UNPKG

@infinite-debugger/swagger-to-ts

Version:

swagger-to-ts is a powerful library that allows you to generate TypeScript code from Swagger documentation or OpenAPI specifications. It simplifies the process of integrating API definitions into your TypeScript projects, saving you time and effort.

155 lines (154 loc) 4.88 kB
import { z } from 'zod'; import { Schema } from './Schema'; export declare const ApikeyAuthValidationSchema: z.ZodObject<{ type: z.ZodString; scheme: z.ZodOptional<z.ZodLiteral<"apikey">>; in: z.ZodOptional<z.ZodString>; name: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: string; scheme?: "apikey" | undefined; in?: string | undefined; name?: string | undefined; description?: string | undefined; }, { type: string; scheme?: "apikey" | undefined; in?: string | undefined; name?: string | undefined; description?: string | undefined; }>; export type ApikeyAuth = { type: string; scheme?: 'apikey'; in?: string; name?: string; description?: string; }; export declare const BearerAuthValidationSchema: z.ZodObject<{ type: z.ZodString; scheme: z.ZodOptional<z.ZodLiteral<"bearer">>; bearerFormat: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: string; scheme?: "bearer" | undefined; bearerFormat?: string | undefined; description?: string | undefined; }, { type: string; scheme?: "bearer" | undefined; bearerFormat?: string | undefined; description?: string | undefined; }>; export type BearerAuth = { type: string; scheme?: 'bearer'; bearerFormat?: string; description?: string; }; export declare const SecuritySchemeValidationSchema: z.ZodUnion<[z.ZodObject<{ type: z.ZodString; scheme: z.ZodOptional<z.ZodLiteral<"apikey">>; in: z.ZodOptional<z.ZodString>; name: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: string; scheme?: "apikey" | undefined; in?: string | undefined; name?: string | undefined; description?: string | undefined; }, { type: string; scheme?: "apikey" | undefined; in?: string | undefined; name?: string | undefined; description?: string | undefined; }>, z.ZodObject<{ type: z.ZodString; scheme: z.ZodOptional<z.ZodLiteral<"bearer">>; bearerFormat: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: string; scheme?: "bearer" | undefined; bearerFormat?: string | undefined; description?: string | undefined; }, { type: string; scheme?: "bearer" | undefined; bearerFormat?: string | undefined; description?: string | undefined; }>]>; export type SecurityScheme = ApikeyAuth | BearerAuth; export declare const ComponentsValidationSchema: z.ZodObject<{ securitySchemes: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{ type: z.ZodString; scheme: z.ZodOptional<z.ZodLiteral<"apikey">>; in: z.ZodOptional<z.ZodString>; name: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: string; scheme?: "apikey" | undefined; in?: string | undefined; name?: string | undefined; description?: string | undefined; }, { type: string; scheme?: "apikey" | undefined; in?: string | undefined; name?: string | undefined; description?: string | undefined; }>, z.ZodObject<{ type: z.ZodString; scheme: z.ZodOptional<z.ZodLiteral<"bearer">>; bearerFormat: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: string; scheme?: "bearer" | undefined; bearerFormat?: string | undefined; description?: string | undefined; }, { type: string; scheme?: "bearer" | undefined; bearerFormat?: string | undefined; description?: string | undefined; }>]>>; schemas: z.ZodRecord<z.ZodString, z.ZodAny>; }, "strip", z.ZodTypeAny, { securitySchemes: Record<string, { type: string; scheme?: "apikey" | undefined; in?: string | undefined; name?: string | undefined; description?: string | undefined; } | { type: string; scheme?: "bearer" | undefined; bearerFormat?: string | undefined; description?: string | undefined; }>; schemas: Record<string, any>; }, { securitySchemes: Record<string, { type: string; scheme?: "apikey" | undefined; in?: string | undefined; name?: string | undefined; description?: string | undefined; } | { type: string; scheme?: "bearer" | undefined; bearerFormat?: string | undefined; description?: string | undefined; }>; schemas: Record<string, any>; }>; export type Components = { securitySchemes: Record<string, SecurityScheme>; schemas: Record<string, Schema>; };