zcatalyst-cli 1.25.3 → 1.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +6 -7
  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 +17 -7
  46. package/lib/commands/token/generate.js +17 -7
  47. package/lib/commands/token/list.js +17 -7
  48. package/lib/commands/token/revoke.js +17 -7
  49. package/lib/commands/zest/generate/index.js +21 -11
  50. package/lib/deploy/features/appsail/index.js +2 -3
  51. package/lib/deploy/features/appsail/pack.d.ts +0 -1
  52. package/lib/deploy/features/appsail/pack.js +2 -3
  53. package/lib/deploy/features/appsail/utils.js +7 -8
  54. package/lib/deploy/features/functions/languages/index.js +3 -4
  55. package/lib/deploy/features/index.js +17 -7
  56. package/lib/deploy/features/slate.js +11 -8
  57. package/lib/deploy/index.js +2 -2
  58. package/lib/deploy/util.d.ts +2 -0
  59. package/lib/deploy/util.js +3 -1
  60. package/lib/docs/commands/signals/generate/generate.toml +19 -0
  61. package/lib/docs/commands/slate/unlink.toml +9 -0
  62. package/lib/docs/fn-utils/lib/node.toml +4 -0
  63. package/lib/docs/init/dependencies/python/ensure-python.toml +4 -0
  64. package/lib/docs/serve/server/lib/slate/index.toml +20 -0
  65. package/lib/docs/slate-utils.toml +9 -0
  66. package/lib/endpoints/index.d.ts +2 -1
  67. package/lib/endpoints/index.js +88 -79
  68. package/lib/endpoints/lib/apig.d.ts +0 -1
  69. package/lib/endpoints/lib/apig.js +2 -2
  70. package/lib/endpoints/lib/applogic.d.ts +0 -1
  71. package/lib/endpoints/lib/applogic.js +2 -2
  72. package/lib/endpoints/lib/appsail.d.ts +1 -4
  73. package/lib/endpoints/lib/appsail.js +7 -7
  74. package/lib/endpoints/lib/client.d.ts +0 -1
  75. package/lib/endpoints/lib/code-deck.js +1 -1
  76. package/lib/endpoints/lib/common.d.ts +0 -2
  77. package/lib/endpoints/lib/ds-bulk.js +2 -2
  78. package/lib/endpoints/lib/env.js +2 -2
  79. package/lib/endpoints/lib/filestore.d.ts +0 -1
  80. package/lib/endpoints/lib/functions.d.ts +0 -1
  81. package/lib/endpoints/lib/functions.js +2 -2
  82. package/lib/endpoints/lib/git-hub.d.ts +0 -2
  83. package/lib/endpoints/lib/iac.d.ts +0 -3
  84. package/lib/endpoints/lib/iac.js +2 -2
  85. package/lib/endpoints/lib/project.d.ts +0 -1
  86. package/lib/endpoints/lib/project.js +2 -2
  87. package/lib/endpoints/lib/sdk.d.ts +0 -2
  88. package/lib/endpoints/lib/sdk.js +1 -1
  89. package/lib/endpoints/lib/slate.d.ts +0 -1
  90. package/lib/endpoints/lib/stratus.d.ts +0 -1
  91. package/lib/endpoints/lib/user.d.ts +0 -2
  92. package/lib/endpoints/lib/user.js +2 -1
  93. package/lib/error/context-help.js +1 -1
  94. package/lib/error/index.js +2 -2
  95. package/lib/event_generate/cache.js +4 -4
  96. package/lib/event_generate/custom.js +1 -2
  97. package/lib/event_generate/datastore.js +4 -4
  98. package/lib/event_generate/filestore.js +4 -4
  99. package/lib/event_generate/github.js +2 -2
  100. package/lib/event_generate/index.js +19 -11
  101. package/lib/event_generate/stratus.js +2 -2
  102. package/lib/event_generate/user.js +2 -2
  103. package/lib/event_generate/webapp.js +2 -2
  104. package/lib/execute/caller.d.ts +0 -1
  105. package/lib/execute/caller.js +20 -7
  106. package/lib/execute/index.js +27 -4
  107. package/lib/execute-script.js +22 -13
  108. package/lib/express_middlewares/auth-checker.js +2 -3
  109. package/lib/express_middlewares/project.d.ts +1 -1
  110. package/lib/fn-utils/index.js +17 -7
  111. package/lib/fn-utils/lib/browserLogic.js +4 -5
  112. package/lib/fn-utils/lib/common.d.ts +0 -1
  113. package/lib/fn-utils/lib/common.js +25 -26
  114. package/lib/fn-utils/lib/integ.js +2 -3
  115. package/lib/fn-utils/lib/java/classpath.js +2 -3
  116. package/lib/fn-utils/lib/java/compile.js +4 -4
  117. package/lib/fn-utils/lib/java/ensure-java-userconfig.d.ts +10 -0
  118. package/lib/fn-utils/lib/java/ensure-java-userconfig.js +45 -23
  119. package/lib/fn-utils/lib/java/index.d.ts +0 -1
  120. package/lib/fn-utils/lib/java/index.js +11 -11
  121. package/lib/fn-utils/lib/java/keywords.js +2 -2
  122. package/lib/fn-utils/lib/node.d.ts +1 -1
  123. package/lib/fn-utils/lib/node.js +67 -15
  124. package/lib/fn-utils/lib/python.js +29 -19
  125. package/lib/iac/status/util/index.d.ts +1 -1
  126. package/lib/init/dependencies/npm-install.js +2 -2
  127. package/lib/init/dependencies/python/ensure-python.d.ts +2 -2
  128. package/lib/init/dependencies/python/ensure-python.js +65 -58
  129. package/lib/init/dependencies/python/pip-install.d.ts +3 -5
  130. package/lib/init/dependencies/python/pip-install.js +14 -53
  131. package/lib/init/features/appsail/utils.js +21 -12
  132. package/lib/init/features/client/index.js +18 -9
  133. package/lib/init/features/client/initializers/angular.js +17 -7
  134. package/lib/init/features/client/initializers/basic.js +17 -7
  135. package/lib/init/features/client/initializers/lyte.js +17 -7
  136. package/lib/init/features/client/initializers/react.js +17 -7
  137. package/lib/init/features/index.js +29 -20
  138. package/lib/init/features/project.js +5 -5
  139. package/lib/init/features/slate/index.js +23 -11
  140. package/lib/init/util/client.js +23 -13
  141. package/lib/init/util/common.js +5 -6
  142. package/lib/init/util/project.js +1 -1
  143. package/lib/internal/api.d.ts +0 -3
  144. package/lib/internal/api.js +19 -9
  145. package/lib/internal/command.js +18 -9
  146. package/lib/migration/global/1.25.0.d.ts +2 -0
  147. package/lib/migration/global/1.25.0.js +28 -0
  148. package/lib/migration/index.js +20 -12
  149. package/lib/option-filter.js +19 -10
  150. package/lib/optional-import.js +19 -10
  151. package/lib/plugin-loader.d.ts +0 -2
  152. package/lib/plugin-loader.js +18 -8
  153. package/lib/port-resolver.js +10 -10
  154. package/lib/prompt/index.d.ts +3 -3
  155. package/lib/prompt/index.js +17 -7
  156. package/lib/prompt/types/file-path.d.ts +0 -1
  157. package/lib/prompt/types/search-box.d.ts +0 -1
  158. package/lib/prompt/types/tree.d.ts +1 -2
  159. package/lib/prompt/types/tree.js +10 -10
  160. package/lib/prompt/types/with-description.d.ts +0 -1
  161. package/lib/pull/features/functions/index.js +71 -52
  162. package/lib/pull/features/functions/languages.js +3 -4
  163. package/lib/pull/features/index.js +17 -7
  164. package/lib/repl-server.d.ts +0 -1
  165. package/lib/repl-server.js +9 -1
  166. package/lib/serve/features/apig.js +7 -1
  167. package/lib/serve/features/appsail.d.ts +1 -0
  168. package/lib/serve/features/appsail.js +51 -7
  169. package/lib/serve/features/index.js +22 -13
  170. package/lib/serve/index.js +17 -7
  171. package/lib/serve/server/index.d.ts +0 -2
  172. package/lib/serve/server/index.js +26 -12
  173. package/lib/serve/server/lib/appsail/index.js +27 -34
  174. package/lib/serve/server/lib/appsail/util.d.ts +11 -0
  175. package/lib/serve/server/lib/appsail/util.js +69 -0
  176. package/lib/serve/server/lib/java/index.js +18 -7
  177. package/lib/serve/server/lib/master/appsail.js +3 -4
  178. package/lib/serve/server/lib/master/functions.js +1 -2
  179. package/lib/serve/server/lib/master/index.d.ts +0 -1
  180. package/lib/serve/server/lib/master/index.js +5 -5
  181. package/lib/serve/server/lib/master/slate.js +1 -2
  182. package/lib/serve/server/lib/master/unknown-req-proxy.js +5 -2
  183. package/lib/serve/server/lib/master/utils.d.ts +4 -8
  184. package/lib/serve/server/lib/master/utils.js +4 -6
  185. package/lib/serve/server/lib/master/web-client.js +1 -2
  186. package/lib/serve/server/lib/node/index.js +22 -11
  187. package/lib/serve/server/lib/node/server/browserlogic/utils/playwright-handler.js +1 -1
  188. package/lib/serve/server/lib/node/server/browserlogic/utils/puppeteer-handler.js +1 -1
  189. package/lib/serve/server/lib/node/server/browserlogic/utils/selenium-handler.js +2 -0
  190. package/lib/serve/server/lib/python/index.js +23 -14
  191. package/lib/serve/server/lib/slate/index.js +7 -0
  192. package/lib/serve/server/lib/slate/static-server.d.ts +0 -1
  193. package/lib/serve/server/lib/slate/static-server.js +5 -4
  194. package/lib/serve/server/lib/web_client/server.d.ts +0 -1
  195. package/lib/serve/server/lib/web_client/server.js +5 -4
  196. package/lib/shell/dependencies/http-functions.d.ts +0 -2
  197. package/lib/shell/dependencies/http-functions.js +7 -7
  198. package/lib/shell/dependencies/non-http-function/fn-execution-handler.d.ts +0 -2
  199. package/lib/shell/dependencies/non-http-function/fn-execution-handler.js +55 -24
  200. package/lib/shell/dependencies/non-http-function/fn-handler.d.ts +3 -3
  201. package/lib/shell/dependencies/non-http-function/fn-handler.js +54 -20
  202. package/lib/shell/dependencies/non-http-function/node.js +4 -4
  203. package/lib/shell/dependencies/non-http-function/python.d.ts +1 -1
  204. package/lib/shell/dependencies/non-http-function/python.js +11 -13
  205. package/lib/shell/dependencies/non-http-function/slave-manager.d.ts +0 -2
  206. package/lib/shell/dependencies/non-http-function/slave-manager.js +11 -7
  207. package/lib/shell/dependencies/tunnel-server.js +4 -4
  208. package/lib/shell/index.js +50 -3
  209. package/lib/shell/prepare/index.js +4 -3
  210. package/lib/shell/prepare/languages/index.js +18 -9
  211. package/lib/shell/prepare/languages/node.js +29 -19
  212. package/lib/shell/prepare/languages/python.js +6 -12
  213. package/lib/signals/index.js +19 -11
  214. package/lib/slate-utils.js +25 -16
  215. package/lib/throbber/index.d.ts +1 -2
  216. package/lib/throbber/index.js +5 -2
  217. package/lib/throbber/utils.d.ts +0 -1
  218. package/lib/throbber/utils.js +4 -5
  219. package/lib/userConfig.d.ts +14 -0
  220. package/lib/userConfig.js +15 -1
  221. package/lib/util_modules/config/index.js +17 -7
  222. package/lib/util_modules/config/lib/apig.d.ts +1 -0
  223. package/lib/util_modules/config/lib/apig.js +10 -5
  224. package/lib/util_modules/config/lib/appsail.js +7 -7
  225. package/lib/util_modules/config/lib/client.js +5 -6
  226. package/lib/util_modules/config/lib/functions.js +5 -6
  227. package/lib/util_modules/config/lib/slate.d.ts +2 -1
  228. package/lib/util_modules/config/lib/slate.js +27 -13
  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
@@ -12,9 +12,11 @@ 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.installPkgs = exports.installRequirements = exports.pypiRes = exports.ensurePyRuntime = void 0;
15
+ exports.pypiRes = void 0;
16
+ exports.ensurePyRuntime = ensurePyRuntime;
17
+ exports.installRequirements = installRequirements;
18
+ exports.installPkgs = installPkgs;
16
19
  const error_1 = __importDefault(require("../../../error"));
17
- const prompt_1 = __importDefault(require("../../../prompt"));
18
20
  const shell_1 = require("../../../util_modules/shell");
19
21
  const constants_1 = require("../../../util_modules/constants");
20
22
  const path_1 = require("path");
@@ -22,48 +24,10 @@ const fs_1 = require("../../../util_modules/fs");
22
24
  const https_1 = __importDefault(require("https"));
23
25
  const runtime_1 = __importDefault(require("../../../util_modules/constants/lib/runtime"));
24
26
  const env_1 = require("../../../util_modules/env");
25
- const ensure_python_1 = require("./ensure-python");
26
- const userConfig_1 = __importDefault(require("../../../userConfig"));
27
27
  const index_1 = require("../../../util_modules/logger/index");
28
- const sdkPipOpts = (0, env_1.envOverride)('CATALYST_SDK_PIP_OPTS', 'zcatalyst-sdk');
29
- const cliqSdkPipOpts = (0, env_1.envOverride)('CATALYST_CLIQ_SDK_PIP_OPTS', 'zcatalyst-cliq');
30
28
  const testPypi = (0, env_1.envOverride)('CATALYST_TEST_PYPI', 'false');
31
- exports.default = (pth, stack, isIntegFn = false, integService = false) => __awaiter(void 0, void 0, void 0, function* () {
32
- const stackVersion = stack.replace('python_', '');
33
- const ans = yield prompt_1.default.ask(prompt_1.default.question('pipInstall', 'Do you wish to install all dependency libraries now ? ', {
34
- type: 'confirm',
35
- defaultAns: true,
36
- when: () => !isIntegFn
37
- }));
38
- if (ans.pipInstall && !isIntegFn) {
39
- yield (0, ensure_python_1.ensurePythonWithPip)(stackVersion.replace('_', '.'), true);
40
- const spawnOpts = ['-m', 'pip', 'install', ...sdkPipOpts.split(' '), '-t', '.'];
41
- return (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), spawnOpts, {
42
- cwd: pth
43
- })
44
- .ASYNC()
45
- .catch((err) => {
46
- throw new error_1.default('Failure while installing zcatalyst SDk', {
47
- exit: 2,
48
- original: err
49
- });
50
- });
51
- }
52
- else if ((isIntegFn || ans.pipInstall === undefined) &&
53
- integService === constants_1.INTEG.services.cliq) {
54
- yield (0, ensure_python_1.ensurePythonWithPip)(stackVersion.replace('_', '.'), true);
55
- const spawnOpts = ['-m', 'pip', 'install', ...cliqSdkPipOpts.split(' '), '-t', '.'];
56
- return (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), spawnOpts, { cwd: pth })
57
- .ASYNC()
58
- .catch((err) => {
59
- throw error_1.default.getErrorInstance(err, {
60
- message: 'Failure while installing zcatalyst cliq SDK.'
61
- });
62
- });
63
- }
64
- });
65
- function ensurePyRuntime(pth, stack) {
66
- return __awaiter(this, void 0, void 0, function* () {
29
+ function ensurePyRuntime(pth_1, stack_1) {
30
+ return __awaiter(this, arguments, void 0, function* (pth, stack, spawnCommand = 'python') {
67
31
  const stackVersion = stack.replace('python_', '');
68
32
  const runtimePkgName = 'zcatalyst-runtime-' + stackVersion.replace('_', '');
69
33
  yield fs_1.ASYNC.ensureDir(pth);
@@ -82,7 +46,7 @@ function ensurePyRuntime(pth, stack) {
82
46
  if (testPypi === 'true') {
83
47
  spawnOpts.push('-i', 'https://test.pypi.org/simple/', '--extra-index-url', 'https://pypi.org/simple/');
84
48
  }
85
- const child = (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), spawnOpts, {
49
+ const child = (0, shell_1.spawn)(spawnCommand, spawnOpts, {
86
50
  cwd: pth,
87
51
  stdio: 'pipe'
88
52
  }).RAW();
@@ -110,7 +74,7 @@ function ensurePyRuntime(pth, stack) {
110
74
  try {
111
75
  const runtimeReqFile = (0, path_1.join)(runtimeDir, constants_1.FILENAME.functions.python_requirements);
112
76
  if (yield fs_1.ASYNC.fileExists(runtimeReqFile)) {
113
- yield installRequirements(runtimeReqFile, runtimeDir, stackVersion);
77
+ yield installRequirements(runtimeReqFile, runtimeDir, spawnCommand);
114
78
  }
115
79
  }
116
80
  catch (err) {
@@ -119,7 +83,6 @@ function ensurePyRuntime(pth, stack) {
119
83
  }
120
84
  });
121
85
  }
122
- exports.ensurePyRuntime = ensurePyRuntime;
123
86
  const pypiRes = (pkg) => __awaiter(void 0, void 0, void 0, function* () {
124
87
  const url = testPypi === 'true'
125
88
  ? `https://test.pypi.org/pypi/${pkg}/json`
@@ -144,8 +107,8 @@ const pypiRes = (pkg) => __awaiter(void 0, void 0, void 0, function* () {
144
107
  });
145
108
  });
146
109
  exports.pypiRes = pypiRes;
147
- function installRequirements(reqFile, pth, stackVersion, linuxMode = false) {
148
- return __awaiter(this, void 0, void 0, function* () {
110
+ function installRequirements(reqFile_1, pth_1) {
111
+ return __awaiter(this, arguments, void 0, function* (reqFile, pth, spawnCommand = 'python', linuxMode = false) {
149
112
  const spawnOpts = ['-m', 'pip', 'install', '-r', reqFile, '-t', '.', '--upgrade'];
150
113
  if (linuxMode) {
151
114
  spawnOpts.push(...[
@@ -161,7 +124,7 @@ function installRequirements(reqFile, pth, stackVersion, linuxMode = false) {
161
124
  }
162
125
  return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
163
126
  var _a;
164
- const child = (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), spawnOpts, {
127
+ const child = (0, shell_1.spawn)(spawnCommand, spawnOpts, {
165
128
  cwd: pth,
166
129
  stdio: 'pipe'
167
130
  }).RAW();
@@ -189,14 +152,13 @@ function installRequirements(reqFile, pth, stackVersion, linuxMode = false) {
189
152
  }));
190
153
  });
191
154
  }
192
- exports.installRequirements = installRequirements;
193
- function installPkgs(pkgs, stackVersion, pth = undefined) {
194
- return __awaiter(this, void 0, void 0, function* () {
155
+ function installPkgs(pkgs_1) {
156
+ return __awaiter(this, arguments, void 0, function* (pkgs, spawnCommand = 'python', pth = undefined) {
195
157
  const spawnOpts = ['-m', 'pip', 'install', ...pkgs, '--upgrade'];
196
158
  if (pth) {
197
159
  spawnOpts.push(...['-t', pth]);
198
160
  }
199
- return (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), spawnOpts, {
161
+ return (0, shell_1.spawn)(spawnCommand, spawnOpts, {
200
162
  cwd: pth,
201
163
  stdio: 'ignore'
202
164
  })
@@ -209,4 +171,3 @@ function installPkgs(pkgs, stackVersion, pth = undefined) {
209
171
  });
210
172
  });
211
173
  }
212
- exports.installPkgs = installPkgs;
@@ -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) {
@@ -35,7 +45,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.getCustomAppSailSource = exports.getContainerImageTag = exports.getAppSailName = exports.getAppSailZip = void 0;
48
+ exports.getAppSailZip = getAppSailZip;
49
+ exports.getAppSailName = getAppSailName;
50
+ exports.getContainerImageTag = getContainerImageTag;
51
+ exports.getCustomAppSailSource = getCustomAppSailSource;
39
52
  const image_1 = require("@zcatalyst/container-plugin/out/endpoints/image");
40
53
  const ansi_colors_1 = require("ansi-colors");
41
54
  const inquirer = __importStar(require("inquirer"));
@@ -138,7 +151,6 @@ function getAppSailZip() {
138
151
  };
139
152
  });
140
153
  }
141
- exports.getAppSailZip = getAppSailZip;
142
154
  function getAppSailName() {
143
155
  return __awaiter(this, void 0, void 0, function* () {
144
156
  const existingSails = config_1.appSailConfig.raw() || [];
@@ -162,7 +174,6 @@ function getAppSailName() {
162
174
  return appName.name;
163
175
  });
164
176
  }
165
- exports.getAppSailName = getAppSailName;
166
177
  function getContainerImageTag() {
167
178
  return __awaiter(this, void 0, void 0, function* () {
168
179
  yield (0, container_1.isSocketAccessible)();
@@ -214,7 +225,6 @@ function getContainerImageTag() {
214
225
  return `docker://${image.name}`;
215
226
  });
216
227
  }
217
- exports.getContainerImageTag = getContainerImageTag;
218
228
  function getCustomAppSailSource() {
219
229
  return __awaiter(this, void 0, void 0, function* () {
220
230
  const dockerProtocol = yield prompt_1.default.ask(prompt_1.default.question('type', 'Please choose one of the supported protocols:', {
@@ -261,4 +271,3 @@ function getCustomAppSailSource() {
261
271
  }
262
272
  });
263
273
  }
264
- exports.getCustomAppSailSource = getCustomAppSailSource;
@@ -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) {
@@ -38,7 +48,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
38
48
  const index_js_1 = __importDefault(require("../../../prompt/index.js"));
39
49
  const index_js_2 = require("../../../util_modules/constants/index.js");
40
50
  exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
41
- var _a;
42
51
  const clientInitAnswer = yield index_js_1.default.ask(index_js_1.default.question('clientFlavour', 'Choose the type of client to initialise: ', {
43
52
  type: 'list',
44
53
  choices: index_js_2.PLUGIN.client.map((plugin) => {
@@ -49,5 +58,5 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
49
58
  });
50
59
  })
51
60
  }));
52
- return (yield (_a = './initializers/' + clientInitAnswer.clientFlavour, Promise.resolve().then(() => __importStar(require(_a))))).default();
61
+ return (yield Promise.resolve(`${'./initializers/' + clientInitAnswer.clientFlavour}`).then(s => __importStar(require(s)))).default();
53
62
  });
@@ -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) {
@@ -35,7 +45,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.appsail = exports.project = exports.slate = exports.client = exports.functions = exports.setCatalystConfig = void 0;
48
+ exports.setCatalystConfig = setCatalystConfig;
49
+ exports.functions = functions;
50
+ exports.client = client;
51
+ exports.slate = slate;
52
+ exports.project = project;
53
+ exports.appsail = appsail;
39
54
  const ansi_colors_1 = require("ansi-colors");
40
55
  const path_1 = require("path");
41
56
  const index_js_1 = __importDefault(require("../../error/index.js"));
@@ -45,8 +60,8 @@ const runtime_1 = __importDefault(require("../../util_modules/constants/lib/runt
45
60
  const js_1 = require("../../util_modules/js");
46
61
  const index_1 = require("../../util_modules/logger/index");
47
62
  const project_1 = require("../../util_modules/project");
48
- function upsertEnvArr(envArr, idx = 0) {
49
- return __awaiter(this, void 0, void 0, function* () {
63
+ function upsertEnvArr(envArr_1) {
64
+ return __awaiter(this, arguments, void 0, function* (envArr, idx = 0) {
50
65
  if (envArr === null) {
51
66
  return upsertEnvArr(envArr, idx + 1);
52
67
  }
@@ -130,28 +145,24 @@ function setCatalystConfig(featureName, add) {
130
145
  }
131
146
  });
132
147
  }
133
- exports.setCatalystConfig = setCatalystConfig;
134
- function functions(add = false) {
135
- return __awaiter(this, void 0, void 0, function* () {
148
+ function functions() {
149
+ return __awaiter(this, arguments, void 0, function* (add = false) {
136
150
  yield (yield Promise.resolve().then(() => __importStar(require('./functions/index.js')))).default();
137
151
  setCatalystConfig('functions', add);
138
152
  });
139
153
  }
140
- exports.functions = functions;
141
154
  function client() {
142
155
  return __awaiter(this, void 0, void 0, function* () {
143
156
  yield (yield Promise.resolve().then(() => __importStar(require('./client/index.js')))).default();
144
157
  setCatalystConfig('client', false);
145
158
  });
146
159
  }
147
- exports.client = client;
148
- function slate(add = false) {
149
- return __awaiter(this, void 0, void 0, function* () {
160
+ function slate() {
161
+ return __awaiter(this, arguments, void 0, function* (add = false) {
150
162
  yield (yield Promise.resolve().then(() => __importStar(require('./slate/index.js')))).default(add);
151
163
  setCatalystConfig('slate', false);
152
164
  });
153
165
  }
154
- exports.slate = slate;
155
166
  function project() {
156
167
  return __awaiter(this, void 0, void 0, function* () {
157
168
  yield (yield Promise.resolve().then(() => __importStar(require('./project.js')))).default();
@@ -175,14 +186,12 @@ function project() {
175
186
  }
176
187
  });
177
188
  }
178
- exports.project = project;
179
189
  function appsail() {
180
190
  return __awaiter(this, void 0, void 0, function* () {
181
191
  yield (yield Promise.resolve().then(() => __importStar(require('./appsail/index.js')))).default();
182
192
  setCatalystConfig('appsail');
183
193
  });
184
194
  }
185
- exports.appsail = appsail;
186
195
  exports.default = {
187
196
  functions,
188
197
  client,
@@ -88,7 +88,7 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
88
88
  ];
89
89
  allProjects.forEach((project) => {
90
90
  projectChoices.push(prompt_1.default.choice(project.project_name + ' (' + project.id + ')', {
91
- id: project.project_name,
91
+ id: project.id,
92
92
  value: project,
93
93
  short: project.project_name
94
94
  }));
@@ -107,15 +107,15 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
107
107
  const callbackPort = yield port_resolver_1.default.getFreePort(3000, 10, false);
108
108
  const accessUrl = new URL(`${constants_1.ORIGIN.console}/baas/${(0, project_1.getEnvId)()}/index#/?port=${callbackPort}&type=cli`);
109
109
  const server = (0, http_1.createServer)((req, resp) => __awaiter(void 0, void 0, void 0, function* () {
110
- var _c, _d;
110
+ var _a, _b;
111
111
  try {
112
- if (!((_c = req.url) === null || _c === void 0 ? void 0 : _c.includes('/success'))) {
112
+ if (!((_a = req.url) === null || _a === void 0 ? void 0 : _a.includes('/success'))) {
113
113
  resp.writeHead(404);
114
114
  resp.end();
115
115
  return;
116
116
  }
117
117
  const htmlFile = yield fs_1.ASYNC.readFile((0, path_1.join)(__dirname, '../../../templates/projectSuccess.html'));
118
- projectId = (_d = req.url) === null || _d === void 0 ? void 0 : _d.split('?')[1].split('=')[1];
118
+ projectId = (_b = req.url) === null || _b === void 0 ? void 0 : _b.split('?')[1].split('=')[1];
119
119
  resp.setHeader('Content-Type', 'text/html');
120
120
  resp.writeHead(200);
121
121
  resp.end(htmlFile, () => __awaiter(void 0, void 0, void 0, function* () {
@@ -162,7 +162,7 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
162
162
  const templateJson = parsedJSON ? parsedJSON : (0, yaml_1.parse)(template);
163
163
  const functions = ((_a = templateJson.components) === null || _a === void 0 ? void 0 : _a.Functions) || [];
164
164
  const client = ((_b = templateJson.components) === null || _b === void 0 ? void 0 : _b.WebClient) || [];
165
- yield Promise.all(functions.map(({ properties }) => __awaiter(void 0, void 0, void 0, function* () {
165
+ yield Promise.all(functions.map((_a) => __awaiter(void 0, [_a], void 0, function* ({ properties }) {
166
166
  const source = properties.code.path.replace('/', path_1.sep).replace('.zip', '');
167
167
  const stack = properties.stack.toLowerCase();
168
168
  const refinedTargets = yield fn_utils_1.fnUtils.common.refineTargets([(0, project_1.resolveProjectPath)(source)], false);
@@ -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) {
@@ -161,8 +171,8 @@ function getAppName(existingSlates, frameworkOpt) {
161
171
  return appName;
162
172
  });
163
173
  }
164
- function handleTemplate(appName, { templateName, frameworkName } = {}) {
165
- return __awaiter(this, void 0, void 0, function* () {
174
+ function handleTemplate(appName_1) {
175
+ return __awaiter(this, arguments, void 0, function* (appName, { templateName, frameworkName } = {}) {
166
176
  const projectRoot = (0, project_1.getProjectRoot)();
167
177
  const appPath = path_1.default.join(projectRoot, appName);
168
178
  const folderExists = yield fs_1.ASYNC.dirExists(appPath);
@@ -192,9 +202,11 @@ function addExistingSlate(existingSlates) {
192
202
  return __awaiter(this, void 0, void 0, function* () {
193
203
  const projectRoot = (0, project_1.getProjectRoot)();
194
204
  const sourceOpt = (0, option_1.getOptionValue)('source');
205
+ const isDuplicate = (candidateAbs) => existingSlates.findIndex((targ) => (0, path_1.resolve)(projectRoot, targ.source) === candidateAbs) !==
206
+ -1;
195
207
  if (sourceOpt) {
196
208
  const buildPath = (0, path_1.resolve)(projectRoot, sourceOpt);
197
- if (existingSlates.findIndex((targ) => targ.source === buildPath) !== -1) {
209
+ if (isDuplicate(buildPath)) {
198
210
  throw new error_1.default(`Path ${(0, ansi_colors_1.bold)(buildPath)} is already linked to a Slate app.`, {
199
211
  exit: 1
200
212
  });
@@ -211,7 +223,7 @@ function addExistingSlate(existingSlates) {
211
223
  type: 'file-path',
212
224
  validate: (pth) => __awaiter(this, void 0, void 0, function* () {
213
225
  const buildPath = (0, path_1.resolve)(projectRoot, pth.value);
214
- if (existingSlates.findIndex((targ) => targ.source === buildPath) !== -1)
226
+ if (isDuplicate(buildPath))
215
227
  return 'Path is already linked.';
216
228
  if (yield fs_1.ASYNC.dirExists(buildPath)) {
217
229
  return true;
@@ -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) {
@@ -35,7 +45,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.addDependency = exports.clientNamePrompt = exports.directoryOverridePrompt = exports.fillClientInitPayload = void 0;
48
+ exports.fillClientInitPayload = void 0;
49
+ exports.directoryOverridePrompt = directoryOverridePrompt;
50
+ exports.clientNamePrompt = clientNamePrompt;
51
+ exports.addDependency = addDependency;
39
52
  const ansi_colors_1 = require("ansi-colors");
40
53
  const runtime_store_js_1 = __importDefault(require("../../runtime-store.js"));
41
54
  const index_js_1 = __importDefault(require("../../error/index.js"));
@@ -64,7 +77,6 @@ function directoryOverridePrompt(dir) {
64
77
  }
65
78
  });
66
79
  }
67
- exports.directoryOverridePrompt = directoryOverridePrompt;
68
80
  function clientNamePrompt(question, defaultAns) {
69
81
  return __awaiter(this, void 0, void 0, function* () {
70
82
  const namePrompt = yield index_js_2.default.ask(index_js_2.default.question('name', question, {
@@ -80,9 +92,8 @@ function clientNamePrompt(question, defaultAns) {
80
92
  return namePrompt.name;
81
93
  });
82
94
  }
83
- exports.clientNamePrompt = clientNamePrompt;
84
- function addDependency(filePath, dep, { dev = false, depPath = [] } = {}) {
85
- return __awaiter(this, void 0, void 0, function* () {
95
+ function addDependency(filePath_1, dep_1) {
96
+ return __awaiter(this, arguments, void 0, function* (filePath, dep, { dev = false, depPath = [] } = {}) {
86
97
  try {
87
98
  const packageJson = yield ASYNC.readJSONFile(filePath);
88
99
  if (packageJson) {
@@ -98,4 +109,3 @@ function addDependency(filePath, dep, { dev = false, depPath = [] } = {}) {
98
109
  }
99
110
  });
100
111
  }
101
- exports.addDependency = addDependency;