import { JSONSchema4, JSONSchema6, JSONSchema7 } from 'json-schema'; import { OpenAPIV3_1, OpenAPIV3, OpenAPIV2 } from 'openapi-types'; type JSONSchema = JSONSchema4 | JSONSchema6 | JSONSchema7; /** * @param check Data to determine if it contains a ReferenceObject (`$ref` pointer`). * @returns If the supplied data has a `$ref` pointer. */ declare function isRef(check: unknown): check is OpenAPIV3_1.ReferenceObject | OpenAPIV3.ReferenceObject; /** * Is a given object a Swagger API definition? * */ declare const isSwagger: (schema: any) => schema is OpenAPIV2.Document; /** * Is a given object an OpenAPI 3.0 API definition? * */ declare const isOpenAPI30: (schema: any) => schema is OpenAPIV3.Document; /** * Is a given object an OpenAPI 3.1 API definition? * */ declare const isOpenAPI31: (schema: any) => schema is OpenAPIV3_1.Document; /** * Data shape for taking OpenAPI operation data and converting it into HAR. * * @see {@link https://github.com/readmeio/oas/tree/main/packages/oas-to-har} */ interface DataForHAR { body?: any; cookie?: Record; formData?: Record; header?: Record; path?: Record; query?: Record; server?: { selected: number; variables?: ServerVariable; }; } type AuthForHAR = Record; interface User { [key: string]: unknown; keys?: { [key: string]: unknown; name: number | string; pass?: number | string; user?: number | string; }[]; } /** * The type of security scheme. Used by `operation.getSecurityWithTypes()` and `operation.prepareSecurity()`. */ type SecurityType = 'apiKey' | 'Basic' | 'Bearer' | 'Cookie' | 'Header' | 'http' | 'OAuth2' | 'Query'; type HttpMethods = OpenAPIV3_1.HttpMethods | OpenAPIV3.HttpMethods | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace'; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#openapi-object} */ type OASDocument = (OpenAPIV3_1.Document | OpenAPIV3.Document) & Record; type OAS31Document = OpenAPIV3_1.Document & Record; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-object} */ type ServerObject = OpenAPIV3_1.ServerObject | OpenAPIV3.ServerObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-variable-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-variable-object} */ type ServerVariableObject = OpenAPIV3_1.ServerVariableObject | OpenAPIV3.ServerVariableObject; type ServerVariablesObject = Record; type ServerVariable = Record | number | string | { default?: number | string; }>; interface Servers { selected: number; variables: ServerVariable; } /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#components-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#components-object} */ type ComponentsObject = OpenAPIV3_1.ComponentsObject | OpenAPIV3.ComponentsObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#reference-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#reference-object} */ type ReferenceObject = OpenAPIV3_1.ReferenceObject | OpenAPIV3.ReferenceObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#paths-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#paths-object} */ type PathsObject = OpenAPIV3_1.PathsObject | OpenAPIV3.PathsObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#path-item-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object} */ type PathItemObject = OpenAPIV3_1.PathItemObject | OpenAPIV3.PathItemObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operation-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operation-object} */ type OperationObject = (OpenAPIV3_1.OperationObject | OpenAPIV3.OperationObject) & Record; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameter-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-object} */ type ParameterObject = { in: 'cookie' | 'header' | 'path' | 'query'; } & (OpenAPIV3_1.ParameterObject | OpenAPIV3.ParameterObject); /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#request-body-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#request-body-object} */ type RequestBodyObject = OpenAPIV3_1.RequestBodyObject | OpenAPIV3.RequestBodyObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#media-type-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#media-type-object} */ type MediaTypeObject = OpenAPIV3_1.MediaTypeObject | OpenAPIV3.MediaTypeObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#response-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#response-object} */ type ResponseObject = OpenAPIV3_1.ResponseObject | OpenAPIV3.ResponseObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callback-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object} */ type CallbackObject = OpenAPIV3_1.CallbackObject | OpenAPIV3.CallbackObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#example-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.3.md#example-object} */ type ExampleObject = OpenAPIV3_1.ExampleObject | OpenAPIV3.ExampleObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#tag-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#tag-object} */ type TagObject = OpenAPIV3_1.TagObject | OpenAPIV3.TagObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#header-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#header-object} */ type HeaderObject = OpenAPIV3_1.HeaderObject | OpenAPIV3.HeaderObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object} */ type SchemaObject = { externalDocs?: unknown; xml?: unknown; } & { $schema?: string; components?: OpenAPIV3_1.ComponentsObject; deprecated?: boolean; example?: unknown; examples?: unknown[]; nullable?: boolean; readOnly?: boolean; writeOnly?: boolean; discriminator?: DiscriminatorObject; 'x-readme-ref-name'?: string; } & (OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaObject | JSONSchema); interface SchemaWrapper { $schema?: string; description?: string; label?: string; schema: SchemaObject; type: string; } /** * Determine if a given JSON Schema object is a valid JSON Schema object and either has a declared * `type` or is polymorphic in one form or another. * * @param check JSON Schema object to determine if it's a non-polymorphic schema. * @param isPolymorphicAllOfChild If this JSON Schema object is the child of a polymorphic `allOf`. * @returns If the JSON Schema object is a JSON Schema object. */ declare function isSchema(check: unknown, isPolymorphicAllOfChild?: boolean): check is SchemaObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#security-scheme-object} */ type SecuritySchemeObject = OpenAPIV3_1.SecuritySchemeObject | OpenAPIV3.SecuritySchemeObject; type SecuritySchemesObject = Record; type KeyedSecuritySchemeObject = SecuritySchemeObject & { /** * The key for the given security scheme object */ _key: string; /** * An array of required scopes for the given security scheme object. * Used for `oauth2` security scheme types. */ _requirements?: string[]; 'x-default'?: number | string; }; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-requirement-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#security-requirement-object} */ type SecurityRequirementObject = OpenAPIV3_1.SecurityRequirementObject | OpenAPIV3.SecurityRequirementObject; /** * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#discriminator-object} * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#discriminator-object} */ type DiscriminatorObject = OpenAPIV3.DiscriminatorObject | OpenAPIV3_1.DiscriminatorObject; /** * Mapping of discriminator schema names to their child schema names. * Used to pass information between the pre-dereference and post-dereference phases. */ type DiscriminatorChildrenMap = Map; export { type AuthForHAR, type CallbackObject, type ComponentsObject, type DataForHAR, type DiscriminatorChildrenMap, type DiscriminatorObject, type ExampleObject, type HeaderObject, type HttpMethods, type JSONSchema, type KeyedSecuritySchemeObject, type MediaTypeObject, type OAS31Document, type OASDocument, type OperationObject, type ParameterObject, type PathItemObject, type PathsObject, type ReferenceObject, type RequestBodyObject, type ResponseObject, type SchemaObject, type SchemaWrapper, type SecurityRequirementObject, type SecuritySchemeObject, type SecuritySchemesObject, type SecurityType, type ServerObject, type ServerVariable, type ServerVariableObject, type ServerVariablesObject, type Servers, type TagObject, type User, isOpenAPI30, isOpenAPI31, isRef, isSchema, isSwagger };