@contember/cli 2.1.0-alpha.8 → 2.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (479) hide show
  1. package/CLAUDE.md +39 -0
  2. package/dist/development/run.cjs.map +1 -1
  3. package/dist/development/run.js.map +1 -1
  4. package/dist/development/src/commands/actions/ActionsGetEventCommand.cjs +31 -0
  5. package/dist/development/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -0
  6. package/dist/development/src/commands/actions/ActionsGetEventCommand.js +31 -0
  7. package/dist/development/src/commands/actions/ActionsGetEventCommand.js.map +1 -0
  8. package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs +60 -0
  9. package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -0
  10. package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js +60 -0
  11. package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -0
  12. package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs +29 -0
  13. package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -0
  14. package/dist/development/src/commands/actions/ActionsListVariablesCommand.js +29 -0
  15. package/dist/development/src/commands/actions/ActionsListVariablesCommand.js.map +1 -0
  16. package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs +32 -0
  17. package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -0
  18. package/dist/development/src/commands/actions/ActionsRetryEventCommand.js +32 -0
  19. package/dist/development/src/commands/actions/ActionsRetryEventCommand.js.map +1 -0
  20. package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs +43 -0
  21. package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -0
  22. package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js +43 -0
  23. package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -0
  24. package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs +32 -0
  25. package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -0
  26. package/dist/development/src/commands/actions/ActionsStopEventCommand.js +32 -0
  27. package/dist/development/src/commands/actions/ActionsStopEventCommand.js.map +1 -0
  28. package/dist/development/src/commands/deploy/DeployCommand.cjs.map +1 -1
  29. package/dist/development/src/commands/deploy/DeployCommand.js.map +1 -1
  30. package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
  31. package/dist/development/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
  32. package/dist/development/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -1
  33. package/dist/development/src/commands/migrations/MigrationBlankCommand.js.map +1 -1
  34. package/dist/development/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
  35. package/dist/development/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
  36. package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
  37. package/dist/development/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
  38. package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
  39. package/dist/development/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
  40. package/dist/development/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
  41. package/dist/development/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
  42. package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs +1 -1
  43. package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
  44. package/dist/development/src/commands/migrations/MigrationStatusCommand.js +1 -1
  45. package/dist/development/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
  46. package/dist/development/src/commands/misc/VersionCommand.cjs.map +1 -1
  47. package/dist/development/src/commands/misc/VersionCommand.js.map +1 -1
  48. package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
  49. package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
  50. package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
  51. package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
  52. package/dist/development/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
  53. package/dist/development/src/commands/project/ProjectValidateCommand.js.map +1 -1
  54. package/dist/development/src/commands/transfer/ExportCommand.cjs +7 -2
  55. package/dist/development/src/commands/transfer/ExportCommand.cjs.map +1 -1
  56. package/dist/development/src/commands/transfer/ExportCommand.js +8 -3
  57. package/dist/development/src/commands/transfer/ExportCommand.js.map +1 -1
  58. package/dist/development/src/commands/transfer/ImportCommand.cjs +7 -4
  59. package/dist/development/src/commands/transfer/ImportCommand.cjs.map +1 -1
  60. package/dist/development/src/commands/transfer/ImportCommand.js +5 -2
  61. package/dist/development/src/commands/transfer/ImportCommand.js.map +1 -1
  62. package/dist/development/src/commands/transfer/TransferCommand.cjs +4 -5
  63. package/dist/development/src/commands/transfer/TransferCommand.cjs.map +1 -1
  64. package/dist/development/src/commands/transfer/TransferCommand.js +4 -5
  65. package/dist/development/src/commands/transfer/TransferCommand.js.map +1 -1
  66. package/dist/development/src/commands/transfer/utils.cjs.map +1 -1
  67. package/dist/development/src/commands/transfer/utils.js.map +1 -1
  68. package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs +16 -14
  69. package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
  70. package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js +16 -14
  71. package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
  72. package/dist/development/src/consts.cjs.map +1 -1
  73. package/dist/development/src/dic.cjs +100 -4
  74. package/dist/development/src/dic.cjs.map +1 -1
  75. package/dist/development/src/dic.js +101 -5
  76. package/dist/development/src/dic.js.map +1 -1
  77. package/dist/development/src/lib/SystemClientProvider.cjs.map +1 -1
  78. package/dist/development/src/lib/SystemClientProvider.js.map +1 -1
  79. package/dist/development/src/lib/TenantClientProvider.cjs.map +1 -1
  80. package/dist/development/src/lib/TenantClientProvider.js.map +1 -1
  81. package/dist/development/src/lib/VersionChecker.cjs +7 -9
  82. package/dist/development/src/lib/VersionChecker.cjs.map +1 -1
  83. package/dist/development/src/lib/VersionChecker.js +7 -9
  84. package/dist/development/src/lib/VersionChecker.js.map +1 -1
  85. package/dist/development/src/lib/actions/ActionsClient.cjs +91 -0
  86. package/dist/development/src/lib/actions/ActionsClient.cjs.map +1 -0
  87. package/dist/development/src/lib/actions/ActionsClient.js +91 -0
  88. package/dist/development/src/lib/actions/ActionsClient.js.map +1 -0
  89. package/dist/development/src/lib/admin/AdminClient.cjs.map +1 -1
  90. package/dist/development/src/lib/admin/AdminClient.js.map +1 -1
  91. package/dist/development/src/lib/admin/AdminDeployer.cjs.map +1 -1
  92. package/dist/development/src/lib/admin/AdminDeployer.js.map +1 -1
  93. package/dist/development/src/lib/assertNever.cjs.map +1 -1
  94. package/dist/development/src/lib/assertNever.js.map +1 -1
  95. package/dist/development/src/lib/dsn.cjs.map +1 -1
  96. package/dist/development/src/lib/dsn.js.map +1 -1
  97. package/dist/development/src/lib/env.cjs.map +1 -1
  98. package/dist/development/src/lib/env.js.map +1 -1
  99. package/dist/development/src/lib/fs/DockerComposeManager.cjs.map +1 -1
  100. package/dist/development/src/lib/fs/DockerComposeManager.js.map +1 -1
  101. package/dist/development/src/lib/fs/FileSystem.cjs.map +1 -1
  102. package/dist/development/src/lib/fs/FileSystem.js.map +1 -1
  103. package/dist/development/src/lib/fs/YamlHandler.cjs.map +1 -1
  104. package/dist/development/src/lib/fs/YamlHandler.js.map +1 -1
  105. package/dist/development/src/lib/js/EsBuildBuilder.cjs.map +1 -1
  106. package/dist/development/src/lib/js/EsBuildBuilder.js.map +1 -1
  107. package/dist/development/src/lib/js/EvalExecutor.cjs.map +1 -1
  108. package/dist/development/src/lib/js/EvalExecutor.js.map +1 -1
  109. package/dist/development/src/lib/js/JsCodeRunner.cjs.map +1 -1
  110. package/dist/development/src/lib/js/JsCodeRunner.js.map +1 -1
  111. package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
  112. package/dist/development/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
  113. package/dist/development/src/lib/migrations/MigrationPrinter.cjs +7 -2
  114. package/dist/development/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
  115. package/dist/development/src/lib/migrations/MigrationPrinter.js +7 -2
  116. package/dist/development/src/lib/migrations/MigrationPrinter.js.map +1 -1
  117. package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
  118. package/dist/development/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
  119. package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs +3 -3
  120. package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
  121. package/dist/development/src/lib/migrations/MigrationsStatusFacade.js +3 -3
  122. package/dist/development/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
  123. package/dist/development/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
  124. package/dist/development/src/lib/migrations/MigrationsValidator.js.map +1 -1
  125. package/dist/development/src/lib/project/RemoteProject.cjs.map +1 -1
  126. package/dist/development/src/lib/project/RemoteProject.js.map +1 -1
  127. package/dist/development/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
  128. package/dist/development/src/lib/project/RemoteProjectProvider.js.map +1 -1
  129. package/dist/development/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
  130. package/dist/development/src/lib/project/RemoteProjectResolver.js.map +1 -1
  131. package/dist/development/src/lib/project/docs/components/EntityInfo.cjs +135 -177
  132. package/dist/development/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
  133. package/dist/development/src/lib/project/docs/components/EntityInfo.js +136 -178
  134. package/dist/development/src/lib/project/docs/components/EntityInfo.js.map +1 -1
  135. package/dist/development/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
  136. package/dist/development/src/lib/project/docs/components/EntityLink.js.map +1 -1
  137. package/dist/development/src/lib/project/docs/components/FieldLink.cjs +5 -5
  138. package/dist/development/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
  139. package/dist/development/src/lib/project/docs/components/FieldLink.js +5 -5
  140. package/dist/development/src/lib/project/docs/components/FieldLink.js.map +1 -1
  141. package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs +8 -8
  142. package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
  143. package/dist/development/src/lib/project/docs/components/FieldPermissions.js +8 -8
  144. package/dist/development/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
  145. package/dist/development/src/lib/project/docs/components/FieldType.cjs +34 -36
  146. package/dist/development/src/lib/project/docs/components/FieldType.cjs.map +1 -1
  147. package/dist/development/src/lib/project/docs/components/FieldType.js +34 -36
  148. package/dist/development/src/lib/project/docs/components/FieldType.js.map +1 -1
  149. package/dist/development/src/lib/project/docs/components/OnDelete.cjs +22 -26
  150. package/dist/development/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
  151. package/dist/development/src/lib/project/docs/components/OnDelete.js +22 -26
  152. package/dist/development/src/lib/project/docs/components/OnDelete.js.map +1 -1
  153. package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs +16 -16
  154. package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
  155. package/dist/development/src/lib/project/docs/components/ProjectInfo.js +16 -16
  156. package/dist/development/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
  157. package/dist/development/src/lib/project/docs/components/SinglePermission.cjs.map +1 -1
  158. package/dist/development/src/lib/project/docs/components/SinglePermission.js.map +1 -1
  159. package/dist/development/src/lib/project/docs/components/utils.cjs.map +1 -1
  160. package/dist/development/src/lib/project/docs/components/utils.js.map +1 -1
  161. package/dist/development/src/lib/project/docs/projectDescribe.cjs.map +1 -1
  162. package/dist/development/src/lib/project/docs/projectDescribe.js.map +1 -1
  163. package/dist/development/src/lib/schema/SchemaLoader.cjs.map +1 -1
  164. package/dist/development/src/lib/schema/SchemaLoader.js.map +1 -1
  165. package/dist/development/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
  166. package/dist/development/src/lib/schema/SchemaValidationPrinter.cjs.map +1 -1
  167. package/dist/development/src/lib/schema/SchemaValidationPrinter.js.map +1 -1
  168. package/dist/development/src/lib/schema/collectReferences.cjs.map +1 -1
  169. package/dist/development/src/lib/schema/collectReferences.js.map +1 -1
  170. package/dist/development/src/lib/stream.cjs +0 -7
  171. package/dist/development/src/lib/stream.cjs.map +1 -1
  172. package/dist/development/src/lib/stream.js +1 -8
  173. package/dist/development/src/lib/stream.js.map +1 -1
  174. package/dist/development/src/lib/tenant/TenantClient.cjs.map +1 -1
  175. package/dist/development/src/lib/tenant/TenantClient.js.map +1 -1
  176. package/dist/development/src/lib/transfer/DataTransferClient.cjs +53 -61
  177. package/dist/development/src/lib/transfer/DataTransferClient.cjs.map +1 -1
  178. package/dist/development/src/lib/transfer/DataTransferClient.js +55 -63
  179. package/dist/development/src/lib/transfer/DataTransferClient.js.map +1 -1
  180. package/dist/development/src/lib/transfer/stdio.cjs.map +1 -1
  181. package/dist/development/src/lib/transfer/stdio.js.map +1 -1
  182. package/dist/development/src/lib/workspace/WorkspaceResolver.cjs +4 -4
  183. package/dist/development/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
  184. package/dist/development/src/lib/workspace/WorkspaceResolver.js +5 -5
  185. package/dist/development/src/lib/workspace/WorkspaceResolver.js.map +1 -1
  186. package/dist/production/run.cjs.map +1 -1
  187. package/dist/production/run.js.map +1 -1
  188. package/dist/production/src/commands/actions/ActionsGetEventCommand.cjs +31 -0
  189. package/dist/production/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -0
  190. package/dist/production/src/commands/actions/ActionsGetEventCommand.js +31 -0
  191. package/dist/production/src/commands/actions/ActionsGetEventCommand.js.map +1 -0
  192. package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs +60 -0
  193. package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -0
  194. package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js +60 -0
  195. package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -0
  196. package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs +29 -0
  197. package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -0
  198. package/dist/production/src/commands/actions/ActionsListVariablesCommand.js +29 -0
  199. package/dist/production/src/commands/actions/ActionsListVariablesCommand.js.map +1 -0
  200. package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs +32 -0
  201. package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -0
  202. package/dist/production/src/commands/actions/ActionsRetryEventCommand.js +32 -0
  203. package/dist/production/src/commands/actions/ActionsRetryEventCommand.js.map +1 -0
  204. package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs +43 -0
  205. package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -0
  206. package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js +43 -0
  207. package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -0
  208. package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs +32 -0
  209. package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -0
  210. package/dist/production/src/commands/actions/ActionsStopEventCommand.js +32 -0
  211. package/dist/production/src/commands/actions/ActionsStopEventCommand.js.map +1 -0
  212. package/dist/production/src/commands/deploy/DeployCommand.cjs.map +1 -1
  213. package/dist/production/src/commands/deploy/DeployCommand.js.map +1 -1
  214. package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
  215. package/dist/production/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
  216. package/dist/production/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -1
  217. package/dist/production/src/commands/migrations/MigrationBlankCommand.js.map +1 -1
  218. package/dist/production/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
  219. package/dist/production/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
  220. package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
  221. package/dist/production/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
  222. package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
  223. package/dist/production/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
  224. package/dist/production/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
  225. package/dist/production/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
  226. package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs +1 -1
  227. package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
  228. package/dist/production/src/commands/migrations/MigrationStatusCommand.js +1 -1
  229. package/dist/production/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
  230. package/dist/production/src/commands/misc/VersionCommand.cjs.map +1 -1
  231. package/dist/production/src/commands/misc/VersionCommand.js.map +1 -1
  232. package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
  233. package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
  234. package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
  235. package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
  236. package/dist/production/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
  237. package/dist/production/src/commands/project/ProjectValidateCommand.js.map +1 -1
  238. package/dist/production/src/commands/transfer/ExportCommand.cjs +7 -2
  239. package/dist/production/src/commands/transfer/ExportCommand.cjs.map +1 -1
  240. package/dist/production/src/commands/transfer/ExportCommand.js +8 -3
  241. package/dist/production/src/commands/transfer/ExportCommand.js.map +1 -1
  242. package/dist/production/src/commands/transfer/ImportCommand.cjs +7 -4
  243. package/dist/production/src/commands/transfer/ImportCommand.cjs.map +1 -1
  244. package/dist/production/src/commands/transfer/ImportCommand.js +5 -2
  245. package/dist/production/src/commands/transfer/ImportCommand.js.map +1 -1
  246. package/dist/production/src/commands/transfer/TransferCommand.cjs +4 -5
  247. package/dist/production/src/commands/transfer/TransferCommand.cjs.map +1 -1
  248. package/dist/production/src/commands/transfer/TransferCommand.js +4 -5
  249. package/dist/production/src/commands/transfer/TransferCommand.js.map +1 -1
  250. package/dist/production/src/commands/transfer/utils.cjs.map +1 -1
  251. package/dist/production/src/commands/transfer/utils.js.map +1 -1
  252. package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs +16 -14
  253. package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
  254. package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js +16 -14
  255. package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
  256. package/dist/production/src/consts.cjs.map +1 -1
  257. package/dist/production/src/dic.cjs +100 -4
  258. package/dist/production/src/dic.cjs.map +1 -1
  259. package/dist/production/src/dic.js +101 -5
  260. package/dist/production/src/dic.js.map +1 -1
  261. package/dist/production/src/lib/SystemClientProvider.cjs.map +1 -1
  262. package/dist/production/src/lib/SystemClientProvider.js.map +1 -1
  263. package/dist/production/src/lib/TenantClientProvider.cjs.map +1 -1
  264. package/dist/production/src/lib/TenantClientProvider.js.map +1 -1
  265. package/dist/production/src/lib/VersionChecker.cjs +7 -9
  266. package/dist/production/src/lib/VersionChecker.cjs.map +1 -1
  267. package/dist/production/src/lib/VersionChecker.js +7 -9
  268. package/dist/production/src/lib/VersionChecker.js.map +1 -1
  269. package/dist/production/src/lib/actions/ActionsClient.cjs +91 -0
  270. package/dist/production/src/lib/actions/ActionsClient.cjs.map +1 -0
  271. package/dist/production/src/lib/actions/ActionsClient.js +91 -0
  272. package/dist/production/src/lib/actions/ActionsClient.js.map +1 -0
  273. package/dist/production/src/lib/admin/AdminClient.cjs.map +1 -1
  274. package/dist/production/src/lib/admin/AdminClient.js.map +1 -1
  275. package/dist/production/src/lib/admin/AdminDeployer.cjs.map +1 -1
  276. package/dist/production/src/lib/admin/AdminDeployer.js.map +1 -1
  277. package/dist/production/src/lib/assertNever.cjs.map +1 -1
  278. package/dist/production/src/lib/assertNever.js.map +1 -1
  279. package/dist/production/src/lib/dsn.cjs.map +1 -1
  280. package/dist/production/src/lib/dsn.js.map +1 -1
  281. package/dist/production/src/lib/env.cjs.map +1 -1
  282. package/dist/production/src/lib/env.js.map +1 -1
  283. package/dist/production/src/lib/fs/DockerComposeManager.cjs.map +1 -1
  284. package/dist/production/src/lib/fs/DockerComposeManager.js.map +1 -1
  285. package/dist/production/src/lib/fs/FileSystem.cjs.map +1 -1
  286. package/dist/production/src/lib/fs/FileSystem.js.map +1 -1
  287. package/dist/production/src/lib/fs/YamlHandler.cjs.map +1 -1
  288. package/dist/production/src/lib/fs/YamlHandler.js.map +1 -1
  289. package/dist/production/src/lib/js/EsBuildBuilder.cjs.map +1 -1
  290. package/dist/production/src/lib/js/EsBuildBuilder.js.map +1 -1
  291. package/dist/production/src/lib/js/EvalExecutor.cjs.map +1 -1
  292. package/dist/production/src/lib/js/EvalExecutor.js.map +1 -1
  293. package/dist/production/src/lib/js/JsCodeRunner.cjs.map +1 -1
  294. package/dist/production/src/lib/js/JsCodeRunner.js.map +1 -1
  295. package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
  296. package/dist/production/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
  297. package/dist/production/src/lib/migrations/MigrationPrinter.cjs +7 -2
  298. package/dist/production/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
  299. package/dist/production/src/lib/migrations/MigrationPrinter.js +7 -2
  300. package/dist/production/src/lib/migrations/MigrationPrinter.js.map +1 -1
  301. package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
  302. package/dist/production/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
  303. package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs +3 -3
  304. package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
  305. package/dist/production/src/lib/migrations/MigrationsStatusFacade.js +3 -3
  306. package/dist/production/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
  307. package/dist/production/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
  308. package/dist/production/src/lib/migrations/MigrationsValidator.js.map +1 -1
  309. package/dist/production/src/lib/project/RemoteProject.cjs.map +1 -1
  310. package/dist/production/src/lib/project/RemoteProject.js.map +1 -1
  311. package/dist/production/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
  312. package/dist/production/src/lib/project/RemoteProjectProvider.js.map +1 -1
  313. package/dist/production/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
  314. package/dist/production/src/lib/project/RemoteProjectResolver.js.map +1 -1
  315. package/dist/production/src/lib/project/docs/components/EntityInfo.cjs +39 -66
  316. package/dist/production/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
  317. package/dist/production/src/lib/project/docs/components/EntityInfo.js +40 -67
  318. package/dist/production/src/lib/project/docs/components/EntityInfo.js.map +1 -1
  319. package/dist/production/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
  320. package/dist/production/src/lib/project/docs/components/EntityLink.js.map +1 -1
  321. package/dist/production/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
  322. package/dist/production/src/lib/project/docs/components/FieldLink.js.map +1 -1
  323. package/dist/production/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
  324. package/dist/production/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
  325. package/dist/production/src/lib/project/docs/components/FieldType.cjs +3 -5
  326. package/dist/production/src/lib/project/docs/components/FieldType.cjs.map +1 -1
  327. package/dist/production/src/lib/project/docs/components/FieldType.js +3 -5
  328. package/dist/production/src/lib/project/docs/components/FieldType.js.map +1 -1
  329. package/dist/production/src/lib/project/docs/components/OnDelete.cjs +4 -8
  330. package/dist/production/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
  331. package/dist/production/src/lib/project/docs/components/OnDelete.js +4 -8
  332. package/dist/production/src/lib/project/docs/components/OnDelete.js.map +1 -1
  333. package/dist/production/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
  334. package/dist/production/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
  335. package/dist/production/src/lib/project/docs/components/SinglePermission.cjs.map +1 -1
  336. package/dist/production/src/lib/project/docs/components/SinglePermission.js.map +1 -1
  337. package/dist/production/src/lib/project/docs/components/utils.cjs.map +1 -1
  338. package/dist/production/src/lib/project/docs/components/utils.js.map +1 -1
  339. package/dist/production/src/lib/project/docs/projectDescribe.cjs.map +1 -1
  340. package/dist/production/src/lib/project/docs/projectDescribe.js.map +1 -1
  341. package/dist/production/src/lib/schema/SchemaLoader.cjs.map +1 -1
  342. package/dist/production/src/lib/schema/SchemaLoader.js.map +1 -1
  343. package/dist/production/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
  344. package/dist/production/src/lib/schema/SchemaValidationPrinter.cjs.map +1 -1
  345. package/dist/production/src/lib/schema/SchemaValidationPrinter.js.map +1 -1
  346. package/dist/production/src/lib/schema/collectReferences.cjs.map +1 -1
  347. package/dist/production/src/lib/schema/collectReferences.js.map +1 -1
  348. package/dist/production/src/lib/stream.cjs +0 -7
  349. package/dist/production/src/lib/stream.cjs.map +1 -1
  350. package/dist/production/src/lib/stream.js +1 -8
  351. package/dist/production/src/lib/stream.js.map +1 -1
  352. package/dist/production/src/lib/tenant/TenantClient.cjs.map +1 -1
  353. package/dist/production/src/lib/tenant/TenantClient.js.map +1 -1
  354. package/dist/production/src/lib/transfer/DataTransferClient.cjs +53 -61
  355. package/dist/production/src/lib/transfer/DataTransferClient.cjs.map +1 -1
  356. package/dist/production/src/lib/transfer/DataTransferClient.js +55 -63
  357. package/dist/production/src/lib/transfer/DataTransferClient.js.map +1 -1
  358. package/dist/production/src/lib/transfer/stdio.cjs.map +1 -1
  359. package/dist/production/src/lib/transfer/stdio.js.map +1 -1
  360. package/dist/production/src/lib/workspace/WorkspaceResolver.cjs +4 -4
  361. package/dist/production/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
  362. package/dist/production/src/lib/workspace/WorkspaceResolver.js +5 -5
  363. package/dist/production/src/lib/workspace/WorkspaceResolver.js.map +1 -1
  364. package/dist/types/commands/actions/ActionsGetEventCommand.d.ts +16 -0
  365. package/dist/types/commands/actions/ActionsGetEventCommand.d.ts.map +1 -0
  366. package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts +15 -0
  367. package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts.map +1 -0
  368. package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts +14 -0
  369. package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts.map +1 -0
  370. package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts +16 -0
  371. package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts.map +1 -0
  372. package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts +19 -0
  373. package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts.map +1 -0
  374. package/dist/types/commands/actions/ActionsStopEventCommand.d.ts +16 -0
  375. package/dist/types/commands/actions/ActionsStopEventCommand.d.ts.map +1 -0
  376. package/dist/types/commands/deploy/DeployCommand.d.ts.map +1 -1
  377. package/dist/types/commands/migrations/MigrationAmendCommand.d.ts.map +1 -1
  378. package/dist/types/commands/migrations/MigrationBlankCommand.d.ts.map +1 -1
  379. package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts.map +1 -1
  380. package/dist/types/commands/migrations/MigrationDiffCommand.d.ts.map +1 -1
  381. package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts.map +1 -1
  382. package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts.map +1 -1
  383. package/dist/types/commands/migrations/MigrationStatusCommand.d.ts.map +1 -1
  384. package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts.map +1 -1
  385. package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
  386. package/dist/types/commands/transfer/ExportCommand.d.ts.map +1 -1
  387. package/dist/types/commands/transfer/ImportCommand.d.ts.map +1 -1
  388. package/dist/types/commands/transfer/TransferCommand.d.ts.map +1 -1
  389. package/dist/types/commands/transfer/utils.d.ts.map +1 -1
  390. package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +1 -1
  391. package/dist/types/dic.d.ts +18 -0
  392. package/dist/types/dic.d.ts.map +1 -1
  393. package/dist/types/lib/VersionChecker.d.ts.map +1 -1
  394. package/dist/types/lib/actions/ActionsClient.d.ts +33 -0
  395. package/dist/types/lib/actions/ActionsClient.d.ts.map +1 -0
  396. package/dist/types/lib/admin/AdminClient.d.ts.map +1 -1
  397. package/dist/types/lib/admin/AdminDeployer.d.ts.map +1 -1
  398. package/dist/types/lib/fs/DockerComposeManager.d.ts.map +1 -1
  399. package/dist/types/lib/migrations/MigrationPrinter.d.ts +1 -1
  400. package/dist/types/lib/migrations/MigrationPrinter.d.ts.map +1 -1
  401. package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts +3 -1
  402. package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts.map +1 -1
  403. package/dist/types/lib/project/docs/components/EntityInfo.d.ts.map +1 -1
  404. package/dist/types/lib/project/docs/components/FieldLink.d.ts.map +1 -1
  405. package/dist/types/lib/project/docs/components/FieldPermissions.d.ts.map +1 -1
  406. package/dist/types/lib/project/docs/components/FieldType.d.ts.map +1 -1
  407. package/dist/types/lib/project/docs/components/OnDelete.d.ts.map +1 -1
  408. package/dist/types/lib/project/docs/components/ProjectInfo.d.ts.map +1 -1
  409. package/dist/types/lib/project/docs/projectDescribe.d.ts.map +1 -1
  410. package/dist/types/lib/schema/SchemaValidationPrinter.d.ts.map +1 -1
  411. package/dist/types/lib/stream.d.ts.map +1 -1
  412. package/dist/types/lib/tenant/TenantClient.d.ts.map +1 -1
  413. package/dist/types/lib/transfer/DataTransferClient.d.ts +2 -4
  414. package/dist/types/lib/transfer/DataTransferClient.d.ts.map +1 -1
  415. package/dist/types/tsconfig.tsbuildinfo +1 -1
  416. package/package.json +33 -29
  417. package/src/commands/actions/ActionsGetEventCommand.ts +41 -0
  418. package/src/commands/actions/ActionsListFailedEventsCommand.ts +68 -0
  419. package/src/commands/actions/ActionsListVariablesCommand.ts +36 -0
  420. package/src/commands/actions/ActionsRetryEventCommand.ts +42 -0
  421. package/src/commands/actions/ActionsSetVariablesCommand.ts +62 -0
  422. package/src/commands/actions/ActionsStopEventCommand.ts +42 -0
  423. package/src/commands/deploy/DeployCommand.ts +0 -3
  424. package/src/commands/migrations/MigrationAmendCommand.ts +2 -2
  425. package/src/commands/migrations/MigrationBlankCommand.ts +1 -3
  426. package/src/commands/migrations/MigrationDescribeCommand.ts +0 -1
  427. package/src/commands/migrations/MigrationDiffCommand.ts +0 -2
  428. package/src/commands/migrations/MigrationExecuteCommand.ts +1 -2
  429. package/src/commands/migrations/MigrationRebaseCommand.ts +0 -2
  430. package/src/commands/migrations/MigrationStatusCommand.ts +8 -13
  431. package/src/commands/project/ProjectGenerateDocumentationCommand.ts +1 -2
  432. package/src/commands/project/ProjectPrintSchemaCommand.ts +1 -3
  433. package/src/commands/transfer/ExportCommand.ts +9 -4
  434. package/src/commands/transfer/ImportCommand.ts +7 -3
  435. package/src/commands/transfer/TransferCommand.ts +6 -6
  436. package/src/commands/transfer/utils.ts +0 -1
  437. package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +16 -14
  438. package/src/dic.ts +162 -103
  439. package/src/lib/VersionChecker.ts +11 -9
  440. package/src/lib/actions/ActionsClient.ts +111 -0
  441. package/src/lib/admin/AdminClient.ts +2 -2
  442. package/src/lib/admin/AdminDeployer.ts +0 -1
  443. package/src/lib/fs/DockerComposeManager.ts +0 -3
  444. package/src/lib/migrations/MigrationPrinter.ts +7 -4
  445. package/src/lib/migrations/MigrationsStatusFacade.ts +4 -4
  446. package/src/lib/project/RemoteProjectResolver.ts +2 -2
  447. package/src/lib/project/docs/components/EntityInfo.tsx +36 -31
  448. package/src/lib/project/docs/components/FieldLink.tsx +5 -1
  449. package/src/lib/project/docs/components/FieldPermissions.tsx +8 -6
  450. package/src/lib/project/docs/components/FieldType.tsx +31 -30
  451. package/src/lib/project/docs/components/OnDelete.tsx +15 -13
  452. package/src/lib/project/docs/components/ProjectInfo.tsx +1 -4
  453. package/src/lib/project/docs/components/SinglePermission.tsx +0 -1
  454. package/src/lib/project/docs/components/utils.ts +0 -1
  455. package/src/lib/project/docs/projectDescribe.tsx +0 -2
  456. package/src/lib/project/docs/resources/style.css +2 -3
  457. package/src/lib/schema/SchemaLoader.ts +1 -1
  458. package/src/lib/schema/SchemaValidationPrinter.ts +0 -1
  459. package/src/lib/stream.ts +7 -8
  460. package/src/lib/tenant/TenantClient.ts +0 -1
  461. package/src/lib/transfer/DataTransferClient.ts +56 -74
  462. package/src/lib/transfer/stdio.ts +0 -1
  463. package/src/lib/workspace/WorkspaceResolver.ts +5 -5
  464. package/src/run.ts +2 -5
  465. package/dist/development/src/lib/migrations/migrations.cjs +0 -43
  466. package/dist/development/src/lib/migrations/migrations.cjs.map +0 -1
  467. package/dist/development/src/lib/migrations/migrations.js +0 -43
  468. package/dist/development/src/lib/migrations/migrations.js.map +0 -1
  469. package/dist/production/src/lib/migrations/migrations.cjs +0 -43
  470. package/dist/production/src/lib/migrations/migrations.cjs.map +0 -1
  471. package/dist/production/src/lib/migrations/migrations.js +0 -43
  472. package/dist/production/src/lib/migrations/migrations.js.map +0 -1
  473. package/dist/types/lib/migrations/migrations.d.ts +0 -3
  474. package/dist/types/lib/migrations/migrations.d.ts.map +0 -1
  475. package/postcss.config.js +0 -6
  476. package/src/.eslintrc.cjs +0 -5
  477. package/src/lib/migrations/migrations.ts +0 -45
  478. package/src/lib/project/docs/.eslintrc.cjs +0 -5
  479. package/tailwind.config.js +0 -7
@@ -1,22 +1,22 @@
1
- import { MigrationsResolver, MigrationsStatusResolver, SystemClient } from '@contember/migrations-client'
2
- import { createMigrationStatusTable } from './migrations'
1
+ import { MigrationsResolver, MigrationsStatusResolver } from '@contember/migrations-client'
3
2
  import { SystemClientProvider } from '../SystemClientProvider'
3
+ import { MigrationPrinter } from './MigrationPrinter'
4
4
 
5
5
  export class MigrationsStatusFacade {
6
6
  constructor(
7
7
  private readonly systemClientProvider: SystemClientProvider,
8
8
  private readonly migrationsResolver: MigrationsResolver,
9
9
  private readonly migrationsStatusResolver: MigrationsStatusResolver,
10
+ private readonly migrationPrinter: MigrationPrinter,
10
11
  ) {
11
12
  }
12
13
 
13
-
14
14
  public resolveMigrationsStatus = async ({ force, allowError }: { force?: boolean; allowError?: boolean }) => {
15
15
  const executedMigrations = await this.systemClientProvider.get().listExecutedMigrations()
16
16
  const localMigrations = await this.migrationsResolver.getMigrationFiles()
17
17
  const status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force)
18
18
  if (status.errorMigrations.length > 0 && !allowError) {
19
- console.error(createMigrationStatusTable(status.errorMigrations))
19
+ console.error(this.migrationPrinter.printStatusTable(status.errorMigrations))
20
20
  if (!force) {
21
21
  throw `Cannot execute migrations`
22
22
  }
@@ -13,9 +13,9 @@ export class RemoteProjectResolver {
13
13
  let token: string | undefined
14
14
  let project: string | undefined
15
15
  if (identifier?.includes('://')) {
16
- ({ endpoint, project, token } = parseDsn(identifier))
16
+ ;({ endpoint, project, token } = parseDsn(identifier))
17
17
  } else if (this.cliEnv.dsn) {
18
- ({ endpoint, project, token } = parseDsn(this.cliEnv.dsn))
18
+ ;({ endpoint, project, token } = parseDsn(this.cliEnv.dsn))
19
19
  } else {
20
20
  endpoint = this.cliEnv.apiUrl
21
21
  token = this.cliEnv.apiToken
@@ -14,8 +14,7 @@ interface EntityInfoProps {
14
14
  }
15
15
 
16
16
  export const EntityInfo = ({ entity, schema, references }: EntityInfoProps) => (
17
- <div class={'m-4 border border-gray-400 rounded-lg group'}
18
- id={formatEntityAnchor(entity.name)}>
17
+ <div class={'m-4 border border-gray-400 rounded-lg group'} id={formatEntityAnchor(entity.name)}>
19
18
  <div class={'font-bold text-gray-900 py-2 px-4 border-b border-gray-400 group-target:bg-yellow-100 rounded-t-lg'}>
20
19
  {entity.name}
21
20
  </div>
@@ -26,60 +25,66 @@ export const EntityInfo = ({ entity, schema, references }: EntityInfoProps) => (
26
25
  <tr>
27
26
  <th class={'text-left px-2 text-gray-500 font-normal w-[180px] max-w-[180px]'}>Name</th>
28
27
  <th class={'text-left px-2 text-gray-500 font-normal w-[340px] max-w-[340px]'}>Type</th>
29
- {Object.keys(schema.acl.roles).map(role => <th
30
- key={role}
31
- class={'text-left px-2 text-gray-500 font-normal w-[120px] max-w-[120px] text-xs truncate text-sm'}>{role}</th>)}
28
+ {Object.keys(schema.acl.roles).map(role => (
29
+ <th
30
+ key={role}
31
+ class={'text-left px-2 text-gray-500 font-normal w-[120px] max-w-[120px] text-xs truncate text-sm'}
32
+ >
33
+ {role}
34
+ </th>
35
+ ))}
32
36
  </tr>
33
37
  </thead>
34
38
  <tr>
35
39
  <td></td>
36
40
  <td></td>
37
- {Object.entries(schema.acl.roles).map(([name, role]) => <td class={'px-2'} key={name}>
38
- <SinglePermission value={'D'}
39
- predicate={role.entities[entity.name]?.operations.delete} />
40
- </td>)}
41
+ {Object.entries(schema.acl.roles).map(([name, role]) => (
42
+ <td class={'px-2'} key={name}>
43
+ <SinglePermission value={'D'} predicate={role.entities[entity.name]?.operations.delete} />
44
+ </td>
45
+ ))}
41
46
  </tr>
42
47
  {Object.values(entity.fields).map(field => (
43
- <tr class={'even:bg-gray-100 target:bg-yellow-100'}
44
- id={formatFieldAnchor(entity.name, field.name)}
45
- key={field.name}
46
- >
48
+ <tr class={'even:bg-gray-100 target:bg-yellow-100'} id={formatFieldAnchor(entity.name, field.name)} key={field.name}>
47
49
  <td class={'px-2 font-mono truncate w-[180px] max-w-[180px]'} title={field.name}>
48
50
  {field.name}
49
51
  </td>
50
52
  <td class={'text-gray-800 px-2 font-mono w-[420px] max-w-[420px]'}>
51
53
  <FieldType field={field} />
52
54
  </td>
53
- {Object.entries(schema.acl.roles).map(([name, role]) => <td class={'px-2'} key={name}>
54
- <FieldPermissions field={field.name}
55
- entityPermissions={role.entities[entity.name]} />
56
- </td>)}
55
+ {Object.entries(schema.acl.roles).map(([name, role]) => (
56
+ <td class={'px-2'} key={name}>
57
+ <FieldPermissions field={field.name} entityPermissions={role.entities[entity.name]} />
58
+ </td>
59
+ ))}
57
60
  </tr>
58
61
  ))}
59
-
60
62
  </table>
61
63
  </div>
62
64
  <div class={'px-2 py-2 w-1/2'}>
63
65
  <h3 class={'text-lg text-gray-600'}>On delete behaviour:</h3>
64
66
  <p class={'text-gray-500 text-sm'}>
65
- (What happens when you attempt to delete entity {entity.name})</p>
67
+ (What happens when you attempt to delete entity {entity.name})
68
+ </p>
66
69
  <div class={'mt-2 text-sm '}>
67
70
  <OnDelete references={references} entity={entity} />
68
71
  </div>
69
72
  </div>
70
- {false && <div class={'px-2 py-2 w-1/2'}>
71
- <h3 class={'text-lg text-gray-600'}>ACL predicates:</h3>
72
- <div class={'mt-2 text-sm '}>
73
- {Object.entries(schema.acl.roles).map(([roleName, role]) =>
74
- Object.entries(role.entities[entity.name]?.predicates ?? {}).map(([predicateName, predicate]) => (
75
- <Fragment key={roleName + '__' + predicateName}>
76
- <h4>{roleName}: {predicateName}</h4>
77
- <code>{JSON.stringify(predicate)}</code>
78
- </Fragment>
79
- )),
80
- )}
73
+ {false && (
74
+ <div class={'px-2 py-2 w-1/2'}>
75
+ <h3 class={'text-lg text-gray-600'}>ACL predicates:</h3>
76
+ <div class={'mt-2 text-sm '}>
77
+ {Object.entries(schema.acl.roles).map(([roleName, role]) =>
78
+ Object.entries(role.entities[entity.name]?.predicates ?? {}).map(([predicateName, predicate]) => (
79
+ <Fragment key={roleName + '__' + predicateName}>
80
+ <h4>{roleName}: {predicateName}</h4>
81
+ <code>{JSON.stringify(predicate)}</code>
82
+ </Fragment>
83
+ ))
84
+ )}
85
+ </div>
81
86
  </div>
82
- </div>}
87
+ )}
83
88
  </div>
84
89
  </div>
85
90
  )
@@ -4,7 +4,11 @@ import { formatFieldAnchor } from './utils'
4
4
 
5
5
  export const FieldLink = ({ entity, field, noEntityLabel }: { entity: string; field: string; noEntityLabel?: boolean }) => (
6
6
  <Fragment>
7
- {noEntityLabel ? '' : <Fragment><EntityLink entity={entity} />.</Fragment>}
7
+ {noEntityLabel ? '' : (
8
+ <Fragment>
9
+ <EntityLink entity={entity} />.
10
+ </Fragment>
11
+ )}
8
12
  <a href={`#${formatFieldAnchor(entity, field)}`} class={'text-blue-500 hover:underline'}>{field}</a>
9
13
  </Fragment>
10
14
  )
@@ -2,13 +2,15 @@ import { Fragment, h } from 'preact'
2
2
  import { Acl } from '@contember/schema'
3
3
  import { SinglePermission } from './SinglePermission'
4
4
 
5
- export const FieldPermissions = ({ entityPermissions, field }: { entityPermissions?: Acl.EntityPermissions; field: string }) => {
5
+ export const FieldPermissions = ({ entityPermissions, field }: { entityPermissions?: Acl.EntityPermissions; field: string }) => {
6
6
  const readPermissions = entityPermissions?.operations.read?.[field]
7
7
  const updatePermissions = entityPermissions?.operations.update?.[field]
8
8
  const createPermissions = entityPermissions?.operations.create?.[field]
9
- return <Fragment>
10
- <SinglePermission value={'C'} predicate={createPermissions} />
11
- <SinglePermission value={'R'} predicate={readPermissions} />
12
- <SinglePermission value={'U'} predicate={updatePermissions} />
13
- </Fragment>
9
+ return (
10
+ <Fragment>
11
+ <SinglePermission value={'C'} predicate={createPermissions} />
12
+ <SinglePermission value={'R'} predicate={readPermissions} />
13
+ <SinglePermission value={'U'} predicate={updatePermissions} />
14
+ </Fragment>
15
+ )
14
16
  }
@@ -1,45 +1,46 @@
1
1
  import { Model } from '@contember/schema'
2
- import { h, Fragment } from 'preact'
2
+ import { Fragment, h } from 'preact'
3
3
  import { EntityLink } from './EntityLink'
4
4
  import { FieldLink } from './FieldLink'
5
5
 
6
6
  export const FieldType = ({ field }: { field: Model.AnyField }) => {
7
7
  if (field.type === 'ManyHasMany') {
8
- return <>
9
- <EntityLink entity={field.target}/>[]{' '}
10
- <TargetField field={field}/> (m:n)
11
- </>
12
-
8
+ return (
9
+ <>
10
+ <EntityLink entity={field.target} />[] <TargetField field={field} /> (m:n)
11
+ </>
12
+ )
13
13
  } else if (field.type === 'OneHasMany') {
14
- return <>
15
- <EntityLink entity={field.target}/>[]{' '}
16
- <TargetField field={field}/> (1:n)
17
- </>
18
-
14
+ return (
15
+ <>
16
+ <EntityLink entity={field.target} />[] <TargetField field={field} /> (1:n)
17
+ </>
18
+ )
19
19
  } else if (field.type === 'OneHasOne') {
20
- return <>
21
- <NullableMark field={field} />
22
- <EntityLink entity={field.target}/>{' '}
23
- <TargetField field={field}/> (1:1)
24
- </>
25
-
20
+ return (
21
+ <>
22
+ <NullableMark field={field} />
23
+ <EntityLink entity={field.target} /> <TargetField field={field} /> (1:1)
24
+ </>
25
+ )
26
26
  } else if (field.type === 'ManyHasOne') {
27
- return <>
28
- <NullableMark field={field} />
29
- <EntityLink entity={field.target}/>{' '}
30
- <TargetField field={field}/> (m:1)
31
- </>
32
-
27
+ return (
28
+ <>
29
+ <NullableMark field={field} />
30
+ <EntityLink entity={field.target} /> <TargetField field={field} /> (m:1)
31
+ </>
32
+ )
33
33
  } else {
34
- return <>
35
- <NullableMark field={field} />
36
- {field.type}
37
- </>
38
-
34
+ return (
35
+ <>
36
+ <NullableMark field={field} />
37
+ {field.type}
38
+ </>
39
+ )
39
40
  }
40
41
  }
41
42
 
42
- const TargetField = ({ field }: {field: Model.AnyRelation}) => {
43
+ const TargetField = ({ field }: { field: Model.AnyRelation }) => {
43
44
  if ('ownedBy' in field) {
44
45
  return <FieldLink entity={field.target} field={field.ownedBy} noEntityLabel />
45
46
  }
@@ -50,5 +51,5 @@ const TargetField = ({ field }: {field: Model.AnyRelation}) => {
50
51
  }
51
52
 
52
53
  const NullableMark = (props: { field: Model.NullableRelation | Model.AnyColumn }) => {
53
- return props.field.nullable ? <span class={'font-bold color-black'}>? </span> : null
54
+ return props.field.nullable ? <span class={'font-bold color-black'}>?</span> : null
54
55
  }
@@ -1,4 +1,4 @@
1
- import { h, Fragment } from 'preact'
1
+ import { Fragment, h } from 'preact'
2
2
  import { Model } from '@contember/schema'
3
3
  import { ReferenceMapEntry, ReferencesMap } from '../../../schema/collectReferences'
4
4
  import { FieldLink } from './FieldLink'
@@ -36,37 +36,39 @@ export const OnDelete = ({ references, entity, visited = [] }: { references: Ref
36
36
  .sort(sortReferences)
37
37
  .map(it => {
38
38
  const inverseDescr = it.targetRelation
39
- ? <>see <FieldLink entity={entity.name} field={it.targetRelation.name} /></>
39
+ ? (
40
+ <>
41
+ see <FieldLink entity={entity.name} field={it.targetRelation.name} />
42
+ </>
43
+ )
40
44
  : 'no inverse side'
41
45
  if (it.owningRelation.joiningColumn.onDelete === 'restrict') {
42
46
  return (
43
47
  <li key={it.owningEntity.name + '_' + it.owningRelation.name}>
44
- <span class={'bg-black text-white px-1'}>Fails</span> when referenced from
45
- {' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />
46
- {' '}({inverseDescr})
48
+ <span class={'bg-black text-white px-1'}>Fails</span> when referenced from{' '}
49
+ <FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} /> ({inverseDescr})
47
50
  </li>
48
51
  )
49
52
  }
50
53
  if (it.owningRelation.joiningColumn.onDelete === 'set null') {
51
54
  return (
52
55
  <li key={it.owningEntity.name + '_' + it.owningRelation.name}>
53
- <span class={'bg-blue-400 text-white px-1'}>Sets null</span> at
54
- {' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />
55
- {' '}({inverseDescr})
56
+ <span class={'bg-blue-400 text-white px-1'}>Sets null</span> at <FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />
57
+ {' '}
58
+ ({inverseDescr})
56
59
  </li>
57
60
  )
58
61
  }
59
62
  if (it.owningRelation.joiningColumn.onDelete === 'cascade') {
60
63
  return (
61
64
  <li key={it.owningEntity.name + '_' + it.owningRelation.name}>
62
- <span class={'bg-red-400 text-white px-1'}>Deletes</span> <EntityLink entity={it.owningEntity.name} />
63
- {' '}connected using
64
- {' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} noEntityLabel />
65
- {' '}({inverseDescr})
65
+ <span class={'bg-red-400 text-white px-1'}>Deletes</span> <EntityLink entity={it.owningEntity.name} /> connected using{' '}
66
+ <FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} noEntityLabel /> ({inverseDescr})
66
67
  <OnDelete entity={it.owningEntity} visited={[...visited, entity]} references={references} />
67
68
  </li>
68
69
  )
69
70
  }
70
71
  })}
71
- </ul>)
72
+ </ul>
73
+ )
72
74
  }
@@ -4,7 +4,6 @@ import { collectReferences } from '../../../schema/collectReferences'
4
4
  import { EntityLink } from './EntityLink'
5
5
  import { EntityInfo } from './EntityInfo'
6
6
 
7
-
8
7
  export const ProjectInfo = (props: { schema: Schema; projectName: string }) => {
9
8
  const references = collectReferences(props.schema.model)
10
9
 
@@ -37,11 +36,9 @@ export const ProjectInfo = (props: { schema: Schema; projectName: string }) => {
37
36
  </ul>
38
37
  </div>
39
38
  </div>
40
-
41
-
42
39
  </div>
43
40
  {Object.values(props.schema.model.entities).map(entity => (
44
- <EntityInfo key={entity.name} entity={entity} schema={props.schema} references={references}/>
41
+ <EntityInfo key={entity.name} entity={entity} schema={props.schema} references={references} />
45
42
  ))}
46
43
  </div>
47
44
  )
@@ -10,4 +10,3 @@ export const SinglePermission = ({ predicate, value }: { predicate?: Acl.Predica
10
10
  }
11
11
  return <span class={'bg-yellow-400 text-black font-semibold px-0.5'} title={predicate}>{value}</span>
12
12
  }
13
-
@@ -1,3 +1,2 @@
1
1
  export const formatEntityAnchor = (name: string) => `entity-${name}`
2
2
  export const formatFieldAnchor = (entity: string, field: string) => `field-${entity}--${field}`
3
-
@@ -22,6 +22,4 @@ ${html}
22
22
  </body>
23
23
  </html>
24
24
  `
25
-
26
25
  }
27
-
@@ -1,3 +1,2 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
1
+ @import 'tailwindcss';
2
+ @source "../../components/**/*.tsx";
@@ -28,7 +28,7 @@ export class TranspilingSchemaLoader {
28
28
  loadSchema = async (): Promise<Schema> => {
29
29
  const path = join(this.workspace.apiDir, 'index.ts')
30
30
 
31
- const result = (await this.jsCodeRunner.run(path))
31
+ const result = await this.jsCodeRunner.run(path)
32
32
  return Typesafe.object({ default: schemaType })(result).default
33
33
  }
34
34
  }
@@ -1,6 +1,5 @@
1
1
  import { ValidationError } from '@contember/schema-utils'
2
2
 
3
-
4
3
  export const printValidationErrors = (errors: ValidationError[], message?: string) => {
5
4
  if (errors.length === 0) {
6
5
  return
package/src/lib/stream.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { Stream, Transform } from 'node:stream'
2
2
  import { Buffer } from 'node:buffer'
3
3
 
4
-
5
4
  export class LineTransform extends Transform {
6
5
  private chunks: Buffer[] = []
7
6
 
@@ -35,10 +34,10 @@ export class LineTransform extends Transform {
35
34
  }
36
35
  }
37
36
 
38
-
39
- export const readStream = async (stream: Stream) => new Promise<Buffer>((resolve, reject) => {
40
- const chunks: Buffer[] = []
41
- stream.on('error', err => reject(err))
42
- stream.on('data', chunk => chunks.push(chunk))
43
- stream.on('end', () => resolve(Buffer.concat(chunks)))
44
- })
37
+ export const readStream = async (stream: Stream) =>
38
+ new Promise<Buffer>((resolve, reject) => {
39
+ const chunks: Buffer[] = []
40
+ stream.on('error', err => reject(err))
41
+ stream.on('data', chunk => chunks.push(chunk))
42
+ stream.on('end', () => resolve(Buffer.concat(chunks)))
43
+ })
@@ -10,7 +10,6 @@ export const createTenantApiUrl = (url: string) => {
10
10
  return url + '/tenant'
11
11
  }
12
12
 
13
-
14
13
  export class TenantClient {
15
14
  constructor(private readonly apiClient: GraphQlClient) {}
16
15
 
@@ -1,12 +1,9 @@
1
- import http from 'node:http'
2
- import https from 'node:https'
3
- import { LineTransform, readStream } from '../stream'
4
- import { Readable, Stream } from 'node:stream'
1
+ import { LineTransform } from '../stream'
2
+ import { Readable } from 'node:stream'
5
3
  import { createGzip } from 'node:zlib'
6
4
  import { RemoteProject } from '../project/RemoteProject'
7
5
 
8
6
  export class DataTransferClient {
9
-
10
7
  dataImport = async ({ printProgress, stream, project, gzip }: {
11
8
  stream: Readable
12
9
  project: RemoteProject
@@ -18,96 +15,81 @@ export class DataTransferClient {
18
15
  let rowTotal = 0
19
16
  let transferred = 0
20
17
  let start = Date.now()
21
- const inputStream = stream.pipe(new LineTransform(line => {
22
- transferred += line.length + 1
23
- if (line === '') {
24
- return ''
25
- }
26
- const data = JSON.parse(line)
27
- switch (data[0]) {
28
- case 'importSystemSchemaBegin':
29
- return JSON.stringify([data[0], { ...data[1], project: project.name }])
30
- case 'importContentSchemaBegin':
31
- return JSON.stringify([data[0], { ...data[1], project: project.name }])
32
- case 'insertBegin':
33
- table = data[1].table
34
- rowCount = 0
35
- break
36
- case 'insertRow':
37
- rowCount++
38
- rowTotal++
39
- break
40
- case 'insertEnd':
41
- break
42
- }
43
- if ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {
44
- const mbs = Math.floor(transferred / 1024 / 1024).toString()
45
- const durationS = Math.floor((Date.now() - start) / 1000)
46
- printProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)
47
- }
48
- return line
49
- }))
18
+ const inputStream = stream.pipe(
19
+ new 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
+ case 'insertEnd':
39
+ break
40
+ }
41
+ if ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {
42
+ const mbs = Math.floor(transferred / 1024 / 1024).toString()
43
+ const durationS = Math.floor((Date.now() - start) / 1000)
44
+ printProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)
45
+ }
46
+ return line
47
+ }),
48
+ )
49
+ inputStream.on('error', err => {
50
+ throw new Error(`Input stream error: ${err}`)
51
+ })
50
52
 
51
- return await this.executeRequest({
52
- url: `${project.endpoint}/import`,
53
- token: project.token,
53
+ const bodyStream = Readable.toWeb(gzip ? inputStream.pipe(createGzip()) : inputStream) as unknown as BodyInit
54
+
55
+ const response = await fetch(`${project.endpoint}/import`, {
54
56
  headers: {
57
+ 'Authorization': `Bearer ${project.token}`,
55
58
  'Content-type': 'application/x-ndjson',
56
59
  ...(gzip ? { 'Content-Encoding': 'gzip' } : {}),
57
60
  },
58
- body: gzip ? inputStream.pipe(createGzip()) : inputStream,
61
+ method: 'POST',
62
+ body: bodyStream,
63
+ ...{ duplex: 'half' },
59
64
  })
65
+ if (!response.ok) {
66
+ const responseBody = await response.text()
67
+ throw new Error(`Invalid response: ${response.statusText}\n${responseBody}`)
68
+ }
69
+ return response
60
70
  }
61
71
 
62
-
63
72
  dataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {
64
73
  project: RemoteProject
65
74
  excludeTables?: string[]
66
75
  includeSystem: boolean
67
76
  gzip: boolean
68
77
  }) => {
69
- return await this.executeRequest({
70
- url: `${baseUrl}/export`,
71
- token,
78
+ const response = await fetch(`${baseUrl}/export`, {
72
79
  headers: {
80
+ 'Authorization': `Bearer ${token}`,
73
81
  'Accept-Encoding': gzip ? 'gzip' : 'identity',
74
82
  'Content-type': 'application/json',
75
83
  },
84
+ method: 'POST',
76
85
  body: JSON.stringify({
77
86
  projects: [{ slug: project, system: includeSystem, excludeTables }],
78
87
  }),
79
88
  })
80
- }
81
-
82
-
83
- private executeRequest = async ({ url, token, headers, body }: {
84
- url: string
85
- token: string
86
- headers: Record<string, string>
87
- body: any
88
- }) => {
89
- return await new Promise<http.IncomingMessage>((resolve, reject) => {
90
- const req = (url.startsWith('https://') ? https : http).request(url, {
91
- method: 'POST',
92
- headers: {
93
- Authorization: `Bearer ${token}`,
94
- ...headers,
95
- },
96
- }, async res => {
97
- if (res.statusCode !== 200) {
98
- const responseBody = (await readStream(res)).toString()
99
- reject(new Error(`Invalid response: ${res.statusMessage}\n${responseBody}`))
100
- } else {
101
- resolve(res)
102
- }
103
- })
104
-
105
- if (body instanceof Stream) {
106
- body.pipe(req)
107
- } else {
108
- req.write(body)
109
- req.end()
110
- }
111
- })
89
+ if (!response.ok) {
90
+ const responseBody = await response.text()
91
+ throw new Error(`Invalid response: ${response.statusText}\n${responseBody}`)
92
+ }
93
+ return response
112
94
  }
113
95
  }
@@ -6,4 +6,3 @@ export const printProgressLine = (message: string) => {
6
6
  process.stdout.cursorTo(0)
7
7
  process.stdout.write(message)
8
8
  }
9
-
@@ -1,5 +1,5 @@
1
1
  import { Workspace } from './Workspace'
2
- import { join } from 'node:path'
2
+ import { join, resolve } from 'node:path'
3
3
  import { YamlHandler } from '../fs/YamlHandler'
4
4
 
5
5
  export interface LocalProjectConfig {
@@ -17,10 +17,10 @@ export class WorkspaceResolver {
17
17
 
18
18
  resolve = async (baseDir: string): Promise<Workspace> => {
19
19
  const config = await this.readConfig(baseDir)
20
- const apiDir = config.apiDir ?? join(baseDir, 'api')
21
- const migrationsDir = config.migrationsDir ?? join(apiDir, 'migrations')
22
- const adminDir = config.adminDir === false ? undefined : (config.adminDir ?? join(baseDir, 'admin'))
23
- const adminDistDir = adminDir === undefined ? undefined : (config.adminDistDir ?? join(adminDir, 'dist'))
20
+ const apiDir = config.apiDir ? resolve(baseDir, config.apiDir) : join(baseDir, 'api')
21
+ const migrationsDir = config.migrationsDir ? resolve(baseDir, config.migrationsDir) : join(apiDir, 'migrations')
22
+ const adminDir = config.adminDir === false ? undefined : (config.adminDir ? resolve(baseDir, config.adminDir) : join(baseDir, 'admin'))
23
+ const adminDistDir = adminDir === undefined ? undefined : (config.adminDistDir ? resolve(baseDir, config.adminDistDir) : join(adminDir, 'dist'))
24
24
 
25
25
  return {
26
26
  baseDir,
package/src/run.ts CHANGED
@@ -5,10 +5,8 @@ import { createContainer } from './dic'
5
5
  import { readCliEnv } from './lib/env'
6
6
  import { WorkspaceResolver } from './lib/workspace/WorkspaceResolver'
7
7
  import { YamlHandler } from './lib/fs/YamlHandler'
8
- import { FileSystem } from './lib/fs/FileSystem';
9
-
10
- (async () => {
11
- // eslint-disable-next-line @typescript-eslint/no-var-requires
8
+ import { FileSystem } from './lib/fs/FileSystem'
9
+ ;(async () => {
12
10
  const version = require(join(packageRoot, 'package.json')).version
13
11
  const nodeVersion = process.version.match(/^v?(\d+)\..+$/)
14
12
  if (nodeVersion && Number(nodeVersion[1]) < 18) {
@@ -25,7 +23,6 @@ import { FileSystem } from './lib/fs/FileSystem';
25
23
  runtime: process.title === 'bun' ? 'bun' : 'node',
26
24
  })
27
25
 
28
-
29
26
  await dic.application.run(process.argv.slice(2))
30
27
  })().catch(e => {
31
28
  console.log(e)