Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const tencentcloudcos = require('cos-nodejs-sdk-v5');
const tencentcloud = require('tencentcloud-sdk-nodejs');
const ClientProfile = require('tencentcloud-sdk-nodejs/tencentcloud/common/profile/client_profile.js');
const HttpProfile = require('tencentcloud-sdk-nodejs/tencentcloud/common/profile/http_profile.js');
const assert = require('assert');
const COS = require('cos-nodejs-sdk-v5');
const Credential = tencentcloud.common.Credential;
const ScfClient = tencentcloud.scf.v20180416.Client;
const TagClient = tencentcloud.tag.v20180813.Client;
const MonitorClinet = tencentcloud.monitor.v20180724.Client;
class AbstractHandler {
constructor(appid, secret_id, secret_key, options) {
this.appid = appid;
this.secret_id = secret_id;
this.secret_key = secret_key;
this.options = options;
assert(options, 'options should not is empty');
this._scfClient = AbstractHandler.createScfClient(secret_id, secret_key, options);
this._cosClient = AbstractHandler.createCosClient(secret_id, secret_key, options);
this._tagClient = AbstractHandler.createTagClient(secret_id, secret_key, options);
this._monitorClient = AbstractHandler.createMonitorClient(secret_id, secret_key, options);
}
const tencentcloud = require('tencentcloud-sdk-nodejs')
const ClientProfile = require('tencentcloud-sdk-nodejs/tencentcloud/common/profile/client_profile.js')
const HttpProfile = require('tencentcloud-sdk-nodejs/tencentcloud/common/profile/http_profile.js')
const assert = require('assert')
const COS = require('cos-nodejs-sdk-v5')
const { Credential } = tencentcloud.common
const ScfClient = tencentcloud.scf.v20180416.Client
const CamClient = tencentcloud.cam.v20190116.Client
const TagClient = tencentcloud.tag.v20180813.Client
class AbstractHandler {
constructor({ appid, secret_id, secret_key, options, context }) {
this.appid = appid
this.options = options
this.context = context
assert(options, 'Options should not is empty')
this._scfClient = AbstractHandler.createScfClient(secret_id, secret_key, options)
this._tagClient = AbstractHandler.createTagClient(secret_id, secret_key, options)
this._cosClient = AbstractHandler.createCosClient(secret_id, secret_key, options)
this._camClient = AbstractHandler.createCamClient(secret_id, secret_key, options)
}
static getClientInfo(secret_id, secret_key, options) {
const cred = options.token
? new Credential(secret_id, secret_key, options.token)