@cloudbase/manager-node 5.8.9-beta.0 → 5.9.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/.codebuddy/rules/error-code-contract.mdc +13 -0
- package/CHANGELOG.md +1 -0
- package/lib/agent/index.js +6 -5
- package/lib/aiModel/index.js +21 -9
- package/lib/cloudApp/index.js +4 -4
- package/lib/cloudrun/index.js +16 -15
- package/lib/common/index.js +1 -1
- package/lib/database/index.js +23 -23
- package/lib/deploy/DatabaseDeployer.js +19 -24
- package/lib/deploy/DeployOrchestrator.js +2 -2
- package/lib/deploy/FunctionDeployer.js +19 -1
- package/lib/deploy/GatewayDeployer.js +5 -5
- package/lib/deploy/StaticDeployer.js +2 -2
- package/lib/deploy/framework.js +2 -1
- package/lib/deploy/function/config-guard.js +23 -3
- package/lib/deploy/function/enterprise-tcr.js +18 -2
- package/lib/docs/index.js +4 -3
- package/lib/env/index.js +16 -16
- package/lib/environment.js +4 -4
- package/lib/environmentManager.js +5 -1
- package/lib/error-docs.js +385 -0
- package/lib/error-types.js +21 -0
- package/lib/error.js +239 -2
- package/lib/function/index.js +135 -41
- package/lib/function/packer.js +1 -1
- package/lib/hosting/index.js +1 -1
- package/lib/index.js +2 -1
- package/lib/integration/crypto.js +4 -3
- package/lib/integration/index.js +1 -1
- package/lib/integration/secretKey.js +4 -4
- package/lib/monitor/index.js +1 -1
- package/lib/mysql/index.js +2 -1
- package/lib/permission/index.js +56 -49
- package/lib/platform/index.js +2 -2
- package/lib/sandbox/index.js +68 -61
- package/lib/storage/index.js +164 -162
- package/lib/user/index.js +32 -31
- package/lib/utils/cloud-api-request.js +13 -5
- package/lib/utils/cloudbase-request.js +21 -0
- package/lib/utils/fs.js +3 -3
- package/lib/utils/http-request.js +2 -2
- package/lib/utils/index.js +4 -3
- package/lib/utils/storage-config.js +3 -3
- package/package.json +2 -2
- package/types/error-docs.d.ts +57 -0
- package/types/error-types.d.ts +32 -0
- package/types/error.d.ts +148 -2
- package/types/function/index.d.ts +14 -1
- package/types/utils/cloudbase-request.d.ts +22 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Environment } from '../environment';
|
|
2
|
-
import { IResponseInfo, ICloudFunction, ICloudFunctionV2, IFunctionLogOptions, ICloudFunctionTrigger, IFunctionInvokeRes, IFunctionLogRes, IFunctionDownloadUrlRes, IFunctionLogDetailOptions, IFunctionLogDetailRes, IFunctionLogOptionsV2, IFunctionLogResV2 } from '../interfaces';
|
|
2
|
+
import { IResponseInfo, ICloudFunction, ICloudFunctionV2, IFunctionLogOptions, ICloudFunctionTrigger, IFunctionInvokeRes, IFunctionLogRes, IFunctionDownloadUrlRes, IFunctionLogDetailOptions, IFunctionLogDetailRes, IFunctionLogOptionsV2, IFunctionLogResV2, IFunctionImageConfig } from '../interfaces';
|
|
3
3
|
import { IFunctionInfo, IFunctionCode as IScfFunctionCode } from './types';
|
|
4
4
|
export interface IFunctionCode {
|
|
5
5
|
func: ICloudFunction;
|
|
@@ -228,6 +228,13 @@ export interface ILayer {
|
|
|
228
228
|
}
|
|
229
229
|
/** 企业版 TCR 镜像对 SCF 不可见时的排查指引 */
|
|
230
230
|
export declare const ENTERPRISE_IMAGE_REGION_GUIDANCE = "\u8BF7\u786E\u8BA4 TCR \u4F01\u4E1A\u7248\u5B9E\u4F8B\u5DF2\u5728\u5F53\u524D\u51FD\u6570\u5730\u57DF\u63D0\u4F9B\u53EF\u8BBF\u95EE\u7684\u5B9E\u4F8B\u6216\u590D\u5236\u5B9E\u4F8B\uFF0C\u5E76\u68C0\u67E5 RegistryId\u3001\u955C\u50CF\u5730\u5740\u53CA\u62C9\u53D6\u6743\u9650\u3002";
|
|
231
|
+
/**
|
|
232
|
+
* 为企业版镜像的典型不可见错误补充排查指引,同时保留原始错误和 requestId。
|
|
233
|
+
* 仅匹配 SCF 已进入 enterprise 镜像查询阶段的错误,避免给普通网络或鉴权错误误导提示。
|
|
234
|
+
*
|
|
235
|
+
* 纯函数:只读入参,**不修改**传进来的错误对象;幂等由 WeakMap 缓存保证。
|
|
236
|
+
*/
|
|
237
|
+
export declare function formatImageDeploymentErrorMessage(error: unknown, imageConfig?: IFunctionImageConfig): string;
|
|
231
238
|
export declare class FunctionService {
|
|
232
239
|
private environment;
|
|
233
240
|
private vpcService;
|
|
@@ -537,6 +544,12 @@ export declare class FunctionService {
|
|
|
537
544
|
}>;
|
|
538
545
|
private createAccessPath;
|
|
539
546
|
private getTempCosInfo;
|
|
547
|
+
/**
|
|
548
|
+
* 创建触发器(带重试)。
|
|
549
|
+
*
|
|
550
|
+
* ⚠️ AIP-194:**只重试可重试错误**。旧实现是 catch-all 盲重试 —— 权限不足 / 参数非法这类
|
|
551
|
+
* **必然失败**的错误也会被重试 3 次,既浪费时间,又把确定性失败伪装成偶发失败、掩盖真实原因。
|
|
552
|
+
*/
|
|
540
553
|
private retryCreateTrigger;
|
|
541
554
|
/**
|
|
542
555
|
* 获取函数配置信息
|
|
@@ -12,3 +12,25 @@ export declare function cloudBaseRequest(options: {
|
|
|
12
12
|
method?: string;
|
|
13
13
|
headers?: Record<string, any>;
|
|
14
14
|
}): Promise<any>;
|
|
15
|
+
/**
|
|
16
|
+
* 数据面(/admin)错误响应结构。
|
|
17
|
+
*
|
|
18
|
+
* 来源:`tcblinker/internal/tcberror` 的 `TcbError.ToJSON()`,形如
|
|
19
|
+
* `{ code, message, requestId }`。无 docs 字段——文档链接由 CLI 侧
|
|
20
|
+
* `resolveErrorDoc` 按 code + source 生成(见错误码治理方案 §4.6)。
|
|
21
|
+
*/
|
|
22
|
+
export interface IDataPlaneErrorResponse {
|
|
23
|
+
/** 数据面稳定错误码,见 tcblinker/internal/tcberror(如 INVALID_PARAM / STORAGE_FILE_NONEXIST) */
|
|
24
|
+
code?: string;
|
|
25
|
+
message?: string;
|
|
26
|
+
requestId?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 校验数据面(/admin)响应,命中错误时抛出带 code 的 CloudBaseError。
|
|
30
|
+
*
|
|
31
|
+
* 必须把 `res.code` 落到 `CloudBaseError.code` 并标记 `source: 'runtime'`:
|
|
32
|
+
* 否则 CLI 侧 `resolveErrorDoc` 拿不到 code → 文档链接哑火,
|
|
33
|
+
* `resolveExitCode` 也会兜底成 1,灯塔上报退化为 `ERROR`。
|
|
34
|
+
* 这是「错误码治理方案」D11 的修复点。
|
|
35
|
+
*/
|
|
36
|
+
export declare function assertDataPlaneOk(res: IDataPlaneErrorResponse | null | undefined, action: string): void;
|