@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,10 +1,10 @@
1
1
  import { ExitPromptError } from '@inquirer/core';
2
- import { CommandModule } from 'yargs';
3
- import { createSolution } from './createSolution';
4
- import { defaultValues } from './defaultValues';
5
- import { logger, setDebug } from './helpers/logger';
6
- import { CliResults } from './helpers/types';
7
- import { runQuestionaire } from './runQuestionaire';
2
+ import type { CommandModule } from 'yargs';
3
+ import { createSolution } from './createSolution.js';
4
+ import { defaultValues } from './defaultValues.js';
5
+ import { logger, setDebug } from './helpers/logger.js';
6
+ import type { CliResults } from './helpers/types.js';
7
+ import { runQuestionaire } from './runQuestionaire.js';
8
8
 
9
9
  export const createSolutionCommand: CommandModule<unknown, CliResults> = {
10
10
  command: 'create',
@@ -4,9 +4,9 @@ import { createGunzip } from 'node:zlib';
4
4
  import * as path from 'path';
5
5
  import { simpleGit } from 'simple-git';
6
6
  import { extract } from 'tar';
7
- import { getCommitId } from './helpers/git';
8
- import * as logger from './helpers/logger';
9
- import { CreateSolutionInput } from './helpers/types';
7
+ import { getCommitId } from './helpers/git.js';
8
+ import * as logger from './helpers/logger.js';
9
+ import type { CreateSolutionInput } from './helpers/types.js';
10
10
 
11
11
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
12
12
  const getOra = async () => (await import('ora')).default;
@@ -1,4 +1,4 @@
1
- import { CreateSolutionInput } from './types';
1
+ import type { CreateSolutionInput } from './types.js';
2
2
 
3
3
  export const getBranches = async (): Promise<string[]> => {
4
4
  const branches: string[] = [];
@@ -1,9 +1,9 @@
1
1
  import confirm from '@inquirer/confirm';
2
2
  import input from '@inquirer/input';
3
3
  import select from '@inquirer/select';
4
- import { defaultValues } from './defaultValues';
5
- import { getBranches } from './helpers/git';
6
- import { CliResults } from './helpers/types';
4
+ import { defaultValues } from './defaultValues.js';
5
+ import { getBranches } from './helpers/git.js';
6
+ import type { CliResults } from './helpers/types.js';
7
7
 
8
8
  /**
9
9
  * Runs the questionnaire to gather user input for the project creation.
@@ -3,7 +3,7 @@ import findNearestFile from 'find-nearest-file';
3
3
  import * as fs from 'fs';
4
4
  import * as path from 'path';
5
5
  import { promisify } from 'util';
6
- import { exitCode } from '../../common';
6
+ import { exitCode, getCliExtensionFactory } from '../../common/index.js';
7
7
 
8
8
  const execAsync = promisify(exec);
9
9
 
@@ -74,8 +74,8 @@ export const createExtensionConfig = async (): Promise<void> => {
74
74
  installedMosaicLibs.map(async (lib: string) => {
75
75
  //filter libraries, that have cli extension
76
76
  try {
77
- const result = await import(lib);
78
- if (result.cliExtension) {
77
+ const cliExtension = getCliExtensionFactory(await import(lib));
78
+ if (cliExtension) {
79
79
  extensions.push(lib);
80
80
  }
81
81
  } catch (error) {
@@ -1,9 +1,9 @@
1
1
  import * as dotenv from 'dotenv';
2
- import { CommandModule } from 'yargs';
2
+ import type { CommandModule } from 'yargs';
3
3
  import {
4
4
  createExtensionConfig,
5
5
  getExtensionConfigPath,
6
- } from './create-extension-config';
6
+ } from './create-extension-config.js';
7
7
 
8
8
  export const createExtensionConfigCommand: CommandModule<unknown, undefined> = {
9
9
  command: 'create-extension-config',
@@ -1,9 +1,9 @@
1
1
  import { ensureError } from '@axinom/mosaic-service-common';
2
2
  import chalk from 'chalk';
3
- import { CommandModule } from 'yargs';
4
- import { exitCode } from '../../common';
5
- import { GetAccessTokenOptions } from './get-access-token-options';
6
- import { getDevAccessToken } from './get-dev-access-token';
3
+ import type { CommandModule } from 'yargs';
4
+ import { exitCode } from '../../common/index.js';
5
+ import type { GetAccessTokenOptions } from '../../lib/get-access-token-options.js';
6
+ import { getDevAccessToken } from '../../lib/get-dev-access-token.js';
7
7
 
8
8
  export const getAccessToken: CommandModule<unknown, GetAccessTokenOptions> = {
9
9
  command: 'get-access-token',
@@ -6,13 +6,14 @@
6
6
  /* eslint-disable no-console */
7
7
  /* eslint-disable @typescript-eslint/no-explicit-any */
8
8
  import { CriticalityLevel, diff } from '@graphql-inspector/core';
9
- import { green, red } from 'chalk';
9
+ import chalk from 'chalk';
10
10
  import { execSync } from 'child_process';
11
11
  import * as fs from 'fs';
12
12
  import { GraphQLSchema, buildSchema } from 'graphql';
13
13
  import * as path from 'path';
14
- import { CommandModule } from 'yargs';
15
- import { exitCode } from '../common';
14
+ import type { CommandModule } from 'yargs';
15
+ import { exitCode } from '../common/index.js';
16
+ const { green, red } = chalk;
16
17
 
17
18
  interface GraphqlDiffOptions {
18
19
  files: (string | number)[];
@@ -69,8 +70,7 @@ async function gqlDiff(
69
70
  branch: string,
70
71
  verbose: boolean,
71
72
  ): Promise<number> {
72
- const root = path.dirname(__dirname);
73
- const relPath = path.relative(root, file);
73
+ const relPath = path.relative(process.cwd(), file);
74
74
  console.log(`Comparing schema '${relPath}' with branch '${branch}':`);
75
75
 
76
76
  let schema1: GraphQLSchema | undefined = undefined;
@@ -1,7 +1,7 @@
1
- import { CommandModule } from 'yargs';
2
- import { manifestCommands } from './manifest/manifest-commands';
3
- import { piletCommands } from './pilet/pilet-commands';
4
- import { serviceCommands } from './service/service-commands';
1
+ import type { CommandModule } from 'yargs';
2
+ import { manifestCommands } from './manifest/manifest-commands.js';
3
+ import { piletCommands } from './pilet/pilet-commands.js';
4
+ import { serviceCommands } from './service/service-commands.js';
5
5
 
6
6
  export const hosting: CommandModule<unknown, unknown> = {
7
7
  command: 'hosting',
@@ -1,6 +1,6 @@
1
- import { CommandModule } from 'yargs';
2
- import { uploadDeploymentManifest, validateArgs } from './upload-manifest';
3
- import { GetUploadManifestOptions } from './upload-manifest-options';
1
+ import type { CommandModule } from 'yargs';
2
+ import type { GetUploadManifestOptions } from './upload-manifest-options.js';
3
+ import { uploadDeploymentManifest, validateArgs } from './upload-manifest.js';
4
4
 
5
5
  export const manifestCommands: CommandModule<unknown, unknown> = {
6
6
  builder: (yargs) =>
@@ -1,11 +1,11 @@
1
1
  import { getServiceAccountToken } from '@axinom/mosaic-id-link-be';
2
2
  import { isNullOrWhitespace } from '@axinom/mosaic-service-common';
3
- import axios, { AxiosError, AxiosInstance } from 'axios';
3
+ import axios, { AxiosError, type AxiosInstance } from 'axios';
4
4
  import { existsSync, lstatSync, readFileSync } from 'fs';
5
5
  import * as yaml from 'js-yaml';
6
6
  import * as path from 'path';
7
- import { exitCode } from '../../../common';
8
- import { GetUploadManifestOptions } from './upload-manifest-options';
7
+ import { exitCode } from '../../../common/index.js';
8
+ import type { GetUploadManifestOptions } from './upload-manifest-options.js';
9
9
 
10
10
  const getAxiosInstance = (
11
11
  hostingServiceBaseUrl: string,
@@ -1,6 +1,6 @@
1
- import { CommandModule } from 'yargs';
2
- import { registerPilet, validateArgs } from './register-pilet';
3
- import { GetRegisterPiletOptions } from './register-pilet-options';
1
+ import type { CommandModule } from 'yargs';
2
+ import type { GetRegisterPiletOptions } from './register-pilet-options.js';
3
+ import { registerPilet, validateArgs } from './register-pilet.js';
4
4
 
5
5
  export const piletCommands: CommandModule<unknown, unknown> = {
6
6
  builder: (yargs) =>
@@ -1,11 +1,14 @@
1
- import { TokenResult, getServiceAccountToken } from '@axinom/mosaic-id-link-be';
1
+ import {
2
+ type TokenResult,
3
+ getServiceAccountToken,
4
+ } from '@axinom/mosaic-id-link-be';
2
5
  import { isNullOrWhitespace } from '@axinom/mosaic-service-common';
3
6
  import axios, { AxiosError } from 'axios';
4
7
  import FormData from 'form-data';
5
8
  import { createReadStream, existsSync, lstatSync, readdirSync } from 'fs';
6
9
  import * as path from 'path';
7
- import { exitCode } from '../../../common';
8
- import { GetRegisterPiletOptions } from './register-pilet-options';
10
+ import { exitCode } from '../../../common/index.js';
11
+ import type { GetRegisterPiletOptions } from './register-pilet-options.js';
9
12
 
10
13
  export const registerPilet = async (
11
14
  args: Required<GetRegisterPiletOptions>,
@@ -1,7 +1,8 @@
1
- import { red, yellow } from 'chalk';
2
- import { CommandModule } from 'yargs';
3
- import { deployService, validateDeploymentArgs } from './service-deploy';
4
- import { GetServiceDeployOptions } from './service-deploy-options';
1
+ import chalk from 'chalk';
2
+ import type { CommandModule } from 'yargs';
3
+ import type { GetServiceDeployOptions } from './service-deploy-options.js';
4
+ import { deployService, validateDeploymentArgs } from './service-deploy.js';
5
+ const { red, yellow } = chalk;
5
6
 
6
7
  export const serviceDeploy: CommandModule<unknown, GetServiceDeployOptions> = {
7
8
  builder: (yargs) => {
@@ -1,11 +1,12 @@
1
1
  import { getServiceAccountToken } from '@axinom/mosaic-id-link-be';
2
2
  import { isNullOrWhitespace } from '@axinom/mosaic-service-common';
3
- import axios, { AxiosError, AxiosInstance } from 'axios';
4
- import { green, red, yellow } from 'chalk';
3
+ import axios, { AxiosError, type AxiosInstance } from 'axios';
4
+ import chalk from 'chalk';
5
5
  import { readFileSync } from 'fs';
6
6
  import * as yaml from 'js-yaml';
7
- import { exitCode } from '../../../../common';
8
- import { GetServiceDeployOptions } from './service-deploy-options';
7
+ import { exitCode } from '../../../../common/index.js';
8
+ import type { GetServiceDeployOptions } from './service-deploy-options.js';
9
+ const { green, red, yellow } = chalk;
9
10
 
10
11
  const getAxiosInstance = (
11
12
  hostingServiceBaseUrl: string,
@@ -1,6 +1,6 @@
1
- import { CommandModule } from 'yargs';
2
- import { serviceDeploy } from './deploy/service-deploy-command';
3
- import { serviceUndeploy } from './undeploy/service-undeploy-command';
1
+ import type { CommandModule } from 'yargs';
2
+ import { serviceDeploy } from './deploy/service-deploy-command.js';
3
+ import { serviceUndeploy } from './undeploy/service-undeploy-command.js';
4
4
 
5
5
  export const serviceCommands: CommandModule<unknown, unknown> = {
6
6
  builder: (yargs) =>
@@ -1,7 +1,11 @@
1
- import { red, yellow } from 'chalk';
2
- import { CommandModule } from 'yargs';
3
- import { undeployService, validateUndeploymentArgs } from './service-undeploy';
4
- import { GetServiceUndeployOptions } from './service-undeploy-options';
1
+ import chalk from 'chalk';
2
+ import type { CommandModule } from 'yargs';
3
+ import type { GetServiceUndeployOptions } from './service-undeploy-options.js';
4
+ import {
5
+ undeployService,
6
+ validateUndeploymentArgs,
7
+ } from './service-undeploy.js';
8
+ const { red, yellow } = chalk;
5
9
 
6
10
  export const serviceUndeploy: CommandModule<
7
11
  unknown,
@@ -1,9 +1,10 @@
1
1
  import { getServiceAccountToken } from '@axinom/mosaic-id-link-be';
2
2
  import { isNullOrWhitespace } from '@axinom/mosaic-service-common';
3
- import axios, { AxiosError, AxiosInstance } from 'axios';
4
- import { green, red, yellow } from 'chalk';
5
- import { exitCode } from '../../../../common';
6
- import { GetServiceUndeployOptions } from './service-undeploy-options';
3
+ import axios, { AxiosError, type AxiosInstance } from 'axios';
4
+ import chalk from 'chalk';
5
+ import { exitCode } from '../../../../common/index.js';
6
+ import type { GetServiceUndeployOptions } from './service-undeploy-options.js';
7
+ const { green, red, yellow } = chalk;
7
8
 
8
9
  const getAxiosInstance = (
9
10
  hostingServiceBaseUrl: string,
@@ -8,23 +8,23 @@ import {
8
8
  typeScriptDefaultPropertyKeyConstraints,
9
9
  TypeScriptGenerator,
10
10
  } from '@asyncapi/modelina';
11
- import Parser, {
12
- AsyncAPIDocumentInterface,
11
+ import _Parser, {
12
+ type AsyncAPIDocumentInterface,
13
13
  fromFile,
14
- MessageInterface,
14
+ type MessageInterface,
15
15
  } from '@asyncapi/parser';
16
- import endent from 'endent';
16
+ import _endent from 'endent';
17
17
  import * as fs from 'fs';
18
18
  import * as path from 'path';
19
- import { exitCode } from '../../common';
20
- import { MessageCodegenOptions } from './message-codegen-options';
19
+ import { exitCode } from '../../common/index.js';
20
+ import type { MessageCodegenOptions } from './message-codegen-options.js';
21
21
  import {
22
22
  ADDITIONAL_PROPERTIES_PRESET,
23
23
  ANY_TO_UNKNOWN_PRESET,
24
+ createImportsPreset,
24
25
  EXPORT_TYPES_PRESET,
25
- IMPORTS_PRESET,
26
26
  NULLABLE_PROPERTY_TO_UNION_PRESET,
27
- } from './presets';
27
+ } from './presets.js';
28
28
  import {
29
29
  createDummyReservedKeywordsChecker,
30
30
  getChannelAction,
@@ -38,7 +38,19 @@ import {
38
38
  getServiceTitle,
39
39
  removeXParserProperties,
40
40
  toPosixPath,
41
- } from './utils';
41
+ } from './utils.js';
42
+ // @asyncapi/parser is a TypeScript-compiled CJS package that emits
43
+ // `module.exports = { __esModule: true, default: value }`.
44
+ // Node.js native ESM does not honour the __esModule sentinel, so the default
45
+ // import receives the whole module.exports wrapper. Pattern 9 in
46
+ // ESM_MIGRATION_GUIDE.md. The `?? _Parser` fallback keeps the CJS build safe.
47
+ const Parser = ((_Parser as any).default ?? _Parser) as typeof _Parser;
48
+ // endent is a TypeScript-compiled CJS package that emits
49
+ // `module.exports = { __esModule: true, default: value }`.
50
+ // Node.js native ESM does not honour the __esModule sentinel — the default
51
+ // import receives the whole module.exports wrapper. Pattern 9 in
52
+ // ESM_MIGRATION_GUIDE.md. The `?? _endent` fallback keeps the CJS build safe.
53
+ const endent = ((_endent as any).default ?? _endent) as typeof _endent;
42
54
 
43
55
  const AX_COMMON_SERVICE_ID = 'ax-common-service';
44
56
 
@@ -58,6 +70,7 @@ export class Codegen {
58
70
  private readonly typesOutputRoot: string;
59
71
  private readonly schemasOutputRoot: string;
60
72
  private readonly messagingSettingsOutputRoot: string;
73
+ private readonly importSpecifierExtension: string;
61
74
 
62
75
  constructor(options: MessageCodegenOptions) {
63
76
  this.schemaRoot = path.resolve(options.inputDir);
@@ -74,6 +87,7 @@ export class Codegen {
74
87
  this.typesOutputRoot = path.join(this.outputRoot, 'types');
75
88
  this.schemasOutputRoot = path.join(this.outputRoot, 'schemas');
76
89
  this.messagingSettingsOutputRoot = path.join(this.outputRoot, 'config');
90
+ this.importSpecifierExtension = options.importSpecifierExtension ?? '';
77
91
  }
78
92
 
79
93
  public async run(): Promise<void> {
@@ -249,7 +263,7 @@ export class Codegen {
249
263
  ADDITIONAL_PROPERTIES_PRESET,
250
264
  EXPORT_TYPES_PRESET,
251
265
  TS_DESCRIPTION_PRESET,
252
- IMPORTS_PRESET,
266
+ createImportsPreset(this.importSpecifierExtension),
253
267
  ],
254
268
  });
255
269
 
@@ -526,7 +540,11 @@ export class Codegen {
526
540
  serviceId === AX_COMMON_SERVICE_ID,
527
541
  ),
528
542
  );
529
- const content = endent`import { ${baseClass} } from '@axinom/mosaic-message-bus-abstractions';
543
+ // MessagingSettings is an interface (implements clause is erased at runtime),
544
+ // so it only needs a type import. MultiTenantMessagingSettings is an abstract
545
+ // class used in extends, so it requires a value import.
546
+ const importKeyword = isMultiTenant ? 'import' : 'import type';
547
+ const content = endent`${importKeyword} { ${baseClass} } from '@axinom/mosaic-message-bus-abstractions';
530
548
 
531
549
  export class ${className} ${action} ${baseClass} {
532
550
  ${properties.join(`\n`)}
@@ -642,19 +660,26 @@ export class Codegen {
642
660
  outPath: string,
643
661
  ): Promise<void> {
644
662
  console.log(`Rolling up TS exports to ${outPath}.`);
645
- const items = [
646
- ...files.map((f) => path.basename(f, '.ts')),
647
- ...dirs.filter((d) => fs.existsSync(d)).map((d) => path.basename(d)),
663
+ const ext = this.importSpecifierExtension;
664
+ const allItems: { key: string; isDir: boolean }[] = [
665
+ ...files.map((f) => ({ key: path.basename(f, '.ts'), isDir: false })),
666
+ ...dirs
667
+ .filter((d) => fs.existsSync(d))
668
+ .map((d) => ({ key: path.basename(d), isDir: true })),
648
669
  ];
649
670
 
650
- if (items.length < 1) {
671
+ if (allItems.length < 1) {
651
672
  return;
652
673
  }
653
674
 
654
- const exports = `${items
655
- .sort()
656
- .map((p) => `export * from './${p}';`)
657
- .join('\n')}`;
675
+ const exports = allItems
676
+ .sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0))
677
+ .map(({ key, isDir }) =>
678
+ isDir && ext
679
+ ? `export * from './${key}/index${ext}';`
680
+ : `export * from './${key}${ext}';`,
681
+ )
682
+ .join('\n');
658
683
  let schemaEnum = '';
659
684
  let typeNamesEnum = '';
660
685
 
@@ -727,6 +752,7 @@ export class Codegen {
727
752
  outPath: string,
728
753
  ): Promise<void> {
729
754
  console.log(`Rolling up Messaging Settings exports to ${outPath}.`);
755
+ const ext = this.importSpecifierExtension;
730
756
  const items = [
731
757
  ...files.map((f) => path.basename(f, '.ts')),
732
758
  ...dirs.filter((d) => fs.existsSync(d)).map((d) => path.basename(d)),
@@ -745,14 +771,22 @@ export class Codegen {
745
771
 
746
772
  if (files.length > 0) {
747
773
  const baseNames = files.map((f) => path.basename(f, '.ts')).sort();
748
- const messagingImports = baseNames.map((n) => `export * from './${n}';`);
774
+ const messagingImports = baseNames.map(
775
+ (n) => `export * from './${n}${ext}';`,
776
+ );
749
777
  contents = endent`
750
778
  ${messagingImports.join('\n')}
751
779
  `;
752
780
  }
753
781
 
754
782
  contents += endent`\n
755
- ${dirExports.map((d) => `export * from './${d}';`).join('\n')}`;
783
+ ${dirExports
784
+ .map((d) =>
785
+ ext
786
+ ? `export * from './${d}/index${ext}';`
787
+ : `export * from './${d}';`,
788
+ )
789
+ .join('\n')}`;
756
790
 
757
791
  await fs.promises.writeFile(outPath, contents);
758
792
  }
@@ -768,6 +802,7 @@ export class Codegen {
768
802
  outPath: string,
769
803
  ): Promise<void> {
770
804
  console.log(`Rolling up JSON exports to ${outPath}.`);
805
+ const ext = this.importSpecifierExtension;
771
806
  const items = [
772
807
  ...files.map((f) => path.basename(f, '.json')),
773
808
  ...dirs.filter((d) => fs.existsSync(d)).map((d) => path.basename(d)),
@@ -804,7 +839,11 @@ export class Codegen {
804
839
  }
805
840
 
806
841
  contents += endent`\n
807
- ${dirExports.map((d) => `export * from './${d}';`).join('\n')}`;
842
+ ${dirExports
843
+ .map((d) =>
844
+ ext ? `export * from './${d}/index${ext}';` : `export * from './${d}';`,
845
+ )
846
+ .join('\n')}`;
808
847
 
809
848
  await fs.promises.writeFile(outPath, contents);
810
849
  }
@@ -1,7 +1,7 @@
1
- import { CommandModule } from 'yargs';
2
- import { Codegen } from './codegen';
3
- import { lint } from './lint';
4
- import { MessageCodegenOptions } from './message-codegen-options';
1
+ import type { CommandModule } from 'yargs';
2
+ import { Codegen } from './codegen.js';
3
+ import { lint } from './lint.js';
4
+ import type { MessageCodegenOptions } from './message-codegen-options.js';
5
5
 
6
6
  export const msgCodegen: CommandModule<unknown, MessageCodegenOptions> = {
7
7
  command: 'msg-codegen',
@@ -35,6 +35,13 @@ export const msgCodegen: CommandModule<unknown, MessageCodegenOptions> = {
35
35
  alias: 'r',
36
36
  describe: 'Path to a Spectral ruleset file for linting.',
37
37
  type: 'string',
38
+ })
39
+ .option('importSpecifierExtension', {
40
+ alias: 'e',
41
+ describe:
42
+ 'Extension appended to relative import specifiers in generated barrel files (e.g. ".js" for ESM-compatible output). Default empty string preserves existing CJS behaviour.',
43
+ type: 'string',
44
+ default: '',
38
45
  }),
39
46
  handler: async (argv) => {
40
47
  if (argv.lint) {
@@ -1,11 +1,14 @@
1
- import { Document, Ruleset, Spectral } from '@stoplight/spectral-core';
2
- import * as Parsers from '@stoplight/spectral-parsers';
1
+ import spectralCore, { type Ruleset } from '@stoplight/spectral-core';
2
+ import spectralParsers from '@stoplight/spectral-parsers';
3
3
  import { bundleAndLoadRuleset } from '@stoplight/spectral-ruleset-bundler/with-loader';
4
- import { fetch } from '@stoplight/spectral-runtime';
4
+ import spectralRuntime from '@stoplight/spectral-runtime';
5
5
  import * as fs from 'fs';
6
- import * as glob from 'glob';
6
+ import glob from 'glob';
7
7
  import * as path from 'path';
8
- import { MessageCodegenOptions } from './message-codegen-options';
8
+ import type { MessageCodegenOptions } from './message-codegen-options.js';
9
+ const { Document, Spectral } = spectralCore;
10
+ const { Json } = spectralParsers;
11
+ const { fetch } = spectralRuntime;
9
12
 
10
13
  export async function lint(options: MessageCodegenOptions): Promise<void> {
11
14
  console.log(`Linting schemas at ${options.inputDir}.`);
@@ -29,7 +32,7 @@ export async function lint(options: MessageCodegenOptions): Promise<void> {
29
32
  // console.log(schema);
30
33
  const document = new Document(
31
34
  fs.readFileSync(schema, 'utf-8'),
32
- Parsers.Json,
35
+ Json,
33
36
  schema,
34
37
  );
35
38
  const results = await spectral.run(document);
@@ -4,4 +4,5 @@ export interface MessageCodegenOptions {
4
4
  outputDir: string;
5
5
  lint: boolean;
6
6
  rulesetPath?: string;
7
+ importSpecifierExtension: string;
7
8
  }
@@ -1,5 +1,5 @@
1
- import { FormatHelpers, TypeScriptPreset } from '@asyncapi/modelina';
2
- import endent from 'endent';
1
+ import { FormatHelpers, type TypeScriptPreset } from '@asyncapi/modelina';
2
+ import _endent from 'endent';
3
3
  import {
4
4
  ensureNullable,
5
5
  getArrayItemNonNullTypes,
@@ -7,7 +7,13 @@ import {
7
7
  indexOfNullArrayProperty,
8
8
  indexOfNullObjectProperty,
9
9
  replaceAnyType,
10
- } from './utils';
10
+ } from './utils.js';
11
+ // endent is a TypeScript-compiled CJS package that emits
12
+ // `module.exports = { __esModule: true, default: value }`.
13
+ // Node.js native ESM does not honour the __esModule sentinel — the default
14
+ // import receives the whole module.exports wrapper. Pattern 9 in
15
+ // ESM_MIGRATION_GUIDE.md. The `?? _endent` fallback keeps the CJS build safe.
16
+ const endent = ((_endent as any).default ?? _endent) as typeof _endent;
11
17
 
12
18
  /**
13
19
  * Exports types.
@@ -48,9 +54,15 @@ export const ADDITIONAL_PROPERTIES_PRESET: TypeScriptPreset = {
48
54
  };
49
55
 
50
56
  /**
51
- * Preset for TypeScriptGenerator, adds imports to resulting model.
57
+ * Creates a preset for TypeScriptGenerator that adds imports to resulting models.
58
+ * Pass `importSpecifierExtension` (e.g. `".js"`) to emit explicit file extensions
59
+ * on relative specifiers, required for ESM-compatible output.
60
+ * All cross-model dependencies are TypeScript interfaces, so imports are always
61
+ * emitted as `import type` to satisfy `verbatimModuleSyntax`.
52
62
  */
53
- export const IMPORTS_PRESET: TypeScriptPreset = {
63
+ export const createImportsPreset = (
64
+ importSpecifierExtension = '',
65
+ ): TypeScriptPreset => ({
54
66
  interface: {
55
67
  self({ content, model }) {
56
68
  const interfacePrefix = getModelPathPrefix(model.name);
@@ -62,13 +74,15 @@ export const IMPORTS_PRESET: TypeScriptPreset = {
62
74
  interfacePrefix !== getModelPathPrefix(dep.name)
63
75
  ? `../${getModelPathPrefix(dep.name)}/${FormatHelpers.toParamCase(
64
76
  dep.name,
65
- )}`
66
- : `./${FormatHelpers.toParamCase(dep.name)}`,
77
+ )}${importSpecifierExtension}`
78
+ : `./${FormatHelpers.toParamCase(
79
+ dep.name,
80
+ )}${importSpecifierExtension}`,
67
81
  }));
68
82
  return endent`
69
83
  ${imports
70
84
  .sort((a, b) => a.location.localeCompare(b.location))
71
- .map((i) => `import { ${i.class} } from '${i.location}';`)
85
+ .map((i) => `import type { ${i.class} } from '${i.location}';`)
72
86
  .join('\n')}
73
87
  ${content}`;
74
88
  },
@@ -76,7 +90,7 @@ export const IMPORTS_PRESET: TypeScriptPreset = {
76
90
  return content;
77
91
  },
78
92
  },
79
- };
93
+ });
80
94
 
81
95
  /**
82
96
  * Preset for TypeScriptGenerator, sets nullable properties as unions in resulted models(compatibility with zapatos generated models).
@@ -6,10 +6,10 @@ import {
6
6
  FormatHelpers,
7
7
  } from '@asyncapi/modelina';
8
8
  import {
9
- AsyncAPIDocumentInterface,
10
- ChannelInterface,
11
- MessageInterface,
12
- SpecTypesV2,
9
+ type AsyncAPIDocumentInterface,
10
+ type ChannelInterface,
11
+ type MessageInterface,
12
+ type SpecTypesV2,
13
13
  } from '@asyncapi/parser';
14
14
  import * as fs from 'fs';
15
15
  import * as path from 'path';
@@ -1,4 +1,4 @@
1
- import { OverrideObject } from '@asyncapi/diff';
1
+ import type { OverrideObject } from '@asyncapi/diff';
2
2
 
3
3
  const unclassified: OverrideObject[string] = {
4
4
  add: 'unclassified',
@@ -1,7 +1,8 @@
1
- import * as yargs from 'yargs';
2
- import { CommandModule } from 'yargs';
3
- import { MessageDiffOptions } from './message-diff-options';
4
- import { MessageDiff } from './msg-diff';
1
+ import { pathToFileURL } from 'url';
2
+ import type { CommandModule } from 'yargs';
3
+ import yargs from 'yargs';
4
+ import type { MessageDiffOptions } from './message-diff-options.js';
5
+ import { MessageDiff } from './msg-diff.js';
5
6
 
6
7
  export const msgDiff: CommandModule<unknown, MessageDiffOptions> = {
7
8
  command: 'msg-diff',
@@ -47,7 +48,10 @@ export const msgDiff: CommandModule<unknown, MessageDiffOptions> = {
47
48
  };
48
49
 
49
50
  // Dev helper. Script can be run directly with command:
50
- // ts-node libs/cli/src/commands/msg-diff/index.ts msg-diff -i libs/messages/schemas
51
- if (require.main === module) {
52
- yargs.command(msgDiff).demandCommand().argv;
51
+ // yarn tsx libs/cli/src/commands/msg-diff/index.ts msg-diff -i libs/messages/schemas
52
+ const isDirectRun =
53
+ process.argv[1] !== undefined &&
54
+ import.meta.url === pathToFileURL(process.argv[1]).href;
55
+ if (isDirectRun) {
56
+ yargs(process.argv.slice(2)).command(msgDiff).demandCommand().argv;
53
57
  }