zcatalyst-cli 1.25.2 → 1.26.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 (263) hide show
  1. package/lib/api-timer.d.ts +0 -1
  2. package/lib/apig-utils.d.ts +1 -1
  3. package/lib/apig-utils.js +1 -1
  4. package/lib/appsail-utils.js +80 -13
  5. package/lib/archiver.d.ts +0 -4
  6. package/lib/archiver.js +21 -11
  7. package/lib/authentication/constants/auth.js +1 -1
  8. package/lib/authentication/credential.js +3 -3
  9. package/lib/authentication/index.js +25 -14
  10. package/lib/authentication/login.d.ts +0 -2
  11. package/lib/authentication/login.js +23 -10
  12. package/lib/bin/catalyst.js +17 -7
  13. package/lib/client-utils.d.ts +3 -3
  14. package/lib/client-utils.js +2 -2
  15. package/lib/client.js +19 -9
  16. package/lib/code-deck.d.ts +0 -2
  17. package/lib/code-deck.js +4 -4
  18. package/lib/command_needs/config.js +1 -1
  19. package/lib/command_needs/rc.js +5 -2
  20. package/lib/commands/appsail/add.js +17 -7
  21. package/lib/commands/client/setup.js +17 -7
  22. package/lib/commands/config/set.js +5 -3
  23. package/lib/commands/deploy/appsail.js +37 -14
  24. package/lib/commands/deploy/index.js +88 -66
  25. package/lib/commands/deploy/slate.js +37 -14
  26. package/lib/commands/event/generate/integ.js +18 -9
  27. package/lib/commands/functions/add.js +17 -7
  28. package/lib/commands/functions/execute.js +17 -7
  29. package/lib/commands/functions/setup.js +17 -7
  30. package/lib/commands/functions/shell.js +17 -7
  31. package/lib/commands/iac/import.js +18 -8
  32. package/lib/commands/iac/pack.js +17 -7
  33. package/lib/commands/iac/status.js +17 -7
  34. package/lib/commands/index.js +20 -12
  35. package/lib/commands/init.js +17 -7
  36. package/lib/commands/login.js +17 -7
  37. package/lib/commands/logout.js +17 -7
  38. package/lib/commands/project/list.js +17 -7
  39. package/lib/commands/project/use.js +1 -0
  40. package/lib/commands/pull.js +17 -7
  41. package/lib/commands/run.js +17 -7
  42. package/lib/commands/serve.js +17 -7
  43. package/lib/commands/signals/generate/index.js +1 -1
  44. package/lib/commands/slate/create.js +17 -7
  45. package/lib/commands/slate/link.js +18 -7
  46. package/lib/commands/slate/unlink.js +16 -4
  47. package/lib/commands/token/generate.js +17 -7
  48. package/lib/commands/token/list.js +17 -7
  49. package/lib/commands/token/revoke.js +17 -7
  50. package/lib/commands/zest/generate/index.js +21 -11
  51. package/lib/deploy/features/appsail/index.js +2 -3
  52. package/lib/deploy/features/appsail/pack.d.ts +0 -1
  53. package/lib/deploy/features/appsail/pack.js +2 -3
  54. package/lib/deploy/features/appsail/utils.js +7 -8
  55. package/lib/deploy/features/functions/languages/index.js +3 -4
  56. package/lib/deploy/features/index.js +17 -7
  57. package/lib/deploy/features/slate.js +2 -3
  58. package/lib/deploy/index.js +2 -2
  59. package/lib/deploy/util.d.ts +2 -0
  60. package/lib/deploy/util.js +3 -1
  61. package/lib/docs/commands/signals/generate/generate.toml +19 -0
  62. package/lib/docs/commands/slate/unlink.toml +9 -0
  63. package/lib/docs/fn-utils/lib/node.toml +4 -0
  64. package/lib/docs/init/dependencies/python/ensure-python.toml +4 -0
  65. package/lib/docs/serve/server/lib/slate/index.toml +15 -0
  66. package/lib/docs/slate-utils.toml +9 -0
  67. package/lib/endpoints/index.d.ts +2 -1
  68. package/lib/endpoints/index.js +88 -79
  69. package/lib/endpoints/lib/apig.d.ts +0 -1
  70. package/lib/endpoints/lib/apig.js +2 -2
  71. package/lib/endpoints/lib/applogic.d.ts +0 -1
  72. package/lib/endpoints/lib/applogic.js +2 -2
  73. package/lib/endpoints/lib/appsail.d.ts +1 -4
  74. package/lib/endpoints/lib/appsail.js +7 -7
  75. package/lib/endpoints/lib/client.d.ts +0 -1
  76. package/lib/endpoints/lib/code-deck.js +1 -1
  77. package/lib/endpoints/lib/common.d.ts +0 -2
  78. package/lib/endpoints/lib/ds-bulk.js +2 -2
  79. package/lib/endpoints/lib/env.js +2 -2
  80. package/lib/endpoints/lib/filestore.d.ts +0 -1
  81. package/lib/endpoints/lib/functions.d.ts +0 -1
  82. package/lib/endpoints/lib/functions.js +2 -2
  83. package/lib/endpoints/lib/git-hub.d.ts +0 -2
  84. package/lib/endpoints/lib/iac.d.ts +0 -3
  85. package/lib/endpoints/lib/iac.js +2 -2
  86. package/lib/endpoints/lib/project.d.ts +0 -1
  87. package/lib/endpoints/lib/project.js +2 -2
  88. package/lib/endpoints/lib/sdk.d.ts +0 -2
  89. package/lib/endpoints/lib/sdk.js +1 -1
  90. package/lib/endpoints/lib/slate.d.ts +0 -1
  91. package/lib/endpoints/lib/stratus.d.ts +0 -1
  92. package/lib/endpoints/lib/user.d.ts +0 -2
  93. package/lib/endpoints/lib/user.js +2 -1
  94. package/lib/error/context-help.js +1 -1
  95. package/lib/error/index.js +2 -2
  96. package/lib/event_generate/cache.js +4 -4
  97. package/lib/event_generate/custom.js +1 -2
  98. package/lib/event_generate/datastore.js +4 -4
  99. package/lib/event_generate/filestore.js +4 -4
  100. package/lib/event_generate/github.js +2 -2
  101. package/lib/event_generate/index.js +19 -11
  102. package/lib/event_generate/stratus.js +2 -2
  103. package/lib/event_generate/user.js +2 -2
  104. package/lib/event_generate/webapp.js +2 -2
  105. package/lib/execute/caller.d.ts +0 -1
  106. package/lib/execute/caller.js +20 -7
  107. package/lib/execute/index.js +27 -4
  108. package/lib/execute-script.js +22 -13
  109. package/lib/express_middlewares/auth-checker.js +2 -3
  110. package/lib/express_middlewares/project.d.ts +1 -1
  111. package/lib/fn-utils/index.js +17 -7
  112. package/lib/fn-utils/lib/browserLogic.js +4 -5
  113. package/lib/fn-utils/lib/common.d.ts +0 -1
  114. package/lib/fn-utils/lib/common.js +25 -26
  115. package/lib/fn-utils/lib/integ.js +2 -3
  116. package/lib/fn-utils/lib/java/classpath.js +2 -3
  117. package/lib/fn-utils/lib/java/compile.js +4 -4
  118. package/lib/fn-utils/lib/java/ensure-java-userconfig.d.ts +10 -0
  119. package/lib/fn-utils/lib/java/ensure-java-userconfig.js +45 -23
  120. package/lib/fn-utils/lib/java/index.d.ts +0 -1
  121. package/lib/fn-utils/lib/java/index.js +11 -11
  122. package/lib/fn-utils/lib/java/keywords.js +2 -2
  123. package/lib/fn-utils/lib/node.d.ts +1 -1
  124. package/lib/fn-utils/lib/node.js +67 -15
  125. package/lib/fn-utils/lib/python.js +29 -19
  126. package/lib/iac/status/util/index.d.ts +1 -1
  127. package/lib/init/dependencies/npm-install.js +2 -2
  128. package/lib/init/dependencies/python/ensure-python.d.ts +2 -2
  129. package/lib/init/dependencies/python/ensure-python.js +65 -58
  130. package/lib/init/dependencies/python/pip-install.d.ts +3 -5
  131. package/lib/init/dependencies/python/pip-install.js +14 -53
  132. package/lib/init/features/appsail/utils.js +21 -12
  133. package/lib/init/features/client/index.js +18 -9
  134. package/lib/init/features/client/initializers/angular.js +17 -7
  135. package/lib/init/features/client/initializers/basic.js +17 -7
  136. package/lib/init/features/client/initializers/lyte.js +17 -7
  137. package/lib/init/features/client/initializers/react.js +17 -7
  138. package/lib/init/features/index.js +29 -20
  139. package/lib/init/features/project.js +5 -5
  140. package/lib/init/features/slate/index.js +198 -69
  141. package/lib/init/util/client.js +23 -13
  142. package/lib/init/util/common.js +5 -6
  143. package/lib/init/util/project.js +1 -1
  144. package/lib/internal/api.d.ts +0 -3
  145. package/lib/internal/api.js +19 -9
  146. package/lib/internal/command.js +18 -9
  147. package/lib/migration/global/1.25.0.d.ts +2 -0
  148. package/lib/migration/global/1.25.0.js +28 -0
  149. package/lib/migration/index.js +20 -12
  150. package/lib/option-filter.js +19 -10
  151. package/lib/optional-import.js +19 -10
  152. package/lib/plugin-loader.d.ts +0 -2
  153. package/lib/plugin-loader.js +18 -8
  154. package/lib/port-resolver.js +10 -10
  155. package/lib/prompt/index.d.ts +3 -3
  156. package/lib/prompt/index.js +17 -7
  157. package/lib/prompt/types/file-path.d.ts +0 -1
  158. package/lib/prompt/types/search-box.d.ts +0 -1
  159. package/lib/prompt/types/tree.d.ts +1 -2
  160. package/lib/prompt/types/tree.js +10 -10
  161. package/lib/prompt/types/with-description.d.ts +0 -1
  162. package/lib/pull/features/functions/index.js +71 -52
  163. package/lib/pull/features/functions/languages.js +3 -4
  164. package/lib/pull/features/index.js +17 -7
  165. package/lib/repl-server.d.ts +0 -1
  166. package/lib/repl-server.js +9 -1
  167. package/lib/serve/features/apig.js +19 -1
  168. package/lib/serve/features/appsail.d.ts +1 -0
  169. package/lib/serve/features/appsail.js +51 -7
  170. package/lib/serve/features/index.js +22 -13
  171. package/lib/serve/index.js +20 -7
  172. package/lib/serve/server/index.d.ts +0 -2
  173. package/lib/serve/server/index.js +26 -12
  174. package/lib/serve/server/lib/appsail/index.js +31 -37
  175. package/lib/serve/server/lib/appsail/start.js +12 -5
  176. package/lib/serve/server/lib/appsail/util.d.ts +11 -0
  177. package/lib/serve/server/lib/appsail/util.js +69 -0
  178. package/lib/serve/server/lib/java/index.js +18 -7
  179. package/lib/serve/server/lib/master/appsail.js +3 -4
  180. package/lib/serve/server/lib/master/functions.js +1 -2
  181. package/lib/serve/server/lib/master/index.d.ts +0 -1
  182. package/lib/serve/server/lib/master/index.js +5 -5
  183. package/lib/serve/server/lib/master/slate.js +1 -2
  184. package/lib/serve/server/lib/master/unknown-req-proxy.js +5 -2
  185. package/lib/serve/server/lib/master/utils.d.ts +4 -8
  186. package/lib/serve/server/lib/master/utils.js +4 -6
  187. package/lib/serve/server/lib/master/web-client.js +1 -2
  188. package/lib/serve/server/lib/node/index.js +22 -11
  189. package/lib/serve/server/lib/node/server/browserlogic/utils/playwright-handler.js +1 -1
  190. package/lib/serve/server/lib/node/server/browserlogic/utils/puppeteer-handler.js +1 -1
  191. package/lib/serve/server/lib/node/server/browserlogic/utils/selenium-handler.js +2 -0
  192. package/lib/serve/server/lib/python/index.js +23 -14
  193. package/lib/serve/server/lib/slate/static-server.d.ts +0 -1
  194. package/lib/serve/server/lib/slate/static-server.js +5 -4
  195. package/lib/serve/server/lib/web_client/server.d.ts +0 -1
  196. package/lib/serve/server/lib/web_client/server.js +5 -4
  197. package/lib/shell/dependencies/http-functions.d.ts +0 -2
  198. package/lib/shell/dependencies/http-functions.js +7 -7
  199. package/lib/shell/dependencies/non-http-function/fn-execution-handler.d.ts +0 -2
  200. package/lib/shell/dependencies/non-http-function/fn-execution-handler.js +55 -24
  201. package/lib/shell/dependencies/non-http-function/fn-handler.d.ts +3 -3
  202. package/lib/shell/dependencies/non-http-function/fn-handler.js +54 -20
  203. package/lib/shell/dependencies/non-http-function/node.js +4 -4
  204. package/lib/shell/dependencies/non-http-function/python.d.ts +1 -1
  205. package/lib/shell/dependencies/non-http-function/python.js +11 -13
  206. package/lib/shell/dependencies/non-http-function/slave-manager.d.ts +0 -2
  207. package/lib/shell/dependencies/non-http-function/slave-manager.js +11 -7
  208. package/lib/shell/dependencies/tunnel-server.js +4 -4
  209. package/lib/shell/index.js +50 -3
  210. package/lib/shell/prepare/index.js +4 -3
  211. package/lib/shell/prepare/languages/index.js +18 -9
  212. package/lib/shell/prepare/languages/node.js +29 -19
  213. package/lib/shell/prepare/languages/python.js +6 -12
  214. package/lib/signals/index.js +19 -11
  215. package/lib/slate-utils.js +4 -3
  216. package/lib/throbber/index.d.ts +1 -2
  217. package/lib/throbber/index.js +5 -2
  218. package/lib/throbber/utils.d.ts +0 -1
  219. package/lib/throbber/utils.js +4 -5
  220. package/lib/userConfig.d.ts +14 -0
  221. package/lib/userConfig.js +15 -1
  222. package/lib/util_modules/config/index.js +17 -7
  223. package/lib/util_modules/config/lib/apig.d.ts +1 -0
  224. package/lib/util_modules/config/lib/apig.js +10 -5
  225. package/lib/util_modules/config/lib/appsail.js +7 -7
  226. package/lib/util_modules/config/lib/client.js +5 -6
  227. package/lib/util_modules/config/lib/functions.js +5 -6
  228. package/lib/util_modules/config/lib/slate.js +5 -6
  229. package/lib/util_modules/config-store.d.ts +1 -1
  230. package/lib/util_modules/config-store.js +30 -13
  231. package/lib/util_modules/constants/lib/apig-rules.d.ts +1 -1
  232. package/lib/util_modules/constants/lib/dc-type.js +3 -3
  233. package/lib/util_modules/constants/lib/placeholders.d.ts +1 -1
  234. package/lib/util_modules/constants/lib/placeholders.js +1 -1
  235. package/lib/util_modules/constants/lib/urls.js +2 -9
  236. package/lib/util_modules/container.js +23 -14
  237. package/lib/util_modules/dc.js +3 -4
  238. package/lib/util_modules/env.d.ts +3 -0
  239. package/lib/util_modules/env.js +64 -4
  240. package/lib/util_modules/event-emitter.d.ts +9 -0
  241. package/lib/util_modules/event-emitter.js +68 -0
  242. package/lib/util_modules/fs/index.js +17 -7
  243. package/lib/util_modules/fs/lib/async.d.ts +0 -4
  244. package/lib/util_modules/fs/lib/async.js +46 -46
  245. package/lib/util_modules/fs/lib/sync.d.ts +1 -3
  246. package/lib/util_modules/fs/lib/sync.js +40 -30
  247. package/lib/util_modules/logger/index.js +12 -12
  248. package/lib/util_modules/logger/utils.d.ts +0 -4
  249. package/lib/util_modules/logger/utils.js +1 -1
  250. package/lib/util_modules/logger/winston.js +2 -2
  251. package/lib/util_modules/option.js +5 -6
  252. package/lib/util_modules/project.js +22 -23
  253. package/lib/util_modules/runtime-store.d.ts +2 -2
  254. package/lib/util_modules/server.d.ts +1 -2
  255. package/lib/util_modules/server.js +54 -15
  256. package/lib/util_modules/shell.d.ts +0 -3
  257. package/lib/util_modules/shell.js +5 -6
  258. package/lib/util_modules/toml.js +2 -3
  259. package/package.json +13 -13
  260. package/templates/init/functions/java/event/sample.java +5 -2
  261. package/templates/web-socket.txt +1 -1
  262. /package/lib/docs/{commands/event/generate → event_generate}/index.toml +0 -0
  263. /package/templates/init/functions/java/integ/convokraft/{Sample.java → sample.java} +0 -0
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -19,11 +19,13 @@ const index_1 = require("../../util_modules/logger/index");
19
19
  exports.default = new command_1.default('config:set <key=value>')
20
20
  .description('Set catalyst configuration as a key value pair')
21
21
  .action((details) => __awaiter(void 0, void 0, void 0, function* () {
22
- const args = details.split('=');
23
- if (args.length !== 2) {
22
+ const firstEqualIndex = details.indexOf('=');
23
+ if (firstEqualIndex === -1) {
24
24
  throw new error_1.default('Invalid parameter passed' +
25
25
  `\nplease give the key value pairs splitted by '=' (eg. orgname=zoho) `);
26
26
  }
27
- userConfig_1.default.set(args[0], args[1]);
27
+ const key = details.substring(0, firstEqualIndex);
28
+ const value = details.substring(firstEqualIndex + 1);
29
+ userConfig_1.default.set(key, value);
28
30
  (0, index_1.success)('config updated successfully');
29
31
  }));
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -37,6 +47,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
38
48
  const scopes_1 = __importDefault(require("../../authentication/constants/scopes"));
39
49
  const utils_1 = require("../../deploy/features/appsail/utils");
50
+ const util_1 = require("../../deploy/util");
51
+ const error_1 = __importDefault(require("../../error"));
40
52
  const command_1 = __importDefault(require("../../internal/command"));
41
53
  const index_1 = require("../../util_modules/logger/index");
42
54
  exports.default = new command_1.default('appsail')
@@ -52,13 +64,24 @@ exports.default = new command_1.default('appsail')
52
64
  .needs('config', { optional: true })
53
65
  .needs('rc', { optional: true })
54
66
  .action(() => __awaiter(void 0, void 0, void 0, function* () {
55
- yield (yield Promise.resolve().then(() => __importStar(require('../../deploy')))).default({ feature: 'appsail' });
56
- const deployTargets = (0, utils_1.urlLogger)();
57
- (0, index_1.info)();
58
- if (deployTargets.length === 0) {
59
- (0, index_1.error)('AppSail Deploy failed');
67
+ try {
68
+ util_1.DeployEvents.emit('start');
69
+ yield (yield Promise.resolve().then(() => __importStar(require('../../deploy')))).default({ feature: 'appsail' });
70
+ const deployTargets = (0, utils_1.urlLogger)();
71
+ (0, index_1.info)();
72
+ if (deployTargets.length === 0) {
73
+ (0, index_1.error)('AppSail Deploy failed');
74
+ }
75
+ else {
76
+ (0, index_1.success)('Catalyst AppSail Deploy completed successfully');
77
+ }
78
+ }
79
+ catch (er) {
80
+ const err = error_1.default.getErrorInstance(er);
81
+ util_1.DeployEvents.emit('error', err);
82
+ throw err;
60
83
  }
61
- else {
62
- (0, index_1.success)('Catalyst AppSail Deploy completed successfully');
84
+ finally {
85
+ util_1.DeployEvents.emit('end');
63
86
  }
64
87
  }));
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -46,6 +56,7 @@ const error_1 = __importDefault(require("../../error"));
46
56
  const ansi_colors_1 = require("ansi-colors");
47
57
  const utils_2 = require("../../deploy/features/functions/utils");
48
58
  const slate_2 = __importDefault(require("./slate"));
59
+ const util_1 = require("../../deploy/util");
49
60
  exports.default = new command_1.default('deploy')
50
61
  .description('Deploy the Catalyst project and project resources to the Catalyst development environment from the local directory')
51
62
  .option('--only <targets>', 'only deploy specified, comma-separated targets (e.g. "functions,client,appsail").' +
@@ -58,69 +69,80 @@ exports.default = new command_1.default('deploy')
58
69
  .needs('rc', { optional: true })
59
70
  .addSubCommand(appsail_1.default, slate_2.default)
60
71
  .action(() => __awaiter(void 0, void 0, void 0, function* () {
61
- const optionFilter = yield Promise.resolve().then(() => __importStar(require('../../option-filter')));
62
- optionFilter.filterTargets();
63
- const deployRes = yield (yield Promise.resolve().then(() => __importStar(require('../../deploy')))).default();
64
- const deployTargets = runtime_store_1.default
65
- .get('context.payload.targets', [])
66
- .filter((deploytarget) => {
67
- if (!runtime_store_1.default.get('context.payload.' + deploytarget + '.deploy', false)) {
72
+ try {
73
+ util_1.DeployEvents.emit('start');
74
+ const optionFilter = yield Promise.resolve().then(() => __importStar(require('../../option-filter')));
75
+ optionFilter.filterTargets();
76
+ const deployRes = yield (yield Promise.resolve().then(() => __importStar(require('../../deploy')))).default();
77
+ const deployTargets = runtime_store_1.default
78
+ .get('context.payload.targets', [])
79
+ .filter((deploytarget) => {
80
+ if (!runtime_store_1.default.get('context.payload.' + deploytarget + '.deploy', false)) {
81
+ (0, index_1.info)();
82
+ (0, index_1.labeled)(deploytarget, 'deploy skipped').ERROR();
83
+ return false;
84
+ }
85
+ return true;
86
+ });
87
+ (0, index_1.info)();
88
+ deployTargets.forEach((deploytarget) => {
89
+ switch (deploytarget) {
90
+ case 'client':
91
+ (0, index_1.info)();
92
+ (0, index_1.info)((0, ansi_colors_1.bold)(' >>>>>>>>>>>>> Web Client <<<<<<<<<<<<'));
93
+ (0, index_1.info)();
94
+ const clientTarget = runtime_store_1.default.get('context.payload.client');
95
+ (0, index_1.labeled)('DEPLOYMENT SUCCESSFUL', clientTarget.name).SUCCESS();
96
+ (0, index_1.labeled)('ACCESS URL ', clientTarget.url).MESSAGE();
97
+ (0, index_1.info)();
98
+ break;
99
+ case 'slate':
100
+ (0, index_1.info)((0, ansi_colors_1.bold)(' >>>>>>>>>>>>>>> Slate <<<<<<<<<<<<<<<'));
101
+ (0, slate_1.slateLogger)();
102
+ (0, index_1.info)();
103
+ break;
104
+ case 'apig':
105
+ (0, index_1.info)();
106
+ (0, index_1.info)((0, ansi_colors_1.bold)(' >>>>>>>>>>>>> API Gateway <<<<<<<<<<<'));
107
+ (0, index_1.info)();
108
+ (0, index_1.labeled)('DEPLOYMENT SUCCESSFUL', 'API Gateway').SUCCESS();
109
+ (0, index_1.info)();
110
+ break;
111
+ case 'functions':
112
+ (0, index_1.info)();
113
+ (0, index_1.info)((0, ansi_colors_1.bold)(' >>>>>>>>>>>>>> Functions <<<<<<<<<<<<'));
114
+ (0, index_1.info)();
115
+ (0, utils_2.fnLogger)();
116
+ break;
117
+ case 'appsail':
118
+ (0, index_1.info)();
119
+ (0, index_1.info)((0, ansi_colors_1.bold)(' >>>>>>>>>>>>>>> AppSail <<<<<<<<<<<<<'));
120
+ (0, index_1.info)();
121
+ (0, utils_1.urlLogger)();
122
+ break;
123
+ }
124
+ });
125
+ if (deployTargets.length > 0) {
126
+ (0, index_1.success)('Catalyst deploy complete!');
68
127
  (0, index_1.info)();
69
- (0, index_1.labeled)(deploytarget, 'deploy skipped').ERROR();
70
- return false;
71
128
  }
72
- return true;
73
- });
74
- (0, index_1.info)();
75
- deployTargets.forEach((deploytarget) => {
76
- switch (deploytarget) {
77
- case 'client':
78
- (0, index_1.info)();
79
- (0, index_1.info)((0, ansi_colors_1.bold)(' >>>>>>>>>>>>> Web Client <<<<<<<<<<<<'));
80
- (0, index_1.info)();
81
- const clientTarget = runtime_store_1.default.get('context.payload.client');
82
- (0, index_1.labeled)('DEPLOYMENT SUCCESSFUL', clientTarget.name).SUCCESS();
83
- (0, index_1.labeled)('ACCESS URL ', clientTarget.url).MESSAGE();
84
- (0, index_1.info)();
85
- break;
86
- case 'slate':
87
- (0, index_1.info)((0, ansi_colors_1.bold)(' >>>>>>>>>>>>>>> Slate <<<<<<<<<<<<<<<'));
88
- (0, slate_1.slateLogger)();
89
- (0, index_1.info)();
90
- break;
91
- case 'apig':
92
- (0, index_1.info)();
93
- (0, index_1.info)((0, ansi_colors_1.bold)(' >>>>>>>>>>>>> API Gateway <<<<<<<<<<<'));
94
- (0, index_1.info)();
95
- (0, index_1.labeled)('DEPLOYMENT SUCCESSFUL', 'API Gateway').SUCCESS();
96
- (0, index_1.info)();
97
- break;
98
- case 'functions':
99
- (0, index_1.info)();
100
- (0, index_1.info)((0, ansi_colors_1.bold)(' >>>>>>>>>>>>>> Functions <<<<<<<<<<<<'));
101
- (0, index_1.info)();
102
- (0, utils_2.fnLogger)();
103
- break;
104
- case 'appsail':
105
- (0, index_1.info)();
106
- (0, index_1.info)((0, ansi_colors_1.bold)(' >>>>>>>>>>>>>>> AppSail <<<<<<<<<<<<<'));
107
- (0, index_1.info)();
108
- (0, utils_1.urlLogger)();
109
- break;
129
+ else {
130
+ (0, index_1.error)('No components deployed!');
131
+ (0, index_1.info)();
132
+ }
133
+ if (deployRes.length > 0) {
134
+ throw new error_1.default('Error deploy Catalyst components to remote', {
135
+ original: deployRes,
136
+ skipHelp: true
137
+ });
110
138
  }
111
- });
112
- if (deployTargets.length > 0) {
113
- (0, index_1.success)('Catalyst deploy complete!');
114
- (0, index_1.info)();
115
139
  }
116
- else {
117
- (0, index_1.error)('No components deployed!');
118
- (0, index_1.info)();
140
+ catch (err) {
141
+ const errorInstance = error_1.default.getErrorInstance(err);
142
+ util_1.DeployEvents.emit('error', errorInstance);
143
+ throw errorInstance;
119
144
  }
120
- if (deployRes.length > 0) {
121
- throw new error_1.default('Error deploy Catalyst components to remote', {
122
- original: deployRes,
123
- skipHelp: true
124
- });
145
+ finally {
146
+ util_1.DeployEvents.emit('end');
125
147
  }
126
148
  }));
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -36,6 +46,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
38
48
  const slate_1 = require("../../deploy/features/slate");
49
+ const util_1 = require("../../deploy/util");
50
+ const error_1 = __importDefault(require("../../error"));
39
51
  const command_1 = __importDefault(require("../../internal/command"));
40
52
  const logger_1 = require("../../util_modules/logger");
41
53
  exports.default = new command_1.default('slate')
@@ -46,13 +58,24 @@ exports.default = new command_1.default('slate')
46
58
  .needs('config', { optional: true })
47
59
  .needs('rc', { optional: true })
48
60
  .action(() => __awaiter(void 0, void 0, void 0, function* () {
49
- yield (yield Promise.resolve().then(() => __importStar(require('../../deploy')))).default({ feature: 'slate' });
50
- (0, logger_1.info)();
51
- const deployTargets = (0, slate_1.slateLogger)();
52
- if (deployTargets.length === 0) {
53
- (0, logger_1.error)('Slate Deploy failed');
61
+ try {
62
+ util_1.DeployEvents.emit('start');
63
+ yield (yield Promise.resolve().then(() => __importStar(require('../../deploy')))).default({ feature: 'slate' });
64
+ (0, logger_1.info)();
65
+ const deployTargets = (0, slate_1.slateLogger)();
66
+ if (deployTargets.length === 0) {
67
+ (0, logger_1.error)('Slate Deploy failed');
68
+ }
69
+ else {
70
+ (0, logger_1.success)('Catalyst Slate Deploy is Live!');
71
+ }
72
+ }
73
+ catch (er) {
74
+ const err = error_1.default.getErrorInstance(er);
75
+ util_1.DeployEvents.emit('error', err);
76
+ throw err;
54
77
  }
55
- else {
56
- (0, logger_1.success)('Catalyst Slate Deploy is Live!');
78
+ finally {
79
+ util_1.DeployEvents.emit('end');
57
80
  }
58
81
  }));
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -46,7 +56,6 @@ exports.default = new command_1.default('event:generate:integ <service>')
46
56
  .needs('rc')
47
57
  .needs('auth')
48
58
  .action((service) => __awaiter(void 0, void 0, void 0, function* () {
49
- var _a;
50
59
  const availableServices = [constants_1.INTEG.services.cliq];
51
60
  if (!availableServices.includes(service)) {
52
61
  throw new index_js_1.default('Unknown service requested', {
@@ -57,7 +66,7 @@ exports.default = new command_1.default('event:generate:integ <service>')
57
66
  }
58
67
  const inputs = (0, option_1.getOptionValue)('inputs', '');
59
68
  const serviceValue = constants_1.INTEG.service_map[service];
60
- const serviceModule = (yield (_a = `../../../event_generate/integration/${serviceValue}`, Promise.resolve().then(() => __importStar(require(_a)))))
69
+ const serviceModule = (yield Promise.resolve(`${`../../../event_generate/integration/${serviceValue}`}`).then(s => __importStar(require(s))))
61
70
  .default;
62
71
  const payload = yield serviceModule(inputs);
63
72
  process.stdout.write(payload + '\n');
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -183,7 +193,7 @@ const iacImport = (filePath, projectName) => __awaiter(void 0, void 0, void 0, f
183
193
  type: 'file-path',
184
194
  when: !filePath,
185
195
  exclude: ['**/!(*.zip)', '**/.*'],
186
- validate: ({ value }) => __awaiter(void 0, void 0, void 0, function* () {
196
+ validate: (_a) => __awaiter(void 0, [_a], void 0, function* ({ value }) {
187
197
  if (value && value.endsWith('.zip')) {
188
198
  return (yield ASYNC.fileExists(value)) ? true : 'File does not exists!';
189
199
  }