@cloudbase/manager-node 4.11.0-alpha.8 → 5.0.0
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 +3 -3
- package/lib/cloudApp/index.js +243 -0
- package/lib/cloudApp/types.js +10 -0
- package/lib/cloudrun/index.js +28 -28
- package/lib/env/index.js +92 -0
- package/lib/environment.js +5 -0
- package/lib/index.js +25 -0
- package/lib/interfaces/cloudApp.interface.js +20 -0
- package/lib/interfaces/index.js +1 -0
- package/lib/permission/index.js +4 -7
- package/package.json +2 -2
- package/types/agent/index.d.ts +3 -3
- package/types/agent/type.d.ts +2 -2
- package/types/cloudApp/index.d.ts +73 -0
- package/types/cloudApp/types.d.ts +325 -0
- package/types/cloudrun/index.d.ts +2 -2
- package/types/cloudrun/type.d.ts +5 -3
- package/types/env/index.d.ts +39 -1
- package/types/env/type.d.ts +187 -0
- package/types/environment.d.ts +3 -0
- package/types/index.d.ts +20 -0
- package/types/interfaces/cloudApp.interface.d.ts +4 -0
- package/types/interfaces/index.d.ts +1 -0
- package/types/permission/types.d.ts +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Environment } from '../environment';
|
|
2
|
+
import { ICreateCloudAppParams, ICreateCloudAppResult, IDescribeCloudAppListParams, IDescribeCloudAppListResult, IDescribeCloudAppInfoParams, IDescribeCloudAppInfoResult, IDeleteCloudAppParams, IDeleteCloudAppResult, IDescribeCloudAppVersionParams, IDescribeCloudAppVersionResult, IDescribeCloudAppVersionListParams, IDescribeCloudAppVersionListResult, IDeleteCloudAppVersionParams, IDeleteCloudAppVersionResult, IDescribeCloudAppCosInfoParams, IDescribeCloudAppCosInfoResult, IUploadCloudAppCodeParams, IUploadCloudAppCodeResult } from './types';
|
|
3
|
+
export * from './types';
|
|
4
|
+
/**
|
|
5
|
+
* CloudApp 统一部署服务
|
|
6
|
+
* 提供 Web 应用的创建、查询、删除、版本管理等功能
|
|
7
|
+
*/
|
|
8
|
+
export declare class CloudAppService {
|
|
9
|
+
private tcbService;
|
|
10
|
+
private environment;
|
|
11
|
+
constructor(environment: Environment);
|
|
12
|
+
/**
|
|
13
|
+
* 创建/更新 CloudApp 应用
|
|
14
|
+
* @param params 创建参数
|
|
15
|
+
*/
|
|
16
|
+
createApp(params: ICreateCloudAppParams): Promise<ICreateCloudAppResult>;
|
|
17
|
+
/**
|
|
18
|
+
* 获取 CloudApp 应用列表
|
|
19
|
+
* @param params 查询参数
|
|
20
|
+
*/
|
|
21
|
+
describeAppList(params: IDescribeCloudAppListParams): Promise<IDescribeCloudAppListResult>;
|
|
22
|
+
/**
|
|
23
|
+
* 获取 CloudApp 应用详情
|
|
24
|
+
* @param params 查询参数
|
|
25
|
+
*/
|
|
26
|
+
describeAppInfo(params: IDescribeCloudAppInfoParams): Promise<IDescribeCloudAppInfoResult>;
|
|
27
|
+
/**
|
|
28
|
+
* 删除 CloudApp 应用
|
|
29
|
+
* @param params 删除参数
|
|
30
|
+
*/
|
|
31
|
+
deleteApp(params: IDeleteCloudAppParams): Promise<IDeleteCloudAppResult>;
|
|
32
|
+
/**
|
|
33
|
+
* 获取 CloudApp 版本详情
|
|
34
|
+
* 不指定 versionName 或 buildId 时返回最新版本
|
|
35
|
+
* @param params 查询参数
|
|
36
|
+
*/
|
|
37
|
+
describeAppVersion(params: IDescribeCloudAppVersionParams): Promise<IDescribeCloudAppVersionResult>;
|
|
38
|
+
/**
|
|
39
|
+
* 获取 CloudApp 版本列表
|
|
40
|
+
* @param params 查询参数
|
|
41
|
+
*/
|
|
42
|
+
describeAppVersionList(params: IDescribeCloudAppVersionListParams): Promise<IDescribeCloudAppVersionListResult>;
|
|
43
|
+
/**
|
|
44
|
+
* 删除 CloudApp 版本
|
|
45
|
+
* @param params 删除参数
|
|
46
|
+
*/
|
|
47
|
+
deleteAppVersion(params: IDeleteCloudAppVersionParams): Promise<IDeleteCloudAppVersionResult>;
|
|
48
|
+
/**
|
|
49
|
+
* 获取 CloudApp COS 上传信息(预签名 URL)
|
|
50
|
+
* @param params 查询参数
|
|
51
|
+
*/
|
|
52
|
+
describeCosInfo(params: IDescribeCloudAppCosInfoParams): Promise<IDescribeCloudAppCosInfoResult>;
|
|
53
|
+
/**
|
|
54
|
+
* 上传本地代码到 COS
|
|
55
|
+
* 自动打包 ZIP 并上传到预签名 URL
|
|
56
|
+
*
|
|
57
|
+
* 注意:此方法不依赖应用是否已创建,可在创建应用前调用
|
|
58
|
+
* 返回的 cosTimestamp 用于 createApp 时传入 staticConfig.cosTimestamp
|
|
59
|
+
*
|
|
60
|
+
* @param params 上传参数
|
|
61
|
+
*/
|
|
62
|
+
uploadCode(params: IUploadCloudAppCodeParams): Promise<IUploadCloudAppCodeResult>;
|
|
63
|
+
/**
|
|
64
|
+
* 获取环境信息
|
|
65
|
+
*/
|
|
66
|
+
private getEnvInfo;
|
|
67
|
+
/**
|
|
68
|
+
* 校验必填参数
|
|
69
|
+
* @param params 参数对象
|
|
70
|
+
* @param fields 必填字段列表
|
|
71
|
+
*/
|
|
72
|
+
private validateRequiredParams;
|
|
73
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -135,8 +135,6 @@ export declare class CloudRunService {
|
|
|
135
135
|
* @returns {Promise<ITemplate[]>} 返回模板数组
|
|
136
136
|
*/
|
|
137
137
|
getTemplates(): Promise<ITemplate[]>;
|
|
138
|
-
private _checkFunctionExist;
|
|
139
|
-
private _upsertFunction;
|
|
140
138
|
/**
|
|
141
139
|
* 获取部署记录列表,按部署时间倒序(最新在前)
|
|
142
140
|
*/
|
|
@@ -150,6 +148,8 @@ export declare class CloudRunService {
|
|
|
150
148
|
getProcessLog(params: {
|
|
151
149
|
RunId: string;
|
|
152
150
|
}): Promise<IProcessLogResponse>;
|
|
151
|
+
private _checkFunctionExist;
|
|
152
|
+
private _upsertFunction;
|
|
153
153
|
}
|
|
154
154
|
export declare function codeToZip(cwd: string, options?: {
|
|
155
155
|
installDependency?: boolean;
|
package/types/cloudrun/type.d.ts
CHANGED
|
@@ -38,10 +38,12 @@ export interface ICloudrunServerBaseInfo {
|
|
|
38
38
|
*/
|
|
39
39
|
CustomDomainName: string;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
41
|
+
* 服务状态(来自 DescribeCloudRunServers)
|
|
42
|
+
* 常见值:"creating" | "create_failed" | "freezing" | "freeze_fail" | "froze" |
|
|
43
|
+
* "unfreezing" | "unfreeze_fail" | "normal" | "deleting" | "delete_failed" | "abnormal"
|
|
44
|
+
* @example "normal"
|
|
43
45
|
*/
|
|
44
|
-
Status: '
|
|
46
|
+
Status: 'creating' | 'create_failed' | 'freezing' | 'freeze_fail' | 'froze' | 'unfreezing' | 'unfreeze_fail' | 'normal' | 'deleting' | 'delete_failed' | 'abnormal';
|
|
45
47
|
/**
|
|
46
48
|
* 更新时间
|
|
47
49
|
* @example "2022-03-09 14:00:00"
|
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;
|
package/types/env/type.d.ts
CHANGED
|
@@ -14,3 +14,190 @@ export interface CalculatePackageModifyPriceParams {
|
|
|
14
14
|
envId: string;
|
|
15
15
|
currency?: 'CNY' | 'USD';
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* 客户端限频配置
|
|
19
|
+
*/
|
|
20
|
+
export interface HTTPServiceQPSPerClient {
|
|
21
|
+
LimitBy?: 'UserID' | 'ClientIP';
|
|
22
|
+
LimitValue?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* QPS限频策略
|
|
26
|
+
*/
|
|
27
|
+
export interface HTTPServiceRouteQPSPolicy {
|
|
28
|
+
QPSTotal?: number;
|
|
29
|
+
QPSPerClient?: HTTPServiceQPSPerClient;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 路径重写
|
|
33
|
+
*/
|
|
34
|
+
export interface HTTPServicePathRewrite {
|
|
35
|
+
StaticStorePrefix?: string;
|
|
36
|
+
Prefix?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* HTTP访问服务路由信息
|
|
40
|
+
*/
|
|
41
|
+
export interface HTTPServiceRoute {
|
|
42
|
+
Path: string;
|
|
43
|
+
PathRewrite?: HTTPServicePathRewrite;
|
|
44
|
+
UpstreamResourceType: 'SCF' | 'CBR' | 'STATIC_STORE' | 'WEB_SCF' | 'LH';
|
|
45
|
+
UpstreamResourceName: string;
|
|
46
|
+
EnableSafeDomain: boolean;
|
|
47
|
+
EnableAuth: boolean;
|
|
48
|
+
EnablePathTransmission: boolean;
|
|
49
|
+
QPSPolicy?: HTTPServiceRouteQPSPolicy;
|
|
50
|
+
Enable: boolean;
|
|
51
|
+
CreateTime: string;
|
|
52
|
+
UpdateTime: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 域名路由信息
|
|
56
|
+
*/
|
|
57
|
+
export interface HTTPServiceDomain {
|
|
58
|
+
Domain: string;
|
|
59
|
+
DomainType: 'HTTPSERVICE' | 'CBR' | 'ANYSERVICE' | 'AI_AGENT' | 'VM' | 'INTEGRATION_CALLBACK';
|
|
60
|
+
AccessType: 'DIRECT' | 'CDN' | 'CUSTOM';
|
|
61
|
+
CertId: string;
|
|
62
|
+
Protocol: 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
|
|
63
|
+
Cname: string;
|
|
64
|
+
IsDefault: boolean;
|
|
65
|
+
Enable: boolean;
|
|
66
|
+
Status: 'PROCESSING' | 'FAIL' | 'SUCCESS';
|
|
67
|
+
DNSStatus: 'OK' | 'INVALID';
|
|
68
|
+
Routes?: HTTPServiceRoute[];
|
|
69
|
+
CreateTime: string;
|
|
70
|
+
UpdateTime: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 过滤条件
|
|
74
|
+
*/
|
|
75
|
+
export interface HTTPServiceRouteFilter {
|
|
76
|
+
Name?: 'Domain' | 'Path' | 'DomainType' | 'UpstreamResourceType';
|
|
77
|
+
Values?: string[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* DescribeHTTPServiceRoute 请求参数
|
|
81
|
+
*/
|
|
82
|
+
export interface DescribeHttpServiceRouteParams {
|
|
83
|
+
EnvId: string;
|
|
84
|
+
Filters?: HTTPServiceRouteFilter[];
|
|
85
|
+
Offset?: number;
|
|
86
|
+
Limit?: number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* DescribeHTTPServiceRoute 返回结果
|
|
90
|
+
*/
|
|
91
|
+
export interface DescribeHttpServiceRouteRes {
|
|
92
|
+
Domains?: HTTPServiceDomain[];
|
|
93
|
+
OriginDomain: string;
|
|
94
|
+
TotalCount: number;
|
|
95
|
+
RequestId: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* HTTP访问服务路由参数(创建/修改)
|
|
99
|
+
*/
|
|
100
|
+
export interface HTTPServiceRouteParam {
|
|
101
|
+
Path: string;
|
|
102
|
+
UpstreamResourceType?: 'SCF' | 'CBR' | 'STATIC_STORE' | 'WEB_SCF' | 'LH';
|
|
103
|
+
UpstreamResourceName?: string;
|
|
104
|
+
PathRewrite?: HTTPServicePathRewrite;
|
|
105
|
+
EnableSafeDomain?: boolean;
|
|
106
|
+
EnableAuth?: boolean;
|
|
107
|
+
EnablePathTransmission?: boolean;
|
|
108
|
+
QPSPolicy?: HTTPServiceRouteQPSPolicy;
|
|
109
|
+
Enable?: boolean;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* HTTP访问服务域名参数(创建/修改)
|
|
113
|
+
*/
|
|
114
|
+
export interface HTTPServiceDomainParam {
|
|
115
|
+
Domain: string;
|
|
116
|
+
AccessType?: 'DIRECT' | 'CDN' | 'CUSTOM';
|
|
117
|
+
CertId?: string;
|
|
118
|
+
Protocol?: 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
|
|
119
|
+
CustomCname?: string;
|
|
120
|
+
Enable?: boolean;
|
|
121
|
+
Routes?: HTTPServiceRouteParam[];
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* CreateHTTPServiceRoute 请求参数
|
|
125
|
+
*/
|
|
126
|
+
export interface CreateHttpServiceRouteParams {
|
|
127
|
+
EnvId: string;
|
|
128
|
+
Domain: HTTPServiceDomainParam;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* CreateHTTPServiceRoute 返回结果
|
|
132
|
+
*/
|
|
133
|
+
export interface CreateHttpServiceRouteRes {
|
|
134
|
+
RequestId: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* ModifyHTTPServiceRoute 请求参数
|
|
138
|
+
*/
|
|
139
|
+
export interface ModifyHttpServiceRouteParams {
|
|
140
|
+
EnvId: string;
|
|
141
|
+
Domain: HTTPServiceDomainParam;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* ModifyHTTPServiceRoute 返回结果
|
|
145
|
+
*/
|
|
146
|
+
export interface ModifyHttpServiceRouteRes {
|
|
147
|
+
RequestId: string;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* DeleteHTTPServiceRoute 请求参数
|
|
151
|
+
*/
|
|
152
|
+
export interface DeleteHttpServiceRouteParams {
|
|
153
|
+
EnvId: string;
|
|
154
|
+
Domain: string;
|
|
155
|
+
Paths?: string[];
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* DeleteHTTPServiceRoute 返回结果
|
|
159
|
+
*/
|
|
160
|
+
export interface DeleteHttpServiceRouteRes {
|
|
161
|
+
RequestId: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* 绑定自定义域名的域名参数
|
|
165
|
+
* 与 HTTPServiceDomainParam 类似,但不包含 Routes(绑定域名场景)
|
|
166
|
+
*/
|
|
167
|
+
export interface BindCustomDomainDomainParam {
|
|
168
|
+
Domain: string;
|
|
169
|
+
CertId: string;
|
|
170
|
+
AccessType?: 'DIRECT' | 'CDN' | 'CUSTOM';
|
|
171
|
+
Protocol?: 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
|
|
172
|
+
Enable?: boolean;
|
|
173
|
+
CustomCname?: string;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* BindCustomDomain 请求参数
|
|
177
|
+
* 用于绑定自定义域名到 HTTP 访问服务
|
|
178
|
+
* 底层调用 CreateHTTPServiceRoute API,但参数配置不同
|
|
179
|
+
*/
|
|
180
|
+
export interface BindCustomDomainParams {
|
|
181
|
+
EnvId: string;
|
|
182
|
+
Domain: BindCustomDomainDomainParam;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* BindCustomDomain 返回结果
|
|
186
|
+
*/
|
|
187
|
+
export interface BindCustomDomainRes {
|
|
188
|
+
RequestId: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* DeleteCustomDomain 请求参数
|
|
192
|
+
* 用于删除自定义域名(仅当域名下无路由绑定时可删除)
|
|
193
|
+
*/
|
|
194
|
+
export interface DeleteCustomDomainParams {
|
|
195
|
+
EnvId: string;
|
|
196
|
+
Domain: string;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* DeleteCustomDomain 返回结果
|
|
200
|
+
*/
|
|
201
|
+
export interface DeleteCustomDomainRes {
|
|
202
|
+
RequestId: string;
|
|
203
|
+
}
|
package/types/environment.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { AccessService } from './access';
|
|
|
13
13
|
import { UserService } from './user';
|
|
14
14
|
import { CloudBaseRunService } from './cloudBaseRun';
|
|
15
15
|
import { MysqlService } from './mysql';
|
|
16
|
+
import { CloudAppService } from './cloudApp';
|
|
16
17
|
import { EnvInfo } from './interfaces';
|
|
17
18
|
import { PermissionService } from './permission';
|
|
18
19
|
export declare class Environment {
|
|
@@ -35,6 +36,7 @@ export declare class Environment {
|
|
|
35
36
|
private cloudBaseRunService;
|
|
36
37
|
private mysqlService;
|
|
37
38
|
private permissionService;
|
|
39
|
+
private cloudAppService;
|
|
38
40
|
constructor(context: CloudBaseContext, envId: string);
|
|
39
41
|
lazyInit(): Promise<any>;
|
|
40
42
|
getEnvId(): string;
|
|
@@ -52,6 +54,7 @@ export declare class Environment {
|
|
|
52
54
|
getUserService(): UserService;
|
|
53
55
|
getCloudBaseRunService(): CloudBaseRunService;
|
|
54
56
|
getMysqlService(): MysqlService;
|
|
57
|
+
getCloudAppService(): CloudAppService;
|
|
55
58
|
getPermissionService(): PermissionService;
|
|
56
59
|
getCommonService(serviceType: string, serviceVersion: any): CommonService;
|
|
57
60
|
getServicesEnvInfo(): Promise<any>;
|