zcatalyst-cli 1.12.1 → 1.13.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.
Files changed (179) hide show
  1. package/lib/apig-utils.js +39 -39
  2. package/lib/archiver.js +13 -9
  3. package/lib/authentication/index.js +22 -18
  4. package/lib/authentication/login.js +32 -32
  5. package/lib/bin/catalyst.js +15 -15
  6. package/lib/cli_table/src/cell.js +26 -26
  7. package/lib/cli_table/src/layout-manager.js +44 -45
  8. package/lib/cli_table/src/table.js +9 -9
  9. package/lib/cli_table/src/utils.js +35 -36
  10. package/lib/client-utils.js +18 -18
  11. package/lib/client.js +1 -1
  12. package/lib/command_needs/auth.js +7 -7
  13. package/lib/command_needs/rc.js +24 -24
  14. package/lib/commands/apig/disable.js +5 -5
  15. package/lib/commands/apig/enable.js +5 -5
  16. package/lib/commands/apig/status.js +9 -9
  17. package/lib/commands/client/delete.js +18 -18
  18. package/lib/commands/client/setup.js +8 -4
  19. package/lib/commands/deploy.js +18 -14
  20. package/lib/commands/ds/export.js +11 -11
  21. package/lib/commands/ds/import.js +12 -12
  22. package/lib/commands/ds/status.js +10 -10
  23. package/lib/commands/event/generate/index.js +21 -17
  24. package/lib/commands/event/generate/integ.js +7 -3
  25. package/lib/commands/functions/add.js +8 -4
  26. package/lib/commands/functions/config.js +5 -5
  27. package/lib/commands/functions/delete.js +20 -20
  28. package/lib/commands/functions/setup.js +8 -4
  29. package/lib/commands/functions/shell.js +7 -3
  30. package/lib/commands/help.js +4 -4
  31. package/lib/commands/iac/export.js +8 -8
  32. package/lib/commands/iac/import.js +23 -19
  33. package/lib/commands/iac/pack.js +15 -11
  34. package/lib/commands/iac/status.js +6 -2
  35. package/lib/commands/index.js +5 -1
  36. package/lib/commands/init.js +14 -10
  37. package/lib/commands/login.js +5 -1
  38. package/lib/commands/logout.js +5 -1
  39. package/lib/commands/project/list.js +14 -10
  40. package/lib/commands/project/reset.js +5 -5
  41. package/lib/commands/project/use.js +9 -9
  42. package/lib/commands/pull.js +18 -14
  43. package/lib/commands/run.js +13 -9
  44. package/lib/commands/serve.js +5 -1
  45. package/lib/commands/token/generate.js +6 -2
  46. package/lib/commands/token/list.js +7 -3
  47. package/lib/commands/token/revoke.js +6 -2
  48. package/lib/commands/whoami.js +3 -3
  49. package/lib/dc.js +2 -2
  50. package/lib/deploy/features/apig.js +6 -6
  51. package/lib/deploy/features/client.js +1 -1
  52. package/lib/deploy/features/functions/index.js +9 -9
  53. package/lib/deploy/features/index.js +5 -1
  54. package/lib/deploy/index.js +2 -2
  55. package/lib/endpoints/index.js +17 -13
  56. package/lib/endpoints/lib/apig.js +5 -5
  57. package/lib/endpoints/lib/applogic.js +4 -4
  58. package/lib/endpoints/lib/cache.js +3 -3
  59. package/lib/endpoints/lib/catalyst-details.js +1 -1
  60. package/lib/endpoints/lib/client.js +5 -5
  61. package/lib/endpoints/lib/datastore.js +2 -2
  62. package/lib/endpoints/lib/ds-bulk.js +5 -5
  63. package/lib/endpoints/lib/env.js +1 -1
  64. package/lib/endpoints/lib/event-bus.js +1 -1
  65. package/lib/endpoints/lib/filestore.js +2 -2
  66. package/lib/endpoints/lib/functions.js +4 -4
  67. package/lib/endpoints/lib/iac.js +10 -10
  68. package/lib/endpoints/lib/project.js +20 -5
  69. package/lib/endpoints/lib/queue.js +3 -3
  70. package/lib/endpoints/lib/sdk.js +1 -1
  71. package/lib/endpoints/lib/zcql.js +1 -1
  72. package/lib/error.js +1 -1
  73. package/lib/errorOut.js +2 -2
  74. package/lib/event_generate/cache.js +5 -5
  75. package/lib/event_generate/custom.js +2 -2
  76. package/lib/event_generate/datastore.js +5 -5
  77. package/lib/event_generate/filestore.js +5 -5
  78. package/lib/event_generate/integration/cliq.js +3 -3
  79. package/lib/event_generate/user.js +1 -1
  80. package/lib/event_generate/webapp.js +5 -5
  81. package/lib/execute-script.js +19 -15
  82. package/lib/express_middlewares/authenticator.js +32 -5
  83. package/lib/express_middlewares/logger.js +2 -2
  84. package/lib/express_middlewares/unknownReqProxy.js +1 -1
  85. package/lib/fn-utils/index.js +5 -1
  86. package/lib/fn-utils/lib/common.js +44 -44
  87. package/lib/fn-utils/lib/integ.js +9 -9
  88. package/lib/fn-utils/lib/java.js +46 -46
  89. package/lib/fn-utils/lib/node.js +7 -7
  90. package/lib/fn-watcher.js +9 -11
  91. package/lib/iac/status/bundle.js +5 -5
  92. package/lib/iac/status/deploy.js +4 -4
  93. package/lib/index.js +2 -2
  94. package/lib/init/dependencies/npm-install.js +1 -1
  95. package/lib/init/dependencies/package-json.js +6 -6
  96. package/lib/init/features/client/index.js +5 -1
  97. package/lib/init/features/client/initializers/angular.js +16 -12
  98. package/lib/init/features/client/initializers/basic.js +10 -6
  99. package/lib/init/features/client/initializers/lyte.js +11 -7
  100. package/lib/init/features/client/initializers/react.js +13 -9
  101. package/lib/init/features/functions/index.js +9 -9
  102. package/lib/init/features/functions/languages/java.js +10 -10
  103. package/lib/init/features/functions/languages/node.js +9 -9
  104. package/lib/init/features/index.js +12 -8
  105. package/lib/init/features/project.js +20 -20
  106. package/lib/init/index.js +2 -2
  107. package/lib/init/util/client.js +7 -3
  108. package/lib/init/util/functions.js +1 -1
  109. package/lib/init/util/project.js +4 -4
  110. package/lib/internal/api.js +19 -19
  111. package/lib/internal/command.js +20 -16
  112. package/lib/internal/config.js +5 -5
  113. package/lib/internal/credential.js +10 -10
  114. package/lib/internal/crypt.js +5 -5
  115. package/lib/internal/rc.js +5 -5
  116. package/lib/migration/global/1.6.2.js +3 -3
  117. package/lib/migration/index.js +22 -18
  118. package/lib/option-filter.js +34 -30
  119. package/lib/optional-import.js +12 -8
  120. package/lib/plugin-loader.js +7 -3
  121. package/lib/port-resolver.js +4 -4
  122. package/lib/progress.js +2 -2
  123. package/lib/prompt/index.js +5 -1
  124. package/lib/prompt/types/file-path.js +1 -1
  125. package/lib/pull/features/apig.js +9 -9
  126. package/lib/pull/features/client.js +7 -7
  127. package/lib/pull/features/functions/index.js +14 -14
  128. package/lib/pull/features/index.js +5 -1
  129. package/lib/pull/index.js +4 -4
  130. package/lib/repl-server.js +2 -2
  131. package/lib/serve/features/apig.js +1 -1
  132. package/lib/serve/features/index.js +8 -4
  133. package/lib/serve/index.js +15 -11
  134. package/lib/serve/server/index.js +34 -27
  135. package/lib/serve/server/lib/java/JavaaioServer.java +2 -1
  136. package/lib/serve/server/lib/java/lib/catalyst-cli-java-runtime-1.0.0.jar +0 -0
  137. package/lib/serve/server/lib/java/lib/catalyst-java-runtime-1.0.0.jar +0 -0
  138. package/lib/serve/server/lib/java/lib/zip4j-2.5.0.jar +0 -0
  139. package/lib/serve/server/lib/master.js +26 -15
  140. package/lib/serve/server/lib/node.js +7 -3
  141. package/lib/serve/server/lib/web_client/index.js +3 -3
  142. package/lib/serve/server/lib/web_client/server.js +17 -17
  143. package/lib/shell/dependencies/http-functions.js +38 -33
  144. package/lib/shell/dependencies/invoker/bio/java/JavabioInvoker.java +7 -2
  145. package/lib/shell/dependencies/invoker/cron/java/JavacronInvoker.java +7 -2
  146. package/lib/shell/dependencies/invoker/event/java/JavaeventInvoker.java +7 -2
  147. package/lib/shell/dependencies/invoker/integ/java/JavaintegInvoker.java +7 -2
  148. package/lib/shell/dependencies/invoker/integ/node.js +8 -4
  149. package/lib/shell/dependencies/local-function.js +44 -40
  150. package/lib/shell/index.js +12 -12
  151. package/lib/shell/prepare/index.js +2 -2
  152. package/lib/shell/prepare/languages/index.js +5 -1
  153. package/lib/shell/prepare/languages/java.js +1 -1
  154. package/lib/throbber/index.js +17 -17
  155. package/lib/throbber/utils.js +9 -9
  156. package/lib/track.js +7 -7
  157. package/lib/util_modules/config/index.js +5 -1
  158. package/lib/util_modules/constants/lib/auth.js +6 -6
  159. package/lib/util_modules/constants/lib/cliq-handlers.js +2 -2
  160. package/lib/util_modules/constants/lib/template.js +21 -21
  161. package/lib/util_modules/constants/lib/urls.js +11 -11
  162. package/lib/util_modules/context-help.js +15 -15
  163. package/lib/util_modules/fs/index.js +5 -1
  164. package/lib/util_modules/fs/lib/async.js +4 -4
  165. package/lib/util_modules/fs/utils.js +1 -1
  166. package/lib/util_modules/logger.js +2 -2
  167. package/lib/util_modules/parser/toml.js +1 -1
  168. package/lib/util_modules/project.js +6 -6
  169. package/lib/util_modules/shell.js +4 -4
  170. package/lib/winston.js +5 -5
  171. package/package.json +39 -39
  172. package/scripts/postInstall.js +7 -6
  173. package/docs/.DS_Store +0 -0
  174. package/lib/serve/server/lib/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
  175. package/templates/.DS_Store +0 -0
  176. package/templates/init/.DS_Store +0 -0
  177. package/templates/init/client/.DS_Store +0 -0
  178. package/templates/init/client/react/.DS_Store +0 -0
  179. package/templates/init/functions/node/integ/cliq/.DS_Store +0 -0
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const ansi_colors_1 = __importDefault(require("ansi-colors"));
7
- const cli_cursor_1 = require("cli-cursor");
7
+ const cli_cursor_1 = __importDefault(require("cli-cursor"));
8
8
  const readline_1 = require("readline");
9
9
  const strip_ansi_1 = __importDefault(require("strip-ansi"));
10
10
  const error_js_1 = __importDefault(require("../error.js"));
@@ -30,7 +30,7 @@ class Throbber {
30
30
  if (Throbber.instance !== undefined) {
31
31
  return Throbber.instance;
32
32
  }
33
- const instance = new Throbber(Object.assign({ spinnerColor: 'cyanBright', spinner: shell_js_1.supportsUnicode() ? spinners_json_1.dots : spinners_json_1.dashes, disableSpins: false, status: 'spinning', succeedPrefix: char_js_1.CHAR.success, failPrefix: char_js_1.CHAR.error }, options));
33
+ const instance = new Throbber(Object.assign({ spinnerColor: 'cyanBright', spinner: (0, shell_js_1.supportsUnicode)() ? spinners_json_1.dots : spinners_json_1.dashes, disableSpins: false, status: 'spinning', succeedPrefix: char_js_1.CHAR.success, failPrefix: char_js_1.CHAR.error }, options));
34
34
  Throbber.instance = instance;
35
35
  return instance;
36
36
  }
@@ -107,7 +107,7 @@ class Throbber {
107
107
  }
108
108
  this.currentInterval = this.loopStream();
109
109
  if (!this.isCursorHidden) {
110
- cli_cursor_1.hide();
110
+ cli_cursor_1.default.hide();
111
111
  }
112
112
  this.isCursorHidden = true;
113
113
  this.checkIfActiveSpinners();
@@ -139,40 +139,40 @@ class Throbber {
139
139
  let prefixLength = indent || 0;
140
140
  if (status === 'spinning') {
141
141
  prefixLength += frame.length + 1;
142
- text = utils_1.breakText(text, prefixLength);
142
+ text = (0, utils_1.breakText)(text, prefixLength);
143
143
  line = `${ansi_colors_1.default[spinnerColor](frame)} ${color ? ansi_colors_1.default[color](text) : text}`;
144
144
  }
145
145
  else {
146
146
  if (status === 'succeed') {
147
- prefixLength += strip_ansi_1.default(succeedPrefix).length + 1;
147
+ prefixLength += (0, strip_ansi_1.default)(succeedPrefix).length + 1;
148
148
  if (hasActiveSpinners) {
149
- text = utils_1.breakText(text, prefixLength);
149
+ text = (0, utils_1.breakText)(text, prefixLength);
150
150
  }
151
151
  line = `${succeedPrefix} ${text}`;
152
152
  }
153
153
  else if (status === 'fail') {
154
- prefixLength += strip_ansi_1.default(failPrefix).length + 1;
154
+ prefixLength += (0, strip_ansi_1.default)(failPrefix).length + 1;
155
155
  if (hasActiveSpinners) {
156
- text = utils_1.breakText(text, prefixLength);
156
+ text = (0, utils_1.breakText)(text, prefixLength);
157
157
  }
158
158
  line = `${failPrefix} ${text}`;
159
159
  }
160
160
  else {
161
161
  if (hasActiveSpinners) {
162
- text = utils_1.breakText(text, prefixLength);
162
+ text = (0, utils_1.breakText)(text, prefixLength);
163
163
  }
164
164
  line = color ? ansi_colors_1.default[color](text) : text;
165
165
  }
166
166
  }
167
- linesLength.push(...utils_1.getLinesLength(text, prefixLength));
167
+ linesLength.push(...(0, utils_1.getLinesLength)(text, prefixLength));
168
168
  output += indent ? `${' '.repeat(indent)}${line}\n` : `${line}\n`;
169
169
  });
170
170
  if (!hasActiveSpinners) {
171
- readline_1.clearScreenDown(this.stream);
171
+ (0, readline_1.clearScreenDown)(this.stream);
172
172
  }
173
- utils_1.writeStream(this.stream, output, linesLength);
173
+ (0, utils_1.writeStream)(this.stream, output, linesLength);
174
174
  if (hasActiveSpinners) {
175
- utils_1.cleanStream(this.stream, linesLength);
175
+ (0, utils_1.cleanStream)(this.stream, linesLength);
176
176
  }
177
177
  this.lineCount = linesLength.length;
178
178
  }
@@ -185,20 +185,20 @@ class Throbber {
185
185
  if (!this.hasActiveSpinners()) {
186
186
  if (this.spin) {
187
187
  this.setStreamOutput();
188
- readline_1.moveCursor(this.stream, 0, this.lineCount);
188
+ (0, readline_1.moveCursor)(this.stream, 0, this.lineCount);
189
189
  if (this.currentInterval !== null) {
190
190
  clearInterval(this.currentInterval);
191
191
  }
192
192
  this.isCursorHidden = false;
193
- cli_cursor_1.show();
193
+ cli_cursor_1.default.show();
194
194
  }
195
195
  this.spinners = {};
196
196
  }
197
197
  }
198
198
  bindSigint() {
199
199
  process.prependOnceListener('SIGINT', () => {
200
- cli_cursor_1.show();
201
- readline_1.moveCursor(process.stderr, 0, this.lineCount);
200
+ cli_cursor_1.default.show();
201
+ (0, readline_1.moveCursor)(process.stderr, 0, this.lineCount);
202
202
  process.exit(0);
203
203
  });
204
204
  }
@@ -7,7 +7,7 @@ exports.cleanStream = exports.writeStream = exports.getLinesLength = exports.bre
7
7
  const readline_1 = require("readline");
8
8
  const strip_ansi_1 = __importDefault(require("strip-ansi"));
9
9
  function breakText(text, prefixLength) {
10
- return strip_ansi_1.default(text)
10
+ return (0, strip_ansi_1.default)(text)
11
11
  .split('\n')
12
12
  .map((line, index) => (index === 0 ? breakLine(line, prefixLength) : breakLine(line, 0)))
13
13
  .join('\n');
@@ -20,24 +20,24 @@ function breakLine(line, prefixLength) {
20
20
  : line;
21
21
  }
22
22
  function getLinesLength(text, prefixLength) {
23
- return strip_ansi_1.default(text)
23
+ return (0, strip_ansi_1.default)(text)
24
24
  .split('\n')
25
25
  .map((line, index) => (index === 0 ? line.length + prefixLength : line.length));
26
26
  }
27
27
  exports.getLinesLength = getLinesLength;
28
28
  function writeStream(stream, output, rawLines) {
29
29
  stream.write(output);
30
- readline_1.moveCursor(stream, 0, -rawLines.length);
30
+ (0, readline_1.moveCursor)(stream, 0, -rawLines.length);
31
31
  }
32
32
  exports.writeStream = writeStream;
33
33
  function cleanStream(stream, rawLines) {
34
34
  rawLines.forEach((lineLength, index) => {
35
- readline_1.moveCursor(stream, lineLength, index);
36
- readline_1.clearLine(stream, 1);
37
- readline_1.moveCursor(stream, -lineLength, -index);
35
+ (0, readline_1.moveCursor)(stream, lineLength, index);
36
+ (0, readline_1.clearLine)(stream, 1);
37
+ (0, readline_1.moveCursor)(stream, -lineLength, -index);
38
38
  });
39
- readline_1.moveCursor(stream, 0, rawLines.length);
40
- readline_1.clearScreenDown(stream);
41
- readline_1.moveCursor(stream, 0, -rawLines.length);
39
+ (0, readline_1.moveCursor)(stream, 0, rawLines.length);
40
+ (0, readline_1.clearScreenDown)(stream);
41
+ (0, readline_1.moveCursor)(stream, 0, -rawLines.length);
42
42
  }
43
43
  exports.cleanStream = cleanStream;
package/lib/track.js CHANGED
@@ -22,8 +22,8 @@ const fs_1 = require("./util_modules/fs");
22
22
  const logger_1 = require("./util_modules/logger");
23
23
  const winston_1 = require("./winston");
24
24
  exports.default = (event, message, duration) => __awaiter(void 0, void 0, void 0, function* () {
25
- logger_1.debug(`EXEC ENDED with event: ${event}, message: ${message}`);
26
- logger_1.debug('TOTAL DURATION OF COMMAND EXEC : ' + duration);
25
+ (0, logger_1.debug)(`EXEC ENDED with event: ${event}, message: ${message}`);
26
+ (0, logger_1.debug)('TOTAL DURATION OF COMMAND EXEC : ' + duration);
27
27
  try {
28
28
  const httpLog = winston_1.logger.transports.find((transport) => {
29
29
  return (transport.filename ===
@@ -32,14 +32,14 @@ exports.default = (event, message, duration) => __awaiter(void 0, void 0, void 0
32
32
  if (runtime_store_1.default.get('credential', false) &&
33
33
  config_store_1.default.get('usage', false) &&
34
34
  httpLog !== undefined) {
35
- const httpLogger = yield endpoints_1.logAPI();
35
+ const httpLogger = yield (0, endpoints_1.logAPI)();
36
36
  if (httpLogger === undefined) {
37
- logger_1.debug('Unable to initialise the log API');
37
+ (0, logger_1.debug)('Unable to initialise the log API');
38
38
  return;
39
39
  }
40
40
  winston_1.logger.remove(httpLog);
41
- const rl = readline_1.createInterface({
42
- input: fs_1.SYNC.getReadStream(path_1.join(httpLog.dirname, httpLog.filename)),
41
+ const rl = (0, readline_1.createInterface)({
42
+ input: fs_1.SYNC.getReadStream((0, path_1.join)(httpLog.dirname, httpLog.filename)),
43
43
  crlfDelay: Infinity
44
44
  });
45
45
  const logInput = yield new Promise((resolve) => {
@@ -55,6 +55,6 @@ exports.default = (event, message, duration) => __awaiter(void 0, void 0, void 0
55
55
  }
56
56
  catch (e) {
57
57
  const err = error_1.default.getErrorInstance(e);
58
- logger_1.debug('Unable to send debug log to server: ' + err.message);
58
+ (0, logger_1.debug)('Unable to send debug log to server: ' + err.message);
59
59
  }
60
60
  });
@@ -1,7 +1,11 @@
1
1
  'use strict';
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -8,14 +8,14 @@ const dc_1 = require("../../../dc");
8
8
  const dc_type_1 = __importDefault(require("./dc-type"));
9
9
  class AUTH {
10
10
  static get web() {
11
- const dc = dc_1.getActiveDCType();
11
+ const dc = (0, dc_1.getActiveDCType)();
12
12
  if (dc === undefined) {
13
13
  return AUTH._web[dc_type_1.default.us.ref];
14
14
  }
15
15
  return AUTH._web[dc.w_auth];
16
16
  }
17
17
  static get mobile() {
18
- const dc = dc_1.getActiveDCType();
18
+ const dc = (0, dc_1.getActiveDCType)();
19
19
  if (dc === undefined) {
20
20
  return AUTH._mobile[dc_type_1.default.us.ref];
21
21
  }
@@ -25,13 +25,13 @@ class AUTH {
25
25
  exports.default = AUTH;
26
26
  AUTH._web = {
27
27
  [dc_type_1.default.us.ref]: {
28
- id: env_1.envOverride('W_CATALYST_CLIENT_ID', '1000.D5IIHDXSPN2MII26AD0V61I6RMVSNM'),
29
- secret: env_1.envOverride('W_CATALYST_CLIENT_SECRET', '02ee875ecfc50573e5cc8d62916ad3077be20d0f42')
28
+ id: (0, env_1.envOverride)('W_CATALYST_CLIENT_ID', '1000.D5IIHDXSPN2MII26AD0V61I6RMVSNM'),
29
+ secret: (0, env_1.envOverride)('W_CATALYST_CLIENT_SECRET', '02ee875ecfc50573e5cc8d62916ad3077be20d0f42')
30
30
  }
31
31
  };
32
32
  AUTH._mobile = {
33
33
  [dc_type_1.default.us.ref]: {
34
- id: env_1.envOverride('M_CATALYST_CLIENT_ID', '1004.NMUISG5YKILERY9G29LJHZWIY9II7Y'),
35
- secret: env_1.envOverride('M_CATALYST_CLIENT_SECRET', 'ee359029dc211b37c797d3584c59953f2bd6aa1adc')
34
+ id: (0, env_1.envOverride)('M_CATALYST_CLIENT_ID', '1004.NMUISG5YKILERY9G29LJHZWIY9II7Y'),
35
+ secret: (0, env_1.envOverride)('M_CATALYST_CLIENT_SECRET', 'ee359029dc211b37c797d3584c59953f2bd6aa1adc')
36
36
  }
37
37
  };
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const path_1 = require("path");
7
7
  const file_names_1 = __importDefault(require("./file-names"));
8
8
  const { node_main, node_package, java_main, java_classpath, java_project } = file_names_1.default.functions;
9
- const template_root = path_1.join(__dirname, '../../../../templates');
9
+ const template_root = (0, path_1.join)(__dirname, '../../../../templates');
10
10
  const handlers = {
11
11
  bot_handler: 'bot_handler',
12
12
  command_handler: 'command_handler',
@@ -17,7 +17,7 @@ const handlers = {
17
17
  installation_validator: 'installation_validator'
18
18
  };
19
19
  exports.default = Object.freeze({
20
- event_template_dir: path_1.join(template_root, './event/integ/cliq/'),
20
+ event_template_dir: (0, path_1.join)(template_root, './event/integ/cliq/'),
21
21
  node_handlers_template_dir: './handlers',
22
22
  java_handlers_template_dir: './com/handlers',
23
23
  node_handlers_path: 'handlers/',
@@ -2,44 +2,44 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const path_1 = require("path");
4
4
  const constants_1 = require("../../constants");
5
- const TEMPLATE_ROOT = path_1.resolve(__dirname, '../../../../templates');
5
+ const TEMPLATE_ROOT = (0, path_1.resolve)(__dirname, '../../../../templates');
6
6
  exports.default = Object.freeze({
7
- banner: path_1.join(TEMPLATE_ROOT, 'banner.txt'),
8
- login_success: path_1.join(TEMPLATE_ROOT, 'loginSuccess.html'),
9
- login_fail: path_1.join(TEMPLATE_ROOT, 'loginFailure.html'),
7
+ banner: (0, path_1.join)(TEMPLATE_ROOT, 'banner.txt'),
8
+ login_success: (0, path_1.join)(TEMPLATE_ROOT, 'loginSuccess.html'),
9
+ login_fail: (0, path_1.join)(TEMPLATE_ROOT, 'loginFailure.html'),
10
10
  client: {
11
11
  basic: {
12
- new: path_1.join(TEMPLATE_ROOT, 'init', 'client', 'basic'),
13
- socket: path_1.join(TEMPLATE_ROOT, 'web-socket.txt')
12
+ new: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'client', 'basic'),
13
+ socket: (0, path_1.join)(TEMPLATE_ROOT, 'web-socket.txt')
14
14
  },
15
- lyte: path_1.join(TEMPLATE_ROOT, 'init', 'client', 'lyte'),
15
+ lyte: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'client', 'lyte'),
16
16
  react: {
17
- js: path_1.join(TEMPLATE_ROOT, 'init', 'client', 'react', 'react_js'),
18
- ts: path_1.join(TEMPLATE_ROOT, 'init', 'client', 'react', 'react_ts')
17
+ js: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'client', 'react', 'react_js'),
18
+ ts: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'client', 'react', 'react_ts')
19
19
  }
20
20
  },
21
21
  applogic: {
22
- node: path_1.join(TEMPLATE_ROOT, 'init', 'applogic', 'node')
22
+ node: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'applogic', 'node')
23
23
  },
24
24
  functions: {
25
25
  node: {
26
- bio: path_1.join(TEMPLATE_ROOT, 'init', 'functions', 'node', 'bio'),
27
- event: path_1.join(TEMPLATE_ROOT, 'init', 'functions', 'node', 'event'),
28
- cron: path_1.join(TEMPLATE_ROOT, 'init', 'functions', 'node', 'cron'),
29
- aio: path_1.join(TEMPLATE_ROOT, 'init', 'functions', 'node', 'aio'),
26
+ bio: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'functions', 'node', 'bio'),
27
+ event: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'functions', 'node', 'event'),
28
+ cron: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'functions', 'node', 'cron'),
29
+ aio: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'functions', 'node', 'aio'),
30
30
  integ: {
31
- [constants_1.INTEG.services.cliq]: path_1.join(TEMPLATE_ROOT, 'init', 'functions', 'node', 'integ', 'cliq')
31
+ [constants_1.INTEG.services.cliq]: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'functions', 'node', 'integ', 'cliq')
32
32
  }
33
33
  },
34
34
  java: {
35
- bio: path_1.join(TEMPLATE_ROOT, 'init', 'functions', 'java', 'bio'),
36
- event: path_1.join(TEMPLATE_ROOT, 'init', 'functions', 'java', 'event'),
37
- cron: path_1.join(TEMPLATE_ROOT, 'init', 'functions', 'java', 'cron'),
38
- aio: path_1.join(TEMPLATE_ROOT, 'init', 'functions', 'java', 'aio'),
35
+ bio: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'functions', 'java', 'bio'),
36
+ event: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'functions', 'java', 'event'),
37
+ cron: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'functions', 'java', 'cron'),
38
+ aio: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'functions', 'java', 'aio'),
39
39
  integ: {
40
- [constants_1.INTEG.services.cliq]: path_1.join(TEMPLATE_ROOT, 'init', 'functions', 'java', 'integ', 'cliq')
40
+ [constants_1.INTEG.services.cliq]: (0, path_1.join)(TEMPLATE_ROOT, 'init', 'functions', 'java', 'integ', 'cliq')
41
41
  }
42
42
  }
43
43
  },
44
- event_data: path_1.join(TEMPLATE_ROOT, 'event', 'data.json')
44
+ event_data: (0, path_1.join)(TEMPLATE_ROOT, 'event', 'data.json')
45
45
  });
@@ -8,28 +8,28 @@ const dc_js_1 = require("../../../dc.js");
8
8
  const dc_type_js_1 = __importDefault(require("./dc-type.js"));
9
9
  class URL {
10
10
  static get auth() {
11
- const dc = dc_js_1.getActiveDCType();
11
+ const dc = (0, dc_js_1.getActiveDCType)();
12
12
  if (dc === undefined) {
13
13
  return URL._auth;
14
14
  }
15
15
  return URL._auth.replace('.com', dc.ext);
16
16
  }
17
17
  static get admin() {
18
- const dc = dc_js_1.getActiveDCType();
18
+ const dc = (0, dc_js_1.getActiveDCType)();
19
19
  if (dc === undefined) {
20
20
  return URL._admin;
21
21
  }
22
22
  return URL._admin.replace('.com', dc.ext);
23
23
  }
24
24
  static get app() {
25
- const dc = dc_js_1.getActiveDCType();
25
+ const dc = (0, dc_js_1.getActiveDCType)();
26
26
  if (dc === undefined) {
27
27
  return URL._app;
28
28
  }
29
29
  return URL._app.replace('.com', dc.ext);
30
30
  }
31
31
  static get catalystStatic() {
32
- const dc = dc_js_1.getActiveDCType();
32
+ const dc = (0, dc_js_1.getActiveDCType)();
33
33
  if (dc === undefined) {
34
34
  return URL._catalystStatic;
35
35
  }
@@ -39,7 +39,7 @@ class URL {
39
39
  return URL._catalystStatic.replace('.com', dc.ext);
40
40
  }
41
41
  static get console() {
42
- const dc = dc_js_1.getActiveDCType();
42
+ const dc = (0, dc_js_1.getActiveDCType)();
43
43
  if (dc === undefined) {
44
44
  return URL._console;
45
45
  }
@@ -47,9 +47,9 @@ class URL {
47
47
  }
48
48
  }
49
49
  exports.default = URL;
50
- URL._auth = env_js_1.envOverride('CATALYST_AUTH_URL', 'https://accounts.zoho.com');
51
- URL._admin = env_js_1.envOverride('CATALYST_ADMIN_URL', 'https://api.catalyst.zoho.com');
52
- URL._app = env_js_1.envOverride('CATALYST_APP_URL', 'https://catalystserverless.com');
53
- URL._zohoStatic = env_js_1.envOverride('ZOHO_STATIC', 'https://www.zoho.com/catalyst');
54
- URL._catalystStatic = env_js_1.envOverride('CATALYST_STATIC', 'https://catalyst.zoho.com');
55
- URL._console = env_js_1.envOverride('CATALYST_CONSOLE_URL', 'https://console.catalyst.zoho.com');
50
+ URL._auth = (0, env_js_1.envOverride)('CATALYST_AUTH_URL', 'https://accounts.zoho.com');
51
+ URL._admin = (0, env_js_1.envOverride)('CATALYST_ADMIN_URL', 'https://api.catalyst.zoho.com');
52
+ URL._app = (0, env_js_1.envOverride)('CATALYST_APP_URL', 'https://catalystserverless.com');
53
+ URL._zohoStatic = (0, env_js_1.envOverride)('ZOHO_STATIC', 'https://www.zoho.com/catalyst');
54
+ URL._catalystStatic = (0, env_js_1.envOverride)('CATALYST_STATIC', 'https://catalyst.zoho.com');
55
+ URL._console = (0, env_js_1.envOverride)('CATALYST_CONSOLE_URL', 'https://console.catalyst.zoho.com');
@@ -13,7 +13,7 @@ function help() {
13
13
  let exitCode = 0;
14
14
  const logs = runtime_store_1.default.get('log');
15
15
  if (logs === undefined) {
16
- logger_1.debug('NO ERRORS REGISTERED');
16
+ (0, logger_1.debug)('NO ERRORS REGISTERED');
17
17
  return exitCode;
18
18
  }
19
19
  const logKeys = Object.keys(logs);
@@ -34,9 +34,9 @@ function help() {
34
34
  return;
35
35
  });
36
36
  }
37
- const docPath = key.replace(path_1.join(__dirname, '../../lib'), path_1.join(__dirname, '../../docs')) + '.toml';
37
+ const docPath = key.replace((0, path_1.join)(__dirname, '../../lib'), (0, path_1.join)(__dirname, '../../docs')) + '.toml';
38
38
  const doc = fs_1.SYNC.readFile(docPath) || '';
39
- const catHelp = toml_1.default(doc);
39
+ const catHelp = (0, toml_1.default)(doc);
40
40
  errQueue.forEach((err) => {
41
41
  exitCode = err.exit > exitCode ? err.exit : exitCode;
42
42
  if (err.errorId === undefined || catHelp === undefined || catHelp === {}) {
@@ -46,18 +46,18 @@ function help() {
46
46
  const arg = err.arg || [];
47
47
  const helpTemplate = catHelp[err.errorId];
48
48
  if (helpTemplate === undefined || helpTemplate.context === undefined) {
49
- logger_1.debug('Error when fetching the help');
50
- logger_1.debug('No Help found for errorId: ' + err.errorId);
49
+ (0, logger_1.debug)('Error when fetching the help');
50
+ (0, logger_1.debug)('No Help found for errorId: ' + err.errorId);
51
51
  outputError(err, errQueue);
52
52
  return;
53
53
  }
54
54
  const help = fillTemplate(helpTemplate.context, helpTemplate.aid || '', ...arg);
55
- logger_1.info();
56
- logger_1.labeled(ansi_colors_1.bold('Error'), help.context).ERROR();
55
+ (0, logger_1.info)();
56
+ (0, logger_1.labeled)((0, ansi_colors_1.bold)('Error'), help.context).ERROR();
57
57
  debugLog(err);
58
- logger_1.log('error', help.aid);
58
+ (0, logger_1.log)('error', help.aid);
59
59
  if (helpTemplate.link && helpTemplate.link !== '') {
60
- logger_1.log('error', ansi_colors_1.bold(ansi_colors_1.blue('REF: ') + ansi_colors_1.underline(helpTemplate.link)));
60
+ (0, logger_1.log)('error', (0, ansi_colors_1.bold)((0, ansi_colors_1.blue)('REF: ') + (0, ansi_colors_1.underline)(helpTemplate.link)));
61
61
  }
62
62
  errQueue.shift();
63
63
  });
@@ -66,23 +66,23 @@ function help() {
66
66
  }
67
67
  exports.default = help;
68
68
  function outputError(err, errQueue) {
69
- logger_1.error(err.message);
69
+ (0, logger_1.error)(err.message);
70
70
  debugLog(err);
71
71
  errQueue.shift();
72
72
  if (err.exit === 2) {
73
- logger_1.info(`Kindly contact Catalyst support [${ansi_colors_1.bold.underline('support@zohocatalyst.com')}] if you need any further assistance`);
73
+ (0, logger_1.info)(`Kindly contact Catalyst support [${ansi_colors_1.bold.underline('support@zohocatalyst.com')}] if you need any further assistance`);
74
74
  }
75
75
  }
76
76
  function debugLog(err) {
77
- logger_1.debug('Error Stack: ' + err.stack);
77
+ (0, logger_1.debug)('Error Stack: ' + err.stack);
78
78
  if (err.original) {
79
- logger_1.debug('Original Error: ' +
79
+ (0, logger_1.debug)('Original Error: ' +
80
80
  (typeof err.original === 'string' ? err.original : err.original.stack));
81
81
  }
82
82
  if (err.context) {
83
- logger_1.debug('Error Context: ' + JSON.stringify(err.context, undefined, 2));
83
+ (0, logger_1.debug)('Error Context: ' + JSON.stringify(err.context, undefined, 2));
84
84
  }
85
85
  if (err.status) {
86
- logger_1.debug('Error Status: ' + err.status);
86
+ (0, logger_1.debug)('Error Status: ' + err.status);
87
87
  }
88
88
  }
@@ -1,7 +1,11 @@
1
1
  'use strict';
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -20,14 +20,14 @@ const path_1 = __importDefault(require("path"));
20
20
  const utils_js_1 = require("../utils.js");
21
21
  function dirExists(pth) {
22
22
  return __awaiter(this, void 0, void 0, function* () {
23
- const stats = yield fs_extra_1.default.stat(utils_js_1.untildify(pth)).catch(() => false);
23
+ const stats = yield fs_extra_1.default.stat((0, utils_js_1.untildify)(pth)).catch(() => false);
24
24
  return stats && stats.isDirectory();
25
25
  });
26
26
  }
27
27
  exports.dirExists = dirExists;
28
28
  function fileExists(pth) {
29
29
  return __awaiter(this, void 0, void 0, function* () {
30
- const stats = yield fs_extra_1.default.stat(utils_js_1.untildify(pth)).catch(() => false);
30
+ const stats = yield fs_extra_1.default.stat((0, utils_js_1.untildify)(pth)).catch(() => false);
31
31
  return stats && stats.isFile();
32
32
  });
33
33
  }
@@ -89,7 +89,7 @@ function walk(dir, { exclude = [], excludeDir = true, depth = -1 } = {}) {
89
89
  let excludeMatch = false;
90
90
  if (!(isEntryPthDir && !excludeDir)) {
91
91
  for (const glob of exclude) {
92
- excludeMatch = excludeMatch || minimatch_1.default(entryPath, glob);
92
+ excludeMatch = excludeMatch || (0, minimatch_1.default)(entryPath, glob);
93
93
  }
94
94
  }
95
95
  if (excludeMatch) {
@@ -171,7 +171,7 @@ function rename(pth, modifier = (baseName) => baseName) {
171
171
  exports.rename = rename;
172
172
  const findAndReplace = (pth) => (templates, finalWords) => __awaiter(void 0, void 0, void 0, function* () {
173
173
  if (Array.isArray(pth)) {
174
- yield Promise.all(pth.map((el) => exports.findAndReplace(el)(templates, finalWords)));
174
+ yield Promise.all(pth.map((el) => (0, exports.findAndReplace)(el)(templates, finalWords)));
175
175
  return;
176
176
  }
177
177
  const files = yield walk(pth);
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.untildify = void 0;
4
4
  const os_1 = require("os");
5
5
  const tildRegex = /^~(?=$|\/|\\)/;
6
- const homeDirectory = os_1.homedir();
6
+ const homeDirectory = (0, os_1.homedir)();
7
7
  const untildify = (pth) => homeDirectory ? pth.replace(tildRegex, homeDirectory) : pth;
8
8
  exports.untildify = untildify;
@@ -13,11 +13,11 @@ function log(level, message, ...meta) {
13
13
  }
14
14
  exports.log = log;
15
15
  function info(msg = '', ...params) {
16
- winston_1.default.info(util_1.format(msg, ...params));
16
+ winston_1.default.info((0, util_1.format)(msg, ...params));
17
17
  }
18
18
  exports.info = info;
19
19
  function debug(msg = '', ...params) {
20
- winston_1.default.debug(util_1.format(msg, ...params));
20
+ winston_1.default.debug((0, util_1.format)(msg, ...params));
21
21
  }
22
22
  exports.debug = debug;
23
23
  function success(msg, level = 'info', label = '') {
@@ -7,7 +7,7 @@ const toml_1 = require("toml");
7
7
  const error_1 = __importDefault(require("../../error"));
8
8
  exports.default = (str) => {
9
9
  try {
10
- return toml_1.parse(str);
10
+ return (0, toml_1.parse)(str);
11
11
  }
12
12
  catch (e) {
13
13
  const err = error_1.default.getErrorInstance(e, {
@@ -27,7 +27,7 @@ function getDefaultProject(throwError) {
27
27
  throw new error_1.default(constants_1.FILENAME.rc + ' file needed', {
28
28
  exit: 1,
29
29
  errorId: 'PROJ-1',
30
- arg: [constants_1.FILENAME.rc, ansi_colors_1.bold('catalyst init project')]
30
+ arg: [constants_1.FILENAME.rc, (0, ansi_colors_1.bold)('catalyst init project')]
31
31
  });
32
32
  }
33
33
  return;
@@ -41,7 +41,7 @@ function getDefaultEnv(throwError) {
41
41
  throw new error_1.default(constants_1.FILENAME.rc + ' file needed', {
42
42
  exit: 1,
43
43
  errorId: 'PROJ-1',
44
- arg: [constants_1.FILENAME.rc, ansi_colors_1.bold('catalyst init project')]
44
+ arg: [constants_1.FILENAME.rc, (0, ansi_colors_1.bold)('catalyst init project')]
45
45
  });
46
46
  }
47
47
  return;
@@ -55,7 +55,7 @@ function getProjectId(fallback) {
55
55
  throw new error_1.default('ProjectId is needed', {
56
56
  exit: 1,
57
57
  errorId: 'PROJ-2',
58
- arg: ['Project ID', ansi_colors_1.bold('catalyst init project --force')]
58
+ arg: ['Project ID', (0, ansi_colors_1.bold)('catalyst init project --force')]
59
59
  });
60
60
  }
61
61
  return fallback;
@@ -70,7 +70,7 @@ function getProjectName(fallback) {
70
70
  throw new error_1.default('ProjectName is needed', {
71
71
  exit: 1,
72
72
  errorId: 'PROJ-2',
73
- arg: ['Project Name', ansi_colors_1.bold('catalyst init project --force')]
73
+ arg: ['Project Name', (0, ansi_colors_1.bold)('catalyst init project --force')]
74
74
  });
75
75
  }
76
76
  return fallback;
@@ -89,7 +89,7 @@ function getDomainPrefix(fallback) {
89
89
  throw new error_1.default('domainName is needed', {
90
90
  exit: 1,
91
91
  errorId: 'PROJ-2',
92
- arg: ['Domain Name', ansi_colors_1.bold('catalyst init project --force')]
92
+ arg: ['Domain Name', (0, ansi_colors_1.bold)('catalyst init project --force')]
93
93
  });
94
94
  }
95
95
  return fallback;
@@ -104,7 +104,7 @@ function getDomainKey(fallback) {
104
104
  throw new error_1.default('domainId is needed', {
105
105
  exit: 1,
106
106
  errorId: 'PROJ-2',
107
- arg: ['Domain ID', ansi_colors_1.bold('catalyst init project --force')]
107
+ arg: ['Domain ID', (0, ansi_colors_1.bold)('catalyst init project --force')]
108
108
  });
109
109
  }
110
110
  return fallback;
@@ -45,7 +45,7 @@ function spawn(command, opts, _a = {}) {
45
45
  return {
46
46
  SYNC: () => cross_spawn_1.default.sync(command, opts, Object.assign({ cwd, stdio, shell }, otherOpts)),
47
47
  ASYNC: () => {
48
- const childProcess = cross_spawn_1.default(command, opts, Object.assign({ cwd,
48
+ const childProcess = (0, cross_spawn_1.default)(command, opts, Object.assign({ cwd,
49
49
  stdio,
50
50
  shell }, otherOpts));
51
51
  return new Promise((res, rej) => {
@@ -68,7 +68,7 @@ function spawn(command, opts, _a = {}) {
68
68
  });
69
69
  },
70
70
  RAW: () => {
71
- const child = cross_spawn_1.default(command, opts, Object.assign({ cwd, stdio, shell }, otherOpts)).on('error', logger_1.debug);
71
+ const child = (0, cross_spawn_1.default)(command, opts, Object.assign({ cwd, stdio, shell }, otherOpts)).on('error', logger_1.debug);
72
72
  return child;
73
73
  }
74
74
  };
@@ -98,7 +98,7 @@ function which(commandName, { alwaysResolve = true }) {
98
98
  if (/[\x00-\x1f<>:"|?*]/.test(commandName)) {
99
99
  alwaysResolve ? resolve(false) : reject('controll char test failed');
100
100
  }
101
- child_process_1.exec('where ' + cleanedCmd, (error) => {
101
+ (0, child_process_1.exec)('where ' + cleanedCmd, (error) => {
102
102
  if (error !== null) {
103
103
  alwaysResolve ? resolve(false) : reject(error);
104
104
  }
@@ -108,7 +108,7 @@ function which(commandName, { alwaysResolve = true }) {
108
108
  });
109
109
  }
110
110
  else {
111
- child_process_1.exec('command -v ' +
111
+ (0, child_process_1.exec)('command -v ' +
112
112
  cleanedCmd +
113
113
  ' 2>/dev/null' +
114
114
  ' && { echo >&1 ' +