zcatalyst-cli 1.18.0-beta.0 → 1.18.0-beta.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/docs/commands/event/generate/job.toml +7 -0
- package/docs/endpoints/lib/job-scheduling.toml +3 -0
- package/docs/internal/command.toml +5 -0
- package/lib/appsail-utils.js +4 -10
- package/lib/authentication/index.js +1 -0
- package/lib/bin/catalyst.js +1 -1
- package/lib/command_needs/rc.js +1 -1
- package/lib/commands/appsail/add.js +1 -0
- package/lib/commands/client/setup.js +1 -0
- package/lib/commands/event/generate/index.js +2 -1
- package/lib/commands/event/generate/integ.js +2 -1
- package/lib/commands/event/generate/job.js +82 -0
- package/lib/commands/functions/add.js +1 -0
- package/lib/commands/functions/delete.js +2 -4
- package/lib/commands/functions/setup.js +1 -0
- package/lib/commands/functions/shell.js +1 -0
- package/lib/commands/index.js +3 -1
- package/lib/commands/init.js +2 -6
- package/lib/commands/login.js +1 -0
- package/lib/commands/logout.js +1 -0
- package/lib/commands/pull.js +1 -0
- package/lib/commands/serve.js +1 -1
- package/lib/commands/whoami.js +1 -0
- package/lib/deploy/features/appsail/index.js +19 -17
- package/lib/deploy/features/appsail/utils.js +4 -5
- package/lib/endpoints/index.js +8 -1
- package/lib/endpoints/lib/appsail.js +7 -1
- package/lib/endpoints/lib/job-scheduling.js +61 -0
- package/lib/express_middlewares/logger.js +2 -4
- package/lib/fn-utils/lib/common.js +2 -3
- package/lib/fn-utils/lib/java.js +1 -1
- package/lib/fn-utils/lib/python.js +2 -2
- package/lib/fn-watcher.js +1 -1
- package/lib/init/dependencies/python/ensure-python.js +6 -8
- package/lib/init/features/appsail/index.js +14 -10
- package/lib/init/features/client/index.js +2 -1
- package/lib/init/features/functions/index.js +4 -0
- package/lib/init/features/functions/languages/python.js +21 -5
- package/lib/internal/api.js +12 -1
- package/lib/internal/command.js +30 -6
- 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/features/appsail.js +2 -3
- package/lib/serve/index.js +1 -2
- package/lib/serve/server/index.js +8 -9
- package/lib/serve/server/lib/appsail/index.js +24 -34
- package/lib/serve/server/lib/java/aio_server/lib/catalyst-cli-java-runtime-1.0.0.jar +0 -0
- package/lib/serve/server/lib/java/aio_server/lib/catalyst-function-sdk-1.0.0.jar +0 -0
- package/lib/serve/server/lib/java/aio_server/lib/catalyst-java-runtime-1.0.0.jar +0 -0
- package/lib/serve/server/lib/java/index.js +2 -2
- package/lib/serve/server/lib/master/appsail.js +53 -0
- package/lib/serve/server/lib/master/functions.js +34 -0
- package/lib/serve/server/lib/master/index.js +155 -0
- package/lib/{express_middlewares/unknownReqProxy.js → serve/server/lib/master/unknown-req-proxy.js} +4 -7
- package/lib/serve/server/lib/master/utils.js +130 -0
- package/lib/serve/server/lib/master/web-client.js +39 -0
- package/lib/serve/server/lib/node/index.js +3 -3
- package/lib/serve/server/lib/python/index.js +3 -3
- package/lib/shell/dependencies/invoker/bio/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
- package/lib/shell/dependencies/invoker/cron/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
- package/lib/shell/dependencies/invoker/event/java/JavaeventInvoker.java +2 -1
- package/lib/shell/dependencies/invoker/event/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
- package/lib/shell/dependencies/invoker/event/node.mjs +1 -0
- package/lib/shell/dependencies/invoker/integ/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
- package/lib/shell/dependencies/invoker/job/java/JavajobInvoker.java +254 -0
- package/lib/shell/dependencies/invoker/job/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
- package/lib/shell/dependencies/invoker/job/java/lib/org.json.jar +0 -0
- package/lib/shell/dependencies/invoker/job/node.mjs +93 -0
- package/lib/shell/dependencies/local-function.js +121 -13
- package/lib/shell/index.js +7 -1
- package/lib/shell/prepare/languages/index.js +4 -4
- package/lib/shell/prepare/languages/java.js +1 -2
- package/lib/shell/prepare/languages/python.js +10 -16
- package/lib/throbber/index.js +6 -1
- package/lib/userConfig.js +7 -1
- package/lib/util_modules/config/index.js +1 -1
- package/lib/util_modules/config/lib/{appSail.js → appsail.js} +61 -9
- package/lib/util_modules/config/lib/client.js +6 -8
- package/lib/util_modules/config/lib/functions.js +6 -8
- package/lib/util_modules/constants/lib/default.js +9 -9
- package/lib/util_modules/constants/lib/fn-type.js +2 -1
- package/lib/util_modules/constants/lib/needed-scopes.js +53 -44
- package/lib/util_modules/constants/lib/placeholders.js +6 -0
- package/lib/util_modules/constants/lib/ref-mapping.js +2 -1
- package/lib/util_modules/constants/lib/remote-mapping.js +2 -1
- package/lib/util_modules/constants/lib/scopes.js +5 -1
- package/lib/util_modules/constants/lib/template.js +9 -4
- package/lib/util_modules/constants/lib/urls.js +8 -0
- package/lib/util_modules/fs/lib/async.js +7 -2
- package/lib/util_modules/fs/lib/sync.js +12 -1
- package/lib/util_modules/server.js +2 -4
- package/lib/winston.js +17 -11
- package/package.json +1 -1
- package/templates/event/job.json +30 -0
- package/templates/init/functions/java/job/.classpath +6 -0
- package/templates/init/functions/java/job/.project +17 -0
- package/templates/init/functions/java/job/catalyst-config.json +11 -0
- package/templates/init/functions/java/job/sample.java +34 -0
- package/templates/init/functions/node/aio/package.json +1 -1
- package/templates/init/functions/node/bio/package.json +1 -1
- package/templates/init/functions/node/cron/package.json +1 -1
- package/templates/init/functions/node/event/package.json +1 -1
- package/templates/init/functions/node/integ/cliq/package.json +1 -1
- package/templates/init/functions/node/integ/convokraft/package.json +1 -1
- package/templates/init/functions/node/{stream → job}/catalyst-config.json +3 -2
- package/templates/init/functions/node/{stream → job}/package.json +1 -1
- package/templates/init/functions/node/job/sample.js +28 -0
- package/templates/init/functions/node/job/types/job.d.ts +66 -0
- package/templates/init/functions/python/job/catalyst-config.json +11 -0
- package/templates/init/functions/python/job/requirements.txt +1 -0
- package/templates/init/functions/python/job/sample.py +23 -0
- package/templates/init.txt +13 -0
- package/lib/serve/server/lib/master.js +0 -326
- package/templates/init/functions/node/stream/sample.js +0 -15
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[JOB-1]
|
|
2
|
+
context = '''No Jobpools were present in the development environment for project ${arg[0]}'''
|
|
3
|
+
aid = '''Please visit the below link to create your first jobpool\n${arg[1]}'''
|
|
4
|
+
|
|
5
|
+
[JOB-2]
|
|
6
|
+
context = '''No function Jobpools were present in the development environment for project ${arg[0]}'''
|
|
7
|
+
aid = '''Please visit the below link to create a functions jobpool\n${arg[1]}'''
|
|
@@ -2,3 +2,8 @@
|
|
|
2
2
|
context = '''Too many arguments specified with the command: ${arg[0]}.'''
|
|
3
3
|
aid = '''Use ${arg[1]} command to get the usage instructions.'''
|
|
4
4
|
link = 'https://www.zoho.com/catalyst/help/cli-help.html'
|
|
5
|
+
|
|
6
|
+
[CMD-2]
|
|
7
|
+
context = '''The command ${arg[0]} provided is not supported in CI enviroment.'''
|
|
8
|
+
aid = '''Use '${arg[1]}' to know the commands supported in CI.'''
|
|
9
|
+
link = ''
|
package/lib/appsail-utils.js
CHANGED
|
@@ -3,13 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.validateAppSail = exports.filterTargets = void 0;
|
|
7
7
|
const ansi_colors_1 = require("ansi-colors");
|
|
8
8
|
const error_1 = __importDefault(require("./error"));
|
|
9
9
|
const constants_1 = require("./util_modules/constants");
|
|
10
10
|
const logger_1 = require("./util_modules/logger");
|
|
11
11
|
const option_1 = require("./util_modules/option");
|
|
12
|
-
const project_1 = require("./util_modules/project");
|
|
13
12
|
function getAppSailFilters(targetStr) {
|
|
14
13
|
return targetStr.split(',').reduce((filterArr, target) => {
|
|
15
14
|
const opts = target.split(':');
|
|
@@ -28,7 +27,7 @@ function filterTargets(allTargets) {
|
|
|
28
27
|
return allTargets;
|
|
29
28
|
}
|
|
30
29
|
const refined = onlyTargs.reduce((filtered, filter) => {
|
|
31
|
-
const targDetailsIdx = allTargets.findIndex((targ) =>
|
|
30
|
+
const targDetailsIdx = allTargets.findIndex((targ) => targ.name === filter);
|
|
32
31
|
if (targDetailsIdx === -1) {
|
|
33
32
|
filtered.unmatched.push(filter);
|
|
34
33
|
}
|
|
@@ -50,7 +49,7 @@ function filterTargets(allTargets) {
|
|
|
50
49
|
if (except !== undefined) {
|
|
51
50
|
const exceptTargs = getAppSailFilters(except);
|
|
52
51
|
const refined = exceptTargs.reduce((filtered, filter) => {
|
|
53
|
-
const targDetailsIdx = allTargets.findIndex((targ) =>
|
|
52
|
+
const targDetailsIdx = allTargets.findIndex((targ) => targ.name === filter);
|
|
54
53
|
if (targDetailsIdx === -1) {
|
|
55
54
|
filtered.unmatched.push(filter);
|
|
56
55
|
}
|
|
@@ -73,7 +72,7 @@ exports.filterTargets = filterTargets;
|
|
|
73
72
|
function validateAppSail(targDetails) {
|
|
74
73
|
targDetails.forEach((targ) => {
|
|
75
74
|
var _a, _b;
|
|
76
|
-
if (targ.validity.valid && ((_a = targ.
|
|
75
|
+
if (targ.validity.valid && ((_a = targ.config) === null || _a === void 0 ? void 0 : _a.platform) !== 'war' && !((_b = targ.config) === null || _b === void 0 ? void 0 : _b.command)) {
|
|
77
76
|
targ.validity = {
|
|
78
77
|
valid: false,
|
|
79
78
|
reason: 'Start-up command missing'
|
|
@@ -83,8 +82,3 @@ function validateAppSail(targDetails) {
|
|
|
83
82
|
return targDetails;
|
|
84
83
|
}
|
|
85
84
|
exports.validateAppSail = validateAppSail;
|
|
86
|
-
function getDomainPrefix(targetDetail) {
|
|
87
|
-
var _a;
|
|
88
|
-
return `${(_a = targetDetail.appSail) === null || _a === void 0 ? void 0 : _a.name}-${(0, project_1.getDomainKey)()}.development`;
|
|
89
|
-
}
|
|
90
|
-
exports.getDomainPrefix = getDomainPrefix;
|
|
@@ -113,6 +113,7 @@ function login() {
|
|
|
113
113
|
const token = config_store_1.default.get(`${activeDC}.credential`);
|
|
114
114
|
if (user && token && !(0, option_1.getOptionValue)('force', false)) {
|
|
115
115
|
(0, logger_1.message)('No need to login. Already logged as: ' + ansi_colors_1.default.cyan.bold(user.Email));
|
|
116
|
+
(0, dc_1.updateActiveDC)(activeDC);
|
|
116
117
|
return;
|
|
117
118
|
}
|
|
118
119
|
const ans = yield prompt_1.default.ask(prompt_1.default.question('collectUsage', 'Allow Catalyst to collect CLI error reporting information?', {
|
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
|
@@ -33,7 +33,7 @@ exports.default = ({ optional = false, resolveOnNotFound = false, skipOrgCheck =
|
|
|
33
33
|
const globProjectOpt = (0, option_1.getGlobalOptionValue)('project', null);
|
|
34
34
|
const projectOpt = globProjectOpt
|
|
35
35
|
? globProjectOpt
|
|
36
|
-
: (0, env_1.getEnvVariable)('CATALYST_PROJECT', null);
|
|
36
|
+
: (0, env_1.getEnvVariable)('CATALYST_PROJECT_ID', (0, env_1.getEnvVariable)('CATALYST_PROJECT', null));
|
|
37
37
|
const orgApi = yield (0, endpoints_1.orgAPI)();
|
|
38
38
|
if (orgOpt !== null) {
|
|
39
39
|
const orgList = yield orgApi.getAllOrgs();
|
|
@@ -45,6 +45,7 @@ exports.default = new command_1.default('appsail:add')
|
|
|
45
45
|
.needs('auth', [constants_1.SCOPE.functions])
|
|
46
46
|
.needs('config')
|
|
47
47
|
.needs('rc')
|
|
48
|
+
.ci(false)
|
|
48
49
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
50
|
const config = runtime_store_1.default.get('config');
|
|
50
51
|
yield (yield Promise.resolve().then(() => __importStar(require('../../init/features')))).appsail();
|
|
@@ -45,6 +45,7 @@ exports.default = new command_1.default('client:setup')
|
|
|
45
45
|
.needs('auth', [constants_1.SCOPE.webapp])
|
|
46
46
|
.needs('config')
|
|
47
47
|
.needs('rc')
|
|
48
|
+
.ci(false)
|
|
48
49
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
50
|
const config = runtime_store_1.default.get('config');
|
|
50
51
|
yield (yield Promise.resolve().then(() => __importStar(require('../../init/features')))).client();
|
|
@@ -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');
|
|
@@ -0,0 +1,82 @@
|
|
|
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 error_1 = __importDefault(require("../../../error"));
|
|
18
|
+
const command_1 = __importDefault(require("../../../internal/command"));
|
|
19
|
+
const prompt_1 = __importDefault(require("../../../prompt"));
|
|
20
|
+
const constants_1 = require("../../../util_modules/constants");
|
|
21
|
+
const fs_1 = require("../../../util_modules/fs");
|
|
22
|
+
const project_1 = require("../../../util_modules/project");
|
|
23
|
+
exports.default = new command_1.default('event:generate:job [jobpool_id]')
|
|
24
|
+
.description('Generate sample payloads for job functions')
|
|
25
|
+
.needs('rc')
|
|
26
|
+
.needs('auth')
|
|
27
|
+
.action((jobpoolId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
if (!fs_1.ASYNC.fileExists(constants_1.TEMPLATE.job_data)) {
|
|
29
|
+
throw new error_1.default('Could not read request template', { exit: 2 });
|
|
30
|
+
}
|
|
31
|
+
const jobData = yield fs_1.ASYNC.readFile(constants_1.TEMPLATE.job_data);
|
|
32
|
+
const jobDataJson = JSON.parse(jobData || '');
|
|
33
|
+
const jobpoolAPI = yield (0, endpoints_1.jobScheduling)();
|
|
34
|
+
const jobpoolDetails = jobpoolId
|
|
35
|
+
? yield jobpoolAPI.getJobpoolDetails(jobpoolId)
|
|
36
|
+
: yield (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
const allJobpoolDetails = yield jobpoolAPI.getJobpoolDetails();
|
|
38
|
+
if (allJobpoolDetails.length === 0) {
|
|
39
|
+
throw new error_1.default('No jobpool present in development environment', {
|
|
40
|
+
exit: 1,
|
|
41
|
+
errorId: 'JOB-1',
|
|
42
|
+
arg: [
|
|
43
|
+
(0, ansi_colors_1.bold)(`${(0, project_1.getProjectName)()} (${(0, project_1.getProjectId)()})`),
|
|
44
|
+
ansi_colors_1.italic.underline(`${constants_1.ORIGIN.console}/baas/${(0, project_1.getEnvId)()}/project/${(0, project_1.getProjectId)()}/Development#/jobscheduling/jobpool`)
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const jobpoolChoices = allJobpoolDetails.reduce((poolChoices, _pool) => {
|
|
49
|
+
if (_pool.type !== 'Function') {
|
|
50
|
+
return poolChoices;
|
|
51
|
+
}
|
|
52
|
+
poolChoices.push(prompt_1.default.choice(`${_pool.name} [${_pool.id}]`, {
|
|
53
|
+
value: _pool,
|
|
54
|
+
short: _pool.name
|
|
55
|
+
}));
|
|
56
|
+
return poolChoices;
|
|
57
|
+
}, []);
|
|
58
|
+
if (jobpoolChoices.length === 0) {
|
|
59
|
+
throw new error_1.default('No valid function jobpool available in the development environment', {
|
|
60
|
+
exit: 1,
|
|
61
|
+
errorId: 'JOB-2',
|
|
62
|
+
arg: [
|
|
63
|
+
(0, ansi_colors_1.bold)(`${(0, project_1.getProjectName)()} (${(0, project_1.getProjectId)()})`),
|
|
64
|
+
ansi_colors_1.italic.underline(`${constants_1.ORIGIN.console}/baas/${(0, project_1.getEnvId)()}/project/${(0, project_1.getProjectId)()}/Development#/jobscheduling/jobpool`)
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const jobpoolQuestion = yield prompt_1.default.ask(prompt_1.default.question('details', "Please choose one of the function jobpool's to generate the data", {
|
|
69
|
+
type: 'list',
|
|
70
|
+
choices: jobpoolChoices
|
|
71
|
+
}));
|
|
72
|
+
return jobpoolQuestion.details;
|
|
73
|
+
}))();
|
|
74
|
+
if (jobpoolDetails.type !== 'Function') {
|
|
75
|
+
throw new error_1.default(`The jobpool ${jobpoolId || jobpoolDetails.name || jobpoolDetails.id} is not a function jobpool`, {
|
|
76
|
+
exit: 1
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
jobDataJson.job_details.job_meta_details.jobpool_id = jobpoolDetails.id;
|
|
80
|
+
jobDataJson.job_details.job_meta_details.jobpool_details = jobpoolDetails;
|
|
81
|
+
process.stdout.write(JSON.stringify(jobDataJson, null, ' ') + '\n');
|
|
82
|
+
}));
|
|
@@ -45,6 +45,7 @@ exports.default = new command_1.default('functions:add')
|
|
|
45
45
|
.needs('auth', [constants_1.SCOPE.functions])
|
|
46
46
|
.needs('config')
|
|
47
47
|
.needs('rc')
|
|
48
|
+
.ci(false)
|
|
48
49
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
50
|
const config = runtime_store_1.default.get('config');
|
|
50
51
|
yield (yield Promise.resolve().then(() => __importStar(require('../../init/features')))).functions(true);
|
|
@@ -199,10 +199,8 @@ exports.default = new command_1.default('functions:delete [function_name_or_id]'
|
|
|
199
199
|
if (fn.location === remote && fn.id !== undefined) {
|
|
200
200
|
return fnApi.delete(fn.id + '');
|
|
201
201
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return (0, common_1.deleteFunctionLocal)(fn.source);
|
|
205
|
-
}
|
|
202
|
+
if (fn.source) {
|
|
203
|
+
return (0, common_1.deleteFunctionLocal)(fn.source);
|
|
206
204
|
}
|
|
207
205
|
return;
|
|
208
206
|
}));
|
|
@@ -45,6 +45,7 @@ exports.default = new command_1.default('functions:setup')
|
|
|
45
45
|
.needs('auth', [constants_1.SCOPE.functions])
|
|
46
46
|
.needs('config')
|
|
47
47
|
.needs('rc')
|
|
48
|
+
.ci(false)
|
|
48
49
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
50
|
const config = runtime_store_1.default.get('config');
|
|
50
51
|
yield (yield Promise.resolve().then(() => __importStar(require('../../init/features')))).functions();
|
|
@@ -61,6 +61,7 @@ exports.default = new command_1.default('functions:shell')
|
|
|
61
61
|
.needs('auth', constants_1.NEEDED_SCOPES.SERVE)
|
|
62
62
|
.needs('config')
|
|
63
63
|
.needs('rc')
|
|
64
|
+
.ci(false)
|
|
64
65
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
66
|
const httpOpt = (0, option_1.getOptionValue)('http', false);
|
|
66
67
|
if (httpOpt && typeof httpOpt !== 'boolean') {
|
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();
|
|
@@ -79,6 +80,7 @@ exports.default = (client) => {
|
|
|
79
80
|
loadCommand('codelib:install'),
|
|
80
81
|
loadCommand('event:generate'),
|
|
81
82
|
loadCommand('event:generate:integ'),
|
|
83
|
+
loadCommand('event:generate:job'),
|
|
82
84
|
loadCommand('serve'),
|
|
83
85
|
loadCommand('deploy'),
|
|
84
86
|
loadCommand('help'),
|
package/lib/commands/init.js
CHANGED
|
@@ -56,14 +56,10 @@ exports.default = new command_1.default('init [feature]')
|
|
|
56
56
|
.description('Initialize a Catalyst project, function, and client resources in the local directory')
|
|
57
57
|
.option('--force', 'force initialise a project for this directory')
|
|
58
58
|
.ignore(['project'])
|
|
59
|
-
.needs('auth', [
|
|
60
|
-
constants_1.SCOPE.projects,
|
|
61
|
-
constants_1.SCOPE.stratus_create,
|
|
62
|
-
constants_1.SCOPE.stratus_read,
|
|
63
|
-
constants_1.SCOPE.project_import_create
|
|
64
|
-
])
|
|
59
|
+
.needs('auth', [constants_1.SCOPE.projects, constants_1.SCOPE.project_import_create])
|
|
65
60
|
.needs('config', { optional: true })
|
|
66
61
|
.needs('rc', { optional: true, resolveOnNotFound: true })
|
|
62
|
+
.ci(false)
|
|
67
63
|
.action((feature) => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
64
|
var _a;
|
|
69
65
|
const config = runtime_store_1.default.get('config');
|
package/lib/commands/login.js
CHANGED
|
@@ -40,6 +40,7 @@ exports.default = new command_1.default('login')
|
|
|
40
40
|
.description('Log the CLI in to your Catalyst account')
|
|
41
41
|
.option('--no-localhost', 'login without browser')
|
|
42
42
|
.option('--force', 'force reauthentication')
|
|
43
|
+
.ci(false)
|
|
43
44
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
45
|
const auth = yield Promise.resolve().then(() => __importStar(require('../authentication')));
|
|
45
46
|
return auth.login();
|
package/lib/commands/logout.js
CHANGED
|
@@ -38,6 +38,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
38
38
|
const command_1 = __importDefault(require("../internal/command"));
|
|
39
39
|
exports.default = new command_1.default('logout')
|
|
40
40
|
.description('Log the CLI out of your Catalyst account')
|
|
41
|
+
.ci(false)
|
|
41
42
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
43
|
const auth = yield Promise.resolve().then(() => __importStar(require('../authentication')));
|
|
43
44
|
return auth.logout();
|
package/lib/commands/pull.js
CHANGED
|
@@ -50,6 +50,7 @@ exports.default = new command_1.default('pull [feature]')
|
|
|
50
50
|
.needs('auth', [constants_1.SCOPE.functions, constants_1.SCOPE.webapp])
|
|
51
51
|
.needs('config', { optional: true })
|
|
52
52
|
.needs('rc')
|
|
53
|
+
.ci(false)
|
|
53
54
|
.action((feature) => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
55
|
const config = runtime_store_1.default.get('config');
|
|
55
56
|
const homeDir = (yield Promise.resolve().then(() => __importStar(require('os')))).homedir();
|
package/lib/commands/serve.js
CHANGED
|
@@ -47,7 +47,7 @@ exports.default = new command_1.default('serve')
|
|
|
47
47
|
.option('--only <targets>', 'only serve specified, comma-separated targets (e.g. "client,functions:f1")')
|
|
48
48
|
.option('--no-watch', 'disable watching the files for changes')
|
|
49
49
|
.option('--except <targets>', 'serve all targets except specified (e.g. "client")')
|
|
50
|
-
.option('--ignore-scripts', 'ignore the pre and post
|
|
50
|
+
.option('--ignore-scripts', 'ignore the pre and post lifecycle scripts')
|
|
51
51
|
.option('--no-open', 'disable opening the client automatically when served')
|
|
52
52
|
.needs('auth', constants_1.NEEDED_SCOPES.SERVE)
|
|
53
53
|
.needs('config')
|
package/lib/commands/whoami.js
CHANGED
|
@@ -19,6 +19,7 @@ const command_1 = __importDefault(require("../internal/command"));
|
|
|
19
19
|
const logger_1 = require("../util_modules/logger");
|
|
20
20
|
exports.default = new command_1.default('whoami')
|
|
21
21
|
.description('Print the email address of the user currently logged in')
|
|
22
|
+
.ci(false)
|
|
22
23
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
24
|
const activeDC = (0, dc_1.getActiveDC)();
|
|
24
25
|
const user = config_store_1.default.get(`${activeDC}.user`);
|
|
@@ -57,7 +57,7 @@ function getConfigJsonInputs() {
|
|
|
57
57
|
when: () => optValues.build_path === false,
|
|
58
58
|
rootPath: cwd,
|
|
59
59
|
validate: ({ value }) => __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
const pathRes = (0, utils_1.validateBuildPath)(value);
|
|
60
|
+
const pathRes = yield (0, utils_1.validateBuildPath)(value);
|
|
61
61
|
if (!pathRes) {
|
|
62
62
|
return `Invalid path: ${value}`;
|
|
63
63
|
}
|
|
@@ -142,7 +142,9 @@ function getStandAloneTarget() {
|
|
|
142
142
|
configJson.stack = configJson.stack.runtime;
|
|
143
143
|
}
|
|
144
144
|
return {
|
|
145
|
-
|
|
145
|
+
name: nameOpt === false ? appSailName.name : nameOpt,
|
|
146
|
+
source: cwd,
|
|
147
|
+
config: configJson,
|
|
146
148
|
validity: { valid: true }
|
|
147
149
|
};
|
|
148
150
|
});
|
|
@@ -157,15 +159,15 @@ exports.default = (standAlone = false) => __awaiter(void 0, void 0, void 0, func
|
|
|
157
159
|
const filtered = (0, appsail_utils_1.filterTargets)(targets);
|
|
158
160
|
let pythonPrompt = false;
|
|
159
161
|
const validTargets = (0, appsail_utils_1.validateAppSail)(filtered).filter((targ) => {
|
|
160
|
-
var _a
|
|
162
|
+
var _a;
|
|
161
163
|
if (targ.validity.valid) {
|
|
162
164
|
if (!pythonPrompt &&
|
|
163
|
-
((_a = targ.
|
|
165
|
+
((_a = targ.config) === null || _a === void 0 ? void 0 : _a.stack.startsWith(constants_1.RUNTIME.language.python.value))) {
|
|
164
166
|
pythonPrompt = true;
|
|
165
167
|
}
|
|
166
168
|
return targ;
|
|
167
169
|
}
|
|
168
|
-
(0, logger_1.labeled)('AppSail: ', 'Invalid AppSail service ' + (0, ansi_colors_1.bold)(
|
|
170
|
+
(0, logger_1.labeled)('AppSail: ', 'Invalid AppSail service ' + (0, ansi_colors_1.bold)(targ.name || 'Unknown')).ERROR();
|
|
169
171
|
(0, logger_1.error)('Reason: ' + targ.validity.reason);
|
|
170
172
|
(0, logger_1.info)();
|
|
171
173
|
return false;
|
|
@@ -179,20 +181,19 @@ exports.default = (standAlone = false) => __awaiter(void 0, void 0, void 0, func
|
|
|
179
181
|
const throbber = throbber_1.default.getInstance();
|
|
180
182
|
const deployRes = yield validTargets.reduce((result, _targ) => __awaiter(void 0, void 0, void 0, function* () {
|
|
181
183
|
var _a, _b;
|
|
182
|
-
const targ = _targ.
|
|
184
|
+
const targ = _targ.config;
|
|
183
185
|
const prevRes = yield result;
|
|
184
186
|
try {
|
|
185
187
|
if ((_a = targ.scripts) === null || _a === void 0 ? void 0 : _a.predeploy) {
|
|
186
|
-
executeHook(targ.scripts.predeploy, 'predeploy',
|
|
188
|
+
executeHook(targ.scripts.predeploy, 'predeploy', _targ.source);
|
|
187
189
|
}
|
|
188
|
-
const throbberName = `prepare_appsail_${
|
|
190
|
+
const throbberName = `prepare_appsail_${_targ.name}`;
|
|
189
191
|
throbber.add(throbberName, {
|
|
190
|
-
text: `Preparing AppSail[${
|
|
192
|
+
text: `Preparing AppSail[${_targ.name}]`
|
|
191
193
|
});
|
|
192
194
|
const zip = new archiver_1.default();
|
|
193
|
-
const
|
|
194
|
-
const folderPath =
|
|
195
|
-
const ignoreFile = yield fs_1.ASYNC.readFile((0, path_1.join)(folderPath, constants_1.FILENAME.catalyst_ignore));
|
|
195
|
+
const ignoreFile = yield fs_1.ASYNC.readFile((0, path_1.join)(_targ.source, constants_1.FILENAME.catalyst_ignore));
|
|
196
|
+
const folderPath = targ.build_path;
|
|
196
197
|
const folderContents = yield fs_1.ASYNC.walk(folderPath, {
|
|
197
198
|
filter: {
|
|
198
199
|
exclude: [
|
|
@@ -215,19 +216,21 @@ exports.default = (standAlone = false) => __awaiter(void 0, void 0, void 0, func
|
|
|
215
216
|
const finalized = yield zip.finalize();
|
|
216
217
|
const zipStream = yield finalized.fsStream();
|
|
217
218
|
throbber.remove(throbberName);
|
|
218
|
-
const { stack,
|
|
219
|
+
const { stack, command, memory, platform, env_variables, catalyst_auth, login_redirect } = targ;
|
|
219
220
|
const apiRes = yield sailAPI.deploy(zipStream.stream, {
|
|
220
221
|
stack,
|
|
221
|
-
name,
|
|
222
|
+
name: _targ.name,
|
|
222
223
|
memory,
|
|
223
224
|
platform,
|
|
224
225
|
command,
|
|
226
|
+
catalystAuth: catalyst_auth,
|
|
227
|
+
loginRedirect: login_redirect,
|
|
225
228
|
envVariables: env_variables,
|
|
226
229
|
contentLength: zipStream.length
|
|
227
230
|
});
|
|
228
231
|
_targ.url = apiRes.url;
|
|
229
232
|
if ((_b = targ.scripts) === null || _b === void 0 ? void 0 : _b.postdeploy) {
|
|
230
|
-
executeHook(targ.scripts.postdeploy, 'postdeploy',
|
|
233
|
+
executeHook(targ.scripts.postdeploy, 'postdeploy', _targ.source);
|
|
231
234
|
}
|
|
232
235
|
}
|
|
233
236
|
catch (err) {
|
|
@@ -241,10 +244,9 @@ exports.default = (standAlone = false) => __awaiter(void 0, void 0, void 0, func
|
|
|
241
244
|
return Promise.resolve(prevRes);
|
|
242
245
|
}), Promise.resolve([]));
|
|
243
246
|
const deployedValidTargets = deployRes.filter((targ) => {
|
|
244
|
-
var _a;
|
|
245
247
|
if (!targ.validity.valid) {
|
|
246
248
|
(0, logger_1.warning)('Deploy of AppSail [' +
|
|
247
|
-
|
|
249
|
+
targ.name +
|
|
248
250
|
'] was unsuccessful since ' +
|
|
249
251
|
targ.validity.reason);
|
|
250
252
|
}
|
|
@@ -36,10 +36,10 @@ 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 = runtime_store_1.default.get('cwd');
|
|
40
40
|
if (path) {
|
|
41
41
|
const buildPath = (0, path_1.isAbsolute)(path) ? path : (0, path_1.resolve)(cwd, path);
|
|
42
|
-
return (yield fs_1.ASYNC.
|
|
42
|
+
return (yield fs_1.ASYNC.isPathExists(buildPath)) ? path : false;
|
|
43
43
|
}
|
|
44
44
|
return false;
|
|
45
45
|
});
|
|
@@ -79,11 +79,10 @@ exports.validateName = validateName;
|
|
|
79
79
|
function urlLogger() {
|
|
80
80
|
const deployTargets = runtime_store_1.default.get('payload.appsail.targets', []);
|
|
81
81
|
deployTargets.forEach((sail) => {
|
|
82
|
-
var _a, _b;
|
|
83
82
|
if (sail.url !== undefined) {
|
|
84
|
-
(0, logger_1.labeled)(`AppSail(${
|
|
83
|
+
(0, logger_1.labeled)(`AppSail(${sail.name})`, 'URL => ' + sail.url).MESSAGE();
|
|
85
84
|
}
|
|
86
|
-
(0, logger_1.labeled)(`AppSail(${
|
|
85
|
+
(0, logger_1.labeled)(`AppSail(${sail.name})`, 'deploy successful').SUCCESS();
|
|
87
86
|
(0, logger_1.info)();
|
|
88
87
|
});
|
|
89
88
|
return deployTargets;
|
package/lib/endpoints/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.tunnelAPI = exports.commonAPI = exports.codeDeck = exports.gitHubAPI = exports.appSailAPI = exports.logAPI = exports.eventBusAPI = exports.functionsAPI = exports.applogicAPI = exports.bulkDSAPI = exports.apigAPI = exports.clientAPI = exports.datastoreAPI = exports.zcqlAPI = exports.queueAPI = exports.filestoreAPI = exports.cacheAPI = exports.sdkAPI = exports.envAPI = exports.projectAPI = exports.orgAPI = void 0;
|
|
35
|
+
exports.tunnelAPI = exports.commonAPI = exports.jobScheduling = exports.codeDeck = exports.gitHubAPI = exports.appSailAPI = exports.logAPI = exports.eventBusAPI = exports.functionsAPI = exports.applogicAPI = exports.bulkDSAPI = exports.apigAPI = exports.clientAPI = exports.datastoreAPI = exports.zcqlAPI = exports.queueAPI = exports.filestoreAPI = exports.cacheAPI = exports.sdkAPI = exports.envAPI = exports.projectAPI = exports.orgAPI = void 0;
|
|
36
36
|
const project_1 = require("../util_modules/project");
|
|
37
37
|
function orgAPI({ auth = true } = {}) {
|
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -170,6 +170,13 @@ function codeDeck() {
|
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
exports.codeDeck = codeDeck;
|
|
173
|
+
function jobScheduling({ auth = true, projectId = (0, project_1.getProjectId)() } = {}) {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
const jobScheduling = (yield Promise.resolve().then(() => __importStar(require('./lib/job-scheduling')))).default;
|
|
176
|
+
return new jobScheduling(projectId, { authNeeded: auth });
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
exports.jobScheduling = jobScheduling;
|
|
173
180
|
function commonAPI() {
|
|
174
181
|
return __awaiter(this, void 0, void 0, function* () {
|
|
175
182
|
const common = (yield Promise.resolve().then(() => __importStar(require('./lib/common')))).default;
|
|
@@ -21,7 +21,7 @@ class AppSail {
|
|
|
21
21
|
this.opts = opts;
|
|
22
22
|
this.projectId = projectId;
|
|
23
23
|
}
|
|
24
|
-
deploy(sourceFsStream, { stack, name, contentLength, command, memory, platform, envVariables = {} }) {
|
|
24
|
+
deploy(sourceFsStream, { stack, name, contentLength, command, memory, platform, envVariables = {}, catalystAuth, loginRedirect }) {
|
|
25
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
const formData = {
|
|
27
27
|
stack,
|
|
@@ -43,6 +43,12 @@ class AppSail {
|
|
|
43
43
|
variables: envVariables
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
+
if (typeof catalystAuth === 'boolean') {
|
|
47
|
+
configuration.catalyst_auth = catalystAuth;
|
|
48
|
+
if (typeof loginRedirect === 'string') {
|
|
49
|
+
configuration.login_redirect = loginRedirect;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
46
52
|
if (Object.keys(configuration).length > 0) {
|
|
47
53
|
formData.configuration = JSON.stringify(configuration);
|
|
48
54
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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 error_1 = __importDefault(require("../../error"));
|
|
17
|
+
const api_1 = __importDefault(require("../../internal/api"));
|
|
18
|
+
const logger_1 = require("../../util_modules/logger");
|
|
19
|
+
class JobScheduling {
|
|
20
|
+
constructor(projectId, opts) {
|
|
21
|
+
this.opts = opts;
|
|
22
|
+
this.projectId = projectId;
|
|
23
|
+
}
|
|
24
|
+
getJobpoolDetails(id) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const res = yield new api_1.default(this.opts).get(`/baas/v1/project/${this.projectId}/job_scheduling/jobpool${id ? '/' + id : ''}`, {
|
|
27
|
+
resolveOnError: true
|
|
28
|
+
});
|
|
29
|
+
if (res.status === 200) {
|
|
30
|
+
if (res.body && res.body.data) {
|
|
31
|
+
return res.body.data;
|
|
32
|
+
}
|
|
33
|
+
(0, logger_1.debug)(`get jobpool details response from server for (${id}): ${res.body}`);
|
|
34
|
+
throw new error_1.default('Server Error: Unexpected Response from server.', {
|
|
35
|
+
exit: 2
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
if (res.status === 404 && id) {
|
|
39
|
+
const allJobpools = yield this.getJobpoolDetails();
|
|
40
|
+
throw new error_1.default(`The provided jobpool identifier (${id}) is invalid`, {
|
|
41
|
+
exit: 1,
|
|
42
|
+
context: res.body,
|
|
43
|
+
status: res.status,
|
|
44
|
+
errorId: 'JOB-SCHEDULING-1',
|
|
45
|
+
arg: [
|
|
46
|
+
(0, ansi_colors_1.bold)(id),
|
|
47
|
+
(0, ansi_colors_1.bold)(allJobpools
|
|
48
|
+
.map((pool) => `${(0, ansi_colors_1.green)('*')} ${pool.name} [${pool.id}]`)
|
|
49
|
+
.join('\n'))
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
throw new error_1.default('Error when feting details of the jobpool: ' + id, {
|
|
54
|
+
exit: 2,
|
|
55
|
+
context: res.body,
|
|
56
|
+
status: res.status
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.default = JobScheduling;
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ansi_colors_1 = require("ansi-colors");
|
|
4
4
|
exports.default = (appSailDetails) => (req, _RES, next) => {
|
|
5
|
-
var _a
|
|
5
|
+
var _a;
|
|
6
6
|
console.log('[' +
|
|
7
7
|
new Date().getTime() +
|
|
8
8
|
'] ' +
|
|
9
|
-
(appSailDetails
|
|
10
|
-
? (0, ansi_colors_1.cyan)(` Appsail[${(_b = (_a = appSailDetails === null || appSailDetails === void 0 ? void 0 : appSailDetails.target) === null || _a === void 0 ? void 0 : _a.appSail) === null || _b === void 0 ? void 0 : _b.name}] `)
|
|
11
|
-
: '') +
|
|
9
|
+
(appSailDetails ? (0, ansi_colors_1.cyan)(` Appsail[${(_a = appSailDetails === null || appSailDetails === void 0 ? void 0 : appSailDetails.target) === null || _a === void 0 ? void 0 : _a.name}] `) : '') +
|
|
12
10
|
' "' +
|
|
13
11
|
(0, ansi_colors_1.cyan)(req.method) +
|
|
14
12
|
'" ' +
|