tencentcloud-sdk-nodejs 4.0.457 → 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 (56) hide show
  1. package/CHANGELOG.md +143 -0
  2. package/SERVICE_CHANGELOG.md +171 -84
  3. package/package.json +1 -1
  4. package/products.md +8 -8
  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/bma/v20210624/bma_client.ts +12 -11
  11. package/src/services/bma/v20210624/bma_models.ts +149 -149
  12. package/src/services/cvm/v20170312/cvm_client.ts +1 -1
  13. package/src/services/cvm/v20170312/cvm_models.ts +4 -4
  14. package/src/services/cwp/v20180228/cwp_client.ts +70 -19
  15. package/src/services/cwp/v20180228/cwp_models.ts +627 -215
  16. package/src/services/mariadb/v20170312/mariadb_client.ts +22 -60
  17. package/src/services/mariadb/v20170312/mariadb_models.ts +51 -358
  18. package/src/services/tse/v20201207/tse_client.ts +12 -0
  19. package/src/services/tse/v20201207/tse_models.ts +30 -0
  20. package/src/services/vod/v20180717/vod_models.ts +16 -0
  21. package/src/services/wav/v20210129/wav_models.ts +6 -0
  22. package/src/services/wedata/v20210820/wedata_client.ts +15 -3
  23. package/src/services/wedata/v20210820/wedata_models.ts +101 -44
  24. package/tencentcloud/common/abstract_client.d.ts +5 -1
  25. package/tencentcloud/common/abstract_client.js +6 -0
  26. package/tencentcloud/common/http/fetch.d.ts +6 -1
  27. package/tencentcloud/common/http/fetch.js +3 -2
  28. package/tencentcloud/common/http/http_connection.d.ts +10 -2
  29. package/tencentcloud/common/http/http_connection.js +8 -2
  30. package/tencentcloud/common/interface.d.ts +12 -0
  31. package/tencentcloud/common/sdk_version.d.ts +1 -1
  32. package/tencentcloud/common/sdk_version.js +1 -1
  33. package/tencentcloud/services/bma/v20210624/bma_client.d.ts +11 -10
  34. package/tencentcloud/services/bma/v20210624/bma_client.js +11 -10
  35. package/tencentcloud/services/bma/v20210624/bma_models.d.ts +148 -148
  36. package/tencentcloud/services/cvm/v20170312/cvm_client.d.ts +1 -1
  37. package/tencentcloud/services/cvm/v20170312/cvm_client.js +1 -1
  38. package/tencentcloud/services/cvm/v20170312/cvm_models.d.ts +4 -4
  39. package/tencentcloud/services/cwp/v20180228/cwp_client.d.ts +21 -5
  40. package/tencentcloud/services/cwp/v20180228/cwp_client.js +30 -6
  41. package/tencentcloud/services/cwp/v20180228/cwp_models.d.ts +526 -178
  42. package/tencentcloud/services/mariadb/v20170312/mariadb_client.d.ts +7 -19
  43. package/tencentcloud/services/mariadb/v20170312/mariadb_client.js +9 -27
  44. package/tencentcloud/services/mariadb/v20170312/mariadb_models.d.ts +45 -299
  45. package/tencentcloud/services/tse/v20201207/tse_client.d.ts +5 -1
  46. package/tencentcloud/services/tse/v20201207/tse_client.js +6 -0
  47. package/tencentcloud/services/tse/v20201207/tse_models.d.ts +26 -0
  48. package/tencentcloud/services/vod/v20180717/vod_models.d.ts +14 -0
  49. package/tencentcloud/services/wav/v20210129/wav_models.d.ts +5 -0
  50. package/tencentcloud/services/wedata/v20210820/wedata_client.d.ts +5 -1
  51. package/tencentcloud/services/wedata/v20210820/wedata_client.js +6 -0
  52. package/tencentcloud/services/wedata/v20210820/wedata_models.d.ts +86 -38
  53. package/test/cwp.v20180228.test.js +44 -4
  54. package/test/mariadb.v20170312.test.js +6 -36
  55. package/test/tse.v20201207.test.js +10 -0
  56. package/test/wedata.v20210820.test.js +10 -0
@@ -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.457"
1
+ export const sdkVersion = "4.0.458"
@@ -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,