tencentcloud-sdk-nodejs-lowcode 4.0.781 → 4.0.1039

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/README.md CHANGED
@@ -1,36 +1,66 @@
1
1
  # 简介
2
2
 
3
- 欢迎使用腾讯云开发者工具套件(SDK),NODEJS SDK 4.0 是云 API 3.0 平台的配套工具。目前已经支持 cvm、vpc、cbs 等产品,后续所有的云服务产品都会接入进来。新版 SDK 实现了统一化,具有各个语言版本的 SDK 使用方法相同,接口调用方式相同,统一的错误码和返回包格式这些优点。
4
- 为方便 NODEJS 开发者调试和接入腾讯云产品 API,这里向您介绍适用于 NODEJS 的腾讯云开发工具包,并提供首次使用开发工具包的简单示例。让您快速获取腾讯云 NODEJS SDK 并开始调用。
3
+ 欢迎使用腾讯云开发者工具套件(SDK),Node.js SDK 4.0 是云 API 3.0 平台的配套工具。
4
+ 为方便 Node.js 开发者调试和接入腾讯云产品 API,这里向您介绍适用于 Node.js 的腾讯云开发工具包,并提供首次使用开发工具包的简单示例。让您快速获取腾讯云 Node.js SDK 并开始调用。
5
5
 
6
6
  # 依赖环境
7
7
 
8
- 1. NODEJS 10.0.0 版本及以上
9
- 2. 从腾讯云控制台 开通相应产品
10
- 3. 获取 SecretID、SecretKey 以及调用地址(endpoint),endpoint 一般形式为\*.tencentcloudapi.com,如 CVM 的调用地址为 cvm.tencentcloudapi.com,具体参考各产品说明。
8
+ 1. Node.js 10.0.0 版本及以上。
9
+ 2. 注意:部分产品需在 [腾讯云控制台](https://console.cloud.tencent.com/) 开通服务后才能使用。
11
10
 
12
11
  # 获取安装
13
12
 
14
- 安装 NODEJS SDK 前,先获取安全凭证。在第一次使用云 API 之前,用户首先需要在腾讯云控制台上申请安全凭证,安全凭证包括 SecretID SecretKey, SecretID 是用于标识 API 调用者的身份,SecretKey 是用于加密签名字符串和服务器端验证签名字符串的密钥。SecretKey 必须严格保管,避免泄露。
13
+ 使用 SDK 需要 API 密钥,可前往 [腾讯云控制台 - 访问密钥](https://console.cloud.tencent.com/cam/capi) 页面申请,API 密钥包括 SecretID SecretKey,密钥须严格保管,避免泄露。
15
14
 
16
- ## 通过 Npm 安装
15
+ ## 通过 npm 安装
17
16
 
18
- 通过 npm 获取安装是使用 NODEJS SDK 的推荐方法,npm 是 NODEJS 的包管理工具。关于 npm 详细可参考[ npm 官网](https://www.npmjs.com/) 。
17
+ 通过 npm 获取安装是使用 Node.js SDK 的推荐方法,关于 npm 详细可参考 [NPM 官网](https://www.npmjs.com/) 。
19
18
 
20
- 1. 执行以下安装命令:
21
- > npm install tencentcloud-sdk-nodejs --save
22
- 2. 在您的代码中引用对应模块代码,可参考示例。
23
- 3. 如上引用方式会将腾讯云所有产品sdk下载到本地,可以将tencentcloud-sdk-nodejs换成tencentcloud-sdk-nodejs-cvm/cbs/vpc等,即可引用特定产品的sdk,代码中可将require("tencentcloud-sdk-nodejs")改为require("tencentcloud-sdk-nodejs-cvm/cbs/vpc"),其余不变,可参考示例,可大大节省存储空间。
19
+ ### 安装指定产品 SDK(推荐)
20
+
21
+ 安装 CVM SDK:
22
+
23
+ ```
24
+ npm install tencentcloud-sdk-nodejs-cvm --save
25
+ ```
26
+
27
+ 安装 VPC SDK:
28
+
29
+ ```
30
+ npm install tencentcloud-sdk-nodejs-vpc --save
31
+ ```
32
+
33
+ 具体产品的缩写表请参考 [products.md](./products.md) 中的包名字段。
34
+
35
+ 安装指定产品 SDK 后,注意修改引入的包名:
36
+
37
+ ```diff
38
+ - const tencentcloud = require("tencentcloud-sdk-nodejs")
39
+ + const { cvm } = require("tencentcloud-sdk-nodejs-cvm")
40
+
41
+ - const CvmClient = tencentcloud.cvm.v20170312.Client
42
+ + const CvmClient = cvm.v20170312.Client
43
+ ```
44
+
45
+ ### 安装全产品 SDK
46
+
47
+ ```
48
+ npm install tencentcloud-sdk-nodejs --save
49
+ ```
50
+
51
+ 全产品 SDK 包含了所有云产品的调用代码,体积偏大,对体积敏感的场景,推荐安装指定产品 SDK。
24
52
 
25
53
  ## 通过源码包安装
26
54
 
27
- 1. 前往 [Github 仓库](https://github.com/tencentcloud/tencentcloud-sdk-nodejs) 或者 [Gitee 仓库](https://gitee.com/tencentcloud/tencentcloud-sdk-nodejs) 下载源码压缩包。
55
+ 1. 前往 [GitHub 仓库](https://github.com/tencentcloud/tencentcloud-sdk-nodejs) 或者 [Gitee 仓库](https://gitee.com/tencentcloud/tencentcloud-sdk-nodejs) 下载源码压缩包。
28
56
  2. 解压源码包到您项目合适的位置,例如 `sdk/tencentcloud-sdk-nodejs`。
29
57
  3. 执行 `npm install ./sdk/tencentcloud-sdk-nodejs`。
30
- 4. 使用 `require("tencentcloud-sdk-nodejs")` 的方式引入sdk,具体可参考示例。
58
+ 4. 使用 `require("tencentcloud-sdk-nodejs")` 的方式引入 SDK,具体可参考示例。
31
59
 
32
60
  # 示例
33
61
 
62
+ 以云服务器产品查询可用区列表接口为例。
63
+
34
64
  ```js
35
65
  const tencentcloud = require("tencentcloud-sdk-nodejs")
36
66
 
@@ -53,6 +83,9 @@ const client = new CvmClient({
53
83
  httpProfile: {
54
84
  reqMethod: "POST", // 请求方法
55
85
  reqTimeout: 30, // 请求超时时间,默认60s
86
+ headers: {
87
+ // 自定义 header
88
+ },
56
89
  // proxy: "http://127.0.0.1:8899" // http请求代理
57
90
  },
58
91
  },
@@ -70,7 +103,7 @@ client.DescribeZones().then(
70
103
  )
71
104
  ```
72
105
 
73
- 在支持 typescript 项目中,采用如下方式调用
106
+ 在支持 TypeScript 项目中,采用如下方式调用
74
107
 
75
108
  ```js
76
109
  import * as tencentcloud from "tencentcloud-sdk-nodejs"
@@ -80,23 +113,31 @@ const CvmClient = tencentcloud.cvm.v20170312.Client
80
113
  // ...
81
114
  ```
82
115
 
83
- 实例化`Client` 的入参支持 `clientConfig` 数据结构和说明 详见 [ClientConfig](https://github.com/TencentCloud/tencentcloud-sdk-nodejs/blob/master/src/common/interface.ts)
116
+ 实例化 `Client` 的入参支持 `clientConfig`,数据结构和说明详见 [ClientConfig](https://github.com/TencentCloud/tencentcloud-sdk-nodejs/blob/master/src/common/interface.ts)
117
+
118
+ ## Common Client
119
+
120
+ 从 4.0.714 版本开始,腾讯云 Node.js SDK 支持使用泛用性的 API 调用方式(Common Client)进行请求。您只需要安装 tencentcloud-sdk-nodejs-common 包,即可向任何产品发起调用。
121
+
122
+ **注意,您必须明确知道您调用的接口所需参数,否则可能会调用失败。**
123
+
124
+ 详细使用请参阅示例:[使用 Common Client 进行调用](https://github.com/TencentCloud/tencentcloud-sdk-nodejs/tree/master/examples/common)
84
125
 
85
126
  ## 更多示例
86
127
 
87
- 更丰富的使用 demo 请在 examples 目录中寻找。
128
+ 请参考 [examples](https://github.com/TencentCloud/tencentcloud-sdk-nodejs/tree/master/examples) 目录。
88
129
 
89
130
  # 相关配置
90
131
 
91
132
  ## 代理
92
133
 
93
- 如果是有代理的环境下,需要配置代理,请在创建Client时传入 [profile.httpProfile.proxy](https://github.com/TencentCloud/tencentcloud-sdk-nodejs/blob/master/src/common/interface.ts#L78) 参数,或设置系统环境变量 `http_proxy` ,否则可能无法正常调用,抛出连接超时的异常。
134
+ 如果是有代理的环境下,需要配置代理,请在创建 Client 时传入 [profile.httpProfile.proxy](https://github.com/TencentCloud/tencentcloud-sdk-nodejs/blob/master/src/common/interface.ts#L78) 参数,或设置系统环境变量 `http_proxy` ,否则可能无法正常调用,抛出连接超时的异常。
94
135
 
95
136
  # 凭证管理
96
137
 
97
138
  除显式传入凭证外,从 `v4.0.506` 起支持 [腾讯云实例角色](https://cloud.tencent.com/document/product/213/47668)
98
139
 
99
- 在您为实例绑定角色后,您可以在实例中访问相关元数据接口获取临时凭证。用法可参考 [js示例代码](./examples/cvm_role.js) 或 [ts示例代码](./examples/cvm_role.ts)
140
+ 在您为实例绑定角色后,您可以在实例中访问相关元数据接口获取临时凭证。用法可参考 [js 示例代码](./examples/cvm_role.js) 或 [ts 示例代码](./examples/cvm_role.ts)
100
141
  ```javascript
101
142
  // ...
102
143
  const CvmRoleCredential = require("tencentcloud-sdk-nodejs/tencentcloud/common/cvm_role_credential").default
@@ -108,20 +149,16 @@ new XxxClient({
108
149
  })
109
150
  ```
110
151
 
111
- # 旧版 SDK
112
-
113
- 我们推荐使用新版 NODEJS SDK,如果一定要用旧版 SDK,请前往[github 仓库](https://github.com/CFETeam/qcloudapi-sdk)下载。
114
-
115
152
  # 常见问题
116
- - webpack打包出错/浏览器报错
153
+ - webpack 打包出错/浏览器报错
117
154
 
118
- 请**务必不要**将此sdk直接用于web前端(包括小程序等),暴露密钥在这些环境非常不安全。
155
+ 请**务必不要**将此 SDK 直接用于 Web 前端(包括小程序等),暴露密钥在这些环境非常不安全。
119
156
 
120
- 正确的做法是在自己的服务端引用此sdk,并保存好密钥,做好请求鉴权;前端再调用服务端执行业务流程。
157
+ 正确的做法是在自己的服务端引用此 SDK,并保存好密钥,做好请求鉴权,前端再调用服务端执行业务流程。
121
158
 
122
159
  - `The "original" argument must be of type Function.`
123
160
 
124
- 通常是因为nodejs版本低于 `v10` ,或处于非node环境,请再次确认执行环境。
161
+ 通常是因为 Node.js 版本低于 `v10` ,或处于非 Node.js 环境,请再次确认执行环境。
125
162
 
126
163
  - 请求不通
127
164
 
@@ -139,3 +176,6 @@ new XxxClient({
139
176
  # MacOS
140
177
  http_proxy=http://代理地址:代理端口 node app.js
141
178
  ```
179
+
180
+ - 整数类型值超出 JavaScript 最大安全整数
181
+ 使用新的数据类型 `BigInt`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tencentcloud-sdk-nodejs-lowcode",
3
- "version": "4.0.781",
3
+ "version": "4.0.1039",
4
4
  "description": "Tencent Cloud API NODEJS SDK",
5
5
  "main": "tencentcloud/index.js",
6
6
  "scripts": {
@@ -22,7 +22,8 @@
22
22
  "author": "tencentcloudapi",
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "tencentcloud-sdk-nodejs-common": "^4.0.488"
25
+ "tencentcloud-sdk-nodejs-common": "^4.0.488",
26
+ "tslib": "1.13.0"
26
27
  },
27
28
  "directories": {
28
29
  "example": "examples",
@@ -17,13 +17,47 @@
17
17
  */
18
18
  import * as TencentCloudCommon from "tencentcloud-sdk-nodejs-common"
19
19
  import {
20
- TicketAuthInfo,
21
- DescribeDataSourceListRequest,
20
+ DescribeKnowledgeSetListRequest,
21
+ KnowledgeDocumentSetInfo,
22
+ DeleteKnowledgeDocumentSetRsp,
23
+ UploadKnowledgeDocumentSetRequest,
24
+ UpdateKnowledgeSetResponse,
25
+ SearchDocListRequest,
26
+ DescribeKnowledgeDocumentSetListResponse,
27
+ UploadKnowledgeDocumentSetRsp,
22
28
  DataSourceQueryOption,
23
- DataSourceLinkApp,
29
+ PageQuery,
30
+ SearchDocListResponse,
31
+ DeleteKnowledgeSetResponse,
32
+ DocumentQuery,
33
+ UpdateKnowledgeSetRequest,
34
+ SearchDocInfo,
24
35
  DataSourceDetail,
25
- DataSourceDetailItems,
36
+ KnowledgeSet,
37
+ KnowledgeSplitterPreprocess,
38
+ DescribeKnowledgeDocumentSetDetailRequest,
39
+ CreateKnowledgeSetResponse,
40
+ DeleteKnowledgeSetRequest,
41
+ RelationField,
42
+ DescribeKnowledgeDocumentSetListRequest,
43
+ DescribeDataSourceListRequest,
44
+ DeleteKnowledgeDocumentSetRequest,
45
+ QureyKnowledgeDocumentSet,
46
+ DescribeKnowledgeSetListResponse,
26
47
  DescribeDataSourceListResponse,
48
+ UploadKnowledgeDocumentSetResponse,
49
+ DeleteKnowledgeDocumentSetResponse,
50
+ TicketAuthInfo,
51
+ CreateKnowledgeSetRequest,
52
+ DescribeKnowledgeDocumentSetDetailRsp,
53
+ QureyKnowledgeDocumentSetInfo,
54
+ DescribeKnowledgeDocumentSetListRsp,
55
+ KnowledgeDocumentSet,
56
+ DescribeKnowledgeDocumentSetDetailResponse,
57
+ DataSourceLinkApp,
58
+ SearchDocRsp,
59
+ KnowledgeSetRsp,
60
+ DataSourceDetailItems,
27
61
  } from "./lowcode_models"
28
62
 
29
63
  /**
@@ -35,6 +69,46 @@ export class Client extends TencentCloudCommon.AbstractClient {
35
69
  super("lowcode.tencentcloudapi.com", "2021-01-08", clientConfig)
36
70
  }
37
71
 
72
+ /**
73
+ * 创建知识库
74
+ */
75
+ async CreateKnowledgeSet(
76
+ req: CreateKnowledgeSetRequest,
77
+ cb?: (error: string, rep: CreateKnowledgeSetResponse) => void
78
+ ): Promise<CreateKnowledgeSetResponse> {
79
+ return this.request("CreateKnowledgeSet", req, cb)
80
+ }
81
+
82
+ /**
83
+ * 更新知识库
84
+ */
85
+ async UpdateKnowledgeSet(
86
+ req: UpdateKnowledgeSetRequest,
87
+ cb?: (error: string, rep: UpdateKnowledgeSetResponse) => void
88
+ ): Promise<UpdateKnowledgeSetResponse> {
89
+ return this.request("UpdateKnowledgeSet", req, cb)
90
+ }
91
+
92
+ /**
93
+ * 知识库文档搜索接口
94
+ */
95
+ async SearchDocList(
96
+ req: SearchDocListRequest,
97
+ cb?: (error: string, rep: SearchDocListResponse) => void
98
+ ): Promise<SearchDocListResponse> {
99
+ return this.request("SearchDocList", req, cb)
100
+ }
101
+
102
+ /**
103
+ * 查询知识库
104
+ */
105
+ async DescribeKnowledgeSetList(
106
+ req: DescribeKnowledgeSetListRequest,
107
+ cb?: (error: string, rep: DescribeKnowledgeSetListResponse) => void
108
+ ): Promise<DescribeKnowledgeSetListResponse> {
109
+ return this.request("DescribeKnowledgeSetList", req, cb)
110
+ }
111
+
38
112
  /**
39
113
  * 获取数据源详情列表
40
114
  */
@@ -44,4 +118,54 @@ export class Client extends TencentCloudCommon.AbstractClient {
44
118
  ): Promise<DescribeDataSourceListResponse> {
45
119
  return this.request("DescribeDataSourceList", req, cb)
46
120
  }
121
+
122
+ /**
123
+ * 删除知识库下文档
124
+ */
125
+ async DeleteKnowledgeDocumentSet(
126
+ req: DeleteKnowledgeDocumentSetRequest,
127
+ cb?: (error: string, rep: DeleteKnowledgeDocumentSetResponse) => void
128
+ ): Promise<DeleteKnowledgeDocumentSetResponse> {
129
+ return this.request("DeleteKnowledgeDocumentSet", req, cb)
130
+ }
131
+
132
+ /**
133
+ * 获取知识库下文档详情
134
+ */
135
+ async DescribeKnowledgeDocumentSetDetail(
136
+ req: DescribeKnowledgeDocumentSetDetailRequest,
137
+ cb?: (error: string, rep: DescribeKnowledgeDocumentSetDetailResponse) => void
138
+ ): Promise<DescribeKnowledgeDocumentSetDetailResponse> {
139
+ return this.request("DescribeKnowledgeDocumentSetDetail", req, cb)
140
+ }
141
+
142
+ /**
143
+ * 更新知识库
144
+ */
145
+ async UploadKnowledgeDocumentSet(
146
+ req: UploadKnowledgeDocumentSetRequest,
147
+ cb?: (error: string, rep: UploadKnowledgeDocumentSetResponse) => void
148
+ ): Promise<UploadKnowledgeDocumentSetResponse> {
149
+ return this.request("UploadKnowledgeDocumentSet", req, cb)
150
+ }
151
+
152
+ /**
153
+ * 查询知识库下文件集合
154
+ */
155
+ async DescribeKnowledgeDocumentSetList(
156
+ req: DescribeKnowledgeDocumentSetListRequest,
157
+ cb?: (error: string, rep: DescribeKnowledgeDocumentSetListResponse) => void
158
+ ): Promise<DescribeKnowledgeDocumentSetListResponse> {
159
+ return this.request("DescribeKnowledgeDocumentSetList", req, cb)
160
+ }
161
+
162
+ /**
163
+ * 删除知识库
164
+ */
165
+ async DeleteKnowledgeSet(
166
+ req: DeleteKnowledgeSetRequest,
167
+ cb?: (error: string, rep: DeleteKnowledgeSetResponse) => void
168
+ ): Promise<DeleteKnowledgeSetResponse> {
169
+ return this.request("DeleteKnowledgeSet", req, cb)
170
+ }
47
171
  }