zcatalyst-cli 1.12.1 → 1.13.2
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/docs/apig-utils.toml +5 -0
- package/lib/apig-utils.js +51 -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 +43 -22
- package/lib/client.js +1 -1
- package/lib/command_needs/auth.js +7 -7
- package/lib/command_needs/rc.js +32 -25
- 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 +30 -4
- 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 +6 -6
- 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 +43 -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 +40 -34
- package/lib/shell/dependencies/invoker/bio/java/JavabioInvoker.java +13 -1
- package/lib/shell/dependencies/invoker/cron/java/JavacronInvoker.java +13 -2
- package/lib/shell/dependencies/invoker/event/java/JavaeventInvoker.java +13 -2
- package/lib/shell/dependencies/invoker/integ/java/JavaintegInvoker.java +13 -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/scopes.js +1 -0
- 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
|
@@ -45,7 +45,7 @@ function spawn(command, opts, _a = {}) {
|
|
|
45
45
|
return {
|
|
46
46
|
SYNC: () => cross_spawn_1.default.sync(command, opts, Object.assign({ cwd, stdio, shell }, otherOpts)),
|
|
47
47
|
ASYNC: () => {
|
|
48
|
-
const childProcess = cross_spawn_1.default(command, opts, Object.assign({ cwd,
|
|
48
|
+
const childProcess = (0, cross_spawn_1.default)(command, opts, Object.assign({ cwd,
|
|
49
49
|
stdio,
|
|
50
50
|
shell }, otherOpts));
|
|
51
51
|
return new Promise((res, rej) => {
|
|
@@ -68,7 +68,7 @@ function spawn(command, opts, _a = {}) {
|
|
|
68
68
|
});
|
|
69
69
|
},
|
|
70
70
|
RAW: () => {
|
|
71
|
-
const child = cross_spawn_1.default(command, opts, Object.assign({ cwd, stdio, shell }, otherOpts)).on('error', logger_1.debug);
|
|
71
|
+
const child = (0, cross_spawn_1.default)(command, opts, Object.assign({ cwd, stdio, shell }, otherOpts)).on('error', logger_1.debug);
|
|
72
72
|
return child;
|
|
73
73
|
}
|
|
74
74
|
};
|
|
@@ -98,7 +98,7 @@ function which(commandName, { alwaysResolve = true }) {
|
|
|
98
98
|
if (/[\x00-\x1f<>:"|?*]/.test(commandName)) {
|
|
99
99
|
alwaysResolve ? resolve(false) : reject('controll char test failed');
|
|
100
100
|
}
|
|
101
|
-
child_process_1.exec('where ' + cleanedCmd, (error) => {
|
|
101
|
+
(0, child_process_1.exec)('where ' + cleanedCmd, (error) => {
|
|
102
102
|
if (error !== null) {
|
|
103
103
|
alwaysResolve ? resolve(false) : reject(error);
|
|
104
104
|
}
|
|
@@ -108,7 +108,7 @@ function which(commandName, { alwaysResolve = true }) {
|
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
else {
|
|
111
|
-
child_process_1.exec('command -v ' +
|
|
111
|
+
(0, child_process_1.exec)('command -v ' +
|
|
112
112
|
cleanedCmd +
|
|
113
113
|
' 2>/dev/null' +
|
|
114
114
|
' && { echo >&1 ' +
|
package/lib/winston.js
CHANGED
|
@@ -27,15 +27,15 @@ exports.transport = {
|
|
|
27
27
|
handleExceptions: true,
|
|
28
28
|
tailable: true,
|
|
29
29
|
format: winston_1.format.combine(winston_1.format.printf((info) => {
|
|
30
|
-
return `[${info.level}] [${new Date().toISOString()}] : ${strip_ansi_1.default(info.message)}`;
|
|
30
|
+
return `[${info.level}] [${new Date().toISOString()}] : ${(0, strip_ansi_1.default)(info.message)}`;
|
|
31
31
|
}))
|
|
32
32
|
}),
|
|
33
33
|
http_log: new winston_1.transports.File({
|
|
34
34
|
filename: fs_1.SYNC.tempFile(constants_1.FILENAME.http_log),
|
|
35
35
|
level: 'debug',
|
|
36
36
|
handleExceptions: true,
|
|
37
|
-
format: winston_1.format.combine(winston_1.format((info) => {
|
|
38
|
-
info.message = strip_ansi_1.default(info.message);
|
|
37
|
+
format: winston_1.format.combine((0, winston_1.format)((info) => {
|
|
38
|
+
info.message = (0, strip_ansi_1.default)(info.message);
|
|
39
39
|
return info.message === '' || info.level === 'info' ? false : info;
|
|
40
40
|
})(), winston_1.format.json(), winston_1.format.label({
|
|
41
41
|
label: 'CatalystCLI/' + version
|
|
@@ -56,11 +56,11 @@ if (process.env.DEBUG || process.argv.slice(2).includes('--verbose')) {
|
|
|
56
56
|
return `[${info.timestamp}] ${info.level}: ${info.message}`;
|
|
57
57
|
}));
|
|
58
58
|
}
|
|
59
|
-
exports.logger = winston_1.createLogger({
|
|
59
|
+
exports.logger = (0, winston_1.createLogger)({
|
|
60
60
|
transports: [exports.transport.console],
|
|
61
61
|
exitOnError: false
|
|
62
62
|
});
|
|
63
|
-
if (env_1.isWindows || env_1.isPrimaryShell()) {
|
|
63
|
+
if (env_1.isWindows || (0, env_1.isPrimaryShell)()) {
|
|
64
64
|
if (usage) {
|
|
65
65
|
exports.logger.add(exports.transport.http_log);
|
|
66
66
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcatalyst-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.2",
|
|
4
4
|
"description": "Command Line Tool for CATALYST",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"catalyst": "./lib/bin/catalyst.js"
|
|
8
8
|
},
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
10
|
+
"node": ">=14.0.0"
|
|
11
11
|
},
|
|
12
12
|
"preferGlobal": true,
|
|
13
13
|
"keywords": [
|
|
@@ -28,34 +28,34 @@
|
|
|
28
28
|
"ansi-colors": "^4.1.1",
|
|
29
29
|
"app-module-path": "^2.2.0",
|
|
30
30
|
"better-queue": "^3.8.10",
|
|
31
|
-
"chokidar": "^3.5.
|
|
31
|
+
"chokidar": "^3.5.3",
|
|
32
32
|
"cli-cursor": "^3.1.0",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"conf": "^10.0.2",
|
|
33
|
+
"commander": "^9.2.0",
|
|
34
|
+
"conf": "^10.1.2",
|
|
36
35
|
"cross-spawn": "^7.0.3",
|
|
37
|
-
"express": "^4.17.
|
|
38
|
-
"fs-extra": "^10.
|
|
36
|
+
"express": "^4.17.3",
|
|
37
|
+
"fs-extra": "^10.1.0",
|
|
39
38
|
"fuzzy": "^0.1.3",
|
|
40
39
|
"http-proxy": "^1.18.1",
|
|
41
|
-
"inquirer": "^8.
|
|
42
|
-
"inquirer-autocomplete-prompt": "^
|
|
43
|
-
"jszip": "^3.
|
|
40
|
+
"inquirer": "^8.2.2",
|
|
41
|
+
"inquirer-autocomplete-prompt": "^2.0.0",
|
|
42
|
+
"jszip": "^3.9.1",
|
|
44
43
|
"lodash": "^4.17.21",
|
|
45
|
-
"minimatch": "^
|
|
46
|
-
"moment": "^2.29.
|
|
47
|
-
"open": "^8.
|
|
44
|
+
"minimatch": "^5.0.1",
|
|
45
|
+
"moment": "^2.29.3",
|
|
46
|
+
"open": "^8.4.0",
|
|
48
47
|
"portfinder": "^1.0.28",
|
|
49
48
|
"pretty-ms": "^7.0.1",
|
|
50
49
|
"request": "^2.88.2",
|
|
51
|
-
"semver": "^7.3.
|
|
52
|
-
"
|
|
50
|
+
"semver": "^7.3.7",
|
|
51
|
+
"string-width": "^4.2.3",
|
|
52
|
+
"strip-ansi": "^6.0.1",
|
|
53
53
|
"toml": "^3.0.0",
|
|
54
54
|
"update-notifier": "^5.1.0",
|
|
55
|
-
"winston": "^3.
|
|
56
|
-
"ws": "^8.
|
|
55
|
+
"winston": "^3.7.2",
|
|
56
|
+
"ws": "^8.5.0",
|
|
57
57
|
"xml2js": "^0.4.23",
|
|
58
|
-
"yaml": "^
|
|
58
|
+
"yaml": "^2.0.1",
|
|
59
59
|
"zcatalyst-angular-schematics": "^0.1.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
@@ -63,30 +63,30 @@
|
|
|
63
63
|
"@types/better-queue": "^3.8.3",
|
|
64
64
|
"@types/cross-spawn": "^6.0.2",
|
|
65
65
|
"@types/express": "^4.17.13",
|
|
66
|
-
"@types/fs-extra": "^9.0.
|
|
67
|
-
"@types/http-proxy": "^1.17.
|
|
68
|
-
"@types/inquirer": "^
|
|
69
|
-
"@types/inquirer-autocomplete-prompt": "^1.3.
|
|
70
|
-
"@types/jest": "^
|
|
71
|
-
"@types/lodash": "^4.14.
|
|
66
|
+
"@types/fs-extra": "^9.0.13",
|
|
67
|
+
"@types/http-proxy": "^1.17.8",
|
|
68
|
+
"@types/inquirer": "^8.2.1",
|
|
69
|
+
"@types/inquirer-autocomplete-prompt": "^1.3.4",
|
|
70
|
+
"@types/jest": "^27.4.1",
|
|
71
|
+
"@types/lodash": "^4.14.182",
|
|
72
72
|
"@types/minimatch": "^3.0.5",
|
|
73
|
-
"@types/node": "^
|
|
74
|
-
"@types/request": "^2.48.
|
|
75
|
-
"@types/semver": "^7.3.
|
|
73
|
+
"@types/node": "^17.0.25",
|
|
74
|
+
"@types/request": "^2.48.8",
|
|
75
|
+
"@types/semver": "^7.3.9",
|
|
76
76
|
"@types/update-notifier": "^5.1.0",
|
|
77
|
-
"@types/ws": "^8.
|
|
78
|
-
"@types/xml2js": "^0.4.
|
|
79
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
80
|
-
"@typescript-eslint/parser": "^
|
|
81
|
-
"eslint": "^
|
|
82
|
-
"eslint-config-prettier": "^8.
|
|
83
|
-
"eslint-plugin-prettier": "^
|
|
77
|
+
"@types/ws": "^8.5.3",
|
|
78
|
+
"@types/xml2js": "^0.4.11",
|
|
79
|
+
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
|
80
|
+
"@typescript-eslint/parser": "^5.20.0",
|
|
81
|
+
"eslint": "^8.13.0",
|
|
82
|
+
"eslint-config-prettier": "^8.5.0",
|
|
83
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
84
84
|
"gulp": "^4.0.2",
|
|
85
|
-
"jest": "^27.
|
|
85
|
+
"jest": "^27.5.1",
|
|
86
86
|
"npm-run-all": "^4.1.5",
|
|
87
|
-
"prettier": "^2.
|
|
88
|
-
"ts-jest": "^27.
|
|
89
|
-
"typescript": "^4.3
|
|
87
|
+
"prettier": "^2.6.2",
|
|
88
|
+
"ts-jest": "^27.1.4",
|
|
89
|
+
"typescript": "^4.6.3"
|
|
90
90
|
},
|
|
91
91
|
"scripts": {
|
|
92
92
|
"build": "gulp build",
|
package/scripts/postInstall.js
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
try {
|
|
8
8
|
const semver = require('semver');
|
|
9
9
|
const ansi = require('ansi-colors');
|
|
10
|
-
const cliTable = require('
|
|
10
|
+
const cliTable = require('../lib/cli_table');
|
|
11
11
|
const packageJson = require('../package.json');
|
|
12
12
|
|
|
13
13
|
if (semver.satisfies(process.version, packageJson.engines.node)) {
|
|
14
14
|
console.log(ansi.green.bold('Installation successful.'));
|
|
15
|
-
|
|
15
|
+
process.exit(0);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const table = new cliTable({ style: { border: [], header: [] } });
|
|
@@ -24,8 +24,9 @@ try {
|
|
|
24
24
|
'Compatible version: ': [ansi.green(packageJson.engines.node)]
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
|
-
console.
|
|
28
|
-
console.
|
|
29
|
-
console.
|
|
30
|
-
console.
|
|
27
|
+
console.error(ansi.red('Node.js version is incompatible !!!'));
|
|
28
|
+
console.error(table.toString());
|
|
29
|
+
console.error('\n' + ansi.yellow.bold('Please update Node.js to a compatible version.'));
|
|
30
|
+
console.error(ansi.bold('Reference: ') + ansi.underline('https://nodejs.org/') + '\n');
|
|
31
|
+
process.exit(1);
|
|
31
32
|
} catch (err) {}
|
package/docs/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|