@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TenantApplyCommand.js","sources":["../../../../../../packages/cli/src/commands/tenant/TenantApplyCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'\nimport { TenantClient } from '../../lib/tenant/TenantClient.js'\nimport { TenantConfigLoader } from '../../lib/tenant/TenantConfigLoader.js'\nimport { TenantConfigApplier } from '../../lib/tenant/TenantConfigApplier.js'\n\ntype Args = {\n\tconfig?: string\n}\n\ntype Options = {\n\tdsn?: string\n\t['dry-run']?: boolean\n}\n\nconst DEFAULT_CONFIG_PATH = 'tenant.config.ts'\n\nexport class TenantApplyCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly tenantConfigLoader: TenantConfigLoader,\n\t\tprivate readonly tenantConfigApplier: TenantConfigApplier,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Apply declarative tenant configuration (global config, identity providers, mail templates)')\n\t\tconfiguration.argument('config').optional().description(`Path to the tenant config file (default: ${DEFAULT_CONFIG_PATH})`)\n\t\tconfiguration.option('dsn').valueRequired().description('Project DSN. Falls back to CONTEMBER_* environment variables.')\n\t\tconfiguration.option('dry-run').valueNone().description('Print the actions that would be performed without executing them.')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst configPath = input.getArgument('config') ?? DEFAULT_CONFIG_PATH\n\t\tconst dsn = input.getOption('dsn')\n\t\tconst dryRun = input.getOption('dry-run') === true\n\n\t\tconst remoteProject = this.remoteProjectResolver.resolve(dsn)\n\t\tif (!remoteProject) {\n\t\t\tthrow `Project not defined. Please provide a DSN (--dsn) or set CONTEMBER_* environment variables.`\n\t\t}\n\n\t\tconst config = await this.tenantConfigLoader.loadConfig(configPath)\n\t\tconst client = TenantClient.create(remoteProject.endpoint, remoteProject.token)\n\n\t\tconsole.log(`Applying tenant config from ${configPath}`)\n\t\tconsole.log(`API URL: ${remoteProject.endpoint}`)\n\t\tconsole.log('')\n\n\t\tawait this.tenantConfigApplier.apply(client, config, { dryRun })\n\n\t\tconsole.log('')\n\t\tconsole.log(dryRun ? 'Dry run complete. No changes were made.' : 'Tenant configuration applied.')\n\t\treturn 0\n\t}\n}\n"],"names":[],"mappings":";;AAeA,MAAM,sBAAsB;AAErB,MAAM,2BAA2B,QAAuB;AAAA,EAC9D,YACkB,uBACA,oBACA,qBAChB;AACD,UAAA;AAJiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AACA,SAAA,sBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,4FAA4F;AACtH,kBAAc,SAAS,QAAQ,EAAE,SAAA,EAAW,YAAY,4CAA4C,mBAAmB,GAAG;AAC1H,kBAAc,OAAO,KAAK,EAAE,cAAA,EAAgB,YAAY,+DAA+D;AACvH,kBAAc,OAAO,SAAS,EAAE,UAAA,EAAY,YAAY,mEAAmE;AAAA,EAC5H;AAAA,EAEA,MAAgB,QAAQ,OAAqD;AAC5E,UAAM,aAAa,MAAM,YAAY,QAAQ,KAAK;AAClD,UAAM,MAAM,MAAM,UAAU,KAAK;AACjC,UAAM,SAAS,MAAM,UAAU,SAAS,MAAM;AAE9C,UAAM,gBAAgB,KAAK,sBAAsB,QAAQ,GAAG;AAC5D,QAAI,CAAC,eAAe;AACnB,YAAM;AAAA,IACP;AAEA,UAAM,SAAS,MAAM,KAAK,mBAAmB,WAAW,UAAU;AAClE,UAAM,SAAS,aAAa,OAAO,cAAc,UAAU,cAAc,KAAK;AAE9E,YAAQ,IAAI,+BAA+B,UAAU,EAAE;AACvD,YAAQ,IAAI,YAAY,cAAc,QAAQ,EAAE;AAChD,YAAQ,IAAI,EAAE;AAEd,UAAM,KAAK,oBAAoB,MAAM,QAAQ,QAAQ,EAAE,QAAQ;AAE/D,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,SAAS,4CAA4C,+BAA+B;AAChG,WAAO;AAAA,EACR;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExportCommand.cjs","sources":["../../../../../../packages/cli/src/commands/transfer/ExportCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { createWriteStream } from 'node:fs'\nimport { maskToken } from '../../lib/maskToken'\nimport { pipeline } from 'node:stream/promises'\nimport { printProgressLine } from '../../lib/transfer/stdio'\nimport { createGunzip, createGzip } from 'node:zlib'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient'\nimport { Readable } from 'node:stream'\n\ntype Args = {\n\tsource?: string\n}\ntype Options = {\n\t'include-system'?: boolean\n\t/** @deprecated */\n\t'no-gzip'?: boolean\n\t'no-gzip-output'?: boolean\n\t'no-gzip-transfer'?: boolean\n\toutput?: string\n\t'exclude-table'?: string[]\n}\n\nexport class ExportCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Export data from a project')\n\t\tconfiguration.argument('source').optional()\n\t\tconfiguration.option('include-system').valueNone()\n\t\tconfiguration.option('no-gzip').valueNone().deprecated()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('no-gzip-output').valueNone()\n\t\tconfiguration.option('output').valueRequired()\n\t\tconfiguration.option('exclude-table').valueArray()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst from = input.getArgument('source')\n\t\tconst project = await this.remoteProjectResolver.resolve(from)\n\t\tif (!project) {\n\t\t\tthrow `Project not defined`\n\t\t}\n\n\t\tconsole.log('')\n\t\tconsole.log('Exporting data from a following project')\n\t\tconsole.log('')\n\t\tconsole.log(`Project name: ${project.name}`)\n\t\tconsole.log(`API URL: ${project.endpoint}`)\n\t\tconsole.log(`Token: ${maskToken(project.token)}`)\n\n\t\tconst gzipOutput = !input.getOption('no-gzip-output') && !input.getOption('no-gzip')\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\n\t\tconst includeSystem = input.getOption('include-system') === true\n\n\t\tconst response = await this.dataTransferClient.dataExport({\n\t\t\tproject,\n\t\t\texcludeTables: input.getOption('exclude-table') ?? [],\n\t\t\tincludeSystem,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tif (!response.body) {\n\t\t\tthrow new Error('Response does not contain a readable stream.')\n\t\t}\n\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tlet lastMbReported = 0\n\t\tconsole.log('')\n\t\tconst stream = Readable.fromWeb(response.body as any)\n\t\tstream.on('data', chunk => {\n\t\t\ttransferred += chunk.length\n\t\t\tconst currentMb = Math.floor(transferred / 1024 / 1024)\n\t\t\tif (currentMb > lastMbReported) {\n\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\tprintProgressLine(`transferred ${currentMb} MiB; ${durationS} seconds`)\n\t\t\t\tlastMbReported = currentMb\n\t\t\t}\n\t\t})\n\n\t\tconst fileName = input.getOption('output') ?? `${project.name}.jsonl${gzipOutput ? '.gz' : ''}`\n\t\tconst fileStream = createWriteStream(fileName)\n\n\t\tconst responseStream = !gzipOutput\n\t\t\t? stream\n\t\t\t: stream.pipe(createGzip())\n\n\t\tawait pipeline(responseStream, fileStream)\n\n\t\tconsole.log('\\nExport done.')\n\t\tconsole.log(`Data saved to ${fileName}`)\n\t}\n}\n"],"names":["Command","maskToken","Readable","printProgressLine","createWriteStream","createGzip","pipeline"],"mappings":";;;;;;;;;AAuBO,MAAM,sBAAsBA,UAAAA,QAAuB;AAAA,EACzD,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,4BAA4B;AACtD,kBAAc,SAAS,QAAQ,EAAE,SAAA;AACjC,kBAAc,OAAO,gBAAgB,EAAE,UAAA;AACvC,kBAAc,OAAO,SAAS,EAAE,UAAA,EAAY,WAAA;AAC5C,kBAAc,OAAO,kBAAkB,EAAE,UAAA;AACzC,kBAAc,OAAO,gBAAgB,EAAE,UAAA;AACvC,kBAAc,OAAO,QAAQ,EAAE,cAAA;AAC/B,kBAAc,OAAO,eAAe,EAAE,WAAA;AAAA,EACvC;AAAA,EAEA,MAAgB,QAAQ,OAAqD;AAC5E,UAAM,OAAO,MAAM,YAAY,QAAQ;AACvC,UAAM,UAAU,MAAM,KAAK,sBAAsB,QAAQ,IAAI;AAC7D,QAAI,CAAC,SAAS;AACb,YAAM;AAAA,IACP;AAEA,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,yCAAyC;AACrD,YAAQ,IAAI,EAAE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YAAQ,IAAI,gBAAgB;AAC5B,YAAQ,IAAI,iBAAiB,QAAQ,EAAE;AAAA,EACxC;AACD;;"}
1
+ {"version":3,"file":"ExportCommand.cjs","sources":["../../../../../../packages/cli/src/commands/transfer/ExportCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { createWriteStream } from 'node:fs'\nimport { maskToken } from '../../lib/maskToken.js'\nimport { pipeline } from 'node:stream/promises'\nimport { printProgressLine } from '../../lib/transfer/stdio.js'\nimport { createGunzip, createGzip } from 'node:zlib'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient.js'\nimport { Readable } from 'node:stream'\n\ntype Args = {\n\tsource?: string\n}\ntype Options = {\n\t'include-system'?: boolean\n\t/** @deprecated */\n\t'no-gzip'?: boolean\n\t'no-gzip-output'?: boolean\n\t'no-gzip-transfer'?: boolean\n\toutput?: string\n\t'exclude-table'?: string[]\n}\n\nexport class ExportCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Export data from a project')\n\t\tconfiguration.argument('source').optional()\n\t\tconfiguration.option('include-system').valueNone()\n\t\tconfiguration.option('no-gzip').valueNone().deprecated()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('no-gzip-output').valueNone()\n\t\tconfiguration.option('output').valueRequired()\n\t\tconfiguration.option('exclude-table').valueArray()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst from = input.getArgument('source')\n\t\tconst project = await this.remoteProjectResolver.resolve(from)\n\t\tif (!project) {\n\t\t\tthrow `Project not defined`\n\t\t}\n\n\t\tconsole.log('')\n\t\tconsole.log('Exporting data from a following project')\n\t\tconsole.log('')\n\t\tconsole.log(`Project name: ${project.name}`)\n\t\tconsole.log(`API URL: ${project.endpoint}`)\n\t\tconsole.log(`Token: ${maskToken(project.token)}`)\n\n\t\tconst gzipOutput = !input.getOption('no-gzip-output') && !input.getOption('no-gzip')\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\n\t\tconst includeSystem = input.getOption('include-system') === true\n\n\t\tconst response = await this.dataTransferClient.dataExport({\n\t\t\tproject,\n\t\t\texcludeTables: input.getOption('exclude-table') ?? [],\n\t\t\tincludeSystem,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tif (!response.body) {\n\t\t\tthrow new Error('Response does not contain a readable stream.')\n\t\t}\n\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tlet lastMbReported = 0\n\t\tconsole.log('')\n\t\tconst stream = Readable.fromWeb(response.body as any)\n\t\tstream.on('data', chunk => {\n\t\t\ttransferred += chunk.length\n\t\t\tconst currentMb = Math.floor(transferred / 1024 / 1024)\n\t\t\tif (currentMb > lastMbReported) {\n\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\tprintProgressLine(`transferred ${currentMb} MiB; ${durationS} seconds`)\n\t\t\t\tlastMbReported = currentMb\n\t\t\t}\n\t\t})\n\n\t\tconst fileName = input.getOption('output') ?? `${project.name}.jsonl${gzipOutput ? '.gz' : ''}`\n\t\tconst fileStream = createWriteStream(fileName)\n\n\t\tconst responseStream = !gzipOutput\n\t\t\t? stream\n\t\t\t: stream.pipe(createGzip())\n\n\t\tawait pipeline(responseStream, fileStream)\n\n\t\tconsole.log('\\nExport done.')\n\t\tconsole.log(`Data saved to ${fileName}`)\n\t}\n}\n"],"names":["Command","maskToken","Readable","printProgressLine","createWriteStream","createGzip","pipeline"],"mappings":";;;;;;;;;AAuBO,MAAM,sBAAsBA,UAAAA,QAAuB;AAAA,EACzD,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA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,iBAAiB;AACrB,YAAQ,IAAI,EAAE;AACd,UAAM,SAASC,YAAAA,SAAS,QAAQ,SAAS,IAAW;AACpD,WAAO,GAAG,QAAQ,CAAA,UAAS;AAC1B,qBAAe,MAAM;AACrB,YAAM,YAAY,KAAK,MAAM,cAAc,OAAO,IAAI;AACtD,UAAI,YAAY,gBAAgB;AAC/B,cAAM,YAAY,KAAK,OAAO,KAAK,IAAA,IAAQ,SAAS,GAAI;AACxDC,cAAAA,kBAAkB,eAAe,SAAS,SAAS,SAAS,UAAU;AACtE,yBAAiB;AAAA,MAClB;AAAA,IACD,CAAC;AAED,UAAM,WAAW,MAAM,UAAU,QAAQ,KAAK,GAAG,QAAQ,IAAI,SAAS,aAAa,QAAQ,EAAE;AAC7F,UAAM,aAAaC,QAAAA,kBAAkB,QAAQ;AAE7C,UAAM,iBAAiB,CAAC,aACrB,SACA,OAAO,KAAKC,UAAAA,YAAY;AAE3B,UAAMC,SAAAA,SAAS,gBAAgB,UAAU;AAEzC,YAAQ,IAAI,gBAAgB;AAC5B,YAAQ,IAAI,iBAAiB,QAAQ,EAAE;AAAA,EACxC;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExportCommand.js","sources":["../../../../../../packages/cli/src/commands/transfer/ExportCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { createWriteStream } from 'node:fs'\nimport { maskToken } from '../../lib/maskToken'\nimport { pipeline } from 'node:stream/promises'\nimport { printProgressLine } from '../../lib/transfer/stdio'\nimport { createGunzip, createGzip } from 'node:zlib'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient'\nimport { Readable } from 'node:stream'\n\ntype Args = {\n\tsource?: string\n}\ntype Options = {\n\t'include-system'?: boolean\n\t/** @deprecated */\n\t'no-gzip'?: boolean\n\t'no-gzip-output'?: boolean\n\t'no-gzip-transfer'?: boolean\n\toutput?: string\n\t'exclude-table'?: string[]\n}\n\nexport class ExportCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Export data from a project')\n\t\tconfiguration.argument('source').optional()\n\t\tconfiguration.option('include-system').valueNone()\n\t\tconfiguration.option('no-gzip').valueNone().deprecated()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('no-gzip-output').valueNone()\n\t\tconfiguration.option('output').valueRequired()\n\t\tconfiguration.option('exclude-table').valueArray()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst from = input.getArgument('source')\n\t\tconst project = await this.remoteProjectResolver.resolve(from)\n\t\tif (!project) {\n\t\t\tthrow `Project not defined`\n\t\t}\n\n\t\tconsole.log('')\n\t\tconsole.log('Exporting data from a following project')\n\t\tconsole.log('')\n\t\tconsole.log(`Project name: ${project.name}`)\n\t\tconsole.log(`API URL: ${project.endpoint}`)\n\t\tconsole.log(`Token: ${maskToken(project.token)}`)\n\n\t\tconst gzipOutput = !input.getOption('no-gzip-output') && !input.getOption('no-gzip')\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\n\t\tconst includeSystem = input.getOption('include-system') === true\n\n\t\tconst response = await this.dataTransferClient.dataExport({\n\t\t\tproject,\n\t\t\texcludeTables: input.getOption('exclude-table') ?? [],\n\t\t\tincludeSystem,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tif (!response.body) {\n\t\t\tthrow new Error('Response does not contain a readable stream.')\n\t\t}\n\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tlet lastMbReported = 0\n\t\tconsole.log('')\n\t\tconst stream = Readable.fromWeb(response.body as any)\n\t\tstream.on('data', chunk => {\n\t\t\ttransferred += chunk.length\n\t\t\tconst currentMb = Math.floor(transferred / 1024 / 1024)\n\t\t\tif (currentMb > lastMbReported) {\n\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\tprintProgressLine(`transferred ${currentMb} MiB; ${durationS} seconds`)\n\t\t\t\tlastMbReported = currentMb\n\t\t\t}\n\t\t})\n\n\t\tconst fileName = input.getOption('output') ?? `${project.name}.jsonl${gzipOutput ? '.gz' : ''}`\n\t\tconst fileStream = createWriteStream(fileName)\n\n\t\tconst responseStream = !gzipOutput\n\t\t\t? stream\n\t\t\t: stream.pipe(createGzip())\n\n\t\tawait pipeline(responseStream, fileStream)\n\n\t\tconsole.log('\\nExport done.')\n\t\tconsole.log(`Data saved to ${fileName}`)\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAuBO,MAAM,sBAAsB,QAAuB;AAAA,EACzD,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,4BAA4B;AACtD,kBAAc,SAAS,QAAQ,EAAE,SAAA;AACjC,kBAAc,OAAO,gBAAgB,EAAE,UAAA;AACvC,kBAAc,OAAO,SAAS,EAAE,UAAA,EAAY,WAAA;AAC5C,kBAAc,OAAO,kBAAkB,EAAE,UAAA;AACzC,kBAAc,OAAO,gBAAgB,EAAE,UAAA;AACvC,kBAAc,OAAO,QAAQ,EAAE,cAAA;AAC/B,kBAAc,OAAO,eAAe,EAAE,WAAA;AAAA,EACvC;AAAA,EAEA,MAAgB,QAAQ,OAAqD;AAC5E,UAAM,OAAO,MAAM,YAAY,QAAQ;AACvC,UAAM,UAAU,MAAM,KAAK,sBAAsB,QAAQ,IAAI;AAC7D,QAAI,CAAC,SAAS;AACb,YAAM;AAAA,IACP;AAEA,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,yCAAyC;AACrD,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,iBAAiB,QAAQ,IAAI,EAAE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,"file":"ExportCommand.js","sources":["../../../../../../packages/cli/src/commands/transfer/ExportCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { createWriteStream } from 'node:fs'\nimport { maskToken } from '../../lib/maskToken.js'\nimport { pipeline } from 'node:stream/promises'\nimport { printProgressLine } from '../../lib/transfer/stdio.js'\nimport { createGunzip, createGzip } from 'node:zlib'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient.js'\nimport { Readable } from 'node:stream'\n\ntype Args = {\n\tsource?: string\n}\ntype Options = {\n\t'include-system'?: boolean\n\t/** @deprecated */\n\t'no-gzip'?: boolean\n\t'no-gzip-output'?: boolean\n\t'no-gzip-transfer'?: boolean\n\toutput?: string\n\t'exclude-table'?: string[]\n}\n\nexport class ExportCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Export data from a project')\n\t\tconfiguration.argument('source').optional()\n\t\tconfiguration.option('include-system').valueNone()\n\t\tconfiguration.option('no-gzip').valueNone().deprecated()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('no-gzip-output').valueNone()\n\t\tconfiguration.option('output').valueRequired()\n\t\tconfiguration.option('exclude-table').valueArray()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst from = input.getArgument('source')\n\t\tconst project = await this.remoteProjectResolver.resolve(from)\n\t\tif (!project) {\n\t\t\tthrow `Project not defined`\n\t\t}\n\n\t\tconsole.log('')\n\t\tconsole.log('Exporting data from a following project')\n\t\tconsole.log('')\n\t\tconsole.log(`Project name: ${project.name}`)\n\t\tconsole.log(`API URL: ${project.endpoint}`)\n\t\tconsole.log(`Token: ${maskToken(project.token)}`)\n\n\t\tconst gzipOutput = !input.getOption('no-gzip-output') && !input.getOption('no-gzip')\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\n\t\tconst includeSystem = input.getOption('include-system') === true\n\n\t\tconst response = await this.dataTransferClient.dataExport({\n\t\t\tproject,\n\t\t\texcludeTables: input.getOption('exclude-table') ?? [],\n\t\t\tincludeSystem,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tif (!response.body) {\n\t\t\tthrow new Error('Response does not contain a readable stream.')\n\t\t}\n\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tlet lastMbReported = 0\n\t\tconsole.log('')\n\t\tconst stream = Readable.fromWeb(response.body as any)\n\t\tstream.on('data', chunk => {\n\t\t\ttransferred += chunk.length\n\t\t\tconst currentMb = Math.floor(transferred / 1024 / 1024)\n\t\t\tif (currentMb > lastMbReported) {\n\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\tprintProgressLine(`transferred ${currentMb} MiB; ${durationS} seconds`)\n\t\t\t\tlastMbReported = currentMb\n\t\t\t}\n\t\t})\n\n\t\tconst fileName = input.getOption('output') ?? `${project.name}.jsonl${gzipOutput ? '.gz' : ''}`\n\t\tconst fileStream = createWriteStream(fileName)\n\n\t\tconst responseStream = !gzipOutput\n\t\t\t? stream\n\t\t\t: stream.pipe(createGzip())\n\n\t\tawait pipeline(responseStream, fileStream)\n\n\t\tconsole.log('\\nExport done.')\n\t\tconsole.log(`Data saved to ${fileName}`)\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAuBO,MAAM,sBAAsB,QAAuB;AAAA,EACzD,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,4BAA4B;AACtD,kBAAc,SAAS,QAAQ,EAAE,SAAA;AACjC,kBAAc,OAAO,gBAAgB,EAAE,UAAA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AM,cAAc,OAAO,IAAI;AACtD,UAAI,YAAY,gBAAgB;AAC/B,cAAM,YAAY,KAAK,OAAO,KAAK,IAAA,IAAQ,SAAS,GAAI;AACxD,0BAAkB,eAAe,SAAS,SAAS,SAAS,UAAU;AACtE,yBAAiB;AAAA,MAClB;AAAA,IACD,CAAC;AAED,UAAM,WAAW,MAAM,UAAU,QAAQ,KAAK,GAAG,QAAQ,IAAI,SAAS,aAAa,QAAQ,EAAE;AAC7F,UAAM,aAAa,kBAAkB,QAAQ;AAE7C,UAAM,iBAAiB,CAAC,aACrB,SACA,OAAO,KAAK,YAAY;AAE3B,UAAM,SAAS,gBAAgB,UAAU;AAEzC,YAAQ,IAAI,gBAAgB;AAC5B,YAAQ,IAAI,iBAAiB,QAAQ,EAAE;AAAA,EACxC;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ImportCommand.cjs","sources":["../../../../../../packages/cli/src/commands/transfer/ImportCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { createReadStream } from 'node:fs'\nimport { createGunzip } from 'node:zlib'\nimport { confirmImport } from './utils'\nimport { maskToken } from '../../lib/maskToken'\nimport { printProgressLine } from '../../lib/transfer/stdio'\nimport { readStream } from '../../lib/stream'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient'\n\ntype Args = {\n\tfile: string\n\ttarget?: string\n}\ntype Options = {\n\t'yes': boolean\n\t'no-gzip-transfer'?: boolean\n}\n\nexport class ImportCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Import data into a project')\n\t\tconfiguration.argument('file')\n\t\tconfiguration.argument('target').optional()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('yes').valueNone()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst target = input.getArgument('target')\n\t\tconst project = await this.remoteProjectResolver.resolve(target)\n\t\tif (!project) {\n\t\t\tthrow `Target project not defined`\n\t\t}\n\t\tconsole.log('')\n\t\tconsole.log('Importing data into a following project')\n\t\tconsole.log('')\n\t\tconsole.log(`Project name: ${project.name}`)\n\t\tconsole.log(`API URL: ${project.endpoint}`)\n\t\tconsole.log(`Token: ${maskToken(project.token)}`)\n\t\tconsole.log('')\n\t\tif (!await confirmImport(input)) {\n\t\t\treturn 1\n\t\t}\n\t\tconst file = input.getArgument('file')\n\t\tconst baseInputStream = createReadStream(file)\n\t\tconst stream = file.endsWith('.gz') ? baseInputStream.pipe(createGunzip()) : baseInputStream\n\t\tstream.on('error', (err: any) => {\n\t\t\tconsole.error('Error in import stream:', err)\n\t\t})\n\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\t\tconst response = await this.dataTransferClient.dataImport({\n\t\t\tstream: stream,\n\t\t\tproject,\n\t\t\tprintProgress: printProgressLine,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconsole.log('')\n\t\tconst responseData = await response.json()\n\t\tif (responseData.ok) {\n\t\t\tconsole.log('Import done.')\n\t\t} else {\n\t\t\tconsole.error('Import failed:')\n\t\t\tconsole.log(responseData)\n\t\t\treturn 1\n\t\t}\n\t}\n}\n"],"names":["Command","maskToken","confirmImport","createReadStream","createGunzip","printProgressLine"],"mappings":";;;;;;;;AAmBO,MAAM,sBAAsBA,UAAAA,QAAuB;AAAA,EACzD,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,4BAA4B;AACtD,kBAAc,SAAS,MAAM;AAC7B,kBAAc,SAAS,QAAQ,EAAE,SAAA;AACjC,kBAAc,OAA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Command.cjs","sources":["../../../../../../packages/cli/src/commands/transfer/ImportCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { createReadStream } from 'node:fs'\nimport { createGunzip } from 'node:zlib'\nimport { confirmImport } from './utils.js'\nimport { maskToken } from '../../lib/maskToken.js'\nimport { printProgressLine } from '../../lib/transfer/stdio.js'\nimport { readStream } from '../../lib/stream.js'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient.js'\n\ntype Args = {\n\tfile: string\n\ttarget?: string\n}\ntype Options = {\n\t'yes': boolean\n\t'no-gzip-transfer'?: boolean\n}\n\nexport class ImportCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Import data into a project')\n\t\tconfiguration.argument('file')\n\t\tconfiguration.argument('target').optional()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('yes').valueNone()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst target = input.getArgument('target')\n\t\tconst project = await this.remoteProjectResolver.resolve(target)\n\t\tif (!project) {\n\t\t\tthrow `Target project not defined`\n\t\t}\n\t\tconsole.log('')\n\t\tconsole.log('Importing data into a following project')\n\t\tconsole.log('')\n\t\tconsole.log(`Project name: ${project.name}`)\n\t\tconsole.log(`API URL: ${project.endpoint}`)\n\t\tconsole.log(`Token: ${maskToken(project.token)}`)\n\t\tconsole.log('')\n\t\tif (!await confirmImport(input)) {\n\t\t\treturn 1\n\t\t}\n\t\tconst file = input.getArgument('file')\n\t\tconst baseInputStream = createReadStream(file)\n\t\tconst stream = file.endsWith('.gz') ? baseInputStream.pipe(createGunzip()) : baseInputStream\n\t\tstream.on('error', (err: any) => {\n\t\t\tconsole.error('Error in import stream:', err)\n\t\t})\n\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\t\tconst response = await this.dataTransferClient.dataImport({\n\t\t\tstream: stream,\n\t\t\tproject,\n\t\t\tprintProgress: printProgressLine,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconsole.log('')\n\t\tconst responseData = await response.json()\n\t\tif (responseData.ok) {\n\t\t\tconsole.log('Import done.')\n\t\t} else {\n\t\t\tconsole.error('Import failed:')\n\t\t\tconsole.log(responseData)\n\t\t\treturn 1\n\t\t}\n\t}\n}\n"],"names":["Command","maskToken","confirmImport","createReadStream","createGunzip","printProgressLine"],"mappings":";;;;;;;;AAmBO,MAAM,sBAAsBA,UAAAA,QAAuB;AAAA,EACzD,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,4BAA4B;AACtD,kBAAc,SAAS,MAAM;AAC7B,kBAAc,SAAS,QAAQ,EAAE,SAAA;AACjC,kBAAc,OAAO,kBAAkB,EAAE,UAAA;AACzC,kBAAc,OAAO,KAAK,EAAE,UAAA;AAAA,EAC7B;AAAA,EAEA,MAAgB,QAAQ,OAAqD;AAC5E,UAAM,SAAS,MAAM,YAAY,QAAQ;AACzC,UAAM,UAAU,MAAM,KAAK,sBAAsB,QAAQ,MAAM;AAC/D,QAAI,CAAC,SAAS;AACb,YAAM;AAAA,IACP;AACA,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,yCAAyC;AACrD,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,iBAAiB,QAAQ,IAAI,EAAE;AAC3C,YAAQ,IAAI,YAAY,QAAQ,QAAQ,EAAE;AAC1C,YAAQ,IAAI,UAAUC,UAAAA,UAAU,QAAQ,KAAK,CAAC,EAAE;AAChD,YAAQ,IAAI,EAAE;AACd,QAAI,CAAC,MAAMC,oBAAc,KAAK,GAAG;AAChC,aAAO;AAAA,IACR;AACA,UAAM,OAAO,MAAM,YAAY,MAAM;AACrC,UAAM,kBAAkBC,QAAAA,iBAAiB,IAAI;AAC7C,UAAM,SAAS,KAAK,SAAS,KAAK,IAAI,gBAAgB,KAAKC,uBAAA,CAAc,IAAI;AAC7E,WAAO,GAAG,SAAS,CAAC,QAAa;AAChC,cAAQ,MAAM,2BAA2B,GAAG;AAAA,IAC7C,CAAC;AAED,UAAM,eAAe,CAAC,MAAM,UAAU,kBAAkB;AACxD,UAAM,WAAW,MAAM,KAAK,mBAAmB,WAAW;AAAA,MACzD;AAAA,MACA;AAAA,MACA,eAAeC,MAAAA;AAAAA,MACf,MAAM;AAAA,IAAA,CACN;AACD,YAAQ,IAAI,EAAE;AACd,UAAM,eAAe,MAAM,SAAS,KAAA;AACpC,QAAI,aAAa,IAAI;AACpB,cAAQ,IAAI,cAAc;AAAA,IAC3B,OAAO;AACN,cAAQ,MAAM,gBAAgB;AAC9B,cAAQ,IAAI,YAAY;AACxB,aAAO;AAAA,IACR;AAAA,EACD;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ImportCommand.js","sources":["../../../../../../packages/cli/src/commands/transfer/ImportCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { createReadStream } from 'node:fs'\nimport { createGunzip } from 'node:zlib'\nimport { confirmImport } from './utils'\nimport { maskToken } from '../../lib/maskToken'\nimport { printProgressLine } from '../../lib/transfer/stdio'\nimport { readStream } from '../../lib/stream'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient'\n\ntype Args = {\n\tfile: string\n\ttarget?: string\n}\ntype Options = {\n\t'yes': boolean\n\t'no-gzip-transfer'?: boolean\n}\n\nexport class ImportCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Import data into a project')\n\t\tconfiguration.argument('file')\n\t\tconfiguration.argument('target').optional()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('yes').valueNone()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst target = input.getArgument('target')\n\t\tconst project = await this.remoteProjectResolver.resolve(target)\n\t\tif (!project) {\n\t\t\tthrow `Target project not defined`\n\t\t}\n\t\tconsole.log('')\n\t\tconsole.log('Importing data into a following project')\n\t\tconsole.log('')\n\t\tconsole.log(`Project name: ${project.name}`)\n\t\tconsole.log(`API URL: ${project.endpoint}`)\n\t\tconsole.log(`Token: ${maskToken(project.token)}`)\n\t\tconsole.log('')\n\t\tif (!await confirmImport(input)) {\n\t\t\treturn 1\n\t\t}\n\t\tconst file = input.getArgument('file')\n\t\tconst baseInputStream = createReadStream(file)\n\t\tconst stream = file.endsWith('.gz') ? baseInputStream.pipe(createGunzip()) : baseInputStream\n\t\tstream.on('error', (err: any) => {\n\t\t\tconsole.error('Error in import stream:', err)\n\t\t})\n\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\t\tconst response = await this.dataTransferClient.dataImport({\n\t\t\tstream: stream,\n\t\t\tproject,\n\t\t\tprintProgress: printProgressLine,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconsole.log('')\n\t\tconst responseData = await response.json()\n\t\tif (responseData.ok) {\n\t\t\tconsole.log('Import done.')\n\t\t} else {\n\t\t\tconsole.error('Import failed:')\n\t\t\tconsole.log(responseData)\n\t\t\treturn 1\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAmBO,MAAM,sBAAsB,QAAuB;AAAA,EACzD,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;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MAAM,gBAAgB;AAC9B,cAAQ,IAAI,YAAY;AACxB,aAAO;AAAA,IACR;AAAA,EACD;AACD;"}
1
+ {"version":3,"file":"ImportCommand.js","sources":["../../../../../../packages/cli/src/commands/transfer/ImportCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { createReadStream } from 'node:fs'\nimport { createGunzip } from 'node:zlib'\nimport { confirmImport } from './utils.js'\nimport { maskToken } from '../../lib/maskToken.js'\nimport { printProgressLine } from '../../lib/transfer/stdio.js'\nimport { readStream } from '../../lib/stream.js'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient.js'\n\ntype Args = {\n\tfile: string\n\ttarget?: string\n}\ntype Options = {\n\t'yes': boolean\n\t'no-gzip-transfer'?: boolean\n}\n\nexport class ImportCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Import data into a project')\n\t\tconfiguration.argument('file')\n\t\tconfiguration.argument('target').optional()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('yes').valueNone()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst target = input.getArgument('target')\n\t\tconst project = await this.remoteProjectResolver.resolve(target)\n\t\tif (!project) {\n\t\t\tthrow `Target project not defined`\n\t\t}\n\t\tconsole.log('')\n\t\tconsole.log('Importing data into a following project')\n\t\tconsole.log('')\n\t\tconsole.log(`Project name: ${project.name}`)\n\t\tconsole.log(`API URL: ${project.endpoint}`)\n\t\tconsole.log(`Token: ${maskToken(project.token)}`)\n\t\tconsole.log('')\n\t\tif (!await confirmImport(input)) {\n\t\t\treturn 1\n\t\t}\n\t\tconst file = input.getArgument('file')\n\t\tconst baseInputStream = createReadStream(file)\n\t\tconst stream = file.endsWith('.gz') ? baseInputStream.pipe(createGunzip()) : baseInputStream\n\t\tstream.on('error', (err: any) => {\n\t\t\tconsole.error('Error in import stream:', err)\n\t\t})\n\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\t\tconst response = await this.dataTransferClient.dataImport({\n\t\t\tstream: stream,\n\t\t\tproject,\n\t\t\tprintProgress: printProgressLine,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconsole.log('')\n\t\tconst responseData = await response.json()\n\t\tif (responseData.ok) {\n\t\t\tconsole.log('Import done.')\n\t\t} else {\n\t\t\tconsole.error('Import failed:')\n\t\t\tconsole.log(responseData)\n\t\t\treturn 1\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAmBO,MAAM,sBAAsB,QAAuB;AAAA,EACzD,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,4BAA4B;AACtD,kBAAc,SAAS,MAAM;AAC7B,kBAAc,SAAS,QAAQ,EAAE,SAAA;AACjC,kBAAc,OAAO,kBAAkB,EAAE,UAAA;AACzC,kBAAc,OAAO,KAAK,EAAE,UAAA;AAAA,EAC7B;AAAA,EAEA,MAAgB,QAAQ,OAAqD;AAC5E,UAAM,SAAS,MAAM,YAAY,QAAQ;AACzC,UAAM,UAAU,MAAM,KAAK,sBAAsB,QAAQ,MAAM;AAC/D,QAAI,CAAC,SAAS;AACb,YAAM;AAAA,IACP;AACA,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,yCAAyC;AACrD,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,iBAAiB,QAAQ,IAAI,EAAE;AAC3C,YAAQ,IAAI,YAAY,QAAQ,QAAQ,EAAE;AAC1C,YAAQ,IAAI,UAAU,UAAU,QAAQ,KAAK,CAAC,EAAE;AAChD,YAAQ,IAAI,EAAE;AACd,QAAI,CAAC,MAAM,cAAc,KAAK,GAAG;AAChC,aAAO;AAAA,IACR;AACA,UAAM,OAAO,MAAM,YAAY,MAAM;AACrC,UAAM,kBAAkB,iBAAiB,IAAI;AAC7C,UAAM,SAAS,KAAK,SAAS,KAAK,IAAI,gBAAgB,KAAK,aAAA,CAAc,IAAI;AAC7E,WAAO,GAAG,SAAS,CAAC,QAAa;AAChC,cAAQ,MAAM,2BAA2B,GAAG;AAAA,IAC7C,CAAC;AAED,UAAM,eAAe,CAAC,MAAM,UAAU,kBAAkB;AACxD,UAAM,WAAW,MAAM,KAAK,mBAAmB,WAAW;AAAA,MACzD;AAAA,MACA;AAAA,MACA,eAAe;AAAA,MACf,MAAM;AAAA,IAAA,CACN;AACD,YAAQ,IAAI,EAAE;AACd,UAAM,eAAe,MAAM,SAAS,KAAA;AACpC,QAAI,aAAa,IAAI;AACpB,cAAQ,IAAI,cAAc;AAAA,IAC3B,OAAO;AACN,cAAQ,MAAM,gBAAgB;AAC9B,cAAQ,IAAI,YAAY;AACxB,aAAO;AAAA,IACR;AAAA,EACD;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TransferCommand.cjs","sources":["../../../../../../packages/cli/src/commands/transfer/TransferCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { confirmImport } from './utils'\nimport { maskToken } from '../../lib/maskToken'\nimport { printProgressLine } from '../../lib/transfer/stdio'\nimport { readStream } from '../../lib/stream'\nimport { createGunzip } from 'node:zlib'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient'\nimport { Duplex, Readable } from 'node:stream'\n\ntype Args = {\n\tsource: string\n\ttarget: string\n}\ntype Options = {\n\t'include-system'?: boolean\n\t'no-gzip-transfer'?: boolean\n\tyes: boolean\n\t'exclude-table'?: string[]\n}\n\nexport class TransferCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Transfer data between projects')\n\t\tconfiguration.argument('source')\n\t\tconfiguration.argument('target').optional()\n\t\tconfiguration.option('include-system').valueNone()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('yes').valueNone()\n\t\tconfiguration.option('exclude-table').valueArray()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst source = input.getArgument('source')\n\t\tconst sourceProject = await this.remoteProjectResolver.resolve(source)\n\t\tif (!sourceProject) {\n\t\t\tthrow `Source project not defined`\n\t\t}\n\n\t\tconst target = input.getArgument('target')\n\t\tconst targetProject = await this.remoteProjectResolver.resolve(target)\n\t\tif (!targetProject) {\n\t\t\tthrow `Target project not defined`\n\t\t}\n\n\t\tconsole.log('')\n\t\tconsole.log('Transferring data between projects:')\n\t\tconsole.log('')\n\t\tconsole.log(`Source project name: ${sourceProject.name}`)\n\t\tconsole.log(`Source API URL: ${sourceProject.endpoint}`)\n\t\tconsole.log(`Source token: ${maskToken(sourceProject.token)}`)\n\t\tconsole.log('')\n\t\tconsole.log(`Target project name: ${targetProject.name}`)\n\t\tconsole.log(`Target API URL: ${targetProject.endpoint}`)\n\t\tconsole.log(`Target token: ${maskToken(targetProject.token)}`)\n\t\tconsole.log('')\n\t\tif (!await confirmImport(input)) {\n\t\t\treturn 1\n\t\t}\n\n\t\tconst includeSystem = input.getOption('include-system') === true\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\t\tconst exportResponse = await this.dataTransferClient.dataExport({\n\t\t\tproject: sourceProject,\n\t\t\tincludeSystem,\n\t\t\texcludeTables: input.getOption('exclude-table') ?? [],\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconst stream = Readable.fromWeb(exportResponse.body! as any)\n\t\tconst importResponse = await this.dataTransferClient.dataImport({\n\t\t\tstream: stream,\n\t\t\tproject: targetProject,\n\t\t\tprintProgress: printProgressLine,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconsole.log('')\n\n\t\tconst responseData = await importResponse.json()\n\t\tif (responseData.ok) {\n\t\t\tconsole.log('Transfer done.')\n\t\t} else {\n\t\t\tconsole.error('Transfer failed:')\n\t\t\tconsole.log(responseData)\n\t\t}\n\t}\n}\n"],"names":["Command","maskToken","confirmImport","Readable","printProgressLine"],"mappings":";;;;;;;AAqBO,MAAM,wBAAwBA,UAAAA,QAAuB;AAAA,EAC3D,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,gCAAgC;AAC1D,kBAAc,SAAS,QAAQ;AAC/B,kBAAc,SAAS,QAAQ,EAAE,SAAA;AACjC,kBAAc,OAAO,gBAAgB,EAAE,UAAA;AACvC,kBAAc,OAAO,kBAAkB,EAAE,UAAA;AACzC,kBAAc,OAAO,KAAK,EAAE,UAAA;AAC5B,kBAAc,OAAO,eAAe,EAAE,WAAA;AAAA,EACvC;AAAA,EAEA,MAAgB,QAAQ,OAAqD;AAC5E,UAAM,SAAS,MAAM,YAAY,QAAQ;AACzC,UAAM,gBAAgB,MAAM,KAAK,sBAAsB,QAAQ,MAAM;AACrE,QAAI,CAAC,eAAe;AACnB,YAAM;AAAA,IACP;AAEA,UAAM,SAAS,MAAM,YAAY,QAAQ;AACzC,UAAM,gBAAgB,MAAM,KAAK,sBAAsB,QAAQ,MAAM;AACrE,QAAI,CAAC,eAAe;AACnB,YAAM;AAAA,IACP;AAEA,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,qCAAqC;AACjD,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,wBAAwB,cAAc,IAAI,EAAE;AACxD,YAAQ,IAAI,mBAAmB,cAAc,QAAQ,EAAE;AACvD,YAAQ,IAAI,iBAAiBC,UAAAA,UAAU,cAAc,KAAK,CAAC,EAAE;AAC7D,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,wBAAwB,cAAc,IAAI,EAAE;AACxD,YAAQ,IAAI,mBAAmB,cAAc,QAAQ,EAAE;AACvD,YAAQ,IAAI,iBAAiBA,UAAAA,UAAU,cAAc,KAAK,CAAC,EAAE;AAC7D,YAAQ,IAAI,EAAE;AACd,QAAI,CAAC,MAAMC,oBAAc,KAAK,GAAG;AAChC,aAAO;AAAA,IACR;AAEA,UAAM,gBAAgB,MAAM,UAAU,gBAAgB,MAAM;AAC5D,UAAM,eAAe,CAAC,MAAM,UAAU,kBAAkB;AACxD,UAAM,iBAAiB,MAAM,KAAK,mBAAmB,WAAW;AAAA,MAC/D,SAAS;AAAA,MACT;AAAA,MACA,eAAe,MAAM,UAAU,eAAe,KAAK,CAAA;AAAA,MACnD,MAAM;AAAA,IAAA,CACN;AACD,UAAM,SAASC,YAAAA,SAAS,QAAQ,eAAe,IAAY;AAC3D,UAAM,iBAAiB,MAAM,KAAK,mBAAmB,WAAW;AAAA,MAC/D;AAAA,MACA,SAAS;AAAA,MACT,eAAeC,MAAAA;AAAAA,MACf,MAAM;AAAA,IAAA,CACN;AACD,YAAQ,IAAI,EAAE;AAEd,UAAM,eAAe,MAAM,eAAe,KAAA;AAC1C,QAAI,aAAa,IAAI;AACpB,cAAQ,IAAI,gBAAgB;AAAA,IAC7B,OAAO;AACN,cAAQ,MAAM,kBAAkB;AAChC,cAAQ,IAAI,YAAY;AAAA,IACzB;AAAA,EACD;AACD;;"}
1
+ {"version":3,"file":"TransferCommand.cjs","sources":["../../../../../../packages/cli/src/commands/transfer/TransferCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { confirmImport } from './utils.js'\nimport { maskToken } from '../../lib/maskToken.js'\nimport { printProgressLine } from '../../lib/transfer/stdio.js'\nimport { readStream } from '../../lib/stream.js'\nimport { createGunzip } from 'node:zlib'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient.js'\nimport { Duplex, Readable } from 'node:stream'\n\ntype Args = {\n\tsource: string\n\ttarget: string\n}\ntype Options = {\n\t'include-system'?: boolean\n\t'no-gzip-transfer'?: boolean\n\tyes: boolean\n\t'exclude-table'?: string[]\n}\n\nexport class TransferCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Transfer data between projects')\n\t\tconfiguration.argument('source')\n\t\tconfiguration.argument('target').optional()\n\t\tconfiguration.option('include-system').valueNone()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('yes').valueNone()\n\t\tconfiguration.option('exclude-table').valueArray()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst source = input.getArgument('source')\n\t\tconst sourceProject = await this.remoteProjectResolver.resolve(source)\n\t\tif (!sourceProject) {\n\t\t\tthrow `Source project not defined`\n\t\t}\n\n\t\tconst target = input.getArgument('target')\n\t\tconst targetProject = await this.remoteProjectResolver.resolve(target)\n\t\tif (!targetProject) {\n\t\t\tthrow `Target project not defined`\n\t\t}\n\n\t\tconsole.log('')\n\t\tconsole.log('Transferring data between projects:')\n\t\tconsole.log('')\n\t\tconsole.log(`Source project name: ${sourceProject.name}`)\n\t\tconsole.log(`Source API URL: ${sourceProject.endpoint}`)\n\t\tconsole.log(`Source token: ${maskToken(sourceProject.token)}`)\n\t\tconsole.log('')\n\t\tconsole.log(`Target project name: ${targetProject.name}`)\n\t\tconsole.log(`Target API URL: ${targetProject.endpoint}`)\n\t\tconsole.log(`Target token: ${maskToken(targetProject.token)}`)\n\t\tconsole.log('')\n\t\tif (!await confirmImport(input)) {\n\t\t\treturn 1\n\t\t}\n\n\t\tconst includeSystem = input.getOption('include-system') === true\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\t\tconst exportResponse = await this.dataTransferClient.dataExport({\n\t\t\tproject: sourceProject,\n\t\t\tincludeSystem,\n\t\t\texcludeTables: input.getOption('exclude-table') ?? [],\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconst stream = Readable.fromWeb(exportResponse.body! as any)\n\t\tconst importResponse = await this.dataTransferClient.dataImport({\n\t\t\tstream: stream,\n\t\t\tproject: targetProject,\n\t\t\tprintProgress: printProgressLine,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconsole.log('')\n\n\t\tconst responseData = await importResponse.json()\n\t\tif (responseData.ok) {\n\t\t\tconsole.log('Transfer done.')\n\t\t} else {\n\t\t\tconsole.error('Transfer failed:')\n\t\t\tconsole.log(responseData)\n\t\t}\n\t}\n}\n"],"names":["Command","maskToken","confirmImport","Readable","printProgressLine"],"mappings":";;;;;;;AAqBO,MAAM,wBAAwBA,UAAAA,QAAuB;AAAA,EAC3D,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,gCAAgC;AAC1D,kBAAc,SAAS,QAAQ;AAC/B,kBAAc,SAAS,QAAQ,EAAE,SAAA;AACjC,kBAAc,OAAO,gBAAgB,EAAE,UAAA;AACvC,kBAAc,OAAO,kBAAkB,EAAE,UAAA;AACzC,kBAAc,OAAO,KAAK,EAAE,UAAA;AAC5B,kBAAc,OAAO,eAAe,EAAE,WAAA;AAAA,EACvC;AAAA,EAEA,MAAgB,QAAQ,OAAqD;AAC5E,UAAM,SAAS,MAAM,YAAY,QAAQ;AACzC,UAAM,gBAAgB,MAAM,KAAK,sBAAsB,QAAQ,MAAM;AACrE,QAAI,CAAC,e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AA,IAC7B,OAAO;AACN,cAAQ,MAAM,kBAAkB;AAChC,cAAQ,IAAI,YAAY;AAAA,IACzB;AAAA,EACD;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TransferCommand.js","sources":["../../../../../../packages/cli/src/commands/transfer/TransferCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { confirmImport } from './utils'\nimport { maskToken } from '../../lib/maskToken'\nimport { printProgressLine } from '../../lib/transfer/stdio'\nimport { readStream } from '../../lib/stream'\nimport { createGunzip } from 'node:zlib'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient'\nimport { Duplex, Readable } from 'node:stream'\n\ntype Args = {\n\tsource: string\n\ttarget: string\n}\ntype Options = {\n\t'include-system'?: boolean\n\t'no-gzip-transfer'?: boolean\n\tyes: boolean\n\t'exclude-table'?: string[]\n}\n\nexport class TransferCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Transfer data between projects')\n\t\tconfiguration.argument('source')\n\t\tconfiguration.argument('target').optional()\n\t\tconfiguration.option('include-system').valueNone()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('yes').valueNone()\n\t\tconfiguration.option('exclude-table').valueArray()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst source = input.getArgument('source')\n\t\tconst sourceProject = await this.remoteProjectResolver.resolve(source)\n\t\tif (!sourceProject) {\n\t\t\tthrow `Source project not defined`\n\t\t}\n\n\t\tconst target = input.getArgument('target')\n\t\tconst targetProject = await this.remoteProjectResolver.resolve(target)\n\t\tif (!targetProject) {\n\t\t\tthrow `Target project not defined`\n\t\t}\n\n\t\tconsole.log('')\n\t\tconsole.log('Transferring data between projects:')\n\t\tconsole.log('')\n\t\tconsole.log(`Source project name: ${sourceProject.name}`)\n\t\tconsole.log(`Source API URL: ${sourceProject.endpoint}`)\n\t\tconsole.log(`Source token: ${maskToken(sourceProject.token)}`)\n\t\tconsole.log('')\n\t\tconsole.log(`Target project name: ${targetProject.name}`)\n\t\tconsole.log(`Target API URL: ${targetProject.endpoint}`)\n\t\tconsole.log(`Target token: ${maskToken(targetProject.token)}`)\n\t\tconsole.log('')\n\t\tif (!await confirmImport(input)) {\n\t\t\treturn 1\n\t\t}\n\n\t\tconst includeSystem = input.getOption('include-system') === true\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\t\tconst exportResponse = await this.dataTransferClient.dataExport({\n\t\t\tproject: sourceProject,\n\t\t\tincludeSystem,\n\t\t\texcludeTables: input.getOption('exclude-table') ?? [],\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconst stream = Readable.fromWeb(exportResponse.body! as any)\n\t\tconst importResponse = await this.dataTransferClient.dataImport({\n\t\t\tstream: stream,\n\t\t\tproject: targetProject,\n\t\t\tprintProgress: printProgressLine,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconsole.log('')\n\n\t\tconst responseData = await importResponse.json()\n\t\tif (responseData.ok) {\n\t\t\tconsole.log('Transfer done.')\n\t\t} else {\n\t\t\tconsole.error('Transfer failed:')\n\t\t\tconsole.log(responseData)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,wBAAwB,QAAuB;AAAA,EAC3D,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,gCAAgC;AAC1D,kBAAc,SAAS,QAAQ;AAC/B,kBAAc,SAAS,QAAQ,EAAE,SAAA;AACjC,kBAAc,OAAO,gBAAgB,EAAE,UAAA;AACvC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,iBAAiB,MAAM,KAAK,mBAAmB,WAAW;AAAA,MAC/D;AAAA,MACA,SAAS;AAAA,MACT,eAAe;AAAA,MACf,MAAM;AAAA,IAAA,CACN;AACD,YAAQ,IAAI,EAAE;AAEd,UAAM,eAAe,MAAM,eAAe,KAAA;AAC1C,QAAI,aAAa,IAAI;AACpB,cAAQ,IAAI,gBAAgB;AAAA,IAC7B,OAAO;AACN,cAAQ,MAAM,kBAAkB;AAChC,cAAQ,IAAI,YAAY;AAAA,IACzB;AAAA,EACD;AACD;"}
1
+ {"version":3,"file":"TransferCommand.js","sources":["../../../../../../packages/cli/src/commands/transfer/TransferCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { confirmImport } from './utils.js'\nimport { maskToken } from '../../lib/maskToken.js'\nimport { printProgressLine } from '../../lib/transfer/stdio.js'\nimport { readStream } from '../../lib/stream.js'\nimport { createGunzip } from 'node:zlib'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient.js'\nimport { Duplex, Readable } from 'node:stream'\n\ntype Args = {\n\tsource: string\n\ttarget: string\n}\ntype Options = {\n\t'include-system'?: boolean\n\t'no-gzip-transfer'?: boolean\n\tyes: boolean\n\t'exclude-table'?: string[]\n}\n\nexport class TransferCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Transfer data between projects')\n\t\tconfiguration.argument('source')\n\t\tconfiguration.argument('target').optional()\n\t\tconfiguration.option('include-system').valueNone()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('yes').valueNone()\n\t\tconfiguration.option('exclude-table').valueArray()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst source = input.getArgument('source')\n\t\tconst sourceProject = await this.remoteProjectResolver.resolve(source)\n\t\tif (!sourceProject) {\n\t\t\tthrow `Source project not defined`\n\t\t}\n\n\t\tconst target = input.getArgument('target')\n\t\tconst targetProject = await this.remoteProjectResolver.resolve(target)\n\t\tif (!targetProject) {\n\t\t\tthrow `Target project not defined`\n\t\t}\n\n\t\tconsole.log('')\n\t\tconsole.log('Transferring data between projects:')\n\t\tconsole.log('')\n\t\tconsole.log(`Source project name: ${sourceProject.name}`)\n\t\tconsole.log(`Source API URL: ${sourceProject.endpoint}`)\n\t\tconsole.log(`Source token: ${maskToken(sourceProject.token)}`)\n\t\tconsole.log('')\n\t\tconsole.log(`Target project name: ${targetProject.name}`)\n\t\tconsole.log(`Target API URL: ${targetProject.endpoint}`)\n\t\tconsole.log(`Target token: ${maskToken(targetProject.token)}`)\n\t\tconsole.log('')\n\t\tif (!await confirmImport(input)) {\n\t\t\treturn 1\n\t\t}\n\n\t\tconst includeSystem = input.getOption('include-system') === true\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\t\tconst exportResponse = await this.dataTransferClient.dataExport({\n\t\t\tproject: sourceProject,\n\t\t\tincludeSystem,\n\t\t\texcludeTables: input.getOption('exclude-table') ?? [],\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconst stream = Readable.fromWeb(exportResponse.body! as any)\n\t\tconst importResponse = await this.dataTransferClient.dataImport({\n\t\t\tstream: stream,\n\t\t\tproject: targetProject,\n\t\t\tprintProgress: printProgressLine,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconsole.log('')\n\n\t\tconst responseData = await importResponse.json()\n\t\tif (responseData.ok) {\n\t\t\tconsole.log('Transfer done.')\n\t\t} else {\n\t\t\tconsole.error('Transfer failed:')\n\t\t\tconsole.log(responseData)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,wBAAwB,QAAuB;AAAA,EAC3D,YACkB,uBACA,oBA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AAM,UAAU,kBAAkB;AACxD,UAAM,iBAAiB,MAAM,KAAK,mBAAmB,WAAW;AAAA,MAC/D,SAAS;AAAA,MACT;AAAA,MACA,eAAe,MAAM,UAAU,eAAe,KAAK,CAAA;AAAA,MACnD,MAAM;AAAA,IAAA,CACN;AACD,UAAM,SAAS,SAAS,QAAQ,eAAe,IAAY;AAC3D,UAAM,iBAAiB,MAAM,KAAK,mBAAmB,WAAW;AAAA,MAC/D;AAAA,MACA,SAAS;AAAA,MACT,eAAe;AAAA,MACf,MAAM;AAAA,IAAA,CACN;AACD,YAAQ,IAAI,EAAE;AAEd,UAAM,eAAe,MAAM,eAAe,KAAA;AAC1C,QAAI,aAAa,IAAI;AACpB,cAAQ,IAAI,gBAAgB;AAAA,IAC7B,OAAO;AACN,cAAQ,MAAM,kBAAkB;AAChC,cAAQ,IAAI,YAAY;AAAA,IACzB;AAAA,EACD;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceUpdateApiCommand.cjs","sources":["../../../../../../packages/cli/src/commands/workspace/WorkspaceUpdateApiCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input, PackageWorkspaceResolver } from '@contember/cli-common'\nimport { DockerComposeManager } from '../../lib/fs/DockerComposeManager'\nimport { contemberDockerImages } from '../../consts'\n\ntype Args = {\n\tversion: string\n}\n\ntype Options = {}\n\nexport class WorkspaceUpdateApiCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly packageWorkspaceResolver: PackageWorkspaceResolver,\n\t\tprivate readonly dockerComposeManager: DockerComposeManager,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Updates Contember API version and all related packages')\n\t\tconfiguration.argument('version')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst version = input.getArgument('version')\n\t\tconst packageWorkspace = await this.packageWorkspaceResolver.resolve()\n\n\t\tawait packageWorkspace.updateEverywhere({\n\t\t\t'@contember/schema': version,\n\t\t\t'@contember/schema-definition': version,\n\t\t\t'@contember/cli': version,\n\t\t})\n\n\t\tconsole.log('Updating docker-compose')\n\t\tconst getNewImage = (currentImage: string): string | null => {\n\t\t\tfor (const candidate of contemberDockerImages) {\n\t\t\t\tif (currentImage.startsWith(`${candidate}:`)) {\n\t\t\t\t\treturn `${candidate.replace(/-ee$/, '')}:${version}`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null\n\t\t}\n\t\tawait this.dockerComposeManager.updateMainDockerComposeConfig(data => ({\n\t\t\t...data,\n\t\t\tservices: Object.fromEntries(\n\t\t\t\tObject.entries(data?.services ?? {}).map(([name, service]: [string, any]) => {\n\t\t\t\t\tconst newImage = getNewImage(service.image)\n\t\t\t\t\tif (newImage) {\n\t\t\t\t\t\tconsole.log(`docker-compose service ${name} updated`)\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...service,\n\t\t\t\t\t\t\t\timage: newImage,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\treturn [name, service]\n\t\t\t\t}),\n\t\t\t),\n\t\t}))\n\t\tconsole.log('API versions updated')\n\t\tconsole.log('Restart server to apply changes')\n\t}\n}\n"],"names":["Command","contemberDockerImages"],"mappings":";;;;AAUO,MAAM,kCAAkCA,UAAAA,QAAuB;AAAA,EACrE,YACkB,0BACA,sBAChB;AACD,UAAA;AAHiB,SAAA,2BAAA;AACA,SAAA,uBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,wDAAwD;AAClF,kBAAc,SAAS,SAAS;AAAA,EACjC;AAAA,EAEA,MAAgB,QAAQ,OAA4C;AACnE,UAAM,UAAU,MAAM,YAAY,SAAS;AAC3C,UAAM,mBAAmB,MAAM,KAAK,yBAAyB,QAAA;AAE7D,UAAM,iBAAiB,iBAAiB;AAAA,MACvC,qBAAqB;AAAA,MACrB,gCAAgC;AAAA,MAChC,kBAAkB;AAAA,IAAA,CAClB;AAED,YAAQ,IAAI,yBAAyB;AACrC,UAAM,cAAc,CAAC,iBAAwC;AAC5D,iBAAW,aAAaC,8BAAuB;AAC9C,YAAI,aAAa,WAAW,GAAG,SAAS,GAAG,GAAG;AAC7C,iBAAO,GAAG,UAAU,QAAQ,QAAQ,EAAE,CAAC,IAAI,OAAO;AAAA,QACnD;AAAA,MACD;AACA,aAAO;AAAA,IACR;AACA,UAAM,KAAK,qBAAqB,8BAA8B,CAAA,UAAS;AAAA,MACtE,GAAG;AAAA,MACH,UAAU,OAAO;AAAA,QAChB,OAAO,QAAQ,MAAM,YAAY,CAAA,CAAE,EAAE,IAAI,CAAC,CAAC,MAAM,OAAO,MAAqB;AAC5E,gBAAM,WAAW,YAAY,QAAQ,KAAK;AAC1C,cAAI,UAAU;AACb,oBAAQ,IAAI,0BAA0B,IAAI,UAAU;AACpD,mBAAO;AAAA,cACN;AAAA,cACA;AAAA,gBACC,GAAG;AAAA,gBACH,OAAO;AAAA,cAAA;AAAA,YACR;AAAA,UAEF;AACA,iBAAO,CAAC,MAAM,OAAO;AAAA,QACtB,CAAC;AAAA,MAAA;AAAA,IACF,EACC;AACF,YAAQ,IAAI,sBAAsB;AAClC,YAAQ,IAAI,iCAAiC;AAAA,EAC9C;AACD;;"}
1
+ {"version":3,"file":"WorkspaceUpdateApiCommand.cjs","sources":["../../../../../../packages/cli/src/commands/workspace/WorkspaceUpdateApiCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input, PackageWorkspaceResolver } from '@contember/cli-common'\nimport { DockerComposeManager } from '../../lib/fs/DockerComposeManager.js'\nimport { contemberDockerImages } from '../../consts.js'\n\ntype Args = {\n\tversion: string\n}\n\ntype Options = {}\n\nexport class WorkspaceUpdateApiCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly packageWorkspaceResolver: PackageWorkspaceResolver,\n\t\tprivate readonly dockerComposeManager: DockerComposeManager,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Updates Contember API version and all related packages')\n\t\tconfiguration.argument('version')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst version = input.getArgument('version')\n\t\tconst packageWorkspace = await this.packageWorkspaceResolver.resolve()\n\n\t\tawait packageWorkspace.updateEverywhere({\n\t\t\t'@contember/schema': version,\n\t\t\t'@contember/schema-definition': version,\n\t\t\t'@contember/cli': version,\n\t\t})\n\n\t\tconsole.log('Updating docker-compose')\n\t\tconst getNewImage = (currentImage: string): string | null => {\n\t\t\tfor (const candidate of contemberDockerImages) {\n\t\t\t\tif (currentImage.startsWith(`${candidate}:`)) {\n\t\t\t\t\treturn `${candidate.replace(/-ee$/, '')}:${version}`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null\n\t\t}\n\t\tawait this.dockerComposeManager.updateMainDockerComposeConfig(data => ({\n\t\t\t...data,\n\t\t\tservices: Object.fromEntries(\n\t\t\t\tObject.entries(data?.services ?? {}).map(([name, service]: [string, any]) => {\n\t\t\t\t\tconst newImage = getNewImage(service.image)\n\t\t\t\t\tif (newImage) {\n\t\t\t\t\t\tconsole.log(`docker-compose service ${name} updated`)\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...service,\n\t\t\t\t\t\t\t\timage: newImage,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\treturn [name, service]\n\t\t\t\t}),\n\t\t\t),\n\t\t}))\n\t\tconsole.log('API versions updated')\n\t\tconsole.log('Restart server to apply changes')\n\t}\n}\n"],"names":["Command","contemberDockerImages"],"mappings":";;;;AAUO,MAAM,kCAAkCA,UAAAA,QAAuB;AAAA,EACrE,YACkB,0BACA,sBAChB;AACD,UAAA;AAHiB,SAAA,2BAAA;AACA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ts"],"sourcesContent":["import { Command, CommandConfiguration, Input, PackageWorkspaceResolver } from '@contember/cli-common'\nimport { DockerComposeManager } from '../../lib/fs/DockerComposeManager'\nimport { contemberDockerImages } from '../../consts'\n\ntype Args = {\n\tversion: string\n}\n\ntype Options = {}\n\nexport class WorkspaceUpdateApiCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly packageWorkspaceResolver: PackageWorkspaceResolver,\n\t\tprivate readonly dockerComposeManager: DockerComposeManager,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Updates Contember API version and all related packages')\n\t\tconfiguration.argument('version')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst version = input.getArgument('version')\n\t\tconst packageWorkspace = await this.packageWorkspaceResolver.resolve()\n\n\t\tawait packageWorkspace.updateEverywhere({\n\t\t\t'@contember/schema': version,\n\t\t\t'@contember/schema-definition': version,\n\t\t\t'@contember/cli': version,\n\t\t})\n\n\t\tconsole.log('Updating docker-compose')\n\t\tconst getNewImage = (currentImage: string): string | null => {\n\t\t\tfor (const candidate of contemberDockerImages) {\n\t\t\t\tif (currentImage.startsWith(`${candidate}:`)) {\n\t\t\t\t\treturn `${candidate.replace(/-ee$/, '')}:${version}`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null\n\t\t}\n\t\tawait this.dockerComposeManager.updateMainDockerComposeConfig(data => ({\n\t\t\t...data,\n\t\t\tservices: Object.fromEntries(\n\t\t\t\tObject.entries(data?.services ?? {}).map(([name, service]: [string, any]) => {\n\t\t\t\t\tconst newImage = getNewImage(service.image)\n\t\t\t\t\tif (newImage) {\n\t\t\t\t\t\tconsole.log(`docker-compose service ${name} updated`)\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...service,\n\t\t\t\t\t\t\t\timage: newImage,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\treturn [name, service]\n\t\t\t\t}),\n\t\t\t),\n\t\t}))\n\t\tconsole.log('API versions updated')\n\t\tconsole.log('Restart server to apply changes')\n\t}\n}\n"],"names":[],"mappings":";;AAUO,MAAM,kCAAkC,QAAuB;AAAA,EACrE,YACkB,0BACA,sBAChB;AACD,UAAA;AAHiB,SAAA,2BAAA;AACA,SAAA,uBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,wDAAwD;AAClF,kBAAc,SAAS,SAAS;AAAA,EACjC;AAAA,EAEA,MAAgB,QAAQ,OAA4C;AACnE,UAAM,UAAU,MAAM,YAAY,SAAS;AAC3C,UAAM,mBAAmB,MAAM,KAAK,yBAAyB,QAAA;AAE7D,UAAM,iBAAiB,iBAAiB;AAAA,MACvC,qBAAqB;AAAA,MACrB,gCAAgC;AAAA,MAChC,kBAAkB;AAAA,IAAA,CAClB;AAED,YAAQ,IAAI,yBAAyB;AACrC,UAAM,cAAc,CAAC,iBAAwC;AAC5D,iBAAW,aAAa,uBAAuB;AAC9C,YAAI,aAAa,WAAW,GAAG,SAAS,GAAG,GAAG;AAC7C,iBAAO,GAAG,UAAU,QAAQ,QAAQ,EAAE,CAAC,IAAI,OAAO;AAAA,QACnD;AAAA,MACD;AACA,aAAO;AAAA,IACR;AACA,UAAM,KAAK,qBAAqB,8BAA8B,CAAA,UAAS;AAAA,MACtE,GAAG;AAAA,MACH,UAAU,OAAO;AAAA,QAChB,OAAO,QAAQ,MAAM,YAAY,CAAA,CAAE,EAAE,IAAI,CAAC,CAAC,MAAM,OAAO,MAAqB;AAC5E,gBAAM,WAAW,YAAY,QAAQ,KAAK;AAC1C,cAAI,UAAU;AACb,oBAAQ,IAAI,0BAA0B,IAAI,UAAU;AACpD,mBAAO;AAAA,cACN;AAAA,cACA;AAAA,gBACC,GAAG;AAAA,gBACH,OAAO;AAAA,cAAA;AAAA,YACR;AAAA,UAEF;AACA,iBAAO,CAAC,MAAM,OAAO;AAAA,QACtB,CAAC;AAAA,MAAA;AAAA,IACF,EACC;AACF,YAAQ,IAAI,sBAAsB;AAClC,YAAQ,IAAI,iCAAiC;AAAA,EAC9C;AACD;"}
1
+ {"version":3,"file":"WorkspaceUpdateApiCommand.js","sources":["../../../../../../packages/cli/src/commands/workspace/WorkspaceUpdateApiCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input, PackageWorkspaceResolver } from '@contember/cli-common'\nimport { DockerComposeManager } from '../../lib/fs/DockerComposeManager.js'\nimport { contemberDockerImages } from '../../consts.js'\n\ntype Args = {\n\tversion: string\n}\n\ntype Options = {}\n\nexport class WorkspaceUpdateApiCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly packageWorkspaceResolver: PackageWorkspaceResolver,\n\t\tprivate readonly dockerComposeManager: DockerComposeManager,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Updates Contember API version and all related packages')\n\t\tconfiguration.argument('version')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst version = input.getArgument('version')\n\t\tconst packageWorkspace = await this.packageWorkspaceResolver.resolve()\n\n\t\tawait packageWorkspace.updateEverywhere({\n\t\t\t'@contember/schema': version,\n\t\t\t'@contember/schema-definition': version,\n\t\t\t'@contember/cli': version,\n\t\t})\n\n\t\tconsole.log('Updating docker-compose')\n\t\tconst getNewImage = (currentImage: string): string | null => {\n\t\t\tfor (const candidate of contemberDockerImages) {\n\t\t\t\tif (currentImage.startsWith(`${candidate}:`)) {\n\t\t\t\t\treturn `${candidate.replace(/-ee$/, '')}:${version}`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null\n\t\t}\n\t\tawait this.dockerComposeManager.updateMainDockerComposeConfig(data => ({\n\t\t\t...data,\n\t\t\tservices: Object.fromEntries(\n\t\t\t\tObject.entries(data?.services ?? {}).map(([name, service]: [string, any]) => {\n\t\t\t\t\tconst newImage = getNewImage(service.image)\n\t\t\t\t\tif (newImage) {\n\t\t\t\t\t\tconsole.log(`docker-compose service ${name} updated`)\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...service,\n\t\t\t\t\t\t\t\timage: newImage,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\treturn [name, service]\n\t\t\t\t}),\n\t\t\t),\n\t\t}))\n\t\tconsole.log('API versions updated')\n\t\tconsole.log('Restart server to apply changes')\n\t}\n}\n"],"names":[],"mappings":";;AAUO,MAAM,kCAAkC,QAAuB;AAAA,EACrE,YACkB,0BACA,sBAChB;AACD,UAAA;AAHiB,SAAA,2BAAA;AACA,SAAA,uBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,wDAAwD;AAClF,kBAAc,SAAS,SAAS;AAAA,EACjC;AAAA,EAEA,MAAgB,QAAQ,OAA4C;AACnE,UAAM,UAAU,MAAM,YAAY,SAAS;AAC3C,UAAM,mBAAmB,MAAM,KAAK,yBAAyB,QAAA;AAE7D,UAAM,iBAAiB,iBAAiB;AAAA,MACvC,qBAAqB;AAAA,MACrB,gCAAgC;AAAA,MAChC,kBAAkB;AAAA,IAAA,CAClB;AAED,YAAQ,IAAI,yBAAyB;AACrC,UAAM,cAAc,CAAC,iBAAwC;AAC5D,iBAAW,aAAa,uBAAuB;AAC9C,YAAI,aAAa,WAAW,GAAG,SAAS,GAAG,GAAG;AAC7C,iBAAO,GAAG,UAAU,QAAQ,QAAQ,EAAE,CAAC,IAAI,OAAO;AAAA,QACnD;AAAA,MACD;AACA,aAAO;AAAA,IACR;AACA,UAAM,KAAK,qBAAqB,8BAA8B,CAAA,UAAS;AAAA,MACtE,GAAG;AAAA,MACH,UAAU,OAAO;AAAA,QAChB,OAAO,QAAQ,MAAM,YAAY,CAAA,CAAE,EAAE,IAAI,CAAC,CAAC,MAAM,OAAO,MAAqB;AAC5E,gBAAM,WAAW,YAAY,QAAQ,KAAK;AAC1C,cAAI,UAAU;AACb,oBAAQ,IAAI,0BAA0B,IAAI,UAAU;AACpD,mBAAO;AAAA,cACN;AAAA,cACA;AAAA,gBACC,GAAG;AAAA,gBACH,OAAO;AAAA,cAAA;AAAA,YACR;AAAA,UAEF;AACA,iBAAO,CAAC,MAAM,OAAO;AAAA,QACtB,CAAC;AAAA,MAAA;AAAA,IACF,EACC;AACF,YAAQ,IAAI,sBAAsB;AAClC,YAAQ,IAAI,iCAAiC;AAAA,EAC9C;AACD;"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const cliCommon = require("@contember/cli-common");
4
- const node_path = require("node:path");
4
+ const path = require("node:path");
5
5
  const node_url = require("node:url");
6
6
  var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
7
- const currentFilePath = node_path.dirname(node_url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("cli/src/consts.cjs", document.baseURI).href));
7
+ const currentFilePath = path.dirname(node_url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("cli/src/consts.cjs", document.baseURI).href));
8
8
  const packageRoot = process.env.CONTEMBER_CLI_PACKAGE_ROOT || cliCommon.findPackageRoot(currentFilePath);
9
9
  const contemberDockerImages = ["contember/engine", "contember/engine-ee", "contember/cli"];
10
10
  exports.contemberDockerImages = contemberDockerImages;
@@ -1 +1 @@
1
- {"version":3,"file":"consts.cjs","sources":["../../../../packages/cli/src/consts.ts"],"sourcesContent":["import { findPackageRoot } from '@contember/cli-common'\nimport { dirname } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst currentFilePath = dirname(fileURLToPath(import.meta.url))\nexport const packageRoot = process.env.CONTEMBER_CLI_PACKAGE_ROOT || findPackageRoot(currentFilePath)\nexport const contemberDockerImages = ['contember/engine', 'contember/engine-ee', 'contember/cli']\n"],"names":["dirname","fileURLToPath","findPackageRoot"],"mappings":";;;;;;AAIA,MAAM,kBAAkBA,UAAAA,QAAQC,uBAAc,OAAA,aAAA,cAAA,QAAA,KAAA,EAAA,cAAA,UAAA,EAAA,OAAA,0BAAA,uBAAA,QAAA,YAAA,MAAA,YAAA,uBAAA,OAAA,IAAA,IAAA,sBAAA,SAAA,OAAA,EAAA,IAAe,CAAC;AACvD,MAAM,cAAc,QAAQ,IAAI,8BAA8BC,UAAAA,gBAAgB,eAAe;AAC7F,MAAM,wBAAwB,CAAC,oBAAoB,uBAAuB,eAAe;;;"}
1
+ {"version":3,"file":"consts.cjs","sources":["../../../../packages/cli/src/consts.ts"],"sourcesContent":["import { findPackageRoot } from '@contember/cli-common'\nimport { dirname } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst currentFilePath = dirname(fileURLToPath(import.meta.url))\nexport const packageRoot = process.env.CONTEMBER_CLI_PACKAGE_ROOT || findPackageRoot(currentFilePath)\nexport const contemberDockerImages = ['contember/engine', 'contember/engine-ee', 'contember/cli']\n"],"names":["dirname","fileURLToPath","findPackageRoot"],"mappings":";;;;;;AAIA,MAAM,kBAAkBA,KAAAA,QAAQC,uBAAc,OAAA,aAAA,cAAA,QAAA,KAAA,EAAA,cAAA,UAAA,EAAA,OAAA,0BAAA,uBAAA,QAAA,YAAA,MAAA,YAAA,uBAAA,OAAA,IAAA,IAAA,sBAAA,SAAA,OAAA,EAAA,IAAe,CAAC;AACvD,MAAM,cAAc,QAAQ,IAAI,8BAA8BC,UAAAA,gBAAgB,eAAe;AAC7F,MAAM,wBAAwB,CAAC,oBAAoB,uBAAuB,eAAe;;;"}
@@ -17,15 +17,20 @@ const MigrationBlankCommand = require("./commands/migrations/MigrationBlankComma
17
17
  const MigrationDescribeCommand = require("./commands/migrations/MigrationDescribeCommand.cjs");
18
18
  const MigrationDiffCommand = require("./commands/migrations/MigrationDiffCommand.cjs");
19
19
  const MigrationExecuteCommand = require("./commands/migrations/MigrationExecuteCommand.cjs");
20
+ const MigrationInitStateCommand = require("./commands/migrations/MigrationInitStateCommand.cjs");
20
21
  const MigrationStatusCommand = require("./commands/migrations/MigrationStatusCommand.cjs");
21
22
  const MigrationRebaseCommand = require("./commands/migrations/MigrationRebaseCommand.cjs");
23
+ const MigrationSnapshotCommand = require("./commands/migrations/MigrationSnapshotCommand.cjs");
24
+ const MigrationVerifySnapshotCommand = require("./commands/migrations/MigrationVerifySnapshotCommand.cjs");
22
25
  const VersionCommand = require("./commands/misc/VersionCommand.cjs");
23
26
  const ProjectGenerateDocumentationCommand = require("./commands/project/ProjectGenerateDocumentationCommand.cjs");
24
27
  const ProjectPrintSchemaCommand = require("./commands/project/ProjectPrintSchemaCommand.cjs");
25
28
  const ProjectValidateCommand = require("./commands/project/ProjectValidateCommand.cjs");
29
+ const TenantApplyCommand = require("./commands/tenant/TenantApplyCommand.cjs");
26
30
  const WorkspaceUpdateApiCommand = require("./commands/workspace/WorkspaceUpdateApiCommand.cjs");
27
31
  const MigrationExecutionFacade = require("./lib/migrations/MigrationExecutionFacade.cjs");
28
32
  const MigrationPrinter = require("./lib/migrations/MigrationPrinter.cjs");
33
+ const MigrationSnapshotFacade = require("./lib/migrations/MigrationSnapshotFacade.cjs");
29
34
  const MigrationsStatusFacade = require("./lib/migrations/MigrationsStatusFacade.cjs");
30
35
  const SchemaLoader = require("./lib/schema/SchemaLoader.cjs");
31
36
  const MigrationsValidator = require("./lib/migrations/MigrationsValidator.cjs");
@@ -46,6 +51,8 @@ const ActionsListFailedEventsCommand = require("./commands/actions/ActionsListFa
46
51
  const ActionsRetryEventCommand = require("./commands/actions/ActionsRetryEventCommand.cjs");
47
52
  const ActionsGetEventCommand = require("./commands/actions/ActionsGetEventCommand.cjs");
48
53
  const ActionsStopEventCommand = require("./commands/actions/ActionsStopEventCommand.cjs");
54
+ const TenantConfigLoader = require("./lib/tenant/TenantConfigLoader.cjs");
55
+ const TenantConfigApplier = require("./lib/tenant/TenantConfigApplier.cjs");
49
56
  const jsSample = `
50
57
  export const query = \`\`
51
58
  export const variables = {}
@@ -83,13 +90,26 @@ const createContainer = ({ env, version, runtime, workspace }) => {
83
90
  }).addService(
84
91
  "dockerComposeManager",
85
92
  ({ workspace: workspace2, env: env2, fs, yamlHandler }) => new DockerComposeManager.DockerComposeManager(workspace2.baseDir, env2.dockerComposeFile, fs, yamlHandler)
86
- ).addService("modificationHandlerFactory", () => new migrationsClient.ModificationHandlerFactory(migrationsClient.ModificationHandlerFactory.defaultFactoryMap)).addService("schemaMigrator", ({ modificationHandlerFactory }) => new migrationsClient.SchemaMigrator(modificationHandlerFactory)).addService("migrationsResolver", ({ migrationFilesManager }) => new migrationsClient.MigrationsResolver(migrationFilesManager)).addService("schemaVersionBuilder", ({ migrationsResolver, schemaMigrator }) => new migrationsClient.SchemaVersionBuilder(migrationsResolver, schemaMigrator)).addService("schemaDiffer", ({ schemaMigrator }) => new migrationsClient.SchemaDiffer(schemaMigrator, {
93
+ ).addService("modificationHandlerFactory", () => new migrationsClient.ModificationHandlerFactory(migrationsClient.ModificationHandlerFactory.defaultFactoryMap)).addService("schemaMigrator", ({ modificationHandlerFactory }) => new migrationsClient.SchemaMigrator(modificationHandlerFactory)).addService("migrationsResolver", ({ migrationFilesManager }) => new migrationsClient.MigrationsResolver(migrationFilesManager)).addService("schemaStateManager", ({ workspace: workspace2 }) => new migrationsClient.SchemaStateManager(workspace2.migrationsDir + "/state")).addService("snapshotManager", ({ workspace: workspace2 }) => new migrationsClient.SnapshotManager(workspace2.migrationsDir + "/snapshot.json")).addService(
94
+ "schemaVersionBuilder",
95
+ ({ migrationsResolver, schemaMigrator, schemaStateManager }) => new migrationsClient.SchemaVersionBuilder(migrationsResolver, schemaMigrator, schemaStateManager)
96
+ ).addService("schemaDiffer", ({ schemaMigrator }) => new migrationsClient.SchemaDiffer(schemaMigrator, {
87
97
  maxPatchSize: env.migrationsOptions?.maxPatchSize
88
98
  })).addService("migrationCreator", ({ migrationFilesManager, schemaDiffer }) => new migrationsClient.MigrationCreator(migrationFilesManager, schemaDiffer, {
89
99
  json: JSON.stringify({ formatVersion: migrationsClient.VERSION_LATEST, modifications: [] }, void 0, " ") + "\n",
90
100
  ts: jsSample,
91
101
  js: jsSample
92
102
  })).addService("migrationDescriber", ({ modificationHandlerFactory }) => new migrationsClient.MigrationDescriber(modificationHandlerFactory)).addService("migrationPrinter", ({ migrationDescriber }) => new MigrationPrinter.MigrationPrinter(migrationDescriber)).addService("migrationsExecutor", () => new migrationsClient.MigrationExecutor()).addService("migrationsStatusResolver", () => new migrationsClient.MigrationsStatusResolver()).addService(
103
+ "migrationSnapshotFacade",
104
+ ({ migrationsResolver, schemaVersionBuilder, schemaDiffer, schemaMigrator, schemaStateManager, snapshotManager }) => new MigrationSnapshotFacade.MigrationSnapshotFacade(
105
+ migrationsResolver,
106
+ schemaVersionBuilder,
107
+ schemaDiffer,
108
+ schemaMigrator,
109
+ schemaStateManager,
110
+ snapshotManager
111
+ )
112
+ ).addService(
93
113
  "migrationsStatusFacade",
94
114
  ({ systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter }) => new MigrationsStatusFacade.MigrationsStatusFacade(systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter)
95
115
  ).addService(
@@ -101,7 +121,9 @@ const createContainer = ({ env, version, runtime, workspace }) => {
101
121
  schemaVersionBuilder,
102
122
  migrationPrinter,
103
123
  migrationsExecutor,
104
- migrationsStatusFacade
124
+ migrationsStatusFacade,
125
+ schemaStateManager,
126
+ migrationSnapshotFacade
105
127
  }) => new MigrationExecutionFacade.MigrationExecutionFacade(
106
128
  systemClientProvider,
107
129
  tenantClientProvider,
@@ -109,11 +131,13 @@ const createContainer = ({ env, version, runtime, workspace }) => {
109
131
  schemaVersionBuilder,
110
132
  migrationPrinter,
111
133
  migrationsExecutor,
112
- migrationsStatusFacade
134
+ migrationsStatusFacade,
135
+ schemaStateManager,
136
+ migrationSnapshotFacade
113
137
  )
114
138
  ).addService("migrationsValidator", ({ migrationDescriber, schemaMigrator }) => new MigrationsValidator.MigrationsValidator(migrationDescriber, schemaMigrator)).addService(
115
139
  "migrationRebaseFacade",
116
- ({ schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager }) => new MigrationRebaseFacade.MigrationRebaseFacade(schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager)
140
+ ({ schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager, schemaStateManager }) => new MigrationRebaseFacade.MigrationRebaseFacade(schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager, schemaStateManager)
117
141
  ).addService(
118
142
  "schemaLoader",
119
143
  ({ workspace: workspace2, jsCodeRunner, runtime: runtime2 }) => runtime2 === "bun" ? new SchemaLoader.ImportSchemaLoader(workspace2) : new SchemaLoader.TranspilingSchemaLoader(workspace2, jsCodeRunner)
@@ -131,7 +155,8 @@ const createContainer = ({ env, version, runtime, workspace }) => {
131
155
  migrationCreator,
132
156
  migrationsValidator,
133
157
  migrationPrinter,
134
- schemaMigrator
158
+ schemaMigrator,
159
+ schemaStateManager
135
160
  }) => new MigrationAmendCommand.MigrationAmendCommand(
136
161
  migrationsResolver,
137
162
  systemClientProvider,
@@ -141,17 +166,32 @@ const createContainer = ({ env, version, runtime, workspace }) => {
141
166
  migrationCreator,
142
167
  migrationsValidator,
143
168
  migrationPrinter,
144
- schemaMigrator
169
+ schemaMigrator,
170
+ schemaStateManager
145
171
  )
146
172
  ).addService("migrationBlankCommand", ({ migrationCreator }) => new MigrationBlankCommand.MigrationBlankCommand(migrationCreator)).addService(
147
173
  "migrationDescribeCommand",
148
174
  ({ migrationPrinter, schemaVersionBuilder, migrationsResolver }) => new MigrationDescribeCommand.MigrationDescribeCommand(migrationPrinter, schemaVersionBuilder, migrationsResolver)
149
175
  ).addService(
150
176
  "migrationDiffCommand",
151
- ({ schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade }) => new MigrationDiffCommand.MigrationDiffCommand(schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade)
177
+ ({ schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade, schemaStateManager, migrationsResolver }) => new MigrationDiffCommand.MigrationDiffCommand(
178
+ schemaLoader,
179
+ schemaVersionBuilder,
180
+ migrationCreator,
181
+ migrationPrinter,
182
+ migrationExecutionFacade,
183
+ schemaStateManager,
184
+ migrationsResolver
185
+ )
152
186
  ).addService("migrationExecuteCommand", ({ migrationExecutionFacade }) => new MigrationExecuteCommand.MigrationExecuteCommand(migrationExecutionFacade)).addService(
187
+ "migrationInitStateCommand",
188
+ ({ schemaLoader, schemaStateManager }) => new MigrationInitStateCommand.MigrationInitStateCommand(schemaLoader, schemaStateManager)
189
+ ).addService(
153
190
  "migrationRebaseCommand",
154
191
  ({ migrationsResolver, migrationRebaseFacade }) => new MigrationRebaseCommand.MigrationRebaseCommand(migrationsResolver, migrationRebaseFacade)
192
+ ).addService("migrationSnapshotCommand", ({ migrationSnapshotFacade }) => new MigrationSnapshotCommand.MigrationSnapshotCommand(migrationSnapshotFacade)).addService(
193
+ "migrationVerifySnapshotCommand",
194
+ ({ migrationSnapshotFacade }) => new MigrationVerifySnapshotCommand.MigrationVerifySnapshotCommand(migrationSnapshotFacade)
155
195
  ).addService(
156
196
  "migrationStatusCommand",
157
197
  ({ migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter }) => new MigrationStatusCommand.MigrationStatusCommand(migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter)
@@ -167,7 +207,13 @@ const createContainer = ({ env, version, runtime, workspace }) => {
167
207
  ).addService("exportCommand", ({ dataTransferClient, remoteProjectResolver }) => new ExportCommand.ExportCommand(remoteProjectResolver, dataTransferClient)).addService("importCommand", ({ dataTransferClient, remoteProjectResolver }) => new ImportCommand.ImportCommand(remoteProjectResolver, dataTransferClient)).addService("transferCommand", ({ dataTransferClient, remoteProjectResolver }) => new TransferCommand.TransferCommand(remoteProjectResolver, dataTransferClient)).addService(
168
208
  "workspaceUpdateCommand",
169
209
  ({ packageWorkspaceResolver, dockerComposeManager }) => new WorkspaceUpdateApiCommand.WorkspaceUpdateApiCommand(packageWorkspaceResolver, dockerComposeManager)
170
- ).addService("actionsListVariables", ({ remoteProjectResolver }) => new ActionsListVariablesCommand.ActionsListVariablesCommand(remoteProjectResolver)).addService("actionsSetVariables", ({ remoteProjectResolver }) => new ActionsSetVariablesCommand.ActionsSetVariablesCommand(remoteProjectResolver)).addService("actionsListFailedEvents", ({ remoteProjectResolver }) => new ActionsListFailedEventsCommand.ActionsListFailedEventsCommand(remoteProjectResolver)).addService("actionsRetryEvent", ({ remoteProjectResolver }) => new ActionsRetryEventCommand.ActionsRetryEventCommand(remoteProjectResolver)).addService("actionsGetEvent", ({ remoteProjectResolver }) => new ActionsGetEventCommand.ActionsGetEventCommand(remoteProjectResolver)).addService("actionsStopEvent", ({ remoteProjectResolver }) => new ActionsStopEventCommand.ActionsStopEventCommand(remoteProjectResolver)).addService("commandList", (dic2) => {
210
+ ).addService("actionsListVariables", ({ remoteProjectResolver }) => new ActionsListVariablesCommand.ActionsListVariablesCommand(remoteProjectResolver)).addService("actionsSetVariables", ({ remoteProjectResolver }) => new ActionsSetVariablesCommand.ActionsSetVariablesCommand(remoteProjectResolver)).addService("actionsListFailedEvents", ({ remoteProjectResolver }) => new ActionsListFailedEventsCommand.ActionsListFailedEventsCommand(remoteProjectResolver)).addService("actionsRetryEvent", ({ remoteProjectResolver }) => new ActionsRetryEventCommand.ActionsRetryEventCommand(remoteProjectResolver)).addService("actionsGetEvent", ({ remoteProjectResolver }) => new ActionsGetEventCommand.ActionsGetEventCommand(remoteProjectResolver)).addService("actionsStopEvent", ({ remoteProjectResolver }) => new ActionsStopEventCommand.ActionsStopEventCommand(remoteProjectResolver)).addService(
211
+ "tenantConfigLoader",
212
+ ({ jsCodeRunner }) => runtime === "bun" ? new TenantConfigLoader.ImportTenantConfigLoader() : new TenantConfigLoader.TranspilingTenantConfigLoader(jsCodeRunner)
213
+ ).addService("tenantConfigApplier", () => new TenantConfigApplier.TenantConfigApplier()).addService(
214
+ "tenantApplyCommand",
215
+ ({ remoteProjectResolver, tenantConfigLoader, tenantConfigApplier }) => new TenantApplyCommand.TenantApplyCommand(remoteProjectResolver, tenantConfigLoader, tenantConfigApplier)
216
+ ).addService("commandList", (dic2) => {
171
217
  const commands = {
172
218
  ["deploy"]: () => dic2.deployCommand,
173
219
  ["version"]: () => dic2.versionCommand,
@@ -177,9 +223,12 @@ const createContainer = ({ env, version, runtime, workspace }) => {
177
223
  ["migrations:diff"]: () => dic2.migrationDiffCommand,
178
224
  ["migrations:amend"]: () => dic2.migrationAmendCommand,
179
225
  ["migrations:blank"]: () => dic2.migrationBlankCommand,
226
+ ["migrations:init-state"]: () => dic2.migrationInitStateCommand,
180
227
  ["migrations:describe"]: () => dic2.migrationDescribeCommand,
181
228
  ["migrations:execute"]: () => dic2.migrationExecuteCommand,
182
229
  ["migrations:rebase"]: () => dic2.migrationRebaseCommand,
230
+ ["migrations:snapshot"]: () => dic2.migrationSnapshotCommand,
231
+ ["migrations:verify-snapshot"]: () => dic2.migrationVerifySnapshotCommand,
183
232
  ["migrations:status"]: () => dic2.migrationStatusCommand,
184
233
  ["workspace:update:api"]: () => dic2.workspaceUpdateCommand,
185
234
  ["project:validate"]: () => dic2.projectValidateCommand,
@@ -190,7 +239,8 @@ const createContainer = ({ env, version, runtime, workspace }) => {
190
239
  ["actions:failed-events"]: () => dic2.actionsListFailedEvents,
191
240
  ["actions:retry-event"]: () => dic2.actionsRetryEvent,
192
241
  ["actions:get-event"]: () => dic2.actionsGetEvent,
193
- ["actions:stop-event"]: () => dic2.actionsStopEvent
242
+ ["actions:stop-event"]: () => dic2.actionsStopEvent,
243
+ ["tenant:apply"]: () => dic2.tenantApplyCommand
194
244
  };
195
245
  return commands;
196
246
  }).addService("commandManager", ({ commandList }) => new cliCommon.CommandManager(commandList)).addService(
@@ -202,7 +252,7 @@ const createContainer = ({ env, version, runtime, workspace }) => {
202
252
  `Contember CLI version ${version}`,
203
253
  {
204
254
  beforeRun: async ({ name }) => {
205
- if (!process.env.CONTEMBER_SKIP_VERSION_CHECK && !["deploy", "version", "data:export", "data:import", "data:transfer"].includes(name)) {
255
+ if (!process.env.CONTEMBER_SKIP_VERSION_CHECK && !["deploy", "version", "data:export", "data:import", "data:transfer", "tenant:apply"].includes(name)) {
206
256
  await versionChecker.checkVersions();
207
257
  }
208
258
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dic.cjs","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":["Builder","FileSystem","YamlHandler","EvalExecutor","EsBuildBuilder","JsCodeRunner","WorkspaceResolver","env","RemoteProjectResolver","RemoteProjectProvider","SystemClientProvider","TenantClientProvider","AdminClient","workspace","MigrationFilesManager","JsonLoader","MigrationParser","JsLoader","CommandRunner","PackageWorkspaceResolver","Yarn","YarnClassic","Pnpm","Npm","Bun","DockerComposeManager","ModificationHandlerFactory","SchemaMigrator","MigrationsResolver","SchemaVersionBuilder","SchemaDiffer","MigrationCreator","VERSION_LATEST","MigrationDescriber","MigrationPrinter","MigrationExecutor","MigrationsStatusResolver","MigrationsStatusFacade","MigrationExecutionFacade","MigrationsValidator","MigrationRebaseFacade","runtime","ImportSchemaLoader","TranspilingSchemaLoader","AdminDeployer","DataTransferClient","DeployCommand","MigrationAmendCommand","MigrationBlankCommand","MigrationDescribeCommand","MigrationDiffCommand","MigrationExecuteCommand","MigrationRebaseCommand","MigrationStatusCommand","version","VersionCommand","ProjectGenerateDocumentationCommand","ProjectPrintSchemaCommand","ProjectValidateCommand","ExportCommand","ImportCommand","TransferCommand","WorkspaceUpdateApiCommand","ActionsListVariablesCommand","ActionsSetVariablesCommand","ActionsListFailedEventsCommand","ActionsRetryEventCommand","ActionsGetEventCommand","ActionsStopEventCommand","dic","CommandManager","VersionChecker","Application"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWV,MAAM,kBAAkB,CAAC,EAAE,KAAK,SAAS,SAAS,gBAKnD;AACL,SAAO,IAAIA,IAAAA,QAAQ,EAAE,EACnB,WAAW,OAAO,MAAM,GAAG,EAC3B,WAAW,WAAW,MAAM,OAAO,EACnC,WAAW,WAAW,MAAM,OAAO,EACnC,WAAW,aAAa,MAAM,SAAS,EACvC,WAAW,MAAM,MAAM,IAAIC,WAAAA,YAAY,EACvC,WAAW,eAAe,CAAC,EAAE,SAAS,IAAIC,YAAAA,YAAY,EAAE,CAAC,EACzD,WAAW,cAAc,MAAM,IAAIC,aAAAA,aAAA,CAAc,EACjD,WAAW,aAAa,MAAM,IAAIC,eAAAA,eAAA,CAAgB,EAClD,WAAW,gBAAgB,CAAC,EAAE,YAAY,UAAA,MAAgB,IAAIC,aAAAA,aAAa,WAAW,UAAU,CAAC,EACjG,WAAW,qBAAqB,CAAC,EAAE,kBAAkB,IAAIC,kBAAAA,kBAAkB,WAAW,CAAC,EACvF,WAAW,yBAAyB,CAAC,EAAE,KAAAC,KAAAA,MAAU,IAAIC,sBAAAA,sBAAsBD,IAAG,CAAC,EAC/E,WAAW,yBAAyB,CAAC,EAAE,4BAA4B;AACnE,UAAM,WAAW,IAAIE,4CAAA;AACrB,UAAM,gBAAgB,sBAAsB,QAAA;AAC5C,QAAI,eAAe;AAClB,eAAS,iBAAiB,aAAa;AAAA,IACxC;AACA,WAAO;AAAA,EACR,CAAC,EACA,WAAW,wBAAwB,CAAC,EAAE,4BAA4B,IAAIC,qBAAAA,qBAAqB,qBAAqB,C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MAAA;AACH;;"}
1
+ {"version":3,"file":"dic.cjs","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":["Builder","FileSystem","YamlHandler","EvalExecutor","EsBuildBuilder","JsCodeRunner","WorkspaceResolver","env","RemoteProjectResolver","RemoteProjectProvider","SystemClientProvider","TenantClientProvider","AdminClient","workspace","MigrationFilesManager","JsonLoader","MigrationParser","JsLoader","CommandRunner","PackageWorkspaceResolver","Yarn","YarnClassic","Pnpm","Npm","Bun","DockerComposeManager","ModificationHandlerFactory","SchemaMigrator","MigrationsResolver","SchemaStateManager","SnapshotManager","SchemaVersionBuilder","SchemaDiffer","MigrationCreator","VERSION_LATEST","MigrationDescriber","MigrationPrinter","MigrationExecutor","MigrationsStatusResolver","MigrationSnapshotFacade","MigrationsStatusFacade","MigrationExecutionFacade","MigrationsValidator","MigrationRebaseFacade","runtime","ImportSchemaLoader","TranspilingSchemaLoader","AdminDeployer","DataTransferClient","DeployCommand","MigrationAmendCommand","MigrationBlankCommand","MigrationDescribeCommand","MigrationDiffCommand","MigrationExecuteCommand","MigrationInitStateCommand","MigrationRebaseCommand","MigrationSnapshotCommand","MigrationVerifySnapshotCommand","MigrationStatusCommand","version","VersionCommand","ProjectGenerateDocumentationCommand","ProjectPrintSchemaCommand","ProjectValidateCommand","ExportCommand","ImportCommand","TransferCommand","WorkspaceUpdateApiCommand","ActionsListVariablesCommand","ActionsSetVariablesCommand","ActionsListFailedEventsCommand","ActionsRetryEventCommand","ActionsGetEventCommand","ActionsStopEventCommand","ImportTenantConfigLoader","TranspilingTenantConfigLoader","TenantConfigApplier","TenantApplyCommand","dic","CommandManager","VersionChecker","Application"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWV,MAAM,kBAAkB,CAAC,EAAE,KAAK,SAAS,SAAS,gBAKnD;AACL,SAAO,IAAIA,IAAAA,QAAQ,EAAE,EACnB,WAAW,OAAO,MAAM,GAAG,EAC3B,WAAW,WAAW,MAAM,OAAO,EACnC,WAAW,WAAW,MAAM,OAAO,EACnC,WAAW,aAAa,MAAM,SAAS,EACvC,WAAW,MAAM,MAAM,IAAIC,WAAAA,YAAY,EACvC,WAAW,eAAe,CAAC,EAAE,SAAS,IAAIC,YAAAA,YAAY,EAAE,CAAC,EACzD,WAAW,cAAc,MAAM,IAAIC,aAAAA,aAAA,CAAc,EACjD,WAAW,aAAa,MAAM,IAAIC,eAAAA,eAAA,CAAgB,EAClD,WAAW,gBAAgB,CAAC,EAAE,YAAY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