@cloudbase/cli 2.9.9 → 2.9.10-beta.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/bin/cloudbase.js +2 -1
- package/bin/tcb.js +35 -28
- package/lib/auth/login.js +21 -13
- package/lib/commands/account/login.js +43 -42
- package/lib/commands/account/logout.js +3 -2
- package/lib/commands/ai/index.js +13 -12
- package/lib/commands/cloudfunction/base.js +24 -26
- package/lib/commands/cloudrun/base.js +87 -96
- package/lib/commands/common.js +11 -10
- package/lib/commands/config/delete.js +72 -0
- package/lib/commands/config/get.js +69 -0
- package/lib/commands/config/index.js +21 -0
- package/lib/commands/config/interface.js +24 -0
- package/lib/commands/config/list.js +72 -0
- package/lib/commands/config/set.js +89 -0
- package/lib/commands/db/base.js +33 -32
- package/lib/commands/env/base.js +12 -11
- package/lib/commands/env/domain.js +24 -23
- package/lib/commands/env/login.js +31 -30
- package/lib/commands/fun/base.js +37 -36
- package/lib/commands/functions/alias/getRoute.js +5 -4
- package/lib/commands/functions/alias/setRoute.js +7 -6
- package/lib/commands/functions/code-download.js +15 -11
- package/lib/commands/functions/code-update.js +8 -7
- package/lib/commands/functions/concurrency/delete.js +5 -4
- package/lib/commands/functions/concurrency/list.js +6 -5
- package/lib/commands/functions/concurrency/set.js +5 -4
- package/lib/commands/functions/config-update.js +8 -7
- package/lib/commands/functions/copy.js +7 -6
- package/lib/commands/functions/delete.js +8 -7
- package/lib/commands/functions/deploy.js +35 -34
- package/lib/commands/functions/detail.js +32 -31
- package/lib/commands/functions/invoke.js +16 -15
- package/lib/commands/functions/layer/bind.js +26 -25
- package/lib/commands/functions/layer/common.js +2 -1
- package/lib/commands/functions/layer/create.js +7 -6
- package/lib/commands/functions/layer/delete.js +9 -8
- package/lib/commands/functions/layer/download.js +10 -9
- package/lib/commands/functions/layer/list.js +10 -9
- package/lib/commands/functions/layer/sort.js +9 -8
- package/lib/commands/functions/list.js +9 -8
- package/lib/commands/functions/log.js +28 -27
- package/lib/commands/functions/run.js +21 -20
- package/lib/commands/functions/trigger-create.js +9 -8
- package/lib/commands/functions/trigger-delete.js +10 -9
- package/lib/commands/functions/version/list.js +9 -8
- package/lib/commands/functions/version/publish.js +5 -4
- package/lib/commands/gateway/create.js +14 -13
- package/lib/commands/gateway/delete.js +10 -9
- package/lib/commands/gateway/domain.js +25 -24
- package/lib/commands/gateway/list.js +11 -10
- package/lib/commands/gateway/switch.js +22 -19
- package/lib/commands/helpers/init.js +38 -37
- package/lib/commands/helpers/new.js +7 -6
- package/lib/commands/helpers/open.js +7 -6
- package/lib/commands/hosting/hosting.js +45 -44
- package/lib/commands/index.js +1 -0
- package/lib/commands/pull/pull.js +12 -11
- package/lib/commands/run/delete.js +16 -15
- package/lib/commands/run/image/common.js +2 -1
- package/lib/commands/run/image/delete.js +10 -9
- package/lib/commands/run/image/download.js +8 -7
- package/lib/commands/run/image/list.js +11 -10
- package/lib/commands/run/image/upload.js +9 -8
- package/lib/commands/run/list.js +10 -9
- package/lib/commands/run/service/config.js +13 -12
- package/lib/commands/run/service/deploy.js +24 -23
- package/lib/commands/run/service/list.js +10 -9
- package/lib/commands/run/service/update.js +22 -21
- package/lib/commands/run/standalonegateway/common.js +2 -1
- package/lib/commands/run/standalonegateway/create.js +14 -13
- package/lib/commands/run/standalonegateway/destroy.js +9 -8
- package/lib/commands/run/standalonegateway/list.js +7 -6
- package/lib/commands/run/standalonegateway/package.js +7 -6
- package/lib/commands/run/standalonegateway/turn.js +10 -9
- package/lib/commands/run/version/common.js +2 -1
- package/lib/commands/run/version/create.js +41 -40
- package/lib/commands/run/version/delete.js +10 -9
- package/lib/commands/run/version/list.js +13 -12
- package/lib/commands/run/version/modify.js +13 -12
- package/lib/commands/run/version/update.js +57 -54
- package/lib/commands/runf/base.js +42 -40
- package/lib/commands/self-update.js +11 -10
- package/lib/commands/smart.js +5 -4
- package/lib/commands/storage/storage.js +61 -56
- package/lib/commands/third/thirdAttach.js +6 -5
- package/lib/commands/utils.js +8 -5
- package/lib/constant.js +18 -17
- package/lib/decorators/deprecate.js +2 -1
- package/lib/function/alias.js +3 -2
- package/lib/function/base.js +9 -8
- package/lib/function/concurrency.js +4 -3
- package/lib/function/create.js +5 -4
- package/lib/function/delete.js +2 -1
- package/lib/function/layer/attach.js +2 -1
- package/lib/function/layer/create.js +2 -1
- package/lib/function/layer/download.js +2 -1
- package/lib/function/trigger.js +6 -5
- package/lib/function/update.js +3 -2
- package/lib/function/version.js +3 -2
- package/lib/help.js +22 -20
- package/lib/hosting.js +18 -17
- package/lib/i18n/index.js +81 -0
- package/lib/run/service/common.js +14 -13
- package/lib/run/service/config.js +4 -3
- package/lib/run/service/deployPackage.js +6 -5
- package/lib/run/service/showLogs.js +3 -2
- package/lib/run/service/update.js +7 -6
- package/lib/run/standalonegateway/list.js +5 -1
- package/lib/storage.js +2 -1
- package/lib/utils/ai/banner.js +12 -11
- package/lib/utils/ai/claudeWindows.js +5 -3
- package/lib/utils/ai/config.js +3 -2
- package/lib/utils/ai/const.js +4 -3
- package/lib/utils/ai/env.js +3 -2
- package/lib/utils/ai/envLocalManager.js +6 -5
- package/lib/utils/ai/nodeVersion.js +5 -1
- package/lib/utils/ai/router.js +129 -106
- package/lib/utils/ai/setup.js +95 -91
- package/lib/utils/checkTcbrEnv.js +22 -21
- package/lib/utils/cli-table.js +2 -1
- package/lib/utils/commonParamsCheck.js +4 -3
- package/lib/utils/debug-logger.js +2 -1
- package/lib/utils/dts.js +4 -3
- package/lib/utils/env.js +23 -21
- package/lib/utils/fs/index.js +5 -4
- package/lib/utils/function-packer.js +3 -2
- package/lib/utils/index.js +1 -0
- package/lib/utils/mcp-config-modifier.js +18 -17
- package/lib/utils/net/cloud-api-request.js +2 -1
- package/lib/utils/net/credential.js +2 -1
- package/lib/utils/net/http-request.js +2 -1
- package/lib/utils/progress-bar.js +2 -1
- package/lib/utils/prompt/select.js +8 -6
- package/lib/utils/store/auth.js +3 -2
- package/lib/utils/store/config.js +49 -0
- package/lib/utils/store/db.js +5 -0
- package/lib/utils/store/index.js +1 -1
- package/lib/utils/tcbrApi/callTcbrApi.js +2 -1
- package/lib/utils/template-manager.js +37 -36
- package/lib/utils/template.js +10 -9
- package/lib/utils/tools/common.js +3 -2
- package/lib/utils/url.js +19 -0
- package/lib/utils/validator.js +12 -4
- package/locales/README.md +160 -0
- package/locales/i18next-scanner.config.js +206 -0
- package/locales/langs/en.json +1235 -0
- package/locales/langs/zh.json +1235 -0
- package/locales/mapping.json +1235 -0
- package/package.json +9 -2
- package/types/commands/config/delete.d.ts +13 -0
- package/types/commands/config/get.d.ts +13 -0
- package/types/commands/config/index.d.ts +5 -0
- package/types/commands/config/interface.d.ts +17 -0
- package/types/commands/config/list.d.ts +13 -0
- package/types/commands/config/set.d.ts +13 -0
- package/types/commands/index.d.ts +1 -0
- package/types/i18n/index.d.ts +3 -0
- package/types/utils/ai/const.d.ts +1 -1
- package/types/utils/index.d.ts +1 -0
- package/types/utils/store/config.d.ts +8 -0
- package/types/utils/store/db.d.ts +2 -0
- package/types/utils/store/index.d.ts +1 -1
- package/types/utils/url.d.ts +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/cli",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.10-beta.0",
|
|
4
4
|
"description": "cli tool for cloudbase",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
"package:windows-x64": "OS=windows ARCH=x64 VERSION= node -e \"require('child_process').execSync('bash build/scripts/package.sh',{stdio:'inherit'})\"",
|
|
28
28
|
"package:windows-arm64": "OS=windows ARCH=arm64 VERSION= node -e \"require('child_process').execSync('bash build/scripts/package.sh',{stdio:'inherit'})\"",
|
|
29
29
|
"package:windows-all": "npm run -s node:fetch:win-x64 && npm run -s node:fetch:win-arm64 && npm run -s package:windows-x64 && npm run -s package:windows-arm64",
|
|
30
|
-
"out:prune": "bash build/scripts/prune-out.sh"
|
|
30
|
+
"out:prune": "bash build/scripts/prune-out.sh",
|
|
31
|
+
"i18n:scan": "i18next-scanner --config locales/i18next-scanner.config.js && node locales/scripts/generate.js",
|
|
32
|
+
"i18n:sync": "node locales/scripts/sync.js sync"
|
|
31
33
|
},
|
|
32
34
|
"repository": {
|
|
33
35
|
"type": "git",
|
|
@@ -82,6 +84,7 @@
|
|
|
82
84
|
"npm": "^11.5.2",
|
|
83
85
|
"open": "^7.0.0",
|
|
84
86
|
"ora": "^4.0.2",
|
|
87
|
+
"os-locale": "5.0.0",
|
|
85
88
|
"patch-package": "^8.0.0",
|
|
86
89
|
"portfinder": "^1.0.28",
|
|
87
90
|
"progress": "^2.0.3",
|
|
@@ -100,6 +103,9 @@
|
|
|
100
103
|
"zod": "^4.0.13"
|
|
101
104
|
},
|
|
102
105
|
"devDependencies": {
|
|
106
|
+
"@babel/parser": "^7.28.4",
|
|
107
|
+
"@babel/traverse": "^7.28.4",
|
|
108
|
+
"@babel/types": "^7.28.4",
|
|
103
109
|
"@types/fs-extra": "^11.0.4",
|
|
104
110
|
"@types/jest": "^27",
|
|
105
111
|
"@types/koa__router": "^8.0.11",
|
|
@@ -116,6 +122,7 @@
|
|
|
116
122
|
"eslint": "^7.14.0",
|
|
117
123
|
"eslint-config-alloy": "^3.8.2",
|
|
118
124
|
"husky": "^3.0.9",
|
|
125
|
+
"i18next-scanner": "^4.6.0",
|
|
119
126
|
"jest": "^27",
|
|
120
127
|
"rimraf": "^3.0.2",
|
|
121
128
|
"ts-jest": "^27",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '../common';
|
|
2
|
+
import { Logger } from '../../decorators';
|
|
3
|
+
export declare class ConfigDeleteCommand extends Command {
|
|
4
|
+
get options(): {
|
|
5
|
+
cmd: string;
|
|
6
|
+
childCmd: string;
|
|
7
|
+
options: any[];
|
|
8
|
+
desc: string;
|
|
9
|
+
requiredEnvId: boolean;
|
|
10
|
+
withoutAuth: boolean;
|
|
11
|
+
};
|
|
12
|
+
execute(params: any[], log: Logger): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '../common';
|
|
2
|
+
import { Logger } from '../../decorators';
|
|
3
|
+
export declare class ConfigGetCommand extends Command {
|
|
4
|
+
get options(): {
|
|
5
|
+
cmd: string;
|
|
6
|
+
childCmd: string;
|
|
7
|
+
options: any[];
|
|
8
|
+
desc: string;
|
|
9
|
+
requiredEnvId: boolean;
|
|
10
|
+
withoutAuth: boolean;
|
|
11
|
+
};
|
|
12
|
+
execute(params: any[], log: Logger): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type IConfigItem = {
|
|
2
|
+
key: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
envKey?: string;
|
|
5
|
+
} & ({
|
|
6
|
+
type: 'string';
|
|
7
|
+
value: string;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'number';
|
|
10
|
+
value: number;
|
|
11
|
+
} | {
|
|
12
|
+
type: 'boolean';
|
|
13
|
+
value: boolean;
|
|
14
|
+
});
|
|
15
|
+
export declare const CONFIGS: Record<string, IConfigItem>;
|
|
16
|
+
export declare const DEFAULT_CONFIGS: any;
|
|
17
|
+
export type ConfigAction = 'set' | 'get' | 'delete' | 'list';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '../common';
|
|
2
|
+
import { Logger } from '../../decorators';
|
|
3
|
+
export declare class ConfigListCommand extends Command {
|
|
4
|
+
get options(): {
|
|
5
|
+
cmd: string;
|
|
6
|
+
childCmd: string;
|
|
7
|
+
options: any[];
|
|
8
|
+
desc: string;
|
|
9
|
+
requiredEnvId: boolean;
|
|
10
|
+
withoutAuth: boolean;
|
|
11
|
+
};
|
|
12
|
+
execute(log: Logger): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '../common';
|
|
2
|
+
import { Logger } from '../../decorators';
|
|
3
|
+
export declare class ConfigSetCommand extends Command {
|
|
4
|
+
get options(): {
|
|
5
|
+
cmd: string;
|
|
6
|
+
childCmd: string;
|
|
7
|
+
options: any[];
|
|
8
|
+
desc: string;
|
|
9
|
+
requiredEnvId: boolean;
|
|
10
|
+
withoutAuth: boolean;
|
|
11
|
+
};
|
|
12
|
+
execute(params: any[], log: Logger): Promise<void>;
|
|
13
|
+
}
|
|
@@ -398,4 +398,4 @@ export declare const BASE_URL_MODEL_MAPPING: {
|
|
|
398
398
|
};
|
|
399
399
|
export declare function getDefaultModelByBaseUrl(baseUrl: string): string;
|
|
400
400
|
export declare function getBooleanHint(defaultValue?: boolean): string;
|
|
401
|
-
export declare const LIST_HINT
|
|
401
|
+
export declare const LIST_HINT: string;
|
package/types/utils/index.d.ts
CHANGED
|
@@ -4,10 +4,12 @@ export declare function getAsyncDB(file: string): Promise<low.LowdbAsync<any>>;
|
|
|
4
4
|
export declare function getSyncDB(file: string): low.LowdbSync<any>;
|
|
5
5
|
export declare class LocalStore {
|
|
6
6
|
db: any;
|
|
7
|
+
dbSync: low.LowdbSync<any>;
|
|
7
8
|
dbKey: string;
|
|
8
9
|
defaults: any;
|
|
9
10
|
constructor(defaults: any, dbKey?: string);
|
|
10
11
|
getDB(): Promise<any>;
|
|
12
|
+
getSyncDB(): low.LowdbSync<any>;
|
|
11
13
|
get(key: string): Promise<any>;
|
|
12
14
|
set(key: string, value: any): Promise<void>;
|
|
13
15
|
push(key: string, value: any): Promise<void>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const EDomain: {
|
|
2
|
+
readonly Console: "console.tencentcloud.com" | "console.cloud.tencent.com";
|
|
3
|
+
readonly Official: "www.tencentcloud.com" | "cloud.tencent.com";
|
|
4
|
+
readonly Gateway: "api.intl.tcloudbasegateway.com" | "api.tcloudbasegateway.com";
|
|
5
|
+
readonly Tcb: "tcb.tencentcloud.com" | "tcb.cloud.tencent.com";
|
|
6
|
+
readonly Docs: "docs.cloudbase.net";
|
|
7
|
+
};
|
|
8
|
+
export declare const EUrl: {
|
|
9
|
+
readonly Docs: string;
|
|
10
|
+
readonly DevPlatform: "https://tcb.cloud.tencent.com/dev" | "https://tcb.tencentcloud.com/dev";
|
|
11
|
+
readonly TcbConsole: "https://console.tencentcloud.com/tcb" | "https://console.cloud.tencent.com/tcb";
|
|
12
|
+
readonly CloudAdmin: "https://tcb.tencentcloud.com/cloud-admin" | "https://tcb.cloud.tencent.com/cloud-admin";
|
|
13
|
+
readonly Console: "https://console.tencentcloud.com" | "https://console.cloud.tencent.com";
|
|
14
|
+
readonly Official: "https://www.tencentcloud.com" | "https://cloud.tencent.com";
|
|
15
|
+
readonly Gateway: "https://api.intl.tcloudbasegateway.com" | "https://api.tcloudbasegateway.com";
|
|
16
|
+
readonly Tcb: "https://tcb.tencentcloud.com" | "https://tcb.cloud.tencent.com";
|
|
17
|
+
};
|
|
18
|
+
export declare function getGatewayUrl(envId: string): `https://${string}.api.intl.tcloudbasegateway.com` | `https://${string}.api.tcloudbasegateway.com`;
|