tencentcloud-sdk-nodejs 4.0.789 → 4.0.790
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/CHANGELOG.md +414 -0
- package/README.md +6 -0
- package/SERVICE_CHANGELOG.md +939 -260
- package/examples/cls/v20201016/cls.proto +34 -0
- package/examples/cls/v20201016/upload_log.js +69 -0
- package/package.json +1 -1
- package/products.md +12 -12
- package/src/common/abstract_client.ts +32 -0
- package/src/common/http/http_connection.ts +5 -2
- package/src/common/sdk_version.ts +1 -1
- package/src/common/sign.ts +8 -4
- package/src/services/cdb/v20170320/cdb_client.ts +18 -6
- package/src/services/cdb/v20170320/cdb_models.ts +15 -0
- package/src/services/emr/v20190103/emr_models.ts +7 -7
- package/src/services/ess/v20201111/ess_client.ts +22 -4
- package/src/services/ess/v20201111/ess_models.ts +19 -10
- package/src/services/essbasic/v20210526/essbasic_client.ts +11 -9
- package/src/services/essbasic/v20210526/essbasic_models.ts +4 -0
- package/src/services/iotvideo/v20211125/iotvideo_models.ts +8 -0
- package/src/services/mna/v20210119/mna_models.ts +3 -3
- package/src/services/rum/v20210622/rum_models.ts +2 -1
- package/src/services/ssl/v20191205/ssl_models.ts +2 -3
- package/src/services/teo/v20220901/teo_client.ts +20 -15
- package/src/services/teo/v20220901/teo_models.ts +8 -4
- package/src/services/tmt/v20180321/tmt_models.ts +2 -2
- package/src/services/wedata/v20210820/wedata_client.ts +2802 -5338
- package/src/services/wedata/v20210820/wedata_models.ts +14500 -29440
- package/tencentcloud/common/abstract_client.d.ts +4 -0
- package/tencentcloud/common/abstract_client.js +22 -0
- package/tencentcloud/common/http/http_connection.js +6 -2
- package/tencentcloud/common/sdk_version.d.ts +1 -1
- package/tencentcloud/common/sdk_version.js +1 -1
- package/tencentcloud/common/sign.d.ts +2 -1
- package/tencentcloud/common/sign.js +6 -4
- package/tencentcloud/services/cdb/v20170320/cdb_client.d.ts +7 -3
- package/tencentcloud/services/cdb/v20170320/cdb_client.js +9 -3
- package/tencentcloud/services/cdb/v20170320/cdb_models.d.ts +13 -0
- package/tencentcloud/services/emr/v20190103/emr_models.d.ts +7 -7
- package/tencentcloud/services/ess/v20201111/ess_client.d.ts +22 -4
- package/tencentcloud/services/ess/v20201111/ess_client.js +22 -4
- package/tencentcloud/services/ess/v20201111/ess_models.d.ts +19 -10
- package/tencentcloud/services/essbasic/v20210526/essbasic_client.d.ts +11 -9
- package/tencentcloud/services/essbasic/v20210526/essbasic_client.js +11 -9
- package/tencentcloud/services/essbasic/v20210526/essbasic_models.d.ts +4 -0
- package/tencentcloud/services/iotvideo/v20211125/iotvideo_models.d.ts +8 -0
- package/tencentcloud/services/mna/v20210119/mna_models.d.ts +3 -3
- package/tencentcloud/services/rum/v20210622/rum_models.d.ts +2 -1
- package/tencentcloud/services/ssl/v20191205/ssl_models.d.ts +2 -3
- package/tencentcloud/services/teo/v20220901/teo_client.d.ts +15 -10
- package/tencentcloud/services/teo/v20220901/teo_client.js +15 -10
- package/tencentcloud/services/teo/v20220901/teo_models.d.ts +8 -4
- package/tencentcloud/services/tmt/v20180321/tmt_models.d.ts +2 -2
- package/tencentcloud/services/wedata/v20210820/wedata_client.d.ts +675 -1483
- package/tencentcloud/services/wedata/v20210820/wedata_client.js +1027 -2237
- package/tencentcloud/services/wedata/v20210820/wedata_models.d.ts +14275 -28693
- package/test/cdb.v20170320.test.js +12 -2
- package/test/wedata.v20210820.test.js +636 -2646
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
syntax = "proto2";
|
|
2
|
+
|
|
3
|
+
package cls;
|
|
4
|
+
|
|
5
|
+
message Log
|
|
6
|
+
{
|
|
7
|
+
message Content
|
|
8
|
+
{
|
|
9
|
+
required string key = 1; // 每组字段的 key
|
|
10
|
+
required string value = 2; // 每组字段的 value
|
|
11
|
+
}
|
|
12
|
+
required int64 time = 1; // 时间戳,UNIX时间格式
|
|
13
|
+
repeated Content contents = 2; // 一条日志里的多个kv组合
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
message LogTag
|
|
17
|
+
{
|
|
18
|
+
required string key = 1;
|
|
19
|
+
required string value = 2;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message LogGroup
|
|
23
|
+
{
|
|
24
|
+
repeated Log logs = 1; // 多条日志合成的日志数组
|
|
25
|
+
optional string contextFlow = 2; // 目前暂无效用
|
|
26
|
+
optional string filename = 3; // 日志文件名
|
|
27
|
+
optional string source = 4; // 日志来源,一般使用机器IP
|
|
28
|
+
repeated LogTag logTags = 5;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message LogGroupList
|
|
32
|
+
{
|
|
33
|
+
repeated LogGroup logGroupList = 1; // 日志组列表
|
|
34
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const { CommonClient } = require("../../../tencentcloud/common/common_client")
|
|
2
|
+
const protobuf = require("protobufjs")
|
|
3
|
+
const lz4 = require("lz4")
|
|
4
|
+
const path = require("path")
|
|
5
|
+
|
|
6
|
+
// 实例化要请求产品的client对象。profile可选。
|
|
7
|
+
const clientConfig = {
|
|
8
|
+
credential: {
|
|
9
|
+
secretId: process.env.secretId,
|
|
10
|
+
secretKey: process.env.secretKey,
|
|
11
|
+
},
|
|
12
|
+
region: "ap-guangzhou",
|
|
13
|
+
profile: {
|
|
14
|
+
httpProfile: {
|
|
15
|
+
endpoint: "cls.tencentcloudapi.com",
|
|
16
|
+
headers: {
|
|
17
|
+
"X-CLS-TopicId": "", // 替换为自己业务的 topic
|
|
18
|
+
"X-CLS-HashKey": "", // 可选参数,具体参考官方文档:https://cloud.tencent.com/document/product/614/59470
|
|
19
|
+
"X-CLS-CompressType": "lz4", // lz4压缩方式, 空字符串意味不压缩
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 实例化要请求产品的client对象,clientProfile是可选的
|
|
26
|
+
const client = new CommonClient("cls.tencentcloudapi.com", "2020-10-16", clientConfig)
|
|
27
|
+
// lz4 压缩数据
|
|
28
|
+
const params = compress(getBodyInfo())
|
|
29
|
+
client.requestOctetStream("UploadLog", params).then(
|
|
30
|
+
(data) => {
|
|
31
|
+
console.log(data)
|
|
32
|
+
},
|
|
33
|
+
(err) => {
|
|
34
|
+
console.error("error", err)
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
function compress(input) {
|
|
39
|
+
const output = Buffer.alloc(lz4.encodeBound(input.length))
|
|
40
|
+
const compressedBlockSize = lz4.encodeBlock(input, output)
|
|
41
|
+
return output.slice(0, compressedBlockSize)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function getBodyInfo() {
|
|
45
|
+
const root = protobuf.loadSync(path.join(__dirname, "cls.proto"))
|
|
46
|
+
const LogGroupList = root.lookupType("cls.LogGroupList")
|
|
47
|
+
const payload = {
|
|
48
|
+
logGroupList: [
|
|
49
|
+
{
|
|
50
|
+
logs: [
|
|
51
|
+
{
|
|
52
|
+
time: Date.now(),
|
|
53
|
+
contents: [
|
|
54
|
+
{
|
|
55
|
+
key: "name",
|
|
56
|
+
value: "张三",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: "age",
|
|
60
|
+
value: "18",
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
}
|
|
68
|
+
return LogGroupList.encode(payload).finish()
|
|
69
|
+
}
|
package/package.json
CHANGED
package/products.md
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
| cat | [云拨测](https://cloud.tencent.com/document/product/280) | 2023-12-29 01:09:11 |
|
|
41
41
|
| cbs | [云硬盘](https://cloud.tencent.com/document/product/362) | 2023-12-27 01:08:57 |
|
|
42
42
|
| ccc | [云联络中心](https://cloud.tencent.com/document/product/679) | 2024-01-25 15:34:29 |
|
|
43
|
-
| cdb | [云数据库 MySQL](https://cloud.tencent.com/document/product/236) | 2024-01-
|
|
43
|
+
| cdb | [云数据库 MySQL](https://cloud.tencent.com/document/product/236) | 2024-01-30 01:08:20 |
|
|
44
44
|
| cdc | [本地专用集群](https://cloud.tencent.com/document/product/1346) | 2024-01-15 01:08:17 |
|
|
45
45
|
| cdn | [内容分发网络 CDN](https://cloud.tencent.com/document/product/228) | 2024-01-17 01:09:06 |
|
|
46
46
|
| cds | [T-Sec-数据安全审计(DSA)](https://cloud.tencent.com/document/product/856) | 2024-01-24 01:23:26 |
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
| ecm | [边缘计算机器](https://cloud.tencent.com/document/product/1108) | 2023-12-20 01:36:00 |
|
|
95
95
|
| eiam | [数字身份管控平台(员工版)](https://cloud.tencent.com/document/product/1442) | 2023-05-18 01:25:40 |
|
|
96
96
|
| eis | [数据连接器](https://cloud.tencent.com/document/product/1270) | 2023-08-10 01:17:44 |
|
|
97
|
-
| emr | [弹性 MapReduce](https://cloud.tencent.com/document/product/589) | 2024-01-
|
|
97
|
+
| emr | [弹性 MapReduce](https://cloud.tencent.com/document/product/589) | 2024-01-30 01:14:22 |
|
|
98
98
|
| es | [Elasticsearch Service](https://cloud.tencent.com/document/product/845) | 2024-01-25 01:13:20 |
|
|
99
|
-
| ess | [腾讯电子签企业版](https://cloud.tencent.com/document/product/1323) | 2024-01-
|
|
100
|
-
| essbasic | [腾讯电子签(基础版)](https://cloud.tencent.com/document/product/1420) | 2024-01-
|
|
99
|
+
| ess | [腾讯电子签企业版](https://cloud.tencent.com/document/product/1323) | 2024-01-30 01:14:38 |
|
|
100
|
+
| essbasic | [腾讯电子签(基础版)](https://cloud.tencent.com/document/product/1420) | 2024-01-30 01:14:52 |
|
|
101
101
|
| facefusion | [人脸融合](https://cloud.tencent.com/document/product/670) | 2023-12-15 19:41:44 |
|
|
102
102
|
| faceid | [人脸核身](https://cloud.tencent.com/document/product/1007) | 2024-01-12 01:15:37 |
|
|
103
103
|
| fmu | [人脸试妆](https://cloud.tencent.com/document/product/1172) | 2023-12-25 00:11:01 |
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
| iotcloud | [物联网通信](https://cloud.tencent.com/document/product/634) | 2023-11-06 00:11:14 |
|
|
126
126
|
| iotexplorer | [物联网开发平台](https://cloud.tencent.com/document/product/1081) | 2023-10-16 01:17:51 |
|
|
127
127
|
| iottid | [物联网设备身份认证](https://cloud.tencent.com/document/product/1086) | 2023-05-18 01:33:02 |
|
|
128
|
-
| iotvideo | [物联网智能视频服务](https://cloud.tencent.com/document/product/1131) | 2024-01-
|
|
128
|
+
| iotvideo | [物联网智能视频服务](https://cloud.tencent.com/document/product/1131) | 2024-01-30 01:16:52 |
|
|
129
129
|
| iotvideoindustry | [物联网智能视频服务(行业版)](https://cloud.tencent.com/document/product/1361) | 2023-08-17 03:44:44 |
|
|
130
130
|
| irp | [智能推荐平台](https://cloud.tencent.com/document/product/1541) | 2023-09-22 02:00:51 |
|
|
131
131
|
| iss | [智能视图计算平台](https://cloud.tencent.com/document/product/1344) | 2024-01-26 01:15:52 |
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
| memcached | [云数据库Memcached](https://cloud.tencent.com/document/product/241) | 2023-10-20 01:19:21 |
|
|
144
144
|
| mgobe | [游戏联机对战引擎](https://cloud.tencent.com/document/product/1038) | 2022-07-08 06:11:32 |
|
|
145
145
|
| mmps | [小程序安全](https://cloud.tencent.com/document/product/1223) | 2023-05-18 01:39:20 |
|
|
146
|
-
| mna | [多网聚合加速](https://cloud.tencent.com/document/product/1385) |
|
|
146
|
+
| mna | [多网聚合加速](https://cloud.tencent.com/document/product/1385) | 2024-01-30 01:18:35 |
|
|
147
147
|
| mongodb | [云数据库 MongoDB](https://cloud.tencent.com/document/product/240) | 2024-01-29 01:17:07 |
|
|
148
148
|
| monitor | [腾讯云可观测平台](https://cloud.tencent.com/document/product/248) | 2024-01-29 01:17:14 |
|
|
149
149
|
| mps | [媒体处理](https://cloud.tencent.com/document/product/862) | 2024-01-26 01:17:35 |
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
| region | [地域管理系统](https://cloud.tencent.com/document/product/1596) | 2023-10-13 01:22:28 |
|
|
168
168
|
| rkp | [风险探针](https://cloud.tencent.com/document/product/1169) | 2023-12-25 00:16:39 |
|
|
169
169
|
| rp | [注册保护](https://cloud.tencent.com/document/product/1191) | 2022-04-04 07:04:06 |
|
|
170
|
-
| rum | [前端性能监控](https://cloud.tencent.com/document/product/1464) | 2024-01-
|
|
170
|
+
| rum | [前端性能监控](https://cloud.tencent.com/document/product/1464) | 2024-01-30 01:20:45 |
|
|
171
171
|
| scf | [云函数](https://cloud.tencent.com/document/product/583) | 2024-01-24 01:34:14 |
|
|
172
172
|
| ses | [邮件推送](https://cloud.tencent.com/document/product/1288) | 2023-12-25 00:16:59 |
|
|
173
173
|
| smh | [智能媒资托管](https://cloud.tencent.com/document/product/1339) | 2023-07-11 01:37:49 |
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
| solar | [智汇零售](https://cloud.tencent.com/document/product) | 2020-03-19 08:01:59 |
|
|
179
179
|
| sqlserver | [云数据库 SQL Server](https://cloud.tencent.com/document/product/238) | 2024-01-17 01:21:16 |
|
|
180
180
|
| ssa | [安全运营中心](https://cloud.tencent.com/document/product/664) | 2023-11-15 02:18:28 |
|
|
181
|
-
| ssl | [SSL 证书](https://cloud.tencent.com/document/product/400) | 2024-01-
|
|
181
|
+
| ssl | [SSL 证书](https://cloud.tencent.com/document/product/400) | 2024-01-30 01:21:39 |
|
|
182
182
|
| sslpod | [证书监控 SSLPod](https://cloud.tencent.com/document/product/1084) | 2023-08-17 04:46:28 |
|
|
183
183
|
| ssm | [凭据管理系统](https://cloud.tencent.com/document/product/1140) | 2023-12-28 01:23:11 |
|
|
184
184
|
| sts | [安全凭证服务](https://cloud.tencent.com/document/product/1312) | 2024-01-17 01:21:44 |
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
| tdmq | [消息队列 TDMQ](https://cloud.tencent.com/document/product/1179) | 2024-01-12 01:24:10 |
|
|
206
206
|
| tds | [设备安全](https://cloud.tencent.com/document/product/1628) | 2023-11-15 02:26:59 |
|
|
207
207
|
| tem | [弹性微服务](https://cloud.tencent.com/document/product/1371) | 2023-12-20 02:13:36 |
|
|
208
|
-
| teo | [边缘安全加速平台](https://cloud.tencent.com/document/product/1552) | 2024-01-
|
|
208
|
+
| teo | [边缘安全加速平台](https://cloud.tencent.com/document/product/1552) | 2024-01-30 01:24:01 |
|
|
209
209
|
| thpc | [高性能计算平台](https://cloud.tencent.com/document/product/1527) | 2023-11-27 00:20:12 |
|
|
210
210
|
| tia | [智能钛机器学习](https://cloud.tencent.com/document/product/851) | 2021-10-21 11:12:52 |
|
|
211
211
|
| tic | [资源编排 TIC](https://cloud.tencent.com/document/product/1213) | 2023-08-17 05:26:08 |
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
| tke | [容器服务](https://cloud.tencent.com/document/product/457) | 2024-01-22 11:36:09 |
|
|
219
219
|
| tkgdq | [腾讯知识图谱数据查询](https://cloud.tencent.com/document/product) | 2020-03-10 00:51:44 |
|
|
220
220
|
| tms | [文本内容安全](https://cloud.tencent.com/document/product/1124) | 2024-01-12 01:25:58 |
|
|
221
|
-
| tmt | [机器翻译](https://cloud.tencent.com/document/product/551) | 2024-01-
|
|
221
|
+
| tmt | [机器翻译](https://cloud.tencent.com/document/product/551) | 2024-01-30 01:25:25 |
|
|
222
222
|
| tourism | [文旅客情大数据](https://cloud.tencent.com/document/product/1684) | 2023-08-10 01:43:37 |
|
|
223
223
|
| trdp | [流量风险决策平台](https://cloud.tencent.com/document/product/1604) | 2023-05-18 02:01:19 |
|
|
224
224
|
| trocket | [消息队列 RocketMQ 版](https://cloud.tencent.com/document/product/1493) | 2024-01-23 01:30:19 |
|
|
@@ -233,11 +233,11 @@
|
|
|
233
233
|
| vm | [视频内容安全](https://cloud.tencent.com/document/product/1265) | 2023-12-22 01:27:31 |
|
|
234
234
|
| vms | [语音消息](https://cloud.tencent.com/document/product/1128) | 2023-08-17 05:50:56 |
|
|
235
235
|
| vod | [云点播](https://cloud.tencent.com/document/product/266) | 2024-01-25 01:25:21 |
|
|
236
|
-
| vpc | [私有网络](https://cloud.tencent.com/document/product/215) | 2024-01-
|
|
236
|
+
| vpc | [私有网络](https://cloud.tencent.com/document/product/215) | 2024-01-30 01:27:12 |
|
|
237
237
|
| vrs | [声音复刻](https://cloud.tencent.com/document/product/1283) | 2023-11-27 00:23:42 |
|
|
238
238
|
| waf | [Web 应用防火墙](https://cloud.tencent.com/document/product/627) | 2024-01-26 01:25:28 |
|
|
239
239
|
| wav | [企业微信汽车行业版](https://cloud.tencent.com/document/product/1318) | 2023-11-15 02:42:49 |
|
|
240
|
-
| wedata | [数据开发治理平台 WeData](https://cloud.tencent.com/document/product/1267) | 2024-01-
|
|
240
|
+
| wedata | [数据开发治理平台 WeData](https://cloud.tencent.com/document/product/1267) | 2024-01-30 01:28:12 |
|
|
241
241
|
| weilingwith | [微瓴同业开放平台](https://cloud.tencent.com/document/product/1693) | 2024-01-17 01:27:53 |
|
|
242
242
|
| wss | [SSL证书管理服务](https://cloud.tencent.com/document/product) | 2020-04-01 08:53:44 |
|
|
243
243
|
| yinsuda | [音速达直播音乐版权引擎](https://cloud.tencent.com/document/product/1592) | 2023-12-26 02:06:57 |
|
|
@@ -142,6 +142,38 @@ export class AbstractClient {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
/**
|
|
146
|
+
* @inner
|
|
147
|
+
*/
|
|
148
|
+
async requestOctetStream(
|
|
149
|
+
action: string,
|
|
150
|
+
req: any,
|
|
151
|
+
options?: ResponseCallback | RequestOptions,
|
|
152
|
+
cb?: ResponseCallback
|
|
153
|
+
) {
|
|
154
|
+
if (typeof options === "function") {
|
|
155
|
+
cb = options
|
|
156
|
+
options = {} as RequestOptions
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
try {
|
|
160
|
+
const result = await this.doRequest(
|
|
161
|
+
action,
|
|
162
|
+
req ?? {},
|
|
163
|
+
Object.assign({}, options, {
|
|
164
|
+
headers: {
|
|
165
|
+
"Content-Type": "application/octet-stream; charset=utf-8",
|
|
166
|
+
},
|
|
167
|
+
})
|
|
168
|
+
)
|
|
169
|
+
cb && cb(null, result)
|
|
170
|
+
return result
|
|
171
|
+
} catch (e) {
|
|
172
|
+
cb && cb(e as any, null)
|
|
173
|
+
throw e
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
145
177
|
/**
|
|
146
178
|
* @inner
|
|
147
179
|
*/
|
|
@@ -142,8 +142,10 @@ export class HttpConnection {
|
|
|
142
142
|
config.headers["Content-Type"] = "application/x-www-form-urlencoded"
|
|
143
143
|
}
|
|
144
144
|
if (method === "POST" && !multipart) {
|
|
145
|
-
config.body =
|
|
146
|
-
config.headers["Content-Type"]
|
|
145
|
+
config.body = data
|
|
146
|
+
const contentType = config.headers["Content-Type"] || "application/json"
|
|
147
|
+
if (!isBuffer(data)) config.body = JSONbigNative.stringify(data)
|
|
148
|
+
config.headers["Content-Type"] = contentType
|
|
147
149
|
}
|
|
148
150
|
if (method === "POST" && multipart) {
|
|
149
151
|
form = new FormData()
|
|
@@ -164,6 +166,7 @@ export class HttpConnection {
|
|
|
164
166
|
secretKey,
|
|
165
167
|
multipart,
|
|
166
168
|
boundary: form ? form.getBoundary() : undefined,
|
|
169
|
+
headers: config.headers,
|
|
167
170
|
})
|
|
168
171
|
|
|
169
172
|
config.headers["Authorization"] = signature
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const sdkVersion = "4.0.
|
|
1
|
+
export const sdkVersion = "4.0.790"
|
package/src/common/sign.ts
CHANGED
|
@@ -36,6 +36,7 @@ export default class Sign {
|
|
|
36
36
|
secretKey,
|
|
37
37
|
multipart,
|
|
38
38
|
boundary,
|
|
39
|
+
headers: configHeaders = {},
|
|
39
40
|
}: {
|
|
40
41
|
method?: string
|
|
41
42
|
url?: string
|
|
@@ -46,21 +47,23 @@ export default class Sign {
|
|
|
46
47
|
secretKey: string
|
|
47
48
|
multipart: boolean
|
|
48
49
|
boundary: string
|
|
50
|
+
headers: Record<string, string>
|
|
49
51
|
}): string {
|
|
50
52
|
const urlObj = new URL(url)
|
|
53
|
+
const contentType = configHeaders["Content-Type"]
|
|
51
54
|
|
|
52
55
|
// 通用头部
|
|
53
56
|
let headers = ""
|
|
54
57
|
let signedHeaders = ""
|
|
55
58
|
if (method === "GET") {
|
|
56
59
|
signedHeaders = "content-type"
|
|
57
|
-
headers =
|
|
60
|
+
headers = `content-type:${contentType}\n`
|
|
58
61
|
} else if (method === "POST") {
|
|
59
62
|
signedHeaders = "content-type"
|
|
60
63
|
if (multipart) {
|
|
61
64
|
headers = `content-type:multipart/form-data; boundary=${boundary}\n`
|
|
62
65
|
} else {
|
|
63
|
-
headers =
|
|
66
|
+
headers = `content-type:${contentType}\n`
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
headers += `host:${urlObj.hostname}\n`
|
|
@@ -90,7 +93,8 @@ export default class Sign {
|
|
|
90
93
|
hash.update(`--\r\n`)
|
|
91
94
|
payload_hash = hash.digest("hex")
|
|
92
95
|
} else {
|
|
93
|
-
|
|
96
|
+
const hashMessage = Buffer.isBuffer(payload) ? payload : JSONbigNative.stringify(payload)
|
|
97
|
+
payload_hash = payload ? getHash(hashMessage) : getHash("")
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
const canonicalRequest =
|
|
@@ -130,7 +134,7 @@ function sha256(message: string, secret = "", encoding?: string): string {
|
|
|
130
134
|
return hmac.update(message).digest(encoding as any)
|
|
131
135
|
}
|
|
132
136
|
|
|
133
|
-
function getHash(message:
|
|
137
|
+
function getHash(message: crypto.BinaryLike, encoding = "hex"): string {
|
|
134
138
|
const hash = crypto.createHash("sha256")
|
|
135
139
|
return hash.update(message).digest(encoding as any)
|
|
136
140
|
}
|
|
@@ -108,6 +108,7 @@ import {
|
|
|
108
108
|
ReleaseResult,
|
|
109
109
|
CreateAuditLogFileRequest,
|
|
110
110
|
AuditRule,
|
|
111
|
+
DescribeInstanceAlarmEventsRequest,
|
|
111
112
|
DescribeBinlogsRequest,
|
|
112
113
|
DescribeCdbProxyInfoRequest,
|
|
113
114
|
RollbackDBName,
|
|
@@ -336,6 +337,7 @@ import {
|
|
|
336
337
|
DescribeCdbProxyInfoResponse,
|
|
337
338
|
ModifyAuditConfigRequest,
|
|
338
339
|
DeviceDiskInfo,
|
|
340
|
+
DescribeInstanceAlarmEventsResponse,
|
|
339
341
|
DescribeRoMinScaleResponse,
|
|
340
342
|
RoWeightValue,
|
|
341
343
|
DescribeSlowLogDataResponse,
|
|
@@ -1460,6 +1462,16 @@ export class Client extends AbstractClient {
|
|
|
1460
1462
|
return this.request("CloseCDBProxy", req, cb)
|
|
1461
1463
|
}
|
|
1462
1464
|
|
|
1465
|
+
/**
|
|
1466
|
+
* 修改置放群组的名称或者描述
|
|
1467
|
+
*/
|
|
1468
|
+
async ModifyNameOrDescByDpId(
|
|
1469
|
+
req: ModifyNameOrDescByDpIdRequest,
|
|
1470
|
+
cb?: (error: string, rep: ModifyNameOrDescByDpIdResponse) => void
|
|
1471
|
+
): Promise<ModifyNameOrDescByDpIdResponse> {
|
|
1472
|
+
return this.request("ModifyNameOrDescByDpId", req, cb)
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1463
1475
|
/**
|
|
1464
1476
|
* 本接口(ModifyAccountMaxUserConnections)用于修改云数据库账户最大可用连接数。
|
|
1465
1477
|
*/
|
|
@@ -2023,13 +2035,13 @@ export class Client extends AbstractClient {
|
|
|
2023
2035
|
}
|
|
2024
2036
|
|
|
2025
2037
|
/**
|
|
2026
|
-
*
|
|
2038
|
+
* 查询实例发生的事件信息
|
|
2027
2039
|
*/
|
|
2028
|
-
async
|
|
2029
|
-
req
|
|
2030
|
-
cb?: (error: string, rep:
|
|
2031
|
-
): Promise<
|
|
2032
|
-
return this.request("
|
|
2040
|
+
async DescribeInstanceAlarmEvents(
|
|
2041
|
+
req?: DescribeInstanceAlarmEventsRequest,
|
|
2042
|
+
cb?: (error: string, rep: DescribeInstanceAlarmEventsResponse) => void
|
|
2043
|
+
): Promise<DescribeInstanceAlarmEventsResponse> {
|
|
2044
|
+
return this.request("DescribeInstanceAlarmEvents", req, cb)
|
|
2033
2045
|
}
|
|
2034
2046
|
|
|
2035
2047
|
/**
|
|
@@ -2307,6 +2307,11 @@ export interface AuditRule {
|
|
|
2307
2307
|
AuditAll: boolean
|
|
2308
2308
|
}
|
|
2309
2309
|
|
|
2310
|
+
/**
|
|
2311
|
+
* DescribeInstanceAlarmEvents请求参数结构体
|
|
2312
|
+
*/
|
|
2313
|
+
export type DescribeInstanceAlarmEventsRequest = null
|
|
2314
|
+
|
|
2310
2315
|
/**
|
|
2311
2316
|
* DescribeBinlogs请求参数结构体
|
|
2312
2317
|
*/
|
|
@@ -7664,6 +7669,16 @@ export interface DeviceDiskInfo {
|
|
|
7664
7669
|
CapacityRatio: Array<number | bigint>
|
|
7665
7670
|
}
|
|
7666
7671
|
|
|
7672
|
+
/**
|
|
7673
|
+
* DescribeInstanceAlarmEvents返回参数结构体
|
|
7674
|
+
*/
|
|
7675
|
+
export interface DescribeInstanceAlarmEventsResponse {
|
|
7676
|
+
/**
|
|
7677
|
+
* 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
|
7678
|
+
*/
|
|
7679
|
+
RequestId?: string
|
|
7680
|
+
}
|
|
7681
|
+
|
|
7667
7682
|
/**
|
|
7668
7683
|
* DescribeRoMinScale返回参数结构体
|
|
7669
7684
|
*/
|
|
@@ -122,27 +122,27 @@ export interface ScaleOutInstanceResponse {
|
|
|
122
122
|
/**
|
|
123
123
|
* 实例ID。
|
|
124
124
|
*/
|
|
125
|
-
InstanceId
|
|
125
|
+
InstanceId?: string
|
|
126
126
|
/**
|
|
127
127
|
* 订单号。
|
|
128
128
|
注意:此字段可能返回 null,表示取不到有效值。
|
|
129
129
|
*/
|
|
130
|
-
DealNames
|
|
130
|
+
DealNames?: Array<string>
|
|
131
131
|
/**
|
|
132
132
|
* 客户端Token。
|
|
133
133
|
注意:此字段可能返回 null,表示取不到有效值。
|
|
134
134
|
*/
|
|
135
|
-
ClientToken
|
|
135
|
+
ClientToken?: string
|
|
136
136
|
/**
|
|
137
137
|
* 扩容流程ID。
|
|
138
138
|
注意:此字段可能返回 null,表示取不到有效值。
|
|
139
139
|
*/
|
|
140
|
-
FlowId
|
|
140
|
+
FlowId?: number
|
|
141
141
|
/**
|
|
142
142
|
* 大订单号。
|
|
143
143
|
注意:此字段可能返回 null,表示取不到有效值。
|
|
144
144
|
*/
|
|
145
|
-
BillId
|
|
145
|
+
BillId?: string
|
|
146
146
|
/**
|
|
147
147
|
* 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
|
148
148
|
*/
|
|
@@ -1126,7 +1126,7 @@ export interface ScaleOutInstanceRequest {
|
|
|
1126
1126
|
*/
|
|
1127
1127
|
PayMode: number
|
|
1128
1128
|
/**
|
|
1129
|
-
*
|
|
1129
|
+
* 唯一随机标识,时效5分钟,需要调用者指定 防止客户端重新创建资源,例如 a9a90aa6-751a-41b6-aad6-fae36063280
|
|
1130
1130
|
*/
|
|
1131
1131
|
ClientToken?: string
|
|
1132
1132
|
/**
|
|
@@ -3952,7 +3952,7 @@ export interface CreateInstanceRequest {
|
|
|
3952
3952
|
*/
|
|
3953
3953
|
AutoRenew?: number
|
|
3954
3954
|
/**
|
|
3955
|
-
*
|
|
3955
|
+
* 唯一随机标识,时效5分钟,需要调用者指定 防止客户端重新创建资源,例如 a9a90aa6-751a-41b6-aad6-fae36063280
|
|
3956
3956
|
*/
|
|
3957
3957
|
ClientToken?: string
|
|
3958
3958
|
/**
|
|
@@ -310,9 +310,16 @@ export class Client extends AbstractClient {
|
|
|
310
310
|
/**
|
|
311
311
|
* 用于撤销合同流程<br/>
|
|
312
312
|
适用场景:如果某个合同流程当前至少还有一方没有签署,则可通过该接口取消该合同流程。常用于合同发错、内容填错,需要及时撤销的场景。<br/>
|
|
313
|
+
- **可撤回合同状态**:未全部签署完成
|
|
314
|
+
- **不撤回合同状态**:已全部签署完成、已拒签、已过期、已撤回、拒绝填写、已解除等合同状态。
|
|
313
315
|
|
|
314
316
|
注:
|
|
315
|
-
|
|
317
|
+
1. 如果合同流程中的参与方均已签署完毕,则无法通过该接口撤销合同,签署完毕的合同需要双方走解除流程将合同作废,可以参考<a href="https://qian.tencent.com/developers/companyApis/operateFlows/CreateReleaseFlow" target="_blank">发起解除合同流程</a>接口。
|
|
318
|
+
|
|
319
|
+
2. 有对应合同撤销权限的人: <font color='red'>合同的发起人(并已经授予撤销权限)或者发起人所在企业的超管、法人</font>
|
|
320
|
+

|
|
321
|
+
|
|
322
|
+
3. <font color='red'>撤销合同会返还合同额度</font>
|
|
316
323
|
*/
|
|
317
324
|
async CancelFlow(
|
|
318
325
|
req: CancelFlowRequest,
|
|
@@ -484,9 +491,20 @@ export class Client extends AbstractClient {
|
|
|
484
491
|
}
|
|
485
492
|
|
|
486
493
|
/**
|
|
487
|
-
*
|
|
488
|
-
|
|
489
|
-
|
|
494
|
+
* 指定需要批量撤回的签署流程Id,以获取批量撤销链接。
|
|
495
|
+
客户需指定要撤回的签署流程Id,最多可指定100个,超过100则不处理。
|
|
496
|
+
接口调用成功后,将返回批量撤回合同的链接。通过点击链接,可跳转至电子签小程序完成批量撤回操作。
|
|
497
|
+
|
|
498
|
+
- **可撤回合同状态**:未全部签署完成
|
|
499
|
+
- **不撤回合同状态**:已全部签署完成、已拒签、已过期、已撤回、拒绝填写、已解除等合同状态。
|
|
500
|
+
|
|
501
|
+
注:
|
|
502
|
+
1. 如果合同流程中的参与方均已签署完毕,则无法通过该接口撤销合同,签署完毕的合同需要双方走解除流程将合同作废,可以参考<a href="https://qian.tencent.com/developers/companyApis/operateFlows/CreateReleaseFlow" target="_blank">发起解除合同流程</a>接口。
|
|
503
|
+
|
|
504
|
+
2. 有对应合同撤销权限的人: <font color='red'>合同的发起人(并已经授予撤销权限)或者发起人所在企业的超管、法人</font>
|
|
505
|
+

|
|
506
|
+
|
|
507
|
+
3. <font color='red'>撤销合同会返还合同额度</font>
|
|
490
508
|
*/
|
|
491
509
|
async CreateBatchCancelFlowUrl(
|
|
492
510
|
req: CreateBatchCancelFlowUrlRequest,
|
|
@@ -1964,7 +1964,10 @@ export interface CreateSchemeUrlRequest {
|
|
|
1964
1964
|
/**
|
|
1965
1965
|
* 签署完成后是否自动回跳
|
|
1966
1966
|
<ul><li>**false**:否, 签署完成不会自动跳转回来(默认)</li><li>**true**:是, 签署完成会自动跳转回来</li></ul>
|
|
1967
|
-
|
|
1967
|
+
|
|
1968
|
+
注:
|
|
1969
|
+
1. 该参数<font color="red">只针对APP</font> 类型的签署链接有效
|
|
1970
|
+
2. <font color="red">手机应用APP 或 微信小程序需要监控界面的返回走后序逻辑</font>, 微信小程序的文档可以参考[这个](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onShow-Object-object)
|
|
1968
1971
|
*/
|
|
1969
1972
|
AutoJumpBack?: boolean
|
|
1970
1973
|
/**
|
|
@@ -3639,20 +3642,24 @@ style String 为字体风格设置 风格支持: font : 目前支持 黑体、
|
|
|
3639
3642
|
export interface FormField {
|
|
3640
3643
|
/**
|
|
3641
3644
|
* 控件填充vaule,ComponentType和传入值类型对应关系:
|
|
3642
|
-
TEXT
|
|
3643
|
-
MULTI_LINE_TEXT
|
|
3644
|
-
CHECK_BOX
|
|
3645
|
-
FILL_IMAGE、ATTACHMENT
|
|
3646
|
-
SELECTOR
|
|
3647
|
-
DYNAMIC_TABLE
|
|
3645
|
+
TEXT : 文本内容
|
|
3646
|
+
MULTI_LINE_TEXT :文本内容
|
|
3647
|
+
CHECK_BOX :true/false
|
|
3648
|
+
FILL_IMAGE、ATTACHMENT : 附件的FileId,需要通过UploadFiles接口上传获取
|
|
3649
|
+
SELECTOR : 选项值
|
|
3650
|
+
DYNAMIC_TABLE :传入json格式的表格内容,具体见数据结构[点击查看](https://qian.tencent.com/developers/company/dynamic_table)
|
|
3648
3651
|
*/
|
|
3649
3652
|
ComponentValue: string
|
|
3650
3653
|
/**
|
|
3651
3654
|
* 控件id,和ComponentName选择一项传入即可
|
|
3655
|
+
|
|
3656
|
+
<a href="https://dyn.ess.tencent.cn/guide/apivideo/component_name.mp4" target="_blank">点击查看在模版中找到控件ID的方式</a>
|
|
3652
3657
|
*/
|
|
3653
3658
|
ComponentId?: string
|
|
3654
3659
|
/**
|
|
3655
3660
|
* 控件名字,最大长度不超过30字符,和ComponentId选择一项传入即可
|
|
3661
|
+
|
|
3662
|
+
<a href="https://dyn.ess.tencent.cn/guide/apivideo/component_name.mp4" target="_blank">点击查看在模版中找到控件名字的方式</a>
|
|
3656
3663
|
*/
|
|
3657
3664
|
ComponentName?: string
|
|
3658
3665
|
}
|
|
@@ -6225,11 +6232,13 @@ export interface CancelFlowRequest {
|
|
|
6225
6232
|
/**
|
|
6226
6233
|
* 合同流程ID, 为32位字符串。
|
|
6227
6234
|
|
|
6228
|
-
|
|
6235
|
+
可登录腾讯电子签控制台,[点击产看FlowId在控制台中的位置](https://qcloudimg.tencent-cloud.cn/raw/0a83015166cfe1cb043d14f9ec4bd75e.png)
|
|
6229
6236
|
*/
|
|
6230
6237
|
FlowId: string
|
|
6231
6238
|
/**
|
|
6232
|
-
*
|
|
6239
|
+
* 撤销此合同流程的**撤销理由**,最多支持200个字符长度。只能由中文、字母、数字、中文标点和英文标点组成(不支持表情)。
|
|
6240
|
+
|
|
6241
|
+

|
|
6233
6242
|
*/
|
|
6234
6243
|
CancelMessage: string
|
|
6235
6244
|
/**
|
|
@@ -7235,7 +7244,7 @@ export interface CreateBatchCancelFlowUrlRequest {
|
|
|
7235
7244
|
Operator: UserInfo
|
|
7236
7245
|
/**
|
|
7237
7246
|
* 需要执行撤回的流程(合同)的编号列表,最多100个.
|
|
7238
|
-
|
|
7247
|
+
列表中的流程(合同)编号不要重复.
|
|
7239
7248
|
*/
|
|
7240
7249
|
FlowIds: Array<string>
|
|
7241
7250
|
/**
|
|
@@ -574,7 +574,7 @@ export class Client extends AbstractClient {
|
|
|
574
574
|
- **不撤回合同状态**:已全部签署完成、已拒签、已过期、已撤回、拒绝填写、已解除等合同状态。
|
|
575
575
|
|
|
576
576
|
注:
|
|
577
|
-
- 有对应合同撤销权限的人: <font color='red'
|
|
577
|
+
- 有对应合同撤销权限的人: <font color='red'>**合同的发起人(并已经授予撤销权限)或者发起人所在企业的超管、法人**</font>
|
|
578
578
|
- 签署完毕的合同需要双方走解除流程将合同作废,可以参考<a href="https://qian.tencent.com/developers/partnerApis/startFlows/ChannelCreateReleaseFlow" target="_blank">发起解除合同流程接口</a>
|
|
579
579
|
*/
|
|
580
580
|
async ChannelCancelFlow(
|
|
@@ -680,13 +680,15 @@ export class Client extends AbstractClient {
|
|
|
680
680
|
</table>
|
|
681
681
|
|
|
682
682
|
**注**:
|
|
683
|
-
|
|
683
|
+
1. 发起合同时候, 作为<font color="red">发起方的第三方子企业A员工的企业和员工必须经过实名</font>, 而作为签署方的第三方子企业A员工/个人/自然人/SaaS平台企业员工/第三方子企业B员工企业中的企业和个人/员工可以未实名
|
|
684
684
|
|
|
685
|
-
|
|
685
|
+
2. 不同类型的签署方传参不同, 可以参考开发者中心的FlowApproverInfo结构体说明
|
|
686
686
|
|
|
687
|
-
|
|
687
|
+
3. <font color="red">调用接口发起合同成功就会扣减合同的额度</font>, 如果未签署完成时撤销合同会返还此额度(过期,拒签,签署完成,解除完成等状态不会返还额度)
|
|
688
688
|
|
|
689
|
-
|
|
689
|
+
4. <font color="red">静默(自动)签署不支持合同签署方存在填写</font>
|
|
690
|
+
|
|
691
|
+
5. <font color="red">在下一步创建签署链接前,建议等待DocumentFill </font>[PDF合成完成的回调](https://qian.tencent.com/developers/partner/callback_types_file_resources)或者睡眠几秒,尤其是当模板中存在动态表格等复杂填写控件时,因为合成过程可能会耗费秒级别的时间。
|
|
690
692
|
*/
|
|
691
693
|
async CreateFlowsByTemplates(
|
|
692
694
|
req: CreateFlowsByTemplatesRequest,
|
|
@@ -958,7 +960,7 @@ Web链接访问后,会根据子客企业(**Agent中ProxyOrganizationOpenId表
|
|
|
958
960
|
}
|
|
959
961
|
|
|
960
962
|
/**
|
|
961
|
-
* 通过合同编号生成批量撤销合同的链接,单次最多支持撤销100份合同, 返回的链接需要有此权限的人<font color='red'
|
|
963
|
+
* 通过合同编号生成批量撤销合同的链接,单次最多支持撤销100份合同, 返回的链接需要有此权限的人<font color='red'>**合同的发起人(并已经授予撤销权限)或者发起人所在企业的超管、法人**</font>在<font color='red'>**手机端**</font>打开, 跳转到腾讯电子签小程序输入撤销原因来进行撤销合同
|
|
962
964
|
|
|
963
965
|
适用场景:如果某个合同当前**至少还有一方没有签署**,则可通过该接口取消该合同流程。常用于合同发错、内容填错,需要及时撤销的场景。
|
|
964
966
|
|
|
@@ -1185,7 +1187,7 @@ Web链接访问后,会根据子客企业(**Agent中ProxyOrganizationOpenId表
|
|
|
1185
1187
|
- **不撤回合同状态**:已全部签署完成、已拒签、已过期、已撤回、拒绝填写、已解除等合同状态。
|
|
1186
1188
|
|
|
1187
1189
|
注:
|
|
1188
|
-
- 有对应合同撤销权限的人: <font color='red'
|
|
1190
|
+
- 有对应合同撤销权限的人: <font color='red'>**合同的发起人(并已经授予撤销权限)或者发起人所在企业的超管、法人**</font>
|
|
1189
1191
|
- 签署完毕的合同需要双方走解除流程将合同作废,可以参考<a href="https://qian.tencent.com/developers/partnerApis/startFlows/ChannelCreateReleaseFlow" target="_blank">发起解除合同流程接口</a>
|
|
1190
1192
|
*/
|
|
1191
1193
|
async ChannelBatchCancelFlows(
|
|
@@ -1529,9 +1531,9 @@ Web链接访问后,会根据子客企业(**Agent中ProxyOrganizationOpenId表
|
|
|
1529
1531
|
/**
|
|
1530
1532
|
* 此接口(SyncProxyOrganizationOperators)用于同步 第三方平台子客企业经办人列表,主要是同步经办人的离职状态。子客Web控制台的组织架构管理,是依赖于第三方应用平台的,无法针对员工做新增/更新/离职等操作。
|
|
1531
1533
|
|
|
1532
|
-
- **新增员工的场景**:
|
|
1534
|
+
- **新增员工的场景**: 通过本接口提前导入员工列表, 然后调用<a href="https://qian.tencent.com/developers/partnerApis/accounts/CreateConsoleLoginUrl" target="_blank">生成子客登录链接</a>分享给对应的员工进行实名, 新增员工后员工的状态为**未实名**, 通过链接实名后状态变为**已实名**, 已实名员工就可以参与合同的发起和签署
|
|
1533
1535
|
|
|
1534
|
-
- **员工离职的场景**:
|
|
1536
|
+
- **员工离职的场景**: 通过本接口将员工置为离职, 员工无法登录控制台和腾讯电子签小程序进行操作了, 同时给此员工分配的openid会被回收可以给其他新员工使用 (离职后员工数据会被置空, 再次加入公司会从零开始) , 若员工信息有误可通过离职后在新增来解决, 离职员工状态为**离职**
|
|
1535
1537
|
|
|
1536
1538
|

|
|
1537
1539
|
|
|
@@ -1711,11 +1711,15 @@ export interface FormField {
|
|
|
1711
1711
|
/**
|
|
1712
1712
|
* 表单域或控件的ID,跟ComponentName二选一,不能全为空;
|
|
1713
1713
|
CreateFlowsByTemplates 接口不使用此字段。
|
|
1714
|
+
|
|
1715
|
+
<a href="https://dyn.ess.tencent.cn/guide/apivideo/channel_component_name.mp4" target="_blank">点击此处查看模板上控件ID的获取方式</a>
|
|
1714
1716
|
注意:此字段可能返回 null,表示取不到有效值。
|
|
1715
1717
|
*/
|
|
1716
1718
|
ComponentId?: string
|
|
1717
1719
|
/**
|
|
1718
1720
|
* 控件的名字,跟ComponentId二选一,不能全为空
|
|
1721
|
+
|
|
1722
|
+
<a href="https://dyn.ess.tencent.cn/guide/apivideo/channel_component_name.mp4" target="_blank">点击此处查看模板上控件名字的获取方式</a>
|
|
1719
1723
|
注意:此字段可能返回 null,表示取不到有效值。
|
|
1720
1724
|
*/
|
|
1721
1725
|
ComponentName?: string
|