@cloudbase/manager-node 5.7.1-beta.1 → 5.8.0-beta.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/lib/cloudApp/index.js +12 -3
- package/lib/deploy/DatabaseDeployer.js +238 -0
- package/lib/deploy/DeployOrchestrator.js +645 -0
- package/lib/deploy/FunctionDeployer.js +611 -0
- package/lib/deploy/GatewayDeployer.js +612 -0
- package/lib/deploy/StateStore.js +327 -0
- package/lib/deploy/StaticDeployer.js +236 -0
- package/lib/deploy/domain.js +41 -0
- package/lib/deploy/framework.js +230 -0
- package/lib/deploy/function/artifact.js +207 -0
- package/lib/deploy/function/builders/cloud.js +654 -0
- package/lib/deploy/function/cam-preflight.js +157 -0
- package/lib/deploy/function/cloud-build-service.js +191 -0
- package/lib/deploy/function/config-guard.js +595 -0
- package/lib/deploy/function/docker-preflight.js +87 -0
- package/lib/deploy/function/image-preflight.js +164 -0
- package/lib/deploy/function/local-builder.js +129 -0
- package/lib/deploy/function/planner.js +278 -0
- package/lib/deploy/function/preflight.js +329 -0
- package/lib/deploy/types.js +103 -0
- package/lib/env/index.js +0 -27
- package/lib/environment.js +11 -0
- package/lib/function/index.js +1 -1
- package/lib/hosting/index.js +4 -1
- package/lib/index.js +31 -0
- package/lib/projectValidator/index.js +452 -0
- package/lib/projectValidator/types.js +2 -0
- package/lib/storage/index.js +6 -7
- package/lib/utils/index.js +62 -5
- package/package.json +2 -1
- package/types/cloudApp/index.d.ts +4 -0
- package/types/cloudApp/types.d.ts +87 -6
- package/types/deploy/DatabaseDeployer.d.ts +70 -0
- package/types/deploy/DeployOrchestrator.d.ts +170 -0
- package/types/deploy/FunctionDeployer.d.ts +159 -0
- package/types/deploy/GatewayDeployer.d.ts +194 -0
- package/types/deploy/StateStore.d.ts +170 -0
- package/types/deploy/StaticDeployer.d.ts +97 -0
- package/types/deploy/domain.d.ts +17 -0
- package/types/deploy/framework.d.ts +63 -0
- package/types/deploy/function/artifact.d.ts +40 -0
- package/types/deploy/function/builders/cloud.d.ts +110 -0
- package/types/deploy/function/cam-preflight.d.ts +51 -0
- package/types/deploy/function/cloud-build-service.d.ts +10 -0
- package/types/deploy/function/config-guard.d.ts +41 -0
- package/types/deploy/function/docker-preflight.d.ts +17 -0
- package/types/deploy/function/image-preflight.d.ts +21 -0
- package/types/deploy/function/local-builder.d.ts +26 -0
- package/types/deploy/function/planner.d.ts +15 -0
- package/types/deploy/function/preflight.d.ts +9 -0
- package/types/deploy/types.d.ts +429 -0
- package/types/env/index.d.ts +1 -17
- package/types/env/type.d.ts +6 -260
- package/types/environment.d.ts +7 -0
- package/types/function/types.d.ts +15 -0
- package/types/hosting/index.d.ts +6 -0
- package/types/index.d.ts +18 -0
- package/types/interfaces/function.interface.d.ts +1 -1
- package/types/projectValidator/index.d.ts +38 -0
- package/types/projectValidator/types.d.ts +26 -0
- package/types/storage/index.d.ts +6 -0
- package/types/utils/index.d.ts +13 -0
package/types/env/type.d.ts
CHANGED
|
@@ -14,169 +14,6 @@ export interface CalculatePackageModifyPriceParams {
|
|
|
14
14
|
envId: string;
|
|
15
15
|
currency?: 'CNY' | 'USD';
|
|
16
16
|
}
|
|
17
|
-
/** 获取 SSL 证书列表请求参数。 */
|
|
18
|
-
export interface DescribeCertificatesParams {
|
|
19
|
-
/** 分页偏移量,从 0 开始。 */
|
|
20
|
-
Offset?: number;
|
|
21
|
-
/** 每页数量,范围为 1 至 1000。 */
|
|
22
|
-
Limit?: number;
|
|
23
|
-
/** 模糊匹配证书 ID、备注名称或证书域名。 */
|
|
24
|
-
SearchKey?: string;
|
|
25
|
-
/** 证书类型:CA 为客户端证书,SVR 为服务器证书。 */
|
|
26
|
-
CertificateType?: 'CA' | 'SVR';
|
|
27
|
-
/** 项目 ID。 */
|
|
28
|
-
ProjectId?: number;
|
|
29
|
-
/** 按证书到期时间排序。 */
|
|
30
|
-
ExpirationSort?: 'ASC' | 'DESC';
|
|
31
|
-
/** 证书状态筛选。 */
|
|
32
|
-
CertificateStatus?: number[];
|
|
33
|
-
/** 是否仅返回可部署证书:1 是,0 否。 */
|
|
34
|
-
Deployable?: 0 | 1;
|
|
35
|
-
/** 是否仅返回上传托管证书:1 是,0 否。 */
|
|
36
|
-
Upload?: 0 | 1;
|
|
37
|
-
/** 是否仅返回可续期证书:1 是,0 否。 */
|
|
38
|
-
Renew?: 0 | 1;
|
|
39
|
-
/** 来源筛选。 */
|
|
40
|
-
FilterSource?: 'upload' | 'buy';
|
|
41
|
-
/** 是否仅返回国密证书:1 是,0 否。 */
|
|
42
|
-
IsSM?: 0 | 1;
|
|
43
|
-
/** 是否仅返回即将过期证书:1 是,0 否。 */
|
|
44
|
-
FilterExpiring?: 0 | 1;
|
|
45
|
-
/** 是否仅返回可托管证书:1 是,0 否。 */
|
|
46
|
-
Hostable?: 0 | 1;
|
|
47
|
-
/** 标签筛选条件。 */
|
|
48
|
-
Tags?: Array<{
|
|
49
|
-
TagKey: string;
|
|
50
|
-
TagValue?: string;
|
|
51
|
-
}>;
|
|
52
|
-
/** 是否仅返回等待签发证书:1 是,0 否。 */
|
|
53
|
-
IsPendingIssue?: 0 | 1;
|
|
54
|
-
/** 指定证书 ID 列表。 */
|
|
55
|
-
CertIds?: string[];
|
|
56
|
-
/** 订阅服务 ID。 */
|
|
57
|
-
ServiceId?: string;
|
|
58
|
-
}
|
|
59
|
-
/** Certificates.CertificateExtra:证书扩展信息。 */
|
|
60
|
-
export interface CertificateExtra {
|
|
61
|
-
DomainNumber: string;
|
|
62
|
-
OriginCertificateId: string | null;
|
|
63
|
-
ReplacedBy: string | null;
|
|
64
|
-
ReplacedFor: string | null;
|
|
65
|
-
RenewOrder: string | null;
|
|
66
|
-
SMCert: number;
|
|
67
|
-
CompanyType: number;
|
|
68
|
-
ServiceRenewCertificateId: string;
|
|
69
|
-
ServiceOriginCertificateId: string;
|
|
70
|
-
}
|
|
71
|
-
/** Certificates.ProjectInfo:项目信息。 */
|
|
72
|
-
export interface ProjectInfo {
|
|
73
|
-
ProjectName: string;
|
|
74
|
-
ProjectCreatorUin: number;
|
|
75
|
-
ProjectCreateTime: string;
|
|
76
|
-
ProjectResume: string;
|
|
77
|
-
OwnerUin: number;
|
|
78
|
-
ProjectId: string;
|
|
79
|
-
}
|
|
80
|
-
/** Certificates.PreAuditInfo:证书预审核信息。 */
|
|
81
|
-
export interface PreAuditInfo {
|
|
82
|
-
TotalPeriod: number;
|
|
83
|
-
NowPeriod: number;
|
|
84
|
-
ManagerId: string;
|
|
85
|
-
}
|
|
86
|
-
/** Certificates.HostingConfig:托管配置。 */
|
|
87
|
-
export interface HostingConfig {
|
|
88
|
-
ReplaceTime?: number;
|
|
89
|
-
MessageTypes?: number[];
|
|
90
|
-
ReplaceStartTime?: string;
|
|
91
|
-
ReplaceEndTime?: string;
|
|
92
|
-
}
|
|
93
|
-
/** Certificates.SupportDownloadType:支持下载的服务器格式。 */
|
|
94
|
-
export interface SupportDownloadType {
|
|
95
|
-
NGINX: boolean;
|
|
96
|
-
APACHE: boolean;
|
|
97
|
-
TOMCAT: boolean;
|
|
98
|
-
IIS: boolean;
|
|
99
|
-
JKS: boolean;
|
|
100
|
-
OTHER: boolean;
|
|
101
|
-
ROOT: boolean;
|
|
102
|
-
}
|
|
103
|
-
/** Certificates.Tags:标签信息。 */
|
|
104
|
-
export interface CertificateTag {
|
|
105
|
-
TagKey: string;
|
|
106
|
-
TagValue: string;
|
|
107
|
-
}
|
|
108
|
-
/** SSL 证书列表项,对应 DescribeCertificates 响应中的 Certificates 元素。 */
|
|
109
|
-
export interface Certificates {
|
|
110
|
-
OwnerUin: string;
|
|
111
|
-
ProjectId: string;
|
|
112
|
-
From: string;
|
|
113
|
-
PackageType: string;
|
|
114
|
-
CertificateType: 'CA' | 'SVR';
|
|
115
|
-
ProductZhName: string;
|
|
116
|
-
Domain: string;
|
|
117
|
-
Alias: string;
|
|
118
|
-
Status: number;
|
|
119
|
-
CertificateExtra: CertificateExtra;
|
|
120
|
-
VulnerabilityStatus: 'INACTIVE' | 'ACTIVE';
|
|
121
|
-
StatusMsg: string;
|
|
122
|
-
VerifyType: 'DNS_AUTO' | 'DNS' | 'FILE' | 'DNS_PROXY' | 'FILE_PROXY';
|
|
123
|
-
CertBeginTime: string;
|
|
124
|
-
CertEndTime: string;
|
|
125
|
-
ValidityPeriod: string;
|
|
126
|
-
InsertTime: string;
|
|
127
|
-
CertificateId: string;
|
|
128
|
-
SubjectAltName: string[];
|
|
129
|
-
PackageTypeName: string;
|
|
130
|
-
StatusName: string;
|
|
131
|
-
IsVip: boolean;
|
|
132
|
-
IsDv: boolean;
|
|
133
|
-
IsWildcard: boolean;
|
|
134
|
-
IsVulnerability: boolean;
|
|
135
|
-
RenewAble: boolean;
|
|
136
|
-
ProjectInfo: ProjectInfo;
|
|
137
|
-
BoundResource: string[];
|
|
138
|
-
Deployable: boolean;
|
|
139
|
-
Tags: CertificateTag[];
|
|
140
|
-
IsIgnore: boolean;
|
|
141
|
-
IsSM: boolean;
|
|
142
|
-
EncryptAlgorithm: string;
|
|
143
|
-
CAEncryptAlgorithms: string[];
|
|
144
|
-
CAEndTimes: string[];
|
|
145
|
-
CACommonNames: string[];
|
|
146
|
-
PreAuditInfo: PreAuditInfo;
|
|
147
|
-
AutoRenewFlag: number;
|
|
148
|
-
HostingStatus: number;
|
|
149
|
-
HostingCompleteTime: string;
|
|
150
|
-
HostingRenewCertId: string;
|
|
151
|
-
HasRenewOrder: string;
|
|
152
|
-
ReplaceOriCertIsDelete: boolean;
|
|
153
|
-
IsExpiring: boolean;
|
|
154
|
-
DVAuthDeadline: string;
|
|
155
|
-
ValidationPassedTime: string;
|
|
156
|
-
CertSANs: string[];
|
|
157
|
-
AwaitingValidationMsg: string;
|
|
158
|
-
AllowDownload: boolean;
|
|
159
|
-
IsDNSPODResolve: boolean;
|
|
160
|
-
IsPackage: boolean;
|
|
161
|
-
KeyPasswordCustomFlag: boolean;
|
|
162
|
-
SupportDownloadType: SupportDownloadType;
|
|
163
|
-
CertRevokedTime: string;
|
|
164
|
-
HostingResourceTypes: string[];
|
|
165
|
-
HostingConfig: HostingConfig | null;
|
|
166
|
-
IsHostingUploadRenewCert: boolean;
|
|
167
|
-
ServiceId: string;
|
|
168
|
-
ServiceStatus: 'initing' | 'running' | 'expired' | 'refunded' | 'nearExpire';
|
|
169
|
-
CertServiceBeginTime: string;
|
|
170
|
-
CertServiceEndTime: string;
|
|
171
|
-
CertServiceShareEnabled: boolean;
|
|
172
|
-
CertServiceValidCertificateCount: number;
|
|
173
|
-
}
|
|
174
|
-
/** 获取 SSL 证书列表响应。 */
|
|
175
|
-
export interface DescribeCertificatesRes {
|
|
176
|
-
TotalCount: number;
|
|
177
|
-
Certificates: Certificates[];
|
|
178
|
-
RequestId: string;
|
|
179
|
-
}
|
|
180
17
|
/**
|
|
181
18
|
* 客户端限频配置
|
|
182
19
|
*/
|
|
@@ -198,43 +35,18 @@ export interface HTTPServicePathRewrite {
|
|
|
198
35
|
StaticStorePrefix?: string;
|
|
199
36
|
Prefix?: string;
|
|
200
37
|
}
|
|
201
|
-
/**
|
|
202
|
-
* HTTP 访问服务路由添加 header 配置
|
|
203
|
-
*/
|
|
204
|
-
export interface HTTPServiceHeaderToAdd {
|
|
205
|
-
Key?: string;
|
|
206
|
-
Value?: string;
|
|
207
|
-
Action?: 'APPEND_IF_EXISTS_OR_ADD' | 'ADD_IF_ABSENT' | 'OVERWRITE_IF_EXISTS_OR_ADD' | 'OVERWRITE_IF_EXISTS';
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* HTTP 访问服务路由 headers 处理配置
|
|
211
|
-
*/
|
|
212
|
-
export interface HTTPServiceHeadersHandler {
|
|
213
|
-
RequestHeadersToAdd?: HTTPServiceHeaderToAdd[];
|
|
214
|
-
RequestHeadersToRemove?: string[];
|
|
215
|
-
ResponseHeadersToAdd?: HTTPServiceHeaderToAdd[];
|
|
216
|
-
ResponseHeadersToRemove?: string[];
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* HTTP访问服务路由扩展字段
|
|
220
|
-
*/
|
|
221
|
-
export interface HTTPServiceExtension {
|
|
222
|
-
HeadersHandler?: HTTPServiceHeadersHandler;
|
|
223
|
-
[key: string]: unknown;
|
|
224
|
-
}
|
|
225
38
|
/**
|
|
226
39
|
* HTTP访问服务路由信息
|
|
227
40
|
*/
|
|
228
41
|
export interface HTTPServiceRoute {
|
|
229
42
|
Path: string;
|
|
230
43
|
PathRewrite?: HTTPServicePathRewrite;
|
|
231
|
-
UpstreamResourceType: 'SCF' | 'CBR' | 'STATIC_STORE' | 'WEB_SCF' | 'LH'
|
|
44
|
+
UpstreamResourceType: 'SCF' | 'CBR' | 'STATIC_STORE' | 'WEB_SCF' | 'LH';
|
|
232
45
|
UpstreamResourceName: string;
|
|
233
46
|
EnableSafeDomain: boolean;
|
|
234
47
|
EnableAuth: boolean;
|
|
235
48
|
EnablePathTransmission: boolean;
|
|
236
49
|
QPSPolicy?: HTTPServiceRouteQPSPolicy;
|
|
237
|
-
Extension?: HTTPServiceExtension;
|
|
238
50
|
Enable: boolean;
|
|
239
51
|
CreateTime: string;
|
|
240
52
|
UpdateTime: string;
|
|
@@ -245,7 +57,7 @@ export interface HTTPServiceRoute {
|
|
|
245
57
|
export interface HTTPServiceDomain {
|
|
246
58
|
Domain: string;
|
|
247
59
|
DomainType: 'HTTPSERVICE' | 'CBR' | 'ANYSERVICE' | 'AI_AGENT' | 'VM' | 'INTEGRATION_CALLBACK';
|
|
248
|
-
AccessType: 'DIRECT' | 'CDN' | 'CUSTOM'
|
|
60
|
+
AccessType: 'DIRECT' | 'CDN' | 'CUSTOM';
|
|
249
61
|
CertId: string;
|
|
250
62
|
Protocol: 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
|
|
251
63
|
Cname: string;
|
|
@@ -254,7 +66,6 @@ export interface HTTPServiceDomain {
|
|
|
254
66
|
Status: 'PROCESSING' | 'FAIL' | 'SUCCESS';
|
|
255
67
|
DNSStatus: 'OK' | 'INVALID';
|
|
256
68
|
Routes?: HTTPServiceRoute[];
|
|
257
|
-
Extension?: HTTPServiceExtension;
|
|
258
69
|
CreateTime: string;
|
|
259
70
|
UpdateTime: string;
|
|
260
71
|
}
|
|
@@ -288,14 +99,13 @@ export interface DescribeHttpServiceRouteRes {
|
|
|
288
99
|
*/
|
|
289
100
|
export interface HTTPServiceRouteParam {
|
|
290
101
|
Path: string;
|
|
291
|
-
UpstreamResourceType?: 'SCF' | 'CBR' | 'STATIC_STORE' | 'WEB_SCF' | 'LH'
|
|
102
|
+
UpstreamResourceType?: 'SCF' | 'CBR' | 'STATIC_STORE' | 'WEB_SCF' | 'LH';
|
|
292
103
|
UpstreamResourceName?: string;
|
|
293
104
|
PathRewrite?: HTTPServicePathRewrite;
|
|
294
105
|
EnableSafeDomain?: boolean;
|
|
295
106
|
EnableAuth?: boolean;
|
|
296
107
|
EnablePathTransmission?: boolean;
|
|
297
108
|
QPSPolicy?: HTTPServiceRouteQPSPolicy;
|
|
298
|
-
Extension?: HTTPServiceExtension;
|
|
299
109
|
Enable?: boolean;
|
|
300
110
|
}
|
|
301
111
|
/**
|
|
@@ -305,74 +115,10 @@ export interface HTTPServiceDomainParam {
|
|
|
305
115
|
Domain: string;
|
|
306
116
|
AccessType?: 'DIRECT' | 'CDN' | 'CUSTOM' | 'EO';
|
|
307
117
|
CertId?: string;
|
|
308
|
-
Protocol?: 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
|
|
118
|
+
Protocol?: 'HTTP' | 'HTTPS' | 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
|
|
309
119
|
CustomCname?: string;
|
|
310
120
|
Enable?: boolean;
|
|
311
121
|
Routes?: HTTPServiceRouteParam[];
|
|
312
|
-
Extension?: HTTPServiceExtension;
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* 前置校验检查状态
|
|
316
|
-
*/
|
|
317
|
-
export type VerifyHttpServiceRouteCheckStatus = 'PASS' | 'SKIPPED' | 'FAIL';
|
|
318
|
-
/**
|
|
319
|
-
* 前置校验失败原因
|
|
320
|
-
*/
|
|
321
|
-
export type VerifyHttpServiceRouteCheckCode = 'INTERNAL_CHECK_ERROR' | 'OWNERSHIP_DNS_LOOKUP_FAILED' | 'OWNERSHIP_VERIFY_FAILED' | 'CERT_VERIFY_FAILED' | 'QUOTA_EXCEEDED' | 'ROUTE_CONFLICT' | 'DOMAIN_IN_USE' | 'NON_INTERNAL_ACCOUNT' | 'DOMAIN_IN_BLACKLIST' | 'CDN_RESOURCE_PROCESSING' | 'CDN_RESOURCE_OFFLINE' | 'EO_OWNERSHIP_VERIFY_FAILED' | 'EO_DOMAIN_NOT_ICP' | 'EO_DOMAIN_IN_USE';
|
|
322
|
-
/**
|
|
323
|
-
* 域名归属权 DNS 验证指引
|
|
324
|
-
*/
|
|
325
|
-
export interface OwnershipVerificationDnsInfo {
|
|
326
|
-
Subdomain?: string;
|
|
327
|
-
RecordType?: string;
|
|
328
|
-
RecordValue?: string;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* 域名归属权文件验证指引
|
|
332
|
-
*/
|
|
333
|
-
export interface OwnershipVerificationFileInfo {
|
|
334
|
-
Path?: string;
|
|
335
|
-
Content?: string;
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* 域名归属权验证指引
|
|
339
|
-
*/
|
|
340
|
-
export interface OwnershipVerificationInfo {
|
|
341
|
-
Domain?: string;
|
|
342
|
-
DnsVerification?: OwnershipVerificationDnsInfo[];
|
|
343
|
-
FileVerification?: OwnershipVerificationFileInfo[];
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* VerifyHTTPServiceRoute 单项前置校验结果
|
|
347
|
-
*/
|
|
348
|
-
export interface VerifyHttpServiceRouteCheckItem {
|
|
349
|
-
Status: VerifyHttpServiceRouteCheckStatus;
|
|
350
|
-
Code?: VerifyHttpServiceRouteCheckCode;
|
|
351
|
-
Message?: string;
|
|
352
|
-
OwnershipVerification?: OwnershipVerificationInfo;
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* VerifyHTTPServiceRoute 请求参数
|
|
356
|
-
*/
|
|
357
|
-
export interface VerifyHttpServiceRouteParams {
|
|
358
|
-
EnvId: string;
|
|
359
|
-
Domain: HTTPServiceDomainParam;
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* VerifyHTTPServiceRoute 返回结果
|
|
363
|
-
*/
|
|
364
|
-
export interface VerifyHttpServiceRouteRes {
|
|
365
|
-
Passed: boolean;
|
|
366
|
-
Ownership: VerifyHttpServiceRouteCheckItem;
|
|
367
|
-
Cert: VerifyHttpServiceRouteCheckItem;
|
|
368
|
-
Quota: VerifyHttpServiceRouteCheckItem;
|
|
369
|
-
RouteConflict: VerifyHttpServiceRouteCheckItem;
|
|
370
|
-
DomainConflict: VerifyHttpServiceRouteCheckItem;
|
|
371
|
-
InternalAccount: VerifyHttpServiceRouteCheckItem;
|
|
372
|
-
Blacklist: VerifyHttpServiceRouteCheckItem;
|
|
373
|
-
CDNResource: VerifyHttpServiceRouteCheckItem;
|
|
374
|
-
EO: VerifyHttpServiceRouteCheckItem;
|
|
375
|
-
RequestId: string;
|
|
376
122
|
}
|
|
377
123
|
/**
|
|
378
124
|
* CreateHTTPServiceRoute 请求参数
|
|
@@ -421,8 +167,8 @@ export interface DeleteHttpServiceRouteRes {
|
|
|
421
167
|
export interface BindCustomDomainDomainParam {
|
|
422
168
|
Domain: string;
|
|
423
169
|
CertId: string;
|
|
424
|
-
AccessType?: 'DIRECT' | 'CDN' | 'CUSTOM';
|
|
425
|
-
Protocol?: 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
|
|
170
|
+
AccessType?: 'DIRECT' | 'CDN' | 'CUSTOM' | 'EO';
|
|
171
|
+
Protocol?: 'HTTP' | 'HTTPS' | 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
|
|
426
172
|
Enable?: boolean;
|
|
427
173
|
CustomCname?: string;
|
|
428
174
|
}
|
package/types/environment.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DatabaseService } from './database';
|
|
2
2
|
import { FunctionService } from './function';
|
|
3
|
+
import { FunctionDeployer } from './deploy/FunctionDeployer';
|
|
3
4
|
import { CloudRunService } from './cloudrun';
|
|
4
5
|
import { AgentService } from './agent';
|
|
5
6
|
import { StorageService } from './storage';
|
|
@@ -27,6 +28,7 @@ export declare class Environment {
|
|
|
27
28
|
private envId;
|
|
28
29
|
private envType?;
|
|
29
30
|
private functionService;
|
|
31
|
+
private functionDeployer;
|
|
30
32
|
private cloudRunService;
|
|
31
33
|
private agentService;
|
|
32
34
|
private databaseService;
|
|
@@ -52,6 +54,11 @@ export declare class Environment {
|
|
|
52
54
|
getStorageService(): StorageService;
|
|
53
55
|
getDatabaseService(): DatabaseService;
|
|
54
56
|
getFunctionService(): FunctionService;
|
|
57
|
+
/**
|
|
58
|
+
* 获取函数部署编排器
|
|
59
|
+
* 采用懒初始化,避免模块循环引用导致的初始化顺序问题
|
|
60
|
+
*/
|
|
61
|
+
getFunctionDeployer(): FunctionDeployer;
|
|
55
62
|
getCloudRunService(): CloudRunService;
|
|
56
63
|
getAgentService(): AgentService;
|
|
57
64
|
getEnvService(): EnvService;
|
|
@@ -105,6 +105,21 @@ export interface IFunctionInfo {
|
|
|
105
105
|
Variables: IEnvVariable[];
|
|
106
106
|
};
|
|
107
107
|
Type: string;
|
|
108
|
+
/** HTTP 函数协议类型;SCF 缺省时表示普通 HTTP */
|
|
109
|
+
ProtocolType?: string;
|
|
110
|
+
/** 自定义镜像函数配置 */
|
|
111
|
+
ImageConfig?: {
|
|
112
|
+
ImageType?: string;
|
|
113
|
+
ImageUri?: string;
|
|
114
|
+
RegistryId?: string;
|
|
115
|
+
EntryPoint?: string;
|
|
116
|
+
Command?: string;
|
|
117
|
+
Args?: string;
|
|
118
|
+
ContainerImageAccelerate?: boolean;
|
|
119
|
+
ImagePort?: number;
|
|
120
|
+
CommandList?: string[];
|
|
121
|
+
ArgsList?: string[];
|
|
122
|
+
};
|
|
108
123
|
EipConfig: {
|
|
109
124
|
EipFixed: 'FALSE' | 'TRUE';
|
|
110
125
|
Eips: string[];
|
package/types/hosting/index.d.ts
CHANGED
|
@@ -122,6 +122,12 @@ export interface IRoutingRules {
|
|
|
122
122
|
export interface IBucketWebsiteOptiosn {
|
|
123
123
|
indexDocument: string;
|
|
124
124
|
errorDocument?: string;
|
|
125
|
+
/** 错误文档是否保留原始 HTTP 状态码:Enabled / Disabled(SPA 回退需 Disabled) */
|
|
126
|
+
originalHttpStatus?: string;
|
|
127
|
+
/** 404 是否展示腾讯云公益页面:Enabled / Disabled(SPA 回退需 Disabled) */
|
|
128
|
+
charity404?: string;
|
|
129
|
+
/** 忽略 HTML 扩展名:Enabled / Disabled */
|
|
130
|
+
autoAddressing?: string;
|
|
125
131
|
routingRules?: Array<IRoutingRules>;
|
|
126
132
|
}
|
|
127
133
|
export interface IFindOptions {
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EnvService } from './env';
|
|
2
2
|
import { FunctionService } from './function';
|
|
3
|
+
import { FunctionDeployer } from './deploy/FunctionDeployer';
|
|
3
4
|
import { CloudRunService } from './cloudrun';
|
|
4
5
|
import { AgentService } from './agent';
|
|
5
6
|
import { StorageService } from './storage';
|
|
@@ -21,6 +22,8 @@ import { CloudAppService } from './cloudApp';
|
|
|
21
22
|
import { AiModelService } from './aiModel';
|
|
22
23
|
import { IntegrationService } from './integration';
|
|
23
24
|
import { MonitorService } from './monitor';
|
|
25
|
+
import { ProjectValidator } from './projectValidator';
|
|
26
|
+
import { DeployOrchestrator } from './deploy/DeployOrchestrator';
|
|
24
27
|
interface CloudBaseConfig {
|
|
25
28
|
secretId?: string;
|
|
26
29
|
secretKey?: string;
|
|
@@ -47,10 +50,17 @@ declare class CloudBase {
|
|
|
47
50
|
private cloudBaseConfig;
|
|
48
51
|
private environmentManager;
|
|
49
52
|
private docsService;
|
|
53
|
+
private projectValidatorService;
|
|
54
|
+
private deployOrchestratorService;
|
|
50
55
|
constructor(config?: CloudBaseConfig);
|
|
51
56
|
addEnvironment(envId: string): void;
|
|
52
57
|
currentEnvironment(): Environment;
|
|
53
58
|
get functions(): FunctionService;
|
|
59
|
+
/**
|
|
60
|
+
* 函数部署编排器(FunctionDeployer)
|
|
61
|
+
* 在现有 FunctionService 之上,按 buildStrategy 编排 Event/HTTP 函数的创建、更新与访问收敛
|
|
62
|
+
*/
|
|
63
|
+
get functionDeployer(): FunctionDeployer;
|
|
54
64
|
get cloudrun(): CloudRunService;
|
|
55
65
|
get agent(): AgentService;
|
|
56
66
|
get storage(): StorageService;
|
|
@@ -101,6 +111,14 @@ declare class CloudBase {
|
|
|
101
111
|
*/
|
|
102
112
|
get monitor(): MonitorService;
|
|
103
113
|
get docs(): DocsService;
|
|
114
|
+
get projectValidator(): ProjectValidator;
|
|
115
|
+
getProjectValidator(): ProjectValidator;
|
|
116
|
+
/**
|
|
117
|
+
* 声明式部署编排器
|
|
118
|
+
* 顺序:database → functions → app → hosting → gateway;支持 dry-run / only / skip / 幂等重试
|
|
119
|
+
*/
|
|
120
|
+
get deployOrchestrator(): DeployOrchestrator;
|
|
121
|
+
getDeployOrchestrator(): DeployOrchestrator;
|
|
104
122
|
getEnvironmentManager(): EnvironmentManager;
|
|
105
123
|
getManagerConfig(): CloudBaseConfig;
|
|
106
124
|
get isInternalEndpoint(): Boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ProjectValidationResult, ProjectValidatorValidateOptions } from './types';
|
|
2
|
+
export declare class ProjectValidator {
|
|
3
|
+
validate(options?: ProjectValidatorValidateOptions): Promise<ProjectValidationResult>;
|
|
4
|
+
private loadProjectConfig;
|
|
5
|
+
private validateSchema;
|
|
6
|
+
private validateEnvId;
|
|
7
|
+
/**
|
|
8
|
+
* 个人版 TCR 的 username/password/namespace 必须在 cloudbaserc 中显式声明。
|
|
9
|
+
* ConfigParser 已先解析 {{env.*}},因此这里同时承担缺失 env 值的前置校验。
|
|
10
|
+
*/
|
|
11
|
+
private validatePersonalRegistryConfig;
|
|
12
|
+
private hasPersonalCloudFunction;
|
|
13
|
+
private isPersonalCloudFunction;
|
|
14
|
+
private validateResources;
|
|
15
|
+
private validateConsistency;
|
|
16
|
+
/**
|
|
17
|
+
* 检测 hosting 路由中 enablePathTransmission=true 与自动生成 pathRewrite 的冲突
|
|
18
|
+
*
|
|
19
|
+
* hosting 目标未显式配置 pathRewrite 时,部署会自动生成 PathRewrite.Prefix = hosting.deployPath。
|
|
20
|
+
* 若同时显式开启 enablePathTransmission=true,路径透传会覆盖路径重写,导致请求打到错误的托管路径(404)。
|
|
21
|
+
*/
|
|
22
|
+
private validateGatewayPathRewriteConflicts;
|
|
23
|
+
/**
|
|
24
|
+
* 子路径部署(deployPath !== '/')下,前端构建产物若仍使用根路径 base(如 Vite 默认 '/'),
|
|
25
|
+
* 会导致资源请求落到 /assets/* 而非 /{deployPath}/assets/*,出现 404/白屏。
|
|
26
|
+
*
|
|
27
|
+
* 这里在“可能存在构建步骤”的 hosting 配置上给出防坑告警。
|
|
28
|
+
*/
|
|
29
|
+
private validateHostingSubPathBaseRisks;
|
|
30
|
+
private validateUniqueNames;
|
|
31
|
+
private validateUniqueField;
|
|
32
|
+
private validateGatewayTargets;
|
|
33
|
+
private getSummary;
|
|
34
|
+
private getLinkedEnvId;
|
|
35
|
+
private normalizeSchemaPath;
|
|
36
|
+
private getErrorMessage;
|
|
37
|
+
}
|
|
38
|
+
export * from './types';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type ProjectValidationIssueLevel = 'error' | 'warning';
|
|
2
|
+
export interface ProjectValidationIssue {
|
|
3
|
+
level: ProjectValidationIssueLevel;
|
|
4
|
+
resource?: string;
|
|
5
|
+
field?: string;
|
|
6
|
+
message: string;
|
|
7
|
+
fix?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ProjectValidationSummary {
|
|
10
|
+
functions: number;
|
|
11
|
+
hosting: number;
|
|
12
|
+
databases: number;
|
|
13
|
+
gateways: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ProjectValidationResult {
|
|
16
|
+
valid: boolean;
|
|
17
|
+
version: string;
|
|
18
|
+
errors: ProjectValidationIssue[];
|
|
19
|
+
warnings: ProjectValidationIssue[];
|
|
20
|
+
summary: ProjectValidationSummary;
|
|
21
|
+
}
|
|
22
|
+
export interface ProjectValidatorValidateOptions {
|
|
23
|
+
cwd?: string;
|
|
24
|
+
configPath?: string;
|
|
25
|
+
mode?: string;
|
|
26
|
+
}
|
package/types/storage/index.d.ts
CHANGED
|
@@ -49,6 +49,12 @@ export interface IRoutingRules {
|
|
|
49
49
|
export interface IBucketWebsiteOptions {
|
|
50
50
|
indexDocument: string;
|
|
51
51
|
errorDocument?: string;
|
|
52
|
+
/** 错误文档是否保留原始 HTTP 状态码:Enabled / Disabled(SPA 回退需 Disabled,否则 404 状态码使前端路由失效) */
|
|
53
|
+
originalHttpStatus?: string;
|
|
54
|
+
/** 404 是否展示腾讯云公益页面:Enabled / Disabled(SPA 回退需 Disabled,否则覆盖错误文档) */
|
|
55
|
+
charity404?: string;
|
|
56
|
+
/** 忽略 HTML 扩展名:Enabled / Disabled(未传则保持默认 Disabled) */
|
|
57
|
+
autoAddressing?: string;
|
|
52
58
|
routingRules?: Array<IRoutingRules>;
|
|
53
59
|
region: string;
|
|
54
60
|
bucket: string;
|
package/types/utils/index.d.ts
CHANGED
|
@@ -6,11 +6,24 @@ export * from './envLazy';
|
|
|
6
6
|
export * from './fs';
|
|
7
7
|
export * from './http-request';
|
|
8
8
|
export { guid6 } from './uuid';
|
|
9
|
+
interface IZipExtraEntry {
|
|
10
|
+
/** zip 包内的相对路径 */
|
|
11
|
+
zipPath: string;
|
|
12
|
+
/** 文件文本内容 */
|
|
13
|
+
content: string | Buffer;
|
|
14
|
+
/** unix 权限位(八进制),如 0o755 */
|
|
15
|
+
mode?: number;
|
|
16
|
+
}
|
|
9
17
|
interface IZipOption {
|
|
10
18
|
dirPath: string;
|
|
11
19
|
outputPath: string;
|
|
12
20
|
ignore?: string | string[];
|
|
13
21
|
pattern?: string;
|
|
22
|
+
/**
|
|
23
|
+
* 额外注入 zip 的文件条目(不来自 dirPath),用于把 SDK 生成的辅助文件
|
|
24
|
+
* (如构建推送脚本)打进包内,而不污染用户源码目录。
|
|
25
|
+
*/
|
|
26
|
+
extraEntries?: IZipExtraEntry[];
|
|
14
27
|
}
|
|
15
28
|
export declare function compressToZip(option: IZipOption): Promise<unknown>;
|
|
16
29
|
/**
|