UNPKG

@omnigraph/openapi

Version:
28 lines (27 loc) 1.44 kB
/// <reference types="@cloudflare/workers-types" /> import { OpenAPIV2, OpenAPIV3 } from 'openapi-types'; import { Logger } from '@graphql-mesh/types'; import { JSONSchemaOperationConfig, OperationHeadersConfiguration } from '@omnigraph/json-schema'; import { OpenAPILoaderSelectQueryOrMutationFieldConfig } from './types.cjs'; interface GetJSONSchemaOptionsFromOpenAPIOptionsParams { source: OpenAPIV3.Document | OpenAPIV2.Document | string; fallbackFormat?: 'json' | 'yaml' | 'js' | 'ts'; cwd?: string; fetch?: WindowOrWorkerGlobalScope['fetch']; endpoint?: string; schemaHeaders?: Record<string, string>; operationHeaders?: OperationHeadersConfiguration; queryParams?: Record<string, any>; selectQueryOrMutationField?: OpenAPILoaderSelectQueryOrMutationFieldConfig[]; logger?: Logger; jsonApi?: boolean; } export declare function getJSONSchemaOptionsFromOpenAPIOptions(name: string, { source, fallbackFormat, cwd, fetch: fetchFn, endpoint, schemaHeaders, operationHeaders, queryParams, selectQueryOrMutationField, logger, jsonApi, }: GetJSONSchemaOptionsFromOpenAPIOptionsParams): Promise<{ operations: JSONSchemaOperationConfig[]; endpoint: string; cwd: string; fetch: (input: RequestInfo | URL, init?: RequestInit<CfProperties<unknown>>) => Promise<Response>; schemaHeaders: Record<string, string>; operationHeaders: OperationHeadersConfiguration; }>; export {};