@temporary-name/server 1.9.3-alpha.e098b3d1c5bffbad2fadfda89ba01f6452db46b5 → 1.9.3-alpha.ec3bfb9dce56198911349c322c970208b21b50db
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 +4 -5
- package/dist/adapters/aws-lambda/index.d.ts +4 -5
- package/dist/adapters/aws-lambda/index.mjs +4 -4
- package/dist/adapters/fetch/index.d.mts +8 -85
- package/dist/adapters/fetch/index.d.ts +8 -85
- package/dist/adapters/fetch/index.mjs +16 -155
- package/dist/adapters/node/index.d.mts +8 -62
- package/dist/adapters/node/index.d.ts +8 -62
- package/dist/adapters/node/index.mjs +14 -120
- package/dist/adapters/standard/index.d.mts +5 -6
- package/dist/adapters/standard/index.d.ts +5 -6
- package/dist/adapters/standard/index.mjs +4 -4
- package/dist/helpers/index.mjs +3 -29
- package/dist/index.d.mts +110 -199
- package/dist/index.d.ts +110 -199
- package/dist/index.mjs +140 -153
- package/dist/openapi/index.d.mts +11 -27
- package/dist/openapi/index.d.ts +11 -27
- package/dist/openapi/index.mjs +9 -79
- package/dist/shared/server.C1RJffw4.mjs +30 -0
- package/dist/shared/server.CQIFwyhc.mjs +40 -0
- package/dist/shared/server.CVhIyQ4x.d.mts +41 -0
- package/dist/shared/server.CYa9puL2.mjs +403 -0
- package/dist/shared/server.ChOv1yG3.mjs +319 -0
- package/dist/shared/server.Cj3_Lp61.d.mts +373 -0
- package/dist/shared/server.Cj3_Lp61.d.ts +373 -0
- package/dist/shared/server.Cza0RB3u.mjs +160 -0
- package/dist/shared/server.D8RAzJ_p.d.ts +41 -0
- package/dist/shared/server.YUvuxHty.mjs +48 -0
- package/package.json +10 -28
- package/dist/plugins/index.d.mts +0 -110
- package/dist/plugins/index.d.ts +0 -110
- package/dist/plugins/index.mjs +0 -175
- package/dist/shared/server.7aL9gcoU.d.mts +0 -23
- package/dist/shared/server.BL2R5jcp.d.mts +0 -228
- package/dist/shared/server.BL2R5jcp.d.ts +0 -228
- package/dist/shared/server.CVBLzkro.mjs +0 -255
- package/dist/shared/server.ClhVCxfg.mjs +0 -413
- package/dist/shared/server.D6Qs_UcF.d.mts +0 -55
- package/dist/shared/server.DFptr1Nz.d.ts +0 -23
- package/dist/shared/server.DpoO_ER_.d.ts +0 -55
- package/dist/shared/server.JtIZ8YG7.mjs +0 -237
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { HTTPMethods } from '@temporary-name/shared';
|
|
2
|
+
import * as z from '@temporary-name/zod';
|
|
3
|
+
|
|
4
|
+
function isStartWithMiddlewares(middlewares, compare) {
|
|
5
|
+
if (compare.length > middlewares.length) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
for (let i = 0; i < middlewares.length; i++) {
|
|
9
|
+
if (compare[i] === void 0) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
if (middlewares[i] !== compare[i]) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
function mergeMiddlewares(first, second, options) {
|
|
19
|
+
if (options.dedupeLeading && isStartWithMiddlewares(second, first)) {
|
|
20
|
+
return second;
|
|
21
|
+
}
|
|
22
|
+
return [...first, ...second];
|
|
23
|
+
}
|
|
24
|
+
function addMiddleware(middlewares, addition) {
|
|
25
|
+
return [...middlewares, addition];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
class Contract {
|
|
29
|
+
/**
|
|
30
|
+
* This property holds the defined options.
|
|
31
|
+
*/
|
|
32
|
+
"~orpc";
|
|
33
|
+
constructor(def) {
|
|
34
|
+
this["~orpc"] = def;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
class Procedure extends Contract {
|
|
38
|
+
}
|
|
39
|
+
function isProcedure(item) {
|
|
40
|
+
return item instanceof Procedure || // This is so we'll return true for Proxy-wrapped Procedures e.g. as returned by `callable`
|
|
41
|
+
(typeof item === "object" || typeof item === "function") && item !== null && "~orpc" in item && typeof item["~orpc"] === "object" && item["~orpc"] !== null && "route" in item["~orpc"] && "meta" in item["~orpc"] && "middlewares" in item["~orpc"] && "inputValidationIndex" in item["~orpc"] && "outputValidationIndex" in item["~orpc"] && "handler" in item["~orpc"];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
class ValidationError extends Error {
|
|
45
|
+
issues;
|
|
46
|
+
data;
|
|
47
|
+
constructor(options) {
|
|
48
|
+
super(options.message, options);
|
|
49
|
+
this.issues = options.issues;
|
|
50
|
+
this.data = options.data;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function mergeRoute(a, b) {
|
|
55
|
+
return { ...a, ...b };
|
|
56
|
+
}
|
|
57
|
+
function prefixRoute(route, prefix) {
|
|
58
|
+
if (!route.path) {
|
|
59
|
+
return route;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
...route,
|
|
63
|
+
path: `${prefix}${route.path}`
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function unshiftTagRoute(route, tags) {
|
|
67
|
+
return {
|
|
68
|
+
...route,
|
|
69
|
+
tags: [...tags, ...route.tags ?? []]
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function mergePrefix(a, b) {
|
|
73
|
+
return a ? `${a}${b}` : b;
|
|
74
|
+
}
|
|
75
|
+
function mergeTags(a, b) {
|
|
76
|
+
return a ? [...a, ...b] : b;
|
|
77
|
+
}
|
|
78
|
+
function enhanceRoute(route, options) {
|
|
79
|
+
let router = route;
|
|
80
|
+
if (options.prefix) {
|
|
81
|
+
router = prefixRoute(router, options.prefix);
|
|
82
|
+
}
|
|
83
|
+
if (options.tags?.length) {
|
|
84
|
+
router = unshiftTagRoute(router, options.tags);
|
|
85
|
+
}
|
|
86
|
+
return router;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function getRouter(router, path) {
|
|
90
|
+
let current = router;
|
|
91
|
+
for (let i = 0; i < path.length; i++) {
|
|
92
|
+
const segment = path[i];
|
|
93
|
+
if (!current) {
|
|
94
|
+
return void 0;
|
|
95
|
+
}
|
|
96
|
+
if (isProcedure(current)) {
|
|
97
|
+
return void 0;
|
|
98
|
+
}
|
|
99
|
+
if (!isLazy(current)) {
|
|
100
|
+
current = current[segment];
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
const lazied = current;
|
|
104
|
+
const rest = path.slice(i);
|
|
105
|
+
return lazyInternal(async () => {
|
|
106
|
+
const unwrapped = await unlazy(lazied);
|
|
107
|
+
const next = getRouter(unwrapped.default, rest);
|
|
108
|
+
return unlazy(next);
|
|
109
|
+
}, getLazyMeta(lazied));
|
|
110
|
+
}
|
|
111
|
+
return current;
|
|
112
|
+
}
|
|
113
|
+
function createAccessibleLazyRouter(lazied) {
|
|
114
|
+
const recursive = new Proxy(lazied, {
|
|
115
|
+
get(target, key) {
|
|
116
|
+
if (typeof key !== "string") {
|
|
117
|
+
return Reflect.get(target, key);
|
|
118
|
+
}
|
|
119
|
+
const next = getRouter(lazied, [key]);
|
|
120
|
+
return createAccessibleLazyRouter(next);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
return recursive;
|
|
124
|
+
}
|
|
125
|
+
function enhanceRouter(router, options) {
|
|
126
|
+
if (isLazy(router)) {
|
|
127
|
+
const laziedMeta = getLazyMeta(router);
|
|
128
|
+
const enhancedPrefix = laziedMeta?.prefix ? mergePrefix(options.prefix, laziedMeta?.prefix) : options.prefix;
|
|
129
|
+
const enhanced2 = lazyInternal(
|
|
130
|
+
async () => {
|
|
131
|
+
const { default: unlaziedRouter } = await unlazy(router);
|
|
132
|
+
const enhanced3 = enhanceRouter(unlaziedRouter, options);
|
|
133
|
+
return unlazy(enhanced3);
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
...laziedMeta,
|
|
137
|
+
prefix: enhancedPrefix
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
const accessible = createAccessibleLazyRouter(enhanced2);
|
|
141
|
+
return accessible;
|
|
142
|
+
}
|
|
143
|
+
if (isProcedure(router)) {
|
|
144
|
+
const newMiddlewares = mergeMiddlewares(options.middlewares, router["~orpc"].middlewares, {
|
|
145
|
+
dedupeLeading: options.dedupeLeadingMiddlewares
|
|
146
|
+
});
|
|
147
|
+
const newMiddlewareAdded = newMiddlewares.length - router["~orpc"].middlewares.length;
|
|
148
|
+
const enhanced2 = new Procedure({
|
|
149
|
+
...router["~orpc"],
|
|
150
|
+
route: enhanceRoute(router["~orpc"].route, options),
|
|
151
|
+
middlewares: newMiddlewares,
|
|
152
|
+
inputValidationIndex: router["~orpc"].inputValidationIndex + newMiddlewareAdded,
|
|
153
|
+
outputValidationIndex: router["~orpc"].outputValidationIndex + newMiddlewareAdded
|
|
154
|
+
});
|
|
155
|
+
return enhanced2;
|
|
156
|
+
}
|
|
157
|
+
const enhanced = {};
|
|
158
|
+
for (const key in router) {
|
|
159
|
+
enhanced[key] = enhanceRouter(router[key], options);
|
|
160
|
+
}
|
|
161
|
+
return enhanced;
|
|
162
|
+
}
|
|
163
|
+
function traverseContractProcedures(options, callback, lazyOptions = []) {
|
|
164
|
+
const currentRouter = options.router;
|
|
165
|
+
if (isLazy(currentRouter)) {
|
|
166
|
+
lazyOptions.push({
|
|
167
|
+
router: currentRouter,
|
|
168
|
+
path: options.path
|
|
169
|
+
});
|
|
170
|
+
} else if (currentRouter instanceof Contract) {
|
|
171
|
+
callback({
|
|
172
|
+
contract: currentRouter,
|
|
173
|
+
path: options.path
|
|
174
|
+
});
|
|
175
|
+
} else if (typeof currentRouter === "string") {
|
|
176
|
+
throw new Error("Unexpected: got string instead of router");
|
|
177
|
+
} else {
|
|
178
|
+
for (const key in currentRouter) {
|
|
179
|
+
traverseContractProcedures(
|
|
180
|
+
{
|
|
181
|
+
router: currentRouter[key],
|
|
182
|
+
path: [...options.path, key]
|
|
183
|
+
},
|
|
184
|
+
callback,
|
|
185
|
+
lazyOptions
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return lazyOptions;
|
|
190
|
+
}
|
|
191
|
+
async function resolveContractProcedures(options, callback) {
|
|
192
|
+
const pending = [options];
|
|
193
|
+
for (const options2 of pending) {
|
|
194
|
+
const lazyOptions = traverseContractProcedures(options2, callback);
|
|
195
|
+
for (const options3 of lazyOptions) {
|
|
196
|
+
const { default: router } = await unlazy(options3.router);
|
|
197
|
+
pending.push({
|
|
198
|
+
router,
|
|
199
|
+
path: options3.path
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
async function unlazyRouter(router) {
|
|
205
|
+
if (isProcedure(router)) {
|
|
206
|
+
return router;
|
|
207
|
+
}
|
|
208
|
+
const unlazied = {};
|
|
209
|
+
for (const key in router) {
|
|
210
|
+
const item = router[key];
|
|
211
|
+
const { default: unlaziedRouter } = await unlazy(item);
|
|
212
|
+
unlazied[key] = await unlazyRouter(unlaziedRouter);
|
|
213
|
+
}
|
|
214
|
+
return unlazied;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const LAZY_SYMBOL = Symbol("ORPC_LAZY_SYMBOL");
|
|
218
|
+
function lazyInternal(loader, meta = {}) {
|
|
219
|
+
return {
|
|
220
|
+
[LAZY_SYMBOL]: {
|
|
221
|
+
loader,
|
|
222
|
+
meta
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function lazy(prefix, loader) {
|
|
227
|
+
return enhanceRouter(lazyInternal(loader), {
|
|
228
|
+
middlewares: [],
|
|
229
|
+
dedupeLeadingMiddlewares: true,
|
|
230
|
+
prefix
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
function isLazy(item) {
|
|
234
|
+
return (typeof item === "object" || typeof item === "function") && item !== null && LAZY_SYMBOL in item;
|
|
235
|
+
}
|
|
236
|
+
function getLazyMeta(lazied) {
|
|
237
|
+
return lazied[LAZY_SYMBOL].meta;
|
|
238
|
+
}
|
|
239
|
+
function unlazy(lazied) {
|
|
240
|
+
return isLazy(lazied) ? lazied[LAZY_SYMBOL].loader() : Promise.resolve({ default: lazied });
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const endpointRegex = new RegExp(`^(${HTTPMethods.join("|")})`);
|
|
244
|
+
function standardizeHTTPPath(path) {
|
|
245
|
+
return `/${path.replace(/\/{2,}/g, "/").replace(/^\/|\/$/g, "")}`;
|
|
246
|
+
}
|
|
247
|
+
function getDynamicParams(path) {
|
|
248
|
+
return path ? standardizeHTTPPath(path).match(/\/\{[^}]+\}/g)?.map((v) => ({
|
|
249
|
+
raw: v,
|
|
250
|
+
name: v.match(/\{\+?([^}]+)\}/)[1]
|
|
251
|
+
})) : void 0;
|
|
252
|
+
}
|
|
253
|
+
function parseEndpointDefinition(stringsOrEndpoint, values) {
|
|
254
|
+
let method, path, pathSchema;
|
|
255
|
+
if (stringsOrEndpoint instanceof Array) {
|
|
256
|
+
let endpoint = stringsOrEndpoint[0];
|
|
257
|
+
if (endpoint === void 0 || !endpointRegex.test(endpoint)) {
|
|
258
|
+
throw new Error(".endpoint() must start with a valid HTTP endpoint string.");
|
|
259
|
+
}
|
|
260
|
+
const shape = {};
|
|
261
|
+
for (let i = 1; i < stringsOrEndpoint.length; i++) {
|
|
262
|
+
const str = stringsOrEndpoint[i];
|
|
263
|
+
const value = values[i - 1];
|
|
264
|
+
if (typeof value !== "object" || value instanceof z.core.$ZodType) {
|
|
265
|
+
throw new Error(
|
|
266
|
+
`Each template value for .endpoint must be an object with a single key, whose value is a ZodType.`
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
const valueEntries = Object.entries(value);
|
|
270
|
+
if (valueEntries.length !== 1) {
|
|
271
|
+
throw new Error(
|
|
272
|
+
`Each template value for .endpoint must be an object with a single key, whose value is a ZodType.`
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
const [key, schema] = valueEntries[0];
|
|
276
|
+
endpoint += `{${key}}${str}`;
|
|
277
|
+
if (key in schema) {
|
|
278
|
+
throw new Error(`Duplicate path parameter name "${key}" in endpoint.`);
|
|
279
|
+
}
|
|
280
|
+
shape[key] = schema;
|
|
281
|
+
}
|
|
282
|
+
[method, path] = endpoint.split(" ", 2);
|
|
283
|
+
pathSchema = z.object(shape);
|
|
284
|
+
} else if (values.length <= 1) {
|
|
285
|
+
const endpoint = stringsOrEndpoint;
|
|
286
|
+
const schema = values[0];
|
|
287
|
+
[method, path] = endpoint.split(" ", 2);
|
|
288
|
+
const pathParamNames = getDynamicParams(path)?.map((p) => p.name) ?? [];
|
|
289
|
+
let schemaKeys;
|
|
290
|
+
if (schema instanceof z.core.$ZodType) {
|
|
291
|
+
if (schema instanceof z.core.$ZodObject) {
|
|
292
|
+
schemaKeys = Object.keys(schema._zod.def.shape);
|
|
293
|
+
pathSchema = schema;
|
|
294
|
+
} else {
|
|
295
|
+
throw new Error(
|
|
296
|
+
`Path schema for endpoint "${endpoint}" must be a ZodObject schema (or object where each value is a ZodType).`
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
} else if (typeof schema === "object") {
|
|
300
|
+
schemaKeys = Object.keys(schema);
|
|
301
|
+
pathSchema = z.object(schema);
|
|
302
|
+
} else if (schema !== void 0) {
|
|
303
|
+
throw new Error(
|
|
304
|
+
`Path schema for endpoint "${endpoint}" must be a ZodObject schema (or object where each value is a ZodType).`
|
|
305
|
+
);
|
|
306
|
+
} else {
|
|
307
|
+
schemaKeys = [];
|
|
308
|
+
pathSchema = z.object({});
|
|
309
|
+
}
|
|
310
|
+
if (pathParamNames.length !== schemaKeys.length || !pathParamNames.every((name) => schemaKeys.includes(name))) {
|
|
311
|
+
throw new Error(`Path schema keys do not match dynamic parameters in endpoint "${endpoint}".`);
|
|
312
|
+
}
|
|
313
|
+
} else {
|
|
314
|
+
throw new Error("Invalid arguments for .endpoint() method.");
|
|
315
|
+
}
|
|
316
|
+
return { method, path, pathSchema };
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export { Contract as C, LAZY_SYMBOL as L, Procedure as P, ValidationError as V, mergeTags as a, mergeRoute as b, prefixRoute as c, addMiddleware as d, enhanceRouter as e, getLazyMeta as f, getDynamicParams as g, isLazy as h, isProcedure as i, getRouter as j, lazy as k, lazyInternal as l, mergePrefix as m, isStartWithMiddlewares as n, mergeMiddlewares as o, parseEndpointDefinition as p, createAccessibleLazyRouter as q, resolveContractProcedures as r, standardizeHTTPPath as s, traverseContractProcedures as t, unlazy as u, unlazyRouter as v, endpointRegex as w };
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { Promisable, HTTPMethod, HTTPPath, OutputStructure, OpenAPI, IsEqual, StandardLazyRequest } from '@temporary-name/shared';
|
|
2
|
+
import * as z from '@temporary-name/zod';
|
|
3
|
+
|
|
4
|
+
type Context = object;
|
|
5
|
+
type MergedInitialContext<TInitial extends Context, TAdditional extends Context, TCurrent extends Context> = TInitial & Omit<TAdditional, keyof TCurrent>;
|
|
6
|
+
type MergedCurrentContext<T extends Context, U extends Context> = Omit<T, keyof U> & U;
|
|
7
|
+
type BuildContextWithAuth<TContext extends Context, TAuthContext> = MergedCurrentContext<TContext, {
|
|
8
|
+
auth: TAuthContext | ('auth' extends keyof TContext ? TContext['auth'] : never);
|
|
9
|
+
}>;
|
|
10
|
+
declare function mergeCurrentContext<T extends Context, U extends Context>(context: T, other: U): MergedCurrentContext<T, U>;
|
|
11
|
+
|
|
12
|
+
type Meta = Record<string, any>;
|
|
13
|
+
declare function mergeMeta<T extends Meta>(meta1: T, meta2: T): T;
|
|
14
|
+
|
|
15
|
+
type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
|
|
16
|
+
output: TOutput;
|
|
17
|
+
context: TOutContext;
|
|
18
|
+
}>;
|
|
19
|
+
interface MiddlewareNextFn<TOutput> {
|
|
20
|
+
<U extends Context = {}>(options?: {
|
|
21
|
+
context?: U;
|
|
22
|
+
}): MiddlewareResult<U, TOutput>;
|
|
23
|
+
}
|
|
24
|
+
interface MiddlewareOutputFn<TOutput> {
|
|
25
|
+
(output: TOutput): MiddlewareResult<{}, TOutput>;
|
|
26
|
+
}
|
|
27
|
+
interface MiddlewareOptions<TInContext extends Context, TOutput, TMeta extends Meta> extends ProcedureHandlerOptions<TInContext, TMeta> {
|
|
28
|
+
next: MiddlewareNextFn<TOutput>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A function that represents a middleware.
|
|
32
|
+
*
|
|
33
|
+
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
34
|
+
*/
|
|
35
|
+
interface Middleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TMeta extends Meta> {
|
|
36
|
+
(options: MiddlewareOptions<TInContext, TOutput, TMeta>, input: TInput, output: MiddlewareOutputFn<TOutput>): Promisable<MiddlewareResult<TOutContext, TOutput>>;
|
|
37
|
+
}
|
|
38
|
+
type AnyMiddleware = Middleware<any, any, any, any, any>;
|
|
39
|
+
interface MapInputMiddleware<TInput, TMappedInput> {
|
|
40
|
+
(input: TInput): TMappedInput;
|
|
41
|
+
}
|
|
42
|
+
declare function middlewareOutputFn<TOutput>(output: TOutput): MiddlewareResult<{}, TOutput>;
|
|
43
|
+
|
|
44
|
+
interface Route {
|
|
45
|
+
/**
|
|
46
|
+
* The HTTP method of the procedure.
|
|
47
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
48
|
+
*
|
|
49
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
50
|
+
*/
|
|
51
|
+
method?: HTTPMethod;
|
|
52
|
+
/**
|
|
53
|
+
* The HTTP path of the procedure.
|
|
54
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
55
|
+
*
|
|
56
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
57
|
+
*/
|
|
58
|
+
path?: HTTPPath;
|
|
59
|
+
/**
|
|
60
|
+
* The operation ID of the endpoint.
|
|
61
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
62
|
+
*
|
|
63
|
+
* @default Concatenation of router segments
|
|
64
|
+
*/
|
|
65
|
+
operationId?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The summary of the procedure.
|
|
68
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
69
|
+
*
|
|
70
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
71
|
+
*/
|
|
72
|
+
summary?: string;
|
|
73
|
+
/**
|
|
74
|
+
* The description of the procedure.
|
|
75
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
76
|
+
*
|
|
77
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
78
|
+
*/
|
|
79
|
+
description?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Marks the procedure as deprecated.
|
|
82
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
83
|
+
*
|
|
84
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
85
|
+
*/
|
|
86
|
+
deprecated?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* The tags of the procedure.
|
|
89
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
90
|
+
*
|
|
91
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
92
|
+
*/
|
|
93
|
+
tags?: readonly string[];
|
|
94
|
+
/**
|
|
95
|
+
* The status code of the response when the procedure is successful.
|
|
96
|
+
* The status code must be in the 200-399 range.
|
|
97
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
98
|
+
*
|
|
99
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
100
|
+
* @default 200
|
|
101
|
+
*/
|
|
102
|
+
successStatus?: number;
|
|
103
|
+
/**
|
|
104
|
+
* The description of the response when the procedure is successful.
|
|
105
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
106
|
+
*
|
|
107
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
108
|
+
* @default 'OK'
|
|
109
|
+
*/
|
|
110
|
+
successDescription?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Determines how the response should be structured based on the output.
|
|
113
|
+
*
|
|
114
|
+
* @option 'compact'
|
|
115
|
+
* The output data is directly returned as the response body.
|
|
116
|
+
*
|
|
117
|
+
* @option 'detailed'
|
|
118
|
+
* Return an object with optional properties:
|
|
119
|
+
* - `status`: The response status (must be in 200-399 range) if not set fallback to `successStatus`.
|
|
120
|
+
* - `headers`: Custom headers to merge with the response headers (`Record<string, string | string[] | undefined>`)
|
|
121
|
+
* - `body`: The response body.
|
|
122
|
+
*
|
|
123
|
+
* Example:
|
|
124
|
+
* ```ts
|
|
125
|
+
* const output = {
|
|
126
|
+
* status: 201,
|
|
127
|
+
* headers: { 'x-custom-header': 'value' },
|
|
128
|
+
* body: { message: 'Hello, world!' },
|
|
129
|
+
* };
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
133
|
+
* @default 'compact'
|
|
134
|
+
*/
|
|
135
|
+
outputStructure?: OutputStructure;
|
|
136
|
+
/**
|
|
137
|
+
* Override entire auto-generated OpenAPI Operation Object Specification.
|
|
138
|
+
*
|
|
139
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata Operation Metadata Docs}
|
|
140
|
+
*/
|
|
141
|
+
spec?: OpenAPI.OperationObject | ((current: OpenAPI.OperationObject) => OpenAPI.OperationObject);
|
|
142
|
+
}
|
|
143
|
+
interface EnhanceRouteOptions {
|
|
144
|
+
prefix?: HTTPPath;
|
|
145
|
+
tags?: readonly string[];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
type Schema<TInput, TOutput> = z.core.$ZodType<TOutput, TInput>;
|
|
149
|
+
type AnySchema = z.core.$ZodType<any, any>;
|
|
150
|
+
type AnyShape = Readonly<Record<string, AnySchema>>;
|
|
151
|
+
type UnionToIntersection<T extends readonly object[]> = T extends readonly [infer First, ...infer Rest] ? First & (Rest extends readonly object[] ? UnionToIntersection<Rest> : {}) : {};
|
|
152
|
+
type WrapShape<U extends AnySchema | AnyShape> = U extends AnySchema ? U : U extends AnyShape ? z.KrustyObject<U, z.core.$strip> : never;
|
|
153
|
+
type SchemaIssue = z.core.$ZodIssue;
|
|
154
|
+
type InferSchemaInput<T extends AnySchema> = z.input<T>;
|
|
155
|
+
type InferSchemaOutput<T extends AnySchema> = z.output<T>;
|
|
156
|
+
type InferHandlerInputs<TSchemas extends Schemas> = {
|
|
157
|
+
path: InferSchemaOutput<TSchemas['pathSchema']>;
|
|
158
|
+
query: InferSchemaOutput<TSchemas['querySchema']>;
|
|
159
|
+
body: InferSchemaOutput<TSchemas['bodySchema']>;
|
|
160
|
+
};
|
|
161
|
+
type InferProcedureClientInputs<TSchemas extends Schemas> = {
|
|
162
|
+
path: InferSchemaInput<TSchemas['pathSchema']>;
|
|
163
|
+
query: InferSchemaInput<TSchemas['querySchema']>;
|
|
164
|
+
body: InferSchemaInput<TSchemas['bodySchema']>;
|
|
165
|
+
};
|
|
166
|
+
type TypeRest<TInput, TOutput> = [map: (input: TInput) => Promisable<TOutput>] | (IsEqual<TInput, TOutput> extends true ? [] : never);
|
|
167
|
+
interface Schemas {
|
|
168
|
+
pathSchema: AnySchema;
|
|
169
|
+
querySchema: AnySchema;
|
|
170
|
+
bodySchema: AnySchema;
|
|
171
|
+
outputSchema: AnySchema;
|
|
172
|
+
}
|
|
173
|
+
declare const initialSchemas: {
|
|
174
|
+
pathSchema: z.KrustyObject<{}, z.core.$strict, z.KrustyInternals<string>>;
|
|
175
|
+
querySchema: z.KrustyObject<{}, z.core.$strict, z.KrustyInternals<string>>;
|
|
176
|
+
bodySchema: z.KrustyObject<{}, z.core.$strict, z.KrustyInternals<string>>;
|
|
177
|
+
outputSchema: z.KrustyUnknown<z.KrustyInternals<string>>;
|
|
178
|
+
};
|
|
179
|
+
type InitialSchemas = typeof initialSchemas;
|
|
180
|
+
type MergedSchemas<T1 extends Schemas, T2 extends Partial<Schemas>> = {
|
|
181
|
+
pathSchema: T2['pathSchema'] extends AnySchema ? T2['pathSchema'] : T1['pathSchema'];
|
|
182
|
+
querySchema: T2['querySchema'] extends AnySchema ? T2['querySchema'] : T1['querySchema'];
|
|
183
|
+
bodySchema: T2['bodySchema'] extends AnySchema ? T2['bodySchema'] : T1['bodySchema'];
|
|
184
|
+
outputSchema: T2['outputSchema'] extends AnySchema ? T2['outputSchema'] : T1['outputSchema'];
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
type DefaultProcedureHandlerOptions = ProcedureHandlerOptions<Context, Meta>;
|
|
188
|
+
interface ProcedureHandlerOptions<TCurrentContext extends Context, TMeta extends Meta> {
|
|
189
|
+
context: TCurrentContext;
|
|
190
|
+
path: readonly string[];
|
|
191
|
+
procedure: Procedure<Context, Context, Schemas, TMeta>;
|
|
192
|
+
signal?: AbortSignal;
|
|
193
|
+
request?: StandardLazyRequest;
|
|
194
|
+
lastEventId: string | undefined;
|
|
195
|
+
}
|
|
196
|
+
interface ProcedureHandler<TCurrentContext extends Context, TInput extends {
|
|
197
|
+
path: any;
|
|
198
|
+
query: any;
|
|
199
|
+
body: any;
|
|
200
|
+
}, THandlerOutput, TMeta extends Meta> {
|
|
201
|
+
(input: TInput, opt: ProcedureHandlerOptions<TCurrentContext, TMeta>): Promisable<THandlerOutput>;
|
|
202
|
+
}
|
|
203
|
+
interface ContractDef<TSchemas extends Schemas, TMeta extends Meta> {
|
|
204
|
+
meta: TMeta;
|
|
205
|
+
route: Route;
|
|
206
|
+
schemas: TSchemas;
|
|
207
|
+
middlewares: readonly AnyMiddleware[];
|
|
208
|
+
authConfigs: TypedAuthConfig[];
|
|
209
|
+
inputValidationIndex: number;
|
|
210
|
+
outputValidationIndex: number;
|
|
211
|
+
}
|
|
212
|
+
type AnyContractDef = ContractDef<Schemas, Meta>;
|
|
213
|
+
declare class Contract<TDef extends AnyContractDef = AnyContractDef> {
|
|
214
|
+
/**
|
|
215
|
+
* This property holds the defined options.
|
|
216
|
+
*/
|
|
217
|
+
'~orpc': TDef;
|
|
218
|
+
constructor(def: TDef);
|
|
219
|
+
}
|
|
220
|
+
interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TMeta extends Meta> extends ContractDef<TSchemas, TMeta> {
|
|
221
|
+
handler: ProcedureHandler<TCurrentContext, any, any, any>;
|
|
222
|
+
'~~DO_NOT_USE_initialContextHack'?: (type: TInitialContext) => unknown;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* This class represents a procedure.
|
|
226
|
+
*
|
|
227
|
+
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
228
|
+
*/
|
|
229
|
+
declare class Procedure<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TMeta extends Meta> extends Contract<ProcedureDef<TInitialContext, TCurrentContext, TSchemas, TMeta>> {
|
|
230
|
+
}
|
|
231
|
+
type AnyProcedure = Procedure<any, any, Schemas, any>;
|
|
232
|
+
declare function isProcedure(item: unknown): item is AnyProcedure;
|
|
233
|
+
|
|
234
|
+
type ValidatedAuthContext = {};
|
|
235
|
+
interface BasicAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> {
|
|
236
|
+
tokenPrefix?: string;
|
|
237
|
+
validate: (username: string, password: string, options: ProcedureHandlerOptions<TCurrentContext, TMeta>) => Promisable<TAuthContext>;
|
|
238
|
+
}
|
|
239
|
+
interface TokenAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> {
|
|
240
|
+
tokenPrefix?: string;
|
|
241
|
+
validate: (token: string, options: ProcedureHandlerOptions<TCurrentContext, TMeta>) => Promisable<TAuthContext>;
|
|
242
|
+
}
|
|
243
|
+
interface NamedTokenAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends TokenAuthConfig<TAuthContext, TCurrentContext, TMeta> {
|
|
244
|
+
name: string;
|
|
245
|
+
}
|
|
246
|
+
type AuthType = 'header' | 'query' | 'cookie' | 'bearer' | 'basic' | 'none';
|
|
247
|
+
type AuthConfig<TAuthType extends AuthType, TAuthContext extends ValidatedAuthContext = ValidatedAuthContext, TCurrentContext extends Context = Context, TMeta extends Meta = Meta> = TAuthType extends 'basic' ? BasicAuthConfig<TAuthContext, TCurrentContext, TMeta> : TAuthType extends 'bearer' ? TokenAuthConfig<TAuthContext, TCurrentContext, TMeta> : TAuthType extends 'header' ? NamedTokenAuthConfig<TAuthContext, TCurrentContext, TMeta> : TAuthType extends 'query' ? NamedTokenAuthConfig<TAuthContext, TCurrentContext, TMeta> : TAuthType extends 'cookie' ? NamedTokenAuthConfig<TAuthContext, TCurrentContext, TMeta> : TAuthType extends 'none' ? {} : never;
|
|
248
|
+
type TypedAuthConfig<TAuthType extends AuthType = AuthType> = {
|
|
249
|
+
type: TAuthType;
|
|
250
|
+
} & AuthConfig<TAuthType, object>;
|
|
251
|
+
|
|
252
|
+
type ContractRouter = Contract | {
|
|
253
|
+
[k: string]: ContractRouter;
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* Represents a router, which defines a hierarchical structure of procedures.
|
|
257
|
+
*
|
|
258
|
+
* @info A procedure is a router too.
|
|
259
|
+
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#contract-router Contract Router Docs}
|
|
260
|
+
*/
|
|
261
|
+
type Router<TInitialContext extends Context> = Procedure<TInitialContext, any, any, any> | {
|
|
262
|
+
[k: string]: Lazyable<Router<TInitialContext>>;
|
|
263
|
+
};
|
|
264
|
+
type AnyRouter = Router<any>;
|
|
265
|
+
type InferRouterInitialContext<T extends AnyRouter> = T extends Router<infer UInitialContext> ? UInitialContext : never;
|
|
266
|
+
/**
|
|
267
|
+
* Infer all initial context of the router.
|
|
268
|
+
*
|
|
269
|
+
* @info A procedure is a router too.
|
|
270
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
|
271
|
+
*/
|
|
272
|
+
type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any> ? UInitialContext : {
|
|
273
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* Infer all current context of the router.
|
|
277
|
+
*
|
|
278
|
+
* @info A procedure is a router too.
|
|
279
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
|
280
|
+
*/
|
|
281
|
+
type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any, infer UCurrentContext, any, any> ? UCurrentContext : {
|
|
282
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterCurrentContexts<U> : never;
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* Infer all router inputs
|
|
286
|
+
*
|
|
287
|
+
* @info A procedure is a router too.
|
|
288
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
|
289
|
+
*/
|
|
290
|
+
type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer USchemas, any> ? InferProcedureClientInputs<USchemas> : {
|
|
291
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* Infer all router outputs
|
|
295
|
+
*
|
|
296
|
+
* @info A procedure is a router too.
|
|
297
|
+
* @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
|
|
298
|
+
*/
|
|
299
|
+
type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, infer USchemas, any> ? InferSchemaOutput<USchemas['outputSchema']> : {
|
|
300
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
declare function getRouter<T extends Lazyable<AnyRouter | undefined>>(router: T, path: readonly string[]): T extends Lazy<any> ? Lazy<AnyRouter | undefined> : Lazyable<AnyRouter | undefined>;
|
|
304
|
+
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> & {
|
|
305
|
+
[K in keyof T]: T[K] extends Lazyable<AnyRouter> ? AccessibleLazyRouter<T[K]> : never;
|
|
306
|
+
};
|
|
307
|
+
declare function createAccessibleLazyRouter<T extends Lazy<AnyRouter | undefined>>(lazied: T): AccessibleLazyRouter<T>;
|
|
308
|
+
type EnhancedRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context> = T extends Lazy<infer U extends AnyRouter> ? AccessibleLazyRouter<EnhancedRouter<U, TInitialContext, TCurrentContext>> : T extends Procedure<infer UInitialContext, infer UCurrentContext, infer USchemas, infer UMeta> ? Procedure<MergedInitialContext<TInitialContext, UInitialContext, TCurrentContext>, UCurrentContext, USchemas, UMeta> : {
|
|
309
|
+
[K in keyof T]: T[K] extends Lazyable<AnyRouter> ? EnhancedRouter<T[K], TInitialContext, TCurrentContext> : never;
|
|
310
|
+
};
|
|
311
|
+
interface EnhanceRouterOptions extends EnhanceRouteOptions {
|
|
312
|
+
middlewares: readonly AnyMiddleware[];
|
|
313
|
+
dedupeLeadingMiddlewares: boolean;
|
|
314
|
+
}
|
|
315
|
+
declare function enhanceRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context>(router: T, options: EnhanceRouterOptions): EnhancedRouter<T, TInitialContext, TCurrentContext>;
|
|
316
|
+
interface TraverseContractProceduresOptions {
|
|
317
|
+
router: ContractRouter | AnyRouter;
|
|
318
|
+
path: readonly string[];
|
|
319
|
+
}
|
|
320
|
+
interface TraverseContractProcedureCallbackOptions {
|
|
321
|
+
contract: Contract;
|
|
322
|
+
path: readonly string[];
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* @deprecated Use `TraverseContractProcedureCallbackOptions` instead.
|
|
326
|
+
*/
|
|
327
|
+
type ContractProcedureCallbackOptions = TraverseContractProcedureCallbackOptions;
|
|
328
|
+
interface LazyTraverseContractProceduresOptions {
|
|
329
|
+
router: Lazy<AnyRouter>;
|
|
330
|
+
path: readonly string[];
|
|
331
|
+
}
|
|
332
|
+
declare function traverseContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void, lazyOptions?: LazyTraverseContractProceduresOptions[]): LazyTraverseContractProceduresOptions[];
|
|
333
|
+
declare function resolveContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void): Promise<void>;
|
|
334
|
+
type UnlaziedRouter<T extends AnyRouter> = T extends AnyProcedure ? T : {
|
|
335
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? UnlaziedRouter<U> : never;
|
|
336
|
+
};
|
|
337
|
+
declare function unlazyRouter<T extends AnyRouter>(router: T): Promise<UnlaziedRouter<T>>;
|
|
338
|
+
|
|
339
|
+
declare const LAZY_SYMBOL: unique symbol;
|
|
340
|
+
interface LazyMeta {
|
|
341
|
+
prefix?: HTTPPath;
|
|
342
|
+
}
|
|
343
|
+
interface Lazy<T> {
|
|
344
|
+
[LAZY_SYMBOL]: {
|
|
345
|
+
loader: () => Promise<{
|
|
346
|
+
default: T;
|
|
347
|
+
}>;
|
|
348
|
+
meta: LazyMeta;
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
type Lazyable<T> = T | Lazy<T>;
|
|
352
|
+
/**
|
|
353
|
+
* @internal
|
|
354
|
+
*/
|
|
355
|
+
declare function lazyInternal<T>(loader: () => Promise<{
|
|
356
|
+
default: T;
|
|
357
|
+
}>, meta?: LazyMeta): Lazy<T>;
|
|
358
|
+
/**
|
|
359
|
+
* Creates a lazy-loaded item.
|
|
360
|
+
*
|
|
361
|
+
* @warning The `prefix` in `meta` only holds metadata and does not apply the prefix to the lazy router, use `os.prefix(...).lazyRoute(...)` instead.
|
|
362
|
+
*/
|
|
363
|
+
declare function lazy<T extends Router<any>>(prefix: HTTPPath, loader: () => Promise<{
|
|
364
|
+
default: T;
|
|
365
|
+
}>): EnhancedRouter<Lazy<T>, {}, {}>;
|
|
366
|
+
declare function isLazy(item: unknown): item is Lazy<any>;
|
|
367
|
+
declare function getLazyMeta(lazied: Lazy<any>): LazyMeta;
|
|
368
|
+
declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
|
369
|
+
default: T extends Lazy<infer U> ? U : T;
|
|
370
|
+
}>;
|
|
371
|
+
|
|
372
|
+
export { lazyInternal as D, lazy as F, isLazy as G, getLazyMeta as H, unlazy as J, mergeMeta as K, Procedure as P, middlewareOutputFn as X, isProcedure as a0, getRouter as a6, createAccessibleLazyRouter as a8, enhanceRouter as a9, traverseContractProcedures as ae, resolveContractProcedures as af, unlazyRouter as ah, initialSchemas as aj, Contract as b, mergeCurrentContext as x, LAZY_SYMBOL as y };
|
|
373
|
+
export type { ProcedureDef as $, AnyShape as A, BuildContextWithAuth as B, Context as C, EnhanceRouterOptions as E, InferProcedureClientInputs as I, Lazyable as L, Meta as M, MiddlewareResult as N, MiddlewareNextFn as O, MiddlewareOutputFn as Q, Route as R, Schemas as S, MiddlewareOptions as T, UnionToIntersection as U, ValidatedAuthContext as V, WrapShape as W, DefaultProcedureHandlerOptions as Y, ProcedureHandlerOptions as Z, AnyContractDef as _, InferSchemaOutput as a, ContractRouter as a1, InferRouterInitialContexts as a2, InferRouterCurrentContexts as a3, InferRouterInputs as a4, InferRouterOutputs as a5, AccessibleLazyRouter as a7, TraverseContractProceduresOptions as aa, TraverseContractProcedureCallbackOptions as ab, ContractProcedureCallbackOptions as ac, LazyTraverseContractProceduresOptions as ad, UnlaziedRouter as ag, TypeRest as ai, InitialSchemas as ak, MergedSchemas as c, AnySchema as d, Middleware as e, MergedCurrentContext as f, MergedInitialContext as g, AuthType as h, AuthConfig as i, ProcedureHandler as j, InferHandlerInputs as k, InferSchemaInput as l, Router as m, EnhancedRouter as n, MapInputMiddleware as o, ContractDef as p, SchemaIssue as q, Schema as r, AnyMiddleware as s, Lazy as t, AnyProcedure as u, AnyRouter as v, InferRouterInitialContext as w, LazyMeta as z };
|