diff --git a/package.json b/package.json index 58b2883..a7aedc4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "lint:check": "ultracite check", "lint:fix": "ultracite fix", "repo:fix": "sherif --fix", - "sync:sponsors": "node scripts/sync-sponsors.ts" + "sync:sponsors": "node scripts/sync-sponsors.ts && git ls-files --modified --others --exclude-standard | xargs -r pnpm run lint:fix" }, "devDependencies": { "@types/node": "^26.4.0", @@ -21,8 +21,9 @@ "oxlint": "^1.80.0", "sherif": "^1.13.0", "simple-git-hooks": "^2.13.1", - "typescript": "^7.0.2", + "typescript": "^6.0.3", "ultracite": "7.10.7", + "unbuild": "^3.6.1", "vitest": "^4.1.11" }, "simple-git-hooks": { diff --git a/packages/types/README.md b/packages/types/README.md new file mode 100644 index 0000000..386d738 --- /dev/null +++ b/packages/types/README.md @@ -0,0 +1,107 @@ +# @oasty/types + +TypeScript types for the [OpenAPI Specification](https://spec.openapis.org/), covering versions 3.0, 3.1, and 3.2 with complete inline documentation. + +Each version module is authored against the latest patch release of its minor line: + +- `@oasty/types/v3.0` β€” OpenAPI [3.0.4](https://spec.openapis.org/oas/v3.0.4.html) +- `@oasty/types/v3.1` β€” OpenAPI [3.1.2](https://spec.openapis.org/oas/v3.1.2.html), reusing 3.0 types where unchanged +- `@oasty/types/v3.2` β€” OpenAPI [3.2.0](https://spec.openapis.org/oas/v3.2.0.html), reusing 3.1 types where unchanged + +## Usage + +```ts +import type { OpenAPIObject, SchemaObject } from "@oasty/types/v3.1"; + +// or via namespaces from the root export +import type { OpenAPIV3_0, OpenAPIV3_1, OpenAPIV3_2 } from "@oasty/types"; + +// SchemaObject accepts an optional data type for its data-carrying fields +// (`enum`, `default`, `example`, and in 3.1+ `const` and `examples`). +const status = { + type: "string", + enum: ["available", "pending", "sold"], + default: "available", +} satisfies SchemaObject; +``` + +Type names follow the specification's section names (`InfoObject`, `PathItemObject`, `SchemaObject`, ...), and every field carries its specification description as JSDoc, linked back to the relevant spec section. + +## Sponsors + +Like what we build over at [middleapi](https://github.com/middleapi)? You can help keep it going through [GitHub Sponsors](https://github.com/sponsors/dinwwwh) or [Open Collective](https://opencollective.com/middleapi). Every bit helps! πŸš€ + + + + + + + + +
ScreenshotOne.comScreenshotOne.com
The screenshot API for developers
MisskeyHQMisskeyHQ
Decentralized microblogging SNS born on Earth
+ +### Organization Sponsors + + + + + +
LN Markets
LN Markets
+ +### Sponsors + + + + + + + + + + + + + + + + + + + + + + + + + +
Reece McDonald
Reece McDonald
あわわわとーにゅ
あわわわとーにゅ
nk
nk
supastarter
supastarter
Dexter Miguel
Dexter Miguel
herrfugbaum
herrfugbaum
Ryota Murakami
Ryota Murakami
David Cramer
David Cramer
Valerii Petryniak
Valerii Petryniak
Valerii Strilets
Valerii Strilets
Kyle Mistele
Kyle Mistele
christ12938
christ12938
Ryan Soderberg
Ryan Soderberg
shota
shota
Ellis Driscoll
Ellis Driscoll
Hoang Nguyen
Hoang Nguyen
Orestis Ioannou
Orestis Ioannou
+ +### Backers + + + + + + + + + + + + + + + + + + + + + + + + + +
David Walsh
David Walsh
Robbe Vaes
Robbe Vaes
Aidan Sunbury
Aidan Sunbury
soonoo
soonoo
Kevin Porten
Kevin Porten
Denis
Denis
Christopher Kapic
Christopher Kapic
Tom Ballinger
Tom Ballinger
Sam
Sam
Titoine
Titoine
Igor Makowski
Igor Makowski
hanayashiki
hanayashiki
Lev Dubinets
Lev Dubinets
Kelly Peilin Chan
Kelly Peilin Chan
Guy Ariely
Guy Ariely
Alex
Alex
Andrey Gubanov
Andrey Gubanov
+ +With thanks to [37 past sponsors](https://htmlpreview.github.io/?https://github.com/middleapi/static/blob/main/sponsors.svg) who helped get Oasty here. diff --git a/packages/types/package.json b/packages/types/package.json new file mode 100644 index 0000000..6678c42 --- /dev/null +++ b/packages/types/package.json @@ -0,0 +1,70 @@ +{ + "name": "@oasty/types", + "version": "0.0.0", + "description": "TypeScript types for the OpenAPI Specification, covering versions 3.0, 3.1, and 3.2 with complete inline documentation", + "keywords": [ + "oas", + "oasty", + "openapi", + "openapi-3.0", + "openapi-3.1", + "openapi-3.2", + "openapi-types", + "specification", + "swagger", + "types", + "typescript" + ], + "homepage": "https://github.com/middleapi/oasty", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/middleapi/oasty.git", + "directory": "packages/types" + }, + "funding": [ + "https://github.com/sponsors/dinwwwh", + "https://opencollective.com/middleapi" + ], + "files": [ + "dist" + ], + "type": "module", + "sideEffects": false, + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./v3.0": "./src/v3.0.ts", + "./v3.1": "./src/v3.1.ts", + "./v3.2": "./src/v3.2.ts" + }, + "publishConfig": { + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./dist/index.d.mts", + "import": "./dist/index.mjs", + "default": "./dist/index.mjs" + }, + "./v3.0": { + "types": "./dist/v3.0.d.mts", + "import": "./dist/v3.0.mjs", + "default": "./dist/v3.0.mjs" + }, + "./v3.1": { + "types": "./dist/v3.1.d.mts", + "import": "./dist/v3.1.mjs", + "default": "./dist/v3.1.mjs" + }, + "./v3.2": { + "types": "./dist/v3.2.d.mts", + "import": "./dist/v3.2.mjs", + "default": "./dist/v3.2.mjs" + } + } + }, + "scripts": { + "build": "unbuild", + "type:check": "tsc -b" + } +} diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts new file mode 100644 index 0000000..eab7bde --- /dev/null +++ b/packages/types/src/index.ts @@ -0,0 +1,3 @@ +export type * as OpenAPIV3_0 from "./v3.0"; +export type * as OpenAPIV3_1 from "./v3.1"; +export type * as OpenAPIV3_2 from "./v3.2"; diff --git a/packages/types/src/v3.0.test-d.ts b/packages/types/src/v3.0.test-d.ts new file mode 100644 index 0000000..47e2654 --- /dev/null +++ b/packages/types/src/v3.0.test-d.ts @@ -0,0 +1,429 @@ +import type { + OpenAPIObject, + ReferenceObject, + ResponsesObject, + SchemaObject, + SecuritySchemeObject, +} from "./v3.0"; + +export const petstore = { + components: { + callbacks: { + onPetStatusChange: { + "{$request.body#/callbackUrl}": { + post: { responses: { "200": { description: "OK" } } }, + }, + }, + }, + examples: { + tags: { summary: "Example tags", value: ["dog", "cat"] }, + }, + headers: { + next: { + description: "Link to the next page", + schema: { type: "string" }, + }, + }, + links: { + next: { operationRef: "#/paths/~1pets/get" }, + }, + parameters: { + sessionCookie: { + content: { + "text/plain": { schema: { type: "string" } }, + }, + in: "cookie", + name: "session", + }, + traceId: { + in: "header", + name: "X-Trace-Id", + schema: { type: "string" }, + }, + }, + requestBodies: { + PetBody: { + content: { + "application/x-www-form-urlencoded": { + schema: { type: "object" }, + }, + }, + }, + }, + responses: { + Error: { + content: { + "application/json": { schema: { $ref: "#/components/schemas/Pet" } }, + }, + description: "An error occurred", + }, + }, + schemas: { + Animal: { + discriminator: { + mapping: { + cat: "#/components/schemas/Cat", + dog: "Dog", + }, + propertyName: "petType", + }, + oneOf: [ + { $ref: "#/components/schemas/Cat" }, + { $ref: "#/components/schemas/Dog" }, + ], + }, + AnyOfExample: { + anyOf: [{ pattern: "^[a-z]+$", type: "string" }, { type: "integer" }], + }, + Cat: { type: "object" }, + Dog: { type: "object" }, + NewPet: { + allOf: [ + { $ref: "#/components/schemas/Pet" }, + { properties: { name: { type: "string" } }, type: "object" }, + ], + }, + Pet: { + additionalProperties: false, + description: "A pet", + externalDocs: { url: "https://example.com/pet" }, + properties: { + attributes: { + additionalProperties: { type: "string" }, + maxProperties: 20, + minProperties: 0, + type: "object", + xml: { name: "attribute", wrapped: false }, + }, + friends: { + items: { $ref: "#/components/schemas/Pet" }, + maxItems: 10, + minItems: 0, + type: "array", + uniqueItems: true, + }, + id: { format: "int64", readOnly: true, type: "integer" }, + legacy: { deprecated: true, not: { type: "string" } }, + name: { maxLength: 100, minLength: 1, type: "string" }, + score: { + exclusiveMaximum: true, + exclusiveMinimum: false, + maximum: 10, + minimum: 0, + multipleOf: 0.5, + type: "number", + }, + secret: { type: "string", writeOnly: true }, + status: { + default: "available", + enum: ["available", "pending", "sold"], + example: "available", + type: "string", + }, + tag: { nullable: true, type: "string" }, + }, + required: ["id", "name"], + title: "Pet", + type: "object", + "x-schema-extension": true, + xml: { + name: "pet", + namespace: "https://example.com/schema", + prefix: "p", + }, + }, + }, + securitySchemes: { + apiKey: { + description: "API key auth", + in: "header", + name: "api_key", + type: "apiKey", + }, + basicAuth: { scheme: "basic", type: "http" }, + bearerAuth: { bearerFormat: "JWT", scheme: "bearer", type: "http" }, + oidc: { + openIdConnectUrl: + "https://example.com/.well-known/openid-configuration", + type: "openIdConnect", + }, + petstoreAuth: { + flows: { + authorizationCode: { + authorizationUrl: "https://example.com/authorize", + scopes: { "write:pets": "modify pets" }, + tokenUrl: "https://example.com/token", + }, + clientCredentials: { + refreshUrl: "https://example.com/refresh", + scopes: {}, + tokenUrl: "https://example.com/token", + }, + implicit: { + authorizationUrl: "https://example.com/authorize", + scopes: { "read:pets": "read your pets" }, + }, + password: { + scopes: {}, + tokenUrl: "https://example.com/token", + }, + }, + type: "oauth2", + }, + referenced: { $ref: "#/components/securitySchemes/apiKey" }, + }, + }, + externalDocs: { url: "https://example.com/docs" }, + info: { + contact: { + email: "apiteam@example.com", + name: "Swagger API Team", + url: "https://example.com", + }, + description: "A sample API that uses a petstore as an example.", + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html", + }, + termsOfService: "https://example.com/terms/", + title: "Swagger Petstore", + version: "1.0.0", + "x-internal-id": 42, + }, + openapi: "3.0.4", + paths: { + "/pets": { + get: { + deprecated: false, + externalDocs: { description: "More", url: "https://example.com/docs" }, + operationId: "listPets", + parameters: [ + { + allowReserved: false, + description: "How many items to return", + example: 20, + explode: false, + in: "query", + name: "limit", + required: false, + schema: { format: "int32", maximum: 100, type: "integer" }, + style: "form", + }, + { + examples: { + external: { externalValue: "https://example.com/examples/tags" }, + referenced: { $ref: "#/components/examples/tags" }, + two: { summary: "Two tags", value: "dog|cat" }, + }, + in: "query", + name: "tags", + schema: { + items: { type: "string" }, + type: "array", + }, + style: "pipeDelimited", + }, + { $ref: "#/components/parameters/traceId" }, + ], + responses: { + "200": { + content: { + "application/json": { + example: [{ id: 1, name: "Rex" }], + schema: { + items: { $ref: "#/components/schemas/Pet" }, + type: "array", + }, + }, + }, + description: "A paged array of pets", + headers: { + "x-next": { $ref: "#/components/headers/next" }, + "x-rate-limit": { + deprecated: false, + description: "Calls per hour allowed", + explode: false, + required: false, + schema: { type: "integer" }, + style: "simple", + }, + }, + links: { + byRef: { $ref: "#/components/links/next" }, + next: { + description: "The next page", + operationId: "listPets", + parameters: { limit: "$request.query.limit" }, + server: { url: "https://api.example.com/v1" }, + }, + }, + }, + "4XX": { $ref: "#/components/responses/Error" }, + default: { description: "Unexpected error" }, + }, + security: [{}, { petstoreAuth: ["read:pets"] }], + servers: [{ url: "/" }], + summary: "List all pets", + tags: ["pets"], + "x-code-samples": [], + }, + post: { + callbacks: { + byRef: { $ref: "#/components/callbacks/onPetStatusChange" }, + onPetStatusChange: { + "{$request.body#/callbackUrl}": { + post: { + requestBody: { + content: { + "application/json": { schema: { type: "object" } }, + }, + }, + responses: { "200": { description: "OK" } }, + }, + }, + }, + }, + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/NewPet" }, + }, + "multipart/form-data": { + encoding: { + metadata: { + allowReserved: false, + explode: true, + style: "form", + }, + photo: { + contentType: "image/png, image/jpeg", + headers: { + "X-Upload-Id": { schema: { type: "string" } }, + }, + }, + }, + schema: { + properties: { + metadata: { nullable: true, type: "object" }, + photo: { format: "binary", type: "string" }, + }, + type: "object", + }, + }, + }, + description: "Pet to add", + required: true, + }, + responses: { + "201": { description: "Created" }, + }, + summary: "Create a pet", + }, + summary: "Pet operations", + }, + "/pets/{petId}": { + $ref: "#/components/schemas/ignored-path-item", + delete: { + responses: { "204": { description: "Deleted" } }, + }, + parameters: [ + { + in: "path", + name: "petId", + required: true, + schema: { type: "string" }, + style: "matrix", + }, + ], + }, + "x-hidden-paths": ["/internal"], + }, + security: [{ apiKey: [] }], + servers: [ + { + description: "Main server", + url: "https://{environment}.example.com/v1", + variables: { + environment: { + default: "api", + description: "Environment prefix", + enum: ["api", "api.dev", "api.staging"], + }, + }, + }, + ], + tags: [ + { + description: "Pet operations", + externalDocs: { url: "https://example.com/docs/pets" }, + name: "pets", + "x-display-name": "Pets", + }, + ], + "x-tag-groups": [], +} satisfies OpenAPIObject; + +// @ts-expect-error: The `paths` field is REQUIRED in OpenAPI 3.0. +export const missingPaths: OpenAPIObject = { + info: { title: "API", version: "1.0.0" }, + openapi: "3.0.4", +}; + +export const noWebhooks = { + info: { title: "API", version: "1.0.0" }, + openapi: "3.0.4", + paths: {}, + // @ts-expect-error: The `webhooks` field does not exist in OpenAPI 3.0 (added in 3.1). + webhooks: {}, +} satisfies OpenAPIObject; + +export const wrongVersion = { + info: { title: "API", version: "1.0.0" }, + // @ts-expect-error: The `openapi` version string must be within the 3.0 line. + openapi: "3.1.0", + paths: {}, +} satisfies OpenAPIObject; + +export const schemaWithoutTypeArrays = { + // @ts-expect-error: A `type` array is not supported in OpenAPI 3.0 (added in 3.1). + type: ["string", "null"], +} satisfies SchemaObject; + +export const booleanExclusiveBounds = { + // @ts-expect-error: `exclusiveMinimum` is a boolean in OpenAPI 3.0, not a number. + exclusiveMinimum: 0, + type: "number", +} satisfies SchemaObject; + +// @ts-expect-error: Boolean schemas are not valid Schema Objects in OpenAPI 3.0. +export const booleanSchema = true satisfies SchemaObject; + +export const closedReference = { + $ref: "#/components/schemas/Pet", + // @ts-expect-error: The 3.0 Reference Object has no `summary`/`description` overrides. + summary: "A pet", +} satisfies ReferenceObject; + +export const noMutualTls = { + // @ts-expect-error: The `mutualTLS` security scheme type does not exist in OpenAPI 3.0. + type: "mutualTLS", +} satisfies SecuritySchemeObject; + +export const invalidStatusCodeRange = { + // @ts-expect-error: Only 1XX-5XX status codes and ranges are allowed as response keys. + "600": { description: "not a valid status code" }, + default: { description: "fallback" }, +} satisfies ResponsesObject; + +export const typedSchema = { + default: "available", + enum: ["available", "pending", "sold"], + example: "pending", + type: "string", +} satisfies SchemaObject; + +export const typedSchemaMismatch = { + // @ts-expect-error: `default` must match the schema's data type parameter. + default: 1, + type: "string", +} satisfies SchemaObject; diff --git a/packages/types/src/v3.0.ts b/packages/types/src/v3.0.ts new file mode 100644 index 0000000..eec2ae5 --- /dev/null +++ b/packages/types/src/v3.0.ts @@ -0,0 +1,1646 @@ +/** + * TypeScript types for the OpenAPI Specification v3.0, authored against the + * latest patch release 3.0.4. + * + * Type names follow the specification's section names, and every field + * carries its specification description as JSDoc. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html} + */ + +/** + * While the OpenAPI Specification tries to accommodate most use cases, + * additional data can be added to extend the specification at certain points. + * The extension fields are implemented as patterned fields that are always + * prefixed by `x-`. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#specification-extensions} + */ +export interface SpecificationExtensions { + /** + * Allows extensions to the OpenAPI Schema. The field name MUST begin with + * `x-`, for example, `x-internal-id`. The value can be any valid JSON value + * (`null`, a primitive, an array, or an object). + */ + [extension: `x-${string}`]: unknown; // oxlint-disable-line anti-slop/no-unsafe-dictionary-type -- the specification allows any JSON value here +} + +/** + * This is the root object of the OpenAPI Description. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#openapi-object} + */ +export interface OpenAPIObject extends SpecificationExtensions { + /** + * REQUIRED. This string MUST be the version number of the OpenAPI + * Specification that the OpenAPI Document uses (`major.minor.patch`, e.g. + * `"3.0.4"`). The `openapi` field SHOULD be used by tooling to interpret + * the OpenAPI Document. This is not related to the API `info.version` + * string. + */ + openapi: `3.0.${string}`; + /** + * REQUIRED. Provides metadata about the API. The metadata MAY be used by + * tooling as required. + */ + info: InfoObject; + /** + * An array of Server Objects, which provide connectivity information to a + * target server. If the `servers` field is not provided, or is an empty + * array, the default value would be a Server Object with a `url` value of + * `/`. + */ + servers?: ServerObject[]; + /** + * REQUIRED. The available paths and operations for the API. + */ + paths: PathsObject; + /** + * An element to hold various Objects for the OpenAPI Description. + */ + components?: ComponentsObject; + /** + * A declaration of which security mechanisms can be used across the API. + * The list of values includes alternative Security Requirement Objects; + * only one of them needs to be satisfied to authorize a request. Individual + * operations can override this definition. The list can be incomplete, up + * to being empty or absent. To make security explicitly optional, an empty + * security requirement (`{}`) can be included in the array. + */ + security?: SecurityRequirementObject[]; + /** + * A list of tags used by the OpenAPI Description with additional metadata. + * The order of the tags can be used to reflect on their order by the + * parsing tools. Not all tags that are used by the Operation Object must be + * declared; undeclared tags MAY be organized randomly or based on the + * tools' logic. Each tag name in the list MUST be unique. + */ + tags?: TagObject[]; + /** + * Additional external documentation. + */ + externalDocs?: ExternalDocumentationObject; +} + +/** + * The object provides metadata about the API. The metadata MAY be used by the + * clients if needed, and MAY be presented in editing or documentation + * generation tools for convenience. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#info-object} + */ +export interface InfoObject extends SpecificationExtensions { + /** + * REQUIRED. The title of the API. + */ + title: string; + /** + * A description of the API. CommonMark syntax MAY be used for rich text + * representation. + */ + description?: string; + /** + * A URL for the Terms of Service for the API. This MUST be in the form of a + * URL. + */ + termsOfService?: string; + /** + * The contact information for the exposed API. + */ + contact?: ContactObject; + /** + * The license information for the exposed API. + */ + license?: LicenseObject; + /** + * REQUIRED. The version of the OpenAPI Document (which is distinct from the + * OpenAPI Specification version, the version of the API being described, or + * the version of the OpenAPI Description). + */ + version: string; +} + +/** + * Contact information for the exposed API. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#contact-object} + */ +export interface ContactObject extends SpecificationExtensions { + /** + * The identifying name of the contact person/organization. + */ + name?: string; + /** + * The URL for the contact information. This MUST be in the form of a URL. + */ + url?: string; + /** + * The email address of the contact person/organization. This MUST be in the + * form of an email address. + */ + email?: string; +} + +/** + * License information for the exposed API. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#license-object} + */ +export interface LicenseObject extends SpecificationExtensions { + /** + * REQUIRED. The license name used for the API. + */ + name: string; + /** + * A URL for the license used for the API. This MUST be in the form of a + * URL. + */ + url?: string; +} + +/** + * An object representing a Server. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#server-object} + */ +export interface ServerObject extends SpecificationExtensions { + /** + * REQUIRED. A URL to the target host. This URL supports Server Variables + * and MAY be relative, to indicate that the host location is relative to + * the location where the document containing the Server Object is being + * served. Variable substitutions will be made when a variable is named in + * `{braces}`. + */ + url: string; + /** + * An optional string describing the host designated by the URL. CommonMark + * syntax MAY be used for rich text representation. + */ + description?: string; + /** + * A map between a variable name and its value. The value is used for + * substitution in the server's URL template. + */ + variables?: Record; +} + +/** + * An object representing a Server Variable for server URL template + * substitution. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#server-variable-object} + */ +export interface ServerVariableObject extends SpecificationExtensions { + /** + * An enumeration of string values to be used if the substitution options + * are from a limited set. The array SHOULD NOT be empty. + */ + enum?: string[]; + /** + * REQUIRED. The default value to use for substitution, which SHALL be sent + * if an alternate value is not supplied. If the `enum` is defined, the + * value SHOULD exist in the enum's values. Note that this behavior is + * different from the Schema Object's `default` keyword, which documents the + * receiver's behavior rather than inserting the value into the data. + */ + default: string; + /** + * An optional description for the server variable. CommonMark syntax MAY be + * used for rich text representation. + */ + description?: string; +} + +/** + * Holds a set of reusable objects for different aspects of the OAS. All + * objects defined within the Components Object will have no effect on the API + * unless they are explicitly referenced from outside the Components Object. + * + * All the fixed fields are objects whose keys MUST match the regular + * expression `^[a-zA-Z0-9\.\-_]+$`. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#components-object} + */ +export interface ComponentsObject extends SpecificationExtensions { + /** + * An object to hold reusable Schema Objects. + */ + schemas?: Record; + /** + * An object to hold reusable Response Objects. + */ + responses?: Record; + /** + * An object to hold reusable Parameter Objects. + */ + parameters?: Record; + /** + * An object to hold reusable Example Objects. + */ + examples?: Record; + /** + * An object to hold reusable Request Body Objects. + */ + requestBodies?: Record; + /** + * An object to hold reusable Header Objects. + */ + headers?: Record; + /** + * An object to hold reusable Security Scheme Objects. + */ + securitySchemes?: Record; + /** + * An object to hold reusable Link Objects. + */ + links?: Record; + /** + * An object to hold reusable Callback Objects. + */ + callbacks?: Record; +} + +/** + * Holds the relative paths to the individual endpoints and their operations. + * The path is appended to the URL from the Server Object in order to + * construct the full URL. The Paths Object MAY be empty, due to Access + * Control List (ACL) constraints. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#paths-object} + */ +export interface PathsObject extends SpecificationExtensions { + /** + * A relative path to an individual endpoint. The field name MUST begin with + * a forward slash (`/`). The path is appended (no relative URL resolution) + * to the expanded URL from the Server Object's `url` field in order to + * construct the full URL. Path templating is allowed. When matching URLs, + * concrete (non-templated) paths would be matched before their templated + * counterparts. Templated paths with the same hierarchy but different + * templated names MUST NOT exist as they are identical. In case of + * ambiguous matching, it is up to the tooling to decide which one to use. + */ + [path: `/${string}`]: PathItemObject; +} + +/** + * Describes the operations available on a single path. A Path Item MAY be + * empty, due to ACL constraints. The path itself is still exposed to the + * documentation viewer but they will not know which operations and parameters + * are available. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#path-item-object} + */ +export interface PathItemObject extends SpecificationExtensions { + /** + * Allows for a referenced definition of this path item. The value MUST be + * in the form of a URL, and the referenced structure MUST be in the form of + * a Path Item Object. In case a Path Item Object field appears both in the + * defined object and the referenced object, the behavior is undefined. + */ + $ref?: string; + /** + * An optional string summary, intended to apply to all operations in this + * path. + */ + summary?: string; + /** + * An optional string description, intended to apply to all operations in + * this path. CommonMark syntax MAY be used for rich text representation. + */ + description?: string; + /** + * A definition of a GET operation on this path. + */ + get?: OperationObject; + /** + * A definition of a PUT operation on this path. + */ + put?: OperationObject; + /** + * A definition of a POST operation on this path. + */ + post?: OperationObject; + /** + * A definition of a DELETE operation on this path. + */ + delete?: OperationObject; + /** + * A definition of a OPTIONS operation on this path. + */ + options?: OperationObject; + /** + * A definition of a HEAD operation on this path. + */ + head?: OperationObject; + /** + * A definition of a PATCH operation on this path. + */ + patch?: OperationObject; + /** + * A definition of a TRACE operation on this path. + */ + trace?: OperationObject; + /** + * An alternative `servers` array to service all operations in this path. + * If a `servers` array is specified at the OpenAPI Object level, it will be + * overridden by this value. + */ + servers?: ServerObject[]; + /** + * A list of parameters that are applicable for all the operations described + * under this path. These parameters can be overridden at the operation + * level, but cannot be removed there. The list MUST NOT include duplicated + * parameters; a unique parameter is defined by a combination of a name and + * location. The list can use the Reference Object to link to parameters + * defined in the OpenAPI Object's `components.parameters`. + */ + parameters?: (ParameterObject | ReferenceObject)[]; +} + +/** + * Describes a single API operation on a path. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#operation-object} + */ +export interface OperationObject extends SpecificationExtensions { + /** + * A list of tags for API documentation control. Tags can be used for + * logical grouping of operations by resources or any other qualifier. + */ + tags?: string[]; + /** + * A short summary of what the operation does. + */ + summary?: string; + /** + * A verbose explanation of the operation behavior. CommonMark syntax MAY be + * used for rich text representation. + */ + description?: string; + /** + * Additional external documentation for this operation. + */ + externalDocs?: ExternalDocumentationObject; + /** + * Unique string used to identify the operation. The id MUST be unique among + * all operations described in the API. The `operationId` value is + * case-sensitive. Tools and libraries MAY use the `operationId` to uniquely + * identify an operation, therefore, it is RECOMMENDED to follow common + * programming naming conventions. + */ + operationId?: string; + /** + * A list of parameters that are applicable for this operation. If a + * parameter is already defined in the Path Item, the new definition will + * override it but can never remove it. The list MUST NOT include duplicated + * parameters; a unique parameter is defined by a combination of a name and + * location. The list can use the Reference Object to link to parameters + * defined in the OpenAPI Object's `components.parameters`. + */ + parameters?: (ParameterObject | ReferenceObject)[]; + /** + * The request body applicable for this operation. The `requestBody` is only + * supported in HTTP methods where the HTTP 1.1 specification RFC7231 has + * explicitly defined semantics for request bodies. In other cases where the + * HTTP spec is vague (such as GET, HEAD and DELETE), `requestBody` SHALL be + * ignored by consumers. + */ + requestBody?: RequestBodyObject | ReferenceObject; + /** + * REQUIRED. The list of possible responses as they are returned from + * executing this operation. + */ + responses: ResponsesObject; + /** + * A map of possible out-of band callbacks related to the parent operation. + * The key is a unique identifier for the Callback Object. Each value in the + * map is a Callback Object that describes a request that may be initiated + * by the API provider and the expected responses. + */ + callbacks?: Record; + /** + * Declares this operation to be deprecated. Consumers SHOULD refrain from + * usage of the declared operation. + * + * @default false + */ + deprecated?: boolean; + /** + * A declaration of which security mechanisms can be used for this + * operation. Only one of the Security Requirement Objects needs to be + * satisfied to authorize a request. To make security optional, an empty + * security requirement (`{}`) can be included in the array. This definition + * overrides any declared top-level `security`. To remove a top-level + * security declaration, an empty array can be used. + */ + security?: SecurityRequirementObject[]; + /** + * An alternative `servers` array to service this operation. If a `servers` + * array is specified at the Path Item Object or OpenAPI Object level, it + * will be overridden by this value. + */ + servers?: ServerObject[]; +} + +/** + * Allows referencing an external resource for extended documentation. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#external-documentation-object} + */ +export interface ExternalDocumentationObject extends SpecificationExtensions { + /** + * A description of the target documentation. CommonMark syntax MAY be used + * for rich text representation. + */ + description?: string; + /** + * REQUIRED. The URL for the target documentation. This MUST be in the form + * of a URL. + */ + url: string; +} + +/** + * The location of a parameter. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#parameter-locations} + */ +export type ParameterLocation = "cookie" | "header" | "path" | "query"; + +/** + * Describes how a parameter value will be serialized depending on the type of + * the parameter value. In order to support common ways of serializing simple + * parameters, a set of `style` values are defined: + * + * - `"matrix"` β€” path-style parameters defined by RFC6570 (`path`). + * - `"label"` β€” label style parameters defined by RFC6570 (`path`). + * - `"simple"` β€” simple style parameters defined by RFC6570 (`path`, + * `header`). + * - `"form"` β€” form style parameters defined by RFC6570 (`query`, `cookie`). + * - `"spaceDelimited"` β€” space separated array or object values (`query`). + * - `"pipeDelimited"` β€” pipe separated array or object values (`query`). + * - `"deepObject"` β€” allows objects with scalar properties to be represented + * using form parameters; the representation of nested array or object + * properties is not defined (`query`). + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#style-values} + */ +export type ParameterStyle = + | "deepObject" + | "form" + | "label" + | "matrix" + | "pipeDelimited" + | "simple" + | "spaceDelimited"; + +/** + * The subset of `style` values that is defined for `query` parameters. The + * Encoding Object's `style` field follows the same values as `query` + * parameters. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#style-values} + */ +export type QueryParameterStyle = + | "deepObject" + | "form" + | "pipeDelimited" + | "spaceDelimited"; + +/** + * Describes a single operation parameter. + * + * A unique parameter is defined by a combination of a name and location. + * + * Parameter Objects MUST include either a `content` field or a `schema` + * field, but not both. The `style`, `explode`, `allowReserved`, `example`, + * and `examples` fields are for use with `schema`. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#parameter-object} + */ +export interface ParameterObject extends SpecificationExtensions { + /** + * REQUIRED. The name of the parameter. Parameter names are case sensitive. + * + * - If `in` is `"path"`, the `name` field MUST correspond to a template + * expression occurring within the path field in the Paths Object. + * - If `in` is `"header"` and the `name` field is `"Accept"`, + * `"Content-Type"` or `"Authorization"`, the parameter definition SHALL + * be ignored. + * - For all other cases, the `name` corresponds to the parameter name used + * by the `in` field. + */ + name: string; + /** + * REQUIRED. The location of the parameter. Possible values are `"query"`, + * `"header"`, `"path"` or `"cookie"`. + */ + in: ParameterLocation; + /** + * A brief description of the parameter. This could contain examples of use. + * CommonMark syntax MAY be used for rich text representation. + */ + description?: string; + /** + * Determines whether this parameter is mandatory. If the parameter location + * is `"path"`, this field is REQUIRED and its value MUST be `true`. + * Otherwise, the field MAY be included and its default value is `false`. + * + * @default false + */ + required?: boolean; + /** + * Specifies that a parameter is deprecated and SHOULD be transitioned out + * of usage. + * + * @default false + */ + deprecated?: boolean; + /** + * If `true`, clients MAY pass a zero-length string value in place of + * parameters that would otherwise be omitted entirely, which the server + * SHOULD interpret as the parameter being unused. If `style` is used, and + * if behavior is n/a (cannot be serialized), the value SHALL be ignored. + * This field is valid only for `query` parameters. Use of this field is NOT + * RECOMMENDED, and it is likely to be removed in a later revision. + * + * @default false + */ + allowEmptyValue?: boolean; + /** + * Describes how the parameter value will be serialized depending on the + * type of the parameter value. Default values (based on value of `in`): for + * `"query"` - `"form"`; for `"path"` - `"simple"`; for `"header"` - + * `"simple"`; for `"cookie"` - `"form"`. + */ + style?: ParameterStyle; + /** + * When true, parameter values of type `array` or `object` generate separate + * parameters for each value of the array or key-value pair of the map. For + * other types of parameters this field has no effect. When `style` is + * `"form"`, the default value is `true`; for all other styles, the default + * value is `false`. Note that despite `false` being the default for + * `deepObject`, the combination of `false` with `deepObject` is undefined. + */ + explode?: boolean; + /** + * When true, parameter values are serialized using reserved expansion, as + * defined by RFC6570, which allows RFC3986's reserved character set, as + * well as percent-encoded triples, to pass through unchanged, while still + * percent-encoding all other disallowed characters. This field only applies + * to parameters with an `in` value of `query`. + * + * @default false + */ + allowReserved?: boolean; + /** + * The schema defining the type used for the parameter. + */ + schema?: SchemaObject | ReferenceObject; + /** + * Example of the parameter's potential value. The example SHOULD match the + * specified schema and follow the prescribed serialization strategy for the + * parameter. The `example` field is mutually exclusive of the `examples` + * field. Furthermore, if referencing a `schema` that contains an example, + * the `example` value SHALL override the example provided by the schema. + */ + example?: unknown; + /** + * Examples of the parameter's potential value. Each example SHOULD contain + * a value in the correct format as specified in the parameter encoding. The + * `examples` field is mutually exclusive of the `example` field. + * Furthermore, if referencing a `schema` that contains an example, the + * `examples` value SHALL override the example provided by the schema. + */ + examples?: Record; + /** + * A map containing the representations for the parameter. The key is the + * media type and the value describes it. The map MUST only contain one + * entry. + */ + content?: Record; +} + +/** + * Describes a single request body. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#request-body-object} + */ +export interface RequestBodyObject extends SpecificationExtensions { + /** + * A brief description of the request body. This could contain examples of + * use. CommonMark syntax MAY be used for rich text representation. + */ + description?: string; + /** + * REQUIRED. The content of the request body. The key is a media type or + * media type range and the value describes it. For requests that match + * multiple keys, only the most specific key is applicable, e.g. + * `"text/plain"` overrides `"text/*"`. + */ + content: Record; + /** + * Determines if the request body is required in the request. + * + * @default false + */ + required?: boolean; +} + +/** + * Each Media Type Object provides schema and examples for the media type + * identified by its key. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#media-type-object} + */ +export interface MediaTypeObject extends SpecificationExtensions { + /** + * The schema defining the content of the request, response, parameter, or + * header. When using `multipart` content, a `schema` is REQUIRED to define + * the input parameters to the operation. + */ + schema?: SchemaObject | ReferenceObject; + /** + * Example of the media type. The example SHOULD match the specified schema + * and be in the correct format as specified by the media type and its + * encoding. The `example` field is mutually exclusive of the `examples` + * field. Furthermore, if referencing a `schema` that contains an example, + * the `example` value SHALL override the example provided by the schema. + */ + example?: unknown; + /** + * Examples of the media type. Each example SHOULD match the specified + * schema and be in the correct format as specified by the media type and + * its encoding. The `examples` field is mutually exclusive of the `example` + * field. Furthermore, if referencing a `schema` that contains an example, + * the `examples` value SHALL override the example provided by the schema. + */ + examples?: Record; + /** + * 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` field SHALL only apply to Request Body Objects, and only when + * the media type is `multipart` or `application/x-www-form-urlencoded`. If + * no Encoding Object is provided for a property, the behavior is determined + * by the default values documented for the Encoding Object. + */ + encoding?: Record; +} + +/** + * A single encoding definition applied to a single schema property. + * + * Properties are correlated with `multipart` parts via the `name` parameter + * of `Content-Disposition: form-data`, and with `application/x-www-form-urlencoded` + * via query string parameter names; ordering is implementation-defined. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#encoding-object} + */ +export interface EncodingObject extends SpecificationExtensions { + /** + * The `Content-Type` for encoding a specific property. The value is a + * comma-separated list, each element of which is either a specific media + * type (e.g. `image/png`) or a wildcard media type (e.g. `image/*`). + * Default value depends on the property type: for `string` with `format` + * being `binary` or `byte` – `application/octet-stream`; for other + * primitive types – `text/plain`; for `object` – `application/json`; for + * `array` – the default is defined based on the inner type. + */ + contentType?: string; + /** + * A map allowing additional information to be provided as headers. + * `Content-Type` is described separately and SHALL be ignored in this + * section. This field SHALL be ignored if the request body media type is + * not a `multipart`. + */ + headers?: Record; + /** + * Describes how a specific property value will be serialized depending on + * its type. See Parameter Object for details on the `style` field. The + * behavior follows the same values as `query` parameters, including default + * values. Note that the initial `?` used in query strings is not used in + * `application/x-www-form-urlencoded` message bodies, and MUST be removed + * or not added. This field SHALL be ignored if the request body media type + * is not `application/x-www-form-urlencoded`. + * + * @default "form" + */ + style?: QueryParameterStyle; + /** + * When true, property values of type `array` or `object` generate separate + * parameters for each value of the array, or key-value-pair of the map. For + * other types of properties this field has no effect. When `style` is + * `"form"`, the default value is `true`; for all other styles, the default + * value is `false`. This field SHALL be ignored if the request body media + * type is not `application/x-www-form-urlencoded`. + */ + explode?: boolean; + /** + * When true, parameter values are serialized using reserved expansion, as + * defined by RFC6570, which allows RFC3986's reserved character set, as + * well as percent-encoded triples, to pass through unchanged, while still + * percent-encoding all other disallowed characters. This field SHALL be + * ignored if the request body media type is not + * `application/x-www-form-urlencoded`. + * + * @default false + */ + allowReserved?: boolean; +} + +/** + * A container for the expected responses of an operation. The container maps + * a HTTP response code to the expected response. + * + * The Responses Object MUST contain at least one response code, and if only + * one response code is provided it SHOULD be the response for a successful + * operation call. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#responses-object} + */ +export interface ResponsesObject extends SpecificationExtensions { + /** + * The documentation of responses other than the ones declared for specific + * HTTP response codes. Use this field to cover undeclared responses. + */ + default?: ResponseObject | ReferenceObject; + /** + * Any HTTP status code can be used as the property name, but only one + * property per code, to describe the expected response for that HTTP status + * code. This field MUST be enclosed in quotation marks (for example, "200") + * for compatibility between JSON and YAML. To define a range of response + * codes, this field MAY contain the uppercase wildcard character `X`. For + * example, `2XX` represents all response codes between `200` and `299`. + * Only the following range definitions are allowed: `1XX`, `2XX`, `3XX`, + * `4XX`, and `5XX`. If a response is defined using an explicit code, the + * explicit code definition takes precedence over the range definition for + * that code. + */ + [statusCode: `${1 | 2 | 3 | 4 | 5}${string}`]: + | ResponseObject + | ReferenceObject; +} + +/** + * Describes a single response from an API operation, including design-time, + * static `links` to operations based on the response. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#response-object} + */ +export interface ResponseObject extends SpecificationExtensions { + /** + * REQUIRED. A description of the response. CommonMark syntax MAY be used + * for rich text representation. + */ + description: string; + /** + * Maps a header name to its definition. RFC7230 states header names are + * case insensitive. If a response header is defined with the name + * `"Content-Type"`, it SHALL be ignored. + */ + headers?: Record; + /** + * A map containing descriptions of potential response payloads. The key is + * a media type or media type range and the value describes it. For + * responses that match multiple keys, only the most specific key is + * applicable, e.g. `"text/plain"` overrides `"text/*"`. + */ + content?: Record; + /** + * A map of operations links that can be followed from the response. The key + * of the map is a short name for the link, following the naming constraints + * of the names for Component Objects (`^[a-zA-Z0-9\.\-_]+$`). + */ + links?: Record; +} + +/** + * A map of possible out-of-band callbacks related to the parent operation. + * Each value in the map is a Path Item Object that describes a set of + * requests that may be initiated by the API provider and the expected + * responses. + * + * Note: this object MAY be extended with Specification Extensions (`x-` + * prefixed fields), which cannot be represented in TypeScript alongside the + * arbitrary runtime-expression keys. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#callback-object} + */ +export interface CallbackObject { + /** + * A Path Item Object used to define a callback request and expected + * responses. The key is a runtime expression, evaluated in the context of a + * runtime HTTP request/response, that identifies the URL to be used for the + * callback request (e.g. `$request.body#/url`); expressions can be embedded + * into string values by surrounding them with `{}` curly braces. + */ + [expression: string]: PathItemObject; +} + +/** + * An object grouping an internal or external example value with basic + * `summary` and `description` metadata. + * + * In all cases, the example value SHOULD be compatible with the schema of its + * associated value; tooling MAY validate compatibility and reject + * incompatible examples. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#example-object} + */ +export interface ExampleObject extends SpecificationExtensions { + /** + * Short description for the example. + */ + summary?: string; + /** + * Long description for the example. CommonMark syntax MAY be used for rich + * text representation. + */ + description?: string; + /** + * Embedded literal example. The `value` field and `externalValue` field are + * mutually exclusive. To represent examples of media types that cannot + * naturally be represented in JSON or YAML, use a string value to contain + * the example, escaping where necessary. + */ + value?: unknown; + /** + * A URL that points to the literal example. This provides the capability to + * reference examples that cannot easily be included in JSON or YAML + * documents. The `value` field and `externalValue` field are mutually + * exclusive. + */ + externalValue?: string; +} + +/** + * The Link Object represents a possible design-time link for a response. The + * presence of a link does not guarantee the caller's ability to successfully + * invoke it, rather it provides a known relationship and traversal mechanism + * between responses and other operations. + * + * A linked operation MUST be identified using either an `operationRef` or + * `operationId` (mutually exclusive). + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#link-object} + */ +export interface LinkObject extends SpecificationExtensions { + /** + * A URI reference to an OAS operation. This field is mutually exclusive of + * the `operationId` field, and MUST point to an Operation Object. Relative + * `operationRef` values MAY be used to locate an existing Operation Object + * in the OpenAPI Description. + */ + operationRef?: string; + /** + * The name of an existing, resolvable OAS operation, as defined with a + * unique `operationId`. This field is mutually exclusive of the + * `operationRef` field. + */ + operationId?: string; + /** + * A map representing parameters to pass to an operation as specified with + * `operationId` or identified via `operationRef`. The key is the parameter + * name to be used (optionally qualified with the parameter location, e.g. + * `path.id` for an `id` parameter in the path), whereas the value can be a + * constant or a runtime expression to be evaluated and passed to the linked + * operation. + */ + parameters?: Record; // oxlint-disable-line anti-slop/no-unsafe-dictionary-type -- the specification allows any value or runtime expression here + /** + * A literal value or runtime expression to use as a request body when + * calling the target operation. + */ + requestBody?: unknown; + /** + * A description of the link. CommonMark syntax MAY be used for rich text + * representation. + */ + description?: string; + /** + * A server object to be used by the target operation. + */ + server?: ServerObject; +} + +/** + * Describes a single header for HTTP responses and for individual parts in + * multipart representations. + * + * The Header Object follows the structure of the Parameter Object, including + * determining its serialization strategy based on whether `schema` or + * `content` is present (mutually exclusive), with these changes: `name` MUST + * NOT be specified, it is given in the corresponding `headers` map; `in` MUST + * NOT be specified, it is implicitly in `header`; all traits that are + * affected by the location MUST be applicable to a location of `header` β€” + * `allowEmptyValue` and `allowReserved` MUST NOT be used, and `style`, if + * used, MUST be limited to `"simple"`. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#header-object} + */ +export interface HeaderObject extends SpecificationExtensions { + /** + * A brief description of the header. This could contain examples of use. + * CommonMark syntax MAY be used for rich text representation. + */ + description?: string; + /** + * Determines whether this header is mandatory. + * + * @default false + */ + required?: boolean; + /** + * Specifies that the header is deprecated and SHOULD be transitioned out of + * usage. + * + * @default false + */ + deprecated?: boolean; + /** + * Describes how the header value will be serialized. The default (and only + * legal value for headers) is `"simple"`. + * + * @default "simple" + */ + style?: "simple"; + /** + * When true, header values of type `array` or `object` generate a single + * header whose value is a comma-separated list of the array items or + * key-value pairs of the map. For other data types this field has no + * effect. + * + * @default false + */ + explode?: boolean; + /** + * The schema defining the type used for the header. + */ + schema?: SchemaObject | ReferenceObject; + /** + * Example of the header's potential value. The example SHOULD match the + * specified schema and follow the prescribed serialization strategy for the + * header. The `example` field is mutually exclusive of the `examples` + * field. Furthermore, if referencing a `schema` that contains an example, + * the `example` value SHALL override the example provided by the schema. + */ + example?: unknown; + /** + * Examples of the header's potential value. Each example SHOULD contain a + * value in the correct format as specified in the header encoding. The + * `examples` field is mutually exclusive of the `example` field. + * Furthermore, if referencing a `schema` that contains an example, the + * `examples` value SHALL override the example provided by the schema. + */ + examples?: Record; + /** + * A map containing the representations for the header. The key is the media + * type and the value describes it. The map MUST only contain one entry. + */ + content?: Record; +} + +/** + * Adds metadata to a single tag that is used by the Operation Object. It is + * not mandatory to have a Tag Object per tag defined in the Operation Object + * instances. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#tag-object} + */ +export interface TagObject extends SpecificationExtensions { + /** + * REQUIRED. The name of the tag. + */ + name: string; + /** + * A description for the tag. CommonMark syntax MAY be used for rich text + * representation. + */ + description?: string; + /** + * Additional external documentation for this tag. + */ + externalDocs?: ExternalDocumentationObject; +} + +/** + * A simple object to allow referencing other components in the OpenAPI + * Description, internally and externally. + * + * This object cannot be extended with additional properties, and any + * properties added SHALL be ignored. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#reference-object} + */ +export interface ReferenceObject { + /** + * REQUIRED. The reference string. + */ + $ref: string; +} + +/** + * The data type of a schema. Note that OpenAPI 3.0 does not support `"null"` + * as a type, nor type arrays; see the Schema Object's `nullable` field. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#data-types} + */ +export type SchemaObjectType = + | "array" + | "boolean" + | "integer" + | "number" + | "object" + | "string"; + +/** + * The Schema Object allows the definition of input and output data types. + * These types can be objects, but also primitives and arrays. This object is + * an extended subset of the JSON Schema Specification Draft Wright-00. + * + * Unless stated otherwise in a field's description, the field definitions + * follow those of JSON Schema and do not add any additional semantics. + * Additional JSON Schema keywords not defined here are strictly unsupported. + * + * @template T The type of the data instances this schema describes, applied + * to the `enum`, `default`, and `example` fields. Defaults to `unknown`; + * subschema positions (`properties`, `items`, ...) are not parameterized. + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#schema-object} + */ +export interface SchemaObject extends SpecificationExtensions { + /** + * A short title for the schema. + */ + title?: string; + /** + * A numeric instance is valid only if division by this keyword's value + * results in an integer. MUST be a number strictly greater than 0. + */ + multipleOf?: number; + /** + * An inclusive upper limit for a numeric instance, unless + * `exclusiveMaximum` is `true`. + */ + maximum?: number; + /** + * A boolean indicating whether `maximum` is an exclusive limit. Note that + * unlike OpenAPI 3.1 and modern JSON Schema, this is a boolean, not a + * number. + * + * @default false + */ + exclusiveMaximum?: boolean; + /** + * An inclusive lower limit for a numeric instance, unless + * `exclusiveMinimum` is `true`. + */ + minimum?: number; + /** + * A boolean indicating whether `minimum` is an exclusive limit. Note that + * unlike OpenAPI 3.1 and modern JSON Schema, this is a boolean, not a + * number. + * + * @default false + */ + exclusiveMinimum?: boolean; + /** + * The maximum length of a string instance. MUST be a non-negative integer. + */ + maxLength?: number; + /** + * The minimum length of a string instance. MUST be a non-negative integer. + * + * @default 0 + */ + minLength?: number; + /** + * This string SHOULD be a valid regular expression, according to the + * Ecma-262 Edition 5.1 regular expression dialect. Applies only to strings. + */ + pattern?: string; + /** + * The maximum number of items in an array instance. MUST be a non-negative + * integer. + */ + maxItems?: number; + /** + * The minimum number of items in an array instance. MUST be a non-negative + * integer. + * + * @default 0 + */ + minItems?: number; + /** + * If `true`, all items in an array instance must be unique. + * + * @default false + */ + uniqueItems?: boolean; + /** + * The maximum number of properties of an object instance. MUST be a + * non-negative integer. + */ + maxProperties?: number; + /** + * The minimum number of properties of an object instance. MUST be a + * non-negative integer. + * + * @default 0 + */ + minProperties?: number; + /** + * Property names that must be present in an object instance. Elements MUST + * be unique and the array MUST have at least one element. + */ + required?: string[]; + /** + * The instance is valid only if its value equals one of the elements in + * this array. + */ + enum?: T[]; + /** + * The data type of the schema. The value MUST be a string; multiple types + * via an array are not supported. See `nullable` for the alternative to a + * `"null"` type. Note that keywords and formats do not implicitly require + * the expected type; use `type` to constrain it. + */ + type?: SchemaObjectType; + /** + * An instance is valid against this keyword if it is valid against all + * schemas in this array. The inline or referenced schema MUST be of a + * Schema Object and not a standard JSON Schema. + */ + allOf?: (SchemaObject | ReferenceObject)[]; + /** + * An instance is valid against this keyword if it is valid against exactly + * one schema in this array. The inline or referenced schema MUST be of a + * Schema Object and not a standard JSON Schema. + */ + oneOf?: (SchemaObject | ReferenceObject)[]; + /** + * An instance is valid against this keyword if it is valid against at least + * one schema in this array. The inline or referenced schema MUST be of a + * Schema Object and not a standard JSON Schema. + */ + anyOf?: (SchemaObject | ReferenceObject)[]; + /** + * An instance is valid against this keyword if it is not valid against the + * given schema. The inline or referenced schema MUST be of a Schema Object + * and not a standard JSON Schema. + */ + not?: SchemaObject | ReferenceObject; + /** + * Describes the items of an array instance. The value MUST be an object and + * not an array. The inline or referenced schema MUST be of a Schema Object + * and not a standard JSON Schema. `items` MUST be present if `type` is + * `"array"`. + */ + items?: SchemaObject | ReferenceObject; + /** + * Describes the properties of an object instance. Property definitions MUST + * be a Schema Object and not a standard JSON Schema (inline or referenced). + */ + properties?: Record; + /** + * Describes properties of an object instance not covered by `properties`. + * The value can be a boolean or an object. The inline or referenced schema + * MUST be of a Schema Object and not a standard JSON Schema. + * + * @default true + */ + additionalProperties?: boolean | SchemaObject | ReferenceObject; + /** + * A description of the schema. CommonMark syntax MAY be used for rich text + * representation. + */ + description?: string; + /** + * The format of the data type. While relying on JSON Schema's defined + * formats, the OAS offers a few additional predefined formats: `"int32"`, + * `"int64"`, `"float"`, `"double"` (with `type: "number"`); `"byte"` + * (base64-encoded), `"binary"` (any sequence of octets), `"date"` (RFC3339 + * full-date), `"date-time"` (RFC3339 date-time), and `"password"` (a hint + * to obscure the value) (with `type: "string"`). `format` is a + * non-validating annotation by default; tools that do not recognize a + * format MAY default back to `type` alone. + */ + format?: string; + /** + * The default value represents what would be assumed by the consumer of the + * input as the value of the schema if one is not provided. Unlike JSON + * Schema, the value MUST conform to the defined `type` for the Schema + * Object defined at the same level (e.g. if `type` is `"string"`, then + * `default` can be `"foo"` but cannot be `1`). + */ + default?: T; + /** + * This keyword only takes effect if `type` is explicitly defined within the + * same Schema Object. A `true` value indicates that both `null` values and + * values of the type specified by `type` are allowed. Other Schema Object + * constraints retain their defined behavior, and therefore may disallow the + * use of `null` as a value. A `false` value leaves the specified or default + * `type` unmodified. + * + * @default false + */ + nullable?: boolean; + /** + * Adds support for polymorphism. The discriminator is used to determine + * which of a set of schemas a payload is expected to satisfy. The + * discriminator property MUST be a required field of the schema. Legal only + * when using one of the composite keywords `oneOf`, `anyOf`, `allOf`. + */ + discriminator?: DiscriminatorObject; + /** + * Relevant only for Schema Object `properties` definitions. Declares the + * property as "read only": it MAY be sent as part of a response but SHOULD + * NOT be sent as part of the request. If the property is marked `readOnly` + * and is in the `required` list, `required` takes effect on the response + * only. A property MUST NOT be marked as both `readOnly` and `writeOnly` + * being `true`. + * + * @default false + */ + readOnly?: boolean; + /** + * Relevant only for Schema Object `properties` definitions. Declares the + * property as "write only": it MAY be sent as part of a request but SHOULD + * NOT be sent as part of the response. If the property is marked + * `writeOnly` and is in the `required` list, `required` takes effect on the + * request only. A property MUST NOT be marked as both `readOnly` and + * `writeOnly` being `true`. + * + * @default false + */ + writeOnly?: boolean; + /** + * This MAY be used only on property schemas; it has no effect on root + * schemas. Adds additional metadata to describe the XML representation of + * this property. + */ + xml?: XMLObject; + /** + * Additional external documentation for this schema. + */ + externalDocs?: ExternalDocumentationObject; + /** + * A free-form field to include an example of an instance for this schema. + * To represent examples that cannot be naturally represented in JSON or + * YAML, a string value can be used to contain the example with escaping + * where necessary. + */ + example?: T; + /** + * Specifies that a schema is deprecated and SHOULD be transitioned out of + * usage. + * + * @default false + */ + deprecated?: boolean; +} + +/** + * When request bodies or response payloads may be one of a number of + * different schemas, a Discriminator Object gives a hint about the expected + * schema of the document. This hint can be used to aid in serialization, + * deserialization, and validation. + * + * The Discriminator Object is legal only when using one of the composite + * keywords `oneOf`, `anyOf`, `allOf`. Note that `discriminator` MUST NOT + * change the validation outcome of the schema. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#discriminator-object} + */ +export interface DiscriminatorObject { + /** + * REQUIRED. The name of the property in the payload that will hold the + * discriminating value. This property SHOULD be required in the payload + * schema, as the behavior when the property is absent is undefined. + */ + propertyName: string; + /** + * An object to hold mappings between payload values and schema names or URI + * references. The value of the property named in `propertyName` is used as + * the name of the associated schema under the Components Object unless a + * `mapping` is present for that value. To force a value to be treated as a + * relative URI reference rather than a schema name, authors MUST prefix it + * with the `"."` path segment (e.g. `"./foo"`). Mapping keys MUST be string + * values. + */ + mapping?: Record; +} + +/** + * A metadata object that allows for more fine-tuned XML model definitions. + * + * When using arrays, XML element names are not inferred (for singular/plural + * forms) and the `name` field SHOULD be used to add that information. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#xml-object} + */ +export interface XMLObject extends SpecificationExtensions { + /** + * Replaces the name of the element/attribute used for the described schema + * property. When defined within `items`, it will affect the name of the + * individual XML elements within the list. When defined alongside `type` + * being `"array"` (outside the `items`), it will affect the wrapping + * element if and only if `wrapped` is `true`; if `wrapped` is `false`, it + * will be ignored. + */ + name?: string; + /** + * The URI of the namespace definition. Value MUST be in the form of a + * non-relative URI. + */ + namespace?: string; + /** + * The prefix to be used for the name. + */ + prefix?: string; + /** + * Declares whether the property definition translates to an attribute + * instead of an element. + * + * @default false + */ + attribute?: boolean; + /** + * MAY be used only for an array definition. Signifies whether the array is + * wrapped (e.g. ``) or unwrapped + * (``). The definition takes effect only when defined + * alongside `type` being `"array"` (outside the `items`). + * + * @default false + */ + wrapped?: boolean; +} + +/** + * The type of a security scheme. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object} + */ +export type SecuritySchemeType = "apiKey" | "http" | "oauth2" | "openIdConnect"; + +/** + * Defines an API key security scheme that can be used by the operations. The + * API key can be sent via a header, cookie, or query parameter. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object} + */ +export interface ApiKeySecuritySchemeObject extends SpecificationExtensions { + /** + * REQUIRED. The type of the security scheme. + */ + type: "apiKey"; + /** + * A description for security scheme. CommonMark syntax MAY be used for rich + * text representation. + */ + description?: string; + /** + * REQUIRED. The name of the header, query or cookie parameter to be used. + */ + name: string; + /** + * REQUIRED. The location of the API key. Valid values are `"query"`, + * `"header"`, or `"cookie"`. + */ + in: "cookie" | "header" | "query"; +} + +/** + * Defines an HTTP authentication security scheme that can be used by the + * operations. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object} + */ +export interface HttpSecuritySchemeObject extends SpecificationExtensions { + /** + * REQUIRED. The type of the security scheme. + */ + type: "http"; + /** + * A description for security scheme. CommonMark syntax MAY be used for rich + * text representation. + */ + description?: string; + /** + * REQUIRED. The name of the HTTP Authentication scheme to be used in the + * Authorization header as defined in RFC7235. The values used SHOULD be + * registered in the IANA Authentication Scheme registry. The value is + * case-insensitive. + */ + scheme: string; + /** + * A hint to the client to identify how the bearer token is formatted. + * Bearer tokens are usually generated by an authorization server, so this + * information is primarily for documentation purposes. Applies to `http` + * schemes with a `"bearer"` scheme value. + */ + bearerFormat?: string; +} + +/** + * Defines an OAuth2 security scheme that can be used by the operations, using + * OAuth2's common flows (implicit, password, client credentials, and + * authorization code) as defined in RFC6749. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object} + */ +export interface OAuth2SecuritySchemeObject extends SpecificationExtensions { + /** + * REQUIRED. The type of the security scheme. + */ + type: "oauth2"; + /** + * A description for security scheme. CommonMark syntax MAY be used for rich + * text representation. + */ + description?: string; + /** + * REQUIRED. An object containing configuration information for the flow + * types supported. + */ + flows: OAuthFlowsObject; +} + +/** + * Defines an OpenID Connect security scheme that can be used by the + * operations. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object} + */ +export interface OpenIdConnectSecuritySchemeObject extends SpecificationExtensions { + /** + * REQUIRED. The type of the security scheme. + */ + type: "openIdConnect"; + /** + * A description for security scheme. CommonMark syntax MAY be used for rich + * text representation. + */ + description?: string; + /** + * REQUIRED. Well-known URL to discover the OpenID Connect Discovery + * provider metadata. + */ + openIdConnectUrl: string; +} + +/** + * Defines a security scheme that can be used by the operations. Supported + * schemes are HTTP authentication, an API key (either as a header, a cookie + * parameter, or as a query parameter), OAuth2's common flows (implicit, + * password, client credentials, and authorization code) as defined in + * RFC6749, and OpenID Connect Discovery. + * + * The implicit flow is subject to deprecation by the OAuth 2.0 Security Best + * Current Practice; the Authorization Code Grant flow with PKCE is + * recommended for most use cases. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object} + */ +export type SecuritySchemeObject = + | ApiKeySecuritySchemeObject + | HttpSecuritySchemeObject + | OAuth2SecuritySchemeObject + | OpenIdConnectSecuritySchemeObject; + +/** + * Allows configuration of the supported OAuth Flows. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#oauth-flows-object} + */ +export interface OAuthFlowsObject extends SpecificationExtensions { + /** + * Configuration for the OAuth Implicit flow. + */ + implicit?: ImplicitOAuthFlowObject; + /** + * Configuration for the OAuth Resource Owner Password flow. + */ + password?: PasswordOAuthFlowObject; + /** + * Configuration for the OAuth Client Credentials flow. Previously called + * `application` in OpenAPI 2.0. + */ + clientCredentials?: ClientCredentialsOAuthFlowObject; + /** + * Configuration for the OAuth Authorization Code flow. Previously called + * `accessCode` in OpenAPI 2.0. + */ + authorizationCode?: AuthorizationCodeOAuthFlowObject; +} + +/** + * Configuration details common to all supported OAuth Flows. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#oauth-flow-object} + */ +export interface OAuthFlowObjectBase extends SpecificationExtensions { + /** + * The URL to be used for obtaining refresh tokens. This MUST be in the form + * of a URL. The OAuth2 standard requires the use of TLS. + */ + refreshUrl?: string; + /** + * REQUIRED. The available scopes for the OAuth2 security scheme. A map + * between the scope name and a short description for it. The map MAY be + * empty. + */ + scopes: Record; +} + +/** + * Configuration details for the OAuth Implicit flow. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#oauth-flow-object} + */ +export interface ImplicitOAuthFlowObject extends OAuthFlowObjectBase { + /** + * REQUIRED. The authorization URL to be used for this flow. This MUST be in + * the form of a URL. The OAuth2 standard requires the use of TLS. + */ + authorizationUrl: string; +} + +/** + * Configuration details for the OAuth Resource Owner Password flow. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#oauth-flow-object} + */ +export interface PasswordOAuthFlowObject extends OAuthFlowObjectBase { + /** + * REQUIRED. The token URL to be used for this flow. This MUST be in the + * form of a URL. The OAuth2 standard requires the use of TLS. + */ + tokenUrl: string; +} + +/** + * Configuration details for the OAuth Client Credentials flow. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#oauth-flow-object} + */ +export interface ClientCredentialsOAuthFlowObject extends OAuthFlowObjectBase { + /** + * REQUIRED. The token URL to be used for this flow. This MUST be in the + * form of a URL. The OAuth2 standard requires the use of TLS. + */ + tokenUrl: string; +} + +/** + * Configuration details for the OAuth Authorization Code flow. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#oauth-flow-object} + */ +export interface AuthorizationCodeOAuthFlowObject extends OAuthFlowObjectBase { + /** + * REQUIRED. The authorization URL to be used for this flow. This MUST be in + * the form of a URL. The OAuth2 standard requires the use of TLS. + */ + authorizationUrl: string; + /** + * REQUIRED. The token URL to be used for this flow. This MUST be in the + * form of a URL. The OAuth2 standard requires the use of TLS. + */ + tokenUrl: string; +} + +/** + * Configuration details for a supported OAuth Flow. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#oauth-flow-object} + */ +export type OAuthFlowObject = + | AuthorizationCodeOAuthFlowObject + | ClientCredentialsOAuthFlowObject + | ImplicitOAuthFlowObject + | PasswordOAuthFlowObject; + +/** + * Lists the required security schemes to execute this operation or the API as + * a whole. A Security Requirement Object MAY refer to multiple security + * schemes, in which case all schemes MUST be satisfied for a request to be + * authorized. + * + * When a list of Security Requirement Objects is defined on the OpenAPI + * Object or Operation Object, only one of the Security Requirement Objects in + * the list needs to be satisfied to authorize the request. An empty Security + * Requirement Object (`{}`) indicates anonymous access is supported. + * + * @see {@link https://spec.openapis.org/oas/v3.0.4.html#security-requirement-object} + */ +export interface SecurityRequirementObject { + /** + * Each name MUST correspond to a security scheme which is declared in the + * Security Schemes under the Components Object. If the security scheme is + * of type `"oauth2"` or `"openIdConnect"`, then the value is a list of + * scope names required for the execution, and the list MAY be empty if + * authorization does not require a specified scope. For other security + * scheme types, the array MUST be empty. + */ + [name: string]: string[]; +} diff --git a/packages/types/src/v3.1.test-d.ts b/packages/types/src/v3.1.test-d.ts new file mode 100644 index 0000000..b2108f9 --- /dev/null +++ b/packages/types/src/v3.1.test-d.ts @@ -0,0 +1,175 @@ +import type { OpenAPIObject, PathItemObject, SchemaObject } from "./v3.1"; + +export const webhooksOnly = { + components: { + pathItems: { + petWebhook: { + post: { responses: { "200": { description: "OK" } } }, + }, + }, + schemas: { + Animal: { + discriminator: { + mapping: { pet: "Pet" }, + propertyName: "petType", + "x-extension": "allowed in 3.1", + }, + oneOf: [ + { + $ref: "#/components/schemas/Pet", + description: "sibling keywords allowed", + }, + { type: "string" }, + ], + }, + Pet: { + $defs: { + item: { + $dynamicAnchor: "item", + type: "string", + }, + }, + $id: "https://example.com/schemas/pet", + $schema: "https://spec.openapis.org/oas/3.1/dialect/base", + deprecated: false, + example: { id: 1, name: "Rex" }, + examples: [{ id: 1, name: "Rex" }], + properties: { + anything: true, + avatar: { + contentEncoding: "base64", + contentMediaType: "image/png", + type: "string", + }, + conditional: { + else: { required: ["bField"] }, + if: { properties: { kind: { const: "a" } } }, + // oxlint-disable-next-line unicorn/no-thenable -- `then` is a JSON Schema keyword + then: { required: ["aField"] }, + }, + config: { + additionalProperties: { type: "string" }, + dependentRequired: { credit: ["billing"] }, + dependentSchemas: { + credit: { required: ["billing"] }, + }, + propertyNames: { pattern: "^[a-z]+$" }, + type: "object", + unevaluatedProperties: false, + }, + coordinates: { + contains: { type: "number" }, + items: false, + minContains: 1, + prefixItems: [{ type: "number" }, { type: "number" }], + type: "array", + }, + dynamic: { $dynamicRef: "#item" }, + id: { format: "int64", type: "integer" }, + name: { type: "string" }, + nothing: false, + nullable: { type: "null" }, + score: { + exclusiveMaximum: 10, + exclusiveMinimum: 0, + type: "number", + }, + status: { const: "available" }, + tag: { type: ["string", "null"] }, + }, + required: ["id", "name"], + type: "object", + "unprefixed-extension": { anything: "goes" }, + "x-prefixed-extension": true, + }, + }, + securitySchemes: { + mtls: { description: "Client certificate", type: "mutualTLS" }, + }, + }, + info: { + license: { identifier: "MIT", name: "MIT" }, + summary: "A webhook-only API description", + title: "Webhook Example", + version: "1.0.0", + }, + jsonSchemaDialect: "https://spec.openapis.org/oas/3.1/dialect/base", + openapi: "3.1.2", + security: [{ mtls: ["admin-role"] }], + webhooks: { + newPet: { + post: { + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/Pet" }, + }, + }, + description: "Information about a new pet", + }, + responses: { + "200": { description: "Webhook processed" }, + }, + }, + }, + referenced: { $ref: "#/components/pathItems/petWebhook" }, + }, +} satisfies OpenAPIObject; + +export const referenceOverrides = { + info: { title: "API", version: "1.0.0" }, + openapi: "3.1.0", + paths: { + "/pets": { + get: { + // `responses` is no longer REQUIRED in 3.1. + parameters: [ + { + $ref: "#/components/parameters/limit", + description: "Overridden description", + summary: "Overridden summary", + }, + ], + }, + }, + }, +} satisfies OpenAPIObject; + +export const wrongVersion = { + info: { title: "API", version: "1.0.0" }, + // @ts-expect-error: The `openapi` version string must be within the 3.1 line. + openapi: "3.0.4", + paths: {}, +} satisfies OpenAPIObject; + +// Boolean schemas are valid Schema Objects in OpenAPI 3.1. +export const booleanSchema = true satisfies SchemaObject; + +export const numericExclusiveBounds = { + // @ts-expect-error: `exclusiveMaximum` is a number in OpenAPI 3.1, not a 3.0-style boolean. + exclusiveMaximum: true, + type: "number", +} satisfies SchemaObject; + +export const noQueryMethod = { + // @ts-expect-error: The QUERY method does not exist before OpenAPI 3.2. + query: { responses: { "200": { description: "OK" } } }, +} satisfies PathItemObject; + +export const noAdditionalOperations = { + // @ts-expect-error: `additionalOperations` does not exist before OpenAPI 3.2. + additionalOperations: {}, +} satisfies PathItemObject; + +export const typedSchema = { + const: "fixed", + default: "fixed", + examples: ["fixed"], + type: "string", +} satisfies SchemaObject; + +export const typedSchemaMismatch = { + // @ts-expect-error: `examples` entries must match the schema's data type parameter. + examples: [1], + type: "string", +} satisfies SchemaObject; diff --git a/packages/types/src/v3.1.ts b/packages/types/src/v3.1.ts new file mode 100644 index 0000000..59f94e5 --- /dev/null +++ b/packages/types/src/v3.1.ts @@ -0,0 +1,1495 @@ +/** + * TypeScript types for the OpenAPI Specification v3.1, authored against the + * latest patch release 3.1.2. + * + * Types that are structurally identical to OpenAPI 3.0 (including everything + * they reference) are re-exported from `./v3.0`; every other type is + * redefined here. The most significant difference is that the 3.1 Schema + * Object is a superset of JSON Schema Draft 2020-12, so `nullable` is gone + * (use `type` arrays including `"null"`), `$ref` is a plain schema keyword + * (no more `Schema Object | Reference Object` unions), and boolean schemas + * are valid Schema Objects. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html} + */ + +import type { + ContactObject, + ExampleObject, + ExternalDocumentationObject, + LinkObject, + ParameterLocation, + ParameterStyle, + QueryParameterStyle, + SpecificationExtensions, + TagObject, + XMLObject, + ApiKeySecuritySchemeObject, + HttpSecuritySchemeObject, + OAuth2SecuritySchemeObject, + OpenIdConnectSecuritySchemeObject, +} from "./v3.0"; + +export type { + ApiKeySecuritySchemeObject, + AuthorizationCodeOAuthFlowObject, + ClientCredentialsOAuthFlowObject, + ContactObject, + ExampleObject, + ExternalDocumentationObject, + HttpSecuritySchemeObject, + ImplicitOAuthFlowObject, + LinkObject, + OAuth2SecuritySchemeObject, + OAuthFlowObject, + OAuthFlowObjectBase, + OAuthFlowsObject, + OpenIdConnectSecuritySchemeObject, + ParameterLocation, + ParameterStyle, + PasswordOAuthFlowObject, + QueryParameterStyle, + SpecificationExtensions, + TagObject, + XMLObject, +} from "./v3.0"; + +/** + * An object representing a Server. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#server-object} + */ +export interface ServerObject extends SpecificationExtensions { + /** + * REQUIRED. A URL to the target host. This URL supports Server Variables + * and MAY be relative, to indicate that the host location is relative to + * the location where the document containing the Server Object is being + * served. Query and fragment MUST NOT be part of this URL. Variable + * substitutions will be made when a variable is named in `{braces}`. + */ + url: string; + /** + * An optional string describing the host designated by the URL. CommonMark + * syntax MAY be used for rich text representation. + */ + description?: string; + /** + * A map between a variable name and its value. The value is used for + * substitution in the server's URL template. + */ + variables?: Record; +} + +/** + * An object representing a Server Variable for server URL template + * substitution. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#server-variable-object} + */ +export interface ServerVariableObject extends SpecificationExtensions { + /** + * An enumeration of string values to be used if the substitution options + * are from a limited set. The array MUST NOT be empty. + */ + enum?: string[]; + /** + * REQUIRED. The default value to use for substitution, which SHALL be sent + * if an alternate value is not supplied. If the `enum` is defined, the + * value MUST exist in the enum's values. Note that this behavior is + * different from the Schema Object's `default` keyword, which documents the + * receiver's behavior rather than inserting the value into the data. + */ + default: string; + /** + * An optional description for the server variable. CommonMark syntax MAY be + * used for rich text representation. + */ + description?: string; +} + +/** + * This is the root object of the OpenAPI Description. + * + * An OpenAPI Description MUST contain at least one of `paths`, `components`, + * or `webhooks`. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#openapi-object} + */ +export interface OpenAPIObject extends SpecificationExtensions { + /** + * REQUIRED. This string MUST be the version number of the OpenAPI + * Specification that the OpenAPI Document uses. The `openapi` field SHOULD + * be used by tooling to interpret the OpenAPI Document. This is not related + * to the API `info.version` string. + */ + openapi: `3.1.${string}`; + /** + * REQUIRED. Provides metadata about the API. The metadata MAY be used by + * tooling as required. + */ + info: InfoObject; + /** + * The default value for the `$schema` keyword within Schema Objects + * contained within this OAS document. This MUST be in the form of a URI. + */ + jsonSchemaDialect?: string; + /** + * An array of Server Objects, which provide connectivity information to a + * target server. If the `servers` field is not provided, or is an empty + * array, the default value would be a Server Object with a `url` value of + * `/`. + */ + servers?: ServerObject[]; + /** + * The available paths and operations for the API. + */ + paths?: PathsObject; + /** + * The incoming webhooks that MAY be received as part of this API and that + * the API consumer MAY choose to implement. Closely related to the + * `callbacks` feature, this section describes requests initiated other than + * by an API call, for example by an out-of-band registration. The key name + * is a unique string to refer to each webhook, while the (optionally + * referenced) Path Item Object describes a request that may be initiated by + * the API provider and the expected responses. + */ + webhooks?: Record; + /** + * An element to hold various Objects for the OpenAPI Description. + */ + components?: ComponentsObject; + /** + * A declaration of which security mechanisms can be used across the API. + * The list of values includes alternative Security Requirement Objects; + * only one of them needs to be satisfied to authorize a request. Individual + * operations can override this definition. The list can be incomplete, up + * to being empty or absent. To make security explicitly optional, an empty + * security requirement (`{}`) can be included in the array. + */ + security?: SecurityRequirementObject[]; + /** + * A list of tags used by the OpenAPI Description with additional metadata. + * The order of the tags can be used to reflect on their order by the + * parsing tools. Not all tags that are used by the Operation Object must be + * declared; undeclared tags MAY be organized randomly or based on the + * tools' logic. Each tag name in the list MUST be unique. + */ + tags?: TagObject[]; + /** + * Additional external documentation. + */ + externalDocs?: ExternalDocumentationObject; +} + +/** + * The object provides metadata about the API. The metadata MAY be used by the + * clients if needed, and MAY be presented in editing or documentation + * generation tools for convenience. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#info-object} + */ +export interface InfoObject extends SpecificationExtensions { + /** + * REQUIRED. The title of the API. + */ + title: string; + /** + * A short summary of the API. + */ + summary?: string; + /** + * A description of the API. CommonMark syntax MAY be used for rich text + * representation. + */ + description?: string; + /** + * A URI for the Terms of Service for the API. This MUST be in the form of a + * URI. + */ + termsOfService?: string; + /** + * The contact information for the exposed API. + */ + contact?: ContactObject; + /** + * The license information for the exposed API. + */ + license?: LicenseObject; + /** + * REQUIRED. The version of the OpenAPI Document (which is distinct from the + * OpenAPI Specification version, the version of the API being described, or + * the version of the OpenAPI Description). + */ + version: string; +} + +/** + * License information for the exposed API. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#license-object} + */ +export interface LicenseObject extends SpecificationExtensions { + /** + * REQUIRED. The license name used for the API. + */ + name: string; + /** + * An SPDX license expression for the API. The `identifier` field is + * mutually exclusive of the `url` field. + */ + identifier?: string; + /** + * A URI for the license used for the API. This MUST be in the form of a + * URI. The `url` field is mutually exclusive of the `identifier` field. + */ + url?: string; +} + +/** + * Holds a set of reusable objects for different aspects of the OAS. All + * objects defined within the Components Object will have no effect on the API + * unless they are explicitly referenced from outside the Components Object. + * + * All the fixed fields are objects whose keys MUST match the regular + * expression `^[a-zA-Z0-9\.\-_]+$`. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#components-object} + */ +export interface ComponentsObject extends SpecificationExtensions { + /** + * An object to hold reusable Schema Objects. Note that the values are not + * unioned with the Reference Object: in OpenAPI 3.1, `$ref` is a JSON + * Schema keyword of the Schema Object itself. + */ + schemas?: Record; + /** + * An object to hold reusable Response Objects. + */ + responses?: Record; + /** + * An object to hold reusable Parameter Objects. + */ + parameters?: Record; + /** + * An object to hold reusable Example Objects. + */ + examples?: Record; + /** + * An object to hold reusable Request Body Objects. + */ + requestBodies?: Record; + /** + * An object to hold reusable Header Objects. + */ + headers?: Record; + /** + * An object to hold reusable Security Scheme Objects. + */ + securitySchemes?: Record; + /** + * An object to hold reusable Link Objects. + */ + links?: Record; + /** + * An object to hold reusable Callback Objects. + */ + callbacks?: Record; + /** + * An object to hold reusable Path Item Objects. Note that the values are + * not unioned with the Reference Object: the Path Item Object has its own + * `$ref` field. + */ + pathItems?: Record; +} + +/** + * Holds the relative paths to the individual endpoints and their operations. + * The path is appended to the URL from the Server Object in order to + * construct the full URL. The Paths Object MAY be empty, due to Access + * Control List (ACL) constraints. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#paths-object} + */ +export interface PathsObject extends SpecificationExtensions { + /** + * A relative path to an individual endpoint. The field name MUST begin with + * a forward slash (`/`). The path is appended (no relative URL resolution) + * to the expanded URL from the Server Object's `url` field in order to + * construct the full URL. Path templating is allowed. When matching URLs, + * concrete (non-templated) paths would be matched before their templated + * counterparts. Templated paths with the same hierarchy but different + * templated names MUST NOT exist as they are identical. In case of + * ambiguous matching, it is up to the tooling to decide which one to use. + */ + [path: `/${string}`]: PathItemObject; +} + +/** + * Describes the operations available on a single path. A Path Item MAY be + * empty, due to ACL constraints. The path itself is still exposed to the + * documentation viewer but they will not know which operations and parameters + * are available. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#path-item-object} + */ +export interface PathItemObject extends SpecificationExtensions { + /** + * Allows for a referenced definition of this path item. The value MUST be + * in the form of a URI, and the referenced structure MUST be in the form of + * a Path Item Object. In case a Path Item Object field appears both in the + * defined object and the referenced object, the behavior is undefined. Note + * that the behavior of `$ref` with adjacent properties is likely to change + * in future versions of this specification to bring it into closer + * alignment with the behavior of the Reference Object. + */ + $ref?: string; + /** + * An optional string summary, intended to apply to all operations in this + * path. + */ + summary?: string; + /** + * An optional string description, intended to apply to all operations in + * this path. CommonMark syntax MAY be used for rich text representation. + */ + description?: string; + /** + * A definition of a GET operation on this path. + */ + get?: OperationObject; + /** + * A definition of a PUT operation on this path. + */ + put?: OperationObject; + /** + * A definition of a POST operation on this path. + */ + post?: OperationObject; + /** + * A definition of a DELETE operation on this path. + */ + delete?: OperationObject; + /** + * A definition of an OPTIONS operation on this path. + */ + options?: OperationObject; + /** + * A definition of a HEAD operation on this path. + */ + head?: OperationObject; + /** + * A definition of a PATCH operation on this path. + */ + patch?: OperationObject; + /** + * A definition of a TRACE operation on this path. + */ + trace?: OperationObject; + /** + * An alternative `servers` array to service all operations in this path. + * If a `servers` array is specified at the OpenAPI Object level, it will be + * overridden by this value. + */ + servers?: ServerObject[]; + /** + * A list of parameters that are applicable for all the operations described + * under this path. These parameters can be overridden at the operation + * level, but cannot be removed there. The list MUST NOT include duplicated + * parameters; a unique parameter is defined by a combination of a name and + * location. The list can use the Reference Object to link to parameters + * defined in the Components Object's `parameters`. + */ + parameters?: (ParameterObject | ReferenceObject)[]; +} + +/** + * Describes a single API operation on a path. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#operation-object} + */ +export interface OperationObject extends SpecificationExtensions { + /** + * A list of tags for API documentation control. Tags can be used for + * logical grouping of operations by resources or any other qualifier. + */ + tags?: string[]; + /** + * A short summary of what the operation does. + */ + summary?: string; + /** + * A verbose explanation of the operation behavior. CommonMark syntax MAY be + * used for rich text representation. + */ + description?: string; + /** + * Additional external documentation for this operation. + */ + externalDocs?: ExternalDocumentationObject; + /** + * Unique string used to identify the operation. The id MUST be unique among + * all operations described in the API. The `operationId` value is + * case-sensitive. Tools and libraries MAY use the `operationId` to uniquely + * identify an operation, therefore, it is RECOMMENDED to follow common + * programming naming conventions. + */ + operationId?: string; + /** + * A list of parameters that are applicable for this operation. If a + * parameter is already defined in the Path Item, the new definition will + * override it but can never remove it. The list MUST NOT include duplicated + * parameters; a unique parameter is defined by a combination of a name and + * location. The list can use the Reference Object to link to parameters + * defined in the Components Object's `parameters`. + */ + parameters?: (ParameterObject | ReferenceObject)[]; + /** + * The request body applicable for this operation. The `requestBody` is + * fully supported in HTTP methods where the HTTP 1.1 specification RFC7231 + * has explicitly defined semantics for request bodies. In other cases where + * the HTTP spec is vague (such as GET, HEAD and DELETE), `requestBody` is + * permitted but does not have well-defined semantics and SHOULD be avoided + * if possible. + */ + requestBody?: RequestBodyObject | ReferenceObject; + /** + * The list of possible responses as they are returned from executing this + * operation. + */ + responses?: ResponsesObject; + /** + * A map of possible out-of band callbacks related to the parent operation. + * The key is a unique identifier for the Callback Object. Each value in the + * map is a Callback Object that describes a request that may be initiated + * by the API provider and the expected responses. + */ + callbacks?: Record; + /** + * Declares this operation to be deprecated. Consumers SHOULD refrain from + * usage of the declared operation. + * + * @default false + */ + deprecated?: boolean; + /** + * A declaration of which security mechanisms can be used for this + * operation. Only one of the Security Requirement Objects needs to be + * satisfied to authorize a request. To make security optional, an empty + * security requirement (`{}`) can be included in the array. This definition + * overrides any declared top-level `security`. To remove a top-level + * security declaration, an empty array can be used. + */ + security?: SecurityRequirementObject[]; + /** + * An alternative `servers` array to service this operation. If a `servers` + * array is specified at the Path Item Object or OpenAPI Object level, it + * will be overridden by this value. + */ + servers?: ServerObject[]; +} + +/** + * Describes a single operation parameter. + * + * A unique parameter is defined by a combination of a name and location. + * + * Parameter Objects MUST include either a `content` field or a `schema` + * field, but not both. The `style`, `explode`, `allowReserved`, `example`, + * and `examples` fields are for use with `schema`. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#parameter-object} + */ +export interface ParameterObject extends SpecificationExtensions { + /** + * REQUIRED. The name of the parameter. Parameter names are case sensitive. + * + * - If `in` is `"path"`, the `name` field MUST correspond to a template + * expression occurring within the path field in the Paths Object. + * - If `in` is `"header"` and the `name` field is `"Accept"`, + * `"Content-Type"` or `"Authorization"`, the parameter definition SHALL + * be ignored. + * - For all other cases, the `name` corresponds to the parameter name used + * by the `in` field. + */ + name: string; + /** + * REQUIRED. The location of the parameter. Possible values are `"query"`, + * `"header"`, `"path"` or `"cookie"`. + */ + in: ParameterLocation; + /** + * A brief description of the parameter. This could contain examples of use. + * CommonMark syntax MAY be used for rich text representation. + */ + description?: string; + /** + * Determines whether this parameter is mandatory. If the parameter location + * is `"path"`, this field is REQUIRED and its value MUST be `true`. + * Otherwise, the field MAY be included and its default value is `false`. + * + * @default false + */ + required?: boolean; + /** + * Specifies that a parameter is deprecated and SHOULD be transitioned out + * of usage. + * + * @default false + */ + deprecated?: boolean; + /** + * If `true`, clients MAY pass a zero-length string value in place of + * parameters that would otherwise be omitted entirely, which the server + * SHOULD interpret as the parameter being unused. If `style` is used, and + * if behavior is n/a (cannot be serialized), the value SHALL be ignored. + * This field is valid only for `query` parameters. Use of this field is NOT + * RECOMMENDED, and it is likely to be removed in a later revision. + * + * @default false + */ + allowEmptyValue?: boolean; + /** + * Describes how the parameter value will be serialized depending on the + * type of the parameter value. Default values (based on value of `in`): for + * `"query"` - `"form"`; for `"path"` - `"simple"`; for `"header"` - + * `"simple"`; for `"cookie"` - `"form"`. + */ + style?: ParameterStyle; + /** + * When true, parameter values of type `array` or `object` generate separate + * parameters for each value of the array or key-value pair of the map. For + * other types of parameters this field has no effect. When `style` is + * `"form"`, the default value is `true`; for all other styles, the default + * value is `false`. Note that despite `false` being the default for + * `deepObject`, the combination of `false` with `deepObject` is undefined. + */ + explode?: boolean; + /** + * When true, parameter values are serialized using reserved expansion, as + * defined by RFC6570, which allows RFC3986's reserved character set, as + * well as percent-encoded triples, to pass through unchanged, while still + * percent-encoding all other disallowed characters. Applications are still + * responsible for percent-encoding reserved characters that are not allowed + * in the query string (`[`, `]`, `#`), or have a special meaning in + * `application/x-www-form-urlencoded` (`-`, `&`, `+`). This field only + * applies to parameters with an `in` value of `query`. + * + * @default false + */ + allowReserved?: boolean; + /** + * The schema defining the type used for the parameter. + */ + schema?: SchemaObject; + /** + * Example of the parameter's potential value. The example SHOULD match the + * specified schema and follow the prescribed serialization strategy for the + * parameter. The `example` field is mutually exclusive of the `examples` + * field. Furthermore, if referencing a `schema` that contains an example, + * the `example` value SHALL override the example provided by the schema. + */ + example?: unknown; + /** + * Examples of the parameter's potential value. Each example SHOULD contain + * a value in the correct format as specified in the parameter encoding. The + * `examples` field is mutually exclusive of the `example` field. + * Furthermore, if referencing a `schema` that contains an example, the + * `examples` value SHALL override the example provided by the schema. + */ + examples?: Record; + /** + * A map containing the representations for the parameter. The key is the + * media type and the value describes it. The map MUST only contain one + * entry. + */ + content?: Record; +} + +/** + * Describes a single request body. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#request-body-object} + */ +export interface RequestBodyObject extends SpecificationExtensions { + /** + * A brief description of the request body. This could contain examples of + * use. CommonMark syntax MAY be used for rich text representation. + */ + description?: string; + /** + * REQUIRED. The content of the request body. The key is a media type or + * media type range and the value describes it. For requests that match + * multiple keys, only the most specific key is applicable, e.g. + * `"text/plain"` overrides `"text/*"`. The map SHOULD have at least one + * entry; if it does not, the behavior is implementation-defined. + */ + content: Record; + /** + * Determines if the request body is required in the request. + * + * @default false + */ + required?: boolean; +} + +/** + * Each Media Type Object provides schema and examples for the media type + * identified by its key. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#media-type-object} + */ +export interface MediaTypeObject extends SpecificationExtensions { + /** + * The schema defining the content of the request, response, parameter, or + * header. Binary content (e.g. `image/png`, `application/octet-stream`) MAY + * omit `schema` entirely; encoded binary data is modeled with JSON Schema's + * `contentEncoding` and `contentMediaType` keywords rather than the 3.0 + * `format` values `byte` and `binary`. + */ + schema?: SchemaObject; + /** + * Example of the media type. The example SHOULD match the specified schema + * and be in the correct format as specified by the media type and its + * encoding. The `example` field is mutually exclusive of the `examples` + * field. Furthermore, if referencing a `schema` that contains an example, + * the `example` value SHALL override the example provided by the schema. + */ + example?: unknown; + /** + * Examples of the media type. Each example SHOULD match the specified + * schema and be in the correct format as specified by the media type and + * its encoding. The `examples` field is mutually exclusive of the `example` + * field. Furthermore, if referencing a `schema` that contains an example, + * the `examples` value SHALL override the example provided by the schema. + */ + examples?: Record; + /** + * 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` field SHALL only apply to Request Body Objects, and only when + * the media type is `multipart` or `application/x-www-form-urlencoded`. If + * no Encoding Object is provided for a property, the behavior is determined + * by the default values documented for the Encoding Object. + */ + encoding?: Record; +} + +/** + * A single encoding definition applied to a single schema property. + * + * Properties are correlated with `multipart` parts via the `name` parameter + * of `Content-Disposition: form-data`, and with `application/x-www-form-urlencoded` + * via query string parameter names; ordering is implementation-defined. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#encoding-object} + */ +export interface EncodingObject extends SpecificationExtensions { + /** + * The `Content-Type` for encoding a specific property. The value is a + * comma-separated list, each element of which is either a specific media + * type (e.g. `image/png`) or a wildcard media type (e.g. `image/*`). + * Default value depends on the property type: for a schema with absent + * `type` – `application/octet-stream`; for `string` with `contentEncoding` + * present – `application/octet-stream`; for `string` without + * `contentEncoding`, and for `number`, `integer`, or `boolean` – + * `text/plain`; for `object` – `application/json`; for `array` – according + * to the `type` of the `items` schema. + */ + contentType?: string; + /** + * A map allowing additional information to be provided as headers. + * `Content-Type` is described separately and SHALL be ignored in this + * section. This field SHALL be ignored if the request body media type is + * not a `multipart`. + */ + headers?: Record; + /** + * Describes how a specific property value will be serialized depending on + * its type. See Parameter Object for details on the `style` field. The + * behavior follows the same values as `query` parameters, including default + * values, noting that the default of `"form"` applies only when + * `contentType` is not being used due to `explode` or `allowReserved` being + * explicitly specified. The initial `?` used in query strings MUST NOT + * appear in `application/x-www-form-urlencoded` message bodies. This field + * SHALL be ignored if the request body media type is not + * `application/x-www-form-urlencoded` or `multipart/form-data`. If a value + * is explicitly defined, then the value of `contentType` (implicit or + * explicit) SHALL be ignored. + */ + style?: QueryParameterStyle; + /** + * When true, property values of type `array` or `object` generate separate + * parameters for each value of the array, or key-value-pair of the map. For + * other types of properties this field has no effect. When `style` is + * `"form"`, the default value is `true`; for all other styles, the default + * value is `false`. This field SHALL be ignored if the request body media + * type is not `application/x-www-form-urlencoded` or `multipart/form-data`. + * If a value is explicitly defined, then the value of `contentType` + * (implicit or explicit) SHALL be ignored. + */ + explode?: boolean; + /** + * When true, parameter values are serialized using reserved expansion, as + * defined by RFC6570, which allows RFC3986's reserved character set, as + * well as percent-encoded triples, to pass through unchanged, while still + * percent-encoding all other disallowed characters. Applications are still + * responsible for percent-encoding reserved characters that are not allowed + * in the query string (`[`, `]`, `#`), or have a special meaning in + * `application/x-www-form-urlencoded` (`-`, `&`, `+`). This field SHALL be + * ignored if the request body media type is not + * `application/x-www-form-urlencoded` or `multipart/form-data`. If a value + * is explicitly defined, then the value of `contentType` (implicit or + * explicit) SHALL be ignored. + * + * @default false + */ + allowReserved?: boolean; +} + +/** + * A container for the expected responses of an operation. The container maps + * a HTTP response code to the expected response. + * + * The Responses Object MUST contain at least one response code, and if only + * one response code is provided it SHOULD be the response for a successful + * operation call. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#responses-object} + */ +export interface ResponsesObject extends SpecificationExtensions { + /** + * The documentation of responses other than the ones declared for specific + * HTTP response codes. Use this field to cover undeclared responses. + */ + default?: ResponseObject | ReferenceObject; + /** + * Any HTTP status code can be used as the property name, but only one + * property per code, to describe the expected response for that HTTP status + * code. This field MUST be enclosed in quotation marks (for example, "200") + * for compatibility between JSON and YAML. To define a range of response + * codes, this field MAY contain the uppercase wildcard character `X`. For + * example, `2XX` represents all response codes between `200` and `299`. + * Only the following range definitions are allowed: `1XX`, `2XX`, `3XX`, + * `4XX`, and `5XX`. If a response is defined using an explicit code, the + * explicit code definition takes precedence over the range definition for + * that code. + */ + [statusCode: `${1 | 2 | 3 | 4 | 5}${string}`]: + | ResponseObject + | ReferenceObject; +} + +/** + * Describes a single response from an API operation, including design-time, + * static `links` to operations based on the response. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#response-object} + */ +export interface ResponseObject extends SpecificationExtensions { + /** + * REQUIRED. A description of the response. CommonMark syntax MAY be used + * for rich text representation. + */ + description: string; + /** + * Maps a header name to its definition. RFC7230 states header names are + * case insensitive. If a response header is defined with the name + * `"Content-Type"`, it SHALL be ignored. + */ + headers?: Record; + /** + * A map containing descriptions of potential response payloads. The key is + * a media type or media type range and the value describes it. For + * responses that match multiple keys, only the most specific key is + * applicable, e.g. `"text/plain"` overrides `"text/*"`. + */ + content?: Record; + /** + * A map of operations links that can be followed from the response. The key + * of the map is a short name for the link, following the naming constraints + * of the names for Component Objects (`^[a-zA-Z0-9\.\-_]+$`). + */ + links?: Record; +} + +/** + * A map of possible out-of-band callbacks related to the parent operation. + * Each value in the map is a Path Item Object that describes a set of + * requests that may be initiated by the API provider and the expected + * responses. To describe incoming requests from the API provider independent + * from another API call, use the OpenAPI Object's `webhooks` field. + * + * Note: this object MAY be extended with Specification Extensions (`x-` + * prefixed fields), which cannot be represented in TypeScript alongside the + * arbitrary runtime-expression keys. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#callback-object} + */ +export interface CallbackObject { + /** + * A Path Item Object used to define a callback request and expected + * responses. The key is a runtime expression, evaluated in the context of a + * runtime HTTP request/response, that identifies the URL to be used for the + * callback request (e.g. `$request.body#/url`); expressions can be embedded + * into string values by surrounding them with `{}` curly braces. + */ + [expression: string]: PathItemObject; +} + +/** + * Describes a single header for HTTP responses and for individual parts in + * multipart representations. + * + * The Header Object follows the structure of the Parameter Object, including + * determining its serialization strategy based on whether `schema` or + * `content` is present (mutually exclusive), with these changes: `name` MUST + * NOT be specified, it is given in the corresponding `headers` map; `in` MUST + * NOT be specified, it is implicitly in `header`; all traits that are + * affected by the location MUST be applicable to a location of `header` β€” + * `allowEmptyValue` and `allowReserved` MUST NOT be used, and `style`, if + * used, MUST be limited to `"simple"`. + * + * When serializing with `schema`, URI percent-encoding MUST NOT be applied + * and header values MUST be passed through unchanged (no automatic quoting). + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#header-object} + */ +export interface HeaderObject extends SpecificationExtensions { + /** + * A brief description of the header. This could contain examples of use. + * CommonMark syntax MAY be used for rich text representation. + */ + description?: string; + /** + * Determines whether this header is mandatory. + * + * @default false + */ + required?: boolean; + /** + * Specifies that the header is deprecated and SHOULD be transitioned out of + * usage. + * + * @default false + */ + deprecated?: boolean; + /** + * Describes how the header value will be serialized. The default (and only + * legal value for headers) is `"simple"`. + * + * @default "simple" + */ + style?: "simple"; + /** + * When true, header values of type `array` or `object` generate a single + * header whose value is a comma-separated list of the array items or + * key-value pairs of the map. For other data types this field has no + * effect. + * + * @default false + */ + explode?: boolean; + /** + * The schema defining the type used for the header. + */ + schema?: SchemaObject; + /** + * Example of the header's potential value. The example SHOULD match the + * specified schema and follow the prescribed serialization strategy for the + * header. The `example` field is mutually exclusive of the `examples` + * field. Furthermore, if referencing a `schema` that contains an example, + * the `example` value SHALL override the example provided by the schema. + */ + example?: unknown; + /** + * Examples of the header's potential value. Each example SHOULD contain a + * value in the correct format as specified in the header encoding. The + * `examples` field is mutually exclusive of the `example` field. + * Furthermore, if referencing a `schema` that contains an example, the + * `examples` value SHALL override the example provided by the schema. + */ + examples?: Record; + /** + * A map containing the representations for the header. The key is the media + * type and the value describes it. The map MUST only contain one entry. + */ + content?: Record; +} + +/** + * A simple object to allow referencing other components in the OpenAPI + * Description, internally and externally. + * + * This object cannot be extended with additional properties, and any + * properties added SHALL be ignored. Note that this restriction on additional + * properties is a difference between Reference Objects and Schema Objects + * that contain a `$ref` keyword. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#reference-object} + */ +export interface ReferenceObject { + /** + * REQUIRED. The reference identifier. This MUST be in the form of a URI. + */ + $ref: string; + /** + * A short summary which by default SHOULD override that of the referenced + * component. If the referenced object-type does not allow a `summary` + * field, then this field has no effect. + */ + summary?: string; + /** + * A description which by default SHOULD override that of the referenced + * component. CommonMark syntax MAY be used for rich text representation. If + * the referenced object-type does not allow a `description` field, then + * this field has no effect. + */ + description?: string; +} + +/** + * The data type of a schema. In OpenAPI 3.1 (JSON Schema Draft 2020-12), + * `"null"` is a first-class type, and the Schema Object's `type` keyword also + * accepts an array of unique types. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#data-types} + */ +export type SchemaObjectType = + | "array" + | "boolean" + | "integer" + | "null" + | "number" + | "object" + | "string"; + +/** + * The object form of the Schema Object: every JSON Schema Draft 2020-12 + * keyword, plus the OAS base vocabulary (`discriminator`, `xml`, + * `externalDocs`, `example`). + * + * In addition to these keywords, the Schema Object supports keywords from any + * other vocabularies, or entirely arbitrary properties (extensions inside + * Schema Objects MAY omit the `x-` prefix). + * + * @template T The type of the data instances this schema describes, applied + * to the `enum`, `const`, `default`, `examples`, and `example` fields. + * Defaults to `unknown`; subschema positions (`properties`, `items`, ...) are + * not parameterized. + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#schema-object} + */ +export interface SchemaObjectFields { + /** + * In addition to the JSON Schema keywords comprising the OAS dialect, the + * Schema Object supports keywords from any other vocabularies, or entirely + * arbitrary properties. Unlike the other objects of this specification, + * extensions MAY omit the `x-` prefix within this object. + */ + [keyword: string]: unknown; // oxlint-disable-line anti-slop/no-unsafe-dictionary-type -- the specification allows arbitrary keywords with any value here + + // JSON Schema Core vocabulary + + /** + * The URI of the dialect (meta-schema) this schema conforms to. MAY be + * present in any schema resource root, and if present MUST be used to + * determine the dialect. Tooling MUST support the OAS dialect schema id + * `https://spec.openapis.org/oas/3.1/dialect/base`, and MAY support + * additional values. The OpenAPI Object's `jsonSchemaDialect` field sets + * the default; if it is also unset, the OAS dialect schema id MUST be used. + */ + $schema?: string; + /** + * A URI identifying the schema resource. The nearest parent `$id` serves as + * the base URI for relative references within the schema. + */ + $id?: string; + /** + * A URI reference to a schema to apply at this location. Unlike the + * Reference Object, `$ref` here is a plain JSON Schema keyword: adjacent + * keywords are allowed and are evaluated normally. + */ + $ref?: string; + /** + * A plain-name fragment identifier for the enclosing schema, usable as a + * `$ref` target. + */ + $anchor?: string; + /** + * A URI reference that, together with `$dynamicAnchor`, MAY be used to + * implement generic or template data structures: `$dynamicRef` resolves to + * the first matching `$dynamicAnchor` in the dynamic scope from the schema + * entry point. + */ + $dynamicRef?: string; + /** + * A plain-name fragment identifier that is a candidate target for + * `$dynamicRef` resolution. + */ + $dynamicAnchor?: string; + /** + * A map of vocabulary URIs to booleans declaring which vocabularies are + * required (`true`) or optional (`false`) to process the schema. Only + * meaningful in a meta-schema. + */ + $vocabulary?: Record; + /** + * Reusable subschema definitions, addressable via `$ref`. + */ + $defs?: Record; + /** + * A comment for schema maintainers, carrying no validation semantics. + */ + $comment?: string; + + // JSON Schema Applicator vocabulary + + /** + * An instance is valid against this keyword if it is valid against all + * subschemas in this array. `allOf` offers model composition; with + * `discriminator`, polymorphism. + */ + allOf?: SchemaObject[]; + /** + * An instance is valid against this keyword if it is valid against exactly + * one subschema in this array. + */ + oneOf?: SchemaObject[]; + /** + * An instance is valid against this keyword if it is valid against at least + * one subschema in this array. + */ + anyOf?: SchemaObject[]; + /** + * An instance is valid against this keyword if it is not valid against the + * given subschema. + */ + not?: SchemaObject; + /** + * If the instance validates against this subschema, it must also validate + * against `then` (if present); otherwise against `else` (if present). + */ + if?: SchemaObject; + /** + * Applied when the instance validates against `if`. + */ + then?: SchemaObject; + /** + * Applied when the instance fails validation against `if`. + */ + else?: SchemaObject; + /** + * A map of property names to subschemas that the whole instance must + * validate against when the named property is present. + */ + dependentSchemas?: Record; + /** + * An array of subschemas applied positionally to the first items of an + * array instance (tuple validation). + */ + prefixItems?: SchemaObject[]; + /** + * A subschema applied to all array items not covered by `prefixItems` + * (tuples use `prefixItems`). Unlike OpenAPI 3.0, `items` is not required + * when `type` is `"array"`. + */ + items?: SchemaObject; + /** + * An array instance is valid if at least one item (subject to + * `minContains`/`maxContains`) validates against this subschema. + */ + contains?: SchemaObject; + /** + * A map of property names to subschemas validating the corresponding + * property values of an object instance. + */ + properties?: Record; + /** + * A map of ECMA-262 regular expressions to subschemas validating the values + * of all properties whose names match each expression. + */ + patternProperties?: Record; + /** + * A subschema applied to the values of all object properties not covered by + * `properties` or `patternProperties`. + */ + additionalProperties?: SchemaObject; + /** + * A subschema every property name of an object instance must validate + * against. + */ + propertyNames?: SchemaObject; + + // JSON Schema Unevaluated vocabulary + + /** + * A subschema applied to array items not successfully evaluated by any + * `prefixItems`, `items`, or `contains` in this schema or its subschemas. + */ + unevaluatedItems?: SchemaObject; + /** + * A subschema applied to object properties not successfully evaluated by + * any `properties`, `patternProperties`, or `additionalProperties` in this + * schema or its subschemas. + */ + unevaluatedProperties?: SchemaObject; + + // JSON Schema Validation vocabulary + + /** + * The data type of the schema: a string or an array of unique strings. + * `"null"` is a first-class type value (replacing OpenAPI 3.0's `nullable` + * keyword, e.g. `type: ["string", "null"]`). Note that keywords and formats + * do not implicitly require the expected type; use `type` to constrain it. + */ + type?: SchemaObjectType | SchemaObjectType[]; + /** + * The instance is valid only if its value equals one of the elements in + * this array. + */ + enum?: T[]; + /** + * The instance is valid only if its value equals this value. + */ + const?: T; + /** + * A numeric instance is valid only if division by this keyword's value + * results in an integer. MUST be a number strictly greater than 0. + */ + multipleOf?: number; + /** + * An inclusive upper limit for a numeric instance. + */ + maximum?: number; + /** + * An exclusive upper limit for a numeric instance. Note that unlike OpenAPI + * 3.0, this is a standalone numeric limit, not a boolean modifying + * `maximum`. + */ + exclusiveMaximum?: number; + /** + * An inclusive lower limit for a numeric instance. + */ + minimum?: number; + /** + * An exclusive lower limit for a numeric instance. Note that unlike OpenAPI + * 3.0, this is a standalone numeric limit, not a boolean modifying + * `minimum`. + */ + exclusiveMinimum?: number; + /** + * The maximum length of a string instance. MUST be a non-negative integer. + * MAY be used to set an expected upper bound on the length of a streaming + * payload; for unencoded binary data the length is the number of octets. + */ + maxLength?: number; + /** + * The minimum length of a string instance. MUST be a non-negative integer. + * + * @default 0 + */ + minLength?: number; + /** + * A string instance is valid if the ECMA-262 regular expression matches it. + */ + pattern?: string; + /** + * The maximum number of items in an array instance. MUST be a non-negative + * integer. + */ + maxItems?: number; + /** + * The minimum number of items in an array instance. MUST be a non-negative + * integer. + * + * @default 0 + */ + minItems?: number; + /** + * If `true`, all items in an array instance must be unique. + * + * @default false + */ + uniqueItems?: boolean; + /** + * The maximum number of items matching `contains`. MUST be a non-negative + * integer. + */ + maxContains?: number; + /** + * The minimum number of items matching `contains`. MUST be a non-negative + * integer. + * + * @default 1 + */ + minContains?: number; + /** + * The maximum number of properties of an object instance. MUST be a + * non-negative integer. + */ + maxProperties?: number; + /** + * The minimum number of properties of an object instance. MUST be a + * non-negative integer. + * + * @default 0 + */ + minProperties?: number; + /** + * Property names that must be present in an object instance. Elements MUST + * be unique. + */ + required?: string[]; + /** + * A map of property names to arrays of property names that must also be + * present when the key property is present. + */ + dependentRequired?: Record; + + // JSON Schema Meta-Data vocabulary + + /** + * A short title for the schema. + */ + title?: string; + /** + * A description of the schema. CommonMark syntax MAY be used for rich text + * representation. + */ + description?: string; + /** + * A default value associated with the schema, as an annotation for + * documenting the receiver's behavior. Note that unlike OpenAPI 3.0, the + * value is not required to conform to the schema's `type`. + */ + default?: T; + /** + * Indicates that applications SHOULD refrain from using the described + * value(s). + * + * @default false + */ + deprecated?: boolean; + /** + * Indicates the value is managed by the owning authority: it MAY be sent in + * a response but SHOULD NOT be sent in a request. Note that the behavior of + * `readOnly` in particular differs from that of OpenAPI 3.0: per JSON + * Schema Validation Draft 2020-12 Β§9.4, the owning authority MAY either + * ignore a `readOnly` field sent in a request or treat it as an error. + * + * @default false + */ + readOnly?: boolean; + /** + * Indicates the value may be sent in a request but SHOULD NOT be included + * in a response. + * + * @default false + */ + writeOnly?: boolean; + /** + * An array of example values associated with the schema. This is the + * preferred, JSON-Schema-native way to include examples in a Schema Object, + * replacing the OAS-specific singular `example`. + */ + examples?: T[]; + + // JSON Schema Format-Annotation vocabulary + + /** + * The format of the data type. While relying on JSON Schema's defined + * formats, the OAS offers a few additional predefined formats: `"int32"`, + * `"int64"`, `"float"`, `"double"` (with `type: "number"`), and + * `"password"` (a hint to obscure the value, with `type: "string"`). + * `format` is a non-validating annotation by default; tools that do not + * recognize a format MAY default back to `type` alone. Support for any + * format registered in the OpenAPI Format Registry is strictly OPTIONAL. + */ + format?: string; + + // JSON Schema Content vocabulary + + /** + * The encoding (e.g. `base64`, `base64url`) used to represent binary data + * as a string instance, replacing the OpenAPI 3.0 `format: "byte"` usage. + * Raw binary data (OpenAPI 3.0 `format: "binary"`) is instead represented + * by omitting `type` and `contentEncoding` and using `contentMediaType`. + * Treated as an annotation rather than validated directly. + */ + contentEncoding?: string; + /** + * The media type of the content of a string instance. Redundant if the + * media type is already set as the Media Type Object's key or in an + * Encoding Object's `contentType`, and SHALL be ignored if it contradicts + * them. Treated as an annotation rather than validated directly. + */ + contentMediaType?: string; + /** + * A subschema describing the structure of the string's decoded content. + * Treated as an annotation rather than validated directly. + */ + contentSchema?: SchemaObject; + + // OAS base vocabulary + + /** + * Adds support for polymorphism. The discriminator is used to determine + * which of a set of schemas a payload is expected to satisfy. The + * discriminator property SHOULD be a required field of the payload schema. + * Legal only when using one of the composite keywords `oneOf`, `anyOf`, + * `allOf`; MUST NOT change the validation outcome. + */ + discriminator?: DiscriminatorObject; + /** + * This MAY be used only on property schemas; it has no effect on root + * schemas. Adds additional metadata to describe the XML representation of + * this property. + */ + xml?: XMLObject; + /** + * Additional external documentation for this schema. + */ + externalDocs?: ExternalDocumentationObject; + /** + * A free-form field to include an example of an instance for this schema. + * To represent examples that cannot be naturally represented in JSON or + * YAML, a string value can be used to contain the example with escaping + * where necessary. + * + * @deprecated The `example` field has been deprecated in favor of the JSON + * Schema `examples` keyword. Use of `example` is discouraged, and later + * versions of this specification may remove it. + */ + example?: T; +} + +/** + * The Schema Object allows the definition of input and output data types. + * These types can be objects, but also primitives and arrays. This object is + * a superset of the JSON Schema Specification Draft 2020-12. + * + * The empty schema (which allows any instance to validate) MAY be represented + * by the boolean value `true`, and a schema which allows no instance to + * validate MAY be represented by the boolean value `false`. + * + * Unless stated otherwise, the keyword definitions follow those of JSON + * Schema and do not add any additional semantics. The OpenAPI Schema Object + * dialect is identified by the URI `https://spec.openapis.org/oas/3.1/dialect/base` + * (the "OAS dialect schema id"), and requires the OAS base vocabulary + * (`discriminator`, `xml`, `externalDocs`, `example`) in addition to the + * vocabularies of the JSON Schema Draft 2020-12 general-purpose meta-schema. + * + * @template T The type of the data instances this schema describes, applied + * to the `enum`, `const`, `default`, `examples`, and `example` fields. + * Defaults to `unknown`. + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#schema-object} + */ +export type SchemaObject = boolean | SchemaObjectFields; + +/** + * When request bodies or response payloads may be one of a number of + * different schemas, a Discriminator Object gives a hint about the expected + * schema of the document. This hint can be used to aid in serialization, + * deserialization, and validation. + * + * The Discriminator Object is legal only when using one of the composite + * keywords `oneOf`, `anyOf`, `allOf`. Note that `discriminator` MUST NOT + * change the validation outcome of the schema. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#discriminator-object} + */ +export interface DiscriminatorObject extends SpecificationExtensions { + /** + * REQUIRED. The name of the property in the payload that will hold the + * discriminating value. This property SHOULD be required in the payload + * schema, as the behavior when the property is absent is undefined. + */ + propertyName: string; + /** + * An object to hold mappings between payload values and schema names or URI + * references. The value of the property named in `propertyName` is used as + * the name of the associated schema under the Components Object unless a + * `mapping` is present for that value. To force a value to be treated as a + * relative URI reference rather than a schema name, authors MUST prefix it + * with the `"."` path segment (e.g. `"./foo"`). Mapping keys MUST be string + * values. + */ + mapping?: Record; +} + +/** + * The type of a security scheme. OpenAPI 3.1 adds `"mutualTLS"`. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#security-scheme-object} + */ +export type SecuritySchemeType = + | "apiKey" + | "http" + | "mutualTLS" + | "oauth2" + | "openIdConnect"; + +/** + * Defines a mutual TLS security scheme (use of a client certificate) that can + * be used by the operations. There are no additional configuration fields. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#security-scheme-object} + */ +export interface MutualTlsSecuritySchemeObject extends SpecificationExtensions { + /** + * REQUIRED. The type of the security scheme. + */ + type: "mutualTLS"; + /** + * A description for security scheme. CommonMark syntax MAY be used for rich + * text representation. + */ + description?: string; +} + +/** + * Defines a security scheme that can be used by the operations. Supported + * schemes are HTTP authentication, an API key (either as a header, a cookie + * parameter, or as a query parameter), mutual TLS (use of a client + * certificate), OAuth2's common flows (implicit, password, client credentials, + * and authorization code) as defined in RFC6749, and OpenID Connect + * Discovery. + * + * The implicit flow is subject to deprecation by the OAuth 2.0 Security Best + * Current Practice; the Authorization Code Grant flow with PKCE is + * recommended for most use cases. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#security-scheme-object} + */ +export type SecuritySchemeObject = + | ApiKeySecuritySchemeObject + | HttpSecuritySchemeObject + | MutualTlsSecuritySchemeObject + | OAuth2SecuritySchemeObject + | OpenIdConnectSecuritySchemeObject; + +/** + * Lists the required security schemes to execute this operation or the API as + * a whole. A Security Requirement Object MAY refer to multiple security + * schemes, in which case all schemes MUST be satisfied for a request to be + * authorized. + * + * When a list of Security Requirement Objects is defined on the OpenAPI + * Object or Operation Object, only one of the Security Requirement Objects in + * the list needs to be satisfied to authorize the request. An empty Security + * Requirement Object (`{}`) indicates anonymous access is supported. + * + * @see {@link https://spec.openapis.org/oas/v3.1.2.html#security-requirement-object} + */ +export interface SecurityRequirementObject { + /** + * Each name MUST correspond to a security scheme which is declared in the + * Security Schemes under the Components Object. If the security scheme is + * of type `"oauth2"` or `"openIdConnect"`, then the value is a list of + * scope names required for the execution, and the list MAY be empty if + * authorization does not require a specified scope. For other security + * scheme types, the array MAY contain a list of role names which are + * required for the execution, but are not otherwise defined or exchanged + * in-band. + */ + [name: string]: string[]; +} diff --git a/packages/types/src/v3.2.test-d.ts b/packages/types/src/v3.2.test-d.ts new file mode 100644 index 0000000..10a128b --- /dev/null +++ b/packages/types/src/v3.2.test-d.ts @@ -0,0 +1,240 @@ +import type { OpenAPIObject, SchemaObject } from "./v3.2"; + +export const streamingApi = { + $self: "https://example.com/openapi", + components: { + examples: { + external: { + dataValue: { kind: "cat" }, + externalValue: "https://example.com/examples/cat.bin", + }, + serialized: { + dataValue: { kind: "cat" }, + serializedValue: "kind=cat", + summary: "A serialized example", + }, + }, + mediaTypes: { + EventStream: { + itemSchema: { $ref: "#/components/schemas/Event" }, + }, + Referenced: { $ref: "#/components/mediaTypes/EventStream" }, + }, + responses: { + Uploaded: { + description: "The upload was accepted", + summary: "Upload accepted", + }, + }, + schemas: { + Cat: { type: "object" }, + Event: { + properties: { + animal: { + discriminator: { + defaultMapping: "Cat", + mapping: { cat: "Cat" }, + propertyName: "kind", + }, + oneOf: [{ $ref: "#/components/schemas/Cat" }, { type: "object" }], + }, + payload: { + properties: { + body: { type: "string", xml: { nodeType: "cdata" } }, + id: { type: "string", xml: { nodeType: "attribute" } }, + legacyAttribute: { type: "string", xml: { attribute: true } }, + legacyWrapped: { + items: { type: "string" }, + type: "array", + xml: { wrapped: true }, + }, + note: { type: "string", xml: { nodeType: "text" } }, + }, + type: "object", + xml: { + name: "payload", + namespace: "https://example.com/ns", + nodeType: "element", + prefix: "ex", + }, + }, + }, + type: "object", + }, + EventQuery: { type: "object" }, + }, + securitySchemes: { + device: { + deprecated: false, + flows: { + authorizationCode: { + authorizationUrl: "https://auth.example.com/authorize", + scopes: {}, + tokenUrl: "https://auth.example.com/token", + }, + deviceAuthorization: { + deviceAuthorizationUrl: "https://auth.example.com/device", + scopes: { "read:events": "read events" }, + tokenUrl: "https://auth.example.com/token", + }, + }, + oauth2MetadataUrl: + "https://auth.example.com/.well-known/oauth-authorization-server", + type: "oauth2", + }, + legacy: { + deprecated: true, + scheme: "basic", + type: "http", + }, + }, + }, + info: { title: "Streaming API", version: "2.0.0" }, + openapi: "3.2.0", + paths: { + "/events": { + additionalOperations: { + COPY: { + responses: { "204": {} }, + summary: "Copy the event stream configuration", + }, + }, + get: { + parameters: [ + { + content: { + "application/x-www-form-urlencoded": { + schema: { + properties: { kind: { type: "string" } }, + type: "object", + }, + }, + }, + in: "querystring", + name: "filter", + }, + { + explode: false, + in: "cookie", + name: "session", + schema: { type: "string" }, + style: "cookie", + }, + ], + responses: { + "200": { + content: { + "text/event-stream": { + itemSchema: { + properties: { + data: { + contentMediaType: "application/json", + contentSchema: { $ref: "#/components/schemas/Event" }, + type: "string", + }, + event: { type: "string" }, + retry: { type: "integer" }, + }, + type: "object", + }, + }, + }, + summary: "Event stream", + }, + }, + summary: "Subscribe to events", + }, + query: { + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/EventQuery" }, + }, + }, + }, + responses: { + "200": { description: "Query results" }, + }, + summary: "Complex event query using the QUERY method", + }, + }, + "/uploads": { + post: { + requestBody: { + content: { + "application/x-www-form-urlencoded": { + encoding: { + nested: { + contentType: "application/json", + encoding: { + inner: { explode: true, style: "form" }, + }, + itemEncoding: { contentType: "text/plain" }, + prefixEncoding: [{ contentType: "text/plain" }], + }, + }, + schema: { type: "object" }, + }, + "multipart/form-data": { + prefixEncoding: [ + { contentType: "text/plain" }, + { + contentType: "image/png", + headers: { + "X-Part-Id": { schema: { type: "string" } }, + }, + }, + ], + schema: { + prefixItems: [ + { type: "string" }, + { contentEncoding: "base64", type: "string" }, + ], + type: "array", + }, + }, + "multipart/mixed": { + itemEncoding: { contentType: "application/octet-stream" }, + itemSchema: { contentEncoding: "base64", type: "string" }, + }, + }, + }, + responses: { + default: { $ref: "#/components/responses/Uploaded" }, + }, + }, + }, + }, + security: [{ "./device": ["read:events"] }], + servers: [ + { + description: "Production server", + name: "production", + url: "https://api.example.com", + }, + ], + tags: [ + { kind: "nav", name: "events", summary: "Events" }, + { kind: "badge", name: "streaming", parent: "events" }, + ], +} satisfies OpenAPIObject; + +export const wrongVersion = { + info: { title: "API", version: "1.0.0" }, + // @ts-expect-error: The `openapi` version string must be within the 3.2 line. + openapi: "3.1.2", + paths: {}, +} satisfies OpenAPIObject; + +export const typedSchema = { + const: "fixed", + default: "fixed", + examples: ["fixed"], + type: "string", +} satisfies SchemaObject; + +export const typedSchemaMismatch = { + // @ts-expect-error: `const` must match the schema's data type parameter. + const: 1, + type: "string", +} satisfies SchemaObject; diff --git a/packages/types/src/v3.2.ts b/packages/types/src/v3.2.ts new file mode 100644 index 0000000..81b9f74 --- /dev/null +++ b/packages/types/src/v3.2.ts @@ -0,0 +1,1918 @@ +/** + * TypeScript types for the OpenAPI Specification v3.2, authored against + * release 3.2.0. + * + * Types that are structurally identical to OpenAPI 3.1 (including everything + * they reference) are re-exported from `./v3.1`; every other type is + * redefined here. Highlights of 3.2: the `$self` document URI, tag hierarchy + * (`parent`/`kind`), the QUERY HTTP method and `additionalOperations`, the + * `querystring` parameter location, streaming media types (`itemSchema`, + * `itemEncoding`, `prefixEncoding`), reusable media types in components, the + * OAuth2 Device Authorization flow, and the XML `nodeType` model. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html} + */ + +import type { + AuthorizationCodeOAuthFlowObject, + ClientCredentialsOAuthFlowObject, + ExternalDocumentationObject, + ImplicitOAuthFlowObject, + InfoObject, + OAuthFlowObjectBase, + PasswordOAuthFlowObject, + QueryParameterStyle, + ReferenceObject, + SchemaObjectType, + ServerVariableObject, + SpecificationExtensions, +} from "./v3.1"; + +export type { + AuthorizationCodeOAuthFlowObject, + ClientCredentialsOAuthFlowObject, + ContactObject, + ExternalDocumentationObject, + ImplicitOAuthFlowObject, + InfoObject, + LicenseObject, + OAuthFlowObjectBase, + PasswordOAuthFlowObject, + QueryParameterStyle, + ReferenceObject, + SchemaObjectType, + SecuritySchemeType, + ServerVariableObject, + SpecificationExtensions, +} from "./v3.1"; + +/** + * This is the root object of the OpenAPI Description. + * + * In addition to the required fields, at least one of `components`, `paths`, + * or `webhooks` MUST be present. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#openapi-object} + */ +export interface OpenAPIObject extends SpecificationExtensions { + /** + * REQUIRED. This string MUST be the version number of the OpenAPI + * Specification that the OpenAPI document uses. The `openapi` field SHOULD + * be used by tooling to interpret the OpenAPI document. This is not related + * to the API `info.version` string. + */ + openapi: `3.2.${string}`; + /** + * This string MUST be in the form of a URI reference as defined by RFC3986. + * Provides the self-assigned URI of this document, which also serves as its + * base URI. To ensure interoperability, references between documents MUST + * use the target document's `$self` URI when this field is present. If + * relative, it is resolved against the next possible base URI source (e.g. + * the retrieval URI). + */ + $self?: string; + /** + * REQUIRED. Provides metadata about the API. The metadata MAY be used by + * tooling as required. + */ + info: InfoObject; + /** + * The default value for the `$schema` keyword within Schema Objects + * contained within this OAS document. This MUST be in the form of a URI. + */ + jsonSchemaDialect?: string; + /** + * An array of Server Objects, which provide connectivity information to a + * target server. If the `servers` field is not provided, or is an empty + * array, the default value is an array consisting of a single Server Object + * with a `url` value of `/`. + */ + servers?: ServerObject[]; + /** + * The available paths and operations for the API. + */ + paths?: PathsObject; + /** + * The incoming webhooks that MAY be received as part of this API and that + * the API consumer MAY choose to implement. Closely related to the + * `callbacks` feature, this section describes requests initiated other than + * by an API call, for example by an out-of-band registration. The key name + * is a unique string to refer to each webhook, while the (optionally + * referenced) Path Item Object describes a request that may be initiated by + * the API provider and the expected responses. + */ + webhooks?: Record; + /** + * An element to hold various Objects for the OpenAPI Description. + */ + components?: ComponentsObject; + /** + * A declaration of which security mechanisms can be used across the API. + * The list of values includes alternative Security Requirement Objects; + * only one of them needs to be satisfied to authorize a request. Individual + * operations can override this definition. The list can be incomplete, up + * to being empty or absent. To make security explicitly optional, an empty + * security requirement (`{}`) can be included in the array. + */ + security?: SecurityRequirementObject[]; + /** + * A list of tags used by the OpenAPI Description with additional metadata. + * The order of the tags can be used to reflect on their order by the + * parsing tools. Not all tags that are used by the Operation Object must be + * declared; undeclared tags MAY be organized randomly or based on the + * tools' logic. Each tag name in the list MUST be unique. + */ + tags?: TagObject[]; + /** + * Additional external documentation. + */ + externalDocs?: ExternalDocumentationObject; +} + +/** + * An object representing a Server. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#server-object} + */ +export interface ServerObject extends SpecificationExtensions { + /** + * REQUIRED. A URL to the target host. This URL supports Server Variables + * and MAY be relative, to indicate that the host location is relative to + * the location where the document containing the Server Object is being + * served. Query and fragment MUST NOT be part of this URL. Variable + * substitutions will be made when a variable is named in `{braces}`. Each + * server variable MUST NOT appear more than once in the URL template. + */ + url: string; + /** + * An optional string describing the host designated by the URL. CommonMark + * syntax MAY be used for rich text representation. + */ + description?: string; + /** + * An optional unique string to refer to the host designated by the URL. + */ + name?: string; + /** + * A map between a variable name and its value. The value is used for + * substitution in the server's URL template. + */ + variables?: Record; +} + +/** + * Holds a set of reusable objects for different aspects of the OAS. All + * objects defined within the Components Object will have no effect on the API + * unless they are explicitly referenced from outside the Components Object. + * + * All the fixed fields are objects whose keys MUST match the regular + * expression `^[a-zA-Z0-9\.\-_]+$`. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#components-object} + */ +export interface ComponentsObject extends SpecificationExtensions { + /** + * An object to hold reusable Schema Objects. Note that the values are not + * unioned with the Reference Object: `$ref` is a JSON Schema keyword of the + * Schema Object itself. + */ + schemas?: Record; + /** + * An object to hold reusable Response Objects. + */ + responses?: Record; + /** + * An object to hold reusable Parameter Objects. + */ + parameters?: Record; + /** + * An object to hold reusable Example Objects. + */ + examples?: Record; + /** + * An object to hold reusable Request Body Objects. + */ + requestBodies?: Record; + /** + * An object to hold reusable Header Objects. + */ + headers?: Record; + /** + * An object to hold reusable Media Type Objects. + */ + mediaTypes?: Record; + /** + * An object to hold reusable Security Scheme Objects. + */ + securitySchemes?: Record; + /** + * An object to hold reusable Link Objects. + */ + links?: Record; + /** + * An object to hold reusable Callback Objects. + */ + callbacks?: Record; + /** + * An object to hold reusable Path Item Objects. Note that the values are + * not unioned with the Reference Object: the Path Item Object has its own + * `$ref` field. + */ + pathItems?: Record; +} + +/** + * Holds the relative paths to the individual endpoints and their operations. + * The path is appended to the URL from the Server Object in order to + * construct the full URL. The Paths Object MAY be empty, due to Access + * Control List (ACL) constraints. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#paths-object} + */ +export interface PathsObject extends SpecificationExtensions { + /** + * A relative path to an individual endpoint. The field name MUST begin with + * a forward slash (`/`). The URL from the Server Object's `url` field, + * resolved and with template variables substituted, has the path appended + * (no relative URL resolution) to construct the full URL. Path templating + * is allowed. When matching URLs, concrete (non-templated) paths would be + * matched before their templated counterparts. Templated paths with the + * same hierarchy but different templated names MUST NOT exist as they are + * identical. In case of ambiguous matching, it is up to the tooling to + * decide which one to use. Each template expression MUST NOT appear more + * than once in a single path template. + */ + [path: `/${string}`]: PathItemObject; +} + +/** + * Describes the operations available on a single path. A Path Item MAY be + * empty, due to ACL constraints. The path itself is still exposed to the + * documentation viewer but they will not know which operations and parameters + * are available. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#path-item-object} + */ +export interface PathItemObject extends SpecificationExtensions { + /** + * Allows for a referenced definition of this path item. The value MUST be + * in the form of a URI, and the referenced structure MUST be in the form of + * a Path Item Object. In case a Path Item Object field appears both in the + * defined object and the referenced object, the behavior is undefined. Note + * that the behavior of `$ref` with adjacent properties is likely to change + * in future versions of this specification to bring it into closer + * alignment with the behavior of the Reference Object. + */ + $ref?: string; + /** + * An optional string summary, intended to apply to all operations in this + * path. + */ + summary?: string; + /** + * An optional string description, intended to apply to all operations in + * this path. CommonMark syntax MAY be used for rich text representation. + */ + description?: string; + /** + * A definition of a GET operation on this path. + */ + get?: OperationObject; + /** + * A definition of a PUT operation on this path. + */ + put?: OperationObject; + /** + * A definition of a POST operation on this path. + */ + post?: OperationObject; + /** + * A definition of a DELETE operation on this path. + */ + delete?: OperationObject; + /** + * A definition of an OPTIONS operation on this path. + */ + options?: OperationObject; + /** + * A definition of a HEAD operation on this path. + */ + head?: OperationObject; + /** + * A definition of a PATCH operation on this path. + */ + patch?: OperationObject; + /** + * A definition of a TRACE operation on this path. + */ + trace?: OperationObject; + /** + * A definition of a QUERY operation, as defined in the most recent IETF + * draft of draft-ietf-httpbis-safe-method-w-body, or its RFC successor, on + * this path. + */ + query?: OperationObject; + /** + * A map of additional operations on this path. The map key is the HTTP + * method with the same capitalization that is to be sent in the request. + * This map MUST NOT contain any entry for the methods that can be defined + * by the other fixed fields with Operation Object values (e.g. no `POST` + * entry, as the `post` field is used for that method). + */ + additionalOperations?: Record; + /** + * An alternative `servers` array to service all operations in this path. + * If a `servers` array is specified at the OpenAPI Object level, it will be + * overridden by this value. + */ + servers?: ServerObject[]; + /** + * A list of parameters that are applicable for all the operations described + * under this path. These parameters can be overridden at the operation + * level, but cannot be removed there. The list MUST NOT include duplicated + * parameters; a unique parameter is defined by a combination of a name and + * location. The list can use the Reference Object to link to parameters + * defined in the Components Object's `parameters`. + */ + parameters?: (ParameterObject | ReferenceObject)[]; +} + +/** + * Describes a single API operation on a path. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#operation-object} + */ +export interface OperationObject extends SpecificationExtensions { + /** + * A list of tags for API documentation control. Tags can be used for + * logical grouping of operations by resources or any other qualifier. + */ + tags?: string[]; + /** + * A short summary of what the operation does. + */ + summary?: string; + /** + * A verbose explanation of the operation behavior. CommonMark syntax MAY be + * used for rich text representation. + */ + description?: string; + /** + * Additional external documentation for this operation. + */ + externalDocs?: ExternalDocumentationObject; + /** + * Unique string used to identify the operation. The id MUST be unique among + * all operations described in the API. The `operationId` value is + * case-sensitive. Tools and libraries MAY use the `operationId` to uniquely + * identify an operation, therefore, it is RECOMMENDED to follow common + * programming naming conventions. + */ + operationId?: string; + /** + * A list of parameters that are applicable for this operation. If a + * parameter is already defined in the Path Item, the new definition will + * override it but can never remove it. The list MUST NOT include duplicated + * parameters; a unique parameter is defined by a combination of a name and + * location. The list can use the Reference Object to link to parameters + * defined in the Components Object's `parameters`. + */ + parameters?: (ParameterObject | ReferenceObject)[]; + /** + * The request body applicable for this operation. The `requestBody` is + * fully supported in HTTP methods where the HTTP 1.1 specification RFC9110 + * has explicitly defined semantics for request bodies. In other cases where + * the HTTP spec discourages message content (such as GET and DELETE), + * `requestBody` is permitted but does not have well-defined semantics and + * SHOULD be avoided if possible. + */ + requestBody?: RequestBodyObject | ReferenceObject; + /** + * The list of possible responses as they are returned from executing this + * operation. + */ + responses?: ResponsesObject; + /** + * A map of possible out-of band callbacks related to the parent operation. + * The key is a unique identifier for the Callback Object. Each value in the + * map is a Callback Object that describes a request that may be initiated + * by the API provider and the expected responses. + */ + callbacks?: Record; + /** + * Declares this operation to be deprecated. Consumers SHOULD refrain from + * usage of the declared operation. + * + * @default false + */ + deprecated?: boolean; + /** + * A declaration of which security mechanisms can be used for this + * operation. Only one of the Security Requirement Objects needs to be + * satisfied to authorize a request. To make security optional, an empty + * security requirement (`{}`) can be included in the array. This definition + * overrides any declared top-level `security`. To remove a top-level + * security declaration, an empty array can be used. + */ + security?: SecurityRequirementObject[]; + /** + * An alternative `servers` array to service this operation. If a `servers` + * array is specified at the Path Item Object or OpenAPI Object level, it + * will be overridden by this value. + */ + servers?: ServerObject[]; +} + +/** + * The location of a parameter. OpenAPI 3.2 adds `"querystring"`, which treats + * the entire URL query string as a single parameter value. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#parameter-locations} + */ +export type ParameterLocation = + | "cookie" + | "header" + | "path" + | "query" + | "querystring"; + +/** + * Describes how a parameter value will be serialized depending on the type of + * the parameter value. In order to support common ways of serializing simple + * parameters, a set of `style` values are defined: + * + * - `"matrix"` β€” path-style parameters defined by RFC6570 (`path`). + * - `"label"` β€” label style parameters defined by RFC6570 (`path`). + * - `"simple"` β€” simple style parameters defined by RFC6570 (`path`, + * `header`). + * - `"form"` β€” form style parameters defined by RFC6570 (`query`, `cookie`). + * - `"spaceDelimited"` β€” space separated array or object values (`query`). + * - `"pipeDelimited"` β€” pipe separated array or object values (`query`). + * - `"deepObject"` β€” allows objects with scalar properties to be represented + * using form parameters; the representation of array or object properties + * is not defined, and `explode` has no effect (`query`). + * - `"cookie"` β€” cookie syntax as defined by RFC6265, analogous to `form` + * but with name-value pairs separated by `; ` and without percent-encoding + * or other escaping applied (`cookie`); new in OpenAPI 3.2. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#style-values} + */ +export type ParameterStyle = + | "cookie" + | "deepObject" + | "form" + | "label" + | "matrix" + | "pipeDelimited" + | "simple" + | "spaceDelimited"; + +/** + * Describes a single operation parameter. + * + * A unique parameter is defined by a combination of a name and location. + * + * Parameter Objects MUST include either a `content` field or a `schema` + * field, but not both. The `style`, `explode`, `allowReserved`, and `schema` + * fields form the schema group and MUST NOT be used with + * `in: "querystring"`, which MUST be specified using `content`. + * + * An `in: "querystring"` parameter MUST NOT appear more than once, and MUST + * NOT appear in the same operation (or the operation's path item) as any + * `in: "query"` parameter, and vice versa. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#parameter-object} + */ +export interface ParameterObject extends SpecificationExtensions { + /** + * REQUIRED. The name of the parameter. Parameter names are case sensitive. + * + * - If `in` is `"path"`, the `name` field MUST correspond to a single + * template expression occurring within the path field in the Paths + * Object. + * - If `in` is `"header"` and the `name` field is `"Accept"`, + * `"Content-Type"` or `"Authorization"`, the parameter definition SHALL + * be ignored. + * - If `in` is `"querystring"`, or for certain combinations of `style` and + * `explode`, the value of `name` is not used in the parameter + * serialization. + * - For all other cases, the `name` corresponds to the parameter name used + * by the `in` field. + */ + name: string; + /** + * REQUIRED. The location of the parameter. Possible values are `"query"`, + * `"querystring"`, `"header"`, `"path"` or `"cookie"`. + */ + in: ParameterLocation; + /** + * A brief description of the parameter. This could contain examples of use. + * CommonMark syntax MAY be used for rich text representation. + */ + description?: string; + /** + * Determines whether this parameter is mandatory. If the parameter location + * is `"path"`, this field is REQUIRED and its value MUST be `true`. + * Otherwise, the field MAY be included and its default value is `false`. + * + * @default false + */ + required?: boolean; + /** + * Specifies that a parameter is deprecated and SHOULD be transitioned out + * of usage. + * + * @default false + */ + deprecated?: boolean; + /** + * If `true`, clients MAY pass a zero-length string value in place of + * parameters that would otherwise be omitted entirely, which the server + * SHOULD interpret as the parameter being unused. If `style` is used, and + * if behavior is n/a (cannot be serialized), the value SHALL be ignored. + * Interactions between this field and the parameter's Schema Object are + * implementation-defined. This field is valid only for `query` parameters. + * + * @default false + * @deprecated Use of this field is NOT RECOMMENDED, and it is likely to be + * removed in a later revision. + */ + allowEmptyValue?: boolean; + /** + * Describes how the parameter value will be serialized depending on the + * type of the parameter value. Default values (based on value of `in`): for + * `"query"` - `"form"`; for `"path"` - `"simple"`; for `"header"` - + * `"simple"`; for `"cookie"` - `"form"` (for compatibility; `"cookie"` + * SHOULD be used). This field MUST NOT be used with `in: "querystring"`. + */ + style?: ParameterStyle; + /** + * When true, parameter values of type `array` or `object` generate separate + * parameters for each value of the array or key-value pair of the map. For + * other types of parameters, or when `style` is `"deepObject"`, this field + * has no effect. When `style` is `"form"` or `"cookie"`, the default value + * is `true`; for all other styles, the default value is `false`. + */ + explode?: boolean; + /** + * When true, parameter values are serialized using reserved expansion, as + * defined by RFC6570, which allows RFC3986's reserved character set, as + * well as percent-encoded triples, to pass through unchanged, while still + * percent-encoding all other disallowed characters (including `%` outside + * of percent-encoded triples). Applications are still responsible for + * percent-encoding reserved characters that are not allowed by the rules of + * the `in` destination or media type, or are not allowed in the path by + * this specification. This field only applies to `in` and `style` values + * that automatically percent-encode. + * + * @default false + */ + allowReserved?: boolean; + /** + * The schema defining the type used for the parameter. This field MUST NOT + * be used with `in: "querystring"`. + */ + schema?: SchemaObject; + /** + * Example of the parameter's potential value. The `example` field is + * mutually exclusive of the `examples` field. + */ + example?: unknown; + /** + * Examples of the parameter's potential value. Each example SHOULD contain + * a value in the correct format as specified in the parameter encoding. The + * `examples` field is mutually exclusive of the `example` field. + */ + examples?: Record; + /** + * A map containing the representations for the parameter. The key is the + * media type and the value describes it. The map MUST only contain one + * entry. An `in: "querystring"` parameter is most often defined with the + * `application/x-www-form-urlencoded` media type. + */ + content?: Record; +} + +/** + * Describes a single request body. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#request-body-object} + */ +export interface RequestBodyObject extends SpecificationExtensions { + /** + * A brief description of the request body. This could contain examples of + * use. CommonMark syntax MAY be used for rich text representation. + */ + description?: string; + /** + * REQUIRED. The content of the request body. The key is a media type or + * media type range and the value describes it. For requests that match + * multiple keys, only the most specific key is applicable, e.g. + * `"text/plain"` overrides `"text/*"`. The map SHOULD have at least one + * entry; if it does not, the behavior is implementation-defined. + */ + content: Record; + /** + * Determines if the request body is required in the request. + * + * @default false + */ + required?: boolean; +} + +/** + * Each Media Type Object provides schema and examples for the media type + * identified by its key. + * + * Sequential media types (e.g. `application/jsonl`, `application/x-ndjson`, + * `application/json-seq`, `text/event-stream`, `multipart/mixed`) MUST be + * mapped to the JSON Schema data model as if their values were in an array in + * the same order. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#media-type-object} + */ +export interface MediaTypeObject extends SpecificationExtensions { + /** + * A schema describing the complete content of the request, response, + * parameter, or header. + */ + schema?: SchemaObject; + /** + * A schema describing each item within a sequential media type. Unlike + * `schema`, which would be applied to the complete content treated as an + * array, `itemSchema` MUST be applied to each item in the stream + * independently, which supports processing each item as it is read from the + * stream. Both `schema` and `itemSchema` MAY be used in the same Media Type + * Object. + */ + itemSchema?: SchemaObject; + /** + * Example of the media type. The example SHOULD match the specified schema + * and be in the correct format as specified by the media type and its + * encoding. The `example` field is mutually exclusive of the `examples` + * field. + */ + example?: unknown; + /** + * Examples of the media type. Each example SHOULD match the specified + * schema and be in the correct format as specified by the media type and + * its encoding. The `examples` field is mutually exclusive of the `example` + * field. + */ + examples?: Record; + /** + * A map between a property name and its encoding information, as defined + * under Encoding By Name. The key, being the property name, MUST exist in + * the schema as a property (entries with no corresponding schema property + * SHALL be ignored). The `encoding` field SHALL only apply when the media + * type is `multipart` or `application/x-www-form-urlencoded`. This field + * MUST NOT be present if `prefixEncoding` or `itemEncoding` are present. + */ + encoding?: Record; + /** + * An array of positional encoding information, as defined under Encoding By + * Position (analogous to `prefixItems`): each Encoding Object applies to + * the value at the same position in the data array. The `prefixEncoding` + * field SHALL only apply when the media type is `multipart`. This field + * MUST NOT be present if `encoding` is present. + */ + prefixEncoding?: EncodingObject[]; + /** + * A single Encoding Object that provides encoding information for multiple + * array items, as defined under Encoding By Position (analogous to + * `items`): it applies to all items not covered by `prefixEncoding`, and + * can also be used with `itemSchema` to support streaming multipart + * content. The `itemEncoding` field SHALL only apply when the media type is + * `multipart`. This field MUST NOT be present if `encoding` is present. + */ + itemEncoding?: EncodingObject; +} + +/** + * A single encoding definition applied to a single value. + * + * Encoding By Name (the Media Type Object's `encoding` field) correlates + * properties with `multipart` parts via the `name` parameter of + * `Content-Disposition: form-data`, and with `application/x-www-form-urlencoded` + * via query string parameter names; array properties are handled by applying + * the Encoding Object per array item. Encoding By Position (`prefixEncoding` + * / `itemEncoding`) correlates Encoding Objects positionally with the items + * of a `multipart` array. Implementations MUST support one level of nested + * encoding and MAY support more. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#encoding-object} + */ +export interface EncodingObject extends SpecificationExtensions { + /** + * The `Content-Type` for encoding a specific value. The value is a + * comma-separated list, each element of which is either a specific media + * type (e.g. `image/png`) or a wildcard media type (e.g. `image/*`). + * Default value depends on the type of the schema the Encoding Object + * applies to: for a schema with absent `type` – `application/octet-stream`; + * for `string` with `contentEncoding` present – `application/octet-stream`; + * for `string` without `contentEncoding`, and for `number`, `integer`, or + * `boolean` – `text/plain`; for `object` – `application/json`; for `array` + * – `application/json` (note that in Encoding By Name the Encoding Object + * is applied per array item, so this row only applies to array values + * nested inside a top-level array). + */ + contentType?: string; + /** + * A map allowing additional information to be provided as headers. + * `Content-Type` is described separately and SHALL be ignored in this + * section. This field SHALL be ignored if the media type is not a + * `multipart`. + */ + headers?: Record; + /** + * Applies nested Encoding Objects in the same manner as the Media Type + * Object's `encoding` field. + */ + encoding?: Record; + /** + * Applies nested Encoding Objects in the same manner as the Media Type + * Object's `prefixEncoding` field. + */ + prefixEncoding?: EncodingObject[]; + /** + * Applies nested Encoding Objects in the same manner as the Media Type + * Object's `itemEncoding` field. + */ + itemEncoding?: EncodingObject; + /** + * Describes how a specific value will be serialized depending on its type. + * See Parameter Object for details on the `style` field. The behavior + * follows the same values as `query` parameters, including default values, + * noting that the default of `"form"` applies only when `contentType` is + * not being used due to `explode` or `allowReserved` being explicitly + * specified. The initial `?` used in query strings MUST NOT appear in + * `application/x-www-form-urlencoded` message bodies. This field SHALL be + * ignored if the media type is not `application/x-www-form-urlencoded` or + * `multipart/form-data`. If a value is explicitly defined, then the value + * of `contentType` (implicit or explicit) SHALL be ignored. + */ + style?: QueryParameterStyle; + /** + * When true, values of type `array` or `object` generate separate + * parameters for each value of the array, or key-value-pair of the map. For + * other types of values, or when `style` is `"deepObject"`, this field has + * no effect. When `style` is `"form"`, the default value is `true`; for all + * other styles, the default value is `false`. This field SHALL be ignored + * if the media type is not `application/x-www-form-urlencoded` or + * `multipart/form-data`. If a value is explicitly defined, then the value + * of `contentType` (implicit or explicit) SHALL be ignored. + */ + explode?: boolean; + /** + * When true, values are serialized using reserved expansion, as defined by + * RFC6570, which allows RFC3986's reserved character set, as well as + * percent-encoded triples, to pass through unchanged, while still + * percent-encoding all other disallowed characters (including `%` outside + * of percent-encoded triples). Applications are still responsible for + * percent-encoding reserved characters that are not allowed in the target + * media type. This field SHALL be ignored if the media type is not + * `application/x-www-form-urlencoded` or `multipart/form-data`. If a value + * is explicitly defined, then the value of `contentType` (implicit or + * explicit) SHALL be ignored. + * + * @default false + */ + allowReserved?: boolean; +} + +/** + * A container for the expected responses of an operation. The container maps + * a HTTP response code to the expected response. + * + * The Responses Object MUST contain at least one response code, and if only + * one response code is provided it SHOULD be the response for a successful + * operation call. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#responses-object} + */ +export interface ResponsesObject extends SpecificationExtensions { + /** + * The documentation of responses other than the ones declared for specific + * HTTP response codes. Use this field to cover undeclared responses. + */ + default?: ResponseObject | ReferenceObject; + /** + * Any HTTP status code can be used as the property name, but only one + * property per code, to describe the expected response for that HTTP status + * code. This field MUST be enclosed in quotation marks (for example, "200") + * for compatibility between JSON and YAML. Status codes SHOULD be selected + * from the IANA Status Code Registry. To define a range of response codes, + * this field MAY contain the uppercase wildcard character `X`. For example, + * `2XX` represents all response codes between `200` and `299`. Only the + * following range definitions are allowed: `1XX`, `2XX`, `3XX`, `4XX`, and + * `5XX`. If a response is defined using an explicit code, the explicit code + * definition takes precedence over the range definition for that code. + */ + [statusCode: `${1 | 2 | 3 | 4 | 5}${string}`]: + | ResponseObject + | ReferenceObject; +} + +/** + * Describes a single response from an API operation, including design-time, + * static `links` to operations based on the response. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#response-object} + */ +export interface ResponseObject extends SpecificationExtensions { + /** + * A short summary of the meaning of the response. + */ + summary?: string; + /** + * A description of the response. CommonMark syntax MAY be used for rich + * text representation. Note that unlike earlier versions, this field is no + * longer REQUIRED. + */ + description?: string; + /** + * Maps a header name to its definition. RFC9110 states header names are + * case insensitive. If a response header is defined with the name + * `"Content-Type"`, it SHALL be ignored. + */ + headers?: Record; + /** + * A map containing descriptions of potential response payloads. The key is + * a media type or media type range and the value describes it. For + * responses that match multiple keys, only the most specific key is + * applicable, e.g. `"text/plain"` overrides `"text/*"`. + */ + content?: Record; + /** + * A map of operations links that can be followed from the response. The key + * of the map is a short name for the link, following the naming constraints + * of the names for Component Objects (`^[a-zA-Z0-9\.\-_]+$`). + */ + links?: Record; +} + +/** + * A map of possible out-of-band callbacks related to the parent operation. + * Each value in the map is a Path Item Object that describes a set of + * requests that may be initiated by the API provider and the expected + * responses. To describe incoming requests from the API provider independent + * from another API call, use the OpenAPI Object's `webhooks` field. + * + * Note: this object MAY be extended with Specification Extensions (`x-` + * prefixed fields), which cannot be represented in TypeScript alongside the + * arbitrary runtime-expression keys. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#callback-object} + */ +export interface CallbackObject { + /** + * A Path Item Object used to define a callback request and expected + * responses. The key is a runtime expression, evaluated in the context of a + * runtime HTTP request/response, that identifies the URL to be used for the + * callback request (e.g. `$request.body#/url`); expressions can be embedded + * into string values by surrounding them with `{}` curly braces. + */ + [expression: string]: PathItemObject; +} + +/** + * An object grouping examples with basic `summary` and `description` + * metadata, supporting both the data form (`dataValue`) and the serialized + * form (`serializedValue` / `externalValue`) of the example. + * + * Mutual exclusivity: `value` MUST be absent if `dataValue`, + * `serializedValue`, or `externalValue` is present, and `serializedValue` and + * `externalValue` are mutually exclusive; `dataValue` MAY be combined with + * either `serializedValue` or `externalValue`. + * + * In all cases, the example value SHOULD be compatible with the schema of its + * associated value; tooling MAY validate compatibility and reject + * incompatible examples. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#example-object} + */ +export interface ExampleObject extends SpecificationExtensions { + /** + * Short description for the example. + */ + summary?: string; + /** + * Long description for the example. CommonMark syntax MAY be used for rich + * text representation. + */ + description?: string; + /** + * An example of the data structure that MUST be valid according to the + * relevant Schema Object. If this field is present, `value` MUST be absent. + */ + dataValue?: unknown; + /** + * An example of the serialized form of the value, including encoding and + * escaping. If `dataValue` is present, this field SHOULD contain the + * serialization of the given data. This field SHOULD NOT be used if the + * serialization format is JSON, as the data form is easier to work with. If + * this field is present, `value` and `externalValue` MUST be absent. + */ + serializedValue?: string; + /** + * A URI that identifies the serialized example in a separate document, + * which allows for values not easily or readably expressed as a Unicode + * string. If `dataValue` is present, this field SHOULD identify a + * serialization of the given data. If this field is present, + * `serializedValue` and `value` MUST be absent. + */ + externalValue?: string; + /** + * Embedded literal example. The `value` field and `externalValue` field are + * mutually exclusive. To represent examples of media types that cannot + * naturally be represented in JSON or YAML, use a string value to contain + * the example, escaping where necessary. + * + * @deprecated For non-JSON serialization targets, use `dataValue` and/or + * `serializedValue`, which have unambiguous syntax and semantics, instead. + */ + value?: unknown; +} + +/** + * The Link Object represents a possible design-time link for a response. The + * presence of a link does not guarantee the caller's ability to successfully + * invoke it, rather it provides a known relationship and traversal mechanism + * between responses and other operations. + * + * A linked operation MUST be identified using either an `operationRef` or + * `operationId` (mutually exclusive). + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#link-object} + */ +export interface LinkObject extends SpecificationExtensions { + /** + * A URI reference to an OAS operation. This field is mutually exclusive of + * the `operationId` field, and MUST point to an Operation Object. Relative + * `operationRef` values MAY be used to locate an existing Operation Object + * in the OpenAPI Description. + */ + operationRef?: string; + /** + * The name of an existing, resolvable OAS operation, as defined with a + * unique `operationId`. This field is mutually exclusive of the + * `operationRef` field. + */ + operationId?: string; + /** + * A map representing parameters to pass to an operation as specified with + * `operationId` or identified via `operationRef`. The key is the parameter + * name to be used (optionally qualified with the parameter location, e.g. + * `path.id` for an `id` parameter in the path), whereas the value can be a + * constant or a runtime expression to be evaluated and passed to the linked + * operation. + */ + parameters?: Record; // oxlint-disable-line anti-slop/no-unsafe-dictionary-type -- the specification allows any value or runtime expression here + /** + * A literal value or runtime expression to use as a request body when + * calling the target operation. + */ + requestBody?: unknown; + /** + * A description of the link. CommonMark syntax MAY be used for rich text + * representation. + */ + description?: string; + /** + * A server object to be used by the target operation. + */ + server?: ServerObject; +} + +/** + * Describes a single header for HTTP responses and for individual parts in + * multipart representations. + * + * The Header Object follows the structure of the Parameter Object, including + * determining its serialization strategy based on whether `schema` or + * `content` is present (mutually exclusive), with these changes: `name` MUST + * NOT be specified, it is given in the corresponding `headers` map; `in` MUST + * NOT be specified, it is implicitly in `header`; all traits that are + * affected by the location MUST be applicable to a location of `header` β€” + * `allowEmptyValue` MUST NOT be used, and `style`, if used, MUST be limited + * to `"simple"`. + * + * When serializing with `schema`, URI percent-encoding MUST NOT be applied + * and header values MUST be passed through unchanged (no automatic quoting). + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#header-object} + */ +export interface HeaderObject extends SpecificationExtensions { + /** + * A brief description of the header. This could contain examples of use. + * CommonMark syntax MAY be used for rich text representation. + */ + description?: string; + /** + * Determines whether this header is mandatory. + * + * @default false + */ + required?: boolean; + /** + * Specifies that the header is deprecated and SHOULD be transitioned out of + * usage. + * + * @default false + */ + deprecated?: boolean; + /** + * Describes how the header value will be serialized. The default (and only + * legal value for headers) is `"simple"`. + * + * @default "simple" + */ + style?: "simple"; + /** + * When true, header values of type `array` or `object` generate a single + * header whose value is a comma-separated list of the array items or + * key-value pairs of the map. For other data types this field has no + * effect. + * + * @default false + */ + explode?: boolean; + /** + * The schema defining the type used for the header. + */ + schema?: SchemaObject; + /** + * Example of the header's potential value. The `example` field is mutually + * exclusive of the `examples` field. + */ + example?: unknown; + /** + * Examples of the header's potential value. Each example SHOULD contain a + * value in the correct format as specified in the header encoding. The + * `examples` field is mutually exclusive of the `example` field. + */ + examples?: Record; + /** + * A map containing the representations for the header. The key is the media + * type and the value describes it. The map MUST only contain one entry. + */ + content?: Record; +} + +/** + * Adds metadata to a single tag that is used by the Operation Object. It is + * not mandatory to have a Tag Object per tag defined in the Operation Object + * instances. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#tag-object} + */ +export interface TagObject extends SpecificationExtensions { + /** + * REQUIRED. The name of the tag. Use this value in the `tags` array of an + * Operation. + */ + name: string; + /** + * A short summary of the tag, used for display purposes. + */ + summary?: string; + /** + * A description for the tag. CommonMark syntax MAY be used for rich text + * representation. + */ + description?: string; + /** + * Additional external documentation for this tag. + */ + externalDocs?: ExternalDocumentationObject; + /** + * The `name` of a tag that this tag is nested under. The named tag MUST + * exist in the API description, and circular references between parent and + * child tags MUST NOT be used. + */ + parent?: string; + /** + * A machine-readable string to categorize what sort of tag it is. Any + * string value can be used; common uses are `nav` for Navigation, `badge` + * for visible badges, and `audience` for APIs used by different groups. A + * registry of the most commonly used values is available. + */ + kind?: string; +} + +/** + * The object form of the Schema Object: every JSON Schema Draft 2020-12 + * keyword, plus the OAS base vocabulary (`discriminator`, `xml`, + * `externalDocs`, `example`). + * + * In addition to these keywords, the Schema Object supports keywords from any + * other vocabularies, or entirely arbitrary properties (extensions inside + * Schema Objects MAY omit the `x-` prefix). + * + * @template T The type of the data instances this schema describes, applied + * to the `enum`, `const`, `default`, `examples`, and `example` fields. + * Defaults to `unknown`; subschema positions (`properties`, `items`, ...) are + * not parameterized. + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#schema-object} + */ +export interface SchemaObjectFields { + /** + * In addition to the JSON Schema keywords comprising the OAS dialect, the + * Schema Object supports keywords from any other vocabularies, or entirely + * arbitrary properties. Unlike the other objects of this specification, + * extensions MAY omit the `x-` prefix within this object. + */ + [keyword: string]: unknown; // oxlint-disable-line anti-slop/no-unsafe-dictionary-type -- the specification allows arbitrary keywords with any value here + + // JSON Schema Core vocabulary + + /** + * The URI of the dialect (meta-schema) this schema conforms to. MAY be + * present in any schema resource root, and if present MUST be used to + * determine the dialect. Tooling MUST support the OAS dialect schema id + * `https://spec.openapis.org/oas/3.1/dialect/base`, and MAY support + * additional values. The OpenAPI Object's `jsonSchemaDialect` field sets + * the default; if it is also unset, the OAS dialect schema id MUST be used. + */ + $schema?: string; + /** + * A URI identifying the schema resource. The nearest parent `$id` serves as + * the base URI for relative references within the schema. + */ + $id?: string; + /** + * A URI reference to a schema to apply at this location. Unlike the + * Reference Object, `$ref` here is a plain JSON Schema keyword: adjacent + * keywords are allowed and are evaluated normally. When inspecting schemas + * for serialization purposes (e.g. XML or sequential media types), + * implementations MUST follow `$ref` and `allOf`. + */ + $ref?: string; + /** + * A plain-name fragment identifier for the enclosing schema, usable as a + * `$ref` target. + */ + $anchor?: string; + /** + * A URI reference that, together with `$dynamicAnchor`, MAY be used to + * implement generic or template data structures: `$dynamicRef` resolves to + * the first matching `$dynamicAnchor` in the dynamic scope from the schema + * entry point. Implementations SHOULD support these keywords. + */ + $dynamicRef?: string; + /** + * A plain-name fragment identifier that is a candidate target for + * `$dynamicRef` resolution. + */ + $dynamicAnchor?: string; + /** + * A map of vocabulary URIs to booleans declaring which vocabularies are + * required (`true`) or optional (`false`) to process the schema. Only + * meaningful in a meta-schema. + */ + $vocabulary?: Record; + /** + * Reusable subschema definitions, addressable via `$ref`. + */ + $defs?: Record; + /** + * A comment for schema maintainers, carrying no validation semantics. + */ + $comment?: string; + + // JSON Schema Applicator vocabulary + + /** + * An instance is valid against this keyword if it is valid against all + * subschemas in this array. `allOf` offers model composition; with + * `discriminator`, polymorphism. When inspecting schemas for serialization + * purposes, implementations MUST follow `$ref` and `allOf`. + */ + allOf?: SchemaObject[]; + /** + * An instance is valid against this keyword if it is valid against exactly + * one subschema in this array. + */ + oneOf?: SchemaObject[]; + /** + * An instance is valid against this keyword if it is valid against at least + * one subschema in this array. + */ + anyOf?: SchemaObject[]; + /** + * An instance is valid against this keyword if it is not valid against the + * given subschema. + */ + not?: SchemaObject; + /** + * If the instance validates against this subschema, it must also validate + * against `then` (if present); otherwise against `else` (if present). + */ + if?: SchemaObject; + /** + * Applied when the instance validates against `if`. + */ + then?: SchemaObject; + /** + * Applied when the instance fails validation against `if`. + */ + else?: SchemaObject; + /** + * A map of property names to subschemas that the whole instance must + * validate against when the named property is present. + */ + dependentSchemas?: Record; + /** + * An array of subschemas applied positionally to the first items of an + * array instance (tuple validation). Also used to control XML node ordering + * and to correlate with `prefixEncoding` for positional multipart encoding. + */ + prefixItems?: SchemaObject[]; + /** + * A subschema applied to all array items not covered by `prefixItems`. + */ + items?: SchemaObject; + /** + * An array instance is valid if at least one item (subject to + * `minContains`/`maxContains`) validates against this subschema. + */ + contains?: SchemaObject; + /** + * A map of property names to subschemas validating the corresponding + * property values of an object instance. + */ + properties?: Record; + /** + * A map of ECMA-262 regular expressions to subschemas validating the values + * of all properties whose names match each expression. + */ + patternProperties?: Record; + /** + * A subschema applied to the values of all object properties not covered by + * `properties` or `patternProperties`. + */ + additionalProperties?: SchemaObject; + /** + * A subschema every property name of an object instance must validate + * against. + */ + propertyNames?: SchemaObject; + + // JSON Schema Unevaluated vocabulary + + /** + * A subschema applied to array items not successfully evaluated by any + * `prefixItems`, `items`, or `contains` in this schema or its subschemas. + */ + unevaluatedItems?: SchemaObject; + /** + * A subschema applied to object properties not successfully evaluated by + * any `properties`, `patternProperties`, or `additionalProperties` in this + * schema or its subschemas. + */ + unevaluatedProperties?: SchemaObject; + + // JSON Schema Validation vocabulary + + /** + * The data type of the schema: a string or an array of unique strings. + * `"null"` is a first-class type value. Note that keywords and formats do + * not implicitly require the expected type; use `type` to constrain it. + * Schema Objects that do not contain `type` MUST be considered to allow all + * types during schema inspection: raw binary content omits `type`, while + * encoded binary uses `type: "string"` with `contentEncoding`. + */ + type?: SchemaObjectType | SchemaObjectType[]; + /** + * The instance is valid only if its value equals one of the elements in + * this array. `enum` cannot carry per-value annotations; implementations + * MAY recognize a `oneOf`/`anyOf` whose subschemas each consist of `const` + * plus annotations (e.g. `title`, `description`) as an annotated + * enumeration. + */ + enum?: T[]; + /** + * The instance is valid only if its value equals this value. + */ + const?: T; + /** + * A numeric instance is valid only if division by this keyword's value + * results in an integer. MUST be a number strictly greater than 0. + */ + multipleOf?: number; + /** + * An inclusive upper limit for a numeric instance. + */ + maximum?: number; + /** + * An exclusive upper limit for a numeric instance. + */ + exclusiveMaximum?: number; + /** + * An inclusive lower limit for a numeric instance. + */ + minimum?: number; + /** + * An exclusive lower limit for a numeric instance. + */ + exclusiveMinimum?: number; + /** + * The maximum length of a string instance. MUST be a non-negative integer. + * MAY be used to set an expected upper bound on the length of a streaming + * payload of string data or unencoded binary data (where the length is the + * number of octets); for that use it MAY be implemented outside of regular + * JSON Schema evaluation. + */ + maxLength?: number; + /** + * The minimum length of a string instance. MUST be a non-negative integer. + * + * @default 0 + */ + minLength?: number; + /** + * A string instance is valid if the ECMA-262 regular expression matches it. + */ + pattern?: string; + /** + * The maximum number of items in an array instance. MUST be a non-negative + * integer. + */ + maxItems?: number; + /** + * The minimum number of items in an array instance. MUST be a non-negative + * integer. + * + * @default 0 + */ + minItems?: number; + /** + * If `true`, all items in an array instance must be unique. + * + * @default false + */ + uniqueItems?: boolean; + /** + * The maximum number of items matching `contains`. MUST be a non-negative + * integer. + */ + maxContains?: number; + /** + * The minimum number of items matching `contains`. MUST be a non-negative + * integer. + * + * @default 1 + */ + minContains?: number; + /** + * The maximum number of properties of an object instance. MUST be a + * non-negative integer. + */ + maxProperties?: number; + /** + * The minimum number of properties of an object instance. MUST be a + * non-negative integer. + * + * @default 0 + */ + minProperties?: number; + /** + * Property names that must be present in an object instance. Elements MUST + * be unique. + */ + required?: string[]; + /** + * A map of property names to arrays of property names that must also be + * present when the key property is present. + */ + dependentRequired?: Record; + + // JSON Schema Meta-Data vocabulary + + /** + * A short title for the schema. + */ + title?: string; + /** + * A description of the schema. CommonMark syntax MAY be used for rich text + * representation. + */ + description?: string; + /** + * A default value associated with the schema, as an annotation for + * documenting the receiver's behavior; it is not inserted into the data + * (contrast with the Server Variable Object's `default`). + */ + default?: T; + /** + * Indicates that applications SHOULD refrain from using the described + * value(s). + * + * @default false + */ + deprecated?: boolean; + /** + * Indicates the value is managed by the owning authority: it MAY be sent in + * a response but SHOULD NOT be sent in a request. Per JSON Schema + * Validation Draft 2020-12 Β§9.4, the owning authority MAY either ignore a + * `readOnly` field sent in a request or treat it as an error. + * + * @default false + */ + readOnly?: boolean; + /** + * Indicates the value may be sent in a request but SHOULD NOT be included + * in a response. + * + * @default false + */ + writeOnly?: boolean; + /** + * An array of example values associated with the schema. This is the + * preferred, JSON-Schema-native way to include examples in a Schema Object, + * replacing the OAS-specific singular `example`. + */ + examples?: T[]; + + // JSON Schema Format-Annotation vocabulary + + /** + * The format of the data type. While relying on JSON Schema's defined + * formats, the OAS offers a few additional predefined formats: `"int32"`, + * `"int64"`, `"float"`, `"double"` (with `type: "number"`), and + * `"password"` (a hint to obscure the value, with `type: "string"`). + * `format` is a non-validating annotation by default; tools that do not + * recognize a format MAY default back to `type` alone. Support for any + * format registered in the OpenAPI Format Registry is strictly OPTIONAL. + */ + format?: string; + + // JSON Schema Content vocabulary + + /** + * The encoding (`base64`, `base64url`, or another encoding) used to + * represent binary data as a string instance. Unrelated to the HTTP + * `Content-Encoding` header. For multipart content, using `contentEncoding` + * is equivalent to requiring a `Content-Transfer-Encoding` header. Treated + * as an annotation rather than validated directly. + */ + contentEncoding?: string; + /** + * The media type of the content of a string instance (or of raw binary + * data). Redundant if the media type is already set as the Media Type + * Object's key or in an Encoding Object's `contentType`, and SHALL be + * ignored if it contradicts them. Treated as an annotation rather than + * validated directly. + */ + contentMediaType?: string; + /** + * A subschema describing the structure of the string's decoded content + * (e.g. JSON in a `text/event-stream` `data` field). Treated as an + * annotation rather than validated directly. + */ + contentSchema?: SchemaObject; + + // OAS base vocabulary + + /** + * Provides a hint about which of a set of schemas a payload is expected to + * satisfy. Legal only when using one of the composite keywords `oneOf`, + * `anyOf`, `allOf` β€” adjacent to `oneOf`/`anyOf`, or in a parent schema + * that child schemas reference via `allOf`; MUST NOT change the validation + * outcome. When the discriminating property is optional, the Discriminator + * Object MUST include a `defaultMapping` field. + */ + discriminator?: DiscriminatorObject; + /** + * Adds additional metadata to describe the XML representation of this + * schema. Note that unlike earlier versions, OpenAPI 3.2 does not restrict + * `xml` to property schemas. + */ + xml?: XMLObject; + /** + * Additional external documentation for this schema. + */ + externalDocs?: ExternalDocumentationObject; + /** + * A free-form field to include an example of an instance for this schema. + * To represent examples that cannot be naturally represented in JSON or + * YAML, a string value can be used to contain the example with escaping + * where necessary. + * + * @deprecated The `example` field has been deprecated in favor of the JSON + * Schema `examples` keyword. Use of `example` is discouraged, and later + * versions of this specification may remove it. + */ + example?: T; +} + +/** + * The Schema Object allows the definition of input and output data types. + * These types can be objects, but also primitives and arrays. This object is + * a superset of the JSON Schema Specification Draft 2020-12. + * + * The empty schema (which allows any instance to validate) MAY be represented + * by the boolean value `true`, and a schema which allows no instance to + * validate MAY be represented by the boolean value `false`. + * + * Unless stated otherwise, the keyword definitions follow those of JSON + * Schema and do not add any additional semantics. The OpenAPI Schema Object + * dialect is identified by the URI `https://spec.openapis.org/oas/3.1/dialect/base` + * (the "OAS dialect schema id"), and requires the OAS base vocabulary + * (`discriminator`, `xml`, `externalDocs`, `example`) in addition to the + * vocabularies of the JSON Schema Draft 2020-12 general-purpose meta-schema. + * + * @template T The type of the data instances this schema describes, applied + * to the `enum`, `const`, `default`, `examples`, and `example` fields. + * Defaults to `unknown`. + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#schema-object} + */ +export type SchemaObject = boolean | SchemaObjectFields; + +/** + * When request bodies or response payloads may be one of a number of + * different schemas, a Discriminator Object gives a hint about the expected + * schema of the document. This hint can be used to aid in serialization, + * deserialization, and validation. + * + * The Discriminator Object is legal only when using one of the composite + * keywords `oneOf`, `anyOf`, `allOf`. Note that `discriminator` MUST NOT + * change the validation outcome of the schema. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#discriminator-object} + */ +export interface DiscriminatorObject extends SpecificationExtensions { + /** + * REQUIRED. The name of the property in the payload that will hold the + * discriminating value. The discriminating property MAY be defined as + * required or optional, but when defined as optional the Discriminator + * Object MUST include a `defaultMapping` field. + */ + propertyName: string; + /** + * An object to hold mappings between payload values and schema names or URI + * references. The value of the property named in `propertyName` is used as + * the name of the associated schema under the Components Object unless a + * `mapping` is present for that value. To force a value to be treated as a + * relative URI reference rather than a schema name, authors MUST prefix it + * with the `"."` path segment (e.g. `"./foo"`). Mapping keys MUST be string + * values. + */ + mapping?: Record; + /** + * The schema name or URI reference to a schema that is expected to validate + * the structure of the model when the discriminating property is not + * present in the payload, or contains a value for which there is no + * explicit or implicit mapping. REQUIRED when the discriminating property + * is defined as optional. + */ + defaultMapping?: string; +} + +/** + * The type of XML node a schema corresponds to (with DOM `nodeType` numeric + * equivalents): + * + * - `"element"` (1) β€” the schema represents an element and describes its + * contents. + * - `"attribute"` (2) β€” the schema represents an attribute and its value. + * - `"text"` (3) β€” the schema represents a text node (parsed character data). + * - `"cdata"` (4) β€” the schema represents a CDATA section. + * - `"none"` β€” no corresponding node; nodes from subschemas are included + * directly under the parent schema's node. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#xml-node-types} + */ +export type XMLNodeType = "attribute" | "cdata" | "element" | "none" | "text"; + +/** + * A metadata object that allows for more fine-tuned XML model definitions. + * + * When using arrays, XML element names are not inferred (for singular/plural + * forms) and the `name` field SHOULD be used to add that information. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#xml-object} + */ +export interface XMLObject extends SpecificationExtensions { + /** + * The type of XML node this schema corresponds to. The default value is + * `"none"` if `$ref`, `$dynamicRef`, or `type: "array"` is present in the + * Schema Object containing the XML Object, and `"element"` otherwise; set + * an explicit `nodeType: "element"` on an array schema to produce a + * wrapping element. + */ + nodeType?: XMLNodeType; + /** + * Sets the name of the element/attribute corresponding to the schema, + * replacing the inferred name (a component schema's name, or the parent + * property's name; in other cases, such as inline media-type schemas, no + * name can be inferred and an XML Object with `name` MUST be present). This + * field SHALL be ignored if `nodeType` is `"text"`, `"cdata"`, or + * `"none"`. + */ + name?: string; + /** + * The IRI (RFC3987) of the namespace definition. Value MUST be in the form + * of a non-relative IRI. + */ + namespace?: string; + /** + * The prefix to be used for the name. + */ + prefix?: string; + /** + * Declares whether the property definition translates to an attribute + * instead of an element. This field MUST NOT be present if `nodeType` is + * present. + * + * @default false + * @deprecated Use `nodeType: "attribute"` instead of `attribute: true`. + */ + attribute?: boolean; + /** + * MAY be used only for an array definition. Signifies whether the array is + * wrapped (e.g. ``) or unwrapped + * (``). The definition takes effect only when defined + * alongside `type` being `"array"` (outside the `items`). This field MUST + * NOT be present if `nodeType` is present. + * + * @default false + * @deprecated Use `nodeType: "element"` instead of `wrapped: true`. + */ + wrapped?: boolean; +} + +/** + * Defines an API key security scheme that can be used by the operations. The + * API key can be sent via a header, cookie, or query parameter. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#security-scheme-object} + */ +export interface ApiKeySecuritySchemeObject extends SpecificationExtensions { + /** + * REQUIRED. The type of the security scheme. + */ + type: "apiKey"; + /** + * A description for security scheme. CommonMark syntax MAY be used for rich + * text representation. + */ + description?: string; + /** + * Declares this security scheme to be deprecated. Consumers SHOULD refrain + * from usage of the declared scheme. + * + * @default false + */ + deprecated?: boolean; + /** + * REQUIRED. The name of the header, query or cookie parameter to be used. + */ + name: string; + /** + * REQUIRED. The location of the API key. Valid values are `"query"`, + * `"header"`, or `"cookie"`. + */ + in: "cookie" | "header" | "query"; +} + +/** + * Defines an HTTP authentication security scheme that can be used by the + * operations. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#security-scheme-object} + */ +export interface HttpSecuritySchemeObject extends SpecificationExtensions { + /** + * REQUIRED. The type of the security scheme. + */ + type: "http"; + /** + * A description for security scheme. CommonMark syntax MAY be used for rich + * text representation. + */ + description?: string; + /** + * Declares this security scheme to be deprecated. Consumers SHOULD refrain + * from usage of the declared scheme. + * + * @default false + */ + deprecated?: boolean; + /** + * REQUIRED. The name of the HTTP Authentication scheme to be used in the + * Authorization header as defined in RFC9110. The values used SHOULD be + * registered in the IANA Authentication Scheme registry. The value is + * case-insensitive. + */ + scheme: string; + /** + * A hint to the client to identify how the bearer token is formatted. + * Bearer tokens are usually generated by an authorization server, so this + * information is primarily for documentation purposes. Applies to `http` + * schemes with a `"bearer"` scheme value. + */ + bearerFormat?: string; +} + +/** + * Defines a mutual TLS security scheme (use of a client certificate) that can + * be used by the operations. There are no additional configuration fields. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#security-scheme-object} + */ +export interface MutualTlsSecuritySchemeObject extends SpecificationExtensions { + /** + * REQUIRED. The type of the security scheme. + */ + type: "mutualTLS"; + /** + * A description for security scheme. CommonMark syntax MAY be used for rich + * text representation. + */ + description?: string; + /** + * Declares this security scheme to be deprecated. Consumers SHOULD refrain + * from usage of the declared scheme. + * + * @default false + */ + deprecated?: boolean; +} + +/** + * Defines an OAuth2 security scheme that can be used by the operations, using + * OAuth2's common flows (implicit, password, client credentials, and + * authorization code) as defined in RFC6749, and the Device Authorization + * flow as defined in RFC8628. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#security-scheme-object} + */ +export interface OAuth2SecuritySchemeObject extends SpecificationExtensions { + /** + * REQUIRED. The type of the security scheme. + */ + type: "oauth2"; + /** + * A description for security scheme. CommonMark syntax MAY be used for rich + * text representation. + */ + description?: string; + /** + * Declares this security scheme to be deprecated. Consumers SHOULD refrain + * from usage of the declared scheme. + * + * @default false + */ + deprecated?: boolean; + /** + * REQUIRED. An object containing configuration information for the flow + * types supported. + */ + flows: OAuthFlowsObject; + /** + * URL to the OAuth2 authorization server metadata (RFC8414). TLS is + * required. + */ + oauth2MetadataUrl?: string; +} + +/** + * Defines an OpenID Connect security scheme that can be used by the + * operations. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#security-scheme-object} + */ +export interface OpenIdConnectSecuritySchemeObject extends SpecificationExtensions { + /** + * REQUIRED. The type of the security scheme. + */ + type: "openIdConnect"; + /** + * A description for security scheme. CommonMark syntax MAY be used for rich + * text representation. + */ + description?: string; + /** + * Declares this security scheme to be deprecated. Consumers SHOULD refrain + * from usage of the declared scheme. + * + * @default false + */ + deprecated?: boolean; + /** + * REQUIRED. Well-known URL to discover the OpenID Connect Discovery + * provider metadata. + */ + openIdConnectUrl: string; +} + +/** + * Defines a security scheme that can be used by the operations. Supported + * schemes are HTTP authentication, an API key (either as a header, a cookie + * parameter, or as a query parameter), mutual TLS (use of a client + * certificate), OAuth2's common flows (implicit, password, client + * credentials, and authorization code) as defined in RFC6749, the OAuth2 + * Device Authorization flow as defined in RFC8628, and OpenID Connect + * Discovery. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#security-scheme-object} + */ +export type SecuritySchemeObject = + | ApiKeySecuritySchemeObject + | HttpSecuritySchemeObject + | MutualTlsSecuritySchemeObject + | OAuth2SecuritySchemeObject + | OpenIdConnectSecuritySchemeObject; + +/** + * Allows configuration of the supported OAuth Flows. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#oauth-flows-object} + */ +export interface OAuthFlowsObject extends SpecificationExtensions { + /** + * Configuration for the OAuth Implicit flow. + */ + implicit?: ImplicitOAuthFlowObject; + /** + * Configuration for the OAuth Resource Owner Password flow. + */ + password?: PasswordOAuthFlowObject; + /** + * Configuration for the OAuth Client Credentials flow. Previously called + * `application` in OpenAPI 2.0. + */ + clientCredentials?: ClientCredentialsOAuthFlowObject; + /** + * Configuration for the OAuth Authorization Code flow. Previously called + * `accessCode` in OpenAPI 2.0. + */ + authorizationCode?: AuthorizationCodeOAuthFlowObject; + /** + * Configuration for the OAuth Device Authorization flow. + */ + deviceAuthorization?: DeviceAuthorizationOAuthFlowObject; +} + +/** + * Configuration details for the OAuth Device Authorization flow (RFC8628). + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#oauth-flow-object} + */ +export interface DeviceAuthorizationOAuthFlowObject extends OAuthFlowObjectBase { + /** + * REQUIRED. The device authorization URL to be used for this flow. This + * MUST be in the form of a URL. The OAuth2 standard requires the use of + * TLS. + */ + deviceAuthorizationUrl: string; + /** + * REQUIRED. The token URL to be used for this flow. This MUST be in the + * form of a URL. The OAuth2 standard requires the use of TLS. + */ + tokenUrl: string; +} + +/** + * Configuration details for a supported OAuth Flow. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#oauth-flow-object} + */ +export type OAuthFlowObject = + | AuthorizationCodeOAuthFlowObject + | ClientCredentialsOAuthFlowObject + | DeviceAuthorizationOAuthFlowObject + | ImplicitOAuthFlowObject + | PasswordOAuthFlowObject; + +/** + * Lists the required security schemes to execute this operation or the API as + * a whole. A Security Requirement Object MAY refer to multiple security + * schemes, in which case all schemes MUST be satisfied for a request to be + * authorized. + * + * When a list of Security Requirement Objects is defined on the OpenAPI + * Object or Operation Object, only one of the Security Requirement Objects in + * the list needs to be satisfied to authorize the request. An empty Security + * Requirement Object (`{}`) indicates anonymous access is supported. + * + * @see {@link https://spec.openapis.org/oas/v3.2.0.html#security-requirement-object} + */ +export interface SecurityRequirementObject { + /** + * Each name or URI MUST correspond to a security scheme: either the name of + * a Security Scheme Object declared in the Components Object's + * `securitySchemes`, or the URI of a Security Scheme Object. Property names + * that are identical to a component name MUST be treated as a component + * name; to reference a scheme with a single-segment relative URI reference + * that collides with a component name, prefix it with the `./` path segment + * (e.g. `"./foo"`). If the security scheme is of type `"oauth2"` or + * `"openIdConnect"`, then the value is a list of scope names required for + * the execution, and the list MAY be empty if authorization does not + * require a specified scope. For other security scheme types, the array MAY + * contain a list of role names which are required for the execution, but + * are not otherwise defined or exchanged in-band. + */ + [name: string]: string[]; +} diff --git a/packages/types/tests/README.md b/packages/types/tests/README.md new file mode 100644 index 0000000..c7ced5e --- /dev/null +++ b/packages/types/tests/README.md @@ -0,0 +1,13 @@ +# Real-document fixtures + +Type-level fixtures generated from official OpenAPI documents. Each file embeds a complete document as an object literal checked with `satisfies OpenAPIObject` against the version module matching its `openapi` field, so `tsc` at the repository root re-validates the whole corpus. + +Sources (Apache-2.0, Β© the OpenAPI Initiative): + +- `examples/` β€” the official example documents from [OAI/learn.openapis.org](https://github.com/OAI/learn.openapis.org/tree/main/examples) (v3.0, v3.1, and v3.2 sets). +- `schema-tests-3.1/` β€” the `tests/schema/pass` documents from the [OAI/OpenAPI-Specification `v3.1-dev` branch](https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass). +- `schema-tests-3.2/` β€” the `tests/schema/pass` documents from the [OAI/OpenAPI-Specification `v3.2-dev` branch](https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass). + +The corresponding `tests/schema/fail` documents are intentionally not committed: most of them violate semantic rules that these types document rather than encode (mutual exclusions, at-least-one-of containers, per-location field applicability, non-empty arrays, map-key syntax). The ones that are type-expressible (unknown top-level fields, wrong value shapes, excess fields on Header/Link Objects, 3.2-only style values used in 3.1 documents) were verified to produce compile errors when this corpus was generated. + +The files are generated β€” do not edit them by hand; refresh them from the sources above instead. diff --git a/packages/types/tests/examples/3-2-query-example.ts b/packages/types/tests/examples/3-2-query-example.ts new file mode 100644 index 0000000..3e3b19b --- /dev/null +++ b/packages/types/tests/examples/3-2-query-example.ts @@ -0,0 +1,116 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/learn.openapis.org/tree/main/examples/3.2-query-example.json +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "Flight API", + version: "1.0.0", + }, + paths: { + "/flights/search": { + query: { + summary: "Search flights with complex criteria", + description: + "Uses the HTTP QUERY method to perform a safe, idempotent flight search with filters that are too complex for a URL query string.", + operationId: "searchFlights", + requestBody: { + required: true, + content: { + "application/json": { + schema: { + type: "object", + properties: { + origin: { + type: "string", + example: "ATL", + }, + destination: { + type: "string", + example: "LHR", + }, + departureDate: { + type: "string", + format: "date", + example: "2026-06-15", + }, + returnDate: { + type: "string", + format: "date", + example: "2026-06-25", + }, + passengers: { + type: "integer", + minimum: 1, + example: 2, + }, + cabinClass: { + type: "string", + enum: ["economy", "premium-economy", "business", "first"], + example: "business", + }, + nonStopOnly: { + type: "boolean", + example: true, + }, + }, + required: ["origin", "destination", "departureDate"], + }, + }, + }, + }, + responses: { + "200": { + description: "Matching flights", + content: { + "application/json": { + schema: { + type: "object", + properties: { + flights: { + type: "array", + items: { + type: "object", + properties: { + flightNumber: { + type: "string", + example: "DL30", + }, + origin: { + type: "string", + example: "ATL", + }, + destination: { + type: "string", + example: "LHR", + }, + departureTime: { + type: "string", + format: "date-time", + example: "2026-06-15T22:30:00Z", + }, + arrivalTime: { + type: "string", + format: "date-time", + example: "2026-06-16T10:15:00Z", + }, + price: { + type: "number", + format: "float", + example: 1249.99, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/examples/3-2-tags-example.ts b/packages/types/tests/examples/3-2-tags-example.ts new file mode 100644 index 0000000..2ba3011 --- /dev/null +++ b/packages/types/tests/examples/3-2-tags-example.ts @@ -0,0 +1,70 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/learn.openapis.org/tree/main/examples/3.2-tags-example.json +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "Flight API", + version: "1.0.0", + }, + tags: [ + { + name: "flights", + summary: "Flights", + description: "Core flight operations", + kind: "nav", + }, + { + name: "international", + summary: "International", + description: "Flights that cross country borders", + parent: "flights", + kind: "nav", + }, + { + name: "domestic", + summary: "Domestic", + description: "Flights within a single country", + parent: "flights", + kind: "nav", + }, + { + name: "delays", + summary: "Delays", + description: "Information about flight delays", + kind: "badge", + externalDocs: { + description: "Delay compensation policies", + url: "https://docs.example.com/delay-policies", + }, + }, + ], + paths: { + "/flights": { + get: { + tags: ["flights"], + summary: "List all flights", + }, + }, + "/flights/international": { + get: { + tags: ["international"], + summary: "List international flights", + }, + }, + "/flights/domestic": { + get: { + tags: ["domestic"], + summary: "List domestic flights", + }, + }, + "/flights/delayed": { + get: { + tags: ["delays"], + summary: "Get delayed flights", + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/examples/api-with-examples-3-0.ts b/packages/types/tests/examples/api-with-examples-3-0.ts new file mode 100644 index 0000000..4c40df9 --- /dev/null +++ b/packages/types/tests/examples/api-with-examples-3-0.ts @@ -0,0 +1,197 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/learn.openapis.org/tree/main/examples/api-with-examples-3.0.json +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.0"; + +export const doc = { + openapi: "3.0.0", + info: { + title: "Simple API overview", + version: "2.0.0", + }, + paths: { + "/": { + get: { + operationId: "listVersionsv2", + summary: "List API versions", + responses: { + "200": { + description: "200 response", + content: { + "application/json": { + examples: { + foo: { + value: { + versions: [ + { + status: "CURRENT", + updated: "2011-01-21T11:33:21Z", + id: "v2.0", + links: [ + { + href: "http://127.0.0.1:8774/v2/", + rel: "self", + }, + ], + }, + { + status: "EXPERIMENTAL", + updated: "2013-07-23T11:33:21Z", + id: "v3.0", + links: [ + { + href: "http://127.0.0.1:8774/v3/", + rel: "self", + }, + ], + }, + ], + }, + }, + }, + }, + }, + }, + "300": { + description: "300 response", + content: { + "application/json": { + examples: { + foo: { + value: { + versions: [ + { + status: "CURRENT", + updated: "2011-01-21T11:33:21Z", + id: "v2.0", + links: [ + { + href: "http://127.0.0.1:8774/v2/", + rel: "self", + }, + ], + }, + { + status: "EXPERIMENTAL", + updated: "2013-07-23T11:33:21Z", + id: "v3.0", + links: [ + { + href: "http://127.0.0.1:8774/v3/", + rel: "self", + }, + ], + }, + ], + }, + }, + }, + }, + }, + }, + }, + }, + }, + "/v2": { + get: { + operationId: "getVersionDetailsv2", + summary: "Show API version details", + responses: { + "200": { + description: "200 response", + content: { + "application/json": { + examples: { + foo: { + value: { + version: { + status: "CURRENT", + updated: "2011-01-21T11:33:21Z", + "media-types": [ + { + base: "application/xml", + type: "application/vnd.openstack.compute+xml;version=2", + }, + { + base: "application/json", + type: "application/vnd.openstack.compute+json;version=2", + }, + ], + id: "v2.0", + links: [ + { + href: "http://127.0.0.1:8774/v2/", + rel: "self", + }, + { + href: "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf", + type: "application/pdf", + rel: "describedby", + }, + { + href: "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl", + type: "application/vnd.sun.wadl+xml", + rel: "describedby", + }, + { + href: "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl", + type: "application/vnd.sun.wadl+xml", + rel: "describedby", + }, + ], + }, + }, + }, + }, + }, + }, + }, + "203": { + description: "203 response", + content: { + "application/json": { + examples: { + foo: { + value: { + version: { + status: "CURRENT", + updated: "2011-01-21T11:33:21Z", + "media-types": [ + { + base: "application/xml", + type: "application/vnd.openstack.compute+xml;version=2", + }, + { + base: "application/json", + type: "application/vnd.openstack.compute+json;version=2", + }, + ], + id: "v2.0", + links: [ + { + href: "http://23.253.228.211:8774/v2/", + rel: "self", + }, + { + href: "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf", + type: "application/pdf", + rel: "describedby", + }, + { + href: "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl", + type: "application/vnd.sun.wadl+xml", + rel: "describedby", + }, + ], + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/examples/callback-example-3-0.ts b/packages/types/tests/examples/callback-example-3-0.ts new file mode 100644 index 0000000..641ba03 --- /dev/null +++ b/packages/types/tests/examples/callback-example-3-0.ts @@ -0,0 +1,92 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/learn.openapis.org/tree/main/examples/callback-example-3.0.json +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.0"; + +export const doc = { + openapi: "3.0.0", + info: { + title: "Callback Example", + version: "1.0.0", + }, + paths: { + "/streams": { + post: { + description: "subscribes a client to receive out-of-band data", + parameters: [ + { + name: "callbackUrl", + in: "query", + required: true, + description: + "the location where data will be sent. Must be network accessible\nby the source server\n", + schema: { + type: "string", + format: "uri", + example: "https://tonys-server.com", + }, + }, + ], + responses: { + "201": { + description: "subscription successfully created", + content: { + "application/json": { + schema: { + type: "object", + description: "subscription information", + required: ["subscriptionId"], + properties: { + subscriptionId: { + description: + "this unique identifier allows management of the subscription", + type: "string", + example: "2531329f-fb09-4ef7-887e-84e648214436", + }, + }, + }, + }, + }, + }, + }, + callbacks: { + onData: { + "{$request.query.callbackUrl}/data": { + post: { + requestBody: { + description: "subscription payload", + content: { + "application/json": { + schema: { + type: "object", + properties: { + timestamp: { + type: "string", + format: "date-time", + }, + userData: { + type: "string", + }, + }, + }, + }, + }, + }, + responses: { + "202": { + description: + "Your server implementation should return this HTTP status code\nif the data was received successfully\n", + }, + "204": { + description: + "Your server should return this HTTP status code if no longer interested\nin further updates\n", + }, + }, + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/examples/link-example-3-0.ts b/packages/types/tests/examples/link-example-3-0.ts new file mode 100644 index 0000000..607d8cd --- /dev/null +++ b/packages/types/tests/examples/link-example-3-0.ts @@ -0,0 +1,324 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/learn.openapis.org/tree/main/examples/link-example-3.0.json +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.0"; + +export const doc = { + openapi: "3.0.0", + info: { + title: "Link Example", + version: "1.0.0", + }, + paths: { + "/2.0/users/{username}": { + get: { + operationId: "getUserByName", + parameters: [ + { + name: "username", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + ], + responses: { + "200": { + description: "The User", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/user", + }, + }, + }, + links: { + userRepositories: { + $ref: "#/components/links/UserRepositories", + }, + }, + }, + }, + }, + }, + "/2.0/repositories/{username}": { + get: { + operationId: "getRepositoriesByOwner", + parameters: [ + { + name: "username", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + ], + responses: { + "200": { + description: "repositories owned by the supplied user", + content: { + "application/json": { + schema: { + type: "array", + items: { + $ref: "#/components/schemas/repository", + }, + }, + }, + }, + links: { + userRepository: { + $ref: "#/components/links/UserRepository", + }, + }, + }, + }, + }, + }, + "/2.0/repositories/{username}/{slug}": { + get: { + operationId: "getRepository", + parameters: [ + { + name: "username", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + { + name: "slug", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + ], + responses: { + "200": { + description: "The repository", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/repository", + }, + }, + }, + links: { + repositoryPullRequests: { + $ref: "#/components/links/RepositoryPullRequests", + }, + }, + }, + }, + }, + }, + "/2.0/repositories/{username}/{slug}/pullrequests": { + get: { + operationId: "getPullRequestsByRepository", + parameters: [ + { + name: "username", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + { + name: "slug", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + { + name: "state", + in: "query", + schema: { + type: "string", + enum: ["open", "merged", "declined"], + }, + }, + ], + responses: { + "200": { + description: "an array of pull request objects", + content: { + "application/json": { + schema: { + type: "array", + items: { + $ref: "#/components/schemas/pullrequest", + }, + }, + }, + }, + }, + }, + }, + }, + "/2.0/repositories/{username}/{slug}/pullrequests/{pid}": { + get: { + operationId: "getPullRequestsById", + parameters: [ + { + name: "username", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + { + name: "slug", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + { + name: "pid", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + ], + responses: { + "200": { + description: "a pull request object", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/pullrequest", + }, + }, + }, + links: { + pullRequestMerge: { + $ref: "#/components/links/PullRequestMerge", + }, + }, + }, + }, + }, + }, + "/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge": { + post: { + operationId: "mergePullRequest", + parameters: [ + { + name: "username", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + { + name: "slug", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + { + name: "pid", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + ], + responses: { + "204": { + description: "the PR was successfully merged", + }, + }, + }, + }, + }, + components: { + links: { + UserRepositories: { + operationId: "getRepositoriesByOwner", + parameters: { + username: "$response.body#/username", + }, + }, + UserRepository: { + operationId: "getRepository", + parameters: { + username: "$response.body#/owner/username", + slug: "$response.body#/slug", + }, + }, + RepositoryPullRequests: { + operationId: "getPullRequestsByRepository", + parameters: { + username: "$response.body#/owner/username", + slug: "$response.body#/slug", + }, + }, + PullRequestMerge: { + operationId: "mergePullRequest", + parameters: { + username: "$response.body#/author/username", + slug: "$response.body#/repository/slug", + pid: "$response.body#/id", + }, + }, + }, + schemas: { + user: { + type: "object", + properties: { + username: { + type: "string", + }, + uuid: { + type: "string", + }, + }, + }, + repository: { + type: "object", + properties: { + slug: { + type: "string", + }, + owner: { + $ref: "#/components/schemas/user", + }, + }, + }, + pullrequest: { + type: "object", + properties: { + id: { + type: "integer", + }, + title: { + type: "string", + }, + repository: { + $ref: "#/components/schemas/repository", + }, + author: { + $ref: "#/components/schemas/user", + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/examples/non-oauth-scopes-3-1.ts b/packages/types/tests/examples/non-oauth-scopes-3-1.ts new file mode 100644 index 0000000..8085e3d --- /dev/null +++ b/packages/types/tests/examples/non-oauth-scopes-3-1.ts @@ -0,0 +1,34 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/learn.openapis.org/tree/main/examples/non-oauth-scopes-3.1.json +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "Non-oAuth Scopes example", + version: "1.0.0", + }, + paths: { + "/users": { + get: { + security: [ + { + bearerAuth: ["read:users", "public"], + }, + ], + }, + }, + }, + components: { + securitySchemes: { + bearerAuth: { + type: "http", + scheme: "bearer", + bearerFormat: "jwt", + description: + "note: non-oauth scopes are not defined at the securityScheme level", + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/examples/petstore-3-0.ts b/packages/types/tests/examples/petstore-3-0.ts new file mode 100644 index 0000000..066109b --- /dev/null +++ b/packages/types/tests/examples/petstore-3-0.ts @@ -0,0 +1,182 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/learn.openapis.org/tree/main/examples/petstore-3.0.json +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.0"; + +export const doc = { + openapi: "3.0.0", + info: { + version: "1.0.0", + title: "Swagger Petstore", + license: { + name: "MIT", + }, + }, + servers: [ + { + url: "http://petstore.swagger.io/v1", + }, + ], + paths: { + "/pets": { + get: { + summary: "List all pets", + operationId: "listPets", + tags: ["pets"], + parameters: [ + { + name: "limit", + in: "query", + description: "How many items to return at one time (max 100)", + required: false, + schema: { + type: "integer", + maximum: 100, + format: "int32", + }, + }, + ], + responses: { + "200": { + description: "A paged array of pets", + headers: { + "x-next": { + description: "A link to the next page of responses", + schema: { + type: "string", + }, + }, + }, + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Pets", + }, + }, + }, + }, + default: { + description: "unexpected error", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Error", + }, + }, + }, + }, + }, + }, + post: { + summary: "Create a pet", + operationId: "createPets", + tags: ["pets"], + requestBody: { + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + required: true, + }, + responses: { + "201": { + description: "Null response", + }, + default: { + description: "unexpected error", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Error", + }, + }, + }, + }, + }, + }, + }, + "/pets/{petId}": { + get: { + summary: "Info for a specific pet", + operationId: "showPetById", + tags: ["pets"], + parameters: [ + { + name: "petId", + in: "path", + required: true, + description: "The id of the pet to retrieve", + schema: { + type: "string", + }, + }, + ], + responses: { + "200": { + description: "Expected response to a valid request", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + }, + default: { + description: "unexpected error", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Error", + }, + }, + }, + }, + }, + }, + }, + }, + components: { + schemas: { + Pet: { + type: "object", + required: ["id", "name"], + properties: { + id: { + type: "integer", + format: "int64", + }, + name: { + type: "string", + }, + tag: { + type: "string", + }, + }, + }, + Pets: { + type: "array", + maxItems: 100, + items: { + $ref: "#/components/schemas/Pet", + }, + }, + Error: { + type: "object", + required: ["code", "message"], + properties: { + code: { + type: "integer", + format: "int32", + }, + message: { + type: "string", + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/examples/petstore-expanded-3-0.ts b/packages/types/tests/examples/petstore-expanded-3-0.ts new file mode 100644 index 0000000..0bba117 --- /dev/null +++ b/packages/types/tests/examples/petstore-expanded-3-0.ts @@ -0,0 +1,243 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/learn.openapis.org/tree/main/examples/petstore-expanded-3.0.json +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.0"; + +export const doc = { + openapi: "3.0.0", + info: { + version: "1.0.0", + title: "Swagger Petstore", + description: + "A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification", + termsOfService: "http://swagger.io/terms/", + contact: { + name: "Swagger API Team", + email: "apiteam@swagger.io", + url: "http://swagger.io", + }, + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html", + }, + }, + servers: [ + { + url: "https://petstore.swagger.io/v2", + }, + ], + paths: { + "/pets": { + get: { + description: + "Returns all pets from the system that the user has access to\nNam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.\n\nSed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.\n", + operationId: "findPets", + parameters: [ + { + name: "tags", + in: "query", + description: "tags to filter by", + required: false, + style: "form", + schema: { + type: "array", + items: { + type: "string", + }, + }, + }, + { + name: "limit", + in: "query", + description: "maximum number of results to return", + required: false, + schema: { + type: "integer", + format: "int32", + }, + }, + ], + responses: { + "200": { + description: "pet response", + content: { + "application/json": { + schema: { + type: "array", + items: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + }, + }, + default: { + description: "unexpected error", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Error", + }, + }, + }, + }, + }, + }, + post: { + description: "Creates a new pet in the store. Duplicates are allowed", + operationId: "addPet", + requestBody: { + description: "Pet to add to the store", + required: true, + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/NewPet", + }, + }, + }, + }, + responses: { + "200": { + description: "pet response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + }, + default: { + description: "unexpected error", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Error", + }, + }, + }, + }, + }, + }, + }, + "/pets/{id}": { + get: { + description: + "Returns a user based on a single ID, if the user does not have access to the pet", + operationId: "find pet by id", + parameters: [ + { + name: "id", + in: "path", + description: "ID of pet to fetch", + required: true, + schema: { + type: "integer", + format: "int64", + }, + }, + ], + responses: { + "200": { + description: "pet response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + }, + default: { + description: "unexpected error", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Error", + }, + }, + }, + }, + }, + }, + delete: { + description: "deletes a single pet based on the ID supplied", + operationId: "deletePet", + parameters: [ + { + name: "id", + in: "path", + description: "ID of pet to delete", + required: true, + schema: { + type: "integer", + format: "int64", + }, + }, + ], + responses: { + "204": { + description: "pet deleted", + }, + default: { + description: "unexpected error", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Error", + }, + }, + }, + }, + }, + }, + }, + }, + components: { + schemas: { + Pet: { + allOf: [ + { + $ref: "#/components/schemas/NewPet", + }, + { + type: "object", + required: ["id"], + properties: { + id: { + type: "integer", + format: "int64", + }, + }, + }, + ], + }, + NewPet: { + type: "object", + required: ["name"], + properties: { + name: { + type: "string", + }, + tag: { + type: "string", + }, + }, + }, + Error: { + type: "object", + required: ["code", "message"], + properties: { + code: { + type: "integer", + format: "int32", + }, + message: { + type: "string", + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/examples/tictactoe-3-1.ts b/packages/types/tests/examples/tictactoe-3-1.ts new file mode 100644 index 0000000..3429dfb --- /dev/null +++ b/packages/types/tests/examples/tictactoe-3-1.ts @@ -0,0 +1,269 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/learn.openapis.org/tree/main/examples/tictactoe-3.1.json +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "Tic Tac Toe", + description: + "This API allows writing down marks on a Tic Tac Toe board\nand requesting the state of the board or of individual squares.\n", + version: "1.0.0", + }, + tags: [ + { + name: "Gameplay", + }, + ], + paths: { + "/board": { + get: { + summary: "Get the whole board", + description: "Retrieves the current state of the board and the winner.", + tags: ["Gameplay"], + operationId: "get-board", + responses: { + "200": { + description: "OK", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/status", + }, + }, + }, + }, + }, + security: [ + { + defaultApiKey: [], + }, + { + app2AppOauth: ["board:read"], + }, + ], + }, + }, + "/board/{row}/{column}": { + parameters: [ + { + $ref: "#/components/parameters/rowParam", + }, + { + $ref: "#/components/parameters/columnParam", + }, + ], + get: { + summary: "Get a single board square", + description: "Retrieves the requested square.", + tags: ["Gameplay"], + operationId: "get-square", + responses: { + "200": { + description: "OK", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/mark", + }, + }, + }, + }, + "400": { + description: "The provided parameters are incorrect", + content: { + "text/html": { + schema: { + $ref: "#/components/schemas/errorMessage", + }, + example: "Illegal coordinates", + }, + }, + }, + }, + security: [ + { + bearerHttpAuthentication: [], + }, + { + user2AppOauth: ["board:read"], + }, + ], + }, + put: { + summary: "Set a single board square", + description: + "Places a mark on the board and retrieves the whole board and the winner (if any).", + tags: ["Gameplay"], + operationId: "put-square", + requestBody: { + required: true, + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/mark", + }, + }, + }, + }, + responses: { + "200": { + description: "OK", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/status", + }, + }, + }, + }, + "400": { + description: "The provided parameters are incorrect", + content: { + "text/html": { + schema: { + $ref: "#/components/schemas/errorMessage", + }, + examples: { + illegalCoordinates: { + value: "Illegal coordinates.", + }, + notEmpty: { + value: "Square is not empty.", + }, + invalidMark: { + value: "Invalid Mark (X or O).", + }, + }, + }, + }, + }, + }, + security: [ + { + bearerHttpAuthentication: [], + }, + { + user2AppOauth: ["board:write"], + }, + ], + }, + }, + }, + components: { + parameters: { + rowParam: { + description: "Board row (vertical coordinate)", + name: "row", + in: "path", + required: true, + schema: { + $ref: "#/components/schemas/coordinate", + }, + }, + columnParam: { + description: "Board column (horizontal coordinate)", + name: "column", + in: "path", + required: true, + schema: { + $ref: "#/components/schemas/coordinate", + }, + }, + }, + schemas: { + errorMessage: { + type: "string", + maxLength: 256, + description: "A text message describing an error", + }, + coordinate: { + type: "integer", + minimum: 1, + maximum: 3, + example: 1, + }, + mark: { + type: "string", + enum: [".", "X", "O"], + description: + "Possible values for a board square. `.` means empty square.", + example: ".", + }, + board: { + type: "array", + maxItems: 3, + minItems: 3, + items: { + type: "array", + maxItems: 3, + minItems: 3, + items: { + $ref: "#/components/schemas/mark", + }, + }, + }, + winner: { + type: "string", + enum: [".", "X", "O"], + description: "Winner of the game. `.` means nobody has won yet.", + example: ".", + }, + status: { + type: "object", + properties: { + winner: { + $ref: "#/components/schemas/winner", + }, + board: { + $ref: "#/components/schemas/board", + }, + }, + }, + }, + securitySchemes: { + defaultApiKey: { + description: "API key provided in console", + type: "apiKey", + name: "api-key", + in: "header", + }, + basicHttpAuthentication: { + description: "Basic HTTP Authentication", + type: "http", + scheme: "Basic", + }, + bearerHttpAuthentication: { + description: "Bearer token using a JWT", + type: "http", + scheme: "Bearer", + bearerFormat: "JWT", + }, + app2AppOauth: { + type: "oauth2", + flows: { + clientCredentials: { + tokenUrl: "https://learn.openapis.org/oauth/2.0/token", + scopes: { + "board:read": "Read the board", + }, + }, + }, + }, + user2AppOauth: { + type: "oauth2", + flows: { + authorizationCode: { + authorizationUrl: "https://learn.openapis.org/oauth/2.0/auth", + tokenUrl: "https://learn.openapis.org/oauth/2.0/token", + scopes: { + "board:read": "Read the board", + "board:write": "Write to the board", + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/examples/uspto-3-0.ts b/packages/types/tests/examples/uspto-3-0.ts new file mode 100644 index 0000000..ad96a24 --- /dev/null +++ b/packages/types/tests/examples/uspto-3-0.ts @@ -0,0 +1,260 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/learn.openapis.org/tree/main/examples/uspto-3.0.json +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.0"; + +export const doc = { + openapi: "3.0.1", + servers: [ + { + url: "{scheme}://developer.uspto.gov/ds-api", + variables: { + scheme: { + description: "The Data Set API is accessible via https and http", + enum: ["https", "http"], + default: "https", + }, + }, + }, + ], + info: { + description: + "The Data Set API (DSAPI) allows the public users to discover and search USPTO exported data sets. This is a generic API that allows USPTO users to make any CSV based data files searchable through API. With the help of GET call, it returns the list of data fields that are searchable. With the help of POST call, data can be fetched based on the filters on the field names. Please note that POST call is used to search the actual data. The reason for the POST call is that it allows users to specify any complex search criteria without worry about the GET size limitations as well as encoding of the input parameters.", + version: "1.0.0", + title: "USPTO Data Set API", + contact: { + name: "Open Data Portal", + url: "https://developer.uspto.gov", + email: "developer@uspto.gov", + }, + }, + tags: [ + { + name: "metadata", + description: "Find out about the data sets", + }, + { + name: "search", + description: "Search a data set", + }, + ], + paths: { + "/": { + get: { + tags: ["metadata"], + operationId: "list-data-sets", + summary: "List available data sets", + responses: { + "200": { + description: "Returns a list of data sets", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/dataSetList", + }, + example: { + total: 2, + apis: [ + { + apiKey: "oa_citations", + apiVersionNumber: "v1", + apiUrl: + "https://developer.uspto.gov/ds-api/oa_citations/v1/fields", + apiDocumentationUrl: + "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/oa_citations.json", + }, + { + apiKey: "cancer_moonshot", + apiVersionNumber: "v1", + apiUrl: + "https://developer.uspto.gov/ds-api/cancer_moonshot/v1/fields", + apiDocumentationUrl: + "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/cancer_moonshot.json", + }, + ], + }, + }, + }, + }, + }, + }, + }, + "/{dataset}/{version}/fields": { + get: { + tags: ["metadata"], + summary: + "Provides the general information about the API and the list of fields that can be used to query the dataset.", + description: + "This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below.", + operationId: "list-searchable-fields", + parameters: [ + { + name: "dataset", + in: "path", + description: "Name of the dataset.", + required: true, + example: "oa_citations", + schema: { + type: "string", + }, + }, + { + name: "version", + in: "path", + description: "Version of the dataset.", + required: true, + example: "v1", + schema: { + type: "string", + }, + }, + ], + responses: { + "200": { + description: + "The dataset API for the given version is found and it is accessible to consume.", + content: { + "application/json": { + schema: { + type: "string", + }, + }, + }, + }, + "404": { + description: + "The combination of dataset name and version is not found in the system or it is not published yet to be consumed by public.", + content: { + "application/json": { + schema: { + type: "string", + }, + }, + }, + }, + }, + }, + }, + "/{dataset}/{version}/records": { + post: { + tags: ["search"], + summary: + "Provides search capability for the data set with the given search criteria.", + description: + "This API is based on Solr/Lucene Search. The data is indexed using SOLR. This GET API returns the list of all the searchable field names that are in the Solr Index. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the Solr/Lucene Syntax. Please refer https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for the query syntax. List of field names that are searchable can be determined using above GET api.", + operationId: "perform-search", + parameters: [ + { + name: "version", + in: "path", + description: "Version of the dataset.", + required: true, + schema: { + type: "string", + default: "v1", + }, + }, + { + name: "dataset", + in: "path", + description: + "Name of the dataset. In this case, the default value is oa_citations", + required: true, + schema: { + type: "string", + default: "oa_citations", + }, + }, + ], + responses: { + "200": { + description: "successful operation", + content: { + "application/json": { + schema: { + type: "array", + items: { + type: "object", + additionalProperties: { + type: "object", + }, + }, + }, + }, + }, + }, + "404": { + description: "No matching record found for the given criteria.", + }, + }, + requestBody: { + content: { + "application/x-www-form-urlencoded": { + schema: { + type: "object", + properties: { + criteria: { + description: + "Uses Lucene Query Syntax in the format of propertyName:value, propertyName:[num1 TO num2] and date range format: propertyName:[yyyyMMdd TO yyyyMMdd]. In the response please see the 'docs' element which has the list of record objects. Each record structure would consist of all the fields and their corresponding values.", + type: "string", + default: "*:*", + }, + start: { + description: "Starting record number. Default value is 0.", + type: "integer", + default: 0, + }, + rows: { + description: + "Specify number of rows to be returned. If you run the search with default values, in the response you will see 'numFound' attribute which will tell the number of records available in the dataset.", + type: "integer", + default: 100, + }, + }, + required: ["criteria"], + }, + }, + }, + }, + }, + }, + }, + components: { + schemas: { + dataSetList: { + type: "object", + properties: { + total: { + type: "integer", + }, + apis: { + type: "array", + items: { + type: "object", + properties: { + apiKey: { + type: "string", + description: "To be used as a dataset parameter value", + }, + apiVersionNumber: { + type: "string", + description: "To be used as a version parameter value", + }, + apiUrl: { + type: "string", + format: "uri-reference", + description: "The URL describing the dataset's fields", + }, + apiDocumentationUrl: { + type: "string", + format: "uri-reference", + description: "A URL to the API console for each API", + }, + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/examples/webhook-example-3-1.ts b/packages/types/tests/examples/webhook-example-3-1.ts new file mode 100644 index 0000000..481d05c --- /dev/null +++ b/packages/types/tests/examples/webhook-example-3-1.ts @@ -0,0 +1,54 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/learn.openapis.org/tree/main/examples/webhook-example-3.1.json +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "Webhook Example", + version: "1.0.0", + }, + webhooks: { + newPet: { + post: { + requestBody: { + description: "Information about a new pet in the system", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + }, + responses: { + "200": { + description: + "Return a 200 status to indicate that the data was received successfully", + }, + }, + }, + }, + }, + components: { + schemas: { + Pet: { + type: "object", + required: ["id", "name"], + properties: { + id: { + type: "integer", + format: "int64", + }, + name: { + type: "string", + }, + tag: { + type: "string", + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/callback-object-examples.ts b/packages/types/tests/schema-tests-3.1/callback-object-examples.ts new file mode 100644 index 0000000..a50b303 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/callback-object-examples.ts @@ -0,0 +1,62 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/callback-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + callbacks: { + myCallback: { + "{$request.query.queryUrl}": { + post: { + requestBody: { + description: "Callback payload", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SomePayload", + }, + }, + }, + }, + responses: { + "200": { + description: "callback successfully processed", + }, + }, + }, + }, + }, + transactionCallback: { + "http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}": + { + post: { + requestBody: { + description: "Callback payload", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SomePayload", + }, + }, + }, + }, + responses: { + "200": { + description: "callback successfully processed", + }, + }, + }, + }, + }, + }, + schemas: { + SomePayload: {}, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/comp-pathitems.ts b/packages/types/tests/schema-tests-3.1/comp-pathitems.ts new file mode 100644 index 0000000..0b753c5 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/comp-pathitems.ts @@ -0,0 +1,15 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/comp_pathitems.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + pathItems: {}, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/components-object-example.ts b/packages/types/tests/schema-tests-3.1/components-object-example.ts new file mode 100644 index 0000000..f826b93 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/components-object-example.ts @@ -0,0 +1,111 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/components-object-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + schemas: { + GeneralError: { + type: "object", + properties: { + code: { + type: "integer", + format: "int32", + }, + message: { + type: "string", + }, + }, + }, + Category: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64", + }, + name: { + type: "string", + }, + }, + }, + Tag: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64", + }, + name: { + type: "string", + }, + }, + }, + }, + parameters: { + skipParam: { + name: "skip", + in: "query", + description: "number of items to skip", + required: true, + schema: { + type: "integer", + format: "int32", + }, + }, + limitParam: { + name: "limit", + in: "query", + description: "max records to return", + required: true, + schema: { + type: "integer", + format: "int32", + }, + }, + }, + responses: { + NotFound: { + description: "Entity not found.", + }, + IllegalInput: { + description: "Illegal input for operation.", + }, + GeneralError: { + description: "General Error", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/GeneralError", + }, + }, + }, + }, + }, + securitySchemes: { + api_key: { + type: "apiKey", + name: "api-key", + in: "header", + }, + petstore_auth: { + type: "oauth2", + flows: { + implicit: { + authorizationUrl: "https://example.org/api/oauth/dialog", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets", + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/example-object-examples.ts b/packages/types/tests/schema-tests-3.1/example-object-examples.ts new file mode 100644 index 0000000..f4549bb --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/example-object-examples.ts @@ -0,0 +1,117 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/example-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + examples: { + "zip-example": {}, + "confirmation-success": {}, + }, + schemas: { + SuccessResponse: {}, + Address: {}, + }, + requestBodies: { + "with-example": { + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Address", + }, + examples: { + foo: { + summary: "A foo example", + value: { + foo: "bar", + }, + }, + bar: { + summary: "A bar example", + value: { + bar: "baz", + }, + }, + }, + }, + "application/xml": { + examples: { + xmlExample: { + summary: "This is an example in XML", + externalValue: + "https://example.org/examples/address-example.xml", + }, + }, + }, + "text/plain": { + examples: { + textExample: { + summary: "This is a text example", + externalValue: "https://foo.bar/examples/address-example.txt", + }, + }, + }, + }, + }, + }, + parameters: { + "with-example": { + name: "zipCode", + in: "query", + schema: { + type: "string", + format: "zip-code", + }, + examples: { + "zip-example": { + $ref: "#/components/examples/zip-example", + }, + }, + }, + }, + responses: { + "200": { + description: "your car appointment has been booked", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SuccessResponse", + }, + examples: { + "confirmation-success": { + $ref: "#/components/examples/confirmation-success", + }, + }, + }, + "application/x-www-form-urlencoded": { + schema: { + type: "object", + properties: { + jsonValue: { + type: "string", + }, + }, + }, + encoding: { + jsonValue: { + contentType: "application/json", + }, + }, + examples: { + jsonFormValue: { + description: 'The JSON string "json" as a form value', + value: "jsonValue=%22json%22", + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/header-object-examples.ts b/packages/types/tests/schema-tests-3.1/header-object-examples.ts new file mode 100644 index 0000000..ade0210 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/header-object-examples.ts @@ -0,0 +1,44 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/header-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + headers: { + "X-Rate-Limit-Limit": { + description: "The number of allowed requests in the current period", + deprecated: false, + schema: { + type: "integer", + }, + }, + ETag: { + required: true, + content: { + "text/plain": { + schema: { + type: "string", + pattern: '^"', + }, + }, + }, + }, + Reference: { + $ref: "#/components/headers/ETag", + }, + Style: { + schema: { + type: "array", + }, + style: "simple", + explode: true, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/info-object-example.ts b/packages/types/tests/schema-tests-3.1/info-object-example.ts new file mode 100644 index 0000000..de2ae5a --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/info-object-example.ts @@ -0,0 +1,29 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/info-object-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "Example Pet Store App", + summary: "A pet store manager.", + description: "This is an example server for a pet store.", + termsOfService: "https://example.com/terms/", + contact: { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com", + }, + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html", + }, + version: "1.0.1", + }, + externalDocs: { + description: "Find more info here", + url: "https://example.com", + }, + components: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/info-summary.ts b/packages/types/tests/schema-tests-3.1/info-summary.ts new file mode 100644 index 0000000..3f665cf --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/info-summary.ts @@ -0,0 +1,14 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/info_summary.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + summary: "My lovely API", + version: "1.0.0", + }, + components: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/json-schema-dialect.ts b/packages/types/tests/schema-tests-3.1/json-schema-dialect.ts new file mode 100644 index 0000000..cf97374 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/json-schema-dialect.ts @@ -0,0 +1,28 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/json_schema_dialect.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + summary: "Testing jsonSchemaDialect", + title: "My API", + version: "1.0.0", + license: { + name: "Apache 2.0", + identifier: "Apache-2.0", + }, + }, + jsonSchemaDialect: + "https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS", + components: { + schemas: { + WithDollarSchema: { + $id: "locked-metaschema", + $schema: "https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS", + }, + }, + }, + paths: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/license-identifier.ts b/packages/types/tests/schema-tests-3.1/license-identifier.ts new file mode 100644 index 0000000..e5108ae --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/license-identifier.ts @@ -0,0 +1,18 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/license_identifier.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + summary: "My lovely API", + version: "1.0.0", + license: { + name: "Apache", + identifier: "Apache-2.0", + }, + }, + components: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/link-object-examples.ts b/packages/types/tests/schema-tests-3.1/link-object-examples.ts new file mode 100644 index 0000000..0e09af0 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/link-object-examples.ts @@ -0,0 +1,101 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/link-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/users/{id}": { + parameters: [ + { + name: "id", + in: "path", + required: true, + description: "the user identifier, as userId", + schema: { + type: "string", + }, + }, + ], + get: { + responses: { + "200": { + description: "the user being returned", + content: { + "application/json": { + schema: { + type: "object", + properties: { + uuid: { + type: "string", + format: "uuid", + }, + }, + }, + }, + }, + links: { + address: { + operationId: "getUserAddress", + parameters: { + userid: "$request.path.id", + }, + }, + address2: { + operationId: "getUserAddressByUUID", + parameters: { + userUuid: "$response.body#/uuid", + }, + }, + UserRepositories: { + operationRef: "#/paths/~12.0~1repositories~1%7Busername%7D/get", + parameters: { + username: "$response.body#/username", + }, + }, + UserRepositories2: { + operationRef: + "https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1%7Busername%7D/get", + parameters: { + username: "$response.body#/username", + }, + }, + withBody: { + operationId: "queryUserWithBody", + requestBody: { + userId: "$request.path.id", + }, + }, + }, + }, + }, + }, + }, + "/users/{userid}/address": { + parameters: [ + { + name: "userid", + in: "path", + required: true, + description: "the user identifier, as userId", + schema: { + type: "string", + }, + }, + ], + get: { + operationId: "getUserAddress", + responses: { + "200": { + description: "the user's address", + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/media-type-examples.ts b/packages/types/tests/schema-tests-3.1/media-type-examples.ts new file mode 100644 index 0000000..9e1285f --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/media-type-examples.ts @@ -0,0 +1,169 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/media-type-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + examples: { + "frog-example": {}, + }, + schemas: { + Address: {}, + Pet: {}, + }, + }, + paths: { + "/something": { + put: { + requestBody: { + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Pet", + }, + examples: { + cat: { + summary: "An example of a cat", + value: { + name: "Fluffy", + petType: "Cat", + color: "White", + gender: "male", + breed: "Persian", + }, + }, + dog: { + summary: "An example of a dog with a cat's name", + value: { + name: "Puma", + petType: "Dog", + color: "Black", + gender: "Female", + breed: "Mixed", + }, + }, + frog: { + $ref: "#/components/examples/frog-example", + }, + }, + }, + "application/xml": { + schema: { + type: "object", + properties: { + foo: { + type: "string", + xml: { + namespace: "https://example.com", + prefix: "example", + name: "Foo", + }, + }, + bar: { + type: "array", + items: { + type: "number", + }, + xml: { + wrapped: true, + }, + }, + attr: { + type: "string", + xml: { + attribute: true, + }, + }, + }, + }, + }, + "application/x-www-form-urlencoded": { + schema: { + type: "object", + properties: { + id: { + type: "string", + format: "uuid", + }, + address: { + type: "object", + properties: {}, + }, + icon: { + type: "string", + contentEncoding: "base64url", + }, + }, + }, + encoding: { + icon: { + contentType: "image/png, image/jpeg", + }, + }, + }, + "multipart/form-data": { + schema: { + type: "object", + properties: { + id: { + type: "string", + format: "uuid", + }, + addresses: { + description: "addresses in XML format", + type: "array", + items: { + $ref: "#/components/schemas/Address", + }, + }, + profileImage: { + type: "string", + format: "binary", + }, + forCoverage: { + type: "string", + }, + forCoverage2: { + type: "string", + }, + }, + }, + encoding: { + addresses: { + contentType: "application/xml; charset=utf-8", + }, + profileImage: { + contentType: "image/png, image/jpeg", + headers: { + "X-Rate-Limit-Limit": { + description: + "The number of allowed requests in the current period", + schema: { + type: "integer", + }, + }, + }, + }, + forCoverage: { + style: "form", + explode: false, + allowReserved: true, + }, + forCoverage2: { + style: "spaceDelimited", + explode: true, + }, + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/mega.ts b/packages/types/tests/schema-tests-3.1/mega.ts new file mode 100644 index 0000000..62b7d70 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/mega.ts @@ -0,0 +1,101 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/mega.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + summary: "My API's summary", + title: "My API", + version: "1.0.0", + license: { + name: "Apache 2.0", + identifier: "Apache-2.0", + }, + }, + paths: { + "/": { + get: { + parameters: [], + }, + }, + "/{pathTest}": {}, + }, + webhooks: { + myWebhook: { + $ref: "#/components/pathItems/myPathItem", + description: "Overriding description", + }, + }, + components: { + securitySchemes: { + mtls: { + type: "mutualTLS", + }, + }, + schemas: { + Foo: { + type: "object", + properties: { + type: { + const: "foo", + }, + }, + }, + }, + pathItems: { + myPathItem: { + post: { + requestBody: { + required: true, + content: { + "application/json": { + schema: { + externalDocs: { + description: "More docs!", + url: "https://example.com/elsewhere.html", + }, + type: "object", + properties: { + type: { + type: "string", + }, + int: { + type: "integer", + exclusiveMaximum: 100, + exclusiveMinimum: 0, + }, + none: { + type: "null", + }, + arr: { + type: "array", + $comment: "Array without items keyword", + }, + either: { + type: ["string", "null"], + }, + }, + discriminator: { + propertyName: "type", + mapping: { + foo: "Foo", + }, + "x-extension": true, + }, + anyOf: [ + { + $ref: "#/components/schemas/Foo", + }, + ], + myArbitraryKeyword: true, + }, + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/minimal-comp.ts b/packages/types/tests/schema-tests-3.1/minimal-comp.ts new file mode 100644 index 0000000..f977f1e --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/minimal-comp.ts @@ -0,0 +1,13 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/minimal_comp.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + components: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/minimal-hooks.ts b/packages/types/tests/schema-tests-3.1/minimal-hooks.ts new file mode 100644 index 0000000..1ef2a62 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/minimal-hooks.ts @@ -0,0 +1,13 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/minimal_hooks.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + webhooks: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/minimal-paths.ts b/packages/types/tests/schema-tests-3.1/minimal-paths.ts new file mode 100644 index 0000000..8c97109 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/minimal-paths.ts @@ -0,0 +1,13 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/minimal_paths.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/non-oauth-scopes.ts b/packages/types/tests/schema-tests-3.1/non-oauth-scopes.ts new file mode 100644 index 0000000..9f960bd --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/non-oauth-scopes.ts @@ -0,0 +1,34 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/non-oauth-scopes.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "Non-oAuth Scopes example", + version: "1.0.0", + }, + paths: { + "/users": { + get: { + security: [ + { + bearerAuth: ["read:users", "public"], + }, + ], + }, + }, + }, + components: { + securitySchemes: { + bearerAuth: { + type: "http", + scheme: "bearer", + bearerFormat: "jwt", + description: + "note: non-oauth scopes are not defined at the securityScheme level", + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/operation-object-example.ts b/packages/types/tests/schema-tests-3.1/operation-object-example.ts new file mode 100644 index 0000000..15fb000 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/operation-object-example.ts @@ -0,0 +1,73 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/operation-object-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/pets/{id}": { + put: { + tags: ["pet"], + summary: "Updates a pet in the store with form data", + operationId: "updatePetWithForm", + parameters: [ + { + name: "petId", + in: "path", + description: "ID of pet that needs to be updated", + required: true, + schema: { + type: "string", + }, + }, + ], + requestBody: { + content: { + "application/x-www-form-urlencoded": { + schema: { + type: "object", + properties: { + name: { + description: "Updated name of the pet", + type: "string", + }, + status: { + description: "Updated status of the pet", + type: "string", + }, + }, + required: ["status"], + }, + }, + }, + }, + responses: { + "200": { + description: "Pet updated.", + content: { + "application/json": {}, + "application/xml": {}, + }, + }, + "405": { + description: "Method Not Allowed", + content: { + "application/json": {}, + "application/xml": {}, + }, + }, + }, + security: [ + { + petstore_auth: ["write:pets", "read:pets"], + }, + ], + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/parameter-object-examples.ts b/packages/types/tests/schema-tests-3.1/parameter-object-examples.ts new file mode 100644 index 0000000..bf3a1c1 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/parameter-object-examples.ts @@ -0,0 +1,95 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/parameter-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/user/{username}": { + parameters: [ + { + name: "token", + in: "header", + description: "token to be passed as a header", + required: true, + explode: false, + schema: { + type: "array", + items: { + type: "integer", + format: "int64", + }, + }, + style: "simple", + }, + { + name: "usernames", + in: "path", + description: "usernames to fetch", + required: true, + explode: false, + schema: { + type: "array", + }, + }, + { + name: "id", + in: "query", + description: "IDs of the object to fetch", + required: false, + schema: { + type: "array", + items: { + type: "string", + }, + }, + style: "form", + explode: true, + }, + { + in: "query", + name: "freeForm", + schema: { + type: "object", + additionalProperties: { + type: "integer", + }, + }, + style: "form", + }, + { + in: "query", + name: "coordinates", + content: { + "application/json": { + schema: { + type: "object", + required: ["lat", "long"], + properties: { + lat: { + type: "number", + }, + long: { + type: "number", + }, + }, + }, + }, + }, + }, + { + in: "cookie", + name: "my_cookie1", + style: "form", + explode: false, + schema: {}, + }, + ], + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/parameter-object-query-allow-reserved.ts b/packages/types/tests/schema-tests-3.1/parameter-object-query-allow-reserved.ts new file mode 100644 index 0000000..6a299d0 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/parameter-object-query-allow-reserved.ts @@ -0,0 +1,22 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/parameter-object-query-allowReserved.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "allowReserved only permitted with in: query", + version: "1.0.0", + }, + components: { + parameters: { + my_query: { + name: "my_query", + in: "query", + allowReserved: true, + schema: {}, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/path-item-object-example.ts b/packages/types/tests/schema-tests-3.1/path-item-object-example.ts new file mode 100644 index 0000000..935e974 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/path-item-object-example.ts @@ -0,0 +1,67 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/path-item-object-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + schemas: { + Pet: {}, + ErrorModel: {}, + }, + }, + paths: { + "/pets/{id}": { + get: { + description: "Returns pets based on ID", + summary: "Find pets by ID", + operationId: "getPetsById", + responses: { + "200": { + description: "pet response", + content: { + "*/*": { + schema: { + type: "array", + items: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + }, + }, + default: { + description: "error payload", + content: { + "text/html": { + schema: { + $ref: "#/components/schemas/ErrorModel", + }, + }, + }, + }, + }, + }, + parameters: [ + { + name: "id", + in: "path", + description: "ID of pet to use", + required: true, + schema: { + type: "array", + items: { + type: "string", + }, + }, + style: "simple", + }, + ], + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/path-item-servers-parameters.ts b/packages/types/tests/schema-tests-3.1/path-item-servers-parameters.ts new file mode 100644 index 0000000..f9acb78 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/path-item-servers-parameters.ts @@ -0,0 +1,188 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/path_item_servers_parameters.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/things": { + summary: "Lots of things", + servers: [ + { + url: "https://things.example.com", + }, + ], + get: { + summary: "Get a list of things", + externalDocs: { + description: "Find more info here", + url: "https://example.com", + }, + parameters: [ + { + $ref: "#/components/parameters/biscuit", + summary: "The maximum number of things to return", + description: "The maximum number of things to return", + }, + ], + responses: { + default: { + description: "A list of things", + }, + }, + servers: [ + { + url: "https://things.example.com", + }, + ], + }, + post: { + deprecated: false, + requestBody: { + $ref: "#/components/requestBodies/ThingRequestBody", + }, + responses: { + "201": { + $ref: "#/components/responses/ThingResponse", + }, + }, + callbacks: { + myCallback: { + "{$request.query.queryUrl}": { + post: { + requestBody: { + description: "Callback payload", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SomePayload", + }, + }, + }, + }, + responses: { + "200": { + description: "callback successfully processed", + }, + }, + }, + }, + }, + transactionCallback: { + $ref: "#/components/callbacks/transactionCallback", + }, + }, + }, + patch: {}, + delete: {}, + head: {}, + options: {}, + trace: {}, + }, + }, + components: { + callbacks: { + transactionCallback: { + "http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}": + { + post: { + requestBody: { + description: "Callback payload", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SomePayload", + }, + }, + }, + }, + responses: { + "200": { + description: "callback successfully processed", + }, + }, + }, + }, + }, + }, + examples: { + ThingExample: { + summary: "A thing", + description: "A thing", + value: { + id: 1, + name: "Thing", + }, + }, + }, + links: { + ThingLink: { + description: "A link to a thing", + operationId: "getThing", + parameters: { + thingId: "$response.body#/id", + }, + server: { + url: "https://things.example.com", + }, + }, + ThingyLink: { + $ref: "#/components/links/ThingLink", + }, + }, + parameters: { + limit: { + name: "limit", + in: "query", + required: false, + allowEmptyValue: false, + allowReserved: false, + deprecated: true, + description: "The maximum number of list items to return", + schema: { + type: "integer", + minimum: 0, + }, + }, + biscuit: { + name: "biscuit", + in: "cookie", + style: "form", + schema: { + type: "string", + }, + }, + }, + requestBodies: { + ThingRequestBody: { + content: { + "application/json": { + schema: { + type: "object", + }, + }, + }, + }, + }, + responses: { + ThingResponse: { + description: "A thing", + content: { + "application/json": { + schema: { + type: "object", + }, + }, + }, + }, + }, + schemas: { + SomePayload: {}, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/path-no-response.ts b/packages/types/tests/schema-tests-3.1/path-no-response.ts new file mode 100644 index 0000000..7a28436 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/path-no-response.ts @@ -0,0 +1,17 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/path_no_response.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/": { + get: {}, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/path-var-empty-pathitem.ts b/packages/types/tests/schema-tests-3.1/path-var-empty-pathitem.ts new file mode 100644 index 0000000..9c3b6ff --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/path-var-empty-pathitem.ts @@ -0,0 +1,15 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/path_var_empty_pathitem.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/{var}": {}, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/paths-object-example.ts b/packages/types/tests/schema-tests-3.1/paths-object-example.ts new file mode 100644 index 0000000..53864c5 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/paths-object-example.ts @@ -0,0 +1,40 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/paths-object-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + schemas: { + pet: {}, + }, + }, + paths: { + "/pets": { + get: { + description: + "Returns all pets from the system that the user has access to", + responses: { + "200": { + description: "A list of pets.", + content: { + "application/json": { + schema: { + type: "array", + items: { + $ref: "#/components/schemas/pet", + }, + }, + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/request-body-examples.ts b/packages/types/tests/schema-tests-3.1/request-body-examples.ts new file mode 100644 index 0000000..6c89808 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/request-body-examples.ts @@ -0,0 +1,67 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/request-body-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + schemas: { + User: {}, + }, + }, + paths: { + "/something": { + put: { + requestBody: { + description: "user to add to the system", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/User", + }, + examples: { + user: { + summary: "User example", + externalValue: "https://foo.bar/examples/user-example.json", + }, + }, + }, + "application/xml": { + schema: { + $ref: "#/components/schemas/User", + }, + examples: { + user: { + summary: "User example in XML", + externalValue: "https://foo.bar/examples/user-example.xml", + }, + }, + }, + "text/plain": { + examples: { + user: { + summary: "User example in plain text", + externalValue: "https://foo.bar/examples/user-example.txt", + }, + }, + }, + "*/*": { + examples: { + user: { + summary: "User example in other format", + externalValue: + "https://foo.bar/examples/user-example.whatever", + }, + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/response-object-examples.ts b/packages/types/tests/schema-tests-3.1/response-object-examples.ts new file mode 100644 index 0000000..2102a8f --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/response-object-examples.ts @@ -0,0 +1,77 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/response-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + responses: { + "complex-object-array": { + description: "A complex object array response", + content: { + "application/json": { + schema: { + type: "array", + items: { + $ref: "#/components/schemas/VeryComplexType", + }, + }, + }, + }, + }, + "simple-string": { + description: "A simple string response", + content: { + "text/plain": { + schema: { + type: "string", + }, + }, + }, + }, + "plain-text-with-headers": { + description: "A simple string response", + content: { + "text/plain": { + schema: { + type: "string", + }, + example: "whoa!", + }, + }, + headers: { + "X-Rate-Limit-Limit": { + description: "The number of allowed requests in the current period", + schema: { + type: "integer", + }, + }, + "X-Rate-Limit-Remaining": { + description: + "The number of remaining requests in the current period", + schema: { + type: "integer", + }, + }, + "X-Rate-Limit-Reset": { + description: "The number of seconds left in the current period", + schema: { + type: "integer", + }, + }, + }, + }, + "no-return-value": { + description: "object created", + }, + }, + schemas: { + VeryComplexType: {}, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/schema-object-deprecated-example-keyword.ts b/packages/types/tests/schema-tests-3.1/schema-object-deprecated-example-keyword.ts new file mode 100644 index 0000000..5e751d7 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/schema-object-deprecated-example-keyword.ts @@ -0,0 +1,29 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/schema-object-deprecated-example-keyword.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/user": { + parameters: [ + { + in: "query", + name: "example", + schema: { + type: "object", + example: { + numbers: [1, 2], + flag: null, + }, + }, + }, + ], + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/schema.ts b/packages/types/tests/schema-tests-3.1/schema.ts new file mode 100644 index 0000000..07e655d --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/schema.ts @@ -0,0 +1,70 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/schema.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: {}, + components: { + schemas: { + model: { + type: "object", + properties: { + one: { + description: "type array", + type: ["integer", "string"], + }, + two: { + description: "type 'null'", + type: "null", + }, + three: { + description: "type array including 'null'", + type: ["string", "null"], + }, + four: { + description: "array with no items", + type: "array", + }, + five: { + description: "singular example", + type: "string", + examples: ["exampleValue"], + }, + six: { + description: "exclusiveMinimum true", + exclusiveMinimum: 10, + }, + seven: { + description: "exclusiveMinimum false", + minimum: 10, + }, + eight: { + description: "exclusiveMaximum true", + exclusiveMaximum: 20, + }, + nine: { + description: "exclusiveMaximum false", + maximum: 20, + }, + ten: { + description: "nullable string", + type: ["string", "null"], + }, + eleven: { + description: "x-nullable string", + type: ["string", "null"], + }, + twelve: { + description: "file/binary", + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/security-scheme-object-examples.ts b/packages/types/tests/schema-tests-3.1/security-scheme-object-examples.ts new file mode 100644 index 0000000..a847984 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/security-scheme-object-examples.ts @@ -0,0 +1,94 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/security-scheme-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + security: [ + { + basic: [], + }, + { + apiKey: [], + }, + { + "JWT-bearer": [], + }, + { + mutualTLS: [], + }, + { + OAuth2: ["write:pets", "read:pets"], + }, + ], + components: { + securitySchemes: { + basic: { + type: "http", + scheme: "basic", + }, + apiKey: { + type: "apiKey", + name: "api-key", + in: "header", + }, + "JWT-bearer": { + type: "http", + scheme: "bearer", + bearerFormat: "JWT", + }, + mutualTLS: { + type: "mutualTLS", + description: "Cert must be signed by example.com CA", + }, + OAuth2: { + type: "oauth2", + flows: { + implicit: { + authorizationUrl: "https://example.com/api/oauth/dialog", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets", + }, + refreshUrl: "https://example.com/api/oauth/refresh", + }, + authorizationCode: { + authorizationUrl: "https://example.com/api/oauth/dialog", + refreshUrl: "https://example.com/api/oauth/refresh", + tokenUrl: "https://example.com/api/oauth/token", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets", + }, + }, + password: { + tokenUrl: "https://example.com/api/oauth/token", + scopes: { + "read:pets": "read your pets", + }, + refreshUrl: "https://example.com/api/oauth/refresh", + }, + clientCredentials: { + tokenUrl: "https://example.com/api/oauth/token", + scopes: { + "read:pets": "read your pets", + }, + refreshUrl: "https://example.com/api/oauth/refresh", + }, + }, + }, + OpenIdConnect: { + type: "openIdConnect", + openIdConnectUrl: "https://example.com/api/oauth/openid", + }, + external: { + $ref: "https://example.com/api/openapi.json#/components/externalDocs/ThingExternalDocs", + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/servers.ts b/packages/types/tests/schema-tests-3.1/servers.ts new file mode 100644 index 0000000..8c5fad4 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/servers.ts @@ -0,0 +1,41 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/servers.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: {}, + servers: [ + { + url: "/v1", + description: "Run locally.", + }, + { + url: "https://production.com/v1", + description: "Run on production server.", + }, + { + url: "https://{username}.gigantic-server.com:{port}/{basePath}", + description: "The production API server", + variables: { + username: { + default: "demo", + description: + "A user-specific subdomain. Use `demo` for a free sandbox environment.", + }, + port: { + enum: ["8443", "443"], + default: "8443", + }, + basePath: { + default: "v2", + }, + }, + }, + ], +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/specification-extensions.ts b/packages/types/tests/schema-tests-3.1/specification-extensions.ts new file mode 100644 index 0000000..35adee3 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/specification-extensions.ts @@ -0,0 +1,14 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/specification-extensions.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: {}, + "x-tensions": "specification extensions are prefixed with `x-`", +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/style-defaults.ts b/packages/types/tests/schema-tests-3.1/style-defaults.ts new file mode 100644 index 0000000..0d33729 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/style-defaults.ts @@ -0,0 +1,154 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/style-defaults.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: + "various permutations of parameter objects, with non-required values left to their defaults", + version: "1.0.0", + }, + components: { + parameters: { + encoding_object_defaults: { + name: "encoding_object_defaults", + in: "path", + content: { + encoding_object_defaults: { + encoding: { + no_styles: { + "x-comment": + "style, explode and allowReserved are not present, so contentType is used; no defaults expected as default contentType cannot be determined by the schema", + }, + style_form: { + "x-comment": + "expecting defaults: explode=true, allowReserved=false", + style: "form", + }, + style_spaceDelimited: { + "x-comment": + "expecting defaults: explode=false, allowReserved=false", + style: "spaceDelimited", + }, + explode: { + "x-comment": + "expecting defaults: style=form, allowReserved=false", + explode: false, + }, + allowReserved: { + "x-comment": "expecting default: style=form, explode=true", + allowReserved: true, + }, + }, + }, + }, + }, + path_media_type: { + "x-comment": "expecting defaults: deprecated=false", + name: "path_media-type", + in: "path", + required: true, + content: { + "text/*": { + schema: {}, + }, + }, + }, + path_simple: { + "x-comment": + "expecting defaults: deprecated=false, style=simple, explode=false, allowReserved=false", + name: "path_simple", + in: "path", + required: true, + schema: {}, + }, + path_matrix: { + "x-comment": + "expecting defaults: deprecated=false, explode=false, allowReserved=false", + name: "path_matrix", + in: "path", + required: true, + style: "matrix", + schema: {}, + }, + path_label: { + "x-comment": + "expecting defaults: deprecated=false, explode=false, allowReserved=false", + name: "path_label", + in: "path", + required: true, + style: "label", + schema: {}, + }, + query_media_type: { + "x-comment": + "expecting defaults: required=false, deprecated=false, allowEmptyValue=false", + name: "query_media_type", + in: "query", + content: { + "text/*": { + schema: {}, + }, + }, + }, + query_form: { + "x-comment": + "expecting defaults: required=false, deprecated=false, allowEmptyValue=false, style=form, explode=true, allowReserved=false", + name: "query_form", + in: "query", + schema: {}, + }, + query_spaceDelimited: { + "x-comment": + "expecting defaults: required=false, deprecated=false, allowEmptyValue=false, explode=false, allowReserved=false", + name: "query_spaceDelimited", + in: "query", + style: "spaceDelimited", + schema: {}, + }, + query_pipeDelimited: { + "x-comment": + "expecting defaults: required=false, deprecated=false, allowEmptyValue=false, explode=false, allowReserved=false", + name: "query_pipeDelimited", + in: "query", + style: "pipeDelimited", + schema: {}, + }, + query_deepObject: { + "x-comment": + "expecting defaults: required=false, deprecated=false, allowEmptyValue=false, allowReserved=false", + name: "query_deepObject", + in: "query", + style: "deepObject", + schema: {}, + }, + header: { + "x-comment": + "expecting defaults: deprecated=false, style=simple, explode=false, allowReserved=false", + name: "header", + in: "path", + required: true, + schema: {}, + }, + cookie_media_type: { + "x-comment": "expecting defaults: required=false, deprecated=false", + name: "cookie_media_type", + in: "cookie", + content: { + "text/*": { + schema: {}, + }, + }, + }, + cookie_form: { + "x-comment": + "expecting defaults: required=false, deprecated=false, style=form, explode=true, allowReserved=false", + name: "cookie_form", + in: "cookie", + schema: {}, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/tag-object-example.ts b/packages/types/tests/schema-tests-3.1/tag-object-example.ts new file mode 100644 index 0000000..5016661 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/tag-object-example.ts @@ -0,0 +1,27 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/tag-object-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: {}, + tags: [ + { + name: "pet", + description: "Pets operations", + }, + { + name: "external", + description: "Operations available to external consumers", + externalDocs: { + description: "Find more info here", + url: "https://example.com", + }, + }, + ], +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/valid-schema-types.ts b/packages/types/tests/schema-tests-3.1/valid-schema-types.ts new file mode 100644 index 0000000..4063f1b --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/valid-schema-types.ts @@ -0,0 +1,22 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/valid_schema_types.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.1", + info: { + title: "API", + version: "1.0.0", + }, + components: { + schemas: { + anything_boolean: true, + nothing_boolean: false, + anything_object: {}, + nothing_object: { + not: {}, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.1/webhook-example.ts b/packages/types/tests/schema-tests-3.1/webhook-example.ts new file mode 100644 index 0000000..3818956 --- /dev/null +++ b/packages/types/tests/schema-tests-3.1/webhook-example.ts @@ -0,0 +1,53 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.1-dev/tests/schema/pass/webhook-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.1"; + +export const doc = { + openapi: "3.1.0", + info: { + title: "Webhook Example", + version: "1.0.0", + }, + webhooks: { + newPet: { + post: { + requestBody: { + description: "Information about a new pet in the system", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + }, + responses: { + "200": { + description: + "Return a 200 status to indicate that the data was received successfully", + }, + }, + }, + }, + }, + components: { + schemas: { + Pet: { + required: ["id", "name"], + properties: { + id: { + type: "integer", + format: "int64", + }, + name: { + type: "string", + }, + tag: { + type: "string", + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/callback-object-examples.ts b/packages/types/tests/schema-tests-3.2/callback-object-examples.ts new file mode 100644 index 0000000..4ad9f8a --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/callback-object-examples.ts @@ -0,0 +1,62 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/callback-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + callbacks: { + myCallback: { + "{$request.query.queryUrl}": { + post: { + requestBody: { + description: "Callback payload", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SomePayload", + }, + }, + }, + }, + responses: { + "200": { + description: "callback successfully processed", + }, + }, + }, + }, + }, + transactionCallback: { + "http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}": + { + post: { + requestBody: { + description: "Callback payload", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SomePayload", + }, + }, + }, + }, + responses: { + "200": { + description: "callback successfully processed", + }, + }, + }, + }, + }, + }, + schemas: { + SomePayload: {}, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/comp-pathitems.ts b/packages/types/tests/schema-tests-3.2/comp-pathitems.ts new file mode 100644 index 0000000..5d7cf8e --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/comp-pathitems.ts @@ -0,0 +1,15 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/comp_pathitems.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + pathItems: {}, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/components-object-example.ts b/packages/types/tests/schema-tests-3.2/components-object-example.ts new file mode 100644 index 0000000..eb773ca --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/components-object-example.ts @@ -0,0 +1,111 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/components-object-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + schemas: { + GeneralError: { + type: "object", + properties: { + code: { + type: "integer", + format: "int32", + }, + message: { + type: "string", + }, + }, + }, + Category: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64", + }, + name: { + type: "string", + }, + }, + }, + Tag: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64", + }, + name: { + type: "string", + }, + }, + }, + }, + parameters: { + skipParam: { + name: "skip", + in: "query", + description: "number of items to skip", + required: true, + schema: { + type: "integer", + format: "int32", + }, + }, + limitParam: { + name: "limit", + in: "query", + description: "max records to return", + required: true, + schema: { + type: "integer", + format: "int32", + }, + }, + }, + responses: { + NotFound: { + description: "Entity not found.", + }, + IllegalInput: { + description: "Illegal input for operation.", + }, + GeneralError: { + description: "General Error", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/GeneralError", + }, + }, + }, + }, + }, + securitySchemes: { + api_key: { + type: "apiKey", + name: "api-key", + in: "header", + }, + petstore_auth: { + type: "oauth2", + flows: { + implicit: { + authorizationUrl: "https://example.org/api/oauth/dialog", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets", + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/example-object-examples.ts b/packages/types/tests/schema-tests-3.2/example-object-examples.ts new file mode 100644 index 0000000..349b2b4 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/example-object-examples.ts @@ -0,0 +1,118 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/example-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + examples: { + "zip-example": {}, + "confirmation-success": {}, + }, + schemas: { + SuccessResponse: {}, + Address: {}, + }, + requestBodies: { + "with-example": { + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Address", + }, + examples: { + foo: { + summary: "A foo example", + value: { + foo: "bar", + }, + }, + bar: { + summary: "A bar example", + value: { + bar: "baz", + }, + }, + }, + }, + "application/xml": { + examples: { + xmlExample: { + summary: "This is an example in XML", + externalValue: + "https://example.org/examples/address-example.xml", + }, + }, + }, + "text/plain": { + examples: { + textExample: { + summary: "This is a text example", + externalValue: "https://foo.bar/examples/address-example.txt", + }, + }, + }, + }, + }, + }, + parameters: { + "with-example": { + name: "zipCode", + in: "query", + schema: { + type: "string", + format: "zip-code", + }, + examples: { + "zip-example": { + $ref: "#/components/examples/zip-example", + }, + }, + }, + }, + responses: { + "200": { + description: "your car appointment has been booked", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SuccessResponse", + }, + examples: { + "confirmation-success": { + $ref: "#/components/examples/confirmation-success", + }, + }, + }, + "application/x-www-form-urlencoded": { + schema: { + type: "object", + properties: { + jsonValue: { + type: "string", + }, + }, + }, + encoding: { + jsonValue: { + contentType: "application/json", + }, + }, + examples: { + jsonFormValue: { + description: 'The JSON string "json" as a form value', + dataValue: "json", + serializedValue: "jsonValue=%22json%22", + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/header-object-examples.ts b/packages/types/tests/schema-tests-3.2/header-object-examples.ts new file mode 100644 index 0000000..3754a7c --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/header-object-examples.ts @@ -0,0 +1,44 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/header-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + headers: { + "X-Rate-Limit-Limit": { + description: "The number of allowed requests in the current period", + deprecated: false, + schema: { + type: "integer", + }, + }, + ETag: { + required: true, + content: { + "text/plain": { + schema: { + type: "string", + pattern: '^"', + }, + }, + }, + }, + Reference: { + $ref: "#/components/headers/ETag", + }, + Style: { + schema: { + type: "array", + }, + style: "simple", + explode: true, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/info-object-example.ts b/packages/types/tests/schema-tests-3.2/info-object-example.ts new file mode 100644 index 0000000..96258dd --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/info-object-example.ts @@ -0,0 +1,30 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/info-object-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + $self: "https://example.com/openapi", + info: { + title: "Example Pet Store App", + summary: "A pet store manager.", + description: "This is an example server for a pet store.", + termsOfService: "https://example.com/terms/", + contact: { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com", + }, + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html", + }, + version: "1.0.1", + }, + externalDocs: { + description: "Find more info here", + url: "https://example.com", + }, + components: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/info-summary.ts b/packages/types/tests/schema-tests-3.2/info-summary.ts new file mode 100644 index 0000000..fb15a28 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/info-summary.ts @@ -0,0 +1,14 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/info_summary.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + summary: "My lovely API", + version: "1.0.0", + }, + components: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/json-schema-dialect.ts b/packages/types/tests/schema-tests-3.2/json-schema-dialect.ts new file mode 100644 index 0000000..e8a3156 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/json-schema-dialect.ts @@ -0,0 +1,28 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/json_schema_dialect.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + summary: "Testing jsonSchemaDialect", + title: "My API", + version: "1.0.0", + license: { + name: "Apache 2.0", + identifier: "Apache-2.0", + }, + }, + jsonSchemaDialect: + "https://spec.openapis.org/oas/3.2/dialect/WORK-IN-PROGRESS", + components: { + schemas: { + WithDollarSchema: { + $id: "locked-metaschema", + $schema: "https://spec.openapis.org/oas/3.2/dialect/WORK-IN-PROGRESS", + }, + }, + }, + paths: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/license-identifier.ts b/packages/types/tests/schema-tests-3.2/license-identifier.ts new file mode 100644 index 0000000..ea56da4 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/license-identifier.ts @@ -0,0 +1,18 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/license_identifier.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + summary: "My lovely API", + version: "1.0.0", + license: { + name: "Apache", + identifier: "Apache-2.0", + }, + }, + components: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/link-object-examples.ts b/packages/types/tests/schema-tests-3.2/link-object-examples.ts new file mode 100644 index 0000000..a979aa9 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/link-object-examples.ts @@ -0,0 +1,101 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/link-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/users/{id}": { + parameters: [ + { + name: "id", + in: "path", + required: true, + description: "the user identifier, as userId", + schema: { + type: "string", + }, + }, + ], + get: { + responses: { + "200": { + description: "the user being returned", + content: { + "application/json": { + schema: { + type: "object", + properties: { + uuid: { + type: "string", + format: "uuid", + }, + }, + }, + }, + }, + links: { + address: { + operationId: "getUserAddress", + parameters: { + userid: "$request.path.id", + }, + }, + address2: { + operationId: "getUserAddressByUUID", + parameters: { + userUuid: "$response.body#/uuid", + }, + }, + UserRepositories: { + operationRef: "#/paths/~12.0~1repositories~1%7Busername%7D/get", + parameters: { + username: "$response.body#/username", + }, + }, + UserRepositories2: { + operationRef: + "https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1%7Busername%7D/get", + parameters: { + username: "$response.body#/username", + }, + }, + withBody: { + operationId: "queryUserWithBody", + requestBody: { + userId: "$request.path.id", + }, + }, + }, + }, + }, + }, + }, + "/users/{userid}/address": { + parameters: [ + { + name: "userid", + in: "path", + required: true, + description: "the user identifier, as userId", + schema: { + type: "string", + }, + }, + ], + get: { + operationId: "getUserAddress", + responses: { + "200": { + description: "the user's address", + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/media-type-examples.ts b/packages/types/tests/schema-tests-3.2/media-type-examples.ts new file mode 100644 index 0000000..c02ac87 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/media-type-examples.ts @@ -0,0 +1,250 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/media-type-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + examples: { + "frog-example": {}, + }, + schemas: { + Address: {}, + Pet: {}, + }, + mediaTypes: { + StreamingPets: { + description: + "Streaming sequence of JSON pet representations,\nsuitable for use with any of the streaming JSON\nmedia types.\n", + itemSchema: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + }, + paths: { + "/something": { + put: { + requestBody: { + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Pet", + }, + examples: { + cat: { + summary: "An example of a cat", + value: { + name: "Fluffy", + petType: "Cat", + color: "White", + gender: "male", + breed: "Persian", + }, + }, + dog: { + summary: "An example of a dog with a cat's name", + value: { + name: "Puma", + petType: "Dog", + color: "Black", + gender: "Female", + breed: "Mixed", + }, + }, + frog: { + $ref: "#/components/examples/frog-example", + }, + }, + }, + "application/jsonl": { + $ref: "#/components/mediaTypes/StreamingPets", + }, + "application/x-ndjson": { + $ref: "#/components/mediaTypes/StreamingPets", + }, + "application/xml": { + schema: { + type: "object", + properties: { + foo: { + type: "string", + xml: { + namespace: "https://example.com", + prefix: "example", + name: "Foo", + }, + }, + bar: { + type: "array", + items: { + type: "number", + }, + xml: { + wrapped: true, + }, + }, + attr: { + type: "string", + xml: { + attribute: true, + }, + }, + elementNode: { + $ref: "#/components/schemas/Pet", + xml: { + nodeType: "element", + }, + }, + attributeNode: { + type: "string", + xml: { + nodeType: "attribute", + }, + }, + textNode: { + type: "string", + xml: { + nodeType: "text", + }, + }, + cdataNode: { + type: "string", + xml: { + nodeType: "cdata", + }, + }, + noneNode: { + type: "object", + xml: { + nodeType: "none", + }, + }, + }, + }, + }, + "application/x-www-form-urlencoded": { + schema: { + type: "object", + properties: { + id: { + type: "string", + format: "uuid", + }, + address: { + type: "object", + properties: {}, + }, + icon: { + type: "string", + contentEncoding: "base64url", + }, + }, + }, + encoding: { + icon: { + contentType: "image/png, image/jpeg", + }, + }, + }, + "multipart/form-data": { + schema: { + type: "object", + properties: { + id: { + type: "string", + format: "uuid", + }, + addresses: { + description: "addresses in XML format", + type: "array", + items: { + $ref: "#/components/schemas/Address", + }, + }, + profileImage: { + type: "string", + format: "binary", + }, + forCoverage: { + type: "string", + }, + forCoverage2: { + type: "string", + }, + nested1: { + type: "object", + }, + nested2: { + type: "array", + }, + }, + }, + encoding: { + addresses: { + contentType: "application/xml; charset=utf-8", + }, + profileImage: { + contentType: "image/png, image/jpeg", + headers: { + "X-Rate-Limit-Limit": { + description: + "The number of allowed requests in the current period", + schema: { + type: "integer", + }, + }, + }, + }, + forCoverage: { + style: "form", + explode: false, + allowReserved: true, + }, + forCoverage2: { + style: "spaceDelimited", + explode: true, + }, + nested1: { + contentType: "multipart/form-data", + encoding: { + inner: {}, + }, + }, + nested2: { + contentType: "multipart/mixed", + prefixEncoding: [{}], + itemEncoding: {}, + }, + }, + }, + "multipart/related": { + schema: { + type: "array", + }, + itemEncoding: { + contentType: "text/plain", + }, + prefixEncoding: [ + { + headers: { + "Content-Location": { + schema: { + type: "string", + }, + }, + }, + }, + ], + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/mega.ts b/packages/types/tests/schema-tests-3.2/mega.ts new file mode 100644 index 0000000..ab6bd82 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/mega.ts @@ -0,0 +1,102 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/mega.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + summary: "My API's summary", + title: "My API", + version: "1.0.0", + license: { + name: "Apache 2.0", + identifier: "Apache-2.0", + }, + }, + paths: { + "/": { + get: { + parameters: [], + }, + }, + "/{pathTest}": {}, + }, + webhooks: { + myWebhook: { + $ref: "#/components/pathItems/myPathItem", + description: "Overriding description", + }, + }, + components: { + securitySchemes: { + mtls: { + type: "mutualTLS", + }, + }, + schemas: { + Foo: { + type: "object", + properties: { + type: { + const: "foo", + }, + }, + }, + }, + pathItems: { + myPathItem: { + post: { + requestBody: { + required: true, + content: { + "application/json": { + schema: { + externalDocs: { + description: "More docs!", + url: "https://example.com/elsewhere.html", + }, + type: "object", + properties: { + type: { + type: "string", + }, + int: { + type: "integer", + exclusiveMaximum: 100, + exclusiveMinimum: 0, + }, + none: { + type: "null", + }, + arr: { + type: "array", + $comment: "Array without items keyword", + }, + either: { + type: ["string", "null"], + }, + }, + discriminator: { + propertyName: "type", + mapping: { + foo: "Foo", + }, + defaultMapping: "Bar", + "x-extension": true, + }, + anyOf: [ + { + $ref: "#/components/schemas/Foo", + }, + ], + myArbitraryKeyword: true, + }, + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/minimal-comp.ts b/packages/types/tests/schema-tests-3.2/minimal-comp.ts new file mode 100644 index 0000000..fd3cc65 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/minimal-comp.ts @@ -0,0 +1,13 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/minimal_comp.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + components: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/minimal-hooks.ts b/packages/types/tests/schema-tests-3.2/minimal-hooks.ts new file mode 100644 index 0000000..583d141 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/minimal-hooks.ts @@ -0,0 +1,13 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/minimal_hooks.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + webhooks: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/minimal-paths.ts b/packages/types/tests/schema-tests-3.2/minimal-paths.ts new file mode 100644 index 0000000..c9a0e04 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/minimal-paths.ts @@ -0,0 +1,13 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/minimal_paths.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: {}, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/non-oauth-scopes.ts b/packages/types/tests/schema-tests-3.2/non-oauth-scopes.ts new file mode 100644 index 0000000..7caa354 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/non-oauth-scopes.ts @@ -0,0 +1,34 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/non-oauth-scopes.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "Non-oAuth Scopes example", + version: "1.0.0", + }, + paths: { + "/users": { + get: { + security: [ + { + bearerAuth: ["read:users", "public"], + }, + ], + }, + }, + }, + components: { + securitySchemes: { + bearerAuth: { + type: "http", + scheme: "bearer", + bearerFormat: "jwt", + description: + "note: non-oauth scopes are not defined at the securityScheme level", + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/operation-object-example.ts b/packages/types/tests/schema-tests-3.2/operation-object-example.ts new file mode 100644 index 0000000..da23532 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/operation-object-example.ts @@ -0,0 +1,73 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/operation-object-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/pets/{id}": { + put: { + tags: ["pet"], + summary: "Updates a pet in the store with form data", + operationId: "updatePetWithForm", + parameters: [ + { + name: "petId", + in: "path", + description: "ID of pet that needs to be updated", + required: true, + schema: { + type: "string", + }, + }, + ], + requestBody: { + content: { + "application/x-www-form-urlencoded": { + schema: { + type: "object", + properties: { + name: { + description: "Updated name of the pet", + type: "string", + }, + status: { + description: "Updated status of the pet", + type: "string", + }, + }, + required: ["status"], + }, + }, + }, + }, + responses: { + "200": { + description: "Pet updated.", + content: { + "application/json": {}, + "application/xml": {}, + }, + }, + "405": { + description: "Method Not Allowed", + content: { + "application/json": {}, + "application/xml": {}, + }, + }, + }, + security: [ + { + petstore_auth: ["write:pets", "read:pets"], + }, + ], + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/parameter-object-cookie-form-allow-reserved.ts b/packages/types/tests/schema-tests-3.2/parameter-object-cookie-form-allow-reserved.ts new file mode 100644 index 0000000..d95e4bf --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/parameter-object-cookie-form-allow-reserved.ts @@ -0,0 +1,29 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/parameter-object-cookie-form-allowReserved.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: + "allowReserved only permitted with in and style values that percent-encode", + version: "1.0.0", + }, + components: { + parameters: { + style_form: { + name: "my_form_cookie", + in: "cookie", + allowReserved: true, + schema: {}, + }, + style_cookie: { + name: "my_cookie_cookie", + in: "cookie", + style: "cookie", + schema: {}, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/parameter-object-examples.ts b/packages/types/tests/schema-tests-3.2/parameter-object-examples.ts new file mode 100644 index 0000000..41b2f67 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/parameter-object-examples.ts @@ -0,0 +1,121 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/parameter-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/user/{username}": { + parameters: [ + { + name: "token", + in: "header", + description: "token to be passed as a header", + required: true, + explode: false, + schema: { + type: "array", + items: { + type: "integer", + format: "int64", + }, + }, + style: "simple", + }, + { + name: "usernames", + in: "path", + description: "usernames to fetch", + required: true, + explode: false, + schema: { + type: "array", + }, + }, + { + name: "id", + in: "query", + description: "IDs of the object to fetch", + required: false, + schema: { + type: "array", + items: { + type: "string", + }, + }, + style: "form", + explode: true, + }, + { + in: "query", + name: "freeForm", + schema: { + type: "object", + additionalProperties: { + type: "integer", + }, + }, + style: "form", + }, + { + in: "query", + name: "coordinates", + content: { + "application/json": { + schema: { + type: "object", + required: ["lat", "long"], + properties: { + lat: { + type: "number", + }, + long: { + type: "number", + }, + }, + }, + }, + }, + }, + { + in: "cookie", + name: "my_cookie1", + style: "form", + explode: false, + schema: {}, + }, + { + in: "cookie", + name: "my_cookie2", + style: "cookie", + explode: true, + schema: {}, + }, + ], + }, + "/user": { + parameters: [ + { + in: "querystring", + name: "json", + content: { + "application/json": { + schema: { + type: "object", + }, + example: { + numbers: [1, 2], + flag: null, + }, + }, + }, + }, + ], + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/parameter-object-path-allow-reserved.ts b/packages/types/tests/schema-tests-3.2/parameter-object-path-allow-reserved.ts new file mode 100644 index 0000000..ad75e4d --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/parameter-object-path-allow-reserved.ts @@ -0,0 +1,23 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/parameter-object-path-allowReserved.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "api", + version: "1.0.0", + }, + components: { + parameters: { + path: { + name: "my-path", + in: "path", + required: true, + allowReserved: false, + schema: {}, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/parameter-object-query-allow-reserved.ts b/packages/types/tests/schema-tests-3.2/parameter-object-query-allow-reserved.ts new file mode 100644 index 0000000..97517e7 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/parameter-object-query-allow-reserved.ts @@ -0,0 +1,23 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/parameter-object-query-allowReserved.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: + "allowReserved only permitted with in and style values that percent-encode", + version: "1.0.0", + }, + components: { + parameters: { + my_query: { + name: "my_query", + in: "query", + allowReserved: true, + schema: {}, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/path-item-object-example.ts b/packages/types/tests/schema-tests-3.2/path-item-object-example.ts new file mode 100644 index 0000000..5929de3 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/path-item-object-example.ts @@ -0,0 +1,129 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/path-item-object-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + schemas: { + Pet: {}, + ErrorModel: {}, + }, + }, + paths: { + "/pets/{id}": { + get: { + description: "Returns pets based on ID", + summary: "Find pets by ID", + operationId: "getPetsById", + responses: { + "200": { + description: "pet response", + content: { + "*/*": { + schema: { + type: "array", + items: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + }, + }, + default: { + description: "error payload", + content: { + "text/html": { + schema: { + $ref: "#/components/schemas/ErrorModel", + }, + }, + }, + }, + }, + }, + query: { + description: "Returns pets based on ID", + summary: "Find pets by ID", + operationId: "queryPetsById", + responses: { + "200": { + description: "pet response", + content: { + "*/*": { + schema: { + type: "array", + items: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + }, + }, + default: { + description: "error payload", + content: { + "text/html": { + schema: { + $ref: "#/components/schemas/ErrorModel", + }, + }, + }, + }, + }, + }, + parameters: [ + { + name: "id", + in: "path", + description: "ID of pet to use", + required: true, + schema: { + type: "array", + items: { + type: "string", + }, + }, + style: "simple", + }, + ], + additionalOperations: { + COPY: { + description: "Copies pet information based on ID", + summary: "Copies pets by ID", + operationId: "copyPetsById", + responses: { + "200": { + description: "pet response", + content: { + "*/*": { + schema: { + type: "array", + items: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + }, + }, + default: { + description: "error payload", + content: { + "text/html": { + schema: { + $ref: "#/components/schemas/ErrorModel", + }, + }, + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/path-item-servers-parameters.ts b/packages/types/tests/schema-tests-3.2/path-item-servers-parameters.ts new file mode 100644 index 0000000..949425f --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/path-item-servers-parameters.ts @@ -0,0 +1,188 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/path_item_servers_parameters.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/things": { + summary: "Lots of things", + servers: [ + { + url: "https://things.example.com", + }, + ], + get: { + summary: "Get a list of things", + externalDocs: { + description: "Find more info here", + url: "https://example.com", + }, + parameters: [ + { + $ref: "#/components/parameters/biscuit", + summary: "The maximum number of things to return", + description: "The maximum number of things to return", + }, + ], + responses: { + default: { + description: "A list of things", + }, + }, + servers: [ + { + url: "https://things.example.com", + }, + ], + }, + post: { + deprecated: false, + requestBody: { + $ref: "#/components/requestBodies/ThingRequestBody", + }, + responses: { + "201": { + $ref: "#/components/responses/ThingResponse", + }, + }, + callbacks: { + myCallback: { + "{$request.query.queryUrl}": { + post: { + requestBody: { + description: "Callback payload", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SomePayload", + }, + }, + }, + }, + responses: { + "200": { + description: "callback successfully processed", + }, + }, + }, + }, + }, + transactionCallback: { + $ref: "#/components/callbacks/transactionCallback", + }, + }, + }, + patch: {}, + delete: {}, + head: {}, + options: {}, + trace: {}, + }, + }, + components: { + callbacks: { + transactionCallback: { + "http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}": + { + post: { + requestBody: { + description: "Callback payload", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SomePayload", + }, + }, + }, + }, + responses: { + "200": { + description: "callback successfully processed", + }, + }, + }, + }, + }, + }, + examples: { + ThingExample: { + summary: "A thing", + description: "A thing", + value: { + id: 1, + name: "Thing", + }, + }, + }, + links: { + ThingLink: { + description: "A link to a thing", + operationId: "getThing", + parameters: { + thingId: "$response.body#/id", + }, + server: { + url: "https://things.example.com", + }, + }, + ThingyLink: { + $ref: "#/components/links/ThingLink", + }, + }, + parameters: { + limit: { + name: "limit", + in: "query", + required: false, + allowEmptyValue: false, + allowReserved: false, + deprecated: true, + description: "The maximum number of list items to return", + schema: { + type: "integer", + minimum: 0, + }, + }, + biscuit: { + name: "biscuit", + in: "cookie", + style: "form", + schema: { + type: "string", + }, + }, + }, + requestBodies: { + ThingRequestBody: { + content: { + "application/json": { + schema: { + type: "object", + }, + }, + }, + }, + }, + responses: { + ThingResponse: { + description: "A thing", + content: { + "application/json": { + schema: { + type: "object", + }, + }, + }, + }, + }, + schemas: { + SomePayload: {}, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/path-no-response.ts b/packages/types/tests/schema-tests-3.2/path-no-response.ts new file mode 100644 index 0000000..d913f84 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/path-no-response.ts @@ -0,0 +1,17 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/path_no_response.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/": { + get: {}, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/path-var-empty-pathitem.ts b/packages/types/tests/schema-tests-3.2/path-var-empty-pathitem.ts new file mode 100644 index 0000000..b7db875 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/path-var-empty-pathitem.ts @@ -0,0 +1,15 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/path_var_empty_pathitem.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/{var}": {}, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/paths-object-example.ts b/packages/types/tests/schema-tests-3.2/paths-object-example.ts new file mode 100644 index 0000000..2b32229 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/paths-object-example.ts @@ -0,0 +1,40 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/paths-object-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + schemas: { + pet: {}, + }, + }, + paths: { + "/pets": { + get: { + description: + "Returns all pets from the system that the user has access to", + responses: { + "200": { + description: "A list of pets.", + content: { + "application/json": { + schema: { + type: "array", + items: { + $ref: "#/components/schemas/pet", + }, + }, + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/request-body-examples.ts b/packages/types/tests/schema-tests-3.2/request-body-examples.ts new file mode 100644 index 0000000..0c58920 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/request-body-examples.ts @@ -0,0 +1,67 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/request-body-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + schemas: { + User: {}, + }, + }, + paths: { + "/something": { + put: { + requestBody: { + description: "user to add to the system", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/User", + }, + examples: { + user: { + summary: "User example", + externalValue: "https://foo.bar/examples/user-example.json", + }, + }, + }, + "application/xml": { + schema: { + $ref: "#/components/schemas/User", + }, + examples: { + user: { + summary: "User example in XML", + externalValue: "https://foo.bar/examples/user-example.xml", + }, + }, + }, + "text/plain": { + examples: { + user: { + summary: "User example in plain text", + externalValue: "https://foo.bar/examples/user-example.txt", + }, + }, + }, + "*/*": { + examples: { + user: { + summary: "User example in other format", + externalValue: + "https://foo.bar/examples/user-example.whatever", + }, + }, + }, + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/response-object-examples.ts b/packages/types/tests/schema-tests-3.2/response-object-examples.ts new file mode 100644 index 0000000..ce0464f --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/response-object-examples.ts @@ -0,0 +1,78 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/response-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + components: { + responses: { + "complex-object-array": { + summary: "Complex object array", + description: "A complex object array response", + content: { + "application/json": { + schema: { + type: "array", + items: { + $ref: "#/components/schemas/VeryComplexType", + }, + }, + }, + }, + }, + "simple-string": { + description: "A simple string response", + content: { + "text/plain": { + schema: { + type: "string", + }, + }, + }, + }, + "plain-text-with-headers": { + description: "A simple string response", + content: { + "text/plain": { + schema: { + type: "string", + }, + example: "whoa!", + }, + }, + headers: { + "X-Rate-Limit-Limit": { + description: "The number of allowed requests in the current period", + schema: { + type: "integer", + }, + }, + "X-Rate-Limit-Remaining": { + description: + "The number of remaining requests in the current period", + schema: { + type: "integer", + }, + }, + "X-Rate-Limit-Reset": { + description: "The number of seconds left in the current period", + schema: { + type: "integer", + }, + }, + }, + }, + "no-return-value": { + description: "object created", + }, + }, + schemas: { + VeryComplexType: {}, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/schema-object-deprecated-example-keyword.ts b/packages/types/tests/schema-tests-3.2/schema-object-deprecated-example-keyword.ts new file mode 100644 index 0000000..85c1365 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/schema-object-deprecated-example-keyword.ts @@ -0,0 +1,29 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/schema-object-deprecated-example-keyword.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: { + "/user": { + parameters: [ + { + in: "query", + name: "example", + schema: { + type: "object", + example: { + numbers: [1, 2], + flag: null, + }, + }, + }, + ], + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/schema.ts b/packages/types/tests/schema-tests-3.2/schema.ts new file mode 100644 index 0000000..195c122 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/schema.ts @@ -0,0 +1,70 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/schema.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: {}, + components: { + schemas: { + model: { + type: "object", + properties: { + one: { + description: "type array", + type: ["integer", "string"], + }, + two: { + description: "type 'null'", + type: "null", + }, + three: { + description: "type array including 'null'", + type: ["string", "null"], + }, + four: { + description: "array with no items", + type: "array", + }, + five: { + description: "singular example", + type: "string", + examples: ["exampleValue"], + }, + six: { + description: "exclusiveMinimum true", + exclusiveMinimum: 10, + }, + seven: { + description: "exclusiveMinimum false", + minimum: 10, + }, + eight: { + description: "exclusiveMaximum true", + exclusiveMaximum: 20, + }, + nine: { + description: "exclusiveMaximum false", + maximum: 20, + }, + ten: { + description: "nullable string", + type: ["string", "null"], + }, + eleven: { + description: "x-nullable string", + type: ["string", "null"], + }, + twelve: { + description: "file/binary", + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/security-scheme-object-examples.ts b/packages/types/tests/schema-tests-3.2/security-scheme-object-examples.ts new file mode 100644 index 0000000..a035dbb --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/security-scheme-object-examples.ts @@ -0,0 +1,108 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/security-scheme-object-examples.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + security: [ + { + basic: [], + }, + { + apiKey: [], + }, + { + "JWT-bearer": [], + }, + { + mutualTLS: [], + }, + { + OAuth2: ["write:pets", "read:pets"], + }, + ], + components: { + securitySchemes: { + basic: { + type: "http", + scheme: "basic", + }, + apiKey: { + type: "apiKey", + name: "api-key", + in: "header", + }, + "JWT-bearer": { + type: "http", + scheme: "bearer", + bearerFormat: "JWT", + }, + mutualTLS: { + type: "mutualTLS", + description: "Cert must be signed by example.com CA", + }, + OAuth2: { + type: "oauth2", + oauth2MetadataUrl: "https://example.com/api/oauth/metadata", + flows: { + authorizationCode: { + authorizationUrl: "https://example.com/api/oauth/dialog", + refreshUrl: "https://example.com/api/oauth/refresh", + tokenUrl: "https://example.com/api/oauth/token", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets", + }, + }, + password: { + tokenUrl: "https://example.com/api/oauth/token", + scopes: { + "read:pets": "read your pets", + }, + refreshUrl: "https://example.com/api/oauth/refresh", + }, + clientCredentials: { + tokenUrl: "https://example.com/api/oauth/token", + scopes: { + "read:pets": "read your pets", + }, + refreshUrl: "https://example.com/api/oauth/refresh", + }, + deviceAuthorization: { + deviceAuthorizationUrl: "https://example.com/api/oauth/device", + tokenUrl: "https://example.com/api/oauth/token", + scopes: { + "read:pets": "read your pets", + }, + refreshUrl: "https://example.com/api/oauth/refresh", + }, + }, + }, + OAuth2Old: { + deprecated: true, + type: "oauth2", + flows: { + implicit: { + authorizationUrl: "https://example.com/api/oauth/dialog", + scopes: { + "read:pets": "read your pets", + }, + refreshUrl: "https://example.com/api/oauth/refresh", + }, + }, + }, + OpenIdConnect: { + type: "openIdConnect", + openIdConnectUrl: "https://example.com/api/oauth/openid", + }, + external: { + $ref: "https://example.com/api/openapi.json#/components/externalDocs/ThingExternalDocs", + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/servers.ts b/packages/types/tests/schema-tests-3.2/servers.ts new file mode 100644 index 0000000..06ef770 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/servers.ts @@ -0,0 +1,42 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/servers.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: {}, + servers: [ + { + url: "/v1", + description: "Run locally.", + name: "local", + }, + { + url: "https://production.com/v1", + description: "Run on production server.", + }, + { + url: "https://{username}.gigantic-server.com:{port}/{basePath}", + description: "The production API server", + variables: { + username: { + default: "demo", + description: + "A user-specific subdomain. Use `demo` for a free sandbox environment.", + }, + port: { + enum: ["8443", "443"], + default: "8443", + }, + basePath: { + default: "v2", + }, + }, + }, + ], +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/specification-extensions.ts b/packages/types/tests/schema-tests-3.2/specification-extensions.ts new file mode 100644 index 0000000..a466349 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/specification-extensions.ts @@ -0,0 +1,14 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/specification-extensions.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: {}, + "x-tensions": "specification extensions are prefixed with `x-`", +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/style-defaults.ts b/packages/types/tests/schema-tests-3.2/style-defaults.ts new file mode 100644 index 0000000..9ed7c89 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/style-defaults.ts @@ -0,0 +1,157 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/style-defaults.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: + "various permutations of parameter objects, with non-required values left to their defaults", + version: "1.0.0", + }, + components: { + mediaTypes: { + encoding_object_defaults: { + encoding: { + no_styles: { + "x-comment": + "style, explode and allowReserved are not present, so contentType is used; no defaults expected as default contentType cannot be determined by the schema", + }, + style_form: { + "x-comment": + "expecting defaults: explode=true, allowReserved=false", + style: "form", + }, + style_spaceDelimited: { + "x-comment": + "expecting defaults: explode=false, allowReserved=false", + style: "spaceDelimited", + }, + explode: { + "x-comment": "expecting defaults: style=form, allowReserved=false", + explode: false, + }, + allowReserved: { + "x-comment": "expecting default: style=form, explode=true", + allowReserved: true, + }, + }, + }, + }, + parameters: { + path_media_type: { + "x-comment": "expecting defaults: deprecated=false", + name: "path_media-type", + in: "path", + required: true, + content: { + "text/*": { + schema: {}, + }, + }, + }, + path_simple: { + "x-comment": + "expecting defaults: deprecated=false, style=simple, explode=false, allowReserved=false", + name: "path_simple", + in: "path", + required: true, + schema: {}, + }, + path_matrix: { + "x-comment": + "expecting defaults: deprecated=false, explode=false, allowReserved=false", + name: "path_matrix", + in: "path", + required: true, + style: "matrix", + schema: {}, + }, + path_label: { + "x-comment": + "expecting defaults: deprecated=false, explode=false, allowReserved=false", + name: "path_label", + in: "path", + required: true, + style: "label", + schema: {}, + }, + query_media_type: { + "x-comment": + "expecting defaults: required=false, deprecated=false, allowEmptyValue=false", + name: "query_media_type", + in: "query", + content: { + "text/*": { + schema: {}, + }, + }, + }, + query_form: { + "x-comment": + "expecting defaults: required=false, deprecated=false, allowEmptyValue=false, style=form, explode=true, allowReserved=false", + name: "query_form", + in: "query", + schema: {}, + }, + query_spaceDelimited: { + "x-comment": + "expecting defaults: required=false, deprecated=false, allowEmptyValue=false, explode=false, allowReserved=false", + name: "query_spaceDelimited", + in: "query", + style: "spaceDelimited", + schema: {}, + }, + query_pipeDelimited: { + "x-comment": + "expecting defaults: required=false, deprecated=false, allowEmptyValue=false, explode=false, allowReserved=false", + name: "query_pipeDelimited", + in: "query", + style: "pipeDelimited", + schema: {}, + }, + query_deepObject: { + "x-comment": + "expecting defaults: required=false, deprecated=false, allowEmptyValue=false, allowReserved=false", + name: "query_deepObject", + in: "query", + style: "deepObject", + schema: {}, + }, + header: { + "x-comment": + "expecting defaults: deprecated=false, style=simple, explode=false, allowReserved=false", + name: "header", + in: "path", + required: true, + schema: {}, + }, + cookie_media_type: { + "x-comment": "expecting defaults: required=false, deprecated=false", + name: "cookie_media_type", + in: "cookie", + content: { + "text/*": { + schema: {}, + }, + }, + }, + cookie_form: { + "x-comment": + "expecting defaults: required=false, deprecated=false, style=form, explode=true, allowReserved=false", + name: "cookie_form", + in: "cookie", + schema: {}, + }, + cookie_cookie: { + "x-comment": + "expecting defaults: required=false, deprecated=false, explode=true", + name: "cookie_cookie", + in: "cookie", + style: "cookie", + schema: {}, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/tag-object-example.ts b/packages/types/tests/schema-tests-3.2/tag-object-example.ts new file mode 100644 index 0000000..b6598ca --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/tag-object-example.ts @@ -0,0 +1,38 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/tag-object-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "API", + version: "1.0.0", + }, + paths: {}, + tags: [ + { + name: "account-updates", + summary: "Account Updates", + description: "Account update operations", + kind: "nav", + }, + { + name: "partner", + summary: "Partner", + description: "Operations available to the partners network", + parent: "external", + kind: "audience", + }, + { + name: "external", + summary: "External", + description: "Operations available to external consumers", + kind: "audience", + externalDocs: { + description: "Find more info here", + url: "https://example.com", + }, + }, + ], +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/valid-schema-types.ts b/packages/types/tests/schema-tests-3.2/valid-schema-types.ts new file mode 100644 index 0000000..7f5e566 --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/valid-schema-types.ts @@ -0,0 +1,22 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/valid_schema_types.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.1", + info: { + title: "API", + version: "1.0.0", + }, + components: { + schemas: { + anything_boolean: true, + nothing_boolean: false, + anything_object: {}, + nothing_object: { + not: {}, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tests/schema-tests-3.2/webhook-example.ts b/packages/types/tests/schema-tests-3.2/webhook-example.ts new file mode 100644 index 0000000..fff2b0e --- /dev/null +++ b/packages/types/tests/schema-tests-3.2/webhook-example.ts @@ -0,0 +1,53 @@ +/* oxlint-disable sort-keys, unicorn/no-thenable */ +// Generated from https://github.com/OAI/OpenAPI-Specification/tree/v3.2-dev/tests/schema/pass/webhook-example.yaml +// Do not edit by hand; regenerate instead. +import type { OpenAPIObject } from "../../src/v3.2"; + +export const doc = { + openapi: "3.2.0", + info: { + title: "Webhook Example", + version: "1.0.0", + }, + webhooks: { + newPet: { + post: { + requestBody: { + description: "Information about a new pet in the system", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/Pet", + }, + }, + }, + }, + responses: { + "200": { + description: + "Return a 200 status to indicate that the data was received successfully", + }, + }, + }, + }, + }, + components: { + schemas: { + Pet: { + required: ["id", "name"], + properties: { + id: { + type: "integer", + format: "int64", + }, + name: { + type: "string", + }, + tag: { + type: "string", + }, + }, + }, + }, + }, +} satisfies OpenAPIObject; diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json new file mode 100644 index 0000000..0fb4b9f --- /dev/null +++ b/packages/types/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.lib.json", + "include": ["package.json", "src"], + "exclude": [ + "**/*.test.*", + "**/*.test-d.ts", + "**/__tests__/**", + "**/__mocks__/**", + "**/__snapshots__/**" + ] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 612c003..fd50227 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -131,17 +131,26 @@ importers: specifier: ^2.13.1 version: 2.13.1 typescript: - specifier: ^7.0.2 - version: 7.0.2 + specifier: ^6.0.3 + version: 6.0.3 ultracite: specifier: 7.10.7 version: 7.10.7(oxfmt@0.65.0)(oxlint@1.80.0) + unbuild: + specifier: ^3.6.1 + version: 3.6.1(typescript@6.0.3) vitest: specifier: ^4.1.11 - version: 4.1.11(@types/node@26.4.0)(@vitest/coverage-v8@4.1.11)(vite@8.2.2(@types/node@26.4.0)(yaml@2.9.0)) + version: 4.1.11(@types/node@26.4.0)(@vitest/coverage-v8@4.1.11)(vite@8.2.2(@types/node@26.4.0)(jiti@2.7.0)(yaml@2.9.0)) + + packages/types: {} packages: + '@babel/code-frame@8.0.0': + resolution: {integrity: sha512-dYYg153EyN2Ekbqw2zAsbd6/JR+9N2SEoC7YV2GyyqMM7x9bLDTjBD6XBhSMLH0wtIVyJj03jWNriQhaN+eoCw==} + engines: {node: ^22.18.0 || >=24.11.0} + '@babel/helper-string-parser@7.29.7': resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} engines: {node: '>=6.9.0'} @@ -150,6 +159,10 @@ packages: resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@8.0.4': + resolution: {integrity: sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==} + engines: {node: ^22.18.0 || >=24.11.0} + '@babel/parser@7.29.8': resolution: {integrity: sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==} engines: {node: '>=6.0.0'} @@ -171,6 +184,171 @@ packages: resolution: {integrity: sha512-y7/yvZ2TPAnR9+jnc00klvNNLkJiXFFrQA/hlLCcxA9a2A4zQIOimyFQ9XfwYKiGD1fb5GY8vbKIIgO8d5Tb2A==} engines: {node: '>= 20.12.0'} + '@colordx/core@5.6.0': + resolution: {integrity: sha512-EDlcg/Hmlj1WuFh/Os9YhA+A2aasB2XlgwFfGePUDuW7fVHC07HBi5AFIMx0Ct1eM8kHM9NRyOtZ0MuVYa8xvg==} + + '@esbuild/aix-ppc64@0.25.12': + resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.25.12': + resolution: {integrity: sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.25.12': + resolution: {integrity: sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.25.12': + resolution: {integrity: sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.25.12': + resolution: {integrity: sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.25.12': + resolution: {integrity: sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.25.12': + resolution: {integrity: sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.25.12': + resolution: {integrity: sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.25.12': + resolution: {integrity: sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.25.12': + resolution: {integrity: sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.25.12': + resolution: {integrity: sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.25.12': + resolution: {integrity: sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.25.12': + resolution: {integrity: sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.25.12': + resolution: {integrity: sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.25.12': + resolution: {integrity: sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.25.12': + resolution: {integrity: sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.25.12': + resolution: {integrity: sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.25.12': + resolution: {integrity: sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.25.12': + resolution: {integrity: sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.25.12': + resolution: {integrity: sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.25.12': + resolution: {integrity: sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openharmony-arm64@0.25.12': + resolution: {integrity: sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.25.12': + resolution: {integrity: sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.25.12': + resolution: {integrity: sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.25.12': + resolution: {integrity: sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.25.12': + resolution: {integrity: sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + + '@jridgewell/remapping@2.3.5': + resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} + '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} @@ -181,6 +359,13 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@napi-rs/lzma-linux-x64-gnu@1.5.1': + resolution: {integrity: sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==} + engines: {node: ^22.20 || ^24.12 || >=25} + cpu: [x64] + os: [linux] + libc: [glibc] + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -539,148 +724,223 @@ packages: '@rolldown/pluginutils@1.0.1': resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} - '@sec-ant/readable-stream@0.4.1': - resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} + '@rollup/plugin-alias@5.1.1': + resolution: {integrity: sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true - '@sindresorhus/merge-streams@4.0.0': - resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} - engines: {node: '>=18'} + '@rollup/plugin-commonjs@28.0.9': + resolution: {integrity: sha512-PIR4/OHZ79romx0BVVll/PkwWpJ7e5lsqFa3gFfcrFPWwLXLV39JVUzQV9RKjWerE7B845Hqjj9VYlQeieZ2dA==} + engines: {node: '>=16.0.0 || 14 >= 14.17'} + peerDependencies: + rollup: ^2.68.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true - '@standard-schema/spec@1.1.0': - resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + '@rollup/plugin-json@6.1.0': + resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true - '@types/chai@5.2.3': - resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + '@rollup/plugin-node-resolve@16.0.3': + resolution: {integrity: sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.78.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true - '@types/deep-eql@4.0.2': - resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@rollup/plugin-replace@6.0.3': + resolution: {integrity: sha512-J4RZarRvQAm5IF0/LwUUg+obsm+xZhYnbMXmXROyoSE1ATJe3oXSb9L5MMppdxP2ylNSjv6zFBwKYjcKMucVfA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true - '@types/estree@1.0.9': - resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + '@rollup/pluginutils@5.4.0': + resolution: {integrity: sha512-MfPp06CjRLfXQ3wY0R8vJDYBy/MvVcc9OulEfR0B8Iv9ko+GCNaRZ+EpJYFl27LhKsZK0o420sYCRHCjfCgeUg==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true - '@types/node@26.4.0': - resolution: {integrity: sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ==} + '@rollup/rollup-android-arm-eabi@4.63.0': + resolution: {integrity: sha512-70TeIFezKKy65LgAVyQh+w94/gjWhvPWaLaGGeMEgVrPkQhuj/M5bAYYZzIFUj9Y69oHyTm5Um/R6gcLh4A8JA==} + cpu: [arm] + os: [android] - '@typescript/typescript-aix-ppc64@7.0.2': - resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} - engines: {node: '>=16.20.0'} - cpu: [ppc64] - os: [aix] + '@rollup/rollup-android-arm64@4.63.0': + resolution: {integrity: sha512-YC86tYIHK6M1IV+wbzO+Bxk8RCBr6ZyWYgWxUCzaZD8mc8rrFoIJDNzDrkHBYRc/wKdrsIXmm6/F7NzrAO+OrA==} + cpu: [arm64] + os: [android] - '@typescript/typescript-darwin-arm64@7.0.2': - resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-darwin-arm64@4.63.0': + resolution: {integrity: sha512-oI+ECtUcli0y0fi4xpW82GdPIXdTkI8G8DSjG2LRuw09fPAGykaWYH/hXxiKuTxiAjiPSTIIuYUqof5Z2hShWw==} cpu: [arm64] os: [darwin] - '@typescript/typescript-darwin-x64@7.0.2': - resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-darwin-x64@4.63.0': + resolution: {integrity: sha512-NwV+1s7TiKrMe4owHyKB/dTLD7ZJD0YEBEhIz+hvav1Cu1GReJjF+rsdNwjzENQeIAbE/CoNiaAc5Vz2h5DPAA==} cpu: [x64] os: [darwin] - '@typescript/typescript-freebsd-arm64@7.0.2': - resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-freebsd-arm64@4.63.0': + resolution: {integrity: sha512-tWtHBTu5gOPK4u4Urtk4qAHW3zZ9rQAmbssO8gp7ELvGTGI3aCiq6NqyTQ0PCIg7KbHJF2UkGDDs77YZGxfjCA==} cpu: [arm64] os: [freebsd] - '@typescript/typescript-freebsd-x64@7.0.2': - resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-freebsd-x64@4.63.0': + resolution: {integrity: sha512-2qPoJiwTvtHQ27NnYvTnsgk8laXWYuVmNESG8WFZBcEPKLfZ3I27qBJarjVRQtwGeYyRfq5ZowHXih9lm2BItw==} cpu: [x64] os: [freebsd] - '@typescript/typescript-linux-arm64@7.0.2': - resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==} - engines: {node: '>=16.20.0'} - cpu: [arm64] + '@rollup/rollup-linux-arm-gnueabihf@4.63.0': + resolution: {integrity: sha512-FQwsTRvLNuHoTdICABJQfbPUSEueISGmnpT06tXTMpfprf5NiKLSXKA0A+w45wJnCmZAnzgqBwbt6ARFuyOi5w==} + cpu: [arm] os: [linux] + libc: [glibc] - '@typescript/typescript-linux-arm@7.0.2': - resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-linux-arm-musleabihf@4.63.0': + resolution: {integrity: sha512-BBVTXziw8mY1a4ZbWME9tZyfzqXCDPqaC7Z3heQ29p5dkvXzwL0NwelO8zLa8c3RBKvl3YTuSnBgsBhYBtwjIw==} cpu: [arm] os: [linux] + libc: [musl] + + '@rollup/rollup-linux-arm64-gnu@4.63.0': + resolution: {integrity: sha512-w2Iyy9+RqKwx3d9qWMKsJg0FfRBsY0/pXNv0mCQ3ueRvJI6+QAScfD4nrMlzFLs2HNVW6Ew+mtZfDl9b7Ew5/Q==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm64-musl@4.63.0': + resolution: {integrity: sha512-YK++KtrFRHYE0P6/RtYEAy9t8F37znP+K03RrIuLPYOL6SVlObRumf/0OE4V/h63xL9DwkWbNssZfmA9hawuDA==} + cpu: [arm64] + os: [linux] + libc: [musl] - '@typescript/typescript-linux-loong64@7.0.2': - resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-linux-loong64-gnu@4.63.0': + resolution: {integrity: sha512-aBfOG6fP7YkkPmTqPwufRJeFyz7WPpECv9XNbnsk9+vg7rxdih0lbtEel7jcRng4LZrrmU3FfitCFyEj4BWDWg==} cpu: [loong64] os: [linux] + libc: [glibc] - '@typescript/typescript-linux-mips64el@7.0.2': - resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==} - engines: {node: '>=16.20.0'} - cpu: [mips64el] + '@rollup/rollup-linux-loong64-musl@4.63.0': + resolution: {integrity: sha512-LGaHEOeHNAag9VuS1Crs5DFg4RrU9MPi2nVnNJk9DTePx/B6RRYKVmrIXt2h7YOJlwjaFJ6lwtFDliZxScTLrQ==} + cpu: [loong64] os: [linux] + libc: [musl] - '@typescript/typescript-linux-ppc64@7.0.2': - resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-linux-ppc64-gnu@4.63.0': + resolution: {integrity: sha512-jClvk+J0FC3b7Udvegiw5/4hErbHtmsNsQgENnKXDWtNCJXsJYZH5WURvu7imDOO38xYml24eeh5x3A04ppwCw==} cpu: [ppc64] os: [linux] + libc: [glibc] - '@typescript/typescript-linux-riscv64@7.0.2': - resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-linux-ppc64-musl@4.63.0': + resolution: {integrity: sha512-0OJlaGK+8+B777Ql5okIpD7ua5Ro9+VB9Ve0OKa28OQJZ1RbuUBVNHK/e3pr4BROqsyPl1JrPO1ZxJseCNffcA==} + cpu: [ppc64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-riscv64-gnu@4.63.0': + resolution: {integrity: sha512-Ygsx+HoNH7afwi1bTIXbnTvVnsO+zurPLSYxybV1hHFVU72OWOCl6v05ql/z0hkpAPx+DK7Kn9Bi7MayCcjLTA==} cpu: [riscv64] os: [linux] + libc: [glibc] - '@typescript/typescript-linux-s390x@7.0.2': - resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-linux-riscv64-musl@4.63.0': + resolution: {integrity: sha512-pDQxtMGb+OvG3fLwR2OkZlSd47hW+kWg4BYMG/++sR6RqorQccwPTDsxda5hPwiIeIErAnCF9ma3SAU06bdQtQ==} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-s390x-gnu@4.63.0': + resolution: {integrity: sha512-0BnUG9mS8I4SSHr3XsxVhuCMEiu+rX61xxZF5vujso4LaiAGFZFxvDjg6Xn6tLPNTUAfuCvQYas4LMQMVsKRSQ==} cpu: [s390x] os: [linux] + libc: [glibc] - '@typescript/typescript-linux-x64@7.0.2': - resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-linux-x64-gnu@4.63.0': + resolution: {integrity: sha512-Adu/VttB1dpPNW+FEacrZ+xVm9tFty84+RrFzsqlFaPxoJB+9XXyDGtp5dCOoBwGBIEVH0To7lExFXEx0BIF4A==} cpu: [x64] os: [linux] + libc: [glibc] - '@typescript/typescript-netbsd-arm64@7.0.2': - resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [netbsd] - - '@typescript/typescript-netbsd-x64@7.0.2': - resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-linux-x64-musl@4.63.0': + resolution: {integrity: sha512-NQ3bDvjUbFKmP23671xUlXtKmqVsUBd6M4PQCvbmNtOy06hnQIdKHy8oG/6S3R/S6He1JgPk6A5VT+prAJMYEw==} cpu: [x64] - os: [netbsd] - - '@typescript/typescript-openbsd-arm64@7.0.2': - resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [openbsd] + os: [linux] + libc: [musl] - '@typescript/typescript-openbsd-x64@7.0.2': - resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-openbsd-x64@4.63.0': + resolution: {integrity: sha512-u2eDAl4+0aFvA13GxlGBtTI3SS3sdgwgtV0HyjZ0QaQVCgNE+jqNGey+GtxWiq+wxr/UycAx/OnfJzApCFamvA==} cpu: [x64] os: [openbsd] - '@typescript/typescript-sunos-x64@7.0.2': - resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [sunos] + '@rollup/rollup-openharmony-arm64@4.63.0': + resolution: {integrity: sha512-XvRb5vfW3wAZQ+ZUG21AnHHDKtNcw99eigzEhjr//NZ3u7SoBaPP0seSc7FgP7p1epAEdAoZckMW9WY/+4w70w==} + cpu: [arm64] + os: [openharmony] - '@typescript/typescript-win32-arm64@7.0.2': - resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-win32-arm64-msvc@4.63.0': + resolution: {integrity: sha512-iZPmniy4kNBf5yo2RezbkYNNK5HPbXE9+g+twnbqSng7dtLEJy1SKoxiE/ni4FDacjyuZpEeb9U054N4EoKHYw==} cpu: [arm64] os: [win32] - '@typescript/typescript-win32-x64@7.0.2': - resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==} - engines: {node: '>=16.20.0'} + '@rollup/rollup-win32-ia32-msvc@4.63.0': + resolution: {integrity: sha512-mFBBd+LF37fnE8JnYUOH+imj0aPFPK30vpar4ehJkgnLj9sZn8ZxiRENmLtgIwxK7TC8klF6N57fxdNBwQoqOA==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-gnu@4.63.0': + resolution: {integrity: sha512-ujeqEY3B+zbGn3Z4Q03cUBG/LGWnBJncVT36WER31LcOsQk9+1dmINKKtvmmfChUvRbK1G0R8OhMWFgHgaZtAw==} cpu: [x64] os: [win32] + '@rollup/rollup-win32-x64-msvc@4.63.0': + resolution: {integrity: sha512-hncn90N4sOky0L2LKE5oESKLbxCPeVo4eLA2LSMoDzM+879ml4WSr+Rr4DWknNIVVvS1Hirkc9hx02W6YxS8rQ==} + cpu: [x64] + os: [win32] + + '@sec-ant/readable-stream@0.4.1': + resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} + + '@sindresorhus/merge-streams@4.0.0': + resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} + engines: {node: '>=18'} + + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + + '@types/node@26.4.0': + resolution: {integrity: sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ==} + + '@types/resolve@1.20.2': + resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} + '@vitest/coverage-v8@4.1.11': resolution: {integrity: sha512-8MVGEFnJIcdGjcbfKmeq8z0pZHH0JlVtoVZH9Q/qwUp6wyFnEJUBMrw9DCaj+ra3vShGmhavjalMIhPNxZAUcw==} peerDependencies: @@ -743,14 +1003,43 @@ packages: ast-v8-to-istanbul@1.0.5: resolution: {integrity: sha512-UPAgKJFSEGMWSDr3LX4tqnAb4f7KGT8O40Tyx8wbYmmZ/yn58lNCm8h3svs3eXgiGd5AXxz8NDOvXWvicq+rJA==} + autoprefixer@10.5.4: + resolution: {integrity: sha512-MaU0U/za7N3r6brxD4YB/l4NSrFzLPlANv6wEuQVaIPlD3L4W9rFcQPbL/EilY9BHhHvhfcz3gInDLrEtWT4EA==} + engines: {node: ^10 || ^12 || >=14} + hasBin: true + peerDependencies: + postcss: ^8.1.0 + + baseline-browser-mapping@2.11.20: + resolution: {integrity: sha512-H0ulySigv6icDJ1F7SjtdCD6PrhTpdYCmP0CactWy1+ekh0AFd0o1Wn5T8b+hnTmdBx19u9yhL6wvCylXMY7zw==} + engines: {node: '>=6.0.0'} + hasBin: true + + boolbase@1.0.0: + resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} + browserslist@4.28.8: + resolution: {integrity: sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + caniuse-api@3.0.0: + resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} + + caniuse-lite@1.0.30001810: + resolution: {integrity: sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==} + chai@6.2.2: resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} engines: {node: '>=18'} + citty@0.1.6: + resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} + citty@0.2.2: resolution: {integrity: sha512-+6vJA3L98yv+IdfKGZHBNiGW5KHn22e/JwID0Strsz8h4S/csAu/OuICwxrg44k5MRiZHWIo8XXuJgQTriRP4w==} @@ -762,35 +1051,136 @@ packages: resolution: {integrity: sha512-06p9vyLahLa4zkGcgsGxU6iEkSOiuI4fhCH6Emhe2lPAcoUv73n72DnODsnHA+5wwXGnV0n9M9/qOQJSjYhFhw==} engines: {node: '>=22'} + commander@11.1.0: + resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} + engines: {node: '>=16'} + commander@15.0.0: resolution: {integrity: sha512-z67u4ZhzCL/Tydu1lJARtEZYWbWaN7oYLHbsuzocr6y4N6WZAagG3RQ4FW61V1/0+jImpj293XfrcYnd1qxtPg==} engines: {node: '>=22.12.0'} + commondir@1.0.1: + resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + confbox@0.1.8: resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} + confbox@0.2.4: + resolution: {integrity: sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ==} + + consola@3.4.2: + resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} + engines: {node: ^14.18.0 || >=16.10.0} + convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + css-declaration-sorter@7.4.0: + resolution: {integrity: sha512-LTuzjPoyA2vMGKKcaOqKSp7Ub2eGrNfKiZH4LpezxpNrsICGCSFvsQOI29psISxNZtaXibkC2CXzrQ5enMeGGw==} + engines: {node: ^14 || ^16 || >=18} + peerDependencies: + postcss: ^8.0.9 + + css-select@6.0.0: + resolution: {integrity: sha512-rZZVSLle8v0+EY8QAkDWrKhpgt6SA5OtHsgBnsj6ZaLb5dmDVOWUDtQitd9ydxxvEjhewNudS6eTVU7uOyzvXw==} + + css-tree@2.2.1: + resolution: {integrity: sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} + + css-tree@3.2.1: + resolution: {integrity: sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} + + css-what@7.0.0: + resolution: {integrity: sha512-wD5oz5xibMOPHzy13CyGmogB3phdvcDaB5t0W/Nr5Z2O/agcB8YwOz6e2Lsp10pNDzBoDO9nVa3RGs/2BttpHQ==} + engines: {node: '>= 6'} + + cssesc@3.0.0: + resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} + engines: {node: '>=4'} + hasBin: true + + cssnano-preset-default@7.0.17: + resolution: {integrity: sha512-11qO63A+czwguQFJCaTdICvbaxn0pJzz/XghLlv+OT7WyToDxAMR0Xb3/26/l0y0hQJywwNbj/SLSQlGBHE1OA==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + cssnano-utils@5.0.3: + resolution: {integrity: sha512-ynIREMICLxkxm7e9bCR9sh75s4Q5drICi0ua1yxo5jH2XPBqSKkl4dOh4EbFqtUmnTMhRffHgYL0EKKkMjtJTg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + cssnano@7.1.9: + resolution: {integrity: sha512-uPR75+5Dk/WJ/YSPR1/YDHdwMM9c5FsaARljfKWgeCKLKOtJ0we21xy/RcCjn53fZnD/f6yYEIZ8pu18+GnbNQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + csso@5.0.5: + resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} + deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + detect-libc@2.1.2: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} + dom-serializer@2.0.0: + resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} + + domelementtype@2.3.0: + resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} + + domhandler@5.0.3: + resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} + engines: {node: '>= 4'} + + domutils@3.2.2: + resolution: {integrity: sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==} + + electron-to-chromium@1.5.415: + resolution: {integrity: sha512-958V+Kbhtgz+SxXeEVKBjrlKRBIDAYvUJfwhjxMZ5S6ut9jAl7l9ZKBkBrvjyjZE36PabLUo2L8kEeV5O4vgJg==} + empathic@2.0.1: resolution: {integrity: sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==} engines: {node: '>=14'} + entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + environment@1.1.0: resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} engines: {node: '>=18'} + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + es-module-lexer@2.3.2: resolution: {integrity: sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==} + esbuild@0.25.12: + resolution: {integrity: sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==} + engines: {node: '>=18'} + hasBin: true + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} @@ -802,6 +1192,9 @@ packages: resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} engines: {node: '>=12.0.0'} + exsolve@1.1.1: + resolution: {integrity: sha512-9U/jZUgjnSGyntRr6y5Muu1MJcwFl6kPu7k8qLF0IMNfLqvw0NZ4nnVDq0RVoZ0RvCyumib4Ez3KYrVfilrw+g==} + fast-glob@3.3.3: resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} engines: {node: '>=8.6.0'} @@ -838,11 +1231,20 @@ packages: find-workspaces@0.3.1: resolution: {integrity: sha512-UDkGILGJSA1LN5Aa7McxCid4sqW3/e+UYsVwyxki3dDT0F8+ym0rAfnCkEfkL0rO7M+8/mvkim4t/s3IPHmg+w==} + fix-dts-default-cjs-exports@1.0.1: + resolution: {integrity: sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==} + + fraction.js@5.3.4: + resolution: {integrity: sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==} + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + get-east-asian-width@1.6.0: resolution: {integrity: sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==} engines: {node: '>=18'} @@ -859,6 +1261,13 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + hasown@2.0.4: + resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==} + engines: {node: '>= 0.4'} + + hookable@5.5.3: + resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} + html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} @@ -866,6 +1275,10 @@ packages: resolution: {integrity: sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==} engines: {node: '>=18.18.0'} + is-core-module@2.16.2: + resolution: {integrity: sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==} + engines: {node: '>= 0.4'} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -878,6 +1291,9 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-module@1.0.0: + resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} + is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -886,6 +1302,9 @@ packages: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} engines: {node: '>=12'} + is-reference@1.2.1: + resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} + is-stream@4.0.1: resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==} engines: {node: '>=18'} @@ -906,12 +1325,23 @@ packages: resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} engines: {node: '>=8'} + jiti@1.21.7: + resolution: {integrity: sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==} + hasBin: true + + jiti@2.7.0: + resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==} + hasBin: true + js-tokens@10.0.0: resolution: {integrity: sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==} jsonc-parser@3.3.1: resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + knitwork@1.3.0: + resolution: {integrity: sha512-4LqMNoONzR43B1W0ek0fhXMsDNW/zxa1NdFAVMY+k28pgZLovR4G3PB5MrpTxCy1QaZCqNoiaKPr5w5qZHfSNw==} + lightningcss-android-arm64@1.33.0: resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==} engines: {node: '>= 12.0.0'} @@ -986,11 +1416,21 @@ packages: resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==} engines: {node: '>= 12.0.0'} + lilconfig@3.1.3: + resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} + engines: {node: '>=14'} + lint-staged@17.4.1: resolution: {integrity: sha512-FmJeudcalbSfg1du+JCfvi5vS6Qt08KgbfLWiHinbef+2JJwUZwAWVoaO1AcJVUTWPfk0t30PMQNwPAeCzYQ+Q==} engines: {node: '>=22.22.1'} hasBin: true + lodash.memoize@4.1.2: + resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + + lodash.uniq@4.5.0: + resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} + log-update@8.0.0: resolution: {integrity: sha512-lddSgOt3bPASrylL54ZSpy8nBHns+vBVSoILlVOx+dei300pnLRN958rj/EdlVLKuWlSESU3qdnDZdAI7FXYGg==} engines: {node: '>=22'} @@ -1005,6 +1445,12 @@ packages: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} + mdn-data@2.0.28: + resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==} + + mdn-data@2.27.1: + resolution: {integrity: sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==} + merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -1017,6 +1463,27 @@ packages: resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} engines: {node: '>=18'} + mkdist@2.4.1: + resolution: {integrity: sha512-Ezk0gi04GJBkqMfsksICU5Rjoemc4biIekwgrONWVPor2EO/N9nBgN6MZXAf7Yw4mDDhrNyKbdETaHNevfumKg==} + hasBin: true + peerDependencies: + sass: ^1.92.1 + typescript: '>=5.9.2' + vue: ^3.5.21 + vue-sfc-transformer: ^0.1.1 + vue-tsc: ^1.8.27 || ^2.0.21 || ^3.0.0 + peerDependenciesMeta: + sass: + optional: true + typescript: + optional: true + vue: + optional: true + vue-sfc-transformer: + optional: true + vue-tsc: + optional: true + mlly@1.8.2: resolution: {integrity: sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==} @@ -1025,10 +1492,17 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + node-releases@2.0.54: + resolution: {integrity: sha512-YHs7BmmcsdAI5Ozuf8JZo6PT0mv2GIWC9vMfvUC3dp65M8hn7Ux8CPL+2oBI7juNuj9d0ndhTcznq2ODBps9cQ==} + engines: {node: '>=18'} + npm-run-path@6.0.0: resolution: {integrity: sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==} engines: {node: '>=18'} + nth-check@2.1.1: + resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + nypm@0.6.9: resolution: {integrity: sha512-zxlE2yvSWZWmHcNdT3+5zV2lrCogeE9YOklHrR3dFjqutq5wO7GFDYLFDRXLsYnJzwvy/im9fYoxePvS0VTW0w==} engines: {node: '>=18'} @@ -1076,6 +1550,9 @@ packages: resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} engines: {node: '>=12'} + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} @@ -1093,10 +1570,192 @@ packages: pkg-types@1.3.1: resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} + pkg-types@2.3.1: + resolution: {integrity: sha512-y+ichcgc2LrADuhLNAx8DFjVfgz91pRxfZdI3UDhxHvcVEZsenLO+7XaU5vOp0u/7V/wZ+plyuQxtrDlZJ+yeg==} + + postcss-calc@10.1.1: + resolution: {integrity: sha512-NYEsLHh8DgG/PRH2+G9BTuUdtf9ViS+vdoQ0YA5OQdGsfN4ztiwtDWNtBl9EKeqNMFnIu8IKZ0cLxEQ5r5KVMw==} + engines: {node: ^18.12 || ^20.9 || >=22.0} + peerDependencies: + postcss: ^8.4.38 + + postcss-colormin@7.0.10: + resolution: {integrity: sha512-yFr6JezOolHLta/buLE71VKPh2mXursp4saVe98/ol8ZnEWhL+racShqPKlvd/DKWLre/39B6HhcMXf7RZ3hxg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-convert-values@7.0.12: + resolution: {integrity: sha512-xurKu5qqk4viR3Cp3p4xBR4KfnZm4w4ys6+UBwBmeuBSNkH7+DtLnYOYnOffgtE4yx8sH9S1VZ6RAAvROXzP2Q==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-discard-comments@7.0.8: + resolution: {integrity: sha512-CvvS5S9WrXblFXCEJ9nVo+4z+eA7zSC7Z88V1HEJuwlQhlFnYTIjg1xJY+BCUiG2bvICap2tXii4mP22BD108Q==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-discard-duplicates@7.0.4: + resolution: {integrity: sha512-VBNn1+EuMZkeGVVtz0gRfbNGtx9IFgAsAV+E2pHtXPrp4qfGBkhTIiAuE/wrb+Y6Pakg9NewAlfTpYIFAWODtw==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-discard-empty@7.0.3: + resolution: {integrity: sha512-M2pyjQCU+/7cMHVtL6bKTHjv0lZnPLMpicgr67Dlth7AbuV9gjVTtUqaRwn6Pp6BwSDspUzhz8SaUrRykJU5Dw==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-discard-overridden@7.0.3: + resolution: {integrity: sha512-aNovXo9UsZuRNLzHJtp13lHIvinDPfiXBPePpXkSjCbgp++iU2FqE+YxvjIsg6EdyPZsASFbfu+JcBFVsErXIQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-merge-longhand@7.0.7: + resolution: {integrity: sha512-b3mfYUxR388u5Pt0HPcVIUtUDn/k15UfTY9M+ORW+meCR6JLNxoZffiYvXyOYQoRYQNZyX/UFkMCM/mNHxe1qA==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-merge-rules@7.0.11: + resolution: {integrity: sha512-SJUPM18g2BmPhf8BVlbwqWz4aK3pLu6u6xjfwEzra7xL6IBR10sUaiB++EzqcVfadPHrKBSMlNdP+XieykhI+Q==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-minify-font-values@7.0.3: + resolution: {integrity: sha512-yilG/VOaNI74IylQvAQQxm3/wZVBkXyYUqNUAdxqwtbWUXPsbK1q8Ms0mL83v+f8YicgcyfYCRZtWACUdYajpA==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-minify-gradients@7.0.5: + resolution: {integrity: sha512-YraROyQRg3BI1+Hg8E05B/JPdnTm8EDSVu4P2BxdM+CRiOyfmou809+chGIqo6fQqwjPGQ947nbGncSjmTU1WQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-minify-params@7.0.9: + resolution: {integrity: sha512-R8itbB8BhlpoYyBm1ou0dD+vJnQ3F6adQipR4UnkCHUwlo+S9WXJaDRg1RHjC8YVAtIdrQzSWvJl40HnGDTKjA==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-minify-selectors@7.1.2: + resolution: {integrity: sha512-aQtrEWKwqafNlExcKHQvPGsXR2+vlUqqJtf5XsCQcgsSb5PL4wlujWBYDJuWsP4UnQX1YHDHU8qRlD+1PzTQ+Q==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-nested@7.0.2: + resolution: {integrity: sha512-5osppouFc0VR9/VYzYxO03VaDa3e8F23Kfd6/9qcZTUI8P58GIYlArOET2Wq0ywSl2o2PjELhYOFI4W7l5QHKw==} + engines: {node: '>=18.0'} + peerDependencies: + postcss: ^8.2.14 + + postcss-normalize-charset@7.0.3: + resolution: {integrity: sha512-NoBfZu8PR4c2NlmjvrqQTzCzLY79hwcSRgNQ3ZiNK0ABzf9kYKloE/jNj+/8GQY1wsm8pRRgANk6ydLH8cwo0Q==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-normalize-display-values@7.0.3: + resolution: {integrity: sha512-ldsCX0QIt05pKIOobZtVQ48wXJecr+czw4+e1/YjVhLMqslShgpVxgPtI2CefURR8oyVoYaU/l829MMwExDMLw==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-normalize-positions@7.0.4: + resolution: {integrity: sha512-VEvlpeGd3Ju1Hqa/oN4jaP3+ms4laYwkEL9N9u+B6k54PZjXbW1n6wI+aVprf1BQXlCYpS5+1pl/7/vHiKgARg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-normalize-repeat-style@7.0.4: + resolution: {integrity: sha512-6mPKlY/8cSaDHxX502wERADarJsccwlky6yIrOapHH2ZgfoKAV94SbiTKfKEs4EEpdazuc3J72WsqeYk7hp9+Q==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-normalize-string@7.0.3: + resolution: {integrity: sha512-HnEQPUchi1eznmDKEYrKUTqrprEq97SrpUYClgUkv7V2zRODD9DFoUsYU+m9ZOetmD5ku7fEMZB/lwy8IT6xVQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-normalize-timing-functions@7.0.3: + resolution: {integrity: sha512-zmEzHdvpZBZu0OKlbJSfgASQvaayyAoVuWtvyr34IJ/LyS+DaOKvvR3EvFJ9RWWtNIx+CMvO125OVophaxNYew==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-normalize-unicode@7.0.9: + resolution: {integrity: sha512-DRAdWfeh/TjmhLJsw91vdiWCnUod9iwvM7xyS02/nF/sLsCR3A8l3pztrSUrWG8DSBqfX7yEk9FM0USaVJ2mSg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-normalize-url@7.0.3: + resolution: {integrity: sha512-CL93wmloq5qsffmFv+bw24MIRbmhHrp53qoh1LDAb/5TtjWEXI/np4xcP/Gw9oWCb2XyWnqHYLDUwiKRoJBA1Q==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-normalize-whitespace@7.0.3: + resolution: {integrity: sha512-FdHjjn+Ht5Z2ZRjNOmeCbNq6lq09sUYKpmlF/Aq0XjVNSLTL6fmHlA/3swN2wP2caY9GV/tjSDcIIyS7aN7W0A==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-ordered-values@7.0.4: + resolution: {integrity: sha512-nubSi49hDHQk4E8KIj+IbLY8Bg+8OcSUEhgyolgM+atnOvXjV7EjaR6bac4YGZoFyPa9mWoAF3EaYbWdFkKqVg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-reduce-initial@7.0.9: + resolution: {integrity: sha512-ztTNPdIxXTxtBcG03E9u8v44M4ElXbMIRT7pf2onlquGula0Y83nKKxqM22FA/hMgkfCjN7ohevkVlaNwI8iOQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-reduce-transforms@7.0.3: + resolution: {integrity: sha512-FXsnN9ZwcZTT8Yf8cAHA8qIGUXcX6WfLd9JoYhrdDfmvsVhhfqkkv7m4AC3rwFOfz+GzkUa87OCKF9dUcicd+g==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-selector-parser@7.1.5: + resolution: {integrity: sha512-KvvtD7SrlBP7dlgkBghEE3r84CABm5SmV2aNcG4oCA+qDnJ/tvKonFVvwWAyyWUEwxuNawdfEAZKP9zM3oZ2Uw==} + engines: {node: '>=4'} + + postcss-svgo@7.1.3: + resolution: {integrity: sha512-2QfoFOYMcj8lwcVEf9WeTlkVIAm7u2QvOEhMzkQU3KUhhGX/l8hVV9EtjMv4iq3E9iI3OeeMN0YoMLbGusuigw==} + engines: {node: ^18.12.0 || ^20.9.0 || >= 18} + peerDependencies: + postcss: ^8.5.13 + + postcss-unique-selectors@7.0.7: + resolution: {integrity: sha512-d+sCkaRnSefghOUdH8CMJZV9yUQhj2ojpe8Nw/lA+LV1UOfeleGkLTl6XdCFFSai9UJ+DJPb69FFuqthXYsY8w==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + + postcss-value-parser@4.2.0: + resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + postcss@8.5.26: resolution: {integrity: sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==} engines: {node: ^10 || ^12 || >=14} + pretty-bytes@7.1.1: + resolution: {integrity: sha512-X+vn9z8nOFZQlxOLmfJ0iKDdMD7jYTsTW12OAlCpdoE3Igik6L37pugIZi+N3usuyp5McfgKPWi12q3zvHLeGQ==} + engines: {node: '>=20'} + pretty-ms@9.3.0: resolution: {integrity: sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ==} engines: {node: '>=18'} @@ -1108,6 +1767,11 @@ packages: resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} engines: {node: '>=10'} + resolve@1.22.12: + resolution: {integrity: sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==} + engines: {node: '>= 0.4'} + hasBin: true + restore-cursor@5.1.0: resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} engines: {node: '>=18'} @@ -1121,9 +1785,32 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} hasBin: true + rollup-plugin-dts@6.5.1: + resolution: {integrity: sha512-jODTXp3H7MK/Ur/ErtsrQ0G1GvaCmc3du+y5pNrdBMf6d7HlL2Nd/N6TkEr+f75CkUj01zEoEd7y2elH0eHi1Q==} + engines: {node: '>=20'} + peerDependencies: + '@typescript/typescript6': ^6 + rollup: ^3 || ^4 + typescript: ^4.5 || ^5 || ^6 || ^7 + peerDependenciesMeta: + '@typescript/typescript6': + optional: true + + rollup@4.63.0: + resolution: {integrity: sha512-T5vnZ2y4QqC3/4P+w2+JO+Q/OVdnPsv4XcSYJYMEn0R9/jjl5AgLwO9LAZMzP2lN71O6pypn91rB7lDstUkfrQ==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + sax@1.6.1: + resolution: {integrity: sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q==} + engines: {node: '>=11.0.0'} + + scule@1.3.0: + resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==} + semver@7.8.5: resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} engines: {node: '>=10'} @@ -1221,10 +1908,25 @@ packages: resolution: {integrity: sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==} engines: {node: '>=18'} + stylehacks@7.0.11: + resolution: {integrity: sha512-iODNfhXVLqc5LADs+Y6Oh5wJuK5ZcHbVng8aiK3y9pjMQdc5hLrBW0eFU6FtnpNrE6PoEg/MmFTU4waotj5WNg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.5.13 + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + + svgo@4.1.0: + resolution: {integrity: sha512-bkxnTg1kSU0guhIBmibA6UUhrQmPVA1XsQLN+ylCd+UWzbnLkySOcXpyk1mrl05f+pcaCx2eHb+sp6BgMZWX+Q==} + engines: {node: '>=16'} + hasBin: true + tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} @@ -1248,9 +1950,9 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} - typescript@7.0.2: - resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} - engines: {node: '>=16.20.0'} + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} hasBin: true ufo@1.6.4: @@ -1268,6 +1970,15 @@ packages: oxlint: optional: true + unbuild@3.6.1: + resolution: {integrity: sha512-+U5CdtrdjfWkZhuO4N9l5UhyiccoeMEXIc2Lbs30Haxb+tRwB3VwB8AoZRxlAzORXunenSo+j6lh45jx+xkKgg==} + hasBin: true + peerDependencies: + typescript: ^5.9.2 + peerDependenciesMeta: + typescript: + optional: true + undici-types@8.3.0: resolution: {integrity: sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==} @@ -1275,6 +1986,19 @@ packages: resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} engines: {node: '>=18'} + untyped@2.0.0: + resolution: {integrity: sha512-nwNCjxJTjNuLCgFr42fEak5OcLuB3ecca+9ksPFNvtfYSLpjf+iJqSIaSnIile6ZPbKYxI5k2AfXqeopGudK/g==} + hasBin: true + + update-browserslist-db@1.3.2: + resolution: {integrity: sha512-UQ+MSxlhRm1bzjhU+DcuXfjFO1FzNtqhK5+9Yvlp90ItDLk5vT932A0rFu619nf7RVS+Y/VeaUW1jaRDqZ8VJw==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + vite@8.2.2: resolution: {integrity: sha512-cFKLV/PRgAUlIRm5WjMjJ86jrftzpqcgH+Us+DS8mI3CDNiH30Whrz8uHL3+MOLPAgqbMBAqWdAHAphOAM+z/Q==} engines: {node: ^20.19.0 || >=22.12.0} @@ -1387,10 +2111,19 @@ packages: snapshots: + '@babel/code-frame@8.0.0': + dependencies: + '@babel/helper-validator-identifier': 8.0.4 + js-tokens: 10.0.0 + optional: true + '@babel/helper-string-parser@7.29.7': {} '@babel/helper-validator-identifier@7.29.7': {} + '@babel/helper-validator-identifier@8.0.4': + optional: true + '@babel/parser@7.29.8': dependencies: '@babel/types': 7.29.8 @@ -1414,6 +2147,96 @@ snapshots: fast-wrap-ansi: 0.2.2 sisteransi: 1.0.5 + '@colordx/core@5.6.0': {} + + '@esbuild/aix-ppc64@0.25.12': + optional: true + + '@esbuild/android-arm64@0.25.12': + optional: true + + '@esbuild/android-arm@0.25.12': + optional: true + + '@esbuild/android-x64@0.25.12': + optional: true + + '@esbuild/darwin-arm64@0.25.12': + optional: true + + '@esbuild/darwin-x64@0.25.12': + optional: true + + '@esbuild/freebsd-arm64@0.25.12': + optional: true + + '@esbuild/freebsd-x64@0.25.12': + optional: true + + '@esbuild/linux-arm64@0.25.12': + optional: true + + '@esbuild/linux-arm@0.25.12': + optional: true + + '@esbuild/linux-ia32@0.25.12': + optional: true + + '@esbuild/linux-loong64@0.25.12': + optional: true + + '@esbuild/linux-mips64el@0.25.12': + optional: true + + '@esbuild/linux-ppc64@0.25.12': + optional: true + + '@esbuild/linux-riscv64@0.25.12': + optional: true + + '@esbuild/linux-s390x@0.25.12': + optional: true + + '@esbuild/linux-x64@0.25.12': + optional: true + + '@esbuild/netbsd-arm64@0.25.12': + optional: true + + '@esbuild/netbsd-x64@0.25.12': + optional: true + + '@esbuild/openbsd-arm64@0.25.12': + optional: true + + '@esbuild/openbsd-x64@0.25.12': + optional: true + + '@esbuild/openharmony-arm64@0.25.12': + optional: true + + '@esbuild/sunos-x64@0.25.12': + optional: true + + '@esbuild/win32-arm64@0.25.12': + optional: true + + '@esbuild/win32-ia32@0.25.12': + optional: true + + '@esbuild/win32-x64@0.25.12': + optional: true + + '@jridgewell/gen-mapping@0.3.13': + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/remapping@2.3.5': + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/resolve-uri@3.1.2': {} '@jridgewell/sourcemap-codec@1.5.5': {} @@ -1423,6 +2246,9 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 + '@napi-rs/lzma-linux-x64-gnu@1.5.1': + optional: true + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -1598,85 +2424,149 @@ snapshots: '@rolldown/pluginutils@1.0.1': {} - '@sec-ant/readable-stream@0.4.1': {} + '@rollup/plugin-alias@5.1.1(rollup@4.63.0)': + optionalDependencies: + rollup: 4.63.0 + + '@rollup/plugin-commonjs@28.0.9(rollup@4.63.0)': + dependencies: + '@rollup/pluginutils': 5.4.0(rollup@4.63.0) + commondir: 1.0.1 + estree-walker: 2.0.2 + fdir: 6.5.0(picomatch@4.0.7) + is-reference: 1.2.1 + magic-string: 0.30.21 + picomatch: 4.0.7 + optionalDependencies: + rollup: 4.63.0 + + '@rollup/plugin-json@6.1.0(rollup@4.63.0)': + dependencies: + '@rollup/pluginutils': 5.4.0(rollup@4.63.0) + optionalDependencies: + rollup: 4.63.0 + + '@rollup/plugin-node-resolve@16.0.3(rollup@4.63.0)': + dependencies: + '@rollup/pluginutils': 5.4.0(rollup@4.63.0) + '@types/resolve': 1.20.2 + deepmerge: 4.3.1 + is-module: 1.0.0 + resolve: 1.22.12 + optionalDependencies: + rollup: 4.63.0 + + '@rollup/plugin-replace@6.0.3(rollup@4.63.0)': + dependencies: + '@rollup/pluginutils': 5.4.0(rollup@4.63.0) + magic-string: 0.30.21 + optionalDependencies: + rollup: 4.63.0 - '@sindresorhus/merge-streams@4.0.0': {} + '@rollup/pluginutils@5.4.0(rollup@4.63.0)': + dependencies: + '@types/estree': 1.0.9 + estree-walker: 2.0.2 + picomatch: 4.0.7 + optionalDependencies: + rollup: 4.63.0 - '@standard-schema/spec@1.1.0': {} + '@rollup/rollup-android-arm-eabi@4.63.0': + optional: true - '@types/chai@5.2.3': - dependencies: - '@types/deep-eql': 4.0.2 - assertion-error: 2.0.1 + '@rollup/rollup-android-arm64@4.63.0': + optional: true - '@types/deep-eql@4.0.2': {} + '@rollup/rollup-darwin-arm64@4.63.0': + optional: true - '@types/estree@1.0.9': {} + '@rollup/rollup-darwin-x64@4.63.0': + optional: true - '@types/node@26.4.0': - dependencies: - undici-types: 8.3.0 + '@rollup/rollup-freebsd-arm64@4.63.0': + optional: true - '@typescript/typescript-aix-ppc64@7.0.2': + '@rollup/rollup-freebsd-x64@4.63.0': optional: true - '@typescript/typescript-darwin-arm64@7.0.2': + '@rollup/rollup-linux-arm-gnueabihf@4.63.0': optional: true - '@typescript/typescript-darwin-x64@7.0.2': + '@rollup/rollup-linux-arm-musleabihf@4.63.0': optional: true - '@typescript/typescript-freebsd-arm64@7.0.2': + '@rollup/rollup-linux-arm64-gnu@4.63.0': optional: true - '@typescript/typescript-freebsd-x64@7.0.2': + '@rollup/rollup-linux-arm64-musl@4.63.0': optional: true - '@typescript/typescript-linux-arm64@7.0.2': + '@rollup/rollup-linux-loong64-gnu@4.63.0': optional: true - '@typescript/typescript-linux-arm@7.0.2': + '@rollup/rollup-linux-loong64-musl@4.63.0': optional: true - '@typescript/typescript-linux-loong64@7.0.2': + '@rollup/rollup-linux-ppc64-gnu@4.63.0': optional: true - '@typescript/typescript-linux-mips64el@7.0.2': + '@rollup/rollup-linux-ppc64-musl@4.63.0': optional: true - '@typescript/typescript-linux-ppc64@7.0.2': + '@rollup/rollup-linux-riscv64-gnu@4.63.0': optional: true - '@typescript/typescript-linux-riscv64@7.0.2': + '@rollup/rollup-linux-riscv64-musl@4.63.0': optional: true - '@typescript/typescript-linux-s390x@7.0.2': + '@rollup/rollup-linux-s390x-gnu@4.63.0': optional: true - '@typescript/typescript-linux-x64@7.0.2': + '@rollup/rollup-linux-x64-gnu@4.63.0': optional: true - '@typescript/typescript-netbsd-arm64@7.0.2': + '@rollup/rollup-linux-x64-musl@4.63.0': optional: true - '@typescript/typescript-netbsd-x64@7.0.2': + '@rollup/rollup-openbsd-x64@4.63.0': optional: true - '@typescript/typescript-openbsd-arm64@7.0.2': + '@rollup/rollup-openharmony-arm64@4.63.0': optional: true - '@typescript/typescript-openbsd-x64@7.0.2': + '@rollup/rollup-win32-arm64-msvc@4.63.0': optional: true - '@typescript/typescript-sunos-x64@7.0.2': + '@rollup/rollup-win32-ia32-msvc@4.63.0': optional: true - '@typescript/typescript-win32-arm64@7.0.2': + '@rollup/rollup-win32-x64-gnu@4.63.0': optional: true - '@typescript/typescript-win32-x64@7.0.2': + '@rollup/rollup-win32-x64-msvc@4.63.0': optional: true + '@sec-ant/readable-stream@0.4.1': {} + + '@sindresorhus/merge-streams@4.0.0': {} + + '@standard-schema/spec@1.1.0': {} + + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/deep-eql@4.0.2': {} + + '@types/estree@1.0.9': {} + + '@types/node@26.4.0': + dependencies: + undici-types: 8.3.0 + + '@types/resolve@1.20.2': {} + '@vitest/coverage-v8@4.1.11(vitest@4.1.11)': dependencies: '@bcoe/v8-coverage': 1.0.2 @@ -1689,7 +2579,7 @@ snapshots: obug: 2.1.4 std-env: 4.2.0 tinyrainbow: 3.1.1 - vitest: 4.1.11(@types/node@26.4.0)(@vitest/coverage-v8@4.1.11)(vite@8.2.2(@types/node@26.4.0)(yaml@2.9.0)) + vitest: 4.1.11(@types/node@26.4.0)(@vitest/coverage-v8@4.1.11)(vite@8.2.2(@types/node@26.4.0)(jiti@2.7.0)(yaml@2.9.0)) '@vitest/expect@4.1.11': dependencies: @@ -1700,13 +2590,13 @@ snapshots: chai: 6.2.2 tinyrainbow: 3.1.1 - '@vitest/mocker@4.1.11(vite@8.2.2(@types/node@26.4.0)(yaml@2.9.0))': + '@vitest/mocker@4.1.11(vite@8.2.2(@types/node@26.4.0)(jiti@2.7.0)(yaml@2.9.0))': dependencies: '@vitest/spy': 4.1.11 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 8.2.2(@types/node@26.4.0)(yaml@2.9.0) + vite: 8.2.2(@types/node@26.4.0)(jiti@2.7.0)(yaml@2.9.0) '@vitest/pretty-format@4.1.11': dependencies: @@ -1750,12 +2640,46 @@ snapshots: estree-walker: 3.0.3 js-tokens: 10.0.0 + autoprefixer@10.5.4(postcss@8.5.26): + dependencies: + browserslist: 4.28.8 + caniuse-lite: 1.0.30001810 + fraction.js: 5.3.4 + picocolors: 1.1.1 + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + baseline-browser-mapping@2.11.20: {} + + boolbase@1.0.0: {} + braces@3.0.3: dependencies: fill-range: 7.1.1 + browserslist@4.28.8: + dependencies: + baseline-browser-mapping: 2.11.20 + caniuse-lite: 1.0.30001810 + electron-to-chromium: 1.5.415 + node-releases: 2.0.54 + update-browserslist-db: 1.3.2(browserslist@4.28.8) + + caniuse-api@3.0.0: + dependencies: + browserslist: 4.28.8 + caniuse-lite: 1.0.30001810 + lodash.memoize: 4.1.2 + lodash.uniq: 4.5.0 + + caniuse-lite@1.0.30001810: {} + chai@6.2.2: {} + citty@0.1.6: + dependencies: + consola: 3.4.2 + citty@0.2.2: {} cli-cursor@5.0.0: @@ -1767,22 +2691,163 @@ snapshots: slice-ansi: 9.0.0 string-width: 8.2.2 + commander@11.1.0: {} + commander@15.0.0: {} + commondir@1.0.1: {} + confbox@0.1.8: {} + confbox@0.2.4: {} + + consola@3.4.2: {} + convert-source-map@2.0.0: {} + css-declaration-sorter@7.4.0(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + + css-select@6.0.0: + dependencies: + boolbase: 1.0.0 + css-what: 7.0.0 + domhandler: 5.0.3 + domutils: 3.2.2 + nth-check: 2.1.1 + + css-tree@2.2.1: + dependencies: + mdn-data: 2.0.28 + source-map-js: 1.2.1 + + css-tree@3.2.1: + dependencies: + mdn-data: 2.27.1 + source-map-js: 1.2.1 + + css-what@7.0.0: {} + + cssesc@3.0.0: {} + + cssnano-preset-default@7.0.17(postcss@8.5.26): + dependencies: + browserslist: 4.28.8 + css-declaration-sorter: 7.4.0(postcss@8.5.26) + cssnano-utils: 5.0.3(postcss@8.5.26) + postcss: 8.5.26 + postcss-calc: 10.1.1(postcss@8.5.26) + postcss-colormin: 7.0.10(postcss@8.5.26) + postcss-convert-values: 7.0.12(postcss@8.5.26) + postcss-discard-comments: 7.0.8(postcss@8.5.26) + postcss-discard-duplicates: 7.0.4(postcss@8.5.26) + postcss-discard-empty: 7.0.3(postcss@8.5.26) + postcss-discard-overridden: 7.0.3(postcss@8.5.26) + postcss-merge-longhand: 7.0.7(postcss@8.5.26) + postcss-merge-rules: 7.0.11(postcss@8.5.26) + postcss-minify-font-values: 7.0.3(postcss@8.5.26) + postcss-minify-gradients: 7.0.5(postcss@8.5.26) + postcss-minify-params: 7.0.9(postcss@8.5.26) + postcss-minify-selectors: 7.1.2(postcss@8.5.26) + postcss-normalize-charset: 7.0.3(postcss@8.5.26) + postcss-normalize-display-values: 7.0.3(postcss@8.5.26) + postcss-normalize-positions: 7.0.4(postcss@8.5.26) + postcss-normalize-repeat-style: 7.0.4(postcss@8.5.26) + postcss-normalize-string: 7.0.3(postcss@8.5.26) + postcss-normalize-timing-functions: 7.0.3(postcss@8.5.26) + postcss-normalize-unicode: 7.0.9(postcss@8.5.26) + postcss-normalize-url: 7.0.3(postcss@8.5.26) + postcss-normalize-whitespace: 7.0.3(postcss@8.5.26) + postcss-ordered-values: 7.0.4(postcss@8.5.26) + postcss-reduce-initial: 7.0.9(postcss@8.5.26) + postcss-reduce-transforms: 7.0.3(postcss@8.5.26) + postcss-svgo: 7.1.3(postcss@8.5.26) + postcss-unique-selectors: 7.0.7(postcss@8.5.26) + + cssnano-utils@5.0.3(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + + cssnano@7.1.9(postcss@8.5.26): + dependencies: + cssnano-preset-default: 7.0.17(postcss@8.5.26) + lilconfig: 3.1.3 + postcss: 8.5.26 + + csso@5.0.5: + dependencies: + css-tree: 2.2.1 + deepmerge@4.3.1: {} + defu@6.1.7: {} + detect-libc@2.1.2: {} + dom-serializer@2.0.0: + dependencies: + domelementtype: 2.3.0 + domhandler: 5.0.3 + entities: 4.5.0 + + domelementtype@2.3.0: {} + + domhandler@5.0.3: + dependencies: + domelementtype: 2.3.0 + + domutils@3.2.2: + dependencies: + dom-serializer: 2.0.0 + domelementtype: 2.3.0 + domhandler: 5.0.3 + + electron-to-chromium@1.5.415: {} + empathic@2.0.1: {} + entities@4.5.0: {} + environment@1.1.0: {} + es-errors@1.3.0: {} + es-module-lexer@2.3.2: {} + esbuild@0.25.12: + optionalDependencies: + '@esbuild/aix-ppc64': 0.25.12 + '@esbuild/android-arm': 0.25.12 + '@esbuild/android-arm64': 0.25.12 + '@esbuild/android-x64': 0.25.12 + '@esbuild/darwin-arm64': 0.25.12 + '@esbuild/darwin-x64': 0.25.12 + '@esbuild/freebsd-arm64': 0.25.12 + '@esbuild/freebsd-x64': 0.25.12 + '@esbuild/linux-arm': 0.25.12 + '@esbuild/linux-arm64': 0.25.12 + '@esbuild/linux-ia32': 0.25.12 + '@esbuild/linux-loong64': 0.25.12 + '@esbuild/linux-mips64el': 0.25.12 + '@esbuild/linux-ppc64': 0.25.12 + '@esbuild/linux-riscv64': 0.25.12 + '@esbuild/linux-s390x': 0.25.12 + '@esbuild/linux-x64': 0.25.12 + '@esbuild/netbsd-arm64': 0.25.12 + '@esbuild/netbsd-x64': 0.25.12 + '@esbuild/openbsd-arm64': 0.25.12 + '@esbuild/openbsd-x64': 0.25.12 + '@esbuild/openharmony-arm64': 0.25.12 + '@esbuild/sunos-x64': 0.25.12 + '@esbuild/win32-arm64': 0.25.12 + '@esbuild/win32-ia32': 0.25.12 + '@esbuild/win32-x64': 0.25.12 + + escalade@3.2.0: {} + + estree-walker@2.0.2: {} + estree-walker@3.0.3: dependencies: '@types/estree': 1.0.9 @@ -1804,6 +2869,8 @@ snapshots: expect-type@1.4.0: {} + exsolve@1.1.1: {} + fast-glob@3.3.3: dependencies: '@nodelib/fs.stat': 2.0.5 @@ -1844,9 +2911,19 @@ snapshots: pkg-types: 1.3.1 yaml: 2.9.0 + fix-dts-default-cjs-exports@1.0.1: + dependencies: + magic-string: 0.30.21 + mlly: 1.8.2 + rollup: 4.63.0 + + fraction.js@5.3.4: {} + fsevents@2.3.3: optional: true + function-bind@1.1.2: {} + get-east-asian-width@1.6.0: {} get-stream@9.0.1: @@ -1860,10 +2937,20 @@ snapshots: has-flag@4.0.0: {} + hasown@2.0.4: + dependencies: + function-bind: 1.1.2 + + hookable@5.5.3: {} + html-escaper@2.0.2: {} human-signals@8.0.1: {} + is-core-module@2.16.2: + dependencies: + hasown: 2.0.4 + is-extglob@2.1.1: {} is-fullwidth-code-point@5.1.0: @@ -1874,10 +2961,16 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-module@1.0.0: {} + is-number@7.0.0: {} is-plain-obj@4.1.0: {} + is-reference@1.2.1: + dependencies: + '@types/estree': 1.0.9 + is-stream@4.0.1: {} is-unicode-supported@2.1.0: {} @@ -1895,10 +2988,16 @@ snapshots: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 + jiti@1.21.7: {} + + jiti@2.7.0: {} + js-tokens@10.0.0: {} jsonc-parser@3.3.1: {} + knitwork@1.3.0: {} + lightningcss-android-arm64@1.33.0: optional: true @@ -1948,6 +3047,8 @@ snapshots: lightningcss-win32-arm64-msvc: 1.33.0 lightningcss-win32-x64-msvc: 1.33.0 + lilconfig@3.1.3: {} + lint-staged@17.4.1: dependencies: picomatch: 4.0.7 @@ -1956,6 +3057,10 @@ snapshots: optionalDependencies: yaml: 2.9.0 + lodash.memoize@4.1.2: {} + + lodash.uniq@4.5.0: {} + log-update@8.0.0: dependencies: ansi-escapes: 7.3.0 @@ -1979,6 +3084,10 @@ snapshots: dependencies: semver: 7.8.5 + mdn-data@2.0.28: {} + + mdn-data@2.27.1: {} + merge2@1.4.1: {} micromatch@4.0.8: @@ -1988,6 +3097,24 @@ snapshots: mimic-function@5.0.1: {} + mkdist@2.4.1(typescript@6.0.3): + dependencies: + autoprefixer: 10.5.4(postcss@8.5.26) + citty: 0.1.6 + cssnano: 7.1.9(postcss@8.5.26) + defu: 6.1.7 + esbuild: 0.25.12 + jiti: 1.21.7 + mlly: 1.8.2 + pathe: 2.0.3 + pkg-types: 2.3.1 + postcss: 8.5.26 + postcss-nested: 7.0.2(postcss@8.5.26) + semver: 7.8.5 + tinyglobby: 0.2.17 + optionalDependencies: + typescript: 6.0.3 + mlly@1.8.2: dependencies: acorn: 8.18.0 @@ -1997,11 +3124,17 @@ snapshots: nanoid@3.3.18: {} + node-releases@2.0.54: {} + npm-run-path@6.0.0: dependencies: path-key: 4.0.0 unicorn-magic: 0.3.0 + nth-check@2.1.1: + dependencies: + boolbase: 1.0.0 + nypm@0.6.9: dependencies: citty: 0.2.2 @@ -2064,6 +3197,8 @@ snapshots: path-key@4.0.0: {} + path-parse@1.0.7: {} + pathe@2.0.3: {} picocolors@1.1.1: {} @@ -2078,12 +3213,183 @@ snapshots: mlly: 1.8.2 pathe: 2.0.3 + pkg-types@2.3.1: + dependencies: + confbox: 0.2.4 + exsolve: 1.1.1 + pathe: 2.0.3 + + postcss-calc@10.1.1(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-selector-parser: 7.1.5 + postcss-value-parser: 4.2.0 + + postcss-colormin@7.0.10(postcss@8.5.26): + dependencies: + '@colordx/core': 5.6.0 + browserslist: 4.28.8 + caniuse-api: 3.0.0 + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-convert-values@7.0.12(postcss@8.5.26): + dependencies: + browserslist: 4.28.8 + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-discard-comments@7.0.8(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-selector-parser: 7.1.5 + + postcss-discard-duplicates@7.0.4(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + + postcss-discard-empty@7.0.3(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + + postcss-discard-overridden@7.0.3(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + + postcss-merge-longhand@7.0.7(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + stylehacks: 7.0.11(postcss@8.5.26) + + postcss-merge-rules@7.0.11(postcss@8.5.26): + dependencies: + browserslist: 4.28.8 + caniuse-api: 3.0.0 + cssnano-utils: 5.0.3(postcss@8.5.26) + postcss: 8.5.26 + postcss-selector-parser: 7.1.5 + + postcss-minify-font-values@7.0.3(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-minify-gradients@7.0.5(postcss@8.5.26): + dependencies: + '@colordx/core': 5.6.0 + cssnano-utils: 5.0.3(postcss@8.5.26) + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-minify-params@7.0.9(postcss@8.5.26): + dependencies: + browserslist: 4.28.8 + cssnano-utils: 5.0.3(postcss@8.5.26) + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-minify-selectors@7.1.2(postcss@8.5.26): + dependencies: + browserslist: 4.28.8 + caniuse-api: 3.0.0 + cssesc: 3.0.0 + postcss: 8.5.26 + postcss-selector-parser: 7.1.5 + + postcss-nested@7.0.2(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-selector-parser: 7.1.5 + + postcss-normalize-charset@7.0.3(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + + postcss-normalize-display-values@7.0.3(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-normalize-positions@7.0.4(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-normalize-repeat-style@7.0.4(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-normalize-string@7.0.3(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-normalize-timing-functions@7.0.3(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-normalize-unicode@7.0.9(postcss@8.5.26): + dependencies: + browserslist: 4.28.8 + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-normalize-url@7.0.3(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-normalize-whitespace@7.0.3(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-ordered-values@7.0.4(postcss@8.5.26): + dependencies: + cssnano-utils: 5.0.3(postcss@8.5.26) + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-reduce-initial@7.0.9(postcss@8.5.26): + dependencies: + browserslist: 4.28.8 + caniuse-api: 3.0.0 + postcss: 8.5.26 + + postcss-reduce-transforms@7.0.3(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + + postcss-selector-parser@7.1.5: + dependencies: + cssesc: 3.0.0 + util-deprecate: 1.0.2 + + postcss-svgo@7.1.3(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-value-parser: 4.2.0 + svgo: 4.1.0 + + postcss-unique-selectors@7.0.7(postcss@8.5.26): + dependencies: + postcss: 8.5.26 + postcss-selector-parser: 7.1.5 + + postcss-value-parser@4.2.0: {} + postcss@8.5.26: dependencies: nanoid: 3.3.18 picocolors: 1.1.1 source-map-js: 1.2.1 + pretty-bytes@7.1.1: {} + pretty-ms@9.3.0: dependencies: parse-ms: 4.0.0 @@ -2092,6 +3398,13 @@ snapshots: resolve.exports@2.0.3: {} + resolve@1.22.12: + dependencies: + es-errors: 1.3.0 + is-core-module: 2.16.2 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + restore-cursor@5.1.0: dependencies: onetime: 7.0.0 @@ -2120,10 +3433,57 @@ snapshots: '@rolldown/binding-win32-arm64-msvc': 1.2.6 '@rolldown/binding-win32-x64-msvc': 1.2.6 + rollup-plugin-dts@6.5.1(rollup@4.63.0)(typescript@6.0.3): + dependencies: + '@jridgewell/remapping': 2.3.5 + '@jridgewell/sourcemap-codec': 1.5.5 + convert-source-map: 2.0.0 + magic-string: 0.30.21 + rollup: 4.63.0 + typescript: 6.0.3 + optionalDependencies: + '@babel/code-frame': 8.0.0 + + rollup@4.63.0: + dependencies: + '@types/estree': 1.0.9 + optionalDependencies: + '@napi-rs/lzma-linux-x64-gnu': 1.5.1 + '@rollup/rollup-android-arm-eabi': 4.63.0 + '@rollup/rollup-android-arm64': 4.63.0 + '@rollup/rollup-darwin-arm64': 4.63.0 + '@rollup/rollup-darwin-x64': 4.63.0 + '@rollup/rollup-freebsd-arm64': 4.63.0 + '@rollup/rollup-freebsd-x64': 4.63.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.63.0 + '@rollup/rollup-linux-arm-musleabihf': 4.63.0 + '@rollup/rollup-linux-arm64-gnu': 4.63.0 + '@rollup/rollup-linux-arm64-musl': 4.63.0 + '@rollup/rollup-linux-loong64-gnu': 4.63.0 + '@rollup/rollup-linux-loong64-musl': 4.63.0 + '@rollup/rollup-linux-ppc64-gnu': 4.63.0 + '@rollup/rollup-linux-ppc64-musl': 4.63.0 + '@rollup/rollup-linux-riscv64-gnu': 4.63.0 + '@rollup/rollup-linux-riscv64-musl': 4.63.0 + '@rollup/rollup-linux-s390x-gnu': 4.63.0 + '@rollup/rollup-linux-x64-gnu': 4.63.0 + '@rollup/rollup-linux-x64-musl': 4.63.0 + '@rollup/rollup-openbsd-x64': 4.63.0 + '@rollup/rollup-openharmony-arm64': 4.63.0 + '@rollup/rollup-win32-arm64-msvc': 4.63.0 + '@rollup/rollup-win32-ia32-msvc': 4.63.0 + '@rollup/rollup-win32-x64-gnu': 4.63.0 + '@rollup/rollup-win32-x64-msvc': 4.63.0 + fsevents: 2.3.3 + run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 + sax@1.6.1: {} + + scule@1.3.0: {} + semver@7.8.5: {} sherif-darwin-arm64@1.13.0: @@ -2193,10 +3553,28 @@ snapshots: strip-final-newline@4.0.0: {} + stylehacks@7.0.11(postcss@8.5.26): + dependencies: + browserslist: 4.28.8 + postcss: 8.5.26 + postcss-selector-parser: 7.1.5 + supports-color@7.2.0: dependencies: has-flag: 4.0.0 + supports-preserve-symlinks-flag@1.0.0: {} + + svgo@4.1.0: + dependencies: + commander: 11.1.0 + css-select: 6.0.0 + css-tree: 3.2.1 + css-what: 7.0.0 + csso: 5.0.5 + picocolors: 1.1.1 + sax: 1.6.1 + tinybench@2.9.0: {} tinyexec@1.3.0: {} @@ -2214,28 +3592,7 @@ snapshots: dependencies: is-number: 7.0.0 - typescript@7.0.2: - optionalDependencies: - '@typescript/typescript-aix-ppc64': 7.0.2 - '@typescript/typescript-darwin-arm64': 7.0.2 - '@typescript/typescript-darwin-x64': 7.0.2 - '@typescript/typescript-freebsd-arm64': 7.0.2 - '@typescript/typescript-freebsd-x64': 7.0.2 - '@typescript/typescript-linux-arm': 7.0.2 - '@typescript/typescript-linux-arm64': 7.0.2 - '@typescript/typescript-linux-loong64': 7.0.2 - '@typescript/typescript-linux-mips64el': 7.0.2 - '@typescript/typescript-linux-ppc64': 7.0.2 - '@typescript/typescript-linux-riscv64': 7.0.2 - '@typescript/typescript-linux-s390x': 7.0.2 - '@typescript/typescript-linux-x64': 7.0.2 - '@typescript/typescript-netbsd-arm64': 7.0.2 - '@typescript/typescript-netbsd-x64': 7.0.2 - '@typescript/typescript-openbsd-arm64': 7.0.2 - '@typescript/typescript-openbsd-x64': 7.0.2 - '@typescript/typescript-sunos-x64': 7.0.2 - '@typescript/typescript-win32-arm64': 7.0.2 - '@typescript/typescript-win32-x64': 7.0.2 + typescript@6.0.3: {} ufo@1.6.4: {} @@ -2261,11 +3618,62 @@ snapshots: oxfmt: 0.65.0 oxlint: 1.80.0 + unbuild@3.6.1(typescript@6.0.3): + dependencies: + '@rollup/plugin-alias': 5.1.1(rollup@4.63.0) + '@rollup/plugin-commonjs': 28.0.9(rollup@4.63.0) + '@rollup/plugin-json': 6.1.0(rollup@4.63.0) + '@rollup/plugin-node-resolve': 16.0.3(rollup@4.63.0) + '@rollup/plugin-replace': 6.0.3(rollup@4.63.0) + '@rollup/pluginutils': 5.4.0(rollup@4.63.0) + citty: 0.1.6 + consola: 3.4.2 + defu: 6.1.7 + esbuild: 0.25.12 + fix-dts-default-cjs-exports: 1.0.1 + hookable: 5.5.3 + jiti: 2.7.0 + magic-string: 0.30.21 + mkdist: 2.4.1(typescript@6.0.3) + mlly: 1.8.2 + pathe: 2.0.3 + pkg-types: 2.3.1 + pretty-bytes: 7.1.1 + rollup: 4.63.0 + rollup-plugin-dts: 6.5.1(rollup@4.63.0)(typescript@6.0.3) + scule: 1.3.0 + tinyglobby: 0.2.17 + untyped: 2.0.0 + optionalDependencies: + typescript: 6.0.3 + transitivePeerDependencies: + - '@typescript/typescript6' + - sass + - vue + - vue-sfc-transformer + - vue-tsc + undici-types@8.3.0: {} unicorn-magic@0.3.0: {} - vite@8.2.2(@types/node@26.4.0)(yaml@2.9.0): + untyped@2.0.0: + dependencies: + citty: 0.1.6 + defu: 6.1.7 + jiti: 2.7.0 + knitwork: 1.3.0 + scule: 1.3.0 + + update-browserslist-db@1.3.2(browserslist@4.28.8): + dependencies: + browserslist: 4.28.8 + escalade: 3.2.0 + picocolors: 1.1.1 + + util-deprecate@1.0.2: {} + + vite@8.2.2(@types/node@26.4.0)(jiti@2.7.0)(yaml@2.9.0): dependencies: lightningcss: 1.33.0 picomatch: 4.0.7 @@ -2275,12 +3683,13 @@ snapshots: optionalDependencies: '@types/node': 26.4.0 fsevents: 2.3.3 + jiti: 2.7.0 yaml: 2.9.0 - vitest@4.1.11(@types/node@26.4.0)(@vitest/coverage-v8@4.1.11)(vite@8.2.2(@types/node@26.4.0)(yaml@2.9.0)): + vitest@4.1.11(@types/node@26.4.0)(@vitest/coverage-v8@4.1.11)(vite@8.2.2(@types/node@26.4.0)(jiti@2.7.0)(yaml@2.9.0)): dependencies: '@vitest/expect': 4.1.11 - '@vitest/mocker': 4.1.11(vite@8.2.2(@types/node@26.4.0)(yaml@2.9.0)) + '@vitest/mocker': 4.1.11(vite@8.2.2(@types/node@26.4.0)(jiti@2.7.0)(yaml@2.9.0)) '@vitest/pretty-format': 4.1.11 '@vitest/runner': 4.1.11 '@vitest/snapshot': 4.1.11 @@ -2297,7 +3706,7 @@ snapshots: tinyexec: 1.3.0 tinyglobby: 0.2.17 tinyrainbow: 3.1.1 - vite: 8.2.2(@types/node@26.4.0)(yaml@2.9.0) + vite: 8.2.2(@types/node@26.4.0)(jiti@2.7.0)(yaml@2.9.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 26.4.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 6959a77..3e5baad 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -9,4 +9,5 @@ linkWorkspacePackages: true preferWorkspacePackages: true allowBuilds: + esbuild: true simple-git-hooks: false diff --git a/tsconfig.lib.json b/tsconfig.lib.json index 320251d..7970b84 100644 --- a/tsconfig.lib.json +++ b/tsconfig.lib.json @@ -3,7 +3,7 @@ "extends": "./tsconfig.base.json", "compilerOptions": { "composite": true, - "lib": ["ES2022", "DOM", "DOM.Iterable"], + "lib": ["ES2022"], "declaration": true, "declarationMap": true, "emitDeclarationOnly": true,