ddd-ts-kit 0.93.0 → 0.94.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.
Files changed (90) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.fr.md +2 -2
  3. package/README.md +1 -1
  4. package/dist/check/authz/modelled-permissions.d.ts +32 -0
  5. package/dist/check/authz/modelled-permissions.d.ts.map +1 -0
  6. package/dist/check/authz/modelled-permissions.js +169 -0
  7. package/dist/check/authz/modelled-permissions.js.map +1 -0
  8. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  9. package/dist/check/catalogue/architecture-rules.js +4 -0
  10. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  11. package/dist/check/explain/authz-docs.d.ts.map +1 -1
  12. package/dist/check/explain/authz-docs.js +17 -0
  13. package/dist/check/explain/authz-docs.js.map +1 -1
  14. package/dist/check/explain/scheduling-docs.d.ts.map +1 -1
  15. package/dist/check/explain/scheduling-docs.js +7 -0
  16. package/dist/check/explain/scheduling-docs.js.map +1 -1
  17. package/dist/check/fixtures/authz-resource-modelled-fixtures.d.ts +3 -0
  18. package/dist/check/fixtures/authz-resource-modelled-fixtures.d.ts.map +1 -0
  19. package/dist/check/fixtures/authz-resource-modelled-fixtures.js +194 -0
  20. package/dist/check/fixtures/authz-resource-modelled-fixtures.js.map +1 -0
  21. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  22. package/dist/check/fixtures/fixtures.js +2 -0
  23. package/dist/check/fixtures/fixtures.js.map +1 -1
  24. package/dist/check/fixtures/scheduling-fixtures.d.ts.map +1 -1
  25. package/dist/check/fixtures/scheduling-fixtures.js +69 -1
  26. package/dist/check/fixtures/scheduling-fixtures.js.map +1 -1
  27. package/dist/check/rules/authz-resource-modelled.d.ts +13 -0
  28. package/dist/check/rules/authz-resource-modelled.d.ts.map +1 -0
  29. package/dist/check/rules/authz-resource-modelled.js +128 -0
  30. package/dist/check/rules/authz-resource-modelled.js.map +1 -0
  31. package/dist/check/rules/scheduling-tenancy-declared.d.ts +3 -0
  32. package/dist/check/rules/scheduling-tenancy-declared.d.ts.map +1 -0
  33. package/dist/check/rules/scheduling-tenancy-declared.js +45 -0
  34. package/dist/check/rules/scheduling-tenancy-declared.js.map +1 -0
  35. package/dist/check/scheduling/job-names.d.ts +1 -1
  36. package/dist/check/scheduling/job-names.d.ts.map +1 -1
  37. package/dist/check/scheduling/job-names.js +3 -21
  38. package/dist/check/scheduling/job-names.js.map +1 -1
  39. package/dist/check/scheduling/jobs-declared.d.ts +11 -0
  40. package/dist/check/scheduling/jobs-declared.d.ts.map +1 -0
  41. package/dist/check/scheduling/jobs-declared.js +24 -0
  42. package/dist/check/scheduling/jobs-declared.js.map +1 -0
  43. package/dist/generate/access-vars.js +18 -0
  44. package/dist/generate/access-vars.js.map +1 -1
  45. package/dist/generate/kinds/job/grant-system-actor.js +2 -2
  46. package/dist/generate/kinds/job/grant-system-actor.js.map +1 -1
  47. package/dist/generate/kinds/job-kind.js +1 -1
  48. package/dist/generate/kinds/job-kind.js.map +1 -1
  49. package/dist/init/files/platform-files.js +1 -0
  50. package/dist/init/files/platform-files.js.map +1 -1
  51. package/dist/init/manifest/versions.js +24 -24
  52. package/dist/platform-layout/platform-layout.d.ts +1 -0
  53. package/dist/platform-layout/platform-layout.d.ts.map +1 -1
  54. package/dist/platform-layout/platform-layout.js +1 -0
  55. package/dist/platform-layout/platform-layout.js.map +1 -1
  56. package/dist/presets/apply-preset.d.ts.map +1 -1
  57. package/dist/presets/apply-preset.js +4 -0
  58. package/dist/presets/apply-preset.js.map +1 -1
  59. package/dist/presets/organisations-as-tenant-directory.d.ts +10 -0
  60. package/dist/presets/organisations-as-tenant-directory.d.ts.map +1 -0
  61. package/dist/presets/organisations-as-tenant-directory.js +16 -0
  62. package/dist/presets/organisations-as-tenant-directory.js.map +1 -0
  63. package/dist/version.d.ts +1 -1
  64. package/dist/version.js +1 -1
  65. package/package.json +4 -4
  66. package/templates/command/command.ts.tpl +3 -0
  67. package/templates/file-upload/command.ts.tpl +3 -0
  68. package/templates/init/docker/env.example.tpl +2 -1
  69. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +1 -1
  70. package/templates/init/platform/auth/relationships/relationship-schema.ts.tpl +24 -9
  71. package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +5 -5
  72. package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +13 -17
  73. package/templates/init/platform/composition/tenant-directory.ts.tpl +14 -0
  74. package/templates/init/platform/config/app-config.ts.tpl +1 -1
  75. package/templates/init/platform/files/files.module.tsyringe.ts.tpl +1 -1
  76. package/templates/init/platform/privacy/privacy.module.tsyringe.ts.tpl +1 -1
  77. package/templates/init/scripts/privacy-erase.manual.ts.tpl +18 -8
  78. package/templates/init/scripts/privacy-erase.tsyringe.ts.tpl +18 -8
  79. package/templates/init/scripts/privacy-export.manual.ts.tpl +17 -7
  80. package/templates/init/scripts/privacy-export.tsyringe.ts.tpl +17 -7
  81. package/templates/job/job.spec.tsyringe.ts.tpl +1 -1
  82. package/templates/pipeline/github/workflows/ci.yml.tpl +2 -0
  83. package/templates/pipeline/gitlab/gitlab-ci.yml.tpl +2 -0
  84. package/templates/pipeline/package-scripts.json +1 -1
  85. package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation-tenant-directory.reader.drizzle.ts.tpl +26 -0
  86. package/templates/presets/identity/context/infrastructure/persistence/knex-organisation-tenant-directory.reader.knex.ts.tpl +30 -0
  87. package/templates/presets/identity/context/infrastructure/persistence/prisma-organisation-tenant-directory.reader.prisma.ts.tpl +25 -0
  88. package/templates/presets/identity/context/test/integration/organisation-tenant-directory.spec.ts.tpl +107 -0
  89. package/templates/presets/identity/platform/tenant-directory.ts.tpl +13 -0
  90. package/templates/query/query.ts.tpl +3 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,60 @@ What each version changes for someone who uses the kit. The packages of `package
4
4
  together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
5
5
  list the pull requests behind it.
6
6
 
7
+ ## 0.94.0
8
+
9
+ **The rules of `@ddd-ts-kit/eslint-plugin` run whole when Oxlint loads the plugin as a JS plugin.** Oxlint hands a rule no type information and a parser that parses nothing. `naming-business-name` threw there, which stopped every rule of the kit on the file (303 of 985 files of a generated application); it now reads the names of the code when the linter offers no parser services, as it already did without a program. `clean-no-commented-out-code`, `language-declared-vocabulary`, `authz-declared` and `ports-implements-never-extends`, which parse a text of their own, reported nothing under Oxlint; they now parse with the parser of typescript-eslint when the run configured none (or only the stand-in of Oxlint). The findings under ESLint do not change. On the copy of the example with every rule of the catalogue broken once, Oxlint reports the 77 injections ESLint reports, each at the same place.
10
+
11
+ **Under relationships, a permission modelled on an element is no longer held by the operators of the context, and a use case on the context says so.** `generate command` and `generate query` write, next to the `{ type: 'context', id: '<context>' }` resource, a `TODO(domain)` naming the element the permission is checked on (`{ type: '<aggregate>', id: <message>.<aggregate>Id }`), so `ddd-ts-kit todo` and `status` list it until the resource names it; a search keeps the context. The schema written by `init` derives on `context` only the permissions no element derives: the elements go in `elements` of `relationships/relationship-schema.ts`, and a permission derived there leaves the operators of the context, where it used to be granted to all of them whatever the element. The access-control skill and the guide on choosing access control say when the context is the right resource.
12
+
13
+ `authz/resource-modelled` (an error under relationships, from the first day) reports a requirement whose resource is the context for a permission the relationship schema derives on an element type, and a search whose gate is on the context while its scope asks the same permission derived on the element; it reads the types written in `elements` or in place in `defineSchema`, and reports a schema or a resource it cannot read.
14
+
15
+ To move: in a project generated earlier, open `relationships/relationship-schema.ts`: move the types of the elements out of `defineSchema` into an `elements` object and derive on `context` only `permissions.all()` minus the ids those elements derive (the template of `init` shows it), then replace each context resource by the element the use case is about. A search whose requirement and scope use the same permission needs two: one on the context, one on the element. Then run `ddd-ts-kit check`: name the element in each reported requirement, give a search two permissions (one on the context to run it, one on the element for the scope), or make the schema readable (an object literal given to `defineSchema`, derived keys as `[<context>Permissions['<permission>'].id]`).
16
+
17
+ **`generate job` under relationships relates the system actor of the job as `system:<job>`, not `system:system:<job>`.**
18
+
19
+ The tuple written in `platform/auth/relationships/relate-system-actors.ts` carried the prefix
20
+ twice, so the actor of the job (`system:<context>.<job>`) held no right and every run was refused
21
+ `FORBIDDEN` before its handler ran.
22
+
23
+ To move: a job generated before this version has `system:system:` in its line of
24
+ `relate-system-actors.ts`: remove one `system:`.
25
+
26
+ **With the identity preset, a per-tenant job runs for every organisation, including one opened after the process started.**
27
+
28
+ Until now `init` gave the scheduler the tenants of `TENANTS`, read once when the process
29
+ started: an organisation created later (a sign-up, an operator) never got the run of a per-tenant
30
+ job (a reminder, a purge, a deadline), with no error and no log. `init` under tenancy now writes
31
+ `src/platform/composition/tenant-directory.ts`, the one place the scheduler's `TenantDirectory`
32
+ is made; `--preset identity` (and `generate context --preset identity`) replaces it by a
33
+ directory that reads the organisations of the identity context from the database at each
34
+ occurrence, on Drizzle, Knex and Prisma (the preset refuses TypeORM). A project with tenancy and
35
+ no source of tenants keeps `TENANTS`, and the documentation says plainly that a fixed list misses
36
+ a tenant created later. The adapter is integration-tested on PostgreSQL, including an
37
+ organisation opened after the first read and, on tsyringe, its run of a per-tenant job.
38
+
39
+ `privacy:erase` and `privacy:export` go through the same directory: with the identity preset they
40
+ reach the organisations of the database, not only the tenants of `TENANTS`, and they refuse to
41
+ run when the directory lists none.
42
+
43
+ A per-tenant run reading its own tenant only is now proven end to end on the real tenant-scoped
44
+ repository of a generated multi-tenant project, and the generated job spec points to that
45
+ pattern where it kept an `it.todo`.
46
+
47
+ To move: a project with tenancy regenerates its platform; a project that already holds the
48
+ identity preset and tenancy replaces `src/platform/composition/tenant-directory.ts` (or, before
49
+ this version, the `InMemoryTenantDirectory` bound in `compose-application.ts` or
50
+ `lay-foundations.ts`) by a directory over `<Orm>OrganisationTenantDirectory`. `TENANTS` is no
51
+ longer read once the organisations are the tenants.
52
+
53
+ **`scheduling/tenancy-declared` reports a job that does not say whether it runs per tenant or globally.** In a project whose `stack.tenancy` is not `none`, the options of every `@Scheduled(..)` and `builder.job(..)` must carry `tenancy: 'per-tenant'` or `tenancy: 'global'`. A job that leaves it out runs globally, in no tenant, as a system actor that names none, and a tenant-scoped repository refuses it at run time (`NoCurrentTenantError`) while the specs on fakes stay green. An error from the first day, with the fix in the message; what the checker cannot read (options that are not an object literal, a spread, a `tenancy` that is not a literal) is reported, never passed. The jobs `init` registers in the platform (`files.purge-staged`, `privacy.purge-expired`, `audit.archive`) now write `tenancy: 'global'`, which is what they already did by default.
54
+
55
+ To move: run `ddd-ts-kit check` in a project under tenancy and add `tenancy: 'per-tenant'` to each reported job that reads or writes tenant data (the `TenantDirectory` must be bound so the scheduler can list the tenants), or `tenancy: 'global'` to a job that works across tenants and reaches no tenant-scoped repository.
56
+
57
+ **The mutation job of a merge request or pull request in a generated project reuses the report of the night.** The night runs Stryker without a base, so it writes `reports/mutation/mutation.json` and no incremental file, and the job of a change that downloaded that report found nothing to reuse: it logged "No incremental result file found" and ran every mutant. The job now copies the json report to `reports/mutation/incremental.json` before it runs, the same object Stryker reads back, and mutates what the change touches only. On the example of the kit this takes the job from 1,133 s to about 140 s.
58
+
59
+ To move: in a project generated before this version, add one step after the download of the report of the night, in the `mutation-changed` job of `.github/workflows/ci.yml` or the `mutation_changed` job of `.gitlab-ci.yml`: `if [ -f reports/mutation/mutation.json ]; then cp reports/mutation/mutation.json reports/mutation/incremental.json; fi`. Or run `ddd-ts-kit init` in a scratch copy and take the job from there.
60
+
7
61
  ## 0.93.0
8
62
 
9
63
  **The behaviour pages of `ddd-ts-kit docs` no longer open a rule with the row ids and criteria of its title.** A regression spec named `#FIX1 escalates ...` or an acceptance scenario named `#US1.04 AC1 a member declares ...` is written in `docs/behaviour/` as `escalates ...` and `a member declares ...`, read with the patterns `acceptance` uses for rows and criteria; the rest of the title is kept as it is.
package/README.fr.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [English](README.md) · **Français**
2
- <!-- translation-of: README.md sha256:625e334eec9dcf53 -->
2
+ <!-- translation-of: README.md sha256:1a299156421ce74c -->
3
3
 
4
4
  # ddd-ts-kit
5
5
 
@@ -809,7 +809,7 @@ Next, in this order: the language of the context first, then the business decisi
809
809
  donne à chaque acteur système (`systemRole`) ; `--authz abac`, une règle
810
810
  `permit('system-<job>', [permission], ({ actor }) => actor.id === 'system:<job>')` dans
811
811
  `platform/auth/attributes/attribute-policies.ts` ; `--authz rebac`, le tuple
812
- `context:<context>#operator@system:system:<job>` dans `platform/auth/relationships/relate-system-actors.ts`,
812
+ `context:<context>#operator@system:<job>` dans `platform/auth/relationships/relate-system-actors.ts`,
813
813
  écrit dans le magasin de tuples au démarrage de l'application, tant que le schéma laisse encore
814
814
  un sujet `system` opérer un contexte. Avec `--authz custom`, une région supprimée, un schéma de
815
815
  relations remodelé ou une permission que le générateur ne sait pas lire, rien n'est écrit et le
package/README.md CHANGED
@@ -780,7 +780,7 @@ Next, in this order: the language of the context first, then the business decisi
780
780
  the role `createAuthorizer` gives every system actor (`systemRole`); `--authz abac`, a
781
781
  `permit('system-<job>', [permission], ({ actor }) => actor.id === 'system:<job>')` rule in
782
782
  `platform/auth/attributes/attribute-policies.ts`; `--authz rebac`, the tuple
783
- `context:<context>#operator@system:system:<job>` in `platform/auth/relationships/relate-system-actors.ts`,
783
+ `context:<context>#operator@system:<job>` in `platform/auth/relationships/relate-system-actors.ts`,
784
784
  written to the tuple store when the application starts, as long as the schema still lets a
785
785
  `system` subject operate a context. With `--authz custom`, a removed region, a remodelled
786
786
  relationship schema or a permission the generator cannot read, nothing is written and the job
@@ -0,0 +1,32 @@
1
+ import type { SourceFile } from '../model/source-file.js';
2
+ import type { PermissionSet } from './permission-sets.js';
3
+ /** A permission a type of the relationship schema derives: the right is decided on that type. */
4
+ export interface ModelledPermission {
5
+ /** The id of the permission, `billing:invoice.view`. */
6
+ readonly id: string;
7
+ readonly type: string;
8
+ }
9
+ /** A part of the schema the checker cannot read, and where it stands. */
10
+ interface UnreadSchema {
11
+ readonly line: number;
12
+ readonly what: string;
13
+ }
14
+ export interface ModelledSchema {
15
+ readonly file: SourceFile;
16
+ readonly modelled: readonly ModelledPermission[];
17
+ readonly unread: readonly UnreadSchema[];
18
+ /** Whether the operators of the context hold this permission: the context derives it, or every permission no element derives. */
19
+ contextHolds(id: string): boolean;
20
+ }
21
+ /**
22
+ * The permissions the types other than `context` derive in the relationship schema, read from
23
+ * the object given to `defineSchema`: the types written in place, and those of an `elements`
24
+ * object the schema spreads. A derived relation named after a permission is a string key
25
+ * (`'billing:invoice.view'`) or a computed one (`[billingPermissions['invoice.view'].id]`, or a
26
+ * constant of the file holding it). A relation named otherwise (`edit`) grants no permission.
27
+ * Anything else (a schema built by a call, another spread, a type held elsewhere, a key computed
28
+ * in another way) is unread, and said so.
29
+ */
30
+ export declare function modelledPermissions(file: SourceFile, sets: readonly PermissionSet[]): ModelledSchema;
31
+ export {};
32
+ //# sourceMappingURL=modelled-permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelled-permissions.d.ts","sourceRoot":"","sources":["../../../src/check/authz/modelled-permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAUvD,iGAAiG;AACjG,MAAM,WAAW,kBAAkB;IACjC,wDAAwD;IACxD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,yEAAyE;AACzE,UAAU,YAAY;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACjD,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,iIAAiI;IACjI,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;CACnC;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,aAAa,EAAE,GAAG,cAAc,CAcpG"}
@@ -0,0 +1,169 @@
1
+ import { callArguments } from '../text/call-arguments.js';
2
+ import { matchingBracket } from '../text/matching-bracket.js';
3
+ const DEFINE_SCHEMA = /\bdefineSchema\s*\(/;
4
+ const IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
5
+ const SPREAD = /^\.\.\.\s*([A-Za-z_$][\w$]*)$/;
6
+ const PROPERTY = /^([A-Za-z_$][\w$]*)\s*:\s*/;
7
+ const DERIVED = /^derived\s*:\s*/;
8
+ /** `billingPermissions['invoice.view'].id`, the key of a derived relation named after a permission. */
9
+ const PERMISSION_ID = /^([A-Za-z_$][\w$]*)\s*\[\s*$/;
10
+ /**
11
+ * The permissions the types other than `context` derive in the relationship schema, read from
12
+ * the object given to `defineSchema`: the types written in place, and those of an `elements`
13
+ * object the schema spreads. A derived relation named after a permission is a string key
14
+ * (`'billing:invoice.view'`) or a computed one (`[billingPermissions['invoice.view'].id]`, or a
15
+ * constant of the file holding it). A relation named otherwise (`edit`) grants no permission.
16
+ * Anything else (a schema built by a call, another spread, a type held elsewhere, a key computed
17
+ * in another way) is unread, and said so.
18
+ */
19
+ export function modelledPermissions(file, sets) {
20
+ const reader = new Reader(file, sets);
21
+ reader.schema();
22
+ return {
23
+ file,
24
+ modelled: reader.modelled,
25
+ unread: reader.unread,
26
+ contextHolds: (id) => reader.context.all ||
27
+ reader.context.listed.includes(id) ||
28
+ (reader.context.unmodelled && !reader.modelled.some((entry) => entry.id === id)),
29
+ };
30
+ }
31
+ class Reader {
32
+ file;
33
+ sets;
34
+ modelled = [];
35
+ unread = [];
36
+ /** What the type `context` derives: every permission, every one no element derives, or the ones it lists. */
37
+ context = {
38
+ all: false,
39
+ unmodelled: false,
40
+ listed: [],
41
+ };
42
+ constructor(file, sets) {
43
+ this.file = file;
44
+ this.sets = sets;
45
+ }
46
+ schema() {
47
+ const { code } = this.file.scan;
48
+ const call = DEFINE_SCHEMA.exec(code);
49
+ if (call === null) {
50
+ this.refuse(0, 'the schema is not built by a call of defineSchema in this file');
51
+ return;
52
+ }
53
+ const argument = callArguments(code, call.index + call[0].length - 1)[0];
54
+ if (argument === undefined || !argument.code.startsWith('{')) {
55
+ this.refuse(call.index, 'the types are not an object literal given to defineSchema');
56
+ return;
57
+ }
58
+ this.types(argument, 0);
59
+ }
60
+ types(object, depth) {
61
+ for (const property of callArguments(this.file.scan.code, object.start)) {
62
+ this.type(property, depth);
63
+ }
64
+ }
65
+ type(property, depth) {
66
+ const spread = SPREAD.exec(property.code)?.[1];
67
+ if (spread !== undefined) {
68
+ this.spread(spread, property, depth);
69
+ return;
70
+ }
71
+ const key = PROPERTY.exec(property.code);
72
+ if (key === null) {
73
+ this.refuse(property.start, `\`${property.code}\` is not a type written as \`name: { ... }\``);
74
+ return;
75
+ }
76
+ const value = property.code.slice(key[0].length);
77
+ if (!value.startsWith('{')) {
78
+ this.refuse(property.start, `the type \`${key[1] ?? ''}\` is not an object literal`);
79
+ return;
80
+ }
81
+ this.derivedOn(key[1] ?? '', { code: value, start: property.start + key[0].length });
82
+ }
83
+ spread(name, at, depth) {
84
+ const declaration = new RegExp(`\\b(?:const|let|var)\\s+${name}\\b[^=;]*=\\s*(?=\\{)`).exec(this.file.scan.code);
85
+ if (name !== 'elements' || declaration === null || depth > 0) {
86
+ this.refuse(at.start, `\`...${name}\` is not the \`elements\` object of this file`);
87
+ return;
88
+ }
89
+ const start = declaration.index + declaration[0].length;
90
+ this.types({ code: this.file.scan.code.slice(start), start }, depth + 1);
91
+ }
92
+ derivedOn(type, object) {
93
+ const derived = callArguments(this.file.scan.code, object.start).find(({ code }) => DERIVED.test(code));
94
+ if (derived === undefined) {
95
+ return;
96
+ }
97
+ const value = derived.code.replace(DERIVED, '');
98
+ const start = derived.start + derived.code.length - value.length;
99
+ if (type === 'context') {
100
+ this.contextDerives(value, start);
101
+ return;
102
+ }
103
+ if (!value.startsWith('{')) {
104
+ this.refuse(derived.start, `the relations \`${type}\` derives are not an object literal`);
105
+ return;
106
+ }
107
+ for (const relation of callArguments(this.file.scan.code, start)) {
108
+ this.relation(type, relation);
109
+ }
110
+ }
111
+ /** `Object.fromEntries(permissions.all()...)` holds every permission, with a `.filter(` the ones no element derives. */
112
+ contextDerives(value, start) {
113
+ if (value.startsWith('{')) {
114
+ const before = this.modelled.length;
115
+ for (const relation of callArguments(this.file.scan.code, start)) {
116
+ this.relation('context', relation);
117
+ }
118
+ this.context.listed.push(...this.modelled.splice(before).map(({ id }) => id));
119
+ }
120
+ else if (value.startsWith('Object.fromEntries(')) {
121
+ this.context.all = !value.includes('.filter(');
122
+ this.context.unmodelled = value.includes('.filter(');
123
+ }
124
+ }
125
+ relation(type, relation) {
126
+ const { code, strings } = this.file.scan;
127
+ if (relation.code.startsWith('[')) {
128
+ const end = matchingBracket(code, relation.start);
129
+ const id = this.permissionId(code.slice(relation.start + 1, end), relation.start + 1);
130
+ if (id === undefined) {
131
+ this.refuse(relation.start, `the key \`${relation.code.slice(0, end - relation.start + 1)}\` of \`${type}\` is computed in a way the checker cannot resolve`);
132
+ }
133
+ else {
134
+ this.modelled.push({ id, type });
135
+ }
136
+ return;
137
+ }
138
+ const quoted = strings.find(({ start }) => start === relation.start)?.value;
139
+ if (quoted !== undefined && /^[\w-]+:/.test(quoted)) {
140
+ this.modelled.push({ id: quoted, type });
141
+ }
142
+ }
143
+ /** `billingPermissions['invoice.view'].id`, written in place or held in a constant of the file. */
144
+ permissionId(expression, at) {
145
+ const { code, strings } = this.file.scan;
146
+ const text = expression.trim();
147
+ const offset = at + expression.indexOf(text);
148
+ const open = text.indexOf('[');
149
+ if (open > 0 && PERMISSION_ID.test(text.slice(0, open + 1)) && /\]\s*\.id$/.test(text)) {
150
+ const set = this.sets.find(({ set: name }) => name === text.slice(0, open).trim());
151
+ const key = strings.find(({ start }) => start > offset + open && start < offset + text.length)?.value;
152
+ return set === undefined || key === undefined ? undefined : `${set.context}:${key}`;
153
+ }
154
+ if (!IDENTIFIER.test(text)) {
155
+ return undefined;
156
+ }
157
+ const held = new RegExp(`\\b(?:const|let|var)\\s+${text}\\b[^=;]*=\\s*`).exec(code);
158
+ if (held === null) {
159
+ return undefined;
160
+ }
161
+ const start = held.index + held[0].length;
162
+ const end = code.indexOf(';', start);
163
+ return end === -1 ? undefined : this.permissionId(code.slice(start, end), start);
164
+ }
165
+ refuse(offset, what) {
166
+ this.unread.push({ line: this.file.scan.lineAt(offset), what });
167
+ }
168
+ }
169
+ //# sourceMappingURL=modelled-permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelled-permissions.js","sourceRoot":"","sources":["../../../src/check/authz/modelled-permissions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,MAAM,aAAa,GAAG,qBAAqB,CAAC;AAC5C,MAAM,UAAU,GAAG,oBAAoB,CAAC;AACxC,MAAM,MAAM,GAAG,+BAA+B,CAAC;AAC/C,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAC9C,MAAM,OAAO,GAAG,iBAAiB,CAAC;AAClC,uGAAuG;AACvG,MAAM,aAAa,GAAG,8BAA8B,CAAC;AAuBrD;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAgB,EAAE,IAA8B;IAClF,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAEtC,MAAM,CAAC,MAAM,EAAE,CAAC;IAEhB,OAAO;QACL,IAAI;QACJ,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,MAAM,EAAE,MAAM,CAAC,MAA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,GAAG,EAAE,CAAC;QACtF,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,MAAM,CAAC,2BAA2B,IAAI,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEpF,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAErC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACnF,CAAC;IAEO,MAAM,CAAC,MAAc,EAAE,IAAY;QACzC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"architecture-rules.d.ts","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAwG1C,gHAAgH;AAChH,eAAO,MAAM,kBAAkB,EAAE,SAAS,IAAI,EAuG7C,CAAC"}
1
+ {"version":3,"file":"architecture-rules.d.ts","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AA0G1C,gHAAgH;AAChH,eAAO,MAAM,kBAAkB,EAAE,SAAS,IAAI,EAyG7C,CAAC"}
@@ -3,6 +3,7 @@ import { authzActorExplicit } from '../rules/authz-actor-explicit.js';
3
3
  import { authzFieldsBySchema } from '../rules/authz-fields-by-schema.js';
4
4
  import { authzDeclared } from '../rules/authz-declared.js';
5
5
  import { authzGranted } from '../rules/authz-granted.js';
6
+ import { authzResourceModelled } from '../rules/authz-resource-modelled.js';
6
7
  import { authzScopeNarrows } from '../rules/authz-scope-narrows.js';
7
8
  import { privacyDeclaredField } from '../rules/privacy-declared-field.js';
8
9
  import { privacyErasureReachesCopies } from '../rules/privacy-erasure-reaches-copies.js';
@@ -83,6 +84,7 @@ import { processSendsCommandsOnly } from '../rules/process-sends-commands-only.j
83
84
  import { purityNoAmbientRandomness } from '../rules/purity-no-ambient-randomness.js';
84
85
  import { purityNoEnvironment } from '../rules/purity-no-environment.js';
85
86
  import { purityNoSystemClock } from '../rules/purity-no-system-clock.js';
87
+ import { schedulingTenancyDeclared } from '../rules/scheduling-tenancy-declared.js';
86
88
  import { schedulingJobName } from '../rules/scheduling-job-name.js';
87
89
  import { schedulingJobTriggersUseCase } from '../rules/scheduling-job-triggers-use-case.js';
88
90
  import { schemaNoDuplicateShape } from '../rules/schema-no-duplicate-shape.js';
@@ -167,6 +169,7 @@ export const ARCHITECTURE_RULES = [
167
169
  authzPolicyAsked,
168
170
  authzGranted,
169
171
  authzScopeNarrows,
172
+ authzResourceModelled,
170
173
  privacyDeclaredField,
171
174
  privacyEventPayloadDeclared,
172
175
  privacyErasureReachesCopies,
@@ -194,6 +197,7 @@ export const ARCHITECTURE_RULES = [
194
197
  lifecycleStatusThroughMachine,
195
198
  processSendsCommandsOnly,
196
199
  schedulingJobName,
200
+ schedulingTenancyDeclared,
197
201
  importsAliasOnly,
198
202
  importsExtension,
199
203
  importsAliasDeclared,
@@ -1 +1 @@
1
- {"version":3,"file":"architecture-rules.js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Aa;IACb,sBAAsB;IACtB,oBAAoB;IACpB,wBAAwB;IACxB,4BAA4B;IAC5B,qCAAqC;IACrC,yBAAyB;IACzB,sBAAsB;IACtB,kCAAkC;IAClC,mCAAmC;IACnC,6BAA6B;IAC7B,kBAAkB;IAClB,aAAa;IACb,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,YAAY;IACZ,iBAAiB;IACjB,oBAAoB;IACpB,2BAA2B;IAC3B,2BAA2B;IAC3B,sBAAsB;IACtB,2BAA2B;IAC3B,gBAAgB;IAChB,mBAAmB;IACnB,sBAAsB;IACtB,2BAA2B;IAC3B,sBAAsB;IACtB,sBAAsB;IACtB,2BAA2B;IAC3B,uBAAuB;IACvB,uBAAuB;IACvB,wBAAwB;IACxB,yBAAyB;IACzB,gCAAgC;IAChC,4BAA4B;IAC5B,kBAAkB;IAClB,2BAA2B;IAC3B,oBAAoB;IACpB,yBAAyB;IACzB,gBAAgB;IAChB,4BAA4B;IAC5B,6BAA6B;IAC7B,wBAAwB;IACxB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,2BAA2B;IAC3B,wBAAwB;IACxB,0BAA0B;IAC1B,qBAAqB;CACtB,CAAC"}
1
+ {"version":3,"file":"architecture-rules.js","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,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AoB;IACpB,2BAA2B;IAC3B,2BAA2B;IAC3B,sBAAsB;IACtB,2BAA2B;IAC3B,gBAAgB;IAChB,mBAAmB;IACnB,sBAAsB;IACtB,2BAA2B;IAC3B,sBAAsB;IACtB,sBAAsB;IACtB,2BAA2B;IAC3B,uBAAuB;IACvB,uBAAuB;IACvB,wBAAwB;IACxB,yBAAyB;IACzB,gCAAgC;IAChC,4BAA4B;IAC5B,kBAAkB;IAClB,2BAA2B;IAC3B,oBAAoB;IACpB,yBAAyB;IACzB,gBAAgB;IAChB,4BAA4B;IAC5B,6BAA6B;IAC7B,wBAAwB;IACxB,iBAAiB;IACjB,yBAAyB;IACzB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,2BAA2B;IAC3B,wBAAwB;IACxB,0BAA0B;IAC1B,qBAAqB;CACtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"authz-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/authz-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiGxD,CAAC"}
1
+ {"version":3,"file":"authz-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/authz-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkHxD,CAAC"}
@@ -55,6 +55,23 @@ export class SearchDocumentsQuery extends AuthorizedQuery<SearchDocumentsResult>
55
55
  // contexts/docs/application/queries/search-documents/search-documents.handler.ts
56
56
  const scope = await this.access.scope(query.actor, docsPermissions['document.search'], 'document');
57
57
  // { kind: 'ids', ids: [...] }: the documents the actor reaches, an empty page for one who reaches none`,
58
+ },
59
+ 'authz/resource-modelled': {
60
+ why: "Under relationships, a requirement names the element its permission is checked on. The schema written by `init` derives on `context` only the permissions no element derives, so a permission modelled on an element (`service: { derived: { [cataloguePermissions['service.change'].id]: 'owning-member' } }`) is not held by the operators of the context: a requirement that still names `{ type: 'context' }` for it is refused to everybody, or, where the project's own bridge grants it to every member, the rule on the element is never asked and any member acts on any element, while every spec written as a member of the owning team stays green. A search whose gate and scope use the same permission has the same shape: the gate on the context fails once the permission is derived on the element, so it needs two permissions, one held on the context to run the search and one derived on the element for its scope. Judged: the permissions the types other than `context` derive in `<platformDir>/auth/relationships/relationship-schema.ts` (the types written in place or in the `elements` object), against the resource of every `@Requires`, `.requires(` and `requires(` outside the tests. What it cannot read is reported, never taken as safe: a schema built by a call, a spread other than `elements`, a key computed in another way, a resource that is not an object literal with a literal `type`. An error under relationships; silent with any other model.",
61
+ bad: `// platform/auth/relationships/relationship-schema.ts
62
+ const elements: SchemaDefinition = {
63
+ service: { relations: { owner: ['user'] }, derived: { [cataloguePermissions['service.change'].id]: 'owner' } },
64
+ };
65
+ // contexts/catalogue/application/commands/change-service/change-service.command.ts
66
+ @Requires(cataloguePermissions['service.change'], { resource: () => ({ type: 'context', id: 'catalogue' }) })
67
+ export class ChangeServiceCommand extends AuthorizedCommand<void> {}`,
68
+ good: `// contexts/catalogue/application/commands/change-service/change-service.command.ts
69
+ @Requires(cataloguePermissions['service.change'], {
70
+ resource: (command) => ({ type: 'service', id: command.serviceId }),
71
+ })
72
+ export class ChangeServiceCommand extends AuthorizedCommand<void> {
73
+ constructor(actor: Actor, readonly serviceId: string) { super(actor); }
74
+ }`,
58
75
  },
59
76
  'authz/policy-asked': {
60
77
  why: 'The bus checks the permission of a use case before its handler runs, with the identifier of the element at most: it cannot read the element. A policy is the part of the right that needs the element (only the issuer, not after closing), and it is evaluated only when the handler asks Access once the element is loaded. A handler that forgets to ask leaves the policy declared, tested and never applied, and nothing at run time says so. Judged: for every permission refined by a policy (@Policy or definePolicy in application/authorization/), the handlers in the folder of each command or query that requires it (@Requires, .requires(...) or requires(X, ...)) call authorize, decide or decideOn and name that permission in their code. The TODO(domain) the generator leaves in such a handler, naming the permission, is accepted, and so is a TODO(review) that names it: `ddd-ts-kit todo` lists both, and until it is done the authorization module refuses the result of the handler at run time (PolicyNotAskedError).',
@@ -1 +1 @@
1
- {"version":3,"file":"authz-docs.js","sourceRoot":"","sources":["../../../src/check/explain/authz-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAsC;IAC3D,gBAAgB,EAAE;QAChB,GAAG,EAAE,mvBAAmvB;QACxvB,GAAG,EAAE;;;mEAG0D;QAC/D,IAAI,EAAE;;;;;mEAKyD;KAChE;IACD,sBAAsB,EAAE;QACtB,GAAG,EAAE,q0BAAq0B;QAC10B,GAAG,EAAE;;;;;4DAKmD;QACxD,IAAI,EAAE;;;;;;sCAM4B;KACnC;IACD,eAAe,EAAE;QACf,GAAG,EAAE,koCAAkoC;QACvoC,GAAG,EAAE;;;;;8CAKqC;QAC1C,IAAI,EAAE;;;;;kFAKwE;KAC/E;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,uxDAAuxD;QAC5xD,GAAG,EAAE;;;oGAG2F;QAChG,IAAI,EAAE;;;;;wGAK8F;KACrG;IACD,oBAAoB,EAAE;QACpB,GAAG,EAAE,o/BAAo/B;QACz/B,GAAG,EAAE;;;;;gCAKuB;QAC5B,IAAI,EAAE;;;gCAGsB;KAC7B;IACD,sBAAsB,EAAE;QACtB,GAAG,EAAE,ykBAAykB;QAC9kB,GAAG,EAAE;;;;qDAI4C;QACjD,IAAI,EAAE;;;;;2GAKiG;KACxG;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,i1BAAi1B;QACt1B,GAAG,EAAE;;+FAEsF;QAC3F,IAAI,EAAE;;;;;IAKN;KACD;CACF,CAAC"}
1
+ {"version":3,"file":"authz-docs.js","sourceRoot":"","sources":["../../../src/check/explain/authz-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAsC;IAC3D,gBAAgB,EAAE;QAChB,GAAG,EAAE,mvBAAmvB;QACxvB,GAAG,EAAE;;;mEAG0D;QAC/D,IAAI,EAAE;;;;;mEAKyD;KAChE;IACD,sBAAsB,EAAE;QACtB,GAAG,EAAE,q0BAAq0B;QAC10B,GAAG,EAAE;;;;;4DAKmD;QACxD,IAAI,EAAE;;;;;;sCAM4B;KACnC;IACD,eAAe,EAAE;QACf,GAAG,EAAE,koCAAkoC;QACvoC,GAAG,EAAE;;;;;8CAKqC;QAC1C,IAAI,EAAE;;;;;kFAKwE;KAC/E;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,uxDAAuxD;QAC5xD,GAAG,EAAE;;;oGAG2F;QAChG,IAAI,EAAE;;;;;wGAK8F;KACrG;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,u6CAAu6C;QAC56C,GAAG,EAAE;;;;;;qEAM4D;QACjE,IAAI,EAAE;;;;;;EAMR;KACC;IACD,oBAAoB,EAAE;QACpB,GAAG,EAAE,o/BAAo/B;QACz/B,GAAG,EAAE;;;;;gCAKuB;QAC5B,IAAI,EAAE;;;gCAGsB;KAC7B;IACD,sBAAsB,EAAE;QACtB,GAAG,EAAE,ykBAAykB;QAC9kB,GAAG,EAAE;;;;qDAI4C;QACjD,IAAI,EAAE;;;;;2GAKiG;KACxG;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,i1BAAi1B;QACt1B,GAAG,EAAE;;+FAEsF;QAC3F,IAAI,EAAE;;;;;IAKN;KACD;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"scheduling-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/scheduling-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAwC7D,CAAC"}
1
+ {"version":3,"file":"scheduling-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/scheduling-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA+C7D,CAAC"}
@@ -38,5 +38,12 @@ new SendRemindersCommand(systemActor('billing.reminders'), execution.scheduledAt
38
38
  builder.job('billing.send-reminders', { every: '15m' }).handledBy(SendRemindersJob, [CommandBus]);
39
39
  new SendRemindersCommand(systemActor('billing.send-reminders'), execution.scheduledAt);`,
40
40
  },
41
+ 'scheduling/tenancy-declared': {
42
+ why: "Under tenancy, a job that declares no `tenancy` runs globally: one run per occurrence, in no tenant, as a system actor that names none. The tenant-scoped repository the handler reads refuses it at run time (`NoCurrentTenantError`), and the specs that use fakes never see it. The job says which it is: `tenancy: 'per-tenant'` runs it once per tenant of the `TenantDirectory`, each run in the execution scope of that tenant, so it reads one tenant at a time and one failing tenant does not stop the others; `tenancy: 'global'` is work across tenants, chosen on purpose. Judged on the options of every `@Scheduled(..)` and `builder.job(..)` outside the tests, in a project whose `stack.tenancy` is not `none`. What it cannot read is reported, never taken as safe: options that are not an object literal, a spread or a computed key in them, a `tenancy` that is not the literal `'per-tenant'` or `'global'`. An error from the first day.",
43
+ bad: `@Scheduled('billing.send-reminders', { every: '15m' })
44
+ export class SendRemindersJob implements ScheduledJob {}`,
45
+ good: `@Scheduled('billing.send-reminders', { every: '15m', tenancy: 'per-tenant' })
46
+ export class SendRemindersJob implements ScheduledJob {}`,
47
+ },
41
48
  };
42
49
  //# sourceMappingURL=scheduling-docs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scheduling-docs.js","sourceRoot":"","sources":["../../../src/check/explain/scheduling-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAsC;IAChE,kCAAkC,EAAE;QAClC,GAAG,EAAE,2dAA2d;QAChe,GAAG,EAAE;;;;;;;;;;;;;;;EAeP;QACE,IAAI,EAAE;;;;;;;;EAQR;KACC;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,+fAA+f;QACpgB,GAAG,EAAE;;;;mFAI0E;QAC/E,IAAI,EAAE;;wFAE8E;KACrF;CACF,CAAC"}
1
+ {"version":3,"file":"scheduling-docs.js","sourceRoot":"","sources":["../../../src/check/explain/scheduling-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAsC;IAChE,kCAAkC,EAAE;QAClC,GAAG,EAAE,2dAA2d;QAChe,GAAG,EAAE;;;;;;;;;;;;;;;EAeP;QACE,IAAI,EAAE;;;;;;;;EAQR;KACC;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,+fAA+f;QACpgB,GAAG,EAAE;;;;mFAI0E;QAC/E,IAAI,EAAE;;wFAE8E;KACrF;IACD,6BAA6B,EAAE;QAC7B,GAAG,EAAE,q6BAAq6B;QAC16B,GAAG,EAAE;yDACgD;QACrD,IAAI,EAAE;yDAC+C;KACtD;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Fixture } from './fixture.js';
2
+ export declare const AUTHZ_RESOURCE_MODELLED_FIXTURES: readonly Fixture[];
3
+ //# sourceMappingURL=authz-resource-modelled-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authz-resource-modelled-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/authz-resource-modelled-fixtures.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyCzC,eAAO,MAAM,gCAAgC,EAAE,SAAS,OAAO,EA8J9D,CAAC"}