tencentcloud-sdk-nodejs 4.1.217 → 4.1.219
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/abstract_client.js +1 -0
- package/es/common/credential.js +7 -4
- package/es/common/http/http_connection.js +19 -14
- package/es/common/sdk_version.js +1 -1
- package/es/services/bi/v20220105/bi_client.js +43 -4
- package/es/services/ckafka/v20190819/ckafka_client.js +6 -0
- package/es/services/cme/v20191029/cme_client.js +6 -0
- package/es/services/es/v20180416/es_client.js +8 -2
- package/es/services/mqtt/v20240516/mqtt_client.js +3 -0
- package/es/services/vod/v20180717/vod_client.js +5 -2
- package/package.json +2 -2
- package/tencentcloud/common/abstract_client.d.ts +5 -0
- package/tencentcloud/common/abstract_client.js +1 -0
- package/tencentcloud/common/credential.js +7 -4
- package/tencentcloud/common/http/http_connection.d.ts +2 -1
- package/tencentcloud/common/http/http_connection.js +19 -14
- package/tencentcloud/common/sdk_version.d.ts +1 -1
- package/tencentcloud/common/sdk_version.js +1 -1
- package/tencentcloud/services/aiart/v20221229/aiart_models.d.ts +4 -4
- package/tencentcloud/services/ams/v20201229/ams_models.d.ts +70 -22
- package/tencentcloud/services/apis/v20240801/apis_models.d.ts +115 -69
- package/tencentcloud/services/apm/v20210622/apm_models.d.ts +23 -47
- package/tencentcloud/services/bi/v20220105/bi_client.d.ts +57 -5
- package/tencentcloud/services/bi/v20220105/bi_client.js +84 -6
- package/tencentcloud/services/bi/v20220105/bi_models.d.ts +986 -129
- package/tencentcloud/services/billing/v20180709/billing_models.d.ts +280 -404
- package/tencentcloud/services/cdb/v20170320/cdb_models.d.ts +86 -102
- package/tencentcloud/services/cfw/v20190904/cfw_models.d.ts +65 -24
- package/tencentcloud/services/ckafka/v20190819/ckafka_client.d.ts +22 -14
- package/tencentcloud/services/ckafka/v20190819/ckafka_client.js +25 -13
- package/tencentcloud/services/ckafka/v20190819/ckafka_models.d.ts +373 -252
- package/tencentcloud/services/clb/v20180317/clb_client.d.ts +0 -1
- package/tencentcloud/services/clb/v20180317/clb_client.js +0 -1
- package/tencentcloud/services/clb/v20180317/clb_models.d.ts +4 -0
- package/tencentcloud/services/cls/v20201016/cls_models.d.ts +48 -18
- package/tencentcloud/services/cme/v20191029/cme_client.d.ts +9 -1
- package/tencentcloud/services/cme/v20191029/cme_client.js +12 -0
- package/tencentcloud/services/cme/v20191029/cme_models.d.ts +130 -78
- package/tencentcloud/services/dc/v20180410/dc_models.d.ts +13 -9
- package/tencentcloud/services/es/v20180416/es_client.d.ts +11 -3
- package/tencentcloud/services/es/v20180416/es_client.js +15 -3
- package/tencentcloud/services/es/v20180416/es_models.d.ts +95 -37
- package/tencentcloud/services/ess/v20201111/ess_models.d.ts +55 -144
- package/tencentcloud/services/fmu/v20191213/fmu_models.d.ts +4 -4
- package/tencentcloud/services/hai/v20230812/hai_models.d.ts +9 -1
- package/tencentcloud/services/mps/v20190612/mps_models.d.ts +38 -26
- package/tencentcloud/services/mqtt/v20240516/mqtt_client.d.ts +5 -1
- package/tencentcloud/services/mqtt/v20240516/mqtt_client.js +6 -0
- package/tencentcloud/services/mqtt/v20240516/mqtt_models.d.ts +61 -0
- package/tencentcloud/services/ocr/v20181119/ocr_models.d.ts +32 -38
- package/tencentcloud/services/sms/v20190711/sms_models.d.ts +4 -4
- package/tencentcloud/services/sms/v20210111/sms_models.d.ts +21 -61
- package/tencentcloud/services/tcb/v20180608/tcb_models.d.ts +17 -92
- package/tencentcloud/services/tdai/v20250717/tdai_client.d.ts +1 -1
- package/tencentcloud/services/tdai/v20250717/tdai_models.d.ts +135 -32
- package/tencentcloud/services/teo/v20220901/teo_models.d.ts +17 -2
- package/tencentcloud/services/vclm/v20240523/vclm_models.d.ts +95 -19
- package/tencentcloud/services/vcube/v20220410/vcube_models.d.ts +33 -25
- package/tencentcloud/services/vod/v20180717/vod_client.d.ts +7 -3
- package/tencentcloud/services/vod/v20180717/vod_client.js +9 -3
- package/tencentcloud/services/vod/v20180717/vod_models.d.ts +97 -16
- package/tencentcloud/services/vpc/v20170312/vpc_models.d.ts +25 -21
- package/tencentcloud/services/wedata/v20210820/wedata_models.d.ts +19 -9
package/es/common/credential.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
|
+
import { promisify } from "util";
|
|
2
3
|
import path from "path";
|
|
3
4
|
import { homedir } from "os";
|
|
4
5
|
import { parse } from "ini";
|
|
@@ -111,7 +112,7 @@ export class OIDCRoleArnCredential {
|
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
|
-
initFromTke() {
|
|
115
|
+
async initFromTke() {
|
|
115
116
|
const region = process.env.TKE_REGION;
|
|
116
117
|
if (!region) {
|
|
117
118
|
throw new Error("env TKE_REGION not exist");
|
|
@@ -126,7 +127,7 @@ export class OIDCRoleArnCredential {
|
|
|
126
127
|
}
|
|
127
128
|
let wbIdentityToken;
|
|
128
129
|
try {
|
|
129
|
-
wbIdentityToken = fs.
|
|
130
|
+
wbIdentityToken = (await promisify(fs.readFile)(tokenFile)).toString();
|
|
130
131
|
}
|
|
131
132
|
catch (error) {
|
|
132
133
|
throw new Error(`failed to read token file: ${error.message}`);
|
|
@@ -146,14 +147,16 @@ export class OIDCRoleArnCredential {
|
|
|
146
147
|
async getCredentialWithStsAssumeRoleWithWebIdentity() {
|
|
147
148
|
try {
|
|
148
149
|
if (this.isTke) {
|
|
149
|
-
this.initFromTke();
|
|
150
|
+
await this.initFromTke();
|
|
150
151
|
}
|
|
151
152
|
const { endpoint, version, action, region, clientConfig, assumeRoleWithWebIdentityParams } = this;
|
|
152
153
|
const client = new CommonClient(endpoint, version, {
|
|
153
154
|
region: region,
|
|
154
155
|
...clientConfig,
|
|
155
156
|
});
|
|
156
|
-
const result = await client.request(action, assumeRoleWithWebIdentityParams
|
|
157
|
+
const result = await client.request(action, assumeRoleWithWebIdentityParams, {
|
|
158
|
+
skipSign: true
|
|
159
|
+
});
|
|
157
160
|
return {
|
|
158
161
|
TmpSecretId: result.Credentials.TmpSecretId,
|
|
159
162
|
TmpSecretKey: result.Credentials.TmpSecretKey,
|
|
@@ -26,7 +26,7 @@ export class HttpConnection {
|
|
|
26
26
|
}
|
|
27
27
|
return await fetch(url, config);
|
|
28
28
|
}
|
|
29
|
-
static async doRequestWithSign3({ method, url, data, service, action, region, version, secretId, secretKey, multipart = false, timeout = 60000, token, requestClient, language, headers = {}, agent, proxy, signal, }) {
|
|
29
|
+
static async doRequestWithSign3({ method, url, data, service, action, region, version, secretId, secretKey, multipart = false, timeout = 60000, token, requestClient, language, headers = {}, agent, proxy, signal, skipSign = false, }) {
|
|
30
30
|
await convertReadStreamToBuffer(data);
|
|
31
31
|
data = deepRemoveNull(data);
|
|
32
32
|
const timestamp = parseInt(String(new Date().getTime() / 1000));
|
|
@@ -83,19 +83,24 @@ export class HttpConnection {
|
|
|
83
83
|
config.body = form;
|
|
84
84
|
config.headers = Object.assign({}, config.headers, form.getHeaders());
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
86
|
+
if (skipSign) {
|
|
87
|
+
config.headers["Authorization"] = "SKIP";
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
const signature = Sign.sign3({
|
|
91
|
+
method,
|
|
92
|
+
url,
|
|
93
|
+
payload,
|
|
94
|
+
timestamp,
|
|
95
|
+
service,
|
|
96
|
+
secretId,
|
|
97
|
+
secretKey,
|
|
98
|
+
multipart,
|
|
99
|
+
boundary: form ? form.getBoundary() : undefined,
|
|
100
|
+
headers: config.headers,
|
|
101
|
+
});
|
|
102
|
+
config.headers["Authorization"] = signature;
|
|
103
|
+
}
|
|
99
104
|
return await fetch(url, config);
|
|
100
105
|
}
|
|
101
106
|
}
|
package/es/common/sdk_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const sdkVersion = "4.1.
|
|
1
|
+
export const sdkVersion = "4.1.219";
|
|
@@ -15,6 +15,9 @@ export class Client extends AbstractClient {
|
|
|
15
15
|
async CreateDatasource(req, cb) {
|
|
16
16
|
return this.request("CreateDatasource", req, cb);
|
|
17
17
|
}
|
|
18
|
+
async DescribeUserGroupTreeList(req, cb) {
|
|
19
|
+
return this.request("DescribeUserGroupTreeList", req, cb);
|
|
20
|
+
}
|
|
18
21
|
async CreatePermissionRanks(req, cb) {
|
|
19
22
|
return this.request("CreatePermissionRanks", req, cb);
|
|
20
23
|
}
|
|
@@ -24,6 +27,9 @@ export class Client extends AbstractClient {
|
|
|
24
27
|
async CreateProject(req, cb) {
|
|
25
28
|
return this.request("CreateProject", req, cb);
|
|
26
29
|
}
|
|
30
|
+
async DeleteUserGroupMember(req, cb) {
|
|
31
|
+
return this.request("DeleteUserGroupMember", req, cb);
|
|
32
|
+
}
|
|
27
33
|
async CreateDatasourceCloud(req, cb) {
|
|
28
34
|
return this.request("CreateDatasourceCloud", req, cb);
|
|
29
35
|
}
|
|
@@ -33,12 +39,18 @@ export class Client extends AbstractClient {
|
|
|
33
39
|
async ModifyUserRole(req, cb) {
|
|
34
40
|
return this.request("ModifyUserRole", req, cb);
|
|
35
41
|
}
|
|
36
|
-
async
|
|
37
|
-
return this.request("
|
|
42
|
+
async DescribeResourceUserGroupPageList(req, cb) {
|
|
43
|
+
return this.request("DescribeResourceUserGroupPageList", req, cb);
|
|
44
|
+
}
|
|
45
|
+
async DeleteUserGroup(req, cb) {
|
|
46
|
+
return this.request("DeleteUserGroup", req, cb);
|
|
38
47
|
}
|
|
39
48
|
async CreateEmbedToken(req, cb) {
|
|
40
49
|
return this.request("CreateEmbedToken", req, cb);
|
|
41
50
|
}
|
|
51
|
+
async DescribeUserGroupInfo(req, cb) {
|
|
52
|
+
return this.request("DescribeUserGroupInfo", req, cb);
|
|
53
|
+
}
|
|
42
54
|
async CreateUserRole(req, cb) {
|
|
43
55
|
return this.request("CreateUserRole", req, cb);
|
|
44
56
|
}
|
|
@@ -48,24 +60,45 @@ export class Client extends AbstractClient {
|
|
|
48
60
|
async DeleteUserRole(req, cb) {
|
|
49
61
|
return this.request("DeleteUserRole", req, cb);
|
|
50
62
|
}
|
|
63
|
+
async ModifyUserGroup(req, cb) {
|
|
64
|
+
return this.request("ModifyUserGroup", req, cb);
|
|
65
|
+
}
|
|
51
66
|
async ModifyProject(req, cb) {
|
|
52
67
|
return this.request("ModifyProject", req, cb);
|
|
53
68
|
}
|
|
54
69
|
async DescribeUserRoleList(req, cb) {
|
|
55
70
|
return this.request("DescribeUserRoleList", req, cb);
|
|
56
71
|
}
|
|
72
|
+
async CreateUserGroup(req, cb) {
|
|
73
|
+
return this.request("CreateUserGroup", req, cb);
|
|
74
|
+
}
|
|
57
75
|
async DescribePageWidgetList(req, cb) {
|
|
58
76
|
return this.request("DescribePageWidgetList", req, cb);
|
|
59
77
|
}
|
|
78
|
+
async ModifyUserRoleProject(req, cb) {
|
|
79
|
+
return this.request("ModifyUserRoleProject", req, cb);
|
|
80
|
+
}
|
|
81
|
+
async ModifyUserDetailInfo(req, cb) {
|
|
82
|
+
return this.request("ModifyUserDetailInfo", req, cb);
|
|
83
|
+
}
|
|
84
|
+
async CreateUserGroupMember(req, cb) {
|
|
85
|
+
return this.request("CreateUserGroupMember", req, cb);
|
|
86
|
+
}
|
|
60
87
|
async DescribeUserRoleProjectList(req, cb) {
|
|
61
88
|
return this.request("DescribeUserRoleProjectList", req, cb);
|
|
62
89
|
}
|
|
90
|
+
async QueryUserGroupMember(req, cb) {
|
|
91
|
+
return this.request("QueryUserGroupMember", req, cb);
|
|
92
|
+
}
|
|
63
93
|
async ModifyDatasourceCloud(req, cb) {
|
|
64
94
|
return this.request("ModifyDatasourceCloud", req, cb);
|
|
65
95
|
}
|
|
66
96
|
async ClearEmbedToken(req, cb) {
|
|
67
97
|
return this.request("ClearEmbedToken", req, cb);
|
|
68
98
|
}
|
|
99
|
+
async DescribeUserGroupMemberList(req, cb) {
|
|
100
|
+
return this.request("DescribeUserGroupMemberList", req, cb);
|
|
101
|
+
}
|
|
69
102
|
async CreateUserRoleProject(req, cb) {
|
|
70
103
|
return this.request("CreateUserRoleProject", req, cb);
|
|
71
104
|
}
|
|
@@ -81,11 +114,17 @@ export class Client extends AbstractClient {
|
|
|
81
114
|
async DescribeUserProjectList(req, cb) {
|
|
82
115
|
return this.request("DescribeUserProjectList", req, cb);
|
|
83
116
|
}
|
|
117
|
+
async ModifyResourceUserGroupResource(req, cb) {
|
|
118
|
+
return this.request("ModifyResourceUserGroupResource", req, cb);
|
|
119
|
+
}
|
|
120
|
+
async ExportScreenPage(req, cb) {
|
|
121
|
+
return this.request("ExportScreenPage", req, cb);
|
|
122
|
+
}
|
|
84
123
|
async DeleteProject(req, cb) {
|
|
85
124
|
return this.request("DeleteProject", req, cb);
|
|
86
125
|
}
|
|
87
|
-
async
|
|
88
|
-
return this.request("
|
|
126
|
+
async ModifyResourceUserGroup(req, cb) {
|
|
127
|
+
return this.request("ModifyResourceUserGroup", req, cb);
|
|
89
128
|
}
|
|
90
129
|
async DescribeProjectList(req, cb) {
|
|
91
130
|
return this.request("DescribeProjectList", req, cb);
|
|
@@ -138,6 +138,9 @@ export class Client extends AbstractClient {
|
|
|
138
138
|
async DescribeRoute(req, cb) {
|
|
139
139
|
return this.request("DescribeRoute", req, cb);
|
|
140
140
|
}
|
|
141
|
+
async ModifyAccessPolicy(req, cb) {
|
|
142
|
+
return this.request("ModifyAccessPolicy", req, cb);
|
|
143
|
+
}
|
|
141
144
|
async ModifyDatahubTask(req, cb) {
|
|
142
145
|
return this.request("ModifyDatahubTask", req, cb);
|
|
143
146
|
}
|
|
@@ -240,6 +243,9 @@ export class Client extends AbstractClient {
|
|
|
240
243
|
async CreateRoute(req, cb) {
|
|
241
244
|
return this.request("CreateRoute", req, cb);
|
|
242
245
|
}
|
|
246
|
+
async DescribeAccessPolicy(req, cb) {
|
|
247
|
+
return this.request("DescribeAccessPolicy", req, cb);
|
|
248
|
+
}
|
|
243
249
|
async DescribeTopicDetail(req, cb) {
|
|
244
250
|
return this.request("DescribeTopicDetail", req, cb);
|
|
245
251
|
}
|
|
@@ -42,6 +42,9 @@ export class Client extends AbstractClient {
|
|
|
42
42
|
async ImportMaterial(req, cb) {
|
|
43
43
|
return this.request("ImportMaterial", req, cb);
|
|
44
44
|
}
|
|
45
|
+
async DeleteAccount(req, cb) {
|
|
46
|
+
return this.request("DeleteAccount", req, cb);
|
|
47
|
+
}
|
|
45
48
|
async ExportVideoByEditorTrackData(req, cb) {
|
|
46
49
|
return this.request("ExportVideoByEditorTrackData", req, cb);
|
|
47
50
|
}
|
|
@@ -126,6 +129,9 @@ export class Client extends AbstractClient {
|
|
|
126
129
|
async ImportMediaToProject(req, cb) {
|
|
127
130
|
return this.request("ImportMediaToProject", req, cb);
|
|
128
131
|
}
|
|
132
|
+
async ForbidAccount(req, cb) {
|
|
133
|
+
return this.request("ForbidAccount", req, cb);
|
|
134
|
+
}
|
|
129
135
|
async ListMedia(req, cb) {
|
|
130
136
|
return this.request("ListMedia", req, cb);
|
|
131
137
|
}
|
|
@@ -81,8 +81,8 @@ export class Client extends AbstractClient {
|
|
|
81
81
|
async CheckMigrateIndexMetaData(req, cb) {
|
|
82
82
|
return this.request("CheckMigrateIndexMetaData", req, cb);
|
|
83
83
|
}
|
|
84
|
-
async
|
|
85
|
-
return this.request("
|
|
84
|
+
async RequestInstances(req, cb) {
|
|
85
|
+
return this.request("RequestInstances", req, cb);
|
|
86
86
|
}
|
|
87
87
|
async DeleteServerlessInstance(req, cb) {
|
|
88
88
|
return this.request("DeleteServerlessInstance", req, cb);
|
|
@@ -147,6 +147,9 @@ export class Client extends AbstractClient {
|
|
|
147
147
|
async QueryIpTraceLog(req, cb) {
|
|
148
148
|
return this.request("QueryIpTraceLog", req, cb);
|
|
149
149
|
}
|
|
150
|
+
async RequestInstancesByGet(req, cb) {
|
|
151
|
+
return this.request("RequestInstancesByGet", req, cb);
|
|
152
|
+
}
|
|
150
153
|
async GetIpTraceStatus(req, cb) {
|
|
151
154
|
return this.request("GetIpTraceStatus", req, cb);
|
|
152
155
|
}
|
|
@@ -213,6 +216,9 @@ export class Client extends AbstractClient {
|
|
|
213
216
|
async DescribeLogstashInstanceOperations(req, cb) {
|
|
214
217
|
return this.request("DescribeLogstashInstanceOperations", req, cb);
|
|
215
218
|
}
|
|
219
|
+
async UpdateIpTraceStatus(req, cb) {
|
|
220
|
+
return this.request("UpdateIpTraceStatus", req, cb);
|
|
221
|
+
}
|
|
216
222
|
async InquirePriceRenewInstance(req, cb) {
|
|
217
223
|
return this.request("InquirePriceRenewInstance", req, cb);
|
|
218
224
|
}
|
|
@@ -189,6 +189,9 @@ export class Client extends AbstractClient {
|
|
|
189
189
|
async ApplyRegistrationCode(req, cb) {
|
|
190
190
|
return this.request("ApplyRegistrationCode", req, cb);
|
|
191
191
|
}
|
|
192
|
+
async DescribeSharedSubscriptionGroups(req, cb) {
|
|
193
|
+
return this.request("DescribeSharedSubscriptionGroups", req, cb);
|
|
194
|
+
}
|
|
192
195
|
async DescribeDeviceIdentities(req, cb) {
|
|
193
196
|
return this.request("DescribeDeviceIdentities", req, cb);
|
|
194
197
|
}
|
|
@@ -231,6 +231,9 @@ export class Client extends AbstractClient {
|
|
|
231
231
|
async ModifyVodDomainAccelerateConfig(req, cb) {
|
|
232
232
|
return this.request("ModifyVodDomainAccelerateConfig", req, cb);
|
|
233
233
|
}
|
|
234
|
+
async ModifyTranscodeTemplate(req, cb) {
|
|
235
|
+
return this.request("ModifyTranscodeTemplate", req, cb);
|
|
236
|
+
}
|
|
234
237
|
async DeleteSuperPlayerConfig(req, cb) {
|
|
235
238
|
return this.request("DeleteSuperPlayerConfig", req, cb);
|
|
236
239
|
}
|
|
@@ -366,8 +369,8 @@ export class Client extends AbstractClient {
|
|
|
366
369
|
async CreateComplexAdaptiveDynamicStreamingTask(req, cb) {
|
|
367
370
|
return this.request("CreateComplexAdaptiveDynamicStreamingTask", req, cb);
|
|
368
371
|
}
|
|
369
|
-
async
|
|
370
|
-
return this.request("
|
|
372
|
+
async CreateAigcVideoRedrawTask(req, cb) {
|
|
373
|
+
return this.request("CreateAigcVideoRedrawTask", req, cb);
|
|
371
374
|
}
|
|
372
375
|
async DescribeContentReviewTemplates(req, cb) {
|
|
373
376
|
return this.request("DescribeContentReviewTemplates", 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.219",
|
|
4
4
|
"description": "腾讯云 API NODEJS SDK",
|
|
5
5
|
"main": "./tencentcloud/index.js",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -36,7 +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": "^
|
|
39
|
+
"ini": "^2.0.0",
|
|
40
40
|
"is-stream": "^2.0.0",
|
|
41
41
|
"json-bigint": "^1.0.0",
|
|
42
42
|
"node-fetch": "^2.2.0",
|
|
@@ -16,6 +16,11 @@ export interface RequestOptions extends Partial<Pick<HttpProfile, "headers">> {
|
|
|
16
16
|
* Abort request signal
|
|
17
17
|
*/
|
|
18
18
|
signal?: AbortSignal;
|
|
19
|
+
/**
|
|
20
|
+
* Set Authorization with SKIP
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
skipSign?: boolean;
|
|
19
24
|
}
|
|
20
25
|
type ResponseData = any;
|
|
21
26
|
/**
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DefaultCredentialProvider = exports.OIDCRoleArnCredential = exports.CvmRoleCredential = exports.STSCredential = exports.ProfileCredential = exports.EnvironmentVariableCredential = exports.BasicCredential = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const util_1 = require("util");
|
|
6
7
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
8
|
const os_1 = require("os");
|
|
8
9
|
const ini_1 = require("ini");
|
|
@@ -162,7 +163,7 @@ class OIDCRoleArnCredential {
|
|
|
162
163
|
};
|
|
163
164
|
}
|
|
164
165
|
}
|
|
165
|
-
initFromTke() {
|
|
166
|
+
async initFromTke() {
|
|
166
167
|
const region = process.env.TKE_REGION;
|
|
167
168
|
if (!region) {
|
|
168
169
|
throw new Error("env TKE_REGION not exist");
|
|
@@ -177,7 +178,7 @@ class OIDCRoleArnCredential {
|
|
|
177
178
|
}
|
|
178
179
|
let wbIdentityToken;
|
|
179
180
|
try {
|
|
180
|
-
wbIdentityToken = fs_1.default.
|
|
181
|
+
wbIdentityToken = (await (0, util_1.promisify)(fs_1.default.readFile)(tokenFile)).toString();
|
|
181
182
|
}
|
|
182
183
|
catch (error) {
|
|
183
184
|
throw new Error(`failed to read token file: ${error.message}`);
|
|
@@ -197,14 +198,16 @@ class OIDCRoleArnCredential {
|
|
|
197
198
|
async getCredentialWithStsAssumeRoleWithWebIdentity() {
|
|
198
199
|
try {
|
|
199
200
|
if (this.isTke) {
|
|
200
|
-
this.initFromTke();
|
|
201
|
+
await this.initFromTke();
|
|
201
202
|
}
|
|
202
203
|
const { endpoint, version, action, region, clientConfig, assumeRoleWithWebIdentityParams } = this;
|
|
203
204
|
const client = new common_client_1.CommonClient(endpoint, version, {
|
|
204
205
|
region: region,
|
|
205
206
|
...clientConfig,
|
|
206
207
|
});
|
|
207
|
-
const result = await client.request(action, assumeRoleWithWebIdentityParams
|
|
208
|
+
const result = await client.request(action, assumeRoleWithWebIdentityParams, {
|
|
209
|
+
skipSign: true
|
|
210
|
+
});
|
|
208
211
|
return {
|
|
209
212
|
TmpSecretId: result.Credentials.TmpSecretId,
|
|
210
213
|
TmpSecretKey: result.Credentials.TmpSecretKey,
|
|
@@ -14,7 +14,7 @@ export declare class HttpConnection {
|
|
|
14
14
|
proxy?: string;
|
|
15
15
|
signal?: AbortSignal;
|
|
16
16
|
}): Promise<Response>;
|
|
17
|
-
static doRequestWithSign3({ method, url, data, service, action, region, version, secretId, secretKey, multipart, timeout, token, requestClient, language, headers, agent, proxy, signal, }: {
|
|
17
|
+
static doRequestWithSign3({ method, url, data, service, action, region, version, secretId, secretKey, multipart, timeout, token, requestClient, language, headers, agent, proxy, signal, skipSign, }: {
|
|
18
18
|
method: string;
|
|
19
19
|
url: string;
|
|
20
20
|
data: any;
|
|
@@ -33,5 +33,6 @@ export declare class HttpConnection {
|
|
|
33
33
|
agent?: Agent;
|
|
34
34
|
proxy?: string;
|
|
35
35
|
signal?: AbortSignal;
|
|
36
|
+
skipSign?: boolean;
|
|
36
37
|
}): Promise<Response>;
|
|
37
38
|
}
|
|
@@ -33,7 +33,7 @@ class HttpConnection {
|
|
|
33
33
|
}
|
|
34
34
|
return await (0, fetch_1.default)(url, config);
|
|
35
35
|
}
|
|
36
|
-
static async doRequestWithSign3({ method, url, data, service, action, region, version, secretId, secretKey, multipart = false, timeout = 60000, token, requestClient, language, headers = {}, agent, proxy, signal, }) {
|
|
36
|
+
static async doRequestWithSign3({ method, url, data, service, action, region, version, secretId, secretKey, multipart = false, timeout = 60000, token, requestClient, language, headers = {}, agent, proxy, signal, skipSign = false, }) {
|
|
37
37
|
// Convert readStream to Buffer to calculate the hash of the entire body
|
|
38
38
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
39
39
|
await convertReadStreamToBuffer(data);
|
|
@@ -94,19 +94,24 @@ class HttpConnection {
|
|
|
94
94
|
config.body = form;
|
|
95
95
|
config.headers = Object.assign({}, config.headers, form.getHeaders());
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
97
|
+
if (skipSign) {
|
|
98
|
+
config.headers["Authorization"] = "SKIP";
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
const signature = sign_1.default.sign3({
|
|
102
|
+
method,
|
|
103
|
+
url,
|
|
104
|
+
payload,
|
|
105
|
+
timestamp,
|
|
106
|
+
service,
|
|
107
|
+
secretId,
|
|
108
|
+
secretKey,
|
|
109
|
+
multipart,
|
|
110
|
+
boundary: form ? form.getBoundary() : undefined,
|
|
111
|
+
headers: config.headers,
|
|
112
|
+
});
|
|
113
|
+
config.headers["Authorization"] = signature;
|
|
114
|
+
}
|
|
110
115
|
return await (0, fetch_1.default)(url, config);
|
|
111
116
|
}
|
|
112
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const sdkVersion = "4.1.
|
|
1
|
+
export declare const sdkVersion = "4.1.219";
|
|
@@ -551,19 +551,19 @@ export interface SketchToImageRequest {
|
|
|
551
551
|
*/
|
|
552
552
|
export interface Rect {
|
|
553
553
|
/**
|
|
554
|
-
*
|
|
554
|
+
* <p>人脸框左上角横坐标。</p>
|
|
555
555
|
*/
|
|
556
556
|
X?: number;
|
|
557
557
|
/**
|
|
558
|
-
*
|
|
558
|
+
* <p>人脸框左上角纵坐标。</p>
|
|
559
559
|
*/
|
|
560
560
|
Y?: number;
|
|
561
561
|
/**
|
|
562
|
-
*
|
|
562
|
+
* <p>人脸框宽度。<br>单位:px</p>
|
|
563
563
|
*/
|
|
564
564
|
Width?: number;
|
|
565
565
|
/**
|
|
566
|
-
*
|
|
566
|
+
* <p>人脸框高度。<br>单位:px</p>
|
|
567
567
|
*/
|
|
568
568
|
Height?: number;
|
|
569
569
|
}
|