zcatalyst-cli 1.16.2 → 1.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/authentication/login.js +5 -3
- package/lib/deploy/features/functions/index.js +15 -5
- package/lib/fn-utils/lib/ensure-java-userconfig.js +2 -8
- package/lib/fn-utils/lib/java.js +11 -13
- package/lib/fn-watcher.js +16 -0
- package/lib/pull/features/functions/index.js +13 -0
- package/lib/serve/index.js +0 -11
- package/lib/serve/server/lib/java/index.js +4 -4
- package/lib/serve/server/lib/node/index.js +3 -3
- package/lib/serve/server/lib/python/index.js +1 -2
- package/lib/shell/prepare/index.js +16 -0
- package/lib/util_modules/constants/lib/dc-type.js +8 -0
- package/lib/util_modules/constants/lib/urls.js +12 -0
- package/package.json +1 -1
- package/templates/init/functions/java/aio/sample.java +1 -1
|
@@ -33,8 +33,10 @@ const logger_1 = require("../util_modules/logger");
|
|
|
33
33
|
const option_1 = require("../util_modules/option");
|
|
34
34
|
const crypto_1 = require("crypto");
|
|
35
35
|
exports.missingScopes = {
|
|
36
|
-
[constants_1.DC_TYPE.
|
|
37
|
-
[constants_1.DC_TYPE.eu.value]: ['quick_ml']
|
|
36
|
+
[constants_1.DC_TYPE.in.value]: ['dataverse'],
|
|
37
|
+
[constants_1.DC_TYPE.eu.value]: ['quick_ml', 'dataverse'],
|
|
38
|
+
[constants_1.DC_TYPE.au.value]: ['dataverse'],
|
|
39
|
+
[constants_1.DC_TYPE.ca.value]: ['quick_ml', 'dataverse']
|
|
38
40
|
};
|
|
39
41
|
class Login {
|
|
40
42
|
constructor(localhost = true, user = true) {
|
|
@@ -283,7 +285,7 @@ class Login {
|
|
|
283
285
|
var _a;
|
|
284
286
|
const dcRef = (_a = (0, dc_1.getActiveDCType)()) === null || _a === void 0 ? void 0 : _a.ref;
|
|
285
287
|
const callbackUrl = this._getCallbackUrl(port);
|
|
286
|
-
const nonce =
|
|
288
|
+
const nonce = (0, crypto_1.randomBytes)(16).toString('base64');
|
|
287
289
|
const authUrl = this._getLoginUrl(callbackUrl, nonce);
|
|
288
290
|
let reqCount = 0;
|
|
289
291
|
const server = (0, http_1.createServer)((req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -23,6 +23,7 @@ const runtime_1 = __importDefault(require("../../../util_modules/constants/lib/r
|
|
|
23
23
|
const logger_1 = require("../../../util_modules/logger");
|
|
24
24
|
const option_1 = require("../../../util_modules/option");
|
|
25
25
|
const languages_1 = require("./languages");
|
|
26
|
+
const char_1 = require("../../../util_modules/char");
|
|
26
27
|
exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
28
|
fn_utils_1.fnUtils.common.executeHook({ prefix: 'pre', command: 'deploy' });
|
|
28
29
|
const targets = yield fn_utils_1.fnUtils.common.validate();
|
|
@@ -48,6 +49,20 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
48
49
|
(0, languages_1.java)(refinedTargets.filter((target) => { var _a; return ((_a = target.stack) === null || _a === void 0 ? void 0 : _a.startsWith(runtime_1.default.language.java.value)) && target.valid; })),
|
|
49
50
|
(0, languages_1.python)(refinedTargets.filter((target) => { var _a; return ((_a = target.stack) === null || _a === void 0 ? void 0 : _a.startsWith(runtime_1.default.language.python.value)) && target.valid; }))
|
|
50
51
|
]);
|
|
52
|
+
refinedTargets === null || refinedTargets === void 0 ? void 0 : refinedTargets.forEach((target) => {
|
|
53
|
+
if (target.compilationError) {
|
|
54
|
+
target.compilationError.forEach((error) => {
|
|
55
|
+
console.log(`${(0, ansi_colors_1.red)(char_1.CHAR.error)} Error while compiling function[${target.name}]`);
|
|
56
|
+
console.log(error);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (target.compilationWarning) {
|
|
60
|
+
target.compilationWarning.forEach((warn) => {
|
|
61
|
+
console.warn(`${(0, ansi_colors_1.yellow)(char_1.CHAR.warning)} Warning while compiling function[${target.name}]`);
|
|
62
|
+
console.warn(warn);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
51
66
|
const combinedTarget = [...(nodeTarget || []), ...(javaTarget || []), ...(pythonTarget || [])];
|
|
52
67
|
const batchSize = 1;
|
|
53
68
|
const fnAPI = yield (0, endpoints_1.functionsAPI)();
|
|
@@ -99,11 +114,6 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
99
114
|
})));
|
|
100
115
|
}
|
|
101
116
|
const allTargets = refinedTargets.filter((target) => {
|
|
102
|
-
if (target.compilationWarning) {
|
|
103
|
-
target.compilationWarning.forEach((message) => {
|
|
104
|
-
(0, logger_1.warning)(message);
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
117
|
if (!target.valid) {
|
|
108
118
|
(0, logger_1.warning)('skipping deploy of target [' + target.name + '] since ' + target.failure_reason);
|
|
109
119
|
}
|
|
@@ -17,9 +17,9 @@ const semver_1 = require("semver");
|
|
|
17
17
|
const error_1 = __importDefault(require("../../error"));
|
|
18
18
|
const runtime_store_1 = __importDefault(require("../../runtime-store"));
|
|
19
19
|
const userConfig_1 = __importDefault(require("../../userConfig"));
|
|
20
|
-
const env_1 = require("../../util_modules/env");
|
|
21
20
|
const shell_1 = require("../../util_modules/shell");
|
|
22
21
|
const java_1 = require("./java");
|
|
22
|
+
const path_1 = require("path");
|
|
23
23
|
exports.stackVsVersions = {
|
|
24
24
|
java8: {
|
|
25
25
|
version: '1.8.0',
|
|
@@ -140,12 +140,6 @@ function getJavaSpawnCommand(spawnCommand, process, stack) {
|
|
|
140
140
|
if (isUsingJavaDefaultPath === true) {
|
|
141
141
|
return process;
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
spawnCommand = `"${spawnCommand}\\${process}"`;
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
spawnCommand = `${spawnCommand}/${process}`;
|
|
148
|
-
}
|
|
149
|
-
return spawnCommand;
|
|
143
|
+
return (0, path_1.join)(spawnCommand, process);
|
|
150
144
|
}
|
|
151
145
|
exports.getJavaSpawnCommand = getJavaSpawnCommand;
|
package/lib/fn-utils/lib/java.js
CHANGED
|
@@ -175,7 +175,7 @@ function normaliseClasspath(pth, libFolder) {
|
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
row.path = (0, path_1.
|
|
178
|
+
row.path = (0, path_1.basename)(libFolder) + '/' + jarName;
|
|
179
179
|
if ((0, path_1.dirname)(libPath) === (0, path_1.dirname)(libFolder)) {
|
|
180
180
|
try {
|
|
181
181
|
yield fs_1.ASYNC.deleteFile(libPath);
|
|
@@ -238,15 +238,20 @@ function compileTarget(target) {
|
|
|
238
238
|
const targetVersion = getTargetVersion(target.stack);
|
|
239
239
|
yield Promise.all(entries.map((file) => compileJavaFiles(file, spawnCommand, targetVersion, targetSource, outputFolder)
|
|
240
240
|
.then((result) => {
|
|
241
|
-
const code = result
|
|
242
|
-
if (code === 1) {
|
|
241
|
+
const [_stdout, stderr, code] = result;
|
|
242
|
+
if (code === null || code >= 1) {
|
|
243
243
|
const error = [];
|
|
244
|
-
error === null || error === void 0 ? void 0 : error.push(
|
|
244
|
+
error === null || error === void 0 ? void 0 : error.push(stderr);
|
|
245
245
|
target.valid = false;
|
|
246
|
+
target.failure_reason = 'there was a Java compilation error';
|
|
246
247
|
target.compilationError = error;
|
|
247
248
|
}
|
|
249
|
+
else if (stderr) {
|
|
250
|
+
target.compilationWarning = [stderr];
|
|
251
|
+
}
|
|
248
252
|
})
|
|
249
253
|
.catch((error) => {
|
|
254
|
+
target.valid = false;
|
|
250
255
|
target.failure_reason = error.message;
|
|
251
256
|
})));
|
|
252
257
|
const currentCommand = (0, option_1.getCurrentCommand)();
|
|
@@ -282,6 +287,7 @@ function compileJavaFiles(file, spawnCommand, targetVersion, targetSource, outpu
|
|
|
282
287
|
'*' + module.exports.classPathSep + '.',
|
|
283
288
|
'-g',
|
|
284
289
|
'-Xprefer:source',
|
|
290
|
+
'-Xlint',
|
|
285
291
|
file.replace(targetSource, outputFolder)
|
|
286
292
|
], {
|
|
287
293
|
cwd: outputFolder,
|
|
@@ -435,15 +441,7 @@ function validate(targets, idx) {
|
|
|
435
441
|
skipHelp: !!(0, option_1.getOptionValue)('watch', false)
|
|
436
442
|
});
|
|
437
443
|
});
|
|
438
|
-
|
|
439
|
-
currentTarget.valid = true;
|
|
440
|
-
return validate(targets, ++idx);
|
|
441
|
-
}
|
|
442
|
-
throw new error_1.default('there was a compilation error!', {
|
|
443
|
-
exit: 1,
|
|
444
|
-
errorId: 'JAVA-7',
|
|
445
|
-
skipHelp: !!(0, option_1.getOptionValue)('watch', false)
|
|
446
|
-
});
|
|
444
|
+
return validate(targets, ++idx);
|
|
447
445
|
}
|
|
448
446
|
catch (err) {
|
|
449
447
|
currentTarget.valid = false;
|
package/lib/fn-watcher.js
CHANGED
|
@@ -19,6 +19,8 @@ const languages_1 = require("./shell/prepare/languages");
|
|
|
19
19
|
const constants_1 = require("./util_modules/constants");
|
|
20
20
|
const fs_1 = require("./util_modules/fs");
|
|
21
21
|
const logger_1 = require("./util_modules/logger");
|
|
22
|
+
const char_1 = require("./util_modules/char");
|
|
23
|
+
const ansi_colors_1 = require("ansi-colors");
|
|
22
24
|
exports.default = (target) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
25
|
return new Promise((res) => {
|
|
24
26
|
let paused = false;
|
|
@@ -38,11 +40,25 @@ exports.default = (target) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
38
40
|
watcher.emit('preparing');
|
|
39
41
|
target.failure_reason = undefined;
|
|
40
42
|
target.valid = true;
|
|
43
|
+
target.compilationError = undefined;
|
|
44
|
+
target.compilationWarning = undefined;
|
|
41
45
|
yield fs_1.ASYNC.chmod((0, path_1.join)(runtime_store_1.default.get('project.root'), constants_1.FOLDERNAME.build, constants_1.FOLDERNAME.functions, target.name), '755', { recursive: true });
|
|
42
46
|
yield (0, languages_1.prepareFunctions)([target], latestEvent);
|
|
43
47
|
if (currentLatestEvent.at === latestEvent.at) {
|
|
44
48
|
latestEvent = undefined;
|
|
45
49
|
}
|
|
50
|
+
if (target.compilationError) {
|
|
51
|
+
target.compilationError.forEach((error) => {
|
|
52
|
+
console.log(`${(0, ansi_colors_1.red)(char_1.CHAR.error)} Error while compiling function[${target.name}]`);
|
|
53
|
+
console.log(error);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (target.compilationWarning) {
|
|
57
|
+
target.compilationWarning.forEach((warn) => {
|
|
58
|
+
console.warn(`${(0, ansi_colors_1.yellow)(char_1.CHAR.warning)} Warning while compiling function[${target.name}]`);
|
|
59
|
+
console.warn(warn);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
46
62
|
if (target.valid) {
|
|
47
63
|
watcher.emit('compiled');
|
|
48
64
|
return;
|
|
@@ -30,6 +30,7 @@ const error_1 = __importDefault(require("../../../error"));
|
|
|
30
30
|
const python_1 = require("../../../fn-utils/lib/python");
|
|
31
31
|
const throbber_1 = __importDefault(require("../../../throbber"));
|
|
32
32
|
const ensure_java_userconfig_1 = require("../../../fn-utils/lib/ensure-java-userconfig");
|
|
33
|
+
const char_1 = require("../../../util_modules/char");
|
|
33
34
|
function selFnsPrompt(targs, fnDirPath) {
|
|
34
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
36
|
const choicesObj = targs.reduce((accumulator, fn) => {
|
|
@@ -202,6 +203,18 @@ exports.default = (_fns) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
202
203
|
else if (!target.valid && ((_c = target.failure_reason) === null || _c === void 0 ? void 0 : _c.startsWith('unable to locate python'))) {
|
|
203
204
|
(0, logger_1.warning)(`skipping pull of function(${target.name}) since ${target.failure_reason}`);
|
|
204
205
|
}
|
|
206
|
+
if (target.compilationError) {
|
|
207
|
+
target.compilationError.forEach((error) => {
|
|
208
|
+
console.log(`${(0, ansi_colors_1.red)(char_1.CHAR.error)} Error while compiling function[${target.name}]`);
|
|
209
|
+
console.log(error);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
if (target.compilationWarning) {
|
|
213
|
+
target.compilationWarning.forEach((warn) => {
|
|
214
|
+
console.warn(`${(0, ansi_colors_1.yellow)(char_1.CHAR.warning)} Warning while compiling function[${target.name}]`);
|
|
215
|
+
console.warn(warn);
|
|
216
|
+
});
|
|
217
|
+
}
|
|
205
218
|
return target.valid;
|
|
206
219
|
});
|
|
207
220
|
if (isFnPulled) {
|
package/lib/serve/index.js
CHANGED
|
@@ -51,7 +51,6 @@ const logger_1 = require("../util_modules/logger");
|
|
|
51
51
|
const option_1 = require("../util_modules/option");
|
|
52
52
|
const features = __importStar(require("./features"));
|
|
53
53
|
const server_1 = __importDefault(require("./server"));
|
|
54
|
-
const char_1 = require("../util_modules/char");
|
|
55
54
|
exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
55
|
const serveTargets = runtime_store_1.default.get('context.targets', []);
|
|
57
56
|
const advancedServer = new server_1.default();
|
|
@@ -90,11 +89,6 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
90
89
|
}
|
|
91
90
|
const functionTargets = rawTargets.filter((target) => {
|
|
92
91
|
var _a;
|
|
93
|
-
if (target.compilationError) {
|
|
94
|
-
target.compilationError.forEach((error) => {
|
|
95
|
-
console.log(`${(0, ansi_colors_1.red)(char_1.CHAR.error)} Error while compiling function[${target.name}] : ${error}`);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
92
|
if (!target.valid) {
|
|
99
93
|
(0, logger_1.warning)('skipping serve of function [' +
|
|
100
94
|
target.name +
|
|
@@ -102,11 +96,6 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
102
96
|
target.failure_reason);
|
|
103
97
|
return false;
|
|
104
98
|
}
|
|
105
|
-
if (target.compilationWarning) {
|
|
106
|
-
target.compilationWarning.forEach((message) => {
|
|
107
|
-
(0, logger_1.warning)(message);
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
99
|
if (target.type === constants_1.FN_TYPE.advanced) {
|
|
111
100
|
advancedServer.add('server', target);
|
|
112
101
|
}
|
|
@@ -24,9 +24,9 @@ const project_1 = require("../../../../util_modules/project");
|
|
|
24
24
|
const shell_1 = require("../../../../util_modules/shell");
|
|
25
25
|
exports.default = (details, masterPort) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
26
|
var _a, _b, _c, _d, _e;
|
|
27
|
-
const
|
|
28
|
-
const javaServer = (0, path_1.join)(
|
|
29
|
-
const targetDir = (0, path_1.join)(
|
|
27
|
+
const projectRoot = runtime_store_1.default.get('project.root');
|
|
28
|
+
const javaServer = (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build, '.catalyst', 'aioserver', 'JavaaioServer');
|
|
29
|
+
const targetDir = (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build, constants_1.FOLDERNAME.functions, (_a = details.target) === null || _a === void 0 ? void 0 : _a.name);
|
|
30
30
|
const label = `${details.type}[${(_b = details.target) === null || _b === void 0 ? void 0 : _b.name}]`;
|
|
31
31
|
const opts = [
|
|
32
32
|
'-cp',
|
|
@@ -52,7 +52,7 @@ exports.default = (details, masterPort) => __awaiter(void 0, void 0, void 0, fun
|
|
|
52
52
|
const userConfigCmd = userConfig_1.default.get(configKey);
|
|
53
53
|
const spawnCommand = (0, ensure_java_userconfig_1.getJavaSpawnCommand)(userConfigCmd, 'java', (_e = details.target) === null || _e === void 0 ? void 0 : _e.stack);
|
|
54
54
|
return (0, shell_1.spawn)(spawnCommand, opts, {
|
|
55
|
-
cwd: targetSource === null || targetSource === void 0 ? void 0 : targetSource.replace(
|
|
55
|
+
cwd: targetSource === null || targetSource === void 0 ? void 0 : targetSource.replace(projectRoot, (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build)),
|
|
56
56
|
stdio: 'pipe',
|
|
57
57
|
env: Object.assign({ X_ZOHO_CATALYST_IS_LOCAL: 'true', X_ZOHO_CATALYST_FUNCTION_LOADED: 'true', X_ZOHO_CATALYST_CODE_LOCATION: targetDir + path_1.sep, X_ZOHO_CATALYST_ACCOUNTS_URL: constants_1.ORIGIN.auth, X_ZOHO_CATALYST_CONSOLE_URL: constants_1.ORIGIN.admin, CATALYST_PROJECT_TIMEZONE: (0, project_1.getProjectTimezone)(Intl.DateTimeFormat().resolvedOptions().timeZone) }, details.target.env_var)
|
|
58
58
|
}).RAW();
|
|
@@ -37,9 +37,9 @@ exports.default = (details, masterPort) => __awaiter(void 0, void 0, void 0, fun
|
|
|
37
37
|
var _a, _b;
|
|
38
38
|
const label = `${details.type}[${(_a = details.target) === null || _a === void 0 ? void 0 : _a.name}]`;
|
|
39
39
|
const _c = details.target, { ['watcher']: _ } = _c, serialisableTarget = __rest(_c, ['watcher']);
|
|
40
|
-
const
|
|
40
|
+
const projectRoot = runtime_store_1.default.get('project.root');
|
|
41
41
|
serialisableTarget.index = serialisableTarget.index
|
|
42
|
-
? serialisableTarget.index.replace(
|
|
42
|
+
? serialisableTarget.index.replace(projectRoot, (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build))
|
|
43
43
|
: undefined;
|
|
44
44
|
const opts = [
|
|
45
45
|
(0, path_1.join)(__dirname, 'server'),
|
|
@@ -79,7 +79,7 @@ exports.default = (details, masterPort) => __awaiter(void 0, void 0, void 0, fun
|
|
|
79
79
|
return event;
|
|
80
80
|
}
|
|
81
81
|
return (0, shell_1.spawn)('node', opts, {
|
|
82
|
-
cwd: targetSource === null || targetSource === void 0 ? void 0 : targetSource.replace(
|
|
82
|
+
cwd: targetSource === null || targetSource === void 0 ? void 0 : targetSource.replace(projectRoot, (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build)),
|
|
83
83
|
stdio: 'pipe',
|
|
84
84
|
env: Object.assign({ NODE_PATH: targetSource + path_1.sep + 'node_modules', X_ZOHO_CATALYST_IS_LOCAL: 'true', X_ZOHO_CATALYST_FUNCTION_LOADED: 'true', X_ZOHO_CATALYST_ACCOUNTS_URL: constants_1.ORIGIN.auth, X_ZOHO_CATALYST_CONSOLE_URL: constants_1.ORIGIN.admin, CATALYST_PROJECT_TIMEZONE: (0, project_1.getProjectTimezone)(Intl.DateTimeFormat().resolvedOptions().timeZone) }, details.target.env_var)
|
|
85
85
|
}).RAW();
|
|
@@ -26,7 +26,6 @@ exports.default = (details) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
26
26
|
const projectRoot = runtime_store_1.default.get('project.root');
|
|
27
27
|
const targetSource = (_a = details.target) === null || _a === void 0 ? void 0 : _a.source;
|
|
28
28
|
const runtimesDir = constants_1.ENVPATH.runtimes.data;
|
|
29
|
-
const cwd = runtime_store_1.default.get('cwd');
|
|
30
29
|
const stackVersion = (_b = details.target.stack) === null || _b === void 0 ? void 0 : _b.replace('python_', '');
|
|
31
30
|
const opts = [
|
|
32
31
|
'-u',
|
|
@@ -34,7 +33,7 @@ exports.default = (details) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
34
33
|
];
|
|
35
34
|
return new Promise((res) => {
|
|
36
35
|
const child = (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), opts, {
|
|
37
|
-
cwd: targetSource === null || targetSource === void 0 ? void 0 : targetSource.replace(
|
|
36
|
+
cwd: targetSource === null || targetSource === void 0 ? void 0 : targetSource.replace(projectRoot, (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build)),
|
|
38
37
|
stdio: 'pipe',
|
|
39
38
|
env: Object.assign({ X_ZOHO_CATALYST_IS_LOCAL: 'true', X_ZOHO_CATALYST_FUNCTION_LOADED: 'true', X_ZOHO_CATALYST_ACCOUNTS_URL: constants_1.ORIGIN.auth, X_ZOHO_CATALYST_CONSOLE_URL: constants_1.ORIGIN.admin, X_ZOHO_CATALYST_CODE_LOCATION: targetSource === null || targetSource === void 0 ? void 0 : targetSource.replace(projectRoot, (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build)), X_ZOHO_CATALYST_SERVER_LISTEN_PORT: details.httpPort.toString(), CATALYST_PROJECT_TIMEZONE: (0, project_1.getProjectTimezone)(Intl.DateTimeFormat().resolvedOptions().timeZone) }, details.target.env_var)
|
|
40
39
|
}).RAW();
|
|
@@ -12,6 +12,7 @@ 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 fn_utils_1 = require("../../fn-utils");
|
|
16
17
|
const common_1 = require("../../fn-utils/lib/common");
|
|
17
18
|
const pip_install_1 = require("../../init/dependencies/python/pip-install");
|
|
@@ -20,6 +21,7 @@ const throbber_1 = __importDefault(require("../../throbber"));
|
|
|
20
21
|
const constants_1 = require("../../util_modules/constants");
|
|
21
22
|
const runtime_1 = __importDefault(require("../../util_modules/constants/lib/runtime"));
|
|
22
23
|
const languages_1 = require("./languages");
|
|
24
|
+
const char_1 = require("../../util_modules/char");
|
|
23
25
|
exports.default = (fnTypes) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
26
|
fn_utils_1.fnUtils.common.executeHook({ prefix: 'pre', command: 'serve' });
|
|
25
27
|
const throbber = throbber_1.default.getInstance();
|
|
@@ -42,6 +44,20 @@ exports.default = (fnTypes) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
42
44
|
});
|
|
43
45
|
runtime_store_1.default.set('context.functions.targets', refinedTargets);
|
|
44
46
|
yield (0, languages_1.prepareFunctions)(refinedTargets);
|
|
47
|
+
refinedTargets.forEach((target) => {
|
|
48
|
+
if (target.compilationError) {
|
|
49
|
+
target.compilationError.forEach((error) => {
|
|
50
|
+
console.log(`${(0, ansi_colors_1.red)(char_1.CHAR.error)} Error while compiling function[${target.name}]`);
|
|
51
|
+
console.log(error);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (target.compilationWarning) {
|
|
55
|
+
target.compilationWarning.forEach((warn) => {
|
|
56
|
+
console.warn(`${(0, ansi_colors_1.yellow)(char_1.CHAR.warning)} Warning while compiling function[${target.name}]`);
|
|
57
|
+
console.warn(warn);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
45
61
|
const pyStacks = [];
|
|
46
62
|
refinedTargets.filter((target) => {
|
|
47
63
|
var _a;
|
|
@@ -12,6 +12,9 @@ class URL {
|
|
|
12
12
|
if (dc === undefined) {
|
|
13
13
|
return URL._auth;
|
|
14
14
|
}
|
|
15
|
+
if (dc.value === dc_type_js_1.default.ca.value) {
|
|
16
|
+
return URL._auth.replace('.zoho.com', '.zohocloud.ca');
|
|
17
|
+
}
|
|
15
18
|
return URL._auth.replace('.com', dc.ext);
|
|
16
19
|
}
|
|
17
20
|
static get admin() {
|
|
@@ -19,6 +22,9 @@ class URL {
|
|
|
19
22
|
if (dc === undefined) {
|
|
20
23
|
return URL._admin;
|
|
21
24
|
}
|
|
25
|
+
if (dc.value === dc_type_js_1.default.ca.value) {
|
|
26
|
+
return URL._admin.replace('.zoho.com', '.zohocloud.ca');
|
|
27
|
+
}
|
|
22
28
|
return URL._admin.replace('.com', dc.ext);
|
|
23
29
|
}
|
|
24
30
|
static get app() {
|
|
@@ -33,6 +39,9 @@ class URL {
|
|
|
33
39
|
if (dc === undefined) {
|
|
34
40
|
return URL._zohoStatic;
|
|
35
41
|
}
|
|
42
|
+
if (dc.value === dc_type_js_1.default.ca.value) {
|
|
43
|
+
return URL._zohoStatic.replace('.zoho.com', '.zohocloud.ca');
|
|
44
|
+
}
|
|
36
45
|
return URL._zohoStatic.replace(dc_type_js_1.default.us.ext, dc.ext);
|
|
37
46
|
}
|
|
38
47
|
static get console() {
|
|
@@ -40,6 +49,9 @@ class URL {
|
|
|
40
49
|
if (dc === undefined) {
|
|
41
50
|
return URL._console;
|
|
42
51
|
}
|
|
52
|
+
if (dc.value === dc_type_js_1.default.ca.value) {
|
|
53
|
+
return URL._console.replace('.zoho.com', '.zohocloud.ca');
|
|
54
|
+
}
|
|
43
55
|
return URL._console.replace('.com', dc.ext);
|
|
44
56
|
}
|
|
45
57
|
}
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ public class {{_CLASS_}} implements CatalystAdvancedIOHandler {
|
|
|
14
14
|
try {
|
|
15
15
|
switch(request.getRequestURI()) {
|
|
16
16
|
case "/": {
|
|
17
|
-
String name =
|
|
17
|
+
String name = request.getParameter("name");
|
|
18
18
|
LOGGER.log(Level.INFO, "Hello "+name);
|
|
19
19
|
response.setStatus(200);
|
|
20
20
|
response.getWriter().write("Hello from {{_CLASS_}}.java");
|