@dunx/http 3.1.0 → 3.1.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/dist/route/schema.d.ts +2 -31
- package/package.json +2 -2
package/dist/route/schema.d.ts
CHANGED
|
@@ -1,35 +1,7 @@
|
|
|
1
|
+
import type { StandardSchemaV1 } from '@dunx/core';
|
|
1
2
|
import type { BunRequest } from 'bun';
|
|
2
3
|
import type { DefaultStatus, HttpMethod } from './marker.js';
|
|
3
|
-
|
|
4
|
-
* Standard Schema v1, restated rather than depended on: the spec is an interface,
|
|
5
|
-
* so restating it keeps `@dunx/http` at zero dependencies. Zod 4, Valibot and
|
|
6
|
-
* ArkType all satisfy this shape already.
|
|
7
|
-
*/
|
|
8
|
-
export interface StandardSchemaV1<In = unknown, Out = In> {
|
|
9
|
-
readonly '~standard': {
|
|
10
|
-
readonly version: 1;
|
|
11
|
-
readonly vendor: string;
|
|
12
|
-
readonly validate: (value: unknown) => StandardSchemaResult<Out> | Promise<StandardSchemaResult<Out>>;
|
|
13
|
-
readonly types?: {
|
|
14
|
-
readonly input: In;
|
|
15
|
-
readonly output: Out;
|
|
16
|
-
} | undefined;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
/** Success carries `value`; failure carries `issues`. `issues` discriminates. */
|
|
20
|
-
export type StandardSchemaResult<Out> = {
|
|
21
|
-
readonly value: Out;
|
|
22
|
-
readonly issues?: undefined;
|
|
23
|
-
} | {
|
|
24
|
-
readonly issues: readonly StandardSchemaIssue[];
|
|
25
|
-
};
|
|
26
|
-
export interface StandardSchemaIssue {
|
|
27
|
-
readonly message: string;
|
|
28
|
-
/** Zod yields bare keys, Valibot `{ key }` objects. The spec allows both. */
|
|
29
|
-
readonly path?: readonly (PropertyKey | {
|
|
30
|
-
readonly key: PropertyKey;
|
|
31
|
-
})[] | undefined;
|
|
32
|
-
}
|
|
4
|
+
export type { StandardSchemaIssue, StandardSchemaResult, StandardSchemaV1, } from '@dunx/core';
|
|
33
5
|
/** The validated output of a schema - `InferOutput<typeof CreateNote>` is `Note`. */
|
|
34
6
|
export type InferOutput<S> = S extends StandardSchemaV1<unknown, infer Out> ? Out : never;
|
|
35
7
|
/**
|
|
@@ -154,4 +126,3 @@ export interface RouteInput {
|
|
|
154
126
|
readonly query?: unknown;
|
|
155
127
|
readonly params?: unknown;
|
|
156
128
|
}
|
|
157
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dunx/http",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Bun.serve adapter for the dunx framework: controllers, middleware and WebSocket gateways",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@dunx/core": "workspace:*"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@dunx/core": "^3.1.
|
|
65
|
+
"@dunx/core": "^3.1.1",
|
|
66
66
|
"@types/bun": ">=1.3.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|