@orpc/openapi 0.0.0-next.f17a1a0 → 0.0.0-next.f4d410a

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 (57) hide show
  1. package/README.md +4 -2
  2. package/dist/adapters/fetch/index.d.mts +15 -0
  3. package/dist/adapters/fetch/index.d.ts +15 -0
  4. package/dist/adapters/fetch/index.mjs +11 -0
  5. package/dist/adapters/hono/index.d.mts +8 -0
  6. package/dist/adapters/hono/index.d.ts +8 -0
  7. package/dist/adapters/hono/index.mjs +11 -0
  8. package/dist/adapters/next/index.d.mts +8 -0
  9. package/dist/adapters/next/index.d.ts +8 -0
  10. package/dist/adapters/next/index.mjs +11 -0
  11. package/dist/adapters/node/index.d.mts +15 -0
  12. package/dist/adapters/node/index.d.ts +15 -0
  13. package/dist/adapters/node/index.mjs +35 -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/{chunk-PGCWJMRO.js → shared/openapi.BNHmrMe2.mjs} +26 -38
  21. package/dist/shared/openapi.DZzpQAb-.mjs +231 -0
  22. package/dist/shared/openapi.Dv-KT_Bx.mjs +33 -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 +30 -34
  26. package/dist/chunk-ATDLVTJE.js +0 -32
  27. package/dist/chunk-XGHV4TH3.js +0 -13
  28. package/dist/fetch.js +0 -9
  29. package/dist/hono.js +0 -9
  30. package/dist/index.js +0 -701
  31. package/dist/next.js +0 -9
  32. package/dist/node.js +0 -30
  33. package/dist/src/adapters/fetch/index.d.ts +0 -2
  34. package/dist/src/adapters/fetch/openapi-handler.d.ts +0 -11
  35. package/dist/src/adapters/hono/index.d.ts +0 -2
  36. package/dist/src/adapters/next/index.d.ts +0 -2
  37. package/dist/src/adapters/node/index.d.ts +0 -2
  38. package/dist/src/adapters/node/openapi-handler.d.ts +0 -11
  39. package/dist/src/adapters/standard/index.d.ts +0 -4
  40. package/dist/src/adapters/standard/openapi-codec.d.ts +0 -13
  41. package/dist/src/adapters/standard/openapi-handler.d.ts +0 -5
  42. package/dist/src/adapters/standard/openapi-matcher.d.ts +0 -10
  43. package/dist/src/index.d.ts +0 -16
  44. package/dist/src/openapi-content-builder.d.ts +0 -10
  45. package/dist/src/openapi-error.d.ts +0 -3
  46. package/dist/src/openapi-generator.d.ts +0 -67
  47. package/dist/src/openapi-input-structure-parser.d.ts +0 -22
  48. package/dist/src/openapi-operation-extender.d.ts +0 -7
  49. package/dist/src/openapi-output-structure-parser.d.ts +0 -18
  50. package/dist/src/openapi-parameters-builder.d.ts +0 -12
  51. package/dist/src/openapi-path-parser.d.ts +0 -8
  52. package/dist/src/openapi.d.ts +0 -3
  53. package/dist/src/schema-converter.d.ts +0 -16
  54. package/dist/src/schema-utils.d.ts +0 -11
  55. package/dist/src/schema.d.ts +0 -12
  56. package/dist/src/utils.d.ts +0 -4
  57. package/dist/standard.js +0 -10
@@ -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.f17a1a0",
4
+ "version": "0.0.0-next.f4d410a",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -15,61 +15,57 @@
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"
28
+ "types": "./dist/adapters/fetch/index.d.mts",
29
+ "import": "./dist/adapters/fetch/index.mjs",
30
+ "default": "./dist/adapters/fetch/index.mjs"
31
31
  },
32
32
  "./hono": {
33
- "types": "./dist/src/adapters/hono/index.d.ts",
34
- "import": "./dist/hono.js",
35
- "default": "./dist/hono.js"
33
+ "types": "./dist/adapters/hono/index.d.mts",
34
+ "import": "./dist/adapters/hono/index.mjs",
35
+ "default": "./dist/adapters/hono/index.mjs"
36
36
  },
37
37
  "./next": {
38
- "types": "./dist/src/adapters/next/index.d.ts",
39
- "import": "./dist/next.js",
40
- "default": "./dist/next.js"
38
+ "types": "./dist/adapters/next/index.d.mts",
39
+ "import": "./dist/adapters/next/index.mjs",
40
+ "default": "./dist/adapters/next/index.mjs"
41
41
  },
42
42
  "./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"
43
+ "types": "./dist/adapters/node/index.d.mts",
44
+ "import": "./dist/adapters/node/index.mjs",
45
+ "default": "./dist/adapters/node/index.mjs"
49
46
  }
50
47
  },
51
48
  "files": [
52
- "!**/*.map",
53
- "!**/*.tsbuildinfo",
54
49
  "dist"
55
50
  ],
56
51
  "dependencies": {
57
- "@orpc/server-standard": "^0.4.0",
58
- "@orpc/server-standard-fetch": "^0.4.0",
59
- "@orpc/server-standard-node": "^0.4.0",
60
52
  "json-schema-typed": "^8.0.1",
61
- "openapi3-ts": "^4.4.0",
53
+ "openapi-types": "^12.1.3",
62
54
  "rou3": "^0.5.1",
63
- "@orpc/client": "0.0.0-next.f17a1a0",
64
- "@orpc/contract": "0.0.0-next.f17a1a0",
65
- "@orpc/server": "0.0.0-next.f17a1a0",
66
- "@orpc/shared": "0.0.0-next.f17a1a0"
55
+ "@orpc/client": "0.0.0-next.f4d410a",
56
+ "@orpc/openapi-client": "0.0.0-next.f4d410a",
57
+ "@orpc/shared": "0.0.0-next.f4d410a",
58
+ "@orpc/contract": "0.0.0-next.f4d410a",
59
+ "@orpc/server": "0.0.0-next.f4d410a",
60
+ "@orpc/standard-server": "0.0.0-next.f4d410a",
61
+ "@orpc/standard-server-fetch": "0.0.0-next.f4d410a",
62
+ "@orpc/standard-server-node": "0.0.0-next.f4d410a"
67
63
  },
68
64
  "devDependencies": {
69
- "zod": "^3.24.1"
65
+ "zod": "^3.24.2"
70
66
  },
71
67
  "scripts": {
72
- "build": "tsup --onSuccess='tsc -b --noCheck'",
68
+ "build": "unbuild",
73
69
  "build:watch": "pnpm run build --watch",
74
70
  "type:check": "tsc -b"
75
71
  }
@@ -1,32 +0,0 @@
1
- import {
2
- OpenAPICodec,
3
- OpenAPIMatcher
4
- } from "./chunk-PGCWJMRO.js";
5
-
6
- // src/adapters/fetch/openapi-handler.ts
7
- import { toFetchResponse, toStandardRequest } from "@orpc/server-standard-fetch";
8
- import { StandardHandler } from "@orpc/server/standard";
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-ATDLVTJE.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-ATDLVTJE.js";
4
- import "./chunk-PGCWJMRO.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-ATDLVTJE.js";
4
- import "./chunk-PGCWJMRO.js";
5
- import "./chunk-XGHV4TH3.js";
6
- export {
7
- OpenAPIHandler
8
- };
9
- //# sourceMappingURL=hono.js.map