@orpc/openapi 0.0.0-next.fea68c1 → 0.0.0-next.ff41b3a

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 (49) hide show
  1. package/README.md +27 -18
  2. package/dist/adapters/fetch/index.d.mts +17 -0
  3. package/dist/adapters/fetch/index.d.ts +17 -0
  4. package/dist/adapters/fetch/index.mjs +17 -0
  5. package/dist/adapters/node/index.d.mts +17 -0
  6. package/dist/adapters/node/index.d.ts +17 -0
  7. package/dist/adapters/node/index.mjs +17 -0
  8. package/dist/adapters/standard/index.d.mts +34 -0
  9. package/dist/adapters/standard/index.d.ts +34 -0
  10. package/dist/adapters/standard/index.mjs +8 -0
  11. package/dist/index.d.mts +131 -0
  12. package/dist/index.d.ts +131 -0
  13. package/dist/index.mjs +545 -0
  14. package/dist/shared/openapi.D3j94c9n.d.mts +12 -0
  15. package/dist/shared/openapi.D3j94c9n.d.ts +12 -0
  16. package/dist/{chunk-LTTK3H5J.js → shared/openapi.p5tsmBXx.mjs} +39 -38
  17. package/package.json +23 -39
  18. package/dist/chunk-PW7RAFQQ.js +0 -32
  19. package/dist/chunk-XGHV4TH3.js +0 -13
  20. package/dist/fetch.js +0 -9
  21. package/dist/hono.js +0 -9
  22. package/dist/index.js +0 -701
  23. package/dist/next.js +0 -9
  24. package/dist/node.js +0 -30
  25. package/dist/src/adapters/fetch/index.d.ts +0 -2
  26. package/dist/src/adapters/fetch/openapi-handler.d.ts +0 -11
  27. package/dist/src/adapters/hono/index.d.ts +0 -2
  28. package/dist/src/adapters/next/index.d.ts +0 -2
  29. package/dist/src/adapters/node/index.d.ts +0 -2
  30. package/dist/src/adapters/node/openapi-handler.d.ts +0 -11
  31. package/dist/src/adapters/standard/index.d.ts +0 -4
  32. package/dist/src/adapters/standard/openapi-codec.d.ts +0 -13
  33. package/dist/src/adapters/standard/openapi-handler.d.ts +0 -5
  34. package/dist/src/adapters/standard/openapi-matcher.d.ts +0 -10
  35. package/dist/src/index.d.ts +0 -16
  36. package/dist/src/openapi-content-builder.d.ts +0 -10
  37. package/dist/src/openapi-error.d.ts +0 -3
  38. package/dist/src/openapi-generator.d.ts +0 -67
  39. package/dist/src/openapi-input-structure-parser.d.ts +0 -22
  40. package/dist/src/openapi-operation-extender.d.ts +0 -7
  41. package/dist/src/openapi-output-structure-parser.d.ts +0 -18
  42. package/dist/src/openapi-parameters-builder.d.ts +0 -12
  43. package/dist/src/openapi-path-parser.d.ts +0 -8
  44. package/dist/src/openapi.d.ts +0 -3
  45. package/dist/src/schema-converter.d.ts +0 -16
  46. package/dist/src/schema-utils.d.ts +0 -11
  47. package/dist/src/schema.d.ts +0 -12
  48. package/dist/src/utils.d.ts +0 -4
  49. package/dist/standard.js +0 -10
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.fea68c1",
4
+ "version": "0.0.0-next.ff41b3a",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -15,61 +15,45 @@
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
21
  },
22
22
  "./standard": {
23
- "types": "./dist/src/adapters/standard/index.d.ts",
24
- "import": "./dist/standard.js",
25
- "default": "./dist/standard.js"
23
+ "types": "./dist/adapters/standard/index.d.mts",
24
+ "import": "./dist/adapters/standard/index.mjs",
25
+ "default": "./dist/adapters/standard/index.mjs"
26
26
  },
27
27
  "./fetch": {
28
- "types": "./dist/src/adapters/fetch/index.d.ts",
29
- "import": "./dist/fetch.js",
30
- "default": "./dist/fetch.js"
31
- },
32
- "./hono": {
33
- "types": "./dist/src/adapters/hono/index.d.ts",
34
- "import": "./dist/hono.js",
35
- "default": "./dist/hono.js"
36
- },
37
- "./next": {
38
- "types": "./dist/src/adapters/next/index.d.ts",
39
- "import": "./dist/next.js",
40
- "default": "./dist/next.js"
28
+ "types": "./dist/adapters/fetch/index.d.mts",
29
+ "import": "./dist/adapters/fetch/index.mjs",
30
+ "default": "./dist/adapters/fetch/index.mjs"
41
31
  },
42
32
  "./node": {
43
- "types": "./dist/src/adapters/node/index.d.ts",
44
- "import": "./dist/node.js",
45
- "default": "./dist/node.js"
46
- },
47
- "./🔒/*": {
48
- "types": "./dist/src/*.d.ts"
33
+ "types": "./dist/adapters/node/index.d.mts",
34
+ "import": "./dist/adapters/node/index.mjs",
35
+ "default": "./dist/adapters/node/index.mjs"
49
36
  }
50
37
  },
51
38
  "files": [
52
- "!**/*.map",
53
- "!**/*.tsbuildinfo",
54
39
  "dist"
55
40
  ],
56
41
  "dependencies": {
57
42
  "json-schema-typed": "^8.0.1",
58
- "openapi3-ts": "^4.4.0",
59
- "rou3": "^0.5.1",
60
- "@orpc/client": "0.0.0-next.fea68c1",
61
- "@orpc/contract": "0.0.0-next.fea68c1",
62
- "@orpc/server": "0.0.0-next.fea68c1",
63
- "@orpc/shared": "0.0.0-next.fea68c1",
64
- "@orpc/standard-server": "0.0.0-next.fea68c1",
65
- "@orpc/standard-server-fetch": "0.0.0-next.fea68c1",
66
- "@orpc/standard-server-node": "0.0.0-next.fea68c1"
43
+ "openapi-types": "^12.1.3",
44
+ "rou3": "^0.6.0",
45
+ "@orpc/client": "0.0.0-next.ff41b3a",
46
+ "@orpc/contract": "0.0.0-next.ff41b3a",
47
+ "@orpc/server": "0.0.0-next.ff41b3a",
48
+ "@orpc/openapi-client": "0.0.0-next.ff41b3a",
49
+ "@orpc/shared": "0.0.0-next.ff41b3a",
50
+ "@orpc/standard-server": "0.0.0-next.ff41b3a"
67
51
  },
68
52
  "devDependencies": {
69
- "zod": "^3.24.1"
53
+ "zod": "^3.24.2"
70
54
  },
71
55
  "scripts": {
72
- "build": "tsup --onSuccess='tsc -b --noCheck'",
56
+ "build": "unbuild",
73
57
  "build:watch": "pnpm run build --watch",
74
58
  "type:check": "tsc -b"
75
59
  }
@@ -1,32 +0,0 @@
1
- import {
2
- OpenAPICodec,
3
- OpenAPIMatcher
4
- } from "./chunk-LTTK3H5J.js";
5
-
6
- // src/adapters/fetch/openapi-handler.ts
7
- import { StandardHandler } from "@orpc/server/standard";
8
- import { toFetchResponse, toStandardRequest } from "@orpc/standard-server-fetch";
9
- var OpenAPIHandler = class {
10
- standardHandler;
11
- constructor(router, options) {
12
- const matcher = options?.matcher ?? new OpenAPIMatcher();
13
- const codec = options?.codec ?? new OpenAPICodec();
14
- this.standardHandler = new StandardHandler(router, matcher, codec, options);
15
- }
16
- async handle(request, ...rest) {
17
- const standardRequest = toStandardRequest(request);
18
- const result = await this.standardHandler.handle(standardRequest, ...rest);
19
- if (!result.matched) {
20
- return result;
21
- }
22
- return {
23
- matched: true,
24
- response: toFetchResponse(result.response)
25
- };
26
- }
27
- };
28
-
29
- export {
30
- OpenAPIHandler
31
- };
32
- //# sourceMappingURL=chunk-PW7RAFQQ.js.map
@@ -1,13 +0,0 @@
1
- // src/utils.ts
2
- function standardizeHTTPPath(path) {
3
- return `/${path.replace(/\/{2,}/g, "/").replace(/^\/|\/$/g, "")}`;
4
- }
5
- function toOpenAPI31RoutePattern(path) {
6
- return standardizeHTTPPath(path).replace(/\{\+([^}]+)\}/g, "{$1}");
7
- }
8
-
9
- export {
10
- standardizeHTTPPath,
11
- toOpenAPI31RoutePattern
12
- };
13
- //# sourceMappingURL=chunk-XGHV4TH3.js.map
package/dist/fetch.js DELETED
@@ -1,9 +0,0 @@
1
- import {
2
- OpenAPIHandler
3
- } from "./chunk-PW7RAFQQ.js";
4
- import "./chunk-LTTK3H5J.js";
5
- import "./chunk-XGHV4TH3.js";
6
- export {
7
- OpenAPIHandler
8
- };
9
- //# sourceMappingURL=fetch.js.map
package/dist/hono.js DELETED
@@ -1,9 +0,0 @@
1
- import {
2
- OpenAPIHandler
3
- } from "./chunk-PW7RAFQQ.js";
4
- import "./chunk-LTTK3H5J.js";
5
- import "./chunk-XGHV4TH3.js";
6
- export {
7
- OpenAPIHandler
8
- };
9
- //# sourceMappingURL=hono.js.map