@orpc/server 0.0.0-next.c59d67c → 0.0.0-next.d42488d
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/chunk-FN62GL22.js +182 -0
- package/dist/fetch.js +253 -73
- package/dist/index.js +402 -278
- package/dist/src/builder.d.ts +26 -40
- package/dist/src/fetch/composite-handler.d.ts +8 -0
- package/dist/src/fetch/index.d.ts +4 -2
- package/dist/src/fetch/orpc-handler.d.ts +20 -0
- package/dist/src/fetch/orpc-payload-codec.d.ts +9 -0
- package/dist/src/fetch/orpc-procedure-matcher.d.ts +12 -0
- package/dist/src/fetch/super-json.d.ts +12 -0
- package/dist/src/fetch/types.d.ts +14 -33
- package/dist/src/hidden.d.ts +6 -0
- package/dist/src/implementer-chainable.d.ts +10 -0
- package/dist/src/index.d.ts +11 -3
- package/dist/src/lazy-decorated.d.ts +10 -0
- package/dist/src/lazy-utils.d.ts +4 -0
- package/dist/src/lazy.d.ts +18 -0
- package/dist/src/middleware-decorated.d.ts +8 -0
- package/dist/src/middleware.d.ts +3 -6
- package/dist/src/procedure-builder.d.ts +15 -24
- package/dist/src/procedure-client.d.ts +29 -0
- package/dist/src/procedure-decorated.d.ts +14 -0
- package/dist/src/procedure-implementer.d.ts +13 -13
- package/dist/src/procedure.d.ts +18 -24
- package/dist/src/router-builder.d.ts +24 -17
- package/dist/src/router-client.d.ts +25 -0
- package/dist/src/router-implementer.d.ts +18 -17
- package/dist/src/router.d.ts +11 -15
- package/dist/src/types.d.ts +8 -4
- package/package.json +4 -9
- package/dist/chunk-TDFYNRZV.js +0 -190
- package/dist/src/fetch/handle.d.ts +0 -7
- package/dist/src/fetch/handler.d.ts +0 -3
- package/dist/src/procedure-caller.d.ts +0 -19
- package/dist/src/router-caller.d.ts +0 -22
@@ -0,0 +1,182 @@
|
|
1
|
+
// src/utils.ts
|
2
|
+
function mergeContext(a, b) {
|
3
|
+
if (!a)
|
4
|
+
return b;
|
5
|
+
if (!b)
|
6
|
+
return a;
|
7
|
+
return {
|
8
|
+
...a,
|
9
|
+
...b
|
10
|
+
};
|
11
|
+
}
|
12
|
+
|
13
|
+
// src/procedure.ts
|
14
|
+
import { isContractProcedure } from "@orpc/contract";
|
15
|
+
var Procedure = class {
|
16
|
+
"~type" = "Procedure";
|
17
|
+
"~orpc";
|
18
|
+
constructor(def) {
|
19
|
+
this["~orpc"] = def;
|
20
|
+
}
|
21
|
+
};
|
22
|
+
function isProcedure(item) {
|
23
|
+
if (item instanceof Procedure) {
|
24
|
+
return true;
|
25
|
+
}
|
26
|
+
return (typeof item === "object" || typeof item === "function") && item !== null && "~type" in item && item["~type"] === "Procedure" && "~orpc" in item && typeof item["~orpc"] === "object" && item["~orpc"] !== null && "contract" in item["~orpc"] && isContractProcedure(item["~orpc"].contract) && "func" in item["~orpc"] && typeof item["~orpc"].func === "function";
|
27
|
+
}
|
28
|
+
|
29
|
+
// src/lazy.ts
|
30
|
+
var LAZY_LOADER_SYMBOL = Symbol("ORPC_LAZY_LOADER");
|
31
|
+
function lazy(loader) {
|
32
|
+
return {
|
33
|
+
[LAZY_LOADER_SYMBOL]: loader
|
34
|
+
};
|
35
|
+
}
|
36
|
+
function isLazy(item) {
|
37
|
+
return (typeof item === "object" || typeof item === "function") && item !== null && LAZY_LOADER_SYMBOL in item && typeof item[LAZY_LOADER_SYMBOL] === "function";
|
38
|
+
}
|
39
|
+
function unlazy(lazied) {
|
40
|
+
return isLazy(lazied) ? lazied[LAZY_LOADER_SYMBOL]() : Promise.resolve({ default: lazied });
|
41
|
+
}
|
42
|
+
function flatLazy(lazied) {
|
43
|
+
const flattenLoader = async () => {
|
44
|
+
let current = await unlazy(lazied);
|
45
|
+
while (true) {
|
46
|
+
if (!isLazy(current.default)) {
|
47
|
+
break;
|
48
|
+
}
|
49
|
+
current = await unlazy(current.default);
|
50
|
+
}
|
51
|
+
return current;
|
52
|
+
};
|
53
|
+
return lazy(flattenLoader);
|
54
|
+
}
|
55
|
+
|
56
|
+
// src/procedure-client.ts
|
57
|
+
import { executeWithHooks, value } from "@orpc/shared";
|
58
|
+
import { ORPCError } from "@orpc/shared/error";
|
59
|
+
function createProcedureClient(options) {
|
60
|
+
return async (...[input, callerOptions]) => {
|
61
|
+
const path = options.path ?? [];
|
62
|
+
const { default: procedure } = await unlazy(options.procedure);
|
63
|
+
const context = await value(options.context);
|
64
|
+
const meta = {
|
65
|
+
path,
|
66
|
+
procedure,
|
67
|
+
signal: callerOptions?.signal
|
68
|
+
};
|
69
|
+
const executeWithValidation = async () => {
|
70
|
+
const validInput = await validateInput(procedure, input);
|
71
|
+
const output = await executeMiddlewareChain(
|
72
|
+
procedure,
|
73
|
+
validInput,
|
74
|
+
context,
|
75
|
+
meta
|
76
|
+
);
|
77
|
+
return validateOutput(procedure, output);
|
78
|
+
};
|
79
|
+
return executeWithHooks({
|
80
|
+
hooks: options,
|
81
|
+
input,
|
82
|
+
context,
|
83
|
+
meta,
|
84
|
+
execute: executeWithValidation
|
85
|
+
});
|
86
|
+
};
|
87
|
+
}
|
88
|
+
async function validateInput(procedure, input) {
|
89
|
+
const schema = procedure["~orpc"].contract["~orpc"].InputSchema;
|
90
|
+
if (!schema)
|
91
|
+
return input;
|
92
|
+
const result = await schema["~standard"].validate(input);
|
93
|
+
if (result.issues) {
|
94
|
+
throw new ORPCError({
|
95
|
+
message: "Input validation failed",
|
96
|
+
code: "BAD_REQUEST",
|
97
|
+
issues: result.issues
|
98
|
+
});
|
99
|
+
}
|
100
|
+
return result.value;
|
101
|
+
}
|
102
|
+
async function validateOutput(procedure, output) {
|
103
|
+
const schema = procedure["~orpc"].contract["~orpc"].OutputSchema;
|
104
|
+
if (!schema)
|
105
|
+
return output;
|
106
|
+
const result = await schema["~standard"].validate(output);
|
107
|
+
if (result.issues) {
|
108
|
+
throw new ORPCError({
|
109
|
+
message: "Output validation failed",
|
110
|
+
code: "INTERNAL_SERVER_ERROR",
|
111
|
+
issues: result.issues
|
112
|
+
});
|
113
|
+
}
|
114
|
+
return result.value;
|
115
|
+
}
|
116
|
+
async function executeMiddlewareChain(procedure, input, context, meta) {
|
117
|
+
const middlewares = procedure["~orpc"].middlewares ?? [];
|
118
|
+
let currentMidIndex = 0;
|
119
|
+
let currentContext = context;
|
120
|
+
const next = async (nextOptions) => {
|
121
|
+
const mid = middlewares[currentMidIndex];
|
122
|
+
currentMidIndex += 1;
|
123
|
+
currentContext = mergeContext(currentContext, nextOptions.context);
|
124
|
+
if (mid) {
|
125
|
+
return await mid(input, currentContext, {
|
126
|
+
...meta,
|
127
|
+
next,
|
128
|
+
output: (output) => ({ output, context: void 0 })
|
129
|
+
});
|
130
|
+
}
|
131
|
+
const result = {
|
132
|
+
output: await procedure["~orpc"].func(input, currentContext, meta),
|
133
|
+
context: currentContext
|
134
|
+
};
|
135
|
+
return result;
|
136
|
+
};
|
137
|
+
return (await next({})).output;
|
138
|
+
}
|
139
|
+
|
140
|
+
// src/router.ts
|
141
|
+
function getRouterChild(router, ...path) {
|
142
|
+
let current = router;
|
143
|
+
for (let i = 0; i < path.length; i++) {
|
144
|
+
const segment = path[i];
|
145
|
+
if (!current) {
|
146
|
+
return void 0;
|
147
|
+
}
|
148
|
+
if (isProcedure(current)) {
|
149
|
+
return void 0;
|
150
|
+
}
|
151
|
+
if (!isLazy(current)) {
|
152
|
+
current = current[segment];
|
153
|
+
continue;
|
154
|
+
}
|
155
|
+
const lazied = current;
|
156
|
+
const rest = path.slice(i);
|
157
|
+
const newLazy = lazy(async () => {
|
158
|
+
const unwrapped = await unlazy(lazied);
|
159
|
+
if (!unwrapped.default) {
|
160
|
+
return unwrapped;
|
161
|
+
}
|
162
|
+
const next = getRouterChild(unwrapped.default, ...rest);
|
163
|
+
return { default: next };
|
164
|
+
});
|
165
|
+
return flatLazy(newLazy);
|
166
|
+
}
|
167
|
+
return current;
|
168
|
+
}
|
169
|
+
|
170
|
+
export {
|
171
|
+
mergeContext,
|
172
|
+
Procedure,
|
173
|
+
isProcedure,
|
174
|
+
LAZY_LOADER_SYMBOL,
|
175
|
+
lazy,
|
176
|
+
isLazy,
|
177
|
+
unlazy,
|
178
|
+
flatLazy,
|
179
|
+
createProcedureClient,
|
180
|
+
getRouterChild
|
181
|
+
};
|
182
|
+
//# sourceMappingURL=chunk-FN62GL22.js.map
|
package/dist/fetch.js
CHANGED
@@ -1,106 +1,286 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
createProcedureClient,
|
3
|
+
getRouterChild,
|
4
|
+
isProcedure,
|
5
|
+
unlazy
|
6
|
+
} from "./chunk-FN62GL22.js";
|
5
7
|
|
6
|
-
// src/fetch/
|
8
|
+
// src/fetch/composite-handler.ts
|
9
|
+
var CompositeHandler = class {
|
10
|
+
constructor(handlers) {
|
11
|
+
this.handlers = handlers;
|
12
|
+
}
|
13
|
+
async fetch(request, ...opt) {
|
14
|
+
for (const handler of this.handlers) {
|
15
|
+
if (handler.condition(request)) {
|
16
|
+
return handler.fetch(request, ...opt);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
return new Response("None of the handlers can handle the request.", {
|
20
|
+
status: 404
|
21
|
+
});
|
22
|
+
}
|
23
|
+
};
|
24
|
+
|
25
|
+
// src/fetch/orpc-handler.ts
|
26
|
+
import { executeWithHooks, ORPC_HANDLER_HEADER, ORPC_HANDLER_VALUE, trim as trim2 } from "@orpc/shared";
|
27
|
+
import { ORPCError as ORPCError2 } from "@orpc/shared/error";
|
28
|
+
|
29
|
+
// src/fetch/orpc-payload-codec.ts
|
30
|
+
import { findDeepMatches, set } from "@orpc/shared";
|
7
31
|
import { ORPCError } from "@orpc/shared/error";
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
32
|
+
|
33
|
+
// ../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/getType.js
|
34
|
+
function getType(payload) {
|
35
|
+
return Object.prototype.toString.call(payload).slice(8, -1);
|
36
|
+
}
|
37
|
+
|
38
|
+
// ../../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isPlainObject.js
|
39
|
+
function isPlainObject(payload) {
|
40
|
+
if (getType(payload) !== "Object")
|
41
|
+
return false;
|
42
|
+
const prototype = Object.getPrototypeOf(payload);
|
43
|
+
return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
|
44
|
+
}
|
45
|
+
|
46
|
+
// src/fetch/super-json.ts
|
47
|
+
function serialize(value, segments = [], meta = []) {
|
48
|
+
if (typeof value === "bigint") {
|
49
|
+
meta.push(["bigint", segments]);
|
50
|
+
return { data: value.toString(), meta };
|
51
|
+
}
|
52
|
+
if (value instanceof Date) {
|
53
|
+
meta.push(["date", segments]);
|
54
|
+
const data = Number.isNaN(value.getTime()) ? "Invalid Date" : value.toISOString();
|
55
|
+
return { data, meta };
|
56
|
+
}
|
57
|
+
if (Number.isNaN(value)) {
|
58
|
+
meta.push(["nan", segments]);
|
59
|
+
return { data: "NaN", meta };
|
60
|
+
}
|
61
|
+
if (value instanceof RegExp) {
|
62
|
+
meta.push(["regexp", segments]);
|
63
|
+
return { data: value.toString(), meta };
|
64
|
+
}
|
65
|
+
if (value instanceof URL) {
|
66
|
+
meta.push(["url", segments]);
|
67
|
+
return { data: value.toString(), meta };
|
68
|
+
}
|
69
|
+
if (isPlainObject(value)) {
|
70
|
+
const data = {};
|
71
|
+
for (const k in value) {
|
72
|
+
data[k] = serialize(value[k], [...segments, k], meta).data;
|
13
73
|
}
|
74
|
+
return { data, meta };
|
75
|
+
}
|
76
|
+
if (Array.isArray(value)) {
|
77
|
+
const data = value.map((v, i) => {
|
78
|
+
if (v === void 0) {
|
79
|
+
meta.push(["undefined", [...segments, i]]);
|
80
|
+
return null;
|
81
|
+
}
|
82
|
+
return serialize(v, [...segments, i], meta).data;
|
83
|
+
});
|
84
|
+
return { data, meta };
|
85
|
+
}
|
86
|
+
if (value instanceof Set) {
|
87
|
+
const result = serialize(Array.from(value), segments, meta);
|
88
|
+
meta.push(["set", segments]);
|
89
|
+
return result;
|
90
|
+
}
|
91
|
+
if (value instanceof Map) {
|
92
|
+
const result = serialize(Array.from(value.entries()), segments, meta);
|
93
|
+
meta.push(["map", segments]);
|
94
|
+
return result;
|
14
95
|
}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
96
|
+
return { data: value, meta };
|
97
|
+
}
|
98
|
+
function deserialize({
|
99
|
+
data,
|
100
|
+
meta
|
101
|
+
}) {
|
102
|
+
if (meta.length === 0) {
|
103
|
+
return data;
|
104
|
+
}
|
105
|
+
const ref = { data };
|
106
|
+
for (const [type, segments] of meta) {
|
107
|
+
let currentRef = ref;
|
108
|
+
let preSegment = "data";
|
109
|
+
for (let i = 0; i < segments.length; i++) {
|
110
|
+
currentRef = currentRef[preSegment];
|
111
|
+
preSegment = segments[i];
|
20
112
|
}
|
21
|
-
|
113
|
+
switch (type) {
|
114
|
+
case "nan":
|
115
|
+
currentRef[preSegment] = Number.NaN;
|
116
|
+
break;
|
117
|
+
case "bigint":
|
118
|
+
currentRef[preSegment] = BigInt(currentRef[preSegment]);
|
119
|
+
break;
|
120
|
+
case "date":
|
121
|
+
currentRef[preSegment] = new Date(currentRef[preSegment]);
|
122
|
+
break;
|
123
|
+
case "regexp": {
|
124
|
+
const [, pattern, flags] = currentRef[preSegment].match(/^\/(.*)\/([a-z]*)$/);
|
125
|
+
currentRef[preSegment] = new RegExp(pattern, flags);
|
126
|
+
break;
|
127
|
+
}
|
128
|
+
case "url":
|
129
|
+
currentRef[preSegment] = new URL(currentRef[preSegment]);
|
130
|
+
break;
|
131
|
+
case "undefined":
|
132
|
+
currentRef[preSegment] = void 0;
|
133
|
+
break;
|
134
|
+
case "map":
|
135
|
+
currentRef[preSegment] = new Map(currentRef[preSegment]);
|
136
|
+
break;
|
137
|
+
case "set":
|
138
|
+
currentRef[preSegment] = new Set(currentRef[preSegment]);
|
139
|
+
break;
|
140
|
+
/* v8 ignore next 3 */
|
141
|
+
default: {
|
142
|
+
const _expected = type;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
return ref.data;
|
22
147
|
}
|
23
148
|
|
24
|
-
// src/fetch/
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
149
|
+
// src/fetch/orpc-payload-codec.ts
|
150
|
+
var ORPCPayloadCodec = class {
|
151
|
+
encode(payload) {
|
152
|
+
const { data, meta } = serialize(payload);
|
153
|
+
const { maps, values } = findDeepMatches((v) => v instanceof Blob, data);
|
154
|
+
if (values.length > 0) {
|
155
|
+
const form = new FormData();
|
156
|
+
if (data !== void 0) {
|
157
|
+
form.append("data", JSON.stringify(data));
|
158
|
+
}
|
159
|
+
form.append("meta", JSON.stringify(meta));
|
160
|
+
form.append("maps", JSON.stringify(maps));
|
161
|
+
for (const i in values) {
|
162
|
+
const value = values[i];
|
163
|
+
form.append(i, value);
|
164
|
+
}
|
165
|
+
return { body: form };
|
166
|
+
}
|
167
|
+
return {
|
168
|
+
body: JSON.stringify({ data, meta }),
|
169
|
+
headers: new Headers({
|
170
|
+
"content-type": "application/json"
|
171
|
+
})
|
172
|
+
};
|
173
|
+
}
|
174
|
+
async decode(re) {
|
175
|
+
try {
|
176
|
+
if (re.headers.get("content-type")?.startsWith("multipart/form-data")) {
|
177
|
+
const form = await re.formData();
|
178
|
+
const rawData = form.get("data");
|
179
|
+
const rawMeta = form.get("meta");
|
180
|
+
const rawMaps = form.get("maps");
|
181
|
+
let data = JSON.parse(rawData);
|
182
|
+
const meta = JSON.parse(rawMeta);
|
183
|
+
const maps = JSON.parse(rawMaps);
|
184
|
+
for (const i in maps) {
|
185
|
+
data = set(data, maps[i], form.get(i));
|
186
|
+
}
|
187
|
+
return deserialize({
|
188
|
+
data,
|
189
|
+
meta
|
190
|
+
});
|
191
|
+
}
|
192
|
+
const json = await re.json();
|
193
|
+
return deserialize(json);
|
194
|
+
} catch (e) {
|
195
|
+
throw new ORPCError({
|
196
|
+
code: "BAD_REQUEST",
|
197
|
+
message: "Cannot parse request/response. Please check the request/response body and Content-Type header.",
|
198
|
+
cause: e
|
199
|
+
});
|
200
|
+
}
|
201
|
+
}
|
202
|
+
};
|
203
|
+
|
204
|
+
// src/fetch/orpc-procedure-matcher.ts
|
205
|
+
import { trim } from "@orpc/shared";
|
206
|
+
var ORPCProcedureMatcher = class {
|
207
|
+
constructor(router) {
|
208
|
+
this.router = router;
|
209
|
+
}
|
210
|
+
async match(pathname) {
|
211
|
+
const path = trim(pathname, "/").split("/").map(decodeURIComponent);
|
212
|
+
const match = getRouterChild(this.router, ...path);
|
213
|
+
const { default: maybeProcedure } = await unlazy(match);
|
214
|
+
if (!isProcedure(maybeProcedure)) {
|
34
215
|
return void 0;
|
35
216
|
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
217
|
+
return {
|
218
|
+
procedure: maybeProcedure,
|
219
|
+
path
|
220
|
+
};
|
221
|
+
}
|
222
|
+
};
|
223
|
+
|
224
|
+
// src/fetch/orpc-handler.ts
|
225
|
+
var ORPCHandler = class {
|
226
|
+
constructor(router, options) {
|
227
|
+
this.router = router;
|
228
|
+
this.options = options;
|
229
|
+
this.procedureMatcher = options?.procedureMatcher ?? new ORPCProcedureMatcher(router);
|
230
|
+
this.payloadCodec = options?.payloadCodec ?? new ORPCPayloadCodec();
|
231
|
+
}
|
232
|
+
procedureMatcher;
|
233
|
+
payloadCodec;
|
234
|
+
condition(request) {
|
235
|
+
return Boolean(request.headers.get(ORPC_HANDLER_HEADER)?.includes(ORPC_HANDLER_VALUE));
|
236
|
+
}
|
237
|
+
async fetch(request, ...[options]) {
|
238
|
+
const context = options?.context;
|
239
|
+
const execute = async () => {
|
240
|
+
const url = new URL(request.url);
|
241
|
+
const pathname = `/${trim2(url.pathname.replace(options?.prefix ?? "", ""), "/")}`;
|
242
|
+
const match = await this.procedureMatcher.match(pathname);
|
41
243
|
if (!match) {
|
42
244
|
throw new ORPCError2({ code: "NOT_FOUND", message: "Not found" });
|
43
245
|
}
|
44
|
-
const input = await
|
45
|
-
const
|
246
|
+
const input = await this.payloadCodec.decode(request);
|
247
|
+
const client = createProcedureClient({
|
46
248
|
context,
|
47
249
|
procedure: match.procedure,
|
48
250
|
path: match.path
|
49
251
|
});
|
50
|
-
const output = await
|
51
|
-
const { body, headers } =
|
52
|
-
return new Response(body, {
|
53
|
-
status: 200,
|
54
|
-
headers
|
55
|
-
});
|
252
|
+
const output = await client(input, { signal: options?.signal });
|
253
|
+
const { body, headers } = this.payloadCodec.encode(output);
|
254
|
+
return new Response(body, { headers });
|
56
255
|
};
|
57
256
|
try {
|
58
|
-
return await
|
257
|
+
return await executeWithHooks({
|
59
258
|
context,
|
60
|
-
|
61
|
-
|
259
|
+
execute,
|
260
|
+
input: request,
|
261
|
+
hooks: this.options,
|
262
|
+
meta: {
|
263
|
+
signal: options?.signal
|
264
|
+
}
|
265
|
+
});
|
62
266
|
} catch (e) {
|
63
267
|
const error = e instanceof ORPCError2 ? e : new ORPCError2({
|
64
268
|
code: "INTERNAL_SERVER_ERROR",
|
65
269
|
message: "Internal server error",
|
66
270
|
cause: e
|
67
271
|
});
|
68
|
-
const { body, headers } =
|
272
|
+
const { body, headers } = this.payloadCodec.encode(error.toJSON());
|
69
273
|
return new Response(body, {
|
70
|
-
|
71
|
-
|
274
|
+
headers,
|
275
|
+
status: error.status
|
72
276
|
});
|
73
277
|
}
|
74
|
-
};
|
75
|
-
}
|
76
|
-
function resolveORPCRouter(router, pathname) {
|
77
|
-
const path = trim(pathname, "/").split("/").map(decodeURIComponent);
|
78
|
-
let current = router;
|
79
|
-
for (const segment of path) {
|
80
|
-
if ((typeof current !== "object" || current === null) && typeof current !== "function") {
|
81
|
-
current = void 0;
|
82
|
-
break;
|
83
|
-
}
|
84
|
-
current = current[segment];
|
85
278
|
}
|
86
|
-
|
87
|
-
procedure: current,
|
88
|
-
path
|
89
|
-
} : void 0;
|
90
|
-
}
|
91
|
-
async function deserializeRequest(request) {
|
92
|
-
try {
|
93
|
-
return await deserializer.deserialize(request);
|
94
|
-
} catch (e) {
|
95
|
-
throw new ORPCError2({
|
96
|
-
code: "BAD_REQUEST",
|
97
|
-
message: "Cannot parse request. Please check the request body and Content-Type header.",
|
98
|
-
cause: e
|
99
|
-
});
|
100
|
-
}
|
101
|
-
}
|
279
|
+
};
|
102
280
|
export {
|
103
|
-
|
104
|
-
|
281
|
+
CompositeHandler,
|
282
|
+
ORPCHandler,
|
283
|
+
ORPCPayloadCodec,
|
284
|
+
ORPCProcedureMatcher
|
105
285
|
};
|
106
286
|
//# sourceMappingURL=fetch.js.map
|