tencentcloud-sdk-nodejs 4.1.120 → 4.1.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/common/credential.js +209 -0
- package/es/common/index.js +1 -0
- package/es/common/sdk_version.js +1 -1
- package/es/services/ccc/v20200210/ccc_client.js +5 -2
- package/es/services/cdn/v20180606/cdn_client.js +2 -11
- package/es/services/iotexplorer/v20190423/iotexplorer_client.js +5 -2
- package/es/services/lke/v20231130/lke_client.js +0 -6
- package/es/services/mps/v20190612/mps_client.js +16 -4
- package/package.json +3 -1
- package/tencentcloud/common/credential.d.ts +101 -0
- package/tencentcloud/common/credential.js +267 -0
- package/tencentcloud/common/cvm_role_credential.d.ts +2 -7
- package/tencentcloud/common/index.d.ts +1 -0
- package/tencentcloud/common/index.js +1 -0
- package/tencentcloud/common/interface.d.ts +7 -0
- package/tencentcloud/common/sdk_version.d.ts +1 -1
- package/tencentcloud/common/sdk_version.js +1 -1
- package/tencentcloud/services/ai3d/v20250513/ai3d_client.d.ts +2 -2
- package/tencentcloud/services/ai3d/v20250513/ai3d_client.js +2 -2
- package/tencentcloud/services/ai3d/v20250513/ai3d_models.d.ts +1 -1
- package/tencentcloud/services/billing/v20180709/billing_models.d.ts +1 -1
- package/tencentcloud/services/ccc/v20200210/ccc_client.d.ts +7 -3
- package/tencentcloud/services/ccc/v20200210/ccc_client.js +9 -3
- package/tencentcloud/services/ccc/v20200210/ccc_models.d.ts +49 -0
- package/tencentcloud/services/cdn/v20180606/cdn_client.d.ts +3 -20
- package/tencentcloud/services/cdn/v20180606/cdn_client.js +3 -26
- package/tencentcloud/services/cdn/v20180606/cdn_models.d.ts +95 -244
- package/tencentcloud/services/cfw/v20190904/cfw_models.d.ts +45 -1
- package/tencentcloud/services/ckafka/v20190819/ckafka_models.d.ts +18 -1
- package/tencentcloud/services/ctem/v20231128/ctem_models.d.ts +116 -0
- package/tencentcloud/services/emr/v20190103/emr_models.d.ts +14 -0
- package/tencentcloud/services/ess/v20201111/ess_client.d.ts +3 -3
- package/tencentcloud/services/ess/v20201111/ess_client.js +3 -3
- package/tencentcloud/services/ess/v20201111/ess_models.d.ts +4 -4
- package/tencentcloud/services/essbasic/v20210526/essbasic_models.d.ts +1 -1
- package/tencentcloud/services/iai/v20180301/iai_client.d.ts +0 -1
- package/tencentcloud/services/iai/v20180301/iai_client.js +0 -1
- package/tencentcloud/services/iai/v20180301/iai_models.d.ts +30 -31
- package/tencentcloud/services/iotexplorer/v20190423/iotexplorer_client.d.ts +7 -3
- package/tencentcloud/services/iotexplorer/v20190423/iotexplorer_client.js +9 -3
- package/tencentcloud/services/iotexplorer/v20190423/iotexplorer_models.d.ts +43 -0
- package/tencentcloud/services/lcic/v20220817/lcic_models.d.ts +12 -3
- package/tencentcloud/services/lighthouse/v20200324/lighthouse_models.d.ts +75 -6
- package/tencentcloud/services/lke/v20231130/lke_client.d.ts +1 -9
- package/tencentcloud/services/lke/v20231130/lke_client.js +0 -12
- package/tencentcloud/services/lke/v20231130/lke_models.d.ts +5204 -5256
- package/tencentcloud/services/lkeap/v20240522/lkeap_client.d.ts +5 -2
- package/tencentcloud/services/lkeap/v20240522/lkeap_client.js +5 -2
- package/tencentcloud/services/mongodb/v20190725/mongodb_client.d.ts +1 -1
- package/tencentcloud/services/mongodb/v20190725/mongodb_client.js +1 -1
- package/tencentcloud/services/mongodb/v20190725/mongodb_models.d.ts +43 -29
- package/tencentcloud/services/mps/v20190612/mps_client.d.ts +21 -5
- package/tencentcloud/services/mps/v20190612/mps_client.js +30 -6
- package/tencentcloud/services/mps/v20190612/mps_models.d.ts +339 -130
- package/tencentcloud/services/organization/v20210331/organization_models.d.ts +3 -3
- package/tencentcloud/services/redis/v20180412/redis_client.d.ts +2 -2
- package/tencentcloud/services/redis/v20180412/redis_client.js +2 -2
- package/tencentcloud/services/redis/v20180412/redis_models.d.ts +8 -6
- package/tencentcloud/services/tcss/v20201101/tcss_models.d.ts +8 -0
- package/tencentcloud/services/teo/v20220901/teo_models.d.ts +4 -0
- package/tencentcloud/services/trtc/v20190722/trtc_models.d.ts +14 -6
- package/tencentcloud/services/tse/v20201207/tse_client.d.ts +1 -1
- package/tencentcloud/services/tse/v20201207/tse_client.js +1 -1
- package/tencentcloud/services/tse/v20201207/tse_models.d.ts +24 -0
- package/tencentcloud/services/waf/v20180125/waf_client.d.ts +1 -1
- package/tencentcloud/services/waf/v20180125/waf_client.js +1 -1
- package/tencentcloud/services/waf/v20180125/waf_models.d.ts +310 -33
@@ -0,0 +1,209 @@
|
|
1
|
+
import fs from "fs";
|
2
|
+
import path from "path";
|
3
|
+
import { homedir } from "os";
|
4
|
+
import { parse } from "ini";
|
5
|
+
import { CommonClient } from "./common_client";
|
6
|
+
import CvmRoleCredential from "./cvm_role_credential";
|
7
|
+
const EXPIRE_BUFFER = 30 * 1000;
|
8
|
+
export class BasicCredential {
|
9
|
+
constructor(secretId, secretKey, token) {
|
10
|
+
this.secretId = secretId;
|
11
|
+
this.secretKey = secretKey;
|
12
|
+
this.token = token;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
export class EnvironmentVariableCredential {
|
16
|
+
async getCredential() {
|
17
|
+
const secretId = process.env.TENCENTCLOUD_SECRET_ID;
|
18
|
+
const secretKey = process.env.TENCENTCLOUD_SECRET_KEY;
|
19
|
+
const token = process.env.TENCENTCLOUD_SESSION_TOKEN;
|
20
|
+
return new BasicCredential(secretId, secretKey, token);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
export class ProfileCredential {
|
24
|
+
async getCredential() {
|
25
|
+
let filePath = "";
|
26
|
+
const userHome = homedir();
|
27
|
+
const userCredentialsPath = path.join(userHome, ".tencentcloud", "credentials");
|
28
|
+
if (fs.existsSync(userCredentialsPath)) {
|
29
|
+
filePath = userCredentialsPath;
|
30
|
+
}
|
31
|
+
else {
|
32
|
+
filePath = "/etc/tencentcloud/credentials";
|
33
|
+
}
|
34
|
+
if (filePath) {
|
35
|
+
try {
|
36
|
+
const content = fs.readFileSync(filePath, "utf8");
|
37
|
+
const { default: { secret_id, secret_key, token }, } = parse(content);
|
38
|
+
if (secret_id && secret_key) {
|
39
|
+
return new BasicCredential(secret_id, secret_key, token);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
catch (error) {
|
43
|
+
}
|
44
|
+
}
|
45
|
+
return new BasicCredential("", "");
|
46
|
+
}
|
47
|
+
}
|
48
|
+
export class STSCredential {
|
49
|
+
constructor(clientConfig, assumeRoleParams) {
|
50
|
+
this.clientConfig = clientConfig;
|
51
|
+
this.assumeRoleParams = assumeRoleParams;
|
52
|
+
this.endpoint = "sts.tencentcloudapi.com";
|
53
|
+
this.version = "2018-08-13";
|
54
|
+
this.action = "AssumeRole";
|
55
|
+
this.region = "ap-guangzhou";
|
56
|
+
}
|
57
|
+
async getCredentialWithStsAssumeRole() {
|
58
|
+
const { endpoint, version, action, region, clientConfig, assumeRoleParams } = this;
|
59
|
+
try {
|
60
|
+
const client = new CommonClient(endpoint, version, {
|
61
|
+
region,
|
62
|
+
...clientConfig,
|
63
|
+
});
|
64
|
+
const result = await client.request(action, assumeRoleParams);
|
65
|
+
return {
|
66
|
+
TmpSecretId: result.Credentials.TmpSecretId,
|
67
|
+
TmpSecretKey: result.Credentials.TmpSecretKey,
|
68
|
+
Token: result.Credentials.Token,
|
69
|
+
ExpiredTime: result.ExpiredTime,
|
70
|
+
Expiration: result.Expiration,
|
71
|
+
};
|
72
|
+
}
|
73
|
+
catch (error) {
|
74
|
+
throw new Error(`Get STS AssumeRole failed: ${error.message}`);
|
75
|
+
}
|
76
|
+
}
|
77
|
+
async getCredential() {
|
78
|
+
if (!this.credentialTask) {
|
79
|
+
this.credentialTask = this.getCredentialWithStsAssumeRole();
|
80
|
+
}
|
81
|
+
const credential = await this.credentialTask;
|
82
|
+
if (credential.ExpiredTime * 1000 - EXPIRE_BUFFER <= Date.now()) {
|
83
|
+
this.credentialTask = null;
|
84
|
+
return this.getCredential();
|
85
|
+
}
|
86
|
+
return {
|
87
|
+
secretId: credential.TmpSecretId,
|
88
|
+
secretKey: credential.TmpSecretKey,
|
89
|
+
token: credential.Token,
|
90
|
+
};
|
91
|
+
}
|
92
|
+
}
|
93
|
+
export { default as CvmRoleCredential } from "./cvm_role_credential";
|
94
|
+
export class OIDCRoleArnCredential {
|
95
|
+
constructor(clientConfig, assumeRoleWithWebIdentityParams) {
|
96
|
+
this.endpoint = "sts.tencentcloudapi.com";
|
97
|
+
this.version = "2018-08-13";
|
98
|
+
this.action = "AssumeRoleWithWebIdentity";
|
99
|
+
this.defaultSessionName = "tencentcloud-node-sdk-";
|
100
|
+
this.isTke = false;
|
101
|
+
this.expirationReservationTime = 600;
|
102
|
+
if (clientConfig && assumeRoleWithWebIdentityParams) {
|
103
|
+
this.clientConfig = clientConfig;
|
104
|
+
this.assumeRoleWithWebIdentityParams = assumeRoleWithWebIdentityParams;
|
105
|
+
}
|
106
|
+
else {
|
107
|
+
this.isTke = true;
|
108
|
+
this.clientConfig = {
|
109
|
+
credential: new BasicCredential("", ""),
|
110
|
+
...clientConfig,
|
111
|
+
};
|
112
|
+
}
|
113
|
+
}
|
114
|
+
initFromTke() {
|
115
|
+
const region = process.env.TKE_REGION;
|
116
|
+
if (!region) {
|
117
|
+
throw new Error("env TKE_REGION not exist");
|
118
|
+
}
|
119
|
+
const providerId = process.env.TKE_PROVIDER_ID;
|
120
|
+
if (!providerId) {
|
121
|
+
throw new Error("env TKE_PROVIDER_ID not exist");
|
122
|
+
}
|
123
|
+
const tokenFile = process.env.TKE_WEB_IDENTITY_TOKEN_FILE;
|
124
|
+
if (!tokenFile) {
|
125
|
+
throw new Error("env TKE_WEB_IDENTITY_TOKEN_FILE not exist");
|
126
|
+
}
|
127
|
+
let wbIdentityToken;
|
128
|
+
try {
|
129
|
+
wbIdentityToken = fs.readFileSync(tokenFile).toString();
|
130
|
+
}
|
131
|
+
catch (error) {
|
132
|
+
throw new Error(`failed to read token file: ${error.message}`);
|
133
|
+
}
|
134
|
+
const roleArn = process.env.TKE_ROLE_ARN;
|
135
|
+
if (!roleArn) {
|
136
|
+
throw new Error("env TKE_ROLE_ARN not exist");
|
137
|
+
}
|
138
|
+
this.clientConfig.region = region;
|
139
|
+
this.assumeRoleWithWebIdentityParams = {
|
140
|
+
RoleArn: roleArn,
|
141
|
+
RoleSessionName: `${this.defaultSessionName}${Date.now() * 1000}`,
|
142
|
+
WebIdentityToken: wbIdentityToken,
|
143
|
+
ProviderId: providerId,
|
144
|
+
};
|
145
|
+
}
|
146
|
+
async getCredentialWithStsAssumeRoleWithWebIdentity() {
|
147
|
+
try {
|
148
|
+
if (this.isTke) {
|
149
|
+
this.initFromTke();
|
150
|
+
}
|
151
|
+
const { endpoint, version, action, region, clientConfig, assumeRoleWithWebIdentityParams } = this;
|
152
|
+
const client = new CommonClient(endpoint, version, {
|
153
|
+
region: region,
|
154
|
+
...clientConfig,
|
155
|
+
});
|
156
|
+
const result = await client.request(action, assumeRoleWithWebIdentityParams);
|
157
|
+
return {
|
158
|
+
TmpSecretId: result.Credentials.TmpSecretId,
|
159
|
+
TmpSecretKey: result.Credentials.TmpSecretKey,
|
160
|
+
Token: result.Credentials.Token,
|
161
|
+
ExpiredTime: result.ExpiredTime,
|
162
|
+
Expiration: result.Expiration,
|
163
|
+
};
|
164
|
+
}
|
165
|
+
catch (error) {
|
166
|
+
throw new Error(`Get STS AssumeRoleWithWebIdentity failed: ${error.message}`);
|
167
|
+
}
|
168
|
+
}
|
169
|
+
async getCredential() {
|
170
|
+
if (!this.credentialTask) {
|
171
|
+
this.credentialTask = this.getCredentialWithStsAssumeRoleWithWebIdentity();
|
172
|
+
}
|
173
|
+
const credential = await this.credentialTask;
|
174
|
+
if (credential.ExpiredTime * 1000 - this.expirationReservationTime <= Date.now()) {
|
175
|
+
this.credentialTask = null;
|
176
|
+
return this.getCredential();
|
177
|
+
}
|
178
|
+
return {
|
179
|
+
secretId: credential.TmpSecretId,
|
180
|
+
secretKey: credential.TmpSecretKey,
|
181
|
+
token: credential.Token,
|
182
|
+
};
|
183
|
+
}
|
184
|
+
}
|
185
|
+
export class DefaultCredentialProvider {
|
186
|
+
constructor() {
|
187
|
+
this.providers = [
|
188
|
+
new EnvironmentVariableCredential(),
|
189
|
+
new ProfileCredential(),
|
190
|
+
new CvmRoleCredential(),
|
191
|
+
new OIDCRoleArnCredential(),
|
192
|
+
];
|
193
|
+
}
|
194
|
+
async getCredential() {
|
195
|
+
for (const provider of this.providers) {
|
196
|
+
try {
|
197
|
+
const credential = await provider.getCredential();
|
198
|
+
if (credential.secretId && credential.secretKey) {
|
199
|
+
return credential;
|
200
|
+
}
|
201
|
+
}
|
202
|
+
catch (error) {
|
203
|
+
console.error(error);
|
204
|
+
continue;
|
205
|
+
}
|
206
|
+
}
|
207
|
+
return new BasicCredential("", "");
|
208
|
+
}
|
209
|
+
}
|
package/es/common/index.js
CHANGED
package/es/common/sdk_version.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const sdkVersion = "4.1.
|
1
|
+
export const sdkVersion = "4.1.122";
|
@@ -9,8 +9,8 @@ export class Client extends AbstractClient {
|
|
9
9
|
async ModifyCompanyApply(req, cb) {
|
10
10
|
return this.request("ModifyCompanyApply", req, cb);
|
11
11
|
}
|
12
|
-
async
|
13
|
-
return this.request("
|
12
|
+
async DescribeAIAnalysisResult(req, cb) {
|
13
|
+
return this.request("DescribeAIAnalysisResult", req, cb);
|
14
14
|
}
|
15
15
|
async DescribeExtensions(req, cb) {
|
16
16
|
return this.request("DescribeExtensions", req, cb);
|
@@ -84,6 +84,9 @@ export class Client extends AbstractClient {
|
|
84
84
|
async UploadIvrAudio(req, cb) {
|
85
85
|
return this.request("UploadIvrAudio", req, cb);
|
86
86
|
}
|
87
|
+
async ModifyStaff(req, cb) {
|
88
|
+
return this.request("ModifyStaff", req, cb);
|
89
|
+
}
|
87
90
|
async DescribeExtension(req, cb) {
|
88
91
|
return this.request("DescribeExtension", req, cb);
|
89
92
|
}
|
@@ -66,8 +66,8 @@ export class Client extends AbstractClient {
|
|
66
66
|
async DescribeCertDomains(req, cb) {
|
67
67
|
return this.request("DescribeCertDomains", req, cb);
|
68
68
|
}
|
69
|
-
async
|
70
|
-
return this.request("
|
69
|
+
async ListTopClsLogData(req, cb) {
|
70
|
+
return this.request("ListTopClsLogData", req, cb);
|
71
71
|
}
|
72
72
|
async ListDiagnoseReport(req, cb) {
|
73
73
|
return this.request("ListDiagnoseReport", req, cb);
|
@@ -144,9 +144,6 @@ export class Client extends AbstractClient {
|
|
144
144
|
async ListClsLogTopics(req, cb) {
|
145
145
|
return this.request("ListClsLogTopics", req, cb);
|
146
146
|
}
|
147
|
-
async GetDisableRecords(req, cb) {
|
148
|
-
return this.request("GetDisableRecords", req, cb);
|
149
|
-
}
|
150
147
|
async DeleteClsLogTopic(req, cb) {
|
151
148
|
return this.request("DeleteClsLogTopic", req, cb);
|
152
149
|
}
|
@@ -171,10 +168,4 @@ export class Client extends AbstractClient {
|
|
171
168
|
async UpdatePayType(req, cb) {
|
172
169
|
return this.request("UpdatePayType", req, cb);
|
173
170
|
}
|
174
|
-
async EnableCaches(req, cb) {
|
175
|
-
return this.request("EnableCaches", req, cb);
|
176
|
-
}
|
177
|
-
async ListTopClsLogData(req, cb) {
|
178
|
-
return this.request("ListTopClsLogData", req, cb);
|
179
|
-
}
|
180
171
|
}
|
@@ -336,8 +336,8 @@ export class Client extends AbstractClient {
|
|
336
336
|
async BindProducts(req, cb) {
|
337
337
|
return this.request("BindProducts", req, cb);
|
338
338
|
}
|
339
|
-
async
|
340
|
-
return this.request("
|
339
|
+
async DescribeSubscribedTopicPolicy(req, cb) {
|
340
|
+
return this.request("DescribeSubscribedTopicPolicy", req, cb);
|
341
341
|
}
|
342
342
|
async SearchPositionSpace(req, cb) {
|
343
343
|
return this.request("SearchPositionSpace", req, cb);
|
@@ -372,6 +372,9 @@ export class Client extends AbstractClient {
|
|
372
372
|
async DescribeDeviceFirmwares(req, cb) {
|
373
373
|
return this.request("DescribeDeviceFirmwares", req, cb);
|
374
374
|
}
|
375
|
+
async RemoveUserByRoomIdFromTRTC(req, cb) {
|
376
|
+
return this.request("RemoveUserByRoomIdFromTRTC", req, cb);
|
377
|
+
}
|
375
378
|
async BindDevices(req, cb) {
|
376
379
|
return this.request("BindDevices", req, cb);
|
377
380
|
}
|
@@ -33,9 +33,6 @@ export class Client extends AbstractClient {
|
|
33
33
|
async StopWorkflowRun(req, cb) {
|
34
34
|
return this.request("StopWorkflowRun", req, cb);
|
35
35
|
}
|
36
|
-
async ModifyAgent(req, cb) {
|
37
|
-
return this.request("ModifyAgent", req, cb);
|
38
|
-
}
|
39
36
|
async CreateAttributeLabel(req, cb) {
|
40
37
|
return this.request("CreateAttributeLabel", req, cb);
|
41
38
|
}
|
@@ -204,9 +201,6 @@ export class Client extends AbstractClient {
|
|
204
201
|
async ExportQAList(req, cb) {
|
205
202
|
return this.request("ExportQAList", req, cb);
|
206
203
|
}
|
207
|
-
async CreateAgent(req, cb) {
|
208
|
-
return this.request("CreateAgent", req, cb);
|
209
|
-
}
|
210
204
|
async UploadAttributeLabel(req, cb) {
|
211
205
|
return this.request("UploadAttributeLabel", req, cb);
|
212
206
|
}
|
@@ -126,6 +126,9 @@ export class Client extends AbstractClient {
|
|
126
126
|
async CreateContentReviewTemplate(req, cb) {
|
127
127
|
return this.request("CreateContentReviewTemplate", req, cb);
|
128
128
|
}
|
129
|
+
async ModifyStreamLinkOutputInfo(req, cb) {
|
130
|
+
return this.request("ModifyStreamLinkOutputInfo", req, cb);
|
131
|
+
}
|
129
132
|
async DescribeGroupAttachFlowsById(req, cb) {
|
130
133
|
return this.request("DescribeGroupAttachFlowsById", req, cb);
|
131
134
|
}
|
@@ -183,6 +186,12 @@ export class Client extends AbstractClient {
|
|
183
186
|
async ModifyStreamLinkInput(req, cb) {
|
184
187
|
return this.request("ModifyStreamLinkInput", req, cb);
|
185
188
|
}
|
189
|
+
async DescribeSmartEraseTemplates(req, cb) {
|
190
|
+
return this.request("DescribeSmartEraseTemplates", req, cb);
|
191
|
+
}
|
192
|
+
async ModifySmartEraseTemplate(req, cb) {
|
193
|
+
return this.request("ModifySmartEraseTemplate", req, cb);
|
194
|
+
}
|
186
195
|
async CreateSmartSubtitleTemplate(req, cb) {
|
187
196
|
return this.request("CreateSmartSubtitleTemplate", req, cb);
|
188
197
|
}
|
@@ -219,8 +228,8 @@ export class Client extends AbstractClient {
|
|
219
228
|
async DescribeSmartSubtitleTemplates(req, cb) {
|
220
229
|
return this.request("DescribeSmartSubtitleTemplates", req, cb);
|
221
230
|
}
|
222
|
-
async
|
223
|
-
return this.request("
|
231
|
+
async ModifyAIRecognitionTemplate(req, cb) {
|
232
|
+
return this.request("ModifyAIRecognitionTemplate", req, cb);
|
224
233
|
}
|
225
234
|
async DescribeSnapshotByTimeOffsetTemplates(req, cb) {
|
226
235
|
return this.request("DescribeSnapshotByTimeOffsetTemplates", req, cb);
|
@@ -378,6 +387,9 @@ export class Client extends AbstractClient {
|
|
378
387
|
async DisassociateSecurityGroup(req, cb) {
|
379
388
|
return this.request("DisassociateSecurityGroup", req, cb);
|
380
389
|
}
|
390
|
+
async CreateSmartEraseTemplate(req, cb) {
|
391
|
+
return this.request("CreateSmartEraseTemplate", req, cb);
|
392
|
+
}
|
381
393
|
async ModifyContentReviewTemplate(req, cb) {
|
382
394
|
return this.request("ModifyContentReviewTemplate", req, cb);
|
383
395
|
}
|
@@ -387,8 +399,8 @@ export class Client extends AbstractClient {
|
|
387
399
|
async BatchStopStreamLinkFlow(req, cb) {
|
388
400
|
return this.request("BatchStopStreamLinkFlow", req, cb);
|
389
401
|
}
|
390
|
-
async
|
391
|
-
return this.request("
|
402
|
+
async DeleteSmartEraseTemplate(req, cb) {
|
403
|
+
return this.request("DeleteSmartEraseTemplate", req, cb);
|
392
404
|
}
|
393
405
|
async DeleteStreamLinkEvent(req, cb) {
|
394
406
|
return this.request("DeleteStreamLinkEvent", req, cb);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "tencentcloud-sdk-nodejs",
|
3
|
-
"version": "4.1.
|
3
|
+
"version": "4.1.122",
|
4
4
|
"description": "腾讯云 API NODEJS SDK",
|
5
5
|
"main": "./tencentcloud/index.js",
|
6
6
|
"module": "./es/index.js",
|
@@ -36,6 +36,7 @@
|
|
36
36
|
"form-data": "^3.0.4",
|
37
37
|
"get-stream": "^6.0.0",
|
38
38
|
"https-proxy-agent": "^5.0.0",
|
39
|
+
"ini": "^5.0.0",
|
39
40
|
"is-stream": "^2.0.0",
|
40
41
|
"json-bigint": "^1.0.0",
|
41
42
|
"node-fetch": "^2.2.0",
|
@@ -51,6 +52,7 @@
|
|
51
52
|
"url": "https://github.com/tencentcloud/tencentcloud-sdk-nodejs"
|
52
53
|
},
|
53
54
|
"devDependencies": {
|
55
|
+
"@types/ini": "^4.1.1",
|
54
56
|
"@types/json-bigint": "^1.0.1",
|
55
57
|
"@types/node": "^18.0.0",
|
56
58
|
"@types/node-fetch": "^2.5.7",
|
@@ -0,0 +1,101 @@
|
|
1
|
+
import { ClientConfig, Credential, CredentialResult, DynamicCredential } from "./interface";
|
2
|
+
/**
|
3
|
+
* Basic credential with secret id and secret key
|
4
|
+
*/
|
5
|
+
export declare class BasicCredential implements Credential {
|
6
|
+
readonly secretId: string;
|
7
|
+
readonly secretKey: string;
|
8
|
+
readonly token?: string;
|
9
|
+
constructor(secretId: string, secretKey: string, token?: string);
|
10
|
+
}
|
11
|
+
/**
|
12
|
+
* Environment variable credential
|
13
|
+
* Get credential from environment variables:
|
14
|
+
* - TENCENTCLOUD_SECRET_ID
|
15
|
+
* - TENCENTCLOUD_SECRET_KEY
|
16
|
+
* - TENCENTCLOUD_SESSION_TOKEN (optional)
|
17
|
+
*/
|
18
|
+
export declare class EnvironmentVariableCredential implements DynamicCredential {
|
19
|
+
getCredential(): Promise<Credential>;
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* Profile credential
|
23
|
+
* Get credential from profile file ~/.tencentcloud/credentials or /etc/tencentcloud/credentials
|
24
|
+
* example credentials file:
|
25
|
+
* [default]
|
26
|
+
* secret_id = your-secret-id
|
27
|
+
* secret_key = your-secret-key
|
28
|
+
*/
|
29
|
+
export declare class ProfileCredential implements DynamicCredential {
|
30
|
+
getCredential(): Promise<Credential>;
|
31
|
+
}
|
32
|
+
interface AssumeRoleParams {
|
33
|
+
RoleArn: string;
|
34
|
+
RoleSessionName: string;
|
35
|
+
[key: string]: any;
|
36
|
+
}
|
37
|
+
/**
|
38
|
+
* Tencent Cloud Credential via STS service
|
39
|
+
* @see {@link https://cloud.tencent.com/document/api/1312/48197} for more information.
|
40
|
+
*/
|
41
|
+
export declare class STSCredential implements DynamicCredential {
|
42
|
+
private clientConfig;
|
43
|
+
private assumeRoleParams;
|
44
|
+
private endpoint;
|
45
|
+
private version;
|
46
|
+
private action;
|
47
|
+
private region;
|
48
|
+
credentialTask: Promise<CredentialResult> | null;
|
49
|
+
/**
|
50
|
+
* Constructs a new STSCredential instance
|
51
|
+
*
|
52
|
+
* @param {ClientConfig} clientConfig Request client Configuration object
|
53
|
+
* @param {AssumeRoleParams} assumeRoleParams Request parameters of the AssumeRole interface
|
54
|
+
* @see {@link https://cloud.tencent.com/document/api/1312/48197} for more AssumeRoleParams information.
|
55
|
+
*/
|
56
|
+
constructor(clientConfig: ClientConfig, assumeRoleParams: AssumeRoleParams);
|
57
|
+
protected getCredentialWithStsAssumeRole(): Promise<CredentialResult>;
|
58
|
+
getCredential(): Promise<Credential>;
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* CVM Role credential using existing implementation
|
62
|
+
* Re-export the existing CvmRoleCredential for consistency
|
63
|
+
*/
|
64
|
+
export { default as CvmRoleCredential } from "./cvm_role_credential";
|
65
|
+
/**
|
66
|
+
* TencentCloud OIDC Credential
|
67
|
+
* OIDC is an authentication protocol built on OAuth 2.0. Tencent Cloud CAM supports OIDC role-based SSO.
|
68
|
+
* @see {@link https://cloud.tencent.com/document/product/598/96013} for more information.
|
69
|
+
*/
|
70
|
+
export declare class OIDCRoleArnCredential implements DynamicCredential {
|
71
|
+
private endpoint;
|
72
|
+
private version;
|
73
|
+
private action;
|
74
|
+
private clientConfig;
|
75
|
+
private assumeRoleWithWebIdentityParams;
|
76
|
+
private defaultSessionName;
|
77
|
+
private isTke;
|
78
|
+
protected region: string;
|
79
|
+
protected expirationReservationTime: number;
|
80
|
+
protected credentialTask: Promise<CredentialResult> | null;
|
81
|
+
/**
|
82
|
+
* Constructs a new OIDCRoleArnCredential instance
|
83
|
+
*
|
84
|
+
* @param {ClientConfig} [clientConfig] Optional request client Configuration object
|
85
|
+
* @param {AssumeRoleParams} [assumeRoleParams] Optional request parameters of the AssumeRole interface
|
86
|
+
* @see {@link https://cloud.tencent.com/document/api/1312/48197} for more AssumeRoleWithWebIdentity information.
|
87
|
+
*/
|
88
|
+
constructor();
|
89
|
+
constructor(clientConfig: ClientConfig, assumeRoleWithWebIdentityParams: AssumeRoleParams);
|
90
|
+
private initFromTke;
|
91
|
+
protected getCredentialWithStsAssumeRoleWithWebIdentity(): Promise<CredentialResult>;
|
92
|
+
getCredential(): Promise<Credential>;
|
93
|
+
}
|
94
|
+
/**
|
95
|
+
* Tencent Cloud DefaultCredentialProvider
|
96
|
+
*/
|
97
|
+
export declare class DefaultCredentialProvider implements DynamicCredential {
|
98
|
+
private readonly providers;
|
99
|
+
constructor();
|
100
|
+
getCredential(): Promise<Credential>;
|
101
|
+
}
|