@axinom/mosaic-cli 0.56.0 → 0.57.0-rc.3

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 (532) hide show
  1. package/README.md +9 -3
  2. package/bin/mosaic.mjs +5 -0
  3. package/dist/cjs/exports.d.ts +2 -0
  4. package/dist/cjs/exports.js +6 -0
  5. package/dist/cjs/exports.js.map +1 -0
  6. package/dist/cjs/lib/get-access-token-options.js.map +1 -0
  7. package/dist/{commands/get-access-token → cjs/lib}/get-dev-access-token.d.ts +2 -2
  8. package/dist/cjs/lib/get-dev-access-token.js.map +1 -0
  9. package/dist/cjs/package.json +1 -0
  10. package/dist/esm/cli/index.js +51 -0
  11. package/dist/esm/cli/index.js.map +1 -0
  12. package/dist/{commands → esm/commands}/apply-templates/apply-templates.d.ts +2 -2
  13. package/dist/{commands → esm/commands}/apply-templates/apply-templates.js +56 -57
  14. package/dist/esm/commands/apply-templates/apply-templates.js.map +1 -0
  15. package/dist/{commands → esm/commands}/apply-templates/bitwarden-vault.js +18 -18
  16. package/dist/esm/commands/apply-templates/bitwarden-vault.js.map +1 -0
  17. package/dist/esm/commands/apply-templates/index.d.ts +1 -0
  18. package/dist/esm/commands/apply-templates/index.js +2 -0
  19. package/dist/esm/commands/apply-templates/index.js.map +1 -0
  20. package/dist/esm/commands/create/command.d.ts +3 -0
  21. package/dist/{commands → esm/commands}/create/command.js +23 -27
  22. package/dist/esm/commands/create/command.js.map +1 -0
  23. package/dist/{commands → esm/commands}/create/createSolution.d.ts +1 -1
  24. package/dist/{commands → esm/commands}/create/createSolution.js +16 -22
  25. package/dist/esm/commands/create/createSolution.js.map +1 -0
  26. package/dist/esm/commands/create/defaultValues.js +7 -0
  27. package/dist/esm/commands/create/defaultValues.js.map +1 -0
  28. package/dist/{commands → esm/commands}/create/helpers/git.d.ts +1 -1
  29. package/dist/{commands → esm/commands}/create/helpers/git.js +2 -7
  30. package/dist/esm/commands/create/helpers/git.js.map +1 -0
  31. package/dist/esm/commands/create/helpers/logger.js +35 -0
  32. package/dist/esm/commands/create/helpers/logger.js.map +1 -0
  33. package/dist/esm/commands/create/helpers/types.js +2 -0
  34. package/dist/esm/commands/create/helpers/types.js.map +1 -0
  35. package/dist/{commands → esm/commands}/create/runQuestionaire.d.ts +1 -1
  36. package/dist/{commands → esm/commands}/create/runQuestionaire.js +15 -20
  37. package/dist/esm/commands/create/runQuestionaire.js.map +1 -0
  38. package/dist/{commands → esm/commands}/create-extension-config/create-extension-config.js +15 -22
  39. package/dist/esm/commands/create-extension-config/create-extension-config.js.map +1 -0
  40. package/dist/{commands → esm/commands}/create-extension-config/index.d.ts +1 -1
  41. package/dist/esm/commands/create-extension-config/index.js +17 -0
  42. package/dist/esm/commands/create-extension-config/index.js.map +1 -0
  43. package/dist/esm/commands/get-access-token/index.d.ts +3 -0
  44. package/dist/{commands → esm/commands}/get-access-token/index.js +10 -14
  45. package/dist/esm/commands/get-access-token/index.js.map +1 -0
  46. package/dist/{commands → esm/commands}/graphql-diff.d.ts +1 -1
  47. package/dist/{commands → esm/commands}/graphql-diff.js +21 -25
  48. package/dist/esm/commands/graphql-diff.js.map +1 -0
  49. package/dist/{commands → esm/commands}/hosting/index.d.ts +1 -1
  50. package/dist/esm/commands/hosting/index.js +16 -0
  51. package/dist/esm/commands/hosting/index.js.map +1 -0
  52. package/dist/{commands → esm/commands}/hosting/manifest/manifest-commands.d.ts +1 -1
  53. package/dist/{commands → esm/commands}/hosting/manifest/manifest-commands.js +4 -7
  54. package/dist/esm/commands/hosting/manifest/manifest-commands.js.map +1 -0
  55. package/dist/esm/commands/hosting/manifest/upload-manifest-options.js +2 -0
  56. package/dist/esm/commands/hosting/manifest/upload-manifest-options.js.map +1 -0
  57. package/dist/{commands → esm/commands}/hosting/manifest/upload-manifest.d.ts +1 -1
  58. package/dist/{commands → esm/commands}/hosting/manifest/upload-manifest.js +34 -38
  59. package/dist/esm/commands/hosting/manifest/upload-manifest.js.map +1 -0
  60. package/dist/{commands → esm/commands}/hosting/pilet/pilet-commands.d.ts +1 -1
  61. package/dist/{commands → esm/commands}/hosting/pilet/pilet-commands.js +4 -7
  62. package/dist/esm/commands/hosting/pilet/pilet-commands.js.map +1 -0
  63. package/dist/esm/commands/hosting/pilet/register-pilet-options.js +2 -0
  64. package/dist/esm/commands/hosting/pilet/register-pilet-options.js.map +1 -0
  65. package/dist/{commands → esm/commands}/hosting/pilet/register-pilet.d.ts +1 -1
  66. package/dist/esm/commands/hosting/pilet/register-pilet.js +127 -0
  67. package/dist/esm/commands/hosting/pilet/register-pilet.js.map +1 -0
  68. package/dist/esm/commands/hosting/service/deploy/service-deploy-command.d.ts +3 -0
  69. package/dist/{commands → esm/commands}/hosting/service/deploy/service-deploy-command.js +8 -10
  70. package/dist/esm/commands/hosting/service/deploy/service-deploy-command.js.map +1 -0
  71. package/dist/esm/commands/hosting/service/deploy/service-deploy-options.js +2 -0
  72. package/dist/esm/commands/hosting/service/deploy/service-deploy-options.js.map +1 -0
  73. package/dist/{commands → esm/commands}/hosting/service/deploy/service-deploy.d.ts +1 -1
  74. package/dist/esm/commands/hosting/service/deploy/service-deploy.js +240 -0
  75. package/dist/esm/commands/hosting/service/deploy/service-deploy.js.map +1 -0
  76. package/dist/{commands → esm/commands}/hosting/service/service-commands.d.ts +1 -1
  77. package/dist/esm/commands/hosting/service/service-commands.js +13 -0
  78. package/dist/esm/commands/hosting/service/service-commands.js.map +1 -0
  79. package/dist/esm/commands/hosting/service/undeploy/service-undeploy-command.d.ts +3 -0
  80. package/dist/{commands → esm/commands}/hosting/service/undeploy/service-undeploy-command.js +8 -10
  81. package/dist/esm/commands/hosting/service/undeploy/service-undeploy-command.js.map +1 -0
  82. package/dist/esm/commands/hosting/service/undeploy/service-undeploy-options.js +2 -0
  83. package/dist/esm/commands/hosting/service/undeploy/service-undeploy-options.js.map +1 -0
  84. package/dist/{commands → esm/commands}/hosting/service/undeploy/service-undeploy.d.ts +1 -1
  85. package/dist/esm/commands/hosting/service/undeploy/service-undeploy.js +136 -0
  86. package/dist/esm/commands/hosting/service/undeploy/service-undeploy.js.map +1 -0
  87. package/dist/{commands → esm/commands}/msg-codegen/codegen.d.ts +3 -2
  88. package/dist/{commands → esm/commands}/msg-codegen/codegen.js +114 -83
  89. package/dist/esm/commands/msg-codegen/codegen.js.map +1 -0
  90. package/dist/esm/commands/msg-codegen/index.d.ts +3 -0
  91. package/dist/{commands → esm/commands}/msg-codegen/index.js +11 -8
  92. package/dist/esm/commands/msg-codegen/index.js.map +1 -0
  93. package/dist/{commands → esm/commands}/msg-codegen/lint.d.ts +1 -1
  94. package/dist/{commands → esm/commands}/msg-codegen/lint.js +14 -15
  95. package/dist/esm/commands/msg-codegen/lint.js.map +1 -0
  96. package/dist/{commands → esm/commands}/msg-codegen/message-codegen-options.d.ts +1 -0
  97. package/dist/esm/commands/msg-codegen/message-codegen-options.js +2 -0
  98. package/dist/esm/commands/msg-codegen/message-codegen-options.js.map +1 -0
  99. package/dist/{commands → esm/commands}/msg-codegen/presets.d.ts +7 -3
  100. package/dist/{commands → esm/commands}/msg-codegen/presets.js +35 -30
  101. package/dist/esm/commands/msg-codegen/presets.js.map +1 -0
  102. package/dist/{commands → esm/commands}/msg-codegen/utils.d.ts +1 -1
  103. package/dist/{commands → esm/commands}/msg-codegen/utils.js +52 -86
  104. package/dist/esm/commands/msg-codegen/utils.js.map +1 -0
  105. package/dist/{commands → esm/commands}/msg-diff/asyncapi-override.d.ts +1 -1
  106. package/dist/{commands → esm/commands}/msg-diff/asyncapi-override.js +1 -4
  107. package/dist/esm/commands/msg-diff/asyncapi-override.js.map +1 -0
  108. package/dist/{commands → esm/commands}/msg-diff/git-checkout-tmp.js +11 -15
  109. package/dist/esm/commands/msg-diff/git-checkout-tmp.js.map +1 -0
  110. package/dist/esm/commands/msg-diff/index.d.ts +3 -0
  111. package/dist/{commands → esm/commands}/msg-diff/index.js +10 -11
  112. package/dist/esm/commands/msg-diff/index.js.map +1 -0
  113. package/dist/esm/commands/msg-diff/message-diff-options.js +2 -0
  114. package/dist/esm/commands/msg-diff/message-diff-options.js.map +1 -0
  115. package/dist/{commands → esm/commands}/msg-diff/msg-diff.d.ts +2 -2
  116. package/dist/{commands → esm/commands}/msg-diff/msg-diff.js +42 -35
  117. package/dist/esm/commands/msg-diff/msg-diff.js.map +1 -0
  118. package/dist/{commands → esm/commands}/pg-dump/generate.d.ts +1 -1
  119. package/dist/{commands → esm/commands}/pg-dump/generate.js +34 -39
  120. package/dist/esm/commands/pg-dump/generate.js.map +1 -0
  121. package/dist/esm/commands/pg-dump/index.d.ts +3 -0
  122. package/dist/{commands → esm/commands}/pg-dump/index.js +3 -6
  123. package/dist/esm/commands/pg-dump/index.js.map +1 -0
  124. package/dist/esm/commands/pg-dump/pg-dump-options.js +2 -0
  125. package/dist/esm/commands/pg-dump/pg-dump-options.js.map +1 -0
  126. package/dist/{commands → esm/commands}/publish-schema-to-db/abstractions/base-smart-tags.d.ts +1 -1
  127. package/dist/esm/commands/publish-schema-to-db/abstractions/base-smart-tags.js +2 -0
  128. package/dist/esm/commands/publish-schema-to-db/abstractions/base-smart-tags.js.map +1 -0
  129. package/dist/esm/commands/publish-schema-to-db/abstractions/index.d.ts +5 -0
  130. package/dist/esm/commands/publish-schema-to-db/abstractions/index.js +6 -0
  131. package/dist/esm/commands/publish-schema-to-db/abstractions/index.js.map +1 -0
  132. package/dist/{commands → esm/commands}/publish-schema-to-db/abstractions/pg-column.d.ts +3 -3
  133. package/dist/esm/commands/publish-schema-to-db/abstractions/pg-column.js +2 -0
  134. package/dist/esm/commands/publish-schema-to-db/abstractions/pg-column.js.map +1 -0
  135. package/dist/{commands → esm/commands}/publish-schema-to-db/abstractions/pg-fk-column.d.ts +1 -1
  136. package/dist/esm/commands/publish-schema-to-db/abstractions/pg-fk-column.js +2 -0
  137. package/dist/esm/commands/publish-schema-to-db/abstractions/pg-fk-column.js.map +1 -0
  138. package/dist/{commands → esm/commands}/publish-schema-to-db/abstractions/pg-table.d.ts +4 -4
  139. package/dist/esm/commands/publish-schema-to-db/abstractions/pg-table.js +2 -0
  140. package/dist/esm/commands/publish-schema-to-db/abstractions/pg-table.js.map +1 -0
  141. package/dist/esm/commands/publish-schema-to-db/abstractions/pg-type.js +2 -0
  142. package/dist/esm/commands/publish-schema-to-db/abstractions/pg-type.js.map +1 -0
  143. package/dist/{commands → esm/commands}/publish-schema-to-db/content-entity-model.d.ts +3 -3
  144. package/dist/{commands → esm/commands}/publish-schema-to-db/content-entity-model.js +12 -14
  145. package/dist/esm/commands/publish-schema-to-db/content-entity-model.js.map +1 -0
  146. package/dist/{commands → esm/commands}/publish-schema-to-db/generate.d.ts +1 -1
  147. package/dist/esm/commands/publish-schema-to-db/generate.js +57 -0
  148. package/dist/esm/commands/publish-schema-to-db/generate.js.map +1 -0
  149. package/dist/esm/commands/publish-schema-to-db/index.d.ts +3 -0
  150. package/dist/{commands → esm/commands}/publish-schema-to-db/index.js +3 -6
  151. package/dist/esm/commands/publish-schema-to-db/index.js.map +1 -0
  152. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/fk-column.d.ts +1 -1
  153. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/fk-column.js +11 -8
  154. package/dist/esm/commands/publish-schema-to-db/pg-models/columns/fk-column.js.map +1 -0
  155. package/dist/esm/commands/publish-schema-to-db/pg-models/columns/index.d.ts +4 -0
  156. package/dist/esm/commands/publish-schema-to-db/pg-models/columns/index.js +5 -0
  157. package/dist/esm/commands/publish-schema-to-db/pg-models/columns/index.js.map +1 -0
  158. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/pk-column.d.ts +1 -1
  159. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/pk-column.js +4 -5
  160. package/dist/esm/commands/publish-schema-to-db/pg-models/columns/pk-column.js.map +1 -0
  161. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/primitive-column.d.ts +1 -1
  162. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/primitive-column.js +10 -10
  163. package/dist/esm/commands/publish-schema-to-db/pg-models/columns/primitive-column.js.map +1 -0
  164. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/virtual-fk-column.d.ts +1 -1
  165. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/virtual-fk-column.js +9 -8
  166. package/dist/esm/commands/publish-schema-to-db/pg-models/columns/virtual-fk-column.js.map +1 -0
  167. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/json-schema-parse-utils.d.ts +2 -2
  168. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/json-schema-parse-utils.js +17 -29
  169. package/dist/esm/commands/publish-schema-to-db/pg-models/json-schema-parse-utils.js.map +1 -0
  170. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/pg-sql-gen-utils.d.ts +1 -7
  171. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/pg-sql-gen-utils.js +14 -50
  172. package/dist/esm/commands/publish-schema-to-db/pg-models/pg-sql-gen-utils.js.map +1 -0
  173. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/pgl-utils.d.ts +2 -2
  174. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/pgl-utils.js +23 -24
  175. package/dist/esm/commands/publish-schema-to-db/pg-models/pgl-utils.js.map +1 -0
  176. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/tables/content-entity-table.d.ts +3 -3
  177. package/dist/esm/commands/publish-schema-to-db/pg-models/tables/content-entity-table.js +69 -0
  178. package/dist/esm/commands/publish-schema-to-db/pg-models/tables/content-entity-table.js.map +1 -0
  179. package/dist/esm/commands/publish-schema-to-db/pg-models/tables/index.d.ts +3 -0
  180. package/dist/esm/commands/publish-schema-to-db/pg-models/tables/index.js +4 -0
  181. package/dist/esm/commands/publish-schema-to-db/pg-models/tables/index.js.map +1 -0
  182. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/tables/object-property-table.d.ts +3 -3
  183. package/dist/esm/commands/publish-schema-to-db/pg-models/tables/object-property-table.js +75 -0
  184. package/dist/esm/commands/publish-schema-to-db/pg-models/tables/object-property-table.js.map +1 -0
  185. package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/tables/relations-table.d.ts +3 -3
  186. package/dist/esm/commands/publish-schema-to-db/pg-models/tables/relations-table.js +63 -0
  187. package/dist/esm/commands/publish-schema-to-db/pg-models/tables/relations-table.js.map +1 -0
  188. package/dist/esm/commands/publish-schema-to-db/postprocessors/collection-postprocessor.d.ts +2 -0
  189. package/dist/esm/commands/publish-schema-to-db/postprocessors/collection-postprocessor.js +17 -0
  190. package/dist/esm/commands/publish-schema-to-db/postprocessors/collection-postprocessor.js.map +1 -0
  191. package/dist/{commands → esm/commands}/publish-schema-to-db/postprocessors/content-entity-model-postprocessor.d.ts +2 -2
  192. package/dist/esm/commands/publish-schema-to-db/postprocessors/content-entity-model-postprocessor.js +2 -0
  193. package/dist/esm/commands/publish-schema-to-db/postprocessors/content-entity-model-postprocessor.js.map +1 -0
  194. package/dist/esm/commands/publish-schema-to-db/postprocessors/episode-postprocessor.d.ts +2 -0
  195. package/dist/esm/commands/publish-schema-to-db/postprocessors/episode-postprocessor.js +20 -0
  196. package/dist/esm/commands/publish-schema-to-db/postprocessors/episode-postprocessor.js.map +1 -0
  197. package/dist/esm/commands/publish-schema-to-db/postprocessors/index.d.ts +6 -0
  198. package/dist/esm/commands/publish-schema-to-db/postprocessors/index.js +7 -0
  199. package/dist/esm/commands/publish-schema-to-db/postprocessors/index.js.map +1 -0
  200. package/dist/esm/commands/publish-schema-to-db/postprocessors/movie-postprocessor.d.ts +2 -0
  201. package/dist/esm/commands/publish-schema-to-db/postprocessors/movie-postprocessor.js +16 -0
  202. package/dist/esm/commands/publish-schema-to-db/postprocessors/movie-postprocessor.js.map +1 -0
  203. package/dist/esm/commands/publish-schema-to-db/postprocessors/postprocessing-utils.d.ts +9 -0
  204. package/dist/esm/commands/publish-schema-to-db/postprocessors/postprocessing-utils.js +37 -0
  205. package/dist/esm/commands/publish-schema-to-db/postprocessors/postprocessing-utils.js.map +1 -0
  206. package/dist/esm/commands/publish-schema-to-db/postprocessors/season-postprocessor.d.ts +2 -0
  207. package/dist/esm/commands/publish-schema-to-db/postprocessors/season-postprocessor.js +20 -0
  208. package/dist/esm/commands/publish-schema-to-db/postprocessors/season-postprocessor.js.map +1 -0
  209. package/dist/esm/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.d.ts +2 -0
  210. package/dist/esm/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.js +16 -0
  211. package/dist/esm/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.js.map +1 -0
  212. package/dist/esm/commands/publish-schema-to-db/publish-schema-to-db-options.js +2 -0
  213. package/dist/esm/commands/publish-schema-to-db/publish-schema-to-db-options.js.map +1 -0
  214. package/dist/{commands → esm/commands}/service/index.d.ts +1 -1
  215. package/dist/esm/commands/service/index.js +14 -0
  216. package/dist/esm/commands/service/index.js.map +1 -0
  217. package/dist/esm/commands/service/purge-permissions/purge-permissions-command.d.ts +3 -0
  218. package/dist/{commands → esm/commands}/service/purge-permissions/purge-permissions-command.js +8 -10
  219. package/dist/esm/commands/service/purge-permissions/purge-permissions-command.js.map +1 -0
  220. package/dist/esm/commands/service/purge-permissions/purge-permissions-options.js +2 -0
  221. package/dist/esm/commands/service/purge-permissions/purge-permissions-options.js.map +1 -0
  222. package/dist/{commands → esm/commands}/service/purge-permissions/purge-permissions.d.ts +1 -1
  223. package/dist/esm/commands/service/purge-permissions/purge-permissions.js +49 -0
  224. package/dist/esm/commands/service/purge-permissions/purge-permissions.js.map +1 -0
  225. package/dist/esm/commands/service/sync-permissions/sync-permission-command.d.ts +3 -0
  226. package/dist/{commands → esm/commands}/service/sync-permissions/sync-permission-command.js +8 -10
  227. package/dist/esm/commands/service/sync-permissions/sync-permission-command.js.map +1 -0
  228. package/dist/esm/commands/service/sync-permissions/sync-permissions-options.js +2 -0
  229. package/dist/esm/commands/service/sync-permissions/sync-permissions-options.js.map +1 -0
  230. package/dist/{commands → esm/commands}/service/sync-permissions/sync-permissions.d.ts +1 -1
  231. package/dist/esm/commands/service/sync-permissions/sync-permissions.js +62 -0
  232. package/dist/esm/commands/service/sync-permissions/sync-permissions.js.map +1 -0
  233. package/dist/esm/commands/unpublish-pilet/index.d.ts +3 -0
  234. package/dist/{commands → esm/commands}/unpublish-pilet/index.js +11 -15
  235. package/dist/esm/commands/unpublish-pilet/index.js.map +1 -0
  236. package/dist/esm/commands/unpublish-pilet/unpublish-pilet-options.js +2 -0
  237. package/dist/esm/commands/unpublish-pilet/unpublish-pilet-options.js.map +1 -0
  238. package/dist/{commands → esm/commands}/unpublish-pilet/unpublish-pilet.d.ts +1 -1
  239. package/dist/esm/commands/unpublish-pilet/unpublish-pilet.js +14 -0
  240. package/dist/esm/commands/unpublish-pilet/unpublish-pilet.js.map +1 -0
  241. package/dist/esm/common/cli-extension.d.ts +10 -0
  242. package/dist/esm/common/cli-extension.js +7 -0
  243. package/dist/esm/common/cli-extension.js.map +1 -0
  244. package/dist/esm/common/index.d.ts +2 -0
  245. package/dist/esm/common/index.js +3 -0
  246. package/dist/esm/common/index.js.map +1 -0
  247. package/dist/{common → esm/common}/utils.js +2 -6
  248. package/dist/esm/common/utils.js.map +1 -0
  249. package/dist/esm/exports.d.ts +2 -0
  250. package/dist/esm/exports.js +3 -0
  251. package/dist/esm/exports.js.map +1 -0
  252. package/dist/esm/lib/get-access-token-options.d.ts +9 -0
  253. package/dist/esm/lib/get-access-token-options.js +2 -0
  254. package/dist/esm/lib/get-access-token-options.js.map +1 -0
  255. package/dist/esm/lib/get-dev-access-token.d.ts +6 -0
  256. package/dist/esm/lib/get-dev-access-token.js +11 -0
  257. package/dist/esm/lib/get-dev-access-token.js.map +1 -0
  258. package/dist/esm/package.json +1 -0
  259. package/package.json +22 -13
  260. package/src/cli/index.ts +21 -18
  261. package/src/commands/apply-templates/apply-templates.spec.ts +2 -2
  262. package/src/commands/apply-templates/apply-templates.ts +13 -8
  263. package/src/commands/apply-templates/bitwarden-vault.ts +2 -1
  264. package/src/commands/apply-templates/index.ts +1 -1
  265. package/src/commands/create/command.ts +6 -6
  266. package/src/commands/create/createSolution.ts +3 -3
  267. package/src/commands/create/helpers/git.ts +1 -1
  268. package/src/commands/create/runQuestionaire.ts +3 -3
  269. package/src/commands/create-extension-config/create-extension-config.ts +3 -3
  270. package/src/commands/create-extension-config/index.ts +2 -2
  271. package/src/commands/get-access-token/index.ts +4 -4
  272. package/src/commands/graphql-diff.ts +5 -5
  273. package/src/commands/hosting/index.ts +4 -4
  274. package/src/commands/hosting/manifest/manifest-commands.ts +3 -3
  275. package/src/commands/hosting/manifest/upload-manifest.ts +3 -3
  276. package/src/commands/hosting/pilet/pilet-commands.ts +3 -3
  277. package/src/commands/hosting/pilet/register-pilet.ts +6 -3
  278. package/src/commands/hosting/service/deploy/service-deploy-command.ts +5 -4
  279. package/src/commands/hosting/service/deploy/service-deploy.ts +5 -4
  280. package/src/commands/hosting/service/service-commands.ts +3 -3
  281. package/src/commands/hosting/service/undeploy/service-undeploy-command.ts +8 -4
  282. package/src/commands/hosting/service/undeploy/service-undeploy.ts +5 -4
  283. package/src/commands/msg-codegen/codegen.ts +61 -22
  284. package/src/commands/msg-codegen/index.ts +11 -4
  285. package/src/commands/msg-codegen/lint.ts +9 -6
  286. package/src/commands/msg-codegen/message-codegen-options.ts +1 -0
  287. package/src/commands/msg-codegen/presets.ts +23 -9
  288. package/src/commands/msg-codegen/utils.ts +4 -4
  289. package/src/commands/msg-diff/asyncapi-override.ts +1 -1
  290. package/src/commands/msg-diff/index.ts +11 -7
  291. package/src/commands/msg-diff/msg-diff.spec.ts +7 -5
  292. package/src/commands/msg-diff/msg-diff.ts +19 -12
  293. package/src/commands/msg-diff/test-resources/0/command.json +4 -14
  294. package/src/commands/msg-diff/test-resources/0/event.json +2 -5
  295. package/src/commands/msg-diff/test-resources/1/moved-event.json +2 -5
  296. package/src/commands/pg-dump/generate.ts +3 -3
  297. package/src/commands/pg-dump/index.ts +3 -3
  298. package/src/commands/publish-schema-to-db/README.md +7 -6
  299. package/src/commands/publish-schema-to-db/abstractions/base-smart-tags.ts +1 -1
  300. package/src/commands/publish-schema-to-db/abstractions/index.ts +5 -5
  301. package/src/commands/publish-schema-to-db/abstractions/pg-column.ts +3 -3
  302. package/src/commands/publish-schema-to-db/abstractions/pg-fk-column.ts +1 -1
  303. package/src/commands/publish-schema-to-db/abstractions/pg-table.ts +4 -4
  304. package/src/commands/publish-schema-to-db/content-entity-model.ts +9 -6
  305. package/src/commands/publish-schema-to-db/generate.ts +9 -9
  306. package/src/commands/publish-schema-to-db/index.ts +3 -3
  307. package/src/commands/publish-schema-to-db/pg-models/columns/fk-column.spec.ts +2 -2
  308. package/src/commands/publish-schema-to-db/pg-models/columns/fk-column.ts +7 -7
  309. package/src/commands/publish-schema-to-db/pg-models/columns/index.ts +4 -4
  310. package/src/commands/publish-schema-to-db/pg-models/columns/pk-column.spec.ts +2 -2
  311. package/src/commands/publish-schema-to-db/pg-models/columns/pk-column.ts +6 -1
  312. package/src/commands/publish-schema-to-db/pg-models/columns/primitive-column.spec.ts +2 -2
  313. package/src/commands/publish-schema-to-db/pg-models/columns/primitive-column.ts +6 -1
  314. package/src/commands/publish-schema-to-db/pg-models/columns/virtual-fk-column.spec.ts +2 -2
  315. package/src/commands/publish-schema-to-db/pg-models/columns/virtual-fk-column.ts +7 -7
  316. package/src/commands/publish-schema-to-db/pg-models/json-schema-parse-utils.spec.ts +3 -3
  317. package/src/commands/publish-schema-to-db/pg-models/json-schema-parse-utils.ts +6 -4
  318. package/src/commands/publish-schema-to-db/pg-models/pg-sql-gen-utils.spec.ts +1 -1
  319. package/src/commands/publish-schema-to-db/pg-models/pg-sql-gen-utils.ts +1 -37
  320. package/src/commands/publish-schema-to-db/pg-models/pgl-utils.spec.ts +1 -1
  321. package/src/commands/publish-schema-to-db/pg-models/pgl-utils.ts +18 -10
  322. package/src/commands/publish-schema-to-db/pg-models/tables/content-entity-table.ts +11 -11
  323. package/src/commands/publish-schema-to-db/pg-models/tables/index.ts +3 -3
  324. package/src/commands/publish-schema-to-db/pg-models/tables/object-property-table.ts +14 -11
  325. package/src/commands/publish-schema-to-db/pg-models/tables/relations-table.ts +11 -11
  326. package/src/commands/publish-schema-to-db/postprocessors/collection-postprocessor.ts +3 -3
  327. package/src/commands/publish-schema-to-db/postprocessors/content-entity-model-postprocessor.ts +2 -2
  328. package/src/commands/publish-schema-to-db/postprocessors/episode-postprocessor.ts +8 -5
  329. package/src/commands/publish-schema-to-db/postprocessors/index.ts +6 -6
  330. package/src/commands/publish-schema-to-db/postprocessors/movie-postprocessor.ts +3 -4
  331. package/src/commands/publish-schema-to-db/postprocessors/postprocessing-utils.ts +37 -2
  332. package/src/commands/publish-schema-to-db/postprocessors/season-postprocessor.ts +8 -5
  333. package/src/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.ts +3 -4
  334. package/src/commands/service/index.ts +3 -3
  335. package/src/commands/service/purge-permissions/purge-permissions-command.ts +5 -4
  336. package/src/commands/service/purge-permissions/purge-permissions.ts +3 -2
  337. package/src/commands/service/sync-permissions/sync-permission-command.ts +5 -4
  338. package/src/commands/service/sync-permissions/sync-permissions.ts +5 -4
  339. package/src/commands/unpublish-pilet/index.ts +4 -4
  340. package/src/commands/unpublish-pilet/unpublish-pilet.ts +1 -1
  341. package/src/common/cli-extension.ts +21 -0
  342. package/src/common/index.ts +2 -1
  343. package/src/exports.ts +2 -2
  344. package/src/index.ts +1 -1
  345. package/src/{commands/get-access-token → lib}/get-dev-access-token.ts +2 -2
  346. package/bin/mosaic.js +0 -3
  347. package/dist/cli/index.js +0 -54
  348. package/dist/cli/index.js.map +0 -1
  349. package/dist/commands/apply-templates/apply-templates.js.map +0 -1
  350. package/dist/commands/apply-templates/bitwarden-vault.js.map +0 -1
  351. package/dist/commands/apply-templates/index.d.ts +0 -1
  352. package/dist/commands/apply-templates/index.js +0 -5
  353. package/dist/commands/apply-templates/index.js.map +0 -1
  354. package/dist/commands/create/command.d.ts +0 -3
  355. package/dist/commands/create/command.js.map +0 -1
  356. package/dist/commands/create/createSolution.js.map +0 -1
  357. package/dist/commands/create/defaultValues.js +0 -10
  358. package/dist/commands/create/defaultValues.js.map +0 -1
  359. package/dist/commands/create/helpers/git.js.map +0 -1
  360. package/dist/commands/create/helpers/logger.js +0 -46
  361. package/dist/commands/create/helpers/logger.js.map +0 -1
  362. package/dist/commands/create/helpers/types.js +0 -3
  363. package/dist/commands/create/helpers/types.js.map +0 -1
  364. package/dist/commands/create/runQuestionaire.js.map +0 -1
  365. package/dist/commands/create-extension-config/create-extension-config.js.map +0 -1
  366. package/dist/commands/create-extension-config/index.js +0 -22
  367. package/dist/commands/create-extension-config/index.js.map +0 -1
  368. package/dist/commands/get-access-token/get-access-token-options.js.map +0 -1
  369. package/dist/commands/get-access-token/get-dev-access-token.js.map +0 -1
  370. package/dist/commands/get-access-token/index.d.ts +0 -3
  371. package/dist/commands/get-access-token/index.js.map +0 -1
  372. package/dist/commands/graphql-diff.js.map +0 -1
  373. package/dist/commands/hosting/index.js +0 -19
  374. package/dist/commands/hosting/index.js.map +0 -1
  375. package/dist/commands/hosting/manifest/manifest-commands.js.map +0 -1
  376. package/dist/commands/hosting/manifest/upload-manifest-options.js +0 -3
  377. package/dist/commands/hosting/manifest/upload-manifest-options.js.map +0 -1
  378. package/dist/commands/hosting/manifest/upload-manifest.js.map +0 -1
  379. package/dist/commands/hosting/pilet/pilet-commands.js.map +0 -1
  380. package/dist/commands/hosting/pilet/register-pilet-options.js +0 -3
  381. package/dist/commands/hosting/pilet/register-pilet-options.js.map +0 -1
  382. package/dist/commands/hosting/pilet/register-pilet.js +0 -131
  383. package/dist/commands/hosting/pilet/register-pilet.js.map +0 -1
  384. package/dist/commands/hosting/service/deploy/service-deploy-command.d.ts +0 -3
  385. package/dist/commands/hosting/service/deploy/service-deploy-command.js.map +0 -1
  386. package/dist/commands/hosting/service/deploy/service-deploy-options.js +0 -3
  387. package/dist/commands/hosting/service/deploy/service-deploy-options.js.map +0 -1
  388. package/dist/commands/hosting/service/deploy/service-deploy.js +0 -246
  389. package/dist/commands/hosting/service/deploy/service-deploy.js.map +0 -1
  390. package/dist/commands/hosting/service/service-commands.js +0 -16
  391. package/dist/commands/hosting/service/service-commands.js.map +0 -1
  392. package/dist/commands/hosting/service/undeploy/service-undeploy-command.d.ts +0 -3
  393. package/dist/commands/hosting/service/undeploy/service-undeploy-command.js.map +0 -1
  394. package/dist/commands/hosting/service/undeploy/service-undeploy-options.js +0 -3
  395. package/dist/commands/hosting/service/undeploy/service-undeploy-options.js.map +0 -1
  396. package/dist/commands/hosting/service/undeploy/service-undeploy.js +0 -142
  397. package/dist/commands/hosting/service/undeploy/service-undeploy.js.map +0 -1
  398. package/dist/commands/msg-codegen/codegen.js.map +0 -1
  399. package/dist/commands/msg-codegen/index.d.ts +0 -3
  400. package/dist/commands/msg-codegen/index.js.map +0 -1
  401. package/dist/commands/msg-codegen/lint.js.map +0 -1
  402. package/dist/commands/msg-codegen/message-codegen-options.js +0 -3
  403. package/dist/commands/msg-codegen/message-codegen-options.js.map +0 -1
  404. package/dist/commands/msg-codegen/presets.js.map +0 -1
  405. package/dist/commands/msg-codegen/utils.js.map +0 -1
  406. package/dist/commands/msg-diff/asyncapi-override.js.map +0 -1
  407. package/dist/commands/msg-diff/git-checkout-tmp.js.map +0 -1
  408. package/dist/commands/msg-diff/index.d.ts +0 -3
  409. package/dist/commands/msg-diff/index.js.map +0 -1
  410. package/dist/commands/msg-diff/message-diff-options.js +0 -3
  411. package/dist/commands/msg-diff/message-diff-options.js.map +0 -1
  412. package/dist/commands/msg-diff/msg-diff.js.map +0 -1
  413. package/dist/commands/pg-dump/generate.js.map +0 -1
  414. package/dist/commands/pg-dump/index.d.ts +0 -3
  415. package/dist/commands/pg-dump/index.js.map +0 -1
  416. package/dist/commands/pg-dump/pg-dump-options.js +0 -3
  417. package/dist/commands/pg-dump/pg-dump-options.js.map +0 -1
  418. package/dist/commands/publish-schema-to-db/abstractions/base-smart-tags.js +0 -3
  419. package/dist/commands/publish-schema-to-db/abstractions/base-smart-tags.js.map +0 -1
  420. package/dist/commands/publish-schema-to-db/abstractions/index.d.ts +0 -5
  421. package/dist/commands/publish-schema-to-db/abstractions/index.js +0 -9
  422. package/dist/commands/publish-schema-to-db/abstractions/index.js.map +0 -1
  423. package/dist/commands/publish-schema-to-db/abstractions/pg-column.js +0 -3
  424. package/dist/commands/publish-schema-to-db/abstractions/pg-column.js.map +0 -1
  425. package/dist/commands/publish-schema-to-db/abstractions/pg-fk-column.js +0 -3
  426. package/dist/commands/publish-schema-to-db/abstractions/pg-fk-column.js.map +0 -1
  427. package/dist/commands/publish-schema-to-db/abstractions/pg-table.js +0 -3
  428. package/dist/commands/publish-schema-to-db/abstractions/pg-table.js.map +0 -1
  429. package/dist/commands/publish-schema-to-db/abstractions/pg-type.js +0 -3
  430. package/dist/commands/publish-schema-to-db/abstractions/pg-type.js.map +0 -1
  431. package/dist/commands/publish-schema-to-db/content-entity-model.js.map +0 -1
  432. package/dist/commands/publish-schema-to-db/generate.js +0 -61
  433. package/dist/commands/publish-schema-to-db/generate.js.map +0 -1
  434. package/dist/commands/publish-schema-to-db/index.d.ts +0 -3
  435. package/dist/commands/publish-schema-to-db/index.js.map +0 -1
  436. package/dist/commands/publish-schema-to-db/pg-models/columns/fk-column.js.map +0 -1
  437. package/dist/commands/publish-schema-to-db/pg-models/columns/index.d.ts +0 -4
  438. package/dist/commands/publish-schema-to-db/pg-models/columns/index.js +0 -8
  439. package/dist/commands/publish-schema-to-db/pg-models/columns/index.js.map +0 -1
  440. package/dist/commands/publish-schema-to-db/pg-models/columns/pk-column.js.map +0 -1
  441. package/dist/commands/publish-schema-to-db/pg-models/columns/primitive-column.js.map +0 -1
  442. package/dist/commands/publish-schema-to-db/pg-models/columns/virtual-fk-column.js.map +0 -1
  443. package/dist/commands/publish-schema-to-db/pg-models/json-schema-parse-utils.js.map +0 -1
  444. package/dist/commands/publish-schema-to-db/pg-models/pg-sql-gen-utils.js.map +0 -1
  445. package/dist/commands/publish-schema-to-db/pg-models/pgl-utils.js.map +0 -1
  446. package/dist/commands/publish-schema-to-db/pg-models/tables/content-entity-table.js +0 -67
  447. package/dist/commands/publish-schema-to-db/pg-models/tables/content-entity-table.js.map +0 -1
  448. package/dist/commands/publish-schema-to-db/pg-models/tables/index.d.ts +0 -3
  449. package/dist/commands/publish-schema-to-db/pg-models/tables/index.js +0 -7
  450. package/dist/commands/publish-schema-to-db/pg-models/tables/index.js.map +0 -1
  451. package/dist/commands/publish-schema-to-db/pg-models/tables/object-property-table.js +0 -73
  452. package/dist/commands/publish-schema-to-db/pg-models/tables/object-property-table.js.map +0 -1
  453. package/dist/commands/publish-schema-to-db/pg-models/tables/relations-table.js +0 -61
  454. package/dist/commands/publish-schema-to-db/pg-models/tables/relations-table.js.map +0 -1
  455. package/dist/commands/publish-schema-to-db/postprocessors/collection-postprocessor.d.ts +0 -2
  456. package/dist/commands/publish-schema-to-db/postprocessors/collection-postprocessor.js +0 -21
  457. package/dist/commands/publish-schema-to-db/postprocessors/collection-postprocessor.js.map +0 -1
  458. package/dist/commands/publish-schema-to-db/postprocessors/content-entity-model-postprocessor.js +0 -3
  459. package/dist/commands/publish-schema-to-db/postprocessors/content-entity-model-postprocessor.js.map +0 -1
  460. package/dist/commands/publish-schema-to-db/postprocessors/episode-postprocessor.d.ts +0 -2
  461. package/dist/commands/publish-schema-to-db/postprocessors/episode-postprocessor.js +0 -25
  462. package/dist/commands/publish-schema-to-db/postprocessors/episode-postprocessor.js.map +0 -1
  463. package/dist/commands/publish-schema-to-db/postprocessors/index.d.ts +0 -6
  464. package/dist/commands/publish-schema-to-db/postprocessors/index.js +0 -10
  465. package/dist/commands/publish-schema-to-db/postprocessors/index.js.map +0 -1
  466. package/dist/commands/publish-schema-to-db/postprocessors/movie-postprocessor.d.ts +0 -2
  467. package/dist/commands/publish-schema-to-db/postprocessors/movie-postprocessor.js +0 -21
  468. package/dist/commands/publish-schema-to-db/postprocessors/movie-postprocessor.js.map +0 -1
  469. package/dist/commands/publish-schema-to-db/postprocessors/postprocessing-utils.d.ts +0 -4
  470. package/dist/commands/publish-schema-to-db/postprocessors/postprocessing-utils.js +0 -19
  471. package/dist/commands/publish-schema-to-db/postprocessors/postprocessing-utils.js.map +0 -1
  472. package/dist/commands/publish-schema-to-db/postprocessors/season-postprocessor.d.ts +0 -2
  473. package/dist/commands/publish-schema-to-db/postprocessors/season-postprocessor.js +0 -25
  474. package/dist/commands/publish-schema-to-db/postprocessors/season-postprocessor.js.map +0 -1
  475. package/dist/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.d.ts +0 -2
  476. package/dist/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.js +0 -21
  477. package/dist/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.js.map +0 -1
  478. package/dist/commands/publish-schema-to-db/publish-schema-to-db-options.js +0 -3
  479. package/dist/commands/publish-schema-to-db/publish-schema-to-db-options.js.map +0 -1
  480. package/dist/commands/service/index.js +0 -17
  481. package/dist/commands/service/index.js.map +0 -1
  482. package/dist/commands/service/purge-permissions/purge-permissions-command.d.ts +0 -3
  483. package/dist/commands/service/purge-permissions/purge-permissions-command.js.map +0 -1
  484. package/dist/commands/service/purge-permissions/purge-permissions-options.js +0 -3
  485. package/dist/commands/service/purge-permissions/purge-permissions-options.js.map +0 -1
  486. package/dist/commands/service/purge-permissions/purge-permissions.js +0 -54
  487. package/dist/commands/service/purge-permissions/purge-permissions.js.map +0 -1
  488. package/dist/commands/service/sync-permissions/sync-permission-command.d.ts +0 -3
  489. package/dist/commands/service/sync-permissions/sync-permission-command.js.map +0 -1
  490. package/dist/commands/service/sync-permissions/sync-permissions-options.js +0 -3
  491. package/dist/commands/service/sync-permissions/sync-permissions-options.js.map +0 -1
  492. package/dist/commands/service/sync-permissions/sync-permissions.js +0 -67
  493. package/dist/commands/service/sync-permissions/sync-permissions.js.map +0 -1
  494. package/dist/commands/unpublish-pilet/index.d.ts +0 -3
  495. package/dist/commands/unpublish-pilet/index.js.map +0 -1
  496. package/dist/commands/unpublish-pilet/unpublish-pilet-options.js +0 -3
  497. package/dist/commands/unpublish-pilet/unpublish-pilet-options.js.map +0 -1
  498. package/dist/commands/unpublish-pilet/unpublish-pilet.js +0 -19
  499. package/dist/commands/unpublish-pilet/unpublish-pilet.js.map +0 -1
  500. package/dist/common/index.d.ts +0 -1
  501. package/dist/common/index.js +0 -5
  502. package/dist/common/index.js.map +0 -1
  503. package/dist/common/utils.js.map +0 -1
  504. package/dist/exports.d.ts +0 -2
  505. package/dist/exports.js +0 -6
  506. package/dist/exports.js.map +0 -1
  507. package/dist/index.d.ts +0 -1
  508. package/dist/index.js +0 -6
  509. package/dist/index.js.map +0 -1
  510. /package/dist/{commands/get-access-token → cjs/lib}/get-access-token-options.d.ts +0 -0
  511. /package/dist/{commands/get-access-token → cjs/lib}/get-access-token-options.js +0 -0
  512. /package/dist/{commands/get-access-token → cjs/lib}/get-dev-access-token.js +0 -0
  513. /package/dist/{cli → esm/cli}/index.d.ts +0 -0
  514. /package/dist/{commands → esm/commands}/apply-templates/bitwarden-vault.d.ts +0 -0
  515. /package/dist/{commands → esm/commands}/create/defaultValues.d.ts +0 -0
  516. /package/dist/{commands → esm/commands}/create/helpers/logger.d.ts +0 -0
  517. /package/dist/{commands → esm/commands}/create/helpers/types.d.ts +0 -0
  518. /package/dist/{commands → esm/commands}/create-extension-config/create-extension-config.d.ts +0 -0
  519. /package/dist/{commands → esm/commands}/hosting/manifest/upload-manifest-options.d.ts +0 -0
  520. /package/dist/{commands → esm/commands}/hosting/pilet/register-pilet-options.d.ts +0 -0
  521. /package/dist/{commands → esm/commands}/hosting/service/deploy/service-deploy-options.d.ts +0 -0
  522. /package/dist/{commands → esm/commands}/hosting/service/undeploy/service-undeploy-options.d.ts +0 -0
  523. /package/dist/{commands → esm/commands}/msg-diff/git-checkout-tmp.d.ts +0 -0
  524. /package/dist/{commands → esm/commands}/msg-diff/message-diff-options.d.ts +0 -0
  525. /package/dist/{commands → esm/commands}/pg-dump/pg-dump-options.d.ts +0 -0
  526. /package/dist/{commands → esm/commands}/publish-schema-to-db/abstractions/pg-type.d.ts +0 -0
  527. /package/dist/{commands → esm/commands}/publish-schema-to-db/publish-schema-to-db-options.d.ts +0 -0
  528. /package/dist/{commands → esm/commands}/service/purge-permissions/purge-permissions-options.d.ts +0 -0
  529. /package/dist/{commands → esm/commands}/service/sync-permissions/sync-permissions-options.d.ts +0 -0
  530. /package/dist/{commands → esm/commands}/unpublish-pilet/unpublish-pilet-options.d.ts +0 -0
  531. /package/dist/{common → esm/common}/utils.d.ts +0 -0
  532. /package/src/{commands/get-access-token → lib}/get-access-token-options.ts +0 -0
@@ -1,15 +1,17 @@
1
1
  import {
2
- AsyncAPIDocumentInterface,
3
- Diagnostic,
2
+ type AsyncAPIDocumentInterface,
3
+ type Diagnostic,
4
4
  fromFile,
5
5
  Parser,
6
6
  } from '@asyncapi/parser';
7
7
  import * as fs from 'fs';
8
+ import { dirname } from 'path';
9
+ import { fileURLToPath } from 'url';
8
10
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
9
- import { MessageDiffOptions } from './message-diff-options';
10
- import { MessageDiff } from './msg-diff';
11
+ import type { MessageDiffOptions } from './message-diff-options.js';
12
+ import { MessageDiff } from './msg-diff.js';
11
13
 
12
- const resources = `${__dirname}/test-resources`;
14
+ const resources = `${dirname(fileURLToPath(import.meta.url))}/test-resources`;
13
15
 
14
16
  describe('sanity', () => {
15
17
  const options: MessageDiffOptions = {
@@ -1,20 +1,27 @@
1
1
  /* eslint-disable no-console */
2
- import { diff, DiffOutputItem } from '@asyncapi/diff';
3
- import Parser, {
4
- AsyncAPIDocumentInterface,
5
- ChannelInterface,
2
+ import { diff, type DiffOutputItem } from '@asyncapi/diff';
3
+ import _Parser, {
4
+ type AsyncAPIDocumentInterface,
5
+ type ChannelInterface,
6
6
  fromFile,
7
- SchemaInterface,
7
+ type SchemaInterface,
8
8
  } from '@asyncapi/parser';
9
- import { green, red, white } from 'chalk';
9
+ import chalk from 'chalk';
10
10
  import * as jsonDiff from 'diff';
11
11
  import * as fs from 'fs';
12
- import * as jsonSchemaDiff from 'json-schema-diff';
12
+ import jsonSchemaDiff from 'json-schema-diff';
13
13
  import * as path from 'path';
14
- import { exitCode } from '../../common';
15
- import { override } from './asyncapi-override';
16
- import { GitCheckoutTmp } from './git-checkout-tmp';
17
- import { MessageDiffOptions } from './message-diff-options';
14
+ import { exitCode } from '../../common/index.js';
15
+ import { override } from './asyncapi-override.js';
16
+ import { GitCheckoutTmp } from './git-checkout-tmp.js';
17
+ import type { MessageDiffOptions } from './message-diff-options.js';
18
+ // @asyncapi/parser is a TypeScript-compiled CJS package that emits
19
+ // `module.exports = { __esModule: true, default: value }`.
20
+ // Node.js native ESM does not honour the __esModule sentinel, so the default
21
+ // import receives the whole module.exports wrapper. Pattern 9 in
22
+ // ESM_MIGRATION_GUIDE.md. The `?? _Parser` fallback keeps the CJS build safe.
23
+ const Parser = ((_Parser as any).default ?? _Parser) as typeof _Parser;
24
+ const { green, red, white } = chalk;
18
25
 
19
26
  /**
20
27
  * Diff results. Each file (asyncapi document or payload) is classified to one of 'skipped', 'same', 'changed' or 'breaking'.
@@ -333,7 +340,7 @@ export class MessageDiff {
333
340
  throw new Error(`Could not find payload schema`);
334
341
  }
335
342
 
336
- let result: jsonSchemaDiff.DiffResult;
343
+ let result: Awaited<ReturnType<typeof jsonSchemaDiff.diffSchemas>>;
337
344
  try {
338
345
  result = await jsonSchemaDiff.diffSchemas({
339
346
  sourceSchema: schema1.json(),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type":"object",
3
+ "type": "object",
4
4
  "title": "synchronize_claim_definitions_start_command",
5
5
  "description": "Synchronize claim definitions start command schema.",
6
6
  "additionalProperties": false,
@@ -21,11 +21,7 @@
21
21
  "type": "object",
22
22
  "title": "claim_definition_group",
23
23
  "additionalProperties": false,
24
- "required": [
25
- "title",
26
- "selection_mode",
27
- "claim_definitions"
28
- ],
24
+ "required": ["title", "selection_mode", "claim_definitions"],
29
25
  "properties": {
30
26
  "title": {
31
27
  "$ref": "../common.json#/definitions/non_empty_string",
@@ -35,10 +31,7 @@
35
31
  "type": "string",
36
32
  "title": "claim_selection_mode",
37
33
  "description": "Selection options for a claim definition group.",
38
- "enum": [
39
- "SINGLE",
40
- "MULTIPLE"
41
- ]
34
+ "enum": ["SINGLE", "MULTIPLE"]
42
35
  },
43
36
  "claim_definitions": {
44
37
  "type": "array",
@@ -55,10 +48,7 @@
55
48
  "type": "object",
56
49
  "title": "claim_definition",
57
50
  "additionalProperties": false,
58
- "required": [
59
- "claim",
60
- "title"
61
- ],
51
+ "required": ["claim", "title"],
62
52
  "properties": {
63
53
  "claim": {
64
54
  "$ref": "../common.json#/definitions/non_empty_string",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type":"object",
3
+ "type": "object",
4
4
  "title": "example_post_created_event",
5
5
  "description": "New post created event.",
6
6
  "properties": {
@@ -18,8 +18,5 @@
18
18
  }
19
19
  },
20
20
  "additionalProperties": false,
21
- "required": [
22
- "title",
23
- "content"
24
- ]
21
+ "required": ["title", "content"]
25
22
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type":"object",
3
+ "type": "object",
4
4
  "title": "example_post_created_event",
5
5
  "description": "New post created event.",
6
6
  "properties": {
@@ -18,8 +18,5 @@
18
18
  }
19
19
  },
20
20
  "additionalProperties": false,
21
- "required": [
22
- "title",
23
- "content"
24
- ]
21
+ "required": ["title", "content"]
25
22
  }
@@ -6,11 +6,11 @@ import {
6
6
  pick,
7
7
  } from '@axinom/mosaic-service-common';
8
8
  import chalk from 'chalk';
9
- import { ExecException, exec } from 'child_process';
9
+ import { type ExecException, exec } from 'child_process';
10
10
  import { existsSync, mkdirSync, statSync } from 'fs';
11
11
  import { basename, dirname, isAbsolute, join, normalize, relative } from 'path';
12
- import { exitCode, getTimestamp } from '../../common';
13
- import { PgDumpOptions } from './pg-dump-options';
12
+ import { exitCode, getTimestamp } from '../../common/index.js';
13
+ import type { PgDumpOptions } from './pg-dump-options.js';
14
14
 
15
15
  /**
16
16
  * Type needed for findCompose functions
@@ -1,6 +1,6 @@
1
- import { CommandModule } from 'yargs';
2
- import { generate } from './generate';
3
- import { PgDumpOptions } from './pg-dump-options';
1
+ import type { CommandModule } from 'yargs';
2
+ import { generate } from './generate.js';
3
+ import type { PgDumpOptions } from './pg-dump-options.js';
4
4
 
5
5
  export const pgDump: CommandModule<unknown, PgDumpOptions> = {
6
6
  command: 'pg-dump',
@@ -122,9 +122,10 @@ Mapping of supported property types to DB constructs:
122
122
  > Checked a bit on the implementation. The "ignored properties" seems to be
123
123
  > just a flat string list. So it is not possible to exclude propertyA from
124
124
  > movie but keep propertyB on TV show - right? In the used env variable I see
125
- > $schema,related_items. The schema part I understand (and I would even hard-code that potentially - or even exclude anything starting with $).
126
- > But for "related_items" I am very unsure about. The name can be custom, it
127
- > can change over time etc. I would rather say to hard code the \$ part. And
128
- > then have some callback function that you can implement in code that would
129
- > get the content type (and for objects also that type). And then this could
130
- > be customized to exclude if it is needed.
125
+ > $schema,related_items. The schema part I understand (and I would even
126
+ > hard-code that potentially - or even exclude anything starting with $). But
127
+ > for "related_items" I am very unsure about. The name can be custom, it can
128
+ > change over time etc. I would rather say to hard code the \$ part. And then
129
+ > have some callback function that you can implement in code that would get
130
+ > the content type (and for objects also that type). And then this could be
131
+ > customized to exclude if it is needed.
@@ -1,4 +1,4 @@
1
- import { PgSmartTagTags } from 'graphile-utils/node8plus/makePgSmartTagsPlugin';
1
+ import type { PgSmartTagTags } from 'graphile-utils/node8plus/makePgSmartTagsPlugin';
2
2
 
3
3
  export interface BaseSmartTags {
4
4
  tags?: PgSmartTagTags;
@@ -1,5 +1,5 @@
1
- export * from './base-smart-tags';
2
- export * from './pg-column';
3
- export * from './pg-fk-column';
4
- export * from './pg-table';
5
- export * from './pg-type';
1
+ export * from './base-smart-tags.js';
2
+ export * from './pg-column.js';
3
+ export * from './pg-fk-column.js';
4
+ export * from './pg-table.js';
5
+ export * from './pg-type.js';
@@ -1,6 +1,6 @@
1
- import { BaseSmartTags } from './base-smart-tags';
2
- import { PgTable } from './pg-table';
3
- import { PgType } from './pg-type';
1
+ import type { BaseSmartTags } from './base-smart-tags.js';
2
+ import type { PgTable } from './pg-table.js';
3
+ import type { PgType } from './pg-type.js';
4
4
 
5
5
  /**
6
6
  * Abstraction over a Postgres table column.
@@ -1,4 +1,4 @@
1
- import { PgColumn } from './pg-column';
1
+ import type { PgColumn } from './pg-column.js';
2
2
 
3
3
  export interface PgFkColumn extends PgColumn {
4
4
  readonly targetPk: PgColumn;
@@ -1,7 +1,7 @@
1
- import { PgSmartTagTags } from 'graphile-utils';
2
- import { BaseSmartTags } from './base-smart-tags';
3
- import { PgColumn } from './pg-column';
4
- import { PgFkColumn } from './pg-fk-column';
1
+ import type { PgSmartTagTags } from 'graphile-utils';
2
+ import type { BaseSmartTags } from './base-smart-tags.js';
3
+ import type { PgColumn } from './pg-column.js';
4
+ import type { PgFkColumn } from './pg-fk-column.js';
5
5
 
6
6
  // TODO: Consider adding a separate property for FKs for consistency.
7
7
  /**
@@ -1,10 +1,13 @@
1
1
  /* eslint-disable no-console */
2
- import { JSONSchema4 } from 'json-schema';
3
- import { PgTable, TableSmartTags } from './abstractions';
4
- import { separateProperties } from './pg-models/json-schema-parse-utils';
5
- import { isReservedPgWord } from './pg-models/pg-sql-gen-utils';
6
- import { ContentEntityTable, ObjectPropertyTable } from './pg-models/tables';
7
- import { PublishSchemaToDbOptions } from './publish-schema-to-db-options';
2
+ import type { JSONSchema4 } from 'json-schema';
3
+ import type { PgTable, TableSmartTags } from './abstractions/index.js';
4
+ import { separateProperties } from './pg-models/json-schema-parse-utils.js';
5
+ import { isReservedPgWord } from './pg-models/pg-sql-gen-utils.js';
6
+ import {
7
+ ContentEntityTable,
8
+ ObjectPropertyTable,
9
+ } from './pg-models/tables/index.js';
10
+ import type { PublishSchemaToDbOptions } from './publish-schema-to-db-options.js';
8
11
 
9
12
  export class ContentEntityModel {
10
13
  public name: string;
@@ -1,20 +1,20 @@
1
1
  /* eslint-disable no-console */
2
- import { JSONPgSmartTags } from 'graphile-utils';
2
+ import type { JSONPgSmartTags } from 'graphile-utils';
3
3
  import * as path from 'path';
4
- import { exitCode } from '../../common';
5
- import { ContentEntityModel } from './content-entity-model';
6
- import { getContentMetadataSchemas } from './pg-models/json-schema-parse-utils';
7
- import { generateMigration } from './pg-models/pg-sql-gen-utils';
8
- import { generateSmartTagsPlugin } from './pg-models/pgl-utils';
4
+ import { exitCode } from '../../common/index.js';
5
+ import { ContentEntityModel } from './content-entity-model.js';
6
+ import { getContentMetadataSchemas } from './pg-models/json-schema-parse-utils.js';
7
+ import { generateMigration } from './pg-models/pg-sql-gen-utils.js';
8
+ import { generateSmartTagsPlugin } from './pg-models/pgl-utils.js';
9
9
  import {
10
10
  collectionPostprocessor,
11
- ContentEntityModelPostprocessor,
11
+ type ContentEntityModelPostprocessor,
12
12
  episodePostprocessor,
13
13
  moviePostprocessor,
14
14
  seasonPostprocessor,
15
15
  tvshowPostprocessor,
16
- } from './postprocessors';
17
- import { PublishSchemaToDbOptions } from './publish-schema-to-db-options';
16
+ } from './postprocessors/index.js';
17
+ import type { PublishSchemaToDbOptions } from './publish-schema-to-db-options.js';
18
18
 
19
19
  /**
20
20
  * Generates a database schema from an asset publish format JSON schema.
@@ -1,6 +1,6 @@
1
- import { CommandModule } from 'yargs';
2
- import { generate } from './generate';
3
- import { PublishSchemaToDbOptions } from './publish-schema-to-db-options';
1
+ import type { CommandModule } from 'yargs';
2
+ import { generate } from './generate.js';
3
+ import type { PublishSchemaToDbOptions } from './publish-schema-to-db-options.js';
4
4
 
5
5
  export const publishSchemaToDb: CommandModule<
6
6
  unknown,
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from 'vitest';
2
- import { PgColumn, PgTable, PgType } from '../../abstractions';
3
- import { FkColumn } from './fk-column';
2
+ import type { PgColumn, PgTable, PgType } from '../../abstractions/index.js';
3
+ import { FkColumn } from './fk-column.js';
4
4
 
5
5
  interface FkColumnTestInput {
6
6
  pkType: PgType;
@@ -1,11 +1,11 @@
1
1
  import {
2
- BaseSmartTags,
3
- PgColumn,
4
- PgFkColumn,
5
- PgTable,
6
- PgType,
7
- } from '../../abstractions';
8
- import { buildName } from '../pg-sql-gen-utils';
2
+ type BaseSmartTags,
3
+ type PgColumn,
4
+ type PgFkColumn,
5
+ type PgTable,
6
+ type PgType,
7
+ } from '../../abstractions/index.js';
8
+ import { buildName } from '../pg-sql-gen-utils.js';
9
9
 
10
10
  export class FkColumn implements PgFkColumn {
11
11
  name: string;
@@ -1,4 +1,4 @@
1
- export * from './fk-column';
2
- export * from './pk-column';
3
- export * from './primitive-column';
4
- export * from './virtual-fk-column';
1
+ export * from './fk-column.js';
2
+ export * from './pk-column.js';
3
+ export * from './primitive-column.js';
4
+ export * from './virtual-fk-column.js';
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from 'vitest';
2
- import { PgTable, PgType } from '../../abstractions';
3
- import { PkColumn } from './pk-column';
2
+ import type { PgTable, PgType } from '../../abstractions/index.js';
3
+ import { PkColumn } from './pk-column.js';
4
4
 
5
5
  interface PkColumnTestInput {
6
6
  type: PgType;
@@ -1,4 +1,9 @@
1
- import { BaseSmartTags, PgColumn, PgTable, PgType } from '../../abstractions';
1
+ import type {
2
+ BaseSmartTags,
3
+ PgColumn,
4
+ PgTable,
5
+ PgType,
6
+ } from '../../abstractions/index.js';
2
7
 
3
8
  export class PkColumn implements PgColumn {
4
9
  name: string;
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from 'vitest';
2
- import { PgTable } from '../../abstractions';
3
- import { PrimitiveColumn } from './primitive-column';
2
+ import type { PgTable } from '../../abstractions/index.js';
3
+ import { PrimitiveColumn } from './primitive-column.js';
4
4
 
5
5
  const dummyTable: PgTable = {
6
6
  name: 'some_table',
@@ -1,4 +1,9 @@
1
- import { BaseSmartTags, PgColumn, PgTable, PgType } from '../../abstractions';
1
+ import type {
2
+ BaseSmartTags,
3
+ PgColumn,
4
+ PgTable,
5
+ PgType,
6
+ } from '../../abstractions/index.js';
2
7
 
3
8
  export interface PrimitiveColumnOptions {
4
9
  description?: string;
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from 'vitest';
2
- import { PgColumn, PgTable } from '../../abstractions';
3
- import { VirtualFkColumn } from './virtual-fk-column';
2
+ import type { PgColumn, PgTable } from '../../abstractions/index.js';
3
+ import { VirtualFkColumn } from './virtual-fk-column.js';
4
4
 
5
5
  describe('VirtualFkColumn', () => {
6
6
  test('Virtual FK is created with correct references', () => {
@@ -1,11 +1,11 @@
1
1
  import {
2
- BaseSmartTags,
3
- PgColumn,
4
- PgFkColumn,
5
- PgTable,
6
- PgType,
7
- } from '../../abstractions';
8
- import { buildName } from '../pg-sql-gen-utils';
2
+ type BaseSmartTags,
3
+ type PgColumn,
4
+ type PgFkColumn,
5
+ type PgTable,
6
+ type PgType,
7
+ } from '../../abstractions/index.js';
8
+ import { buildName } from '../pg-sql-gen-utils.js';
9
9
 
10
10
  export class VirtualFkColumn implements PgFkColumn {
11
11
  name: string;
@@ -1,7 +1,7 @@
1
- import { JSONSchema4 } from 'json-schema';
1
+ import type { JSONSchema4 } from 'json-schema';
2
2
  import { describe, expect, test } from 'vitest';
3
- import { PgType } from '../abstractions';
4
- import { getPropertySchema, mapToPgType } from './json-schema-parse-utils';
3
+ import type { PgType } from '../abstractions/index.js';
4
+ import { getPropertySchema, mapToPgType } from './json-schema-parse-utils.js';
5
5
 
6
6
  describe('mapToPgType', () => {
7
7
  interface TestInput {
@@ -1,7 +1,9 @@
1
- import { glob } from 'glob';
2
- import { JSONSchema4 } from 'json-schema';
3
- import { dereference } from 'json-schema-ref-parser';
4
- import { PgType } from '../abstractions';
1
+ import glob from 'glob';
2
+ import type { JSONSchema4 } from 'json-schema';
3
+ import refParser from 'json-schema-ref-parser';
4
+ import type { PgType } from '../abstractions/index.js';
5
+ const { dereference } =
6
+ refParser as unknown as typeof import('json-schema-ref-parser');
5
7
 
6
8
  /**
7
9
  * Returns true if a JSON schema property element is a primitive property.
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, test } from 'vitest';
2
- import { buildName } from './pg-sql-gen-utils';
2
+ import { buildName } from './pg-sql-gen-utils.js';
3
3
 
4
4
  describe('buildName', () => {
5
5
  test('single part', () => {
@@ -2,8 +2,7 @@
2
2
  import * as fs from 'fs';
3
3
  import * as path from 'path';
4
4
  import { format } from 'sql-formatter';
5
- import { PgColumn, PgTable } from '../abstractions';
6
- import { ContentEntityModel } from '../content-entity-model';
5
+ import type { PgTable } from '../abstractions/index.js';
7
6
 
8
7
  export function buildFullTableName(tableName: string, schema?: string): string {
9
8
  return schema ? `${schema}.${tableName}` : tableName;
@@ -117,41 +116,6 @@ export function buildName(...nameParts: string[]): string {
117
116
  return nameParts.join('_');
118
117
  }
119
118
 
120
- export function renameDbItem(
121
- item: PgTable | PgColumn,
122
- newName: string,
123
- displayName?: string,
124
- ): void {
125
- item.name = newName;
126
- if (displayName) {
127
- item.displayName = displayName;
128
- }
129
- }
130
-
131
- export interface NameOverride {
132
- [name: string]: [string, string?];
133
- }
134
-
135
- export function applyNameOverrides(
136
- model: ContentEntityModel,
137
- overrides: NameOverride,
138
- ): void {
139
- const mainModelTables = [model.contentEntity, ...model.relatedObjects];
140
-
141
- for (const table of mainModelTables) {
142
- let rename = overrides[table.name];
143
- if (rename) {
144
- renameDbItem(table, ...rename);
145
- }
146
- for (const column of table.columns) {
147
- rename = overrides[column.name];
148
- if (rename) {
149
- renameDbItem(column, ...rename);
150
- }
151
- }
152
- }
153
- }
154
-
155
119
  export function isReservedPgWord(s: string): boolean {
156
120
  return PgReservedWords.includes(s.toUpperCase());
157
121
  }
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, test } from 'vitest';
2
- import { snakeCaseToCamelCase } from './pgl-utils';
2
+ import { snakeCaseToCamelCase } from './pgl-utils.js';
3
3
 
4
4
  describe('snakeCaseToCamelCase', () => {
5
5
  test('single part', () => {
@@ -1,15 +1,22 @@
1
- import endent from 'endent';
1
+ import _endent from 'endent';
2
2
  import * as fs from 'fs';
3
- import { JSONPgSmartTags } from 'graphile-utils';
4
- import * as JSON5 from 'json5';
3
+ import type { JSONPgSmartTags } from 'graphile-utils';
4
+ import JSON5 from 'json5';
5
5
  import * as path from 'path';
6
6
  import {
7
- BaseSmartTags,
8
- PgColumn,
9
- PgFkColumn,
10
- PgTable,
11
- TableSmartTags,
12
- } from '../abstractions';
7
+ type BaseSmartTags,
8
+ type PgColumn,
9
+ type PgFkColumn,
10
+ type PgTable,
11
+ type TableSmartTags,
12
+ } from '../abstractions/index.js';
13
+ // endent is a TypeScript-compiled CJS package that emits
14
+ // `module.exports = { __esModule: true, default: value }`.
15
+ // Node.js native ESM does not honour the __esModule sentinel — the default
16
+ // import receives the whole module.exports wrapper. `endent.pretty()` is also
17
+ // accessible via `.default.pretty`. Pattern 9 in ESM_MIGRATION_GUIDE.md.
18
+ // The `?? _endent` fallback keeps the CJS build safe.
19
+ const endent = ((_endent as any).default ?? _endent) as typeof _endent;
13
20
 
14
21
  /**
15
22
  * Builds smart tags for FK constraints.
@@ -101,7 +108,8 @@ export function generateSmartTagsPlugin(
101
108
  console.log(`Writing smart tags plugn to to ${outPath}.`);
102
109
 
103
110
  const pluginSrc = endent`
104
- import { makeJSONPgSmartTagsPlugin } from 'graphile-utils';
111
+ import graphileUtils from 'graphile-utils';
112
+ const { makeJSONPgSmartTagsPlugin } = graphileUtils;
105
113
  /**
106
114
  * Smart tags to adjust and enhance the generated GraphQL API.
107
115
  */
@@ -1,17 +1,17 @@
1
- import { JSONSchema4 } from 'json-schema';
1
+ import type { JSONSchema4 } from 'json-schema';
2
2
  import {
3
- PgColumn,
4
- PgFkColumn,
5
- PgTable,
6
- TableSmartTags,
7
- } from '../../abstractions';
8
- import { PublishSchemaToDbOptions } from '../../publish-schema-to-db-options';
9
- import { PkColumn, PrimitiveColumn } from '../columns';
3
+ type PgColumn,
4
+ type PgFkColumn,
5
+ type PgTable,
6
+ type TableSmartTags,
7
+ } from '../../abstractions/index.js';
8
+ import type { PublishSchemaToDbOptions } from '../../publish-schema-to-db-options.js';
9
+ import { PkColumn, PrimitiveColumn } from '../columns/index.js';
10
10
  import {
11
11
  filterProperties,
12
12
  isPrimitiveProperty,
13
13
  mapToPgType,
14
- } from '../json-schema-parse-utils';
14
+ } from '../json-schema-parse-utils.js';
15
15
  import {
16
16
  buildAdditionalTableStatements,
17
17
  buildCreateTable,
@@ -19,8 +19,8 @@ import {
19
19
  buildFullTableName,
20
20
  buildInsertUpdateGrants,
21
21
  buildSelectDeleteGrants,
22
- } from '../pg-sql-gen-utils';
23
- import { buildAttributeSmartTags } from '../pgl-utils';
22
+ } from '../pg-sql-gen-utils.js';
23
+ import { buildAttributeSmartTags } from '../pgl-utils.js';
24
24
 
25
25
  /**
26
26
  * Table model for storing primitive properties of a root entity (movie, collection etc.).
@@ -1,3 +1,3 @@
1
- export * from './content-entity-table';
2
- export * from './object-property-table';
3
- export * from './relations-table';
1
+ export * from './content-entity-table.js';
2
+ export * from './object-property-table.js';
3
+ export * from './relations-table.js';