@orpc/openapi 0.38.0 → 0.39.0
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-DRV7KYES.js → chunk-MEP42INL.js} +1 -1
- package/dist/{chunk-NHYWV7BW.js → chunk-SE4JDETS.js} +5 -5
- package/dist/fetch.js +2 -2
- package/dist/hono.js +2 -2
- package/dist/next.js +2 -2
- package/dist/node.js +4 -4
- package/dist/src/adapters/standard/openapi-codec.d.ts +2 -1
- package/dist/standard.js +1 -1
- package/package.json +7 -4
@@ -1,10 +1,10 @@
|
|
1
1
|
import {
|
2
2
|
OpenAPICodec,
|
3
3
|
OpenAPIMatcher
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-MEP42INL.js";
|
5
5
|
|
6
6
|
// src/adapters/fetch/openapi-handler.ts
|
7
|
-
import {
|
7
|
+
import { toFetchResponse, toStandardRequest } from "@orpc/server-standard-fetch";
|
8
8
|
import { StandardHandler } from "@orpc/server/standard";
|
9
9
|
var OpenAPIHandler = class {
|
10
10
|
standardHandler;
|
@@ -14,14 +14,14 @@ var OpenAPIHandler = class {
|
|
14
14
|
this.standardHandler = new StandardHandler(router, matcher, codec, options);
|
15
15
|
}
|
16
16
|
async handle(request, ...rest) {
|
17
|
-
const standardRequest =
|
17
|
+
const standardRequest = toStandardRequest(request);
|
18
18
|
const result = await this.standardHandler.handle(standardRequest, ...rest);
|
19
19
|
if (!result.matched) {
|
20
20
|
return result;
|
21
21
|
}
|
22
22
|
return {
|
23
23
|
matched: true,
|
24
|
-
response:
|
24
|
+
response: toFetchResponse(result.response)
|
25
25
|
};
|
26
26
|
}
|
27
27
|
};
|
@@ -29,4 +29,4 @@ var OpenAPIHandler = class {
|
|
29
29
|
export {
|
30
30
|
OpenAPIHandler
|
31
31
|
};
|
32
|
-
//# sourceMappingURL=chunk-
|
32
|
+
//# sourceMappingURL=chunk-SE4JDETS.js.map
|
package/dist/fetch.js
CHANGED
package/dist/hono.js
CHANGED
package/dist/next.js
CHANGED
package/dist/node.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import {
|
2
2
|
OpenAPICodec,
|
3
3
|
OpenAPIMatcher
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-MEP42INL.js";
|
5
5
|
import "./chunk-HC5PVG4R.js";
|
6
6
|
|
7
7
|
// src/adapters/node/openapi-handler.ts
|
8
|
-
import {
|
8
|
+
import { sendStandardResponse, toStandardRequest } from "@orpc/server-standard-node";
|
9
9
|
import { StandardHandler } from "@orpc/server/standard";
|
10
10
|
var OpenAPIHandler = class {
|
11
11
|
standardHandler;
|
@@ -15,12 +15,12 @@ var OpenAPIHandler = class {
|
|
15
15
|
this.standardHandler = new StandardHandler(router, matcher, codec, { ...options });
|
16
16
|
}
|
17
17
|
async handle(req, res, ...rest) {
|
18
|
-
const standardRequest =
|
18
|
+
const standardRequest = toStandardRequest(req, res);
|
19
19
|
const result = await this.standardHandler.handle(standardRequest, ...rest);
|
20
20
|
if (!result.matched) {
|
21
21
|
return { matched: false };
|
22
22
|
}
|
23
|
-
await
|
23
|
+
await sendStandardResponse(res, result.response);
|
24
24
|
return { matched: true };
|
25
25
|
}
|
26
26
|
};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { AnyProcedure } from '@orpc/server';
|
2
|
-
import type {
|
2
|
+
import type { StandardRequest, StandardResponse } from '@orpc/server-standard';
|
3
|
+
import type { StandardCodec, StandardParams } from '@orpc/server/standard';
|
3
4
|
import { type ORPCError } from '@orpc/contract';
|
4
5
|
import { OpenAPISerializer } from './openapi-serializer';
|
5
6
|
export interface OpenAPICodecOptions {
|
package/dist/standard.js
CHANGED
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/openapi",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.
|
4
|
+
"version": "0.39.0",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
7
7
|
"repository": {
|
@@ -54,15 +54,18 @@
|
|
54
54
|
"dist"
|
55
55
|
],
|
56
56
|
"dependencies": {
|
57
|
+
"@orpc/server-standard": "^0.0.0",
|
58
|
+
"@orpc/server-standard-fetch": "^0.0.0",
|
59
|
+
"@orpc/server-standard-node": "^0.0.0",
|
57
60
|
"escape-string-regexp": "^5.0.0",
|
58
61
|
"fast-content-type-parse": "^2.0.0",
|
59
62
|
"json-schema-typed": "^8.0.1",
|
60
63
|
"openapi3-ts": "^4.4.0",
|
61
64
|
"rou3": "^0.5.1",
|
62
65
|
"wildcard-match": "^5.1.3",
|
63
|
-
"@orpc/
|
64
|
-
"@orpc/
|
65
|
-
"@orpc/shared": "0.
|
66
|
+
"@orpc/server": "0.39.0",
|
67
|
+
"@orpc/contract": "0.39.0",
|
68
|
+
"@orpc/shared": "0.39.0"
|
66
69
|
},
|
67
70
|
"devDependencies": {
|
68
71
|
"@readme/openapi-parser": "^2.6.0",
|