@cloudbase/manager-node 5.7.1-beta.0 → 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 -9
- 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 -8
- package/types/env/type.d.ts +6 -97
- 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
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import { ICloudFunctionTrigger, IFunctionImageConfig, IFunctionVPC } from '../interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* 镜像 HTTP 函数固定监听端口
|
|
4
|
+
* SCF HTTP 自定义镜像函数要求容器监听 9000
|
|
5
|
+
*/
|
|
6
|
+
export declare const IMAGE_FUNCTION_PORT = 9000;
|
|
7
|
+
/**
|
|
8
|
+
* 镜像构建默认目标平台
|
|
9
|
+
* SCF 运行环境为 linux/amd64,Apple Silicon 也必须显式构建该平台
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_IMAGE_PLATFORM = "linux/amd64";
|
|
12
|
+
/** 默认 Dockerfile 名称,相对于构建上下文 */
|
|
13
|
+
export declare const DEFAULT_DOCKERFILE = "Dockerfile";
|
|
14
|
+
/** HTTP 函数支持的构建策略 */
|
|
15
|
+
export type HttpBuildStrategy = 'zip' | 'cloud' | 'local' | 'image';
|
|
16
|
+
/** 函数运行模型 */
|
|
17
|
+
export type FunctionRuntimeModel = 'Event' | 'HTTP';
|
|
18
|
+
/** 自定义镜像运行时标识 */
|
|
19
|
+
export declare const CUSTOM_IMAGE_RUNTIME = "CustomImage";
|
|
20
|
+
/** 部署计划的粗粒度动作 */
|
|
21
|
+
export type DeployActionKind = 'create' | 'update' | 'replace' | 'noop';
|
|
22
|
+
/** 部署计划中的细粒度操作 */
|
|
23
|
+
export type DeployOperation = 'create-function' | 'update-code' | 'update-config' | 'replace-function' | 'configure-access' | 'configure-gateway';
|
|
24
|
+
/** 统一进度阶段 */
|
|
25
|
+
export type DeployStage = 'validate' | 'preflight' | 'plan' | 'pack' | 'upload' | 'build' | 'push' | 'deploy-function' | 'wait-active' | 'configure-access' | 'configure-gateway' | 'done';
|
|
26
|
+
/** 单项检查结论 */
|
|
27
|
+
export type CheckStatus = 'pass' | 'warn' | 'fail';
|
|
28
|
+
/**
|
|
29
|
+
* 单项检查结果
|
|
30
|
+
* 配置契约守卫与后续 Preflight 复用同一结构,便于上层统一展示
|
|
31
|
+
*/
|
|
32
|
+
export interface ICheckResult {
|
|
33
|
+
/** 稳定错误码,供上层做本地化和引导 */
|
|
34
|
+
id: string;
|
|
35
|
+
status: CheckStatus;
|
|
36
|
+
/** 简短结论 */
|
|
37
|
+
summary: string;
|
|
38
|
+
/** 详细信息,不得包含凭证 */
|
|
39
|
+
detail?: string;
|
|
40
|
+
/** 可执行的修复建议 */
|
|
41
|
+
remediation?: string;
|
|
42
|
+
docsUrl?: string;
|
|
43
|
+
/** 该问题是否可以通过切换到云端构建规避 */
|
|
44
|
+
canFallbackToCloud?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/** 检查报告 */
|
|
47
|
+
export interface ICheckReport {
|
|
48
|
+
/** config 表示纯配置契约校验;local/cloud 表示环境与云资源检查 */
|
|
49
|
+
scope: 'config' | 'local' | 'cloud';
|
|
50
|
+
strategy?: HttpBuildStrategy;
|
|
51
|
+
/** 是否没有 fail 项 */
|
|
52
|
+
ready: boolean;
|
|
53
|
+
checks: ICheckResult[];
|
|
54
|
+
/** 建议改用的策略 */
|
|
55
|
+
recommendedStrategy?: 'cloud';
|
|
56
|
+
}
|
|
57
|
+
/** 函数部署错误码 */
|
|
58
|
+
export declare const FUNCTION_DEPLOY_ERROR: {
|
|
59
|
+
readonly CONFIG_INVALID: "CONFIG_INVALID";
|
|
60
|
+
readonly CONFIG_NAME_INVALID: "CONFIG_NAME_INVALID";
|
|
61
|
+
readonly CONFIG_TYPE_INVALID: "CONFIG_TYPE_INVALID";
|
|
62
|
+
readonly CONFIG_STRATEGY_INVALID: "CONFIG_STRATEGY_INVALID";
|
|
63
|
+
readonly CONFIG_TIMEOUT_INVALID: "CONFIG_TIMEOUT_INVALID";
|
|
64
|
+
readonly CONFIG_MEMORY_SIZE_INVALID: "CONFIG_MEMORY_SIZE_INVALID";
|
|
65
|
+
readonly CONFIG_ENV_VARIABLE_INVALID: "CONFIG_ENV_VARIABLE_INVALID";
|
|
66
|
+
readonly EVENT_IMAGE_NOT_SUPPORTED: "EVENT_IMAGE_NOT_SUPPORTED";
|
|
67
|
+
readonly EVENT_GATEWAY_NOT_SUPPORTED: "EVENT_GATEWAY_NOT_SUPPORTED";
|
|
68
|
+
readonly EVENT_HTTP_FIELD_NOT_SUPPORTED: "EVENT_HTTP_FIELD_NOT_SUPPORTED";
|
|
69
|
+
readonly HTTP_ZIP_RUNTIME_INVALID: "HTTP_ZIP_RUNTIME_INVALID";
|
|
70
|
+
readonly HTTP_ZIP_IMAGE_CONFIG_CONFLICT: "HTTP_ZIP_IMAGE_CONFIG_CONFLICT";
|
|
71
|
+
readonly HTTP_ZIP_INSTALL_DEPENDENCY_OVERRIDDEN: "HTTP_ZIP_INSTALL_DEPENDENCY_OVERRIDDEN";
|
|
72
|
+
readonly HTTP_TRIGGER_NOT_SUPPORTED: "HTTP_TRIGGER_NOT_SUPPORTED";
|
|
73
|
+
readonly HTTP_CONCURRENCY_INVALID: "HTTP_CONCURRENCY_INVALID";
|
|
74
|
+
readonly HTTP_PROTOCOL_PARAMS_INVALID: "HTTP_PROTOCOL_PARAMS_INVALID";
|
|
75
|
+
readonly CODE_SOURCE_MISSING: "CODE_SOURCE_MISSING";
|
|
76
|
+
readonly CODE_SOURCE_CONFLICT: "CODE_SOURCE_CONFLICT";
|
|
77
|
+
readonly IMAGE_CONFIG_MISSING: "IMAGE_CONFIG_MISSING";
|
|
78
|
+
readonly IMAGE_CONFIG_NOT_ALLOWED: "IMAGE_CONFIG_NOT_ALLOWED";
|
|
79
|
+
readonly IMAGE_URI_INVALID: "IMAGE_URI_INVALID";
|
|
80
|
+
readonly IMAGE_TAG_MISSING: "IMAGE_TAG_MISSING";
|
|
81
|
+
readonly IMAGE_TAG_LATEST_FORBIDDEN: "IMAGE_TAG_LATEST_FORBIDDEN";
|
|
82
|
+
readonly IMAGE_TYPE_INVALID: "IMAGE_TYPE_INVALID";
|
|
83
|
+
readonly IMAGE_REGISTRY_ID_MISSING: "IMAGE_REGISTRY_ID_MISSING";
|
|
84
|
+
readonly IMAGE_REGISTRY_ID_INVALID: "IMAGE_REGISTRY_ID_INVALID";
|
|
85
|
+
readonly IMAGE_PORT_INVALID: "IMAGE_PORT_INVALID";
|
|
86
|
+
readonly IMAGE_RUNTIME_INVALID: "IMAGE_RUNTIME_INVALID";
|
|
87
|
+
readonly IMAGE_HANDLER_NOT_ALLOWED: "IMAGE_HANDLER_NOT_ALLOWED";
|
|
88
|
+
readonly BUILD_CONFIG_MISSING: "BUILD_CONFIG_MISSING";
|
|
89
|
+
readonly BUILD_DOCKERFILE_INVALID: "BUILD_DOCKERFILE_INVALID";
|
|
90
|
+
readonly BUILD_CONTEXT_INVALID: "BUILD_CONTEXT_INVALID";
|
|
91
|
+
readonly BUILD_PLATFORM_INVALID: "BUILD_PLATFORM_INVALID";
|
|
92
|
+
readonly BUILD_TAG_INVALID: "BUILD_TAG_INVALID";
|
|
93
|
+
readonly BUILD_REPOSITORY_INVALID: "BUILD_REPOSITORY_INVALID";
|
|
94
|
+
readonly BUILD_ARG_INVALID: "BUILD_ARG_INVALID";
|
|
95
|
+
readonly CLOUD_REGISTRY_CREDENTIAL_MISSING: "CLOUD_REGISTRY_CREDENTIAL_MISSING";
|
|
96
|
+
readonly CLOUD_REGISTRY_CREDENTIAL_INVALID: "CLOUD_REGISTRY_CREDENTIAL_INVALID";
|
|
97
|
+
readonly GATEWAY_PATH_INVALID: "GATEWAY_PATH_INVALID";
|
|
98
|
+
readonly LOCAL_FALLBACK_INVALID: "LOCAL_FALLBACK_INVALID";
|
|
99
|
+
readonly PREFLIGHT_CODE_PATH_MISSING: "PREFLIGHT_CODE_PATH_MISSING";
|
|
100
|
+
readonly PREFLIGHT_CODE_PATH_NOT_DIRECTORY: "PREFLIGHT_CODE_PATH_NOT_DIRECTORY";
|
|
101
|
+
readonly PREFLIGHT_BOOTSTRAP_MISSING: "PREFLIGHT_BOOTSTRAP_MISSING";
|
|
102
|
+
readonly PREFLIGHT_BOOTSTRAP_NOT_FILE: "PREFLIGHT_BOOTSTRAP_NOT_FILE";
|
|
103
|
+
readonly PREFLIGHT_BOOTSTRAP_NOT_EXECUTABLE: "PREFLIGHT_BOOTSTRAP_NOT_EXECUTABLE";
|
|
104
|
+
readonly PREFLIGHT_PACKAGE_TOO_LARGE: "PREFLIGHT_PACKAGE_TOO_LARGE";
|
|
105
|
+
readonly PREFLIGHT_SYMLINK_ESCAPE: "PREFLIGHT_SYMLINK_ESCAPE";
|
|
106
|
+
readonly PREFLIGHT_DEPENDENCY_NOT_BUNDLED: "PREFLIGHT_DEPENDENCY_NOT_BUNDLED";
|
|
107
|
+
readonly PREFLIGHT_IO_ERROR: "PREFLIGHT_IO_ERROR";
|
|
108
|
+
readonly PREFLIGHT_DOCKER_CLI_MISSING: "PREFLIGHT_DOCKER_CLI_MISSING";
|
|
109
|
+
readonly PREFLIGHT_DOCKER_DAEMON_UNAVAILABLE: "PREFLIGHT_DOCKER_DAEMON_UNAVAILABLE";
|
|
110
|
+
readonly PREFLIGHT_DOCKER_BUILDX_MISSING: "PREFLIGHT_DOCKER_BUILDX_MISSING";
|
|
111
|
+
readonly LOCAL_BUILD_CONTEXT_MISSING: "LOCAL_BUILD_CONTEXT_MISSING";
|
|
112
|
+
readonly LOCAL_BUILD_DOCKERFILE_MISSING: "LOCAL_BUILD_DOCKERFILE_MISSING";
|
|
113
|
+
readonly LOCAL_BUILD_REPOSITORY_MISSING: "LOCAL_BUILD_REPOSITORY_MISSING";
|
|
114
|
+
readonly LOCAL_BUILD_FAILED: "LOCAL_BUILD_FAILED";
|
|
115
|
+
readonly LOCAL_PUSH_FAILED: "LOCAL_PUSH_FAILED";
|
|
116
|
+
readonly LOCAL_DIGEST_QUERY_FAILED: "LOCAL_DIGEST_QUERY_FAILED";
|
|
117
|
+
readonly CLOUD_BUILD_DOCKERFILE_MISSING: "CLOUD_BUILD_DOCKERFILE_MISSING";
|
|
118
|
+
readonly CLOUD_UPLOAD_FAILED: "CLOUD_UPLOAD_FAILED";
|
|
119
|
+
readonly CLOUD_BUILD_TRIGGER_FAILED: "CLOUD_BUILD_TRIGGER_FAILED";
|
|
120
|
+
readonly CLOUD_BUILD_FAILED: "CLOUD_BUILD_FAILED";
|
|
121
|
+
readonly CLOUD_REGISTRY_AUTH_FAILED: "CLOUD_REGISTRY_AUTH_FAILED";
|
|
122
|
+
readonly CLOUD_PERSONAL_REGISTRY_REPOSITORY_QUOTA_EXCEEDED: "CLOUD_PERSONAL_REGISTRY_REPOSITORY_QUOTA_EXCEEDED";
|
|
123
|
+
readonly CLOUD_BUILD_CANCELED: "CLOUD_BUILD_CANCELED";
|
|
124
|
+
readonly CLOUD_BUILD_TIMEOUT: "CLOUD_BUILD_TIMEOUT";
|
|
125
|
+
readonly PREFLIGHT_IMAGE_REMOTE_NOT_FOUND: "PREFLIGHT_IMAGE_REMOTE_NOT_FOUND";
|
|
126
|
+
readonly PREFLIGHT_IMAGE_REMOTE_UNVERIFIABLE: "PREFLIGHT_IMAGE_REMOTE_UNVERIFIABLE";
|
|
127
|
+
readonly PREFLIGHT_IMAGE_DIGEST_UNRESOLVED: "PREFLIGHT_IMAGE_DIGEST_UNRESOLVED";
|
|
128
|
+
readonly PREFLIGHT_IMAGE_REGION_MISMATCH: "PREFLIGHT_IMAGE_REGION_MISMATCH";
|
|
129
|
+
readonly PREFLIGHT_IMAGE_PULL_ROLE_MISSING: "PREFLIGHT_IMAGE_PULL_ROLE_MISSING";
|
|
130
|
+
readonly PREFLIGHT_IMAGE_PULL_POLICY_MISSING: "PREFLIGHT_IMAGE_PULL_POLICY_MISSING";
|
|
131
|
+
readonly PREFLIGHT_IMAGE_PULL_AUTH_GRANTED: "PREFLIGHT_IMAGE_PULL_AUTH_GRANTED";
|
|
132
|
+
readonly PREFLIGHT_IMAGE_PULL_AUTH_UNVERIFIABLE: "PREFLIGHT_IMAGE_PULL_AUTH_UNVERIFIABLE";
|
|
133
|
+
readonly PREFLIGHT_CAM_PERMISSION_DENIED: "PREFLIGHT_CAM_PERMISSION_DENIED";
|
|
134
|
+
readonly FUNCTION_RECREATE_REQUIRED: "FUNCTION_RECREATE_REQUIRED";
|
|
135
|
+
readonly NOT_IMPLEMENTED: "NOT_IMPLEMENTED";
|
|
136
|
+
};
|
|
137
|
+
export type FunctionDeployErrorCode = typeof FUNCTION_DEPLOY_ERROR[keyof typeof FUNCTION_DEPLOY_ERROR];
|
|
138
|
+
/** 函数通用属性,Event 与 HTTP 共用 */
|
|
139
|
+
export interface IFunctionDeployCommon {
|
|
140
|
+
name: string;
|
|
141
|
+
description?: string;
|
|
142
|
+
timeout?: number;
|
|
143
|
+
memorySize?: number;
|
|
144
|
+
envVariables?: Record<string, string | number | boolean>;
|
|
145
|
+
vpc?: IFunctionVPC;
|
|
146
|
+
layers?: {
|
|
147
|
+
name: string;
|
|
148
|
+
version: number;
|
|
149
|
+
}[];
|
|
150
|
+
role?: string;
|
|
151
|
+
codeSecret?: string;
|
|
152
|
+
/** 声明式配置中的函数代码目录,由 DeployOrchestrator 解析为绝对 functionPath */
|
|
153
|
+
dir?: string;
|
|
154
|
+
l5?: boolean | 'TRUE' | 'FALSE';
|
|
155
|
+
}
|
|
156
|
+
/** 本地代码来源,三者互斥 */
|
|
157
|
+
export interface ILocalCodeSource {
|
|
158
|
+
/** 函数所在目录 */
|
|
159
|
+
functionRootPath?: string;
|
|
160
|
+
/** 单个函数目录 */
|
|
161
|
+
functionPath?: string;
|
|
162
|
+
/** ZIP 的 base64 内容 */
|
|
163
|
+
base64Code?: string;
|
|
164
|
+
ignore?: string | string[];
|
|
165
|
+
}
|
|
166
|
+
/** Event 函数部署配置 */
|
|
167
|
+
export interface IEventFunctionDeployConfig extends IFunctionDeployCommon, ILocalCodeSource {
|
|
168
|
+
type?: 'Event';
|
|
169
|
+
/** Event 函数只支持代码包部署 */
|
|
170
|
+
buildStrategy?: 'zip';
|
|
171
|
+
runtime?: string;
|
|
172
|
+
handler?: string;
|
|
173
|
+
installDependency?: boolean | 'TRUE' | 'FALSE';
|
|
174
|
+
triggers?: ICloudFunctionTrigger[];
|
|
175
|
+
}
|
|
176
|
+
/** HTTP 函数公共配置 */
|
|
177
|
+
export interface IHttpFunctionDeployCommon extends IFunctionDeployCommon {
|
|
178
|
+
type: 'HTTP';
|
|
179
|
+
/**
|
|
180
|
+
* 是否允许匿名访问
|
|
181
|
+
* 不传表示不由部署器管理访问规则
|
|
182
|
+
*/
|
|
183
|
+
public?: boolean;
|
|
184
|
+
/** 云接入路径(兼容既有声明式部署配置) */
|
|
185
|
+
path?: string;
|
|
186
|
+
/** 网关路径,例如 /api */
|
|
187
|
+
gatewayPath?: string;
|
|
188
|
+
/** HTTP 为普通 HTTP,WS 为 WebSocket;不传等价于 HTTP */
|
|
189
|
+
protocolType?: 'HTTP' | 'WS';
|
|
190
|
+
protocolParams?: {
|
|
191
|
+
wsParams?: {
|
|
192
|
+
idleTimeOut?: number;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
instanceConcurrencyConfig?: {
|
|
196
|
+
dynamicEnabled?: boolean | 'TRUE' | 'FALSE';
|
|
197
|
+
maxConcurrency?: number;
|
|
198
|
+
[key: string]: any;
|
|
199
|
+
};
|
|
200
|
+
/** 镜像地址兼容字段;image 策略会转换为 imageConfig.imageUri */
|
|
201
|
+
imageUri?: string;
|
|
202
|
+
}
|
|
203
|
+
/** HTTP 托管运行时代码包部署 */
|
|
204
|
+
export interface IHttpZipDeployConfig extends IHttpFunctionDeployCommon, ILocalCodeSource {
|
|
205
|
+
buildStrategy?: 'zip';
|
|
206
|
+
runtime?: string;
|
|
207
|
+
/**
|
|
208
|
+
* HTTP 代码包部署要求依赖随包携带
|
|
209
|
+
* 该字段会被强制置为 false
|
|
210
|
+
*/
|
|
211
|
+
installDependency?: boolean | 'TRUE' | 'FALSE';
|
|
212
|
+
}
|
|
213
|
+
/** 个人版 TCR 云端推送凭证,只能通过 CloudApp Secrets 传递密码。 */
|
|
214
|
+
export interface IRegistryCredential {
|
|
215
|
+
/** 腾讯云账号 ID(UIN),作为个人版 CCR 登录用户名 */
|
|
216
|
+
username: string;
|
|
217
|
+
/** 个人版 CCR 固定密码 */
|
|
218
|
+
password: string;
|
|
219
|
+
}
|
|
220
|
+
/** 镜像构建目标配置 */
|
|
221
|
+
export interface IImageBuildTarget {
|
|
222
|
+
/** 构建上下文目录,默认取部署调用方指定的函数目录 */
|
|
223
|
+
cwd?: string;
|
|
224
|
+
/** Dockerfile 相对构建上下文的路径,默认 Dockerfile */
|
|
225
|
+
dockerfile?: string;
|
|
226
|
+
/** 目标镜像仓库实例 ID */
|
|
227
|
+
registryId?: string;
|
|
228
|
+
/** 目标镜像命名空间;个人版 cloud 构建必填,推荐使用 {{env.TCB_TCR_NAMESPACE}} */
|
|
229
|
+
namespace?: string;
|
|
230
|
+
/**
|
|
231
|
+
* 目标镜像仓库路径。
|
|
232
|
+
* cloud 策略可提供 repository 名、namespace/repository 或完整
|
|
233
|
+
* registry/namespace/repository;省略时默认使用函数名。
|
|
234
|
+
*/
|
|
235
|
+
repository?: string;
|
|
236
|
+
/** 目标镜像 tag,缺省时由构建器按构建上下文摘要生成 */
|
|
237
|
+
tag?: string;
|
|
238
|
+
/** 目标平台,默认 linux/amd64 */
|
|
239
|
+
platform?: string;
|
|
240
|
+
/** 构建参数,不得写入敏感值 */
|
|
241
|
+
buildArgs?: Record<string, string>;
|
|
242
|
+
/** 个人版 TCR 云端推送凭证;personal + cloud 必填,推荐使用 {{env.*}} */
|
|
243
|
+
registryCredential?: IRegistryCredential;
|
|
244
|
+
/** 忽略同摘要镜像复用,强制重新构建 */
|
|
245
|
+
forceBuild?: boolean;
|
|
246
|
+
}
|
|
247
|
+
/** HTTP 自定义镜像公共配置 */
|
|
248
|
+
export interface IHttpImageRuntimeCommon extends IHttpFunctionDeployCommon {
|
|
249
|
+
runtime?: typeof CUSTOM_IMAGE_RUNTIME;
|
|
250
|
+
/** 容器监听端口,仅允许 9000 */
|
|
251
|
+
imagePort?: number;
|
|
252
|
+
/** 镜像类型,默认 enterprise */
|
|
253
|
+
imageType?: 'enterprise' | 'personal';
|
|
254
|
+
/** 企业版 TCR 实例 ID;个人版镜像不传 */
|
|
255
|
+
registryId?: string;
|
|
256
|
+
entryPoint?: string;
|
|
257
|
+
command?: string;
|
|
258
|
+
args?: string;
|
|
259
|
+
commandList?: string[];
|
|
260
|
+
argsList?: string[];
|
|
261
|
+
containerImageAccelerate?: boolean;
|
|
262
|
+
}
|
|
263
|
+
/** 云端构建镜像部署 */
|
|
264
|
+
export interface IHttpCloudDeployConfig extends IHttpImageRuntimeCommon {
|
|
265
|
+
buildStrategy: 'cloud';
|
|
266
|
+
build: IImageBuildTarget;
|
|
267
|
+
}
|
|
268
|
+
/** 本地构建镜像部署 */
|
|
269
|
+
export interface IHttpLocalDeployConfig extends IHttpImageRuntimeCommon {
|
|
270
|
+
buildStrategy: 'local';
|
|
271
|
+
build: IImageBuildTarget;
|
|
272
|
+
/**
|
|
273
|
+
* 本地构建环境不可用时的处理方式
|
|
274
|
+
* 默认 error,避免静默改变构建环境
|
|
275
|
+
*/
|
|
276
|
+
localFallback?: 'cloud' | 'error';
|
|
277
|
+
}
|
|
278
|
+
/** 已有镜像直接部署 */
|
|
279
|
+
export interface IHttpImageDeployConfig extends IHttpImageRuntimeCommon {
|
|
280
|
+
buildStrategy: 'image';
|
|
281
|
+
imageConfig: IFunctionImageConfig;
|
|
282
|
+
}
|
|
283
|
+
export type IHttpFunctionDeployConfig = IHttpZipDeployConfig | IHttpCloudDeployConfig | IHttpLocalDeployConfig | IHttpImageDeployConfig;
|
|
284
|
+
export type IFunctionDeployConfig = IEventFunctionDeployConfig | IHttpFunctionDeployConfig;
|
|
285
|
+
/** 规范化后的 Event 配置 */
|
|
286
|
+
export type INormalizedEventConfig = IEventFunctionDeployConfig & {
|
|
287
|
+
type: 'Event';
|
|
288
|
+
buildStrategy: 'zip';
|
|
289
|
+
};
|
|
290
|
+
/** 规范化后的 HTTP 代码包配置 */
|
|
291
|
+
export type INormalizedHttpZipConfig = IHttpZipDeployConfig & {
|
|
292
|
+
type: 'HTTP';
|
|
293
|
+
buildStrategy: 'zip';
|
|
294
|
+
};
|
|
295
|
+
/** 规范化后的 HTTP 云端构建配置 */
|
|
296
|
+
export type INormalizedHttpCloudConfig = IHttpCloudDeployConfig & {
|
|
297
|
+
type: 'HTTP';
|
|
298
|
+
buildStrategy: 'cloud';
|
|
299
|
+
runtime: typeof CUSTOM_IMAGE_RUNTIME;
|
|
300
|
+
imagePort: number;
|
|
301
|
+
};
|
|
302
|
+
/** 规范化后的 HTTP 本地构建配置 */
|
|
303
|
+
export type INormalizedHttpLocalConfig = IHttpLocalDeployConfig & {
|
|
304
|
+
type: 'HTTP';
|
|
305
|
+
buildStrategy: 'local';
|
|
306
|
+
runtime: typeof CUSTOM_IMAGE_RUNTIME;
|
|
307
|
+
imagePort: number;
|
|
308
|
+
localFallback: 'cloud' | 'error';
|
|
309
|
+
};
|
|
310
|
+
/** 规范化后的 HTTP 已有镜像配置 */
|
|
311
|
+
export type INormalizedHttpImageConfig = IHttpImageDeployConfig & {
|
|
312
|
+
type: 'HTTP';
|
|
313
|
+
buildStrategy: 'image';
|
|
314
|
+
runtime: typeof CUSTOM_IMAGE_RUNTIME;
|
|
315
|
+
imagePort: number;
|
|
316
|
+
};
|
|
317
|
+
export type INormalizedDeployConfig = INormalizedEventConfig | INormalizedHttpZipConfig | INormalizedHttpCloudConfig | INormalizedHttpLocalConfig | INormalizedHttpImageConfig;
|
|
318
|
+
/** 代码类部署物 */
|
|
319
|
+
export interface ICodeArtifact {
|
|
320
|
+
kind: 'code';
|
|
321
|
+
/** 交给 SCF 的代码传输方式 */
|
|
322
|
+
deployMode: 'cos' | 'zip';
|
|
323
|
+
functionRootPath?: string;
|
|
324
|
+
functionPath?: string;
|
|
325
|
+
base64Code?: string;
|
|
326
|
+
}
|
|
327
|
+
/** 镜像类部署物 */
|
|
328
|
+
export interface IImageArtifact {
|
|
329
|
+
kind: 'image';
|
|
330
|
+
deployMode: 'image';
|
|
331
|
+
imageUri: string;
|
|
332
|
+
imageDigest?: string;
|
|
333
|
+
imageType: 'enterprise' | 'personal';
|
|
334
|
+
registryId?: string;
|
|
335
|
+
imagePort: number;
|
|
336
|
+
/** 实际产出该镜像的策略 */
|
|
337
|
+
effectiveStrategy: HttpBuildStrategy;
|
|
338
|
+
buildId?: string;
|
|
339
|
+
logsUrl?: string;
|
|
340
|
+
entryPoint?: string;
|
|
341
|
+
command?: string;
|
|
342
|
+
args?: string;
|
|
343
|
+
commandList?: string[];
|
|
344
|
+
argsList?: string[];
|
|
345
|
+
containerImageAccelerate?: boolean;
|
|
346
|
+
}
|
|
347
|
+
export type IFunctionArtifact = ICodeArtifact | IImageArtifact;
|
|
348
|
+
/** 线上函数当前状态摘要 */
|
|
349
|
+
export interface IFunctionCurrentState {
|
|
350
|
+
functionName: string;
|
|
351
|
+
type: FunctionRuntimeModel;
|
|
352
|
+
runtime?: string;
|
|
353
|
+
status?: string;
|
|
354
|
+
protocolType?: string;
|
|
355
|
+
triggerNames: string[];
|
|
356
|
+
isCustomImage: boolean;
|
|
357
|
+
/** 以下字段用于 noop 差异比较,缺省表示线上未返回或不适用 */
|
|
358
|
+
imageUri?: string;
|
|
359
|
+
timeout?: number;
|
|
360
|
+
memorySize?: number;
|
|
361
|
+
description?: string;
|
|
362
|
+
/** 线上环境变量,键值对形式 */
|
|
363
|
+
envVariables?: Record<string, string>;
|
|
364
|
+
}
|
|
365
|
+
/** 部署计划 */
|
|
366
|
+
export interface IFunctionDeployPlan {
|
|
367
|
+
functionName: string;
|
|
368
|
+
functionType: FunctionRuntimeModel;
|
|
369
|
+
buildStrategy: HttpBuildStrategy;
|
|
370
|
+
/** 线上是否已存在同名函数 */
|
|
371
|
+
exists: boolean;
|
|
372
|
+
action: DeployActionKind;
|
|
373
|
+
operations: DeployOperation[];
|
|
374
|
+
/** 计划说明,用于向用户解释将要发生什么 */
|
|
375
|
+
reasons: string[];
|
|
376
|
+
/** 需要删除重建的原因,非空表示调用方需先在控制台删除函数 */
|
|
377
|
+
replaceReasons: string[];
|
|
378
|
+
current?: IFunctionCurrentState;
|
|
379
|
+
}
|
|
380
|
+
/** 单步执行结果 */
|
|
381
|
+
export interface IDeployStepResult {
|
|
382
|
+
stage: DeployStage;
|
|
383
|
+
status: 'success' | 'skipped' | 'failed';
|
|
384
|
+
/** 毫秒 */
|
|
385
|
+
elapsedTime: number;
|
|
386
|
+
detail?: string;
|
|
387
|
+
}
|
|
388
|
+
/** 进度事件 */
|
|
389
|
+
export interface IDeployProgressEvent {
|
|
390
|
+
stage: DeployStage;
|
|
391
|
+
status: 'start' | 'success' | 'skipped' | 'failed';
|
|
392
|
+
message?: string;
|
|
393
|
+
}
|
|
394
|
+
/** 部署结果 */
|
|
395
|
+
export interface IFunctionDeployResult {
|
|
396
|
+
functionName: string;
|
|
397
|
+
functionType: FunctionRuntimeModel;
|
|
398
|
+
/** 调用方请求的策略 */
|
|
399
|
+
requestedStrategy: HttpBuildStrategy;
|
|
400
|
+
/** 实际执行的策略,local 回退 cloud 时两者不同 */
|
|
401
|
+
effectiveStrategy: HttpBuildStrategy;
|
|
402
|
+
action: DeployActionKind;
|
|
403
|
+
operations: DeployOperation[];
|
|
404
|
+
/** 是否只生成计划未执行变更 */
|
|
405
|
+
dryRun: boolean;
|
|
406
|
+
imageUri?: string;
|
|
407
|
+
imageDigest?: string;
|
|
408
|
+
buildId?: string;
|
|
409
|
+
gatewayUrl?: string;
|
|
410
|
+
public?: boolean;
|
|
411
|
+
/** 毫秒 */
|
|
412
|
+
elapsedTime: number;
|
|
413
|
+
steps: IDeployStepResult[];
|
|
414
|
+
warnings: string[];
|
|
415
|
+
plan: IFunctionDeployPlan;
|
|
416
|
+
}
|
|
417
|
+
/** 部署选项 */
|
|
418
|
+
export interface IFunctionDeployOptions {
|
|
419
|
+
/** 只生成计划,不执行任何变更 */
|
|
420
|
+
dryRun?: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* 是否允许自动补齐镜像拉取所需的 CAM 授权(默认 true)
|
|
423
|
+
*
|
|
424
|
+
* 仅在检测到 image 策略缺少拉镜像策略时,为固定角色绑定唯一白名单策略;
|
|
425
|
+
* 绝不放大到其它策略。设为 false 时只诊断并给出手动授权指引,不做任何 CAM 写操作。
|
|
426
|
+
*/
|
|
427
|
+
autoGrant?: boolean;
|
|
428
|
+
onProgress?: (event: IDeployProgressEvent) => void;
|
|
429
|
+
}
|
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, DescribeHttpServiceRouteParams, DescribeHttpServiceRouteRes,
|
|
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, DescribeEnvInfoParams, DescribeEnvInfoResponse, DescribeEnvAccountCircleParams, DescribeEnvAccountCircleRes, DescribeCreditsUsageDetailParams, EnvPkgCreditsUsage } from '../interfaces/tcb.interface';
|
|
5
5
|
type SOURCE = 'miniapp' | 'qcloud';
|
|
6
6
|
interface IDeleteDomainRes {
|
|
@@ -888,13 +888,6 @@ export declare class EnvService {
|
|
|
888
888
|
* @returns {Promise<DescribeHttpServiceRouteRes>}
|
|
889
889
|
*/
|
|
890
890
|
describeHttpServiceRoute(params: DescribeHttpServiceRouteParams): Promise<DescribeHttpServiceRouteRes>;
|
|
891
|
-
/**
|
|
892
|
-
* 校验HTTP访问服务域名路由
|
|
893
|
-
* 此操作为只读预检,不会创建任何资源。
|
|
894
|
-
* @param {VerifyHttpServiceRouteParams} params 校验参数
|
|
895
|
-
* @returns {Promise<VerifyHttpServiceRouteRes>}
|
|
896
|
-
*/
|
|
897
|
-
verifyHttpServiceRoute(params: VerifyHttpServiceRouteParams): Promise<VerifyHttpServiceRouteRes>;
|
|
898
891
|
/**
|
|
899
892
|
* 创建HTTP访问服务域名路由
|
|
900
893
|
* @param {CreateHttpServiceRouteParams} params 创建参数
|
package/types/env/type.d.ts
CHANGED
|
@@ -35,43 +35,18 @@ export interface HTTPServicePathRewrite {
|
|
|
35
35
|
StaticStorePrefix?: string;
|
|
36
36
|
Prefix?: string;
|
|
37
37
|
}
|
|
38
|
-
/**
|
|
39
|
-
* HTTP 访问服务路由添加 header 配置
|
|
40
|
-
*/
|
|
41
|
-
export interface HTTPServiceHeaderToAdd {
|
|
42
|
-
Key?: string;
|
|
43
|
-
Value?: string;
|
|
44
|
-
Action?: 'APPEND_IF_EXISTS_OR_ADD' | 'ADD_IF_ABSENT' | 'OVERWRITE_IF_EXISTS_OR_ADD' | 'OVERWRITE_IF_EXISTS';
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* HTTP 访问服务路由 headers 处理配置
|
|
48
|
-
*/
|
|
49
|
-
export interface HTTPServiceHeadersHandler {
|
|
50
|
-
RequestHeadersToAdd?: HTTPServiceHeaderToAdd[];
|
|
51
|
-
RequestHeadersToRemove?: string[];
|
|
52
|
-
ResponseHeadersToAdd?: HTTPServiceHeaderToAdd[];
|
|
53
|
-
ResponseHeadersToRemove?: string[];
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* HTTP访问服务路由扩展字段
|
|
57
|
-
*/
|
|
58
|
-
export interface HTTPServiceExtension {
|
|
59
|
-
HeadersHandler?: HTTPServiceHeadersHandler;
|
|
60
|
-
[key: string]: unknown;
|
|
61
|
-
}
|
|
62
38
|
/**
|
|
63
39
|
* HTTP访问服务路由信息
|
|
64
40
|
*/
|
|
65
41
|
export interface HTTPServiceRoute {
|
|
66
42
|
Path: string;
|
|
67
43
|
PathRewrite?: HTTPServicePathRewrite;
|
|
68
|
-
UpstreamResourceType: 'SCF' | 'CBR' | 'STATIC_STORE' | 'WEB_SCF' | 'LH'
|
|
44
|
+
UpstreamResourceType: 'SCF' | 'CBR' | 'STATIC_STORE' | 'WEB_SCF' | 'LH';
|
|
69
45
|
UpstreamResourceName: string;
|
|
70
46
|
EnableSafeDomain: boolean;
|
|
71
47
|
EnableAuth: boolean;
|
|
72
48
|
EnablePathTransmission: boolean;
|
|
73
49
|
QPSPolicy?: HTTPServiceRouteQPSPolicy;
|
|
74
|
-
Extension?: HTTPServiceExtension;
|
|
75
50
|
Enable: boolean;
|
|
76
51
|
CreateTime: string;
|
|
77
52
|
UpdateTime: string;
|
|
@@ -82,7 +57,7 @@ export interface HTTPServiceRoute {
|
|
|
82
57
|
export interface HTTPServiceDomain {
|
|
83
58
|
Domain: string;
|
|
84
59
|
DomainType: 'HTTPSERVICE' | 'CBR' | 'ANYSERVICE' | 'AI_AGENT' | 'VM' | 'INTEGRATION_CALLBACK';
|
|
85
|
-
AccessType: 'DIRECT' | 'CDN' | 'CUSTOM'
|
|
60
|
+
AccessType: 'DIRECT' | 'CDN' | 'CUSTOM';
|
|
86
61
|
CertId: string;
|
|
87
62
|
Protocol: 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
|
|
88
63
|
Cname: string;
|
|
@@ -91,7 +66,6 @@ export interface HTTPServiceDomain {
|
|
|
91
66
|
Status: 'PROCESSING' | 'FAIL' | 'SUCCESS';
|
|
92
67
|
DNSStatus: 'OK' | 'INVALID';
|
|
93
68
|
Routes?: HTTPServiceRoute[];
|
|
94
|
-
Extension?: HTTPServiceExtension;
|
|
95
69
|
CreateTime: string;
|
|
96
70
|
UpdateTime: string;
|
|
97
71
|
}
|
|
@@ -125,14 +99,13 @@ export interface DescribeHttpServiceRouteRes {
|
|
|
125
99
|
*/
|
|
126
100
|
export interface HTTPServiceRouteParam {
|
|
127
101
|
Path: string;
|
|
128
|
-
UpstreamResourceType?: 'SCF' | 'CBR' | 'STATIC_STORE' | 'WEB_SCF' | 'LH'
|
|
102
|
+
UpstreamResourceType?: 'SCF' | 'CBR' | 'STATIC_STORE' | 'WEB_SCF' | 'LH';
|
|
129
103
|
UpstreamResourceName?: string;
|
|
130
104
|
PathRewrite?: HTTPServicePathRewrite;
|
|
131
105
|
EnableSafeDomain?: boolean;
|
|
132
106
|
EnableAuth?: boolean;
|
|
133
107
|
EnablePathTransmission?: boolean;
|
|
134
108
|
QPSPolicy?: HTTPServiceRouteQPSPolicy;
|
|
135
|
-
Extension?: HTTPServiceExtension;
|
|
136
109
|
Enable?: boolean;
|
|
137
110
|
}
|
|
138
111
|
/**
|
|
@@ -142,74 +115,10 @@ export interface HTTPServiceDomainParam {
|
|
|
142
115
|
Domain: string;
|
|
143
116
|
AccessType?: 'DIRECT' | 'CDN' | 'CUSTOM' | 'EO';
|
|
144
117
|
CertId?: string;
|
|
145
|
-
Protocol?: 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
|
|
118
|
+
Protocol?: 'HTTP' | 'HTTPS' | 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
|
|
146
119
|
CustomCname?: string;
|
|
147
120
|
Enable?: boolean;
|
|
148
121
|
Routes?: HTTPServiceRouteParam[];
|
|
149
|
-
Extension?: HTTPServiceExtension;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* 前置校验检查状态
|
|
153
|
-
*/
|
|
154
|
-
export type VerifyHttpServiceRouteCheckStatus = 'PASS' | 'SKIPPED' | 'FAIL';
|
|
155
|
-
/**
|
|
156
|
-
* 前置校验失败原因
|
|
157
|
-
*/
|
|
158
|
-
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';
|
|
159
|
-
/**
|
|
160
|
-
* 域名归属权 DNS 验证指引
|
|
161
|
-
*/
|
|
162
|
-
export interface OwnershipVerificationDnsInfo {
|
|
163
|
-
Subdomain?: string;
|
|
164
|
-
RecordType?: string;
|
|
165
|
-
RecordValue?: string;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* 域名归属权文件验证指引
|
|
169
|
-
*/
|
|
170
|
-
export interface OwnershipVerificationFileInfo {
|
|
171
|
-
Path?: string;
|
|
172
|
-
Content?: string;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* 域名归属权验证指引
|
|
176
|
-
*/
|
|
177
|
-
export interface OwnershipVerificationInfo {
|
|
178
|
-
Domain?: string;
|
|
179
|
-
DnsVerification?: OwnershipVerificationDnsInfo[];
|
|
180
|
-
FileVerification?: OwnershipVerificationFileInfo[];
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* VerifyHTTPServiceRoute 单项前置校验结果
|
|
184
|
-
*/
|
|
185
|
-
export interface VerifyHttpServiceRouteCheckItem {
|
|
186
|
-
Status: VerifyHttpServiceRouteCheckStatus;
|
|
187
|
-
Code?: VerifyHttpServiceRouteCheckCode;
|
|
188
|
-
Message?: string;
|
|
189
|
-
OwnershipVerification?: OwnershipVerificationInfo;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* VerifyHTTPServiceRoute 请求参数
|
|
193
|
-
*/
|
|
194
|
-
export interface VerifyHttpServiceRouteParams {
|
|
195
|
-
EnvId: string;
|
|
196
|
-
Domain: HTTPServiceDomainParam;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* VerifyHTTPServiceRoute 返回结果
|
|
200
|
-
*/
|
|
201
|
-
export interface VerifyHttpServiceRouteRes {
|
|
202
|
-
Passed: boolean;
|
|
203
|
-
Ownership: VerifyHttpServiceRouteCheckItem;
|
|
204
|
-
Cert: VerifyHttpServiceRouteCheckItem;
|
|
205
|
-
Quota: VerifyHttpServiceRouteCheckItem;
|
|
206
|
-
RouteConflict: VerifyHttpServiceRouteCheckItem;
|
|
207
|
-
DomainConflict: VerifyHttpServiceRouteCheckItem;
|
|
208
|
-
InternalAccount: VerifyHttpServiceRouteCheckItem;
|
|
209
|
-
Blacklist: VerifyHttpServiceRouteCheckItem;
|
|
210
|
-
CDNResource: VerifyHttpServiceRouteCheckItem;
|
|
211
|
-
EO: VerifyHttpServiceRouteCheckItem;
|
|
212
|
-
RequestId: string;
|
|
213
122
|
}
|
|
214
123
|
/**
|
|
215
124
|
* CreateHTTPServiceRoute 请求参数
|
|
@@ -258,8 +167,8 @@ export interface DeleteHttpServiceRouteRes {
|
|
|
258
167
|
export interface BindCustomDomainDomainParam {
|
|
259
168
|
Domain: string;
|
|
260
169
|
CertId: string;
|
|
261
|
-
AccessType?: 'DIRECT' | 'CDN' | 'CUSTOM';
|
|
262
|
-
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';
|
|
263
172
|
Enable?: boolean;
|
|
264
173
|
CustomCname?: string;
|
|
265
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 {
|