@cloudbase/manager-node 5.8.0-beta.1 → 5.8.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/CHANGELOG.md +6 -0
- package/lib/deploy/DeployOrchestrator.js +8 -4
- package/lib/deploy/StateStore.js +1 -0
- package/lib/deploy/function/artifact.js +26 -8
- package/lib/deploy/function/config-guard.js +138 -70
- package/lib/env/index.js +27 -0
- package/lib/function/index.js +103 -92
- package/lib/projectValidator/index.js +4 -2
- package/package.json +2 -2
- package/types/deploy/StateStore.d.ts +4 -0
- package/types/deploy/types.d.ts +34 -5
- package/types/env/index.d.ts +17 -1
- package/types/env/type.d.ts +257 -3
- package/types/function/index.d.ts +37 -36
package/lib/function/index.js
CHANGED
|
@@ -126,7 +126,9 @@ function formatImageDeploymentErrorMessage(error, imageConfig) {
|
|
|
126
126
|
const isEnterprise = (imageConfig === null || imageConfig === void 0 ? void 0 : imageConfig.imageType) === 'enterprise';
|
|
127
127
|
const isEnterpriseImageNotFound = haystack.includes('resourcenotfound.image') ||
|
|
128
128
|
haystack.includes('describe images enterprise resource not found');
|
|
129
|
-
if (!isEnterprise ||
|
|
129
|
+
if (!isEnterprise ||
|
|
130
|
+
!isEnterpriseImageNotFound ||
|
|
131
|
+
message.includes(exports.ENTERPRISE_IMAGE_REGION_GUIDANCE)) {
|
|
130
132
|
return message;
|
|
131
133
|
}
|
|
132
134
|
return `${message}\n提示:${exports.ENTERPRISE_IMAGE_REGION_GUIDANCE}`;
|
|
@@ -140,25 +142,25 @@ function configToParams(options) {
|
|
|
140
142
|
// key: 小写用于匹配,value: PascalCase 用于输出
|
|
141
143
|
const AUTO_CONVERT_FIELDS = {
|
|
142
144
|
// 基础配置
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
description: 'Description',
|
|
146
|
+
memorysize: 'MemorySize',
|
|
147
|
+
timeout: 'Timeout',
|
|
148
|
+
runtime: 'Runtime',
|
|
149
|
+
type: 'Type', // Event/HTTP
|
|
150
|
+
role: 'Role',
|
|
149
151
|
// 日志配置
|
|
150
|
-
|
|
151
|
-
|
|
152
|
+
clslogsetid: 'ClsLogsetId',
|
|
153
|
+
clstopicid: 'ClsTopicId',
|
|
152
154
|
// 高级配置
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
deadletterconfig: 'DeadLetterConfig',
|
|
156
|
+
publicnetconfig: 'PublicNetConfig',
|
|
157
|
+
cfsconfig: 'CfsConfig',
|
|
158
|
+
inittimeout: 'InitTimeout',
|
|
159
|
+
tags: 'Tags',
|
|
158
160
|
// 注意:asyncRunEnable/traceEnable/autoDeployClsTopicIndex/autoCreateClsTopic/dnsCache
|
|
159
161
|
// 需要 'TRUE'/'FALSE' 字符串,在特殊处理阶段处理
|
|
160
|
-
|
|
161
|
-
|
|
162
|
+
protocoltype: 'ProtocolType', // WS
|
|
163
|
+
intranetconfig: 'IntranetConfig'
|
|
162
164
|
};
|
|
163
165
|
let params = Object.assign(Object.assign({}, baseParams), { FunctionName: func.name });
|
|
164
166
|
// 第一阶段:白名单字段自动转换(大小写不敏感,统一输出 PascalCase)
|
|
@@ -184,11 +186,11 @@ function configToParams(options) {
|
|
|
184
186
|
// 3. 需要 'TRUE'/'FALSE' 字符串的布尔字段统一处理(大小写不敏感)
|
|
185
187
|
// key: 小写用于匹配,value: PascalCase 用于输出
|
|
186
188
|
const BOOLEAN_STRING_FIELDS = {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
asyncrunenable: 'AsyncRunEnable', // 异步属性
|
|
190
|
+
traceenable: 'TraceEnable', // 事件追踪
|
|
191
|
+
autodeployclstopicindex: 'AutoDeployClsTopicIndex', // 自动创建 CLS 索引
|
|
192
|
+
autocreateclstopic: 'AutoCreateClsTopic', // 自动创建 CLS 主题
|
|
193
|
+
dnscache: 'DnsCache' // Dns 缓存
|
|
192
194
|
};
|
|
193
195
|
for (const key of Object.keys(func)) {
|
|
194
196
|
const lowerKey = key.toLowerCase();
|
|
@@ -352,7 +354,7 @@ class FunctionService {
|
|
|
352
354
|
// ENABLE_TCBF 开启时,runtime 适配 tcb 风格
|
|
353
355
|
if (this.useTcbFunctionApi) {
|
|
354
356
|
if (!func.runtime) {
|
|
355
|
-
params.Runtime = '
|
|
357
|
+
params.Runtime = 'Nodejs24.14';
|
|
356
358
|
}
|
|
357
359
|
}
|
|
358
360
|
const customCode = code;
|
|
@@ -360,7 +362,9 @@ class FunctionService {
|
|
|
360
362
|
const funcImageCode = (_a = params.Code) === null || _a === void 0 ? void 0 : _a.ImageConfig;
|
|
361
363
|
// 根据部署方式处理 Code 参数
|
|
362
364
|
// 优先级:deployMode=image > 显式传入 code > 原有自动打包逻辑(base64Code/functionPath/functionRootPath)
|
|
363
|
-
const isImageDeploy = deployMode === 'image' ||
|
|
365
|
+
const isImageDeploy = deployMode === 'image' ||
|
|
366
|
+
Boolean(customImageCode) ||
|
|
367
|
+
(!deployMode && Boolean(funcImageCode));
|
|
364
368
|
if (isImageDeploy) {
|
|
365
369
|
// 镜像部署优先使用显式 code.ImageConfig;未传时回退到 func.imageConfig(configToParams 生成)
|
|
366
370
|
if (customImageCode) {
|
|
@@ -580,9 +584,7 @@ class FunctionService {
|
|
|
580
584
|
*/
|
|
581
585
|
async deleteFunction(name) {
|
|
582
586
|
var _a;
|
|
583
|
-
const funcName = typeof name === 'string'
|
|
584
|
-
? name
|
|
585
|
-
: name === null || name === void 0 ? void 0 : name.name;
|
|
587
|
+
const funcName = typeof name === 'string' ? name : name === null || name === void 0 ? void 0 : name.name;
|
|
586
588
|
const { namespace } = this.getFunctionConfig();
|
|
587
589
|
// 检测是否绑定了 API 网关
|
|
588
590
|
const accessService = this.environment.getAccessService();
|
|
@@ -682,50 +684,50 @@ class FunctionService {
|
|
|
682
684
|
return data;
|
|
683
685
|
}
|
|
684
686
|
/**
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
687
|
+
* 获取函数日志
|
|
688
|
+
* @deprecated 底层 GetFunctionLogs 接口已下线,请使用 env.getLogService().searchClsLog() 查询云函数日志
|
|
689
|
+
* @param {{
|
|
690
|
+
* name: string
|
|
691
|
+
* offset: number
|
|
692
|
+
* limit: number
|
|
693
|
+
* order: string
|
|
694
|
+
* orderBy: string
|
|
695
|
+
* startTime: string
|
|
696
|
+
* endTime: string
|
|
697
|
+
* requestId: string
|
|
698
|
+
* }} options
|
|
699
|
+
* @returns {Promise<IFunctionLogRes>}
|
|
700
|
+
*/
|
|
699
701
|
async getFunctionLogs(_options) {
|
|
700
702
|
throw new error_1.CloudBaseError('getFunctionLogs 已废弃:底层 GetFunctionLogs 接口已下线,请使用 env.getLogService().searchClsLog() 查询云函数日志');
|
|
701
703
|
}
|
|
702
704
|
/**
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
705
|
+
* 获取函数日志 ID 列表
|
|
706
|
+
* @deprecated 底层 GetFunctionLogs 接口已下线,请使用 env.getLogService().searchClsLog() 查询云函数日志
|
|
707
|
+
* @param {{
|
|
708
|
+
* name: string
|
|
709
|
+
* offset: number
|
|
710
|
+
* limit: number
|
|
711
|
+
* startTime: string
|
|
712
|
+
* endTime: string
|
|
713
|
+
* requestId: string
|
|
714
|
+
* qualifier: string
|
|
715
|
+
* }} options
|
|
716
|
+
* @returns {Promise<IFunctionLogResV2>}
|
|
717
|
+
*/
|
|
716
718
|
async getFunctionLogsV2(_options) {
|
|
717
719
|
throw new error_1.CloudBaseError('getFunctionLogsV2 已废弃:底层 GetFunctionLogs 接口已下线,请使用 env.getLogService().searchClsLog() 查询云函数日志');
|
|
718
720
|
}
|
|
719
721
|
/**
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
722
|
+
* 根据函数日志 ID 查询日志详情
|
|
723
|
+
* @deprecated 底层 GetFunctionLogDetail 接口已下线,请使用 env.getLogService().searchClsLog() 查询云函数日志
|
|
724
|
+
* @param {{
|
|
725
|
+
* startTime: string
|
|
726
|
+
* endTime: string
|
|
727
|
+
* logRequestId: string
|
|
728
|
+
* }} options
|
|
729
|
+
* @returns {Promise<IFunctionLogDetailRes>}
|
|
730
|
+
*/
|
|
729
731
|
async getFunctionLogDetail(_options) {
|
|
730
732
|
throw new error_1.CloudBaseError('getFunctionLogDetail 已废弃:底层 GetFunctionLogDetail 接口已下线,请使用 env.getLogService().searchClsLog() 查询云函数日志');
|
|
731
733
|
}
|
|
@@ -752,22 +754,22 @@ class FunctionService {
|
|
|
752
754
|
// 注意:Runtime, Handler, Code, Type, ProtocolType 只能在 CreateFunction 时指定
|
|
753
755
|
// key: 小写用于匹配,value: PascalCase 用于输出
|
|
754
756
|
const UPDATE_CONFIG_FIELDS = {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
757
|
+
description: 'Description',
|
|
758
|
+
memorysize: 'MemorySize',
|
|
759
|
+
timeout: 'Timeout',
|
|
760
|
+
role: 'Role',
|
|
759
761
|
// 日志配置
|
|
760
|
-
|
|
761
|
-
|
|
762
|
+
clslogsetid: 'ClsLogsetId',
|
|
763
|
+
clstopicid: 'ClsTopicId',
|
|
762
764
|
// 高级配置
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
765
|
+
deadletterconfig: 'DeadLetterConfig',
|
|
766
|
+
publicnetconfig: 'PublicNetConfig',
|
|
767
|
+
cfsconfig: 'CfsConfig',
|
|
768
|
+
inittimeout: 'InitTimeout',
|
|
767
769
|
// 注意:asyncRunEnable/traceEnable/autoDeployClsTopicIndex/autoCreateClsTopic
|
|
768
770
|
// 只能在 CreateFunction 时设置,UpdateFunctionConfiguration 不支持
|
|
769
771
|
// 注意:dnsCache 需要 'TRUE'/'FALSE' 字符串,在特殊处理阶段处理
|
|
770
|
-
|
|
772
|
+
intranetconfig: 'IntranetConfig'
|
|
771
773
|
};
|
|
772
774
|
const { TopicId, LogsetId } = this.getClsServiceConfig();
|
|
773
775
|
// 构建参数
|
|
@@ -923,13 +925,14 @@ class FunctionService {
|
|
|
923
925
|
if (func.installDependency !== undefined) {
|
|
924
926
|
installDependency = toBooleanString(func.installDependency);
|
|
925
927
|
}
|
|
926
|
-
const codeParams = customCode ||
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
928
|
+
const codeParams = customCode ||
|
|
929
|
+
(await this.getCodeParams({
|
|
930
|
+
func,
|
|
931
|
+
functionPath,
|
|
932
|
+
functionRootPath,
|
|
933
|
+
base64Code,
|
|
934
|
+
deployMode
|
|
935
|
+
}, installDependency));
|
|
933
936
|
const params = {
|
|
934
937
|
FunctionName: funcName,
|
|
935
938
|
[this.namespaceParamKey]: namespace,
|
|
@@ -1167,7 +1170,7 @@ class FunctionService {
|
|
|
1167
1170
|
* @returns {Promise<void>}
|
|
1168
1171
|
*/
|
|
1169
1172
|
async downloadFunctionCode(options) {
|
|
1170
|
-
const { destPath, envId, functionName, codeSecret } = options;
|
|
1173
|
+
const { destPath, envId, functionName, codeSecret, qualifier } = options;
|
|
1171
1174
|
// 检验路径是否存在
|
|
1172
1175
|
(0, utils_1.checkFullAccess)(destPath, true);
|
|
1173
1176
|
// 获取下载链接:ENABLE_TCBF 开启走 tcb 的 DownloadFunction,否则走 scf 的 GetFunctionAddress
|
|
@@ -1176,6 +1179,10 @@ class FunctionService {
|
|
|
1176
1179
|
FunctionName: functionName,
|
|
1177
1180
|
[this.namespaceParamKey]: envId
|
|
1178
1181
|
};
|
|
1182
|
+
// 指定版本时透传 Qualifier;默认 $LATEST 与现状一致
|
|
1183
|
+
if (qualifier) {
|
|
1184
|
+
params.Qualifier = qualifier;
|
|
1185
|
+
}
|
|
1179
1186
|
if (codeSecret) {
|
|
1180
1187
|
params.CodeSecret = codeSecret;
|
|
1181
1188
|
}
|
|
@@ -1242,10 +1249,14 @@ class FunctionService {
|
|
|
1242
1249
|
const apiParams = {
|
|
1243
1250
|
Namespace: envId,
|
|
1244
1251
|
FunctionName: functionName,
|
|
1245
|
-
Layers: Layers.length > 0
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1252
|
+
Layers: Layers.length > 0
|
|
1253
|
+
? Layers
|
|
1254
|
+
: [
|
|
1255
|
+
{
|
|
1256
|
+
LayerName: '',
|
|
1257
|
+
LayerVersion: 0
|
|
1258
|
+
}
|
|
1259
|
+
]
|
|
1249
1260
|
};
|
|
1250
1261
|
return this.scfService.request('UpdateFunctionConfiguration', apiParams);
|
|
1251
1262
|
}
|
|
@@ -1344,7 +1355,7 @@ class FunctionService {
|
|
|
1344
1355
|
let param = {
|
|
1345
1356
|
Limit: limit,
|
|
1346
1357
|
Offset: offset,
|
|
1347
|
-
SearchKey: searchKey
|
|
1358
|
+
SearchKey: searchKey
|
|
1348
1359
|
// SearchSrc: `TCB_${env}`
|
|
1349
1360
|
};
|
|
1350
1361
|
if (runtime) {
|
|
@@ -1553,7 +1564,7 @@ class FunctionService {
|
|
|
1553
1564
|
Bucket: `${regionPrefix}tempcos-${constant_1.SCF_TEMP_COS.APPID}`,
|
|
1554
1565
|
Key: tempCosObjectName,
|
|
1555
1566
|
Region: region,
|
|
1556
|
-
FilePath: zipFilePath
|
|
1567
|
+
FilePath: zipFilePath
|
|
1557
1568
|
};
|
|
1558
1569
|
const cos = new cos_nodejs_sdk_v5_1.default({
|
|
1559
1570
|
getAuthorization: function (options, callback) {
|
|
@@ -1653,7 +1664,7 @@ class FunctionService {
|
|
|
1653
1664
|
// 直接传入 base64Code 的情况,校验大小
|
|
1654
1665
|
// ZipFile 上传大小上限 1.5MB,base64 编码后长度约为原始大小的 4/3
|
|
1655
1666
|
const MAX_ZIP_SIZE = 1.5 * 1024 * 1024; // 1.5MB
|
|
1656
|
-
const MAX_BASE64_LENGTH = Math.floor(MAX_ZIP_SIZE * 4 / 3); // ≈ 2097152
|
|
1667
|
+
const MAX_BASE64_LENGTH = Math.floor((MAX_ZIP_SIZE * 4) / 3); // ≈ 2097152
|
|
1657
1668
|
if ((base64Code === null || base64Code === void 0 ? void 0 : base64Code.length) > MAX_BASE64_LENGTH) {
|
|
1658
1669
|
throw new error_1.CloudBaseError('ZipFile 上传不能大于 1.5MB,请使用 COS 上传方式');
|
|
1659
1670
|
}
|
|
@@ -1767,10 +1778,10 @@ class FunctionService {
|
|
|
1767
1778
|
// 兜底从 Storages[0] 的 AppId 或 Bucket 名提取
|
|
1768
1779
|
// COS Bucket 格式: {BucketName}-{APPID},APPID 为纯数字
|
|
1769
1780
|
const storage = (_c = envConfig.Storages) === null || _c === void 0 ? void 0 : _c[0];
|
|
1770
|
-
const appId = ((_d = envConfig.UserInfo) === null || _d === void 0 ? void 0 : _d.AppId)
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1781
|
+
const appId = ((_d = envConfig.UserInfo) === null || _d === void 0 ? void 0 : _d.AppId) ||
|
|
1782
|
+
(storage === null || storage === void 0 ? void 0 : storage.AppId) ||
|
|
1783
|
+
((_f = (_e = storage === null || storage === void 0 ? void 0 : storage.Bucket) === null || _e === void 0 ? void 0 : _e.match(/-(\d+)$/)) === null || _f === void 0 ? void 0 : _f[1]) ||
|
|
1784
|
+
'';
|
|
1774
1785
|
const { proxy } = this.environment.cloudBaseContext;
|
|
1775
1786
|
return {
|
|
1776
1787
|
proxy,
|
|
@@ -190,10 +190,12 @@ class ProjectValidator {
|
|
|
190
190
|
return (config.functions || []).some((func) => this.isPersonalCloudFunction(func));
|
|
191
191
|
}
|
|
192
192
|
isPersonalCloudFunction(func) {
|
|
193
|
-
var _a;
|
|
193
|
+
var _a, _b, _c, _d, _e, _f;
|
|
194
|
+
const registryId = (_b = (_a = func.imageConfig) === null || _a === void 0 ? void 0 : _a.registryId) !== null && _b !== void 0 ? _b : (_d = (_c = func.imageConfig) === null || _c === void 0 ? void 0 : _c.build) === null || _d === void 0 ? void 0 : _d.registryId;
|
|
195
|
+
const imageType = (_f = (_e = func.imageConfig) === null || _e === void 0 ? void 0 : _e.imageType) !== null && _f !== void 0 ? _f : (registryId ? 'enterprise' : 'personal');
|
|
194
196
|
return (func.type === 'HTTP' &&
|
|
195
197
|
func.buildStrategy === 'cloud' &&
|
|
196
|
-
|
|
198
|
+
imageType === 'personal');
|
|
197
199
|
}
|
|
198
200
|
validateResources(cwd, config) {
|
|
199
201
|
const errors = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/manager-node",
|
|
3
|
-
"version": "5.8.0
|
|
3
|
+
"version": "5.8.0",
|
|
4
4
|
"description": "The node manage service api for cloudbase.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@cloudbase/signature-nodejs": "^1.0.0",
|
|
45
|
-
"@cloudbase/toolbox": "
|
|
45
|
+
"@cloudbase/toolbox": "~0.8.3",
|
|
46
46
|
"@cloudbase/database": "^0.6.2",
|
|
47
47
|
"archiver": "^3.1.1",
|
|
48
48
|
"cos-nodejs-sdk-v5": "^2.14.0",
|
|
@@ -58,6 +58,8 @@ export interface IDeployState {
|
|
|
58
58
|
version: number;
|
|
59
59
|
updatedAt: string;
|
|
60
60
|
gitCommit?: string;
|
|
61
|
+
/** 写入快照时的目标环境 ID:跨环境切换(如上海 → 新加坡)后旧快照不可信,skip 判定强制失效 */
|
|
62
|
+
envId?: string;
|
|
61
63
|
resources: {
|
|
62
64
|
hosting?: IHostingStateEntry[];
|
|
63
65
|
gateway?: unknown;
|
|
@@ -102,6 +104,8 @@ export declare class StateStore {
|
|
|
102
104
|
write(state: {
|
|
103
105
|
resources: IDeployState['resources'];
|
|
104
106
|
gitCommit?: string;
|
|
107
|
+
/** 本次部署的目标环境 ID(用于跨环境切换时使旧快照 skip 判定失效) */
|
|
108
|
+
envId?: string;
|
|
105
109
|
}): void;
|
|
106
110
|
/**
|
|
107
111
|
* 计算产物目录逐文件 sha256 指纹(仅 hash,兼容旧调用)
|
package/types/deploy/types.d.ts
CHANGED
|
@@ -156,6 +156,35 @@ export interface IFunctionDeployCommon {
|
|
|
156
156
|
/** 声明式配置中的函数代码目录,由 DeployOrchestrator 解析为绝对 functionPath */
|
|
157
157
|
dir?: string;
|
|
158
158
|
l5?: boolean | 'TRUE' | 'FALSE';
|
|
159
|
+
/** 标签列表(透传为 SCF Tags) */
|
|
160
|
+
tags?: {
|
|
161
|
+
Key: string;
|
|
162
|
+
Value: string;
|
|
163
|
+
}[];
|
|
164
|
+
/** 日志投递 CLS 日志集 ID */
|
|
165
|
+
clsLogsetId?: string;
|
|
166
|
+
/** 日志投递 CLS 主题 ID */
|
|
167
|
+
clsTopicId?: string;
|
|
168
|
+
/** 死信队列配置(透传为 SCF DeadLetterConfig) */
|
|
169
|
+
deadLetterConfig?: Record<string, unknown>;
|
|
170
|
+
/** 公网访问配置(透传为 SCF PublicNetConfig) */
|
|
171
|
+
publicNetConfig?: Record<string, unknown>;
|
|
172
|
+
/** 文件系统 CFS 配置(透传为 SCF CfsConfig) */
|
|
173
|
+
cfsConfig?: Record<string, unknown>;
|
|
174
|
+
/** 内网固定 IP 配置(透传为 SCF IntranetConfig) */
|
|
175
|
+
intranetConfig?: Record<string, unknown>;
|
|
176
|
+
/** 初始化超时时间(秒),范围 1-60 */
|
|
177
|
+
initTimeout?: number;
|
|
178
|
+
/** 是否开启异步属性(仅 CreateFunction 支持) */
|
|
179
|
+
asyncRunEnable?: boolean | 'TRUE' | 'FALSE';
|
|
180
|
+
/** 是否开启事件追踪(仅 CreateFunction 支持) */
|
|
181
|
+
traceEnable?: boolean | 'TRUE' | 'FALSE';
|
|
182
|
+
/** 是否自动创建 CLS 索引(仅 CreateFunction 支持) */
|
|
183
|
+
autoDeployClsTopicIndex?: boolean | 'TRUE' | 'FALSE';
|
|
184
|
+
/** 是否自动创建 CLS 主题(仅 CreateFunction 支持) */
|
|
185
|
+
autoCreateClsTopic?: boolean | 'TRUE' | 'FALSE';
|
|
186
|
+
/** 是否开启 DNS 缓存(仅 Event 函数支持) */
|
|
187
|
+
dnsCache?: boolean | 'TRUE' | 'FALSE';
|
|
159
188
|
}
|
|
160
189
|
/** 本地代码来源,三者互斥 */
|
|
161
190
|
export interface ILocalCodeSource {
|
|
@@ -233,11 +262,11 @@ export interface IImageBuildTarget {
|
|
|
233
262
|
namespace?: string;
|
|
234
263
|
/**
|
|
235
264
|
* 目标镜像仓库路径。
|
|
236
|
-
* cloud
|
|
237
|
-
* registry/namespace/repository
|
|
265
|
+
* personal cloud 可省略并默认使用函数名;enterprise cloud 在自动实例发现完成前需提供完整地址;
|
|
266
|
+
* local 策略当前需提供可直接 push 的完整 registry/namespace/repository 地址。
|
|
238
267
|
*/
|
|
239
268
|
repository?: string;
|
|
240
|
-
/**
|
|
269
|
+
/** local 策略的目标镜像 tag;cloud 策略由平台生成,不接受自定义 tag */
|
|
241
270
|
tag?: string;
|
|
242
271
|
/** 目标平台,默认 linux/amd64 */
|
|
243
272
|
platform?: string;
|
|
@@ -253,9 +282,9 @@ export interface IHttpImageRuntimeCommon extends IHttpFunctionDeployCommon {
|
|
|
253
282
|
runtime?: typeof CUSTOM_IMAGE_RUNTIME;
|
|
254
283
|
/** 容器监听端口,仅允许 9000 */
|
|
255
284
|
imagePort?: number;
|
|
256
|
-
/**
|
|
285
|
+
/** 镜像类型;省略时有 registryId 推断为 enterprise,否则推断为 personal */
|
|
257
286
|
imageType?: 'enterprise' | 'personal';
|
|
258
|
-
/** 企业版 TCR 实例 ID
|
|
287
|
+
/** 企业版 TCR 实例 ID 的运行时规范位置;个人版镜像不传 */
|
|
259
288
|
registryId?: string;
|
|
260
289
|
entryPoint?: string;
|
|
261
290
|
command?: string;
|
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, CreateHttpServiceRouteParams, CreateHttpServiceRouteRes, ModifyHttpServiceRouteParams, ModifyHttpServiceRouteRes, DeleteHttpServiceRouteParams, DeleteHttpServiceRouteRes, BindCustomDomainParams, BindCustomDomainRes, DeleteCustomDomainParams, DeleteCustomDomainRes } from './type';
|
|
3
|
+
import { CalculatePackageCreatePriceParams, CalculatePackageRenewPriceParams, CalculatePackageModifyPriceParams, DescribeHttpServiceRouteParams, DescribeHttpServiceRouteRes, VerifyHttpServiceRouteParams, VerifyHttpServiceRouteRes, CreateHttpServiceRouteParams, CreateHttpServiceRouteRes, ModifyHttpServiceRouteParams, ModifyHttpServiceRouteRes, DeleteHttpServiceRouteParams, DeleteHttpServiceRouteRes, BindCustomDomainParams, BindCustomDomainRes, DeleteCustomDomainParams, DeleteCustomDomainRes, DescribeCertificatesParams, DescribeCertificatesRes } 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 {
|
|
@@ -559,6 +559,7 @@ export declare class EnvService {
|
|
|
559
559
|
private envType?;
|
|
560
560
|
private commonService;
|
|
561
561
|
private billingService;
|
|
562
|
+
private certificateCloudService;
|
|
562
563
|
private tokenCache;
|
|
563
564
|
constructor(environment: Environment);
|
|
564
565
|
/**
|
|
@@ -882,12 +883,27 @@ export declare class EnvService {
|
|
|
882
883
|
Usages: EnvPkgCreditsUsage[];
|
|
883
884
|
RequestId: string;
|
|
884
885
|
}>;
|
|
886
|
+
/**
|
|
887
|
+
* 获取当前凭证有权限访问的 SSL 证书列表。
|
|
888
|
+
*
|
|
889
|
+
* 证书用于自定义域名 HTTPS 配置,本接口不依赖 CloudBase 环境信息。
|
|
890
|
+
* @param {DescribeCertificatesParams} params 查询参数
|
|
891
|
+
* @returns {Promise<DescribeCertificatesRes>}
|
|
892
|
+
*/
|
|
893
|
+
describeCertificates(params?: DescribeCertificatesParams): Promise<DescribeCertificatesRes>;
|
|
885
894
|
/**
|
|
886
895
|
* 查询HTTP访问服务域名路由信息
|
|
887
896
|
* @param {DescribeHttpServiceRouteParams} params 查询参数
|
|
888
897
|
* @returns {Promise<DescribeHttpServiceRouteRes>}
|
|
889
898
|
*/
|
|
890
899
|
describeHttpServiceRoute(params: DescribeHttpServiceRouteParams): Promise<DescribeHttpServiceRouteRes>;
|
|
900
|
+
/**
|
|
901
|
+
* 校验HTTP访问服务域名路由
|
|
902
|
+
* 此操作为只读预检,不会创建任何资源。
|
|
903
|
+
* @param {VerifyHttpServiceRouteParams} params 校验参数
|
|
904
|
+
* @returns {Promise<VerifyHttpServiceRouteRes>}
|
|
905
|
+
*/
|
|
906
|
+
verifyHttpServiceRoute(params: VerifyHttpServiceRouteParams): Promise<VerifyHttpServiceRouteRes>;
|
|
891
907
|
/**
|
|
892
908
|
* 创建HTTP访问服务域名路由
|
|
893
909
|
* @param {CreateHttpServiceRouteParams} params 创建参数
|