ddd-ts-kit 0.17.0 → 0.19.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 +1273 -0
- package/README.fr.md +11 -12
- package/README.md +10 -10
- package/dist/affected/reach-of.js +1 -1
- package/dist/affected/reach-of.js.map +1 -1
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +4 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/declarations/declared-event-handlers.d.ts +4 -9
- package/dist/check/declarations/declared-event-handlers.d.ts.map +1 -1
- package/dist/check/declarations/declared-event-handlers.js +5 -5
- package/dist/check/declarations/declared-event-handlers.js.map +1 -1
- package/dist/check/declarations/option-of.d.ts +0 -2
- package/dist/check/declarations/option-of.d.ts.map +1 -1
- package/dist/check/declarations/option-of.js +1 -7
- package/dist/check/declarations/option-of.js.map +1 -1
- package/dist/check/explain/authz-docs.d.ts.map +1 -1
- package/dist/check/explain/authz-docs.js +14 -1
- package/dist/check/explain/authz-docs.js.map +1 -1
- package/dist/check/explain/events-docs.d.ts.map +1 -1
- package/dist/check/explain/events-docs.js +44 -13
- package/dist/check/explain/events-docs.js.map +1 -1
- package/dist/check/explain/ports-docs.d.ts.map +1 -1
- package/dist/check/explain/ports-docs.js +11 -9
- package/dist/check/explain/ports-docs.js.map +1 -1
- package/dist/check/explain/scheduling-docs.d.ts.map +1 -1
- package/dist/check/explain/scheduling-docs.js +10 -5
- package/dist/check/explain/scheduling-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.js +4 -4
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.d.ts +3 -0
- package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/authz-policy-fixtures.js +97 -0
- package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -0
- package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.js +2 -42
- package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
- package/dist/check/fixtures/declared.d.ts.map +1 -1
- package/dist/check/fixtures/declared.js +3 -3
- package/dist/check/fixtures/declared.js.map +1 -1
- package/dist/check/fixtures/domain-events-fixtures.js +1 -1
- package/dist/check/fixtures/domain-events-fixtures.js.map +1 -1
- package/dist/check/fixtures/event-sourcing-fixtures.js +3 -3
- package/dist/check/fixtures/event-sourcing-fixtures.js.map +1 -1
- package/dist/check/fixtures/events-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/events-fixtures.js +30 -1
- package/dist/check/fixtures/events-fixtures.js.map +1 -1
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +2 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/language-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/language-fixtures.js +1 -1
- package/dist/check/fixtures/language-fixtures.js.map +1 -1
- package/dist/check/rules/authz-policy-asked.d.ts +3 -0
- package/dist/check/rules/authz-policy-asked.d.ts.map +1 -0
- package/dist/check/rules/authz-policy-asked.js +184 -0
- package/dist/check/rules/authz-policy-asked.js.map +1 -0
- package/dist/check/rules/declarations-role-declared.d.ts.map +1 -1
- package/dist/check/rules/declarations-role-declared.js +4 -35
- package/dist/check/rules/declarations-role-declared.js.map +1 -1
- package/dist/check/rules/events-consumer-idempotent.js +3 -3
- package/dist/check/rules/events-consumer-idempotent.js.map +1 -1
- package/dist/check/rules/events-name-declared-once.d.ts +3 -0
- package/dist/check/rules/events-name-declared-once.d.ts.map +1 -0
- package/dist/check/rules/events-name-declared-once.js +51 -0
- package/dist/check/rules/events-name-declared-once.js.map +1 -0
- package/dist/generate/emit.d.ts.map +1 -1
- package/dist/generate/emit.js +2 -14
- package/dist/generate/emit.js.map +1 -1
- package/dist/generate/kinds/ask-policy-in-generated-use-case.d.ts +9 -0
- package/dist/generate/kinds/ask-policy-in-generated-use-case.d.ts.map +1 -0
- package/dist/generate/kinds/ask-policy-in-generated-use-case.js +102 -0
- package/dist/generate/kinds/ask-policy-in-generated-use-case.js.map +1 -0
- package/dist/generate/kinds/assert-declares-its-name.d.ts +9 -0
- package/dist/generate/kinds/assert-declares-its-name.d.ts.map +1 -0
- package/dist/generate/kinds/assert-declares-its-name.js +16 -0
- package/dist/generate/kinds/assert-declares-its-name.js.map +1 -0
- package/dist/generate/kinds/command-context.d.ts +12 -0
- package/dist/generate/kinds/command-context.d.ts.map +1 -0
- package/dist/generate/kinds/command-context.js +18 -0
- package/dist/generate/kinds/command-context.js.map +1 -0
- package/dist/generate/kinds/command-kind.d.ts.map +1 -1
- package/dist/generate/kinds/command-kind.js +7 -24
- package/dist/generate/kinds/command-kind.js.map +1 -1
- package/dist/generate/kinds/command-outputs.d.ts +6 -0
- package/dist/generate/kinds/command-outputs.d.ts.map +1 -0
- package/dist/generate/kinds/command-outputs.js +13 -0
- package/dist/generate/kinds/command-outputs.js.map +1 -0
- package/dist/generate/kinds/declares-its-name.d.ts +5 -0
- package/dist/generate/kinds/declares-its-name.d.ts.map +1 -0
- package/dist/generate/kinds/declares-its-name.js +7 -0
- package/dist/generate/kinds/declares-its-name.js.map +1 -0
- package/dist/generate/kinds/event-file-of.d.ts +5 -0
- package/dist/generate/kinds/event-file-of.d.ts.map +1 -0
- package/dist/generate/kinds/event-file-of.js +5 -0
- package/dist/generate/kinds/event-file-of.js.map +1 -0
- package/dist/generate/kinds/event-handler-kind.d.ts.map +1 -1
- package/dist/generate/kinds/event-handler-kind.js +2 -0
- package/dist/generate/kinds/event-handler-kind.js.map +1 -1
- package/dist/generate/kinds/event-name-reference.d.ts +4 -3
- package/dist/generate/kinds/event-name-reference.d.ts.map +1 -1
- package/dist/generate/kinds/event-name-reference.js +6 -6
- package/dist/generate/kinds/event-name-reference.js.map +1 -1
- package/dist/generate/kinds/integration-event-kind.d.ts.map +1 -1
- package/dist/generate/kinds/integration-event-kind.js +2 -0
- package/dist/generate/kinds/integration-event-kind.js.map +1 -1
- package/dist/generate/kinds/policy-kind.d.ts.map +1 -1
- package/dist/generate/kinds/policy-kind.js +2 -0
- package/dist/generate/kinds/policy-kind.js.map +1 -1
- package/dist/generate/kinds/query-context.d.ts +9 -0
- package/dist/generate/kinds/query-context.d.ts.map +1 -0
- package/dist/generate/kinds/query-context.js +27 -0
- package/dist/generate/kinds/query-context.js.map +1 -0
- package/dist/generate/kinds/query-kind.d.ts.map +1 -1
- package/dist/generate/kinds/query-kind.js +16 -52
- package/dist/generate/kinds/query-kind.js.map +1 -1
- package/dist/generate/kinds/query-outputs.d.ts +8 -0
- package/dist/generate/kinds/query-outputs.d.ts.map +1 -0
- package/dist/generate/kinds/query-outputs.js +20 -0
- package/dist/generate/kinds/query-outputs.js.map +1 -0
- package/dist/generate/kinds/reader-file.d.ts +8 -0
- package/dist/generate/kinds/reader-file.d.ts.map +1 -0
- package/dist/generate/kinds/reader-file.js +9 -0
- package/dist/generate/kinds/reader-file.js.map +1 -0
- package/dist/generate/mark-policy-questions.d.ts +10 -0
- package/dist/generate/mark-policy-questions.d.ts.map +1 -0
- package/dist/generate/mark-policy-questions.js +76 -0
- package/dist/generate/mark-policy-questions.js.map +1 -0
- package/dist/generate/permission-pattern.d.ts +4 -0
- package/dist/generate/permission-pattern.d.ts.map +1 -0
- package/dist/generate/permission-pattern.js +7 -0
- package/dist/generate/permission-pattern.js.map +1 -0
- package/dist/generate/refined-by-policy.d.ts +4 -0
- package/dist/generate/refined-by-policy.d.ts.map +1 -0
- package/dist/generate/refined-by-policy.js +9 -0
- package/dist/generate/refined-by-policy.js.map +1 -0
- package/dist/generate/rendered.d.ts +5 -0
- package/dist/generate/rendered.d.ts.map +1 -0
- package/dist/generate/rendered.js +18 -0
- package/dist/generate/rendered.js.map +1 -0
- package/dist/generate/wire.d.ts.map +1 -1
- package/dist/generate/wire.js +3 -25
- package/dist/generate/wire.js.map +1 -1
- package/dist/generate/wirings.d.ts +8 -0
- package/dist/generate/wirings.d.ts.map +1 -0
- package/dist/generate/wirings.js +28 -0
- package/dist/generate/wirings.js.map +1 -0
- package/dist/init/copilot-instruction.d.ts +6 -0
- package/dist/init/copilot-instruction.d.ts.map +1 -0
- package/dist/init/copilot-instruction.js +15 -0
- package/dist/init/copilot-instruction.js.map +1 -0
- package/dist/init/files/guidance-files.d.ts +1 -0
- package/dist/init/files/guidance-files.d.ts.map +1 -1
- package/dist/init/files/guidance-files.js +4 -3
- package/dist/init/files/guidance-files.js.map +1 -1
- package/dist/init/files/layer-rules.d.ts +3 -0
- package/dist/init/files/layer-rules.d.ts.map +1 -0
- package/dist/init/files/layer-rules.js +11 -0
- package/dist/init/files/layer-rules.js.map +1 -0
- package/dist/init/files/pipeline-files.d.ts.map +1 -1
- package/dist/init/files/pipeline-files.js +2 -0
- package/dist/init/files/pipeline-files.js.map +1 -1
- package/dist/init/json-object.d.ts +3 -0
- package/dist/init/json-object.d.ts.map +1 -0
- package/dist/init/json-object.js +12 -0
- package/dist/init/json-object.js.map +1 -0
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +4 -0
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/write-agent-settings.d.ts.map +1 -1
- package/dist/init/write-agent-settings.js +3 -10
- package/dist/init/write-agent-settings.js.map +1 -1
- package/dist/init/write-copilot-instructions.d.ts +7 -0
- package/dist/init/write-copilot-instructions.d.ts.map +1 -0
- package/dist/init/write-copilot-instructions.js +16 -0
- package/dist/init/write-copilot-instructions.js.map +1 -0
- package/dist/init/write-copilot-settings.d.ts +8 -0
- package/dist/init/write-copilot-settings.d.ts.map +1 -0
- package/dist/init/write-copilot-settings.js +36 -0
- package/dist/init/write-copilot-settings.js.map +1 -0
- package/dist/markers/index.d.ts +1 -0
- package/dist/markers/index.d.ts.map +1 -1
- package/dist/markers/index.js +1 -0
- package/dist/markers/index.js.map +1 -1
- package/dist/markers/replace-in-region.d.ts +10 -0
- package/dist/markers/replace-in-region.d.ts.map +1 -0
- package/dist/markers/replace-in-region.js +30 -0
- package/dist/markers/replace-in-region.js.map +1 -0
- package/dist/progress/format-progress.js +4 -0
- package/dist/progress/format-progress.js.map +1 -1
- package/dist/progress/progress.d.ts +2 -0
- package/dist/progress/progress.d.ts.map +1 -1
- package/dist/progress/read-progress.js +1 -0
- package/dist/progress/read-progress.js.map +1 -1
- package/dist/progress/read-slices.d.ts +5 -1
- package/dist/progress/read-slices.d.ts.map +1 -1
- package/dist/progress/read-slices.js +17 -7
- package/dist/progress/read-slices.js.map +1 -1
- package/dist/sdk/agent-instruction.d.ts +1 -1
- package/dist/sdk/agent-instruction.js +1 -1
- package/dist/sdk/instruct-agents.d.ts +1 -1
- package/dist/sdk/instruct-agents.d.ts.map +1 -1
- package/dist/sdk/instruct-agents.js +12 -8
- package/dist/sdk/instruct-agents.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +27 -4
- package/templates/command/handler.declared.ts.tpl +29 -0
- package/templates/command/handler.spec.buses.ts.tpl +24 -1
- package/templates/command/handler.ts.tpl +29 -0
- package/templates/command/wiring.manual.tpl +2 -2
- package/templates/command/wiring.tsyringe.tpl +5 -2
- package/templates/event-handler/event-handler.declared.ts.tpl +1 -1
- package/templates/init/AGENTS.md.tpl +46 -0
- package/templates/init/CLAUDE.md.tpl +2 -45
- package/templates/init/README.md.tpl +1 -1
- package/templates/init/rules/application.md.tpl +1 -1
- package/templates/init/rules/domain.md.tpl +1 -1
- package/templates/integration-event/publisher.declared.ts.tpl +1 -1
- package/templates/pipeline/github/workflows/copilot-setup-steps.yml +26 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/presets/identity/context/application/integration/publishers/account-deactivated.publisher.ts.tpl +1 -1
- package/templates/presets/identity/context/application/integration/publishers/delegation-granted.publisher.ts.tpl +1 -1
- package/templates/presets/identity/context/application/integration/publishers/delegation-revoked.publisher.ts.tpl +1 -1
- package/templates/presets/identity/context/application/integration/publishers/member-joined.publisher.ts.tpl +1 -1
- package/templates/presets/identity/context/application/integration/publishers/member-removed.publisher.ts.tpl +1 -1
- package/templates/presets/identity/context/application/integration/publishers/member-role-changed.publisher.ts.tpl +1 -1
- package/templates/presets/identity/context/application/integration/publishers/organisation-opened.publisher.ts.tpl +1 -1
- package/templates/query/handler.declared.ts.tpl +19 -0
- package/templates/query/handler.spec.buses.ts.tpl +21 -0
- package/templates/query/handler.ts.tpl +19 -0
- package/templates/query/wiring.manual.tpl +1 -1
- package/templates/query/wiring.tsyringe.tpl +4 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-declares-its-name.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/assert-declares-its-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAS3E"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CliError } from '../../cli-error.js';
|
|
2
|
+
import { isDeclared } from '../is-declared.js';
|
|
3
|
+
import { declaresItsName } from './declares-its-name.js';
|
|
4
|
+
import { eventFileOf } from './event-file-of.js';
|
|
5
|
+
/**
|
|
6
|
+
* In the declared style a reaction is attached under the name its event class declares,
|
|
7
|
+
* `@DomainEventHandler(InvoiceIssued)`: an event class generated before 0.7 has to declare it
|
|
8
|
+
* first, or the reaction does not compile.
|
|
9
|
+
*/
|
|
10
|
+
export function assertDeclaresItsName(scope, names) {
|
|
11
|
+
if (!isDeclared(scope.config) || declaresItsName(scope, names)) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
throw new CliError(`${names.event.pascal} does not declare the name its events carry, and a declared reaction is attached under it.`, `In ${eventFileOf(scope, names)}, write \`static readonly eventName = '${names.eventName}';\` and \`readonly name = ${names.event.pascal}.eventName;\`, then run the command again.`);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=assert-declares-its-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-declares-its-name.js","sourceRoot":"","sources":["../../../src/generate/kinds/assert-declares-its-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAY,EAAE,KAAiB;IACnE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;QAC/D,OAAO;IACT,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,4FAA4F,EACjH,MAAM,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,0CAA0C,KAAK,CAAC,SAAS,8BAA8B,KAAK,CAAC,KAAK,CAAC,MAAM,4CAA4C,CACrL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Name } from '../../naming/index.js';
|
|
2
|
+
import type { RenderContext } from '../../templating/index.js';
|
|
3
|
+
import type { Scope } from '../scope.js';
|
|
4
|
+
/**
|
|
5
|
+
* What the templates of a command read. `asksPolicy`: a policy refines its permission, so the
|
|
6
|
+
* handler receives `Access` and asks it, about the command until the element is loaded.
|
|
7
|
+
*/
|
|
8
|
+
export declare function commandContext(scope: Scope, { name, aggregate }: {
|
|
9
|
+
name: Name;
|
|
10
|
+
aggregate: Name | undefined;
|
|
11
|
+
}, asksPolicy: boolean): RenderContext;
|
|
12
|
+
//# sourceMappingURL=command-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-context.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/command-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,KAAK,EACZ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,IAAI,GAAG,SAAS,CAAA;CAAE,EAChE,UAAU,EAAE,OAAO,GAClB,aAAa,CASf"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { accessVars } from '../access-vars.js';
|
|
2
|
+
import { named } from '../named.js';
|
|
3
|
+
import { specVars } from '../spec-vars.js';
|
|
4
|
+
import { vars } from '../vars.js';
|
|
5
|
+
/**
|
|
6
|
+
* What the templates of a command read. `asksPolicy`: a policy refines its permission, so the
|
|
7
|
+
* handler receives `Access` and asks it, about the command until the element is loaded.
|
|
8
|
+
*/
|
|
9
|
+
export function commandContext(scope, { name, aggregate }, asksPolicy) {
|
|
10
|
+
const reference = `${scope.context.camel}Permissions['${scope.flags.permission ?? ''}']`;
|
|
11
|
+
const access = { ...accessVars(scope, { name, kind: 'Command' }), policy: asksPolicy, reference };
|
|
12
|
+
return {
|
|
13
|
+
...vars(scope, { name: named(name), access, spec: specVars(scope, access) }),
|
|
14
|
+
command: { hasAggregate: aggregate !== undefined, result: aggregate === undefined ? 'void' : 'string' },
|
|
15
|
+
...(aggregate === undefined ? {} : { aggregate: named(aggregate) }),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=command-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-context.js","sourceRoot":"","sources":["../../../src/generate/kinds/command-context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAY,EACZ,EAAE,IAAI,EAAE,SAAS,EAA+C,EAChE,UAAmB;IAEnB,MAAM,SAAS,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,gBAAgB,KAAK,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,IAAI,CAAC;IACzF,MAAM,MAAM,GAAG,EAAE,GAAG,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;IAElG,OAAO;QACL,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;QAC5E,OAAO,EAAE,EAAE,YAAY,EAAE,SAAS,KAAK,SAAS,EAAE,MAAM,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;QACvG,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;KACpE,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/command-kind.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/command-kind.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAUvC,eAAO,MAAM,WAAW,EAAE,IAoCzB,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { accessVars } from '../access-vars.js';
|
|
2
1
|
import { concept } from '../concept.js';
|
|
3
2
|
import { emit } from '../emit.js';
|
|
4
3
|
import { learnTerms } from '../learn-terms.js';
|
|
5
|
-
import {
|
|
4
|
+
import { refinedByPolicy } from '../refined-by-policy.js';
|
|
6
5
|
import { openScope } from '../open-scope.js';
|
|
7
|
-
import { specVars } from '../spec-vars.js';
|
|
8
|
-
import { vars } from '../vars.js';
|
|
9
6
|
import { wire } from '../wire.js';
|
|
7
|
+
import { commandContext } from './command-context.js';
|
|
8
|
+
import { commandOutputs } from './command-outputs.js';
|
|
10
9
|
import { existingAggregate } from './existing-aggregate.js';
|
|
11
10
|
import { generateRepository } from './generate-repository.js';
|
|
12
11
|
export const commandKind = {
|
|
@@ -21,30 +20,14 @@ export const commandKind = {
|
|
|
21
20
|
learnTerms(scope);
|
|
22
21
|
const name = concept(scope, request.args[1] ?? '', { what: 'use case', strip: ['command', 'handler'] });
|
|
23
22
|
const aggregate = request.flags.aggregate === undefined ? undefined : existingAggregate(scope, request.flags.aggregate);
|
|
24
|
-
const
|
|
23
|
+
const { permission } = scope.flags;
|
|
24
|
+
const context = commandContext(scope, { name, aggregate }, permission !== undefined && refinedByPolicy(scope, permission));
|
|
25
25
|
if (aggregate !== undefined &&
|
|
26
26
|
!scope.ws.exists(`${scope.dir}/domain/repositories/${aggregate.kebab}.repository.ts`)) {
|
|
27
27
|
generateRepository(scope, aggregate);
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
emit(scope, context, commandOutputs(scope, name));
|
|
30
|
+
wire(scope, 'command', context);
|
|
30
31
|
},
|
|
31
32
|
};
|
|
32
|
-
function commandVars(aggregate) {
|
|
33
|
-
return {
|
|
34
|
-
command: { hasAggregate: aggregate !== undefined, result: aggregate === undefined ? 'void' : 'string' },
|
|
35
|
-
...(aggregate === undefined ? {} : { aggregate: named(aggregate) }),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function writeCommand(scope, name, context) {
|
|
39
|
-
const folder = `application/commands/${name.kebab}`;
|
|
40
|
-
emit(scope, context, [
|
|
41
|
-
['command/command.ts.tpl', `${folder}/${name.kebab}.command.ts`],
|
|
42
|
-
['command/handler.ts.tpl', `${folder}/${name.kebab}.handler.ts`],
|
|
43
|
-
[
|
|
44
|
-
`command/handler.spec.${scope.config.stack.di === 'tsyringe' ? 'tsyringe' : 'buses'}.ts.tpl`,
|
|
45
|
-
`test/unit/${name.kebab}.handler.spec.ts`,
|
|
46
|
-
],
|
|
47
|
-
]);
|
|
48
|
-
wire(scope, 'command', context);
|
|
49
|
-
}
|
|
50
33
|
//# sourceMappingURL=command-kind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/command-kind.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/command-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,cAAc,E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KAAK,gBAAgB,CAAC,EACrF,CAAC;YACD,kBAAkB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Name } from '../../naming/index.js';
|
|
2
|
+
import type { Output } from '../emit.js';
|
|
3
|
+
import type { Scope } from '../scope.js';
|
|
4
|
+
/** The files of a command, relative to its context. */
|
|
5
|
+
export declare function commandOutputs(scope: Scope, name: Name): Output[];
|
|
6
|
+
//# sourceMappingURL=command-outputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-outputs.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/command-outputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,uDAAuD;AACvD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CAWjE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** The files of a command, relative to its context. */
|
|
2
|
+
export function commandOutputs(scope, name) {
|
|
3
|
+
const folder = `application/commands/${name.kebab}`;
|
|
4
|
+
return [
|
|
5
|
+
['command/command.ts.tpl', `${folder}/${name.kebab}.command.ts`],
|
|
6
|
+
['command/handler.ts.tpl', `${folder}/${name.kebab}.handler.ts`],
|
|
7
|
+
[
|
|
8
|
+
`command/handler.spec.${scope.config.stack.di === 'tsyringe' ? 'tsyringe' : 'buses'}.ts.tpl`,
|
|
9
|
+
`test/unit/${name.kebab}.handler.spec.ts`,
|
|
10
|
+
],
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=command-outputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-outputs.js","sourceRoot":"","sources":["../../../src/generate/kinds/command-outputs.ts"],"names":[],"mappings":"AAIA,uDAAuD;AACvD,MAAM,UAAU,cAAc,CAAC,KAAY,EAAE,IAAU;IACrD,MAAM,MAAM,GAAG,wBAAwB,IAAI,CAAC,KAAK,EAAE,CAAC;IAEpD,OAAO;QACL,CAAC,wBAAwB,EAAE,GAAG,MAAM,IAAI,IAAI,CAAC,KAAK,aAAa,CAAC;QAChE,CAAC,wBAAwB,EAAE,GAAG,MAAM,IAAI,IAAI,CAAC,KAAK,aAAa,CAAC;QAChE;YACE,wBAAwB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,SAAS;YAC5F,aAAa,IAAI,CAAC,KAAK,kBAAkB;SAC1C;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EventNames } from '../event-names.js';
|
|
2
|
+
import type { Scope } from '../scope.js';
|
|
3
|
+
/** True when the event class declares once the name its events carry, `static readonly eventName = '..'`. */
|
|
4
|
+
export declare function declaresItsName(scope: Scope, names: EventNames): boolean;
|
|
5
|
+
//# sourceMappingURL=declares-its-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declares-its-name.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/declares-its-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAKzC,6GAA6G;AAC7G,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAExE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { eventFileOf } from './event-file-of.js';
|
|
2
|
+
const DECLARES_ITS_NAME = /\bstatic\s+readonly\s+eventName\s*=/;
|
|
3
|
+
/** True when the event class declares once the name its events carry, `static readonly eventName = '..'`. */
|
|
4
|
+
export function declaresItsName(scope, names) {
|
|
5
|
+
return DECLARES_ITS_NAME.test(scope.ws.read(eventFileOf(scope, names)) ?? '');
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=declares-its-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declares-its-name.js","sourceRoot":"","sources":["../../../src/generate/kinds/declares-its-name.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,iBAAiB,GAAG,qCAAqC,CAAC;AAEhE,6GAA6G;AAC7G,MAAM,UAAU,eAAe,CAAC,KAAY,EAAE,KAAiB;IAC7D,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EventNames } from '../event-names.js';
|
|
2
|
+
import type { Scope } from '../scope.js';
|
|
3
|
+
/** The file of the event class, under domain/events/ of its context. */
|
|
4
|
+
export declare function eventFileOf(scope: Scope, names: EventNames): string;
|
|
5
|
+
//# sourceMappingURL=event-file-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-file-of.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/event-file-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAEnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-file-of.js","sourceRoot":"","sources":["../../../src/generate/kinds/event-file-of.ts"],"names":[],"mappings":"AAGA,wEAAwE;AACxE,MAAM,UAAU,WAAW,CAAC,KAAY,EAAE,KAAiB;IACzD,OAAO,GAAG,KAAK,CAAC,GAAG,kBAAkB,KAAK,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC;AACpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-handler-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/event-handler-kind.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"event-handler-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/event-handler-kind.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AASvC,eAAO,MAAM,gBAAgB,EAAE,IA2B9B,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { learnTerms } from '../learn-terms.js';
|
|
|
4
4
|
import { openScope } from '../open-scope.js';
|
|
5
5
|
import { wire } from '../wire.js';
|
|
6
6
|
import { ensureDomainEvent } from './ensure-domain-event.js';
|
|
7
|
+
import { assertDeclaresItsName } from './assert-declares-its-name.js';
|
|
7
8
|
import { eventVars } from './event-vars.js';
|
|
8
9
|
export const eventHandlerKind = {
|
|
9
10
|
name: 'event-handler',
|
|
@@ -16,6 +17,7 @@ export const eventHandlerKind = {
|
|
|
16
17
|
const scope = openScope(request);
|
|
17
18
|
learnTerms(scope);
|
|
18
19
|
const names = ensureDomainEvent(scope, request.args[1] ?? '', request.args[2] ?? '');
|
|
20
|
+
assertDeclaresItsName(scope, names);
|
|
19
21
|
const context = { ...eventVars(scope, names), handler: phaseVars(scope) };
|
|
20
22
|
emit(scope, context, [
|
|
21
23
|
['event-handler/event-handler.ts.tpl', `application/event-handlers/${names.event.kebab}.event-handler.ts`],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-handler-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/event-handler-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,EAAE;IACX,KAAK,EACH,gHAAgH;IAClH,OAAO,EACL,6MAA6M;IAC/M,WAAW,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC;IAC7C,YAAY,EAAE,KAAK;IACnB,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE;QACf,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAEjC,UAAU,CAAC,KAAK,CAAC,CAAC;QAElB,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"event-handler-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/event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CAAC,KAAK,mBAAmB,CAAC;YAC1G,CAAC,yCAAyC,EAAE,aAAa,KAAK,CAAC,KAAK,CAAC,KAAK,wBAAwB,CAAC;SACpG,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;CACF,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;AAEjD,6FAA6F;AAC7F,SAAS,SAAS,CAAC,KAAY;IAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,eAAe,CAAC;IAEnD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,QAAQ,CAChB,kBAAkB,KAAK,IAAI,EAC3B,4NAA4N,CAC7N,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,KAAK,cAAc,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { EventNames } from '../event-names.js';
|
|
2
2
|
import type { Scope } from '../scope.js';
|
|
3
3
|
/**
|
|
4
|
-
* How a reaction names the domain event it is attached to:
|
|
5
|
-
* event class declares once, or the name written out for
|
|
6
|
-
* (one generated before 0.
|
|
4
|
+
* How a reaction wired by a module file names the domain event it is attached to:
|
|
5
|
+
* `InvoiceIssued.eventName`, the name the event class declares once, or the name written out for
|
|
6
|
+
* an event class that does not declare it (one generated before 0.7), so that the reaction still
|
|
7
|
+
* compiles.
|
|
7
8
|
*/
|
|
8
9
|
export declare function eventNameReference(scope: Scope, names: EventNames): string;
|
|
9
10
|
//# sourceMappingURL=event-name-reference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-name-reference.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/event-name-reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"event-name-reference.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/event-name-reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAE1E"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { declaresItsName } from './declares-its-name.js';
|
|
2
2
|
/**
|
|
3
|
-
* How a reaction names the domain event it is attached to:
|
|
4
|
-
* event class declares once, or the name written out for
|
|
5
|
-
* (one generated before 0.
|
|
3
|
+
* How a reaction wired by a module file names the domain event it is attached to:
|
|
4
|
+
* `InvoiceIssued.eventName`, the name the event class declares once, or the name written out for
|
|
5
|
+
* an event class that does not declare it (one generated before 0.7), so that the reaction still
|
|
6
|
+
* compiles.
|
|
6
7
|
*/
|
|
7
8
|
export function eventNameReference(scope, names) {
|
|
8
|
-
|
|
9
|
-
return DECLARES_ITS_NAME.test(declared) ? `${names.event.pascal}.eventName` : `'${names.eventName}'`;
|
|
9
|
+
return declaresItsName(scope, names) ? `${names.event.pascal}.eventName` : `'${names.eventName}'`;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=event-name-reference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-name-reference.js","sourceRoot":"","sources":["../../../src/generate/kinds/event-name-reference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-name-reference.js","sourceRoot":"","sources":["../../../src/generate/kinds/event-name-reference.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAY,EAAE,KAAiB;IAChE,OAAO,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,YAAY,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,SAAS,GAAG,CAAC;AACpG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-event-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/integration-event-kind.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"integration-event-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/integration-event-kind.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAYvC,eAAO,MAAM,oBAAoB,EAAE,IAmClC,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { openScope } from '../open-scope.js';
|
|
|
10
10
|
import { vars } from '../vars.js';
|
|
11
11
|
import { wire } from '../wire.js';
|
|
12
12
|
import { ensureDomainEvent } from './ensure-domain-event.js';
|
|
13
|
+
import { assertDeclaresItsName } from './assert-declares-its-name.js';
|
|
13
14
|
import { eventNameReference } from './event-name-reference.js';
|
|
14
15
|
import { publishInIndex } from './publish-in-index.js';
|
|
15
16
|
export const integrationEventKind = {
|
|
@@ -24,6 +25,7 @@ export const integrationEventKind = {
|
|
|
24
25
|
learnTerms(scope);
|
|
25
26
|
const version = parseVersion(request.flags.version);
|
|
26
27
|
const names = ensureDomainEvent(scope, request.args[1] ?? '', request.args[2] ?? '');
|
|
28
|
+
assertDeclaresItsName(scope, names);
|
|
27
29
|
const publisher = toName(version === 1 ? names.event.words : `${names.event.words} v${version}`);
|
|
28
30
|
const reference = eventNameReference(scope, names);
|
|
29
31
|
const event = { ...named(names.event), name: names.eventName, reference, version };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-event-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/integration-event-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAe,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,CAAC,MAAM,oBAAoB,GAAS;IACxC,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,+FAA+F;IACtG,OAAO,EAAE,kGAAkG;IAC3G,WAAW,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC;IAC7C,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE;QACf,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAEjC,UAAU,CAAC,KAAK,CAAC,CAAC;QAElB,MAAM,OAAO,GAAG,YA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K,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/D,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAE1C,IAAI,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9B,WAAW,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,EAAE,cAAc,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,KAAyB;IAC7C,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC;IAErC,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;QAC9C,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,IAAI,KAAK,2BAA2B,EACpC,4FAA4F,CAC7F,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAAY;IACjC,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IAE1C,OAAO,UAAU,KAAK,KAAK,IAAI,UAAU,KAAK,iBAAiB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC1F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/policy-kind.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"policy-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/policy-kind.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAQvC,eAAO,MAAM,UAAU,EAAE,IAwCxB,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { declarePermission } from '../declare-permission.js';
|
|
|
5
5
|
import { emit } from '../emit.js';
|
|
6
6
|
import { isDeclared } from '../is-declared.js';
|
|
7
7
|
import { label } from '../label.js';
|
|
8
|
+
import { markPolicyQuestions } from '../mark-policy-questions.js';
|
|
8
9
|
import { named } from '../named.js';
|
|
9
10
|
import { openScope } from '../open-scope.js';
|
|
10
11
|
import { permissionNamed } from '../permission-named.js';
|
|
@@ -29,6 +30,7 @@ export const policyKind = {
|
|
|
29
30
|
['policy/policy.ts.tpl', `application/authorization/${name.kebab}.policy.ts`],
|
|
30
31
|
['policy/policy.spec.ts.tpl', `test/unit/${name.kebab}.policy.spec.ts`],
|
|
31
32
|
]);
|
|
33
|
+
markPolicyQuestions(scope, permission);
|
|
32
34
|
// A declared policy is found through its decorator: only a policy written as a value is listed for `Access`.
|
|
33
35
|
if (!isDeclared(scope.config)) {
|
|
34
36
|
applyWiring(scope.ws, `${scope.config.platformDir}/auth/access-policies.ts`, renderTemplate('policy/registration.tpl', context));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/policy-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,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AI,GAAG,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxF,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;QAEnC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,QAAQ,CAChB,8BAA8B,EAC9B,iHAAiH,CAClH,CAAC;QACJ,CAAC;QAED,iBAAiB,CAAC,KAAK,EAAE,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,CAAC;QAEnE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;QAE3E,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE;YACnB,CAAC,sBAAsB,EAAE,6BAA6B,IAAI,CAAC,KAAK,YAAY,CAAC;YAC7E,CAAC,2BAA2B,EAAE,aAAa,IAAI,CAAC,KAAK,iBAAiB,CAAC;SACxE,CAAC,CAAC;QAEH,mBAAmB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAEvC,6GAA6G;QAC7G,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9B,WAAW,CACT,KAAK,CAAC,EAAE,EACR,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,0BAA0B,EACrD,cAAc,CAAC,yBAAyB,EAAE,OAAO,CAAC,CACnD,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Name } from '../../naming/index.js';
|
|
2
|
+
import type { RenderContext } from '../../templating/index.js';
|
|
3
|
+
import type { Scope } from '../scope.js';
|
|
4
|
+
/**
|
|
5
|
+
* What the templates of a query read. `asksPolicy`: a policy refines its permission, so the
|
|
6
|
+
* handler receives `Access` and asks it, about the query until the element is read.
|
|
7
|
+
*/
|
|
8
|
+
export declare function queryContext(scope: Scope, name: Name, asksPolicy: boolean): RenderContext;
|
|
9
|
+
//# sourceMappingURL=query-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-context.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/query-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMzC;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,GAAG,aAAa,CAWzF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { accessVars } from '../access-vars.js';
|
|
2
|
+
import { named } from '../named.js';
|
|
3
|
+
import { searchedElements } from '../searched-elements.js';
|
|
4
|
+
import { specVars } from '../spec-vars.js';
|
|
5
|
+
import { vars } from '../vars.js';
|
|
6
|
+
import { readerFile } from './reader-file.js';
|
|
7
|
+
/**
|
|
8
|
+
* What the templates of a query read. `asksPolicy`: a policy refines its permission, so the
|
|
9
|
+
* handler receives `Access` and asks it, about the query until the element is read.
|
|
10
|
+
*/
|
|
11
|
+
export function queryContext(scope, name, asksPolicy) {
|
|
12
|
+
const reference = `${scope.context.camel}Permissions['${scope.flags.permission ?? ''}']`;
|
|
13
|
+
const access = { ...accessVars(scope, { name, kind: 'Query' }), policy: asksPolicy, reference };
|
|
14
|
+
return vars(scope, {
|
|
15
|
+
name: named(name),
|
|
16
|
+
access,
|
|
17
|
+
spec: specVars(scope, access),
|
|
18
|
+
search: { resource: searchedResource(access), ...searchedElements(name) },
|
|
19
|
+
reader: { file: readerFile(scope, name) },
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/** The element a search answers, as the authorization model names it: the aggregate of its permission, to start with. */
|
|
23
|
+
function searchedResource(access) {
|
|
24
|
+
const permission = access['permission'];
|
|
25
|
+
return typeof permission === 'string' ? (permission.split('.')[0] ?? '') : '';
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=query-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-context.js","sourceRoot":"","sources":["../../../src/generate/kinds/query-context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAY,EAAE,IAAU,EAAE,UAAmB;IACxE,MAAM,SAAS,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,gBAAgB,KAAK,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,IAAI,CAAC;IACzF,MAAM,MAAM,GAAG,EAAE,GAAG,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;IAEhG,OAAO,IAAI,CAAC,KAAK,EAAE;QACjB,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC;QACjB,MAAM;QACN,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAC7B,MAAM,EAAE,EAAE,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE;QACzE,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE;KAC1C,CAAC,CAAC;AACL,CAAC;AAED,yHAAyH;AACzH,SAAS,gBAAgB,CAAC,MAAqB;IAC7C,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;IAExC,OAAO,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAChF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/query-kind.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/query-kind.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAUvC,eAAO,MAAM,SAAS,EAAE,IA4BvB,CAAC"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { CliError } from '../../cli-error.js';
|
|
2
|
-
import { accessVars } from '../access-vars.js';
|
|
3
2
|
import { concept } from '../concept.js';
|
|
4
3
|
import { emit } from '../emit.js';
|
|
5
|
-
import { isDeclared } from '../is-declared.js';
|
|
6
4
|
import { learnTerms } from '../learn-terms.js';
|
|
7
|
-
import {
|
|
5
|
+
import { markPolicyQuestions } from '../mark-policy-questions.js';
|
|
6
|
+
import { refinedByPolicy } from '../refined-by-policy.js';
|
|
8
7
|
import { openScope } from '../open-scope.js';
|
|
9
|
-
import { searchedElements } from '../searched-elements.js';
|
|
10
|
-
import { specVars } from '../spec-vars.js';
|
|
11
|
-
import { vars } from '../vars.js';
|
|
12
8
|
import { wire } from '../wire.js';
|
|
9
|
+
import { queryContext } from './query-context.js';
|
|
10
|
+
import { queryOutputs } from './query-outputs.js';
|
|
13
11
|
export const queryKind = {
|
|
14
12
|
name: 'query',
|
|
15
13
|
aliases: [],
|
|
@@ -21,60 +19,26 @@ export const queryKind = {
|
|
|
21
19
|
const scope = openScope(request);
|
|
22
20
|
learnTerms(scope);
|
|
23
21
|
const name = concept(scope, request.args[1] ?? '', { what: 'use case', strip: ['query', 'handler'] });
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const context =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
writeQuery(scope, { name, variant, reader: reader.file }, context);
|
|
22
|
+
const variant = queryVariant(scope);
|
|
23
|
+
const { permission } = scope.flags;
|
|
24
|
+
const asksPolicy = variant === '' && permission !== undefined && refinedByPolicy(scope, permission);
|
|
25
|
+
const context = queryContext(scope, name, asksPolicy);
|
|
26
|
+
emit(scope, context, queryOutputs(scope, name, variant));
|
|
27
|
+
wire(scope, variant === '' ? 'query' : 'query/search', context);
|
|
28
|
+
// A search is narrowed by the access scope of its actor: there is no element to ask a policy about, only a marker.
|
|
29
|
+
if (variant !== '' && permission !== undefined) {
|
|
30
|
+
markPolicyQuestions(scope, permission);
|
|
31
|
+
}
|
|
35
32
|
},
|
|
36
33
|
};
|
|
37
|
-
/**
|
|
38
|
-
* The in-memory adapter of the read port. Declared, it is a role file bound by its own
|
|
39
|
-
* decorator, so it carries the repository suffix.
|
|
40
|
-
*/
|
|
41
|
-
function readerFile(scope, name) {
|
|
42
|
-
return isDeclared(scope.config) ? `in-memory-${name.kebab}-reader.repository` : `in-memory-${name.kebab}.reader`;
|
|
43
|
-
}
|
|
44
34
|
/** `--search`: the templates of a paginated search. A search is narrowed by what its actor may see, so it names a permission. */
|
|
45
|
-
function queryVariant(scope
|
|
35
|
+
function queryVariant(scope) {
|
|
46
36
|
if (!scope.flags.search) {
|
|
47
37
|
return '';
|
|
48
38
|
}
|
|
49
|
-
if (
|
|
39
|
+
if (!scope.flags.public) {
|
|
50
40
|
return 'search.';
|
|
51
41
|
}
|
|
52
42
|
throw new CliError('--search cannot be combined with --public.', 'A generated search is filtered by the access scope the authorizer computes for its actor: give it --permission <aggregate>.<action>, or generate a plain public query and page it yourself.');
|
|
53
43
|
}
|
|
54
|
-
/** The element a search answers, as the authorization model names it: the aggregate of its permission, to start with. */
|
|
55
|
-
function searchedResource(access) {
|
|
56
|
-
const permission = access['permission'];
|
|
57
|
-
return typeof permission === 'string' ? (permission.split('.')[0] ?? '') : '';
|
|
58
|
-
}
|
|
59
|
-
function writeQuery(scope, { name, variant, reader }, context) {
|
|
60
|
-
const folder = `application/queries/${name.kebab}`;
|
|
61
|
-
emit(scope, context, [
|
|
62
|
-
[`query/${variant}query.ts.tpl`, `${folder}/${name.kebab}.query.ts`],
|
|
63
|
-
[`query/${variant}result.ts.tpl`, `${folder}/${name.kebab}.result.ts`],
|
|
64
|
-
[`query/${variant}handler.ts.tpl`, `${folder}/${name.kebab}.handler.ts`],
|
|
65
|
-
[`query/${variant}reader.port.ts.tpl`, `application/ports/${name.kebab}-reader.port.ts`],
|
|
66
|
-
[`query/${variant}reader.in-memory.ts.tpl`, `infrastructure/persistence/${reader}.ts`],
|
|
67
|
-
[`query/${variant}reader.fake.ts.tpl`, `test/fakes/${name.kebab}-reader.fake.ts`],
|
|
68
|
-
[
|
|
69
|
-
`query/${variant}handler.spec.${scope.config.stack.di === 'tsyringe' ? 'tsyringe' : 'buses'}.ts.tpl`,
|
|
70
|
-
`test/unit/${name.kebab}.handler.spec.ts`,
|
|
71
|
-
],
|
|
72
|
-
...readerSpec(variant, reader),
|
|
73
|
-
]);
|
|
74
|
-
wire(scope, variant === '' ? 'query' : 'query/search', context);
|
|
75
|
-
}
|
|
76
|
-
/** The canned reader of a search pages, sorts and filters by the access scope: an adapter, held by a spec of its own. */
|
|
77
|
-
function readerSpec(variant, reader) {
|
|
78
|
-
return variant === '' ? [] : [['query/search.reader.spec.ts.tpl', `test/integration/${reader}.spec.ts`]];
|
|
79
|
-
}
|
|
80
44
|
//# sourceMappingURL=query-kind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/query-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"query-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/query-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAqB,MAAM,oBAAoB,CAAC;AAErE,MAAM,CAAC,MAAM,SAAS,GAAS;IAC7B,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,EAAE;IACX,KAAK,EACH,wHAAwH;IAC1H,OAAO,EACL,sNAAsN;IACxN,WAAW,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;IACvC,YAAY,EAAE,KAAK;IACnB,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE;QACf,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAEjC,UAAU,CAAC,KAAK,CAAC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,8 @@
|
|
|
1
|
+
import type { Name } from '../../naming/index.js';
|
|
2
|
+
import type { Output } from '../emit.js';
|
|
3
|
+
import type { Scope } from '../scope.js';
|
|
4
|
+
/** `search.` for a paginated search narrowed by the access scope of its actor, nothing for a plain query. */
|
|
5
|
+
export type QueryVariant = '' | 'search.';
|
|
6
|
+
/** The files of a query, relative to its context. */
|
|
7
|
+
export declare function queryOutputs(scope: Scope, name: Name, variant: QueryVariant): Output[];
|
|
8
|
+
//# sourceMappingURL=query-outputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-outputs.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/query-outputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,6GAA6G;AAC7G,MAAM,MAAM,YAAY,GAAG,EAAE,GAAG,SAAS,CAAC;AAE1C,qDAAqD;AACrD,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,EAAE,CAiBtF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { readerFile } from './reader-file.js';
|
|
2
|
+
/** The files of a query, relative to its context. */
|
|
3
|
+
export function queryOutputs(scope, name, variant) {
|
|
4
|
+
const folder = `application/queries/${name.kebab}`;
|
|
5
|
+
const reader = readerFile(scope, name);
|
|
6
|
+
return [
|
|
7
|
+
[`query/${variant}query.ts.tpl`, `${folder}/${name.kebab}.query.ts`],
|
|
8
|
+
[`query/${variant}result.ts.tpl`, `${folder}/${name.kebab}.result.ts`],
|
|
9
|
+
[`query/${variant}handler.ts.tpl`, `${folder}/${name.kebab}.handler.ts`],
|
|
10
|
+
[`query/${variant}reader.port.ts.tpl`, `application/ports/${name.kebab}-reader.port.ts`],
|
|
11
|
+
[`query/${variant}reader.in-memory.ts.tpl`, `infrastructure/persistence/${reader}.ts`],
|
|
12
|
+
[`query/${variant}reader.fake.ts.tpl`, `test/fakes/${name.kebab}-reader.fake.ts`],
|
|
13
|
+
[
|
|
14
|
+
`query/${variant}handler.spec.${scope.config.stack.di === 'tsyringe' ? 'tsyringe' : 'buses'}.ts.tpl`,
|
|
15
|
+
`test/unit/${name.kebab}.handler.spec.ts`,
|
|
16
|
+
],
|
|
17
|
+
...(variant === '' ? [] : [['query/search.reader.spec.ts.tpl', `test/integration/${reader}.spec.ts`]]),
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=query-outputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-outputs.js","sourceRoot":"","sources":["../../../src/generate/kinds/query-outputs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAK9C,qDAAqD;AACrD,MAAM,UAAU,YAAY,CAAC,KAAY,EAAE,IAAU,EAAE,OAAqB;IAC1E,MAAM,MAAM,GAAG,uBAAuB,IAAI,CAAC,KAAK,EAAE,CAAC;IACnD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAEvC,OAAO;QACL,CAAC,SAAS,OAAO,cAAc,EAAE,GAAG,MAAM,IAAI,IAAI,CAAC,KAAK,WAAW,CAAC;QACpE,CAAC,SAAS,OAAO,eAAe,EAAE,GAAG,MAAM,IAAI,IAAI,CAAC,KAAK,YAAY,CAAC;QACtE,CAAC,SAAS,OAAO,gBAAgB,EAAE,GAAG,MAAM,IAAI,IAAI,CAAC,KAAK,aAAa,CAAC;QACxE,CAAC,SAAS,OAAO,oBAAoB,EAAE,qBAAqB,IAAI,CAAC,KAAK,iBAAiB,CAAC;QACxF,CAAC,SAAS,OAAO,yBAAyB,EAAE,8BAA8B,MAAM,KAAK,CAAC;QACtF,CAAC,SAAS,OAAO,oBAAoB,EAAE,cAAc,IAAI,CAAC,KAAK,iBAAiB,CAAC;QACjF;YACE,SAAS,OAAO,gBAAgB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,SAAS;YACpG,aAAa,IAAI,CAAC,KAAK,kBAAkB;SAC1C;QACD,GAAG,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,iCAAiC,EAAE,oBAAoB,MAAM,UAAU,CAAU,CAAC,CAAC;KAChH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Name } from '../../naming/index.js';
|
|
2
|
+
import type { Scope } from '../scope.js';
|
|
3
|
+
/**
|
|
4
|
+
* The in-memory adapter of the read port. Declared, it is a role file bound by its own
|
|
5
|
+
* decorator, so it carries the repository suffix.
|
|
6
|
+
*/
|
|
7
|
+
export declare function readerFile(scope: Scope, name: Name): string;
|
|
8
|
+
//# sourceMappingURL=reader-file.d.ts.map
|