ddd-ts-kit 0.13.0 → 0.15.0
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 +34 -3
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +2 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/errors/kit-error-codes.d.ts.map +1 -1
- package/dist/check/errors/kit-error-codes.js +1 -0
- package/dist/check/errors/kit-error-codes.js.map +1 -1
- package/dist/check/explain/authz-docs.d.ts.map +1 -1
- package/dist/check/explain/authz-docs.js +12 -0
- package/dist/check/explain/authz-docs.js.map +1 -1
- package/dist/check/explain/errors-docs.js +1 -1
- package/dist/check/explain/errors-docs.js.map +1 -1
- package/dist/check/explain/tenancy-docs.d.ts.map +1 -1
- package/dist/check/explain/tenancy-docs.js +3 -1
- package/dist/check/explain/tenancy-docs.js.map +1 -1
- package/dist/check/fixtures/authz-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-fixtures.js +38 -1
- package/dist/check/fixtures/authz-fixtures.js.map +1 -1
- package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/tenancy-fixtures.js +28 -0
- package/dist/check/fixtures/tenancy-fixtures.js.map +1 -1
- package/dist/check/rules/authz-fields-by-schema.d.ts +3 -0
- package/dist/check/rules/authz-fields-by-schema.d.ts.map +1 -0
- package/dist/check/rules/authz-fields-by-schema.js +33 -0
- package/dist/check/rules/authz-fields-by-schema.js.map +1 -0
- package/dist/check/tenancy/knex-unscoped.d.ts +6 -1
- package/dist/check/tenancy/knex-unscoped.d.ts.map +1 -1
- package/dist/check/tenancy/knex-unscoped.js +19 -6
- package/dist/check/tenancy/knex-unscoped.js.map +1 -1
- package/dist/check/tenancy/raw-reaches-rows.d.ts +8 -0
- package/dist/check/tenancy/raw-reaches-rows.d.ts.map +1 -0
- package/dist/check/tenancy/raw-reaches-rows.js +91 -0
- package/dist/check/tenancy/raw-reaches-rows.js.map +1 -0
- package/dist/check/tenancy/raw-sql-text.d.ts +9 -0
- package/dist/check/tenancy/raw-sql-text.d.ts.map +1 -0
- package/dist/check/tenancy/raw-sql-text.js +29 -0
- package/dist/check/tenancy/raw-sql-text.js.map +1 -0
- package/dist/commands/generate.js +2 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +13 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/parse-stack.d.ts.map +1 -1
- package/dist/config/parse-stack.js +3 -1
- package/dist/config/parse-stack.js.map +1 -1
- package/dist/config/stack.d.ts +14 -0
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +2 -0
- package/dist/config/stack.js.map +1 -1
- package/dist/declared/injection/laid-out-calls.d.ts +7 -0
- package/dist/declared/injection/laid-out-calls.d.ts.map +1 -0
- package/dist/declared/injection/laid-out-calls.js +14 -0
- package/dist/declared/injection/laid-out-calls.js.map +1 -0
- package/dist/declared/render-barrel.d.ts.map +1 -1
- package/dist/declared/render-barrel.js +2 -1
- package/dist/declared/render-barrel.js.map +1 -1
- package/dist/declared/render-dependencies-file.d.ts.map +1 -1
- package/dist/declared/render-dependencies-file.js +2 -1
- package/dist/declared/render-dependencies-file.js.map +1 -1
- package/dist/describe/context-description.d.ts +6 -0
- package/dist/describe/context-description.d.ts.map +1 -1
- package/dist/describe/format-description.js +9 -1
- package/dist/describe/format-description.js.map +1 -1
- package/dist/describe/presentation-of-route.d.ts +4 -0
- package/dist/describe/presentation-of-route.d.ts.map +1 -0
- package/dist/describe/presentation-of-route.js +15 -0
- package/dist/describe/presentation-of-route.js.map +1 -0
- package/dist/describe/read-controllers.d.ts.map +1 -1
- package/dist/describe/read-controllers.js +4 -1
- package/dist/describe/read-controllers.js.map +1 -1
- package/dist/describe/read-routes.d.ts.map +1 -1
- package/dist/describe/read-routes.js +2 -0
- package/dist/describe/read-routes.js.map +1 -1
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/context-kind.d.ts.map +1 -1
- package/dist/generate/kinds/context-kind.js +13 -6
- package/dist/generate/kinds/context-kind.js.map +1 -1
- package/dist/generate/kinds/form-kind.d.ts +3 -0
- package/dist/generate/kinds/form-kind.d.ts.map +1 -0
- package/dist/generate/kinds/form-kind.js +38 -0
- package/dist/generate/kinds/form-kind.js.map +1 -0
- package/dist/generate/kinds/next-adr-number.d.ts +4 -0
- package/dist/generate/kinds/next-adr-number.d.ts.map +1 -0
- package/dist/generate/kinds/next-adr-number.js +7 -0
- package/dist/generate/kinds/next-adr-number.js.map +1 -0
- package/dist/generate/kinds/presentation/controller-of.d.ts +10 -0
- package/dist/generate/kinds/presentation/controller-of.d.ts.map +1 -0
- package/dist/generate/kinds/presentation/controller-of.js +13 -0
- package/dist/generate/kinds/presentation/controller-of.js.map +1 -0
- package/dist/generate/kinds/presentation/controller-source.d.ts +13 -0
- package/dist/generate/kinds/presentation/controller-source.d.ts.map +1 -0
- package/dist/generate/kinds/presentation/controller-source.js +44 -0
- package/dist/generate/kinds/presentation/controller-source.js.map +1 -0
- package/dist/generate/kinds/representation-kind.d.ts +3 -0
- package/dist/generate/kinds/representation-kind.d.ts.map +1 -0
- package/dist/generate/kinds/representation-kind.js +54 -0
- package/dist/generate/kinds/representation-kind.js.map +1 -0
- package/dist/generate/kinds/write-adr.js +3 -6
- package/dist/generate/kinds/write-adr.js.map +1 -1
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +4 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/help/usage.d.ts +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +3 -2
- package/dist/help/usage.js.map +1 -1
- package/dist/init/files/platform-files.js +3 -1
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/run-init.d.ts +2 -0
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +15 -1
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +15 -1
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/stack-options.d.ts +2 -0
- package/dist/init/stack/stack-options.d.ts.map +1 -1
- package/dist/presets/apply-preset.d.ts +15 -0
- package/dist/presets/apply-preset.d.ts.map +1 -0
- package/dist/presets/apply-preset.js +94 -0
- package/dist/presets/apply-preset.js.map +1 -0
- package/dist/presets/grant-to-signed-in.d.ts +9 -0
- package/dist/presets/grant-to-signed-in.d.ts.map +1 -0
- package/dist/presets/grant-to-signed-in.js +61 -0
- package/dist/presets/grant-to-signed-in.js.map +1 -0
- package/dist/presets/identity-preset.d.ts +9 -0
- package/dist/presets/identity-preset.d.ts.map +1 -0
- package/dist/presets/identity-preset.js +44 -0
- package/dist/presets/identity-preset.js.map +1 -0
- package/dist/presets/identity-refusal.d.ts +5 -0
- package/dist/presets/identity-refusal.d.ts.map +1 -0
- package/dist/presets/identity-refusal.js +29 -0
- package/dist/presets/identity-refusal.js.map +1 -0
- package/dist/presets/identity-terms.d.ts +4 -0
- package/dist/presets/identity-terms.d.ts.map +1 -0
- package/dist/presets/identity-terms.js +57 -0
- package/dist/presets/identity-terms.js.map +1 -0
- package/dist/presets/no-flags.d.ts +4 -0
- package/dist/presets/no-flags.d.ts.map +1 -0
- package/dist/presets/no-flags.js +18 -0
- package/dist/presets/no-flags.js.map +1 -0
- package/dist/presets/organisations-as-tenants.d.ts +9 -0
- package/dist/presets/organisations-as-tenants.d.ts.map +1 -0
- package/dist/presets/organisations-as-tenants.js +43 -0
- package/dist/presets/organisations-as-tenants.js.map +1 -0
- package/dist/presets/preset-decision.d.ts +8 -0
- package/dist/presets/preset-decision.d.ts.map +1 -0
- package/dist/presets/preset-decision.js +19 -0
- package/dist/presets/preset-decision.js.map +1 -0
- package/dist/presets/preset-file.d.ts +13 -0
- package/dist/presets/preset-file.d.ts.map +1 -0
- package/dist/presets/preset-file.js +2 -0
- package/dist/presets/preset-file.js.map +1 -0
- package/dist/presets/preset-files.d.ts +9 -0
- package/dist/presets/preset-files.d.ts.map +1 -0
- package/dist/presets/preset-files.js +34 -0
- package/dist/presets/preset-files.js.map +1 -0
- package/dist/presets/preset-named.d.ts +3 -0
- package/dist/presets/preset-named.d.ts.map +1 -0
- package/dist/presets/preset-named.js +12 -0
- package/dist/presets/preset-named.js.map +1 -0
- package/dist/presets/preset-refusal.d.ts +6 -0
- package/dist/presets/preset-refusal.d.ts.map +1 -0
- package/dist/presets/preset-refusal.js +2 -0
- package/dist/presets/preset-refusal.js.map +1 -0
- package/dist/presets/preset-step.d.ts +8 -0
- package/dist/presets/preset-step.d.ts.map +1 -0
- package/dist/presets/preset-step.js +2 -0
- package/dist/presets/preset-step.js.map +1 -0
- package/dist/presets/preset.d.ts +36 -0
- package/dist/presets/preset.d.ts.map +1 -0
- package/dist/presets/preset.js +2 -0
- package/dist/presets/preset.js.map +1 -0
- package/dist/presets/with-authorizer-import.d.ts +6 -0
- package/dist/presets/with-authorizer-import.d.ts.map +1 -0
- package/dist/presets/with-authorizer-import.js +27 -0
- package/dist/presets/with-authorizer-import.js.map +1 -0
- package/dist/stack/stack-vars.js +19 -2
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workspace/workspace.d.ts +2 -0
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/dist/workspace/workspace.js +4 -0
- package/dist/workspace/workspace.js.map +1 -1
- package/package.json +2 -2
- package/templates/docs/openapi.json.tpl +15 -0
- package/templates/init/CLAUDE.md.tpl +2 -2
- package/templates/init/platform/auth/http-boundary.ts.tpl +20 -3
- package/templates/init/platform/compose-application.manual.ts.tpl +18 -0
- package/templates/init/platform/compose-application.tsyringe.ts.tpl +23 -0
- package/templates/init/platform/http/presentation-of.ts.tpl +27 -0
- package/templates/init/platform/http/start-http-server.express.ts.tpl +1 -1
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +1 -1
- package/templates/init/platform/http/start-http-server.hono.ts.tpl +1 -1
- package/templates/init/platform/http/start-http-server.nest.ts.tpl +2 -2
- package/templates/init/platform/http/with-documentation.ts.tpl +13 -3
- package/templates/init/platform/http/with-forms.ts.tpl +7 -0
- package/templates/init/rules/application.md.tpl +1 -1
- package/templates/init/rules/presentation.md.tpl +1 -1
- package/templates/init/scripts/openapi.ts.tpl +27 -6
- package/templates/pipeline/biome.json.tpl +1 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/presets/identity/context/application/authorization/__context__.permissions.ts.tpl +23 -0
- package/templates/presets/identity/context/application/authorization/change-member-roles.policy.ts.tpl +17 -0
- package/templates/presets/identity/context/application/authorization/grant-delegations.policy.ts.tpl +17 -0
- package/templates/presets/identity/context/application/authorization/invite-members.policy.ts.tpl +17 -0
- package/templates/presets/identity/context/application/authorization/read-members.policy.ts.tpl +17 -0
- package/templates/presets/identity/context/application/authorization/remove-members.policy.ts.tpl +17 -0
- package/templates/presets/identity/context/application/authorization/revoke-delegations.policy.ts.tpl +17 -0
- package/templates/presets/identity/context/application/authorization/revoke-invitations.policy.ts.tpl +17 -0
- package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.command.ts.tpl +14 -0
- package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +56 -0
- package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.command.ts.tpl +17 -0
- package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.handler.ts.tpl +82 -0
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.command.ts.tpl +7 -0
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.handler.ts.tpl +69 -0
- package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.command.ts.tpl +14 -0
- package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.handler.ts.tpl +36 -0
- package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.command.ts.tpl +21 -0
- package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.handler.ts.tpl +43 -0
- package/templates/presets/identity/context/application/commands/invite-member/invite-member.command.ts.tpl +16 -0
- package/templates/presets/identity/context/application/commands/invite-member/invite-member.handler.ts.tpl +53 -0
- package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.command.ts.tpl +14 -0
- package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.handler.ts.tpl +50 -0
- package/templates/presets/identity/context/application/commands/provision-account/provision-account.command.ts.tpl +14 -0
- package/templates/presets/identity/context/application/commands/provision-account/provision-account.handler.ts.tpl +41 -0
- package/templates/presets/identity/context/application/commands/remove-member/remove-member.command.ts.tpl +15 -0
- package/templates/presets/identity/context/application/commands/remove-member/remove-member.handler.ts.tpl +79 -0
- package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.command.ts.tpl +15 -0
- package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.handler.ts.tpl +39 -0
- package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.command.ts.tpl +15 -0
- package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.handler.ts.tpl +42 -0
- package/templates/presets/identity/context/application/integration/handlers/account-deactivated.integration-handler.ts.tpl +19 -0
- package/templates/presets/identity/context/application/integration/handlers/member-joined.integration-handler.ts.tpl +33 -0
- package/templates/presets/identity/context/application/integration/handlers/member-removed.integration-handler.ts.tpl +30 -0
- package/templates/presets/identity/context/application/integration/handlers/organisation-opened.integration-handler.ts.tpl +19 -0
- package/templates/presets/identity/context/application/integration/publishers/account-deactivated.publisher.ts.tpl +24 -0
- package/templates/presets/identity/context/application/integration/publishers/delegation-granted.publisher.ts.tpl +36 -0
- package/templates/presets/identity/context/application/integration/publishers/delegation-revoked.publisher.ts.tpl +33 -0
- package/templates/presets/identity/context/application/integration/publishers/member-joined.publisher.ts.tpl +33 -0
- package/templates/presets/identity/context/application/integration/publishers/member-removed.publisher.ts.tpl +33 -0
- package/templates/presets/identity/context/application/integration/publishers/member-role-changed.publisher.ts.tpl +35 -0
- package/templates/presets/identity/context/application/integration/publishers/organisation-opened.publisher.ts.tpl +32 -0
- package/templates/presets/identity/context/application/ports/identity-provider-admin.port.ts.tpl +17 -0
- package/templates/presets/identity/context/application/ports/identity-provider-connection.port.ts.tpl +14 -0
- package/templates/presets/identity/context/application/ports/invitation-tokens.port.ts.tpl +7 -0
- package/templates/presets/identity/context/application/ports/search-members-reader.port.ts.tpl +10 -0
- package/templates/presets/identity/context/application/queries/search-members/search-members.handler.ts.tpl +33 -0
- package/templates/presets/identity/context/application/queries/search-members/search-members.query.ts.tpl +19 -0
- package/templates/presets/identity/context/application/queries/search-members/search-members.result.ts.tpl +17 -0
- package/templates/presets/identity/context/domain/aggregates/account.aggregate.ts.tpl +92 -0
- package/templates/presets/identity/context/domain/aggregates/delegation.aggregate.ts.tpl +117 -0
- package/templates/presets/identity/context/domain/aggregates/invitation.aggregate.ts.tpl +128 -0
- package/templates/presets/identity/context/domain/aggregates/member.aggregate.ts.tpl +149 -0
- package/templates/presets/identity/context/domain/aggregates/organisation.aggregate.ts.tpl +52 -0
- package/templates/presets/identity/context/domain/errors/account.error.ts.tpl +40 -0
- package/templates/presets/identity/context/domain/errors/delegation.error.ts.tpl +45 -0
- package/templates/presets/identity/context/domain/errors/invitation.error.ts.tpl +30 -0
- package/templates/presets/identity/context/domain/errors/member.error.ts.tpl +50 -0
- package/templates/presets/identity/context/domain/errors/organisation.error.ts.tpl +32 -0
- package/templates/presets/identity/context/domain/events/account-deactivated.event.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/events/account-provisioned.event.ts.tpl +17 -0
- package/templates/presets/identity/context/domain/events/delegation-granted.event.ts.tpl +22 -0
- package/templates/presets/identity/context/domain/events/delegation-revoked.event.ts.tpl +18 -0
- package/templates/presets/identity/context/domain/events/invitation-accepted.event.ts.tpl +17 -0
- package/templates/presets/identity/context/domain/events/invitation-declined.event.ts.tpl +16 -0
- package/templates/presets/identity/context/domain/events/invitation-issued.event.ts.tpl +22 -0
- package/templates/presets/identity/context/domain/events/invitation-revoked.event.ts.tpl +16 -0
- package/templates/presets/identity/context/domain/events/member-joined.event.ts.tpl +19 -0
- package/templates/presets/identity/context/domain/events/member-removed.event.ts.tpl +19 -0
- package/templates/presets/identity/context/domain/events/member-role-changed.event.ts.tpl +22 -0
- package/templates/presets/identity/context/domain/events/organisation-opened.event.ts.tpl +17 -0
- package/templates/presets/identity/context/domain/repositories/account.repository.ts.tpl +5 -0
- package/templates/presets/identity/context/domain/repositories/delegation.repository.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/repositories/invitation.repository.ts.tpl +7 -0
- package/templates/presets/identity/context/domain/repositories/member.repository.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/repositories/organisation.repository.ts.tpl +5 -0
- package/templates/presets/identity/context/domain/services/role-rights.service.ts.tpl +59 -0
- package/templates/presets/identity/context/domain/value-objects/delegation-period.vo.ts.tpl +42 -0
- package/templates/presets/identity/context/domain/value-objects/display-name.vo.ts.tpl +29 -0
- package/templates/presets/identity/context/domain/value-objects/email-address.vo.ts.tpl +31 -0
- package/templates/presets/identity/context/domain/value-objects/organisation-name.vo.ts.tpl +29 -0
- package/templates/presets/identity/context/domain/value-objects/organisation-rights.vo.ts.tpl +43 -0
- package/templates/presets/identity/context/domain/value-objects/organisation-slug.vo.ts.tpl +30 -0
- package/templates/presets/identity/context/domain/vocabularies/account-status.vocabulary.ts.tpl +7 -0
- package/templates/presets/identity/context/domain/vocabularies/invitation-status.vocabulary.ts.tpl +9 -0
- package/templates/presets/identity/context/domain/vocabularies/member-right.vocabulary.ts.tpl +9 -0
- package/templates/presets/identity/context/domain/vocabularies/member-role.vocabulary.ts.tpl +8 -0
- package/templates/presets/identity/context/infrastructure/external/crypto-invitation-tokens.adapter.ts.tpl +20 -0
- package/templates/presets/identity/context/infrastructure/external/environment-identity-provider-connection.adapter.ts.tpl +37 -0
- package/templates/presets/identity/context/infrastructure/external/keycloak-identity-provider-admin.adapter.ts.tpl +149 -0
- package/templates/presets/identity/context/infrastructure/persistence/__context__.schema.drizzle.ts.tpl +102 -0
- package/templates/presets/identity/context/infrastructure/persistence/account-row.schema.knex.ts.tpl +15 -0
- package/templates/presets/identity/context/infrastructure/persistence/account.mapper.drizzle.ts.tpl +38 -0
- package/templates/presets/identity/context/infrastructure/persistence/account.mapper.knex.ts.tpl +33 -0
- package/templates/presets/identity/context/infrastructure/persistence/create-__context__-tables.schema.knex.ts.tpl +107 -0
- package/templates/presets/identity/context/infrastructure/persistence/delegation-row.schema.knex.ts.tpl +17 -0
- package/templates/presets/identity/context/infrastructure/persistence/delegation.mapper.drizzle.ts.tpl +50 -0
- package/templates/presets/identity/context/infrastructure/persistence/delegation.mapper.knex.ts.tpl +45 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +59 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +77 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +65 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +84 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +59 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-search-members-reader.repository.drizzle.ts.tpl +53 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation-row.schema.knex.ts.tpl +20 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.drizzle.ts.tpl +45 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.knex.ts.tpl +40 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-account.repository.knex.ts.tpl +61 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-delegation.repository.knex.ts.tpl +80 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-invitation.repository.knex.ts.tpl +67 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-member.repository.knex.ts.tpl +82 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-organisation.repository.knex.ts.tpl +61 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-search-members-reader.repository.knex.ts.tpl +77 -0
- package/templates/presets/identity/context/infrastructure/persistence/member-row.schema.knex.ts.tpl +15 -0
- package/templates/presets/identity/context/infrastructure/persistence/member.mapper.drizzle.ts.tpl +36 -0
- package/templates/presets/identity/context/infrastructure/persistence/member.mapper.knex.ts.tpl +31 -0
- package/templates/presets/identity/context/infrastructure/persistence/organisation-row.schema.knex.ts.tpl +12 -0
- package/templates/presets/identity/context/infrastructure/persistence/organisation.mapper.drizzle.ts.tpl +28 -0
- package/templates/presets/identity/context/infrastructure/persistence/organisation.mapper.knex.ts.tpl +26 -0
- package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/deactivate-account.accepted.class-validator.per-route.ts.tpl +6 -0
- package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/deactivate-account.controller.ts.tpl +71 -0
- package/templates/presets/identity/context/presentation/http/accounts/provision-account/provision-account.accepted.class-validator.per-route.ts.tpl +6 -0
- package/templates/presets/identity/context/presentation/http/accounts/provision-account/provision-account.body.class-validator.ts.tpl +9 -0
- package/templates/presets/identity/context/presentation/http/accounts/provision-account/provision-account.controller.ts.tpl +85 -0
- package/templates/presets/identity/context/presentation/http/accounts.routes.ts.tpl +5 -0
- package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.accepted.class-validator.per-route.ts.tpl +6 -0
- package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.body.class-validator.per-route.ts.tpl +8 -0
- package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.ts.tpl +100 -0
- package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/decline-invitation.accepted.class-validator.per-route.ts.tpl +6 -0
- package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/decline-invitation.body.class-validator.per-route.ts.tpl +8 -0
- package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/decline-invitation.controller.ts.tpl +98 -0
- package/templates/presets/identity/context/presentation/http/invitations.routes.ts.tpl +5 -0
- package/templates/presets/identity/context/presentation/http/organisations/change-member-role/change-member-role.accepted.class-validator.per-route.ts.tpl +6 -0
- package/templates/presets/identity/context/presentation/http/organisations/change-member-role/change-member-role.body.class-validator.ts.tpl +7 -0
- package/templates/presets/identity/context/presentation/http/organisations/change-member-role/change-member-role.controller.ts.tpl +83 -0
- package/templates/presets/identity/context/presentation/http/organisations/change-member-role/change-member-role.params.class-validator.ts.tpl +11 -0
- package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/grant-delegation.accepted.class-validator.per-route.ts.tpl +6 -0
- package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/grant-delegation.body.class-validator.ts.tpl +18 -0
- package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/grant-delegation.controller.ts.tpl +103 -0
- package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/grant-delegation.params.class-validator.ts.tpl +7 -0
- package/templates/presets/identity/context/presentation/http/organisations/invite-member/invite-member.accepted.class-validator.ts.tpl +10 -0
- package/templates/presets/identity/context/presentation/http/organisations/invite-member/invite-member.body.class-validator.ts.tpl +10 -0
- package/templates/presets/identity/context/presentation/http/organisations/invite-member/invite-member.controller.ts.tpl +65 -0
- package/templates/presets/identity/context/presentation/http/organisations/invite-member/invite-member.params.class-validator.ts.tpl +7 -0
- package/templates/presets/identity/context/presentation/http/organisations/open-organisation/open-organisation.accepted.class-validator.per-route.ts.tpl +6 -0
- package/templates/presets/identity/context/presentation/http/organisations/open-organisation/open-organisation.body.class-validator.ts.tpl +12 -0
- package/templates/presets/identity/context/presentation/http/organisations/open-organisation/open-organisation.controller.ts.tpl +79 -0
- package/templates/presets/identity/context/presentation/http/organisations/remove-member/remove-member.accepted.class-validator.per-route.ts.tpl +6 -0
- package/templates/presets/identity/context/presentation/http/organisations/remove-member/remove-member.controller.ts.tpl +73 -0
- package/templates/presets/identity/context/presentation/http/organisations/remove-member/remove-member.params.class-validator.ts.tpl +11 -0
- package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/revoke-delegation.accepted.class-validator.per-route.ts.tpl +6 -0
- package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/revoke-delegation.controller.ts.tpl +73 -0
- package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/revoke-delegation.params.class-validator.ts.tpl +11 -0
- package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/revoke-invitation.accepted.class-validator.per-route.ts.tpl +6 -0
- package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/revoke-invitation.controller.ts.tpl +73 -0
- package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/revoke-invitation.params.class-validator.ts.tpl +11 -0
- package/templates/presets/identity/context/presentation/http/organisations/search-members/search-members.controller.ts.tpl +86 -0
- package/templates/presets/identity/context/presentation/http/organisations/search-members/search-members.line.class-validator.ts.tpl +22 -0
- package/templates/presets/identity/context/presentation/http/organisations/search-members/search-members.params.class-validator.ts.tpl +7 -0
- package/templates/presets/identity/context/presentation/http/organisations.routes.ts.tpl +5 -0
- package/templates/presets/identity/context/presentation/http/shared/invitation-token.schema.class-validator.shared.ts.tpl +9 -0
- package/templates/presets/identity/context/presentation/http/shared/invitation-token.schema.zod.shared.ts.tpl +9 -0
- package/templates/presets/identity/context/published-language/account-deactivated.v1.integration-event.ts.tpl +33 -0
- package/templates/presets/identity/context/published-language/account-deactivated.v1.payload.class-validator.ts.tpl +7 -0
- package/templates/presets/identity/context/published-language/delegation-granted.v1.integration-event.ts.tpl +39 -0
- package/templates/presets/identity/context/published-language/delegation-granted.v1.payload.class-validator.ts.tpl +28 -0
- package/templates/presets/identity/context/published-language/delegation-revoked.v1.integration-event.ts.tpl +36 -0
- package/templates/presets/identity/context/published-language/delegation-revoked.v1.payload.class-validator.ts.tpl +16 -0
- package/templates/presets/identity/context/published-language/member-joined.v1.integration-event.ts.tpl +36 -0
- package/templates/presets/identity/context/published-language/member-joined.v1.payload.class-validator.ts.tpl +16 -0
- package/templates/presets/identity/context/published-language/member-removed.v1.integration-event.ts.tpl +36 -0
- package/templates/presets/identity/context/published-language/member-removed.v1.payload.class-validator.ts.tpl +18 -0
- package/templates/presets/identity/context/published-language/member-role-changed.v1.integration-event.ts.tpl +38 -0
- package/templates/presets/identity/context/published-language/member-role-changed.v1.payload.class-validator.ts.tpl +24 -0
- package/templates/presets/identity/context/published-language/organisation-opened.v1.integration-event.ts.tpl +35 -0
- package/templates/presets/identity/context/published-language/organisation-opened.v1.payload.class-validator.ts.tpl +13 -0
- package/templates/presets/identity/context/test/builders/account.builder.ts.tpl +59 -0
- package/templates/presets/identity/context/test/builders/delegation.builder.ts.tpl +67 -0
- package/templates/presets/identity/context/test/builders/invitation.builder.ts.tpl +60 -0
- package/templates/presets/identity/context/test/builders/member.builder.ts.tpl +59 -0
- package/templates/presets/identity/context/test/builders/organisation.builder.ts.tpl +44 -0
- package/templates/presets/identity/context/test/fakes/account.repository.fake.ts.tpl +10 -0
- package/templates/presets/identity/context/test/fakes/delegation.repository.fake.ts.tpl +26 -0
- package/templates/presets/identity/context/test/fakes/identity-provider-admin.fake.ts.tpl +41 -0
- package/templates/presets/identity/context/test/fakes/invitation-tokens.fake.ts.tpl +18 -0
- package/templates/presets/identity/context/test/fakes/invitation.repository.fake.ts.tpl +14 -0
- package/templates/presets/identity/context/test/fakes/member.repository.fake.ts.tpl +29 -0
- package/templates/presets/identity/context/test/fakes/organisation.repository.fake.ts.tpl +10 -0
- package/templates/presets/identity/context/test/fakes/search-members-reader.fake.ts.tpl +25 -0
- package/templates/presets/identity/context/test/integration/account.repository.contract.spec.ts.tpl +48 -0
- package/templates/presets/identity/context/test/integration/delegation.repository.contract.spec.ts.tpl +84 -0
- package/templates/presets/identity/context/test/integration/invitation.repository.contract.spec.ts.tpl +76 -0
- package/templates/presets/identity/context/test/integration/keycloak-identity-provider-admin.adapter.spec.ts.tpl +123 -0
- package/templates/presets/identity/context/test/integration/member.repository.contract.spec.ts.tpl +92 -0
- package/templates/presets/identity/context/test/integration/organisation.repository.contract.spec.ts.tpl +46 -0
- package/templates/presets/identity/context/test/integration/search-members-reader.spec.ts.tpl +86 -0
- package/templates/presets/identity/context/test/unit/accept-invitation.controller.spec.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/accept-invitation.handler.spec.ts.tpl +69 -0
- package/templates/presets/identity/context/test/unit/account-deactivated.integration-handler.spec.ts.tpl +24 -0
- package/templates/presets/identity/context/test/unit/account-deactivated.publisher.spec.ts.tpl +25 -0
- package/templates/presets/identity/context/test/unit/account.aggregate.spec.ts.tpl +72 -0
- package/templates/presets/identity/context/test/unit/change-member-role.controller.spec.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/change-member-role.handler.spec.ts.tpl +135 -0
- package/templates/presets/identity/context/test/unit/crypto-invitation-tokens.adapter.spec.ts.tpl +15 -0
- package/templates/presets/identity/context/test/unit/deactivate-account.controller.spec.ts.tpl +44 -0
- package/templates/presets/identity/context/test/unit/deactivate-account.handler.spec.ts.tpl +106 -0
- package/templates/presets/identity/context/test/unit/decline-invitation.controller.spec.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/decline-invitation.handler.spec.ts.tpl +40 -0
- package/templates/presets/identity/context/test/unit/delegation-granted.publisher.spec.ts.tpl +36 -0
- package/templates/presets/identity/context/test/unit/delegation-period.vo.spec.ts.tpl +32 -0
- package/templates/presets/identity/context/test/unit/delegation-revoked.publisher.spec.ts.tpl +35 -0
- package/templates/presets/identity/context/test/unit/delegation.aggregate.spec.ts.tpl +111 -0
- package/templates/presets/identity/context/test/unit/display-name.vo.spec.ts.tpl +13 -0
- package/templates/presets/identity/context/test/unit/email-address.vo.spec.ts.tpl +24 -0
- package/templates/presets/identity/context/test/unit/environment-identity-provider-connection.adapter.spec.ts.tpl +41 -0
- package/templates/presets/identity/context/test/unit/grant-delegation.controller.spec.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/grant-delegation.handler.spec.ts.tpl +66 -0
- package/templates/presets/identity/context/test/unit/identity-application.ts.tpl +79 -0
- package/templates/presets/identity/context/test/unit/invitation.aggregate.spec.ts.tpl +118 -0
- package/templates/presets/identity/context/test/unit/invite-member.controller.spec.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/invite-member.handler.spec.ts.tpl +110 -0
- package/templates/presets/identity/context/test/unit/member-joined.integration-handler.spec.ts.tpl +38 -0
- package/templates/presets/identity/context/test/unit/member-joined.publisher.spec.ts.tpl +36 -0
- package/templates/presets/identity/context/test/unit/member-removed.integration-handler.spec.ts.tpl +45 -0
- package/templates/presets/identity/context/test/unit/member-removed.publisher.spec.ts.tpl +35 -0
- package/templates/presets/identity/context/test/unit/member-role-changed.publisher.spec.ts.tpl +36 -0
- package/templates/presets/identity/context/test/unit/member.aggregate.spec.ts.tpl +142 -0
- package/templates/presets/identity/context/test/unit/open-organisation.controller.spec.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/open-organisation.handler.spec.ts.tpl +52 -0
- package/templates/presets/identity/context/test/unit/organisation-name.vo.spec.ts.tpl +13 -0
- package/templates/presets/identity/context/test/unit/organisation-opened.integration-handler.spec.ts.tpl +24 -0
- package/templates/presets/identity/context/test/unit/organisation-opened.publisher.spec.ts.tpl +35 -0
- package/templates/presets/identity/context/test/unit/organisation-rights.vo.spec.ts.tpl +23 -0
- package/templates/presets/identity/context/test/unit/organisation-slug.vo.spec.ts.tpl +17 -0
- package/templates/presets/identity/context/test/unit/organisation.aggregate.spec.ts.tpl +33 -0
- package/templates/presets/identity/context/test/unit/provision-account.controller.spec.ts.tpl +73 -0
- package/templates/presets/identity/context/test/unit/provision-account.handler.spec.ts.tpl +65 -0
- package/templates/presets/identity/context/test/unit/remove-member.controller.spec.ts.tpl +44 -0
- package/templates/presets/identity/context/test/unit/remove-member.handler.spec.ts.tpl +125 -0
- package/templates/presets/identity/context/test/unit/revoke-delegation.controller.spec.ts.tpl +44 -0
- package/templates/presets/identity/context/test/unit/revoke-delegation.handler.spec.ts.tpl +51 -0
- package/templates/presets/identity/context/test/unit/revoke-invitation.controller.spec.ts.tpl +44 -0
- package/templates/presets/identity/context/test/unit/revoke-invitation.handler.spec.ts.tpl +44 -0
- package/templates/presets/identity/context/test/unit/role-rights.service.spec.ts.tpl +54 -0
- package/templates/presets/identity/context/test/unit/search-members.controller.spec.ts.tpl +43 -0
- package/templates/presets/identity/context/test/unit/search-members.handler.spec.ts.tpl +38 -0
- package/templates/presets/identity/decision.md.tpl +37 -0
- package/templates/presets/identity/design.md.tpl +71 -0
- package/templates/presets/signed-in-grants.ts.tpl +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation-of-route.d.ts","sourceRoot":"","sources":["../../src/describe/presentation-of-route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAG1D,uIAAuI;AACvI,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GAClB,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC,CASnD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { listedIn } from './listed-in.js';
|
|
2
|
+
/** What a route says of its presentation, in the options of its declaration: the media types it answers and reads in, and its form. */
|
|
3
|
+
export function presentationOfRoute(options, operationId) {
|
|
4
|
+
const produces = mediaTypes(options, 'produces');
|
|
5
|
+
const consumes = mediaTypes(options, 'consumes');
|
|
6
|
+
return {
|
|
7
|
+
...(produces.length === 0 ? {} : { produces }),
|
|
8
|
+
...(consumes.length === 0 ? {} : { consumes }),
|
|
9
|
+
...(/(?:^|[\n,{])\s*form\s*[,:}\n]/.test(options) ? { form: `GET /forms/${operationId}` } : {}),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function mediaTypes(options, key) {
|
|
13
|
+
return listedIn(options, key).map((entry) => entry.replace(/^['"]|['"]$/g, ''));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=presentation-of-route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation-of-route.js","sourceRoot":"","sources":["../../src/describe/presentation-of-route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,uIAAuI;AACvI,MAAM,UAAU,mBAAmB,CACjC,OAAe,EACf,WAAmB;IAEnB,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAEjD,OAAO;QACL,GAAG,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC9C,GAAG,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC9C,GAAG,CAAC,+BAA+B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChG,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,OAAe,EAAE,GAAW;IAC9C,OAAO,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-controllers.d.ts","sourceRoot":"","sources":["../../src/describe/read-controllers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,SAAS,EAAiB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"read-controllers.d.ts","sourceRoot":"","sources":["../../src/describe/read-controllers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,SAAS,EAAiB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAwB3D,mHAAmH;AACnH,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,SAAS,EAAE,CActG"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { filesUnder } from '../generate/files-under.js';
|
|
2
2
|
import { decoratorOptions } from './decorator-options.js';
|
|
3
3
|
import { listedIn } from './listed-in.js';
|
|
4
|
+
import { presentationOfRoute } from './presentation-of-route.js';
|
|
4
5
|
import { readRouteGroups } from './read-route-groups.js';
|
|
5
6
|
const FOLDER = 'presentation/http';
|
|
6
7
|
const PARTS = ['params', 'query', 'headers', 'body'];
|
|
@@ -29,10 +30,11 @@ function routeOf(read, groups, useCases) {
|
|
|
29
30
|
const guards = [...group.guards, ...listedIn(options, 'guards')];
|
|
30
31
|
const { kind, useCase } = sentBy(read);
|
|
31
32
|
const sent = useCases.find((candidate) => candidate.kind === kind && candidate.name === useCase);
|
|
33
|
+
const operationId = field(options, 'operationId') || operationIdOf(source);
|
|
32
34
|
return {
|
|
33
35
|
method: field(options, 'method'),
|
|
34
36
|
path: pathOf(field(options, 'path'), group.prefix),
|
|
35
|
-
operationId
|
|
37
|
+
operationId,
|
|
36
38
|
group: group.name,
|
|
37
39
|
guards,
|
|
38
40
|
useCase,
|
|
@@ -40,6 +42,7 @@ function routeOf(read, groups, useCases) {
|
|
|
40
42
|
request: requestOf(source, options),
|
|
41
43
|
responses: responsesOf(source, options),
|
|
42
44
|
errors: errorsOf(options, group, guards),
|
|
45
|
+
...presentationOfRoute(options, operationId),
|
|
43
46
|
file,
|
|
44
47
|
};
|
|
45
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-controllers.js","sourceRoot":"","sources":["../../src/describe/read-controllers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,MAAM,MAAM,GAAG,mBAAmB,CAAC;AACnC,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAErD,qEAAqE;AACrE,MAAM,YAAY,GAAgD;IAChE,aAAa,EAAE,CAAC,cAAc,CAAC;IAC/B,OAAO,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC;CACvC,CAAC;AAUF,mHAAmH;AACnH,MAAM,UAAU,eAAe,CAAC,OAAuB,EAAE,QAAgC;IACvF,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAE9C,OAAO,UAAU,CAAC,EAAE,EAAE,GAAG,SAAS,IAAI,MAAM,EAAE,CAAC;SAC5C,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;SACjD,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,MAAM,IAAI,GAA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AAED,6FAA6F;AAC7F,SAAS,UAAU,CAAC,MAAc,EAAE,OAAe;IACjD,MAAM,IAAI,GAAG,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEzD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,WAAW,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;IAC/C,CAAC;IAED,MAAM,MAAM,GAAG,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAExD,OAAO,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,WAAW,OAAO,uBAAuB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;AAChH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-routes.d.ts","sourceRoot":"","sources":["../../src/describe/read-routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-routes.d.ts","sourceRoot":"","sources":["../../src/describe/read-routes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,SAAS,EAAiB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,SAAS,EAAE,CAajG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { presentationOfRoute } from './presentation-of-route.js';
|
|
1
2
|
import { readControllers } from './read-controllers.js';
|
|
2
3
|
const FOLDER = 'presentation/http';
|
|
3
4
|
/**
|
|
@@ -28,6 +29,7 @@ function routeOf(file, source, useCases) {
|
|
|
28
29
|
request: requestOf(source),
|
|
29
30
|
responses: responsesOf(source),
|
|
30
31
|
errors: [...(/\berrors:\s*\[([^\]]*)\]/.exec(source)?.[1] ?? '').matchAll(/'([^']+)'/g)].map((match) => match[1] ?? ''),
|
|
32
|
+
...presentationOfRoute(source, field('operationId')),
|
|
31
33
|
file,
|
|
32
34
|
};
|
|
33
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-routes.js","sourceRoot":"","sources":["../../src/describe/read-routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-routes.js","sourceRoot":"","sources":["../../src/describe/read-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,MAAM,GAAG,mBAAmB,CAAC;AAEnC;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,OAAuB,EAAE,QAAgC;IAClF,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAElC,MAAM,SAAS,GAAG,EAAE;SACjB,IAAI,CAAC,GAAG,SAAS,IAAI,MAAM,EAAE,CAAC;SAC9B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;SAC5C,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,OAAO,CAAC,GAAG,SAAS,IAAI,MAAM,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,SAAS,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,CACrG,CAAC;IAEJ,OAAO,CAAC,GAAG,SAAS,EAAE,GAAG,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAC/D,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAA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AC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;IAClG,CAAC,CAAC,CAAC;AACL,CAAC;AAED,0HAA0H;AAC1H,SAAS,UAAU,CAAC,MAAc,EAAE,OAAe;IACjD,MAAM,IAAI,GAAG,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE1D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,WAAW,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;IAC/C,CAAC;IAED,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,WAAW,OAAO,uBAAuB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;AACtG,CAAC"}
|
package/dist/generate/kind.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export interface KindFlags {
|
|
|
6
6
|
readonly upstream: readonly string[];
|
|
7
7
|
/** `<Term>=<meaning>` rows to add to the glossary of the context. */
|
|
8
8
|
readonly term: readonly string[];
|
|
9
|
+
/** `generate context --preset <name>`: the context is written whole from that preset. */
|
|
10
|
+
readonly preset?: string;
|
|
9
11
|
/** The values of a closed vocabulary, one per `--value`. */
|
|
10
12
|
readonly value: readonly string[];
|
|
11
13
|
/** The transitions of a state machine, one per `--transition "<intention>:<from>[,<from>]...[><to>]"`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kind.d.ts","sourceRoot":"","sources":["../../src/generate/kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,CA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1B,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2CAA2C;IAC3C,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,2GAA2G;IAC3G,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,8KAA8K;IAC9K,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,+GAA+G;IAC/G,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/context-kind.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"context-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/context-kind.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAMvC,eAAO,MAAM,WAAW,EAAE,IAyBzB,CAAC"}
|
|
@@ -2,22 +2,29 @@ import { isOneOf, RELATIONSHIPS } from '../../config/index.js';
|
|
|
2
2
|
import { CliError } from '../../cli-error.js';
|
|
3
3
|
import { parseContextName } from '../../naming/index.js';
|
|
4
4
|
import { parseTerms } from '../parse-terms.js';
|
|
5
|
+
import { applyPreset } from '../../presets/apply-preset.js';
|
|
6
|
+
import { presetNamed } from '../../presets/preset-named.js';
|
|
5
7
|
import { generateContext } from './generate-context.js';
|
|
6
8
|
export const contextKind = {
|
|
7
9
|
name: 'context',
|
|
8
10
|
aliases: [],
|
|
9
|
-
usage: 'context <name> --classification <core|supporting|generic> [--purpose "<two sentences>"] [--term "<Term>=<meaning>"]... [--upstream <ctx>[:relationship]]...',
|
|
10
|
-
summary: 'A bounded context: CONTEXT.md with its glossary, published language, config entry, and what assembles it (its declarations, or its module file).',
|
|
11
|
+
usage: 'context <name> --classification <core|supporting|generic> [--purpose "<two sentences>"] [--term "<Term>=<meaning>"]... [--upstream <ctx>[:relationship]]... [--preset identity]',
|
|
12
|
+
summary: 'A bounded context: CONTEXT.md with its glossary, published language, config entry, and what assembles it (its declarations, or its module file); with --preset, written whole from a preset of the kit.',
|
|
11
13
|
positionals: ['name'],
|
|
12
14
|
writesShared: true,
|
|
13
15
|
run: ({ ws, config, args, flags }) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const name = args[0] ?? '';
|
|
17
|
+
const preset = flags.preset === undefined ? undefined : presetNamed(flags.preset);
|
|
18
|
+
const declared = generateContext(ws, config, {
|
|
19
|
+
name,
|
|
20
|
+
classification: flags.classification ?? preset?.classification,
|
|
17
21
|
upstreams: flags.upstream.map(parseUpstreamFlag),
|
|
18
|
-
purpose: flags.purpose,
|
|
22
|
+
purpose: flags.purpose ?? preset?.purpose,
|
|
19
23
|
terms: parseTerms(flags.term),
|
|
20
24
|
});
|
|
25
|
+
if (preset !== undefined) {
|
|
26
|
+
applyPreset(ws, declared, { context: name, preset });
|
|
27
|
+
}
|
|
21
28
|
},
|
|
22
29
|
};
|
|
23
30
|
function parseUpstreamFlag(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/context-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAiB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,EAAE;IACX,KAAK,EACH,
|
|
1
|
+
{"version":3,"file":"context-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/context-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAiB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,EAAE;IACX,KAAK,EACH,iLAAiL;IACnL,OAAO,EACL,yMAAyM;IAC3M,WAAW,EAAE,CAAC,MAAM,CAAC;IACrB,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;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ings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAavC,eAAO,MAAM,QAAQ,EAAE,IAwCtB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CONFIG_FILE } from '../../config/index.js';
|
|
2
|
+
import { CliError } from '../../cli-error.js';
|
|
3
|
+
import { label } from '../label.js';
|
|
4
|
+
import { openScope } from '../open-scope.js';
|
|
5
|
+
import { controllerOf } from './presentation/controller-of.js';
|
|
6
|
+
import { controllerSource } from './presentation/controller-source.js';
|
|
7
|
+
const HINTS = `/** How the body of the route is entered, served as a form at GET /forms/<operationId> for the caller who asks. */
|
|
8
|
+
const form = defineForm<Infer<typeof body>>({
|
|
9
|
+
// TODO(domain): name the permission of the use case as its @Requires does (requires: { permission, subject, context }), so that only who may run it reads the form.
|
|
10
|
+
// TODO(domain): group the fields (groups), and say per field what the schema cannot: its widget, the GET route its options come from (lookup), when it shows (visibleWhen) and when it is required (requiredWhen).
|
|
11
|
+
});
|
|
12
|
+
`;
|
|
13
|
+
export const formKind = {
|
|
14
|
+
name: 'form',
|
|
15
|
+
aliases: [],
|
|
16
|
+
usage: 'form <context> <UseCase>',
|
|
17
|
+
summary: 'The form of a controller that receives a body: `defineForm` hints next to its schemas, named in `@Controller` as `form`, served at GET /forms/<operationId> when "stack.forms" is "on". Fields, constraints and options come from the body schema, read-only and hidden fields from its field access.',
|
|
18
|
+
positionals: ['context', 'UseCase'],
|
|
19
|
+
writesShared: false,
|
|
20
|
+
run: (request) => {
|
|
21
|
+
const scope = openScope(request);
|
|
22
|
+
const useCase = label(scope, request.args[1] ?? '', { what: 'use case', strip: ['controller'] });
|
|
23
|
+
const { file, source } = controllerOf(scope, useCase);
|
|
24
|
+
if (!/^\s*body[,:]/m.test(source)) {
|
|
25
|
+
throw new CliError(`${useCase.pascal}Controller receives no body.`, 'A form describes the body of a route: give the controller a body schema first.');
|
|
26
|
+
}
|
|
27
|
+
if (/\bconst form = defineForm\b/.test(source)) {
|
|
28
|
+
throw new CliError(`${useCase.pascal}Controller already declares its form.`, 'Edit its hints in the controller.');
|
|
29
|
+
}
|
|
30
|
+
const hinted = controllerSource.withOption(controllerSource.beforeController(source, HINTS), 'form,');
|
|
31
|
+
const imported = controllerSource.withImport(controllerSource.withImport(hinted, 'defineForm', '@ddd-ts-kit/http'), 'type Infer', '@ddd-ts-kit/validation');
|
|
32
|
+
scope.ws.update(file, imported);
|
|
33
|
+
if (scope.config.stack.forms !== 'on') {
|
|
34
|
+
scope.ws.note(`The form is served once "stack.forms" is "on" in ${CONFIG_FILE}: run \`ddd-ts-kit init --force --forms on\`.`);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=form-kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/form-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAEvE,MAAM,KAAK,GAAG;;;;;CAKb,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAS;IAC5B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,0BAA0B;IACjC,OAAO,EACL,uSAAuS;IACzS,WAAW,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;IACnC,YAAY,EAAE,KAAK;IACnB,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE;QACf,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,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|
|
2
|
+
/** The number the next decision record of the project takes: one after the highest in `docs/adr/`. */
|
|
3
|
+
export declare function nextAdrNumber(ws: Workspace): string;
|
|
4
|
+
//# sourceMappingURL=next-adr-number.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-adr-number.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/next-adr-number.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE1D,sGAAsG;AACtG,wBAAgB,aAAa,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,CAInD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ADR_DIRECTORY } from '../../check/governance/adr-directory.js';
|
|
2
|
+
/** The number the next decision record of the project takes: one after the highest in `docs/adr/`. */
|
|
3
|
+
export function nextAdrNumber(ws) {
|
|
4
|
+
const taken = ws.list(ADR_DIRECTORY).map((file) => Number(/^(\d+)-/.exec(file)?.[1] ?? '0'));
|
|
5
|
+
return String(Math.max(0, ...taken) + 1).padStart(4, '0');
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=next-adr-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-adr-number.js","sourceRoot":"","sources":["../../../src/generate/kinds/next-adr-number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAGxE,sGAAsG;AACtG,MAAM,UAAU,aAAa,CAAC,EAAa;IACzC,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IAE7F,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Name } from '../../../naming/index.js';
|
|
2
|
+
import type { Scope } from '../../scope.js';
|
|
3
|
+
/** A controller of the context, found by its use case, with its source as it stands. */
|
|
4
|
+
export interface FoundController {
|
|
5
|
+
readonly file: string;
|
|
6
|
+
readonly source: string;
|
|
7
|
+
}
|
|
8
|
+
/** The controller of a use case, wherever its resource folder is under presentation/http/. */
|
|
9
|
+
export declare function controllerOf(scope: Scope, useCase: Name): FoundController;
|
|
10
|
+
//# sourceMappingURL=controller-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller-of.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/presentation/controller-of.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,wFAAwF;AACxF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,GAAG,eAAe,CAiBzE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CliError } from '../../../cli-error.js';
|
|
2
|
+
import { filesUnder } from '../../files-under.js';
|
|
3
|
+
/** The controller of a use case, wherever its resource folder is under presentation/http/. */
|
|
4
|
+
export function controllerOf(scope, useCase) {
|
|
5
|
+
const http = `${scope.dir}/presentation/http`;
|
|
6
|
+
const found = filesUnder(scope.ws, http).find((file) => file.endsWith(`/${useCase.kebab}/${useCase.kebab}.controller.ts`));
|
|
7
|
+
const source = found === undefined ? undefined : scope.ws.read(`${http}/${found}`);
|
|
8
|
+
if (found === undefined || source === undefined || !source.includes('@Controller(')) {
|
|
9
|
+
throw new CliError(`The context ${scope.context.kebab} has no controller for ${useCase.title}.`, `Write it first: \`ddd-ts-kit generate controller ${scope.context.kebab} ${useCase.pascal}\`; a function route declares \`produces\` and \`form\` in its \`defineRoute\` spec by hand.`);
|
|
10
|
+
}
|
|
11
|
+
return { file: `${http}/${found}`, source };
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=controller-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller-of.js","sourceRoot":"","sources":["../../../../src/generate/kinds/presentation/controller-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AASlD,8FAA8F;AAC9F,MAAM,UAAU,YAAY,CAAC,KAAY,EAAE,OAAa;IACtD,MAAM,IAAI,GAAG,GAAG,KAAK,CAAC,GAAG,oBAAoB,CAAC;IAE9C,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACrD,IAAI,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,gBAAgB,CAAC,CAClE,CAAC;IAEF,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC;IAEnF,IAAI,KAAK,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;QACpF,MAAM,IAAI,QAAQ,CAChB,eAAe,KAAK,CAAC,OAAO,CAAC,KAAK,0BAA0B,OAAO,CAAC,KAAK,GAAG,EAC5E,oDAAoD,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,8FAA8F,CACxL,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,IAAI,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edits of the source of a controller written by the generator, which keep its shape: one more
|
|
3
|
+
* name in an import, one more option of `@Controller`, a declaration before the class.
|
|
4
|
+
*/
|
|
5
|
+
export declare const controllerSource: {
|
|
6
|
+
/** Adds `name` (`type Name` for a type) to the import of `module`, or a new import line after the last one. */
|
|
7
|
+
withImport(source: string, name: string, module: string): string;
|
|
8
|
+
/** Adds an option line to `@Controller({ ... })`, after its `summary`, with its indentation. */
|
|
9
|
+
withOption(source: string, line: string): string;
|
|
10
|
+
/** Puts a declaration right before the decorator of the class. */
|
|
11
|
+
beforeController(source: string, declaration: string): string;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=controller-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller-source.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/presentation/controller-source.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;IAC3B,+GAA+G;IAC/G,UAAU,SAAS,MAAM,QAAQ,MAAM,UAAU,MAAM,GAAG,MAAM;IAoChE,gGAAgG;IAChG,UAAU,SAAS,MAAM,QAAQ,MAAM,GAAG,MAAM;IAYhD,kEAAkE;IAClE,gBAAgB,SAAS,MAAM,eAAe,MAAM,GAAG,MAAM;CAK9D,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edits of the source of a controller written by the generator, which keep its shape: one more
|
|
3
|
+
* name in an import, one more option of `@Controller`, a declaration before the class.
|
|
4
|
+
*/
|
|
5
|
+
export const controllerSource = {
|
|
6
|
+
/** Adds `name` (`type Name` for a type) to the import of `module`, or a new import line after the last one. */
|
|
7
|
+
withImport(source, name, module) {
|
|
8
|
+
const written = new RegExp(String.raw `import\s*(type\s*)?\{([^}]*)\}\s*from\s*'${module.replaceAll('/', '\\/')}';`).exec(source);
|
|
9
|
+
if (written === null) {
|
|
10
|
+
const lastImport = [...source.matchAll(/^import .*;$/gm)].at(-1);
|
|
11
|
+
const at = lastImport === undefined ? 0 : lastImport.index + lastImport[0].length + 1;
|
|
12
|
+
const typeOnly = name.startsWith('type ') ? 'type ' : '';
|
|
13
|
+
return `${source.slice(0, at)}import ${typeOnly}{ ${name.replace(/^type\s+/, '')} } from '${module}';\n${source.slice(at)}`;
|
|
14
|
+
}
|
|
15
|
+
const names = (written[2] ?? '')
|
|
16
|
+
.split(',')
|
|
17
|
+
.map((part) => part.trim())
|
|
18
|
+
.filter((part) => part !== '');
|
|
19
|
+
const bare = name.replace(/^type\s+/, '');
|
|
20
|
+
if (names.some((part) => part.replace(/^type\s+/, '') === bare)) {
|
|
21
|
+
return source;
|
|
22
|
+
}
|
|
23
|
+
const typeOnly = written[1] !== undefined;
|
|
24
|
+
const added = typeOnly ? [...names, bare] : [...names, name];
|
|
25
|
+
const values = added.filter((part) => !part.startsWith('type ')).sort();
|
|
26
|
+
const types = added.filter((part) => part.startsWith('type ')).sort();
|
|
27
|
+
return source.replace(written[0], `import ${typeOnly ? 'type ' : ''}{ ${[...values, ...types].join(', ')} } from '${module}';`);
|
|
28
|
+
},
|
|
29
|
+
/** Adds an option line to `@Controller({ ... })`, after its `summary`, with its indentation. */
|
|
30
|
+
withOption(source, line) {
|
|
31
|
+
const summary = /^(\s*)summary:.*$/m.exec(source);
|
|
32
|
+
if (summary === null) {
|
|
33
|
+
return source;
|
|
34
|
+
}
|
|
35
|
+
const end = summary.index + summary[0].length;
|
|
36
|
+
return `${source.slice(0, end)}\n${summary[1] ?? ''}${line}${source.slice(end)}`;
|
|
37
|
+
},
|
|
38
|
+
/** Puts a declaration right before the decorator of the class. */
|
|
39
|
+
beforeController(source, declaration) {
|
|
40
|
+
const at = source.indexOf('@Controller(');
|
|
41
|
+
return `${source.slice(0, at)}${declaration}\n${source.slice(at)}`;
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=controller-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller-source.js","sourceRoot":"","sources":["../../../../src/generate/kinds/presentation/controller-source.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,+GAA+G;IAC/G,UAAU,CAAC,MAAc,EAAE,IAAY,EAAE,MAAc;QACrD,MAAM,OAAO,GAAG,IAAI,MAAM,CACxB,MAAM,CAAC,GAAG,CAAA,4CAA4C,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CACxF,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEf,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,MAAM,UAAU,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YACjE,MAAM,EAAE,GAAG,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;YAEtF,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YAEzD,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,QAAQ,KAAK,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,YAAY,MA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,CAAC,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,MAAM,IAAI,CAC7F,CAAC;IACJ,CAAC;IAED,gGAAgG;IAChG,UAAU,CAAC,MAAc,EAAE,IAAY;QACrC,MAAM,OAAO,GAAG,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAElD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAE9C,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;IACnF,CAAC;IAED,kEAAkE;IAClE,gBAAgB,CAAC,MAAc,EAAE,WAAmB;QAClD,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAE1C,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,WAAW,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IACrE,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"representation-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/representation-kind.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAUvC,eAAO,MAAM,kBAAkB,EAAE,IAkChC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CONFIG_FILE } from '../../config/index.js';
|
|
2
|
+
import { CliError } from '../../cli-error.js';
|
|
3
|
+
import { label } from '../label.js';
|
|
4
|
+
import { openScope } from '../open-scope.js';
|
|
5
|
+
import { controllerOf } from './presentation/controller-of.js';
|
|
6
|
+
import { controllerSource } from './presentation/controller-source.js';
|
|
7
|
+
const SHORT_NAMES = { xml: 'application/xml', csv: 'text/csv' };
|
|
8
|
+
const XML = 'application/xml';
|
|
9
|
+
const CSV = 'text/csv';
|
|
10
|
+
export const representationKind = {
|
|
11
|
+
name: 'representation',
|
|
12
|
+
aliases: [],
|
|
13
|
+
usage: 'representation <context> <UseCase> <xml|csv|media/type>[,...]',
|
|
14
|
+
summary: 'Makes a controller answer in more media types than JSON: `produces` in `@Controller`, and `consumes` of XML for a route that receives a body. The request chooses by its Accept header when "stack.representations" is "negotiated"; the contract lists every media type.',
|
|
15
|
+
positionals: ['context', 'UseCase', 'media'],
|
|
16
|
+
writesShared: false,
|
|
17
|
+
run: (request) => {
|
|
18
|
+
const scope = openScope(request);
|
|
19
|
+
const useCase = label(scope, request.args[1] ?? '', { what: 'use case', strip: ['controller'] });
|
|
20
|
+
const media = mediaTypesOf(request.args[2] ?? '');
|
|
21
|
+
const { file, source } = controllerOf(scope, useCase);
|
|
22
|
+
if (/^\s*produces:/m.test(source)) {
|
|
23
|
+
throw new CliError(`${useCase.pascal}Controller already declares what it produces.`, 'Edit its `produces` in the controller.');
|
|
24
|
+
}
|
|
25
|
+
const receivesXml = media.includes(XML) && /^\s*body[,:]/m.test(source);
|
|
26
|
+
const produced = controllerSource.withOption(source, `produces: [${media.map((type) => `'${type}'`).join(', ')}],`);
|
|
27
|
+
scope.ws.update(file, receivesXml ? controllerSource.withOption(produced, `consumes: ['${XML}'],`) : produced);
|
|
28
|
+
if (receivesXml) {
|
|
29
|
+
scope.ws.note(`The route now also reads its body in XML (\`consumes: ['${XML}']\`), and answers 415 to another media type: remove \`consumes\` from @Controller if only the answer was to be XML.`);
|
|
30
|
+
}
|
|
31
|
+
tellWhatIsLeft(scope, { media, source });
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
function mediaTypesOf(written) {
|
|
35
|
+
const media = written
|
|
36
|
+
.split(',')
|
|
37
|
+
.map((part) => part.trim())
|
|
38
|
+
.filter((part) => part !== '')
|
|
39
|
+
.map((part) => (Object.hasOwn(SHORT_NAMES, part) ? (SHORT_NAMES[part] ?? part) : part));
|
|
40
|
+
const invalid = media.find((type) => !/^[a-z]+\/[a-z0-9.+-]+$/.test(type) || type === 'application/json');
|
|
41
|
+
if (media.length === 0 || invalid !== undefined) {
|
|
42
|
+
throw new CliError(`"${written}" names no media type besides JSON.`, 'Name xml, csv or a media type such as application/xml, comma-separated: JSON is always answered.');
|
|
43
|
+
}
|
|
44
|
+
return [...new Set(media)];
|
|
45
|
+
}
|
|
46
|
+
function tellWhatIsLeft(scope, { media, source }) {
|
|
47
|
+
if (media.includes(CSV) && !/\b(?:pageSchemaOf|streamSchemaOf)\(/.test(source)) {
|
|
48
|
+
scope.ws.note('CSV writes a list of flat rows: answer a page (pageSchemaOf) or a streamed list (streamSchemaOf) of an item whose fields are scalars, or the routes are refused when they are mounted.');
|
|
49
|
+
}
|
|
50
|
+
if (scope.config.stack.representations !== 'negotiated') {
|
|
51
|
+
scope.ws.note(`The route answers JSON only until "stack.representations" is "negotiated" in ${CONFIG_FILE}: run \`ddd-ts-kit init --force --representations negotiated\`.`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=representation-kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"representation-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/representation-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,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AAM,IAAI,QAAQ,CAChB,IAAI,OAAO,qCAAqC,EAChD,kGAAkG,CACnG,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,cAAc,CACrB,KAAmC,EACnC,EAAE,KAAK,EAAE,MAAM,EAAgD;IAE/D,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,qCAAqC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/E,KAAK,CAAC,EAAE,CAAC,IAAI,CACX,wLAAwL,CACzL,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,KAAK,YAAY,EAAE,CAAC;QACxD,KAAK,CAAC,EAAE,CAAC,IAAI,CACX,gFAAgF,WAAW,iEAAiE,CAC7J,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { CliError } from '../../cli-error.js';
|
|
2
2
|
import { toName } from '../../naming/index.js';
|
|
3
3
|
import { renderTemplate } from '../../templating/index.js';
|
|
4
|
-
|
|
4
|
+
import { ADR_DIRECTORY } from '../../check/governance/adr-directory.js';
|
|
5
|
+
import { nextAdrNumber } from './next-adr-number.js';
|
|
5
6
|
/** Writes the record under the next free number and answers that number. */
|
|
6
7
|
export function writeAdr(ws, request) {
|
|
7
8
|
const slug = toName(request.title).kebab;
|
|
8
9
|
if (slug === '') {
|
|
9
10
|
throw new CliError('A decision record needs a title.', 'Pass it as the first argument, for example: ddd-ts-kit generate adr "Read the catalog without a gateway".');
|
|
10
11
|
}
|
|
11
|
-
const number =
|
|
12
|
+
const number = nextAdrNumber(ws);
|
|
12
13
|
const { deviation } = request;
|
|
13
14
|
const adr = {
|
|
14
15
|
number,
|
|
@@ -21,10 +22,6 @@ export function writeAdr(ws, request) {
|
|
|
21
22
|
ws.create(`${ADR_DIRECTORY}/${number}-${slug}.md`, renderTemplate('adr/adr.md.tpl', { adr }));
|
|
22
23
|
return number;
|
|
23
24
|
}
|
|
24
|
-
function nextNumber(ws) {
|
|
25
|
-
const taken = ws.list(ADR_DIRECTORY).map((file) => Number(/^(\d+)-/.exec(file)?.[1] ?? '0'));
|
|
26
|
-
return String(Math.max(0, ...taken) + 1).padStart(4, '0');
|
|
27
|
-
}
|
|
28
25
|
function today() {
|
|
29
26
|
return new Date().toISOString().slice(0, 10);
|
|
30
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-adr.js","sourceRoot":"","sources":["../../../src/generate/kinds/write-adr.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"write-adr.js","sourceRoot":"","sources":["../../../src/generate/kinds/write-adr.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAQrD,4EAA4E;AAC5E,MAAM,UAAU,QAAQ,CAAC,EAAa,EAAE,OAAmB;IACzD,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;IAEzC,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,QAAQ,CAChB,kCAAkC,EAClC,2GAA2G,CAC5G,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IACjC,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAE9B,MAAM,GAAG,GAAG;QACV,MAAM;QACN,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,IAAI,EAAE,KAAK,EAAE;QACb,SAAS,EAAE,SAAS,KAAK,SAAS;QAClC,IAAI,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE;QAC3B,MAAM,EAAE,SAAS,EAAE,MAAM,IAAI,EAAE;KAChC,CAAC;IAEF,EAAE,CAAC,MAAM,CAAC,GAAG,aAAa,IAAI,MAAM,IAAI,IAAI,KAAK,EAAE,cAAc,CAAC,gBAAgB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAE9F,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,KAAK;IACZ,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../../src/generate/kinds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../../src/generate/kinds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAuCtC,qEAAqE;AACrE,eAAO,MAAM,KAAK,EAAE,SAAS,IAAI,EAuChC,CAAC"}
|
package/dist/generate/kinds.js
CHANGED
|
@@ -15,6 +15,7 @@ import { entityKind } from './kinds/entity-kind.js';
|
|
|
15
15
|
import { eventHandlerKind } from './kinds/event-handler-kind.js';
|
|
16
16
|
import { fileUploadKind } from './kinds/file-upload-kind.js';
|
|
17
17
|
import { gatewayKind } from './kinds/gateway-kind.js';
|
|
18
|
+
import { formKind } from './kinds/form-kind.js';
|
|
18
19
|
import { guardKind } from './kinds/guard-kind.js';
|
|
19
20
|
import { integrationEventKind } from './kinds/integration-event-kind.js';
|
|
20
21
|
import { integrationHandlerKind } from './kinds/integration-handler-kind.js';
|
|
@@ -25,6 +26,7 @@ import { processKind } from './kinds/process-kind.js';
|
|
|
25
26
|
import { projectionKind } from './kinds/projection-kind.js';
|
|
26
27
|
import { queryKind } from './kinds/query-kind.js';
|
|
27
28
|
import { repositoryKind } from './kinds/repository-kind.js';
|
|
29
|
+
import { representationKind } from './kinds/representation-kind.js';
|
|
28
30
|
import { routeGroupKind } from './kinds/route-group-kind.js';
|
|
29
31
|
import { controllerKind, routeKind } from './kinds/route-kind.js';
|
|
30
32
|
import { schemaKind } from './kinds/schema-kind.js';
|
|
@@ -55,6 +57,8 @@ export const KINDS = [
|
|
|
55
57
|
fileUploadKind,
|
|
56
58
|
routeGroupKind,
|
|
57
59
|
guardKind,
|
|
60
|
+
representationKind,
|
|
61
|
+
formKind,
|
|
58
62
|
schemaKind,
|
|
59
63
|
integrationEventKind,
|
|
60
64
|
integrationHandlerKind,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kinds.js","sourceRoot":"","sources":["../../src/generate/kinds.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D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,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,qEAAqE;AACrE,MAAM,CAAC,MAAM,KAAK,GAAoB;IACpC,WAAW;IACX,aAAa;IACb,WAAW;IACX,UAAU;IACV,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,eAAe;IACf,SAAS;IACT,eAAe;IACf,iBAAiB;IACjB,cAAc;IACd,WAAW;IACX,SAAS;IACT,QAAQ;IACR,SAAS;IACT,cAAc;IACd,cAAc;IACd,cAAc;IACd,SAAS;IACT,kBAAkB;IAClB,QAAQ;IACR,UAAU;IACV,oBAAoB;IACpB,sBAAsB;IACtB,gBAAgB;IAChB,cAAc;IACd,OAAO;IACP,iBAAiB;IACjB,WAAW;IACX,OAAO;IACP,OAAO;IACP,UAAU;IACV,WAAW;IACX,WAAW;IACX,WAAW;IACX,UAAU;IACV,OAAO;CACR,CAAC"}
|
package/dist/help/usage.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Every command of the CLI and its flags, as `--help` prints them and docs/guides/commands.md shows them. */
|
|
2
|
-
export declare const USAGE = "Usage\n ddd-ts-kit init [--http express|fastify|hono|nest|none]\n [--validation zod|class-validator|typebox|standard-schema|none]\n [--di tsyringe|nest|manual] [--tests vitest|jest]\n [--orm drizzle|knex|prisma|typeorm|custom|none] [--database postgres|mysql|sqlite|none]\n [--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]\n [--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]\n [--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]\n [--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis] [--http-cache none|varnish]\n [--storage local|s3|none]\n [--audit on|off]\n [--errors none|sentry] [--logger stdout|pino|winston] [--style declared|explicit] [--assembly barrel|discovery]\n [--dependencies signature|listed] [--refusals factories|classes]\n [--routes controllers|functions] [--value-objects throwing|result] [--literals named|free] [--tenancy none|shared-table] [--queue database|redis|memory]\n [--schemas shared|per-route]\n [--package-manager npm|pnpm] [--allow-no-outbox \"<reason>\"] [--import-alias '$<name>/']\n [--import-extension none|js] [--sdk]\n [--context <name>:<core|supporting|generic>]... [--dry-run] [--force]\n ddd-ts-kit generate <kind> ... [--term \"<Term>=<meaning>\"]... [--allow-name] [--local-only] [--dry-run] [--force] (alias: g)\n ddd-ts-kit generate --help --json\n ddd-ts-kit list [--context <name>]\n ddd-ts-kit describe <context>\n ddd-ts-kit status\n ddd-ts-kit todo [<context>]\n ddd-ts-kit worker-scope <context> [--worktree <path>] [--branch <name>] [--dry-run]\n ddd-ts-kit docs [--check] [--stored-events]\n ddd-ts-kit sdk [--check] [--dry-run]\n ddd-ts-kit depcruise-config [--check|--write]\n ddd-ts-kit build-aliases [--project <tsconfig>]\n ddd-ts-kit error-factories --plan | --apply [--dry-run]\n ddd-ts-kit controllers [<context>] [--dry-run]\n ddd-ts-kit value-objects [--dry-run]\n ddd-ts-kit affected [--base <git-ref>] [--head <git-ref>] [--format text|json|github|env]\n ddd-ts-kit check [paths...] [--rule <id>]... [--format text|json|github|gitlab] [--changed-since <git-ref>] [--self]\n ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|github]\n ddd-ts-kit check --commit-size [--staged] [--strict]\n ddd-ts-kit check-file <path>\n ddd-ts-kit rules\n ddd-ts-kit explain <rule-id>\n\nEvery command accepts --json (machine-readable output) and --cwd <dir> (project root).";
|
|
2
|
+
export declare const USAGE = "Usage\n ddd-ts-kit init [--http express|fastify|hono|nest|none]\n [--validation zod|class-validator|typebox|standard-schema|none]\n [--di tsyringe|nest|manual] [--tests vitest|jest]\n [--orm drizzle|knex|prisma|typeorm|custom|none] [--database postgres|mysql|sqlite|none]\n [--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]\n [--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]\n [--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]\n [--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis] [--http-cache none|varnish]\n [--storage local|s3|none]\n [--audit on|off]\n [--errors none|sentry] [--logger stdout|pino|winston] [--style declared|explicit] [--assembly barrel|discovery]\n [--dependencies signature|listed] [--refusals factories|classes]\n [--routes controllers|functions] [--representations negotiated|json] [--forms on|off]\n [--value-objects throwing|result] [--literals named|free] [--tenancy none|shared-table] [--queue database|redis|memory]\n [--schemas shared|per-route]\n [--package-manager npm|pnpm] [--allow-no-outbox \"<reason>\"] [--import-alias '$<name>/']\n [--import-extension none|js] [--sdk]\n [--context <name>:<core|supporting|generic>]... [--preset identity]... [--dry-run] [--force]\n ddd-ts-kit generate <kind> ... [--term \"<Term>=<meaning>\"]... [--allow-name] [--local-only] [--dry-run] [--force] (alias: g)\n ddd-ts-kit generate --help --json\n ddd-ts-kit list [--context <name>]\n ddd-ts-kit describe <context>\n ddd-ts-kit status\n ddd-ts-kit todo [<context>]\n ddd-ts-kit worker-scope <context> [--worktree <path>] [--branch <name>] [--dry-run]\n ddd-ts-kit docs [--check] [--stored-events]\n ddd-ts-kit sdk [--check] [--dry-run]\n ddd-ts-kit depcruise-config [--check|--write]\n ddd-ts-kit build-aliases [--project <tsconfig>]\n ddd-ts-kit error-factories --plan | --apply [--dry-run]\n ddd-ts-kit controllers [<context>] [--dry-run]\n ddd-ts-kit value-objects [--dry-run]\n ddd-ts-kit affected [--base <git-ref>] [--head <git-ref>] [--format text|json|github|env]\n ddd-ts-kit check [paths...] [--rule <id>]... [--format text|json|github|gitlab] [--changed-since <git-ref>] [--self]\n ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|github]\n ddd-ts-kit check --commit-size [--staged] [--strict]\n ddd-ts-kit check-file <path>\n ddd-ts-kit rules\n ddd-ts-kit explain <rule-id>\n\nEvery command accepts --json (machine-readable output) and --cwd <dir> (project root).";
|
|
3
3
|
//# sourceMappingURL=usage.d.ts.map
|
package/dist/help/usage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,eAAO,MAAM,KAAK,mvFAyCqE,CAAC"}
|
package/dist/help/usage.js
CHANGED
|
@@ -12,11 +12,12 @@ export const USAGE = `Usage
|
|
|
12
12
|
[--audit on|off]
|
|
13
13
|
[--errors none|sentry] [--logger stdout|pino|winston] [--style declared|explicit] [--assembly barrel|discovery]
|
|
14
14
|
[--dependencies signature|listed] [--refusals factories|classes]
|
|
15
|
-
[--routes controllers|functions] [--
|
|
15
|
+
[--routes controllers|functions] [--representations negotiated|json] [--forms on|off]
|
|
16
|
+
[--value-objects throwing|result] [--literals named|free] [--tenancy none|shared-table] [--queue database|redis|memory]
|
|
16
17
|
[--schemas shared|per-route]
|
|
17
18
|
[--package-manager npm|pnpm] [--allow-no-outbox "<reason>"] [--import-alias '$<name>/']
|
|
18
19
|
[--import-extension none|js] [--sdk]
|
|
19
|
-
[--context <name>:<core|supporting|generic>]... [--dry-run] [--force]
|
|
20
|
+
[--context <name>:<core|supporting|generic>]... [--preset identity]... [--dry-run] [--force]
|
|
20
21
|
ddd-ts-kit generate <kind> ... [--term "<Term>=<meaning>"]... [--allow-name] [--local-only] [--dry-run] [--force] (alias: g)
|
|
21
22
|
ddd-ts-kit generate --help --json
|
|
22
23
|
ddd-ts-kit list [--context <name>]
|