zcatalyst-cli 1.18.0-beta.9 → 1.19.0
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/README.md +11 -6
- package/docs/commands/signals/generate/index.toml +19 -0
- package/docs/commands/slate/unlink.toml +9 -0
- package/docs/endpoints/lib/env.toml +3 -1
- package/docs/endpoints/lib/slate.toml +3 -0
- package/docs/serve/server/lib/slate/index.toml +14 -0
- package/docs/slate-utils.toml +4 -0
- package/docs/util_modules/config/lib/slate.toml +4 -0
- package/lib/archiver.js +18 -9
- package/lib/authentication/login.js +6 -5
- package/lib/code-deck.js +5 -6
- package/lib/command_needs/auth.js +1 -1
- package/lib/command_needs/rc.js +40 -3
- package/lib/commands/codelib/install.js +1 -0
- package/lib/commands/deploy/index.js +4 -0
- package/lib/commands/deploy/slate.js +58 -0
- package/lib/commands/event/generate/index.js +8 -2
- package/lib/commands/index.js +3 -3
- package/lib/commands/init.js +0 -10
- package/lib/commands/signals/generate/index.js +214 -0
- package/lib/commands/slate/create.js +59 -0
- package/lib/commands/slate/link.js +59 -0
- package/lib/commands/slate/unlink.js +75 -0
- package/lib/commands/zest/generate/index.js +1 -6
- package/lib/config-store.js +2 -1
- package/lib/deploy/features/index.js +3 -0
- package/lib/deploy/features/slate.js +123 -0
- package/lib/endpoints/index.js +8 -1
- package/lib/endpoints/lib/env.js +2 -1
- package/lib/endpoints/lib/sdk.js +2 -2
- package/lib/endpoints/lib/slate.js +107 -0
- package/lib/event_generate/cache.js +35 -33
- package/lib/event_generate/custom.js +15 -19
- package/lib/event_generate/datastore.js +60 -56
- package/lib/event_generate/filestore.js +51 -47
- package/lib/event_generate/github.js +19 -18
- package/lib/event_generate/stratus.js +52 -38
- package/lib/event_generate/user.js +33 -29
- package/lib/event_generate/webapp.js +33 -32
- package/lib/fn-utils/lib/common.js +1 -1
- package/lib/iac/status/deploy.js +1 -5
- package/lib/index.js +1 -1
- package/lib/init/features/appsail/index.js +3 -4
- package/lib/init/features/index.js +13 -1
- package/lib/init/features/project.js +1 -1
- package/lib/init/features/slate/index.js +313 -0
- package/lib/internal/api.js +1 -1
- package/lib/internal/command.js +10 -6
- package/lib/port-resolver.js +7 -0
- package/lib/prompt/index.js +22 -6
- package/lib/prompt/types/file-path.js +10 -7
- package/lib/serve/features/index.js +8 -1
- package/lib/serve/features/slate.js +47 -0
- package/lib/serve/server/index.js +61 -1
- package/lib/serve/server/lib/appsail/index.js +1 -1
- package/lib/serve/server/lib/master/appsail.js +7 -2
- package/lib/serve/server/lib/master/index.js +25 -21
- package/lib/serve/server/lib/master/slate.js +45 -0
- package/lib/serve/server/lib/master/utils.js +9 -3
- package/lib/serve/server/lib/slate/index.js +115 -0
- package/lib/serve/server/lib/slate/static-server.js +194 -0
- package/lib/serve/server/lib/web_client/server.js +2 -1
- package/lib/shell/dependencies/local-function.js +1 -1
- package/lib/slate-utils.js +212 -0
- package/lib/util_modules/config/index.js +3 -1
- package/lib/util_modules/config/lib/slate.js +98 -0
- package/lib/util_modules/constants/index.js +7 -1
- 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/default.js +4 -0
- package/lib/util_modules/constants/lib/file-names.js +7 -1
- package/lib/util_modules/constants/lib/folder-names.js +1 -0
- package/lib/util_modules/constants/lib/placeholders.js +18 -1
- package/lib/util_modules/constants/lib/scopes.js +1 -6
- package/lib/util_modules/constants/lib/signals-api-names.js +19 -0
- package/lib/util_modules/constants/lib/signals-publishers-type.js +27 -0
- package/lib/util_modules/constants/lib/signals-publishers.js +10 -0
- package/lib/util_modules/constants/lib/template.js +1 -0
- package/lib/util_modules/context-help.js +2 -2
- package/lib/util_modules/fs/lib/async.js +14 -3
- package/lib/util_modules/fs/lib/sync.js +6 -1
- package/lib/util_modules/parser/toml.js +20 -5
- package/package.json +3 -3
- 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/event/signals.json +26 -0
- 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/event/sample.java +4 -0
- 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/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/event/sample.js +1 -0
- package/templates/init/functions/node/event/types/event.d.ts +7 -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/integ/cliq/package.json +1 -1
- package/templates/init/functions/node/integ/convokraft/package.json +1 -1
- package/templates/init/functions/node/job/package.json +1 -1
- package/templates/init/functions/python/event/sample.py +9 -5
- 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.txt +2 -1
- 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
|
@@ -5,6 +5,10 @@ exports.default = Object.freeze({
|
|
|
5
5
|
http_log: 'catalyst-http-log.json',
|
|
6
6
|
rc: '.catalystrc',
|
|
7
7
|
config: 'catalyst.json',
|
|
8
|
+
slate: {
|
|
9
|
+
config_json: 'files.json',
|
|
10
|
+
static_zip: 'static.zip'
|
|
11
|
+
},
|
|
8
12
|
client: {
|
|
9
13
|
package_json: 'client-package.json',
|
|
10
14
|
notFoundPage: '404.html'
|
|
@@ -23,9 +27,11 @@ exports.default = Object.freeze({
|
|
|
23
27
|
system_rules: 'catalyst-system-rules.json'
|
|
24
28
|
},
|
|
25
29
|
catalyst_config: 'catalyst-config.json',
|
|
30
|
+
slate_config: 'slate-config.toml',
|
|
26
31
|
command_log: '.command.log',
|
|
27
32
|
node_modules: 'node_modules',
|
|
28
33
|
app_config: 'app-config.json',
|
|
29
34
|
package_json: 'package.json',
|
|
30
|
-
catalyst_ignore: '.catalystignore'
|
|
35
|
+
catalyst_ignore: '.catalystignore',
|
|
36
|
+
cli_config: 'cli-config.json'
|
|
31
37
|
});
|
|
@@ -39,10 +39,27 @@ exports.default = Object.freeze({
|
|
|
39
39
|
data: '{{__DATA__}}',
|
|
40
40
|
rule_id: '{{__RULE_ID__}}'
|
|
41
41
|
},
|
|
42
|
+
signal_event_data: {
|
|
43
|
+
version: '{{__VERSION__}}',
|
|
44
|
+
org_id: '{{__ORG_ID__}}',
|
|
45
|
+
project_id: '{{__PROJECT_ID__}}',
|
|
46
|
+
project_name: '{{__PROJECT_NAME__}}',
|
|
47
|
+
environment: '{{__ENVIRONMENT__}}',
|
|
48
|
+
uuid: '{{__UUID__}}',
|
|
49
|
+
source: '{{__SOURCE__}}',
|
|
50
|
+
signal_id: '{{__SIGNAL_ID__}}',
|
|
51
|
+
signal_api_name: '{{__SIGNAL_API_NAME__}}',
|
|
52
|
+
data: '{{__DATA__}}',
|
|
53
|
+
time_in_ms: '{{__TIME_IN_MS__}}',
|
|
54
|
+
rule_id: '{{__RULE_ID__}}',
|
|
55
|
+
target_id: '{{__TARGET_ID__}}',
|
|
56
|
+
attempt: '{{__ATTEMPT__}}'
|
|
57
|
+
},
|
|
42
58
|
init_js: {
|
|
43
59
|
project_id: '{{__PROJECT_ID__}}',
|
|
44
60
|
zaid: '{{__ZAID__}}',
|
|
45
61
|
auth_domain: '{{__AUTH_DOMAIN__}}',
|
|
46
|
-
org_id: '{{__ORG_ID__}}'
|
|
62
|
+
org_id: '{{__ORG_ID__}}',
|
|
63
|
+
stratus_domain: '{{_STRATUS_DOMAIN__}}'
|
|
47
64
|
}
|
|
48
65
|
});
|
|
@@ -75,10 +75,5 @@ exports.default = Object.freeze({
|
|
|
75
75
|
bucket_read: 'ZohoCatalyst.buckets.READ',
|
|
76
76
|
object_create: 'ZohoCatalyst.buckets.objects.CREATE',
|
|
77
77
|
pipline_read: 'ZohoCatalyst.pipeline.READ',
|
|
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'
|
|
78
|
+
pipeline_exec_create: 'ZohoCatalyst.pipeline.execution.CREATE'
|
|
84
79
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const signals_publishers_1 = __importDefault(require("./signals-publishers"));
|
|
7
|
+
exports.default = Object.freeze({
|
|
8
|
+
[signals_publishers_1.default.datastore]: ['row_inserted', 'row_updated', 'row_deleted'],
|
|
9
|
+
[signals_publishers_1.default.cache]: ['cache_item_created', 'cache_item_updated'],
|
|
10
|
+
[signals_publishers_1.default.authentication]: ['user_signedup', 'user_deleted', 'user_confirmed'],
|
|
11
|
+
[signals_publishers_1.default.filestore]: ['filestore_file_uploaded'],
|
|
12
|
+
[signals_publishers_1.default.stratus]: [
|
|
13
|
+
'stratus_object_uploaded',
|
|
14
|
+
'stratus_object_downloaded',
|
|
15
|
+
'stratus_object_updated',
|
|
16
|
+
'stratus_object_deleted'
|
|
17
|
+
],
|
|
18
|
+
[signals_publishers_1.default.custom]: ['deploy_success']
|
|
19
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = Object.freeze({
|
|
4
|
+
zoho: [
|
|
5
|
+
'bigin',
|
|
6
|
+
'billing',
|
|
7
|
+
'books',
|
|
8
|
+
'commerce',
|
|
9
|
+
'crm',
|
|
10
|
+
'expense',
|
|
11
|
+
'inventory',
|
|
12
|
+
'invoice',
|
|
13
|
+
'meeting',
|
|
14
|
+
'survey'
|
|
15
|
+
],
|
|
16
|
+
cloudscale: [
|
|
17
|
+
'authentication',
|
|
18
|
+
'datastore',
|
|
19
|
+
'filestore',
|
|
20
|
+
'cache',
|
|
21
|
+
'stratus',
|
|
22
|
+
'webapp',
|
|
23
|
+
'github'
|
|
24
|
+
],
|
|
25
|
+
saas: ['shopify'],
|
|
26
|
+
custom: ['custom']
|
|
27
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = Object.freeze({
|
|
4
|
+
authentication: 'authentication',
|
|
5
|
+
datastore: 'datastore',
|
|
6
|
+
filestore: 'filestore',
|
|
7
|
+
cache: 'cache',
|
|
8
|
+
stratus: 'stratus',
|
|
9
|
+
custom: 'custom'
|
|
10
|
+
});
|
|
@@ -69,6 +69,7 @@ exports.default = Object.freeze({
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
event_data: (0, path_1.join)(TEMPLATE_ROOT, 'event', 'data.json'),
|
|
72
|
+
signal_event_data: (0, path_1.join)(TEMPLATE_ROOT, 'event', 'signals.json'),
|
|
72
73
|
job_data: (0, path_1.join)(TEMPLATE_ROOT, 'event', 'job.json'),
|
|
73
74
|
init_js: (0, path_1.join)(TEMPLATE_ROOT, 'init.txt')
|
|
74
75
|
});
|
|
@@ -8,7 +8,7 @@ const runtime_store_1 = __importDefault(require("../runtime-store"));
|
|
|
8
8
|
const ansi_colors_1 = require("ansi-colors");
|
|
9
9
|
const fs_1 = require("./fs");
|
|
10
10
|
const logger_1 = require("./logger");
|
|
11
|
-
const toml_1 =
|
|
11
|
+
const toml_1 = require("./parser/toml");
|
|
12
12
|
function help() {
|
|
13
13
|
let exitCode = 0;
|
|
14
14
|
const logs = runtime_store_1.default.get('log');
|
|
@@ -40,7 +40,7 @@ function help() {
|
|
|
40
40
|
}
|
|
41
41
|
const docPath = ((_a = errQueue[0].fileName) === null || _a === void 0 ? void 0 : _a.replace((0, path_1.join)(__dirname, '../../lib'), (0, path_1.join)(__dirname, '../../docs'))) + '.toml';
|
|
42
42
|
const doc = fs_1.SYNC.readFile(docPath) || '';
|
|
43
|
-
const catHelp = (0, toml_1.
|
|
43
|
+
const catHelp = (0, toml_1.parseTOML)(doc);
|
|
44
44
|
errQueue.forEach((err) => {
|
|
45
45
|
exitCode = err.exit > exitCode ? err.exit : exitCode;
|
|
46
46
|
if (err.errorId === undefined ||
|
|
@@ -12,7 +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
|
-
exports.chmod = exports.writeJSONFile = exports.readJSONFile = exports.emptyDir = exports.findAndReplace = exports.rename = exports.copyDir = exports.copyFiles = exports.copyFile = exports.deleteDir = exports.deleteFile = exports.ensureDir = exports.ensureFile = exports.walk = exports.dirList = exports.writeFile = exports.tempFile = exports.readFile = exports.fileExists = exports.dirExists = exports.isPathExists = void 0;
|
|
15
|
+
exports.isDirEmpty = exports.chmod = exports.writeJSONFile = exports.readJSONFile = exports.emptyDir = exports.findAndReplace = exports.rename = exports.copyDir = exports.copyFiles = exports.copyFile = exports.deleteDir = exports.deleteFile = exports.ensureDir = exports.ensureFile = exports.walk = exports.dirList = exports.writeFile = exports.tempFile = exports.readFile = exports.fileExists = exports.dirExists = exports.isPathExists = void 0;
|
|
16
16
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
17
17
|
const minimatch_1 = __importDefault(require("minimatch"));
|
|
18
18
|
const os_1 = __importDefault(require("os"));
|
|
@@ -84,7 +84,8 @@ function dirList(dir) {
|
|
|
84
84
|
exports.dirList = dirList;
|
|
85
85
|
function walk(dir, { filter = {
|
|
86
86
|
exclude: [],
|
|
87
|
-
excludeDir: true
|
|
87
|
+
excludeDir: true,
|
|
88
|
+
ignoreFiles: false
|
|
88
89
|
}, depth = -1, includeDirPaths = false } = {}) {
|
|
89
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
91
|
const stats = yield fs_extra_1.default.lstat(dir);
|
|
@@ -98,7 +99,7 @@ function walk(dir, { filter = {
|
|
|
98
99
|
const entryPathStats = yield fs_extra_1.default.lstat(entryPath);
|
|
99
100
|
const isEntryPthDir = entryPathStats.isDirectory() && !entryPathStats.isSymbolicLink();
|
|
100
101
|
let excludeMatch = false;
|
|
101
|
-
if (!
|
|
102
|
+
if (!isEntryPthDir || filter.excludeDir) {
|
|
102
103
|
if (typeof filter.exclude === 'function') {
|
|
103
104
|
excludeMatch = excludeMatch || (yield filter.exclude(entryPath));
|
|
104
105
|
}
|
|
@@ -108,6 +109,9 @@ function walk(dir, { filter = {
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
}
|
|
112
|
+
if (!isEntryPthDir && filter.ignoreFiles && !excludeMatch) {
|
|
113
|
+
excludeMatch = true;
|
|
114
|
+
}
|
|
111
115
|
if (excludeMatch) {
|
|
112
116
|
return [];
|
|
113
117
|
}
|
|
@@ -249,3 +253,10 @@ function chmod(path, mode, { checkPath = true, recursive = false } = {}) {
|
|
|
249
253
|
});
|
|
250
254
|
}
|
|
251
255
|
exports.chmod = chmod;
|
|
256
|
+
function isDirEmpty(pth) {
|
|
257
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
258
|
+
const files = yield fs_extra_1.default.readdir(pth);
|
|
259
|
+
return files.length === 0;
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
exports.isDirEmpty = isDirEmpty;
|
|
@@ -3,7 +3,7 @@ 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.writeJSONFile = exports.readJSONFile = exports.emptyDir = exports.copyDir = exports.copyFiles = exports.copyFile = exports.deleteTempDir = exports.tempFile = exports.deleteDir = exports.isPathInside = exports.isPathOutside = exports.renameFile = exports.modifyFileName = exports.appendFile = exports.writeFile = exports.ensureFile = exports.ensureDir = exports.readFile = exports.deleteFile = exports.getAllFiles = exports.getAllDirs = exports.dirExists = exports.pathExists = exports.fileExists = exports.readSymLink = exports.getReadStream = exports.getWriteStream = void 0;
|
|
6
|
+
exports.isDirEmpty = exports.writeJSONFile = exports.readJSONFile = exports.emptyDir = exports.copyDir = exports.copyFiles = exports.copyFile = exports.deleteTempDir = exports.tempFile = exports.deleteDir = exports.isPathInside = exports.isPathOutside = exports.renameFile = exports.modifyFileName = exports.appendFile = exports.writeFile = exports.ensureFile = exports.ensureDir = exports.readFile = exports.deleteFile = exports.getAllFiles = exports.getAllDirs = exports.dirExists = exports.pathExists = exports.fileExists = exports.readSymLink = exports.getReadStream = exports.getWriteStream = void 0;
|
|
7
7
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
8
|
const os_1 = __importDefault(require("os"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -180,3 +180,8 @@ function writeJSONFile(pth, object, opts) {
|
|
|
180
180
|
return fs_extra_1.default.writeJsonSync(pth, object, opts);
|
|
181
181
|
}
|
|
182
182
|
exports.writeJSONFile = writeJSONFile;
|
|
183
|
+
function isDirEmpty(pth) {
|
|
184
|
+
const files = fs_extra_1.default.readdirSync(pth);
|
|
185
|
+
return files.length === 0;
|
|
186
|
+
}
|
|
187
|
+
exports.isDirEmpty = isDirEmpty;
|
|
@@ -3,17 +3,32 @@ 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
|
-
|
|
6
|
+
exports.convertTOML = exports.parseTOML = void 0;
|
|
7
|
+
const toml_1 = __importDefault(require("@iarna/toml"));
|
|
7
8
|
const error_1 = __importDefault(require("../../error"));
|
|
8
|
-
|
|
9
|
+
function parseTOML(str) {
|
|
9
10
|
try {
|
|
10
|
-
return
|
|
11
|
+
return toml_1.default.parse(str);
|
|
11
12
|
}
|
|
12
13
|
catch (e) {
|
|
13
14
|
const err = error_1.default.getErrorInstance(e, {
|
|
14
|
-
message: 'TOML Parsing error'
|
|
15
|
+
message: 'TOML Parsing error' + e
|
|
15
16
|
});
|
|
16
17
|
err.exit = 2;
|
|
17
18
|
throw err;
|
|
18
19
|
}
|
|
19
|
-
}
|
|
20
|
+
}
|
|
21
|
+
exports.parseTOML = parseTOML;
|
|
22
|
+
function convertTOML(object) {
|
|
23
|
+
try {
|
|
24
|
+
return toml_1.default.stringify(object);
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
const err = error_1.default.getErrorInstance(e, {
|
|
28
|
+
message: 'TOML Writing error'
|
|
29
|
+
});
|
|
30
|
+
err.exit = 2;
|
|
31
|
+
throw err;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.convertTOML = convertTOML;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcatalyst-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Command Line Tool for CATALYST",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"functions",
|
|
22
22
|
"zcatalyst"
|
|
23
23
|
],
|
|
24
|
-
"author": "Catalyst (https://
|
|
24
|
+
"author": "Catalyst (https://github.com/catalystbyzoho)",
|
|
25
25
|
"homepage": "https://catalyst.zoho.com",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@iarna/toml": "^2.2.5",
|
|
28
29
|
"ansi-colors": "^4.1.3",
|
|
29
30
|
"app-module-path": "^2.2.0",
|
|
30
31
|
"better-queue": "^3.8.10",
|
|
@@ -51,7 +52,6 @@
|
|
|
51
52
|
"semver": "^7.3.7",
|
|
52
53
|
"string-width": "^4.2.3",
|
|
53
54
|
"strip-ansi": "^6.0.1",
|
|
54
|
-
"toml": "^3.0.0",
|
|
55
55
|
"update-notifier": "^5.1.0",
|
|
56
56
|
"winston": "^3.7.2",
|
|
57
57
|
"ws": "^8.5.0",
|
|
@@ -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",
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Sample",
|
|
3
|
+
"unique_name": "sample_uniq",
|
|
4
|
+
"handler": {
|
|
5
|
+
"type": "alert_handler"
|
|
6
|
+
},
|
|
7
|
+
"type": "bot",
|
|
8
|
+
"timestamp": 1738312467537,
|
|
9
|
+
"params" : {
|
|
10
|
+
"environment" : {
|
|
11
|
+
"tld": ".com",
|
|
12
|
+
"data_center": "US",
|
|
13
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
14
|
+
},
|
|
15
|
+
"access": {
|
|
16
|
+
"user_id": "130720038",
|
|
17
|
+
"zoho_user_id": "130720038",
|
|
18
|
+
"organization": {
|
|
19
|
+
"type": "company",
|
|
20
|
+
"id": "123456456"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"operation": "ringing",
|
|
24
|
+
"user": {
|
|
25
|
+
"country": "us",
|
|
26
|
+
"timezone": "Asia/calcutta",
|
|
27
|
+
"last_name": "Fisher",
|
|
28
|
+
"first_name": "Scott",
|
|
29
|
+
"language": "en",
|
|
30
|
+
"id": "123456",
|
|
31
|
+
"email": "scott.fisher@zylcal.com",
|
|
32
|
+
"admin" : true,
|
|
33
|
+
"organization_id" : "123456456",
|
|
34
|
+
"zoho_user_id": "130720038"
|
|
35
|
+
},
|
|
36
|
+
"data": {
|
|
37
|
+
"call_id": "783719c0-54d1-423c-9033-588454522e9e",
|
|
38
|
+
"time": 1738312467509
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -9,10 +9,17 @@
|
|
|
9
9
|
"timestamp": 1569520690703,
|
|
10
10
|
"params" : {
|
|
11
11
|
"environment" : {
|
|
12
|
-
|
|
12
|
+
"tld": ".com",
|
|
13
|
+
"data_center": "US",
|
|
14
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
13
15
|
},
|
|
14
16
|
"access": {
|
|
15
|
-
"user_id": "
|
|
17
|
+
"user_id": "130720038",
|
|
18
|
+
"zoho_user_id": "130720038",
|
|
19
|
+
"organization": {
|
|
20
|
+
"type": "company",
|
|
21
|
+
"id": "123456456"
|
|
22
|
+
},
|
|
16
23
|
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
17
24
|
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
18
25
|
},
|
|
@@ -25,7 +32,8 @@
|
|
|
25
32
|
"id": "123456",
|
|
26
33
|
"email": "scott.fisher@zylcal.com",
|
|
27
34
|
"admin" : true,
|
|
28
|
-
"organization_id" : "123456456"
|
|
35
|
+
"organization_id" : "123456456",
|
|
36
|
+
"zoho_user_id": "130720038"
|
|
29
37
|
},
|
|
30
38
|
"chat": {
|
|
31
39
|
"owner": "123456",
|
|
@@ -9,10 +9,17 @@
|
|
|
9
9
|
"timestamp": 1569520690703,
|
|
10
10
|
"params" : {
|
|
11
11
|
"environment" : {
|
|
12
|
-
|
|
12
|
+
"tld": ".com",
|
|
13
|
+
"data_center": "US",
|
|
14
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
13
15
|
},
|
|
14
16
|
"access": {
|
|
15
|
-
"user_id": "
|
|
17
|
+
"user_id": "130720038",
|
|
18
|
+
"zoho_user_id": "130720038",
|
|
19
|
+
"organization": {
|
|
20
|
+
"type": "company",
|
|
21
|
+
"id": "123456456"
|
|
22
|
+
},
|
|
16
23
|
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
17
24
|
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
18
25
|
},
|
|
@@ -25,7 +32,8 @@
|
|
|
25
32
|
"id": "123456",
|
|
26
33
|
"email": "scott.fisher@zylcal.com",
|
|
27
34
|
"admin" : true,
|
|
28
|
-
"organization_id" : "123456456"
|
|
35
|
+
"organization_id" : "123456456",
|
|
36
|
+
"zoho_user_id": "130720038"
|
|
29
37
|
},
|
|
30
38
|
"headers": {},
|
|
31
39
|
"params": {},
|
|
@@ -9,10 +9,17 @@
|
|
|
9
9
|
"timestamp": 1569520690703,
|
|
10
10
|
"params" : {
|
|
11
11
|
"environment" : {
|
|
12
|
-
|
|
12
|
+
"tld": ".com",
|
|
13
|
+
"data_center": "US",
|
|
14
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
13
15
|
},
|
|
14
16
|
"access": {
|
|
15
|
-
"user_id": "
|
|
17
|
+
"user_id": "130720038",
|
|
18
|
+
"zoho_user_id": "130720038",
|
|
19
|
+
"organization": {
|
|
20
|
+
"type": "company",
|
|
21
|
+
"id": "123456456"
|
|
22
|
+
},
|
|
16
23
|
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
17
24
|
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
18
25
|
},
|
|
@@ -44,7 +51,8 @@
|
|
|
44
51
|
"id": "123456",
|
|
45
52
|
"email": "scott.fisher@zylcal.com",
|
|
46
53
|
"admin" : true,
|
|
47
|
-
"organization_id" : "123456456"
|
|
54
|
+
"organization_id" : "123456456",
|
|
55
|
+
"zoho_user_id": "130720038"
|
|
48
56
|
},
|
|
49
57
|
"chat": {
|
|
50
58
|
"owner": "123456",
|
|
@@ -66,7 +74,7 @@
|
|
|
66
74
|
],
|
|
67
75
|
"id": "CT_1256246524399772951_1741337",
|
|
68
76
|
"type": "channel",
|
|
69
|
-
"title": "",
|
|
77
|
+
"title": "Catalyst",
|
|
70
78
|
"recent_messages": []
|
|
71
79
|
},
|
|
72
80
|
"location": {
|
|
@@ -9,15 +9,22 @@
|
|
|
9
9
|
"timestamp": 1569520690703,
|
|
10
10
|
"params" : {
|
|
11
11
|
"environment" : {
|
|
12
|
-
|
|
12
|
+
"tld": ".com",
|
|
13
|
+
"data_center": "US",
|
|
14
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
13
15
|
},
|
|
14
16
|
"access": {
|
|
15
|
-
"user_id": "
|
|
17
|
+
"user_id": "130720038",
|
|
18
|
+
"zoho_user_id": "130720038",
|
|
19
|
+
"organization": {
|
|
20
|
+
"type": "company",
|
|
21
|
+
"id": "123456456"
|
|
22
|
+
},
|
|
16
23
|
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
17
24
|
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
18
25
|
},
|
|
19
26
|
"message_details": {
|
|
20
|
-
"message": { "mentions": [], "type": "text", "text": "Hi" },
|
|
27
|
+
"message": { "mentions": [], "type": "text", "text": "Hi", "comment":"Attached a file", "file": "File" },
|
|
21
28
|
"time": 1610351240458
|
|
22
29
|
},
|
|
23
30
|
"attachments": [],
|
|
@@ -41,7 +48,8 @@
|
|
|
41
48
|
"id": "123456",
|
|
42
49
|
"email": "scott.fisher@zylcal.com",
|
|
43
50
|
"admin" : true,
|
|
44
|
-
"organization_id" : "123456456"
|
|
51
|
+
"organization_id" : "123456456",
|
|
52
|
+
"zoho_user_id": "130720038"
|
|
45
53
|
},
|
|
46
54
|
"chat" : {
|
|
47
55
|
"owner": "123456",
|
|
@@ -63,6 +71,7 @@
|
|
|
63
71
|
],
|
|
64
72
|
"id": "CD_1256246524399772951_1741337",
|
|
65
73
|
"type": "channel",
|
|
74
|
+
"title": "Catalyst",
|
|
66
75
|
"recent_messages": []
|
|
67
76
|
},
|
|
68
77
|
"location": {
|
|
@@ -9,10 +9,17 @@
|
|
|
9
9
|
"timestamp": 1569520690703,
|
|
10
10
|
"params" : {
|
|
11
11
|
"environment" : {
|
|
12
|
-
|
|
12
|
+
"tld": ".com",
|
|
13
|
+
"data_center": "US",
|
|
14
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
13
15
|
},
|
|
14
16
|
"access": {
|
|
15
|
-
"user_id": "
|
|
17
|
+
"user_id": "130720038",
|
|
18
|
+
"zoho_user_id": "130720038",
|
|
19
|
+
"organization": {
|
|
20
|
+
"type": "company",
|
|
21
|
+
"id": "123456456"
|
|
22
|
+
},
|
|
16
23
|
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
17
24
|
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
18
25
|
},
|
|
@@ -25,7 +32,8 @@
|
|
|
25
32
|
"id": "123456",
|
|
26
33
|
"email": "scott.fisher@zylcal.com",
|
|
27
34
|
"admin" : true,
|
|
28
|
-
"organization_id" : "123456456"
|
|
35
|
+
"organization_id" : "123456456",
|
|
36
|
+
"zoho_user_id": "130720038"
|
|
29
37
|
},
|
|
30
38
|
"operation": "added",
|
|
31
39
|
"chat": {
|
|
@@ -48,9 +56,11 @@
|
|
|
48
56
|
],
|
|
49
57
|
"id": "CD_1256246524399772951_1741337",
|
|
50
58
|
"type": "channel",
|
|
59
|
+
"title": "Catalyst",
|
|
51
60
|
"recent_messages": []
|
|
52
61
|
},
|
|
53
62
|
"data": {
|
|
63
|
+
"message": { "mentions": [], "type": "text", "text": "Hi", "comment":"Attached a file" },
|
|
54
64
|
"time": 1569520690703
|
|
55
65
|
}
|
|
56
66
|
}
|
|
@@ -9,10 +9,17 @@
|
|
|
9
9
|
"timestamp": 1569520690703,
|
|
10
10
|
"params" : {
|
|
11
11
|
"environment" : {
|
|
12
|
-
|
|
12
|
+
"tld": ".com",
|
|
13
|
+
"data_center": "US",
|
|
14
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
13
15
|
},
|
|
14
16
|
"access": {
|
|
15
|
-
"user_id": "
|
|
17
|
+
"user_id": "130720038",
|
|
18
|
+
"zoho_user_id": "130720038",
|
|
19
|
+
"organization": {
|
|
20
|
+
"type": "company",
|
|
21
|
+
"id": "123456456"
|
|
22
|
+
},
|
|
16
23
|
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
17
24
|
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
18
25
|
},
|
|
@@ -25,12 +32,9 @@
|
|
|
25
32
|
"id": "123456",
|
|
26
33
|
"email": "scott.fisher@zylcal.com",
|
|
27
34
|
"admin" : true,
|
|
28
|
-
"organization_id" : "123456456"
|
|
35
|
+
"organization_id" : "123456456",
|
|
36
|
+
"zoho_user_id": "130720038"
|
|
29
37
|
},
|
|
30
|
-
"newuser": true
|
|
31
|
-
"mentions": [],
|
|
32
|
-
"options": {},
|
|
33
|
-
"selections": [],
|
|
34
|
-
"arguments": ""
|
|
38
|
+
"newuser": true
|
|
35
39
|
}
|
|
36
40
|
}
|
|
@@ -8,10 +8,17 @@
|
|
|
8
8
|
"timestamp": 1569520690703,
|
|
9
9
|
"params" : {
|
|
10
10
|
"environment" : {
|
|
11
|
-
|
|
11
|
+
"tld": ".com",
|
|
12
|
+
"data_center": "US",
|
|
13
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
12
14
|
},
|
|
13
15
|
"access": {
|
|
14
|
-
"user_id": "
|
|
16
|
+
"user_id": "130720038",
|
|
17
|
+
"zoho_user_id": "130720038",
|
|
18
|
+
"organization": {
|
|
19
|
+
"type": "company",
|
|
20
|
+
"id": "123456456"
|
|
21
|
+
},
|
|
15
22
|
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
16
23
|
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
17
24
|
},
|
|
@@ -24,7 +31,8 @@
|
|
|
24
31
|
"id": "123456",
|
|
25
32
|
"email": "scott.fisher@zylcal.com",
|
|
26
33
|
"admin" : true,
|
|
27
|
-
"organization_id" : "123456456"
|
|
34
|
+
"organization_id" : "123456456",
|
|
35
|
+
"zoho_user_id": "130720038"
|
|
28
36
|
},
|
|
29
37
|
"chat": {
|
|
30
38
|
"owner": "123456",
|
|
@@ -46,6 +54,7 @@
|
|
|
46
54
|
],
|
|
47
55
|
"id": "CD_1256246524399772951_1741337",
|
|
48
56
|
"type": "channel",
|
|
57
|
+
"channel_unique_name": "sample",
|
|
49
58
|
"title": "Sample"
|
|
50
59
|
},
|
|
51
60
|
"mentions": [],
|