@omnigraph/openapi
Version:
25 lines (24 loc) • 1.22 kB
TypeScript
import { OpenAPIV3, OpenAPIV2 } from 'openapi-types';
import { JSONSchemaOperationConfig } from '@omnigraph/json-schema';
import { OpenAPILoaderSelectQueryOrMutationFieldConfig } from './types';
import { Logger } from '@graphql-mesh/types';
interface GetJSONSchemaOptionsFromOpenAPIOptionsParams {
oasFilePath: OpenAPIV3.Document | OpenAPIV2.Document | string;
fallbackFormat?: 'json' | 'yaml' | 'js' | 'ts';
cwd?: string;
fetch?: WindowOrWorkerGlobalScope['fetch'];
baseUrl?: string;
schemaHeaders?: Record<string, string>;
operationHeaders?: Record<string, string>;
selectQueryOrMutationField?: OpenAPILoaderSelectQueryOrMutationFieldConfig[];
logger?: Logger;
}
export declare function getJSONSchemaOptionsFromOpenAPIOptions({ oasFilePath, fallbackFormat, cwd, fetch: fetchFn, baseUrl, schemaHeaders, operationHeaders, selectQueryOrMutationField, logger, }: GetJSONSchemaOptionsFromOpenAPIOptionsParams): Promise<{
operations: JSONSchemaOperationConfig[];
baseUrl: string;
cwd: string;
fetch: (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>;
schemaHeaders: Record<string, string>;
operationHeaders: Record<string, string>;
}>;
export {};