@cloudbase/cli 2.0.12 → 2.1.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/.history/.gitignore_20220624162613 +84 -0
- package/.history/.gitignore_20220627114054 +86 -0
- package/.history/package_20220711204706.json +88 -0
- package/.history/package_20220711204818.json +88 -0
- package/.history/package_20220712151717.json +88 -0
- package/.history/package_20220712212537.json +88 -0
- package/.history/package_20220722205058.json +88 -0
- package/.history/package_20220726110155.json +88 -0
- package/.history/package_20220726110201.json +88 -0
- package/.history/package_20220728110905.json +88 -0
- package/.history/package_20220728110936.json +88 -0
- package/.history/package_20220728111531.json +89 -0
- package/.history/package_20220728111810.json +89 -0
- package/.history/src/commands/lowcode/app_20220728111717.ts +52 -0
- package/{src/commands/lowcode/app.ts → .history/src/commands/lowcode/app_20220728112031.ts} +2 -2
- package/{src/index.ts → .history/src/index_20220624162613.ts} +0 -0
- package/.history/src/index_20220627113609.ts +15 -0
- package/.history/src/index_20220627114102.ts +13 -0
- package/.vscode/launch.json +10 -0
- package/bin/cloudbase.js +0 -0
- package/bin/tcb.js +5 -5
- package/lib/commands/account/login.js +3 -6
- package/lib/commands/env/index.js +0 -1
- package/lib/commands/lowcode/app.js +1 -1
- package/lib/commands/run/index.js +0 -1
- package/lib/commands/run/service/deploy.js +6 -1
- package/lib/commands/run/service/index.js +0 -1
- package/lib/commands/run/service/update.js +4 -0
- package/lib/constant.js +15 -1
- package/lib/env/index.js +1 -11
- package/lib/run/index.js +0 -1
- package/lib/run/service/common.js +20 -7
- package/lib/run/service/config.js +2 -3
- package/lib/run/service/deployPackage.js +2 -9
- package/lib/run/service/index.js +0 -1
- package/lib/run/service/update.js +1 -1
- package/lib/utils/debug-logger.js +30 -0
- package/lib/utils/net/cloud-api-request.js +7 -1
- package/lib/utils/net/http-request.js +16 -5
- package/package.json +2 -2
- package/types/commands/env/index.d.ts +0 -1
- package/types/commands/run/index.d.ts +0 -1
- package/types/commands/run/service/index.d.ts +0 -1
- package/types/env/index.d.ts +0 -6
- package/types/run/index.d.ts +0 -1
- package/types/run/service/common.d.ts +8 -1
- package/types/run/service/index.d.ts +0 -1
- package/types/types.d.ts +4 -0
- package/types/utils/debug-logger.d.ts +1 -0
- package/types/utils/net/http-request.d.ts +6 -2
- package/lib/commands/env/create.js +0 -115
- package/lib/commands/run/create.js +0 -162
- package/lib/commands/run/service/create.js +0 -144
- package/lib/run/create.js +0 -19
- package/lib/run/service/create.js +0 -67
- package/src/auth/index.ts +0 -2
- package/src/auth/login.ts +0 -91
- package/src/auth/logout.ts +0 -7
- package/src/commands/account/index.ts +0 -2
- package/src/commands/account/login.ts +0 -192
- package/src/commands/account/logout.ts +0 -24
- package/src/commands/common.ts +0 -246
- package/src/commands/env/base.ts +0 -90
- package/src/commands/env/create.ts +0 -92
- package/src/commands/env/domain.ts +0 -186
- package/src/commands/env/index.ts +0 -4
- package/src/commands/env/login.ts +0 -235
- package/src/commands/framework/index.ts +0 -124
- package/src/commands/functions/alias/getRoute.ts +0 -76
- package/src/commands/functions/alias/index.ts +0 -2
- package/src/commands/functions/alias/setRoute.ts +0 -82
- package/src/commands/functions/code-download.ts +0 -100
- package/src/commands/functions/code-update.ts +0 -62
- package/src/commands/functions/concurrency/delete.ts +0 -45
- package/src/commands/functions/concurrency/index.ts +0 -3
- package/src/commands/functions/concurrency/list.ts +0 -58
- package/src/commands/functions/concurrency/set.ts +0 -47
- package/src/commands/functions/config-update.ts +0 -76
- package/src/commands/functions/copy.ts +0 -62
- package/src/commands/functions/delete.ts +0 -79
- package/src/commands/functions/deploy.ts +0 -293
- package/src/commands/functions/detail.ts +0 -138
- package/src/commands/functions/index.ts +0 -16
- package/src/commands/functions/invoke.ts +0 -121
- package/src/commands/functions/layer/bind.ts +0 -182
- package/src/commands/functions/layer/common.ts +0 -8
- package/src/commands/functions/layer/create.ts +0 -49
- package/src/commands/functions/layer/delete.ts +0 -73
- package/src/commands/functions/layer/download.ts +0 -92
- package/src/commands/functions/layer/index.ts +0 -7
- package/src/commands/functions/layer/list.ts +0 -94
- package/src/commands/functions/layer/sort.ts +0 -76
- package/src/commands/functions/list.ts +0 -68
- package/src/commands/functions/log.ts +0 -148
- package/src/commands/functions/run.ts +0 -249
- package/src/commands/functions/trigger-create.ts +0 -79
- package/src/commands/functions/trigger-delete.ts +0 -105
- package/src/commands/functions/version/index.ts +0 -2
- package/src/commands/functions/version/list.ts +0 -73
- package/src/commands/functions/version/publish.ts +0 -43
- package/src/commands/gateway/create.ts +0 -109
- package/src/commands/gateway/delete.ts +0 -81
- package/src/commands/gateway/domain.ts +0 -159
- package/src/commands/gateway/index.ts +0 -5
- package/src/commands/gateway/list.ts +0 -76
- package/src/commands/gateway/switch.ts +0 -107
- package/src/commands/helpers/index.ts +0 -3
- package/src/commands/helpers/init.ts +0 -431
- package/src/commands/helpers/new.ts +0 -117
- package/src/commands/helpers/open.ts +0 -67
- package/src/commands/hosting/hosting.ts +0 -360
- package/src/commands/hosting/index.ts +0 -1
- package/src/commands/index.ts +0 -13
- package/src/commands/lowcode/comps.ts +0 -325
- package/src/commands/lowcode/index.ts +0 -2
- package/src/commands/lowcode/utils.ts +0 -25
- package/src/commands/run/create.ts +0 -153
- package/src/commands/run/delete.ts +0 -77
- package/src/commands/run/image/common.ts +0 -8
- package/src/commands/run/image/delete.ts +0 -68
- package/src/commands/run/image/download.ts +0 -68
- package/src/commands/run/image/index.ts +0 -5
- package/src/commands/run/image/list.ts +0 -84
- package/src/commands/run/image/upload.ts +0 -76
- package/src/commands/run/index.ts +0 -7
- package/src/commands/run/list.ts +0 -83
- package/src/commands/run/service/config.ts +0 -81
- package/src/commands/run/service/create.ts +0 -122
- package/src/commands/run/service/deploy.ts +0 -125
- package/src/commands/run/service/index.ts +0 -5
- package/src/commands/run/service/list.ts +0 -94
- package/src/commands/run/service/update.ts +0 -108
- package/src/commands/run/standalonegateway/common.ts +0 -8
- package/src/commands/run/standalonegateway/create.ts +0 -85
- package/src/commands/run/standalonegateway/destroy.ts +0 -59
- package/src/commands/run/standalonegateway/index.ts +0 -5
- package/src/commands/run/standalonegateway/list.ts +0 -53
- package/src/commands/run/standalonegateway/package.ts +0 -62
- package/src/commands/run/standalonegateway/turn.ts +0 -63
- package/src/commands/run/version/common.ts +0 -8
- package/src/commands/run/version/create.ts +0 -369
- package/src/commands/run/version/delete.ts +0 -64
- package/src/commands/run/version/index.ts +0 -5
- package/src/commands/run/version/list.ts +0 -91
- package/src/commands/run/version/modify.ts +0 -137
- package/src/commands/run/version/update.ts +0 -398
- package/src/commands/smart.ts +0 -132
- package/src/commands/storage/index.ts +0 -1
- package/src/commands/storage/storage.ts +0 -464
- package/src/commands/third/index.ts +0 -1
- package/src/commands/third/thirdAttach.ts +0 -49
- package/src/completion/index.ts +0 -13
- package/src/constant.ts +0 -154
- package/src/decorators/captureError.ts +0 -25
- package/src/decorators/constants.ts +0 -12
- package/src/decorators/deprecate.ts +0 -25
- package/src/decorators/guard.ts +0 -42
- package/src/decorators/index.ts +0 -7
- package/src/decorators/injectParams.ts +0 -54
- package/src/decorators/params/common.ts +0 -28
- package/src/decorators/params/index.ts +0 -35
- package/src/env/domain.ts +0 -33
- package/src/env/index.ts +0 -63
- package/src/env/login.ts +0 -80
- package/src/error.ts +0 -36
- package/src/function/alias.ts +0 -43
- package/src/function/base.ts +0 -253
- package/src/function/code.ts +0 -55
- package/src/function/concurrency.ts +0 -57
- package/src/function/create.ts +0 -78
- package/src/function/delete.ts +0 -42
- package/src/function/index.ts +0 -11
- package/src/function/layer/attach.ts +0 -68
- package/src/function/layer/create.ts +0 -63
- package/src/function/layer/delete.ts +0 -21
- package/src/function/layer/download.ts +0 -54
- package/src/function/layer/index.ts +0 -7
- package/src/function/layer/list.ts +0 -32
- package/src/function/layer/sort.ts +0 -24
- package/src/function/trigger.ts +0 -97
- package/src/function/update.ts +0 -35
- package/src/function/version.ts +0 -39
- package/src/function/vpc.ts +0 -22
- package/src/gateway/index.ts +0 -137
- package/src/help.ts +0 -50
- package/src/hosting.ts +0 -212
- package/src/logger.ts +0 -17
- package/src/run/create.ts +0 -23
- package/src/run/delete.ts +0 -15
- package/src/run/image/build.ts +0 -36
- package/src/run/image/delete.ts +0 -14
- package/src/run/image/index.ts +0 -4
- package/src/run/image/info.ts +0 -27
- package/src/run/image/list.ts +0 -23
- package/src/run/index.ts +0 -8
- package/src/run/list.ts +0 -30
- package/src/run/repo.ts +0 -25
- package/src/run/service/common.ts +0 -311
- package/src/run/service/config.ts +0 -77
- package/src/run/service/create.ts +0 -52
- package/src/run/service/deployPackage.ts +0 -65
- package/src/run/service/index.ts +0 -7
- package/src/run/service/list.ts +0 -29
- package/src/run/service/showLogs.ts +0 -98
- package/src/run/service/update.ts +0 -82
- package/src/run/standalonegateway/create.ts +0 -24
- package/src/run/standalonegateway/destroy.ts +0 -19
- package/src/run/standalonegateway/index.ts +0 -5
- package/src/run/standalonegateway/list.ts +0 -74
- package/src/run/standalonegateway/package/index.ts +0 -1
- package/src/run/standalonegateway/package/list.ts +0 -24
- package/src/run/standalonegateway/turn/index.ts +0 -2
- package/src/run/standalonegateway/turn/off.ts +0 -19
- package/src/run/standalonegateway/turn/on.ts +0 -19
- package/src/run/version/create.ts +0 -68
- package/src/run/version/delete.ts +0 -16
- package/src/run/version/index.ts +0 -6
- package/src/run/version/list.ts +0 -17
- package/src/run/version/modify.ts +0 -17
- package/src/run/version/repo.ts +0 -28
- package/src/run/version/update.ts +0 -59
- package/src/storage.ts +0 -114
- package/src/third/index.ts +0 -13
- package/src/types.ts +0 -672
- package/src/utils/auth.ts +0 -15
- package/src/utils/checkTcbrEnv.ts +0 -69
- package/src/utils/cli-table.ts +0 -23
- package/src/utils/commonParamsCheck.ts +0 -65
- package/src/utils/config.ts +0 -39
- package/src/utils/env.ts +0 -244
- package/src/utils/fs/del.ts +0 -5
- package/src/utils/fs/index.ts +0 -71
- package/src/utils/function-packer.ts +0 -97
- package/src/utils/index.ts +0 -25
- package/src/utils/log.ts +0 -82
- package/src/utils/net/cloud-api-request.ts +0 -62
- package/src/utils/net/credential.ts +0 -53
- package/src/utils/net/http-request.ts +0 -84
- package/src/utils/net/index.ts +0 -5
- package/src/utils/net/manager-service.ts +0 -36
- package/src/utils/net/proxy.ts +0 -6
- package/src/utils/notice.ts +0 -28
- package/src/utils/output/highlight.ts +0 -5
- package/src/utils/output/index.ts +0 -3
- package/src/utils/output/link.ts +0 -10
- package/src/utils/output/loading.ts +0 -82
- package/src/utils/parallel.ts +0 -82
- package/src/utils/platform/index.ts +0 -3
- package/src/utils/platform/mac.ts +0 -21
- package/src/utils/platform/os.ts +0 -64
- package/src/utils/platform/port.ts +0 -10
- package/src/utils/progress-bar.ts +0 -38
- package/src/utils/prompt/index.ts +0 -1
- package/src/utils/prompt/select.ts +0 -60
- package/src/utils/reporter/agree.ts +0 -20
- package/src/utils/reporter/download.ts +0 -26
- package/src/utils/reporter/index.ts +0 -3
- package/src/utils/reporter/usage.ts +0 -20
- package/src/utils/store/auth.ts +0 -49
- package/src/utils/store/common.ts +0 -8
- package/src/utils/store/db.ts +0 -68
- package/src/utils/store/index.ts +0 -5
- package/src/utils/store/usage.ts +0 -12
- package/src/utils/tcbrApi/callTcbrApi.ts +0 -28
- package/src/utils/tcbrApi/index.ts +0 -1
- package/src/utils/template.ts +0 -170
- package/src/utils/tools/encoding.ts +0 -8
- package/src/utils/tools/index.ts +0 -4
- package/src/utils/tools/object.ts +0 -33
- package/src/utils/tools/time.ts +0 -38
- package/src/utils/tools/uid.ts +0 -19
- package/src/utils/validator.ts +0 -65
- package/types/commands/env/create.d.ts +0 -12
- package/types/commands/run/create.d.ts +0 -13
- package/types/commands/run/service/create.d.ts +0 -13
- package/types/run/create.d.ts +0 -2
- package/types/run/service/create.d.ts +0 -7
package/bin/tcb.js
CHANGED
|
@@ -84,20 +84,20 @@ if (isCommandEmpty) {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// 处理无效命令
|
|
87
|
-
program.action((
|
|
88
|
-
const args =
|
|
87
|
+
program.action(() => {
|
|
88
|
+
const args = program.args
|
|
89
89
|
if (!Array.isArray(args) || !args.length) {
|
|
90
90
|
return
|
|
91
91
|
}
|
|
92
92
|
const cmd = args.join(' ')
|
|
93
|
-
console.log(chalk.bold.red('Error: ') + `${cmd}
|
|
93
|
+
console.log(chalk.bold.red('Error: ') + `${cmd} 不是有效的命令`)
|
|
94
94
|
didYouMean.threshold = 0.5
|
|
95
95
|
didYouMean.caseSensitive = false
|
|
96
96
|
const suggest = didYouMean(cmd, ALL_COMMANDS)
|
|
97
97
|
if (suggest) {
|
|
98
|
-
console.log(chalk.bold(`\n您是不是想使用命令:
|
|
98
|
+
console.log(chalk.bold(`\n您是不是想使用命令:tcb ${suggest}\n`))
|
|
99
99
|
}
|
|
100
|
-
console.log(
|
|
100
|
+
console.log(`💡使用 ${chalk.bold('tcb -h')} 查看所有命令`)
|
|
101
101
|
})
|
|
102
102
|
|
|
103
103
|
// 没有使用命令
|
|
@@ -37,10 +37,6 @@ const utils_1 = require("../../utils");
|
|
|
37
37
|
function printSuggestion() {
|
|
38
38
|
const tips = `可使用下面命令继续操作:
|
|
39
39
|
|
|
40
|
-
${chalk_1.default.gray('–')} 创建免费环境
|
|
41
|
-
|
|
42
|
-
${chalk_1.default.cyan('$ tcb env create envName')}
|
|
43
|
-
|
|
44
40
|
${chalk_1.default.gray('–')} 初始化云开发项目
|
|
45
41
|
|
|
46
42
|
${chalk_1.default.cyan('$ tcb new')}
|
|
@@ -177,15 +173,16 @@ let LoginCommand = class LoginCommand extends common_1.Command {
|
|
|
177
173
|
return process.exit(1);
|
|
178
174
|
}
|
|
179
175
|
}
|
|
176
|
+
const consoleUrl = 'https://console.cloud.tencent.com/tcb/env/index?action=CreateEnv&from=cli';
|
|
180
177
|
try {
|
|
181
178
|
const envs = yield (0, env_1.listEnvs)();
|
|
182
179
|
if (!envs.length) {
|
|
183
|
-
log.warn(
|
|
180
|
+
log.warn(`您还没有可用的环境,请前往控制台 ${(0, utils_1.genClickableLink)(consoleUrl)} 创建环境`);
|
|
184
181
|
}
|
|
185
182
|
}
|
|
186
183
|
catch (e) {
|
|
187
184
|
if (e.code === 'ResourceNotFound.UserNotExists') {
|
|
188
|
-
log.error(
|
|
185
|
+
log.error(`您还没有可用的环境,请前往控制台 ${(0, utils_1.genClickableLink)(consoleUrl)} 创建环境`);
|
|
189
186
|
}
|
|
190
187
|
else {
|
|
191
188
|
console.error(e);
|
|
@@ -15,6 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./base"), exports);
|
|
18
|
-
__exportStar(require("./create"), exports);
|
|
19
18
|
__exportStar(require("./domain"), exports);
|
|
20
19
|
__exportStar(require("./login"), exports);
|
|
@@ -48,7 +48,7 @@ let LowCodeWatch = class LowCodeWatch extends common_1.Command {
|
|
|
48
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
49
|
yield (0, lowcode_cli_1.watchApp)({
|
|
50
50
|
watchPort: 8288,
|
|
51
|
-
wxDevtoolPath: options === null || options === void 0 ? void 0 : options.wxDevtoolPath
|
|
51
|
+
wxDevtoolPath: options === null || options === void 0 ? void 0 : options.wxDevtoolPath
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
54
|
}
|
|
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./list"), exports);
|
|
18
|
-
__exportStar(require("./create"), exports);
|
|
19
18
|
__exportStar(require("./version"), exports);
|
|
20
19
|
__exportStar(require("./delete"), exports);
|
|
21
20
|
__exportStar(require("./image"), exports);
|
|
@@ -26,6 +26,7 @@ const common_1 = require("../../common");
|
|
|
26
26
|
const decorators_1 = require("../../../decorators");
|
|
27
27
|
const run_1 = require("../../../run");
|
|
28
28
|
const utils_1 = require("../../../utils");
|
|
29
|
+
const toolbox_1 = require("@cloudbase/toolbox");
|
|
29
30
|
let DeployServiceTcbr = class DeployServiceTcbr extends common_1.Command {
|
|
30
31
|
get options() {
|
|
31
32
|
return {
|
|
@@ -80,6 +81,10 @@ let DeployServiceTcbr = class DeployServiceTcbr extends common_1.Command {
|
|
|
80
81
|
flags: '--envParams <envParams>',
|
|
81
82
|
desc: '环境变量,格式为xx=a&yy=b,默认为空'
|
|
82
83
|
},
|
|
84
|
+
{
|
|
85
|
+
flags: '--log_type <log_type>',
|
|
86
|
+
desc: '日志类型,只能为 none,如需自定义日志,请前往控制台配置'
|
|
87
|
+
},
|
|
83
88
|
{
|
|
84
89
|
flags: '--containerPort <containerPort>',
|
|
85
90
|
desc: '监听端口,必填'
|
|
@@ -128,7 +133,7 @@ let DeployServiceTcbr = class DeployServiceTcbr extends common_1.Command {
|
|
|
128
133
|
serviceName: options.serviceName
|
|
129
134
|
});
|
|
130
135
|
if (serviceDetail === undefined) {
|
|
131
|
-
|
|
136
|
+
throw new toolbox_1.CloudBaseError(`当前服务不存在,请前往控制台 ${(0, utils_1.genClickableLink)('https://console.cloud.tencent.com/tcbr')} 创建服务`);
|
|
132
137
|
}
|
|
133
138
|
else {
|
|
134
139
|
yield (0, run_1.updateTcbrService)(options);
|
|
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./list"), exports);
|
|
18
|
-
__exportStar(require("./create"), exports);
|
|
19
18
|
__exportStar(require("./update"), exports);
|
|
20
19
|
__exportStar(require("./deploy"), exports);
|
|
21
20
|
__exportStar(require("./config"), exports);
|
|
@@ -80,6 +80,10 @@ let UpdateServiceTcbr = class UpdateServiceTcbr extends common_1.Command {
|
|
|
80
80
|
flags: '--envParams <envParams>',
|
|
81
81
|
desc: '环境变量,格式为xx=a&yy=b,默认为空'
|
|
82
82
|
},
|
|
83
|
+
{
|
|
84
|
+
flags: '--log_type <log_type>',
|
|
85
|
+
desc: '日志类型,只能为 none,如需自定义日志,请前往控制台配置'
|
|
86
|
+
},
|
|
83
87
|
{
|
|
84
88
|
flags: '--containerPort <containerPort>',
|
|
85
89
|
desc: '监听端口,必填'
|
package/lib/constant.js
CHANGED
|
@@ -32,7 +32,6 @@ exports.ALL_COMMANDS = [
|
|
|
32
32
|
'open',
|
|
33
33
|
'env list',
|
|
34
34
|
'env rename',
|
|
35
|
-
'env create',
|
|
36
35
|
'env domain list',
|
|
37
36
|
'env domain create',
|
|
38
37
|
'env domain delete',
|
|
@@ -82,6 +81,21 @@ exports.ALL_COMMANDS = [
|
|
|
82
81
|
'run standalonegateway package list',
|
|
83
82
|
'run standalonegateway turn on',
|
|
84
83
|
'run standalonegateway turn off',
|
|
84
|
+
'run:deprecated list',
|
|
85
|
+
'run:deprecated delete',
|
|
86
|
+
'run:deprecated version list',
|
|
87
|
+
'run:deprecated version create',
|
|
88
|
+
'run:deprecated version modify',
|
|
89
|
+
'run:deprecated version delete',
|
|
90
|
+
'run:deprecated version update',
|
|
91
|
+
'run:deprecated image list',
|
|
92
|
+
'run:deprecated image upload',
|
|
93
|
+
'run:deprecated image download',
|
|
94
|
+
'run:deprecated image delete',
|
|
95
|
+
'run service:list',
|
|
96
|
+
'run service:deploy',
|
|
97
|
+
'run deploy',
|
|
98
|
+
'run service:config'
|
|
85
99
|
];
|
|
86
100
|
exports.StatusMap = {
|
|
87
101
|
Active: '部署完成',
|
package/lib/env/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getEnvLimit = exports.updateEnvInfo = exports.listEnvs = exports.getEnvInfo = exports.
|
|
26
|
+
exports.getEnvLimit = exports.updateEnvInfo = exports.listEnvs = exports.getEnvInfo = exports.initTcb = void 0;
|
|
27
27
|
const net_1 = require("../utils/net");
|
|
28
28
|
__exportStar(require("./domain"), exports);
|
|
29
29
|
__exportStar(require("./login"), exports);
|
|
@@ -37,16 +37,6 @@ function initTcb(skey) {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
exports.initTcb = initTcb;
|
|
40
|
-
function createEnv({ alias, paymentMode }) {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
const { env } = yield (0, net_1.getMangerService)();
|
|
43
|
-
return env.createEnv({
|
|
44
|
-
paymentMode,
|
|
45
|
-
name: alias
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
exports.createEnv = createEnv;
|
|
50
40
|
function getEnvInfo(envId) {
|
|
51
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
42
|
const { EnvList } = yield tcbService.request('DescribeEnvs', {
|
package/lib/run/index.js
CHANGED
|
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./list"), exports);
|
|
18
|
-
__exportStar(require("./create"), exports);
|
|
19
18
|
__exportStar(require("./version"), exports);
|
|
20
19
|
__exportStar(require("./image"), exports);
|
|
21
20
|
__exportStar(require("./delete"), exports);
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.validateTcrImageURL = exports.getAuthorizedTcrInstance = exports.tcbrServiceOptions = exports.mergeEnvParams = exports.parseEnvParams = exports.extractPolicyDetails = exports.convertNumber = exports.describeWxCloudBaseRunReleaseOrder = void 0;
|
|
12
|
+
exports.validateTcrImageURL = exports.getAuthorizedTcrInstance = exports.tcbrServiceOptions = exports.mergeEnvParams = exports.parseEnvParams = exports.extractPolicyDetails = exports.convertNumber = exports.describeWxCloudBaseRunReleaseOrder = exports.describeCloudRunServerDetail = void 0;
|
|
13
13
|
const utils_1 = require("../../utils");
|
|
14
14
|
const types_1 = require("../../types");
|
|
15
15
|
const toolbox_1 = require("@cloudbase/toolbox");
|
|
@@ -18,6 +18,13 @@ const __1 = require("..");
|
|
|
18
18
|
const constant_1 = require("../../constant");
|
|
19
19
|
const tcbService = utils_1.CloudApiService.getInstance('tcb');
|
|
20
20
|
const tcrCloudApiService = new utils_1.CloudApiService('tcr', {}, '2019-09-24');
|
|
21
|
+
const describeCloudRunServerDetail = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
return yield (0, utils_1.callTcbrApi)('DescribeCloudRunServerDetail', {
|
|
23
|
+
EnvId: options.envId,
|
|
24
|
+
ServerName: options.serviceName,
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
exports.describeCloudRunServerDetail = describeCloudRunServerDetail;
|
|
21
28
|
function describeWxCloudBaseRunReleaseOrder(options) {
|
|
22
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
30
|
const res = yield tcbService.request('DescribeWxCloudBaseRunReleaseOrder', {
|
|
@@ -70,13 +77,13 @@ const mergeEnvParams = (curEnvParams, preEnvParams) => {
|
|
|
70
77
|
exports.mergeEnvParams = mergeEnvParams;
|
|
71
78
|
function checkRequiredParams(options) {
|
|
72
79
|
if (!options.envId) {
|
|
73
|
-
throw new toolbox_1.CloudBaseError('
|
|
80
|
+
throw new toolbox_1.CloudBaseError('请使用 -e 或 --envId 指定环境ID');
|
|
74
81
|
}
|
|
75
82
|
if (!options.serviceName) {
|
|
76
|
-
throw new toolbox_1.CloudBaseError('
|
|
83
|
+
throw new toolbox_1.CloudBaseError('请使用 -s 或 --serviceName 指定服务名');
|
|
77
84
|
}
|
|
78
85
|
if (!options.containerPort) {
|
|
79
|
-
throw new toolbox_1.CloudBaseError('
|
|
86
|
+
throw new toolbox_1.CloudBaseError('请使用 --containerPort 指定监听端口号');
|
|
80
87
|
}
|
|
81
88
|
if (!options.isCreated && !options.path && !options.custom_image) {
|
|
82
89
|
throw new toolbox_1.CloudBaseError('请使用 --path 指定代码根目录或 --custom_image 指定 TCR 镜像 URL');
|
|
@@ -87,7 +94,7 @@ function checkRequiredParams(options) {
|
|
|
87
94
|
}
|
|
88
95
|
function tcbrServiceOptions(options, isCreated, defaultOverride, previousServerConfig) {
|
|
89
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
let { noConfirm: _noConfirm = false, override: _override = (defaultOverride || false), envId, serviceName, path, cpu, mem, minNum, maxNum, policyDetails, customLogs, envParams, containerPort, remark, targetDir, dockerfile, image, custom_image, library_image, json: _json = false } = options;
|
|
97
|
+
let { noConfirm: _noConfirm = false, override: _override = (defaultOverride || false), envId, serviceName, path, cpu, mem, minNum, maxNum, policyDetails, customLogs, envParams, containerPort, remark, targetDir, dockerfile, image, custom_image, library_image, log_type, json: _json = false } = options;
|
|
91
98
|
checkRequiredParams({
|
|
92
99
|
envId,
|
|
93
100
|
serviceName,
|
|
@@ -111,7 +118,10 @@ function tcbrServiceOptions(options, isCreated, defaultOverride, previousServerC
|
|
|
111
118
|
maxNum,
|
|
112
119
|
minNum
|
|
113
120
|
});
|
|
114
|
-
|
|
121
|
+
if (log_type && log_type !== "none") {
|
|
122
|
+
throw new toolbox_1.CloudBaseError('日志类型 log_type 只能为 none,如需自定义日志,请前往控制台配置');
|
|
123
|
+
}
|
|
124
|
+
const defaultLogType = "none";
|
|
115
125
|
const newServiceOptions = {
|
|
116
126
|
ServerName: serviceName,
|
|
117
127
|
EnvId: envId,
|
|
@@ -132,7 +142,10 @@ function tcbrServiceOptions(options, isCreated, defaultOverride, previousServerC
|
|
|
132
142
|
Port: containerPort,
|
|
133
143
|
HasDockerfile: true,
|
|
134
144
|
Dockerfile: dockerfile || 'Dockerfile',
|
|
135
|
-
LogType: defaultLogType
|
|
145
|
+
LogType: (0, utils_1.parseInputParam)(log_type, _override, null, previousServerConfig === null || previousServerConfig === void 0 ? void 0 : previousServerConfig.LogType, defaultLogType),
|
|
146
|
+
LogSetId: previousServerConfig === null || previousServerConfig === void 0 ? void 0 : previousServerConfig.LogSetId,
|
|
147
|
+
LogTopicId: previousServerConfig === null || previousServerConfig === void 0 ? void 0 : previousServerConfig.LogTopicId,
|
|
148
|
+
LogParseType: previousServerConfig === null || previousServerConfig === void 0 ? void 0 : previousServerConfig.LogParseType,
|
|
136
149
|
},
|
|
137
150
|
DeployInfo: Object.assign({}, DeployInfo)
|
|
138
151
|
};
|
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.updateCloudRunServerConfig = exports.tcbrServiceConfigOptions = void 0;
|
|
13
|
-
const create_1 = require("./create");
|
|
14
13
|
const toolbox_1 = require("@cloudbase/toolbox");
|
|
15
14
|
const common_1 = require("./common");
|
|
16
15
|
const utils_1 = require("../../utils");
|
|
@@ -29,12 +28,12 @@ function tcbrServiceConfigOptions(options) {
|
|
|
29
28
|
maxNum,
|
|
30
29
|
minNum
|
|
31
30
|
});
|
|
32
|
-
const serviceInfo = yield (0,
|
|
31
|
+
const serviceInfo = yield (0, common_1.describeCloudRunServerDetail)({
|
|
33
32
|
envId,
|
|
34
33
|
serviceName
|
|
35
34
|
});
|
|
36
35
|
if (serviceInfo instanceof Error && serviceInfo['code'] === 'InvalidParameter') {
|
|
37
|
-
throw new toolbox_1.CloudBaseError(
|
|
36
|
+
throw new toolbox_1.CloudBaseError(`服务不存在,请检查服务名是否正确或到控制台 ${(0, utils_1.genClickableLink)('https://console.cloud.tencent.com/tcbr')} 创建服务`);
|
|
38
37
|
}
|
|
39
38
|
const { ServerConfig: previousServerConfig } = serviceInfo.data;
|
|
40
39
|
const newServiceOptions = {
|
|
@@ -38,13 +38,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
38
38
|
exports.packageDeploy = void 0;
|
|
39
39
|
const path_1 = __importDefault(require("path"));
|
|
40
40
|
const fs = __importStar(require("fs"));
|
|
41
|
-
const utils_1 = require("../../utils");
|
|
42
41
|
const __1 = require("..");
|
|
43
42
|
const toolbox_1 = require("@cloudbase/toolbox");
|
|
44
43
|
function packageDeploy(options) {
|
|
45
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
45
|
let { envId, serviceName, filePath, fileToIgnore } = options;
|
|
47
|
-
let { PackageName, PackageVersion, UploadUrl } = yield (0, __1.createBuild)({
|
|
46
|
+
let { PackageName, PackageVersion, UploadUrl, UploadHeaders } = yield (0, __1.createBuild)({
|
|
48
47
|
envId,
|
|
49
48
|
serviceName
|
|
50
49
|
});
|
|
@@ -68,13 +67,7 @@ function packageDeploy(options) {
|
|
|
68
67
|
}
|
|
69
68
|
try {
|
|
70
69
|
return yield (0, toolbox_1.execWithLoading)(() => __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
yield (0,
|
|
72
|
-
method: 'PUT',
|
|
73
|
-
body: fs.createReadStream(zipFile),
|
|
74
|
-
headers: {
|
|
75
|
-
'content-type': 'application/zip'
|
|
76
|
-
}
|
|
77
|
-
});
|
|
70
|
+
yield (0, __1.uploadZip)(zipFile, UploadUrl, UploadHeaders[0]);
|
|
78
71
|
return { PackageName, PackageVersion };
|
|
79
72
|
}), {
|
|
80
73
|
startTip: '\n正在上传代码包...',
|
package/lib/run/service/index.js
CHANGED
|
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./list"), exports);
|
|
18
|
-
__exportStar(require("./create"), exports);
|
|
19
18
|
__exportStar(require("./showLogs"), exports);
|
|
20
19
|
__exportStar(require("./deployPackage"), exports);
|
|
21
20
|
__exportStar(require("./common"), exports);
|
|
@@ -39,7 +39,7 @@ function updateTcbrService(options) {
|
|
|
39
39
|
serviceName: options.serviceName
|
|
40
40
|
});
|
|
41
41
|
if (serviceDetail === undefined) {
|
|
42
|
-
throw new toolbox_1.CloudBaseError(
|
|
42
|
+
throw new toolbox_1.CloudBaseError(`当前服务不存在,请前往控制台 ${(0, utils_1.genClickableLink)('https://console.cloud.tencent.com/tcbr')} 创建服务`);
|
|
43
43
|
}
|
|
44
44
|
const status = yield (0, showLogs_1.getBuildStatus)(options.envId, options.serviceName);
|
|
45
45
|
if (status === 'pending') {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.debugLogger = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
function debugLogger(req, resp, startTime, endTime, writeToLocal = true) {
|
|
10
|
+
if (process.env.NODE_ENV !== 'DEBUG') {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const cost = endTime.valueOf() - startTime.valueOf();
|
|
14
|
+
const startTimeFormatted = startTime.toISOString();
|
|
15
|
+
const endTimeFormatted = endTime.toISOString();
|
|
16
|
+
console.log(chalk_1.default.underline('\n[DEBUG]', startTimeFormatted));
|
|
17
|
+
console.log(chalk_1.default.cyan(JSON.stringify(req)), '\n');
|
|
18
|
+
console.log(chalk_1.default.underline('[DEBUG]', endTimeFormatted));
|
|
19
|
+
console.log(chalk_1.default.magenta(JSON.stringify(resp)), '\n');
|
|
20
|
+
if (writeToLocal) {
|
|
21
|
+
const filePath = `${process.cwd()}/cloudbase-cli.debug.log`;
|
|
22
|
+
const logContent = `\n{start:${startTimeFormatted}, req: ${JSON.stringify(req)}, end:${endTimeFormatted}, resp: ${JSON.stringify(resp)}, cost: ${cost}}`;
|
|
23
|
+
fs_1.default.appendFile(filePath, logContent, (err) => {
|
|
24
|
+
if (err) {
|
|
25
|
+
console.error(chalk_1.default.red(`\n写入日志失败:${JSON.stringify(err)}`));
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.debugLogger = debugLogger;
|
|
@@ -14,6 +14,7 @@ const toolbox_1 = require("@cloudbase/toolbox");
|
|
|
14
14
|
const cloud_api_1 = require("@cloudbase/cloud-api");
|
|
15
15
|
const error_1 = require("../../error");
|
|
16
16
|
const constant_1 = require("../../constant");
|
|
17
|
+
const debug_logger_1 = require("../debug-logger");
|
|
17
18
|
let commonCredential;
|
|
18
19
|
const isTokenExpired = (credential, gap = 120) => credential.accessTokenExpired && Number(credential.accessTokenExpired) < Date.now() + gap * 1000;
|
|
19
20
|
class CloudApiService {
|
|
@@ -49,7 +50,12 @@ class CloudApiService {
|
|
|
49
50
|
request(action, data = {}, method = 'POST') {
|
|
50
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
52
|
const region = this.region || (yield (0, toolbox_1.getRegion)());
|
|
52
|
-
|
|
53
|
+
const reqOptions = { action, data, method, region };
|
|
54
|
+
const startTime = new Date();
|
|
55
|
+
const res = yield this.apiService.request(reqOptions);
|
|
56
|
+
const endTime = new Date();
|
|
57
|
+
(0, debug_logger_1.debugLogger)(reqOptions, res, startTime, endTime);
|
|
58
|
+
return res;
|
|
53
59
|
});
|
|
54
60
|
}
|
|
55
61
|
}
|
|
@@ -18,6 +18,7 @@ const https_proxy_agent_1 = require("https-proxy-agent");
|
|
|
18
18
|
const constant_1 = require("../../constant");
|
|
19
19
|
const error_1 = require("../../error");
|
|
20
20
|
const proxy_1 = require("./proxy");
|
|
21
|
+
const debug_logger_1 = require("../debug-logger");
|
|
21
22
|
function handleTimeout(e) {
|
|
22
23
|
if (e.type === 'request-timeout') {
|
|
23
24
|
throw new error_1.CloudBaseError('请求超时,请检查你的网络,如果终端无法直接访问公网,请设置终端 HTTP 请求代理!');
|
|
@@ -26,6 +27,16 @@ function handleTimeout(e) {
|
|
|
26
27
|
throw e;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
30
|
+
function fetchWithDebugLogger(useTextTransform, ...args) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const startTime = new Date();
|
|
33
|
+
const rawRes = yield (0, node_fetch_1.default)(...args);
|
|
34
|
+
const res = useTextTransform ? yield rawRes.text() : rawRes;
|
|
35
|
+
const endTime = new Date();
|
|
36
|
+
(0, debug_logger_1.debugLogger)(args, res, startTime, endTime);
|
|
37
|
+
return res;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
29
40
|
function fetch(url, config = {}) {
|
|
30
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
42
|
const proxy = (0, proxy_1.getProxy)();
|
|
@@ -36,8 +47,8 @@ function fetch(url, config = {}) {
|
|
|
36
47
|
let json;
|
|
37
48
|
let text;
|
|
38
49
|
try {
|
|
39
|
-
const res = yield (
|
|
40
|
-
text =
|
|
50
|
+
const res = yield fetchWithDebugLogger(true, url, config);
|
|
51
|
+
text = res;
|
|
41
52
|
json = JSON.parse(text);
|
|
42
53
|
}
|
|
43
54
|
catch (e) {
|
|
@@ -65,8 +76,8 @@ function postFetch(url, data) {
|
|
|
65
76
|
let json;
|
|
66
77
|
let text;
|
|
67
78
|
try {
|
|
68
|
-
const res = yield (
|
|
69
|
-
text =
|
|
79
|
+
const res = yield fetchWithDebugLogger(true, url, config);
|
|
80
|
+
text = res;
|
|
70
81
|
json = JSON.parse(text);
|
|
71
82
|
}
|
|
72
83
|
catch (e) {
|
|
@@ -85,7 +96,7 @@ function fetchStream(url, config = {}) {
|
|
|
85
96
|
}
|
|
86
97
|
config.timeout = constant_1.REQUEST_TIMEOUT;
|
|
87
98
|
try {
|
|
88
|
-
const res = yield (
|
|
99
|
+
const res = yield fetchWithDebugLogger(false, url, config);
|
|
89
100
|
return res;
|
|
90
101
|
}
|
|
91
102
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/cli",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "cli tool for cloudbase",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@cloudbase/cloud-api": "^0.5.5",
|
|
34
34
|
"@cloudbase/framework-core": "^1.6.1",
|
|
35
|
-
"@cloudbase/lowcode-cli": "^0.
|
|
35
|
+
"@cloudbase/lowcode-cli": "^0.15.0",
|
|
36
36
|
"@cloudbase/manager-node": "4.0.1",
|
|
37
37
|
"@cloudbase/toolbox": "^0.7.3",
|
|
38
38
|
"@sentry/node": "^5.10.2",
|
package/types/env/index.d.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
export * from './domain';
|
|
2
2
|
export * from './login';
|
|
3
3
|
export declare function initTcb(skey: string): Promise<any>;
|
|
4
|
-
export declare function createEnv({ alias, paymentMode }: {
|
|
5
|
-
alias: any;
|
|
6
|
-
paymentMode: any;
|
|
7
|
-
}): Promise<{
|
|
8
|
-
envId: string;
|
|
9
|
-
}>;
|
|
10
4
|
export declare function getEnvInfo(envId: string): Promise<any>;
|
|
11
5
|
export declare function listEnvs(options?: {
|
|
12
6
|
source?: string[];
|
package/types/run/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ITcbrServiceOptions, IDescribeWxCloudBaseRunReleaseOrder, IAuthorizedTcrInstance } from '../../types';
|
|
2
|
+
export declare const describeCloudRunServerDetail: (options: {
|
|
3
|
+
envId: string;
|
|
4
|
+
serviceName: string;
|
|
5
|
+
}) => Promise<any>;
|
|
2
6
|
export declare function describeWxCloudBaseRunReleaseOrder(options: IDescribeWxCloudBaseRunReleaseOrder): Promise<any>;
|
|
3
7
|
export declare const convertNumber: (item: any) => number;
|
|
4
8
|
export declare const extractPolicyDetails: (policyDetails: string) => {
|
|
@@ -27,7 +31,10 @@ export declare function tcbrServiceOptions(options: ITcbrServiceOptions, isCreat
|
|
|
27
31
|
Port: number;
|
|
28
32
|
HasDockerfile: boolean;
|
|
29
33
|
Dockerfile: string;
|
|
30
|
-
LogType:
|
|
34
|
+
LogType: any;
|
|
35
|
+
LogSetId: any;
|
|
36
|
+
LogTopicId: any;
|
|
37
|
+
LogParseType: any;
|
|
31
38
|
};
|
|
32
39
|
DeployInfo: any;
|
|
33
40
|
}>;
|
package/types/types.d.ts
CHANGED
|
@@ -490,6 +490,9 @@ export interface IDescribeCloudRunServerDetail {
|
|
|
490
490
|
ServerConfig: ITcbrServerBaseConfig;
|
|
491
491
|
RequestId: string;
|
|
492
492
|
}
|
|
493
|
+
export declare const enum TCBR_LOG_TYPE {
|
|
494
|
+
NONE = "none"
|
|
495
|
+
}
|
|
493
496
|
export interface ITcbrServiceOptions {
|
|
494
497
|
noConfirm: boolean;
|
|
495
498
|
override: boolean;
|
|
@@ -511,6 +514,7 @@ export interface ITcbrServiceOptions {
|
|
|
511
514
|
image: string;
|
|
512
515
|
custom_image: string;
|
|
513
516
|
library_image: string;
|
|
517
|
+
log_type: TCBR_LOG_TYPE;
|
|
514
518
|
json: boolean;
|
|
515
519
|
}
|
|
516
520
|
export interface ICloudRunProcessLog {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function debugLogger(req: unknown, resp: unknown, startTime: Date, endTime: Date, writeToLocal?: boolean): void;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { RequestInit } from 'node-fetch';
|
|
1
|
+
import _fetch, { RequestInit } from 'node-fetch';
|
|
2
|
+
declare type fetchReturnType = ReturnType<typeof _fetch>;
|
|
3
|
+
declare type UnPromisify<T> = T extends PromiseLike<infer U> ? U : T;
|
|
4
|
+
declare type fetchReturnTypeExtracted = UnPromisify<fetchReturnType>;
|
|
2
5
|
export declare function fetch(url: string, config?: RequestInit): Promise<any>;
|
|
3
6
|
export declare function postFetch(url: string, data?: Record<string, any>): Promise<any>;
|
|
4
|
-
export declare function fetchStream(url: any, config?: Record<string, any>): Promise<
|
|
7
|
+
export declare function fetchStream(url: any, config?: Record<string, any>): Promise<fetchReturnTypeExtracted>;
|
|
8
|
+
export {};
|