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":"identity-refusal.js","sourceRoot":"","sources":["../../src/presets/identity-refusal.ts"],"names":[],"mappings":"AAGA,kHAAkH;AAClH,MAAM,MAAM,GAIN;IACJ,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE;IAChE,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE;IAChF,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE;IACxE,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE;IAC/E,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE;IACxE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,6BAA6B,EAAE;IAChF,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAAE,IAAI,EAAE,kDAAkD,EAAE;IACnH,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,kCAAkC,EAAE;IACzF;QACE,GAAG,EAAE,OAAO;QACZ,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC;QAC3B,IAAI,EAAE,wEAAwE;KAC/E;IACD,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,6DAA6D,EAAE;CAC/G,CAAC;AAEF,0IAA0I;AAC1I,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAEtF,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,OAAO,EAAE,iDAAiD,OAAO,CAAC,GAAG,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI;QACzG,GAAG,EAAE,YAAY,OAAO,CAAC,IAAI,yKAAyK;KACvM,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GlossaryRow } from '../generate/parse-terms.js';
|
|
2
|
+
/** The ubiquitous language of the identity preset, written into the glossary of its CONTEXT.md. */
|
|
3
|
+
export declare const IDENTITY_TERMS: readonly GlossaryRow[];
|
|
4
|
+
//# sourceMappingURL=identity-terms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-terms.d.ts","sourceRoot":"","sources":["../../src/presets/identity-terms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,WAAW,EA0DhD,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** The ubiquitous language of the identity preset, written into the glossary of its CONTEXT.md. */
|
|
2
|
+
export const IDENTITY_TERMS = [
|
|
3
|
+
{
|
|
4
|
+
term: 'Account',
|
|
5
|
+
meaning: 'A person as the application knows them, under the subject the identity provider gives them; provisioned at their first sign-in, never holding a password',
|
|
6
|
+
},
|
|
7
|
+
{ term: 'Subject', meaning: 'The stable identifier the identity provider gives a person: the id of their account' },
|
|
8
|
+
{
|
|
9
|
+
term: 'Provision',
|
|
10
|
+
meaning: 'Create the account of a person at their first sign-in, from what their token says, and refresh it after',
|
|
11
|
+
},
|
|
12
|
+
{ term: 'Deactivate', meaning: 'Stop an account from acting: its person signs in no more, its history stays' },
|
|
13
|
+
{
|
|
14
|
+
term: 'Organisation',
|
|
15
|
+
meaning: 'A group of accounts that work together, identified by its slug; the tenant of its data when the project has tenants',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
term: 'Slug',
|
|
19
|
+
meaning: 'The identifier of an organisation, chosen when it opens: lower-case letters, digits and hyphens',
|
|
20
|
+
},
|
|
21
|
+
{ term: 'Member', meaning: 'The membership of one account in one organisation, in one role' },
|
|
22
|
+
{ term: 'Role', meaning: 'Owner, admin or member: what a member may do in an organisation follows from it' },
|
|
23
|
+
{
|
|
24
|
+
term: 'Right',
|
|
25
|
+
meaning: 'One thing a member may do in an organisation: read, invite or manage members, grant delegations',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
term: 'Invitation',
|
|
29
|
+
meaning: 'An organisation asks a person, by email address, to join in a role; answered with its token within a week, or taken back',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
term: 'Delegation',
|
|
33
|
+
meaning: 'A member lends some of the rights of their role to another member, for at most ninety days',
|
|
34
|
+
},
|
|
35
|
+
{ term: 'Display name', meaning: 'How a person is shown to the others: from their token, or as they wrote it' },
|
|
36
|
+
{
|
|
37
|
+
term: 'Email address',
|
|
38
|
+
meaning: 'Where a person is reached, always the one their token says: an invitation is matched on it',
|
|
39
|
+
},
|
|
40
|
+
{ term: 'Open', meaning: 'Create an organisation under its slug; the account that opens it is its first owner' },
|
|
41
|
+
{ term: 'Join', meaning: 'Become a member of an organisation: by opening it, or by accepting an invitation' },
|
|
42
|
+
{ term: 'Change', meaning: 'Give a member another role; only an owner appoints or changes an owner' },
|
|
43
|
+
{ term: 'Remove', meaning: 'End a membership; an organisation keeps one owner at least' },
|
|
44
|
+
{ term: 'Invite', meaning: 'Issue an invitation to an email address, in a role' },
|
|
45
|
+
{ term: 'Issue', meaning: 'Create an invitation and its token, which is sent once and never stored' },
|
|
46
|
+
{ term: 'Accept', meaning: 'Answer yes to an invitation sent to oneself, before it expires: one joins in its role' },
|
|
47
|
+
{ term: 'Decline', meaning: 'Answer no to an invitation sent to oneself' },
|
|
48
|
+
{ term: 'Grant', meaning: 'Lend rights of a role to another member, for a period' },
|
|
49
|
+
{ term: 'Revoke', meaning: 'Take back an invitation not answered, or end a delegation before its period' },
|
|
50
|
+
{ term: 'Period', meaning: 'When a delegation holds: from its start, included, to its end, excluded' },
|
|
51
|
+
{ term: 'Search', meaning: 'Read a page of the members of an organisation, for one of its members' },
|
|
52
|
+
{
|
|
53
|
+
term: 'Identity provider',
|
|
54
|
+
meaning: 'The system that authenticates the people (Keycloak): the application follows it, never stores its secrets',
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
//# sourceMappingURL=identity-terms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-terms.js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AAI,EAAE,OAAO,EAAE,OAAO,EAAE,yEAAyE,EAAE;IACrG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,uFAAuF,EAAE;IACpH,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,4CAA4C,EAAE;IAC1E,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,uDAAuD,EAAE;IACnF,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,6EAA6E,EAAE;IAC1G,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,yEAAyE,EAAE;IACtG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,uEAAuE,EAAE;IACpG;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EACL,2GAA2G;KAC9G;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-flags.d.ts","sourceRoot":"","sources":["../../src/presets/no-flags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,2FAA2F;AAC3F,eAAO,MAAM,QAAQ,EAAE,SAetB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The flags of a generator nobody passed: what a preset starts each of its steps from. */
|
|
2
|
+
export const NO_FLAGS = {
|
|
3
|
+
upstream: [],
|
|
4
|
+
term: [],
|
|
5
|
+
value: [],
|
|
6
|
+
transition: [],
|
|
7
|
+
command: false,
|
|
8
|
+
query: false,
|
|
9
|
+
allowName: false,
|
|
10
|
+
public: false,
|
|
11
|
+
tenantScoped: false,
|
|
12
|
+
search: false,
|
|
13
|
+
decorators: false,
|
|
14
|
+
mapper: false,
|
|
15
|
+
serializer: false,
|
|
16
|
+
eventSourced: false,
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=no-flags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-flags.js","sourceRoot":"","sources":["../../src/presets/no-flags.ts"],"names":[],"mappings":"AAEA,2FAA2F;AAC3F,MAAM,CAAC,MAAM,QAAQ,GAAc;IACjC,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,EAAE;IACT,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,KAAK;IACnB,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,KAAK;IACjB,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,KAAK;CACpB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Scope } from '../generate/scope.js';
|
|
2
|
+
/**
|
|
3
|
+
* With tenants, the organisations a token names are the tenants of the person: the authenticator
|
|
4
|
+
* of a Keycloak project reads the `organization` claim, which the preset's provider adapter keeps
|
|
5
|
+
* in line. Another authenticator, or one the team rewrote, is left alone with a step saying what
|
|
6
|
+
* to map.
|
|
7
|
+
*/
|
|
8
|
+
export declare function organisationsAsTenants(scope: Scope): void;
|
|
9
|
+
//# sourceMappingURL=organisations-as-tenants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organisations-as-tenants.d.ts","sourceRoot":"","sources":["../../src/presets/organisations-as-tenants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAyBlD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAuBzD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const KEYCLOAK_CALL = 'return keycloakAuthenticator({ baseUrl, realm, audience, ...(clientId === undefined ? {} : { clientId }) });';
|
|
2
|
+
const READS_ORGANISATIONS = "tenantClaim: 'organization'";
|
|
3
|
+
const READING = [
|
|
4
|
+
'return keycloakAuthenticator({',
|
|
5
|
+
' baseUrl,',
|
|
6
|
+
' realm,',
|
|
7
|
+
' audience,',
|
|
8
|
+
` ${READS_ORGANISATIONS},`,
|
|
9
|
+
' ...(clientId === undefined ? {} : { clientId }),',
|
|
10
|
+
' });',
|
|
11
|
+
].join('\n');
|
|
12
|
+
const TENANT_DOC = ' * tenant from the `tenant_id` claim; the session keeps nothing of the token. The realm needs an\n';
|
|
13
|
+
const ORGANISATIONS_DOC = [
|
|
14
|
+
' * tenants from the `organization` claim (one names the tenant of every request; several are the',
|
|
15
|
+
' * `tenants` a request names one of); the session keeps nothing of the token. The realm needs an',
|
|
16
|
+
'',
|
|
17
|
+
].join('\n');
|
|
18
|
+
/**
|
|
19
|
+
* With tenants, the organisations a token names are the tenants of the person: the authenticator
|
|
20
|
+
* of a Keycloak project reads the `organization` claim, which the preset's provider adapter keeps
|
|
21
|
+
* in line. Another authenticator, or one the team rewrote, is left alone with a step saying what
|
|
22
|
+
* to map.
|
|
23
|
+
*/
|
|
24
|
+
export function organisationsAsTenants(scope) {
|
|
25
|
+
if (scope.config.stack.tenancy === 'none' || scope.config.stack.authn === 'none') {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const file = `${scope.config.platformDir}/auth/create-authenticator.ts`;
|
|
29
|
+
const source = scope.ws.read(file);
|
|
30
|
+
if (source?.includes(READS_ORGANISATIONS) === true) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (scope.config.stack.authn === 'keycloak' && source?.includes(KEYCLOAK_CALL) === true) {
|
|
34
|
+
scope.ws.update(file, source.replace(KEYCLOAK_CALL, READING).replace(TENANT_DOC, ORGANISATIONS_DOC));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
scope.ws.step({
|
|
38
|
+
file,
|
|
39
|
+
anchor: 'export function createAuthenticator',
|
|
40
|
+
text: `map the organisations of the token to the tenants of the actor (\`tenantClaim\`, or \`toActor\` filling \`tenantId\` and the \`tenants\` attribute): every organisation of ${scope.context.kebab} is a tenant.`,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=organisations-as-tenants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organisations-as-tenants.js","sourceRoot":"","sources":["../../src/presets/organisations-as-tenants.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GACjB,8GAA8G,CAAC;AAEjH,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AAE1D,MAAM,OAAO,GAAG;IACd,gCAAgC;IAChC,cAAc;IACd,YAAY;IACZ,eAAe;IACf,OAAO,mBAAmB,GAAG;IAC7B,sDAAsD;IACtD,OAAO;CACR,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,UAAU,GAAG,oGAAoG,CAAC;AAExH,MAAM,iBAAiB,GAAG;IACxB,kGAAkG;IAClG,kGAAkG;IAClG,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAY;IACjD,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,KAAK,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC;QACjF,OAAO;IACT,CAAC;IAED,MAAM,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,+BAA+B,CAAC;IACxE,MAAM,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEnC,IAAI,MAAM,EAAE,QAAQ,CAAC,mBAAmB,CAAC,KAAK,IAAI,EAAE,CAAC;QACnD,OAAO;IACT,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,UAAU,IAAI,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC;QACxF,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC;QAErG,OAAO;IACT,CAAC;IAED,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC;QACZ,IAAI;QACJ,MAAM,EAAE,qCAAqC;QAC7C,IAAI,EAAE,8KAA8K,KAAK,CAAC,OAAO,CAAC,KAAK,eAAe;KACvN,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Scope } from '../generate/scope.js';
|
|
2
|
+
/**
|
|
3
|
+
* The decision record a preset writes when the project has tenants: why the tables of its context
|
|
4
|
+
* belong to no tenant, which the suppressions of its adapters name. Answers its reference
|
|
5
|
+
* (`ADR-0003`), or nothing for a project of one customer.
|
|
6
|
+
*/
|
|
7
|
+
export declare function presetDecision(scope: Scope, preset: string): string;
|
|
8
|
+
//# sourceMappingURL=preset-decision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-decision.d.ts","sourceRoot":"","sources":["../../src/presets/preset-decision.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAIlD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAcnE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ADR_DIRECTORY } from '../check/governance/adr-directory.js';
|
|
2
|
+
import { nextAdrNumber } from '../generate/kinds/next-adr-number.js';
|
|
3
|
+
import { vars } from '../generate/vars.js';
|
|
4
|
+
import { renderTemplate } from '../templating/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* The decision record a preset writes when the project has tenants: why the tables of its context
|
|
7
|
+
* belong to no tenant, which the suppressions of its adapters name. Answers its reference
|
|
8
|
+
* (`ADR-0003`), or nothing for a project of one customer.
|
|
9
|
+
*/
|
|
10
|
+
export function presetDecision(scope, preset) {
|
|
11
|
+
if (scope.config.stack.tenancy === 'none') {
|
|
12
|
+
return '';
|
|
13
|
+
}
|
|
14
|
+
const number = nextAdrNumber(scope.ws);
|
|
15
|
+
const adr = { number, date: new Date().toISOString().slice(0, 10) };
|
|
16
|
+
scope.ws.create(`${ADR_DIRECTORY}/${number}-${scope.context.kebab}-is-the-control-plane-of-the-tenants.md`, renderTemplate(`presets/${preset}/decision.md.tpl`, vars(scope, { adr })));
|
|
17
|
+
return `ADR-${number}`;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=preset-decision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-decision.js","sourceRoot":"","sources":["../../src/presets/preset-decision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAY,EAAE,MAAc;IACzD,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IAEpE,KAAK,CAAC,EAAE,CAAC,MAAM,CACb,GAAG,aAAa,IAAI,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,yCAAyC,EAC1F,cAAc,CAAC,WAAW,MAAM,kBAAkB,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAC1E,CAAC;IAEF,OAAO,OAAO,MAAM,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** One file a preset writes into its context. */
|
|
2
|
+
export interface PresetFile {
|
|
3
|
+
/** Under `templates/presets/<name>/`. */
|
|
4
|
+
readonly template: string;
|
|
5
|
+
/** Under the directory of the context. */
|
|
6
|
+
readonly target: string;
|
|
7
|
+
/**
|
|
8
|
+
* Written after the generators of the preset ran, over what they wrote: the files a generator
|
|
9
|
+
* keeps adding to (the tables of the context), which the preset then lays out whole.
|
|
10
|
+
*/
|
|
11
|
+
readonly afterSteps?: boolean;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=preset-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-file.d.ts","sourceRoot":"","sources":["../../src/presets/preset-file.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,WAAW,UAAU;IACzB,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-file.js","sourceRoot":"","sources":["../../src/presets/preset-file.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Config } from '../config/index.js';
|
|
2
|
+
import type { PresetFile } from './preset-file.js';
|
|
3
|
+
/**
|
|
4
|
+
* The files of a preset, read from `templates/presets/<name>/context/`: each template lands at the
|
|
5
|
+
* same path in the context, `__context__` standing for its name, and a template of variants only
|
|
6
|
+
* in a project of every one of them. The paths of `afterSteps` are written after the generators ran.
|
|
7
|
+
*/
|
|
8
|
+
export declare function presetFiles(preset: string, config: Config, afterSteps: readonly string[]): PresetFile[];
|
|
9
|
+
//# sourceMappingURL=preset-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-files.d.ts","sourceRoot":"","sources":["../../src/presets/preset-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAoBnD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,EAAE,CAevG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { listTemplates } from '../templating/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The variants a template is written for, by the segments before its extension:
|
|
4
|
+
* `account.mapper.knex.ts.tpl`, `open-organisation.accepted.class-validator.per-route.ts.tpl`.
|
|
5
|
+
*/
|
|
6
|
+
const VARIANTS = {
|
|
7
|
+
knex: (config) => config.stack.orm === 'knex',
|
|
8
|
+
drizzle: (config) => config.stack.orm === 'drizzle',
|
|
9
|
+
zod: (config) => config.stack.validation === 'zod',
|
|
10
|
+
'class-validator': (config) => config.stack.validation === 'class-validator',
|
|
11
|
+
'per-route': (config) => config.stack.schemas === 'per-route',
|
|
12
|
+
shared: (config) => config.stack.schemas === 'shared',
|
|
13
|
+
};
|
|
14
|
+
const NAMES = Object.keys(VARIANTS).join('|');
|
|
15
|
+
/** One variant segment, followed by others or by the extension only. */
|
|
16
|
+
const VARIANT = new RegExp(`\\.(${NAMES})(?=(?:\\.(?:${NAMES}))*\\.[a-z]+$)`, 'g');
|
|
17
|
+
/**
|
|
18
|
+
* The files of a preset, read from `templates/presets/<name>/context/`: each template lands at the
|
|
19
|
+
* same path in the context, `__context__` standing for its name, and a template of variants only
|
|
20
|
+
* in a project of every one of them. The paths of `afterSteps` are written after the generators ran.
|
|
21
|
+
*/
|
|
22
|
+
export function presetFiles(preset, config, afterSteps) {
|
|
23
|
+
const root = `presets/${preset}/`;
|
|
24
|
+
return listTemplates(`${root}context`).flatMap((template) => {
|
|
25
|
+
const path = template.slice(`${root}context/`.length).replace(/\.tpl$/, '');
|
|
26
|
+
const variants = [...path.matchAll(VARIANT)].map((found) => found[1] ?? '');
|
|
27
|
+
if (!variants.every((variant) => VARIANTS[variant]?.(config) ?? false)) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
const target = path.replace(VARIANT, '');
|
|
31
|
+
return [{ template: template.slice(root.length), target, afterSteps: afterSteps.includes(target) }];
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=preset-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-files.js","sourceRoot":"","sources":["../../src/presets/preset-files.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD;;;GAGG;AACH,MAAM,QAAQ,GAA0D;IACtE,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,MAAM;IAC7C,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,SAAS;IACnD,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,KAAK,KAAK;IAClD,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,KAAK,iBAAiB;IAC5E,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,KAAK,WAAW;IAC7D,MAAM,EAAE,CA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CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtG,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-named.d.ts","sourceRoot":"","sources":["../../src/presets/preset-named.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAK1C,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWhD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CliError } from '../cli-error.js';
|
|
2
|
+
import { identityPreset } from './identity-preset.js';
|
|
3
|
+
/** Every preset of the kit, by name. */
|
|
4
|
+
const PRESETS = [identityPreset];
|
|
5
|
+
export function presetNamed(name) {
|
|
6
|
+
const found = PRESETS.find((preset) => preset.name === name);
|
|
7
|
+
if (found === undefined) {
|
|
8
|
+
throw new CliError(`Unknown preset "${name}".`, `Use one of: ${PRESETS.map((preset) => preset.name).join(', ')}; any other context starts empty.`);
|
|
9
|
+
}
|
|
10
|
+
return found;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=preset-named.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-named.js","sourceRoot":"","sources":["../../src/presets/preset-named.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,wCAAwC;AACxC,MAAM,OAAO,GAAsB,CAAC,cAAc,CAAC,CAAC;AAEpD,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IAE7D,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,QAAQ,CAChB,mBAAmB,IAAI,IAAI,EAC3B,eAAe,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAmC,CAClG,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-refusal.d.ts","sourceRoot":"","sources":["../../src/presets/preset-refusal.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-refusal.js","sourceRoot":"","sources":["../../src/presets/preset-refusal.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Kind, KindFlags } from '../generate/kind.js';
|
|
2
|
+
/** One generator a preset runs on its context, as `ddd-ts-kit generate <kind> <context> <args...>` would. */
|
|
3
|
+
export interface PresetStep {
|
|
4
|
+
readonly kind: Kind;
|
|
5
|
+
readonly args: readonly string[];
|
|
6
|
+
readonly flags?: Partial<KindFlags>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=preset-step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-step.d.ts","sourceRoot":"","sources":["../../src/presets/preset-step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE3D,6GAA6G;AAC7G,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-step.js","sourceRoot":"","sources":["../../src/presets/preset-step.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Config } from '../config/index.js';
|
|
2
|
+
import type { GlossaryRow } from '../generate/parse-terms.js';
|
|
3
|
+
import type { PresetFile } from './preset-file.js';
|
|
4
|
+
import type { PresetRefusal } from './preset-refusal.js';
|
|
5
|
+
import type { PresetStep } from './preset-step.js';
|
|
6
|
+
/**
|
|
7
|
+
* A bounded context written whole, in the conventions of the kit: its model, its use cases, its
|
|
8
|
+
* adapters, its routes and their specs. What `--preset <name>` of `init` and of `generate context`
|
|
9
|
+
* writes into a context of that name, where a team starts from a context that is generic enough to
|
|
10
|
+
* be designed once (identity, notification) instead of an empty one.
|
|
11
|
+
*/
|
|
12
|
+
export interface Preset {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
/** What the context is to the business when the preset creates it. */
|
|
15
|
+
readonly classification: string;
|
|
16
|
+
/** Why the context is of that classification, in one sentence. */
|
|
17
|
+
readonly classificationReason: string;
|
|
18
|
+
readonly purpose: string;
|
|
19
|
+
readonly terms: readonly GlossaryRow[];
|
|
20
|
+
/** Why the preset cannot be written in this project, or nothing: a stack it was not written for. */
|
|
21
|
+
refusal(config: Config): PresetRefusal | undefined;
|
|
22
|
+
/** The generators run on the context once its files are written: what they write outside it is what wires it. */
|
|
23
|
+
readonly steps: readonly PresetStep[];
|
|
24
|
+
/**
|
|
25
|
+
* Every signed-in person holds the permissions of the context, its policies deciding on the
|
|
26
|
+
* element: the platform grants them whatever its access model.
|
|
27
|
+
*/
|
|
28
|
+
readonly grantsEverySignedInPerson: boolean;
|
|
29
|
+
/** With tenants, the organisations of the context are the tenants: the authenticator reads them from the token. */
|
|
30
|
+
readonly organisationsAreTenants: boolean;
|
|
31
|
+
/** A file only this preset writes in a context: another context holding it was written from the same preset. */
|
|
32
|
+
readonly signature: string;
|
|
33
|
+
/** The files of the context, rendered from `templates/presets/<name>/`. */
|
|
34
|
+
files(config: Config): readonly PresetFile[];
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../src/presets/preset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,kEAAkE;IAClE,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IACvC,oGAAoG;IACpG,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;IACnD,iHAAiH;IACjH,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,yBAAyB,EAAE,OAAO,CAAC;IAC5C,mHAAmH;IACnH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C,gHAAgH;IAChH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,2EAA2E;IAC3E,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,UAAU,EAAE,CAAC;CAC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset.js","sourceRoot":"","sources":["../../src/presets/preset.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The source importing `member` from `@ddd-ts-kit/auth` as well, in the import it already has
|
|
3
|
+
* from there (a type-only import becomes one of values and types), or in a new one.
|
|
4
|
+
*/
|
|
5
|
+
export declare function withAuthorizerImport(source: string, member: string): string;
|
|
6
|
+
//# sourceMappingURL=with-authorizer-import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-authorizer-import.d.ts","sourceRoot":"","sources":["../../src/presets/with-authorizer-import.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAgB3E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const AUTH_IMPORT = /^import (type )?\{([^}]*)\} from '@ddd-ts-kit\/auth';$/m;
|
|
2
|
+
/**
|
|
3
|
+
* The source importing `member` from `@ddd-ts-kit/auth` as well, in the import it already has
|
|
4
|
+
* from there (a type-only import becomes one of values and types), or in a new one.
|
|
5
|
+
*/
|
|
6
|
+
export function withAuthorizerImport(source, member) {
|
|
7
|
+
const found = AUTH_IMPORT.exec(source);
|
|
8
|
+
if (found === null) {
|
|
9
|
+
return `import { ${member} } from '@ddd-ts-kit/auth';\n${source}`;
|
|
10
|
+
}
|
|
11
|
+
const [line, typeOnly, members = ''] = found;
|
|
12
|
+
const present = members
|
|
13
|
+
.split(',')
|
|
14
|
+
.map((name) => name.trim())
|
|
15
|
+
.filter((name) => name !== '')
|
|
16
|
+
.map((name) => (typeOnly === undefined || name.startsWith('type ') ? name : `type ${name}`));
|
|
17
|
+
return source.replace(line, `import { ${orderedMembers([...present, member]).join(', ')} } from '@ddd-ts-kit/auth';`);
|
|
18
|
+
}
|
|
19
|
+
/** Values first, then types, each in alphabetical order, as the generated imports are written. */
|
|
20
|
+
function orderedMembers(members) {
|
|
21
|
+
const named = (member) => member.replace(/^type /, '');
|
|
22
|
+
const byName = (left, right) => named(left).localeCompare(named(right));
|
|
23
|
+
const values = members.filter((member) => !member.startsWith('type ')).sort(byName);
|
|
24
|
+
const types = members.filter((member) => member.startsWith('type ')).sort(byName);
|
|
25
|
+
return [...new Set([...values, ...types])];
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=with-authorizer-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-authorizer-import.js","sourceRoot":"","sources":["../../src/presets/with-authorizer-import.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,yDAAyD,CAAC;AAE9E;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAc,EAAE,MAAc;IACjE,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEvC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,YAAY,MAAM,gCAAgC,MAAM,EAAE,CAAC;IACpE,CAAC;IAED,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;IAE7C,MAAM,OAAO,GAAG,OAAO;SACpB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC;SAC7B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;IAE/F,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,YAAY,cAAc,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;AACxH,CAAC;AAED,kGAAkG;AAClG,SAAS,cAAc,CAAC,OAA0B;IAChD,MAAM,KAAK,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACvE,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAChG,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpF,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAElF,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC"}
|
package/dist/stack/stack-vars.js
CHANGED
|
@@ -33,16 +33,20 @@ export function stackVars(config) {
|
|
|
33
33
|
errors: errorVars(config),
|
|
34
34
|
...modelWritingVars(config),
|
|
35
35
|
routes: routeVars(config),
|
|
36
|
+
presentation: presentationVars(config),
|
|
36
37
|
logger: one(logger, ['stdout', 'pino', 'winston']),
|
|
37
38
|
tests: { ...one(tests, ['vitest', 'jest']), module: tests === 'jest' ? '@jest/globals' : 'vitest' },
|
|
38
|
-
worker: { on: config.worker, off: !config.worker },
|
|
39
39
|
config: platformPaths(config),
|
|
40
40
|
alias: aliasVars(config),
|
|
41
41
|
persistence: persistenceVars(config),
|
|
42
42
|
tenancy: { ...one(tenancy, ['none', 'shared-table']), any: tenancy !== 'none' },
|
|
43
|
-
|
|
43
|
+
...backgroundVars(config),
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
+
/** Where the background jobs run and are kept. */
|
|
47
|
+
function backgroundVars(config) {
|
|
48
|
+
return { worker: { on: config.worker, off: !config.worker }, queue: queueVars(config) };
|
|
49
|
+
}
|
|
46
50
|
/**
|
|
47
51
|
* `stored`: the jobs leave the memory of the process. `processTable`: the instances of the
|
|
48
52
|
* process managers go to the database whenever the jobs leave memory and the ORM keeps them.
|
|
@@ -80,6 +84,19 @@ function routeVars(config) {
|
|
|
80
84
|
mountsControllers: declaredControllers || (http !== 'none' && audit === 'on' && routes === 'controllers'),
|
|
81
85
|
};
|
|
82
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* `negotiated`: the boundary registers the representations of the kit; `forms`: the composition
|
|
89
|
+
* root serves the forms of the routes. Either one decides the restricted fields through the
|
|
90
|
+
* `Access` of the application, which `presentation-of.ts` of the platform builds.
|
|
91
|
+
*/
|
|
92
|
+
function presentationVars(config) {
|
|
93
|
+
const { http, representations, forms, audit } = config.stack;
|
|
94
|
+
const negotiated = http !== 'none' && representations === 'negotiated';
|
|
95
|
+
const served = http !== 'none' && forms === 'on';
|
|
96
|
+
const any = negotiated || served;
|
|
97
|
+
// The HTTP boundary takes more than its five ports when the audit trail or the presentation joins them.
|
|
98
|
+
return { negotiated, forms: served, any, widensEdge: any || audit === 'on' };
|
|
99
|
+
}
|
|
83
100
|
function assemblyVars(config) {
|
|
84
101
|
const { style, assembly } = config.stack;
|
|
85
102
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-vars.js","sourceRoot":"","sources":["../../src/stack/stack-vars.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,M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/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.15.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -20,6 +20,8 @@ export declare class Workspace {
|
|
|
20
20
|
list(directory: string): string[];
|
|
21
21
|
/** Names of the directories directly inside `directory`, on disk or planned. */
|
|
22
22
|
directories(directory: string): string[];
|
|
23
|
+
/** True when this command already wrote the file, whether it is on disk or not. */
|
|
24
|
+
planned(file: string): boolean;
|
|
23
25
|
/** Never replaces a file the user may have edited, unless asked to with --force. */
|
|
24
26
|
create(file: string, content: string): boolean;
|
|
25
27
|
update(file: string, written: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/workspace/workspace.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAO7D;;;;;GAKG;AACH,qBAAa,SAAS;IAUlB,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAVxB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAM;IAE9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IAEtD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAE7C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IAExC,YACW,IAAI,EAAE,MAAM,EACJ,KAAK,EAAE,OAAO,EAC7B;IAEJ,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5B;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYrC;IAED,0EAA0E;IAC1E,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAMhC;IAED,gFAAgF;IAChF,WAAW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AAM,GAAG,SAAS,CAYrC;IAED,0EAA0E;IAC1E,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAMhC;IAED,gFAAgF;IAChF,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAUvC;IAED,mFAAmF;IACnF,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7B;IAED,oFAAoF;IACpF,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAc7C;IAED,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAe1C;IAED,sIAAsI;IACtI,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3B;IAED,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI1B;IAED,iHAAiH;IACjH,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAIzB;IAED,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,eAAe,CAwBvC;IAED,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,MAAM;IAYd,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,QAAQ;CAGjB"}
|
|
@@ -52,6 +52,10 @@ export class Workspace {
|
|
|
52
52
|
});
|
|
53
53
|
return [...new Set([...this.onDisk(directory, (entry) => entry.isDirectory()), ...planned])].sort();
|
|
54
54
|
}
|
|
55
|
+
/** True when this command already wrote the file, whether it is on disk or not. */
|
|
56
|
+
planned(file) {
|
|
57
|
+
return this.pending.has(file);
|
|
58
|
+
}
|
|
55
59
|
/** Never replaces a file the user may have edited, unless asked to with --force. */
|
|
56
60
|
create(file, content) {
|
|
57
61
|
const onDisk = fs.existsSync(this.absolute(file));
|