@cloudbase/cli 2.6.0-alpha.7 → 2.7.0-alpha.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.
Files changed (40) hide show
  1. package/.yarn/cache/@cloudbase-functions-framework-npm-1.0.0-beta.11-9bbeceb6ff-3aa0efd307.zip +0 -0
  2. package/.yarn/cache/@cloudbase-functions-typings-npm-1.0.0-beta.3-0b2fc0975b-ebe46cc101.zip +0 -0
  3. package/.yarn/cache/ajv-npm-8.17.1-12ade7edc6-1797bf242c.zip +0 -0
  4. package/.yarn/cache/fast-uri-npm-3.0.1-20477a5d16-106143ff83.zip +0 -0
  5. package/.yarn/cache/radix3-npm-1.1.2-bf27d7ceee-c4d49a3f60.zip +0 -0
  6. package/.yarn/install-state.gz +0 -0
  7. package/lib/commands/env/base.js +1 -2
  8. package/lib/commands/iac/index.js +642 -0
  9. package/lib/commands/index.js +1 -1
  10. package/lib/commands/lowcode/utils.js +2 -1
  11. package/lib/utils/net/cloud-api-request.js +9 -9
  12. package/package.json +5 -6
  13. package/types/commands/iac/index.d.ts +30 -0
  14. package/types/commands/index.d.ts +1 -1
  15. package/types/decorators/params/common.d.ts +1 -1
  16. package/types/types.d.ts +2 -2
  17. package/types/utils/config.d.ts +1 -1
  18. package/types/utils/fs/index.d.ts +1 -1
  19. package/types/utils/net/http-request.d.ts +3 -3
  20. package/types/utils/output/loading.d.ts +1 -1
  21. package/types/utils/parallel.d.ts +1 -1
  22. package/types/utils/validator.d.ts +1 -1
  23. package/.history/src/commands/lowcode/app_20220728111717.ts +0 -52
  24. package/.history/src/commands/lowcode/app_20220728112031.ts +0 -34
  25. package/.history/src/commands/lowcode/app_20220729172854.ts +0 -34
  26. package/.history/src/index_20220624162613.ts +0 -13
  27. package/.history/src/index_20220627113609.ts +0 -15
  28. package/.history/src/index_20220627114102.ts +0 -13
  29. package/.yarn/cache/@cloudbase-functions-framework-npm-1.0.0-beta.3-68c4d9136e-3d11f97edc.zip +0 -0
  30. package/.yarn/cache/@koa-router-npm-12.0.1-6a9764e4df-4b8d3940cb.zip +0 -0
  31. package/.yarn/cache/path-to-regexp-npm-6.2.2-0bf7f6805c-b7b0005c36.zip +0 -0
  32. package/.yarnrc.yml +0 -1
  33. package/lib/commands/constants.js +0 -11
  34. package/lib/commands/fun/base.js +0 -419
  35. package/lib/commands/fun/index.js +0 -17
  36. package/lib/commands/utils.js +0 -47
  37. package/types/commands/constants.d.ts +0 -8
  38. package/types/commands/fun/base.d.ts +0 -43
  39. package/types/commands/fun/index.d.ts +0 -1
  40. package/types/commands/utils.d.ts +0 -3
@@ -1,419 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
24
- return (mod && mod.__esModule) ? mod : { "default": mod };
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.FunRunCommand = exports.FunDeployCommand = exports.FunListCommand = void 0;
28
- const functions_framework_1 = require("@cloudbase/functions-framework");
29
- const fs_extra_1 = __importDefault(require("fs-extra"));
30
- const inquirer_1 = __importDefault(require("inquirer"));
31
- const path_1 = __importDefault(require("path"));
32
- const decorators_1 = require("../../decorators");
33
- const run_1 = require("../../run");
34
- const utils_1 = require("../../utils");
35
- const common_1 = require("../common");
36
- const constants_1 = require("../constants");
37
- const utils_2 = require("../utils");
38
- const nodemon_1 = __importDefault(require("nodemon"));
39
- const scfService = utils_1.CloudApiService.getInstance('tcb');
40
- let FunListCommand = class FunListCommand extends common_1.Command {
41
- get options() {
42
- return {
43
- cmd: 'fun',
44
- childCmd: 'list',
45
- options: [
46
- {
47
- flags: '-e, --envId <envId>',
48
- desc: '环境 Id'
49
- }
50
- ],
51
- requiredEnvId: false,
52
- autoRunLogin: true,
53
- desc: '查看函数式托管服务列表'
54
- };
55
- }
56
- execute(envId, log) {
57
- var _a;
58
- return __awaiter(this, void 0, void 0, function* () {
59
- const loading = (0, utils_1.loadingFactory)();
60
- if (!envId) {
61
- envId = yield _selectEnv();
62
- }
63
- else {
64
- log.info(`当前环境 Id:${envId}`);
65
- }
66
- try {
67
- loading.start('获取函数式托管服务列表中…');
68
- let serverListRes = yield scfService
69
- .request('DescribeCloudBaseRunServers', {
70
- EnvId: envId,
71
- Limit: 100,
72
- Offset: 0
73
- })
74
- .finally(() => loading.stop());
75
- const serverList = (_a = serverListRes.CloudBaseRunServerSet) === null || _a === void 0 ? void 0 : _a.filter((item) => item.Tag === 'function');
76
- const head = ['服务名称', '状态', '创建时间', '更新时间'];
77
- const tableData = serverList.map((serverItem) => [
78
- serverItem.ServerName,
79
- serverItem.Status,
80
- serverItem.CreatedTime,
81
- serverItem.UpdatedTime
82
- ]);
83
- (0, utils_1.printHorizontalTable)(head, tableData);
84
- }
85
- catch (e) {
86
- log.error('获取函数式托管服务列表失败:' + e.message);
87
- }
88
- });
89
- }
90
- };
91
- __decorate([
92
- (0, decorators_1.InjectParams)(),
93
- __param(0, (0, decorators_1.EnvId)()),
94
- __param(1, (0, decorators_1.Log)()),
95
- __metadata("design:type", Function),
96
- __metadata("design:paramtypes", [Object, decorators_1.Logger]),
97
- __metadata("design:returntype", Promise)
98
- ], FunListCommand.prototype, "execute", null);
99
- FunListCommand = __decorate([
100
- (0, common_1.ICommand)()
101
- ], FunListCommand);
102
- exports.FunListCommand = FunListCommand;
103
- let FunDeployCommand = class FunDeployCommand extends common_1.Command {
104
- get options() {
105
- return {
106
- cmd: 'fun',
107
- childCmd: 'deploy',
108
- options: [
109
- {
110
- flags: '-e, --envId <envId>',
111
- desc: '环境 Id'
112
- },
113
- {
114
- flags: '-s, --serviceName <serviceName>',
115
- desc: '服务名称'
116
- },
117
- {
118
- flags: '--appId <appId>',
119
- desc: '微信 AppId'
120
- },
121
- {
122
- flags: '--source <source>',
123
- desc: '目标函数文件所在目录路径。默认为当前路径'
124
- },
125
- {
126
- flags: '--includeNodeModules',
127
- desc: '包含本地 node_modules 目录,默认为 false 不包含'
128
- }
129
- ],
130
- requiredEnvId: false,
131
- autoRunLogin: true,
132
- desc: '部署函数式托管代码'
133
- };
134
- }
135
- execute(envId, log, options) {
136
- return __awaiter(this, void 0, void 0, function* () {
137
- let { serviceName, appId, source, includeNodeModules = false } = options;
138
- const target = 'main';
139
- source = path_1.default.resolve(source || process.cwd());
140
- const loadResult = yield (0, functions_framework_1.loadUserFunction)(source, target);
141
- if (!(loadResult === null || loadResult === void 0 ? void 0 : loadResult.userFunction)) {
142
- if (loadResult.reason.includes('is not a loadable module')) {
143
- log.error(`${source} 不是一个有效的函数式托管代码目录,可以通过 --source <source> 指定代码目录路径`);
144
- }
145
- else if (loadResult === null || loadResult === void 0 ? void 0 : loadResult.reason.includes('is not defined in the provided module')) {
146
- log.error(`主文件并未导出目标函数 ${target},请导出 ${target} 目标函数`);
147
- }
148
- else {
149
- log.error(loadResult === null || loadResult === void 0 ? void 0 : loadResult.reason);
150
- }
151
- return;
152
- }
153
- if (!envId) {
154
- envId = yield _selectEnv();
155
- }
156
- else {
157
- log.info(`当前环境 Id:${envId}`);
158
- }
159
- if (!serviceName) {
160
- let pkgName = '';
161
- try {
162
- const pkg = yield fs_extra_1.default.readJSON(path_1.default.join(source, 'package.json'));
163
- pkgName = pkg.name;
164
- }
165
- catch (e) { }
166
- serviceName = yield _inputServiceName(pkgName);
167
- }
168
- if (!appId) {
169
- appId = yield _inputAppId();
170
- }
171
- const loading = (0, utils_1.loadingFactory)();
172
- const fetchSvrRes = yield scfService.request('DescribeCloudBaseRunServer', {
173
- EnvId: envId,
174
- ServerName: serviceName,
175
- Limit: 1,
176
- Offset: 0
177
- });
178
- if (fetchSvrRes.ServerName && !_isFunRunService(fetchSvrRes.Tag)) {
179
- log.error(`${serviceName} 服务已存在,但不是一个函数式托管服务,请使用另外的服务名称`);
180
- return;
181
- }
182
- if (!fetchSvrRes.ServerName) {
183
- try {
184
- loading.start('正在创建服务…');
185
- yield scfService.request('EstablishCloudBaseRunServerWx', {
186
- EnvId: envId,
187
- ServiceName: serviceName,
188
- IsPublic: true,
189
- OpenAccessTypes: ['MINIAPP', 'PUBLIC'],
190
- ServiceBaseConfig: {
191
- PublicAccess: true,
192
- Cpu: 1,
193
- Mem: 2,
194
- MinNum: 0,
195
- MaxNum: 5,
196
- PolicyType: 'cpu',
197
- PolicyThreshold: 60,
198
- CustomLogs: 'stdout',
199
- EnvParams: '',
200
- OperatorRemark: '',
201
- InitialDelaySeconds: 2,
202
- PolicyDetails: [
203
- {
204
- PolicyThreshold: 60,
205
- PolicyType: 'cpu'
206
- }
207
- ],
208
- BuildDir: '',
209
- Dockerfile: 'Dockerfile',
210
- HasDockerfile: true,
211
- InternalAccess: 'open',
212
- Port: 3000,
213
- Tag: 'function'
214
- },
215
- WxBuffer: ''
216
- });
217
- loading.succeed('创建服务成功');
218
- }
219
- catch (e) {
220
- loading.stop();
221
- log.error('创建服务失败:' + e.message);
222
- return;
223
- }
224
- }
225
- let packageName, packageVersion;
226
- try {
227
- loading.start('正在上传代码包…');
228
- const { PackageName, PackageVersion } = yield (0, run_1.packageDeploy)({
229
- envId,
230
- serviceName,
231
- filePath: source,
232
- fileToIgnore: ['logs', 'logs/**/*'].concat(includeNodeModules ? [] : ['node_modules', 'node_modules/**/*'])
233
- });
234
- packageName = PackageName;
235
- packageVersion = PackageVersion;
236
- loading.stop();
237
- }
238
- catch (e) {
239
- loading.stop();
240
- log.error('上传代码包失败:' + e.message);
241
- return;
242
- }
243
- try {
244
- loading.start('正在创建发布任务…');
245
- yield scfService.request('SubmitServerRelease', {
246
- EnvId: envId,
247
- WxAppId: appId,
248
- ServerName: serviceName,
249
- PackageName: packageName,
250
- PackageVersion: packageVersion,
251
- BuildDir: '.',
252
- DeployType: 'package',
253
- ReleaseType: 'FULL',
254
- HasDockerfile: false,
255
- Dockerfile: '',
256
- Port: 3000,
257
- BuildPacks: {
258
- BaseImage: 'Node.js-LTS',
259
- EntryPoint: 'node index.js',
260
- RepoLanguage: 'Node.js',
261
- UploadFilename: ''
262
- },
263
- VersionRemark: ''
264
- });
265
- loading.succeed(`发布任务创建成功,请前往 https://cloud.weixin.qq.com/cloudrun/service/${serviceName} 查看任务详情`);
266
- }
267
- catch (e) {
268
- loading.stop();
269
- log.error('创建发布任务失败:' + e.message);
270
- }
271
- });
272
- }
273
- };
274
- __decorate([
275
- (0, decorators_1.InjectParams)(),
276
- __param(0, (0, decorators_1.EnvId)()),
277
- __param(1, (0, decorators_1.Log)()),
278
- __param(2, (0, decorators_1.ArgsOptions)()),
279
- __metadata("design:type", Function),
280
- __metadata("design:paramtypes", [Object, decorators_1.Logger, Object]),
281
- __metadata("design:returntype", Promise)
282
- ], FunDeployCommand.prototype, "execute", null);
283
- FunDeployCommand = __decorate([
284
- (0, common_1.ICommand)()
285
- ], FunDeployCommand);
286
- exports.FunDeployCommand = FunDeployCommand;
287
- let FunRunCommand = class FunRunCommand extends common_1.Command {
288
- get options() {
289
- return {
290
- cmd: 'fun',
291
- childCmd: 'run',
292
- options: [
293
- {
294
- flags: '--source <source>',
295
- desc: '目标函数文件所在目录路径,默认为当前路径'
296
- },
297
- {
298
- flags: '--port <port>',
299
- desc: '监听的端口,默认为 3000'
300
- },
301
- {
302
- flags: '-w, --watch',
303
- desc: '是否启用热重启模式,如启用,将会在文件变更时自动重启服务,默认为 false'
304
- },
305
- {
306
- flags: '--dry-run',
307
- desc: '是否不启动服务,只验证代码可以正常加载,默认为 false'
308
- },
309
- {
310
- flags: '--logDirname <logDirname>',
311
- desc: '日志文件目录,默认为 ./logs'
312
- }
313
- ],
314
- requiredEnvId: false,
315
- desc: '本地运行函数式托管代码'
316
- };
317
- }
318
- execute(logger) {
319
- return __awaiter(this, void 0, void 0, function* () {
320
- const args = process.argv.slice(2);
321
- const watchFlag = ['--watch', '-w'];
322
- const defaultIgnoreFiles = ['logs/*.*'];
323
- if (watchFlag.some((flag) => args.includes(flag))) {
324
- debugger;
325
- const cmd = args.filter((arg) => !watchFlag.includes(arg)).join(' ');
326
- (0, nodemon_1.default)({
327
- script: '',
328
- exec: `${process.argv[1]} ${cmd}`,
329
- watchOptions: {
330
- usePolling: true,
331
- ignorePermissionErrors: true,
332
- ignored: defaultIgnoreFiles.join(','),
333
- persistent: true,
334
- interval: 500
335
- }
336
- })
337
- .on('start', () => {
338
- logger.info('Initializing server in watch mode. Changes in source files will trigger a restart.');
339
- })
340
- .on('quit', (e) => {
341
- logger.info(`Nodemon quit with code ${e}.`);
342
- process.exit(0);
343
- })
344
- .on('restart', (e) => {
345
- var _a, _b;
346
- logger.info(`Server restarted due to changed files: ${(_b = (_a = e === null || e === void 0 ? void 0 : e.matched) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.join(', ')}`);
347
- })
348
- .on('log', (e) => {
349
- logger.info(`[nodemon ${e.type}] ${e.message}`);
350
- })
351
- .on('crash', () => {
352
- logger.error(`Server crashed.`);
353
- process.exit(1);
354
- })
355
- .on('exit', (e) => {
356
- logger.info(`Server exited with code ${e}.`);
357
- });
358
- }
359
- else {
360
- (0, functions_framework_1.runCLI)();
361
- }
362
- });
363
- }
364
- };
365
- __decorate([
366
- (0, decorators_1.InjectParams)(),
367
- __param(0, (0, decorators_1.Log)()),
368
- __metadata("design:type", Function),
369
- __metadata("design:paramtypes", [decorators_1.Logger]),
370
- __metadata("design:returntype", Promise)
371
- ], FunRunCommand.prototype, "execute", null);
372
- FunRunCommand = __decorate([
373
- (0, common_1.ICommand)()
374
- ], FunRunCommand);
375
- exports.FunRunCommand = FunRunCommand;
376
- function _selectEnv() {
377
- return __awaiter(this, void 0, void 0, function* () {
378
- return (0, utils_2.selectEnv)({ source: [constants_1.EnvSource.MINIAPP] });
379
- });
380
- }
381
- function _inputServiceName(defaultVal = '') {
382
- return __awaiter(this, void 0, void 0, function* () {
383
- const questions = [
384
- {
385
- type: 'input',
386
- name: 'serviceName',
387
- message: '请输入服务名称(只能包含数字、小写字母和-,只能以小写字母开头,最多 20字符)',
388
- default: defaultVal,
389
- validate: (val) => {
390
- return /^[a-z][a-z0-9-]{0,19}$/.test(val) ? true : '请输入正确的服务名称';
391
- }
392
- }
393
- ];
394
- const answers = yield inquirer_1.default.prompt(questions);
395
- return answers['serviceName'];
396
- });
397
- }
398
- function _inputAppId(defaultVal = '') {
399
- return __awaiter(this, void 0, void 0, function* () {
400
- const questions = [
401
- {
402
- type: 'input',
403
- name: 'appId',
404
- message: '请输入微信 AppID',
405
- validate: (val) => (val ? true : '请输入微信 AppID'),
406
- default: defaultVal
407
- }
408
- ];
409
- const answers = yield inquirer_1.default.prompt(questions);
410
- return answers['appId'];
411
- });
412
- }
413
- function _isFunRunService(tagStr) {
414
- if (!tagStr)
415
- return false;
416
- const tags = tagStr.split(',');
417
- const tagList = tags.map((item) => item.split(':')[0]);
418
- return tagList.includes('function');
419
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./base"), exports);
@@ -1,47 +0,0 @@
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.selectEnv = void 0;
16
- const lodash_1 = require("lodash");
17
- const env_1 = require("../env");
18
- const constants_1 = require("./constants");
19
- const inquirer_1 = __importDefault(require("inquirer"));
20
- const utils_1 = require("../utils");
21
- function selectEnv(options = {}) {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- const loading = (0, utils_1.loadingFactory)();
24
- const { source = [] } = options;
25
- loading.start('获取环境列表中...');
26
- let data = yield (0, env_1.listEnvs)({ source }).finally(() => {
27
- loading.stop();
28
- });
29
- const choices = (0, lodash_1.sortBy)(data, ['Alias']).map((item) => {
30
- return {
31
- name: `${item.Alias || item.EnvId} (${item.EnvId}) ${item.Status === constants_1.EnvStatus.NORMAL ? '正常' : '不可用'}`,
32
- value: item.EnvId
33
- };
34
- });
35
- const questions = [
36
- {
37
- type: 'list',
38
- name: 'env',
39
- message: '请选择环境',
40
- choices: choices
41
- }
42
- ];
43
- const answers = yield inquirer_1.default.prompt(questions);
44
- return answers['env'];
45
- });
46
- }
47
- exports.selectEnv = selectEnv;
@@ -1,8 +0,0 @@
1
- export declare const EnvSource: {
2
- MINIAPP: string;
3
- QCLOUD: string;
4
- };
5
- export declare const EnvStatus: {
6
- NORMAL: string;
7
- UNAVAILABLE: string;
8
- };
@@ -1,43 +0,0 @@
1
- import { Logger } from '../../decorators';
2
- import { Command } from '../common';
3
- export declare class FunListCommand extends Command {
4
- get options(): {
5
- cmd: string;
6
- childCmd: string;
7
- options: {
8
- flags: string;
9
- desc: string;
10
- }[];
11
- requiredEnvId: boolean;
12
- autoRunLogin: boolean;
13
- desc: string;
14
- };
15
- execute(envId: any, log: Logger): Promise<void>;
16
- }
17
- export declare class FunDeployCommand extends Command {
18
- get options(): {
19
- cmd: string;
20
- childCmd: string;
21
- options: {
22
- flags: string;
23
- desc: string;
24
- }[];
25
- requiredEnvId: boolean;
26
- autoRunLogin: boolean;
27
- desc: string;
28
- };
29
- execute(envId: any, log: Logger, options: any): Promise<void>;
30
- }
31
- export declare class FunRunCommand extends Command {
32
- get options(): {
33
- cmd: string;
34
- childCmd: string;
35
- options: {
36
- flags: string;
37
- desc: string;
38
- }[];
39
- requiredEnvId: boolean;
40
- desc: string;
41
- };
42
- execute(logger: Logger): Promise<void>;
43
- }
@@ -1 +0,0 @@
1
- export * from './base';
@@ -1,3 +0,0 @@
1
- export declare function selectEnv(options?: {
2
- source?: string[];
3
- }): Promise<string>;