@cloudbase/manager-node 4.10.5 → 4.10.6
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
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
|
}
|
|
@@ -1050,13 +1053,12 @@ class FunctionService {
|
|
|
1050
1053
|
async deleteFunctionTrigger(name, triggerName) {
|
|
1051
1054
|
const { namespace } = this.getFunctionConfig();
|
|
1052
1055
|
try {
|
|
1053
|
-
await this.scfService.request('DeleteTrigger', {
|
|
1056
|
+
return await this.scfService.request('DeleteTrigger', {
|
|
1054
1057
|
FunctionName: name,
|
|
1055
1058
|
Namespace: namespace,
|
|
1056
1059
|
TriggerName: triggerName,
|
|
1057
1060
|
Type: 'timer'
|
|
1058
1061
|
});
|
|
1059
|
-
(0, utils_1.successLog)(`[${name}] 删除云函数触发器 ${triggerName} 成功!`);
|
|
1060
1062
|
}
|
|
1061
1063
|
catch (e) {
|
|
1062
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
|
* 下载云函数代码
|