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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/workspace/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAG5E,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAQxC;;;;;GAKG;AACH,MAAM,OAAO,SAAS;IAUT,IAAI;IACI,KAAK;IAVf,KAAK,GAAa,EAAE,CAAC;IAEb,OAAO,GAAG,IAAI,GAAG,EAAmB,CAAC;IAErC,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAE5B,KAAK,GAAe,EAAE,CAAC;IAExC,YACW,IAAY,EACJ,KAAc;oBADtB,IAAI;qBACI,KAAK;IACrB,CAAC;IAEJ,MAA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BAC9D,MAAM,CAAC,MAAM,CAAC;iBACd,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,oEAAoE;YACpE,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,IAAY,EAAE,OAAe;QACzC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACrE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAEO,QAAQ,CAAC,IAAY;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;CACF;AAED,SAAS,cAAc,CAAC,IAAkB;IACxC,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,sCAAsC,CAAC,CAAC;AACtE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ddd-ts-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Bootstrap, scaffold and verify DDD and Clean Architecture TypeScript projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"clean:packages": "node dist/bin.js check --clean-only ../kernel/src ../validation/src ../http/src ../tracing/src ../di/src ../events/src ../testing/src ../s3/src ../drizzle/src ../knex/src ../prisma/src ../typeorm/src ../aspects/src ../rabbitmq/src ../auth/src ../audit/src ../redis/src ../scheduling/src ../pino/src ../winston/src ../sentry/src ../kafka/src ../nats/src ../eslint-plugin/src"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ddd-ts-kit/kernel": "^0.
|
|
32
|
+
"@ddd-ts-kit/kernel": "^0.15.0"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -262,6 +262,21 @@
|
|
|
262
262
|
"FORBIDDEN"
|
|
263
263
|
]
|
|
264
264
|
},
|
|
265
|
+
{{#if presentation.negotiated}}
|
|
266
|
+
"406": {
|
|
267
|
+
"description": "Not Acceptable. Error codes: NOT_ACCEPTABLE.",
|
|
268
|
+
"content": {
|
|
269
|
+
"application/problem+json": {
|
|
270
|
+
"schema": {
|
|
271
|
+
"$ref": "#/components/schemas/Problem"
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"x-error-codes": [
|
|
276
|
+
"NOT_ACCEPTABLE"
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
{{/if}}
|
|
265
280
|
"422": {
|
|
266
281
|
"description": "Unprocessable Content. Error codes: VALIDATION_FAILED.",
|
|
267
282
|
"content": {
|
|
@@ -8,7 +8,7 @@ A ddd-ts-kit project: one bounded context per directory of `{{config.contextsDir
|
|
|
8
8
|
- `npx ddd-ts-kit check --changed-since <ref>`: the architecture rules on what changed; `npx ddd-ts-kit explain <rule-id>` gives the reason and an example.
|
|
9
9
|
- `npx ddd-ts-kit list --json`: the map of the contexts. `npx ddd-ts-kit describe <context> --json`: one context as data (use cases, routes, events, ports, dependencies).
|
|
10
10
|
- `npx ddd-ts-kit status`: the next step of the plan, the slices by status, the markers left per context. `npx ddd-ts-kit todo [<context>]`: each remaining `TODO(domain)` and `it.todo` as `file:line`.
|
|
11
|
-
- `npx ddd-ts-kit docs`: regenerates the context map and the generated sections of each `CONTEXT.md`; `npm run docs:generate` the OpenAPI contract and the event catalog.
|
|
11
|
+
- `npx ddd-ts-kit docs`: regenerates the context map and the generated sections of each `CONTEXT.md`; `npm run docs:generate` the OpenAPI contract, the forms and the event catalog.
|
|
12
12
|
|
|
13
13
|
## Read less
|
|
14
14
|
|
|
@@ -29,7 +29,7 @@ Never edit `<context>.declarations.ts`: `generate`, `docs` and `npm run dev` rew
|
|
|
29
29
|
{{#if assembly.discovery}}
|
|
30
30
|
Never edit `<context>.dependencies.ts`: `generate`, `docs` and `npm run dev` rewrite it from the constructor signatures (it registers what each constructor is injected). After changing a constructor by hand, `npx ddd-ts-kit docs`.
|
|
31
31
|
{{/if}}
|
|
32
|
-
Never edit the contracts under `openapi/` (`openapi/openapi.yaml`, one file per document when `openapi.documents` splits it), `docs/integration/asyncapi.yaml`, `docs/integration/event-catalog.md`, `{{config.platformDir}}/http/openapi-documents.ts`, `.dependency-cruiser.cjs` or the generated sections of a `CONTEXT.md`: change the code or the config, then `npm run docs:generate`, `npx ddd-ts-kit docs` and `npx ddd-ts-kit depcruise-config --write`. `stored-events.lock.json` is written by `npx ddd-ts-kit docs --stored-events` once the shape of a version is final (`docs --check` fails while one is unrecorded), never by hand: a stored shape changes only by a new version with its upcaster (`event-sourcing/upcaster-required`).
|
|
32
|
+
Never edit the contracts under `openapi/` (`openapi/openapi.yaml`, one file per document when `openapi.documents` splits it, the forms of `openapi/forms/`), `docs/integration/asyncapi.yaml`, `docs/integration/event-catalog.md`, `{{config.platformDir}}/http/openapi-documents.ts`, `.dependency-cruiser.cjs` or the generated sections of a `CONTEXT.md`: change the code or the config, then `npm run docs:generate`, `npx ddd-ts-kit docs` and `npx ddd-ts-kit depcruise-config --write`. `stored-events.lock.json` is written by `npx ddd-ts-kit docs --stored-events` once the shape of a version is final (`docs --check` fails while one is unrecorded), never by hand: a stored shape changes only by a new version with its upcaster (`event-sourcing/upcaster-required`).
|
|
33
33
|
{{#if sdk.on}}
|
|
34
34
|
{{sdk.instruction}}
|
|
35
35
|
{{/if}}
|
|
@@ -45,9 +45,12 @@ import { multipartUploads } from '@ddd-ts-kit/http/uploads';
|
|
|
45
45
|
{{/if}}
|
|
46
46
|
import { tracedRoutes } from '@ddd-ts-kit/tracing';
|
|
47
47
|
import { principalOf } from '{{alias.platform}}/auth/principal-of{{alias.ext}}';
|
|
48
|
+
{{#if presentation.any}}
|
|
49
|
+
import type { Presentation } from '{{alias.platform}}/http/presentation-of{{alias.ext}}';
|
|
50
|
+
{{/if}}
|
|
48
51
|
|
|
49
52
|
/** What the HTTP adapter needs at the edge of the application: spread into its mount options, for every route. */
|
|
50
|
-
export interface HttpBoundary {
|
|
53
|
+
export interface HttpBoundary{{#if presentation.any}} extends Presentation{{/if}} {
|
|
51
54
|
readonly resolvePrincipal: (raw: unknown) => Promise<Session>;
|
|
52
55
|
/** Every handler runs inside it, with the correlation id, the actor and the session of its request. */
|
|
53
56
|
readonly executionScope: ExecutionScope;
|
|
@@ -92,21 +95,29 @@ interface Edge {
|
|
|
92
95
|
/** Where a request answered 5xx is reported, unless a bus already reported its failure. */
|
|
93
96
|
readonly errors: ErrorReporter;
|
|
94
97
|
{{/if}}
|
|
98
|
+
{{#if presentation.any}}
|
|
99
|
+
readonly presentation: Presentation;
|
|
100
|
+
{{/if}}
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
/** A request is authenticated once, then handled inside the execution scope, so infrastructure sees who acts and under which correlation. */
|
|
98
104
|
{{#if errors.none}}
|
|
99
|
-
{{#unless
|
|
105
|
+
{{#unless presentation.widensEdge}}
|
|
100
106
|
export function httpBoundary({ authenticator, executionScope, errorMapper, clock, logger }: Edge): HttpBoundary {
|
|
101
107
|
{{/unless}}
|
|
102
|
-
{{#if
|
|
108
|
+
{{#if presentation.widensEdge}}
|
|
103
109
|
export function httpBoundary({
|
|
104
110
|
authenticator,
|
|
105
111
|
executionScope,
|
|
106
112
|
errorMapper,
|
|
107
113
|
clock,
|
|
108
114
|
logger,
|
|
115
|
+
{{#if audit.on}}
|
|
109
116
|
refusals,
|
|
117
|
+
{{/if}}
|
|
118
|
+
{{#if presentation.any}}
|
|
119
|
+
presentation,
|
|
120
|
+
{{/if}}
|
|
110
121
|
}: Edge): HttpBoundary {
|
|
111
122
|
{{/if}}
|
|
112
123
|
{{/if}}
|
|
@@ -121,11 +132,17 @@ export function httpBoundary({
|
|
|
121
132
|
refusals,
|
|
122
133
|
{{/if}}
|
|
123
134
|
errors,
|
|
135
|
+
{{#if presentation.any}}
|
|
136
|
+
presentation,
|
|
137
|
+
{{/if}}
|
|
124
138
|
}: Edge): HttpBoundary {
|
|
125
139
|
const report = reportHttpErrors(errors);
|
|
126
140
|
|
|
127
141
|
{{/if}}
|
|
128
142
|
return {
|
|
143
|
+
{{#if presentation.any}}
|
|
144
|
+
...presentation,
|
|
145
|
+
{{/if}}
|
|
129
146
|
resolvePrincipal: principalOf(authenticator),
|
|
130
147
|
executionScope,
|
|
131
148
|
errorMapper,
|
|
@@ -26,6 +26,12 @@ import { auditModule } from '{{alias.platform}}/audit/audit.module{{alias.ext}}'
|
|
|
26
26
|
{{#if http.any}}
|
|
27
27
|
import { httpBoundary, type HttpBoundary } from '{{alias.platform}}/auth/http-boundary{{alias.ext}}';
|
|
28
28
|
{{/if}}
|
|
29
|
+
{{#if presentation.any}}
|
|
30
|
+
import { presentationOf } from '{{alias.platform}}/http/presentation-of{{alias.ext}}';
|
|
31
|
+
{{/if}}
|
|
32
|
+
{{#if presentation.forms}}
|
|
33
|
+
import { withForms } from '{{alias.platform}}/http/with-forms{{alias.ext}}';
|
|
34
|
+
{{/if}}
|
|
29
35
|
{{#if authz.rebac}}
|
|
30
36
|
import { relateSystemActors } from '{{alias.platform}}/auth/relate-system-actors{{alias.ext}}';
|
|
31
37
|
{{/if}}
|
|
@@ -123,10 +129,19 @@ export function composeApplication(
|
|
|
123
129
|
{{/unless}}
|
|
124
130
|
|
|
125
131
|
platform.protection.declare(contexts.flatMap((context) => context.useCases));
|
|
132
|
+
{{#if presentation.any}}
|
|
133
|
+
// What the server answers in and which fields each caller sees: the forms and the contract are given the same.
|
|
134
|
+
const presentation = presentationOf(platform.access, clock);
|
|
135
|
+
{{/if}}
|
|
126
136
|
|
|
127
137
|
return {
|
|
128
138
|
{{#if http.any}}
|
|
139
|
+
{{#if presentation.forms}}
|
|
140
|
+
routes: withForms(defineRoutes(...contexts.map((context) => context.routes)), presentation),
|
|
141
|
+
{{/if}}
|
|
142
|
+
{{#unless presentation.forms}}
|
|
129
143
|
routes: defineRoutes(...contexts.map((context) => context.routes)),
|
|
144
|
+
{{/unless}}
|
|
130
145
|
boundary: httpBoundary({
|
|
131
146
|
authenticator: options.authenticator,
|
|
132
147
|
executionScope: platform.scope,
|
|
@@ -138,6 +153,9 @@ export function composeApplication(
|
|
|
138
153
|
{{/if}}
|
|
139
154
|
{{#if errors.sentry}}
|
|
140
155
|
errors: platform.errors,
|
|
156
|
+
{{/if}}
|
|
157
|
+
{{#if presentation.any}}
|
|
158
|
+
presentation,
|
|
141
159
|
{{/if}}
|
|
142
160
|
}),
|
|
143
161
|
{{/if}}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { installAspectRuntime } from '@ddd-ts-kit/aspects';
|
|
2
2
|
{{#if http.any}}
|
|
3
|
+
{{#if presentation.any}}
|
|
4
|
+
import { Access, Authenticator } from '@ddd-ts-kit/auth';
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#unless presentation.any}}
|
|
3
7
|
import { Authenticator } from '@ddd-ts-kit/auth';
|
|
8
|
+
{{/unless}}
|
|
4
9
|
{{/if}}
|
|
5
10
|
import {
|
|
6
11
|
{{#if routes.declaredControllers}}
|
|
@@ -94,6 +99,12 @@ import { securitySchemes } from '{{alias.platform}}/auth/security-schemes{{alias
|
|
|
94
99
|
{{#if http.any}}
|
|
95
100
|
import { httpBoundary, type HttpBoundary } from '{{alias.platform}}/auth/http-boundary{{alias.ext}}';
|
|
96
101
|
{{/if}}
|
|
102
|
+
{{#if presentation.any}}
|
|
103
|
+
import { presentationOf } from '{{alias.platform}}/http/presentation-of{{alias.ext}}';
|
|
104
|
+
{{/if}}
|
|
105
|
+
{{#if presentation.forms}}
|
|
106
|
+
import { withForms } from '{{alias.platform}}/http/with-forms{{alias.ext}}';
|
|
107
|
+
{{/if}}
|
|
97
108
|
{{#if authz.rebac}}
|
|
98
109
|
import { relateSystemActors } from '{{alias.platform}}/auth/relate-system-actors{{alias.ext}}';
|
|
99
110
|
{{/if}}
|
|
@@ -271,10 +282,19 @@ function kernel(foundations: Foundations, persistence: Persistence, options: App
|
|
|
271
282
|
|
|
272
283
|
function running(container: Container, options: ApplicationOptions, contexts: ContextSelection): Application {
|
|
273
284
|
const logger = container.resolve(Logger);
|
|
285
|
+
{{#if presentation.any}}
|
|
286
|
+
// What the server answers in and which fields each caller sees: the forms and the contract are given the same.
|
|
287
|
+
const presentation = presentationOf(container.resolve(Access), container.resolve(Clock));
|
|
288
|
+
{{/if}}
|
|
274
289
|
|
|
275
290
|
return {
|
|
276
291
|
{{#if http.any}}
|
|
292
|
+
{{#if presentation.forms}}
|
|
293
|
+
routes: withForms(routesOf(container, contexts), presentation),
|
|
294
|
+
{{/if}}
|
|
295
|
+
{{#unless presentation.forms}}
|
|
277
296
|
routes: routesOf(container, contexts),
|
|
297
|
+
{{/unless}}
|
|
278
298
|
boundary: httpBoundary({
|
|
279
299
|
authenticator: container.resolve(Authenticator),
|
|
280
300
|
executionScope: container.resolve(ExecutionScope),
|
|
@@ -289,6 +309,9 @@ function running(container: Container, options: ApplicationOptions, contexts: Co
|
|
|
289
309
|
{{/if}}
|
|
290
310
|
{{#if errors.sentry}}
|
|
291
311
|
errors: container.resolve(ErrorReporter),
|
|
312
|
+
{{/if}}
|
|
313
|
+
{{#if presentation.any}}
|
|
314
|
+
presentation,
|
|
292
315
|
{{/if}}
|
|
293
316
|
}),
|
|
294
317
|
{{/if}}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Access } from '@ddd-ts-kit/auth';
|
|
2
|
+
{{#if presentation.negotiated}}
|
|
3
|
+
import { Representations, fieldDeciderOf, type FieldDecider } from '@ddd-ts-kit/http';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#unless presentation.negotiated}}
|
|
6
|
+
import { fieldDeciderOf, type FieldDecider } from '@ddd-ts-kit/http';
|
|
7
|
+
{{/unless}}
|
|
8
|
+
import type { Clock } from '@ddd-ts-kit/kernel';
|
|
9
|
+
|
|
10
|
+
/** How the answers of the application are presented, the same for the server, the forms and the contract. */
|
|
11
|
+
export interface Presentation {
|
|
12
|
+
{{#if presentation.negotiated}}
|
|
13
|
+
/** JSON, XML and CSV: each request is answered in the one its `Accept` header prefers among those its route declares in `produces`. */
|
|
14
|
+
readonly representations: Representations;
|
|
15
|
+
{{/if}}
|
|
16
|
+
/** Decides the fields a schema reserves to some callers (`withFieldAccess`), through the policies and the authorizer of the application. */
|
|
17
|
+
readonly fieldAccess: FieldDecider;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function presentationOf(access: Access, clock: Clock): Presentation {
|
|
21
|
+
return {
|
|
22
|
+
{{#if presentation.negotiated}}
|
|
23
|
+
representations: Representations.standard(),
|
|
24
|
+
{{/if}}
|
|
25
|
+
fieldAccess: fieldDeciderOf({ access, clock }),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -34,7 +34,7 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
|
|
|
34
34
|
{{/if}}
|
|
35
35
|
app.use(express.json());
|
|
36
36
|
{{#if docs.any}}
|
|
37
|
-
mountExpress(app, withDocumentation(served.routes, config), served.boundary);
|
|
37
|
+
mountExpress(app, withDocumentation(served.routes, config, served.boundary), served.boundary);
|
|
38
38
|
{{/if}}
|
|
39
39
|
{{#unless docs.any}}
|
|
40
40
|
mountExpress(app, served.routes, served.boundary);
|
|
@@ -29,7 +29,7 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
|
|
|
29
29
|
mountFastify(app, served.fileRoutes, served.boundary);
|
|
30
30
|
{{/if}}
|
|
31
31
|
{{#if docs.any}}
|
|
32
|
-
mountFastify(app, withDocumentation(served.routes, config), served.boundary);
|
|
32
|
+
mountFastify(app, withDocumentation(served.routes, config, served.boundary), served.boundary);
|
|
33
33
|
{{/if}}
|
|
34
34
|
{{#unless docs.any}}
|
|
35
35
|
mountFastify(app, served.routes, served.boundary);
|
|
@@ -31,7 +31,7 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
|
|
|
31
31
|
guardTheDoor(app, served, config);
|
|
32
32
|
{{/if}}
|
|
33
33
|
{{#if docs.any}}
|
|
34
|
-
mountHono(app, withDocumentation(served.routes, config), served.boundary);
|
|
34
|
+
mountHono(app, withDocumentation(served.routes, config, served.boundary), served.boundary);
|
|
35
35
|
{{/if}}
|
|
36
36
|
{{#unless docs.any}}
|
|
37
37
|
mountHono(app, served.routes, served.boundary);
|
|
@@ -38,7 +38,7 @@ interface Outgoing {
|
|
|
38
38
|
export async function startHttpServer(served: Served, config: AppConfig): Promise<HttpServer> {
|
|
39
39
|
{{#if files.http}}
|
|
40
40
|
{{#if docs.any}}
|
|
41
|
-
const routes = [...withDocumentation(served.routes, config), ...served.fileRoutes];
|
|
41
|
+
const routes = [...withDocumentation(served.routes, config, served.boundary), ...served.fileRoutes];
|
|
42
42
|
{{/if}}
|
|
43
43
|
{{#unless docs.any}}
|
|
44
44
|
const routes = [...served.routes, ...served.fileRoutes];
|
|
@@ -47,7 +47,7 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
|
|
|
47
47
|
{{/if}}
|
|
48
48
|
{{#unless files.http}}
|
|
49
49
|
{{#if docs.any}}
|
|
50
|
-
const app = await NestFactory.create(createAppModule(withDocumentation(served.routes, config), served.boundary), {
|
|
50
|
+
const app = await NestFactory.create(createAppModule(withDocumentation(served.routes, config, served.boundary), served.boundary), {
|
|
51
51
|
logger: ['error', 'warn'],
|
|
52
52
|
});
|
|
53
53
|
{{/if}}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import type { Route } from '@ddd-ts-kit/http';
|
|
1
|
+
import type { ExecuteOptions, Route } from '@ddd-ts-kit/http';
|
|
2
2
|
import { openApiDocumentsRoutes } from '@ddd-ts-kit/http/docs';
|
|
3
3
|
import { generateOpenApi, routesByDocument } from '@ddd-ts-kit/http/openapi';
|
|
4
4
|
import { securitySchemes } from '{{alias.platform}}/auth/security-schemes{{alias.ext}}';
|
|
5
5
|
import type { AppConfig } from '{{alias.platform}}/config/app-config{{alias.ext}}';
|
|
6
6
|
import { OPENAPI_DOCUMENTS } from '{{alias.platform}}/http/openapi-documents{{alias.ext}}';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Adds the contract and its interactive page next to the routes, one per document of a split
|
|
10
|
+
* contract, unless documentation is switched off (API_DOCS, off in production by default). The
|
|
11
|
+
* contract is written with the error mapper and the representations the routes are mounted with.
|
|
12
|
+
*/
|
|
13
|
+
export function withDocumentation(
|
|
14
|
+
routes: readonly Route[],
|
|
15
|
+
config: AppConfig,
|
|
16
|
+
boundary: Pick<ExecuteOptions, 'errorMapper' | 'representations'>,
|
|
17
|
+
): readonly Route[] {
|
|
10
18
|
if (!config.docsEnabled) {
|
|
11
19
|
return routes;
|
|
12
20
|
}
|
|
@@ -17,6 +25,8 @@ export function withDocumentation(routes: readonly Route[], config: AppConfig):
|
|
|
17
25
|
info: { title: title ?? config.serviceName, version: config.serviceVersion },
|
|
18
26
|
routes: selected,
|
|
19
27
|
securitySchemes,
|
|
28
|
+
...(boundary.errorMapper === undefined ? {} : { errorMapper: boundary.errorMapper }),
|
|
29
|
+
...(boundary.representations === undefined ? {} : { representations: boundary.representations }),
|
|
20
30
|
}),
|
|
21
31
|
}));
|
|
22
32
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { defineRoutes, formRoutes, type Route } from '@ddd-ts-kit/http';
|
|
2
|
+
import type { Presentation } from '{{alias.platform}}/http/presentation-of{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
/** The routes, and the form of each one that declares `form`, at `GET /forms/<operationId>`, for the caller who asks. */
|
|
5
|
+
export function withForms(routes: readonly Route[], { fieldAccess }: Presentation): readonly Route[] {
|
|
6
|
+
return defineRoutes(routes, formRoutes(routes, { fieldAccess }));
|
|
7
|
+
}
|
|
@@ -30,7 +30,7 @@ paths:
|
|
|
30
30
|
{{#if files.any}}
|
|
31
31
|
- A file arrives in the command as a `FileUpload` of its area, which the bus stages before the transaction under a key of `FileKeys` (never a name or a path from the user) and scans; the handler records `upload.file`, its `StoredFile`, on the aggregate and calls `FileStaging.promoteOnCommit`, which moves it to its key with the commit. A direct upload is confirmed from the `PendingUpload` the aggregate kept, never from a key the client sends. The ports are named here, never a connector (`files/port-not-connector`); `npx ddd-ts-kit generate file-upload` writes the slice.
|
|
32
32
|
{{/if}}
|
|
33
|
-
- A query never saves, deletes or publishes (`application/command-query-separation`); it hands the access scope of the actor to its read port and never filters after loading.
|
|
33
|
+
- A query never saves, deletes or publishes (`application/command-query-separation`); it hands the access scope of the actor to its read port and never filters after loading, and answers every field its read model holds: a field reserved to some callers is marked on the response schema with `withFieldAccess` of `@ddd-ts-kit/http`, never removed by a test on the roles of the actor (`authz/fields-by-schema`).
|
|
34
34
|
- A read that takes criteria, a scope or a page is a search, never a list (`naming/search-not-list`): `Search<Things>Query` in `queries/search-<things>/` (`generate query ... --search`), `search...` on the port, its adapters and its fakes; one element or none stays `findById` or `findBy...`.
|
|
35
35
|
{{#if literals.named}}
|
|
36
36
|
- A permission, a role or a status is read from its declaration, `billingPermissions['invoice.issue']`, `InvoiceStatus.Issued`, never written as a string (`language/declared-vocabulary`); a number has a name (`clean/no-magic-number`).
|
|
@@ -27,7 +27,7 @@ paths:
|
|
|
27
27
|
{{#if refusals.classes}}
|
|
28
28
|
- Every route says who may call it (its group or its guards for a controller, `security` for a function) and the `DomainError` codes it can answer in `errors`; the mapping from code to status lives in one place, the error mapper.
|
|
29
29
|
{{/if}}
|
|
30
|
-
- No role or ownership test in a controller or a route (`authz/in-application`): a guard of the group asks for a role at the edge, the bus asks for the permission, a policy decides on loaded state.
|
|
30
|
+
- No role or ownership test in a controller or a route (`authz/in-application`): a guard of the group asks for a role at the edge, the bus asks for the permission, a policy decides on loaded state. A field reserved to some callers is marked on its schema, `withFieldAccess(schema, { field: { read, write } })`, never by an `if` on a role (`authz/fields-by-schema`).{{#if presentation.negotiated}} Other media types are `produces` and `consumes` of the declaration (`generate representation`), from the same schema. A streamed export is `everyPage` over the search query of one page, sent through the bus page by page, never a query handler that answers a lazy list.{{/if}}{{#if presentation.forms}} A form is `defineForm` hints next to the body (`generate form`): shape and presentation, never a business rule; it `requires` the permission of its use case, asked as its `@Requires` asks it.{{/if}}
|
|
31
31
|
- Request and response types are presentation types, one class or schema per file next to the controller (`*.body.ts`, `*.params.ts`, `*.answer.ts`...; `*.dto.ts` for function routes and under `shared/`): never an aggregate, never a row.
|
|
32
32
|
{{#if schemas.shared}}
|
|
33
33
|
- A shape several routes use is declared once, in `presentation/http/shared/<name>.schema.ts` (`npx ddd-ts-kit generate schema <context> <Name>`), or in `presentation/` of the shared kernel when several contexts answer with it (`generate schema shared-kernel <Name>`), and shared: the contract documents it once and every route refers to it. A route takes the part it needs from it (pick, omit, partial, extend) instead of copying it, and answers an identifier with `acceptedSchema` of `@ddd-ts-kit/http` (`schema/no-duplicate-shape`). Only presentation layers import a schema (`schema/presentation-only`).
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
{{#if presentation.forms}}
|
|
4
|
+
import { formDocumentsOf } from '@ddd-ts-kit/http';
|
|
5
|
+
{{/if}}
|
|
3
6
|
import { generateOpenApi, routesByDocument } from '@ddd-ts-kit/http/openapi';
|
|
4
7
|
import { contractFormat, stringifyContract } from 'ddd-ts-kit/dist/contracts.js';
|
|
5
8
|
import { offlineAuthenticator } from '{{alias.platform}}/auth/offline-authenticator{{alias.ext}}';
|
|
@@ -11,6 +14,9 @@ import { OPENAPI_DOCUMENTS } from '{{alias.platform}}/http/openapi-documents{{al
|
|
|
11
14
|
|
|
12
15
|
// Generates the contract from the route definitions: openapi/openapi.yaml, or one file per
|
|
13
16
|
// document of "openapi.documents" in ddd-ts-kit.config.json, in the format of "openapi.format";
|
|
17
|
+
{{#if presentation.forms}}
|
|
18
|
+
// the form of every route that declares one, whole, in openapi/forms/<operationId>.json;
|
|
19
|
+
{{/if}}
|
|
14
20
|
// with --check, fails when a committed file differs. Build products: never edit them by hand.
|
|
15
21
|
const directory = path.resolve('openapi');
|
|
16
22
|
const format = contractFormat();
|
|
@@ -20,8 +26,8 @@ const application = composeApplication(inertPersistence(), {
|
|
|
20
26
|
authenticator: offlineAuthenticator,
|
|
21
27
|
});
|
|
22
28
|
|
|
23
|
-
const generated = new Map(
|
|
24
|
-
routesByDocument(application.routes, OPENAPI_DOCUMENTS).map(({ name, title, routes }) => [
|
|
29
|
+
const generated = new Map([
|
|
30
|
+
...routesByDocument(application.routes, OPENAPI_DOCUMENTS).map(({ name, title, routes }): [string, string] => [
|
|
25
31
|
`${name}.${format}`,
|
|
26
32
|
stringifyContract(
|
|
27
33
|
generateOpenApi({
|
|
@@ -29,22 +35,30 @@ const generated = new Map(
|
|
|
29
35
|
routes,
|
|
30
36
|
securitySchemes,
|
|
31
37
|
errorMapper: application.boundary.errorMapper,
|
|
38
|
+
{{#if presentation.negotiated}}
|
|
39
|
+
representations: application.boundary.representations,
|
|
40
|
+
{{/if}}
|
|
32
41
|
}),
|
|
33
42
|
format,
|
|
34
43
|
),
|
|
35
44
|
]),
|
|
36
|
-
|
|
45
|
+
{{#if presentation.forms}}
|
|
46
|
+
...(await formDocumentsOf(application.routes)).map((form): [string, string] => [
|
|
47
|
+
`forms/${form.operation}.json`,
|
|
48
|
+
`${JSON.stringify({ jsonForms: form.jsonForms, blocks: form.blocks }, null, 2)}\n`,
|
|
49
|
+
]),
|
|
50
|
+
{{/if}}
|
|
51
|
+
]);
|
|
37
52
|
|
|
38
53
|
if (process.argv.includes('--check')) {
|
|
39
54
|
reportDrift();
|
|
40
55
|
} else {
|
|
41
|
-
fs.mkdirSync(directory, { recursive: true });
|
|
42
|
-
|
|
43
56
|
for (const file of staleFiles()) {
|
|
44
57
|
fs.rmSync(path.join(directory, file));
|
|
45
58
|
}
|
|
46
59
|
|
|
47
60
|
for (const [file, content] of generated) {
|
|
61
|
+
fs.mkdirSync(path.dirname(path.join(directory, file)), { recursive: true });
|
|
48
62
|
fs.writeFileSync(path.join(directory, file), content);
|
|
49
63
|
}
|
|
50
64
|
}
|
|
@@ -66,9 +80,16 @@ function reportDrift(): void {
|
|
|
66
80
|
}
|
|
67
81
|
}
|
|
68
82
|
|
|
69
|
-
/** The contracts left by another format or by a document that is gone. */
|
|
83
|
+
/** The contracts left by another format or by a document that is gone{{#if presentation.forms}}, and the forms of routes that declare none any more{{/if}}: what else the folder holds is left alone. */
|
|
70
84
|
function staleFiles(): string[] {
|
|
85
|
+
{{#if presentation.forms}}
|
|
86
|
+
const forms = path.join(directory, 'forms');
|
|
87
|
+
const formFiles = fs.existsSync(forms) ? fs.readdirSync(forms).map((file) => `forms/${file}`) : [];
|
|
88
|
+
const present = [...(fs.existsSync(directory) ? fs.readdirSync(directory) : []), ...formFiles];
|
|
89
|
+
{{/if}}
|
|
90
|
+
{{#unless presentation.forms}}
|
|
71
91
|
const present = fs.existsSync(directory) ? fs.readdirSync(directory) : [];
|
|
92
|
+
{{/unless}}
|
|
72
93
|
|
|
73
94
|
return present.filter((file) => /\.(?:json|yaml)$/.test(file) && !generated.has(file));
|
|
74
95
|
}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@biomejs/biome": "2.5.15",
|
|
24
24
|
"@commitlint/cli": "^21.2.3",
|
|
25
25
|
"@commitlint/config-conventional": "^21.2.3",
|
|
26
|
-
"@ddd-ts-kit/eslint-plugin": "^0.
|
|
26
|
+
"@ddd-ts-kit/eslint-plugin": "^0.15.0",
|
|
27
27
|
"@eslint/js": "^10.0.1",
|
|
28
28
|
"@typescript/native": "npm:typescript@~7.0.2",
|
|
29
29
|
"@vitest/coverage-v8": "5.0.3",
|
package/templates/presets/identity/context/application/authorization/__context__.permissions.ts.tpl
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { definePermissions } from '@ddd-ts-kit/auth';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* What a use case of {{context.kebab}} requires. The platform grants them to every signed-in person;
|
|
5
|
+
* inside an organisation, the policies of this context then decide from the rights of the actor's
|
|
6
|
+
* role and of the delegations lent to them.
|
|
7
|
+
*/
|
|
8
|
+
export const {{context.camel}}Permissions = definePermissions('{{context.kebab}}', {
|
|
9
|
+
// ddd-ts-kit:permissions
|
|
10
|
+
'account.provision': { description: 'Provision or refresh the account of the person who signs in' },
|
|
11
|
+
'account.deactivate': { description: 'Deactivate the account of the person who asks' },
|
|
12
|
+
'organisation.open': { description: 'Open an organisation and become its first owner' },
|
|
13
|
+
'member.invite': { description: 'Invite a person to an organisation, in a role' },
|
|
14
|
+
'invitation.accept': { description: 'Accept an invitation addressed to oneself' },
|
|
15
|
+
'invitation.decline': { description: 'Decline an invitation addressed to oneself' },
|
|
16
|
+
'invitation.revoke': { description: 'Take back an invitation of an organisation' },
|
|
17
|
+
'member.change-role': { description: 'Change the role of a member of an organisation' },
|
|
18
|
+
'member.remove': { description: 'Remove a member from an organisation' },
|
|
19
|
+
'member.search': { description: 'Search the members of an organisation' },
|
|
20
|
+
'delegation.grant': { description: 'Lend some of the rights of a role to another member, for a period' },
|
|
21
|
+
'delegation.revoke': { description: 'Revoke a delegation of an organisation' },
|
|
22
|
+
// /ddd-ts-kit:permissions
|
|
23
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isAuthenticated, type Actor } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { Policy } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
import { OrganisationRights } from '{{alias.context}}/domain/value-objects/organisation-rights.vo{{alias.ext}}';
|
|
4
|
+
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
5
|
+
import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
|
|
6
|
+
|
|
7
|
+
/** An account changes the roles of an organisation where it manages the members. */
|
|
8
|
+
@Policy({{context.camel}}Permissions['member.change-role'], { name: '{{context.kebab}}.change-member-roles' })
|
|
9
|
+
export class ChangeMemberRolesPolicy {
|
|
10
|
+
appliesTo(subject: unknown): subject is OrganisationRights {
|
|
11
|
+
return subject instanceof OrganisationRights;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
allows(actor: Actor, rights: OrganisationRights): boolean {
|
|
15
|
+
return isAuthenticated(actor) && rights.accountId === actor.id && rights.includes(MemberRight.ManageMembers);
|
|
16
|
+
}
|
|
17
|
+
}
|
package/templates/presets/identity/context/application/authorization/grant-delegations.policy.ts.tpl
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isAuthenticated, type Actor } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { Policy } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
import { OrganisationRights } from '{{alias.context}}/domain/value-objects/organisation-rights.vo{{alias.ext}}';
|
|
4
|
+
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
5
|
+
import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
|
|
6
|
+
|
|
7
|
+
/** An account lends rights in an organisation where its role lets it delegate. */
|
|
8
|
+
@Policy({{context.camel}}Permissions['delegation.grant'], { name: '{{context.kebab}}.grant-delegations' })
|
|
9
|
+
export class GrantDelegationsPolicy {
|
|
10
|
+
appliesTo(subject: unknown): subject is OrganisationRights {
|
|
11
|
+
return subject instanceof OrganisationRights;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
allows(actor: Actor, rights: OrganisationRights): boolean {
|
|
15
|
+
return isAuthenticated(actor) && rights.accountId === actor.id && rights.includes(MemberRight.GrantDelegations);
|
|
16
|
+
}
|
|
17
|
+
}
|
package/templates/presets/identity/context/application/authorization/invite-members.policy.ts.tpl
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isAuthenticated, type Actor } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { Policy } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
import { OrganisationRights } from '{{alias.context}}/domain/value-objects/organisation-rights.vo{{alias.ext}}';
|
|
4
|
+
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
5
|
+
import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
|
|
6
|
+
|
|
7
|
+
/** An account invites to an organisation when its role, or a delegation, lets it invite there. */
|
|
8
|
+
@Policy({{context.camel}}Permissions['member.invite'], { name: '{{context.kebab}}.invite-members' })
|
|
9
|
+
export class InviteMembersPolicy {
|
|
10
|
+
appliesTo(subject: unknown): subject is OrganisationRights {
|
|
11
|
+
return subject instanceof OrganisationRights;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
allows(actor: Actor, rights: OrganisationRights): boolean {
|
|
15
|
+
return isAuthenticated(actor) && rights.accountId === actor.id && rights.includes(MemberRight.InviteMembers);
|
|
16
|
+
}
|
|
17
|
+
}
|
package/templates/presets/identity/context/application/authorization/read-members.policy.ts.tpl
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isAuthenticated, type Actor } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { Policy } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
import { OrganisationRights } from '{{alias.context}}/domain/value-objects/organisation-rights.vo{{alias.ext}}';
|
|
4
|
+
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
5
|
+
import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
|
|
6
|
+
|
|
7
|
+
/** An account searches the members of an organisation it belongs to. */
|
|
8
|
+
@Policy({{context.camel}}Permissions['member.search'], { name: '{{context.kebab}}.read-members' })
|
|
9
|
+
export class ReadMembersPolicy {
|
|
10
|
+
appliesTo(subject: unknown): subject is OrganisationRights {
|
|
11
|
+
return subject instanceof OrganisationRights;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
allows(actor: Actor, rights: OrganisationRights): boolean {
|
|
15
|
+
return isAuthenticated(actor) && rights.accountId === actor.id && rights.includes(MemberRight.ReadMembers);
|
|
16
|
+
}
|
|
17
|
+
}
|
package/templates/presets/identity/context/application/authorization/remove-members.policy.ts.tpl
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isAuthenticated, type Actor } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { Policy } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
import { OrganisationRights } from '{{alias.context}}/domain/value-objects/organisation-rights.vo{{alias.ext}}';
|
|
4
|
+
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
5
|
+
import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
|
|
6
|
+
|
|
7
|
+
/** An account removes members of an organisation where it manages the members. */
|
|
8
|
+
@Policy({{context.camel}}Permissions['member.remove'], { name: '{{context.kebab}}.remove-members' })
|
|
9
|
+
export class RemoveMembersPolicy {
|
|
10
|
+
appliesTo(subject: unknown): subject is OrganisationRights {
|
|
11
|
+
return subject instanceof OrganisationRights;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
allows(actor: Actor, rights: OrganisationRights): boolean {
|
|
15
|
+
return isAuthenticated(actor) && rights.accountId === actor.id && rights.includes(MemberRight.ManageMembers);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isAuthenticated, type Actor } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { Policy } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
import { OrganisationRights } from '{{alias.context}}/domain/value-objects/organisation-rights.vo{{alias.ext}}';
|
|
4
|
+
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
5
|
+
import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
|
|
6
|
+
|
|
7
|
+
/** An account revokes the delegations of an organisation where its role lets it delegate. */
|
|
8
|
+
@Policy({{context.camel}}Permissions['delegation.revoke'], { name: '{{context.kebab}}.revoke-delegations' })
|
|
9
|
+
export class RevokeDelegationsPolicy {
|
|
10
|
+
appliesTo(subject: unknown): subject is OrganisationRights {
|
|
11
|
+
return subject instanceof OrganisationRights;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
allows(actor: Actor, rights: OrganisationRights): boolean {
|
|
15
|
+
return isAuthenticated(actor) && rights.accountId === actor.id && rights.includes(MemberRight.GrantDelegations);
|
|
16
|
+
}
|
|
17
|
+
}
|