zcatalyst-cli 1.12.1 → 1.13.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/apig-utils.js +39 -39
- package/lib/archiver.js +13 -9
- package/lib/authentication/index.js +22 -18
- package/lib/authentication/login.js +32 -32
- package/lib/bin/catalyst.js +15 -15
- package/lib/cli_table/src/cell.js +26 -26
- package/lib/cli_table/src/layout-manager.js +44 -45
- package/lib/cli_table/src/table.js +9 -9
- package/lib/cli_table/src/utils.js +35 -36
- package/lib/client-utils.js +18 -18
- package/lib/client.js +1 -1
- package/lib/command_needs/auth.js +7 -7
- package/lib/command_needs/rc.js +24 -24
- package/lib/commands/apig/disable.js +5 -5
- package/lib/commands/apig/enable.js +5 -5
- package/lib/commands/apig/status.js +9 -9
- package/lib/commands/client/delete.js +18 -18
- package/lib/commands/client/setup.js +8 -4
- package/lib/commands/deploy.js +18 -14
- package/lib/commands/ds/export.js +11 -11
- package/lib/commands/ds/import.js +12 -12
- package/lib/commands/ds/status.js +10 -10
- package/lib/commands/event/generate/index.js +21 -17
- package/lib/commands/event/generate/integ.js +7 -3
- package/lib/commands/functions/add.js +8 -4
- package/lib/commands/functions/config.js +5 -5
- package/lib/commands/functions/delete.js +20 -20
- package/lib/commands/functions/setup.js +8 -4
- package/lib/commands/functions/shell.js +7 -3
- package/lib/commands/help.js +4 -4
- package/lib/commands/iac/export.js +8 -8
- package/lib/commands/iac/import.js +23 -19
- package/lib/commands/iac/pack.js +15 -11
- package/lib/commands/iac/status.js +6 -2
- package/lib/commands/index.js +5 -1
- package/lib/commands/init.js +14 -10
- package/lib/commands/login.js +5 -1
- package/lib/commands/logout.js +5 -1
- package/lib/commands/project/list.js +14 -10
- package/lib/commands/project/reset.js +5 -5
- package/lib/commands/project/use.js +9 -9
- package/lib/commands/pull.js +18 -14
- package/lib/commands/run.js +13 -9
- package/lib/commands/serve.js +5 -1
- package/lib/commands/token/generate.js +6 -2
- package/lib/commands/token/list.js +7 -3
- package/lib/commands/token/revoke.js +6 -2
- package/lib/commands/whoami.js +3 -3
- package/lib/dc.js +2 -2
- package/lib/deploy/features/apig.js +6 -6
- package/lib/deploy/features/client.js +1 -1
- package/lib/deploy/features/functions/index.js +9 -9
- package/lib/deploy/features/index.js +5 -1
- package/lib/deploy/index.js +2 -2
- package/lib/endpoints/index.js +17 -13
- package/lib/endpoints/lib/apig.js +5 -5
- package/lib/endpoints/lib/applogic.js +4 -4
- package/lib/endpoints/lib/cache.js +3 -3
- package/lib/endpoints/lib/catalyst-details.js +1 -1
- package/lib/endpoints/lib/client.js +5 -5
- package/lib/endpoints/lib/datastore.js +2 -2
- package/lib/endpoints/lib/ds-bulk.js +5 -5
- package/lib/endpoints/lib/env.js +1 -1
- package/lib/endpoints/lib/event-bus.js +1 -1
- package/lib/endpoints/lib/filestore.js +2 -2
- package/lib/endpoints/lib/functions.js +4 -4
- package/lib/endpoints/lib/iac.js +10 -10
- package/lib/endpoints/lib/project.js +20 -5
- package/lib/endpoints/lib/queue.js +3 -3
- package/lib/endpoints/lib/sdk.js +1 -1
- package/lib/endpoints/lib/zcql.js +1 -1
- package/lib/error.js +1 -1
- package/lib/errorOut.js +2 -2
- package/lib/event_generate/cache.js +5 -5
- package/lib/event_generate/custom.js +2 -2
- package/lib/event_generate/datastore.js +5 -5
- package/lib/event_generate/filestore.js +5 -5
- package/lib/event_generate/integration/cliq.js +3 -3
- package/lib/event_generate/user.js +1 -1
- package/lib/event_generate/webapp.js +5 -5
- package/lib/execute-script.js +19 -15
- package/lib/express_middlewares/authenticator.js +32 -5
- package/lib/express_middlewares/logger.js +2 -2
- package/lib/express_middlewares/unknownReqProxy.js +1 -1
- package/lib/fn-utils/index.js +5 -1
- package/lib/fn-utils/lib/common.js +44 -44
- package/lib/fn-utils/lib/integ.js +9 -9
- package/lib/fn-utils/lib/java.js +46 -46
- package/lib/fn-utils/lib/node.js +7 -7
- package/lib/fn-watcher.js +9 -11
- package/lib/iac/status/bundle.js +5 -5
- package/lib/iac/status/deploy.js +4 -4
- package/lib/index.js +2 -2
- package/lib/init/dependencies/npm-install.js +1 -1
- package/lib/init/dependencies/package-json.js +6 -6
- package/lib/init/features/client/index.js +5 -1
- package/lib/init/features/client/initializers/angular.js +16 -12
- package/lib/init/features/client/initializers/basic.js +10 -6
- package/lib/init/features/client/initializers/lyte.js +11 -7
- package/lib/init/features/client/initializers/react.js +13 -9
- package/lib/init/features/functions/index.js +9 -9
- package/lib/init/features/functions/languages/java.js +10 -10
- package/lib/init/features/functions/languages/node.js +9 -9
- package/lib/init/features/index.js +12 -8
- package/lib/init/features/project.js +20 -20
- package/lib/init/index.js +2 -2
- package/lib/init/util/client.js +7 -3
- package/lib/init/util/functions.js +1 -1
- package/lib/init/util/project.js +4 -4
- package/lib/internal/api.js +19 -19
- package/lib/internal/command.js +20 -16
- package/lib/internal/config.js +5 -5
- package/lib/internal/credential.js +10 -10
- package/lib/internal/crypt.js +5 -5
- package/lib/internal/rc.js +5 -5
- package/lib/migration/global/1.6.2.js +3 -3
- package/lib/migration/index.js +22 -18
- package/lib/option-filter.js +34 -30
- package/lib/optional-import.js +12 -8
- package/lib/plugin-loader.js +7 -3
- package/lib/port-resolver.js +4 -4
- package/lib/progress.js +2 -2
- package/lib/prompt/index.js +5 -1
- package/lib/prompt/types/file-path.js +1 -1
- package/lib/pull/features/apig.js +9 -9
- package/lib/pull/features/client.js +7 -7
- package/lib/pull/features/functions/index.js +14 -14
- package/lib/pull/features/index.js +5 -1
- package/lib/pull/index.js +4 -4
- package/lib/repl-server.js +2 -2
- package/lib/serve/features/apig.js +1 -1
- package/lib/serve/features/index.js +8 -4
- package/lib/serve/index.js +15 -11
- package/lib/serve/server/index.js +34 -27
- package/lib/serve/server/lib/java/JavaaioServer.java +2 -1
- package/lib/serve/server/lib/java/lib/catalyst-cli-java-runtime-1.0.0.jar +0 -0
- package/lib/serve/server/lib/java/lib/catalyst-java-runtime-1.0.0.jar +0 -0
- package/lib/serve/server/lib/java/lib/zip4j-2.5.0.jar +0 -0
- package/lib/serve/server/lib/master.js +26 -15
- package/lib/serve/server/lib/node.js +7 -3
- package/lib/serve/server/lib/web_client/index.js +3 -3
- package/lib/serve/server/lib/web_client/server.js +17 -17
- package/lib/shell/dependencies/http-functions.js +38 -33
- package/lib/shell/dependencies/invoker/bio/java/JavabioInvoker.java +7 -2
- package/lib/shell/dependencies/invoker/cron/java/JavacronInvoker.java +7 -2
- package/lib/shell/dependencies/invoker/event/java/JavaeventInvoker.java +7 -2
- package/lib/shell/dependencies/invoker/integ/java/JavaintegInvoker.java +7 -2
- package/lib/shell/dependencies/invoker/integ/node.js +8 -4
- package/lib/shell/dependencies/local-function.js +44 -40
- package/lib/shell/index.js +12 -12
- package/lib/shell/prepare/index.js +2 -2
- package/lib/shell/prepare/languages/index.js +5 -1
- package/lib/shell/prepare/languages/java.js +1 -1
- package/lib/throbber/index.js +17 -17
- package/lib/throbber/utils.js +9 -9
- package/lib/track.js +7 -7
- package/lib/util_modules/config/index.js +5 -1
- package/lib/util_modules/constants/lib/auth.js +6 -6
- package/lib/util_modules/constants/lib/cliq-handlers.js +2 -2
- package/lib/util_modules/constants/lib/template.js +21 -21
- package/lib/util_modules/constants/lib/urls.js +11 -11
- package/lib/util_modules/context-help.js +15 -15
- package/lib/util_modules/fs/index.js +5 -1
- package/lib/util_modules/fs/lib/async.js +4 -4
- package/lib/util_modules/fs/utils.js +1 -1
- package/lib/util_modules/logger.js +2 -2
- package/lib/util_modules/parser/toml.js +1 -1
- package/lib/util_modules/project.js +6 -6
- package/lib/util_modules/shell.js +4 -4
- package/lib/winston.js +5 -5
- package/package.json +39 -39
- package/scripts/postInstall.js +7 -6
- package/docs/.DS_Store +0 -0
- package/lib/serve/server/lib/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
- package/templates/.DS_Store +0 -0
- package/templates/init/.DS_Store +0 -0
- package/templates/init/client/.DS_Store +0 -0
- package/templates/init/client/react/.DS_Store +0 -0
- package/templates/init/functions/node/integ/cliq/.DS_Store +0 -0
|
@@ -24,12 +24,12 @@ const option_1 = require("../../util_modules/option");
|
|
|
24
24
|
const shell_1 = require("../../util_modules/shell");
|
|
25
25
|
const fs_1 = require("../../util_modules/fs");
|
|
26
26
|
const getReadConfigFromPath = (pth) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
const configJSON = yield fs_1.ASYNC.readJSONFile(path_1.resolve(pth), {
|
|
27
|
+
const configJSON = yield fs_1.ASYNC.readJSONFile((0, path_1.resolve)(pth), {
|
|
28
28
|
checkpath: true,
|
|
29
29
|
throws: false
|
|
30
30
|
});
|
|
31
31
|
if (!configJSON || Object.keys(configJSON).length === 0) {
|
|
32
|
-
logger_1.debug('No parsable export config given');
|
|
32
|
+
(0, logger_1.debug)('No parsable export config given');
|
|
33
33
|
return {};
|
|
34
34
|
}
|
|
35
35
|
return configJSON;
|
|
@@ -44,26 +44,26 @@ exports.default = new command_1.default('ds:export [table]')
|
|
|
44
44
|
.needs('config')
|
|
45
45
|
.needs('rc')
|
|
46
46
|
.action((optTable) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
-
const env = option_1.getOptionValue('production', false) ? 'Production' : 'Development';
|
|
48
|
-
const configPath = option_1.getOptionValue('config', false);
|
|
47
|
+
const env = (0, option_1.getOptionValue)('production', false) ? 'Production' : 'Development';
|
|
48
|
+
const configPath = (0, option_1.getOptionValue)('config', false);
|
|
49
49
|
const exportConfig = configPath ? yield getReadConfigFromPath(configPath) : {};
|
|
50
|
-
const tableOptId = option_1.getOptionValue('table', exportConfig.table_identifier + '');
|
|
50
|
+
const tableOptId = (0, option_1.getOptionValue)('table', exportConfig.table_identifier + '');
|
|
51
51
|
const tableId = optTable ? optTable : tableOptId;
|
|
52
52
|
if (!tableId) {
|
|
53
53
|
throw new error_1.default('table identifier missing', { exit: 0, errorId: 'EXP-1' });
|
|
54
54
|
}
|
|
55
|
-
const page = option_1.getOptionValue('page', undefined);
|
|
55
|
+
const page = (0, option_1.getOptionValue)('page', undefined);
|
|
56
56
|
if (page !== undefined) {
|
|
57
57
|
if (!exportConfig.query) {
|
|
58
58
|
exportConfig.query = {};
|
|
59
59
|
}
|
|
60
60
|
exportConfig.query.page = page;
|
|
61
61
|
}
|
|
62
|
-
const bulkAPI = yield endpoints_1.bulkDSAPI({ env });
|
|
62
|
+
const bulkAPI = yield (0, endpoints_1.bulkDSAPI)({ env });
|
|
63
63
|
const readResponse = (yield bulkAPI.read(tableId, exportConfig));
|
|
64
|
-
logger_1.info();
|
|
65
|
-
logger_1.success(`Successfully scheduled export job for table "${tableId}" with jobid "${readResponse.job_id}"`);
|
|
66
|
-
if (env_1.isPrimaryShell()) {
|
|
64
|
+
(0, logger_1.info)();
|
|
65
|
+
(0, logger_1.success)(`Successfully scheduled export job for table "${tableId}" with jobid "${readResponse.job_id}"`);
|
|
66
|
+
if ((0, env_1.isPrimaryShell)()) {
|
|
67
67
|
const exitListeners = process.listeners('exit');
|
|
68
68
|
process.removeAllListeners('exit');
|
|
69
69
|
const allGlobalOpts = runtime_store_1.default.get('opts.globalOpts', {});
|
|
@@ -74,7 +74,7 @@ exports.default = new command_1.default('ds:export [table]')
|
|
|
74
74
|
}
|
|
75
75
|
return arr;
|
|
76
76
|
}, (env === 'Production' ? ['--production'] : []));
|
|
77
|
-
shell_1.spawn('catalyst', ['ds:status', 'export', readResponse.job_id + '', ...optsArr], {
|
|
77
|
+
(0, shell_1.spawn)('catalyst', ['ds:status', 'export', readResponse.job_id + '', ...optsArr], {
|
|
78
78
|
shell: true,
|
|
79
79
|
stdio: 'inherit'
|
|
80
80
|
}).SYNC();
|
|
@@ -25,12 +25,12 @@ const logger_1 = require("../../util_modules/logger");
|
|
|
25
25
|
const option_1 = require("../../util_modules/option");
|
|
26
26
|
const shell_1 = require("../../util_modules/shell");
|
|
27
27
|
const getWriteConfigFromPath = (pth) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
-
const configJSON = yield fs_1.ASYNC.readJSONFile(path_1.resolve(pth), {
|
|
28
|
+
const configJSON = yield fs_1.ASYNC.readJSONFile((0, path_1.resolve)(pth), {
|
|
29
29
|
checkpath: true,
|
|
30
30
|
throws: false
|
|
31
31
|
});
|
|
32
32
|
if (!configJSON || Object.keys(configJSON).length === 0) {
|
|
33
|
-
logger_1.debug('No parsable import config given');
|
|
33
|
+
(0, logger_1.debug)('No parsable import config given');
|
|
34
34
|
return {};
|
|
35
35
|
}
|
|
36
36
|
return configJSON;
|
|
@@ -44,10 +44,10 @@ exports.default = new command_1.default('ds:import [file]')
|
|
|
44
44
|
.needs('config')
|
|
45
45
|
.needs('rc')
|
|
46
46
|
.action((uploadFile) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
-
const env = option_1.getOptionValue('production', false) ? 'Production' : 'Development';
|
|
48
|
-
const configPath = option_1.getOptionValue('config', false);
|
|
47
|
+
const env = (0, option_1.getOptionValue)('production', false) ? 'Production' : 'Development';
|
|
48
|
+
const configPath = (0, option_1.getOptionValue)('config', false);
|
|
49
49
|
const importConfig = configPath ? yield getWriteConfigFromPath(configPath) : {};
|
|
50
|
-
const tableId = option_1.getOptionValue('table', importConfig.table_identifier + '');
|
|
50
|
+
const tableId = (0, option_1.getOptionValue)('table', importConfig.table_identifier + '');
|
|
51
51
|
if (!tableId) {
|
|
52
52
|
throw new error_1.default('Table identifier missing', { exit: 0, errorId: 'IMP-1' });
|
|
53
53
|
}
|
|
@@ -55,7 +55,7 @@ exports.default = new command_1.default('ds:import [file]')
|
|
|
55
55
|
if (!uploadFile) {
|
|
56
56
|
throw new error_1.default('No CSV file provided', { exit: 0, errorId: 'IMP-2' });
|
|
57
57
|
}
|
|
58
|
-
const fileAPI = yield endpoints_1.filestoreAPI({ env });
|
|
58
|
+
const fileAPI = yield (0, endpoints_1.filestoreAPI)({ env });
|
|
59
59
|
const allFolders = (yield fileAPI.getAllFolders());
|
|
60
60
|
if (allFolders.length > 0) {
|
|
61
61
|
const choices = allFolders.map((folderDetail) => prompt_1.default.choice(folderDetail.folder_name, {
|
|
@@ -65,18 +65,18 @@ exports.default = new command_1.default('ds:import [file]')
|
|
|
65
65
|
type: 'list',
|
|
66
66
|
choices
|
|
67
67
|
}));
|
|
68
|
-
const fileDetails = (yield fileAPI.uploadFile(folderAns.folder, fs_1.SYNC.getReadStream(path_1.resolve(uploadFile))));
|
|
68
|
+
const fileDetails = (yield fileAPI.uploadFile(folderAns.folder, fs_1.SYNC.getReadStream((0, path_1.resolve)(uploadFile))));
|
|
69
69
|
importConfig.file_id = fileDetails.id;
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
72
|
throw new error_1.default('folder needed', { exit: 0, errorId: 'IMP-3' });
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
const bulkAPI = yield endpoints_1.bulkDSAPI({ env });
|
|
75
|
+
const bulkAPI = yield (0, endpoints_1.bulkDSAPI)({ env });
|
|
76
76
|
const writeResponse = (yield bulkAPI.write(tableId, importConfig));
|
|
77
|
-
logger_1.info();
|
|
78
|
-
logger_1.success(`Successfully scheduled import job for table "${tableId}" with jobid "${writeResponse.job_id}"`);
|
|
79
|
-
if (env_1.isPrimaryShell()) {
|
|
77
|
+
(0, logger_1.info)();
|
|
78
|
+
(0, logger_1.success)(`Successfully scheduled import job for table "${tableId}" with jobid "${writeResponse.job_id}"`);
|
|
79
|
+
if ((0, env_1.isPrimaryShell)()) {
|
|
80
80
|
const exitListeners = process.listeners('exit');
|
|
81
81
|
process.removeAllListeners('exit');
|
|
82
82
|
const allGlobalOpts = runtime_store_1.default.get('opts.globalOpts', {});
|
|
@@ -87,7 +87,7 @@ exports.default = new command_1.default('ds:import [file]')
|
|
|
87
87
|
}
|
|
88
88
|
return arr;
|
|
89
89
|
}, (env === 'Production' ? ['--production'] : []));
|
|
90
|
-
shell_1.spawn('catalyst', ['ds:status', 'import', writeResponse.job_id + '', ...optsArr], {
|
|
90
|
+
(0, shell_1.spawn)('catalyst', ['ds:status', 'import', writeResponse.job_id + '', ...optsArr], {
|
|
91
91
|
shell: true,
|
|
92
92
|
stdio: 'inherit'
|
|
93
93
|
}).SYNC();
|
|
@@ -37,14 +37,14 @@ const getSpinnerTxt = (mainTable, finalReport) => {
|
|
|
37
37
|
return spinnerTxt;
|
|
38
38
|
}
|
|
39
39
|
if (finalReport.status === 'Completed') {
|
|
40
|
-
spinnerTxt += ansi_colors_1.green(((_a = finalReport.results) === null || _a === void 0 ? void 0 : _a.description) + '');
|
|
40
|
+
spinnerTxt += (0, ansi_colors_1.green)(((_a = finalReport.results) === null || _a === void 0 ? void 0 : _a.description) + '');
|
|
41
41
|
if (((_b = finalReport.results) === null || _b === void 0 ? void 0 : _b.download_url) !== undefined) {
|
|
42
42
|
spinnerTxt += '\n';
|
|
43
|
-
spinnerTxt += ansi_colors_1.bold(`Download URL : ${(_c = finalReport.results) === null || _c === void 0 ? void 0 : _c.download_url}`);
|
|
43
|
+
spinnerTxt += (0, ansi_colors_1.bold)(`Download URL : ${(_c = finalReport.results) === null || _c === void 0 ? void 0 : _c.download_url}`);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
|
-
spinnerTxt += ansi_colors_1.red(ansi_colors_1.bold('Reason : ') + ((_d = finalReport.results) === null || _d === void 0 ? void 0 : _d.description));
|
|
47
|
+
spinnerTxt += (0, ansi_colors_1.red)((0, ansi_colors_1.bold)('Reason : ') + ((_d = finalReport.results) === null || _d === void 0 ? void 0 : _d.description));
|
|
48
48
|
}
|
|
49
49
|
return spinnerTxt;
|
|
50
50
|
};
|
|
@@ -174,17 +174,17 @@ exports.default = new command_1.default('ds:status <operation> [jobid]')
|
|
|
174
174
|
.needs('config')
|
|
175
175
|
.needs('rc')
|
|
176
176
|
.action((operation, jobId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
177
|
-
const env = option_1.getOptionValue('production', false) ? 'Production' : 'Development';
|
|
177
|
+
const env = (0, option_1.getOptionValue)('production', false) ? 'Production' : 'Development';
|
|
178
178
|
const action = operation === 'import' ? 'write' : 'read';
|
|
179
179
|
const displayOpr = operation === 'import' ? 'Import' : 'Export';
|
|
180
|
-
const bulkApi = yield endpoints_1.bulkDSAPI({ env });
|
|
180
|
+
const bulkApi = yield (0, endpoints_1.bulkDSAPI)({ env });
|
|
181
181
|
if (jobId === undefined) {
|
|
182
182
|
const jobsList = (yield bulkApi.getAllJobs(action));
|
|
183
183
|
if (jobsList === undefined || jobsList.length === 0) {
|
|
184
184
|
throw new error_1.default('No jobs available', {
|
|
185
185
|
exit: 0,
|
|
186
186
|
errorId: 'STAT-1',
|
|
187
|
-
arg: [ansi_colors_1.bold('ds:import or ds:export')]
|
|
187
|
+
arg: [(0, ansi_colors_1.bold)('ds:import or ds:export')]
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
const listTable = new cli_table_1.default();
|
|
@@ -202,8 +202,8 @@ exports.default = new command_1.default('ds:status <operation> [jobid]')
|
|
|
202
202
|
value: jobDetails.job_id
|
|
203
203
|
});
|
|
204
204
|
});
|
|
205
|
-
logger_1.info('List of ' + displayOpr + ' Jobs :');
|
|
206
|
-
logger_1.info(listTable.toString());
|
|
205
|
+
(0, logger_1.info)('List of ' + displayOpr + ' Jobs :');
|
|
206
|
+
(0, logger_1.info)(listTable.toString());
|
|
207
207
|
const jobAns = yield prompt_1.default.ask(prompt_1.default.question('job', `Select an ${operation} job id, to view detailed status : `, {
|
|
208
208
|
type: 'list',
|
|
209
209
|
choices
|
|
@@ -218,7 +218,7 @@ exports.default = new command_1.default('ds:status <operation> [jobid]')
|
|
|
218
218
|
throw new error_1.default('No jobs found for the given id', {
|
|
219
219
|
exit: 1,
|
|
220
220
|
errorId: 'STAT-2',
|
|
221
|
-
arg: [ansi_colors_1.bold(jobId), ansi_colors_1.bold('catalyst ds:status ' + operation)]
|
|
221
|
+
arg: [(0, ansi_colors_1.bold)(jobId), (0, ansi_colors_1.bold)('catalyst ds:status ' + operation)]
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
throw err;
|
|
@@ -238,7 +238,7 @@ exports.default = new command_1.default('ds:status <operation> [jobid]')
|
|
|
238
238
|
const hrTime = process.hrtime();
|
|
239
239
|
const fileName = `${displayOpr}_${jobId}_${hrTime[0] * 1000000000 + hrTime[1]}.zip`;
|
|
240
240
|
const bulkReport = (yield bulkApi.downloadReport(finalDsReport.results.download_url, fileName));
|
|
241
|
-
return fs_1.ASYNC.writeFile(path_1.join(process.cwd(), fileName), bulkReport);
|
|
241
|
+
return fs_1.ASYNC.writeFile((0, path_1.join)(process.cwd(), fileName), bulkReport);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
}));
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -50,12 +54,12 @@ exports.default = new command_1.default('event:generate <source> <action>')
|
|
|
50
54
|
.needs('auth')
|
|
51
55
|
.action(function generate(source, action) {
|
|
52
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
const unknownArgs = option_1.getUnknownOpts([]);
|
|
57
|
+
const unknownArgs = (0, option_1.getUnknownOpts)([]);
|
|
54
58
|
if (unknownArgs.length % 2 !== 0) {
|
|
55
59
|
throw new error_1.default('Unknown options are not provided as key value pairs', {
|
|
56
60
|
exit: 1,
|
|
57
61
|
errorId: 'IDX-1',
|
|
58
|
-
arg: [ansi_colors_1.bold(source), ansi_colors_1.bold(action), ansi_colors_1.bold('--key value')]
|
|
62
|
+
arg: [(0, ansi_colors_1.bold)(source), (0, ansi_colors_1.bold)(action), (0, ansi_colors_1.bold)('--key value')]
|
|
59
63
|
});
|
|
60
64
|
}
|
|
61
65
|
const remoteSourceName = constants_1.EVENT_SOURCE[source];
|
|
@@ -64,7 +68,7 @@ exports.default = new command_1.default('event:generate <source> <action>')
|
|
|
64
68
|
exit: 1,
|
|
65
69
|
errorId: 'IDX-2',
|
|
66
70
|
arg: [
|
|
67
|
-
ansi_colors_1.bold(Object.keys(constants_1.EVENT_SOURCE)
|
|
71
|
+
(0, ansi_colors_1.bold)(Object.keys(constants_1.EVENT_SOURCE)
|
|
68
72
|
.map((src) => '* ' + src)
|
|
69
73
|
.join('\n'))
|
|
70
74
|
]
|
|
@@ -87,21 +91,21 @@ exports.default = new command_1.default('event:generate <source> <action>')
|
|
|
87
91
|
currentValue !== '--verbose') {
|
|
88
92
|
const fault = unknownArgs === null || unknownArgs === void 0 ? void 0 : unknownArgs.map((arg) => {
|
|
89
93
|
if (arg === currentValue) {
|
|
90
|
-
return ansi_colors_1.red(arg);
|
|
94
|
+
return (0, ansi_colors_1.red)(arg);
|
|
91
95
|
}
|
|
92
96
|
return arg;
|
|
93
97
|
}).join(' ');
|
|
94
98
|
throw new error_1.default('Invalid option format detected', {
|
|
95
99
|
exit: 1,
|
|
96
100
|
errorId: 'IDX-3',
|
|
97
|
-
arg: [ansi_colors_1.italic(fault), ansi_colors_1.bold('--<option> <value>')]
|
|
101
|
+
arg: [(0, ansi_colors_1.italic)(fault), (0, ansi_colors_1.bold)('--<option> <value>')]
|
|
98
102
|
});
|
|
99
103
|
}
|
|
100
104
|
previousValue[currentValue.slice(2)] = optionArr[currentIndex + 1];
|
|
101
105
|
}
|
|
102
106
|
return previousValue;
|
|
103
107
|
}, {});
|
|
104
|
-
let eventBusName = option_1.getOptionValue('eventBus', false);
|
|
108
|
+
let eventBusName = (0, option_1.getOptionValue)('eventBus', false);
|
|
105
109
|
if (!eventBusName) {
|
|
106
110
|
eventBusName = constants_1.DEFAULT.event_bus.name;
|
|
107
111
|
}
|
|
@@ -109,10 +113,10 @@ exports.default = new command_1.default('event:generate <source> <action>')
|
|
|
109
113
|
throw new error_1.default('Event bus details not provided', {
|
|
110
114
|
exit: 0,
|
|
111
115
|
errorId: 'IDX-4',
|
|
112
|
-
arg: [ansi_colors_1.bold('-e or --event-bus')]
|
|
116
|
+
arg: [(0, ansi_colors_1.bold)('-e or --event-bus')]
|
|
113
117
|
});
|
|
114
118
|
}
|
|
115
|
-
const remoteEventBusDetails = (yield (yield endpoints_1.eventBusAPI()).getAllEventBusDetails());
|
|
119
|
+
const remoteEventBusDetails = (yield (yield (0, endpoints_1.eventBusAPI)()).getAllEventBusDetails());
|
|
116
120
|
const currentEventBusDetails = remoteEventBusDetails.filter((eventBus) => eventBus.name === eventBusName)[0];
|
|
117
121
|
if (currentEventBusDetails === undefined) {
|
|
118
122
|
const availableBuses = remoteEventBusDetails
|
|
@@ -123,20 +127,20 @@ exports.default = new command_1.default('event:generate <source> <action>')
|
|
|
123
127
|
throw new error_1.default('No matching event bus details found', {
|
|
124
128
|
exit: 1,
|
|
125
129
|
errorId: 'IDX-5',
|
|
126
|
-
arg: [ansi_colors_1.bold(eventBusName), ansi_colors_1.bold(availableBuses)]
|
|
130
|
+
arg: [(0, ansi_colors_1.bold)(eventBusName), (0, ansi_colors_1.bold)(availableBuses)]
|
|
127
131
|
});
|
|
128
132
|
}
|
|
129
133
|
const eventDataPlaceHolder = constants_1.PLACEHOLDER.event_data;
|
|
130
134
|
Object.keys(eventDataPlaceHolder).forEach((placeholderKey) => {
|
|
131
135
|
switch (placeholderKey) {
|
|
132
136
|
case 'project_id':
|
|
133
|
-
eventJsonContent = eventJsonContent === null || eventJsonContent === void 0 ? void 0 : eventJsonContent.replace(new RegExp(eventDataPlaceHolder[placeholderKey], 'g'), project_1.getProjectId() + '');
|
|
137
|
+
eventJsonContent = eventJsonContent === null || eventJsonContent === void 0 ? void 0 : eventJsonContent.replace(new RegExp(eventDataPlaceHolder[placeholderKey], 'g'), (0, project_1.getProjectId)() + '');
|
|
134
138
|
break;
|
|
135
139
|
case 'project_name':
|
|
136
|
-
eventJsonContent = eventJsonContent === null || eventJsonContent === void 0 ? void 0 : eventJsonContent.replace(new RegExp(eventDataPlaceHolder[placeholderKey], 'g'), project_1.getProjectName() + '');
|
|
140
|
+
eventJsonContent = eventJsonContent === null || eventJsonContent === void 0 ? void 0 : eventJsonContent.replace(new RegExp(eventDataPlaceHolder[placeholderKey], 'g'), (0, project_1.getProjectName)() + '');
|
|
137
141
|
break;
|
|
138
142
|
case 'eventbus_id':
|
|
139
|
-
logger_1.debug(`eventBusName provided is : ${eventBusName} and id is ${currentEventBusDetails.id}`);
|
|
143
|
+
(0, logger_1.debug)(`eventBusName provided is : ${eventBusName} and id is ${currentEventBusDetails.id}`);
|
|
140
144
|
eventJsonContent = eventJsonContent === null || eventJsonContent === void 0 ? void 0 : eventJsonContent.replace(new RegExp(eventDataPlaceHolder[placeholderKey], 'g'), currentEventBusDetails.id + '');
|
|
141
145
|
break;
|
|
142
146
|
case 'eventbus_name':
|
|
@@ -145,17 +149,17 @@ exports.default = new command_1.default('event:generate <source> <action>')
|
|
|
145
149
|
case 'action':
|
|
146
150
|
const eventRefArr = constants_1.EVENT_REF[remoteSourceName];
|
|
147
151
|
const remoteRefAction = action.charAt(0).toUpperCase() + action.slice(1);
|
|
148
|
-
logger_1.debug(`action provided is : ${remoteRefAction}`);
|
|
152
|
+
(0, logger_1.debug)(`action provided is : ${remoteRefAction}`);
|
|
149
153
|
const indexOfAction = eventRefArr.indexOf(remoteRefAction);
|
|
150
154
|
if (indexOfAction < 0) {
|
|
151
155
|
throw new error_1.default('Action incompatible with the source ' + eventRefArr, {
|
|
152
156
|
exit: 1,
|
|
153
157
|
errorId: 'IDX-6',
|
|
154
158
|
arg: [
|
|
155
|
-
ansi_colors_1.bold(action),
|
|
159
|
+
(0, ansi_colors_1.bold)(action),
|
|
156
160
|
ansi_colors_1.bold.red('X'),
|
|
157
|
-
ansi_colors_1.bold(source),
|
|
158
|
-
ansi_colors_1.bold(eventRefArr.map((act) => '* ' + act).join('\n'))
|
|
161
|
+
(0, ansi_colors_1.bold)(source),
|
|
162
|
+
(0, ansi_colors_1.bold)(eventRefArr.map((act) => '* ' + act).join('\n'))
|
|
159
163
|
]
|
|
160
164
|
});
|
|
161
165
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -47,10 +51,10 @@ exports.default = new command_1.default('event:generate:integ <service>')
|
|
|
47
51
|
throw new error_1.default('Unknown service requested', {
|
|
48
52
|
exit: 1,
|
|
49
53
|
errorId: 'INTEG-1',
|
|
50
|
-
arg: [ansi_colors_1.bold(availableServices.map((service) => '* ' + service).join('\n'))]
|
|
54
|
+
arg: [(0, ansi_colors_1.bold)(availableServices.map((service) => '* ' + service).join('\n'))]
|
|
51
55
|
});
|
|
52
56
|
}
|
|
53
|
-
const inputs = option_1.getOptionValue('inputs', '');
|
|
57
|
+
const inputs = (0, option_1.getOptionValue)('inputs', '');
|
|
54
58
|
const serviceValue = constants_1.INTEG.service_map[service];
|
|
55
59
|
const serviceModule = (yield Promise.resolve().then(() => __importStar(require(`../../../event_generate/integration/${serviceValue}`))))
|
|
56
60
|
.default;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -45,7 +49,7 @@ exports.default = new command_1.default('functions:add')
|
|
|
45
49
|
const config = runtime_store_1.default.get('config');
|
|
46
50
|
yield (yield Promise.resolve().then(() => __importStar(require('../../init/features')))).functions(true);
|
|
47
51
|
yield config.save();
|
|
48
|
-
logger_1.message(ansi_colors_1.bold(constants_1.FILENAME.config) + ' file has been successfully updated with functions details.');
|
|
49
|
-
logger_1.info();
|
|
50
|
-
logger_1.success('Catalyst functions add complete!');
|
|
52
|
+
(0, logger_1.message)((0, ansi_colors_1.bold)(constants_1.FILENAME.config) + ' file has been successfully updated with functions details.');
|
|
53
|
+
(0, logger_1.info)();
|
|
54
|
+
(0, logger_1.success)('Catalyst functions add complete!');
|
|
51
55
|
}));
|
|
@@ -26,7 +26,7 @@ exports.default = new command_1.default('functions:config [function_name_or_id]'
|
|
|
26
26
|
.needs('config')
|
|
27
27
|
.needs('rc')
|
|
28
28
|
.action((targetFn) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
-
const fnApi = yield endpoints_1.functionsAPI();
|
|
29
|
+
const fnApi = yield (0, endpoints_1.functionsAPI)();
|
|
30
30
|
const allRemoteFn = (yield fnApi.getAllFunctions());
|
|
31
31
|
if (allRemoteFn.length === 0) {
|
|
32
32
|
throw new error_1.default('No Functions present in the Catalyst remote console', {
|
|
@@ -36,7 +36,7 @@ exports.default = new command_1.default('functions:config [function_name_or_id]'
|
|
|
36
36
|
}
|
|
37
37
|
let remoteTarget = undefined;
|
|
38
38
|
if (targetFn === undefined) {
|
|
39
|
-
const fnChoices = allRemoteFn.map((remoteFn) => prompt_1.default.choice(`${ansi_colors_1.bold(remoteFn.name)} -- ${remoteFn.id}`, {
|
|
39
|
+
const fnChoices = allRemoteFn.map((remoteFn) => prompt_1.default.choice(`${(0, ansi_colors_1.bold)(remoteFn.name)} -- ${remoteFn.id}`, {
|
|
40
40
|
value: remoteFn,
|
|
41
41
|
short: remoteFn.name
|
|
42
42
|
}));
|
|
@@ -55,11 +55,11 @@ exports.default = new command_1.default('functions:config [function_name_or_id]'
|
|
|
55
55
|
exit: 1,
|
|
56
56
|
errorId: 'CONF-2',
|
|
57
57
|
arg: [
|
|
58
|
-
ansi_colors_1.bold(targetFn),
|
|
59
|
-
ansi_colors_1.bold(allRemoteFn.map((fn) => `* ${fn.name} (${fn.id})`).join('\n'))
|
|
58
|
+
(0, ansi_colors_1.bold)(targetFn),
|
|
59
|
+
(0, ansi_colors_1.bold)(allRemoteFn.map((fn) => `* ${fn.name} (${fn.id})`).join('\n'))
|
|
60
60
|
]
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
return common_1.updateFnConfig(remoteTarget);
|
|
64
|
+
return (0, common_1.updateFnConfig)(remoteTarget);
|
|
65
65
|
}));
|
|
@@ -34,16 +34,16 @@ exports.default = new command_1.default('functions:delete [function_name_or_id]'
|
|
|
34
34
|
.needs('rc')
|
|
35
35
|
.action((fnTarget) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
36
|
const { local = 'LOCAL', remote = 'REMOTE' } = {};
|
|
37
|
-
const sourceDir = project_1.resolveProjectPath(config_1.functionsConfig.source());
|
|
38
|
-
const fnApi = yield endpoints_1.functionsAPI();
|
|
39
|
-
let localOpt = option_1.getOptionValue('local', false);
|
|
40
|
-
let remoteOpt = option_1.getOptionValue('remote', false);
|
|
37
|
+
const sourceDir = (0, project_1.resolveProjectPath)(config_1.functionsConfig.source());
|
|
38
|
+
const fnApi = yield (0, endpoints_1.functionsAPI)();
|
|
39
|
+
let localOpt = (0, option_1.getOptionValue)('local', false);
|
|
40
|
+
let remoteOpt = (0, option_1.getOptionValue)('remote', false);
|
|
41
41
|
const choiceArr = [];
|
|
42
42
|
if (localOpt && remoteOpt) {
|
|
43
43
|
throw new error_1.default('local and remote opts specified in the same command', {
|
|
44
44
|
exit: 1,
|
|
45
45
|
errorId: 'FDEL-1',
|
|
46
|
-
arg: [ansi_colors_1.bold('--local'), ansi_colors_1.bold('--remote')]
|
|
46
|
+
arg: [(0, ansi_colors_1.bold)('--local'), (0, ansi_colors_1.bold)('--remote')]
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
if (!localOpt && !remoteOpt) {
|
|
@@ -73,7 +73,7 @@ exports.default = new command_1.default('functions:delete [function_name_or_id]'
|
|
|
73
73
|
throw new error_1.default('No targets found in local', {
|
|
74
74
|
exit: 0,
|
|
75
75
|
errorId: 'FDEL-2',
|
|
76
|
-
arg: [ansi_colors_1.bold('catalyst functions:add')]
|
|
76
|
+
arg: [(0, ansi_colors_1.bold)('catalyst functions:add')]
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
if (fnTarget !== undefined) {
|
|
@@ -87,18 +87,18 @@ exports.default = new command_1.default('functions:delete [function_name_or_id]'
|
|
|
87
87
|
throw new error_1.default('function not available in local', {
|
|
88
88
|
exit: 1,
|
|
89
89
|
errorId: 'FDEL-4',
|
|
90
|
-
arg: [ansi_colors_1.bold(fnTarget), ansi_colors_1.bold(target.map((tar) => '* ' + tar).join('\n'))]
|
|
90
|
+
arg: [(0, ansi_colors_1.bold)(fnTarget), (0, ansi_colors_1.bold)(target.map((tar) => '* ' + tar).join('\n'))]
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
target = [fnTarget];
|
|
94
94
|
}
|
|
95
|
-
const localTargets = target.map((fn) => project_1.resolveProjectPath(path_1.join(sourceDir, fn)));
|
|
96
|
-
const localChoices = (yield common_1.refineTargets(localTargets, false)).map((fn) => {
|
|
95
|
+
const localTargets = target.map((fn) => (0, project_1.resolveProjectPath)((0, path_1.join)(sourceDir, fn)));
|
|
96
|
+
const localChoices = (yield (0, common_1.refineTargets)(localTargets, false)).map((fn) => {
|
|
97
97
|
if (!fn.valid) {
|
|
98
|
-
logger_1.debug(`Invalid function target since, ${fn.failure_reason}.`);
|
|
98
|
+
(0, logger_1.debug)(`Invalid function target since, ${fn.failure_reason}.`);
|
|
99
99
|
}
|
|
100
|
-
const name = js_1.JS.isEmpty(fn.name) ? path_1.basename(fn.source) : fn.name;
|
|
101
|
-
let cStr = ansi_colors_1.bold(name);
|
|
100
|
+
const name = js_1.JS.isEmpty(fn.name) ? (0, path_1.basename)(fn.source) : fn.name;
|
|
101
|
+
let cStr = (0, ansi_colors_1.bold)(name);
|
|
102
102
|
cStr =
|
|
103
103
|
fn.type === undefined
|
|
104
104
|
? cStr
|
|
@@ -126,7 +126,7 @@ exports.default = new command_1.default('functions:delete [function_name_or_id]'
|
|
|
126
126
|
throw new error_1.default('No targets found in remote', {
|
|
127
127
|
exit: 0,
|
|
128
128
|
errorId: 'FDEL-5',
|
|
129
|
-
arg: [ansi_colors_1.bold('catalyst deploy')]
|
|
129
|
+
arg: [(0, ansi_colors_1.bold)('catalyst deploy')]
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
if (fnTarget !== undefined) {
|
|
@@ -138,8 +138,8 @@ exports.default = new command_1.default('functions:delete [function_name_or_id]'
|
|
|
138
138
|
exit: 1,
|
|
139
139
|
errorId: 'FDEL-6',
|
|
140
140
|
arg: [
|
|
141
|
-
ansi_colors_1.bold(fnTarget),
|
|
142
|
-
ansi_colors_1.bold(remoteTargets
|
|
141
|
+
(0, ansi_colors_1.bold)(fnTarget),
|
|
142
|
+
(0, ansi_colors_1.bold)(remoteTargets
|
|
143
143
|
.map((rTarget) => '* ' + rTarget.name + ' -- ' + rTarget.id)
|
|
144
144
|
.join('\n'))
|
|
145
145
|
]
|
|
@@ -153,7 +153,7 @@ exports.default = new command_1.default('functions:delete [function_name_or_id]'
|
|
|
153
153
|
fn.type === constants_1.REMOTE_REF.functions.type[constants_1.FN_TYPE.applogic]
|
|
154
154
|
? constants_1.REMOTE_REF.functions.type[constants_1.FN_TYPE.advanced]
|
|
155
155
|
: fn.type;
|
|
156
|
-
return prompt_1.default.choice(`${ansi_colors_1.bold(name)} -- ${fn.type} -- ${fn.stack}`, {
|
|
156
|
+
return prompt_1.default.choice(`${(0, ansi_colors_1.bold)(name)} -- ${fn.type} -- ${fn.stack}`, {
|
|
157
157
|
value: {
|
|
158
158
|
id: fn.id + '',
|
|
159
159
|
stack: fn.stack,
|
|
@@ -192,7 +192,7 @@ exports.default = new command_1.default('functions:delete [function_name_or_id]'
|
|
|
192
192
|
defaultAns: false
|
|
193
193
|
}));
|
|
194
194
|
if (!consentAns.consent) {
|
|
195
|
-
logger_1.message('Aborted by user');
|
|
195
|
+
(0, logger_1.message)('Aborted by user');
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
198
|
yield Promise.all(fnToDelete.map((fn) => {
|
|
@@ -201,11 +201,11 @@ exports.default = new command_1.default('functions:delete [function_name_or_id]'
|
|
|
201
201
|
}
|
|
202
202
|
else {
|
|
203
203
|
if (fn.source) {
|
|
204
|
-
return common_1.deleteFunctionLocal(fn.source);
|
|
204
|
+
return (0, common_1.deleteFunctionLocal)(fn.source);
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
return;
|
|
208
208
|
}));
|
|
209
|
-
logger_1.info();
|
|
210
|
-
logger_1.success('Functions delete completed!');
|
|
209
|
+
(0, logger_1.info)();
|
|
210
|
+
(0, logger_1.success)('Functions delete completed!');
|
|
211
211
|
}));
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -45,7 +49,7 @@ exports.default = new command_1.default('functions:setup')
|
|
|
45
49
|
const config = runtime_store_1.default.get('config');
|
|
46
50
|
yield (yield Promise.resolve().then(() => __importStar(require('../../init/features')))).functions();
|
|
47
51
|
yield config.save();
|
|
48
|
-
logger_1.message(ansi_colors_1.bold(constants_1.FILENAME.config) + ' file has been successfully updated with functions details.');
|
|
49
|
-
logger_1.info();
|
|
50
|
-
logger_1.success('Catalyst functions setup complete!');
|
|
52
|
+
(0, logger_1.message)((0, ansi_colors_1.bold)(constants_1.FILENAME.config) + ' file has been successfully updated with functions details.');
|
|
53
|
+
(0, logger_1.info)();
|
|
54
|
+
(0, logger_1.success)('Catalyst functions setup complete!');
|
|
51
55
|
}));
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -50,11 +54,11 @@ exports.default = new command_1.default('functions:shell')
|
|
|
50
54
|
.needs('config')
|
|
51
55
|
.needs('rc')
|
|
52
56
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
-
const httpOpt = option_1.getOptionValue('http', false);
|
|
57
|
+
const httpOpt = (0, option_1.getOptionValue)('http', false);
|
|
54
58
|
if (httpOpt && typeof httpOpt !== 'boolean') {
|
|
55
59
|
runtime_store_1.default.set('context.port.http.basicio', httpOpt);
|
|
56
60
|
}
|
|
57
|
-
const debugOpt = option_1.getOptionValue('debug', false);
|
|
61
|
+
const debugOpt = (0, option_1.getOptionValue)('debug', false);
|
|
58
62
|
if (debugOpt && typeof debugOpt !== 'boolean') {
|
|
59
63
|
runtime_store_1.default.set('context.port.debug.basicio', debugOpt);
|
|
60
64
|
}
|
package/lib/commands/help.js
CHANGED
|
@@ -12,14 +12,14 @@ exports.default = new command_1.default('help [command]')
|
|
|
12
12
|
var _a, _b, _c;
|
|
13
13
|
if (commandName === undefined) {
|
|
14
14
|
(_a = this.client) === null || _a === void 0 ? void 0 : _a.cli.outputHelp();
|
|
15
|
-
logger_1.info();
|
|
16
|
-
logger_1.info(' To get help with a specific command, type ' +
|
|
17
|
-
ansi_colors_1.bold('catalyst help [command_name]'));
|
|
15
|
+
(0, logger_1.info)();
|
|
16
|
+
(0, logger_1.info)(' To get help with a specific command, type ' +
|
|
17
|
+
(0, ansi_colors_1.bold)('catalyst help [command_name]'));
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
const cmd = (_b = this.client) === null || _b === void 0 ? void 0 : _b.getCommand(commandName);
|
|
21
21
|
if (cmd === null || cmd === undefined) {
|
|
22
|
-
logger_1.warning(ansi_colors_1.bold(commandName) + ' is not a valid command. See below for valid commands');
|
|
22
|
+
(0, logger_1.warning)((0, ansi_colors_1.bold)(commandName) + ' is not a valid command. See below for valid commands');
|
|
23
23
|
(_c = this.client) === null || _c === void 0 ? void 0 : _c.cli.outputHelp();
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
@@ -25,11 +25,11 @@ const option_1 = require("../../util_modules/option");
|
|
|
25
25
|
const project_1 = require("../../util_modules/project");
|
|
26
26
|
const shell_1 = require("../../util_modules/shell");
|
|
27
27
|
const getExportProjectId = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
-
const projectId = project_1.getProjectId(null);
|
|
28
|
+
const projectId = (0, project_1.getProjectId)(null);
|
|
29
29
|
if (projectId !== null) {
|
|
30
30
|
return projectId;
|
|
31
31
|
}
|
|
32
|
-
const allProjects = (yield (yield endpoints_1.projectAPI()).getAllProjects());
|
|
32
|
+
const allProjects = (yield (yield (0, endpoints_1.projectAPI)()).getAllProjects());
|
|
33
33
|
if (allProjects.length === 0) {
|
|
34
34
|
throw new error_1.default('No projects found', {
|
|
35
35
|
exit: 0,
|
|
@@ -37,7 +37,7 @@ const getExportProjectId = () => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
if (allProjects.length === 1) {
|
|
40
|
-
logger_1.message('only one project found in remote, using that');
|
|
40
|
+
(0, logger_1.message)('only one project found in remote, using that');
|
|
41
41
|
return allProjects[0].id;
|
|
42
42
|
}
|
|
43
43
|
const projectAns = yield prompt_1.default.ask(prompt_1.default.question('project', 'Which project do you wish to export ? ', {
|
|
@@ -58,12 +58,12 @@ exports.default = new command_1.default('iac:export')
|
|
|
58
58
|
.needs('config', { optional: true })
|
|
59
59
|
.needs('rc', { optional: true })
|
|
60
60
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
|
-
const env = option_1.getOptionValue('production', false) ? 'Production' : 'Development';
|
|
61
|
+
const env = (0, option_1.getOptionValue)('production', false) ? 'Production' : 'Development';
|
|
62
62
|
const projectId = yield getExportProjectId();
|
|
63
63
|
const bundleResp = yield new iac_1.default(projectId, { env }).bundle(constants_1.IAC.template_format.json);
|
|
64
|
-
logger_1.info();
|
|
65
|
-
logger_1.success(`Successfully scheduled export job for project "${project_1.getProjectName(projectId)}" with jobid "${bundleResp.id}"`);
|
|
66
|
-
if (env_1.isPrimaryShell()) {
|
|
64
|
+
(0, logger_1.info)();
|
|
65
|
+
(0, logger_1.success)(`Successfully scheduled export job for project "${(0, project_1.getProjectName)(projectId)}" with jobid "${bundleResp.id}"`);
|
|
66
|
+
if ((0, env_1.isPrimaryShell)()) {
|
|
67
67
|
const exitListeners = process.listeners('exit');
|
|
68
68
|
process.removeAllListeners('exit');
|
|
69
69
|
const allGlobalOpts = runtime_store_1.default.get('opts.globalOpts', {});
|
|
@@ -74,7 +74,7 @@ exports.default = new command_1.default('iac:export')
|
|
|
74
74
|
}
|
|
75
75
|
return arr;
|
|
76
76
|
}, (env === 'Production' ? ['--production'] : []));
|
|
77
|
-
shell_1.spawn('catalyst', ['iac:status', 'export', ...optsArr], {
|
|
77
|
+
(0, shell_1.spawn)('catalyst', ['iac:status', 'export', ...optsArr], {
|
|
78
78
|
shell: true,
|
|
79
79
|
stdio: 'inherit'
|
|
80
80
|
}).SYNC();
|