@contember/cli 2.1.0-alpha.3 → 2.1.0-alpha.35

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 (485) hide show
  1. package/dist/development/run.cjs.map +1 -1
  2. package/dist/development/run.js.map +1 -1
  3. package/dist/development/src/commands/actions/ActionsGetEventCommand.cjs +31 -0
  4. package/dist/development/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -0
  5. package/dist/development/src/commands/actions/ActionsGetEventCommand.js +31 -0
  6. package/dist/development/src/commands/actions/ActionsGetEventCommand.js.map +1 -0
  7. package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs +60 -0
  8. package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -0
  9. package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js +60 -0
  10. package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -0
  11. package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs +29 -0
  12. package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -0
  13. package/dist/development/src/commands/actions/ActionsListVariablesCommand.js +29 -0
  14. package/dist/development/src/commands/actions/ActionsListVariablesCommand.js.map +1 -0
  15. package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs +32 -0
  16. package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -0
  17. package/dist/development/src/commands/actions/ActionsRetryEventCommand.js +32 -0
  18. package/dist/development/src/commands/actions/ActionsRetryEventCommand.js.map +1 -0
  19. package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs +43 -0
  20. package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -0
  21. package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js +43 -0
  22. package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -0
  23. package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs +32 -0
  24. package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -0
  25. package/dist/development/src/commands/actions/ActionsStopEventCommand.js +32 -0
  26. package/dist/development/src/commands/actions/ActionsStopEventCommand.js.map +1 -0
  27. package/dist/development/src/commands/deploy/DeployCommand.cjs.map +1 -1
  28. package/dist/development/src/commands/deploy/DeployCommand.js.map +1 -1
  29. package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
  30. package/dist/development/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
  31. package/dist/development/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -1
  32. package/dist/development/src/commands/migrations/MigrationBlankCommand.js.map +1 -1
  33. package/dist/development/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
  34. package/dist/development/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
  35. package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
  36. package/dist/development/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
  37. package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
  38. package/dist/development/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
  39. package/dist/development/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
  40. package/dist/development/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
  41. package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs +1 -1
  42. package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
  43. package/dist/development/src/commands/migrations/MigrationStatusCommand.js +1 -1
  44. package/dist/development/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
  45. package/dist/development/src/commands/misc/VersionCommand.cjs.map +1 -1
  46. package/dist/development/src/commands/misc/VersionCommand.js.map +1 -1
  47. package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
  48. package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
  49. package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
  50. package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
  51. package/dist/development/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
  52. package/dist/development/src/commands/project/ProjectValidateCommand.js.map +1 -1
  53. package/dist/development/src/commands/transfer/ExportCommand.cjs +7 -2
  54. package/dist/development/src/commands/transfer/ExportCommand.cjs.map +1 -1
  55. package/dist/development/src/commands/transfer/ExportCommand.js +8 -3
  56. package/dist/development/src/commands/transfer/ExportCommand.js.map +1 -1
  57. package/dist/development/src/commands/transfer/ImportCommand.cjs +7 -4
  58. package/dist/development/src/commands/transfer/ImportCommand.cjs.map +1 -1
  59. package/dist/development/src/commands/transfer/ImportCommand.js +5 -2
  60. package/dist/development/src/commands/transfer/ImportCommand.js.map +1 -1
  61. package/dist/development/src/commands/transfer/TransferCommand.cjs +4 -5
  62. package/dist/development/src/commands/transfer/TransferCommand.cjs.map +1 -1
  63. package/dist/development/src/commands/transfer/TransferCommand.js +4 -5
  64. package/dist/development/src/commands/transfer/TransferCommand.js.map +1 -1
  65. package/dist/development/src/commands/transfer/utils.cjs.map +1 -1
  66. package/dist/development/src/commands/transfer/utils.js.map +1 -1
  67. package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs +16 -14
  68. package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
  69. package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js +16 -14
  70. package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
  71. package/dist/development/src/consts.cjs.map +1 -1
  72. package/dist/development/src/dic.cjs +100 -4
  73. package/dist/development/src/dic.cjs.map +1 -1
  74. package/dist/development/src/dic.js +101 -5
  75. package/dist/development/src/dic.js.map +1 -1
  76. package/dist/development/src/lib/SystemClientProvider.cjs.map +1 -1
  77. package/dist/development/src/lib/SystemClientProvider.js.map +1 -1
  78. package/dist/development/src/lib/TenantClientProvider.cjs.map +1 -1
  79. package/dist/development/src/lib/TenantClientProvider.js.map +1 -1
  80. package/dist/development/src/lib/VersionChecker.cjs +7 -9
  81. package/dist/development/src/lib/VersionChecker.cjs.map +1 -1
  82. package/dist/development/src/lib/VersionChecker.js +7 -9
  83. package/dist/development/src/lib/VersionChecker.js.map +1 -1
  84. package/dist/development/src/lib/actions/ActionsClient.cjs +91 -0
  85. package/dist/development/src/lib/actions/ActionsClient.cjs.map +1 -0
  86. package/dist/development/src/lib/actions/ActionsClient.js +91 -0
  87. package/dist/development/src/lib/actions/ActionsClient.js.map +1 -0
  88. package/dist/development/src/lib/admin/AdminClient.cjs.map +1 -1
  89. package/dist/development/src/lib/admin/AdminClient.js.map +1 -1
  90. package/dist/development/src/lib/admin/AdminDeployer.cjs.map +1 -1
  91. package/dist/development/src/lib/admin/AdminDeployer.js.map +1 -1
  92. package/dist/development/src/lib/assertNever.cjs.map +1 -1
  93. package/dist/development/src/lib/assertNever.js.map +1 -1
  94. package/dist/development/src/lib/dsn.cjs.map +1 -1
  95. package/dist/development/src/lib/dsn.js.map +1 -1
  96. package/dist/development/src/lib/env.cjs.map +1 -1
  97. package/dist/development/src/lib/env.js.map +1 -1
  98. package/dist/development/src/lib/fs/DockerComposeManager.cjs.map +1 -1
  99. package/dist/development/src/lib/fs/DockerComposeManager.js.map +1 -1
  100. package/dist/development/src/lib/fs/FileSystem.cjs.map +1 -1
  101. package/dist/development/src/lib/fs/FileSystem.js.map +1 -1
  102. package/dist/development/src/lib/fs/YamlHandler.cjs.map +1 -1
  103. package/dist/development/src/lib/fs/YamlHandler.js.map +1 -1
  104. package/dist/development/src/lib/js/EsBuildBuilder.cjs.map +1 -1
  105. package/dist/development/src/lib/js/EsBuildBuilder.js.map +1 -1
  106. package/dist/development/src/lib/js/EvalExecutor.cjs.map +1 -1
  107. package/dist/development/src/lib/js/EvalExecutor.js.map +1 -1
  108. package/dist/development/src/lib/js/JsCodeRunner.cjs.map +1 -1
  109. package/dist/development/src/lib/js/JsCodeRunner.js.map +1 -1
  110. package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs +2 -1
  111. package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
  112. package/dist/development/src/lib/migrations/MigrationExecutionFacade.js +2 -1
  113. package/dist/development/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
  114. package/dist/development/src/lib/migrations/MigrationPrinter.cjs +7 -2
  115. package/dist/development/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
  116. package/dist/development/src/lib/migrations/MigrationPrinter.js +7 -2
  117. package/dist/development/src/lib/migrations/MigrationPrinter.js.map +1 -1
  118. package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
  119. package/dist/development/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
  120. package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs +3 -3
  121. package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
  122. package/dist/development/src/lib/migrations/MigrationsStatusFacade.js +3 -3
  123. package/dist/development/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
  124. package/dist/development/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
  125. package/dist/development/src/lib/migrations/MigrationsValidator.js.map +1 -1
  126. package/dist/development/src/lib/project/RemoteProject.cjs.map +1 -1
  127. package/dist/development/src/lib/project/RemoteProject.js.map +1 -1
  128. package/dist/development/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
  129. package/dist/development/src/lib/project/RemoteProjectProvider.js.map +1 -1
  130. package/dist/development/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
  131. package/dist/development/src/lib/project/RemoteProjectResolver.js.map +1 -1
  132. package/dist/development/src/lib/project/docs/components/EntityInfo.cjs +135 -177
  133. package/dist/development/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
  134. package/dist/development/src/lib/project/docs/components/EntityInfo.js +136 -178
  135. package/dist/development/src/lib/project/docs/components/EntityInfo.js.map +1 -1
  136. package/dist/development/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
  137. package/dist/development/src/lib/project/docs/components/EntityLink.js.map +1 -1
  138. package/dist/development/src/lib/project/docs/components/FieldLink.cjs +5 -5
  139. package/dist/development/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
  140. package/dist/development/src/lib/project/docs/components/FieldLink.js +5 -5
  141. package/dist/development/src/lib/project/docs/components/FieldLink.js.map +1 -1
  142. package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs +8 -8
  143. package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
  144. package/dist/development/src/lib/project/docs/components/FieldPermissions.js +8 -8
  145. package/dist/development/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
  146. package/dist/development/src/lib/project/docs/components/FieldType.cjs +34 -36
  147. package/dist/development/src/lib/project/docs/components/FieldType.cjs.map +1 -1
  148. package/dist/development/src/lib/project/docs/components/FieldType.js +34 -36
  149. package/dist/development/src/lib/project/docs/components/FieldType.js.map +1 -1
  150. package/dist/development/src/lib/project/docs/components/OnDelete.cjs +22 -26
  151. package/dist/development/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
  152. package/dist/development/src/lib/project/docs/components/OnDelete.js +22 -26
  153. package/dist/development/src/lib/project/docs/components/OnDelete.js.map +1 -1
  154. package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs +16 -16
  155. package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
  156. package/dist/development/src/lib/project/docs/components/ProjectInfo.js +16 -16
  157. package/dist/development/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
  158. package/dist/development/src/lib/project/docs/components/SinglePermission.cjs.map +1 -1
  159. package/dist/development/src/lib/project/docs/components/SinglePermission.js.map +1 -1
  160. package/dist/development/src/lib/project/docs/components/utils.cjs.map +1 -1
  161. package/dist/development/src/lib/project/docs/components/utils.js.map +1 -1
  162. package/dist/development/src/lib/project/docs/projectDescribe.cjs.map +1 -1
  163. package/dist/development/src/lib/project/docs/projectDescribe.js.map +1 -1
  164. package/dist/development/src/lib/schema/SchemaLoader.cjs.map +1 -1
  165. package/dist/development/src/lib/schema/SchemaLoader.js.map +1 -1
  166. package/dist/development/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
  167. package/dist/development/src/lib/schema/SchemaValidationPrinter.cjs.map +1 -1
  168. package/dist/development/src/lib/schema/SchemaValidationPrinter.js.map +1 -1
  169. package/dist/development/src/lib/schema/collectReferences.cjs.map +1 -1
  170. package/dist/development/src/lib/schema/collectReferences.js.map +1 -1
  171. package/dist/development/src/lib/stream.cjs +0 -7
  172. package/dist/development/src/lib/stream.cjs.map +1 -1
  173. package/dist/development/src/lib/stream.js +1 -8
  174. package/dist/development/src/lib/stream.js.map +1 -1
  175. package/dist/development/src/lib/tenant/TenantClient.cjs.map +1 -1
  176. package/dist/development/src/lib/tenant/TenantClient.js.map +1 -1
  177. package/dist/development/src/lib/transfer/DataTransferClient.cjs +53 -61
  178. package/dist/development/src/lib/transfer/DataTransferClient.cjs.map +1 -1
  179. package/dist/development/src/lib/transfer/DataTransferClient.js +55 -63
  180. package/dist/development/src/lib/transfer/DataTransferClient.js.map +1 -1
  181. package/dist/development/src/lib/transfer/stdio.cjs.map +1 -1
  182. package/dist/development/src/lib/transfer/stdio.js.map +1 -1
  183. package/dist/development/src/lib/workspace/WorkspaceResolver.cjs +4 -4
  184. package/dist/development/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
  185. package/dist/development/src/lib/workspace/WorkspaceResolver.js +5 -5
  186. package/dist/development/src/lib/workspace/WorkspaceResolver.js.map +1 -1
  187. package/dist/production/run.cjs.map +1 -1
  188. package/dist/production/run.js +0 -0
  189. package/dist/production/run.js.map +1 -1
  190. package/dist/production/src/commands/actions/ActionsGetEventCommand.cjs +31 -0
  191. package/dist/production/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -0
  192. package/dist/production/src/commands/actions/ActionsGetEventCommand.js +31 -0
  193. package/dist/production/src/commands/actions/ActionsGetEventCommand.js.map +1 -0
  194. package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs +60 -0
  195. package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -0
  196. package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js +60 -0
  197. package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -0
  198. package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs +29 -0
  199. package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -0
  200. package/dist/production/src/commands/actions/ActionsListVariablesCommand.js +29 -0
  201. package/dist/production/src/commands/actions/ActionsListVariablesCommand.js.map +1 -0
  202. package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs +32 -0
  203. package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -0
  204. package/dist/production/src/commands/actions/ActionsRetryEventCommand.js +32 -0
  205. package/dist/production/src/commands/actions/ActionsRetryEventCommand.js.map +1 -0
  206. package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs +43 -0
  207. package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -0
  208. package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js +43 -0
  209. package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -0
  210. package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs +32 -0
  211. package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -0
  212. package/dist/production/src/commands/actions/ActionsStopEventCommand.js +32 -0
  213. package/dist/production/src/commands/actions/ActionsStopEventCommand.js.map +1 -0
  214. package/dist/production/src/commands/deploy/DeployCommand.cjs.map +1 -1
  215. package/dist/production/src/commands/deploy/DeployCommand.js.map +1 -1
  216. package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
  217. package/dist/production/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
  218. package/dist/production/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -1
  219. package/dist/production/src/commands/migrations/MigrationBlankCommand.js.map +1 -1
  220. package/dist/production/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
  221. package/dist/production/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
  222. package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
  223. package/dist/production/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
  224. package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
  225. package/dist/production/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
  226. package/dist/production/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
  227. package/dist/production/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
  228. package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs +1 -1
  229. package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
  230. package/dist/production/src/commands/migrations/MigrationStatusCommand.js +1 -1
  231. package/dist/production/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
  232. package/dist/production/src/commands/misc/VersionCommand.cjs.map +1 -1
  233. package/dist/production/src/commands/misc/VersionCommand.js.map +1 -1
  234. package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
  235. package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
  236. package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
  237. package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
  238. package/dist/production/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
  239. package/dist/production/src/commands/project/ProjectValidateCommand.js.map +1 -1
  240. package/dist/production/src/commands/transfer/ExportCommand.cjs +7 -2
  241. package/dist/production/src/commands/transfer/ExportCommand.cjs.map +1 -1
  242. package/dist/production/src/commands/transfer/ExportCommand.js +8 -3
  243. package/dist/production/src/commands/transfer/ExportCommand.js.map +1 -1
  244. package/dist/production/src/commands/transfer/ImportCommand.cjs +7 -4
  245. package/dist/production/src/commands/transfer/ImportCommand.cjs.map +1 -1
  246. package/dist/production/src/commands/transfer/ImportCommand.js +5 -2
  247. package/dist/production/src/commands/transfer/ImportCommand.js.map +1 -1
  248. package/dist/production/src/commands/transfer/TransferCommand.cjs +4 -5
  249. package/dist/production/src/commands/transfer/TransferCommand.cjs.map +1 -1
  250. package/dist/production/src/commands/transfer/TransferCommand.js +4 -5
  251. package/dist/production/src/commands/transfer/TransferCommand.js.map +1 -1
  252. package/dist/production/src/commands/transfer/utils.cjs.map +1 -1
  253. package/dist/production/src/commands/transfer/utils.js.map +1 -1
  254. package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs +16 -14
  255. package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
  256. package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js +16 -14
  257. package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
  258. package/dist/production/src/consts.cjs.map +1 -1
  259. package/dist/production/src/dic.cjs +100 -4
  260. package/dist/production/src/dic.cjs.map +1 -1
  261. package/dist/production/src/dic.js +101 -5
  262. package/dist/production/src/dic.js.map +1 -1
  263. package/dist/production/src/lib/SystemClientProvider.cjs.map +1 -1
  264. package/dist/production/src/lib/SystemClientProvider.js.map +1 -1
  265. package/dist/production/src/lib/TenantClientProvider.cjs.map +1 -1
  266. package/dist/production/src/lib/TenantClientProvider.js.map +1 -1
  267. package/dist/production/src/lib/VersionChecker.cjs +7 -9
  268. package/dist/production/src/lib/VersionChecker.cjs.map +1 -1
  269. package/dist/production/src/lib/VersionChecker.js +7 -9
  270. package/dist/production/src/lib/VersionChecker.js.map +1 -1
  271. package/dist/production/src/lib/actions/ActionsClient.cjs +91 -0
  272. package/dist/production/src/lib/actions/ActionsClient.cjs.map +1 -0
  273. package/dist/production/src/lib/actions/ActionsClient.js +91 -0
  274. package/dist/production/src/lib/actions/ActionsClient.js.map +1 -0
  275. package/dist/production/src/lib/admin/AdminClient.cjs.map +1 -1
  276. package/dist/production/src/lib/admin/AdminClient.js.map +1 -1
  277. package/dist/production/src/lib/admin/AdminDeployer.cjs.map +1 -1
  278. package/dist/production/src/lib/admin/AdminDeployer.js.map +1 -1
  279. package/dist/production/src/lib/assertNever.cjs.map +1 -1
  280. package/dist/production/src/lib/assertNever.js.map +1 -1
  281. package/dist/production/src/lib/dsn.cjs.map +1 -1
  282. package/dist/production/src/lib/dsn.js.map +1 -1
  283. package/dist/production/src/lib/env.cjs.map +1 -1
  284. package/dist/production/src/lib/env.js.map +1 -1
  285. package/dist/production/src/lib/fs/DockerComposeManager.cjs.map +1 -1
  286. package/dist/production/src/lib/fs/DockerComposeManager.js.map +1 -1
  287. package/dist/production/src/lib/fs/FileSystem.cjs.map +1 -1
  288. package/dist/production/src/lib/fs/FileSystem.js.map +1 -1
  289. package/dist/production/src/lib/fs/YamlHandler.cjs.map +1 -1
  290. package/dist/production/src/lib/fs/YamlHandler.js.map +1 -1
  291. package/dist/production/src/lib/js/EsBuildBuilder.cjs.map +1 -1
  292. package/dist/production/src/lib/js/EsBuildBuilder.js.map +1 -1
  293. package/dist/production/src/lib/js/EvalExecutor.cjs.map +1 -1
  294. package/dist/production/src/lib/js/EvalExecutor.js.map +1 -1
  295. package/dist/production/src/lib/js/JsCodeRunner.cjs.map +1 -1
  296. package/dist/production/src/lib/js/JsCodeRunner.js.map +1 -1
  297. package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs +2 -1
  298. package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
  299. package/dist/production/src/lib/migrations/MigrationExecutionFacade.js +2 -1
  300. package/dist/production/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
  301. package/dist/production/src/lib/migrations/MigrationPrinter.cjs +7 -2
  302. package/dist/production/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
  303. package/dist/production/src/lib/migrations/MigrationPrinter.js +7 -2
  304. package/dist/production/src/lib/migrations/MigrationPrinter.js.map +1 -1
  305. package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
  306. package/dist/production/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
  307. package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs +3 -3
  308. package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
  309. package/dist/production/src/lib/migrations/MigrationsStatusFacade.js +3 -3
  310. package/dist/production/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
  311. package/dist/production/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
  312. package/dist/production/src/lib/migrations/MigrationsValidator.js.map +1 -1
  313. package/dist/production/src/lib/project/RemoteProject.cjs.map +1 -1
  314. package/dist/production/src/lib/project/RemoteProject.js.map +1 -1
  315. package/dist/production/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
  316. package/dist/production/src/lib/project/RemoteProjectProvider.js.map +1 -1
  317. package/dist/production/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
  318. package/dist/production/src/lib/project/RemoteProjectResolver.js.map +1 -1
  319. package/dist/production/src/lib/project/docs/components/EntityInfo.cjs +39 -66
  320. package/dist/production/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
  321. package/dist/production/src/lib/project/docs/components/EntityInfo.js +40 -67
  322. package/dist/production/src/lib/project/docs/components/EntityInfo.js.map +1 -1
  323. package/dist/production/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
  324. package/dist/production/src/lib/project/docs/components/EntityLink.js.map +1 -1
  325. package/dist/production/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
  326. package/dist/production/src/lib/project/docs/components/FieldLink.js.map +1 -1
  327. package/dist/production/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
  328. package/dist/production/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
  329. package/dist/production/src/lib/project/docs/components/FieldType.cjs +3 -5
  330. package/dist/production/src/lib/project/docs/components/FieldType.cjs.map +1 -1
  331. package/dist/production/src/lib/project/docs/components/FieldType.js +3 -5
  332. package/dist/production/src/lib/project/docs/components/FieldType.js.map +1 -1
  333. package/dist/production/src/lib/project/docs/components/OnDelete.cjs +4 -8
  334. package/dist/production/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
  335. package/dist/production/src/lib/project/docs/components/OnDelete.js +4 -8
  336. package/dist/production/src/lib/project/docs/components/OnDelete.js.map +1 -1
  337. package/dist/production/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
  338. package/dist/production/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
  339. package/dist/production/src/lib/project/docs/components/SinglePermission.cjs.map +1 -1
  340. package/dist/production/src/lib/project/docs/components/SinglePermission.js.map +1 -1
  341. package/dist/production/src/lib/project/docs/components/utils.cjs.map +1 -1
  342. package/dist/production/src/lib/project/docs/components/utils.js.map +1 -1
  343. package/dist/production/src/lib/project/docs/projectDescribe.cjs.map +1 -1
  344. package/dist/production/src/lib/project/docs/projectDescribe.js.map +1 -1
  345. package/dist/production/src/lib/schema/SchemaLoader.cjs.map +1 -1
  346. package/dist/production/src/lib/schema/SchemaLoader.js.map +1 -1
  347. package/dist/production/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
  348. package/dist/production/src/lib/schema/SchemaValidationPrinter.cjs.map +1 -1
  349. package/dist/production/src/lib/schema/SchemaValidationPrinter.js.map +1 -1
  350. package/dist/production/src/lib/schema/collectReferences.cjs.map +1 -1
  351. package/dist/production/src/lib/schema/collectReferences.js.map +1 -1
  352. package/dist/production/src/lib/stream.cjs +0 -7
  353. package/dist/production/src/lib/stream.cjs.map +1 -1
  354. package/dist/production/src/lib/stream.js +1 -8
  355. package/dist/production/src/lib/stream.js.map +1 -1
  356. package/dist/production/src/lib/tenant/TenantClient.cjs.map +1 -1
  357. package/dist/production/src/lib/tenant/TenantClient.js.map +1 -1
  358. package/dist/production/src/lib/transfer/DataTransferClient.cjs +53 -61
  359. package/dist/production/src/lib/transfer/DataTransferClient.cjs.map +1 -1
  360. package/dist/production/src/lib/transfer/DataTransferClient.js +55 -63
  361. package/dist/production/src/lib/transfer/DataTransferClient.js.map +1 -1
  362. package/dist/production/src/lib/transfer/stdio.cjs.map +1 -1
  363. package/dist/production/src/lib/transfer/stdio.js.map +1 -1
  364. package/dist/production/src/lib/workspace/WorkspaceResolver.cjs +4 -4
  365. package/dist/production/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
  366. package/dist/production/src/lib/workspace/WorkspaceResolver.js +5 -5
  367. package/dist/production/src/lib/workspace/WorkspaceResolver.js.map +1 -1
  368. package/dist/types/commands/actions/ActionsGetEventCommand.d.ts +16 -0
  369. package/dist/types/commands/actions/ActionsGetEventCommand.d.ts.map +1 -0
  370. package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts +15 -0
  371. package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts.map +1 -0
  372. package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts +14 -0
  373. package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts.map +1 -0
  374. package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts +16 -0
  375. package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts.map +1 -0
  376. package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts +19 -0
  377. package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts.map +1 -0
  378. package/dist/types/commands/actions/ActionsStopEventCommand.d.ts +16 -0
  379. package/dist/types/commands/actions/ActionsStopEventCommand.d.ts.map +1 -0
  380. package/dist/types/commands/deploy/DeployCommand.d.ts.map +1 -1
  381. package/dist/types/commands/migrations/MigrationAmendCommand.d.ts.map +1 -1
  382. package/dist/types/commands/migrations/MigrationBlankCommand.d.ts.map +1 -1
  383. package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts.map +1 -1
  384. package/dist/types/commands/migrations/MigrationDiffCommand.d.ts.map +1 -1
  385. package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts.map +1 -1
  386. package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts.map +1 -1
  387. package/dist/types/commands/migrations/MigrationStatusCommand.d.ts.map +1 -1
  388. package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts.map +1 -1
  389. package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
  390. package/dist/types/commands/transfer/ExportCommand.d.ts.map +1 -1
  391. package/dist/types/commands/transfer/ImportCommand.d.ts.map +1 -1
  392. package/dist/types/commands/transfer/TransferCommand.d.ts.map +1 -1
  393. package/dist/types/commands/transfer/utils.d.ts.map +1 -1
  394. package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +1 -1
  395. package/dist/types/dic.d.ts +18 -0
  396. package/dist/types/dic.d.ts.map +1 -1
  397. package/dist/types/lib/VersionChecker.d.ts.map +1 -1
  398. package/dist/types/lib/actions/ActionsClient.d.ts +33 -0
  399. package/dist/types/lib/actions/ActionsClient.d.ts.map +1 -0
  400. package/dist/types/lib/admin/AdminClient.d.ts.map +1 -1
  401. package/dist/types/lib/admin/AdminDeployer.d.ts.map +1 -1
  402. package/dist/types/lib/fs/DockerComposeManager.d.ts.map +1 -1
  403. package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts.map +1 -1
  404. package/dist/types/lib/migrations/MigrationPrinter.d.ts +1 -1
  405. package/dist/types/lib/migrations/MigrationPrinter.d.ts.map +1 -1
  406. package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts +3 -1
  407. package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts.map +1 -1
  408. package/dist/types/lib/project/docs/components/EntityInfo.d.ts.map +1 -1
  409. package/dist/types/lib/project/docs/components/FieldLink.d.ts.map +1 -1
  410. package/dist/types/lib/project/docs/components/FieldPermissions.d.ts.map +1 -1
  411. package/dist/types/lib/project/docs/components/FieldType.d.ts.map +1 -1
  412. package/dist/types/lib/project/docs/components/OnDelete.d.ts.map +1 -1
  413. package/dist/types/lib/project/docs/components/ProjectInfo.d.ts.map +1 -1
  414. package/dist/types/lib/project/docs/projectDescribe.d.ts.map +1 -1
  415. package/dist/types/lib/schema/SchemaValidationPrinter.d.ts.map +1 -1
  416. package/dist/types/lib/stream.d.ts.map +1 -1
  417. package/dist/types/lib/tenant/TenantClient.d.ts.map +1 -1
  418. package/dist/types/lib/transfer/DataTransferClient.d.ts +2 -4
  419. package/dist/types/lib/transfer/DataTransferClient.d.ts.map +1 -1
  420. package/package.json +39 -35
  421. package/src/commands/actions/ActionsGetEventCommand.ts +41 -0
  422. package/src/commands/actions/ActionsListFailedEventsCommand.ts +68 -0
  423. package/src/commands/actions/ActionsListVariablesCommand.ts +36 -0
  424. package/src/commands/actions/ActionsRetryEventCommand.ts +42 -0
  425. package/src/commands/actions/ActionsSetVariablesCommand.ts +62 -0
  426. package/src/commands/actions/ActionsStopEventCommand.ts +42 -0
  427. package/src/commands/deploy/DeployCommand.ts +0 -3
  428. package/src/commands/migrations/MigrationAmendCommand.ts +2 -2
  429. package/src/commands/migrations/MigrationBlankCommand.ts +1 -3
  430. package/src/commands/migrations/MigrationDescribeCommand.ts +0 -1
  431. package/src/commands/migrations/MigrationDiffCommand.ts +0 -2
  432. package/src/commands/migrations/MigrationExecuteCommand.ts +1 -2
  433. package/src/commands/migrations/MigrationRebaseCommand.ts +0 -2
  434. package/src/commands/migrations/MigrationStatusCommand.ts +8 -13
  435. package/src/commands/project/ProjectGenerateDocumentationCommand.ts +1 -2
  436. package/src/commands/project/ProjectPrintSchemaCommand.ts +1 -3
  437. package/src/commands/transfer/ExportCommand.ts +9 -4
  438. package/src/commands/transfer/ImportCommand.ts +7 -3
  439. package/src/commands/transfer/TransferCommand.ts +6 -6
  440. package/src/commands/transfer/utils.ts +0 -1
  441. package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +16 -14
  442. package/src/dic.ts +162 -103
  443. package/src/lib/VersionChecker.ts +11 -9
  444. package/src/lib/actions/ActionsClient.ts +111 -0
  445. package/src/lib/admin/AdminClient.ts +2 -2
  446. package/src/lib/admin/AdminDeployer.ts +0 -1
  447. package/src/lib/fs/DockerComposeManager.ts +0 -3
  448. package/src/lib/migrations/MigrationExecutionFacade.ts +1 -0
  449. package/src/lib/migrations/MigrationPrinter.ts +7 -4
  450. package/src/lib/migrations/MigrationsStatusFacade.ts +4 -4
  451. package/src/lib/project/RemoteProjectResolver.ts +2 -2
  452. package/src/lib/project/docs/components/EntityInfo.tsx +36 -31
  453. package/src/lib/project/docs/components/FieldLink.tsx +5 -1
  454. package/src/lib/project/docs/components/FieldPermissions.tsx +8 -6
  455. package/src/lib/project/docs/components/FieldType.tsx +31 -30
  456. package/src/lib/project/docs/components/OnDelete.tsx +15 -13
  457. package/src/lib/project/docs/components/ProjectInfo.tsx +1 -4
  458. package/src/lib/project/docs/components/SinglePermission.tsx +0 -1
  459. package/src/lib/project/docs/components/utils.ts +0 -1
  460. package/src/lib/project/docs/projectDescribe.tsx +0 -2
  461. package/src/lib/project/docs/resources/style.css +2 -3
  462. package/src/lib/schema/SchemaLoader.ts +1 -1
  463. package/src/lib/schema/SchemaValidationPrinter.ts +0 -1
  464. package/src/lib/stream.ts +7 -8
  465. package/src/lib/tenant/TenantClient.ts +0 -1
  466. package/src/lib/transfer/DataTransferClient.ts +56 -74
  467. package/src/lib/transfer/stdio.ts +0 -1
  468. package/src/lib/workspace/WorkspaceResolver.ts +5 -5
  469. package/src/run.ts +2 -5
  470. package/dist/development/src/lib/migrations/migrations.cjs +0 -43
  471. package/dist/development/src/lib/migrations/migrations.cjs.map +0 -1
  472. package/dist/development/src/lib/migrations/migrations.js +0 -43
  473. package/dist/development/src/lib/migrations/migrations.js.map +0 -1
  474. package/dist/production/src/lib/migrations/migrations.cjs +0 -43
  475. package/dist/production/src/lib/migrations/migrations.cjs.map +0 -1
  476. package/dist/production/src/lib/migrations/migrations.js +0 -43
  477. package/dist/production/src/lib/migrations/migrations.js.map +0 -1
  478. package/dist/types/lib/migrations/migrations.d.ts +0 -3
  479. package/dist/types/lib/migrations/migrations.d.ts.map +0 -1
  480. package/dist/types/tsconfig.tsbuildinfo +0 -1
  481. package/postcss.config.js +0 -6
  482. package/src/.eslintrc.cjs +0 -5
  483. package/src/lib/migrations/migrations.ts +0 -45
  484. package/src/lib/project/docs/.eslintrc.cjs +0 -5
  485. package/tailwind.config.js +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaLoader.js","sources":["../../../../../../packages/cli/src/lib/schema/SchemaLoader.ts"],"sourcesContent":["import { join } from 'node:path'\nimport { Schema } from '@contember/schema'\nimport { schemaType } from '@contember/schema-utils'\nimport { JsCodeRunner } from '../js/JsCodeRunner'\nimport * as Typesafe from '@contember/typesafe'\nimport { Workspace } from '../workspace/Workspace'\n\nexport class ImportSchemaLoader {\n\tconstructor(\n\t\tprivate readonly workspace: Workspace,\n\t) {\n\t}\n\n\tloadSchema = async (): Promise<Schema> => {\n\t\tconst path = join(this.workspace.apiDir, 'index.ts')\n\t\tconst result = await import(path)\n\t\treturn Typesafe.object({ default: schemaType })(result).default\n\t}\n}\n\nexport class TranspilingSchemaLoader {\n\tconstructor(\n\t\tprivate readonly workspace: Workspace,\n\t\tprivate readonly jsCodeRunner: JsCodeRunner,\n\t) {\n\t}\n\n\tloadSchema = async (): Promise<Schema> => {\n\t\tconst path = join(this.workspace.apiDir, 'index.ts')\n\n\t\tconst result = (await this.jsCodeRunner.run(path))\n\t\treturn Typesafe.object({ default: schemaType })(result).default\n\t}\n}\n\nexport interface SchemaLoader {\n\tloadSchema(): Promise<Schema>\n}\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,mBAAmB;AAAA,EAC/B,YACkB,WAChB;AADgB,SAAA,YAAA;AAIlB,kBAAA,MAAA,cAAa,YAA6B;AACzC,YAAM,OAAO,KAAK,KAAK,UAAU,QAAQ,UAAU;AAC7C,YAAA,SAAS,MAAM,OAAO;AACrB,aAAA,SAAS,OAAO,EAAE,SAAS,YAAY,EAAE,MAAM,EAAE;AAAA,IAAA,CACzD;AAAA,EAAA;AACD;AAEO,MAAM,wBAAwB;AAAA,EACpC,YACkB,WACA,cAChB;AAFgB,SAAA,YAAA;AACA,SAAA,eAAA;AAIlB,kBAAA,MAAA,cAAa,YAA6B;AACzC,YAAM,OAAO,KAAK,KAAK,UAAU,QAAQ,UAAU;AAEnD,YAAM,SAAU,MAAM,KAAK,aAAa,IAAI,IAAI;AACzC,aAAA,SAAS,OAAO,EAAE,SAAS,YAAY,EAAE,MAAM,EAAE;AAAA,IAAA,CACzD;AAAA,EAAA;AACD;"}
1
+ {"version":3,"file":"SchemaLoader.js","sources":["../../../../../../packages/cli/src/lib/schema/SchemaLoader.ts"],"sourcesContent":["import { join } from 'node:path'\nimport { Schema } from '@contember/schema'\nimport { schemaType } from '@contember/schema-utils'\nimport { JsCodeRunner } from '../js/JsCodeRunner'\nimport * as Typesafe from '@contember/typesafe'\nimport { Workspace } from '../workspace/Workspace'\n\nexport class ImportSchemaLoader {\n\tconstructor(\n\t\tprivate readonly workspace: Workspace,\n\t) {\n\t}\n\n\tloadSchema = async (): Promise<Schema> => {\n\t\tconst path = join(this.workspace.apiDir, 'index.ts')\n\t\tconst result = await import(path)\n\t\treturn Typesafe.object({ default: schemaType })(result).default\n\t}\n}\n\nexport class TranspilingSchemaLoader {\n\tconstructor(\n\t\tprivate readonly workspace: Workspace,\n\t\tprivate readonly jsCodeRunner: JsCodeRunner,\n\t) {\n\t}\n\n\tloadSchema = async (): Promise<Schema> => {\n\t\tconst path = join(this.workspace.apiDir, 'index.ts')\n\n\t\tconst result = await this.jsCodeRunner.run(path)\n\t\treturn Typesafe.object({ default: schemaType })(result).default\n\t}\n}\n\nexport interface SchemaLoader {\n\tloadSchema(): Promise<Schema>\n}\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,mBAAmB;AAAA,EAC/B,YACkB,WAChB;AADgB,SAAA,YAAA;AAIlB,kBAAA,MAAA,cAAa,YAA6B;AACzC,YAAM,OAAO,KAAK,KAAK,UAAU,QAAQ,UAAU;AACnD,YAAM,SAAS,MAAM,OAAO;AAC5B,aAAO,SAAS,OAAO,EAAE,SAAS,YAAY,EAAE,MAAM,EAAE;AAAA,IACzD,CAAA;AAAA,EANA;AAOD;AAEO,MAAM,wBAAwB;AAAA,EACpC,YACkB,WACA,cAChB;AAFgB,SAAA,YAAA;AACA,SAAA,eAAA;AAIlB,kBAAA,MAAA,cAAa,YAA6B;AACzC,YAAM,OAAO,KAAK,KAAK,UAAU,QAAQ,UAAU;AAEnD,YAAM,SAAS,MAAM,KAAK,aAAa,IAAI,IAAI;AAC/C,aAAO,SAAS,OAAO,EAAE,SAAS,YAAY,EAAE,MAAM,EAAE;AAAA,IACzD,CAAA;AAAA,EAPA;AAQD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaValidationHelper.cjs","sources":["../../../../../../packages/cli/src/lib/schema/SchemaValidationHelper.ts"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { SchemaValidator, SchemaValidatorSkippedErrors } from '@contember/schema-utils'\nimport { printValidationErrors } from './SchemaValidationPrinter'\n\nexport const validateSchemaAndPrintErrors = (schema: Schema, message?: string, skippedErrors?: SchemaValidatorSkippedErrors[]): boolean => {\n\tconst errors = SchemaValidator.validate(schema, skippedErrors)\n\tprintValidationErrors(errors, message)\n\treturn errors.length === 0\n}\n"],"names":["SchemaValidator","printValidationErrors"],"mappings":";;;;AAIO,MAAM,+BAA+B,CAAC,QAAgB,SAAkB,kBAA4D;AAC1I,QAAM,SAASA,YAAA,gBAAgB,SAAS,QAAQ,aAAa;AAC7DC,0BAAA,sBAAsB,QAAQ,OAAO;AACrC,SAAO,OAAO,WAAW;AAC1B;;"}
1
+ {"version":3,"file":"SchemaValidationHelper.cjs","sources":["../../../../../../packages/cli/src/lib/schema/SchemaValidationHelper.ts"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { SchemaValidator, SchemaValidatorSkippedErrors } from '@contember/schema-utils'\nimport { printValidationErrors } from './SchemaValidationPrinter'\n\nexport const validateSchemaAndPrintErrors = (schema: Schema, message?: string, skippedErrors?: SchemaValidatorSkippedErrors[]): boolean => {\n\tconst errors = SchemaValidator.validate(schema, skippedErrors)\n\tprintValidationErrors(errors, message)\n\treturn errors.length === 0\n}\n"],"names":["SchemaValidator","printValidationErrors"],"mappings":";;;;AAIO,MAAM,+BAA+B,CAAC,QAAgB,SAAkB,kBAA4D;AAC1I,QAAM,SAASA,YAAAA,gBAAgB,SAAS,QAAQ,aAAa;AAC7DC,0BAAAA,sBAAsB,QAAQ,OAAO;AACrC,SAAO,OAAO,WAAW;AAC1B;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaValidationPrinter.cjs","sources":["../../../../../../packages/cli/src/lib/schema/SchemaValidationPrinter.ts"],"sourcesContent":["import { ValidationError } from '@contember/schema-utils'\n\n\nexport const printValidationErrors = (errors: ValidationError[], message?: string) => {\n\tif (errors.length === 0) {\n\t\treturn\n\t}\n\tconsole.group(message || 'Schema is invalid:')\n\tfor (const err of errors) {\n\t\tconsole.log(`${err.path.join('.')}: [${err.code}] ${err.message}`)\n\t}\n\tconsole.groupEnd()\n}\n"],"names":[],"mappings":";;AAGa,MAAA,wBAAwB,CAAC,QAA2B,YAAqB;AACjF,MAAA,OAAO,WAAW,GAAG;AACxB;AAAA,EAAA;AAEO,UAAA,MAAM,WAAW,oBAAoB;AAC7C,aAAW,OAAO,QAAQ;AACzB,YAAQ,IAAI,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,MAAM,IAAI,IAAI,KAAK,IAAI,OAAO,EAAE;AAAA,EAAA;AAElE,UAAQ,SAAS;AAClB;;"}
1
+ {"version":3,"file":"SchemaValidationPrinter.cjs","sources":["../../../../../../packages/cli/src/lib/schema/SchemaValidationPrinter.ts"],"sourcesContent":["import { ValidationError } from '@contember/schema-utils'\n\nexport const printValidationErrors = (errors: ValidationError[], message?: string) => {\n\tif (errors.length === 0) {\n\t\treturn\n\t}\n\tconsole.group(message || 'Schema is invalid:')\n\tfor (const err of errors) {\n\t\tconsole.log(`${err.path.join('.')}: [${err.code}] ${err.message}`)\n\t}\n\tconsole.groupEnd()\n}\n"],"names":[],"mappings":";;AAEO,MAAM,wBAAwB,CAAC,QAA2B,YAAqB;AACrF,MAAI,OAAO,WAAW,GAAG;AACxB;AAAA,EACD;AACA,UAAQ,MAAM,WAAW,oBAAoB;AAC7C,aAAW,OAAO,QAAQ;AACzB,YAAQ,IAAI,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,MAAM,IAAI,IAAI,KAAK,IAAI,OAAO,EAAE;AAAA,EAClE;AACA,UAAQ,SAAA;AACT;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaValidationPrinter.js","sources":["../../../../../../packages/cli/src/lib/schema/SchemaValidationPrinter.ts"],"sourcesContent":["import { ValidationError } from '@contember/schema-utils'\n\n\nexport const printValidationErrors = (errors: ValidationError[], message?: string) => {\n\tif (errors.length === 0) {\n\t\treturn\n\t}\n\tconsole.group(message || 'Schema is invalid:')\n\tfor (const err of errors) {\n\t\tconsole.log(`${err.path.join('.')}: [${err.code}] ${err.message}`)\n\t}\n\tconsole.groupEnd()\n}\n"],"names":[],"mappings":"AAGa,MAAA,wBAAwB,CAAC,QAA2B,YAAqB;AACjF,MAAA,OAAO,WAAW,GAAG;AACxB;AAAA,EAAA;AAEO,UAAA,MAAM,WAAW,oBAAoB;AAC7C,aAAW,OAAO,QAAQ;AACzB,YAAQ,IAAI,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,MAAM,IAAI,IAAI,KAAK,IAAI,OAAO,EAAE;AAAA,EAAA;AAElE,UAAQ,SAAS;AAClB;"}
1
+ {"version":3,"file":"SchemaValidationPrinter.js","sources":["../../../../../../packages/cli/src/lib/schema/SchemaValidationPrinter.ts"],"sourcesContent":["import { ValidationError } from '@contember/schema-utils'\n\nexport const printValidationErrors = (errors: ValidationError[], message?: string) => {\n\tif (errors.length === 0) {\n\t\treturn\n\t}\n\tconsole.group(message || 'Schema is invalid:')\n\tfor (const err of errors) {\n\t\tconsole.log(`${err.path.join('.')}: [${err.code}] ${err.message}`)\n\t}\n\tconsole.groupEnd()\n}\n"],"names":[],"mappings":"AAEO,MAAM,wBAAwB,CAAC,QAA2B,YAAqB;AACrF,MAAI,OAAO,WAAW,GAAG;AACxB;AAAA,EACD;AACA,UAAQ,MAAM,WAAW,oBAAoB;AAC7C,aAAW,OAAO,QAAQ;AACzB,YAAQ,IAAI,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,MAAM,IAAI,IAAI,KAAK,IAAI,OAAO,EAAE;AAAA,EAClE;AACA,UAAQ,SAAA;AACT;"}
@@ -1 +1 @@
1
- {"version":3,"file":"collectReferences.cjs","sources":["../../../../../../packages/cli/src/lib/schema/collectReferences.ts"],"sourcesContent":["import { Model } from '@contember/schema'\n\nexport type ReferenceMapEntry = {\n\towningEntity: Model.Entity\n\towningRelation: Model.OneHasOneOwningRelation | Model.ManyHasOneRelation\n\ttargetEntity: Model.Entity\n\ttargetRelation: Model.OneHasOneInverseRelation | Model.OneHasManyRelation | null\n}\nexport type ReferencesMap = Record<string, ReferenceMapEntry[]>\n\nexport const collectReferences = (model: Model.Schema): ReferencesMap => {\n\tconst entityReferences: ReferencesMap = Object.fromEntries(Object.keys(model.entities).map(it => [it, []]))\n\tfor (const entity of Object.values(model.entities)) {\n\t\tfor (const field of Object.values(entity.fields)) {\n\t\t\tswitch (field.type) {\n\t\t\t\tcase 'OneHasOne':\n\t\t\t\t\tconst targetEntity = model.entities[field.target]\n\t\t\t\t\tif (!('ownedBy' in field)) {\n\t\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\t\ttargetEntity: targetEntity,\n\t\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity.fields[field.inversedBy] as Model.OneHasOneInverseRelation : null,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'ManyHasOne':\n\t\t\t\t\tconst targetEntity2 = model.entities[field.target]\n\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\ttargetEntity: targetEntity2,\n\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity2.fields[field.inversedBy] as Model.OneHasManyRelation : null,\n\t\t\t\t\t})\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn entityReferences\n}\n"],"names":[],"mappings":";;AAUa,MAAA,oBAAoB,CAAC,UAAuC;AACxE,QAAM,mBAAkC,OAAO,YAAY,OAAO,KAAK,MAAM,QAAQ,EAAE,IAAI,QAAM,CAAC,IAAI,CAAA,CAAE,CAAC,CAAC;AAC1G,aAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AACnD,eAAW,SAAS,OAAO,OAAO,OAAO,MAAM,GAAG;AACjD,cAAQ,MAAM,MAAM;AAAA,QACnB,KAAK;AACJ,gBAAM,eAAe,MAAM,SAAS,MAAM,MAAM;AAC5C,cAAA,EAAE,aAAa,QAAQ;AACT,6BAAA,MAAM,MAAM,EAAE,KAAK;AAAA,cACnC,cAAc;AAAA,cACd,gBAAgB;AAAA,cAChB;AAAA,cACA,gBAAgB,MAAM,aAAa,aAAa,OAAO,MAAM,UAAU,IAAsC;AAAA,YAAA,CAC7G;AAAA,UAAA;AAEF;AAAA,QACD,KAAK;AACJ,gBAAM,gBAAgB,MAAM,SAAS,MAAM,MAAM;AAChC,2BAAA,MAAM,MAAM,EAAE,KAAK;AAAA,YACnC,cAAc;AAAA,YACd,gBAAgB;AAAA,YAChB,cAAc;AAAA,YACd,gBAAgB,MAAM,aAAa,cAAc,OAAO,MAAM,UAAU,IAAgC;AAAA,UAAA,CACxG;AACD;AAAA,MAAA;AAAA,IACF;AAAA,EACD;AAEM,SAAA;AACR;;"}
1
+ {"version":3,"file":"collectReferences.cjs","sources":["../../../../../../packages/cli/src/lib/schema/collectReferences.ts"],"sourcesContent":["import { Model } from '@contember/schema'\n\nexport type ReferenceMapEntry = {\n\towningEntity: Model.Entity\n\towningRelation: Model.OneHasOneOwningRelation | Model.ManyHasOneRelation\n\ttargetEntity: Model.Entity\n\ttargetRelation: Model.OneHasOneInverseRelation | Model.OneHasManyRelation | null\n}\nexport type ReferencesMap = Record<string, ReferenceMapEntry[]>\n\nexport const collectReferences = (model: Model.Schema): ReferencesMap => {\n\tconst entityReferences: ReferencesMap = Object.fromEntries(Object.keys(model.entities).map(it => [it, []]))\n\tfor (const entity of Object.values(model.entities)) {\n\t\tfor (const field of Object.values(entity.fields)) {\n\t\t\tswitch (field.type) {\n\t\t\t\tcase 'OneHasOne':\n\t\t\t\t\tconst targetEntity = model.entities[field.target]\n\t\t\t\t\tif (!('ownedBy' in field)) {\n\t\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\t\ttargetEntity: targetEntity,\n\t\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity.fields[field.inversedBy] as Model.OneHasOneInverseRelation : null,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'ManyHasOne':\n\t\t\t\t\tconst targetEntity2 = model.entities[field.target]\n\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\ttargetEntity: targetEntity2,\n\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity2.fields[field.inversedBy] as Model.OneHasManyRelation : null,\n\t\t\t\t\t})\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn entityReferences\n}\n"],"names":[],"mappings":";;AAUO,MAAM,oBAAoB,CAAC,UAAuC;AACxE,QAAM,mBAAkC,OAAO,YAAY,OAAO,KAAK,MAAM,QAAQ,EAAE,IAAI,QAAM,CAAC,IAAI,CAAA,CAAE,CAAC,CAAC;AAC1G,aAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AACnD,eAAW,SAAS,OAAO,OAAO,OAAO,MAAM,GAAG;AACjD,cAAQ,MAAM,MAAA;AAAA,QACb,KAAK;AACJ,gBAAM,eAAe,MAAM,SAAS,MAAM,MAAM;AAChD,cAAI,EAAE,aAAa,QAAQ;AAC1B,6BAAiB,MAAM,MAAM,EAAE,KAAK;AAAA,cACnC,cAAc;AAAA,cACd,gBAAgB;AAAA,cAChB;AAAA,cACA,gBAAgB,MAAM,aAAa,aAAa,OAAO,MAAM,UAAU,IAAsC;AAAA,YAAA,CAC7G;AAAA,UACF;AACA;AAAA,QACD,KAAK;AACJ,gBAAM,gBAAgB,MAAM,SAAS,MAAM,MAAM;AACjD,2BAAiB,MAAM,MAAM,EAAE,KAAK;AAAA,YACnC,cAAc;AAAA,YACd,gBAAgB;AAAA,YAChB,cAAc;AAAA,YACd,gBAAgB,MAAM,aAAa,cAAc,OAAO,MAAM,UAAU,IAAgC;AAAA,UAAA,CACxG;AACD;AAAA,MAAA;AAAA,IAEH;AAAA,EACD;AACA,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"collectReferences.js","sources":["../../../../../../packages/cli/src/lib/schema/collectReferences.ts"],"sourcesContent":["import { Model } from '@contember/schema'\n\nexport type ReferenceMapEntry = {\n\towningEntity: Model.Entity\n\towningRelation: Model.OneHasOneOwningRelation | Model.ManyHasOneRelation\n\ttargetEntity: Model.Entity\n\ttargetRelation: Model.OneHasOneInverseRelation | Model.OneHasManyRelation | null\n}\nexport type ReferencesMap = Record<string, ReferenceMapEntry[]>\n\nexport const collectReferences = (model: Model.Schema): ReferencesMap => {\n\tconst entityReferences: ReferencesMap = Object.fromEntries(Object.keys(model.entities).map(it => [it, []]))\n\tfor (const entity of Object.values(model.entities)) {\n\t\tfor (const field of Object.values(entity.fields)) {\n\t\t\tswitch (field.type) {\n\t\t\t\tcase 'OneHasOne':\n\t\t\t\t\tconst targetEntity = model.entities[field.target]\n\t\t\t\t\tif (!('ownedBy' in field)) {\n\t\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\t\ttargetEntity: targetEntity,\n\t\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity.fields[field.inversedBy] as Model.OneHasOneInverseRelation : null,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'ManyHasOne':\n\t\t\t\t\tconst targetEntity2 = model.entities[field.target]\n\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\ttargetEntity: targetEntity2,\n\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity2.fields[field.inversedBy] as Model.OneHasManyRelation : null,\n\t\t\t\t\t})\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn entityReferences\n}\n"],"names":[],"mappings":"AAUa,MAAA,oBAAoB,CAAC,UAAuC;AACxE,QAAM,mBAAkC,OAAO,YAAY,OAAO,KAAK,MAAM,QAAQ,EAAE,IAAI,QAAM,CAAC,IAAI,CAAA,CAAE,CAAC,CAAC;AAC1G,aAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AACnD,eAAW,SAAS,OAAO,OAAO,OAAO,MAAM,GAAG;AACjD,cAAQ,MAAM,MAAM;AAAA,QACnB,KAAK;AACJ,gBAAM,eAAe,MAAM,SAAS,MAAM,MAAM;AAC5C,cAAA,EAAE,aAAa,QAAQ;AACT,6BAAA,MAAM,MAAM,EAAE,KAAK;AAAA,cACnC,cAAc;AAAA,cACd,gBAAgB;AAAA,cAChB;AAAA,cACA,gBAAgB,MAAM,aAAa,aAAa,OAAO,MAAM,UAAU,IAAsC;AAAA,YAAA,CAC7G;AAAA,UAAA;AAEF;AAAA,QACD,KAAK;AACJ,gBAAM,gBAAgB,MAAM,SAAS,MAAM,MAAM;AAChC,2BAAA,MAAM,MAAM,EAAE,KAAK;AAAA,YACnC,cAAc;AAAA,YACd,gBAAgB;AAAA,YAChB,cAAc;AAAA,YACd,gBAAgB,MAAM,aAAa,cAAc,OAAO,MAAM,UAAU,IAAgC;AAAA,UAAA,CACxG;AACD;AAAA,MAAA;AAAA,IACF;AAAA,EACD;AAEM,SAAA;AACR;"}
1
+ {"version":3,"file":"collectReferences.js","sources":["../../../../../../packages/cli/src/lib/schema/collectReferences.ts"],"sourcesContent":["import { Model } from '@contember/schema'\n\nexport type ReferenceMapEntry = {\n\towningEntity: Model.Entity\n\towningRelation: Model.OneHasOneOwningRelation | Model.ManyHasOneRelation\n\ttargetEntity: Model.Entity\n\ttargetRelation: Model.OneHasOneInverseRelation | Model.OneHasManyRelation | null\n}\nexport type ReferencesMap = Record<string, ReferenceMapEntry[]>\n\nexport const collectReferences = (model: Model.Schema): ReferencesMap => {\n\tconst entityReferences: ReferencesMap = Object.fromEntries(Object.keys(model.entities).map(it => [it, []]))\n\tfor (const entity of Object.values(model.entities)) {\n\t\tfor (const field of Object.values(entity.fields)) {\n\t\t\tswitch (field.type) {\n\t\t\t\tcase 'OneHasOne':\n\t\t\t\t\tconst targetEntity = model.entities[field.target]\n\t\t\t\t\tif (!('ownedBy' in field)) {\n\t\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\t\ttargetEntity: targetEntity,\n\t\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity.fields[field.inversedBy] as Model.OneHasOneInverseRelation : null,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'ManyHasOne':\n\t\t\t\t\tconst targetEntity2 = model.entities[field.target]\n\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\ttargetEntity: targetEntity2,\n\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity2.fields[field.inversedBy] as Model.OneHasManyRelation : null,\n\t\t\t\t\t})\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn entityReferences\n}\n"],"names":[],"mappings":"AAUO,MAAM,oBAAoB,CAAC,UAAuC;AACxE,QAAM,mBAAkC,OAAO,YAAY,OAAO,KAAK,MAAM,QAAQ,EAAE,IAAI,QAAM,CAAC,IAAI,CAAA,CAAE,CAAC,CAAC;AAC1G,aAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AACnD,eAAW,SAAS,OAAO,OAAO,OAAO,MAAM,GAAG;AACjD,cAAQ,MAAM,MAAA;AAAA,QACb,KAAK;AACJ,gBAAM,eAAe,MAAM,SAAS,MAAM,MAAM;AAChD,cAAI,EAAE,aAAa,QAAQ;AAC1B,6BAAiB,MAAM,MAAM,EAAE,KAAK;AAAA,cACnC,cAAc;AAAA,cACd,gBAAgB;AAAA,cAChB;AAAA,cACA,gBAAgB,MAAM,aAAa,aAAa,OAAO,MAAM,UAAU,IAAsC;AAAA,YAAA,CAC7G;AAAA,UACF;AACA;AAAA,QACD,KAAK;AACJ,gBAAM,gBAAgB,MAAM,SAAS,MAAM,MAAM;AACjD,2BAAiB,MAAM,MAAM,EAAE,KAAK;AAAA,YACnC,cAAc;AAAA,YACd,gBAAgB;AAAA,YAChB,cAAc;AAAA,YACd,gBAAgB,MAAM,aAAa,cAAc,OAAO,MAAM,UAAU,IAAgC;AAAA,UAAA,CACxG;AACD;AAAA,MAAA;AAAA,IAEH;AAAA,EACD;AACA,SAAO;AACR;"}
@@ -32,12 +32,5 @@ class LineTransform extends node_stream.Transform {
32
32
  __publicField(this, "chunks", []);
33
33
  }
34
34
  }
35
- const readStream = async (stream) => new Promise((resolve, reject) => {
36
- const chunks = [];
37
- stream.on("error", (err) => reject(err));
38
- stream.on("data", (chunk) => chunks.push(chunk));
39
- stream.on("end", () => resolve(node_buffer.Buffer.concat(chunks)));
40
- });
41
35
  exports.LineTransform = LineTransform;
42
- exports.readStream = readStream;
43
36
  //# sourceMappingURL=stream.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"stream.cjs","sources":["../../../../../packages/cli/src/lib/stream.ts"],"sourcesContent":["import { Stream, Transform } from 'node:stream'\nimport { Buffer } from 'node:buffer'\n\n\nexport class LineTransform extends Transform {\n\tprivate chunks: Buffer[] = []\n\n\tconstructor(transform: (line: string) => string) {\n\t\tsuper({\n\t\t\ttransform: (chunk, encoding, done) => {\n\t\t\t\twhile (true) {\n\t\t\t\t\tconst eolIndex = chunk.indexOf('\\n')\n\n\t\t\t\t\tif (eolIndex < 0) {\n\t\t\t\t\t\tthis.chunks.push(chunk)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.chunks.push(chunk.slice(0, eolIndex))\n\t\t\t\t\tchunk = chunk.slice(eolIndex + 1)\n\t\t\t\t\tthis.push(transform(Buffer.concat(this.chunks).toString('utf8')) + '\\n', 'utf8')\n\t\t\t\t\tthis.chunks = []\n\t\t\t\t}\n\n\t\t\t\treturn done()\n\t\t\t},\n\n\t\t\tflush: done => {\n\t\t\t\tif (this.chunks.length) {\n\t\t\t\t\tthis.push(transform(Buffer.concat(this.chunks).toString('utf8')), 'utf8')\n\t\t\t\t\treturn done()\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t}\n}\n\n\nexport const readStream = async (stream: Stream) => new Promise<Buffer>((resolve, reject) => {\n\tconst chunks: Buffer[] = []\n\tstream.on('error', err => reject(err))\n\tstream.on('data', chunk => chunks.push(chunk))\n\tstream.on('end', () => resolve(Buffer.concat(chunks)))\n})\n"],"names":["Transform","Buffer"],"mappings":";;;;;;;AAIO,MAAM,sBAAsBA,YAAAA,UAAU;AAAA,EAG5C,YAAY,WAAqC;AAC1C,UAAA;AAAA,MACL,WAAW,CAAC,OAAO,UAAU,SAAS;AACrC,eAAO,MAAM;AACN,gBAAA,WAAW,MAAM,QAAQ,IAAI;AAEnC,cAAI,WAAW,GAAG;AACZ,iBAAA,OAAO,KAAK,KAAK;AACtB;AAAA,UAAA;AAGD,eAAK,OAAO,KAAK,MAAM,MAAM,GAAG,QAAQ,CAAC;AACjC,kBAAA,MAAM,MAAM,WAAW,CAAC;AAChC,eAAK,KAAK,UAAUC,YAAO,OAAA,OAAO,KAAK,MAAM,EAAE,SAAS,MAAM,CAAC,IAAI,MAAM,MAAM;AAC/E,eAAK,SAAS,CAAC;AAAA,QAAA;AAGhB,eAAO,KAAK;AAAA,MACb;AAAA,MAEA,OAAO,CAAQ,SAAA;AACV,YAAA,KAAK,OAAO,QAAQ;AAClB,eAAA,KAAK,UAAUA,YAAAA,OAAO,OAAO,KAAK,MAAM,EAAE,SAAS,MAAM,CAAC,GAAG,MAAM;AACxE,iBAAO,KAAK;AAAA,QAAA;AAAA,MACb;AAAA,IACD,CACA;AA5BF,kBAAA,MAAQ,UAAmB,EAAC;AAAA,EAAA;AA8B7B;AAGO,MAAM,aAAa,OAAO,WAAmB,IAAI,QAAgB,CAAC,SAAS,WAAW;AAC5F,QAAM,SAAmB,CAAC;AAC1B,SAAO,GAAG,SAAS,CAAO,QAAA,OAAO,GAAG,CAAC;AACrC,SAAO,GAAG,QAAQ,CAAA,UAAS,OAAO,KAAK,KAAK,CAAC;AACtC,SAAA,GAAG,OAAO,MAAM,QAAQA,YAAAA,OAAO,OAAO,MAAM,CAAC,CAAC;AACtD,CAAC;;;"}
1
+ {"version":3,"file":"stream.cjs","sources":["../../../../../packages/cli/src/lib/stream.ts"],"sourcesContent":["import { Stream, Transform } from 'node:stream'\nimport { Buffer } from 'node:buffer'\n\nexport class LineTransform extends Transform {\n\tprivate chunks: Buffer[] = []\n\n\tconstructor(transform: (line: string) => string) {\n\t\tsuper({\n\t\t\ttransform: (chunk, encoding, done) => {\n\t\t\t\twhile (true) {\n\t\t\t\t\tconst eolIndex = chunk.indexOf('\\n')\n\n\t\t\t\t\tif (eolIndex < 0) {\n\t\t\t\t\t\tthis.chunks.push(chunk)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.chunks.push(chunk.slice(0, eolIndex))\n\t\t\t\t\tchunk = chunk.slice(eolIndex + 1)\n\t\t\t\t\tthis.push(transform(Buffer.concat(this.chunks).toString('utf8')) + '\\n', 'utf8')\n\t\t\t\t\tthis.chunks = []\n\t\t\t\t}\n\n\t\t\t\treturn done()\n\t\t\t},\n\n\t\t\tflush: done => {\n\t\t\t\tif (this.chunks.length) {\n\t\t\t\t\tthis.push(transform(Buffer.concat(this.chunks).toString('utf8')), 'utf8')\n\t\t\t\t\treturn done()\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t}\n}\n\nexport const readStream = async (stream: Stream) =>\n\tnew Promise<Buffer>((resolve, reject) => {\n\t\tconst chunks: Buffer[] = []\n\t\tstream.on('error', err => reject(err))\n\t\tstream.on('data', chunk => chunks.push(chunk))\n\t\tstream.on('end', () => resolve(Buffer.concat(chunks)))\n\t})\n"],"names":["Transform","Buffer"],"mappings":";;;;;;;AAGO,MAAM,sBAAsBA,YAAAA,UAAU;AAAA,EAG5C,YAAY,WAAqC;AAChD,UAAM;AAAA,MACL,WAAW,CAAC,OAAO,UAAU,SAAS;AACrC,eAAO,MAAM;AACZ,gBAAM,WAAW,MAAM,QAAQ,IAAI;AAEnC,cAAI,WAAW,GAAG;AACjB,iBAAK,OAAO,KAAK,KAAK;AACtB;AAAA,UACD;AAEA,eAAK,OAAO,KAAK,MAAM,MAAM,GAAG,QAAQ,CAAC;AACzC,kBAAQ,MAAM,MAAM,WAAW,CAAC;AAChC,eAAK,KAAK,UAAUC,YAAAA,OAAO,OAAO,KAAK,MAAM,EAAE,SAAS,MAAM,CAAC,IAAI,MAAM,MAAM;AAC/E,eAAK,SAAS,CAAA;AAAA,QACf;AAEA,eAAO,KAAA;AAAA,MACR;AAAA,MAEA,OAAO,CAAA,SAAQ;AACd,YAAI,KAAK,OAAO,QAAQ;AACvB,eAAK,KAAK,UAAUA,YAAAA,OAAO,OAAO,KAAK,MAAM,EAAE,SAAS,MAAM,CAAC,GAAG,MAAM;AACxE,iBAAO,KAAA;AAAA,QACR;AAAA,MACD;AAAA,IAAA,CACA;AA5BF,kBAAA,MAAQ,UAAmB,EAAC;AAAA,EA6B5B;AACD;;"}
@@ -30,14 +30,7 @@ class LineTransform extends Transform {
30
30
  __publicField(this, "chunks", []);
31
31
  }
32
32
  }
33
- const readStream = async (stream) => new Promise((resolve, reject) => {
34
- const chunks = [];
35
- stream.on("error", (err) => reject(err));
36
- stream.on("data", (chunk) => chunks.push(chunk));
37
- stream.on("end", () => resolve(Buffer.concat(chunks)));
38
- });
39
33
  export {
40
- LineTransform,
41
- readStream
34
+ LineTransform
42
35
  };
43
36
  //# sourceMappingURL=stream.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stream.js","sources":["../../../../../packages/cli/src/lib/stream.ts"],"sourcesContent":["import { Stream, Transform } from 'node:stream'\nimport { Buffer } from 'node:buffer'\n\n\nexport class LineTransform extends Transform {\n\tprivate chunks: Buffer[] = []\n\n\tconstructor(transform: (line: string) => string) {\n\t\tsuper({\n\t\t\ttransform: (chunk, encoding, done) => {\n\t\t\t\twhile (true) {\n\t\t\t\t\tconst eolIndex = chunk.indexOf('\\n')\n\n\t\t\t\t\tif (eolIndex < 0) {\n\t\t\t\t\t\tthis.chunks.push(chunk)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.chunks.push(chunk.slice(0, eolIndex))\n\t\t\t\t\tchunk = chunk.slice(eolIndex + 1)\n\t\t\t\t\tthis.push(transform(Buffer.concat(this.chunks).toString('utf8')) + '\\n', 'utf8')\n\t\t\t\t\tthis.chunks = []\n\t\t\t\t}\n\n\t\t\t\treturn done()\n\t\t\t},\n\n\t\t\tflush: done => {\n\t\t\t\tif (this.chunks.length) {\n\t\t\t\t\tthis.push(transform(Buffer.concat(this.chunks).toString('utf8')), 'utf8')\n\t\t\t\t\treturn done()\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t}\n}\n\n\nexport const readStream = async (stream: Stream) => new Promise<Buffer>((resolve, reject) => {\n\tconst chunks: Buffer[] = []\n\tstream.on('error', err => reject(err))\n\tstream.on('data', chunk => chunks.push(chunk))\n\tstream.on('end', () => resolve(Buffer.concat(chunks)))\n})\n"],"names":["Buffer"],"mappings":";;;;;AAIO,MAAM,sBAAsB,UAAU;AAAA,EAG5C,YAAY,WAAqC;AAC1C,UAAA;AAAA,MACL,WAAW,CAAC,OAAO,UAAU,SAAS;AACrC,eAAO,MAAM;AACN,gBAAA,WAAW,MAAM,QAAQ,IAAI;AAEnC,cAAI,WAAW,GAAG;AACZ,iBAAA,OAAO,KAAK,KAAK;AACtB;AAAA,UAAA;AAGD,eAAK,OAAO,KAAK,MAAM,MAAM,GAAG,QAAQ,CAAC;AACjC,kBAAA,MAAM,MAAM,WAAW,CAAC;AAChC,eAAK,KAAK,UAAUA,OAAO,OAAO,KAAK,MAAM,EAAE,SAAS,MAAM,CAAC,IAAI,MAAM,MAAM;AAC/E,eAAK,SAAS,CAAC;AAAA,QAAA;AAGhB,eAAO,KAAK;AAAA,MACb;AAAA,MAEA,OAAO,CAAQ,SAAA;AACV,YAAA,KAAK,OAAO,QAAQ;AAClB,eAAA,KAAK,UAAUA,OAAO,OAAO,KAAK,MAAM,EAAE,SAAS,MAAM,CAAC,GAAG,MAAM;AACxE,iBAAO,KAAK;AAAA,QAAA;AAAA,MACb;AAAA,IACD,CACA;AA5BF,kBAAA,MAAQ,UAAmB,EAAC;AAAA,EAAA;AA8B7B;AAGO,MAAM,aAAa,OAAO,WAAmB,IAAI,QAAgB,CAAC,SAAS,WAAW;AAC5F,QAAM,SAAmB,CAAC;AAC1B,SAAO,GAAG,SAAS,CAAO,QAAA,OAAO,GAAG,CAAC;AACrC,SAAO,GAAG,QAAQ,CAAA,UAAS,OAAO,KAAK,KAAK,CAAC;AACtC,SAAA,GAAG,OAAO,MAAM,QAAQA,OAAO,OAAO,MAAM,CAAC,CAAC;AACtD,CAAC;"}
1
+ {"version":3,"file":"stream.js","sources":["../../../../../packages/cli/src/lib/stream.ts"],"sourcesContent":["import { Stream, Transform } from 'node:stream'\nimport { Buffer } from 'node:buffer'\n\nexport class LineTransform extends Transform {\n\tprivate chunks: Buffer[] = []\n\n\tconstructor(transform: (line: string) => string) {\n\t\tsuper({\n\t\t\ttransform: (chunk, encoding, done) => {\n\t\t\t\twhile (true) {\n\t\t\t\t\tconst eolIndex = chunk.indexOf('\\n')\n\n\t\t\t\t\tif (eolIndex < 0) {\n\t\t\t\t\t\tthis.chunks.push(chunk)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.chunks.push(chunk.slice(0, eolIndex))\n\t\t\t\t\tchunk = chunk.slice(eolIndex + 1)\n\t\t\t\t\tthis.push(transform(Buffer.concat(this.chunks).toString('utf8')) + '\\n', 'utf8')\n\t\t\t\t\tthis.chunks = []\n\t\t\t\t}\n\n\t\t\t\treturn done()\n\t\t\t},\n\n\t\t\tflush: done => {\n\t\t\t\tif (this.chunks.length) {\n\t\t\t\t\tthis.push(transform(Buffer.concat(this.chunks).toString('utf8')), 'utf8')\n\t\t\t\t\treturn done()\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t}\n}\n\nexport const readStream = async (stream: Stream) =>\n\tnew Promise<Buffer>((resolve, reject) => {\n\t\tconst chunks: Buffer[] = []\n\t\tstream.on('error', err => reject(err))\n\t\tstream.on('data', chunk => chunks.push(chunk))\n\t\tstream.on('end', () => resolve(Buffer.concat(chunks)))\n\t})\n"],"names":["Buffer"],"mappings":";;;;;AAGO,MAAM,sBAAsB,UAAU;AAAA,EAG5C,YAAY,WAAqC;AAChD,UAAM;AAAA,MACL,WAAW,CAAC,OAAO,UAAU,SAAS;AACrC,eAAO,MAAM;AACZ,gBAAM,WAAW,MAAM,QAAQ,IAAI;AAEnC,cAAI,WAAW,GAAG;AACjB,iBAAK,OAAO,KAAK,KAAK;AACtB;AAAA,UACD;AAEA,eAAK,OAAO,KAAK,MAAM,MAAM,GAAG,QAAQ,CAAC;AACzC,kBAAQ,MAAM,MAAM,WAAW,CAAC;AAChC,eAAK,KAAK,UAAUA,OAAO,OAAO,KAAK,MAAM,EAAE,SAAS,MAAM,CAAC,IAAI,MAAM,MAAM;AAC/E,eAAK,SAAS,CAAA;AAAA,QACf;AAEA,eAAO,KAAA;AAAA,MACR;AAAA,MAEA,OAAO,CAAA,SAAQ;AACd,YAAI,KAAK,OAAO,QAAQ;AACvB,eAAK,KAAK,UAAUA,OAAO,OAAO,KAAK,MAAM,EAAE,SAAS,MAAM,CAAC,GAAG,MAAM;AACxE,iBAAO,KAAA;AAAA,QACR;AAAA,MACD;AAAA,IAAA,CACA;AA5BF,kBAAA,MAAQ,UAAmB,EAAC;AAAA,EA6B5B;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TenantClient.cjs","sources":["../../../../../../packages/cli/src/lib/tenant/TenantClient.ts"],"sourcesContent":["import { GraphQlClient } from '@contember/graphql-client'\n\nexport const createTenantApiUrl = (url: string) => {\n\tif (url.endsWith('/')) {\n\t\turl = url.substring(0, url.length - 1)\n\t}\n\tif (url.endsWith('/tenant')) {\n\t\treturn url\n\t}\n\treturn url + '/tenant'\n}\n\n\nexport class TenantClient {\n\tconstructor(private readonly apiClient: GraphQlClient) {}\n\n\tpublic static create(url: string, apiToken: string): TenantClient {\n\t\tconst graphqlClient = new GraphQlClient({ url: createTenantApiUrl(url), apiToken })\n\t\treturn new TenantClient(graphqlClient)\n\t}\n\n\tpublic async createProject(slug: string, ignoreExisting = false): Promise<void> {\n\t\tconst query = `mutation($slug: String!) {\n createProject(projectSlug: $slug) {\n ok\n error {\n code\n }\n }\n}`\n\t\tconst result = await this.apiClient.execute<{\n\t\t\tcreateProject: { ok: boolean; error: { code: string } }\n\t\t}>(query, { variables: { slug } })\n\t\tif (!result.createProject.ok) {\n\t\t\tif (ignoreExisting && result.createProject.error.code === 'ALREADY_EXISTS') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow result.createProject.error.code\n\t\t}\n\t}\n}\n"],"names":["graphqlClient","GraphQlClient"],"mappings":";;;AAEa,MAAA,qBAAqB,CAAC,QAAgB;AAC9C,MAAA,IAAI,SAAS,GAAG,GAAG;AACtB,UAAM,IAAI,UAAU,GAAG,IAAI,SAAS,CAAC;AAAA,EAAA;AAElC,MAAA,IAAI,SAAS,SAAS,GAAG;AACrB,WAAA;AAAA,EAAA;AAER,SAAO,MAAM;AACd;AAGO,MAAM,aAAa;AAAA,EACzB,YAA6B,WAA0B;AAA1B,SAAA,YAAA;AAAA,EAAA;AAAA,EAE7B,OAAc,OAAO,KAAa,UAAgC;AAC3D,UAAAA,kBAAgB,IAAIC,cAAAA,cAAc,EAAE,KAAK,mBAAmB,GAAG,GAAG,UAAU;AAC3E,WAAA,IAAI,aAAaD,eAAa;AAAA,EAAA;AAAA,EAGtC,MAAa,cAAc,MAAc,iBAAiB,OAAsB;AAC/E,UAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQR,UAAA,SAAS,MAAM,KAAK,UAAU,QAEjC,OAAO,EAAE,WAAW,EAAE,KAAK,GAAG;AAC7B,QAAA,CAAC,OAAO,cAAc,IAAI;AAC7B,UAAI,kBAAkB,OAAO,cAAc,MAAM,SAAS,kBAAkB;AAC3E;AAAA,MAAA;AAEK,YAAA,OAAO,cAAc,MAAM;AAAA,IAAA;AAAA,EAClC;AAEF;;;"}
1
+ {"version":3,"file":"TenantClient.cjs","sources":["../../../../../../packages/cli/src/lib/tenant/TenantClient.ts"],"sourcesContent":["import { GraphQlClient } from '@contember/graphql-client'\n\nexport const createTenantApiUrl = (url: string) => {\n\tif (url.endsWith('/')) {\n\t\turl = url.substring(0, url.length - 1)\n\t}\n\tif (url.endsWith('/tenant')) {\n\t\treturn url\n\t}\n\treturn url + '/tenant'\n}\n\nexport class TenantClient {\n\tconstructor(private readonly apiClient: GraphQlClient) {}\n\n\tpublic static create(url: string, apiToken: string): TenantClient {\n\t\tconst graphqlClient = new GraphQlClient({ url: createTenantApiUrl(url), apiToken })\n\t\treturn new TenantClient(graphqlClient)\n\t}\n\n\tpublic async createProject(slug: string, ignoreExisting = false): Promise<void> {\n\t\tconst query = `mutation($slug: String!) {\n createProject(projectSlug: $slug) {\n ok\n error {\n code\n }\n }\n}`\n\t\tconst result = await this.apiClient.execute<{\n\t\t\tcreateProject: { ok: boolean; error: { code: string } }\n\t\t}>(query, { variables: { slug } })\n\t\tif (!result.createProject.ok) {\n\t\t\tif (ignoreExisting && result.createProject.error.code === 'ALREADY_EXISTS') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow result.createProject.error.code\n\t\t}\n\t}\n}\n"],"names":["graphqlClient","GraphQlClient"],"mappings":";;;AAEO,MAAM,qBAAqB,CAAC,QAAgB;AAClD,MAAI,IAAI,SAAS,GAAG,GAAG;AACtB,UAAM,IAAI,UAAU,GAAG,IAAI,SAAS,CAAC;AAAA,EACtC;AACA,MAAI,IAAI,SAAS,SAAS,GAAG;AAC5B,WAAO;AAAA,EACR;AACA,SAAO,MAAM;AACd;AAEO,MAAM,aAAa;AAAA,EACzB,YAA6B,WAA0B;AAA1B,SAAA,YAAA;AAAA,EAA2B;AAAA,EAExD,OAAc,OAAO,KAAa,UAAgC;AACjE,UAAMA,kBAAgB,IAAIC,cAAAA,cAAc,EAAE,KAAK,mBAAmB,GAAG,GAAG,UAAU;AAClF,WAAO,IAAI,aAAaD,eAAa;AAAA,EACtC;AAAA,EAEA,MAAa,cAAc,MAAc,iBAAiB,OAAsB;AAC/E,UAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQd,UAAM,SAAS,MAAM,KAAK,UAAU,QAEjC,OAAO,EAAE,WAAW,EAAE,KAAA,GAAQ;AACjC,QAAI,CAAC,OAAO,cAAc,IAAI;AAC7B,UAAI,kBAAkB,OAAO,cAAc,MAAM,SAAS,kBAAkB;AAC3E;AAAA,MACD;AACA,YAAM,OAAO,cAAc,MAAM;AAAA,IAClC;AAAA,EACD;AACD;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TenantClient.js","sources":["../../../../../../packages/cli/src/lib/tenant/TenantClient.ts"],"sourcesContent":["import { GraphQlClient } from '@contember/graphql-client'\n\nexport const createTenantApiUrl = (url: string) => {\n\tif (url.endsWith('/')) {\n\t\turl = url.substring(0, url.length - 1)\n\t}\n\tif (url.endsWith('/tenant')) {\n\t\treturn url\n\t}\n\treturn url + '/tenant'\n}\n\n\nexport class TenantClient {\n\tconstructor(private readonly apiClient: GraphQlClient) {}\n\n\tpublic static create(url: string, apiToken: string): TenantClient {\n\t\tconst graphqlClient = new GraphQlClient({ url: createTenantApiUrl(url), apiToken })\n\t\treturn new TenantClient(graphqlClient)\n\t}\n\n\tpublic async createProject(slug: string, ignoreExisting = false): Promise<void> {\n\t\tconst query = `mutation($slug: String!) {\n createProject(projectSlug: $slug) {\n ok\n error {\n code\n }\n }\n}`\n\t\tconst result = await this.apiClient.execute<{\n\t\t\tcreateProject: { ok: boolean; error: { code: string } }\n\t\t}>(query, { variables: { slug } })\n\t\tif (!result.createProject.ok) {\n\t\t\tif (ignoreExisting && result.createProject.error.code === 'ALREADY_EXISTS') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow result.createProject.error.code\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAEa,MAAA,qBAAqB,CAAC,QAAgB;AAC9C,MAAA,IAAI,SAAS,GAAG,GAAG;AACtB,UAAM,IAAI,UAAU,GAAG,IAAI,SAAS,CAAC;AAAA,EAAA;AAElC,MAAA,IAAI,SAAS,SAAS,GAAG;AACrB,WAAA;AAAA,EAAA;AAER,SAAO,MAAM;AACd;AAGO,MAAM,aAAa;AAAA,EACzB,YAA6B,WAA0B;AAA1B,SAAA,YAAA;AAAA,EAAA;AAAA,EAE7B,OAAc,OAAO,KAAa,UAAgC;AAC3D,UAAA,gBAAgB,IAAI,cAAc,EAAE,KAAK,mBAAmB,GAAG,GAAG,UAAU;AAC3E,WAAA,IAAI,aAAa,aAAa;AAAA,EAAA;AAAA,EAGtC,MAAa,cAAc,MAAc,iBAAiB,OAAsB;AAC/E,UAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQR,UAAA,SAAS,MAAM,KAAK,UAAU,QAEjC,OAAO,EAAE,WAAW,EAAE,KAAK,GAAG;AAC7B,QAAA,CAAC,OAAO,cAAc,IAAI;AAC7B,UAAI,kBAAkB,OAAO,cAAc,MAAM,SAAS,kBAAkB;AAC3E;AAAA,MAAA;AAEK,YAAA,OAAO,cAAc,MAAM;AAAA,IAAA;AAAA,EAClC;AAEF;"}
1
+ {"version":3,"file":"TenantClient.js","sources":["../../../../../../packages/cli/src/lib/tenant/TenantClient.ts"],"sourcesContent":["import { GraphQlClient } from '@contember/graphql-client'\n\nexport const createTenantApiUrl = (url: string) => {\n\tif (url.endsWith('/')) {\n\t\turl = url.substring(0, url.length - 1)\n\t}\n\tif (url.endsWith('/tenant')) {\n\t\treturn url\n\t}\n\treturn url + '/tenant'\n}\n\nexport class TenantClient {\n\tconstructor(private readonly apiClient: GraphQlClient) {}\n\n\tpublic static create(url: string, apiToken: string): TenantClient {\n\t\tconst graphqlClient = new GraphQlClient({ url: createTenantApiUrl(url), apiToken })\n\t\treturn new TenantClient(graphqlClient)\n\t}\n\n\tpublic async createProject(slug: string, ignoreExisting = false): Promise<void> {\n\t\tconst query = `mutation($slug: String!) {\n createProject(projectSlug: $slug) {\n ok\n error {\n code\n }\n }\n}`\n\t\tconst result = await this.apiClient.execute<{\n\t\t\tcreateProject: { ok: boolean; error: { code: string } }\n\t\t}>(query, { variables: { slug } })\n\t\tif (!result.createProject.ok) {\n\t\t\tif (ignoreExisting && result.createProject.error.code === 'ALREADY_EXISTS') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow result.createProject.error.code\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAEO,MAAM,qBAAqB,CAAC,QAAgB;AAClD,MAAI,IAAI,SAAS,GAAG,GAAG;AACtB,UAAM,IAAI,UAAU,GAAG,IAAI,SAAS,CAAC;AAAA,EACtC;AACA,MAAI,IAAI,SAAS,SAAS,GAAG;AAC5B,WAAO;AAAA,EACR;AACA,SAAO,MAAM;AACd;AAEO,MAAM,aAAa;AAAA,EACzB,YAA6B,WAA0B;AAA1B,SAAA,YAAA;AAAA,EAA2B;AAAA,EAExD,OAAc,OAAO,KAAa,UAAgC;AACjE,UAAM,gBAAgB,IAAI,cAAc,EAAE,KAAK,mBAAmB,GAAG,GAAG,UAAU;AAClF,WAAO,IAAI,aAAa,aAAa;AAAA,EACtC;AAAA,EAEA,MAAa,cAAc,MAAc,iBAAiB,OAAsB;AAC/E,UAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQd,UAAM,SAAS,MAAM,KAAK,UAAU,QAEjC,OAAO,EAAE,WAAW,EAAE,KAAA,GAAQ;AACjC,QAAI,CAAC,OAAO,cAAc,IAAI;AAC7B,UAAI,kBAAkB,OAAO,cAAc,MAAM,SAAS,kBAAkB;AAC3E;AAAA,MACD;AACA,YAAM,OAAO,cAAc,MAAM;AAAA,IAClC;AAAA,EACD;AACD;"}
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const http = require("node:http");
4
- const https = require("node:https");
5
3
  const stream = require("../stream.cjs");
6
4
  const node_stream = require("node:stream");
7
5
  const node_zlib = require("node:zlib");
@@ -16,80 +14,74 @@ class DataTransferClient {
16
14
  let rowTotal = 0;
17
15
  let transferred = 0;
18
16
  let start = Date.now();
19
- const inputStream = stream$1.pipe(new stream.LineTransform((line) => {
20
- transferred += line.length + 1;
21
- if (line === "") {
22
- return "";
23
- }
24
- const data = JSON.parse(line);
25
- switch (data[0]) {
26
- case "importSystemSchemaBegin":
27
- return JSON.stringify([data[0], { ...data[1], project: project.name }]);
28
- case "importContentSchemaBegin":
29
- return JSON.stringify([data[0], { ...data[1], project: project.name }]);
30
- case "insertBegin":
31
- table = data[1].table;
32
- rowCount = 0;
33
- break;
34
- case "insertRow":
35
- rowCount++;
36
- rowTotal++;
37
- break;
38
- }
39
- if (rowCount % 1e3 === 0 || data[0] !== "insertRow") {
40
- const mbs = Math.floor(transferred / 1024 / 1024).toString();
41
- const durationS = Math.floor((Date.now() - start) / 1e3);
42
- printProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`);
43
- }
44
- return line;
45
- }));
46
- return await this.executeRequest({
47
- url: `${project.endpoint}/import`,
48
- token: project.token,
17
+ const inputStream = stream$1.pipe(
18
+ new stream.LineTransform((line) => {
19
+ transferred += line.length + 1;
20
+ if (line === "") {
21
+ return "";
22
+ }
23
+ const data = JSON.parse(line);
24
+ switch (data[0]) {
25
+ case "importSystemSchemaBegin":
26
+ return JSON.stringify([data[0], { ...data[1], project: project.name }]);
27
+ case "importContentSchemaBegin":
28
+ return JSON.stringify([data[0], { ...data[1], project: project.name }]);
29
+ case "insertBegin":
30
+ table = data[1].table;
31
+ rowCount = 0;
32
+ break;
33
+ case "insertRow":
34
+ rowCount++;
35
+ rowTotal++;
36
+ break;
37
+ }
38
+ if (rowCount % 1e3 === 0 || data[0] !== "insertRow") {
39
+ const mbs = Math.floor(transferred / 1024 / 1024).toString();
40
+ const durationS = Math.floor((Date.now() - start) / 1e3);
41
+ printProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`);
42
+ }
43
+ return line;
44
+ })
45
+ );
46
+ inputStream.on("error", (err) => {
47
+ throw new Error(`Input stream error: ${err}`);
48
+ });
49
+ const bodyStream = node_stream.Readable.toWeb(gzip ? inputStream.pipe(node_zlib.createGzip()) : inputStream);
50
+ const response = await fetch(`${project.endpoint}/import`, {
49
51
  headers: {
52
+ "Authorization": `Bearer ${project.token}`,
50
53
  "Content-type": "application/x-ndjson",
51
54
  ...gzip ? { "Content-Encoding": "gzip" } : {}
52
55
  },
53
- body: gzip ? inputStream.pipe(node_zlib.createGzip()) : inputStream
56
+ method: "POST",
57
+ body: bodyStream,
58
+ ...{ duplex: "half" }
54
59
  });
60
+ if (!response.ok) {
61
+ const responseBody = await response.text();
62
+ throw new Error(`Invalid response: ${response.statusText}
63
+ ${responseBody}`);
64
+ }
65
+ return response;
55
66
  });
56
67
  __publicField(this, "dataExport", async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }) => {
57
- return await this.executeRequest({
58
- url: `${baseUrl}/export`,
59
- token,
68
+ const response = await fetch(`${baseUrl}/export`, {
60
69
  headers: {
70
+ "Authorization": `Bearer ${token}`,
61
71
  "Accept-Encoding": gzip ? "gzip" : "identity",
62
72
  "Content-type": "application/json"
63
73
  },
74
+ method: "POST",
64
75
  body: JSON.stringify({
65
76
  projects: [{ slug: project, system: includeSystem, excludeTables }]
66
77
  })
67
78
  });
68
- });
69
- __publicField(this, "executeRequest", async ({ url, token, headers, body }) => {
70
- return await new Promise((resolve, reject) => {
71
- const req = (url.startsWith("https://") ? https : http).request(url, {
72
- method: "POST",
73
- headers: {
74
- Authorization: `Bearer ${token}`,
75
- ...headers
76
- }
77
- }, async (res) => {
78
- if (res.statusCode !== 200) {
79
- const responseBody = (await stream.readStream(res)).toString();
80
- reject(new Error(`Invalid response: ${res.statusMessage}
81
- ${responseBody}`));
82
- } else {
83
- resolve(res);
84
- }
85
- });
86
- if (body instanceof node_stream.Stream) {
87
- body.pipe(req);
88
- } else {
89
- req.write(body);
90
- req.end();
91
- }
92
- });
79
+ if (!response.ok) {
80
+ const responseBody = await response.text();
81
+ throw new Error(`Invalid response: ${response.statusText}
82
+ ${responseBody}`);
83
+ }
84
+ return response;
93
85
  });
94
86
  }
95
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DataTransferClient.cjs","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import http from 'node:http'\nimport https from 'node:https'\nimport { LineTransform, readStream } from '../stream'\nimport { Readable, Stream } from 'node:stream'\nimport { createGzip } from 'node:zlib'\nimport { RemoteProject } from '../project/RemoteProject'\n\nexport class DataTransferClient {\n\n\tdataImport = async ({ printProgress, stream, project, gzip }: {\n\t\tstream: Readable\n\t\tproject: RemoteProject\n\t\tprintProgress: (message: string) => void\n\t\tgzip: boolean\n\t}) => {\n\t\tlet table = ''\n\t\tlet rowCount = 0\n\t\tlet rowTotal = 0\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tconst inputStream = stream.pipe(new LineTransform(line => {\n\t\t\ttransferred += line.length + 1\n\t\t\tif (line === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst data = JSON.parse(line)\n\t\t\tswitch (data[0]) {\n\t\t\t\tcase 'importSystemSchemaBegin':\n\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\tcase 'importContentSchemaBegin':\n\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\tcase 'insertBegin':\n\t\t\t\t\ttable = data[1].table\n\t\t\t\t\trowCount = 0\n\t\t\t\t\tbreak\n\t\t\t\tcase 'insertRow':\n\t\t\t\t\trowCount++\n\t\t\t\t\trowTotal++\n\t\t\t\t\tbreak\n\t\t\t\tcase 'insertEnd':\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {\n\t\t\t\tconst mbs = Math.floor(transferred / 1024 / 1024).toString()\n\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\tprintProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)\n\t\t\t}\n\t\t\treturn line\n\t\t}))\n\n\t\treturn await this.executeRequest({\n\t\t\turl: `${project.endpoint}/import`,\n\t\t\ttoken: project.token,\n\t\t\theaders: {\n\t\t\t\t'Content-type': 'application/x-ndjson',\n\t\t\t\t...(gzip ? { 'Content-Encoding': 'gzip' } : {}),\n\t\t\t},\n\t\t\tbody: gzip ? inputStream.pipe(createGzip()) : inputStream,\n\t\t})\n\t}\n\n\n\tdataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {\n\t\tproject: RemoteProject\n\t\texcludeTables?: string[]\n\t\tincludeSystem: boolean\n\t\tgzip: boolean\n\t}) => {\n\t\treturn await this.executeRequest({\n\t\t\turl: `${baseUrl}/export`,\n\t\t\ttoken,\n\t\t\theaders: {\n\t\t\t\t'Accept-Encoding': gzip ? 'gzip' : 'identity',\n\t\t\t\t'Content-type': 'application/json',\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tprojects: [{ slug: project, system: includeSystem, excludeTables }],\n\t\t\t}),\n\t\t})\n\t}\n\n\n\tprivate executeRequest = async ({ url, token, headers, body }: {\n\t\turl: string\n\t\ttoken: string\n\t\theaders: Record<string, string>\n\t\tbody: any\n\t}) => {\n\t\treturn await new Promise<http.IncomingMessage>((resolve, reject) => {\n\t\t\tconst req = (url.startsWith('https://') ? https : http).request(url, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${token}`,\n\t\t\t\t\t...headers,\n\t\t\t\t},\n\t\t\t}, async res => {\n\t\t\t\tif (res.statusCode !== 200) {\n\t\t\t\t\tconst responseBody = (await readStream(res)).toString()\n\t\t\t\t\treject(new Error(`Invalid response: ${res.statusMessage}\\n${responseBody}`))\n\t\t\t\t} else {\n\t\t\t\t\tresolve(res)\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tif (body instanceof Stream) {\n\t\t\t\tbody.pipe(req)\n\t\t\t} else {\n\t\t\t\treq.write(body)\n\t\t\t\treq.end()\n\t\t\t}\n\t\t})\n\t}\n}\n"],"names":["stream","LineTransform","createGzip","readStream","Stream"],"mappings":";;;;;;;;;;AAOO,MAAM,mBAAmB;AAAA,EAAzB,cAAA;AAEN,kBAAA,MAAA,cAAa,OAAO,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ient.cjs","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import { LineTransform } from '../stream'\nimport { Readable } from 'node:stream'\nimport { createGzip } from 'node:zlib'\nimport { RemoteProject } from '../project/RemoteProject'\n\nexport class DataTransferClient {\n\tdataImport = async ({ printProgress, stream, project, gzip }: {\n\t\tstream: Readable\n\t\tproject: RemoteProject\n\t\tprintProgress: (message: string) => void\n\t\tgzip: boolean\n\t}) => {\n\t\tlet table = ''\n\t\tlet rowCount = 0\n\t\tlet rowTotal = 0\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tconst inputStream = stream.pipe(\n\t\t\tnew LineTransform(line => {\n\t\t\t\ttransferred += line.length + 1\n\t\t\t\tif (line === '') {\n\t\t\t\t\treturn ''\n\t\t\t\t}\n\t\t\t\tconst data = JSON.parse(line)\n\t\t\t\tswitch (data[0]) {\n\t\t\t\t\tcase 'importSystemSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'importContentSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'insertBegin':\n\t\t\t\t\t\ttable = data[1].table\n\t\t\t\t\t\trowCount = 0\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertRow':\n\t\t\t\t\t\trowCount++\n\t\t\t\t\t\trowTotal++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertEnd':\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {\n\t\t\t\t\tconst mbs = Math.floor(transferred / 1024 / 1024).toString()\n\t\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\t\tprintProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)\n\t\t\t\t}\n\t\t\t\treturn line\n\t\t\t}),\n\t\t)\n\t\tinputStream.on('error', err => {\n\t\t\tthrow new Error(`Input stream error: ${err}`)\n\t\t})\n\n\t\tconst bodyStream = Readable.toWeb(gzip ? inputStream.pipe(createGzip()) : inputStream) as unknown as BodyInit\n\n\t\tconst response = await fetch(`${project.endpoint}/import`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${project.token}`,\n\t\t\t\t'Content-type': 'application/x-ndjson',\n\t\t\t\t...(gzip ? { 'Content-Encoding': 'gzip' } : {}),\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: bodyStream,\n\t\t\t...{ duplex: 'half' },\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n\n\tdataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {\n\t\tproject: RemoteProject\n\t\texcludeTables?: string[]\n\t\tincludeSystem: boolean\n\t\tgzip: boolean\n\t}) => {\n\t\tconst response = await fetch(`${baseUrl}/export`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${token}`,\n\t\t\t\t'Accept-Encoding': gzip ? 'gzip' : 'identity',\n\t\t\t\t'Content-type': 'application/json',\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify({\n\t\t\t\tprojects: [{ slug: project, system: includeSystem, excludeTables }],\n\t\t\t}),\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n}\n"],"names":["stream","LineTransform","Readable","createGzip"],"mappings":";;;;;;;;AAKO,MAAM,mBAAmB;AAAA,EAAzB,cAAA;AACN,kBAAA,MAAA,cAAa,OAAO,EAAE,eAAA,QAAeA,UAAQ,SAAS,WAKhD;AACL,UAAI,QAAQ;AACZ,U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AAA,UACR,iBAAiB,UAAU,QAAQ,KAAK;AAAA,UACxC,gBAAgB;AAAA,UAChB,GAAI,OAAO,EAAE,oBAAoB,WAAW,CAAA;AAAA,QAAC;AAAA,QAE9C,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,GAAG,EAAE,QAAQ,OAAA;AAAA,MAAO,CACpB;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAEA,kBAAA,MAAA,cAAa,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,OAAO,UAAU,QAAA,GAAW,MAAM,eAAe,oBAK3F;AACL,YAAM,WAAW,MAAM,MAAM,GAAG,OAAO,WAAW;AAAA,QACjD,SAAS;AAAA,UACR,iBAAiB,UAAU,KAAK;AAAA,UAChC,mBAAmB,OAAO,SAAS;AAAA,UACnC,gBAAgB;AAAA,QAAA;AAAA,QAEjB,QAAQ;AAAA,QACR,MAAM,KAAK,UAAU;AAAA,UACpB,UAAU,CAAC,EAAE,MAAM,SAAS,QAAQ,eAAe,eAAe;AAAA,QAAA,CAClE;AAAA,MAAA,CACD;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EAAA;AACD;;"}
@@ -1,7 +1,5 @@
1
- import http__default from "node:http";
2
- import https from "node:https";
3
- import { LineTransform, readStream } from "../stream.js";
4
- import { Stream } from "node:stream";
1
+ import { LineTransform } from "../stream.js";
2
+ import { Readable } from "node:stream";
5
3
  import { createGzip } from "node:zlib";
6
4
  var __defProp = Object.defineProperty;
7
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -14,80 +12,74 @@ class DataTransferClient {
14
12
  let rowTotal = 0;
15
13
  let transferred = 0;
16
14
  let start = Date.now();
17
- const inputStream = stream.pipe(new LineTransform((line) => {
18
- transferred += line.length + 1;
19
- if (line === "") {
20
- return "";
21
- }
22
- const data = JSON.parse(line);
23
- switch (data[0]) {
24
- case "importSystemSchemaBegin":
25
- return JSON.stringify([data[0], { ...data[1], project: project.name }]);
26
- case "importContentSchemaBegin":
27
- return JSON.stringify([data[0], { ...data[1], project: project.name }]);
28
- case "insertBegin":
29
- table = data[1].table;
30
- rowCount = 0;
31
- break;
32
- case "insertRow":
33
- rowCount++;
34
- rowTotal++;
35
- break;
36
- }
37
- if (rowCount % 1e3 === 0 || data[0] !== "insertRow") {
38
- const mbs = Math.floor(transferred / 1024 / 1024).toString();
39
- const durationS = Math.floor((Date.now() - start) / 1e3);
40
- printProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`);
41
- }
42
- return line;
43
- }));
44
- return await this.executeRequest({
45
- url: `${project.endpoint}/import`,
46
- token: project.token,
15
+ const inputStream = stream.pipe(
16
+ new LineTransform((line) => {
17
+ transferred += line.length + 1;
18
+ if (line === "") {
19
+ return "";
20
+ }
21
+ const data = JSON.parse(line);
22
+ switch (data[0]) {
23
+ case "importSystemSchemaBegin":
24
+ return JSON.stringify([data[0], { ...data[1], project: project.name }]);
25
+ case "importContentSchemaBegin":
26
+ return JSON.stringify([data[0], { ...data[1], project: project.name }]);
27
+ case "insertBegin":
28
+ table = data[1].table;
29
+ rowCount = 0;
30
+ break;
31
+ case "insertRow":
32
+ rowCount++;
33
+ rowTotal++;
34
+ break;
35
+ }
36
+ if (rowCount % 1e3 === 0 || data[0] !== "insertRow") {
37
+ const mbs = Math.floor(transferred / 1024 / 1024).toString();
38
+ const durationS = Math.floor((Date.now() - start) / 1e3);
39
+ printProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`);
40
+ }
41
+ return line;
42
+ })
43
+ );
44
+ inputStream.on("error", (err) => {
45
+ throw new Error(`Input stream error: ${err}`);
46
+ });
47
+ const bodyStream = Readable.toWeb(gzip ? inputStream.pipe(createGzip()) : inputStream);
48
+ const response = await fetch(`${project.endpoint}/import`, {
47
49
  headers: {
50
+ "Authorization": `Bearer ${project.token}`,
48
51
  "Content-type": "application/x-ndjson",
49
52
  ...gzip ? { "Content-Encoding": "gzip" } : {}
50
53
  },
51
- body: gzip ? inputStream.pipe(createGzip()) : inputStream
54
+ method: "POST",
55
+ body: bodyStream,
56
+ ...{ duplex: "half" }
52
57
  });
58
+ if (!response.ok) {
59
+ const responseBody = await response.text();
60
+ throw new Error(`Invalid response: ${response.statusText}
61
+ ${responseBody}`);
62
+ }
63
+ return response;
53
64
  });
54
65
  __publicField(this, "dataExport", async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }) => {
55
- return await this.executeRequest({
56
- url: `${baseUrl}/export`,
57
- token,
66
+ const response = await fetch(`${baseUrl}/export`, {
58
67
  headers: {
68
+ "Authorization": `Bearer ${token}`,
59
69
  "Accept-Encoding": gzip ? "gzip" : "identity",
60
70
  "Content-type": "application/json"
61
71
  },
72
+ method: "POST",
62
73
  body: JSON.stringify({
63
74
  projects: [{ slug: project, system: includeSystem, excludeTables }]
64
75
  })
65
76
  });
66
- });
67
- __publicField(this, "executeRequest", async ({ url, token, headers, body }) => {
68
- return await new Promise((resolve, reject) => {
69
- const req = (url.startsWith("https://") ? https : http__default).request(url, {
70
- method: "POST",
71
- headers: {
72
- Authorization: `Bearer ${token}`,
73
- ...headers
74
- }
75
- }, async (res) => {
76
- if (res.statusCode !== 200) {
77
- const responseBody = (await readStream(res)).toString();
78
- reject(new Error(`Invalid response: ${res.statusMessage}
79
- ${responseBody}`));
80
- } else {
81
- resolve(res);
82
- }
83
- });
84
- if (body instanceof Stream) {
85
- body.pipe(req);
86
- } else {
87
- req.write(body);
88
- req.end();
89
- }
90
- });
77
+ if (!response.ok) {
78
+ const responseBody = await response.text();
79
+ throw new Error(`Invalid response: ${response.statusText}
80
+ ${responseBody}`);
81
+ }
82
+ return response;
91
83
  });
92
84
  }
93
85
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DataTransferClient.js","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import http from 'node:http'\nimport https from 'node:https'\nimport { LineTransform, readStream } from '../stream'\nimport { Readable, Stream } from 'node:stream'\nimport { createGzip } from 'node:zlib'\nimport { RemoteProject } from '../project/RemoteProject'\n\nexport class DataTransferClient {\n\n\tdataImport = async ({ printProgress, stream, project, gzip }: {\n\t\tstream: Readable\n\t\tproject: RemoteProject\n\t\tprintProgress: (message: string) => void\n\t\tgzip: boolean\n\t}) => {\n\t\tlet table = ''\n\t\tlet rowCount = 0\n\t\tlet rowTotal = 0\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tconst inputStream = stream.pipe(new LineTransform(line => {\n\t\t\ttransferred += line.length + 1\n\t\t\tif (line === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst data = JSON.parse(line)\n\t\t\tswitch (data[0]) {\n\t\t\t\tcase 'importSystemSchemaBegin':\n\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\tcase 'importContentSchemaBegin':\n\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\tcase 'insertBegin':\n\t\t\t\t\ttable = data[1].table\n\t\t\t\t\trowCount = 0\n\t\t\t\t\tbreak\n\t\t\t\tcase 'insertRow':\n\t\t\t\t\trowCount++\n\t\t\t\t\trowTotal++\n\t\t\t\t\tbreak\n\t\t\t\tcase 'insertEnd':\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {\n\t\t\t\tconst mbs = Math.floor(transferred / 1024 / 1024).toString()\n\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\tprintProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)\n\t\t\t}\n\t\t\treturn line\n\t\t}))\n\n\t\treturn await this.executeRequest({\n\t\t\turl: `${project.endpoint}/import`,\n\t\t\ttoken: project.token,\n\t\t\theaders: {\n\t\t\t\t'Content-type': 'application/x-ndjson',\n\t\t\t\t...(gzip ? { 'Content-Encoding': 'gzip' } : {}),\n\t\t\t},\n\t\t\tbody: gzip ? inputStream.pipe(createGzip()) : inputStream,\n\t\t})\n\t}\n\n\n\tdataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {\n\t\tproject: RemoteProject\n\t\texcludeTables?: string[]\n\t\tincludeSystem: boolean\n\t\tgzip: boolean\n\t}) => {\n\t\treturn await this.executeRequest({\n\t\t\turl: `${baseUrl}/export`,\n\t\t\ttoken,\n\t\t\theaders: {\n\t\t\t\t'Accept-Encoding': gzip ? 'gzip' : 'identity',\n\t\t\t\t'Content-type': 'application/json',\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tprojects: [{ slug: project, system: includeSystem, excludeTables }],\n\t\t\t}),\n\t\t})\n\t}\n\n\n\tprivate executeRequest = async ({ url, token, headers, body }: {\n\t\turl: string\n\t\ttoken: string\n\t\theaders: Record<string, string>\n\t\tbody: any\n\t}) => {\n\t\treturn await new Promise<http.IncomingMessage>((resolve, reject) => {\n\t\t\tconst req = (url.startsWith('https://') ? https : http).request(url, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${token}`,\n\t\t\t\t\t...headers,\n\t\t\t\t},\n\t\t\t}, async res => {\n\t\t\t\tif (res.statusCode !== 200) {\n\t\t\t\t\tconst responseBody = (await readStream(res)).toString()\n\t\t\t\t\treject(new Error(`Invalid response: ${res.statusMessage}\\n${respon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A,UAAA,OACrE;AACN,oBAAQ,GAAG;AAAA,UAAA;AAAA,QACZ,CACA;AAED,YAAI,gBAAgB,QAAQ;AAC3B,eAAK,KAAK,GAAG;AAAA,QAAA,OACP;AACN,cAAI,MAAM,IAAI;AACd,cAAI,IAAI;AAAA,QAAA;AAAA,MACT,CACA;AAAA,IAAA,CACF;AAAA,EAAA;AACD;"}
1
+ {"version":3,"file":"DataTransferClient.js","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import { LineTransform } from '../stream'\nimport { Readable } from 'node:stream'\nimport { createGzip } from 'node:zlib'\nimport { RemoteProject } from '../project/RemoteProject'\n\nexport class DataTransferClient {\n\tdataImport = async ({ printProgress, stream, project, gzip }: {\n\t\tstream: Readable\n\t\tproject: RemoteProject\n\t\tprintProgress: (message: string) => void\n\t\tgzip: boolean\n\t}) => {\n\t\tlet table = ''\n\t\tlet rowCount = 0\n\t\tlet rowTotal = 0\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tconst inputStream = stream.pipe(\n\t\t\tnew LineTransform(line => {\n\t\t\t\ttransferred += line.length + 1\n\t\t\t\tif (line === '') {\n\t\t\t\t\treturn ''\n\t\t\t\t}\n\t\t\t\tconst data = JSON.parse(line)\n\t\t\t\tswitch (data[0]) {\n\t\t\t\t\tcase 'importSystemSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'importContentSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'insertBegin':\n\t\t\t\t\t\ttable = data[1].table\n\t\t\t\t\t\trowCount = 0\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertRow':\n\t\t\t\t\t\trowCount++\n\t\t\t\t\t\trowTotal++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertEnd':\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {\n\t\t\t\t\tconst mbs = Math.floor(transferred / 1024 / 1024).toString()\n\t\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\t\tprintProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)\n\t\t\t\t}\n\t\t\t\treturn line\n\t\t\t}),\n\t\t)\n\t\tinputStream.on('error', err => {\n\t\t\tthrow new Error(`Input stream error: ${err}`)\n\t\t})\n\n\t\tconst bodyStream = Readable.toWeb(gzip ? inputStream.pipe(createGzip()) : inputStream) as unknown as BodyInit\n\n\t\tconst response = await fetch(`${project.endpoint}/import`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${project.token}`,\n\t\t\t\t'Content-type': 'application/x-ndjson',\n\t\t\t\t...(gzip ? { 'Content-Encoding': 'gzip' } : {}),\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: bodyStream,\n\t\t\t...{ duplex: 'half' },\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n\n\tdataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {\n\t\tproject: RemoteProject\n\t\texcludeTables?: string[]\n\t\tincludeSystem: boolean\n\t\tgzip: boolean\n\t}) => {\n\t\tconst response = await fetch(`${baseUrl}/export`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${token}`,\n\t\t\t\t'Accept-Encoding': gzip ? 'gzip' : 'identity',\n\t\t\t\t'Content-type': 'application/json',\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify({\n\t\t\t\tprojects: [{ slug: project, system: includeSystem, excludeTables }],\n\t\t\t}),\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\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io.cjs","sources":["../../../../../../packages/cli/src/lib/transfer/stdio.ts"],"sourcesContent":["export const printProgressLine = (message: string) => {\n\tif (!process.stdout.clearLine) {\n\t\treturn\n\t}\n\tprocess.stdout.clearLine(0)\n\tprocess.stdout.cursorTo(0)\n\tprocess.stdout.write(message)\n}\n\n"],"names":[],"mappings":";;AAAa,MAAA,oBAAoB,CAAC,YAAoB;AACjD,MAAA,CAAC,QAAQ,OAAO,WAAW;AAC9B;AAAA,EAAA;AAEO,UAAA,OAAO,UAAU,CAAC;AAClB,UAAA,OAAO,SAAS,CAAC;AACjB,UAAA,OAAO,MAAM,OAAO;AAC7B;;"}
1
+ {"version":3,"file":"stdio.cjs","sources":["../../../../../../packages/cli/src/lib/transfer/stdio.ts"],"sourcesContent":["export const printProgressLine = (message: string) => {\n\tif (!process.stdout.clearLine) {\n\t\treturn\n\t}\n\tprocess.stdout.clearLine(0)\n\tprocess.stdout.cursorTo(0)\n\tprocess.stdout.write(message)\n}\n"],"names":[],"mappings":";;AAAO,MAAM,oBAAoB,CAAC,YAAoB;AACrD,MAAI,CAAC,QAAQ,OAAO,WAAW;AAC9B;AAAA,EACD;AACA,UAAQ,OAAO,UAAU,CAAC;AAC1B,UAAQ,OAAO,SAAS,CAAC;AACzB,UAAQ,OAAO,MAAM,OAAO;AAC7B;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"stdio.js","sources":["../../../../../../packages/cli/src/lib/transfer/stdio.ts"],"sourcesContent":["export const printProgressLine = (message: string) => {\n\tif (!process.stdout.clearLine) {\n\t\treturn\n\t}\n\tprocess.stdout.clearLine(0)\n\tprocess.stdout.cursorTo(0)\n\tprocess.stdout.write(message)\n}\n\n"],"names":[],"mappings":"AAAa,MAAA,oBAAoB,CAAC,YAAoB;AACjD,MAAA,CAAC,QAAQ,OAAO,WAAW;AAC9B;AAAA,EAAA;AAEO,UAAA,OAAO,UAAU,CAAC;AAClB,UAAA,OAAO,SAAS,CAAC;AACjB,UAAA,OAAO,MAAM,OAAO;AAC7B;"}
1
+ {"version":3,"file":"stdio.js","sources":["../../../../../../packages/cli/src/lib/transfer/stdio.ts"],"sourcesContent":["export const printProgressLine = (message: string) => {\n\tif (!process.stdout.clearLine) {\n\t\treturn\n\t}\n\tprocess.stdout.clearLine(0)\n\tprocess.stdout.cursorTo(0)\n\tprocess.stdout.write(message)\n}\n"],"names":[],"mappings":"AAAO,MAAM,oBAAoB,CAAC,YAAoB;AACrD,MAAI,CAAC,QAAQ,OAAO,WAAW;AAC9B;AAAA,EACD;AACA,UAAQ,OAAO,UAAU,CAAC;AAC1B,UAAQ,OAAO,SAAS,CAAC;AACzB,UAAQ,OAAO,MAAM,OAAO;AAC7B;"}
@@ -9,10 +9,10 @@ class WorkspaceResolver {
9
9
  this.yamlHandler = yamlHandler;
10
10
  __publicField(this, "resolve", async (baseDir) => {
11
11
  const config = await this.readConfig(baseDir);
12
- const apiDir = config.apiDir ?? node_path.join(baseDir, "api");
13
- const migrationsDir = config.migrationsDir ?? node_path.join(apiDir, "migrations");
14
- const adminDir = config.adminDir === false ? void 0 : config.adminDir ?? node_path.join(baseDir, "admin");
15
- const adminDistDir = adminDir === void 0 ? void 0 : config.adminDistDir ?? node_path.join(adminDir, "dist");
12
+ const apiDir = config.apiDir ? node_path.resolve(baseDir, config.apiDir) : node_path.join(baseDir, "api");
13
+ const migrationsDir = config.migrationsDir ? node_path.resolve(baseDir, config.migrationsDir) : node_path.join(apiDir, "migrations");
14
+ const adminDir = config.adminDir === false ? void 0 : config.adminDir ? node_path.resolve(baseDir, config.adminDir) : node_path.join(baseDir, "admin");
15
+ const adminDistDir = adminDir === void 0 ? void 0 : config.adminDistDir ? node_path.resolve(baseDir, config.adminDistDir) : node_path.join(adminDir, "dist");
16
16
  return {
17
17
  baseDir,
18
18
  apiDir,
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceResolver.cjs","sources":["../../../../../../packages/cli/src/lib/workspace/WorkspaceResolver.ts"],"sourcesContent":["import { Workspace } from './Workspace'\nimport { join } from 'node:path'\nimport { YamlHandler } from '../fs/YamlHandler'\n\nexport interface LocalProjectConfig {\n\tapiDir?: string\n\tmigrationsDir?: string\n\tadminDir?: string | false\n\tadminDistDir?: string\n}\n\nexport class WorkspaceResolver {\n\tconstructor(\n\t\tprivate readonly yamlHandler: YamlHandler,\n\t) {\n\t}\n\n\tresolve = async (baseDir: string): Promise<Workspace> => {\n\t\tconst config = await this.readConfig(baseDir)\n\t\tconst apiDir = config.apiDir ?? join(baseDir, 'api')\n\t\tconst migrationsDir = config.migrationsDir ?? join(apiDir, 'migrations')\n\t\tconst adminDir = config.adminDir === false ? undefined : (config.adminDir ?? join(baseDir, 'admin'))\n\t\tconst adminDistDir = adminDir === undefined ? undefined : (config.adminDistDir ?? join(adminDir, 'dist'))\n\n\t\treturn {\n\t\t\tbaseDir,\n\t\t\tapiDir,\n\t\t\tmigrationsDir,\n\t\t\tadminDir,\n\t\t\tadminDistDir,\n\t\t}\n\t}\n\n\tprivate async readConfig(baseDir: string): Promise<LocalProjectConfig> {\n\t\tconst configPath = join(baseDir, 'contember.yaml')\n\t\ttry {\n\t\t\treturn await this.yamlHandler.readYaml(configPath)\n\t\t} catch (e: any) {\n\t\t\tif (e.code === 'ENOENT') {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n}\n"],"names":["join"],"mappings":";;;;;;AAWO,MAAM,kBAAkB;AAAA,EAC9B,YACkB,aAChB;AADgB,SAAA,cAAA;AAIlB,kBAAA,MAAA,WAAU,OAAO,YAAwC;AACxD,YAAM,SAAS,MAAM,KAAK,WAAW,OAAO;AAC5C,YAAM,SAAS,OAAO,UAAUA,UAAAA,KAAK,SAAS,KAAK;AACnD,YAAM,gBAAgB,OAAO,iBAAiBA,UAAAA,KAAK,QAAQ,YAAY;AACjE,YAAA,WAAW,OAAO,aAAa,QAAQ,SAAa,OAAO,YAAYA,eAAK,SAAS,OAAO;AAC5F,YAAA,eAAe,aAAa,SAAY,SAAa,OAAO,gBAAgBA,UAAAA,KAAK,UAAU,MAAM;AAEhG,aAAA;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IAAA,CACD;AAAA,EAAA;AAAA,EAEA,MAAc,WAAW,SAA8C;AAChE,UAAA,aAAaA,UAAAA,KAAK,SAAS,gBAAgB;AAC7C,QAAA;AACH,aAAO,MAAM,KAAK,YAAY,SAAS,UAAU;AAAA,aACzC,GAAQ;AACZ,UAAA,EAAE,SAAS,UAAU;AACxB,eAAO,CAAC;AAAA,MAAA;AAEH,YAAA;AAAA,IAAA;AAAA,EACP;AAEF;;"}
1
+ {"version":3,"file":"WorkspaceResolver.cjs","sources":["../../../../../../packages/cli/src/lib/workspace/WorkspaceResolver.ts"],"sourcesContent":["import { Workspace } from './Workspace'\nimport { join, resolve } from 'node:path'\nimport { YamlHandler } from '../fs/YamlHandler'\n\nexport interface LocalProjectConfig {\n\tapiDir?: string\n\tmigrationsDir?: string\n\tadminDir?: string | false\n\tadminDistDir?: string\n}\n\nexport class WorkspaceResolver {\n\tconstructor(\n\t\tprivate readonly yamlHandler: YamlHandler,\n\t) {\n\t}\n\n\tresolve = async (baseDir: string): Promise<Workspace> => {\n\t\tconst config = await this.readConfig(baseDir)\n\t\tconst apiDir = config.apiDir ? resolve(baseDir, config.apiDir) : join(baseDir, 'api')\n\t\tconst migrationsDir = config.migrationsDir ? resolve(baseDir, config.migrationsDir) : join(apiDir, 'migrations')\n\t\tconst adminDir = config.adminDir === false ? undefined : (config.adminDir ? resolve(baseDir, config.adminDir) : join(baseDir, 'admin'))\n\t\tconst adminDistDir = adminDir === undefined ? undefined : (config.adminDistDir ? resolve(baseDir, config.adminDistDir) : join(adminDir, 'dist'))\n\n\t\treturn {\n\t\t\tbaseDir,\n\t\t\tapiDir,\n\t\t\tmigrationsDir,\n\t\t\tadminDir,\n\t\t\tadminDistDir,\n\t\t}\n\t}\n\n\tprivate async readConfig(baseDir: string): Promise<LocalProjectConfig> {\n\t\tconst configPath = join(baseDir, 'contember.yaml')\n\t\ttry {\n\t\t\treturn await this.yamlHandler.readYaml(configPath)\n\t\t} catch (e: any) {\n\t\t\tif (e.code === 'ENOENT') {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n}\n"],"names":["resolve","join"],"mappings":";;;;;;AAWO,MAAM,kBAAkB;AAAA,EAC9B,YACkB,aAChB;AADgB,SAAA,cAAA;AAIlB,kBAAA,MAAA,WAAU,OAAO,YAAwC;AACxD,YAAM,SAAS,MAAM,KAAK,WAAW,OAAO;AAC5C,YAAM,SAAS,OAAO,SAASA,kBAAQ,SAAS,OAAO,MAAM,IAAIC,eAAK,SAAS,KAAK;AACpF,YAAM,gBAAgB,OAAO,gBAAgBD,kBAAQ,SAAS,OAAO,aAAa,IAAIC,eAAK,QAAQ,YAAY;AAC/G,YAAM,WAAW,OAAO,aAAa,QAAQ,SAAa,OAAO,WAAWD,UAAAA,QAAQ,SAAS,OAAO,QAAQ,IAAIC,UAAAA,KAAK,SAAS,OAAO;AACrI,YAAM,eAAe,aAAa,SAAY,SAAa,OAAO,eAAeD,UAAAA,QAAQ,SAAS,OAAO,YAAY,IAAIC,UAAAA,KAAK,UAAU,MAAM;AAE9I,aAAO;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAEF,CAAA;AAAA,EAhBA;AAAA,EAkBA,MAAc,WAAW,SAA8C;AACtE,UAAM,aAAaA,UAAAA,KAAK,SAAS,gBAAgB;AACjD,QAAI;AACH,aAAO,MAAM,KAAK,YAAY,SAAS,UAAU;AAAA,IAClD,SAAS,GAAQ;AAChB,UAAI,EAAE,SAAS,UAAU;AACxB,eAAO,CAAA;AAAA,MACR;AACA,YAAM;AAAA,IACP;AAAA,EACD;AACD;;"}
@@ -1,4 +1,4 @@
1
- import { join } from "node:path";
1
+ import { join, resolve } from "node:path";
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
@@ -7,10 +7,10 @@ class WorkspaceResolver {
7
7
  this.yamlHandler = yamlHandler;
8
8
  __publicField(this, "resolve", async (baseDir) => {
9
9
  const config = await this.readConfig(baseDir);
10
- const apiDir = config.apiDir ?? join(baseDir, "api");
11
- const migrationsDir = config.migrationsDir ?? join(apiDir, "migrations");
12
- const adminDir = config.adminDir === false ? void 0 : config.adminDir ?? join(baseDir, "admin");
13
- const adminDistDir = adminDir === void 0 ? void 0 : config.adminDistDir ?? join(adminDir, "dist");
10
+ const apiDir = config.apiDir ? resolve(baseDir, config.apiDir) : join(baseDir, "api");
11
+ const migrationsDir = config.migrationsDir ? resolve(baseDir, config.migrationsDir) : join(apiDir, "migrations");
12
+ const adminDir = config.adminDir === false ? void 0 : config.adminDir ? resolve(baseDir, config.adminDir) : join(baseDir, "admin");
13
+ const adminDistDir = adminDir === void 0 ? void 0 : config.adminDistDir ? resolve(baseDir, config.adminDistDir) : join(adminDir, "dist");
14
14
  return {
15
15
  baseDir,
16
16
  apiDir,