zcatalyst-cli 1.25.3 → 1.26.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/api-timer.d.ts +0 -1
- package/lib/apig-utils.d.ts +1 -1
- package/lib/apig-utils.js +1 -1
- package/lib/appsail-utils.js +6 -7
- package/lib/archiver.d.ts +0 -4
- package/lib/archiver.js +21 -11
- package/lib/authentication/constants/auth.js +1 -1
- package/lib/authentication/credential.js +3 -3
- package/lib/authentication/index.js +25 -14
- package/lib/authentication/login.d.ts +0 -2
- package/lib/authentication/login.js +23 -10
- package/lib/bin/catalyst.js +17 -7
- package/lib/client-utils.d.ts +3 -3
- package/lib/client-utils.js +2 -2
- package/lib/client.js +19 -9
- package/lib/code-deck.d.ts +0 -2
- package/lib/code-deck.js +4 -4
- package/lib/command_needs/config.js +1 -1
- package/lib/command_needs/rc.js +5 -2
- package/lib/commands/appsail/add.js +17 -7
- package/lib/commands/client/setup.js +17 -7
- package/lib/commands/config/set.js +5 -3
- package/lib/commands/deploy/appsail.js +37 -14
- package/lib/commands/deploy/index.js +88 -66
- package/lib/commands/deploy/slate.js +37 -14
- package/lib/commands/event/generate/integ.js +18 -9
- package/lib/commands/functions/add.js +17 -7
- package/lib/commands/functions/execute.js +17 -7
- package/lib/commands/functions/setup.js +17 -7
- package/lib/commands/functions/shell.js +17 -7
- package/lib/commands/iac/import.js +18 -8
- package/lib/commands/iac/pack.js +17 -7
- package/lib/commands/iac/status.js +17 -7
- package/lib/commands/index.js +20 -12
- package/lib/commands/init.js +17 -7
- package/lib/commands/login.js +17 -7
- package/lib/commands/logout.js +17 -7
- package/lib/commands/project/list.js +17 -7
- package/lib/commands/project/use.js +1 -0
- package/lib/commands/pull.js +17 -7
- package/lib/commands/run.js +17 -7
- package/lib/commands/serve.js +17 -7
- package/lib/commands/signals/generate/index.js +1 -1
- package/lib/commands/slate/create.js +17 -7
- package/lib/commands/slate/link.js +17 -7
- package/lib/commands/token/generate.js +17 -7
- package/lib/commands/token/list.js +17 -7
- package/lib/commands/token/revoke.js +17 -7
- package/lib/commands/zest/generate/index.js +21 -11
- package/lib/deploy/features/appsail/index.js +2 -3
- package/lib/deploy/features/appsail/pack.d.ts +0 -1
- package/lib/deploy/features/appsail/pack.js +2 -3
- package/lib/deploy/features/appsail/utils.js +7 -8
- package/lib/deploy/features/functions/languages/index.js +3 -4
- package/lib/deploy/features/index.js +17 -7
- package/lib/deploy/features/slate.js +2 -3
- package/lib/deploy/index.js +2 -2
- package/lib/deploy/util.d.ts +2 -0
- package/lib/deploy/util.js +3 -1
- package/lib/docs/commands/signals/generate/generate.toml +19 -0
- package/lib/docs/commands/slate/unlink.toml +9 -0
- package/lib/docs/fn-utils/lib/node.toml +4 -0
- package/lib/docs/init/dependencies/python/ensure-python.toml +4 -0
- package/lib/docs/serve/server/lib/slate/index.toml +15 -0
- package/lib/docs/slate-utils.toml +9 -0
- package/lib/endpoints/index.d.ts +2 -1
- package/lib/endpoints/index.js +88 -79
- package/lib/endpoints/lib/apig.d.ts +0 -1
- package/lib/endpoints/lib/apig.js +2 -2
- package/lib/endpoints/lib/applogic.d.ts +0 -1
- package/lib/endpoints/lib/applogic.js +2 -2
- package/lib/endpoints/lib/appsail.d.ts +1 -4
- package/lib/endpoints/lib/appsail.js +7 -7
- package/lib/endpoints/lib/client.d.ts +0 -1
- package/lib/endpoints/lib/code-deck.js +1 -1
- package/lib/endpoints/lib/common.d.ts +0 -2
- package/lib/endpoints/lib/ds-bulk.js +2 -2
- package/lib/endpoints/lib/env.js +2 -2
- package/lib/endpoints/lib/filestore.d.ts +0 -1
- package/lib/endpoints/lib/functions.d.ts +0 -1
- package/lib/endpoints/lib/functions.js +2 -2
- package/lib/endpoints/lib/git-hub.d.ts +0 -2
- package/lib/endpoints/lib/iac.d.ts +0 -3
- package/lib/endpoints/lib/iac.js +2 -2
- package/lib/endpoints/lib/project.d.ts +0 -1
- package/lib/endpoints/lib/project.js +2 -2
- package/lib/endpoints/lib/sdk.d.ts +0 -2
- package/lib/endpoints/lib/sdk.js +1 -1
- package/lib/endpoints/lib/slate.d.ts +0 -1
- package/lib/endpoints/lib/stratus.d.ts +0 -1
- package/lib/endpoints/lib/user.d.ts +0 -2
- package/lib/endpoints/lib/user.js +2 -1
- package/lib/error/context-help.js +1 -1
- package/lib/error/index.js +2 -2
- package/lib/event_generate/cache.js +4 -4
- package/lib/event_generate/custom.js +1 -2
- package/lib/event_generate/datastore.js +4 -4
- package/lib/event_generate/filestore.js +4 -4
- package/lib/event_generate/github.js +2 -2
- package/lib/event_generate/index.js +19 -11
- package/lib/event_generate/stratus.js +2 -2
- package/lib/event_generate/user.js +2 -2
- package/lib/event_generate/webapp.js +2 -2
- package/lib/execute/caller.d.ts +0 -1
- package/lib/execute/caller.js +20 -7
- package/lib/execute/index.js +27 -4
- package/lib/execute-script.js +22 -13
- package/lib/express_middlewares/auth-checker.js +2 -3
- package/lib/express_middlewares/project.d.ts +1 -1
- package/lib/fn-utils/index.js +17 -7
- package/lib/fn-utils/lib/browserLogic.js +4 -5
- package/lib/fn-utils/lib/common.d.ts +0 -1
- package/lib/fn-utils/lib/common.js +25 -26
- package/lib/fn-utils/lib/integ.js +2 -3
- package/lib/fn-utils/lib/java/classpath.js +2 -3
- package/lib/fn-utils/lib/java/compile.js +4 -4
- package/lib/fn-utils/lib/java/ensure-java-userconfig.d.ts +10 -0
- package/lib/fn-utils/lib/java/ensure-java-userconfig.js +45 -23
- package/lib/fn-utils/lib/java/index.d.ts +0 -1
- package/lib/fn-utils/lib/java/index.js +11 -11
- package/lib/fn-utils/lib/java/keywords.js +2 -2
- package/lib/fn-utils/lib/node.d.ts +1 -1
- package/lib/fn-utils/lib/node.js +67 -15
- package/lib/fn-utils/lib/python.js +29 -19
- package/lib/iac/status/util/index.d.ts +1 -1
- package/lib/init/dependencies/npm-install.js +2 -2
- package/lib/init/dependencies/python/ensure-python.d.ts +2 -2
- package/lib/init/dependencies/python/ensure-python.js +65 -58
- package/lib/init/dependencies/python/pip-install.d.ts +3 -5
- package/lib/init/dependencies/python/pip-install.js +14 -53
- package/lib/init/features/appsail/utils.js +21 -12
- package/lib/init/features/client/index.js +18 -9
- package/lib/init/features/client/initializers/angular.js +17 -7
- package/lib/init/features/client/initializers/basic.js +17 -7
- package/lib/init/features/client/initializers/lyte.js +17 -7
- package/lib/init/features/client/initializers/react.js +17 -7
- package/lib/init/features/index.js +29 -20
- package/lib/init/features/project.js +5 -5
- package/lib/init/features/slate/index.js +19 -9
- package/lib/init/util/client.js +23 -13
- package/lib/init/util/common.js +5 -6
- package/lib/init/util/project.js +1 -1
- package/lib/internal/api.d.ts +0 -3
- package/lib/internal/api.js +19 -9
- package/lib/internal/command.js +18 -9
- package/lib/migration/global/1.25.0.d.ts +2 -0
- package/lib/migration/global/1.25.0.js +28 -0
- package/lib/migration/index.js +20 -12
- package/lib/option-filter.js +19 -10
- package/lib/optional-import.js +19 -10
- package/lib/plugin-loader.d.ts +0 -2
- package/lib/plugin-loader.js +18 -8
- package/lib/port-resolver.js +10 -10
- package/lib/prompt/index.d.ts +3 -3
- package/lib/prompt/index.js +17 -7
- package/lib/prompt/types/file-path.d.ts +0 -1
- package/lib/prompt/types/search-box.d.ts +0 -1
- package/lib/prompt/types/tree.d.ts +1 -2
- package/lib/prompt/types/tree.js +10 -10
- package/lib/prompt/types/with-description.d.ts +0 -1
- package/lib/pull/features/functions/index.js +71 -52
- package/lib/pull/features/functions/languages.js +3 -4
- package/lib/pull/features/index.js +17 -7
- package/lib/repl-server.d.ts +0 -1
- package/lib/repl-server.js +9 -1
- package/lib/serve/features/apig.js +7 -1
- package/lib/serve/features/appsail.d.ts +1 -0
- package/lib/serve/features/appsail.js +51 -7
- package/lib/serve/features/index.js +22 -13
- package/lib/serve/index.js +17 -7
- package/lib/serve/server/index.d.ts +0 -2
- package/lib/serve/server/index.js +26 -12
- package/lib/serve/server/lib/appsail/index.js +27 -34
- package/lib/serve/server/lib/appsail/start.js +12 -5
- package/lib/serve/server/lib/appsail/util.d.ts +11 -0
- package/lib/serve/server/lib/appsail/util.js +69 -0
- package/lib/serve/server/lib/java/index.js +18 -7
- package/lib/serve/server/lib/master/appsail.js +3 -4
- package/lib/serve/server/lib/master/functions.js +1 -2
- package/lib/serve/server/lib/master/index.d.ts +0 -1
- package/lib/serve/server/lib/master/index.js +5 -5
- package/lib/serve/server/lib/master/slate.js +1 -2
- package/lib/serve/server/lib/master/unknown-req-proxy.js +5 -2
- package/lib/serve/server/lib/master/utils.d.ts +4 -8
- package/lib/serve/server/lib/master/utils.js +4 -6
- package/lib/serve/server/lib/master/web-client.js +1 -2
- package/lib/serve/server/lib/node/index.js +22 -11
- package/lib/serve/server/lib/node/server/browserlogic/utils/playwright-handler.js +1 -1
- package/lib/serve/server/lib/node/server/browserlogic/utils/puppeteer-handler.js +1 -1
- package/lib/serve/server/lib/node/server/browserlogic/utils/selenium-handler.js +2 -0
- package/lib/serve/server/lib/python/index.js +23 -14
- package/lib/serve/server/lib/slate/static-server.d.ts +0 -1
- package/lib/serve/server/lib/slate/static-server.js +5 -4
- package/lib/serve/server/lib/web_client/server.d.ts +0 -1
- package/lib/serve/server/lib/web_client/server.js +5 -4
- package/lib/shell/dependencies/http-functions.d.ts +0 -2
- package/lib/shell/dependencies/http-functions.js +7 -7
- package/lib/shell/dependencies/non-http-function/fn-execution-handler.d.ts +0 -2
- package/lib/shell/dependencies/non-http-function/fn-execution-handler.js +55 -24
- package/lib/shell/dependencies/non-http-function/fn-handler.d.ts +3 -3
- package/lib/shell/dependencies/non-http-function/fn-handler.js +54 -20
- package/lib/shell/dependencies/non-http-function/node.js +4 -4
- package/lib/shell/dependencies/non-http-function/python.d.ts +1 -1
- package/lib/shell/dependencies/non-http-function/python.js +11 -13
- package/lib/shell/dependencies/non-http-function/slave-manager.d.ts +0 -2
- package/lib/shell/dependencies/non-http-function/slave-manager.js +11 -7
- package/lib/shell/dependencies/tunnel-server.js +4 -4
- package/lib/shell/index.js +50 -3
- package/lib/shell/prepare/index.js +4 -3
- package/lib/shell/prepare/languages/index.js +18 -9
- package/lib/shell/prepare/languages/node.js +29 -19
- package/lib/shell/prepare/languages/python.js +6 -12
- package/lib/signals/index.js +19 -11
- package/lib/slate-utils.js +2 -2
- package/lib/throbber/index.d.ts +1 -2
- package/lib/throbber/index.js +5 -2
- package/lib/throbber/utils.d.ts +0 -1
- package/lib/throbber/utils.js +4 -5
- package/lib/userConfig.d.ts +14 -0
- package/lib/userConfig.js +15 -1
- package/lib/util_modules/config/index.js +17 -7
- package/lib/util_modules/config/lib/apig.d.ts +1 -0
- package/lib/util_modules/config/lib/apig.js +10 -5
- package/lib/util_modules/config/lib/appsail.js +7 -7
- package/lib/util_modules/config/lib/client.js +5 -6
- package/lib/util_modules/config/lib/functions.js +5 -6
- package/lib/util_modules/config/lib/slate.js +5 -6
- package/lib/util_modules/config-store.d.ts +1 -1
- package/lib/util_modules/config-store.js +30 -13
- package/lib/util_modules/constants/lib/apig-rules.d.ts +1 -1
- package/lib/util_modules/constants/lib/dc-type.js +3 -3
- package/lib/util_modules/constants/lib/placeholders.d.ts +1 -1
- package/lib/util_modules/constants/lib/placeholders.js +1 -1
- package/lib/util_modules/constants/lib/urls.js +2 -9
- package/lib/util_modules/container.js +23 -14
- package/lib/util_modules/dc.js +3 -4
- package/lib/util_modules/env.d.ts +3 -0
- package/lib/util_modules/env.js +64 -4
- package/lib/util_modules/event-emitter.d.ts +9 -0
- package/lib/util_modules/event-emitter.js +68 -0
- package/lib/util_modules/fs/index.js +17 -7
- package/lib/util_modules/fs/lib/async.d.ts +0 -4
- package/lib/util_modules/fs/lib/async.js +46 -46
- package/lib/util_modules/fs/lib/sync.d.ts +1 -3
- package/lib/util_modules/fs/lib/sync.js +40 -30
- package/lib/util_modules/logger/index.js +12 -12
- package/lib/util_modules/logger/utils.d.ts +0 -4
- package/lib/util_modules/logger/utils.js +1 -1
- package/lib/util_modules/logger/winston.js +2 -2
- package/lib/util_modules/option.js +5 -6
- package/lib/util_modules/project.js +22 -23
- package/lib/util_modules/runtime-store.d.ts +2 -2
- package/lib/util_modules/server.d.ts +1 -2
- package/lib/util_modules/server.js +54 -15
- package/lib/util_modules/shell.d.ts +0 -3
- package/lib/util_modules/shell.js +5 -6
- package/lib/util_modules/toml.js +2 -3
- package/package.json +13 -13
- package/templates/init/functions/java/event/sample.java +5 -2
- package/templates/web-socket.txt +1 -1
- /package/lib/docs/{commands/event/generate → event_generate}/index.toml +0 -0
- /package/templates/init/functions/java/integ/convokraft/{Sample.java → sample.java} +0 -0
package/lib/api-timer.d.ts
CHANGED
package/lib/apig-utils.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare const apigUtils: {
|
|
|
34
34
|
validate: () => Promise<Array<IAPIGRules>>;
|
|
35
35
|
compile: (ruleArr: Array<IAPIGRules>) => IAPIGLocal;
|
|
36
36
|
executeHook: ({ prefix, command }: {
|
|
37
|
-
prefix:
|
|
37
|
+
prefix: "pre" | "post";
|
|
38
38
|
command: string;
|
|
39
39
|
}) => Promise<void>;
|
|
40
40
|
pack: () => Promise<ReadStream>;
|
package/lib/apig-utils.js
CHANGED
|
@@ -358,7 +358,7 @@ exports.apigUtils = {
|
|
|
358
358
|
}
|
|
359
359
|
return localConfig;
|
|
360
360
|
},
|
|
361
|
-
executeHook: (
|
|
361
|
+
executeHook: (_a) => __awaiter(void 0, [_a], void 0, function* ({ prefix, command }) {
|
|
362
362
|
if ((0, option_1.getOptionValue)('ignoreScripts', false)) {
|
|
363
363
|
(0, index_1.debug)(`skipping ${prefix + command} hook`);
|
|
364
364
|
return;
|
package/lib/appsail-utils.js
CHANGED
|
@@ -12,7 +12,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.filterTargets = filterTargets;
|
|
16
|
+
exports.validateAppSail = validateAppSail;
|
|
16
17
|
const ansi_colors_1 = require("ansi-colors");
|
|
17
18
|
const error_1 = __importDefault(require("./error"));
|
|
18
19
|
const appsail_1 = require("./util_modules/config/lib/appsail");
|
|
@@ -97,7 +98,6 @@ function filterTargets(allTargets) {
|
|
|
97
98
|
}
|
|
98
99
|
return allTargets;
|
|
99
100
|
}
|
|
100
|
-
exports.filterTargets = filterTargets;
|
|
101
101
|
function validateAppSail(targDetails) {
|
|
102
102
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103
103
|
let isSocket;
|
|
@@ -131,8 +131,8 @@ function validateAppSail(targDetails) {
|
|
|
131
131
|
}
|
|
132
132
|
const traversedDigests = new Set();
|
|
133
133
|
const resolveImageManifestPath = (manifestIndex, sourceFile) => __awaiter(this, void 0, void 0, function* () {
|
|
134
|
-
var
|
|
135
|
-
const imageDescriptor = (
|
|
134
|
+
var _a;
|
|
135
|
+
const imageDescriptor = (_a = manifestIndex.manifests) === null || _a === void 0 ? void 0 : _a.find((manifest) => {
|
|
136
136
|
if (!(manifest === null || manifest === void 0 ? void 0 : manifest.digest)) {
|
|
137
137
|
return false;
|
|
138
138
|
}
|
|
@@ -198,7 +198,7 @@ function validateAppSail(targDetails) {
|
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
200
|
const _details = targDetails.map((targ) => __awaiter(this, void 0, void 0, function* () {
|
|
201
|
-
var
|
|
201
|
+
var _a, _b;
|
|
202
202
|
if (targ.validity.valid) {
|
|
203
203
|
if (targ.runtime === 'custom') {
|
|
204
204
|
if (isSocket === undefined) {
|
|
@@ -240,7 +240,7 @@ function validateAppSail(targDetails) {
|
|
|
240
240
|
}
|
|
241
241
|
return targ;
|
|
242
242
|
}
|
|
243
|
-
if (((
|
|
243
|
+
if (((_a = targ.config) === null || _a === void 0 ? void 0 : _a.platform) !== 'war' && !((_b = targ.config) === null || _b === void 0 ? void 0 : _b.command)) {
|
|
244
244
|
targ.validity = {
|
|
245
245
|
valid: false,
|
|
246
246
|
reason: 'Start-up command missing'
|
|
@@ -253,4 +253,3 @@ function validateAppSail(targDetails) {
|
|
|
253
253
|
return Promise.all(_details);
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
exports.validateAppSail = validateAppSail;
|
package/lib/archiver.d.ts
CHANGED
package/lib/archiver.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -55,13 +65,13 @@ class Archiver {
|
|
|
55
65
|
this.jszip = (0, jszip_1.loadAsync)(content, { createFolders });
|
|
56
66
|
return this;
|
|
57
67
|
}
|
|
58
|
-
_writeFolder(
|
|
59
|
-
return __awaiter(this,
|
|
68
|
+
_writeFolder(folder_1, to_1) {
|
|
69
|
+
return __awaiter(this, arguments, void 0, function* (folder, to, recursive = false, ignoreLevel = 1) {
|
|
60
70
|
return this._writeAllFile(folder.filter((_relPath, file) => !file.dir), to, recursive, ignoreLevel);
|
|
61
71
|
});
|
|
62
72
|
}
|
|
63
|
-
_writeAllFile(
|
|
64
|
-
return __awaiter(this,
|
|
73
|
+
_writeAllFile(files_1, to_1) {
|
|
74
|
+
return __awaiter(this, arguments, void 0, function* (files, to, recursive = false, ignoreLevel = 0) {
|
|
65
75
|
while (files.length > 0) {
|
|
66
76
|
const limit = files.length < Archiver.maxWriteLimit ? files.length : Archiver.maxWriteLimit;
|
|
67
77
|
yield Promise.all(files.splice(0, limit).map((file) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -22,7 +22,6 @@ class AUTH {
|
|
|
22
22
|
return AUTH._mobile[dc.m_auth];
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
exports.default = AUTH;
|
|
26
25
|
AUTH._web = {
|
|
27
26
|
[dc_type_js_1.default.us.ref]: {
|
|
28
27
|
id: (0, env_js_1.envOverride)('W_CATALYST_CLIENT_ID', '1000.D5IIHDXSPN2MII26AD0V61I6RMVSNM'),
|
|
@@ -35,3 +34,4 @@ AUTH._mobile = {
|
|
|
35
34
|
secret: (0, env_js_1.envOverride)('M_CATALYST_CLIENT_SECRET', 'ee359029dc211b37c797d3584c59953f2bd6aa1adc')
|
|
36
35
|
}
|
|
37
36
|
};
|
|
37
|
+
exports.default = AUTH;
|
|
@@ -121,8 +121,8 @@ class Credential {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
refreshAccessToken() {
|
|
124
|
-
var _a, _b;
|
|
125
124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
var _a, _b;
|
|
126
126
|
(0, index_1.debug)('> refreshing access token <');
|
|
127
127
|
const res = yield new api_js_1.default({ authNeeded: false })
|
|
128
128
|
.post('/oauth/v2/token', {
|
|
@@ -223,8 +223,8 @@ class Credential {
|
|
|
223
223
|
Credential.isTempCred = temp;
|
|
224
224
|
return Credential.globalSelf;
|
|
225
225
|
}
|
|
226
|
-
static getAccessToken(
|
|
227
|
-
return __awaiter(this,
|
|
226
|
+
static getAccessToken() {
|
|
227
|
+
return __awaiter(this, arguments, void 0, function* (forceRefresh = false) {
|
|
228
228
|
if (Credential.globalSelf === null) {
|
|
229
229
|
if (Credential.oneTimeToken === null) {
|
|
230
230
|
throw new error_js_1.default('Authentication required', {
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -35,7 +45,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
46
|
};
|
|
37
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.
|
|
48
|
+
exports.create = create;
|
|
49
|
+
exports.list = list;
|
|
50
|
+
exports.revoke = revoke;
|
|
51
|
+
exports.login = login;
|
|
52
|
+
exports.logout = logout;
|
|
39
53
|
const ansi_colors_1 = __importStar(require("ansi-colors"));
|
|
40
54
|
const moment_1 = __importDefault(require("moment"));
|
|
41
55
|
const config_store_js_1 = __importDefault(require("../util_modules/config-store.js"));
|
|
@@ -50,6 +64,7 @@ const option_js_1 = require("../util_modules/option.js");
|
|
|
50
64
|
const login_js_1 = __importDefault(require("./login.js"));
|
|
51
65
|
const revoke_js_1 = __importDefault(require("./revoke.js"));
|
|
52
66
|
const runtime_store_js_1 = __importDefault(require("../runtime-store.js"));
|
|
67
|
+
const env_js_1 = require("../util_modules/env.js");
|
|
53
68
|
function create() {
|
|
54
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
70
|
if ((0, option_js_1.getOptionValue)('current', false)) {
|
|
@@ -60,14 +75,14 @@ function create() {
|
|
|
60
75
|
return result.token.token;
|
|
61
76
|
});
|
|
62
77
|
}
|
|
63
|
-
exports.create = create;
|
|
64
78
|
function list() {
|
|
65
79
|
const tokens = config_store_js_1.default.get(`${(0, dc_js_1.getActiveDC)()}.tokens`, null);
|
|
66
80
|
if (tokens === null || Object.keys(tokens).length === 0) {
|
|
67
81
|
throw new error_js_1.default('No tokens found', {
|
|
68
82
|
exit: 0,
|
|
69
83
|
errorId: 'IDX-1',
|
|
70
|
-
arg: [(0, ansi_colors_1.bold)('catalyst token:generate')]
|
|
84
|
+
arg: [(0, ansi_colors_1.bold)('catalyst token:generate')],
|
|
85
|
+
skipHelp: env_js_1.isExtension
|
|
71
86
|
});
|
|
72
87
|
}
|
|
73
88
|
const tableData = [];
|
|
@@ -84,7 +99,6 @@ function list() {
|
|
|
84
99
|
});
|
|
85
100
|
return tableData;
|
|
86
101
|
}
|
|
87
|
-
exports.list = list;
|
|
88
102
|
function revoke(id) {
|
|
89
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
104
|
const tokens = config_store_js_1.default.get(`${(0, dc_js_1.getActiveDC)()}.tokens`, {});
|
|
@@ -105,7 +119,6 @@ function revoke(id) {
|
|
|
105
119
|
return new revoke_js_1.default(credential, 'tokens.' + id).init();
|
|
106
120
|
});
|
|
107
121
|
}
|
|
108
|
-
exports.revoke = revoke;
|
|
109
122
|
function login() {
|
|
110
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
111
124
|
let activeDC = (0, dc_js_1.getActiveDC)();
|
|
@@ -146,7 +159,6 @@ function login() {
|
|
|
146
159
|
(0, index_1.success)('Success! Logged in as : ' + ansi_colors_1.default.cyan.bold(result.user.Email));
|
|
147
160
|
});
|
|
148
161
|
}
|
|
149
|
-
exports.login = login;
|
|
150
162
|
function logout() {
|
|
151
163
|
return __awaiter(this, void 0, void 0, function* () {
|
|
152
164
|
const activeDC = (0, dc_js_1.getActiveDC)();
|
|
@@ -173,4 +185,3 @@ function logout() {
|
|
|
173
185
|
(0, index_1.success)('SuccessFully Logged out, we hope to see you soon. (^-^)ノ');
|
|
174
186
|
});
|
|
175
187
|
}
|
|
176
|
-
exports.logout = logout;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -60,6 +70,7 @@ const option_js_1 = require("../util_modules/option.js");
|
|
|
60
70
|
const events_1 = __importDefault(require("events"));
|
|
61
71
|
const index_js_4 = __importDefault(require("../error/index.js"));
|
|
62
72
|
const crypto_1 = require("crypto");
|
|
73
|
+
const env_js_1 = require("../util_modules/env.js");
|
|
63
74
|
exports.missingScopes = {
|
|
64
75
|
[index_js_3.DC_TYPE.in.value]: getScopes(['dataverse']),
|
|
65
76
|
[index_js_3.DC_TYPE.eu.value]: getScopes(['dataverse']),
|
|
@@ -184,14 +195,16 @@ class Login {
|
|
|
184
195
|
if ((0, option_js_1.getCurrentCommand)() === 'login') {
|
|
185
196
|
throw new error_js_1.default('Unable to get refresh_token from code', {
|
|
186
197
|
exit: 0,
|
|
187
|
-
errorId: 'LOGIN-1'
|
|
198
|
+
errorId: 'LOGIN-1',
|
|
199
|
+
skipHelp: env_js_1.isExtension
|
|
188
200
|
});
|
|
189
201
|
}
|
|
190
202
|
else {
|
|
191
203
|
throw new error_js_1.default('Unable to get refresh_token from code', {
|
|
192
204
|
exit: 1,
|
|
193
205
|
errorId: 'LOGIN-2',
|
|
194
|
-
arg: [(0, ansi_colors_1.bold)('catalyst token:generate')]
|
|
206
|
+
arg: [(0, ansi_colors_1.bold)('catalyst token:generate')],
|
|
207
|
+
skipHelp: env_js_1.isExtension
|
|
195
208
|
});
|
|
196
209
|
}
|
|
197
210
|
}
|
|
@@ -428,5 +441,5 @@ class Login {
|
|
|
428
441
|
return scopes_js_1.default;
|
|
429
442
|
}
|
|
430
443
|
}
|
|
431
|
-
exports.default = Login;
|
|
432
444
|
Login.loginEvents = new events_1.default();
|
|
445
|
+
exports.default = Login;
|
package/lib/bin/catalyst.js
CHANGED
|
@@ -16,13 +16,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
16
16
|
}) : function(o, v) {
|
|
17
17
|
o["default"] = v;
|
|
18
18
|
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
26
36
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
27
37
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28
38
|
return new (P || (P = Promise))(function (resolve, reject) {
|
package/lib/client-utils.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReadStream } from 'fs-extra';
|
|
2
2
|
export declare const clientUtils: {
|
|
3
3
|
validate: ({ source, skipPluginValidation }?: {
|
|
4
|
-
source?: string
|
|
5
|
-
skipPluginValidation?: boolean
|
|
4
|
+
source?: string;
|
|
5
|
+
skipPluginValidation?: boolean;
|
|
6
6
|
}) => Promise<Record<string, unknown>>;
|
|
7
7
|
executeHook: ({ prefix, command }: {
|
|
8
|
-
prefix:
|
|
8
|
+
prefix: "pre" | "post";
|
|
9
9
|
command: string;
|
|
10
10
|
}) => Promise<void>;
|
|
11
11
|
pack: () => Promise<{
|
package/lib/client-utils.js
CHANGED
|
@@ -28,7 +28,7 @@ const index_1 = require("./util_modules/logger/index");
|
|
|
28
28
|
const option_1 = require("./util_modules/option");
|
|
29
29
|
const stream_1 = require("stream");
|
|
30
30
|
exports.clientUtils = {
|
|
31
|
-
validate: (
|
|
31
|
+
validate: (...args_1) => __awaiter(void 0, [...args_1], void 0, function* ({ source, skipPluginValidation = false } = {}) {
|
|
32
32
|
if (source === null || source === void 0 ? void 0 : source.includes(path_1.sep)) {
|
|
33
33
|
throw new index_js_1.default(`Invalid source: "${source}" should not contain a path.`, {
|
|
34
34
|
exit: 1
|
|
@@ -125,7 +125,7 @@ exports.clientUtils = {
|
|
|
125
125
|
runtime_store_1.default.set('context.client.valid', true);
|
|
126
126
|
return packageJson;
|
|
127
127
|
}),
|
|
128
|
-
executeHook: (
|
|
128
|
+
executeHook: (_a) => __awaiter(void 0, [_a], void 0, function* ({ prefix, command }) {
|
|
129
129
|
if ((0, option_1.getOptionValue)('ignoreScripts', false)) {
|
|
130
130
|
(0, index_1.debug)(`skipping ${prefix + command} hook`);
|
|
131
131
|
return;
|
package/lib/client.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -106,8 +116,8 @@ class Client {
|
|
|
106
116
|
});
|
|
107
117
|
return optionsArr;
|
|
108
118
|
}
|
|
109
|
-
exec(
|
|
110
|
-
return __awaiter(this,
|
|
119
|
+
exec(command_1, projectRoot_1, cwd_1) {
|
|
120
|
+
return __awaiter(this, arguments, void 0, function* (command, projectRoot, cwd, { args = [], options = {}, inputs } = {}) {
|
|
111
121
|
runtime_store_1.default.set('context', {});
|
|
112
122
|
utils_js_1.runtime.set('context', {});
|
|
113
123
|
runtime_store_1.default.set('cwd', cwd);
|
package/lib/code-deck.d.ts
CHANGED
package/lib/code-deck.js
CHANGED
|
@@ -12,7 +12,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.CodeDeckToken =
|
|
15
|
+
exports.CodeDeckToken = void 0;
|
|
16
|
+
exports.listenDeploy = listenDeploy;
|
|
17
|
+
exports.getTemplateFile = getTemplateFile;
|
|
18
|
+
exports.getDeckFromGit = getDeckFromGit;
|
|
16
19
|
const archiver_1 = __importDefault(require("./archiver"));
|
|
17
20
|
const endpoints_1 = require("./endpoints");
|
|
18
21
|
const error_1 = __importDefault(require("./error"));
|
|
@@ -46,7 +49,6 @@ function listenDeploy(id, gitUrl) {
|
|
|
46
49
|
}
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
|
-
exports.listenDeploy = listenDeploy;
|
|
50
52
|
function getTemplateFile(deckZip) {
|
|
51
53
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
54
|
try {
|
|
@@ -59,7 +61,6 @@ function getTemplateFile(deckZip) {
|
|
|
59
61
|
}
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
|
-
exports.getTemplateFile = getTemplateFile;
|
|
63
64
|
function getDeckFromGit() {
|
|
64
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
66
|
const deckAPI = yield (0, endpoints_1.codeDeck)();
|
|
@@ -99,7 +100,6 @@ function getDeckFromGit() {
|
|
|
99
100
|
return deck.code;
|
|
100
101
|
});
|
|
101
102
|
}
|
|
102
|
-
exports.getDeckFromGit = getDeckFromGit;
|
|
103
103
|
class CodeDeckToken {
|
|
104
104
|
static createToken(importId, gitUrl) {
|
|
105
105
|
const tokenObj = [importId, gitUrl];
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const config_1 = __importDefault(require("../internal/config"));
|
|
16
16
|
const runtime_store_1 = __importDefault(require("../runtime-store"));
|
|
17
|
-
exports.default = (
|
|
17
|
+
exports.default = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* ({ optional = false } = {}) {
|
|
18
18
|
const userConfig = yield config_1.default.load(optional);
|
|
19
19
|
runtime_store_1.default.set('config', userConfig);
|
|
20
20
|
});
|
package/lib/command_needs/rc.js
CHANGED
|
@@ -28,7 +28,7 @@ const config_store_1 = __importDefault(require("../util_modules/config-store"));
|
|
|
28
28
|
const dc_1 = require("../util_modules/dc");
|
|
29
29
|
const env_1 = require("../util_modules/env");
|
|
30
30
|
const features_1 = require("../init/features");
|
|
31
|
-
exports.default = ({ optional = false, resolveOnNotFound = false, skipOrgCheck = true, skipProjectCheck = true, generateRc = false } = {})
|
|
31
|
+
exports.default = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* ({ optional = false, resolveOnNotFound = false, skipOrgCheck = true, skipProjectCheck = true, generateRc = false } = {}) {
|
|
32
32
|
const globOrgOpt = (0, option_1.getGlobalOptionValue)('org', null);
|
|
33
33
|
const orgOpt = globOrgOpt
|
|
34
34
|
? globOrgOpt
|
|
@@ -248,7 +248,10 @@ exports.default = ({ optional = false, resolveOnNotFound = false, skipOrgCheck =
|
|
|
248
248
|
errorId: 'RC-5',
|
|
249
249
|
arg: [
|
|
250
250
|
(0, ansi_colors_1.bold)(`${finalProjectObj === null || finalProjectObj === void 0 ? void 0 : finalProjectObj.name}(${finalProjectObj === null || finalProjectObj === void 0 ? void 0 : finalProjectObj.id})`),
|
|
251
|
-
(0, ansi_colors_1.bold)((0, ansi_colors_1.cyan)('command: ') +
|
|
251
|
+
(0, ansi_colors_1.bold)((0, ansi_colors_1.cyan)('command: ') +
|
|
252
|
+
(env_1.isExtension
|
|
253
|
+
? 'zcatalyst.init.init'
|
|
254
|
+
: 'catalyst init --force'))
|
|
252
255
|
]
|
|
253
256
|
});
|
|
254
257
|
}
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -19,11 +19,13 @@ const index_1 = require("../../util_modules/logger/index");
|
|
|
19
19
|
exports.default = new command_1.default('config:set <key=value>')
|
|
20
20
|
.description('Set catalyst configuration as a key value pair')
|
|
21
21
|
.action((details) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
22
|
+
const firstEqualIndex = details.indexOf('=');
|
|
23
|
+
if (firstEqualIndex === -1) {
|
|
24
24
|
throw new error_1.default('Invalid parameter passed' +
|
|
25
25
|
`\nplease give the key value pairs splitted by '=' (eg. orgname=zoho) `);
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
const key = details.substring(0, firstEqualIndex);
|
|
28
|
+
const value = details.substring(firstEqualIndex + 1);
|
|
29
|
+
userConfig_1.default.set(key, value);
|
|
28
30
|
(0, index_1.success)('config updated successfully');
|
|
29
31
|
}));
|