zcatalyst-cli 1.9.0 → 1.9.1
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/README.md +29 -29
- package/lib/commands/apig/disable.js +1 -1
- package/lib/commands/apig/enable.js +1 -1
- package/lib/commands/apig/status.js +1 -1
- package/lib/commands/client/delete.js +1 -1
- package/lib/commands/client/setup.js +1 -1
- package/lib/commands/deploy.js +1 -1
- package/lib/commands/ds/export.js +1 -1
- package/lib/commands/ds/import.js +1 -1
- package/lib/commands/ds/status.js +1 -1
- package/lib/commands/event/generate/index.js +1 -1
- package/lib/commands/event/generate/integ.js +1 -1
- package/lib/commands/functions/add.js +1 -1
- package/lib/commands/functions/config.js +1 -1
- package/lib/commands/functions/delete.js +1 -1
- package/lib/commands/functions/setup.js +1 -1
- package/lib/commands/functions/shell.js +1 -1
- package/lib/commands/help.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/login.js +1 -1
- package/lib/commands/logout.js +1 -1
- package/lib/commands/project/list.js +1 -1
- package/lib/commands/project/reset.js +1 -1
- package/lib/commands/pull.js +1 -1
- package/lib/commands/run.js +1 -1
- package/lib/commands/serve.js +1 -1
- package/lib/commands/token/generate.js +1 -1
- package/lib/commands/token/list.js +1 -1
- package/lib/commands/token/revoke.js +1 -1
- package/lib/commands/whoami.js +1 -1
- package/lib/index.js +5 -5
- package/lib/serve/server/index.js +22 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,36 +70,36 @@ Certain command are project specific and for it to work you must be inside a pro
|
|
|
70
70
|
|
|
71
71
|
Command | Description
|
|
72
72
|
------- | -----------
|
|
73
|
-
**login** |
|
|
74
|
-
**whoami** |
|
|
75
|
-
**token:generate** |
|
|
76
|
-
**token:revoke** | Revoke
|
|
77
|
-
**token:list** | List all the available tokens
|
|
78
|
-
**project:list** | List the Catalyst projects you have access to.
|
|
73
|
+
**login** | Log the CLI in to your Catalyst account. *Requires access to a web browser*.
|
|
74
|
+
**whoami** | Print the email address of the user currently logged in.
|
|
75
|
+
**token:generate** | Generate a token to authenticate accessing the CLI from a remote system.
|
|
76
|
+
**token:revoke** | Revoke a token generated in this CLI.
|
|
77
|
+
**token:list** | List all the available tokens generated in this CLI.
|
|
78
|
+
**project:list** | List all the Catalyst projects you have access to.
|
|
79
79
|
**project:use** | Set an active Catalyst project for your working directory.
|
|
80
|
-
**project:reset** | Clear an active selection
|
|
81
|
-
**init** | Initialize a Catalyst
|
|
82
|
-
**pull** | Pull
|
|
83
|
-
**apig:status** |
|
|
84
|
-
**apig:enable** |
|
|
85
|
-
**apig:disable** | Disable API Gateway
|
|
86
|
-
**ds:import** |
|
|
87
|
-
**ds:export** |
|
|
88
|
-
**ds:status** |
|
|
89
|
-
**client:setup** |
|
|
90
|
-
**client:delete** |
|
|
91
|
-
**functions:setup** |
|
|
92
|
-
**functions:
|
|
93
|
-
**functions:
|
|
94
|
-
**functions:
|
|
95
|
-
**functions:
|
|
96
|
-
**event:generate \| generate:event** | Generate sample payloads from different event sources
|
|
97
|
-
**event:generate:integ** | Generate sample
|
|
98
|
-
**serve** | Serve
|
|
99
|
-
**deploy** | Deploy
|
|
100
|
-
**help** | Display help
|
|
101
|
-
**run-script \| run** | Run a particular command script.
|
|
102
|
-
**logout** | Log the CLI out of your
|
|
80
|
+
**project:reset** | Clear an active project selection and reset to the base project.
|
|
81
|
+
**init** | Initialize a Catalyst project, function, and client resources in the local directory.
|
|
82
|
+
**pull** | Pull resources of your project from the remote console to the local directory.
|
|
83
|
+
**apig:status** | Obtain the current status of API Gateway for your project and the schedule progress.
|
|
84
|
+
**apig:enable** | Enable API Gateway for your project. *In both Console and Local*.
|
|
85
|
+
**apig:disable** | Disable API Gateway for your project. *In both Console and Local*.
|
|
86
|
+
**ds:import** | Bulk write records to a table in the Catalyst Data Store.
|
|
87
|
+
**ds:export** | Bulk read records from a table in the Catalyst Data Store.
|
|
88
|
+
**ds:status** | Display the job status of a Data Store import or export operation.
|
|
89
|
+
**client:setup** | Set up the client directory in your project directory.
|
|
90
|
+
**client:delete** | Delete a version of the client from the remote console or the local directory.
|
|
91
|
+
**functions:setup** | Set up the function directory in your project directory.
|
|
92
|
+
**functions:add** | Add a function of the required stack to the function directory.
|
|
93
|
+
**functions:shell** | Launch a node shell to test emulated functions of any stack or type, other than Advanced I/O functions.
|
|
94
|
+
**functions:config** | Configure the memory allocation of a function in your project.
|
|
95
|
+
**functions:delete** | Delete a function from the remote console or the local directory.
|
|
96
|
+
**event:generate \| generate:event** | Generate sample payloads from different components or custom event sources to test Event functions.
|
|
97
|
+
**event:generate:integ** | Generate sample payloads for the required integration service to test Integration functions.
|
|
98
|
+
**serve** | Serve Basic I/O and Advanced I/O functions, and the client, to test them locally.
|
|
99
|
+
**deploy** | Deploy the Catalyst project and project resources to the remote console from the local directory.
|
|
100
|
+
**help** | Display the command reference or help for a specific command.
|
|
101
|
+
**run-script \| run** | Run a particular command script defined in *catalyst.json*.
|
|
102
|
+
**logout** | Log the CLI out of your Catalyst account.
|
|
103
103
|
|
|
104
104
|
---
|
|
105
105
|
|
|
@@ -20,7 +20,7 @@ const runtime_store_1 = __importDefault(require("../../runtime-store"));
|
|
|
20
20
|
const constants_1 = require("../../util_modules/constants");
|
|
21
21
|
const logger_1 = require("../../util_modules/logger");
|
|
22
22
|
exports.default = new command_1.default('apig:disable')
|
|
23
|
-
.description('
|
|
23
|
+
.description('Disable API Gateway for your project')
|
|
24
24
|
.needs('auth', [constants_1.SCOPE.projects])
|
|
25
25
|
.needs('config')
|
|
26
26
|
.needs('rc')
|
|
@@ -20,7 +20,7 @@ const runtime_store_1 = __importDefault(require("../../runtime-store"));
|
|
|
20
20
|
const constants_1 = require("../../util_modules/constants");
|
|
21
21
|
const logger_1 = require("../../util_modules/logger");
|
|
22
22
|
exports.default = new command_1.default('apig:enable')
|
|
23
|
-
.description('
|
|
23
|
+
.description('Enable API Gateway for your project')
|
|
24
24
|
.needs('auth', [constants_1.SCOPE.projects])
|
|
25
25
|
.needs('config')
|
|
26
26
|
.needs('rc')
|
|
@@ -22,7 +22,7 @@ const constants_1 = require("../../util_modules/constants");
|
|
|
22
22
|
const logger_1 = require("../../util_modules/logger");
|
|
23
23
|
const option_1 = require("../../util_modules/option");
|
|
24
24
|
exports.default = new command_1.default('apig:status')
|
|
25
|
-
.description('
|
|
25
|
+
.description('Obtain the current status of API Gateway for your project and the schedule progress')
|
|
26
26
|
.option('--previous', 'show previous schedule status instead of current one')
|
|
27
27
|
.needs('auth', [constants_1.SCOPE.projects])
|
|
28
28
|
.needs('config')
|
|
@@ -28,7 +28,7 @@ const logger_1 = require("../../util_modules/logger");
|
|
|
28
28
|
const option_1 = require("../../util_modules/option");
|
|
29
29
|
const project_1 = require("../../util_modules/project");
|
|
30
30
|
exports.default = new command_1.default('client:delete [client_version]')
|
|
31
|
-
.description('
|
|
31
|
+
.description('Delete a version of the client from the remote console or the local directory')
|
|
32
32
|
.option('--local', 'removes the client from local machine')
|
|
33
33
|
.option('--remote', 'removes the selected client from remote console')
|
|
34
34
|
.needs('auth', [constants_1.SCOPE.webapp])
|
|
@@ -37,7 +37,7 @@ const runtime_store_1 = __importDefault(require("../../runtime-store"));
|
|
|
37
37
|
const constants_1 = require("../../util_modules/constants");
|
|
38
38
|
const logger_1 = require("../../util_modules/logger");
|
|
39
39
|
exports.default = new command_1.default('client:setup')
|
|
40
|
-
.description('
|
|
40
|
+
.description('Set up the client directory in your project directory')
|
|
41
41
|
.needs('auth', [constants_1.SCOPE.webapp])
|
|
42
42
|
.needs('config')
|
|
43
43
|
.needs('rc')
|
package/lib/commands/deploy.js
CHANGED
|
@@ -36,7 +36,7 @@ const runtime_store_1 = __importDefault(require("../runtime-store"));
|
|
|
36
36
|
const constants_1 = require("../util_modules/constants");
|
|
37
37
|
const logger_1 = require("../util_modules/logger");
|
|
38
38
|
exports.default = new command_1.default('deploy')
|
|
39
|
-
.description('Deploy
|
|
39
|
+
.description('Deploy the Catalyst project and project resources to the remote console from the local directory')
|
|
40
40
|
.option('--only <targets>', 'only deploy specified, comma-separated targets (e.g. "functions,client").' +
|
|
41
41
|
' For Functions you can specify which functions to deploy with colon notation' +
|
|
42
42
|
' (e.g. "--only functions:<function_name>,functions:<function_name>"). ')
|
|
@@ -35,7 +35,7 @@ const getReadConfigFromPath = (pth) => __awaiter(void 0, void 0, void 0, functio
|
|
|
35
35
|
return configJSON;
|
|
36
36
|
});
|
|
37
37
|
exports.default = new command_1.default('ds:export [table]')
|
|
38
|
-
.description('
|
|
38
|
+
.description('Bulk read records from a table in the Catalyst Data Store')
|
|
39
39
|
.option('--table <name|id>', 'Name or ID of the table from which data is to be read (eg. "UserDetails")')
|
|
40
40
|
.option('--config <path>', 'Path of the configuration json file to be used for export.')
|
|
41
41
|
.option('--page <page>', 'Number which denotes the range of rows to be fetched (eg. "1")')
|
|
@@ -36,7 +36,7 @@ const getWriteConfigFromPath = (pth) => __awaiter(void 0, void 0, void 0, functi
|
|
|
36
36
|
return configJSON;
|
|
37
37
|
});
|
|
38
38
|
exports.default = new command_1.default('ds:import [file]')
|
|
39
|
-
.description('
|
|
39
|
+
.description('Bulk write records to a table in the Catalyst Data Store')
|
|
40
40
|
.option('--table <name|id>', 'Name or ID of the table to which data to be written (e.g. "UserDetails")')
|
|
41
41
|
.option('--config <path>', 'Path of the configuration json file to be used for import.')
|
|
42
42
|
.option('--production', 'flag for pointing to production environment')
|
|
@@ -25,7 +25,7 @@ const fs_1 = require("../../util_modules/fs");
|
|
|
25
25
|
const logger_1 = require("../../util_modules/logger");
|
|
26
26
|
const option_1 = require("../../util_modules/option");
|
|
27
27
|
exports.default = new command_1.default('ds:status <operation> [jobid]')
|
|
28
|
-
.description('
|
|
28
|
+
.description('Display the job status of a Data Store import or export operation')
|
|
29
29
|
.option('--production', 'flag for pointing to production environment.')
|
|
30
30
|
.needs('auth', [constants_1.SCOPE.projects, constants_1.SCOPE.datastore, constants_1.SCOPE.row])
|
|
31
31
|
.needs('config')
|
|
@@ -42,7 +42,7 @@ const option_1 = require("../../../util_modules/option");
|
|
|
42
42
|
const project_1 = require("../../../util_modules/project");
|
|
43
43
|
exports.default = new command_1.default('event:generate <source> <action>')
|
|
44
44
|
.alias('generate:event')
|
|
45
|
-
.description('Generate sample payloads from different event sources
|
|
45
|
+
.description('Generate sample payloads from different components or custom event sources to test Event functions')
|
|
46
46
|
.option('-rid, --rule-id <rule_identifier>', 'rule_identifier that will be used if the source is custom')
|
|
47
47
|
.option('-e, --event-bus <event_bus_name>', 'event bus name that should be used')
|
|
48
48
|
.allowUnknownOpts()
|
|
@@ -37,7 +37,7 @@ const command_1 = __importDefault(require("../../../internal/command"));
|
|
|
37
37
|
const constants_1 = require("../../../util_modules/constants");
|
|
38
38
|
const option_1 = require("../../../util_modules/option");
|
|
39
39
|
exports.default = new command_1.default('event:generate:integ <service>')
|
|
40
|
-
.description('Generate sample
|
|
40
|
+
.description('Generate sample payloads for the required integration service to test Integration functions')
|
|
41
41
|
.option('--inputs <inputs>', 'inputs to generate the integ event provided as comma seperated values')
|
|
42
42
|
.needs('rc')
|
|
43
43
|
.needs('auth')
|
|
@@ -37,7 +37,7 @@ const runtime_store_1 = __importDefault(require("../../runtime-store"));
|
|
|
37
37
|
const constants_1 = require("../../util_modules/constants");
|
|
38
38
|
const logger_1 = require("../../util_modules/logger");
|
|
39
39
|
exports.default = new command_1.default('functions:add')
|
|
40
|
-
.description('Add
|
|
40
|
+
.description('Add a function of the required stack to the function directory')
|
|
41
41
|
.needs('auth', [constants_1.SCOPE.functions])
|
|
42
42
|
.needs('config')
|
|
43
43
|
.needs('rc')
|
|
@@ -20,7 +20,7 @@ const ansi_colors_1 = require("ansi-colors");
|
|
|
20
20
|
const prompt_1 = __importDefault(require("../../prompt"));
|
|
21
21
|
const common_1 = require("../../fn-utils/lib/common");
|
|
22
22
|
exports.default = new command_1.default('functions:config [function_name_or_id]')
|
|
23
|
-
.description('Configure the
|
|
23
|
+
.description('Configure the memory allocation of a function in your project')
|
|
24
24
|
.option('--memory <value>', 'use this option to configure the memory for the function. ex: --memory 128')
|
|
25
25
|
.needs('auth', [constants_1.SCOPE.functions])
|
|
26
26
|
.needs('config')
|
|
@@ -26,7 +26,7 @@ const logger_1 = require("../../util_modules/logger");
|
|
|
26
26
|
const option_1 = require("../../util_modules/option");
|
|
27
27
|
const project_1 = require("../../util_modules/project");
|
|
28
28
|
exports.default = new command_1.default('functions:delete [function_name_or_id]')
|
|
29
|
-
.description('
|
|
29
|
+
.description('Delete a function from the remote console or the local directory')
|
|
30
30
|
.option('--local', 'delete the functions in local machine.')
|
|
31
31
|
.option('--remote', 'delete the functions in remote console.')
|
|
32
32
|
.needs('auth', [constants_1.SCOPE.projects])
|
|
@@ -37,7 +37,7 @@ const runtime_store_1 = __importDefault(require("../../runtime-store"));
|
|
|
37
37
|
const constants_1 = require("../../util_modules/constants");
|
|
38
38
|
const logger_1 = require("../../util_modules/logger");
|
|
39
39
|
exports.default = new command_1.default('functions:setup')
|
|
40
|
-
.description('
|
|
40
|
+
.description('Set up the function directory in your project directory')
|
|
41
41
|
.needs('auth', [constants_1.SCOPE.functions])
|
|
42
42
|
.needs('config')
|
|
43
43
|
.needs('rc')
|
|
@@ -36,7 +36,7 @@ const runtime_store_1 = __importDefault(require("../../runtime-store"));
|
|
|
36
36
|
const constants_1 = require("../../util_modules/constants");
|
|
37
37
|
const option_1 = require("../../util_modules/option");
|
|
38
38
|
exports.default = new command_1.default('functions:shell')
|
|
39
|
-
.description('Launch a node shell
|
|
39
|
+
.description('Launch a node shell to test emulated functions of any stack or type, other than Advanced I/O functions')
|
|
40
40
|
.option('--http [port]', 'enables http mode for the basicIO functions and start server at specified port' +
|
|
41
41
|
`(default: ${constants_1.DEFAULT.serve_port.http.basicio})`)
|
|
42
42
|
.option('--debug [port]', 'the functions are invoked from local environment enabling debugging options on provided port.' +
|
package/lib/commands/help.js
CHANGED
|
@@ -11,7 +11,7 @@ const logger_1 = require("../util_modules/logger");
|
|
|
11
11
|
const option_1 = require("../util_modules/option");
|
|
12
12
|
const project_1 = require("../util_modules/project");
|
|
13
13
|
exports.default = new command_1.default('help [command]')
|
|
14
|
-
.description('Display help
|
|
14
|
+
.description('Display the command reference or help for a specific command')
|
|
15
15
|
.action(function help(commandName) {
|
|
16
16
|
var _a, _b, _c;
|
|
17
17
|
if (option_1.getOptionValue('info', false)) {
|
package/lib/commands/init.js
CHANGED
|
@@ -42,7 +42,7 @@ const js_1 = require("../util_modules/js");
|
|
|
42
42
|
const logger_1 = require("../util_modules/logger");
|
|
43
43
|
const shell_1 = require("../util_modules/shell");
|
|
44
44
|
exports.default = new command_1.default('init [feature]')
|
|
45
|
-
.description('Initialize a Catalyst
|
|
45
|
+
.description('Initialize a Catalyst project, function, and client resources in the local directory')
|
|
46
46
|
.option('--force', 'force initialise a project for this directory')
|
|
47
47
|
.ignore(['project'])
|
|
48
48
|
.needs('auth', [constants_1.SCOPE.projects, constants_1.SCOPE.stratus_create, constants_1.SCOPE.stratus_read])
|
package/lib/commands/login.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
34
|
const command_1 = __importDefault(require("../internal/command"));
|
|
35
35
|
exports.default = new command_1.default('login')
|
|
36
|
-
.description('Log the CLI in to your
|
|
36
|
+
.description('Log the CLI in to your Catalyst account')
|
|
37
37
|
.option('--no-localhost', 'login without browser')
|
|
38
38
|
.option('--force', 'force reauthentication')
|
|
39
39
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
package/lib/commands/logout.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
34
|
const command_1 = __importDefault(require("../internal/command"));
|
|
35
35
|
exports.default = new command_1.default('logout')
|
|
36
|
-
.description('Log the CLI out of your
|
|
36
|
+
.description('Log the CLI out of your Catalyst account')
|
|
37
37
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
38
|
const auth = yield Promise.resolve().then(() => __importStar(require('../authentication')));
|
|
39
39
|
return auth.logout();
|
|
@@ -38,7 +38,7 @@ const constants_1 = require("../../util_modules/constants");
|
|
|
38
38
|
const logger_1 = require("../../util_modules/logger");
|
|
39
39
|
const project_1 = require("../../util_modules/project");
|
|
40
40
|
exports.default = new command_1.default('project:list')
|
|
41
|
-
.description('List the Catalyst projects you have access to')
|
|
41
|
+
.description('List all the Catalyst projects you have access to')
|
|
42
42
|
.needs('auth', [constants_1.SCOPE.projects])
|
|
43
43
|
.needs('config', { optional: true, resolveOnNotFound: true })
|
|
44
44
|
.needs('rc', { optional: true })
|
|
@@ -17,7 +17,7 @@ const constants_1 = require("../../util_modules/constants");
|
|
|
17
17
|
const logger_1 = require("../../util_modules/logger");
|
|
18
18
|
const project_1 = require("../../util_modules/project");
|
|
19
19
|
exports.default = new command_1.default('project:reset')
|
|
20
|
-
.description('Clear an active selection
|
|
20
|
+
.description('Clear an active project selection and reset to the base project')
|
|
21
21
|
.needs('auth', [constants_1.SCOPE.projects])
|
|
22
22
|
.needs('config', { optional: true, resolveOnNotFound: true })
|
|
23
23
|
.needs('rc')
|
package/lib/commands/pull.js
CHANGED
|
@@ -42,7 +42,7 @@ const fs_1 = require("../util_modules/fs");
|
|
|
42
42
|
const js_1 = require("../util_modules/js");
|
|
43
43
|
const logger_1 = require("../util_modules/logger");
|
|
44
44
|
exports.default = new command_1.default('pull [feature]')
|
|
45
|
-
.description('Pull
|
|
45
|
+
.description('Pull resources of your project from the remote console to the local directory')
|
|
46
46
|
.needs('auth', [constants_1.SCOPE.functions, constants_1.SCOPE.webapp])
|
|
47
47
|
.needs('config', { optional: true })
|
|
48
48
|
.needs('rc')
|
package/lib/commands/run.js
CHANGED
|
@@ -38,7 +38,7 @@ const constants_1 = require("../util_modules/constants");
|
|
|
38
38
|
const logger_1 = require("../util_modules/logger");
|
|
39
39
|
exports.default = new command_1.default('run-script [command]')
|
|
40
40
|
.alias('run')
|
|
41
|
-
.description('
|
|
41
|
+
.description('Run a particular command script defined in catalyst.json')
|
|
42
42
|
.needs('auth')
|
|
43
43
|
.needs('config')
|
|
44
44
|
.needs('rc', { optional: true, resolveOnNotFound: true })
|
package/lib/commands/serve.js
CHANGED
|
@@ -34,7 +34,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
34
34
|
const command_1 = __importDefault(require("../internal/command"));
|
|
35
35
|
const constants_1 = require("../util_modules/constants");
|
|
36
36
|
exports.default = new command_1.default('serve')
|
|
37
|
-
.description('Serve
|
|
37
|
+
.description('Serve Basic I/O and Advanced I/O functions, and the client, to test them locally')
|
|
38
38
|
.option('--http <port>', 'start the server at specified port ')
|
|
39
39
|
.option('--debug <type:port>', 'the functions are invoked from local environment enabling debugging options on provided ports ' +
|
|
40
40
|
`(example: advancedio:<name>:${constants_1.DEFAULT.serve_port.debug.advancedio},basicio:${constants_1.DEFAULT.serve_port.debug.basicio})`)
|
|
@@ -34,7 +34,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
34
34
|
const command_1 = __importDefault(require("../../internal/command"));
|
|
35
35
|
const logger_1 = require("../../util_modules/logger");
|
|
36
36
|
exports.default = new command_1.default('token:generate')
|
|
37
|
-
.description('
|
|
37
|
+
.description('Generate a token to authenticate accessing the CLI from a remote system')
|
|
38
38
|
.option('--current', 'prints out the existing token used by this CLI')
|
|
39
39
|
.needs('auth')
|
|
40
40
|
.ignore(['token'])
|
|
@@ -35,7 +35,7 @@ const ansi_colors_1 = require("ansi-colors");
|
|
|
35
35
|
const command_1 = __importDefault(require("../../internal/command"));
|
|
36
36
|
const logger_1 = require("../../util_modules/logger");
|
|
37
37
|
exports.default = new command_1.default('token:list')
|
|
38
|
-
.description('List all the available tokens
|
|
38
|
+
.description('List all the available tokens generated in this CLI')
|
|
39
39
|
.ignore(['token'])
|
|
40
40
|
.needs('auth')
|
|
41
41
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -34,7 +34,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
34
34
|
const command_1 = __importDefault(require("../../internal/command"));
|
|
35
35
|
const logger_1 = require("../../util_modules/logger");
|
|
36
36
|
exports.default = new command_1.default('token:revoke <id>')
|
|
37
|
-
.description('Revoke
|
|
37
|
+
.description('Revoke a token generated in this CLI')
|
|
38
38
|
.needs('auth')
|
|
39
39
|
.ignore(['token'])
|
|
40
40
|
.action((input) => __awaiter(void 0, void 0, void 0, function* () {
|
package/lib/commands/whoami.js
CHANGED
|
@@ -18,7 +18,7 @@ const dc_1 = require("../dc");
|
|
|
18
18
|
const command_1 = __importDefault(require("../internal/command"));
|
|
19
19
|
const logger_1 = require("../util_modules/logger");
|
|
20
20
|
exports.default = new command_1.default('whoami')
|
|
21
|
-
.description('
|
|
21
|
+
.description('Print the email address of the user currently logged in')
|
|
22
22
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
23
|
const activeDC = dc_1.getActiveDC();
|
|
24
24
|
const user = config_store_1.default.get(`${activeDC}.user`);
|
package/lib/index.js
CHANGED
|
@@ -12,11 +12,11 @@ const packageJson = runtime_store_1.default.get('context.cli.package');
|
|
|
12
12
|
const { description, version } = packageJson;
|
|
13
13
|
const program = new commander_1.Command();
|
|
14
14
|
program.description(description);
|
|
15
|
-
program.version(version, '-v, --version');
|
|
16
|
-
program.option('-p, --project <name|project_id>', 'the
|
|
17
|
-
program.option('--token <token>', '
|
|
18
|
-
program.option('--dc <us|eu|in>', '
|
|
19
|
-
program.option('--verbose', '
|
|
15
|
+
program.version(version, '-v, --version', 'Print the Catalyst CLI version number');
|
|
16
|
+
program.option('-p, --project <name|project_id>', 'Specify the Catalyst project to be used for a command');
|
|
17
|
+
program.option('--token <token>', 'Supply an authentication token for a command');
|
|
18
|
+
program.option('--dc <us|eu|in>', 'Supply a data center for a command');
|
|
19
|
+
program.option('--verbose', 'Change the log level to verbose for debugging purposes');
|
|
20
20
|
const cli = new client_1.Client(program);
|
|
21
21
|
cli.onUnknownCommand((_OPTS, cmd) => {
|
|
22
22
|
const commandNames = cli.getAllCommandNames();
|
|
@@ -39,25 +39,26 @@ class Server {
|
|
|
39
39
|
constructor() {
|
|
40
40
|
this.targetDetailsArr = [];
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
_addBasicFnDetails() {
|
|
43
|
+
const fnTargets = runtime_store_1.default.get('context.functions.targets', []);
|
|
44
|
+
if (fnTargets.length === 0) {
|
|
45
|
+
logger_1.debug('No basic functions to add');
|
|
46
|
+
}
|
|
47
|
+
const httpPort = parseInt(runtime_store_1.default.get('context.port.http.' + constants_1.REMOTE_REF.functions.type[constants_1.FN_TYPE.basic]), 10);
|
|
48
|
+
const debugPort = parseInt(runtime_store_1.default.get('context.port.debug.' + constants_1.REMOTE_REF.functions.type[constants_1.FN_TYPE.basic], '-1'), 10);
|
|
49
|
+
if (!isNaN(httpPort)) {
|
|
50
|
+
fnTargets
|
|
51
|
+
.filter((t) => t.url !== undefined && t.type === constants_1.FN_TYPE.basic)
|
|
52
|
+
.map((t) => js_1.JS.omit(t, ['zip_stream', 'localFn']))
|
|
53
|
+
.forEach((t) => {
|
|
54
|
+
this.targetDetailsArr.push({
|
|
55
|
+
type: 'functions',
|
|
56
|
+
httpPort,
|
|
57
|
+
debugPort,
|
|
58
|
+
target: t
|
|
57
59
|
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
61
62
|
}
|
|
62
63
|
_spinUpJavaServer(details, masterPort) {
|
|
63
64
|
var _a, _b, _c, _d;
|
|
@@ -185,13 +186,13 @@ class Server {
|
|
|
185
186
|
throw new error_1.default('master port cannot be undefined', { exit: 2 });
|
|
186
187
|
}
|
|
187
188
|
yield Promise.all(this.targetDetailsArr.map((details) => __awaiter(this, void 0, void 0, function* () { return this.startServer(details, masterPort); })));
|
|
188
|
-
|
|
189
|
-
if (
|
|
189
|
+
this._addBasicFnDetails();
|
|
190
|
+
if (this.targetDetailsArr.length === 0) {
|
|
190
191
|
throw new error_1.default('Trying to start master server before other server', {
|
|
191
192
|
exit: 2
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
|
-
const server = yield
|
|
195
|
+
const server = yield master_1.default(masterPort, this.targetDetailsArr);
|
|
195
196
|
this.masterServer = server;
|
|
196
197
|
return new Promise((res) => {
|
|
197
198
|
server.on('listening', () => {
|