UNPKG

prisma-zod-generator

Version:

Prisma 2+ generator to emit Zod schemas from your Prisma schema

36 lines (35 loc) 1.34 kB
/** * PZG Pro - SDK Publisher Pack * * Generate and publish type-safe SDKs for multiple platforms from DMMF data */ import { DMMF } from '@prisma/generator-helper'; import { GeneratorConfig } from '../../../config/parser'; export interface SDKConfig { outputPath?: string; platforms?: Platform[]; packageName?: string; version?: string; publishRegistry?: string; enableAutoPublish?: boolean; includeDocumentation?: boolean; authConfig?: AuthConfig; } /** * Platforms with a generator behind them. * * The union previously listed go, rust, java, csharp and php, which only produced * a "not yet implemented" warning at runtime — autocomplete advertised five * languages that did not exist. Narrowed so an unsupported platform is a compile * error; anything else passed at runtime is still reported rather than ignored. */ export type Platform = 'typescript' | 'python'; export interface AuthConfig { type: 'bearer' | 'apikey' | 'oauth2'; headerName?: string; tokenPrefix?: string; } /** * Generate multi-platform SDKs from DMMF data */ export declare function generateSDKFromDMMF(dmmf: DMMF.Document, generatorConfig: GeneratorConfig, schemaPath: string, outputPath: string, prismaClientPath: string, provider: string, config?: SDKConfig, previewFeatures?: string[]): Promise<void>;