@cloudbase/cli 2.10.0-beta.0 → 2.11.0-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/lib/auth/login.js +51 -65
- package/lib/auth/logout.js +3 -14
- package/lib/commands/account/login.js +136 -149
- package/lib/commands/account/logout.js +3 -14
- package/lib/commands/ag/base.js +203 -0
- package/lib/commands/ag/create.js +301 -0
- package/lib/commands/ag/debug/index.html +699 -0
- package/lib/commands/ag/delete.js +200 -0
- package/lib/commands/ag/deploy.js +185 -0
- package/lib/commands/ag/detail.js +113 -0
- package/lib/commands/ag/index.js +22 -0
- package/lib/commands/ag/list.js +155 -0
- package/lib/commands/ag/run.js +644 -0
- package/lib/commands/ai/index.js +76 -95
- package/lib/commands/cloudfunction/base.js +182 -203
- package/lib/commands/cloudrun/base.js +578 -603
- package/lib/commands/common.js +48 -63
- package/lib/commands/config/delete.js +16 -27
- package/lib/commands/config/get.js +13 -24
- package/lib/commands/config/list.js +16 -27
- package/lib/commands/config/set.js +33 -44
- package/lib/commands/db/base.js +221 -240
- package/lib/commands/env/base.js +36 -49
- package/lib/commands/env/domain.js +79 -94
- package/lib/commands/env/login.js +120 -135
- package/lib/commands/framework/index.js +32 -49
- package/lib/commands/fun/base.js +223 -244
- package/lib/commands/functions/alias/getRoute.js +33 -44
- package/lib/commands/functions/alias/setRoute.js +36 -47
- package/lib/commands/functions/code-download.js +43 -54
- package/lib/commands/functions/code-update.js +23 -34
- package/lib/commands/functions/concurrency/delete.js +11 -22
- package/lib/commands/functions/concurrency/list.js +20 -31
- package/lib/commands/functions/concurrency/set.js +13 -24
- package/lib/commands/functions/config-update.js +30 -41
- package/lib/commands/functions/copy.js +12 -23
- package/lib/commands/functions/delete.js +30 -41
- package/lib/commands/functions/deploy.js +184 -202
- package/lib/commands/functions/detail.js +23 -34
- package/lib/commands/functions/invoke.js +69 -75
- package/lib/commands/functions/layer/bind.js +102 -105
- package/lib/commands/functions/layer/create.js +29 -35
- package/lib/commands/functions/layer/delete.js +42 -48
- package/lib/commands/functions/layer/download.js +52 -58
- package/lib/commands/functions/layer/list.js +44 -50
- package/lib/commands/functions/layer/sort.js +39 -45
- package/lib/commands/functions/list.js +25 -36
- package/lib/commands/functions/log.js +65 -73
- package/lib/commands/functions/run.js +118 -116
- package/lib/commands/functions/trigger-create.js +32 -43
- package/lib/commands/functions/trigger-delete.js +50 -61
- package/lib/commands/functions/version/list.js +29 -40
- package/lib/commands/functions/version/publish.js +11 -22
- package/lib/commands/gateway/create.js +50 -61
- package/lib/commands/gateway/delete.js +38 -49
- package/lib/commands/gateway/domain.js +65 -80
- package/lib/commands/gateway/list.js +31 -42
- package/lib/commands/gateway/switch.js +48 -61
- package/lib/commands/helpers/init.js +226 -249
- package/lib/commands/helpers/new.js +35 -46
- package/lib/commands/helpers/open.js +22 -33
- package/lib/commands/hosting/hosting.js +157 -178
- package/lib/commands/index.js +1 -0
- package/lib/commands/lowcode/app.js +114 -144
- package/lib/commands/lowcode/comps.js +136 -127
- package/lib/commands/lowcode/utils.js +11 -22
- package/lib/commands/pull/pull.js +33 -46
- package/lib/commands/run/delete.js +35 -46
- package/lib/commands/run/image/delete.js +32 -39
- package/lib/commands/run/image/download.js +26 -33
- package/lib/commands/run/image/list.js +41 -48
- package/lib/commands/run/image/upload.js +26 -33
- package/lib/commands/run/list.js +32 -43
- package/lib/commands/run/service/config.js +17 -28
- package/lib/commands/run/service/deploy.js +15 -26
- package/lib/commands/run/service/list.js +48 -59
- package/lib/commands/run/service/update.js +7 -18
- package/lib/commands/run/standalonegateway/create.js +35 -42
- package/lib/commands/run/standalonegateway/destroy.js +23 -30
- package/lib/commands/run/standalonegateway/list.js +19 -26
- package/lib/commands/run/standalonegateway/package.js +31 -38
- package/lib/commands/run/standalonegateway/turn.js +27 -34
- package/lib/commands/run/version/create.js +198 -205
- package/lib/commands/run/version/delete.js +31 -38
- package/lib/commands/run/version/list.js +42 -49
- package/lib/commands/run/version/modify.js +27 -34
- package/lib/commands/run/version/update.js +201 -208
- package/lib/commands/runf/base.js +216 -237
- package/lib/commands/self-update.js +59 -72
- package/lib/commands/smart.js +66 -79
- package/lib/commands/storage/storage.js +192 -219
- package/lib/commands/third/thirdAttach.js +16 -27
- package/lib/commands/utils.js +119 -149
- package/lib/db/index.js +48 -67
- package/lib/decorators/captureError.js +10 -21
- package/lib/decorators/guard.js +11 -22
- package/lib/decorators/injectParams.js +29 -40
- package/lib/decorators/params/common.js +5 -2
- package/lib/decorators/params/index.js +3 -12
- package/lib/env/domain.js +13 -28
- package/lib/env/index.js +25 -44
- package/lib/env/login.js +30 -45
- package/lib/function/alias.js +31 -44
- package/lib/function/base.js +187 -215
- package/lib/function/code.js +8 -19
- package/lib/function/concurrency.js +43 -58
- package/lib/function/create.js +43 -53
- package/lib/function/delete.js +22 -35
- package/lib/function/layer/attach.js +33 -46
- package/lib/function/layer/create.js +34 -45
- package/lib/function/layer/delete.js +5 -16
- package/lib/function/layer/download.js +11 -22
- package/lib/function/layer/list.js +12 -25
- package/lib/function/layer/sort.js +6 -17
- package/lib/function/trigger.js +65 -82
- package/lib/function/update.js +24 -32
- package/lib/function/version.js +29 -42
- package/lib/function/vpc.js +12 -25
- package/lib/gateway/index.js +77 -104
- package/lib/hosting.js +157 -188
- package/lib/run/delete.js +3 -12
- package/lib/run/image/build.js +6 -15
- package/lib/run/image/delete.js +3 -12
- package/lib/run/image/info.js +3 -12
- package/lib/run/image/list.js +6 -15
- package/lib/run/list.js +19 -30
- package/lib/run/repo.js +6 -15
- package/lib/run/service/common.js +160 -173
- package/lib/run/service/config.js +44 -57
- package/lib/run/service/deployPackage.js +33 -44
- package/lib/run/service/list.js +8 -14
- package/lib/run/service/showLogs.js +69 -90
- package/lib/run/service/update.js +50 -63
- package/lib/run/standalonegateway/create.js +3 -12
- package/lib/run/standalonegateway/destroy.js +3 -12
- package/lib/run/standalonegateway/list.js +3 -12
- package/lib/run/standalonegateway/package/list.js +3 -12
- package/lib/run/standalonegateway/turn/off.js +3 -12
- package/lib/run/standalonegateway/turn/on.js +3 -12
- package/lib/run/version/create.js +41 -31
- package/lib/run/version/delete.js +3 -12
- package/lib/run/version/list.js +3 -12
- package/lib/run/version/modify.js +3 -12
- package/lib/run/version/repo.js +6 -15
- package/lib/run/version/update.js +37 -26
- package/lib/storage.js +62 -93
- package/lib/third/index.js +6 -17
- package/lib/utils/ai/banner.js +49 -60
- package/lib/utils/ai/claudeWindows.js +2 -2
- package/lib/utils/ai/config.js +169 -206
- package/lib/utils/ai/ensureFiles.js +6 -17
- package/lib/utils/ai/env.js +16 -27
- package/lib/utils/ai/envLocalManager.js +35 -52
- package/lib/utils/ai/router.js +927 -1005
- package/lib/utils/ai/setup.js +527 -563
- package/lib/utils/auth.js +3 -14
- package/lib/utils/checkTcbrEnv.js +20 -31
- package/lib/utils/cli-table.js +6 -1
- package/lib/utils/config.js +4 -13
- package/lib/utils/dts.js +98 -113
- package/lib/utils/env.js +154 -175
- package/lib/utils/function-packer.js +29 -42
- package/lib/utils/log.js +10 -21
- package/lib/utils/mcp-config-modifier.js +105 -120
- package/lib/utils/net/cloud-api-request.js +15 -23
- package/lib/utils/net/credential.js +26 -39
- package/lib/utils/net/http-request.js +63 -80
- package/lib/utils/net/manager-service.js +22 -35
- package/lib/utils/notice.js +16 -27
- package/lib/utils/output/loading.js +3 -12
- package/lib/utils/parallel.js +32 -43
- package/lib/utils/platform/mac.js +4 -15
- package/lib/utils/platform/port.js +4 -15
- package/lib/utils/prompt/select.js +6 -15
- package/lib/utils/report.js +28 -33
- package/lib/utils/reporter/agree.js +11 -22
- package/lib/utils/reporter/download.js +17 -28
- package/lib/utils/reporter/usage.js +12 -23
- package/lib/utils/store/auth.js +17 -30
- package/lib/utils/store/config.js +11 -25
- package/lib/utils/store/db.js +17 -36
- package/lib/utils/tcbrApi/callTcbrApi.js +19 -28
- package/lib/utils/template-manager.js +215 -242
- package/lib/utils/template.js +81 -96
- package/lib/utils/tools/common.js +45 -56
- package/lib/utils/tools/time.js +5 -16
- package/lib/utils/url.js +10 -4
- package/package.json +2 -2
- package/specs/ag-command/design.md +421 -0
- package/specs/ag-command/doc.md +204 -0
- package/specs/ag-command/requirements.md +173 -0
- package/specs/ag-command/summary.md +174 -0
- package/specs/ag-command/tasks.md +197 -0
- package/specs/ag-command/usage-guide.md +420 -0
- package/tsconfig.json +1 -1
- package/types/commands/ag/base.d.ts +44 -0
- package/types/commands/ag/create.d.ts +25 -0
- package/types/commands/ag/delete.d.ts +32 -0
- package/types/commands/ag/deploy.d.ts +31 -0
- package/types/commands/ag/detail.d.ts +28 -0
- package/types/commands/ag/index.d.ts +6 -0
- package/types/commands/ag/list.d.ts +35 -0
- package/types/commands/ag/run.d.ts +52 -0
- package/types/commands/cloudrun/base.d.ts +10 -0
- package/types/commands/index.d.ts +1 -0
package/lib/commands/run/list.js
CHANGED
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
15
|
exports.ListRun = void 0;
|
|
25
16
|
const common_1 = require("../common");
|
|
@@ -53,41 +44,39 @@ let ListRun = class ListRun extends common_1.Command {
|
|
|
53
44
|
desc: (0, i18n_1.t)('展示云托管服务列表')
|
|
54
45
|
};
|
|
55
46
|
}
|
|
56
|
-
execute(envId, options) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
offset: Number(offset)
|
|
78
|
-
});
|
|
79
|
-
loading.stop();
|
|
80
|
-
const head = [(0, i18n_1.t)('服务名称'), (0, i18n_1.t)('服务备注'), (0, i18n_1.t)('创建时间'), (0, i18n_1.t)('修改时间'), (0, i18n_1.t)('状态'), (0, i18n_1.t)('所在私有网络')];
|
|
81
|
-
const tableData = data.map((item) => [
|
|
82
|
-
item.ServerName,
|
|
83
|
-
item.ServiceRemark ? item.ServiceRemark : '-',
|
|
84
|
-
item.CreatedTime,
|
|
85
|
-
item.UpdatedTime,
|
|
86
|
-
StatusMap[item.Status],
|
|
87
|
-
item.VpcId,
|
|
88
|
-
]);
|
|
89
|
-
(0, utils_1.printHorizontalTable)(head, tableData);
|
|
47
|
+
async execute(envId, options) {
|
|
48
|
+
let envCheckType = await (0, utils_1.checkTcbrEnv)(options.envId, false);
|
|
49
|
+
if (envCheckType !== 0) {
|
|
50
|
+
(0, utils_1.logEnvCheck)(envId, envCheckType);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
let { limit = 20, offset = 0 } = options;
|
|
54
|
+
limit = Number(limit);
|
|
55
|
+
offset = Number(offset);
|
|
56
|
+
if (!Number.isInteger(limit) || !Number.isInteger(offset)) {
|
|
57
|
+
throw new error_1.CloudBaseError((0, i18n_1.t)('limit 和 offset 必须为整数'));
|
|
58
|
+
}
|
|
59
|
+
if (limit < 0 || offset < 0) {
|
|
60
|
+
throw new error_1.CloudBaseError((0, i18n_1.t)('limit 和 offset 必须为大于 0 的整数'));
|
|
61
|
+
}
|
|
62
|
+
const loading = (0, utils_1.loadingFactory)();
|
|
63
|
+
loading.start((0, i18n_1.t)('数据加载中...'));
|
|
64
|
+
const data = await (0, run_1.listRun)({
|
|
65
|
+
envId,
|
|
66
|
+
limit: Number(limit),
|
|
67
|
+
offset: Number(offset)
|
|
90
68
|
});
|
|
69
|
+
loading.stop();
|
|
70
|
+
const head = [(0, i18n_1.t)('服务名称'), (0, i18n_1.t)('服务备注'), (0, i18n_1.t)('创建时间'), (0, i18n_1.t)('修改时间'), (0, i18n_1.t)('状态'), (0, i18n_1.t)('所在私有网络')];
|
|
71
|
+
const tableData = data.map((item) => [
|
|
72
|
+
item.ServerName,
|
|
73
|
+
item.ServiceRemark ? item.ServiceRemark : '-',
|
|
74
|
+
item.CreatedTime,
|
|
75
|
+
item.UpdatedTime,
|
|
76
|
+
StatusMap[item.Status],
|
|
77
|
+
item.VpcId,
|
|
78
|
+
]);
|
|
79
|
+
(0, utils_1.printHorizontalTable)(head, tableData);
|
|
91
80
|
}
|
|
92
81
|
};
|
|
93
82
|
__decorate([
|
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
15
|
exports.ConfigServiceTcbr = void 0;
|
|
25
16
|
const common_1 = require("../../common");
|
|
@@ -77,26 +68,24 @@ let ConfigServiceTcbr = class ConfigServiceTcbr extends common_1.Command {
|
|
|
77
68
|
desc: (0, i18n_1.t)('指定环境和服务,更新服务的基础配置')
|
|
78
69
|
};
|
|
79
70
|
}
|
|
80
|
-
execute(options, log) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
ServerBaseConfig: newServiceConfig
|
|
92
|
-
});
|
|
93
|
-
if (options.json) {
|
|
94
|
-
console.log(JSON.stringify(configRes, null, 2));
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
log.success((0, i18n_1.t)('更新配置信息成功'));
|
|
98
|
-
}
|
|
71
|
+
async execute(options, log) {
|
|
72
|
+
let envCheckType = await (0, utils_1.checkTcbrEnv)(options.envId, true);
|
|
73
|
+
if (envCheckType !== 0) {
|
|
74
|
+
(0, utils_1.logEnvCheck)(options.envId, envCheckType);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const newServiceConfig = await (0, run_1.tcbrServiceConfigOptions)(options);
|
|
78
|
+
const configRes = await (0, run_1.updateCloudRunServerConfig)({
|
|
79
|
+
envId: options.envId,
|
|
80
|
+
serviceName: options.serviceName,
|
|
81
|
+
ServerBaseConfig: newServiceConfig
|
|
99
82
|
});
|
|
83
|
+
if (options.json) {
|
|
84
|
+
console.log(JSON.stringify(configRes, null, 2));
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
log.success((0, i18n_1.t)('更新配置信息成功'));
|
|
88
|
+
}
|
|
100
89
|
}
|
|
101
90
|
};
|
|
102
91
|
__decorate([
|
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
15
|
exports.DeployServiceTcbr = void 0;
|
|
25
16
|
const common_1 = require("../../common");
|
|
@@ -122,24 +113,22 @@ let DeployServiceTcbr = class DeployServiceTcbr extends common_1.Command {
|
|
|
122
113
|
desc: (0, i18n_1.t)('在指定的环境部署服务')
|
|
123
114
|
};
|
|
124
115
|
}
|
|
125
|
-
execute(options) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
serviceName: options.serviceName
|
|
135
|
-
});
|
|
136
|
-
if (serviceDetail === undefined) {
|
|
137
|
-
throw new toolbox_1.CloudBaseError((0, i18n_1.t)('当前服务不存在,请前往控制台 {{link}} 创建服务', { link: (0, utils_1.genClickableLink)(`${utils_1.EUrl.TcbConsole}/tcbr`) }));
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
yield (0, run_1.updateTcbrService)(options);
|
|
141
|
-
}
|
|
116
|
+
async execute(options) {
|
|
117
|
+
let envCheckType = await (0, utils_1.checkTcbrEnv)(options.envId, true);
|
|
118
|
+
if (envCheckType !== 0) {
|
|
119
|
+
(0, utils_1.logEnvCheck)(options.envId, envCheckType);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const { data: serviceDetail } = await (0, run_1.describeCloudRunServerDetail)({
|
|
123
|
+
envId: options.envId,
|
|
124
|
+
serviceName: options.serviceName
|
|
142
125
|
});
|
|
126
|
+
if (serviceDetail === undefined) {
|
|
127
|
+
throw new toolbox_1.CloudBaseError((0, i18n_1.t)('当前服务不存在,请前往控制台 {{link}} 创建服务', { link: (0, utils_1.genClickableLink)(`${utils_1.EUrl.TcbConsole}/tcbr`) }));
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
await (0, run_1.updateTcbrService)(options);
|
|
131
|
+
}
|
|
143
132
|
}
|
|
144
133
|
};
|
|
145
134
|
__decorate([
|
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
15
|
exports.ListServiceTcbr = void 0;
|
|
25
16
|
const common_1 = require("../../common");
|
|
@@ -50,57 +41,55 @@ let ListServiceTcbr = class ListServiceTcbr extends common_1.Command {
|
|
|
50
41
|
desc: (0, i18n_1.t)('展示环境下服务信息')
|
|
51
42
|
};
|
|
52
43
|
}
|
|
53
|
-
execute(options) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
envId: envId
|
|
66
|
-
});
|
|
67
|
-
loading.stop();
|
|
68
|
-
const specificServer = serverList.filter(serverItem => serverItem.ServerName === serviceName);
|
|
69
|
-
if (options.json) {
|
|
70
|
-
console.log(JSON.stringify({
|
|
71
|
-
code: 0,
|
|
72
|
-
errmsg: 'success',
|
|
73
|
-
data: specificServer.length ?
|
|
74
|
-
specificServer
|
|
75
|
-
: serverList
|
|
76
|
-
}, null, 2));
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (!serverList.length) {
|
|
80
|
-
console.log((0, i18n_1.t)('当前环境下没有服务'));
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
let tableData;
|
|
84
|
-
if (specificServer.length) {
|
|
85
|
-
tableData = [[
|
|
86
|
-
specificServer[0].ServerName,
|
|
87
|
-
specificServer[0].Status,
|
|
88
|
-
`${(0, i18n_1.t)('是')} ${(0, utils_1.genClickableLink)(specificServer[0].DefaultDomainName)}`,
|
|
89
|
-
specificServer[0].CreatedTime,
|
|
90
|
-
specificServer[0].UpdateTime
|
|
91
|
-
]];
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
tableData = serverList.map(serverItem => [
|
|
95
|
-
serverItem.ServerName,
|
|
96
|
-
serverItem.Status,
|
|
97
|
-
`${(0, i18n_1.t)('是')} ${(0, utils_1.genClickableLink)(serverItem.DefaultDomainName)}`,
|
|
98
|
-
serverItem.CreatedTime,
|
|
99
|
-
serverItem.UpdateTime
|
|
100
|
-
]);
|
|
101
|
-
}
|
|
102
|
-
(0, utils_1.printHorizontalTable)(head, tableData);
|
|
44
|
+
async execute(options) {
|
|
45
|
+
let { envId, serviceName = '' } = options;
|
|
46
|
+
let envCheckType = await (0, checkTcbrEnv_1.checkTcbrEnv)(envId, true);
|
|
47
|
+
if (envCheckType !== 0) {
|
|
48
|
+
(0, checkTcbrEnv_1.logEnvCheck)(envId, envCheckType);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const loading = (0, utils_1.loadingFactory)();
|
|
52
|
+
const head = [(0, i18n_1.t)('服务名称'), (0, i18n_1.t)('状态'), (0, i18n_1.t)('公网访问'), (0, i18n_1.t)('创建时间'), (0, i18n_1.t)('更新时间')];
|
|
53
|
+
loading.start((0, i18n_1.t)('正在获取服务列表'));
|
|
54
|
+
const serverList = await (0, run_1.listService)({
|
|
55
|
+
envId: envId
|
|
103
56
|
});
|
|
57
|
+
loading.stop();
|
|
58
|
+
const specificServer = serverList.filter(serverItem => serverItem.ServerName === serviceName);
|
|
59
|
+
if (options.json) {
|
|
60
|
+
console.log(JSON.stringify({
|
|
61
|
+
code: 0,
|
|
62
|
+
errmsg: 'success',
|
|
63
|
+
data: specificServer.length ?
|
|
64
|
+
specificServer
|
|
65
|
+
: serverList
|
|
66
|
+
}, null, 2));
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (!serverList.length) {
|
|
70
|
+
console.log((0, i18n_1.t)('当前环境下没有服务'));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
let tableData;
|
|
74
|
+
if (specificServer.length) {
|
|
75
|
+
tableData = [[
|
|
76
|
+
specificServer[0].ServerName,
|
|
77
|
+
specificServer[0].Status,
|
|
78
|
+
`${(0, i18n_1.t)('是')} ${(0, utils_1.genClickableLink)(specificServer[0].DefaultDomainName)}`,
|
|
79
|
+
specificServer[0].CreatedTime,
|
|
80
|
+
specificServer[0].UpdateTime
|
|
81
|
+
]];
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
tableData = serverList.map(serverItem => [
|
|
85
|
+
serverItem.ServerName,
|
|
86
|
+
serverItem.Status,
|
|
87
|
+
`${(0, i18n_1.t)('是')} ${(0, utils_1.genClickableLink)(serverItem.DefaultDomainName)}`,
|
|
88
|
+
serverItem.CreatedTime,
|
|
89
|
+
serverItem.UpdateTime
|
|
90
|
+
]);
|
|
91
|
+
}
|
|
92
|
+
(0, utils_1.printHorizontalTable)(head, tableData);
|
|
104
93
|
}
|
|
105
94
|
};
|
|
106
95
|
__decorate([
|
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
15
|
exports.UpdateServiceTcbr = void 0;
|
|
25
16
|
const common_1 = require("../../common");
|
|
@@ -117,15 +108,13 @@ let UpdateServiceTcbr = class UpdateServiceTcbr extends common_1.Command {
|
|
|
117
108
|
desc: (0, i18n_1.t)('指定环境和已存在的服务,发布新的应用')
|
|
118
109
|
};
|
|
119
110
|
}
|
|
120
|
-
execute(options) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
yield (0, run_1.updateTcbrService)(options);
|
|
128
|
-
});
|
|
111
|
+
async execute(options) {
|
|
112
|
+
let envCheckType = await (0, utils_1.checkTcbrEnv)(options.envId, true);
|
|
113
|
+
if (envCheckType !== 0) {
|
|
114
|
+
(0, utils_1.logEnvCheck)(options.envId, envCheckType);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
await (0, run_1.updateTcbrService)(options);
|
|
129
118
|
}
|
|
130
119
|
};
|
|
131
120
|
__decorate([
|
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
15
|
exports.CreateStandalonegateway = void 0;
|
|
25
16
|
const common_1 = require("../../common");
|
|
@@ -31,7 +22,9 @@ const error_1 = require("../../../error");
|
|
|
31
22
|
const i18n_1 = require("../../../i18n");
|
|
32
23
|
let CreateStandalonegateway = class CreateStandalonegateway extends common_1.Command {
|
|
33
24
|
get options() {
|
|
34
|
-
return
|
|
25
|
+
return {
|
|
26
|
+
...(0, common_2.standalonegatewayCommonOptions)('create'),
|
|
27
|
+
options: [
|
|
35
28
|
{
|
|
36
29
|
flags: '-e, --envId <envId>',
|
|
37
30
|
desc: (0, i18n_1.t)('环境 Id')
|
|
@@ -56,40 +49,40 @@ let CreateStandalonegateway = class CreateStandalonegateway extends common_1.Com
|
|
|
56
49
|
flags: '-p, --packageVersion <packageVersion>',
|
|
57
50
|
desc: (0, i18n_1.t)('套餐版本')
|
|
58
51
|
}
|
|
59
|
-
],
|
|
52
|
+
],
|
|
53
|
+
desc: (0, i18n_1.t)('创建小租户网关')
|
|
54
|
+
};
|
|
60
55
|
}
|
|
61
|
-
execute(envId, options) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
packageVersion
|
|
89
|
-
});
|
|
90
|
-
loading.stop();
|
|
91
|
-
console.log((0, i18n_1.t)('操作执行成功,网关名称:{{name}}', { name: data }));
|
|
56
|
+
async execute(envId, options) {
|
|
57
|
+
let { gatewayAlias = '', gatewayDesc = '', vpcId = '', subnetIds = [], packageVersion = '' } = options;
|
|
58
|
+
gatewayAlias = String(gatewayAlias);
|
|
59
|
+
gatewayDesc = String(gatewayDesc);
|
|
60
|
+
vpcId = String(vpcId);
|
|
61
|
+
packageVersion = String(packageVersion);
|
|
62
|
+
if (vpcId === '') {
|
|
63
|
+
throw new error_1.CloudBaseError((0, i18n_1.t)('请输入 VPC'));
|
|
64
|
+
}
|
|
65
|
+
if (subnetIds.length === 0) {
|
|
66
|
+
throw new error_1.CloudBaseError((0, i18n_1.t)('请输入子网列表'));
|
|
67
|
+
}
|
|
68
|
+
if (gatewayDesc === '') {
|
|
69
|
+
throw new error_1.CloudBaseError((0, i18n_1.t)('请输入网关描述'));
|
|
70
|
+
}
|
|
71
|
+
if (packageVersion === '') {
|
|
72
|
+
throw new error_1.CloudBaseError((0, i18n_1.t)('请输入套餐版本'));
|
|
73
|
+
}
|
|
74
|
+
const loading = (0, toolbox_1.loadingFactory)();
|
|
75
|
+
loading.start((0, i18n_1.t)('数据加载中...'));
|
|
76
|
+
const data = await (0, run_1.createStandaloneGateway)({
|
|
77
|
+
envId,
|
|
78
|
+
gatewayAlias,
|
|
79
|
+
gatewayDesc,
|
|
80
|
+
vpcId,
|
|
81
|
+
subnetIds,
|
|
82
|
+
packageVersion
|
|
92
83
|
});
|
|
84
|
+
loading.stop();
|
|
85
|
+
console.log((0, i18n_1.t)('操作执行成功,网关名称:{{name}}', { name: data }));
|
|
93
86
|
}
|
|
94
87
|
};
|
|
95
88
|
__decorate([
|
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
15
|
exports.DestroyStandalonegateway = void 0;
|
|
25
16
|
const common_1 = require("../../common");
|
|
@@ -31,7 +22,9 @@ const error_1 = require("../../../error");
|
|
|
31
22
|
const i18n_1 = require("../../../i18n");
|
|
32
23
|
let DestroyStandalonegateway = class DestroyStandalonegateway extends common_1.Command {
|
|
33
24
|
get options() {
|
|
34
|
-
return
|
|
25
|
+
return {
|
|
26
|
+
...(0, common_2.standalonegatewayCommonOptions)('destroy'),
|
|
27
|
+
options: [
|
|
35
28
|
{
|
|
36
29
|
flags: '-e, --envId <envId>',
|
|
37
30
|
desc: (0, i18n_1.t)('环境 Id')
|
|
@@ -44,28 +37,28 @@ let DestroyStandalonegateway = class DestroyStandalonegateway extends common_1.C
|
|
|
44
37
|
flags: '--isForce',
|
|
45
38
|
desc: (0, i18n_1.t)('强制确认删除资源')
|
|
46
39
|
}
|
|
47
|
-
],
|
|
40
|
+
],
|
|
41
|
+
desc: (0, i18n_1.t)('销毁小租户网关')
|
|
42
|
+
};
|
|
48
43
|
}
|
|
49
|
-
execute(envId, options) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
gatewayName
|
|
65
|
-
});
|
|
66
|
-
loading.stop();
|
|
67
|
-
console.log((0, i18n_1.t)('网关已销毁'));
|
|
44
|
+
async execute(envId, options) {
|
|
45
|
+
let { isForce = false, gatewayName = '' } = options;
|
|
46
|
+
isForce = Boolean(isForce);
|
|
47
|
+
gatewayName = String(gatewayName);
|
|
48
|
+
if (gatewayName === '') {
|
|
49
|
+
throw new error_1.CloudBaseError((0, i18n_1.t)('请输入网关名称'));
|
|
50
|
+
}
|
|
51
|
+
if (!isForce) {
|
|
52
|
+
throw new error_1.CloudBaseError((0, i18n_1.t)('请使用 --isForce 选项确认销毁资源!'));
|
|
53
|
+
}
|
|
54
|
+
const loading = (0, toolbox_1.loadingFactory)();
|
|
55
|
+
loading.start((0, i18n_1.t)('数据加载中...'));
|
|
56
|
+
await (0, run_1.destroyStandalonegateway)({
|
|
57
|
+
envId,
|
|
58
|
+
gatewayName
|
|
68
59
|
});
|
|
60
|
+
loading.stop();
|
|
61
|
+
console.log((0, i18n_1.t)('网关已销毁'));
|
|
69
62
|
}
|
|
70
63
|
};
|
|
71
64
|
__decorate([
|
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
15
|
exports.ListStandalonegateway = void 0;
|
|
25
16
|
const common_1 = require("../../common");
|
|
@@ -31,7 +22,9 @@ const utils_1 = require("../../../utils");
|
|
|
31
22
|
const i18n_1 = require("../../../i18n");
|
|
32
23
|
let ListStandalonegateway = class ListStandalonegateway extends common_1.Command {
|
|
33
24
|
get options() {
|
|
34
|
-
return
|
|
25
|
+
return {
|
|
26
|
+
...(0, common_2.standalonegatewayCommonOptions)('list'),
|
|
27
|
+
options: [
|
|
35
28
|
{
|
|
36
29
|
flags: '-e, --envId <envId>',
|
|
37
30
|
desc: (0, i18n_1.t)('环境 Id')
|
|
@@ -44,24 +37,24 @@ let ListStandalonegateway = class ListStandalonegateway extends common_1.Command
|
|
|
44
37
|
flags: '-gA, --gatewayAlias <gatewayAlias>',
|
|
45
38
|
desc: (0, i18n_1.t)('网关 alias')
|
|
46
39
|
}
|
|
47
|
-
],
|
|
40
|
+
],
|
|
41
|
+
desc: (0, i18n_1.t)('查询小租户网关')
|
|
42
|
+
};
|
|
48
43
|
}
|
|
49
|
-
execute(envId, options) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
gatewayAlias
|
|
60
|
-
});
|
|
61
|
-
loading.stop();
|
|
62
|
-
const head = [(0, i18n_1.t)('名称'), (0, i18n_1.t)('状态'), (0, i18n_1.t)('别名'), (0, i18n_1.t)('套餐版本'), (0, i18n_1.t)('子网'), (0, i18n_1.t)('外网IP'), (0, i18n_1.t)('内网IP'), (0, i18n_1.t)('服务信息')];
|
|
63
|
-
(0, utils_1.printHorizontalTable)(head, data);
|
|
44
|
+
async execute(envId, options) {
|
|
45
|
+
let { gatewayName = '', gatewayAlias = '' } = options;
|
|
46
|
+
gatewayName = String(gatewayName);
|
|
47
|
+
gatewayAlias = String(gatewayAlias);
|
|
48
|
+
const loading = (0, toolbox_1.loadingFactory)();
|
|
49
|
+
loading.start((0, i18n_1.t)('数据加载中...'));
|
|
50
|
+
const data = await (0, standalonegateway_1.listStandalonegateway)({
|
|
51
|
+
envId,
|
|
52
|
+
gatewayName,
|
|
53
|
+
gatewayAlias
|
|
64
54
|
});
|
|
55
|
+
loading.stop();
|
|
56
|
+
const head = [(0, i18n_1.t)('名称'), (0, i18n_1.t)('状态'), (0, i18n_1.t)('别名'), (0, i18n_1.t)('套餐版本'), (0, i18n_1.t)('子网'), (0, i18n_1.t)('外网IP'), (0, i18n_1.t)('内网IP'), (0, i18n_1.t)('服务信息')];
|
|
57
|
+
(0, utils_1.printHorizontalTable)(head, data);
|
|
65
58
|
}
|
|
66
59
|
};
|
|
67
60
|
__decorate([
|