import { Extensions, Refable } from "../common"; import { EnumStr } from "./common"; export type Dictionary = { [key: string]: T; }; /** Properties, Parameters, Operations and Schemas require additional support */ export interface Implementation { } export interface Details { } /** * Property References may have additional data that's not in the target reference */ export interface PropertyDetails extends Details, Extensions { description?: string; readOnly?: boolean; nullable?: boolean; } /** Parameter References may have additional data that's not in the target reference */ export interface ParameterDetails extends Details, Extensions { description?: string; } export interface SchemaDetails extends Details { } export interface HttpOperationDetails extends Details { } /** * @description The location of the parameter. * * @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#user-content-parameterIn */ export declare enum ParameterLocation { Query = "query", Header = "header", Cookie = "cookie", Path = "path" } export declare function hasContent>(parameter: T): parameter is HasContent & T; export declare function hasSchema>(parameter: T): parameter is HasSchema & T; export declare function hasExample(parameter: T): parameter is HasExample & T; export declare function hasExamples(parameter: T): parameter is HasExamples & T; export declare function isCookieParameter(parameter: Parameter): parameter is InCookie & Parameter; export declare function isHeaderParameter(parameter: Parameter): parameter is InHeader & Parameter; export declare function isPathParameter(parameter: Parameter): parameter is InPath & Parameter; export declare function isQueryParameter(parameter: Parameter): parameter is InQuery & Parameter; /** * Properties have additional data when referencing them */ export type PropertyReference = PropertyDetails & Refable; /** * Parameter references could have additional data to override the shared parameter value. */ export type ParameterReference = ParameterDetails & Refable; /** * @description common ways of serializing simple parameters * @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#style-values */ export declare enum EncodingStyle { Matrix = "matrix", Label = "label", Simple = "simple", Form = "form", SpaceDelimited = "spaceDelimited", PipeDelimited = "pipeDelimited", TabDelimited = "tabDelimited", DeepObject = "deepObject" } export declare enum JsonType { Array = "array", Boolean = "boolean", Integer = "integer", Number = "number", Object = "object", String = "string" } export declare enum Scheme { Bearer = "bearer" } export declare enum SecurityType { ApiKey = "apiKey", Http = "http", OAuth2 = "oauth2", OpenIDConnect = "openIdConnect" } export interface Callback extends Dictionary { } export interface SecurityRequirement extends Dictionary { } export type HTTPSecurityScheme = NonBearerHTTPSecurityScheme | BearerHTTPSecurityScheme; export type SecurityScheme = APIKeySecurityScheme | HTTPSecurityScheme | OAuth2SecurityScheme | OpenIdConnectSecurityScheme; export type QueryEncodingStyle = EncodingStyle.Form | EncodingStyle.SpaceDelimited | EncodingStyle.PipeDelimited | EncodingStyle.DeepObject; export type PathEncodingStyle = EncodingStyle.Matrix | EncodingStyle.Label | EncodingStyle.Simple; export interface OpenAPI3Document extends Extensions { paths: Dictionary; openapi: string; info: Info; externalDocs?: ExternalDocumentation; servers?: Array; security?: Array; tags?: Array; components?: Components; } export interface Components extends Extensions { schemas?: Dictionary; responses?: Dictionary; parameters?: Dictionary; examples?: Dictionary; requestBodies?: Dictionary; headers?: Dictionary
; securitySchemes?: Dictionary; links?: Dictionary; callbacks?: Dictionary; } export interface APIKeySecurityScheme extends Extensions { type: SecurityType.ApiKey; name: string; in: EnumStr; description?: string; } export interface AuthorizationCodeOAuthFlow extends Extensions { authorizationUrl: string; tokenUrl: string; refreshUrl?: string; scopes?: Dictionary; } export interface BearerHTTPSecurityScheme extends Extensions { scheme: Scheme.Bearer; bearerFormat?: string; type: SecurityType.Http; description?: string; } export interface ClientCredentialsFlow extends Extensions { tokenUrl: string; refreshUrl?: string; scopes?: Dictionary; } export interface Contact extends Extensions { name?: string; url?: string; email?: string; } export interface Discriminator extends Extensions { propertyName: string; mapping?: Dictionary; } export interface Encoding extends Extensions { contentType?: string; headers?: Dictionary>; style?: QueryEncodingStyle; explode?: boolean; allowReserved?: boolean; } export interface Example extends Extensions { summary?: string; description?: string; value?: any; externalValue?: string; } export interface ExternalDocumentation extends Extensions { description?: string; url: string; } export interface Header extends Deprecatable, Extensions, Partial, Partial, Partial, Partial { description?: string; required?: boolean; allowEmptyValue?: boolean; allowReserved?: boolean; } export interface ImplicitOAuthFlow extends Extensions { authorizationUrl: string; refreshUrl?: string; scopes: Dictionary; } export interface Info extends Extensions { title: string; description?: string; termsOfService?: string; contact?: Contact; license?: License; version: string; } export interface License extends Extensions { name: string; url?: string; } export interface Link extends Extensions { operationRef?: string; operationId?: string; parameters?: Dictionary; requestBody?: any; description?: string; server?: Server; } export interface MediaType extends Extensions, Partial, Partial { /** A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to requestBody objects when the media type is multipart or application/x-www-form-urlencoded. */ encoding?: Dictionary; /** The schema defining the type used for the request body. */ schema?: Refable; } export interface NonBearerHTTPSecurityScheme extends Extensions { scheme: string; description?: string; type: SecurityType.Http; } export interface OAuth2SecurityScheme extends Extensions { type: SecurityType.OAuth2; flows: OAuthFlows; description?: string; } export interface OAuthFlows extends Extensions { implicit?: ImplicitOAuthFlow; password?: PasswordOAuthFlow; clientCredentials?: ClientCredentialsFlow; authorizationCode?: AuthorizationCodeOAuthFlow; } export interface OpenIdConnectSecurityScheme extends Extensions { type: SecurityType.OpenIDConnect; openIdConnectUrl: string; description?: string; } export interface HttpOperation extends Deprecatable, Extensions, Implementation { tags?: Array; summary?: string; description?: string; externalDocs?: ExternalDocumentation; operationId?: string; parameters?: ParameterReference[]; requestBody?: Refable; responses: Dictionary>; callbacks?: Dictionary>; security?: Array; servers?: Array; } export interface Deprecatable { deprecated?: boolean; } export interface HasSchema { schema: Refable; explode?: boolean; } export interface HasContent { content: Dictionary; } export interface HasExample { example: any; } export interface HasExamples { examples: Dictionary>; } export interface InCookie extends HasSchema, Partial, Partial { in: ParameterLocation.Cookie; style?: EncodingStyle.Form; } export interface InHeader extends HasSchema, Partial, Partial { in: ParameterLocation.Header; style?: EncodingStyle.Simple; } export interface InPath extends HasSchema, Partial, Partial { in: ParameterLocation.Path; style?: PathEncodingStyle; } export interface InQuery extends HasSchema, Partial, Partial { in: ParameterLocation.Query; allowReserved?: boolean; style?: QueryEncodingStyle; } export interface Parameter extends Deprecatable, Partial, Partial, Partial, Partial, Extensions { name: string; in: EnumStr; description?: string; allowEmptyValue?: boolean; required?: boolean; style?: EnumStr; allowReserved?: boolean; } export interface PasswordOAuthFlow extends Extensions { tokenUrl: string; refreshUrl?: string; scopes?: Dictionary; } export type HttpMethod = "get" | "put" | "post" | "delete" | "options" | "head" | "patch" | "trace"; export interface PathItem extends Extensions, Partial> { $ref?: string | PathItem; summary?: string; description?: string; servers?: Server[]; parameters?: ParameterReference[]; } export interface RequestBody extends Extensions { description?: string; content: Dictionary; required?: boolean; "x-ms-client-flatten"?: boolean; "x-ms-parameter-location"?: string; } export interface Response extends Extensions { description: string; headers?: Dictionary>; content?: Dictionary; links?: Dictionary>; } export interface Schema extends Deprecatable, Extensions, Implementation { type?: EnumStr; title?: string; description?: string; format?: string; nullable?: boolean; readOnly?: boolean; writeOnly?: boolean; required?: Array; multipleOf?: number; maximum?: number; exclusiveMaximum?: boolean; minimum?: number; exclusiveMinimum?: boolean; maxLength?: number; minLength?: number; pattern?: string; maxItems?: number; minItems?: number; uniqueItems?: boolean; maxProperties?: number; minProperties?: number; example?: any; default?: any; discriminator?: Discriminator; externalDocs?: ExternalDocumentation; xml?: XML; enum?: Array; not?: Refable; allOf?: Array>; oneOf?: Array>; anyOf?: Array>; items?: Refable; properties?: Dictionary>; additionalProperties?: boolean | Refable; } export interface Server extends Extensions { url: string; description?: string; variables?: Dictionary; } export interface ServerVariable extends Extensions { enum?: Array; default: string; description?: string; } export interface Tag extends Extensions { name: string; description?: string; externalDocs?: ExternalDocumentation; } export interface XML extends Extensions { name?: string; namespace?: string; prefix?: string; attribute?: boolean; wrapped?: boolean; } //# sourceMappingURL=oai3.d.ts.map