zcatalyst-cli 1.7.1 → 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 +31 -10
- package/docs/apig-utils.toml +69 -0
- package/docs/authentication/index.toml +15 -0
- package/docs/authentication/login.toml +14 -0
- package/docs/client-utils.toml +24 -0
- package/docs/command_needs/auth.toml +4 -0
- package/docs/command_needs/rc.toml +24 -0
- package/docs/commands/apig/disable.toml +4 -0
- package/docs/commands/apig/enable.toml +4 -0
- package/docs/commands/apig/status.toml +4 -0
- package/docs/commands/client/delete.toml +34 -0
- package/docs/commands/ds/export.toml +4 -0
- package/docs/commands/ds/import.toml +15 -0
- package/docs/commands/ds/status.toml +9 -0
- package/docs/commands/event/generate/index.toml +29 -0
- package/docs/commands/event/generate/integ.toml +4 -0
- package/docs/commands/functions/config.toml +11 -0
- package/docs/commands/functions/delete.toml +29 -0
- package/docs/commands/project/use.toml +9 -0
- package/docs/dc.toml +4 -0
- package/docs/deploy/features/apig.toml +4 -0
- package/docs/deploy/features/functions/index.toml +4 -0
- package/docs/event_generate/cache.toml +4 -0
- package/docs/event_generate/custom.toml +4 -0
- package/docs/event_generate/datastore.toml +4 -0
- package/docs/event_generate/filestore.toml +4 -0
- package/docs/event_generate/integration/cliq.toml +9 -0
- package/docs/execute-script.toml +19 -0
- package/docs/fn-utils/lib/common.toml +25 -0
- package/docs/fn-utils/lib/java.toml +34 -0
- package/docs/fn-utils/lib/node.toml +4 -0
- package/docs/init/index.toml +4 -0
- package/docs/internal/command.toml +4 -0
- package/docs/internal/config.toml +9 -0
- package/docs/internal/credential.toml +14 -0
- package/docs/option-filter.toml +45 -0
- package/docs/port-resolver.toml +9 -0
- package/docs/pull/index.toml +4 -0
- package/docs/serve/index.toml +4 -0
- package/docs/shell/index.toml +4 -0
- package/docs/util_modules/project.toml +9 -0
- package/lib/apig-utils.js +133 -43
- package/lib/archiver.js +4 -2
- package/lib/authentication/index.js +44 -9
- package/lib/authentication/login.js +51 -8
- package/lib/bin/catalyst.js +14 -7
- package/lib/client-utils.js +47 -14
- package/lib/client.js +1 -1
- package/lib/command_needs/auth.js +5 -3
- package/lib/command_needs/rc.js +35 -13
- package/lib/commands/apig/disable.js +8 -3
- package/lib/commands/apig/enable.js +8 -3
- package/lib/commands/apig/status.js +29 -9
- package/lib/commands/client/delete.js +65 -26
- package/lib/commands/client/setup.js +2 -2
- package/lib/commands/deploy.js +2 -2
- package/lib/commands/ds/export.js +16 -8
- package/lib/commands/ds/import.js +20 -14
- package/lib/commands/ds/status.js +22 -11
- package/lib/commands/event/generate/index.js +62 -12
- package/lib/commands/event/generate/integ.js +7 -3
- package/lib/commands/functions/add.js +2 -2
- package/lib/commands/functions/config.js +11 -3
- package/lib/commands/functions/delete.js +36 -13
- package/lib/commands/functions/setup.js +2 -2
- package/lib/commands/functions/shell.js +2 -2
- package/lib/commands/help.js +1 -1
- package/lib/commands/index.js +2 -3
- package/lib/commands/init.js +4 -4
- package/lib/commands/login.js +2 -2
- package/lib/commands/logout.js +2 -2
- package/lib/commands/project/list.js +2 -2
- package/lib/commands/project/reset.js +1 -1
- package/lib/commands/project/use.js +18 -2
- package/lib/commands/pull.js +5 -5
- package/lib/commands/run.js +2 -2
- package/lib/commands/serve.js +7 -6
- package/lib/commands/token/generate.js +2 -2
- package/lib/commands/token/list.js +2 -2
- package/lib/commands/token/revoke.js +2 -2
- package/lib/commands/whoami.js +1 -1
- package/lib/dc.js +11 -1
- package/lib/deploy/features/apig.js +33 -33
- package/lib/deploy/features/client.js +12 -19
- package/lib/deploy/features/functions/index.js +14 -4
- package/lib/deploy/features/index.js +1 -1
- package/lib/deploy/index.js +2 -9
- package/lib/endpoints/index.js +5 -2
- package/lib/endpoints/lib/apig.js +15 -5
- package/lib/endpoints/lib/applogic.js +12 -4
- package/lib/endpoints/lib/cache.js +9 -3
- package/lib/endpoints/lib/catalyst-details.js +37 -0
- package/lib/endpoints/lib/client.js +15 -5
- package/lib/endpoints/lib/datastore.js +6 -2
- package/lib/endpoints/lib/ds-bulk.js +15 -5
- package/lib/endpoints/lib/env.js +3 -1
- package/lib/endpoints/lib/event-bus.js +3 -1
- package/lib/endpoints/lib/filestore.js +6 -2
- package/lib/endpoints/lib/functions.js +12 -4
- package/lib/endpoints/lib/project.js +9 -3
- package/lib/endpoints/lib/queue.js +9 -3
- package/lib/endpoints/lib/sdk.js +3 -1
- package/lib/endpoints/lib/zcql.js +3 -1
- package/lib/error.js +18 -0
- package/lib/errorOut.js +10 -7
- package/lib/event_generate/cache.js +9 -1
- package/lib/event_generate/custom.js +6 -1
- package/lib/event_generate/datastore.js +12 -2
- package/lib/event_generate/filestore.js +9 -1
- package/lib/event_generate/integration/cliq.js +10 -2
- package/lib/execute-script.js +35 -6
- package/lib/express_middlewares/unknownReqProxy.js +18 -7
- package/lib/fn-utils/index.js +1 -1
- package/lib/fn-utils/lib/common.js +95 -17
- package/lib/fn-utils/lib/integ.js +4 -3
- package/lib/fn-utils/lib/java.js +49 -13
- package/lib/fn-utils/lib/node.js +15 -6
- package/lib/fn-watcher.js +67 -0
- package/lib/index.js +13 -12
- package/lib/init/dependencies/package-json.js +3 -1
- package/lib/init/features/functions/index.js +41 -29
- package/lib/init/features/functions/languages/java.js +5 -4
- package/lib/init/features/functions/languages/node.js +6 -5
- package/lib/init/features/index.js +8 -4
- package/lib/init/index.js +10 -3
- package/lib/internal/api.js +9 -9
- package/lib/internal/command.js +19 -14
- package/lib/internal/config.js +15 -15
- package/lib/internal/credential.js +33 -7
- package/lib/internal/rc.js +18 -10
- package/lib/migration/global/1.4.0.js +4 -2
- package/lib/migration/global/1.6.2.js +4 -2
- package/lib/migration/index.js +1 -1
- package/lib/option-filter.js +79 -22
- package/lib/optional-import.js +1 -1
- package/lib/plugin-loader.js +1 -1
- package/lib/port-resolver.js +23 -3
- package/lib/prompt.js +1 -1
- package/lib/pull/features/functions/index.js +7 -7
- package/lib/pull/features/index.js +1 -1
- package/lib/pull/index.js +10 -3
- package/lib/repl-server.js +9 -5
- package/lib/serve/features/index.js +11 -2
- package/lib/serve/index.js +19 -9
- package/lib/serve/server/index.js +137 -60
- package/lib/serve/server/lib/client.js +1 -1
- package/lib/serve/server/lib/master.js +16 -3
- package/lib/serve/server/lib/node.js +1 -1
- package/lib/shell/dependencies/http-functions.js +120 -90
- package/lib/shell/dependencies/invoker/integ/node.js +1 -1
- package/lib/shell/dependencies/local-function.js +86 -119
- package/lib/shell/index.js +10 -10
- package/lib/shell/prepare/index.js +1 -4
- package/lib/shell/prepare/languages/index.js +15 -4
- package/lib/track.js +4 -1
- package/lib/util_modules/config/index.js +1 -1
- package/lib/util_modules/config/lib/apig.js +3 -3
- package/lib/util_modules/config/lib/client.js +3 -3
- package/lib/util_modules/config/lib/functions.js +5 -5
- package/lib/util_modules/constants/index.js +22 -20
- package/lib/util_modules/constants/lib/regex.js +3 -2
- package/lib/util_modules/constants/lib/runtime.js +9 -0
- package/lib/util_modules/contextHelp.js +63 -123
- package/lib/util_modules/fs/index.js +1 -1
- package/lib/util_modules/fs/lib/async.js +19 -2
- package/lib/util_modules/fs/lib/sync.js +13 -1
- package/lib/util_modules/logger.js +12 -20
- package/lib/util_modules/option.js +1 -13
- package/lib/util_modules/project.js +75 -26
- package/lib/util_modules/shell.js +8 -2
- package/package.json +45 -45
- package/scripts/postInstall.js +31 -0
- package/lib/cjson.js +0 -20
- package/lib/log-error.js +0 -18
- package/lib/util_modules/big-json.js +0 -16
- package/lib/util_modules/constants/lib/stack.js +0 -6
- package/templates/init/functions/.DS_Store +0 -0
- package/templates/init/functions/node/.DS_Store +0 -0
- package/templates/init/functions/node/integ/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcatalyst-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.1",
|
|
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": ">=12.0.0"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [
|
|
13
13
|
"cli",
|
|
@@ -27,63 +27,60 @@
|
|
|
27
27
|
"ansi-colors": "^4.1.1",
|
|
28
28
|
"app-module-path": "^2.2.0",
|
|
29
29
|
"better-queue": "^3.8.10",
|
|
30
|
-
"chokidar": "^3.
|
|
30
|
+
"chokidar": "^3.5.2",
|
|
31
31
|
"cli-cursor": "^3.1.0",
|
|
32
32
|
"cli-table3": "^0.6.0",
|
|
33
|
-
"commander": "^
|
|
34
|
-
"conf": "^
|
|
33
|
+
"commander": "^8.1.0",
|
|
34
|
+
"conf": "^10.0.2",
|
|
35
35
|
"cross-spawn": "^7.0.3",
|
|
36
36
|
"express": "^4.17.1",
|
|
37
|
-
"fs-extra": "^
|
|
38
|
-
"global-dirs": "^
|
|
39
|
-
"http-proxy": "^1.18.
|
|
40
|
-
"inquirer": "^
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"meant": "^1.0.2",
|
|
37
|
+
"fs-extra": "^10.0.0",
|
|
38
|
+
"global-dirs": "^3.0.0",
|
|
39
|
+
"http-proxy": "^1.18.1",
|
|
40
|
+
"inquirer": "^8.1.2",
|
|
41
|
+
"jszip": "^3.7.1",
|
|
42
|
+
"lodash": "^4.17.21",
|
|
43
|
+
"meant": "^2.0.1",
|
|
45
44
|
"minimatch": "^3.0.4",
|
|
46
|
-
"moment": "^2.
|
|
47
|
-
"open": "^
|
|
45
|
+
"moment": "^2.29.1",
|
|
46
|
+
"open": "^8.2.1",
|
|
48
47
|
"portfinder": "^1.0.28",
|
|
49
|
-
"pretty-ms": "^7.0.
|
|
48
|
+
"pretty-ms": "^7.0.1",
|
|
50
49
|
"request": "^2.88.2",
|
|
51
|
-
"semver": "^7.3.
|
|
50
|
+
"semver": "^7.3.5",
|
|
52
51
|
"strip-ansi": "^6.0.0",
|
|
53
52
|
"toml": "^3.0.0",
|
|
54
|
-
"update-notifier": "^
|
|
53
|
+
"update-notifier": "^5.1.0",
|
|
55
54
|
"winston": "^3.3.3",
|
|
56
55
|
"xml2js": "^0.4.23"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
58
|
"@types/app-module-path": "^2.2.0",
|
|
60
|
-
"@types/better-queue": "^3.8.
|
|
61
|
-
"@types/
|
|
62
|
-
"@types/
|
|
63
|
-
"@types/
|
|
64
|
-
"@types/
|
|
65
|
-
"@types/
|
|
66
|
-
"@types/
|
|
67
|
-
"@types/
|
|
68
|
-
"@types/
|
|
69
|
-
"@types/
|
|
70
|
-
"@types/
|
|
71
|
-
"@types/
|
|
72
|
-
"@types/
|
|
73
|
-
"@types/
|
|
74
|
-
"@
|
|
75
|
-
"@
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"eslint": "^
|
|
79
|
-
"eslint-config-prettier": "^7.1.0",
|
|
80
|
-
"eslint-plugin-prettier": "^3.3.0",
|
|
59
|
+
"@types/better-queue": "^3.8.3",
|
|
60
|
+
"@types/cross-spawn": "^6.0.2",
|
|
61
|
+
"@types/express": "^4.17.13",
|
|
62
|
+
"@types/fs-extra": "^9.0.12",
|
|
63
|
+
"@types/http-proxy": "^1.17.7",
|
|
64
|
+
"@types/inquirer": "^7.3.3",
|
|
65
|
+
"@types/jest": "^26.0.24",
|
|
66
|
+
"@types/lodash": "^4.14.172",
|
|
67
|
+
"@types/minimatch": "^3.0.5",
|
|
68
|
+
"@types/node": "^16.6.0",
|
|
69
|
+
"@types/request": "^2.48.7",
|
|
70
|
+
"@types/semver": "^7.3.8",
|
|
71
|
+
"@types/update-notifier": "^5.1.0",
|
|
72
|
+
"@types/xml2js": "^0.4.9",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^4.29.1",
|
|
74
|
+
"@typescript-eslint/parser": "^4.29.1",
|
|
75
|
+
"eslint": "^7.32.0",
|
|
76
|
+
"eslint-config-prettier": "^8.3.0",
|
|
77
|
+
"eslint-plugin-prettier": "^3.4.0",
|
|
81
78
|
"gulp": "^4.0.2",
|
|
82
|
-
"jest": "^
|
|
79
|
+
"jest": "^27.0.6",
|
|
83
80
|
"npm-run-all": "^4.1.5",
|
|
84
|
-
"prettier": "^2.
|
|
85
|
-
"ts-jest": "^
|
|
86
|
-
"typescript": "^3.
|
|
81
|
+
"prettier": "^2.3.2",
|
|
82
|
+
"ts-jest": "^27.0.4",
|
|
83
|
+
"typescript": "^4.3.5"
|
|
87
84
|
},
|
|
88
85
|
"scripts": {
|
|
89
86
|
"build": "gulp build",
|
|
@@ -98,10 +95,13 @@
|
|
|
98
95
|
"prepublishOnly": "npm test && npm run lint",
|
|
99
96
|
"preversion": "npm run lint",
|
|
100
97
|
"version": "git add -A src test templates",
|
|
101
|
-
"postversion": "git push && git push --tags"
|
|
98
|
+
"postversion": "git push && git push --tags",
|
|
99
|
+
"postinstall": "node ./scripts/postInstall.js "
|
|
102
100
|
},
|
|
103
101
|
"files": [
|
|
104
102
|
"lib/**/*",
|
|
105
|
-
"templates/**/*"
|
|
103
|
+
"templates/**/*",
|
|
104
|
+
"docs/**/*",
|
|
105
|
+
"scripts/**/*"
|
|
106
106
|
]
|
|
107
107
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const semver = require('semver');
|
|
9
|
+
const ansi = require('ansi-colors');
|
|
10
|
+
const cliTable = require('cli-table3');
|
|
11
|
+
const packageJson = require('../package.json');
|
|
12
|
+
|
|
13
|
+
if (semver.satisfies(process.version, packageJson.engines.node)) {
|
|
14
|
+
console.log(ansi.green.bold('Installation successful.'));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const table = new cliTable({ style: { border: [], header: [] } });
|
|
19
|
+
table.push(
|
|
20
|
+
{
|
|
21
|
+
'Current version: ': [ansi.red(semver.clean(process.version))]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
'Compatible version: ': [ansi.green(packageJson.engines.node)]
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
console.log(ansi.red('Node.js version is incompatible !!!'));
|
|
28
|
+
console.log(table.toString());
|
|
29
|
+
console.log('\n' + ansi.yellow.bold('Please update Node.js to a compatible version.'));
|
|
30
|
+
console.log(ansi.bold('Reference: ') + ansi.underline('https://nodejs.org/') + '\n');
|
|
31
|
+
} catch (err) {}
|
package/lib/cjson.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_1 = require("./util_modules/fs");
|
|
7
|
-
const big_json_1 = require("./util_modules/big-json");
|
|
8
|
-
const error_1 = __importDefault(require("./error"));
|
|
9
|
-
exports.default = (path) => {
|
|
10
|
-
const jsonContentStr = fs_1.SYNC.readFile(path);
|
|
11
|
-
if (jsonContentStr === undefined) {
|
|
12
|
-
throw new error_1.default('File ' + path + ' does not exist', { exit: 1 });
|
|
13
|
-
}
|
|
14
|
-
try {
|
|
15
|
-
return big_json_1.bigJSON.parse(jsonContentStr);
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
throw new error_1.default('Parse Error in ' + path + ':\n\n' + e.message);
|
|
19
|
-
}
|
|
20
|
-
};
|
package/lib/log-error.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ansi_colors_1 = require("ansi-colors");
|
|
4
|
-
const logger_1 = require("./util_modules/logger");
|
|
5
|
-
exports.default = (err) => {
|
|
6
|
-
if (err.original) {
|
|
7
|
-
logger_1.debug('Original Error: ' +
|
|
8
|
-
(typeof err.original === 'string' ? err.original : err.original.stack));
|
|
9
|
-
}
|
|
10
|
-
logger_1.error(ansi_colors_1.bold.red('Error: ') + err.message);
|
|
11
|
-
logger_1.debug('Error Stack: ' + err.stack);
|
|
12
|
-
if (err.context) {
|
|
13
|
-
logger_1.debug('Error Context: ' + JSON.stringify(err.context, undefined, 2));
|
|
14
|
-
}
|
|
15
|
-
if (err.status) {
|
|
16
|
-
logger_1.debug('Error Status: ' + err.status);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.bigJSON = void 0;
|
|
7
|
-
const json_bigint_1 = __importDefault(require("json-bigint"));
|
|
8
|
-
const jsonFunctions = json_bigint_1.default({ storeAsString: true });
|
|
9
|
-
exports.bigJSON = {
|
|
10
|
-
parse: (text, reviver) => {
|
|
11
|
-
const data = jsonFunctions.parse(text, reviver);
|
|
12
|
-
const strData = jsonFunctions.stringify(data);
|
|
13
|
-
return JSON.parse(strData);
|
|
14
|
-
},
|
|
15
|
-
stringify: jsonFunctions.stringify
|
|
16
|
-
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|