@orpc/server 0.0.0-next.a6dec3e → 0.0.0-next.a79cddd
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 +17 -22
- package/dist/adapters/aws-lambda/index.d.mts +45 -0
- package/dist/adapters/aws-lambda/index.d.ts +45 -0
- package/dist/adapters/aws-lambda/index.mjs +41 -0
- package/dist/adapters/bun-ws/index.d.mts +35 -0
- package/dist/adapters/bun-ws/index.d.ts +35 -0
- package/dist/adapters/bun-ws/index.mjs +46 -0
- package/dist/adapters/crossws/index.d.mts +30 -0
- package/dist/adapters/crossws/index.d.ts +30 -0
- package/dist/adapters/crossws/index.mjs +46 -0
- package/dist/adapters/fetch/index.d.mts +28 -8
- package/dist/adapters/fetch/index.d.ts +28 -8
- package/dist/adapters/fetch/index.mjs +107 -8
- package/dist/adapters/message-port/index.d.mts +28 -0
- package/dist/adapters/message-port/index.d.ts +28 -0
- package/dist/adapters/message-port/index.mjs +41 -0
- package/dist/adapters/node/index.d.mts +28 -8
- package/dist/adapters/node/index.d.ts +28 -8
- package/dist/adapters/node/index.mjs +9 -4
- package/dist/adapters/standard/index.d.mts +4 -4
- package/dist/adapters/standard/index.d.ts +4 -4
- package/dist/adapters/standard/index.mjs +4 -5
- package/dist/adapters/websocket/index.d.mts +51 -0
- package/dist/adapters/websocket/index.d.ts +51 -0
- package/dist/adapters/websocket/index.mjs +69 -0
- package/dist/adapters/ws/index.d.mts +28 -0
- package/dist/adapters/ws/index.d.ts +28 -0
- package/dist/adapters/ws/index.mjs +39 -0
- package/dist/hibernation/index.d.mts +44 -0
- package/dist/hibernation/index.d.ts +44 -0
- package/dist/hibernation/index.mjs +65 -0
- package/dist/index.d.mts +559 -16
- package/dist/index.d.ts +559 -16
- package/dist/index.mjs +136 -11
- package/dist/plugins/index.d.mts +44 -12
- package/dist/plugins/index.d.ts +44 -12
- package/dist/plugins/index.mjs +27 -12
- package/dist/shared/{server.DFFT_EZo.d.ts → server.-ACo36I0.d.ts} +18 -17
- package/dist/shared/server.BPAWobQg.d.ts +12 -0
- package/dist/shared/server.Bd52nNaH.d.mts +12 -0
- package/dist/shared/{server.CGCwEAt_.d.mts → server.BliFSTnG.d.mts} +2 -2
- package/dist/shared/{server.DFuJLDuo.mjs → server.CB8Snncu.mjs} +12 -16
- package/dist/shared/{server.DLt5njUb.d.mts → server.DD2C4ujN.d.mts} +57 -8
- package/dist/shared/{server.DLt5njUb.d.ts → server.DD2C4ujN.d.ts} +57 -8
- package/dist/shared/{server.C37gDhSZ.mjs → server.DLJzqnSX.mjs} +6 -2
- package/dist/shared/{server.BVwwTHyO.mjs → server.DZ5BIITo.mjs} +1 -1
- package/dist/shared/{server.DOYDVeMX.d.mts → server.Dq8xr7PQ.d.mts} +18 -17
- package/dist/shared/{server._2UufoXA.d.ts → server.IG2MjhrD.d.ts} +2 -2
- package/package.json +59 -20
- package/dist/adapters/hono/index.d.mts +0 -22
- package/dist/adapters/hono/index.d.ts +0 -22
- package/dist/adapters/hono/index.mjs +0 -35
- package/dist/adapters/next/index.d.mts +0 -29
- package/dist/adapters/next/index.d.ts +0 -29
- package/dist/adapters/next/index.mjs +0 -32
- package/dist/shared/server.Bm0UqHzd.mjs +0 -103
- package/dist/shared/server.C8NkqxHo.d.ts +0 -17
- package/dist/shared/server.DCQgF_JR.d.mts +0 -17
package/dist/plugins/index.mjs
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
import { value } from '@orpc/shared';
|
1
|
+
import { value, isAsyncIteratorObject, clone } from '@orpc/shared';
|
2
|
+
import { flattenHeader } from '@orpc/standard-server';
|
2
3
|
import { parseBatchRequest, toBatchResponse } from '@orpc/standard-server/batch';
|
3
4
|
import { ORPCError } from '@orpc/client';
|
4
5
|
export { S as StrictGetMethodPlugin } from '../shared/server.BW-nUGgA.mjs';
|
@@ -25,7 +26,8 @@ class BatchHandlerPlugin {
|
|
25
26
|
init(options) {
|
26
27
|
options.rootInterceptors ??= [];
|
27
28
|
options.rootInterceptors.unshift(async (options2) => {
|
28
|
-
|
29
|
+
const xHeader = flattenHeader(options2.request.headers["x-orpc-batch"]);
|
30
|
+
if (xHeader === void 0) {
|
29
31
|
return options2.next();
|
30
32
|
}
|
31
33
|
let isParsing = false;
|
@@ -49,6 +51,14 @@ class BatchHandlerPlugin {
|
|
49
51
|
const mapped = this.mapRequestItem(request, options2);
|
50
52
|
return options2.next({ ...options2, request: { ...mapped, body: () => Promise.resolve(mapped.body) } }).then(({ response: response2, matched }) => {
|
51
53
|
if (matched) {
|
54
|
+
if (response2.body instanceof Blob || response2.body instanceof FormData || isAsyncIteratorObject(response2.body)) {
|
55
|
+
return {
|
56
|
+
index,
|
57
|
+
status: 500,
|
58
|
+
headers: {},
|
59
|
+
body: "Batch responses do not support file/blob, or event-iterator. Please call this procedure separately outside of the batch request."
|
60
|
+
};
|
61
|
+
}
|
52
62
|
return { ...response2, index };
|
53
63
|
}
|
54
64
|
return { index, status: 404, headers: {}, body: "No procedure matched" };
|
@@ -60,9 +70,10 @@ class BatchHandlerPlugin {
|
|
60
70
|
await Promise.race(responses);
|
61
71
|
const status = await value(this.successStatus, responses, options2);
|
62
72
|
const headers = await value(this.headers, responses, options2);
|
63
|
-
const response = toBatchResponse({
|
73
|
+
const response = await toBatchResponse({
|
64
74
|
status,
|
65
75
|
headers,
|
76
|
+
mode: xHeader === "buffered" ? "buffered" : "streaming",
|
66
77
|
body: async function* () {
|
67
78
|
const promises = [...responses];
|
68
79
|
while (true) {
|
@@ -115,13 +126,11 @@ class CORSPlugin {
|
|
115
126
|
resHeaders["access-control-max-age"] = this.options.maxAge.toString();
|
116
127
|
}
|
117
128
|
if (this.options.allowMethods?.length) {
|
118
|
-
resHeaders["access-control-allow-methods"] = this.options.allowMethods
|
129
|
+
resHeaders["access-control-allow-methods"] = flattenHeader(this.options.allowMethods);
|
119
130
|
}
|
120
131
|
const allowHeaders = this.options.allowHeaders ?? interceptorOptions.request.headers["access-control-request-headers"];
|
121
|
-
if (
|
122
|
-
resHeaders["access-control-allow-headers"] = allowHeaders
|
123
|
-
} else if (typeof allowHeaders === "string") {
|
124
|
-
resHeaders["access-control-allow-headers"] = allowHeaders;
|
132
|
+
if (typeof allowHeaders === "string" || allowHeaders?.length) {
|
133
|
+
resHeaders["access-control-allow-headers"] = flattenHeader(allowHeaders);
|
125
134
|
}
|
126
135
|
return {
|
127
136
|
matched: true,
|
@@ -139,7 +148,7 @@ class CORSPlugin {
|
|
139
148
|
if (!result.matched) {
|
140
149
|
return result;
|
141
150
|
}
|
142
|
-
const origin =
|
151
|
+
const origin = flattenHeader(interceptorOptions.request.headers.origin) ?? "";
|
143
152
|
const allowedOrigin = await value(this.options.origin, origin, interceptorOptions);
|
144
153
|
const allowedOriginArr = Array.isArray(allowedOrigin) ? allowedOrigin : [allowedOrigin];
|
145
154
|
if (allowedOriginArr.includes("*")) {
|
@@ -161,7 +170,7 @@ class CORSPlugin {
|
|
161
170
|
result.response.headers["access-control-allow-credentials"] = "true";
|
162
171
|
}
|
163
172
|
if (this.options.exposeHeaders?.length) {
|
164
|
-
result.response.headers["access-control-expose-headers"] = this.options.exposeHeaders
|
173
|
+
result.response.headers["access-control-expose-headers"] = flattenHeader(this.options.exposeHeaders);
|
165
174
|
}
|
166
175
|
return result;
|
167
176
|
});
|
@@ -183,7 +192,7 @@ class ResponseHeadersPlugin {
|
|
183
192
|
if (!result.matched) {
|
184
193
|
return result;
|
185
194
|
}
|
186
|
-
const responseHeaders = result.response.headers;
|
195
|
+
const responseHeaders = clone(result.response.headers);
|
187
196
|
for (const [key, value] of resHeaders) {
|
188
197
|
if (Array.isArray(responseHeaders[key])) {
|
189
198
|
responseHeaders[key].push(value);
|
@@ -193,7 +202,13 @@ class ResponseHeadersPlugin {
|
|
193
202
|
responseHeaders[key] = value;
|
194
203
|
}
|
195
204
|
}
|
196
|
-
return
|
205
|
+
return {
|
206
|
+
...result,
|
207
|
+
response: {
|
208
|
+
...result.response,
|
209
|
+
headers: responseHeaders
|
210
|
+
}
|
211
|
+
};
|
197
212
|
});
|
198
213
|
}
|
199
214
|
}
|
@@ -1,8 +1,18 @@
|
|
1
1
|
import { HTTPPath, ORPCError } from '@orpc/client';
|
2
|
-
import { Meta
|
3
|
-
import { Interceptor
|
2
|
+
import { Meta } from '@orpc/contract';
|
3
|
+
import { Interceptor } from '@orpc/shared';
|
4
4
|
import { StandardResponse, StandardLazyRequest } from '@orpc/standard-server';
|
5
|
-
import {
|
5
|
+
import { C as Context, R as Router, f as AnyRouter, h as AnyProcedure, F as ProcedureClientInterceptorOptions } from './server.DD2C4ujN.js';
|
6
|
+
|
7
|
+
interface StandardHandlerPlugin<T extends Context> {
|
8
|
+
order?: number;
|
9
|
+
init?(options: StandardHandlerOptions<T>, router: Router<any, T>): void;
|
10
|
+
}
|
11
|
+
declare class CompositeStandardHandlerPlugin<T extends Context, TPlugin extends StandardHandlerPlugin<T>> implements StandardHandlerPlugin<T> {
|
12
|
+
protected readonly plugins: TPlugin[];
|
13
|
+
constructor(plugins?: readonly TPlugin[]);
|
14
|
+
init(options: StandardHandlerOptions<T>, router: Router<any, T>): void;
|
15
|
+
}
|
6
16
|
|
7
17
|
type StandardParams = Record<string, string>;
|
8
18
|
type StandardMatchResult = {
|
@@ -20,16 +30,6 @@ interface StandardCodec {
|
|
20
30
|
decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure): Promise<unknown>;
|
21
31
|
}
|
22
32
|
|
23
|
-
interface StandardHandlerPlugin<TContext extends Context> {
|
24
|
-
order?: number;
|
25
|
-
init?(options: StandardHandlerOptions<TContext>): void;
|
26
|
-
}
|
27
|
-
declare class CompositeStandardHandlerPlugin<T extends Context, TPlugin extends StandardHandlerPlugin<T>> implements StandardHandlerPlugin<T> {
|
28
|
-
protected readonly plugins: TPlugin[];
|
29
|
-
constructor(plugins?: readonly TPlugin[]);
|
30
|
-
init(options: StandardHandlerOptions<T>): void;
|
31
|
-
}
|
32
|
-
|
33
33
|
interface StandardHandleOptions<T extends Context> {
|
34
34
|
prefix?: HTTPPath;
|
35
35
|
context: T;
|
@@ -49,16 +49,16 @@ interface StandardHandlerOptions<TContext extends Context> {
|
|
49
49
|
/**
|
50
50
|
* Interceptors at the request level, helpful when you want catch errors
|
51
51
|
*/
|
52
|
-
interceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, StandardHandleResult
|
52
|
+
interceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, Promise<StandardHandleResult>>[];
|
53
53
|
/**
|
54
54
|
* Interceptors at the root level, helpful when you want override the request/response
|
55
55
|
*/
|
56
|
-
rootInterceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, StandardHandleResult
|
56
|
+
rootInterceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, Promise<StandardHandleResult>>[];
|
57
57
|
/**
|
58
58
|
*
|
59
59
|
* Interceptors for procedure client.
|
60
60
|
*/
|
61
|
-
clientInterceptors?: Interceptor<ProcedureClientInterceptorOptions<TContext, Record<never, never>, Meta>,
|
61
|
+
clientInterceptors?: Interceptor<ProcedureClientInterceptorOptions<TContext, Record<never, never>, Meta>, Promise<unknown>>[];
|
62
62
|
}
|
63
63
|
declare class StandardHandler<T extends Context> {
|
64
64
|
private readonly matcher;
|
@@ -70,4 +70,5 @@ declare class StandardHandler<T extends Context> {
|
|
70
70
|
handle(request: StandardLazyRequest, options: StandardHandleOptions<T>): Promise<StandardHandleResult>;
|
71
71
|
}
|
72
72
|
|
73
|
-
export { CompositeStandardHandlerPlugin as C,
|
73
|
+
export { CompositeStandardHandlerPlugin as C, StandardHandler as i };
|
74
|
+
export type { StandardHandlerInterceptorOptions as S, StandardHandlerPlugin as a, StandardHandlerOptions as b, StandardCodec as c, StandardParams as d, StandardMatcher as e, StandardMatchResult as f, StandardHandleOptions as g, StandardHandleResult as h };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
|
2
|
+
import { C as Context, R as Router } from './server.DD2C4ujN.js';
|
3
|
+
import { b as StandardHandlerOptions, i as StandardHandler } from './server.-ACo36I0.js';
|
4
|
+
|
5
|
+
interface StandardRPCHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, StandardRPCJsonSerializerOptions {
|
6
|
+
}
|
7
|
+
declare class StandardRPCHandler<T extends Context> extends StandardHandler<T> {
|
8
|
+
constructor(router: Router<any, T>, options?: StandardRPCHandlerOptions<T>);
|
9
|
+
}
|
10
|
+
|
11
|
+
export { StandardRPCHandler as a };
|
12
|
+
export type { StandardRPCHandlerOptions as S };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
|
2
|
+
import { C as Context, R as Router } from './server.DD2C4ujN.mjs';
|
3
|
+
import { b as StandardHandlerOptions, i as StandardHandler } from './server.Dq8xr7PQ.mjs';
|
4
|
+
|
5
|
+
interface StandardRPCHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, StandardRPCJsonSerializerOptions {
|
6
|
+
}
|
7
|
+
declare class StandardRPCHandler<T extends Context> extends StandardHandler<T> {
|
8
|
+
constructor(router: Router<any, T>, options?: StandardRPCHandlerOptions<T>);
|
9
|
+
}
|
10
|
+
|
11
|
+
export { StandardRPCHandler as a };
|
12
|
+
export type { StandardRPCHandlerOptions as S };
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { C as Context } from './server.
|
2
|
-
import {
|
1
|
+
import { C as Context } from './server.DD2C4ujN.mjs';
|
2
|
+
import { g as StandardHandleOptions } from './server.Dq8xr7PQ.mjs';
|
3
3
|
|
4
4
|
type FriendlyStandardHandleOptions<T extends Context> = Omit<StandardHandleOptions<T>, 'context'> & (Record<never, never> extends T ? {
|
5
5
|
context?: T;
|
@@ -1,18 +1,17 @@
|
|
1
1
|
import { toHttpPath, StandardRPCJsonSerializer, StandardRPCSerializer } from '@orpc/client/standard';
|
2
|
-
import { toArray, intercept, parseEmptyableJSON } from '@orpc/shared';
|
3
|
-
import '@orpc/standard-server/batch';
|
4
2
|
import { ORPCError, toORPCError } from '@orpc/client';
|
5
|
-
import {
|
6
|
-
import {
|
3
|
+
import { toArray, intercept, parseEmptyableJSON, NullProtoObj } from '@orpc/shared';
|
4
|
+
import { flattenHeader } from '@orpc/standard-server';
|
5
|
+
import { c as createProcedureClient, t as traverseContractProcedures, i as isProcedure, u as unlazy, g as getRouter, a as createContractedProcedure } from './server.DLJzqnSX.mjs';
|
7
6
|
|
8
7
|
class CompositeStandardHandlerPlugin {
|
9
8
|
plugins;
|
10
9
|
constructor(plugins = []) {
|
11
10
|
this.plugins = [...plugins].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
12
11
|
}
|
13
|
-
init(options) {
|
12
|
+
init(options, router) {
|
14
13
|
for (const plugin of this.plugins) {
|
15
|
-
plugin.init?.(options);
|
14
|
+
plugin.init?.(options, router);
|
16
15
|
}
|
17
16
|
}
|
18
17
|
}
|
@@ -22,7 +21,7 @@ class StandardHandler {
|
|
22
21
|
this.matcher = matcher;
|
23
22
|
this.codec = codec;
|
24
23
|
const plugins = new CompositeStandardHandlerPlugin(options.plugins);
|
25
|
-
plugins.init(options);
|
24
|
+
plugins.init(options, router);
|
26
25
|
this.interceptors = toArray(options.interceptors);
|
27
26
|
this.clientInterceptors = toArray(options.clientInterceptors);
|
28
27
|
this.rootInterceptors = toArray(options.rootInterceptors);
|
@@ -61,8 +60,10 @@ class StandardHandler {
|
|
61
60
|
isDecoding = true;
|
62
61
|
const input = await this.codec.decode(request2, match.params, match.procedure);
|
63
62
|
isDecoding = false;
|
64
|
-
const
|
65
|
-
|
63
|
+
const output = await client(input, {
|
64
|
+
signal: request2.signal,
|
65
|
+
lastEventId: flattenHeader(request2.headers["last-event-id"])
|
66
|
+
});
|
66
67
|
const response = this.codec.encode(output, match.procedure);
|
67
68
|
return {
|
68
69
|
matched: true,
|
@@ -111,7 +112,7 @@ class StandardRPCCodec {
|
|
111
112
|
}
|
112
113
|
|
113
114
|
class StandardRPCMatcher {
|
114
|
-
tree =
|
115
|
+
tree = new NullProtoObj();
|
115
116
|
pendingRouters = [];
|
116
117
|
init(router, path = []) {
|
117
118
|
const laziedOptions = traverseContractProcedures({ router, path }, ({ path: path2, contract }) => {
|
@@ -173,12 +174,7 @@ class StandardRPCMatcher {
|
|
173
174
|
}
|
174
175
|
|
175
176
|
class StandardRPCHandler extends StandardHandler {
|
176
|
-
constructor(router, options) {
|
177
|
-
options.plugins ??= [];
|
178
|
-
const strictGetMethodPluginEnabled = options.strictGetMethodPluginEnabled ?? true;
|
179
|
-
if (strictGetMethodPluginEnabled) {
|
180
|
-
options.plugins.push(new StrictGetMethodPlugin());
|
181
|
-
}
|
177
|
+
constructor(router, options = {}) {
|
182
178
|
const jsonSerializer = new StandardRPCJsonSerializer(options);
|
183
179
|
const serializer = new StandardRPCSerializer(jsonSerializer);
|
184
180
|
const matcher = new StandardRPCMatcher();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ORPCErrorCode, ORPCErrorOptions, ORPCError, HTTPPath, ClientContext, Client } from '@orpc/client';
|
2
|
-
import { MaybeOptionalOptions, Promisable, Interceptor, Value } from '@orpc/shared';
|
3
2
|
import { ErrorMap, ErrorMapItem, InferSchemaInput, AnySchema, Meta, ContractProcedureDef, InferSchemaOutput, ErrorFromErrorMap, AnyContractRouter, ContractProcedure } from '@orpc/contract';
|
3
|
+
import { MaybeOptionalOptions, Promisable, Interceptor, PromiseWithError, Value } from '@orpc/shared';
|
4
4
|
|
5
5
|
type Context = Record<PropertyKey, any>;
|
6
6
|
type MergedInitialContext<TInitial extends Context, TAdditional extends Context, TCurrent extends Context> = TInitial & Omit<TAdditional, keyof TCurrent>;
|
@@ -28,6 +28,9 @@ interface Lazy<T> {
|
|
28
28
|
};
|
29
29
|
}
|
30
30
|
type Lazyable<T> = T | Lazy<T>;
|
31
|
+
/**
|
32
|
+
* Create a lazy thing.
|
33
|
+
*/
|
31
34
|
declare function lazy<T>(loader: () => Promise<{
|
32
35
|
default: T;
|
33
36
|
}>, meta?: LazyMeta): Lazy<T>;
|
@@ -56,7 +59,15 @@ interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends
|
|
56
59
|
outputValidationIndex: number;
|
57
60
|
handler: ProcedureHandler<TCurrentContext, any, any, any, any>;
|
58
61
|
}
|
62
|
+
/**
|
63
|
+
* This class represents a procedure.
|
64
|
+
*
|
65
|
+
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
66
|
+
*/
|
59
67
|
declare class Procedure<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
68
|
+
/**
|
69
|
+
* This property holds the defined options.
|
70
|
+
*/
|
60
71
|
'~orpc': ProcedureDef<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
61
72
|
constructor(def: ProcedureDef<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>);
|
62
73
|
}
|
@@ -87,6 +98,11 @@ interface MiddlewareOptions<TInContext extends Context, TOutput, TErrorConstruct
|
|
87
98
|
next: MiddlewareNextFn<TOutput>;
|
88
99
|
errors: TErrorConstructorMap;
|
89
100
|
}
|
101
|
+
/**
|
102
|
+
* A function that represents a middleware.
|
103
|
+
*
|
104
|
+
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
105
|
+
*/
|
90
106
|
interface Middleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
91
107
|
(options: MiddlewareOptions<TInContext, TOutput, TErrorConstructorMap, TMeta>, input: TInput, output: MiddlewareOutputFn<TOutput>): Promisable<MiddlewareResult<TOutContext, TOutput>>;
|
92
108
|
}
|
@@ -106,38 +122,71 @@ interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TEr
|
|
106
122
|
signal?: AbortSignal;
|
107
123
|
lastEventId: string | undefined;
|
108
124
|
}
|
109
|
-
/**
|
110
|
-
* Options for creating a procedure caller with comprehensive type safety
|
111
|
-
*/
|
112
125
|
type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext> = {
|
113
126
|
/**
|
114
127
|
* This is helpful for logging and analytics.
|
115
128
|
*/
|
116
129
|
path?: readonly string[];
|
117
|
-
interceptors?: Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap, TMeta>, InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap
|
130
|
+
interceptors?: Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap, TMeta>, PromiseWithError<InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>>[];
|
118
131
|
} & (Record<never, never> extends TInitialContext ? {
|
119
|
-
context?: Value<TInitialContext
|
132
|
+
context?: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
|
120
133
|
} : {
|
121
|
-
context: Value<TInitialContext
|
134
|
+
context: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
|
122
135
|
});
|
136
|
+
/**
|
137
|
+
* Create Server-side client from a procedure.
|
138
|
+
*
|
139
|
+
* @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
|
140
|
+
*/
|
123
141
|
declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TMeta>>, ...[options]: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
|
124
142
|
|
143
|
+
/**
|
144
|
+
* Represents a router, which defines a hierarchical structure of procedures.
|
145
|
+
*
|
146
|
+
* @info A procedure is a router too.
|
147
|
+
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#contract-router Contract Router Docs}
|
148
|
+
*/
|
125
149
|
type Router<T extends AnyContractRouter, TInitialContext extends Context> = T extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? Procedure<TInitialContext, any, UInputSchema, UOutputSchema, UErrorMap, UMeta> : {
|
126
150
|
[K in keyof T]: T[K] extends AnyContractRouter ? Lazyable<Router<T[K], TInitialContext>> : never;
|
127
151
|
};
|
128
152
|
type AnyRouter = Router<any, any>;
|
129
153
|
type InferRouterInitialContext<T extends AnyRouter> = T extends Router<any, infer UInitialContext> ? UInitialContext : never;
|
154
|
+
/**
|
155
|
+
* Infer all initial context of the router.
|
156
|
+
*
|
157
|
+
* @info A procedure is a router too.
|
158
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
159
|
+
*/
|
130
160
|
type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any, any> ? UInitialContext : {
|
131
161
|
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
|
132
162
|
};
|
163
|
+
/**
|
164
|
+
* Infer all current context of the router.
|
165
|
+
*
|
166
|
+
* @info A procedure is a router too.
|
167
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
168
|
+
*/
|
133
169
|
type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any, infer UCurrentContext, any, any, any, any> ? UCurrentContext : {
|
134
170
|
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterCurrentContexts<U> : never;
|
135
171
|
};
|
172
|
+
/**
|
173
|
+
* Infer all router inputs
|
174
|
+
*
|
175
|
+
* @info A procedure is a router too.
|
176
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
177
|
+
*/
|
136
178
|
type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
|
137
179
|
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
|
138
180
|
};
|
181
|
+
/**
|
182
|
+
* Infer all router outputs
|
183
|
+
*
|
184
|
+
* @info A procedure is a router too.
|
185
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
186
|
+
*/
|
139
187
|
type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
|
140
188
|
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
|
141
189
|
};
|
142
190
|
|
143
|
-
export {
|
191
|
+
export { isProcedure as E, createProcedureClient as G, Procedure as P, createORPCErrorConstructorMap as l, mergeCurrentContext as m, LAZY_SYMBOL as n, lazy as p, isLazy as q, getLazyMeta as r, unlazy as u, validateORPCError as v, middlewareOutputFn as z };
|
192
|
+
export type { AnyMiddleware as A, ProcedureHandlerOptions as B, Context as C, ProcedureDef as D, ProcedureClientInterceptorOptions as F, InferRouterInitialContexts as H, InferRouterInitialContext as I, InferRouterCurrentContexts as J, InferRouterInputs as K, Lazyable as L, Middleware as M, InferRouterOutputs as N, ORPCErrorConstructorMap as O, Router as R, MergedInitialContext as a, MergedCurrentContext as b, MapInputMiddleware as c, CreateProcedureClientOptions as d, ProcedureClient as e, AnyRouter as f, Lazy as g, AnyProcedure as h, ProcedureHandler as i, ORPCErrorConstructorMapItemOptions as j, ORPCErrorConstructorMapItem as k, LazyMeta as o, MiddlewareResult as s, MiddlewareNextFnOptions as t, MiddlewareNextFn as w, MiddlewareOutputFn as x, MiddlewareOptions as y };
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ORPCErrorCode, ORPCErrorOptions, ORPCError, HTTPPath, ClientContext, Client } from '@orpc/client';
|
2
|
-
import { MaybeOptionalOptions, Promisable, Interceptor, Value } from '@orpc/shared';
|
3
2
|
import { ErrorMap, ErrorMapItem, InferSchemaInput, AnySchema, Meta, ContractProcedureDef, InferSchemaOutput, ErrorFromErrorMap, AnyContractRouter, ContractProcedure } from '@orpc/contract';
|
3
|
+
import { MaybeOptionalOptions, Promisable, Interceptor, PromiseWithError, Value } from '@orpc/shared';
|
4
4
|
|
5
5
|
type Context = Record<PropertyKey, any>;
|
6
6
|
type MergedInitialContext<TInitial extends Context, TAdditional extends Context, TCurrent extends Context> = TInitial & Omit<TAdditional, keyof TCurrent>;
|
@@ -28,6 +28,9 @@ interface Lazy<T> {
|
|
28
28
|
};
|
29
29
|
}
|
30
30
|
type Lazyable<T> = T | Lazy<T>;
|
31
|
+
/**
|
32
|
+
* Create a lazy thing.
|
33
|
+
*/
|
31
34
|
declare function lazy<T>(loader: () => Promise<{
|
32
35
|
default: T;
|
33
36
|
}>, meta?: LazyMeta): Lazy<T>;
|
@@ -56,7 +59,15 @@ interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends
|
|
56
59
|
outputValidationIndex: number;
|
57
60
|
handler: ProcedureHandler<TCurrentContext, any, any, any, any>;
|
58
61
|
}
|
62
|
+
/**
|
63
|
+
* This class represents a procedure.
|
64
|
+
*
|
65
|
+
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
66
|
+
*/
|
59
67
|
declare class Procedure<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
68
|
+
/**
|
69
|
+
* This property holds the defined options.
|
70
|
+
*/
|
60
71
|
'~orpc': ProcedureDef<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
61
72
|
constructor(def: ProcedureDef<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>);
|
62
73
|
}
|
@@ -87,6 +98,11 @@ interface MiddlewareOptions<TInContext extends Context, TOutput, TErrorConstruct
|
|
87
98
|
next: MiddlewareNextFn<TOutput>;
|
88
99
|
errors: TErrorConstructorMap;
|
89
100
|
}
|
101
|
+
/**
|
102
|
+
* A function that represents a middleware.
|
103
|
+
*
|
104
|
+
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
105
|
+
*/
|
90
106
|
interface Middleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
91
107
|
(options: MiddlewareOptions<TInContext, TOutput, TErrorConstructorMap, TMeta>, input: TInput, output: MiddlewareOutputFn<TOutput>): Promisable<MiddlewareResult<TOutContext, TOutput>>;
|
92
108
|
}
|
@@ -106,38 +122,71 @@ interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TEr
|
|
106
122
|
signal?: AbortSignal;
|
107
123
|
lastEventId: string | undefined;
|
108
124
|
}
|
109
|
-
/**
|
110
|
-
* Options for creating a procedure caller with comprehensive type safety
|
111
|
-
*/
|
112
125
|
type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext> = {
|
113
126
|
/**
|
114
127
|
* This is helpful for logging and analytics.
|
115
128
|
*/
|
116
129
|
path?: readonly string[];
|
117
|
-
interceptors?: Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap, TMeta>, InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap
|
130
|
+
interceptors?: Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap, TMeta>, PromiseWithError<InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>>[];
|
118
131
|
} & (Record<never, never> extends TInitialContext ? {
|
119
|
-
context?: Value<TInitialContext
|
132
|
+
context?: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
|
120
133
|
} : {
|
121
|
-
context: Value<TInitialContext
|
134
|
+
context: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
|
122
135
|
});
|
136
|
+
/**
|
137
|
+
* Create Server-side client from a procedure.
|
138
|
+
*
|
139
|
+
* @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
|
140
|
+
*/
|
123
141
|
declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TMeta>>, ...[options]: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
|
124
142
|
|
143
|
+
/**
|
144
|
+
* Represents a router, which defines a hierarchical structure of procedures.
|
145
|
+
*
|
146
|
+
* @info A procedure is a router too.
|
147
|
+
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#contract-router Contract Router Docs}
|
148
|
+
*/
|
125
149
|
type Router<T extends AnyContractRouter, TInitialContext extends Context> = T extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? Procedure<TInitialContext, any, UInputSchema, UOutputSchema, UErrorMap, UMeta> : {
|
126
150
|
[K in keyof T]: T[K] extends AnyContractRouter ? Lazyable<Router<T[K], TInitialContext>> : never;
|
127
151
|
};
|
128
152
|
type AnyRouter = Router<any, any>;
|
129
153
|
type InferRouterInitialContext<T extends AnyRouter> = T extends Router<any, infer UInitialContext> ? UInitialContext : never;
|
154
|
+
/**
|
155
|
+
* Infer all initial context of the router.
|
156
|
+
*
|
157
|
+
* @info A procedure is a router too.
|
158
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
159
|
+
*/
|
130
160
|
type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any, any> ? UInitialContext : {
|
131
161
|
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
|
132
162
|
};
|
163
|
+
/**
|
164
|
+
* Infer all current context of the router.
|
165
|
+
*
|
166
|
+
* @info A procedure is a router too.
|
167
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
168
|
+
*/
|
133
169
|
type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any, infer UCurrentContext, any, any, any, any> ? UCurrentContext : {
|
134
170
|
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterCurrentContexts<U> : never;
|
135
171
|
};
|
172
|
+
/**
|
173
|
+
* Infer all router inputs
|
174
|
+
*
|
175
|
+
* @info A procedure is a router too.
|
176
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
177
|
+
*/
|
136
178
|
type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
|
137
179
|
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
|
138
180
|
};
|
181
|
+
/**
|
182
|
+
* Infer all router outputs
|
183
|
+
*
|
184
|
+
* @info A procedure is a router too.
|
185
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
186
|
+
*/
|
139
187
|
type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
|
140
188
|
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
|
141
189
|
};
|
142
190
|
|
143
|
-
export {
|
191
|
+
export { isProcedure as E, createProcedureClient as G, Procedure as P, createORPCErrorConstructorMap as l, mergeCurrentContext as m, LAZY_SYMBOL as n, lazy as p, isLazy as q, getLazyMeta as r, unlazy as u, validateORPCError as v, middlewareOutputFn as z };
|
192
|
+
export type { AnyMiddleware as A, ProcedureHandlerOptions as B, Context as C, ProcedureDef as D, ProcedureClientInterceptorOptions as F, InferRouterInitialContexts as H, InferRouterInitialContext as I, InferRouterCurrentContexts as J, InferRouterInputs as K, Lazyable as L, Middleware as M, InferRouterOutputs as N, ORPCErrorConstructorMap as O, Router as R, MergedInitialContext as a, MergedCurrentContext as b, MapInputMiddleware as c, CreateProcedureClientOptions as d, ProcedureClient as e, AnyRouter as f, Lazy as g, AnyProcedure as h, ProcedureHandler as i, ORPCErrorConstructorMapItemOptions as j, ORPCErrorConstructorMapItem as k, LazyMeta as o, MiddlewareResult as s, MiddlewareNextFnOptions as t, MiddlewareNextFn as w, MiddlewareOutputFn as x, MiddlewareOptions as y };
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { isContractProcedure, ValidationError, mergePrefix, mergeErrorMap, enhanceRoute } from '@orpc/contract';
|
2
|
+
import { value, intercept, resolveMaybeOptionalOptions } from '@orpc/shared';
|
2
3
|
import { fallbackORPCErrorStatus, ORPCError } from '@orpc/client';
|
3
|
-
import { value, intercept } from '@orpc/shared';
|
4
4
|
|
5
5
|
const LAZY_SYMBOL = Symbol("ORPC_LAZY_SYMBOL");
|
6
6
|
function lazy(loader, meta = {}) {
|
@@ -46,6 +46,9 @@ function addMiddleware(middlewares, addition) {
|
|
46
46
|
}
|
47
47
|
|
48
48
|
class Procedure {
|
49
|
+
/**
|
50
|
+
* This property holds the defined options.
|
51
|
+
*/
|
49
52
|
"~orpc";
|
50
53
|
constructor(def) {
|
51
54
|
this["~orpc"] = def;
|
@@ -358,7 +361,8 @@ function createContractedProcedure(procedure, contract) {
|
|
358
361
|
});
|
359
362
|
}
|
360
363
|
function call(procedure, input, ...rest) {
|
361
|
-
|
364
|
+
const options = resolveMaybeOptionalOptions(rest);
|
365
|
+
return createProcedureClient(procedure, options)(input, options);
|
362
366
|
}
|
363
367
|
|
364
368
|
export { LAZY_SYMBOL as L, Procedure as P, createContractedProcedure as a, addMiddleware as b, createProcedureClient as c, isLazy as d, enhanceRouter as e, createAssertedLazyProcedure as f, getRouter as g, createORPCErrorConstructorMap as h, isProcedure as i, getLazyMeta as j, middlewareOutputFn as k, lazy as l, mergeCurrentContext as m, isStartWithMiddlewares as n, mergeMiddlewares as o, call as p, getHiddenRouterContract as q, createAccessibleLazyRouter as r, setHiddenRouterContract as s, traverseContractProcedures as t, unlazy as u, validateORPCError as v, resolveContractProcedures as w, unlazyRouter as x };
|
@@ -1,8 +1,18 @@
|
|
1
1
|
import { HTTPPath, ORPCError } from '@orpc/client';
|
2
|
-
import { Meta
|
3
|
-
import { Interceptor
|
2
|
+
import { Meta } from '@orpc/contract';
|
3
|
+
import { Interceptor } from '@orpc/shared';
|
4
4
|
import { StandardResponse, StandardLazyRequest } from '@orpc/standard-server';
|
5
|
-
import {
|
5
|
+
import { C as Context, R as Router, f as AnyRouter, h as AnyProcedure, F as ProcedureClientInterceptorOptions } from './server.DD2C4ujN.mjs';
|
6
|
+
|
7
|
+
interface StandardHandlerPlugin<T extends Context> {
|
8
|
+
order?: number;
|
9
|
+
init?(options: StandardHandlerOptions<T>, router: Router<any, T>): void;
|
10
|
+
}
|
11
|
+
declare class CompositeStandardHandlerPlugin<T extends Context, TPlugin extends StandardHandlerPlugin<T>> implements StandardHandlerPlugin<T> {
|
12
|
+
protected readonly plugins: TPlugin[];
|
13
|
+
constructor(plugins?: readonly TPlugin[]);
|
14
|
+
init(options: StandardHandlerOptions<T>, router: Router<any, T>): void;
|
15
|
+
}
|
6
16
|
|
7
17
|
type StandardParams = Record<string, string>;
|
8
18
|
type StandardMatchResult = {
|
@@ -20,16 +30,6 @@ interface StandardCodec {
|
|
20
30
|
decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure): Promise<unknown>;
|
21
31
|
}
|
22
32
|
|
23
|
-
interface StandardHandlerPlugin<TContext extends Context> {
|
24
|
-
order?: number;
|
25
|
-
init?(options: StandardHandlerOptions<TContext>): void;
|
26
|
-
}
|
27
|
-
declare class CompositeStandardHandlerPlugin<T extends Context, TPlugin extends StandardHandlerPlugin<T>> implements StandardHandlerPlugin<T> {
|
28
|
-
protected readonly plugins: TPlugin[];
|
29
|
-
constructor(plugins?: readonly TPlugin[]);
|
30
|
-
init(options: StandardHandlerOptions<T>): void;
|
31
|
-
}
|
32
|
-
|
33
33
|
interface StandardHandleOptions<T extends Context> {
|
34
34
|
prefix?: HTTPPath;
|
35
35
|
context: T;
|
@@ -49,16 +49,16 @@ interface StandardHandlerOptions<TContext extends Context> {
|
|
49
49
|
/**
|
50
50
|
* Interceptors at the request level, helpful when you want catch errors
|
51
51
|
*/
|
52
|
-
interceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, StandardHandleResult
|
52
|
+
interceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, Promise<StandardHandleResult>>[];
|
53
53
|
/**
|
54
54
|
* Interceptors at the root level, helpful when you want override the request/response
|
55
55
|
*/
|
56
|
-
rootInterceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, StandardHandleResult
|
56
|
+
rootInterceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, Promise<StandardHandleResult>>[];
|
57
57
|
/**
|
58
58
|
*
|
59
59
|
* Interceptors for procedure client.
|
60
60
|
*/
|
61
|
-
clientInterceptors?: Interceptor<ProcedureClientInterceptorOptions<TContext, Record<never, never>, Meta>,
|
61
|
+
clientInterceptors?: Interceptor<ProcedureClientInterceptorOptions<TContext, Record<never, never>, Meta>, Promise<unknown>>[];
|
62
62
|
}
|
63
63
|
declare class StandardHandler<T extends Context> {
|
64
64
|
private readonly matcher;
|
@@ -70,4 +70,5 @@ declare class StandardHandler<T extends Context> {
|
|
70
70
|
handle(request: StandardLazyRequest, options: StandardHandleOptions<T>): Promise<StandardHandleResult>;
|
71
71
|
}
|
72
72
|
|
73
|
-
export { CompositeStandardHandlerPlugin as C,
|
73
|
+
export { CompositeStandardHandlerPlugin as C, StandardHandler as i };
|
74
|
+
export type { StandardHandlerInterceptorOptions as S, StandardHandlerPlugin as a, StandardHandlerOptions as b, StandardCodec as c, StandardParams as d, StandardMatcher as e, StandardMatchResult as f, StandardHandleOptions as g, StandardHandleResult as h };
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { C as Context } from './server.
|
2
|
-
import {
|
1
|
+
import { C as Context } from './server.DD2C4ujN.js';
|
2
|
+
import { g as StandardHandleOptions } from './server.-ACo36I0.js';
|
3
3
|
|
4
4
|
type FriendlyStandardHandleOptions<T extends Context> = Omit<StandardHandleOptions<T>, 'context'> & (Record<never, never> extends T ? {
|
5
5
|
context?: T;
|