zcatalyst-cli 1.17.4 → 1.17.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/command_needs/rc.toml +2 -2
- package/docs/endpoints/lib/env.toml +3 -0
- package/lib/bin/catalyst.js +1 -1
- package/lib/command_needs/rc.js +8 -8
- package/lib/commands/event/generate/index.js +2 -1
- package/lib/commands/event/generate/integ.js +2 -1
- package/lib/commands/functions/shell.js +1 -1
- package/lib/commands/index.js +2 -1
- package/lib/commands/serve.js +7 -1
- package/lib/deploy/features/appsail/index.js +4 -3
- package/lib/deploy/features/appsail/utils.js +1 -1
- package/lib/endpoints/lib/env.js +20 -2
- package/lib/init/features/appsail/index.js +2 -2
- package/lib/init/features/client/index.js +2 -1
- package/lib/internal/api.js +4 -1
- package/lib/internal/command.js +2 -1
- package/lib/migration/index.js +4 -2
- package/lib/optional-import.js +3 -2
- package/lib/prompt/types/tree.js +3 -3
- package/lib/serve/server/lib/appsail/index.js +9 -8
- package/lib/shell/prepare/languages/java.js +1 -1
- package/lib/shell/prepare/languages/node.js +3 -1
- package/lib/shell/prepare/languages/python.js +1 -0
- package/lib/util_modules/constants/lib/default.js +9 -9
- package/lib/util_modules/constants/lib/scopes.js +1 -0
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[RC-1]
|
|
2
|
-
context = '''The project(${arg[0]}) provided with the ${arg[1]} option is not available in the
|
|
3
|
-
aid = '''Please use one of the available projects with the ${arg[1]} option
|
|
2
|
+
context = '''The project(${arg[0]}) provided with the ${arg[1]} option is not available is not available in the ${arg[3]} org.'''
|
|
3
|
+
aid = '''Please use one of the available projects with the ${arg[1]} option or specify the correct org \nThe available projects in the ${arg[3]} org are: \n${arg[2]}'''
|
|
4
4
|
link = 'https://www.zoho.com/catalyst/help/cli-options.html#Project'
|
|
5
5
|
|
|
6
6
|
[RC-2]
|
package/lib/bin/catalyst.js
CHANGED
|
@@ -44,7 +44,7 @@ const errorOut_1 = __importDefault(require("../errorOut"));
|
|
|
44
44
|
(0, logger_1.debug)(js_1.JS.repeat('-', 70));
|
|
45
45
|
(0, logger_1.debug)();
|
|
46
46
|
process.on('beforeExit', (code) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
-
code = process.exitCode || code;
|
|
47
|
+
code = Number(process.exitCode) || code;
|
|
48
48
|
if (code > 0 && process.stdout.isTTY) {
|
|
49
49
|
const lastError = config_store_1.default.get('lastError', 0);
|
|
50
50
|
const timestamp = Date.now();
|
package/lib/command_needs/rc.js
CHANGED
|
@@ -34,11 +34,6 @@ exports.default = ({ optional = false, resolveOnNotFound = false, skipOrgCheck =
|
|
|
34
34
|
const projectOpt = globProjectOpt
|
|
35
35
|
? globProjectOpt
|
|
36
36
|
: (0, env_1.getEnvVariable)('CATALYST_PROJECT', null);
|
|
37
|
-
if (projectOpt !== null && orgOpt === null) {
|
|
38
|
-
throw new error_1.default('Org option is needed when project option is supplied', {
|
|
39
|
-
exit: 2
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
37
|
const orgApi = yield (0, endpoints_1.orgAPI)();
|
|
43
38
|
if (orgOpt !== null) {
|
|
44
39
|
const orgList = yield orgApi.getAllOrgs();
|
|
@@ -50,8 +45,8 @@ exports.default = ({ optional = false, resolveOnNotFound = false, skipOrgCheck =
|
|
|
50
45
|
}
|
|
51
46
|
runtime_store_1.default.set('project.env.id', orgOpt + '');
|
|
52
47
|
}
|
|
53
|
-
let projectApi =
|
|
54
|
-
let envApi =
|
|
48
|
+
let projectApi = yield (0, endpoints_1.projectAPI)();
|
|
49
|
+
let envApi = yield (0, endpoints_1.envAPI)();
|
|
55
50
|
const convertProjectToProperties = (project) => {
|
|
56
51
|
project = (0, project_2.transformProject)(project);
|
|
57
52
|
runtime_store_1.default.set('project.name', project.name);
|
|
@@ -81,6 +76,9 @@ exports.default = ({ optional = false, resolveOnNotFound = false, skipOrgCheck =
|
|
|
81
76
|
const projectArr = (yield projectApi.getAllProjects());
|
|
82
77
|
const project = js_1.JS.find(projectArr, { project_name: projectOpt });
|
|
83
78
|
if (project === undefined) {
|
|
79
|
+
const allOrgs = yield orgApi.getAllOrgs();
|
|
80
|
+
const orgId = (0, project_2.getEnvId)();
|
|
81
|
+
const orgDetails = allOrgs.find((org) => (!orgId && org.is_default) || org.name === orgId || org.id === orgId);
|
|
84
82
|
throw new error_1.default('invalid project provided with the --project option', {
|
|
85
83
|
exit: 1,
|
|
86
84
|
errorId: 'RC-1',
|
|
@@ -91,7 +89,9 @@ exports.default = ({ optional = false, resolveOnNotFound = false, skipOrgCheck =
|
|
|
91
89
|
.filter((proj) => proj.project_type &&
|
|
92
90
|
project_1.default.accepted_types.includes(proj.project_type))
|
|
93
91
|
.map((project) => '* ' + project.project_name)
|
|
94
|
-
.join('\n'))
|
|
92
|
+
.join('\n')),
|
|
93
|
+
`${orgDetails === null || orgDetails === void 0 ? void 0 : orgDetails.name}(${orgDetails === null || orgDetails === void 0 ? void 0 : orgDetails.id})` +
|
|
94
|
+
((orgDetails === null || orgDetails === void 0 ? void 0 : orgDetails.is_default) ? ' [DEFAULT]' : '')
|
|
95
95
|
]
|
|
96
96
|
});
|
|
97
97
|
}
|
|
@@ -54,6 +54,7 @@ exports.default = new command_1.default('event:generate <source> <action>')
|
|
|
54
54
|
.needs('auth')
|
|
55
55
|
.action(function generate(source, action) {
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
var _a;
|
|
57
58
|
const unknownArgs = (0, option_1.getUnknownOpts)([]);
|
|
58
59
|
if (unknownArgs.length % 2 !== 0) {
|
|
59
60
|
throw new error_1.default('Unknown options are not provided as key value pairs', {
|
|
@@ -175,7 +176,7 @@ exports.default = new command_1.default('event:generate <source> <action>')
|
|
|
175
176
|
break;
|
|
176
177
|
}
|
|
177
178
|
});
|
|
178
|
-
const sourceModule = (yield Promise.resolve().then(() => __importStar(require(
|
|
179
|
+
const sourceModule = (yield (_a = '../../../event_generate/' + source, Promise.resolve().then(() => __importStar(require(_a))))).default;
|
|
179
180
|
eventJsonContent = yield sourceModule(eventJsonContent, optionMap, action);
|
|
180
181
|
const jsonContent = JSON.parse(eventJsonContent);
|
|
181
182
|
Object.keys(jsonContent).forEach((key) => {
|
|
@@ -46,6 +46,7 @@ exports.default = new command_1.default('event:generate:integ <service>')
|
|
|
46
46
|
.needs('rc')
|
|
47
47
|
.needs('auth')
|
|
48
48
|
.action((service) => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
+
var _a;
|
|
49
50
|
const availableServices = Object.keys(constants_1.INTEG.service_map);
|
|
50
51
|
if (!availableServices.includes(service)) {
|
|
51
52
|
throw new error_1.default('Unknown service requested', {
|
|
@@ -56,7 +57,7 @@ exports.default = new command_1.default('event:generate:integ <service>')
|
|
|
56
57
|
}
|
|
57
58
|
const inputs = (0, option_1.getOptionValue)('inputs', '');
|
|
58
59
|
const serviceValue = constants_1.INTEG.service_map[service];
|
|
59
|
-
const serviceModule = (yield Promise.resolve().then(() => __importStar(require(
|
|
60
|
+
const serviceModule = (yield (_a = `../../../event_generate/integration/${serviceValue}`, Promise.resolve().then(() => __importStar(require(_a)))))
|
|
60
61
|
.default;
|
|
61
62
|
const payload = yield serviceModule(inputs);
|
|
62
63
|
process.stdout.write(payload + '\n');
|
|
@@ -50,7 +50,7 @@ exports.default = new command_1.default('functions:shell')
|
|
|
50
50
|
'\n' +
|
|
51
51
|
'(deprecated: The watch mode will be enabled by default. To disable watch mode use the --no-watch option)')
|
|
52
52
|
.option('--no-watch', 'disable watching the files for changes')
|
|
53
|
-
.needs('auth', [constants_1.SCOPE.functions, constants_1.SCOPE.functions_execution])
|
|
53
|
+
.needs('auth', [constants_1.SCOPE.functions, constants_1.SCOPE.functions_execution, constants_1.SCOPE.custom_token_generation])
|
|
54
54
|
.needs('config')
|
|
55
55
|
.needs('rc')
|
|
56
56
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
package/lib/commands/index.js
CHANGED
|
@@ -36,7 +36,8 @@ exports.default = (client) => {
|
|
|
36
36
|
function loadCommand(name) {
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
38
|
return new Promise((resolve, reject) => setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
|
|
39
|
+
var _a;
|
|
40
|
+
const cmd = (yield (_a = './' + name.split(':').join('/'), Promise.resolve().then(() => __importStar(require(_a))))).default;
|
|
40
41
|
try {
|
|
41
42
|
cmd.register(client);
|
|
42
43
|
resolve();
|
package/lib/commands/serve.js
CHANGED
|
@@ -49,7 +49,13 @@ exports.default = new command_1.default('serve')
|
|
|
49
49
|
.option('--except <targets>', 'serve all targets except specified (e.g. "client")')
|
|
50
50
|
.option('--ignore-scripts', 'ignore the pre and post lifescycle scripts')
|
|
51
51
|
.option('--no-open', 'disable opening the client automatically when served')
|
|
52
|
-
.needs('auth', [
|
|
52
|
+
.needs('auth', [
|
|
53
|
+
constants_1.SCOPE.functions,
|
|
54
|
+
constants_1.SCOPE.functions_execution,
|
|
55
|
+
constants_1.SCOPE.webapp,
|
|
56
|
+
constants_1.SCOPE.pdf_shot,
|
|
57
|
+
constants_1.SCOPE.custom_token_generation
|
|
58
|
+
])
|
|
53
59
|
.needs('config')
|
|
54
60
|
.needs('rc')
|
|
55
61
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -45,7 +45,7 @@ function getConfigJsonInputs() {
|
|
|
45
45
|
const stack = yield (0, utils_1.validateOptions)(utils_1.validateStack, 'stack', runtimeDetailsPromise);
|
|
46
46
|
const platform = yield (0, utils_1.validateOptions)(utils_1.validatePlatform, 'platform', stack);
|
|
47
47
|
const optValues = {
|
|
48
|
-
|
|
48
|
+
build_path: yield (0, utils_1.validateOptions)(utils_1.validateBuildPath, 'buildPath'),
|
|
49
49
|
stack,
|
|
50
50
|
platform,
|
|
51
51
|
command: (0, option_1.getOptionValue)('command', false)
|
|
@@ -54,7 +54,7 @@ function getConfigJsonInputs() {
|
|
|
54
54
|
yield prompt_1.default.register('file-path');
|
|
55
55
|
const appConfigAns = yield prompt_1.default.ask(prompt_1.default.question('buildPath', 'Please provide the build directory of your AppSail service', {
|
|
56
56
|
type: 'file-path',
|
|
57
|
-
when: () => optValues.
|
|
57
|
+
when: () => optValues.build_path === false,
|
|
58
58
|
rootPath: cwd,
|
|
59
59
|
validate: ({ value }) => __awaiter(this, void 0, void 0, function* () {
|
|
60
60
|
const pathRes = (0, utils_1.validateBuildPath)(value);
|
|
@@ -190,7 +190,8 @@ exports.default = (standAlone = false) => __awaiter(void 0, void 0, void 0, func
|
|
|
190
190
|
text: `Preparing AppSail[${targ.name}]`
|
|
191
191
|
});
|
|
192
192
|
const zip = new archiver_1.default();
|
|
193
|
-
const
|
|
193
|
+
const buildPath = targ.buildPath ? targ.buildPath : targ.build_path;
|
|
194
|
+
const folderPath = (0, project_1.resolveProjectPath)(buildPath);
|
|
194
195
|
const ignoreFile = yield fs_1.ASYNC.readFile((0, path_1.join)(folderPath, constants_1.FILENAME.catalyst_ignore));
|
|
195
196
|
const folderContents = yield fs_1.ASYNC.walk(folderPath, {
|
|
196
197
|
filter: {
|
|
@@ -36,7 +36,7 @@ function validateOptions(validationFn, option, ...args) {
|
|
|
36
36
|
exports.validateOptions = validateOptions;
|
|
37
37
|
function validateBuildPath(path) {
|
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
const cwd =
|
|
39
|
+
const cwd = process.cwd();
|
|
40
40
|
if (path) {
|
|
41
41
|
const buildPath = (0, path_1.isAbsolute)(path) ? path : (0, path_1.resolve)(cwd, path);
|
|
42
42
|
return (yield fs_1.ASYNC.dirExists(buildPath)) ? path : false;
|
package/lib/endpoints/lib/env.js
CHANGED
|
@@ -12,19 +12,37 @@ 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
|
+
const ansi_colors_1 = require("ansi-colors");
|
|
15
16
|
const error_1 = __importDefault(require("../../error"));
|
|
16
17
|
const api_1 = __importDefault(require("../../internal/api"));
|
|
18
|
+
const constants_1 = require("../../util_modules/constants");
|
|
17
19
|
const logger_1 = require("../../util_modules/logger");
|
|
18
20
|
class Env {
|
|
19
21
|
constructor(opts, org) {
|
|
20
22
|
this.opts = opts;
|
|
21
23
|
this.opts.envId = org;
|
|
22
24
|
}
|
|
23
|
-
getEnvs(projectId) {
|
|
25
|
+
getEnvs(projectId, throwErr = true) {
|
|
24
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
27
|
const res = yield new api_1.default(this.opts).get('/baas/v1/project/' + projectId + '/environment');
|
|
26
28
|
if (res.body && res.body.data) {
|
|
27
|
-
|
|
29
|
+
const data = res.body.data;
|
|
30
|
+
if (throwErr) {
|
|
31
|
+
const devEnv = data.find((env) => env.env_name === constants_1.DEFAULT.env_name);
|
|
32
|
+
if ((devEnv === null || devEnv === void 0 ? void 0 : devEnv.env_status) === 'Blocked') {
|
|
33
|
+
throw new error_1.default('Environment blocked', {
|
|
34
|
+
exit: 1,
|
|
35
|
+
errorId: 'ENV-1',
|
|
36
|
+
arg: [
|
|
37
|
+
(0, ansi_colors_1.bold)(constants_1.DEFAULT.env_name),
|
|
38
|
+
(0, ansi_colors_1.bold)(projectId),
|
|
39
|
+
ansi_colors_1.bold.red('blocked'),
|
|
40
|
+
ansi_colors_1.italic.underline('support@zohocatalyst.com')
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return data;
|
|
28
46
|
}
|
|
29
47
|
(0, logger_1.debug)('get environment response from server : ' + JSON.stringify(res.body));
|
|
30
48
|
throw new error_1.default('Server Error: Unexpected Response from server.', {
|
|
@@ -148,7 +148,7 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
148
148
|
const appSail = yield prompt_1.default.ask(prompt_1.default.question('buildPath', 'Please provide the build path of your AppSail service: ', {
|
|
149
149
|
type: 'file-path',
|
|
150
150
|
validate: (pth) => __awaiter(void 0, void 0, void 0, function* () {
|
|
151
|
-
const buildPath = (0, path_1.resolve)(
|
|
151
|
+
const buildPath = (0, path_1.resolve)(process.cwd(), pth.value);
|
|
152
152
|
if ((yield fs_1.ASYNC.dirExists(buildPath)) || (yield fs_1.ASYNC.fileExists(buildPath))) {
|
|
153
153
|
return true;
|
|
154
154
|
}
|
|
@@ -182,7 +182,7 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
182
182
|
const appConfig = {
|
|
183
183
|
command: _appSailConfig.command ||
|
|
184
184
|
'echo Please specify the start-up command in the app-config.json file under the key command',
|
|
185
|
-
|
|
185
|
+
build_path: _appSailConfig.build || appSail.buildPath,
|
|
186
186
|
stack: appSailStack.runtime,
|
|
187
187
|
env_variables: {},
|
|
188
188
|
memory: _appSailConfig.memory || 256,
|
|
@@ -38,6 +38,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
38
38
|
const index_js_1 = __importDefault(require("../../../prompt/index.js"));
|
|
39
39
|
const index_js_2 = require("../../../util_modules/constants/index.js");
|
|
40
40
|
exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
var _a;
|
|
41
42
|
const clientInitAnswer = yield index_js_1.default.ask(index_js_1.default.question('clientFlavour', 'Choose the type of client to initialise: ', {
|
|
42
43
|
type: 'list',
|
|
43
44
|
choices: index_js_2.PLUGIN.client.map((plugin) => {
|
|
@@ -47,5 +48,5 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
47
48
|
});
|
|
48
49
|
})
|
|
49
50
|
}));
|
|
50
|
-
return (yield Promise.resolve().then(() => __importStar(require(
|
|
51
|
+
return (yield (_a = './initializers/' + clientInitAnswer.clientFlavour, Promise.resolve().then(() => __importStar(require(_a))))).default();
|
|
51
52
|
});
|
package/lib/internal/api.js
CHANGED
|
@@ -55,7 +55,10 @@ class API {
|
|
|
55
55
|
headers
|
|
56
56
|
};
|
|
57
57
|
if (!isExternal) {
|
|
58
|
-
this.requestOpts.headers = Object.assign(Object.assign({}, this.requestOpts.headers), { Accept: 'application/vnd.catalyst.v2+json', 'X-CATALYST-Environment': env
|
|
58
|
+
this.requestOpts.headers = Object.assign(Object.assign({}, this.requestOpts.headers), { Accept: 'application/vnd.catalyst.v2+json', 'X-CATALYST-Environment': env });
|
|
59
|
+
if (envId) {
|
|
60
|
+
this.requestOpts.headers['CATALYST-ORG'] = envId;
|
|
61
|
+
}
|
|
59
62
|
}
|
|
60
63
|
this.requestOpts.headers = Object.assign(Object.assign({}, this.requestOpts.headers), { 'User-Agent': runtime_store_1.default.get('context.cli.package.name') +
|
|
61
64
|
'/' +
|
package/lib/internal/command.js
CHANGED
|
@@ -206,7 +206,8 @@ class Command {
|
|
|
206
206
|
(0, logger_1.debug)(e);
|
|
207
207
|
}
|
|
208
208
|
yield Promise.all(js_1.JS.map(this.beforeRunners, (before) => __awaiter(this, void 0, void 0, function* () {
|
|
209
|
-
|
|
209
|
+
var _a;
|
|
210
|
+
const beforeModule = (yield (_a = '../command_needs/' + before.fn, Promise.resolve().then(() => __importStar(require(_a))))).default;
|
|
210
211
|
return beforeModule.call(this, before.args);
|
|
211
212
|
})));
|
|
212
213
|
return this.cmdAction.call(this, ...args);
|
package/lib/migration/index.js
CHANGED
|
@@ -44,6 +44,7 @@ const rc_1 = __importDefault(require("../internal/rc"));
|
|
|
44
44
|
const fs_1 = require("../util_modules/fs");
|
|
45
45
|
const logger_1 = require("../util_modules/logger");
|
|
46
46
|
const runMigration = (rc, migFiles, idx = 0) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
var _a;
|
|
47
48
|
if (migFiles.length <= idx) {
|
|
48
49
|
return Promise.resolve();
|
|
49
50
|
}
|
|
@@ -54,7 +55,7 @@ const runMigration = (rc, migFiles, idx = 0) => __awaiter(void 0, void 0, void 0
|
|
|
54
55
|
return runMigration(rc, migFiles, ++idx);
|
|
55
56
|
}
|
|
56
57
|
try {
|
|
57
|
-
const migModule = yield Promise.resolve().then(() => __importStar(require(
|
|
58
|
+
const migModule = yield (_a = migFile, Promise.resolve().then(() => __importStar(require(_a))));
|
|
58
59
|
if (migModule.isRequire()) {
|
|
59
60
|
(0, logger_1.debug)('migration started for v' + currentMigFileVersion);
|
|
60
61
|
migModule.migrate();
|
|
@@ -83,6 +84,7 @@ const runMigration = (rc, migFiles, idx = 0) => __awaiter(void 0, void 0, void 0
|
|
|
83
84
|
return runMigration(rc, migFiles, ++idx);
|
|
84
85
|
});
|
|
85
86
|
const runGlobalMigration = (migFiles) => __awaiter(void 0, void 0, void 0, function* () {
|
|
87
|
+
var _b;
|
|
86
88
|
if (migFiles.length === 0) {
|
|
87
89
|
return;
|
|
88
90
|
}
|
|
@@ -96,7 +98,7 @@ const runGlobalMigration = (migFiles) => __awaiter(void 0, void 0, void 0, funct
|
|
|
96
98
|
return runGlobalMigration(migFiles);
|
|
97
99
|
}
|
|
98
100
|
try {
|
|
99
|
-
const migModule = yield Promise.resolve().then(() => __importStar(require(
|
|
101
|
+
const migModule = yield (_b = migFile, Promise.resolve().then(() => __importStar(require(_b))));
|
|
100
102
|
if (migModule.isRequire()) {
|
|
101
103
|
(0, logger_1.debug)('migration started for v' + currentMigFileVersion);
|
|
102
104
|
migModule.migrate();
|
package/lib/optional-import.js
CHANGED
|
@@ -42,6 +42,7 @@ const async_js_1 = require("./util_modules/fs/lib/async.js");
|
|
|
42
42
|
const error_js_1 = __importDefault(require("./error.js"));
|
|
43
43
|
const ansi_colors_1 = require("ansi-colors");
|
|
44
44
|
exports.default = (name, source) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
var _a, _b;
|
|
45
46
|
if (name === (0, path_1.basename)(name)) {
|
|
46
47
|
const projectModulePath = (0, project_js_1.resolveProjectPath)((0, path_1.join)(source, 'node_modules', name));
|
|
47
48
|
const projectModulePathExists = yield (0, async_js_1.dirExists)(projectModulePath);
|
|
@@ -53,7 +54,7 @@ exports.default = (name, source) => __awaiter(void 0, void 0, void 0, function*
|
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
app_module_path_1.default.addPath(projectModulePath);
|
|
56
|
-
return Promise.resolve().then(() => __importStar(require(
|
|
57
|
+
return _a = projectModulePath, Promise.resolve().then(() => __importStar(require(_a)));
|
|
57
58
|
}
|
|
58
59
|
const projectModulePath = (0, project_js_1.resolveProjectPath)(name);
|
|
59
60
|
const projectModulePathExists = yield (0, async_js_1.dirExists)(projectModulePath);
|
|
@@ -65,5 +66,5 @@ exports.default = (name, source) => __awaiter(void 0, void 0, void 0, function*
|
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
68
|
app_module_path_1.default.addPath(projectModulePath);
|
|
68
|
-
return Promise.resolve().then(() => __importStar(require(
|
|
69
|
+
return _b = projectModulePath, Promise.resolve().then(() => __importStar(require(_b)));
|
|
69
70
|
});
|
package/lib/prompt/types/tree.js
CHANGED
|
@@ -26,6 +26,9 @@ var ETreeState;
|
|
|
26
26
|
ETreeState[ETreeState["EXPANDED"] = 3] = "EXPANDED";
|
|
27
27
|
})(ETreeState || (ETreeState = {}));
|
|
28
28
|
class TreeNode {
|
|
29
|
+
get indent() {
|
|
30
|
+
return this.level * 2;
|
|
31
|
+
}
|
|
29
32
|
constructor(root) {
|
|
30
33
|
_TreeNode_instances.add(this);
|
|
31
34
|
this.open = false;
|
|
@@ -36,9 +39,6 @@ class TreeNode {
|
|
|
36
39
|
this.level = 1;
|
|
37
40
|
this.root = root;
|
|
38
41
|
}
|
|
39
|
-
get indent() {
|
|
40
|
-
return this.level * 2;
|
|
41
|
-
}
|
|
42
42
|
addNode(node) {
|
|
43
43
|
if (node instanceof TreeNode) {
|
|
44
44
|
this.leaves.push(node);
|
|
@@ -45,7 +45,7 @@ const startAppSail = (port, opts) => {
|
|
|
45
45
|
}).RAW();
|
|
46
46
|
};
|
|
47
47
|
exports.default = (serverDetails) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
var _a, _b, _c;
|
|
48
|
+
var _a, _b, _c, _d;
|
|
49
49
|
let child;
|
|
50
50
|
const targetSail = serverDetails.target;
|
|
51
51
|
if (!targetSail || !targetSail.appSail) {
|
|
@@ -54,16 +54,17 @@ exports.default = (serverDetails) => __awaiter(void 0, void 0, void 0, function*
|
|
|
54
54
|
if ((_a = targetSail.appSail.scripts) === null || _a === void 0 ? void 0 : _a.preserve) {
|
|
55
55
|
executeHook(targetSail.appSail.scripts.preserve, `AppSail [PRESERVE] [${(_b = targetSail.appSail) === null || _b === void 0 ? void 0 : _b.name}]`, targetSail.appSail.source);
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const buildPath = targetSail.appSail.buildPath
|
|
58
|
+
? targetSail.appSail.buildPath
|
|
59
|
+
: (_c = targetSail.appSail) === null || _c === void 0 ? void 0 : _c.build_path;
|
|
60
|
+
if (!(yield fs_1.ASYNC.isPathExists(buildPath))) {
|
|
61
|
+
throw new error_1.default(`Build path does not exists [${buildPath}]`, {
|
|
59
62
|
exit: 1,
|
|
60
63
|
errorId: 'SERVE-APPSAIL-1',
|
|
61
|
-
arg: [ansi_colors_1.italic.red(
|
|
64
|
+
arg: [ansi_colors_1.italic.red(buildPath), (0, ansi_colors_1.bold)(targetSail.appSail.name)]
|
|
62
65
|
});
|
|
63
66
|
}
|
|
64
|
-
const target = (yield fs_1.ASYNC.fileExists(
|
|
65
|
-
? (0, path_1.dirname)(targetSail.appSail.buildPath)
|
|
66
|
-
: targetSail.appSail.buildPath;
|
|
67
|
+
const target = (yield fs_1.ASYNC.fileExists(buildPath)) ? (0, path_1.dirname)(buildPath) : buildPath;
|
|
67
68
|
switch (true) {
|
|
68
69
|
case targetSail.appSail.stack.startsWith('node'): {
|
|
69
70
|
child = startAppSail(targetSail.port.appsail, {
|
|
@@ -139,7 +140,7 @@ exports.default = (serverDetails) => __awaiter(void 0, void 0, void 0, function*
|
|
|
139
140
|
}
|
|
140
141
|
});
|
|
141
142
|
});
|
|
142
|
-
if ((
|
|
143
|
+
if ((_d = targetSail.appSail.scripts) === null || _d === void 0 ? void 0 : _d.postserve) {
|
|
143
144
|
child.once('exit', () => {
|
|
144
145
|
var _a, _b, _c, _d;
|
|
145
146
|
if (!((_a = targetSail.appSail) === null || _a === void 0 ? void 0 : _a.scripts)) {
|
|
@@ -45,7 +45,7 @@ exports.default = (targets) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
45
45
|
}
|
|
46
46
|
const targetBuildPath = (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build, constants_1.FOLDERNAME.functions, target.name);
|
|
47
47
|
if (yield fs_1.ASYNC.isPathExists(targetBuildPath)) {
|
|
48
|
-
yield fs_1.ASYNC.
|
|
48
|
+
yield fs_1.ASYNC.emptyDir(targetBuildPath);
|
|
49
49
|
}
|
|
50
50
|
if (target.type === constants_1.FN_TYPE.advanced ||
|
|
51
51
|
target.type === constants_1.FN_TYPE.applogic ||
|
|
@@ -36,7 +36,9 @@ exports.default = (targets) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
36
36
|
return target;
|
|
37
37
|
});
|
|
38
38
|
return Promise.all(nodeTargets.map((target) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
-
|
|
39
|
+
const buildPath = (0, path_1.join)(runtime_store_1.default.get('project.root'), constants_1.FOLDERNAME.build, constants_1.FOLDERNAME.functions, target.name);
|
|
40
|
+
yield fs_1.ASYNC.emptyDir(buildPath);
|
|
41
|
+
yield fs_1.ASYNC.copyDir(target.source, buildPath);
|
|
40
42
|
throbber.remove('function_serve_' + target.name);
|
|
41
43
|
return target;
|
|
42
44
|
})));
|
|
@@ -57,6 +57,7 @@ exports.default = (targets, fnWatchEvent) => __awaiter(void 0, void 0, void 0, f
|
|
|
57
57
|
target.failure_reason = error.message;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
yield fs_1.ASYNC.emptyDir(buildPath);
|
|
60
61
|
yield fs_1.ASYNC.copyDir(target.source, buildPath);
|
|
61
62
|
throbber.remove('function_serve_' + target.name);
|
|
62
63
|
return target;
|
|
@@ -12,22 +12,22 @@ exports.default = Object.freeze({
|
|
|
12
12
|
serve_port: {
|
|
13
13
|
http: {
|
|
14
14
|
master: 3000,
|
|
15
|
+
advancedio: 4000,
|
|
16
|
+
basicio: 4200,
|
|
17
|
+
browser_logic: 4400,
|
|
15
18
|
appsail: {
|
|
16
19
|
master: 3000,
|
|
17
|
-
service:
|
|
20
|
+
service: 4500
|
|
18
21
|
},
|
|
19
|
-
|
|
20
|
-
basicio: 3040,
|
|
21
|
-
client: 3050,
|
|
22
|
-
browser_logic: 3100
|
|
22
|
+
client: 5000
|
|
23
23
|
},
|
|
24
24
|
debug: {
|
|
25
25
|
master: -1,
|
|
26
26
|
advancedio: 8000,
|
|
27
|
-
basicio:
|
|
28
|
-
|
|
29
|
-
appsail:
|
|
30
|
-
|
|
27
|
+
basicio: 8200,
|
|
28
|
+
browser_logic: 8400,
|
|
29
|
+
appsail: -1,
|
|
30
|
+
client: -1
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
event_bus: {
|
|
@@ -27,6 +27,7 @@ exports.default = Object.freeze({
|
|
|
27
27
|
project_user_create: 'ZohoCatalyst.projects.users.CREATE',
|
|
28
28
|
project_user_delete: 'ZohoCatalyst.projects.users.DELETE',
|
|
29
29
|
project_user_update: 'ZohoCatalyst.projects.users.UPDATE',
|
|
30
|
+
custom_token_generation: 'ZohoCatalyst.authentication.CREATE',
|
|
30
31
|
email_send: 'ZohoCatalyst.email.CREATE',
|
|
31
32
|
datastore: 'ZohoCatalyst.tables.ALL',
|
|
32
33
|
row: 'ZohoCatalyst.tables.rows.ALL',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcatalyst-cli",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.6",
|
|
4
4
|
"description": "Command Line Tool for CATALYST",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@types/jest": "^27.4.1",
|
|
72
72
|
"@types/lodash": "^4.14.182",
|
|
73
73
|
"@types/minimatch": "^5.1.2",
|
|
74
|
-
"@types/node": "^
|
|
74
|
+
"@types/node": "^20.12.7",
|
|
75
75
|
"@types/request": "^2.48.8",
|
|
76
76
|
"@types/semver": "^7.3.9",
|
|
77
77
|
"@types/update-notifier": "^5.1.0",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"npm-run-all": "^4.1.5",
|
|
88
88
|
"prettier": "^2.6.2",
|
|
89
89
|
"ts-jest": "^27.1.4",
|
|
90
|
-
"typescript": "^4.
|
|
90
|
+
"typescript": "^4.9.5"
|
|
91
91
|
},
|
|
92
92
|
"scripts": {
|
|
93
93
|
"build": "gulp build",
|