ddd-ts-kit 0.105.0 → 0.106.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/CHANGELOG.md +60 -0
- package/README.fr.md +22 -13
- package/README.md +20 -12
- package/dist/check/baseline/renamed-files.d.ts.map +1 -1
- package/dist/check/baseline/renamed-files.js +2 -1
- package/dist/check/baseline/renamed-files.js.map +1 -1
- package/dist/check/commands/changed-files.d.ts.map +1 -1
- package/dist/check/commands/changed-files.js +2 -1
- package/dist/check/commands/changed-files.js.map +1 -1
- package/dist/check/project/git-ignored.d.ts.map +1 -1
- package/dist/check/project/git-ignored.js +2 -1
- package/dist/check/project/git-ignored.js.map +1 -1
- package/dist/check/rules/authz-declared.d.ts.map +1 -1
- package/dist/check/rules/authz-declared.js +2 -1
- package/dist/check/rules/authz-declared.js.map +1 -1
- package/dist/commit/git-arguments.d.ts +9 -0
- package/dist/commit/git-arguments.d.ts.map +1 -0
- package/dist/commit/git-arguments.js +46 -0
- package/dist/commit/git-arguments.js.map +1 -0
- package/dist/commit/run-git.d.ts.map +1 -1
- package/dist/commit/run-git.js +2 -1
- package/dist/commit/run-git.js.map +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/kit-container.d.ts +6 -0
- package/dist/config/kit-container.d.ts.map +1 -0
- package/dist/config/kit-container.js +10 -0
- package/dist/config/kit-container.js.map +1 -0
- package/dist/config/stack.d.ts +1 -1
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +1 -1
- package/dist/config/stack.js.map +1 -1
- package/dist/doctor/format-diagnosis.js +3 -0
- package/dist/doctor/format-diagnosis.js.map +1 -1
- package/dist/doctor/hook-findings.d.ts +2 -1
- package/dist/doctor/hook-findings.d.ts.map +1 -1
- package/dist/doctor/hook-findings.js +10 -2
- package/dist/doctor/hook-findings.js.map +1 -1
- package/dist/doctor/permission-findings.js +1 -0
- package/dist/doctor/permission-findings.js.map +1 -1
- package/dist/generate/di-entry.d.ts +4 -0
- package/dist/generate/di-entry.d.ts.map +1 -0
- package/dist/generate/di-entry.js +5 -0
- package/dist/generate/di-entry.js.map +1 -0
- package/dist/generate/di-imports.d.ts +4 -0
- package/dist/generate/di-imports.d.ts.map +1 -0
- package/dist/generate/di-imports.js +12 -0
- package/dist/generate/di-imports.js.map +1 -0
- package/dist/generate/kinds/adapter-kind.d.ts.map +1 -1
- package/dist/generate/kinds/adapter-kind.js +3 -2
- package/dist/generate/kinds/adapter-kind.js.map +1 -1
- package/dist/generate/kinds/background/spec-family.d.ts +1 -1
- package/dist/generate/kinds/background/spec-family.d.ts.map +1 -1
- package/dist/generate/kinds/background/spec-family.js +2 -1
- package/dist/generate/kinds/background/spec-family.js.map +1 -1
- package/dist/generate/kinds/command-outputs.d.ts.map +1 -1
- package/dist/generate/kinds/command-outputs.js +2 -1
- package/dist/generate/kinds/command-outputs.js.map +1 -1
- package/dist/generate/kinds/extraction/service-selection.d.ts.map +1 -1
- package/dist/generate/kinds/extraction/service-selection.js +2 -1
- package/dist/generate/kinds/extraction/service-selection.js.map +1 -1
- package/dist/generate/kinds/gateway-kind.js +1 -1
- package/dist/generate/kinds/gateway-kind.js.map +1 -1
- package/dist/generate/kinds/import-assembler.d.ts.map +1 -1
- package/dist/generate/kinds/import-assembler.js +11 -2
- package/dist/generate/kinds/import-assembler.js.map +1 -1
- package/dist/generate/kinds/job/grant-system-actor.d.ts.map +1 -1
- package/dist/generate/kinds/job/grant-system-actor.js +8 -4
- package/dist/generate/kinds/job/grant-system-actor.js.map +1 -1
- package/dist/generate/kinds/job-kind.d.ts.map +1 -1
- package/dist/generate/kinds/job-kind.js +2 -1
- package/dist/generate/kinds/job-kind.js.map +1 -1
- package/dist/generate/kinds/personal-data/declare-personal-data.js +1 -1
- package/dist/generate/kinds/personal-data/declare-personal-data.js.map +1 -1
- package/dist/generate/kinds/query-outputs.d.ts.map +1 -1
- package/dist/generate/kinds/query-outputs.js +2 -1
- package/dist/generate/kinds/query-outputs.js.map +1 -1
- package/dist/generate/kinds/test-world-kind.d.ts.map +1 -1
- package/dist/generate/kinds/test-world-kind.js +3 -2
- package/dist/generate/kinds/test-world-kind.js.map +1 -1
- package/dist/generate/kinds/world/context-fakes.d.ts.map +1 -1
- package/dist/generate/kinds/world/context-fakes.js +2 -1
- package/dist/generate/kinds/world/context-fakes.js.map +1 -1
- package/dist/generate/kinds/world/world-arrangement.d.ts.map +1 -1
- package/dist/generate/kinds/world/world-arrangement.js +2 -1
- package/dist/generate/kinds/world/world-arrangement.js.map +1 -1
- package/dist/generate/kinds/world/world-vars.d.ts.map +1 -1
- package/dist/generate/kinds/world/world-vars.js +2 -1
- package/dist/generate/kinds/world/world-vars.js.map +1 -1
- package/dist/generate/spec-vars.d.ts.map +1 -1
- package/dist/generate/spec-vars.js +2 -1
- package/dist/generate/spec-vars.js.map +1 -1
- package/dist/generate/wiring-family.d.ts +1 -1
- package/dist/generate/wiring-family.d.ts.map +1 -1
- package/dist/generate/wiring-family.js +2 -1
- package/dist/generate/wiring-family.js.map +1 -1
- package/dist/generate/wirings.js +2 -2
- package/dist/generate/wirings.js.map +1 -1
- package/dist/help/usage.js +1 -1
- package/dist/init/add-presets.d.ts +8 -0
- package/dist/init/add-presets.d.ts.map +1 -0
- package/dist/init/add-presets.js +17 -0
- package/dist/init/add-presets.js.map +1 -0
- package/dist/init/agent-permissions.js +2 -0
- package/dist/init/agent-permissions.js.map +1 -1
- package/dist/init/files/audit-files.js +1 -1
- package/dist/init/files/audit-files.js.map +1 -1
- package/dist/init/files/auth-files.js +2 -2
- package/dist/init/files/auth-files.js.map +1 -1
- package/dist/init/files/event-sourcing-files.js +1 -1
- package/dist/init/files/event-sourcing-files.js.map +1 -1
- package/dist/init/files/family-of.d.ts +1 -1
- package/dist/init/files/family-of.d.ts.map +1 -1
- package/dist/init/files/family-of.js +2 -1
- package/dist/init/files/family-of.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +2 -1
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/files/platform-files.js +2 -2
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/files/privacy-files.js +1 -1
- package/dist/init/files/privacy-files.js.map +1 -1
- package/dist/init/manifest/dependencies-against-stack.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-against-stack.js +5 -1
- package/dist/init/manifest/dependencies-against-stack.js.map +1 -1
- package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-for.js +4 -0
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/versions.d.ts.map +1 -1
- package/dist/init/manifest/versions.js +28 -24
- package/dist/init/manifest/versions.js.map +1 -1
- package/dist/init/manifest/write-manifest.js +1 -1
- package/dist/init/manifest/write-manifest.js.map +1 -1
- package/dist/init/regulated-sandbox.d.ts +5 -3
- package/dist/init/regulated-sandbox.d.ts.map +1 -1
- package/dist/init/regulated-sandbox.js +6 -3
- package/dist/init/regulated-sandbox.js.map +1 -1
- package/dist/init/rewire-personal-data.js +1 -1
- package/dist/init/rewire-personal-data.js.map +1 -1
- package/dist/init/rewire-preset.d.ts +1 -1
- package/dist/init/rewire-preset.d.ts.map +1 -1
- package/dist/init/rewire-preset.js +5 -2
- package/dist/init/rewire-preset.js.map +1 -1
- package/dist/init/run-init.js +1 -5
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/resolve-stack.js +1 -1
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/resolve-style.d.ts +1 -1
- package/dist/init/stack/resolve-style.js +4 -4
- package/dist/init/stack/resolve-style.js.map +1 -1
- package/dist/init/validation-dependencies.d.ts.map +1 -1
- package/dist/init/validation-dependencies.js +3 -1
- package/dist/init/validation-dependencies.js.map +1 -1
- package/dist/layout/fit-statement.js +16 -2
- package/dist/layout/fit-statement.js.map +1 -1
- package/dist/merge/git-process.d.ts.map +1 -1
- package/dist/merge/git-process.js +2 -1
- package/dist/merge/git-process.js.map +1 -1
- package/dist/merge/lost/revision-files.d.ts.map +1 -1
- package/dist/merge/lost/revision-files.js +6 -1
- package/dist/merge/lost/revision-files.js.map +1 -1
- package/dist/merge/lost/side-hunks.d.ts.map +1 -1
- package/dist/merge/lost/side-hunks.js +2 -1
- package/dist/merge/lost/side-hunks.js.map +1 -1
- package/dist/merge/object-bytes.d.ts.map +1 -1
- package/dist/merge/object-bytes.js +2 -1
- package/dist/merge/object-bytes.js.map +1 -1
- package/dist/package-manager/package-manager-vars.d.ts +1 -1
- package/dist/package-manager/package-manager-vars.js +2 -2
- package/dist/package-manager/package-manager-vars.js.map +1 -1
- package/dist/package-manager/pinned-package-managers.d.ts +2 -2
- package/dist/package-manager/pinned-package-managers.js +2 -2
- package/dist/plan/copy-of-project.d.ts.map +1 -1
- package/dist/plan/copy-of-project.js +2 -1
- package/dist/plan/copy-of-project.js.map +1 -1
- package/dist/presets/apply-preset.d.ts.map +1 -1
- package/dist/presets/apply-preset.js +2 -0
- package/dist/presets/apply-preset.js.map +1 -1
- package/dist/presets/identity-refusal.d.ts.map +1 -1
- package/dist/presets/identity-refusal.js +4 -3
- package/dist/presets/identity-refusal.js.map +1 -1
- package/dist/presets/organisations-as-audit-chains.d.ts +10 -0
- package/dist/presets/organisations-as-audit-chains.d.ts.map +1 -0
- package/dist/presets/organisations-as-audit-chains.js +30 -0
- package/dist/presets/organisations-as-audit-chains.js.map +1 -0
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +7 -2
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -5
- package/templates/architecture/{extractable.tsyringe.spec.ts.tpl → extractable.container.spec.ts.tpl} +2 -1
- package/templates/architecture/extractable.declared.spec.ts.tpl +2 -1
- package/templates/controller/guard.spec.ts.tpl +20 -15
- package/templates/controller/guard.ts.tpl +3 -5
- package/templates/init/README.md.tpl +8 -6
- package/templates/init/docker/Dockerfile.tpl +7 -7
- package/templates/init/docker/env.example.tpl +2 -0
- package/templates/init/e2e/start-application.database.ts.tpl +5 -5
- package/templates/init/e2e/start-application.memory.ts.tpl +5 -5
- package/templates/init/main.ts.tpl +1 -0
- package/templates/init/platform/composition/{compose-application.tsyringe.ts.tpl → compose-application.container.ts.tpl} +4 -7
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +2 -0
- package/templates/init/platform/events/start-outbox-relay.ts.tpl +5 -1
- package/templates/init/platform/observability/create-logger.stdout.ts.tpl +2 -2
- package/templates/init/platform/observability/create-metrics.ts.tpl +6 -3
- package/templates/init/platform/resilience/adapters-with-own-policy.ts.tpl +1 -1
- package/templates/init/platform/resilience/default-policy.ts.tpl +1 -1
- package/templates/init/rules/platform.md.tpl +3 -3
- package/templates/init/rules/tests.md.tpl +2 -2
- package/templates/pipeline/biome.json.tpl +1 -1
- package/templates/pipeline/github/actions/setup/action.yml.tpl +3 -2
- package/templates/pipeline/gitlab/gitlab-ci.yml.tpl +2 -2
- package/templates/pipeline/package-scripts.json +2 -2
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.handler.ts.tpl +6 -4
- package/templates/presets/identity/context/test/integration/organisation-tenant-directory.spec.ts.tpl +7 -6
- package/templates/presets/identity/context/test/worlds/__context__.world.declared.ts.tpl +2 -1
- package/templates/presets/identity/design.md.tpl +4 -2
- package/templates/presets/identity/e2e/support.wiring.tpl +4 -4
- package/templates/presets/identity/platform/organisation-of-command.ts.tpl +36 -0
- package/templates/repository/knex/mapper.ts.tpl +1 -1
- package/templates/service/main.ts.tpl +1 -0
- /package/templates/adapter/{simulated.wiring.tsyringe.tpl → simulated.wiring.container.tpl} +0 -0
- /package/templates/adapter/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/architecture/{hosting.tsyringe.spec.ts.tpl → hosting.container.spec.ts.tpl} +0 -0
- /package/templates/architecture/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/background-job/{background-job.spec.tsyringe.ts.tpl → background-job.spec.container.ts.tpl} +0 -0
- /package/templates/background-job/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/command/{handler.spec.tsyringe.ts.tpl → handler.spec.container.ts.tpl} +0 -0
- /package/templates/command/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/context/{module.tsyringe.ts.tpl → module.container.ts.tpl} +0 -0
- /package/templates/context/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/controller/{routes.tsyringe.tpl → routes.container.tpl} +0 -0
- /package/templates/erasure-handler/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/event-handler/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/file-upload/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/gateway/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/init/platform/audit/{audit.module.tsyringe.ts.tpl → audit.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/auth/authorization/{authorization.tsyringe.ts.tpl → authorization.container.ts.tpl} +0 -0
- /package/templates/init/platform/buses/{create-command-bus.tsyringe.ts.tpl → create-command-bus.container.ts.tpl} +0 -0
- /package/templates/init/platform/buses/{create-query-bus.tsyringe.ts.tpl → create-query-bus.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{context-selection.tsyringe.ts.tpl → context-selection.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{lay-foundations.tsyringe.ts.tpl → lay-foundations.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{platform-test.module.tsyringe.ts.tpl → platform-test.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{platform.module.tsyringe.ts.tpl → platform.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{routes-of.tsyringe.ts.tpl → routes-of.container.ts.tpl} +0 -0
- /package/templates/init/platform/files/{bind-files.tsyringe.ts.tpl → bind-files.container.ts.tpl} +0 -0
- /package/templates/init/platform/files/{files.module.tsyringe.ts.tpl → files.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/files/{staging-uploads.tsyringe.ts.tpl → staging-uploads.container.ts.tpl} +0 -0
- /package/templates/init/platform/jobs/{housekeeping.module.tsyringe.ts.tpl → housekeeping.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{data-subject-copies.tsyringe.ts.tpl → data-subject-copies.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{data-subject-exports.tsyringe.ts.tpl → data-subject-exports.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{privacy.module.tsyringe.ts.tpl → privacy.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{run-erasure.tsyringe.ts.tpl → run-erasure.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{run-export.tsyringe.ts.tpl → run-export.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{run-purge.tsyringe.ts.tpl → run-purge.container.ts.tpl} +0 -0
- /package/templates/init/scripts/{privacy-erase.tsyringe.ts.tpl → privacy-erase.container.ts.tpl} +0 -0
- /package/templates/init/scripts/{privacy-export.tsyringe.ts.tpl → privacy-export.container.ts.tpl} +0 -0
- /package/templates/init/scripts/{privacy-purge.tsyringe.ts.tpl → privacy-purge.container.ts.tpl} +0 -0
- /package/templates/integration-event/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/integration-handler/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/job/{job.spec.tsyringe.ts.tpl → job.spec.container.ts.tpl} +0 -0
- /package/templates/job/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/module/{module-file.tsyringe.ts.tpl → module-file.container.ts.tpl} +0 -0
- /package/templates/module/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/personal-data/{copies.tsyringe.tpl → copies.container.tpl} +0 -0
- /package/templates/personal-data/{exports.tsyringe.tpl → exports.container.tpl} +0 -0
- /package/templates/personal-data/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/process/{timeout-job.spec.tsyringe.ts.tpl → timeout-job.spec.container.ts.tpl} +0 -0
- /package/templates/process/{timeout-job.wiring.tsyringe.tpl → timeout-job.wiring.container.tpl} +0 -0
- /package/templates/projection/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/query/{handler.spec.tsyringe.ts.tpl → handler.spec.container.ts.tpl} +0 -0
- /package/templates/query/{search.handler.spec.tsyringe.ts.tpl → search.handler.spec.container.ts.tpl} +0 -0
- /package/templates/query/{search.wiring.tsyringe.tpl → search.wiring.container.tpl} +0 -0
- /package/templates/query/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/repository/{event-sourced.wiring.tsyringe.tpl → event-sourced.wiring.container.tpl} +0 -0
- /package/templates/repository/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/route/{routes.on-tsyringe.tpl → routes.on-container.tpl} +0 -0
- /package/templates/service/{extracted.tsyringe.tpl → extracted.container.tpl} +0 -0
- /package/templates/test-world/{world.tsyringe.ts.tpl → world.container.ts.tpl} +0 -0
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"ci:build": "npm run build"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@biomejs/biome": "2.6.
|
|
23
|
+
"@biomejs/biome": "2.6.3",
|
|
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.106.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",
|
|
@@ -39,10 +39,12 @@ export class DeactivateAccountHandler implements CommandHandler<DeactivateAccoun
|
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* A person deactivates their own account, which leaves every organisation it belongs to and ends
|
|
42
|
-
* every delegation it gave or received there, in the same unit of work
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* the
|
|
42
|
+
* every delegation it gave or received there, in the same unit of work. This context refuses the
|
|
43
|
+
* account at once; the other contexts read the token, so they refuse it at its next token: a
|
|
44
|
+
* token already issued lives until it expires (300 s in the realm of the kit). A project that
|
|
45
|
+
* wants no window checks the account at the edge. The last owner of an organisation is refused:
|
|
46
|
+
* they appoint another owner first. The provider is asked to disable the person once it is
|
|
47
|
+
* committed (`application/integration/handlers/`).
|
|
46
48
|
*/
|
|
47
49
|
async execute({ actor }: DeactivateAccountCommand): Promise<string> {
|
|
48
50
|
const account = await this.accountRepository.findById(actor.id);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { afterAll, beforeAll, beforeEach, describe, expect, it } from '{{tests.module}}';
|
|
2
|
-
{{#if di.
|
|
3
|
-
import { contextModule,
|
|
2
|
+
{{#if di.container}}
|
|
3
|
+
import { contextModule, kernelModule } from '@ddd-ts-kit/di';
|
|
4
|
+
import { createApplication } from '{{di.entry}}';
|
|
4
5
|
{{/if}}
|
|
5
|
-
{{#if di.
|
|
6
|
+
{{#if di.container}}
|
|
6
7
|
import {
|
|
7
8
|
FixedClock,
|
|
8
9
|
FixedExecutionScope,
|
|
@@ -13,10 +14,10 @@ import {
|
|
|
13
14
|
type ScheduledJob,
|
|
14
15
|
} from '@ddd-ts-kit/kernel';
|
|
15
16
|
{{/if}}
|
|
16
|
-
{{#unless di.
|
|
17
|
+
{{#unless di.container}}
|
|
17
18
|
import { FixedClock, FixedExecutionScope, executionContext, type Actor } from '@ddd-ts-kit/kernel';
|
|
18
19
|
{{/unless}}
|
|
19
|
-
{{#if di.
|
|
20
|
+
{{#if di.container}}
|
|
20
21
|
import { Scheduled } from '@ddd-ts-kit/kernel/declarations';
|
|
21
22
|
{{/if}}
|
|
22
23
|
import { {{preset.adapter.pascal}}OrganisationRepository } from '{{alias.context}}/infrastructure/persistence/{{preset.adapter.kebab}}-organisation.repository{{alias.ext}}';
|
|
@@ -67,7 +68,7 @@ describe('{{preset.adapter.pascal}}OrganisationTenantDirectory', () => {
|
|
|
67
68
|
await organisations.save(anOrganisation().identifiedBy('globex').build());
|
|
68
69
|
expect(await directory.tenants()).toEqual(['acme', 'globex']);
|
|
69
70
|
});
|
|
70
|
-
{{#if di.
|
|
71
|
+
{{#if di.container}}
|
|
71
72
|
|
|
72
73
|
it('gives an organisation opened after the boot its run of a per-tenant job', async () => {
|
|
73
74
|
const { organisations, directory } = arrange();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RoleBasedAuthorizer } from '@ddd-ts-kit/auth';
|
|
2
2
|
import { authorizationModule } from '@ddd-ts-kit/auth/di';
|
|
3
3
|
import { anActor } from '@ddd-ts-kit/auth/testing';
|
|
4
|
-
import { contextModule,
|
|
4
|
+
import { contextModule, fake } from '@ddd-ts-kit/di';
|
|
5
|
+
import { createTestApplication } from '{{di.entry}}';
|
|
5
6
|
import type { Actor } from '@ddd-ts-kit/kernel';
|
|
6
7
|
import * as {{context.camel}}Declarations from '{{alias.context}}/{{context.kebab}}.declarations{{alias.ext}}';
|
|
7
8
|
import { platformTestModule } from '{{alias.platform}}/composition/platform-test.module{{alias.ext}}';
|
|
@@ -9,8 +9,10 @@ what their token says (`PUT /accounts/me`) and refreshed at each later one. No p
|
|
|
9
9
|
of the provider is stored here. The email address of an account is always the one of the token,
|
|
10
10
|
never one a client sends, and one the provider verified (`email_verified`): an invitation is
|
|
11
11
|
matched on it. A deactivated account leaves every organisation and ends every delegation in the
|
|
12
|
-
same unit of work
|
|
13
|
-
|
|
12
|
+
same unit of work; the last owner of an organisation appoints another owner before deactivating.
|
|
13
|
+
This context refuses the account at once, the other contexts at its next token: they read the
|
|
14
|
+
token, and a token already issued lives until it expires (300 s in the realm of the kit). A
|
|
15
|
+
project that wants no window checks the account at the edge.
|
|
14
16
|
|
|
15
17
|
**Organisations, members and roles.** An organisation is opened under its slug, which is its
|
|
16
18
|
identity for good, and its opener is its first owner. A member holds one role, `owner`, `admin`
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
@@imports
|
|
2
|
-
{{#if di.
|
|
2
|
+
{{#if di.container}}
|
|
3
3
|
import { IdentityProviderAdmin } from '{{alias.context}}/application/ports/identity-provider-admin.port{{alias.ext}}';
|
|
4
4
|
{{/if}}
|
|
5
|
-
{{#unless di.
|
|
5
|
+
{{#unless di.container}}
|
|
6
6
|
import { {{context.camel}}Module } from '{{alias.context}}/{{context.kebab}}.module{{alias.ext}}';
|
|
7
7
|
{{/unless}}
|
|
8
8
|
import { FakeIdentityProviderAdmin } from '{{alias.context}}/test/fakes/identity-provider-admin.fake{{alias.ext}}';
|
|
9
9
|
@@e2e-fakes
|
|
10
|
-
{{#if di.
|
|
10
|
+
{{#if di.container}}
|
|
11
11
|
builder.rebind(IdentityProviderAdmin).toValue(new FakeIdentityProviderAdmin());
|
|
12
12
|
{{/if}}
|
|
13
|
-
{{#unless di.
|
|
13
|
+
{{#unless di.container}}
|
|
14
14
|
if (module === {{context.camel}}Module) {
|
|
15
15
|
return (platform) => {{context.camel}}Module(platform, { identityProvider: new FakeIdentityProviderAdmin() });
|
|
16
16
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Message } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { ChangeMemberRoleCommand } from '{{alias.context}}/application/commands/change-member-role/change-member-role.command{{alias.ext}}';
|
|
3
|
+
import { GrantDelegationCommand } from '{{alias.context}}/application/commands/grant-delegation/grant-delegation.command{{alias.ext}}';
|
|
4
|
+
import { InviteMemberCommand } from '{{alias.context}}/application/commands/invite-member/invite-member.command{{alias.ext}}';
|
|
5
|
+
import { OpenOrganisationCommand } from '{{alias.context}}/application/commands/open-organisation/open-organisation.command{{alias.ext}}';
|
|
6
|
+
import { RemoveMemberCommand } from '{{alias.context}}/application/commands/remove-member/remove-member.command{{alias.ext}}';
|
|
7
|
+
import { RevokeDelegationCommand } from '{{alias.context}}/application/commands/revoke-delegation/revoke-delegation.command{{alias.ext}}';
|
|
8
|
+
import { RevokeInvitationCommand } from '{{alias.context}}/application/commands/revoke-invitation/revoke-invitation.command{{alias.ext}}';
|
|
9
|
+
import { OrganisationSlug } from '{{alias.context}}/domain/value-objects/organisation-slug.vo{{alias.ext}}';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The organisation a command of the {{context.kebab}} context acts on, whose audit chain receives its
|
|
13
|
+
* entry once it succeeded, whatever organisation the token of its sender names: the owner of an
|
|
14
|
+
* organisation reads there who opened it, invited, removed, changed a role or lent a right in it.
|
|
15
|
+
* The entry of a failure, and the decision of the authorization, stay in the tenant of the token,
|
|
16
|
+
* since they record what the sender asked. Accepting or declining an invitation names its token
|
|
17
|
+
* only: the organisation it joins reads `{{context.kebab}}.member.joined` in its own chain.
|
|
18
|
+
*/
|
|
19
|
+
export function organisationOfCommand(message: Message): string | undefined {
|
|
20
|
+
if (message instanceof OpenOrganisationCommand) {
|
|
21
|
+
return OrganisationSlug.create(message.organisation.slug).value;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (
|
|
25
|
+
message instanceof ChangeMemberRoleCommand ||
|
|
26
|
+
message instanceof GrantDelegationCommand ||
|
|
27
|
+
message instanceof InviteMemberCommand ||
|
|
28
|
+
message instanceof RemoveMemberCommand ||
|
|
29
|
+
message instanceof RevokeDelegationCommand ||
|
|
30
|
+
message instanceof RevokeInvitationCommand
|
|
31
|
+
) {
|
|
32
|
+
return message.organisationId;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
@@ -12,7 +12,7 @@ export const {{aggregate.pascal}}Mapper = {
|
|
|
12
12
|
},
|
|
13
13
|
|
|
14
14
|
toRow(saved: {{aggregate.pascal}}): {{aggregate.pascal}}Columns {
|
|
15
|
-
// TODO(domain): flatten each value object of {{aggregate.pascal}}State into its columns; nothing of the row type leaves this file. A `jsonb` column holding an array or a string takes `
|
|
15
|
+
// TODO(domain): flatten each value object of {{aggregate.pascal}}State into its columns; nothing of the row type leaves this file. A `jsonb` column holding an array or a string takes `jsonColumn(value)` of `@ddd-ts-kit/knex` on Knex, where the other ORM serialize it.
|
|
16
16
|
{{#if personal.any}}
|
|
17
17
|
return {
|
|
18
18
|
id: saved.id,
|
|
File without changes
|
|
File without changes
|
/package/templates/architecture/{hosting.tsyringe.spec.ts.tpl → hosting.container.spec.ts.tpl}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/init/platform/files/{bind-files.tsyringe.ts.tpl → bind-files.container.ts.tpl}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/init/platform/privacy/{run-export.tsyringe.ts.tpl → run-export.container.ts.tpl}
RENAMED
|
File without changes
|
/package/templates/init/platform/privacy/{run-purge.tsyringe.ts.tpl → run-purge.container.ts.tpl}
RENAMED
|
File without changes
|
/package/templates/init/scripts/{privacy-erase.tsyringe.ts.tpl → privacy-erase.container.ts.tpl}
RENAMED
|
File without changes
|
/package/templates/init/scripts/{privacy-export.tsyringe.ts.tpl → privacy-export.container.ts.tpl}
RENAMED
|
File without changes
|
/package/templates/init/scripts/{privacy-purge.tsyringe.ts.tpl → privacy-purge.container.ts.tpl}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/process/{timeout-job.spec.tsyringe.ts.tpl → timeout-job.spec.container.ts.tpl}
RENAMED
|
File without changes
|
/package/templates/process/{timeout-job.wiring.tsyringe.tpl → timeout-job.wiring.container.tpl}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|