@temporary-name/server 1.9.3-alpha.62445d8d52a6787e7750865cd468fca8cccd3e28 → 1.9.3-alpha.6a70825f6d8c3dc99b87e4e5b778aea0fa007417
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/adapters/aws-lambda/index.d.mts +3 -3
- package/dist/adapters/aws-lambda/index.d.ts +3 -3
- package/dist/adapters/aws-lambda/index.mjs +4 -3
- package/dist/adapters/fetch/index.d.mts +3 -3
- package/dist/adapters/fetch/index.d.ts +3 -3
- package/dist/adapters/fetch/index.mjs +4 -3
- package/dist/adapters/node/index.d.mts +3 -3
- package/dist/adapters/node/index.d.ts +3 -3
- package/dist/adapters/node/index.mjs +4 -3
- package/dist/adapters/standard/index.d.mts +10 -5
- package/dist/adapters/standard/index.d.ts +10 -5
- package/dist/adapters/standard/index.mjs +4 -3
- package/dist/index.d.mts +51 -83
- package/dist/index.d.ts +51 -83
- package/dist/index.mjs +50 -213
- package/dist/openapi/index.d.mts +1 -1
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.mjs +52 -34
- package/dist/plugins/index.d.mts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/shared/{server.CT1xhSmE.d.mts → server.BCcLYvdF.d.mts} +1 -1
- package/dist/shared/server.CHV9AQHl.mjs +412 -0
- package/dist/shared/{server.cjcgLdr1.d.ts → server.CdeqmULw.d.ts} +1 -1
- package/dist/shared/{server.B93y_8tj.d.mts → server.DHezmW6C.d.mts} +2 -2
- package/dist/shared/server.DN9mVGfv.mjs +11 -0
- package/dist/shared/{server.CqTex_jI.mjs → server.DWwaAM-a.mjs} +13 -23
- package/dist/shared/{server.D_fags8X.d.ts → server.Da-qLzdU.d.ts} +2 -2
- package/dist/shared/{server.C3RuMHWl.d.mts → server.DecvGKtb.d.mts} +118 -68
- package/dist/shared/{server.C3RuMHWl.d.ts → server.DecvGKtb.d.ts} +118 -68
- package/dist/shared/{server.Kxw442A9.mjs → server.JtIZ8YG7.mjs} +1 -11
- package/package.json +10 -10
- package/dist/shared/server.BYYf0Wn6.mjs +0 -202
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorMap, ErrorMapItem, InferSchemaInput,
|
|
1
|
+
import { ErrorMap, ErrorMapItem, InferSchemaInput, Schemas, Meta, ContractProcedureDef, AnyContractRouter, ContractProcedure, InferProcedureClientInputs, InferSchemaOutput, EnhanceRouteOptions, MergedErrorMap, AnyContractProcedure, ContractRouter, AnySchema, ErrorFromErrorMap } from '@temporary-name/contract';
|
|
2
2
|
import { ORPCErrorCode, MaybeOptionalOptions, ORPCErrorOptions, ORPCError, Promisable, HTTPPath, ClientContext, Interceptor, PromiseWithError, Value, Client } from '@temporary-name/shared';
|
|
3
3
|
|
|
4
4
|
type Context = Record<PropertyKey, any>;
|
|
@@ -13,19 +13,22 @@ type ORPCErrorConstructorMap<T extends ErrorMap> = {
|
|
|
13
13
|
};
|
|
14
14
|
declare function createORPCErrorConstructorMap<T extends ErrorMap>(errors: T): ORPCErrorConstructorMap<T>;
|
|
15
15
|
|
|
16
|
-
interface ProcedureHandlerOptions<TCurrentContext extends Context,
|
|
16
|
+
interface ProcedureHandlerOptions<TCurrentContext extends Context, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
|
17
17
|
context: TCurrentContext;
|
|
18
|
-
input: TInput;
|
|
19
18
|
path: readonly string[];
|
|
20
|
-
procedure: Procedure<Context, Context,
|
|
19
|
+
procedure: Procedure<Context, Context, Schemas, ErrorMap, TMeta>;
|
|
21
20
|
signal?: AbortSignal;
|
|
22
21
|
lastEventId: string | undefined;
|
|
23
22
|
errors: TErrorConstructorMap;
|
|
24
23
|
}
|
|
25
|
-
interface ProcedureHandler<TCurrentContext extends Context, TInput
|
|
26
|
-
|
|
24
|
+
interface ProcedureHandler<TCurrentContext extends Context, TInput extends {
|
|
25
|
+
path: any;
|
|
26
|
+
query: any;
|
|
27
|
+
body: any;
|
|
28
|
+
}, THandlerOutput, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
29
|
+
(input: TInput, opt: ProcedureHandlerOptions<TCurrentContext, ORPCErrorConstructorMap<TErrorMap>, TMeta>): Promisable<THandlerOutput>;
|
|
27
30
|
}
|
|
28
|
-
interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends Context,
|
|
31
|
+
interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta> extends ContractProcedureDef<TSchemas, TErrorMap, TMeta> {
|
|
29
32
|
__initialContext?: (type: TInitialContext) => unknown;
|
|
30
33
|
middlewares: readonly AnyMiddleware[];
|
|
31
34
|
inputValidationIndex: number;
|
|
@@ -37,14 +40,14 @@ interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends
|
|
|
37
40
|
*
|
|
38
41
|
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
39
42
|
*/
|
|
40
|
-
declare class Procedure<TInitialContext extends Context, TCurrentContext extends Context,
|
|
43
|
+
declare class Procedure<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
41
44
|
/**
|
|
42
45
|
* This property holds the defined options.
|
|
43
46
|
*/
|
|
44
|
-
'~orpc': ProcedureDef<TInitialContext, TCurrentContext,
|
|
45
|
-
constructor(def: ProcedureDef<TInitialContext, TCurrentContext,
|
|
47
|
+
'~orpc': ProcedureDef<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta>;
|
|
48
|
+
constructor(def: ProcedureDef<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta>);
|
|
46
49
|
}
|
|
47
|
-
type AnyProcedure = Procedure<any, any,
|
|
50
|
+
type AnyProcedure = Procedure<any, any, Schemas, any, any>;
|
|
48
51
|
declare function isProcedure(item: unknown): item is AnyProcedure;
|
|
49
52
|
|
|
50
53
|
type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
|
|
@@ -65,7 +68,7 @@ interface MiddlewareOutputFn<TOutput> {
|
|
|
65
68
|
interface MiddlewareOptions<TInContext extends Context, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
|
66
69
|
context: TInContext;
|
|
67
70
|
path: readonly string[];
|
|
68
|
-
procedure: Procedure<Context, Context,
|
|
71
|
+
procedure: Procedure<Context, Context, Schemas, ErrorMap, TMeta>;
|
|
69
72
|
signal?: AbortSignal;
|
|
70
73
|
lastEventId: string | undefined;
|
|
71
74
|
next: MiddlewareNextFn<TOutput>;
|
|
@@ -85,6 +88,91 @@ interface MapInputMiddleware<TInput, TMappedInput> {
|
|
|
85
88
|
}
|
|
86
89
|
declare function middlewareOutputFn<TOutput>(output: TOutput): MiddlewareResult<Record<never, never>, TOutput>;
|
|
87
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Represents a router, which defines a hierarchical structure of procedures.
|
|
93
|
+
*
|
|
94
|
+
* @info A procedure is a router too.
|
|
95
|
+
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#contract-router Contract Router Docs}
|
|
96
|
+
*/
|
|
97
|
+
type Router<T extends AnyContractRouter, TInitialContext extends Context> = T extends ContractProcedure<infer USchemas, infer UErrorMap, infer UMeta> ? Procedure<TInitialContext, any, USchemas, UErrorMap, UMeta> : {
|
|
98
|
+
[K in keyof T]: T[K] extends AnyContractRouter ? Lazyable<Router<T[K], TInitialContext>> : never;
|
|
99
|
+
};
|
|
100
|
+
type AnyRouter = Router<any, any>;
|
|
101
|
+
type InferRouterInitialContext<T extends AnyRouter> = T extends Router<any, infer UInitialContext> ? UInitialContext : never;
|
|
102
|
+
/**
|
|
103
|
+
* Infer all initial context of the router.
|
|
104
|
+
*
|
|
105
|
+
* @info A procedure is a router too.
|
|
106
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
|
107
|
+
*/
|
|
108
|
+
type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any> ? UInitialContext : {
|
|
109
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Infer all current context of the router.
|
|
113
|
+
*
|
|
114
|
+
* @info A procedure is a router too.
|
|
115
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
|
116
|
+
*/
|
|
117
|
+
type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any, infer UCurrentContext, any, any, any> ? UCurrentContext : {
|
|
118
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterCurrentContexts<U> : never;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Infer all router inputs
|
|
122
|
+
*
|
|
123
|
+
* @info A procedure is a router too.
|
|
124
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
|
125
|
+
*/
|
|
126
|
+
type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer USchemas, any, any> ? InferProcedureClientInputs<USchemas> : {
|
|
127
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Infer all router outputs
|
|
131
|
+
*
|
|
132
|
+
* @info A procedure is a router too.
|
|
133
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
|
134
|
+
*/
|
|
135
|
+
type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, infer USchemas, any, any> ? InferSchemaOutput<USchemas['outputSchema']> : {
|
|
136
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
declare function getRouter<T extends Lazyable<AnyRouter | undefined>>(router: T, path: readonly string[]): T extends Lazy<any> ? Lazy<AnyRouter | undefined> : Lazyable<AnyRouter | undefined>;
|
|
140
|
+
type AccessibleLazyRouter<T extends Lazyable<AnyRouter | undefined>> = T extends Lazy<infer U extends AnyRouter | undefined | Lazy<AnyRouter | undefined>> ? AccessibleLazyRouter<U> : T extends AnyProcedure | undefined ? Lazy<T> : Lazy<T> & {
|
|
141
|
+
[K in keyof T]: T[K] extends Lazyable<AnyRouter> ? AccessibleLazyRouter<T[K]> : never;
|
|
142
|
+
};
|
|
143
|
+
declare function createAccessibleLazyRouter<T extends Lazy<AnyRouter | undefined>>(lazied: T): AccessibleLazyRouter<T>;
|
|
144
|
+
type EnhancedRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap> = T extends Lazy<infer U extends AnyRouter> ? AccessibleLazyRouter<EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>> : T extends (Procedure<infer UInitialContext, infer UCurrentContext, infer USchemas, infer UErrorMap, infer UMeta>) ? Procedure<MergedInitialContext<TInitialContext, UInitialContext, TCurrentContext>, UCurrentContext, USchemas, MergedErrorMap<TErrorMap, UErrorMap>, UMeta> : {
|
|
145
|
+
[K in keyof T]: T[K] extends Lazyable<AnyRouter> ? EnhancedRouter<T[K], TInitialContext, TCurrentContext, TErrorMap> : never;
|
|
146
|
+
};
|
|
147
|
+
interface EnhanceRouterOptions<TErrorMap extends ErrorMap> extends EnhanceRouteOptions {
|
|
148
|
+
middlewares: readonly AnyMiddleware[];
|
|
149
|
+
errorMap: TErrorMap;
|
|
150
|
+
dedupeLeadingMiddlewares: boolean;
|
|
151
|
+
}
|
|
152
|
+
declare function enhanceRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap>(router: T, options: EnhanceRouterOptions<TErrorMap>): EnhancedRouter<T, TInitialContext, TCurrentContext, TErrorMap>;
|
|
153
|
+
interface TraverseContractProceduresOptions {
|
|
154
|
+
router: AnyContractRouter | AnyRouter;
|
|
155
|
+
path: readonly string[];
|
|
156
|
+
}
|
|
157
|
+
interface TraverseContractProcedureCallbackOptions {
|
|
158
|
+
contract: AnyContractProcedure | AnyProcedure;
|
|
159
|
+
path: readonly string[];
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* @deprecated Use `TraverseContractProcedureCallbackOptions` instead.
|
|
163
|
+
*/
|
|
164
|
+
type ContractProcedureCallbackOptions = TraverseContractProcedureCallbackOptions;
|
|
165
|
+
interface LazyTraverseContractProceduresOptions {
|
|
166
|
+
router: Lazy<AnyRouter>;
|
|
167
|
+
path: readonly string[];
|
|
168
|
+
}
|
|
169
|
+
declare function traverseContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void, lazyOptions?: LazyTraverseContractProceduresOptions[]): LazyTraverseContractProceduresOptions[];
|
|
170
|
+
declare function resolveContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void): Promise<void>;
|
|
171
|
+
type UnlaziedRouter<T extends AnyRouter> = T extends AnyProcedure ? T : {
|
|
172
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? UnlaziedRouter<U> : never;
|
|
173
|
+
};
|
|
174
|
+
declare function unlazyRouter<T extends AnyRouter>(router: T): Promise<UnlaziedRouter<T>>;
|
|
175
|
+
|
|
88
176
|
declare const LAZY_SYMBOL: unique symbol;
|
|
89
177
|
interface LazyMeta {
|
|
90
178
|
prefix?: HTTPPath;
|
|
@@ -98,27 +186,37 @@ interface Lazy<T> {
|
|
|
98
186
|
};
|
|
99
187
|
}
|
|
100
188
|
type Lazyable<T> = T | Lazy<T>;
|
|
189
|
+
/**
|
|
190
|
+
* @internal
|
|
191
|
+
*/
|
|
192
|
+
declare function lazyInternal<T>(loader: () => Promise<{
|
|
193
|
+
default: T;
|
|
194
|
+
}>, meta?: LazyMeta): Lazy<T>;
|
|
101
195
|
/**
|
|
102
196
|
* Creates a lazy-loaded item.
|
|
103
197
|
*
|
|
104
198
|
* @warning The `prefix` in `meta` only holds metadata and does not apply the prefix to the lazy router, use `os.prefix(...).lazyRoute(...)` instead.
|
|
105
199
|
*/
|
|
106
|
-
declare function lazy<T
|
|
200
|
+
declare function lazy<T extends Router<ContractRouter<{}>, any>>(prefix: HTTPPath, loader: () => Promise<{
|
|
107
201
|
default: T;
|
|
108
|
-
}
|
|
202
|
+
}>): EnhancedRouter<Lazy<T>, {}, {}, {}>;
|
|
109
203
|
declare function isLazy(item: unknown): item is Lazy<any>;
|
|
110
204
|
declare function getLazyMeta(lazied: Lazy<any>): LazyMeta;
|
|
111
205
|
declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
|
112
206
|
default: T extends Lazy<infer U> ? U : T;
|
|
113
207
|
}>;
|
|
114
208
|
|
|
115
|
-
type ProcedureClient<TClientContext extends ClientContext,
|
|
209
|
+
type ProcedureClient<TClientContext extends ClientContext, TSchemas extends Schemas, TErrorMap extends ErrorMap> = Client<TClientContext, InferProcedureClientInputs<TSchemas>, InferSchemaOutput<TSchemas['outputSchema']>, ErrorFromErrorMap<TErrorMap>>;
|
|
116
210
|
interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
117
211
|
context: TInitialContext;
|
|
118
|
-
input:
|
|
212
|
+
input: {
|
|
213
|
+
path: unknown;
|
|
214
|
+
query: unknown;
|
|
215
|
+
body: unknown;
|
|
216
|
+
};
|
|
119
217
|
errors: ORPCErrorConstructorMap<TErrorMap>;
|
|
120
218
|
path: readonly string[];
|
|
121
|
-
procedure: Procedure<Context, Context,
|
|
219
|
+
procedure: Procedure<Context, Context, Schemas, ErrorMap, TMeta>;
|
|
122
220
|
signal?: AbortSignal;
|
|
123
221
|
lastEventId: string | undefined;
|
|
124
222
|
}
|
|
@@ -138,55 +236,7 @@ type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema
|
|
|
138
236
|
*
|
|
139
237
|
* @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
|
|
140
238
|
*/
|
|
141
|
-
declare function createProcedureClient<TInitialContext extends Context,
|
|
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
|
-
*/
|
|
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> : {
|
|
150
|
-
[K in keyof T]: T[K] extends AnyContractRouter ? Lazyable<Router<T[K], TInitialContext>> : never;
|
|
151
|
-
};
|
|
152
|
-
type AnyRouter = Router<any, any>;
|
|
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
|
-
*/
|
|
160
|
-
type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any, any> ? UInitialContext : {
|
|
161
|
-
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
|
|
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
|
-
*/
|
|
169
|
-
type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any, infer UCurrentContext, any, any, any, any> ? UCurrentContext : {
|
|
170
|
-
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterCurrentContexts<U> : never;
|
|
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
|
-
*/
|
|
178
|
-
type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
|
|
179
|
-
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
|
|
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
|
-
*/
|
|
187
|
-
type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
|
|
188
|
-
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
|
|
189
|
-
};
|
|
239
|
+
declare function createProcedureClient<TInitialContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TSchemas, TErrorMap, TMeta>>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TSchemas['outputSchema'], TErrorMap, TMeta, TClientContext>>): ProcedureClient<TClientContext, TSchemas, TErrorMap>;
|
|
190
240
|
|
|
191
|
-
export { isProcedure as
|
|
192
|
-
export type { AnyMiddleware as A,
|
|
241
|
+
export { traverseContractProcedures as $, middlewareOutputFn as B, isProcedure as G, createProcedureClient as J, Procedure as P, getRouter as T, createAccessibleLazyRouter as V, enhanceRouter as W, resolveContractProcedures as a0, unlazyRouter as a2, mergeCurrentContext as m, createORPCErrorConstructorMap as n, LAZY_SYMBOL as o, lazyInternal as q, lazy as r, isLazy as s, getLazyMeta as t, unlazy as u };
|
|
242
|
+
export type { AnyMiddleware as A, Context as C, ProcedureHandlerOptions as D, EnhanceRouterOptions as E, ProcedureDef as F, ProcedureClientInterceptorOptions as H, InferRouterInitialContext as I, InferRouterInitialContexts as K, Lazy as L, Middleware as M, InferRouterCurrentContexts as N, ORPCErrorConstructorMap as O, InferRouterInputs as Q, Router as R, InferRouterOutputs as S, AccessibleLazyRouter as U, TraverseContractProceduresOptions as X, TraverseContractProcedureCallbackOptions as Y, ContractProcedureCallbackOptions as Z, LazyTraverseContractProceduresOptions as _, CreateProcedureClientOptions as a, UnlaziedRouter as a1, ProcedureClient as b, MergedInitialContext as c, MergedCurrentContext as d, ProcedureHandler as e, EnhancedRouter as f, MapInputMiddleware as g, AnyProcedure as h, Lazyable as i, AnyRouter as j, ORPCErrorConstructorMapItemOptions as k, ORPCErrorConstructorMapItem as l, LazyMeta as p, MiddlewareResult as v, MiddlewareNextFnOptions as w, MiddlewareNextFn as x, MiddlewareOutputFn as y, MiddlewareOptions as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorMap, ErrorMapItem, InferSchemaInput,
|
|
1
|
+
import { ErrorMap, ErrorMapItem, InferSchemaInput, Schemas, Meta, ContractProcedureDef, AnyContractRouter, ContractProcedure, InferProcedureClientInputs, InferSchemaOutput, EnhanceRouteOptions, MergedErrorMap, AnyContractProcedure, ContractRouter, AnySchema, ErrorFromErrorMap } from '@temporary-name/contract';
|
|
2
2
|
import { ORPCErrorCode, MaybeOptionalOptions, ORPCErrorOptions, ORPCError, Promisable, HTTPPath, ClientContext, Interceptor, PromiseWithError, Value, Client } from '@temporary-name/shared';
|
|
3
3
|
|
|
4
4
|
type Context = Record<PropertyKey, any>;
|
|
@@ -13,19 +13,22 @@ type ORPCErrorConstructorMap<T extends ErrorMap> = {
|
|
|
13
13
|
};
|
|
14
14
|
declare function createORPCErrorConstructorMap<T extends ErrorMap>(errors: T): ORPCErrorConstructorMap<T>;
|
|
15
15
|
|
|
16
|
-
interface ProcedureHandlerOptions<TCurrentContext extends Context,
|
|
16
|
+
interface ProcedureHandlerOptions<TCurrentContext extends Context, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
|
17
17
|
context: TCurrentContext;
|
|
18
|
-
input: TInput;
|
|
19
18
|
path: readonly string[];
|
|
20
|
-
procedure: Procedure<Context, Context,
|
|
19
|
+
procedure: Procedure<Context, Context, Schemas, ErrorMap, TMeta>;
|
|
21
20
|
signal?: AbortSignal;
|
|
22
21
|
lastEventId: string | undefined;
|
|
23
22
|
errors: TErrorConstructorMap;
|
|
24
23
|
}
|
|
25
|
-
interface ProcedureHandler<TCurrentContext extends Context, TInput
|
|
26
|
-
|
|
24
|
+
interface ProcedureHandler<TCurrentContext extends Context, TInput extends {
|
|
25
|
+
path: any;
|
|
26
|
+
query: any;
|
|
27
|
+
body: any;
|
|
28
|
+
}, THandlerOutput, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
29
|
+
(input: TInput, opt: ProcedureHandlerOptions<TCurrentContext, ORPCErrorConstructorMap<TErrorMap>, TMeta>): Promisable<THandlerOutput>;
|
|
27
30
|
}
|
|
28
|
-
interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends Context,
|
|
31
|
+
interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta> extends ContractProcedureDef<TSchemas, TErrorMap, TMeta> {
|
|
29
32
|
__initialContext?: (type: TInitialContext) => unknown;
|
|
30
33
|
middlewares: readonly AnyMiddleware[];
|
|
31
34
|
inputValidationIndex: number;
|
|
@@ -37,14 +40,14 @@ interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends
|
|
|
37
40
|
*
|
|
38
41
|
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
39
42
|
*/
|
|
40
|
-
declare class Procedure<TInitialContext extends Context, TCurrentContext extends Context,
|
|
43
|
+
declare class Procedure<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
41
44
|
/**
|
|
42
45
|
* This property holds the defined options.
|
|
43
46
|
*/
|
|
44
|
-
'~orpc': ProcedureDef<TInitialContext, TCurrentContext,
|
|
45
|
-
constructor(def: ProcedureDef<TInitialContext, TCurrentContext,
|
|
47
|
+
'~orpc': ProcedureDef<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta>;
|
|
48
|
+
constructor(def: ProcedureDef<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta>);
|
|
46
49
|
}
|
|
47
|
-
type AnyProcedure = Procedure<any, any,
|
|
50
|
+
type AnyProcedure = Procedure<any, any, Schemas, any, any>;
|
|
48
51
|
declare function isProcedure(item: unknown): item is AnyProcedure;
|
|
49
52
|
|
|
50
53
|
type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
|
|
@@ -65,7 +68,7 @@ interface MiddlewareOutputFn<TOutput> {
|
|
|
65
68
|
interface MiddlewareOptions<TInContext extends Context, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
|
66
69
|
context: TInContext;
|
|
67
70
|
path: readonly string[];
|
|
68
|
-
procedure: Procedure<Context, Context,
|
|
71
|
+
procedure: Procedure<Context, Context, Schemas, ErrorMap, TMeta>;
|
|
69
72
|
signal?: AbortSignal;
|
|
70
73
|
lastEventId: string | undefined;
|
|
71
74
|
next: MiddlewareNextFn<TOutput>;
|
|
@@ -85,6 +88,91 @@ interface MapInputMiddleware<TInput, TMappedInput> {
|
|
|
85
88
|
}
|
|
86
89
|
declare function middlewareOutputFn<TOutput>(output: TOutput): MiddlewareResult<Record<never, never>, TOutput>;
|
|
87
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Represents a router, which defines a hierarchical structure of procedures.
|
|
93
|
+
*
|
|
94
|
+
* @info A procedure is a router too.
|
|
95
|
+
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#contract-router Contract Router Docs}
|
|
96
|
+
*/
|
|
97
|
+
type Router<T extends AnyContractRouter, TInitialContext extends Context> = T extends ContractProcedure<infer USchemas, infer UErrorMap, infer UMeta> ? Procedure<TInitialContext, any, USchemas, UErrorMap, UMeta> : {
|
|
98
|
+
[K in keyof T]: T[K] extends AnyContractRouter ? Lazyable<Router<T[K], TInitialContext>> : never;
|
|
99
|
+
};
|
|
100
|
+
type AnyRouter = Router<any, any>;
|
|
101
|
+
type InferRouterInitialContext<T extends AnyRouter> = T extends Router<any, infer UInitialContext> ? UInitialContext : never;
|
|
102
|
+
/**
|
|
103
|
+
* Infer all initial context of the router.
|
|
104
|
+
*
|
|
105
|
+
* @info A procedure is a router too.
|
|
106
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
|
107
|
+
*/
|
|
108
|
+
type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any> ? UInitialContext : {
|
|
109
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Infer all current context of the router.
|
|
113
|
+
*
|
|
114
|
+
* @info A procedure is a router too.
|
|
115
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
|
116
|
+
*/
|
|
117
|
+
type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any, infer UCurrentContext, any, any, any> ? UCurrentContext : {
|
|
118
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterCurrentContexts<U> : never;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Infer all router inputs
|
|
122
|
+
*
|
|
123
|
+
* @info A procedure is a router too.
|
|
124
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
|
125
|
+
*/
|
|
126
|
+
type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer USchemas, any, any> ? InferProcedureClientInputs<USchemas> : {
|
|
127
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Infer all router outputs
|
|
131
|
+
*
|
|
132
|
+
* @info A procedure is a router too.
|
|
133
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
|
134
|
+
*/
|
|
135
|
+
type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, infer USchemas, any, any> ? InferSchemaOutput<USchemas['outputSchema']> : {
|
|
136
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
declare function getRouter<T extends Lazyable<AnyRouter | undefined>>(router: T, path: readonly string[]): T extends Lazy<any> ? Lazy<AnyRouter | undefined> : Lazyable<AnyRouter | undefined>;
|
|
140
|
+
type AccessibleLazyRouter<T extends Lazyable<AnyRouter | undefined>> = T extends Lazy<infer U extends AnyRouter | undefined | Lazy<AnyRouter | undefined>> ? AccessibleLazyRouter<U> : T extends AnyProcedure | undefined ? Lazy<T> : Lazy<T> & {
|
|
141
|
+
[K in keyof T]: T[K] extends Lazyable<AnyRouter> ? AccessibleLazyRouter<T[K]> : never;
|
|
142
|
+
};
|
|
143
|
+
declare function createAccessibleLazyRouter<T extends Lazy<AnyRouter | undefined>>(lazied: T): AccessibleLazyRouter<T>;
|
|
144
|
+
type EnhancedRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap> = T extends Lazy<infer U extends AnyRouter> ? AccessibleLazyRouter<EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>> : T extends (Procedure<infer UInitialContext, infer UCurrentContext, infer USchemas, infer UErrorMap, infer UMeta>) ? Procedure<MergedInitialContext<TInitialContext, UInitialContext, TCurrentContext>, UCurrentContext, USchemas, MergedErrorMap<TErrorMap, UErrorMap>, UMeta> : {
|
|
145
|
+
[K in keyof T]: T[K] extends Lazyable<AnyRouter> ? EnhancedRouter<T[K], TInitialContext, TCurrentContext, TErrorMap> : never;
|
|
146
|
+
};
|
|
147
|
+
interface EnhanceRouterOptions<TErrorMap extends ErrorMap> extends EnhanceRouteOptions {
|
|
148
|
+
middlewares: readonly AnyMiddleware[];
|
|
149
|
+
errorMap: TErrorMap;
|
|
150
|
+
dedupeLeadingMiddlewares: boolean;
|
|
151
|
+
}
|
|
152
|
+
declare function enhanceRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap>(router: T, options: EnhanceRouterOptions<TErrorMap>): EnhancedRouter<T, TInitialContext, TCurrentContext, TErrorMap>;
|
|
153
|
+
interface TraverseContractProceduresOptions {
|
|
154
|
+
router: AnyContractRouter | AnyRouter;
|
|
155
|
+
path: readonly string[];
|
|
156
|
+
}
|
|
157
|
+
interface TraverseContractProcedureCallbackOptions {
|
|
158
|
+
contract: AnyContractProcedure | AnyProcedure;
|
|
159
|
+
path: readonly string[];
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* @deprecated Use `TraverseContractProcedureCallbackOptions` instead.
|
|
163
|
+
*/
|
|
164
|
+
type ContractProcedureCallbackOptions = TraverseContractProcedureCallbackOptions;
|
|
165
|
+
interface LazyTraverseContractProceduresOptions {
|
|
166
|
+
router: Lazy<AnyRouter>;
|
|
167
|
+
path: readonly string[];
|
|
168
|
+
}
|
|
169
|
+
declare function traverseContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void, lazyOptions?: LazyTraverseContractProceduresOptions[]): LazyTraverseContractProceduresOptions[];
|
|
170
|
+
declare function resolveContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void): Promise<void>;
|
|
171
|
+
type UnlaziedRouter<T extends AnyRouter> = T extends AnyProcedure ? T : {
|
|
172
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? UnlaziedRouter<U> : never;
|
|
173
|
+
};
|
|
174
|
+
declare function unlazyRouter<T extends AnyRouter>(router: T): Promise<UnlaziedRouter<T>>;
|
|
175
|
+
|
|
88
176
|
declare const LAZY_SYMBOL: unique symbol;
|
|
89
177
|
interface LazyMeta {
|
|
90
178
|
prefix?: HTTPPath;
|
|
@@ -98,27 +186,37 @@ interface Lazy<T> {
|
|
|
98
186
|
};
|
|
99
187
|
}
|
|
100
188
|
type Lazyable<T> = T | Lazy<T>;
|
|
189
|
+
/**
|
|
190
|
+
* @internal
|
|
191
|
+
*/
|
|
192
|
+
declare function lazyInternal<T>(loader: () => Promise<{
|
|
193
|
+
default: T;
|
|
194
|
+
}>, meta?: LazyMeta): Lazy<T>;
|
|
101
195
|
/**
|
|
102
196
|
* Creates a lazy-loaded item.
|
|
103
197
|
*
|
|
104
198
|
* @warning The `prefix` in `meta` only holds metadata and does not apply the prefix to the lazy router, use `os.prefix(...).lazyRoute(...)` instead.
|
|
105
199
|
*/
|
|
106
|
-
declare function lazy<T
|
|
200
|
+
declare function lazy<T extends Router<ContractRouter<{}>, any>>(prefix: HTTPPath, loader: () => Promise<{
|
|
107
201
|
default: T;
|
|
108
|
-
}
|
|
202
|
+
}>): EnhancedRouter<Lazy<T>, {}, {}, {}>;
|
|
109
203
|
declare function isLazy(item: unknown): item is Lazy<any>;
|
|
110
204
|
declare function getLazyMeta(lazied: Lazy<any>): LazyMeta;
|
|
111
205
|
declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
|
112
206
|
default: T extends Lazy<infer U> ? U : T;
|
|
113
207
|
}>;
|
|
114
208
|
|
|
115
|
-
type ProcedureClient<TClientContext extends ClientContext,
|
|
209
|
+
type ProcedureClient<TClientContext extends ClientContext, TSchemas extends Schemas, TErrorMap extends ErrorMap> = Client<TClientContext, InferProcedureClientInputs<TSchemas>, InferSchemaOutput<TSchemas['outputSchema']>, ErrorFromErrorMap<TErrorMap>>;
|
|
116
210
|
interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
117
211
|
context: TInitialContext;
|
|
118
|
-
input:
|
|
212
|
+
input: {
|
|
213
|
+
path: unknown;
|
|
214
|
+
query: unknown;
|
|
215
|
+
body: unknown;
|
|
216
|
+
};
|
|
119
217
|
errors: ORPCErrorConstructorMap<TErrorMap>;
|
|
120
218
|
path: readonly string[];
|
|
121
|
-
procedure: Procedure<Context, Context,
|
|
219
|
+
procedure: Procedure<Context, Context, Schemas, ErrorMap, TMeta>;
|
|
122
220
|
signal?: AbortSignal;
|
|
123
221
|
lastEventId: string | undefined;
|
|
124
222
|
}
|
|
@@ -138,55 +236,7 @@ type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema
|
|
|
138
236
|
*
|
|
139
237
|
* @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
|
|
140
238
|
*/
|
|
141
|
-
declare function createProcedureClient<TInitialContext extends Context,
|
|
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
|
-
*/
|
|
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> : {
|
|
150
|
-
[K in keyof T]: T[K] extends AnyContractRouter ? Lazyable<Router<T[K], TInitialContext>> : never;
|
|
151
|
-
};
|
|
152
|
-
type AnyRouter = Router<any, any>;
|
|
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
|
-
*/
|
|
160
|
-
type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any, any> ? UInitialContext : {
|
|
161
|
-
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
|
|
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
|
-
*/
|
|
169
|
-
type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any, infer UCurrentContext, any, any, any, any> ? UCurrentContext : {
|
|
170
|
-
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterCurrentContexts<U> : never;
|
|
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
|
-
*/
|
|
178
|
-
type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
|
|
179
|
-
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
|
|
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
|
-
*/
|
|
187
|
-
type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
|
|
188
|
-
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
|
|
189
|
-
};
|
|
239
|
+
declare function createProcedureClient<TInitialContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TSchemas, TErrorMap, TMeta>>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TSchemas['outputSchema'], TErrorMap, TMeta, TClientContext>>): ProcedureClient<TClientContext, TSchemas, TErrorMap>;
|
|
190
240
|
|
|
191
|
-
export { isProcedure as
|
|
192
|
-
export type { AnyMiddleware as A,
|
|
241
|
+
export { traverseContractProcedures as $, middlewareOutputFn as B, isProcedure as G, createProcedureClient as J, Procedure as P, getRouter as T, createAccessibleLazyRouter as V, enhanceRouter as W, resolveContractProcedures as a0, unlazyRouter as a2, mergeCurrentContext as m, createORPCErrorConstructorMap as n, LAZY_SYMBOL as o, lazyInternal as q, lazy as r, isLazy as s, getLazyMeta as t, unlazy as u };
|
|
242
|
+
export type { AnyMiddleware as A, Context as C, ProcedureHandlerOptions as D, EnhanceRouterOptions as E, ProcedureDef as F, ProcedureClientInterceptorOptions as H, InferRouterInitialContext as I, InferRouterInitialContexts as K, Lazy as L, Middleware as M, InferRouterCurrentContexts as N, ORPCErrorConstructorMap as O, InferRouterInputs as Q, Router as R, InferRouterOutputs as S, AccessibleLazyRouter as U, TraverseContractProceduresOptions as X, TraverseContractProcedureCallbackOptions as Y, ContractProcedureCallbackOptions as Z, LazyTraverseContractProceduresOptions as _, CreateProcedureClientOptions as a, UnlaziedRouter as a1, ProcedureClient as b, MergedInitialContext as c, MergedCurrentContext as d, ProcedureHandler as e, EnhancedRouter as f, MapInputMiddleware as g, AnyProcedure as h, Lazyable as i, AnyRouter as j, ORPCErrorConstructorMapItemOptions as k, ORPCErrorConstructorMapItem as l, LazyMeta as p, MiddlewareResult as v, MiddlewareNextFnOptions as w, MiddlewareNextFn as x, MiddlewareOutputFn as y, MiddlewareOptions as z };
|
|
@@ -234,14 +234,4 @@ function deserialize(data) {
|
|
|
234
234
|
return data;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
|
|
238
|
-
return `/${path.replace(/\/{2,}/g, "/").replace(/^\/|\/$/g, "")}`;
|
|
239
|
-
}
|
|
240
|
-
function getDynamicParams(path) {
|
|
241
|
-
return path ? standardizeHTTPPath(path).match(/\/\{[^}]+\}/g)?.map((v) => ({
|
|
242
|
-
raw: v,
|
|
243
|
-
name: v.match(/\{\+?([^}]+)\}/)[1]
|
|
244
|
-
})) : void 0;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export { standardizeHTTPPath as a, bracketNotationDeserialize as b, deserialize as d, getDynamicParams as g, jsonSerialize as j, serialize as s };
|
|
237
|
+
export { bracketNotationDeserialize as b, deserialize as d, jsonSerialize as j, serialize as s };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporary-name/server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.9.3-alpha.
|
|
4
|
+
"version": "1.9.3-alpha.6a70825f6d8c3dc99b87e4e5b778aea0fa007417",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://www.stainless.com/",
|
|
7
7
|
"repository": {
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"cookie": "^1.0.2",
|
|
74
74
|
"rou3": "^0.7.7",
|
|
75
75
|
"zod": "^4.1.12",
|
|
76
|
-
"@temporary-name/contract": "1.9.3-alpha.
|
|
77
|
-
"@temporary-name/
|
|
78
|
-
"@temporary-name/shared": "1.9.3-alpha.
|
|
79
|
-
"@temporary-name/standard-server": "1.9.3-alpha.
|
|
80
|
-
"@temporary-name/standard-server-
|
|
81
|
-
"@temporary-name/standard-server
|
|
82
|
-
"@temporary-name/
|
|
83
|
-
"@temporary-name/zod": "1.9.3-alpha.
|
|
84
|
-
"@temporary-name/
|
|
76
|
+
"@temporary-name/contract": "1.9.3-alpha.6a70825f6d8c3dc99b87e4e5b778aea0fa007417",
|
|
77
|
+
"@temporary-name/json-schema": "1.9.3-alpha.6a70825f6d8c3dc99b87e4e5b778aea0fa007417",
|
|
78
|
+
"@temporary-name/shared": "1.9.3-alpha.6a70825f6d8c3dc99b87e4e5b778aea0fa007417",
|
|
79
|
+
"@temporary-name/standard-server-aws-lambda": "1.9.3-alpha.6a70825f6d8c3dc99b87e4e5b778aea0fa007417",
|
|
80
|
+
"@temporary-name/standard-server-fetch": "1.9.3-alpha.6a70825f6d8c3dc99b87e4e5b778aea0fa007417",
|
|
81
|
+
"@temporary-name/standard-server": "1.9.3-alpha.6a70825f6d8c3dc99b87e4e5b778aea0fa007417",
|
|
82
|
+
"@temporary-name/interop": "1.9.3-alpha.6a70825f6d8c3dc99b87e4e5b778aea0fa007417",
|
|
83
|
+
"@temporary-name/zod": "1.9.3-alpha.6a70825f6d8c3dc99b87e4e5b778aea0fa007417",
|
|
84
|
+
"@temporary-name/standard-server-node": "1.9.3-alpha.6a70825f6d8c3dc99b87e4e5b778aea0fa007417"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/supertest": "^6.0.3",
|