zcatalyst-cli 1.15.0-beta.2 → 1.15.0-beta.4
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/appsail-utils.js +84 -0
- package/lib/archiver.js +18 -1
- package/lib/code-deck.js +114 -0
- package/lib/command_needs/rc.js +7 -6
- package/lib/commands/appsail/add.js +55 -0
- package/lib/commands/codelib/install.js +143 -0
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/deploy/appsail.js +62 -0
- package/lib/commands/{deploy.js → deploy/index.js} +20 -14
- package/lib/commands/iac/pack.js +3 -3
- package/lib/commands/index.js +2 -0
- package/lib/commands/init.js +5 -1
- package/lib/commands/pull.js +1 -1
- package/lib/commands/serve.js +1 -1
- package/lib/commands/whoami.js +2 -1
- package/lib/deploy/features/appsail/index.js +246 -0
- package/lib/deploy/features/appsail/utils.js +91 -0
- package/lib/deploy/features/functions/index.js +12 -10
- package/lib/deploy/features/index.js +3 -0
- package/lib/deploy/index.js +3 -3
- package/lib/endpoints/index.js +22 -1
- package/lib/endpoints/lib/appsail.js +98 -0
- package/lib/endpoints/lib/code-deck.js +71 -0
- package/lib/endpoints/lib/common.js +8 -5
- package/lib/endpoints/lib/git-hub.js +148 -0
- package/lib/endpoints/lib/iac.js +15 -0
- package/lib/endpoints/lib/sdk.js +4 -1
- package/lib/execute-script.js +35 -27
- package/lib/fn-utils/lib/browserLogic.js +17 -20
- package/lib/fn-utils/lib/common.js +3 -4
- package/lib/fn-utils/lib/integ.js +6 -4
- package/lib/fn-utils/lib/java.js +7 -1
- package/lib/fn-watcher.js +3 -0
- package/lib/iac/status/deploy.js +26 -4
- package/lib/iac/status/util/index.js +3 -0
- package/lib/init/dependencies/python/ensure-python.js +2 -2
- package/lib/init/dependencies/python/pip-install.js +4 -4
- package/lib/init/features/appsail/index.js +213 -0
- package/lib/init/features/functions/index.js +5 -72
- package/lib/init/features/functions/languages/java.js +7 -3
- package/lib/init/features/functions/languages/node.js +9 -7
- package/lib/init/features/functions/languages/python.js +1 -1
- package/lib/init/features/index.js +28 -12
- package/lib/init/features/project.js +3 -3
- package/lib/init/index.js +1 -1
- package/lib/init/util/common.js +103 -0
- package/lib/internal/api.js +5 -5
- package/lib/internal/command.js +26 -3
- package/lib/option-filter.js +40 -21
- package/lib/prompt/index.js +5 -0
- package/lib/prompt/types/file-path.js +4 -1
- package/lib/prompt/types/tree.js +297 -0
- package/lib/pull/features/functions/index.js +70 -47
- package/lib/serve/features/appsail.js +37 -0
- package/lib/serve/features/index.js +8 -1
- package/lib/serve/index.js +23 -6
- package/lib/serve/server/index.js +111 -233
- package/lib/serve/server/lib/appsail/index.js +134 -0
- package/lib/serve/server/lib/appsail/start.js +75 -0
- package/lib/serve/server/lib/java/index.js +54 -0
- package/lib/serve/server/lib/master.js +84 -60
- package/lib/serve/server/lib/node/index.js +85 -74
- package/lib/serve/server/lib/node/server/index.js +77 -0
- package/lib/serve/server/lib/python/index.js +46 -0
- package/lib/serve/server/lib/web_client/index.js +33 -0
- package/lib/serve/server/lib/web_client/server.js +3 -0
- package/lib/shell/dependencies/http-functions.js +7 -7
- package/lib/shell/dependencies/local-function.js +6 -6
- package/lib/shell/prepare/index.js +1 -1
- package/lib/shell/prepare/languages/index.js +3 -3
- package/lib/shell/prepare/languages/java.js +2 -2
- package/lib/util_modules/config/index.js +3 -1
- package/lib/util_modules/config/lib/appSail.js +89 -0
- package/lib/util_modules/constants/index.js +3 -1
- package/lib/util_modules/constants/lib/default.js +4 -2
- package/lib/util_modules/constants/lib/file-names.js +4 -1
- package/lib/util_modules/constants/lib/runtime.js +12 -3
- package/lib/util_modules/constants/lib/scopes.js +4 -0
- package/lib/util_modules/constants/lib/template.js +23 -20
- package/lib/util_modules/constants/lib/urls.js +5 -0
- package/lib/util_modules/context-help.js +3 -0
- package/lib/util_modules/fs/lib/async.js +10 -3
- package/lib/util_modules/fs/lib/sync.js +2 -2
- package/lib/util_modules/js.js +4 -0
- package/lib/util_modules/project.js +2 -2
- package/lib/util_modules/server.js +2 -1
- package/package.json +1 -1
- package/scripts/postInstall.js +27 -18
- package/templates/init/functions/java/browserLogic/playwright/sample.java +1 -1
- package/templates/init/functions/java/browserLogic/selenium/sample.java +1 -1
- package/templates/init/functions/node/browserlogic/playwright/sample.js +1 -1
- package/templates/init/functions/node/browserlogic/puppeteer/sample.js +1 -1
- package/templates/init/functions/node/browserlogic/selenium/sample.js +1 -1
- package/templates/init/functions/node/integ/cliq/package.json +1 -0
- package/templates/init/functions/python/aio/requirements.txt +1 -1
- package/templates/init/functions/python/bio/requirements.txt +1 -1
- package/templates/init/functions/python/cron/requirements.txt +1 -1
- package/templates/init/functions/python/event/requirements.txt +1 -1
- package/templates/init/functions/python/integ/cliq/requirements.txt +1 -1
- /package/lib/serve/server/lib/java/{JavaaioServer.java → aio_server/JavaaioServer.java} +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/catalyst-cli-java-runtime-1.0.0.jar +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/catalyst-function-sdk-1.0.0.jar +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/catalyst-java-runtime-1.0.0.jar +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/gradle-wrapper.jar +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/jetty-http-9.3.24.v20180605.jar +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/jetty-io-9.3.24.v20180605.jar +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/jetty-security-9.3.24.v20180605.jar +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/jetty-server-9.3.24.v20180605.jar +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/jetty-servlet-9.3.24.v20180605.jar +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/jetty-util-9.3.24.v20180605.jar +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/org.json.jar +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/servlet-api-3.1.jar +0 -0
- /package/lib/serve/server/lib/java/{lib → aio_server/lib}/zip4j-2.5.0.jar +0 -0
- /package/lib/serve/server/lib/node/{browserlogic → server/browserlogic}/browserlogic-playwright.js +0 -0
- /package/lib/serve/server/lib/node/{browserlogic → server/browserlogic}/browserlogic-puppeteer.js +0 -0
- /package/lib/serve/server/lib/node/{browserlogic → server/browserlogic}/browserlogic-selenium.js +0 -0
- /package/lib/serve/server/lib/node/{browserlogic → server/browserlogic}/index.js +0 -0
- /package/lib/serve/server/lib/node/{browserlogic → server/browserlogic}/utils/deferred_promise.js +0 -0
- /package/lib/serve/server/lib/node/{browserlogic → server/browserlogic}/utils/playwright-handler.js +0 -0
- /package/lib/serve/server/lib/node/{browserlogic → server/browserlogic}/utils/puppeteer-handler.js +0 -0
- /package/lib/serve/server/lib/node/{browserlogic → server/browserlogic}/utils/selenium-handler.js +0 -0
- /package/lib/serve/server/lib/node/{package.json → server/package.json} +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
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.validateAppSail = exports.filterTargets = void 0;
|
|
7
|
+
const ansi_colors_1 = require("ansi-colors");
|
|
8
|
+
const error_1 = __importDefault(require("./error"));
|
|
9
|
+
const constants_1 = require("./util_modules/constants");
|
|
10
|
+
const logger_1 = require("./util_modules/logger");
|
|
11
|
+
const option_1 = require("./util_modules/option");
|
|
12
|
+
function getAppSailFilters(targetStr) {
|
|
13
|
+
return targetStr.split(',').reduce((filterArr, target) => {
|
|
14
|
+
const opts = target.split(':');
|
|
15
|
+
if (opts[0] === 'appsail' && opts[1]) {
|
|
16
|
+
filterArr.push(opts[1]);
|
|
17
|
+
return filterArr;
|
|
18
|
+
}
|
|
19
|
+
return filterArr;
|
|
20
|
+
}, []);
|
|
21
|
+
}
|
|
22
|
+
function filterTargets(allTargets) {
|
|
23
|
+
const only = (0, option_1.getOptionValue)('only');
|
|
24
|
+
if (only !== undefined) {
|
|
25
|
+
const onlyTargs = getAppSailFilters(only);
|
|
26
|
+
if (onlyTargs.length === 0) {
|
|
27
|
+
return allTargets;
|
|
28
|
+
}
|
|
29
|
+
const refined = onlyTargs.reduce((filtered, filter) => {
|
|
30
|
+
const targDetailsIdx = allTargets.findIndex((targ) => { var _a; return ((_a = targ.appSail) === null || _a === void 0 ? void 0 : _a.name) === filter; });
|
|
31
|
+
if (targDetailsIdx === -1) {
|
|
32
|
+
filtered.unmatched.push(filter);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
const targDetails = allTargets.splice(targDetailsIdx, 1);
|
|
36
|
+
filtered.matched.push(targDetails[0]);
|
|
37
|
+
}
|
|
38
|
+
return filtered;
|
|
39
|
+
}, {
|
|
40
|
+
matched: [],
|
|
41
|
+
unmatched: []
|
|
42
|
+
});
|
|
43
|
+
if (refined.unmatched.length > 0) {
|
|
44
|
+
throw new error_1.default(`The filters ${(0, ansi_colors_1.bold)(refined.unmatched.join(', '))} provided with --only option does not match with any AppSail service in ${constants_1.FILENAME.config}.`);
|
|
45
|
+
}
|
|
46
|
+
return refined.matched;
|
|
47
|
+
}
|
|
48
|
+
const except = (0, option_1.getOptionValue)('except');
|
|
49
|
+
if (except !== undefined) {
|
|
50
|
+
const exceptTargs = getAppSailFilters(except);
|
|
51
|
+
const refined = exceptTargs.reduce((filtered, filter) => {
|
|
52
|
+
const targDetailsIdx = allTargets.findIndex((targ) => { var _a; return ((_a = targ.appSail) === null || _a === void 0 ? void 0 : _a.name) === filter; });
|
|
53
|
+
if (targDetailsIdx === -1) {
|
|
54
|
+
filtered.unmatched.push(filter);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
filtered.matched.splice(targDetailsIdx, 1);
|
|
58
|
+
}
|
|
59
|
+
return filtered;
|
|
60
|
+
}, {
|
|
61
|
+
matched: allTargets,
|
|
62
|
+
unmatched: []
|
|
63
|
+
});
|
|
64
|
+
if (refined.unmatched.length > 0) {
|
|
65
|
+
(0, logger_1.message)(`The filters ${(0, ansi_colors_1.bold)(refined.unmatched.join(', '))} provided with --except option does not match with any AppSail service in ${constants_1.FILENAME.config}, hence ignored.`);
|
|
66
|
+
}
|
|
67
|
+
return refined.matched;
|
|
68
|
+
}
|
|
69
|
+
return allTargets;
|
|
70
|
+
}
|
|
71
|
+
exports.filterTargets = filterTargets;
|
|
72
|
+
function validateAppSail(targDetails) {
|
|
73
|
+
targDetails.forEach((targ) => {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
if (targ.validity.valid && ((_a = targ.appSail) === null || _a === void 0 ? void 0 : _a.platform) !== 'war' && !((_b = targ.appSail) === null || _b === void 0 ? void 0 : _b.command)) {
|
|
76
|
+
targ.validity = {
|
|
77
|
+
valid: false,
|
|
78
|
+
reason: 'Start-up command missing'
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return targDetails;
|
|
83
|
+
}
|
|
84
|
+
exports.validateAppSail = validateAppSail;
|
package/lib/archiver.js
CHANGED
|
@@ -40,6 +40,7 @@ const path_1 = require("path");
|
|
|
40
40
|
const error_1 = __importDefault(require("./error"));
|
|
41
41
|
const fs_1 = require("./util_modules/fs");
|
|
42
42
|
const js_1 = require("./util_modules/js");
|
|
43
|
+
const logger_1 = require("./util_modules/logger");
|
|
43
44
|
class Archiver {
|
|
44
45
|
constructor(name = 'Archive') {
|
|
45
46
|
this.name = name;
|
|
@@ -81,12 +82,28 @@ class Archiver {
|
|
|
81
82
|
}
|
|
82
83
|
});
|
|
83
84
|
}
|
|
85
|
+
getFileMode(file) {
|
|
86
|
+
const permission = file.unixPermissions;
|
|
87
|
+
if (permission === null) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (typeof permission === 'number') {
|
|
91
|
+
return permission;
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
return Number.parseInt(permission);
|
|
95
|
+
}
|
|
96
|
+
catch (er) {
|
|
97
|
+
(0, logger_1.debug)('Zip file mode error: ', er);
|
|
98
|
+
}
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
84
101
|
_writeFile(file, to) {
|
|
85
102
|
return __awaiter(this, void 0, void 0, function* () {
|
|
86
103
|
return new Promise((resolve) => {
|
|
87
104
|
const fileName = (0, path_1.basename)(file.name);
|
|
88
105
|
file.nodeStream()
|
|
89
|
-
.pipe(fs_1.SYNC.getWriteStream((0, path_1.join)(to, fileName)))
|
|
106
|
+
.pipe(fs_1.SYNC.getWriteStream((0, path_1.join)(to, fileName), this.getFileMode(file)))
|
|
90
107
|
.on('close', resolve);
|
|
91
108
|
});
|
|
92
109
|
});
|
package/lib/code-deck.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CodeDeckToken = exports.getDeckFromGit = exports.getTemplateFile = exports.listenDeploy = void 0;
|
|
16
|
+
const archiver_1 = __importDefault(require("./archiver"));
|
|
17
|
+
const endpoints_1 = require("./endpoints");
|
|
18
|
+
const error_1 = __importDefault(require("./error"));
|
|
19
|
+
const prompt_1 = __importDefault(require("./prompt"));
|
|
20
|
+
const tree_1 = require("./prompt/types/tree");
|
|
21
|
+
const runtime_store_1 = __importDefault(require("./runtime-store"));
|
|
22
|
+
const logger_1 = require("./util_modules/logger");
|
|
23
|
+
const shell_1 = require("./util_modules/shell");
|
|
24
|
+
function listenDeploy(id, gitUrl) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
try {
|
|
27
|
+
const allGlobalOpts = runtime_store_1.default.get('opts.globalOpts', {});
|
|
28
|
+
const optsArr = Object.keys(allGlobalOpts).reduce((arr, key) => {
|
|
29
|
+
arr.push('--' + key);
|
|
30
|
+
if (allGlobalOpts[key]) {
|
|
31
|
+
arr.push(allGlobalOpts[key]);
|
|
32
|
+
}
|
|
33
|
+
return arr;
|
|
34
|
+
}, ['--id', id]);
|
|
35
|
+
const childRes = yield (0, shell_1.spawn)('catalyst', ['iac:status', 'import', ...optsArr], {
|
|
36
|
+
shell: true,
|
|
37
|
+
stdio: ['inherit', 'inherit', 'inherit', 'ipc'],
|
|
38
|
+
env: { PARENT_COMMAND: 'codedeck', GIT_URL: gitUrl }
|
|
39
|
+
})
|
|
40
|
+
.ASYNC()
|
|
41
|
+
.catch((err) => (0, logger_1.debug)(err));
|
|
42
|
+
return (childRes === null || childRes === void 0 ? void 0 : childRes.message) === 'success';
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
exports.listenDeploy = listenDeploy;
|
|
50
|
+
function getTemplateFile(deckZip) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
try {
|
|
53
|
+
const archiver = new archiver_1.default();
|
|
54
|
+
archiver.load(deckZip);
|
|
55
|
+
return archiver.readFile(/project-template-[\.0-9]+\.json/);
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
throw new error_1.default('Invalid ZIP file', { exit: 1, original: err });
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
exports.getTemplateFile = getTemplateFile;
|
|
63
|
+
function getDeckFromGit() {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const deckAPI = yield (0, endpoints_1.codeDeck)();
|
|
66
|
+
const deckJson = yield deckAPI.data();
|
|
67
|
+
const transformedDeck = Object.values(deckJson).reduce((deck, rawDeck) => {
|
|
68
|
+
const deckCategory = deck[rawDeck.category];
|
|
69
|
+
if (deckCategory === undefined) {
|
|
70
|
+
deck[rawDeck.category] = [
|
|
71
|
+
{
|
|
72
|
+
display: rawDeck.title,
|
|
73
|
+
value: rawDeck,
|
|
74
|
+
short: rawDeck.title,
|
|
75
|
+
expand: 'Description: ' + rawDeck.description.short
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
deck[rawDeck.category].push({
|
|
81
|
+
display: rawDeck.title,
|
|
82
|
+
value: rawDeck,
|
|
83
|
+
short: rawDeck.title,
|
|
84
|
+
expand: 'Description: ' + rawDeck.description.short
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return deck;
|
|
88
|
+
}, {});
|
|
89
|
+
const choices = Object.entries(transformedDeck).map(([category, deck]) => {
|
|
90
|
+
const treeNode = new tree_1.TreeNode('Category: ' + category);
|
|
91
|
+
deck.forEach((de) => treeNode.addNode(de));
|
|
92
|
+
return treeNode;
|
|
93
|
+
});
|
|
94
|
+
yield prompt_1.default.register('tree');
|
|
95
|
+
const deck = yield prompt_1.default.ask(prompt_1.default.question('code', 'Select the code library that you want to install', {
|
|
96
|
+
type: 'tree',
|
|
97
|
+
treeChoices: choices
|
|
98
|
+
}));
|
|
99
|
+
return deck.code;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
exports.getDeckFromGit = getDeckFromGit;
|
|
103
|
+
class CodeDeckToken {
|
|
104
|
+
static createToken(importId, gitUrl) {
|
|
105
|
+
const tokenObj = [importId, gitUrl];
|
|
106
|
+
const tokenString = JSON.stringify(tokenObj);
|
|
107
|
+
return Buffer.from(tokenString).toString('base64');
|
|
108
|
+
}
|
|
109
|
+
static getDetailsFromToken(token) {
|
|
110
|
+
const decodedString = Buffer.from(token, 'base64').toString();
|
|
111
|
+
return JSON.parse(decodedString);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.CodeDeckToken = CodeDeckToken;
|
package/lib/command_needs/rc.js
CHANGED
|
@@ -27,13 +27,13 @@ const project_2 = require("../util_modules/project");
|
|
|
27
27
|
exports.default = ({ optional = false, resolveOnNotFound = false, skipOrgCheck = true } = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
28
|
const orgOpt = (0, option_1.getGlobalOptionValue)('org', null);
|
|
29
29
|
const projectOpt = (0, option_1.getGlobalOptionValue)('project', null);
|
|
30
|
-
if (projectOpt
|
|
30
|
+
if (projectOpt !== null && orgOpt === null) {
|
|
31
31
|
throw new error_1.default('Org option is needed when project option is supplied', {
|
|
32
32
|
exit: 2
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
const orgApi = yield (0, endpoints_1.orgAPI)();
|
|
36
|
-
if (orgOpt
|
|
36
|
+
if (orgOpt !== null) {
|
|
37
37
|
const orgList = yield orgApi.getAllOrgs();
|
|
38
38
|
const found = orgList.find((org) => org.id + '' === orgOpt);
|
|
39
39
|
if (!found) {
|
|
@@ -43,8 +43,8 @@ exports.default = ({ optional = false, resolveOnNotFound = false, skipOrgCheck =
|
|
|
43
43
|
}
|
|
44
44
|
runtime_store_1.default.set('project.env.id', orgOpt + '');
|
|
45
45
|
}
|
|
46
|
-
let projectApi = orgOpt
|
|
47
|
-
let envApi = orgOpt
|
|
46
|
+
let projectApi = orgOpt !== null ? yield (0, endpoints_1.projectAPI)({ auth: true, org: orgOpt }) : yield (0, endpoints_1.projectAPI)();
|
|
47
|
+
let envApi = orgOpt !== null ? yield (0, endpoints_1.envAPI)({ auth: true, org: orgOpt }) : yield (0, endpoints_1.envAPI)();
|
|
48
48
|
const convertProjectToProperties = (project) => {
|
|
49
49
|
project = (0, project_2.transformProject)(project);
|
|
50
50
|
runtime_store_1.default.set('project.name', project.name);
|
|
@@ -112,7 +112,7 @@ exports.default = ({ optional = false, resolveOnNotFound = false, skipOrgCheck =
|
|
|
112
112
|
});
|
|
113
113
|
runtime_store_1.default.set('rc', rcInstance);
|
|
114
114
|
if (!rcInstance.loaded) {
|
|
115
|
-
if (!ignoreRC && orgOpt
|
|
115
|
+
if (!ignoreRC && orgOpt === null && !skipOrgCheck) {
|
|
116
116
|
(0, logger_1.warning)('Not in Catalyst app directory!!!');
|
|
117
117
|
const orgList = yield orgApi.getAllOrgs();
|
|
118
118
|
if (orgList.length === 0) {
|
|
@@ -238,7 +238,8 @@ exports.default = ({ optional = false, resolveOnNotFound = false, skipOrgCheck =
|
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
if (defaultRCProject.id + '' !== finalProjectObj.id + '' &&
|
|
241
|
-
(0, option_1.getCurrentCommand)() !== 'project:reset'
|
|
241
|
+
(0, option_1.getCurrentCommand)() !== 'project:reset' &&
|
|
242
|
+
!process.env.CATALYST_SUB_PROCESS) {
|
|
242
243
|
(0, logger_1.message)('Using project other than the default project for this folder. Use ' +
|
|
243
244
|
(0, ansi_colors_1.bold)('catalyst project:reset') +
|
|
244
245
|
' in order to reset.');
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
const ansi_colors_1 = require("ansi-colors");
|
|
39
|
+
const command_1 = __importDefault(require("../../internal/command"));
|
|
40
|
+
const runtime_store_1 = __importDefault(require("../../runtime-store"));
|
|
41
|
+
const constants_1 = require("../../util_modules/constants");
|
|
42
|
+
const logger_1 = require("../../util_modules/logger");
|
|
43
|
+
exports.default = new command_1.default('appsail:add')
|
|
44
|
+
.description('Link an already existing AppSail service to Catalyst Project')
|
|
45
|
+
.needs('auth', [constants_1.SCOPE.functions])
|
|
46
|
+
.needs('config')
|
|
47
|
+
.needs('rc')
|
|
48
|
+
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
+
const config = runtime_store_1.default.get('config');
|
|
50
|
+
yield (yield Promise.resolve().then(() => __importStar(require('../../init/features')))).appsail();
|
|
51
|
+
yield config.save();
|
|
52
|
+
(0, logger_1.message)((0, ansi_colors_1.bold)(constants_1.FILENAME.config) + ' file has been successfully updated with functions details.');
|
|
53
|
+
(0, logger_1.info)();
|
|
54
|
+
(0, logger_1.success)('AppSail service successfully linked');
|
|
55
|
+
}));
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const ansi_colors_1 = require("ansi-colors");
|
|
16
|
+
const endpoints_1 = require("../../endpoints");
|
|
17
|
+
const iac_1 = __importDefault(require("../../endpoints/lib/iac"));
|
|
18
|
+
const command_1 = __importDefault(require("../../internal/command"));
|
|
19
|
+
const prompt_1 = __importDefault(require("../../prompt"));
|
|
20
|
+
const runtime_store_1 = __importDefault(require("../../runtime-store"));
|
|
21
|
+
const constants_1 = require("../../util_modules/constants");
|
|
22
|
+
const env_1 = require("../../util_modules/env");
|
|
23
|
+
const fs_1 = require("../../util_modules/fs");
|
|
24
|
+
const logger_1 = require("../../util_modules/logger");
|
|
25
|
+
const project_1 = require("../../util_modules/project");
|
|
26
|
+
const functions_1 = __importDefault(require("../../pull/features/functions"));
|
|
27
|
+
const features_1 = require("../../init/features");
|
|
28
|
+
const error_1 = __importDefault(require("../../error"));
|
|
29
|
+
const code_deck_1 = require("../../code-deck");
|
|
30
|
+
const option_1 = require("../../util_modules/option");
|
|
31
|
+
exports.default = new command_1.default('codelib:install [git-url]')
|
|
32
|
+
.description('Install the code library functionalities into your project')
|
|
33
|
+
.option('-c, --continue <install-id>', 'Continue CodeLib install')
|
|
34
|
+
.needs('auth', [constants_1.SCOPE.project_import_create])
|
|
35
|
+
.needs('config')
|
|
36
|
+
.needs('rc')
|
|
37
|
+
.action((gitUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
var _a;
|
|
39
|
+
const continueOpt = (0, option_1.getOptionValue)('continue', false);
|
|
40
|
+
let [_importId, _gitUrl] = ['', ''];
|
|
41
|
+
if (continueOpt) {
|
|
42
|
+
if (gitUrl) {
|
|
43
|
+
throw new error_1.default('Cannot specify [git-url] when using --continue option');
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
[_importId, _gitUrl] = code_deck_1.CodeDeckToken.getDetailsFromToken(continueOpt);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
throw new error_1.default('Invalid token', { original: err });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const _gitHubAPI = yield (0, endpoints_1.gitHubAPI)();
|
|
53
|
+
gitUrl = gitUrl || _gitUrl;
|
|
54
|
+
if (gitUrl) {
|
|
55
|
+
const headRes = yield _gitHubAPI.validateUrl(gitUrl);
|
|
56
|
+
if (headRes !== 200) {
|
|
57
|
+
(0, logger_1.error)('Invalid GitHub URL: ' + ansi_colors_1.italic.red(`"${gitUrl}"`));
|
|
58
|
+
const listAns = yield prompt_1.default.ask(prompt_1.default.question('list', 'Do you wish to select from a list of available Code Library installations from GitHub?', { type: 'confirm', defaultAns: true }));
|
|
59
|
+
if (!listAns.list) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
gitUrl = undefined;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const code = gitUrl
|
|
66
|
+
? { github: { url: gitUrl } }
|
|
67
|
+
: yield (0, code_deck_1.getDeckFromGit)();
|
|
68
|
+
(0, logger_1.info)();
|
|
69
|
+
!continueOpt && (0, logger_1.info)((0, ansi_colors_1.white)('==> ') + 'Downloading CodeLib');
|
|
70
|
+
let deckZip = yield _gitHubAPI.download(code.github.url, continueOpt ? null : code.title);
|
|
71
|
+
if (!deckZip) {
|
|
72
|
+
if (!gitUrl) {
|
|
73
|
+
throw new error_1.default('Invalid code lib', { exit: 2 });
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const templateFile = yield (0, code_deck_1.getTemplateFile)(deckZip);
|
|
78
|
+
const templateJson = JSON.parse(templateFile || '');
|
|
79
|
+
const tmpFile = yield fs_1.ASYNC.tempFile('deck.zip', deckZip);
|
|
80
|
+
deckZip = undefined;
|
|
81
|
+
const templateComponents = Object.entries(templateJson.components).reduce((compRed, _comp) => {
|
|
82
|
+
const [key, comp] = _comp;
|
|
83
|
+
compRed[key] = (comp || [])
|
|
84
|
+
.map((item) => {
|
|
85
|
+
switch (key) {
|
|
86
|
+
case 'Functions': {
|
|
87
|
+
const props = item.properties;
|
|
88
|
+
return `* ${item.name} (${props.stack}) (${props.type === 'applogic' ? 'advancedio' : props.type})`;
|
|
89
|
+
}
|
|
90
|
+
case 'Filestore': {
|
|
91
|
+
if (item.type === 'folder') {
|
|
92
|
+
return `* ${item.name} (${item.type})`;
|
|
93
|
+
}
|
|
94
|
+
return '';
|
|
95
|
+
}
|
|
96
|
+
default: {
|
|
97
|
+
return '* ' + item.name;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
.filter((item) => item)
|
|
102
|
+
.join('\n\t\t');
|
|
103
|
+
return compRed;
|
|
104
|
+
}, {});
|
|
105
|
+
if (!continueOpt) {
|
|
106
|
+
(0, logger_1.info)();
|
|
107
|
+
(0, logger_1.info)(`The following components will be installed with ${code.title ? (0, ansi_colors_1.bold)(code.title) : 'this'} CodeLib`);
|
|
108
|
+
(0, logger_1.info)();
|
|
109
|
+
(0, logger_1.info)(Object.entries(templateComponents)
|
|
110
|
+
.map(([name, comp]) => (0, ansi_colors_1.bold)('\t' + name + ':') + '\n' + (0, ansi_colors_1.yellow)('\t\t' + comp))
|
|
111
|
+
.join('\n'));
|
|
112
|
+
(0, logger_1.info)();
|
|
113
|
+
const install = yield prompt_1.default.ask(prompt_1.default.question('consent', 'Do you wish to continue? ', {
|
|
114
|
+
type: 'confirm',
|
|
115
|
+
default: true
|
|
116
|
+
}));
|
|
117
|
+
if (!install.consent) {
|
|
118
|
+
(0, logger_1.message)('Aborted by user');
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const projectId = (0, project_1.getProjectId)();
|
|
122
|
+
const iacAPI = new iac_1.default(projectId);
|
|
123
|
+
const schedulerRes = yield iacAPI.update(fs_1.SYNC.getReadStream(tmpFile));
|
|
124
|
+
_importId = schedulerRes.id;
|
|
125
|
+
}
|
|
126
|
+
if (!env_1.isPrimaryShell || !_importId) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
(0, logger_1.info)();
|
|
130
|
+
(0, logger_1.info)((0, ansi_colors_1.white)('==> ') + 'Installing CodeLib');
|
|
131
|
+
const importRes = yield (0, code_deck_1.listenDeploy)(_importId, code.github.url);
|
|
132
|
+
if (!importRes) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const templateFns = (((_a = templateJson.components) === null || _a === void 0 ? void 0 : _a.Functions) || []);
|
|
136
|
+
if (templateFns.length > 0) {
|
|
137
|
+
yield (0, functions_1.default)(templateFns.map((fn) => fn.name));
|
|
138
|
+
(0, features_1.setCatalystConfig)('functions', true);
|
|
139
|
+
const config = runtime_store_1.default.get('config');
|
|
140
|
+
yield config.save();
|
|
141
|
+
}
|
|
142
|
+
(0, logger_1.success)('CodeLib successfully installed');
|
|
143
|
+
}));
|
|
@@ -20,7 +20,7 @@ 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
22
|
const args = details.split('=');
|
|
23
|
-
if (args.length
|
|
23
|
+
if (args.length !== 2) {
|
|
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
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
const utils_1 = require("../../deploy/features/appsail/utils");
|
|
39
|
+
const command_1 = __importDefault(require("../../internal/command"));
|
|
40
|
+
const constants_1 = require("../../util_modules/constants");
|
|
41
|
+
const logger_1 = require("../../util_modules/logger");
|
|
42
|
+
exports.default = new command_1.default('appsail')
|
|
43
|
+
.description('Deploy your Catalyst AppSail service to Catalyst Development environment')
|
|
44
|
+
.option('--name <name>', 'Please specify a name for your AppSail')
|
|
45
|
+
.option('--build-path <path>', 'Specify the AppSail build path')
|
|
46
|
+
.option('--stack <stack>', 'Specify the AppSail stack')
|
|
47
|
+
.option('--platform <javase|war>', 'Specify the AppSail platform for java stack')
|
|
48
|
+
.option('--command <command>', 'Specify the AppSail startup command')
|
|
49
|
+
.needs('auth', [constants_1.SCOPE.appsail_update])
|
|
50
|
+
.needs('config', { optional: true })
|
|
51
|
+
.needs('rc', { optional: true })
|
|
52
|
+
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
+
yield (yield Promise.resolve().then(() => __importStar(require('../../deploy')))).default('appsail');
|
|
54
|
+
const deployTargets = (0, utils_1.urlLogger)();
|
|
55
|
+
(0, logger_1.info)();
|
|
56
|
+
if (deployTargets.length === 0) {
|
|
57
|
+
(0, logger_1.error)('AppSail Deploy failed');
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
(0, logger_1.success)('Catalyst AppSail Deploy completed successfully');
|
|
61
|
+
}
|
|
62
|
+
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -35,24 +35,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
38
|
+
const utils_1 = require("../../deploy/features/appsail/utils");
|
|
39
|
+
const command_1 = __importDefault(require("../../internal/command"));
|
|
40
|
+
const runtime_store_1 = __importDefault(require("../../runtime-store"));
|
|
41
|
+
const constants_1 = require("../../util_modules/constants");
|
|
42
|
+
const logger_1 = require("../../util_modules/logger");
|
|
43
|
+
const appsail_1 = __importDefault(require("./appsail"));
|
|
42
44
|
exports.default = new command_1.default('deploy')
|
|
43
|
-
.description('Deploy the Catalyst project and project resources to the
|
|
44
|
-
.option('--only <targets>', 'only deploy specified, comma-separated targets (e.g. "functions,client").' +
|
|
45
|
-
' For
|
|
46
|
-
' (e.g. "--only functions:<function_name>,
|
|
45
|
+
.description('Deploy the Catalyst project and project resources to the Catalyst development environment from the local directory')
|
|
46
|
+
.option('--only <targets>', 'only deploy specified, comma-separated targets (e.g. "functions,client,appsail").' +
|
|
47
|
+
' For Function and Appsail you can specify which functions to deploy with colon notation' +
|
|
48
|
+
' (e.g. "--only functions:<function_name>,appsail:<appsail_name>"). ')
|
|
47
49
|
.option('--except <targets>', 'deploy all targets except specified (e.g. "client")')
|
|
48
|
-
.option('--ignore-scripts', 'ignore the pre and post
|
|
49
|
-
.needs('auth', [constants_1.SCOPE.functions, constants_1.SCOPE.webapp])
|
|
50
|
+
.option('--ignore-scripts', 'ignore the pre and post lifecycle scripts')
|
|
51
|
+
.needs('auth', [constants_1.SCOPE.functions, constants_1.SCOPE.webapp, constants_1.SCOPE.appsail_update])
|
|
50
52
|
.needs('config')
|
|
51
|
-
.needs('rc')
|
|
53
|
+
.needs('rc', { optional: true })
|
|
54
|
+
.addSubCommand(appsail_1.default)
|
|
52
55
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
-
const optionFilter = yield Promise.resolve().then(() => __importStar(require('
|
|
56
|
+
const optionFilter = yield Promise.resolve().then(() => __importStar(require('../../option-filter')));
|
|
54
57
|
optionFilter.filterTargets();
|
|
55
|
-
yield (yield Promise.resolve().then(() => __importStar(require('
|
|
58
|
+
yield (yield Promise.resolve().then(() => __importStar(require('../../deploy')))).default();
|
|
56
59
|
const deployTargets = runtime_store_1.default
|
|
57
60
|
.get('payload.targets', [])
|
|
58
61
|
.filter((deploytarget) => {
|
|
@@ -86,6 +89,9 @@ exports.default = new command_1.default('deploy')
|
|
|
86
89
|
});
|
|
87
90
|
(0, logger_1.info)();
|
|
88
91
|
break;
|
|
92
|
+
case 'appsail':
|
|
93
|
+
(0, utils_1.urlLogger)();
|
|
94
|
+
break;
|
|
89
95
|
}
|
|
90
96
|
});
|
|
91
97
|
if (deployTargets.length > 0) {
|
package/lib/commands/iac/pack.js
CHANGED
|
@@ -94,13 +94,13 @@ exports.default = new command_1.default('iac:pack [zip_name]')
|
|
|
94
94
|
throw new error_1.default(`No property found for function ${fn.name} in project template`, { exit: 1 });
|
|
95
95
|
}
|
|
96
96
|
fnNameByCodePath[fn.name] = fnTemplateConfig.properties.code.path;
|
|
97
|
-
if ((_a = fn.stack) === null || _a === void 0 ? void 0 : _a.startsWith(runtime_1.default.language.
|
|
97
|
+
if ((_a = fn.stack) === null || _a === void 0 ? void 0 : _a.startsWith(runtime_1.default.language.node.value)) {
|
|
98
98
|
acc[0].push(fn);
|
|
99
99
|
}
|
|
100
|
-
if ((_b = fn.stack) === null || _b === void 0 ? void 0 : _b.startsWith(runtime_1.default.language.java)) {
|
|
100
|
+
if ((_b = fn.stack) === null || _b === void 0 ? void 0 : _b.startsWith(runtime_1.default.language.java.value)) {
|
|
101
101
|
acc[1].push(fn);
|
|
102
102
|
}
|
|
103
|
-
if ((_c = fn.stack) === null || _c === void 0 ? void 0 : _c.startsWith(runtime_1.default.language.python)) {
|
|
103
|
+
if ((_c = fn.stack) === null || _c === void 0 ? void 0 : _c.startsWith(runtime_1.default.language.python.value)) {
|
|
104
104
|
acc[2].push(fn);
|
|
105
105
|
}
|
|
106
106
|
return acc;
|
package/lib/commands/index.js
CHANGED
|
@@ -75,6 +75,8 @@ exports.default = (client) => {
|
|
|
75
75
|
loadCommand('functions:add'),
|
|
76
76
|
loadCommand('functions:shell'),
|
|
77
77
|
loadCommand('functions:config'),
|
|
78
|
+
loadCommand('appsail:add'),
|
|
79
|
+
loadCommand('codelib:install'),
|
|
78
80
|
loadCommand('event:generate'),
|
|
79
81
|
loadCommand('event:generate:integ'),
|
|
80
82
|
loadCommand('serve'),
|