@orpc/server 0.0.0-next.9b3a030 → 0.0.0-next.a2e4a58
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/{chunk-DNG2IB3R.js → chunk-GK2Z6B6W.js} +38 -35
- package/dist/{chunk-V3I7RIRY.js → chunk-SXUFCJBY.js} +5 -6
- package/dist/fetch.js +4 -4
- package/dist/hono.js +4 -4
- package/dist/index.js +672 -174
- package/dist/next.js +4 -4
- package/dist/node.js +6 -6
- package/dist/src/adapters/fetch/orpc-handler.d.ts +3 -3
- package/dist/src/adapters/node/orpc-handler.d.ts +3 -3
- package/dist/src/builder-with-errors-middlewares.d.ts +51 -0
- package/dist/src/builder-with-errors.d.ts +52 -0
- package/dist/src/builder-with-middlewares.d.ts +48 -0
- package/dist/src/builder.d.ts +36 -23
- package/dist/src/config.d.ts +6 -0
- package/dist/src/context.d.ts +11 -0
- package/dist/src/error.d.ts +1 -1
- package/dist/src/hidden.d.ts +2 -2
- package/dist/src/implementer-chainable.d.ts +7 -3
- package/dist/src/index.d.ts +4 -2
- package/dist/src/lazy-decorated.d.ts +3 -6
- package/dist/src/middleware-decorated.d.ts +2 -1
- package/dist/src/middleware.d.ts +1 -0
- package/dist/src/procedure-builder-with-input.d.ts +34 -0
- package/dist/src/procedure-builder-with-output.d.ts +33 -0
- package/dist/src/procedure-builder.d.ts +21 -18
- package/dist/src/procedure-client.d.ts +7 -19
- package/dist/src/procedure-decorated.d.ts +21 -10
- package/dist/src/procedure-implementer.d.ts +7 -4
- package/dist/src/procedure-utils.d.ts +17 -0
- package/dist/src/procedure.d.ts +4 -2
- package/dist/src/router-builder.d.ts +19 -15
- package/dist/src/router-client.d.ts +7 -6
- package/dist/src/router-implementer.d.ts +7 -6
- package/dist/src/router.d.ts +3 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
@@ -9,15 +9,24 @@ import {
|
|
9
9
|
isProcedure,
|
10
10
|
lazy,
|
11
11
|
mergeContext,
|
12
|
+
middlewareOutputFn,
|
12
13
|
unlazy
|
13
|
-
} from "./chunk-
|
14
|
+
} from "./chunk-GK2Z6B6W.js";
|
14
15
|
|
15
16
|
// src/builder.ts
|
17
|
+
import { ContractProcedure as ContractProcedure4 } from "@orpc/contract";
|
18
|
+
|
19
|
+
// src/builder-with-errors.ts
|
20
|
+
import { ContractProcedure as ContractProcedure2 } from "@orpc/contract";
|
21
|
+
|
22
|
+
// src/builder-with-errors-middlewares.ts
|
16
23
|
import { ContractProcedure } from "@orpc/contract";
|
17
24
|
|
18
|
-
// src/
|
19
|
-
import {
|
20
|
-
|
25
|
+
// src/procedure-builder.ts
|
26
|
+
import { ContractProcedureBuilder, DecoratedContractProcedure as DecoratedContractProcedure4 } from "@orpc/contract";
|
27
|
+
|
28
|
+
// src/procedure-builder-with-input.ts
|
29
|
+
import { ContractProcedureBuilderWithInput, DecoratedContractProcedure as DecoratedContractProcedure2 } from "@orpc/contract";
|
21
30
|
|
22
31
|
// src/middleware-decorated.ts
|
23
32
|
function decorateMiddleware(middleware) {
|
@@ -44,58 +53,81 @@ function decorateMiddleware(middleware) {
|
|
44
53
|
|
45
54
|
// src/procedure-decorated.ts
|
46
55
|
import { DecoratedContractProcedure } from "@orpc/contract";
|
47
|
-
|
48
|
-
|
49
|
-
procedure
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
56
|
+
var DecoratedProcedure = class _DecoratedProcedure extends Procedure {
|
57
|
+
static decorate(procedure) {
|
58
|
+
if (procedure instanceof _DecoratedProcedure) {
|
59
|
+
return procedure;
|
60
|
+
}
|
61
|
+
return new _DecoratedProcedure(procedure["~orpc"]);
|
62
|
+
}
|
63
|
+
prefix(prefix) {
|
64
|
+
return new _DecoratedProcedure({
|
65
|
+
...this["~orpc"],
|
66
|
+
contract: DecoratedContractProcedure.decorate(this["~orpc"].contract).prefix(prefix)
|
67
|
+
});
|
68
|
+
}
|
69
|
+
route(route) {
|
70
|
+
return new _DecoratedProcedure({
|
71
|
+
...this["~orpc"],
|
72
|
+
contract: DecoratedContractProcedure.decorate(this["~orpc"].contract).route(route)
|
73
|
+
});
|
74
|
+
}
|
75
|
+
errors(errors) {
|
76
|
+
return new _DecoratedProcedure({
|
77
|
+
...this["~orpc"],
|
78
|
+
contract: DecoratedContractProcedure.decorate(this["~orpc"].contract).errors(errors)
|
79
|
+
});
|
80
|
+
}
|
81
|
+
use(middleware, mapInput) {
|
68
82
|
const middleware_ = mapInput ? decorateMiddleware(middleware).mapInput(mapInput) : middleware;
|
69
|
-
return
|
70
|
-
...
|
71
|
-
middlewares: [...
|
72
|
-
})
|
73
|
-
}
|
74
|
-
|
75
|
-
return
|
76
|
-
...
|
77
|
-
contract: DecoratedContractProcedure.decorate(
|
78
|
-
})
|
79
|
-
}
|
80
|
-
|
81
|
-
|
83
|
+
return new _DecoratedProcedure({
|
84
|
+
...this["~orpc"],
|
85
|
+
middlewares: [...this["~orpc"].middlewares, middleware_]
|
86
|
+
});
|
87
|
+
}
|
88
|
+
unshiftTag(...tags) {
|
89
|
+
return new _DecoratedProcedure({
|
90
|
+
...this["~orpc"],
|
91
|
+
contract: DecoratedContractProcedure.decorate(this["~orpc"].contract).unshiftTag(...tags)
|
92
|
+
});
|
93
|
+
}
|
94
|
+
unshiftMiddleware(...middlewares) {
|
95
|
+
const castedMiddlewares = middlewares;
|
96
|
+
if (this["~orpc"].middlewares.length) {
|
82
97
|
let min = 0;
|
83
|
-
for (let i = 0; i <
|
84
|
-
const index =
|
98
|
+
for (let i = 0; i < this["~orpc"].middlewares.length; i++) {
|
99
|
+
const index = castedMiddlewares.indexOf(this["~orpc"].middlewares[i], min);
|
85
100
|
if (index === -1) {
|
86
|
-
|
101
|
+
castedMiddlewares.push(...this["~orpc"].middlewares.slice(i));
|
87
102
|
break;
|
88
103
|
}
|
89
104
|
min = index + 1;
|
90
105
|
}
|
91
106
|
}
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
}
|
107
|
+
const numNewMiddlewares = castedMiddlewares.length - this["~orpc"].middlewares.length;
|
108
|
+
return new _DecoratedProcedure({
|
109
|
+
...this["~orpc"],
|
110
|
+
inputValidationIndex: this["~orpc"].inputValidationIndex + numNewMiddlewares,
|
111
|
+
outputValidationIndex: this["~orpc"].outputValidationIndex + numNewMiddlewares,
|
112
|
+
middlewares: castedMiddlewares
|
113
|
+
});
|
114
|
+
}
|
115
|
+
/**
|
116
|
+
* Make this procedure callable (works like a function while still being a procedure).
|
117
|
+
*/
|
118
|
+
callable(...rest) {
|
119
|
+
return Object.assign(createProcedureClient(this, ...rest), {
|
120
|
+
"~type": "Procedure",
|
121
|
+
"~orpc": this["~orpc"]
|
122
|
+
});
|
123
|
+
}
|
124
|
+
/**
|
125
|
+
* Make this procedure compatible with server action (the same as .callable, but the type is compatible with server action).
|
126
|
+
*/
|
127
|
+
actionable(...rest) {
|
128
|
+
return this.callable(...rest);
|
129
|
+
}
|
130
|
+
};
|
99
131
|
|
100
132
|
// src/procedure-implementer.ts
|
101
133
|
var ProcedureImplementer = class _ProcedureImplementer {
|
@@ -108,15 +140,143 @@ var ProcedureImplementer = class _ProcedureImplementer {
|
|
108
140
|
const mappedMiddleware = mapInput ? decorateMiddleware(middleware).mapInput(mapInput) : middleware;
|
109
141
|
return new _ProcedureImplementer({
|
110
142
|
...this["~orpc"],
|
111
|
-
middlewares: [...this["~orpc"].middlewares
|
143
|
+
middlewares: [...this["~orpc"].middlewares, mappedMiddleware]
|
112
144
|
});
|
113
145
|
}
|
114
146
|
handler(handler) {
|
115
|
-
return
|
116
|
-
|
117
|
-
contract: this["~orpc"].contract,
|
147
|
+
return new DecoratedProcedure({
|
148
|
+
...this["~orpc"],
|
118
149
|
handler
|
119
|
-
})
|
150
|
+
});
|
151
|
+
}
|
152
|
+
};
|
153
|
+
|
154
|
+
// src/procedure-builder-with-input.ts
|
155
|
+
var ProcedureBuilderWithInput = class _ProcedureBuilderWithInput {
|
156
|
+
"~type" = "ProcedureBuilderWithInput";
|
157
|
+
"~orpc";
|
158
|
+
constructor(def) {
|
159
|
+
this["~orpc"] = def;
|
160
|
+
}
|
161
|
+
errors(errors) {
|
162
|
+
return new _ProcedureBuilderWithInput({
|
163
|
+
...this["~orpc"],
|
164
|
+
contract: DecoratedContractProcedure2.decorate(this["~orpc"].contract).errors(errors)
|
165
|
+
});
|
166
|
+
}
|
167
|
+
route(route) {
|
168
|
+
return new _ProcedureBuilderWithInput({
|
169
|
+
...this["~orpc"],
|
170
|
+
contract: DecoratedContractProcedure2.decorate(this["~orpc"].contract).route(route)
|
171
|
+
});
|
172
|
+
}
|
173
|
+
use(middleware, mapInput) {
|
174
|
+
const maybeWithMapInput = mapInput ? decorateMiddleware(middleware).mapInput(mapInput) : middleware;
|
175
|
+
return new _ProcedureBuilderWithInput({
|
176
|
+
...this["~orpc"],
|
177
|
+
outputValidationIndex: this["~orpc"].outputValidationIndex + 1,
|
178
|
+
middlewares: [...this["~orpc"].middlewares, maybeWithMapInput]
|
179
|
+
});
|
180
|
+
}
|
181
|
+
output(schema, example) {
|
182
|
+
return new ProcedureImplementer({
|
183
|
+
...this["~orpc"],
|
184
|
+
contract: new ContractProcedureBuilderWithInput(this["~orpc"].contract["~orpc"]).output(schema, example)
|
185
|
+
});
|
186
|
+
}
|
187
|
+
handler(handler) {
|
188
|
+
return new DecoratedProcedure({
|
189
|
+
...this["~orpc"],
|
190
|
+
handler
|
191
|
+
});
|
192
|
+
}
|
193
|
+
};
|
194
|
+
|
195
|
+
// src/procedure-builder-with-output.ts
|
196
|
+
import { ContractProcedureBuilderWithOutput, DecoratedContractProcedure as DecoratedContractProcedure3 } from "@orpc/contract";
|
197
|
+
var ProcedureBuilderWithOutput = class _ProcedureBuilderWithOutput {
|
198
|
+
"~type" = "ProcedureBuilderWithOutput";
|
199
|
+
"~orpc";
|
200
|
+
constructor(def) {
|
201
|
+
this["~orpc"] = def;
|
202
|
+
}
|
203
|
+
errors(errors) {
|
204
|
+
return new _ProcedureBuilderWithOutput({
|
205
|
+
...this["~orpc"],
|
206
|
+
contract: DecoratedContractProcedure3.decorate(this["~orpc"].contract).errors(errors)
|
207
|
+
});
|
208
|
+
}
|
209
|
+
route(route) {
|
210
|
+
return new _ProcedureBuilderWithOutput({
|
211
|
+
...this["~orpc"],
|
212
|
+
contract: DecoratedContractProcedure3.decorate(this["~orpc"].contract).route(route)
|
213
|
+
});
|
214
|
+
}
|
215
|
+
use(middleware) {
|
216
|
+
return new _ProcedureBuilderWithOutput({
|
217
|
+
...this["~orpc"],
|
218
|
+
inputValidationIndex: this["~orpc"].inputValidationIndex + 1,
|
219
|
+
middlewares: [...this["~orpc"].middlewares, middleware]
|
220
|
+
});
|
221
|
+
}
|
222
|
+
input(schema, example) {
|
223
|
+
return new ProcedureImplementer({
|
224
|
+
...this["~orpc"],
|
225
|
+
contract: new ContractProcedureBuilderWithOutput(this["~orpc"].contract["~orpc"]).input(schema, example)
|
226
|
+
});
|
227
|
+
}
|
228
|
+
handler(handler) {
|
229
|
+
return new DecoratedProcedure({
|
230
|
+
...this["~orpc"],
|
231
|
+
handler
|
232
|
+
});
|
233
|
+
}
|
234
|
+
};
|
235
|
+
|
236
|
+
// src/procedure-builder.ts
|
237
|
+
var ProcedureBuilder = class _ProcedureBuilder {
|
238
|
+
"~type" = "ProcedureBuilder";
|
239
|
+
"~orpc";
|
240
|
+
constructor(def) {
|
241
|
+
this["~orpc"] = def;
|
242
|
+
}
|
243
|
+
errors(errors) {
|
244
|
+
return new _ProcedureBuilder({
|
245
|
+
...this["~orpc"],
|
246
|
+
contract: DecoratedContractProcedure4.decorate(this["~orpc"].contract).errors(errors)
|
247
|
+
});
|
248
|
+
}
|
249
|
+
route(route) {
|
250
|
+
return new _ProcedureBuilder({
|
251
|
+
...this["~orpc"],
|
252
|
+
contract: DecoratedContractProcedure4.decorate(this["~orpc"].contract).route(route)
|
253
|
+
});
|
254
|
+
}
|
255
|
+
use(middleware) {
|
256
|
+
return new _ProcedureBuilder({
|
257
|
+
...this["~orpc"],
|
258
|
+
inputValidationIndex: this["~orpc"].inputValidationIndex + 1,
|
259
|
+
outputValidationIndex: this["~orpc"].outputValidationIndex + 1,
|
260
|
+
middlewares: [...this["~orpc"].middlewares, middleware]
|
261
|
+
});
|
262
|
+
}
|
263
|
+
input(schema, example) {
|
264
|
+
return new ProcedureBuilderWithInput({
|
265
|
+
...this["~orpc"],
|
266
|
+
contract: new ContractProcedureBuilder(this["~orpc"].contract["~orpc"]).input(schema, example)
|
267
|
+
});
|
268
|
+
}
|
269
|
+
output(schema, example) {
|
270
|
+
return new ProcedureBuilderWithOutput({
|
271
|
+
...this["~orpc"],
|
272
|
+
contract: new ContractProcedureBuilder(this["~orpc"].contract["~orpc"]).output(schema, example)
|
273
|
+
});
|
274
|
+
}
|
275
|
+
handler(handler) {
|
276
|
+
return new DecoratedProcedure({
|
277
|
+
...this["~orpc"],
|
278
|
+
handler
|
279
|
+
});
|
120
280
|
}
|
121
281
|
};
|
122
282
|
|
@@ -154,31 +314,10 @@ function getLazyRouterPrefix(obj) {
|
|
154
314
|
return obj[LAZY_ROUTER_PREFIX_SYMBOL];
|
155
315
|
}
|
156
316
|
|
157
|
-
// src/lazy-utils.ts
|
158
|
-
function createLazyProcedureFormAnyLazy(lazied) {
|
159
|
-
const lazyProcedure = lazy(async () => {
|
160
|
-
const { default: maybeProcedure } = await unlazy(flatLazy(lazied));
|
161
|
-
if (!isProcedure(maybeProcedure)) {
|
162
|
-
throw new Error(`
|
163
|
-
Expected a lazy<procedure> but got lazy<unknown>.
|
164
|
-
This should be caught by TypeScript compilation.
|
165
|
-
Please report this issue if this makes you feel uncomfortable.
|
166
|
-
`);
|
167
|
-
}
|
168
|
-
return { default: maybeProcedure };
|
169
|
-
});
|
170
|
-
return lazyProcedure;
|
171
|
-
}
|
172
|
-
|
173
317
|
// src/lazy-decorated.ts
|
174
318
|
function decorateLazy(lazied) {
|
175
319
|
const flattenLazy = flatLazy(lazied);
|
176
|
-
const
|
177
|
-
procedure: createLazyProcedureFormAnyLazy(flattenLazy),
|
178
|
-
context: void 0
|
179
|
-
});
|
180
|
-
Object.assign(procedureProcedureClient, flattenLazy);
|
181
|
-
const recursive = new Proxy(procedureProcedureClient, {
|
320
|
+
const recursive = new Proxy(flattenLazy, {
|
182
321
|
get(target, key) {
|
183
322
|
if (typeof key !== "string") {
|
184
323
|
return Reflect.get(target, key);
|
@@ -215,10 +354,19 @@ var RouterBuilder = class _RouterBuilder {
|
|
215
354
|
tags: [...this["~orpc"].tags ?? [], ...tags]
|
216
355
|
});
|
217
356
|
}
|
357
|
+
errors(errors) {
|
358
|
+
return new _RouterBuilder({
|
359
|
+
...this["~orpc"],
|
360
|
+
errorMap: {
|
361
|
+
...this["~orpc"].errorMap,
|
362
|
+
...errors
|
363
|
+
}
|
364
|
+
});
|
365
|
+
}
|
218
366
|
use(middleware) {
|
219
367
|
return new _RouterBuilder({
|
220
368
|
...this["~orpc"],
|
221
|
-
middlewares: [...this["~orpc"].middlewares
|
369
|
+
middlewares: [...this["~orpc"].middlewares, middleware]
|
222
370
|
});
|
223
371
|
}
|
224
372
|
router(router) {
|
@@ -245,7 +393,7 @@ function adapt(item, options) {
|
|
245
393
|
return adaptedLazy;
|
246
394
|
}
|
247
395
|
if (isProcedure(item)) {
|
248
|
-
let decorated =
|
396
|
+
let decorated = DecoratedProcedure.decorate(item);
|
249
397
|
if (options.tags?.length) {
|
250
398
|
decorated = decorated.unshiftTag(...options.tags);
|
251
399
|
}
|
@@ -255,6 +403,9 @@ function adapt(item, options) {
|
|
255
403
|
if (options.middlewares?.length) {
|
256
404
|
decorated = decorated.unshiftMiddleware(...options.middlewares);
|
257
405
|
}
|
406
|
+
if (Object.keys(options.errorMap).length) {
|
407
|
+
decorated = decorated.errors(options.errorMap);
|
408
|
+
}
|
258
409
|
return decorated;
|
259
410
|
}
|
260
411
|
const adapted = {};
|
@@ -264,6 +415,246 @@ function adapt(item, options) {
|
|
264
415
|
return adapted;
|
265
416
|
}
|
266
417
|
|
418
|
+
// src/builder-with-errors-middlewares.ts
|
419
|
+
var BuilderWithErrorsMiddlewares = class _BuilderWithErrorsMiddlewares {
|
420
|
+
"~type" = "BuilderWithErrorsMiddlewares";
|
421
|
+
"~orpc";
|
422
|
+
constructor(def) {
|
423
|
+
this["~orpc"] = def;
|
424
|
+
}
|
425
|
+
errors(errors) {
|
426
|
+
return new _BuilderWithErrorsMiddlewares({
|
427
|
+
...this["~orpc"],
|
428
|
+
errorMap: {
|
429
|
+
...this["~orpc"].errorMap,
|
430
|
+
...errors
|
431
|
+
}
|
432
|
+
});
|
433
|
+
}
|
434
|
+
use(middleware) {
|
435
|
+
return new _BuilderWithErrorsMiddlewares({
|
436
|
+
...this["~orpc"],
|
437
|
+
inputValidationIndex: this["~orpc"].inputValidationIndex + 1,
|
438
|
+
outputValidationIndex: this["~orpc"].outputValidationIndex + 1,
|
439
|
+
middlewares: [...this["~orpc"].middlewares, middleware]
|
440
|
+
// FIXME: I believe we can remove `as any` here
|
441
|
+
});
|
442
|
+
}
|
443
|
+
route(route) {
|
444
|
+
return new ProcedureBuilder({
|
445
|
+
...this["~orpc"],
|
446
|
+
contract: new ContractProcedure({
|
447
|
+
route: {
|
448
|
+
...this["~orpc"].config.initialRoute,
|
449
|
+
...route
|
450
|
+
},
|
451
|
+
InputSchema: void 0,
|
452
|
+
OutputSchema: void 0,
|
453
|
+
errorMap: this["~orpc"].errorMap
|
454
|
+
})
|
455
|
+
});
|
456
|
+
}
|
457
|
+
input(schema, example) {
|
458
|
+
return new ProcedureBuilderWithInput({
|
459
|
+
...this["~orpc"],
|
460
|
+
contract: new ContractProcedure({
|
461
|
+
route: this["~orpc"].config.initialRoute,
|
462
|
+
OutputSchema: void 0,
|
463
|
+
InputSchema: schema,
|
464
|
+
inputExample: example,
|
465
|
+
errorMap: this["~orpc"].errorMap
|
466
|
+
})
|
467
|
+
});
|
468
|
+
}
|
469
|
+
output(schema, example) {
|
470
|
+
return new ProcedureBuilderWithOutput({
|
471
|
+
...this["~orpc"],
|
472
|
+
contract: new ContractProcedure({
|
473
|
+
route: this["~orpc"].config.initialRoute,
|
474
|
+
InputSchema: void 0,
|
475
|
+
OutputSchema: schema,
|
476
|
+
outputExample: example,
|
477
|
+
errorMap: this["~orpc"].errorMap
|
478
|
+
})
|
479
|
+
});
|
480
|
+
}
|
481
|
+
handler(handler) {
|
482
|
+
return new DecoratedProcedure({
|
483
|
+
...this["~orpc"],
|
484
|
+
contract: new ContractProcedure({
|
485
|
+
route: this["~orpc"].config.initialRoute,
|
486
|
+
InputSchema: void 0,
|
487
|
+
OutputSchema: void 0,
|
488
|
+
errorMap: this["~orpc"].errorMap
|
489
|
+
}),
|
490
|
+
handler
|
491
|
+
});
|
492
|
+
}
|
493
|
+
prefix(prefix) {
|
494
|
+
return new RouterBuilder({
|
495
|
+
...this["~orpc"],
|
496
|
+
prefix
|
497
|
+
});
|
498
|
+
}
|
499
|
+
tag(...tags) {
|
500
|
+
return new RouterBuilder({
|
501
|
+
...this["~orpc"],
|
502
|
+
tags
|
503
|
+
});
|
504
|
+
}
|
505
|
+
router(router) {
|
506
|
+
return new RouterBuilder(this["~orpc"]).router(router);
|
507
|
+
}
|
508
|
+
lazy(loader) {
|
509
|
+
return new RouterBuilder(this["~orpc"]).lazy(loader);
|
510
|
+
}
|
511
|
+
};
|
512
|
+
|
513
|
+
// src/config.ts
|
514
|
+
var DEFAULT_CONFIG = {
|
515
|
+
initialInputValidationIndex: 0,
|
516
|
+
initialOutputValidationIndex: 0
|
517
|
+
};
|
518
|
+
function fallbackConfig(key, value) {
|
519
|
+
if (value === void 0) {
|
520
|
+
return DEFAULT_CONFIG[key];
|
521
|
+
}
|
522
|
+
return value;
|
523
|
+
}
|
524
|
+
|
525
|
+
// src/builder-with-errors.ts
|
526
|
+
var BuilderWithErrors = class _BuilderWithErrors {
|
527
|
+
"~type" = "BuilderWithErrors";
|
528
|
+
"~orpc";
|
529
|
+
constructor(def) {
|
530
|
+
this["~orpc"] = def;
|
531
|
+
}
|
532
|
+
config(config) {
|
533
|
+
return new _BuilderWithErrors({
|
534
|
+
...this["~orpc"],
|
535
|
+
config: {
|
536
|
+
...this["~orpc"].config,
|
537
|
+
...config
|
538
|
+
}
|
539
|
+
});
|
540
|
+
}
|
541
|
+
context() {
|
542
|
+
return this;
|
543
|
+
}
|
544
|
+
errors(errors) {
|
545
|
+
return new _BuilderWithErrors({
|
546
|
+
...this["~orpc"],
|
547
|
+
errorMap: {
|
548
|
+
...this["~orpc"].errorMap,
|
549
|
+
...errors
|
550
|
+
}
|
551
|
+
});
|
552
|
+
}
|
553
|
+
middleware(middleware) {
|
554
|
+
return decorateMiddleware(middleware);
|
555
|
+
}
|
556
|
+
use(middleware) {
|
557
|
+
return new BuilderWithErrorsMiddlewares({
|
558
|
+
...this["~orpc"],
|
559
|
+
inputValidationIndex: fallbackConfig("initialInputValidationIndex", this["~orpc"].config.initialInputValidationIndex) + 1,
|
560
|
+
outputValidationIndex: fallbackConfig("initialOutputValidationIndex", this["~orpc"].config.initialOutputValidationIndex) + 1,
|
561
|
+
middlewares: [middleware]
|
562
|
+
// FIXME: I believe we can remove `as any` here
|
563
|
+
});
|
564
|
+
}
|
565
|
+
route(route) {
|
566
|
+
return new ProcedureBuilder({
|
567
|
+
middlewares: [],
|
568
|
+
inputValidationIndex: fallbackConfig("initialInputValidationIndex", this["~orpc"].config.initialInputValidationIndex),
|
569
|
+
outputValidationIndex: fallbackConfig("initialOutputValidationIndex", this["~orpc"].config.initialOutputValidationIndex),
|
570
|
+
contract: new ContractProcedure2({
|
571
|
+
route: {
|
572
|
+
...this["~orpc"].config.initialRoute,
|
573
|
+
...route
|
574
|
+
},
|
575
|
+
InputSchema: void 0,
|
576
|
+
OutputSchema: void 0,
|
577
|
+
errorMap: this["~orpc"].errorMap
|
578
|
+
})
|
579
|
+
});
|
580
|
+
}
|
581
|
+
input(schema, example) {
|
582
|
+
return new ProcedureBuilderWithInput({
|
583
|
+
middlewares: [],
|
584
|
+
inputValidationIndex: fallbackConfig("initialInputValidationIndex", this["~orpc"].config.initialInputValidationIndex),
|
585
|
+
outputValidationIndex: fallbackConfig("initialOutputValidationIndex", this["~orpc"].config.initialOutputValidationIndex),
|
586
|
+
contract: new ContractProcedure2({
|
587
|
+
route: this["~orpc"].config.initialRoute,
|
588
|
+
OutputSchema: void 0,
|
589
|
+
InputSchema: schema,
|
590
|
+
inputExample: example,
|
591
|
+
errorMap: this["~orpc"].errorMap
|
592
|
+
})
|
593
|
+
});
|
594
|
+
}
|
595
|
+
output(schema, example) {
|
596
|
+
return new ProcedureBuilderWithOutput({
|
597
|
+
middlewares: [],
|
598
|
+
inputValidationIndex: fallbackConfig("initialInputValidationIndex", this["~orpc"].config.initialInputValidationIndex),
|
599
|
+
outputValidationIndex: fallbackConfig("initialOutputValidationIndex", this["~orpc"].config.initialOutputValidationIndex),
|
600
|
+
contract: new ContractProcedure2({
|
601
|
+
route: this["~orpc"].config.initialRoute,
|
602
|
+
InputSchema: void 0,
|
603
|
+
OutputSchema: schema,
|
604
|
+
outputExample: example,
|
605
|
+
errorMap: this["~orpc"].errorMap
|
606
|
+
})
|
607
|
+
});
|
608
|
+
}
|
609
|
+
handler(handler) {
|
610
|
+
return new DecoratedProcedure({
|
611
|
+
middlewares: [],
|
612
|
+
inputValidationIndex: fallbackConfig("initialInputValidationIndex", this["~orpc"].config.initialInputValidationIndex),
|
613
|
+
outputValidationIndex: fallbackConfig("initialOutputValidationIndex", this["~orpc"].config.initialOutputValidationIndex),
|
614
|
+
contract: new ContractProcedure2({
|
615
|
+
route: this["~orpc"].config.initialRoute,
|
616
|
+
InputSchema: void 0,
|
617
|
+
OutputSchema: void 0,
|
618
|
+
errorMap: this["~orpc"].errorMap
|
619
|
+
}),
|
620
|
+
handler
|
621
|
+
});
|
622
|
+
}
|
623
|
+
prefix(prefix) {
|
624
|
+
return new RouterBuilder({
|
625
|
+
middlewares: [],
|
626
|
+
errorMap: this["~orpc"].errorMap,
|
627
|
+
prefix
|
628
|
+
});
|
629
|
+
}
|
630
|
+
tag(...tags) {
|
631
|
+
return new RouterBuilder({
|
632
|
+
middlewares: [],
|
633
|
+
errorMap: this["~orpc"].errorMap,
|
634
|
+
tags
|
635
|
+
});
|
636
|
+
}
|
637
|
+
router(router) {
|
638
|
+
return new RouterBuilder({
|
639
|
+
middlewares: [],
|
640
|
+
...this["~orpc"]
|
641
|
+
}).router(router);
|
642
|
+
}
|
643
|
+
lazy(loader) {
|
644
|
+
return new RouterBuilder({
|
645
|
+
middlewares: [],
|
646
|
+
...this["~orpc"]
|
647
|
+
}).lazy(loader);
|
648
|
+
}
|
649
|
+
};
|
650
|
+
|
651
|
+
// src/builder-with-middlewares.ts
|
652
|
+
import { ContractProcedure as ContractProcedure3 } from "@orpc/contract";
|
653
|
+
|
654
|
+
// src/implementer-chainable.ts
|
655
|
+
import { isContractProcedure } from "@orpc/contract";
|
656
|
+
import { createCallableObject } from "@orpc/shared";
|
657
|
+
|
267
658
|
// src/router-implementer.ts
|
268
659
|
var RouterImplementer = class _RouterImplementer {
|
269
660
|
"~type" = "RouterImplementer";
|
@@ -278,31 +669,42 @@ var RouterImplementer = class _RouterImplementer {
|
|
278
669
|
});
|
279
670
|
}
|
280
671
|
router(router) {
|
281
|
-
const adapted = new RouterBuilder(
|
672
|
+
const adapted = new RouterBuilder({
|
673
|
+
...this["~orpc"],
|
674
|
+
errorMap: {}
|
675
|
+
}).router(router);
|
282
676
|
const contracted = setRouterContract(adapted, this["~orpc"].contract);
|
283
677
|
return contracted;
|
284
678
|
}
|
285
679
|
lazy(loader) {
|
286
|
-
const adapted = new RouterBuilder(
|
680
|
+
const adapted = new RouterBuilder({
|
681
|
+
...this["~orpc"],
|
682
|
+
errorMap: {}
|
683
|
+
}).lazy(loader);
|
287
684
|
const contracted = setRouterContract(adapted, this["~orpc"].contract);
|
288
685
|
return contracted;
|
289
686
|
}
|
290
687
|
};
|
291
688
|
|
292
689
|
// src/implementer-chainable.ts
|
293
|
-
function createChainableImplementer(contract,
|
690
|
+
function createChainableImplementer(contract, options) {
|
294
691
|
if (isContractProcedure(contract)) {
|
295
692
|
const implementer = new ProcedureImplementer({
|
296
693
|
contract,
|
297
|
-
middlewares
|
694
|
+
middlewares: options.middlewares,
|
695
|
+
inputValidationIndex: options.inputValidationIndex,
|
696
|
+
outputValidationIndex: options.outputValidationIndex
|
298
697
|
});
|
299
698
|
return implementer;
|
300
699
|
}
|
301
700
|
const chainable = {};
|
302
701
|
for (const key in contract) {
|
303
|
-
chainable[key] = createChainableImplementer(contract[key],
|
702
|
+
chainable[key] = createChainableImplementer(contract[key], options);
|
304
703
|
}
|
305
|
-
const routerImplementer = new RouterImplementer({
|
704
|
+
const routerImplementer = new RouterImplementer({
|
705
|
+
contract,
|
706
|
+
middlewares: options.middlewares
|
707
|
+
});
|
306
708
|
const merged = new Proxy(chainable, {
|
307
709
|
get(target, key) {
|
308
710
|
const next = Reflect.get(target, key);
|
@@ -319,58 +721,105 @@ function createChainableImplementer(contract, middlewares) {
|
|
319
721
|
return merged;
|
320
722
|
}
|
321
723
|
|
322
|
-
// src/
|
323
|
-
|
324
|
-
|
325
|
-
} from "@orpc/contract";
|
326
|
-
var ProcedureBuilder = class _ProcedureBuilder {
|
327
|
-
"~type" = "ProcedureBuilder";
|
724
|
+
// src/builder-with-middlewares.ts
|
725
|
+
var BuilderWithMiddlewares = class _BuilderWithMiddlewares {
|
726
|
+
"~type" = "BuilderHasMiddlewares";
|
328
727
|
"~orpc";
|
329
728
|
constructor(def) {
|
330
729
|
this["~orpc"] = def;
|
331
730
|
}
|
731
|
+
use(middleware) {
|
732
|
+
return new _BuilderWithMiddlewares({
|
733
|
+
...this["~orpc"],
|
734
|
+
inputValidationIndex: this["~orpc"].inputValidationIndex + 1,
|
735
|
+
outputValidationIndex: this["~orpc"].outputValidationIndex + 1,
|
736
|
+
middlewares: [...this["~orpc"].middlewares, middleware]
|
737
|
+
});
|
738
|
+
}
|
739
|
+
errors(errors) {
|
740
|
+
return new BuilderWithErrorsMiddlewares({
|
741
|
+
...this["~orpc"],
|
742
|
+
errorMap: errors
|
743
|
+
});
|
744
|
+
}
|
332
745
|
route(route) {
|
333
|
-
return new
|
746
|
+
return new ProcedureBuilder({
|
334
747
|
...this["~orpc"],
|
335
|
-
contract:
|
748
|
+
contract: new ContractProcedure3({
|
749
|
+
route: {
|
750
|
+
...this["~orpc"].config.initialRoute,
|
751
|
+
...route
|
752
|
+
},
|
753
|
+
InputSchema: void 0,
|
754
|
+
OutputSchema: void 0,
|
755
|
+
errorMap: {}
|
756
|
+
})
|
336
757
|
});
|
337
758
|
}
|
338
759
|
input(schema, example) {
|
339
|
-
return new
|
760
|
+
return new ProcedureBuilderWithInput({
|
340
761
|
...this["~orpc"],
|
341
|
-
contract:
|
762
|
+
contract: new ContractProcedure3({
|
763
|
+
route: this["~orpc"].config.initialRoute,
|
764
|
+
OutputSchema: void 0,
|
765
|
+
InputSchema: schema,
|
766
|
+
inputExample: example,
|
767
|
+
errorMap: {}
|
768
|
+
})
|
342
769
|
});
|
343
770
|
}
|
344
771
|
output(schema, example) {
|
345
|
-
return new
|
772
|
+
return new ProcedureBuilderWithOutput({
|
346
773
|
...this["~orpc"],
|
347
|
-
contract:
|
774
|
+
contract: new ContractProcedure3({
|
775
|
+
route: this["~orpc"].config.initialRoute,
|
776
|
+
InputSchema: void 0,
|
777
|
+
OutputSchema: schema,
|
778
|
+
outputExample: example,
|
779
|
+
errorMap: {}
|
780
|
+
})
|
348
781
|
});
|
349
782
|
}
|
350
|
-
|
351
|
-
return new
|
783
|
+
handler(handler) {
|
784
|
+
return new DecoratedProcedure({
|
352
785
|
...this["~orpc"],
|
353
|
-
contract:
|
786
|
+
contract: new ContractProcedure3({
|
787
|
+
route: this["~orpc"].config.initialRoute,
|
788
|
+
InputSchema: void 0,
|
789
|
+
OutputSchema: void 0,
|
790
|
+
errorMap: {}
|
791
|
+
}),
|
792
|
+
handler
|
354
793
|
});
|
355
794
|
}
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
}
|
363
|
-
return new ProcedureImplementer({
|
364
|
-
contract: this["~orpc"].contract,
|
365
|
-
middlewares: this["~orpc"].middlewares
|
366
|
-
}).use(middleware, mapInput);
|
795
|
+
prefix(prefix) {
|
796
|
+
return new RouterBuilder({
|
797
|
+
middlewares: this["~orpc"].middlewares,
|
798
|
+
errorMap: {},
|
799
|
+
prefix
|
800
|
+
});
|
367
801
|
}
|
368
|
-
|
369
|
-
return
|
802
|
+
tag(...tags) {
|
803
|
+
return new RouterBuilder({
|
370
804
|
middlewares: this["~orpc"].middlewares,
|
371
|
-
|
372
|
-
|
373
|
-
})
|
805
|
+
errorMap: {},
|
806
|
+
tags
|
807
|
+
});
|
808
|
+
}
|
809
|
+
router(router) {
|
810
|
+
return new RouterBuilder({
|
811
|
+
errorMap: {},
|
812
|
+
...this["~orpc"]
|
813
|
+
}).router(router);
|
814
|
+
}
|
815
|
+
lazy(loader) {
|
816
|
+
return new RouterBuilder({
|
817
|
+
errorMap: {},
|
818
|
+
...this["~orpc"]
|
819
|
+
}).lazy(loader);
|
820
|
+
}
|
821
|
+
contract(contract) {
|
822
|
+
return createChainableImplementer(contract, this["~orpc"]);
|
374
823
|
}
|
375
824
|
};
|
376
825
|
|
@@ -381,125 +830,170 @@ var Builder = class _Builder {
|
|
381
830
|
constructor(def) {
|
382
831
|
this["~orpc"] = def;
|
383
832
|
}
|
384
|
-
|
385
|
-
return new _Builder({});
|
386
|
-
}
|
387
|
-
use(middleware) {
|
833
|
+
config(config) {
|
388
834
|
return new _Builder({
|
389
835
|
...this["~orpc"],
|
390
|
-
|
836
|
+
config: {
|
837
|
+
...this["~orpc"].config,
|
838
|
+
...config
|
839
|
+
}
|
391
840
|
});
|
392
841
|
}
|
842
|
+
context() {
|
843
|
+
return this;
|
844
|
+
}
|
393
845
|
middleware(middleware) {
|
394
846
|
return decorateMiddleware(middleware);
|
395
847
|
}
|
848
|
+
errors(errors) {
|
849
|
+
return new BuilderWithErrors({
|
850
|
+
...this["~orpc"],
|
851
|
+
errorMap: errors
|
852
|
+
});
|
853
|
+
}
|
854
|
+
use(middleware) {
|
855
|
+
return new BuilderWithMiddlewares({
|
856
|
+
...this["~orpc"],
|
857
|
+
inputValidationIndex: fallbackConfig("initialInputValidationIndex", this["~orpc"].config.initialInputValidationIndex) + 1,
|
858
|
+
outputValidationIndex: fallbackConfig("initialOutputValidationIndex", this["~orpc"].config.initialOutputValidationIndex) + 1,
|
859
|
+
middlewares: [middleware]
|
860
|
+
// FIXME: I believe we can remove `as any` here
|
861
|
+
});
|
862
|
+
}
|
396
863
|
route(route) {
|
397
864
|
return new ProcedureBuilder({
|
398
|
-
middlewares:
|
399
|
-
|
400
|
-
|
865
|
+
middlewares: [],
|
866
|
+
inputValidationIndex: fallbackConfig("initialInputValidationIndex", this["~orpc"].config.initialInputValidationIndex),
|
867
|
+
outputValidationIndex: fallbackConfig("initialOutputValidationIndex", this["~orpc"].config.initialOutputValidationIndex),
|
868
|
+
contract: new ContractProcedure4({
|
869
|
+
route: {
|
870
|
+
...this["~orpc"].config.initialRoute,
|
871
|
+
...route
|
872
|
+
},
|
401
873
|
InputSchema: void 0,
|
402
874
|
OutputSchema: void 0,
|
403
|
-
errorMap:
|
875
|
+
errorMap: {}
|
404
876
|
})
|
405
877
|
});
|
406
878
|
}
|
407
879
|
input(schema, example) {
|
408
|
-
return new
|
409
|
-
middlewares:
|
410
|
-
|
880
|
+
return new ProcedureBuilderWithInput({
|
881
|
+
middlewares: [],
|
882
|
+
inputValidationIndex: fallbackConfig("initialInputValidationIndex", this["~orpc"].config.initialInputValidationIndex),
|
883
|
+
outputValidationIndex: fallbackConfig("initialOutputValidationIndex", this["~orpc"].config.initialOutputValidationIndex),
|
884
|
+
contract: new ContractProcedure4({
|
885
|
+
route: this["~orpc"].config.initialRoute,
|
411
886
|
OutputSchema: void 0,
|
412
887
|
InputSchema: schema,
|
413
888
|
inputExample: example,
|
414
|
-
errorMap:
|
889
|
+
errorMap: {}
|
415
890
|
})
|
416
891
|
});
|
417
892
|
}
|
418
893
|
output(schema, example) {
|
419
|
-
return new
|
420
|
-
middlewares:
|
421
|
-
|
894
|
+
return new ProcedureBuilderWithOutput({
|
895
|
+
middlewares: [],
|
896
|
+
inputValidationIndex: fallbackConfig("initialInputValidationIndex", this["~orpc"].config.initialInputValidationIndex),
|
897
|
+
outputValidationIndex: fallbackConfig("initialOutputValidationIndex", this["~orpc"].config.initialOutputValidationIndex),
|
898
|
+
contract: new ContractProcedure4({
|
899
|
+
route: this["~orpc"].config.initialRoute,
|
422
900
|
InputSchema: void 0,
|
423
901
|
OutputSchema: schema,
|
424
902
|
outputExample: example,
|
425
|
-
errorMap:
|
426
|
-
})
|
427
|
-
});
|
428
|
-
}
|
429
|
-
errors(errors) {
|
430
|
-
return new ProcedureBuilder({
|
431
|
-
middlewares: this["~orpc"].middlewares,
|
432
|
-
contract: new ContractProcedure({
|
433
|
-
InputSchema: void 0,
|
434
|
-
OutputSchema: void 0,
|
435
|
-
errorMap: errors
|
903
|
+
errorMap: {}
|
436
904
|
})
|
437
905
|
});
|
438
906
|
}
|
439
907
|
handler(handler) {
|
440
|
-
return
|
441
|
-
middlewares:
|
442
|
-
|
908
|
+
return new DecoratedProcedure({
|
909
|
+
middlewares: [],
|
910
|
+
inputValidationIndex: fallbackConfig("initialInputValidationIndex", this["~orpc"].config.initialInputValidationIndex),
|
911
|
+
outputValidationIndex: fallbackConfig("initialOutputValidationIndex", this["~orpc"].config.initialOutputValidationIndex),
|
912
|
+
contract: new ContractProcedure4({
|
913
|
+
route: this["~orpc"].config.initialRoute,
|
443
914
|
InputSchema: void 0,
|
444
915
|
OutputSchema: void 0,
|
445
|
-
errorMap:
|
916
|
+
errorMap: {}
|
446
917
|
}),
|
447
918
|
handler
|
448
|
-
})
|
919
|
+
});
|
449
920
|
}
|
450
921
|
prefix(prefix) {
|
451
922
|
return new RouterBuilder({
|
452
|
-
middlewares:
|
923
|
+
middlewares: [],
|
924
|
+
errorMap: {},
|
453
925
|
prefix
|
454
926
|
});
|
455
927
|
}
|
456
928
|
tag(...tags) {
|
457
929
|
return new RouterBuilder({
|
458
|
-
middlewares:
|
930
|
+
middlewares: [],
|
931
|
+
errorMap: {},
|
459
932
|
tags
|
460
933
|
});
|
461
934
|
}
|
462
935
|
router(router) {
|
463
|
-
return new RouterBuilder(
|
936
|
+
return new RouterBuilder({
|
937
|
+
middlewares: [],
|
938
|
+
errorMap: []
|
939
|
+
}).router(router);
|
464
940
|
}
|
465
941
|
lazy(loader) {
|
466
|
-
return new RouterBuilder(
|
942
|
+
return new RouterBuilder({
|
943
|
+
middlewares: [],
|
944
|
+
errorMap: {}
|
945
|
+
}).lazy(loader);
|
467
946
|
}
|
468
947
|
contract(contract) {
|
469
|
-
return createChainableImplementer(contract,
|
948
|
+
return createChainableImplementer(contract, {
|
949
|
+
middlewares: [],
|
950
|
+
inputValidationIndex: 0,
|
951
|
+
outputValidationIndex: 0
|
952
|
+
});
|
470
953
|
}
|
471
954
|
};
|
472
955
|
|
956
|
+
// src/procedure-utils.ts
|
957
|
+
function call(procedure, input, ...rest) {
|
958
|
+
return createProcedureClient(procedure, ...rest)(input);
|
959
|
+
}
|
960
|
+
|
961
|
+
// src/lazy-utils.ts
|
962
|
+
function createLazyProcedureFormAnyLazy(lazied) {
|
963
|
+
const lazyProcedure = lazy(async () => {
|
964
|
+
const { default: maybeProcedure } = await unlazy(flatLazy(lazied));
|
965
|
+
if (!isProcedure(maybeProcedure)) {
|
966
|
+
throw new Error(`
|
967
|
+
Expected a lazy<procedure> but got lazy<unknown>.
|
968
|
+
This should be caught by TypeScript compilation.
|
969
|
+
Please report this issue if this makes you feel uncomfortable.
|
970
|
+
`);
|
971
|
+
}
|
972
|
+
return { default: maybeProcedure };
|
973
|
+
});
|
974
|
+
return lazyProcedure;
|
975
|
+
}
|
976
|
+
|
473
977
|
// src/router-client.ts
|
474
|
-
function createRouterClient(
|
475
|
-
if (isProcedure(
|
476
|
-
const caller = createProcedureClient(
|
477
|
-
...options,
|
478
|
-
procedure: options.router,
|
479
|
-
context: options.context,
|
480
|
-
path: options.path
|
481
|
-
});
|
978
|
+
function createRouterClient(router, ...rest) {
|
979
|
+
if (isProcedure(router)) {
|
980
|
+
const caller = createProcedureClient(router, ...rest);
|
482
981
|
return caller;
|
483
982
|
}
|
484
|
-
const procedureCaller = isLazy(
|
485
|
-
...options,
|
486
|
-
procedure: createLazyProcedureFormAnyLazy(options.router),
|
487
|
-
context: options.context,
|
488
|
-
path: options.path
|
489
|
-
}) : {};
|
983
|
+
const procedureCaller = isLazy(router) ? createProcedureClient(createLazyProcedureFormAnyLazy(router), ...rest) : {};
|
490
984
|
const recursive = new Proxy(procedureCaller, {
|
491
985
|
get(target, key) {
|
492
986
|
if (typeof key !== "string") {
|
493
987
|
return Reflect.get(target, key);
|
494
988
|
}
|
495
|
-
const next = getRouterChild(
|
989
|
+
const next = getRouterChild(router, key);
|
496
990
|
if (!next) {
|
497
991
|
return Reflect.get(target, key);
|
498
992
|
}
|
499
|
-
|
993
|
+
const [options] = rest;
|
994
|
+
return createRouterClient(next, {
|
500
995
|
...options,
|
501
|
-
|
502
|
-
path: [...options.path ?? [], key]
|
996
|
+
path: [...options?.path ?? [], key]
|
503
997
|
});
|
504
998
|
}
|
505
999
|
});
|
@@ -507,10 +1001,13 @@ function createRouterClient(options) {
|
|
507
1001
|
}
|
508
1002
|
|
509
1003
|
// src/index.ts
|
510
|
-
import {
|
511
|
-
var os = new Builder({
|
1004
|
+
import { isDefinedError, ORPCError, safe, type } from "@orpc/contract";
|
1005
|
+
var os = new Builder({
|
1006
|
+
config: {}
|
1007
|
+
});
|
512
1008
|
export {
|
513
1009
|
Builder,
|
1010
|
+
DecoratedProcedure,
|
514
1011
|
LAZY_LOADER_SYMBOL,
|
515
1012
|
ORPCError,
|
516
1013
|
Procedure,
|
@@ -518,16 +1015,15 @@ export {
|
|
518
1015
|
ProcedureImplementer,
|
519
1016
|
RouterBuilder,
|
520
1017
|
RouterImplementer,
|
521
|
-
|
1018
|
+
call,
|
522
1019
|
createChainableImplementer,
|
523
1020
|
createORPCErrorConstructorMap,
|
524
1021
|
createProcedureClient,
|
525
1022
|
createRouterClient,
|
526
1023
|
decorateLazy,
|
527
1024
|
decorateMiddleware,
|
528
|
-
decorateProcedure,
|
529
1025
|
deepSetLazyRouterPrefix,
|
530
|
-
|
1026
|
+
fallbackConfig,
|
531
1027
|
flatLazy,
|
532
1028
|
getLazyRouterPrefix,
|
533
1029
|
getRouterChild,
|
@@ -537,9 +1033,11 @@ export {
|
|
537
1033
|
isProcedure,
|
538
1034
|
lazy,
|
539
1035
|
mergeContext,
|
1036
|
+
middlewareOutputFn,
|
540
1037
|
os,
|
541
1038
|
safe,
|
542
1039
|
setRouterContract,
|
1040
|
+
type,
|
543
1041
|
unlazy
|
544
1042
|
};
|
545
1043
|
//# sourceMappingURL=index.js.map
|