New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More β†’
Socket
Sign inDemoInstall
Socket

trpc-to-openapi

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trpc-to-openapi - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

1

dist/cjs/adapters/fastify.js

@@ -20,2 +20,3 @@ "use strict";

return await openApiHttpHandler(rawRequest, Object.assign(reply, {
once: () => undefined,
setHeader: (key, value) => {

@@ -22,0 +23,0 @@ if (Array.isArray(value)) {

2

dist/cjs/adapters/next.js

@@ -41,3 +41,3 @@ "use strict";

}
(0, node_http_1.incomingMessageToRequest)(Object.assign(req, {
(0, node_http_1.incomingMessageToRequest)(req, Object.assign(res, {
once: () => undefined,

@@ -44,0 +44,0 @@ }), {

@@ -67,3 +67,3 @@ "use strict";

? req
: (0, node_http_1.incomingMessageToRequest)(req, {
: (0, node_http_1.incomingMessageToRequest)(req, res, {
maxBodySize: maxBodySize !== null && maxBodySize !== void 0 ? maxBodySize : null,

@@ -87,3 +87,3 @@ }),

for (const [key, shape] of Object.entries(unwrappedSchema.shape)) {
if (shape instanceof zod_1.ZodArray && typeof input[key] === 'string') {
if (shape instanceof zod_1.ZodArray && !Array.isArray(input[key])) {
input[key] = [input[key]];

@@ -90,0 +90,0 @@ }

@@ -10,3 +10,3 @@ "use strict";

var _a;
await openApiHttpHandler((0, node_http_1.incomingMessageToRequest)(req, {
await openApiHttpHandler((0, node_http_1.incomingMessageToRequest)(req, res, {
maxBodySize: (_a = opts.maxBodySize) !== null && _a !== void 0 ? _a : null,

@@ -13,0 +13,0 @@ }), res);

{
"name": "trpc-to-openapi",
"version": "2.0.3",
"version": "2.0.4",
"description": "tRPC OpenAPI",

@@ -52,3 +52,3 @@ "author": "mcampa",

"peerDependencies": {
"@trpc/server": "^11.0.0-rc.566",
"@trpc/server": "^11.0.0-rc.648",
"zod": "^3.23.8"

@@ -60,3 +60,2 @@ },

"lodash.clonedeep": "^4.5.0",
"node-mocks-http": "^1.12.2",
"openapi3-ts": "4.3.3",

@@ -66,3 +65,3 @@ "zod-openapi": "^2.19.0"

"devDependencies": {
"@trpc/client": "^11.0.0-rc.566",
"@trpc/client": "^11.0.0-rc.648",
"@types/aws-lambda": "^8.10.115",

@@ -82,2 +81,3 @@ "@types/co-body": "^6.1.0",

"next": "^14.2.10",
"node-mocks-http": "^1.12.2",
"node-fetch": "^2.6.11",

@@ -90,3 +90,3 @@ "openapi-schema-validator": "^12.1.1",

"ts-node": "^10.9.1",
"typescript": "5.5.4"
"typescript": "5.7.2"
},

@@ -93,0 +93,0 @@ "optionalDependencies": {

@@ -14,3 +14,3 @@ <p align="center">

- tRPC 11 only πŸ‘ˆ
- tRPC ^11.0.0-rc.648 only πŸ‘ˆ
- Easy REST endpoints for your tRPC procedures.

@@ -24,2 +24,3 @@ - Perfect for incremental adoption.

- 2.0.4 Upgrade to tRPC 11.0.0-rc.648
- 2.0.3 Added support for array inputs for GET requests

@@ -82,3 +83,3 @@

No support for AWS lambdas yet 😒
No support for AWS lambdas

@@ -128,3 +129,3 @@ ```typescript

Procedures with a `GET`/`DELETE` method will accept inputs via URL `query parameters`. Procedures with a `POST`/`PATCH`/`PUT` method will accept inputs via the `request body` with a `application/json` or `application/x-www-form-urlencoded` content type.
Procedures with a `GET`/`DELETE` method will accept inputs via URL `query parameters`. Procedures with a `POST`/`PATCH`/`PUT` method will accept inputs via the `request body` with a `application/json` content type.

@@ -274,4 +275,38 @@ ### Path parameters

#### With Next.js
#### With Next.js app router
Please see [full example here](examples/with-nextjs-appdir).
```typescript
// src/app/[...trpc]/route.ts
import { appRouter } from '~/server/api/root';
import { createContext } from '~/server/api/trpc';
import { type NextRequest } from 'next/server';
import { createOpenApiFetchHandler } from 'trpc-to-openapi';
export const dynamic = 'force-dynamic';
const handler = (req: NextRequest) => {
// Handle incoming OpenAPI requests
return createOpenApiFetchHandler({
endpoint: '/',
router: appRouter,
createContext: () => createContext(req),
req,
});
};
export {
handler as GET,
handler as POST,
handler as PUT,
handler as PATCH,
handler as DELETE,
handler as OPTIONS,
handler as HEAD,
};
```
#### With Next.js pages router
Please see [full example here](examples/with-nextjs).

@@ -278,0 +313,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc