@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.
- package/README.md +9 -3
- package/bin/mosaic.mjs +5 -0
- package/dist/cjs/exports.d.ts +2 -0
- package/dist/cjs/exports.js +6 -0
- package/dist/cjs/exports.js.map +1 -0
- package/dist/cjs/lib/get-access-token-options.js.map +1 -0
- package/dist/{commands/get-access-token → cjs/lib}/get-dev-access-token.d.ts +2 -2
- package/dist/cjs/lib/get-dev-access-token.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/cli/index.js +51 -0
- package/dist/esm/cli/index.js.map +1 -0
- package/dist/{commands → esm/commands}/apply-templates/apply-templates.d.ts +2 -2
- package/dist/{commands → esm/commands}/apply-templates/apply-templates.js +56 -57
- package/dist/esm/commands/apply-templates/apply-templates.js.map +1 -0
- package/dist/{commands → esm/commands}/apply-templates/bitwarden-vault.js +18 -18
- package/dist/esm/commands/apply-templates/bitwarden-vault.js.map +1 -0
- package/dist/esm/commands/apply-templates/index.d.ts +1 -0
- package/dist/esm/commands/apply-templates/index.js +2 -0
- package/dist/esm/commands/apply-templates/index.js.map +1 -0
- package/dist/esm/commands/create/command.d.ts +3 -0
- package/dist/{commands → esm/commands}/create/command.js +23 -27
- package/dist/esm/commands/create/command.js.map +1 -0
- package/dist/{commands → esm/commands}/create/createSolution.d.ts +1 -1
- package/dist/{commands → esm/commands}/create/createSolution.js +16 -22
- package/dist/esm/commands/create/createSolution.js.map +1 -0
- package/dist/esm/commands/create/defaultValues.js +7 -0
- package/dist/esm/commands/create/defaultValues.js.map +1 -0
- package/dist/{commands → esm/commands}/create/helpers/git.d.ts +1 -1
- package/dist/{commands → esm/commands}/create/helpers/git.js +2 -7
- package/dist/esm/commands/create/helpers/git.js.map +1 -0
- package/dist/esm/commands/create/helpers/logger.js +35 -0
- package/dist/esm/commands/create/helpers/logger.js.map +1 -0
- package/dist/esm/commands/create/helpers/types.js +2 -0
- package/dist/esm/commands/create/helpers/types.js.map +1 -0
- package/dist/{commands → esm/commands}/create/runQuestionaire.d.ts +1 -1
- package/dist/{commands → esm/commands}/create/runQuestionaire.js +15 -20
- package/dist/esm/commands/create/runQuestionaire.js.map +1 -0
- package/dist/{commands → esm/commands}/create-extension-config/create-extension-config.js +15 -22
- package/dist/esm/commands/create-extension-config/create-extension-config.js.map +1 -0
- package/dist/{commands → esm/commands}/create-extension-config/index.d.ts +1 -1
- package/dist/esm/commands/create-extension-config/index.js +17 -0
- package/dist/esm/commands/create-extension-config/index.js.map +1 -0
- package/dist/esm/commands/get-access-token/index.d.ts +3 -0
- package/dist/{commands → esm/commands}/get-access-token/index.js +10 -14
- package/dist/esm/commands/get-access-token/index.js.map +1 -0
- package/dist/{commands → esm/commands}/graphql-diff.d.ts +1 -1
- package/dist/{commands → esm/commands}/graphql-diff.js +21 -25
- package/dist/esm/commands/graphql-diff.js.map +1 -0
- package/dist/{commands → esm/commands}/hosting/index.d.ts +1 -1
- package/dist/esm/commands/hosting/index.js +16 -0
- package/dist/esm/commands/hosting/index.js.map +1 -0
- package/dist/{commands → esm/commands}/hosting/manifest/manifest-commands.d.ts +1 -1
- package/dist/{commands → esm/commands}/hosting/manifest/manifest-commands.js +4 -7
- package/dist/esm/commands/hosting/manifest/manifest-commands.js.map +1 -0
- package/dist/esm/commands/hosting/manifest/upload-manifest-options.js +2 -0
- package/dist/esm/commands/hosting/manifest/upload-manifest-options.js.map +1 -0
- package/dist/{commands → esm/commands}/hosting/manifest/upload-manifest.d.ts +1 -1
- package/dist/{commands → esm/commands}/hosting/manifest/upload-manifest.js +34 -38
- package/dist/esm/commands/hosting/manifest/upload-manifest.js.map +1 -0
- package/dist/{commands → esm/commands}/hosting/pilet/pilet-commands.d.ts +1 -1
- package/dist/{commands → esm/commands}/hosting/pilet/pilet-commands.js +4 -7
- package/dist/esm/commands/hosting/pilet/pilet-commands.js.map +1 -0
- package/dist/esm/commands/hosting/pilet/register-pilet-options.js +2 -0
- package/dist/esm/commands/hosting/pilet/register-pilet-options.js.map +1 -0
- package/dist/{commands → esm/commands}/hosting/pilet/register-pilet.d.ts +1 -1
- package/dist/esm/commands/hosting/pilet/register-pilet.js +127 -0
- package/dist/esm/commands/hosting/pilet/register-pilet.js.map +1 -0
- package/dist/esm/commands/hosting/service/deploy/service-deploy-command.d.ts +3 -0
- package/dist/{commands → esm/commands}/hosting/service/deploy/service-deploy-command.js +8 -10
- package/dist/esm/commands/hosting/service/deploy/service-deploy-command.js.map +1 -0
- package/dist/esm/commands/hosting/service/deploy/service-deploy-options.js +2 -0
- package/dist/esm/commands/hosting/service/deploy/service-deploy-options.js.map +1 -0
- package/dist/{commands → esm/commands}/hosting/service/deploy/service-deploy.d.ts +1 -1
- package/dist/esm/commands/hosting/service/deploy/service-deploy.js +240 -0
- package/dist/esm/commands/hosting/service/deploy/service-deploy.js.map +1 -0
- package/dist/{commands → esm/commands}/hosting/service/service-commands.d.ts +1 -1
- package/dist/esm/commands/hosting/service/service-commands.js +13 -0
- package/dist/esm/commands/hosting/service/service-commands.js.map +1 -0
- package/dist/esm/commands/hosting/service/undeploy/service-undeploy-command.d.ts +3 -0
- package/dist/{commands → esm/commands}/hosting/service/undeploy/service-undeploy-command.js +8 -10
- package/dist/esm/commands/hosting/service/undeploy/service-undeploy-command.js.map +1 -0
- package/dist/esm/commands/hosting/service/undeploy/service-undeploy-options.js +2 -0
- package/dist/esm/commands/hosting/service/undeploy/service-undeploy-options.js.map +1 -0
- package/dist/{commands → esm/commands}/hosting/service/undeploy/service-undeploy.d.ts +1 -1
- package/dist/esm/commands/hosting/service/undeploy/service-undeploy.js +136 -0
- package/dist/esm/commands/hosting/service/undeploy/service-undeploy.js.map +1 -0
- package/dist/{commands → esm/commands}/msg-codegen/codegen.d.ts +3 -2
- package/dist/{commands → esm/commands}/msg-codegen/codegen.js +114 -83
- package/dist/esm/commands/msg-codegen/codegen.js.map +1 -0
- package/dist/esm/commands/msg-codegen/index.d.ts +3 -0
- package/dist/{commands → esm/commands}/msg-codegen/index.js +11 -8
- package/dist/esm/commands/msg-codegen/index.js.map +1 -0
- package/dist/{commands → esm/commands}/msg-codegen/lint.d.ts +1 -1
- package/dist/{commands → esm/commands}/msg-codegen/lint.js +14 -15
- package/dist/esm/commands/msg-codegen/lint.js.map +1 -0
- package/dist/{commands → esm/commands}/msg-codegen/message-codegen-options.d.ts +1 -0
- package/dist/esm/commands/msg-codegen/message-codegen-options.js +2 -0
- package/dist/esm/commands/msg-codegen/message-codegen-options.js.map +1 -0
- package/dist/{commands → esm/commands}/msg-codegen/presets.d.ts +7 -3
- package/dist/{commands → esm/commands}/msg-codegen/presets.js +35 -30
- package/dist/esm/commands/msg-codegen/presets.js.map +1 -0
- package/dist/{commands → esm/commands}/msg-codegen/utils.d.ts +1 -1
- package/dist/{commands → esm/commands}/msg-codegen/utils.js +52 -86
- package/dist/esm/commands/msg-codegen/utils.js.map +1 -0
- package/dist/{commands → esm/commands}/msg-diff/asyncapi-override.d.ts +1 -1
- package/dist/{commands → esm/commands}/msg-diff/asyncapi-override.js +1 -4
- package/dist/esm/commands/msg-diff/asyncapi-override.js.map +1 -0
- package/dist/{commands → esm/commands}/msg-diff/git-checkout-tmp.js +11 -15
- package/dist/esm/commands/msg-diff/git-checkout-tmp.js.map +1 -0
- package/dist/esm/commands/msg-diff/index.d.ts +3 -0
- package/dist/{commands → esm/commands}/msg-diff/index.js +10 -11
- package/dist/esm/commands/msg-diff/index.js.map +1 -0
- package/dist/esm/commands/msg-diff/message-diff-options.js +2 -0
- package/dist/esm/commands/msg-diff/message-diff-options.js.map +1 -0
- package/dist/{commands → esm/commands}/msg-diff/msg-diff.d.ts +2 -2
- package/dist/{commands → esm/commands}/msg-diff/msg-diff.js +42 -35
- package/dist/esm/commands/msg-diff/msg-diff.js.map +1 -0
- package/dist/{commands → esm/commands}/pg-dump/generate.d.ts +1 -1
- package/dist/{commands → esm/commands}/pg-dump/generate.js +34 -39
- package/dist/esm/commands/pg-dump/generate.js.map +1 -0
- package/dist/esm/commands/pg-dump/index.d.ts +3 -0
- package/dist/{commands → esm/commands}/pg-dump/index.js +3 -6
- package/dist/esm/commands/pg-dump/index.js.map +1 -0
- package/dist/esm/commands/pg-dump/pg-dump-options.js +2 -0
- package/dist/esm/commands/pg-dump/pg-dump-options.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/abstractions/base-smart-tags.d.ts +1 -1
- package/dist/esm/commands/publish-schema-to-db/abstractions/base-smart-tags.js +2 -0
- package/dist/esm/commands/publish-schema-to-db/abstractions/base-smart-tags.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/abstractions/index.d.ts +5 -0
- package/dist/esm/commands/publish-schema-to-db/abstractions/index.js +6 -0
- package/dist/esm/commands/publish-schema-to-db/abstractions/index.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/abstractions/pg-column.d.ts +3 -3
- package/dist/esm/commands/publish-schema-to-db/abstractions/pg-column.js +2 -0
- package/dist/esm/commands/publish-schema-to-db/abstractions/pg-column.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/abstractions/pg-fk-column.d.ts +1 -1
- package/dist/esm/commands/publish-schema-to-db/abstractions/pg-fk-column.js +2 -0
- package/dist/esm/commands/publish-schema-to-db/abstractions/pg-fk-column.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/abstractions/pg-table.d.ts +4 -4
- package/dist/esm/commands/publish-schema-to-db/abstractions/pg-table.js +2 -0
- package/dist/esm/commands/publish-schema-to-db/abstractions/pg-table.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/abstractions/pg-type.js +2 -0
- package/dist/esm/commands/publish-schema-to-db/abstractions/pg-type.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/content-entity-model.d.ts +3 -3
- package/dist/{commands → esm/commands}/publish-schema-to-db/content-entity-model.js +12 -14
- package/dist/esm/commands/publish-schema-to-db/content-entity-model.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/generate.d.ts +1 -1
- package/dist/esm/commands/publish-schema-to-db/generate.js +57 -0
- package/dist/esm/commands/publish-schema-to-db/generate.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/index.d.ts +3 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/index.js +3 -6
- package/dist/esm/commands/publish-schema-to-db/index.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/fk-column.d.ts +1 -1
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/fk-column.js +11 -8
- package/dist/esm/commands/publish-schema-to-db/pg-models/columns/fk-column.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/pg-models/columns/index.d.ts +4 -0
- package/dist/esm/commands/publish-schema-to-db/pg-models/columns/index.js +5 -0
- package/dist/esm/commands/publish-schema-to-db/pg-models/columns/index.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/pk-column.d.ts +1 -1
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/pk-column.js +4 -5
- package/dist/esm/commands/publish-schema-to-db/pg-models/columns/pk-column.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/primitive-column.d.ts +1 -1
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/primitive-column.js +10 -10
- package/dist/esm/commands/publish-schema-to-db/pg-models/columns/primitive-column.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/virtual-fk-column.d.ts +1 -1
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/columns/virtual-fk-column.js +9 -8
- package/dist/esm/commands/publish-schema-to-db/pg-models/columns/virtual-fk-column.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/json-schema-parse-utils.d.ts +2 -2
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/json-schema-parse-utils.js +17 -29
- package/dist/esm/commands/publish-schema-to-db/pg-models/json-schema-parse-utils.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/pg-sql-gen-utils.d.ts +1 -7
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/pg-sql-gen-utils.js +14 -50
- package/dist/esm/commands/publish-schema-to-db/pg-models/pg-sql-gen-utils.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/pgl-utils.d.ts +2 -2
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/pgl-utils.js +23 -24
- package/dist/esm/commands/publish-schema-to-db/pg-models/pgl-utils.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/tables/content-entity-table.d.ts +3 -3
- package/dist/esm/commands/publish-schema-to-db/pg-models/tables/content-entity-table.js +69 -0
- package/dist/esm/commands/publish-schema-to-db/pg-models/tables/content-entity-table.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/pg-models/tables/index.d.ts +3 -0
- package/dist/esm/commands/publish-schema-to-db/pg-models/tables/index.js +4 -0
- package/dist/esm/commands/publish-schema-to-db/pg-models/tables/index.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/tables/object-property-table.d.ts +3 -3
- package/dist/esm/commands/publish-schema-to-db/pg-models/tables/object-property-table.js +75 -0
- package/dist/esm/commands/publish-schema-to-db/pg-models/tables/object-property-table.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/pg-models/tables/relations-table.d.ts +3 -3
- package/dist/esm/commands/publish-schema-to-db/pg-models/tables/relations-table.js +63 -0
- package/dist/esm/commands/publish-schema-to-db/pg-models/tables/relations-table.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/collection-postprocessor.d.ts +2 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/collection-postprocessor.js +17 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/collection-postprocessor.js.map +1 -0
- package/dist/{commands → esm/commands}/publish-schema-to-db/postprocessors/content-entity-model-postprocessor.d.ts +2 -2
- package/dist/esm/commands/publish-schema-to-db/postprocessors/content-entity-model-postprocessor.js +2 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/content-entity-model-postprocessor.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/episode-postprocessor.d.ts +2 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/episode-postprocessor.js +20 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/episode-postprocessor.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/index.d.ts +6 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/index.js +7 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/index.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/movie-postprocessor.d.ts +2 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/movie-postprocessor.js +16 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/movie-postprocessor.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/postprocessing-utils.d.ts +9 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/postprocessing-utils.js +37 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/postprocessing-utils.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/season-postprocessor.d.ts +2 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/season-postprocessor.js +20 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/season-postprocessor.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.d.ts +2 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.js +16 -0
- package/dist/esm/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.js.map +1 -0
- package/dist/esm/commands/publish-schema-to-db/publish-schema-to-db-options.js +2 -0
- package/dist/esm/commands/publish-schema-to-db/publish-schema-to-db-options.js.map +1 -0
- package/dist/{commands → esm/commands}/service/index.d.ts +1 -1
- package/dist/esm/commands/service/index.js +14 -0
- package/dist/esm/commands/service/index.js.map +1 -0
- package/dist/esm/commands/service/purge-permissions/purge-permissions-command.d.ts +3 -0
- package/dist/{commands → esm/commands}/service/purge-permissions/purge-permissions-command.js +8 -10
- package/dist/esm/commands/service/purge-permissions/purge-permissions-command.js.map +1 -0
- package/dist/esm/commands/service/purge-permissions/purge-permissions-options.js +2 -0
- package/dist/esm/commands/service/purge-permissions/purge-permissions-options.js.map +1 -0
- package/dist/{commands → esm/commands}/service/purge-permissions/purge-permissions.d.ts +1 -1
- package/dist/esm/commands/service/purge-permissions/purge-permissions.js +49 -0
- package/dist/esm/commands/service/purge-permissions/purge-permissions.js.map +1 -0
- package/dist/esm/commands/service/sync-permissions/sync-permission-command.d.ts +3 -0
- package/dist/{commands → esm/commands}/service/sync-permissions/sync-permission-command.js +8 -10
- package/dist/esm/commands/service/sync-permissions/sync-permission-command.js.map +1 -0
- package/dist/esm/commands/service/sync-permissions/sync-permissions-options.js +2 -0
- package/dist/esm/commands/service/sync-permissions/sync-permissions-options.js.map +1 -0
- package/dist/{commands → esm/commands}/service/sync-permissions/sync-permissions.d.ts +1 -1
- package/dist/esm/commands/service/sync-permissions/sync-permissions.js +62 -0
- package/dist/esm/commands/service/sync-permissions/sync-permissions.js.map +1 -0
- package/dist/esm/commands/unpublish-pilet/index.d.ts +3 -0
- package/dist/{commands → esm/commands}/unpublish-pilet/index.js +11 -15
- package/dist/esm/commands/unpublish-pilet/index.js.map +1 -0
- package/dist/esm/commands/unpublish-pilet/unpublish-pilet-options.js +2 -0
- package/dist/esm/commands/unpublish-pilet/unpublish-pilet-options.js.map +1 -0
- package/dist/{commands → esm/commands}/unpublish-pilet/unpublish-pilet.d.ts +1 -1
- package/dist/esm/commands/unpublish-pilet/unpublish-pilet.js +14 -0
- package/dist/esm/commands/unpublish-pilet/unpublish-pilet.js.map +1 -0
- package/dist/esm/common/cli-extension.d.ts +10 -0
- package/dist/esm/common/cli-extension.js +7 -0
- package/dist/esm/common/cli-extension.js.map +1 -0
- package/dist/esm/common/index.d.ts +2 -0
- package/dist/esm/common/index.js +3 -0
- package/dist/esm/common/index.js.map +1 -0
- package/dist/{common → esm/common}/utils.js +2 -6
- package/dist/esm/common/utils.js.map +1 -0
- package/dist/esm/exports.d.ts +2 -0
- package/dist/esm/exports.js +3 -0
- package/dist/esm/exports.js.map +1 -0
- package/dist/esm/lib/get-access-token-options.d.ts +9 -0
- package/dist/esm/lib/get-access-token-options.js +2 -0
- package/dist/esm/lib/get-access-token-options.js.map +1 -0
- package/dist/esm/lib/get-dev-access-token.d.ts +6 -0
- package/dist/esm/lib/get-dev-access-token.js +11 -0
- package/dist/esm/lib/get-dev-access-token.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/package.json +22 -13
- package/src/cli/index.ts +21 -18
- package/src/commands/apply-templates/apply-templates.spec.ts +2 -2
- package/src/commands/apply-templates/apply-templates.ts +13 -8
- package/src/commands/apply-templates/bitwarden-vault.ts +2 -1
- package/src/commands/apply-templates/index.ts +1 -1
- package/src/commands/create/command.ts +6 -6
- package/src/commands/create/createSolution.ts +3 -3
- package/src/commands/create/helpers/git.ts +1 -1
- package/src/commands/create/runQuestionaire.ts +3 -3
- package/src/commands/create-extension-config/create-extension-config.ts +3 -3
- package/src/commands/create-extension-config/index.ts +2 -2
- package/src/commands/get-access-token/index.ts +4 -4
- package/src/commands/graphql-diff.ts +5 -5
- package/src/commands/hosting/index.ts +4 -4
- package/src/commands/hosting/manifest/manifest-commands.ts +3 -3
- package/src/commands/hosting/manifest/upload-manifest.ts +3 -3
- package/src/commands/hosting/pilet/pilet-commands.ts +3 -3
- package/src/commands/hosting/pilet/register-pilet.ts +6 -3
- package/src/commands/hosting/service/deploy/service-deploy-command.ts +5 -4
- package/src/commands/hosting/service/deploy/service-deploy.ts +5 -4
- package/src/commands/hosting/service/service-commands.ts +3 -3
- package/src/commands/hosting/service/undeploy/service-undeploy-command.ts +8 -4
- package/src/commands/hosting/service/undeploy/service-undeploy.ts +5 -4
- package/src/commands/msg-codegen/codegen.ts +61 -22
- package/src/commands/msg-codegen/index.ts +11 -4
- package/src/commands/msg-codegen/lint.ts +9 -6
- package/src/commands/msg-codegen/message-codegen-options.ts +1 -0
- package/src/commands/msg-codegen/presets.ts +23 -9
- package/src/commands/msg-codegen/utils.ts +4 -4
- package/src/commands/msg-diff/asyncapi-override.ts +1 -1
- package/src/commands/msg-diff/index.ts +11 -7
- package/src/commands/msg-diff/msg-diff.spec.ts +7 -5
- package/src/commands/msg-diff/msg-diff.ts +19 -12
- package/src/commands/msg-diff/test-resources/0/command.json +4 -14
- package/src/commands/msg-diff/test-resources/0/event.json +2 -5
- package/src/commands/msg-diff/test-resources/1/moved-event.json +2 -5
- package/src/commands/pg-dump/generate.ts +3 -3
- package/src/commands/pg-dump/index.ts +3 -3
- package/src/commands/publish-schema-to-db/README.md +7 -6
- package/src/commands/publish-schema-to-db/abstractions/base-smart-tags.ts +1 -1
- package/src/commands/publish-schema-to-db/abstractions/index.ts +5 -5
- package/src/commands/publish-schema-to-db/abstractions/pg-column.ts +3 -3
- package/src/commands/publish-schema-to-db/abstractions/pg-fk-column.ts +1 -1
- package/src/commands/publish-schema-to-db/abstractions/pg-table.ts +4 -4
- package/src/commands/publish-schema-to-db/content-entity-model.ts +9 -6
- package/src/commands/publish-schema-to-db/generate.ts +9 -9
- package/src/commands/publish-schema-to-db/index.ts +3 -3
- package/src/commands/publish-schema-to-db/pg-models/columns/fk-column.spec.ts +2 -2
- package/src/commands/publish-schema-to-db/pg-models/columns/fk-column.ts +7 -7
- package/src/commands/publish-schema-to-db/pg-models/columns/index.ts +4 -4
- package/src/commands/publish-schema-to-db/pg-models/columns/pk-column.spec.ts +2 -2
- package/src/commands/publish-schema-to-db/pg-models/columns/pk-column.ts +6 -1
- package/src/commands/publish-schema-to-db/pg-models/columns/primitive-column.spec.ts +2 -2
- package/src/commands/publish-schema-to-db/pg-models/columns/primitive-column.ts +6 -1
- package/src/commands/publish-schema-to-db/pg-models/columns/virtual-fk-column.spec.ts +2 -2
- package/src/commands/publish-schema-to-db/pg-models/columns/virtual-fk-column.ts +7 -7
- package/src/commands/publish-schema-to-db/pg-models/json-schema-parse-utils.spec.ts +3 -3
- package/src/commands/publish-schema-to-db/pg-models/json-schema-parse-utils.ts +6 -4
- package/src/commands/publish-schema-to-db/pg-models/pg-sql-gen-utils.spec.ts +1 -1
- package/src/commands/publish-schema-to-db/pg-models/pg-sql-gen-utils.ts +1 -37
- package/src/commands/publish-schema-to-db/pg-models/pgl-utils.spec.ts +1 -1
- package/src/commands/publish-schema-to-db/pg-models/pgl-utils.ts +18 -10
- package/src/commands/publish-schema-to-db/pg-models/tables/content-entity-table.ts +11 -11
- package/src/commands/publish-schema-to-db/pg-models/tables/index.ts +3 -3
- package/src/commands/publish-schema-to-db/pg-models/tables/object-property-table.ts +14 -11
- package/src/commands/publish-schema-to-db/pg-models/tables/relations-table.ts +11 -11
- package/src/commands/publish-schema-to-db/postprocessors/collection-postprocessor.ts +3 -3
- package/src/commands/publish-schema-to-db/postprocessors/content-entity-model-postprocessor.ts +2 -2
- package/src/commands/publish-schema-to-db/postprocessors/episode-postprocessor.ts +8 -5
- package/src/commands/publish-schema-to-db/postprocessors/index.ts +6 -6
- package/src/commands/publish-schema-to-db/postprocessors/movie-postprocessor.ts +3 -4
- package/src/commands/publish-schema-to-db/postprocessors/postprocessing-utils.ts +37 -2
- package/src/commands/publish-schema-to-db/postprocessors/season-postprocessor.ts +8 -5
- package/src/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.ts +3 -4
- package/src/commands/service/index.ts +3 -3
- package/src/commands/service/purge-permissions/purge-permissions-command.ts +5 -4
- package/src/commands/service/purge-permissions/purge-permissions.ts +3 -2
- package/src/commands/service/sync-permissions/sync-permission-command.ts +5 -4
- package/src/commands/service/sync-permissions/sync-permissions.ts +5 -4
- package/src/commands/unpublish-pilet/index.ts +4 -4
- package/src/commands/unpublish-pilet/unpublish-pilet.ts +1 -1
- package/src/common/cli-extension.ts +21 -0
- package/src/common/index.ts +2 -1
- package/src/exports.ts +2 -2
- package/src/index.ts +1 -1
- package/src/{commands/get-access-token → lib}/get-dev-access-token.ts +2 -2
- package/bin/mosaic.js +0 -3
- package/dist/cli/index.js +0 -54
- package/dist/cli/index.js.map +0 -1
- package/dist/commands/apply-templates/apply-templates.js.map +0 -1
- package/dist/commands/apply-templates/bitwarden-vault.js.map +0 -1
- package/dist/commands/apply-templates/index.d.ts +0 -1
- package/dist/commands/apply-templates/index.js +0 -5
- package/dist/commands/apply-templates/index.js.map +0 -1
- package/dist/commands/create/command.d.ts +0 -3
- package/dist/commands/create/command.js.map +0 -1
- package/dist/commands/create/createSolution.js.map +0 -1
- package/dist/commands/create/defaultValues.js +0 -10
- package/dist/commands/create/defaultValues.js.map +0 -1
- package/dist/commands/create/helpers/git.js.map +0 -1
- package/dist/commands/create/helpers/logger.js +0 -46
- package/dist/commands/create/helpers/logger.js.map +0 -1
- package/dist/commands/create/helpers/types.js +0 -3
- package/dist/commands/create/helpers/types.js.map +0 -1
- package/dist/commands/create/runQuestionaire.js.map +0 -1
- package/dist/commands/create-extension-config/create-extension-config.js.map +0 -1
- package/dist/commands/create-extension-config/index.js +0 -22
- package/dist/commands/create-extension-config/index.js.map +0 -1
- package/dist/commands/get-access-token/get-access-token-options.js.map +0 -1
- package/dist/commands/get-access-token/get-dev-access-token.js.map +0 -1
- package/dist/commands/get-access-token/index.d.ts +0 -3
- package/dist/commands/get-access-token/index.js.map +0 -1
- package/dist/commands/graphql-diff.js.map +0 -1
- package/dist/commands/hosting/index.js +0 -19
- package/dist/commands/hosting/index.js.map +0 -1
- package/dist/commands/hosting/manifest/manifest-commands.js.map +0 -1
- package/dist/commands/hosting/manifest/upload-manifest-options.js +0 -3
- package/dist/commands/hosting/manifest/upload-manifest-options.js.map +0 -1
- package/dist/commands/hosting/manifest/upload-manifest.js.map +0 -1
- package/dist/commands/hosting/pilet/pilet-commands.js.map +0 -1
- package/dist/commands/hosting/pilet/register-pilet-options.js +0 -3
- package/dist/commands/hosting/pilet/register-pilet-options.js.map +0 -1
- package/dist/commands/hosting/pilet/register-pilet.js +0 -131
- package/dist/commands/hosting/pilet/register-pilet.js.map +0 -1
- package/dist/commands/hosting/service/deploy/service-deploy-command.d.ts +0 -3
- package/dist/commands/hosting/service/deploy/service-deploy-command.js.map +0 -1
- package/dist/commands/hosting/service/deploy/service-deploy-options.js +0 -3
- package/dist/commands/hosting/service/deploy/service-deploy-options.js.map +0 -1
- package/dist/commands/hosting/service/deploy/service-deploy.js +0 -246
- package/dist/commands/hosting/service/deploy/service-deploy.js.map +0 -1
- package/dist/commands/hosting/service/service-commands.js +0 -16
- package/dist/commands/hosting/service/service-commands.js.map +0 -1
- package/dist/commands/hosting/service/undeploy/service-undeploy-command.d.ts +0 -3
- package/dist/commands/hosting/service/undeploy/service-undeploy-command.js.map +0 -1
- package/dist/commands/hosting/service/undeploy/service-undeploy-options.js +0 -3
- package/dist/commands/hosting/service/undeploy/service-undeploy-options.js.map +0 -1
- package/dist/commands/hosting/service/undeploy/service-undeploy.js +0 -142
- package/dist/commands/hosting/service/undeploy/service-undeploy.js.map +0 -1
- package/dist/commands/msg-codegen/codegen.js.map +0 -1
- package/dist/commands/msg-codegen/index.d.ts +0 -3
- package/dist/commands/msg-codegen/index.js.map +0 -1
- package/dist/commands/msg-codegen/lint.js.map +0 -1
- package/dist/commands/msg-codegen/message-codegen-options.js +0 -3
- package/dist/commands/msg-codegen/message-codegen-options.js.map +0 -1
- package/dist/commands/msg-codegen/presets.js.map +0 -1
- package/dist/commands/msg-codegen/utils.js.map +0 -1
- package/dist/commands/msg-diff/asyncapi-override.js.map +0 -1
- package/dist/commands/msg-diff/git-checkout-tmp.js.map +0 -1
- package/dist/commands/msg-diff/index.d.ts +0 -3
- package/dist/commands/msg-diff/index.js.map +0 -1
- package/dist/commands/msg-diff/message-diff-options.js +0 -3
- package/dist/commands/msg-diff/message-diff-options.js.map +0 -1
- package/dist/commands/msg-diff/msg-diff.js.map +0 -1
- package/dist/commands/pg-dump/generate.js.map +0 -1
- package/dist/commands/pg-dump/index.d.ts +0 -3
- package/dist/commands/pg-dump/index.js.map +0 -1
- package/dist/commands/pg-dump/pg-dump-options.js +0 -3
- package/dist/commands/pg-dump/pg-dump-options.js.map +0 -1
- package/dist/commands/publish-schema-to-db/abstractions/base-smart-tags.js +0 -3
- package/dist/commands/publish-schema-to-db/abstractions/base-smart-tags.js.map +0 -1
- package/dist/commands/publish-schema-to-db/abstractions/index.d.ts +0 -5
- package/dist/commands/publish-schema-to-db/abstractions/index.js +0 -9
- package/dist/commands/publish-schema-to-db/abstractions/index.js.map +0 -1
- package/dist/commands/publish-schema-to-db/abstractions/pg-column.js +0 -3
- package/dist/commands/publish-schema-to-db/abstractions/pg-column.js.map +0 -1
- package/dist/commands/publish-schema-to-db/abstractions/pg-fk-column.js +0 -3
- package/dist/commands/publish-schema-to-db/abstractions/pg-fk-column.js.map +0 -1
- package/dist/commands/publish-schema-to-db/abstractions/pg-table.js +0 -3
- package/dist/commands/publish-schema-to-db/abstractions/pg-table.js.map +0 -1
- package/dist/commands/publish-schema-to-db/abstractions/pg-type.js +0 -3
- package/dist/commands/publish-schema-to-db/abstractions/pg-type.js.map +0 -1
- package/dist/commands/publish-schema-to-db/content-entity-model.js.map +0 -1
- package/dist/commands/publish-schema-to-db/generate.js +0 -61
- package/dist/commands/publish-schema-to-db/generate.js.map +0 -1
- package/dist/commands/publish-schema-to-db/index.d.ts +0 -3
- package/dist/commands/publish-schema-to-db/index.js.map +0 -1
- package/dist/commands/publish-schema-to-db/pg-models/columns/fk-column.js.map +0 -1
- package/dist/commands/publish-schema-to-db/pg-models/columns/index.d.ts +0 -4
- package/dist/commands/publish-schema-to-db/pg-models/columns/index.js +0 -8
- package/dist/commands/publish-schema-to-db/pg-models/columns/index.js.map +0 -1
- package/dist/commands/publish-schema-to-db/pg-models/columns/pk-column.js.map +0 -1
- package/dist/commands/publish-schema-to-db/pg-models/columns/primitive-column.js.map +0 -1
- package/dist/commands/publish-schema-to-db/pg-models/columns/virtual-fk-column.js.map +0 -1
- package/dist/commands/publish-schema-to-db/pg-models/json-schema-parse-utils.js.map +0 -1
- package/dist/commands/publish-schema-to-db/pg-models/pg-sql-gen-utils.js.map +0 -1
- package/dist/commands/publish-schema-to-db/pg-models/pgl-utils.js.map +0 -1
- package/dist/commands/publish-schema-to-db/pg-models/tables/content-entity-table.js +0 -67
- package/dist/commands/publish-schema-to-db/pg-models/tables/content-entity-table.js.map +0 -1
- package/dist/commands/publish-schema-to-db/pg-models/tables/index.d.ts +0 -3
- package/dist/commands/publish-schema-to-db/pg-models/tables/index.js +0 -7
- package/dist/commands/publish-schema-to-db/pg-models/tables/index.js.map +0 -1
- package/dist/commands/publish-schema-to-db/pg-models/tables/object-property-table.js +0 -73
- package/dist/commands/publish-schema-to-db/pg-models/tables/object-property-table.js.map +0 -1
- package/dist/commands/publish-schema-to-db/pg-models/tables/relations-table.js +0 -61
- package/dist/commands/publish-schema-to-db/pg-models/tables/relations-table.js.map +0 -1
- package/dist/commands/publish-schema-to-db/postprocessors/collection-postprocessor.d.ts +0 -2
- package/dist/commands/publish-schema-to-db/postprocessors/collection-postprocessor.js +0 -21
- package/dist/commands/publish-schema-to-db/postprocessors/collection-postprocessor.js.map +0 -1
- package/dist/commands/publish-schema-to-db/postprocessors/content-entity-model-postprocessor.js +0 -3
- package/dist/commands/publish-schema-to-db/postprocessors/content-entity-model-postprocessor.js.map +0 -1
- package/dist/commands/publish-schema-to-db/postprocessors/episode-postprocessor.d.ts +0 -2
- package/dist/commands/publish-schema-to-db/postprocessors/episode-postprocessor.js +0 -25
- package/dist/commands/publish-schema-to-db/postprocessors/episode-postprocessor.js.map +0 -1
- package/dist/commands/publish-schema-to-db/postprocessors/index.d.ts +0 -6
- package/dist/commands/publish-schema-to-db/postprocessors/index.js +0 -10
- package/dist/commands/publish-schema-to-db/postprocessors/index.js.map +0 -1
- package/dist/commands/publish-schema-to-db/postprocessors/movie-postprocessor.d.ts +0 -2
- package/dist/commands/publish-schema-to-db/postprocessors/movie-postprocessor.js +0 -21
- package/dist/commands/publish-schema-to-db/postprocessors/movie-postprocessor.js.map +0 -1
- package/dist/commands/publish-schema-to-db/postprocessors/postprocessing-utils.d.ts +0 -4
- package/dist/commands/publish-schema-to-db/postprocessors/postprocessing-utils.js +0 -19
- package/dist/commands/publish-schema-to-db/postprocessors/postprocessing-utils.js.map +0 -1
- package/dist/commands/publish-schema-to-db/postprocessors/season-postprocessor.d.ts +0 -2
- package/dist/commands/publish-schema-to-db/postprocessors/season-postprocessor.js +0 -25
- package/dist/commands/publish-schema-to-db/postprocessors/season-postprocessor.js.map +0 -1
- package/dist/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.d.ts +0 -2
- package/dist/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.js +0 -21
- package/dist/commands/publish-schema-to-db/postprocessors/tvshow-postprocessor.js.map +0 -1
- package/dist/commands/publish-schema-to-db/publish-schema-to-db-options.js +0 -3
- package/dist/commands/publish-schema-to-db/publish-schema-to-db-options.js.map +0 -1
- package/dist/commands/service/index.js +0 -17
- package/dist/commands/service/index.js.map +0 -1
- package/dist/commands/service/purge-permissions/purge-permissions-command.d.ts +0 -3
- package/dist/commands/service/purge-permissions/purge-permissions-command.js.map +0 -1
- package/dist/commands/service/purge-permissions/purge-permissions-options.js +0 -3
- package/dist/commands/service/purge-permissions/purge-permissions-options.js.map +0 -1
- package/dist/commands/service/purge-permissions/purge-permissions.js +0 -54
- package/dist/commands/service/purge-permissions/purge-permissions.js.map +0 -1
- package/dist/commands/service/sync-permissions/sync-permission-command.d.ts +0 -3
- package/dist/commands/service/sync-permissions/sync-permission-command.js.map +0 -1
- package/dist/commands/service/sync-permissions/sync-permissions-options.js +0 -3
- package/dist/commands/service/sync-permissions/sync-permissions-options.js.map +0 -1
- package/dist/commands/service/sync-permissions/sync-permissions.js +0 -67
- package/dist/commands/service/sync-permissions/sync-permissions.js.map +0 -1
- package/dist/commands/unpublish-pilet/index.d.ts +0 -3
- package/dist/commands/unpublish-pilet/index.js.map +0 -1
- package/dist/commands/unpublish-pilet/unpublish-pilet-options.js +0 -3
- package/dist/commands/unpublish-pilet/unpublish-pilet-options.js.map +0 -1
- package/dist/commands/unpublish-pilet/unpublish-pilet.js +0 -19
- package/dist/commands/unpublish-pilet/unpublish-pilet.js.map +0 -1
- package/dist/common/index.d.ts +0 -1
- package/dist/common/index.js +0 -5
- package/dist/common/index.js.map +0 -1
- package/dist/common/utils.js.map +0 -1
- package/dist/exports.d.ts +0 -2
- package/dist/exports.js +0 -6
- package/dist/exports.js.map +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -6
- package/dist/index.js.map +0 -1
- /package/dist/{commands/get-access-token → cjs/lib}/get-access-token-options.d.ts +0 -0
- /package/dist/{commands/get-access-token → cjs/lib}/get-access-token-options.js +0 -0
- /package/dist/{commands/get-access-token → cjs/lib}/get-dev-access-token.js +0 -0
- /package/dist/{cli → esm/cli}/index.d.ts +0 -0
- /package/dist/{commands → esm/commands}/apply-templates/bitwarden-vault.d.ts +0 -0
- /package/dist/{commands → esm/commands}/create/defaultValues.d.ts +0 -0
- /package/dist/{commands → esm/commands}/create/helpers/logger.d.ts +0 -0
- /package/dist/{commands → esm/commands}/create/helpers/types.d.ts +0 -0
- /package/dist/{commands → esm/commands}/create-extension-config/create-extension-config.d.ts +0 -0
- /package/dist/{commands → esm/commands}/hosting/manifest/upload-manifest-options.d.ts +0 -0
- /package/dist/{commands → esm/commands}/hosting/pilet/register-pilet-options.d.ts +0 -0
- /package/dist/{commands → esm/commands}/hosting/service/deploy/service-deploy-options.d.ts +0 -0
- /package/dist/{commands → esm/commands}/hosting/service/undeploy/service-undeploy-options.d.ts +0 -0
- /package/dist/{commands → esm/commands}/msg-diff/git-checkout-tmp.d.ts +0 -0
- /package/dist/{commands → esm/commands}/msg-diff/message-diff-options.d.ts +0 -0
- /package/dist/{commands → esm/commands}/pg-dump/pg-dump-options.d.ts +0 -0
- /package/dist/{commands → esm/commands}/publish-schema-to-db/abstractions/pg-type.d.ts +0 -0
- /package/dist/{commands → esm/commands}/publish-schema-to-db/publish-schema-to-db-options.d.ts +0 -0
- /package/dist/{commands → esm/commands}/service/purge-permissions/purge-permissions-options.d.ts +0 -0
- /package/dist/{commands → esm/commands}/service/sync-permissions/sync-permissions-options.d.ts +0 -0
- /package/dist/{commands → esm/commands}/unpublish-pilet/unpublish-pilet-options.d.ts +0 -0
- /package/dist/{common → esm/common}/utils.d.ts +0 -0
- /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,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
|
|
78
|
-
if (
|
|
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 '
|
|
6
|
-
import { getDevAccessToken } from '
|
|
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
|
|
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
|
|
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 {
|
|
3
|
-
import {
|
|
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 {
|
|
3
|
-
import {
|
|
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 {
|
|
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
|
|
2
|
-
import { CommandModule } from 'yargs';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
|
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
|
|
2
|
-
import { CommandModule } from 'yargs';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
|
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
|
|
12
|
-
AsyncAPIDocumentInterface,
|
|
11
|
+
import _Parser, {
|
|
12
|
+
type AsyncAPIDocumentInterface,
|
|
13
13
|
fromFile,
|
|
14
|
-
MessageInterface,
|
|
14
|
+
type MessageInterface,
|
|
15
15
|
} from '@asyncapi/parser';
|
|
16
|
-
import
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
646
|
-
|
|
647
|
-
...
|
|
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 (
|
|
671
|
+
if (allItems.length < 1) {
|
|
651
672
|
return;
|
|
652
673
|
}
|
|
653
674
|
|
|
654
|
-
const exports =
|
|
655
|
-
.sort()
|
|
656
|
-
.map((
|
|
657
|
-
|
|
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(
|
|
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
|
|
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
|
|
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 {
|
|
2
|
-
import
|
|
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
|
|
4
|
+
import spectralRuntime from '@stoplight/spectral-runtime';
|
|
5
5
|
import * as fs from 'fs';
|
|
6
|
-
import
|
|
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
|
-
|
|
35
|
+
Json,
|
|
33
36
|
schema,
|
|
34
37
|
);
|
|
35
38
|
const results = await spectral.run(document);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormatHelpers, TypeScriptPreset } from '@asyncapi/modelina';
|
|
2
|
-
import
|
|
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
|
-
*
|
|
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
|
|
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(
|
|
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,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CommandModule } from 'yargs';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
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
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
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
|
}
|