diff --git a/package.json b/package.json index 65ff9bc3..26727a01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "trpc-to-openapi", - "version": "2.0.0-rc.0", + "version": "2.0.0-rc.1", "description": "tRPC OpenAPI", "author": "mcampa", "private": false, diff --git a/src/adapters/node-http/input.ts b/src/adapters/node-http/input.ts index 5fc00000..479d41ff 100644 --- a/src/adapters/node-http/input.ts +++ b/src/adapters/node-http/input.ts @@ -1,5 +1,5 @@ import { TRPCError } from '@trpc/server'; -import { NodeHTTPRequest } from '@trpc/server/dist/adapters/node-http'; +import { NodeHTTPRequest } from '@trpc/server/adapters/node-http'; import parse from 'co-body'; export const getQuery = (req: NodeHTTPRequest, url: URL): Record => { diff --git a/src/types.ts b/src/types.ts index 2e5f27c5..7d9846e9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import { TRPC_ERROR_CODE_KEY } from '@trpc/server/dist/rpc'; +import { TRPC_ERROR_CODE_KEY } from '@trpc/server/rpc'; import type { CreateRootTypes, Procedure, @@ -7,7 +7,7 @@ import type { } from '@trpc/server/unstable-core-do-not-import'; import type { AnyZodObject, ZodIssue } from 'zod'; -export { type OpenAPIObject, type SecuritySchemeObject } from 'openapi3-ts/dist/oas31'; +export { type OpenAPIObject, type SecuritySchemeObject } from 'openapi3-ts/oas31'; export type OpenApiMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE'; diff --git a/src/utils/procedure.ts b/src/utils/procedure.ts index 4d5900b7..b34f1e08 100644 --- a/src/utils/procedure.ts +++ b/src/utils/procedure.ts @@ -46,7 +46,7 @@ export const forEachOpenApiProcedure = ( for (const [path, procedure] of Object.entries(procedureRecord)) { // @ts-expect-error FIXME const meta = procedure._def.meta as unknown as OpenApiMeta; - const { openapi } = meta; + const { openapi } = meta ?? {}; if (openapi && openapi.enabled !== false) { const type = getProcedureType(procedure as OpenApiProcedure); callback({ path, type, procedure: procedure as OpenApiProcedure, openapi });