@contember/cli 2.0.0-alpha.32 → 2.0.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 (246) hide show
  1. package/contember-docker.sh +0 -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/deploy/DeployCommand.cjs.map +1 -1
  5. package/dist/development/src/commands/deploy/DeployCommand.js.map +1 -1
  6. package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
  7. package/dist/development/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
  8. package/dist/development/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -1
  9. package/dist/development/src/commands/migrations/MigrationBlankCommand.js.map +1 -1
  10. package/dist/development/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
  11. package/dist/development/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
  12. package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
  13. package/dist/development/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
  14. package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
  15. package/dist/development/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
  16. package/dist/development/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
  17. package/dist/development/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
  18. package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
  19. package/dist/development/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
  20. package/dist/development/src/commands/misc/VersionCommand.cjs.map +1 -1
  21. package/dist/development/src/commands/misc/VersionCommand.js.map +1 -1
  22. package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
  23. package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
  24. package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
  25. package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
  26. package/dist/development/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
  27. package/dist/development/src/commands/project/ProjectValidateCommand.js.map +1 -1
  28. package/dist/development/src/commands/transfer/ExportCommand.cjs.map +1 -1
  29. package/dist/development/src/commands/transfer/ExportCommand.js.map +1 -1
  30. package/dist/development/src/commands/transfer/ImportCommand.cjs.map +1 -1
  31. package/dist/development/src/commands/transfer/ImportCommand.js.map +1 -1
  32. package/dist/development/src/commands/transfer/TransferCommand.cjs.map +1 -1
  33. package/dist/development/src/commands/transfer/TransferCommand.js.map +1 -1
  34. package/dist/development/src/commands/transfer/utils.cjs.map +1 -1
  35. package/dist/development/src/commands/transfer/utils.js.map +1 -1
  36. package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
  37. package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
  38. package/dist/development/src/consts.cjs +1 -1
  39. package/dist/development/src/consts.cjs.map +1 -1
  40. package/dist/development/src/dic.cjs.map +1 -1
  41. package/dist/development/src/dic.js.map +1 -1
  42. package/dist/development/src/lib/SystemClientProvider.cjs.map +1 -1
  43. package/dist/development/src/lib/SystemClientProvider.js.map +1 -1
  44. package/dist/development/src/lib/TenantClientProvider.cjs.map +1 -1
  45. package/dist/development/src/lib/TenantClientProvider.js.map +1 -1
  46. package/dist/development/src/lib/VersionChecker.cjs.map +1 -1
  47. package/dist/development/src/lib/VersionChecker.js.map +1 -1
  48. package/dist/development/src/lib/admin/AdminClient.cjs.map +1 -1
  49. package/dist/development/src/lib/admin/AdminClient.js.map +1 -1
  50. package/dist/development/src/lib/admin/AdminDeployer.cjs.map +1 -1
  51. package/dist/development/src/lib/admin/AdminDeployer.js.map +1 -1
  52. package/dist/development/src/lib/dsn.cjs.map +1 -1
  53. package/dist/development/src/lib/dsn.js.map +1 -1
  54. package/dist/development/src/lib/env.cjs.map +1 -1
  55. package/dist/development/src/lib/env.js.map +1 -1
  56. package/dist/development/src/lib/fs/DockerComposeManager.cjs.map +1 -1
  57. package/dist/development/src/lib/fs/DockerComposeManager.js.map +1 -1
  58. package/dist/development/src/lib/fs/FileSystem.cjs.map +1 -1
  59. package/dist/development/src/lib/fs/FileSystem.js.map +1 -1
  60. package/dist/development/src/lib/fs/YamlHandler.cjs.map +1 -1
  61. package/dist/development/src/lib/fs/YamlHandler.js.map +1 -1
  62. package/dist/development/src/lib/js/EsBuildBuilder.cjs +24 -19
  63. package/dist/development/src/lib/js/EsBuildBuilder.cjs.map +1 -1
  64. package/dist/development/src/lib/js/EsBuildBuilder.js +1 -1
  65. package/dist/development/src/lib/js/EsBuildBuilder.js.map +1 -1
  66. package/dist/development/src/lib/js/EvalExecutor.cjs.map +1 -1
  67. package/dist/development/src/lib/js/EvalExecutor.js.map +1 -1
  68. package/dist/development/src/lib/js/JsCodeRunner.cjs.map +1 -1
  69. package/dist/development/src/lib/js/JsCodeRunner.js.map +1 -1
  70. package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
  71. package/dist/development/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
  72. package/dist/development/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
  73. package/dist/development/src/lib/migrations/MigrationPrinter.js.map +1 -1
  74. package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
  75. package/dist/development/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
  76. package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
  77. package/dist/development/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
  78. package/dist/development/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
  79. package/dist/development/src/lib/migrations/MigrationsValidator.js.map +1 -1
  80. package/dist/development/src/lib/migrations/migrations.cjs.map +1 -1
  81. package/dist/development/src/lib/migrations/migrations.js.map +1 -1
  82. package/dist/development/src/lib/project/RemoteProject.cjs.map +1 -1
  83. package/dist/development/src/lib/project/RemoteProject.js.map +1 -1
  84. package/dist/development/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
  85. package/dist/development/src/lib/project/RemoteProjectProvider.js.map +1 -1
  86. package/dist/development/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
  87. package/dist/development/src/lib/project/RemoteProjectResolver.js.map +1 -1
  88. package/dist/development/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
  89. package/dist/development/src/lib/project/docs/components/EntityInfo.js.map +1 -1
  90. package/dist/development/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
  91. package/dist/development/src/lib/project/docs/components/FieldLink.js.map +1 -1
  92. package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
  93. package/dist/development/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
  94. package/dist/development/src/lib/project/docs/components/FieldType.cjs.map +1 -1
  95. package/dist/development/src/lib/project/docs/components/FieldType.js.map +1 -1
  96. package/dist/development/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
  97. package/dist/development/src/lib/project/docs/components/OnDelete.js.map +1 -1
  98. package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
  99. package/dist/development/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
  100. package/dist/development/src/lib/project/docs/components/SinglePermission.cjs.map +1 -1
  101. package/dist/development/src/lib/project/docs/components/SinglePermission.js.map +1 -1
  102. package/dist/development/src/lib/project/docs/projectDescribe.cjs.map +1 -1
  103. package/dist/development/src/lib/schema/SchemaLoader.cjs.map +1 -1
  104. package/dist/development/src/lib/schema/SchemaLoader.js.map +1 -1
  105. package/dist/development/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
  106. package/dist/development/src/lib/schema/SchemaValidationPrinter.cjs.map +1 -1
  107. package/dist/development/src/lib/schema/SchemaValidationPrinter.js.map +1 -1
  108. package/dist/development/src/lib/schema/collectReferences.cjs.map +1 -1
  109. package/dist/development/src/lib/schema/collectReferences.js.map +1 -1
  110. package/dist/development/src/lib/stream.cjs.map +1 -1
  111. package/dist/development/src/lib/stream.js.map +1 -1
  112. package/dist/development/src/lib/tenant/TenantClient.cjs.map +1 -1
  113. package/dist/development/src/lib/tenant/TenantClient.js.map +1 -1
  114. package/dist/development/src/lib/transfer/DataTransferClient.cjs.map +1 -1
  115. package/dist/development/src/lib/transfer/DataTransferClient.js.map +1 -1
  116. package/dist/development/src/lib/transfer/stdio.cjs.map +1 -1
  117. package/dist/development/src/lib/transfer/stdio.js.map +1 -1
  118. package/dist/development/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
  119. package/dist/development/src/lib/workspace/WorkspaceResolver.js.map +1 -1
  120. package/dist/production/run.cjs.map +1 -1
  121. package/dist/production/run.js.map +1 -1
  122. package/dist/production/src/commands/deploy/DeployCommand.cjs.map +1 -1
  123. package/dist/production/src/commands/deploy/DeployCommand.js.map +1 -1
  124. package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
  125. package/dist/production/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
  126. package/dist/production/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -1
  127. package/dist/production/src/commands/migrations/MigrationBlankCommand.js.map +1 -1
  128. package/dist/production/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
  129. package/dist/production/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
  130. package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
  131. package/dist/production/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
  132. package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
  133. package/dist/production/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
  134. package/dist/production/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
  135. package/dist/production/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
  136. package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
  137. package/dist/production/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
  138. package/dist/production/src/commands/misc/VersionCommand.cjs.map +1 -1
  139. package/dist/production/src/commands/misc/VersionCommand.js.map +1 -1
  140. package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
  141. package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
  142. package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
  143. package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
  144. package/dist/production/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
  145. package/dist/production/src/commands/project/ProjectValidateCommand.js.map +1 -1
  146. package/dist/production/src/commands/transfer/ExportCommand.cjs.map +1 -1
  147. package/dist/production/src/commands/transfer/ExportCommand.js.map +1 -1
  148. package/dist/production/src/commands/transfer/ImportCommand.cjs.map +1 -1
  149. package/dist/production/src/commands/transfer/ImportCommand.js.map +1 -1
  150. package/dist/production/src/commands/transfer/TransferCommand.cjs.map +1 -1
  151. package/dist/production/src/commands/transfer/TransferCommand.js.map +1 -1
  152. package/dist/production/src/commands/transfer/utils.cjs.map +1 -1
  153. package/dist/production/src/commands/transfer/utils.js.map +1 -1
  154. package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
  155. package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
  156. package/dist/production/src/consts.cjs +1 -1
  157. package/dist/production/src/consts.cjs.map +1 -1
  158. package/dist/production/src/dic.cjs.map +1 -1
  159. package/dist/production/src/dic.js.map +1 -1
  160. package/dist/production/src/lib/SystemClientProvider.cjs.map +1 -1
  161. package/dist/production/src/lib/SystemClientProvider.js.map +1 -1
  162. package/dist/production/src/lib/TenantClientProvider.cjs.map +1 -1
  163. package/dist/production/src/lib/TenantClientProvider.js.map +1 -1
  164. package/dist/production/src/lib/VersionChecker.cjs.map +1 -1
  165. package/dist/production/src/lib/VersionChecker.js.map +1 -1
  166. package/dist/production/src/lib/admin/AdminClient.cjs.map +1 -1
  167. package/dist/production/src/lib/admin/AdminClient.js.map +1 -1
  168. package/dist/production/src/lib/admin/AdminDeployer.cjs.map +1 -1
  169. package/dist/production/src/lib/admin/AdminDeployer.js.map +1 -1
  170. package/dist/production/src/lib/dsn.cjs.map +1 -1
  171. package/dist/production/src/lib/dsn.js.map +1 -1
  172. package/dist/production/src/lib/env.cjs.map +1 -1
  173. package/dist/production/src/lib/env.js.map +1 -1
  174. package/dist/production/src/lib/fs/DockerComposeManager.cjs.map +1 -1
  175. package/dist/production/src/lib/fs/DockerComposeManager.js.map +1 -1
  176. package/dist/production/src/lib/fs/FileSystem.cjs.map +1 -1
  177. package/dist/production/src/lib/fs/FileSystem.js.map +1 -1
  178. package/dist/production/src/lib/fs/YamlHandler.cjs.map +1 -1
  179. package/dist/production/src/lib/fs/YamlHandler.js.map +1 -1
  180. package/dist/production/src/lib/js/EsBuildBuilder.cjs +24 -19
  181. package/dist/production/src/lib/js/EsBuildBuilder.cjs.map +1 -1
  182. package/dist/production/src/lib/js/EsBuildBuilder.js +1 -1
  183. package/dist/production/src/lib/js/EsBuildBuilder.js.map +1 -1
  184. package/dist/production/src/lib/js/EvalExecutor.cjs.map +1 -1
  185. package/dist/production/src/lib/js/EvalExecutor.js.map +1 -1
  186. package/dist/production/src/lib/js/JsCodeRunner.cjs.map +1 -1
  187. package/dist/production/src/lib/js/JsCodeRunner.js.map +1 -1
  188. package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
  189. package/dist/production/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
  190. package/dist/production/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
  191. package/dist/production/src/lib/migrations/MigrationPrinter.js.map +1 -1
  192. package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
  193. package/dist/production/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
  194. package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
  195. package/dist/production/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
  196. package/dist/production/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
  197. package/dist/production/src/lib/migrations/MigrationsValidator.js.map +1 -1
  198. package/dist/production/src/lib/migrations/migrations.cjs.map +1 -1
  199. package/dist/production/src/lib/migrations/migrations.js.map +1 -1
  200. package/dist/production/src/lib/project/RemoteProject.cjs.map +1 -1
  201. package/dist/production/src/lib/project/RemoteProject.js.map +1 -1
  202. package/dist/production/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
  203. package/dist/production/src/lib/project/RemoteProjectProvider.js.map +1 -1
  204. package/dist/production/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
  205. package/dist/production/src/lib/project/RemoteProjectResolver.js.map +1 -1
  206. package/dist/production/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
  207. package/dist/production/src/lib/project/docs/components/EntityInfo.js.map +1 -1
  208. package/dist/production/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
  209. package/dist/production/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
  210. package/dist/production/src/lib/project/docs/components/FieldType.cjs.map +1 -1
  211. package/dist/production/src/lib/project/docs/components/FieldType.js.map +1 -1
  212. package/dist/production/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
  213. package/dist/production/src/lib/project/docs/components/OnDelete.js.map +1 -1
  214. package/dist/production/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
  215. package/dist/production/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
  216. package/dist/production/src/lib/project/docs/components/SinglePermission.cjs.map +1 -1
  217. package/dist/production/src/lib/project/docs/components/SinglePermission.js.map +1 -1
  218. package/dist/production/src/lib/project/docs/projectDescribe.cjs.map +1 -1
  219. package/dist/production/src/lib/project/docs/projectDescribe.js.map +1 -1
  220. package/dist/production/src/lib/schema/SchemaLoader.cjs.map +1 -1
  221. package/dist/production/src/lib/schema/SchemaLoader.js.map +1 -1
  222. package/dist/production/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
  223. package/dist/production/src/lib/schema/SchemaValidationPrinter.cjs.map +1 -1
  224. package/dist/production/src/lib/schema/SchemaValidationPrinter.js.map +1 -1
  225. package/dist/production/src/lib/schema/collectReferences.cjs.map +1 -1
  226. package/dist/production/src/lib/schema/collectReferences.js.map +1 -1
  227. package/dist/production/src/lib/stream.cjs.map +1 -1
  228. package/dist/production/src/lib/stream.js.map +1 -1
  229. package/dist/production/src/lib/tenant/TenantClient.cjs.map +1 -1
  230. package/dist/production/src/lib/tenant/TenantClient.js.map +1 -1
  231. package/dist/production/src/lib/transfer/DataTransferClient.cjs.map +1 -1
  232. package/dist/production/src/lib/transfer/DataTransferClient.js.map +1 -1
  233. package/dist/production/src/lib/transfer/stdio.cjs.map +1 -1
  234. package/dist/production/src/lib/transfer/stdio.js.map +1 -1
  235. package/dist/production/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
  236. package/dist/production/src/lib/workspace/WorkspaceResolver.js.map +1 -1
  237. package/dist/types/lib/js/EsBuildBuilder.d.ts.map +1 -1
  238. package/dist/types/lib/migrations/MigrationPrinter.d.ts.map +1 -1
  239. package/dist/types/tsconfig.tsbuildinfo +1 -1
  240. package/package.json +18 -15
  241. package/src/lib/js/EsBuildBuilder.ts +1 -1
  242. package/src/lib/migrations/MigrationPrinter.ts +3 -0
  243. package/tsconfig.settings.json +0 -1
  244. package/Dockerfile +0 -20
  245. package/build.sh +0 -11
  246. package/esbuild.cjs +0 -27
@@ -1 +1 @@
1
- {"version":3,"file":"MigrationPrinter.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationPrinter.ts"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport chalk from 'chalk'\nimport { AnyMigrationStatus, Migration, MigrationDescriber, MigrationState } from '@contember/migrations-client'\nimport { emptyDatabaseMetadata } from '@contember/database'\nimport chalkTable from 'chalk-table'\nimport { assertNever } from '../assertNever'\n\nexport class MigrationPrinter {\n\tconstructor(\n\t\tprivate readonly migrationsDescriber: MigrationDescriber,\n\t) {\n\t}\n\n\tprintMigrationDescription = (\n\t\tschema: Schema,\n\t\tmigration: Migration,\n\t\toptions: { sqlOnly?: boolean; noSql?: boolean },\n\t) => {\n\t\tconst description = this.migrationsDescriber.describeModifications(schema, migration)\n\t\tdescription.forEach(({ modification, getSql, description }) => {\n\t\t\tconst sql = getSql({\n\t\t\t\tsystemSchema: 'system',\n\t\t\t\tdatabaseMetadata: emptyDatabaseMetadata,\n\t\t\t\tinvalidateDatabaseMetadata: () => null,\n\t\t\t})\n\t\t\tif (options.sqlOnly) {\n\t\t\t\tif (sql.trim()) {\n\t\t\t\t\tconsole.log(sql)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst color = description.isDestructive ? chalk.red : chalk.blue\n\t\t\t\tconsole.group(color(`${description.message} [${modification.modification}]`))\n\t\t\t\tif (description.failureWarning) {\n\t\t\t\t\tconsole.log(chalk.bgWhite(chalk.redBright(description.failureWarning)))\n\t\t\t\t}\n\n\t\t\t\tif (!options.noSql) {\n\t\t\t\t\tif (sql.trim()) {\n\t\t\t\t\t\tconsole.log(sql)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log('No sql to execute')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconsole.groupEnd()\n\t\t\t}\n\t\t})\n\t}\n\n\tprintStatusTable = (migrations: AnyMigrationStatus[]) => {\n\t\tconst table = chalkTable(\n\t\t\t{\n\t\t\t\tcolumns: ['status', 'migration', 'info'],\n\t\t\t},\n\t\t\tmigrations.map(it => {\n\t\t\t\tswitch (it.state) {\n\t\t\t\t\tcase MigrationState.EXECUTED_ERROR:\n\t\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\t\tcase MigrationState.EXECUTED_OK:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: chalk.bgGreen.blackBright('Executed'),\n\t\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\t\tinfo: `Executed at ${it.executedMigration.executedAt.toISOString()}`,\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MigrationState.EXECUTED_MISSING:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: chalk.bgRedBright.white('ERROR'),\n\t\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\t\tinfo: it.errorMessage,\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MigrationState.TO_EXECUTE_OK:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: chalk.bgBlueBright.white('Not executed'),\n\t\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\t\tinfo: 'Will be executed during next deploy',\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MigrationState.TO_EXECUTE_ERROR:\n\t\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tassertNever(it)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\t\tconsole.log(table)\n\t}\n\n}\n"],"names":["description","emptyDatabaseMetadata","MigrationState","assertNever"],"mappings":";;;;;;;;;;AAOO,MAAM,iBAAiB;AAAA,EAC7B,YACkB,qBAChB;AADgB,SAAA,sBAAA;AAIU,kBAAA,MAAA,6BAAA,CAC3B,QACA,WACA,YACI;AACJ,YAAM,cAAc,KAAK,oBAAoB,sBAAsB,QAAQ,SAAS;AACpF,kBAAY,QAAQ,CAAC,EAAE,cAAc,QAAQ,aAAAA,mBAAkB;AAC9D,cAAM,MAAM,OAAO;AAAA,UAClB,cAAc;AAAA,UACd,kBAAkBC,SAAA;AAAA,UAClB,4BAA4B,MAAM;AAAA,QAAA,CAClC;AACD,YAAI,QAAQ,SAAS;AAChB,cAAA,IAAI,QAAQ;AACf,oBAAQ,IAAI,GAAG;AAAA,UAChB;AAAA,QAAA,OACM;AACN,gBAAM,QAAQD,aAAY,gBAAgB,MAAM,MAAM,MAAM;AACpD,kBAAA,MAAM,MAAM,GAAGA,aAAY,OAAO,KAAK,a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AG,MAAM,MAAM,GAAG,aAAa;AAAA,YAC9F;AACCC,0BAAAA,YAAc;AAAA,UAChB;AAAA,QAAA,CACA;AAAA,MAAA;AAEF,cAAQ,IAAI,KAAK;AAAA,IAAA,CAClB;AAAA,EAxEA;AA0ED;;"}
1
+ {"version":3,"file":"MigrationPrinter.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationPrinter.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// <reference path=\"../../../types/chalk-table/index.d.ts\" />\n\nimport { Schema } from '@contember/schema'\nimport chalk from 'chalk'\nimport { AnyMigrationStatus, Migration, MigrationDescriber, MigrationState } from '@contember/migrations-client'\nimport { emptyDatabaseMetadata } from '@contember/database'\nimport chalkTable from 'chalk-table'\nimport { assertNever } from '../assertNever'\n\nexport class MigrationPrinter {\n\tconstructor(\n\t\tprivate readonly migrationsDescriber: MigrationDescriber,\n\t) {\n\t}\n\n\tprintMigrationDescription = (\n\t\tschema: Schema,\n\t\tmigration: Migration,\n\t\toptions: { sqlOnly?: boolean; noSql?: boolean },\n\t) => {\n\t\tconst description = this.migrationsDescriber.describeModifications(schema, migration)\n\t\tdescription.forEach(({ modification, getSql, description }) => {\n\t\t\tconst sql = getSql({\n\t\t\t\tsystemSchema: 'system',\n\t\t\t\tdatabaseMetadata: emptyDatabaseMetadata,\n\t\t\t\tinvalidateDatabaseMetadata: () => null,\n\t\t\t})\n\t\t\tif (options.sqlOnly) {\n\t\t\t\tif (sql.trim()) {\n\t\t\t\t\tconsole.log(sql)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst color = description.isDestructive ? chalk.red : chalk.blue\n\t\t\t\tconsole.group(color(`${description.message} [${modification.modification}]`))\n\t\t\t\tif (description.failureWarning) {\n\t\t\t\t\tconsole.log(chalk.bgWhite(chalk.redBright(description.failureWarning)))\n\t\t\t\t}\n\n\t\t\t\tif (!options.noSql) {\n\t\t\t\t\tif (sql.trim()) {\n\t\t\t\t\t\tconsole.log(sql)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log('No sql to execute')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconsole.groupEnd()\n\t\t\t}\n\t\t})\n\t}\n\n\tprintStatusTable = (migrations: AnyMigrationStatus[]) => {\n\t\tconst table = chalkTable(\n\t\t\t{\n\t\t\t\tcolumns: ['status', 'migration', 'info'],\n\t\t\t},\n\t\t\tmigrations.map(it => {\n\t\t\t\tswitch (it.state) {\n\t\t\t\t\tcase MigrationState.EXECUTED_ERROR:\n\t\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\t\tcase MigrationState.EXECUTED_OK:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: chalk.bgGreen.blackBright('Executed'),\n\t\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\t\tinfo: `Executed at ${it.executedMigration.executedAt.toISOString()}`,\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MigrationState.EXECUTED_MISSING:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: chalk.bgRedBright.white('ERROR'),\n\t\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\t\tinfo: it.errorMessage,\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MigrationState.TO_EXECUTE_OK:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: chalk.bgBlueBright.white('Not executed'),\n\t\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\t\tinfo: 'Will be executed during next deploy',\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MigrationState.TO_EXECUTE_ERROR:\n\t\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tassertNever(it)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\t\tconsole.log(table)\n\t}\n\n}\n"],"names":["description","emptyDataba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,MAAM,GAAG,aAAa;AAAA,YAC9F,KAAKA,iBAAe,eAAA;AACZ,qBAAA;AAAA,gBACN,QAAQ,MAAM,QAAQ,YAAY,UAAU;AAAA,gBAC5C,WAAW,GAAG;AAAA,gBACd,MAAM,eAAe,GAAG,kBAAkB,WAAW,aAAa;AAAA,cACnE;AAAA,YACD,KAAKA,iBAAe,eAAA;AACZ,qBAAA;AAAA,gBACN,QAAQ,MAAM,YAAY,MAAM,OAAO;AAAA,gBACvC,WAAW,GAAG;AAAA,gBACd,MAAM,GAAG;AAAA,cACV;AAAA,YACD,KAAKA,iBAAe,eAAA;AACZ,qBAAA;AAAA,gBACN,QAAQ,MAAM,aAAa,MAAM,cAAc;AAAA,gBAC/C,WAAW,GAAG;AAAA,gBACd,MAAM;AAAA,cACP;AAAA,YACD,KAAKA,iBAAe,eAAA;AACnB,qBAAO,EAAE,QAAQ,MAAM,YAAY,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,MAAM,GAAG,aAAa;AAAA,YAC9F;AACCC,0BAAAA,YAAc;AAAA,UAAA;AAAA,QAEhB,CAAA;AAAA,MACF;AACA,cAAQ,IAAI,KAAK;AAAA,IAAA,CAClB;AAAA,EAAA;AAED;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MigrationPrinter.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationPrinter.ts"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport chalk from 'chalk'\nimport { AnyMigrationStatus, Migration, MigrationDescriber, MigrationState } from '@contember/migrations-client'\nimport { emptyDatabaseMetadata } from '@contember/database'\nimport chalkTable from 'chalk-table'\nimport { assertNever } from '../assertNever'\n\nexport class MigrationPrinter {\n\tconstructor(\n\t\tprivate readonly migrationsDescriber: MigrationDescriber,\n\t) {\n\t}\n\n\tprintMigrationDescription = (\n\t\tschema: Schema,\n\t\tmigration: Migration,\n\t\toptions: { sqlOnly?: boolean; noSql?: boolean },\n\t) => {\n\t\tconst description = this.migrationsDescriber.describeModifications(schema, migration)\n\t\tdescription.forEach(({ modification, getSql, description }) => {\n\t\t\tconst sql = getSql({\n\t\t\t\tsystemSchema: 'system',\n\t\t\t\tdatabaseMetadata: emptyDatabaseMetadata,\n\t\t\t\tinvalidateDatabaseMetadata: () => null,\n\t\t\t})\n\t\t\tif (options.sqlOnly) {\n\t\t\t\tif (sql.trim()) {\n\t\t\t\t\tconsole.log(sql)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst color = description.isDestructive ? chalk.red : chalk.blue\n\t\t\t\tconsole.group(color(`${description.message} [${modification.modification}]`))\n\t\t\t\tif (description.failureWarning) {\n\t\t\t\t\tconsole.log(chalk.bgWhite(chalk.redBright(description.failureWarning)))\n\t\t\t\t}\n\n\t\t\t\tif (!options.noSql) {\n\t\t\t\t\tif (sql.trim()) {\n\t\t\t\t\t\tconsole.log(sql)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log('No sql to execute')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconsole.groupEnd()\n\t\t\t}\n\t\t})\n\t}\n\n\tprintStatusTable = (migrations: AnyMigrationStatus[]) => {\n\t\tconst table = chalkTable(\n\t\t\t{\n\t\t\t\tcolumns: ['status', 'migration', 'info'],\n\t\t\t},\n\t\t\tmigrations.map(it => {\n\t\t\t\tswitch (it.state) {\n\t\t\t\t\tcase MigrationState.EXECUTED_ERROR:\n\t\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\t\tcase MigrationState.EXECUTED_OK:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: chalk.bgGreen.blackBright('Executed'),\n\t\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\t\tinfo: `Executed at ${it.executedMigration.executedAt.toISOString()}`,\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MigrationState.EXECUTED_MISSING:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: chalk.bgRedBright.white('ERROR'),\n\t\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\t\tinfo: it.errorMessage,\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MigrationState.TO_EXECUTE_OK:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: chalk.bgBlueBright.white('Not executed'),\n\t\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\t\tinfo: 'Will be executed during next deploy',\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MigrationState.TO_EXECUTE_ERROR:\n\t\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tassertNever(it)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\t\tconsole.log(table)\n\t}\n\n}\n"],"names":["description"],"mappings":";;;;;;;;AAOO,MAAM,iBAAiB;AAAA,EAC7B,YACkB,qBAChB;AADgB,SAAA,sBAAA;AAIU,kBAAA,MAAA,6BAAA,CAC3B,QACA,WACA,YACI;AACJ,YAAM,cAAc,KAAK,oBAAoB,sBAAsB,QAAQ,SAAS;AACpF,kBAAY,QAAQ,CAAC,EAAE,cAAc,QAAQ,aAAAA,mBAAkB;AAC9D,cAAM,MAAM,OAAO;AAAA,UAClB,cAAc;AAAA,UACd,kBAAkB;AAAA,UAClB,4BAA4B,MAAM;AAAA,QAAA,CAClC;AACD,YAAI,QAAQ,SAAS;AAChB,cAAA,IAAI,QAAQ;AACf,oBAAQ,IAAI,GAAG;AAAA,UAChB;AAAA,QAAA,OACM;AACN,gBAAM,QAAQA,aAAY,gBAAgB,MAAM,MAAM,MAAM;AACpD,kBAAA,MAAM,MAAM,GAAGA,aAAY,OAAO,KAAK,aAAa,YAAY,GAAG,CAAC;AAC5E,cAAIA,aAAY,gBAAgB;AACvB,oBAAA,IAAI,MAAM,QAAQ,MAAM,UAAUA,aAAY,cAAc,CAAC,CAAC;AAAA,UACvE;AAEI,cAAA,CAAC,QAAQ,OAA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ages/cli/src/lib/migrations/MigrationPrinter.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// <reference path=\"../../../types/chalk-table/index.d.ts\" />\n\nimport { Schema } from '@contember/schema'\nimport chalk from 'chalk'\nimport { AnyMigrationStatus, Migration, MigrationDescriber, MigrationState } from '@contember/migrations-client'\nimport { emptyDatabaseMetadata } from '@contember/database'\nimport chalkTable from 'chalk-table'\nimport { assertNever } from '../assertNever'\n\nexport class MigrationPrinter {\n\tconstructor(\n\t\tprivate readonly migrationsDescriber: MigrationDescriber,\n\t) {\n\t}\n\n\tprintMigrationDescription = (\n\t\tschema: Schema,\n\t\tmigration: Migration,\n\t\toptions: { sqlOnly?: boolean; noSql?: boolean },\n\t) => {\n\t\tconst description = this.migrationsDescriber.describeModifications(schema, migration)\n\t\tdescription.forEach(({ modification, getSql, description }) => {\n\t\t\tconst sql = getSql({\n\t\t\t\tsystemSchema: 'system',\n\t\t\t\tdatabaseMetadata: emptyDatabaseMetadata,\n\t\t\t\tinvalidateDatabaseMetadata: () => null,\n\t\t\t})\n\t\t\tif (options.sqlOnly) {\n\t\t\t\tif (sql.trim()) {\n\t\t\t\t\tconsole.log(sql)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst color = description.isDestructive ? chalk.red : chalk.blue\n\t\t\t\tconsole.group(color(`${description.message} [${modification.modification}]`))\n\t\t\t\tif (description.failureWarning) {\n\t\t\t\t\tconsole.log(chalk.bgWhite(chalk.redBright(description.failureWarning)))\n\t\t\t\t}\n\n\t\t\t\tif (!options.noSql) {\n\t\t\t\t\tif (sql.trim()) {\n\t\t\t\t\t\tconsole.log(sql)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log('No sql to execute')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconsole.groupEnd()\n\t\t\t}\n\t\t})\n\t}\n\n\tprintStatusTable = (migrations: AnyMigrationStatus[]) => {\n\t\tconst table = chalkTable(\n\t\t\t{\n\t\t\t\tcolumns: ['status', 'migration', 'info'],\n\t\t\t},\n\t\t\tmigrations.map(it => {\n\t\t\t\tswitch (it.state) {\n\t\t\t\t\tcase MigrationState.EXECUTED_ERROR:\n\t\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\t\tcase MigrationState.EXECUTED_OK:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: chalk.bgGreen.blackBright('Executed'),\n\t\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\t\tinfo: `Executed at ${it.executedMigration.executedAt.toISOString()}`,\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MigrationState.EXECUTED_MISSING:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: chalk.bgRedBright.white('ERROR'),\n\t\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\t\tinfo: it.errorMessage,\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MigrationState.TO_EXECUTE_OK:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstatus: chalk.bgBlueBright.white('Not executed'),\n\t\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\t\tinfo: 'Will be executed during next deploy',\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MigrationState.TO_EXECUTE_ERROR:\n\t\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tassertNever(it)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\t\tconsole.log(table)\n\t}\n\n}\n"],"names":["description"],"mappings":";;;;;;;;AAUO,MAAM,iBAAiB;AAAA,EAC7B,YACkB,qBAChB;AADgB,SAAA,sBAAA;AAIU,kBAAA,MAAA,6BAAA,CAC3B,QACA,WACA,YACI;AACJ,YAAM,cAAc,KAAK,oBAAoB,sBAAsB,QAAQ,SAAS;AACpF,kBAAY,QAAQ,CAAC,EAAE,cAAc,Q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,OAAO;AAAA,gBACvC,WAAW,GAAG;AAAA,gBACd,MAAM,GAAG;AAAA,cACV;AAAA,YACD,KAAK,eAAe;AACZ,qBAAA;AAAA,gBACN,QAAQ,MAAM,aAAa,MAAM,cAAc;AAAA,gBAC/C,WAAW,GAAG;AAAA,gBACd,MAAM;AAAA,cACP;AAAA,YACD,KAAK,eAAe;AACnB,qBAAO,EAAE,QAAQ,MAAM,YAAY,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,MAAM,GAAG,aAAa;AAAA,YAC9F;AACC,0BAAc;AAAA,UAAA;AAAA,QAEhB,CAAA;AAAA,MACF;AACA,cAAQ,IAAI,KAAK;AAAA,IAAA,CAClB;AAAA,EAAA;AAED;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MigrationRebaseFacade.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationRebaseFacade.ts"],"sourcesContent":["import { Migration, MigrationFilesManager, SchemaVersionBuilder, SystemClient } from '@contember/migrations-client'\nimport { MigrationsValidator } from './MigrationsValidator'\nimport { emptySchema } from '@contember/schema-utils'\nimport { MigrationVersionHelper } from '@contember/engine-common'\nimport { SystemClientProvider } from '../SystemClientProvider'\n\nexport class MigrationRebaseFacade {\n\tconstructor(\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationsValidator: MigrationsValidator,\n\t\tprivate readonly systemClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationFilesManager: MigrationFilesManager,\n\t) {\n\t}\n\n\trebase = async (migrations: Migration[]) => {\n\t\tconst versions = migrations.map(it => it.version)\n\t\tconst schemaWithoutMigrations = await this.schemaVersionBuilder.buildSchemaAdvanced(\n\t\t\temptySchema,\n\t\t\tversion => !versions.includes(version),\n\t\t)\n\t\tconst valid = await this.migrationsValidator.validate(schemaWithoutMigrations, migrations)\n\t\tif (!valid) {\n\t\t\tthrow `Cannot rebase migrations`\n\t\t}\n\n\t\tlet i = 0\n\t\tfor (const migration of migrations) {\n\t\t\tconst name = migration.name.substring(MigrationVersionHelper.prefixLength + 1)\n\t\t\tconst [version, fullName] = MigrationVersionHelper.createVersion(name, i++)\n\t\t\tconst newMigration = {\n\t\t\t\tname: fullName,\n\t\t\t\tversion: version,\n\t\t\t\tformatVersion: migration.formatVersion,\n\t\t\t\tmodifications: migration.modifications,\n\t\t\t}\n\t\t\tawait this.systemClientProvider.get().migrationModify(migration.version, newMigration)\n\t\t\tawait this.migrationFilesManager.moveFile(migration.name, newMigration.name)\n\t\t}\n\t}\n}\n"],"names":["emptySchema","MigrationVersionHelper"],"mappings":";;;;;;;AAMO,MAAM,sBAAsB;AAAA,EAClC,YACkB,sBACA,qBACA,sBACA,uBAChB;AAJgB,SAAA,uBAAA;AACA,SAAA,sBAAA;AACA,SAAA,uBAAA;AACA,SAAA,wBAAA;AAIlB,kBAAA,MAAA,UAAS,OAAO,eAA4B;AAC3C,YAAM,WAAW,WAAW,IAAI,CAAA,OAAM,GAAG,OAAO;AAC1C,YAAA,0BAA0B,MAAM,KAAK,qBAAqB;AAAA,QAC/DA,YAAA;AAAA,QACA,CAAW,YAAA,CAAC,SAAS,SAAS,OAAO;AAAA,MAAA;AAEtC,YAAM,QAAQ,MAAM,KAAK,oBAAoB,SAAS,yBAAyB,UAAU;AACzF,UAAI,CAAC,OAAO;AACL,cAAA;AAAA,MACP;AAEA,UAAI,IAAI;AACR,iBAAW,aAAa,YAAY;AACnC,cAAM,OAAO,UAAU,KAAK,UAAUC,oCAAuB,eAAe,CAAC;AAC7E,cAAM,CAAC,SAAS,QAAQ,IAAIA,aAAAA,uBAAuB,cAAc,MAAM,GAAG;AAC1E,cAAM,eAAe;AAAA,UACpB,MAAM;AAAA,UACN;AAAA,UACA,eAAe,UAAU;AAAA,UACzB,eAAe,UAAU;AAAA,QAAA;AAE1B,cAAM,KAAK,qBAAqB,MAAM,gBAAgB,UAAU,SAAS,YAAY;AACrF,cAAM,KAAK,sBAAsB,SAAS,UAAU,MAAM,aAAa,IAAI;AAAA,MAC5E;AAAA,IAAA,CACD;AAAA,EA1BA;AA2BD;;"}
1
+ {"version":3,"file":"MigrationRebaseFacade.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationRebaseFacade.ts"],"sourcesContent":["import { Migration, MigrationFilesManager, SchemaVersionBuilder, SystemClient } from '@contember/migrations-client'\nimport { MigrationsValidator } from './MigrationsValidator'\nimport { emptySchema } from '@contember/schema-utils'\nimport { MigrationVersionHelper } from '@contember/engine-common'\nimport { SystemClientProvider } from '../SystemClientProvider'\n\nexport class MigrationRebaseFacade {\n\tconstructor(\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationsValidator: MigrationsValidator,\n\t\tprivate readonly systemClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationFilesManager: MigrationFilesManager,\n\t) {\n\t}\n\n\trebase = async (migrations: Migration[]) => {\n\t\tconst versions = migrations.map(it => it.version)\n\t\tconst schemaWithoutMigrations = await this.schemaVersionBuilder.buildSchemaAdvanced(\n\t\t\temptySchema,\n\t\t\tversion => !versions.includes(version),\n\t\t)\n\t\tconst valid = await this.migrationsValidator.validate(schemaWithoutMigrations, migrations)\n\t\tif (!valid) {\n\t\t\tthrow `Cannot rebase migrations`\n\t\t}\n\n\t\tlet i = 0\n\t\tfor (const migration of migrations) {\n\t\t\tconst name = migration.name.substring(MigrationVersionHelper.prefixLength + 1)\n\t\t\tconst [version, fullName] = MigrationVersionHelper.createVersion(name, i++)\n\t\t\tconst newMigration = {\n\t\t\t\tname: fullName,\n\t\t\t\tversion: version,\n\t\t\t\tformatVersion: migration.formatVersion,\n\t\t\t\tmodifications: migration.modifications,\n\t\t\t}\n\t\t\tawait this.systemClientProvider.get().migrationModify(migration.version, newMigration)\n\t\t\tawait this.migrationFilesManager.moveFile(migration.name, newMigration.name)\n\t\t}\n\t}\n}\n"],"names":["emptySchema","MigrationVersionHelper"],"mappings":";;;;;;;AAMO,MAAM,sBAAsB;AAAA,EAClC,YACkB,sBACA,qBACA,sBACA,uBAChB;AAJgB,SAAA,uBAAA;AACA,SAAA,sBAAA;AACA,SAAA,uBAAA;AACA,SAAA,wBAAA;AAIlB,kBAAA,MAAA,UAAS,OAAO,eAA4B;AAC3C,YAAM,WAAW,WAAW,IAAI,CAAA,OAAM,GAAG,OAAO;AAC1C,YAAA,0BAA0B,MAAM,KAAK,qBAAqB;AAAA,QAC/DA,YAAA;AAAA,QACA,CAAW,YAAA,CAAC,SAAS,SAAS,OAAO;AAAA,MACtC;AACA,YAAM,QAAQ,MAAM,KAAK,oBAAoB,SAAS,yBAAyB,UAAU;AACzF,UAAI,CAAC,OAAO;AACL,cAAA;AAAA,MAAA;AAGP,UAAI,IAAI;AACR,iBAAW,aAAa,YAAY;AACnC,cAAM,OAAO,UAAU,KAAK,UAAUC,aAAA,uBAAuB,eAAe,CAAC;AAC7E,cAAM,CAAC,SAAS,QAAQ,IAAIA,aAAuB,uBAAA,cAAc,MAAM,GAAG;AAC1E,cAAM,eAAe;AAAA,UACpB,MAAM;AAAA,UACN;AAAA,UACA,eAAe,UAAU;AAAA,UACzB,eAAe,UAAU;AAAA,QAC1B;AACA,cAAM,KAAK,qBAAqB,IAAA,EAAM,gBAAgB,UAAU,SAAS,YAAY;AACrF,cAAM,KAAK,sBAAsB,SAAS,UAAU,MAAM,aAAa,IAAI;AAAA,MAAA;AAAA,IAC5E,CACD;AAAA,EAAA;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MigrationRebaseFacade.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationRebaseFacade.ts"],"sourcesContent":["import { Migration, MigrationFilesManager, SchemaVersionBuilder, SystemClient } from '@contember/migrations-client'\nimport { MigrationsValidator } from './MigrationsValidator'\nimport { emptySchema } from '@contember/schema-utils'\nimport { MigrationVersionHelper } from '@contember/engine-common'\nimport { SystemClientProvider } from '../SystemClientProvider'\n\nexport class MigrationRebaseFacade {\n\tconstructor(\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationsValidator: MigrationsValidator,\n\t\tprivate readonly systemClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationFilesManager: MigrationFilesManager,\n\t) {\n\t}\n\n\trebase = async (migrations: Migration[]) => {\n\t\tconst versions = migrations.map(it => it.version)\n\t\tconst schemaWithoutMigrations = await this.schemaVersionBuilder.buildSchemaAdvanced(\n\t\t\temptySchema,\n\t\t\tversion => !versions.includes(version),\n\t\t)\n\t\tconst valid = await this.migrationsValidator.validate(schemaWithoutMigrations, migrations)\n\t\tif (!valid) {\n\t\t\tthrow `Cannot rebase migrations`\n\t\t}\n\n\t\tlet i = 0\n\t\tfor (const migration of migrations) {\n\t\t\tconst name = migration.name.substring(MigrationVersionHelper.prefixLength + 1)\n\t\t\tconst [version, fullName] = MigrationVersionHelper.createVersion(name, i++)\n\t\t\tconst newMigration = {\n\t\t\t\tname: fullName,\n\t\t\t\tversion: version,\n\t\t\t\tformatVersion: migration.formatVersion,\n\t\t\t\tmodifications: migration.modifications,\n\t\t\t}\n\t\t\tawait this.systemClientProvider.get().migrationModify(migration.version, newMigration)\n\t\t\tawait this.migrationFilesManager.moveFile(migration.name, newMigration.name)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,sBAAsB;AAAA,EAClC,YACkB,sBACA,qBACA,sBACA,uBAChB;AAJgB,SAAA,uBAAA;AACA,SAAA,sBAAA;AACA,SAAA,uBAAA;AACA,SAAA,wBAAA;AAIlB,kBAAA,MAAA,UAAS,OAAO,eAA4B;AAC3C,YAAM,WAAW,WAAW,IAAI,CAAA,OAAM,GAAG,OAAO;AAC1C,YAAA,0BAA0B,MAAM,KAAK,qBAAqB;AAAA,QAC/D;AAAA,QACA,CAAW,YAAA,CAAC,SAAS,SAAS,OAAO;AAAA,MAAA;AAEtC,YAAM,QAAQ,MAAM,KAAK,oBAAoB,SAAS,yBAAyB,UAAU;AACzF,UAAI,CAAC,OAAO;AACL,cAAA;AAAA,MACP;AAEA,UAAI,IAAI;AACR,iBAAW,aAAa,YAAY;AACnC,cAAM,OAAO,UAAU,KAAK,UAAU,uBAAuB,eAAe,CAAC;AAC7E,cAAM,CAAC,SAAS,QAAQ,IAAI,uBAAuB,cAAc,MAAM,GAAG;AAC1E,cAAM,eAAe;AAAA,UACpB,MAAM;AAAA,UACN;AAAA,UACA,eAAe,UAAU;AAAA,UACzB,eAAe,UAAU;AAAA,QAAA;AAE1B,cAAM,KAAK,qBAAqB,MAAM,gBAAgB,UAAU,SAAS,YAAY;AACrF,cAAM,KAAK,sBAAsB,SAAS,UAAU,MAAM,aAAa,IAAI;AAAA,MAC5E;AAAA,IAAA,CACD;AAAA,EA1BA;AA2BD;"}
1
+ {"version":3,"file":"MigrationRebaseFacade.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationRebaseFacade.ts"],"sourcesContent":["import { Migration, MigrationFilesManager, SchemaVersionBuilder, SystemClient } from '@contember/migrations-client'\nimport { MigrationsValidator } from './MigrationsValidator'\nimport { emptySchema } from '@contember/schema-utils'\nimport { MigrationVersionHelper } from '@contember/engine-common'\nimport { SystemClientProvider } from '../SystemClientProvider'\n\nexport class MigrationRebaseFacade {\n\tconstructor(\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationsValidator: MigrationsValidator,\n\t\tprivate readonly systemClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationFilesManager: MigrationFilesManager,\n\t) {\n\t}\n\n\trebase = async (migrations: Migration[]) => {\n\t\tconst versions = migrations.map(it => it.version)\n\t\tconst schemaWithoutMigrations = await this.schemaVersionBuilder.buildSchemaAdvanced(\n\t\t\temptySchema,\n\t\t\tversion => !versions.includes(version),\n\t\t)\n\t\tconst valid = await this.migrationsValidator.validate(schemaWithoutMigrations, migrations)\n\t\tif (!valid) {\n\t\t\tthrow `Cannot rebase migrations`\n\t\t}\n\n\t\tlet i = 0\n\t\tfor (const migration of migrations) {\n\t\t\tconst name = migration.name.substring(MigrationVersionHelper.prefixLength + 1)\n\t\t\tconst [version, fullName] = MigrationVersionHelper.createVersion(name, i++)\n\t\t\tconst newMigration = {\n\t\t\t\tname: fullName,\n\t\t\t\tversion: version,\n\t\t\t\tformatVersion: migration.formatVersion,\n\t\t\t\tmodifications: migration.modifications,\n\t\t\t}\n\t\t\tawait this.systemClientProvider.get().migrationModify(migration.version, newMigration)\n\t\t\tawait this.migrationFilesManager.moveFile(migration.name, newMigration.name)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,sBAAsB;AAAA,EAClC,YACkB,sBACA,qBACA,sBACA,uBAChB;AAJgB,SAAA,uBAAA;AACA,SAAA,sBAAA;AACA,SAAA,uBAAA;AACA,SAAA,wBAAA;AAIlB,kBAAA,MAAA,UAAS,OAAO,eAA4B;AAC3C,YAAM,WAAW,WAAW,IAAI,CAAA,OAAM,GAAG,OAAO;AAC1C,YAAA,0BAA0B,MAAM,KAAK,qBAAqB;AAAA,QAC/D;AAAA,QACA,CAAW,YAAA,CAAC,SAAS,SAAS,OAAO;AAAA,MACtC;AACA,YAAM,QAAQ,MAAM,KAAK,oBAAoB,SAAS,yBAAyB,UAAU;AACzF,UAAI,CAAC,OAAO;AACL,cAAA;AAAA,MAAA;AAGP,UAAI,IAAI;AACR,iBAAW,aAAa,YAAY;AACnC,cAAM,OAAO,UAAU,KAAK,UAAU,uBAAuB,eAAe,CAAC;AAC7E,cAAM,CAAC,SAAS,QAAQ,IAAI,uBAAuB,cAAc,MAAM,GAAG;AAC1E,cAAM,eAAe;AAAA,UACpB,MAAM;AAAA,UACN;AAAA,UACA,eAAe,UAAU;AAAA,UACzB,eAAe,UAAU;AAAA,QAC1B;AACA,cAAM,KAAK,qBAAqB,IAAA,EAAM,gBAAgB,UAAU,SAAS,YAAY;AACrF,cAAM,KAAK,sBAAsB,SAAS,UAAU,MAAM,aAAa,IAAI;AAAA,MAAA;AAAA,IAC5E,CACD;AAAA,EAAA;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MigrationsStatusFacade.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsStatusFacade.ts"],"sourcesContent":["import { MigrationsResolver, MigrationsStatusResolver, SystemClient } from '@contember/migrations-client'\nimport { createMigrationStatusTable } from './migrations'\nimport { SystemClientProvider } from '../SystemClientProvider'\n\nexport class MigrationsStatusFacade {\n\tconstructor(\n\t\tprivate readonly systemClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly migrationsStatusResolver: MigrationsStatusResolver,\n\t) {\n\t}\n\n\n\tpublic resolveMigrationsStatus = async ({ force }: { force?: boolean }) => {\n\t\tconst executedMigrations = await this.systemClientProvider.get().listExecutedMigrations()\n\t\tconst localMigrations = await this.migrationsResolver.getMigrationFiles()\n\t\tconst status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force)\n\t\tif (status.errorMigrations.length > 0) {\n\t\t\tconsole.error(createMigrationStatusTable(status.errorMigrations))\n\t\t\tif (!force) {\n\t\t\t\tthrow `Cannot execute migrations`\n\t\t\t}\n\t\t}\n\n\t\treturn status\n\t}\n}\n"],"names":["createMigrationStatusTable"],"mappings":";;;;;;AAIO,MAAM,uBAAuB;AAAA,EACnC,YACkB,sBACA,oBACA,0BAChB;AAHgB,SAAA,uBAAA;AACA,SAAA,qBAAA;AACA,SAAA,2BAAA;AAKlB,kBAAA,MAAO,2BAA0B,OAAO,EAAE,MAAA,MAAiC;AAC1E,YAAM,qBAAqB,MAAM,KAAK,qBAAqB,IAAA,EAAM;AACjE,YAAM,kBAAkB,MAAM,KAAK,mBAAmB,kBAAkB;AACxE,YAAM,SAAS,MAAM,KAAK,yBAAyB,oBAAoB,oBAAoB,iBAAiB,KAAK;AAC7G,UAAA,OAAO,gBAAgB,SAAS,GAAG;AACtC,gBAAQ,MAAMA,WAAAA,2BAA2B,OAAO,eAAe,CAAC;AAChE,YAAI,CAAC,OAAO;AACL,gBAAA;AAAA,QACP;AAAA,MACD;AAEO,aAAA;AAAA,IAAA,CACR;AAAA,EAfA;AAgBD;;"}
1
+ {"version":3,"file":"MigrationsStatusFacade.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsStatusFacade.ts"],"sourcesContent":["import { MigrationsResolver, MigrationsStatusResolver, SystemClient } from '@contember/migrations-client'\nimport { createMigrationStatusTable } from './migrations'\nimport { SystemClientProvider } from '../SystemClientProvider'\n\nexport class MigrationsStatusFacade {\n\tconstructor(\n\t\tprivate readonly systemClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly migrationsStatusResolver: MigrationsStatusResolver,\n\t) {\n\t}\n\n\n\tpublic resolveMigrationsStatus = async ({ force }: { force?: boolean }) => {\n\t\tconst executedMigrations = await this.systemClientProvider.get().listExecutedMigrations()\n\t\tconst localMigrations = await this.migrationsResolver.getMigrationFiles()\n\t\tconst status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force)\n\t\tif (status.errorMigrations.length > 0) {\n\t\t\tconsole.error(createMigrationStatusTable(status.errorMigrations))\n\t\t\tif (!force) {\n\t\t\t\tthrow `Cannot execute migrations`\n\t\t\t}\n\t\t}\n\n\t\treturn status\n\t}\n}\n"],"names":["createMigrationStatusTable"],"mappings":";;;;;;AAIO,MAAM,uBAAuB;AAAA,EACnC,YACkB,sBACA,oBACA,0BAChB;AAHgB,SAAA,uBAAA;AACA,SAAA,qBAAA;AACA,SAAA,2BAAA;AAKlB,kBAAA,MAAO,2BAA0B,OAAO,EAAE,MAAA,MAAiC;AAC1E,YAAM,qBAAqB,MAAM,KAAK,qBAAqB,IAAA,EAAM,uBAAuB;AACxF,YAAM,kBAAkB,MAAM,KAAK,mBAAmB,kBAAkB;AACxE,YAAM,SAAS,MAAM,KAAK,yBAAyB,oBAAoB,oBAAoB,iBAAiB,KAAK;AAC7G,UAAA,OAAO,gBAAgB,SAAS,GAAG;AACtC,gBAAQ,MAAMA,WAAAA,2BAA2B,OAAO,eAAe,CAAC;AAChE,YAAI,CAAC,OAAO;AACL,gBAAA;AAAA,QAAA;AAAA,MACP;AAGM,aAAA;AAAA,IAAA,CACR;AAAA,EAAA;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MigrationsStatusFacade.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsStatusFacade.ts"],"sourcesContent":["import { MigrationsResolver, MigrationsStatusResolver, SystemClient } from '@contember/migrations-client'\nimport { createMigrationStatusTable } from './migrations'\nimport { SystemClientProvider } from '../SystemClientProvider'\n\nexport class MigrationsStatusFacade {\n\tconstructor(\n\t\tprivate readonly systemClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly migrationsStatusResolver: MigrationsStatusResolver,\n\t) {\n\t}\n\n\n\tpublic resolveMigrationsStatus = async ({ force }: { force?: boolean }) => {\n\t\tconst executedMigrations = await this.systemClientProvider.get().listExecutedMigrations()\n\t\tconst localMigrations = await this.migrationsResolver.getMigrationFiles()\n\t\tconst status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force)\n\t\tif (status.errorMigrations.length > 0) {\n\t\t\tconsole.error(createMigrationStatusTable(status.errorMigrations))\n\t\t\tif (!force) {\n\t\t\t\tthrow `Cannot execute migrations`\n\t\t\t}\n\t\t}\n\n\t\treturn status\n\t}\n}\n"],"names":[],"mappings":";;;;AAIO,MAAM,uBAAuB;AAAA,EACnC,YACkB,sBACA,oBACA,0BAChB;AAHgB,SAAA,uBAAA;AACA,SAAA,qBAAA;AACA,SAAA,2BAAA;AAKlB,kBAAA,MAAO,2BAA0B,OAAO,EAAE,MAAA,MAAiC;AAC1E,YAAM,qBAAqB,MAAM,KAAK,qBAAqB,IAAA,EAAM;AACjE,YAAM,kBAAkB,MAAM,KAAK,mBAAmB,kBAAkB;AACxE,YAAM,SAAS,MAAM,KAAK,yBAAyB,oBAAoB,oBAAoB,iBAAiB,KAAK;AAC7G,UAAA,OAAO,gBAAgB,SAAS,GAAG;AACtC,gBAAQ,MAAM,2BAA2B,OAAO,eAAe,CAAC;AAChE,YAAI,CAAC,OAAO;AACL,gBAAA;AAAA,QACP;AAAA,MACD;AAEO,aAAA;AAAA,IAAA,CACR;AAAA,EAfA;AAgBD;"}
1
+ {"version":3,"file":"MigrationsStatusFacade.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsStatusFacade.ts"],"sourcesContent":["import { MigrationsResolver, MigrationsStatusResolver, SystemClient } from '@contember/migrations-client'\nimport { createMigrationStatusTable } from './migrations'\nimport { SystemClientProvider } from '../SystemClientProvider'\n\nexport class MigrationsStatusFacade {\n\tconstructor(\n\t\tprivate readonly systemClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly migrationsStatusResolver: MigrationsStatusResolver,\n\t) {\n\t}\n\n\n\tpublic resolveMigrationsStatus = async ({ force }: { force?: boolean }) => {\n\t\tconst executedMigrations = await this.systemClientProvider.get().listExecutedMigrations()\n\t\tconst localMigrations = await this.migrationsResolver.getMigrationFiles()\n\t\tconst status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force)\n\t\tif (status.errorMigrations.length > 0) {\n\t\t\tconsole.error(createMigrationStatusTable(status.errorMigrations))\n\t\t\tif (!force) {\n\t\t\t\tthrow `Cannot execute migrations`\n\t\t\t}\n\t\t}\n\n\t\treturn status\n\t}\n}\n"],"names":[],"mappings":";;;;AAIO,MAAM,uBAAuB;AAAA,EACnC,YACkB,sBACA,oBACA,0BAChB;AAHgB,SAAA,uBAAA;AACA,SAAA,qBAAA;AACA,SAAA,2BAAA;AAKlB,kBAAA,MAAO,2BAA0B,OAAO,EAAE,MAAA,MAAiC;AAC1E,YAAM,qBAAqB,MAAM,KAAK,qBAAqB,IAAA,EAAM,uBAAuB;AACxF,YAAM,kBAAkB,MAAM,KAAK,mBAAmB,kBAAkB;AACxE,YAAM,SAAS,MAAM,KAAK,yBAAyB,oBAAoB,oBAAoB,iBAAiB,KAAK;AAC7G,UAAA,OAAO,gBAAgB,SAAS,GAAG;AACtC,gBAAQ,MAAM,2BAA2B,OAAO,eAAe,CAAC;AAChE,YAAI,CAAC,OAAO;AACL,gBAAA;AAAA,QAAA;AAAA,MACP;AAGM,aAAA;AAAA,IAAA,CACR;AAAA,EAAA;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MigrationsValidator.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsValidator.ts"],"sourcesContent":["import { Migration } from '@contember/migrations-client'\nimport { Schema } from '@contember/schema'\nimport { SchemaValidatorSkippedErrors } from '@contember/schema-utils'\nimport { MigrationDescriber, MigrationVersionHelper, SchemaMigrator, SchemaUpdateError } from '@contember/schema-migrations'\nimport { validateSchemaAndPrintErrors } from '../schema/SchemaValidationHelper'\n\nexport class MigrationsValidator {\n\tconstructor(\n\t\tprivate readonly describer: MigrationDescriber,\n\t\tprivate readonly migrator: SchemaMigrator,\n\t) {\n\t}\n\n\tvalidate = (initialSchema: Schema, migrations: Migration[]): boolean => {\n\t\tlet migratedSchema = initialSchema\n\t\tlet projectValid = true\n\t\tlet skippedErrors: SchemaValidatorSkippedErrors[] = []\n\t\tfor (const migration of migrations) {\n\t\t\ttry {\n\t\t\t\t// just a check that it does not fail\n\t\t\t\tthis.describer.describeModifications(migratedSchema, migration)\n\n\t\t\t\tmigratedSchema = this.migrator.applyModifications(migratedSchema, migration.modifications, migration.formatVersion)\n\t\t\t} catch (e) {\n\t\t\t\tif (e instanceof SchemaUpdateError) {\n\t\t\t\t\tconsole.error(`Migration ${migration.name} has failed`)\n\t\t\t\t}\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tconst errorMessage = `Migration ${migration.name} produces invalid schema:`\n\t\t\tskippedErrors = [\n\t\t\t\t...skippedErrors.filter(it => it.skipUntil && MigrationVersionHelper.extractVersion(it.skipUntil) >= migration.version),\n\t\t\t\t...migration.skippedErrors ?? [],\n\t\t\t]\n\t\t\tprojectValid = validateSchemaAndPrintErrors(migratedSchema, errorMessage, skippedErrors)\n\t\t\t\t&& projectValid\n\t\t}\n\t\treturn projectValid\n\t}\n}\n"],"names":["SchemaUpdateError","MigrationVersionHelper","validateSchemaAndPrintErrors"],"mappings":";;;;;;;AAMO,MAAM,oBAAoB;AAAA,EAChC,YACkB,WACA,UAChB;AAFgB,SAAA,YAAA;AACA,SAAA,WAAA;AAIP,kBAAA,MAAA,YAAA,CAAC,eAAuB,eAAqC;AACvE,UAAI,iBAAiB;AACrB,UAAI,eAAe;AACnB,UAAI,gBAAgD,CAAA;AACpD,iBAAW,aAAa,YAAY;AAC/B,YAAA;AAEE,eAAA,UAAU,sBAAsB,gBAAgB,SAAS;AAE9D,2BAAiB,KAAK,SAAS,mBAAmB,gBAAgB,UAAU,eAAe,UAAU,aAAa;AAAA,iBAC1G,GAAG;AACX,cAAI,aAAaA,iBAAAA,mBAAmB;AACnC,oBAAQ,MAAM,aAAa,UAAU,IAAI,aAAa;AAAA,UACvD;AACM,gBAAA;AAAA,QACP;AACM,cAAA,eAAe,aAAa,UAAU,IAAI;AAChC,wBAAA;AAAA,UACf,GAAG,cAAc,OAAO,CAAA,OAAM,GAAG,aAAaC,wCAAuB,eAAe,GAAG,SAAS,KAAK,UAAU,OAAO;AAAA,UACtH,GAAG,UAAU,iBAAiB,CAAC;AAAA,QAAA;AAEhC,uBAAeC,uBAA6B,6BAAA,gBAAgB,cAAc,aAAa,KACnF;AAAA,MACL;AACO,aAAA;AAAA,IAAA,CACR;AAAA,EA3BA;AA4BD;;"}
1
+ {"version":3,"file":"MigrationsValidator.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsValidator.ts"],"sourcesContent":["import { Migration } from '@contember/migrations-client'\nimport { Schema } from '@contember/schema'\nimport { SchemaValidatorSkippedErrors } from '@contember/schema-utils'\nimport { MigrationDescriber, MigrationVersionHelper, SchemaMigrator, SchemaUpdateError } from '@contember/schema-migrations'\nimport { validateSchemaAndPrintErrors } from '../schema/SchemaValidationHelper'\n\nexport class MigrationsValidator {\n\tconstructor(\n\t\tprivate readonly describer: MigrationDescriber,\n\t\tprivate readonly migrator: SchemaMigrator,\n\t) {\n\t}\n\n\tvalidate = (initialSchema: Schema, migrations: Migration[]): boolean => {\n\t\tlet migratedSchema = initialSchema\n\t\tlet projectValid = true\n\t\tlet skippedErrors: SchemaValidatorSkippedErrors[] = []\n\t\tfor (const migration of migrations) {\n\t\t\ttry {\n\t\t\t\t// just a check that it does not fail\n\t\t\t\tthis.describer.describeModifications(migratedSchema, migration)\n\n\t\t\t\tmigratedSchema = this.migrator.applyModifications(migratedSchema, migration.modifications, migration.formatVersion)\n\t\t\t} catch (e) {\n\t\t\t\tif (e instanceof SchemaUpdateError) {\n\t\t\t\t\tconsole.error(`Migration ${migration.name} has failed`)\n\t\t\t\t}\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tconst errorMessage = `Migration ${migration.name} produces invalid schema:`\n\t\t\tskippedErrors = [\n\t\t\t\t...skippedErrors.filter(it => it.skipUntil && MigrationVersionHelper.extractVersion(it.skipUntil) >= migration.version),\n\t\t\t\t...migration.skippedErrors ?? [],\n\t\t\t]\n\t\t\tprojectValid = validateSchemaAndPrintErrors(migratedSchema, errorMessage, skippedErrors)\n\t\t\t\t&& projectValid\n\t\t}\n\t\treturn projectValid\n\t}\n}\n"],"names":["SchemaUpdateError","MigrationVersionHelper","validateSchemaAndPrintErrors"],"mappings":";;;;;;;AAMO,MAAM,oBAAoB;AAAA,EAChC,YACkB,WACA,UAChB;AAFgB,SAAA,YAAA;AACA,SAAA,WAAA;AAIP,kBAAA,MAAA,YAAA,CAAC,eAAuB,eAAqC;AACvE,UAAI,iBAAiB;AACrB,UAAI,eAAe;AACnB,UAAI,gBAAgD,CAAC;AACrD,iBAAW,aAAa,YAAY;AAC/B,YAAA;AAEE,eAAA,UAAU,sBAAsB,gBAAgB,SAAS;AAE9D,2BAAiB,KAAK,SAAS,mBAAmB,gBAAgB,UAAU,eAAe,UAAU,aAAa;AAAA,iBAC1G,GAAG;AACX,cAAI,aAAaA,iBAAAA,mBAAmB;AACnC,oBAAQ,MAAM,aAAa,UAAU,IAAI,aAAa;AAAA,UAAA;AAEjD,gBAAA;AAAA,QAAA;AAED,cAAA,eAAe,aAAa,UAAU,IAAI;AAChC,wBAAA;AAAA,UACf,GAAG,cAAc,OAAO,CAAA,OAAM,GAAG,aAAaC,wCAAuB,eAAe,GAAG,SAAS,KAAK,UAAU,OAAO;AAAA,UACtH,GAAG,UAAU,iBAAiB,CAAA;AAAA,QAC/B;AACA,uBAAeC,uBAAAA,6BAA6B,gBAAgB,cAAc,aAAa,KACnF;AAAA,MAAA;AAEE,aAAA;AAAA,IAAA,CACR;AAAA,EAAA;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MigrationsValidator.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsValidator.ts"],"sourcesContent":["import { Migration } from '@contember/migrations-client'\nimport { Schema } from '@contember/schema'\nimport { SchemaValidatorSkippedErrors } from '@contember/schema-utils'\nimport { MigrationDescriber, MigrationVersionHelper, SchemaMigrator, SchemaUpdateError } from '@contember/schema-migrations'\nimport { validateSchemaAndPrintErrors } from '../schema/SchemaValidationHelper'\n\nexport class MigrationsValidator {\n\tconstructor(\n\t\tprivate readonly describer: MigrationDescriber,\n\t\tprivate readonly migrator: SchemaMigrator,\n\t) {\n\t}\n\n\tvalidate = (initialSchema: Schema, migrations: Migration[]): boolean => {\n\t\tlet migratedSchema = initialSchema\n\t\tlet projectValid = true\n\t\tlet skippedErrors: SchemaValidatorSkippedErrors[] = []\n\t\tfor (const migration of migrations) {\n\t\t\ttry {\n\t\t\t\t// just a check that it does not fail\n\t\t\t\tthis.describer.describeModifications(migratedSchema, migration)\n\n\t\t\t\tmigratedSchema = this.migrator.applyModifications(migratedSchema, migration.modifications, migration.formatVersion)\n\t\t\t} catch (e) {\n\t\t\t\tif (e instanceof SchemaUpdateError) {\n\t\t\t\t\tconsole.error(`Migration ${migration.name} has failed`)\n\t\t\t\t}\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tconst errorMessage = `Migration ${migration.name} produces invalid schema:`\n\t\t\tskippedErrors = [\n\t\t\t\t...skippedErrors.filter(it => it.skipUntil && MigrationVersionHelper.extractVersion(it.skipUntil) >= migration.version),\n\t\t\t\t...migration.skippedErrors ?? [],\n\t\t\t]\n\t\t\tprojectValid = validateSchemaAndPrintErrors(migratedSchema, errorMessage, skippedErrors)\n\t\t\t\t&& projectValid\n\t\t}\n\t\treturn projectValid\n\t}\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,oBAAoB;AAAA,EAChC,YACkB,WACA,UAChB;AAFgB,SAAA,YAAA;AACA,SAAA,WAAA;AAIP,kBAAA,MAAA,YAAA,CAAC,eAAuB,eAAqC;AACvE,UAAI,iBAAiB;AACrB,UAAI,eAAe;AACnB,UAAI,gBAAgD,CAAA;AACpD,iBAAW,aAAa,YAAY;AAC/B,YAAA;AAEE,eAAA,UAAU,sBAAsB,gBAAgB,SAAS;AAE9D,2BAAiB,KAAK,SAAS,mBAAmB,gBAAgB,UAAU,eAAe,UAAU,aAAa;AAAA,iBAC1G,GAAG;AACX,cAAI,aAAa,mBAAmB;AACnC,oBAAQ,MAAM,aAAa,UAAU,IAAI,aAAa;AAAA,UACvD;AACM,gBAAA;AAAA,QACP;AACM,cAAA,eAAe,aAAa,UAAU,IAAI;AAChC,wBAAA;AAAA,UACf,GAAG,cAAc,OAAO,CAAA,OAAM,GAAG,aAAa,uBAAuB,eAAe,GAAG,SAAS,KAAK,UAAU,OAAO;AAAA,UACtH,GAAG,UAAU,iBAAiB,CAAC;AAAA,QAAA;AAEhC,uBAAe,6BAA6B,gBAAgB,cAAc,aAAa,KACnF;AAAA,MACL;AACO,aAAA;AAAA,IAAA,CACR;AAAA,EA3BA;AA4BD;"}
1
+ {"version":3,"file":"MigrationsValidator.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsValidator.ts"],"sourcesContent":["import { Migration } from '@contember/migrations-client'\nimport { Schema } from '@contember/schema'\nimport { SchemaValidatorSkippedErrors } from '@contember/schema-utils'\nimport { MigrationDescriber, MigrationVersionHelper, SchemaMigrator, SchemaUpdateError } from '@contember/schema-migrations'\nimport { validateSchemaAndPrintErrors } from '../schema/SchemaValidationHelper'\n\nexport class MigrationsValidator {\n\tconstructor(\n\t\tprivate readonly describer: MigrationDescriber,\n\t\tprivate readonly migrator: SchemaMigrator,\n\t) {\n\t}\n\n\tvalidate = (initialSchema: Schema, migrations: Migration[]): boolean => {\n\t\tlet migratedSchema = initialSchema\n\t\tlet projectValid = true\n\t\tlet skippedErrors: SchemaValidatorSkippedErrors[] = []\n\t\tfor (const migration of migrations) {\n\t\t\ttry {\n\t\t\t\t// just a check that it does not fail\n\t\t\t\tthis.describer.describeModifications(migratedSchema, migration)\n\n\t\t\t\tmigratedSchema = this.migrator.applyModifications(migratedSchema, migration.modifications, migration.formatVersion)\n\t\t\t} catch (e) {\n\t\t\t\tif (e instanceof SchemaUpdateError) {\n\t\t\t\t\tconsole.error(`Migration ${migration.name} has failed`)\n\t\t\t\t}\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tconst errorMessage = `Migration ${migration.name} produces invalid schema:`\n\t\t\tskippedErrors = [\n\t\t\t\t...skippedErrors.filter(it => it.skipUntil && MigrationVersionHelper.extractVersion(it.skipUntil) >= migration.version),\n\t\t\t\t...migration.skippedErrors ?? [],\n\t\t\t]\n\t\t\tprojectValid = validateSchemaAndPrintErrors(migratedSchema, errorMessage, skippedErrors)\n\t\t\t\t&& projectValid\n\t\t}\n\t\treturn projectValid\n\t}\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,oBAAoB;AAAA,EAChC,YACkB,WACA,UAChB;AAFgB,SAAA,YAAA;AACA,SAAA,WAAA;AAIP,kBAAA,MAAA,YAAA,CAAC,eAAuB,eAAqC;AACvE,UAAI,iBAAiB;AACrB,UAAI,eAAe;AACnB,UAAI,gBAAgD,CAAC;AACrD,iBAAW,aAAa,YAAY;AAC/B,YAAA;AAEE,eAAA,UAAU,sBAAsB,gBAAgB,SAAS;AAE9D,2BAAiB,KAAK,SAAS,mBAAmB,gBAAgB,UAAU,eAAe,UAAU,aAAa;AAAA,iBAC1G,GAAG;AACX,cAAI,aAAa,mBAAmB;AACnC,oBAAQ,MAAM,aAAa,UAAU,IAAI,aAAa;AAAA,UAAA;AAEjD,gBAAA;AAAA,QAAA;AAED,cAAA,eAAe,aAAa,UAAU,IAAI;AAChC,wBAAA;AAAA,UACf,GAAG,cAAc,OAAO,CAAA,OAAM,GAAG,aAAa,uBAAuB,eAAe,GAAG,SAAS,KAAK,UAAU,OAAO;AAAA,UACtH,GAAG,UAAU,iBAAiB,CAAA;AAAA,QAC/B;AACA,uBAAe,6BAA6B,gBAAgB,cAAc,aAAa,KACnF;AAAA,MAAA;AAEE,aAAA;AAAA,IAAA,CACR;AAAA,EAAA;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"migrations.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/migrations.ts"],"sourcesContent":["import { Migration, MigrationDescriber } from '@contember/schema-migrations'\nimport chalk from 'chalk'\nimport { Schema } from '@contember/schema'\nimport chalkTable from 'chalk-table'\nimport { assertNever } from '../assertNever'\nimport { emptyDatabaseMetadata } from '@contember/database'\nimport { MigrationState } from '@contember/migrations-client'\nimport { AnyMigrationStatus } from '@contember/migrations-client'\n\n\nexport const createMigrationStatusTable = (migrations: AnyMigrationStatus[]): string => {\n\treturn chalkTable(\n\t\t{\n\t\t\tcolumns: ['status', 'migration', 'info'],\n\t\t},\n\t\tmigrations.map(it => {\n\t\t\tswitch (it.state) {\n\t\t\t\tcase MigrationState.EXECUTED_ERROR:\n\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\tcase MigrationState.EXECUTED_OK:\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: chalk.bgGreen.blackBright('Executed'),\n\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\tinfo: `Executed at ${it.executedMigration.executedAt.toISOString()}`,\n\t\t\t\t\t}\n\t\t\t\tcase MigrationState.EXECUTED_MISSING:\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: chalk.bgRedBright.white('ERROR'),\n\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\tinfo: it.errorMessage,\n\t\t\t\t\t}\n\t\t\t\tcase MigrationState.TO_EXECUTE_OK:\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: chalk.bgBlueBright.white('Not executed'),\n\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\tinfo: 'Will be executed during next deploy',\n\t\t\t\t\t}\n\t\t\t\tcase MigrationState.TO_EXECUTE_ERROR:\n\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(it)\n\t\t\t}\n\t\t}),\n\t)\n}\n"],"names":["MigrationState","assertNever"],"mappings":";;;;;;AAUa,MAAA,6BAA6B,CAAC,eAA6C;AAChF,SAAA;AAAA,IACN;AAAA,MACC,SAAS,CAAC,UAAU,aAAa,MAAM;AAAA,IACxC;AAAA,IACA,WAAW,IAAI,CAAM,OAAA;AACpB,cAAQ,GAAG,OAAO;AAAA,QACjB,KAAKA,iBAAe,eAAA;AACnB,iBAAO,EAAE,QAAQ,MAAM,YAAY,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,MAAM,GAAG,aAAa;AAAA,QAC9F,KAAKA,iBAAe,eAAA;AACZ,iBAAA;AAAA,YACN,QAAQ,MAAM,QAAQ,YAAY,UAAU;AAAA,YAC5C,WAAW,GAAG;AAAA,YACd,MAAM,eAAe,GAAG,kBAAkB,WAAW,aAAa;AAAA,UAAA;AAAA,QAEpE,KAAKA,iBAAe,eAAA;AACZ,iBAAA;AAAA,YACN,QAAQ,MAAM,YAAY,MAAM,OAAO;AAAA,YACvC,WAAW,GAAG;AAAA,YACd,MAAM,GAAG;AAAA,UAAA;AAAA,QAEX,KAAKA,iBAAe,eAAA;AACZ,iBAAA;AAAA,YACN,QAAQ,MAAM,aAAa,MAAM,cAAc;AAAA,YAC/C,WAAW,GAAG;AAAA,YACd,MAAM;AAAA,UAAA;AAAA,QAER,KAAKA,iBAAe,eAAA;AACnB,iBAAO,EAAE,QAAQ,MAAM,YAAY,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,MAAM,GAAG,aAAa;AAAA,QAC9F;AACCC,sBAAAA,YAAc;AAAA,MAChB;AAAA,IAAA,CACA;AAAA,EAAA;AAEH;;"}
1
+ {"version":3,"file":"migrations.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/migrations.ts"],"sourcesContent":["import { Migration, MigrationDescriber } from '@contember/schema-migrations'\nimport chalk from 'chalk'\nimport { Schema } from '@contember/schema'\nimport chalkTable from 'chalk-table'\nimport { assertNever } from '../assertNever'\nimport { emptyDatabaseMetadata } from '@contember/database'\nimport { MigrationState } from '@contember/migrations-client'\nimport { AnyMigrationStatus } from '@contember/migrations-client'\n\n\nexport const createMigrationStatusTable = (migrations: AnyMigrationStatus[]): string => {\n\treturn chalkTable(\n\t\t{\n\t\t\tcolumns: ['status', 'migration', 'info'],\n\t\t},\n\t\tmigrations.map(it => {\n\t\t\tswitch (it.state) {\n\t\t\t\tcase MigrationState.EXECUTED_ERROR:\n\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\tcase MigrationState.EXECUTED_OK:\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: chalk.bgGreen.blackBright('Executed'),\n\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\tinfo: `Executed at ${it.executedMigration.executedAt.toISOString()}`,\n\t\t\t\t\t}\n\t\t\t\tcase MigrationState.EXECUTED_MISSING:\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: chalk.bgRedBright.white('ERROR'),\n\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\tinfo: it.errorMessage,\n\t\t\t\t\t}\n\t\t\t\tcase MigrationState.TO_EXECUTE_OK:\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: chalk.bgBlueBright.white('Not executed'),\n\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\tinfo: 'Will be executed during next deploy',\n\t\t\t\t\t}\n\t\t\t\tcase MigrationState.TO_EXECUTE_ERROR:\n\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(it)\n\t\t\t}\n\t\t}),\n\t)\n}\n"],"names":["MigrationState","assertNever"],"mappings":";;;;;;AAUa,MAAA,6BAA6B,CAAC,eAA6C;AAChF,SAAA;AAAA,IACN;AAAA,MACC,SAAS,CAAC,UAAU,aAAa,MAAM;AAAA,IACxC;AAAA,IACA,WAAW,IAAI,CAAM,OAAA;AACpB,cAAQ,GAAG,OAAO;AAAA,QACjB,KAAKA,iBAAe,eAAA;AACnB,iBAAO,EAAE,QAAQ,MAAM,YAAY,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,MAAM,GAAG,aAAa;AAAA,QAC9F,KAAKA,iBAAe,eAAA;AACZ,iBAAA;AAAA,YACN,QAAQ,MAAM,QAAQ,YAAY,UAAU;AAAA,YAC5C,WAAW,GAAG;AAAA,YACd,MAAM,eAAe,GAAG,kBAAkB,WAAW,aAAa;AAAA,UACnE;AAAA,QACD,KAAKA,iBAAe,eAAA;AACZ,iBAAA;AAAA,YACN,QAAQ,MAAM,YAAY,MAAM,OAAO;AAAA,YACvC,WAAW,GAAG;AAAA,YACd,MAAM,GAAG;AAAA,UACV;AAAA,QACD,KAAKA,iBAAe,eAAA;AACZ,iBAAA;AAAA,YACN,QAAQ,MAAM,aAAa,MAAM,cAAc;AAAA,YAC/C,WAAW,GAAG;AAAA,YACd,MAAM;AAAA,UACP;AAAA,QACD,KAAKA,iBAAe,eAAA;AACnB,iBAAO,EAAE,QAAQ,MAAM,YAAY,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,MAAM,GAAG,aAAa;AAAA,QAC9F;AACCC,sBAAAA,YAAc;AAAA,MAAA;AAAA,IAEhB,CAAA;AAAA,EACF;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"migrations.js","sources":["../../../../../../packages/cli/src/lib/migrations/migrations.ts"],"sourcesContent":["import { Migration, MigrationDescriber } from '@contember/schema-migrations'\nimport chalk from 'chalk'\nimport { Schema } from '@contember/schema'\nimport chalkTable from 'chalk-table'\nimport { assertNever } from '../assertNever'\nimport { emptyDatabaseMetadata } from '@contember/database'\nimport { MigrationState } from '@contember/migrations-client'\nimport { AnyMigrationStatus } from '@contember/migrations-client'\n\n\nexport const createMigrationStatusTable = (migrations: AnyMigrationStatus[]): string => {\n\treturn chalkTable(\n\t\t{\n\t\t\tcolumns: ['status', 'migration', 'info'],\n\t\t},\n\t\tmigrations.map(it => {\n\t\t\tswitch (it.state) {\n\t\t\t\tcase MigrationState.EXECUTED_ERROR:\n\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\tcase MigrationState.EXECUTED_OK:\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: chalk.bgGreen.blackBright('Executed'),\n\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\tinfo: `Executed at ${it.executedMigration.executedAt.toISOString()}`,\n\t\t\t\t\t}\n\t\t\t\tcase MigrationState.EXECUTED_MISSING:\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: chalk.bgRedBright.white('ERROR'),\n\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\tinfo: it.errorMessage,\n\t\t\t\t\t}\n\t\t\t\tcase MigrationState.TO_EXECUTE_OK:\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: chalk.bgBlueBright.white('Not executed'),\n\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\tinfo: 'Will be executed during next deploy',\n\t\t\t\t\t}\n\t\t\t\tcase MigrationState.TO_EXECUTE_ERROR:\n\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(it)\n\t\t\t}\n\t\t}),\n\t)\n}\n"],"names":[],"mappings":";;;;AAUa,MAAA,6BAA6B,CAAC,eAA6C;AAChF,SAAA;AAAA,IACN;AAAA,MACC,SAAS,CAAC,UAAU,aAAa,MAAM;AAAA,IACxC;AAAA,IACA,WAAW,IAAI,CAAM,OAAA;AACpB,cAAQ,GAAG,OAAO;AAAA,QACjB,KAAK,eAAe;AACnB,iBAAO,EAAE,QAAQ,MAAM,YAAY,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,MAAM,GAAG,aAAa;AAAA,QAC9F,KAAK,eAAe;AACZ,iBAAA;AAAA,YACN,QAAQ,MAAM,QAAQ,YAAY,UAAU;AAAA,YAC5C,WAAW,GAAG;AAAA,YACd,MAAM,eAAe,GAAG,kBAAkB,WAAW,aAAa;AAAA,UAAA;AAAA,QAEpE,KAAK,eAAe;AACZ,iBAAA;AAAA,YACN,QAAQ,MAAM,YAAY,MAAM,OAAO;AAAA,YACvC,WAAW,GAAG;AAAA,YACd,MAAM,GAAG;AAAA,UAAA;AAAA,QAEX,KAAK,eAAe;AACZ,iBAAA;AAAA,YACN,QAAQ,MAAM,aAAa,MAAM,cAAc;AAAA,YAC/C,WAAW,GAAG;AAAA,YACd,MAAM;AAAA,UAAA;AAAA,QAER,KAAK,eAAe;AACnB,iBAAO,EAAE,QAAQ,MAAM,YAAY,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,MAAM,GAAG,aAAa;AAAA,QAC9F;AACC,sBAAc;AAAA,MAChB;AAAA,IAAA,CACA;AAAA,EAAA;AAEH;"}
1
+ {"version":3,"file":"migrations.js","sources":["../../../../../../packages/cli/src/lib/migrations/migrations.ts"],"sourcesContent":["import { Migration, MigrationDescriber } from '@contember/schema-migrations'\nimport chalk from 'chalk'\nimport { Schema } from '@contember/schema'\nimport chalkTable from 'chalk-table'\nimport { assertNever } from '../assertNever'\nimport { emptyDatabaseMetadata } from '@contember/database'\nimport { MigrationState } from '@contember/migrations-client'\nimport { AnyMigrationStatus } from '@contember/migrations-client'\n\n\nexport const createMigrationStatusTable = (migrations: AnyMigrationStatus[]): string => {\n\treturn chalkTable(\n\t\t{\n\t\t\tcolumns: ['status', 'migration', 'info'],\n\t\t},\n\t\tmigrations.map(it => {\n\t\t\tswitch (it.state) {\n\t\t\t\tcase MigrationState.EXECUTED_ERROR:\n\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\tcase MigrationState.EXECUTED_OK:\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: chalk.bgGreen.blackBright('Executed'),\n\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\tinfo: `Executed at ${it.executedMigration.executedAt.toISOString()}`,\n\t\t\t\t\t}\n\t\t\t\tcase MigrationState.EXECUTED_MISSING:\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: chalk.bgRedBright.white('ERROR'),\n\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\tinfo: it.errorMessage,\n\t\t\t\t\t}\n\t\t\t\tcase MigrationState.TO_EXECUTE_OK:\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: chalk.bgBlueBright.white('Not executed'),\n\t\t\t\t\t\tmigration: it.name,\n\t\t\t\t\t\tinfo: 'Will be executed during next deploy',\n\t\t\t\t\t}\n\t\t\t\tcase MigrationState.TO_EXECUTE_ERROR:\n\t\t\t\t\treturn { status: chalk.bgRedBright.white('ERROR'), migration: it.name, info: it.errorMessage }\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(it)\n\t\t\t}\n\t\t}),\n\t)\n}\n"],"names":[],"mappings":";;;;AAUa,MAAA,6BAA6B,CAAC,eAA6C;AAChF,SAAA;AAAA,IACN;AAAA,MACC,SAAS,CAAC,UAAU,aAAa,MAAM;AAAA,IACxC;AAAA,IACA,WAAW,IAAI,CAAM,OAAA;AACpB,cAAQ,GAAG,OAAO;AAAA,QACjB,KAAK,eAAe;AACnB,iBAAO,EAAE,QAAQ,MAAM,YAAY,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,MAAM,GAAG,aAAa;AAAA,QAC9F,KAAK,eAAe;AACZ,iBAAA;AAAA,YACN,QAAQ,MAAM,QAAQ,YAAY,UAAU;AAAA,YAC5C,WAAW,GAAG;AAAA,YACd,MAAM,eAAe,GAAG,kBAAkB,WAAW,aAAa;AAAA,UACnE;AAAA,QACD,KAAK,eAAe;AACZ,iBAAA;AAAA,YACN,QAAQ,MAAM,YAAY,MAAM,OAAO;AAAA,YACvC,WAAW,GAAG;AAAA,YACd,MAAM,GAAG;AAAA,UACV;AAAA,QACD,KAAK,eAAe;AACZ,iBAAA;AAAA,YACN,QAAQ,MAAM,aAAa,MAAM,cAAc;AAAA,YAC/C,WAAW,GAAG;AAAA,YACd,MAAM;AAAA,UACP;AAAA,QACD,KAAK,eAAe;AACnB,iBAAO,EAAE,QAAQ,MAAM,YAAY,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,MAAM,GAAG,aAAa;AAAA,QAC9F;AACC,sBAAc;AAAA,MAAA;AAAA,IAEhB,CAAA;AAAA,EACF;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteProject.cjs","sources":["../../../../../../packages/cli/src/lib/project/RemoteProject.ts"],"sourcesContent":["export class RemoteProject {\n\tconstructor(\n\t\tpublic readonly name: string,\n\t\tpublic readonly endpoint: string,\n\t\tpublic readonly token: string,\n\t\tpublic readonly adminEndpoint?: string,\n\t) {\n\t}\n}\n"],"names":[],"mappings":";;AAAO,MAAM,cAAc;AAAA,EAC1B,YACiB,MACA,UACA,OACA,eACf;AAJe,SAAA,OAAA;AACA,SAAA,WAAA;AACA,SAAA,QAAA;AACA,SAAA,gBAAA;AAAA,EAEjB;AACD;;"}
1
+ {"version":3,"file":"RemoteProject.cjs","sources":["../../../../../../packages/cli/src/lib/project/RemoteProject.ts"],"sourcesContent":["export class RemoteProject {\n\tconstructor(\n\t\tpublic readonly name: string,\n\t\tpublic readonly endpoint: string,\n\t\tpublic readonly token: string,\n\t\tpublic readonly adminEndpoint?: string,\n\t) {\n\t}\n}\n"],"names":[],"mappings":";;AAAO,MAAM,cAAc;AAAA,EAC1B,YACiB,MACA,UACA,OACA,eACf;AAJe,SAAA,OAAA;AACA,SAAA,WAAA;AACA,SAAA,QAAA;AACA,SAAA,gBAAA;AAAA,EAAA;AAGlB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteProject.js","sources":["../../../../../../packages/cli/src/lib/project/RemoteProject.ts"],"sourcesContent":["export class RemoteProject {\n\tconstructor(\n\t\tpublic readonly name: string,\n\t\tpublic readonly endpoint: string,\n\t\tpublic readonly token: string,\n\t\tpublic readonly adminEndpoint?: string,\n\t) {\n\t}\n}\n"],"names":[],"mappings":"AAAO,MAAM,cAAc;AAAA,EAC1B,YACiB,MACA,UACA,OACA,eACf;AAJe,SAAA,OAAA;AACA,SAAA,WAAA;AACA,SAAA,QAAA;AACA,SAAA,gBAAA;AAAA,EAEjB;AACD;"}
1
+ {"version":3,"file":"RemoteProject.js","sources":["../../../../../../packages/cli/src/lib/project/RemoteProject.ts"],"sourcesContent":["export class RemoteProject {\n\tconstructor(\n\t\tpublic readonly name: string,\n\t\tpublic readonly endpoint: string,\n\t\tpublic readonly token: string,\n\t\tpublic readonly adminEndpoint?: string,\n\t) {\n\t}\n}\n"],"names":[],"mappings":"AAAO,MAAM,cAAc;AAAA,EAC1B,YACiB,MACA,UACA,OACA,eACf;AAJe,SAAA,OAAA;AACA,SAAA,WAAA;AACA,SAAA,QAAA;AACA,SAAA,gBAAA;AAAA,EAAA;AAGlB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteProjectProvider.cjs","sources":["../../../../../../packages/cli/src/lib/project/RemoteProjectProvider.ts"],"sourcesContent":["import { RemoteProject } from './RemoteProject'\n\nexport class RemoteProjectProvider {\n\tprivate _remoteProject: RemoteProject | undefined = undefined\n\n\tpublic setRemoteProject(remoteProject: RemoteProject) {\n\t\tthis._remoteProject = remoteProject\n\t}\n\n\tpublic get(): RemoteProject {\n\t\tif (!this._remoteProject) {\n\t\t\tthrow new Error('Remote project not set')\n\t\t}\n\t\treturn this._remoteProject\n\t}\n}\n"],"names":[],"mappings":";;;;;AAEO,MAAM,sBAAsB;AAAA,EAA5B,cAAA;AACE,kBAAA,MAAA,gBAAA;AAAA,EAAA;AAAA,EAED,iBAAiB,eAA8B;AACrD,SAAK,iBAAiB;AAAA,EACvB;AAAA,EAEO,MAAqB;AACvB,QAAA,CAAC,KAAK,gBAAgB;AACnB,YAAA,IAAI,MAAM,wBAAwB;AAAA,IACzC;AACA,WAAO,KAAK;AAAA,EACb;AACD;;"}
1
+ {"version":3,"file":"RemoteProjectProvider.cjs","sources":["../../../../../../packages/cli/src/lib/project/RemoteProjectProvider.ts"],"sourcesContent":["import { RemoteProject } from './RemoteProject'\n\nexport class RemoteProjectProvider {\n\tprivate _remoteProject: RemoteProject | undefined = undefined\n\n\tpublic setRemoteProject(remoteProject: RemoteProject) {\n\t\tthis._remoteProject = remoteProject\n\t}\n\n\tpublic get(): RemoteProject {\n\t\tif (!this._remoteProject) {\n\t\t\tthrow new Error('Remote project not set')\n\t\t}\n\t\treturn this._remoteProject\n\t}\n}\n"],"names":[],"mappings":";;;;;AAEO,MAAM,sBAAsB;AAAA,EAA5B,cAAA;AACE,kBAAA,MAAA,gBAAA;AAAA,EAAA;AAAA,EAED,iBAAiB,eAA8B;AACrD,SAAK,iBAAiB;AAAA,EAAA;AAAA,EAGhB,MAAqB;AACvB,QAAA,CAAC,KAAK,gBAAgB;AACnB,YAAA,IAAI,MAAM,wBAAwB;AAAA,IAAA;AAEzC,WAAO,KAAK;AAAA,EAAA;AAEd;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteProjectProvider.js","sources":["../../../../../../packages/cli/src/lib/project/RemoteProjectProvider.ts"],"sourcesContent":["import { RemoteProject } from './RemoteProject'\n\nexport class RemoteProjectProvider {\n\tprivate _remoteProject: RemoteProject | undefined = undefined\n\n\tpublic setRemoteProject(remoteProject: RemoteProject) {\n\t\tthis._remoteProject = remoteProject\n\t}\n\n\tpublic get(): RemoteProject {\n\t\tif (!this._remoteProject) {\n\t\t\tthrow new Error('Remote project not set')\n\t\t}\n\t\treturn this._remoteProject\n\t}\n}\n"],"names":[],"mappings":";;;AAEO,MAAM,sBAAsB;AAAA,EAA5B,cAAA;AACE,kBAAA,MAAA,gBAAA;AAAA,EAAA;AAAA,EAED,iBAAiB,eAA8B;AACrD,SAAK,iBAAiB;AAAA,EACvB;AAAA,EAEO,MAAqB;AACvB,QAAA,CAAC,KAAK,gBAAgB;AACnB,YAAA,IAAI,MAAM,wBAAwB;AAAA,IACzC;AACA,WAAO,KAAK;AAAA,EACb;AACD;"}
1
+ {"version":3,"file":"RemoteProjectProvider.js","sources":["../../../../../../packages/cli/src/lib/project/RemoteProjectProvider.ts"],"sourcesContent":["import { RemoteProject } from './RemoteProject'\n\nexport class RemoteProjectProvider {\n\tprivate _remoteProject: RemoteProject | undefined = undefined\n\n\tpublic setRemoteProject(remoteProject: RemoteProject) {\n\t\tthis._remoteProject = remoteProject\n\t}\n\n\tpublic get(): RemoteProject {\n\t\tif (!this._remoteProject) {\n\t\t\tthrow new Error('Remote project not set')\n\t\t}\n\t\treturn this._remoteProject\n\t}\n}\n"],"names":[],"mappings":";;;AAEO,MAAM,sBAAsB;AAAA,EAA5B,cAAA;AACE,kBAAA,MAAA,gBAAA;AAAA,EAAA;AAAA,EAED,iBAAiB,eAA8B;AACrD,SAAK,iBAAiB;AAAA,EAAA;AAAA,EAGhB,MAAqB;AACvB,QAAA,CAAC,KAAK,gBAAgB;AACnB,YAAA,IAAI,MAAM,wBAAwB;AAAA,IAAA;AAEzC,WAAO,KAAK;AAAA,EAAA;AAEd;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteProjectResolver.cjs","sources":["../../../../../../packages/cli/src/lib/project/RemoteProjectResolver.ts"],"sourcesContent":["import { parseDsn } from '../dsn'\nimport { RemoteProject } from './RemoteProject'\nimport { CliEnv } from '../env'\n\nexport class RemoteProjectResolver {\n\tconstructor(\n\t\tprivate readonly cliEnv: CliEnv,\n\t) {\n\t}\n\n\tresolve(identifier?: string, adminEndpoint?: string): RemoteProject | undefined {\n\t\tlet endpoint: string | undefined\n\t\tlet token: string | undefined\n\t\tlet project: string | undefined\n\t\tif (identifier?.includes('://')) {\n\t\t\t({ endpoint, project, token } = parseDsn(identifier))\n\t\t} else if (this.cliEnv.dsn) {\n\t\t\t({ endpoint, project, token } = parseDsn(this.cliEnv.dsn))\n\t\t} else {\n\t\t\tendpoint = this.cliEnv.apiUrl\n\t\t\ttoken = this.cliEnv.apiToken\n\t\t\tproject = !identifier || identifier === '.' ? this.cliEnv.projectName : identifier\n\t\t}\n\t\tif (!project || !endpoint || !token) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (endpoint.endsWith('/')) {\n\t\t\tendpoint = endpoint.slice(0, -1)\n\t\t}\n\n\t\tif (!adminEndpoint && endpoint.endsWith('.contember.cloud') && !endpoint.includes('://api-')) {\n\t\t\tadminEndpoint = endpoint\n\t\t\tendpoint += '/_api'\n\t\t}\n\n\t\treturn new RemoteProject(project, endpoint, token, adminEndpoint)\n\t}\n}\n"],"names":["parseDsn","RemoteProject"],"mappings":";;;;AAIO,MAAM,sBAAsB;AAAA,EAClC,YACkB,QAChB;AADgB,SAAA,SAAA;AAAA,EAElB;AAAA,EAEA,QAAQ,YAAqB,eAAmD;AAC3E,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA,YAAY,SAAS,KAAK,GAAG;AAChC,OAAC,EAAE,UAAU,SAAS,MAAM,IAAIA,IAAAA,SAAS,UAAU;AAAA,IAAA,WACzC,KAAK,OAAO,KAAK;AAC1B,OAAA,EAAE,UAAU,SAAS,MAAA,IAAUA,IAAAA,SAAS,KAAK,OAAO,GAAG;AAAA,IAAA,OAClD;AACN,iBAAW,KAAK,OAAO;AACvB,cAAQ,KAAK,OAAO;AACpB,gBAAU,CAAC,cAAc,eAAe,MAAM,KAAK,OAAO,cAAc;AAAA,IACzE;AACA,QAAI,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO;AAC7B,aAAA;AAAA,IACR;AACI,QAAA,SAAS,SAAS,GAAG,GAAG;AAChB,iBAAA,SAAS,MAAM,GAAG,EAAE;AAAA,IAChC;AAEI,QAAA,CAAC,iBAAiB,SAAS,SAAS,kBAAkB,KAAK,CAAC,SAAS,SAAS,SAAS,GAAG;AAC7E,sBAAA;AACJ,kBAAA;AAAA,IACb;AAEA,WAAO,IAAIC,cAAA,cAAc,SAAS,UAAU,OAAO,aAAa;AAAA,EACjE;AACD;;"}
1
+ {"version":3,"file":"RemoteProjectResolver.cjs","sources":["../../../../../../packages/cli/src/lib/project/RemoteProjectResolver.ts"],"sourcesContent":["import { parseDsn } from '../dsn'\nimport { RemoteProject } from './RemoteProject'\nimport { CliEnv } from '../env'\n\nexport class RemoteProjectResolver {\n\tconstructor(\n\t\tprivate readonly cliEnv: CliEnv,\n\t) {\n\t}\n\n\tresolve(identifier?: string, adminEndpoint?: string): RemoteProject | undefined {\n\t\tlet endpoint: string | undefined\n\t\tlet token: string | undefined\n\t\tlet project: string | undefined\n\t\tif (identifier?.includes('://')) {\n\t\t\t({ endpoint, project, token } = parseDsn(identifier))\n\t\t} else if (this.cliEnv.dsn) {\n\t\t\t({ endpoint, project, token } = parseDsn(this.cliEnv.dsn))\n\t\t} else {\n\t\t\tendpoint = this.cliEnv.apiUrl\n\t\t\ttoken = this.cliEnv.apiToken\n\t\t\tproject = !identifier || identifier === '.' ? this.cliEnv.projectName : identifier\n\t\t}\n\t\tif (!project || !endpoint || !token) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (endpoint.endsWith('/')) {\n\t\t\tendpoint = endpoint.slice(0, -1)\n\t\t}\n\n\t\tif (!adminEndpoint && endpoint.endsWith('.contember.cloud') && !endpoint.includes('://api-')) {\n\t\t\tadminEndpoint = endpoint\n\t\t\tendpoint += '/_api'\n\t\t}\n\n\t\treturn new RemoteProject(project, endpoint, token, adminEndpoint)\n\t}\n}\n"],"names":["parseDsn","RemoteProject"],"mappings":";;;;AAIO,MAAM,sBAAsB;AAAA,EAClC,YACkB,QAChB;AADgB,SAAA,SAAA;AAAA,EAAA;AAAA,EAIlB,QAAQ,YAAqB,eAAmD;AAC3E,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA,YAAY,SAAS,KAAK,GAAG;AAChC,OAAC,EAAE,UAAU,SAAS,MAAM,IAAIA,IAAAA,SAAS,UAAU;AAAA,IAAA,WACzC,KAAK,OAAO,KAAK;AAC1B,OAAA,EAAE,UAAU,SAAS,MAAA,IAAUA,IAAAA,SAAS,KAAK,OAAO,GAAG;AAAA,IAAA,OAClD;AACN,iBAAW,KAAK,OAAO;AACvB,cAAQ,KAAK,OAAO;AACpB,gBAAU,CAAC,cAAc,eAAe,MAAM,KAAK,OAAO,cAAc;AAAA,IAAA;AAEzE,QAAI,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO;AAC7B,aAAA;AAAA,IAAA;AAEJ,QAAA,SAAS,SAAS,GAAG,GAAG;AAChB,iBAAA,SAAS,MAAM,GAAG,EAAE;AAAA,IAAA;AAG5B,QAAA,CAAC,iBAAiB,SAAS,SAAS,kBAAkB,KAAK,CAAC,SAAS,SAAS,SAAS,GAAG;AAC7E,sBAAA;AACJ,kBAAA;AAAA,IAAA;AAGb,WAAO,IAAIC,cAAAA,cAAc,SAAS,UAAU,OAAO,aAAa;AAAA,EAAA;AAElE;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteProjectResolver.js","sources":["../../../../../../packages/cli/src/lib/project/RemoteProjectResolver.ts"],"sourcesContent":["import { parseDsn } from '../dsn'\nimport { RemoteProject } from './RemoteProject'\nimport { CliEnv } from '../env'\n\nexport class RemoteProjectResolver {\n\tconstructor(\n\t\tprivate readonly cliEnv: CliEnv,\n\t) {\n\t}\n\n\tresolve(identifier?: string, adminEndpoint?: string): RemoteProject | undefined {\n\t\tlet endpoint: string | undefined\n\t\tlet token: string | undefined\n\t\tlet project: string | undefined\n\t\tif (identifier?.includes('://')) {\n\t\t\t({ endpoint, project, token } = parseDsn(identifier))\n\t\t} else if (this.cliEnv.dsn) {\n\t\t\t({ endpoint, project, token } = parseDsn(this.cliEnv.dsn))\n\t\t} else {\n\t\t\tendpoint = this.cliEnv.apiUrl\n\t\t\ttoken = this.cliEnv.apiToken\n\t\t\tproject = !identifier || identifier === '.' ? this.cliEnv.projectName : identifier\n\t\t}\n\t\tif (!project || !endpoint || !token) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (endpoint.endsWith('/')) {\n\t\t\tendpoint = endpoint.slice(0, -1)\n\t\t}\n\n\t\tif (!adminEndpoint && endpoint.endsWith('.contember.cloud') && !endpoint.includes('://api-')) {\n\t\t\tadminEndpoint = endpoint\n\t\t\tendpoint += '/_api'\n\t\t}\n\n\t\treturn new RemoteProject(project, endpoint, token, adminEndpoint)\n\t}\n}\n"],"names":[],"mappings":";;AAIO,MAAM,sBAAsB;AAAA,EAClC,YACkB,QAChB;AADgB,SAAA,SAAA;AAAA,EAElB;AAAA,EAEA,QAAQ,YAAqB,eAAmD;AAC3E,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA,YAAY,SAAS,KAAK,GAAG;AAChC,OAAC,EAAE,UAAU,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,IAAA,WACzC,KAAK,OAAO,KAAK;AAC1B,OAAA,EAAE,UAAU,SAAS,MAAA,IAAU,SAAS,KAAK,OAAO,GAAG;AAAA,IAAA,OAClD;AACN,iBAAW,KAAK,OAAO;AACvB,cAAQ,KAAK,OAAO;AACpB,gBAAU,CAAC,cAAc,eAAe,MAAM,KAAK,OAAO,cAAc;AAAA,IACzE;AACA,QAAI,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO;AAC7B,aAAA;AAAA,IACR;AACI,QAAA,SAAS,SAAS,GAAG,GAAG;AAChB,iBAAA,SAAS,MAAM,GAAG,EAAE;AAAA,IAChC;AAEI,QAAA,CAAC,iBAAiB,SAAS,SAAS,kBAAkB,KAAK,CAAC,SAAS,SAAS,SAAS,GAAG;AAC7E,sBAAA;AACJ,kBAAA;AAAA,IACb;AAEA,WAAO,IAAI,cAAc,SAAS,UAAU,OAAO,aAAa;AAAA,EACjE;AACD;"}
1
+ {"version":3,"file":"RemoteProjectResolver.js","sources":["../../../../../../packages/cli/src/lib/project/RemoteProjectResolver.ts"],"sourcesContent":["import { parseDsn } from '../dsn'\nimport { RemoteProject } from './RemoteProject'\nimport { CliEnv } from '../env'\n\nexport class RemoteProjectResolver {\n\tconstructor(\n\t\tprivate readonly cliEnv: CliEnv,\n\t) {\n\t}\n\n\tresolve(identifier?: string, adminEndpoint?: string): RemoteProject | undefined {\n\t\tlet endpoint: string | undefined\n\t\tlet token: string | undefined\n\t\tlet project: string | undefined\n\t\tif (identifier?.includes('://')) {\n\t\t\t({ endpoint, project, token } = parseDsn(identifier))\n\t\t} else if (this.cliEnv.dsn) {\n\t\t\t({ endpoint, project, token } = parseDsn(this.cliEnv.dsn))\n\t\t} else {\n\t\t\tendpoint = this.cliEnv.apiUrl\n\t\t\ttoken = this.cliEnv.apiToken\n\t\t\tproject = !identifier || identifier === '.' ? this.cliEnv.projectName : identifier\n\t\t}\n\t\tif (!project || !endpoint || !token) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (endpoint.endsWith('/')) {\n\t\t\tendpoint = endpoint.slice(0, -1)\n\t\t}\n\n\t\tif (!adminEndpoint && endpoint.endsWith('.contember.cloud') && !endpoint.includes('://api-')) {\n\t\t\tadminEndpoint = endpoint\n\t\t\tendpoint += '/_api'\n\t\t}\n\n\t\treturn new RemoteProject(project, endpoint, token, adminEndpoint)\n\t}\n}\n"],"names":[],"mappings":";;AAIO,MAAM,sBAAsB;AAAA,EAClC,YACkB,QAChB;AADgB,SAAA,SAAA;AAAA,EAAA;AAAA,EAIlB,QAAQ,YAAqB,eAAmD;AAC3E,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA,YAAY,SAAS,KAAK,GAAG;AAChC,OAAC,EAAE,UAAU,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,IAAA,WACzC,KAAK,OAAO,KAAK;AAC1B,OAAA,EAAE,UAAU,SAAS,MAAA,IAAU,SAAS,KAAK,OAAO,GAAG;AAAA,IAAA,OAClD;AACN,iBAAW,KAAK,OAAO;AACvB,cAAQ,KAAK,OAAO;AACpB,gBAAU,CAAC,cAAc,eAAe,MAAM,KAAK,OAAO,cAAc;AAAA,IAAA;AAEzE,QAAI,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO;AAC7B,aAAA;AAAA,IAAA;AAEJ,QAAA,SAAS,SAAS,GAAG,GAAG;AAChB,iBAAA,SAAS,MAAM,GAAG,EAAE;AAAA,IAAA;AAG5B,QAAA,CAAC,iBAAiB,SAAS,SAAS,kBAAkB,KAAK,CAAC,SAAS,SAAS,SAAS,GAAG;AAC7E,sBAAA;AACJ,kBAAA;AAAA,IAAA;AAGb,WAAO,IAAI,cAAc,SAAS,UAAU,OAAO,aAAa;AAAA,EAAA;AAElE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityInfo.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/EntityInfo.tsx"],"sourcesContent":["import { Model, Schema } from '@contember/schema'\nimport { ReferencesMap } from '../../../schema/collectReferences'\nimport { formatEntityAnchor, formatFieldAnchor } from './utils'\nimport { SinglePermission } from './SinglePermission'\nimport { FieldType } from './FieldType'\nimport { FieldPermissions } from './FieldPermissions'\nimport { OnDelete } from './OnDelete'\nimport { Fragment, h } from 'preact'\n\ninterface EntityInfoProps {\n\tentity: Model.Entity\n\tschema: Schema\n\treferences: ReferencesMap\n}\n\nexport const EntityInfo = ({ entity, schema, references }: EntityInfoProps) => (\n\t<div class={'m-4 border border-gray-400 rounded-lg group'}\n\t\t id={formatEntityAnchor(entity.name)}>\n\t\t<div class={'font-bold text-gray-900 py-2 px-4 border-b border-gray-400 group-target:bg-yellow-100 rounded-t-lg'}>\n\t\t\t{entity.name}\n\t\t</div>\n\t\t<div class={'px-2 py-2 flex flex-wrap '}>\n\t\t\t<div>\n\t\t\t\t<table>\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th class={'text-left px-2 text-gray-500 font-normal w-[180px] max-w-[180px]'}>Name</th>\n\t\t\t\t\t\t\t<th class={'text-left px-2 text-gray-500 font-normal w-[340px] max-w-[340px]'}>Type</th>\n\t\t\t\t\t\t\t{Object.keys(schema.acl.roles).map(role => <th\n\t\t\t\t\t\t\t\tkey={role}\n\t\t\t\t\t\t\t\tclass={'text-left px-2 text-gray-500 font-normal w-[120px] max-w-[120px] text-xs truncate text-sm'}>{role}</th>)}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t{Object.entries(schema.acl.roles).map(([name, role]) => <td class={'px-2'} key={name}>\n\t\t\t\t\t\t\t<SinglePermission value={'D'}\n\t\t\t\t\t\t\t\t\t\t\t predicate={role.entities[entity.name]?.operations.delete} />\n\t\t\t\t\t\t</td>)}\n\t\t\t\t\t</tr>\n\t\t\t\t\t{Object.values(entity.fields).map(field => (\n\t\t\t\t\t\t<tr class={'even:bg-gray-100 target:bg-yellow-100'}\n\t\t\t\t\t\t\tid={formatFieldAnchor(entity.name, field.name)}\n\t\t\t\t\t\t\tkey={field.name}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<td class={'px-2 font-mono truncate w-[180px] max-w-[180px]'} title={field.name}>\n\t\t\t\t\t\t\t\t{field.name}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class={'text-gray-800 px-2 font-mono w-[420px] max-w-[420px]'}>\n\t\t\t\t\t\t\t\t<FieldType field={field} />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t{Object.entries(schema.acl.roles).map(([name, role]) => <td class={'px-2'} key={name}>\n\t\t\t\t\t\t\t\t<FieldPermissions field={field.name}\n\t\t\t\t\t\t\t\t\t\t\t\t entityPermissions={role.entities[entity.name]} />\n\t\t\t\t\t\t\t</td>)}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t))}\n\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<div class={'px-2 py-2 w-1/2'}>\n\t\t\t\t<h3 class={'text-lg text-gray-600'}>On delete behaviour:</h3>\n\t\t\t\t<p class={'text-gray-500 text-sm'}>\n\t\t\t\t\t(What happens when you attempt to delete entity {entity.name})</p>\n\t\t\t\t<div class={'mt-2 text-sm '}>\n\t\t\t\t\t<OnDelete references={references} entity={entity} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{false && <div class={'px-2 py-2 w-1/2'}>\n\t\t\t\t<h3 class={'text-lg text-gray-600'}>ACL predicates:</h3>\n\t\t\t\t<div class={'mt-2 text-sm '}>\n\t\t\t\t\t{Object.entries(schema.acl.roles).map(([roleName, role]) =>\n\t\t\t\t\t\tObject.entries(role.entities[entity.name]?.predicates ?? {}).map(([predicateName, predicate]) => (\n\t\t\t\t\t\t\t<Fragment key={roleName + '__' + predicateName}>\n\t\t\t\t\t\t\t\t<h4>{roleName}: {predicateName}</h4>\n\t\t\t\t\t\t\t\t<code>{JSON.stringify(predicate)}</code>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t)),\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>}\n\t\t</div>\n\t</div>\n)\n"],"names":["jsxs","formatEntityAnchor","jsx","Sin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docs/components/EntityInfo.tsx"],"sourcesContent":["import { Model, Schema } from '@contember/schema'\nimport { ReferencesMap } from '../../../schema/collectReferences'\nimport { formatEntityAnchor, formatFieldAnchor } from './utils'\nimport { SinglePermission } from './SinglePermission'\nimport { FieldType } from './FieldType'\nimport { FieldPermissions } from './FieldPermissions'\nimport { OnDelete } from './OnDelete'\nimport { Fragment, h } from 'preact'\n\ninterface EntityInfoProps {\n\tentity: Model.Entity\n\tschema: Schema\n\treferences: ReferencesMap\n}\n\nexport const EntityInfo = ({ entity, schema, references }: EntityInfoProps) => (\n\t<div class={'m-4 border border-gray-400 rounded-lg group'}\n\t\t id={formatEntityAnchor(entity.name)}>\n\t\t<div class={'font-bold text-gray-900 py-2 px-4 border-b border-gray-400 group-target:bg-yellow-100 rounded-t-lg'}>\n\t\t\t{entity.name}\n\t\t</div>\n\t\t<div class={'px-2 py-2 flex flex-wrap '}>\n\t\t\t<div>\n\t\t\t\t<table>\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th class={'text-left px-2 text-gray-500 font-normal w-[180px] max-w-[180px]'}>Name</th>\n\t\t\t\t\t\t\t<th class={'text-left px-2 text-gray-500 font-normal w-[340px] max-w-[340px]'}>Type</th>\n\t\t\t\t\t\t\t{Object.keys(schema.acl.roles).map(role => <th\n\t\t\t\t\t\t\t\tkey={role}\n\t\t\t\t\t\t\t\tclass={'text-left px-2 text-gray-500 font-normal w-[120px] max-w-[120px] text-xs truncate text-sm'}>{role}</th>)}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t{Object.entries(schema.acl.roles).map(([name, role]) => <td class={'px-2'} key={name}>\n\t\t\t\t\t\t\t<SinglePermission value={'D'}\n\t\t\t\t\t\t\t\t\t\t\t predicate={role.entities[entity.name]?.operations.delete} />\n\t\t\t\t\t\t</td>)}\n\t\t\t\t\t</tr>\n\t\t\t\t\t{Object.values(entity.fields).map(field => (\n\t\t\t\t\t\t<tr class={'even:bg-gray-100 target:bg-yellow-100'}\n\t\t\t\t\t\t\tid={formatFieldAnchor(entity.name, field.name)}\n\t\t\t\t\t\t\tkey={field.name}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<td class={'px-2 font-mono truncate w-[180px] max-w-[180px]'} title={field.name}>\n\t\t\t\t\t\t\t\t{field.name}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class={'text-gray-800 px-2 font-mono w-[420px] max-w-[420px]'}>\n\t\t\t\t\t\t\t\t<FieldType field={field} />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t{Object.entries(schema.acl.roles).map(([name, role]) => <td class={'px-2'} key={name}>\n\t\t\t\t\t\t\t\t<FieldPermissions field={field.name}\n\t\t\t\t\t\t\t\t\t\t\t\t entityPermissions={role.entities[entity.name]} />\n\t\t\t\t\t\t\t</td>)}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t))}\n\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<div class={'px-2 py-2 w-1/2'}>\n\t\t\t\t<h3 class={'text-lg text-gray-600'}>On delete behaviour:</h3>\n\t\t\t\t<p class={'text-gray-500 text-sm'}>\n\t\t\t\t\t(What happens when you attempt to delete entity {entity.name})</p>\n\t\t\t\t<div class={'mt-2 text-sm '}>\n\t\t\t\t\t<OnDelete references={references} entity={entity} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{false && <div class={'px-2 py-2 w-1/2'}>\n\t\t\t\t<h3 class={'text-lg text-gray-600'}>ACL predicates:</h3>\n\t\t\t\t<div class={'mt-2 text-sm '}>\n\t\t\t\t\t{Object.entries(schema.acl.roles).map(([roleName, role]) =>\n\t\t\t\t\t\tObject.entries(role.entities[entity.name]?.predicates ?? {}).map(([predicateName, predicate]) => (\n\t\t\t\t\t\t\t<Fragment key={roleName + '__' + predicateName}>\n\t\t\t\t\t\t\t\t<h4>{roleName}: {predicateName}</h4>\n\t\t\t\t\t\t\t\t<code>{JSON.stringify(predicate)}</code>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t)),\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>}\n\t\t</div>\n\t</div>\n)\n"],"names":["jsxs","formatEntityAnchor","jsx","SinglePermission","formatFieldAnchor","FieldType","FieldPermissions","OnDelete"],"mappings":";;;;;;;;;AAeO,MAAM,aAAa,CAAC,EAAE,QAAQ,QAAQ,WAC5C,MAAAA,2BAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IAAI,OAAO;AAAA,IACV,IAAIC,MAAAA,mBAAmB,OAAO,IAAI;AAAA,IACnC,UAAA;AAAA,MAAAC,2BAAA,IAAC,OAAI,EAAA,OAAO,sGACV,UAAA,OAAO,MACT;AAAA,MACAF,2BAAAA,KAAC,OAAI,EAAA,OAAO,6BACX,UAAA;AAAA,QAACE,2BAAA,IAAA,OAAA,EACA,0CAAC,SACA,EAAA,UAAA;AAAA,UAACA,2BAAA,IAAA,SAAA,EACA,0CAAC,MACA,EAAA,UAAA;AAAA,YAACA,2BAAA,IAAA,MAAA,EAAG,OAAO,oEAAoE,UAAI,QAAA;AAAA,YAClFA,2BAAA,IAAA,MAAA,EAAG,OAAO,oEAAoE,UAAI,QAAA;AAAA,YAClF,OAAO,KAAK,OAAO,IAAI,KAAK,EAAE,IAAI,CAAQ,SAAAA,2BAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBAE3C,OAAO;AAAA,gBAA8F,UAAA;AAAA,cAAA;AAAA,cADhG;AAAA,YAC0G,CAAA;AAAA,UAAA,EAAA,CACjH,EACD,CAAA;AAAA,0CACC,MACA,EAAA,UAAA;AAAA,YAAAA,2BAAA,IAAC,MAAG,EAAA;AAAA,2CACH,MAAG,EAAA;AAAA,YACH,OAAO,QAAQ,OAAO,IAAI,KAAK,EAAE,IAAI,CAAC,CAAC,MAAM,IAAI,MAAOA,2B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/DE,2BAAAA,IAAC,SAAI,OAAO,iBACX,yCAACK,mBAAS,EAAA,YAAwB,OAAgB,CAAA,EACnD,CAAA;AAAA,QAAA,GACD;AAAA,QACC;AAAA,MAAA,EAaF,CAAA;AAAA,IAAA;AAAA,EAAA;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityInfo.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/EntityInfo.tsx"],"sourcesContent":["import { Model, Schema } from '@contember/schema'\nimport { ReferencesMap } from '../../../schema/collectReferences'\nimport { formatEntityAnchor, formatFieldAnchor } from './utils'\nimport { SinglePermission } from './SinglePermission'\nimport { FieldType } from './FieldType'\nimport { FieldPermissions } from './FieldPermissions'\nimport { OnDelete } from './OnDelete'\nimport { Fragment, h } from 'preact'\n\ninterface EntityInfoProps {\n\tentity: Model.Entity\n\tschema: Schema\n\treferences: ReferencesMap\n}\n\nexport const EntityInfo = ({ entity, schema, references }: EntityInfoProps) => (\n\t<div class={'m-4 border border-gray-400 rounded-lg group'}\n\t\t id={formatEntityAnchor(entity.name)}>\n\t\t<div class={'font-bold text-gray-900 py-2 px-4 border-b border-gray-400 group-target:bg-yellow-100 rounded-t-lg'}>\n\t\t\t{entity.name}\n\t\t</div>\n\t\t<div class={'px-2 py-2 flex flex-wrap '}>\n\t\t\t<div>\n\t\t\t\t<table>\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th class={'text-left px-2 text-gray-500 font-normal w-[180px] max-w-[180px]'}>Name</th>\n\t\t\t\t\t\t\t<th class={'text-left px-2 text-gray-500 font-normal w-[340px] max-w-[340px]'}>Type</th>\n\t\t\t\t\t\t\t{Object.keys(schema.acl.roles).map(role => <th\n\t\t\t\t\t\t\t\tkey={role}\n\t\t\t\t\t\t\t\tclass={'text-left px-2 text-gray-500 font-normal w-[120px] max-w-[120px] text-xs truncate text-sm'}>{role}</th>)}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t{Object.entries(schema.acl.roles).map(([name, role]) => <td class={'px-2'} key={name}>\n\t\t\t\t\t\t\t<SinglePermission value={'D'}\n\t\t\t\t\t\t\t\t\t\t\t predicate={role.entities[entity.name]?.operations.delete} />\n\t\t\t\t\t\t</td>)}\n\t\t\t\t\t</tr>\n\t\t\t\t\t{Object.values(entity.fields).map(field => (\n\t\t\t\t\t\t<tr class={'even:bg-gray-100 target:bg-yellow-100'}\n\t\t\t\t\t\t\tid={formatFieldAnchor(entity.name, field.name)}\n\t\t\t\t\t\t\tkey={field.name}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<td class={'px-2 font-mono truncate w-[180px] max-w-[180px]'} title={field.name}>\n\t\t\t\t\t\t\t\t{field.name}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class={'text-gray-800 px-2 font-mono w-[420px] max-w-[420px]'}>\n\t\t\t\t\t\t\t\t<FieldType field={field} />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t{Object.entries(schema.acl.roles).map(([name, role]) => <td class={'px-2'} key={name}>\n\t\t\t\t\t\t\t\t<FieldPermissions field={field.name}\n\t\t\t\t\t\t\t\t\t\t\t\t entityPermissions={role.entities[entity.name]} />\n\t\t\t\t\t\t\t</td>)}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t))}\n\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<div class={'px-2 py-2 w-1/2'}>\n\t\t\t\t<h3 class={'text-lg text-gray-600'}>On delete behaviour:</h3>\n\t\t\t\t<p class={'text-gray-500 text-sm'}>\n\t\t\t\t\t(What happens when you attempt to delete entity {entity.name})</p>\n\t\t\t\t<div class={'mt-2 text-sm '}>\n\t\t\t\t\t<OnDelete references={references} entity={entity} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{false && <div class={'px-2 py-2 w-1/2'}>\n\t\t\t\t<h3 class={'text-lg text-gray-600'}>ACL predicates:</h3>\n\t\t\t\t<div class={'mt-2 text-sm '}>\n\t\t\t\t\t{Object.entries(schema.acl.roles).map(([roleName, role]) =>\n\t\t\t\t\t\tObject.entries(role.entities[entity.name]?.predicates ?? {}).map(([predicateName, predicate]) => (\n\t\t\t\t\t\t\t<Fragment key={roleName + '__' + predicateName}>\n\t\t\t\t\t\t\t\t<h4>{roleName}: {predicateName}</h4>\n\t\t\t\t\t\t\t\t<code>{JSON.stringify(predicate)}</code>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t)),\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>}\n\t\t</div>\n\t</div>\n)\n"],"names":[],"mappings":";;;;;;;AAeO,MAAM,aAAa,CAAC,EAAE,QAAQ,QAAQ,WAC5C,MAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IAAI,OAAO;AAAA,IACV,IAAI,mBAAmB,OAAO,IAAI;AAAA,IACnC,UAAA;AAAA,MAAA,oBAAC,OAAI,EAAA,OAAO,sGACV,UAAA,OAAO,MACT;AAAA,MACA,qBAAC,OAAI,EAAA,OAAO,6BACX,UAAA;AAAA,QAAC,oBAAA,OAAA,EACA,+BAAC,SACA,EAAA,UAAA;AAAA,UAAC,oBAAA,SAAA,EACA,+BAAC,MACA,EAAA,UAAA;AAAA,YAAC,oBAAA,MAAA,EAAG,OAAO,oEAAoE,UAAI,QAAA;AAAA,YAClF,oBAAA,MAAA,EAAG,OAAO,oEAAoE,UAAI,QAAA;AAAA,YAClF,OAAO,KAAK,OAAO,IAAI,KAAK,EAAE,IAAI,CAAQ,SAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBAE3C,OAAO;AAAA,gBAA8F,UAAA;AAAA,cAAA;AAAA,cADhG;AAAA,YAAA,CAC0G;AAAA,UAAA,EAAA,CACjH,EACD,CAAA;AAAA,+BACC,MACA,EAAA,UAAA;AAAA,YAAA,oBAAC,MAAG,EAAA;AAAA,g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C/D,oBAAC,SAAI,OAAO,iBACX,8BAAC,UAAS,EAAA,YAAwB,QAAgB,EACnD,CAAA;AAAA,QAAA,GACD;AAAA,QACC;AAAA,MAAA,GAaF;AAAA,IAAA;AAAA,EAAA;AACD;"}
1
+ {"version":3,"file":"EntityInfo.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/EntityInfo.tsx"],"sourcesContent":["import { Model, Schema } from '@contember/schema'\nimport { ReferencesMap } from '../../../schema/collectReferences'\nimport { formatEntityAnchor, formatFieldAnchor } from './utils'\nimport { SinglePermission } from './SinglePermission'\nimport { FieldType } from './FieldType'\nimport { FieldPermissions } from './FieldPermissions'\nimport { OnDelete } from './OnDelete'\nimport { Fragment, h } from 'preact'\n\ninterface EntityInfoProps {\n\tentity: Model.Entity\n\tschema: Schema\n\treferences: ReferencesMap\n}\n\nexport const EntityInfo = ({ entity, schema, references }: EntityInfoProps) => (\n\t<div class={'m-4 border border-gray-400 rounded-lg group'}\n\t\t id={formatEntityAnchor(entity.name)}>\n\t\t<div class={'font-bold text-gray-900 py-2 px-4 border-b border-gray-400 group-target:bg-yellow-100 rounded-t-lg'}>\n\t\t\t{entity.name}\n\t\t</div>\n\t\t<div class={'px-2 py-2 flex flex-wrap '}>\n\t\t\t<div>\n\t\t\t\t<table>\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th class={'text-left px-2 text-gray-500 font-normal w-[180px] max-w-[180px]'}>Name</th>\n\t\t\t\t\t\t\t<th class={'text-left px-2 text-gray-500 font-normal w-[340px] max-w-[340px]'}>Type</th>\n\t\t\t\t\t\t\t{Object.keys(schema.acl.roles).map(role => <th\n\t\t\t\t\t\t\t\tkey={role}\n\t\t\t\t\t\t\t\tclass={'text-left px-2 text-gray-500 font-normal w-[120px] max-w-[120px] text-xs truncate text-sm'}>{role}</th>)}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t{Object.entries(schema.acl.roles).map(([name, role]) => <td class={'px-2'} key={name}>\n\t\t\t\t\t\t\t<SinglePermission value={'D'}\n\t\t\t\t\t\t\t\t\t\t\t predicate={role.entities[entity.name]?.operations.delete} />\n\t\t\t\t\t\t</td>)}\n\t\t\t\t\t</tr>\n\t\t\t\t\t{Object.values(entity.fields).map(field => (\n\t\t\t\t\t\t<tr class={'even:bg-gray-100 target:bg-yellow-100'}\n\t\t\t\t\t\t\tid={formatFieldAnchor(entity.name, field.name)}\n\t\t\t\t\t\t\tkey={field.name}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<td class={'px-2 font-mono truncate w-[180px] max-w-[180px]'} title={field.name}>\n\t\t\t\t\t\t\t\t{field.name}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class={'text-gray-800 px-2 font-mono w-[420px] max-w-[420px]'}>\n\t\t\t\t\t\t\t\t<FieldType field={field} />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t{Object.entries(schema.acl.roles).map(([name, role]) => <td class={'px-2'} key={name}>\n\t\t\t\t\t\t\t\t<FieldPermissions field={field.name}\n\t\t\t\t\t\t\t\t\t\t\t\t entityPermissions={role.entities[entity.name]} />\n\t\t\t\t\t\t\t</td>)}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t))}\n\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<div class={'px-2 py-2 w-1/2'}>\n\t\t\t\t<h3 class={'text-lg text-gray-600'}>On delete behaviour:</h3>\n\t\t\t\t<p class={'text-gray-500 text-sm'}>\n\t\t\t\t\t(What happens when you attempt to delete entity {entity.name})</p>\n\t\t\t\t<div class={'mt-2 text-sm '}>\n\t\t\t\t\t<OnDelete references={references} entity={entity} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{false && <div class={'px-2 py-2 w-1/2'}>\n\t\t\t\t<h3 class={'text-lg text-gray-600'}>ACL predicates:</h3>\n\t\t\t\t<div class={'mt-2 text-sm '}>\n\t\t\t\t\t{Object.entries(schema.acl.roles).map(([roleName, role]) =>\n\t\t\t\t\t\tObject.entries(role.entities[entity.name]?.predicates ?? {}).map(([predicateName, predicate]) => (\n\t\t\t\t\t\t\t<Fragment key={roleName + '__' + predicateName}>\n\t\t\t\t\t\t\t\t<h4>{roleName}: {predicateName}</h4>\n\t\t\t\t\t\t\t\t<code>{JSON.stringify(predicate)}</code>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t)),\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>}\n\t\t</div>\n\t</div>\n)\n"],"names":[],"mappings":";;;;;;;AAeO,MAAM,aAAa,CAAC,EAAE,QAAQ,QAAQ,WAC5C,MAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IAAI,OAAO;AAAA,IACV,IAAI,mBAAmB,OAAO,IAAI;AAAA,IACnC,UAAA;AAAA,MAAA,oBAAC,OAAI,EAAA,OAAO,sGACV,UAAA,OAAO,MACT;AAAA,MACA,qBAAC,OAAI,EAAA,OAAO,6BACX,UAAA;AAAA,QAAC,oBAAA,OAAA,EACA,+BAAC,SACA,EAAA,UAAA;AAAA,UAAC,oBAAA,SAAA,EACA,+BAAC,MACA,EAAA,UAAA;AAAA,YAAC,oBAAA,MAAA,EAAG,OAAO,oEAAoE,UAAI,QAAA;AAAA,YAClF,oBAAA,MAAA,EAAG,OAAO,oEAAoE,UAAI,QAAA;AAAA,YAClF,OAAO,KAAK,OAAO,IAAI,KAAK,EAAE,IAAI,CAAQ,SAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBAE3C,OAAO;AAAA,gBAA8F,UAAA;AAAA,cAAA;AAAA,cADhG;AAAA,YAC0G,CAAA;AAAA,UAAA,EAAA,CACjH,EACD,CAAA;AAAA,+BACC,MACA,EAAA,UAAA;AAAA,YAAA,oBAAC,MAAG,EAAA;AAAA,gCACH,MAAG,EAAA;AAAA,YACH,OAAO,Q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C,UAAS,EAAA,YAAwB,OAAgB,CAAA,EACnD,CAAA;AAAA,QAAA,GACD;AAAA,QACC;AAAA,MAAA,EAaF,CAAA;AAAA,IAAA;AAAA,EAAA;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldPermissions.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/FieldPermissions.tsx"],"sourcesContent":["import { Fragment, h } from 'preact'\nimport { Acl } from '@contember/schema'\nimport { SinglePermission } from './SinglePermission'\n\nexport const FieldPermissions = ({ entityPermissions, field }: { entityPermissions?: Acl.EntityPermissions; field: string }) => {\n\tconst readPermissions = entityPermissions?.operations.read?.[field]\n\tconst updatePermissions = entityPermissions?.operations.update?.[field]\n\tconst createPermissions = entityPermissions?.operations.create?.[field]\n\treturn <Fragment>\n\t\t<SinglePermission value={'C'} predicate={createPermissions} />\n\t\t<SinglePermission value={'R'} predicate={readPermissions} />\n\t\t<SinglePermission value={'U'} predicate={updatePermissions} />\n\t</Fragment>\n}\n"],"names":["Fragment","jsx","SinglePermission"],"mappings":";;;;;AAIO,MAAM,mBAAoB,CAAC,EAAE,mBAAmB,YAA0E;AAChI,QAAM,kBAAkB,mBAAmB,WAAW,OAAO,KAAK;AAClE,QAAM,oBAAoB,mBAAmB,WAAW,SAAS,KAAK;AACtE,QAAM,oBAAoB,mBAAmB,WAAW,SAAS,KAAK;AACtE,yCAAQA,iBACP,EAAA,UAAA;AAAA,IAAAC,2BAAA,IAACC,iBAAiB,kBAAA,EAAA,OAAO,KAAK,WAAW,mBAAmB;AAAA,IAC3DD,2BAAA,IAAAC,iBAAA,kBAAA,EAAiB,OAAO,KAAK,WAAW,iBAAiB;AAAA,IACzDD,2BAAA,IAAAC,iBAAA,kBAAA,EAAiB,OAAO,KAAK,WAAW,mBAAmB;AAAA,EAC7D,EAAA,CAAA;AACD;;"}
1
+ {"version":3,"file":"FieldPermissions.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/FieldPermissions.tsx"],"sourcesContent":["import { Fragment, h } from 'preact'\nimport { Acl } from '@contember/schema'\nimport { SinglePermission } from './SinglePermission'\n\nexport const FieldPermissions = ({ entityPermissions, field }: { entityPermissions?: Acl.EntityPermissions; field: string }) => {\n\tconst readPermissions = entityPermissions?.operations.read?.[field]\n\tconst updatePermissions = entityPermissions?.operations.update?.[field]\n\tconst createPermissions = entityPermissions?.operations.create?.[field]\n\treturn <Fragment>\n\t\t<SinglePermission value={'C'} predicate={createPermissions} />\n\t\t<SinglePermission value={'R'} predicate={readPermissions} />\n\t\t<SinglePermission value={'U'} predicate={updatePermissions} />\n\t</Fragment>\n}\n"],"names":["Fragment","jsx","SinglePermission"],"mappings":";;;;;AAIO,MAAM,mBAAoB,CAAC,EAAE,mBAAmB,YAA0E;AAChI,QAAM,kBAAkB,mBAAmB,WAAW,OAAO,KAAK;AAClE,QAAM,oBAAoB,mBAAmB,WAAW,SAAS,KAAK;AACtE,QAAM,oBAAoB,mBAAmB,WAAW,SAAS,KAAK;AACtE,yCAAQA,iBACP,EAAA,UAAA;AAAA,IAAAC,2BAAA,IAACC,iBAAiB,kBAAA,EAAA,OAAO,KAAK,WAAW,mBAAmB;AAAA,IAC3DD,2BAAA,IAAAC,iBAAA,kBAAA,EAAiB,OAAO,KAAK,WAAW,iBAAiB;AAAA,IACzDD,2BAAA,IAAAC,iBAAA,kBAAA,EAAiB,OAAO,KAAK,WAAW,kBAAmB,CAAA;AAAA,EAAA,GAC7D;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldPermissions.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/FieldPermissions.tsx"],"sourcesContent":["import { Fragment, h } from 'preact'\nimport { Acl } from '@contember/schema'\nimport { SinglePermission } from './SinglePermission'\n\nexport const FieldPermissions = ({ entityPermissions, field }: { entityPermissions?: Acl.EntityPermissions; field: string }) => {\n\tconst readPermissions = entityPermissions?.operations.read?.[field]\n\tconst updatePermissions = entityPermissions?.operations.update?.[field]\n\tconst createPermissions = entityPermissions?.operations.create?.[field]\n\treturn <Fragment>\n\t\t<SinglePermission value={'C'} predicate={createPermissions} />\n\t\t<SinglePermission value={'R'} predicate={readPermissions} />\n\t\t<SinglePermission value={'U'} predicate={updatePermissions} />\n\t</Fragment>\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,mBAAoB,CAAC,EAAE,mBAAmB,YAA0E;AAChI,QAAM,kBAAkB,mBAAmB,WAAW,OAAO,KAAK;AAClE,QAAM,oBAAoB,mBAAmB,WAAW,SAAS,KAAK;AACtE,QAAM,oBAAoB,mBAAmB,WAAW,SAAS,KAAK;AACtE,8BAAQ,UACP,EAAA,UAAA;AAAA,IAAA,oBAAC,kBAAiB,EAAA,OAAO,KAAK,WAAW,mBAAmB;AAAA,IAC3D,oBAAA,kBAAA,EAAiB,OAAO,KAAK,WAAW,iBAAiB;AAAA,IACzD,oBAAA,kBAAA,EAAiB,OAAO,KAAK,WAAW,mBAAmB;AAAA,EAC7D,EAAA,CAAA;AACD;"}
1
+ {"version":3,"file":"FieldPermissions.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/FieldPermissions.tsx"],"sourcesContent":["import { Fragment, h } from 'preact'\nimport { Acl } from '@contember/schema'\nimport { SinglePermission } from './SinglePermission'\n\nexport const FieldPermissions = ({ entityPermissions, field }: { entityPermissions?: Acl.EntityPermissions; field: string }) => {\n\tconst readPermissions = entityPermissions?.operations.read?.[field]\n\tconst updatePermissions = entityPermissions?.operations.update?.[field]\n\tconst createPermissions = entityPermissions?.operations.create?.[field]\n\treturn <Fragment>\n\t\t<SinglePermission value={'C'} predicate={createPermissions} />\n\t\t<SinglePermission value={'R'} predicate={readPermissions} />\n\t\t<SinglePermission value={'U'} predicate={updatePermissions} />\n\t</Fragment>\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,mBAAoB,CAAC,EAAE,mBAAmB,YAA0E;AAChI,QAAM,kBAAkB,mBAAmB,WAAW,OAAO,KAAK;AAClE,QAAM,oBAAoB,mBAAmB,WAAW,SAAS,KAAK;AACtE,QAAM,oBAAoB,mBAAmB,WAAW,SAAS,KAAK;AACtE,8BAAQ,UACP,EAAA,UAAA;AAAA,IAAA,oBAAC,kBAAiB,EAAA,OAAO,KAAK,WAAW,mBAAmB;AAAA,IAC3D,oBAAA,kBAAA,EAAiB,OAAO,KAAK,WAAW,iBAAiB;AAAA,IACzD,oBAAA,kBAAA,EAAiB,OAAO,KAAK,WAAW,kBAAmB,CAAA;AAAA,EAAA,GAC7D;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldType.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/FieldType.tsx"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { h, Fragment } from 'preact'\nimport { EntityLink } from './EntityLink'\nimport { FieldLink } from './FieldLink'\n\nexport const FieldType = ({ field }: { field: Model.AnyField }) => {\n\tif (field.type === 'ManyHasMany') {\n\t\treturn <>\n\t\t\t<EntityLink entity={field.target}/>[]{' '}\n\t\t\t<TargetField field={field}/> (m:n)\n\t\t</>\n\n\t} else if (field.type === 'OneHasMany') {\n\t\treturn <>\n\t\t\t<EntityLink entity={field.target}/>[]{' '}\n\t\t\t<TargetField field={field}/> (1:n)\n\t\t</>\n\n\t} else if (field.type === 'OneHasOne') {\n\t\treturn <>\n\t\t\t<NullableMark field={field} />\n\t\t\t<EntityLink entity={field.target}/>{' '}\n\t\t\t<TargetField field={field}/> (1:1)\n\t\t</>\n\n\t} else if (field.type === 'ManyHasOne') {\n\t\treturn <>\n\t\t\t<NullableMark field={field} />\n\t\t\t<EntityLink entity={field.target}/>{' '}\n\t\t\t<TargetField field={field}/> (m:1)\n\t\t</>\n\n\t} else {\n\t\treturn <>\n\t\t\t<NullableMark field={field} />\n\t\t\t{field.type}\n\t\t</>\n\n\t}\n}\n\nconst TargetField = ({ field }: {field: Model.AnyRelation}) => {\n\tif ('ownedBy' in field) {\n\t\treturn <FieldLink entity={field.target} field={field.ownedBy} noEntityLabel />\n\t}\n\tif (field.inversedBy) {\n\t\treturn <FieldLink entity={field.target} field={field.inversedBy} noEntityLabel />\n\t}\n\treturn null\n}\n\nconst NullableMark = (props: { field: Model.NullableRelation | Model.AnyColumn }) => {\n\treturn props.field.nullable ? <span class={'font-bold color-black'}>? </span> : null\n}\n"],"names":["jsxs","Fragment","jsx","EntityLink","FieldLink"],"mappings":";;;;;AAKO,MAAM,YAAY,CAAC,EAAE,YAAuC;AAC9D,MAAA,MAAM,SAAS,eAAe;AACjC,WACCA,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,MAACC,2BAAAA,IAAAC,WAAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAE;AAAA,MAAG;AAAA,MACtCD,+BAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAC7B,EAAA,CAAA;AAAA,EAAA,WAEU,MAAM,SAAS,cAAc;AACvC,WACCF,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,MAACC,2BAAAA,IAAAC,WAAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAE;AAAA,MAAG;AAAA,MACtCD,+BAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAC7B,EAAA,CAAA;AAAA,EAAA,WAEU,MAAM,SAAS,aAAa;AACtC,WACCF,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,MAAAC,+BAAC,gBAAa,OAAc;AAAA,MAC3BA,2BAAAA,IAAAC,WAAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAG;AAAA,MACpCD,+BAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAC7B,EAAA,CAAA;AAAA,EAAA,WAEU,MAAM,SAAS,cAAc;AACvC,WACCF,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,MAAAC,+BAAC,gBAAa,OAAc;AAAA,MAC3BA,2BAAAA,IAAAC,WAAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAG;AAAA,MACpCD,+BAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAC7B,EAAA,CAAA;AAAA,EAAA,OAEM;AACN,WACCF,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,MAAAC,+BAAC,gBAAa,OAAc;AAAA,MAC3B,MAAM;AAAA,IACR,EAAA,CAAA;AAAA,EAED;AACD;AAEA,MAAM,cAAc,CAAC,EAAE,YAAwC;AAC9D,MAAI,aAAa,OAAO;AAChB,WAAAA,+BAACE,UAAAA,aAAU,QAAQ,MAAM,QAAQ,OAAO,MAAM,SAAS,eAAa,KAAC,CAAA;AAAA,EAC7E;AACA,MAAI,MAAM,YAAY;AACd,WAAAF,+BAACE,UAAAA,aAAU,QAAQ,MAAM,QAAQ,OAAO,MAAM,YAAY,eAAa,KAAC,CAAA;AAAA,EAChF;AACO,SAAA;AACR;AAEA,MAAM,eAAe,CAAC,UAA+D;AAC7E,SAAA,MAAM,MAAM,WAAWF,2BAAA,IAAC,UAAK,OAAO,yBAAyB,eAAE,CAAA,IAAU;AACjF;;"}
1
+ {"version":3,"file":"FieldType.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/FieldType.tsx"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { h, Fragment } from 'preact'\nimport { EntityLink } from './EntityLink'\nimport { FieldLink } from './FieldLink'\n\nexport const FieldType = ({ field }: { field: Model.AnyField }) => {\n\tif (field.type === 'ManyHasMany') {\n\t\treturn <>\n\t\t\t<EntityLink entity={field.target}/>[]{' '}\n\t\t\t<TargetField field={field}/> (m:n)\n\t\t</>\n\n\t} else if (field.type === 'OneHasMany') {\n\t\treturn <>\n\t\t\t<EntityLink entity={field.target}/>[]{' '}\n\t\t\t<TargetField field={field}/> (1:n)\n\t\t</>\n\n\t} else if (field.type === 'OneHasOne') {\n\t\treturn <>\n\t\t\t<NullableMark field={field} />\n\t\t\t<EntityLink entity={field.target}/>{' '}\n\t\t\t<TargetField field={field}/> (1:1)\n\t\t</>\n\n\t} else if (field.type === 'ManyHasOne') {\n\t\treturn <>\n\t\t\t<NullableMark field={field} />\n\t\t\t<EntityLink entity={field.target}/>{' '}\n\t\t\t<TargetField field={field}/> (m:1)\n\t\t</>\n\n\t} else {\n\t\treturn <>\n\t\t\t<NullableMark field={field} />\n\t\t\t{field.type}\n\t\t</>\n\n\t}\n}\n\nconst TargetField = ({ field }: {field: Model.AnyRelation}) => {\n\tif ('ownedBy' in field) {\n\t\treturn <FieldLink entity={field.target} field={field.ownedBy} noEntityLabel />\n\t}\n\tif (field.inversedBy) {\n\t\treturn <FieldLink entity={field.target} field={field.inversedBy} noEntityLabel />\n\t}\n\treturn null\n}\n\nconst NullableMark = (props: { field: Model.NullableRelation | Model.AnyColumn }) => {\n\treturn props.field.nullable ? <span class={'font-bold color-black'}>? </span> : null\n}\n"],"names":["jsxs","Fragment","jsx","EntityLink","FieldLink"],"mappings":";;;;;AAKO,MAAM,YAAY,CAAC,EAAE,YAAuC;AAC9D,MAAA,MAAM,SAAS,eAAe;AACjC,WACCA,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,MAACC,2BAAAA,IAAAC,WAAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAE;AAAA,MAAG;AAAA,MACtCD,+BAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAAA,GAC7B;AAAA,EAAA,WAEU,MAAM,SAAS,cAAc;AACvC,WACCF,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,MAACC,2BAAAA,IAAAC,WAAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAE;AAAA,MAAG;AAAA,MACtCD,+BAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAAA,GAC7B;AAAA,EAAA,WAEU,MAAM,SAAS,aAAa;AACtC,WACCF,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,MAAAC,+BAAC,gBAAa,OAAc;AAAA,MAC3BA,2BAAAA,IAAAC,WAAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAG;AAAA,MACpCD,+BAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAAA,GAC7B;AAAA,EAAA,WAEU,MAAM,SAAS,cAAc;AACvC,WACCF,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,MAAAC,+BAAC,gBAAa,OAAc;AAAA,MAC3BA,2BAAAA,IAAAC,WAAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAG;AAAA,MACpCD,+BAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAAA,GAC7B;AAAA,EAAA,OAEM;AACN,WACCF,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,MAAAC,+BAAC,gBAAa,OAAc;AAAA,MAC3B,MAAM;AAAA,IAAA,GACR;AAAA,EAAA;AAGF;AAEA,MAAM,cAAc,CAAC,EAAE,YAAwC;AAC9D,MAAI,aAAa,OAAO;AAChB,WAAAA,+BAACE,UAAAA,aAAU,QAAQ,MAAM,QAAQ,OAAO,MAAM,SAAS,eAAa,KAAC,CAAA;AAAA,EAAA;AAE7E,MAAI,MAAM,YAAY;AACd,WAAAF,+BAACE,UAAAA,aAAU,QAAQ,MAAM,QAAQ,OAAO,MAAM,YAAY,eAAa,KAAC,CAAA;AAAA,EAAA;AAEzE,SAAA;AACR;AAEA,MAAM,eAAe,CAAC,UAA+D;AAC7E,SAAA,MAAM,MAAM,WAAWF,2BAAA,IAAC,UAAK,OAAO,yBAAyB,gBAAE,IAAU;AACjF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldType.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/FieldType.tsx"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { h, Fragment } from 'preact'\nimport { EntityLink } from './EntityLink'\nimport { FieldLink } from './FieldLink'\n\nexport const FieldType = ({ field }: { field: Model.AnyField }) => {\n\tif (field.type === 'ManyHasMany') {\n\t\treturn <>\n\t\t\t<EntityLink entity={field.target}/>[]{' '}\n\t\t\t<TargetField field={field}/> (m:n)\n\t\t</>\n\n\t} else if (field.type === 'OneHasMany') {\n\t\treturn <>\n\t\t\t<EntityLink entity={field.target}/>[]{' '}\n\t\t\t<TargetField field={field}/> (1:n)\n\t\t</>\n\n\t} else if (field.type === 'OneHasOne') {\n\t\treturn <>\n\t\t\t<NullableMark field={field} />\n\t\t\t<EntityLink entity={field.target}/>{' '}\n\t\t\t<TargetField field={field}/> (1:1)\n\t\t</>\n\n\t} else if (field.type === 'ManyHasOne') {\n\t\treturn <>\n\t\t\t<NullableMark field={field} />\n\t\t\t<EntityLink entity={field.target}/>{' '}\n\t\t\t<TargetField field={field}/> (m:1)\n\t\t</>\n\n\t} else {\n\t\treturn <>\n\t\t\t<NullableMark field={field} />\n\t\t\t{field.type}\n\t\t</>\n\n\t}\n}\n\nconst TargetField = ({ field }: {field: Model.AnyRelation}) => {\n\tif ('ownedBy' in field) {\n\t\treturn <FieldLink entity={field.target} field={field.ownedBy} noEntityLabel />\n\t}\n\tif (field.inversedBy) {\n\t\treturn <FieldLink entity={field.target} field={field.inversedBy} noEntityLabel />\n\t}\n\treturn null\n}\n\nconst NullableMark = (props: { field: Model.NullableRelation | Model.AnyColumn }) => {\n\treturn props.field.nullable ? <span class={'font-bold color-black'}>? </span> : null\n}\n"],"names":[],"mappings":";;;AAKO,MAAM,YAAY,CAAC,EAAE,YAAuC;AAC9D,MAAA,MAAM,SAAS,eAAe;AACjC,WACC,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAC,oBAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAE;AAAA,MAAG;AAAA,MACtC,oBAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAC7B,EAAA,CAAA;AAAA,EAAA,WAEU,MAAM,SAAS,cAAc;AACvC,WACC,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAC,oBAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAE;AAAA,MAAG;AAAA,MACtC,oBAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAC7B,EAAA,CAAA;AAAA,EAAA,WAEU,MAAM,SAAS,aAAa;AACtC,WACC,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA,oBAAC,gBAAa,OAAc;AAAA,MAC3B,oBAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAG;AAAA,MACpC,oBAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAC7B,EAAA,CAAA;AAAA,EAAA,WAEU,MAAM,SAAS,cAAc;AACvC,WACC,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA,oBAAC,gBAAa,OAAc;AAAA,MAC3B,oBAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAG;AAAA,MACpC,oBAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAC7B,EAAA,CAAA;AAAA,EAAA,OAEM;AACN,WACC,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA,oBAAC,gBAAa,OAAc;AAAA,MAC3B,MAAM;AAAA,IACR,EAAA,CAAA;AAAA,EAED;AACD;AAEA,MAAM,cAAc,CAAC,EAAE,YAAwC;AAC9D,MAAI,aAAa,OAAO;AAChB,WAAA,oBAAC,aAAU,QAAQ,MAAM,QAAQ,OAAO,MAAM,SAAS,eAAa,KAAC,CAAA;AAAA,EAC7E;AACA,MAAI,MAAM,YAAY;AACd,WAAA,oBAAC,aAAU,QAAQ,MAAM,QAAQ,OAAO,MAAM,YAAY,eAAa,KAAC,CAAA;AAAA,EAChF;AACO,SAAA;AACR;AAEA,MAAM,eAAe,CAAC,UAA+D;AAC7E,SAAA,MAAM,MAAM,WAAW,oBAAC,UAAK,OAAO,yBAAyB,eAAE,CAAA,IAAU;AACjF;"}
1
+ {"version":3,"file":"FieldType.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/FieldType.tsx"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { h, Fragment } from 'preact'\nimport { EntityLink } from './EntityLink'\nimport { FieldLink } from './FieldLink'\n\nexport const FieldType = ({ field }: { field: Model.AnyField }) => {\n\tif (field.type === 'ManyHasMany') {\n\t\treturn <>\n\t\t\t<EntityLink entity={field.target}/>[]{' '}\n\t\t\t<TargetField field={field}/> (m:n)\n\t\t</>\n\n\t} else if (field.type === 'OneHasMany') {\n\t\treturn <>\n\t\t\t<EntityLink entity={field.target}/>[]{' '}\n\t\t\t<TargetField field={field}/> (1:n)\n\t\t</>\n\n\t} else if (field.type === 'OneHasOne') {\n\t\treturn <>\n\t\t\t<NullableMark field={field} />\n\t\t\t<EntityLink entity={field.target}/>{' '}\n\t\t\t<TargetField field={field}/> (1:1)\n\t\t</>\n\n\t} else if (field.type === 'ManyHasOne') {\n\t\treturn <>\n\t\t\t<NullableMark field={field} />\n\t\t\t<EntityLink entity={field.target}/>{' '}\n\t\t\t<TargetField field={field}/> (m:1)\n\t\t</>\n\n\t} else {\n\t\treturn <>\n\t\t\t<NullableMark field={field} />\n\t\t\t{field.type}\n\t\t</>\n\n\t}\n}\n\nconst TargetField = ({ field }: {field: Model.AnyRelation}) => {\n\tif ('ownedBy' in field) {\n\t\treturn <FieldLink entity={field.target} field={field.ownedBy} noEntityLabel />\n\t}\n\tif (field.inversedBy) {\n\t\treturn <FieldLink entity={field.target} field={field.inversedBy} noEntityLabel />\n\t}\n\treturn null\n}\n\nconst NullableMark = (props: { field: Model.NullableRelation | Model.AnyColumn }) => {\n\treturn props.field.nullable ? <span class={'font-bold color-black'}>? </span> : null\n}\n"],"names":[],"mappings":";;;AAKO,MAAM,YAAY,CAAC,EAAE,YAAuC;AAC9D,MAAA,MAAM,SAAS,eAAe;AACjC,WACC,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAC,oBAAA,YAAA,EAAW,QAAQ,MAAM,OAAO,CAAA;AAAA,MAAE;AAAA,MAAG;AAAA,MACtC,oBAAC,eAAY,OAAa;AAAA,MAAE;AAAA,IAAA,GAC7B;AAAA,EAAA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1 @@
1
- {"version":3,"file":"OnDelete.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/OnDelete.tsx"],"sourcesContent":["import { h, Fragment } from 'preact'\nimport { Model } from '@contember/schema'\nimport { ReferenceMapEntry, ReferencesMap } from '../../../schema/collectReferences'\nimport { FieldLink } from './FieldLink'\nimport { EntityLink } from './EntityLink'\n\nconst sortReferences = (a: ReferenceMapEntry, b: ReferenceMapEntry) =>\n\ta.owningRelation.joiningColumn.onDelete.localeCompare(b.owningRelation.joiningColumn.onDelete)\n\t|| a.owningEntity.name.localeCompare(b.owningEntity.name)\n\t|| a.owningRelation.name.localeCompare(b.owningRelation.name)\n\nexport const OnDelete = ({ references, entity, visited = [] }: { references: ReferencesMap; entity: Model.Entity; visited?: Model.Entity[] }) => {\n\tconst referencedFrom = references[entity.name]\n\tif (referencedFrom.length === 0) {\n\t\tif (visited.length !== 0) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<span class={'bg-green-200 text-gray-600 p-1 rounded'}>\n\t\t\t\tThis entity is not referenced from any other entity.\n\t\t\t</span>\n\t\t)\n\t}\n\n\tif (visited.includes(entity)) {\n\t\treturn (\n\t\t\t<ul class={'ml-4'}>\n\t\t\t\t<li class={'italic'}>(recursion)</li>\n\t\t\t</ul>\n\t\t)\n\t}\n\n\treturn (\n\t\t<ul class={visited.length > 0 ? 'ml-4' : ''}>\n\t\t\t{referencedFrom\n\t\t\t\t.sort(sortReferences)\n\t\t\t\t.map(it => {\n\t\t\t\t\tconst inverseDescr = it.targetRelation\n\t\t\t\t\t\t? <>see <FieldLink entity={entity.name} field={it.targetRelation.name} /></>\n\t\t\t\t\t\t: 'no inverse side'\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'restrict') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-black text-white px-1'}>Fails</span> when referenced from\n\t\t\t\t\t\t\t\t{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />\n\t\t\t\t\t\t\t\t{' '}({inverseDescr})\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'set null') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-blue-400 text-white px-1'}>Sets null</span> at\n\t\t\t\t\t\t\t\t{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />\n\t\t\t\t\t\t\t\t{' '}({inverseDescr})\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'cascade') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-red-400 text-white px-1'}>Deletes</span> <EntityLink entity={it.owningEntity.name} />\n\t\t\t\t\t\t\t\t{' '}connected using\n\t\t\t\t\t\t\t\t{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} noEntityLabel />\n\t\t\t\t\t\t\t\t{' '}({inverseDescr})\n\t\t\t\t\t\t\t\t<OnDelete entity={it.owningEntity} visited={[...visited, entity]} references={references} />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t})}\n\t\t</ul>)\n}\n"],"names":["jsx","jsxs","Fragment","FieldLink","EntityLink"],"mappings":";;;;;AAMA,MAAM,iBAAiB,CAAC,GAAsB,MAC7C,EAAE,eAAe,cAAc,SAAS,cAAc,EAAE,eAAe,cAAc,QAAQ,KAC1F,EAAE,aAAa,KAAK,cAAc,EAAE,aAAa,IAAI,KACrD,EAAE,eAAe,KAAK,cAAc,EAAE,eAAe,IAAI;AAE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AAS,aAAA;AAAA,QAAO;AAAA,QAC3D;AAAA,QAAIA,2BAAAA,IAACG,uBAAU,QAAQ,GAAG,aAAa,MAAM,OAAO,GAAG,eAAe,KAAM,CAAA;AAAA,QAC5E;AAAA,QAAI;AAAA,QAAE;AAAA,QAAa;AAAA,MAAA,KAHZ,GAAG,aAAa,OAAO,MAAM,GAAG,eAAe,IAIxD;AAAA,IAEF;AACA,QAAI,GAAG,eAAe,cAAc,aAAa,WAAW;AAC3D,6CACE,MACA,EAAA,UAAA;AAAA,QAACH,2BAAA,IAAA,QAAA,EAAK,OAAO,8BAA8B,UAAO,WAAA;AAAA,QAAO;AAAA,QAAEA,2BAAA,IAAAI,WAAA,YAAA,EAAW,QAAQ,GAAG,aAAa,MAAM;AAAA,QACnG;AAAA,QAAI;AAAA,QACJ;AAAA,QAAIJ,2BAAAA,IAACG,UAAAA,WAAU,EAAA,QAAQ,GAAG,aAAa,MAAM,OAAO,GAAG,eAAe,MAAM,eAAa,KAAC,CAAA;AAAA,QAC1F;AAAA,QAAI;AAAA,QAAE;AAAA,QAAa;AAAA,QACpBH,2BAAAA,IAAC,UAAS,EAAA,QAAQ,GAAG,cAAc,SAAS,CAAC,GAAG,SAAS,MAAM,GAAG,WAAwB,CAAA;AAAA,MAAA,KALlF,GAAG,aAAa,OAAO,MAAM,GAAG,eAAe,IAMxD;AAAA,IAEF;AAAA,EACA,CAAA,EACH,CAAA;AACF;;"}
1
+ {"version":3,"file":"OnDelete.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/OnDelete.tsx"],"sourcesContent":["import { h, Fragment } from 'preact'\nimport { Model } from '@contember/schema'\nimport { ReferenceMapEntry, ReferencesMap } from '../../../schema/collectReferences'\nimport { FieldLink } from './FieldLink'\nimport { EntityLink } from './EntityLink'\n\nconst sortReferences = (a: ReferenceMapEntry, b: ReferenceMapEntry) =>\n\ta.owningRelation.joiningColumn.onDelete.localeCompare(b.owningRelation.joiningColumn.onDelete)\n\t|| a.owningEntity.name.localeCompare(b.owningEntity.name)\n\t|| a.owningRelation.name.localeCompare(b.owningRelation.name)\n\nexport const OnDelete = ({ references, entity, visited = [] }: { references: ReferencesMap; entity: Model.Entity; visited?: Model.Entity[] }) => {\n\tconst referencedFrom = references[entity.name]\n\tif (referencedFrom.length === 0) {\n\t\tif (visited.length !== 0) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<span class={'bg-green-200 text-gray-600 p-1 rounded'}>\n\t\t\t\tThis entity is not referenced from any other entity.\n\t\t\t</span>\n\t\t)\n\t}\n\n\tif (visited.includes(entity)) {\n\t\treturn (\n\t\t\t<ul class={'ml-4'}>\n\t\t\t\t<li class={'italic'}>(recursion)</li>\n\t\t\t</ul>\n\t\t)\n\t}\n\n\treturn (\n\t\t<ul class={visited.length > 0 ? 'ml-4' : ''}>\n\t\t\t{referencedFrom\n\t\t\t\t.sort(sortReferences)\n\t\t\t\t.map(it => {\n\t\t\t\t\tconst inverseDescr = it.targetRelation\n\t\t\t\t\t\t? <>see <FieldLink entity={entity.name} field={it.targetRelation.name} /></>\n\t\t\t\t\t\t: 'no inverse side'\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'restrict') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-black text-white px-1'}>Fails</span> when referenced from\n\t\t\t\t\t\t\t\t{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />\n\t\t\t\t\t\t\t\t{' '}({inverseDescr})\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'set null') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-blue-400 text-white px-1'}>Sets null</span> at\n\t\t\t\t\t\t\t\t{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />\n\t\t\t\t\t\t\t\t{' '}({inverseDescr})\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'cascade') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-red-400 text-white px-1'}>Deletes</span> <EntityLink entity={it.owningEntity.name} />\n\t\t\t\t\t\t\t\t{' '}connected using\n\t\t\t\t\t\t\t\t{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} noEntityLabel />\n\t\t\t\t\t\t\t\t{' '}({inverseDescr})\n\t\t\t\t\t\t\t\t<OnDelete entity={it.owningEntity} visited={[...visited, entity]} references={references} />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t})}\n\t\t</ul>)\n}\n"],"names":["jsx","jsxs","Fragment","FieldLink","EntityLink"],"mappings":";;;;;AAMA,MAAM,iBAAiB,CAAC,GAAsB,MAC7C,EAAE,eAAe,cAAc,SAAS,cAAc,EAAE,eAAe,cAAc,QAAQ,KAC1F,EAAE,aAAa,KAAK,cAAc,EAAE,aAAa,IAAI,KACrD,EAAE,eAAe,KAAK,cAAc,EAAE,eAAe,IAAI;AAEhD,MAAA,WAAW,CAAC,EAAE,YAAY,QAAQ,UAAU,SAAwF;AAC1I,QAAA,iBAAiB,WAAW,OAAO,IAAI;AACzC,MAAA,eAAe,WAAW,GAAG;AAC5B,QAAA,QAAQ,WAAW,GAAG;AAClB,aAAA;AAAA,IAAA;AAER,WACEA,2BAAAA,IAAA,QAAA,EAAK,OAAO,0CAA0C,UAEvD,wDAAA;AAAA,EAAA;AAIE,MAAA,QAAQ,SAAS,MAAM,GAAG;AAE5B,WAAAA,2BAAA,IAAC,QAAG,OAAO,QACV,yCAAC,M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BAAA,IAAA,QAAA,EAAK,OAAO,8BAA8B,UAAO,WAAA;AAAA,QAAO;AAAA,QAAEA,2BAAA,IAAAI,WAAA,YAAA,EAAW,QAAQ,GAAG,aAAa,MAAM;AAAA,QACnG;AAAA,QAAI;AAAA,QACJ;AAAA,QAAIJ,2BAAAA,IAACG,UAAAA,WAAU,EAAA,QAAQ,GAAG,aAAa,MAAM,OAAO,GAAG,eAAe,MAAM,eAAa,KAAC,CAAA;AAAA,QAC1F;AAAA,QAAI;AAAA,QAAE;AAAA,QAAa;AAAA,QACpBH,2BAAAA,IAAC,UAAS,EAAA,QAAQ,GAAG,cAAc,SAAS,CAAC,GAAG,SAAS,MAAM,GAAG,WAAwB,CAAA;AAAA,MAAA,EAAA,GALlF,GAAG,aAAa,OAAO,MAAM,GAAG,eAAe,IAMxD;AAAA,IAAA;AAAA,EAGF,CAAA,GACH;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"OnDelete.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/OnDelete.tsx"],"sourcesContent":["import { h, Fragment } from 'preact'\nimport { Model } from '@contember/schema'\nimport { ReferenceMapEntry, ReferencesMap } from '../../../schema/collectReferences'\nimport { FieldLink } from './FieldLink'\nimport { EntityLink } from './EntityLink'\n\nconst sortReferences = (a: ReferenceMapEntry, b: ReferenceMapEntry) =>\n\ta.owningRelation.joiningColumn.onDelete.localeCompare(b.owningRelation.joiningColumn.onDelete)\n\t|| a.owningEntity.name.localeCompare(b.owningEntity.name)\n\t|| a.owningRelation.name.localeCompare(b.owningRelation.name)\n\nexport const OnDelete = ({ references, entity, visited = [] }: { references: ReferencesMap; entity: Model.Entity; visited?: Model.Entity[] }) => {\n\tconst referencedFrom = references[entity.name]\n\tif (referencedFrom.length === 0) {\n\t\tif (visited.length !== 0) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<span class={'bg-green-200 text-gray-600 p-1 rounded'}>\n\t\t\t\tThis entity is not referenced from any other entity.\n\t\t\t</span>\n\t\t)\n\t}\n\n\tif (visited.includes(entity)) {\n\t\treturn (\n\t\t\t<ul class={'ml-4'}>\n\t\t\t\t<li class={'italic'}>(recursion)</li>\n\t\t\t</ul>\n\t\t)\n\t}\n\n\treturn (\n\t\t<ul class={visited.length > 0 ? 'ml-4' : ''}>\n\t\t\t{referencedFrom\n\t\t\t\t.sort(sortReferences)\n\t\t\t\t.map(it => {\n\t\t\t\t\tconst inverseDescr = it.targetRelation\n\t\t\t\t\t\t? <>see <FieldLink entity={entity.name} field={it.targetRelation.name} /></>\n\t\t\t\t\t\t: 'no inverse side'\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'restrict') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-black text-white px-1'}>Fails</span> when referenced from\n\t\t\t\t\t\t\t\t{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />\n\t\t\t\t\t\t\t\t{' '}({inverseDescr})\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'set null') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-blue-400 text-white px-1'}>Sets null</span> at\n\t\t\t\t\t\t\t\t{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />\n\t\t\t\t\t\t\t\t{' '}({inverseDescr})\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'cascade') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-red-400 text-white px-1'}>Deletes</span> <EntityLink entity={it.owningEntity.name} />\n\t\t\t\t\t\t\t\t{' '}connected using\n\t\t\t\t\t\t\t\t{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} noEntityLabel />\n\t\t\t\t\t\t\t\t{' '}({inverseDescr})\n\t\t\t\t\t\t\t\t<OnDelete entity={it.owningEntity} visited={[...visited, entity]} references={references} />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t})}\n\t\t</ul>)\n}\n"],"names":[],"mappings":";;;AAMA,MAAM,iBAAiB,CAAC,GAAsB,MAC7C,EAAE,eAAe,cAAc,SAAS,cAAc,EAAE,eAAe,cAAc,QAAQ,KAC1F,EAAE,aAAa,KAAK,cAAc,EAAE,aAAa,IAAI,KACrD,EAAE,eAAe,KAAK,cAAc,EAAE,eAAe,IAAI;AAEhD,MAAA,WAAW,CAAC,EAAE,YAAY,QAAQ,UAAU,SAAwF;AAC1I,QAAA,iBAAiB,WAAW,OAAO,IAAI;AACzC,MAAA,eAAe,WAAW,GAAG;AAC5B,QAAA,QAAQ,WAAW,GAAG;AAClB,aAAA;AAAA,IACR;AACA,WACE,oBAAA,QAAA,EAAK,OAAO,0CAA0C,UAEvD,uDAAA,CAAA;AAAA,EAEF;AAEI,MAAA,QAAQ,SAAS,MAAM,GAAG;AAE5B,WAAA,oBAAC,QAAG,OAAO,QACV,8BAAC,MAAG,EAAA,OAAO,UAAU,UAAA,cAAW,CAAA,EACjC,CAAA;AAAA,EAEF;AAEA,SACE,oBAAA,MAAA,EAAG,OAAO,QAAQ,SAAS,IAAI,SAAS,IACvC,UACC,eAAA,KAAK,cAAc,EACnB,IAAI,CAAM,OAAA;AACJ,UAAA,eAAe,GAAG,iBACnB,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA;AAAA,MAAI,oBAAC,aAAU,QAAQ,OAAO,MAAM,OAAO,GAAG,eAAe,MAAM;AAAA,IAAA,EAAE,CAAA,IACvE;AACH,QAAI,GAAG,eAA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AMxD;AAAA,IAEF;AAAA,EACA,CAAA,EACH,CAAA;AACF;"}
1
+ {"version":3,"file":"OnDelete.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/OnDelete.tsx"],"sourcesContent":["import { h, Fragment } from 'preact'\nimport { Model } from '@contember/schema'\nimport { ReferenceMapEntry, ReferencesMap } from '../../../schema/collectReferences'\nimport { FieldLink } from './FieldLink'\nimport { EntityLink } from './EntityLink'\n\nconst sortReferences = (a: ReferenceMapEntry, b: ReferenceMapEntry) =>\n\ta.owningRelation.joiningColumn.onDelete.localeCompare(b.owningRelation.joiningColumn.onDelete)\n\t|| a.owningEntity.name.localeCompare(b.owningEntity.name)\n\t|| a.owningRelation.name.localeCompare(b.owningRelation.name)\n\nexport const OnDelete = ({ references, entity, visited = [] }: { references: ReferencesMap; entity: Model.Entity; visited?: Model.Entity[] }) => {\n\tconst referencedFrom = references[entity.name]\n\tif (referencedFrom.length === 0) {\n\t\tif (visited.length !== 0) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<span class={'bg-green-200 text-gray-600 p-1 rounded'}>\n\t\t\t\tThis entity is not referenced from any other entity.\n\t\t\t</span>\n\t\t)\n\t}\n\n\tif (visited.includes(entity)) {\n\t\treturn (\n\t\t\t<ul class={'ml-4'}>\n\t\t\t\t<li class={'italic'}>(recursion)</li>\n\t\t\t</ul>\n\t\t)\n\t}\n\n\treturn (\n\t\t<ul class={visited.length > 0 ? 'ml-4' : ''}>\n\t\t\t{referencedFrom\n\t\t\t\t.sort(sortReferences)\n\t\t\t\t.map(it => {\n\t\t\t\t\tconst inverseDescr = it.targetRelation\n\t\t\t\t\t\t? <>see <FieldLink entity={entity.name} field={it.targetRelation.name} /></>\n\t\t\t\t\t\t: 'no inverse side'\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'restrict') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-black text-white px-1'}>Fails</span> when referenced from\n\t\t\t\t\t\t\t\t{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />\n\t\t\t\t\t\t\t\t{' '}({inverseDescr})\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'set null') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-blue-400 text-white px-1'}>Sets null</span> at\n\t\t\t\t\t\t\t\t{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />\n\t\t\t\t\t\t\t\t{' '}({inverseDescr})\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'cascade') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-red-400 text-white px-1'}>Deletes</span> <EntityLink entity={it.owningEntity.name} />\n\t\t\t\t\t\t\t\t{' '}connected using\n\t\t\t\t\t\t\t\t{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} noEntityLabel />\n\t\t\t\t\t\t\t\t{' '}({inverseDescr})\n\t\t\t\t\t\t\t\t<OnDelete entity={it.owningEntity} visited={[...visited, entity]} references={references} />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t})}\n\t\t</ul>)\n}\n"],"names":[],"mappings":";;;AAMA,MAAM,iBAAiB,CAAC,GAAsB,MAC7C,EAAE,eAAe,cAAc,SAAS,cAAc,EAAE,eAAe,cAAc,QAAQ,KAC1F,EAAE,aAAa,KAAK,cAAc,EAAE,aAAa,IAAI,KACrD,EAAE,eAAe,KAAK,cAAc,EAAE,eA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AAC,aAAU,QAAQ,GAAG,aAAa,MAAM,OAAO,GAAG,eAAe,KAAM,CAAA;AAAA,QAC5E;AAAA,QAAI;AAAA,QAAE;AAAA,QAAa;AAAA,MAAA,EAAA,GAHZ,GAAG,aAAa,OAAO,MAAM,GAAG,eAAe,IAIxD;AAAA,IAAA;AAGF,QAAI,GAAG,eAAe,cAAc,aAAa,WAAW;AAC3D,kCACE,MACA,EAAA,UAAA;AAAA,QAAC,oBAAA,QAAA,EAAK,OAAO,8BAA8B,UAAO,WAAA;AAAA,QAAO;AAAA,QAAE,oBAAA,YAAA,EAAW,QAAQ,GAAG,aAAa,MAAM;AAAA,QACnG;AAAA,QAAI;AAAA,QACJ;AAAA,QAAI,oBAAC,WAAU,EAAA,QAAQ,GAAG,aAAa,MAAM,OAAO,GAAG,eAAe,MAAM,eAAa,KAAC,CAAA;AAAA,QAC1F;AAAA,QAAI;AAAA,QAAE;AAAA,QAAa;AAAA,QACpB,oBAAC,UAAS,EAAA,QAAQ,GAAG,cAAc,SAAS,CAAC,GAAG,SAAS,MAAM,GAAG,WAAwB,CAAA;AAAA,MAAA,EAAA,GALlF,GAAG,aAAa,OAAO,MAAM,GAAG,eAAe,IAMxD;AAAA,IAAA;AAAA,EAGF,CAAA,GACH;AACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectInfo.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/ProjectInfo.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport { collectReferences } from '../../../schema/collectReferences'\nimport { EntityLink } from './EntityLink'\nimport { EntityInfo } from './EntityInfo'\n\n\nexport const ProjectInfo = (props: { schema: Schema; projectName: string }) => {\n\tconst references = collectReferences(props.schema.model)\n\n\treturn (\n\t\t<div class={'w-full'}>\n\t\t\t<div class={'bg-gray-100 p-6 border-b border-gray-400'}>\n\t\t\t\t<h1 class={'font-bold text-xl mb-1'}>{props.projectName}</h1>\n\t\t\t\t<div class={'flex flex-column gap-4'}>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2 class={'font-semibold text-gray-500 mb-1'}>Entities</h2>\n\t\t\t\t\t\t<ul class={'text-sm'}>\n\t\t\t\t\t\t\t{Object.values(props.schema.model.entities).map(entity => (\n\t\t\t\t\t\t\t\t<li key={entity.name}>\n\t\t\t\t\t\t\t\t\t<EntityLink entity={entity.name} />\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2 class={'font-semibold text-gray-500 mb-1'}>Enums</h2>\n\t\t\t\t\t\t<ul class={'text-sm'}>\n\t\t\t\t\t\t\t{Object.entries(props.schema.model.enums).map(([name, values]) => (\n\t\t\t\t\t\t\t\t<li class={'mb-2'} key={name}>\n\t\t\t\t\t\t\t\t\t{name} <br />\n\t\t\t\t\t\t\t\t\t<span class={'text-gray-700 ml-4'}>\n\t\t\t\t\t\t\t\t\t\t{values.join(', ')}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\n\t\t\t</div>\n\t\t\t{Object.values(props.schema.model.entities).map(entity => (\n\t\t\t\t<EntityInfo key={entity.name} entity={entity} schema={props.schema} references={references}/>\n\t\t\t))}\n\t\t</div>\n\t)\n}\n"],"names":["collectReferences","jsxs","jsx","EntityLink","EntityInfo"],"mappings":";;;;;;AAOa,MAAA,cAAc,CAAC,UAAmD;AAC9E,QAAM,aAAaA,kBAAA,kBAAkB,MAAM,OAAO,KAAK;AAGtD,SAAAC,2BAAA,KAAC,OAAI,EAAA,OAAO,UACX,UAAA;AAAA,IAACA,2BAAAA,KAAA,OAAA,EAAI,OAAO,4CACX,UAAA;AAAA,MAAAC,2BAAA,IAAC,MAAG,EAAA,OAAO,0BAA2B,UAAA,MAAM,aAAY;AAAA,MACxDD,2BAAAA,KAAC,OAAI,EAAA,OAAO,0BACX,UAAA;AAAA,QAAAA,gCAAC,OACA,EAAA,UAAA;AAAA,UAACC,2BAAA,IAAA,MAAA,EAAG,OAAO,oCAAoC,UAAQ,YAAA;AAAA,UACvDA,2BAAAA,IAAC,MAAG,EAAA,OAAO,WACT,UAAA,OAAO,OAAO,MAAM,OAAO,MAAM,QAAQ,EAAE,IAAI,YAC9CA,2BAAA,IAAA,MAAA,EACA,UAACA,2BAAAA,IAAAC,WAAAA,YAAA,EAAW,QAAQ,OAAO,KAAM,CAAA,EADzB,GAAA,OAAO,IAEhB,CACA,EACF,CAAA;AAAA,QAAA,GACD;AAAA,wCACC,OACA,EAAA,UAAA;AAAA,UAACD,2BAAA,IAAA,MAAA,EAAG,OAAO,oCAAoC,UAAK,SAAA;AAAA,UACpDA,+BAAC,QAAG,OAAO,WACT,iBAAO,QAAQ,MAAM,OAAO,MAAM,KAAK,EAAE,IAAI,CAAC,CAAC,MAAM,MAAM,MAC1DD,gCAAA,MAAA,EAAG,OAAO,QACT,UAAA;AAAA,YAAA;AAAA,YAAK;AAAA,2CAAE,MAAG,EAAA;AAAA,2CACV,QAAK,EAAA,OAAO,sBACX,UAAO,OAAA,KAAK,IAAI,GAClB;AAAA,UAAA,KAJuB,IAKxB,CACA,GACF;AAAA,QAAA,GACD;AAAA,MAAA,GACD;AAAA,IAAA,GAGD;AAAA,IACC,OAAO,OAAO,MAAM,OAAO,MAAM,QAAQ,EAAE,IAAI,CAAA,WAC9CC,2BAAAA,IAAAE,WAAAA,YAAA,EAA6B,QAAgB,QAAQ,MAAM,QAAQ,WAAnD,GAAA,OAAO,IAAmE,CAC3F;AAAA,EACF,EAAA,CAAA;AAEF;;"}
1
+ {"version":3,"file":"ProjectInfo.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/ProjectInfo.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport { collectReferences } from '../../../schema/collectReferences'\nimport { EntityLink } from './EntityLink'\nimport { EntityInfo } from './EntityInfo'\n\n\nexport const ProjectInfo = (props: { schema: Schema; projectName: string }) => {\n\tconst references = collectReferences(props.schema.model)\n\n\treturn (\n\t\t<div class={'w-full'}>\n\t\t\t<div class={'bg-gray-100 p-6 border-b border-gray-400'}>\n\t\t\t\t<h1 class={'font-bold text-xl mb-1'}>{props.projectName}</h1>\n\t\t\t\t<div class={'flex flex-column gap-4'}>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2 class={'font-semibold text-gray-500 mb-1'}>Entities</h2>\n\t\t\t\t\t\t<ul class={'text-sm'}>\n\t\t\t\t\t\t\t{Object.values(props.schema.model.entities).map(entity => (\n\t\t\t\t\t\t\t\t<li key={entity.name}>\n\t\t\t\t\t\t\t\t\t<EntityLink entity={entity.name} />\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2 class={'font-semibold text-gray-500 mb-1'}>Enums</h2>\n\t\t\t\t\t\t<ul class={'text-sm'}>\n\t\t\t\t\t\t\t{Object.entries(props.schema.model.enums).map(([name, values]) => (\n\t\t\t\t\t\t\t\t<li class={'mb-2'} key={name}>\n\t\t\t\t\t\t\t\t\t{name} <br />\n\t\t\t\t\t\t\t\t\t<span class={'text-gray-700 ml-4'}>\n\t\t\t\t\t\t\t\t\t\t{values.join(', ')}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\n\t\t\t</div>\n\t\t\t{Object.values(props.schema.model.entities).map(entity => (\n\t\t\t\t<EntityInfo key={entity.name} entity={entity} schema={props.schema} references={references}/>\n\t\t\t))}\n\t\t</div>\n\t)\n}\n"],"names":["collectReferences","jsxs","jsx","EntityLink","EntityInfo"],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E,IAAI,CAAA,WAC9CC,2BAAA,IAAAE,uBAAA,EAA6B,QAAgB,QAAQ,MAAM,QAAQ,WAAnD,GAAA,OAAO,IAAmE,CAC3F;AAAA,EAAA,GACF;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectInfo.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/ProjectInfo.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport { collectReferences } from '../../../schema/collectReferences'\nimport { EntityLink } from './EntityLink'\nimport { EntityInfo } from './EntityInfo'\n\n\nexport const ProjectInfo = (props: { schema: Schema; projectName: string }) => {\n\tconst references = collectReferences(props.schema.model)\n\n\treturn (\n\t\t<div class={'w-full'}>\n\t\t\t<div class={'bg-gray-100 p-6 border-b border-gray-400'}>\n\t\t\t\t<h1 class={'font-bold text-xl mb-1'}>{props.projectName}</h1>\n\t\t\t\t<div class={'flex flex-column gap-4'}>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2 class={'font-semibold text-gray-500 mb-1'}>Entities</h2>\n\t\t\t\t\t\t<ul class={'text-sm'}>\n\t\t\t\t\t\t\t{Object.values(props.schema.model.entities).map(entity => (\n\t\t\t\t\t\t\t\t<li key={entity.name}>\n\t\t\t\t\t\t\t\t\t<EntityLink entity={entity.name} />\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2 class={'font-semibold text-gray-500 mb-1'}>Enums</h2>\n\t\t\t\t\t\t<ul class={'text-sm'}>\n\t\t\t\t\t\t\t{Object.entries(props.schema.model.enums).map(([name, values]) => (\n\t\t\t\t\t\t\t\t<li class={'mb-2'} key={name}>\n\t\t\t\t\t\t\t\t\t{name} <br />\n\t\t\t\t\t\t\t\t\t<span class={'text-gray-700 ml-4'}>\n\t\t\t\t\t\t\t\t\t\t{values.join(', ')}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\n\t\t\t</div>\n\t\t\t{Object.values(props.schema.model.entities).map(entity => (\n\t\t\t\t<EntityInfo key={entity.name} entity={entity} schema={props.schema} references={references}/>\n\t\t\t))}\n\t\t</div>\n\t)\n}\n"],"names":[],"mappings":";;;;AAOa,MAAA,cAAc,CAAC,UAAmD;AAC9E,QAAM,aAAa,kBAAkB,MAAM,OAAO,KAAK;AAGtD,SAAA,qBAAC,OAAI,EAAA,OAAO,UACX,UAAA;AAAA,IAAC,qBAAA,OAAA,EAAI,OAAO,4CACX,UAAA;AAAA,MAAA,oBAAC,MAAG,EAAA,OAAO,0BAA2B,UAAA,MAAM,aAAY;AAAA,MACxD,qBAAC,OAAI,EAAA,OAAO,0BACX,UAAA;AAAA,QAAA,qBAAC,OACA,EAAA,UAAA;AAAA,UAAC,oBAAA,MAAA,EAAG,OAAO,oCAAoC,UAAQ,YAAA;AAAA,UACvD,oBAAC,MAAG,EAAA,OAAO,WACT,UAAA,OAAO,OAAO,MAAM,OAAO,MAAM,QAAQ,EAAE,IAAI,YAC9C,oBAAA,MAAA,EACA,UAAC,oBAAA,YAAA,EAAW,QAAQ,OAAO,KAAM,CAAA,EADzB,GAAA,OAAO,IAEhB,CACA,EACF,CAAA;AAAA,QAAA,GACD;AAAA,6BACC,OACA,EAAA,UAAA;AAAA,UAAC,oBAAA,MAAA,EAAG,OAAO,oCAAoC,UAAK,SAAA;AAAA,UACpD,oBAAC,QAAG,OAAO,WACT,iBAAO,QAAQ,MAAM,OAAO,MAAM,KAAK,EAAE,IAAI,CAAC,CAAC,MAAM,MAAM,MAC1D,qBAAA,MAAA,EAAG,OAAO,QACT,UAAA;AAAA,YAAA;AAAA,YAAK;AAAA,gCAAE,MAAG,EAAA;AAAA,gCACV,QAAK,EAAA,OAAO,sBACX,UAAO,OAAA,KAAK,IAAI,GAClB;AAAA,UAAA,KAJuB,IAKxB,CACA,GACF;AAAA,QAAA,GACD;AAAA,MAAA,GACD;AAAA,IAAA,GAGD;AAAA,IACC,OAAO,OAAO,MAAM,OAAO,MAAM,QAAQ,EAAE,IAAI,CAAA,WAC9C,oBAAA,YAAA,EAA6B,QAAgB,QAAQ,MAAM,QAAQ,WAAnD,GAAA,OAAO,IAAmE,CAC3F;AAAA,EACF,EAAA,CAAA;AAEF;"}
1
+ {"version":3,"file":"ProjectInfo.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/ProjectInfo.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport { collectReferences } from '../../../schema/collectReferences'\nimport { EntityLink } from './EntityLink'\nimport { EntityInfo } from './EntityInfo'\n\n\nexport const ProjectInfo = (props: { schema: Schema; projectName: string }) => {\n\tconst references = collectReferences(props.schema.model)\n\n\treturn (\n\t\t<div class={'w-full'}>\n\t\t\t<div class={'bg-gray-100 p-6 border-b border-gray-400'}>\n\t\t\t\t<h1 class={'font-bold text-xl mb-1'}>{props.projectName}</h1>\n\t\t\t\t<div class={'flex flex-column gap-4'}>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2 class={'font-semibold text-gray-500 mb-1'}>Entities</h2>\n\t\t\t\t\t\t<ul class={'text-sm'}>\n\t\t\t\t\t\t\t{Object.values(props.schema.model.entities).map(entity => (\n\t\t\t\t\t\t\t\t<li key={entity.name}>\n\t\t\t\t\t\t\t\t\t<EntityLink entity={entity.name} />\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2 class={'font-semibold text-gray-500 mb-1'}>Enums</h2>\n\t\t\t\t\t\t<ul class={'text-sm'}>\n\t\t\t\t\t\t\t{Object.entries(props.schema.model.enums).map(([name, values]) => (\n\t\t\t\t\t\t\t\t<li class={'mb-2'} key={name}>\n\t\t\t\t\t\t\t\t\t{name} <br />\n\t\t\t\t\t\t\t\t\t<span class={'text-gray-700 ml-4'}>\n\t\t\t\t\t\t\t\t\t\t{values.join(', ')}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\n\t\t\t</div>\n\t\t\t{Object.values(props.schema.model.entities).map(entity => (\n\t\t\t\t<EntityInfo key={entity.name} entity={entity} schema={props.schema} references={references}/>\n\t\t\t))}\n\t\t</div>\n\t)\n}\n"],"names":[],"mappings":";;;;AAOa,MAAA,cAAc,CAAC,UAAmD;AAC9E,QAAM,aAAa,kBAAkB,MAAM,OAAO,KAAK;AAGtD,SAAA,qBAAC,OAAI,EAAA,OAAO,UACX,UAAA;AAAA,IAAC,qBAAA,OAAA,EAAI,OAAO,4CACX,UAAA;AAAA,MAAA,oBAAC,MAAG,EAAA,OAAO,0BAA2B,UAAA,MAAM,aAAY;AAAA,MACxD,qBAAC,OAAI,EAAA,OAAO,0BACX,UAAA;AAAA,QAAA,qBAAC,OACA,EAAA,UAAA;AAAA,UAAC,oBAAA,MAAA,EAAG,OAAO,oCAAoC,UAAQ,YAAA;AAAA,UACvD,oBAAC,MAAG,EAAA,OAAO,WACT,UAAA,OAAO,OAAO,MAAM,OAAO,MAAM,QAAQ,EAAE,IAAI,YAC9C,oBAAA,MAAA,EACA,UAAC,oBAAA,YAAA,EAAW,QAAQ,OAAO,MAAM,EADzB,GAAA,OAAO,IAEhB,CACA,EACF,CAAA;AAAA,QAAA,GACD;AAAA,6BACC,OACA,EAAA,UAAA;AAAA,UAAC,oBAAA,MAAA,EAAG,OAAO,oCAAoC,UAAK,SAAA;AAAA,UACpD,oBAAC,QAAG,OAAO,WACT,iBAAO,QAAQ,MAAM,OAAO,MAAM,KAAK,EAAE,IAAI,CAAC,CAAC,MAAM,MAAM,MAC1D,qBAAA,MAAA,EAAG,OAAO,QACT,UAAA;AAAA,YAAA;AAAA,YAAK;AAAA,gCAAE,MAAG,EAAA;AAAA,gCACV,QAAK,EAAA,OAAO,sBACX,UAAO,OAAA,KAAK,IAAI,EAClB,CAAA;AAAA,UAAA,EAJuB,GAAA,IAKxB,CACA,EACF,CAAA;AAAA,QAAA,EACD,CAAA;AAAA,MAAA,EACD,CAAA;AAAA,IAAA,GAGD;AAAA,IACC,OAAO,OAAO,MAAM,OAAO,MAAM,QAAQ,EAAE,IAAI,CAAA,WAC9C,oBAAA,YAAA,EAA6B,QAAgB,QAAQ,MAAM,QAAQ,WAAnD,GAAA,OAAO,IAAmE,CAC3F;AAAA,EAAA,GACF;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SinglePermission.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/SinglePermission.tsx"],"sourcesContent":["import { h } from 'preact'\nimport { Acl } from '@contember/schema'\n\nexport const SinglePermission = ({ predicate, value }: { predicate?: Acl.Predicate; value: string }) => {\n\tif (!predicate) {\n\t\treturn <span class={'bg-red-500 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\tif (predicate === true) {\n\t\treturn <span class={'bg-green-600 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\treturn <span class={'bg-yellow-400 text-black font-semibold px-0.5'} title={predicate}>{value}</span>\n}\n\n"],"names":["jsx"],"mappings":";;;AAGO,MAAM,mBAAmB,CAAC,EAAE,WAAW,YAA0D;AACvG,MAAI,CAAC,WAAW;AACf,WAAQA,2BAAAA,IAAA,QAAA,EAAK,OAAO,8CAA+C,UAAM,MAAA,CAAA;AAAA,EAC1E;AACA,MAAI,cAAc,MAAM;AACvB,WAAQA,2BAAAA,IAAA,QAAA,EAAK,OAAO,gDAAiD,UAAM,MAAA,CAAA;AAAA,EAC5E;AACA,wCAAQ,QAAK,EAAA,OAAO,iDAAiD,OAAO,WAAY,UAAM,MAAA,CAAA;AAC/F;;"}
1
+ {"version":3,"file":"SinglePermission.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/SinglePermission.tsx"],"sourcesContent":["import { h } from 'preact'\nimport { Acl } from '@contember/schema'\n\nexport const SinglePermission = ({ predicate, value }: { predicate?: Acl.Predicate; value: string }) => {\n\tif (!predicate) {\n\t\treturn <span class={'bg-red-500 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\tif (predicate === true) {\n\t\treturn <span class={'bg-green-600 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\treturn <span class={'bg-yellow-400 text-black font-semibold px-0.5'} title={predicate}>{value}</span>\n}\n\n"],"names":["jsx"],"mappings":";;;AAGO,MAAM,mBAAmB,CAAC,EAAE,WAAW,YAA0D;AACvG,MAAI,CAAC,WAAW;AACf,WAAQA,2BAAAA,IAAA,QAAA,EAAK,OAAO,8CAA+C,UAAM,OAAA;AAAA,EAAA;AAE1E,MAAI,cAAc,MAAM;AACvB,WAAQA,2BAAAA,IAAA,QAAA,EAAK,OAAO,gDAAiD,UAAM,OAAA;AAAA,EAAA;AAE5E,wCAAQ,QAAK,EAAA,OAAO,iDAAiD,OAAO,WAAY,UAAM,OAAA;AAC/F;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SinglePermission.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/SinglePermission.tsx"],"sourcesContent":["import { h } from 'preact'\nimport { Acl } from '@contember/schema'\n\nexport const SinglePermission = ({ predicate, value }: { predicate?: Acl.Predicate; value: string }) => {\n\tif (!predicate) {\n\t\treturn <span class={'bg-red-500 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\tif (predicate === true) {\n\t\treturn <span class={'bg-green-600 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\treturn <span class={'bg-yellow-400 text-black font-semibold px-0.5'} title={predicate}>{value}</span>\n}\n\n"],"names":[],"mappings":";AAGO,MAAM,mBAAmB,CAAC,EAAE,WAAW,YAA0D;AACvG,MAAI,CAAC,WAAW;AACf,WAAQ,oBAAA,QAAA,EAAK,OAAO,8CAA+C,UAAM,MAAA,CAAA;AAAA,EAC1E;AACA,MAAI,cAAc,MAAM;AACvB,WAAQ,oBAAA,QAAA,EAAK,OAAO,gDAAiD,UAAM,MAAA,CAAA;AAAA,EAC5E;AACA,6BAAQ,QAAK,EAAA,OAAO,iDAAiD,OAAO,WAAY,UAAM,MAAA,CAAA;AAC/F;"}
1
+ {"version":3,"file":"SinglePermission.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/SinglePermission.tsx"],"sourcesContent":["import { h } from 'preact'\nimport { Acl } from '@contember/schema'\n\nexport const SinglePermission = ({ predicate, value }: { predicate?: Acl.Predicate; value: string }) => {\n\tif (!predicate) {\n\t\treturn <span class={'bg-red-500 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\tif (predicate === true) {\n\t\treturn <span class={'bg-green-600 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\treturn <span class={'bg-yellow-400 text-black font-semibold px-0.5'} title={predicate}>{value}</span>\n}\n\n"],"names":[],"mappings":";AAGO,MAAM,mBAAmB,CAAC,EAAE,WAAW,YAA0D;AACvG,MAAI,CAAC,WAAW;AACf,WAAQ,oBAAA,QAAA,EAAK,OAAO,8CAA+C,UAAM,OAAA;AAAA,EAAA;AAE1E,MAAI,cAAc,MAAM;AACvB,WAAQ,oBAAA,QAAA,EAAK,OAAO,gDAAiD,UAAM,OAAA;AAAA,EAAA;AAE5E,6BAAQ,QAAK,EAAA,OAAO,iDAAiD,OAAO,WAAY,UAAM,OAAA;AAC/F;"}
@@ -1 +1 @@
1
- {"version":3,"file":"projectDescribe.cjs","sources":["../../../../../../../packages/cli/src/lib/project/docs/projectDescribe.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport render from 'preact-render-to-string'\nimport { ProjectInfo } from './components/ProjectInfo'\nimport { readFile } from 'node:fs/promises'\nimport { packageRoot } from '../../../consts'\n\nexport const renderProjectInfoHtml = async (schema: Schema, projectName: string) => {\n\tconst html = render(<ProjectInfo schema={schema} projectName={projectName} />)\n\n\tconst css = await readFile(packageRoot + '/dist/resources/out.css')\n\treturn `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t<style>${css}</style>\n\t<title>${projectName}</title>\n</head>\n<body>\n${html}\n</body>\n</html>\n`\n\n}\n\n"],"names":["jsx","ProjectInfo","readFile","packageRoot"],"mappings":";;;;;;;AAOa,MAAA,wBAAwB,OAAO,QAAgB,gBAAwB;AACnF,QAAM,OAAO,OAAOA,+BAACC,YAAAA,aAAY,EAAA,QAAgB,YAA0B,CAAA,CAAE;AAE7E,QAAM,MAAM,MAAMC,GAAAA,SAASC,OAAA,cAAc,yBAAyB;AAC3D,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAKE,GAAG;AAAA,UACH,WAAW;AAAA;AAAA;AAAA,EAGnB,IAAI;AAAA;AAAA;AAAA;AAKN;;"}
1
+ {"version":3,"file":"projectDescribe.cjs","sources":["../../../../../../../packages/cli/src/lib/project/docs/projectDescribe.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport render from 'preact-render-to-string'\nimport { ProjectInfo } from './components/ProjectInfo'\nimport { readFile } from 'node:fs/promises'\nimport { packageRoot } from '../../../consts'\n\nexport const renderProjectInfoHtml = async (schema: Schema, projectName: string) => {\n\tconst html = render(<ProjectInfo schema={schema} projectName={projectName} />)\n\n\tconst css = await readFile(packageRoot + '/dist/resources/out.css')\n\treturn `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t<style>${css}</style>\n\t<title>${projectName}</title>\n</head>\n<body>\n${html}\n</body>\n</html>\n`\n\n}\n\n"],"names":["jsx","ProjectInfo","readFile","packageRoot"],"mappings":";;;;;;;AAOa,MAAA,wBAAwB,OAAO,QAAgB,gBAAwB;AACnF,QAAM,OAAO,OAAOA,2BAAA,IAACC,YAAY,aAAA,EAAA,QAAgB,aAA0B,CAAE;AAE7E,QAAM,MAAM,MAAMC,YAASC,OAAAA,cAAc,yBAAyB;AAC3D,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAKE,GAAG;AAAA,UACH,WAAW;AAAA;AAAA;AAAA,EAGnB,IAAI;AAAA;AAAA;AAAA;AAKN;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"projectDescribe.js","sources":["../../../../../../../packages/cli/src/lib/project/docs/projectDescribe.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport render from 'preact-render-to-string'\nimport { ProjectInfo } from './components/ProjectInfo'\nimport { readFile } from 'node:fs/promises'\nimport { packageRoot } from '../../../consts'\n\nexport const renderProjectInfoHtml = async (schema: Schema, projectName: string) => {\n\tconst html = render(<ProjectInfo schema={schema} projectName={projectName} />)\n\n\tconst css = await readFile(packageRoot + '/dist/resources/out.css')\n\treturn `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t<style>${css}</style>\n\t<title>${projectName}</title>\n</head>\n<body>\n${html}\n</body>\n</html>\n`\n\n}\n\n"],"names":[],"mappings":";;;;;AAOa,MAAA,wBAAwB,OAAO,QAAgB,gBAAwB;AACnF,QAAM,OAAO,OAAO,oBAAC,aAAY,EAAA,QAAgB,YAA0B,CAAA,CAAE;AAE7E,QAAM,MAAM,MAAM,SAAS,cAAc,yBAAyB;AAC3D,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAKE,GAAG;AAAA,UACH,WAAW;AAAA;AAAA;AAAA,EAGnB,IAAI;AAAA;AAAA;AAAA;AAKN;"}
1
+ {"version":3,"file":"projectDescribe.js","sources":["../../../../../../../packages/cli/src/lib/project/docs/projectDescribe.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport render from 'preact-render-to-string'\nimport { ProjectInfo } from './components/ProjectInfo'\nimport { readFile } from 'node:fs/promises'\nimport { packageRoot } from '../../../consts'\n\nexport const renderProjectInfoHtml = async (schema: Schema, projectName: string) => {\n\tconst html = render(<ProjectInfo schema={schema} projectName={projectName} />)\n\n\tconst css = await readFile(packageRoot + '/dist/resources/out.css')\n\treturn `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t<style>${css}</style>\n\t<title>${projectName}</title>\n</head>\n<body>\n${html}\n</body>\n</html>\n`\n\n}\n\n"],"names":[],"mappings":";;;;;AAOa,MAAA,wBAAwB,OAAO,QAAgB,gBAAwB;AACnF,QAAM,OAAO,OAAO,oBAAC,aAAY,EAAA,QAAgB,aAA0B,CAAE;AAE7E,QAAM,MAAM,MAAM,SAAS,cAAc,yBAAyB;AAC3D,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAKE,GAAG;AAAA,UACH,WAAW;AAAA;AAAA;AAAA,EAGnB,IAAI;AAAA;AAAA;AAAA;AAKN;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaLoader.cjs","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":["join","Typesafe","schemaType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOO,MAAM,mBAAmB;AAAA,EAC/B,YACkB,WAChB;AADgB,SAAA,YAAA;AAIlB,kBAAA,MAAA,cAAa,YAA6B;AACzC,YAAM,OAAOA,UAAAA,KAAK,KAAK,UAAU,QAAQ,UAAU;AAC7C,YAAA,SAAS,MAAM,OAAO;AACrB,aAAAC,oBAAS,OAAO,EAAE,SAASC,wBAAY,EAAE,MAAM,EAAE;AAAA,IAAA,CACzD;AAAA,EANA;AAOD;AAEO,MAAM,wBAAwB;AAAA,EACpC,YACkB,WACA,cAChB;AAFgB,SAAA,YAAA;AACA,SAAA,eAAA;AAIlB,kBAAA,MAAA,cAAa,YAA6B;AACzC,YAAM,OAAOF,UAAAA,KAAK,KAAK,UAAU,QAAQ,UAAU;AAEnD,YAAM,SAAU,MAAM,KAAK,aAAa,IAAI,IAAI;AACzC,aAAAC,oBAAS,OAAO,EAAE,SAASC,wBAAY,EAAE,MAAM,EAAE;AAAA,IAAA,CACzD;AAAA,EAPA;AAQD;;;"}
1
+ {"version":3,"file":"SchemaLoader.cjs","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":["join","Typesafe","schemaType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOO,MAAM,mBAAmB;AAAA,EAC/B,YACkB,WAChB;AADgB,SAAA,YAAA;AAIlB,kBAAA,MAAA,cAAa,YAA6B;AACzC,YAAM,OAAOA,UAAAA,KAAK,KAAK,UAAU,QAAQ,UAAU;AAC7C,YAAA,SAAS,MAAM,OAAO;AACrB,aAAAC,oBAAS,OAAO,EAAE,SAASC,YAAAA,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,OAAOF,UAAAA,KAAK,KAAK,UAAU,QAAQ,UAAU;AAEnD,YAAM,SAAU,MAAM,KAAK,aAAa,IAAI,IAAI;AACzC,aAAAC,oBAAS,OAAO,EAAE,SAASC,YAAAA,YAAY,EAAE,MAAM,EAAE;AAAA,IAAA,CACzD;AAAA,EAAA;AACD;;;"}
@@ -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,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,SAAU,MAAM,KAAK,aAAa,IAAI,IAAI;AACzC,aAAA,SAAS,OAAO,EAAE,SAAS,YAAY,EAAE,MAAM,EAAE;AAAA,IAAA,CACzD;AAAA,EAPA;AAQD;"}
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 +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,gDAAsB,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,YAAA,gBAAgB,SAAS,QAAQ,aAAa;AAC7DC,0BAAA,sBAAsB,QAAQ,OAAO;AACrC,SAAO,OAAO,WAAW;AAC1B;;"}