@cloudbase/manager-node 4.11.0-alpha.4 → 4.11.0-alpha.5
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/function/index.js +13 -8
- package/package.json +1 -1
- package/types/function/index.d.ts +4 -4
package/lib/function/index.js
CHANGED
|
@@ -488,22 +488,25 @@ class FunctionService {
|
|
|
488
488
|
* @param {string} qualifier 需要删除的版本号,不填默认删除函数下全部版本。
|
|
489
489
|
* @returns {Promise<IResponseInfo>}
|
|
490
490
|
*/
|
|
491
|
-
async deleteFunction(
|
|
491
|
+
async deleteFunction(name) {
|
|
492
492
|
var _a;
|
|
493
|
+
const funcName = typeof name === 'string'
|
|
494
|
+
? name
|
|
495
|
+
: name === null || name === void 0 ? void 0 : name.name;
|
|
493
496
|
const { namespace } = this.getFunctionConfig();
|
|
494
497
|
// 检测是否绑定了 API 网关
|
|
495
498
|
const accessService = this.environment.getAccessService();
|
|
496
499
|
const res = await accessService.getAccessList({
|
|
497
|
-
name
|
|
500
|
+
name: funcName
|
|
498
501
|
});
|
|
499
502
|
// 删除绑定的 API 网关
|
|
500
503
|
if (((_a = res === null || res === void 0 ? void 0 : res.APISet) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
501
504
|
await accessService.deleteAccess({
|
|
502
|
-
name
|
|
505
|
+
name: funcName
|
|
503
506
|
});
|
|
504
507
|
}
|
|
505
|
-
await this.scfService.request('DeleteFunction', {
|
|
506
|
-
FunctionName:
|
|
508
|
+
return await this.scfService.request('DeleteFunction', {
|
|
509
|
+
FunctionName: funcName,
|
|
507
510
|
Namespace: namespace
|
|
508
511
|
});
|
|
509
512
|
}
|
|
@@ -741,10 +744,13 @@ class FunctionService {
|
|
|
741
744
|
// 注意:dnsCache 需要 'TRUE'/'FALSE' 字符串,在特殊处理阶段处理
|
|
742
745
|
'intranetconfig': 'IntranetConfig',
|
|
743
746
|
};
|
|
747
|
+
const { TopicId, LogsetId } = this.getClsServiceConfig();
|
|
744
748
|
// 构建参数
|
|
745
749
|
const params = {
|
|
746
750
|
Namespace: namespace,
|
|
747
|
-
FunctionName: func.name
|
|
751
|
+
FunctionName: func.name,
|
|
752
|
+
ClsTopicId: TopicId,
|
|
753
|
+
ClsLogsetId: LogsetId
|
|
748
754
|
};
|
|
749
755
|
// 白名单字段自动转换(大小写不敏感,统一输出 PascalCase)
|
|
750
756
|
for (const key of Object.keys(func)) {
|
|
@@ -1047,13 +1053,12 @@ class FunctionService {
|
|
|
1047
1053
|
async deleteFunctionTrigger(name, triggerName) {
|
|
1048
1054
|
const { namespace } = this.getFunctionConfig();
|
|
1049
1055
|
try {
|
|
1050
|
-
await this.scfService.request('DeleteTrigger', {
|
|
1056
|
+
return await this.scfService.request('DeleteTrigger', {
|
|
1051
1057
|
FunctionName: name,
|
|
1052
1058
|
Namespace: namespace,
|
|
1053
1059
|
TriggerName: triggerName,
|
|
1054
1060
|
Type: 'timer'
|
|
1055
1061
|
});
|
|
1056
|
-
(0, utils_1.successLog)(`[${name}] 删除云函数触发器 ${triggerName} 成功!`);
|
|
1057
1062
|
}
|
|
1058
1063
|
catch (e) {
|
|
1059
1064
|
throw new error_1.CloudBaseError(`[${name}] 删除触发器失败:${e.message}`);
|
package/package.json
CHANGED
|
@@ -277,9 +277,9 @@ export declare class FunctionService {
|
|
|
277
277
|
* @param {string} qualifier 需要删除的版本号,不填默认删除函数下全部版本。
|
|
278
278
|
* @returns {Promise<IResponseInfo>}
|
|
279
279
|
*/
|
|
280
|
-
deleteFunction(
|
|
281
|
-
name:
|
|
282
|
-
}): Promise<
|
|
280
|
+
deleteFunction(name: string | {
|
|
281
|
+
name: string;
|
|
282
|
+
}): Promise<IResponseInfo>;
|
|
283
283
|
/**
|
|
284
284
|
* 批量删除云函数
|
|
285
285
|
* @param {Object} options
|
|
@@ -404,7 +404,7 @@ export declare class FunctionService {
|
|
|
404
404
|
* @param {string} triggerName 云函数触发器名称
|
|
405
405
|
* @returns {Promise<IResponseInfo>}
|
|
406
406
|
*/
|
|
407
|
-
deleteFunctionTrigger(name: string, triggerName: string): Promise<
|
|
407
|
+
deleteFunctionTrigger(name: string, triggerName: string): Promise<IResponseInfo>;
|
|
408
408
|
batchDeleteTriggers(options: IFunctionBatchOptions): Promise<void>;
|
|
409
409
|
/**
|
|
410
410
|
* 下载云函数代码
|