ddd-ts-kit 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +2 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/errors/kit-error-codes.d.ts.map +1 -1
- package/dist/check/errors/kit-error-codes.js +1 -0
- package/dist/check/errors/kit-error-codes.js.map +1 -1
- package/dist/check/explain/authz-docs.d.ts.map +1 -1
- package/dist/check/explain/authz-docs.js +12 -0
- package/dist/check/explain/authz-docs.js.map +1 -1
- package/dist/check/explain/errors-docs.js +1 -1
- package/dist/check/explain/errors-docs.js.map +1 -1
- package/dist/check/fixtures/authz-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-fixtures.js +38 -1
- package/dist/check/fixtures/authz-fixtures.js.map +1 -1
- package/dist/check/rules/authz-fields-by-schema.d.ts +3 -0
- package/dist/check/rules/authz-fields-by-schema.d.ts.map +1 -0
- package/dist/check/rules/authz-fields-by-schema.js +33 -0
- package/dist/check/rules/authz-fields-by-schema.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +2 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/parse-stack.d.ts.map +1 -1
- package/dist/config/parse-stack.js +3 -1
- package/dist/config/parse-stack.js.map +1 -1
- package/dist/config/stack.d.ts +14 -0
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +2 -0
- package/dist/config/stack.js.map +1 -1
- package/dist/describe/context-description.d.ts +6 -0
- package/dist/describe/context-description.d.ts.map +1 -1
- package/dist/describe/format-description.js +9 -1
- package/dist/describe/format-description.js.map +1 -1
- package/dist/describe/presentation-of-route.d.ts +4 -0
- package/dist/describe/presentation-of-route.d.ts.map +1 -0
- package/dist/describe/presentation-of-route.js +15 -0
- package/dist/describe/presentation-of-route.js.map +1 -0
- package/dist/describe/read-controllers.d.ts.map +1 -1
- package/dist/describe/read-controllers.js +4 -1
- package/dist/describe/read-controllers.js.map +1 -1
- package/dist/describe/read-routes.d.ts.map +1 -1
- package/dist/describe/read-routes.js +2 -0
- package/dist/describe/read-routes.js.map +1 -1
- package/dist/generate/kinds/form-kind.d.ts +3 -0
- package/dist/generate/kinds/form-kind.d.ts.map +1 -0
- package/dist/generate/kinds/form-kind.js +38 -0
- package/dist/generate/kinds/form-kind.js.map +1 -0
- package/dist/generate/kinds/presentation/controller-of.d.ts +10 -0
- package/dist/generate/kinds/presentation/controller-of.d.ts.map +1 -0
- package/dist/generate/kinds/presentation/controller-of.js +13 -0
- package/dist/generate/kinds/presentation/controller-of.js.map +1 -0
- package/dist/generate/kinds/presentation/controller-source.d.ts +13 -0
- package/dist/generate/kinds/presentation/controller-source.d.ts.map +1 -0
- package/dist/generate/kinds/presentation/controller-source.js +44 -0
- package/dist/generate/kinds/presentation/controller-source.js.map +1 -0
- package/dist/generate/kinds/representation-kind.d.ts +3 -0
- package/dist/generate/kinds/representation-kind.d.ts.map +1 -0
- package/dist/generate/kinds/representation-kind.js +54 -0
- package/dist/generate/kinds/representation-kind.js.map +1 -0
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +4 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/help/usage.d.ts +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +2 -1
- package/dist/help/usage.js.map +1 -1
- package/dist/init/files/platform-files.js +3 -1
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +15 -1
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/stack-options.d.ts +2 -0
- package/dist/init/stack/stack-options.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +19 -2
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/templates/docs/openapi.json.tpl +15 -0
- package/templates/init/CLAUDE.md.tpl +2 -2
- package/templates/init/platform/auth/http-boundary.ts.tpl +20 -3
- package/templates/init/platform/compose-application.manual.ts.tpl +18 -0
- package/templates/init/platform/compose-application.tsyringe.ts.tpl +23 -0
- package/templates/init/platform/http/presentation-of.ts.tpl +27 -0
- package/templates/init/platform/http/start-http-server.express.ts.tpl +1 -1
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +1 -1
- package/templates/init/platform/http/start-http-server.hono.ts.tpl +1 -1
- package/templates/init/platform/http/start-http-server.nest.ts.tpl +2 -2
- package/templates/init/platform/http/with-documentation.ts.tpl +13 -3
- package/templates/init/platform/http/with-forms.ts.tpl +7 -0
- package/templates/init/rules/application.md.tpl +1 -1
- package/templates/init/rules/presentation.md.tpl +1 -1
- package/templates/init/scripts/openapi.ts.tpl +27 -6
- package/templates/pipeline/biome.json.tpl +1 -0
- package/templates/pipeline/package-scripts.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-stack.d.ts","sourceRoot":"","sources":["../../../src/init/stack/resolve-stack.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"resolve-stack.d.ts","sourceRoot":"","sources":["../../../src/init/stack/resolve-stack.ts"],"names":[],"mappings":"AAEA,OAAO,EA+BL,KAAK,MAAM,EACZ,MAAM,uBAAuB,CAAC;AAW/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,CAiBxE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { AUDIT_MODES, AUTHN_STACKS, AUTHZ_STACKS, BROKER_STACKS, CACHE_STACKS, CI_PLATFORMS, CONFIG_FILE, DEFAULT_IMPORT_ALIAS, DEFAULT_IMPORT_EXTENSION, DEFAULT_SDK_NAME, DI_STACKS, DOCS_UIS, ERROR_REPORTERS, HTTP_CACHE_STACKS, HTTP_STACKS, IMPORT_EXTENSIONS, LOGGERS, REFUSAL_FORMS, ROUTE_FORMS, SCHEMA_FORMS, PACKAGE_MANAGERS, STORAGE_STACKS, parseConfig, readConfig, TEST_STACKS, VALIDATION_STACKS, VALUE_OBJECT_FORMS, LITERAL_FORMS, } from '../../config/index.js';
|
|
3
|
+
import { AUDIT_MODES, AUTHN_STACKS, AUTHZ_STACKS, BROKER_STACKS, CACHE_STACKS, CI_PLATFORMS, CONFIG_FILE, DEFAULT_IMPORT_ALIAS, DEFAULT_IMPORT_EXTENSION, DEFAULT_SDK_NAME, DI_STACKS, DOCS_UIS, ERROR_REPORTERS, HTTP_CACHE_STACKS, HTTP_STACKS, IMPORT_EXTENSIONS, LOGGERS, FORM_MODES, REFUSAL_FORMS, REPRESENTATION_MODES, ROUTE_FORMS, SCHEMA_FORMS, PACKAGE_MANAGERS, STORAGE_STACKS, parseConfig, readConfig, TEST_STACKS, VALIDATION_STACKS, VALUE_OBJECT_FORMS, LITERAL_FORMS, } from '../../config/index.js';
|
|
4
4
|
import { aliasProblem } from '../../alias/index.js';
|
|
5
5
|
import { DEFAULT_PACKAGE_MANAGER } from '../../package-manager/default-package-manager.js';
|
|
6
6
|
import { CliError } from '../../cli-error.js';
|
|
@@ -84,6 +84,7 @@ function stackOf(options) {
|
|
|
84
84
|
...resolveOperations(options, persistence.orm),
|
|
85
85
|
...resolveWriting(options),
|
|
86
86
|
...resolveStyle(options, di),
|
|
87
|
+
...resolvePresentation(options, http),
|
|
87
88
|
tenancy: resolveTenancy(options, persistence.orm),
|
|
88
89
|
queue: resolveQueue(options, { orm: persistence.orm, di }),
|
|
89
90
|
};
|
|
@@ -133,6 +134,19 @@ function resolveWriting(options) {
|
|
|
133
134
|
literals: choose(LITERAL_FORMS, options.literals, 'literals') ?? 'named',
|
|
134
135
|
};
|
|
135
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* A new project with an HTTP stack negotiates its representations and serves the forms its routes
|
|
139
|
+
* declare; one without HTTP has neither, and a recorded one keeps what it says, or JSON alone and
|
|
140
|
+
* no form when it says nothing.
|
|
141
|
+
*/
|
|
142
|
+
function resolvePresentation(options, http) {
|
|
143
|
+
const representations = choose(REPRESENTATION_MODES, options.representations, 'representations');
|
|
144
|
+
const forms = choose(FORM_MODES, options.forms, 'forms');
|
|
145
|
+
return {
|
|
146
|
+
representations: representations ?? (http === 'none' ? 'json' : 'negotiated'),
|
|
147
|
+
forms: forms ?? (http === 'none' ? 'off' : 'on'),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
136
150
|
/** A shared cache purged after the commit needs an API to put it in front of, and the outbox its purge requests ride on. */
|
|
137
151
|
function resolveHttpCache(options, http, events) {
|
|
138
152
|
const httpCache = choose(HTTP_CACHE_STACKS, options.httpCache, 'http-cache') ?? 'none';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-stack.js","sourceRoot":"","sources":["../../../src/init/stack/resolve-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,aAAa,EACb,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AAM,MAAM,GAAG,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC;IAEzE,IAAI,MAAM,KAAK,MAAM,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,YAAY,MAAM,sCAAsC,EACxD,mHAAmH,CACpH,CAAC;AACJ,CAAC;AAID,SAAS,cAAc,CAAC,OAAqB;IAC3C,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,IAAI,KAAK;QAChF,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,QAAQ;QAC9D,EAAE,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,QAAQ;QACtD,cAAc,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,cAAc,EAAE,iBAAiB,CAAC,IAAI,uBAAuB;KAC/G,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAY,EAAE,EAAU;IACtD,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC;QAC1C,OAAO;IACT,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,UAAU,IAAI,iCAAiC,EAAE,GAAG,EACpD,6IAA6I,CAC9I,CAAC;AACJ,CAAC"}
|
|
@@ -26,6 +26,8 @@ export interface StackOptions {
|
|
|
26
26
|
readonly dependencies?: string;
|
|
27
27
|
readonly refusals?: string;
|
|
28
28
|
readonly routes?: string;
|
|
29
|
+
readonly representations?: string;
|
|
30
|
+
readonly forms?: string;
|
|
29
31
|
readonly schemas?: string;
|
|
30
32
|
readonly valueObjects?: string;
|
|
31
33
|
readonly literals?: string;
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AAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,8GAA8G;IAC9G,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,iFAAiF;IACjF,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB"}
|
package/dist/stack/stack-vars.js
CHANGED
|
@@ -33,16 +33,20 @@ export function stackVars(config) {
|
|
|
33
33
|
errors: errorVars(config),
|
|
34
34
|
...modelWritingVars(config),
|
|
35
35
|
routes: routeVars(config),
|
|
36
|
+
presentation: presentationVars(config),
|
|
36
37
|
logger: one(logger, ['stdout', 'pino', 'winston']),
|
|
37
38
|
tests: { ...one(tests, ['vitest', 'jest']), module: tests === 'jest' ? '@jest/globals' : 'vitest' },
|
|
38
|
-
worker: { on: config.worker, off: !config.worker },
|
|
39
39
|
config: platformPaths(config),
|
|
40
40
|
alias: aliasVars(config),
|
|
41
41
|
persistence: persistenceVars(config),
|
|
42
42
|
tenancy: { ...one(tenancy, ['none', 'shared-table']), any: tenancy !== 'none' },
|
|
43
|
-
|
|
43
|
+
...backgroundVars(config),
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
+
/** Where the background jobs run and are kept. */
|
|
47
|
+
function backgroundVars(config) {
|
|
48
|
+
return { worker: { on: config.worker, off: !config.worker }, queue: queueVars(config) };
|
|
49
|
+
}
|
|
46
50
|
/**
|
|
47
51
|
* `stored`: the jobs leave the memory of the process. `processTable`: the instances of the
|
|
48
52
|
* process managers go to the database whenever the jobs leave memory and the ORM keeps them.
|
|
@@ -80,6 +84,19 @@ function routeVars(config) {
|
|
|
80
84
|
mountsControllers: declaredControllers || (http !== 'none' && audit === 'on' && routes === 'controllers'),
|
|
81
85
|
};
|
|
82
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* `negotiated`: the boundary registers the representations of the kit; `forms`: the composition
|
|
89
|
+
* root serves the forms of the routes. Either one decides the restricted fields through the
|
|
90
|
+
* `Access` of the application, which `presentation-of.ts` of the platform builds.
|
|
91
|
+
*/
|
|
92
|
+
function presentationVars(config) {
|
|
93
|
+
const { http, representations, forms, audit } = config.stack;
|
|
94
|
+
const negotiated = http !== 'none' && representations === 'negotiated';
|
|
95
|
+
const served = http !== 'none' && forms === 'on';
|
|
96
|
+
const any = negotiated || served;
|
|
97
|
+
// The HTTP boundary takes more than its five ports when the audit trail or the presentation joins them.
|
|
98
|
+
return { negotiated, forms: served, any, widensEdge: any || audit === 'on' };
|
|
99
|
+
}
|
|
83
100
|
function assemblyVars(config) {
|
|
84
101
|
const { style, assembly } = config.stack;
|
|
85
102
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-vars.js","sourceRoot":"","sources":["../../src/stack/stack-vars.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,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,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;IAE9B,OAAO;QACL,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5D,GAAG,EAAE,IAAI,KAAK,MAAM;QACpB,KAAK,EAAE,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,MAAM;KACnE,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,MAAc;IACnC,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,WAAW,EAAE,MAAM,CAAC,WAAW;KAChC,CAAC;AACJ,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.14.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.14.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ddd-ts-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Bootstrap, scaffold and verify DDD and Clean Architecture TypeScript projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"clean:packages": "node dist/bin.js check --clean-only ../kernel/src ../validation/src ../http/src ../tracing/src ../di/src ../events/src ../testing/src ../s3/src ../drizzle/src ../knex/src ../prisma/src ../typeorm/src ../aspects/src ../rabbitmq/src ../auth/src ../audit/src ../redis/src ../scheduling/src ../pino/src ../winston/src ../sentry/src ../kafka/src ../nats/src ../eslint-plugin/src"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ddd-ts-kit/kernel": "^0.
|
|
32
|
+
"@ddd-ts-kit/kernel": "^0.14.0"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -262,6 +262,21 @@
|
|
|
262
262
|
"FORBIDDEN"
|
|
263
263
|
]
|
|
264
264
|
},
|
|
265
|
+
{{#if presentation.negotiated}}
|
|
266
|
+
"406": {
|
|
267
|
+
"description": "Not Acceptable. Error codes: NOT_ACCEPTABLE.",
|
|
268
|
+
"content": {
|
|
269
|
+
"application/problem+json": {
|
|
270
|
+
"schema": {
|
|
271
|
+
"$ref": "#/components/schemas/Problem"
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"x-error-codes": [
|
|
276
|
+
"NOT_ACCEPTABLE"
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
{{/if}}
|
|
265
280
|
"422": {
|
|
266
281
|
"description": "Unprocessable Content. Error codes: VALIDATION_FAILED.",
|
|
267
282
|
"content": {
|
|
@@ -8,7 +8,7 @@ A ddd-ts-kit project: one bounded context per directory of `{{config.contextsDir
|
|
|
8
8
|
- `npx ddd-ts-kit check --changed-since <ref>`: the architecture rules on what changed; `npx ddd-ts-kit explain <rule-id>` gives the reason and an example.
|
|
9
9
|
- `npx ddd-ts-kit list --json`: the map of the contexts. `npx ddd-ts-kit describe <context> --json`: one context as data (use cases, routes, events, ports, dependencies).
|
|
10
10
|
- `npx ddd-ts-kit status`: the next step of the plan, the slices by status, the markers left per context. `npx ddd-ts-kit todo [<context>]`: each remaining `TODO(domain)` and `it.todo` as `file:line`.
|
|
11
|
-
- `npx ddd-ts-kit docs`: regenerates the context map and the generated sections of each `CONTEXT.md`; `npm run docs:generate` the OpenAPI contract and the event catalog.
|
|
11
|
+
- `npx ddd-ts-kit docs`: regenerates the context map and the generated sections of each `CONTEXT.md`; `npm run docs:generate` the OpenAPI contract, the forms and the event catalog.
|
|
12
12
|
|
|
13
13
|
## Read less
|
|
14
14
|
|
|
@@ -29,7 +29,7 @@ Never edit `<context>.declarations.ts`: `generate`, `docs` and `npm run dev` rew
|
|
|
29
29
|
{{#if assembly.discovery}}
|
|
30
30
|
Never edit `<context>.dependencies.ts`: `generate`, `docs` and `npm run dev` rewrite it from the constructor signatures (it registers what each constructor is injected). After changing a constructor by hand, `npx ddd-ts-kit docs`.
|
|
31
31
|
{{/if}}
|
|
32
|
-
Never edit the contracts under `openapi/` (`openapi/openapi.yaml`, one file per document when `openapi.documents` splits it), `docs/integration/asyncapi.yaml`, `docs/integration/event-catalog.md`, `{{config.platformDir}}/http/openapi-documents.ts`, `.dependency-cruiser.cjs` or the generated sections of a `CONTEXT.md`: change the code or the config, then `npm run docs:generate`, `npx ddd-ts-kit docs` and `npx ddd-ts-kit depcruise-config --write`. `stored-events.lock.json` is written by `npx ddd-ts-kit docs --stored-events` once the shape of a version is final (`docs --check` fails while one is unrecorded), never by hand: a stored shape changes only by a new version with its upcaster (`event-sourcing/upcaster-required`).
|
|
32
|
+
Never edit the contracts under `openapi/` (`openapi/openapi.yaml`, one file per document when `openapi.documents` splits it, the forms of `openapi/forms/`), `docs/integration/asyncapi.yaml`, `docs/integration/event-catalog.md`, `{{config.platformDir}}/http/openapi-documents.ts`, `.dependency-cruiser.cjs` or the generated sections of a `CONTEXT.md`: change the code or the config, then `npm run docs:generate`, `npx ddd-ts-kit docs` and `npx ddd-ts-kit depcruise-config --write`. `stored-events.lock.json` is written by `npx ddd-ts-kit docs --stored-events` once the shape of a version is final (`docs --check` fails while one is unrecorded), never by hand: a stored shape changes only by a new version with its upcaster (`event-sourcing/upcaster-required`).
|
|
33
33
|
{{#if sdk.on}}
|
|
34
34
|
{{sdk.instruction}}
|
|
35
35
|
{{/if}}
|
|
@@ -45,9 +45,12 @@ import { multipartUploads } from '@ddd-ts-kit/http/uploads';
|
|
|
45
45
|
{{/if}}
|
|
46
46
|
import { tracedRoutes } from '@ddd-ts-kit/tracing';
|
|
47
47
|
import { principalOf } from '{{alias.platform}}/auth/principal-of{{alias.ext}}';
|
|
48
|
+
{{#if presentation.any}}
|
|
49
|
+
import type { Presentation } from '{{alias.platform}}/http/presentation-of{{alias.ext}}';
|
|
50
|
+
{{/if}}
|
|
48
51
|
|
|
49
52
|
/** What the HTTP adapter needs at the edge of the application: spread into its mount options, for every route. */
|
|
50
|
-
export interface HttpBoundary {
|
|
53
|
+
export interface HttpBoundary{{#if presentation.any}} extends Presentation{{/if}} {
|
|
51
54
|
readonly resolvePrincipal: (raw: unknown) => Promise<Session>;
|
|
52
55
|
/** Every handler runs inside it, with the correlation id, the actor and the session of its request. */
|
|
53
56
|
readonly executionScope: ExecutionScope;
|
|
@@ -92,21 +95,29 @@ interface Edge {
|
|
|
92
95
|
/** Where a request answered 5xx is reported, unless a bus already reported its failure. */
|
|
93
96
|
readonly errors: ErrorReporter;
|
|
94
97
|
{{/if}}
|
|
98
|
+
{{#if presentation.any}}
|
|
99
|
+
readonly presentation: Presentation;
|
|
100
|
+
{{/if}}
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
/** A request is authenticated once, then handled inside the execution scope, so infrastructure sees who acts and under which correlation. */
|
|
98
104
|
{{#if errors.none}}
|
|
99
|
-
{{#unless
|
|
105
|
+
{{#unless presentation.widensEdge}}
|
|
100
106
|
export function httpBoundary({ authenticator, executionScope, errorMapper, clock, logger }: Edge): HttpBoundary {
|
|
101
107
|
{{/unless}}
|
|
102
|
-
{{#if
|
|
108
|
+
{{#if presentation.widensEdge}}
|
|
103
109
|
export function httpBoundary({
|
|
104
110
|
authenticator,
|
|
105
111
|
executionScope,
|
|
106
112
|
errorMapper,
|
|
107
113
|
clock,
|
|
108
114
|
logger,
|
|
115
|
+
{{#if audit.on}}
|
|
109
116
|
refusals,
|
|
117
|
+
{{/if}}
|
|
118
|
+
{{#if presentation.any}}
|
|
119
|
+
presentation,
|
|
120
|
+
{{/if}}
|
|
110
121
|
}: Edge): HttpBoundary {
|
|
111
122
|
{{/if}}
|
|
112
123
|
{{/if}}
|
|
@@ -121,11 +132,17 @@ export function httpBoundary({
|
|
|
121
132
|
refusals,
|
|
122
133
|
{{/if}}
|
|
123
134
|
errors,
|
|
135
|
+
{{#if presentation.any}}
|
|
136
|
+
presentation,
|
|
137
|
+
{{/if}}
|
|
124
138
|
}: Edge): HttpBoundary {
|
|
125
139
|
const report = reportHttpErrors(errors);
|
|
126
140
|
|
|
127
141
|
{{/if}}
|
|
128
142
|
return {
|
|
143
|
+
{{#if presentation.any}}
|
|
144
|
+
...presentation,
|
|
145
|
+
{{/if}}
|
|
129
146
|
resolvePrincipal: principalOf(authenticator),
|
|
130
147
|
executionScope,
|
|
131
148
|
errorMapper,
|
|
@@ -26,6 +26,12 @@ import { auditModule } from '{{alias.platform}}/audit/audit.module{{alias.ext}}'
|
|
|
26
26
|
{{#if http.any}}
|
|
27
27
|
import { httpBoundary, type HttpBoundary } from '{{alias.platform}}/auth/http-boundary{{alias.ext}}';
|
|
28
28
|
{{/if}}
|
|
29
|
+
{{#if presentation.any}}
|
|
30
|
+
import { presentationOf } from '{{alias.platform}}/http/presentation-of{{alias.ext}}';
|
|
31
|
+
{{/if}}
|
|
32
|
+
{{#if presentation.forms}}
|
|
33
|
+
import { withForms } from '{{alias.platform}}/http/with-forms{{alias.ext}}';
|
|
34
|
+
{{/if}}
|
|
29
35
|
{{#if authz.rebac}}
|
|
30
36
|
import { relateSystemActors } from '{{alias.platform}}/auth/relate-system-actors{{alias.ext}}';
|
|
31
37
|
{{/if}}
|
|
@@ -123,10 +129,19 @@ export function composeApplication(
|
|
|
123
129
|
{{/unless}}
|
|
124
130
|
|
|
125
131
|
platform.protection.declare(contexts.flatMap((context) => context.useCases));
|
|
132
|
+
{{#if presentation.any}}
|
|
133
|
+
// What the server answers in and which fields each caller sees: the forms and the contract are given the same.
|
|
134
|
+
const presentation = presentationOf(platform.access, clock);
|
|
135
|
+
{{/if}}
|
|
126
136
|
|
|
127
137
|
return {
|
|
128
138
|
{{#if http.any}}
|
|
139
|
+
{{#if presentation.forms}}
|
|
140
|
+
routes: withForms(defineRoutes(...contexts.map((context) => context.routes)), presentation),
|
|
141
|
+
{{/if}}
|
|
142
|
+
{{#unless presentation.forms}}
|
|
129
143
|
routes: defineRoutes(...contexts.map((context) => context.routes)),
|
|
144
|
+
{{/unless}}
|
|
130
145
|
boundary: httpBoundary({
|
|
131
146
|
authenticator: options.authenticator,
|
|
132
147
|
executionScope: platform.scope,
|
|
@@ -138,6 +153,9 @@ export function composeApplication(
|
|
|
138
153
|
{{/if}}
|
|
139
154
|
{{#if errors.sentry}}
|
|
140
155
|
errors: platform.errors,
|
|
156
|
+
{{/if}}
|
|
157
|
+
{{#if presentation.any}}
|
|
158
|
+
presentation,
|
|
141
159
|
{{/if}}
|
|
142
160
|
}),
|
|
143
161
|
{{/if}}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { installAspectRuntime } from '@ddd-ts-kit/aspects';
|
|
2
2
|
{{#if http.any}}
|
|
3
|
+
{{#if presentation.any}}
|
|
4
|
+
import { Access, Authenticator } from '@ddd-ts-kit/auth';
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#unless presentation.any}}
|
|
3
7
|
import { Authenticator } from '@ddd-ts-kit/auth';
|
|
8
|
+
{{/unless}}
|
|
4
9
|
{{/if}}
|
|
5
10
|
import {
|
|
6
11
|
{{#if routes.declaredControllers}}
|
|
@@ -94,6 +99,12 @@ import { securitySchemes } from '{{alias.platform}}/auth/security-schemes{{alias
|
|
|
94
99
|
{{#if http.any}}
|
|
95
100
|
import { httpBoundary, type HttpBoundary } from '{{alias.platform}}/auth/http-boundary{{alias.ext}}';
|
|
96
101
|
{{/if}}
|
|
102
|
+
{{#if presentation.any}}
|
|
103
|
+
import { presentationOf } from '{{alias.platform}}/http/presentation-of{{alias.ext}}';
|
|
104
|
+
{{/if}}
|
|
105
|
+
{{#if presentation.forms}}
|
|
106
|
+
import { withForms } from '{{alias.platform}}/http/with-forms{{alias.ext}}';
|
|
107
|
+
{{/if}}
|
|
97
108
|
{{#if authz.rebac}}
|
|
98
109
|
import { relateSystemActors } from '{{alias.platform}}/auth/relate-system-actors{{alias.ext}}';
|
|
99
110
|
{{/if}}
|
|
@@ -271,10 +282,19 @@ function kernel(foundations: Foundations, persistence: Persistence, options: App
|
|
|
271
282
|
|
|
272
283
|
function running(container: Container, options: ApplicationOptions, contexts: ContextSelection): Application {
|
|
273
284
|
const logger = container.resolve(Logger);
|
|
285
|
+
{{#if presentation.any}}
|
|
286
|
+
// What the server answers in and which fields each caller sees: the forms and the contract are given the same.
|
|
287
|
+
const presentation = presentationOf(container.resolve(Access), container.resolve(Clock));
|
|
288
|
+
{{/if}}
|
|
274
289
|
|
|
275
290
|
return {
|
|
276
291
|
{{#if http.any}}
|
|
292
|
+
{{#if presentation.forms}}
|
|
293
|
+
routes: withForms(routesOf(container, contexts), presentation),
|
|
294
|
+
{{/if}}
|
|
295
|
+
{{#unless presentation.forms}}
|
|
277
296
|
routes: routesOf(container, contexts),
|
|
297
|
+
{{/unless}}
|
|
278
298
|
boundary: httpBoundary({
|
|
279
299
|
authenticator: container.resolve(Authenticator),
|
|
280
300
|
executionScope: container.resolve(ExecutionScope),
|
|
@@ -289,6 +309,9 @@ function running(container: Container, options: ApplicationOptions, contexts: Co
|
|
|
289
309
|
{{/if}}
|
|
290
310
|
{{#if errors.sentry}}
|
|
291
311
|
errors: container.resolve(ErrorReporter),
|
|
312
|
+
{{/if}}
|
|
313
|
+
{{#if presentation.any}}
|
|
314
|
+
presentation,
|
|
292
315
|
{{/if}}
|
|
293
316
|
}),
|
|
294
317
|
{{/if}}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Access } from '@ddd-ts-kit/auth';
|
|
2
|
+
{{#if presentation.negotiated}}
|
|
3
|
+
import { Representations, fieldDeciderOf, type FieldDecider } from '@ddd-ts-kit/http';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#unless presentation.negotiated}}
|
|
6
|
+
import { fieldDeciderOf, type FieldDecider } from '@ddd-ts-kit/http';
|
|
7
|
+
{{/unless}}
|
|
8
|
+
import type { Clock } from '@ddd-ts-kit/kernel';
|
|
9
|
+
|
|
10
|
+
/** How the answers of the application are presented, the same for the server, the forms and the contract. */
|
|
11
|
+
export interface Presentation {
|
|
12
|
+
{{#if presentation.negotiated}}
|
|
13
|
+
/** JSON, XML and CSV: each request is answered in the one its `Accept` header prefers among those its route declares in `produces`. */
|
|
14
|
+
readonly representations: Representations;
|
|
15
|
+
{{/if}}
|
|
16
|
+
/** Decides the fields a schema reserves to some callers (`withFieldAccess`), through the policies and the authorizer of the application. */
|
|
17
|
+
readonly fieldAccess: FieldDecider;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function presentationOf(access: Access, clock: Clock): Presentation {
|
|
21
|
+
return {
|
|
22
|
+
{{#if presentation.negotiated}}
|
|
23
|
+
representations: Representations.standard(),
|
|
24
|
+
{{/if}}
|
|
25
|
+
fieldAccess: fieldDeciderOf({ access, clock }),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -34,7 +34,7 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
|
|
|
34
34
|
{{/if}}
|
|
35
35
|
app.use(express.json());
|
|
36
36
|
{{#if docs.any}}
|
|
37
|
-
mountExpress(app, withDocumentation(served.routes, config), served.boundary);
|
|
37
|
+
mountExpress(app, withDocumentation(served.routes, config, served.boundary), served.boundary);
|
|
38
38
|
{{/if}}
|
|
39
39
|
{{#unless docs.any}}
|
|
40
40
|
mountExpress(app, served.routes, served.boundary);
|
|
@@ -29,7 +29,7 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
|
|
|
29
29
|
mountFastify(app, served.fileRoutes, served.boundary);
|
|
30
30
|
{{/if}}
|
|
31
31
|
{{#if docs.any}}
|
|
32
|
-
mountFastify(app, withDocumentation(served.routes, config), served.boundary);
|
|
32
|
+
mountFastify(app, withDocumentation(served.routes, config, served.boundary), served.boundary);
|
|
33
33
|
{{/if}}
|
|
34
34
|
{{#unless docs.any}}
|
|
35
35
|
mountFastify(app, served.routes, served.boundary);
|
|
@@ -31,7 +31,7 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
|
|
|
31
31
|
guardTheDoor(app, served, config);
|
|
32
32
|
{{/if}}
|
|
33
33
|
{{#if docs.any}}
|
|
34
|
-
mountHono(app, withDocumentation(served.routes, config), served.boundary);
|
|
34
|
+
mountHono(app, withDocumentation(served.routes, config, served.boundary), served.boundary);
|
|
35
35
|
{{/if}}
|
|
36
36
|
{{#unless docs.any}}
|
|
37
37
|
mountHono(app, served.routes, served.boundary);
|
|
@@ -38,7 +38,7 @@ interface Outgoing {
|
|
|
38
38
|
export async function startHttpServer(served: Served, config: AppConfig): Promise<HttpServer> {
|
|
39
39
|
{{#if files.http}}
|
|
40
40
|
{{#if docs.any}}
|
|
41
|
-
const routes = [...withDocumentation(served.routes, config), ...served.fileRoutes];
|
|
41
|
+
const routes = [...withDocumentation(served.routes, config, served.boundary), ...served.fileRoutes];
|
|
42
42
|
{{/if}}
|
|
43
43
|
{{#unless docs.any}}
|
|
44
44
|
const routes = [...served.routes, ...served.fileRoutes];
|
|
@@ -47,7 +47,7 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
|
|
|
47
47
|
{{/if}}
|
|
48
48
|
{{#unless files.http}}
|
|
49
49
|
{{#if docs.any}}
|
|
50
|
-
const app = await NestFactory.create(createAppModule(withDocumentation(served.routes, config), served.boundary), {
|
|
50
|
+
const app = await NestFactory.create(createAppModule(withDocumentation(served.routes, config, served.boundary), served.boundary), {
|
|
51
51
|
logger: ['error', 'warn'],
|
|
52
52
|
});
|
|
53
53
|
{{/if}}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import type { Route } from '@ddd-ts-kit/http';
|
|
1
|
+
import type { ExecuteOptions, Route } from '@ddd-ts-kit/http';
|
|
2
2
|
import { openApiDocumentsRoutes } from '@ddd-ts-kit/http/docs';
|
|
3
3
|
import { generateOpenApi, routesByDocument } from '@ddd-ts-kit/http/openapi';
|
|
4
4
|
import { securitySchemes } from '{{alias.platform}}/auth/security-schemes{{alias.ext}}';
|
|
5
5
|
import type { AppConfig } from '{{alias.platform}}/config/app-config{{alias.ext}}';
|
|
6
6
|
import { OPENAPI_DOCUMENTS } from '{{alias.platform}}/http/openapi-documents{{alias.ext}}';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Adds the contract and its interactive page next to the routes, one per document of a split
|
|
10
|
+
* contract, unless documentation is switched off (API_DOCS, off in production by default). The
|
|
11
|
+
* contract is written with the error mapper and the representations the routes are mounted with.
|
|
12
|
+
*/
|
|
13
|
+
export function withDocumentation(
|
|
14
|
+
routes: readonly Route[],
|
|
15
|
+
config: AppConfig,
|
|
16
|
+
boundary: Pick<ExecuteOptions, 'errorMapper' | 'representations'>,
|
|
17
|
+
): readonly Route[] {
|
|
10
18
|
if (!config.docsEnabled) {
|
|
11
19
|
return routes;
|
|
12
20
|
}
|
|
@@ -17,6 +25,8 @@ export function withDocumentation(routes: readonly Route[], config: AppConfig):
|
|
|
17
25
|
info: { title: title ?? config.serviceName, version: config.serviceVersion },
|
|
18
26
|
routes: selected,
|
|
19
27
|
securitySchemes,
|
|
28
|
+
...(boundary.errorMapper === undefined ? {} : { errorMapper: boundary.errorMapper }),
|
|
29
|
+
...(boundary.representations === undefined ? {} : { representations: boundary.representations }),
|
|
20
30
|
}),
|
|
21
31
|
}));
|
|
22
32
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { defineRoutes, formRoutes, type Route } from '@ddd-ts-kit/http';
|
|
2
|
+
import type { Presentation } from '{{alias.platform}}/http/presentation-of{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
/** The routes, and the form of each one that declares `form`, at `GET /forms/<operationId>`, for the caller who asks. */
|
|
5
|
+
export function withForms(routes: readonly Route[], { fieldAccess }: Presentation): readonly Route[] {
|
|
6
|
+
return defineRoutes(routes, formRoutes(routes, { fieldAccess }));
|
|
7
|
+
}
|
|
@@ -30,7 +30,7 @@ paths:
|
|
|
30
30
|
{{#if files.any}}
|
|
31
31
|
- A file arrives in the command as a `FileUpload` of its area, which the bus stages before the transaction under a key of `FileKeys` (never a name or a path from the user) and scans; the handler records `upload.file`, its `StoredFile`, on the aggregate and calls `FileStaging.promoteOnCommit`, which moves it to its key with the commit. A direct upload is confirmed from the `PendingUpload` the aggregate kept, never from a key the client sends. The ports are named here, never a connector (`files/port-not-connector`); `npx ddd-ts-kit generate file-upload` writes the slice.
|
|
32
32
|
{{/if}}
|
|
33
|
-
- A query never saves, deletes or publishes (`application/command-query-separation`); it hands the access scope of the actor to its read port and never filters after loading.
|
|
33
|
+
- A query never saves, deletes or publishes (`application/command-query-separation`); it hands the access scope of the actor to its read port and never filters after loading, and answers every field its read model holds: a field reserved to some callers is marked on the response schema with `withFieldAccess` of `@ddd-ts-kit/http`, never removed by a test on the roles of the actor (`authz/fields-by-schema`).
|
|
34
34
|
- A read that takes criteria, a scope or a page is a search, never a list (`naming/search-not-list`): `Search<Things>Query` in `queries/search-<things>/` (`generate query ... --search`), `search...` on the port, its adapters and its fakes; one element or none stays `findById` or `findBy...`.
|
|
35
35
|
{{#if literals.named}}
|
|
36
36
|
- A permission, a role or a status is read from its declaration, `billingPermissions['invoice.issue']`, `InvoiceStatus.Issued`, never written as a string (`language/declared-vocabulary`); a number has a name (`clean/no-magic-number`).
|
|
@@ -27,7 +27,7 @@ paths:
|
|
|
27
27
|
{{#if refusals.classes}}
|
|
28
28
|
- Every route says who may call it (its group or its guards for a controller, `security` for a function) and the `DomainError` codes it can answer in `errors`; the mapping from code to status lives in one place, the error mapper.
|
|
29
29
|
{{/if}}
|
|
30
|
-
- No role or ownership test in a controller or a route (`authz/in-application`): a guard of the group asks for a role at the edge, the bus asks for the permission, a policy decides on loaded state.
|
|
30
|
+
- No role or ownership test in a controller or a route (`authz/in-application`): a guard of the group asks for a role at the edge, the bus asks for the permission, a policy decides on loaded state. A field reserved to some callers is marked on its schema, `withFieldAccess(schema, { field: { read, write } })`, never by an `if` on a role (`authz/fields-by-schema`).{{#if presentation.negotiated}} Other media types are `produces` and `consumes` of the declaration (`generate representation`), from the same schema. A streamed export is `everyPage` over the search query of one page, sent through the bus page by page, never a query handler that answers a lazy list.{{/if}}{{#if presentation.forms}} A form is `defineForm` hints next to the body (`generate form`): shape and presentation, never a business rule; it `requires` the permission of its use case, asked as its `@Requires` asks it.{{/if}}
|
|
31
31
|
- Request and response types are presentation types, one class or schema per file next to the controller (`*.body.ts`, `*.params.ts`, `*.answer.ts`...; `*.dto.ts` for function routes and under `shared/`): never an aggregate, never a row.
|
|
32
32
|
{{#if schemas.shared}}
|
|
33
33
|
- A shape several routes use is declared once, in `presentation/http/shared/<name>.schema.ts` (`npx ddd-ts-kit generate schema <context> <Name>`), or in `presentation/` of the shared kernel when several contexts answer with it (`generate schema shared-kernel <Name>`), and shared: the contract documents it once and every route refers to it. A route takes the part it needs from it (pick, omit, partial, extend) instead of copying it, and answers an identifier with `acceptedSchema` of `@ddd-ts-kit/http` (`schema/no-duplicate-shape`). Only presentation layers import a schema (`schema/presentation-only`).
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
{{#if presentation.forms}}
|
|
4
|
+
import { formDocumentsOf } from '@ddd-ts-kit/http';
|
|
5
|
+
{{/if}}
|
|
3
6
|
import { generateOpenApi, routesByDocument } from '@ddd-ts-kit/http/openapi';
|
|
4
7
|
import { contractFormat, stringifyContract } from 'ddd-ts-kit/dist/contracts.js';
|
|
5
8
|
import { offlineAuthenticator } from '{{alias.platform}}/auth/offline-authenticator{{alias.ext}}';
|
|
@@ -11,6 +14,9 @@ import { OPENAPI_DOCUMENTS } from '{{alias.platform}}/http/openapi-documents{{al
|
|
|
11
14
|
|
|
12
15
|
// Generates the contract from the route definitions: openapi/openapi.yaml, or one file per
|
|
13
16
|
// document of "openapi.documents" in ddd-ts-kit.config.json, in the format of "openapi.format";
|
|
17
|
+
{{#if presentation.forms}}
|
|
18
|
+
// the form of every route that declares one, whole, in openapi/forms/<operationId>.json;
|
|
19
|
+
{{/if}}
|
|
14
20
|
// with --check, fails when a committed file differs. Build products: never edit them by hand.
|
|
15
21
|
const directory = path.resolve('openapi');
|
|
16
22
|
const format = contractFormat();
|
|
@@ -20,8 +26,8 @@ const application = composeApplication(inertPersistence(), {
|
|
|
20
26
|
authenticator: offlineAuthenticator,
|
|
21
27
|
});
|
|
22
28
|
|
|
23
|
-
const generated = new Map(
|
|
24
|
-
routesByDocument(application.routes, OPENAPI_DOCUMENTS).map(({ name, title, routes }) => [
|
|
29
|
+
const generated = new Map([
|
|
30
|
+
...routesByDocument(application.routes, OPENAPI_DOCUMENTS).map(({ name, title, routes }): [string, string] => [
|
|
25
31
|
`${name}.${format}`,
|
|
26
32
|
stringifyContract(
|
|
27
33
|
generateOpenApi({
|
|
@@ -29,22 +35,30 @@ const generated = new Map(
|
|
|
29
35
|
routes,
|
|
30
36
|
securitySchemes,
|
|
31
37
|
errorMapper: application.boundary.errorMapper,
|
|
38
|
+
{{#if presentation.negotiated}}
|
|
39
|
+
representations: application.boundary.representations,
|
|
40
|
+
{{/if}}
|
|
32
41
|
}),
|
|
33
42
|
format,
|
|
34
43
|
),
|
|
35
44
|
]),
|
|
36
|
-
|
|
45
|
+
{{#if presentation.forms}}
|
|
46
|
+
...(await formDocumentsOf(application.routes)).map((form): [string, string] => [
|
|
47
|
+
`forms/${form.operation}.json`,
|
|
48
|
+
`${JSON.stringify({ jsonForms: form.jsonForms, blocks: form.blocks }, null, 2)}\n`,
|
|
49
|
+
]),
|
|
50
|
+
{{/if}}
|
|
51
|
+
]);
|
|
37
52
|
|
|
38
53
|
if (process.argv.includes('--check')) {
|
|
39
54
|
reportDrift();
|
|
40
55
|
} else {
|
|
41
|
-
fs.mkdirSync(directory, { recursive: true });
|
|
42
|
-
|
|
43
56
|
for (const file of staleFiles()) {
|
|
44
57
|
fs.rmSync(path.join(directory, file));
|
|
45
58
|
}
|
|
46
59
|
|
|
47
60
|
for (const [file, content] of generated) {
|
|
61
|
+
fs.mkdirSync(path.dirname(path.join(directory, file)), { recursive: true });
|
|
48
62
|
fs.writeFileSync(path.join(directory, file), content);
|
|
49
63
|
}
|
|
50
64
|
}
|
|
@@ -66,9 +80,16 @@ function reportDrift(): void {
|
|
|
66
80
|
}
|
|
67
81
|
}
|
|
68
82
|
|
|
69
|
-
/** The contracts left by another format or by a document that is gone. */
|
|
83
|
+
/** The contracts left by another format or by a document that is gone{{#if presentation.forms}}, and the forms of routes that declare none any more{{/if}}: what else the folder holds is left alone. */
|
|
70
84
|
function staleFiles(): string[] {
|
|
85
|
+
{{#if presentation.forms}}
|
|
86
|
+
const forms = path.join(directory, 'forms');
|
|
87
|
+
const formFiles = fs.existsSync(forms) ? fs.readdirSync(forms).map((file) => `forms/${file}`) : [];
|
|
88
|
+
const present = [...(fs.existsSync(directory) ? fs.readdirSync(directory) : []), ...formFiles];
|
|
89
|
+
{{/if}}
|
|
90
|
+
{{#unless presentation.forms}}
|
|
71
91
|
const present = fs.existsSync(directory) ? fs.readdirSync(directory) : [];
|
|
92
|
+
{{/unless}}
|
|
72
93
|
|
|
73
94
|
return present.filter((file) => /\.(?:json|yaml)$/.test(file) && !generated.has(file));
|
|
74
95
|
}
|