export type Annotation = { readonly name: string readonly description?: string readonly deprecation?: Deprecation } export type Apidoc = { readonly version: string } export type Application = { readonly key: string } export type Attribute = { readonly name: string readonly value: any readonly description?: string readonly deprecation?: Deprecation } export type Body = { readonly type: string readonly description?: string readonly deprecation?: Deprecation readonly attributes: readonly Attribute[] } export type Contact = { readonly name?: string readonly url?: string readonly email?: string } export type Deprecation = { readonly description?: string } export type Enum = { readonly name: string readonly plural: string readonly description?: string readonly deprecation?: Deprecation readonly values: readonly EnumValue[] readonly attributes: readonly Attribute[] } export type EnumValue = { readonly name: string readonly description?: string readonly deprecation?: Deprecation readonly attributes: readonly Attribute[] readonly value?: string } export type Field = { readonly name: string readonly type: string readonly description?: string readonly deprecation?: Deprecation readonly default?: string readonly required: boolean readonly minimum?: number readonly maximum?: number readonly example?: string readonly attributes: readonly Attribute[] readonly annotations: readonly string[] } export type Header = { readonly name: string readonly type: string readonly description?: string readonly deprecation?: Deprecation readonly required: boolean readonly default?: string readonly attributes: readonly Attribute[] } export type Import = { readonly uri: string readonly namespace: string readonly organization: Organization readonly application: Application readonly version: string readonly enums: readonly string[] readonly interfaces: readonly string[] readonly unions: readonly string[] readonly models: readonly string[] readonly annotations: readonly Annotation[] } export type Info = { readonly license?: License readonly contact?: Contact } export type Interface = { readonly name: string readonly plural: string readonly description?: string readonly deprecation?: Deprecation readonly fields: readonly Field[] readonly attributes: readonly Attribute[] } export type License = { readonly name: string readonly url?: string } export type Model = { readonly name: string readonly plural: string readonly description?: string readonly deprecation?: Deprecation readonly fields: readonly Field[] readonly attributes: readonly Attribute[] readonly interfaces: readonly string[] } export type Operation = { readonly method: Method readonly path: string readonly description?: string readonly deprecation?: Deprecation readonly body?: Body readonly parameters: readonly Parameter[] readonly responses: readonly Response[] readonly attributes: readonly Attribute[] } export type Organization = { readonly key: string } export type Parameter = { readonly name: string readonly type: string readonly location: ParameterLocation readonly description?: string readonly deprecation?: Deprecation readonly required: boolean readonly default?: string readonly minimum?: number readonly maximum?: number readonly example?: string readonly attributes?: readonly Attribute[] } export type Resource = { readonly type: string readonly plural: string readonly path?: string readonly description?: string readonly deprecation?: Deprecation readonly operations: readonly Operation[] readonly attributes: readonly Attribute[] } export type Response = { readonly code: number | ResponseCodeOption readonly type: string readonly headers?: readonly Header[] readonly description?: string readonly deprecation?: Deprecation readonly attributes?: readonly Attribute[] } export type Service = { readonly apidoc?: Apidoc readonly name: string readonly organization: Organization readonly application: Application readonly namespace: string readonly version: string readonly base_url?: string readonly description?: string readonly info: Info readonly headers: readonly Header[] readonly imports: readonly Import[] readonly enums: readonly Enum[] readonly interfaces: readonly Interface[] readonly unions: readonly Union[] readonly models: readonly Model[] readonly resources: readonly Resource[] readonly attributes: readonly Attribute[] readonly annotations: readonly Annotation[] } export type Union = { readonly name: string readonly plural: string readonly discriminator?: string readonly description?: string readonly deprecation?: Deprecation readonly types: readonly UnionType[] readonly attributes: readonly Attribute[] readonly interfaces: readonly string[] } export type UnionType = { readonly type: string readonly description?: string readonly deprecation?: Deprecation readonly fields?: readonly Field[] readonly attributes: readonly Attribute[] readonly default?: boolean readonly discriminator_value?: string } export type Method = | 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'CONNECT' | 'OPTIONS' | 'TRACE' export type ParameterLocation = 'Path' | 'Query' | 'Form' | 'Header' export type ResponseCodeOption = 'Default' export type JSONValue = | string | number | boolean | { readonly [x: string]: JSONValue } | readonly JSONValue[]