zcatalyst-cli 1.18.0-beta.1 → 1.18.0-beta.11
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 +8 -8
- package/docs/commands/ds/import.toml +5 -5
- package/docs/commands/zest/generate/index.toml +4 -0
- package/docs/serve/server/lib/appsail/index.toml +22 -1
- package/lib/authentication/login.js +8 -4
- package/lib/code-deck.js +7 -7
- package/lib/command_needs/rc.js +7 -7
- package/lib/commands/appsail/add.js +2 -2
- package/lib/commands/client/setup.js +1 -1
- package/lib/commands/codelib/install.js +6 -2
- package/lib/commands/ds/import.js +37 -21
- package/lib/commands/event/generate/index.js +14 -2
- package/lib/commands/functions/add.js +1 -1
- package/lib/commands/functions/setup.js +1 -1
- package/lib/commands/iac/export.js +5 -1
- package/lib/commands/iac/import.js +4 -1
- package/lib/commands/index.js +1 -0
- package/lib/commands/init.js +8 -1
- package/lib/commands/zest/generate/index.js +304 -0
- package/lib/deploy/features/appsail/index.js +25 -10
- package/lib/endpoints/index.js +17 -3
- package/lib/endpoints/lib/ds-bulk.js +1 -0
- package/lib/endpoints/lib/stratus.js +63 -0
- package/lib/endpoints/lib/tunnel.js +18 -0
- package/lib/endpoints/lib/zest.js +124 -0
- package/lib/event_generate/stratus.js +52 -0
- package/lib/fn-utils/lib/common.js +6 -1
- package/lib/iac/status/deploy.js +1 -5
- package/lib/init/features/appsail/index.js +34 -27
- package/lib/init/features/project.js +6 -15
- package/lib/internal/api.js +14 -6
- package/lib/internal/command.js +1 -1
- package/lib/prompt/index.js +5 -2
- package/lib/prompt/types/file-path.js +1 -1
- package/lib/prompt/types/search-box.js +281 -0
- package/lib/serve/features/appsail.js +1 -1
- package/lib/serve/server/index.js +44 -14
- package/lib/serve/server/lib/appsail/index.js +73 -13
- package/lib/serve/server/lib/appsail/start.js +9 -1
- 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 → catalyst-function-sdk-1.1.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 +1 -1
- package/lib/serve/server/lib/master/appsail.js +3 -3
- package/lib/serve/server/lib/master/unknown-req-proxy.js +5 -2
- package/lib/serve/server/lib/master/utils.js +27 -15
- package/lib/serve/server/lib/node/index.js +1 -1
- package/lib/serve/server/lib/node/server/package-lock.json +12 -0
- package/lib/serve/server/lib/python/index.js +1 -1
- package/lib/shell/dependencies/http-functions.js +1 -1
- package/lib/shell/dependencies/invoker/bio/java/lib/{catalyst-function-sdk-1.0.0.jar → catalyst-function-sdk-1.1.0.jar} +0 -0
- package/lib/shell/dependencies/invoker/cron/java/JavacronInvoker.java +1 -1
- package/lib/shell/dependencies/invoker/cron/java/lib/{catalyst-function-sdk-1.0.0.jar → catalyst-function-sdk-1.1.0.jar} +0 -0
- package/lib/shell/dependencies/invoker/event/java/lib/{catalyst-function-sdk-1.0.0.jar → catalyst-function-sdk-1.1.0.jar} +0 -0
- package/lib/shell/dependencies/invoker/integ/java/JavaintegInvoker.java +15 -0
- package/lib/shell/dependencies/invoker/integ/java/lib/catalyst-function-sdk-1.1.0.jar +0 -0
- package/lib/shell/dependencies/invoker/integ/node.mjs +13 -0
- package/lib/shell/dependencies/invoker/job/java/JavajobInvoker.java +15 -1
- package/lib/shell/dependencies/invoker/job/java/lib/catalyst-function-sdk-1.1.0.jar +0 -0
- package/lib/shell/dependencies/local-function.js +24 -23
- package/lib/shell/dependencies/tunnel-server.js +52 -23
- package/lib/shell/index.js +22 -28
- package/lib/util_modules/config/lib/appsail.js +10 -8
- package/lib/util_modules/constants/lib/cliq-handlers.js +18 -10
- package/lib/util_modules/constants/lib/dc-type.js +8 -0
- package/lib/util_modules/constants/lib/event-action.js +1 -0
- package/lib/util_modules/constants/lib/event-source.js +1 -0
- package/lib/util_modules/constants/lib/placeholders.js +2 -1
- package/lib/util_modules/constants/lib/scopes.js +14 -3
- package/lib/util_modules/constants/lib/urls.js +8 -0
- package/lib/util_modules/fs/lib/async.js +7 -2
- package/package.json +4 -2
- package/templates/event/integ/cliq/bot/action_handler.json +13 -4
- package/templates/event/integ/cliq/bot/call_handler.json +41 -0
- package/templates/event/integ/cliq/bot/context_handler.json +11 -3
- package/templates/event/integ/cliq/bot/incomingwebhook_handler.json +11 -3
- package/templates/event/integ/cliq/bot/mention_handler.json +12 -4
- package/templates/event/integ/cliq/bot/message_handler.json +13 -4
- package/templates/event/integ/cliq/bot/participation_handler.json +13 -3
- package/templates/event/integ/cliq/bot/welcome_handler.json +12 -8
- package/templates/event/integ/cliq/command/execution_handler.json +12 -3
- package/templates/event/integ/cliq/command/suggestion_handler.json +18 -4
- package/templates/event/integ/cliq/{installation → extension}/installation_handler.json +13 -4
- package/templates/event/integ/cliq/{installation → extension}/installation_validator.json +13 -5
- package/templates/event/integ/cliq/extension/uninstallation_handler.json +37 -0
- package/templates/event/integ/cliq/function/button_handler.json +13 -5
- package/templates/event/integ/cliq/function/form_change_handler.json +9 -3
- package/templates/event/integ/cliq/function/form_handler.json +11 -3
- package/templates/event/integ/cliq/function/form_values_handler.json +9 -3
- package/templates/event/integ/cliq/function/form_view_handler.json +26 -0
- package/templates/event/integ/cliq/function/widget_button_handler.json +14 -5
- package/templates/event/integ/cliq/link_preview/action_handler.json +54 -0
- package/templates/event/integ/cliq/link_preview/after_send_handler.json +47 -0
- package/templates/event/integ/cliq/link_preview/menu_handler.json +47 -0
- package/templates/event/integ/cliq/link_preview/preview_handler.json +47 -0
- package/templates/event/integ/cliq/messageaction/execution_handler.json +11 -3
- package/templates/event/integ/cliq/widget/view_handler.json +12 -4
- package/templates/init/client/react/react_js/template/src/index.js +3 -3
- package/templates/init/client/react/react_ts/template/src/index.tsx +3 -3
- package/templates/init/client/react/react_ts/template.json +3 -3
- package/templates/init/functions/java/integ/cliq/com/handlers/BotHandler.java +29 -23
- package/templates/init/functions/java/integ/cliq/com/handlers/CommandHandler.java +14 -17
- package/templates/init/functions/java/integ/cliq/com/handlers/ExtensionHandler.java +41 -0
- package/templates/init/functions/java/integ/cliq/com/handlers/FunctionHandler.java +74 -22
- package/templates/init/functions/java/integ/cliq/com/handlers/LinkPreviewHandler.java +108 -0
- package/templates/init/functions/java/integ/cliq/com/handlers/MessageActionHandler.java +6 -8
- package/templates/init/functions/java/integ/cliq/sample.java +10 -0
- package/templates/init/functions/java/job/sample.java +1 -1
- package/templates/init/functions/node/aio/sample.js +7 -0
- package/templates/init/functions/node/bio/sample.js +5 -0
- package/templates/init/functions/node/bio/types/basicio.d.ts +57 -0
- package/templates/init/functions/node/cron/sample.js +5 -0
- package/templates/init/functions/node/cron/types/cron.d.ts +64 -0
- package/templates/init/functions/node/event/sample.js +11 -8
- package/templates/init/functions/node/event/types/event.d.ts +82 -0
- package/templates/init/functions/node/integ/cliq/handlers/bot-handler.js +4 -0
- package/templates/init/functions/node/integ/cliq/handlers/command-handler.js +3 -5
- package/templates/init/functions/node/integ/cliq/handlers/{installation-validator.js → extension-handler.js} +20 -3
- package/templates/init/functions/node/integ/cliq/handlers/function-handler.js +42 -0
- package/templates/init/functions/node/integ/cliq/handlers/link-preview-handler.js +73 -0
- package/templates/init/functions/node/job/sample.js +0 -1
- package/templates/init/functions/node/job/types/job.d.ts +0 -4
- package/templates/init/functions/python/integ/cliq/handlers/bot_handler.py +13 -3
- package/templates/init/functions/python/integ/cliq/handlers/command_handler.py +7 -7
- package/templates/init/functions/python/integ/cliq/handlers/extension_handler.py +25 -0
- package/templates/init/functions/python/integ/cliq/handlers/function_handler.py +54 -10
- package/templates/init/functions/python/integ/cliq/handlers/link_preview_handler.py +76 -0
- package/templates/init/functions/python/integ/cliq/handlers/widget_handler.py +10 -9
- package/templates/init/functions/python/integ/cliq/sample.py +2 -2
- package/templates/init/functions/python/job/sample.py +0 -1
- package/templates/init.txt +2 -1
- package/lib/shell/dependencies/invoker/integ/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
- package/lib/shell/dependencies/invoker/job/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
- package/templates/init/functions/java/integ/cliq/com/handlers/InstallationHandler.java +0 -20
- package/templates/init/functions/java/integ/cliq/com/handlers/InstallationValidator.java +0 -22
- package/templates/init/functions/node/integ/cliq/handlers/installation-handler.js +0 -15
- package/templates/init/functions/python/integ/cliq/handlers/installation_handler.py +0 -12
- package/templates/init/functions/python/integ/cliq/handlers/installation_validator.py +0 -16
|
@@ -97,7 +97,7 @@ class LocalFunction {
|
|
|
97
97
|
return new error_1.default('Invalid input');
|
|
98
98
|
}
|
|
99
99
|
return (() => __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
100
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
101
101
|
const projectRoot = runtime_store_1.default.get('project.root');
|
|
102
102
|
const accessToken = yield credential_1.default.getAccessToken();
|
|
103
103
|
const slaveOptions = [];
|
|
@@ -105,9 +105,9 @@ class LocalFunction {
|
|
|
105
105
|
yield fs_1.ASYNC.ensureFile(this.responseFile, true);
|
|
106
106
|
yield fs_1.ASYNC.ensureFile(this.metaFile, true);
|
|
107
107
|
if (this.target.type === constants_1.FN_TYPE.job) {
|
|
108
|
-
const
|
|
108
|
+
const jobData = data;
|
|
109
109
|
const jobMetaDetails = {
|
|
110
|
-
headers: Object.assign(Object.assign({}, (_a =
|
|
110
|
+
headers: Object.assign(Object.assign({}, (_b = (_a = jobData === null || jobData === void 0 ? void 0 : jobData.job_details) === null || _a === void 0 ? void 0 : _a.job_meta_details) === null || _b === void 0 ? void 0 : _b.headers), {
|
|
111
111
|
'x-zc-projectid': (0, project_1.getProjectId)(),
|
|
112
112
|
'x-zc-project-domain': (0, project_1.getDomainPrefix)() + '.' + constants_1.ORIGIN.app.replace('https://', ''),
|
|
113
113
|
'x-zc-project-key': (0, project_1.getDomainKey)(),
|
|
@@ -118,8 +118,8 @@ class LocalFunction {
|
|
|
118
118
|
'x-zc-admin-cred-token': accessToken,
|
|
119
119
|
'x-zc-user-type': 'admin'
|
|
120
120
|
}),
|
|
121
|
-
params: ((
|
|
122
|
-
jobpool_details: ((
|
|
121
|
+
params: ((_d = (_c = jobData === null || jobData === void 0 ? void 0 : jobData.job_details) === null || _c === void 0 ? void 0 : _c.job_meta_details) === null || _d === void 0 ? void 0 : _d.params) || {},
|
|
122
|
+
jobpool_details: ((_f = (_e = jobData === null || jobData === void 0 ? void 0 : jobData.job_details) === null || _e === void 0 ? void 0 : _e.job_meta_details) === null || _f === void 0 ? void 0 : _f.jobpool_details) || {
|
|
123
123
|
type: 'Function',
|
|
124
124
|
project_details: {
|
|
125
125
|
project_name: (0, project_1.getProjectName)(),
|
|
@@ -127,14 +127,14 @@ class LocalFunction {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
jobData.job_details = Object.assign(Object.assign({}, jobData.job_details), { job_meta_details: jobMetaDetails });
|
|
131
|
+
jobData.capacity = jobData.capacity || {
|
|
132
132
|
memory: '256'
|
|
133
133
|
};
|
|
134
|
-
data =
|
|
134
|
+
data = jobData;
|
|
135
135
|
}
|
|
136
136
|
const slaveFnTarget = { index: this.target.index, name: this.target.name };
|
|
137
|
-
if ((
|
|
137
|
+
if ((_g = this.target.stack) === null || _g === void 0 ? void 0 : _g.startsWith(runtime_1.default.language.node.value)) {
|
|
138
138
|
if (debugPort !== null) {
|
|
139
139
|
slaveOptions.push('--inspect-brk=' + debugPort);
|
|
140
140
|
}
|
|
@@ -158,10 +158,10 @@ class LocalFunction {
|
|
|
158
158
|
this.slave = (0, shell_1.spawn)('node', slaveOptions, {
|
|
159
159
|
cwd: (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build, constants_1.FOLDERNAME.functions, this.target.name),
|
|
160
160
|
stdio: 'pipe',
|
|
161
|
-
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_RESOURCE_ID: (
|
|
161
|
+
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_RESOURCE_ID: (_h = this.target) === null || _h === void 0 ? void 0 : _h.id, X_ZOHO_STRATUS_RESOURCE_SUFFIX: constants_1.ORIGIN.stratusSuffix, CATALYST_PORTAL_DOMAIN: constants_1.ORIGIN.iamPortal, CATALYST_PROJECT_TIMEZONE: (0, project_1.getProjectTimezone)(Intl.DateTimeFormat().resolvedOptions().timeZone) }, this.target.env_var)
|
|
162
162
|
}).RAW();
|
|
163
163
|
}
|
|
164
|
-
else if ((
|
|
164
|
+
else if ((_j = this.target.stack) === null || _j === void 0 ? void 0 : _j.startsWith(runtime_1.default.language.java.value)) {
|
|
165
165
|
const javaInvokerDir = (0, path_1.parse)(this.javaInvoker).dir;
|
|
166
166
|
slaveOptions.push('-cp');
|
|
167
167
|
slaveOptions.push(javaInvokerDir +
|
|
@@ -196,11 +196,11 @@ class LocalFunction {
|
|
|
196
196
|
this.slave = (0, shell_1.spawn)(spawnCommand, slaveOptions, {
|
|
197
197
|
cwd: (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build, constants_1.FOLDERNAME.functions, this.target.name),
|
|
198
198
|
stdio: 'pipe',
|
|
199
|
-
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_RESOURCE_ID: (
|
|
199
|
+
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_RESOURCE_ID: (_k = this.target) === null || _k === void 0 ? void 0 : _k.id, X_ZOHO_STRATUS_RESOURCE_SUFFIX: constants_1.ORIGIN.stratusSuffix, CATALYST_PORTAL_DOMAIN: constants_1.ORIGIN.iamPortal, CATALYST_PROJECT_TIMEZONE: (0, project_1.getProjectTimezone)(Intl.DateTimeFormat().resolvedOptions().timeZone) }, this.target.env_var)
|
|
200
200
|
}).RAW();
|
|
201
201
|
}
|
|
202
|
-
else if ((
|
|
203
|
-
const stackVersion = (
|
|
202
|
+
else if ((_l = this.target.stack) === null || _l === void 0 ? void 0 : _l.startsWith(runtime_1.default.language.python.value)) {
|
|
203
|
+
const stackVersion = (_m = this.target.stack) === null || _m === void 0 ? void 0 : _m.replace('python_', '');
|
|
204
204
|
const runtimesDir = constants_1.ENVPATH.runtimes.data;
|
|
205
205
|
const httpPort = parseInt(runtime_store_1.default.get('context.port.http.' + constants_1.REMOTE_REF.functions.type[constants_1.FN_TYPE.basic]), 10);
|
|
206
206
|
const runTimePort = yield port_resolver_1.default.getFreePort(httpPort, 20, false);
|
|
@@ -211,10 +211,10 @@ class LocalFunction {
|
|
|
211
211
|
this.slave = (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), slaveOptions, {
|
|
212
212
|
cwd: (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build, constants_1.FOLDERNAME.functions, this.target.name),
|
|
213
213
|
stdio: 'pipe',
|
|
214
|
-
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_RESOURCE_ID: (
|
|
214
|
+
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_RESOURCE_ID: (_o = this.target) === null || _o === void 0 ? void 0 : _o.id, X_ZOHO_STRATUS_RESOURCE_SUFFIX: constants_1.ORIGIN.stratusSuffix, CATALYST_PORTAL_DOMAIN: constants_1.ORIGIN.iamPortal, X_ZOHO_CATALYST_CODE_LOCATION: (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build, constants_1.FOLDERNAME.functions, this.target.name), X_ZOHO_CATALYST_SERVER_LISTEN_PORT: runTimePort.toString(), X_ZOHO_DATA_URL: `http://localhost:${runTimePort}/data`, X_ZOHO_CALLBACK_URL: `http://localhost:${runTimePort}/callback`, CATALYST_PROJECT_TIMEZONE: (0, project_1.getProjectTimezone)(Intl.DateTimeFormat().resolvedOptions().timeZone), X_ZOHO_ADMIN_CRED_TOKEN: 'dummy', X_ZOHO_PROJECT_SECRET_KEY: 'dummy', X_ZOHO_CATALYST_ORG: (0, project_1.getEnvId)(), X_ZOHO_CATALYST_ENVIRONMENT: 'Local', X_ZOHO_JOBMETA_JOBID: 'dummy', CATALYST_FUNCTION_TYPE: constants_1.REMOTE_REF.functions.type[this.target.type] }, this.target.env_var)
|
|
215
215
|
}).RAW();
|
|
216
216
|
this.slave.once('spawn', () => __awaiter(this, void 0, void 0, function* () {
|
|
217
|
-
var
|
|
217
|
+
var _r;
|
|
218
218
|
const jsonData = data;
|
|
219
219
|
jsonData.timestamp = Date.now();
|
|
220
220
|
const writeResponse = (response, status) => {
|
|
@@ -223,15 +223,15 @@ class LocalFunction {
|
|
|
223
223
|
};
|
|
224
224
|
if (this.target.type === constants_1.FN_TYPE.job) {
|
|
225
225
|
const jobDetailsServer = new http_1.Server((serverReq, serverRes) => __awaiter(this, void 0, void 0, function* () {
|
|
226
|
-
var
|
|
227
|
-
if ((
|
|
226
|
+
var _s, _t, _u;
|
|
227
|
+
if ((_s = serverReq.url) === null || _s === void 0 ? void 0 : _s.includes('data')) {
|
|
228
228
|
serverRes.writeHead(200);
|
|
229
229
|
serverRes.write(JSON.stringify({
|
|
230
230
|
data: jsonData
|
|
231
231
|
}));
|
|
232
232
|
serverRes.end();
|
|
233
233
|
}
|
|
234
|
-
else if ((
|
|
234
|
+
else if ((_t = serverReq.url) === null || _t === void 0 ? void 0 : _t.includes('callback')) {
|
|
235
235
|
const reqData = yield new Promise((resolve) => {
|
|
236
236
|
const data = [];
|
|
237
237
|
serverReq.on('data', (chunk) => data.push(chunk));
|
|
@@ -262,7 +262,7 @@ class LocalFunction {
|
|
|
262
262
|
else {
|
|
263
263
|
(0, logger_1.debug)(`Invalid request: (${serverReq.method}) ${serverReq.url}`);
|
|
264
264
|
writeResponse('INTERNAL_SERVER_ERROR', 500);
|
|
265
|
-
(
|
|
265
|
+
(_u = this.slave) === null || _u === void 0 ? void 0 : _u.kill('SIGINT');
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
268
|
}));
|
|
@@ -270,7 +270,7 @@ class LocalFunction {
|
|
|
270
270
|
jobDetailsServer.listen(runTimePort, () => {
|
|
271
271
|
(0, logger_1.debug)('server listening on port :' + runTimePort);
|
|
272
272
|
});
|
|
273
|
-
(
|
|
273
|
+
(_r = this.slave) === null || _r === void 0 ? void 0 : _r.once('exit', () => {
|
|
274
274
|
jobConnDestroyer.destroy();
|
|
275
275
|
});
|
|
276
276
|
return;
|
|
@@ -347,11 +347,11 @@ class LocalFunction {
|
|
|
347
347
|
exit: 2
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
|
-
(
|
|
350
|
+
(_p = this.slave.stdout) === null || _p === void 0 ? void 0 : _p.on('data', (message) => {
|
|
351
351
|
(0, shell_1.clearLine)(process.stdout);
|
|
352
352
|
(0, logger_1.info)(message.toString());
|
|
353
353
|
});
|
|
354
|
-
(
|
|
354
|
+
(_q = this.slave.stderr) === null || _q === void 0 ? void 0 : _q.on('data', (message) => {
|
|
355
355
|
const errorStr = js_1.JS.trim(message.toString());
|
|
356
356
|
(0, shell_1.clearLine)(process.stdout);
|
|
357
357
|
(0, logger_1.info)(errorStr);
|
|
@@ -379,6 +379,7 @@ class LocalFunction {
|
|
|
379
379
|
});
|
|
380
380
|
break;
|
|
381
381
|
case constants_1.FN_TYPE.cron:
|
|
382
|
+
case constants_1.FN_TYPE.job:
|
|
382
383
|
case constants_1.FN_TYPE.event:
|
|
383
384
|
(0, logger_1.info)(`[status - ${this.target.name}] ${response || 'Unknown'}`);
|
|
384
385
|
if (!response) {
|
|
@@ -33,6 +33,7 @@ const server_1 = require("../../util_modules/server");
|
|
|
33
33
|
const ansi_colors_1 = require("ansi-colors");
|
|
34
34
|
const util_1 = require("util");
|
|
35
35
|
const project_1 = require("../../util_modules/project");
|
|
36
|
+
const endpoints_1 = require("../../endpoints");
|
|
36
37
|
class TunnelServer {
|
|
37
38
|
constructor(repel) {
|
|
38
39
|
_TunnelServer_contextMap.set(this, {});
|
|
@@ -42,6 +43,29 @@ class TunnelServer {
|
|
|
42
43
|
_TunnelServer_projectId.set(this, (0, project_1.getProjectId)());
|
|
43
44
|
__classPrivateFieldSet(this, _TunnelServer_repel, repel, "f");
|
|
44
45
|
}
|
|
46
|
+
isAsyncFn(fnType) {
|
|
47
|
+
switch (fnType) {
|
|
48
|
+
case 'cron':
|
|
49
|
+
case 'event':
|
|
50
|
+
case 'job': {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
send(req, res, status = 200, data, contentType) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const body = req.body;
|
|
59
|
+
if (this.isAsyncFn(body.function_details.function_type)) {
|
|
60
|
+
const tunnelAPI = yield (0, endpoints_1.tunnelAPI)();
|
|
61
|
+
yield tunnelAPI.tunnelCallback(status, body.default, data);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
contentType && res.contentType(contentType);
|
|
65
|
+
res.status(status);
|
|
66
|
+
res.send(data);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
45
69
|
startServer() {
|
|
46
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
71
|
const tunnelPortOpt = Number.parseInt(runtime_store_1.default.get('context.port.tunnel'));
|
|
@@ -59,23 +83,33 @@ class TunnelServer {
|
|
|
59
83
|
const app = (0, express_1.default)();
|
|
60
84
|
app.use(express_1.default.json());
|
|
61
85
|
app.all('/', (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
if (req.method !== 'POST') {
|
|
87
|
+
res.status(200);
|
|
88
|
+
res.send();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const body = req.body;
|
|
92
|
+
if (!body.function_details ||
|
|
93
|
+
!body.function_data ||
|
|
94
|
+
(body.function_details.function_type !== 'integration' && !body.default)) {
|
|
95
|
+
res.status(400);
|
|
96
|
+
res.send();
|
|
97
|
+
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write();
|
|
98
|
+
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write('Invalid tunnel request: ' + (0, util_1.inspect)(body));
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (this.isAsyncFn(body.function_details.function_type)) {
|
|
102
|
+
res.status(200);
|
|
103
|
+
res.send();
|
|
104
|
+
}
|
|
62
105
|
try {
|
|
63
|
-
const body = req.body;
|
|
64
|
-
if (!body.function_details || !body.function_data) {
|
|
65
|
-
res.status(400);
|
|
66
|
-
res.send();
|
|
67
|
-
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write();
|
|
68
|
-
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write('Invalid tunnel request: ' + (0, util_1.inspect)(body));
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
106
|
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write();
|
|
72
107
|
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write((0, ansi_colors_1.bold)(`Received tunnel request from ${body.function_details.function_name}(${body.function_details.function_id})`));
|
|
73
108
|
const target = body.function_details.function_id in __classPrivateFieldGet(this, _TunnelServer_contextMap, "f")
|
|
74
109
|
? __classPrivateFieldGet(this, _TunnelServer_contextMap, "f")[body.function_details.function_id]
|
|
75
|
-
: (() => {
|
|
110
|
+
: yield (() => __awaiter(this, void 0, void 0, function* () {
|
|
76
111
|
if (__classPrivateFieldGet(this, _TunnelServer_projectId, "f") !== body.function_details.project_id) {
|
|
77
|
-
|
|
78
|
-
res.send();
|
|
112
|
+
yield this.send(req, res, 403);
|
|
79
113
|
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write();
|
|
80
114
|
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write('Invalid access: the tunnel is trying to access the functions from a different project');
|
|
81
115
|
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write();
|
|
@@ -87,15 +121,14 @@ class TunnelServer {
|
|
|
87
121
|
if (namedFn) {
|
|
88
122
|
return namedFn;
|
|
89
123
|
}
|
|
90
|
-
|
|
91
|
-
res.send();
|
|
124
|
+
yield this.send(req, res, 404);
|
|
92
125
|
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write();
|
|
93
126
|
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write(`The tunneled function ${(0, ansi_colors_1.bold)(body.function_details.function_name)} is not present in local project directory`);
|
|
94
127
|
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write();
|
|
95
128
|
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write('[STATUS]');
|
|
96
129
|
__classPrivateFieldGet(this, _TunnelServer_repel, "f").write('NOT_FOUND');
|
|
97
130
|
return;
|
|
98
|
-
}).bind(this)();
|
|
131
|
+
})).bind(this)();
|
|
99
132
|
if (!target) {
|
|
100
133
|
return;
|
|
101
134
|
}
|
|
@@ -103,11 +136,10 @@ class TunnelServer {
|
|
|
103
136
|
? JSON.parse(body.function_data)
|
|
104
137
|
: body.function_data;
|
|
105
138
|
target.call(false)(fnData);
|
|
106
|
-
const errorHandler = (e) => {
|
|
107
|
-
|
|
108
|
-
res.send();
|
|
139
|
+
const errorHandler = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
yield this.send(req, res, 500);
|
|
109
141
|
(0, logger_1.debug)('Target error: ' + e);
|
|
110
|
-
};
|
|
142
|
+
});
|
|
111
143
|
target.once('error', errorHandler);
|
|
112
144
|
const response = yield new Promise((resolve, reject) => {
|
|
113
145
|
target.once('response', (response) => {
|
|
@@ -118,13 +150,10 @@ class TunnelServer {
|
|
|
118
150
|
resolve(response);
|
|
119
151
|
});
|
|
120
152
|
});
|
|
121
|
-
|
|
122
|
-
res.status(response.status || 200);
|
|
123
|
-
res.send(response.responseBody);
|
|
153
|
+
yield this.send(req, res, response.status, response.responseBody, response.ContentType);
|
|
124
154
|
}
|
|
125
155
|
catch (e) {
|
|
126
|
-
|
|
127
|
-
res.send();
|
|
156
|
+
yield this.send(req, res, 500);
|
|
128
157
|
(0, logger_1.debug)(e);
|
|
129
158
|
}
|
|
130
159
|
}));
|
package/lib/shell/index.js
CHANGED
|
@@ -49,35 +49,29 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
49
49
|
const httpServer = new http_functions_1.default({ repl: replServer });
|
|
50
50
|
const tunnelServer = new tunnel_server_1.default(replServer);
|
|
51
51
|
const projectRoot = runtime_store_1.default.get('project.root');
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
(0, logger_js_1.warning)(
|
|
65
|
-
target.name +
|
|
66
|
-
'] is not a valid one reason : ' +
|
|
67
|
-
target.failure_reason);
|
|
68
|
-
Array.isArray(target.compilationError) &&
|
|
69
|
-
target.compilationError.forEach((er) => (0, logger_js_1.error)(er));
|
|
70
|
-
Array.isArray(target.compilationWarning) &&
|
|
71
|
-
target.compilationWarning.forEach((warn) => (0, logger_js_1.warning)(warn));
|
|
72
|
-
}
|
|
73
|
-
return target.valid;
|
|
74
|
-
});
|
|
75
|
-
if (targets.length === 0) {
|
|
76
|
-
throw new error_1.default('No functions are ready for serving', {
|
|
77
|
-
exit: 0,
|
|
78
|
-
errorId: 'SHELL-IDX-1'
|
|
79
|
-
});
|
|
52
|
+
yield (0, prepare_1.default)([constants_1.FN_TYPE.basic, constants_1.FN_TYPE.cron, constants_1.FN_TYPE.event, constants_1.FN_TYPE.integration, constants_1.FN_TYPE.job]);
|
|
53
|
+
const targets = runtime_store_1.default
|
|
54
|
+
.get('context.functions.targets', [])
|
|
55
|
+
.filter((target) => {
|
|
56
|
+
if (!target.valid) {
|
|
57
|
+
(0, logger_js_1.warning)('target [' +
|
|
58
|
+
target.name +
|
|
59
|
+
'] is not a valid one reason : ' +
|
|
60
|
+
target.failure_reason);
|
|
61
|
+
Array.isArray(target.compilationError) &&
|
|
62
|
+
target.compilationError.forEach((er) => (0, logger_js_1.error)(er));
|
|
63
|
+
Array.isArray(target.compilationWarning) &&
|
|
64
|
+
target.compilationWarning.forEach((warn) => (0, logger_js_1.warning)(warn));
|
|
80
65
|
}
|
|
66
|
+
return target.valid;
|
|
67
|
+
});
|
|
68
|
+
if (targets.length === 0) {
|
|
69
|
+
throw new error_1.default('No functions are ready for serving', {
|
|
70
|
+
exit: 0,
|
|
71
|
+
errorId: 'SHELL-IDX-1'
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
81
75
|
replServer.start();
|
|
82
76
|
yield tunnelServer.startServer();
|
|
83
77
|
const tunnelUrl = runtime_store_1.default.get('context.fn_shell.enable_tunnel', undefined);
|
|
@@ -26,6 +26,8 @@ function validateConfig(source, configJson) {
|
|
|
26
26
|
reason: 'Config file is empty'
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
+
const sourcePath = (0, path_1.join)((0, project_1.getProjectRoot)(), source);
|
|
30
|
+
configJson.raw.source_path = sourcePath;
|
|
29
31
|
if (configJson.buildPath || configJson.build_path) {
|
|
30
32
|
const buildPath = configJson.build_path || configJson.buildPath;
|
|
31
33
|
if (!buildPath) {
|
|
@@ -34,14 +36,9 @@ function validateConfig(source, configJson) {
|
|
|
34
36
|
reason: 'Build Path not present'
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
|
-
const absolutePath = (0, path_1.isAbsolute)(buildPath) ? buildPath : (0, path_1.resolve)(
|
|
38
|
-
if (!fs_1.SYNC.pathExists(absolutePath)) {
|
|
39
|
-
return {
|
|
40
|
-
valid: false,
|
|
41
|
-
reason: 'Build Path does not exists'
|
|
42
|
-
};
|
|
43
|
-
}
|
|
39
|
+
const absolutePath = (0, path_1.isAbsolute)(buildPath) ? buildPath : (0, path_1.resolve)(sourcePath, buildPath);
|
|
44
40
|
configJson.build_path = absolutePath;
|
|
41
|
+
configJson.raw.build_path = buildPath;
|
|
45
42
|
}
|
|
46
43
|
if (configJson.catalyst_auth === true) {
|
|
47
44
|
if (configJson.login_redirect === undefined) {
|
|
@@ -78,7 +75,11 @@ function raw(throwError = false) {
|
|
|
78
75
|
}
|
|
79
76
|
return;
|
|
80
77
|
}
|
|
81
|
-
|
|
78
|
+
const appsailConfig = config.get('appsail');
|
|
79
|
+
return appsailConfig === null || appsailConfig === void 0 ? void 0 : appsailConfig.map((_conf) => {
|
|
80
|
+
_conf.source = (0, path_1.isAbsolute)(_conf.source) ? _conf.source : (0, path_1.normalize)(_conf.source);
|
|
81
|
+
return _conf;
|
|
82
|
+
});
|
|
82
83
|
}
|
|
83
84
|
exports.raw = raw;
|
|
84
85
|
function getTargetDetails(name) {
|
|
@@ -123,6 +124,7 @@ function getAllTargetDetails(throwErr = true) {
|
|
|
123
124
|
resArr.push(new Promise((res) => __awaiter(this, void 0, void 0, function* () {
|
|
124
125
|
try {
|
|
125
126
|
const configJson = yield fs_1.ASYNC.readJSONFile(catalystConfigPth);
|
|
127
|
+
configJson && (configJson.raw = {});
|
|
126
128
|
const validity = validateConfig(target.source, configJson);
|
|
127
129
|
return res(Object.assign({ config: configJson, validity }, target));
|
|
128
130
|
}
|
|
@@ -13,8 +13,8 @@ const handlers = {
|
|
|
13
13
|
messageaction_handler: 'messageaction_handler',
|
|
14
14
|
widget_handler: 'widget_handler',
|
|
15
15
|
function_handler: 'function_handler',
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
extension_handler: 'extension_handler',
|
|
17
|
+
link_preview_handler: 'link_preview_handler'
|
|
18
18
|
};
|
|
19
19
|
exports.default = Object.freeze({
|
|
20
20
|
event_template_dir: (0, path_1.join)(template_root, './event/integ/cliq/'),
|
|
@@ -43,8 +43,8 @@ exports.default = Object.freeze({
|
|
|
43
43
|
[handlers.messageaction_handler]: 'message-action-handler.js',
|
|
44
44
|
[handlers.widget_handler]: 'widget-handler.js',
|
|
45
45
|
[handlers.function_handler]: 'function-handler.js',
|
|
46
|
-
[handlers.
|
|
47
|
-
[handlers.
|
|
46
|
+
[handlers.extension_handler]: 'extension-handler.js',
|
|
47
|
+
[handlers.link_preview_handler]: 'link-preview-handler.js'
|
|
48
48
|
},
|
|
49
49
|
java_handler_file_mapping: {
|
|
50
50
|
[handlers.bot_handler]: 'BotHandler.java',
|
|
@@ -52,8 +52,8 @@ exports.default = Object.freeze({
|
|
|
52
52
|
[handlers.messageaction_handler]: 'MessageActionHandler.java',
|
|
53
53
|
[handlers.widget_handler]: 'WidgetHandler.java',
|
|
54
54
|
[handlers.function_handler]: 'FunctionHandler.java',
|
|
55
|
-
[handlers.
|
|
56
|
-
[handlers.
|
|
55
|
+
[handlers.extension_handler]: 'ExtensionHandler.java',
|
|
56
|
+
[handlers.link_preview_handler]: 'LinkPreviewHandler.java'
|
|
57
57
|
},
|
|
58
58
|
python_handler_file_mapping: {
|
|
59
59
|
[handlers.bot_handler]: 'bot_handler.py',
|
|
@@ -61,8 +61,8 @@ exports.default = Object.freeze({
|
|
|
61
61
|
[handlers.messageaction_handler]: 'message_action_handler.py',
|
|
62
62
|
[handlers.widget_handler]: 'widget_handler.py',
|
|
63
63
|
[handlers.function_handler]: 'function_handler.py',
|
|
64
|
-
[handlers.
|
|
65
|
-
[handlers.
|
|
64
|
+
[handlers.extension_handler]: 'extension_handler.py',
|
|
65
|
+
[handlers.link_preview_handler]: 'link_preview_handler.py'
|
|
66
66
|
},
|
|
67
67
|
handlers_event_template: {
|
|
68
68
|
['bot']: [
|
|
@@ -72,7 +72,8 @@ exports.default = Object.freeze({
|
|
|
72
72
|
'mention_handler',
|
|
73
73
|
'action_handler',
|
|
74
74
|
'incomingwebhook_handler',
|
|
75
|
-
'participation_handler'
|
|
75
|
+
'participation_handler',
|
|
76
|
+
'call_handler'
|
|
76
77
|
],
|
|
77
78
|
['command']: ['execution_handler', 'suggestion_handler'],
|
|
78
79
|
['messageaction']: ['execution_handler'],
|
|
@@ -82,8 +83,15 @@ exports.default = Object.freeze({
|
|
|
82
83
|
'form_handler',
|
|
83
84
|
'form_change_handler',
|
|
84
85
|
'form_values_handler',
|
|
86
|
+
'form_view_handler',
|
|
85
87
|
'widget_button_handler'
|
|
86
88
|
],
|
|
87
|
-
['
|
|
89
|
+
['extension']: ['installation_handler', 'installation_validator', 'uninstallation_handler'],
|
|
90
|
+
['link_preview']: [
|
|
91
|
+
'preview_handler',
|
|
92
|
+
'action_handler',
|
|
93
|
+
'menu_handler',
|
|
94
|
+
'after_send_handler'
|
|
95
|
+
]
|
|
88
96
|
}
|
|
89
97
|
});
|
|
@@ -9,6 +9,7 @@ exports.default = Object.freeze({
|
|
|
9
9
|
[event_source_1.default.cache]: ['Put'],
|
|
10
10
|
[event_source_1.default.user]: ['SignUp', 'Delete'],
|
|
11
11
|
[event_source_1.default.filestore]: ['Upload', 'Download'],
|
|
12
|
+
[event_source_1.default.stratus]: ['Object Upload', 'Object Download', 'Object Update', 'Object Delete'],
|
|
12
13
|
[event_source_1.default.webapp]: ['Success'],
|
|
13
14
|
[event_source_1.default.github]: ['Success', 'Failure'],
|
|
14
15
|
[event_source_1.default.custom]: ['Produce']
|
|
@@ -66,8 +66,19 @@ exports.default = Object.freeze({
|
|
|
66
66
|
tunneling_read: 'ZohoCatalyst.tunneling.READ',
|
|
67
67
|
tunneling_update: 'ZohoCatalyst.tunneling.UPDATE',
|
|
68
68
|
iam_profile: 'AaaServer.profile.READ',
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
object_creation: 'Stratus.fileop.CREATE',
|
|
70
|
+
object_operation: 'Stratus.fileop.ALL',
|
|
71
|
+
stratus_bucket_operation: 'Stratus.bucketop.ALL',
|
|
72
|
+
object_update: 'ZohoCatalyst.buckets.objects.UPDATE',
|
|
73
|
+
object_read: 'ZohoCatalyst.buckets.objects.READ',
|
|
74
|
+
object_delete: 'ZohoCatalyst.buckets.objects.DELETE',
|
|
75
|
+
bucket_read: 'ZohoCatalyst.buckets.READ',
|
|
76
|
+
object_create: 'ZohoCatalyst.buckets.objects.CREATE',
|
|
71
77
|
pipline_read: 'ZohoCatalyst.pipeline.READ',
|
|
72
|
-
pipeline_exec_create: 'ZohoCatalyst.pipeline.execution.CREATE'
|
|
78
|
+
pipeline_exec_create: 'ZohoCatalyst.pipeline.execution.CREATE',
|
|
79
|
+
zest_file_read: 'ZohoZEST.files.READ',
|
|
80
|
+
zest_spec_read: 'ZohoZEST.specifications.READ',
|
|
81
|
+
zest_spec_all: 'ZohoZEST.specifications.ALL',
|
|
82
|
+
zest_spec_src_action: 'ZohoZEST.specifications.sources.CREATE',
|
|
83
|
+
zest_schedule_job_read: 'ZohoZEST.scheduled_jobs.READ'
|
|
73
84
|
});
|
|
@@ -68,6 +68,13 @@ class URL {
|
|
|
68
68
|
}
|
|
69
69
|
return URL._console.replace('.com', dc.ext);
|
|
70
70
|
}
|
|
71
|
+
static get stratusSuffix() {
|
|
72
|
+
const dc = (0, dc_js_1.getActiveDCType)();
|
|
73
|
+
if (dc === undefined) {
|
|
74
|
+
return URL._stratusSuffix;
|
|
75
|
+
}
|
|
76
|
+
return URL._stratusSuffix.replace('.com', dc.ext);
|
|
77
|
+
}
|
|
71
78
|
}
|
|
72
79
|
exports.default = URL;
|
|
73
80
|
URL._auth = (0, env_js_1.envOverride)('CATALYST_AUTH_URL', 'https://accounts.zoho.com');
|
|
@@ -77,6 +84,7 @@ URL._app = (0, env_js_1.envOverride)('CATALYST_APP_URL', 'https://catalystserver
|
|
|
77
84
|
URL._appSailDomain = (0, env_js_1.envOverride)('CATALYST_APPSAIL_URL', 'https://catalystappsail.com');
|
|
78
85
|
URL._zohoStatic = (0, env_js_1.envOverride)('ZOHO_STATIC', 'https://www.zoho.com/catalyst');
|
|
79
86
|
URL._console = (0, env_js_1.envOverride)('CATALYST_CONSOLE_URL', 'https://console.catalyst.zoho.com');
|
|
87
|
+
URL._stratusSuffix = (0, env_js_1.envOverride)('CATALYST_STRATUS_RESOURCE_SUFFIX', '.zohostratus.com');
|
|
80
88
|
URL.zohoCDN = (0, env_js_1.envOverride)('ZOHO_CDN', 'https://static.zohocdn.com');
|
|
81
89
|
URL.external = Object.freeze({
|
|
82
90
|
gitHubAPI: 'https://api.github.com',
|
|
@@ -99,8 +99,13 @@ function walk(dir, { filter = {
|
|
|
99
99
|
const isEntryPthDir = entryPathStats.isDirectory() && !entryPathStats.isSymbolicLink();
|
|
100
100
|
let excludeMatch = false;
|
|
101
101
|
if (!(isEntryPthDir && !filter.excludeDir)) {
|
|
102
|
-
|
|
103
|
-
excludeMatch = excludeMatch || (
|
|
102
|
+
if (typeof filter.exclude === 'function') {
|
|
103
|
+
excludeMatch = excludeMatch || (yield filter.exclude(entryPath));
|
|
104
|
+
}
|
|
105
|
+
else if (Array.isArray(filter.exclude)) {
|
|
106
|
+
for (const glob of filter.exclude || []) {
|
|
107
|
+
excludeMatch = excludeMatch || (0, minimatch_1.default)(entryPath, glob);
|
|
108
|
+
}
|
|
104
109
|
}
|
|
105
110
|
}
|
|
106
111
|
if (excludeMatch) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcatalyst-cli",
|
|
3
|
-
"version": "1.18.0-beta.
|
|
3
|
+
"version": "1.18.0-beta.11",
|
|
4
4
|
"description": "Command Line Tool for CATALYST",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"homepage": "https://catalyst.zoho.com",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"ansi-colors": "^4.1.
|
|
28
|
+
"ansi-colors": "^4.1.3",
|
|
29
29
|
"app-module-path": "^2.2.0",
|
|
30
30
|
"better-queue": "^3.8.10",
|
|
31
31
|
"chokidar": "^3.5.3",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"@types/inquirer-autocomplete-prompt": "^1.3.4",
|
|
71
71
|
"@types/jest": "^27.4.1",
|
|
72
72
|
"@types/lodash": "^4.14.182",
|
|
73
|
+
"@types/mime-types": "^2.1.4",
|
|
73
74
|
"@types/minimatch": "^5.1.2",
|
|
74
75
|
"@types/node": "^20.12.7",
|
|
75
76
|
"@types/request": "^2.48.8",
|
|
@@ -94,6 +95,7 @@
|
|
|
94
95
|
"build:watch": "gulp watch",
|
|
95
96
|
"clean": "gulp cleanup",
|
|
96
97
|
"test:unit": "jest --config jest.config.js",
|
|
98
|
+
"lint:nofix": "eslint --ext .ts src/ --color",
|
|
97
99
|
"lint:src": "eslint --ext .ts src/ --fix --color",
|
|
98
100
|
"lint:unit": "eslint --ext .js,.ts test/ --fix --color",
|
|
99
101
|
"lint": "run-p lint:src lint:unit",
|
|
@@ -3,17 +3,25 @@
|
|
|
3
3
|
"unique_name": "sample_uniq",
|
|
4
4
|
"handler": {
|
|
5
5
|
"type": "action_handler",
|
|
6
|
-
"name": "
|
|
6
|
+
"name": "Say Hi"
|
|
7
7
|
},
|
|
8
|
+
"sub_action": "",
|
|
8
9
|
"response_url": "https://cliq.zoho.com/v2/extensions/2980/responses/17202823900615741410013820",
|
|
9
10
|
"type": "bot",
|
|
10
11
|
"timestamp": 1569520690703,
|
|
11
12
|
"params" : {
|
|
12
13
|
"environment" : {
|
|
13
|
-
|
|
14
|
+
"tld": ".com",
|
|
15
|
+
"data_center": "US",
|
|
16
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
14
17
|
},
|
|
15
18
|
"access": {
|
|
16
|
-
"user_id": "
|
|
19
|
+
"user_id": "130720038",
|
|
20
|
+
"zoho_user_id": "130720038",
|
|
21
|
+
"organization": {
|
|
22
|
+
"type": "company",
|
|
23
|
+
"id": "123456456"
|
|
24
|
+
},
|
|
17
25
|
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
18
26
|
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
19
27
|
},
|
|
@@ -26,7 +34,8 @@
|
|
|
26
34
|
"id": "123456",
|
|
27
35
|
"email": "scott.fisher@zylcal.com",
|
|
28
36
|
"admin" : true,
|
|
29
|
-
"organization_id" : "123456456"
|
|
37
|
+
"organization_id" : "123456456",
|
|
38
|
+
"zoho_user_id": "130720038"
|
|
30
39
|
},
|
|
31
40
|
"chat": {
|
|
32
41
|
"owner": "123456",
|