@mintlify/common
Version:
Commonly shared code within Mintlify
34 lines (33 loc) • 1.09 kB
TypeScript
import { OpenAPIV3 } from 'openapi-types';
/**
*
* @param str either the openapi or api string defined in the frontmatter
* @returns method: API method (GET, POST, PUT, DELETE, PATCH)
* endpoint: API endpoint
* filename: filename of the openapi file (if applicable)
* returns undefined for any of the values (fails silently)
*/
export declare const potentiallyParseOpenApiString: (str: string) => {
method: OpenAPIV3.HttpMethods;
endpoint: string;
filename?: string;
} | undefined;
/**
*
* @param str either the openapi or api string defined in the frontmatter
* @returns method: API method (GET, POST, PUT, DELETE, PATCH)
* endpoint: API endpoint
* filename: filename of the openapi file (if applicable)
*/
export declare const parseOpenApiString: (str: string) => {
method: OpenAPIV3.HttpMethods;
endpoint: string;
filename?: string;
};
/**
* same as above, but for openapi-schema frontmatter
*/
export declare const parseOpenApiSchemaString: (str: string) => {
name: string;
filename?: string;
};