@ddd-ts-kit/http 0.113.1 → 0.114.1
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.fr.md +6 -6
- package/README.md +5 -5
- package/package.json +9 -9
package/README.fr.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[English](README.md) · **Français**
|
|
2
|
-
<!-- translation-of: README.md sha256:
|
|
2
|
+
<!-- translation-of: README.md sha256:84d504cf4373feae -->
|
|
3
3
|
|
|
4
4
|
# @ddd-ts-kit/http
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ Chaque adaptateur passe par un seul pipeline (`executeRoute`) : validation, gest
|
|
|
11
11
|
(handler), correspondance des erreurs. Le comportement est donc le même sur les quatre
|
|
12
12
|
frameworks, et une seule suite de tests le prouve.
|
|
13
13
|
|
|
14
|
-

|
|
15
15
|
|
|
16
16
|
Le package vit dans la couche présentation : il transforme une requête HTTP en un appel de
|
|
17
17
|
votre gestionnaire, et la réponse du gestionnaire (ou son refus) en une réponse HTTP. Il ne
|
|
@@ -189,7 +189,7 @@ fait que copier la requête HTTP de son framework dans une `RawRequest` (`params
|
|
|
189
189
|
`headers`, `body`, `raw`, et le flux du corps, `stream`), l'appeler, et réécrire la
|
|
190
190
|
`RouteResponse` qu'elle renvoie.
|
|
191
191
|
|
|
192
|
-

|
|
193
193
|
|
|
194
194
|
Les étapes inutiles sont sautées : pas de téléversement, pas d'`If-Match`, pas de garde, pas de
|
|
195
195
|
validateur. Le premier refus termine la requête HTTP : une requête HTTP invalide n'atteint
|
|
@@ -558,7 +558,7 @@ et la réponse est en `application/problem+json` (RFC 9457) :
|
|
|
558
558
|
"detail": "Order 7 does not exist.", "requestId": "..." }
|
|
559
559
|
```
|
|
560
560
|
|
|
561
|
-

|
|
562
562
|
|
|
563
563
|
Un refus construit par une fabrique porte des faits, et ils sont privés : le document ne
|
|
564
564
|
contient, sous `facts`, que ceux que sa fabrique a exposés par leur nom, et aucun membre `facts`
|
|
@@ -975,7 +975,7 @@ Une route continue de répondre une valeur typée que vérifie son schéma de r
|
|
|
975
975
|
l'en-tête `Accept` parmi ceux que la route déclare. L'application enregistre ses représentations
|
|
976
976
|
une fois et donne le même ensemble aux adaptateurs et au générateur du contrat :
|
|
977
977
|
|
|
978
|
-

|
|
979
979
|
|
|
980
980
|
```ts
|
|
981
981
|
import { Representations, type ExecuteOptions } from '@ddd-ts-kit/http';
|
|
@@ -1197,7 +1197,7 @@ déjà : son schéma de corps de requête, les champs restreints de ce schéma,
|
|
|
1197
1197
|
indications de présentation. `formRoutes` sert un `GET /forms/<operationId>` par route de ce
|
|
1198
1198
|
genre, monté et documenté comme toute route :
|
|
1199
1199
|
|
|
1200
|
-

|
|
1201
1201
|
|
|
1202
1202
|
```ts
|
|
1203
1203
|
// presentation/http/appointments/book-appointment/book-appointment.controller.ts, à côté de ses schémas
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ same declaration.
|
|
|
9
9
|
Every adapter goes through one pipeline (`executeRoute`): validation, handler, error mapping.
|
|
10
10
|
The behaviour is therefore the same on the four frameworks, and one test suite proves it.
|
|
11
11
|
|
|
12
|
-

|
|
13
13
|
|
|
14
14
|
The package lives in the presentation layer: it turns an HTTP request into a call of your
|
|
15
15
|
handler, and the answer of the handler (or its refusal) into an HTTP response. It decides
|
|
@@ -178,7 +178,7 @@ are on the [presentation layer](../../docs/concepts/presentation-layer.md) page.
|
|
|
178
178
|
copies the request of its framework into a `RawRequest` (`params`, `query`, `headers`, `body`,
|
|
179
179
|
`raw`, and the body `stream`), calls it, and writes back the `RouteResponse` it returns.
|
|
180
180
|
|
|
181
|
-

|
|
182
182
|
|
|
183
183
|
The steps that are not needed are skipped: no upload, no `If-Match`, no guard, no validator.
|
|
184
184
|
The first refusal ends the request: a request that is not valid never reaches the check of a
|
|
@@ -528,7 +528,7 @@ A handler throws a `DomainError`; its `code` is mapped to a status in one place
|
|
|
528
528
|
"detail": "Order 7 does not exist.", "requestId": "..." }
|
|
529
529
|
```
|
|
530
530
|
|
|
531
|
-

|
|
532
532
|
|
|
533
533
|
A refusal built by a factory carries facts, and they are private: the document holds, under
|
|
534
534
|
`facts`, only the ones its factory exposed by name, and no `facts` member when it exposed none.
|
|
@@ -936,7 +936,7 @@ into the text of one media type, chosen per request by the `Accept` header among
|
|
|
936
936
|
route declares. The application registers its representations once and gives the same set to
|
|
937
937
|
the adapters and to the contract generator:
|
|
938
938
|
|
|
939
|
-

|
|
940
940
|
|
|
941
941
|
```ts
|
|
942
942
|
import { Representations, type ExecuteOptions } from '@ddd-ts-kit/http';
|
|
@@ -1144,7 +1144,7 @@ A route that declares `form` is described as a form, from what it already declar
|
|
|
1144
1144
|
body schema, the restricted fields of that schema, and a few presentation hints. `formRoutes`
|
|
1145
1145
|
serves one `GET /forms/<operationId>` per such route, mounted and documented like any route:
|
|
1146
1146
|
|
|
1147
|
-

|
|
1148
1148
|
|
|
1149
1149
|
```ts
|
|
1150
1150
|
// presentation/http/appointments/book-appointment/book-appointment.controller.ts, next to its schemas
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ddd-ts-kit/http",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.114.1",
|
|
4
4
|
"description": "Framework-agnostic route definitions with Express, Fastify, Hono and NestJS adapters, oRPC and tRPC procedures and OpenAPI 3.1 generation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddd",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
23
|
-
"url": "git+https://github.com/
|
|
23
|
+
"url": "git+https://github.com/ddd-ts-kit/ddd-ts-kit.git",
|
|
24
24
|
"directory": "packages/http"
|
|
25
25
|
},
|
|
26
|
-
"homepage": "https://
|
|
27
|
-
"bugs": "https://github.com/
|
|
26
|
+
"homepage": "https://ddd-ts-kit.github.io/ddd-ts-kit/packages/http/",
|
|
27
|
+
"bugs": "https://github.com/ddd-ts-kit/ddd-ts-kit/issues",
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public",
|
|
30
30
|
"provenance": true
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"dist"
|
|
89
89
|
],
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@ddd-ts-kit/kernel": "0.
|
|
92
|
-
"@ddd-ts-kit/validation": "0.
|
|
91
|
+
"@ddd-ts-kit/kernel": "0.114.1",
|
|
92
|
+
"@ddd-ts-kit/validation": "0.114.1"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@nestjs/common": ">=11.0.0",
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
|
-
"@ddd-ts-kit/testing": "0.
|
|
132
|
-
"@hono/node-server": "^2.1.
|
|
131
|
+
"@ddd-ts-kit/testing": "0.114.1",
|
|
132
|
+
"@hono/node-server": "^2.1.7",
|
|
133
133
|
"@nestjs/common": "^12.3.2",
|
|
134
134
|
"@nestjs/core": "^12.3.2",
|
|
135
135
|
"@nestjs/platform-express": "^12.3.2",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"busboy": "^1.6.0",
|
|
145
145
|
"express": "^5.3.0",
|
|
146
146
|
"fastify": "^5.12.7",
|
|
147
|
-
"hono": "^4.13.
|
|
147
|
+
"hono": "^4.13.18",
|
|
148
148
|
"reflect-metadata": "^0.2.2",
|
|
149
149
|
"rxjs": "^7.8.0",
|
|
150
150
|
"zod": "^4.6.5"
|