edgeone-cli 1.0.2 → 1.0.3
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/dist/api/client.d.ts +53 -53
- package/dist/api/signer.d.ts +46 -46
- package/dist/commands/config.d.ts +18 -18
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/edgeone.d.ts +13 -13
- package/dist/errors/codes.d.ts +66 -66
- package/dist/index.d.ts +2 -2
- package/dist/utils/crypto.d.ts +12 -12
- package/package.json +1 -1
package/dist/api/client.d.ts
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EdgeOne API 客户端
|
|
3
|
-
*/
|
|
4
|
-
import type { ConfigMode } from "../commands/config.js";
|
|
5
|
-
interface CreatePurgeTaskOptions {
|
|
6
|
-
zoneId?: string;
|
|
7
|
-
type: "purge_url" | "purge_prefix" | "purge_all";
|
|
8
|
-
targets?: string[];
|
|
9
|
-
url?: string;
|
|
10
|
-
}
|
|
11
|
-
interface CreatePrefetchTaskOptions {
|
|
12
|
-
zoneId?: string;
|
|
13
|
-
urls: string[];
|
|
14
|
-
}
|
|
15
|
-
interface CreatePurgeTaskResponse {
|
|
16
|
-
Response: {
|
|
17
|
-
RequestId: string;
|
|
18
|
-
JobId?: string;
|
|
19
|
-
Error?: {
|
|
20
|
-
Code: string;
|
|
21
|
-
Message: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export declare class EdgeOneClient {
|
|
26
|
-
private secretId;
|
|
27
|
-
private secretKey;
|
|
28
|
-
private endpoint;
|
|
29
|
-
private region;
|
|
30
|
-
private mode;
|
|
31
|
-
constructor(secretId: string, secretKey: string, endpoint: string, region?: string, mode?: ConfigMode);
|
|
32
|
-
/**
|
|
33
|
-
* 发送请求
|
|
34
|
-
*/
|
|
35
|
-
private request;
|
|
36
|
-
/**
|
|
37
|
-
* 创建清除缓存任务
|
|
38
|
-
*/
|
|
39
|
-
createPurgeTask(options: CreatePurgeTaskOptions): Promise<CreatePurgeTaskResponse>;
|
|
40
|
-
/**
|
|
41
|
-
* 查询清除缓存任务
|
|
42
|
-
*/
|
|
43
|
-
describePurgeTasks(zoneIds?: string[]): Promise<any>;
|
|
44
|
-
/**
|
|
45
|
-
* 创建预热任务
|
|
46
|
-
*/
|
|
47
|
-
createPrefetchTask(options: CreatePrefetchTaskOptions): Promise<CreatePurgeTaskResponse>;
|
|
48
|
-
/**
|
|
49
|
-
* 查询预热任务
|
|
50
|
-
*/
|
|
51
|
-
describePrefetchTasks(zoneIds?: string[]): Promise<any>;
|
|
52
|
-
}
|
|
53
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* EdgeOne API 客户端
|
|
3
|
+
*/
|
|
4
|
+
import type { ConfigMode } from "../commands/config.js";
|
|
5
|
+
interface CreatePurgeTaskOptions {
|
|
6
|
+
zoneId?: string;
|
|
7
|
+
type: "purge_url" | "purge_prefix" | "purge_all";
|
|
8
|
+
targets?: string[];
|
|
9
|
+
url?: string;
|
|
10
|
+
}
|
|
11
|
+
interface CreatePrefetchTaskOptions {
|
|
12
|
+
zoneId?: string;
|
|
13
|
+
urls: string[];
|
|
14
|
+
}
|
|
15
|
+
interface CreatePurgeTaskResponse {
|
|
16
|
+
Response: {
|
|
17
|
+
RequestId: string;
|
|
18
|
+
JobId?: string;
|
|
19
|
+
Error?: {
|
|
20
|
+
Code: string;
|
|
21
|
+
Message: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare class EdgeOneClient {
|
|
26
|
+
private secretId;
|
|
27
|
+
private secretKey;
|
|
28
|
+
private endpoint;
|
|
29
|
+
private region;
|
|
30
|
+
private mode;
|
|
31
|
+
constructor(secretId: string, secretKey: string, endpoint: string, region?: string, mode?: ConfigMode);
|
|
32
|
+
/**
|
|
33
|
+
* 发送请求
|
|
34
|
+
*/
|
|
35
|
+
private request;
|
|
36
|
+
/**
|
|
37
|
+
* 创建清除缓存任务
|
|
38
|
+
*/
|
|
39
|
+
createPurgeTask(options: CreatePurgeTaskOptions): Promise<CreatePurgeTaskResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* 查询清除缓存任务
|
|
42
|
+
*/
|
|
43
|
+
describePurgeTasks(zoneIds?: string[]): Promise<any>;
|
|
44
|
+
/**
|
|
45
|
+
* 创建预热任务
|
|
46
|
+
*/
|
|
47
|
+
createPrefetchTask(options: CreatePrefetchTaskOptions): Promise<CreatePurgeTaskResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* 查询预热任务
|
|
50
|
+
*/
|
|
51
|
+
describePrefetchTasks(zoneIds?: string[]): Promise<any>;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
54
54
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/api/signer.d.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
interface SignOptions {
|
|
2
|
-
method: string;
|
|
3
|
-
host: string;
|
|
4
|
-
path: string;
|
|
5
|
-
queryParams?: Record<string, any>;
|
|
6
|
-
bodyParams?: Record<string, any>;
|
|
7
|
-
headers?: Record<string, string>;
|
|
8
|
-
secretId: string;
|
|
9
|
-
secretKey: string;
|
|
10
|
-
service: string;
|
|
11
|
-
region?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class Signer {
|
|
14
|
-
/**
|
|
15
|
-
* 计算 HMAC-SHA256
|
|
16
|
-
*/
|
|
17
|
-
private static hmacSha256;
|
|
18
|
-
/**
|
|
19
|
-
* 计算 SHA256
|
|
20
|
-
*/
|
|
21
|
-
private static sha256;
|
|
22
|
-
/**
|
|
23
|
-
* 计算 SHA256 hex
|
|
24
|
-
*/
|
|
25
|
-
private static sha256Hex;
|
|
26
|
-
/**
|
|
27
|
-
* 获取日期
|
|
28
|
-
*/
|
|
29
|
-
private static getDate;
|
|
30
|
-
/**
|
|
31
|
-
* 构建 Query String
|
|
32
|
-
*/
|
|
33
|
-
private static buildQueryString;
|
|
34
|
-
/**
|
|
35
|
-
* URI 编码(RFC3986)
|
|
36
|
-
*/
|
|
37
|
-
private static _encodeURIComponent;
|
|
38
|
-
/**
|
|
39
|
-
* 签名
|
|
40
|
-
*/
|
|
41
|
-
static sign(options: SignOptions): {
|
|
42
|
-
headers: Record<string, string>;
|
|
43
|
-
body: string;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export {};
|
|
1
|
+
interface SignOptions {
|
|
2
|
+
method: string;
|
|
3
|
+
host: string;
|
|
4
|
+
path: string;
|
|
5
|
+
queryParams?: Record<string, any>;
|
|
6
|
+
bodyParams?: Record<string, any>;
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
secretId: string;
|
|
9
|
+
secretKey: string;
|
|
10
|
+
service: string;
|
|
11
|
+
region?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class Signer {
|
|
14
|
+
/**
|
|
15
|
+
* 计算 HMAC-SHA256
|
|
16
|
+
*/
|
|
17
|
+
private static hmacSha256;
|
|
18
|
+
/**
|
|
19
|
+
* 计算 SHA256
|
|
20
|
+
*/
|
|
21
|
+
private static sha256;
|
|
22
|
+
/**
|
|
23
|
+
* 计算 SHA256 hex
|
|
24
|
+
*/
|
|
25
|
+
private static sha256Hex;
|
|
26
|
+
/**
|
|
27
|
+
* 获取日期
|
|
28
|
+
*/
|
|
29
|
+
private static getDate;
|
|
30
|
+
/**
|
|
31
|
+
* 构建 Query String
|
|
32
|
+
*/
|
|
33
|
+
private static buildQueryString;
|
|
34
|
+
/**
|
|
35
|
+
* URI 编码(RFC3986)
|
|
36
|
+
*/
|
|
37
|
+
private static _encodeURIComponent;
|
|
38
|
+
/**
|
|
39
|
+
* 签名
|
|
40
|
+
*/
|
|
41
|
+
static sign(options: SignOptions): {
|
|
42
|
+
headers: Record<string, string>;
|
|
43
|
+
body: string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
47
47
|
//# sourceMappingURL=signer.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
type ConfigMode = 'debug' | 'production';
|
|
3
|
-
interface Config {
|
|
4
|
-
secretId: string;
|
|
5
|
-
secretKey: string;
|
|
6
|
-
endpoint: string;
|
|
7
|
-
mode: ConfigMode;
|
|
8
|
-
domainIdList: string[];
|
|
9
|
-
}
|
|
10
|
-
declare const CONFIG_FILE: string;
|
|
11
|
-
/**
|
|
12
|
-
* 读取配置(自动解密,自动迁移旧格式)
|
|
13
|
-
*/
|
|
14
|
-
declare function readConfig(): Config | null;
|
|
15
|
-
declare const configCmd: Command;
|
|
16
|
-
export default configCmd;
|
|
17
|
-
export { readConfig, CONFIG_FILE };
|
|
18
|
-
export type { ConfigMode };
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
type ConfigMode = 'debug' | 'production';
|
|
3
|
+
interface Config {
|
|
4
|
+
secretId: string;
|
|
5
|
+
secretKey: string;
|
|
6
|
+
endpoint: string;
|
|
7
|
+
mode: ConfigMode;
|
|
8
|
+
domainIdList: string[];
|
|
9
|
+
}
|
|
10
|
+
declare const CONFIG_FILE: string;
|
|
11
|
+
/**
|
|
12
|
+
* 读取配置(自动解密,自动迁移旧格式)
|
|
13
|
+
*/
|
|
14
|
+
declare function readConfig(): Config | null;
|
|
15
|
+
declare const configCmd: Command;
|
|
16
|
+
export default configCmd;
|
|
17
|
+
export { readConfig, CONFIG_FILE };
|
|
18
|
+
export type { ConfigMode };
|
|
19
19
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,KAAK,UAAU,GAAG,OAAO,GAAG,YAAY,CAAC;AAWzC,UAAU,MAAM;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAGD,QAAA,MAAM,WAAW,QAAuC,CAAC;AAWzD;;GAEG;AACH,iBAAS,UAAU,IAAI,MAAM,GAAG,IAAI,CAoCnC;AA0DD,QAAA,MAAM,SAAS,SACgB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,KAAK,UAAU,GAAG,OAAO,GAAG,YAAY,CAAC;AAWzC,UAAU,MAAM;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAGD,QAAA,MAAM,WAAW,QAAuC,CAAC;AAWzD;;GAEG;AACH,iBAAS,UAAU,IAAI,MAAM,GAAG,IAAI,CAoCnC;AA0DD,QAAA,MAAM,SAAS,SACgB,CAAC;AAoMhC,eAAe,SAAS,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;AACnC,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/commands/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Command as e}from"commander";import o from"chalk";import n from"inquirer";import t from"fs";import i from"path";import c from"os";import{encrypt as s,decrypt as
|
|
1
|
+
import{Command as e}from"commander";import o from"chalk";import n from"inquirer";import t from"fs";import i from"path";import c from"os";import{encrypt as s,decrypt as l,isEncrypted as r}from"../utils/crypto.js";const d=i.join(c.homedir(),".edgeone-cli"),a=i.join(d,"config.json");function m(){if(t.existsSync(a)){const e=t.readFileSync(a,"utf-8"),n=JSON.parse(e);let i=n.secretKey,c=!n.encrypted;if(n.encrypted||r(n.secretKey))try{i=l(n.secretKey),c=!1}catch{c=!1}const s={secretId:n.secretId,secretKey:i,endpoint:n.endpoint,mode:n.mode||"production",domainIdList:n.domainIdList||[]};return c&&(p(s),console.log(o.gray("💡 配置已自动升级为加密格式"))),s}return null}function p(e){t.existsSync(d)||t.mkdirSync(d,{recursive:!0});const o=s(e.secretKey),n={secretId:e.secretId,secretKey:o,endpoint:e.endpoint,mode:e.mode,domainIdList:e.domainIdList,encrypted:!0};t.writeFileSync(a,JSON.stringify(n,null,2),"utf-8")}function g(e,o=4){return e?e.length<=2*o?e:e.slice(0,o)+"****"+e.slice(-o):"N/A"}const y=new e("config").description("管理 EdgeOne 配置");y.command("init").description("初始化配置").action(async()=>{const e=m();if(e){console.log(o.yellow("\n⚠ 检测到已存在的配置:\n")),console.log(o.gray("─".repeat(40))),console.log(` SecretId: ${o.green(g(e.secretId))}`),console.log(` SecretKey: ${o.green(g(e.secretKey))}`),console.log(` 接口请求域名: ${o.yellow(e.endpoint||"teo.tencentcloudapi.com")}`),console.log(` 运行模式: ${"debug"===e.mode?o.yellow("调试模式"):o.green("生产模式")}`),console.log(o.gray("─".repeat(40)));const{confirm:t}=await n.prompt([{type:"confirm",name:"confirm",message:"已有配置将被覆盖,是否继续?",default:!1}]);if(!t)return void console.log(o.gray("已取消"))}console.log(o.cyan("\n🔧 开始初始化 EdgeOne 配置\n"));const t=await n.prompt([{type:"input",name:"secretId",message:"请输入 SecretId:",validate:e=>""!==e.trim()||"SecretId 不能为空"},{type:"password",name:"secretKey",message:"请输入 SecretKey:",mask:"*",validate:e=>""!==e.trim()||"SecretKey 不能为空"},{type:"input",name:"endpoint",message:"请输入接口请求域名:",default:"teo.tencentcloudapi.com"},{type:"list",name:"mode",message:"请选择运行模式:",choices:[{name:"生产模式 (不显示调试信息)",value:"production"},{name:"调试模式 (显示详细请求信息)",value:"debug"}],default:"production"},{type:"input",name:"domainIdList",message:"请输入域名ID列表(多个用逗号分隔,留空跳过):",default:""}]);let i=[];const c=t.domainIdList;c&&c.trim()&&(i=c.split(",").map(e=>e.trim()).filter(e=>""!==e)),p({secretId:t.secretId,secretKey:t.secretKey,endpoint:t.endpoint||"teo.tencentcloudapi.com",mode:t.mode||"production",domainIdList:i}),console.log(o.green("\n✅ 配置已加密保存到: "+a))}),y.command("show").description("显示当前配置").action(function(){const e=m();if(!e)return void console.log(o.yellow('⚠ 未找到配置文件,请先运行 "edgeone-cli config init"'));const n="debug"===e.mode?"调试模式":"生产模式",t="debug"===e.mode?o.yellow:o.green;console.log(o.cyan("\n📋 当前配置:\n")),console.log(o.gray("─".repeat(40))),console.log(` SecretId: ${o.green(g(e.secretId))}`),console.log(` SecretKey: ${o.green(g(e.secretKey))}`),console.log(` 接口请求域名: ${o.yellow(e.endpoint||"teo.tencentcloudapi.com")}`),console.log(` 运行模式: ${t(n)}`),e.domainIdList&&e.domainIdList.length>0&&console.log(` 域名ID列表: ${o.yellow(e.domainIdList.join(", "))}`),console.log(o.gray("─".repeat(40)))}),y.command("remove").description("删除配置文件").action(async()=>{if(!t.existsSync(a))return void console.log(o.yellow("⚠ 配置文件不存在"));const{confirm:e}=await n.prompt([{type:"confirm",name:"confirm",message:"确定要删除配置文件吗?",default:!1}]);e?(t.unlinkSync(a),console.log(o.green("✅ 配置文件已删除"))):console.log(o.gray("已取消"))}),y.command("edit").description("编辑配置项").action(async()=>{const e=m();if(!e)return void console.log(o.yellow('⚠ 未找到配置文件,请先运行 "edgeone-cli config init"'));const t=await n.prompt([{type:"list",name:"field",message:"选择要修改的配置项:",choices:[{name:"SecretId",value:"secretId"},{name:"SecretKey",value:"secretKey"},{name:"接口请求域名",value:"endpoint"},{name:"运行模式",value:"mode"},{name:"域名ID列表",value:"domainIdList"}]},{type:"input",name:"value",message:e=>`请输入新的 ${e.field}:`,when:e=>"secretKey"!==e.field&&"mode"!==e.field&&"domainIdList"!==e.field,validate:e=>""!==e.trim()||"不能为空"},{type:"password",name:"value",message:"请输入新的 SecretKey:",mask:"*",when:e=>"secretKey"===e.field,validate:e=>""!==e.trim()||"不能为空"},{type:"list",name:"value",message:"请选择运行模式:",when:e=>"mode"===e.field,choices:[{name:"生产模式 (不显示调试信息)",value:"production"},{name:"调试模式 (显示详细请求信息)",value:"debug"}]},{type:"input",name:"value",message:"请输入域名ID列表(多个用逗号分隔):",when:e=>"domainIdList"===e.field,default:""}]);if("domainIdList"===t.field){const o=t.value,n=o&&o.trim()?o.split(",").map(e=>e.trim()).filter(e=>""!==e):[];e[t.field]=n}else e[t.field]=t.value;p(e),console.log(o.green("✅ 配置已更新"))});export default y;export{m as readConfig,a as CONFIG_FILE};
|
|
2
2
|
//# sourceMappingURL=commands\config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A:\\edgeone-cli\\dist\\commands\\config.js","names":["Command","chalk","inquirer","fs","path","os","encrypt","decrypt","isEncrypted","CONFIG_DIR","join","homedir","CONFIG_FILE","readConfig","existsSync","content","readFileSync","stored","JSON","parse","secretKey","needsMigration","encrypted","config","secretId","endpoint","mode","domainIdList","writeConfig","console","log","gray","mkdirSync","recursive","encryptedSecretKey","writeFileSync","stringify","maskString","str","showLength","length","slice","configCmd","description","command","action","async","
|
|
1
|
+
{"version":3,"file":"A:\\edgeone-cli\\dist\\commands\\config.js","names":["Command","chalk","inquirer","fs","path","os","encrypt","decrypt","isEncrypted","CONFIG_DIR","join","homedir","CONFIG_FILE","readConfig","existsSync","content","readFileSync","stored","JSON","parse","secretKey","needsMigration","encrypted","config","secretId","endpoint","mode","domainIdList","writeConfig","console","log","gray","mkdirSync","recursive","encryptedSecretKey","writeFileSync","stringify","maskString","str","showLength","length","slice","configCmd","description","command","action","async","existingConfig","yellow","repeat","green","confirm","prompt","type","name","message","default","cyan","answers","validate","input","trim","mask","choices","value","domainIds","domainIdInput","split","map","id","filter","modeText","modeColor","unlinkSync","field","when"],"sources":["../../src/commands/config.ts"],"mappings":"kBAASA,MAAe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OAC7CK,EAAcC,MAAM,KAAKC,IAAIC,GAAMA,EAAGR,QAAQS,OAAOD,GAAa,KAAPA,GAC3D,GACH9C,EAAemC,EAAQgB,OAAST,CACnC,MACG1C,EAAemC,EAAQgB,OAAShB,EAAQM,MAE3CpC,EAAYL,GACZM,QAAQC,IAAI7B,EAAMiD,MAAM,6BAGbR,SACN7B,gBAAYD","ignoreList":[]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
/**
|
|
3
|
-
* 创建清除缓存命令
|
|
4
|
-
*/
|
|
5
|
-
export declare function createPurgeCommand(): Command;
|
|
6
|
-
/**
|
|
7
|
-
* 创建预热命令
|
|
8
|
-
*/
|
|
9
|
-
export declare function createPrefetchCommand(): Command;
|
|
10
|
-
/**
|
|
11
|
-
* 创建历史记录命令
|
|
12
|
-
*/
|
|
13
|
-
export declare function createHistoryCommand(): Command;
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
/**
|
|
3
|
+
* 创建清除缓存命令
|
|
4
|
+
*/
|
|
5
|
+
export declare function createPurgeCommand(): Command;
|
|
6
|
+
/**
|
|
7
|
+
* 创建预热命令
|
|
8
|
+
*/
|
|
9
|
+
export declare function createPrefetchCommand(): Command;
|
|
10
|
+
/**
|
|
11
|
+
* 创建历史记录命令
|
|
12
|
+
*/
|
|
13
|
+
export declare function createHistoryCommand(): Command;
|
|
14
14
|
//# sourceMappingURL=edgeone.d.ts.map
|
package/dist/errors/codes.d.ts
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 错误码模块
|
|
3
|
-
* 提供错误码和描述互相转换的功能
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* EdgeOne 错误码枚举
|
|
7
|
-
*/
|
|
8
|
-
export declare enum ErrorCode {
|
|
9
|
-
InternalError_BackendError = "InternalError.BackendError",
|
|
10
|
-
InternalError_DomainConfig = "InternalError.DomainConfig",
|
|
11
|
-
InternalError_ProxyServer = "InternalError.ProxyServer",
|
|
12
|
-
InternalError_QuotaSystem = "InternalError.QuotaSystem",
|
|
13
|
-
InvalidParameter_DomainNotFound = "InvalidParameter.DomainNotFound",
|
|
14
|
-
InvalidParameter_ParameterError = "InvalidParameter.ParameterError",
|
|
15
|
-
InvalidParameter_Target = "InvalidParameter.Target",
|
|
16
|
-
InvalidParameter_TaskNotGenerated = "InvalidParameter.TaskNotGenerated",
|
|
17
|
-
InvalidParameter_UploadUrl = "InvalidParameter.UploadUrl",
|
|
18
|
-
LimitExceeded_BatchQuota = "LimitExceeded.BatchQuota",
|
|
19
|
-
LimitExceeded_DailyQuota = "LimitExceeded.DailyQuota",
|
|
20
|
-
LimitExceeded_PackNotAllow = "LimitExceeded.PackNotAllow",
|
|
21
|
-
UnauthorizedOperation_CamUnauthorized = "UnauthorizedOperation.CamUnauthorized",
|
|
22
|
-
UnauthorizedOperation_NoPermission = "UnauthorizedOperation.NoPermission",
|
|
23
|
-
UnauthorizedOperation_Unknown = "UnauthorizedOperation.Unknown"
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* 错误码工具类
|
|
27
|
-
*/
|
|
28
|
-
export declare class ErrorCodeUtil {
|
|
29
|
-
/**
|
|
30
|
-
* 根据错误码获取描述
|
|
31
|
-
*/
|
|
32
|
-
static getMessage(code: string | ErrorCode): string;
|
|
33
|
-
/**
|
|
34
|
-
* 根据描述获取错误码(支持模糊匹配)
|
|
35
|
-
*/
|
|
36
|
-
static getCode(message: string): ErrorCode | null;
|
|
37
|
-
/**
|
|
38
|
-
* 获取所有错误码列表
|
|
39
|
-
*/
|
|
40
|
-
static getAllCodes(): ErrorCode[];
|
|
41
|
-
/**
|
|
42
|
-
* 检查是否为有效错误码
|
|
43
|
-
*/
|
|
44
|
-
static isValidCode(code: string): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* 格式化错误信息
|
|
47
|
-
*/
|
|
48
|
-
static format(code: string | ErrorCode, customMessage?: string): string;
|
|
49
|
-
/**
|
|
50
|
-
* 获取错误码分类
|
|
51
|
-
*/
|
|
52
|
-
static getCategory(code: string | ErrorCode): string;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* 错误类
|
|
56
|
-
*/
|
|
57
|
-
export declare class EdgeOneError extends Error {
|
|
58
|
-
code: ErrorCode;
|
|
59
|
-
details?: Record<string, unknown>;
|
|
60
|
-
constructor(code: ErrorCode, message?: string, details?: Record<string, unknown>);
|
|
61
|
-
toString(): string;
|
|
62
|
-
/**
|
|
63
|
-
* 获取错误分类
|
|
64
|
-
*/
|
|
65
|
-
getCategory(): string;
|
|
66
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 错误码模块
|
|
3
|
+
* 提供错误码和描述互相转换的功能
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* EdgeOne 错误码枚举
|
|
7
|
+
*/
|
|
8
|
+
export declare enum ErrorCode {
|
|
9
|
+
InternalError_BackendError = "InternalError.BackendError",
|
|
10
|
+
InternalError_DomainConfig = "InternalError.DomainConfig",
|
|
11
|
+
InternalError_ProxyServer = "InternalError.ProxyServer",
|
|
12
|
+
InternalError_QuotaSystem = "InternalError.QuotaSystem",
|
|
13
|
+
InvalidParameter_DomainNotFound = "InvalidParameter.DomainNotFound",
|
|
14
|
+
InvalidParameter_ParameterError = "InvalidParameter.ParameterError",
|
|
15
|
+
InvalidParameter_Target = "InvalidParameter.Target",
|
|
16
|
+
InvalidParameter_TaskNotGenerated = "InvalidParameter.TaskNotGenerated",
|
|
17
|
+
InvalidParameter_UploadUrl = "InvalidParameter.UploadUrl",
|
|
18
|
+
LimitExceeded_BatchQuota = "LimitExceeded.BatchQuota",
|
|
19
|
+
LimitExceeded_DailyQuota = "LimitExceeded.DailyQuota",
|
|
20
|
+
LimitExceeded_PackNotAllow = "LimitExceeded.PackNotAllow",
|
|
21
|
+
UnauthorizedOperation_CamUnauthorized = "UnauthorizedOperation.CamUnauthorized",
|
|
22
|
+
UnauthorizedOperation_NoPermission = "UnauthorizedOperation.NoPermission",
|
|
23
|
+
UnauthorizedOperation_Unknown = "UnauthorizedOperation.Unknown"
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 错误码工具类
|
|
27
|
+
*/
|
|
28
|
+
export declare class ErrorCodeUtil {
|
|
29
|
+
/**
|
|
30
|
+
* 根据错误码获取描述
|
|
31
|
+
*/
|
|
32
|
+
static getMessage(code: string | ErrorCode): string;
|
|
33
|
+
/**
|
|
34
|
+
* 根据描述获取错误码(支持模糊匹配)
|
|
35
|
+
*/
|
|
36
|
+
static getCode(message: string): ErrorCode | null;
|
|
37
|
+
/**
|
|
38
|
+
* 获取所有错误码列表
|
|
39
|
+
*/
|
|
40
|
+
static getAllCodes(): ErrorCode[];
|
|
41
|
+
/**
|
|
42
|
+
* 检查是否为有效错误码
|
|
43
|
+
*/
|
|
44
|
+
static isValidCode(code: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 格式化错误信息
|
|
47
|
+
*/
|
|
48
|
+
static format(code: string | ErrorCode, customMessage?: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* 获取错误码分类
|
|
51
|
+
*/
|
|
52
|
+
static getCategory(code: string | ErrorCode): string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 错误类
|
|
56
|
+
*/
|
|
57
|
+
export declare class EdgeOneError extends Error {
|
|
58
|
+
code: ErrorCode;
|
|
59
|
+
details?: Record<string, unknown>;
|
|
60
|
+
constructor(code: ErrorCode, message?: string, details?: Record<string, unknown>);
|
|
61
|
+
toString(): string;
|
|
62
|
+
/**
|
|
63
|
+
* 获取错误分类
|
|
64
|
+
*/
|
|
65
|
+
getCategory(): string;
|
|
66
|
+
}
|
|
67
67
|
//# sourceMappingURL=codes.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export {};
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export {};
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/utils/crypto.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 加密文本
|
|
3
|
-
*/
|
|
4
|
-
export declare function encrypt(text: string): string;
|
|
5
|
-
/**
|
|
6
|
-
* 解密文本
|
|
7
|
-
*/
|
|
8
|
-
export declare function decrypt(encryptedText: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* 检查文本是否为加密格式
|
|
11
|
-
*/
|
|
12
|
-
export declare function isEncrypted(text: string): boolean;
|
|
1
|
+
/**
|
|
2
|
+
* 加密文本
|
|
3
|
+
*/
|
|
4
|
+
export declare function encrypt(text: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* 解密文本
|
|
7
|
+
*/
|
|
8
|
+
export declare function decrypt(encryptedText: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* 检查文本是否为加密格式
|
|
11
|
+
*/
|
|
12
|
+
export declare function isEncrypted(text: string): boolean;
|
|
13
13
|
//# sourceMappingURL=crypto.d.ts.map
|