@ddd-ts-kit/http 0.102.0 → 0.103.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.fr.md +19 -8
- package/README.md +18 -7
- package/dist/error/answered-edge-error.d.ts +2 -1
- package/dist/error/answered-edge-error.d.ts.map +1 -1
- package/dist/error/answered-edge-error.js +5 -0
- package/dist/error/answered-edge-error.js.map +1 -1
- package/dist/error/answered-not-found.d.ts +10 -0
- package/dist/error/answered-not-found.d.ts.map +1 -0
- package/dist/error/answered-not-found.js +24 -0
- package/dist/error/answered-not-found.js.map +1 -0
- package/dist/error/default-error-mapping.d.ts.map +1 -1
- package/dist/error/default-error-mapping.js +2 -0
- package/dist/error/default-error-mapping.js.map +1 -1
- package/dist/error/to-problem.js +14 -1
- package/dist/error/to-problem.js.map +1 -1
- package/dist/express/problem-not-found-handler.d.ts +10 -0
- package/dist/express/problem-not-found-handler.d.ts.map +1 -0
- package/dist/express/problem-not-found-handler.js +14 -0
- package/dist/express/problem-not-found-handler.js.map +1 -0
- package/dist/express.d.ts +1 -0
- package/dist/express.d.ts.map +1 -1
- package/dist/express.js +1 -0
- package/dist/express.js.map +1 -1
- package/dist/fastify/problem-not-found-handler.d.ts +11 -0
- package/dist/fastify/problem-not-found-handler.d.ts.map +1 -0
- package/dist/fastify/problem-not-found-handler.js +13 -0
- package/dist/fastify/problem-not-found-handler.js.map +1 -0
- package/dist/fastify.d.ts +1 -0
- package/dist/fastify.d.ts.map +1 -1
- package/dist/fastify.js +1 -0
- package/dist/fastify.js.map +1 -1
- package/dist/hono/problem-not-found-handler.d.ts +11 -0
- package/dist/hono/problem-not-found-handler.d.ts.map +1 -0
- package/dist/hono/problem-not-found-handler.js +13 -0
- package/dist/hono/problem-not-found-handler.js.map +1 -0
- package/dist/hono.d.ts +1 -0
- package/dist/hono.d.ts.map +1 -1
- package/dist/hono.js +1 -0
- package/dist/hono.js.map +1 -1
- package/package.json +4 -4
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:8874b7d49d8a67de -->
|
|
3
3
|
|
|
4
4
|
# @ddd-ts-kit/http
|
|
5
5
|
|
|
@@ -625,8 +625,11 @@ Valeurs par défaut : `VALIDATION_FAILED` 422 (avec `issues`, chemins préfixés
|
|
|
625
625
|
perdue ou un interblocage : le client renvoie la requête), `INVARIANT_VIOLATION` 422,
|
|
626
626
|
`UNAUTHORIZED` 401, `FORBIDDEN` 403, `NOT_ACCEPTABLE` 406, `PRECONDITION_FAILED` 412,
|
|
627
627
|
`UNSUPPORTED_MEDIA_TYPE` 415 (un corps ou un fichier d'un type que la route ne prend pas),
|
|
628
|
-
`PRECONDITION_REQUIRED` 428, et pour les fichiers `FILE_NOT_FOUND` 404, `FILE_TOO_LARGE` 413
|
|
629
|
-
|
|
628
|
+
`PRECONDITION_REQUIRED` 428, et pour les fichiers `FILE_NOT_FOUND` 404, `FILE_TOO_LARGE` 413, et
|
|
629
|
+
`SERVICE_UNAVAILABLE` 503 (une unité de travail que la base n'a pas pu servir à temps,
|
|
630
|
+
`TransactionTimeoutError` : le client réessaie plus tard). Une erreur qui n'est pas une
|
|
631
|
+
`DomainError` répond 500 `INTERNAL_ERROR`, sauf si son `code` correspond à un statut de serveur,
|
|
632
|
+
comme `SERVICE_UNAVAILABLE` : elle garde ce statut et ce code, rien de son message. Un code du domaine sans correspondance répond 422 (`fallbackStatus` du second argument le change).
|
|
630
633
|
|
|
631
634
|
<!-- checked sample -->
|
|
632
635
|
```ts
|
|
@@ -1272,7 +1275,7 @@ généré par la CLI les écrit dans `openapi/forms/<operationId>.json` à côt
|
|
|
1272
1275
|
import express from 'express';
|
|
1273
1276
|
import type { ExecuteOptions, Route } from '@ddd-ts-kit/http';
|
|
1274
1277
|
import type { Logger } from '@ddd-ts-kit/kernel';
|
|
1275
|
-
import { mountExpress, problemErrorHandler } from '@ddd-ts-kit/http/express';
|
|
1278
|
+
import { mountExpress, problemErrorHandler, problemNotFoundHandler } from '@ddd-ts-kit/http/express';
|
|
1276
1279
|
|
|
1277
1280
|
declare const routes: readonly Route[]; // defineRoutes(...), controllerRoutes(...)
|
|
1278
1281
|
declare const options: ExecuteOptions;
|
|
@@ -1281,6 +1284,7 @@ declare const logger: Logger;
|
|
|
1281
1284
|
const app = express();
|
|
1282
1285
|
app.use(express.json()); // obligatoire : l'adaptateur n'analyse pas les corps
|
|
1283
1286
|
mountExpress(app, routes, options); // un express.Router() convient aussi
|
|
1287
|
+
app.use(problemNotFoundHandler({ logger })); // après les routes : un chemin qu'aucune ne sert
|
|
1284
1288
|
app.use(problemErrorHandler({ logger })); // en dernier : ce qu'Express refuse avant une route
|
|
1285
1289
|
app.listen(3000);
|
|
1286
1290
|
```
|
|
@@ -1297,6 +1301,9 @@ chaque framework, pour que sa validation décide. Sans lui, le gestionnaire fina
|
|
|
1297
1301
|
hors production, et écrit l'erreur sur stderr, corps cité compris. Le gestionnaire écrit dans
|
|
1298
1302
|
`logger` le type de l'erreur (`entity.parse.failed`), le statut et l'identifiant de la requête,
|
|
1299
1303
|
jamais le message ni le corps : un refus comme avertissement, une panne comme erreur.
|
|
1304
|
+
`problemNotFoundHandler`, après les routes, répond à un chemin qu'aucune route ne sert un 404
|
|
1305
|
+
`NOT_FOUND` sous forme de *problem*, journalisé en `info` (pas un avertissement par sonde d'un scanner), au lieu de la page HTML
|
|
1306
|
+
`Cannot GET /path` d'Express.
|
|
1300
1307
|
|
|
1301
1308
|
## Fastify 5
|
|
1302
1309
|
|
|
@@ -1305,7 +1312,7 @@ jamais le message ni le corps : un refus comme avertissement, une panne comme er
|
|
|
1305
1312
|
import Fastify from 'fastify';
|
|
1306
1313
|
import type { ExecuteOptions, Route } from '@ddd-ts-kit/http';
|
|
1307
1314
|
import type { Logger } from '@ddd-ts-kit/kernel';
|
|
1308
|
-
import { fastifyRoutes, mountFastify, problemErrorHandler } from '@ddd-ts-kit/http/fastify';
|
|
1315
|
+
import { fastifyRoutes, mountFastify, problemErrorHandler, problemNotFoundHandler } from '@ddd-ts-kit/http/fastify';
|
|
1309
1316
|
|
|
1310
1317
|
declare const routes: readonly Route[];
|
|
1311
1318
|
declare const options: ExecuteOptions;
|
|
@@ -1313,6 +1320,7 @@ declare const logger: Logger;
|
|
|
1313
1320
|
|
|
1314
1321
|
const app = Fastify();
|
|
1315
1322
|
app.setErrorHandler(problemErrorHandler({ logger })); // en premier : ce que Fastify refuse avant une route
|
|
1323
|
+
app.setNotFoundHandler(problemNotFoundHandler({ logger })); // un chemin qu'aucune route ne sert
|
|
1316
1324
|
mountFastify(app, routes, options);
|
|
1317
1325
|
// ou, comme plugin :
|
|
1318
1326
|
await app.register(fastifyRoutes(routes, options), { prefix: '/api' });
|
|
@@ -1327,7 +1335,8 @@ de `{ statusCode, code, error, message }`, qui porte au client le message d'une
|
|
|
1327
1335
|
inattendue. Installez-le avant de monter les routes. L'analyseur de Fastify refuse un corps JSON
|
|
1328
1336
|
vide, qu'Express et Hono transmettent comme absent : `mountFastify` enregistre les routes dans un
|
|
1329
1337
|
contexte à elles où un corps vide les atteint comme absent, tout autre corps lu par l'analyseur
|
|
1330
|
-
JSON de Fastify.
|
|
1338
|
+
JSON de Fastify. `problemNotFoundHandler` répond à un chemin qu'aucune route ne sert un 404
|
|
1339
|
+
`NOT_FOUND` sous forme de *problem*, au lieu de `{ message, error, statusCode }`.
|
|
1331
1340
|
|
|
1332
1341
|
## Hono 4
|
|
1333
1342
|
|
|
@@ -1337,7 +1346,7 @@ import { serve } from '@hono/node-server';
|
|
|
1337
1346
|
import { Hono } from 'hono';
|
|
1338
1347
|
import type { ExecuteOptions, Route } from '@ddd-ts-kit/http';
|
|
1339
1348
|
import type { Logger } from '@ddd-ts-kit/kernel';
|
|
1340
|
-
import { mountHono, problemErrorHandler } from '@ddd-ts-kit/http/hono';
|
|
1349
|
+
import { mountHono, problemErrorHandler, problemNotFoundHandler } from '@ddd-ts-kit/http/hono';
|
|
1341
1350
|
|
|
1342
1351
|
declare const routes: readonly Route[];
|
|
1343
1352
|
declare const options: ExecuteOptions;
|
|
@@ -1345,6 +1354,7 @@ declare const logger: Logger;
|
|
|
1345
1354
|
|
|
1346
1355
|
const app = new Hono();
|
|
1347
1356
|
app.onError(problemErrorHandler({ logger })); // un middleware qui lève une erreur, répondu en problem
|
|
1357
|
+
app.notFound(problemNotFoundHandler({ logger })); // un chemin qu'aucune route ne sert, répondu 404 en problem
|
|
1348
1358
|
mountHono(app, routes, { ...options, bodyLimit: 2 * 1024 * 1024 }); // bodyLimit : 1 Mio par défaut
|
|
1349
1359
|
serve({ fetch: app.fetch, port: 3000 });
|
|
1350
1360
|
```
|
|
@@ -1360,7 +1370,8 @@ requête HTTP, avec les limites que déclare leur route, et une réponse en flux
|
|
|
1360
1370
|
est envoyée en flux. Un middleware placé devant les routes qui lève une erreur reçoit sa réponse
|
|
1361
1371
|
sous forme de *problem* de `problemErrorHandler`, un 500 `INTERNAL_ERROR` ou le statut d'une
|
|
1362
1372
|
`HTTPException` avec les en-têtes de sa réponse, journalisé comme sur Express, au lieu d'un texte
|
|
1363
|
-
avec l'erreur écrite sur stderr
|
|
1373
|
+
avec l'erreur écrite sur stderr, et un chemin qu'aucune route ne sert reçoit un 404 `NOT_FOUND`
|
|
1374
|
+
de `problemNotFoundHandler`, au lieu du texte `404 Not Found`. Une requête HTTP porte `HonoRaw`
|
|
1364
1375
|
comme requête brute (ses en-têtes sous forme d'objet, que lisent les authentificateurs du kit,
|
|
1365
1376
|
et le `Context` de Hono), et un paramètre de chaîne de requête répété est une liste, comme sur
|
|
1366
1377
|
Express et Fastify. L'adaptateur n'importe rien de Hono à l'exécution, et `node:stream` pour les
|
package/README.md
CHANGED
|
@@ -594,7 +594,11 @@ Defaults: `VALIDATION_FAILED` 422 (with `issues`, paths prefixed by the part:
|
|
|
594
594
|
or a deadlock: the client sends the request again), `INVARIANT_VIOLATION` 422, `UNAUTHORIZED`
|
|
595
595
|
401, `FORBIDDEN` 403, `NOT_ACCEPTABLE` 406, `PRECONDITION_FAILED` 412, `UNSUPPORTED_MEDIA_TYPE` 415
|
|
596
596
|
(a body or a file of a type the route does not take), `PRECONDITION_REQUIRED` 428, and for files
|
|
597
|
-
`FILE_NOT_FOUND` 404, `FILE_TOO_LARGE` 413
|
|
597
|
+
`FILE_NOT_FOUND` 404, `FILE_TOO_LARGE` 413, and `SERVICE_UNAVAILABLE` 503 (a unit of work the
|
|
598
|
+
database could not serve in time, `TransactionTimeoutError`: the client tries again later). An
|
|
599
|
+
error that is not a `DomainError` answers 500 `INTERNAL_ERROR`, unless its `code` is mapped to a
|
|
600
|
+
status of a server, as `SERVICE_UNAVAILABLE`: it keeps that status and code, nothing of its
|
|
601
|
+
message. A domain code that is not mapped answers 422
|
|
598
602
|
(`fallbackStatus` of the second argument changes it).
|
|
599
603
|
|
|
600
604
|
<!-- checked sample -->
|
|
@@ -1216,7 +1220,7 @@ both formats, for the documentation: a project generated by the CLI writes them
|
|
|
1216
1220
|
import express from 'express';
|
|
1217
1221
|
import type { ExecuteOptions, Route } from '@ddd-ts-kit/http';
|
|
1218
1222
|
import type { Logger } from '@ddd-ts-kit/kernel';
|
|
1219
|
-
import { mountExpress, problemErrorHandler } from '@ddd-ts-kit/http/express';
|
|
1223
|
+
import { mountExpress, problemErrorHandler, problemNotFoundHandler } from '@ddd-ts-kit/http/express';
|
|
1220
1224
|
|
|
1221
1225
|
declare const routes: readonly Route[]; // defineRoutes(...), controllerRoutes(...)
|
|
1222
1226
|
declare const options: ExecuteOptions;
|
|
@@ -1225,6 +1229,7 @@ declare const logger: Logger;
|
|
|
1225
1229
|
const app = express();
|
|
1226
1230
|
app.use(express.json()); // required: the adapter does not parse bodies
|
|
1227
1231
|
mountExpress(app, routes, options); // an express.Router() works too
|
|
1232
|
+
app.use(problemNotFoundHandler({ logger })); // after the routes: a path none serves
|
|
1228
1233
|
app.use(problemErrorHandler({ logger })); // last: what Express refuses before a route
|
|
1229
1234
|
app.listen(3000);
|
|
1230
1235
|
```
|
|
@@ -1240,7 +1245,9 @@ that status, with the code the kit gives it (`UNAUTHORIZED`, `VALIDATION_FAILED`
|
|
|
1240
1245
|
answers an HTML page, with the stack outside production, and writes the error to stderr, the
|
|
1241
1246
|
body it quotes included. The handler writes to `logger` the type of the error
|
|
1242
1247
|
(`entity.parse.failed`), the status and the request id, never the message nor the body: a
|
|
1243
|
-
refusal as a warning, a failure as an error.
|
|
1248
|
+
refusal as a warning, a failure as an error. `problemNotFoundHandler`, after the routes, answers a
|
|
1249
|
+
path no route serves 404 `NOT_FOUND` as a problem, logged at `info` (not a warning per probe of a scanner), instead of the HTML page
|
|
1250
|
+
`Cannot GET /path` of Express.
|
|
1244
1251
|
|
|
1245
1252
|
## Fastify 5
|
|
1246
1253
|
|
|
@@ -1249,7 +1256,7 @@ refusal as a warning, a failure as an error.
|
|
|
1249
1256
|
import Fastify from 'fastify';
|
|
1250
1257
|
import type { ExecuteOptions, Route } from '@ddd-ts-kit/http';
|
|
1251
1258
|
import type { Logger } from '@ddd-ts-kit/kernel';
|
|
1252
|
-
import { fastifyRoutes, mountFastify, problemErrorHandler } from '@ddd-ts-kit/http/fastify';
|
|
1259
|
+
import { fastifyRoutes, mountFastify, problemErrorHandler, problemNotFoundHandler } from '@ddd-ts-kit/http/fastify';
|
|
1253
1260
|
|
|
1254
1261
|
declare const routes: readonly Route[];
|
|
1255
1262
|
declare const options: ExecuteOptions;
|
|
@@ -1257,6 +1264,7 @@ declare const logger: Logger;
|
|
|
1257
1264
|
|
|
1258
1265
|
const app = Fastify();
|
|
1259
1266
|
app.setErrorHandler(problemErrorHandler({ logger })); // first: what Fastify refuses before a route
|
|
1267
|
+
app.setNotFoundHandler(problemNotFoundHandler({ logger })); // a path no route serves
|
|
1260
1268
|
mountFastify(app, routes, options);
|
|
1261
1269
|
// or, as a plugin:
|
|
1262
1270
|
await app.register(fastifyRoutes(routes, options), { prefix: '/api' });
|
|
@@ -1269,7 +1277,8 @@ throws the status it carries or 500 `INTERNAL_ERROR`, with its headers kept as o
|
|
|
1269
1277
|
message of an unexpected error to the client. Set it before the routes are mounted. The parser
|
|
1270
1278
|
of Fastify refuses an empty JSON body, which Express and Hono hand over as absent: `mountFastify`
|
|
1271
1279
|
registers the routes in a context of their own where an empty body reaches them as absent, any
|
|
1272
|
-
other read by the JSON parser of Fastify.
|
|
1280
|
+
other read by the JSON parser of Fastify. `problemNotFoundHandler` answers a path no route serves
|
|
1281
|
+
404 `NOT_FOUND` as a problem, instead of `{ message, error, statusCode }`.
|
|
1273
1282
|
|
|
1274
1283
|
## Hono 4
|
|
1275
1284
|
|
|
@@ -1279,7 +1288,7 @@ import { serve } from '@hono/node-server';
|
|
|
1279
1288
|
import { Hono } from 'hono';
|
|
1280
1289
|
import type { ExecuteOptions, Route } from '@ddd-ts-kit/http';
|
|
1281
1290
|
import type { Logger } from '@ddd-ts-kit/kernel';
|
|
1282
|
-
import { mountHono, problemErrorHandler } from '@ddd-ts-kit/http/hono';
|
|
1291
|
+
import { mountHono, problemErrorHandler, problemNotFoundHandler } from '@ddd-ts-kit/http/hono';
|
|
1283
1292
|
|
|
1284
1293
|
declare const routes: readonly Route[];
|
|
1285
1294
|
declare const options: ExecuteOptions;
|
|
@@ -1287,6 +1296,7 @@ declare const logger: Logger;
|
|
|
1287
1296
|
|
|
1288
1297
|
const app = new Hono();
|
|
1289
1298
|
app.onError(problemErrorHandler({ logger })); // a middleware that throws, answered as a problem
|
|
1299
|
+
app.notFound(problemNotFoundHandler({ logger })); // a path no route serves, answered 404 as a problem
|
|
1290
1300
|
mountHono(app, routes, { ...options, bodyLimit: 2 * 1024 * 1024 }); // bodyLimit: 1 MiB by default
|
|
1291
1301
|
serve({ fetch: app.fetch, port: 3000 });
|
|
1292
1302
|
```
|
|
@@ -1300,7 +1310,8 @@ pipeline answers 415 when representations are mounted. An upload and a raw body
|
|
|
1300
1310
|
the request stream, with the limits their route declares, and a stream answer or a streamed
|
|
1301
1311
|
list is streamed. A middleware in front of the routes that throws is answered as a problem by
|
|
1302
1312
|
`problemErrorHandler`, 500 `INTERNAL_ERROR` or the status of an `HTTPException` with the headers
|
|
1303
|
-
of its response, logged as on Express, instead of a text with the error written to stderr
|
|
1313
|
+
of its response, logged as on Express, instead of a text with the error written to stderr, and a
|
|
1314
|
+
path no route serves 404 `NOT_FOUND` by `problemNotFoundHandler`, instead of the text `404 Not Found`. A request carries `HonoRaw` as
|
|
1304
1315
|
its raw request (its headers as a record, which the authenticators of the kit read, and the
|
|
1305
1316
|
`Context` of Hono), and a repeated query parameter is a list, as on Express and Fastify. The
|
|
1306
1317
|
adapter imports nothing of Hono at run time and `node:stream` for the streams: the kit proves
|
|
@@ -6,7 +6,8 @@ export interface EdgeErrorOptions {
|
|
|
6
6
|
/**
|
|
7
7
|
* Where each error is written: its type (`entity.parse.failed`, `FST_ERR_CTP_BODY_TOO_LARGE`,
|
|
8
8
|
* the class of an unexpected error), the status answered and the request id, never its message
|
|
9
|
-
* nor the body, which may quote personal data. A refusal is a warning, a
|
|
9
|
+
* nor the body, which may quote personal data. A refusal is a warning, a path no route serves
|
|
10
|
+
* an information, a failure an error.
|
|
10
11
|
* Left out, nothing is written.
|
|
11
12
|
*/
|
|
12
13
|
readonly logger?: Logger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"answered-edge-error.d.ts","sourceRoot":"","sources":["../../src/error/answered-edge-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAgB,KAAK,WAAW,EAAkB,MAAM,gBAAgB,CAAC;AAKhF,MAAM,WAAW,gBAAgB;IAC/B
|
|
1
|
+
{"version":3,"file":"answered-edge-error.d.ts","sourceRoot":"","sources":["../../src/error/answered-edge-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAgB,KAAK,WAAW,EAAkB,MAAM,gBAAgB,CAAC;AAKhF,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,gEAAgE;AAChE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IACvC,iHAAiH;IACjH,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;CAChC;AAcD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,GAAG,UAAU,CAiB/G"}
|
|
@@ -8,6 +8,7 @@ import { statusTitle } from './status-title.js';
|
|
|
8
8
|
/** What `express.json()` (body-parser) and the parser of Fastify name a body that is not JSON; an empty body is not one. */
|
|
9
9
|
const MALFORMED_KINDS = new Set(['entity.parse.failed', 'FST_ERR_CTP_INVALID_JSON_BODY']);
|
|
10
10
|
const KIND = /^[A-Za-z0-9_.]{1,64}$/;
|
|
11
|
+
const NOT_FOUND = 404;
|
|
11
12
|
const CONTENT_TOO_LARGE = 413;
|
|
12
13
|
const FIRST_REFUSAL = 400;
|
|
13
14
|
const LAST_FAILURE = 599;
|
|
@@ -31,6 +32,10 @@ export function answeredEdgeError({ error, headers, refusal }, options) {
|
|
|
31
32
|
if (answer.status >= 500) {
|
|
32
33
|
options.logger?.error('request failed before its route', fields);
|
|
33
34
|
}
|
|
35
|
+
else if (answer.status === NOT_FOUND) {
|
|
36
|
+
// A path no route serves, as `problemNotFoundHandler` logs it: a scanner probes them by the thousand.
|
|
37
|
+
options.logger?.info('request refused before its route', fields);
|
|
38
|
+
}
|
|
34
39
|
else {
|
|
35
40
|
options.logger?.warn('request refused before its route', fields);
|
|
36
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"answered-edge-error.js","sourceRoot":"","sources":["../../src/error/answered-edge-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAmB,UAAU,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAoB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"answered-edge-error.js","sourceRoot":"","sources":["../../src/error/answered-edge-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAmB,UAAU,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAoB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAqB7C,4HAA4H;AAC5H,MAAM,eAAe,GAAG,IAAI,GAAG,C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,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAE5D,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAClE,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC5B,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC;AACzD,CAAC;AAED,SAAS,MAAM,CAAC,KAAc,EAAE,GAAW;IACzC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAElC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc,EAAE,GAAW;IAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAElC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED,SAAS,OAAO,CAAC,KAAc,EAAE,GAAW;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RawHeaders } from '../route/raw-headers.js';
|
|
2
|
+
import type { EdgeErrorOptions } from './answered-edge-error.js';
|
|
3
|
+
import { type EdgeAnswer } from './edge-answer.js';
|
|
4
|
+
/**
|
|
5
|
+
* The answer to a path no route serves: 404 `NOT_FOUND`, a problem as every other refusal, as
|
|
6
|
+
* the filter of Nest answers it, logged by its status and the request id at `info`: a scanner
|
|
7
|
+
* probes paths by the thousand, and a warning per probe would drown the ones that matter.
|
|
8
|
+
*/
|
|
9
|
+
export declare function answeredNotFound(headers: Readonly<RawHeaders>, options: EdgeErrorOptions): EdgeAnswer;
|
|
10
|
+
//# sourceMappingURL=answered-not-found.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"answered-not-found.d.ts","sourceRoot":"","sources":["../../src/error/answered-not-found.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,eAAe,CAAC;AAY5D;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,gBAAgB,GAAG,UAAU,CAUrG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { codeOfStatus } from './code-of-status.js';
|
|
2
|
+
import { edgeAnswer } from './edge-answer.js';
|
|
3
|
+
import { statusTitle } from './status-title.js';
|
|
4
|
+
const NOT_FOUND_STATUS = 404;
|
|
5
|
+
const NOT_FOUND = {
|
|
6
|
+
status: NOT_FOUND_STATUS,
|
|
7
|
+
title: statusTitle(NOT_FOUND_STATUS),
|
|
8
|
+
code: codeOfStatus(NOT_FOUND_STATUS),
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The answer to a path no route serves: 404 `NOT_FOUND`, a problem as every other refusal, as
|
|
12
|
+
* the filter of Nest answers it, logged by its status and the request id at `info`: a scanner
|
|
13
|
+
* probes paths by the thousand, and a warning per probe would drown the ones that matter.
|
|
14
|
+
*/
|
|
15
|
+
export function answeredNotFound(headers, options) {
|
|
16
|
+
const answer = edgeAnswer(headers, NOT_FOUND);
|
|
17
|
+
options.logger?.info('request refused before its route', {
|
|
18
|
+
errorType: NOT_FOUND.code,
|
|
19
|
+
status: answer.status,
|
|
20
|
+
requestId: answer.problem.requestId,
|
|
21
|
+
});
|
|
22
|
+
return answer;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=answered-not-found.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"answered-not-found.js","sourceRoot":"","sources":["../../src/error/answered-not-found.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAmB,UAAU,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,MAAM,SAAS,GAAgB;IAC7B,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC;IACpC,IAAI,EAAE,YAAY,CAAC,gBAAgB,CAAC;CACrC,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAA6B,EAAE,OAAyB;IACvF,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAE9C,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,kCAAkC,EAAE;QACvD,SAAS,EAAE,SAAS,CAAC,IAAI;QACzB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS;KACpC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-error-mapping.d.ts","sourceRoot":"","sources":["../../src/error/default-error-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"default-error-mapping.d.ts","sourceRoot":"","sources":["../../src/error/default-error-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,eAAO,MAAM,qBAAqB,EAAE,YAgBnC,CAAC"}
|
|
@@ -12,5 +12,7 @@ export const DEFAULT_ERROR_MAPPING = {
|
|
|
12
12
|
FILE_NOT_FOUND: 404,
|
|
13
13
|
FILE_TOO_LARGE: 413,
|
|
14
14
|
UNSUPPORTED_MEDIA_TYPE: 415,
|
|
15
|
+
// A unit of work the database could not serve in time (`TransactionTimeoutError`): try again later.
|
|
16
|
+
SERVICE_UNAVAILABLE: 503,
|
|
15
17
|
};
|
|
16
18
|
//# sourceMappingURL=default-error-mapping.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-error-mapping.js","sourceRoot":"","sources":["../../src/error/default-error-mapping.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,iBAAiB,EAAE,GAAG;IACtB,SAAS,EAAE,GAAG;IACd,QAAQ,EAAE,GAAG;IACb,oBAAoB,EAAE,GAAG;IACzB,mBAAmB,EAAE,GAAG;IACxB,YAAY,EAAE,GAAG;IACjB,SAAS,EAAE,GAAG;IACd,cAAc,EAAE,GAAG;IACnB,mBAAmB,EAAE,GAAG;IACxB,qBAAqB,EAAE,GAAG;IAC1B,cAAc,EAAE,GAAG;IACnB,cAAc,EAAE,GAAG;IACnB,sBAAsB,EAAE,GAAG;
|
|
1
|
+
{"version":3,"file":"default-error-mapping.js","sourceRoot":"","sources":["../../src/error/default-error-mapping.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,iBAAiB,EAAE,GAAG;IACtB,SAAS,EAAE,GAAG;IACd,QAAQ,EAAE,GAAG;IACb,oBAAoB,EAAE,GAAG;IACzB,mBAAmB,EAAE,GAAG;IACxB,YAAY,EAAE,GAAG;IACjB,SAAS,EAAE,GAAG;IACd,cAAc,EAAE,GAAG;IACnB,mBAAmB,EAAE,GAAG;IACxB,qBAAqB,EAAE,GAAG;IAC1B,cAAc,EAAE,GAAG;IACnB,cAAc,EAAE,GAAG;IACnB,sBAAsB,EAAE,GAAG;IAC3B,oGAAoG;IACpG,mBAAmB,EAAE,GAAG;CACzB,CAAC"}
|
package/dist/error/to-problem.js
CHANGED
|
@@ -4,7 +4,7 @@ import { INTERNAL_ERROR_CODE } from './internal-error-code.js';
|
|
|
4
4
|
import { statusTitle } from './status-title.js';
|
|
5
5
|
export function toProblem(error, mapper, requestId) {
|
|
6
6
|
if (!(error instanceof DomainError)) {
|
|
7
|
-
return
|
|
7
|
+
return serverFaultProblem(error, mapper, requestId);
|
|
8
8
|
}
|
|
9
9
|
const status = mapper.statusOf(error.code);
|
|
10
10
|
if (status >= 500) {
|
|
@@ -62,6 +62,19 @@ function exposedFacts(error) {
|
|
|
62
62
|
const facts = error.exposedFacts;
|
|
63
63
|
return Object.keys(facts).length === 0 ? {} : { facts };
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* A fault of the infrastructure whose code the mapping answers with a status of a server
|
|
67
|
+
* (`SERVICE_UNAVAILABLE` 503 for a unit of work the database could not serve in time) keeps
|
|
68
|
+
* that status and its code; any other is a 500. Nothing of its message either way.
|
|
69
|
+
*/
|
|
70
|
+
function serverFaultProblem(error, mapper, requestId) {
|
|
71
|
+
const code = error instanceof Error ? Reflect.get(error, 'code') : undefined;
|
|
72
|
+
const status = typeof code === 'string' ? mapper.mapping[code] : undefined;
|
|
73
|
+
if (typeof code !== 'string' || status === undefined || status < 500) {
|
|
74
|
+
return internalProblem(requestId);
|
|
75
|
+
}
|
|
76
|
+
return { ...internalProblem(requestId), status, title: statusTitle(status), code };
|
|
77
|
+
}
|
|
65
78
|
// The message of an unexpected error quotes data and internals: it never leaves the process.
|
|
66
79
|
function internalProblem(requestId) {
|
|
67
80
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-problem.js","sourceRoot":"","sources":["../../src/error/to-problem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,MAAmB,EAAE,SAAiB;IAC9E,IAAI,CAAC,CAAC,KAAK,YAAY,WAAW,CAAC,EAAE,CAAC;QACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"to-problem.js","sourceRoot":"","sources":["../../src/error/to-problem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,MAAmB,EAAE,SAAiB;IAC9E,IAAI,CAAC,CAAC,KAAK,YAAY,WAAW,CAAC,EAAE,CAAC;QACpC,OAAO,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE3C,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;QAClB,8EAA8E;QAC9E,OAAO,EAAE,GAAG,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;IACjG,CAAC;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AC,KAAc,EAAE,MAAmB,EAAE,SAAiB;IAChF,MAAM,IAAI,GAAY,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACtF,MAAM,MAAM,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE3E,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,GAAG,GAAG,EAAE,CAAC;QACrE,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,EAAE,GAAG,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC;AACrF,CAAC;AAED,6FAA6F;AAC7F,SAAS,eAAe,CAAC,SAAiB;IACxC,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,uBAAuB;QAC9B,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,mBAAmB;QACzB,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RequestHandler } from 'express';
|
|
2
|
+
import type { EdgeErrorOptions } from '../error/answered-edge-error.js';
|
|
3
|
+
/**
|
|
4
|
+
* The middleware after the routes of an Express application: answers a path no route serves
|
|
5
|
+
* 404 `NOT_FOUND` as a problem, instead of the final handler of Express, which answers the HTML
|
|
6
|
+
* page `Cannot GET /path`. Installed after every route, before `problemErrorHandler`:
|
|
7
|
+
* `app.use(problemNotFoundHandler({ logger }))`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function problemNotFoundHandler(options?: EdgeErrorOptions): RequestHandler;
|
|
10
|
+
//# sourceMappingURL=problem-not-found-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"problem-not-found-handler.d.ts","sourceRoot":"","sources":["../../src/express/problem-not-found-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,gBAAqB,GAAG,cAAc,CAMrF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { answeredNotFound } from '../error/answered-not-found.js';
|
|
2
|
+
/**
|
|
3
|
+
* The middleware after the routes of an Express application: answers a path no route serves
|
|
4
|
+
* 404 `NOT_FOUND` as a problem, instead of the final handler of Express, which answers the HTML
|
|
5
|
+
* page `Cannot GET /path`. Installed after every route, before `problemErrorHandler`:
|
|
6
|
+
* `app.use(problemNotFoundHandler({ logger }))`.
|
|
7
|
+
*/
|
|
8
|
+
export function problemNotFoundHandler(options = {}) {
|
|
9
|
+
return (request, response) => {
|
|
10
|
+
const answer = answeredNotFound(request.headers, options);
|
|
11
|
+
response.status(answer.status).set(answer.headers).send(JSON.stringify(answer.problem));
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=problem-not-found-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"problem-not-found-handler.js","sourceRoot":"","sources":["../../src/express/problem-not-found-handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAO,GAAqB,EAAE;IACnE,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;QAC3B,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAE1D,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1F,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/express.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { EdgeErrorOptions } from './error/answered-edge-error.js';
|
|
2
2
|
export { mountExpress, type ExpressMountOptions } from './express/mount-express.js';
|
|
3
3
|
export { problemErrorHandler } from './express/problem-error-handler.js';
|
|
4
|
+
export { problemNotFoundHandler } from './express/problem-not-found-handler.js';
|
|
4
5
|
//# sourceMappingURL=express.d.ts.map
|
package/dist/express.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../src/express.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../src/express.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC"}
|
package/dist/express.js
CHANGED
package/dist/express.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.js","sourceRoot":"","sources":["../src/express.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAA4B,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"express.js","sourceRoot":"","sources":["../src/express.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAA4B,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import type { EdgeErrorOptions } from '../error/answered-edge-error.js';
|
|
3
|
+
type FastifyNotFoundHandler = (request: FastifyRequest, reply: FastifyReply) => FastifyReply;
|
|
4
|
+
/**
|
|
5
|
+
* The not-found handler of a Fastify instance: answers a path no route serves 404 `NOT_FOUND` as
|
|
6
|
+
* a problem, instead of the default of Fastify, `{ message, error, statusCode }`:
|
|
7
|
+
* `app.setNotFoundHandler(problemNotFoundHandler({ logger }))`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function problemNotFoundHandler(options?: EdgeErrorOptions): FastifyNotFoundHandler;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=problem-not-found-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"problem-not-found-handler.d.ts","sourceRoot":"","sources":["../../src/fastify/problem-not-found-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,KAAK,sBAAsB,GAAG,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,KAAK,YAAY,CAAC;AAE7F;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,gBAAqB,GAAG,sBAAsB,CAM7F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { answeredNotFound } from '../error/answered-not-found.js';
|
|
2
|
+
/**
|
|
3
|
+
* The not-found handler of a Fastify instance: answers a path no route serves 404 `NOT_FOUND` as
|
|
4
|
+
* a problem, instead of the default of Fastify, `{ message, error, statusCode }`:
|
|
5
|
+
* `app.setNotFoundHandler(problemNotFoundHandler({ logger }))`.
|
|
6
|
+
*/
|
|
7
|
+
export function problemNotFoundHandler(options = {}) {
|
|
8
|
+
return (request, reply) => {
|
|
9
|
+
const answer = answeredNotFound(request.headers, options);
|
|
10
|
+
return reply.code(answer.status).headers(answer.headers).send(JSON.stringify(answer.problem));
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=problem-not-found-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"problem-not-found-handler.js","sourceRoot":"","sources":["../../src/fastify/problem-not-found-handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAI/D;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAO,GAAqB,EAAE;IACnE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAE1D,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAChG,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/fastify.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export type { FastifyMountOptions } from './fastify/fastify-mount-options.js';
|
|
|
3
3
|
export { fastifyRoutes } from './fastify/fastify-routes.js';
|
|
4
4
|
export { mountFastify } from './fastify/mount-fastify.js';
|
|
5
5
|
export { problemErrorHandler } from './fastify/problem-error-handler.js';
|
|
6
|
+
export { problemNotFoundHandler } from './fastify/problem-not-found-handler.js';
|
|
6
7
|
//# sourceMappingURL=fastify.d.ts.map
|
package/dist/fastify.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC"}
|
package/dist/fastify.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { fastifyRoutes } from './fastify/fastify-routes.js';
|
|
2
2
|
export { mountFastify } from './fastify/mount-fastify.js';
|
|
3
3
|
export { problemErrorHandler } from './fastify/problem-error-handler.js';
|
|
4
|
+
export { problemNotFoundHandler } from './fastify/problem-not-found-handler.js';
|
|
4
5
|
//# sourceMappingURL=fastify.js.map
|
package/dist/fastify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastify.js","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"fastify.js","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Context } from 'hono';
|
|
2
|
+
import type { EdgeErrorOptions } from '../error/answered-edge-error.js';
|
|
3
|
+
type HonoNotFoundHandler = (context: Context) => Response;
|
|
4
|
+
/**
|
|
5
|
+
* The not-found handler of a Hono application: answers a path no route serves 404 `NOT_FOUND`
|
|
6
|
+
* as a problem, instead of the default of Hono, the text `404 Not Found`:
|
|
7
|
+
* `app.notFound(problemNotFoundHandler({ logger }))`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function problemNotFoundHandler(options?: EdgeErrorOptions): HonoNotFoundHandler;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=problem-not-found-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"problem-not-found-handler.d.ts","sourceRoot":"","sources":["../../src/hono/problem-not-found-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,KAAK,mBAAmB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,QAAQ,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,gBAAqB,GAAG,mBAAmB,CAM1F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { answeredNotFound } from '../error/answered-not-found.js';
|
|
2
|
+
/**
|
|
3
|
+
* The not-found handler of a Hono application: answers a path no route serves 404 `NOT_FOUND`
|
|
4
|
+
* as a problem, instead of the default of Hono, the text `404 Not Found`:
|
|
5
|
+
* `app.notFound(problemNotFoundHandler({ logger }))`.
|
|
6
|
+
*/
|
|
7
|
+
export function problemNotFoundHandler(options = {}) {
|
|
8
|
+
return (context) => {
|
|
9
|
+
const answer = answeredNotFound(context.req.header(), options);
|
|
10
|
+
return new Response(JSON.stringify(answer.problem), { status: answer.status, headers: answer.headers });
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=problem-not-found-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"problem-not-found-handler.js","sourceRoot":"","sources":["../../src/hono/problem-not-found-handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAI/D;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAO,GAAqB,EAAE;IACnE,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;QAE/D,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1G,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/hono.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export type { HonoMountOptions } from './hono/hono-mount-options.js';
|
|
|
3
3
|
export type { HonoRaw } from './hono/hono-raw.js';
|
|
4
4
|
export { mountHono } from './hono/mount-hono.js';
|
|
5
5
|
export { problemErrorHandler } from './hono/problem-error-handler.js';
|
|
6
|
+
export { problemNotFoundHandler } from './hono/problem-not-found-handler.js';
|
|
6
7
|
//# sourceMappingURL=hono.d.ts.map
|
package/dist/hono.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hono.d.ts","sourceRoot":"","sources":["../src/hono.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"hono.d.ts","sourceRoot":"","sources":["../src/hono.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dist/hono.js
CHANGED
package/dist/hono.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hono.js","sourceRoot":"","sources":["../src/hono.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"hono.js","sourceRoot":"","sources":["../src/hono.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ddd-ts-kit/http",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.103.0",
|
|
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",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"dist"
|
|
86
86
|
],
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@ddd-ts-kit/kernel": "0.
|
|
89
|
-
"@ddd-ts-kit/validation": "0.
|
|
88
|
+
"@ddd-ts-kit/kernel": "0.103.0",
|
|
89
|
+
"@ddd-ts-kit/validation": "0.103.0"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@nestjs/common": ">=11.0.0",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
|
-
"@ddd-ts-kit/testing": "0.
|
|
128
|
+
"@ddd-ts-kit/testing": "0.103.0",
|
|
129
129
|
"@hono/node-server": "^2.1.4",
|
|
130
130
|
"@nestjs/common": "^12.2.0",
|
|
131
131
|
"@nestjs/core": "^12.2.0",
|