@cloudbase/cli 2.10.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
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.deleteVersion = void 0;
|
|
13
4
|
const utils_1 = require("../../utils");
|
|
14
5
|
const tcbService = utils_1.CloudApiService.getInstance('tcb');
|
|
15
|
-
const deleteVersion = (options) =>
|
|
16
|
-
const { Result } =
|
|
6
|
+
const deleteVersion = async (options) => {
|
|
7
|
+
const { Result } = await tcbService.request('DeleteCloudBaseRunServerVersion', {
|
|
17
8
|
EnvId: options.envId,
|
|
18
9
|
ServerName: options.serverName,
|
|
19
10
|
VersionName: options.versionName
|
|
20
11
|
});
|
|
21
12
|
return Result;
|
|
22
|
-
}
|
|
13
|
+
};
|
|
23
14
|
exports.deleteVersion = deleteVersion;
|
package/lib/run/version/list.js
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.listVersion = void 0;
|
|
13
4
|
const utils_1 = require("../../utils");
|
|
14
5
|
const tcbService = utils_1.CloudApiService.getInstance('tcb');
|
|
15
|
-
const listVersion = (options) =>
|
|
16
|
-
const { VersionItems } =
|
|
6
|
+
const listVersion = async (options) => {
|
|
7
|
+
const { VersionItems } = await tcbService.request('DescribeCloudBaseRunServer', {
|
|
17
8
|
EnvId: options.envId,
|
|
18
9
|
Limit: options.limit ? options.limit : 100,
|
|
19
10
|
Offset: options.offset ? options.offset : 0,
|
|
20
11
|
ServerName: options.serverName
|
|
21
12
|
});
|
|
22
13
|
return VersionItems;
|
|
23
|
-
}
|
|
14
|
+
};
|
|
24
15
|
exports.listVersion = listVersion;
|
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.modifyVersion = void 0;
|
|
13
4
|
const utils_1 = require("../../utils");
|
|
14
5
|
const tcbService = utils_1.CloudApiService.getInstance('tcb');
|
|
15
|
-
const modifyVersion = (options) =>
|
|
16
|
-
const { Result } =
|
|
6
|
+
const modifyVersion = async (options) => {
|
|
7
|
+
const { Result } = await tcbService.request('ModifyCloudBaseRunServerFlowConf', {
|
|
17
8
|
EnvId: options.envId,
|
|
18
9
|
ServerName: options.serverName,
|
|
19
10
|
TrafficType: options.trafficType,
|
|
20
11
|
VersionFlowItems: options.versionFlowItems
|
|
21
12
|
});
|
|
22
13
|
return Result;
|
|
23
|
-
}
|
|
14
|
+
};
|
|
24
15
|
exports.modifyVersion = modifyVersion;
|
package/lib/run/version/repo.js
CHANGED
|
@@ -1,33 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.listBranch = exports.listRepo = void 0;
|
|
13
4
|
const utils_1 = require("../../utils");
|
|
14
5
|
const tcbService = utils_1.CloudApiService.getInstance('tcb');
|
|
15
|
-
const listRepo = (options) =>
|
|
16
|
-
const { IsFinished, RepoList, Error } =
|
|
6
|
+
const listRepo = async (options) => {
|
|
7
|
+
const { IsFinished, RepoList, Error } = await tcbService.request('DescribeCloudBaseCodeRepos', {
|
|
17
8
|
Channel: options.channel,
|
|
18
9
|
PageNumber: options.pageNumber,
|
|
19
10
|
PageSize: options.pageSize
|
|
20
11
|
});
|
|
21
12
|
return { IsFinished, RepoList, Error };
|
|
22
|
-
}
|
|
13
|
+
};
|
|
23
14
|
exports.listRepo = listRepo;
|
|
24
|
-
const listBranch = (options) =>
|
|
25
|
-
const { IsFinished, BranchList } =
|
|
15
|
+
const listBranch = async (options) => {
|
|
16
|
+
const { IsFinished, BranchList } = await tcbService.request('DescribeCloudBaseCodeBranch', {
|
|
26
17
|
Channel: options.channel,
|
|
27
18
|
PageNumber: options.pageNumber,
|
|
28
19
|
PageSize: options.pageSize,
|
|
29
20
|
RepoName: options.repoName
|
|
30
21
|
});
|
|
31
22
|
return { IsFinished, BranchList };
|
|
32
|
-
}
|
|
23
|
+
};
|
|
33
24
|
exports.listBranch = listBranch;
|
|
@@ -1,39 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.describeRunVersion = exports.updateVersion = void 0;
|
|
13
4
|
const utils_1 = require("../../utils");
|
|
14
5
|
const tcbService = utils_1.CloudApiService.getInstance('tcb');
|
|
15
|
-
const updateVersion = (options) =>
|
|
16
|
-
const { Result, RunId } =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
6
|
+
const updateVersion = async (options) => {
|
|
7
|
+
const { Result, RunId } = await tcbService.request('RollUpdateCloudBaseRunServerVersion', {
|
|
8
|
+
EnvId: options.envId,
|
|
9
|
+
ServerName: options.serverName,
|
|
10
|
+
VersionName: options.versionName,
|
|
11
|
+
ContainerPort: options.containerPort,
|
|
12
|
+
UploadType: options.uploadType,
|
|
13
|
+
FlowRatio: options.flowRatio,
|
|
14
|
+
VersionRemark: options.versionRemark,
|
|
15
|
+
EnableUnion: options.enableUnion,
|
|
16
|
+
Cpu: String(options.cpu),
|
|
17
|
+
Mem: String(options.mem),
|
|
18
|
+
MinNum: String(options.minNum),
|
|
19
|
+
MaxNum: String(options.maxNum),
|
|
20
|
+
PolicyType: options.policyType,
|
|
21
|
+
PolicyThreshold: String(options.policyThreshold),
|
|
22
|
+
...(options.uploadType !== 'image' ? { DockerfilePath: options.dockerfilePath } : {}),
|
|
23
|
+
CustomLogs: options.customLogs,
|
|
24
|
+
EnvParams: options.envParams,
|
|
25
|
+
InitialDelaySeconds: options.initialDelaySeconds,
|
|
26
|
+
...(options.uploadType === 'package' ? {
|
|
27
|
+
PackageName: options.packageName,
|
|
28
|
+
PackageVersion: options.packageVersion,
|
|
29
|
+
DockerfilePath: options.dockerfilePath
|
|
30
|
+
} : options.uploadType === 'image' ? {
|
|
31
|
+
ImageInfo: options.imageInfo
|
|
32
|
+
} : {
|
|
33
|
+
RepositoryType: options.repositoryType,
|
|
34
|
+
Branch: options.branch,
|
|
35
|
+
CodeDetail: options.codeDetail,
|
|
36
|
+
DockerfilePath: options.dockerfilePath
|
|
37
|
+
})
|
|
38
|
+
});
|
|
28
39
|
return { Result, RunId };
|
|
29
|
-
}
|
|
40
|
+
};
|
|
30
41
|
exports.updateVersion = updateVersion;
|
|
31
|
-
const describeRunVersion = (options) =>
|
|
32
|
-
const res =
|
|
42
|
+
const describeRunVersion = async (options) => {
|
|
43
|
+
const res = await tcbService.request('DescribeCloudBaseRunServerVersion', {
|
|
33
44
|
EnvId: options.envId,
|
|
34
45
|
ServerName: options.serverName,
|
|
35
46
|
VersionName: options.versionName
|
|
36
47
|
});
|
|
37
48
|
return res;
|
|
38
|
-
}
|
|
49
|
+
};
|
|
39
50
|
exports.describeRunVersion = describeRunVersion;
|
package/lib/storage.js
CHANGED
|
@@ -1,125 +1,94 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.setAcl = exports.getAcl = exports.detail = exports.getUrl = exports.list = exports.deleteDirectory = exports.deleteFile = exports.downloadDirectory = exports.downloadFile = exports.uploadDirectory = exports.uploadFile = void 0;
|
|
13
4
|
const utils_1 = require("./utils");
|
|
14
5
|
const error_1 = require("./error");
|
|
15
6
|
const i18n_1 = require("./i18n");
|
|
16
|
-
function uploadFile(options) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
cloudPath
|
|
23
|
-
});
|
|
7
|
+
async function uploadFile(options) {
|
|
8
|
+
const { envId, localPath, cloudPath } = options;
|
|
9
|
+
const storageService = await (0, utils_1.getStorageService)(envId);
|
|
10
|
+
return storageService.uploadFile({
|
|
11
|
+
localPath,
|
|
12
|
+
cloudPath
|
|
24
13
|
});
|
|
25
14
|
}
|
|
26
15
|
exports.uploadFile = uploadFile;
|
|
27
|
-
function uploadDirectory(options) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
parallel
|
|
37
|
-
});
|
|
16
|
+
async function uploadDirectory(options) {
|
|
17
|
+
const { envId, localPath, cloudPath, retryInterval, parallel, retryCount } = options;
|
|
18
|
+
const storageService = await (0, utils_1.getStorageService)(envId);
|
|
19
|
+
return storageService.uploadDirectory({
|
|
20
|
+
localPath,
|
|
21
|
+
cloudPath,
|
|
22
|
+
retryInterval,
|
|
23
|
+
retryCount,
|
|
24
|
+
parallel
|
|
38
25
|
});
|
|
39
26
|
}
|
|
40
27
|
exports.uploadDirectory = uploadDirectory;
|
|
41
|
-
function downloadFile(options) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
localPath
|
|
48
|
-
});
|
|
28
|
+
async function downloadFile(options) {
|
|
29
|
+
const { envId, localPath, cloudPath } = options;
|
|
30
|
+
const storageService = await (0, utils_1.getStorageService)(envId);
|
|
31
|
+
return storageService.downloadFile({
|
|
32
|
+
cloudPath,
|
|
33
|
+
localPath
|
|
49
34
|
});
|
|
50
35
|
}
|
|
51
36
|
exports.downloadFile = downloadFile;
|
|
52
|
-
function downloadDirectory(options) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
localPath
|
|
59
|
-
});
|
|
37
|
+
async function downloadDirectory(options) {
|
|
38
|
+
const { envId, localPath, cloudPath } = options;
|
|
39
|
+
const storageService = await (0, utils_1.getStorageService)(envId);
|
|
40
|
+
return storageService.downloadDirectory({
|
|
41
|
+
cloudPath,
|
|
42
|
+
localPath
|
|
60
43
|
});
|
|
61
44
|
}
|
|
62
45
|
exports.downloadDirectory = downloadDirectory;
|
|
63
|
-
function deleteFile(options) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return storageService.deleteFile([cloudPath]);
|
|
71
|
-
});
|
|
46
|
+
async function deleteFile(options) {
|
|
47
|
+
const { envId, cloudPath, cloudPaths } = options;
|
|
48
|
+
const storageService = await (0, utils_1.getStorageService)(envId);
|
|
49
|
+
if (cloudPaths === null || cloudPaths === void 0 ? void 0 : cloudPaths.length) {
|
|
50
|
+
return storageService.deleteFile(cloudPaths);
|
|
51
|
+
}
|
|
52
|
+
return storageService.deleteFile([cloudPath]);
|
|
72
53
|
}
|
|
73
54
|
exports.deleteFile = deleteFile;
|
|
74
|
-
function deleteDirectory(options) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return storageService.deleteDirectory(cloudPath);
|
|
79
|
-
});
|
|
55
|
+
async function deleteDirectory(options) {
|
|
56
|
+
const { envId, cloudPath } = options;
|
|
57
|
+
const storageService = await (0, utils_1.getStorageService)(envId);
|
|
58
|
+
return storageService.deleteDirectory(cloudPath);
|
|
80
59
|
}
|
|
81
60
|
exports.deleteDirectory = deleteDirectory;
|
|
82
|
-
function list(options) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return storageService.listDirectoryFiles(cloudPath);
|
|
87
|
-
});
|
|
61
|
+
async function list(options) {
|
|
62
|
+
const { envId, cloudPath } = options;
|
|
63
|
+
const storageService = await (0, utils_1.getStorageService)(envId);
|
|
64
|
+
return storageService.listDirectoryFiles(cloudPath);
|
|
88
65
|
}
|
|
89
66
|
exports.list = list;
|
|
90
|
-
function getUrl(options) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return storageService.getTemporaryUrl(cloudPaths);
|
|
95
|
-
});
|
|
67
|
+
async function getUrl(options) {
|
|
68
|
+
const { envId, cloudPaths } = options;
|
|
69
|
+
const storageService = await (0, utils_1.getStorageService)(envId);
|
|
70
|
+
return storageService.getTemporaryUrl(cloudPaths);
|
|
96
71
|
}
|
|
97
72
|
exports.getUrl = getUrl;
|
|
98
|
-
function detail(options) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return storageService.getFileInfo(cloudPath);
|
|
103
|
-
});
|
|
73
|
+
async function detail(options) {
|
|
74
|
+
const { envId, cloudPath } = options;
|
|
75
|
+
const storageService = await (0, utils_1.getStorageService)(envId);
|
|
76
|
+
return storageService.getFileInfo(cloudPath);
|
|
104
77
|
}
|
|
105
78
|
exports.detail = detail;
|
|
106
|
-
function getAcl(options) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return storageService.getStorageAcl();
|
|
111
|
-
});
|
|
79
|
+
async function getAcl(options) {
|
|
80
|
+
const { envId } = options;
|
|
81
|
+
const storageService = await (0, utils_1.getStorageService)(envId);
|
|
82
|
+
return storageService.getStorageAcl();
|
|
112
83
|
}
|
|
113
84
|
exports.getAcl = getAcl;
|
|
114
|
-
function setAcl(options) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return storageService.setStorageAcl(acl);
|
|
123
|
-
});
|
|
85
|
+
async function setAcl(options) {
|
|
86
|
+
const { envId, acl } = options;
|
|
87
|
+
const validAcl = ['READONLY', 'PRIVATE', 'ADMINWRITE', 'ADMINONLY'];
|
|
88
|
+
if (!validAcl.includes(acl)) {
|
|
89
|
+
throw new error_1.CloudBaseError((0, i18n_1.t)('非法的权限值,仅支持:READONLY, PRIVATE, ADMINWRITE, ADMINONLY'));
|
|
90
|
+
}
|
|
91
|
+
const storageService = await (0, utils_1.getStorageService)(envId);
|
|
92
|
+
return storageService.setStorageAcl(acl);
|
|
124
93
|
}
|
|
125
94
|
exports.setAcl = setAcl;
|
package/lib/third/index.js
CHANGED
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.deleteThirdPartAttach = void 0;
|
|
13
4
|
const utils_1 = require("../utils");
|
|
14
5
|
const tcbService = utils_1.CloudApiService.getInstance('tcb');
|
|
15
|
-
function deleteThirdPartAttach(options) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
TypeFlag
|
|
21
|
-
});
|
|
22
|
-
return res;
|
|
6
|
+
async function deleteThirdPartAttach(options) {
|
|
7
|
+
const { ThirdPartAppid, TypeFlag } = options;
|
|
8
|
+
const res = await tcbService.request('DeleteThirdPartAttach', {
|
|
9
|
+
ThirdPartAppid,
|
|
10
|
+
TypeFlag
|
|
23
11
|
});
|
|
12
|
+
return res;
|
|
24
13
|
}
|
|
25
14
|
exports.deleteThirdPartAttach = deleteThirdPartAttach;
|
package/lib/utils/ai/banner.js
CHANGED
|
@@ -22,15 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
27
|
};
|
|
@@ -39,64 +30,62 @@ exports.showBanner = void 0;
|
|
|
39
30
|
const chalk_1 = __importDefault(require("chalk"));
|
|
40
31
|
const output_1 = require("../output");
|
|
41
32
|
const i18n_1 = require("../../i18n");
|
|
42
|
-
function showBanner(log) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const data = figlet.textSync(`CloudBase
|
|
33
|
+
async function showBanner(log) {
|
|
34
|
+
try {
|
|
35
|
+
const figlet = await Promise.resolve().then(() => __importStar(require('figlet')));
|
|
36
|
+
const data = figlet.textSync(`CloudBase
|
|
47
37
|
AI ToolKit`, {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
catch (gradientError) {
|
|
62
|
-
log.log(chalk_1.default.bold.cyan(data + '\n'));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
log.log(data + '\n');
|
|
38
|
+
font: 'Slant',
|
|
39
|
+
horizontalLayout: 'fitted',
|
|
40
|
+
verticalLayout: 'fitted'
|
|
41
|
+
});
|
|
42
|
+
const supportsColor = process.stdout.isTTY && process.env.TERM !== 'dumb';
|
|
43
|
+
if (supportsColor) {
|
|
44
|
+
try {
|
|
45
|
+
const gradient = await Promise.resolve().then(() => __importStar(require('gradient-string')));
|
|
46
|
+
const gradientText = gradient
|
|
47
|
+
.default(['cyan', 'rgb(0, 111, 150)', 'rgb(0, 246,136)'])
|
|
48
|
+
.multiline(data);
|
|
49
|
+
log.log(chalk_1.default.bold(gradientText + '\n'));
|
|
67
50
|
}
|
|
68
|
-
|
|
69
|
-
log.log(chalk_1.default.
|
|
70
|
-
log.log(chalk_1.default.hex('#34495E')(` ${(0, i18n_1.t)('⚡ 生成、部署和托管全栈 Web 应用与小程序、数据库和后端服务')}`));
|
|
71
|
-
log.log(chalk_1.default.hex('#34495E')(` ${(0, i18n_1.t)('🎯 无需运维,极速上线你的创意 💫')}`));
|
|
51
|
+
catch (gradientError) {
|
|
52
|
+
log.log(chalk_1.default.bold.cyan(data + '\n'));
|
|
72
53
|
}
|
|
73
|
-
else {
|
|
74
|
-
log.log(` ${(0, i18n_1.t)('🚀 统一集成各种 AI CLI 工具,内置云开发全栈能力')}`);
|
|
75
|
-
log.log(` ${(0, i18n_1.t)('⚡ 生成、部署和托管全栈 Web 应用与小程序、数据库和后端服务')}`);
|
|
76
|
-
log.log(` ${(0, i18n_1.t)('🎯 无需运维,极速上线你的创意 💫')}`);
|
|
77
|
-
}
|
|
78
|
-
log.log('');
|
|
79
|
-
log.log('Github:');
|
|
80
|
-
log.log((0, output_1.genClickableLink)('https://github.com/TencentCloudBase/CloudBase-AI-ToolKit'));
|
|
81
|
-
log.log('');
|
|
82
|
-
log.log((0, i18n_1.t)('使用指引'));
|
|
83
|
-
log.log((0, output_1.genClickableLink)('https://docs.cloudbase.net/cli-v1/ai/introduce'));
|
|
84
|
-
log.log('');
|
|
85
54
|
}
|
|
86
|
-
|
|
87
|
-
log.log(
|
|
88
|
-
|
|
55
|
+
else {
|
|
56
|
+
log.log(data + '\n');
|
|
57
|
+
}
|
|
58
|
+
if (supportsColor) {
|
|
89
59
|
log.log(chalk_1.default.hex('#34495E')(` ${(0, i18n_1.t)('🚀 统一集成各种 AI CLI 工具,内置云开发全栈能力')}`));
|
|
90
60
|
log.log(chalk_1.default.hex('#34495E')(` ${(0, i18n_1.t)('⚡ 生成、部署和托管全栈 Web 应用与小程序、数据库和后端服务')}`));
|
|
91
61
|
log.log(chalk_1.default.hex('#34495E')(` ${(0, i18n_1.t)('🎯 无需运维,极速上线你的创意 💫')}`));
|
|
92
|
-
log.log('');
|
|
93
|
-
log.log('Github:');
|
|
94
|
-
log.log((0, output_1.genClickableLink)('https://github.com/TencentCloudBase/CloudBase-AI-ToolKit'));
|
|
95
|
-
log.log('');
|
|
96
|
-
log.log((0, i18n_1.t)('使用指引'));
|
|
97
|
-
log.log((0, output_1.genClickableLink)('https://docs.cloudbase.net/cli-v1/ai/introduce'));
|
|
98
|
-
log.log('');
|
|
99
62
|
}
|
|
100
|
-
|
|
63
|
+
else {
|
|
64
|
+
log.log(` ${(0, i18n_1.t)('🚀 统一集成各种 AI CLI 工具,内置云开发全栈能力')}`);
|
|
65
|
+
log.log(` ${(0, i18n_1.t)('⚡ 生成、部署和托管全栈 Web 应用与小程序、数据库和后端服务')}`);
|
|
66
|
+
log.log(` ${(0, i18n_1.t)('🎯 无需运维,极速上线你的创意 💫')}`);
|
|
67
|
+
}
|
|
68
|
+
log.log('');
|
|
69
|
+
log.log('Github:');
|
|
70
|
+
log.log((0, output_1.genClickableLink)('https://github.com/TencentCloudBase/CloudBase-AI-ToolKit'));
|
|
71
|
+
log.log('');
|
|
72
|
+
log.log((0, i18n_1.t)('使用指引'));
|
|
73
|
+
log.log((0, output_1.genClickableLink)('https://docs.cloudbase.net/cli-v1/ai/introduce'));
|
|
74
|
+
log.log('');
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
log.log(chalk_1.default.bold.cyanBright('⛰︎'), chalk_1.default.bold.hex('#FFFFFF')(' CloudBase AI ToolKit CLI'));
|
|
78
|
+
log.log(chalk_1.default.bold.cyanBright(''));
|
|
79
|
+
log.log(chalk_1.default.hex('#34495E')(` ${(0, i18n_1.t)('🚀 统一集成各种 AI CLI 工具,内置云开发全栈能力')}`));
|
|
80
|
+
log.log(chalk_1.default.hex('#34495E')(` ${(0, i18n_1.t)('⚡ 生成、部署和托管全栈 Web 应用与小程序、数据库和后端服务')}`));
|
|
81
|
+
log.log(chalk_1.default.hex('#34495E')(` ${(0, i18n_1.t)('🎯 无需运维,极速上线你的创意 💫')}`));
|
|
82
|
+
log.log('');
|
|
83
|
+
log.log('Github:');
|
|
84
|
+
log.log((0, output_1.genClickableLink)('https://github.com/TencentCloudBase/CloudBase-AI-ToolKit'));
|
|
85
|
+
log.log('');
|
|
86
|
+
log.log((0, i18n_1.t)('使用指引'));
|
|
87
|
+
log.log((0, output_1.genClickableLink)('https://docs.cloudbase.net/cli-v1/ai/introduce'));
|
|
88
|
+
log.log('');
|
|
89
|
+
}
|
|
101
90
|
}
|
|
102
91
|
exports.showBanner = showBanner;
|
|
@@ -39,7 +39,7 @@ function pathExistsOnWindows(targetPath) {
|
|
|
39
39
|
try {
|
|
40
40
|
return (0, child_process_1.execSync)(`dir "${targetPath}"`, { stdio: 'pipe' });
|
|
41
41
|
}
|
|
42
|
-
catch
|
|
42
|
+
catch {
|
|
43
43
|
return !1;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -58,7 +58,7 @@ function resolveWindowsExecutablePath(executableName) {
|
|
|
58
58
|
.split(`\r
|
|
59
59
|
`)[0] || null);
|
|
60
60
|
}
|
|
61
|
-
catch
|
|
61
|
+
catch {
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
64
|
}
|