@contember/cli 2.1.0-beta.2 → 2.2.0-alpha.2

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 (525) hide show
  1. package/CLAUDE.md +14 -1
  2. package/dist/development/index.cjs +5 -0
  3. package/dist/development/index.cjs.map +1 -0
  4. package/dist/development/index.js +5 -0
  5. package/dist/development/index.js.map +1 -0
  6. package/dist/development/run.cjs +3 -3
  7. package/dist/development/run.cjs.map +1 -1
  8. package/dist/development/run.js.map +1 -1
  9. package/dist/development/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -1
  10. package/dist/development/src/commands/actions/ActionsGetEventCommand.js.map +1 -1
  11. package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -1
  12. package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -1
  13. package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -1
  14. package/dist/development/src/commands/actions/ActionsListVariablesCommand.js.map +1 -1
  15. package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -1
  16. package/dist/development/src/commands/actions/ActionsRetryEventCommand.js.map +1 -1
  17. package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -1
  18. package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -1
  19. package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -1
  20. package/dist/development/src/commands/actions/ActionsStopEventCommand.js.map +1 -1
  21. package/dist/development/src/commands/deploy/DeployCommand.cjs +3 -1
  22. package/dist/development/src/commands/deploy/DeployCommand.cjs.map +1 -1
  23. package/dist/development/src/commands/deploy/DeployCommand.js +3 -1
  24. package/dist/development/src/commands/deploy/DeployCommand.js.map +1 -1
  25. package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs +26 -4
  26. package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
  27. package/dist/development/src/commands/migrations/MigrationAmendCommand.js +26 -4
  28. package/dist/development/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
  29. package/dist/development/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
  30. package/dist/development/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
  31. package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs +39 -3
  32. package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
  33. package/dist/development/src/commands/migrations/MigrationDiffCommand.js +39 -3
  34. package/dist/development/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
  35. package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs +3 -1
  36. package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
  37. package/dist/development/src/commands/migrations/MigrationExecuteCommand.js +3 -1
  38. package/dist/development/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
  39. package/dist/development/src/commands/migrations/MigrationInitStateCommand.cjs +26 -0
  40. package/dist/development/src/commands/migrations/MigrationInitStateCommand.cjs.map +1 -0
  41. package/dist/development/src/commands/migrations/MigrationInitStateCommand.js +26 -0
  42. package/dist/development/src/commands/migrations/MigrationInitStateCommand.js.map +1 -0
  43. package/dist/development/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
  44. package/dist/development/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
  45. package/dist/development/src/commands/migrations/MigrationSnapshotCommand.cjs +28 -0
  46. package/dist/development/src/commands/migrations/MigrationSnapshotCommand.cjs.map +1 -0
  47. package/dist/development/src/commands/migrations/MigrationSnapshotCommand.js +28 -0
  48. package/dist/development/src/commands/migrations/MigrationSnapshotCommand.js.map +1 -0
  49. package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
  50. package/dist/development/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
  51. package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.cjs +23 -0
  52. package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.cjs.map +1 -0
  53. package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.js +23 -0
  54. package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.js.map +1 -0
  55. package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs +2 -2
  56. package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
  57. package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
  58. package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
  59. package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
  60. package/dist/development/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
  61. package/dist/development/src/commands/project/ProjectValidateCommand.js.map +1 -1
  62. package/dist/development/src/commands/tenant/TenantApplyCommand.cjs +39 -0
  63. package/dist/development/src/commands/tenant/TenantApplyCommand.cjs.map +1 -0
  64. package/dist/development/src/commands/tenant/TenantApplyCommand.js +39 -0
  65. package/dist/development/src/commands/tenant/TenantApplyCommand.js.map +1 -0
  66. package/dist/development/src/commands/transfer/ExportCommand.cjs.map +1 -1
  67. package/dist/development/src/commands/transfer/ExportCommand.js.map +1 -1
  68. package/dist/development/src/commands/transfer/ImportCommand.cjs.map +1 -1
  69. package/dist/development/src/commands/transfer/ImportCommand.js.map +1 -1
  70. package/dist/development/src/commands/transfer/TransferCommand.cjs.map +1 -1
  71. package/dist/development/src/commands/transfer/TransferCommand.js.map +1 -1
  72. package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
  73. package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
  74. package/dist/development/src/consts.cjs +2 -2
  75. package/dist/development/src/consts.cjs.map +1 -1
  76. package/dist/development/src/dic.cjs +60 -10
  77. package/dist/development/src/dic.cjs.map +1 -1
  78. package/dist/development/src/dic.js +61 -11
  79. package/dist/development/src/dic.js.map +1 -1
  80. package/dist/development/src/lib/SystemClientProvider.cjs.map +1 -1
  81. package/dist/development/src/lib/SystemClientProvider.js.map +1 -1
  82. package/dist/development/src/lib/TenantClientProvider.cjs.map +1 -1
  83. package/dist/development/src/lib/TenantClientProvider.js.map +1 -1
  84. package/dist/development/src/lib/VersionChecker.cjs +2 -2
  85. package/dist/development/src/lib/VersionChecker.cjs.map +1 -1
  86. package/dist/development/src/lib/VersionChecker.js.map +1 -1
  87. package/dist/development/src/lib/admin/AdminClient.cjs.map +1 -1
  88. package/dist/development/src/lib/admin/AdminClient.js.map +1 -1
  89. package/dist/development/src/lib/admin/AdminDeployer.cjs.map +1 -1
  90. package/dist/development/src/lib/admin/AdminDeployer.js.map +1 -1
  91. package/dist/development/src/lib/fs/DockerComposeManager.cjs +10 -10
  92. package/dist/development/src/lib/fs/DockerComposeManager.cjs.map +1 -1
  93. package/dist/development/src/lib/fs/DockerComposeManager.js.map +1 -1
  94. package/dist/development/src/lib/fs/YamlHandler.cjs.map +1 -1
  95. package/dist/development/src/lib/fs/YamlHandler.js.map +1 -1
  96. package/dist/development/src/lib/js/EsBuildBuilder.cjs.map +1 -1
  97. package/dist/development/src/lib/js/EsBuildBuilder.js.map +1 -1
  98. package/dist/development/src/lib/js/EvalExecutor.cjs.map +1 -1
  99. package/dist/development/src/lib/js/EvalExecutor.js.map +1 -1
  100. package/dist/development/src/lib/js/JsCodeRunner.cjs.map +1 -1
  101. package/dist/development/src/lib/js/JsCodeRunner.js.map +1 -1
  102. package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs +78 -18
  103. package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
  104. package/dist/development/src/lib/migrations/MigrationExecutionFacade.js +79 -19
  105. package/dist/development/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
  106. package/dist/development/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
  107. package/dist/development/src/lib/migrations/MigrationPrinter.js.map +1 -1
  108. package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs +5 -1
  109. package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
  110. package/dist/development/src/lib/migrations/MigrationRebaseFacade.js +5 -1
  111. package/dist/development/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
  112. package/dist/development/src/lib/migrations/MigrationSnapshotFacade.cjs +171 -0
  113. package/dist/development/src/lib/migrations/MigrationSnapshotFacade.cjs.map +1 -0
  114. package/dist/development/src/lib/migrations/MigrationSnapshotFacade.js +171 -0
  115. package/dist/development/src/lib/migrations/MigrationSnapshotFacade.js.map +1 -0
  116. package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
  117. package/dist/development/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
  118. package/dist/development/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
  119. package/dist/development/src/lib/migrations/MigrationsValidator.js.map +1 -1
  120. package/dist/development/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
  121. package/dist/development/src/lib/project/RemoteProjectProvider.js.map +1 -1
  122. package/dist/development/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
  123. package/dist/development/src/lib/project/RemoteProjectResolver.js.map +1 -1
  124. package/dist/development/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
  125. package/dist/development/src/lib/project/docs/components/EntityInfo.js.map +1 -1
  126. package/dist/development/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
  127. package/dist/development/src/lib/project/docs/components/EntityLink.js.map +1 -1
  128. package/dist/development/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
  129. package/dist/development/src/lib/project/docs/components/FieldLink.js.map +1 -1
  130. package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
  131. package/dist/development/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
  132. package/dist/development/src/lib/project/docs/components/FieldType.cjs.map +1 -1
  133. package/dist/development/src/lib/project/docs/components/FieldType.js.map +1 -1
  134. package/dist/development/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
  135. package/dist/development/src/lib/project/docs/components/OnDelete.js.map +1 -1
  136. package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
  137. package/dist/development/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
  138. package/dist/development/src/lib/project/docs/projectDescribe.cjs.map +1 -1
  139. package/dist/development/src/lib/project/docs/projectDescribe.js.map +1 -1
  140. package/dist/development/src/lib/schema/SchemaLoader.cjs +5 -5
  141. package/dist/development/src/lib/schema/SchemaLoader.cjs.map +1 -1
  142. package/dist/development/src/lib/schema/SchemaLoader.js.map +1 -1
  143. package/dist/development/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
  144. package/dist/development/src/lib/schema/SchemaValidationHelper.js.map +1 -1
  145. package/dist/development/src/lib/tenant/TenantClient.cjs +75 -12
  146. package/dist/development/src/lib/tenant/TenantClient.cjs.map +1 -1
  147. package/dist/development/src/lib/tenant/TenantClient.js +75 -12
  148. package/dist/development/src/lib/tenant/TenantClient.js.map +1 -1
  149. package/dist/development/src/lib/tenant/TenantConfigApplier.cjs +55 -0
  150. package/dist/development/src/lib/tenant/TenantConfigApplier.cjs.map +1 -0
  151. package/dist/development/src/lib/tenant/TenantConfigApplier.js +55 -0
  152. package/dist/development/src/lib/tenant/TenantConfigApplier.js.map +1 -0
  153. package/dist/development/src/lib/tenant/TenantConfigLoader.cjs +32 -0
  154. package/dist/development/src/lib/tenant/TenantConfigLoader.cjs.map +1 -0
  155. package/dist/development/src/lib/tenant/TenantConfigLoader.js +32 -0
  156. package/dist/development/src/lib/tenant/TenantConfigLoader.js.map +1 -0
  157. package/dist/development/src/lib/tenant/tenantConfig.cjs +5 -0
  158. package/dist/development/src/lib/tenant/tenantConfig.cjs.map +1 -0
  159. package/dist/development/src/lib/tenant/tenantConfig.js +5 -0
  160. package/dist/development/src/lib/tenant/tenantConfig.js.map +1 -0
  161. package/dist/development/src/lib/transfer/DataTransferClient.cjs.map +1 -1
  162. package/dist/development/src/lib/transfer/DataTransferClient.js.map +1 -1
  163. package/dist/development/src/lib/workspace/WorkspaceResolver.cjs +6 -6
  164. package/dist/development/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
  165. package/dist/development/src/lib/workspace/WorkspaceResolver.js.map +1 -1
  166. package/dist/production/index.cjs +5 -0
  167. package/dist/production/index.cjs.map +1 -0
  168. package/dist/production/index.js +5 -0
  169. package/dist/production/index.js.map +1 -0
  170. package/dist/production/run.cjs +3 -3
  171. package/dist/production/run.cjs.map +1 -1
  172. package/dist/production/run.js.map +1 -1
  173. package/dist/production/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -1
  174. package/dist/production/src/commands/actions/ActionsGetEventCommand.js.map +1 -1
  175. package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -1
  176. package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -1
  177. package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -1
  178. package/dist/production/src/commands/actions/ActionsListVariablesCommand.js.map +1 -1
  179. package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -1
  180. package/dist/production/src/commands/actions/ActionsRetryEventCommand.js.map +1 -1
  181. package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -1
  182. package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -1
  183. package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -1
  184. package/dist/production/src/commands/actions/ActionsStopEventCommand.js.map +1 -1
  185. package/dist/production/src/commands/deploy/DeployCommand.cjs +3 -1
  186. package/dist/production/src/commands/deploy/DeployCommand.cjs.map +1 -1
  187. package/dist/production/src/commands/deploy/DeployCommand.js +3 -1
  188. package/dist/production/src/commands/deploy/DeployCommand.js.map +1 -1
  189. package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs +26 -4
  190. package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
  191. package/dist/production/src/commands/migrations/MigrationAmendCommand.js +26 -4
  192. package/dist/production/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
  193. package/dist/production/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
  194. package/dist/production/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
  195. package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs +39 -3
  196. package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
  197. package/dist/production/src/commands/migrations/MigrationDiffCommand.js +39 -3
  198. package/dist/production/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
  199. package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs +3 -1
  200. package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
  201. package/dist/production/src/commands/migrations/MigrationExecuteCommand.js +3 -1
  202. package/dist/production/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
  203. package/dist/production/src/commands/migrations/MigrationInitStateCommand.cjs +26 -0
  204. package/dist/production/src/commands/migrations/MigrationInitStateCommand.cjs.map +1 -0
  205. package/dist/production/src/commands/migrations/MigrationInitStateCommand.js +26 -0
  206. package/dist/production/src/commands/migrations/MigrationInitStateCommand.js.map +1 -0
  207. package/dist/production/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
  208. package/dist/production/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
  209. package/dist/production/src/commands/migrations/MigrationSnapshotCommand.cjs +28 -0
  210. package/dist/production/src/commands/migrations/MigrationSnapshotCommand.cjs.map +1 -0
  211. package/dist/production/src/commands/migrations/MigrationSnapshotCommand.js +28 -0
  212. package/dist/production/src/commands/migrations/MigrationSnapshotCommand.js.map +1 -0
  213. package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
  214. package/dist/production/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
  215. package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.cjs +23 -0
  216. package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.cjs.map +1 -0
  217. package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.js +23 -0
  218. package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.js.map +1 -0
  219. package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs +2 -2
  220. package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
  221. package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
  222. package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
  223. package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
  224. package/dist/production/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
  225. package/dist/production/src/commands/project/ProjectValidateCommand.js.map +1 -1
  226. package/dist/production/src/commands/tenant/TenantApplyCommand.cjs +39 -0
  227. package/dist/production/src/commands/tenant/TenantApplyCommand.cjs.map +1 -0
  228. package/dist/production/src/commands/tenant/TenantApplyCommand.js +39 -0
  229. package/dist/production/src/commands/tenant/TenantApplyCommand.js.map +1 -0
  230. package/dist/production/src/commands/transfer/ExportCommand.cjs.map +1 -1
  231. package/dist/production/src/commands/transfer/ExportCommand.js.map +1 -1
  232. package/dist/production/src/commands/transfer/ImportCommand.cjs.map +1 -1
  233. package/dist/production/src/commands/transfer/ImportCommand.js.map +1 -1
  234. package/dist/production/src/commands/transfer/TransferCommand.cjs.map +1 -1
  235. package/dist/production/src/commands/transfer/TransferCommand.js.map +1 -1
  236. package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
  237. package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
  238. package/dist/production/src/consts.cjs +2 -2
  239. package/dist/production/src/consts.cjs.map +1 -1
  240. package/dist/production/src/dic.cjs +60 -10
  241. package/dist/production/src/dic.cjs.map +1 -1
  242. package/dist/production/src/dic.js +61 -11
  243. package/dist/production/src/dic.js.map +1 -1
  244. package/dist/production/src/lib/SystemClientProvider.cjs.map +1 -1
  245. package/dist/production/src/lib/SystemClientProvider.js.map +1 -1
  246. package/dist/production/src/lib/TenantClientProvider.cjs.map +1 -1
  247. package/dist/production/src/lib/TenantClientProvider.js.map +1 -1
  248. package/dist/production/src/lib/VersionChecker.cjs +2 -2
  249. package/dist/production/src/lib/VersionChecker.cjs.map +1 -1
  250. package/dist/production/src/lib/VersionChecker.js.map +1 -1
  251. package/dist/production/src/lib/admin/AdminClient.cjs.map +1 -1
  252. package/dist/production/src/lib/admin/AdminClient.js.map +1 -1
  253. package/dist/production/src/lib/admin/AdminDeployer.cjs.map +1 -1
  254. package/dist/production/src/lib/admin/AdminDeployer.js.map +1 -1
  255. package/dist/production/src/lib/fs/DockerComposeManager.cjs +10 -10
  256. package/dist/production/src/lib/fs/DockerComposeManager.cjs.map +1 -1
  257. package/dist/production/src/lib/fs/DockerComposeManager.js.map +1 -1
  258. package/dist/production/src/lib/fs/YamlHandler.cjs.map +1 -1
  259. package/dist/production/src/lib/fs/YamlHandler.js.map +1 -1
  260. package/dist/production/src/lib/js/EsBuildBuilder.cjs.map +1 -1
  261. package/dist/production/src/lib/js/EsBuildBuilder.js.map +1 -1
  262. package/dist/production/src/lib/js/EvalExecutor.cjs.map +1 -1
  263. package/dist/production/src/lib/js/EvalExecutor.js.map +1 -1
  264. package/dist/production/src/lib/js/JsCodeRunner.cjs.map +1 -1
  265. package/dist/production/src/lib/js/JsCodeRunner.js.map +1 -1
  266. package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs +78 -18
  267. package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
  268. package/dist/production/src/lib/migrations/MigrationExecutionFacade.js +79 -19
  269. package/dist/production/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
  270. package/dist/production/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
  271. package/dist/production/src/lib/migrations/MigrationPrinter.js.map +1 -1
  272. package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs +5 -1
  273. package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
  274. package/dist/production/src/lib/migrations/MigrationRebaseFacade.js +5 -1
  275. package/dist/production/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
  276. package/dist/production/src/lib/migrations/MigrationSnapshotFacade.cjs +171 -0
  277. package/dist/production/src/lib/migrations/MigrationSnapshotFacade.cjs.map +1 -0
  278. package/dist/production/src/lib/migrations/MigrationSnapshotFacade.js +171 -0
  279. package/dist/production/src/lib/migrations/MigrationSnapshotFacade.js.map +1 -0
  280. package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
  281. package/dist/production/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
  282. package/dist/production/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
  283. package/dist/production/src/lib/migrations/MigrationsValidator.js.map +1 -1
  284. package/dist/production/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
  285. package/dist/production/src/lib/project/RemoteProjectProvider.js.map +1 -1
  286. package/dist/production/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
  287. package/dist/production/src/lib/project/RemoteProjectResolver.js.map +1 -1
  288. package/dist/production/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
  289. package/dist/production/src/lib/project/docs/components/EntityInfo.js.map +1 -1
  290. package/dist/production/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
  291. package/dist/production/src/lib/project/docs/components/EntityLink.js.map +1 -1
  292. package/dist/production/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
  293. package/dist/production/src/lib/project/docs/components/FieldLink.js.map +1 -1
  294. package/dist/production/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
  295. package/dist/production/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
  296. package/dist/production/src/lib/project/docs/components/FieldType.cjs.map +1 -1
  297. package/dist/production/src/lib/project/docs/components/FieldType.js.map +1 -1
  298. package/dist/production/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
  299. package/dist/production/src/lib/project/docs/components/OnDelete.js.map +1 -1
  300. package/dist/production/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
  301. package/dist/production/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
  302. package/dist/production/src/lib/project/docs/projectDescribe.cjs.map +1 -1
  303. package/dist/production/src/lib/project/docs/projectDescribe.js.map +1 -1
  304. package/dist/production/src/lib/schema/SchemaLoader.cjs +5 -5
  305. package/dist/production/src/lib/schema/SchemaLoader.cjs.map +1 -1
  306. package/dist/production/src/lib/schema/SchemaLoader.js.map +1 -1
  307. package/dist/production/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
  308. package/dist/production/src/lib/schema/SchemaValidationHelper.js.map +1 -1
  309. package/dist/production/src/lib/tenant/TenantClient.cjs +75 -12
  310. package/dist/production/src/lib/tenant/TenantClient.cjs.map +1 -1
  311. package/dist/production/src/lib/tenant/TenantClient.js +75 -12
  312. package/dist/production/src/lib/tenant/TenantClient.js.map +1 -1
  313. package/dist/production/src/lib/tenant/TenantConfigApplier.cjs +55 -0
  314. package/dist/production/src/lib/tenant/TenantConfigApplier.cjs.map +1 -0
  315. package/dist/production/src/lib/tenant/TenantConfigApplier.js +55 -0
  316. package/dist/production/src/lib/tenant/TenantConfigApplier.js.map +1 -0
  317. package/dist/production/src/lib/tenant/TenantConfigLoader.cjs +32 -0
  318. package/dist/production/src/lib/tenant/TenantConfigLoader.cjs.map +1 -0
  319. package/dist/production/src/lib/tenant/TenantConfigLoader.js +32 -0
  320. package/dist/production/src/lib/tenant/TenantConfigLoader.js.map +1 -0
  321. package/dist/production/src/lib/tenant/tenantConfig.cjs +5 -0
  322. package/dist/production/src/lib/tenant/tenantConfig.cjs.map +1 -0
  323. package/dist/production/src/lib/tenant/tenantConfig.js +5 -0
  324. package/dist/production/src/lib/tenant/tenantConfig.js.map +1 -0
  325. package/dist/production/src/lib/transfer/DataTransferClient.cjs.map +1 -1
  326. package/dist/production/src/lib/transfer/DataTransferClient.js.map +1 -1
  327. package/dist/production/src/lib/workspace/WorkspaceResolver.cjs +6 -6
  328. package/dist/production/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
  329. package/dist/production/src/lib/workspace/WorkspaceResolver.js.map +1 -1
  330. package/dist/types/commands/actions/ActionsGetEventCommand.d.ts +1 -1
  331. package/dist/types/commands/actions/ActionsGetEventCommand.d.ts.map +1 -1
  332. package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts +1 -1
  333. package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts.map +1 -1
  334. package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts +1 -1
  335. package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts.map +1 -1
  336. package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts +1 -1
  337. package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts.map +1 -1
  338. package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts +1 -1
  339. package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts.map +1 -1
  340. package/dist/types/commands/actions/ActionsStopEventCommand.d.ts +1 -1
  341. package/dist/types/commands/actions/ActionsStopEventCommand.d.ts.map +1 -1
  342. package/dist/types/commands/deploy/DeployCommand.d.ts +7 -6
  343. package/dist/types/commands/deploy/DeployCommand.d.ts.map +1 -1
  344. package/dist/types/commands/deploy/index.d.ts +1 -1
  345. package/dist/types/commands/deploy/index.d.ts.map +1 -1
  346. package/dist/types/commands/index.d.ts +6 -5
  347. package/dist/types/commands/index.d.ts.map +1 -1
  348. package/dist/types/commands/migrations/MigrationAmendCommand.d.ts +8 -7
  349. package/dist/types/commands/migrations/MigrationAmendCommand.d.ts.map +1 -1
  350. package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts +1 -1
  351. package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts.map +1 -1
  352. package/dist/types/commands/migrations/MigrationDiffCommand.d.ts +8 -5
  353. package/dist/types/commands/migrations/MigrationDiffCommand.d.ts.map +1 -1
  354. package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts +2 -1
  355. package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts.map +1 -1
  356. package/dist/types/commands/migrations/MigrationInitStateCommand.d.ts +14 -0
  357. package/dist/types/commands/migrations/MigrationInitStateCommand.d.ts.map +1 -0
  358. package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts +1 -1
  359. package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts.map +1 -1
  360. package/dist/types/commands/migrations/MigrationSnapshotCommand.d.ts +12 -0
  361. package/dist/types/commands/migrations/MigrationSnapshotCommand.d.ts.map +1 -0
  362. package/dist/types/commands/migrations/MigrationStatusCommand.d.ts +3 -3
  363. package/dist/types/commands/migrations/MigrationStatusCommand.d.ts.map +1 -1
  364. package/dist/types/commands/migrations/MigrationVerifySnapshotCommand.d.ts +12 -0
  365. package/dist/types/commands/migrations/MigrationVerifySnapshotCommand.d.ts.map +1 -0
  366. package/dist/types/commands/migrations/index.d.ts +10 -7
  367. package/dist/types/commands/migrations/index.d.ts.map +1 -1
  368. package/dist/types/commands/misc/index.d.ts +1 -1
  369. package/dist/types/commands/misc/index.d.ts.map +1 -1
  370. package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts +1 -1
  371. package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts.map +1 -1
  372. package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts +1 -1
  373. package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
  374. package/dist/types/commands/project/ProjectValidateCommand.d.ts +2 -2
  375. package/dist/types/commands/project/ProjectValidateCommand.d.ts.map +1 -1
  376. package/dist/types/commands/project/index.d.ts +3 -3
  377. package/dist/types/commands/project/index.d.ts.map +1 -1
  378. package/dist/types/commands/tenant/TenantApplyCommand.d.ts +21 -0
  379. package/dist/types/commands/tenant/TenantApplyCommand.d.ts.map +1 -0
  380. package/dist/types/commands/tenant/index.d.ts +2 -0
  381. package/dist/types/commands/tenant/index.d.ts.map +1 -0
  382. package/dist/types/commands/transfer/ExportCommand.d.ts +2 -2
  383. package/dist/types/commands/transfer/ExportCommand.d.ts.map +1 -1
  384. package/dist/types/commands/transfer/ImportCommand.d.ts +2 -2
  385. package/dist/types/commands/transfer/ImportCommand.d.ts.map +1 -1
  386. package/dist/types/commands/transfer/TransferCommand.d.ts +2 -2
  387. package/dist/types/commands/transfer/TransferCommand.d.ts.map +1 -1
  388. package/dist/types/commands/transfer/index.d.ts +3 -3
  389. package/dist/types/commands/transfer/index.d.ts.map +1 -1
  390. package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts +1 -1
  391. package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +1 -1
  392. package/dist/types/commands/workspace/index.d.ts +1 -1
  393. package/dist/types/commands/workspace/index.d.ts.map +1 -1
  394. package/dist/types/dic.d.ts +54 -32
  395. package/dist/types/dic.d.ts.map +1 -1
  396. package/dist/types/index.d.ts +2 -0
  397. package/dist/types/index.d.ts.map +1 -0
  398. package/dist/types/lib/SystemClientProvider.d.ts +1 -1
  399. package/dist/types/lib/SystemClientProvider.d.ts.map +1 -1
  400. package/dist/types/lib/TenantClientProvider.d.ts +2 -2
  401. package/dist/types/lib/TenantClientProvider.d.ts.map +1 -1
  402. package/dist/types/lib/VersionChecker.d.ts +1 -1
  403. package/dist/types/lib/VersionChecker.d.ts.map +1 -1
  404. package/dist/types/lib/admin/AdminClient.d.ts +1 -1
  405. package/dist/types/lib/admin/AdminClient.d.ts.map +1 -1
  406. package/dist/types/lib/admin/AdminDeployer.d.ts +3 -3
  407. package/dist/types/lib/admin/AdminDeployer.d.ts.map +1 -1
  408. package/dist/types/lib/fs/DockerComposeManager.d.ts +2 -2
  409. package/dist/types/lib/fs/DockerComposeManager.d.ts.map +1 -1
  410. package/dist/types/lib/fs/YamlHandler.d.ts +2 -2
  411. package/dist/types/lib/fs/YamlHandler.d.ts.map +1 -1
  412. package/dist/types/lib/js/EsBuildBuilder.d.ts +1 -1
  413. package/dist/types/lib/js/EsBuildBuilder.d.ts.map +1 -1
  414. package/dist/types/lib/js/EvalExecutor.d.ts +1 -1
  415. package/dist/types/lib/js/EvalExecutor.d.ts.map +1 -1
  416. package/dist/types/lib/js/JsCodeRunner.d.ts +2 -2
  417. package/dist/types/lib/js/JsCodeRunner.d.ts.map +1 -1
  418. package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts +13 -8
  419. package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts.map +1 -1
  420. package/dist/types/lib/migrations/MigrationRebaseFacade.d.ts +5 -4
  421. package/dist/types/lib/migrations/MigrationRebaseFacade.d.ts.map +1 -1
  422. package/dist/types/lib/migrations/MigrationSnapshotFacade.d.ts +28 -0
  423. package/dist/types/lib/migrations/MigrationSnapshotFacade.d.ts.map +1 -0
  424. package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts +2 -2
  425. package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts.map +1 -1
  426. package/dist/types/lib/project/RemoteProjectProvider.d.ts +1 -1
  427. package/dist/types/lib/project/RemoteProjectProvider.d.ts.map +1 -1
  428. package/dist/types/lib/project/RemoteProjectResolver.d.ts +2 -2
  429. package/dist/types/lib/project/RemoteProjectResolver.d.ts.map +1 -1
  430. package/dist/types/lib/project/docs/components/EntityInfo.d.ts +1 -1
  431. package/dist/types/lib/project/docs/components/EntityInfo.d.ts.map +1 -1
  432. package/dist/types/lib/project/docs/components/OnDelete.d.ts +1 -1
  433. package/dist/types/lib/project/docs/components/OnDelete.d.ts.map +1 -1
  434. package/dist/types/lib/schema/SchemaLoader.d.ts +2 -2
  435. package/dist/types/lib/schema/SchemaLoader.d.ts.map +1 -1
  436. package/dist/types/lib/tenant/TenantClient.d.ts +15 -0
  437. package/dist/types/lib/tenant/TenantClient.d.ts.map +1 -1
  438. package/dist/types/lib/tenant/TenantConfigApplier.d.ts +18 -0
  439. package/dist/types/lib/tenant/TenantConfigApplier.d.ts.map +1 -0
  440. package/dist/types/lib/tenant/TenantConfigLoader.d.ts +16 -0
  441. package/dist/types/lib/tenant/TenantConfigLoader.d.ts.map +1 -0
  442. package/dist/types/lib/tenant/tenantConfig.d.ts +74 -0
  443. package/dist/types/lib/tenant/tenantConfig.d.ts.map +1 -0
  444. package/dist/types/lib/transfer/DataTransferClient.d.ts +1 -1
  445. package/dist/types/lib/transfer/DataTransferClient.d.ts.map +1 -1
  446. package/dist/types/lib/workspace/WorkspaceResolver.d.ts +2 -2
  447. package/dist/types/lib/workspace/WorkspaceResolver.d.ts.map +1 -1
  448. package/dist/types/tsconfig.tsbuildinfo +1 -1
  449. package/package.json +33 -15
  450. package/src/commands/actions/ActionsGetEventCommand.ts +2 -2
  451. package/src/commands/actions/ActionsListFailedEventsCommand.ts +2 -2
  452. package/src/commands/actions/ActionsListVariablesCommand.ts +2 -2
  453. package/src/commands/actions/ActionsRetryEventCommand.ts +2 -2
  454. package/src/commands/actions/ActionsSetVariablesCommand.ts +2 -2
  455. package/src/commands/actions/ActionsStopEventCommand.ts +2 -2
  456. package/src/commands/deploy/DeployCommand.ts +13 -8
  457. package/src/commands/deploy/index.ts +1 -1
  458. package/src/commands/index.ts +6 -5
  459. package/src/commands/migrations/MigrationAmendCommand.ts +38 -10
  460. package/src/commands/migrations/MigrationDescribeCommand.ts +1 -1
  461. package/src/commands/migrations/MigrationDiffCommand.ts +50 -6
  462. package/src/commands/migrations/MigrationExecuteCommand.ts +6 -1
  463. package/src/commands/migrations/MigrationInitStateCommand.ts +34 -0
  464. package/src/commands/migrations/MigrationRebaseCommand.ts +1 -1
  465. package/src/commands/migrations/MigrationSnapshotCommand.ts +34 -0
  466. package/src/commands/migrations/MigrationStatusCommand.ts +3 -3
  467. package/src/commands/migrations/MigrationVerifySnapshotCommand.ts +28 -0
  468. package/src/commands/migrations/index.ts +10 -7
  469. package/src/commands/misc/index.ts +1 -1
  470. package/src/commands/project/ProjectGenerateDocumentationCommand.ts +3 -3
  471. package/src/commands/project/ProjectPrintSchemaCommand.ts +2 -2
  472. package/src/commands/project/ProjectValidateCommand.ts +3 -3
  473. package/src/commands/project/index.ts +3 -3
  474. package/src/commands/tenant/TenantApplyCommand.ts +57 -0
  475. package/src/commands/tenant/index.ts +1 -0
  476. package/src/commands/transfer/ExportCommand.ts +4 -4
  477. package/src/commands/transfer/ImportCommand.ts +6 -6
  478. package/src/commands/transfer/TransferCommand.ts +6 -6
  479. package/src/commands/transfer/index.ts +3 -3
  480. package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +2 -2
  481. package/src/commands/workspace/index.ts +1 -1
  482. package/src/dic.ts +103 -37
  483. package/src/index.ts +1 -0
  484. package/src/lib/SystemClientProvider.ts +1 -1
  485. package/src/lib/TenantClientProvider.ts +2 -2
  486. package/src/lib/VersionChecker.ts +2 -2
  487. package/src/lib/admin/AdminClient.ts +2 -2
  488. package/src/lib/admin/AdminDeployer.ts +3 -3
  489. package/src/lib/fs/DockerComposeManager.ts +2 -2
  490. package/src/lib/fs/YamlHandler.ts +2 -2
  491. package/src/lib/js/EsBuildBuilder.ts +1 -1
  492. package/src/lib/js/EvalExecutor.ts +1 -1
  493. package/src/lib/js/JsCodeRunner.ts +2 -2
  494. package/src/lib/migrations/MigrationExecutionFacade.ts +117 -23
  495. package/src/lib/migrations/MigrationPrinter.ts +1 -1
  496. package/src/lib/migrations/MigrationRebaseFacade.ts +10 -3
  497. package/src/lib/migrations/MigrationSnapshotFacade.ts +218 -0
  498. package/src/lib/migrations/MigrationsStatusFacade.ts +2 -2
  499. package/src/lib/migrations/MigrationsValidator.ts +1 -1
  500. package/src/lib/project/RemoteProjectProvider.ts +1 -1
  501. package/src/lib/project/RemoteProjectResolver.ts +3 -3
  502. package/src/lib/project/docs/components/EntityInfo.tsx +6 -6
  503. package/src/lib/project/docs/components/EntityLink.tsx +1 -1
  504. package/src/lib/project/docs/components/FieldLink.tsx +2 -2
  505. package/src/lib/project/docs/components/FieldPermissions.tsx +1 -1
  506. package/src/lib/project/docs/components/FieldType.tsx +2 -2
  507. package/src/lib/project/docs/components/OnDelete.tsx +3 -3
  508. package/src/lib/project/docs/components/ProjectInfo.tsx +3 -3
  509. package/src/lib/project/docs/projectDescribe.tsx +2 -2
  510. package/src/lib/schema/SchemaLoader.ts +2 -2
  511. package/src/lib/schema/SchemaValidationHelper.ts +1 -1
  512. package/src/lib/tenant/TenantClient.ts +123 -14
  513. package/src/lib/tenant/TenantConfigApplier.ts +72 -0
  514. package/src/lib/tenant/TenantConfigLoader.ts +41 -0
  515. package/src/lib/tenant/tenantConfig.ts +101 -0
  516. package/src/lib/transfer/DataTransferClient.ts +2 -2
  517. package/src/lib/workspace/WorkspaceResolver.ts +2 -2
  518. package/src/run.ts +6 -6
  519. package/src/tsconfig.json +1 -0
  520. package/tenant.config.example.ts +64 -0
  521. package/tests/cases/unit/MigrationAmendCommand.test.ts +156 -0
  522. package/tests/cases/unit/MigrationExecutionFacade.test.ts +81 -0
  523. package/tests/cases/unit/MigrationRebaseFacade.test.ts +87 -0
  524. package/tests/cases/unit/MigrationSnapshotFacade.test.ts +243 -0
  525. package/tests/tenantConfigApplier.test.ts +87 -0
@@ -1,5 +1,5 @@
1
1
  import { Builder } from "@contember/dic";
2
- import { MigrationFilesManager, JsLoader, JsonLoader, MigrationParser, ModificationHandlerFactory, SchemaMigrator, MigrationsResolver, SchemaVersionBuilder, SchemaDiffer, MigrationCreator, VERSION_LATEST, MigrationDescriber, MigrationExecutor, MigrationsStatusResolver } from "@contember/migrations-client";
2
+ import { MigrationFilesManager, JsLoader, JsonLoader, MigrationParser, ModificationHandlerFactory, SchemaMigrator, MigrationsResolver, SchemaStateManager, SnapshotManager, SchemaVersionBuilder, SchemaDiffer, MigrationCreator, VERSION_LATEST, MigrationDescriber, MigrationExecutor, MigrationsStatusResolver } from "@contember/migrations-client";
3
3
  import { JsCodeRunner } from "./lib/js/JsCodeRunner.js";
4
4
  import { EsBuildBuilder } from "./lib/js/EsBuildBuilder.js";
5
5
  import { EvalExecutor } from "./lib/js/EvalExecutor.js";
@@ -15,15 +15,20 @@ import { MigrationBlankCommand } from "./commands/migrations/MigrationBlankComma
15
15
  import { MigrationDescribeCommand } from "./commands/migrations/MigrationDescribeCommand.js";
16
16
  import { MigrationDiffCommand } from "./commands/migrations/MigrationDiffCommand.js";
17
17
  import { MigrationExecuteCommand } from "./commands/migrations/MigrationExecuteCommand.js";
18
+ import { MigrationInitStateCommand } from "./commands/migrations/MigrationInitStateCommand.js";
18
19
  import { MigrationStatusCommand } from "./commands/migrations/MigrationStatusCommand.js";
19
20
  import { MigrationRebaseCommand } from "./commands/migrations/MigrationRebaseCommand.js";
21
+ import { MigrationSnapshotCommand } from "./commands/migrations/MigrationSnapshotCommand.js";
22
+ import { MigrationVerifySnapshotCommand } from "./commands/migrations/MigrationVerifySnapshotCommand.js";
20
23
  import { VersionCommand } from "./commands/misc/VersionCommand.js";
21
24
  import { ProjectGenerateDocumentationCommand } from "./commands/project/ProjectGenerateDocumentationCommand.js";
22
25
  import { ProjectPrintSchemaCommand } from "./commands/project/ProjectPrintSchemaCommand.js";
23
26
  import { ProjectValidateCommand } from "./commands/project/ProjectValidateCommand.js";
27
+ import { TenantApplyCommand } from "./commands/tenant/TenantApplyCommand.js";
24
28
  import { WorkspaceUpdateApiCommand } from "./commands/workspace/WorkspaceUpdateApiCommand.js";
25
29
  import { MigrationExecutionFacade } from "./lib/migrations/MigrationExecutionFacade.js";
26
30
  import { MigrationPrinter } from "./lib/migrations/MigrationPrinter.js";
31
+ import { MigrationSnapshotFacade } from "./lib/migrations/MigrationSnapshotFacade.js";
27
32
  import { MigrationsStatusFacade } from "./lib/migrations/MigrationsStatusFacade.js";
28
33
  import { ImportSchemaLoader, TranspilingSchemaLoader } from "./lib/schema/SchemaLoader.js";
29
34
  import { MigrationsValidator } from "./lib/migrations/MigrationsValidator.js";
@@ -44,6 +49,8 @@ import { ActionsListFailedEventsCommand } from "./commands/actions/ActionsListFa
44
49
  import { ActionsRetryEventCommand } from "./commands/actions/ActionsRetryEventCommand.js";
45
50
  import { ActionsGetEventCommand } from "./commands/actions/ActionsGetEventCommand.js";
46
51
  import { ActionsStopEventCommand } from "./commands/actions/ActionsStopEventCommand.js";
52
+ import { ImportTenantConfigLoader, TranspilingTenantConfigLoader } from "./lib/tenant/TenantConfigLoader.js";
53
+ import { TenantConfigApplier } from "./lib/tenant/TenantConfigApplier.js";
47
54
  const jsSample = `
48
55
  export const query = \`\`
49
56
  export const variables = {}
@@ -81,13 +88,26 @@ const createContainer = ({ env, version, runtime, workspace }) => {
81
88
  }).addService(
82
89
  "dockerComposeManager",
83
90
  ({ workspace: workspace2, env: env2, fs, yamlHandler }) => new DockerComposeManager(workspace2.baseDir, env2.dockerComposeFile, fs, yamlHandler)
84
- ).addService("modificationHandlerFactory", () => new ModificationHandlerFactory(ModificationHandlerFactory.defaultFactoryMap)).addService("schemaMigrator", ({ modificationHandlerFactory }) => new SchemaMigrator(modificationHandlerFactory)).addService("migrationsResolver", ({ migrationFilesManager }) => new MigrationsResolver(migrationFilesManager)).addService("schemaVersionBuilder", ({ migrationsResolver, schemaMigrator }) => new SchemaVersionBuilder(migrationsResolver, schemaMigrator)).addService("schemaDiffer", ({ schemaMigrator }) => new SchemaDiffer(schemaMigrator, {
91
+ ).addService("modificationHandlerFactory", () => new ModificationHandlerFactory(ModificationHandlerFactory.defaultFactoryMap)).addService("schemaMigrator", ({ modificationHandlerFactory }) => new SchemaMigrator(modificationHandlerFactory)).addService("migrationsResolver", ({ migrationFilesManager }) => new MigrationsResolver(migrationFilesManager)).addService("schemaStateManager", ({ workspace: workspace2 }) => new SchemaStateManager(workspace2.migrationsDir + "/state")).addService("snapshotManager", ({ workspace: workspace2 }) => new SnapshotManager(workspace2.migrationsDir + "/snapshot.json")).addService(
92
+ "schemaVersionBuilder",
93
+ ({ migrationsResolver, schemaMigrator, schemaStateManager }) => new SchemaVersionBuilder(migrationsResolver, schemaMigrator, schemaStateManager)
94
+ ).addService("schemaDiffer", ({ schemaMigrator }) => new SchemaDiffer(schemaMigrator, {
85
95
  maxPatchSize: env.migrationsOptions?.maxPatchSize
86
96
  })).addService("migrationCreator", ({ migrationFilesManager, schemaDiffer }) => new MigrationCreator(migrationFilesManager, schemaDiffer, {
87
97
  json: JSON.stringify({ formatVersion: VERSION_LATEST, modifications: [] }, void 0, " ") + "\n",
88
98
  ts: jsSample,
89
99
  js: jsSample
90
100
  })).addService("migrationDescriber", ({ modificationHandlerFactory }) => new MigrationDescriber(modificationHandlerFactory)).addService("migrationPrinter", ({ migrationDescriber }) => new MigrationPrinter(migrationDescriber)).addService("migrationsExecutor", () => new MigrationExecutor()).addService("migrationsStatusResolver", () => new MigrationsStatusResolver()).addService(
101
+ "migrationSnapshotFacade",
102
+ ({ migrationsResolver, schemaVersionBuilder, schemaDiffer, schemaMigrator, schemaStateManager, snapshotManager }) => new MigrationSnapshotFacade(
103
+ migrationsResolver,
104
+ schemaVersionBuilder,
105
+ schemaDiffer,
106
+ schemaMigrator,
107
+ schemaStateManager,
108
+ snapshotManager
109
+ )
110
+ ).addService(
91
111
  "migrationsStatusFacade",
92
112
  ({ systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter }) => new MigrationsStatusFacade(systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter)
93
113
  ).addService(
@@ -99,7 +119,9 @@ const createContainer = ({ env, version, runtime, workspace }) => {
99
119
  schemaVersionBuilder,
100
120
  migrationPrinter,
101
121
  migrationsExecutor,
102
- migrationsStatusFacade
122
+ migrationsStatusFacade,
123
+ schemaStateManager,
124
+ migrationSnapshotFacade
103
125
  }) => new MigrationExecutionFacade(
104
126
  systemClientProvider,
105
127
  tenantClientProvider,
@@ -107,11 +129,13 @@ const createContainer = ({ env, version, runtime, workspace }) => {
107
129
  schemaVersionBuilder,
108
130
  migrationPrinter,
109
131
  migrationsExecutor,
110
- migrationsStatusFacade
132
+ migrationsStatusFacade,
133
+ schemaStateManager,
134
+ migrationSnapshotFacade
111
135
  )
112
136
  ).addService("migrationsValidator", ({ migrationDescriber, schemaMigrator }) => new MigrationsValidator(migrationDescriber, schemaMigrator)).addService(
113
137
  "migrationRebaseFacade",
114
- ({ schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager }) => new MigrationRebaseFacade(schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager)
138
+ ({ schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager, schemaStateManager }) => new MigrationRebaseFacade(schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager, schemaStateManager)
115
139
  ).addService(
116
140
  "schemaLoader",
117
141
  ({ workspace: workspace2, jsCodeRunner, runtime: runtime2 }) => runtime2 === "bun" ? new ImportSchemaLoader(workspace2) : new TranspilingSchemaLoader(workspace2, jsCodeRunner)
@@ -129,7 +153,8 @@ const createContainer = ({ env, version, runtime, workspace }) => {
129
153
  migrationCreator,
130
154
  migrationsValidator,
131
155
  migrationPrinter,
132
- schemaMigrator
156
+ schemaMigrator,
157
+ schemaStateManager
133
158
  }) => new MigrationAmendCommand(
134
159
  migrationsResolver,
135
160
  systemClientProvider,
@@ -139,17 +164,32 @@ const createContainer = ({ env, version, runtime, workspace }) => {
139
164
  migrationCreator,
140
165
  migrationsValidator,
141
166
  migrationPrinter,
142
- schemaMigrator
167
+ schemaMigrator,
168
+ schemaStateManager
143
169
  )
144
170
  ).addService("migrationBlankCommand", ({ migrationCreator }) => new MigrationBlankCommand(migrationCreator)).addService(
145
171
  "migrationDescribeCommand",
146
172
  ({ migrationPrinter, schemaVersionBuilder, migrationsResolver }) => new MigrationDescribeCommand(migrationPrinter, schemaVersionBuilder, migrationsResolver)
147
173
  ).addService(
148
174
  "migrationDiffCommand",
149
- ({ schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade }) => new MigrationDiffCommand(schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade)
175
+ ({ schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade, schemaStateManager, migrationsResolver }) => new MigrationDiffCommand(
176
+ schemaLoader,
177
+ schemaVersionBuilder,
178
+ migrationCreator,
179
+ migrationPrinter,
180
+ migrationExecutionFacade,
181
+ schemaStateManager,
182
+ migrationsResolver
183
+ )
150
184
  ).addService("migrationExecuteCommand", ({ migrationExecutionFacade }) => new MigrationExecuteCommand(migrationExecutionFacade)).addService(
185
+ "migrationInitStateCommand",
186
+ ({ schemaLoader, schemaStateManager }) => new MigrationInitStateCommand(schemaLoader, schemaStateManager)
187
+ ).addService(
151
188
  "migrationRebaseCommand",
152
189
  ({ migrationsResolver, migrationRebaseFacade }) => new MigrationRebaseCommand(migrationsResolver, migrationRebaseFacade)
190
+ ).addService("migrationSnapshotCommand", ({ migrationSnapshotFacade }) => new MigrationSnapshotCommand(migrationSnapshotFacade)).addService(
191
+ "migrationVerifySnapshotCommand",
192
+ ({ migrationSnapshotFacade }) => new MigrationVerifySnapshotCommand(migrationSnapshotFacade)
153
193
  ).addService(
154
194
  "migrationStatusCommand",
155
195
  ({ migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter }) => new MigrationStatusCommand(migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter)
@@ -165,7 +205,13 @@ const createContainer = ({ env, version, runtime, workspace }) => {
165
205
  ).addService("exportCommand", ({ dataTransferClient, remoteProjectResolver }) => new ExportCommand(remoteProjectResolver, dataTransferClient)).addService("importCommand", ({ dataTransferClient, remoteProjectResolver }) => new ImportCommand(remoteProjectResolver, dataTransferClient)).addService("transferCommand", ({ dataTransferClient, remoteProjectResolver }) => new TransferCommand(remoteProjectResolver, dataTransferClient)).addService(
166
206
  "workspaceUpdateCommand",
167
207
  ({ packageWorkspaceResolver, dockerComposeManager }) => new WorkspaceUpdateApiCommand(packageWorkspaceResolver, dockerComposeManager)
168
- ).addService("actionsListVariables", ({ remoteProjectResolver }) => new ActionsListVariablesCommand(remoteProjectResolver)).addService("actionsSetVariables", ({ remoteProjectResolver }) => new ActionsSetVariablesCommand(remoteProjectResolver)).addService("actionsListFailedEvents", ({ remoteProjectResolver }) => new ActionsListFailedEventsCommand(remoteProjectResolver)).addService("actionsRetryEvent", ({ remoteProjectResolver }) => new ActionsRetryEventCommand(remoteProjectResolver)).addService("actionsGetEvent", ({ remoteProjectResolver }) => new ActionsGetEventCommand(remoteProjectResolver)).addService("actionsStopEvent", ({ remoteProjectResolver }) => new ActionsStopEventCommand(remoteProjectResolver)).addService("commandList", (dic) => {
208
+ ).addService("actionsListVariables", ({ remoteProjectResolver }) => new ActionsListVariablesCommand(remoteProjectResolver)).addService("actionsSetVariables", ({ remoteProjectResolver }) => new ActionsSetVariablesCommand(remoteProjectResolver)).addService("actionsListFailedEvents", ({ remoteProjectResolver }) => new ActionsListFailedEventsCommand(remoteProjectResolver)).addService("actionsRetryEvent", ({ remoteProjectResolver }) => new ActionsRetryEventCommand(remoteProjectResolver)).addService("actionsGetEvent", ({ remoteProjectResolver }) => new ActionsGetEventCommand(remoteProjectResolver)).addService("actionsStopEvent", ({ remoteProjectResolver }) => new ActionsStopEventCommand(remoteProjectResolver)).addService(
209
+ "tenantConfigLoader",
210
+ ({ jsCodeRunner }) => runtime === "bun" ? new ImportTenantConfigLoader() : new TranspilingTenantConfigLoader(jsCodeRunner)
211
+ ).addService("tenantConfigApplier", () => new TenantConfigApplier()).addService(
212
+ "tenantApplyCommand",
213
+ ({ remoteProjectResolver, tenantConfigLoader, tenantConfigApplier }) => new TenantApplyCommand(remoteProjectResolver, tenantConfigLoader, tenantConfigApplier)
214
+ ).addService("commandList", (dic) => {
169
215
  const commands = {
170
216
  ["deploy"]: () => dic.deployCommand,
171
217
  ["version"]: () => dic.versionCommand,
@@ -175,9 +221,12 @@ const createContainer = ({ env, version, runtime, workspace }) => {
175
221
  ["migrations:diff"]: () => dic.migrationDiffCommand,
176
222
  ["migrations:amend"]: () => dic.migrationAmendCommand,
177
223
  ["migrations:blank"]: () => dic.migrationBlankCommand,
224
+ ["migrations:init-state"]: () => dic.migrationInitStateCommand,
178
225
  ["migrations:describe"]: () => dic.migrationDescribeCommand,
179
226
  ["migrations:execute"]: () => dic.migrationExecuteCommand,
180
227
  ["migrations:rebase"]: () => dic.migrationRebaseCommand,
228
+ ["migrations:snapshot"]: () => dic.migrationSnapshotCommand,
229
+ ["migrations:verify-snapshot"]: () => dic.migrationVerifySnapshotCommand,
181
230
  ["migrations:status"]: () => dic.migrationStatusCommand,
182
231
  ["workspace:update:api"]: () => dic.workspaceUpdateCommand,
183
232
  ["project:validate"]: () => dic.projectValidateCommand,
@@ -188,7 +237,8 @@ const createContainer = ({ env, version, runtime, workspace }) => {
188
237
  ["actions:failed-events"]: () => dic.actionsListFailedEvents,
189
238
  ["actions:retry-event"]: () => dic.actionsRetryEvent,
190
239
  ["actions:get-event"]: () => dic.actionsGetEvent,
191
- ["actions:stop-event"]: () => dic.actionsStopEvent
240
+ ["actions:stop-event"]: () => dic.actionsStopEvent,
241
+ ["tenant:apply"]: () => dic.tenantApplyCommand
192
242
  };
193
243
  return commands;
194
244
  }).addService("commandManager", ({ commandList }) => new CommandManager(commandList)).addService(
@@ -200,7 +250,7 @@ const createContainer = ({ env, version, runtime, workspace }) => {
200
250
  `Contember CLI version ${version}`,
201
251
  {
202
252
  beforeRun: async ({ name }) => {
203
- if (!process.env.CONTEMBER_SKIP_VERSION_CHECK && !["deploy", "version", "data:export", "data:import", "data:transfer"].includes(name)) {
253
+ if (!process.env.CONTEMBER_SKIP_VERSION_CHECK && !["deploy", "version", "data:export", "data:import", "data:transfer", "tenant:apply"].includes(name)) {
204
254
  await versionChecker.checkVersions();
205
255
  }
206
256
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dic.js","sources":["../../../../packages/cli/src/dic.ts"],"sourcesContent":["import { Builder } from '@contember/dic'\nimport {\n\tJsLoader,\n\tJsonLoader,\n\tMigrationCreator,\n\tMigrationDescriber,\n\tMigrationExecutor,\n\tMigrationFilesManager,\n\tMigrationParser,\n\tMigrationsResolver,\n\tMigrationsStatusResolver,\n\tModificationHandlerFactory,\n\tSchemaDiffer,\n\tSchemaMigrator,\n\tSchemaVersionBuilder,\n\tVERSION_LATEST,\n} from '@contember/migrations-client'\nimport { JsCodeRunner } from './lib/js/JsCodeRunner'\nimport { EsBuildBuilder } from './lib/js/EsBuildBuilder'\nimport { EvalExecutor } from './lib/js/EvalExecutor'\nimport { AdminDeployer } from './lib/admin/AdminDeployer'\nimport { RemoteProjectResolver } from './lib/project/RemoteProjectResolver'\nimport { CliEnv } from './lib/env'\nimport { AdminClient } from './lib/admin/AdminClient'\nimport { FileSystem } from './lib/fs/FileSystem'\nimport { WorkspaceResolver } from './lib/workspace/WorkspaceResolver'\nimport { YamlHandler } from './lib/fs/YamlHandler'\nimport {\n\tDeployCommand,\n\tMigrationAmendCommand,\n\tMigrationBlankCommand,\n\tMigrationDescribeCommand,\n\tMigrationDiffCommand,\n\tMigrationExecuteCommand,\n\tMigrationRebaseCommand,\n\tMigrationStatusCommand,\n\tProjectGenerateDocumentationCommand,\n\tProjectPrintSchemaCommand,\n\tProjectValidateCommand,\n\tVersionCommand,\n\tWorkspaceUpdateApiCommand,\n} from './commands'\nimport { MigrationExecutionFacade } from './lib/migrations/MigrationExecutionFacade'\nimport { MigrationPrinter } from './lib/migrations/MigrationPrinter'\nimport { MigrationsStatusFacade } from './lib/migrations/MigrationsStatusFacade'\nimport { ImportSchemaLoader, SchemaLoader, TranspilingSchemaLoader } from './lib/schema/SchemaLoader'\nimport { MigrationsValidator } from './lib/migrations/MigrationsValidator'\nimport { MigrationRebaseFacade } from './lib/migrations/MigrationRebaseFacade'\nimport { DataTransferClient } from './lib/transfer/DataTransferClient'\nimport { ExportCommand, ImportCommand, TransferCommand } from './commands/transfer'\nimport {\n\tApplication,\n\tBun,\n\tCommandFactoryList,\n\tCommandManager,\n\tCommandRunner,\n\tNpm,\n\tPackageWorkspaceResolver,\n\tPnpm,\n\tYarn,\n\tYarnClassic,\n} from '@contember/cli-common'\nimport { VersionChecker } from './lib/VersionChecker'\nimport { DockerComposeManager } from './lib/fs/DockerComposeManager'\nimport { RemoteProjectProvider } from './lib/project/RemoteProjectProvider'\nimport { SystemClientProvider } from './lib/SystemClientProvider'\nimport { TenantClientProvider } from './lib/TenantClientProvider'\nimport { Workspace } from './lib/workspace/Workspace'\nimport { ActionsListVariablesCommand } from './commands/actions/ActionsListVariablesCommand'\nimport { ActionsSetVariablesCommand } from './commands/actions/ActionsSetVariablesCommand'\nimport { ActionsListFailedEventsCommand } from './commands/actions/ActionsListFailedEventsCommand'\nimport { ActionsRetryEventCommand } from './commands/actions/ActionsRetryEventCommand'\nimport { ActionsGetEventCommand } from './commands/actions/ActionsGetEventCommand'\nimport { ActionsStopEventCommand } from './commands/actions/ActionsStopEventCommand'\n\nconst jsSample = `\nexport const query = \\`\\`\nexport const variables = {}\n\n// or multiple queries\n// export const queries = []\n\n// or a factory\n// export default async () => ({ queries: [] })\n`\n\nexport const createContainer = ({ env, version, runtime, workspace }: {\n\tworkspace: Workspace\n\tenv: CliEnv\n\tversion: string\n\truntime: 'node' | 'bun'\n}) => {\n\treturn new Builder({})\n\t\t.addService('env', () => env)\n\t\t.addService('version', () => version)\n\t\t.addService('runtime', () => runtime)\n\t\t.addService('workspace', () => workspace)\n\t\t.addService('fs', () => new FileSystem())\n\t\t.addService('yamlHandler', ({ fs }) => new YamlHandler(fs))\n\t\t.addService('jsExecutor', () => new EvalExecutor())\n\t\t.addService('jsBuilder', () => new EsBuildBuilder())\n\t\t.addService('jsCodeRunner', ({ jsExecutor, jsBuilder }) => new JsCodeRunner(jsBuilder, jsExecutor))\n\t\t.addService('workspaceResolver', ({ yamlHandler }) => new WorkspaceResolver(yamlHandler))\n\t\t.addService('remoteProjectResolver', ({ env }) => new RemoteProjectResolver(env))\n\t\t.addService('remoteProjectProvider', ({ remoteProjectResolver }) => {\n\t\t\tconst provider = new RemoteProjectProvider()\n\t\t\tconst remoteProject = remoteProjectResolver.resolve()\n\t\t\tif (remoteProject) {\n\t\t\t\tprovider.setRemoteProject(remoteProject)\n\t\t\t}\n\t\t\treturn provider\n\t\t})\n\t\t.addService('systemClientProvider', ({ remoteProjectProvider }) => new SystemClientProvider(remoteProjectProvider))\n\t\t.addService('tenantClientProvider', ({ remoteProjectProvider }) => new TenantClientProvider(remoteProjectProvider))\n\t\t.addService('adminClient', ({ remoteProjectProvider }) => new AdminClient(remoteProjectProvider))\n\t\t.addService('migrationFilesManager', ({ jsCodeRunner, workspace }) => {\n\t\t\tconst runJs = runtime === 'bun' ? (file: string) => import(file) : jsCodeRunner.run\n\t\t\treturn new MigrationFilesManager(workspace.migrationsDir, {\n\t\t\t\tjson: new JsonLoader(new MigrationParser()),\n\t\t\t\tts: new JsLoader(new MigrationParser(), runJs),\n\t\t\t\tjs: new JsLoader(new MigrationParser(), runJs),\n\t\t\t})\n\t\t})\n\t\t.addService('packageWorkspaceResolver', ({ workspace, fs }) => {\n\t\t\tconst commandRunner = new CommandRunner()\n\t\t\treturn new PackageWorkspaceResolver(workspace.baseDir, fs, [\n\t\t\t\tnew Yarn(fs, commandRunner),\n\t\t\t\tnew YarnClassic(fs, commandRunner),\n\t\t\t\tnew Pnpm(fs, commandRunner),\n\t\t\t\tnew Npm(fs, commandRunner),\n\t\t\t\tnew Bun(fs, commandRunner),\n\t\t\t])\n\t\t})\n\t\t.addService(\n\t\t\t'dockerComposeManager',\n\t\t\t({ workspace, env, fs, yamlHandler }) => new DockerComposeManager(workspace.baseDir, env.dockerComposeFile, fs, yamlHandler),\n\t\t)\n\t\t.addService('modificationHandlerFactory', () => new ModificationHandlerFactory(ModificationHandlerFactory.defaultFactoryMap))\n\t\t.addService('schemaMigrator', ({ modificationHandlerFactory }) => new SchemaMigrator(modificationHandlerFactory))\n\t\t.addService('migrationsResolver', ({ migrationFilesManager }) => new MigrationsResolver(migrationFilesManager))\n\t\t.addService('schemaVersionBuilder', ({ migrationsResolver, schemaMigrator }) => new SchemaVersionBuilder(migrationsResolver, schemaMigrator))\n\t\t.addService('schemaDiffer', ({ schemaMigrator }) =>\n\t\t\tnew SchemaDiffer(schemaMigrator, {\n\t\t\t\tmaxPatchSize: env.migrationsOptions?.maxPatchSize,\n\t\t\t}))\n\t\t.addService('migrationCreator', ({ migrationFilesManager, schemaDiffer }) =>\n\t\t\tnew MigrationCreator(migrationFilesManager, schemaDiffer, {\n\t\t\t\tjson: JSON.stringify({ formatVersion: VERSION_LATEST, modifications: [] }, undefined, '\\t') + '\\n',\n\t\t\t\tts: jsSample,\n\t\t\t\tjs: jsSample,\n\t\t\t}))\n\t\t.addService('migrationDescriber', ({ modificationHandlerFactory }) => new MigrationDescriber(modificationHandlerFactory))\n\t\t.addService('migrationPrinter', ({ migrationDescriber }) => new MigrationPrinter(migrationDescriber))\n\t\t.addService('migrationsExecutor', () => new MigrationExecutor())\n\t\t.addService('migrationsStatusResolver', () => new MigrationsStatusResolver())\n\t\t.addService(\n\t\t\t'migrationsStatusFacade',\n\t\t\t({ systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter }) =>\n\t\t\t\tnew MigrationsStatusFacade(systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationExecutionFacade',\n\t\t\t({\n\t\t\t\tsystemClientProvider,\n\t\t\t\ttenantClientProvider,\n\t\t\t\tremoteProjectProvider,\n\t\t\t\tschemaVersionBuilder,\n\t\t\t\tmigrationPrinter,\n\t\t\t\tmigrationsExecutor,\n\t\t\t\tmigrationsStatusFacade,\n\t\t\t}) =>\n\t\t\t\tnew MigrationExecutionFacade(\n\t\t\t\t\tsystemClientProvider,\n\t\t\t\t\ttenantClientProvider,\n\t\t\t\t\tremoteProjectProvider,\n\t\t\t\t\tschemaVersionBuilder,\n\t\t\t\t\tmigrationPrinter,\n\t\t\t\t\tmigrationsExecutor,\n\t\t\t\t\tmigrationsStatusFacade,\n\t\t\t\t),\n\t\t)\n\t\t.addService('migrationsValidator', ({ migrationDescriber, schemaMigrator }) => new MigrationsValidator(migrationDescriber, schemaMigrator))\n\t\t.addService(\n\t\t\t'migrationRebaseFacade',\n\t\t\t({ schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager }) =>\n\t\t\t\tnew MigrationRebaseFacade(schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager),\n\t\t)\n\t\t.addService(\n\t\t\t'schemaLoader',\n\t\t\t({ workspace, jsCodeRunner, runtime }) =>\n\t\t\t\truntime === 'bun' ? new ImportSchemaLoader(workspace) : new TranspilingSchemaLoader(workspace, jsCodeRunner),\n\t\t)\n\t\t.addService('adminDeployer', ({ remoteProjectProvider, adminClient, fs }) => new AdminDeployer(remoteProjectProvider, adminClient, fs))\n\t\t.addService('dataTransferClient', () => new DataTransferClient())\n\t\t.addService(\n\t\t\t'deployCommand',\n\t\t\t({ adminDeployer, migrationExecutionFacade, fs, remoteProjectProvider, remoteProjectResolver, workspace }) =>\n\t\t\t\tnew DeployCommand(adminDeployer, migrationExecutionFacade, fs, remoteProjectProvider, remoteProjectResolver, workspace),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationAmendCommand',\n\t\t\t({\n\t\t\t\tmigrationsResolver,\n\t\t\t\tsystemClientProvider,\n\t\t\t\tmigrationsStatusFacade,\n\t\t\t\tschemaLoader,\n\t\t\t\tschemaVersionBuilder,\n\t\t\t\tmigrationCreator,\n\t\t\t\tmigrationsValidator,\n\t\t\t\tmigrationPrinter,\n\t\t\t\tschemaMigrator,\n\t\t\t}) =>\n\t\t\t\tnew MigrationAmendCommand(\n\t\t\t\t\tmigrationsResolver,\n\t\t\t\t\tsystemClientProvider,\n\t\t\t\t\tmigrationsStatusFacade,\n\t\t\t\t\tschemaLoader,\n\t\t\t\t\tschemaVersionBuilder,\n\t\t\t\t\tmigrationCreator,\n\t\t\t\t\tmigrationsValidator,\n\t\t\t\t\tmigrationPrinter,\n\t\t\t\t\tschemaMigrator,\n\t\t\t\t),\n\t\t)\n\t\t.addService('migrationBlankCommand', ({ migrationCreator }) => new MigrationBlankCommand(migrationCreator))\n\t\t.addService(\n\t\t\t'migrationDescribeCommand',\n\t\t\t({ migrationPrinter, schemaVersionBuilder, migrationsResolver }) =>\n\t\t\t\tnew MigrationDescribeCommand(migrationPrinter, schemaVersionBuilder, migrationsResolver),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationDiffCommand',\n\t\t\t({ schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade }) =>\n\t\t\t\tnew MigrationDiffCommand(schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade),\n\t\t)\n\t\t.addService('migrationExecuteCommand', ({ migrationExecutionFacade }) => new MigrationExecuteCommand(migrationExecutionFacade))\n\t\t.addService(\n\t\t\t'migrationRebaseCommand',\n\t\t\t({ migrationsResolver, migrationRebaseFacade }) => new MigrationRebaseCommand(migrationsResolver, migrationRebaseFacade),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationStatusCommand',\n\t\t\t({ migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter }) =>\n\t\t\t\tnew MigrationStatusCommand(migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter),\n\t\t)\n\t\t.addService('versionCommand', ({ version }) => new VersionCommand(version))\n\t\t.addService(\n\t\t\t'projectGenerateDocumentationCommand',\n\t\t\t({ schemaLoader, schemaVersionBuilder }) => new ProjectGenerateDocumentationCommand(schemaLoader, schemaVersionBuilder),\n\t\t)\n\t\t.addService(\n\t\t\t'projectPrintSchemaCommand',\n\t\t\t({ schemaLoader, schemaVersionBuilder }) => new ProjectPrintSchemaCommand(schemaLoader, schemaVersionBuilder),\n\t\t)\n\t\t.addService(\n\t\t\t'projectValidateCommand',\n\t\t\t({ schemaLoader, migrationsValidator, migrationsResolver, schemaDiffer, schemaVersionBuilder }) =>\n\t\t\t\tnew ProjectValidateCommand(schemaLoader, migrationsValidator, migrationsResolver, schemaDiffer, schemaVersionBuilder),\n\t\t)\n\t\t.addService('exportCommand', ({ dataTransferClient, remoteProjectResolver }) => new ExportCommand(remoteProjectResolver, dataTransferClient))\n\t\t.addService('importCommand', ({ dataTransferClient, remoteProjectResolver }) => new ImportCommand(remoteProjectResolver, dataTransferClient))\n\t\t.addService('transferCommand', ({ dataTransferClient, remoteProjectResolver }) => new TransferCommand(remoteProjectResolver, dataTransferClient))\n\t\t.addService(\n\t\t\t'workspaceUpdateCommand',\n\t\t\t({ packageWorkspaceResolver, dockerComposeManager }) => new WorkspaceUpdateApiCommand(packageWorkspaceResolver, dockerComposeManager),\n\t\t)\n\t\t.addService('actionsListVariables', ({ remoteProjectResolver }) => new ActionsListVariablesCommand(remoteProjectResolver))\n\t\t.addService('actionsSetVariables', ({ remoteProjectResolver }) => new ActionsSetVariablesCommand(remoteProjectResolver))\n\t\t.addService('actionsListFailedEvents', ({ remoteProjectResolver }) => new ActionsListFailedEventsCommand(remoteProjectResolver))\n\t\t.addService('actionsRetryEvent', ({ remoteProjectResolver }) => new ActionsRetryEventCommand(remoteProjectResolver))\n\t\t.addService('actionsGetEvent', ({ remoteProjectResolver }) => new ActionsGetEventCommand(remoteProjectResolver))\n\t\t.addService('actionsStopEvent', ({ remoteProjectResolver }) => new ActionsStopEventCommand(remoteProjectResolver))\n\t\t.addService('commandList', dic => {\n\t\t\tconst commands: CommandFactoryList = {\n\t\t\t\t['deploy']: () => dic.deployCommand,\n\t\t\t\t['version']: () => dic.versionCommand,\n\t\t\t\t['data:export']: () => dic.exportCommand,\n\t\t\t\t['data:import']: () => dic.importCommand,\n\t\t\t\t['data:transfer']: () => dic.transferCommand,\n\t\t\t\t['migrations:diff']: () => dic.migrationDiffCommand,\n\t\t\t\t['migrations:amend']: () => dic.migrationAmendCommand,\n\t\t\t\t['migrations:blank']: () => dic.migrationBlankCommand,\n\t\t\t\t['migrations:describe']: () => dic.migrationDescribeCommand,\n\t\t\t\t['migrations:execute']: () => dic.migrationExecuteCommand,\n\t\t\t\t['migrations:rebase']: () => dic.migrationRebaseCommand,\n\t\t\t\t['migrations:status']: () => dic.migrationStatusCommand,\n\t\t\t\t['workspace:update:api']: () => dic.workspaceUpdateCommand,\n\t\t\t\t['project:validate']: () => dic.projectValidateCommand,\n\t\t\t\t['project:print-schema']: () => dic.projectPrintSchemaCommand,\n\t\t\t\t['project:generate-doc']: () => dic.projectGenerateDocumentationCommand,\n\t\t\t\t['actions:list-variables']: () => dic.actionsListVariables,\n\t\t\t\t['actions:set-variables']: () => dic.actionsSetVariables,\n\t\t\t\t['actions:failed-events']: () => dic.actionsListFailedEvents,\n\t\t\t\t['actions:retry-event']: () => dic.actionsRetryEvent,\n\t\t\t\t['actions:get-event']: () => dic.actionsGetEvent,\n\t\t\t\t['actions:stop-event']: () => dic.actionsStopEvent,\n\t\t\t}\n\t\t\treturn commands\n\t\t})\n\t\t.addService('commandManager', ({ commandList }) => new CommandManager(commandList))\n\t\t.addService(\n\t\t\t'versionChecker',\n\t\t\t({ version, workspace, packageWorkspaceResolver, dockerComposeManager }) =>\n\t\t\t\tnew VersionChecker(version, workspace.baseDir, packageWorkspaceResolver, dockerComposeManager),\n\t\t)\n\t\t.addService('application', ({ commandManager, versionChecker }) => {\n\t\t\tconst app = new Application(\n\t\t\t\tcommandManager,\n\t\t\t\t`Contember CLI version ${version}`,\n\t\t\t\t{\n\t\t\t\t\tbeforeRun: async ({ name }) => {\n\t\t\t\t\t\tif (!process.env.CONTEMBER_SKIP_VERSION_CHECK && !['deploy', 'version', 'data:export', 'data:import', 'data:transfer'].includes(name)) {\n\t\t\t\t\t\t\tawait versionChecker.checkVersions()\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\t\t\treturn app\n\t\t})\n\t\t.build()\n}\n"],"names":["env","workspace","runtime","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWV,MAAM,kBAAkB,CAAC,EAAE,KAAK,SAAS,SAAS,gBAKnD;AACL,SAAO,IAAI,QAAQ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AAO,EAAE,WAAW;AAC9B,cAAI,CAAC,QAAQ,IAAI,gCAAgC,CAAC,CAAC,UAAU,WAAW,eAAe,eAAe,eAAe,EAAE,SAAS,IAAI,GAAG;AACtI,kBAAM,eAAe,cAAA;AAAA,UACtB;AAAA,QACD;AAAA,MAAA;AAAA,IACD;AAED,WAAO;AAAA,EACR,CAAC,EACA,MAAA;AACH;"}
1
+ {"version":3,"file":"dic.js","sources":["../../../../packages/cli/src/dic.ts"],"sourcesContent":["import { Builder } from '@contember/dic'\nimport {\n\tJsLoader,\n\tJsonLoader,\n\tMigrationCreator,\n\tMigrationDescriber,\n\tMigrationExecutor,\n\tMigrationFilesManager,\n\tMigrationParser,\n\tMigrationsResolver,\n\tMigrationsStatusResolver,\n\tModificationHandlerFactory,\n\tSchemaDiffer,\n\tSchemaMigrator,\n\tSchemaStateManager,\n\tSchemaVersionBuilder,\n\tSnapshotManager,\n\tVERSION_LATEST,\n} from '@contember/migrations-client'\nimport { JsCodeRunner } from './lib/js/JsCodeRunner.js'\nimport { EsBuildBuilder } from './lib/js/EsBuildBuilder.js'\nimport { EvalExecutor } from './lib/js/EvalExecutor.js'\nimport { AdminDeployer } from './lib/admin/AdminDeployer.js'\nimport { RemoteProjectResolver } from './lib/project/RemoteProjectResolver.js'\nimport { CliEnv } from './lib/env.js'\nimport { AdminClient } from './lib/admin/AdminClient.js'\nimport { FileSystem } from './lib/fs/FileSystem.js'\nimport { WorkspaceResolver } from './lib/workspace/WorkspaceResolver.js'\nimport { YamlHandler } from './lib/fs/YamlHandler.js'\nimport {\n\tDeployCommand,\n\tMigrationAmendCommand,\n\tMigrationBlankCommand,\n\tMigrationDescribeCommand,\n\tMigrationDiffCommand,\n\tMigrationExecuteCommand,\n\tMigrationInitStateCommand,\n\tMigrationRebaseCommand,\n\tMigrationSnapshotCommand,\n\tMigrationStatusCommand,\n\tMigrationVerifySnapshotCommand,\n\tProjectGenerateDocumentationCommand,\n\tProjectPrintSchemaCommand,\n\tProjectValidateCommand,\n\tVersionCommand,\n\tWorkspaceUpdateApiCommand,\n} from './commands/index.js'\nimport { MigrationExecutionFacade } from './lib/migrations/MigrationExecutionFacade.js'\nimport { MigrationPrinter } from './lib/migrations/MigrationPrinter.js'\nimport { MigrationSnapshotFacade } from './lib/migrations/MigrationSnapshotFacade.js'\nimport { MigrationsStatusFacade } from './lib/migrations/MigrationsStatusFacade.js'\nimport { ImportSchemaLoader, SchemaLoader, TranspilingSchemaLoader } from './lib/schema/SchemaLoader.js'\nimport { MigrationsValidator } from './lib/migrations/MigrationsValidator.js'\nimport { MigrationRebaseFacade } from './lib/migrations/MigrationRebaseFacade.js'\nimport { DataTransferClient } from './lib/transfer/DataTransferClient.js'\nimport { ExportCommand, ImportCommand, TransferCommand } from './commands/transfer/index.js'\nimport {\n\tApplication,\n\tBun,\n\tCommandFactoryList,\n\tCommandManager,\n\tCommandRunner,\n\tNpm,\n\tPackageWorkspaceResolver,\n\tPnpm,\n\tYarn,\n\tYarnClassic,\n} from '@contember/cli-common'\nimport { VersionChecker } from './lib/VersionChecker.js'\nimport { DockerComposeManager } from './lib/fs/DockerComposeManager.js'\nimport { RemoteProjectProvider } from './lib/project/RemoteProjectProvider.js'\nimport { SystemClientProvider } from './lib/SystemClientProvider.js'\nimport { TenantClientProvider } from './lib/TenantClientProvider.js'\nimport { Workspace } from './lib/workspace/Workspace.js'\nimport { ActionsListVariablesCommand } from './commands/actions/ActionsListVariablesCommand.js'\nimport { ActionsSetVariablesCommand } from './commands/actions/ActionsSetVariablesCommand.js'\nimport { ActionsListFailedEventsCommand } from './commands/actions/ActionsListFailedEventsCommand.js'\nimport { ActionsRetryEventCommand } from './commands/actions/ActionsRetryEventCommand.js'\nimport { ActionsGetEventCommand } from './commands/actions/ActionsGetEventCommand.js'\nimport { ActionsStopEventCommand } from './commands/actions/ActionsStopEventCommand.js'\nimport { TenantApplyCommand } from './commands/tenant/index.js'\nimport { ImportTenantConfigLoader, TranspilingTenantConfigLoader } from './lib/tenant/TenantConfigLoader.js'\nimport { TenantConfigApplier } from './lib/tenant/TenantConfigApplier.js'\n\nconst jsSample = `\nexport const query = \\`\\`\nexport const variables = {}\n\n// or multiple queries\n// export const queries = []\n\n// or a factory\n// export default async () => ({ queries: [] })\n`\n\nexport const createContainer = ({ env, version, runtime, workspace }: {\n\tworkspace: Workspace\n\tenv: CliEnv\n\tversion: string\n\truntime: 'node' | 'bun'\n}) => {\n\treturn new Builder({})\n\t\t.addService('env', () => env)\n\t\t.addService('version', () => version)\n\t\t.addService('runtime', () => runtime)\n\t\t.addService('workspace', () => workspace)\n\t\t.addService('fs', () => new FileSystem())\n\t\t.addService('yamlHandler', ({ fs }) => new YamlHandler(fs))\n\t\t.addService('jsExecutor', () => new EvalExecutor())\n\t\t.addService('jsBuilder', () => new EsBuildBuilder())\n\t\t.addService('jsCodeRunner', ({ jsExecutor, jsBuilder }) => new JsCodeRunner(jsBuilder, jsExecutor))\n\t\t.addService('workspaceResolver', ({ yamlHandler }) => new WorkspaceResolver(yamlHandler))\n\t\t.addService('remoteProjectResolver', ({ env }) => new RemoteProjectResolver(env))\n\t\t.addService('remoteProjectProvider', ({ remoteProjectResolver }) => {\n\t\t\tconst provider = new RemoteProjectProvider()\n\t\t\tconst remoteProject = remoteProjectResolver.resolve()\n\t\t\tif (remoteProject) {\n\t\t\t\tprovider.setRemoteProject(remoteProject)\n\t\t\t}\n\t\t\treturn provider\n\t\t})\n\t\t.addService('systemClientProvider', ({ remoteProjectProvider }) => new SystemClientProvider(remoteProjectProvider))\n\t\t.addService('tenantClientProvider', ({ remoteProjectProvider }) => new TenantClientProvider(remoteProjectProvider))\n\t\t.addService('adminClient', ({ remoteProjectProvider }) => new AdminClient(remoteProjectProvider))\n\t\t.addService('migrationFilesManager', ({ jsCodeRunner, workspace }) => {\n\t\t\tconst runJs = runtime === 'bun' ? (file: string) => import(file) : jsCodeRunner.run\n\t\t\treturn new MigrationFilesManager(workspace.migrationsDir, {\n\t\t\t\tjson: new JsonLoader(new MigrationParser()),\n\t\t\t\tts: new JsLoader(new MigrationParser(), runJs),\n\t\t\t\tjs: new JsLoader(new MigrationParser(), runJs),\n\t\t\t})\n\t\t})\n\t\t.addService('packageWorkspaceResolver', ({ workspace, fs }) => {\n\t\t\tconst commandRunner = new CommandRunner()\n\t\t\treturn new PackageWorkspaceResolver(workspace.baseDir, fs, [\n\t\t\t\tnew Yarn(fs, commandRunner),\n\t\t\t\tnew YarnClassic(fs, commandRunner),\n\t\t\t\tnew Pnpm(fs, commandRunner),\n\t\t\t\tnew Npm(fs, commandRunner),\n\t\t\t\tnew Bun(fs, commandRunner),\n\t\t\t])\n\t\t})\n\t\t.addService(\n\t\t\t'dockerComposeManager',\n\t\t\t({ workspace, env, fs, yamlHandler }) => new DockerComposeManager(workspace.baseDir, env.dockerComposeFile, fs, yamlHandler),\n\t\t)\n\t\t.addService('modificationHandlerFactory', () => new ModificationHandlerFactory(ModificationHandlerFactory.defaultFactoryMap))\n\t\t.addService('schemaMigrator', ({ modificationHandlerFactory }) => new SchemaMigrator(modificationHandlerFactory))\n\t\t.addService('migrationsResolver', ({ migrationFilesManager }) => new MigrationsResolver(migrationFilesManager))\n\t\t.addService('schemaStateManager', ({ workspace }) => new SchemaStateManager(workspace.migrationsDir + '/state'))\n\t\t.addService('snapshotManager', ({ workspace }) => new SnapshotManager(workspace.migrationsDir + '/snapshot.json'))\n\t\t.addService(\n\t\t\t'schemaVersionBuilder',\n\t\t\t({ migrationsResolver, schemaMigrator, schemaStateManager }) => new SchemaVersionBuilder(migrationsResolver, schemaMigrator, schemaStateManager),\n\t\t)\n\t\t.addService('schemaDiffer', ({ schemaMigrator }) =>\n\t\t\tnew SchemaDiffer(schemaMigrator, {\n\t\t\t\tmaxPatchSize: env.migrationsOptions?.maxPatchSize,\n\t\t\t}))\n\t\t.addService('migrationCreator', ({ migrationFilesManager, schemaDiffer }) =>\n\t\t\tnew MigrationCreator(migrationFilesManager, schemaDiffer, {\n\t\t\t\tjson: JSON.stringify({ formatVersion: VERSION_LATEST, modifications: [] }, undefined, '\\t') + '\\n',\n\t\t\t\tts: jsSample,\n\t\t\t\tjs: jsSample,\n\t\t\t}))\n\t\t.addService('migrationDescriber', ({ modificationHandlerFactory }) => new MigrationDescriber(modificationHandlerFactory))\n\t\t.addService('migrationPrinter', ({ migrationDescriber }) => new MigrationPrinter(migrationDescriber))\n\t\t.addService('migrationsExecutor', () => new MigrationExecutor())\n\t\t.addService('migrationsStatusResolver', () => new MigrationsStatusResolver())\n\t\t.addService(\n\t\t\t'migrationSnapshotFacade',\n\t\t\t({ migrationsResolver, schemaVersionBuilder, schemaDiffer, schemaMigrator, schemaStateManager, snapshotManager }) =>\n\t\t\t\tnew MigrationSnapshotFacade(\n\t\t\t\t\tmigrationsResolver,\n\t\t\t\t\tschemaVersionBuilder,\n\t\t\t\t\tschemaDiffer,\n\t\t\t\t\tschemaMigrator,\n\t\t\t\t\tschemaStateManager,\n\t\t\t\t\tsnapshotManager,\n\t\t\t\t),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationsStatusFacade',\n\t\t\t({ systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter }) =>\n\t\t\t\tnew MigrationsStatusFacade(systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationExecutionFacade',\n\t\t\t({\n\t\t\t\tsystemClientProvider,\n\t\t\t\ttenantClientProvider,\n\t\t\t\tremoteProjectProvider,\n\t\t\t\tschemaVersionBuilder,\n\t\t\t\tmigrationPrinter,\n\t\t\t\tmigrationsExecutor,\n\t\t\t\tmigrationsStatusFacade,\n\t\t\t\tschemaStateManager,\n\t\t\t\tmigrationSnapshotFacade,\n\t\t\t}) =>\n\t\t\t\tnew MigrationExecutionFacade(\n\t\t\t\t\tsystemClientProvider,\n\t\t\t\t\ttenantClientProvider,\n\t\t\t\t\tremoteProjectProvider,\n\t\t\t\t\tschemaVersionBuilder,\n\t\t\t\t\tmigrationPrinter,\n\t\t\t\t\tmigrationsExecutor,\n\t\t\t\t\tmigrationsStatusFacade,\n\t\t\t\t\tschemaStateManager,\n\t\t\t\t\tmigrationSnapshotFacade,\n\t\t\t\t),\n\t\t)\n\t\t.addService('migrationsValidator', ({ migrationDescriber, schemaMigrator }) => new MigrationsValidator(migrationDescriber, schemaMigrator))\n\t\t.addService(\n\t\t\t'migrationRebaseFacade',\n\t\t\t({ schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager, schemaStateManager }) =>\n\t\t\t\tnew MigrationRebaseFacade(schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager, schemaStateManager),\n\t\t)\n\t\t.addService(\n\t\t\t'schemaLoader',\n\t\t\t({ workspace, jsCodeRunner, runtime }) =>\n\t\t\t\truntime === 'bun' ? new ImportSchemaLoader(workspace) : new TranspilingSchemaLoader(workspace, jsCodeRunner),\n\t\t)\n\t\t.addService('adminDeployer', ({ remoteProjectProvider, adminClient, fs }) => new AdminDeployer(remoteProjectProvider, adminClient, fs))\n\t\t.addService('dataTransferClient', () => new DataTransferClient())\n\t\t.addService(\n\t\t\t'deployCommand',\n\t\t\t({ adminDeployer, migrationExecutionFacade, fs, remoteProjectProvider, remoteProjectResolver, workspace }) =>\n\t\t\t\tnew DeployCommand(adminDeployer, migrationExecutionFacade, fs, remoteProjectProvider, remoteProjectResolver, workspace),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationAmendCommand',\n\t\t\t({\n\t\t\t\tmigrationsResolver,\n\t\t\t\tsystemClientProvider,\n\t\t\t\tmigrationsStatusFacade,\n\t\t\t\tschemaLoader,\n\t\t\t\tschemaVersionBuilder,\n\t\t\t\tmigrationCreator,\n\t\t\t\tmigrationsValidator,\n\t\t\t\tmigrationPrinter,\n\t\t\t\tschemaMigrator,\n\t\t\t\tschemaStateManager,\n\t\t\t}) =>\n\t\t\t\tnew MigrationAmendCommand(\n\t\t\t\t\tmigrationsResolver,\n\t\t\t\t\tsystemClientProvider,\n\t\t\t\t\tmigrationsStatusFacade,\n\t\t\t\t\tschemaLoader,\n\t\t\t\t\tschemaVersionBuilder,\n\t\t\t\t\tmigrationCreator,\n\t\t\t\t\tmigrationsValidator,\n\t\t\t\t\tmigrationPrinter,\n\t\t\t\t\tschemaMigrator,\n\t\t\t\t\tschemaStateManager,\n\t\t\t\t),\n\t\t)\n\t\t.addService('migrationBlankCommand', ({ migrationCreator }) => new MigrationBlankCommand(migrationCreator))\n\t\t.addService(\n\t\t\t'migrationDescribeCommand',\n\t\t\t({ migrationPrinter, schemaVersionBuilder, migrationsResolver }) =>\n\t\t\t\tnew MigrationDescribeCommand(migrationPrinter, schemaVersionBuilder, migrationsResolver),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationDiffCommand',\n\t\t\t({ schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade, schemaStateManager, migrationsResolver }) =>\n\t\t\t\tnew MigrationDiffCommand(\n\t\t\t\t\tschemaLoader,\n\t\t\t\t\tschemaVersionBuilder,\n\t\t\t\t\tmigrationCreator,\n\t\t\t\t\tmigrationPrinter,\n\t\t\t\t\tmigrationExecutionFacade,\n\t\t\t\t\tschemaStateManager,\n\t\t\t\t\tmigrationsResolver,\n\t\t\t\t),\n\t\t)\n\t\t.addService('migrationExecuteCommand', ({ migrationExecutionFacade }) => new MigrationExecuteCommand(migrationExecutionFacade))\n\t\t.addService(\n\t\t\t'migrationInitStateCommand',\n\t\t\t({ schemaLoader, schemaStateManager }) => new MigrationInitStateCommand(schemaLoader, schemaStateManager),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationRebaseCommand',\n\t\t\t({ migrationsResolver, migrationRebaseFacade }) => new MigrationRebaseCommand(migrationsResolver, migrationRebaseFacade),\n\t\t)\n\t\t.addService('migrationSnapshotCommand', ({ migrationSnapshotFacade }) => new MigrationSnapshotCommand(migrationSnapshotFacade))\n\t\t.addService(\n\t\t\t'migrationVerifySnapshotCommand',\n\t\t\t({ migrationSnapshotFacade }) => new MigrationVerifySnapshotCommand(migrationSnapshotFacade),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationStatusCommand',\n\t\t\t({ migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter }) =>\n\t\t\t\tnew MigrationStatusCommand(migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter),\n\t\t)\n\t\t.addService('versionCommand', ({ version }) => new VersionCommand(version))\n\t\t.addService(\n\t\t\t'projectGenerateDocumentationCommand',\n\t\t\t({ schemaLoader, schemaVersionBuilder }) => new ProjectGenerateDocumentationCommand(schemaLoader, schemaVersionBuilder),\n\t\t)\n\t\t.addService(\n\t\t\t'projectPrintSchemaCommand',\n\t\t\t({ schemaLoader, schemaVersionBuilder }) => new ProjectPrintSchemaCommand(schemaLoader, schemaVersionBuilder),\n\t\t)\n\t\t.addService(\n\t\t\t'projectValidateCommand',\n\t\t\t({ schemaLoader, migrationsValidator, migrationsResolver, schemaDiffer, schemaVersionBuilder }) =>\n\t\t\t\tnew ProjectValidateCommand(schemaLoader, migrationsValidator, migrationsResolver, schemaDiffer, schemaVersionBuilder),\n\t\t)\n\t\t.addService('exportCommand', ({ dataTransferClient, remoteProjectResolver }) => new ExportCommand(remoteProjectResolver, dataTransferClient))\n\t\t.addService('importCommand', ({ dataTransferClient, remoteProjectResolver }) => new ImportCommand(remoteProjectResolver, dataTransferClient))\n\t\t.addService('transferCommand', ({ dataTransferClient, remoteProjectResolver }) => new TransferCommand(remoteProjectResolver, dataTransferClient))\n\t\t.addService(\n\t\t\t'workspaceUpdateCommand',\n\t\t\t({ packageWorkspaceResolver, dockerComposeManager }) => new WorkspaceUpdateApiCommand(packageWorkspaceResolver, dockerComposeManager),\n\t\t)\n\t\t.addService('actionsListVariables', ({ remoteProjectResolver }) => new ActionsListVariablesCommand(remoteProjectResolver))\n\t\t.addService('actionsSetVariables', ({ remoteProjectResolver }) => new ActionsSetVariablesCommand(remoteProjectResolver))\n\t\t.addService('actionsListFailedEvents', ({ remoteProjectResolver }) => new ActionsListFailedEventsCommand(remoteProjectResolver))\n\t\t.addService('actionsRetryEvent', ({ remoteProjectResolver }) => new ActionsRetryEventCommand(remoteProjectResolver))\n\t\t.addService('actionsGetEvent', ({ remoteProjectResolver }) => new ActionsGetEventCommand(remoteProjectResolver))\n\t\t.addService('actionsStopEvent', ({ remoteProjectResolver }) => new ActionsStopEventCommand(remoteProjectResolver))\n\t\t.addService(\n\t\t\t'tenantConfigLoader',\n\t\t\t({ jsCodeRunner }) => runtime === 'bun' ? new ImportTenantConfigLoader() : new TranspilingTenantConfigLoader(jsCodeRunner),\n\t\t)\n\t\t.addService('tenantConfigApplier', () => new TenantConfigApplier())\n\t\t.addService(\n\t\t\t'tenantApplyCommand',\n\t\t\t({ remoteProjectResolver, tenantConfigLoader, tenantConfigApplier }) =>\n\t\t\t\tnew TenantApplyCommand(remoteProjectResolver, tenantConfigLoader, tenantConfigApplier),\n\t\t)\n\t\t.addService('commandList', dic => {\n\t\t\tconst commands: CommandFactoryList = {\n\t\t\t\t['deploy']: () => dic.deployCommand,\n\t\t\t\t['version']: () => dic.versionCommand,\n\t\t\t\t['data:export']: () => dic.exportCommand,\n\t\t\t\t['data:import']: () => dic.importCommand,\n\t\t\t\t['data:transfer']: () => dic.transferCommand,\n\t\t\t\t['migrations:diff']: () => dic.migrationDiffCommand,\n\t\t\t\t['migrations:amend']: () => dic.migrationAmendCommand,\n\t\t\t\t['migrations:blank']: () => dic.migrationBlankCommand,\n\t\t\t\t['migrations:init-state']: () => dic.migrationInitStateCommand,\n\t\t\t\t['migrations:describe']: () => dic.migrationDescribeCommand,\n\t\t\t\t['migrations:execute']: () => dic.migrationExecuteCommand,\n\t\t\t\t['migrations:rebase']: () => dic.migrationRebaseCommand,\n\t\t\t\t['migrations:snapshot']: () => dic.migrationSnapshotCommand,\n\t\t\t\t['migrations:verify-snapshot']: () => dic.migrationVerifySnapshotCommand,\n\t\t\t\t['migrations:status']: () => dic.migrationStatusCommand,\n\t\t\t\t['workspace:update:api']: () => dic.workspaceUpdateCommand,\n\t\t\t\t['project:validate']: () => dic.projectValidateCommand,\n\t\t\t\t['project:print-schema']: () => dic.projectPrintSchemaCommand,\n\t\t\t\t['project:generate-doc']: () => dic.projectGenerateDocumentationCommand,\n\t\t\t\t['actions:list-variables']: () => dic.actionsListVariables,\n\t\t\t\t['actions:set-variables']: () => dic.actionsSetVariables,\n\t\t\t\t['actions:failed-events']: () => dic.actionsListFailedEvents,\n\t\t\t\t['actions:retry-event']: () => dic.actionsRetryEvent,\n\t\t\t\t['actions:get-event']: () => dic.actionsGetEvent,\n\t\t\t\t['actions:stop-event']: () => dic.actionsStopEvent,\n\t\t\t\t['tenant:apply']: () => dic.tenantApplyCommand,\n\t\t\t}\n\t\t\treturn commands\n\t\t})\n\t\t.addService('commandManager', ({ commandList }) => new CommandManager(commandList))\n\t\t.addService(\n\t\t\t'versionChecker',\n\t\t\t({ version, workspace, packageWorkspaceResolver, dockerComposeManager }) =>\n\t\t\t\tnew VersionChecker(version, workspace.baseDir, packageWorkspaceResolver, dockerComposeManager),\n\t\t)\n\t\t.addService('application', ({ commandManager, versionChecker }) => {\n\t\t\tconst app = new Application(\n\t\t\t\tcommandManager,\n\t\t\t\t`Contember CLI version ${version}`,\n\t\t\t\t{\n\t\t\t\t\tbeforeRun: async ({ name }) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!process.env.CONTEMBER_SKIP_VERSION_CHECK\n\t\t\t\t\t\t\t&& !['deploy', 'version', 'data:export', 'data:import', 'data:transfer', 'tenant:apply'].includes(name)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tawait versionChecker.checkVersions()\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\t\t\treturn app\n\t\t})\n\t\t.build()\n}\n"],"names":["env","workspace","runtime","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,MAAM,WAA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,IAAI,eAAeE,UAASF,WAAU,SAAS,0BAA0B,oBAAoB;AAAA,EAAA,EAE9F,WAAW,eAAe,CAAC,EAAE,gBAAgB,qBAAqB;AAClE,UAAM,MAAM,IAAI;AAAA,MACf;AAAA,MACA,yBAAyB,OAAO;AAAA,MAChC;AAAA,QACC,WAAW,OAAO,EAAE,WAAW;AAC9B,cACC,CAAC,QAAQ,IAAI,gCACV,CAAC,CAAC,UAAU,WAAW,eAAe,eAAe,iBAAiB,cAAc,EAAE,SAAS,IAAI,GACrG;AACD,kBAAM,eAAe,cAAA;AAAA,UACtB;AAAA,QACD;AAAA,MAAA;AAAA,IACD;AAED,WAAO;AAAA,EACR,CAAC,EACA,MAAA;AACH;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SystemClientProvider.cjs","sources":["../../../../../packages/cli/src/lib/SystemClientProvider.ts"],"sourcesContent":["import { RemoteProjectProvider } from './project/RemoteProjectProvider'\nimport { SystemClient } from '@contember/migrations-client'\n\nexport class SystemClientProvider {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t) {\n\t}\n\n\tpublic get(): SystemClient {\n\t\tconst project = this.remoteProjectProvider.get()\n\t\treturn SystemClient.create(project.endpoint, project.name, project.token)\n\t}\n}\n"],"names":["SystemClient"],"mappings":";;;AAGO,MAAM,qBAAqB;AAAA,EACjC,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAElB;AAAA,EAEO,MAAoB;AAC1B,UAAM,UAAU,KAAK,sBAAsB,IAAA;AAC3C,WAAOA,iBAAAA,aAAa,OAAO,QAAQ,UAAU,QAAQ,MAAM,QAAQ,KAAK;AAAA,EACzE;AACD;;"}
1
+ {"version":3,"file":"SystemClientProvider.cjs","sources":["../../../../../packages/cli/src/lib/SystemClientProvider.ts"],"sourcesContent":["import { RemoteProjectProvider } from './project/RemoteProjectProvider.js'\nimport { SystemClient } from '@contember/migrations-client'\n\nexport class SystemClientProvider {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t) {\n\t}\n\n\tpublic get(): SystemClient {\n\t\tconst project = this.remoteProjectProvider.get()\n\t\treturn SystemClient.create(project.endpoint, project.name, project.token)\n\t}\n}\n"],"names":["SystemClient"],"mappings":";;;AAGO,MAAM,qBAAqB;AAAA,EACjC,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAElB;AAAA,EAEO,MAAoB;AAC1B,UAAM,UAAU,KAAK,sBAAsB,IAAA;AAC3C,WAAOA,iBAAAA,aAAa,OAAO,QAAQ,UAAU,QAAQ,MAAM,QAAQ,KAAK;AAAA,EACzE;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SystemClientProvider.js","sources":["../../../../../packages/cli/src/lib/SystemClientProvider.ts"],"sourcesContent":["import { RemoteProjectProvider } from './project/RemoteProjectProvider'\nimport { SystemClient } from '@contember/migrations-client'\n\nexport class SystemClientProvider {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t) {\n\t}\n\n\tpublic get(): SystemClient {\n\t\tconst project = this.remoteProjectProvider.get()\n\t\treturn SystemClient.create(project.endpoint, project.name, project.token)\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,qBAAqB;AAAA,EACjC,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAElB;AAAA,EAEO,MAAoB;AAC1B,UAAM,UAAU,KAAK,sBAAsB,IAAA;AAC3C,WAAO,aAAa,OAAO,QAAQ,UAAU,QAAQ,MAAM,QAAQ,KAAK;AAAA,EACzE;AACD;"}
1
+ {"version":3,"file":"SystemClientProvider.js","sources":["../../../../../packages/cli/src/lib/SystemClientProvider.ts"],"sourcesContent":["import { RemoteProjectProvider } from './project/RemoteProjectProvider.js'\nimport { SystemClient } from '@contember/migrations-client'\n\nexport class SystemClientProvider {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t) {\n\t}\n\n\tpublic get(): SystemClient {\n\t\tconst project = this.remoteProjectProvider.get()\n\t\treturn SystemClient.create(project.endpoint, project.name, project.token)\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,qBAAqB;AAAA,EACjC,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAElB;AAAA,EAEO,MAAoB;AAC1B,UAAM,UAAU,KAAK,sBAAsB,IAAA;AAC3C,WAAO,aAAa,OAAO,QAAQ,UAAU,QAAQ,MAAM,QAAQ,KAAK;AAAA,EACzE;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TenantClientProvider.cjs","sources":["../../../../../packages/cli/src/lib/TenantClientProvider.ts"],"sourcesContent":["import { TenantClient } from './tenant/TenantClient'\nimport { RemoteProjectProvider } from './project/RemoteProjectProvider'\n\nexport class TenantClientProvider {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t) {\n\t}\n\n\tpublic get(): TenantClient {\n\t\tconst project = this.remoteProjectProvider.get()\n\t\treturn TenantClient.create(project.endpoint, project.token)\n\t}\n}\n"],"names":["TenantClient"],"mappings":";;;AAGO,MAAM,qBAAqB;AAAA,EACjC,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAElB;AAAA,EAEO,MAAoB;AAC1B,UAAM,UAAU,KAAK,sBAAsB,IAAA;AAC3C,WAAOA,aAAAA,aAAa,OAAO,QAAQ,UAAU,QAAQ,KAAK;AAAA,EAC3D;AACD;;"}
1
+ {"version":3,"file":"TenantClientProvider.cjs","sources":["../../../../../packages/cli/src/lib/TenantClientProvider.ts"],"sourcesContent":["import { TenantClient } from './tenant/TenantClient.js'\nimport { RemoteProjectProvider } from './project/RemoteProjectProvider.js'\n\nexport class TenantClientProvider {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t) {\n\t}\n\n\tpublic get(): TenantClient {\n\t\tconst project = this.remoteProjectProvider.get()\n\t\treturn TenantClient.create(project.endpoint, project.token)\n\t}\n}\n"],"names":["TenantClient"],"mappings":";;;AAGO,MAAM,qBAAqB;AAAA,EACjC,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAElB;AAAA,EAEO,MAAoB;AAC1B,UAAM,UAAU,KAAK,sBAAsB,IAAA;AAC3C,WAAOA,aAAAA,aAAa,OAAO,QAAQ,UAAU,QAAQ,KAAK;AAAA,EAC3D;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TenantClientProvider.js","sources":["../../../../../packages/cli/src/lib/TenantClientProvider.ts"],"sourcesContent":["import { TenantClient } from './tenant/TenantClient'\nimport { RemoteProjectProvider } from './project/RemoteProjectProvider'\n\nexport class TenantClientProvider {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t) {\n\t}\n\n\tpublic get(): TenantClient {\n\t\tconst project = this.remoteProjectProvider.get()\n\t\treturn TenantClient.create(project.endpoint, project.token)\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,qBAAqB;AAAA,EACjC,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAElB;AAAA,EAEO,MAAoB;AAC1B,UAAM,UAAU,KAAK,sBAAsB,IAAA;AAC3C,WAAO,aAAa,OAAO,QAAQ,UAAU,QAAQ,KAAK;AAAA,EAC3D;AACD;"}
1
+ {"version":3,"file":"TenantClientProvider.js","sources":["../../../../../packages/cli/src/lib/TenantClientProvider.ts"],"sourcesContent":["import { TenantClient } from './tenant/TenantClient.js'\nimport { RemoteProjectProvider } from './project/RemoteProjectProvider.js'\n\nexport class TenantClientProvider {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t) {\n\t}\n\n\tpublic get(): TenantClient {\n\t\tconst project = this.remoteProjectProvider.get()\n\t\treturn TenantClient.create(project.endpoint, project.token)\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,qBAAqB;AAAA,EACjC,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAElB;AAAA,EAEO,MAAoB;AAC1B,UAAM,UAAU,KAAK,sBAAsB,IAAA;AAC3C,WAAO,aAAa,OAAO,QAAQ,UAAU,QAAQ,KAAK;AAAA,EAC3D;AACD;"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const node_path = require("node:path");
3
+ const path = require("node:path");
4
4
  const semver = require("semver");
5
5
  const consts = require("../consts.cjs");
6
6
  function _interopNamespaceDefault(e) {
@@ -36,7 +36,7 @@ class VersionChecker {
36
36
  for (const packageName of ["@contember/schema", "@contember/schema-definition"]) {
37
37
  const installedPackages = await packageWorkspace.findInstalledDependencies(packageName);
38
38
  for (const pckg of installedPackages) {
39
- const jsonPath = node_path.relative(this.dir, node_path.join(pckg.defined.pckg.dir, "package.json"));
39
+ const jsonPath = path.relative(this.dir, path.join(pckg.defined.pckg.dir, "package.json"));
40
40
  if (!pckg.installed) {
41
41
  errors.push(`Package ${packageName} defined in ${jsonPath} is not installed.`);
42
42
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"VersionChecker.cjs","sources":["../../../../../packages/cli/src/lib/VersionChecker.ts"],"sourcesContent":["import { join, relative } from 'node:path'\nimport * as semver from 'semver'\nimport { PackageWorkspaceResolver } from '@contember/cli-common'\nimport { DockerComposeManager } from './fs/DockerComposeManager'\nimport { contemberDockerImages } from '../consts'\n\nexport class VersionChecker {\n\tconstructor(\n\t\tprivate readonly version: string,\n\t\tprivate readonly dir: string,\n\t\tprivate readonly packageWorkspaceResolver: PackageWorkspaceResolver,\n\t\tprivate readonly dockerComposeManager: DockerComposeManager,\n\t) {\n\t}\n\n\tcheckVersions = async () => {\n\t\tconst cliVersion = this.version\n\t\tconst packageWorkspace = await this.packageWorkspaceResolver.resolve()\n\n\t\tconst errors: string[] = []\n\n\t\tfor (const packageName of ['@contember/schema', '@contember/schema-definition']) {\n\t\t\tconst installedPackages = await packageWorkspace.findInstalledDependencies(packageName)\n\t\t\tfor (const pckg of installedPackages) {\n\t\t\t\tconst jsonPath = relative(this.dir, join(pckg.defined.pckg.dir, 'package.json'))\n\n\t\t\t\tif (!pckg.installed) {\n\t\t\t\t\terrors.push(`Package ${packageName} defined in ${jsonPath} is not installed.`)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (pckg.defined.version !== 'workspace:*' && !semver.satisfies(pckg.installed.version, pckg.defined.version)) {\n\t\t\t\t\terrors.push(`Package ${packageName}@${pckg.installed.version} does not match constraint ${pckg.defined.version} defined in ${jsonPath}.`)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (cliVersion !== pckg.installed.version) {\n\t\t\t\t\terrors.push(`Package ${packageName}@${pckg.installed.version} does not match version of CLI ${cliVersion}.`)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst dockerCompose = await this.dockerComposeManager.tryReadMainDockerComposeConfig()\n\n\t\tif (!dockerCompose) {\n\t\t\terrors.push('docker-compose.yaml not found.')\n\t\t} else {\n\t\t\tfor (const [name, def] of Object.entries(dockerCompose.services ?? {})) {\n\t\t\t\tif (!def.image) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst [image, tag] = def.image.split(':')\n\t\t\t\tif (!tag || !contemberDockerImages.includes(image)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif (extractVersion(tag) !== cliVersion) {\n\t\t\t\t\terrors.push(`Docker service ${name} with image ${image}:${tag} does not match version of CLI ${cliVersion}.`)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length) {\n\t\t\tthrow `${errors.map(it => `${it}`).join('\\n')}\n\nPlease make sure all dependencies are up to date.\\nIf you are really certain about the compatibility, you can disable this version check by running the CLI with the CONTEMBER_SKIP_VERSION_CHECK=1 environment variable`\n\t\t}\n\t}\n}\n\nconst extractVersion = (tag: string) => {\n\t// e.g.\n\t// 2.1.0-alpha.15-foo-bar => 2.1.0-alpha.15\n\t// 2.1.0-debian => 2.1.0\n\treturn tag.match(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AAG,KAAK,OAAO,QAAQ,cAAc,YAAY,CAAA,CAAE,GAAG;AACvE,cAAI,CAAC,IAAI,OAAO;AACf;AAAA,UACD;AACA,gBAAM,CAAC,OAAO,GAAG,IAAI,IAAI,MAAM,MAAM,GAAG;AACxC,cAAI,CAAC,OAAO,CAACC,OAAAA,sBAAsB,SAAS,KAAK,GAAG;AACnD;AAAA,UACD;AAEA,cAAI,eAAe,GAAG,MAAM,YAAY;AACvC,mBAAO,KAAK,kBAAkB,IAAI,eAAe,KAAK,IAAI,GAAG,kCAAkC,UAAU,GAAG;AAAA,UAC7G;AAAA,QACD;AAAA,MACD;AAEA,UAAI,OAAO,QAAQ;AAClB,cAAM,GAAG,OAAO,IAAI,CAAA,OAAM,GAAG,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,MAG9C;AAAA,IACD,CAAA;AAAA,EAnDA;AAoDD;AAEA,MAAM,iBAAiB,CAAC,QAAgB;AAIvC,SAAO,IAAI,MAAM,4BAA4B,IAAI,CAAC,KAAK;AACxD;;"}
1
+ {"version":3,"file":"VersionChecker.cjs","sources":["../../../../../packages/cli/src/lib/VersionChecker.ts"],"sourcesContent":["import { join, relative } from 'node:path'\nimport * as semver from 'semver'\nimport { PackageWorkspaceResolver } from '@contember/cli-common'\nimport { DockerComposeManager } from './fs/DockerComposeManager.js'\nimport { contemberDockerImages } from '../consts.js'\n\nexport class VersionChecker {\n\tconstructor(\n\t\tprivate readonly version: string,\n\t\tprivate readonly dir: string,\n\t\tprivate readonly packageWorkspaceResolver: PackageWorkspaceResolver,\n\t\tprivate readonly dockerComposeManager: DockerComposeManager,\n\t) {\n\t}\n\n\tcheckVersions = async () => {\n\t\tconst cliVersion = this.version\n\t\tconst packageWorkspace = await this.packageWorkspaceResolver.resolve()\n\n\t\tconst errors: string[] = []\n\n\t\tfor (const packageName of ['@contember/schema', '@contember/schema-definition']) {\n\t\t\tconst installedPackages = await packageWorkspace.findInstalledDependencies(packageName)\n\t\t\tfor (const pckg of installedPackages) {\n\t\t\t\tconst jsonPath = relative(this.dir, join(pckg.defined.pckg.dir, 'package.json'))\n\n\t\t\t\tif (!pckg.installed) {\n\t\t\t\t\terrors.push(`Package ${packageName} defined in ${jsonPath} is not installed.`)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (pckg.defined.version !== 'workspace:*' && !semver.satisfies(pckg.installed.version, pckg.defined.version)) {\n\t\t\t\t\terrors.push(`Package ${packageName}@${pckg.installed.version} does not match constraint ${pckg.defined.version} defined in ${jsonPath}.`)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (cliVersion !== pckg.installed.version) {\n\t\t\t\t\terrors.push(`Package ${packageName}@${pckg.installed.version} does not match version of CLI ${cliVersion}.`)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst dockerCompose = await this.dockerComposeManager.tryReadMainDockerComposeConfig()\n\n\t\tif (!dockerCompose) {\n\t\t\terrors.push('docker-compose.yaml not found.')\n\t\t} else {\n\t\t\tfor (const [name, def] of Object.entries(dockerCompose.services ?? {})) {\n\t\t\t\tif (!def.image) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst [image, tag] = def.image.split(':')\n\t\t\t\tif (!tag || !contemberDockerImages.includes(image)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif (extractVersion(tag) !== cliVersion) {\n\t\t\t\t\terrors.push(`Docker service ${name} with image ${image}:${tag} does not match version of CLI ${cliVersion}.`)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length) {\n\t\t\tthrow `${errors.map(it => `${it}`).join('\\n')}\n\nPlease make sure all dependencies are up to date.\\nIf you are really certain about the compatibility, you can disable this version check by running the CLI with the CONTEMBER_SKIP_VERSION_CHECK=1 environment variable`\n\t\t}\n\t}\n}\n\nconst extractVersion = (tag: string) => {\n\t// e.g.\n\t// 2.1.0-alpha.15-foo-bar => 2.1.0-alp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AA,MAC7C,OAAO;AACN,mBAAW,CAAC,MAAM,GAAG,KAAK,OAAO,QAAQ,cAAc,YAAY,CAAA,CAAE,GAAG;AACvE,cAAI,CAAC,IAAI,OAAO;AACf;AAAA,UACD;AACA,gBAAM,CAAC,OAAO,GAAG,IAAI,IAAI,MAAM,MAAM,GAAG;AACxC,cAAI,CAAC,OAAO,CAACC,OAAAA,sBAAsB,SAAS,KAAK,GAAG;AACnD;AAAA,UACD;AAEA,cAAI,eAAe,GAAG,MAAM,YAAY;AACvC,mBAAO,KAAK,kBAAkB,IAAI,eAAe,KAAK,IAAI,GAAG,kCAAkC,UAAU,GAAG;AAAA,UAC7G;AAAA,QACD;AAAA,MACD;AAEA,UAAI,OAAO,QAAQ;AAClB,cAAM,GAAG,OAAO,IAAI,CAAA,OAAM,GAAG,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,MAG9C;AAAA,IACD,CAAA;AAAA,EAnDA;AAoDD;AAEA,MAAM,iBAAiB,CAAC,QAAgB;AAIvC,SAAO,IAAI,MAAM,4BAA4B,IAAI,CAAC,KAAK;AACxD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"VersionChecker.js","sources":["../../../../../packages/cli/src/lib/VersionChecker.ts"],"sourcesContent":["import { join, relative } from 'node:path'\nimport * as semver from 'semver'\nimport { PackageWorkspaceResolver } from '@contember/cli-common'\nimport { DockerComposeManager } from './fs/DockerComposeManager'\nimport { contemberDockerImages } from '../consts'\n\nexport class VersionChecker {\n\tconstructor(\n\t\tprivate readonly version: string,\n\t\tprivate readonly dir: string,\n\t\tprivate readonly packageWorkspaceResolver: PackageWorkspaceResolver,\n\t\tprivate readonly dockerComposeManager: DockerComposeManager,\n\t) {\n\t}\n\n\tcheckVersions = async () => {\n\t\tconst cliVersion = this.version\n\t\tconst packageWorkspace = await this.packageWorkspaceResolver.resolve()\n\n\t\tconst errors: string[] = []\n\n\t\tfor (const packageName of ['@contember/schema', '@contember/schema-definition']) {\n\t\t\tconst installedPackages = await packageWorkspace.findInstalledDependencies(packageName)\n\t\t\tfor (const pckg of installedPackages) {\n\t\t\t\tconst jsonPath = relative(this.dir, join(pckg.defined.pckg.dir, 'package.json'))\n\n\t\t\t\tif (!pckg.installed) {\n\t\t\t\t\terrors.push(`Package ${packageName} defined in ${jsonPath} is not installed.`)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (pckg.defined.version !== 'workspace:*' && !semver.satisfies(pckg.installed.version, pckg.defined.version)) {\n\t\t\t\t\terrors.push(`Package ${packageName}@${pckg.installed.version} does not match constraint ${pckg.defined.version} defined in ${jsonPath}.`)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (cliVersion !== pckg.installed.version) {\n\t\t\t\t\terrors.push(`Package ${packageName}@${pckg.installed.version} does not match version of CLI ${cliVersion}.`)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst dockerCompose = await this.dockerComposeManager.tryReadMainDockerComposeConfig()\n\n\t\tif (!dockerCompose) {\n\t\t\terrors.push('docker-compose.yaml not found.')\n\t\t} else {\n\t\t\tfor (const [name, def] of Object.entries(dockerCompose.services ?? {})) {\n\t\t\t\tif (!def.image) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst [image, tag] = def.image.split(':')\n\t\t\t\tif (!tag || !contemberDockerImages.includes(image)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif (extractVersion(tag) !== cliVersion) {\n\t\t\t\t\terrors.push(`Docker service ${name} with image ${image}:${tag} does not match version of CLI ${cliVersion}.`)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length) {\n\t\t\tthrow `${errors.map(it => `${it}`).join('\\n')}\n\nPlease make sure all dependencies are up to date.\\nIf you are really certain about the compatibility, you can disable this version check by running the CLI with the CONTEMBER_SKIP_VERSION_CHECK=1 environment variable`\n\t\t}\n\t}\n}\n\nconst extractVersion = (tag: string) => {\n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AO;AACN,mBAAW,CAAC,MAAM,GAAG,KAAK,OAAO,QAAQ,cAAc,YAAY,CAAA,CAAE,GAAG;AACvE,cAAI,CAAC,IAAI,OAAO;AACf;AAAA,UACD;AACA,gBAAM,CAAC,OAAO,GAAG,IAAI,IAAI,MAAM,MAAM,GAAG;AACxC,cAAI,CAAC,OAAO,CAAC,sBAAsB,SAAS,KAAK,GAAG;AACnD;AAAA,UACD;AAEA,cAAI,eAAe,GAAG,MAAM,YAAY;AACvC,mBAAO,KAAK,kBAAkB,IAAI,eAAe,KAAK,IAAI,GAAG,kCAAkC,UAAU,GAAG;AAAA,UAC7G;AAAA,QACD;AAAA,MACD;AAEA,UAAI,OAAO,QAAQ;AAClB,cAAM,GAAG,OAAO,IAAI,CAAA,OAAM,GAAG,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,MAG9C;AAAA,IACD,CAAA;AAAA,EAnDA;AAoDD;AAEA,MAAM,iBAAiB,CAAC,QAAgB;AAIvC,SAAO,IAAI,MAAM,4BAA4B,IAAI,CAAC,KAAK;AACxD;"}
1
+ {"version":3,"file":"VersionChecker.js","sources":["../../../../../packages/cli/src/lib/VersionChecker.ts"],"sourcesContent":["import { join, relative } from 'node:path'\nimport * as semver from 'semver'\nimport { PackageWorkspaceResolver } from '@contember/cli-common'\nimport { DockerComposeManager } from './fs/DockerComposeManager.js'\nimport { contemberDockerImages } from '../consts.js'\n\nexport class VersionChecker {\n\tconstructor(\n\t\tprivate readonly version: string,\n\t\tprivate readonly dir: string,\n\t\tprivate readonly packageWorkspaceResolver: PackageWorkspaceResolver,\n\t\tprivate readonly dockerComposeManager: DockerComposeManager,\n\t) {\n\t}\n\n\tcheckVersions = async () => {\n\t\tconst cliVersion = this.version\n\t\tconst packageWorkspace = await this.packageWorkspaceResolver.resolve()\n\n\t\tconst errors: string[] = []\n\n\t\tfor (const packageName of ['@contember/schema', '@contember/schema-definition']) {\n\t\t\tconst installedPackages = await packageWorkspace.findInstalledDependencies(packageName)\n\t\t\tfor (const pckg of installedPackages) {\n\t\t\t\tconst jsonPath = relative(this.dir, join(pckg.defined.pckg.dir, 'package.json'))\n\n\t\t\t\tif (!pckg.installed) {\n\t\t\t\t\terrors.push(`Package ${packageName} defined in ${jsonPath} is not installed.`)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (pckg.defined.version !== 'workspace:*' && !semver.satisfies(pckg.installed.version, pckg.defined.version)) {\n\t\t\t\t\terrors.push(`Package ${packageName}@${pckg.installed.version} does not match constraint ${pckg.defined.version} defined in ${jsonPath}.`)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (cliVersion !== pckg.installed.version) {\n\t\t\t\t\terrors.push(`Package ${packageName}@${pckg.installed.version} does not match version of CLI ${cliVersion}.`)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst dockerCompose = await this.dockerComposeManager.tryReadMainDockerComposeConfig()\n\n\t\tif (!dockerCompose) {\n\t\t\terrors.push('docker-compose.yaml not found.')\n\t\t} else {\n\t\t\tfor (const [name, def] of Object.entries(dockerCompose.services ?? {})) {\n\t\t\t\tif (!def.image) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst [image, tag] = def.image.split(':')\n\t\t\t\tif (!tag || !contemberDockerImages.includes(image)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif (extractVersion(tag) !== cliVersion) {\n\t\t\t\t\terrors.push(`Docker service ${name} with image ${image}:${tag} does not match version of CLI ${cliVersion}.`)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length) {\n\t\t\tthrow `${errors.map(it => `${it}`).join('\\n')}\n\nPlease make sure all dependencies are up to date.\\nIf you are really certain about the compatibility, you can disable this version check by running the CLI with the CONTEMBER_SKIP_VERSION_CHECK=1 environment variable`\n\t\t}\n\t}\n}\n\nconst extractVersion = (tag: string) => {\n\t// e.g.\n\t// 2.1.0-alpha.15-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AG,KAAK,OAAO,QAAQ,cAAc,YAAY,CAAA,CAAE,GAAG;AACvE,cAAI,CAAC,IAAI,OAAO;AACf;AAAA,UACD;AACA,gBAAM,CAAC,OAAO,GAAG,IAAI,IAAI,MAAM,MAAM,GAAG;AACxC,cAAI,CAAC,OAAO,CAAC,sBAAsB,SAAS,KAAK,GAAG;AACnD;AAAA,UACD;AAEA,cAAI,eAAe,GAAG,MAAM,YAAY;AACvC,mBAAO,KAAK,kBAAkB,IAAI,eAAe,KAAK,IAAI,GAAG,kCAAkC,UAAU,GAAG;AAAA,UAC7G;AAAA,QACD;AAAA,MACD;AAEA,UAAI,OAAO,QAAQ;AAClB,cAAM,GAAG,OAAO,IAAI,CAAA,OAAM,GAAG,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,MAG9C;AAAA,IACD,CAAA;AAAA,EAnDA;AAoDD;AAEA,MAAM,iBAAiB,CAAC,QAAgB;AAIvC,SAAO,IAAI,MAAM,4BAA4B,IAAI,CAAC,KAAK;AACxD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AdminClient.cjs","sources":["../../../../../../packages/cli/src/lib/admin/AdminClient.ts"],"sourcesContent":["import { maskToken } from '../maskToken'\nimport { RemoteProjectProvider } from '../project/RemoteProjectProvider'\n\nexport type AdminFiles = Array<{ path: string; data: string }>\nexport class AdminClient {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t) {\n\t}\n\n\tpublic async deploy(project: string | null, files: AdminFiles): Promise<void> {\n\t\tconst response = await this.execute('_deploy', 'POST', { project, files })\n\n\t\tif (!response.ok) {\n\t\t\tconst project = this.remoteProjectProvider.get()\n\t\t\tconst maskedToken = maskToken(project.token)\n\t\t\tthrow `Failed to deploy admin, POST request to ${project.adminEndpoint}/_deploy with token ${maskedToken} returned status ${response.status} ${response.statusText}\\n${await response\n\t\t\t\t.text()}`\n\t\t}\n\t}\n\n\tprivate async execute(path: string, method: string, body: any): Promise<Response> {\n\t\tconst project = this.remoteProjectProvider.get()\n\t\tif (!project.adminEndpoint) {\n\t\t\tthrow new Error('Admin endpoint not set')\n\t\t}\n\t\treturn await fetch(`${project.adminEndpoint}/${path}`, {\n\t\t\tmethod: method,\n\t\t\theaders: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${project.token}` },\n\t\t\tbody: JSON.stringify(body),\n\t\t})\n\t}\n}\n"],"names":["project","maskToken"],"mappings":";;;AAIO,MAAM,YAAY;AAAA,EACxB,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAElB;AAAA,EAEA,MAAa,OAAO,SAAwB,OAAkC;AAC7E,UAAM,WAAW,MAAM,KAAK,QAAQ,WAAW,QAAQ,EAAE,SAAS,OAAO;AAEzE,QAAI,CAAC,SAAS,IAAI;AACjB,YAAMA,WAAU,KAAK,sBAAsB,IAAA;AAC3C,YAAM,cAAcC,UAAAA,UAAUD,SAAQ,KAAK;AAC3C,YAAM,2CAA2CA,SAAQ,aAAa,uBAAuB,WAAW,oBAAoB,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,EAAK,MAAM,SAC3K,KAAA,CAAM;AAAA,IACT;AAAA,EACD;AAAA,EAEA,MAAc,QAAQ,MAAc,QAAgB,MAA8B;AACjF,UAAM,UAAU,KAAK,sBAAsB,IAAA;AAC3C,QAAI,CAAC,QAAQ,eAAe;AAC3B,YAAM,IAAI,MAAM,wBAAwB;AAAA,IACzC;AACA,WAAO,MAAM,MAAM,GAAG,QAAQ,aAAa,IAAI,IAAI,IAAI;AAAA,MACtD;AAAA,MACA,SAAS,EAAE,gBAAgB,oBAAoB,iBAAiB,UAAU,QAAQ,KAAK,GAAA;AAAA,MACvF,MAAM,KAAK,UAAU,IAAI;AAAA,IAAA,CACzB;AAAA,EACF;AACD;;"}
1
+ {"version":3,"file":"AdminClient.cjs","sources":["../../../../../../packages/cli/src/lib/admin/AdminClient.ts"],"sourcesContent":["import { maskToken } from '../maskToken.js'\nimport { RemoteProjectProvider } from '../project/RemoteProjectProvider.js'\n\nexport type AdminFiles = Array<{ path: string; data: string }>\nexport class AdminClient {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t) {\n\t}\n\n\tpublic async deploy(project: string | null, files: AdminFiles): Promise<void> {\n\t\tconst response = await this.execute('_deploy', 'POST', { project, files })\n\n\t\tif (!response.ok) {\n\t\t\tconst project = this.remoteProjectProvider.get()\n\t\t\tconst maskedToken = maskToken(project.token)\n\t\t\tthrow `Failed to deploy admin, POST request to ${project.adminEndpoint}/_deploy with token ${maskedToken} returned status ${response.status} ${response.statusText}\\n${await response\n\t\t\t\t.text()}`\n\t\t}\n\t}\n\n\tprivate async execute(path: string, method: string, body: any): Promise<Response> {\n\t\tconst project = this.remoteProjectProvider.get()\n\t\tif (!project.adminEndpoint) {\n\t\t\tthrow new Error('Admin endpoint not set')\n\t\t}\n\t\treturn await fetch(`${project.adminEndpoint}/${path}`, {\n\t\t\tmethod: method,\n\t\t\theaders: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${project.token}` },\n\t\t\tbody: JSON.stringify(body),\n\t\t})\n\t}\n}\n"],"names":["project","maskToken"],"mappings":";;;AAIO,MAAM,YAAY;AAAA,EACxB,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAElB;AAAA,EAEA,MAAa,OAAO,SAAwB,OAAkC;AAC7E,UAAM,WAAW,MAAM,KAAK,QAAQ,WAAW,QAAQ,EAAE,SAAS,OAAO;AAEzE,QAAI,CAAC,SAAS,IAAI;AACjB,YAAMA,WAAU,KAAK,sBAAsB,IAAA;AAC3C,YAAM,cAAcC,UAAAA,UAAUD,SAAQ,KAAK;AAC3C,YAAM,2CAA2CA,SAAQ,aAAa,uBAAuB,WAAW,oBAAoB,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,EAAK,MAAM,SAC3K,KAAA,CAAM;AAAA,IACT;AAAA,EACD;AAAA,EAEA,MAAc,QAAQ,MAAc,QAAgB,MAA8B;AACjF,UAAM,UAAU,KAAK,sBAAsB,IAAA;AAC3C,QAAI,CAAC,QAAQ,eAAe;AAC3B,YAAM,IAAI,MAAM,wBAAwB;AAAA,IACzC;AACA,WAAO,MAAM,MAAM,GAAG,QAAQ,aAAa,IAAI,IAAI,IAAI;AAAA,MACtD;AAAA,MACA,SAAS,EAAE,gBAAgB,oBAAoB,iBAAiB,UAAU,QAAQ,KAAK,GAAA;AAAA,MACvF,MAAM,KAAK,UAAU,IAAI;AAAA,IAAA,CACzB;AAAA,EACF;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AdminClient.js","sources":["../../../../../../packages/cli/src/lib/admin/AdminClient.ts"],"sourcesContent":["import { maskToken } from '../maskToken'\nimport { RemoteProjectProvider } from '../project/RemoteProjectProvider'\n\nexport type AdminFiles = Array<{ path: string; data: string }>\nexport class AdminClient {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t) {\n\t}\n\n\tpublic async deploy(project: string | null, files: AdminFiles): Promise<void> {\n\t\tconst response = await this.execute('_deploy', 'POST', { project, files })\n\n\t\tif (!response.ok) {\n\t\t\tconst project = this.remoteProjectProvider.get()\n\t\t\tconst maskedToken = maskToken(project.token)\n\t\t\tthrow `Failed to deploy admin, POST request to ${project.adminEndpoint}/_deploy with token ${maskedToken} returned status ${response.status} ${response.statusText}\\n${await response\n\t\t\t\t.text()}`\n\t\t}\n\t}\n\n\tprivate async execute(path: string, method: string, body: any): Promise<Response> {\n\t\tconst project = this.remoteProjectProvider.get()\n\t\tif (!project.adminEndpoint) {\n\t\t\tthrow new Error('Admin endpoint not set')\n\t\t}\n\t\treturn await fetch(`${project.adminEndpoint}/${path}`, {\n\t\t\tmethod: method,\n\t\t\theaders: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${project.token}` },\n\t\t\tbody: JSON.stringify(body),\n\t\t})\n\t}\n}\n"],"names":["project"],"mappings":";AAIO,MAAM,YAAY;AAAA,EACxB,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAElB;AAAA,EAEA,MAAa,OAAO,SAAwB,OAAkC;AAC7E,UAAM,WAAW,MAAM,KAAK,QAAQ,WAAW,QAAQ,EAAE,SAAS,OAAO;AAEzE,QAAI,CAAC,SAAS,IAAI;AACjB,YAAMA,WAAU,KAAK,sBAAsB,IAAA;AAC3C,YAAM,cAAc,UAAUA,SAAQ,KAAK;AAC3C,YAAM,2CAA2CA,SAAQ,aAAa,uBAAuB,WAAW,oBAAoB,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,EAAK,MAAM,SAC3K,KAAA,CAAM;AAAA,IACT;AAAA,EACD;AAAA,EAEA,MAAc,QAAQ,MAAc,QAAgB,MAA8B;AACjF,UAAM,UAAU,KAAK,sBAAsB,IAAA;AAC3C,QAAI,CAAC,QAAQ,eAAe;AAC3B,YAAM,IAAI,MAAM,wBAAwB;AAAA,IACzC;AACA,WAAO,MAAM,MAAM,GAAG,QAAQ,aAAa,IAAI,IAAI,IAAI;AAAA,MACtD;AAAA,MACA,SAAS,EAAE,gBAAgB,oBAAoB,iBAAiB,UAAU,QAAQ,KAAK,GAAA;AAAA,MACvF,MAAM,KAAK,UAAU,IAAI;AAAA,IAAA,CACzB;AAAA,EACF;AACD;"}
1
+ {"version":3,"file":"AdminClient.js","sources":["../../../../../../packages/cli/src/lib/admin/AdminClient.ts"],"sourcesContent":["import { maskToken } from '../maskToken.js'\nimport { RemoteProjectProvider } from '../project/RemoteProjectProvider.js'\n\nexport type AdminFiles = Array<{ path: string; data: string }>\nexport class AdminClient {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t) {\n\t}\n\n\tpublic async deploy(project: string | null, files: AdminFiles): Promise<void> {\n\t\tconst response = await this.execute('_deploy', 'POST', { project, files })\n\n\t\tif (!response.ok) {\n\t\t\tconst project = this.remoteProjectProvider.get()\n\t\t\tconst maskedToken = maskToken(project.token)\n\t\t\tthrow `Failed to deploy admin, POST request to ${project.adminEndpoint}/_deploy with token ${maskedToken} returned status ${response.status} ${response.statusText}\\n${await response\n\t\t\t\t.text()}`\n\t\t}\n\t}\n\n\tprivate async execute(path: string, method: string, body: any): Promise<Response> {\n\t\tconst project = this.remoteProjectProvider.get()\n\t\tif (!project.adminEndpoint) {\n\t\t\tthrow new Error('Admin endpoint not set')\n\t\t}\n\t\treturn await fetch(`${project.adminEndpoint}/${path}`, {\n\t\t\tmethod: method,\n\t\t\theaders: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${project.token}` },\n\t\t\tbody: JSON.stringify(body),\n\t\t})\n\t}\n}\n"],"names":["project"],"mappings":";AAIO,MAAM,YAAY;AAAA,EACxB,YACkB,uBAChB;AADgB,SAAA,wBAAA;AAAA,EAElB;AAAA,EAEA,MAAa,OAAO,SAAwB,OAAkC;AAC7E,UAAM,WAAW,MAAM,KAAK,QAAQ,WAAW,QAAQ,EAAE,SAAS,OAAO;AAEzE,QAAI,CAAC,SAAS,IAAI;AACjB,YAAMA,WAAU,KAAK,sBAAsB,IAAA;AAC3C,YAAM,cAAc,UAAUA,SAAQ,KAAK;AAC3C,YAAM,2CAA2CA,SAAQ,aAAa,uBAAuB,WAAW,oBAAoB,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,EAAK,MAAM,SAC3K,KAAA,CAAM;AAAA,IACT;AAAA,EACD;AAAA,EAEA,MAAc,QAAQ,MAAc,QAAgB,MAA8B;AACjF,UAAM,UAAU,KAAK,sBAAsB,IAAA;AAC3C,QAAI,CAAC,QAAQ,eAAe;AAC3B,YAAM,IAAI,MAAM,wBAAwB;AAAA,IACzC;AACA,WAAO,MAAM,MAAM,GAAG,QAAQ,aAAa,IAAI,IAAI,IAAI;AAAA,MACtD;AAAA,MACA,SAAS,EAAE,gBAAgB,oBAAoB,iBAAiB,UAAU,QAAQ,KAAK,GAAA;AAAA,MACvF,MAAM,KAAK,UAAU,IAAI;AAAA,IAAA,CACzB;AAAA,EACF;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AdminDeployer.cjs","sources":["../../../../../../packages/cli/src/lib/admin/AdminDeployer.ts"],"sourcesContent":["import { AdminClient, AdminFiles } from './AdminClient'\nimport { FileSystem } from '../fs/FileSystem'\nimport { RemoteProjectProvider } from '../project/RemoteProjectProvider'\n\nexport class AdminDeployer {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t\tprivate readonly adminClient: AdminClient,\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\tpublic deploy = async ({ dir, root }: {\n\t\tdir: string\n\t\troot: boolean\n\t}) => {\n\t\tconsole.log('Deploying admin...')\n\t\tconst files = await this.readAdminFiles(dir)\n\t\tconst project = root ? null : this.remoteProjectProvider.get().name\n\n\t\t// in some cases you need deploy whole folder with custom build etc.\n\t\t// with root option you can build app on your own and simply deploy it with subprojects\n\t\tawait this.adminClient.deploy(project, files)\n\n\t\tconsole.log(`Admin deployed (${files.length} files)`)\n\t}\n\n\tprivate readAdminFiles = async (dir: string, prefix: string = ''): Promise<AdminFiles> => {\n\t\tconst files = []\n\t\tfor (const fileName of await this.fs.readDir(dir, { withFileTypes: true })) {\n\t\t\tif (fileName.isDirectory()) {\n\t\t\t\tconst subFiles = await this.readAdminFiles(`${dir}/${fileName.name}`, prefix + fileName.name + '/')\n\t\t\t\tfiles.push(...subFiles)\n\t\t\t} else if (fileName.isFile()) {\n\t\t\t\tfiles.push({\n\t\t\t\t\tpath: prefix + fileName.name,\n\t\t\t\t\tdata: (await this.fs.readFile(`${dir}/${fileName.name}`)).toString('base64'),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\treturn files\n\t}\n}\n"],"names":[],"mappings":";;;;;AAIO,MAAM,cAAc;AAAA,EAC1B,YACkB,uBACA,aACA,IAChB;AAHgB,SAAA,wBAAA;AACA,SAAA,cAAA;AACA,SAAA,KAAA;AAIlB,kBAAA,MAAO,UAAS,OAAO,EAAE,KAAK,WAGxB;AACL,cAAQ,IAAI,oBAAoB;AAChC,YAAM,QAAQ,MAAM,KAAK,eAAe,GAAG;AAC3C,YAAM,UAAU,OAAO,OAAO,KAAK,sBAAsB,MAAM;AAI/D,YAAM,KAAK,YAAY,OAAO,SAAS,KAAK;AAE5C,cAAQ,IAAI,mBAAmB,MAAM,MAAM,SAAS;AAAA,IACrD,CAAA;AAEA,kBAAA,MAAQ,kBAAiB,OAAO,KAAa,SAAiB,OAA4B;AACzF,YAAM,QAAQ,CAAA;AACd,iBAAW,YAAY,MAAM,KAAK,GAAG,QAAQ,KAAK,EAAE,eAAe,KAAA,CAAM,GAAG;AAC3E,YAAI,SAAS,eAAe;AAC3B,gBAAM,WAAW,MAAM,KAAK,eAAe,GAAG,GAAG,IAAI,SAAS,IAAI,IAAI,SAAS,SAAS,OAAO,GAAG;AAClG,gBAAM,KAAK,GAAG,QAAQ;AAAA,QACvB,WAAW,SAAS,UAAU;AAC7B,gBAAM,KAAK;AAAA,YACV,MAAM,SAAS,SAAS;AAAA,YACxB,OAAO,MAAM,KAAK,GAAG,SAAS,GAAG,GAAG,IAAI,SAAS,IAAI,EAAE,GAAG,SAAS,QAAQ;AAAA,UAAA,CAC3E;AAAA,QACF;AAAA,MACD;AAEA,aAAO;AAAA,IACR,CAAA;AAAA,EAhCA;AAiCD;;"}
1
+ {"version":3,"file":"AdminDeployer.cjs","sources":["../../../../../../packages/cli/src/lib/admin/AdminDeployer.ts"],"sourcesContent":["import { AdminClient, AdminFiles } from './AdminClient.js'\nimport { FileSystem } from '../fs/FileSystem.js'\nimport { RemoteProjectProvider } from '../project/RemoteProjectProvider.js'\n\nexport class AdminDeployer {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t\tprivate readonly adminClient: AdminClient,\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\tpublic deploy = async ({ dir, root }: {\n\t\tdir: string\n\t\troot: boolean\n\t}) => {\n\t\tconsole.log('Deploying admin...')\n\t\tconst files = await this.readAdminFiles(dir)\n\t\tconst project = root ? null : this.remoteProjectProvider.get().name\n\n\t\t// in some cases you need deploy whole folder with custom build etc.\n\t\t// with root option you can build app on your own and simply deploy it with subprojects\n\t\tawait this.adminClient.deploy(project, files)\n\n\t\tconsole.log(`Admin deployed (${files.length} files)`)\n\t}\n\n\tprivate readAdminFiles = async (dir: string, prefix: string = ''): Promise<AdminFiles> => {\n\t\tconst files = []\n\t\tfor (const fileName of await this.fs.readDir(dir, { withFileTypes: true })) {\n\t\t\tif (fileName.isDirectory()) {\n\t\t\t\tconst subFiles = await this.readAdminFiles(`${dir}/${fileName.name}`, prefix + fileName.name + '/')\n\t\t\t\tfiles.push(...subFiles)\n\t\t\t} else if (fileName.isFile()) {\n\t\t\t\tfiles.push({\n\t\t\t\t\tpath: prefix + fileName.name,\n\t\t\t\t\tdata: (await this.fs.readFile(`${dir}/${fileName.name}`)).toString('base64'),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\treturn files\n\t}\n}\n"],"names":[],"mappings":";;;;;AAIO,MAAM,cAAc;AAAA,EAC1B,YACkB,uBACA,aACA,IAChB;AAHgB,SAAA,wBAAA;AACA,SAAA,cAAA;AACA,SAAA,KAAA;AAIlB,kBAAA,MAAO,UAAS,OAAO,EAAE,KAAK,WAGxB;AACL,cAAQ,IAAI,oBAAoB;AAChC,YAAM,QAAQ,MAAM,KAAK,eAAe,GAAG;AAC3C,YAAM,UAAU,OAAO,OAAO,KAAK,sBAAsB,MAAM;AAI/D,YAAM,KAAK,YAAY,OAAO,SAAS,KAAK;AAE5C,cAAQ,IAAI,mBAAmB,MAAM,MAAM,SAAS;AAAA,IACrD,CAAA;AAEA,kBAAA,MAAQ,kBAAiB,OAAO,KAAa,SAAiB,OAA4B;AACzF,YAAM,QAAQ,CAAA;AACd,iBAAW,YAAY,MAAM,KAAK,GAAG,QAAQ,KAAK,EAAE,eAAe,KAAA,CAAM,GAAG;AAC3E,YAAI,SAAS,eAAe;AAC3B,gBAAM,WAAW,MAAM,KAAK,eAAe,GAAG,GAAG,IAAI,SAAS,IAAI,IAAI,SAAS,SAAS,OAAO,GAAG;AAClG,gBAAM,KAAK,GAAG,QAAQ;AAAA,QACvB,WAAW,SAAS,UAAU;AAC7B,gBAAM,KAAK;AAAA,YACV,MAAM,SAAS,SAAS;AAAA,YACxB,OAAO,MAAM,KAAK,GAAG,SAAS,GAAG,GAAG,IAAI,SAAS,IAAI,EAAE,GAAG,SAAS,QAAQ;AAAA,UAAA,CAC3E;AAAA,QACF;AAAA,MACD;AAEA,aAAO;AAAA,IACR,CAAA;AAAA,EAhCA;AAiCD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AdminDeployer.js","sources":["../../../../../../packages/cli/src/lib/admin/AdminDeployer.ts"],"sourcesContent":["import { AdminClient, AdminFiles } from './AdminClient'\nimport { FileSystem } from '../fs/FileSystem'\nimport { RemoteProjectProvider } from '../project/RemoteProjectProvider'\n\nexport class AdminDeployer {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t\tprivate readonly adminClient: AdminClient,\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\tpublic deploy = async ({ dir, root }: {\n\t\tdir: string\n\t\troot: boolean\n\t}) => {\n\t\tconsole.log('Deploying admin...')\n\t\tconst files = await this.readAdminFiles(dir)\n\t\tconst project = root ? null : this.remoteProjectProvider.get().name\n\n\t\t// in some cases you need deploy whole folder with custom build etc.\n\t\t// with root option you can build app on your own and simply deploy it with subprojects\n\t\tawait this.adminClient.deploy(project, files)\n\n\t\tconsole.log(`Admin deployed (${files.length} files)`)\n\t}\n\n\tprivate readAdminFiles = async (dir: string, prefix: string = ''): Promise<AdminFiles> => {\n\t\tconst files = []\n\t\tfor (const fileName of await this.fs.readDir(dir, { withFileTypes: true })) {\n\t\t\tif (fileName.isDirectory()) {\n\t\t\t\tconst subFiles = await this.readAdminFiles(`${dir}/${fileName.name}`, prefix + fileName.name + '/')\n\t\t\t\tfiles.push(...subFiles)\n\t\t\t} else if (fileName.isFile()) {\n\t\t\t\tfiles.push({\n\t\t\t\t\tpath: prefix + fileName.name,\n\t\t\t\t\tdata: (await this.fs.readFile(`${dir}/${fileName.name}`)).toString('base64'),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\treturn files\n\t}\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,cAAc;AAAA,EAC1B,YACkB,uBACA,aACA,IAChB;AAHgB,SAAA,wBAAA;AACA,SAAA,cAAA;AACA,SAAA,KAAA;AAIlB,kBAAA,MAAO,UAAS,OAAO,EAAE,KAAK,WAGxB;AACL,cAAQ,IAAI,oBAAoB;AAChC,YAAM,QAAQ,MAAM,KAAK,eAAe,GAAG;AAC3C,YAAM,UAAU,OAAO,OAAO,KAAK,sBAAsB,MAAM;AAI/D,YAAM,KAAK,YAAY,OAAO,SAAS,KAAK;AAE5C,cAAQ,IAAI,mBAAmB,MAAM,MAAM,SAAS;AAAA,IACrD,CAAA;AAEA,kBAAA,MAAQ,kBAAiB,OAAO,KAAa,SAAiB,OAA4B;AACzF,YAAM,QAAQ,CAAA;AACd,iBAAW,YAAY,MAAM,KAAK,GAAG,QAAQ,KAAK,EAAE,eAAe,KAAA,CAAM,GAAG;AAC3E,YAAI,SAAS,eAAe;AAC3B,gBAAM,WAAW,MAAM,KAAK,eAAe,GAAG,GAAG,IAAI,SAAS,IAAI,IAAI,SAAS,SAAS,OAAO,GAAG;AAClG,gBAAM,KAAK,GAAG,QAAQ;AAAA,QACvB,WAAW,SAAS,UAAU;AAC7B,gBAAM,KAAK;AAAA,YACV,MAAM,SAAS,SAAS;AAAA,YACxB,OAAO,MAAM,KAAK,GAAG,SAAS,GAAG,GAAG,IAAI,SAAS,IAAI,EAAE,GAAG,SAAS,QAAQ;AAAA,UAAA,CAC3E;AAAA,QACF;AAAA,MACD;AAEA,aAAO;AAAA,IACR,CAAA;AAAA,EAhCA;AAiCD;"}
1
+ {"version":3,"file":"AdminDeployer.js","sources":["../../../../../../packages/cli/src/lib/admin/AdminDeployer.ts"],"sourcesContent":["import { AdminClient, AdminFiles } from './AdminClient.js'\nimport { FileSystem } from '../fs/FileSystem.js'\nimport { RemoteProjectProvider } from '../project/RemoteProjectProvider.js'\n\nexport class AdminDeployer {\n\tconstructor(\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t\tprivate readonly adminClient: AdminClient,\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\tpublic deploy = async ({ dir, root }: {\n\t\tdir: string\n\t\troot: boolean\n\t}) => {\n\t\tconsole.log('Deploying admin...')\n\t\tconst files = await this.readAdminFiles(dir)\n\t\tconst project = root ? null : this.remoteProjectProvider.get().name\n\n\t\t// in some cases you need deploy whole folder with custom build etc.\n\t\t// with root option you can build app on your own and simply deploy it with subprojects\n\t\tawait this.adminClient.deploy(project, files)\n\n\t\tconsole.log(`Admin deployed (${files.length} files)`)\n\t}\n\n\tprivate readAdminFiles = async (dir: string, prefix: string = ''): Promise<AdminFiles> => {\n\t\tconst files = []\n\t\tfor (const fileName of await this.fs.readDir(dir, { withFileTypes: true })) {\n\t\t\tif (fileName.isDirectory()) {\n\t\t\t\tconst subFiles = await this.readAdminFiles(`${dir}/${fileName.name}`, prefix + fileName.name + '/')\n\t\t\t\tfiles.push(...subFiles)\n\t\t\t} else if (fileName.isFile()) {\n\t\t\t\tfiles.push({\n\t\t\t\t\tpath: prefix + fileName.name,\n\t\t\t\t\tdata: (await this.fs.readFile(`${dir}/${fileName.name}`)).toString('base64'),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\treturn files\n\t}\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,cAAc;AAAA,EAC1B,YACkB,uBACA,aACA,IAChB;AAHgB,SAAA,wBAAA;AACA,SAAA,cAAA;AACA,SAAA,KAAA;AAIlB,kBAAA,MAAO,UAAS,OAAO,EAAE,KAAK,WAGxB;AACL,cAAQ,IAAI,oBAAoB;AAChC,YAAM,QAAQ,MAAM,KAAK,eAAe,GAAG;AAC3C,YAAM,UAAU,OAAO,OAAO,KAAK,sBAAsB,MAAM;AAI/D,YAAM,KAAK,YAAY,OAAO,SAAS,KAAK;AAE5C,cAAQ,IAAI,mBAAmB,MAAM,MAAM,SAAS;AAAA,IACrD,CAAA;AAEA,kBAAA,MAAQ,kBAAiB,OAAO,KAAa,SAAiB,OAA4B;AACzF,YAAM,QAAQ,CAAA;AACd,iBAAW,YAAY,MAAM,KAAK,GAAG,QAAQ,KAAK,EAAE,eAAe,KAAA,CAAM,GAAG;AAC3E,YAAI,SAAS,eAAe;AAC3B,gBAAM,WAAW,MAAM,KAAK,eAAe,GAAG,GAAG,IAAI,SAAS,IAAI,IAAI,SAAS,SAAS,OAAO,GAAG;AAClG,gBAAM,KAAK,GAAG,QAAQ;AAAA,QACvB,WAAW,SAAS,UAAU;AAC7B,gBAAM,KAAK;AAAA,YACV,MAAM,SAAS,SAAS;AAAA,YACxB,OAAO,MAAM,KAAK,GAAG,SAAS,GAAG,GAAG,IAAI,SAAS,IAAI,EAAE,GAAG,SAAS,QAAQ;AAAA,UAAA,CAC3E;AAAA,QACF;AAAA,MACD;AAEA,aAAO;AAAA,IACR,CAAA;AAAA,EAhCA;AAiCD;"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const node_path = require("node:path");
3
+ const path = require("node:path");
4
4
  const jsyaml = require("js-yaml");
5
5
  var __defProp = Object.defineProperty;
6
6
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -13,24 +13,24 @@ class DockerComposeManager {
13
13
  this.fs = fs;
14
14
  this.yamlHandler = yamlHandler;
15
15
  __publicField(this, "tryReadMainDockerComposeConfig", async (dir2 = this.dir) => {
16
- const path = await this.resolvePath(dir2, MAIN_CONFIGS);
17
- if (!path) {
16
+ const path$1 = await this.resolvePath(dir2, MAIN_CONFIGS);
17
+ if (!path$1) {
18
18
  if (dir2 === "/") {
19
19
  return null;
20
20
  }
21
- return await this.tryReadMainDockerComposeConfig(node_path.dirname(dir2));
21
+ return await this.tryReadMainDockerComposeConfig(path.dirname(dir2));
22
22
  }
23
- return jsyaml.load(await this.fs.readFile(path, "utf8"));
23
+ return jsyaml.load(await this.fs.readFile(path$1, "utf8"));
24
24
  });
25
25
  __publicField(this, "updateMainDockerComposeConfig", async (updater, dir2 = this.dir) => {
26
- const path = this.composeFile || await this.resolvePath(dir2, MAIN_CONFIGS) || node_path.join(dir2, MAIN_CONFIGS[0]);
27
- return this.yamlHandler.updateYaml(path, updater, { createMissing: true });
26
+ const path$1 = this.composeFile || await this.resolvePath(dir2, MAIN_CONFIGS) || path.join(dir2, MAIN_CONFIGS[0]);
27
+ return this.yamlHandler.updateYaml(path$1, updater, { createMissing: true });
28
28
  });
29
29
  __publicField(this, "resolvePath", async (dir2, possibleFileNames) => {
30
30
  for (const file of possibleFileNames) {
31
- const path = node_path.join(dir2, file);
32
- if (await this.fs.pathExists(path)) {
33
- return path;
31
+ const path$1 = path.join(dir2, file);
32
+ if (await this.fs.pathExists(path$1)) {
33
+ return path$1;
34
34
  }
35
35
  }
36
36
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"DockerComposeManager.cjs","sources":["../../../../../../packages/cli/src/lib/fs/DockerComposeManager.ts"],"sourcesContent":["import { dirname, join } from 'node:path'\nimport jsyaml from 'js-yaml'\nimport { FileSystem } from './FileSystem'\nimport { JsonUpdateCallback, YamlHandler } from './YamlHandler'\n\nexport interface DockerComposeServiceConfig {\n\timage?: string\n\tcommand?: string\n\tuser?: string\n\tenvironment?: Record<string, string>\n\tports?: (string | {})[] // todo long syntax\n}\n\nexport interface DockerComposeConfig {\n\t[key: string]: unknown\n\n\tversion?: string\n\tservices?: Record<string, DockerComposeServiceConfig>\n}\n\nconst MAIN_CONFIGS = ['docker-compose.yaml', 'docker-compose.yml']\n\nexport class DockerComposeManager {\n\tconstructor(\n\t\tprivate readonly dir: string,\n\t\tprivate readonly composeFile: string | undefined,\n\t\tprivate readonly fs: FileSystem,\n\t\tprivate readonly yamlHandler: YamlHandler,\n\t) {\n\t}\n\n\ttryReadMainDockerComposeConfig = async (dir: string = this.dir): Promise<DockerComposeConfig | null> => {\n\t\tconst path = await this.resolvePath(dir, MAIN_CONFIGS)\n\t\tif (!path) {\n\t\t\tif (dir === '/') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn await this.tryReadMainDockerComposeConfig(dirname(dir))\n\t\t}\n\t\treturn jsyaml.load(await this.fs.readFile(path, 'utf8')) as DockerComposeConfig\n\t}\n\n\tupdateMainDockerComposeConfig = async (\n\t\tupdater: JsonUpdateCallback<DockerComposeConfig>,\n\t\tdir: string = this.dir,\n\t): Promise<void> => {\n\t\tconst path = this.composeFile || (await this.resolvePath(dir, MAIN_CONFIGS)) || join(dir, MAIN_CONFIGS[0])\n\t\treturn this.yamlHandler.updateYaml(path, updater, { createMissing: true })\n\t}\n\n\tprivate resolvePath = async (dir: string, possibleFileNames: string[]): Promise<string | null> => {\n\t\tfor (const file of possibleFileNames) {\n\t\t\tconst path = join(dir, file)\n\t\t\tif (await this.fs.pathExists(path)) {\n\t\t\t\treturn path\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n}\n"],"names":["dir","dirname","join"],"mappings":";;;;;;;AAoBA,MAAM,eAAe,CAAC,uBAAuB,oBAAoB;AAE1D,MAAM,qBAAqB;AAAA,EACjC,YACkB,KACA,aACA,IACA,aAChB;AAJgB,SAAA,MAAA;AACA,SAAA,cAAA;AACA,SAAA,KAAA;AACA,SAAA,cAAA;AAIlB,kBAAA,MAAA,kCAAiC,OAAOA,OAAc,KAAK,QAA6C;AACvG,YAAM,OAAO,MAAM,KAAK,YAAYA,MAAK,YAAY;AACrD,UAAI,CAAC,MAAM;AACV,YAAIA,SAAQ,KAAK;AAChB,iBAAO;AAAA,QACR;AACA,eAAO,MAAM,KAAK,+BAA+BC,UAAAA,QAAQD,IAAG,CAAC;AAAA,MAC9D;AACA,aAAO,OAAO,KAAK,MAAM,KAAK,GAAG,SAAS,MAAM,MAAM,CAAC;AAAA,IACxD,CAAA;AAEA,kBAAA,MAAA,iCAAgC,OAC/B,SACAA,OAAc,KAAK,QACA;AACnB,YAAM,OAAO,KAAK,eAAgB,MAAM,KAAK,YAAYA,MAAK,YAAY,KAAME,UAAAA,KAAKF,MAAK,aAAa,CAAC,CAAC;AACzG,aAAO,KAAK,YAAY,WAAW,MAAM,SAAS,EAAE,eAAe,MAAM;AAAA,IAC1E,CAAA;AAEA,kBAAA,MAAQ,eAAc,OAAOA,MAAa,sBAAwD;AACjG,iBAAW,QAAQ,mBAAmB;AACrC,cAAM,OAAOE,UAAAA,KAAKF,MAAK,IAAI;AAC3B,YAAI,MAAM,KAAK,GAAG,WAAW,IAAI,GAAG;AACnC,iBAAO;AAAA,QACR;AAAA,MACD;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EA7BA;AA8BD;;"}
1
+ {"version":3,"file":"DockerComposeManager.cjs","sources":["../../../../../../packages/cli/src/lib/fs/DockerComposeManager.ts"],"sourcesContent":["import { dirname, join } from 'node:path'\nimport jsyaml from 'js-yaml'\nimport { FileSystem } from './FileSystem.js'\nimport { JsonUpdateCallback, YamlHandler } from './YamlHandler.js'\n\nexport interface DockerComposeServiceConfig {\n\timage?: string\n\tcommand?: string\n\tuser?: string\n\tenvironment?: Record<string, string>\n\tports?: (string | {})[] // todo long syntax\n}\n\nexport interface DockerComposeConfig {\n\t[key: string]: unknown\n\n\tversion?: string\n\tservices?: Record<string, DockerComposeServiceConfig>\n}\n\nconst MAIN_CONFIGS = ['docker-compose.yaml', 'docker-compose.yml']\n\nexport class DockerComposeManager {\n\tconstructor(\n\t\tprivate readonly dir: string,\n\t\tprivate readonly composeFile: string | undefined,\n\t\tprivate readonly fs: FileSystem,\n\t\tprivate readonly yamlHandler: YamlHandler,\n\t) {\n\t}\n\n\ttryReadMainDockerComposeConfig = async (dir: string = this.dir): Promise<DockerComposeConfig | null> => {\n\t\tconst path = await this.resolvePath(dir, MAIN_CONFIGS)\n\t\tif (!path) {\n\t\t\tif (dir === '/') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn await this.tryReadMainDockerComposeConfig(dirname(dir))\n\t\t}\n\t\treturn jsyaml.load(await this.fs.readFile(path, 'utf8')) as DockerComposeConfig\n\t}\n\n\tupdateMainDockerComposeConfig = async (\n\t\tupdater: JsonUpdateCallback<DockerComposeConfig>,\n\t\tdir: string = this.dir,\n\t): Promise<void> => {\n\t\tconst path = this.composeFile || (await this.resolvePath(dir, MAIN_CONFIGS)) || join(dir, MAIN_CONFIGS[0])\n\t\treturn this.yamlHandler.updateYaml(path, updater, { createMissing: true })\n\t}\n\n\tprivate resolvePath = async (dir: string, possibleFileNames: string[]): Promise<string | null> => {\n\t\tfor (const file of possibleFileNames) {\n\t\t\tconst path = join(dir, file)\n\t\t\tif (await this.fs.pathExists(path)) {\n\t\t\t\treturn path\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n}\n"],"names":["dir","path","dirname","join"],"mappings":";;;;;;;AAoBA,MAAM,eAAe,CAAC,uBAAuB,oBAAoB;AAE1D,MAAM,qBAAqB;AAAA,EACjC,YACkB,KACA,aACA,IACA,aAChB;AAJgB,SAAA,MAAA;AACA,SAAA,cAAA;AACA,SAAA,KAAA;AACA,SAAA,cAAA;AAIlB,kBAAA,MAAA,kCAAiC,OAAOA,OAAc,KAAK,QAA6C;AACvG,YAAMC,SAAO,MAAM,KAAK,YAAYD,MAAK,YAAY;AACrD,UAAI,CAACC,QAAM;AACV,YAAID,SAAQ,KAAK;AAChB,iBAAO;AAAA,QACR;AACA,eAAO,MAAM,KAAK,+BAA+BE,KAAAA,QAAQF,IAAG,CAAC;AAAA,MAC9D;AACA,aAAO,OAAO,KAAK,MAAM,KAAK,GAAG,SAASC,QAAM,MAAM,CAAC;AAAA,IACxD,CAAA;AAEA,kBAAA,MAAA,iCAAgC,OAC/B,SACAD,OAAc,KAAK,QACA;AACnB,YAAMC,SAAO,KAAK,eAAgB,MAAM,KAAK,YAAYD,MAAK,YAAY,KAAMG,KAAAA,KAAKH,MAAK,aAAa,CAAC,CAAC;AACzG,aAAO,KAAK,YAAY,WAAWC,QAAM,SAAS,EAAE,eAAe,MAAM;AAAA,IAC1E,CAAA;AAEA,kBAAA,MAAQ,eAAc,OAAOD,MAAa,sBAAwD;AACjG,iBAAW,QAAQ,mBAAmB;AACrC,cAAMC,SAAOE,KAAAA,KAAKH,MAAK,IAAI;AAC3B,YAAI,MAAM,KAAK,GAAG,WAAWC,MAAI,GAAG;AACnC,iBAAOA;AAAAA,QACR;AAAA,MACD;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EA7BA;AA8BD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DockerComposeManager.js","sources":["../../../../../../packages/cli/src/lib/fs/DockerComposeManager.ts"],"sourcesContent":["import { dirname, join } from 'node:path'\nimport jsyaml from 'js-yaml'\nimport { FileSystem } from './FileSystem'\nimport { JsonUpdateCallback, YamlHandler } from './YamlHandler'\n\nexport interface DockerComposeServiceConfig {\n\timage?: string\n\tcommand?: string\n\tuser?: string\n\tenvironment?: Record<string, string>\n\tports?: (string | {})[] // todo long syntax\n}\n\nexport interface DockerComposeConfig {\n\t[key: string]: unknown\n\n\tversion?: string\n\tservices?: Record<string, DockerComposeServiceConfig>\n}\n\nconst MAIN_CONFIGS = ['docker-compose.yaml', 'docker-compose.yml']\n\nexport class DockerComposeManager {\n\tconstructor(\n\t\tprivate readonly dir: string,\n\t\tprivate readonly composeFile: string | undefined,\n\t\tprivate readonly fs: FileSystem,\n\t\tprivate readonly yamlHandler: YamlHandler,\n\t) {\n\t}\n\n\ttryReadMainDockerComposeConfig = async (dir: string = this.dir): Promise<DockerComposeConfig | null> => {\n\t\tconst path = await this.resolvePath(dir, MAIN_CONFIGS)\n\t\tif (!path) {\n\t\t\tif (dir === '/') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn await this.tryReadMainDockerComposeConfig(dirname(dir))\n\t\t}\n\t\treturn jsyaml.load(await this.fs.readFile(path, 'utf8')) as DockerComposeConfig\n\t}\n\n\tupdateMainDockerComposeConfig = async (\n\t\tupdater: JsonUpdateCallback<DockerComposeConfig>,\n\t\tdir: string = this.dir,\n\t): Promise<void> => {\n\t\tconst path = this.composeFile || (await this.resolvePath(dir, MAIN_CONFIGS)) || join(dir, MAIN_CONFIGS[0])\n\t\treturn this.yamlHandler.updateYaml(path, updater, { createMissing: true })\n\t}\n\n\tprivate resolvePath = async (dir: string, possibleFileNames: string[]): Promise<string | null> => {\n\t\tfor (const file of possibleFileNames) {\n\t\t\tconst path = join(dir, file)\n\t\t\tif (await this.fs.pathExists(path)) {\n\t\t\t\treturn path\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n}\n"],"names":["dir","jsyaml"],"mappings":";;;;;AAoBA,MAAM,eAAe,CAAC,uBAAuB,oBAAoB;AAE1D,MAAM,qBAAqB;AAAA,EACjC,YACkB,KACA,aACA,IACA,aAChB;AAJgB,SAAA,MAAA;AACA,SAAA,cAAA;AACA,SAAA,KAAA;AACA,SAAA,cAAA;AAIlB,kBAAA,MAAA,kCAAiC,OAAOA,OAAc,KAAK,QAA6C;AACvG,YAAM,OAAO,MAAM,KAAK,YAAYA,MAAK,YAAY;AACrD,UAAI,CAAC,MAAM;AACV,YAAIA,SAAQ,KAAK;AAChB,iBAAO;AAAA,QACR;AACA,eAAO,MAAM,KAAK,+BAA+B,QAAQA,IAAG,CAAC;AAAA,MAC9D;AACA,aAAOC,gBAAO,KAAK,MAAM,KAAK,GAAG,SAAS,MAAM,MAAM,CAAC;AAAA,IACxD,CAAA;AAEA,kBAAA,MAAA,iCAAgC,OAC/B,SACAD,OAAc,KAAK,QACA;AACnB,YAAM,OAAO,KAAK,eAAgB,MAAM,KAAK,YAAYA,MAAK,YAAY,KAAM,KAAKA,MAAK,aAAa,CAAC,CAAC;AACzG,aAAO,KAAK,YAAY,WAAW,MAAM,SAAS,EAAE,eAAe,MAAM;AAAA,IAC1E,CAAA;AAEA,kBAAA,MAAQ,eAAc,OAAOA,MAAa,sBAAwD;AACjG,iBAAW,QAAQ,mBAAmB;AACrC,cAAM,OAAO,KAAKA,MAAK,IAAI;AAC3B,YAAI,MAAM,KAAK,GAAG,WAAW,IAAI,GAAG;AACnC,iBAAO;AAAA,QACR;AAAA,MACD;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EA7BA;AA8BD;"}
1
+ {"version":3,"file":"DockerComposeManager.js","sources":["../../../../../../packages/cli/src/lib/fs/DockerComposeManager.ts"],"sourcesContent":["import { dirname, join } from 'node:path'\nimport jsyaml from 'js-yaml'\nimport { FileSystem } from './FileSystem.js'\nimport { JsonUpdateCallback, YamlHandler } from './YamlHandler.js'\n\nexport interface DockerComposeServiceConfig {\n\timage?: string\n\tcommand?: string\n\tuser?: string\n\tenvironment?: Record<string, string>\n\tports?: (string | {})[] // todo long syntax\n}\n\nexport interface DockerComposeConfig {\n\t[key: string]: unknown\n\n\tversion?: string\n\tservices?: Record<string, DockerComposeServiceConfig>\n}\n\nconst MAIN_CONFIGS = ['docker-compose.yaml', 'docker-compose.yml']\n\nexport class DockerComposeManager {\n\tconstructor(\n\t\tprivate readonly dir: string,\n\t\tprivate readonly composeFile: string | undefined,\n\t\tprivate readonly fs: FileSystem,\n\t\tprivate readonly yamlHandler: YamlHandler,\n\t) {\n\t}\n\n\ttryReadMainDockerComposeConfig = async (dir: string = this.dir): Promise<DockerComposeConfig | null> => {\n\t\tconst path = await this.resolvePath(dir, MAIN_CONFIGS)\n\t\tif (!path) {\n\t\t\tif (dir === '/') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn await this.tryReadMainDockerComposeConfig(dirname(dir))\n\t\t}\n\t\treturn jsyaml.load(await this.fs.readFile(path, 'utf8')) as DockerComposeConfig\n\t}\n\n\tupdateMainDockerComposeConfig = async (\n\t\tupdater: JsonUpdateCallback<DockerComposeConfig>,\n\t\tdir: string = this.dir,\n\t): Promise<void> => {\n\t\tconst path = this.composeFile || (await this.resolvePath(dir, MAIN_CONFIGS)) || join(dir, MAIN_CONFIGS[0])\n\t\treturn this.yamlHandler.updateYaml(path, updater, { createMissing: true })\n\t}\n\n\tprivate resolvePath = async (dir: string, possibleFileNames: string[]): Promise<string | null> => {\n\t\tfor (const file of possibleFileNames) {\n\t\t\tconst path = join(dir, file)\n\t\t\tif (await this.fs.pathExists(path)) {\n\t\t\t\treturn path\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n}\n"],"names":["dir","jsyaml"],"mappings":";;;;;AAoBA,MAAM,eAAe,CAAC,uBAAuB,oBAAoB;AAE1D,MAAM,qBAAqB;AAAA,EACjC,YACkB,KACA,aACA,IACA,aAChB;AAJgB,SAAA,MAAA;AACA,SAAA,cAAA;AACA,SAAA,KAAA;AACA,SAAA,cAAA;AAIlB,kBAAA,MAAA,kCAAiC,OAAOA,OAAc,KAAK,QAA6C;AACvG,YAAM,OAAO,MAAM,KAAK,YAAYA,MAAK,YAAY;AACrD,UAAI,CAAC,MAAM;AACV,YAAIA,SAAQ,KAAK;AAChB,iBAAO;AAAA,QACR;AACA,eAAO,MAAM,KAAK,+BAA+B,QAAQA,IAAG,CAAC;AAAA,MAC9D;AACA,aAAOC,gBAAO,KAAK,MAAM,KAAK,GAAG,SAAS,MAAM,MAAM,CAAC;AAAA,IACxD,CAAA;AAEA,kBAAA,MAAA,iCAAgC,OAC/B,SACAD,OAAc,KAAK,QACA;AACnB,YAAM,OAAO,KAAK,eAAgB,MAAM,KAAK,YAAYA,MAAK,YAAY,KAAM,KAAKA,MAAK,aAAa,CAAC,CAAC;AACzG,aAAO,KAAK,YAAY,WAAW,MAAM,SAAS,EAAE,eAAe,MAAM;AAAA,IAC1E,CAAA;AAEA,kBAAA,MAAQ,eAAc,OAAOA,MAAa,sBAAwD;AACjG,iBAAW,QAAQ,mBAAmB;AACrC,cAAM,OAAO,KAAKA,MAAK,IAAI;AAC3B,YAAI,MAAM,KAAK,GAAG,WAAW,IAAI,GAAG;AACnC,iBAAO;AAAA,QACR;AAAA,MACD;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EA7BA;AA8BD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"YamlHandler.cjs","sources":["../../../../../../packages/cli/src/lib/fs/YamlHandler.ts"],"sourcesContent":["import { readFile, writeFile } from 'node:fs/promises'\nimport jsyaml from 'js-yaml'\nimport { FileSystem } from './FileSystem'\nimport YAWN from 'yawn-yaml'\nimport { JSONObject, JSONPrimitive } from '../json'\nimport { Merger } from '@contember/config-loader'\n\nexport type JsonUpdateCallback<Value = JSONObject> = (\n\tdata: Partial<Value>,\n\tutils: { merge: (a: JSONObject, b: JSONObject) => JSONObject },\n) => Value\n\nexport class YamlHandler {\n\tconstructor(\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\treadYaml = async <T = unknown>(path: string): Promise<T> => {\n\t\tconst content = await this.fs.readFile(path, { encoding: 'utf8' })\n\t\treturn jsyaml.load(content) as unknown as T\n\t}\n\n\ttryReadYaml = async <T = unknown>(path: string): Promise<T | null> => {\n\t\ttry {\n\t\t\treturn await this.readYaml<T>(path)\n\t\t} catch (e: any) {\n\t\t\tif (e.code === 'ENOENT') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n\n\tupdateYaml = async <Value = JSONObject>(\n\t\tpath: string,\n\t\tupdater: JsonUpdateCallback<Value>,\n\t\toptions: { createMissing?: boolean } = {},\n\t) => {\n\t\tlet config = ''\n\t\tif (await this.fs.pathExists(path)) {\n\t\t\tconfig = await readFile(path, { encoding: 'utf8' })\n\t\t} else if (options.createMissing !== true) {\n\t\t\tthrow new Error(`File ${path} does not exist.`)\n\t\t}\n\n\t\tlet newConfig = ''\n\t\tconst mergeUtils = { merge: (a: JSONObject, b: JSONObject) => Merger.merge<JSONPrimitive>(a, b) }\n\t\tif (config) {\n\t\t\tconst yawn = new YAWN(config)\n\t\t\tyawn.json = updater(yawn.json, mergeUtils)\n\t\t\tnewConfig = yawn.yaml\n\t\t} else {\n\t\t\tnewConfig = jsyaml.dump(updater({}, mergeUtils))\n\t\t}\n\n\t\tawait writeFile(path, newConfig, { encoding: 'utf8' })\n\t}\n}\n"],"names":["fs","readFile","Merger","writeFile"],"mappings":";;;;;;;;;AAYO,MAAM,YAAY;AAAA,EACxB,YACkBA,MAChB;AADgB,SAAA,KAAAA;AAIlB,kBAAA,MAAA,YAAW,OAAoB,SAA6B;AAC3D,YAAM,UAAU,MAAM,KAAK,GAAG,SAAS,MAAM,EAAE,UAAU,QAAQ;AACjE,aAAO,OAAO,KAAK,OAAO;AAAA,IAC3B,CAAA;AAEA,kBAAA,MAAA,eAAc,OAAoB,SAAoC;AACrE,UAAI;AACH,eAAO,MAAM,KAAK,SAAY,IAAI;AAAA,MACnC,SAAS,GAAQ;AAChB,YAAI,EAAE,SAAS,UAAU;AACxB,iBAAO;AAAA,QACR;AACA,cAAM;AAAA,MACP;AAAA,IACD,CAAA;AAEA,kBAAA,MAAA,cAAa,OACZ,MACA,SACA,UAAuC,OACnC;AACJ,UAAI,SAAS;AACb,UAAI,MAAM,KAAK,GAAG,WAAW,IAAI,GAAG;AACnC,iBAAS,MAAMC,GAAAA,SAAS,MAAM,EAAE,UAAU,QAAQ;AAAA,MACnD,WAAW,QAAQ,kBAAkB,MAAM;AAC1C,cAAM,IAAI,MAAM,QAAQ,IAAI,kBAAkB;AAAA,MAC/C;AAEA,UAAI,YAAY;AAChB,YAAM,aAAa,EAAE,OAAO,CAAC,GAAe,MAAkBC,aAAAA,OAAO,MAAqB,GAAG,CAAC,EAAA;AAC9F,UAAI,QAAQ;AACX,cAAM,OAAO,IAAI,KAAK,MAAM;AAC5B,aAAK,OAAO,QAAQ,KAAK,MAAM,UAAU;AACzC,oBAAY,KAAK;AAAA,MAClB,OAAO;AACN,oBAAY,OAAO,KAAK,QAAQ,CAAA,GAAI,UAAU,CAAC;AAAA,MAChD;AAEA,YAAMC,GAAAA,UAAU,MAAM,WAAW,EAAE,UAAU,QAAQ;AAAA,IACtD,CAAA;AAAA,EAzCA;AA0CD;;"}
1
+ {"version":3,"file":"YamlHandler.cjs","sources":["../../../../../../packages/cli/src/lib/fs/YamlHandler.ts"],"sourcesContent":["import { readFile, writeFile } from 'node:fs/promises'\nimport jsyaml from 'js-yaml'\nimport { FileSystem } from './FileSystem.js'\nimport YAWN from 'yawn-yaml'\nimport { JSONObject, JSONPrimitive } from '../json.js'\nimport { Merger } from '@contember/config-loader'\n\nexport type JsonUpdateCallback<Value = JSONObject> = (\n\tdata: Partial<Value>,\n\tutils: { merge: (a: JSONObject, b: JSONObject) => JSONObject },\n) => Value\n\nexport class YamlHandler {\n\tconstructor(\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\treadYaml = async <T = unknown>(path: string): Promise<T> => {\n\t\tconst content = await this.fs.readFile(path, { encoding: 'utf8' })\n\t\treturn jsyaml.load(content) as unknown as T\n\t}\n\n\ttryReadYaml = async <T = unknown>(path: string): Promise<T | null> => {\n\t\ttry {\n\t\t\treturn await this.readYaml<T>(path)\n\t\t} catch (e: any) {\n\t\t\tif (e.code === 'ENOENT') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n\n\tupdateYaml = async <Value = JSONObject>(\n\t\tpath: string,\n\t\tupdater: JsonUpdateCallback<Value>,\n\t\toptions: { createMissing?: boolean } = {},\n\t) => {\n\t\tlet config = ''\n\t\tif (await this.fs.pathExists(path)) {\n\t\t\tconfig = await readFile(path, { encoding: 'utf8' })\n\t\t} else if (options.createMissing !== true) {\n\t\t\tthrow new Error(`File ${path} does not exist.`)\n\t\t}\n\n\t\tlet newConfig = ''\n\t\tconst mergeUtils = { merge: (a: JSONObject, b: JSONObject) => Merger.merge<JSONPrimitive>(a, b) }\n\t\tif (config) {\n\t\t\tconst yawn = new YAWN(config)\n\t\t\tyawn.json = updater(yawn.json, mergeUtils)\n\t\t\tnewConfig = yawn.yaml\n\t\t} else {\n\t\t\tnewConfig = jsyaml.dump(updater({}, mergeUtils))\n\t\t}\n\n\t\tawait writeFile(path, newConfig, { encoding: 'utf8' })\n\t}\n}\n"],"names":["fs","readFile","Merger","writeFile"],"mappings":";;;;;;;;;AAYO,MAAM,YAAY;AAAA,EACxB,YACkBA,MAChB;AADgB,SAAA,KAAAA;AAIlB,kBAAA,MAAA,YAAW,OAAoB,SAA6B;AAC3D,YAAM,UAAU,MAAM,KAAK,GAAG,SAAS,MAAM,EAAE,UAAU,QAAQ;AACjE,aAAO,OAAO,KAAK,OAAO;AAAA,IAC3B,CAAA;AAEA,kBAAA,MAAA,eAAc,OAAoB,SAAoC;AACrE,UAAI;AACH,eAAO,MAAM,KAAK,SAAY,IAAI;AAAA,MACnC,SAAS,GAAQ;AAChB,YAAI,EAAE,SAAS,UAAU;AACxB,iBAAO;AAAA,QACR;AACA,cAAM;AAAA,MACP;AAAA,IACD,CAAA;AAEA,kBAAA,MAAA,cAAa,OACZ,MACA,SACA,UAAuC,OACnC;AACJ,UAAI,SAAS;AACb,UAAI,MAAM,KAAK,GAAG,WAAW,IAAI,GAAG;AACnC,iBAAS,MAAMC,GAAAA,SAAS,MAAM,EAAE,UAAU,QAAQ;AAAA,MACnD,WAAW,QAAQ,kBAAkB,MAAM;AAC1C,cAAM,IAAI,MAAM,QAAQ,IAAI,kBAAkB;AAAA,MAC/C;AAEA,UAAI,YAAY;AAChB,YAAM,aAAa,EAAE,OAAO,CAAC,GAAe,MAAkBC,aAAAA,OAAO,MAAqB,GAAG,CAAC,EAAA;AAC9F,UAAI,QAAQ;AACX,cAAM,OAAO,IAAI,KAAK,MAAM;AAC5B,aAAK,OAAO,QAAQ,KAAK,MAAM,UAAU;AACzC,oBAAY,KAAK;AAAA,MAClB,OAAO;AACN,oBAAY,OAAO,KAAK,QAAQ,CAAA,GAAI,UAAU,CAAC;AAAA,MAChD;AAEA,YAAMC,GAAAA,UAAU,MAAM,WAAW,EAAE,UAAU,QAAQ;AAAA,IACtD,CAAA;AAAA,EAzCA;AA0CD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"YamlHandler.js","sources":["../../../../../../packages/cli/src/lib/fs/YamlHandler.ts"],"sourcesContent":["import { readFile, writeFile } from 'node:fs/promises'\nimport jsyaml from 'js-yaml'\nimport { FileSystem } from './FileSystem'\nimport YAWN from 'yawn-yaml'\nimport { JSONObject, JSONPrimitive } from '../json'\nimport { Merger } from '@contember/config-loader'\n\nexport type JsonUpdateCallback<Value = JSONObject> = (\n\tdata: Partial<Value>,\n\tutils: { merge: (a: JSONObject, b: JSONObject) => JSONObject },\n) => Value\n\nexport class YamlHandler {\n\tconstructor(\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\treadYaml = async <T = unknown>(path: string): Promise<T> => {\n\t\tconst content = await this.fs.readFile(path, { encoding: 'utf8' })\n\t\treturn jsyaml.load(content) as unknown as T\n\t}\n\n\ttryReadYaml = async <T = unknown>(path: string): Promise<T | null> => {\n\t\ttry {\n\t\t\treturn await this.readYaml<T>(path)\n\t\t} catch (e: any) {\n\t\t\tif (e.code === 'ENOENT') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n\n\tupdateYaml = async <Value = JSONObject>(\n\t\tpath: string,\n\t\tupdater: JsonUpdateCallback<Value>,\n\t\toptions: { createMissing?: boolean } = {},\n\t) => {\n\t\tlet config = ''\n\t\tif (await this.fs.pathExists(path)) {\n\t\t\tconfig = await readFile(path, { encoding: 'utf8' })\n\t\t} else if (options.createMissing !== true) {\n\t\t\tthrow new Error(`File ${path} does not exist.`)\n\t\t}\n\n\t\tlet newConfig = ''\n\t\tconst mergeUtils = { merge: (a: JSONObject, b: JSONObject) => Merger.merge<JSONPrimitive>(a, b) }\n\t\tif (config) {\n\t\t\tconst yawn = new YAWN(config)\n\t\t\tyawn.json = updater(yawn.json, mergeUtils)\n\t\t\tnewConfig = yawn.ya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D;"}
1
+ {"version":3,"file":"YamlHandler.js","sources":["../../../../../../packages/cli/src/lib/fs/YamlHandler.ts"],"sourcesContent":["import { readFile, writeFile } from 'node:fs/promises'\nimport jsyaml from 'js-yaml'\nimport { FileSystem } from './FileSystem.js'\nimport YAWN from 'yawn-yaml'\nimport { JSONObject, JSONPrimitive } from '../json.js'\nimport { Merger } from '@contember/config-loader'\n\nexport type JsonUpdateCallback<Value = JSONObject> = (\n\tdata: Partial<Value>,\n\tutils: { merge: (a: JSONObject, b: JSONObject) => JSONObject },\n) => Value\n\nexport class YamlHandler {\n\tconstructor(\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\treadYaml = async <T = unknown>(path: string): Promise<T> => {\n\t\tconst content = await this.fs.readFile(path, { encoding: 'utf8' })\n\t\treturn jsyaml.load(content) as unknown as T\n\t}\n\n\ttryReadYaml = async <T = unknown>(path: string): Promise<T | null> => {\n\t\ttry {\n\t\t\treturn await this.readYaml<T>(path)\n\t\t} catch (e: any) {\n\t\t\tif (e.code === 'ENOENT') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n\n\tupdateYaml = async <Value = JSONObject>(\n\t\tpath: string,\n\t\tupdater: JsonUpdateCallback<Value>,\n\t\toptions: { createMissing?: boolean } = {},\n\t) => {\n\t\tlet config = ''\n\t\tif (await this.fs.pathExists(path)) {\n\t\t\tconfig = await readFile(path, { encoding: 'utf8' })\n\t\t} else if (options.createMissing !== true) {\n\t\t\tthrow new Error(`File ${path} does not exist.`)\n\t\t}\n\n\t\tlet newConfig = ''\n\t\tconst mergeUtils = { merge: (a: JSONObject, b: JSONObject) => Merger.merge<JSONPrimitive>(a, b) }\n\t\tif (config) {\n\t\t\tconst yawn = new YAWN(config)\n\t\t\tyawn.json = updater(yawn.json, mergeUtils)\n\t\t\tnewConfig = yawn.yaml\n\t\t} else {\n\t\t\tnewConfig = jsyaml.dump(updater({}, mergeUtils))\n\t\t}\n\n\t\tawait writeF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