@ultimat3/http 11.0.0 → 11.2.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/package.json +5 -5
- package/src/error-map.ts +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/http",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.2.0",
|
|
4
4
|
"description": "Owned request lifecycle over Bun.serve: router, ordered pipeline, problem+json errors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"test": "bun test"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ultimat3/core": "11.
|
|
35
|
-
"@ultimat3/i18n": "11.
|
|
36
|
-
"@ultimat3/schema": "11.
|
|
37
|
-
"@ultimat3/time": "11.
|
|
34
|
+
"@ultimat3/core": "11.2.0",
|
|
35
|
+
"@ultimat3/i18n": "11.2.0",
|
|
36
|
+
"@ultimat3/schema": "11.2.0",
|
|
37
|
+
"@ultimat3/time": "11.2.0"
|
|
38
38
|
}
|
|
39
39
|
}
|
package/src/error-map.ts
CHANGED
|
@@ -60,6 +60,10 @@ export const ERROR_STATUS = {
|
|
|
60
60
|
// back immediately, which is the load it was shed to avoid.
|
|
61
61
|
X_DRAINING: 503,
|
|
62
62
|
X_OVERLOADED: 503,
|
|
63
|
+
// Core's flight gate refusing past `maxQueued` is the same answer one tier down: it carries
|
|
64
|
+
// `retryAfterSeconds` in `meta`, which `stages.ts` renders onto `Retry-After`, so a caller that
|
|
65
|
+
// already handles a shed request needs no second branch for a refused one.
|
|
66
|
+
X_FLIGHT_GATE_OVERLOADED: 503,
|
|
63
67
|
// 403 and never 401: the caller IS authenticated — that is what makes the forged write work —
|
|
64
68
|
// so a 401 would send a signed-in user to a sign-in page they are already past.
|
|
65
69
|
X_CSRF_BLOCKED: 403,
|
|
@@ -227,6 +231,11 @@ export const ERROR_STATUS = {
|
|
|
227
231
|
X_NOT_IMPLEMENTED: 501,
|
|
228
232
|
X_TIMEOUT: 504,
|
|
229
233
|
X_ABORTED: 499,
|
|
234
|
+
// The twin of `X_ABORTED`, and it answers the same because the outcome is the same: the caller
|
|
235
|
+
// went away there, the caller's generation moved on here, and in both cases nobody will act on
|
|
236
|
+
// the answer. Deliberately not 409 — that spelling asks the client to reconcile and try again,
|
|
237
|
+
// and a fenced answer has nothing to reconcile against.
|
|
238
|
+
X_SUPERSEDED: 499,
|
|
230
239
|
X_INTERNAL: 500,
|
|
231
240
|
// The keys are LITERAL — deliberately not `Readonly<Record<string, number>>`, which is what the
|
|
232
241
|
// annotation used to say. This table is the closed one, so `ERROR_STATUS.X_QUERY_NOT_PAGABLE`
|