@cloudbase/manager-node 4.11.0-alpha.1 → 4.11.0-alpha.11
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/.claude/settings.local.json +9 -0
- package/jest.config.js +1 -0
- package/lib/agent/index.js +607 -16
- package/lib/agent/type.js +1 -0
- package/lib/cloudApp/index.js +243 -0
- package/lib/cloudApp/types.js +10 -0
- package/lib/database/index.js +79 -0
- package/lib/docs/index.js +288 -0
- package/lib/docs/types.js +2 -0
- package/lib/env/index.js +92 -0
- package/lib/environment.js +20 -0
- package/lib/function/index.js +97 -33
- package/lib/index.js +34 -0
- package/lib/interfaces/cloudApp.interface.js +20 -0
- package/lib/interfaces/index.js +1 -0
- package/lib/log/index.js +105 -0
- package/lib/log/types.js +24 -0
- package/lib/mysql/index.js +551 -0
- package/lib/mysql/types/account.js +2 -0
- package/lib/mysql/types/backup.js +2 -0
- package/lib/mysql/types/base.js +2 -0
- package/lib/mysql/types/index.js +19 -0
- package/lib/permission/index.js +310 -0
- package/lib/permission/types.js +2 -0
- package/lib/storage/index.js +424 -10
- package/lib/user/index.js +200 -0
- package/package.json +1 -1
- package/types/agent/index.d.ts +115 -5
- package/types/agent/type.d.ts +389 -0
- package/types/cloudApp/index.d.ts +73 -0
- package/types/cloudApp/types.d.ts +325 -0
- package/types/database/index.d.ts +112 -0
- package/types/docs/index.d.ts +37 -0
- package/types/docs/types.d.ts +24 -0
- package/types/env/index.d.ts +39 -1
- package/types/env/type.d.ts +187 -0
- package/types/environment.d.ts +12 -0
- package/types/function/index.d.ts +34 -5
- package/types/index.d.ts +26 -0
- package/types/interfaces/cloudApp.interface.d.ts +4 -0
- package/types/interfaces/index.d.ts +1 -0
- package/types/log/index.d.ts +53 -0
- package/types/log/types.d.ts +177 -0
- package/types/mysql/index.d.ts +261 -0
- package/types/mysql/types/account.d.ts +160 -0
- package/types/mysql/types/backup.d.ts +161 -0
- package/types/mysql/types/base.d.ts +579 -0
- package/types/mysql/types/index.d.ts +3 -0
- package/types/permission/index.d.ts +31 -0
- package/types/permission/types.d.ts +127 -0
- package/types/storage/index.d.ts +151 -3
- package/types/user/index.d.ts +17 -1
- package/types/user/types.d.ts +62 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CloudApp 统一部署服务类型定义
|
|
3
|
+
* 支持 static-hosting(静态托管)和 http-function(预留)两种部署类型
|
|
4
|
+
*
|
|
5
|
+
* 命名规范:
|
|
6
|
+
* - 入参接口(IXxxParams):camelCase,通过 upperCaseObjKey 转换后透传给 API
|
|
7
|
+
* - 返回值接口(IXxxResult):PascalCase,与 API 响应字段保持一致
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* 部署类型
|
|
11
|
+
* - static-hosting: 静态托管部署
|
|
12
|
+
* - http-function: HTTP 云函数部署(预留)
|
|
13
|
+
*/
|
|
14
|
+
export type DeployType = 'static-hosting' | 'http-function';
|
|
15
|
+
/**
|
|
16
|
+
* 构建类型
|
|
17
|
+
* - GIT: 从 Git 仓库构建
|
|
18
|
+
* - ZIP: 从 ZIP 包构建
|
|
19
|
+
* - TEMPLATE: 从模板构建
|
|
20
|
+
*/
|
|
21
|
+
export type BuildType = 'GIT' | 'ZIP' | 'TEMPLATE';
|
|
22
|
+
/**
|
|
23
|
+
* 构建状态
|
|
24
|
+
*/
|
|
25
|
+
export type BuildStatus = 'BUILDING' | 'SUCCESS' | 'FAILED';
|
|
26
|
+
/**
|
|
27
|
+
* 构建命令配置(入参)
|
|
28
|
+
*/
|
|
29
|
+
export interface IStaticCmd {
|
|
30
|
+
buildCmd?: string;
|
|
31
|
+
installCmd?: string;
|
|
32
|
+
deployCmd?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 静态环境变量配置(入参)
|
|
36
|
+
*/
|
|
37
|
+
export interface IStaticEnv {
|
|
38
|
+
variables?: Array<{
|
|
39
|
+
key: string;
|
|
40
|
+
value: string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 静态托管配置(入参)
|
|
45
|
+
*/
|
|
46
|
+
export interface IStaticConfig {
|
|
47
|
+
/** 框架类型:vue、react、nextjs 等 */
|
|
48
|
+
framework?: string;
|
|
49
|
+
/** Node.js 版本,默认 20 */
|
|
50
|
+
nodeJsVersion?: string;
|
|
51
|
+
/** 访问路径 */
|
|
52
|
+
appPath?: string;
|
|
53
|
+
/** 构建目录 */
|
|
54
|
+
buildPath?: string;
|
|
55
|
+
/** ZIP 文件地址(BuildType=ZIP/TEMPLATE 时使用) */
|
|
56
|
+
zipFileUrl?: string;
|
|
57
|
+
/** COS 时间戳(通过 uploadCode 上传后获取,BuildType=ZIP 时使用) */
|
|
58
|
+
cosTimestamp?: string;
|
|
59
|
+
/** COS 文件后缀 */
|
|
60
|
+
cosSuffix?: string;
|
|
61
|
+
/** 代码源平台:github、gitlab、gitee */
|
|
62
|
+
codeSource?: string;
|
|
63
|
+
/** 代码仓库 */
|
|
64
|
+
codeRepo?: string;
|
|
65
|
+
/** 代码分支 */
|
|
66
|
+
codeBranch?: string;
|
|
67
|
+
/** 构建命令配置 */
|
|
68
|
+
staticCmd?: IStaticCmd;
|
|
69
|
+
/** 构建环境变量 */
|
|
70
|
+
staticEnv?: IStaticEnv;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 静态托管构建命令配置(API 响应)
|
|
74
|
+
*/
|
|
75
|
+
export interface StaticCmd {
|
|
76
|
+
BuildCmd?: string;
|
|
77
|
+
InstallCmd?: string;
|
|
78
|
+
DeployCmd?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 静态托管环境变量配置(API 响应,对应文档 StaticEnvironment)
|
|
82
|
+
*/
|
|
83
|
+
export interface StaticEnv {
|
|
84
|
+
/** 环境变量数组,可能为 null */
|
|
85
|
+
Variables?: Array<{
|
|
86
|
+
Key: string;
|
|
87
|
+
Value: string;
|
|
88
|
+
}> | null;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* 静态托管配置(API 响应,对应文档 StaticConfig)
|
|
92
|
+
* 被 CreateCloudApp、DescribeCloudAppVersion、DescribeCloudAppVersionList 引用
|
|
93
|
+
* 注意:所有字段均可能返回 null
|
|
94
|
+
*/
|
|
95
|
+
export interface CloudAppStaticConfig {
|
|
96
|
+
/** 框架类型:vue、react、nextjs 等 */
|
|
97
|
+
Framework?: string | null;
|
|
98
|
+
/** Node.js 版本,默认 20 */
|
|
99
|
+
NodeJsVersion?: string | null;
|
|
100
|
+
/** 访问路径 */
|
|
101
|
+
AppPath?: string | null;
|
|
102
|
+
/** 构建目录 */
|
|
103
|
+
BuildPath?: string | null;
|
|
104
|
+
/** ZIP 文件地址(BuildType=ZIP/TEMPLATE 时使用) */
|
|
105
|
+
ZipFileUrl?: string | null;
|
|
106
|
+
/** COS 时间戳 */
|
|
107
|
+
CosTimestamp?: string | null;
|
|
108
|
+
/** COS 文件后缀 */
|
|
109
|
+
CosSuffix?: string | null;
|
|
110
|
+
/** 代码源平台:github、gitlab、gitee */
|
|
111
|
+
CodeSource?: string | null;
|
|
112
|
+
/** 代码仓库 */
|
|
113
|
+
CodeRepo?: string | null;
|
|
114
|
+
/** 代码分支 */
|
|
115
|
+
CodeBranch?: string | null;
|
|
116
|
+
/** 构建命令配置 */
|
|
117
|
+
StaticCmd?: StaticCmd | null;
|
|
118
|
+
/** 构建环境变量 */
|
|
119
|
+
StaticEnv?: StaticEnv | null;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* 应用列表项(API 响应 CloudAppServiceItem)
|
|
123
|
+
*/
|
|
124
|
+
export interface CloudAppServiceItem {
|
|
125
|
+
ServiceName: string;
|
|
126
|
+
DeployType: string;
|
|
127
|
+
Framework?: string;
|
|
128
|
+
Domain?: string;
|
|
129
|
+
AppPath?: string;
|
|
130
|
+
CreateTime: string;
|
|
131
|
+
LatestVersionName?: string;
|
|
132
|
+
LatestStatus?: string;
|
|
133
|
+
LatestBuildTime?: string;
|
|
134
|
+
}
|
|
135
|
+
/** @deprecated 请使用 CloudAppServiceItem */
|
|
136
|
+
export type CloudAppItem = CloudAppServiceItem;
|
|
137
|
+
/**
|
|
138
|
+
* 版本信息(API 响应 CloudAppVersionItem)
|
|
139
|
+
*/
|
|
140
|
+
export interface CloudAppVersion {
|
|
141
|
+
VersionName: string;
|
|
142
|
+
BuildId: string;
|
|
143
|
+
BuildType?: string;
|
|
144
|
+
Status: string;
|
|
145
|
+
Framework?: string;
|
|
146
|
+
BuildTime?: string;
|
|
147
|
+
StaticConfig?: CloudAppStaticConfig;
|
|
148
|
+
}
|
|
149
|
+
export interface ICreateCloudAppParams {
|
|
150
|
+
/** 环境 ID(可选,默认从 Environment 获取) */
|
|
151
|
+
envId?: string;
|
|
152
|
+
/** 部署类型:static-hosting / http-function */
|
|
153
|
+
deployType: DeployType;
|
|
154
|
+
/** 服务名称 */
|
|
155
|
+
serviceName: string;
|
|
156
|
+
/** 构建类型:GIT / ZIP / TEMPLATE */
|
|
157
|
+
buildType?: BuildType;
|
|
158
|
+
/** 静态托管配置(deployType 为 static-hosting 时使用) */
|
|
159
|
+
staticConfig?: IStaticConfig;
|
|
160
|
+
}
|
|
161
|
+
export interface ICreateCloudAppResult {
|
|
162
|
+
ServiceName: string;
|
|
163
|
+
BuildId: string;
|
|
164
|
+
VersionName: string;
|
|
165
|
+
RequestId: string;
|
|
166
|
+
}
|
|
167
|
+
export interface IDescribeCloudAppListParams {
|
|
168
|
+
/** 环境 ID(可选) */
|
|
169
|
+
envId?: string;
|
|
170
|
+
/** 部署类型 */
|
|
171
|
+
deployType: DeployType;
|
|
172
|
+
/** 页码(从 1 开始) */
|
|
173
|
+
pageNo?: number;
|
|
174
|
+
/** 每页大小 */
|
|
175
|
+
pageSize?: number;
|
|
176
|
+
/** 搜索关键字,按应用名模糊搜索 */
|
|
177
|
+
searchKey?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface IDescribeCloudAppListResult {
|
|
180
|
+
Total: number;
|
|
181
|
+
ServiceList: CloudAppServiceItem[];
|
|
182
|
+
RequestId: string;
|
|
183
|
+
}
|
|
184
|
+
export interface IDescribeCloudAppInfoParams {
|
|
185
|
+
/** 环境 ID(可选) */
|
|
186
|
+
envId?: string;
|
|
187
|
+
/** 部署类型 */
|
|
188
|
+
deployType: DeployType;
|
|
189
|
+
/** 服务名称 */
|
|
190
|
+
serviceName: string;
|
|
191
|
+
}
|
|
192
|
+
export interface IDescribeCloudAppInfoResult {
|
|
193
|
+
ServiceName: string;
|
|
194
|
+
DeployType: string;
|
|
195
|
+
Framework?: string;
|
|
196
|
+
Domain?: string;
|
|
197
|
+
AppPath?: string;
|
|
198
|
+
CreateTime: string;
|
|
199
|
+
LatestVersionName?: string;
|
|
200
|
+
LatestStatus?: string;
|
|
201
|
+
LatestBuildTime?: string;
|
|
202
|
+
RequestId: string;
|
|
203
|
+
}
|
|
204
|
+
export interface IDeleteCloudAppParams {
|
|
205
|
+
/** 环境 ID(可选) */
|
|
206
|
+
envId?: string;
|
|
207
|
+
/** 部署类型 */
|
|
208
|
+
deployType: DeployType;
|
|
209
|
+
/** 服务名称 */
|
|
210
|
+
serviceName: string;
|
|
211
|
+
}
|
|
212
|
+
export interface IDeleteCloudAppResult {
|
|
213
|
+
Result: boolean;
|
|
214
|
+
RequestId: string;
|
|
215
|
+
}
|
|
216
|
+
export interface IDescribeCloudAppVersionParams {
|
|
217
|
+
/** 环境 ID(可选) */
|
|
218
|
+
envId?: string;
|
|
219
|
+
/** 部署类型 */
|
|
220
|
+
deployType: DeployType;
|
|
221
|
+
/** 服务名称 */
|
|
222
|
+
serviceName: string;
|
|
223
|
+
/** 版本名称(与 buildId 二选一) */
|
|
224
|
+
versionName?: string;
|
|
225
|
+
/** 构建 ID(与 versionName 二选一) */
|
|
226
|
+
buildId?: string;
|
|
227
|
+
}
|
|
228
|
+
export interface IDescribeCloudAppVersionResult {
|
|
229
|
+
BuildType: string;
|
|
230
|
+
BuildId: string;
|
|
231
|
+
Status: BuildStatus;
|
|
232
|
+
Framework?: string;
|
|
233
|
+
StaticConfig?: CloudAppStaticConfig;
|
|
234
|
+
BuildTime?: string;
|
|
235
|
+
RequestId: string;
|
|
236
|
+
}
|
|
237
|
+
export interface IDescribeCloudAppVersionListParams {
|
|
238
|
+
/** 环境 ID(可选) */
|
|
239
|
+
envId?: string;
|
|
240
|
+
/** 部署类型 */
|
|
241
|
+
deployType: DeployType;
|
|
242
|
+
/** 服务名称 */
|
|
243
|
+
serviceName: string;
|
|
244
|
+
/** 页码(从 1 开始) */
|
|
245
|
+
pageNo?: number;
|
|
246
|
+
/** 每页大小 */
|
|
247
|
+
pageSize?: number;
|
|
248
|
+
}
|
|
249
|
+
export interface IDescribeCloudAppVersionListResult {
|
|
250
|
+
Total: number;
|
|
251
|
+
VersionList: CloudAppVersion[] | null;
|
|
252
|
+
RequestId: string;
|
|
253
|
+
}
|
|
254
|
+
export interface IDeleteCloudAppVersionParams {
|
|
255
|
+
/** 环境 ID(可选) */
|
|
256
|
+
envId?: string;
|
|
257
|
+
/** 部署类型 */
|
|
258
|
+
deployType: DeployType;
|
|
259
|
+
/** 服务名称 */
|
|
260
|
+
serviceName: string;
|
|
261
|
+
/** 版本名称 */
|
|
262
|
+
versionName: string;
|
|
263
|
+
}
|
|
264
|
+
export interface IDeleteCloudAppVersionResult {
|
|
265
|
+
Result: boolean;
|
|
266
|
+
RequestId: string;
|
|
267
|
+
}
|
|
268
|
+
export interface IDescribeCloudAppCosInfoParams {
|
|
269
|
+
/** 环境 ID(可选) */
|
|
270
|
+
envId?: string;
|
|
271
|
+
/** 部署类型 */
|
|
272
|
+
deployType: DeployType;
|
|
273
|
+
/** 服务名称 */
|
|
274
|
+
serviceName: string;
|
|
275
|
+
/** Unix 时间戳(用于指定文件路径,不传则自动生成) */
|
|
276
|
+
unixTimestamp?: string;
|
|
277
|
+
/** 文件后缀(默认 .zip) */
|
|
278
|
+
suffix?: string;
|
|
279
|
+
/** 是否需要下载 URL */
|
|
280
|
+
needDownload?: boolean;
|
|
281
|
+
}
|
|
282
|
+
export interface CosHeader {
|
|
283
|
+
Key: string;
|
|
284
|
+
Value: string;
|
|
285
|
+
}
|
|
286
|
+
export interface IDescribeCloudAppCosInfoResult {
|
|
287
|
+
UploadUrl: string;
|
|
288
|
+
UploadHeaders?: CosHeader[];
|
|
289
|
+
DownloadUrl?: string;
|
|
290
|
+
DownloadHeaders?: CosHeader[];
|
|
291
|
+
UnixTimestamp: string;
|
|
292
|
+
RequestId: string;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* 上传进度信息
|
|
296
|
+
*/
|
|
297
|
+
export interface IProgressData {
|
|
298
|
+
loaded: number;
|
|
299
|
+
total: number;
|
|
300
|
+
percent: number;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* 上传代码参数
|
|
304
|
+
*/
|
|
305
|
+
export interface IUploadCloudAppCodeParams {
|
|
306
|
+
/** 部署类型 */
|
|
307
|
+
deployType: DeployType;
|
|
308
|
+
/** 服务名称 */
|
|
309
|
+
serviceName: string;
|
|
310
|
+
/** 本地文件夹路径 */
|
|
311
|
+
localPath: string;
|
|
312
|
+
/** 忽略的文件/目录模式 */
|
|
313
|
+
ignore?: string[];
|
|
314
|
+
/** 进度回调 */
|
|
315
|
+
onProgress?: (progress: IProgressData) => void;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* 上传代码结果
|
|
319
|
+
*/
|
|
320
|
+
export interface IUploadCloudAppCodeResult {
|
|
321
|
+
/** COS 时间戳(用于 createApp 时传入 staticConfig.cosTimestamp) */
|
|
322
|
+
cosTimestamp: string;
|
|
323
|
+
/** Unix 时间戳(与 cosTimestamp 相同) */
|
|
324
|
+
unixTimestamp: string;
|
|
325
|
+
}
|
|
@@ -15,6 +15,38 @@ interface IMgoQueryInfo {
|
|
|
15
15
|
MgoLimit?: number;
|
|
16
16
|
MgoOffset?: number;
|
|
17
17
|
}
|
|
18
|
+
/** 待执行命令参数 */
|
|
19
|
+
interface IMgoCommandParam {
|
|
20
|
+
/** 表名 */
|
|
21
|
+
TableName: string;
|
|
22
|
+
/** 操作类型:UPDATE / QUERY / INSERT / DELETE / COMMAND */
|
|
23
|
+
CommandType: string;
|
|
24
|
+
/** 待执行命令(JSON 字符串) */
|
|
25
|
+
Command: string;
|
|
26
|
+
}
|
|
27
|
+
/** MongoDB 连接器配置 */
|
|
28
|
+
interface IMongoConnector {
|
|
29
|
+
/** 连接器实例 ID */
|
|
30
|
+
InstanceId?: string;
|
|
31
|
+
/** MongoDB 数据库名 */
|
|
32
|
+
DatabaseName?: string;
|
|
33
|
+
}
|
|
34
|
+
/** RunCommands 请求参数 */
|
|
35
|
+
interface IRunCommandsOptions {
|
|
36
|
+
/** 待执行命令列表 */
|
|
37
|
+
MgoCommands: IMgoCommandParam[];
|
|
38
|
+
/** 实例 ID,如 tnt-xxxx。不传则自动使用当前环境的数据库实例 ID */
|
|
39
|
+
Tag?: string;
|
|
40
|
+
/** 环境 ID。不传则自动使用当前环境 ID */
|
|
41
|
+
EnvId?: string;
|
|
42
|
+
/** Mongo 连接器实例信息 */
|
|
43
|
+
MongoConnector?: IMongoConnector;
|
|
44
|
+
}
|
|
45
|
+
/** RunCommands 返回结果 */
|
|
46
|
+
interface IRunCommandsResult extends IResponseInfo {
|
|
47
|
+
/** 返回结果,每个元素是一个 JSON 字符串 */
|
|
48
|
+
Data: string[];
|
|
49
|
+
}
|
|
18
50
|
interface ICollectionInfo extends IResponseInfo {
|
|
19
51
|
Collections: Array<TableInfo>;
|
|
20
52
|
Pager: Pager;
|
|
@@ -38,6 +70,52 @@ interface IDatabaseMigrateQueryInfo extends IResponseInfo {
|
|
|
38
70
|
interface IDatabaseImportAndExportInfo extends IResponseInfo {
|
|
39
71
|
JobId: number;
|
|
40
72
|
}
|
|
73
|
+
/** 回档表格名称映射信息 */
|
|
74
|
+
interface IModifyTableNamesInfo {
|
|
75
|
+
/** 原表名 */
|
|
76
|
+
OldTableName: string;
|
|
77
|
+
/** 新表名 */
|
|
78
|
+
NewTableName: string;
|
|
79
|
+
}
|
|
80
|
+
/** 回档任务信息 */
|
|
81
|
+
interface IRestoreTask {
|
|
82
|
+
/** 恢复任务ID */
|
|
83
|
+
TaskId?: string;
|
|
84
|
+
/** 任务状态 */
|
|
85
|
+
Status?: string;
|
|
86
|
+
/** 任务创建时间 */
|
|
87
|
+
Time?: string;
|
|
88
|
+
/** 环境ID */
|
|
89
|
+
EnvId?: string;
|
|
90
|
+
/** 恢复类型 */
|
|
91
|
+
Type?: string;
|
|
92
|
+
}
|
|
93
|
+
/** 任意时间回档范围 */
|
|
94
|
+
interface IRestoreTableTimeRange {
|
|
95
|
+
[key: string]: any;
|
|
96
|
+
}
|
|
97
|
+
/** 获取可回档表格返回结果 */
|
|
98
|
+
interface IDescribeRestoreTablesResult extends IResponseInfo {
|
|
99
|
+
/** 可回档表格列表 */
|
|
100
|
+
Tables: string[];
|
|
101
|
+
}
|
|
102
|
+
/** 获取回档任务返回结果 */
|
|
103
|
+
interface IDescribeRestoreTaskResult extends IResponseInfo {
|
|
104
|
+
/** 回档任务列表 */
|
|
105
|
+
Tasks: IRestoreTask[];
|
|
106
|
+
}
|
|
107
|
+
/** 获取可回档时间返回结果 */
|
|
108
|
+
interface IDescribeRestoreTimeResult extends IResponseInfo {
|
|
109
|
+
/** 可回档时间列表 */
|
|
110
|
+
RestoreTimes: string[];
|
|
111
|
+
/** 任意时间回档列表 */
|
|
112
|
+
RestoreTimeRanges: IRestoreTableTimeRange[];
|
|
113
|
+
}
|
|
114
|
+
/** 实例表格回档返回结果 */
|
|
115
|
+
interface IRestoreTCBTablesResult extends IResponseInfo {
|
|
116
|
+
/** 流程ID */
|
|
117
|
+
FlowId: number;
|
|
118
|
+
}
|
|
41
119
|
export declare class DatabaseService {
|
|
42
120
|
static tcbServiceVersion: IServiceVersion;
|
|
43
121
|
static flexdbServiceVersion: IServiceVersion;
|
|
@@ -62,5 +140,39 @@ export declare class DatabaseService {
|
|
|
62
140
|
migrateStatus(jobId: number): Promise<IDatabaseMigrateQueryInfo>;
|
|
63
141
|
import(collectionName: string, file: any, options: any): Promise<IDatabaseImportAndExportInfo>;
|
|
64
142
|
export(collectionName: string, file: any, options: any): Promise<IDatabaseImportAndExportInfo>;
|
|
143
|
+
/**
|
|
144
|
+
* 获取可回档表格
|
|
145
|
+
* @param time 回档时间,格式 YYYY-MM-DD HH:MM:SS
|
|
146
|
+
* @param filters 过滤器(可选)
|
|
147
|
+
* @param instanceId 实例ID(可选,不传则自动使用当前环境的数据库实例 ID)
|
|
148
|
+
* @returns 可回档表格列表
|
|
149
|
+
*/
|
|
150
|
+
describeRestoreTables(time: string, filters?: string[], instanceId?: string): Promise<IDescribeRestoreTablesResult>;
|
|
151
|
+
/**
|
|
152
|
+
* 获取回档任务
|
|
153
|
+
* @param instanceId 实例ID(可选,不传则自动使用当前环境的数据库实例 ID)
|
|
154
|
+
* @returns 回档任务列表
|
|
155
|
+
*/
|
|
156
|
+
describeRestoreTask(instanceId?: string): Promise<IDescribeRestoreTaskResult>;
|
|
157
|
+
/**
|
|
158
|
+
* 获取可回档时间
|
|
159
|
+
* @param instanceId 实例ID(可选,不传则自动使用当前环境的数据库实例 ID)
|
|
160
|
+
* @returns 可回档时间列表及任意时间回档列表
|
|
161
|
+
*/
|
|
162
|
+
describeRestoreTime(instanceId?: string): Promise<IDescribeRestoreTimeResult>;
|
|
163
|
+
/**
|
|
164
|
+
* 实例表格回档
|
|
165
|
+
* @param time 回档时间,格式 YYYY-MM-DD HH:MM:SS
|
|
166
|
+
* @param modifyTableNamesInfo 回档表格信息(原表名 → 新表名映射)
|
|
167
|
+
* @param instanceId 实例ID(可选,不传则自动使用当前环境的数据库实例 ID)
|
|
168
|
+
* @returns 流程ID
|
|
169
|
+
*/
|
|
170
|
+
restoreTables(time: string, modifyTableNamesInfo: IModifyTableNamesInfo[], instanceId?: string): Promise<IRestoreTCBTablesResult>;
|
|
171
|
+
/**
|
|
172
|
+
* 执行文档型数据库命令
|
|
173
|
+
* @param options 命令参数(命令列表、可选的 Tag/EnvId/MongoConnector)
|
|
174
|
+
* @returns 执行结果,Data 为 JSON 字符串数组
|
|
175
|
+
*/
|
|
176
|
+
runCommands(options: IRunCommandsOptions): Promise<IRunCommandsResult>;
|
|
65
177
|
}
|
|
66
178
|
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SearchResult, ModuleDocs } from './types';
|
|
2
|
+
export declare class DocsService {
|
|
3
|
+
listModules(): Promise<string[]>;
|
|
4
|
+
/**
|
|
5
|
+
* Case: tcb docs read 快速开始
|
|
6
|
+
* 根据模块名获取该模块下的所有文档(返回嵌套的对象结构)
|
|
7
|
+
*/
|
|
8
|
+
listModuleDocs(moduleName: string): Promise<ModuleDocs>;
|
|
9
|
+
/**
|
|
10
|
+
* Case: tcb docs read <任意输入>
|
|
11
|
+
* 统一的查找入口,自动识别输入格式并返回模块数据或文档URL
|
|
12
|
+
*
|
|
13
|
+
* 支持的输入格式:
|
|
14
|
+
* 1. URL路径格式(包含 /,相对或完整): tcb docs read quick-start/create-env
|
|
15
|
+
* 2. 点分隔路径: tcb docs read 云托管.快速开始..NET 快速开始
|
|
16
|
+
* 3. 模块名: tcb docs read 快速开始 「命中第一个 底下其他同理」
|
|
17
|
+
* 4. 嵌套模块名: tcb docs read 微信生态(嵌套在"社区.最佳实践"下)
|
|
18
|
+
* 5. 文档标题: tcb docs read 小程序快速开始
|
|
19
|
+
* 6. 前缀模糊匹配: tcb docs read PHP(匹配 "PHP 快速开始")
|
|
20
|
+
*/
|
|
21
|
+
findByName(input: string): Promise<{
|
|
22
|
+
type: 'module';
|
|
23
|
+
data: ModuleDocs;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'doc';
|
|
26
|
+
data: string;
|
|
27
|
+
}>;
|
|
28
|
+
readDoc(docPath: string): Promise<string>;
|
|
29
|
+
searchDocs(query: string): Promise<SearchResult[]>;
|
|
30
|
+
private getCategory;
|
|
31
|
+
private findByKeyPrefix;
|
|
32
|
+
private findByDotPath;
|
|
33
|
+
private searchDotPathInTree;
|
|
34
|
+
private matchDotPath;
|
|
35
|
+
private findNestedModule;
|
|
36
|
+
private findDocPathByTitle;
|
|
37
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type CategoryNode = string | {
|
|
2
|
+
[key: string]: CategoryNode;
|
|
3
|
+
};
|
|
4
|
+
export interface Category {
|
|
5
|
+
[key: string]: CategoryNode;
|
|
6
|
+
}
|
|
7
|
+
export interface ModuleDocs {
|
|
8
|
+
[key: string]: CategoryNode;
|
|
9
|
+
}
|
|
10
|
+
export interface DocEntry {
|
|
11
|
+
title: string;
|
|
12
|
+
path: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SearchHit {
|
|
15
|
+
url: string;
|
|
16
|
+
content: string | null;
|
|
17
|
+
type: string;
|
|
18
|
+
hierarchy: Record<string, string | null>;
|
|
19
|
+
}
|
|
20
|
+
export interface SearchResult {
|
|
21
|
+
url: string;
|
|
22
|
+
title: string;
|
|
23
|
+
content: string | null;
|
|
24
|
+
}
|
package/types/env/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Environment } from '../environment';
|
|
2
2
|
import { IResponseInfo, AuthDomain, EnvInfo, LoginConfigItem, ICheckTcbServiceRes, ICreatePostpayRes, EnvBillingInfoItem, PriceResult } from '../interfaces';
|
|
3
|
-
import { CalculatePackageCreatePriceParams, CalculatePackageRenewPriceParams, CalculatePackageModifyPriceParams } from './type';
|
|
3
|
+
import { CalculatePackageCreatePriceParams, CalculatePackageRenewPriceParams, CalculatePackageModifyPriceParams, DescribeHttpServiceRouteParams, DescribeHttpServiceRouteRes, CreateHttpServiceRouteParams, CreateHttpServiceRouteRes, ModifyHttpServiceRouteParams, ModifyHttpServiceRouteRes, DeleteHttpServiceRouteParams, DeleteHttpServiceRouteRes, BindCustomDomainParams, BindCustomDomainRes, DeleteCustomDomainParams, DeleteCustomDomainRes } from './type';
|
|
4
4
|
import { CreateBillingDealParams, CreateEnvParams, BaasPackageInfo, DescribeBaasPackageListParams, ModifyEnvPlanParams, RenewEnvParams, DestroyEnvParams, DescribeEnvsParams, DescribeEnvAccountCircleParams, DescribeEnvAccountCircleRes, DescribeCreditsUsageDetailParams, EnvPkgCreditsUsage } from '../interfaces/tcb.interface';
|
|
5
5
|
type SOURCE = 'miniapp' | 'qcloud';
|
|
6
6
|
interface IDeleteDomainRes {
|
|
@@ -264,6 +264,44 @@ export declare class EnvService {
|
|
|
264
264
|
Usages: EnvPkgCreditsUsage[];
|
|
265
265
|
RequestId: string;
|
|
266
266
|
}>;
|
|
267
|
+
/**
|
|
268
|
+
* 查询HTTP访问服务域名路由信息
|
|
269
|
+
* @param {DescribeHttpServiceRouteParams} params 查询参数
|
|
270
|
+
* @returns {Promise<DescribeHttpServiceRouteRes>}
|
|
271
|
+
*/
|
|
272
|
+
describeHttpServiceRoute(params: DescribeHttpServiceRouteParams): Promise<DescribeHttpServiceRouteRes>;
|
|
273
|
+
/**
|
|
274
|
+
* 创建HTTP访问服务域名路由
|
|
275
|
+
* @param {CreateHttpServiceRouteParams} params 创建参数
|
|
276
|
+
* @returns {Promise<CreateHttpServiceRouteRes>}
|
|
277
|
+
*/
|
|
278
|
+
createHttpServiceRoute(params: CreateHttpServiceRouteParams): Promise<CreateHttpServiceRouteRes>;
|
|
279
|
+
/**
|
|
280
|
+
* 修改HTTP访问服务域名路由
|
|
281
|
+
* @param {ModifyHttpServiceRouteParams} params 修改参数
|
|
282
|
+
* @returns {Promise<ModifyHttpServiceRouteRes>}
|
|
283
|
+
*/
|
|
284
|
+
modifyHttpServiceRoute(params: ModifyHttpServiceRouteParams): Promise<ModifyHttpServiceRouteRes>;
|
|
285
|
+
/**
|
|
286
|
+
* 删除HTTP访问服务域名路由
|
|
287
|
+
* @param {DeleteHttpServiceRouteParams} params 删除参数
|
|
288
|
+
* @returns {Promise<DeleteHttpServiceRouteRes>}
|
|
289
|
+
*/
|
|
290
|
+
deleteHttpServiceRoute(params: DeleteHttpServiceRouteParams): Promise<DeleteHttpServiceRouteRes>;
|
|
291
|
+
/**
|
|
292
|
+
* 绑定自定义域名到HTTP访问服务
|
|
293
|
+
* 底层调用 CreateHTTPServiceRoute API,专用于域名绑定场景
|
|
294
|
+
* @param {BindCustomDomainParams} params 绑定参数
|
|
295
|
+
* @returns {Promise<BindCustomDomainRes>}
|
|
296
|
+
*/
|
|
297
|
+
bindCustomDomain(params: BindCustomDomainParams): Promise<BindCustomDomainRes>;
|
|
298
|
+
/**
|
|
299
|
+
* 删除自定义域名
|
|
300
|
+
* 仅当域名下无路由绑定时可删除,否则抛出错误
|
|
301
|
+
* @param {DeleteCustomDomainParams} params 删除参数
|
|
302
|
+
* @returns {Promise<DeleteCustomDomainRes>}
|
|
303
|
+
*/
|
|
304
|
+
deleteCustomDomain(params: DeleteCustomDomainParams): Promise<DeleteCustomDomainRes>;
|
|
267
305
|
private getCOSDomains;
|
|
268
306
|
private modifyCosCorsDomain;
|
|
269
307
|
private getCos;
|