ddd-ts-kit 0.8.0 → 0.9.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/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/errors/kit-error-codes.d.ts.map +1 -1
- package/dist/check/errors/kit-error-codes.js +5 -0
- package/dist/check/errors/kit-error-codes.js.map +1 -1
- package/dist/check/explain/errors-docs.js +1 -1
- package/dist/check/explain/errors-docs.js.map +1 -1
- package/dist/check/explain/persistence-docs.d.ts.map +1 -1
- package/dist/check/explain/persistence-docs.js +26 -0
- package/dist/check/explain/persistence-docs.js.map +1 -1
- package/dist/check/files/file-content-findings.d.ts +4 -0
- package/dist/check/files/file-content-findings.d.ts.map +1 -0
- package/dist/check/files/file-content-findings.js +29 -0
- package/dist/check/files/file-content-findings.js.map +1 -0
- package/dist/check/files/file-content-pattern.d.ts +7 -0
- package/dist/check/files/file-content-pattern.d.ts.map +1 -0
- package/dist/check/files/file-content-pattern.js +17 -0
- package/dist/check/files/file-content-pattern.js.map +1 -0
- package/dist/check/files/schema-sources.d.ts +13 -0
- package/dist/check/files/schema-sources.d.ts.map +1 -0
- package/dist/check/files/schema-sources.js +37 -0
- package/dist/check/files/schema-sources.js.map +1 -0
- package/dist/check/fixtures/files-fixtures.d.ts +3 -0
- package/dist/check/fixtures/files-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/files-fixtures.js +92 -0
- package/dist/check/fixtures/files-fixtures.js.map +1 -0
- 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/layers/outside-concern.d.ts.map +1 -1
- package/dist/check/layers/outside-concern.js +4 -0
- package/dist/check/layers/outside-concern.js.map +1 -1
- package/dist/check/rules/files-port-not-connector.d.ts +3 -0
- package/dist/check/rules/files-port-not-connector.d.ts.map +1 -0
- package/dist/check/rules/files-port-not-connector.js +28 -0
- package/dist/check/rules/files-port-not-connector.js.map +1 -0
- package/dist/check/rules/persistence-no-file-content.d.ts +3 -0
- package/dist/check/rules/persistence-no-file-content.d.ts.map +1 -0
- package/dist/check/rules/persistence-no-file-content.js +14 -0
- package/dist/check/rules/persistence-no-file-content.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -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 +2 -1
- package/dist/config/parse-stack.js.map +1 -1
- package/dist/config/stack.d.ts +8 -0
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +1 -0
- package/dist/config/stack.js.map +1 -1
- package/dist/generate/kinds/file-upload/write-upload-controller.d.ts +5 -0
- package/dist/generate/kinds/file-upload/write-upload-controller.d.ts.map +1 -0
- package/dist/generate/kinds/file-upload/write-upload-controller.js +42 -0
- package/dist/generate/kinds/file-upload/write-upload-controller.js.map +1 -0
- package/dist/generate/kinds/file-upload-kind.d.ts +3 -0
- package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -0
- package/dist/generate/kinds/file-upload-kind.js +55 -0
- package/dist/generate/kinds/file-upload-kind.js.map +1 -0
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +2 -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.d.ts.map +1 -1
- package/dist/init/files/platform-files.js +22 -0
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-for.js +7 -1
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/versions.d.ts.map +1 -1
- package/dist/init/manifest/versions.js +28 -23
- package/dist/init/manifest/versions.js.map +1 -1
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +11 -2
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/stack-options.d.ts +1 -0
- package/dist/init/stack/stack-options.d.ts.map +1 -1
- package/dist/init/template-vars.d.ts.map +1 -1
- package/dist/init/template-vars.js +3 -2
- package/dist/init/template-vars.js.map +1 -1
- package/dist/stack/files-vars.d.ts +5 -0
- package/dist/stack/files-vars.d.ts.map +1 -0
- package/dist/stack/files-vars.js +11 -0
- package/dist/stack/files-vars.js.map +1 -0
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +13 -4
- 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 +3 -3
- package/templates/file-upload/command.ts.tpl +41 -0
- package/templates/file-upload/controller.spec.ts.tpl +46 -0
- package/templates/file-upload/controller.ts.tpl +23 -0
- package/templates/file-upload/handler.declared.ts.tpl +18 -0
- package/templates/file-upload/handler.spec.ts.tpl +79 -0
- package/templates/file-upload/handler.ts.tpl +16 -0
- package/templates/file-upload/wiring.manual.tpl +9 -0
- package/templates/file-upload/wiring.tsyringe.tpl +7 -0
- package/templates/init/README.md.tpl +22 -0
- package/templates/init/docker/docker-compose.yml.tpl +25 -0
- package/templates/init/docker/env.example.tpl +21 -0
- package/templates/init/gitignore.tpl +3 -0
- package/templates/init/main.ts.tpl +6 -0
- package/templates/init/platform/auth/http-boundary.ts.tpl +25 -1
- package/templates/init/platform/buses/create-command-bus.ts.tpl +7 -1
- package/templates/init/platform/compose-application.manual.ts.tpl +25 -0
- package/templates/init/platform/compose-application.tsyringe.ts.tpl +31 -0
- package/templates/init/platform/config/app-config.ts.tpl +7 -0
- package/templates/init/platform/config/load-config.ts.tpl +9 -0
- package/templates/init/platform/config/read-files.local.ts.tpl +39 -0
- package/templates/init/platform/config/read-files.s3.ts.tpl +42 -0
- package/templates/init/platform/create-platform.manual.ts.tpl +38 -1
- package/templates/init/platform/files/bind-files.tsyringe.ts.tpl +32 -0
- package/templates/init/platform/files/create-files.ts.tpl +34 -0
- package/templates/init/platform/files/file-routes.ts.tpl +10 -0
- package/templates/init/platform/files/files.module.tsyringe.ts.tpl +18 -0
- package/templates/init/platform/files/open-files.local.ts.tpl +13 -0
- package/templates/init/platform/files/open-files.s3.ts.tpl +10 -0
- package/templates/init/platform/files/staging-uploads.tsyringe.ts.tpl +11 -0
- package/templates/init/platform/http/start-http-server.express.ts.tpl +5 -1
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +4 -1
- package/templates/init/platform/http/start-http-server.nest.ts.tpl +12 -1
- package/templates/init/platform/platform-test.module.tsyringe.ts.tpl +11 -0
- package/templates/init/platform/platform.manual.ts.tpl +7 -0
- package/templates/init/rules/application.md.tpl +3 -0
- package/templates/init/rules/infrastructure.md.tpl +1 -0
- package/templates/init/rules/platform.md.tpl +3 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/service/main.ts.tpl +6 -0
- package/templates/worker/main.ts.tpl +6 -0
|
@@ -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,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,aAAa,EACb,WAAW,EACX,gB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":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAM5D,6GAA6G;AAC7G,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"template-vars.d.ts","sourceRoot":"","sources":["../../src/init/template-vars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAM5D,6GAA6G;AAC7G,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,aAAa,CA8B/E"}
|
|
@@ -7,7 +7,7 @@ import { knipVars } from './knip-vars.js';
|
|
|
7
7
|
const KEYCLOAK_VERSION = '26.8.0';
|
|
8
8
|
/** What the templates of `init` read: the variables of the stack, then the ones only a new project needs. */
|
|
9
9
|
export function templateVars(config, projectName) {
|
|
10
|
-
const { database, docsUi, ci, cache, broker, errors } = config.stack;
|
|
10
|
+
const { database, docsUi, ci, cache, broker, errors, storage } = config.stack;
|
|
11
11
|
return {
|
|
12
12
|
...stackVars(config),
|
|
13
13
|
project: { name: projectName },
|
|
@@ -24,7 +24,8 @@ export function templateVars(config, projectName) {
|
|
|
24
24
|
database === 'mysql' ||
|
|
25
25
|
cache === 'redis' ||
|
|
26
26
|
['redis', 'nats'].includes(broker) ||
|
|
27
|
-
errors === 'sentry'
|
|
27
|
+
errors === 'sentry' ||
|
|
28
|
+
storage === 's3',
|
|
28
29
|
},
|
|
29
30
|
database: {
|
|
30
31
|
postgres: database === 'postgres',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-vars.js","sourceRoot":"","sources":["../../src/init/template-vars.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAA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|
|
2
|
+
import type { RenderContext } from '../templating/index.js';
|
|
3
|
+
/** Where the content of files lives, and whether the routes that receive and serve them exist. */
|
|
4
|
+
export declare function filesVars(config: Config): RenderContext;
|
|
5
|
+
//# sourceMappingURL=files-vars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files-vars.d.ts","sourceRoot":"","sources":["../../src/stack/files-vars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG5D,kGAAkG;AAClG,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAQvD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { one } from './one.js';
|
|
2
|
+
/** Where the content of files lives, and whether the routes that receive and serve them exist. */
|
|
3
|
+
export function filesVars(config) {
|
|
4
|
+
const { storage, http } = config.stack;
|
|
5
|
+
return {
|
|
6
|
+
...one(storage, ['none', 'local', 's3']),
|
|
7
|
+
any: storage !== 'none',
|
|
8
|
+
http: storage !== 'none' && http !== 'none',
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=files-vars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files-vars.js","sourceRoot":"","sources":["../../src/stack/files-vars.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,kGAAkG;AAClG,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;IAEvC,OAAO;QACL,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QACxC,GAAG,EAAE,OAAO,KAAK,MAAM;QACvB,IAAI,EAAE,OAAO,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM;KAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-vars.d.ts","sourceRoot":"","sources":["../../src/stack/stack-vars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"stack-vars.d.ts","sourceRoot":"","sources":["../../src/stack/stack-vars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAc5D,6GAA6G;AAC7G,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CA+BvD"}
|
package/dist/stack/stack-vars.js
CHANGED
|
@@ -8,10 +8,11 @@ import { eventVars } from './event-vars.js';
|
|
|
8
8
|
import { one } from './one.js';
|
|
9
9
|
import { persistenceVars } from './persistence-vars.js';
|
|
10
10
|
import { redisVars } from './redis-vars.js';
|
|
11
|
+
import { filesVars } from './files-vars.js';
|
|
11
12
|
import { usesLegacyDecorators } from './uses-legacy-decorators.js';
|
|
12
13
|
/** The choices of the stack as template variables: what every template of `init` and of `generate` reads. */
|
|
13
14
|
export function stackVars(config) {
|
|
14
|
-
const { validation, di, tests, orm, authz, style, logger,
|
|
15
|
+
const { validation, di, tests, orm, authz, style, logger, tenancy } = config.stack;
|
|
15
16
|
const legacy = usesLegacyDecorators(config);
|
|
16
17
|
return {
|
|
17
18
|
style: one(style, ['declared', 'explicit']),
|
|
@@ -26,12 +27,11 @@ export function stackVars(config) {
|
|
|
26
27
|
authz: one(authz, ['rbac', 'abac', 'rebac', 'custom']),
|
|
27
28
|
broker: brokerVars(config),
|
|
28
29
|
cache: cacheVars(config),
|
|
30
|
+
files: filesVars(config),
|
|
29
31
|
redis: redisVars(config),
|
|
30
32
|
audit: auditVars(config),
|
|
31
33
|
errors: errorVars(config),
|
|
32
|
-
|
|
33
|
-
valueObjects: one(valueObjects, ['throwing', 'result']),
|
|
34
|
-
literals: one(literals, ['named', 'free']),
|
|
34
|
+
...modelWritingVars(config),
|
|
35
35
|
routes: routeVars(config),
|
|
36
36
|
logger: one(logger, ['stdout', 'pino', 'winston']),
|
|
37
37
|
tests: { ...one(tests, ['vitest', 'jest']), module: tests === 'jest' ? '@jest/globals' : 'vitest' },
|
|
@@ -42,6 +42,15 @@ export function stackVars(config) {
|
|
|
42
42
|
tenancy: { ...one(tenancy, ['none', 'shared-table']), any: tenancy !== 'none' },
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
+
/** How the code of the model is written: its refusals, its value objects, its closed values. */
|
|
46
|
+
function modelWritingVars(config) {
|
|
47
|
+
const { refusals, valueObjects, literals } = config.stack;
|
|
48
|
+
return {
|
|
49
|
+
refusals: one(refusals, ['factories', 'classes']),
|
|
50
|
+
valueObjects: one(valueObjects, ['throwing', 'result']),
|
|
51
|
+
literals: one(literals, ['named', 'free']),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
45
54
|
/**
|
|
46
55
|
* `listed`: the routes of a context are a list written in `<context>.routes.ts`. Declared
|
|
47
56
|
* controllers reach the application by themselves, and the composition root mounts them in
|
|
@@ -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,SAA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,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.9.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.9.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.9.0",
|
|
4
4
|
"description": "Bootstrap, scaffold and verify DDD and Clean Architecture TypeScript projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "tsc -b",
|
|
28
28
|
"clean:self": "node dist/bin.js check --clean-only src test",
|
|
29
|
-
"clean:packages": "node dist/bin.js check --clean-only ../kernel/src ../validation/src ../http/src ../tracing/src ../di/src ../events/src ../testing/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"
|
|
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.9.0"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{{#if access.protected}}
|
|
2
|
+
import { AuthorizedCommand, FileUpload, type Actor, type ReceivedFile } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{#if style.declared}}
|
|
4
|
+
import { Requires } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{access.useCasePermissionsImport}}
|
|
6
|
+
{{/if}}
|
|
7
|
+
|
|
8
|
+
{{#if style.declared}}
|
|
9
|
+
@{{access.decoration}}
|
|
10
|
+
{{/if}}
|
|
11
|
+
export class {{name.pascal}}Command extends AuthorizedCommand<string> {
|
|
12
|
+
/** Staged by the bus under a key of its area before the transaction opens: the handler reads `upload.file`. */
|
|
13
|
+
readonly upload: FileUpload;
|
|
14
|
+
|
|
15
|
+
// TODO(domain): add the identifier of what the file is attached to, read from the path by the controller, for example `readonly invoiceId: string`.
|
|
16
|
+
constructor(actor: Actor, file: ReceivedFile) {
|
|
17
|
+
super(actor);
|
|
18
|
+
this.upload = new FileUpload(file, '{{name.kebab}}');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
{{/if}}
|
|
22
|
+
{{#if access.public}}
|
|
23
|
+
import { Command, FileUpload, type ReceivedFile } from '@ddd-ts-kit/kernel';
|
|
24
|
+
{{#if style.declared}}
|
|
25
|
+
import { Public } from '@ddd-ts-kit/kernel/declarations';
|
|
26
|
+
{{/if}}
|
|
27
|
+
|
|
28
|
+
{{#if style.declared}}
|
|
29
|
+
@Public()
|
|
30
|
+
{{/if}}
|
|
31
|
+
export class {{name.pascal}}Command extends Command<string> {
|
|
32
|
+
/** Staged by the bus under a key of its area before the transaction opens: the handler reads `upload.file`. */
|
|
33
|
+
readonly upload: FileUpload;
|
|
34
|
+
|
|
35
|
+
// TODO(domain): add the identifier of what the file is attached to, read from the path by the controller, for example `readonly invoiceId: string`.
|
|
36
|
+
constructor(file: ReceivedFile) {
|
|
37
|
+
super();
|
|
38
|
+
this.upload = new FileUpload(file, '{{name.kebab}}');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
{{/if}}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Readable } from 'node:stream';
|
|
2
|
+
import { describe, expect, it } from '{{tests.module}}';
|
|
3
|
+
import { controllerRoute, executeRoute } from '@ddd-ts-kit/http';
|
|
4
|
+
import { InMemoryCommandBus{{#if route.protected}}, type Actor{{/if}} } from '@ddd-ts-kit/kernel';
|
|
5
|
+
{{route.messageImport}}
|
|
6
|
+
{{route.specImports}}
|
|
7
|
+
|
|
8
|
+
{{#if route.protected}}
|
|
9
|
+
const caller: Actor = { id: 'user-1', type: 'user', roles: [], attributes: {} };
|
|
10
|
+
|
|
11
|
+
{{/if}}
|
|
12
|
+
describe('{{route.method}} {{route.path}}', () => {
|
|
13
|
+
it('declares the file it receives, and hands it to the command as it streams', async () => {
|
|
14
|
+
const received: string[] = [];
|
|
15
|
+
|
|
16
|
+
const commands = new InMemoryCommandBus().register({{route.input}}, {
|
|
17
|
+
execute: async ({ upload }) => {
|
|
18
|
+
received.push(upload.fileName);
|
|
19
|
+
|
|
20
|
+
return 'file-1';
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const route = controllerRoute(new {{name.pascal}}Controller(commands));
|
|
25
|
+
const file = { fileName: 'scan.pdf', mediaType: 'application/pdf', stream: Readable.from([Buffer.from('%PDF-')]) };
|
|
26
|
+
|
|
27
|
+
const response = await executeRoute(
|
|
28
|
+
route,
|
|
29
|
+
{ params: {{route.sampleParams}}, query: {}, headers: {}, body: {}, raw: undefined },
|
|
30
|
+
{
|
|
31
|
+
validateResponses: true,
|
|
32
|
+
uploads: async () => ({ fields: {}, file }),
|
|
33
|
+
{{#if route.protected}}
|
|
34
|
+
resolvePrincipal: () => caller,
|
|
35
|
+
{{/if}}
|
|
36
|
+
},
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
expect(response.status).toBe(201);
|
|
40
|
+
expect(received).toEqual(['scan.pdf']);
|
|
41
|
+
expect(route.upload?.field).toBe('file');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// TODO(domain): replace each entry below by a test of the contract a client relies on.
|
|
45
|
+
it.todo('answers the documented status for each error code of the use case');
|
|
46
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { {{upload.httpImports}} } from '@ddd-ts-kit/http';
|
|
2
|
+
import type { CommandBus } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{route.imports}}
|
|
4
|
+
|
|
5
|
+
@Controller({
|
|
6
|
+
{{route.access}}
|
|
7
|
+
method: '{{route.method}}',
|
|
8
|
+
path: '{{route.groupPath}}',
|
|
9
|
+
summary: '{{name.title}}',
|
|
10
|
+
// TODO(domain): the largest file and the media types "{{name.words}}" accepts: both are part of the contract, and the content is checked against them as it streams.
|
|
11
|
+
upload: { field: 'file', maxBytes: 10_485_760, mediaTypes: ['application/pdf', 'image/png', 'image/jpeg'] },
|
|
12
|
+
response: { status: 201, description: 'Stored; the file is visible once the command has committed.' },
|
|
13
|
+
// TODO(domain): list the codes of the refusals "{{name.words}}" can raise, as their factories set them, so that they appear in the contract with their status (`errors/known-code`).
|
|
14
|
+
errors: [],
|
|
15
|
+
})
|
|
16
|
+
export class {{name.pascal}}Controller {
|
|
17
|
+
constructor(private readonly commands: CommandBus) {}
|
|
18
|
+
|
|
19
|
+
async handle(request: HttpRequest<{ upload: IncomingFile }>): Promise<void> {
|
|
20
|
+
// TODO(domain): hand the command the identifier of what the file is attached to, from `request.params`.
|
|
21
|
+
await this.commands.execute(new {{route.input}}({{#if route.protected}}request.actor, {{/if}}request.upload));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FileStaging } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
|
|
4
|
+
|
|
5
|
+
@CommandHandler({{name.pascal}}Command)
|
|
6
|
+
export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Command> {
|
|
7
|
+
constructor(private readonly staging: FileStaging) {}
|
|
8
|
+
|
|
9
|
+
/** The file arrives staged and scanned; it reaches its key with the commit, and stays staged, then purged, on a rollback. */
|
|
10
|
+
async execute(command: {{name.pascal}}Command): Promise<string> {
|
|
11
|
+
const { file } = command.upload;
|
|
12
|
+
|
|
13
|
+
// TODO(domain): record `file` (key, size, media type, checksum: never the content) on the aggregate "{{name.words}}" attaches it to, and save that aggregate here: the reference commits with the file.
|
|
14
|
+
await this.staging.promoteOnCommit(file.key);
|
|
15
|
+
|
|
16
|
+
return file.key;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Readable } from 'node:stream';
|
|
2
|
+
import { describe, expect, it } from '{{tests.module}}';
|
|
3
|
+
{{#if access.protected}}
|
|
4
|
+
import { AuthorizationMap, RoleBasedAuthorizer, authorizationMiddleware, requires } from '@ddd-ts-kit/auth';
|
|
5
|
+
import { anActor } from '@ddd-ts-kit/auth/testing';
|
|
6
|
+
{{/if}}
|
|
7
|
+
import {
|
|
8
|
+
AcceptEveryFileScanner,
|
|
9
|
+
FileStaging,
|
|
10
|
+
InMemoryErrorReporter,
|
|
11
|
+
InMemoryFileStorage,
|
|
12
|
+
TenantFileKeys,
|
|
13
|
+
fileUploadsMiddleware,
|
|
14
|
+
} from '@ddd-ts-kit/kernel';
|
|
15
|
+
import { createTestBuses } from '@ddd-ts-kit/testing';
|
|
16
|
+
{{#if access.protected}}
|
|
17
|
+
import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
|
|
18
|
+
{{/if}}
|
|
19
|
+
import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
|
|
20
|
+
import { {{name.pascal}}Handler } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.handler{{alias.ext}}';
|
|
21
|
+
{{#if access.protected}}
|
|
22
|
+
|
|
23
|
+
const holders = authorizationMiddleware({
|
|
24
|
+
authorizer: new RoleBasedAuthorizer({
|
|
25
|
+
roles: { holder: [{{context.camel}}Permissions['{{access.permission}}']] },
|
|
26
|
+
}),
|
|
27
|
+
map: AuthorizationMap.of(requires({{name.pascal}}Command, {{context.camel}}Permissions['{{access.permission}}'])),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const holder = anActor().withRole('holder').build();
|
|
31
|
+
{{/if}}
|
|
32
|
+
|
|
33
|
+
const PDF = '%PDF-1.7\n%%EOF\n';
|
|
34
|
+
|
|
35
|
+
describe('{{name.title}}', () => {
|
|
36
|
+
it('keeps the file under a key of its own, visible once the command has committed', async () => {
|
|
37
|
+
const { commandBus, storage } = arrange();
|
|
38
|
+
|
|
39
|
+
const key = await commandBus.execute(new {{name.pascal}}Command({{#if access.protected}}holder, {{/if}}aFile()));
|
|
40
|
+
|
|
41
|
+
expect(storage.keys()).toEqual([key]);
|
|
42
|
+
expect(await storage.stat(key)).toMatchObject({ size: PDF.length, mediaType: 'application/pdf' });
|
|
43
|
+
});
|
|
44
|
+
{{#if access.protected}}
|
|
45
|
+
|
|
46
|
+
it('is refused to an actor who does not hold the permission {{access.permission}}, and keeps nothing', async () => {
|
|
47
|
+
const { commandBus, storage } = arrange();
|
|
48
|
+
const command = new {{name.pascal}}Command(anActor().build(), aFile());
|
|
49
|
+
|
|
50
|
+
await expect(commandBus.execute(command)).rejects.toMatchObject({ code: 'FORBIDDEN' });
|
|
51
|
+
expect(storage.keys()).toEqual([]);
|
|
52
|
+
});
|
|
53
|
+
{{/if}}
|
|
54
|
+
|
|
55
|
+
// TODO(domain): replace each entry below by a test named after the business behaviour of "{{name.words}}": the reference recorded on the aggregate, the refusal that rolls the command back and leaves only a staged file.
|
|
56
|
+
it.todo('records the reference of the file on the aggregate it is attached to');
|
|
57
|
+
it.todo('leaves no visible file when the command is refused');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
function aFile() {
|
|
61
|
+
return { fileName: 'scan.pdf', mediaType: 'application/pdf', stream: Readable.from([Buffer.from(PDF)]) };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function arrange() {
|
|
65
|
+
const { commandBus, clock, ids } = createTestBuses({ idPrefix: 'file' });
|
|
66
|
+
const storage = new InMemoryFileStorage({ clock });
|
|
67
|
+
const staging = new FileStaging(storage, new AcceptEveryFileScanner(), new InMemoryErrorReporter());
|
|
68
|
+
|
|
69
|
+
const keys = new TenantFileKeys(ids, clock);
|
|
70
|
+
|
|
71
|
+
commandBus
|
|
72
|
+
{{#if access.protected}}
|
|
73
|
+
.use(holders)
|
|
74
|
+
{{/if}}
|
|
75
|
+
.use(fileUploadsMiddleware(() => ({ keys, staging })))
|
|
76
|
+
.register({{name.pascal}}Command, new {{name.pascal}}Handler(staging));
|
|
77
|
+
|
|
78
|
+
return { commandBus, storage };
|
|
79
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CommandHandler, FileStaging } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import type { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Command> {
|
|
5
|
+
constructor(private readonly staging: FileStaging) {}
|
|
6
|
+
|
|
7
|
+
/** The file arrives staged and scanned; it reaches its key with the commit, and stays staged, then purged, on a rollback. */
|
|
8
|
+
async execute(command: {{name.pascal}}Command): Promise<string> {
|
|
9
|
+
const { file } = command.upload;
|
|
10
|
+
|
|
11
|
+
// TODO(domain): record `file` (key, size, media type, checksum: never the content) on the aggregate "{{name.words}}" attaches it to, and save that aggregate here: the reference commits with the file.
|
|
12
|
+
await this.staging.promoteOnCommit(file.key);
|
|
13
|
+
|
|
14
|
+
return file.key;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@@imports
|
|
2
|
+
{{access.manualImport}}
|
|
3
|
+
{{access.permissionsImport}}
|
|
4
|
+
import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
|
|
5
|
+
import { {{name.pascal}}Handler } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.handler{{alias.ext}}';
|
|
6
|
+
@@registrations
|
|
7
|
+
platform.commands.register({{name.pascal}}Command, new {{name.pascal}}Handler(platform.files.staging), { context: '{{context.kebab}}' });
|
|
8
|
+
@@authorization
|
|
9
|
+
{{access.manualDeclaration}}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
@@imports
|
|
2
|
+
import { FileStaging } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{access.permissionsImport}}
|
|
4
|
+
import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
|
|
5
|
+
import { {{name.pascal}}Handler } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.handler{{alias.ext}}';
|
|
6
|
+
@@registrations
|
|
7
|
+
builder.command({{name.pascal}}Command){{access.declaration}}.handledBy({{name.pascal}}Handler, [FileStaging]);
|
|
@@ -163,6 +163,28 @@ and `execution.scheduledAt` says which period the work is for.
|
|
|
163
163
|
on the API), or initialise the project with `--cache redis`, which binds `RedisLock`, or bind a
|
|
164
164
|
lock between processes of your own to `Lock` in the platform.
|
|
165
165
|
{{/unless}}
|
|
166
|
+
{{#if files.any}}
|
|
167
|
+
|
|
168
|
+
## Files
|
|
169
|
+
|
|
170
|
+
The content of a file lives in a file storage, never in the database: {{#if files.local}}a directory
|
|
171
|
+
(`FILES_DIRECTORY`, `.data/files` by default, kept out of version control) whose signed links the
|
|
172
|
+
application answers under `/files`; before running several instances, move to an object store
|
|
173
|
+
with `npx ddd-ts-kit init --force --storage s3`{{/if}}{{#if files.s3}}a bucket of the S3 protocol (`S3_*` variables), MinIO
|
|
174
|
+
in `docker-compose.yml` while developing, which creates the bucket at its first start{{/if}}. The tests keep files in memory. An
|
|
175
|
+
aggregate keeps the `StoredFile` reference (key, size, media type, checksum). The command bus
|
|
176
|
+
stages a file a command carries before the transaction opens, `FileStaging` moves it to its key
|
|
177
|
+
with the commit and, every hour, purges what refused or rolled-back commands left in `staging/`. `npx ddd-ts-kit generate file-upload <context> <UseCase>` writes an
|
|
178
|
+
upload; see https://github.com/gbourgeat/ddd-ts-kit/blob/main/docs/concepts/file-storage.md.
|
|
179
|
+
{{#if files.local}}
|
|
180
|
+
|
|
181
|
+
| Variable | Says |
|
|
182
|
+
|---|---|
|
|
183
|
+
| `FILES_DIRECTORY` | the directory of the files, `.data/files` by default |
|
|
184
|
+
| `FILES_PUBLIC_URL` | where clients reach `/files`, which signed links point to: required in production, `http://localhost:<PORT>/files` elsewhere |
|
|
185
|
+
| `FILES_SIGNING_SECRET` | signs the links, 32 characters at least: required in production, even before the first file arrives; drawn at each start elsewhere |
|
|
186
|
+
{{/if}}
|
|
187
|
+
{{/if}}
|
|
166
188
|
{{#if errors.sentry}}
|
|
167
189
|
|
|
168
190
|
## Error reporting
|
|
@@ -118,6 +118,28 @@ services:
|
|
|
118
118
|
timeout: 3s
|
|
119
119
|
retries: 30
|
|
120
120
|
|
|
121
|
+
{{/if}}
|
|
122
|
+
{{#if files.s3}}
|
|
123
|
+
# MinIO, an S3 server for local use (pgsty/minio builds it from the upstream sources, which no longer publish images).
|
|
124
|
+
# The bucket of S3_BUCKET is created at the first start; its root account is for local development ONLY.
|
|
125
|
+
minio:
|
|
126
|
+
image: pgsty/minio:RELEASE.2026-08-04T00-00-00Z@sha256:b6bfe7239bfc83fb90d31612d9704d86039dd714f7904b3f1ad68f211e602372
|
|
127
|
+
entrypoint: ["sh", "-c"]
|
|
128
|
+
command: ["mkdir -p /data/$${S3_BUCKET} && exec minio server /data"]
|
|
129
|
+
environment:
|
|
130
|
+
MINIO_ROOT_USER: ${S3_ACCESS_KEY_ID:-minio-app}
|
|
131
|
+
MINIO_ROOT_PASSWORD: ${S3_SECRET_ACCESS_KEY:-minio-app-secret}
|
|
132
|
+
S3_BUCKET: ${S3_BUCKET:-{{project.name}}-files}
|
|
133
|
+
ports:
|
|
134
|
+
- "127.0.0.1:${MINIO_PORT:-9000}:9000"
|
|
135
|
+
volumes:
|
|
136
|
+
- minio-data:/data
|
|
137
|
+
healthcheck:
|
|
138
|
+
test: ["CMD", "curl", "-fsS", "-o", "/dev/null", "http://127.0.0.1:9000/minio/health/ready"]
|
|
139
|
+
interval: 2s
|
|
140
|
+
timeout: 3s
|
|
141
|
+
retries: 30
|
|
142
|
+
|
|
121
143
|
{{/if}}
|
|
122
144
|
{{#if authn.keycloak}}
|
|
123
145
|
# Keycloak {{keycloak.version}} in development mode, for local use only: it imports docker/keycloak/{{project.name}}-realm.json
|
|
@@ -232,3 +254,6 @@ volumes:
|
|
|
232
254
|
{{#if errors.sentry}}
|
|
233
255
|
glitchtip-postgres:
|
|
234
256
|
{{/if}}
|
|
257
|
+
{{#if files.s3}}
|
|
258
|
+
minio-data:
|
|
259
|
+
{{/if}}
|
|
@@ -126,6 +126,27 @@ KEYCLOAK_AUDIENCE={{project.name}}-api
|
|
|
126
126
|
# SENTRY_SCRUB_MESSAGES=false
|
|
127
127
|
GLITCHTIP_PORT=8000
|
|
128
128
|
{{/if}}
|
|
129
|
+
{{#if files.local}}
|
|
130
|
+
|
|
131
|
+
# Files live in a directory, never in the database; the application answers their signed links under /files.
|
|
132
|
+
# FILES_DIRECTORY=.data/files
|
|
133
|
+
# Where clients reach /files: required in production, this value by default elsewhere.
|
|
134
|
+
# FILES_PUBLIC_URL=http://localhost:3000/files
|
|
135
|
+
# Signs the links, 32 characters at least: required in production (openssl rand -hex 32), drawn at each start elsewhere.
|
|
136
|
+
# FILES_SIGNING_SECRET=
|
|
137
|
+
{{/if}}
|
|
138
|
+
{{#if files.s3}}
|
|
139
|
+
|
|
140
|
+
# Files live in a bucket of the S3 protocol (MinIO in docker-compose.yml), never in the database.
|
|
141
|
+
# For AWS leave S3_ENDPOINT out; OVHcloud, Scaleway and Cloudflare R2 give their own endpoint (S3_REGION=auto for R2).
|
|
142
|
+
S3_ENDPOINT=http://localhost:9000
|
|
143
|
+
S3_REGION=us-east-1
|
|
144
|
+
S3_BUCKET={{project.name}}-files
|
|
145
|
+
# The root account of the local MinIO, for local development ONLY: in a deployment, an access key allowed on this bucket only.
|
|
146
|
+
S3_ACCESS_KEY_ID=minio-app
|
|
147
|
+
S3_SECRET_ACCESS_KEY=minio-app-secret
|
|
148
|
+
MINIO_PORT=9000
|
|
149
|
+
{{/if}}
|
|
129
150
|
|
|
130
151
|
# Traces: start Jaeger with `docker compose --profile observability up -d jaeger`, then open http://127.0.0.1:16686
|
|
131
152
|
# Without an endpoint no span leaves the process.
|
|
@@ -14,6 +14,9 @@ import { {{events.providerName}} } from '{{alias.platform}}/events/{{events.prov
|
|
|
14
14
|
{{#if events.outbox}}
|
|
15
15
|
import { startOutboxRelay } from '{{alias.platform}}/events/start-outbox-relay{{alias.ext}}';
|
|
16
16
|
{{/if}}
|
|
17
|
+
{{#if files.any}}
|
|
18
|
+
import { openFiles } from '{{alias.platform}}/files/open-files{{alias.ext}}';
|
|
19
|
+
{{/if}}
|
|
17
20
|
{{#if http.any}}
|
|
18
21
|
import { startHttpServer } from '{{alias.platform}}/http/start-http-server{{alias.ext}}';
|
|
19
22
|
{{/if}}
|
|
@@ -48,6 +51,9 @@ const application = composeApplication(persistence, {
|
|
|
48
51
|
{{#if cache.redis}}
|
|
49
52
|
redis,
|
|
50
53
|
{{/if}}
|
|
54
|
+
{{#if files.any}}
|
|
55
|
+
files: openFiles(config.files),
|
|
56
|
+
{{/if}}
|
|
51
57
|
});
|
|
52
58
|
|
|
53
59
|
await application.start();
|