tencentcloud-sdk-nodejs 4.0.456 → 4.0.458

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +312 -0
  2. package/SERVICE_CHANGELOG.md +309 -88
  3. package/package.json +1 -1
  4. package/products.md +18 -18
  5. package/src/common/abstract_client.ts +11 -1
  6. package/src/common/http/fetch.ts +12 -5
  7. package/src/common/http/http_connection.ts +23 -19
  8. package/src/common/interface.ts +11 -0
  9. package/src/common/sdk_version.ts +1 -1
  10. package/src/services/batch/v20170312/batch_models.ts +1 -1
  11. package/src/services/bma/v20210624/bma_client.ts +12 -11
  12. package/src/services/bma/v20210624/bma_models.ts +149 -149
  13. package/src/services/cdb/v20170320/cdb_client.ts +2 -1
  14. package/src/services/cdb/v20170320/cdb_models.ts +162 -10
  15. package/src/services/cpdp/v20190820/cpdp_client.ts +13 -0
  16. package/src/services/cpdp/v20190820/cpdp_models.ts +92 -0
  17. package/src/services/cvm/v20170312/cvm_client.ts +1 -1
  18. package/src/services/cvm/v20170312/cvm_models.ts +5 -5
  19. package/src/services/cwp/v20180228/cwp_client.ts +70 -19
  20. package/src/services/cwp/v20180228/cwp_models.ts +627 -215
  21. package/src/services/essbasic/v20210526/essbasic_models.ts +1 -1
  22. package/src/services/mariadb/v20170312/mariadb_client.ts +22 -60
  23. package/src/services/mariadb/v20170312/mariadb_models.ts +51 -358
  24. package/src/services/monitor/v20180724/monitor_models.ts +5 -0
  25. package/src/services/redis/v20180412/redis_models.ts +10 -10
  26. package/src/services/tcm/v20210413/tcm_client.ts +44 -8
  27. package/src/services/tcm/v20210413/tcm_models.ts +165 -39
  28. package/src/services/teo/v20220901/teo_models.ts +18 -5
  29. package/src/services/tse/v20201207/tse_client.ts +12 -0
  30. package/src/services/tse/v20201207/tse_models.ts +30 -0
  31. package/src/services/tsf/v20180326/tsf_client.ts +2 -0
  32. package/src/services/tsf/v20180326/tsf_models.ts +74 -1
  33. package/src/services/vod/v20180717/vod_client.ts +2 -2
  34. package/src/services/vod/v20180717/vod_models.ts +16 -0
  35. package/src/services/wav/v20210129/wav_models.ts +6 -0
  36. package/src/services/wedata/v20210820/wedata_client.ts +15 -3
  37. package/src/services/wedata/v20210820/wedata_models.ts +101 -44
  38. package/tencentcloud/common/abstract_client.d.ts +5 -1
  39. package/tencentcloud/common/abstract_client.js +6 -0
  40. package/tencentcloud/common/http/fetch.d.ts +6 -1
  41. package/tencentcloud/common/http/fetch.js +3 -2
  42. package/tencentcloud/common/http/http_connection.d.ts +10 -2
  43. package/tencentcloud/common/http/http_connection.js +8 -2
  44. package/tencentcloud/common/interface.d.ts +12 -0
  45. package/tencentcloud/common/sdk_version.d.ts +1 -1
  46. package/tencentcloud/common/sdk_version.js +1 -1
  47. package/tencentcloud/services/batch/v20170312/batch_models.d.ts +1 -1
  48. package/tencentcloud/services/bma/v20210624/bma_client.d.ts +11 -10
  49. package/tencentcloud/services/bma/v20210624/bma_client.js +11 -10
  50. package/tencentcloud/services/bma/v20210624/bma_models.d.ts +148 -148
  51. package/tencentcloud/services/cdb/v20170320/cdb_client.d.ts +1 -1
  52. package/tencentcloud/services/cdb/v20170320/cdb_models.d.ts +133 -10
  53. package/tencentcloud/services/cpdp/v20190820/cpdp_client.d.ts +5 -1
  54. package/tencentcloud/services/cpdp/v20190820/cpdp_client.js +6 -0
  55. package/tencentcloud/services/cpdp/v20190820/cpdp_models.d.ts +78 -0
  56. package/tencentcloud/services/cvm/v20170312/cvm_client.d.ts +1 -1
  57. package/tencentcloud/services/cvm/v20170312/cvm_client.js +1 -1
  58. package/tencentcloud/services/cvm/v20170312/cvm_models.d.ts +5 -5
  59. package/tencentcloud/services/cwp/v20180228/cwp_client.d.ts +21 -5
  60. package/tencentcloud/services/cwp/v20180228/cwp_client.js +30 -6
  61. package/tencentcloud/services/cwp/v20180228/cwp_models.d.ts +526 -178
  62. package/tencentcloud/services/essbasic/v20210526/essbasic_models.d.ts +1 -1
  63. package/tencentcloud/services/mariadb/v20170312/mariadb_client.d.ts +7 -19
  64. package/tencentcloud/services/mariadb/v20170312/mariadb_client.js +9 -27
  65. package/tencentcloud/services/mariadb/v20170312/mariadb_models.d.ts +45 -299
  66. package/tencentcloud/services/monitor/v20180724/monitor_models.d.ts +4 -0
  67. package/tencentcloud/services/redis/v20180412/redis_models.d.ts +10 -10
  68. package/tencentcloud/services/tcm/v20210413/tcm_client.d.ts +15 -3
  69. package/tencentcloud/services/tcm/v20210413/tcm_client.js +21 -3
  70. package/tencentcloud/services/tcm/v20210413/tcm_models.d.ts +141 -34
  71. package/tencentcloud/services/teo/v20220901/teo_models.d.ts +17 -5
  72. package/tencentcloud/services/tse/v20201207/tse_client.d.ts +5 -1
  73. package/tencentcloud/services/tse/v20201207/tse_client.js +6 -0
  74. package/tencentcloud/services/tse/v20201207/tse_models.d.ts +26 -0
  75. package/tencentcloud/services/tsf/v20180326/tsf_models.d.ts +62 -1
  76. package/tencentcloud/services/vod/v20180717/vod_client.d.ts +2 -2
  77. package/tencentcloud/services/vod/v20180717/vod_client.js +2 -2
  78. package/tencentcloud/services/vod/v20180717/vod_models.d.ts +14 -0
  79. package/tencentcloud/services/wav/v20210129/wav_models.d.ts +5 -0
  80. package/tencentcloud/services/wedata/v20210820/wedata_client.d.ts +5 -1
  81. package/tencentcloud/services/wedata/v20210820/wedata_client.js +6 -0
  82. package/tencentcloud/services/wedata/v20210820/wedata_models.d.ts +86 -38
  83. package/test/cpdp.v20190820.test.js +10 -0
  84. package/test/cwp.v20180228.test.js +44 -4
  85. package/test/mariadb.v20170312.test.js +6 -36
  86. package/test/tcm.v20210413.test.js +32 -2
  87. package/test/tse.v20201207.test.js +10 -0
  88. package/test/wedata.v20210820.test.js +10 -0
package/products.md CHANGED
@@ -18,13 +18,13 @@
18
18
  | asr | [语音识别](https://cloud.tencent.com/document/product/1093) | 2022-09-02 06:09:54 |
19
19
  | asw | [应用与服务编排工作流](https://cloud.tencent.com/document/product/1272) | 2022-04-04 06:08:40 |
20
20
  | ba | [网站备案](https://cloud.tencent.com/document/product/243) | 2022-04-04 06:08:45 |
21
- | batch | [批量计算](https://cloud.tencent.com/document/product/599) | 2022-09-08 06:09:02 |
21
+ | batch | [批量计算](https://cloud.tencent.com/document/product/599) | 2022-10-11 06:10:09 |
22
22
  | bda | [人体分析](https://cloud.tencent.com/document/product/1208) | 2022-09-06 06:10:38 |
23
23
  | bi | [商业智能分析 BI](https://cloud.tencent.com/document/product/590) | 2022-08-09 10:42:14 |
24
24
  | billing | [计费相关](https://cloud.tencent.com/document/product/555) | 2022-08-15 06:09:23 |
25
25
  | bizlive | [商业直播](https://cloud.tencent.com/document/product) | 2020-03-10 01:08:07 |
26
26
  | bm | [黑石物理服务器1.0](https://cloud.tencent.com/document/product/386) | 2022-08-09 11:50:03 |
27
- | bma | [品牌经营管家](https://cloud.tencent.com/document/product/1296) | 2022-09-28 06:10:28 |
27
+ | bma | [品牌经营管家](https://cloud.tencent.com/document/product/1296) | 2022-10-12 06:11:10 |
28
28
  | bmeip | [黑石弹性公网IP](https://cloud.tencent.com/document/product/1028) | 2022-04-19 06:04:56 |
29
29
  | bmlb | [黑石负载均衡](https://cloud.tencent.com/document/product/1027) | 2022-04-04 06:09:37 |
30
30
  | bmvpc | [黑石私有网络](https://cloud.tencent.com/document/product/1024) | 2022-04-15 06:02:36 |
@@ -39,7 +39,7 @@
39
39
  | cat | [云拨测](https://cloud.tencent.com/document/product/280) | 2022-09-15 11:03:22 |
40
40
  | cbs | [云硬盘](https://cloud.tencent.com/document/product/362) | 2022-09-08 06:11:23 |
41
41
  | ccc | [云呼叫中心](https://cloud.tencent.com/document/product/679) | 2022-09-22 06:12:48 |
42
- | cdb | [云数据库 MySQL](https://cloud.tencent.com/document/product/236) | 2022-09-29 06:13:46 |
42
+ | cdb | [云数据库 MySQL](https://cloud.tencent.com/document/product/236) | 2022-10-11 06:14:09 |
43
43
  | cdc | [本地专用集群](https://cloud.tencent.com/document/product/1346) | 2022-07-30 15:07:54 |
44
44
  | cdn | [内容分发网络](https://cloud.tencent.com/document/product/228) | 2022-09-30 06:15:35 |
45
45
  | cds | [数据安全审计](https://cloud.tencent.com/document/product/856) | 2022-04-04 06:17:07 |
@@ -60,10 +60,10 @@
60
60
  | cme | [多媒体创作引擎](https://cloud.tencent.com/document/product/1156) | 2022-08-24 06:19:05 |
61
61
  | cmq | [消息队列 CMQ](https://cloud.tencent.com/document/product/406) | 2022-04-04 06:23:04 |
62
62
  | cms | [内容安全](https://cloud.tencent.com/document/product) | 2020-10-29 08:03:08 |
63
- | cpdp | [企业收付平台](https://cloud.tencent.com/document/product/1122) | 2022-09-29 06:20:13 |
63
+ | cpdp | [企业收付平台](https://cloud.tencent.com/document/product/1122) | 2022-10-11 06:20:53 |
64
64
  | cr | [金融联络机器人](https://cloud.tencent.com/document/product/656) | 2021-02-24 08:03:24 |
65
- | cvm | [云服务器](https://cloud.tencent.com/document/product/213) | 2022-09-30 06:22:32 |
66
- | cwp | [主机安全](https://cloud.tencent.com/document/product/296) | 2022-10-10 06:18:10 |
65
+ | cvm | [云服务器](https://cloud.tencent.com/document/product/213) | 2022-10-12 06:23:14 |
66
+ | cwp | [主机安全](https://cloud.tencent.com/document/product/296) | 2022-10-12 06:24:06 |
67
67
  | cws | [漏洞扫描服务](https://cloud.tencent.com/document/product) | 2019-11-22 12:16:15 |
68
68
  | cynosdb | [云原生数据库 TDSQL-C](https://cloud.tencent.com/document/product/1003) | 2022-09-22 06:22:08 |
69
69
  | dasb | [堡垒机](https://cloud.tencent.com/document/product/1025) | 2022-08-16 06:19:02 |
@@ -89,7 +89,7 @@
89
89
  | emr | [弹性 MapReduce](https://cloud.tencent.com/document/product/589) | 2022-09-06 06:30:34 |
90
90
  | es | [Elasticsearch Service](https://cloud.tencent.com/document/product/845) | 2022-09-28 06:30:23 |
91
91
  | ess | [电子签服务](https://cloud.tencent.com/document/product/1323) | 2022-09-30 06:31:46 |
92
- | essbasic | [腾讯电子签(基础版)](https://cloud.tencent.com/document/product/1420) | 2022-09-30 06:32:03 |
92
+ | essbasic | [腾讯电子签(基础版)](https://cloud.tencent.com/document/product/1420) | 2022-10-10 15:36:47 |
93
93
  | facefusion | [人脸融合](https://cloud.tencent.com/document/product/670) | 2022-06-15 06:09:10 |
94
94
  | faceid | [人脸核身](https://cloud.tencent.com/document/product/1007) | 2022-09-20 06:29:06 |
95
95
  | fmu | [人脸试妆](https://cloud.tencent.com/document/product/1172) | 2022-04-04 06:43:06 |
@@ -122,14 +122,14 @@
122
122
  | live | [云直播](https://cloud.tencent.com/document/product/267) | 2022-09-23 06:36:42 |
123
123
  | lowcode | [云开发低码](https://cloud.tencent.com/document/product/1301) | 2022-04-04 06:56:51 |
124
124
  | lp | [登录保护](https://cloud.tencent.com/document/product/1190) | 2022-04-04 06:56:52 |
125
- | mariadb | [云数据库 MariaDB](https://cloud.tencent.com/document/product/237) | 2022-07-27 06:13:02 |
125
+ | mariadb | [云数据库 MariaDB](https://cloud.tencent.com/document/product/237) | 2022-10-12 06:43:12 |
126
126
  | market | [云市场](https://cloud.tencent.com/document/product/306) | 2022-04-04 06:57:43 |
127
127
  | memcached | [云数据库 Memcached](https://cloud.tencent.com/document/product/241) | 2022-04-04 06:57:44 |
128
128
  | mgobe | [游戏联机对战引擎](https://cloud.tencent.com/document/product/1038) | 2022-07-08 06:11:32 |
129
129
  | mmps | [小程序安全](https://cloud.tencent.com/document/product/1223) | 2022-08-25 06:38:57 |
130
130
  | mna | [移动网络加速](https://cloud.tencent.com/document/product/1385) | 2022-09-14 20:21:28 |
131
131
  | mongodb | [云数据库 MongoDB](https://cloud.tencent.com/document/product/240) | 2022-10-10 06:31:49 |
132
- | monitor | [云监控](https://cloud.tencent.com/document/product/248) | 2022-10-10 06:32:08 |
132
+ | monitor | [云监控](https://cloud.tencent.com/document/product/248) | 2022-10-11 06:43:21 |
133
133
  | mps | [视频处理](https://cloud.tencent.com/document/product/862) | 2022-09-20 06:38:58 |
134
134
  | mrs | [医疗报告结构化](https://cloud.tencent.com/document/product/1314) | 2022-06-28 06:14:04 |
135
135
  | ms | [移动应用安全](https://cloud.tencent.com/document/product/283) | 2022-09-16 17:41:33 |
@@ -146,7 +146,7 @@
146
146
  | privatedns | [私有域解析 Private DNS](https://cloud.tencent.com/document/product/1338) | 2022-09-19 06:43:11 |
147
147
  | pts | [云压测](https://cloud.tencent.com/document/product/1484) | 2022-09-19 06:43:24 |
148
148
  | rce | [全栈式风控引擎](https://cloud.tencent.com/document/product/1343) | 2022-09-23 06:43:17 |
149
- | redis | [云数据库 Redis](https://cloud.tencent.com/document/product/239) | 2022-10-10 06:35:50 |
149
+ | redis | [云数据库 Redis](https://cloud.tencent.com/document/product/239) | 2022-10-11 06:48:18 |
150
150
  | region | [地域管理系统](https://cloud.tencent.com/document/product/1596) | 2022-07-27 21:10:02 |
151
151
  | rkp | [风险探针](https://cloud.tencent.com/document/product/1169) | 2022-04-04 07:04:04 |
152
152
  | rp | [注册保护](https://cloud.tencent.com/document/product/1191) | 2022-04-04 07:04:06 |
@@ -158,7 +158,7 @@
158
158
  | sms | [短信](https://cloud.tencent.com/document/product/382) | 2022-08-17 06:36:01 |
159
159
  | soe | [智聆口语评测](https://cloud.tencent.com/document/product/884) | 2022-06-07 06:12:07 |
160
160
  | solar | [智汇零售](https://cloud.tencent.com/document/product) | 2020-03-19 08:01:59 |
161
- | sqlserver | [云数据库 SQL Server](https://cloud.tencent.com/document/product/238) | 2022-09-09 06:39:25 |
161
+ | sqlserver | [云数据库 SQL Server](https://cloud.tencent.com/document/product/238) | 2022-10-11 06:50:59 |
162
162
  | ssa | [安全运营中心](https://cloud.tencent.com/document/product/664) | 2022-08-16 06:39:20 |
163
163
  | ssl | [证书](https://cloud.tencent.com/document/product/400) | 2022-09-08 06:38:47 |
164
164
  | sslpod | [SSL 证书监控](https://cloud.tencent.com/document/product/1084) | 2022-04-04 07:07:55 |
@@ -177,7 +177,7 @@
177
177
  | tcbr | [云托管 CloudBase Run](https://cloud.tencent.com/document/product/1243) | 2022-08-23 06:50:39 |
178
178
  | tcex | [腾讯云释义](https://cloud.tencent.com/document/product/1266) | 2022-07-21 06:17:29 |
179
179
  | tci | [腾讯智学课堂分析](https://cloud.tencent.com/document/product) | 2020-08-24 08:06:03 |
180
- | tcm | [服务网格](https://cloud.tencent.com/document/product/1261) | 2022-09-26 06:52:58 |
180
+ | tcm | [服务网格](https://cloud.tencent.com/document/product/1261) | 2022-10-11 06:54:36 |
181
181
  | tcr | [容器镜像服务](https://cloud.tencent.com/document/product/1141) | 2022-09-26 06:53:07 |
182
182
  | tcss | [容器安全服务](https://cloud.tencent.com/document/product/1285) | 2022-09-08 06:41:25 |
183
183
  | tdcpg | [TDSQL-C PostgreSQL 版](https://cloud.tencent.com/document/product/1556) | 2022-07-05 06:21:49 |
@@ -185,7 +185,7 @@
185
185
  | tdmq | [分布式消息队列](https://cloud.tencent.com/document/product/1179) | 2022-09-22 06:48:45 |
186
186
  | tds | [设备安全](https://cloud.tencent.com/document/product/1628) | 2022-10-10 06:42:56 |
187
187
  | tem | [弹性微服务](https://cloud.tencent.com/document/product/1371) | 2022-09-28 06:54:52 |
188
- | teo | [边缘安全加速平台](https://cloud.tencent.com/document/product/1552) | 2022-10-10 06:43:20 |
188
+ | teo | [边缘安全加速平台](https://cloud.tencent.com/document/product/1552) | 2022-10-11 06:58:18 |
189
189
  | thpc | [高性能计算平台](https://cloud.tencent.com/document/product/1527) | 2022-06-02 06:15:03 |
190
190
  | tia | [智能钛机器学习](https://cloud.tencent.com/document/product/851) | 2021-10-21 11:12:52 |
191
191
  | tic | [腾讯云IaC平台](https://cloud.tencent.com/document/product/1213) | 2022-04-04 07:16:52 |
@@ -201,18 +201,18 @@
201
201
  | tmt | [机器翻译](https://cloud.tencent.com/document/product/551) | 2022-08-31 06:55:53 |
202
202
  | trp | [T-Sec-安心平台(RP)](https://cloud.tencent.com/document/product/1458) | 2022-09-02 07:00:24 |
203
203
  | trtc | [实时音视频](https://cloud.tencent.com/document/product/647) | 2022-09-28 06:58:25 |
204
- | tse | [腾讯云微服务引擎](https://cloud.tencent.com/document/product/1364) | 2022-09-27 06:48:42 |
205
- | tsf | [腾讯微服务平台 TSF](https://cloud.tencent.com/document/product/649) | 2022-07-27 06:18:08 |
204
+ | tse | [腾讯云微服务引擎](https://cloud.tencent.com/document/product/1364) | 2022-10-12 07:03:55 |
205
+ | tsf | [腾讯微服务平台 TSF](https://cloud.tencent.com/document/product/649) | 2022-10-11 07:02:55 |
206
206
  | tsw | [腾讯微服务观测平台 TSW](https://cloud.tencent.com/document/product/1311) | 2022-04-04 07:22:40 |
207
207
  | tts | [语音合成](https://cloud.tencent.com/document/product/1073) | 2022-09-08 06:47:44 |
208
208
  | ump | [客流数字化平台](https://cloud.tencent.com/document/product/1320) | 2022-04-04 07:22:44 |
209
209
  | vm | [视频内容安全](https://cloud.tencent.com/document/product/1265) | 2022-09-16 06:48:14 |
210
210
  | vms | [语音消息](https://cloud.tencent.com/document/product/1128) | 2022-04-04 07:22:54 |
211
- | vod | [云点播](https://cloud.tencent.com/document/product/266) | 2022-09-27 06:50:30 |
211
+ | vod | [云点播](https://cloud.tencent.com/document/product/266) | 2022-10-12 07:06:19 |
212
212
  | vpc | [私有网络](https://cloud.tencent.com/document/product/215) | 2022-10-10 06:50:01 |
213
213
  | waf | [Web 应用防火墙](https://cloud.tencent.com/document/product/627) | 2022-09-15 06:49:04 |
214
- | wav | [企业微信汽车行业版](https://cloud.tencent.com/document/product/1318) | 2022-04-04 07:39:05 |
215
- | wedata | [数据开发治理平台 WeData](https://cloud.tencent.com/document/product/1267) | 2022-09-21 17:26:55 |
214
+ | wav | [企业微信汽车行业版](https://cloud.tencent.com/document/product/1318) | 2022-10-12 07:10:28 |
215
+ | wedata | [数据开发治理平台 WeData](https://cloud.tencent.com/document/product/1267) | 2022-10-12 07:10:44 |
216
216
  | wss | [SSL证书管理服务](https://cloud.tencent.com/document/product) | 2020-04-01 08:53:44 |
217
217
  | yinsuda | [音速达直播音乐版权引擎](https://cloud.tencent.com/document/product/1592) | 2022-09-16 06:52:09 |
218
218
  | youmall | [](https://cloud.tencent.com/document/product) | 2019-01-11 11:24:15 |
@@ -6,8 +6,12 @@ import TencentCloudSDKHttpException from "./exception/tencent_cloud_sdk_exceptio
6
6
  import { Response } from "node-fetch"
7
7
 
8
8
  export type ResponseCallback<TReuslt = any> = (error: string, rep: TReuslt) => void
9
- export interface RequestOptions extends Pick<ClientProfile["httpProfile"], "headers"> {
9
+ export interface RequestOptions extends Partial<Pick<ClientProfile["httpProfile"], "headers">> {
10
10
  multipart?: boolean
11
+ /**
12
+ * 中止请求信号
13
+ */
14
+ signal?: AbortSignal
11
15
  }
12
16
 
13
17
  interface RequestData {
@@ -140,6 +144,9 @@ export class AbstractClient {
140
144
  data: params,
141
145
  timeout: this.profile.httpProfile.reqTimeout * 1000,
142
146
  headers: Object.assign({}, this.profile.httpProfile.headers, options.headers),
147
+ agent: this.profile.httpProfile.agent,
148
+ proxy: this.profile.httpProfile.proxy,
149
+ signal: options.signal,
143
150
  })
144
151
  } catch (error) {
145
152
  throw new TencentCloudSDKHttpException(error.message)
@@ -173,6 +180,9 @@ export class AbstractClient {
173
180
  requestClient: this.sdkVersion,
174
181
  language: this.profile.language,
175
182
  headers: Object.assign({}, this.profile.httpProfile.headers, options.headers),
183
+ agent: this.profile.httpProfile.agent,
184
+ proxy: this.profile.httpProfile.proxy,
185
+ signal: options.signal,
176
186
  })
177
187
  } catch (e) {
178
188
  throw new TencentCloudSDKHttpException(e.message)
@@ -1,12 +1,19 @@
1
1
  import fetch, { RequestInit, Response } from "node-fetch"
2
2
  import HttpsProxyAgent = require("https-proxy-agent")
3
3
 
4
- export default function (url: string, options: RequestInit): Promise<Response> {
5
- const instanceOptions = options || {}
4
+ export interface FetchOptions extends Omit<RequestInit, "signal"> {
5
+ proxy?: string
6
+ headers: Record<string, string>
7
+ // node-fetch中的signal声明与ts自带的有点冲突,以ts的为准
8
+ signal: AbortSignal
9
+ }
10
+ export default function (url: string, options: FetchOptions): Promise<Response> {
11
+ const instanceOptions = options || ({} as FetchOptions)
6
12
 
7
- if (!options.agent && process.env.http_proxy) {
8
- instanceOptions.agent = new (HttpsProxyAgent as any)(process.env.http_proxy)
13
+ const proxy = options.proxy || process.env.http_proxy
14
+ if (!options.agent && proxy) {
15
+ instanceOptions.agent = new (HttpsProxyAgent as any)(proxy)
9
16
  }
10
17
 
11
- return fetch(url, instanceOptions)
18
+ return fetch(url, instanceOptions as any)
12
19
  }
@@ -4,9 +4,9 @@ import * as isStream from "is-stream"
4
4
  import * as getStream from "get-stream"
5
5
  import * as FormData from "form-data"
6
6
  import Sign from "../sign"
7
- import fetch from "./fetch"
8
- import { Response } from "node-fetch"
9
-
7
+ import fetch, { FetchOptions } from "./fetch"
8
+ import { Response, RequestInit } from "node-fetch"
9
+ import { Agent } from "http"
10
10
  /**
11
11
  * @inner
12
12
  */
@@ -17,24 +17,26 @@ export class HttpConnection {
17
17
  data,
18
18
  timeout,
19
19
  headers = {},
20
+ agent,
21
+ proxy,
22
+ signal,
20
23
  }: {
21
24
  method: string
22
25
  url: string
23
26
  data: any
24
27
  timeout: number
25
28
  headers?: Record<string, string>
29
+ agent?: Agent
30
+ proxy?: string
31
+ signal?: AbortSignal
26
32
  }): Promise<Response> {
27
- const config: {
28
- method: string
29
- timeout: number
30
- headers: {
31
- [key: string]: string
32
- }
33
- body?: string
34
- } = {
33
+ const config: FetchOptions = {
35
34
  method: method,
36
35
  headers: Object.assign({}, headers),
37
36
  timeout,
37
+ agent,
38
+ proxy,
39
+ signal,
38
40
  }
39
41
  if (method === "GET") {
40
42
  url += "?" + QueryString.stringify(data)
@@ -61,6 +63,9 @@ export class HttpConnection {
61
63
  requestClient,
62
64
  language,
63
65
  headers = {},
66
+ agent,
67
+ proxy,
68
+ signal,
64
69
  }: {
65
70
  method: string
66
71
  url: string
@@ -77,6 +82,9 @@ export class HttpConnection {
77
82
  requestClient: string
78
83
  language: string
79
84
  headers?: Record<string, string>
85
+ agent?: Agent
86
+ proxy?: string
87
+ signal?: AbortSignal
80
88
  }): Promise<Response> {
81
89
  // data 中可能带有 readStream,由于需要计算整个 body 的 hash,
82
90
  // 所以这里把 readStream 转为 Buffer
@@ -98,14 +106,7 @@ export class HttpConnection {
98
106
  if (method === "POST") {
99
107
  payload = data
100
108
  }
101
- const config: {
102
- method: string
103
- timeout: number
104
- headers: {
105
- [key: string]: any
106
- }
107
- body?: any
108
- } = {
109
+ const config: FetchOptions = {
109
110
  method,
110
111
  timeout,
111
112
  headers: Object.assign({}, headers, {
@@ -117,6 +118,9 @@ export class HttpConnection {
117
118
  "X-TC-Token": token,
118
119
  "X-TC-RequestClient": requestClient,
119
120
  }),
121
+ agent,
122
+ proxy,
123
+ signal,
120
124
  }
121
125
 
122
126
  if (token === null) {
@@ -1,3 +1,4 @@
1
+ import { Agent } from "http"
1
2
  /**
2
3
  * 初始化client对象参数类型
3
4
  */
@@ -65,6 +66,16 @@ export interface ClientProfile {
65
66
  * 非必选
66
67
  */
67
68
  headers?: Record<string, string>
69
+ /**
70
+ * 高级请求代理,例如 new HttpsProxyAgent("http://127.0.0.1:8899")
71
+ *
72
+ * 优先级高于 proxy 配置
73
+ */
74
+ agent?: Agent
75
+ /**
76
+ * http请求代理,例如 "http://127.0.0.1:8899"
77
+ */
78
+ proxy?: string
68
79
  }
69
80
  /**
70
81
  * api请求时附带的 language 字段
@@ -1 +1 @@
1
- export const sdkVersion = "4.0.456"
1
+ export const sdkVersion = "4.0.458"
@@ -2359,7 +2359,7 @@ export interface Placement {
2359
2359
  Zone: string
2360
2360
 
2361
2361
  /**
2362
- * 实例所属项目ID。该参数可以通过调用 [DescribeProject](/document/api/378/4400) 的返回值中的 projectId 字段来获取。不填为默认项目。
2362
+ * 实例所属项目ID。该参数可以通过调用 [DescribeProject](https://cloud.tencent.com/document/api/651/78725) 的返回值中的 projectId 字段来获取。不填为默认项目。
2363
2363
  */
2364
2364
  ProjectId?: number
2365
2365
 
@@ -110,7 +110,7 @@ export class Client extends AbstractClient {
110
110
  }
111
111
 
112
112
  /**
113
- * 品牌经营管家-版权保护个人认证接口
113
+ * 本接口用于个人认证,新接入用户必须认证后才可以进行后续操作(个人认证和企业认证二选一),只需认证一次即可
114
114
  */
115
115
  async CreateCRUserVerify(
116
116
  req: CreateCRUserVerifyRequest,
@@ -120,7 +120,7 @@ export class Client extends AbstractClient {
120
120
  }
121
121
 
122
122
  /**
123
- * 版权保护-添加作品接口
123
+ * 新建作品
124
124
  */
125
125
  async CreateCRWork(
126
126
  req: CreateCRWorkRequest,
@@ -140,8 +140,9 @@ export class Client extends AbstractClient {
140
140
  }
141
141
 
142
142
  /**
143
- * 版权保护-新建拦截接口
144
- */
143
+ * 新建拦截
144
+
145
+ */
145
146
  async CreateCRBlock(
146
147
  req: CreateCRBlockRequest,
147
148
  cb?: (error: string, rep: CreateCRBlockResponse) => void
@@ -150,7 +151,7 @@ export class Client extends AbstractClient {
150
151
  }
151
152
 
152
153
  /**
153
- * 申请取证
154
+ * 取证申请
154
155
  */
155
156
  async ModifyCRObtainStatus(
156
157
  req: ModifyCRObtainStatusRequest,
@@ -180,7 +181,7 @@ export class Client extends AbstractClient {
180
181
  }
181
182
 
182
183
  /**
183
- * 版权保护-修改监测状态接口
184
+ * 开启/关闭监测
184
185
  */
185
186
  async ModifyCRMonitor(
186
187
  req: ModifyCRMonitorRequest,
@@ -210,7 +211,7 @@ export class Client extends AbstractClient {
210
211
  }
211
212
 
212
213
  /**
213
- * 新增权属文件
214
+ * 权属文件添加
214
215
  */
215
216
  async CreateCRRightFile(
216
217
  req: CreateCRRightFileRequest,
@@ -220,7 +221,7 @@ export class Client extends AbstractClient {
220
221
  }
221
222
 
222
223
  /**
223
- * 版权保护-白名单修改接口
224
+ * 修改白名单列表
224
225
  */
225
226
  async ModifyCRWhiteList(
226
227
  req: ModifyCRWhiteListRequest,
@@ -230,7 +231,7 @@ export class Client extends AbstractClient {
230
231
  }
231
232
 
232
233
  /**
233
- * 版权保护-拦截申请接口
234
+ * 拦截申请
234
235
  */
235
236
  async ModifyCRBlockStatus(
236
237
  req: ModifyCRBlockStatusRequest,
@@ -300,7 +301,7 @@ export class Client extends AbstractClient {
300
301
  }
301
302
 
302
303
  /**
303
- * 版权保护-维权申请接口
304
+ * 发函申请
304
305
  */
305
306
  async ModifyCRRightStatus(
306
307
  req: ModifyCRRightStatusRequest,
@@ -340,7 +341,7 @@ export class Client extends AbstractClient {
340
341
  }
341
342
 
342
343
  /**
343
- * 品牌经营管家-版权保护模块企业认证接口
344
+ * 本接口用于企业认证,新接入用户必须认证后才可以进行后续操作(个人认证和企业认证二选一),只需认证一次即可
344
345
  */
345
346
  async CreateCRCompanyVerify(
346
347
  req: CreateCRCompanyVerifyRequest,