UNPKG

@docyrus/tanstack-db-generator

Version:

Code generator utilities for TanStack Query / Database integration with Docyrus API

101 lines (100 loc) 2.4 kB
export interface OpenAPISpec { openapi: string; paths: Record<string, PathItem>; components?: { schemas?: Record<string, SchemaObject>; parameters?: Record<string, ParameterObject>; }; } export interface PathItem { get?: OperationObject; post?: OperationObject; patch?: OperationObject; delete?: OperationObject; put?: OperationObject; } export interface OperationObject { operationId: string; description?: string; summary?: string; parameters?: Array<ParameterObject | { $ref: string; }>; requestBody?: { required?: boolean; content?: { 'application/json'?: { schema?: SchemaObject | { $ref: string; }; }; }; }; responses?: Record<string, ResponseObject>; tags?: string[]; security?: Array<Record<string, string[]>>; } export interface ParameterObject { name: string; in: 'query' | 'path' | 'header'; required?: boolean; description?: string; schema?: SchemaObject; } export interface ResponseObject { description?: string; content?: { 'application/json'?: { schema?: SchemaObject | { $ref: string; }; }; }; } export interface SchemaObject { type?: string; properties?: Record<string, SchemaObject | { $ref: string; }>; items?: SchemaObject | { $ref: string; }; allOf?: Array<SchemaObject | { $ref: string; }>; oneOf?: Array<SchemaObject | { $ref: string; }>; required?: string[]; format?: string; description?: string; readOnly?: boolean; writeOnly?: boolean; enum?: any[]; } export interface DataSourceInfo { appName: string; dataSourceName: string; entityName: string; endpoints: { list?: OperationInfo; get?: OperationInfo; create?: OperationInfo; update?: OperationInfo; delete?: OperationInfo; deleteMany?: OperationInfo; }; } export interface OperationInfo { path: string; operationId: string; method: string; parameters?: ParameterObject[]; requestBody?: any; responseSchema?: SchemaObject; } export interface EntitySchema { name: string; properties: Record<string, SchemaObject>; required?: string[]; }