From 68a03358750a9f0afe9d717f73ebeb98be609711 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 10 Jan 2026 10:03:41 +0100 Subject: [PATCH] feat(openapi): export all oas types --- openapi-3-0/index.d.ts | 70 +++++++++++++++++++++--------------------- openapi-3-1/index.d.ts | 66 +++++++++++++++++++-------------------- openapi-3-2/index.d.ts | 66 +++++++++++++++++++-------------------- 3 files changed, 101 insertions(+), 101 deletions(-) diff --git a/openapi-3-0/index.d.ts b/openapi-3-0/index.d.ts index 825de2a..dc4e417 100644 --- a/openapi-3-0/index.d.ts +++ b/openapi-3-0/index.d.ts @@ -39,17 +39,17 @@ export type OasSchema30 = { xml?: Xml; }; -type Discriminator = { +export type Discriminator = { propertyName: string; mappings?: Record; }; -type ExternalDocs = { +export type ExternalDocs = { url: string; description?: string; }; -type Xml = { +export type Xml = { name?: string; namespace?: string; prefix?: string; @@ -68,11 +68,11 @@ export type OpenApi30 = { components?: Components; }; -type Reference = { +export type Reference = { $ref: "string"; }; -type Info = { +export type Info = { title: string; description?: string; termsOfService?: string; @@ -81,30 +81,30 @@ type Info = { version: string; }; -type Contact = { +export type Contact = { name?: string; url?: string; email?: string; }; -type License = { +export type License = { name: string; url?: string; }; -type Server = { +export type Server = { url: string; description?: string; variables?: Record; }; -type ServerVariable = { +export type ServerVariable = { enum?: string[]; default: string; description?: string; }; -type Components = { +export type Components = { schemas?: Record; responses?: Record; parameters?: Record; @@ -116,28 +116,28 @@ type Components = { callbacks: Record; }; -type Response = { +export type Response = { description: string; headers?: Record; content?: Record; links?: Record; }; -type MediaType = { +export type MediaType = { schema?: OasSchema30; example?: unknown; examples?: Record; encoding?: Record; }; -type Example = { +export type Example = { summary?: string; description?: string; value?: unknown; externalValue?: string; }; -type Header = { +export type Header = { description?: string; required?: boolean; deprecated?: boolean; @@ -151,9 +151,9 @@ type Header = { examples: Record; }; -type Paths = Record; +export type Paths = Record; -type PathItem = { +export type PathItem = { $ref?: string; summary?: string; description?: string; @@ -169,7 +169,7 @@ type PathItem = { trace?: Operation; }; -type Operation = { +export type Operation = { tags?: string[]; summary?: string; description?: string; @@ -184,17 +184,17 @@ type Operation = { servers?: Server[]; }; -type Responses = Record; +export type Responses = Record; -type SecurityRequirement = Record; +export type SecurityRequirement = Record; -type Tag = { +export type Tag = { name: string; description?: string; externalDocs?: ExternalDocs; }; -type Parameter = { +export type Parameter = { name: string; in: string; description?: string; @@ -210,73 +210,73 @@ type Parameter = { examples?: Record; }; -type RequestBody = { +export type RequestBody = { description?: string; content: Record; required?: boolean; }; -type SecurityScheme = APIKeySecurityScheme | HTTPSecurityScheme | OAuth2SecurityScheme | OpenIdConnectSecurityScheme; +export type SecurityScheme = APIKeySecurityScheme | HTTPSecurityScheme | OAuth2SecurityScheme | OpenIdConnectSecurityScheme; -type APIKeySecurityScheme = { +export type APIKeySecurityScheme = { type: "apiKey"; name: string; in: "header" | "query" | "cookie"; description?: string; }; -type HTTPSecurityScheme = { +export type HTTPSecurityScheme = { scheme: string; bearerFormat?: string; description?: string; type: "http"; }; -type OAuth2SecurityScheme = { +export type OAuth2SecurityScheme = { type: "oauth2"; flows: OAuthFlows; description?: string; }; -type OpenIdConnectSecurityScheme = { +export type OpenIdConnectSecurityScheme = { type: "openIdConnect"; openIdConnectUrl: string; description?: string; }; -type OAuthFlows = { +export type OAuthFlows = { implicit?: ImplicitOAuthFlow; password?: PasswordOAuthFlow; clientCredentials?: ClientCredentialsFlow; authorizationCode?: AuthorizationCodeOAuthFlow; }; -type ImplicitOAuthFlow = { +export type ImplicitOAuthFlow = { authorizationUrl: string; refreshUrl?: string; scopes: Record; }; -type PasswordOAuthFlow = { +export type PasswordOAuthFlow = { tokenUrl: string; refreshUrl?: string; scopes: Record; }; -type ClientCredentialsFlow = { +export type ClientCredentialsFlow = { tokenUrl: string; refreshUrl?: string; scopes: Record; }; -type AuthorizationCodeOAuthFlow = { +export type AuthorizationCodeOAuthFlow = { authorizationUrl: string; tokenUrl: string; refreshUrl?: string; scopes: Record; }; -type Link = { +export type Link = { operationId?: string; operationRef?: string; parameters?: Record; @@ -285,9 +285,9 @@ type Link = { server?: Server; }; -type Callback = Record; +export type Callback = Record; -type Encoding = { +export type Encoding = { contentType?: string; headers?: Record; style?: "form" | "spaceDelimited" | "pipeDelimited" | "deepObject"; diff --git a/openapi-3-1/index.d.ts b/openapi-3-1/index.d.ts index d87de4b..1da082a 100644 --- a/openapi-3-1/index.d.ts +++ b/openapi-3-1/index.d.ts @@ -67,17 +67,17 @@ export type OasSchema31 = boolean | { xml?: Xml; }; -type Discriminator = { +export type Discriminator = { propertyName: string; mappings?: Record; }; -type ExternalDocs = { +export type ExternalDocs = { url: string; description?: string; }; -type Xml = { +export type Xml = { name?: string; namespace?: string; prefix?: string; @@ -98,7 +98,7 @@ export type OpenApi = { components?: Components; }; -type Info = { +export type Info = { title: string; summary?: string; description?: string; @@ -108,31 +108,31 @@ type Info = { version: string; }; -type Contact = { +export type Contact = { name?: string; url?: string; email?: string; }; -type License = { +export type License = { name: string; url?: string; identifier?: string; }; -type Server = { +export type Server = { url: string; description?: string; variables?: Record; }; -type ServerVariable = { +export type ServerVariable = { enum?: string[]; default: string; description?: string; }; -type Components = { +export type Components = { schemas?: Record; responses?: Record; parameters?: Record; @@ -145,7 +145,7 @@ type Components = { pathItems?: Record; }; -type PathItem = { +export type PathItem = { summary?: string; description?: string; servers?: Server[]; @@ -160,7 +160,7 @@ type PathItem = { trace?: Operation; }; -type Operation = { +export type Operation = { tags?: string[]; summary?: string; description?: string; @@ -175,7 +175,7 @@ type Operation = { servers?: Server[]; }; -type ExternalDocumentation = { +export type ExternalDocumentation = { description?: string; url: string; }; @@ -219,32 +219,32 @@ export type Parameter = { ) ); -type ContentParameter = { +export type ContentParameter = { schema?: never; content: Record; }; -type SchemaParameter = { +export type SchemaParameter = { explode?: boolean; allowReserved?: boolean; schema: OasSchema32; content?: never; } & Examples; -type RequestBody = { +export type RequestBody = { description?: string; content: Content; required?: boolean; }; -type Content = Record; +export type Content = Record; -type MediaType = { +export type MediaType = { schema?: OasSchema31; encoding?: Record; } & Examples; -type Encoding = { +export type Encoding = { contentType?: string; headers?: Record; style?: "form" | "spaceDelimited" | "pipeDelimited" | "deepObject"; @@ -252,23 +252,23 @@ type Encoding = { allowReserved?: boolean; }; -type Response = { +export type Response = { description: string; headers?: Record; content?: Content; links?: Record; }; -type Callback = Record; +export type Callback = Record; -type Example = { +export type Example = { summary?: string; description?: string; value?: Json; externalValue?: string; }; -type Link = { +export type Link = { operationRef?: string; operationId?: string; parameters?: Record; @@ -277,7 +277,7 @@ type Link = { server?: Server; }; -type Header = { +export type Header = { description?: string; required?: boolean; deprecated?: boolean; @@ -287,19 +287,19 @@ type Header = { content?: Content; }; -type Tag = { +export type Tag = { name: string; description?: string; externalDocs?: ExternalDocumentation; }; -type Reference = { +export type Reference = { $ref: string; summary?: string; description?: string; }; -type SecurityScheme = { +export type SecurityScheme = { type: "apiKey"; description?: string; name: string; @@ -322,41 +322,41 @@ type SecurityScheme = { openIdConnectUrl: string; }; -type OauthFlows = { +export type OauthFlows = { implicit?: Implicit; password?: Password; clientCredentials?: ClientCredentials; authorizationCode?: AuthorizationCode; }; -type Implicit = { +export type Implicit = { authorizationUrl: string; refreshUrl?: string; scopes: Record; }; -type Password = { +export type Password = { tokenUrl: string; refreshUrl?: string; scopes: Record; }; -type ClientCredentials = { +export type ClientCredentials = { tokenUrl: string; refreshUrl?: string; scopes: Record; }; -type AuthorizationCode = { +export type AuthorizationCode = { authorizationUrl: string; tokenUrl: string; refreshUrl?: string; scopes: Record; }; -type SecurityRequirement = Record; +export type SecurityRequirement = Record; -type Examples = { +export type Examples = { example?: Json; examples?: Record; }; diff --git a/openapi-3-2/index.d.ts b/openapi-3-2/index.d.ts index 4158965..550192c 100644 --- a/openapi-3-2/index.d.ts +++ b/openapi-3-2/index.d.ts @@ -67,18 +67,18 @@ export type OasSchema32 = boolean | { xml?: Xml; }; -type Discriminator = { +export type Discriminator = { propertyName: string; mapping?: Record; defaultMapping?: string; }; -type ExternalDocs = { +export type ExternalDocs = { url: string; description?: string; }; -type Xml = { +export type Xml = { nodeType?: "element" | "attribute" | "text" | "cdata" | "none"; name?: string; namespace?: string; @@ -101,7 +101,7 @@ export type OpenApi = { externalDocs?: ExternalDocs; }; -type Info = { +export type Info = { title: string; summary?: string; description?: string; @@ -111,32 +111,32 @@ type Info = { version: string; }; -type Contact = { +export type Contact = { name?: string; url?: string; email?: string; }; -type License = { +export type License = { name: string; identifier?: string; url?: string; }; -type Server = { +export type Server = { url: string; description?: string; name?: string; variables?: Record; }; -type ServerVariable = { +export type ServerVariable = { enum?: string[]; default: string; description?: string; }; -type Components = { +export type Components = { schemas?: Record; responses?: Record; parameters?: Record; @@ -150,7 +150,7 @@ type Components = { mediaTypes?: Record; }; -type PathItem = { +export type PathItem = { $ref?: string; summary?: string; description?: string; @@ -168,7 +168,7 @@ type PathItem = { parameters?: (Parameter | Reference)[]; }; -type Operation = { +export type Operation = { tags?: string[]; summary?: string; description?: string; @@ -224,25 +224,25 @@ export type Parameter = { ) ); -type ContentParameter = { +export type ContentParameter = { schema?: never; content: Record; }; -type SchemaParameter = { +export type SchemaParameter = { explode?: boolean; allowReserved?: boolean; schema: OasSchema32; content?: never; }; -type RequestBody = { +export type RequestBody = { description?: string; content: Record; required?: boolean; }; -type MediaType = { +export type MediaType = { schema?: OasSchema32; itemSchema?: OasSchema32; } & Examples & ({ @@ -255,7 +255,7 @@ type MediaType = { itemEncoding?: Encoding; }); -type Encoding = { +export type Encoding = { contentType?: string; headers?: Record; style?: "form" | "spaceDelimited" | "pipeDelimited" | "deepObject"; @@ -271,11 +271,11 @@ type Encoding = { itemEncoding?: Encoding; }); -type Responses = { +export type Responses = { default?: Response | Reference; } & Record; -type Response = { +export type Response = { summary?: string; description?: string; headers?: Record; @@ -283,14 +283,14 @@ type Response = { links?: Record; }; -type Callback = Record; +export type Callback = Record; -type Examples = { +export type Examples = { example?: Json; examples?: Record; }; -type Example = { +export type Example = { summary?: string; description?: string; } & ({ @@ -305,7 +305,7 @@ type Example = { externalValue?: string; }); -type Link = { +export type Link = { operationRef?: string; operationId?: string; parameters?: Record; @@ -314,7 +314,7 @@ type Link = { server?: Server; }; -type Header = { +export type Header = { description?: string; required?: boolean; deprecated?: boolean; @@ -326,7 +326,7 @@ type Header = { content: Record; }); -type Tag = { +export type Tag = { name: string; summary?: string; description?: string; @@ -335,13 +335,13 @@ type Tag = { kind?: string; }; -type Reference = { +export type Reference = { $ref: string; summary?: string; description?: string; }; -type SecurityScheme = { +export type SecurityScheme = { type: "apiKey"; description?: string; name: string; @@ -370,7 +370,7 @@ type SecurityScheme = { deprecated?: boolean; }; -type OauthFlows = { +export type OauthFlows = { implicit?: Implicit; password?: Password; clientCredentials?: ClientCredentials; @@ -378,38 +378,38 @@ type OauthFlows = { deviceAuthorization?: DeviceAuthorization; }; -type Implicit = { +export type Implicit = { authorizationUrl: string; refreshUrl?: string; scopes: Record; }; -type Password = { +export type Password = { tokenUrl: string; refreshUrl?: string; scopes: Record; }; -type ClientCredentials = { +export type ClientCredentials = { tokenUrl: string; refreshUrl?: string; scopes: Record; }; -type AuthorizationCode = { +export type AuthorizationCode = { authorizationUrl: string; tokenUrl: string; refreshUrl?: string; scopes: Record; }; -type DeviceAuthorization = { +export type DeviceAuthorization = { deviceAuthorizationUrl: string; tokenUrl: string; refreshUrl?: string; scopes: Record; }; -type SecurityRequirement = Record; +export type SecurityRequirement = Record; export * from "../lib/index.js";