fix: bump trpc and openapi packages (#1591)

This commit is contained in:
David Nguyen
2025-01-19 22:07:02 +11:00
committed by GitHub
parent 9e03747e43
commit 0d3864548c
99 changed files with 1651 additions and 1607 deletions

View File

@@ -1,6 +1,6 @@
import { TRPCError, initTRPC } from '@trpc/server';
import SuperJSON from 'superjson';
import type { OpenApiMeta } from 'trpc-openapi';
import type { AnyZodObject } from 'zod';
import { AppError, genericErrorCodeToTrpcErrorCodeMap } from '@documenso/lib/errors/app-error';
import { isAdmin } from '@documenso/lib/next-auth/guards/is-admin';
@@ -10,6 +10,26 @@ import { extractNextApiRequestMetadata } from '@documenso/lib/universal/extract-
import type { TrpcContext } from './context';
// Can't import type from trpc-to-openapi because it breaks nextjs build, not sure why.
type OpenApiMeta = {
openapi?: {
enabled?: boolean;
method: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
path: `/${string}`;
summary?: string;
description?: string;
protect?: boolean;
tags?: string[];
// eslint-disable-next-line @typescript-eslint/ban-types
contentTypes?: ('application/json' | 'application/x-www-form-urlencoded' | (string & {}))[];
deprecated?: boolean;
requestHeaders?: AnyZodObject;
responseHeaders?: AnyZodObject;
successDescription?: string;
errorResponses?: number[] | Record<number, string>;
};
} & Record<string, unknown>;
const t = initTRPC
.meta<OpenApiMeta>()
.context<TrpcContext>()