@interopio/iocd-cli 0.0.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 (297) hide show
  1. package/README.md +40 -0
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +96 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/commands/apps.command.d.ts +3 -0
  7. package/dist/commands/apps.command.d.ts.map +1 -0
  8. package/dist/commands/apps.command.js +110 -0
  9. package/dist/commands/apps.command.js.map +1 -0
  10. package/dist/commands/components.command.d.ts +3 -0
  11. package/dist/commands/components.command.d.ts.map +1 -0
  12. package/dist/commands/components.command.js +116 -0
  13. package/dist/commands/components.command.js.map +1 -0
  14. package/dist/commands/create.command.d.ts +3 -0
  15. package/dist/commands/create.command.d.ts.map +1 -0
  16. package/dist/commands/create.command.js +19 -0
  17. package/dist/commands/create.command.js.map +1 -0
  18. package/dist/commands/dev.command.d.ts +4 -0
  19. package/dist/commands/dev.command.d.ts.map +1 -0
  20. package/dist/commands/dev.command.js +25 -0
  21. package/dist/commands/dev.command.js.map +1 -0
  22. package/dist/commands/installer.command.d.ts +3 -0
  23. package/dist/commands/installer.command.d.ts.map +1 -0
  24. package/dist/commands/installer.command.js +19 -0
  25. package/dist/commands/installer.command.js.map +1 -0
  26. package/dist/commands/license.command.d.ts +3 -0
  27. package/dist/commands/license.command.d.ts.map +1 -0
  28. package/dist/commands/license.command.js +23 -0
  29. package/dist/commands/license.command.js.map +1 -0
  30. package/dist/commands/modifications.command.d.ts +3 -0
  31. package/dist/commands/modifications.command.d.ts.map +1 -0
  32. package/dist/commands/modifications.command.js +28 -0
  33. package/dist/commands/modifications.command.js.map +1 -0
  34. package/dist/commands/setup.command.d.ts +4 -0
  35. package/dist/commands/setup.command.d.ts.map +1 -0
  36. package/dist/commands/setup.command.js +34 -0
  37. package/dist/commands/setup.command.js.map +1 -0
  38. package/dist/services/app-builder.service.d.ts +2 -0
  39. package/dist/services/app-builder.service.d.ts.map +1 -0
  40. package/dist/services/app-builder.service.js +3 -0
  41. package/dist/services/app-builder.service.js.map +1 -0
  42. package/dist/services/app.service.d.ts +74 -0
  43. package/dist/services/app.service.d.ts.map +1 -0
  44. package/dist/services/app.service.js +328 -0
  45. package/dist/services/app.service.js.map +1 -0
  46. package/dist/services/components/component.config.d.ts +11 -0
  47. package/dist/services/components/component.config.d.ts.map +1 -0
  48. package/dist/services/components/component.config.js +101 -0
  49. package/dist/services/components/component.config.js.map +1 -0
  50. package/dist/services/components/component.d.ts +12 -0
  51. package/dist/services/components/component.d.ts.map +1 -0
  52. package/dist/services/components/component.js +3 -0
  53. package/dist/services/components/component.js.map +1 -0
  54. package/dist/services/components/components.registry.d.ts +40 -0
  55. package/dist/services/components/components.registry.d.ts.map +1 -0
  56. package/dist/services/components/components.registry.js +72 -0
  57. package/dist/services/components/components.registry.js.map +1 -0
  58. package/dist/services/components/components.service.d.ts +20 -0
  59. package/dist/services/components/components.service.d.ts.map +1 -0
  60. package/dist/services/components/components.service.js +171 -0
  61. package/dist/services/components/components.service.js.map +1 -0
  62. package/dist/services/components/file.helper.d.ts +12 -0
  63. package/dist/services/components/file.helper.d.ts.map +1 -0
  64. package/dist/services/components/file.helper.js +124 -0
  65. package/dist/services/components/file.helper.js.map +1 -0
  66. package/dist/services/components/platform.utils.d.ts +72 -0
  67. package/dist/services/components/platform.utils.d.ts.map +1 -0
  68. package/dist/services/components/platform.utils.js +156 -0
  69. package/dist/services/components/platform.utils.js.map +1 -0
  70. package/dist/services/components/stores/github.store.d.ts +35 -0
  71. package/dist/services/components/stores/github.store.d.ts.map +1 -0
  72. package/dist/services/components/stores/github.store.js +157 -0
  73. package/dist/services/components/stores/github.store.js.map +1 -0
  74. package/dist/services/components/stores/local.store.d.ts +69 -0
  75. package/dist/services/components/stores/local.store.d.ts.map +1 -0
  76. package/dist/services/components/stores/local.store.js +300 -0
  77. package/dist/services/components/stores/local.store.js.map +1 -0
  78. package/dist/services/components/stores/s3.store.d.ts +98 -0
  79. package/dist/services/components/stores/s3.store.d.ts.map +1 -0
  80. package/dist/services/components/stores/s3.store.js +368 -0
  81. package/dist/services/components/stores/s3.store.js.map +1 -0
  82. package/dist/services/components/stores/store.d.ts +11 -0
  83. package/dist/services/components/stores/store.d.ts.map +1 -0
  84. package/dist/services/components/stores/store.js +3 -0
  85. package/dist/services/components/stores/store.js.map +1 -0
  86. package/dist/services/config/cli.config.d.ts +57 -0
  87. package/dist/services/config/cli.config.d.ts.map +1 -0
  88. package/dist/services/config/cli.config.js +3 -0
  89. package/dist/services/config/cli.config.js.map +1 -0
  90. package/dist/services/config/config.service.d.ts +14 -0
  91. package/dist/services/config/config.service.d.ts.map +1 -0
  92. package/dist/services/config/config.service.js +170 -0
  93. package/dist/services/config/config.service.js.map +1 -0
  94. package/dist/services/create.service.d.ts +58 -0
  95. package/dist/services/create.service.d.ts.map +1 -0
  96. package/dist/services/create.service.js +318 -0
  97. package/dist/services/create.service.js.map +1 -0
  98. package/dist/services/dev.service.d.ts +2 -0
  99. package/dist/services/dev.service.d.ts.map +1 -0
  100. package/dist/services/dev.service.js +78 -0
  101. package/dist/services/dev.service.js.map +1 -0
  102. package/dist/services/installer/electronBuilder.d.ts +2 -0
  103. package/dist/services/installer/electronBuilder.d.ts.map +1 -0
  104. package/dist/services/installer/electronBuilder.js +3 -0
  105. package/dist/services/installer/electronBuilder.js.map +1 -0
  106. package/dist/services/installer/electronForge.d.ts +2 -0
  107. package/dist/services/installer/electronForge.d.ts.map +1 -0
  108. package/dist/services/installer/electronForge.js +248 -0
  109. package/dist/services/installer/electronForge.js.map +1 -0
  110. package/dist/services/installer/installer.service.d.ts +5 -0
  111. package/dist/services/installer/installer.service.d.ts.map +1 -0
  112. package/dist/services/installer/installer.service.js +101 -0
  113. package/dist/services/installer/installer.service.js.map +1 -0
  114. package/dist/services/installer/macOS.helper.d.ts +3 -0
  115. package/dist/services/installer/macOS.helper.d.ts.map +1 -0
  116. package/dist/services/installer/macOS.helper.js +244 -0
  117. package/dist/services/installer/macOS.helper.js.map +1 -0
  118. package/dist/services/installer/prerequisites.d.ts +2 -0
  119. package/dist/services/installer/prerequisites.d.ts.map +1 -0
  120. package/dist/services/installer/prerequisites.js +73 -0
  121. package/dist/services/installer/prerequisites.js.map +1 -0
  122. package/dist/services/installer/windows.helper.d.ts +10 -0
  123. package/dist/services/installer/windows.helper.d.ts.map +1 -0
  124. package/dist/services/installer/windows.helper.js +394 -0
  125. package/dist/services/installer/windows.helper.js.map +1 -0
  126. package/dist/services/license.service.d.ts +7 -0
  127. package/dist/services/license.service.d.ts.map +1 -0
  128. package/dist/services/license.service.js +14 -0
  129. package/dist/services/license.service.js.map +1 -0
  130. package/dist/services/modifications/macOS.helper.d.ts +13 -0
  131. package/dist/services/modifications/macOS.helper.d.ts.map +1 -0
  132. package/dist/services/modifications/macOS.helper.js +274 -0
  133. package/dist/services/modifications/macOS.helper.js.map +1 -0
  134. package/dist/services/modifications/modifications.service.d.ts +2 -0
  135. package/dist/services/modifications/modifications.service.d.ts.map +1 -0
  136. package/dist/services/modifications/modifications.service.js +376 -0
  137. package/dist/services/modifications/modifications.service.js.map +1 -0
  138. package/dist/services/modifications/windows.helper.d.ts +2 -0
  139. package/dist/services/modifications/windows.helper.d.ts.map +1 -0
  140. package/dist/services/modifications/windows.helper.js +83 -0
  141. package/dist/services/modifications/windows.helper.js.map +1 -0
  142. package/dist/services/template.service.d.ts +116 -0
  143. package/dist/services/template.service.d.ts.map +1 -0
  144. package/dist/services/template.service.js +354 -0
  145. package/dist/services/template.service.js.map +1 -0
  146. package/dist/templates/auto-tests/README.md +31 -0
  147. package/dist/templates/auto-tests/playwright.config.js +19 -0
  148. package/dist/templates/auto-tests/template.json +12 -0
  149. package/dist/templates/auto-tests/tests/basic.test.js +15 -0
  150. package/dist/templates/ioconnect-desktop/.env.example +29 -0
  151. package/dist/templates/ioconnect-desktop/.github/workflows/build-installers.yml +170 -0
  152. package/dist/templates/ioconnect-desktop/LICENSE +0 -0
  153. package/dist/templates/ioconnect-desktop/README.md +0 -0
  154. package/dist/templates/ioconnect-desktop/config/mac-build/entitlements.mac.plist +44 -0
  155. package/dist/templates/ioconnect-desktop/config/win-build/template.nuspectemplate +33 -0
  156. package/dist/templates/ioconnect-desktop/forge.config.js +47 -0
  157. package/dist/templates/ioconnect-desktop/iocd.cli.config.json +45 -0
  158. package/dist/templates/ioconnect-desktop/modifications/iocd/assets/images/logo.icns +0 -0
  159. package/dist/templates/ioconnect-desktop/modifications/iocd/assets/images/logo.ico +0 -0
  160. package/dist/templates/ioconnect-desktop/modifications/iocd/assets/images/logo.png +0 -0
  161. package/dist/templates/ioconnect-desktop/modifications/iocd/config/system.json.merge +3 -0
  162. package/dist/templates/ioconnect-desktop/package.json +43 -0
  163. package/dist/templates/ioconnect-desktop/template.json +7 -0
  164. package/dist/templates/launchpad/apps/launchpad/.eslintrc.json +3 -0
  165. package/dist/templates/launchpad/apps/launchpad/config/iocd.app.def.dev.json +57 -0
  166. package/dist/templates/launchpad/apps/launchpad/config/iocd.app.def.prod.json +2 -0
  167. package/dist/templates/launchpad/apps/launchpad/config/iocd.system.dev.json +3 -0
  168. package/dist/templates/launchpad/apps/launchpad/config/iocd.system.prod.json +3 -0
  169. package/dist/templates/launchpad/apps/launchpad/index.html +16 -0
  170. package/dist/templates/launchpad/apps/launchpad/iocd.app.json +32 -0
  171. package/dist/templates/launchpad/apps/launchpad/package-lock.json +2778 -0
  172. package/dist/templates/launchpad/apps/launchpad/package.json +21 -0
  173. package/dist/templates/launchpad/apps/launchpad/public/favicon.ico +0 -0
  174. package/dist/templates/launchpad/apps/launchpad/src/app/app.tsx +39 -0
  175. package/dist/templates/launchpad/apps/launchpad/src/app/constants.ts +27 -0
  176. package/dist/templates/launchpad/apps/launchpad/src/components/logo.tsx +11 -0
  177. package/dist/templates/launchpad/apps/launchpad/src/components/main-context-menu.tsx +162 -0
  178. package/dist/templates/launchpad/apps/launchpad/src/components/notifications-button.tsx +44 -0
  179. package/dist/templates/launchpad/apps/launchpad/src/main.tsx +6 -0
  180. package/dist/templates/launchpad/apps/launchpad/src/styles.css +17 -0
  181. package/dist/templates/launchpad/apps/launchpad/tsconfig.json +10 -0
  182. package/dist/templates/launchpad/apps/launchpad/vite.config.ts +13 -0
  183. package/dist/templates/launchpad/template.json +12 -0
  184. package/dist/templates/splash-screen/apps/splash-screen/README.md +119 -0
  185. package/dist/templates/splash-screen/apps/splash-screen/config/system-dev.json +9 -0
  186. package/dist/templates/splash-screen/apps/splash-screen/config/system-prod.json +8 -0
  187. package/dist/templates/splash-screen/apps/splash-screen/index.html +55 -0
  188. package/dist/templates/splash-screen/apps/splash-screen/iocd.app.json +20 -0
  189. package/dist/templates/splash-screen/apps/splash-screen/package-lock.json +1059 -0
  190. package/dist/templates/splash-screen/apps/splash-screen/package.json +17 -0
  191. package/dist/templates/splash-screen/apps/splash-screen/public/assets/fonts/PTSans-Regular.ttf +0 -0
  192. package/dist/templates/splash-screen/apps/splash-screen/public/assets/images/logo-light.svg +85 -0
  193. package/dist/templates/splash-screen/apps/splash-screen/public/assets/images/splash-bg.png +0 -0
  194. package/dist/templates/splash-screen/apps/splash-screen/public/assets/styles/style.css +149 -0
  195. package/dist/templates/splash-screen/apps/splash-screen/public/assets/styles/style.css.map +1 -0
  196. package/dist/templates/splash-screen/apps/splash-screen/public/assets/styles/style.scss +90 -0
  197. package/dist/templates/splash-screen/apps/splash-screen/src/main.ts +93 -0
  198. package/dist/templates/splash-screen/apps/splash-screen/src/types.ts +28 -0
  199. package/dist/templates/splash-screen/apps/splash-screen/tsconfig.json +25 -0
  200. package/dist/templates/splash-screen/apps/splash-screen/vite.config.ts +27 -0
  201. package/dist/templates/splash-screen/template.json +12 -0
  202. package/dist/templates/web-groups/apps/web-groups/README.md +15 -0
  203. package/dist/templates/web-groups/apps/web-groups/config/web-group-dev.json +13 -0
  204. package/dist/templates/web-groups/apps/web-groups/config/web-group-prod.json +12 -0
  205. package/dist/templates/web-groups/apps/web-groups/index.html +18 -0
  206. package/dist/templates/web-groups/apps/web-groups/iocd.app.json +24 -0
  207. package/dist/templates/web-groups/apps/web-groups/package.json +28 -0
  208. package/dist/templates/web-groups/apps/web-groups/public/favicon.ico +0 -0
  209. package/dist/templates/web-groups/apps/web-groups/public/logo192.png +0 -0
  210. package/dist/templates/web-groups/apps/web-groups/public/logo512.png +0 -0
  211. package/dist/templates/web-groups/apps/web-groups/public/manifest.json +25 -0
  212. package/dist/templates/web-groups/apps/web-groups/public/robots.txt +3 -0
  213. package/dist/templates/web-groups/apps/web-groups/src/App.css +38 -0
  214. package/dist/templates/web-groups/apps/web-groups/src/App.tsx +11 -0
  215. package/dist/templates/web-groups/apps/web-groups/src/index.css +13 -0
  216. package/dist/templates/web-groups/apps/web-groups/src/index.tsx +25 -0
  217. package/dist/templates/web-groups/apps/web-groups/src/logo.svg +1 -0
  218. package/dist/templates/web-groups/apps/web-groups/src/reportWebVitals.ts +15 -0
  219. package/dist/templates/web-groups/apps/web-groups/tsconfig.json +26 -0
  220. package/dist/templates/web-groups/apps/web-groups/vite.config.ts +8 -0
  221. package/dist/templates/web-groups/template.json +12 -0
  222. package/dist/templates/workspaces/apps/workspaces/README.md +15 -0
  223. package/dist/templates/workspaces/apps/workspaces/config/workspaces-dev.json +21 -0
  224. package/dist/templates/workspaces/apps/workspaces/config/workspaces-prod.json +20 -0
  225. package/dist/templates/workspaces/apps/workspaces/index.html +17 -0
  226. package/dist/templates/workspaces/apps/workspaces/iocd.app.json +24 -0
  227. package/dist/templates/workspaces/apps/workspaces/package.json +29 -0
  228. package/dist/templates/workspaces/apps/workspaces/public/favicon.ico +0 -0
  229. package/dist/templates/workspaces/apps/workspaces/public/logo192.png +0 -0
  230. package/dist/templates/workspaces/apps/workspaces/public/logo512.png +0 -0
  231. package/dist/templates/workspaces/apps/workspaces/public/manifest.json +25 -0
  232. package/dist/templates/workspaces/apps/workspaces/public/robots.txt +3 -0
  233. package/dist/templates/workspaces/apps/workspaces/src/AddWindowButton.tsx +33 -0
  234. package/dist/templates/workspaces/apps/workspaces/src/AfterTabs.tsx +27 -0
  235. package/dist/templates/workspaces/apps/workspaces/src/App.css +38 -0
  236. package/dist/templates/workspaces/apps/workspaces/src/App.tsx +103 -0
  237. package/dist/templates/workspaces/apps/workspaces/src/GroupHeaderButtons.tsx +9 -0
  238. package/dist/templates/workspaces/apps/workspaces/src/index.css +4 -0
  239. package/dist/templates/workspaces/apps/workspaces/src/index.tsx +28 -0
  240. package/dist/templates/workspaces/apps/workspaces/src/logo.svg +7 -0
  241. package/dist/templates/workspaces/apps/workspaces/src/reportWebVitals.ts +15 -0
  242. package/dist/templates/workspaces/apps/workspaces/src/setupTests.ts +5 -0
  243. package/dist/templates/workspaces/apps/workspaces/src/useAddWindowButtonVisible.tsx +30 -0
  244. package/dist/templates/workspaces/apps/workspaces/tsconfig.json +26 -0
  245. package/dist/templates/workspaces/apps/workspaces/vite.config.ts +8 -0
  246. package/dist/templates/workspaces/template.json +12 -0
  247. package/dist/tools/rcedit-x64.exe +0 -0
  248. package/dist/utils/colors.d.ts +57 -0
  249. package/dist/utils/colors.d.ts.map +1 -0
  250. package/dist/utils/colors.js +151 -0
  251. package/dist/utils/colors.js.map +1 -0
  252. package/dist/utils/deep.merge.d.ts +5 -0
  253. package/dist/utils/deep.merge.d.ts.map +1 -0
  254. package/dist/utils/deep.merge.js +27 -0
  255. package/dist/utils/deep.merge.js.map +1 -0
  256. package/dist/utils/electron.builder.config.helper.d.ts +6 -0
  257. package/dist/utils/electron.builder.config.helper.d.ts.map +1 -0
  258. package/dist/utils/electron.builder.config.helper.js +25 -0
  259. package/dist/utils/electron.builder.config.helper.js.map +1 -0
  260. package/dist/utils/ensure.iocd.exists.d.ts +2 -0
  261. package/dist/utils/ensure.iocd.exists.d.ts.map +1 -0
  262. package/dist/utils/ensure.iocd.exists.js +27 -0
  263. package/dist/utils/ensure.iocd.exists.js.map +1 -0
  264. package/dist/utils/error.handler.d.ts +30 -0
  265. package/dist/utils/error.handler.d.ts.map +1 -0
  266. package/dist/utils/error.handler.js +104 -0
  267. package/dist/utils/error.handler.js.map +1 -0
  268. package/dist/utils/file.d.ts +10 -0
  269. package/dist/utils/file.d.ts.map +1 -0
  270. package/dist/utils/file.js +40 -0
  271. package/dist/utils/file.js.map +1 -0
  272. package/dist/utils/find.package.dir.d.ts +2 -0
  273. package/dist/utils/find.package.dir.d.ts.map +1 -0
  274. package/dist/utils/find.package.dir.js +23 -0
  275. package/dist/utils/find.package.dir.js.map +1 -0
  276. package/dist/utils/logger.d.ts +19 -0
  277. package/dist/utils/logger.d.ts.map +1 -0
  278. package/dist/utils/logger.js +184 -0
  279. package/dist/utils/logger.js.map +1 -0
  280. package/dist/utils/nextSteps.d.ts +2 -0
  281. package/dist/utils/nextSteps.d.ts.map +1 -0
  282. package/dist/utils/nextSteps.js +44 -0
  283. package/dist/utils/nextSteps.js.map +1 -0
  284. package/dist/utils/pacakge.json.helper.d.ts +9 -0
  285. package/dist/utils/pacakge.json.helper.d.ts.map +1 -0
  286. package/dist/utils/pacakge.json.helper.js +71 -0
  287. package/dist/utils/pacakge.json.helper.js.map +1 -0
  288. package/dist/utils/path.d.ts +19 -0
  289. package/dist/utils/path.d.ts.map +1 -0
  290. package/dist/utils/path.js +81 -0
  291. package/dist/utils/path.js.map +1 -0
  292. package/dist/utils/version.d.ts +2 -0
  293. package/dist/utils/version.d.ts.map +1 -0
  294. package/dist/utils/version.js +16 -0
  295. package/dist/utils/version.js.map +1 -0
  296. package/package.json +69 -0
  297. package/tools/rcedit-x64.exe +0 -0
@@ -0,0 +1,368 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.S3ComponentsStore = void 0;
4
+ const logger_1 = require("../../../utils/logger");
5
+ const error_handler_1 = require("../../../utils/error.handler");
6
+ const platform_utils_1 = require("../platform.utils");
7
+ /**
8
+ * S3 Components Store implementation
9
+ *
10
+ * This store downloads components from an AWS S3 bucket.
11
+ * It expects components to be organized in the bucket with the following structure:
12
+ *
13
+ * bucket/
14
+ * ├── component1/
15
+ * │ ├── v1.0.0/
16
+ * │ │ ├── component1-v1.0.0-win32.zip
17
+ * │ │ ├── component1-v1.0.0-darwin.dmg
18
+ * │ │ └── component1-v1.0.0-darwin-arm64.dmg
19
+ * │ └── v1.1.0/
20
+ * │ ├── component1-v1.1.0-win32.zip
21
+ * │ └── component1-v1.1.0-darwin.dmg
22
+ * └── component2/
23
+ * └── v2.0.0/
24
+ * └── component2-v2.0.0-win32.zip
25
+ *
26
+ * Authentication is handled through AWS credentials (environment variables, IAM roles, etc.)
27
+ */
28
+ class S3ComponentsStore {
29
+ logger = logger_1.Logger.getInstance();
30
+ bucketName;
31
+ region;
32
+ prefix;
33
+ accessKeyId;
34
+ secretAccessKey;
35
+ constructor(config) {
36
+ this.bucketName = config.bucketName;
37
+ this.region = config.region;
38
+ this.prefix = config.prefix;
39
+ this.accessKeyId = config.accessKeyId;
40
+ this.secretAccessKey = config.secretAccessKey;
41
+ this.validateConfiguration();
42
+ }
43
+ getInfo() {
44
+ const prefixInfo = this.prefix ? ` (prefix: ${this.prefix})` : '';
45
+ return `S3 Components Store: s3://${this.bucketName}${prefixInfo} (${this.region})`;
46
+ }
47
+ async getAll() {
48
+ this.logger.debug(`Scanning S3 bucket for components: ${this.bucketName}`);
49
+ try {
50
+ const objects = await this.listAllObjects();
51
+ return this.parseS3ObjectsToComponents(objects);
52
+ }
53
+ catch (error) {
54
+ throw new error_handler_1.CLIError(`Failed to list components from S3 bucket: ${error instanceof Error ? error.message : error}`, {
55
+ code: error_handler_1.ErrorCode.NETWORK_ERROR,
56
+ cause: error,
57
+ suggestions: [
58
+ 'Check your AWS credentials are properly configured',
59
+ 'Verify the S3 bucket exists and you have read permissions',
60
+ 'Check your network connection',
61
+ 'Ensure the AWS region is correct'
62
+ ]
63
+ });
64
+ }
65
+ }
66
+ async download(name, version) {
67
+ this.logger.info(`Downloading component ${name}@${version} from S3...`);
68
+ try {
69
+ // Find the specific object for this component and version
70
+ const objectKey = await this.findComponentObject(name, version);
71
+ if (!objectKey) {
72
+ throw new error_handler_1.CLIError(`Component ${name}@${version} not found in S3 bucket`, {
73
+ code: error_handler_1.ErrorCode.NOT_FOUND,
74
+ suggestions: [
75
+ `Check that component '${name}' version '${version}' exists in the S3 bucket`,
76
+ 'Use the browse command to see available components',
77
+ 'Verify the component naming convention matches the expected format'
78
+ ]
79
+ });
80
+ }
81
+ // Download the object
82
+ const data = await this.downloadObject(objectKey);
83
+ const filename = this.extractFilenameFromKey(objectKey);
84
+ this.logger.info(`Downloaded ${name}@${version} (${filename}) from S3 successfully!`);
85
+ return {
86
+ name: name,
87
+ data: data,
88
+ filename: filename
89
+ };
90
+ }
91
+ catch (error) {
92
+ if (error instanceof error_handler_1.CLIError) {
93
+ throw error;
94
+ }
95
+ throw new error_handler_1.CLIError(`Failed to download component from S3: ${error instanceof Error ? error.message : error}`, {
96
+ code: error_handler_1.ErrorCode.NETWORK_ERROR,
97
+ cause: error,
98
+ suggestions: [
99
+ 'Check your AWS credentials and permissions',
100
+ 'Verify the S3 bucket and object exist',
101
+ 'Check your network connection'
102
+ ]
103
+ });
104
+ }
105
+ }
106
+ /**
107
+ * Validate the S3 configuration
108
+ */
109
+ validateConfiguration() {
110
+ if (!this.bucketName) {
111
+ throw new error_handler_1.CLIError('S3 bucket name is required', {
112
+ code: error_handler_1.ErrorCode.INVALID_CONFIG,
113
+ suggestions: [
114
+ 'Set the bucketName in your S3 components store configuration',
115
+ 'Check your cli-config.json components.storeS3Config.bucketName setting'
116
+ ]
117
+ });
118
+ }
119
+ if (!this.region) {
120
+ throw new error_handler_1.CLIError('S3 region is required', {
121
+ code: error_handler_1.ErrorCode.INVALID_CONFIG,
122
+ suggestions: [
123
+ 'Set the region in your S3 components store configuration',
124
+ 'Check your cli-config.json components.storeS3Config.region setting'
125
+ ]
126
+ });
127
+ }
128
+ // Check for AWS credentials if not using IAM roles
129
+ if (!this.accessKeyId && !process.env['AWS_ACCESS_KEY_ID']) {
130
+ this.logger.warn('No AWS Access Key ID found. Assuming IAM role or other AWS credential provider is configured.');
131
+ }
132
+ }
133
+ /**
134
+ * List all objects in the S3 bucket
135
+ */
136
+ async listAllObjects() {
137
+ const objects = [];
138
+ let continuationToken;
139
+ do {
140
+ const response = await this.listObjectsV2(continuationToken);
141
+ if (response.Contents) {
142
+ objects.push(...response.Contents);
143
+ }
144
+ continuationToken = response.IsTruncated ? response.NextContinuationToken : undefined;
145
+ } while (continuationToken);
146
+ return objects;
147
+ }
148
+ /**
149
+ * List objects in S3 bucket using ListObjectsV2 API
150
+ */
151
+ async listObjectsV2(continuationToken) {
152
+ const url = this.buildS3ApiUrl('');
153
+ const params = new URLSearchParams({
154
+ 'list-type': '2',
155
+ 'max-keys': '1000'
156
+ });
157
+ if (this.prefix) {
158
+ params.append('prefix', this.prefix);
159
+ }
160
+ if (continuationToken) {
161
+ params.append('continuation-token', continuationToken);
162
+ }
163
+ const requestUrl = `${url}?${params.toString()}`;
164
+ const headers = await this.createAuthHeaders('GET', '', requestUrl);
165
+ const response = await fetch(requestUrl, {
166
+ method: 'GET',
167
+ headers: headers
168
+ });
169
+ if (!response.ok) {
170
+ throw new Error(`S3 API error: ${response.status} ${response.statusText}`);
171
+ }
172
+ const xmlText = await response.text();
173
+ return this.parseListObjectsResponse(xmlText);
174
+ }
175
+ /**
176
+ * Download an object from S3
177
+ */
178
+ async downloadObject(key) {
179
+ const url = this.buildS3ApiUrl(key);
180
+ const headers = await this.createAuthHeaders('GET', key, url);
181
+ this.logger.debug(`Downloading S3 object: ${key}`);
182
+ const response = await fetch(url, {
183
+ method: 'GET',
184
+ headers: headers
185
+ });
186
+ if (!response.ok) {
187
+ throw new Error(`Failed to download S3 object: ${response.status} ${response.statusText}`);
188
+ }
189
+ const buffer = await response.arrayBuffer();
190
+ return new Uint8Array(buffer);
191
+ }
192
+ /**
193
+ * Find the S3 object key for a specific component and version
194
+ */
195
+ async findComponentObject(name, version) {
196
+ const objects = await this.listAllObjects();
197
+ // Look for objects that match the component naming pattern
198
+ const targetObjects = objects.filter(obj => {
199
+ if (!obj.Key)
200
+ return false;
201
+ const key = obj.Key;
202
+ const platform = platform_utils_1.ComponentPlatformUtils.getCurrentPlatform();
203
+ // Handle "latest" version by finding the most recent version
204
+ if (version === 'latest') {
205
+ return key.includes(`${name}/`) && this.matchesPlatform(key, platform);
206
+ }
207
+ else {
208
+ return key.includes(`${name}/v${version}/`) && this.matchesPlatform(key, platform);
209
+ }
210
+ });
211
+ if (targetObjects.length === 0) {
212
+ return null;
213
+ }
214
+ // If multiple objects match, prefer exact platform matches
215
+ const exactMatch = targetObjects.find(obj => {
216
+ const key = obj.Key;
217
+ const platform = platform_utils_1.ComponentPlatformUtils.getCurrentPlatform();
218
+ return key.includes(`-${platform}.`) || key.includes(`-${platform}-`);
219
+ });
220
+ if (exactMatch) {
221
+ return exactMatch.Key;
222
+ }
223
+ // If looking for "latest", find the most recent by sorting
224
+ if (version === 'latest') {
225
+ targetObjects.sort((a, b) => {
226
+ const aVersion = this.extractVersionFromKey(a.Key);
227
+ const bVersion = this.extractVersionFromKey(b.Key);
228
+ return platform_utils_1.ComponentPlatformUtils.compareVersions(bVersion, aVersion); // Descending order
229
+ });
230
+ }
231
+ return targetObjects[0]?.Key || null;
232
+ }
233
+ /**
234
+ * Parse S3 objects into Component array
235
+ */
236
+ parseS3ObjectsToComponents(objects) {
237
+ const components = [];
238
+ for (const obj of objects) {
239
+ if (!obj.Key)
240
+ continue;
241
+ const component = this.parseComponentFromKey(obj.Key);
242
+ if (component) {
243
+ components.push(component);
244
+ }
245
+ }
246
+ return components;
247
+ }
248
+ /**
249
+ * Parse component information from S3 object key
250
+ */
251
+ parseComponentFromKey(key) {
252
+ // Expected format: [prefix/]componentName/vVersion/componentName-vVersion-platform.ext
253
+ const parts = key.split('/');
254
+ if (parts.length < 3) {
255
+ return null;
256
+ }
257
+ // Remove prefix if it exists
258
+ const relevantParts = this.prefix ? parts.slice(this.prefix.split('/').length) : parts;
259
+ if (relevantParts.length < 3) {
260
+ return null;
261
+ }
262
+ const componentName = relevantParts[0];
263
+ const versionDir = relevantParts[1]; // e.g., "v1.0.0"
264
+ const filename = relevantParts[relevantParts.length - 1];
265
+ // Extract version from directory name
266
+ const version = versionDir.startsWith('v') ? versionDir.substring(1) : versionDir;
267
+ // Extract platform from filename using the utility
268
+ const platformInfo = platform_utils_1.ComponentPlatformUtils.parseComponentFilename(filename);
269
+ return {
270
+ name: componentName,
271
+ version: version,
272
+ platform: platformInfo.platform || platform_utils_1.ComponentPlatformUtils.getCurrentPlatform(),
273
+ downloadUrl: this.buildS3ApiUrl(key)
274
+ };
275
+ }
276
+ /**
277
+ * Check if a key matches the current platform
278
+ */
279
+ matchesPlatform(key, _platform) {
280
+ // Extract the filename from the key
281
+ const filename = key.split('/').pop() || key;
282
+ return platform_utils_1.ComponentPlatformUtils.matchesCurrentPlatform(filename);
283
+ }
284
+ /**
285
+ * Extract version from S3 object key
286
+ */
287
+ extractVersionFromKey(key) {
288
+ const versionMatch = key.match(/\/v([^\/]+)\//);
289
+ return versionMatch ? versionMatch[1] : '0.0.0';
290
+ }
291
+ /**
292
+ * Extract filename from S3 object key
293
+ */
294
+ extractFilenameFromKey(key) {
295
+ return key.split('/').pop() || key;
296
+ }
297
+ /**
298
+ * Build S3 API URL for a given object key
299
+ */
300
+ buildS3ApiUrl(key) {
301
+ const encodedKey = encodeURIComponent(key).replace(/%2F/g, '/');
302
+ return `https://${this.bucketName}.s3.${this.region}.amazonaws.com/${encodedKey}`;
303
+ }
304
+ /**
305
+ * Create AWS Signature Version 4 authentication headers
306
+ */
307
+ async createAuthHeaders(_method, _key, _url) {
308
+ const accessKeyId = this.accessKeyId || process.env['AWS_ACCESS_KEY_ID'];
309
+ const secretAccessKey = this.secretAccessKey || process.env['AWS_SECRET_ACCESS_KEY'];
310
+ const sessionToken = process.env['AWS_SESSION_TOKEN'];
311
+ if (!accessKeyId || !secretAccessKey) {
312
+ // Return empty headers if no credentials - assuming IAM role or other auth
313
+ this.logger.debug('No AWS credentials found, assuming IAM role authentication');
314
+ return {};
315
+ }
316
+ const headers = {
317
+ 'Host': `${this.bucketName}.s3.${this.region}.amazonaws.com`
318
+ };
319
+ if (sessionToken) {
320
+ headers['X-Amz-Security-Token'] = sessionToken;
321
+ }
322
+ // For simplicity, this implementation assumes public bucket or IAM role auth
323
+ // In a full implementation, you would implement AWS Signature Version 4
324
+ // For now, we'll try without authentication and let AWS handle it
325
+ return headers;
326
+ }
327
+ /**
328
+ * Parse S3 ListObjects XML response
329
+ */
330
+ parseListObjectsResponse(xmlText) {
331
+ const response = {
332
+ Contents: []
333
+ };
334
+ // Simple XML parsing for S3 ListObjects response
335
+ const contentsMatches = xmlText.match(/<Contents>[\s\S]*?<\/Contents>/g);
336
+ if (contentsMatches) {
337
+ for (const contentMatch of contentsMatches) {
338
+ const keyMatch = contentMatch.match(/<Key>(.*?)<\/Key>/);
339
+ const lastModifiedMatch = contentMatch.match(/<LastModified>(.*?)<\/LastModified>/);
340
+ const sizeMatch = contentMatch.match(/<Size>(.*?)<\/Size>/);
341
+ if (keyMatch) {
342
+ const s3Object = {
343
+ Key: keyMatch[1]
344
+ };
345
+ if (lastModifiedMatch) {
346
+ s3Object.LastModified = new Date(lastModifiedMatch[1]);
347
+ }
348
+ if (sizeMatch) {
349
+ s3Object.Size = parseInt(sizeMatch[1]);
350
+ }
351
+ response.Contents.push(s3Object);
352
+ }
353
+ }
354
+ }
355
+ // Check if response is truncated
356
+ const truncatedMatch = xmlText.match(/<IsTruncated>(.*?)<\/IsTruncated>/);
357
+ if (truncatedMatch && truncatedMatch[1] === 'true') {
358
+ response.IsTruncated = true;
359
+ const tokenMatch = xmlText.match(/<NextContinuationToken>(.*?)<\/NextContinuationToken>/);
360
+ if (tokenMatch) {
361
+ response.NextContinuationToken = tokenMatch[1];
362
+ }
363
+ }
364
+ return response;
365
+ }
366
+ }
367
+ exports.S3ComponentsStore = S3ComponentsStore;
368
+ //# sourceMappingURL=s3.store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3.store.js","sourceRoot":"","sources":["../../../../src/services/components/stores/s3.store.ts"],"names":[],"mappings":";;;AAEA,kDAA+C;AAC/C,gEAAmE;AACnE,sDAA2D;AAe3D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,iBAAiB;IAClB,MAAM,GAAG,eAAM,CAAC,WAAW,EAAE,CAAC;IAC9B,UAAU,CAAS;IACnB,MAAM,CAAS;IACf,MAAM,CAAqB;IAC3B,WAAW,CAAqB;IAChC,eAAe,CAAqB;IAE5C,YAAY,MAMX;QACG,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QACtC,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAE9C,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACjC,CAAC;IAED,OAAO;QACH,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,OAAO,6BAA6B,IAAI,CAAC,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC;IACxF,CAAC;IAED,KAAK,CAAC,MAAM;QACR,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sCAAsC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAE3E,IAAI,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;QAAC,OAA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CAAqC,CAAC,CAAC;gBACpF,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;gBAE5D,IAAI,QAAQ,EAAE,CAAC;oBACX,MAAM,QAAQ,GAAa;wBACvB,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;qBACnB,CAAC;oBAEF,IAAI,iBAAiB,EAAE,CAAC;wBACpB,QAAQ,CAAC,YAAY,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC3D,CAAC;oBAED,IAAI,SAAS,EAAE,CAAC;wBACZ,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC3C,CAAC;oBAED,QAAQ,CAAC,QAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACtC,CAAC;YACL,CAAC;QACL,CAAC;QAED,iCAAiC;QACjC,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QAC1E,IAAI,cAAc,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC;YACjD,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC;YAE5B,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;YAC1F,IAAI,UAAU,EAAE,CAAC;gBACb,QAAQ,CAAC,qBAAqB,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YACnD,CAAC;QACL,CAAC;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAjaD,8CAiaC"}
@@ -0,0 +1,11 @@
1
+ import { Component } from "../component";
2
+ export interface ComponentsStore {
3
+ getInfo(): string;
4
+ getAll(): Promise<Component[]>;
5
+ download(name: string, version: string): Promise<{
6
+ name: string;
7
+ data: any;
8
+ filename: string;
9
+ }>;
10
+ }
11
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/services/components/stores/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC5B,OAAO,IAAI,MAAM,CAAC;IAClB,MAAM,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;CACjG"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../../../src/services/components/stores/store.ts"],"names":[],"mappings":""}
@@ -0,0 +1,57 @@
1
+ export interface CliConfig {
2
+ productSlug: string;
3
+ productName: string;
4
+ productDescription: string;
5
+ company: string;
6
+ version: string;
7
+ copyright: string;
8
+ components: {
9
+ store: "github" | "local" | "s3";
10
+ storeGithubRepo: string;
11
+ storeLocalPath: string;
12
+ storeS3Config: {
13
+ bucketName: string;
14
+ region: string;
15
+ prefix?: string;
16
+ accessKeyId?: string;
17
+ secretAccessKey?: string;
18
+ };
19
+ list: {
20
+ [index: string]: string;
21
+ };
22
+ };
23
+ win: {
24
+ exe: {
25
+ exeName: string;
26
+ exeIconPath: string;
27
+ };
28
+ codeSign: {
29
+ type: 'pfx' | 'wincert' | 'smime' | 'smctl' | 'custom' | 'off';
30
+ pfxPath?: string;
31
+ pfxPassword?: string;
32
+ wincertSubjectName?: string;
33
+ smimeCertificatePath?: string;
34
+ smimeCertificatePassword?: string;
35
+ customCodeSignScriptPath?: string;
36
+ tsaURL?: string;
37
+ };
38
+ };
39
+ mac: {
40
+ appBundleName: string;
41
+ appBundleId: string;
42
+ codeSign: {
43
+ type: 'keychain' | 'custom' | 'off';
44
+ identity?: string;
45
+ keychain?: string;
46
+ customCodeSignScriptPath?: string;
47
+ };
48
+ notarization: {
49
+ type: 'notarytool' | 'custom' | 'off';
50
+ appleId?: string;
51
+ appleIdPassword?: string;
52
+ appleTeamId?: string;
53
+ customNotarizationScriptPath?: string;
54
+ };
55
+ };
56
+ }
57
+ //# sourceMappingURL=cli.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.config.d.ts","sourceRoot":"","sources":["../../../src/services/config/cli.config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE;QACR,KAAK,EAAE,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;QACjC,eAAe,EAAE,MAAM,CAAC;QACxB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE;YACX,UAAU,EAAE,MAAM,CAAC;YACnB,MAAM,EAAE,MAAM,CAAC;YACf,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,eAAe,CAAC,EAAE,MAAM,CAAC;SAC5B,CAAC;QACF,IAAI,EAAE;YAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;KACrC,CAAA;IACD,GAAG,EAAE;QACD,GAAG,EAAE;YACD,OAAO,EAAE,MAAM,CAAC;YAChB,WAAW,EAAE,MAAM,CAAC;SACvB,CAAC;QACF,QAAQ,EAAE;YACN,IAAI,EAAE,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;YAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;YAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;YAC9B,wBAAwB,CAAC,EAAE,MAAM,CAAC;YAClC,wBAAwB,CAAC,EAAE,MAAM,CAAC;YAClC,MAAM,CAAC,EAAE,MAAM,CAAC;SACnB,CAAA;KACJ,CAAC;IAEF,GAAG,EAAE;QAED,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE;YACN,IAAI,EAAE,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;YACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,wBAAwB,CAAC,EAAE,MAAM,CAAC;SACrC,CAAC;QACF,YAAY,EAAE;YACV,IAAI,EAAE,YAAY,GAAG,QAAQ,GAAG,KAAK,CAAC;YACtC,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,eAAe,CAAC,EAAE,MAAM,CAAC;YACzB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;SACzC,CAAA;KACJ,CAAA;CACJ"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=cli.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.config.js","sourceRoot":"","sources":["../../../src/services/config/cli.config.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import { CliConfig } from "./cli.config";
2
+ export declare class ConfigManager {
3
+ private static cachedConfig;
4
+ private static configName;
5
+ static get config(): CliConfig;
6
+ static getConfigStringWithoutSecrets(): string;
7
+ static saveComponents(newComponents: {
8
+ [index: string]: string;
9
+ }): void;
10
+ private static loadConfig;
11
+ private static expandVariablesInString;
12
+ private static getDefaultConfig;
13
+ }
14
+ //# sourceMappingURL=config.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.service.d.ts","sourceRoot":"","sources":["../../../src/services/config/config.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,qBAAa,aAAa;IAEtB,OAAO,CAAC,MAAM,CAAC,YAAY,CAA0B;IACrD,OAAO,CAAC,MAAM,CAAC,UAAU,CAA0B;IAEnD,MAAM,KAAK,MAAM,IAAI,SAAS,CAK7B;WAEa,6BAA6B,IAAI,MAAM;WAevC,cAAc,CAAC,aAAa,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI;IAiB9E,OAAO,CAAC,MAAM,CAAC,UAAU;IAmCzB,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAYtC,OAAO,CAAC,MAAM,CAAC,gBAAgB;CAqDlC"}