UNPKG

typeapi-model

Version:

This library contains models to represent a TypeAPI specification

65 lines (54 loc) 1.28 kB
import { PropertyType, TypeSchema } from 'typeschema-model'; /** * Describes arguments of the operation */ interface Argument { contentType?: string; in?: string; name?: string; schema?: PropertyType; } /** * Describes the response of the operation */ interface Response { code?: number; contentType?: string; schema?: PropertyType; } interface Operation { arguments?: Map<string, Argument>; authorization?: boolean; description?: string; method?: string; path?: string; return?: Response; security?: Array<string>; stability?: number; throws?: Array<Response>; } interface Security { type?: string; } interface SecurityApiKey extends Security { in?: string; name?: string; } interface SecurityHttpBasic extends Security { } interface SecurityHttpBearer extends Security { } interface SecurityOAuth extends Security { authorizationUrl?: string; scopes?: Array<string>; tokenUrl?: string; } /** * The TypeAPI Root */ interface TypeAPI extends TypeSchema { baseUrl?: string; operations?: Map<string, Operation>; security?: Security; } export type { Argument, Operation, Response, Security, SecurityApiKey, SecurityHttpBasic, SecurityHttpBearer, SecurityOAuth, TypeAPI };