@orpc/openapi 0.0.0-next.9306271 → 0.0.0-next.93e7a4c
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-UPDKQRQG.js +665 -0
- package/dist/fetch.js +27 -704
- package/dist/index.js +86 -55
- package/dist/src/fetch/bracket-notation.d.ts +84 -0
- package/dist/src/fetch/index.d.ts +9 -3
- package/dist/src/fetch/input-builder-full.d.ts +11 -0
- package/dist/src/fetch/input-builder-simple.d.ts +6 -0
- package/dist/src/fetch/openapi-handler-server.d.ts +7 -0
- package/dist/src/fetch/openapi-handler-serverless.d.ts +7 -0
- package/dist/src/fetch/openapi-handler.d.ts +28 -0
- package/dist/src/fetch/openapi-payload-codec.d.ts +13 -0
- package/dist/src/fetch/openapi-procedure-matcher.d.ts +19 -0
- package/dist/src/fetch/schema-coercer.d.ts +10 -0
- package/dist/src/generator.d.ts +4 -2
- package/dist/src/utils.d.ts +6 -5
- package/dist/src/zod-to-json-schema.d.ts +2 -2
- package/package.json +10 -7
- package/dist/chunk-KZIT2WCV.js +0 -49
- package/dist/src/fetch/base-handler.d.ts +0 -15
- package/dist/src/fetch/server-handler.d.ts +0 -3
- package/dist/src/fetch/serverless-handler.d.ts +0 -3
package/dist/chunk-KZIT2WCV.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// src/utils.ts
|
|
2
|
-
import { isContractProcedure } from "@orpc/contract";
|
|
3
|
-
import { isLazy, isProcedure, ROUTER_CONTRACT_SYMBOL } from "@orpc/server";
|
|
4
|
-
function eachContractProcedureLeaf(options, callback, result = [], isCurrentRouterContract = false) {
|
|
5
|
-
if (!isCurrentRouterContract && ROUTER_CONTRACT_SYMBOL in options.router && options.router[ROUTER_CONTRACT_SYMBOL]) {
|
|
6
|
-
return eachContractProcedureLeaf(
|
|
7
|
-
{
|
|
8
|
-
path: options.path,
|
|
9
|
-
router: options.router[ROUTER_CONTRACT_SYMBOL]
|
|
10
|
-
},
|
|
11
|
-
callback,
|
|
12
|
-
result,
|
|
13
|
-
true
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
if (isLazy(options.router)) {
|
|
17
|
-
result.push({
|
|
18
|
-
lazy: options.router,
|
|
19
|
-
path: options.path
|
|
20
|
-
});
|
|
21
|
-
} else if (isProcedure(options.router)) {
|
|
22
|
-
callback({
|
|
23
|
-
contract: options.router.zz$p.contract,
|
|
24
|
-
path: options.path
|
|
25
|
-
});
|
|
26
|
-
} else if (isContractProcedure(options.router)) {
|
|
27
|
-
callback({
|
|
28
|
-
contract: options.router,
|
|
29
|
-
path: options.path
|
|
30
|
-
});
|
|
31
|
-
} else {
|
|
32
|
-
for (const key in options.router) {
|
|
33
|
-
eachContractProcedureLeaf(
|
|
34
|
-
{
|
|
35
|
-
router: options.router[key],
|
|
36
|
-
path: [...options.path, key]
|
|
37
|
-
},
|
|
38
|
-
callback,
|
|
39
|
-
result
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return result;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export {
|
|
47
|
-
eachContractProcedureLeaf
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=chunk-KZIT2WCV.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { HTTPPath } from '@orpc/contract';
|
|
2
|
-
import type { ANY_LAZY_PROCEDURE, ANY_PROCEDURE, Router } from '@orpc/server';
|
|
3
|
-
import type { FetchHandler } from '@orpc/server/fetch';
|
|
4
|
-
import type { Router as HonoRouter } from 'hono/router';
|
|
5
|
-
export type ResolveRouter = (router: Router<any>, method: string, pathname: string) => Promise<{
|
|
6
|
-
path: string[];
|
|
7
|
-
procedure: ANY_PROCEDURE | ANY_LAZY_PROCEDURE;
|
|
8
|
-
params: Record<string, string>;
|
|
9
|
-
} | undefined>;
|
|
10
|
-
type Routing = HonoRouter<string[]>;
|
|
11
|
-
export declare function createOpenAPIHandler(createHonoRouter: () => Routing): FetchHandler;
|
|
12
|
-
export declare function createResolveRouter(createHonoRouter: () => Routing): ResolveRouter;
|
|
13
|
-
export declare function openAPIPathToRouterPath(path: HTTPPath): string;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=base-handler.d.ts.map
|