@orpc/openapi 0.0.0-next.d137cdf → 0.0.0-next.d17ef5e

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 (36) hide show
  1. package/README.md +103 -0
  2. package/dist/adapters/fetch/index.d.mts +11 -0
  3. package/dist/adapters/fetch/index.d.ts +11 -0
  4. package/dist/adapters/fetch/index.mjs +11 -0
  5. package/dist/adapters/hono/index.d.mts +6 -0
  6. package/dist/adapters/hono/index.d.ts +6 -0
  7. package/dist/adapters/hono/index.mjs +11 -0
  8. package/dist/adapters/next/index.d.mts +6 -0
  9. package/dist/adapters/next/index.d.ts +6 -0
  10. package/dist/adapters/next/index.mjs +11 -0
  11. package/dist/adapters/node/index.d.mts +11 -0
  12. package/dist/adapters/node/index.d.ts +11 -0
  13. package/dist/adapters/node/index.mjs +23 -0
  14. package/dist/adapters/standard/index.d.mts +35 -0
  15. package/dist/adapters/standard/index.d.ts +35 -0
  16. package/dist/adapters/standard/index.mjs +7 -0
  17. package/dist/index.d.mts +120 -0
  18. package/dist/index.d.ts +120 -0
  19. package/dist/index.mjs +303 -0
  20. package/dist/shared/openapi.BNHmrMe2.mjs +145 -0
  21. package/dist/shared/openapi.DZzpQAb-.mjs +231 -0
  22. package/dist/shared/openapi.G9ZZkQ6q.mjs +19 -0
  23. package/dist/shared/openapi.IfmmOyba.d.mts +8 -0
  24. package/dist/shared/openapi.IfmmOyba.d.ts +8 -0
  25. package/package.json +36 -22
  26. package/dist/chunk-KZIT2WCV.js +0 -49
  27. package/dist/fetch.js +0 -706
  28. package/dist/index.js +0 -4441
  29. package/dist/src/fetch/base-handler.d.ts +0 -15
  30. package/dist/src/fetch/index.d.ts +0 -4
  31. package/dist/src/fetch/server-handler.d.ts +0 -3
  32. package/dist/src/fetch/serverless-handler.d.ts +0 -3
  33. package/dist/src/generator.d.ts +0 -24
  34. package/dist/src/index.d.ts +0 -3
  35. package/dist/src/utils.d.ts +0 -16
  36. package/dist/src/zod-to-json-schema.d.ts +0 -43
@@ -0,0 +1,8 @@
1
+ import { StandardOpenAPIJsonSerializerOptions } from '@orpc/openapi-client/standard';
2
+ import { Context } from '@orpc/server';
3
+ import { StandardHandlerOptions } from '@orpc/server/standard';
4
+
5
+ interface StandardOpenAPIHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, StandardOpenAPIJsonSerializerOptions {
6
+ }
7
+
8
+ export type { StandardOpenAPIHandlerOptions as S };
@@ -0,0 +1,8 @@
1
+ import { StandardOpenAPIJsonSerializerOptions } from '@orpc/openapi-client/standard';
2
+ import { Context } from '@orpc/server';
3
+ import { StandardHandlerOptions } from '@orpc/server/standard';
4
+
5
+ interface StandardOpenAPIHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, StandardOpenAPIJsonSerializerOptions {
6
+ }
7
+
8
+ export type { StandardOpenAPIHandlerOptions as S };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/openapi",
3
3
  "type": "module",
4
- "version": "0.0.0-next.d137cdf",
4
+ "version": "0.0.0-next.d17ef5e",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -15,41 +15,55 @@
15
15
  ],
16
16
  "exports": {
17
17
  ".": {
18
- "types": "./dist/src/index.d.ts",
19
- "import": "./dist/index.js",
20
- "default": "./dist/index.js"
18
+ "types": "./dist/index.d.mts",
19
+ "import": "./dist/index.mjs",
20
+ "default": "./dist/index.mjs"
21
+ },
22
+ "./standard": {
23
+ "types": "./dist/adapters/standard/index.d.mts",
24
+ "import": "./dist/adapters/standard/index.mjs",
25
+ "default": "./dist/adapters/standard/index.mjs"
21
26
  },
22
27
  "./fetch": {
23
- "types": "./dist/src/fetch/index.d.ts",
24
- "import": "./dist/fetch.js",
25
- "default": "./dist/fetch.js"
28
+ "types": "./dist/adapters/fetch/index.d.mts",
29
+ "import": "./dist/adapters/fetch/index.mjs",
30
+ "default": "./dist/adapters/fetch/index.mjs"
31
+ },
32
+ "./hono": {
33
+ "types": "./dist/adapters/hono/index.d.mts",
34
+ "import": "./dist/adapters/hono/index.mjs",
35
+ "default": "./dist/adapters/hono/index.mjs"
36
+ },
37
+ "./next": {
38
+ "types": "./dist/adapters/next/index.d.mts",
39
+ "import": "./dist/adapters/next/index.mjs",
40
+ "default": "./dist/adapters/next/index.mjs"
26
41
  },
27
- "./🔒/*": {
28
- "types": "./dist/src/*.d.ts"
42
+ "./node": {
43
+ "types": "./dist/adapters/node/index.d.mts",
44
+ "import": "./dist/adapters/node/index.mjs",
45
+ "default": "./dist/adapters/node/index.mjs"
29
46
  }
30
47
  },
31
48
  "files": [
32
- "!**/*.map",
33
- "!**/*.tsbuildinfo",
34
49
  "dist"
35
50
  ],
36
51
  "dependencies": {
37
- "escape-string-regexp": "^5.0.0",
38
52
  "json-schema-typed": "^8.0.1",
39
- "openapi3-ts": "^4.4.0",
40
- "@orpc/contract": "0.0.0-next.d137cdf",
41
- "@orpc/server": "0.0.0-next.d137cdf",
42
- "@orpc/shared": "0.0.0-next.d137cdf",
43
- "@orpc/transformer": "0.0.0-next.d137cdf",
44
- "@orpc/zod": "0.0.0-next.d137cdf"
53
+ "openapi-types": "^12.1.3",
54
+ "rou3": "^0.5.1",
55
+ "@orpc/client": "0.0.0-next.d17ef5e",
56
+ "@orpc/contract": "0.0.0-next.d17ef5e",
57
+ "@orpc/shared": "0.0.0-next.d17ef5e",
58
+ "@orpc/openapi-client": "0.0.0-next.d17ef5e",
59
+ "@orpc/server": "0.0.0-next.d17ef5e",
60
+ "@orpc/standard-server": "0.0.0-next.d17ef5e"
45
61
  },
46
62
  "devDependencies": {
47
- "@readme/openapi-parser": "^2.6.0",
48
- "hono": "^4.6.12",
49
- "zod": "^3.23.8"
63
+ "zod": "^3.24.2"
50
64
  },
51
65
  "scripts": {
52
- "build": "tsup --clean --sourcemap --entry.index=src/index.ts --entry.fetch=src/fetch/index.ts --format=esm --onSuccess='tsc -b --noCheck'",
66
+ "build": "unbuild",
53
67
  "build:watch": "pnpm run build --watch",
54
68
  "type:check": "tsc -b"
55
69
  }
@@ -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