every-plugin 0.4.14 → 0.4.16

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.
Files changed (87) hide show
  1. package/dist/build/rspack/index.cjs +4 -5
  2. package/dist/build/rspack/index.cjs.map +1 -0
  3. package/dist/build/rspack/index.d.cts +1 -1
  4. package/dist/build/rspack/index.d.cts.map +1 -0
  5. package/dist/build/rspack/index.d.mts +1 -1
  6. package/dist/build/rspack/index.d.mts.map +1 -0
  7. package/dist/build/rspack/index.mjs +4 -5
  8. package/dist/build/rspack/index.mjs.map +1 -0
  9. package/dist/errors-9sNpYLv5.d.mts +1 -1
  10. package/dist/errors-9sNpYLv5.d.mts.map +1 -0
  11. package/dist/errors-CVnoPl9v.cjs +1 -1
  12. package/dist/errors-CVnoPl9v.cjs.map +1 -0
  13. package/dist/errors-D7keKf7a.mjs +1 -1
  14. package/dist/errors-D7keKf7a.mjs.map +1 -0
  15. package/dist/errors-DKPPPYYT.d.cts +1 -1
  16. package/dist/errors-DKPPPYYT.d.cts.map +1 -0
  17. package/dist/fetch-8DauUFDh.mjs +335 -0
  18. package/dist/fetch-8DauUFDh.mjs.map +1 -0
  19. package/dist/fetch-CrBvwsZ4.cjs +336 -0
  20. package/dist/fetch-CrBvwsZ4.cjs.map +1 -0
  21. package/dist/index-Coz54d1B.d.mts +387 -0
  22. package/dist/index-Coz54d1B.d.mts.map +1 -0
  23. package/dist/index-G63gBZIY.d.cts +386 -0
  24. package/dist/index-G63gBZIY.d.cts.map +1 -0
  25. package/dist/index.cjs +3 -3
  26. package/dist/index.cjs.map +1 -0
  27. package/dist/index.d.cts +1 -1
  28. package/dist/index.d.mts +1 -1
  29. package/dist/index.mjs +3 -3
  30. package/dist/index.mjs.map +1 -0
  31. package/dist/normalize-BW7kk8Lk.d.cts +1 -1
  32. package/dist/normalize-BW7kk8Lk.d.cts.map +1 -0
  33. package/dist/normalize-D4Qh0wVk.cjs +1 -1
  34. package/dist/normalize-D4Qh0wVk.cjs.map +1 -0
  35. package/dist/normalize-D7nae0Hn.mjs +1 -1
  36. package/dist/normalize-D7nae0Hn.mjs.map +1 -0
  37. package/dist/normalize-eB_j86fm.d.mts +1 -1
  38. package/dist/normalize-eB_j86fm.d.mts.map +1 -0
  39. package/dist/package-ClznSERE.mjs +150 -0
  40. package/dist/package-ClznSERE.mjs.map +1 -0
  41. package/dist/package-DqhszuHi.cjs +155 -0
  42. package/dist/package-DqhszuHi.cjs.map +1 -0
  43. package/dist/plugins-C6MGKdD-.mjs +790 -0
  44. package/dist/plugins-C6MGKdD-.mjs.map +1 -0
  45. package/dist/plugins-DNaNtkG7.cjs +791 -0
  46. package/dist/plugins-DNaNtkG7.cjs.map +1 -0
  47. package/dist/runtime/index.cjs +2 -2
  48. package/dist/runtime/index.d.cts +1 -1
  49. package/dist/runtime/index.d.mts +1 -1
  50. package/dist/runtime/index.mjs +2 -2
  51. package/dist/runtime-BNKZYYMG.cjs +541 -0
  52. package/dist/runtime-BNKZYYMG.cjs.map +1 -0
  53. package/dist/runtime-Da94Fyvr.mjs +476 -0
  54. package/dist/runtime-Da94Fyvr.mjs.map +1 -0
  55. package/dist/standard-CkH8zNkx.mjs +584 -0
  56. package/dist/standard-CkH8zNkx.mjs.map +1 -0
  57. package/dist/standard-v75BC6Z5.cjs +685 -0
  58. package/dist/standard-v75BC6Z5.cjs.map +1 -0
  59. package/dist/testing/index.cjs +3 -3
  60. package/dist/testing/index.cjs.map +1 -0
  61. package/dist/testing/index.d.cts +2 -2
  62. package/dist/testing/index.d.cts.map +1 -0
  63. package/dist/testing/index.d.mts +2 -2
  64. package/dist/testing/index.d.mts.map +1 -0
  65. package/dist/testing/index.mjs +3 -3
  66. package/dist/testing/index.mjs.map +1 -0
  67. package/dist/zod-A7Pti5IV.d.cts +1 -1
  68. package/dist/zod-A7Pti5IV.d.cts.map +1 -0
  69. package/dist/zod-BVo51kgJ.mjs +1 -1
  70. package/dist/zod-BVo51kgJ.mjs.map +1 -0
  71. package/dist/zod-DYghWCz1.cjs +1 -1
  72. package/dist/zod-DYghWCz1.cjs.map +1 -0
  73. package/dist/zod-Zw8dlP3j.d.mts +1 -1
  74. package/dist/zod-Zw8dlP3j.d.mts.map +1 -0
  75. package/package.json +1 -1
  76. package/dist/fetch-CGzn1Uf7.cjs +0 -336
  77. package/dist/fetch-ycs0raYN.mjs +0 -335
  78. package/dist/index-DM9S53Bx.d.cts +0 -382
  79. package/dist/index-DrOou1Hc.d.mts +0 -383
  80. package/dist/package-BoyftHDo.mjs +0 -150
  81. package/dist/package-CgNIVjVe.cjs +0 -155
  82. package/dist/plugins-Cmsm3gW1.cjs +0 -791
  83. package/dist/plugins-hpi2GlaX.mjs +0 -790
  84. package/dist/runtime-BYrdNAff.cjs +0 -524
  85. package/dist/runtime-BzkHRj0E.mjs +0 -459
  86. package/dist/standard-0wBehDUp.cjs +0 -685
  87. package/dist/standard-CYaRay89.mjs +0 -584
@@ -0,0 +1,335 @@
1
+ import { _ as value, a as toHttpPath, f as isObject, g as tryDecodeURIComponent, i as standardizeHTTPPath, l as isORPCErrorStatus, m as stringifyJSON, n as StandardOpenAPISerializer, o as StandardBracketNotationSerializer, t as StandardOpenAPIJsonSerializer } from "./standard-CkH8zNkx.mjs";
2
+ import { createContractedProcedure, getLazyMeta, getRouter, isProcedure, traverseContractProcedures, unlazy } from "@orpc/server";
3
+ import { fallbackContractConfig } from "@orpc/contract";
4
+ import { FetchHandler } from "@orpc/server/fetch";
5
+ import { StandardHandler } from "@orpc/server/standard";
6
+
7
+ //#region ../../node_modules/.bun/rou3@0.7.10/node_modules/rou3/dist/index.mjs
8
+ const NullProtoObj = /* @__PURE__ */ (() => {
9
+ const e = function() {};
10
+ return e.prototype = Object.create(null), Object.freeze(e.prototype), e;
11
+ })();
12
+ /**
13
+ * Create a new router context.
14
+ */
15
+ function createRouter() {
16
+ return {
17
+ root: { key: "" },
18
+ static: new NullProtoObj()
19
+ };
20
+ }
21
+ function splitPath(path) {
22
+ const [_, ...s] = path.split("/");
23
+ return s[s.length - 1] === "" ? s.slice(0, -1) : s;
24
+ }
25
+ function getMatchParams(segments, paramsMap) {
26
+ const params = new NullProtoObj();
27
+ for (const [index, name] of paramsMap) {
28
+ const segment = index < 0 ? segments.slice(-1 * index).join("/") : segments[index];
29
+ if (typeof name === "string") params[name] = segment;
30
+ else {
31
+ const match = segment.match(name);
32
+ if (match) for (const key in match.groups) params[key] = match.groups[key];
33
+ }
34
+ }
35
+ return params;
36
+ }
37
+ /**
38
+ * Add a route to the router context.
39
+ */
40
+ function addRoute(ctx, method = "", path, data) {
41
+ method = method.toUpperCase();
42
+ if (path.charCodeAt(0) !== 47) path = `/${path}`;
43
+ const segments = splitPath(path);
44
+ let node = ctx.root;
45
+ let _unnamedParamIndex = 0;
46
+ const paramsMap = [];
47
+ const paramsRegexp = [];
48
+ for (let i = 0; i < segments.length; i++) {
49
+ const segment = segments[i];
50
+ if (segment.startsWith("**")) {
51
+ if (!node.wildcard) node.wildcard = { key: "**" };
52
+ node = node.wildcard;
53
+ paramsMap.push([
54
+ -i,
55
+ segment.split(":")[1] || "_",
56
+ segment.length === 2
57
+ ]);
58
+ break;
59
+ }
60
+ if (segment === "*" || segment.includes(":")) {
61
+ if (!node.param) node.param = { key: "*" };
62
+ node = node.param;
63
+ if (segment === "*") paramsMap.push([
64
+ i,
65
+ `_${_unnamedParamIndex++}`,
66
+ true
67
+ ]);
68
+ else if (segment.includes(":", 1)) {
69
+ const regexp = getParamRegexp(segment);
70
+ paramsRegexp[i] = regexp;
71
+ node.hasRegexParam = true;
72
+ paramsMap.push([
73
+ i,
74
+ regexp,
75
+ false
76
+ ]);
77
+ } else paramsMap.push([
78
+ i,
79
+ segment.slice(1),
80
+ false
81
+ ]);
82
+ continue;
83
+ }
84
+ const child = node.static?.[segment];
85
+ if (child) node = child;
86
+ else {
87
+ const staticNode = { key: segment };
88
+ if (!node.static) node.static = new NullProtoObj();
89
+ node.static[segment] = staticNode;
90
+ node = staticNode;
91
+ }
92
+ }
93
+ const hasParams = paramsMap.length > 0;
94
+ if (!node.methods) node.methods = new NullProtoObj();
95
+ node.methods[method] ??= [];
96
+ node.methods[method].push({
97
+ data: data || null,
98
+ paramsRegexp,
99
+ paramsMap: hasParams ? paramsMap : void 0
100
+ });
101
+ if (!hasParams) ctx.static[path] = node;
102
+ }
103
+ function getParamRegexp(segment) {
104
+ const regex = segment.replace(/:(\w+)/g, (_, id) => `(?<${id}>[^/]+)`).replace(/\./g, "\\.");
105
+ return /* @__PURE__ */ new RegExp(`^${regex}$`);
106
+ }
107
+ /**
108
+ * Find a route by path.
109
+ */
110
+ function findRoute(ctx, method = "", path, opts) {
111
+ if (path.charCodeAt(path.length - 1) === 47) path = path.slice(0, -1);
112
+ const staticNode = ctx.static[path];
113
+ if (staticNode && staticNode.methods) {
114
+ const staticMatch = staticNode.methods[method] || staticNode.methods[""];
115
+ if (staticMatch !== void 0) return staticMatch[0];
116
+ }
117
+ const segments = splitPath(path);
118
+ const match = _lookupTree(ctx, ctx.root, method, segments, 0)?.[0];
119
+ if (match === void 0) return;
120
+ if (opts?.params === false) return match;
121
+ return {
122
+ data: match.data,
123
+ params: match.paramsMap ? getMatchParams(segments, match.paramsMap) : void 0
124
+ };
125
+ }
126
+ function _lookupTree(ctx, node, method, segments, index) {
127
+ if (index === segments.length) {
128
+ if (node.methods) {
129
+ const match = node.methods[method] || node.methods[""];
130
+ if (match) return match;
131
+ }
132
+ if (node.param && node.param.methods) {
133
+ const match = node.param.methods[method] || node.param.methods[""];
134
+ if (match) {
135
+ const pMap = match[0].paramsMap;
136
+ if (pMap?.[pMap?.length - 1]?.[2]) return match;
137
+ }
138
+ }
139
+ if (node.wildcard && node.wildcard.methods) {
140
+ const match = node.wildcard.methods[method] || node.wildcard.methods[""];
141
+ if (match) {
142
+ const pMap = match[0].paramsMap;
143
+ if (pMap?.[pMap?.length - 1]?.[2]) return match;
144
+ }
145
+ }
146
+ return;
147
+ }
148
+ const segment = segments[index];
149
+ if (node.static) {
150
+ const staticChild = node.static[segment];
151
+ if (staticChild) {
152
+ const match = _lookupTree(ctx, staticChild, method, segments, index + 1);
153
+ if (match) return match;
154
+ }
155
+ }
156
+ if (node.param) {
157
+ const match = _lookupTree(ctx, node.param, method, segments, index + 1);
158
+ if (match) {
159
+ if (node.param.hasRegexParam) {
160
+ const exactMatch = match.find((m) => m.paramsRegexp[index]?.test(segment)) || match.find((m) => !m.paramsRegexp[index]);
161
+ return exactMatch ? [exactMatch] : void 0;
162
+ }
163
+ return match;
164
+ }
165
+ }
166
+ if (node.wildcard && node.wildcard.methods) return node.wildcard.methods[method] || node.wildcard.methods[""];
167
+ }
168
+
169
+ //#endregion
170
+ //#region ../../node_modules/.bun/@orpc+openapi@1.10.4+64f0629d09b745d9/node_modules/@orpc/openapi/dist/shared/openapi.DIt-Z9W1.mjs
171
+ var StandardOpenAPICodec = class {
172
+ constructor(serializer, options = {}) {
173
+ this.serializer = serializer;
174
+ this.customErrorResponseBodyEncoder = options.customErrorResponseBodyEncoder;
175
+ }
176
+ customErrorResponseBodyEncoder;
177
+ async decode(request, params, procedure) {
178
+ if (fallbackContractConfig("defaultInputStructure", procedure["~orpc"].route.inputStructure) === "compact") {
179
+ const data = request.method === "GET" ? this.serializer.deserialize(request.url.searchParams) : this.serializer.deserialize(await request.body());
180
+ if (data === void 0) return params;
181
+ if (isObject(data)) return {
182
+ ...params,
183
+ ...data
184
+ };
185
+ return data;
186
+ }
187
+ const deserializeSearchParams = () => {
188
+ return this.serializer.deserialize(request.url.searchParams);
189
+ };
190
+ return {
191
+ params,
192
+ get query() {
193
+ const value$1 = deserializeSearchParams();
194
+ Object.defineProperty(this, "query", {
195
+ value: value$1,
196
+ writable: true
197
+ });
198
+ return value$1;
199
+ },
200
+ set query(value$1) {
201
+ Object.defineProperty(this, "query", {
202
+ value: value$1,
203
+ writable: true
204
+ });
205
+ },
206
+ headers: request.headers,
207
+ body: this.serializer.deserialize(await request.body())
208
+ };
209
+ }
210
+ encode(output, procedure) {
211
+ const successStatus = fallbackContractConfig("defaultSuccessStatus", procedure["~orpc"].route.successStatus);
212
+ if (fallbackContractConfig("defaultOutputStructure", procedure["~orpc"].route.outputStructure) === "compact") return {
213
+ status: successStatus,
214
+ headers: {},
215
+ body: this.serializer.serialize(output)
216
+ };
217
+ if (!this.#isDetailedOutput(output)) throw new Error(`
218
+ Invalid "detailed" output structure:
219
+ \u2022 Expected an object with optional properties:
220
+ - status (number 200-399)
221
+ - headers (Record<string, string | string[]>)
222
+ - body (any)
223
+ \u2022 No extra keys allowed.
224
+
225
+ Actual value:
226
+ ${stringifyJSON(output)}
227
+ `);
228
+ return {
229
+ status: output.status ?? successStatus,
230
+ headers: output.headers ?? {},
231
+ body: this.serializer.serialize(output.body)
232
+ };
233
+ }
234
+ encodeError(error) {
235
+ const body = this.customErrorResponseBodyEncoder?.(error) ?? error.toJSON();
236
+ return {
237
+ status: error.status,
238
+ headers: {},
239
+ body: this.serializer.serialize(body, { outputFormat: "plain" })
240
+ };
241
+ }
242
+ #isDetailedOutput(output) {
243
+ if (!isObject(output)) return false;
244
+ if (output.headers && !isObject(output.headers)) return false;
245
+ if (output.status !== void 0 && (typeof output.status !== "number" || !Number.isInteger(output.status) || isORPCErrorStatus(output.status))) return false;
246
+ return true;
247
+ }
248
+ };
249
+ function toRou3Pattern(path) {
250
+ return standardizeHTTPPath(path).replace(/\/\{\+([^}]+)\}/g, "/**:$1").replace(/\/\{([^}]+)\}/g, "/:$1");
251
+ }
252
+ function decodeParams(params) {
253
+ return Object.fromEntries(Object.entries(params).map(([key, value$1]) => [key, tryDecodeURIComponent(value$1)]));
254
+ }
255
+ var StandardOpenAPIMatcher = class {
256
+ filter;
257
+ tree = createRouter();
258
+ pendingRouters = [];
259
+ constructor(options = {}) {
260
+ this.filter = options.filter ?? true;
261
+ }
262
+ init(router, path = []) {
263
+ const laziedOptions = traverseContractProcedures({
264
+ router,
265
+ path
266
+ }, (traverseOptions) => {
267
+ if (!value(this.filter, traverseOptions)) return;
268
+ const { path: path2, contract } = traverseOptions;
269
+ const method = fallbackContractConfig("defaultMethod", contract["~orpc"].route.method);
270
+ const httpPath = toRou3Pattern(contract["~orpc"].route.path ?? toHttpPath(path2));
271
+ if (isProcedure(contract)) addRoute(this.tree, method, httpPath, {
272
+ path: path2,
273
+ contract,
274
+ procedure: contract,
275
+ router
276
+ });
277
+ else addRoute(this.tree, method, httpPath, {
278
+ path: path2,
279
+ contract,
280
+ procedure: void 0,
281
+ router
282
+ });
283
+ });
284
+ this.pendingRouters.push(...laziedOptions.map((option) => ({
285
+ ...option,
286
+ httpPathPrefix: toHttpPath(option.path),
287
+ laziedPrefix: getLazyMeta(option.router).prefix
288
+ })));
289
+ }
290
+ async match(method, pathname) {
291
+ if (this.pendingRouters.length) {
292
+ const newPendingRouters = [];
293
+ for (const pendingRouter of this.pendingRouters) if (!pendingRouter.laziedPrefix || pathname.startsWith(pendingRouter.laziedPrefix) || pathname.startsWith(pendingRouter.httpPathPrefix)) {
294
+ const { default: router } = await unlazy(pendingRouter.router);
295
+ this.init(router, pendingRouter.path);
296
+ } else newPendingRouters.push(pendingRouter);
297
+ this.pendingRouters = newPendingRouters;
298
+ }
299
+ const match = findRoute(this.tree, method, pathname);
300
+ if (!match) return;
301
+ if (!match.data.procedure) {
302
+ const { default: maybeProcedure } = await unlazy(getRouter(match.data.router, match.data.path));
303
+ if (!isProcedure(maybeProcedure)) throw new Error(`
304
+ [Contract-First] Missing or invalid implementation for procedure at path: ${toHttpPath(match.data.path)}.
305
+ Ensure that the procedure is correctly defined and matches the expected contract.
306
+ `);
307
+ match.data.procedure = createContractedProcedure(maybeProcedure, match.data.contract);
308
+ }
309
+ return {
310
+ path: match.data.path,
311
+ procedure: match.data.procedure,
312
+ params: match.params ? decodeParams(match.params) : void 0
313
+ };
314
+ }
315
+ };
316
+ var StandardOpenAPIHandler = class extends StandardHandler {
317
+ constructor(router, options) {
318
+ const serializer = new StandardOpenAPISerializer(new StandardOpenAPIJsonSerializer(options), new StandardBracketNotationSerializer(options));
319
+ const matcher = new StandardOpenAPIMatcher(options);
320
+ const codec = new StandardOpenAPICodec(serializer, options);
321
+ super(router, matcher, codec, options);
322
+ }
323
+ };
324
+
325
+ //#endregion
326
+ //#region ../../node_modules/.bun/@orpc+openapi@1.10.4+64f0629d09b745d9/node_modules/@orpc/openapi/dist/adapters/fetch/index.mjs
327
+ var OpenAPIHandler = class extends FetchHandler {
328
+ constructor(router, options = {}) {
329
+ super(new StandardOpenAPIHandler(router, options), options);
330
+ }
331
+ };
332
+
333
+ //#endregion
334
+ export { OpenAPIHandler };
335
+ //# sourceMappingURL=fetch-8DauUFDh.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-8DauUFDh.mjs","names":["value","#isDetailedOutput"],"sources":["../../../node_modules/.bun/rou3@0.7.10/node_modules/rou3/dist/index.mjs","../../../node_modules/.bun/@orpc+openapi@1.10.4+64f0629d09b745d9/node_modules/@orpc/openapi/dist/shared/openapi.DIt-Z9W1.mjs","../../../node_modules/.bun/@orpc+openapi@1.10.4+64f0629d09b745d9/node_modules/@orpc/openapi/dist/adapters/fetch/index.mjs"],"sourcesContent":["const NullProtoObj = /* @__PURE__ */ (() => {\n\tconst e = function() {};\n\treturn e.prototype = Object.create(null), Object.freeze(e.prototype), e;\n})();\n\n/**\n* Create a new router context.\n*/\nfunction createRouter() {\n\treturn {\n\t\troot: { key: \"\" },\n\t\tstatic: new NullProtoObj()\n\t};\n}\n\nfunction splitPath(path) {\n\tconst [_, ...s] = path.split(\"/\");\n\treturn s[s.length - 1] === \"\" ? s.slice(0, -1) : s;\n}\nfunction getMatchParams(segments, paramsMap) {\n\tconst params = new NullProtoObj();\n\tfor (const [index, name] of paramsMap) {\n\t\tconst segment = index < 0 ? segments.slice(-1 * index).join(\"/\") : segments[index];\n\t\tif (typeof name === \"string\") params[name] = segment;\n\t\telse {\n\t\t\tconst match = segment.match(name);\n\t\t\tif (match) for (const key in match.groups) params[key] = match.groups[key];\n\t\t}\n\t}\n\treturn params;\n}\n\n/**\n* Add a route to the router context.\n*/\nfunction addRoute(ctx, method = \"\", path, data) {\n\tmethod = method.toUpperCase();\n\tif (path.charCodeAt(0) !== 47) path = `/${path}`;\n\tconst segments = splitPath(path);\n\tlet node = ctx.root;\n\tlet _unnamedParamIndex = 0;\n\tconst paramsMap = [];\n\tconst paramsRegexp = [];\n\tfor (let i = 0; i < segments.length; i++) {\n\t\tconst segment = segments[i];\n\t\tif (segment.startsWith(\"**\")) {\n\t\t\tif (!node.wildcard) node.wildcard = { key: \"**\" };\n\t\t\tnode = node.wildcard;\n\t\t\tparamsMap.push([\n\t\t\t\t-i,\n\t\t\t\tsegment.split(\":\")[1] || \"_\",\n\t\t\t\tsegment.length === 2\n\t\t\t]);\n\t\t\tbreak;\n\t\t}\n\t\tif (segment === \"*\" || segment.includes(\":\")) {\n\t\t\tif (!node.param) node.param = { key: \"*\" };\n\t\t\tnode = node.param;\n\t\t\tif (segment === \"*\") paramsMap.push([\n\t\t\t\ti,\n\t\t\t\t`_${_unnamedParamIndex++}`,\n\t\t\t\ttrue\n\t\t\t]);\n\t\t\telse if (segment.includes(\":\", 1)) {\n\t\t\t\tconst regexp = getParamRegexp(segment);\n\t\t\t\tparamsRegexp[i] = regexp;\n\t\t\t\tnode.hasRegexParam = true;\n\t\t\t\tparamsMap.push([\n\t\t\t\t\ti,\n\t\t\t\t\tregexp,\n\t\t\t\t\tfalse\n\t\t\t\t]);\n\t\t\t} else paramsMap.push([\n\t\t\t\ti,\n\t\t\t\tsegment.slice(1),\n\t\t\t\tfalse\n\t\t\t]);\n\t\t\tcontinue;\n\t\t}\n\t\tconst child = node.static?.[segment];\n\t\tif (child) node = child;\n\t\telse {\n\t\t\tconst staticNode = { key: segment };\n\t\t\tif (!node.static) node.static = new NullProtoObj();\n\t\t\tnode.static[segment] = staticNode;\n\t\t\tnode = staticNode;\n\t\t}\n\t}\n\tconst hasParams = paramsMap.length > 0;\n\tif (!node.methods) node.methods = new NullProtoObj();\n\tnode.methods[method] ??= [];\n\tnode.methods[method].push({\n\t\tdata: data || null,\n\t\tparamsRegexp,\n\t\tparamsMap: hasParams ? paramsMap : void 0\n\t});\n\tif (!hasParams) ctx.static[path] = node;\n}\nfunction getParamRegexp(segment) {\n\tconst regex = segment.replace(/:(\\w+)/g, (_, id) => `(?<${id}>[^/]+)`).replace(/\\./g, \"\\\\.\");\n\treturn /* @__PURE__ */ new RegExp(`^${regex}$`);\n}\n\n/**\n* Find a route by path.\n*/\nfunction findRoute(ctx, method = \"\", path, opts) {\n\tif (path.charCodeAt(path.length - 1) === 47) path = path.slice(0, -1);\n\tconst staticNode = ctx.static[path];\n\tif (staticNode && staticNode.methods) {\n\t\tconst staticMatch = staticNode.methods[method] || staticNode.methods[\"\"];\n\t\tif (staticMatch !== void 0) return staticMatch[0];\n\t}\n\tconst segments = splitPath(path);\n\tconst match = _lookupTree(ctx, ctx.root, method, segments, 0)?.[0];\n\tif (match === void 0) return;\n\tif (opts?.params === false) return match;\n\treturn {\n\t\tdata: match.data,\n\t\tparams: match.paramsMap ? getMatchParams(segments, match.paramsMap) : void 0\n\t};\n}\nfunction _lookupTree(ctx, node, method, segments, index) {\n\tif (index === segments.length) {\n\t\tif (node.methods) {\n\t\t\tconst match = node.methods[method] || node.methods[\"\"];\n\t\t\tif (match) return match;\n\t\t}\n\t\tif (node.param && node.param.methods) {\n\t\t\tconst match = node.param.methods[method] || node.param.methods[\"\"];\n\t\t\tif (match) {\n\t\t\t\tconst pMap = match[0].paramsMap;\n\t\t\t\tif (pMap?.[pMap?.length - 1]?.[2]) return match;\n\t\t\t}\n\t\t}\n\t\tif (node.wildcard && node.wildcard.methods) {\n\t\t\tconst match = node.wildcard.methods[method] || node.wildcard.methods[\"\"];\n\t\t\tif (match) {\n\t\t\t\tconst pMap = match[0].paramsMap;\n\t\t\t\tif (pMap?.[pMap?.length - 1]?.[2]) return match;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\tconst segment = segments[index];\n\tif (node.static) {\n\t\tconst staticChild = node.static[segment];\n\t\tif (staticChild) {\n\t\t\tconst match = _lookupTree(ctx, staticChild, method, segments, index + 1);\n\t\t\tif (match) return match;\n\t\t}\n\t}\n\tif (node.param) {\n\t\tconst match = _lookupTree(ctx, node.param, method, segments, index + 1);\n\t\tif (match) {\n\t\t\tif (node.param.hasRegexParam) {\n\t\t\t\tconst exactMatch = match.find((m) => m.paramsRegexp[index]?.test(segment)) || match.find((m) => !m.paramsRegexp[index]);\n\t\t\t\treturn exactMatch ? [exactMatch] : void 0;\n\t\t\t}\n\t\t\treturn match;\n\t\t}\n\t}\n\tif (node.wildcard && node.wildcard.methods) return node.wildcard.methods[method] || node.wildcard.methods[\"\"];\n}\n\n/**\n* Remove a route from the router context.\n*/\nfunction removeRoute(ctx, method, path) {\n\tconst segments = splitPath(path);\n\treturn _remove(ctx.root, method || \"\", segments, 0);\n}\nfunction _remove(node, method, segments, index) {\n\tif (index === segments.length) {\n\t\tif (node.methods && method in node.methods) {\n\t\t\tdelete node.methods[method];\n\t\t\tif (Object.keys(node.methods).length === 0) node.methods = void 0;\n\t\t}\n\t\treturn;\n\t}\n\tconst segment = segments[index];\n\tif (segment === \"*\") {\n\t\tif (node.param) {\n\t\t\t_remove(node.param, method, segments, index + 1);\n\t\t\tif (_isEmptyNode(node.param)) node.param = void 0;\n\t\t}\n\t\treturn;\n\t}\n\tif (segment.startsWith(\"**\")) {\n\t\tif (node.wildcard) {\n\t\t\t_remove(node.wildcard, method, segments, index + 1);\n\t\t\tif (_isEmptyNode(node.wildcard)) node.wildcard = void 0;\n\t\t}\n\t\treturn;\n\t}\n\tconst childNode = node.static?.[segment];\n\tif (childNode) {\n\t\t_remove(childNode, method, segments, index + 1);\n\t\tif (_isEmptyNode(childNode)) {\n\t\t\tdelete node.static[segment];\n\t\t\tif (Object.keys(node.static).length === 0) node.static = void 0;\n\t\t}\n\t}\n}\nfunction _isEmptyNode(node) {\n\treturn node.methods === void 0 && node.static === void 0 && node.param === void 0 && node.wildcard === void 0;\n}\n\n/**\n* Find all route patterns that match the given path.\n*/\nfunction findAllRoutes(ctx, method = \"\", path, opts) {\n\tif (path.charCodeAt(path.length - 1) === 47) path = path.slice(0, -1);\n\tconst segments = splitPath(path);\n\tconst matches = _findAll(ctx, ctx.root, method, segments, 0);\n\tif (opts?.params === false) return matches;\n\treturn matches.map((m) => {\n\t\treturn {\n\t\t\tdata: m.data,\n\t\t\tparams: m.paramsMap ? getMatchParams(segments, m.paramsMap) : void 0\n\t\t};\n\t});\n}\nfunction _findAll(ctx, node, method, segments, index, matches = []) {\n\tconst segment = segments[index];\n\tif (node.wildcard && node.wildcard.methods) {\n\t\tconst match = node.wildcard.methods[method] || node.wildcard.methods[\"\"];\n\t\tif (match) matches.push(...match);\n\t}\n\tif (node.param) {\n\t\t_findAll(ctx, node.param, method, segments, index + 1, matches);\n\t\tif (index === segments.length && node.param.methods) {\n\t\t\tconst match = node.param.methods[method] || node.param.methods[\"\"];\n\t\t\tif (match) {\n\t\t\t\tconst pMap = match[0].paramsMap;\n\t\t\t\tif (pMap?.[pMap?.length - 1]?.[2]) matches.push(...match);\n\t\t\t}\n\t\t}\n\t}\n\tconst staticChild = node.static?.[segment];\n\tif (staticChild) _findAll(ctx, staticChild, method, segments, index + 1, matches);\n\tif (index === segments.length && node.methods) {\n\t\tconst match = node.methods[method] || node.methods[\"\"];\n\t\tif (match) matches.push(...match);\n\t}\n\treturn matches;\n}\n\nfunction routeToRegExp(route = \"/\") {\n\tconst reSegments = [];\n\tlet idCtr = 0;\n\tfor (const segment of route.split(\"/\")) {\n\t\tif (!segment) continue;\n\t\tif (segment === \"*\") reSegments.push(`(?<_${idCtr++}>[^/]*)`);\n\t\telse if (segment.startsWith(\"**\")) reSegments.push(segment === \"**\" ? \"?(?<_>.*)\" : `?(?<${segment.slice(3)}>.+)`);\n\t\telse if (segment.includes(\":\")) reSegments.push(segment.replace(/:(\\w+)/g, (_, id) => `(?<${id}>[^/]+)`).replace(/\\./g, \"\\\\.\"));\n\t\telse reSegments.push(segment);\n\t}\n\treturn /* @__PURE__ */ new RegExp(`^/${reSegments.join(\"/\")}/?$`);\n}\n\nexport { NullProtoObj, addRoute, createRouter, findAllRoutes, findRoute, removeRoute, routeToRegExp };","import { standardizeHTTPPath, StandardOpenAPIJsonSerializer, StandardBracketNotationSerializer, StandardOpenAPISerializer } from '@orpc/openapi-client/standard';\nimport { StandardHandler } from '@orpc/server/standard';\nimport { isORPCErrorStatus } from '@orpc/client';\nimport { fallbackContractConfig } from '@orpc/contract';\nimport { isObject, stringifyJSON, tryDecodeURIComponent, value } from '@orpc/shared';\nimport { toHttpPath } from '@orpc/client/standard';\nimport { traverseContractProcedures, isProcedure, getLazyMeta, unlazy, getRouter, createContractedProcedure } from '@orpc/server';\nimport { createRouter, addRoute, findRoute } from 'rou3';\n\nclass StandardOpenAPICodec {\n constructor(serializer, options = {}) {\n this.serializer = serializer;\n this.customErrorResponseBodyEncoder = options.customErrorResponseBodyEncoder;\n }\n customErrorResponseBodyEncoder;\n async decode(request, params, procedure) {\n const inputStructure = fallbackContractConfig(\"defaultInputStructure\", procedure[\"~orpc\"].route.inputStructure);\n if (inputStructure === \"compact\") {\n const data = request.method === \"GET\" ? this.serializer.deserialize(request.url.searchParams) : this.serializer.deserialize(await request.body());\n if (data === void 0) {\n return params;\n }\n if (isObject(data)) {\n return {\n ...params,\n ...data\n };\n }\n return data;\n }\n const deserializeSearchParams = () => {\n return this.serializer.deserialize(request.url.searchParams);\n };\n return {\n params,\n get query() {\n const value = deserializeSearchParams();\n Object.defineProperty(this, \"query\", { value, writable: true });\n return value;\n },\n set query(value) {\n Object.defineProperty(this, \"query\", { value, writable: true });\n },\n headers: request.headers,\n body: this.serializer.deserialize(await request.body())\n };\n }\n encode(output, procedure) {\n const successStatus = fallbackContractConfig(\"defaultSuccessStatus\", procedure[\"~orpc\"].route.successStatus);\n const outputStructure = fallbackContractConfig(\"defaultOutputStructure\", procedure[\"~orpc\"].route.outputStructure);\n if (outputStructure === \"compact\") {\n return {\n status: successStatus,\n headers: {},\n body: this.serializer.serialize(output)\n };\n }\n if (!this.#isDetailedOutput(output)) {\n throw new Error(`\n Invalid \"detailed\" output structure:\n \\u2022 Expected an object with optional properties:\n - status (number 200-399)\n - headers (Record<string, string | string[]>)\n - body (any)\n \\u2022 No extra keys allowed.\n\n Actual value:\n ${stringifyJSON(output)}\n `);\n }\n return {\n status: output.status ?? successStatus,\n headers: output.headers ?? {},\n body: this.serializer.serialize(output.body)\n };\n }\n encodeError(error) {\n const body = this.customErrorResponseBodyEncoder?.(error) ?? error.toJSON();\n return {\n status: error.status,\n headers: {},\n body: this.serializer.serialize(body, { outputFormat: \"plain\" })\n };\n }\n #isDetailedOutput(output) {\n if (!isObject(output)) {\n return false;\n }\n if (output.headers && !isObject(output.headers)) {\n return false;\n }\n if (output.status !== void 0 && (typeof output.status !== \"number\" || !Number.isInteger(output.status) || isORPCErrorStatus(output.status))) {\n return false;\n }\n return true;\n }\n}\n\nfunction toRou3Pattern(path) {\n return standardizeHTTPPath(path).replace(/\\/\\{\\+([^}]+)\\}/g, \"/**:$1\").replace(/\\/\\{([^}]+)\\}/g, \"/:$1\");\n}\nfunction decodeParams(params) {\n return Object.fromEntries(Object.entries(params).map(([key, value]) => [key, tryDecodeURIComponent(value)]));\n}\n\nclass StandardOpenAPIMatcher {\n filter;\n tree = createRouter();\n pendingRouters = [];\n constructor(options = {}) {\n this.filter = options.filter ?? true;\n }\n init(router, path = []) {\n const laziedOptions = traverseContractProcedures({ router, path }, (traverseOptions) => {\n if (!value(this.filter, traverseOptions)) {\n return;\n }\n const { path: path2, contract } = traverseOptions;\n const method = fallbackContractConfig(\"defaultMethod\", contract[\"~orpc\"].route.method);\n const httpPath = toRou3Pattern(contract[\"~orpc\"].route.path ?? toHttpPath(path2));\n if (isProcedure(contract)) {\n addRoute(this.tree, method, httpPath, {\n path: path2,\n contract,\n procedure: contract,\n // this mean dev not used contract-first so we can used contract as procedure directly\n router\n });\n } else {\n addRoute(this.tree, method, httpPath, {\n path: path2,\n contract,\n procedure: void 0,\n router\n });\n }\n });\n this.pendingRouters.push(...laziedOptions.map((option) => ({\n ...option,\n httpPathPrefix: toHttpPath(option.path),\n laziedPrefix: getLazyMeta(option.router).prefix\n })));\n }\n async match(method, pathname) {\n if (this.pendingRouters.length) {\n const newPendingRouters = [];\n for (const pendingRouter of this.pendingRouters) {\n if (!pendingRouter.laziedPrefix || pathname.startsWith(pendingRouter.laziedPrefix) || pathname.startsWith(pendingRouter.httpPathPrefix)) {\n const { default: router } = await unlazy(pendingRouter.router);\n this.init(router, pendingRouter.path);\n } else {\n newPendingRouters.push(pendingRouter);\n }\n }\n this.pendingRouters = newPendingRouters;\n }\n const match = findRoute(this.tree, method, pathname);\n if (!match) {\n return void 0;\n }\n if (!match.data.procedure) {\n const { default: maybeProcedure } = await unlazy(getRouter(match.data.router, match.data.path));\n if (!isProcedure(maybeProcedure)) {\n throw new Error(`\n [Contract-First] Missing or invalid implementation for procedure at path: ${toHttpPath(match.data.path)}.\n Ensure that the procedure is correctly defined and matches the expected contract.\n `);\n }\n match.data.procedure = createContractedProcedure(maybeProcedure, match.data.contract);\n }\n return {\n path: match.data.path,\n procedure: match.data.procedure,\n params: match.params ? decodeParams(match.params) : void 0\n };\n }\n}\n\nclass StandardOpenAPIHandler extends StandardHandler {\n constructor(router, options) {\n const jsonSerializer = new StandardOpenAPIJsonSerializer(options);\n const bracketNotationSerializer = new StandardBracketNotationSerializer(options);\n const serializer = new StandardOpenAPISerializer(jsonSerializer, bracketNotationSerializer);\n const matcher = new StandardOpenAPIMatcher(options);\n const codec = new StandardOpenAPICodec(serializer, options);\n super(router, matcher, codec, options);\n }\n}\n\nexport { StandardOpenAPICodec as S, StandardOpenAPIHandler as a, StandardOpenAPIMatcher as b, decodeParams as d, toRou3Pattern as t };\n","import { FetchHandler } from '@orpc/server/fetch';\nimport '@orpc/client';\nimport '@orpc/contract';\nimport '@orpc/shared';\nimport { a as StandardOpenAPIHandler } from '../../shared/openapi.DIt-Z9W1.mjs';\nimport '@orpc/client/standard';\nimport '@orpc/server';\nimport 'rou3';\nimport '@orpc/openapi-client/standard';\nimport '@orpc/server/standard';\n\nclass OpenAPIHandler extends FetchHandler {\n constructor(router, options = {}) {\n super(new StandardOpenAPIHandler(router, options), options);\n }\n}\n\nexport { OpenAPIHandler };\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;AAAA,MAAM,eAA+B,uBAAO;CAC3C,MAAM,IAAI,WAAW;AACrB,QAAO,EAAE,YAAY,OAAO,OAAO,KAAK,EAAE,OAAO,OAAO,EAAE,UAAU,EAAE;IACnE;;;;AAKJ,SAAS,eAAe;AACvB,QAAO;EACN,MAAM,EAAE,KAAK,IAAI;EACjB,QAAQ,IAAI,cAAc;EAC1B;;AAGF,SAAS,UAAU,MAAM;CACxB,MAAM,CAAC,GAAG,GAAG,KAAK,KAAK,MAAM,IAAI;AACjC,QAAO,EAAE,EAAE,SAAS,OAAO,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG;;AAElD,SAAS,eAAe,UAAU,WAAW;CAC5C,MAAM,SAAS,IAAI,cAAc;AACjC,MAAK,MAAM,CAAC,OAAO,SAAS,WAAW;EACtC,MAAM,UAAU,QAAQ,IAAI,SAAS,MAAM,KAAK,MAAM,CAAC,KAAK,IAAI,GAAG,SAAS;AAC5E,MAAI,OAAO,SAAS,SAAU,QAAO,QAAQ;OACxC;GACJ,MAAM,QAAQ,QAAQ,MAAM,KAAK;AACjC,OAAI,MAAO,MAAK,MAAM,OAAO,MAAM,OAAQ,QAAO,OAAO,MAAM,OAAO;;;AAGxE,QAAO;;;;;AAMR,SAAS,SAAS,KAAK,SAAS,IAAI,MAAM,MAAM;AAC/C,UAAS,OAAO,aAAa;AAC7B,KAAI,KAAK,WAAW,EAAE,KAAK,GAAI,QAAO,IAAI;CAC1C,MAAM,WAAW,UAAU,KAAK;CAChC,IAAI,OAAO,IAAI;CACf,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