@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
|
@@ -40,6 +40,7 @@ const decorators_1 = require("../../decorators");
|
|
|
40
40
|
const common_1 = require("../common");
|
|
41
41
|
const constants_1 = require("../constants");
|
|
42
42
|
const utils_1 = require("../utils");
|
|
43
|
+
const i18n_1 = require("../../i18n");
|
|
43
44
|
let CloudFunctionDeployCommand = class CloudFunctionDeployCommand extends common_1.Command {
|
|
44
45
|
get options() {
|
|
45
46
|
return {
|
|
@@ -48,20 +49,20 @@ let CloudFunctionDeployCommand = class CloudFunctionDeployCommand extends common
|
|
|
48
49
|
options: [
|
|
49
50
|
{
|
|
50
51
|
flags: '-e, --envId <envId>',
|
|
51
|
-
desc: '环境 Id'
|
|
52
|
+
desc: (0, i18n_1.t)('环境 Id')
|
|
52
53
|
},
|
|
53
54
|
{
|
|
54
55
|
flags: '-s, --serviceName <serviceName>',
|
|
55
|
-
desc: '服务名称'
|
|
56
|
+
desc: (0, i18n_1.t)('服务名称')
|
|
56
57
|
},
|
|
57
58
|
{
|
|
58
59
|
flags: '--source <source>',
|
|
59
|
-
desc: '目标函数文件所在目录路径。默认为当前路径'
|
|
60
|
+
desc: (0, i18n_1.t)('目标函数文件所在目录路径。默认为当前路径')
|
|
60
61
|
}
|
|
61
62
|
],
|
|
62
63
|
requiredEnvId: false,
|
|
63
64
|
autoRunLogin: true,
|
|
64
|
-
desc: '部署云函数服务'
|
|
65
|
+
desc: (0, i18n_1.t)('部署云函数服务')
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
68
|
execute(ctx, envId, log, options) {
|
|
@@ -72,14 +73,14 @@ let CloudFunctionDeployCommand = class CloudFunctionDeployCommand extends common
|
|
|
72
73
|
const envConfig = (0, camelcase_keys_1.default)(yield iac_core_1.utils.loadEnv(targetDir));
|
|
73
74
|
if (envConfig.envId) {
|
|
74
75
|
envId = envConfig.envId;
|
|
75
|
-
log.info(
|
|
76
|
+
log.info((0, i18n_1.t)('当前环境 Id:{{envId}}', { envId }));
|
|
76
77
|
}
|
|
77
78
|
else {
|
|
78
79
|
envId = yield _selectEnv();
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
else {
|
|
82
|
-
log.info(
|
|
83
|
+
log.info((0, i18n_1.t)('当前环境 Id:{{envId}}', { envId }));
|
|
83
84
|
}
|
|
84
85
|
if (!serviceName) {
|
|
85
86
|
const { shortName } = yield (0, utils_1.getPackageJsonName)(path_1.default.join(targetDir, 'package.json'));
|
|
@@ -89,7 +90,7 @@ let CloudFunctionDeployCommand = class CloudFunctionDeployCommand extends common
|
|
|
89
90
|
{
|
|
90
91
|
type: 'confirm',
|
|
91
92
|
name: 'confirm',
|
|
92
|
-
message:
|
|
93
|
+
message: (0, i18n_1.t)('即将开始部署,是否确认继续?'),
|
|
93
94
|
default: true
|
|
94
95
|
}
|
|
95
96
|
]);
|
|
@@ -118,10 +119,10 @@ let CloudFunctionDeployCommand = class CloudFunctionDeployCommand extends common
|
|
|
118
119
|
}
|
|
119
120
|
catch (e) {
|
|
120
121
|
if ((e === null || e === void 0 ? void 0 : e.action) === 'UpdateFunctionConfiguration' &&
|
|
121
|
-
((_a = e === null || e === void 0 ? void 0 : e.message) === null || _a === void 0 ? void 0 : _a.includes('当前函数处于Updating状态,无法进行此操作,请稍后重试'))) {
|
|
122
|
+
((_a = e === null || e === void 0 ? void 0 : e.message) === null || _a === void 0 ? void 0 : _a.includes((0, i18n_1.t)('当前函数处于Updating状态,无法进行此操作,请稍后重试')))) {
|
|
122
123
|
(0, utils_1.trackCallback)({
|
|
123
124
|
type: 'error',
|
|
124
|
-
details: '当前函数处于更新状态,无法进行此操作,请稍后重试',
|
|
125
|
+
details: (0, i18n_1.t)('当前函数处于更新状态,无法进行此操作,请稍后重试'),
|
|
125
126
|
originalError: e
|
|
126
127
|
}, log);
|
|
127
128
|
}
|
|
@@ -160,20 +161,20 @@ let CloudFunctionDownloadCommand = class CloudFunctionDownloadCommand extends co
|
|
|
160
161
|
options: [
|
|
161
162
|
{
|
|
162
163
|
flags: '-e, --envId <envId>',
|
|
163
|
-
desc: '环境 Id'
|
|
164
|
+
desc: (0, i18n_1.t)('环境 Id')
|
|
164
165
|
},
|
|
165
166
|
{
|
|
166
167
|
flags: '-s, --serviceName <serviceName>',
|
|
167
|
-
desc: '服务名称'
|
|
168
|
+
desc: (0, i18n_1.t)('服务名称')
|
|
168
169
|
},
|
|
169
170
|
{
|
|
170
171
|
flags: '--source <source>',
|
|
171
|
-
desc: '目标函数文件所在目录路径。默认为当前路径'
|
|
172
|
+
desc: (0, i18n_1.t)('目标函数文件所在目录路径。默认为当前路径')
|
|
172
173
|
}
|
|
173
174
|
],
|
|
174
175
|
requiredEnvId: false,
|
|
175
176
|
autoRunLogin: true,
|
|
176
|
-
desc: '下载云函数服务代码'
|
|
177
|
+
desc: (0, i18n_1.t)('下载云函数服务代码')
|
|
177
178
|
};
|
|
178
179
|
}
|
|
179
180
|
execute(ctx, envId, log, options) {
|
|
@@ -185,7 +186,7 @@ let CloudFunctionDownloadCommand = class CloudFunctionDownloadCommand extends co
|
|
|
185
186
|
envId = envConfig.envId || (yield _selectEnv());
|
|
186
187
|
}
|
|
187
188
|
else {
|
|
188
|
-
log.info(
|
|
189
|
+
log.info((0, i18n_1.t)('当前环境 Id:{{envId}}', { envId }));
|
|
189
190
|
}
|
|
190
191
|
if (!serviceName) {
|
|
191
192
|
const { shortName } = yield (0, utils_1.getPackageJsonName)(path_1.default.join(targetDir, 'package.json'));
|
|
@@ -200,7 +201,7 @@ let CloudFunctionDownloadCommand = class CloudFunctionDownloadCommand extends co
|
|
|
200
201
|
{
|
|
201
202
|
type: 'confirm',
|
|
202
203
|
name: 'confirm',
|
|
203
|
-
message:
|
|
204
|
+
message: (0, i18n_1.t)('下载将覆盖 {{targetDir}} 目录下的代码,是否继续?', { targetDir }),
|
|
204
205
|
default: true
|
|
205
206
|
}
|
|
206
207
|
]);
|
|
@@ -256,22 +257,19 @@ let CloudFunctionRunCommand = class CloudFunctionRunCommand extends common_1.Com
|
|
|
256
257
|
options: [
|
|
257
258
|
{
|
|
258
259
|
flags: '--source <source>',
|
|
259
|
-
desc:
|
|
260
|
-
`
|
|
260
|
+
desc: (0, i18n_1.t)('目标函数文件所在目录路径,默认为当前路径')
|
|
261
261
|
},
|
|
262
262
|
{
|
|
263
263
|
flags: '--port <port>',
|
|
264
|
-
desc:
|
|
265
|
-
`
|
|
264
|
+
desc: (0, i18n_1.t)('监听的端口,默认为 3000')
|
|
266
265
|
},
|
|
267
266
|
{
|
|
268
267
|
flags: '-w, --watch',
|
|
269
|
-
desc:
|
|
270
|
-
`
|
|
268
|
+
desc: (0, i18n_1.t)('是否启用热重启模式,如启用,将会在文件变更时自动重启服务,默认为 false')
|
|
271
269
|
}
|
|
272
270
|
],
|
|
273
271
|
requiredEnvId: false,
|
|
274
|
-
desc: '本地运行云函数代码'
|
|
272
|
+
desc: (0, i18n_1.t)('本地运行云函数代码')
|
|
275
273
|
};
|
|
276
274
|
}
|
|
277
275
|
execute(logger, ctx, options) {
|
|
@@ -288,7 +286,7 @@ let CloudFunctionRunCommand = class CloudFunctionRunCommand extends common_1.Com
|
|
|
288
286
|
if (watchFlag.some((flag) => args.includes(flag))) {
|
|
289
287
|
const cmd = args.filter((arg) => !watchFlag.includes(arg)).join(' ');
|
|
290
288
|
if (!nodemon) {
|
|
291
|
-
throw new Error('缺少开发依赖 nodemon,独立发行版已不内置。请在本地开发环境中安装再使用该命令。');
|
|
289
|
+
throw new Error((0, i18n_1.t)('缺少开发依赖 nodemon,独立发行版已不内置。请在本地开发环境中安装再使用该命令。'));
|
|
292
290
|
}
|
|
293
291
|
nodemon({
|
|
294
292
|
script: '',
|
|
@@ -316,7 +314,7 @@ let CloudFunctionRunCommand = class CloudFunctionRunCommand extends common_1.Com
|
|
|
316
314
|
logger.info(`[nodemon ${e.type}] ${e.message}`);
|
|
317
315
|
})
|
|
318
316
|
.on('crash', () => {
|
|
319
|
-
logger.error(
|
|
317
|
+
logger.error('Server crashed.');
|
|
320
318
|
process.exit(1);
|
|
321
319
|
})
|
|
322
320
|
.on('exit', (e) => {
|
|
@@ -353,7 +351,7 @@ function _inputServiceName(defaultVal = '') {
|
|
|
353
351
|
{
|
|
354
352
|
type: 'input',
|
|
355
353
|
name: 'serviceName',
|
|
356
|
-
message: '请输入服务名称',
|
|
354
|
+
message: (0, i18n_1.t)('请输入服务名称'),
|
|
357
355
|
default: defaultVal,
|
|
358
356
|
validate: (val) => {
|
|
359
357
|
const isValid = !val.startsWith('lcap') &&
|
|
@@ -361,7 +359,7 @@ function _inputServiceName(defaultVal = '') {
|
|
|
361
359
|
/^[A-Za-z][\w-_]{0,43}[A-Za-z0-9]$/.test(val);
|
|
362
360
|
return isValid
|
|
363
361
|
? true
|
|
364
|
-
: '支持大小写字母、数字、-和_,但必须以字母开头、以字母和数字结尾,不支持以lcap、lowcode开头,最长45个字符';
|
|
362
|
+
: (0, i18n_1.t)('支持大小写字母、数字、-和_,但必须以字母开头、以字母和数字结尾,不支持以lcap、lowcode开头,最长45个字符');
|
|
365
363
|
}
|
|
366
364
|
}
|
|
367
365
|
];
|