@ultimat3/http 25.1.0 → 26.0.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 +2 -1
- package/package.json +5 -5
- package/src/errors.ts +4 -5
- package/src/server.ts +1 -3
package/README.md
CHANGED
|
@@ -336,7 +336,8 @@ mechanism. It is a plain function and not a pipeline stage, because the secret i
|
|
|
336
336
|
and only the route knows which one applies.
|
|
337
337
|
|
|
338
338
|
```ts
|
|
339
|
-
// apps/web/
|
|
339
|
+
// apps/web/webhooks/partner.ts — mounted as a plain HTTP route through the `routes` runtime
|
|
340
|
+
// override (apps/web/runtime.ts); `api/` holds no route file
|
|
340
341
|
import { verifyWebhookSignature } from '@ultimat3/http';
|
|
341
342
|
|
|
342
343
|
declare const env: { readonly PARTNER_WEBHOOK_SECRET: string }; // the app's defineEnv() result
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/http",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "26.0.0",
|
|
4
4
|
"description": "Owned request lifecycle over Bun.serve: router, ordered pipeline, problem+json errors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"test": "bun test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ultimat3/core": "
|
|
39
|
-
"@ultimat3/i18n": "
|
|
40
|
-
"@ultimat3/schema": "
|
|
41
|
-
"@ultimat3/time": "
|
|
38
|
+
"@ultimat3/core": "26.0.0",
|
|
39
|
+
"@ultimat3/i18n": "26.0.0",
|
|
40
|
+
"@ultimat3/schema": "26.0.0",
|
|
41
|
+
"@ultimat3/time": "26.0.0"
|
|
42
42
|
}
|
|
43
43
|
}
|
package/src/errors.ts
CHANGED
|
@@ -129,11 +129,10 @@ export const bodyInvalid = (
|
|
|
129
129
|
code: 'X_BODY_INVALID',
|
|
130
130
|
cause: `${pathname} body rejected: ${issues.join('; ')}`,
|
|
131
131
|
...(meta === undefined ? {} : { meta }),
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
fix: `x routes --json # find ${pathname}, then send a body matching its input schema`,
|
|
132
|
+
// Only a route that declares `meta.input` reaches the body stage, and no action or query does
|
|
133
|
+
// (`invoke` and `runQuery` validate their own input, as `X_INPUT_INVALID`) — so this is a plain
|
|
134
|
+
// `runtime.ts` route, and `x routes --surface api` lists those by name since owner decision 2.
|
|
135
|
+
fix: `x routes --surface api --json # find ${pathname}, a runtime.ts route, then send a body its meta.input schema accepts`,
|
|
137
136
|
});
|
|
138
137
|
|
|
139
138
|
/** At construction: a hole in a scope, or a prefix shadowing `/api` or `/_x`, never serves. */
|
package/src/server.ts
CHANGED
|
@@ -28,7 +28,7 @@ import { type RateLimitStore, rateLimiter } from './rate-limit';
|
|
|
28
28
|
import { withRouteBuckets } from './rate-limit-buckets';
|
|
29
29
|
import { adoptRateLimitStore } from './rate-limit-installed';
|
|
30
30
|
import { jsonResponse } from './response';
|
|
31
|
-
import { describeRoutes, httpRouter, type Route
|
|
31
|
+
import { describeRoutes, httpRouter, type Route } from './router';
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Beside its one caller rather than in `errors.ts`, which is at the 500-line ceiling — the
|
|
@@ -142,7 +142,6 @@ export interface ServerHandle {
|
|
|
142
142
|
state(): LifecycleState;
|
|
143
143
|
/** `http://host:port` once started; throws before `start()`. */
|
|
144
144
|
url(): string;
|
|
145
|
-
describe(): readonly RouteDescription[];
|
|
146
145
|
start(): ServerHandle;
|
|
147
146
|
/** Runs core's three-phase drain, on the deadline `drain.deadlineMs` set (`lifecycleForRole`). */
|
|
148
147
|
stop(): Promise<void>;
|
|
@@ -306,7 +305,6 @@ const buildServer = (options: ServerOptions, releaseStore: () => void): ServerHa
|
|
|
306
305
|
if (server === undefined) throw serverNotStarted('url()');
|
|
307
306
|
return server.url.origin;
|
|
308
307
|
},
|
|
309
|
-
describe: () => describeRoutes(table),
|
|
310
308
|
fetch: (request) => dispatch(request),
|
|
311
309
|
start() {
|
|
312
310
|
// FIRST, before the socket. `markReady()` refuses a process whose lifecycle already drained
|