From fc5ba6e1f627ddb56f158718bc257455b0f4511b Mon Sep 17 00:00:00 2001 From: Dinh Le Date: Sun, 6 Sep 2026 10:48:52 +0700 Subject: [PATCH] chore: migrate linter to @antfu/eslint-config Replaces oxlint, oxfmt, and ultracite with the ESLint setup used by middleapi/orpc: @antfu/eslint-config with formatters, eslint-driven lint-staged and CI, and matching Zed and Claude hook settings. Top-level arrow-function consts become function declarations, and the oxlint-only disable directives are dropped. --- .claude/settings.json | 10 +- .github/dependabot.yml | 14 +- .github/workflows/ci.yaml | 2 +- .github/workflows/sponsors-sync.yaml | 4 +- .zed/settings.json | 106 +- eslint.config.js | 17 + oxfmt.config.ts | 6 - oxlint.config.ts | 8 - package.json | 18 +- packages/downgrader/README.md | 72 +- packages/downgrader/package.json | 30 +- packages/downgrader/src/index.ts | 4 +- packages/downgrader/src/shared.test.ts | 658 ++-- packages/downgrader/src/shared.ts | 166 +- packages/downgrader/src/v3.1-to-v3.0.test.ts | 1417 ++++---- packages/downgrader/src/v3.1-to-v3.0.ts | 593 ++-- packages/downgrader/src/v3.2-to-v3.1.test.ts | 1452 ++++---- packages/downgrader/src/v3.2-to-v3.1.ts | 449 ++- packages/downgrader/tests/corpus.test.ts | 402 ++- packages/downgrader/tests/e2e.test.ts | 588 ++-- packages/downgrader/tsconfig.json | 6 +- packages/types/README.md | 17 +- packages/types/package.json | 30 +- packages/types/src/index.ts | 6 +- packages/types/src/v3.0.test-d.ts | 400 +-- packages/types/src/v3.0.ts | 436 +-- packages/types/src/v3.1.test-d.ts | 159 +- packages/types/src/v3.1.ts | 400 +-- packages/types/src/v3.2.test-d.ts | 208 +- packages/types/src/v3.2.ts | 506 +-- .../types/tests/examples/3-2-query-example.ts | 95 +- .../types/tests/examples/3-2-tags-example.ts | 75 +- .../tests/examples/api-with-examples-3-0.ts | 161 +- .../tests/examples/callback-example-3-0.ts | 67 +- .../types/tests/examples/link-example-3-0.ts | 217 +- .../tests/examples/non-oauth-scopes-3-1.ts | 23 +- packages/types/tests/examples/petstore-3-0.ts | 129 +- .../tests/examples/petstore-expanded-3-0.ts | 177 +- .../types/tests/examples/tictactoe-3-1.ts | 193 +- packages/types/tests/examples/uspto-3-0.ts | 207 +- .../tests/examples/webhook-example-3-1.ts | 33 +- .../callback-object-examples.ts | 35 +- .../tests/schema-tests-3.1/comp-pathitems.ts | 11 +- .../components-object-example.ts | 79 +- .../example-object-examples.ts | 77 +- .../header-object-examples.ts | 33 +- .../schema-tests-3.1/info-object-example.ts | 31 +- .../tests/schema-tests-3.1/info-summary.ts | 13 +- .../schema-tests-3.1/json-schema-dialect.ts | 23 +- .../schema-tests-3.1/license-identifier.ts | 17 +- .../schema-tests-3.1/link-object-examples.ts | 69 +- .../schema-tests-3.1/media-type-examples.ts | 115 +- packages/types/tests/schema-tests-3.1/mega.ts | 61 +- .../tests/schema-tests-3.1/minimal-comp.ts | 11 +- .../tests/schema-tests-3.1/minimal-hooks.ts | 11 +- .../tests/schema-tests-3.1/minimal-paths.ts | 11 +- .../schema-tests-3.1/non-oauth-scopes.ts | 23 +- .../operation-object-example.ts | 59 +- .../parameter-object-examples.ts | 77 +- .../parameter-object-query-allow-reserved.ts | 15 +- .../path-item-object-example.ts | 47 +- .../path-item-servers-parameters.ts | 107 +- .../schema-tests-3.1/path-no-response.ts | 13 +- .../path-var-empty-pathitem.ts | 13 +- .../schema-tests-3.1/paths-object-example.ts | 25 +- .../schema-tests-3.1/request-body-examples.ts | 43 +- .../response-object-examples.ts | 61 +- ...chema-object-deprecated-example-keyword.ts | 19 +- .../types/tests/schema-tests-3.1/schema.ts | 53 +- .../security-scheme-object-examples.ts | 87 +- .../types/tests/schema-tests-3.1/servers.ts | 33 +- .../specification-extensions.ts | 17 +- .../tests/schema-tests-3.1/style-defaults.ts | 183 +- .../schema-tests-3.1/tag-object-example.ts | 23 +- .../schema-tests-3.1/valid-schema-types.ts | 11 +- .../tests/schema-tests-3.1/webhook-example.ts | 31 +- .../callback-object-examples.ts | 35 +- .../tests/schema-tests-3.2/comp-pathitems.ts | 11 +- .../components-object-example.ts | 79 +- .../example-object-examples.ts | 79 +- .../header-object-examples.ts | 33 +- .../schema-tests-3.2/info-object-example.ts | 33 +- .../tests/schema-tests-3.2/info-summary.ts | 13 +- .../schema-tests-3.2/json-schema-dialect.ts | 23 +- .../schema-tests-3.2/license-identifier.ts | 17 +- .../schema-tests-3.2/link-object-examples.ts | 69 +- .../schema-tests-3.2/media-type-examples.ts | 165 +- packages/types/tests/schema-tests-3.2/mega.ts | 63 +- .../tests/schema-tests-3.2/minimal-comp.ts | 11 +- .../tests/schema-tests-3.2/minimal-hooks.ts | 11 +- .../tests/schema-tests-3.2/minimal-paths.ts | 11 +- .../schema-tests-3.2/non-oauth-scopes.ts | 23 +- .../operation-object-example.ts | 59 +- ...meter-object-cookie-form-allow-reserved.ts | 21 +- .../parameter-object-examples.ts | 93 +- .../parameter-object-path-allow-reserved.ts | 15 +- .../parameter-object-query-allow-reserved.ts | 15 +- .../path-item-object-example.ts | 91 +- .../path-item-servers-parameters.ts | 107 +- .../schema-tests-3.2/path-no-response.ts | 13 +- .../path-var-empty-pathitem.ts | 13 +- .../schema-tests-3.2/paths-object-example.ts | 25 +- .../schema-tests-3.2/request-body-examples.ts | 43 +- .../response-object-examples.ts | 63 +- ...chema-object-deprecated-example-keyword.ts | 19 +- .../types/tests/schema-tests-3.2/schema.ts | 53 +- .../security-scheme-object-examples.ts | 99 +- .../types/tests/schema-tests-3.2/servers.ts | 35 +- .../specification-extensions.ts | 17 +- .../tests/schema-tests-3.2/style-defaults.ts | 189 +- .../schema-tests-3.2/tag-object-example.ts | 41 +- .../schema-tests-3.2/valid-schema-types.ts | 11 +- .../tests/schema-tests-3.2/webhook-example.ts | 31 +- pnpm-lock.yaml | 3109 ++++++++++++++--- pnpm-workspace.yaml | 4 +- scripts/sync-sponsors.ts | 302 +- vitest.config.ts | 12 +- 117 files changed, 9128 insertions(+), 7126 deletions(-) create mode 100644 eslint.config.js delete mode 100644 oxfmt.config.ts delete mode 100644 oxlint.config.ts diff --git a/.claude/settings.json b/.claude/settings.json index ac9bb6d..7a4c300 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -2,13 +2,15 @@ "hooks": { "PostToolUse": [ { + "matcher": "Write|Edit", "hooks": [ { - "command": "pnpm run lint:fix", - "type": "command" + "type": "command", + "command": "jq -r '.tool_input.file_path // .tool_response.filePath' | { read -r f; ./node_modules/.bin/eslint --no-warn-ignored --max-warnings=0 --fix \"$f\"; } 2>/dev/null || true", + "timeout": 30, + "statusMessage": "Running eslint --fix" } - ], - "matcher": "Write|Edit" + ] } ] } diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2031874..4549829 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,17 +10,17 @@ updates: default-days: 1 versioning-strategy: increase groups: - linter: + eslint: patterns: - - oxfmt - - oxlint - - ultracite + - eslint + - '@antfu/eslint-config' + - 'eslint-plugin-*' dev-dependencies-minor-patch: dependency-type: development exclude-patterns: - - oxfmt - - oxlint - - ultracite + - eslint + - '@antfu/eslint-config' + - 'eslint-plugin-*' update-types: - minor - patch diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6e7dec0..aa0ebbc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: - run: pnpm i - - run: pnpm run lint:check + - run: pnpm run lint - run: pnpm run type:check diff --git a/.github/workflows/sponsors-sync.yaml b/.github/workflows/sponsors-sync.yaml index 33eb676..2783895 100644 --- a/.github/workflows/sponsors-sync.yaml +++ b/.github/workflows/sponsors-sync.yaml @@ -2,7 +2,7 @@ name: Sponsors Sync on: schedule: - - cron: "0 1 * * *" + - cron: '0 1 * * *' workflow_dispatch: jobs: @@ -23,6 +23,6 @@ jobs: with: author_name: GitHub Actions author_email: 41898282+github-actions[bot]@users.noreply.github.com - message: "chore: sync sponsors" + message: 'chore: sync sponsors' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.zed/settings.json b/.zed/settings.json index e5611e4..13410e9 100644 --- a/.zed/settings.json +++ b/.zed/settings.json @@ -1,6 +1,36 @@ { "format_on_save": "on", - "formatter": "language_server", + // Use ESLint's --fix: + "code_actions_on_format": { + "source.fixAll.eslint": true + }, + "formatter": [], + // Enable eslint for all supported languages + // Defaults only include https://github.com/search?q=repo%3Azed-industries%2Fzed%20eslint_languages&type=code + "languages": { + "HTML": { + "language_servers": ["...", "eslint"] + }, + "Markdown": { + "language_servers": ["...", "eslint"] + }, + "Markdown-Inline": { + "language_servers": ["...", "eslint"] + }, + "JSON": { + "language_servers": ["...", "eslint"] + }, + "JSONC": { + "language_servers": ["...", "eslint"] + }, + "YAML": { + "language_servers": ["...", "eslint"] + }, + "CSS": { + "language_servers": ["...", "eslint"] + } + // Add other languages as needed + }, "lsp": { "typescript-language-server": { "settings": { @@ -11,63 +41,23 @@ } } }, - "oxfmt": { - "initialization_options": { - "settings": { - "configPath": null, - "flags": {}, - "fmt.configPath": null, - "fmt.experimental": true, - "run": "onSave", - "typeAware": false, - "unusedDisableDirectives": false - } - } - }, - "oxlint": { - "initialization_options": { - "settings": { - "disableNestedConfig": false, - "fixKind": "safe_fix", - "run": "onType", - "typeAware": true, - "unusedDisableDirectives": "deny" - } - } - } - }, - "languages": { - "JavaScript": { - "code_actions_on_format": { - "source.fixAll.oxc": true, - "source.organizeImports.oxc": true - }, - "formatter": { - "language_server": { - "name": "oxfmt" - } - } - }, - "TSX": { - "code_actions_on_format": { - "source.fixAll.oxc": true, - "source.organizeImports.oxc": true - }, - "formatter": { - "language_server": { - "name": "oxfmt" - } - } - }, - "TypeScript": { - "code_actions_on_format": { - "source.fixAll.oxc": true, - "source.organizeImports.oxc": true - }, - "formatter": { - "language_server": { - "name": "oxfmt" - } + "eslint": { + "settings": { + "workingDirectories": ["./"], + + // Silent the stylistic rules in your IDE, but still auto fix them + "rulesCustomizations": [ + { "rule": "style/*", "severity": "off", "fixable": true }, + { "rule": "format/*", "severity": "off", "fixable": true }, + { "rule": "*-indent", "severity": "off", "fixable": true }, + { "rule": "*-spacing", "severity": "off", "fixable": true }, + { "rule": "*-spaces", "severity": "off", "fixable": true }, + { "rule": "*-order", "severity": "off", "fixable": true }, + { "rule": "*-dangle", "severity": "off", "fixable": true }, + { "rule": "*-newline", "severity": "off", "fixable": true }, + { "rule": "*quotes", "severity": "off", "fixable": true }, + { "rule": "*semi", "severity": "off", "fixable": true } + ] } } } diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..cdfc48c --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,17 @@ +import antfu from '@antfu/eslint-config' + +export default antfu({ + formatters: true, + rules: { + 'yaml/sort-keys': 'off', + 'pnpm/json-enforce-catalog': 'off', + 'pnpm/yaml-enforce-settings': 'off', + 'ts/method-signature-style': 'off', + }, +}, { + files: ['**/*.test.ts', '**/*.test-d.ts'], + rules: { + 'unused-imports/no-unused-vars': 'off', + 'antfu/no-top-level-await': 'off', + }, +}) diff --git a/oxfmt.config.ts b/oxfmt.config.ts deleted file mode 100644 index e9b8afb..0000000 --- a/oxfmt.config.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { defineConfig } from "oxfmt"; -import ultracite from "ultracite/oxfmt"; - -export default defineConfig({ - ...ultracite, -}); diff --git a/oxlint.config.ts b/oxlint.config.ts deleted file mode 100644 index 33e2946..0000000 --- a/oxlint.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "oxlint"; -import antiSlop from "ultracite/oxlint/anti-slop"; -import core from "ultracite/oxlint/core"; - -export default defineConfig({ - extends: [core, antiSlop], - ignorePatterns: core.ignorePatterns, -}); diff --git a/package.json b/package.json index 5bb1ab5..3fc45bc 100644 --- a/package.json +++ b/package.json @@ -1,29 +1,29 @@ { "name": "@openapi-spec/repo", + "type": "module", "version": "0.0.0", "license": "MIT", - "type": "module", "scripts": { "prepare": "simple-git-hooks", "type:check": "pnpm run -r type:check && tsc", "test": "vitest run", "test:coverage": "vitest run --coverage", - "lint:check": "ultracite check", - "lint:fix": "ultracite fix", + "lint": "eslint --max-warnings=0 .", + "lint:fix": "eslint --max-warnings=0 --fix .", "repo:fix": "sherif --fix", - "sync:sponsors": "node scripts/sync-sponsors.ts && git ls-files --modified --others --exclude-standard | xargs -r pnpm run lint:fix --no-error-on-unmatched-pattern" + "sync:sponsors": "node scripts/sync-sponsors.ts && eslint --max-warnings=0 --fix '**/README.md'" }, "devDependencies": { + "@antfu/eslint-config": "^9.5.1", "@seriousme/openapi-schema-validator": "^2.9.1", "@types/node": "^26.4.0", "@vitest/coverage-v8": "^4.1.11", + "eslint": "^10.10.0", + "eslint-plugin-format": "^2.0.1", "lint-staged": "^17.4.1", - "oxfmt": "^0.65.0", - "oxlint": "^1.80.0", "sherif": "^1.13.0", "simple-git-hooks": "^2.13.1", "typescript": "^6.0.3", - "ultracite": "7.10.7", "unbuild": "^3.6.1", "vitest": "^4.1.11" }, @@ -31,9 +31,7 @@ "pre-commit": "pnpm lint-staged" }, "lint-staged": { - "*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}": [ - "pnpm run lint:fix" - ] + "*": "eslint --no-warn-ignored --max-warnings=0 --fix" }, "devEngines": { "packageManager": { diff --git a/packages/downgrader/README.md b/packages/downgrader/README.md index 77824ed..982b364 100644 --- a/packages/downgrader/README.md +++ b/packages/downgrader/README.md @@ -14,16 +14,16 @@ import { downgradeSchemaV32ToV31, downgradeSpecV31ToV30, downgradeSpecV32ToV31, -} from "@openapi-spec/downgrader"; +} from '@openapi-spec/downgrader' -const v31 = downgradeSpecV32ToV31(v32Document); -const v30 = downgradeSpecV31ToV30(v31Document); +const v31 = downgradeSpecV32ToV31(v32Document) +const v30 = downgradeSpecV31ToV30(v31Document) // There is intentionally no direct 3.2 → 3.0 converter; compose the steps: -const downgraded = downgradeSpecV31ToV30(downgradeSpecV32ToV31(v32Document)); +const downgraded = downgradeSpecV31ToV30(downgradeSpecV32ToV31(v32Document)) // Schema Objects can be converted standalone: -const schema = downgradeSchemaV31ToV30({ type: ["string", "null"] }); +const schema = downgradeSchemaV31ToV30({ type: ['string', 'null'] }) // { type: "string", nullable: true } ``` @@ -33,14 +33,14 @@ Schema Objects pass through unchanged: the 3.2 Schema Object keyword set is iden Converted: -| 3.2 construct | 3.1 result | -| --- | --- | -| `openapi: 3.2.x` | `openapi: 3.1.2` | -| `components.mediaTypes` and content-map `$ref`s to them | references inlined, the component map removed; content entries whose reference cannot be inlined (external, unknown, or cyclic targets) are removed, as 3.1 content maps cannot hold references — a parameter or header losing its entire `content` that way is removed with it (3.1 requires exactly one entry there) | -| Media type `itemSchema` without a sibling `schema` | `schema: { type: "array", items: … }` (the 3.2 sequential media type data model) | -| Response `summary` when no `description` exists | promoted to `description` (required in 3.1, so `""` is synthesized as a last resort) | -| Example `dataValue` / `serializedValue` when `value` and `externalValue` are absent | promoted to `value` (in that order) | -| Parameter `style: "cookie"` | removed, letting the 3.1 default `form` apply | +| 3.2 construct | 3.1 result | +| ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `openapi: 3.2.x` | `openapi: 3.1.2` | +| `components.mediaTypes` and content-map `$ref`s to them | references inlined, the component map removed; content entries whose reference cannot be inlined (external, unknown, or cyclic targets) are removed, as 3.1 content maps cannot hold references — a parameter or header losing its entire `content` that way is removed with it (3.1 requires exactly one entry there) | +| Media type `itemSchema` without a sibling `schema` | `schema: { type: "array", items: … }` (the 3.2 sequential media type data model) | +| Response `summary` when no `description` exists | promoted to `description` (required in 3.1, so `""` is synthesized as a last resort) | +| Example `dataValue` / `serializedValue` when `value` and `externalValue` are absent | promoted to `value` (in that order) | +| Parameter `style: "cookie"` | removed, letting the 3.1 default `form` apply | Removed (no 3.1 equivalent): `$self`, server `name`, tag `summary`/`parent`/`kind`, the `query` operation and `additionalOperations` of Path Items, `in: "querystring"` parameters (from parameter lists and `components.parameters`, together with references to the removed component entries, following chains of reference aliases), `allowReserved` on non-query parameters, media type `description`, media type / encoding `prefixEncoding`, `itemEncoding`, and nested `encoding`, a media type `itemSchema` beside an existing `schema`, response `summary` beside an existing `description`, OAuth `deviceAuthorization` flows, and security scheme `oauth2MetadataUrl` and `deprecated`. @@ -50,34 +50,34 @@ Known limitations: security requirements using URI keys and `$self`-relative ref Converted: -| 3.1 construct | 3.0 result | -| --- | --- | -| `openapi: 3.1.x` | `openapi: 3.0.4` | -| missing `paths` | `{}` (required in 3.0) | -| missing operation `responses` | `{ "default": { "description": "" } }` (required and non-empty in 3.0) | -| Reference `summary` / `description` overrides | removed (3.0 references stand alone) | -| Security requirement roles on non-OAuth schemes | emptied (`[]`) | +| 3.1 construct | 3.0 result | +| ----------------------------------------------- | ---------------------------------------------------------------------- | +| `openapi: 3.1.x` | `openapi: 3.0.4` | +| missing `paths` | `{}` (required in 3.0) | +| missing operation `responses` | `{ "default": { "description": "" } }` (required and non-empty in 3.0) | +| Reference `summary` / `description` overrides | removed (3.0 references stand alone) | +| Security requirement roles on non-OAuth schemes | emptied (`[]`) | Removed (no 3.0 equivalent): `webhooks`, `components.pathItems` (local `$ref`s pointing at it are left untouched and will dangle), `jsonSchemaDialect`, `info.summary`, `license.identifier`, and `mutualTLS` security schemes (reference aliases to them included) — their names are stripped from every security requirement, requirements that referenced only such schemes are removed, and a `security` list emptied that way is removed entirely, since an explicit empty list means "no security required" and would make an operation public. Schema Objects: -| 3.1 construct | 3.0 result | -| --- | --- | -| `true` / `false` boolean schemas | `{}` / `{ not: {} }` | -| `$ref` with sibling keywords | siblings kept, `$ref` wrapped into `allOf` | -| `type: ["T", "null"]` | `type: "T"` plus `nullable: true` | -| `enum: []` / duplicate `required` entries | `enum` removed / `required` deduplicated (3.0 requires a non-empty `enum` and unique `required`) | -| `type: "null"` | `nullable: true` plus `enum: [null]`; a sibling `enum`/`const` is intersected with the null type — an `enum` containing `null` collapses to `[null]`, and a sibling excluding `null` yields a match-nothing schema (`not: {}`), since the source accepted no value | -| `type` with several non-null entries | `anyOf` of single-type schemas | -| `const` | single-value `enum` | -| numeric `exclusiveMinimum` / `exclusiveMaximum` | bound plus boolean flag (the tighter bound wins) | -| `examples` | first entry becomes `example` when none exists | -| `contentEncoding: base64` | `format: byte` | -| `contentMediaType: application/octet-stream` | `format: binary` | -| `type: "array"` without `items` | `items: {}` is added (required in 3.0) | -| XML `nodeType` (carried over from a 3.2 chain) | `attribute: true` / `wrapped: true` where expressible, then removed (3.0 forbids unknown XML Object fields) | -| `$schema`, `$id`, `$defs`, `$anchor`, `$dynamicRef`/`$dynamicAnchor`, `$vocabulary`, `$comment`, `if`/`then`/`else`, `dependentSchemas`/`dependentRequired`, `prefixItems` (and its trailing `items`), `contains`/`minContains`/`maxContains`, `patternProperties` (and its sibling `additionalProperties`, whose meaning would otherwise tighten onto the pattern-matched keys), `propertyNames`, `unevaluatedItems`/`unevaluatedProperties`, `contentSchema` | removed — in positive schema positions dropping these only loosens validation, the safe direction for a downgrade | +| 3.1 construct | 3.0 result | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `true` / `false` boolean schemas | `{}` / `{ not: {} }` | +| `$ref` with sibling keywords | siblings kept, `$ref` wrapped into `allOf` | +| `type: ["T", "null"]` | `type: "T"` plus `nullable: true` | +| `enum: []` / duplicate `required` entries | `enum` removed / `required` deduplicated (3.0 requires a non-empty `enum` and unique `required`) | +| `type: "null"` | `nullable: true` plus `enum: [null]`; a sibling `enum`/`const` is intersected with the null type — an `enum` containing `null` collapses to `[null]`, and a sibling excluding `null` yields a match-nothing schema (`not: {}`), since the source accepted no value | +| `type` with several non-null entries | `anyOf` of single-type schemas | +| `const` | single-value `enum` | +| numeric `exclusiveMinimum` / `exclusiveMaximum` | bound plus boolean flag (the tighter bound wins) | +| `examples` | first entry becomes `example` when none exists | +| `contentEncoding: base64` | `format: byte` | +| `contentMediaType: application/octet-stream` | `format: binary` | +| `type: "array"` without `items` | `items: {}` is added (required in 3.0) | +| XML `nodeType` (carried over from a 3.2 chain) | `attribute: true` / `wrapped: true` where expressible, then removed (3.0 forbids unknown XML Object fields) | +| `$schema`, `$id`, `$defs`, `$anchor`, `$dynamicRef`/`$dynamicAnchor`, `$vocabulary`, `$comment`, `if`/`then`/`else`, `dependentSchemas`/`dependentRequired`, `prefixItems` (and its trailing `items`), `contains`/`minContains`/`maxContains`, `patternProperties` (and its sibling `additionalProperties`, whose meaning would otherwise tighten onto the pattern-matched keys), `propertyNames`, `unevaluatedItems`/`unevaluatedProperties`, `contentSchema` | removed — in positive schema positions dropping these only loosens validation, the safe direction for a downgrade | Known limitations: `$ref`s that point into dropped keywords (`#/…/$defs/…` pointers, `$anchor` targets, `$id`-based bases) will dangle — hoist reusable subschemas into `components.schemas` before downgrading. Arbitrary non-standard schema keywords are preserved per the extension-preserving contract, even though the official 3.0 schema forbids unknown Schema Object fields. Dropping keywords inside `not` (where loosening the operand tightens the whole) or inside `oneOf` branches (where loosening one branch can break exclusivity) can shift what validates. diff --git a/packages/downgrader/package.json b/packages/downgrader/package.json index 5ee1a6d..5396da8 100644 --- a/packages/downgrader/package.json +++ b/packages/downgrader/package.json @@ -1,7 +1,19 @@ { "name": "@openapi-spec/downgrader", + "type": "module", "version": "0.0.0", "description": "Downgrade OpenAPI specifications one minor version at a time: 3.2 to 3.1 and 3.1 to 3.0, for whole documents or individual schemas", + "license": "MIT", + "funding": [ + "https://github.com/sponsors/dinwwwh", + "https://opencollective.com/middleapi" + ], + "homepage": "https://github.com/middleapi/openapi-spec", + "repository": { + "type": "git", + "url": "git+https://github.com/middleapi/openapi-spec.git", + "directory": "packages/downgrader" + }, "keywords": [ "converter", "downgrade", @@ -15,21 +27,6 @@ "swagger", "typescript" ], - "homepage": "https://github.com/middleapi/openapi-spec", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/middleapi/openapi-spec.git", - "directory": "packages/downgrader" - }, - "funding": [ - "https://github.com/sponsors/dinwwwh", - "https://opencollective.com/middleapi" - ], - "files": [ - "dist" - ], - "type": "module", "sideEffects": false, "exports": { "./package.json": "./package.json", @@ -37,6 +34,9 @@ "./v3.2-to-v3.1": "./src/v3.2-to-v3.1.ts", "./v3.1-to-v3.0": "./src/v3.1-to-v3.0.ts" }, + "files": [ + "dist" + ], "publishConfig": { "exports": { "./package.json": "./package.json", diff --git a/packages/downgrader/src/index.ts b/packages/downgrader/src/index.ts index ed896e4..cbd8d69 100644 --- a/packages/downgrader/src/index.ts +++ b/packages/downgrader/src/index.ts @@ -1,2 +1,2 @@ -export { downgradeSchemaV31ToV30, downgradeSpecV31ToV30 } from "./v3.1-to-v3.0"; -export { downgradeSchemaV32ToV31, downgradeSpecV32ToV31 } from "./v3.2-to-v3.1"; +export { downgradeSchemaV31ToV30, downgradeSpecV31ToV30 } from './v3.1-to-v3.0' +export { downgradeSchemaV32ToV31, downgradeSpecV32ToV31 } from './v3.2-to-v3.1' diff --git a/packages/downgrader/src/shared.test.ts b/packages/downgrader/src/shared.test.ts index a1a610b..21c41c1 100644 --- a/packages/downgrader/src/shared.test.ts +++ b/packages/downgrader/src/shared.test.ts @@ -1,6 +1,4 @@ -/* oxlint-disable anti-slop/no-unknown-parameters, anti-slop/no-unknown-returns -- the helpers under test are the converters' `unknown`-typed I/O boundary, so the test doubles mirror their signatures */ - -import type { UnknownRecord } from "./shared"; +import type { UnknownRecord } from './shared' import { convertRecord, deepClone, @@ -12,362 +10,364 @@ import { mapRecord, operationFields, setKey, -} from "./shared"; +} from './shared' -const identity = (value: T): T => value; +function identity(value: T): T { + return value +} -const asRecord = (value: unknown): UnknownRecord => - // SAFETY: the helpers return plain objects for plain-object input; the tests inspect their keys. - value as UnknownRecord; +function asRecord(value: unknown): UnknownRecord { + return value as UnknownRecord +} /** A converter that recurses into `self`, so a self-referencing node re-enters convertRecord. */ -const convertNode = (value: unknown): unknown => - convertRecord(value, { - name: () => "converted", - self: (item) => convertNode(item), - }); - -describe("isRecord", () => { - it("returns true for plain object literals", () => { - expect(isRecord({})).toBe(true); - expect(isRecord({ a: 1 })).toBe(true); - }); - - it("returns true for objects with a null prototype", () => { - expect(isRecord(Object.create(null))).toBe(true); - }); - - it("returns false for null", () => { - expect(isRecord(null)).toBe(false); - }); - - it("returns false for arrays", () => { - expect(isRecord([])).toBe(false); - expect(isRecord([1, 2])).toBe(false); - }); - - it("returns false for primitives", () => { - expect(isRecord("text")).toBe(false); - expect(isRecord(42)).toBe(false); - expect(isRecord(true)).toBe(false); - expect(isRecord(Symbol("s"))).toBe(false); - expect(isRecord(10n)).toBe(false); - }); - - it("returns false for class instances", () => { - expect(isRecord(new Date())).toBe(false); - expect(isRecord(new Map())).toBe(false); - }); -}); - -describe("deepClone", () => { - it("deep-copies nested plain objects and arrays without sharing references", () => { +function convertNode(value: unknown): unknown { + return convertRecord(value, { + name: () => 'converted', + self: item => convertNode(item), + }) +} + +describe('isRecord', () => { + it('returns true for plain object literals', () => { + expect(isRecord({})).toBe(true) + expect(isRecord({ a: 1 })).toBe(true) + }) + + it('returns true for objects with a null prototype', () => { + expect(isRecord(Object.create(null))).toBe(true) + }) + + it('returns false for null', () => { + expect(isRecord(null)).toBe(false) + }) + + it('returns false for arrays', () => { + expect(isRecord([])).toBe(false) + expect(isRecord([1, 2])).toBe(false) + }) + + it('returns false for primitives', () => { + expect(isRecord('text')).toBe(false) + expect(isRecord(42)).toBe(false) + expect(isRecord(true)).toBe(false) + expect(isRecord(Symbol('s'))).toBe(false) + expect(isRecord(10n)).toBe(false) + }) + + it('returns false for class instances', () => { + expect(isRecord(new Date())).toBe(false) + expect(isRecord(new Map())).toBe(false) + }) +}) + +describe('deepClone', () => { + it('deep-copies nested plain objects and arrays without sharing references', () => { const input = { list: [{ deep: { value: 1 } }, [2, 3]], - nested: { inner: { leaf: "x" } }, - }; - const clone = deepClone(input); - expect(clone).toEqual(input); - expect(clone).not.toBe(input); - expect(clone.list).not.toBe(input.list); - expect(clone.list[0]).not.toBe(input.list[0]); - expect(clone.list[1]).not.toBe(input.list[1]); - expect(clone.nested).not.toBe(input.nested); - expect(clone.nested.inner).not.toBe(input.nested.inner); - }); - - it("keeps functions and class instances by reference", () => { - const date = new Date(); - const map = new Map(); - const clone = deepClone({ date, fn: identity, map }); - expect(clone.fn).toBe(identity); - expect(clone.date).toBe(date); - expect(clone.map).toBe(map); - }); - - it("returns primitives as-is", () => { - expect(deepClone(1)).toBe(1); - expect(deepClone("a")).toBe("a"); - expect(deepClone(null)).toBe(null); - expect(deepClone(true)).toBe(true); - }); - - it("copies a hostile __proto__ own key as a plain own data property without prototype pollution", () => { - const input: unknown = JSON.parse('{"__proto__": {"polluted": true}}'); - const clone = asRecord(deepClone(input)); - expect(Object.getOwnPropertyNames(clone)).toContain("__proto__"); - expect(Object.getOwnPropertyDescriptor(clone, "__proto__")?.value).toEqual({ + nested: { inner: { leaf: 'x' } }, + } + const clone = deepClone(input) + expect(clone).toEqual(input) + expect(clone).not.toBe(input) + expect(clone.list).not.toBe(input.list) + expect(clone.list[0]).not.toBe(input.list[0]) + expect(clone.list[1]).not.toBe(input.list[1]) + expect(clone.nested).not.toBe(input.nested) + expect(clone.nested.inner).not.toBe(input.nested.inner) + }) + + it('keeps functions and class instances by reference', () => { + const date = new Date() + const map = new Map() + const clone = deepClone({ date, fn: identity, map }) + expect(clone.fn).toBe(identity) + expect(clone.date).toBe(date) + expect(clone.map).toBe(map) + }) + + it('returns primitives as-is', () => { + expect(deepClone(1)).toBe(1) + expect(deepClone('a')).toBe('a') + expect(deepClone(null)).toBe(null) + expect(deepClone(true)).toBe(true) + }) + + it('copies a hostile __proto__ own key as a plain own data property without prototype pollution', () => { + const input: unknown = JSON.parse('{"__proto__": {"polluted": true}}') + const clone = asRecord(deepClone(input)) + expect(Object.getOwnPropertyNames(clone)).toContain('__proto__') + expect(Object.getOwnPropertyDescriptor(clone, '__proto__')?.value).toEqual({ polluted: true, - }); - expect(Object.getPrototypeOf(clone)).toBe(Object.prototype); - expect(asRecord({}).polluted).toBeUndefined(); - }); - - it("preserves key order", () => { - const input: UnknownRecord = {}; - input.zebra = 1; - input.apple = 2; - input.mango = 3; - expect(Object.keys(deepClone(input))).toEqual(["zebra", "apple", "mango"]); - }); - - it("preserves object cycles instead of recursing forever", () => { - const child: UnknownRecord = {}; - const node: UnknownRecord = { child, name: "root" }; - child.parent = node; - const clone = deepClone(node); - expect(clone).not.toBe(node); - expect(clone.name).toBe("root"); - expect(asRecord(clone.child).parent).toBe(clone); - }); - - it("preserves array cycles", () => { - const list: unknown[] = [1]; - list.push(list); - const clone = deepClone(list); - expect(clone).not.toBe(list); - expect(clone[0]).toBe(1); - expect(clone[1]).toBe(clone); - }); - - it("clones shared references once", () => { - const shared = { a: 1 }; - const clone = deepClone({ x: shared, y: shared }); - expect(clone.x).toEqual({ a: 1 }); - expect(clone.x).not.toBe(shared); - expect(clone.x).toBe(clone.y); - }); -}); - -describe("convertRecord", () => { - it("routes listed fields through their converters and deep-clones the rest", () => { - const extra = { deep: true }; + }) + expect(Object.getPrototypeOf(clone)).toBe(Object.prototype) + expect(asRecord({}).polluted).toBeUndefined() + }) + + it('preserves key order', () => { + const input: UnknownRecord = {} + input.zebra = 1 + input.apple = 2 + input.mango = 3 + expect(Object.keys(deepClone(input))).toEqual(['zebra', 'apple', 'mango']) + }) + + it('preserves object cycles instead of recursing forever', () => { + const child: UnknownRecord = {} + const node: UnknownRecord = { child, name: 'root' } + child.parent = node + const clone = deepClone(node) + expect(clone).not.toBe(node) + expect(clone.name).toBe('root') + expect(asRecord(clone.child).parent).toBe(clone) + }) + + it('preserves array cycles', () => { + const list: unknown[] = [1] + list.push(list) + const clone = deepClone(list) + expect(clone).not.toBe(list) + expect(clone[0]).toBe(1) + expect(clone[1]).toBe(clone) + }) + + it('clones shared references once', () => { + const shared = { a: 1 } + const clone = deepClone({ x: shared, y: shared }) + expect(clone.x).toEqual({ a: 1 }) + expect(clone.x).not.toBe(shared) + expect(clone.x).toBe(clone.y) + }) +}) + +describe('convertRecord', () => { + it('routes listed fields through their converters and deep-clones the rest', () => { + const extra = { deep: true } const result = asRecord( convertRecord( { a: 1, b: 2, extra }, - { a: (item) => [item], b: () => "converted" } - ) - ); - expect(result).toEqual({ a: [1], b: "converted", extra: { deep: true } }); - expect(result.extra).not.toBe(extra); - }); - - it("removes fields mapped to DROP and fields whose converter returns DROP", () => { + { a: item => [item], b: () => 'converted' }, + ), + ) + expect(result).toEqual({ a: [1], b: 'converted', extra: { deep: true } }) + expect(result.extra).not.toBe(extra) + }) + + it('removes fields mapped to DROP and fields whose converter returns DROP', () => { const result = convertRecord( { gone: 1, kept: 2, maybe: 3 }, - { gone: DROP, maybe: (item) => (item === 3 ? DROP : item) } - ); - expect(result).toEqual({ kept: 2 }); - }); + { gone: DROP, maybe: item => (item === 3 ? DROP : item) }, + ) + expect(result).toEqual({ kept: 2 }) + }) - it("passes the whole source record to converters and to finish", () => { - const source = { flag: true, value: 1 }; + it('passes the whole source record to converters and to finish', () => { + const source = { flag: true, value: 1 } const result = convertRecord( source, { value: (item, record) => (record.flag ? item : DROP) }, - (out, record) => ({ ...out, sameSource: record === source }) - ); - expect(result).toEqual({ flag: true, sameSource: true, value: 1 }); - }); - - it("lets finish replace the whole result", () => { - expect(convertRecord({ a: 1 }, {}, () => DROP)).toBe(DROP); - }); - - it("preserves key order", () => { - const input: UnknownRecord = {}; - input.zebra = 1; - input.apple = 2; - input.mango = 3; - const result = asRecord(convertRecord(input, { apple: identity })); - expect(Object.keys(result)).toEqual(["zebra", "apple", "mango"]); - }); - - it("deep-clones non-object input without consulting the table", () => { - const convert = vi.fn(identity); - const list = [{ a: 1 }]; - const result = convertRecord(list, { a: convert }); - expect(result).toEqual(list); - expect(result).not.toBe(list); - expect(convertRecord("text", { a: convert })).toBe("text"); - expect(convertRecord(null, { a: convert })).toBe(null); - expect(convert).not.toHaveBeenCalled(); - }); - - it("does not look up table entries through the prototype chain", () => { + (out, record) => ({ ...out, sameSource: record === source }), + ) + expect(result).toEqual({ flag: true, sameSource: true, value: 1 }) + }) + + it('lets finish replace the whole result', () => { + expect(convertRecord({ a: 1 }, {}, () => DROP)).toBe(DROP) + }) + + it('preserves key order', () => { + const input: UnknownRecord = {} + input.zebra = 1 + input.apple = 2 + input.mango = 3 + const result = asRecord(convertRecord(input, { apple: identity })) + expect(Object.keys(result)).toEqual(['zebra', 'apple', 'mango']) + }) + + it('deep-clones non-object input without consulting the table', () => { + const convert = vi.fn(identity) + const list = [{ a: 1 }] + const result = convertRecord(list, { a: convert }) + expect(result).toEqual(list) + expect(result).not.toBe(list) + expect(convertRecord('text', { a: convert })).toBe('text') + expect(convertRecord(null, { a: convert })).toBe(null) + expect(convert).not.toHaveBeenCalled() + }) + + it('does not look up table entries through the prototype chain', () => { const input: unknown = JSON.parse( - '{"constructor": 1, "toString": 2, "__proto__": {"polluted": true}}' - ); - const result = asRecord(convertRecord(input, {})); - expect(Object.getOwnPropertyDescriptor(result, "constructor")?.value).toBe( - 1 - ); - expect(Object.getOwnPropertyDescriptor(result, "toString")?.value).toBe(2); - expect(Object.getOwnPropertyDescriptor(result, "__proto__")?.value).toEqual( - { polluted: true } - ); - expect(Object.getPrototypeOf(result)).toBe(Object.prototype); - expect(asRecord({}).polluted).toBeUndefined(); - }); - - it("falls back to a cycle-preserving clone when re-entered for the same object", () => { - const node: UnknownRecord = { name: "root" }; - node.self = node; - const result = asRecord(convertNode(node)); - expect(result.name).toBe("converted"); - const inner = asRecord(result.self); - expect(inner).not.toBe(node); - expect(inner.name).toBe("root"); - expect(inner.self).toBe(inner); - }); - - it("converts shared acyclic references at every occurrence", () => { - const shared = { name: "x" }; + '{"constructor": 1, "toString": 2, "__proto__": {"polluted": true}}', + ) + const result = asRecord(convertRecord(input, {})) + expect(Object.getOwnPropertyDescriptor(result, 'constructor')?.value).toBe( + 1, + ) + expect(Object.getOwnPropertyDescriptor(result, 'toString')?.value).toBe(2) + expect(Object.getOwnPropertyDescriptor(result, '__proto__')?.value).toEqual( + { polluted: true }, + ) + expect(Object.getPrototypeOf(result)).toBe(Object.prototype) + expect(asRecord({}).polluted).toBeUndefined() + }) + + it('falls back to a cycle-preserving clone when re-entered for the same object', () => { + const node: UnknownRecord = { name: 'root' } + node.self = node + const result = asRecord(convertNode(node)) + expect(result.name).toBe('converted') + const inner = asRecord(result.self) + expect(inner).not.toBe(node) + expect(inner.name).toBe('root') + expect(inner.self).toBe(inner) + }) + + it('converts shared acyclic references at every occurrence', () => { + const shared = { name: 'x' } const result = convertRecord( { a: shared, b: shared }, { - a: (item) => convertRecord(item, { name: () => "a" }), - b: (item) => convertRecord(item, { name: () => "b" }), - } - ); - expect(result).toEqual({ a: { name: "a" }, b: { name: "b" } }); - }); - - it("releases the cycle guard when a converter throws", () => { - const value = { a: 1 }; + a: item => convertRecord(item, { name: () => 'a' }), + b: item => convertRecord(item, { name: () => 'b' }), + }, + ) + expect(result).toEqual({ a: { name: 'a' }, b: { name: 'b' } }) + }) + + it('releases the cycle guard when a converter throws', () => { + const value = { a: 1 } expect(() => convertRecord(value, { a: () => { - throw new Error("boom"); + throw new Error('boom') }, - }) - ).toThrow("boom"); - expect(convertRecord(value, { a: () => 2 })).toEqual({ a: 2 }); - }); -}); - -describe("operationFields", () => { - it("routes every HTTP method of a path item to the converter", () => { - const fields = operationFields(identity); - expect(Object.keys(fields)).toEqual([...HTTP_METHODS]); - expect(Object.values(fields).every((entry) => entry === identity)).toBe( - true - ); - }); -}); - -describe("mapRecord", () => { - it("applies the converter to every value with the key as second argument", () => { - const calls: [unknown, string][] = []; + }), + ).toThrow('boom') + expect(convertRecord(value, { a: () => 2 })).toEqual({ a: 2 }) + }) +}) + +describe('operationFields', () => { + it('routes every HTTP method of a path item to the converter', () => { + const fields = operationFields(identity) + expect(Object.keys(fields)).toEqual([...HTTP_METHODS]) + expect(Object.values(fields).every(entry => entry === identity)).toBe( + true, + ) + }) +}) + +describe('mapRecord', () => { + it('applies the converter to every value with the key as second argument', () => { + const calls: [unknown, string][] = [] const result = mapRecord({ a: 1, b: 2 }, (item, key) => { - calls.push([item, key]); + calls.push([item, key]) // SAFETY: the test input only contains numbers. - return (item as number) * 10; - }); - expect(result).toEqual({ a: 10, b: 20 }); + return (item as number) * 10 + }) + expect(result).toEqual({ a: 10, b: 20 }) expect(calls).toEqual([ - [1, "a"], - [2, "b"], - ]); - }); - - it("leaves out entries whose converter returns DROP", () => { - const result = mapRecord({ a: 1, b: 2, c: 3 }, (item) => - item === 2 ? DROP : item - ); - expect(result).toEqual({ a: 1, c: 3 }); - }); - - it("preserves key order", () => { - const input: UnknownRecord = {}; - input.zebra = 1; - input.apple = 2; - const result = asRecord(mapRecord(input, identity)); - expect(Object.keys(result)).toEqual(["zebra", "apple"]); - }); - - it("deep-clones non-object input unchanged without calling the converter", () => { - const convert = vi.fn(identity); - const array = [{ nested: true }]; - const result = mapRecord(array, convert); - expect(result).toEqual(array); - expect(result).not.toBe(array); - expect(mapRecord("text", convert)).toBe("text"); - expect(mapRecord(null, convert)).toBe(null); - expect(convert).not.toHaveBeenCalled(); - }); -}); - -describe("mapArray", () => { - it("applies the converter to every element", () => { + [1, 'a'], + [2, 'b'], + ]) + }) + + it('leaves out entries whose converter returns DROP', () => { + const result = mapRecord({ a: 1, b: 2, c: 3 }, item => + item === 2 ? DROP : item) + expect(result).toEqual({ a: 1, c: 3 }) + }) + + it('preserves key order', () => { + const input: UnknownRecord = {} + input.zebra = 1 + input.apple = 2 + const result = asRecord(mapRecord(input, identity)) + expect(Object.keys(result)).toEqual(['zebra', 'apple']) + }) + + it('deep-clones non-object input unchanged without calling the converter', () => { + const convert = vi.fn(identity) + const array = [{ nested: true }] + const result = mapRecord(array, convert) + expect(result).toEqual(array) + expect(result).not.toBe(array) + expect(mapRecord('text', convert)).toBe('text') + expect(mapRecord(null, convert)).toBe(null) + expect(convert).not.toHaveBeenCalled() + }) +}) + +describe('mapArray', () => { + it('applies the converter to every element', () => { const result = mapArray( [1, 2, 3], - (item) => + item => // SAFETY: the test input only contains numbers. - (item as number) + 1 - ); - expect(result).toEqual([2, 3, 4]); - }); - - it("leaves out elements whose converter returns DROP", () => { - const result = mapArray([1, 2, 3], (item) => (item === 2 ? DROP : item)); - expect(result).toEqual([1, 3]); - }); - - it("deep-clones non-array input unchanged without calling the converter", () => { - const convert = vi.fn(identity); - const record = { nested: { deep: true } }; - const result = mapArray(record, convert); - expect(result).toEqual(record); - expect(result).not.toBe(record); - expect(mapArray(7, convert)).toBe(7); - expect(mapArray(undefined, convert)).toBe(undefined); - expect(convert).not.toHaveBeenCalled(); - }); -}); - -describe("getRef", () => { - it("returns the $ref string of a reference-shaped object", () => { - expect(getRef({ $ref: "#/components/schemas/Pet" })).toBe( - "#/components/schemas/Pet" - ); - }); - - it("returns undefined for non-objects", () => { - expect(getRef(null)).toBeUndefined(); - expect(getRef("#/ref")).toBeUndefined(); - expect(getRef(42)).toBeUndefined(); - expect(getRef([{ $ref: "#/x" }])).toBeUndefined(); - }); - - it("returns undefined when $ref is missing or not a string", () => { - expect(getRef({})).toBeUndefined(); - expect(getRef({ ref: "#/x" })).toBeUndefined(); - expect(getRef({ $ref: 42 })).toBeUndefined(); - expect(getRef({ $ref: { nested: true } })).toBeUndefined(); - expect(getRef({ $ref: null })).toBeUndefined(); - }); -}); - -describe("setKey", () => { - it("defines an enumerable, writable, configurable own property", () => { - const target: UnknownRecord = {}; - setKey(target, "name", "value"); - expect(Object.getOwnPropertyDescriptor(target, "name")).toEqual({ + (item as number) + 1, + ) + expect(result).toEqual([2, 3, 4]) + }) + + it('leaves out elements whose converter returns DROP', () => { + const result = mapArray([1, 2, 3], item => (item === 2 ? DROP : item)) + expect(result).toEqual([1, 3]) + }) + + it('deep-clones non-array input unchanged without calling the converter', () => { + const convert = vi.fn(identity) + const record = { nested: { deep: true } } + const result = mapArray(record, convert) + expect(result).toEqual(record) + expect(result).not.toBe(record) + expect(mapArray(7, convert)).toBe(7) + expect(mapArray(undefined, convert)).toBe(undefined) + expect(convert).not.toHaveBeenCalled() + }) +}) + +describe('getRef', () => { + it('returns the $ref string of a reference-shaped object', () => { + expect(getRef({ $ref: '#/components/schemas/Pet' })).toBe( + '#/components/schemas/Pet', + ) + }) + + it('returns undefined for non-objects', () => { + expect(getRef(null)).toBeUndefined() + expect(getRef('#/ref')).toBeUndefined() + expect(getRef(42)).toBeUndefined() + expect(getRef([{ $ref: '#/x' }])).toBeUndefined() + }) + + it('returns undefined when $ref is missing or not a string', () => { + expect(getRef({})).toBeUndefined() + expect(getRef({ ref: '#/x' })).toBeUndefined() + expect(getRef({ $ref: 42 })).toBeUndefined() + expect(getRef({ $ref: { nested: true } })).toBeUndefined() + expect(getRef({ $ref: null })).toBeUndefined() + }) +}) + +describe('setKey', () => { + it('defines an enumerable, writable, configurable own property', () => { + const target: UnknownRecord = {} + setKey(target, 'name', 'value') + expect(Object.getOwnPropertyDescriptor(target, 'name')).toEqual({ configurable: true, enumerable: true, - value: "value", + value: 'value', writable: true, - }); - }); - - it("sets a __proto__ key as a plain own property without prototype pollution", () => { - const target: UnknownRecord = {}; - setKey(target, "__proto__", { polluted: true }); - const descriptor = Object.getOwnPropertyDescriptor(target, "__proto__"); - expect(descriptor?.value).toEqual({ polluted: true }); - expect(descriptor?.enumerable).toBe(true); - expect(Object.getPrototypeOf(target)).toBe(Object.prototype); - expect(asRecord({}).polluted).toBeUndefined(); - }); -}); + }) + }) + + it('sets a __proto__ key as a plain own property without prototype pollution', () => { + const target: UnknownRecord = {} + setKey(target, '__proto__', { polluted: true }) + const descriptor = Object.getOwnPropertyDescriptor(target, '__proto__') + expect(descriptor?.value).toEqual({ polluted: true }) + expect(descriptor?.enumerable).toBe(true) + expect(Object.getPrototypeOf(target)).toBe(Object.prototype) + expect(asRecord({}).polluted).toBeUndefined() + }) +}) diff --git a/packages/downgrader/src/shared.ts b/packages/downgrader/src/shared.ts index 58906db..2ee00e4 100644 --- a/packages/downgrader/src/shared.ts +++ b/packages/downgrader/src/shared.ts @@ -1,106 +1,95 @@ -/* oxlint-disable anti-slop/no-unknown-parameters, anti-slop/no-unknown-returns, anti-slop/no-known-value-widening, anti-slop/no-runtime-typeof -- the converters are the I/O boundary for untrusted OpenAPI documents: they walk arbitrary input defensively and pass malformed parts through unchanged, so `unknown` values and runtime type checks are the domain contract here */ - /** * Internal helpers shared by the version converters. Everything is defensive: * converters never throw on malformed input, they pass unconvertible parts * through unchanged. */ -// oxlint-disable-next-line anti-slop/no-unsafe-dictionary-type -- converters walk arbitrary user-supplied documents whose values are unknown by nature -export type UnknownRecord = Record; +export type UnknownRecord = Record /** * Returned by a converter to remove its entry from the surrounding object or * array: the single signal for constructs the target version cannot express. */ -export const DROP = Symbol("drop"); +export const DROP = Symbol('drop') /** * Converts one field of a record. The whole source record is passed along * for decisions that depend on sibling fields. */ -// oxlint-disable-next-line anti-slop/no-unsafe-dictionary-type -- the source is an arbitrary user-supplied object -export type FieldConverter = (item: unknown, source: UnknownRecord) => unknown; +export type FieldConverter = (item: unknown, source: UnknownRecord) => unknown /** * What happens to each known field of a record: a converter, or `DROP` to * remove the field. Fields not listed (unknown keys, `x-` extensions) are * deep-cloned as they are. */ -// oxlint-disable-next-line anti-slop/no-unsafe-dictionary-type -- the tables are keyed by arbitrary OpenAPI field names -export type FieldTable = Readonly>; +export type FieldTable = Readonly> export const HTTP_METHODS = [ - "delete", - "get", - "head", - "options", - "patch", - "post", - "put", - "trace", -] as const; + 'delete', + 'get', + 'head', + 'options', + 'patch', + 'post', + 'put', + 'trace', +] as const /** Field-table entries routing every Operation Object of a Path Item to `convert`. */ -export const operationFields = (convert: FieldConverter): FieldTable => - Object.fromEntries(HTTP_METHODS.map((method) => [method, convert])); +export function operationFields(convert: FieldConverter): FieldTable { + return Object.fromEntries(HTTP_METHODS.map(method => [method, convert])) +} /** * Whether the value is a plain object (the only shape the converters walk * into). Arrays, class instances, and primitives are handled by reference or * by dedicated array helpers. */ -export const isRecord = (value: unknown): value is UnknownRecord => { - if (typeof value !== "object" || value === null) { - return false; +export function isRecord(value: unknown): value is UnknownRecord { + if (typeof value !== 'object' || value === null) { + return false } - const proto: unknown = Object.getPrototypeOf(value); - return proto === Object.prototype || proto === null; -}; + const proto: unknown = Object.getPrototypeOf(value) + return proto === Object.prototype || proto === null +} /** * Sets a key on the output record with define-property semantics, so hostile * key names like `__proto__` become plain own properties. */ -export const setKey = ( - target: UnknownRecord, - key: string, - value: unknown -): void => { +export function setKey(target: UnknownRecord, key: string, value: unknown): void { Object.defineProperty(target, key, { configurable: true, enumerable: true, value, writable: true, - }); -}; + }) +} -const cloneValue = ( - value: unknown, - seen: WeakMap -): unknown => { +function cloneValue(value: unknown, seen: WeakMap): unknown { if (!(Array.isArray(value) || isRecord(value))) { - return value; + return value } - const existing = seen.get(value); + const existing = seen.get(value) if (existing !== undefined) { - return existing; + return existing } if (Array.isArray(value)) { - const out: unknown[] = []; - seen.set(value, out); + const out: unknown[] = [] + seen.set(value, out) for (const item of value) { - out.push(cloneValue(item, seen)); + out.push(cloneValue(item, seen)) } - return out; + return out } - const out: UnknownRecord = {}; - seen.set(value, out); + const out: UnknownRecord = {} + seen.set(value, out) for (const [key, item] of Object.entries(value)) { - setKey(out, key, cloneValue(item, seen)); + setKey(out, key, cloneValue(item, seen)) } - return out; -}; + return out +} /** * A JSON-oriented deep clone that never throws: non-plain values (class @@ -109,16 +98,16 @@ const cloneValue = ( * and cyclic or shared references are preserved in the clone instead of * recursing forever. */ -export const deepClone = (value: T): T => { +export function deepClone(value: T): T { if (!(Array.isArray(value) || isRecord(value))) { - return value; + return value } // SAFETY: cloneValue preserves the runtime shape of its input. - return cloneValue(value, new WeakMap()) as T; -}; + return cloneValue(value, new WeakMap()) as T +} /** Objects currently being converted somewhere up the call stack. */ -const converting = new WeakSet(); +const converting = new WeakSet() /** * Rebuilds a plain object field by field: each key goes through its entry in @@ -129,77 +118,68 @@ const converting = new WeakSet(); * higher up the call stack: a cyclic reference, which would otherwise recurse * forever. */ -export const convertRecord = ( - value: unknown, - fields: FieldTable, - finish?: (out: UnknownRecord, source: UnknownRecord) => unknown -): unknown => { +export function convertRecord(value: unknown, fields: FieldTable, finish?: (out: UnknownRecord, source: UnknownRecord) => unknown): unknown { if (!isRecord(value) || converting.has(value)) { - return deepClone(value); + return deepClone(value) } - converting.add(value); + converting.add(value) try { - const out: UnknownRecord = {}; + const out: UnknownRecord = {} for (const [key, item] of Object.entries(value)) { - const convert = Object.hasOwn(fields, key) ? fields[key] : undefined; + const convert = Object.hasOwn(fields, key) ? fields[key] : undefined if (convert === DROP) { - continue; + continue } - const converted = - convert === undefined ? deepClone(item) : convert(item, value); + const converted + = convert === undefined ? deepClone(item) : convert(item, value) if (converted !== DROP) { - setKey(out, key, converted); + setKey(out, key, converted) } } - return finish === undefined ? out : finish(out, value); - } finally { - converting.delete(value); + return finish === undefined ? out : finish(out, value) + } + finally { + converting.delete(value) } -}; +} /** * Applies `convert` to every value of a plain object, preserving key order * and leaving out entries it turns into `DROP`. Non-object input is * deep-cloned unchanged. */ -export const mapRecord = ( - value: unknown, - convert: (item: unknown, key: string) => unknown -): unknown => { +export function mapRecord(value: unknown, convert: (item: unknown, key: string) => unknown): unknown { if (!isRecord(value)) { - return deepClone(value); + return deepClone(value) } - const out: UnknownRecord = {}; + const out: UnknownRecord = {} for (const [key, item] of Object.entries(value)) { - const converted = convert(item, key); + const converted = convert(item, key) if (converted !== DROP) { - setKey(out, key, converted); + setKey(out, key, converted) } } - return out; -}; + return out +} /** * Applies `convert` to every element of an array, leaving out elements it * turns into `DROP`. Non-array input is deep-cloned unchanged. */ -export const mapArray = ( - value: unknown, - convert: (item: unknown) => unknown -): unknown => { +export function mapArray(value: unknown, convert: (item: unknown) => unknown): unknown { if (!Array.isArray(value)) { - return deepClone(value); + return deepClone(value) } - return value.map((item) => convert(item)).filter((item) => item !== DROP); -}; + return value.map(item => convert(item)).filter(item => item !== DROP) +} /** * Returns the `$ref` string of a Reference-Object-shaped value, or * `undefined` when the value is not one. */ -export const getRef = (value: unknown): string | undefined => { - if (isRecord(value) && typeof value.$ref === "string") { - return value.$ref; +export function getRef(value: unknown): string | undefined { + if (isRecord(value) && typeof value.$ref === 'string') { + return value.$ref } - return undefined; -}; + return undefined +} diff --git a/packages/downgrader/src/v3.1-to-v3.0.test.ts b/packages/downgrader/src/v3.1-to-v3.0.test.ts index 47f95bc..48e3293 100644 --- a/packages/downgrader/src/v3.1-to-v3.0.test.ts +++ b/packages/downgrader/src/v3.1-to-v3.0.test.ts @@ -1,1238 +1,1239 @@ -/* oxlint-disable anti-slop/no-unknown-parameters, anti-slop/no-unknown-returns -- the helpers deliberately accept and return `unknown` so tests can feed malformed input to the graceful-degradation branches and inspect loosely-shaped output */ +import type { OpenAPIV3_1 } from '@openapi-spec/types' -import type { OpenAPIV3_1 } from "@openapi-spec/types"; +import type { UnknownRecord } from './shared' +import { downgradeSchemaV31ToV30, downgradeSpecV31ToV30 } from './v3.1-to-v3.0' -import type { UnknownRecord } from "./shared"; -import { downgradeSchemaV31ToV30, downgradeSpecV31ToV30 } from "./v3.1-to-v3.0"; +function asSpec(value: unknown): OpenAPIV3_1.OpenAPIObject { + return value as OpenAPIV3_1.OpenAPIObject +} -const asSpec = (value: unknown): OpenAPIV3_1.OpenAPIObject => - // SAFETY: tests deliberately feed malformed or loosely-shaped documents to exercise graceful handling. - value as OpenAPIV3_1.OpenAPIObject; +function asSchema(value: unknown): OpenAPIV3_1.SchemaObject { + return value as OpenAPIV3_1.SchemaObject +} -const asSchema = (value: unknown): OpenAPIV3_1.SchemaObject => - // SAFETY: tests deliberately feed malformed or loosely-shaped schemas to exercise graceful handling. - value as OpenAPIV3_1.SchemaObject; - -const dig = (value: unknown, ...path: string[]): unknown => { - let current: unknown = value; +function dig(value: unknown, ...path: string[]): unknown { + let current: unknown = value for (const key of path) { // SAFETY: tests walk converter output whose shape the surrounding assertions pin down. - current = (current as UnknownRecord)[key]; + current = (current as UnknownRecord)[key] } - return current; -}; + return current +} -const info = { title: "t", version: "1" }; +const info = { title: 't', version: '1' } /** The smallest valid 3.1 document and its 3.0 counterpart. */ -const base = { info, openapi: "3.1.0", paths: {} }; -const converted = { info, openapi: "3.0.4", paths: {} }; +const base = { info, openapi: '3.1.0', paths: {} } +const converted = { info, openapi: '3.0.4', paths: {} } -const convertSpec = (fields: UnknownRecord) => - downgradeSpecV31ToV30(asSpec({ ...base, ...fields })); +function convertSpec(fields: UnknownRecord) { + return downgradeSpecV31ToV30(asSpec({ ...base, ...fields })) +} -const convertPathItem = (pathItem: unknown): unknown => - dig(convertSpec({ paths: { "/a": pathItem } }), "paths", "/a"); +function convertPathItem(pathItem: unknown): unknown { + return dig(convertSpec({ paths: { '/a': pathItem } }), 'paths', '/a') +} -const convertComponent = (kind: string, value: unknown): unknown => - dig( +function convertComponent(kind: string, value: unknown): unknown { + return dig( convertSpec({ components: { [kind]: { X: value } } }), - "components", + 'components', kind, - "X" - ); + 'X', + ) +} -const convertSchema = (schema: unknown): unknown => - downgradeSchemaV31ToV30(asSchema(schema)); +function convertSchema(schema: unknown): unknown { + return downgradeSchemaV31ToV30(asSchema(schema)) +} -describe("downgradeSpecV31ToV30", () => { - describe("document", () => { - it("rewrites the openapi version to 3.0.4", () => { +describe('downgradeSpecV31ToV30', () => { + describe('document', () => { + it('rewrites the openapi version to 3.0.4', () => { expect( - downgradeSpecV31ToV30({ info, openapi: "3.1.1", paths: {} }) - ).toEqual(converted); - }); + downgradeSpecV31ToV30({ info, openapi: '3.1.1', paths: {} }), + ).toEqual(converted) + }) - it("adds openapi 3.0.4 and an empty paths object when they are missing", () => { - expect(downgradeSpecV31ToV30(asSpec({ info }))).toEqual(converted); - }); + it('adds openapi 3.0.4 and an empty paths object when they are missing', () => { + expect(downgradeSpecV31ToV30(asSpec({ info }))).toEqual(converted) + }) - it("removes jsonSchemaDialect and webhooks without leaving traces", () => { + it('removes jsonSchemaDialect and webhooks without leaving traces', () => { const result = convertSpec({ - jsonSchemaDialect: "https://spec.openapis.org/oas/3.1/dialect/base", - webhooks: { newPet: { post: { summary: "s" } } }, - }); - expect(result).toEqual(converted); - expect(result).not.toHaveProperty("x-webhooks"); - }); - - it("preserves unknown top-level keys and extensions", () => { - expect(convertSpec({ future: { a: 1 }, "x-root": true })).toEqual({ + jsonSchemaDialect: 'https://spec.openapis.org/oas/3.1/dialect/base', + webhooks: { newPet: { post: { summary: 's' } } }, + }) + expect(result).toEqual(converted) + expect(result).not.toHaveProperty('x-webhooks') + }) + + it('preserves unknown top-level keys and extensions', () => { + expect(convertSpec({ 'future': { a: 1 }, 'x-root': true })).toEqual({ ...converted, - future: { a: 1 }, - "x-root": true, - }); - }); - - it("clones non-object input unchanged", () => { - expect(downgradeSpecV31ToV30(asSpec(null))).toBeNull(); - expect(downgradeSpecV31ToV30(asSpec(42))).toBe(42); - expect(downgradeSpecV31ToV30(asSpec("spec"))).toBe("spec"); - const list = [1, { a: 1 }]; - const result = downgradeSpecV31ToV30(asSpec(list)); - expect(result).toEqual(list); - expect(result).not.toBe(list); - }); - }); - - describe("info", () => { - it("removes summary and license.identifier and keeps the other fields", () => { + 'future': { a: 1 }, + 'x-root': true, + }) + }) + + it('clones non-object input unchanged', () => { + expect(downgradeSpecV31ToV30(asSpec(null))).toBeNull() + expect(downgradeSpecV31ToV30(asSpec(42))).toBe(42) + expect(downgradeSpecV31ToV30(asSpec('spec'))).toBe('spec') + const list = [1, { a: 1 }] + const result = downgradeSpecV31ToV30(asSpec(list)) + expect(result).toEqual(list) + expect(result).not.toBe(list) + }) + }) + + describe('info', () => { + it('removes summary and license.identifier and keeps the other fields', () => { expect( convertSpec({ info: { license: { - identifier: "MIT", - name: "MIT", - url: "https://opensource.org/license/mit", + identifier: 'MIT', + name: 'MIT', + url: 'https://opensource.org/license/mit', }, - summary: "short", - title: "t", - version: "1", + summary: 'short', + title: 't', + version: '1', }, - }).info + }).info, ).toEqual({ - license: { name: "MIT", url: "https://opensource.org/license/mit" }, - title: "t", - version: "1", - }); - }); - - it("clones malformed info and license values unchanged", () => { - expect(convertSpec({ info: 42 }).info).toBe(42); + license: { name: 'MIT', url: 'https://opensource.org/license/mit' }, + title: 't', + version: '1', + }) + }) + + it('clones malformed info and license values unchanged', () => { + expect(convertSpec({ info: 42 }).info).toBe(42) expect( - convertSpec({ info: { license: "MIT", title: "t", version: "1" } }).info + convertSpec({ info: { license: 'MIT', title: 't', version: '1' } }).info, ).toEqual({ - license: "MIT", - title: "t", - version: "1", - }); - }); - }); - - describe("paths", () => { - it("converts path items and clones non-path keys", () => { + license: 'MIT', + title: 't', + version: '1', + }) + }) + }) + + describe('paths', () => { + it('converts path items and clones non-path keys', () => { expect( convertSpec({ paths: { - "/a": { get: { summary: "s" } }, + '/a': { get: { summary: 's' } }, // Path-item-shaped on purpose: cloning must NOT convert it, so // no responses may be synthesized inside. - "x-note": { get: { summary: "s" } }, + 'x-note': { get: { summary: 's' } }, }, - }).paths + }).paths, ).toEqual({ - "/a": { - get: { responses: { default: { description: "" } }, summary: "s" }, + '/a': { + get: { responses: { default: { description: '' } }, summary: 's' }, }, - "x-note": { get: { summary: "s" } }, - }); - }); + 'x-note': { get: { summary: 's' } }, + }) + }) - it("leaves a path item $ref field untouched, string or not", () => { + it('leaves a path item $ref field untouched, string or not', () => { expect( convertPathItem({ - $ref: "#/components/pathItems/Reusable", - summary: "s", - }) + $ref: '#/components/pathItems/Reusable', + summary: 's', + }), ).toEqual({ - $ref: "#/components/pathItems/Reusable", - summary: "s", - }); - expect(convertPathItem({ $ref: 42 })).toEqual({ $ref: 42 }); - }); - - it("clones malformed paths, path items, operations, and nested objects unchanged", () => { - expect(convertSpec({ paths: "junk" }).paths).toBe("junk"); + $ref: '#/components/pathItems/Reusable', + summary: 's', + }) + expect(convertPathItem({ $ref: 42 })).toEqual({ $ref: 42 }) + }) + + it('clones malformed paths, path items, operations, and nested objects unchanged', () => { + expect(convertSpec({ paths: 'junk' }).paths).toBe('junk') const paths = { - "/a": { - get: { requestBody: 42, responses: { "200": "junk" } }, + '/a': { + get: { requestBody: 42, responses: { 200: 'junk' } }, parameters: [42], }, - "/b": { + '/b': { post: { requestBody: { content: { - "application/json": "junk", - "multipart/form-data": { encoding: { field: "junk" } }, + 'application/json': 'junk', + 'multipart/form-data': { encoding: { field: 'junk' } }, }, }, responses: {}, }, }, - "/c": { get: "junk" }, - "/junk": "junk", - }; - expect(convertSpec({ paths }).paths).toEqual(paths); - }); - }); + '/c': { get: 'junk' }, + '/junk': 'junk', + } + expect(convertSpec({ paths }).paths).toEqual(paths) + }) + }) - describe("reference objects", () => { - it("strips reference summary and description across components maps", () => { + describe('reference objects', () => { + it('strips reference summary and description across components maps', () => { expect( convertSpec({ components: { - callbacks: { C: { $ref: "#/c/cb", summary: "s" } }, - examples: { E: { $ref: "#/c/e", description: "d" } }, - headers: { H: { $ref: "#/c/h", summary: "s" } }, - links: { L: { $ref: "#/c/l", description: "d" } }, + callbacks: { C: { $ref: '#/c/cb', summary: 's' } }, + examples: { E: { $ref: '#/c/e', description: 'd' } }, + headers: { H: { $ref: '#/c/h', summary: 's' } }, + links: { L: { $ref: '#/c/l', description: 'd' } }, parameters: { - P: { $ref: "#/c/p", description: "d", summary: "s" }, + P: { $ref: '#/c/p', description: 'd', summary: 's' }, }, - requestBodies: { B: { $ref: "#/c/b", summary: "s" } }, - responses: { R: { $ref: "#/c/r", description: "d" } }, - securitySchemes: { S: { $ref: "#/c/s", description: "d" } }, + requestBodies: { B: { $ref: '#/c/b', summary: 's' } }, + responses: { R: { $ref: '#/c/r', description: 'd' } }, + securitySchemes: { S: { $ref: '#/c/s', description: 'd' } }, }, - }).components + }).components, ).toEqual({ - callbacks: { C: { $ref: "#/c/cb" } }, - examples: { E: { $ref: "#/c/e" } }, - headers: { H: { $ref: "#/c/h" } }, - links: { L: { $ref: "#/c/l" } }, - parameters: { P: { $ref: "#/c/p" } }, - requestBodies: { B: { $ref: "#/c/b" } }, - responses: { R: { $ref: "#/c/r" } }, - securitySchemes: { S: { $ref: "#/c/s" } }, - }); - }); - - it("strips reference overrides inside operations and path items", () => { + callbacks: { C: { $ref: '#/c/cb' } }, + examples: { E: { $ref: '#/c/e' } }, + headers: { H: { $ref: '#/c/h' } }, + links: { L: { $ref: '#/c/l' } }, + parameters: { P: { $ref: '#/c/p' } }, + requestBodies: { B: { $ref: '#/c/b' } }, + responses: { R: { $ref: '#/c/r' } }, + securitySchemes: { S: { $ref: '#/c/s' } }, + }) + }) + + it('strips reference overrides inside operations and path items', () => { expect( convertPathItem({ get: { - callbacks: { cb: { $ref: "#/c/cb", summary: "s" } }, - parameters: [{ $ref: "#/c/p", description: "d" }], - requestBody: { $ref: "#/c/b", summary: "s" }, - responses: { "200": { $ref: "#/c/r", summary: "s" } }, + callbacks: { cb: { $ref: '#/c/cb', summary: 's' } }, + parameters: [{ $ref: '#/c/p', description: 'd' }], + requestBody: { $ref: '#/c/b', summary: 's' }, + responses: { 200: { $ref: '#/c/r', summary: 's' } }, }, - parameters: [{ $ref: "#/c/pp", summary: "s" }], - }) + parameters: [{ $ref: '#/c/pp', summary: 's' }], + }), ).toEqual({ get: { - callbacks: { cb: { $ref: "#/c/cb" } }, - parameters: [{ $ref: "#/c/p" }], - requestBody: { $ref: "#/c/b" }, - responses: { "200": { $ref: "#/c/r" } }, + callbacks: { cb: { $ref: '#/c/cb' } }, + parameters: [{ $ref: '#/c/p' }], + requestBody: { $ref: '#/c/b' }, + responses: { 200: { $ref: '#/c/r' } }, }, - parameters: [{ $ref: "#/c/pp" }], - }); - }); + parameters: [{ $ref: '#/c/pp' }], + }) + }) - it("strips reference overrides in response headers, links, and media type examples", () => { + it('strips reference overrides in response headers, links, and media type examples', () => { expect( - convertComponent("responses", { + convertComponent('responses', { content: { - "application/json": { - examples: { e: { $ref: "#/c/e", summary: "s" } }, - schema: { type: ["string", "null"] }, + 'application/json': { + examples: { e: { $ref: '#/c/e', summary: 's' } }, + schema: { type: ['string', 'null'] }, }, }, - description: "ok", - headers: { H: { $ref: "#/c/h", summary: "s" } }, - links: { l: { $ref: "#/c/l", description: "d" } }, - }) + description: 'ok', + headers: { H: { $ref: '#/c/h', summary: 's' } }, + links: { l: { $ref: '#/c/l', description: 'd' } }, + }), ).toEqual({ content: { - "application/json": { - examples: { e: { $ref: "#/c/e" } }, - schema: { nullable: true, type: "string" }, + 'application/json': { + examples: { e: { $ref: '#/c/e' } }, + schema: { nullable: true, type: 'string' }, }, }, - description: "ok", - headers: { H: { $ref: "#/c/h" } }, - links: { l: { $ref: "#/c/l" } }, - }); - }); + description: 'ok', + headers: { H: { $ref: '#/c/h' } }, + links: { l: { $ref: '#/c/l' } }, + }) + }) - it("keeps x- entries in a responses map unconverted", () => { + it('keeps x- entries in a responses map unconverted', () => { const responses = { - "200": { description: "ok" }, - "x-note": { $ref: "#/c/r", summary: "s" }, - }; + '200': { description: 'ok' }, + 'x-note': { $ref: '#/c/r', summary: 's' }, + } expect(convertPathItem({ get: { responses } })).toEqual({ get: { responses }, - }); - }); - }); + }) + }) + }) - describe("operations", () => { - it("synthesizes a minimal default responses object when an operation lacks one", () => { - expect(convertPathItem({ get: { operationId: "getA" } })).toEqual({ + describe('operations', () => { + it('synthesizes a minimal default responses object when an operation lacks one', () => { + expect(convertPathItem({ get: { operationId: 'getA' } })).toEqual({ get: { - operationId: "getA", - responses: { default: { description: "" } }, + operationId: 'getA', + responses: { default: { description: '' } }, }, - }); - }); + }) + }) - it("converts parameter schemas, content, and examples", () => { + it('converts parameter schemas, content, and examples', () => { expect( convertPathItem({ get: { parameters: [ { - examples: { e: { $ref: "#/c/e", summary: "s" } }, - in: "query", - name: "p", - schema: { type: ["string", "null"] }, + examples: { e: { $ref: '#/c/e', summary: 's' } }, + in: 'query', + name: 'p', + schema: { type: ['string', 'null'] }, }, { content: { - "text/plain": { schema: { type: ["integer", "null"] } }, + 'text/plain': { schema: { type: ['integer', 'null'] } }, }, - in: "query", - name: "q", + in: 'query', + name: 'q', }, ], responses: {}, }, - }) + }), ).toEqual({ get: { parameters: [ { - examples: { e: { $ref: "#/c/e" } }, - in: "query", - name: "p", - schema: { nullable: true, type: "string" }, + examples: { e: { $ref: '#/c/e' } }, + in: 'query', + name: 'p', + schema: { nullable: true, type: 'string' }, }, { content: { - "text/plain": { schema: { nullable: true, type: "integer" } }, + 'text/plain': { schema: { nullable: true, type: 'integer' } }, }, - in: "query", - name: "q", + in: 'query', + name: 'q', }, ], responses: {}, }, - }); - }); + }) + }) - it("adds required: true to path parameters that lack it", () => { + it('adds required: true to path parameters that lack it', () => { expect( convertPathItem({ get: { parameters: [ { - content: { "text/plain": { schema: { type: "string" } } }, - in: "path", - name: "id", + content: { 'text/plain': { schema: { type: 'string' } } }, + in: 'path', + name: 'id', }, - { in: "query", name: "q", schema: {} }, + { in: 'query', name: 'q', schema: {} }, ], responses: {}, }, - }) + }), ).toEqual({ get: { parameters: [ { - content: { "text/plain": { schema: { type: "string" } } }, - in: "path", - name: "id", + content: { 'text/plain': { schema: { type: 'string' } } }, + in: 'path', + name: 'id', required: true, }, - { in: "query", name: "q", schema: {} }, + { in: 'query', name: 'q', schema: {} }, ], responses: {}, }, - }); - }); + }) + }) - it("converts request body content, media type encoding, and encoding headers", () => { + it('converts request body content, media type encoding, and encoding headers', () => { expect( - convertComponent("requestBodies", { + convertComponent('requestBodies', { content: { - "multipart/form-data": { + 'multipart/form-data': { encoding: { field: { - contentType: "text/plain", + contentType: 'text/plain', headers: { - H: { $ref: "#/c/h", summary: "s" }, - H2: { schema: { type: ["string", "null"] } }, + H: { $ref: '#/c/h', summary: 's' }, + H2: { schema: { type: ['string', 'null'] } }, }, }, }, - example: { field: "v" }, - schema: { type: "object" }, + example: { field: 'v' }, + schema: { type: 'object' }, }, }, - description: "body", + description: 'body', required: true, - }) + }), ).toEqual({ content: { - "multipart/form-data": { + 'multipart/form-data': { encoding: { field: { - contentType: "text/plain", + contentType: 'text/plain', headers: { - H: { $ref: "#/c/h" }, - H2: { schema: { nullable: true, type: "string" } }, + H: { $ref: '#/c/h' }, + H2: { schema: { nullable: true, type: 'string' } }, }, }, }, - example: { field: "v" }, - schema: { type: "object" }, + example: { field: 'v' }, + schema: { type: 'object' }, }, }, - description: "body", + description: 'body', required: true, - }); - }); + }) + }) - it("converts inline callback objects, cloning x- keys and junk entries", () => { + it('converts inline callback objects, cloning x- keys and junk entries', () => { expect( convertPathItem({ get: { callbacks: { - inline: { expr: { get: {} }, "x-k": { expr: { get: {} } } }, + inline: { 'expr': { get: {} }, 'x-k': { expr: { get: {} } } }, junk: 7, }, responses: {}, }, - }) + }), ).toEqual({ get: { callbacks: { inline: { - expr: { get: { responses: { default: { description: "" } } } }, - "x-k": { expr: { get: {} } }, + 'expr': { get: { responses: { default: { description: '' } } } }, + 'x-k': { expr: { get: {} } }, }, junk: 7, }, responses: {}, }, - }); - }); - }); + }) + }) + }) - describe("components", () => { - it("removes pathItems and keeps the other component maps", () => { + describe('components', () => { + it('removes pathItems and keeps the other component maps', () => { const result = convertSpec({ components: { - pathItems: { Reusable: { get: { summary: "s" } } }, - schemas: { S: { type: "string" } }, + pathItems: { Reusable: { get: { summary: 's' } } }, + schemas: { S: { type: 'string' } }, }, - }); - expect(result.components).toEqual({ schemas: { S: { type: "string" } } }); - expect(result.components).not.toHaveProperty("x-pathItems"); - }); + }) + expect(result.components).toEqual({ schemas: { S: { type: 'string' } } }) + expect(result.components).not.toHaveProperty('x-pathItems') + }) - it("leaves references into components.pathItems intact apart from override stripping", () => { + it('leaves references into components.pathItems intact apart from override stripping', () => { expect( - convertComponent("callbacks", { - $ref: "#/components/pathItems/Reusable", - summary: "s", - }) - ).toEqual({ $ref: "#/components/pathItems/Reusable" }); - }); - - it("converts component callbacks and schemas, including boolean schemas", () => { + convertComponent('callbacks', { + $ref: '#/components/pathItems/Reusable', + summary: 's', + }), + ).toEqual({ $ref: '#/components/pathItems/Reusable' }) + }) + + it('converts component callbacks and schemas, including boolean schemas', () => { expect( convertSpec({ components: { - callbacks: { + 'callbacks': { junkCallback: 42, realCallback: { - "x-note": { "{$expr}": { get: {} } }, - "{$request.body#/url}": { post: { summary: "s" } }, + 'x-note': { '{$expr}': { get: {} } }, + '{$request.body#/url}': { post: { summary: 's' } }, }, }, - schemas: { S: { type: ["string", "null"] }, T: true }, - "x-extra": { keep: true }, + 'schemas': { S: { type: ['string', 'null'] }, T: true }, + 'x-extra': { keep: true }, }, - }).components + }).components, ).toEqual({ - callbacks: { + 'callbacks': { junkCallback: 42, realCallback: { - "x-note": { "{$expr}": { get: {} } }, - "{$request.body#/url}": { + 'x-note': { '{$expr}': { get: {} } }, + '{$request.body#/url}': { post: { - responses: { default: { description: "" } }, - summary: "s", + responses: { default: { description: '' } }, + summary: 's', }, }, }, }, - schemas: { S: { nullable: true, type: "string" }, T: {} }, - "x-extra": { keep: true }, - }); - }); + 'schemas': { S: { nullable: true, type: 'string' }, T: {} }, + 'x-extra': { keep: true }, + }) + }) - it("clones a malformed components value unchanged", () => { - expect(convertSpec({ components: "junk" }).components).toBe("junk"); - }); - }); + it('clones a malformed components value unchanged', () => { + expect(convertSpec({ components: 'junk' }).components).toBe('junk') + }) + }) - describe("security", () => { - const apiKey = { in: "header", name: "k", type: "apiKey" }; + describe('security', () => { + const apiKey = { in: 'header', name: 'k', type: 'apiKey' } - it("removes mutualTLS schemes and drops requirements that become empty", () => { + it('removes mutualTLS schemes and drops requirements that become empty', () => { const result = convertSpec({ components: { - securitySchemes: { api: apiKey, mtls: { type: "mutualTLS" } }, + securitySchemes: { api: apiKey, mtls: { type: 'mutualTLS' } }, }, security: [{ mtls: [] }, { api: [], mtls: [] }, {}], - }); - expect(result.components).toEqual({ securitySchemes: { api: apiKey } }); - expect(result.security).toEqual([{ api: [] }, {}]); - }); + }) + expect(result.components).toEqual({ securitySchemes: { api: apiKey } }) + expect(result.security).toEqual([{ api: [] }, {}]) + }) - it("removes reference aliases of mutualTLS schemes and their requirements", () => { + it('removes reference aliases of mutualTLS schemes and their requirements', () => { const result = convertSpec({ components: { securitySchemes: { api: apiKey, - clientCert: { $ref: "#/components/securitySchemes/mtlsBase" }, - mtlsBase: { type: "mutualTLS" }, + clientCert: { $ref: '#/components/securitySchemes/mtlsBase' }, + mtlsBase: { type: 'mutualTLS' }, }, }, security: [{ clientCert: [] }, { api: [] }], - }); - expect(result.components).toEqual({ securitySchemes: { api: apiKey } }); - expect(result.security).toEqual([{ api: [] }]); - }); + }) + expect(result.components).toEqual({ securitySchemes: { api: apiKey } }) + expect(result.security).toEqual([{ api: [] }]) + }) - it("survives cyclic, dangling, external, and malformed scheme aliases", () => { + it('survives cyclic, dangling, external, and malformed scheme aliases', () => { const securitySchemes = { - dangling: { $ref: "#/components/securitySchemes/missing" }, - external: { $ref: "https://example.com/s.json#/schemes/a" }, + dangling: { $ref: '#/components/securitySchemes/missing' }, + external: { $ref: 'https://example.com/s.json#/schemes/a' }, junk: 42, - nested: { $ref: "#/components/securitySchemes/a/b" }, - ping: { $ref: "#/components/securitySchemes/pong" }, - pong: { $ref: "#/components/securitySchemes/ping" }, - }; + nested: { $ref: '#/components/securitySchemes/a/b' }, + ping: { $ref: '#/components/securitySchemes/pong' }, + pong: { $ref: '#/components/securitySchemes/ping' }, + } expect( - convertSpec({ components: { securitySchemes } }).components + convertSpec({ components: { securitySchemes } }).components, ).toEqual({ securitySchemes, - }); - }); + }) + }) - it("empties roles on non-OAuth schemes and keeps them elsewhere", () => { + it('empties roles on non-OAuth schemes and keeps them elsewhere', () => { expect( convertSpec({ components: { securitySchemes: { api: apiKey, - basic: { scheme: "basic", type: "http" }, - oauth: { flows: {}, type: "oauth2" }, - oidc: { openIdConnectUrl: "https://x", type: "openIdConnect" }, + basic: { scheme: 'basic', type: 'http' }, + oauth: { flows: {}, type: 'oauth2' }, + oidc: { openIdConnectUrl: 'https://x', type: 'openIdConnect' }, }, }, security: [ - { api: ["read"], basic: ["admin"] }, - { oauth: ["read"], oidc: ["a"], unknownScheme: ["s"] }, + { api: ['read'], basic: ['admin'] }, + { oauth: ['read'], oidc: ['a'], unknownScheme: ['s'] }, ], - }).security + }).security, ).toEqual([ { api: [], basic: [] }, - { oauth: ["read"], oidc: ["a"], unknownScheme: ["s"] }, - ]); - }); + { oauth: ['read'], oidc: ['a'], unknownScheme: ['s'] }, + ]) + }) - it("converts operation-level security lists", () => { + it('converts operation-level security lists', () => { expect( convertSpec({ components: { - securitySchemes: { api: apiKey, mtls: { type: "mutualTLS" } }, + securitySchemes: { api: apiKey, mtls: { type: 'mutualTLS' } }, }, paths: { - "/a": { + '/a': { get: { responses: {}, - security: [{ mtls: [] }, { api: ["read"] }], + security: [{ mtls: [] }, { api: ['read'] }], }, }, }, - }).paths - ).toEqual({ "/a": { get: { responses: {}, security: [{ api: [] }] } } }); - }); + }).paths, + ).toEqual({ '/a': { get: { responses: {}, security: [{ api: [] }] } } }) + }) - it("omits a security list that mutualTLS removal emptied instead of making it public", () => { + it('omits a security list that mutualTLS removal emptied instead of making it public', () => { const result = convertSpec({ - components: { securitySchemes: { mtls: { type: "mutualTLS" } } }, + components: { securitySchemes: { mtls: { type: 'mutualTLS' } } }, paths: { - "/admin": { get: { responses: {}, security: [{ mtls: [] }] } }, + '/admin': { get: { responses: {}, security: [{ mtls: [] }] } }, }, security: [{ mtls: [] }], - }); - expect(result.paths).toEqual({ "/admin": { get: { responses: {} } } }); - expect(result).not.toHaveProperty("security"); - }); + }) + expect(result.paths).toEqual({ '/admin': { get: { responses: {} } } }) + expect(result).not.toHaveProperty('security') + }) - it("keeps an explicitly empty security list", () => { + it('keeps an explicitly empty security list', () => { const result = convertSpec({ - paths: { "/a": { get: { responses: {}, security: [] } } }, + paths: { '/a': { get: { responses: {}, security: [] } } }, security: [], - }); + }) expect(result.paths).toEqual({ - "/a": { get: { responses: {}, security: [] } }, - }); - expect(result.security).toEqual([]); - }); + '/a': { get: { responses: {}, security: [] } }, + }) + expect(result.security).toEqual([]) + }) - it("clones malformed security values and scheme maps unchanged", () => { + it('clones malformed security values and scheme maps unchanged', () => { expect( - convertSpec({ security: [{ api: [] }, "junk", 42] }).security - ).toEqual([{ api: [] }, "junk", 42]); + convertSpec({ security: [{ api: [] }, 'junk', 42] }).security, + ).toEqual([{ api: [] }, 'junk', 42]) expect(convertSpec({ security: { api: [] } }).security).toEqual({ api: [], - }); + }) expect( - convertSpec({ components: { securitySchemes: "junk" } }).components + convertSpec({ components: { securitySchemes: 'junk' } }).components, ).toEqual({ - securitySchemes: "junk", - }); - }); - }); + securitySchemes: 'junk', + }) + }) + }) - describe("robustness", () => { - it("never mutates the input document", () => { + describe('robustness', () => { + it('never mutates the input document', () => { const input = asSpec({ components: { - pathItems: { Reusable: { get: { summary: "s" } } }, - schemas: { S: { $ref: "#/c/s", type: ["string", "null"] } }, + pathItems: { Reusable: { get: { summary: 's' } } }, + schemas: { S: { $ref: '#/c/s', type: ['string', 'null'] } }, securitySchemes: { - api: { in: "header", name: "k", type: "apiKey" }, - mtls: { type: "mutualTLS" }, + api: { in: 'header', name: 'k', type: 'apiKey' }, + mtls: { type: 'mutualTLS' }, }, }, info: { - license: { identifier: "MIT", name: "MIT" }, - summary: "short", - title: "t", - version: "1", + license: { identifier: 'MIT', name: 'MIT' }, + summary: 'short', + title: 't', + version: '1', }, - jsonSchemaDialect: "https://spec.openapis.org/oas/3.1/dialect/base", - openapi: "3.1.0", + jsonSchemaDialect: 'https://spec.openapis.org/oas/3.1/dialect/base', + openapi: '3.1.0', paths: { - "/a": { + '/a': { get: { - parameters: [{ $ref: "#/c/p", summary: "s" }], - security: [{ mtls: [] }, { api: ["read"] }], + parameters: [{ $ref: '#/c/p', summary: 's' }], + security: [{ mtls: [] }, { api: ['read'] }], }, }, }, security: [{ mtls: [] }], - webhooks: { newPet: { post: { summary: "s" } } }, - }); - const before = structuredClone(input); - downgradeSpecV31ToV30(input); - expect(input).toEqual(before); - }); - - it("converts a path item that cycles through its callbacks without throwing", () => { - const callback: UnknownRecord = {}; + webhooks: { newPet: { post: { summary: 's' } } }, + }) + const before = structuredClone(input) + downgradeSpecV31ToV30(input) + expect(input).toEqual(before) + }) + + it('converts a path item that cycles through its callbacks without throwing', () => { + const callback: UnknownRecord = {} const pathItem: UnknownRecord = { get: { callbacks: { cb: callback }, responses: {} }, - }; - callback.expr = pathItem; - expect(() => convertPathItem(pathItem)).not.toThrow(); - }); - }); -}); - -describe("downgradeSchemaV31ToV30", () => { - describe("boolean and junk schemas", () => { - it("converts the boolean schemas", () => { - expect(downgradeSchemaV31ToV30(true)).toEqual({}); - expect(downgradeSchemaV31ToV30(false)).toEqual({ not: {} }); - }); - - it("clones junk input unchanged", () => { - expect(convertSchema(null)).toBeNull(); - expect(convertSchema(42)).toBe(42); - expect(convertSchema("x")).toBe("x"); - const list = [{ type: "string" }]; - const result = convertSchema(list); - expect(result).toEqual(list); - expect(result).not.toBe(list); - }); - }); - - describe("$ref", () => { - it("keeps a pure $ref as a bare reference object, wherever it points", () => { - const input = { $ref: "#/components/schemas/Pet" }; - const result = downgradeSchemaV31ToV30(input); - expect(result).toEqual(input); - expect(result).not.toBe(input); - expect(convertSchema({ $ref: "#/components/pathItems/Foo" })).toEqual({ - $ref: "#/components/pathItems/Foo", - }); - }); + } + callback.expr = pathItem + expect(() => convertPathItem(pathItem)).not.toThrow() + }) + }) +}) + +describe('downgradeSchemaV31ToV30', () => { + describe('boolean and junk schemas', () => { + it('converts the boolean schemas', () => { + expect(downgradeSchemaV31ToV30(true)).toEqual({}) + expect(downgradeSchemaV31ToV30(false)).toEqual({ not: {} }) + }) + + it('clones junk input unchanged', () => { + expect(convertSchema(null)).toBeNull() + expect(convertSchema(42)).toBe(42) + expect(convertSchema('x')).toBe('x') + const list = [{ type: 'string' }] + const result = convertSchema(list) + expect(result).toEqual(list) + expect(result).not.toBe(list) + }) + }) + + describe('$ref', () => { + it('keeps a pure $ref as a bare reference object, wherever it points', () => { + const input = { $ref: '#/components/schemas/Pet' } + const result = downgradeSchemaV31ToV30(input) + expect(result).toEqual(input) + expect(result).not.toBe(input) + expect(convertSchema({ $ref: '#/components/pathItems/Foo' })).toEqual({ + $ref: '#/components/pathItems/Foo', + }) + }) it.each([ [ - "wraps a $ref with sibling keywords into allOf", - { $ref: "#/c/s", minLength: 1 }, - { allOf: [{ $ref: "#/c/s" }], minLength: 1 }, + 'wraps a $ref with sibling keywords into allOf', + { $ref: '#/c/s', minLength: 1 }, + { allOf: [{ $ref: '#/c/s' }], minLength: 1 }, ], [ - "merges a $ref into an existing allOf", - { $ref: "#/c/s", allOf: [{ type: "string" }] }, - { allOf: [{ $ref: "#/c/s" }, { type: "string" }] }, + 'merges a $ref into an existing allOf', + { $ref: '#/c/s', allOf: [{ type: 'string' }] }, + { allOf: [{ $ref: '#/c/s' }, { type: 'string' }] }, ], [ - "keeps a malformed allOf and leaves the $ref in place", - { $ref: "#/c/s", allOf: "junk" }, - { $ref: "#/c/s", allOf: "junk" }, + 'keeps a malformed allOf and leaves the $ref in place', + { $ref: '#/c/s', allOf: 'junk' }, + { $ref: '#/c/s', allOf: 'junk' }, ], [ - "passes a non-string $ref through unchanged", - { $ref: 123, type: "string" }, - { $ref: 123, type: "string" }, + 'passes a non-string $ref through unchanged', + { $ref: 123, type: 'string' }, + { $ref: 123, type: 'string' }, ], [ - "passes a lone non-string $ref through unchanged", + 'passes a lone non-string $ref through unchanged', { $ref: 123 }, { $ref: 123 }, ], - ])("%s", (_name, input, expected) => { - expect(convertSchema(input)).toEqual(expected); - }); - }); + ])('%s', (_name, input, expected) => { + expect(convertSchema(input)).toEqual(expected) + }) + }) - describe("type", () => { + describe('type', () => { it.each([ - ["keeps a single string type", { type: "string" }, { type: "string" }], + ['keeps a single string type', { type: 'string' }, { type: 'string' }], [ - "converts a type array with null into type plus nullable", - { type: ["string", "null"] }, - { nullable: true, type: "string" }, + 'converts a type array with null into type plus nullable', + { type: ['string', 'null'] }, + { nullable: true, type: 'string' }, ], [ - "converts a null-only type array into nullable plus a null enum", - { type: ["null"] }, + 'converts a null-only type array into nullable plus a null enum', + { type: ['null'] }, { enum: [null], nullable: true }, ], [ - "converts a null-only type string into nullable plus a null enum", - { type: "null" }, + 'converts a null-only type string into nullable plus a null enum', + { type: 'null' }, { enum: [null], nullable: true }, ], [ - "intersects an existing enum with a null-only type", - { enum: ["a", null], type: ["null"] }, + 'intersects an existing enum with a null-only type', + { enum: ['a', null], type: ['null'] }, { enum: [null], nullable: true }, ], [ - "matches nothing when the enum of a null-only type excludes null", - { enum: ["a"], type: ["null"] }, - { enum: ["a"], not: {}, nullable: true }, + 'matches nothing when the enum of a null-only type excludes null', + { enum: ['a'], type: ['null'] }, + { enum: ['a'], not: {}, nullable: true }, ], [ - "clones a malformed enum of a null-only type through", - { enum: "junk", type: ["null"] }, - { enum: "junk", nullable: true }, + 'clones a malformed enum of a null-only type through', + { enum: 'junk', type: ['null'] }, + { enum: 'junk', nullable: true }, ], [ - "keeps a null const as the enum of a null-only type", - { const: null, type: ["null"] }, + 'keeps a null const as the enum of a null-only type', + { const: null, type: ['null'] }, { enum: [null], nullable: true }, ], [ - "matches nothing when a non-null const contradicts a null-only type", - { const: 7, type: ["null"] }, + 'matches nothing when a non-null const contradicts a null-only type', + { const: 7, type: ['null'] }, { enum: [7], not: {}, nullable: true }, ], [ - "converts multiple non-null types into anyOf variants", - { type: ["string", "integer"] }, - { anyOf: [{ type: "string" }, { type: "integer" }] }, + 'converts multiple non-null types into anyOf variants', + { type: ['string', 'integer'] }, + { anyOf: [{ type: 'string' }, { type: 'integer' }] }, ], [ - "converts multiple types with null into nullable anyOf variants", - { type: ["string", "integer", "null"] }, + 'converts multiple types with null into nullable anyOf variants', + { type: ['string', 'integer', 'null'] }, { anyOf: [ - { nullable: true, type: "string" }, - { nullable: true, type: "integer" }, + { nullable: true, type: 'string' }, + { nullable: true, type: 'integer' }, ], }, ], [ - "gives synthesized array variants an empty items", - { type: ["array", "string"] }, - { anyOf: [{ items: {}, type: "array" }, { type: "string" }] }, + 'gives synthesized array variants an empty items', + { type: ['array', 'string'] }, + { anyOf: [{ items: {}, type: 'array' }, { type: 'string' }] }, ], [ - "copies existing items into the synthesized array variant", - { items: { type: "integer" }, type: ["array", "string", "null"] }, + 'copies existing items into the synthesized array variant', + { items: { type: 'integer' }, type: ['array', 'string', 'null'] }, { anyOf: [ - { items: { type: "integer" }, nullable: true, type: "array" }, - { nullable: true, type: "string" }, + { items: { type: 'integer' }, nullable: true, type: 'array' }, + { nullable: true, type: 'string' }, ], - items: { type: "integer" }, + items: { type: 'integer' }, }, ], [ - "wraps the type union into allOf when anyOf already exists", - { anyOf: [{ minLength: 1 }], type: ["string", "integer"] }, + 'wraps the type union into allOf when anyOf already exists', + { anyOf: [{ minLength: 1 }], type: ['string', 'integer'] }, { - allOf: [{ anyOf: [{ type: "string" }, { type: "integer" }] }], + allOf: [{ anyOf: [{ type: 'string' }, { type: 'integer' }] }], anyOf: [{ minLength: 1 }], }, ], [ - "appends the type union to an existing allOf when anyOf also exists", + 'appends the type union to an existing allOf when anyOf also exists', { - allOf: [{ title: "t" }], + allOf: [{ title: 't' }], anyOf: [{ minLength: 1 }], - type: ["string", "integer"], + type: ['string', 'integer'], }, { allOf: [ - { title: "t" }, - { anyOf: [{ type: "string" }, { type: "integer" }] }, + { title: 't' }, + { anyOf: [{ type: 'string' }, { type: 'integer' }] }, ], anyOf: [{ minLength: 1 }], }, ], [ - "drops the type union when anyOf exists and allOf is malformed", + 'drops the type union when anyOf exists and allOf is malformed', { - allOf: "junk", - anyOf: [{ type: "string" }], - type: ["integer", "string"], + allOf: 'junk', + anyOf: [{ type: 'string' }], + type: ['integer', 'string'], }, - { allOf: "junk", anyOf: [{ type: "string" }] }, + { allOf: 'junk', anyOf: [{ type: 'string' }] }, ], [ - "deduplicates type array entries", - { type: ["string", "string"] }, - { type: "string" }, + 'deduplicates type array entries', + { type: ['string', 'string'] }, + { type: 'string' }, ], [ - "ignores non-string type array entries beside valid ones", - { type: ["string", 42] }, - { type: "string" }, + 'ignores non-string type array entries beside valid ones', + { type: ['string', 42] }, + { type: 'string' }, ], [ - "passes a type array of only junk entries through", + 'passes a type array of only junk entries through', { type: [42] }, { type: [42] }, ], - ["passes a junk number type through", { type: 42 }, { type: 42 }], + ['passes a junk number type through', { type: 42 }, { type: 42 }], [ - "passes a junk object type through", + 'passes a junk object type through', { type: { a: 1 } }, { type: { a: 1 } }, ], - ["drops an empty type array", { type: [] }, {}], + ['drops an empty type array', { type: [] }, {}], [ - "adds empty items to an array type without items", - { type: "array" }, - { items: {}, type: "array" }, + 'adds empty items to an array type without items', + { type: 'array' }, + { items: {}, type: 'array' }, ], [ - "adds empty items to a nullable array type without items", - { type: ["array", "null"] }, - { items: {}, nullable: true, type: "array" }, + 'adds empty items to a nullable array type without items', + { type: ['array', 'null'] }, + { items: {}, nullable: true, type: 'array' }, ], - ])("%s", (_name, input, expected) => { - expect(convertSchema(input)).toEqual(expected); - }); - }); + ])('%s', (_name, input, expected) => { + expect(convertSchema(input)).toEqual(expected) + }) + }) - describe("const", () => { + describe('const', () => { it.each([ [ - "converts const into a single-value enum", - { const: "a" }, - { enum: ["a"] }, + 'converts const into a single-value enum', + { const: 'a' }, + { enum: ['a'] }, ], - ["converts a zero const", { const: 0 }, { enum: [0] }], - ["converts a false const", { const: false }, { enum: [false] }], - ["converts an empty-string const", { const: "" }, { enum: [""] }], + ['converts a zero const', { const: 0 }, { enum: [0] }], + ['converts a false const', { const: false }, { enum: [false] }], + ['converts an empty-string const', { const: '' }, { enum: [''] }], [ - "converts a null const and marks the schema nullable", + 'converts a null const and marks the schema nullable', { const: null }, { enum: [null], nullable: true }, ], [ - "replaces an existing enum with the const value", + 'replaces an existing enum with the const value', { const: 5, enum: [1, 2] }, { enum: [5] }, ], - ])("%s", (_name, input, expected) => { - expect(convertSchema(input)).toEqual(expected); - }); - }); + ])('%s', (_name, input, expected) => { + expect(convertSchema(input)).toEqual(expected) + }) + }) - describe("exclusive bounds", () => { + describe('exclusive bounds', () => { it.each([ [ - "converts a numeric exclusiveMinimum into minimum plus flag", + 'converts a numeric exclusiveMinimum into minimum plus flag', { exclusiveMinimum: 3 }, { exclusiveMinimum: true, minimum: 3 }, ], [ - "keeps a tighter inclusive minimum and drops the exclusive one", + 'keeps a tighter inclusive minimum and drops the exclusive one', { exclusiveMinimum: 3, minimum: 5 }, { minimum: 5 }, ], [ - "overrides a looser inclusive minimum with the exclusive bound", + 'overrides a looser inclusive minimum with the exclusive bound', { exclusiveMinimum: 5, minimum: 3 }, { exclusiveMinimum: true, minimum: 5 }, ], [ - "prefers the exclusive form for equal minimum bounds", + 'prefers the exclusive form for equal minimum bounds', { exclusiveMinimum: 3, minimum: 3 }, { exclusiveMinimum: true, minimum: 3 }, ], [ - "converts a numeric exclusiveMaximum into maximum plus flag", + 'converts a numeric exclusiveMaximum into maximum plus flag', { exclusiveMaximum: 10 }, { exclusiveMaximum: true, maximum: 10 }, ], [ - "keeps a tighter inclusive maximum and drops the exclusive one", + 'keeps a tighter inclusive maximum and drops the exclusive one', { exclusiveMaximum: 10, maximum: 5 }, { maximum: 5 }, ], [ - "overrides a looser inclusive maximum with the exclusive bound", + 'overrides a looser inclusive maximum with the exclusive bound', { exclusiveMaximum: 5, maximum: 10 }, { exclusiveMaximum: true, maximum: 5 }, ], [ - "prefers the exclusive form for equal maximum bounds", + 'prefers the exclusive form for equal maximum bounds', { exclusiveMaximum: 5, maximum: 5 }, { exclusiveMaximum: true, maximum: 5 }, ], [ - "passes a 3.0-style boolean exclusiveMinimum through", + 'passes a 3.0-style boolean exclusiveMinimum through', { exclusiveMinimum: true, minimum: 3 }, { exclusiveMinimum: true, minimum: 3 }, ], [ - "passes a 3.0-style boolean exclusiveMaximum through", + 'passes a 3.0-style boolean exclusiveMaximum through', { exclusiveMaximum: false, maximum: 3 }, { exclusiveMaximum: false, maximum: 3 }, ], - ])("%s", (_name, input, expected) => { - expect(convertSchema(input)).toEqual(expected); - }); - }); + ])('%s', (_name, input, expected) => { + expect(convertSchema(input)).toEqual(expected) + }) + }) - describe("examples", () => { + describe('examples', () => { it.each([ [ - "promotes the first examples entry to example", - { examples: ["a", "b"] }, - { example: "a" }, + 'promotes the first examples entry to example', + { examples: ['a', 'b'] }, + { example: 'a' }, ], [ - "keeps an explicit example over the examples entries", - { example: "e", examples: ["a"] }, - { example: "e" }, + 'keeps an explicit example over the examples entries', + { example: 'e', examples: ['a'] }, + { example: 'e' }, ], - ["drops empty examples arrays", { examples: [] }, {}], - ["drops non-array examples values", { examples: "junk" }, {}], - ])("%s", (_name, input, expected) => { - expect(convertSchema(input)).toEqual(expected); - }); - }); + ['drops empty examples arrays', { examples: [] }, {}], + ['drops non-array examples values', { examples: 'junk' }, {}], + ])('%s', (_name, input, expected) => { + expect(convertSchema(input)).toEqual(expected) + }) + }) - describe("content keywords", () => { + describe('content keywords', () => { it.each([ [ - "converts contentEncoding base64 into format byte", - { contentEncoding: "base64" }, - { format: "byte" }, + 'converts contentEncoding base64 into format byte', + { contentEncoding: 'base64' }, + { format: 'byte' }, ], [ - "keeps an existing format over contentEncoding", - { contentEncoding: "base64", format: "custom" }, - { format: "custom" }, + 'keeps an existing format over contentEncoding', + { contentEncoding: 'base64', format: 'custom' }, + { format: 'custom' }, ], - ["drops other content encodings", { contentEncoding: "gzip" }, {}], + ['drops other content encodings', { contentEncoding: 'gzip' }, {}], [ - "converts contentMediaType application/octet-stream into format binary", - { contentMediaType: "application/octet-stream" }, - { format: "binary" }, + 'converts contentMediaType application/octet-stream into format binary', + { contentMediaType: 'application/octet-stream' }, + { format: 'binary' }, ], [ - "does not emit format binary when a contentEncoding is present", + 'does not emit format binary when a contentEncoding is present', { - contentEncoding: "gzip", - contentMediaType: "application/octet-stream", + contentEncoding: 'gzip', + contentMediaType: 'application/octet-stream', }, {}, ], [ - "drops other content media types", - { contentMediaType: "image/png" }, + 'drops other content media types', + { contentMediaType: 'image/png' }, {}, ], - ["drops contentSchema", { contentSchema: { type: "string" } }, {}], - ])("%s", (_name, input, expected) => { - expect(convertSchema(input)).toEqual(expected); - }); - }); + ['drops contentSchema', { contentSchema: { type: 'string' } }, {}], + ])('%s', (_name, input, expected) => { + expect(convertSchema(input)).toEqual(expected) + }) + }) - describe("dropped keywords", () => { - it("removes every keyword with no 3.0 equivalent", () => { + describe('dropped keywords', () => { + it('removes every keyword with no 3.0 equivalent', () => { expect( convertSchema({ - $anchor: "a", - $comment: "c", - $defs: { D: { type: "string" } }, - $dynamicAnchor: "da", - $dynamicRef: "#dr", - $id: "https://example.com/s", - $schema: "https://json-schema.org/draft/2020-12/schema", - $vocabulary: { "https://example.com/v": true }, - contains: { type: "string" }, - contentSchema: { type: "string" }, - dependentRequired: { a: ["b"] }, - dependentSchemas: { a: { type: "object" } }, - else: { title: "e" }, - if: { title: "i" }, + $anchor: 'a', + $comment: 'c', + $defs: { D: { type: 'string' } }, + $dynamicAnchor: 'da', + $dynamicRef: '#dr', + $id: 'https://example.com/s', + $schema: 'https://json-schema.org/draft/2020-12/schema', + $vocabulary: { 'https://example.com/v': true }, + contains: { type: 'string' }, + contentSchema: { type: 'string' }, + dependentRequired: { a: ['b'] }, + dependentSchemas: { a: { type: 'object' } }, + else: { title: 'e' }, + if: { title: 'i' }, maxContains: 2, minContains: 1, - patternProperties: { "^x": { type: "string" } }, - prefixItems: [{ type: "string" }], - propertyNames: { pattern: "^a" }, - // oxlint-disable-next-line no-thenable -- `then` is the JSON Schema keyword under test - then: { title: "t" }, - type: "string", + patternProperties: { '^x': { type: 'string' } }, + prefixItems: [{ type: 'string' }], + propertyNames: { pattern: '^a' }, + then: { title: 't' }, + type: 'string', unevaluatedItems: false, unevaluatedProperties: false, - }) - ).toEqual({ type: "string" }); - }); + }), + ).toEqual({ type: 'string' }) + }) it.each([ [ - "drops prefixItems together with its trailing items", - { items: { type: "integer" }, prefixItems: [{ type: "string" }] }, + 'drops prefixItems together with its trailing items', + { items: { type: 'integer' }, prefixItems: [{ type: 'string' }] }, {}, ], [ - "drops boolean additionalProperties together with patternProperties", + 'drops boolean additionalProperties together with patternProperties', { additionalProperties: false, - patternProperties: { "^x-": {} }, - properties: { name: { type: "string" } }, - type: "object", + patternProperties: { '^x-': {} }, + properties: { name: { type: 'string' } }, + type: 'object', }, - { properties: { name: { type: "string" } }, type: "object" }, + { properties: { name: { type: 'string' } }, type: 'object' }, ], [ - "drops schema-valued additionalProperties together with patternProperties", + 'drops schema-valued additionalProperties together with patternProperties', { - additionalProperties: { type: "integer" }, - patternProperties: { "^x-": {} }, - type: "object", + additionalProperties: { type: 'integer' }, + patternProperties: { '^x-': {} }, + type: 'object', }, - { type: "object" }, + { type: 'object' }, ], - ])("%s", (_name, input, expected) => { - expect(convertSchema(input)).toEqual(expected); - }); - }); + ])('%s', (_name, input, expected) => { + expect(convertSchema(input)).toEqual(expected) + }) + }) - describe("enum and required", () => { + describe('enum and required', () => { it.each([ [ - "removes an empty enum", - { enum: [], type: "string" }, - { type: "string" }, + 'removes an empty enum', + { enum: [], type: 'string' }, + { type: 'string' }, ], [ - "keeps a non-empty enum", - { enum: ["a"], type: "string" }, - { enum: ["a"], type: "string" }, + 'keeps a non-empty enum', + { enum: ['a'], type: 'string' }, + { enum: ['a'], type: 'string' }, ], - ["drops an empty required array", { required: [] }, {}], + ['drops an empty required array', { required: [] }, {}], [ - "keeps a non-empty required array", - { required: ["a"] }, - { required: ["a"] }, + 'keeps a non-empty required array', + { required: ['a'] }, + { required: ['a'] }, ], [ - "deduplicates required entries", - { required: ["a", "b", "a"], type: "object" }, - { required: ["a", "b"], type: "object" }, + 'deduplicates required entries', + { required: ['a', 'b', 'a'], type: 'object' }, + { required: ['a', 'b'], type: 'object' }, ], [ - "clones a non-array required value unchanged", - { required: "junk" }, - { required: "junk" }, + 'clones a non-array required value unchanged', + { required: 'junk' }, + { required: 'junk' }, ], - ])("%s", (_name, input, expected) => { - expect(convertSchema(input)).toEqual(expected); - }); - }); + ])('%s', (_name, input, expected) => { + expect(convertSchema(input)).toEqual(expected) + }) + }) - describe("subschemas", () => { + describe('subschemas', () => { it.each([ [ - "converts nested property schemas", + 'converts nested property schemas', { - properties: { a: { type: ["string", "null"] }, b: true }, - type: "object", + properties: { a: { type: ['string', 'null'] }, b: true }, + type: 'object', }, { - properties: { a: { nullable: true, type: "string" }, b: {} }, - type: "object", + properties: { a: { nullable: true, type: 'string' }, b: {} }, + type: 'object', }, ], [ - "keeps boolean additionalProperties", + 'keeps boolean additionalProperties', { additionalProperties: false }, { additionalProperties: false }, ], [ - "converts schema additionalProperties", - { additionalProperties: { type: ["string", "null"] } }, - { additionalProperties: { nullable: true, type: "string" } }, + 'converts schema additionalProperties', + { additionalProperties: { type: ['string', 'null'] } }, + { additionalProperties: { nullable: true, type: 'string' } }, ], [ - "converts allOf, anyOf, oneOf, and not members", + 'converts allOf, anyOf, oneOf, and not members', { allOf: [true], anyOf: [{ const: 1 }], not: false, - oneOf: [{ type: ["integer", "null"] }], + oneOf: [{ type: ['integer', 'null'] }], }, { allOf: [{}], anyOf: [{ enum: [1] }], not: { not: {} }, - oneOf: [{ nullable: true, type: "integer" }], + oneOf: [{ nullable: true, type: 'integer' }], }, ], [ - "clones a non-array allOf value unchanged", - { allOf: "junk" }, - { allOf: "junk" }, + 'clones a non-array allOf value unchanged', + { allOf: 'junk' }, + { allOf: 'junk' }, ], [ - "keeps and converts items when there are no prefixItems", - { items: { type: ["string", "null"] } }, - { items: { nullable: true, type: "string" } }, + 'keeps and converts items when there are no prefixItems', + { items: { type: ['string', 'null'] } }, + { items: { nullable: true, type: 'string' } }, ], - ["converts a true items schema", { items: true }, { items: {} }], + ['converts a true items schema', { items: true }, { items: {} }], [ - "converts a false items schema", + 'converts a false items schema', { items: false }, { items: { not: {} } }, ], - ])("%s", (_name, input, expected) => { - expect(convertSchema(input)).toEqual(expected); - }); - }); + ])('%s', (_name, input, expected) => { + expect(convertSchema(input)).toEqual(expected) + }) + }) - describe("xml nodeType carried over from 3.2", () => { + describe('xml nodeType carried over from 3.2', () => { it.each([ [ - "converts nodeType attribute to attribute: true", - { type: "string", xml: { name: "n", nodeType: "attribute" } }, - { type: "string", xml: { attribute: true, name: "n" } }, + 'converts nodeType attribute to attribute: true', + { type: 'string', xml: { name: 'n', nodeType: 'attribute' } }, + { type: 'string', xml: { attribute: true, name: 'n' } }, ], [ - "converts nodeType element on an array schema to wrapped: true", - { items: {}, type: "array", xml: { nodeType: "element" } }, - { items: {}, type: "array", xml: { wrapped: true } }, + 'converts nodeType element on an array schema to wrapped: true', + { items: {}, type: 'array', xml: { nodeType: 'element' } }, + { items: {}, type: 'array', xml: { wrapped: true } }, ], [ - "converts nodeType element on a nullable array schema to wrapped: true", - { type: ["array", "null"], xml: { nodeType: "element" } }, - { items: {}, nullable: true, type: "array", xml: { wrapped: true } }, + 'converts nodeType element on a nullable array schema to wrapped: true', + { type: ['array', 'null'], xml: { nodeType: 'element' } }, + { items: {}, nullable: true, type: 'array', xml: { wrapped: true } }, ], [ - "removes nodeType element on non-array schemas", - { type: "string", xml: { nodeType: "element" } }, - { type: "string", xml: {} }, + 'removes nodeType element on non-array schemas', + { type: 'string', xml: { nodeType: 'element' } }, + { type: 'string', xml: {} }, ], [ - "removes inexpressible nodeType values", - { type: "string", xml: { name: "n", nodeType: "text" } }, - { type: "string", xml: { name: "n" } }, + 'removes inexpressible nodeType values', + { type: 'string', xml: { name: 'n', nodeType: 'text' } }, + { type: 'string', xml: { name: 'n' } }, ], [ - "clones xml objects without nodeType unchanged", - { type: "string", xml: { attribute: true, name: "n" } }, - { type: "string", xml: { attribute: true, name: "n" } }, + 'clones xml objects without nodeType unchanged', + { type: 'string', xml: { attribute: true, name: 'n' } }, + { type: 'string', xml: { attribute: true, name: 'n' } }, ], [ - "clones malformed xml values unchanged", - { type: "string", xml: "junk" }, - { type: "string", xml: "junk" }, + 'clones malformed xml values unchanged', + { type: 'string', xml: 'junk' }, + { type: 'string', xml: 'junk' }, ], - ])("%s", (_name, input, expected) => { - expect(convertSchema(input)).toEqual(expected); - }); - }); + ])('%s', (_name, input, expected) => { + expect(convertSchema(input)).toEqual(expected) + }) + }) - describe("extensions and unknown keywords", () => { - it("preserves x- keys and unknown keywords", () => { - const input = { customKeyword: "v", title: "t", "x-foo": { a: 1 } }; - expect(convertSchema(input)).toEqual(input); - }); + describe('extensions and unknown keywords', () => { + it('preserves x- keys and unknown keywords', () => { + const input = { 'customKeyword': 'v', 'title': 't', 'x-foo': { a: 1 } } + expect(convertSchema(input)).toEqual(input) + }) - it("treats keywords named like Object.prototype members as unknown keywords", () => { + it('treats keywords named like Object.prototype members as unknown keywords', () => { const input = { constructor: 1, hasOwnProperty: 2, toString: 3, - type: "string", - }; - expect(convertSchema(input)).toEqual(input); - }); - }); + type: 'string', + } + expect(convertSchema(input)).toEqual(input) + }) + }) - describe("robustness", () => { - it("never mutates the input schema", () => { + describe('robustness', () => { + it('never mutates the input schema', () => { const input = asSchema({ - $ref: "#/c/s", - allOf: [{ type: "string" }], + $ref: '#/c/s', + allOf: [{ type: 'string' }], const: null, - examples: ["a"], + examples: ['a'], exclusiveMinimum: 5, minimum: 3, - prefixItems: [{ type: "string" }], - properties: { a: { type: ["string", "null"] } }, - type: ["object", "null"], - }); - const before = structuredClone(input); - downgradeSchemaV31ToV30(input); - expect(input).toEqual(before); - }); - - it("converts deeply nested schemas without throwing", () => { - let deep = asSchema({ type: "string" }); + prefixItems: [{ type: 'string' }], + properties: { a: { type: ['string', 'null'] } }, + type: ['object', 'null'], + }) + const before = structuredClone(input) + downgradeSchemaV31ToV30(input) + expect(input).toEqual(before) + }) + + it('converts deeply nested schemas without throwing', () => { + let deep = asSchema({ type: 'string' }) for (let index = 0; index < 1000; index += 1) { - deep = asSchema({ items: deep, type: "array" }); + deep = asSchema({ items: deep, type: 'array' }) } - expect(() => downgradeSchemaV31ToV30(deep)).not.toThrow(); - }); + expect(() => downgradeSchemaV31ToV30(deep)).not.toThrow() + }) - it("converts a schema whose subtree cycles back to itself without throwing", () => { - const properties: UnknownRecord = {}; - const node: UnknownRecord = { properties, type: "object" }; - properties.self = node; + it('converts a schema whose subtree cycles back to itself without throwing', () => { + const properties: UnknownRecord = {} + const node: UnknownRecord = { properties, type: 'object' } + properties.self = node expect(convertSchema(node)).toHaveProperty( - ["properties", "self", "type"], - "object" - ); - }); - }); -}); + ['properties', 'self', 'type'], + 'object', + ) + }) + }) +}) diff --git a/packages/downgrader/src/v3.1-to-v3.0.ts b/packages/downgrader/src/v3.1-to-v3.0.ts index 83b8539..eff5c60 100644 --- a/packages/downgrader/src/v3.1-to-v3.0.ts +++ b/packages/downgrader/src/v3.1-to-v3.0.ts @@ -1,5 +1,3 @@ -/* oxlint-disable anti-slop/no-unknown-parameters, anti-slop/no-unknown-returns, anti-slop/no-known-value-widening, anti-slop/no-runtime-typeof -- this converter is the I/O boundary for untrusted OpenAPI documents: it walks arbitrary input defensively and passes malformed parts through unchanged, so `unknown` values and runtime type checks are the domain contract here */ - /** * Converts OpenAPI 3.1 documents and schemas to OpenAPI 3.0 (targeting the * latest patch release, 3.0.4). @@ -32,9 +30,9 @@ * @see {@link https://spec.openapis.org/oas/v3.0.4.html} */ -import type { OpenAPIV3_0, OpenAPIV3_1 } from "@openapi-spec/types"; +import type { OpenAPIV3_0, OpenAPIV3_1 } from '@openapi-spec/types' -import type { FieldConverter, FieldTable, UnknownRecord } from "./shared"; +import type { FieldConverter, FieldTable, UnknownRecord } from './shared' import { convertRecord, deepClone, @@ -45,192 +43,181 @@ import { mapRecord, operationFields, setKey, -} from "./shared"; +} from './shared' /** * 3.0 references stand alone: a Reference Object is reduced to its `$ref` * (no `summary`/`description` overrides), anything else is converted. */ -const convertRefOr = ( - value: unknown, - convert: (item: unknown) => unknown -): unknown => { - const ref = getRef(value); - return ref === undefined ? convert(value) : { $ref: ref }; -}; +function convertRefOr(value: unknown, convert: (item: unknown) => unknown): unknown { + const ref = getRef(value) + return ref === undefined ? convert(value) : { $ref: ref } +} /** Field converter for a map of reference-or-object entries. */ -const refMap = - (convert: (item: unknown) => unknown): FieldConverter => - (item) => - mapRecord(item, (entry) => convertRefOr(entry, convert)); +function refMap(convert: (item: unknown) => unknown): FieldConverter { + return item => + mapRecord(item, entry => convertRefOr(entry, convert)) +} /** Field converter for a list of reference-or-object entries. */ -const refList = - (convert: (item: unknown) => unknown): FieldConverter => - (item) => - mapArray(item, (entry) => convertRefOr(entry, convert)); - -const applyTypes = ( - types: string[], - schema: UnknownRecord, - out: UnknownRecord -): void => { - const nullable = types.includes("null"); - const rest = types.filter((item) => item !== "null"); +function refList(convert: (item: unknown) => unknown): FieldConverter { + return item => + mapArray(item, entry => convertRefOr(entry, convert)) +} + +function applyTypes(types: string[], schema: UnknownRecord, out: UnknownRecord): void { + const nullable = types.includes('null') + const rest = types.filter(item => item !== 'null') if (rest.length === 1) { - const [single] = rest; - out.type = single; + const [single] = rest + out.type = single if (nullable) { - out.nullable = true; + out.nullable = true } - return; + return } if (rest.length === 0) { if (!nullable) { // `type: []` allows nothing 3.0 can express; drop it. - return; + return } // `type: "null"` alone: 3.0's `nullable` needs a sibling `type`, so a // single-value `enum` is the closest expressible form. Sibling `enum`/ // `const` values intersect with the null type — only null can survive, // and a sibling that excludes null leaves a schema matching nothing. - out.nullable = true; - if ("const" in schema) { + out.nullable = true + if ('const' in schema) { // convertConst emits the single-value enum; a non-null const // contradicts the null type, so nothing may validate. if (schema.const !== null) { - out.not = {}; + out.not = {} } - return; + return } if (Array.isArray(schema.enum)) { if (schema.enum.includes(null)) { - out.enum = [null]; - } else { - out.not = {}; + out.enum = [null] + } + else { + out.not = {} } - return; + return } - if (!("enum" in schema)) { - out.enum = [null]; + if (!('enum' in schema)) { + out.enum = [null] } - return; + return } // Multiple non-null types: 3.0 only allows a single `type`, so the type // union moves into `anyOf` branches. const variants = rest.map((item) => { - const variant: UnknownRecord = { type: item }; - if (item === "array") { + const variant: UnknownRecord = { type: item } + if (item === 'array') { // 3.0 requires `items` whenever `type` is "array". - variant.items = out.items === undefined ? {} : deepClone(out.items); + variant.items = out.items === undefined ? {} : deepClone(out.items) } if (nullable) { - variant.nullable = true; + variant.nullable = true } - return variant; - }); + return variant + }) if (out.anyOf === undefined) { - out.anyOf = variants; - } else if (out.allOf === undefined || Array.isArray(out.allOf)) { + out.anyOf = variants + } + else if (out.allOf === undefined || Array.isArray(out.allOf)) { out.allOf = [ ...(Array.isArray(out.allOf) ? out.allOf : []), { anyOf: variants }, - ]; + ] } // With both anyOf occupied and a malformed allOf, the inexpressible type // union is dropped rather than clobbering the passed-through allOf. -}; +} -const convertType = (schema: UnknownRecord, out: UnknownRecord): void => { - const { type } = schema; +function convertType(schema: UnknownRecord, out: UnknownRecord): void { + const { type } = schema if (type === undefined) { - return; + return } - if (typeof type === "string") { - applyTypes([type], schema, out); - return; + if (typeof type === 'string') { + applyTypes([type], schema, out) + return } if (Array.isArray(type)) { - const types = [...new Set(type.filter((item) => typeof item === "string"))]; + const types = [...new Set(type.filter(item => typeof item === 'string'))] if (types.length === 0 && type.length > 0) { // Only malformed entries: pass the array through unchanged. - setKey(out, "type", deepClone(type)); - return; + setKey(out, 'type', deepClone(type)) + return } - applyTypes(types, schema, out); - return; + applyTypes(types, schema, out) + return } // Malformed: pass through. - setKey(out, "type", deepClone(type)); -}; + setKey(out, 'type', deepClone(type)) +} -const convertConst = (schema: UnknownRecord, out: UnknownRecord): void => { - if (!("const" in schema)) { - return; +function convertConst(schema: UnknownRecord, out: UnknownRecord): void { + if (!('const' in schema)) { + return } // `const` is a single-value `enum`. - out.enum = [deepClone(schema.const)]; + out.enum = [deepClone(schema.const)] if (schema.const === null) { - out.nullable = true; + out.nullable = true } -}; +} -const convertExamples = (schema: UnknownRecord, out: UnknownRecord): void => { +function convertExamples(schema: UnknownRecord, out: UnknownRecord): void { // 3.0 only has the singular `example`; the first entry wins, unless an // explicit `example` already exists. The rest have no 3.0 home. if ( - Array.isArray(schema.examples) && - schema.examples.length > 0 && - !("example" in schema) + Array.isArray(schema.examples) + && schema.examples.length > 0 + && !('example' in schema) ) { - out.example = deepClone(schema.examples[0]); + out.example = deepClone(schema.examples[0]) } -}; +} -const convertExclusiveBounds = ( - schema: UnknownRecord, - out: UnknownRecord -): void => { - const { exclusiveMaximum, exclusiveMinimum, maximum, minimum } = schema; +function convertExclusiveBounds(schema: UnknownRecord, out: UnknownRecord): void { + const { exclusiveMaximum, exclusiveMinimum, maximum, minimum } = schema // 3.1's numeric exclusive bounds become 3.0's bound + boolean pairs. When // an inclusive bound is also present, the tighter constraint wins. if ( - typeof exclusiveMinimum === "number" && - !(typeof minimum === "number" && minimum > exclusiveMinimum) + typeof exclusiveMinimum === 'number' + && !(typeof minimum === 'number' && minimum > exclusiveMinimum) ) { - out.minimum = exclusiveMinimum; - out.exclusiveMinimum = true; + out.minimum = exclusiveMinimum + out.exclusiveMinimum = true } if ( - typeof exclusiveMaximum === "number" && - !(typeof maximum === "number" && maximum < exclusiveMaximum) + typeof exclusiveMaximum === 'number' + && !(typeof maximum === 'number' && maximum < exclusiveMaximum) ) { - out.maximum = exclusiveMaximum; - out.exclusiveMaximum = true; + out.maximum = exclusiveMaximum + out.exclusiveMaximum = true } -}; +} -const convertContentKeywords = ( - schema: UnknownRecord, - out: UnknownRecord -): void => { +function convertContentKeywords(schema: UnknownRecord, out: UnknownRecord): void { // 3.1 replaced 3.0's `format: "byte"` / `format: "binary"` with the JSON // Schema content keywords; reconstruct the formats when unambiguous. if (out.format !== undefined) { - return; + return } - if (schema.contentEncoding === "base64") { - out.format = "byte"; - return; + if (schema.contentEncoding === 'base64') { + out.format = 'byte' + return } if ( - schema.contentEncoding === undefined && - schema.contentMediaType === "application/octet-stream" + schema.contentEncoding === undefined + && schema.contentMediaType === 'application/octet-stream' ) { - out.format = "binary"; + out.format = 'binary' } -}; +} /** * 3.1 documents produced from 3.2 ones may carry the 3.2 `nodeType` field @@ -239,71 +226,71 @@ const convertContentKeywords = ( * 3.0 forbids it outright): it maps back to the `attribute`/`wrapped` * flags where expressible and is removed. */ -const convertXml = (value: unknown, schemaType: unknown): unknown => - convertRecord(value, { nodeType: DROP }, (out, xml) => { - if (xml.nodeType === "attribute") { - out.attribute = true; - } else if ( - xml.nodeType === "element" && - (schemaType === "array" || - (Array.isArray(schemaType) && schemaType.includes("array"))) +function convertXml(value: unknown, schemaType: unknown): unknown { + return convertRecord(value, { nodeType: DROP }, (out, xml) => { + if (xml.nodeType === 'attribute') { + out.attribute = true + } + else if ( + xml.nodeType === 'element' + && (schemaType === 'array' + || (Array.isArray(schemaType) && schemaType.includes('array'))) ) { - out.wrapped = true; + out.wrapped = true } - return out; - }); + return out + }) +} /** Converts the keywords whose 3.0 form depends on several 3.1 keywords at once. */ -const finishSchema = ( - out: UnknownRecord, - schema: UnknownRecord -): UnknownRecord => { - convertType(schema, out); - convertConst(schema, out); - convertExamples(schema, out); - convertExclusiveBounds(schema, out); - convertContentKeywords(schema, out); - if (out.type === "array" && out.items === undefined) { +function finishSchema(out: UnknownRecord, schema: UnknownRecord): UnknownRecord { + convertType(schema, out) + convertConst(schema, out) + convertExamples(schema, out) + convertExclusiveBounds(schema, out) + convertContentKeywords(schema, out) + if (out.type === 'array' && out.items === undefined) { // 3.0 requires `items` whenever `type` is "array". - out.items = {}; + out.items = {} } - const ref = schema.$ref; - if (typeof ref === "string") { + const ref = schema.$ref + if (typeof ref === 'string') { if (out.allOf === undefined || Array.isArray(out.allOf)) { // 3.0 references must stand alone: keep the siblings and move the // reference into an `allOf` member. out.allOf = [ { $ref: ref }, ...(Array.isArray(out.allOf) ? out.allOf : []), - ]; - } else { + ] + } + else { // A malformed allOf passes through, so the reference stays in place. - setKey(out, "$ref", ref); + setKey(out, '$ref', ref) } } - return out; -}; + return out +} -const convertSchema = (schema: unknown): unknown => { +function convertSchema(schema: unknown): unknown { if (schema === true) { - return {}; + return {} } if (schema === false) { - return { not: {} }; + return { not: {} } } if ( - isRecord(schema) && - typeof schema.$ref === "string" && - Object.keys(schema).length === 1 + isRecord(schema) + && typeof schema.$ref === 'string' + && Object.keys(schema).length === 1 ) { - return { $ref: schema.$ref }; + return { $ref: schema.$ref } } - // oxlint-disable-next-line no-use-before-define -- mutually recursive with the field table, as schemas are recursive structures - return convertRecord(schema, SCHEMA_FIELDS, finishSchema); -}; + // eslint-disable-next-line ts/no-use-before-define -- mutually recursive with the field table, as schemas are recursive structures + return convertRecord(schema, SCHEMA_FIELDS, finishSchema) +} -const convertSubschemas: FieldConverter = (item) => - mapArray(item, convertSchema); +const convertSubschemas: FieldConverter = item => + mapArray(item, convertSchema) /** * Every 3.1 Schema Object keyword 3.0 treats differently; the rest (including @@ -324,17 +311,17 @@ const SCHEMA_FIELDS: FieldTable = { $id: DROP, // A string $ref is re-attached by finishSchema; malformed values pass // through unchanged. - $ref: (item) => (typeof item === "string" ? DROP : deepClone(item)), + $ref: item => (typeof item === 'string' ? DROP : deepClone(item)), $schema: DROP, $vocabulary: DROP, // With `patternProperties` dropped, `additionalProperties` would also // constrain the previously pattern-matched keys, so it is dropped alongside // (removing a constraint is the safe direction). Booleans are valid in 3.0. additionalProperties: (item, schema) => { - if ("patternProperties" in schema) { - return DROP; + if ('patternProperties' in schema) { + return DROP } - return typeof item === "boolean" ? item : convertSchema(item); + return typeof item === 'boolean' ? item : convertSchema(item) }, allOf: convertSubschemas, anyOf: convertSubschemas, @@ -348,43 +335,42 @@ const SCHEMA_FIELDS: FieldTable = { else: DROP, // 3.0 requires at least one enum entry; an empty enum only constrains, so // removing it is the safe direction. - enum: (item) => + enum: item => Array.isArray(item) && item.length === 0 ? DROP : deepClone(item), examples: DROP, // Numeric bounds are rewritten by finishSchema; 3.0-style booleans (invalid // in 3.1, but accepted gracefully) pass through. - exclusiveMaximum: (item) => - typeof item === "number" ? DROP : deepClone(item), - exclusiveMinimum: (item) => - typeof item === "number" ? DROP : deepClone(item), + exclusiveMaximum: item => + typeof item === 'number' ? DROP : deepClone(item), + exclusiveMinimum: item => + typeof item === 'number' ? DROP : deepClone(item), if: DROP, // With `prefixItems` dropped, a trailing `items` would wrongly constrain // every item, so it is dropped alongside. items: (item, schema) => - "prefixItems" in schema ? DROP : convertSchema(item), + 'prefixItems' in schema ? DROP : convertSchema(item), maxContains: DROP, minContains: DROP, not: convertSchema, oneOf: convertSubschemas, patternProperties: DROP, prefixItems: DROP, - properties: (item) => mapRecord(item, convertSchema), + properties: item => mapRecord(item, convertSchema), propertyNames: DROP, // 3.0 requires the array to be non-empty with unique entries. required: (item) => { if (!Array.isArray(item)) { - return deepClone(item); + return deepClone(item) } - const unique = [...new Set(item)]; - return unique.length === 0 ? DROP : deepClone(unique); + const unique = [...new Set(item)] + return unique.length === 0 ? DROP : deepClone(unique) }, - // oxlint-disable-next-line unicorn/no-thenable -- the JSON Schema `then` keyword; the table is never awaited then: DROP, type: DROP, unevaluatedItems: DROP, unevaluatedProperties: DROP, xml: (item, schema) => convertXml(item, schema.type), -}; +} /** * Converts an OpenAPI 3.1 Schema Object to its OpenAPI 3.0 form. A schema @@ -392,99 +378,90 @@ const SCHEMA_FIELDS: FieldTable = { * sibling keywords is wrapped in `allOf`. See the module documentation for * the full keyword mapping. */ -export const downgradeSchemaV31ToV30 = ( - schema: OpenAPIV3_1.SchemaObject -): OpenAPIV3_0.ReferenceObject | OpenAPIV3_0.SchemaObject => { - const converted: unknown = convertSchema(schema); +export function downgradeSchemaV31ToV30(schema: OpenAPIV3_1.SchemaObject): OpenAPIV3_0.ReferenceObject | OpenAPIV3_0.SchemaObject { + const converted: unknown = convertSchema(schema) // SAFETY: convertSchema rewrites every 3.1-only keyword into its 3.0 form. - return converted as OpenAPIV3_0.ReferenceObject | OpenAPIV3_0.SchemaObject; -}; + return converted as OpenAPIV3_0.ReferenceObject | OpenAPIV3_0.SchemaObject +} -const SECURITY_SCHEMES_REF_PREFIX = "#/components/securitySchemes/"; +const SECURITY_SCHEMES_REF_PREFIX = '#/components/securitySchemes/' interface SecuritySchemeIndex { /** Names of `mutualTLS` schemes, which 3.0 cannot represent at all. */ - mutualTls: Set; + mutualTls: Set /** Scheme name to declared `type`, for every recognizable scheme. */ - types: Map; + types: Map } /** * Resolves the declared `type` of a security scheme, following local * reference aliases with cycle protection. */ -const resolveSchemeType = ( - name: string, - schemes: UnknownRecord, - seen: Set -): string | undefined => { +function resolveSchemeType(name: string, schemes: UnknownRecord, seen: Set): string | undefined { if (seen.has(name) || !Object.hasOwn(schemes, name)) { - return undefined; + return undefined } - const scheme = schemes[name]; + const scheme = schemes[name] if (!isRecord(scheme)) { - return undefined; + return undefined } - if (typeof scheme.type === "string") { - return scheme.type; + if (typeof scheme.type === 'string') { + return scheme.type } - const ref = getRef(scheme); + const ref = getRef(scheme) if (ref !== undefined && ref.startsWith(SECURITY_SCHEMES_REF_PREFIX)) { - const target = ref.slice(SECURITY_SCHEMES_REF_PREFIX.length); - if (target !== "" && !target.includes("/")) { - seen.add(name); - return resolveSchemeType(target, schemes, seen); + const target = ref.slice(SECURITY_SCHEMES_REF_PREFIX.length) + if (target !== '' && !target.includes('/')) { + seen.add(name) + return resolveSchemeType(target, schemes, seen) } } - return undefined; -}; + return undefined +} -const indexSecuritySchemes = (spec: unknown): SecuritySchemeIndex => { - const index: SecuritySchemeIndex = { mutualTls: new Set(), types: new Map() }; - const components = isRecord(spec) ? spec.components : undefined; - const schemes = isRecord(components) ? components.securitySchemes : undefined; +function indexSecuritySchemes(spec: unknown): SecuritySchemeIndex { + const index: SecuritySchemeIndex = { mutualTls: new Set(), types: new Map() } + const components = isRecord(spec) ? spec.components : undefined + const schemes = isRecord(components) ? components.securitySchemes : undefined if (!isRecord(schemes)) { - return index; + return index } for (const name of Object.keys(schemes)) { - const type = resolveSchemeType(name, schemes, new Set()); + const type = resolveSchemeType(name, schemes, new Set()) if (type !== undefined) { - index.types.set(name, type); - if (type === "mutualTLS") { + index.types.set(name, type) + if (type === 'mutualTLS') { // Reference aliases of mutualTLS schemes are removed as well, so no // dangling references survive. - index.mutualTls.add(name); + index.mutualTls.add(name) } } } - return index; -}; + return index +} -const convertRequirement = ( - value: unknown, - index: SecuritySchemeIndex -): unknown => { +function convertRequirement(value: unknown, index: SecuritySchemeIndex): unknown { if (!isRecord(value)) { - return deepClone(value); + return deepClone(value) } - const entries = Object.entries(value); - const kept = entries.filter(([name]) => !index.mutualTls.has(name)); + const entries = Object.entries(value) + const kept = entries.filter(([name]) => !index.mutualTls.has(name)) if (kept.length === 0 && entries.length > 0) { // A requirement that only referenced mutualTLS schemes disappears; an // originally empty `{}` (optional security) is kept. - return DROP; + return DROP } return Object.fromEntries( kept.map(([name, scopes]) => { // 3.0 allows roles only on OAuth-family schemes; roles on unknown // schemes are left alone. - const type = index.types.get(name); - const scoped = - type === undefined || type === "oauth2" || type === "openIdConnect"; - return [name, Array.isArray(scopes) && !scoped ? [] : deepClone(scopes)]; - }) - ); -}; + const type = index.types.get(name) + const scoped + = type === undefined || type === 'oauth2' || type === 'openIdConnect' + return [name, Array.isArray(scopes) && !scoped ? [] : deepClone(scopes)] + }), + ) +} /** * Converts a `security` list. When mutualTLS removal empties a previously @@ -492,123 +469,121 @@ const convertRequirement = ( * array means "no security required" and, on an operation, would override * the root declaration and silently make the operation public. */ -const convertSecurity = ( - value: unknown, - index: SecuritySchemeIndex -): unknown => { +function convertSecurity(value: unknown, index: SecuritySchemeIndex): unknown { if (!Array.isArray(value)) { - return deepClone(value); + return deepClone(value) } const out = value - .map((item) => convertRequirement(item, index)) - .filter((item) => item !== DROP); - return value.length > 0 && out.length === 0 ? DROP : out; -}; + .map(item => convertRequirement(item, index)) + .filter(item => item !== DROP) + return value.length > 0 && out.length === 0 ? DROP : out +} -const convertInfo = (value: unknown): unknown => - convertRecord(value, { +function convertInfo(value: unknown): unknown { + return convertRecord(value, { // No SPDX `identifier` and no `summary` in 3.0. - license: (item) => convertRecord(item, { identifier: DROP }), + license: item => convertRecord(item, { identifier: DROP }), summary: DROP, - }); + }) +} /** Parameter Objects and Header Objects share every field this converter touches. */ -const convertParameterOrHeader = (value: unknown): unknown => - convertRecord( +function convertParameterOrHeader(value: unknown): unknown { + return convertRecord( value, { - // oxlint-disable-next-line no-use-before-define -- mutually recursive with convertMediaType via encoding headers - content: (item) => mapRecord(item, convertMediaType), + + content: item => mapRecord(item, convertMediaType), examples: refMap(deepClone), schema: convertSchema, }, (out, parameter) => { - if (parameter.in === "path") { + if (parameter.in === 'path') { // 3.0 requires `required: true` on every path parameter; 3.1 only // structurally enforces it for schema-based ones. - out.required = true; + out.required = true } - return out; - } - ); + return out + }, + ) +} -const convertEncoding = (value: unknown): unknown => - convertRecord(value, { headers: refMap(convertParameterOrHeader) }); +function convertEncoding(value: unknown): unknown { + return convertRecord(value, { headers: refMap(convertParameterOrHeader) }) +} -const convertMediaType = (value: unknown): unknown => - convertRecord(value, { - encoding: (item) => mapRecord(item, convertEncoding), +function convertMediaType(value: unknown): unknown { + return convertRecord(value, { + encoding: item => mapRecord(item, convertEncoding), examples: refMap(deepClone), schema: convertSchema, - }); + }) +} -const convertContent: FieldConverter = (item) => - mapRecord(item, convertMediaType); +const convertContent: FieldConverter = item => + mapRecord(item, convertMediaType) -const convertRequestBody = (value: unknown): unknown => - convertRecord(value, { content: convertContent }); +function convertRequestBody(value: unknown): unknown { + return convertRecord(value, { content: convertContent }) +} -const convertResponse = (value: unknown): unknown => - convertRecord(value, { +function convertResponse(value: unknown): unknown { + return convertRecord(value, { content: convertContent, headers: refMap(convertParameterOrHeader), links: refMap(deepClone), - }); + }) +} -const convertResponses: FieldConverter = (item) => +const convertResponses: FieldConverter = item => mapRecord(item, (entry, key) => - key.startsWith("x-") + key.startsWith('x-') ? deepClone(entry) - : convertRefOr(entry, convertResponse) - ); - -const convertOperation = ( - value: unknown, - index: SecuritySchemeIndex -): unknown => - convertRecord( + : convertRefOr(entry, convertResponse)) + +function convertOperation(value: unknown, index: SecuritySchemeIndex): unknown { + return convertRecord( value, { - // oxlint-disable-next-line no-use-before-define -- mutually recursive with convertCallback, as callbacks contain path items - callbacks: refMap((item) => convertCallback(item, index)), + + callbacks: refMap(item => convertCallback(item, index)), parameters: refList(convertParameterOrHeader), - requestBody: (item) => convertRefOr(item, convertRequestBody), + requestBody: item => convertRefOr(item, convertRequestBody), responses: convertResponses, - security: (item) => convertSecurity(item, index), + security: item => convertSecurity(item, index), }, (out) => { if (out.responses === undefined) { // Required and non-empty in 3.0, optional in 3.1: a minimal default // response keeps the output valid against the official 3.0 schema. - out.responses = { default: { description: "" } }; + out.responses = { default: { description: '' } } } - return out; - } - ); + return out + }, + ) +} + +function convertCallback(value: unknown, index: SecuritySchemeIndex): unknown { + return mapRecord(value, (item, key) => -const convertCallback = (value: unknown, index: SecuritySchemeIndex): unknown => - mapRecord(value, (item, key) => - // oxlint-disable-next-line no-use-before-define -- mutually recursive with convertPathItem, as path items contain callbacks - key.startsWith("x-") ? deepClone(item) : convertPathItem(item, index) - ); + key.startsWith('x-') ? deepClone(item) : convertPathItem(item, index)) +} -const convertPathItem = (value: unknown, index: SecuritySchemeIndex): unknown => - convertRecord(value, { - ...operationFields((item) => convertOperation(item, index)), +function convertPathItem(value: unknown, index: SecuritySchemeIndex): unknown { + return convertRecord(value, { + ...operationFields(item => convertOperation(item, index)), parameters: refList(convertParameterOrHeader), - }); - -const convertPaths = (value: unknown, index: SecuritySchemeIndex): unknown => - mapRecord(value, (item, key) => - key.startsWith("/") ? convertPathItem(item, index) : deepClone(item) - ); - -const convertComponents = ( - value: unknown, - index: SecuritySchemeIndex -): unknown => - convertRecord(value, { - callbacks: refMap((item) => convertCallback(item, index)), + }) +} + +function convertPaths(value: unknown, index: SecuritySchemeIndex): unknown { + return mapRecord(value, (item, key) => + key.startsWith('/') ? convertPathItem(item, index) : deepClone(item)) +} + +function convertComponents(value: unknown, index: SecuritySchemeIndex): unknown { + return convertRecord(value, { + callbacks: refMap(item => convertCallback(item, index)), examples: refMap(deepClone), headers: refMap(convertParameterOrHeader), links: refMap(deepClone), @@ -617,46 +592,44 @@ const convertComponents = ( pathItems: DROP, requestBodies: refMap(convertRequestBody), responses: refMap(convertResponse), - schemas: (item) => mapRecord(item, convertSchema), - securitySchemes: (item) => + schemas: item => mapRecord(item, convertSchema), + securitySchemes: item => mapRecord(item, (scheme, name) => - index.mutualTls.has(name) ? DROP : convertRefOr(scheme, deepClone) - ), - }); + index.mutualTls.has(name) ? DROP : convertRefOr(scheme, deepClone)), + }) +} -const convertSpec = (spec: unknown): unknown => { - const index = indexSecuritySchemes(spec); +function convertSpec(spec: unknown): unknown { + const index = indexSecuritySchemes(spec) return convertRecord( spec, { - components: (item) => convertComponents(item, index), + components: item => convertComponents(item, index), info: convertInfo, // 3.0 has neither schema-dialect selection nor webhooks. jsonSchemaDialect: DROP, - paths: (item) => convertPaths(item, index), - security: (item) => convertSecurity(item, index), + paths: item => convertPaths(item, index), + security: item => convertSecurity(item, index), webhooks: DROP, }, (out) => { - out.openapi = "3.0.4"; + out.openapi = '3.0.4' if (out.paths === undefined) { // Required in 3.0; an empty Paths Object is valid. - out.paths = {}; + out.paths = {} } - return out; - } - ); -}; + return out + }, + ) +} /** * Converts an OpenAPI 3.1 document to OpenAPI 3.0.4. The input is never * mutated, unknown keys and specification extensions are preserved, and * malformed parts are copied through unchanged instead of throwing. */ -export const downgradeSpecV31ToV30 = ( - spec: OpenAPIV3_1.OpenAPIObject -): OpenAPIV3_0.OpenAPIObject => { - const converted: unknown = convertSpec(spec); +export function downgradeSpecV31ToV30(spec: OpenAPIV3_1.OpenAPIObject): OpenAPIV3_0.OpenAPIObject { + const converted: unknown = convertSpec(spec) // SAFETY: convertSpec rewrites every 3.1-only construct into its 3.0 form. - return converted as OpenAPIV3_0.OpenAPIObject; -}; + return converted as OpenAPIV3_0.OpenAPIObject +} diff --git a/packages/downgrader/src/v3.2-to-v3.1.test.ts b/packages/downgrader/src/v3.2-to-v3.1.test.ts index da026a2..4f3d3e4 100644 --- a/packages/downgrader/src/v3.2-to-v3.1.test.ts +++ b/packages/downgrader/src/v3.2-to-v3.1.test.ts @@ -1,604 +1,596 @@ -/* oxlint-disable anti-slop/no-unknown-parameters, anti-slop/no-unknown-returns -- the helpers deliberately accept and return `unknown` so tests can feed malformed input to the graceful-degradation branches and inspect loosely-shaped output */ +import type { OpenAPIV3_2 } from '@openapi-spec/types' -import type { OpenAPIV3_2 } from "@openapi-spec/types"; +import type { UnknownRecord } from './shared' +import { downgradeSchemaV32ToV31, downgradeSpecV32ToV31 } from './v3.2-to-v3.1' -import type { UnknownRecord } from "./shared"; -import { downgradeSchemaV32ToV31, downgradeSpecV32ToV31 } from "./v3.2-to-v3.1"; +function asSpec(value: unknown): OpenAPIV3_2.OpenAPIObject { + return value as OpenAPIV3_2.OpenAPIObject +} -const asSpec = (value: unknown): OpenAPIV3_2.OpenAPIObject => - // SAFETY: tests deliberately feed malformed documents to exercise graceful handling. - value as OpenAPIV3_2.OpenAPIObject; +function asSchema(value: unknown): OpenAPIV3_2.SchemaObject { + return value as OpenAPIV3_2.SchemaObject +} -const asSchema = (value: unknown): OpenAPIV3_2.SchemaObject => - // SAFETY: tests deliberately feed malformed schemas to exercise graceful handling. - value as OpenAPIV3_2.SchemaObject; - -const dig = (value: unknown, ...path: string[]): unknown => { - let current: unknown = value; +function dig(value: unknown, ...path: string[]): unknown { + let current: unknown = value for (const key of path) { // SAFETY: tests walk converter output whose shape the surrounding assertions pin down. - current = (current as UnknownRecord)[key]; + current = (current as UnknownRecord)[key] } - return current; -}; + return current +} -const convertSpec = (fields: UnknownRecord) => - downgradeSpecV32ToV31(asSpec({ openapi: "3.2.0", ...fields })); +function convertSpec(fields: UnknownRecord) { + return downgradeSpecV32ToV31(asSpec({ openapi: '3.2.0', ...fields })) +} -const convertPathItem = ( - pathItem: unknown, - components: UnknownRecord = {} -): unknown => - dig(convertSpec({ components, paths: { "/a": pathItem } }), "paths", "/a"); +function convertPathItem(pathItem: unknown, components: UnknownRecord = {}): unknown { + return dig(convertSpec({ components, paths: { '/a': pathItem } }), 'paths', '/a') +} -const convertComponent = ( - kind: string, - value: unknown, - components: UnknownRecord = {} -): unknown => - dig( +function convertComponent(kind: string, value: unknown, components: UnknownRecord = {}): unknown { + return dig( convertSpec({ components: { ...components, [kind]: { X: value } } }), - "components", + 'components', kind, - "X" - ); + 'X', + ) +} /** Converts a request body content map, optionally beside `components` to resolve against. */ -const convertContent = ( - content: unknown, - components: UnknownRecord = {} -): unknown => - dig( +function convertContent(content: unknown, components: UnknownRecord = {}): unknown { + return dig( convertPathItem( { post: { requestBody: { content }, responses: {} } }, - components + components, ), - "post", - "requestBody", - "content" - ); - -describe("downgradeSpecV32ToV31", () => { - describe("document", () => { - it("rewrites the openapi field to 3.1.2", () => { + 'post', + 'requestBody', + 'content', + ) +} + +describe('downgradeSpecV32ToV31', () => { + describe('document', () => { + it('rewrites the openapi field to 3.1.2', () => { expect( downgradeSpecV32ToV31({ - info: { title: "t", version: "1.0.0" }, - openapi: "3.2.0", - }) + info: { title: 't', version: '1.0.0' }, + openapi: '3.2.0', + }), ).toEqual({ - info: { title: "t", version: "1.0.0" }, - openapi: "3.1.2", - }); - }); - - it("adds openapi: 3.1.2 when the input has no openapi field", () => { - expect(downgradeSpecV32ToV31(asSpec({}))).toEqual({ openapi: "3.1.2" }); - }); - - it("removes $self", () => { - expect(convertSpec({ $self: "https://example.com/api.json" })).toEqual({ - openapi: "3.1.2", - }); - }); - - it("returns non-object input unchanged", () => { - expect(downgradeSpecV32ToV31(asSpec(null))).toBeNull(); - expect(downgradeSpecV32ToV31(asSpec("junk"))).toBe("junk"); - expect(downgradeSpecV32ToV31(asSpec([1, 2]))).toEqual([1, 2]); - }); - - it("preserves x- keys and unknown keys at the document, path item, and operation levels", () => { + info: { title: 't', version: '1.0.0' }, + openapi: '3.1.2', + }) + }) + + it('adds openapi: 3.1.2 when the input has no openapi field', () => { + expect(downgradeSpecV32ToV31(asSpec({}))).toEqual({ openapi: '3.1.2' }) + }) + + it('removes $self', () => { + expect(convertSpec({ $self: 'https://example.com/api.json' })).toEqual({ + openapi: '3.1.2', + }) + }) + + it('returns non-object input unchanged', () => { + expect(downgradeSpecV32ToV31(asSpec(null))).toBeNull() + expect(downgradeSpecV32ToV31(asSpec('junk'))).toBe('junk') + expect(downgradeSpecV32ToV31(asSpec([1, 2]))).toEqual([1, 2]) + }) + + it('preserves x- keys and unknown keys at the document, path item, and operation levels', () => { const fields = { - futureKey: { anything: [1] }, - info: { title: "t", version: "1" }, - jsonSchemaDialect: "https://spec.openapis.org/oas/3.1/dialect/base", - paths: { - "/a": { - get: { - operationId: "getA", - responses: {}, - unknownOperationKey: 1, - "x-op": true, + 'futureKey': { anything: [1] }, + 'info': { title: 't', version: '1' }, + 'jsonSchemaDialect': 'https://spec.openapis.org/oas/3.1/dialect/base', + 'paths': { + '/a': { + 'get': { + 'operationId': 'getA', + 'responses': {}, + 'unknownOperationKey': 1, + 'x-op': true, }, - unknownPathItemKey: "kept", - "x-item": [1, 2], + 'unknownPathItemKey': 'kept', + 'x-item': [1, 2], }, }, - security: [{ oauth: ["read"] }], - "x-root": { deep: { value: 1 } }, - }; - expect(convertSpec(fields)).toEqual({ ...fields, openapi: "3.1.2" }); - }); - }); - - describe("servers", () => { - it("removes server name at the root, path item, operation, and link levels", () => { + 'security': [{ oauth: ['read'] }], + 'x-root': { deep: { value: 1 } }, + } + expect(convertSpec(fields)).toEqual({ ...fields, openapi: '3.1.2' }) + }) + }) + + describe('servers', () => { + it('removes server name at the root, path item, operation, and link levels', () => { const result = convertSpec({ components: { - links: { L: { operationId: "op", server: { name: "s", url: "/u" } } }, + links: { L: { operationId: 'op', server: { name: 's', url: '/u' } } }, }, paths: { - "/a": { - get: { responses: {}, servers: [{ name: "s", url: "/u" }] }, - servers: [{ name: "s", url: "/u" }], + '/a': { + get: { responses: {}, servers: [{ name: 's', url: '/u' }] }, + servers: [{ name: 's', url: '/u' }], }, }, servers: [ - { description: "d", name: "prod", url: "https://example.com" }, + { description: 'd', name: 'prod', url: 'https://example.com' }, ], - }); + }) expect(result).toEqual({ components: { - links: { L: { operationId: "op", server: { url: "/u" } } }, + links: { L: { operationId: 'op', server: { url: '/u' } } }, }, - openapi: "3.1.2", + openapi: '3.1.2', paths: { - "/a": { - get: { responses: {}, servers: [{ url: "/u" }] }, - servers: [{ url: "/u" }], + '/a': { + get: { responses: {}, servers: [{ url: '/u' }] }, + servers: [{ url: '/u' }], }, }, - servers: [{ description: "d", url: "https://example.com" }], - }); - }); + servers: [{ description: 'd', url: 'https://example.com' }], + }) + }) - it("clones non-array servers and non-object server entries through", () => { + it('clones non-array servers and non-object server entries through', () => { expect( convertSpec({ - paths: { "/a": { servers: "junk" } }, + paths: { '/a': { servers: 'junk' } }, servers: [5, null], - }) + }), ).toEqual({ - openapi: "3.1.2", - paths: { "/a": { servers: "junk" } }, + openapi: '3.1.2', + paths: { '/a': { servers: 'junk' } }, servers: [5, null], - }); - }); - }); + }) + }) + }) - describe("tags", () => { - it("removes tag summary, parent, and kind and keeps other fields", () => { + describe('tags', () => { + it('removes tag summary, parent, and kind and keeps other fields', () => { expect( convertSpec({ tags: [ { - description: "d", - externalDocs: { url: "https://example.com" }, - kind: "nav", - name: "pets", - parent: "animals", - summary: "Pets", + description: 'd', + externalDocs: { url: 'https://example.com' }, + kind: 'nav', + name: 'pets', + parent: 'animals', + summary: 'Pets', }, - "junk", + 'junk', 1, ], - }).tags + }).tags, ).toEqual([ { - description: "d", - externalDocs: { url: "https://example.com" }, - name: "pets", + description: 'd', + externalDocs: { url: 'https://example.com' }, + name: 'pets', }, - "junk", + 'junk', 1, - ]); - }); - }); + ]) + }) + }) - describe("paths and path items", () => { - it("removes the query operation and additionalOperations whatever their shape", () => { + describe('paths and path items', () => { + it('removes the query operation and additionalOperations whatever their shape', () => { expect( convertSpec({ paths: { - "/a": { + '/a': { get: { responses: {} }, - query: { description: "q", responses: {} }, + query: { description: 'q', responses: {} }, }, - "/b": { additionalOperations: { NOTIFY: { description: "n" } } }, - "/c": { additionalOperations: "junk" }, - "/d": { additionalOperations: 42, query: "junk" }, + '/b': { additionalOperations: { NOTIFY: { description: 'n' } } }, + '/c': { additionalOperations: 'junk' }, + '/d': { additionalOperations: 42, query: 'junk' }, }, - }).paths + }).paths, ).toEqual({ - "/a": { get: { responses: {} } }, - "/b": {}, - "/c": {}, - "/d": {}, - }); - }); - - it("converts only keys starting with a slash and clones the rest", () => { + '/a': { get: { responses: {} } }, + '/b': {}, + '/c': {}, + '/d': {}, + }) + }) + + it('converts only keys starting with a slash and clones the rest', () => { expect( convertSpec({ paths: { - "/a": { query: { description: "dropped" } }, - "x-meta": { query: { description: "kept" } }, + '/a': { query: { description: 'dropped' } }, + 'x-meta': { query: { description: 'kept' } }, }, - }).paths - ).toEqual({ "/a": {}, "x-meta": { query: { description: "kept" } } }); - }); + }).paths, + ).toEqual({ '/a': {}, 'x-meta': { query: { description: 'kept' } } }) + }) - it("clones malformed paths, path items, and nested objects through", () => { - expect(convertSpec({ paths: "junk" }).paths).toBe("junk"); + it('clones malformed paths, path items, and nested objects through', () => { + expect(convertSpec({ paths: 'junk' }).paths).toBe('junk') const paths = { - "/a": { - get: "junk", + '/a': { + get: 'junk', post: { requestBody: { content: { - "application/json": 42, - "multipart/form-data": { - encoding: { field: "junk" }, + 'application/json': 42, + 'multipart/form-data': { + encoding: { field: 'junk' }, example: 5, }, }, }, }, - put: { requestBody: 42, responses: { "200": 42 } }, + put: { requestBody: 42, responses: { 200: 42 } }, }, - }; - expect(convertSpec({ paths }).paths).toEqual(paths); - }); - }); + } + expect(convertSpec({ paths }).paths).toEqual(paths) + }) + }) - describe("parameters", () => { - it("removes querystring parameters from operation and path item lists, keeping neighbors and references", () => { + describe('parameters', () => { + it('removes querystring parameters from operation and path item lists, keeping neighbors and references', () => { expect( convertPathItem({ get: { parameters: [ { - content: { "application/x-www-form-urlencoded": {} }, - in: "querystring", - name: "q", + content: { 'application/x-www-form-urlencoded': {} }, + in: 'querystring', + name: 'q', }, - { in: "query", name: "keep" }, - { $ref: "#/components/parameters/P" }, + { in: 'query', name: 'keep' }, + { $ref: '#/components/parameters/P' }, ], responses: {}, }, parameters: [ - { in: "querystring", name: "q" }, - { in: "path", name: "id", required: true }, + { in: 'querystring', name: 'q' }, + { in: 'path', name: 'id', required: true }, ], - }) + }), ).toEqual({ get: { parameters: [ - { in: "query", name: "keep" }, - { $ref: "#/components/parameters/P" }, + { in: 'query', name: 'keep' }, + { $ref: '#/components/parameters/P' }, ], responses: {}, }, - parameters: [{ in: "path", name: "id", required: true }], - }); - }); + parameters: [{ in: 'path', name: 'id', required: true }], + }) + }) - it("removes querystring entries from components.parameters, keeping neighbors and reference entries", () => { + it('removes querystring entries from components.parameters, keeping neighbors and reference entries', () => { expect( convertSpec({ components: { parameters: { - N: { in: "header", name: "h" }, - Q: { in: "querystring", name: "q" }, - R: { $ref: "#/components/parameters/N" }, + N: { in: 'header', name: 'h' }, + Q: { in: 'querystring', name: 'q' }, + R: { $ref: '#/components/parameters/N' }, }, }, - }).components + }).components, ).toEqual({ parameters: { - N: { in: "header", name: "h" }, - R: { $ref: "#/components/parameters/N" }, + N: { in: 'header', name: 'h' }, + R: { $ref: '#/components/parameters/N' }, }, - }); - }); + }) + }) - it("removes references to removed querystring parameters, following alias chains", () => { + it('removes references to removed querystring parameters, following alias chains', () => { const result = convertSpec({ components: { parameters: { - Alias: { $ref: "#/components/parameters/Qs" }, - AliasOfAlias: { $ref: "#/components/parameters/Alias" }, - Keep: { in: "query", name: "k", schema: {} }, + Alias: { $ref: '#/components/parameters/Qs' }, + AliasOfAlias: { $ref: '#/components/parameters/Alias' }, + Keep: { in: 'query', name: 'k', schema: {} }, Qs: { - content: { "application/x-www-form-urlencoded": { schema: {} } }, - in: "querystring", - name: "filter", + content: { 'application/x-www-form-urlencoded': { schema: {} } }, + in: 'querystring', + name: 'filter', }, }, }, paths: { - "/a": { + '/a': { get: { parameters: [ - { $ref: "#/components/parameters/AliasOfAlias" }, - { $ref: "#/components/parameters/Qs" }, - { $ref: "#/components/parameters/Keep" }, + { $ref: '#/components/parameters/AliasOfAlias' }, + { $ref: '#/components/parameters/Qs' }, + { $ref: '#/components/parameters/Keep' }, ], responses: {}, }, - parameters: [{ $ref: "#/components/parameters/Qs" }], + parameters: [{ $ref: '#/components/parameters/Qs' }], }, }, - }); + }) expect(result.components).toEqual({ - parameters: { Keep: { in: "query", name: "k", schema: {} } }, - }); + parameters: { Keep: { in: 'query', name: 'k', schema: {} } }, + }) expect(result.paths).toEqual({ - "/a": { + '/a': { get: { - parameters: [{ $ref: "#/components/parameters/Keep" }], + parameters: [{ $ref: '#/components/parameters/Keep' }], responses: {}, }, parameters: [], }, - }); - }); + }) + }) it.each([ [ - "removes style: cookie and keeps the other fields", - { in: "cookie", name: "c", style: "cookie" }, - { in: "cookie", name: "c" }, + 'removes style: cookie and keeps the other fields', + { in: 'cookie', name: 'c', style: 'cookie' }, + { in: 'cookie', name: 'c' }, ], [ - "keeps other style values", - { in: "query", name: "q", style: "deepObject" }, - { in: "query", name: "q", style: "deepObject" }, + 'keeps other style values', + { in: 'query', name: 'q', style: 'deepObject' }, + { in: 'query', name: 'q', style: 'deepObject' }, ], [ - "keeps allowReserved on query parameters", - { allowReserved: true, in: "query", name: "q", schema: {} }, - { allowReserved: true, in: "query", name: "q", schema: {} }, + 'keeps allowReserved on query parameters', + { allowReserved: true, in: 'query', name: 'q', schema: {} }, + { allowReserved: true, in: 'query', name: 'q', schema: {} }, ], [ - "removes allowReserved on path parameters", + 'removes allowReserved on path parameters', { allowReserved: true, - in: "path", - name: "id", + in: 'path', + name: 'id', required: true, schema: {}, }, - { in: "path", name: "id", required: true, schema: {} }, + { in: 'path', name: 'id', required: true, schema: {} }, ], [ - "removes allowReserved on cookie parameters", - { allowReserved: true, in: "cookie", name: "c", schema: {} }, - { in: "cookie", name: "c", schema: {} }, + 'removes allowReserved on cookie parameters', + { allowReserved: true, in: 'cookie', name: 'c', schema: {} }, + { in: 'cookie', name: 'c', schema: {} }, ], [ - "keeps allowReserved on objects without an in field", + 'keeps allowReserved on objects without an in field', { allowReserved: true, schema: {} }, { allowReserved: true, schema: {} }, ], [ - "keeps parameter schemas verbatim and converts example maps", + 'keeps parameter schemas verbatim and converts example maps', { examples: { inline: { dataValue: 1 }, - referenced: { $ref: "#/components/examples/E" }, + referenced: { $ref: '#/components/examples/E' }, }, - in: "query", - name: "q", - schema: { type: "string", xml: { nodeType: "attribute" } }, + in: 'query', + name: 'q', + schema: { type: 'string', xml: { nodeType: 'attribute' } }, }, { examples: { inline: { value: 1 }, - referenced: { $ref: "#/components/examples/E" }, + referenced: { $ref: '#/components/examples/E' }, }, - in: "query", - name: "q", - schema: { type: "string", xml: { nodeType: "attribute" } }, + in: 'query', + name: 'q', + schema: { type: 'string', xml: { nodeType: 'attribute' } }, }, ], - ])("%s", (_name, input, expected) => { - expect(convertComponent("parameters", input)).toEqual(expected); - }); - - it("clones non-object parameter entries, non-array lists, and a malformed components map through", () => { - expect(convertPathItem({ parameters: [null, "junk"] })).toEqual({ - parameters: [null, "junk"], - }); - expect(convertPathItem({ parameters: "junk" })).toEqual({ - parameters: "junk", - }); + ])('%s', (_name, input, expected) => { + expect(convertComponent('parameters', input)).toEqual(expected) + }) + + it('clones non-object parameter entries, non-array lists, and a malformed components map through', () => { + expect(convertPathItem({ parameters: [null, 'junk'] })).toEqual({ + parameters: [null, 'junk'], + }) + expect(convertPathItem({ parameters: 'junk' })).toEqual({ + parameters: 'junk', + }) expect( - convertSpec({ components: { parameters: "junk" } }).components + convertSpec({ components: { parameters: 'junk' } }).components, ).toEqual({ - parameters: "junk", - }); - }); - }); + parameters: 'junk', + }) + }) + }) - describe("components.mediaTypes inlining", () => { - it("inlines a media type reference with the converted media type", () => { + describe('components.mediaTypes inlining', () => { + it('inlines a media type reference with the converted media type', () => { expect( convertContent( - { "application/jsonl": { $ref: "#/components/mediaTypes/Stream" } }, - { mediaTypes: { Stream: { itemSchema: { type: "object" } } } } - ) + { 'application/jsonl': { $ref: '#/components/mediaTypes/Stream' } }, + { mediaTypes: { Stream: { itemSchema: { type: 'object' } } } }, + ), ).toEqual({ - "application/jsonl": { - schema: { items: { type: "object" }, type: "array" }, + 'application/jsonl': { + schema: { items: { type: 'object' }, type: 'array' }, }, - }); - }); + }) + }) - it("inlines media type references in response, parameter, and header content maps", () => { + it('inlines media type references in response, parameter, and header content maps', () => { const reference = { - "application/json": { $ref: "#/components/mediaTypes/Json" }, - }; - const inlined = { "application/json": { schema: { type: "string" } } }; + 'application/json': { $ref: '#/components/mediaTypes/Json' }, + } + const inlined = { 'application/json': { schema: { type: 'string' } } } expect( convertPathItem( { get: { - parameters: [{ content: reference, in: "query", name: "q" }], + parameters: [{ content: reference, in: 'query', name: 'q' }], responses: { - "200": { + 200: { content: reference, - description: "ok", - headers: { "X-H": { content: reference } }, + description: 'ok', + headers: { 'X-H': { content: reference } }, }, }, }, }, - { mediaTypes: { Json: { schema: { type: "string" } } } } - ) + { mediaTypes: { Json: { schema: { type: 'string' } } } }, + ), ).toEqual({ get: { - parameters: [{ content: inlined, in: "query", name: "q" }], + parameters: [{ content: inlined, in: 'query', name: 'q' }], responses: { - "200": { + 200: { content: inlined, - description: "ok", - headers: { "X-H": { content: inlined } }, + description: 'ok', + headers: { 'X-H': { content: inlined } }, }, }, }, - }); - }); + }) + }) - it("resolves chained media type references down to the final object", () => { + it('resolves chained media type references down to the final object', () => { expect( convertContent( - { "application/json": { $ref: "#/components/mediaTypes/A" } }, + { 'application/json': { $ref: '#/components/mediaTypes/A' } }, { mediaTypes: { - A: { $ref: "#/components/mediaTypes/B" }, - B: { schema: { type: "number" } }, + A: { $ref: '#/components/mediaTypes/B' }, + B: { schema: { type: 'number' } }, }, - } - ) - ).toEqual({ "application/json": { schema: { type: "number" } } }); - }); + }, + ), + ).toEqual({ 'application/json': { schema: { type: 'number' } } }) + }) - it("resolves long acyclic reference chains", () => { + it('resolves long acyclic reference chains', () => { const links = Array.from({ length: 40 }, (_unused, index) => [ `m${index}`, { $ref: `#/components/mediaTypes/m${index + 1}` }, - ]); + ]) const mediaTypes = Object.fromEntries([ ...links, - ["m40", { schema: { type: "string" } }], - ]); + ['m40', { schema: { type: 'string' } }], + ]) expect( convertContent( - { "application/json": { $ref: "#/components/mediaTypes/m0" } }, - { mediaTypes } - ) - ).toEqual({ "application/json": { schema: { type: "string" } } }); - }); + { 'application/json': { $ref: '#/components/mediaTypes/m0' } }, + { mediaTypes }, + ), + ).toEqual({ 'application/json': { schema: { type: 'string' } } }) + }) - it("removes content entries whose reference chain is cyclic", () => { + it('removes content entries whose reference chain is cyclic', () => { expect( convertContent( { - "application/json": { $ref: "#/components/mediaTypes/Loop" }, - "application/xml": { $ref: "#/components/mediaTypes/Ping" }, + 'application/json': { $ref: '#/components/mediaTypes/Loop' }, + 'application/xml': { $ref: '#/components/mediaTypes/Ping' }, }, { mediaTypes: { - Loop: { $ref: "#/components/mediaTypes/Loop" }, - Ping: { $ref: "#/components/mediaTypes/Pong" }, - Pong: { $ref: "#/components/mediaTypes/Ping" }, + Loop: { $ref: '#/components/mediaTypes/Loop' }, + Ping: { $ref: '#/components/mediaTypes/Pong' }, + Pong: { $ref: '#/components/mediaTypes/Ping' }, }, - } - ) - ).toEqual({}); - }); + }, + ), + ).toEqual({}) + }) - it("removes content entries with external, unknown, and unparseable references", () => { + it('removes content entries with external, unknown, and unparseable references', () => { expect( convertContent( { - "a/1": { $ref: "#/components/schemas/Foo" }, - "a/2": { $ref: "#/components/mediaTypes/nested/name" }, - "a/3": { $ref: "#/components/mediaTypes/" }, - "a/4": { $ref: "https://example.com/other.json#/mediaTypes/A" }, - "a/5": { $ref: "#/components/mediaTypes/Unknown" }, - "a/6": { $ref: "#/components/mediaTypes/Known" }, + 'a/1': { $ref: '#/components/schemas/Foo' }, + 'a/2': { $ref: '#/components/mediaTypes/nested/name' }, + 'a/3': { $ref: '#/components/mediaTypes/' }, + 'a/4': { $ref: 'https://example.com/other.json#/mediaTypes/A' }, + 'a/5': { $ref: '#/components/mediaTypes/Unknown' }, + 'a/6': { $ref: '#/components/mediaTypes/Known' }, }, - { mediaTypes: { Known: { example: 1 } } } - ) - ).toEqual({ "a/6": { example: 1 } }); - }); + { mediaTypes: { Known: { example: 1 } } }, + ), + ).toEqual({ 'a/6': { example: 1 } }) + }) - it("does not resolve names through the prototype chain of the mediaTypes map", () => { + it('does not resolve names through the prototype chain of the mediaTypes map', () => { expect( convertContent( { - "application/json": { - $ref: "#/components/mediaTypes/hasOwnProperty", + 'application/json': { + $ref: '#/components/mediaTypes/hasOwnProperty', }, }, - { mediaTypes: {} } - ) - ).toEqual({}); - }); + { mediaTypes: {} }, + ), + ).toEqual({}) + }) - it("removes media type references when components.mediaTypes is missing or malformed", () => { + it('removes media type references when components.mediaTypes is missing or malformed', () => { const content = { - "application/json": { $ref: "#/components/mediaTypes/A" }, - }; + 'application/json': { $ref: '#/components/mediaTypes/A' }, + } expect( convertSpec({ paths: { - "/a": { post: { requestBody: { content }, responses: {} } }, + '/a': { post: { requestBody: { content }, responses: {} } }, }, - }) + }), ).toEqual({ - openapi: "3.1.2", + openapi: '3.1.2', paths: { - "/a": { post: { requestBody: { content: {} }, responses: {} } }, + '/a': { post: { requestBody: { content: {} }, responses: {} } }, }, - }); - expect(convertContent(content, { mediaTypes: "junk" })).toEqual({}); - }); + }) + expect(convertContent(content, { mediaTypes: 'junk' })).toEqual({}) + }) - it("removes the mediaTypes map from components", () => { + it('removes the mediaTypes map from components', () => { expect( convertSpec({ components: { mediaTypes: { Json: { schema: {} } }, - schemas: { S: { type: "string" } }, + schemas: { S: { type: 'string' } }, }, - }).components - ).toEqual({ schemas: { S: { type: "string" } } }); - }); + }).components, + ).toEqual({ schemas: { S: { type: 'string' } } }) + }) - it("clones a non-object content value through", () => { - expect(convertContent("junk")).toBe("junk"); - }); + it('clones a non-object content value through', () => { + expect(convertContent('junk')).toBe('junk') + }) - describe("parameters and headers losing their entire content", () => { + describe('parameters and headers losing their entire content', () => { const missing = { - "application/json": { $ref: "#/components/mediaTypes/Missing" }, - }; + 'application/json': { $ref: '#/components/mediaTypes/Missing' }, + } - it("removes a parameter whose only content entry could not be inlined", () => { + it('removes a parameter whose only content entry could not be inlined', () => { expect( convertPathItem({ get: { parameters: [ - { content: missing, in: "query", name: "q" }, - { in: "query", name: "keep", schema: {} }, + { content: missing, in: 'query', name: 'q' }, + { in: 'query', name: 'keep', schema: {} }, ], responses: {}, }, - }) + }), ).toEqual({ get: { - parameters: [{ in: "query", name: "keep", schema: {} }], + parameters: [{ in: 'query', name: 'keep', schema: {} }], responses: {}, }, - }); - }); + }) + }) - it("keeps a parameter when part of its content could be inlined", () => { + it('keeps a parameter when part of its content could be inlined', () => { expect( convertPathItem( { @@ -607,106 +599,106 @@ describe("downgradeSpecV32ToV31", () => { { content: { ...missing, - "application/xml": { - $ref: "#/components/mediaTypes/Known", + 'application/xml': { + $ref: '#/components/mediaTypes/Known', }, }, - in: "query", - name: "q", + in: 'query', + name: 'q', }, ], responses: {}, }, }, - { mediaTypes: { Known: { example: 1 } } } - ) + { mediaTypes: { Known: { example: 1 } } }, + ), ).toEqual({ get: { parameters: [ { - content: { "application/xml": { example: 1 } }, - in: "query", - name: "q", + content: { 'application/xml': { example: 1 } }, + in: 'query', + name: 'q', }, ], responses: {}, }, - }); - }); + }) + }) - it("removes headers and component parameters whose entire content could not be inlined", () => { + it('removes headers and component parameters whose entire content could not be inlined', () => { const result = convertSpec({ components: { headers: { Broken: { content: missing }, Keep: { schema: {} } }, parameters: { - Broken: { content: missing, in: "query", name: "q" }, + Broken: { content: missing, in: 'query', name: 'q' }, }, }, paths: { - "/a": { + '/a': { get: { responses: { - "200": { - description: "ok", + 200: { + description: 'ok', headers: { - "X-Broken": { content: missing }, - "X-Keep": { schema: {} }, + 'X-Broken': { content: missing }, + 'X-Keep': { schema: {} }, }, }, }, }, }, }, - }); + }) expect(result.components).toEqual({ headers: { Keep: { schema: {} } }, parameters: {}, - }); + }) expect(result.paths).toEqual({ - "/a": { + '/a': { get: { responses: { - "200": { - description: "ok", - headers: { "X-Keep": { schema: {} } }, + 200: { + description: 'ok', + headers: { 'X-Keep': { schema: {} } }, }, }, }, }, - }); - }); + }) + }) - it("removes references to removed parameters and headers, following alias chains", () => { + it('removes references to removed parameters and headers, following alias chains', () => { const result = convertSpec({ components: { headers: { Broken: { content: { - "text/plain": { $ref: "#/components/mediaTypes/Loop" }, + 'text/plain': { $ref: '#/components/mediaTypes/Loop' }, }, }, - BrokenAlias: { $ref: "#/components/headers/Broken" }, + BrokenAlias: { $ref: '#/components/headers/Broken' }, }, - mediaTypes: { Loop: { $ref: "#/components/mediaTypes/Loop" } }, + mediaTypes: { Loop: { $ref: '#/components/mediaTypes/Loop' } }, parameters: { - Broken: { content: missing, in: "query", name: "q" }, - BrokenAlias: { $ref: "#/components/parameters/Broken" }, + Broken: { content: missing, in: 'query', name: 'q' }, + BrokenAlias: { $ref: '#/components/parameters/Broken' }, }, }, paths: { - "/a": { + '/a': { get: { parameters: [ - { $ref: "#/components/parameters/Broken" }, - { $ref: "#/components/parameters/BrokenAlias" }, + { $ref: '#/components/parameters/Broken' }, + { $ref: '#/components/parameters/BrokenAlias' }, ], responses: { - "200": { - description: "ok", + 200: { + description: 'ok', headers: { - "X-Broken": { $ref: "#/components/headers/Broken" }, - "X-BrokenAlias": { - $ref: "#/components/headers/BrokenAlias", + 'X-Broken': { $ref: '#/components/headers/Broken' }, + 'X-BrokenAlias': { + $ref: '#/components/headers/BrokenAlias', }, }, }, @@ -714,614 +706,614 @@ describe("downgradeSpecV32ToV31", () => { }, }, }, - }); - expect(result.components).toEqual({ headers: {}, parameters: {} }); + }) + expect(result.components).toEqual({ headers: {}, parameters: {} }) expect(result.paths).toEqual({ - "/a": { + '/a': { get: { parameters: [], - responses: { "200": { description: "ok", headers: {} } }, + responses: { 200: { description: 'ok', headers: {} } }, }, }, - }); - }); - }); - }); - - describe("media types", () => { - it("turns itemSchema into a deep-cloned array schema when no schema exists", () => { - const itemSchema = { type: "object", xml: { nodeType: "text" } }; - const result = convertContent({ "application/jsonl": { itemSchema } }); + }) + }) + }) + }) + + describe('media types', () => { + it('turns itemSchema into a deep-cloned array schema when no schema exists', () => { + const itemSchema = { type: 'object', xml: { nodeType: 'text' } } + const result = convertContent({ 'application/jsonl': { itemSchema } }) expect(result).toEqual({ - "application/jsonl": { + 'application/jsonl': { schema: { - items: { type: "object", xml: { nodeType: "text" } }, - type: "array", + items: { type: 'object', xml: { nodeType: 'text' } }, + type: 'array', }, }, - }); - const promoted = dig(result, "application/jsonl", "schema", "items"); - expect(promoted).not.toBe(itemSchema); - expect(dig(promoted, "xml")).not.toBe(itemSchema.xml); - }); + }) + const promoted = dig(result, 'application/jsonl', 'schema', 'items') + expect(promoted).not.toBe(itemSchema) + expect(dig(promoted, 'xml')).not.toBe(itemSchema.xml) + }) it.each([ [ - "removes itemSchema when a schema already exists", - { itemSchema: { type: "string" }, schema: { type: "array" } }, - { schema: { type: "array" } }, + 'removes itemSchema when a schema already exists', + { itemSchema: { type: 'string' }, schema: { type: 'array' } }, + { schema: { type: 'array' } }, ], [ - "removes prefixEncoding and itemEncoding", + 'removes prefixEncoding and itemEncoding', { example: 1, - itemEncoding: { contentType: "text/plain" }, - prefixEncoding: [{ contentType: "application/json" }], + itemEncoding: { contentType: 'text/plain' }, + prefixEncoding: [{ contentType: 'application/json' }], }, { example: 1 }, ], [ - "removes the 3.2-only description and keeps other fields", + 'removes the 3.2-only description and keeps other fields', { - description: "a JSON payload", + description: 'a JSON payload', example: 5, - schema: { type: "integer" }, + schema: { type: 'integer' }, }, - { example: 5, schema: { type: "integer" } }, + { example: 5, schema: { type: 'integer' } }, ], [ - "converts example maps", + 'converts example maps', { examples: { - inline: { serializedValue: "raw" }, - referenced: { $ref: "#/components/examples/E" }, + inline: { serializedValue: 'raw' }, + referenced: { $ref: '#/components/examples/E' }, }, }, { examples: { - inline: { value: "raw" }, - referenced: { $ref: "#/components/examples/E" }, + inline: { value: 'raw' }, + referenced: { $ref: '#/components/examples/E' }, }, }, ], - ])("%s", (_name, mediaType, expected) => { - expect(convertContent({ "application/json": mediaType })).toEqual({ - "application/json": expected, - }); - }); + ])('%s', (_name, mediaType, expected) => { + expect(convertContent({ 'application/json': mediaType })).toEqual({ + 'application/json': expected, + }) + }) - it("removes nested and positional encoding inside encoding objects while still converting headers", () => { + it('removes nested and positional encoding inside encoding objects while still converting headers', () => { expect( convertContent({ - "multipart/form-data": { + 'multipart/form-data': { encoding: { part: { - contentType: "application/json", + contentType: 'application/json', encoding: { - inner: { headers: { "X-C": { style: "cookie" } } }, + inner: { headers: { 'X-C': { style: 'cookie' } } }, }, headers: { - Referenced: { $ref: "#/components/headers/H" }, - "X-H": { description: "h", style: "cookie" }, + 'Referenced': { $ref: '#/components/headers/H' }, + 'X-H': { description: 'h', style: 'cookie' }, }, - itemEncoding: { contentType: "text/plain" }, - prefixEncoding: [{ contentType: "text/csv" }], + itemEncoding: { contentType: 'text/plain' }, + prefixEncoding: [{ contentType: 'text/csv' }], }, }, }, - }) + }), ).toEqual({ - "multipart/form-data": { + 'multipart/form-data': { encoding: { part: { - contentType: "application/json", + contentType: 'application/json', headers: { - Referenced: { $ref: "#/components/headers/H" }, - "X-H": { description: "h" }, + 'Referenced': { $ref: '#/components/headers/H' }, + 'X-H': { description: 'h' }, }, }, }, }, - }); - }); - }); + }) + }) + }) - describe("responses", () => { + describe('responses', () => { it.each([ [ - "uses summary as the description when none exists", - { summary: "ok" }, - { description: "ok" }, + 'uses summary as the description when none exists', + { summary: 'ok' }, + { description: 'ok' }, ], [ - "removes summary when a description exists", - { description: "d", summary: "s" }, - { description: "d" }, + 'removes summary when a description exists', + { description: 'd', summary: 's' }, + { description: 'd' }, ], [ - "synthesizes an empty description when neither summary nor description exist", + 'synthesizes an empty description when neither summary nor description exist', {}, - { description: "" }, + { description: '' }, ], [ - "clones a non-object headers value through", - { description: "ok", headers: "junk" }, - { description: "ok", headers: "junk" }, + 'clones a non-object headers value through', + { description: 'ok', headers: 'junk' }, + { description: 'ok', headers: 'junk' }, ], [ - "leaves response reference objects untouched, including summary and description overrides", + 'leaves response reference objects untouched, including summary and description overrides', { - $ref: "#/components/responses/R", - description: "override", - summary: "kept", + $ref: '#/components/responses/R', + description: 'override', + summary: 'kept', }, { - $ref: "#/components/responses/R", - description: "override", - summary: "kept", + $ref: '#/components/responses/R', + description: 'override', + summary: 'kept', }, ], - ])("%s", (_name, response, expected) => { - expect(convertComponent("responses", response)).toEqual(expected); - }); + ])('%s', (_name, response, expected) => { + expect(convertComponent('responses', response)).toEqual(expected) + }) - it("clones x- keys of the responses map without response conversion", () => { + it('clones x- keys of the responses map without response conversion', () => { expect( convertPathItem({ get: { responses: { - "200": { summary: "ok" }, - "x-note": { summary: "not a response" }, + '200': { summary: 'ok' }, + 'x-note': { summary: 'not a response' }, }, }, - }) + }), ).toEqual({ get: { responses: { - "200": { description: "ok" }, - "x-note": { summary: "not a response" }, + '200': { description: 'ok' }, + 'x-note': { summary: 'not a response' }, }, }, - }); - }); + }) + }) - it("converts response headers, content, and links", () => { + it('converts response headers, content, and links', () => { expect( - convertComponent("responses", { - content: { "application/json": { itemSchema: { type: "string" } } }, - description: "ok", - headers: { "X-H": { style: "cookie" } }, + convertComponent('responses', { + content: { 'application/json': { itemSchema: { type: 'string' } } }, + description: 'ok', + headers: { 'X-H': { style: 'cookie' } }, links: { - inline: { server: { name: "s", url: "/u" } }, - referenced: { $ref: "#/components/links/L" }, + inline: { server: { name: 's', url: '/u' } }, + referenced: { $ref: '#/components/links/L' }, }, - }) + }), ).toEqual({ content: { - "application/json": { - schema: { items: { type: "string" }, type: "array" }, + 'application/json': { + schema: { items: { type: 'string' }, type: 'array' }, }, }, - description: "ok", - headers: { "X-H": {} }, + description: 'ok', + headers: { 'X-H': {} }, links: { - inline: { server: { url: "/u" } }, - referenced: { $ref: "#/components/links/L" }, + inline: { server: { url: '/u' } }, + referenced: { $ref: '#/components/links/L' }, }, - }); - }); - }); + }) + }) + }) - describe("examples", () => { + describe('examples', () => { it.each([ [ - "moves dataValue into the free value slot", + 'moves dataValue into the free value slot', { dataValue: { a: 1 } }, { value: { a: 1 } }, ], [ - "moves serializedValue into the free value slot", - { serializedValue: "a=1" }, - { value: "a=1" }, + 'moves serializedValue into the free value slot', + { serializedValue: 'a=1' }, + { value: 'a=1' }, ], [ - "removes dataValue when value already exists", + 'removes dataValue when value already exists', { dataValue: 1, value: 2 }, { value: 2 }, ], [ - "removes serializedValue when value already exists", - { serializedValue: "s", value: 2 }, + 'removes serializedValue when value already exists', + { serializedValue: 's', value: 2 }, { value: 2 }, ], [ - "removes dataValue and serializedValue when externalValue exists", + 'removes dataValue and serializedValue when externalValue exists', { dataValue: 1, - externalValue: "https://example.com/e.json", - serializedValue: "s", + externalValue: 'https://example.com/e.json', + serializedValue: 's', }, - { externalValue: "https://example.com/e.json" }, + { externalValue: 'https://example.com/e.json' }, ], [ - "lets dataValue win the value slot over serializedValue", - { dataValue: 1, serializedValue: "s" }, + 'lets dataValue win the value slot over serializedValue', + { dataValue: 1, serializedValue: 's' }, { value: 1 }, ], [ - "keeps other example fields untouched", - { dataValue: 1, description: "d", summary: "s" }, - { description: "d", summary: "s", value: 1 }, + 'keeps other example fields untouched', + { dataValue: 1, description: 'd', summary: 's' }, + { description: 'd', summary: 's', value: 1 }, ], [ - "leaves an example without any value fields unchanged", - { summary: "s" }, - { summary: "s" }, + 'leaves an example without any value fields unchanged', + { summary: 's' }, + { summary: 's' }, ], - ["clones a malformed example through", 42, 42], - ])("%s", (_name, example, expected) => { - expect(convertComponent("examples", example)).toEqual(expected); - }); - }); + ['clones a malformed example through', 42, 42], + ])('%s', (_name, example, expected) => { + expect(convertComponent('examples', example)).toEqual(expected) + }) + }) - describe("security schemes", () => { + describe('security schemes', () => { const flow = { - authorizationUrl: "https://example.com/auth", + authorizationUrl: 'https://example.com/auth', scopes: {}, - tokenUrl: "https://example.com/token", - }; + tokenUrl: 'https://example.com/token', + } it.each([ [ - "removes deprecated: true", - { deprecated: true, type: "http" }, - { type: "http" }, + 'removes deprecated: true', + { deprecated: true, type: 'http' }, + { type: 'http' }, ], [ - "removes deprecated: false", - { deprecated: false, type: "http" }, - { type: "http" }, + 'removes deprecated: false', + { deprecated: false, type: 'http' }, + { type: 'http' }, ], [ - "removes a malformed deprecated", - { deprecated: "yes", type: "http" }, - { type: "http" }, + 'removes a malformed deprecated', + { deprecated: 'yes', type: 'http' }, + { type: 'http' }, ], [ - "removes oauth2MetadataUrl", - { oauth2MetadataUrl: "https://example.com/meta", type: "oauth2" }, - { type: "oauth2" }, + 'removes oauth2MetadataUrl', + { oauth2MetadataUrl: 'https://example.com/meta', type: 'oauth2' }, + { type: 'oauth2' }, ], [ - "removes a malformed oauth2MetadataUrl", - { oauth2MetadataUrl: 42, type: "oauth2" }, - { type: "oauth2" }, + 'removes a malformed oauth2MetadataUrl', + { oauth2MetadataUrl: 42, type: 'oauth2' }, + { type: 'oauth2' }, ], [ - "removes the deviceAuthorization flow and keeps other flows", + 'removes the deviceAuthorization flow and keeps other flows', { flows: { authorizationCode: flow, deviceAuthorization: { - deviceAuthorizationUrl: "https://example.com/device", + deviceAuthorizationUrl: 'https://example.com/device', scopes: {}, tokenUrl: flow.tokenUrl, }, }, - type: "oauth2", + type: 'oauth2', }, - { flows: { authorizationCode: flow }, type: "oauth2" }, + { flows: { authorizationCode: flow }, type: 'oauth2' }, ], [ - "removes a malformed deviceAuthorization", - { flows: { deviceAuthorization: "junk" }, type: "oauth2" }, - { flows: {}, type: "oauth2" }, + 'removes a malformed deviceAuthorization', + { flows: { deviceAuthorization: 'junk' }, type: 'oauth2' }, + { flows: {}, type: 'oauth2' }, ], [ - "clones malformed flows through", - { flows: "junk", type: "oauth2" }, - { flows: "junk", type: "oauth2" }, + 'clones malformed flows through', + { flows: 'junk', type: 'oauth2' }, + { flows: 'junk', type: 'oauth2' }, ], [ - "clones references through", - { $ref: "#/components/securitySchemes/Other" }, - { $ref: "#/components/securitySchemes/Other" }, + 'clones references through', + { $ref: '#/components/securitySchemes/Other' }, + { $ref: '#/components/securitySchemes/Other' }, ], - ["passes a non-object security scheme through", "junk", "junk"], - ])("%s", (_name, scheme, expected) => { - expect(convertComponent("securitySchemes", scheme)).toEqual(expected); - }); - }); - - describe("webhooks and components.pathItems", () => { - it("converts webhook path items and removes their query operation", () => { + ['passes a non-object security scheme through', 'junk', 'junk'], + ])('%s', (_name, scheme, expected) => { + expect(convertComponent('securitySchemes', scheme)).toEqual(expected) + }) + }) + + describe('webhooks and components.pathItems', () => { + it('converts webhook path items and removes their query operation', () => { expect( convertSpec({ webhooks: { newPet: { - post: { responses: { "200": { summary: "ok" } } }, - query: { description: "q" }, + post: { responses: { 200: { summary: 'ok' } } }, + query: { description: 'q' }, }, }, - }).webhooks + }).webhooks, ).toEqual({ - newPet: { post: { responses: { "200": { description: "ok" } } } }, - }); - }); + newPet: { post: { responses: { 200: { description: 'ok' } } } }, + }) + }) - it("converts components.pathItems path items and removes their query operation", () => { + it('converts components.pathItems path items and removes their query operation', () => { expect( - convertComponent("pathItems", { + convertComponent('pathItems', { get: { responses: {} }, - query: { description: "q" }, - }) - ).toEqual({ get: { responses: {} } }); - }); - }); - - describe("callbacks", () => { - it("converts path items in operation-level callbacks and clones x- keys", () => { + query: { description: 'q' }, + }), + ).toEqual({ get: { responses: {} } }) + }) + }) + + describe('callbacks', () => { + it('converts path items in operation-level callbacks and clones x- keys', () => { expect( convertPathItem({ post: { callbacks: { onEvent: { - "x-note": { query: { description: "kept" } }, - "{$request.body#/url}": { - post: { responses: { "200": { summary: "ok" } } }, - query: { description: "q" }, + 'x-note': { query: { description: 'kept' } }, + '{$request.body#/url}': { + post: { responses: { 200: { summary: 'ok' } } }, + query: { description: 'q' }, }, }, - referenced: { $ref: "#/components/callbacks/C" }, + referenced: { $ref: '#/components/callbacks/C' }, }, responses: {}, }, - }) + }), ).toEqual({ post: { callbacks: { onEvent: { - "x-note": { query: { description: "kept" } }, - "{$request.body#/url}": { - post: { responses: { "200": { description: "ok" } } }, + 'x-note': { query: { description: 'kept' } }, + '{$request.body#/url}': { + post: { responses: { 200: { description: 'ok' } } }, }, }, - referenced: { $ref: "#/components/callbacks/C" }, + referenced: { $ref: '#/components/callbacks/C' }, }, responses: {}, }, - }); - }); + }) + }) - it("converts components.callbacks, handling both references and inline callbacks", () => { + it('converts components.callbacks, handling both references and inline callbacks', () => { expect( convertSpec({ components: { callbacks: { inline: { - "https://example.com/cb": { - post: { responses: { "200": { summary: "ok" } } }, - query: { description: "q" }, + 'https://example.com/cb': { + post: { responses: { 200: { summary: 'ok' } } }, + query: { description: 'q' }, }, }, - referenced: { $ref: "#/components/callbacks/inline" }, + referenced: { $ref: '#/components/callbacks/inline' }, }, }, - }).components + }).components, ).toEqual({ callbacks: { inline: { - "https://example.com/cb": { - post: { responses: { "200": { description: "ok" } } }, + 'https://example.com/cb': { + post: { responses: { 200: { description: 'ok' } } }, }, }, - referenced: { $ref: "#/components/callbacks/inline" }, + referenced: { $ref: '#/components/callbacks/inline' }, }, - }); - }); - }); + }) + }) + }) - describe("components", () => { - it("handles references and inline objects across component maps", () => { + describe('components', () => { + it('handles references and inline objects across component maps', () => { expect( convertSpec({ components: { examples: { E: { dataValue: 1 }, - ERef: { $ref: "#/components/examples/E" }, + ERef: { $ref: '#/components/examples/E' }, }, headers: { - H: { style: "cookie" }, - HRef: { $ref: "#/components/headers/H" }, + H: { style: 'cookie' }, + HRef: { $ref: '#/components/headers/H' }, }, links: { junkLink: 42 }, parameters: { - P: { in: "querystring", name: "q" }, - PRef: { $ref: "#/components/parameters/P" }, + P: { in: 'querystring', name: 'q' }, + PRef: { $ref: '#/components/parameters/P' }, }, requestBodies: { B: { content: { - "application/json": { itemSchema: { type: "string" } }, + 'application/json': { itemSchema: { type: 'string' } }, }, }, - BRef: { $ref: "#/components/requestBodies/B" }, + BRef: { $ref: '#/components/requestBodies/B' }, }, responses: { - R: { summary: "ok" }, - RRef: { $ref: "#/components/responses/R" }, + R: { summary: 'ok' }, + RRef: { $ref: '#/components/responses/R' }, }, }, - }).components + }).components, ).toEqual({ examples: { E: { value: 1 }, - ERef: { $ref: "#/components/examples/E" }, + ERef: { $ref: '#/components/examples/E' }, }, - headers: { H: {}, HRef: { $ref: "#/components/headers/H" } }, + headers: { H: {}, HRef: { $ref: '#/components/headers/H' } }, links: { junkLink: 42 }, parameters: {}, requestBodies: { B: { content: { - "application/json": { - schema: { items: { type: "string" }, type: "array" }, + 'application/json': { + schema: { items: { type: 'string' }, type: 'array' }, }, }, }, - BRef: { $ref: "#/components/requestBodies/B" }, + BRef: { $ref: '#/components/requestBodies/B' }, }, responses: { - R: { description: "ok" }, - RRef: { $ref: "#/components/responses/R" }, + R: { description: 'ok' }, + RRef: { $ref: '#/components/responses/R' }, }, - }); - }); + }) + }) - it("clones components.schemas entries unchanged, keeping 3.2 OAS vocabulary fields", () => { + it('clones components.schemas entries unchanged, keeping 3.2 OAS vocabulary fields', () => { const schema = { - discriminator: { defaultMapping: "Dog", propertyName: "kind" }, - xml: { nodeType: "attribute" }, - }; - expect(convertComponent("schemas", schema)).toEqual(schema); - }); + discriminator: { defaultMapping: 'Dog', propertyName: 'kind' }, + xml: { nodeType: 'attribute' }, + } + expect(convertComponent('schemas', schema)).toEqual(schema) + }) - it("clones unknown component keys and passes non-object components through", () => { + it('clones unknown component keys and passes non-object components through', () => { expect( - convertSpec({ components: { custom: { anything: true } } }).components + convertSpec({ components: { custom: { anything: true } } }).components, ).toEqual({ custom: { anything: true }, - }); - expect(convertSpec({ components: "junk" }).components).toBe("junk"); - }); - }); + }) + expect(convertSpec({ components: 'junk' }).components).toBe('junk') + }) + }) - describe("robustness", () => { - it("never mutates the input document", () => { + describe('robustness', () => { + it('never mutates the input document', () => { const spec = asSpec({ - $self: "https://example.com/api.json", + $self: 'https://example.com/api.json', components: { - examples: { E: { dataValue: 1, serializedValue: "s" } }, + examples: { E: { dataValue: 1, serializedValue: 's' } }, mediaTypes: { - A: { $ref: "#/components/mediaTypes/B" }, - B: { itemSchema: { xml: { nodeType: "text" } } }, + A: { $ref: '#/components/mediaTypes/B' }, + B: { itemSchema: { xml: { nodeType: 'text' } } }, }, - pathItems: { P: { query: { description: "q" } } }, - schemas: { S: { discriminator: { defaultMapping: "Dog" } } }, - securitySchemes: { O: { deprecated: true, type: "oauth2" } }, + pathItems: { P: { query: { description: 'q' } } }, + schemas: { S: { discriminator: { defaultMapping: 'Dog' } } }, + securitySchemes: { O: { deprecated: true, type: 'oauth2' } }, }, - openapi: "3.2.0", + openapi: '3.2.0', paths: { - "/a": { - additionalOperations: { NOTIFY: { description: "n" } }, + '/a': { + additionalOperations: { NOTIFY: { description: 'n' } }, get: { - parameters: [{ in: "querystring", name: "q" }], + parameters: [{ in: 'querystring', name: 'q' }], requestBody: { content: { - "application/json": { $ref: "#/components/mediaTypes/A" }, + 'application/json': { $ref: '#/components/mediaTypes/A' }, }, }, - responses: { "200": { summary: "ok" } }, + responses: { 200: { summary: 'ok' } }, }, - query: { description: "q" }, - servers: [{ name: "s", url: "/u" }], + query: { description: 'q' }, + servers: [{ name: 's', url: '/u' }], }, }, - servers: [{ name: "root", url: "https://example.com" }], - tags: [{ kind: "nav", name: "t", parent: "p", summary: "s" }], - webhooks: { hook: { query: { description: "wq" } } }, - }); - const before = structuredClone(spec); - downgradeSpecV32ToV31(spec); - expect(spec).toEqual(before); - }); - - it("converts a path item that cycles through its callbacks without throwing", () => { - const callback: UnknownRecord = {}; + servers: [{ name: 'root', url: 'https://example.com' }], + tags: [{ kind: 'nav', name: 't', parent: 'p', summary: 's' }], + webhooks: { hook: { query: { description: 'wq' } } }, + }) + const before = structuredClone(spec) + downgradeSpecV32ToV31(spec) + expect(spec).toEqual(before) + }) + + it('converts a path item that cycles through its callbacks without throwing', () => { + const callback: UnknownRecord = {} const pathItem: UnknownRecord = { get: { callbacks: { cb: callback }, responses: {} }, - }; - callback.expr = pathItem; - expect(() => convertPathItem(pathItem)).not.toThrow(); - }); - }); -}); - -describe("downgradeSchemaV32ToV31", () => { - it("deep-clones schemas, preserving discriminator defaultMapping and xml nodeType verbatim", () => { + } + callback.expr = pathItem + expect(() => convertPathItem(pathItem)).not.toThrow() + }) + }) +}) + +describe('downgradeSchemaV32ToV31', () => { + it('deep-clones schemas, preserving discriminator defaultMapping and xml nodeType verbatim', () => { const source = { discriminator: { - defaultMapping: "Dog", - mapping: { dog: "#/components/schemas/Dog" }, - propertyName: "kind", + defaultMapping: 'Dog', + mapping: { dog: '#/components/schemas/Dog' }, + propertyName: 'kind', }, - properties: { a: { xml: { nodeType: "text" } } }, - type: "object", - xml: { nodeType: "attribute" }, - }; - const result = downgradeSchemaV32ToV31(asSchema(source)); - expect(result).toEqual(source); - expect(result).not.toBe(source); - expect(dig(result, "discriminator")).not.toBe(source.discriminator); - expect(dig(result, "properties")).not.toBe(source.properties); - expect(dig(result, "properties", "a")).not.toBe(source.properties.a); - expect(dig(result, "properties", "a", "xml")).not.toBe( - source.properties.a.xml - ); - expect(dig(result, "xml")).not.toBe(source.xml); - }); - - it("clones subschema containers at every level", () => { + properties: { a: { xml: { nodeType: 'text' } } }, + type: 'object', + xml: { nodeType: 'attribute' }, + } + const result = downgradeSchemaV32ToV31(asSchema(source)) + expect(result).toEqual(source) + expect(result).not.toBe(source) + expect(dig(result, 'discriminator')).not.toBe(source.discriminator) + expect(dig(result, 'properties')).not.toBe(source.properties) + expect(dig(result, 'properties', 'a')).not.toBe(source.properties.a) + expect(dig(result, 'properties', 'a', 'xml')).not.toBe( + source.properties.a.xml, + ) + expect(dig(result, 'xml')).not.toBe(source.xml) + }) + + it('clones subschema containers at every level', () => { const source = { - allOf: [{ discriminator: { defaultMapping: "Dog" } }, true], - items: { xml: { nodeType: "cdata" } }, - }; - const result = downgradeSchemaV32ToV31(asSchema(source)); - expect(result).toEqual(source); - expect(dig(result, "allOf")).not.toBe(source.allOf); - expect(dig(result, "allOf", "0")).not.toBe(source.allOf[0]); - expect(dig(result, "items")).not.toBe(source.items); - }); - - it("keeps unknown schema keywords, validation keywords, and extensions unchanged", () => { + allOf: [{ discriminator: { defaultMapping: 'Dog' } }, true], + items: { xml: { nodeType: 'cdata' } }, + } + const result = downgradeSchemaV32ToV31(asSchema(source)) + expect(result).toEqual(source) + expect(dig(result, 'allOf')).not.toBe(source.allOf) + expect(dig(result, 'allOf', '0')).not.toBe(source.allOf[0]) + expect(dig(result, 'items')).not.toBe(source.items) + }) + + it('keeps unknown schema keywords, validation keywords, and extensions unchanged', () => { const source = { - customKeyword: { nested: true }, - maximum: 5, - type: "number", - "x-note": "kept", - }; - expect(downgradeSchemaV32ToV31(asSchema(source))).toEqual(source); - }); - - it("passes boolean and junk schema input through", () => { - expect(downgradeSchemaV32ToV31(true)).toBe(true); - expect(downgradeSchemaV32ToV31(false)).toBe(false); - expect(downgradeSchemaV32ToV31(asSchema("junk"))).toBe("junk"); - expect(downgradeSchemaV32ToV31(asSchema(null))).toBeNull(); + 'customKeyword': { nested: true }, + 'maximum': 5, + 'type': 'number', + 'x-note': 'kept', + } + expect(downgradeSchemaV32ToV31(asSchema(source))).toEqual(source) + }) + + it('passes boolean and junk schema input through', () => { + expect(downgradeSchemaV32ToV31(true)).toBe(true) + expect(downgradeSchemaV32ToV31(false)).toBe(false) + expect(downgradeSchemaV32ToV31(asSchema('junk'))).toBe('junk') + expect(downgradeSchemaV32ToV31(asSchema(null))).toBeNull() expect( - downgradeSchemaV32ToV31(asSchema({ allOf: "junk", properties: 5 })) + downgradeSchemaV32ToV31(asSchema({ allOf: 'junk', properties: 5 })), ).toEqual({ - allOf: "junk", + allOf: 'junk', properties: 5, - }); - }); + }) + }) - it("never mutates the input schema", () => { + it('never mutates the input schema', () => { const schema: OpenAPIV3_2.SchemaObject = { - discriminator: { defaultMapping: "Dog", propertyName: "kind" }, - properties: { a: { xml: { nodeType: "attribute" } } }, - type: "object", - }; - const before = structuredClone(schema); - downgradeSchemaV32ToV31(schema); - expect(schema).toEqual(before); - }); + discriminator: { defaultMapping: 'Dog', propertyName: 'kind' }, + properties: { a: { xml: { nodeType: 'attribute' } } }, + type: 'object', + } + const before = structuredClone(schema) + downgradeSchemaV32ToV31(schema) + expect(schema).toEqual(before) + }) - it("converts deeply nested schemas without throwing", () => { - let deep = asSchema({ type: "string" }); + it('converts deeply nested schemas without throwing', () => { + let deep = asSchema({ type: 'string' }) for (let index = 0; index < 1000; index += 1) { - deep = asSchema({ items: deep, type: "array" }); + deep = asSchema({ items: deep, type: 'array' }) } - expect(() => downgradeSchemaV32ToV31(deep)).not.toThrow(); - }); -}); + expect(() => downgradeSchemaV32ToV31(deep)).not.toThrow() + }) +}) diff --git a/packages/downgrader/src/v3.2-to-v3.1.ts b/packages/downgrader/src/v3.2-to-v3.1.ts index 04128f9..ae7aa26 100644 --- a/packages/downgrader/src/v3.2-to-v3.1.ts +++ b/packages/downgrader/src/v3.2-to-v3.1.ts @@ -1,5 +1,3 @@ -/* oxlint-disable anti-slop/no-unknown-parameters, anti-slop/no-unknown-returns, anti-slop/no-known-value-widening, anti-slop/no-runtime-typeof -- this converter is the I/O boundary for untrusted OpenAPI documents: it walks arbitrary input defensively and passes malformed parts through unchanged, so `unknown` values and runtime type checks are the domain contract here */ - /** * Converts OpenAPI 3.2 documents and schemas to OpenAPI 3.1 (targeting the * latest patch release, 3.1.2). @@ -44,9 +42,9 @@ * @see {@link https://spec.openapis.org/oas/v3.1.2.html} */ -import type { OpenAPIV3_1, OpenAPIV3_2 } from "@openapi-spec/types"; +import type { OpenAPIV3_1, OpenAPIV3_2 } from '@openapi-spec/types' -import type { FieldConverter, UnknownRecord } from "./shared"; +import type { FieldConverter, UnknownRecord } from './shared' import { convertRecord, deepClone, @@ -56,19 +54,19 @@ import { mapArray, mapRecord, operationFields, -} from "./shared"; +} from './shared' -const HEADERS_REF_PREFIX = "#/components/headers/"; -const MEDIA_TYPES_REF_PREFIX = "#/components/mediaTypes/"; -const PARAMETERS_REF_PREFIX = "#/components/parameters/"; +const HEADERS_REF_PREFIX = '#/components/headers/' +const MEDIA_TYPES_REF_PREFIX = '#/components/mediaTypes/' +const PARAMETERS_REF_PREFIX = '#/components/parameters/' interface Context { /** The raw `components.mediaTypes` map, used to inline references. */ - mediaTypes: UnknownRecord | undefined; + mediaTypes: UnknownRecord | undefined /** `$ref` strings of `components.headers` entries conversion removes. */ - removedHeaderRefs: ReadonlySet; + removedHeaderRefs: ReadonlySet /** `$ref` strings of `components.parameters` entries conversion removes. */ - removedParameterRefs: ReadonlySet; + removedParameterRefs: ReadonlySet } /** @@ -81,166 +79,167 @@ interface Context { * XML and Discriminator Objects to `x-` extras, and 3.1 tooling will not * act on them. */ -export const downgradeSchemaV32ToV31 = ( - schema: OpenAPIV3_2.SchemaObject -): OpenAPIV3_1.SchemaObject => { - const converted: unknown = deepClone(schema); +export function downgradeSchemaV32ToV31(schema: OpenAPIV3_2.SchemaObject): OpenAPIV3_1.SchemaObject { + const converted: unknown = deepClone(schema) // SAFETY: every 3.2 Schema Object is already a structurally valid 3.1 one. - return converted as OpenAPIV3_1.SchemaObject; -}; + return converted as OpenAPIV3_1.SchemaObject +} /** * References stay references in 3.1 (including their `summary`/`description` * overrides); everything else is converted. */ -const convertRefOr = ( - value: unknown, - context: Context, - convert: (item: unknown, innerContext: Context) => unknown -): unknown => - getRef(value) === undefined ? convert(value, context) : deepClone(value); +function convertRefOr(value: unknown, context: Context, convert: (item: unknown, innerContext: Context) => unknown): unknown { + return getRef(value) === undefined ? convert(value, context) : deepClone(value) +} /** Field converter for a map of reference-or-object entries. */ -const refMap = - ( - context: Context, - convert: (item: unknown, innerContext: Context) => unknown - ): FieldConverter => - (item) => - mapRecord(item, (entry) => convertRefOr(entry, context, convert)); +function refMap(context: Context, convert: (item: unknown, innerContext: Context) => unknown): FieldConverter { + return item => + mapRecord(item, entry => convertRefOr(entry, context, convert)) +} -const convertServer = (value: unknown): unknown => - convertRecord(value, { name: DROP }); +function convertServer(value: unknown): unknown { + return convertRecord(value, { name: DROP }) +} -const convertTag = (value: unknown): unknown => - convertRecord(value, { kind: DROP, parent: DROP, summary: DROP }); +function convertTag(value: unknown): unknown { + return convertRecord(value, { kind: DROP, parent: DROP, summary: DROP }) +} -const convertLink = (value: unknown): unknown => - convertRecord(value, { server: convertServer }); +function convertLink(value: unknown): unknown { + return convertRecord(value, { server: convertServer }) +} -const convertSecurityScheme = (value: unknown): unknown => - convertRecord(value, { +function convertSecurityScheme(value: unknown): unknown { + return convertRecord(value, { // `deprecated`, `oauth2MetadataUrl`, and the device authorization flow // are new in 3.2. deprecated: DROP, - flows: (item) => convertRecord(item, { deviceAuthorization: DROP }), + flows: item => convertRecord(item, { deviceAuthorization: DROP }), oauth2MetadataUrl: DROP, - }); + }) +} -const convertExample = (value: unknown): unknown => - convertRecord( +function convertExample(value: unknown): unknown { + return convertRecord( value, { dataValue: DROP, serializedValue: DROP }, (out, example) => { // 3.2's dataValue/serializedValue fill 3.1's `value` slot when it is // free (and no externalValue competes); whatever cannot be promoted is // removed. - if ("value" in example || "externalValue" in example) { - return out; + if ('value' in example || 'externalValue' in example) { + return out } - if ("dataValue" in example) { - out.value = deepClone(example.dataValue); - } else if ("serializedValue" in example) { - out.value = deepClone(example.serializedValue); + if ('dataValue' in example) { + out.value = deepClone(example.dataValue) } - return out; - } - ); + else if ('serializedValue' in example) { + out.value = deepClone(example.serializedValue) + } + return out + }, + ) +} /** Whether a parameter uses the 3.2-only `querystring` location. */ -const isQuerystringParameter = (value: unknown): boolean => - isRecord(value) && value.in === "querystring"; +function isQuerystringParameter(value: unknown): boolean { + return isRecord(value) && value.in === 'querystring' +} /** Whether the value references a component entry conversion removes. */ -const isRemovedRef = ( - value: unknown, - removed: ReadonlySet -): boolean => { - const ref = getRef(value); - return ref !== undefined && removed.has(ref); -}; +function isRemovedRef(value: unknown, removed: ReadonlySet): boolean { + const ref = getRef(value) + return ref !== undefined && removed.has(ref) +} /** Parameter Objects and Header Objects share every field this converter touches. */ -const convertParameterOrHeader = (value: unknown, context: Context): unknown => - convertRecord( +function convertParameterOrHeader(value: unknown, context: Context): unknown { + return convertRecord( value, { // 3.2 broadened allowReserved beyond query parameters; 3.1 only // defines it there. allowReserved: (item, parameter) => - !("in" in parameter) || parameter.in === "query" + !('in' in parameter) || parameter.in === 'query' ? deepClone(item) : DROP, - // oxlint-disable-next-line no-use-before-define -- mutually recursive with convertContentMap via media type encodings - content: (item) => convertContentMap(item, context), + + content: item => convertContentMap(item, context), examples: refMap(context, convertExample), // "cookie" is not a 3.1 style; removing it lets the 3.1 default // (`form`) take over. Other styles pass through. - style: (item) => (item === "cookie" ? DROP : deepClone(item)), + style: item => (item === 'cookie' ? DROP : deepClone(item)), }, (out, parameter) => { - const lostContent = - isRecord(parameter.content) && - Object.keys(parameter.content).length > 0 && - isRecord(out.content) && - Object.keys(out.content).length === 0; + const lostContent + = isRecord(parameter.content) + && Object.keys(parameter.content).length > 0 + && isRecord(out.content) + && Object.keys(out.content).length === 0 // 3.1 requires exactly one content entry on parameters and headers, so // one whose entire content could not be inlined is removed. - return lostContent ? DROP : out; - } - ); + return lostContent ? DROP : out + }, + ) +} /** * Converts a parameter list entry, removing 3.2-only `querystring` * parameters and references to removed component parameters. */ -const convertParameterEntry = (value: unknown, context: Context): unknown => - isQuerystringParameter(value) || - isRemovedRef(value, context.removedParameterRefs) +function convertParameterEntry(value: unknown, context: Context): unknown { + return isQuerystringParameter(value) + || isRemovedRef(value, context.removedParameterRefs) ? DROP - : convertRefOr(value, context, convertParameterOrHeader); + : convertRefOr(value, context, convertParameterOrHeader) +} -const convertParameterList = (value: unknown, context: Context): unknown => - mapArray(value, (item) => convertParameterEntry(item, context)); +function convertParameterList(value: unknown, context: Context): unknown { + return mapArray(value, item => convertParameterEntry(item, context)) +} -const convertHeaderMap = (value: unknown, context: Context): unknown => - mapRecord(value, (item) => +function convertHeaderMap(value: unknown, context: Context): unknown { + return mapRecord(value, item => isRemovedRef(item, context.removedHeaderRefs) ? DROP - : convertRefOr(item, context, convertParameterOrHeader) - ); + : convertRefOr(item, context, convertParameterOrHeader)) +} -const convertEncoding = (value: unknown, context: Context): unknown => - convertRecord(value, { +function convertEncoding(value: unknown, context: Context): unknown { + return convertRecord(value, { // Nested and positional encoding are new in 3.2. encoding: DROP, - headers: (item) => convertHeaderMap(item, context), + headers: item => convertHeaderMap(item, context), itemEncoding: DROP, prefixEncoding: DROP, - }); + }) +} -const convertMediaType = (value: unknown, context: Context): unknown => - convertRecord( +function convertMediaType(value: unknown, context: Context): unknown { + return convertRecord( value, { // `description`, positional encoding, and nested encoding are // 3.2-only; `itemSchema` is recovered below. description: DROP, - encoding: (item) => - mapRecord(item, (entry) => convertEncoding(entry, context)), + encoding: item => + mapRecord(item, entry => convertEncoding(entry, context)), examples: refMap(context, convertExample), itemEncoding: DROP, itemSchema: DROP, prefixEncoding: DROP, }, (out, mediaType) => { - if ("itemSchema" in mediaType && out.schema === undefined) { + if ('itemSchema' in mediaType && out.schema === undefined) { // The 3.2 sequential media type data model maps streams to arrays. - out.schema = { items: deepClone(mediaType.itemSchema), type: "array" }; + out.schema = { items: deepClone(mediaType.itemSchema), type: 'array' } } - return out; - } - ); + return out + }, + ) +} /** * Follows a content-map entry's `components.mediaTypes` reference chain to @@ -248,52 +247,50 @@ const convertMediaType = (value: unknown, context: Context): unknown => * themselves), or to `DROP` when it cannot be inlined: an external, unknown, * or cyclic target. */ -const resolveMediaType = ( - value: unknown, - mediaTypes: UnknownRecord | undefined, - seen: Set -): unknown => { - const ref = getRef(value); +function resolveMediaType(value: unknown, mediaTypes: UnknownRecord | undefined, seen: Set): unknown { + const ref = getRef(value) if (ref === undefined) { - return value; + return value } if (!ref.startsWith(MEDIA_TYPES_REF_PREFIX)) { - return DROP; + return DROP } - const name = ref.slice(MEDIA_TYPES_REF_PREFIX.length); + const name = ref.slice(MEDIA_TYPES_REF_PREFIX.length) if ( - name === "" || - name.includes("/") || - mediaTypes === undefined || - !Object.hasOwn(mediaTypes, name) || - seen.has(name) + name === '' + || name.includes('/') + || mediaTypes === undefined + || !Object.hasOwn(mediaTypes, name) + || seen.has(name) ) { - return DROP; + return DROP } - seen.add(name); - return resolveMediaType(mediaTypes[name], mediaTypes, seen); -}; + seen.add(name) + return resolveMediaType(mediaTypes[name], mediaTypes, seen) +} /** * Converts a content map, inlining `components.mediaTypes` references (3.1 * content maps hold Media Type Objects only, never references) and removing * entries whose reference cannot be inlined. */ -const convertContentMap = (value: unknown, context: Context): unknown => - mapRecord(value, (item) => { - const target = resolveMediaType(item, context.mediaTypes, new Set()); - return target === DROP ? DROP : convertMediaType(target, context); - }); +function convertContentMap(value: unknown, context: Context): unknown { + return mapRecord(value, (item) => { + const target = resolveMediaType(item, context.mediaTypes, new Set()) + return target === DROP ? DROP : convertMediaType(target, context) + }) +} -const convertRequestBody = (value: unknown, context: Context): unknown => - convertRecord(value, { content: (item) => convertContentMap(item, context) }); +function convertRequestBody(value: unknown, context: Context): unknown { + return convertRecord(value, { content: item => convertContentMap(item, context) }) +} -const convertResponse = (value: unknown, context: Context): unknown => - convertRecord( +function convertResponse(value: unknown, context: Context): unknown { + return convertRecord( value, { - content: (item) => convertContentMap(item, context), - headers: (item) => convertHeaderMap(item, context), + content: item => convertContentMap(item, context), + headers: item => convertHeaderMap(item, context), links: refMap(context, convertLink), summary: DROP, }, @@ -301,84 +298,85 @@ const convertResponse = (value: unknown, context: Context): unknown => if (out.description === undefined) { // Required in 3.1, optional in 3.2: the 3.2 summary stands in, and // `""` is synthesized as a last resort. - out.description = - "summary" in response ? deepClone(response.summary) : ""; + out.description + = 'summary' in response ? deepClone(response.summary) : '' } - return out; - } - ); + return out + }, + ) +} -const convertResponses = (value: unknown, context: Context): unknown => - mapRecord(value, (item, key) => - key.startsWith("x-") +function convertResponses(value: unknown, context: Context): unknown { + return mapRecord(value, (item, key) => + key.startsWith('x-') ? deepClone(item) - : convertRefOr(item, context, convertResponse) - ); + : convertRefOr(item, context, convertResponse)) +} + +function convertOperation(value: unknown, context: Context): unknown { + return convertRecord(value, { -const convertOperation = (value: unknown, context: Context): unknown => - convertRecord(value, { - // oxlint-disable-next-line no-use-before-define -- mutually recursive with convertCallback, as callbacks contain path items callbacks: refMap(context, convertCallback), - parameters: (item) => convertParameterList(item, context), - requestBody: (item) => convertRefOr(item, context, convertRequestBody), - responses: (item) => convertResponses(item, context), - servers: (item) => mapArray(item, convertServer), - }); - -const convertCallback = (value: unknown, context: Context): unknown => - mapRecord(value, (item, key) => - // oxlint-disable-next-line no-use-before-define -- mutually recursive with convertPathItem, as path items contain callbacks - key.startsWith("x-") ? deepClone(item) : convertPathItem(item, context) - ); - -const convertPathItem = (value: unknown, context: Context): unknown => - convertRecord(value, { - ...operationFields((item) => convertOperation(item, context)), + parameters: item => convertParameterList(item, context), + requestBody: item => convertRefOr(item, context, convertRequestBody), + responses: item => convertResponses(item, context), + servers: item => mapArray(item, convertServer), + }) +} + +function convertCallback(value: unknown, context: Context): unknown { + return mapRecord(value, (item, key) => + + key.startsWith('x-') ? deepClone(item) : convertPathItem(item, context)) +} + +function convertPathItem(value: unknown, context: Context): unknown { + return convertRecord(value, { + ...operationFields(item => convertOperation(item, context)), // The QUERY method and arbitrary additional operations are 3.2-only. additionalOperations: DROP, - parameters: (item) => convertParameterList(item, context), + parameters: item => convertParameterList(item, context), query: DROP, - servers: (item) => mapArray(item, convertServer), - }); + servers: item => mapArray(item, convertServer), + }) +} -const convertPaths = (value: unknown, context: Context): unknown => - mapRecord(value, (item, key) => - key.startsWith("/") ? convertPathItem(item, context) : deepClone(item) - ); +function convertPaths(value: unknown, context: Context): unknown { + return mapRecord(value, (item, key) => + key.startsWith('/') ? convertPathItem(item, context) : deepClone(item)) +} -const convertComponents = (value: unknown, context: Context): unknown => - convertRecord(value, { +function convertComponents(value: unknown, context: Context): unknown { + return convertRecord(value, { callbacks: refMap(context, convertCallback), examples: refMap(context, convertExample), - headers: (item) => convertHeaderMap(item, context), + headers: item => convertHeaderMap(item, context), links: refMap(context, convertLink), // Inlined at use sites; 3.1 has no reusable media types. mediaTypes: DROP, - parameters: (item) => - mapRecord(item, (entry) => convertParameterEntry(entry, context)), - pathItems: (item) => - mapRecord(item, (entry) => convertPathItem(entry, context)), + parameters: item => + mapRecord(item, entry => convertParameterEntry(entry, context)), + pathItems: item => + mapRecord(item, entry => convertPathItem(entry, context)), requestBodies: refMap(context, convertRequestBody), responses: refMap(context, convertResponse), securitySchemes: refMap(context, convertSecurityScheme), - }); + }) +} /** Whether conversion would remove every entry of the value's `content`. */ -const losesEntireContent = ( - value: unknown, - mediaTypes: UnknownRecord | undefined -): boolean => { +function losesEntireContent(value: unknown, mediaTypes: UnknownRecord | undefined): boolean { if (!(isRecord(value) && isRecord(value.content))) { - return false; + return false } - const entries = Object.values(value.content); + const entries = Object.values(value.content) return ( - entries.length > 0 && - entries.every( - (item) => resolveMediaType(item, mediaTypes, new Set()) === DROP + entries.length > 0 + && entries.every( + item => resolveMediaType(item, mediaTypes, new Set()) === DROP, ) - ); -}; + ) +} /** * Collects the `$ref` strings of component entries conversion removes @@ -386,92 +384,85 @@ const losesEntireContent = ( * `content`), iterated to a fixpoint so chains of reference aliases are * removed with their targets. */ -const indexRemovedComponentRefs = ( - map: unknown, - prefix: string, - mediaTypes: UnknownRecord | undefined, - isDirectlyRemoved: (item: unknown) => boolean -): Set => { - const removed = new Set(); +function indexRemovedComponentRefs(map: unknown, prefix: string, mediaTypes: UnknownRecord | undefined, isDirectlyRemoved: (item: unknown) => boolean): Set { + const removed = new Set() if (!isRecord(map)) { - return removed; + return removed } - const entries = Object.entries(map); - let changed = true; + const entries = Object.entries(map) + let changed = true while (changed) { - changed = false; + changed = false for (const [name, item] of entries) { - const selfRef = prefix + name; + const selfRef = prefix + name if (removed.has(selfRef)) { - continue; + continue } - const target = getRef(item); + const target = getRef(item) if ( - isDirectlyRemoved(item) || - losesEntireContent(item, mediaTypes) || - (target !== undefined && removed.has(target)) + isDirectlyRemoved(item) + || losesEntireContent(item, mediaTypes) + || (target !== undefined && removed.has(target)) ) { - removed.add(selfRef); - changed = true; + removed.add(selfRef) + changed = true } } } - return removed; -}; + return removed +} -const createContext = (spec: unknown): Context => { - const components = isRecord(spec) ? spec.components : undefined; - const mediaTypes = - isRecord(components) && isRecord(components.mediaTypes) +function createContext(spec: unknown): Context { + const components = isRecord(spec) ? spec.components : undefined + const mediaTypes + = isRecord(components) && isRecord(components.mediaTypes) ? components.mediaTypes - : undefined; + : undefined return { mediaTypes, removedHeaderRefs: indexRemovedComponentRefs( isRecord(components) ? components.headers : undefined, HEADERS_REF_PREFIX, mediaTypes, - () => false + () => false, ), removedParameterRefs: indexRemovedComponentRefs( isRecord(components) ? components.parameters : undefined, PARAMETERS_REF_PREFIX, mediaTypes, - isQuerystringParameter + isQuerystringParameter, ), - }; -}; + } +} -const convertSpec = (spec: unknown): unknown => { - const context = createContext(spec); +function convertSpec(spec: unknown): unknown { + const context = createContext(spec) return convertRecord( spec, { // 3.1 has no self-assigned document URI. $self: DROP, - components: (item) => convertComponents(item, context), - paths: (item) => convertPaths(item, context), - servers: (item) => mapArray(item, convertServer), - tags: (item) => mapArray(item, convertTag), - webhooks: (item) => - mapRecord(item, (entry) => convertPathItem(entry, context)), + components: item => convertComponents(item, context), + paths: item => convertPaths(item, context), + servers: item => mapArray(item, convertServer), + tags: item => mapArray(item, convertTag), + webhooks: item => + mapRecord(item, entry => convertPathItem(entry, context)), }, (out) => { - out.openapi = "3.1.2"; - return out; - } - ); -}; + out.openapi = '3.1.2' + return out + }, + ) +} /** * Converts an OpenAPI 3.2 document to OpenAPI 3.1.2. The input is never * mutated, unknown keys and existing specification extensions are preserved, * and malformed parts are copied through unchanged instead of throwing. */ -export const downgradeSpecV32ToV31 = ( - spec: OpenAPIV3_2.OpenAPIObject -): OpenAPIV3_1.OpenAPIObject => { - const converted: unknown = convertSpec(spec); +export function downgradeSpecV32ToV31(spec: OpenAPIV3_2.OpenAPIObject): OpenAPIV3_1.OpenAPIObject { + const converted: unknown = convertSpec(spec) // SAFETY: convertSpec rewrites every 3.2-only construct into its 3.1 form. - return converted as OpenAPIV3_1.OpenAPIObject; -}; + return converted as OpenAPIV3_1.OpenAPIObject +} diff --git a/packages/downgrader/tests/corpus.test.ts b/packages/downgrader/tests/corpus.test.ts index 10dcc7b..adaa101 100644 --- a/packages/downgrader/tests/corpus.test.ts +++ b/packages/downgrader/tests/corpus.test.ts @@ -1,112 +1,108 @@ -import type { OpenAPIV3_1, OpenAPIV3_2 } from "@openapi-spec/types"; -/* oxlint-disable anti-slop/no-unknown-parameters, anti-slop/no-object-parameters, anti-slop/no-unsafe-dictionary-type -- these corpus tests bulk-feed whole OpenAPI documents into the converters and a generic JSON-schema validator, so version-agnostic document shapes are the domain contract */ -import { Validator } from "@seriousme/openapi-schema-validator"; +import type { OpenAPIV3_1, OpenAPIV3_2 } from '@openapi-spec/types' +import { Validator } from '@seriousme/openapi-schema-validator' -import { doc as exampleQueryV32 } from "../../types/tests/examples/3-2-query-example"; -import { doc as exampleTagsV32 } from "../../types/tests/examples/3-2-tags-example"; -import { doc as exampleNonOauthScopesV31 } from "../../types/tests/examples/non-oauth-scopes-3-1"; -import { doc as exampleTictactoeV31 } from "../../types/tests/examples/tictactoe-3-1"; -import { doc as exampleWebhookV31 } from "../../types/tests/examples/webhook-example-3-1"; -import { doc as callbackObjectExamplesV31 } from "../../types/tests/schema-tests-3.1/callback-object-examples"; -import { doc as compPathitemsV31 } from "../../types/tests/schema-tests-3.1/comp-pathitems"; -import { doc as componentsObjectExampleV31 } from "../../types/tests/schema-tests-3.1/components-object-example"; -import { doc as exampleObjectExamplesV31 } from "../../types/tests/schema-tests-3.1/example-object-examples"; -import { doc as headerObjectExamplesV31 } from "../../types/tests/schema-tests-3.1/header-object-examples"; -import { doc as infoObjectExampleV31 } from "../../types/tests/schema-tests-3.1/info-object-example"; -import { doc as infoSummaryV31 } from "../../types/tests/schema-tests-3.1/info-summary"; -import { doc as jsonSchemaDialectV31 } from "../../types/tests/schema-tests-3.1/json-schema-dialect"; -import { doc as licenseIdentifierV31 } from "../../types/tests/schema-tests-3.1/license-identifier"; -import { doc as linkObjectExamplesV31 } from "../../types/tests/schema-tests-3.1/link-object-examples"; -import { doc as mediaTypeExamplesV31 } from "../../types/tests/schema-tests-3.1/media-type-examples"; -import { doc as megaV31 } from "../../types/tests/schema-tests-3.1/mega"; -import { doc as minimalCompV31 } from "../../types/tests/schema-tests-3.1/minimal-comp"; -import { doc as minimalHooksV31 } from "../../types/tests/schema-tests-3.1/minimal-hooks"; -import { doc as minimalPathsV31 } from "../../types/tests/schema-tests-3.1/minimal-paths"; -import { doc as nonOauthScopesV31 } from "../../types/tests/schema-tests-3.1/non-oauth-scopes"; -import { doc as operationObjectExampleV31 } from "../../types/tests/schema-tests-3.1/operation-object-example"; -import { doc as parameterObjectExamplesV31 } from "../../types/tests/schema-tests-3.1/parameter-object-examples"; -import { doc as parameterObjectQueryAllowReservedV31 } from "../../types/tests/schema-tests-3.1/parameter-object-query-allow-reserved"; -import { doc as pathItemObjectExampleV31 } from "../../types/tests/schema-tests-3.1/path-item-object-example"; -import { doc as pathItemServersParametersV31 } from "../../types/tests/schema-tests-3.1/path-item-servers-parameters"; -import { doc as pathNoResponseV31 } from "../../types/tests/schema-tests-3.1/path-no-response"; -import { doc as pathVarEmptyPathitemV31 } from "../../types/tests/schema-tests-3.1/path-var-empty-pathitem"; -import { doc as pathsObjectExampleV31 } from "../../types/tests/schema-tests-3.1/paths-object-example"; -import { doc as requestBodyExamplesV31 } from "../../types/tests/schema-tests-3.1/request-body-examples"; -import { doc as responseObjectExamplesV31 } from "../../types/tests/schema-tests-3.1/response-object-examples"; -import { doc as schemaV31 } from "../../types/tests/schema-tests-3.1/schema"; -import { doc as schemaObjectDeprecatedExampleKeywordV31 } from "../../types/tests/schema-tests-3.1/schema-object-deprecated-example-keyword"; -import { doc as serversV31 } from "../../types/tests/schema-tests-3.1/servers"; -import { doc as specificationExtensionsV31 } from "../../types/tests/schema-tests-3.1/specification-extensions"; -import { doc as tagObjectExampleV31 } from "../../types/tests/schema-tests-3.1/tag-object-example"; -import { doc as validSchemaTypesV31 } from "../../types/tests/schema-tests-3.1/valid-schema-types"; -import { doc as webhookExampleV31 } from "../../types/tests/schema-tests-3.1/webhook-example"; -import { doc as callbackObjectExamplesV32 } from "../../types/tests/schema-tests-3.2/callback-object-examples"; -import { doc as compPathitemsV32 } from "../../types/tests/schema-tests-3.2/comp-pathitems"; -import { doc as componentsObjectExampleV32 } from "../../types/tests/schema-tests-3.2/components-object-example"; -import { doc as exampleObjectExamplesV32 } from "../../types/tests/schema-tests-3.2/example-object-examples"; -import { doc as headerObjectExamplesV32 } from "../../types/tests/schema-tests-3.2/header-object-examples"; -import { doc as infoObjectExampleV32 } from "../../types/tests/schema-tests-3.2/info-object-example"; -import { doc as infoSummaryV32 } from "../../types/tests/schema-tests-3.2/info-summary"; -import { doc as jsonSchemaDialectV32 } from "../../types/tests/schema-tests-3.2/json-schema-dialect"; -import { doc as licenseIdentifierV32 } from "../../types/tests/schema-tests-3.2/license-identifier"; -import { doc as linkObjectExamplesV32 } from "../../types/tests/schema-tests-3.2/link-object-examples"; -import { doc as mediaTypeExamplesV32 } from "../../types/tests/schema-tests-3.2/media-type-examples"; -import { doc as megaV32 } from "../../types/tests/schema-tests-3.2/mega"; -import { doc as minimalCompV32 } from "../../types/tests/schema-tests-3.2/minimal-comp"; -import { doc as minimalHooksV32 } from "../../types/tests/schema-tests-3.2/minimal-hooks"; -import { doc as minimalPathsV32 } from "../../types/tests/schema-tests-3.2/minimal-paths"; -import { doc as nonOauthScopesV32 } from "../../types/tests/schema-tests-3.2/non-oauth-scopes"; -import { doc as operationObjectExampleV32 } from "../../types/tests/schema-tests-3.2/operation-object-example"; -import { doc as parameterObjectCookieFormAllowReservedV32 } from "../../types/tests/schema-tests-3.2/parameter-object-cookie-form-allow-reserved"; -import { doc as parameterObjectExamplesV32 } from "../../types/tests/schema-tests-3.2/parameter-object-examples"; -import { doc as parameterObjectPathAllowReservedV32 } from "../../types/tests/schema-tests-3.2/parameter-object-path-allow-reserved"; -import { doc as parameterObjectQueryAllowReservedV32 } from "../../types/tests/schema-tests-3.2/parameter-object-query-allow-reserved"; -import { doc as pathItemObjectExampleV32 } from "../../types/tests/schema-tests-3.2/path-item-object-example"; -import { doc as pathItemServersParametersV32 } from "../../types/tests/schema-tests-3.2/path-item-servers-parameters"; -import { doc as pathNoResponseV32 } from "../../types/tests/schema-tests-3.2/path-no-response"; -import { doc as pathVarEmptyPathitemV32 } from "../../types/tests/schema-tests-3.2/path-var-empty-pathitem"; -import { doc as pathsObjectExampleV32 } from "../../types/tests/schema-tests-3.2/paths-object-example"; -import { doc as requestBodyExamplesV32 } from "../../types/tests/schema-tests-3.2/request-body-examples"; -import { doc as responseObjectExamplesV32 } from "../../types/tests/schema-tests-3.2/response-object-examples"; -import { doc as schemaV32 } from "../../types/tests/schema-tests-3.2/schema"; -import { doc as schemaObjectDeprecatedExampleKeywordV32 } from "../../types/tests/schema-tests-3.2/schema-object-deprecated-example-keyword"; -import { doc as serversV32 } from "../../types/tests/schema-tests-3.2/servers"; -import { doc as specificationExtensionsV32 } from "../../types/tests/schema-tests-3.2/specification-extensions"; -import { doc as styleDefaultsV32 } from "../../types/tests/schema-tests-3.2/style-defaults"; -import { doc as tagObjectExampleV32 } from "../../types/tests/schema-tests-3.2/tag-object-example"; -import { doc as validSchemaTypesV32 } from "../../types/tests/schema-tests-3.2/valid-schema-types"; -import { doc as webhookExampleV32 } from "../../types/tests/schema-tests-3.2/webhook-example"; -import { downgradeSpecV31ToV30, downgradeSpecV32ToV31 } from "../src/index"; +import { doc as exampleQueryV32 } from '../../types/tests/examples/3-2-query-example' +import { doc as exampleTagsV32 } from '../../types/tests/examples/3-2-tags-example' +import { doc as exampleNonOauthScopesV31 } from '../../types/tests/examples/non-oauth-scopes-3-1' +import { doc as exampleTictactoeV31 } from '../../types/tests/examples/tictactoe-3-1' +import { doc as exampleWebhookV31 } from '../../types/tests/examples/webhook-example-3-1' +import { doc as callbackObjectExamplesV31 } from '../../types/tests/schema-tests-3.1/callback-object-examples' +import { doc as compPathitemsV31 } from '../../types/tests/schema-tests-3.1/comp-pathitems' +import { doc as componentsObjectExampleV31 } from '../../types/tests/schema-tests-3.1/components-object-example' +import { doc as exampleObjectExamplesV31 } from '../../types/tests/schema-tests-3.1/example-object-examples' +import { doc as headerObjectExamplesV31 } from '../../types/tests/schema-tests-3.1/header-object-examples' +import { doc as infoObjectExampleV31 } from '../../types/tests/schema-tests-3.1/info-object-example' +import { doc as infoSummaryV31 } from '../../types/tests/schema-tests-3.1/info-summary' +import { doc as jsonSchemaDialectV31 } from '../../types/tests/schema-tests-3.1/json-schema-dialect' +import { doc as licenseIdentifierV31 } from '../../types/tests/schema-tests-3.1/license-identifier' +import { doc as linkObjectExamplesV31 } from '../../types/tests/schema-tests-3.1/link-object-examples' +import { doc as mediaTypeExamplesV31 } from '../../types/tests/schema-tests-3.1/media-type-examples' +import { doc as megaV31 } from '../../types/tests/schema-tests-3.1/mega' +import { doc as minimalCompV31 } from '../../types/tests/schema-tests-3.1/minimal-comp' +import { doc as minimalHooksV31 } from '../../types/tests/schema-tests-3.1/minimal-hooks' +import { doc as minimalPathsV31 } from '../../types/tests/schema-tests-3.1/minimal-paths' +import { doc as nonOauthScopesV31 } from '../../types/tests/schema-tests-3.1/non-oauth-scopes' +import { doc as operationObjectExampleV31 } from '../../types/tests/schema-tests-3.1/operation-object-example' +import { doc as parameterObjectExamplesV31 } from '../../types/tests/schema-tests-3.1/parameter-object-examples' +import { doc as parameterObjectQueryAllowReservedV31 } from '../../types/tests/schema-tests-3.1/parameter-object-query-allow-reserved' +import { doc as pathItemObjectExampleV31 } from '../../types/tests/schema-tests-3.1/path-item-object-example' +import { doc as pathItemServersParametersV31 } from '../../types/tests/schema-tests-3.1/path-item-servers-parameters' +import { doc as pathNoResponseV31 } from '../../types/tests/schema-tests-3.1/path-no-response' +import { doc as pathVarEmptyPathitemV31 } from '../../types/tests/schema-tests-3.1/path-var-empty-pathitem' +import { doc as pathsObjectExampleV31 } from '../../types/tests/schema-tests-3.1/paths-object-example' +import { doc as requestBodyExamplesV31 } from '../../types/tests/schema-tests-3.1/request-body-examples' +import { doc as responseObjectExamplesV31 } from '../../types/tests/schema-tests-3.1/response-object-examples' +import { doc as schemaV31 } from '../../types/tests/schema-tests-3.1/schema' +import { doc as schemaObjectDeprecatedExampleKeywordV31 } from '../../types/tests/schema-tests-3.1/schema-object-deprecated-example-keyword' +import { doc as serversV31 } from '../../types/tests/schema-tests-3.1/servers' +import { doc as specificationExtensionsV31 } from '../../types/tests/schema-tests-3.1/specification-extensions' +import { doc as tagObjectExampleV31 } from '../../types/tests/schema-tests-3.1/tag-object-example' +import { doc as validSchemaTypesV31 } from '../../types/tests/schema-tests-3.1/valid-schema-types' +import { doc as webhookExampleV31 } from '../../types/tests/schema-tests-3.1/webhook-example' +import { doc as callbackObjectExamplesV32 } from '../../types/tests/schema-tests-3.2/callback-object-examples' +import { doc as compPathitemsV32 } from '../../types/tests/schema-tests-3.2/comp-pathitems' +import { doc as componentsObjectExampleV32 } from '../../types/tests/schema-tests-3.2/components-object-example' +import { doc as exampleObjectExamplesV32 } from '../../types/tests/schema-tests-3.2/example-object-examples' +import { doc as headerObjectExamplesV32 } from '../../types/tests/schema-tests-3.2/header-object-examples' +import { doc as infoObjectExampleV32 } from '../../types/tests/schema-tests-3.2/info-object-example' +import { doc as infoSummaryV32 } from '../../types/tests/schema-tests-3.2/info-summary' +import { doc as jsonSchemaDialectV32 } from '../../types/tests/schema-tests-3.2/json-schema-dialect' +import { doc as licenseIdentifierV32 } from '../../types/tests/schema-tests-3.2/license-identifier' +import { doc as linkObjectExamplesV32 } from '../../types/tests/schema-tests-3.2/link-object-examples' +import { doc as mediaTypeExamplesV32 } from '../../types/tests/schema-tests-3.2/media-type-examples' +import { doc as megaV32 } from '../../types/tests/schema-tests-3.2/mega' +import { doc as minimalCompV32 } from '../../types/tests/schema-tests-3.2/minimal-comp' +import { doc as minimalHooksV32 } from '../../types/tests/schema-tests-3.2/minimal-hooks' +import { doc as minimalPathsV32 } from '../../types/tests/schema-tests-3.2/minimal-paths' +import { doc as nonOauthScopesV32 } from '../../types/tests/schema-tests-3.2/non-oauth-scopes' +import { doc as operationObjectExampleV32 } from '../../types/tests/schema-tests-3.2/operation-object-example' +import { doc as parameterObjectCookieFormAllowReservedV32 } from '../../types/tests/schema-tests-3.2/parameter-object-cookie-form-allow-reserved' +import { doc as parameterObjectExamplesV32 } from '../../types/tests/schema-tests-3.2/parameter-object-examples' +import { doc as parameterObjectPathAllowReservedV32 } from '../../types/tests/schema-tests-3.2/parameter-object-path-allow-reserved' +import { doc as parameterObjectQueryAllowReservedV32 } from '../../types/tests/schema-tests-3.2/parameter-object-query-allow-reserved' +import { doc as pathItemObjectExampleV32 } from '../../types/tests/schema-tests-3.2/path-item-object-example' +import { doc as pathItemServersParametersV32 } from '../../types/tests/schema-tests-3.2/path-item-servers-parameters' +import { doc as pathNoResponseV32 } from '../../types/tests/schema-tests-3.2/path-no-response' +import { doc as pathVarEmptyPathitemV32 } from '../../types/tests/schema-tests-3.2/path-var-empty-pathitem' +import { doc as pathsObjectExampleV32 } from '../../types/tests/schema-tests-3.2/paths-object-example' +import { doc as requestBodyExamplesV32 } from '../../types/tests/schema-tests-3.2/request-body-examples' +import { doc as responseObjectExamplesV32 } from '../../types/tests/schema-tests-3.2/response-object-examples' +import { doc as schemaV32 } from '../../types/tests/schema-tests-3.2/schema' +import { doc as schemaObjectDeprecatedExampleKeywordV32 } from '../../types/tests/schema-tests-3.2/schema-object-deprecated-example-keyword' +import { doc as serversV32 } from '../../types/tests/schema-tests-3.2/servers' +import { doc as specificationExtensionsV32 } from '../../types/tests/schema-tests-3.2/specification-extensions' +import { doc as styleDefaultsV32 } from '../../types/tests/schema-tests-3.2/style-defaults' +import { doc as tagObjectExampleV32 } from '../../types/tests/schema-tests-3.2/tag-object-example' +import { doc as validSchemaTypesV32 } from '../../types/tests/schema-tests-3.2/valid-schema-types' +import { doc as webhookExampleV32 } from '../../types/tests/schema-tests-3.2/webhook-example' +import { downgradeSpecV31ToV30, downgradeSpecV32ToV31 } from '../src/index' -const asSpec31 = (value: unknown): OpenAPIV3_1.OpenAPIObject => - // SAFETY: fixture literals infer unions that do not always narrow to the declared document type; the converters accept arbitrary documents at runtime. - value as OpenAPIV3_1.OpenAPIObject; +function asSpec31(value: unknown): OpenAPIV3_1.OpenAPIObject { + return value as OpenAPIV3_1.OpenAPIObject +} -const asSpec32 = (value: unknown): OpenAPIV3_2.OpenAPIObject => - // SAFETY: fixture literals infer unions that do not always narrow to the declared document type; the converters accept arbitrary documents at runtime. - value as OpenAPIV3_2.OpenAPIObject; +function asSpec32(value: unknown): OpenAPIV3_2.OpenAPIObject { + return value as OpenAPIV3_2.OpenAPIObject +} -const asValidatorInput = (value: unknown): Record => - // SAFETY: the validator accepts arbitrary JSON documents at runtime. - value as Record; +function asValidatorInput(value: unknown): Record { + return value as Record +} -const validate = async (spec: object) => { - const validator = new Validator(); +async function validate(spec: object) { + const validator = new Validator() const result = await validator.validate( - asValidatorInput(structuredClone(spec)) - ); - return { result, version: validator.version }; -}; + asValidatorInput(structuredClone(spec)), + ) + return { result, version: validator.version } +} -const expectValidAs = async ( - spec: object, - expectedVersion: string -): Promise => { - const { result, version } = await validate(spec); - expect(result.errors ?? []).toEqual([]); - expect(result.valid).toBe(true); - expect(version).toBe(expectedVersion); -}; +async function expectValidAs(spec: object, expectedVersion: string): Promise { + const { result, version } = await validate(spec) + expect(result.errors ?? []).toEqual([]) + expect(result.valid).toBe(true) + expect(version).toBe(expectedVersion) +} /** * Excluded 3.1 fixtures: @@ -124,49 +120,49 @@ const corpus31: readonly (readonly [ name: string, doc: OpenAPIV3_1.OpenAPIObject, ])[] = [ - ["examples/non-oauth-scopes-3-1", asSpec31(exampleNonOauthScopesV31)], - ["examples/tictactoe-3-1", asSpec31(exampleTictactoeV31)], - ["examples/webhook-example-3-1", asSpec31(exampleWebhookV31)], - ["callback-object-examples", asSpec31(callbackObjectExamplesV31)], - ["comp-pathitems", asSpec31(compPathitemsV31)], - ["components-object-example", asSpec31(componentsObjectExampleV31)], - ["example-object-examples", asSpec31(exampleObjectExamplesV31)], - ["header-object-examples", asSpec31(headerObjectExamplesV31)], - ["info-object-example", asSpec31(infoObjectExampleV31)], - ["info-summary", asSpec31(infoSummaryV31)], - ["json-schema-dialect", asSpec31(jsonSchemaDialectV31)], - ["license-identifier", asSpec31(licenseIdentifierV31)], - ["link-object-examples", asSpec31(linkObjectExamplesV31)], - ["media-type-examples", asSpec31(mediaTypeExamplesV31)], - ["mega", asSpec31(megaV31)], - ["minimal-comp", asSpec31(minimalCompV31)], - ["minimal-hooks", asSpec31(minimalHooksV31)], - ["minimal-paths", asSpec31(minimalPathsV31)], - ["non-oauth-scopes", asSpec31(nonOauthScopesV31)], - ["operation-object-example", asSpec31(operationObjectExampleV31)], - ["parameter-object-examples", asSpec31(parameterObjectExamplesV31)], + ['examples/non-oauth-scopes-3-1', asSpec31(exampleNonOauthScopesV31)], + ['examples/tictactoe-3-1', asSpec31(exampleTictactoeV31)], + ['examples/webhook-example-3-1', asSpec31(exampleWebhookV31)], + ['callback-object-examples', asSpec31(callbackObjectExamplesV31)], + ['comp-pathitems', asSpec31(compPathitemsV31)], + ['components-object-example', asSpec31(componentsObjectExampleV31)], + ['example-object-examples', asSpec31(exampleObjectExamplesV31)], + ['header-object-examples', asSpec31(headerObjectExamplesV31)], + ['info-object-example', asSpec31(infoObjectExampleV31)], + ['info-summary', asSpec31(infoSummaryV31)], + ['json-schema-dialect', asSpec31(jsonSchemaDialectV31)], + ['license-identifier', asSpec31(licenseIdentifierV31)], + ['link-object-examples', asSpec31(linkObjectExamplesV31)], + ['media-type-examples', asSpec31(mediaTypeExamplesV31)], + ['mega', asSpec31(megaV31)], + ['minimal-comp', asSpec31(minimalCompV31)], + ['minimal-hooks', asSpec31(minimalHooksV31)], + ['minimal-paths', asSpec31(minimalPathsV31)], + ['non-oauth-scopes', asSpec31(nonOauthScopesV31)], + ['operation-object-example', asSpec31(operationObjectExampleV31)], + ['parameter-object-examples', asSpec31(parameterObjectExamplesV31)], [ - "parameter-object-query-allow-reserved", + 'parameter-object-query-allow-reserved', asSpec31(parameterObjectQueryAllowReservedV31), ], - ["path-item-object-example", asSpec31(pathItemObjectExampleV31)], - ["path-item-servers-parameters", asSpec31(pathItemServersParametersV31)], - ["path-no-response", asSpec31(pathNoResponseV31)], - ["path-var-empty-pathitem", asSpec31(pathVarEmptyPathitemV31)], - ["paths-object-example", asSpec31(pathsObjectExampleV31)], - ["request-body-examples", asSpec31(requestBodyExamplesV31)], - ["response-object-examples", asSpec31(responseObjectExamplesV31)], - ["schema", asSpec31(schemaV31)], + ['path-item-object-example', asSpec31(pathItemObjectExampleV31)], + ['path-item-servers-parameters', asSpec31(pathItemServersParametersV31)], + ['path-no-response', asSpec31(pathNoResponseV31)], + ['path-var-empty-pathitem', asSpec31(pathVarEmptyPathitemV31)], + ['paths-object-example', asSpec31(pathsObjectExampleV31)], + ['request-body-examples', asSpec31(requestBodyExamplesV31)], + ['response-object-examples', asSpec31(responseObjectExamplesV31)], + ['schema', asSpec31(schemaV31)], [ - "schema-object-deprecated-example-keyword", + 'schema-object-deprecated-example-keyword', asSpec31(schemaObjectDeprecatedExampleKeywordV31), ], - ["servers", asSpec31(serversV31)], - ["specification-extensions", asSpec31(specificationExtensionsV31)], - ["tag-object-example", asSpec31(tagObjectExampleV31)], - ["valid-schema-types", asSpec31(validSchemaTypesV31)], - ["webhook-example", asSpec31(webhookExampleV31)], -]; + ['servers', asSpec31(serversV31)], + ['specification-extensions', asSpec31(specificationExtensionsV31)], + ['tag-object-example', asSpec31(tagObjectExampleV31)], + ['valid-schema-types', asSpec31(validSchemaTypesV31)], + ['webhook-example', asSpec31(webhookExampleV31)], +] /** * Excluded 3.2 fixtures: @@ -179,85 +175,85 @@ const corpus32: readonly (readonly [ name: string, doc: OpenAPIV3_2.OpenAPIObject, ])[] = [ - ["examples/3-2-query-example", asSpec32(exampleQueryV32)], - ["examples/3-2-tags-example", asSpec32(exampleTagsV32)], - ["callback-object-examples", asSpec32(callbackObjectExamplesV32)], - ["comp-pathitems", asSpec32(compPathitemsV32)], - ["components-object-example", asSpec32(componentsObjectExampleV32)], - ["example-object-examples", asSpec32(exampleObjectExamplesV32)], - ["header-object-examples", asSpec32(headerObjectExamplesV32)], - ["info-object-example", asSpec32(infoObjectExampleV32)], - ["info-summary", asSpec32(infoSummaryV32)], - ["json-schema-dialect", asSpec32(jsonSchemaDialectV32)], - ["license-identifier", asSpec32(licenseIdentifierV32)], - ["link-object-examples", asSpec32(linkObjectExamplesV32)], - ["media-type-examples", asSpec32(mediaTypeExamplesV32)], - ["mega", asSpec32(megaV32)], - ["minimal-comp", asSpec32(minimalCompV32)], - ["minimal-hooks", asSpec32(minimalHooksV32)], - ["minimal-paths", asSpec32(minimalPathsV32)], - ["non-oauth-scopes", asSpec32(nonOauthScopesV32)], - ["operation-object-example", asSpec32(operationObjectExampleV32)], + ['examples/3-2-query-example', asSpec32(exampleQueryV32)], + ['examples/3-2-tags-example', asSpec32(exampleTagsV32)], + ['callback-object-examples', asSpec32(callbackObjectExamplesV32)], + ['comp-pathitems', asSpec32(compPathitemsV32)], + ['components-object-example', asSpec32(componentsObjectExampleV32)], + ['example-object-examples', asSpec32(exampleObjectExamplesV32)], + ['header-object-examples', asSpec32(headerObjectExamplesV32)], + ['info-object-example', asSpec32(infoObjectExampleV32)], + ['info-summary', asSpec32(infoSummaryV32)], + ['json-schema-dialect', asSpec32(jsonSchemaDialectV32)], + ['license-identifier', asSpec32(licenseIdentifierV32)], + ['link-object-examples', asSpec32(linkObjectExamplesV32)], + ['media-type-examples', asSpec32(mediaTypeExamplesV32)], + ['mega', asSpec32(megaV32)], + ['minimal-comp', asSpec32(minimalCompV32)], + ['minimal-hooks', asSpec32(minimalHooksV32)], + ['minimal-paths', asSpec32(minimalPathsV32)], + ['non-oauth-scopes', asSpec32(nonOauthScopesV32)], + ['operation-object-example', asSpec32(operationObjectExampleV32)], [ - "parameter-object-cookie-form-allow-reserved", + 'parameter-object-cookie-form-allow-reserved', asSpec32(parameterObjectCookieFormAllowReservedV32), ], - ["parameter-object-examples", asSpec32(parameterObjectExamplesV32)], + ['parameter-object-examples', asSpec32(parameterObjectExamplesV32)], [ - "parameter-object-path-allow-reserved", + 'parameter-object-path-allow-reserved', asSpec32(parameterObjectPathAllowReservedV32), ], [ - "parameter-object-query-allow-reserved", + 'parameter-object-query-allow-reserved', asSpec32(parameterObjectQueryAllowReservedV32), ], - ["path-item-object-example", asSpec32(pathItemObjectExampleV32)], - ["path-item-servers-parameters", asSpec32(pathItemServersParametersV32)], - ["path-no-response", asSpec32(pathNoResponseV32)], - ["path-var-empty-pathitem", asSpec32(pathVarEmptyPathitemV32)], - ["paths-object-example", asSpec32(pathsObjectExampleV32)], - ["request-body-examples", asSpec32(requestBodyExamplesV32)], - ["response-object-examples", asSpec32(responseObjectExamplesV32)], - ["schema", asSpec32(schemaV32)], + ['path-item-object-example', asSpec32(pathItemObjectExampleV32)], + ['path-item-servers-parameters', asSpec32(pathItemServersParametersV32)], + ['path-no-response', asSpec32(pathNoResponseV32)], + ['path-var-empty-pathitem', asSpec32(pathVarEmptyPathitemV32)], + ['paths-object-example', asSpec32(pathsObjectExampleV32)], + ['request-body-examples', asSpec32(requestBodyExamplesV32)], + ['response-object-examples', asSpec32(responseObjectExamplesV32)], + ['schema', asSpec32(schemaV32)], [ - "schema-object-deprecated-example-keyword", + 'schema-object-deprecated-example-keyword', asSpec32(schemaObjectDeprecatedExampleKeywordV32), ], - ["servers", asSpec32(serversV32)], - ["specification-extensions", asSpec32(specificationExtensionsV32)], - ["style-defaults", asSpec32(styleDefaultsV32)], - ["tag-object-example", asSpec32(tagObjectExampleV32)], - ["valid-schema-types", asSpec32(validSchemaTypesV32)], - ["webhook-example", asSpec32(webhookExampleV32)], -]; + ['servers', asSpec32(serversV32)], + ['specification-extensions', asSpec32(specificationExtensionsV32)], + ['style-defaults', asSpec32(styleDefaultsV32)], + ['tag-object-example', asSpec32(tagObjectExampleV32)], + ['valid-schema-types', asSpec32(validSchemaTypesV32)], + ['webhook-example', asSpec32(webhookExampleV32)], +] -describe("3.1 corpus downgraded to 3.0", () => { +describe('3.1 corpus downgraded to 3.0', () => { it.each(corpus31)( - "converts %s to a valid 3.0 document without mutating the input", + 'converts %s to a valid 3.0 document without mutating the input', async (_name, doc) => { - await expectValidAs(doc, "3.1"); - const before = structuredClone(doc); - const v30 = downgradeSpecV31ToV30(doc); - expect(v30.openapi).toBe("3.0.4"); - await expectValidAs(v30, "3.0"); - expect(doc).toEqual(before); - } - ); -}); + await expectValidAs(doc, '3.1') + const before = structuredClone(doc) + const v30 = downgradeSpecV31ToV30(doc) + expect(v30.openapi).toBe('3.0.4') + await expectValidAs(v30, '3.0') + expect(doc).toEqual(before) + }, + ) +}) -describe("3.2 corpus downgraded to 3.1 and chained to 3.0", () => { +describe('3.2 corpus downgraded to 3.1 and chained to 3.0', () => { it.each(corpus32)( - "converts %s to valid 3.1 and 3.0 documents without mutating the input", + 'converts %s to valid 3.1 and 3.0 documents without mutating the input', async (_name, doc) => { - await expectValidAs(doc, "3.2"); - const before = structuredClone(doc); - const v31 = downgradeSpecV32ToV31(doc); - expect(v31.openapi).toBe("3.1.2"); - await expectValidAs(v31, "3.1"); - const v30 = downgradeSpecV31ToV30(v31); - expect(v30.openapi).toBe("3.0.4"); - await expectValidAs(v30, "3.0"); - expect(doc).toEqual(before); - } - ); -}); + await expectValidAs(doc, '3.2') + const before = structuredClone(doc) + const v31 = downgradeSpecV32ToV31(doc) + expect(v31.openapi).toBe('3.1.2') + await expectValidAs(v31, '3.1') + const v30 = downgradeSpecV31ToV30(v31) + expect(v30.openapi).toBe('3.0.4') + await expectValidAs(v30, '3.0') + expect(doc).toEqual(before) + }, + ) +}) diff --git a/packages/downgrader/tests/e2e.test.ts b/packages/downgrader/tests/e2e.test.ts index bfba671..24fc6a9 100644 --- a/packages/downgrader/tests/e2e.test.ts +++ b/packages/downgrader/tests/e2e.test.ts @@ -1,460 +1,456 @@ -import type { OpenAPIV3_1, OpenAPIV3_2 } from "@openapi-spec/types"; -/* oxlint-disable anti-slop/no-unknown-parameters, anti-slop/no-object-parameters, anti-slop/no-unsafe-dictionary-type -- these e2e tests shuttle whole OpenAPI documents across three spec versions into the converters and a generic JSON-schema validator, so version-agnostic document shapes are the domain contract */ -import { Validator } from "@seriousme/openapi-schema-validator"; +import type { OpenAPIV3_1, OpenAPIV3_2 } from '@openapi-spec/types' +import { Validator } from '@seriousme/openapi-schema-validator' -import { doc as queryExample } from "../../types/tests/examples/3-2-query-example"; -import { doc as tagsExample } from "../../types/tests/examples/3-2-tags-example"; -import { doc as nonOauthScopes } from "../../types/tests/examples/non-oauth-scopes-3-1"; -import { doc as petstore } from "../../types/tests/examples/petstore-3-0"; -import { doc as tictactoe } from "../../types/tests/examples/tictactoe-3-1"; -import { doc as webhookExample } from "../../types/tests/examples/webhook-example-3-1"; -import { doc as mega31 } from "../../types/tests/schema-tests-3.1/mega"; -import { doc as mega32 } from "../../types/tests/schema-tests-3.2/mega"; -import { downgradeSpecV31ToV30, downgradeSpecV32ToV31 } from "../src/index"; +import { doc as queryExample } from '../../types/tests/examples/3-2-query-example' +import { doc as tagsExample } from '../../types/tests/examples/3-2-tags-example' +import { doc as nonOauthScopes } from '../../types/tests/examples/non-oauth-scopes-3-1' +import { doc as petstore } from '../../types/tests/examples/petstore-3-0' +import { doc as tictactoe } from '../../types/tests/examples/tictactoe-3-1' +import { doc as webhookExample } from '../../types/tests/examples/webhook-example-3-1' +import { doc as mega31 } from '../../types/tests/schema-tests-3.1/mega' +import { doc as mega32 } from '../../types/tests/schema-tests-3.2/mega' +import { downgradeSpecV31ToV30, downgradeSpecV32ToV31 } from '../src/index' -const asSpec31 = (value: unknown): OpenAPIV3_1.OpenAPIObject => - // SAFETY: tests deliberately feed documents of other versions (and fixture literals whose inferred unions do not narrow) to exercise real converter input. - value as OpenAPIV3_1.OpenAPIObject; +function asSpec31(value: unknown): OpenAPIV3_1.OpenAPIObject { + return value as OpenAPIV3_1.OpenAPIObject +} -const asValidatorInput = (value: unknown): Record => - // SAFETY: the validator accepts arbitrary JSON documents at runtime. - value as Record; +function asValidatorInput(value: unknown): Record { + return value as Record +} -const validate = async (spec: object) => { - const validator = new Validator(); +async function validate(spec: object) { + const validator = new Validator() const result = await validator.validate( - asValidatorInput(structuredClone(spec)) - ); - return { result, version: validator.version }; -}; + asValidatorInput(structuredClone(spec)), + ) + return { result, version: validator.version } +} -const expectValidAs = async ( - spec: object, - expectedVersion: string -): Promise => { - const { result, version } = await validate(spec); - expect(result.errors ?? []).toEqual([]); - expect(result.valid).toBe(true); - expect(version).toBe(expectedVersion); -}; +async function expectValidAs(spec: object, expectedVersion: string): Promise { + const { result, version } = await validate(spec) + expect(result.errors ?? []).toEqual([]) + expect(result.valid).toBe(true) + expect(version).toBe(expectedVersion) +} -describe("3.1 example documents downgraded to 3.0", () => { - it("converts the tictactoe example to a valid 3.0.4 document without mutating the input", async () => { - const before = structuredClone(tictactoe); - const converted = downgradeSpecV31ToV30(asSpec31(tictactoe)); - expect(converted.openapi).toBe("3.0.4"); - await expectValidAs(converted, "3.0"); - expect(converted).toMatchSnapshot(); - expect(tictactoe).toEqual(before); - }); +describe('3.1 example documents downgraded to 3.0', () => { + it('converts the tictactoe example to a valid 3.0.4 document without mutating the input', async () => { + const before = structuredClone(tictactoe) + const converted = downgradeSpecV31ToV30(asSpec31(tictactoe)) + expect(converted.openapi).toBe('3.0.4') + await expectValidAs(converted, '3.0') + expect(converted).toMatchSnapshot() + expect(tictactoe).toEqual(before) + }) - it("converts the webhook example, removing webhooks and synthesizing empty paths", async () => { - const before = structuredClone(webhookExample); - const converted = downgradeSpecV31ToV30(webhookExample); - expect(converted.openapi).toBe("3.0.4"); - expect(converted).not.toHaveProperty("webhooks"); - expect(converted).not.toHaveProperty("x-webhooks"); - expect(converted.paths).toEqual({}); - expect(converted.components).toHaveProperty(["schemas", "Pet"]); - await expectValidAs(converted, "3.0"); - expect(converted).toMatchSnapshot(); - expect(webhookExample).toEqual(before); - }); + it('converts the webhook example, removing webhooks and synthesizing empty paths', async () => { + const before = structuredClone(webhookExample) + const converted = downgradeSpecV31ToV30(webhookExample) + expect(converted.openapi).toBe('3.0.4') + expect(converted).not.toHaveProperty('webhooks') + expect(converted).not.toHaveProperty('x-webhooks') + expect(converted.paths).toEqual({}) + expect(converted.components).toHaveProperty(['schemas', 'Pet']) + await expectValidAs(converted, '3.0') + expect(converted).toMatchSnapshot() + expect(webhookExample).toEqual(before) + }) - it("converts the non-OAuth-scopes example, emptying roles on the non-OAuth scheme", async () => { - const before = structuredClone(nonOauthScopes); - const converted = downgradeSpecV31ToV30(nonOauthScopes); - expect(converted.openapi).toBe("3.0.4"); + it('converts the non-OAuth-scopes example, emptying roles on the non-OAuth scheme', async () => { + const before = structuredClone(nonOauthScopes) + const converted = downgradeSpecV31ToV30(nonOauthScopes) + expect(converted.openapi).toBe('3.0.4') expect(converted.paths).toMatchObject({ - "/users": { get: { security: [{ bearerAuth: [] }] } }, - }); + '/users': { get: { security: [{ bearerAuth: [] }] } }, + }) // The source operation has no responses; the synthesized minimal default // response keeps the document valid. - expect(converted.paths?.["/users"]?.get?.responses).toEqual({ - default: { description: "" }, - }); - await expectValidAs(converted, "3.0"); - expect(converted).toMatchSnapshot(); - expect(nonOauthScopes).toEqual(before); - }); + expect(converted.paths?.['/users']?.get?.responses).toEqual({ + default: { description: '' }, + }) + await expectValidAs(converted, '3.0') + expect(converted).toMatchSnapshot() + expect(nonOauthScopes).toEqual(before) + }) - it("converts the 3.1 mega document, removing 3.1-only constructs and the mutualTLS scheme", async () => { - const before = structuredClone(mega31); - const converted = downgradeSpecV31ToV30(mega31); - expect(converted.openapi).toBe("3.0.4"); - expect(converted).not.toHaveProperty("webhooks"); - expect(converted).not.toHaveProperty("x-webhooks"); + it('converts the 3.1 mega document, removing 3.1-only constructs and the mutualTLS scheme', async () => { + const before = structuredClone(mega31) + const converted = downgradeSpecV31ToV30(mega31) + expect(converted.openapi).toBe('3.0.4') + expect(converted).not.toHaveProperty('webhooks') + expect(converted).not.toHaveProperty('x-webhooks') expect(converted.info).toEqual({ - license: { name: "Apache 2.0" }, - title: "My API", - version: "1.0.0", - }); - expect(converted.components).not.toHaveProperty("pathItems"); - expect(converted.components).not.toHaveProperty("x-pathItems"); - expect(converted.components?.securitySchemes).toEqual({}); + license: { name: 'Apache 2.0' }, + title: 'My API', + version: '1.0.0', + }) + expect(converted.components).not.toHaveProperty('pathItems') + expect(converted.components).not.toHaveProperty('x-pathItems') + expect(converted.components?.securitySchemes).toEqual({}) // The only reference into components.pathItems lived in the removed // webhooks, so no trace of the reusable path items remains. - expect(JSON.stringify(converted)).not.toContain("#/components/pathItems/"); - await expectValidAs(converted, "3.0"); - expect(converted).toMatchSnapshot(); - expect(mega31).toEqual(before); - }); + expect(JSON.stringify(converted)).not.toContain('#/components/pathItems/') + await expectValidAs(converted, '3.0') + expect(converted).toMatchSnapshot() + expect(mega31).toEqual(before) + }) - it("leaves $refs into the removed components.pathItems untouched, letting them dangle", () => { + it('leaves $refs into the removed components.pathItems untouched, letting them dangle', () => { const doc = asSpec31({ components: { pathItems: { shared: { - get: { responses: { "200": { description: "ok" } } }, + get: { responses: { 200: { description: 'ok' } } }, }, }, }, - info: { title: "Dangling", version: "1.0.0" }, - openapi: "3.1.0", + info: { title: 'Dangling', version: '1.0.0' }, + openapi: '3.1.0', paths: { - "/shared": { $ref: "#/components/pathItems/shared" }, + '/shared': { $ref: '#/components/pathItems/shared' }, }, - }); - const before = structuredClone(doc); - const converted = downgradeSpecV31ToV30(doc); - expect(converted.components).not.toHaveProperty("pathItems"); + }) + const before = structuredClone(doc) + const converted = downgradeSpecV31ToV30(doc) + expect(converted.components).not.toHaveProperty('pathItems') // Documented limitation: the reference is passed through untouched and // now dangles, so the (reference-resolving) validator is not consulted. - expect(converted.paths?.["/shared"]).toEqual({ - $ref: "#/components/pathItems/shared", - }); - expect(doc).toEqual(before); - }); + expect(converted.paths?.['/shared']).toEqual({ + $ref: '#/components/pathItems/shared', + }) + expect(doc).toEqual(before) + }) - it("clones a discriminator with defaultMapping as-is into the 3.0 document", async () => { + it('clones a discriminator with defaultMapping as-is into the 3.0 document', async () => { const doc = asSpec31({ components: { schemas: { Cat: { - properties: { kind: { type: "string" } }, - required: ["kind"], - type: "object", + properties: { kind: { type: 'string' } }, + required: ['kind'], + type: 'object', }, Pet: { discriminator: { - defaultMapping: "Cat", - mapping: { cat: "#/components/schemas/Cat" }, - propertyName: "kind", + defaultMapping: 'Cat', + mapping: { cat: '#/components/schemas/Cat' }, + propertyName: 'kind', }, - oneOf: [{ $ref: "#/components/schemas/Cat" }], + oneOf: [{ $ref: '#/components/schemas/Cat' }], }, }, }, - info: { title: "Discriminated", version: "1.0.0" }, - openapi: "3.1.0", + info: { title: 'Discriminated', version: '1.0.0' }, + openapi: '3.1.0', paths: {}, - }); - const before = structuredClone(doc); - const converted = downgradeSpecV31ToV30(doc); + }) + const before = structuredClone(doc) + const converted = downgradeSpecV31ToV30(doc) // defaultMapping is not a schema keyword the 3.0 converter touches, and // the official 3.0 schema allows extra discriminator fields. expect(converted).toHaveProperty( - ["components", "schemas", "Pet", "discriminator"], + ['components', 'schemas', 'Pet', 'discriminator'], { - defaultMapping: "Cat", - mapping: { cat: "#/components/schemas/Cat" }, - propertyName: "kind", - } - ); - await expectValidAs(converted, "3.0"); - expect(doc).toEqual(before); - }); -}); + defaultMapping: 'Cat', + mapping: { cat: '#/components/schemas/Cat' }, + propertyName: 'kind', + }, + ) + await expectValidAs(converted, '3.0') + expect(doc).toEqual(before) + }) +}) -describe("3.2 example documents downgraded to 3.1 and chained to 3.0", () => { - it("removes the query operation of the query example, leaving an empty path item", async () => { - const before = structuredClone(queryExample); - const v31 = downgradeSpecV32ToV31(queryExample); - expect(v31.openapi).toBe("3.1.2"); +describe('3.2 example documents downgraded to 3.1 and chained to 3.0', () => { + it('removes the query operation of the query example, leaving an empty path item', async () => { + const before = structuredClone(queryExample) + const v31 = downgradeSpecV32ToV31(queryExample) + expect(v31.openapi).toBe('3.1.2') // The QUERY operation has no 3.1 equivalent; an empty Path Item Object // is legal in both 3.1 and 3.0. - expect(v31.paths?.["/flights/search"]).toEqual({}); - expect(JSON.stringify(v31)).not.toContain("x-additionalOperations"); - await expectValidAs(v31, "3.1"); - expect(v31).toMatchSnapshot("v3.1"); + expect(v31.paths?.['/flights/search']).toEqual({}) + expect(JSON.stringify(v31)).not.toContain('x-additionalOperations') + await expectValidAs(v31, '3.1') + expect(v31).toMatchSnapshot('v3.1') - const v30 = downgradeSpecV31ToV30(v31); - expect(v30.openapi).toBe("3.0.4"); - await expectValidAs(v30, "3.0"); - expect(v30).toMatchSnapshot("v3.0"); - expect(queryExample).toEqual(before); - }); + const v30 = downgradeSpecV31ToV30(v31) + expect(v30.openapi).toBe('3.0.4') + await expectValidAs(v30, '3.0') + expect(v30).toMatchSnapshot('v3.0') + expect(queryExample).toEqual(before) + }) - it("removes tag summary, parent, and kind of the tags example", async () => { - const before = structuredClone(tagsExample); - const v31 = downgradeSpecV32ToV31(tagsExample); - expect(v31.openapi).toBe("3.1.2"); + it('removes tag summary, parent, and kind of the tags example', async () => { + const before = structuredClone(tagsExample) + const v31 = downgradeSpecV32ToV31(tagsExample) + expect(v31.openapi).toBe('3.1.2') expect(v31.tags).toEqual([ - { description: "Core flight operations", name: "flights" }, + { description: 'Core flight operations', name: 'flights' }, { - description: "Flights that cross country borders", - name: "international", + description: 'Flights that cross country borders', + name: 'international', }, - { description: "Flights within a single country", name: "domestic" }, + { description: 'Flights within a single country', name: 'domestic' }, { - description: "Information about flight delays", + description: 'Information about flight delays', externalDocs: { - description: "Delay compensation policies", - url: "https://docs.example.com/delay-policies", + description: 'Delay compensation policies', + url: 'https://docs.example.com/delay-policies', }, - name: "delays", + name: 'delays', }, - ]); - await expectValidAs(v31, "3.1"); - expect(v31).toMatchSnapshot("v3.1"); + ]) + await expectValidAs(v31, '3.1') + expect(v31).toMatchSnapshot('v3.1') - const v30 = downgradeSpecV31ToV30(v31); - expect(v30.openapi).toBe("3.0.4"); - await expectValidAs(v30, "3.0"); - expect(v30).toMatchSnapshot("v3.0"); - expect(tagsExample).toEqual(before); - }); + const v30 = downgradeSpecV31ToV30(v31) + expect(v30.openapi).toBe('3.0.4') + await expectValidAs(v30, '3.0') + expect(v30).toMatchSnapshot('v3.0') + expect(tagsExample).toEqual(before) + }) - it("converts the 3.2 mega document, preserving the discriminator defaultMapping in the schema", async () => { - const before = structuredClone(mega32); - const v31 = downgradeSpecV32ToV31(mega32); - expect(v31.openapi).toBe("3.1.2"); + it('converts the 3.2 mega document, preserving the discriminator defaultMapping in the schema', async () => { + const before = structuredClone(mega32) + const v31 = downgradeSpecV32ToV31(mega32) + expect(v31.openapi).toBe('3.1.2') const megaDiscriminatorPath = [ - "components", - "pathItems", - "myPathItem", - "post", - "requestBody", - "content", - "application/json", - "schema", - "discriminator", - ]; + 'components', + 'pathItems', + 'myPathItem', + 'post', + 'requestBody', + 'content', + 'application/json', + 'schema', + 'discriminator', + ] // Schema Objects pass through unchanged in 3.2 -> 3.1, so the 3.2-only // discriminator defaultMapping survives as an extra JSON Schema keyword. expect(v31).toHaveProperty( - [...megaDiscriminatorPath, "defaultMapping"], - "Bar" - ); + [...megaDiscriminatorPath, 'defaultMapping'], + 'Bar', + ) expect(v31).toHaveProperty( - [...megaDiscriminatorPath, "propertyName"], - "type" - ); + [...megaDiscriminatorPath, 'propertyName'], + 'type', + ) expect(v31).not.toHaveProperty([ ...megaDiscriminatorPath, - "x-defaultMapping", - ]); - await expectValidAs(v31, "3.1"); - expect(v31).toMatchSnapshot("v3.1"); + 'x-defaultMapping', + ]) + await expectValidAs(v31, '3.1') + expect(v31).toMatchSnapshot('v3.1') - const v30 = downgradeSpecV31ToV30(v31); - expect(v30.openapi).toBe("3.0.4"); + const v30 = downgradeSpecV31ToV30(v31) + expect(v30.openapi).toBe('3.0.4') // The discriminator lives in components.pathItems, which 3.0 cannot // express, so it disappears together with its host in this hop. - expect(v30.components).not.toHaveProperty("pathItems"); - expect(v30).not.toHaveProperty("webhooks"); - await expectValidAs(v30, "3.0"); - expect(v30).toMatchSnapshot("v3.0"); - expect(mega32).toEqual(before); - }); -}); + expect(v30.components).not.toHaveProperty('pathItems') + expect(v30).not.toHaveProperty('webhooks') + await expectValidAs(v30, '3.0') + expect(v30).toMatchSnapshot('v3.0') + expect(mega32).toEqual(before) + }) +}) -describe("already-3.0-shaped documents", () => { - it("passes the petstore example through untouched apart from the version stamp", () => { - const before = structuredClone(petstore); - const converted = downgradeSpecV31ToV30(asSpec31(petstore)); +describe('already-3.0-shaped documents', () => { + it('passes the petstore example through untouched apart from the version stamp', () => { + const before = structuredClone(petstore) + const converted = downgradeSpecV31ToV30(asSpec31(petstore)) expect(converted).toEqual({ ...structuredClone(petstore), - openapi: "3.0.4", - }); - expect(petstore).toEqual(before); - }); -}); + openapi: '3.0.4', + }) + expect(petstore).toEqual(before) + }) +}) -describe("kitchen-sink 3.2 document chained down to 3.0", () => { +describe('kitchen-sink 3.2 document chained down to 3.0', () => { const kitchenSink = { - $self: "https://api.example.com/openapi.json", + $self: 'https://api.example.com/openapi.json', components: { mediaTypes: { JsonPayload: { - schema: { items: { type: "string" }, type: "array" }, + schema: { items: { type: 'string' }, type: 'array' }, }, }, parameters: { filter: { content: { - "application/json": { + 'application/json': { schema: { - properties: { term: { type: "string" } }, - type: "object", + properties: { term: { type: 'string' } }, + type: 'object', }, }, }, - in: "querystring", - name: "filter", + in: 'querystring', + name: 'filter', }, - page: { in: "query", name: "page", schema: { type: "integer" } }, + page: { in: 'query', name: 'page', schema: { type: 'integer' } }, }, securitySchemes: { deviceAuth: { deprecated: true, flows: { deviceAuthorization: { - deviceAuthorizationUrl: "https://auth.example.com/device", - scopes: { "events:read": "Read events" }, - tokenUrl: "https://auth.example.com/token", + deviceAuthorizationUrl: 'https://auth.example.com/device', + scopes: { 'events:read': 'Read events' }, + tokenUrl: 'https://auth.example.com/token', }, }, - oauth2MetadataUrl: "https://auth.example.com/.well-known/oauth", - type: "oauth2", + oauth2MetadataUrl: 'https://auth.example.com/.well-known/oauth', + type: 'oauth2', }, }, }, - info: { title: "Kitchen Sink", version: "1.0.0" }, - openapi: "3.2.0", + info: { title: 'Kitchen Sink', version: '1.0.0' }, + openapi: '3.2.0', paths: { - "/events": { + '/events': { get: { - operationId: "streamEvents", + operationId: 'streamEvents', responses: { - "200": { + 200: { content: { - "application/json": { - itemSchema: { type: "object" }, - schema: { items: { type: "object" }, type: "array" }, + 'application/json': { + itemSchema: { type: 'object' }, + schema: { items: { type: 'object' }, type: 'array' }, }, - "application/jsonl": { + 'application/jsonl': { itemSchema: { - properties: { kind: { type: "string" } }, - type: "object", + properties: { kind: { type: 'string' } }, + type: 'object', }, }, }, - summary: "Event stream", + summary: 'Event stream', }, - "204": {}, + 204: {}, }, }, }, - "/search": { + '/search': { get: { - operationId: "searchEvents", + operationId: 'searchEvents', parameters: [ { content: { - "application/json": { + 'application/json': { schema: { - properties: { term: { type: "string" } }, - type: "object", + properties: { term: { type: 'string' } }, + type: 'object', }, }, }, - in: "querystring", - name: "filter", + in: 'querystring', + name: 'filter', }, { examples: { - kept: { serializedValue: "sid=1", value: "sid=1" }, + kept: { serializedValue: 'sid=1', value: 'sid=1' }, linked: { dataValue: { sid: 2 }, - externalValue: "https://example.com/session.json", + externalValue: 'https://example.com/session.json', }, - promoted: { dataValue: "sid=3" }, + promoted: { dataValue: 'sid=3' }, }, - in: "cookie", - name: "session", - schema: { type: "string" }, - style: "cookie", + in: 'cookie', + name: 'session', + schema: { type: 'string' }, + style: 'cookie', }, ], responses: { - "200": { + 200: { content: { - "application/json": { - $ref: "#/components/mediaTypes/JsonPayload", + 'application/json': { + $ref: '#/components/mediaTypes/JsonPayload', }, }, - description: "Search results", - summary: "Results", + description: 'Search results', + summary: 'Results', }, }, }, }, }, - security: [{ deviceAuth: ["events:read"] }], - servers: [{ name: "production", url: "https://api.example.com" }], - } satisfies OpenAPIV3_2.OpenAPIObject; + security: [{ deviceAuth: ['events:read'] }], + servers: [{ name: 'production', url: 'https://api.example.com' }], + } satisfies OpenAPIV3_2.OpenAPIObject - it("converts every 3.2-only construct and stays valid through both hops", async () => { - const before = structuredClone(kitchenSink); + it('converts every 3.2-only construct and stays valid through both hops', async () => { + const before = structuredClone(kitchenSink) - const v31 = downgradeSpecV32ToV31(kitchenSink); - expect(v31.openapi).toBe("3.1.2"); - expect(v31).not.toHaveProperty("$self"); - expect(v31).not.toHaveProperty("x-self"); - expect(v31.servers).toEqual([{ url: "https://api.example.com" }]); - expect(v31.components).not.toHaveProperty("mediaTypes"); - expect(JSON.stringify(v31)).not.toContain("#/components/mediaTypes/"); + const v31 = downgradeSpecV32ToV31(kitchenSink) + expect(v31.openapi).toBe('3.1.2') + expect(v31).not.toHaveProperty('$self') + expect(v31).not.toHaveProperty('x-self') + expect(v31.servers).toEqual([{ url: 'https://api.example.com' }]) + expect(v31.components).not.toHaveProperty('mediaTypes') + expect(JSON.stringify(v31)).not.toContain('#/components/mediaTypes/') // The querystring component is removed outright; the deviceAuthorization // flow, oauth2MetadataUrl, and deprecated have no 3.1 equivalent either. expect(v31.components?.parameters).toEqual({ - page: { in: "query", name: "page", schema: { type: "integer" } }, - }); + page: { in: 'query', name: 'page', schema: { type: 'integer' } }, + }) expect(v31.components?.securitySchemes).toEqual({ - deviceAuth: { flows: {}, type: "oauth2" }, - }); - expect(v31.paths?.["/events"]?.get?.responses).toEqual({ - "200": { + deviceAuth: { flows: {}, type: 'oauth2' }, + }) + expect(v31.paths?.['/events']?.get?.responses).toEqual({ + 200: { content: { - "application/json": { - schema: { items: { type: "object" }, type: "array" }, + 'application/json': { + schema: { items: { type: 'object' }, type: 'array' }, }, - "application/jsonl": { + 'application/jsonl': { schema: { items: { - properties: { kind: { type: "string" } }, - type: "object", + properties: { kind: { type: 'string' } }, + type: 'object', }, - type: "array", + type: 'array', }, }, }, - description: "Event stream", + description: 'Event stream', }, - "204": { description: "" }, - }); + 204: { description: '' }, + }) // The querystring parameter is removed from the list; the cookie style // is removed from the remaining parameter, and its examples promote // dataValue/serializedValue into free value slots only. - expect(v31.paths?.["/search"]?.get?.parameters).toEqual([ + expect(v31.paths?.['/search']?.get?.parameters).toEqual([ { examples: { - kept: { value: "sid=1" }, - linked: { externalValue: "https://example.com/session.json" }, - promoted: { value: "sid=3" }, + kept: { value: 'sid=1' }, + linked: { externalValue: 'https://example.com/session.json' }, + promoted: { value: 'sid=3' }, }, - in: "cookie", - name: "session", - schema: { type: "string" }, + in: 'cookie', + name: 'session', + schema: { type: 'string' }, }, - ]); - expect(v31.paths?.["/search"]?.get?.responses?.["200"]).toEqual({ + ]) + expect(v31.paths?.['/search']?.get?.responses?.['200']).toEqual({ content: { - "application/json": { - schema: { items: { type: "string" }, type: "array" }, + 'application/json': { + schema: { items: { type: 'string' }, type: 'array' }, }, }, - description: "Search results", - }); - expect(v31.security).toEqual([{ deviceAuth: ["events:read"] }]); - await expectValidAs(v31, "3.1"); - expect(v31).toMatchSnapshot("v3.1"); + description: 'Search results', + }) + expect(v31.security).toEqual([{ deviceAuth: ['events:read'] }]) + await expectValidAs(v31, '3.1') + expect(v31).toMatchSnapshot('v3.1') - const v30 = downgradeSpecV31ToV30(v31); - expect(v30.openapi).toBe("3.0.4"); - await expectValidAs(v30, "3.0"); - expect(v30).toMatchSnapshot("v3.0"); + const v30 = downgradeSpecV31ToV30(v31) + expect(v30.openapi).toBe('3.0.4') + await expectValidAs(v30, '3.0') + expect(v30).toMatchSnapshot('v3.0') - expect(kitchenSink).toEqual(before); - }); -}); + expect(kitchenSink).toEqual(before) + }) +}) diff --git a/packages/downgrader/tsconfig.json b/packages/downgrader/tsconfig.json index 4a7f724..b5c68d2 100644 --- a/packages/downgrader/tsconfig.json +++ b/packages/downgrader/tsconfig.json @@ -1,10 +1,10 @@ { "extends": "../../tsconfig.lib.json", - "references": [{ "path": "../types" }], "compilerOptions": { - "outDir": "out", - "tsBuildInfoFile": "out/.tsbuildinfo" + "tsBuildInfoFile": "out/.tsbuildinfo", + "outDir": "out" }, + "references": [{ "path": "../types" }], "include": ["package.json", "src"], "exclude": [ "**/*.test.*", diff --git a/packages/types/README.md b/packages/types/README.md index 2842cb7..fc84c0e 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -11,22 +11,23 @@ Each version module is authored against the latest patch release of its minor li ## Usage ```ts -import type { OpenAPIObject, SchemaObject } from "@openapi-spec/types/v3.1"; - -// or via namespaces from the root export +// Namespaces via the root export import type { OpenAPIV3_0, OpenAPIV3_1, OpenAPIV3_2, -} from "@openapi-spec/types"; +} from '@openapi-spec/types' + +// or one version's module directly +import type { OpenAPIObject, SchemaObject } from '@openapi-spec/types/v3.1' // 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: '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. diff --git a/packages/types/package.json b/packages/types/package.json index 6bc20db..aed68d1 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,7 +1,19 @@ { "name": "@openapi-spec/types", + "type": "module", "version": "0.0.0", "description": "TypeScript types for the OpenAPI Specification, covering versions 3.0, 3.1, and 3.2 with complete inline documentation", + "license": "MIT", + "funding": [ + "https://github.com/sponsors/dinwwwh", + "https://opencollective.com/middleapi" + ], + "homepage": "https://github.com/middleapi/openapi-spec", + "repository": { + "type": "git", + "url": "git+https://github.com/middleapi/openapi-spec.git", + "directory": "packages/types" + }, "keywords": [ "oas", "openapi", @@ -15,21 +27,6 @@ "types", "typescript" ], - "homepage": "https://github.com/middleapi/openapi-spec", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/middleapi/openapi-spec.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", @@ -38,6 +35,9 @@ "./v3.1": "./src/v3.1.ts", "./v3.2": "./src/v3.2.ts" }, + "files": [ + "dist" + ], "publishConfig": { "exports": { "./package.json": "./package.json", diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index eab7bde..a182940 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,3 +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"; +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 index 47e2654..8230ffe 100644 --- a/packages/types/src/v3.0.test-d.ts +++ b/packages/types/src/v3.0.test-d.ts @@ -4,48 +4,48 @@ import type { ResponsesObject, SchemaObject, SecuritySchemeObject, -} from "./v3.0"; +} from './v3.0' export const petstore = { - components: { + 'components': { callbacks: { onPetStatusChange: { - "{$request.body#/callbackUrl}": { - post: { responses: { "200": { description: "OK" } } }, + '{$request.body#/callbackUrl}': { + post: { responses: { 200: { description: 'OK' } } }, }, }, }, examples: { - tags: { summary: "Example tags", value: ["dog", "cat"] }, + tags: { summary: 'Example tags', value: ['dog', 'cat'] }, }, headers: { next: { - description: "Link to the next page", - schema: { type: "string" }, + description: 'Link to the next page', + schema: { type: 'string' }, }, }, links: { - next: { operationRef: "#/paths/~1pets/get" }, + next: { operationRef: '#/paths/~1pets/get' }, }, parameters: { sessionCookie: { content: { - "text/plain": { schema: { type: "string" } }, + 'text/plain': { schema: { type: 'string' } }, }, - in: "cookie", - name: "session", + in: 'cookie', + name: 'session', }, traceId: { - in: "header", - name: "X-Trace-Id", - schema: { type: "string" }, + in: 'header', + name: 'X-Trace-Id', + schema: { type: 'string' }, }, }, requestBodies: { PetBody: { content: { - "application/x-www-form-urlencoded": { - schema: { type: "object" }, + 'application/x-www-form-urlencoded': { + schema: { type: 'object' }, }, }, }, @@ -53,377 +53,377 @@ export const petstore = { responses: { Error: { content: { - "application/json": { schema: { $ref: "#/components/schemas/Pet" } }, + 'application/json': { schema: { $ref: '#/components/schemas/Pet' } }, }, - description: "An error occurred", + description: 'An error occurred', }, }, schemas: { Animal: { discriminator: { mapping: { - cat: "#/components/schemas/Cat", - dog: "Dog", + cat: '#/components/schemas/Cat', + dog: 'Dog', }, - propertyName: "petType", + propertyName: 'petType', }, oneOf: [ - { $ref: "#/components/schemas/Cat" }, - { $ref: "#/components/schemas/Dog" }, + { $ref: '#/components/schemas/Cat' }, + { $ref: '#/components/schemas/Dog' }, ], }, AnyOfExample: { - anyOf: [{ pattern: "^[a-z]+$", type: "string" }, { type: "integer" }], + anyOf: [{ pattern: '^[a-z]+$', type: 'string' }, { type: 'integer' }], }, - Cat: { type: "object" }, - Dog: { type: "object" }, + Cat: { type: 'object' }, + Dog: { type: 'object' }, NewPet: { allOf: [ - { $ref: "#/components/schemas/Pet" }, - { properties: { name: { type: "string" } }, type: "object" }, + { $ref: '#/components/schemas/Pet' }, + { properties: { name: { type: 'string' } }, type: 'object' }, ], }, Pet: { - additionalProperties: false, - description: "A pet", - externalDocs: { url: "https://example.com/pet" }, - properties: { + 'additionalProperties': false, + 'description': 'A pet', + 'externalDocs': { url: 'https://example.com/pet' }, + 'properties': { attributes: { - additionalProperties: { type: "string" }, + additionalProperties: { type: 'string' }, maxProperties: 20, minProperties: 0, - type: "object", - xml: { name: "attribute", wrapped: false }, + type: 'object', + xml: { name: 'attribute', wrapped: false }, }, friends: { - items: { $ref: "#/components/schemas/Pet" }, + items: { $ref: '#/components/schemas/Pet' }, maxItems: 10, minItems: 0, - type: "array", + type: 'array', uniqueItems: true, }, - id: { format: "int64", readOnly: true, type: "integer" }, - legacy: { deprecated: true, not: { type: "string" } }, - name: { maxLength: 100, minLength: 1, type: "string" }, + 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", + type: 'number', }, - secret: { type: "string", writeOnly: true }, + secret: { type: 'string', writeOnly: true }, status: { - default: "available", - enum: ["available", "pending", "sold"], - example: "available", - type: "string", + default: 'available', + enum: ['available', 'pending', 'sold'], + example: 'available', + type: 'string', }, - tag: { nullable: true, 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", + '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", + description: 'API key auth', + in: 'header', + name: 'api_key', + type: 'apiKey', }, - basicAuth: { scheme: "basic", type: "http" }, - bearerAuth: { bearerFormat: "JWT", scheme: "bearer", type: "http" }, + basicAuth: { scheme: 'basic', type: 'http' }, + bearerAuth: { bearerFormat: 'JWT', scheme: 'bearer', type: 'http' }, oidc: { openIdConnectUrl: - "https://example.com/.well-known/openid-configuration", - type: "openIdConnect", + '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", + authorizationUrl: 'https://example.com/authorize', + scopes: { 'write:pets': 'modify pets' }, + tokenUrl: 'https://example.com/token', }, clientCredentials: { - refreshUrl: "https://example.com/refresh", + refreshUrl: 'https://example.com/refresh', scopes: {}, - tokenUrl: "https://example.com/token", + tokenUrl: 'https://example.com/token', }, implicit: { - authorizationUrl: "https://example.com/authorize", - scopes: { "read:pets": "read your pets" }, + authorizationUrl: 'https://example.com/authorize', + scopes: { 'read:pets': 'read your pets' }, }, password: { scopes: {}, - tokenUrl: "https://example.com/token", + tokenUrl: 'https://example.com/token', }, }, - type: "oauth2", + type: 'oauth2', }, - referenced: { $ref: "#/components/securitySchemes/apiKey" }, + 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", + '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", + '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, + 'termsOfService': 'https://example.com/terms/', + 'title': 'Swagger Petstore', + 'version': '1.0.0', + 'x-internal-id': 42, }, - openapi: "3.0.4", - paths: { - "/pets": { + 'openapi': '3.0.4', + 'paths': { + '/pets': { get: { - deprecated: false, - externalDocs: { description: "More", url: "https://example.com/docs" }, - operationId: "listPets", - parameters: [ + 'deprecated': false, + 'externalDocs': { description: 'More', url: 'https://example.com/docs' }, + 'operationId': 'listPets', + 'parameters': [ { allowReserved: false, - description: "How many items to return", + description: 'How many items to return', example: 20, explode: false, - in: "query", - name: "limit", + in: 'query', + name: 'limit', required: false, - schema: { format: "int32", maximum: 100, type: "integer" }, - style: "form", + 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" }, + external: { externalValue: 'https://example.com/examples/tags' }, + referenced: { $ref: '#/components/examples/tags' }, + two: { summary: 'Two tags', value: 'dog|cat' }, }, - in: "query", - name: "tags", + in: 'query', + name: 'tags', schema: { - items: { type: "string" }, - type: "array", + items: { type: 'string' }, + type: 'array', }, - style: "pipeDelimited", + style: 'pipeDelimited', }, - { $ref: "#/components/parameters/traceId" }, + { $ref: '#/components/parameters/traceId' }, ], - responses: { - "200": { + 'responses': { + '200': { content: { - "application/json": { - example: [{ id: 1, name: "Rex" }], + 'application/json': { + example: [{ id: 1, name: 'Rex' }], schema: { - items: { $ref: "#/components/schemas/Pet" }, - type: "array", + items: { $ref: '#/components/schemas/Pet' }, + type: 'array', }, }, }, - description: "A paged array of pets", + description: 'A paged array of pets', headers: { - "x-next": { $ref: "#/components/headers/next" }, - "x-rate-limit": { + 'x-next': { $ref: '#/components/headers/next' }, + 'x-rate-limit': { deprecated: false, - description: "Calls per hour allowed", + description: 'Calls per hour allowed', explode: false, required: false, - schema: { type: "integer" }, - style: "simple", + schema: { type: 'integer' }, + style: 'simple', }, }, links: { - byRef: { $ref: "#/components/links/next" }, + byRef: { $ref: '#/components/links/next' }, next: { - description: "The next page", - operationId: "listPets", - parameters: { limit: "$request.query.limit" }, - server: { url: "https://api.example.com/v1" }, + 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" }, + '4XX': { $ref: '#/components/responses/Error' }, + 'default': { description: 'Unexpected error' }, }, - security: [{}, { petstoreAuth: ["read:pets"] }], - servers: [{ url: "/" }], - summary: "List all pets", - tags: ["pets"], - "x-code-samples": [], + 'security': [{}, { petstoreAuth: ['read:pets'] }], + 'servers': [{ url: '/' }], + 'summary': 'List all pets', + 'tags': ['pets'], + 'x-code-samples': [], }, post: { callbacks: { - byRef: { $ref: "#/components/callbacks/onPetStatusChange" }, + byRef: { $ref: '#/components/callbacks/onPetStatusChange' }, onPetStatusChange: { - "{$request.body#/callbackUrl}": { + '{$request.body#/callbackUrl}': { post: { requestBody: { content: { - "application/json": { schema: { type: "object" } }, + 'application/json': { schema: { type: 'object' } }, }, }, - responses: { "200": { description: "OK" } }, + responses: { 200: { description: 'OK' } }, }, }, }, }, requestBody: { content: { - "application/json": { - schema: { $ref: "#/components/schemas/NewPet" }, + 'application/json': { + schema: { $ref: '#/components/schemas/NewPet' }, }, - "multipart/form-data": { + 'multipart/form-data': { encoding: { metadata: { allowReserved: false, explode: true, - style: "form", + style: 'form', }, photo: { - contentType: "image/png, image/jpeg", + contentType: 'image/png, image/jpeg', headers: { - "X-Upload-Id": { schema: { type: "string" } }, + 'X-Upload-Id': { schema: { type: 'string' } }, }, }, }, schema: { properties: { - metadata: { nullable: true, type: "object" }, - photo: { format: "binary", type: "string" }, + metadata: { nullable: true, type: 'object' }, + photo: { format: 'binary', type: 'string' }, }, - type: "object", + type: 'object', }, }, }, - description: "Pet to add", + description: 'Pet to add', required: true, }, responses: { - "201": { description: "Created" }, + 201: { description: 'Created' }, }, - summary: "Create a pet", + summary: 'Create a pet', }, - summary: "Pet operations", + summary: 'Pet operations', }, - "/pets/{petId}": { - $ref: "#/components/schemas/ignored-path-item", + '/pets/{petId}': { + $ref: '#/components/schemas/ignored-path-item', delete: { - responses: { "204": { description: "Deleted" } }, + responses: { 204: { description: 'Deleted' } }, }, parameters: [ { - in: "path", - name: "petId", + in: 'path', + name: 'petId', required: true, - schema: { type: "string" }, - style: "matrix", + schema: { type: 'string' }, + style: 'matrix', }, ], }, - "x-hidden-paths": ["/internal"], + 'x-hidden-paths': ['/internal'], }, - security: [{ apiKey: [] }], - servers: [ + 'security': [{ apiKey: [] }], + 'servers': [ { - description: "Main server", - url: "https://{environment}.example.com/v1", + description: 'Main server', + url: 'https://{environment}.example.com/v1', variables: { environment: { - default: "api", - description: "Environment prefix", - enum: ["api", "api.dev", "api.staging"], + default: 'api', + description: 'Environment prefix', + enum: ['api', 'api.dev', 'api.staging'], }, }, }, ], - tags: [ + 'tags': [ { - description: "Pet operations", - externalDocs: { url: "https://example.com/docs/pets" }, - name: "pets", - "x-display-name": "Pets", + 'description': 'Pet operations', + 'externalDocs': { url: 'https://example.com/docs/pets' }, + 'name': 'pets', + 'x-display-name': 'Pets', }, ], - "x-tag-groups": [], -} satisfies OpenAPIObject; + '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", -}; + 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", + 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; +} satisfies OpenAPIObject export const wrongVersion = { - info: { title: "API", version: "1.0.0" }, + 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", + openapi: '3.1.0', paths: {}, -} satisfies OpenAPIObject; +} 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; + 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; + 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 booleanSchema = true satisfies SchemaObject export const closedReference = { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', // @ts-expect-error: The 3.0 Reference Object has no `summary`/`description` overrides. - summary: "A pet", -} satisfies ReferenceObject; + 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; + 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; + 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; + 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; + type: 'string', +} satisfies SchemaObject diff --git a/packages/types/src/v3.0.ts b/packages/types/src/v3.0.ts index eec2ae5..c6495c3 100644 --- a/packages/types/src/v3.0.ts +++ b/packages/types/src/v3.0.ts @@ -22,7 +22,7 @@ export interface SpecificationExtensions { * `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 + [extension: `x-${string}`]: unknown } /** @@ -38,27 +38,27 @@ export interface OpenAPIObject extends SpecificationExtensions { * the OpenAPI Document. This is not related to the API `info.version` * string. */ - openapi: `3.0.${string}`; + openapi: `3.0.${string}` /** * REQUIRED. Provides metadata about the API. The metadata MAY be used by * tooling as required. */ - info: InfoObject; + 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[]; + servers?: ServerObject[] /** * REQUIRED. The available paths and operations for the API. */ - paths: PathsObject; + paths: PathsObject /** * An element to hold various Objects for the OpenAPI Description. */ - components?: ComponentsObject; + components?: ComponentsObject /** * A declaration of which security mechanisms can be used across the API. * The list of values includes alternative Security Requirement Objects; @@ -67,7 +67,7 @@ export interface OpenAPIObject extends SpecificationExtensions { * to being empty or absent. To make security explicitly optional, an empty * security requirement (`{}`) can be included in the array. */ - security?: SecurityRequirementObject[]; + 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 @@ -75,11 +75,11 @@ export interface OpenAPIObject extends SpecificationExtensions { * declared; undeclared tags MAY be organized randomly or based on the * tools' logic. Each tag name in the list MUST be unique. */ - tags?: TagObject[]; + tags?: TagObject[] /** * Additional external documentation. */ - externalDocs?: ExternalDocumentationObject; + externalDocs?: ExternalDocumentationObject } /** @@ -93,31 +93,31 @@ export interface InfoObject extends SpecificationExtensions { /** * REQUIRED. The title of the API. */ - title: string; + title: string /** * A description of the API. CommonMark syntax MAY be used for rich text * representation. */ - description?: string; + description?: string /** * A URL for the Terms of Service for the API. This MUST be in the form of a * URL. */ - termsOfService?: string; + termsOfService?: string /** * The contact information for the exposed API. */ - contact?: ContactObject; + contact?: ContactObject /** * The license information for the exposed API. */ - license?: LicenseObject; + 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; + version: string } /** @@ -129,16 +129,16 @@ export interface ContactObject extends SpecificationExtensions { /** * The identifying name of the contact person/organization. */ - name?: string; + name?: string /** * The URL for the contact information. This MUST be in the form of a URL. */ - url?: string; + url?: string /** * The email address of the contact person/organization. This MUST be in the * form of an email address. */ - email?: string; + email?: string } /** @@ -150,12 +150,12 @@ export interface LicenseObject extends SpecificationExtensions { /** * REQUIRED. The license name used for the API. */ - name: string; + name: string /** * A URL for the license used for the API. This MUST be in the form of a * URL. */ - url?: string; + url?: string } /** @@ -171,17 +171,17 @@ export interface ServerObject extends SpecificationExtensions { * served. Variable substitutions will be made when a variable is named in * `{braces}`. */ - url: string; + url: string /** * An optional string describing the host designated by the URL. CommonMark * syntax MAY be used for rich text representation. */ - description?: string; + 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; + variables?: Record } /** @@ -195,7 +195,7 @@ 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[]; + 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 @@ -203,12 +203,12 @@ export interface ServerVariableObject extends SpecificationExtensions { * different from the Schema Object's `default` keyword, which documents the * receiver's behavior rather than inserting the value into the data. */ - default: string; + default: string /** * An optional description for the server variable. CommonMark syntax MAY be * used for rich text representation. */ - description?: string; + description?: string } /** @@ -225,39 +225,39 @@ export interface ComponentsObject extends SpecificationExtensions { /** * An object to hold reusable Schema Objects. */ - schemas?: Record; + schemas?: Record /** * An object to hold reusable Response Objects. */ - responses?: Record; + responses?: Record /** * An object to hold reusable Parameter Objects. */ - parameters?: Record; + parameters?: Record /** * An object to hold reusable Example Objects. */ - examples?: Record; + examples?: Record /** * An object to hold reusable Request Body Objects. */ - requestBodies?: Record; + requestBodies?: Record /** * An object to hold reusable Header Objects. */ - headers?: Record; + headers?: Record /** * An object to hold reusable Security Scheme Objects. */ - securitySchemes?: Record; + securitySchemes?: Record /** * An object to hold reusable Link Objects. */ - links?: Record; + links?: Record /** * An object to hold reusable Callback Objects. */ - callbacks?: Record; + callbacks?: Record } /** @@ -279,7 +279,7 @@ export interface PathsObject extends SpecificationExtensions { * 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; + [path: `/${string}`]: PathItemObject } /** @@ -297,55 +297,55 @@ export interface PathItemObject extends SpecificationExtensions { * 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; + $ref?: string /** * An optional string summary, intended to apply to all operations in this * path. */ - summary?: string; + 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; + description?: string /** * A definition of a GET operation on this path. */ - get?: OperationObject; + get?: OperationObject /** * A definition of a PUT operation on this path. */ - put?: OperationObject; + put?: OperationObject /** * A definition of a POST operation on this path. */ - post?: OperationObject; + post?: OperationObject /** * A definition of a DELETE operation on this path. */ - delete?: OperationObject; + delete?: OperationObject /** * A definition of a OPTIONS operation on this path. */ - options?: OperationObject; + options?: OperationObject /** * A definition of a HEAD operation on this path. */ - head?: OperationObject; + head?: OperationObject /** * A definition of a PATCH operation on this path. */ - patch?: OperationObject; + patch?: OperationObject /** * A definition of a TRACE operation on this path. */ - trace?: OperationObject; + 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[]; + 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 @@ -354,7 +354,7 @@ export interface PathItemObject extends SpecificationExtensions { * location. The list can use the Reference Object to link to parameters * defined in the OpenAPI Object's `components.parameters`. */ - parameters?: (ParameterObject | ReferenceObject)[]; + parameters?: (ParameterObject | ReferenceObject)[] } /** @@ -367,20 +367,20 @@ 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[]; + tags?: string[] /** * A short summary of what the operation does. */ - summary?: string; + summary?: string /** * A verbose explanation of the operation behavior. CommonMark syntax MAY be * used for rich text representation. */ - description?: string; + description?: string /** * Additional external documentation for this operation. */ - externalDocs?: ExternalDocumentationObject; + 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 @@ -388,7 +388,7 @@ export interface OperationObject extends SpecificationExtensions { * identify an operation, therefore, it is RECOMMENDED to follow common * programming naming conventions. */ - operationId?: string; + 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 @@ -397,7 +397,7 @@ export interface OperationObject extends SpecificationExtensions { * location. The list can use the Reference Object to link to parameters * defined in the OpenAPI Object's `components.parameters`. */ - parameters?: (ParameterObject | ReferenceObject)[]; + 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 @@ -405,26 +405,26 @@ export interface OperationObject extends SpecificationExtensions { * HTTP spec is vague (such as GET, HEAD and DELETE), `requestBody` SHALL be * ignored by consumers. */ - requestBody?: RequestBodyObject | ReferenceObject; + requestBody?: RequestBodyObject | ReferenceObject /** * REQUIRED. The list of possible responses as they are returned from * executing this operation. */ - responses: ResponsesObject; + 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; + callbacks?: Record /** * Declares this operation to be deprecated. Consumers SHOULD refrain from * usage of the declared operation. * * @default false */ - deprecated?: boolean; + deprecated?: boolean /** * A declaration of which security mechanisms can be used for this * operation. Only one of the Security Requirement Objects needs to be @@ -433,13 +433,13 @@ export interface OperationObject extends SpecificationExtensions { * overrides any declared top-level `security`. To remove a top-level * security declaration, an empty array can be used. */ - security?: SecurityRequirementObject[]; + 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[]; + servers?: ServerObject[] } /** @@ -452,12 +452,12 @@ export interface ExternalDocumentationObject extends SpecificationExtensions { * A description of the target documentation. CommonMark syntax MAY be used * for rich text representation. */ - description?: string; + description?: string /** * REQUIRED. The URL for the target documentation. This MUST be in the form * of a URL. */ - url: string; + url: string } /** @@ -465,7 +465,7 @@ export interface ExternalDocumentationObject extends SpecificationExtensions { * * @see {@link https://spec.openapis.org/oas/v3.0.4.html#parameter-locations} */ -export type ParameterLocation = "cookie" | "header" | "path" | "query"; +export type ParameterLocation = 'cookie' | 'header' | 'path' | 'query' /** * Describes how a parameter value will be serialized depending on the type of @@ -485,14 +485,14 @@ export type ParameterLocation = "cookie" | "header" | "path" | "query"; * * @see {@link https://spec.openapis.org/oas/v3.0.4.html#style-values} */ -export type ParameterStyle = - | "deepObject" - | "form" - | "label" - | "matrix" - | "pipeDelimited" - | "simple" - | "spaceDelimited"; +export type ParameterStyle + = | 'deepObject' + | 'form' + | 'label' + | 'matrix' + | 'pipeDelimited' + | 'simple' + | 'spaceDelimited' /** * The subset of `style` values that is defined for `query` parameters. The @@ -501,11 +501,11 @@ export type ParameterStyle = * * @see {@link https://spec.openapis.org/oas/v3.0.4.html#style-values} */ -export type QueryParameterStyle = - | "deepObject" - | "form" - | "pipeDelimited" - | "spaceDelimited"; +export type QueryParameterStyle + = | 'deepObject' + | 'form' + | 'pipeDelimited' + | 'spaceDelimited' /** * Describes a single operation parameter. @@ -530,17 +530,17 @@ export interface ParameterObject extends SpecificationExtensions { * - For all other cases, the `name` corresponds to the parameter name used * by the `in` field. */ - name: string; + name: string /** * REQUIRED. The location of the parameter. Possible values are `"query"`, * `"header"`, `"path"` or `"cookie"`. */ - in: ParameterLocation; + 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; + description?: string /** * Determines whether this parameter is mandatory. If the parameter location * is `"path"`, this field is REQUIRED and its value MUST be `true`. @@ -548,14 +548,14 @@ export interface ParameterObject extends SpecificationExtensions { * * @default false */ - required?: boolean; + required?: boolean /** * Specifies that a parameter is deprecated and SHOULD be transitioned out * of usage. * * @default false */ - deprecated?: boolean; + 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 @@ -566,14 +566,14 @@ export interface ParameterObject extends SpecificationExtensions { * * @default false */ - allowEmptyValue?: boolean; + 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; + 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 @@ -582,7 +582,7 @@ export interface ParameterObject extends SpecificationExtensions { * value is `false`. Note that despite `false` being the default for * `deepObject`, the combination of `false` with `deepObject` is undefined. */ - explode?: boolean; + explode?: boolean /** * When true, parameter values are serialized using reserved expansion, as * defined by RFC6570, which allows RFC3986's reserved character set, as @@ -592,11 +592,11 @@ export interface ParameterObject extends SpecificationExtensions { * * @default false */ - allowReserved?: boolean; + allowReserved?: boolean /** * The schema defining the type used for the parameter. */ - schema?: SchemaObject | ReferenceObject; + 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 @@ -604,7 +604,7 @@ export interface ParameterObject extends SpecificationExtensions { * field. Furthermore, if referencing a `schema` that contains an example, * the `example` value SHALL override the example provided by the schema. */ - example?: unknown; + 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 @@ -612,13 +612,13 @@ export interface ParameterObject extends SpecificationExtensions { * Furthermore, if referencing a `schema` that contains an example, the * `examples` value SHALL override the example provided by the schema. */ - examples?: Record; + 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; + content?: Record } /** @@ -631,20 +631,20 @@ 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; + 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; + content: Record /** * Determines if the request body is required in the request. * * @default false */ - required?: boolean; + required?: boolean } /** @@ -659,7 +659,7 @@ export interface MediaTypeObject extends SpecificationExtensions { * header. When using `multipart` content, a `schema` is REQUIRED to define * the input parameters to the operation. */ - schema?: SchemaObject | ReferenceObject; + 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 @@ -667,7 +667,7 @@ export interface MediaTypeObject extends SpecificationExtensions { * field. Furthermore, if referencing a `schema` that contains an example, * the `example` value SHALL override the example provided by the schema. */ - example?: unknown; + 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 @@ -675,7 +675,7 @@ export interface MediaTypeObject extends SpecificationExtensions { * field. Furthermore, if referencing a `schema` that contains an example, * the `examples` value SHALL override the example provided by the schema. */ - examples?: Record; + 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 @@ -684,7 +684,7 @@ export interface MediaTypeObject extends SpecificationExtensions { * no Encoding Object is provided for a property, the behavior is determined * by the default values documented for the Encoding Object. */ - encoding?: Record; + encoding?: Record } /** @@ -706,14 +706,14 @@ export interface EncodingObject extends SpecificationExtensions { * primitive types – `text/plain`; for `object` – `application/json`; for * `array` – the default is defined based on the inner type. */ - contentType?: string; + 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; + 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 @@ -725,7 +725,7 @@ export interface EncodingObject extends SpecificationExtensions { * * @default "form" */ - style?: QueryParameterStyle; + 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 @@ -734,7 +734,7 @@ export interface EncodingObject extends SpecificationExtensions { * value is `false`. This field SHALL be ignored if the request body media * type is not `application/x-www-form-urlencoded`. */ - explode?: boolean; + explode?: boolean /** * When true, parameter values are serialized using reserved expansion, as * defined by RFC6570, which allows RFC3986's reserved character set, as @@ -745,7 +745,7 @@ export interface EncodingObject extends SpecificationExtensions { * * @default false */ - allowReserved?: boolean; + allowReserved?: boolean } /** @@ -763,7 +763,7 @@ 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; + 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 @@ -778,7 +778,7 @@ export interface ResponsesObject extends SpecificationExtensions { */ [statusCode: `${1 | 2 | 3 | 4 | 5}${string}`]: | ResponseObject - | ReferenceObject; + | ReferenceObject } /** @@ -792,26 +792,26 @@ export interface ResponseObject extends SpecificationExtensions { * REQUIRED. A description of the response. CommonMark syntax MAY be used * for rich text representation. */ - description: string; + 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; + 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; + 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; + links?: Record } /** @@ -834,7 +834,7 @@ export interface CallbackObject { * callback request (e.g. `$request.body#/url`); expressions can be embedded * into string values by surrounding them with `{}` curly braces. */ - [expression: string]: PathItemObject; + [expression: string]: PathItemObject } /** @@ -851,26 +851,26 @@ export interface ExampleObject extends SpecificationExtensions { /** * Short description for the example. */ - summary?: string; + summary?: string /** * Long description for the example. CommonMark syntax MAY be used for rich * text representation. */ - description?: string; + 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; + 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; + externalValue?: string } /** @@ -891,13 +891,13 @@ export interface LinkObject extends SpecificationExtensions { * `operationRef` values MAY be used to locate an existing Operation Object * in the OpenAPI Description. */ - operationRef?: string; + 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; + operationId?: string /** * A map representing parameters to pass to an operation as specified with * `operationId` or identified via `operationRef`. The key is the parameter @@ -906,21 +906,21 @@ export interface LinkObject extends SpecificationExtensions { * 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 + parameters?: Record /** * A literal value or runtime expression to use as a request body when * calling the target operation. */ - requestBody?: unknown; + requestBody?: unknown /** * A description of the link. CommonMark syntax MAY be used for rich text * representation. */ - description?: string; + description?: string /** * A server object to be used by the target operation. */ - server?: ServerObject; + server?: ServerObject } /** @@ -943,27 +943,27 @@ 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; + description?: string /** * Determines whether this header is mandatory. * * @default false */ - required?: boolean; + required?: boolean /** * Specifies that the header is deprecated and SHOULD be transitioned out of * usage. * * @default false */ - deprecated?: boolean; + deprecated?: boolean /** * Describes how the header value will be serialized. The default (and only * legal value for headers) is `"simple"`. * * @default "simple" */ - style?: "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 @@ -972,11 +972,11 @@ export interface HeaderObject extends SpecificationExtensions { * * @default false */ - explode?: boolean; + explode?: boolean /** * The schema defining the type used for the header. */ - schema?: SchemaObject | ReferenceObject; + 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 @@ -984,7 +984,7 @@ export interface HeaderObject extends SpecificationExtensions { * field. Furthermore, if referencing a `schema` that contains an example, * the `example` value SHALL override the example provided by the schema. */ - example?: unknown; + 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 @@ -992,12 +992,12 @@ export interface HeaderObject extends SpecificationExtensions { * Furthermore, if referencing a `schema` that contains an example, the * `examples` value SHALL override the example provided by the schema. */ - examples?: Record; + 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; + content?: Record } /** @@ -1011,16 +1011,16 @@ export interface TagObject extends SpecificationExtensions { /** * REQUIRED. The name of the tag. */ - name: string; + name: string /** * A description for the tag. CommonMark syntax MAY be used for rich text * representation. */ - description?: string; + description?: string /** * Additional external documentation for this tag. */ - externalDocs?: ExternalDocumentationObject; + externalDocs?: ExternalDocumentationObject } /** @@ -1036,7 +1036,7 @@ export interface ReferenceObject { /** * REQUIRED. The reference string. */ - $ref: string; + $ref: string } /** @@ -1045,13 +1045,13 @@ export interface ReferenceObject { * * @see {@link https://spec.openapis.org/oas/v3.0.4.html#data-types} */ -export type SchemaObjectType = - | "array" - | "boolean" - | "integer" - | "number" - | "object" - | "string"; +export type SchemaObjectType + = | 'array' + | 'boolean' + | 'integer' + | 'number' + | 'object' + | 'string' /** * The Schema Object allows the definition of input and output data types. @@ -1071,17 +1071,17 @@ export interface SchemaObject extends SpecificationExtensions { /** * A short title for the schema. */ - title?: string; + 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; + multipleOf?: number /** * An inclusive upper limit for a numeric instance, unless * `exclusiveMaximum` is `true`. */ - maximum?: number; + 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 @@ -1089,12 +1089,12 @@ export interface SchemaObject extends SpecificationExtensions { * * @default false */ - exclusiveMaximum?: boolean; + exclusiveMaximum?: boolean /** * An inclusive lower limit for a numeric instance, unless * `exclusiveMinimum` is `true`. */ - minimum?: number; + 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 @@ -1102,105 +1102,105 @@ export interface SchemaObject extends SpecificationExtensions { * * @default false */ - exclusiveMinimum?: boolean; + exclusiveMinimum?: boolean /** * The maximum length of a string instance. MUST be a non-negative integer. */ - maxLength?: number; + maxLength?: number /** * The minimum length of a string instance. MUST be a non-negative integer. * * @default 0 */ - minLength?: number; + 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; + pattern?: string /** * The maximum number of items in an array instance. MUST be a non-negative * integer. */ - maxItems?: number; + maxItems?: number /** * The minimum number of items in an array instance. MUST be a non-negative * integer. * * @default 0 */ - minItems?: number; + minItems?: number /** * If `true`, all items in an array instance must be unique. * * @default false */ - uniqueItems?: boolean; + uniqueItems?: boolean /** * The maximum number of properties of an object instance. MUST be a * non-negative integer. */ - maxProperties?: number; + maxProperties?: number /** * The minimum number of properties of an object instance. MUST be a * non-negative integer. * * @default 0 */ - minProperties?: number; + 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[]; + required?: string[] /** * The instance is valid only if its value equals one of the elements in * this array. */ - enum?: T[]; + 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; + 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)[]; + 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)[]; + 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)[]; + 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; + 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; + 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; + 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 @@ -1208,12 +1208,12 @@ export interface SchemaObject extends SpecificationExtensions { * * @default true */ - additionalProperties?: boolean | SchemaObject | ReferenceObject; + additionalProperties?: boolean | SchemaObject | ReferenceObject /** * A description of the schema. CommonMark syntax MAY be used for rich text * representation. */ - description?: string; + 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"`, @@ -1224,7 +1224,7 @@ export interface SchemaObject extends SpecificationExtensions { * non-validating annotation by default; tools that do not recognize a * format MAY default back to `type` alone. */ - format?: string; + 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 @@ -1232,7 +1232,7 @@ export interface SchemaObject extends SpecificationExtensions { * Object defined at the same level (e.g. if `type` is `"string"`, then * `default` can be `"foo"` but cannot be `1`). */ - default?: T; + 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 @@ -1243,14 +1243,14 @@ export interface SchemaObject extends SpecificationExtensions { * * @default false */ - nullable?: boolean; + 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; + 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 @@ -1261,7 +1261,7 @@ export interface SchemaObject extends SpecificationExtensions { * * @default false */ - readOnly?: boolean; + 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 @@ -1272,31 +1272,31 @@ export interface SchemaObject extends SpecificationExtensions { * * @default false */ - writeOnly?: boolean; + 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; + xml?: XMLObject /** * Additional external documentation for this schema. */ - externalDocs?: ExternalDocumentationObject; + 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; + example?: T /** * Specifies that a schema is deprecated and SHOULD be transitioned out of * usage. * * @default false */ - deprecated?: boolean; + deprecated?: boolean } /** @@ -1317,7 +1317,7 @@ export interface DiscriminatorObject { * discriminating value. This property SHOULD be required in the payload * schema, as the behavior when the property is absent is undefined. */ - propertyName: string; + 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 @@ -1327,7 +1327,7 @@ export interface DiscriminatorObject { * with the `"."` path segment (e.g. `"./foo"`). Mapping keys MUST be string * values. */ - mapping?: Record; + mapping?: Record } /** @@ -1347,23 +1347,23 @@ export interface XMLObject extends SpecificationExtensions { * element if and only if `wrapped` is `true`; if `wrapped` is `false`, it * will be ignored. */ - name?: string; + name?: string /** * The URI of the namespace definition. Value MUST be in the form of a * non-relative URI. */ - namespace?: string; + namespace?: string /** * The prefix to be used for the name. */ - prefix?: string; + prefix?: string /** * Declares whether the property definition translates to an attribute * instead of an element. * * @default false */ - attribute?: boolean; + attribute?: boolean /** * MAY be used only for an array definition. Signifies whether the array is * wrapped (e.g. ``) or unwrapped @@ -1372,7 +1372,7 @@ export interface XMLObject extends SpecificationExtensions { * * @default false */ - wrapped?: boolean; + wrapped?: boolean } /** @@ -1380,7 +1380,7 @@ export interface XMLObject extends SpecificationExtensions { * * @see {@link https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object} */ -export type SecuritySchemeType = "apiKey" | "http" | "oauth2" | "openIdConnect"; +export type SecuritySchemeType = 'apiKey' | 'http' | 'oauth2' | 'openIdConnect' /** * Defines an API key security scheme that can be used by the operations. The @@ -1392,21 +1392,21 @@ export interface ApiKeySecuritySchemeObject extends SpecificationExtensions { /** * REQUIRED. The type of the security scheme. */ - type: "apiKey"; + type: 'apiKey' /** * A description for security scheme. CommonMark syntax MAY be used for rich * text representation. */ - description?: string; + description?: string /** * REQUIRED. The name of the header, query or cookie parameter to be used. */ - name: string; + name: string /** * REQUIRED. The location of the API key. Valid values are `"query"`, * `"header"`, or `"cookie"`. */ - in: "cookie" | "header" | "query"; + in: 'cookie' | 'header' | 'query' } /** @@ -1419,26 +1419,26 @@ export interface HttpSecuritySchemeObject extends SpecificationExtensions { /** * REQUIRED. The type of the security scheme. */ - type: "http"; + type: 'http' /** * A description for security scheme. CommonMark syntax MAY be used for rich * text representation. */ - description?: string; + 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; + 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; + bearerFormat?: string } /** @@ -1452,17 +1452,17 @@ export interface OAuth2SecuritySchemeObject extends SpecificationExtensions { /** * REQUIRED. The type of the security scheme. */ - type: "oauth2"; + type: 'oauth2' /** * A description for security scheme. CommonMark syntax MAY be used for rich * text representation. */ - description?: string; + description?: string /** * REQUIRED. An object containing configuration information for the flow * types supported. */ - flows: OAuthFlowsObject; + flows: OAuthFlowsObject } /** @@ -1475,17 +1475,17 @@ export interface OpenIdConnectSecuritySchemeObject extends SpecificationExtensio /** * REQUIRED. The type of the security scheme. */ - type: "openIdConnect"; + type: 'openIdConnect' /** * A description for security scheme. CommonMark syntax MAY be used for rich * text representation. */ - description?: string; + description?: string /** * REQUIRED. Well-known URL to discover the OpenID Connect Discovery * provider metadata. */ - openIdConnectUrl: string; + openIdConnectUrl: string } /** @@ -1501,11 +1501,11 @@ export interface OpenIdConnectSecuritySchemeObject extends SpecificationExtensio * * @see {@link https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object} */ -export type SecuritySchemeObject = - | ApiKeySecuritySchemeObject - | HttpSecuritySchemeObject - | OAuth2SecuritySchemeObject - | OpenIdConnectSecuritySchemeObject; +export type SecuritySchemeObject + = | ApiKeySecuritySchemeObject + | HttpSecuritySchemeObject + | OAuth2SecuritySchemeObject + | OpenIdConnectSecuritySchemeObject /** * Allows configuration of the supported OAuth Flows. @@ -1516,21 +1516,21 @@ export interface OAuthFlowsObject extends SpecificationExtensions { /** * Configuration for the OAuth Implicit flow. */ - implicit?: ImplicitOAuthFlowObject; + implicit?: ImplicitOAuthFlowObject /** * Configuration for the OAuth Resource Owner Password flow. */ - password?: PasswordOAuthFlowObject; + password?: PasswordOAuthFlowObject /** * Configuration for the OAuth Client Credentials flow. Previously called * `application` in OpenAPI 2.0. */ - clientCredentials?: ClientCredentialsOAuthFlowObject; + clientCredentials?: ClientCredentialsOAuthFlowObject /** * Configuration for the OAuth Authorization Code flow. Previously called * `accessCode` in OpenAPI 2.0. */ - authorizationCode?: AuthorizationCodeOAuthFlowObject; + authorizationCode?: AuthorizationCodeOAuthFlowObject } /** @@ -1543,13 +1543,13 @@ 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; + 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; + scopes: Record } /** @@ -1562,7 +1562,7 @@ 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; + authorizationUrl: string } /** @@ -1575,7 +1575,7 @@ 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; + tokenUrl: string } /** @@ -1588,7 +1588,7 @@ 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; + tokenUrl: string } /** @@ -1601,12 +1601,12 @@ 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; + 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; + tokenUrl: string } /** @@ -1614,11 +1614,11 @@ export interface AuthorizationCodeOAuthFlowObject extends OAuthFlowObjectBase { * * @see {@link https://spec.openapis.org/oas/v3.0.4.html#oauth-flow-object} */ -export type OAuthFlowObject = - | AuthorizationCodeOAuthFlowObject - | ClientCredentialsOAuthFlowObject - | ImplicitOAuthFlowObject - | PasswordOAuthFlowObject; +export type OAuthFlowObject + = | AuthorizationCodeOAuthFlowObject + | ClientCredentialsOAuthFlowObject + | ImplicitOAuthFlowObject + | PasswordOAuthFlowObject /** * Lists the required security schemes to execute this operation or the API as @@ -1642,5 +1642,5 @@ export interface SecurityRequirementObject { * authorization does not require a specified scope. For other security * scheme types, the array MUST be empty. */ - [name: string]: string[]; + [name: string]: string[] } diff --git a/packages/types/src/v3.1.test-d.ts b/packages/types/src/v3.1.test-d.ts index b2108f9..412777c 100644 --- a/packages/types/src/v3.1.test-d.ts +++ b/packages/types/src/v3.1.test-d.ts @@ -1,175 +1,174 @@ -import type { OpenAPIObject, PathItemObject, SchemaObject } from "./v3.1"; +import type { OpenAPIObject, PathItemObject, SchemaObject } from './v3.1' export const webhooksOnly = { components: { pathItems: { petWebhook: { - post: { responses: { "200": { description: "OK" } } }, + post: { responses: { 200: { description: 'OK' } } }, }, }, schemas: { Animal: { discriminator: { - mapping: { pet: "Pet" }, - propertyName: "petType", - "x-extension": "allowed in 3.1", + 'mapping': { pet: 'Pet' }, + 'propertyName': 'petType', + 'x-extension': 'allowed in 3.1', }, oneOf: [ { - $ref: "#/components/schemas/Pet", - description: "sibling keywords allowed", + $ref: '#/components/schemas/Pet', + description: 'sibling keywords allowed', }, - { type: "string" }, + { type: 'string' }, ], }, Pet: { - $defs: { + '$defs': { item: { - $dynamicAnchor: "item", - type: "string", + $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: { + '$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", + 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"] }, + else: { required: ['bField'] }, + if: { properties: { kind: { const: 'a' } } }, + then: { required: ['aField'] }, }, config: { - additionalProperties: { type: "string" }, - dependentRequired: { credit: ["billing"] }, + additionalProperties: { type: 'string' }, + dependentRequired: { credit: ['billing'] }, dependentSchemas: { - credit: { required: ["billing"] }, + credit: { required: ['billing'] }, }, - propertyNames: { pattern: "^[a-z]+$" }, - type: "object", + propertyNames: { pattern: '^[a-z]+$' }, + type: 'object', unevaluatedProperties: false, }, coordinates: { - contains: { type: "number" }, + contains: { type: 'number' }, items: false, minContains: 1, - prefixItems: [{ type: "number" }, { type: "number" }], - type: "array", + prefixItems: [{ type: 'number' }, { type: 'number' }], + type: 'array', }, - dynamic: { $dynamicRef: "#item" }, - id: { format: "int64", type: "integer" }, - name: { type: "string" }, + dynamic: { $dynamicRef: '#item' }, + id: { format: 'int64', type: 'integer' }, + name: { type: 'string' }, nothing: false, - nullable: { type: "null" }, + nullable: { type: 'null' }, score: { exclusiveMaximum: 10, exclusiveMinimum: 0, - type: "number", + type: 'number', }, - status: { const: "available" }, - tag: { type: ["string", "null"] }, + status: { const: 'available' }, + tag: { type: ['string', 'null'] }, }, - required: ["id", "name"], - type: "object", - "unprefixed-extension": { anything: "goes" }, - "x-prefixed-extension": true, + 'required': ['id', 'name'], + 'type': 'object', + 'unprefixed-extension': { anything: 'goes' }, + 'x-prefixed-extension': true, }, }, securitySchemes: { - mtls: { description: "Client certificate", type: "mutualTLS" }, + 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", + 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"] }], + 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" }, + 'application/json': { + schema: { $ref: '#/components/schemas/Pet' }, }, }, - description: "Information about a new pet", + description: 'Information about a new pet', }, responses: { - "200": { description: "Webhook processed" }, + 200: { description: 'Webhook processed' }, }, }, }, - referenced: { $ref: "#/components/pathItems/petWebhook" }, + referenced: { $ref: '#/components/pathItems/petWebhook' }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject export const referenceOverrides = { - info: { title: "API", version: "1.0.0" }, - openapi: "3.1.0", + info: { title: 'API', version: '1.0.0' }, + openapi: '3.1.0', paths: { - "/pets": { + '/pets': { get: { // `responses` is no longer REQUIRED in 3.1. parameters: [ { - $ref: "#/components/parameters/limit", - description: "Overridden description", - summary: "Overridden summary", + $ref: '#/components/parameters/limit', + description: 'Overridden description', + summary: 'Overridden summary', }, ], }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject export const wrongVersion = { - info: { title: "API", version: "1.0.0" }, + 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", + openapi: '3.0.4', paths: {}, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject // Boolean schemas are valid Schema Objects in OpenAPI 3.1. -export const booleanSchema = true satisfies SchemaObject; +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; + 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; + query: { responses: { 200: { description: 'OK' } } }, +} satisfies PathItemObject export const noAdditionalOperations = { // @ts-expect-error: `additionalOperations` does not exist before OpenAPI 3.2. additionalOperations: {}, -} satisfies PathItemObject; +} satisfies PathItemObject export const typedSchema = { - const: "fixed", - default: "fixed", - examples: ["fixed"], - type: "string", -} satisfies SchemaObject; + 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; + type: 'string', +} satisfies SchemaObject diff --git a/packages/types/src/v3.1.ts b/packages/types/src/v3.1.ts index 59f94e5..7190b68 100644 --- a/packages/types/src/v3.1.ts +++ b/packages/types/src/v3.1.ts @@ -14,21 +14,21 @@ */ import type { + ApiKeySecuritySchemeObject, ContactObject, ExampleObject, ExternalDocumentationObject, + HttpSecuritySchemeObject, LinkObject, + OAuth2SecuritySchemeObject, + OpenIdConnectSecuritySchemeObject, ParameterLocation, ParameterStyle, QueryParameterStyle, SpecificationExtensions, TagObject, XMLObject, - ApiKeySecuritySchemeObject, - HttpSecuritySchemeObject, - OAuth2SecuritySchemeObject, - OpenIdConnectSecuritySchemeObject, -} from "./v3.0"; +} from './v3.0' export type { ApiKeySecuritySchemeObject, @@ -52,7 +52,7 @@ export type { SpecificationExtensions, TagObject, XMLObject, -} from "./v3.0"; +} from './v3.0' /** * An object representing a Server. @@ -67,17 +67,17 @@ export interface ServerObject extends SpecificationExtensions { * 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; + url: string /** * An optional string describing the host designated by the URL. CommonMark * syntax MAY be used for rich text representation. */ - description?: string; + 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; + variables?: Record } /** @@ -91,7 +91,7 @@ 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[]; + 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 @@ -99,12 +99,12 @@ export interface ServerVariableObject extends SpecificationExtensions { * different from the Schema Object's `default` keyword, which documents the * receiver's behavior rather than inserting the value into the data. */ - default: string; + default: string /** * An optional description for the server variable. CommonMark syntax MAY be * used for rich text representation. */ - description?: string; + description?: string } /** @@ -122,28 +122,28 @@ export interface OpenAPIObject extends SpecificationExtensions { * be used by tooling to interpret the OpenAPI Document. This is not related * to the API `info.version` string. */ - openapi: `3.1.${string}`; + openapi: `3.1.${string}` /** * REQUIRED. Provides metadata about the API. The metadata MAY be used by * tooling as required. */ - info: InfoObject; + 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; + 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[]; + servers?: ServerObject[] /** * The available paths and operations for the API. */ - paths?: PathsObject; + 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 @@ -153,11 +153,11 @@ export interface OpenAPIObject extends SpecificationExtensions { * referenced) Path Item Object describes a request that may be initiated by * the API provider and the expected responses. */ - webhooks?: Record; + webhooks?: Record /** * An element to hold various Objects for the OpenAPI Description. */ - components?: ComponentsObject; + components?: ComponentsObject /** * A declaration of which security mechanisms can be used across the API. * The list of values includes alternative Security Requirement Objects; @@ -166,7 +166,7 @@ export interface OpenAPIObject extends SpecificationExtensions { * to being empty or absent. To make security explicitly optional, an empty * security requirement (`{}`) can be included in the array. */ - security?: SecurityRequirementObject[]; + 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 @@ -174,11 +174,11 @@ export interface OpenAPIObject extends SpecificationExtensions { * declared; undeclared tags MAY be organized randomly or based on the * tools' logic. Each tag name in the list MUST be unique. */ - tags?: TagObject[]; + tags?: TagObject[] /** * Additional external documentation. */ - externalDocs?: ExternalDocumentationObject; + externalDocs?: ExternalDocumentationObject } /** @@ -192,35 +192,35 @@ export interface InfoObject extends SpecificationExtensions { /** * REQUIRED. The title of the API. */ - title: string; + title: string /** * A short summary of the API. */ - summary?: string; + summary?: string /** * A description of the API. CommonMark syntax MAY be used for rich text * representation. */ - description?: string; + description?: string /** * A URI for the Terms of Service for the API. This MUST be in the form of a * URI. */ - termsOfService?: string; + termsOfService?: string /** * The contact information for the exposed API. */ - contact?: ContactObject; + contact?: ContactObject /** * The license information for the exposed API. */ - license?: LicenseObject; + 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; + version: string } /** @@ -232,17 +232,17 @@ export interface LicenseObject extends SpecificationExtensions { /** * REQUIRED. The license name used for the API. */ - name: string; + name: string /** * An SPDX license expression for the API. The `identifier` field is * mutually exclusive of the `url` field. */ - identifier?: string; + 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; + url?: string } /** @@ -261,45 +261,45 @@ export interface ComponentsObject extends SpecificationExtensions { * unioned with the Reference Object: in OpenAPI 3.1, `$ref` is a JSON * Schema keyword of the Schema Object itself. */ - schemas?: Record; + schemas?: Record /** * An object to hold reusable Response Objects. */ - responses?: Record; + responses?: Record /** * An object to hold reusable Parameter Objects. */ - parameters?: Record; + parameters?: Record /** * An object to hold reusable Example Objects. */ - examples?: Record; + examples?: Record /** * An object to hold reusable Request Body Objects. */ - requestBodies?: Record; + requestBodies?: Record /** * An object to hold reusable Header Objects. */ - headers?: Record; + headers?: Record /** * An object to hold reusable Security Scheme Objects. */ - securitySchemes?: Record; + securitySchemes?: Record /** * An object to hold reusable Link Objects. */ - links?: Record; + links?: Record /** * An object to hold reusable Callback Objects. */ - callbacks?: Record; + 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; + pathItems?: Record } /** @@ -321,7 +321,7 @@ export interface PathsObject extends SpecificationExtensions { * 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; + [path: `/${string}`]: PathItemObject } /** @@ -342,55 +342,55 @@ export interface PathItemObject extends SpecificationExtensions { * in future versions of this specification to bring it into closer * alignment with the behavior of the Reference Object. */ - $ref?: string; + $ref?: string /** * An optional string summary, intended to apply to all operations in this * path. */ - summary?: string; + 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; + description?: string /** * A definition of a GET operation on this path. */ - get?: OperationObject; + get?: OperationObject /** * A definition of a PUT operation on this path. */ - put?: OperationObject; + put?: OperationObject /** * A definition of a POST operation on this path. */ - post?: OperationObject; + post?: OperationObject /** * A definition of a DELETE operation on this path. */ - delete?: OperationObject; + delete?: OperationObject /** * A definition of an OPTIONS operation on this path. */ - options?: OperationObject; + options?: OperationObject /** * A definition of a HEAD operation on this path. */ - head?: OperationObject; + head?: OperationObject /** * A definition of a PATCH operation on this path. */ - patch?: OperationObject; + patch?: OperationObject /** * A definition of a TRACE operation on this path. */ - trace?: OperationObject; + 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[]; + 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 @@ -399,7 +399,7 @@ export interface PathItemObject extends SpecificationExtensions { * location. The list can use the Reference Object to link to parameters * defined in the Components Object's `parameters`. */ - parameters?: (ParameterObject | ReferenceObject)[]; + parameters?: (ParameterObject | ReferenceObject)[] } /** @@ -412,20 +412,20 @@ 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[]; + tags?: string[] /** * A short summary of what the operation does. */ - summary?: string; + summary?: string /** * A verbose explanation of the operation behavior. CommonMark syntax MAY be * used for rich text representation. */ - description?: string; + description?: string /** * Additional external documentation for this operation. */ - externalDocs?: ExternalDocumentationObject; + 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 @@ -433,7 +433,7 @@ export interface OperationObject extends SpecificationExtensions { * identify an operation, therefore, it is RECOMMENDED to follow common * programming naming conventions. */ - operationId?: string; + 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 @@ -442,7 +442,7 @@ export interface OperationObject extends SpecificationExtensions { * location. The list can use the Reference Object to link to parameters * defined in the Components Object's `parameters`. */ - parameters?: (ParameterObject | ReferenceObject)[]; + 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 @@ -451,26 +451,26 @@ export interface OperationObject extends SpecificationExtensions { * permitted but does not have well-defined semantics and SHOULD be avoided * if possible. */ - requestBody?: RequestBodyObject | ReferenceObject; + requestBody?: RequestBodyObject | ReferenceObject /** * The list of possible responses as they are returned from executing this * operation. */ - responses?: ResponsesObject; + 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; + callbacks?: Record /** * Declares this operation to be deprecated. Consumers SHOULD refrain from * usage of the declared operation. * * @default false */ - deprecated?: boolean; + deprecated?: boolean /** * A declaration of which security mechanisms can be used for this * operation. Only one of the Security Requirement Objects needs to be @@ -479,13 +479,13 @@ export interface OperationObject extends SpecificationExtensions { * overrides any declared top-level `security`. To remove a top-level * security declaration, an empty array can be used. */ - security?: SecurityRequirementObject[]; + 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[]; + servers?: ServerObject[] } /** @@ -511,17 +511,17 @@ export interface ParameterObject extends SpecificationExtensions { * - For all other cases, the `name` corresponds to the parameter name used * by the `in` field. */ - name: string; + name: string /** * REQUIRED. The location of the parameter. Possible values are `"query"`, * `"header"`, `"path"` or `"cookie"`. */ - in: ParameterLocation; + 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; + description?: string /** * Determines whether this parameter is mandatory. If the parameter location * is `"path"`, this field is REQUIRED and its value MUST be `true`. @@ -529,14 +529,14 @@ export interface ParameterObject extends SpecificationExtensions { * * @default false */ - required?: boolean; + required?: boolean /** * Specifies that a parameter is deprecated and SHOULD be transitioned out * of usage. * * @default false */ - deprecated?: boolean; + 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 @@ -547,14 +547,14 @@ export interface ParameterObject extends SpecificationExtensions { * * @default false */ - allowEmptyValue?: boolean; + 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; + 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 @@ -563,7 +563,7 @@ export interface ParameterObject extends SpecificationExtensions { * value is `false`. Note that despite `false` being the default for * `deepObject`, the combination of `false` with `deepObject` is undefined. */ - explode?: boolean; + explode?: boolean /** * When true, parameter values are serialized using reserved expansion, as * defined by RFC6570, which allows RFC3986's reserved character set, as @@ -576,11 +576,11 @@ export interface ParameterObject extends SpecificationExtensions { * * @default false */ - allowReserved?: boolean; + allowReserved?: boolean /** * The schema defining the type used for the parameter. */ - schema?: SchemaObject; + schema?: SchemaObject /** * Example of the parameter's potential value. The example SHOULD match the * specified schema and follow the prescribed serialization strategy for the @@ -588,7 +588,7 @@ export interface ParameterObject extends SpecificationExtensions { * field. Furthermore, if referencing a `schema` that contains an example, * the `example` value SHALL override the example provided by the schema. */ - example?: unknown; + 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 @@ -596,13 +596,13 @@ export interface ParameterObject extends SpecificationExtensions { * Furthermore, if referencing a `schema` that contains an example, the * `examples` value SHALL override the example provided by the schema. */ - examples?: Record; + 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; + content?: Record } /** @@ -615,7 +615,7 @@ 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; + 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 @@ -623,13 +623,13 @@ export interface RequestBodyObject extends SpecificationExtensions { * `"text/plain"` overrides `"text/*"`. The map SHOULD have at least one * entry; if it does not, the behavior is implementation-defined. */ - content: Record; + content: Record /** * Determines if the request body is required in the request. * * @default false */ - required?: boolean; + required?: boolean } /** @@ -646,7 +646,7 @@ export interface MediaTypeObject extends SpecificationExtensions { * `contentEncoding` and `contentMediaType` keywords rather than the 3.0 * `format` values `byte` and `binary`. */ - schema?: SchemaObject; + 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 @@ -654,7 +654,7 @@ export interface MediaTypeObject extends SpecificationExtensions { * field. Furthermore, if referencing a `schema` that contains an example, * the `example` value SHALL override the example provided by the schema. */ - example?: unknown; + 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 @@ -662,7 +662,7 @@ export interface MediaTypeObject extends SpecificationExtensions { * field. Furthermore, if referencing a `schema` that contains an example, * the `examples` value SHALL override the example provided by the schema. */ - examples?: Record; + 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 @@ -671,7 +671,7 @@ export interface MediaTypeObject extends SpecificationExtensions { * no Encoding Object is provided for a property, the behavior is determined * by the default values documented for the Encoding Object. */ - encoding?: Record; + encoding?: Record } /** @@ -695,14 +695,14 @@ export interface EncodingObject extends SpecificationExtensions { * `text/plain`; for `object` – `application/json`; for `array` – according * to the `type` of the `items` schema. */ - contentType?: string; + 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; + 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 @@ -716,7 +716,7 @@ export interface EncodingObject extends SpecificationExtensions { * is explicitly defined, then the value of `contentType` (implicit or * explicit) SHALL be ignored. */ - style?: QueryParameterStyle; + 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 @@ -727,7 +727,7 @@ export interface EncodingObject extends SpecificationExtensions { * If a value is explicitly defined, then the value of `contentType` * (implicit or explicit) SHALL be ignored. */ - explode?: boolean; + explode?: boolean /** * When true, parameter values are serialized using reserved expansion, as * defined by RFC6570, which allows RFC3986's reserved character set, as @@ -743,7 +743,7 @@ export interface EncodingObject extends SpecificationExtensions { * * @default false */ - allowReserved?: boolean; + allowReserved?: boolean } /** @@ -761,7 +761,7 @@ 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; + 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 @@ -776,7 +776,7 @@ export interface ResponsesObject extends SpecificationExtensions { */ [statusCode: `${1 | 2 | 3 | 4 | 5}${string}`]: | ResponseObject - | ReferenceObject; + | ReferenceObject } /** @@ -790,26 +790,26 @@ export interface ResponseObject extends SpecificationExtensions { * REQUIRED. A description of the response. CommonMark syntax MAY be used * for rich text representation. */ - description: string; + 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; + 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; + 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; + links?: Record } /** @@ -833,7 +833,7 @@ export interface CallbackObject { * callback request (e.g. `$request.body#/url`); expressions can be embedded * into string values by surrounding them with `{}` curly braces. */ - [expression: string]: PathItemObject; + [expression: string]: PathItemObject } /** @@ -859,27 +859,27 @@ 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; + description?: string /** * Determines whether this header is mandatory. * * @default false */ - required?: boolean; + required?: boolean /** * Specifies that the header is deprecated and SHOULD be transitioned out of * usage. * * @default false */ - deprecated?: boolean; + deprecated?: boolean /** * Describes how the header value will be serialized. The default (and only * legal value for headers) is `"simple"`. * * @default "simple" */ - style?: "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 @@ -888,11 +888,11 @@ export interface HeaderObject extends SpecificationExtensions { * * @default false */ - explode?: boolean; + explode?: boolean /** * The schema defining the type used for the header. */ - schema?: SchemaObject; + schema?: SchemaObject /** * Example of the header's potential value. The example SHOULD match the * specified schema and follow the prescribed serialization strategy for the @@ -900,7 +900,7 @@ export interface HeaderObject extends SpecificationExtensions { * field. Furthermore, if referencing a `schema` that contains an example, * the `example` value SHALL override the example provided by the schema. */ - example?: unknown; + 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 @@ -908,12 +908,12 @@ export interface HeaderObject extends SpecificationExtensions { * Furthermore, if referencing a `schema` that contains an example, the * `examples` value SHALL override the example provided by the schema. */ - examples?: Record; + 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; + content?: Record } /** @@ -931,20 +931,20 @@ export interface ReferenceObject { /** * REQUIRED. The reference identifier. This MUST be in the form of a URI. */ - $ref: string; + $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; + 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; + description?: string } /** @@ -954,14 +954,14 @@ export interface ReferenceObject { * * @see {@link https://spec.openapis.org/oas/v3.1.2.html#data-types} */ -export type SchemaObjectType = - | "array" - | "boolean" - | "integer" - | "null" - | "number" - | "object" - | "string"; +export type SchemaObjectType + = | 'array' + | 'boolean' + | 'integer' + | 'null' + | 'number' + | 'object' + | 'string' /** * The object form of the Schema Object: every JSON Schema Draft 2020-12 @@ -985,7 +985,7 @@ export interface SchemaObjectFields { * 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 + [keyword: string]: unknown // JSON Schema Core vocabulary @@ -997,49 +997,49 @@ export interface SchemaObjectFields { * 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; + $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; + $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; + $ref?: string /** * A plain-name fragment identifier for the enclosing schema, usable as a * `$ref` target. */ - $anchor?: string; + $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; + $dynamicRef?: string /** * A plain-name fragment identifier that is a candidate target for * `$dynamicRef` resolution. */ - $dynamicAnchor?: string; + $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; + $vocabulary?: Record /** * Reusable subschema definitions, addressable via `$ref`. */ - $defs?: Record; + $defs?: Record /** * A comment for schema maintainers, carrying no validation semantics. */ - $comment?: string; + $comment?: string // JSON Schema Applicator vocabulary @@ -1048,76 +1048,76 @@ export interface SchemaObjectFields { * subschemas in this array. `allOf` offers model composition; with * `discriminator`, polymorphism. */ - allOf?: SchemaObject[]; + allOf?: SchemaObject[] /** * An instance is valid against this keyword if it is valid against exactly * one subschema in this array. */ - oneOf?: SchemaObject[]; + oneOf?: SchemaObject[] /** * An instance is valid against this keyword if it is valid against at least * one subschema in this array. */ - anyOf?: SchemaObject[]; + anyOf?: SchemaObject[] /** * An instance is valid against this keyword if it is not valid against the * given subschema. */ - not?: SchemaObject; + not?: SchemaObject /** * If the instance validates against this subschema, it must also validate * against `then` (if present); otherwise against `else` (if present). */ - if?: SchemaObject; + if?: SchemaObject /** * Applied when the instance validates against `if`. */ - then?: SchemaObject; + then?: SchemaObject /** * Applied when the instance fails validation against `if`. */ - else?: SchemaObject; + else?: SchemaObject /** * A map of property names to subschemas that the whole instance must * validate against when the named property is present. */ - dependentSchemas?: Record; + dependentSchemas?: Record /** * An array of subschemas applied positionally to the first items of an * array instance (tuple validation). */ - prefixItems?: SchemaObject[]; + 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; + items?: SchemaObject /** * An array instance is valid if at least one item (subject to * `minContains`/`maxContains`) validates against this subschema. */ - contains?: SchemaObject; + contains?: SchemaObject /** * A map of property names to subschemas validating the corresponding * property values of an object instance. */ - properties?: Record; + properties?: Record /** * A map of ECMA-262 regular expressions to subschemas validating the values * of all properties whose names match each expression. */ - patternProperties?: Record; + patternProperties?: Record /** * A subschema applied to the values of all object properties not covered by * `properties` or `patternProperties`. */ - additionalProperties?: SchemaObject; + additionalProperties?: SchemaObject /** * A subschema every property name of an object instance must validate * against. */ - propertyNames?: SchemaObject; + propertyNames?: SchemaObject // JSON Schema Unevaluated vocabulary @@ -1125,13 +1125,13 @@ export interface SchemaObjectFields { * A subschema applied to array items not successfully evaluated by any * `prefixItems`, `items`, or `contains` in this schema or its subschemas. */ - unevaluatedItems?: SchemaObject; + 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; + unevaluatedProperties?: SchemaObject // JSON Schema Validation vocabulary @@ -1141,134 +1141,134 @@ export interface SchemaObjectFields { * 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[]; + type?: SchemaObjectType | SchemaObjectType[] /** * The instance is valid only if its value equals one of the elements in * this array. */ - enum?: T[]; + enum?: T[] /** * The instance is valid only if its value equals this value. */ - const?: T; + 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; + multipleOf?: number /** * An inclusive upper limit for a numeric instance. */ - maximum?: number; + 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; + exclusiveMaximum?: number /** * An inclusive lower limit for a numeric instance. */ - minimum?: number; + 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; + 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; + maxLength?: number /** * The minimum length of a string instance. MUST be a non-negative integer. * * @default 0 */ - minLength?: number; + minLength?: number /** * A string instance is valid if the ECMA-262 regular expression matches it. */ - pattern?: string; + pattern?: string /** * The maximum number of items in an array instance. MUST be a non-negative * integer. */ - maxItems?: number; + maxItems?: number /** * The minimum number of items in an array instance. MUST be a non-negative * integer. * * @default 0 */ - minItems?: number; + minItems?: number /** * If `true`, all items in an array instance must be unique. * * @default false */ - uniqueItems?: boolean; + uniqueItems?: boolean /** * The maximum number of items matching `contains`. MUST be a non-negative * integer. */ - maxContains?: number; + maxContains?: number /** * The minimum number of items matching `contains`. MUST be a non-negative * integer. * * @default 1 */ - minContains?: number; + minContains?: number /** * The maximum number of properties of an object instance. MUST be a * non-negative integer. */ - maxProperties?: number; + maxProperties?: number /** * The minimum number of properties of an object instance. MUST be a * non-negative integer. * * @default 0 */ - minProperties?: number; + minProperties?: number /** * Property names that must be present in an object instance. Elements MUST * be unique. */ - required?: string[]; + 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; + dependentRequired?: Record // JSON Schema Meta-Data vocabulary /** * A short title for the schema. */ - title?: string; + title?: string /** * A description of the schema. CommonMark syntax MAY be used for rich text * representation. */ - description?: string; + 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; + default?: T /** * Indicates that applications SHOULD refrain from using the described * value(s). * * @default false */ - deprecated?: boolean; + 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 @@ -1278,20 +1278,20 @@ export interface SchemaObjectFields { * * @default false */ - readOnly?: boolean; + readOnly?: boolean /** * Indicates the value may be sent in a request but SHOULD NOT be included * in a response. * * @default false */ - writeOnly?: boolean; + 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[]; + examples?: T[] // JSON Schema Format-Annotation vocabulary @@ -1304,7 +1304,7 @@ export interface SchemaObjectFields { * recognize a format MAY default back to `type` alone. Support for any * format registered in the OpenAPI Format Registry is strictly OPTIONAL. */ - format?: string; + format?: string // JSON Schema Content vocabulary @@ -1315,19 +1315,19 @@ export interface SchemaObjectFields { * by omitting `type` and `contentEncoding` and using `contentMediaType`. * Treated as an annotation rather than validated directly. */ - contentEncoding?: string; + 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; + contentMediaType?: string /** * A subschema describing the structure of the string's decoded content. * Treated as an annotation rather than validated directly. */ - contentSchema?: SchemaObject; + contentSchema?: SchemaObject // OAS base vocabulary @@ -1338,17 +1338,17 @@ export interface SchemaObjectFields { * Legal only when using one of the composite keywords `oneOf`, `anyOf`, * `allOf`; MUST NOT change the validation outcome. */ - discriminator?: DiscriminatorObject; + 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; + xml?: XMLObject /** * Additional external documentation for this schema. */ - externalDocs?: ExternalDocumentationObject; + 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 @@ -1359,7 +1359,7 @@ export interface SchemaObjectFields { * Schema `examples` keyword. Use of `example` is discouraged, and later * versions of this specification may remove it. */ - example?: T; + example?: T } /** @@ -1383,7 +1383,7 @@ export interface SchemaObjectFields { * Defaults to `unknown`. * @see {@link https://spec.openapis.org/oas/v3.1.2.html#schema-object} */ -export type SchemaObject = boolean | SchemaObjectFields; +export type SchemaObject = boolean | SchemaObjectFields /** * When request bodies or response payloads may be one of a number of @@ -1403,7 +1403,7 @@ export interface DiscriminatorObject extends SpecificationExtensions { * discriminating value. This property SHOULD be required in the payload * schema, as the behavior when the property is absent is undefined. */ - propertyName: string; + 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 @@ -1413,7 +1413,7 @@ export interface DiscriminatorObject extends SpecificationExtensions { * with the `"."` path segment (e.g. `"./foo"`). Mapping keys MUST be string * values. */ - mapping?: Record; + mapping?: Record } /** @@ -1421,12 +1421,12 @@ export interface DiscriminatorObject extends SpecificationExtensions { * * @see {@link https://spec.openapis.org/oas/v3.1.2.html#security-scheme-object} */ -export type SecuritySchemeType = - | "apiKey" - | "http" - | "mutualTLS" - | "oauth2" - | "openIdConnect"; +export type SecuritySchemeType + = | 'apiKey' + | 'http' + | 'mutualTLS' + | 'oauth2' + | 'openIdConnect' /** * Defines a mutual TLS security scheme (use of a client certificate) that can @@ -1438,12 +1438,12 @@ export interface MutualTlsSecuritySchemeObject extends SpecificationExtensions { /** * REQUIRED. The type of the security scheme. */ - type: "mutualTLS"; + type: 'mutualTLS' /** * A description for security scheme. CommonMark syntax MAY be used for rich * text representation. */ - description?: string; + description?: string } /** @@ -1460,12 +1460,12 @@ export interface MutualTlsSecuritySchemeObject extends SpecificationExtensions { * * @see {@link https://spec.openapis.org/oas/v3.1.2.html#security-scheme-object} */ -export type SecuritySchemeObject = - | ApiKeySecuritySchemeObject - | HttpSecuritySchemeObject - | MutualTlsSecuritySchemeObject - | OAuth2SecuritySchemeObject - | OpenIdConnectSecuritySchemeObject; +export type SecuritySchemeObject + = | ApiKeySecuritySchemeObject + | HttpSecuritySchemeObject + | MutualTlsSecuritySchemeObject + | OAuth2SecuritySchemeObject + | OpenIdConnectSecuritySchemeObject /** * Lists the required security schemes to execute this operation or the API as @@ -1491,5 +1491,5 @@ export interface SecurityRequirementObject { * required for the execution, but are not otherwise defined or exchanged * in-band. */ - [name: string]: string[]; + [name: string]: string[] } diff --git a/packages/types/src/v3.2.test-d.ts b/packages/types/src/v3.2.test-d.ts index fb8554e..6e2d3cf 100644 --- a/packages/types/src/v3.2.test-d.ts +++ b/packages/types/src/v3.2.test-d.ts @@ -1,245 +1,245 @@ -import type { MediaTypeObject, OpenAPIObject, SchemaObject } from "./v3.2"; +import type { MediaTypeObject, OpenAPIObject, SchemaObject } from './v3.2' export const streamingApi = { - $self: "https://example.com/openapi", + $self: 'https://example.com/openapi', components: { examples: { external: { - dataValue: { kind: "cat" }, - externalValue: "https://example.com/examples/cat.bin", + dataValue: { kind: 'cat' }, + externalValue: 'https://example.com/examples/cat.bin', }, serialized: { - dataValue: { kind: "cat" }, - serializedValue: "kind=cat", - summary: "A serialized example", + dataValue: { kind: 'cat' }, + serializedValue: 'kind=cat', + summary: 'A serialized example', }, }, mediaTypes: { EventStream: { - itemSchema: { $ref: "#/components/schemas/Event" }, + itemSchema: { $ref: '#/components/schemas/Event' }, }, - Referenced: { $ref: "#/components/mediaTypes/EventStream" }, + Referenced: { $ref: '#/components/mediaTypes/EventStream' }, }, responses: { Uploaded: { - description: "The upload was accepted", - summary: "Upload accepted", + description: 'The upload was accepted', + summary: 'Upload accepted', }, }, schemas: { - Cat: { type: "object" }, + Cat: { type: 'object' }, Event: { properties: { animal: { discriminator: { - defaultMapping: "Cat", - mapping: { cat: "Cat" }, - propertyName: "kind", + defaultMapping: 'Cat', + mapping: { cat: 'Cat' }, + propertyName: 'kind', }, - oneOf: [{ $ref: "#/components/schemas/Cat" }, { type: "object" }], + 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 } }, + body: { type: 'string', xml: { nodeType: 'cdata' } }, + id: { type: 'string', xml: { nodeType: 'attribute' } }, + legacyAttribute: { type: 'string', xml: { attribute: true } }, legacyWrapped: { - items: { type: "string" }, - type: "array", + items: { type: 'string' }, + type: 'array', xml: { wrapped: true }, }, - note: { type: "string", xml: { nodeType: "text" } }, + note: { type: 'string', xml: { nodeType: 'text' } }, }, - type: "object", + type: 'object', xml: { - name: "payload", - namespace: "https://example.com/ns", - nodeType: "element", - prefix: "ex", + name: 'payload', + namespace: 'https://example.com/ns', + nodeType: 'element', + prefix: 'ex', }, }, }, - type: "object", + type: 'object', }, - EventQuery: { type: "object" }, + EventQuery: { type: 'object' }, }, securitySchemes: { device: { deprecated: false, flows: { authorizationCode: { - authorizationUrl: "https://auth.example.com/authorize", + authorizationUrl: 'https://auth.example.com/authorize', scopes: {}, - tokenUrl: "https://auth.example.com/token", + tokenUrl: 'https://auth.example.com/token', }, deviceAuthorization: { - deviceAuthorizationUrl: "https://auth.example.com/device", - scopes: { "read:events": "read events" }, - tokenUrl: "https://auth.example.com/token", + 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", + 'https://auth.example.com/.well-known/oauth-authorization-server', + type: 'oauth2', }, legacy: { deprecated: true, - scheme: "basic", - type: "http", + scheme: 'basic', + type: 'http', }, }, }, - info: { title: "Streaming API", version: "2.0.0" }, - openapi: "3.2.0", + info: { title: 'Streaming API', version: '2.0.0' }, + openapi: '3.2.0', paths: { - "/events": { + '/events': { additionalOperations: { COPY: { - responses: { "204": {} }, - summary: "Copy the event stream configuration", + responses: { 204: {} }, + summary: 'Copy the event stream configuration', }, }, get: { parameters: [ { content: { - "application/x-www-form-urlencoded": { + 'application/x-www-form-urlencoded': { schema: { - properties: { kind: { type: "string" } }, - type: "object", + properties: { kind: { type: 'string' } }, + type: 'object', }, }, }, - in: "querystring", - name: "filter", + in: 'querystring', + name: 'filter', }, { explode: false, - in: "cookie", - name: "session", - schema: { type: "string" }, - style: "cookie", + in: 'cookie', + name: 'session', + schema: { type: 'string' }, + style: 'cookie', }, ], responses: { - "200": { + 200: { content: { - "text/event-stream": { + 'text/event-stream': { itemSchema: { properties: { data: { - contentMediaType: "application/json", - contentSchema: { $ref: "#/components/schemas/Event" }, - type: "string", + contentMediaType: 'application/json', + contentSchema: { $ref: '#/components/schemas/Event' }, + type: 'string', }, - event: { type: "string" }, - retry: { type: "integer" }, + event: { type: 'string' }, + retry: { type: 'integer' }, }, - type: "object", + type: 'object', }, }, }, - summary: "Event stream", + summary: 'Event stream', }, }, - summary: "Subscribe to events", + summary: 'Subscribe to events', }, query: { requestBody: { content: { - "application/json": { - schema: { $ref: "#/components/schemas/EventQuery" }, + 'application/json': { + schema: { $ref: '#/components/schemas/EventQuery' }, }, }, }, responses: { - "200": { description: "Query results" }, + 200: { description: 'Query results' }, }, - summary: "Complex event query using the QUERY method", + summary: 'Complex event query using the QUERY method', }, }, - "/uploads": { + '/uploads': { post: { requestBody: { content: { - "application/x-www-form-urlencoded": { + 'application/x-www-form-urlencoded': { encoding: { nested: { - contentType: "application/json", + contentType: 'application/json', encoding: { - inner: { explode: true, style: "form" }, + inner: { explode: true, style: 'form' }, }, - itemEncoding: { contentType: "text/plain" }, - prefixEncoding: [{ contentType: "text/plain" }], + itemEncoding: { contentType: 'text/plain' }, + prefixEncoding: [{ contentType: 'text/plain' }], }, }, - schema: { type: "object" }, + schema: { type: 'object' }, }, - "multipart/form-data": { + 'multipart/form-data': { prefixEncoding: [ - { contentType: "text/plain" }, + { contentType: 'text/plain' }, { - contentType: "image/png", + contentType: 'image/png', headers: { - "X-Part-Id": { schema: { type: "string" } }, + 'X-Part-Id': { schema: { type: 'string' } }, }, }, ], schema: { prefixItems: [ - { type: "string" }, - { contentEncoding: "base64", type: "string" }, + { type: 'string' }, + { contentEncoding: 'base64', type: 'string' }, ], - type: "array", + type: 'array', }, }, - "multipart/mixed": { - itemEncoding: { contentType: "application/octet-stream" }, - itemSchema: { contentEncoding: "base64", type: "string" }, + 'multipart/mixed': { + itemEncoding: { contentType: 'application/octet-stream' }, + itemSchema: { contentEncoding: 'base64', type: 'string' }, }, }, }, responses: { - default: { $ref: "#/components/responses/Uploaded" }, + default: { $ref: '#/components/responses/Uploaded' }, }, }, }, }, - security: [{ "./device": ["read:events"] }], + security: [{ './device': ['read:events'] }], servers: [ { - description: "Production server", - name: "production", - url: "https://api.example.com", + description: 'Production server', + name: 'production', + url: 'https://api.example.com', }, ], tags: [ - { kind: "nav", name: "events", summary: "Events" }, - { kind: "badge", name: "streaming", parent: "events" }, + { kind: 'nav', name: 'events', summary: 'Events' }, + { kind: 'badge', name: 'streaming', parent: 'events' }, ], -} satisfies OpenAPIObject; +} satisfies OpenAPIObject export const describedMediaType = { - description: "Streaming sequence of JSON event representations", - itemSchema: { $ref: "#/components/schemas/Event" }, -} satisfies MediaTypeObject; + description: 'Streaming sequence of JSON event representations', + itemSchema: { $ref: '#/components/schemas/Event' }, +} satisfies MediaTypeObject export const wrongVersion = { - info: { title: "API", version: "1.0.0" }, + 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", + openapi: '3.1.2', paths: {}, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject export const typedSchema = { - const: "fixed", - default: "fixed", - examples: ["fixed"], - type: "string", -} satisfies SchemaObject; + 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; + type: 'string', +} satisfies SchemaObject diff --git a/packages/types/src/v3.2.ts b/packages/types/src/v3.2.ts index 6739d47..e07e4c3 100644 --- a/packages/types/src/v3.2.ts +++ b/packages/types/src/v3.2.ts @@ -26,7 +26,7 @@ import type { SchemaObjectType, ServerVariableObject, SpecificationExtensions, -} from "./v3.1"; +} from './v3.1' export type { AuthorizationCodeOAuthFlowObject, @@ -44,7 +44,7 @@ export type { SecuritySchemeType, ServerVariableObject, SpecificationExtensions, -} from "./v3.1"; +} from './v3.1' /** * This is the root object of the OpenAPI Description. @@ -61,7 +61,7 @@ export interface OpenAPIObject extends SpecificationExtensions { * be used by tooling to interpret the OpenAPI document. This is not related * to the API `info.version` string. */ - openapi: `3.2.${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 @@ -70,28 +70,28 @@ export interface OpenAPIObject extends SpecificationExtensions { * relative, it is resolved against the next possible base URI source (e.g. * the retrieval URI). */ - $self?: string; + $self?: string /** * REQUIRED. Provides metadata about the API. The metadata MAY be used by * tooling as required. */ - info: InfoObject; + 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; + 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[]; + servers?: ServerObject[] /** * The available paths and operations for the API. */ - paths?: PathsObject; + 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 @@ -101,11 +101,11 @@ export interface OpenAPIObject extends SpecificationExtensions { * referenced) Path Item Object describes a request that may be initiated by * the API provider and the expected responses. */ - webhooks?: Record; + webhooks?: Record /** * An element to hold various Objects for the OpenAPI Description. */ - components?: ComponentsObject; + components?: ComponentsObject /** * A declaration of which security mechanisms can be used across the API. * The list of values includes alternative Security Requirement Objects; @@ -114,7 +114,7 @@ export interface OpenAPIObject extends SpecificationExtensions { * to being empty or absent. To make security explicitly optional, an empty * security requirement (`{}`) can be included in the array. */ - security?: SecurityRequirementObject[]; + 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 @@ -122,11 +122,11 @@ export interface OpenAPIObject extends SpecificationExtensions { * declared; undeclared tags MAY be organized randomly or based on the * tools' logic. Each tag name in the list MUST be unique. */ - tags?: TagObject[]; + tags?: TagObject[] /** * Additional external documentation. */ - externalDocs?: ExternalDocumentationObject; + externalDocs?: ExternalDocumentationObject } /** @@ -143,21 +143,21 @@ export interface ServerObject extends SpecificationExtensions { * 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; + url: string /** * An optional string describing the host designated by the URL. CommonMark * syntax MAY be used for rich text representation. */ - description?: string; + description?: string /** * An optional unique string to refer to the host designated by the URL. */ - name?: string; + 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; + variables?: Record } /** @@ -176,49 +176,49 @@ export interface ComponentsObject extends SpecificationExtensions { * unioned with the Reference Object: `$ref` is a JSON Schema keyword of the * Schema Object itself. */ - schemas?: Record; + schemas?: Record /** * An object to hold reusable Response Objects. */ - responses?: Record; + responses?: Record /** * An object to hold reusable Parameter Objects. */ - parameters?: Record; + parameters?: Record /** * An object to hold reusable Example Objects. */ - examples?: Record; + examples?: Record /** * An object to hold reusable Request Body Objects. */ - requestBodies?: Record; + requestBodies?: Record /** * An object to hold reusable Header Objects. */ - headers?: Record; + headers?: Record /** * An object to hold reusable Media Type Objects. */ - mediaTypes?: Record; + mediaTypes?: Record /** * An object to hold reusable Security Scheme Objects. */ - securitySchemes?: Record; + securitySchemes?: Record /** * An object to hold reusable Link Objects. */ - links?: Record; + links?: Record /** * An object to hold reusable Callback Objects. */ - callbacks?: Record; + 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; + pathItems?: Record } /** @@ -242,7 +242,7 @@ export interface PathsObject extends SpecificationExtensions { * decide which one to use. Each template expression MUST NOT appear more * than once in a single path template. */ - [path: `/${string}`]: PathItemObject; + [path: `/${string}`]: PathItemObject } /** @@ -263,55 +263,55 @@ export interface PathItemObject extends SpecificationExtensions { * in future versions of this specification to bring it into closer * alignment with the behavior of the Reference Object. */ - $ref?: string; + $ref?: string /** * An optional string summary, intended to apply to all operations in this * path. */ - summary?: string; + 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; + description?: string /** * A definition of a GET operation on this path. */ - get?: OperationObject; + get?: OperationObject /** * A definition of a PUT operation on this path. */ - put?: OperationObject; + put?: OperationObject /** * A definition of a POST operation on this path. */ - post?: OperationObject; + post?: OperationObject /** * A definition of a DELETE operation on this path. */ - delete?: OperationObject; + delete?: OperationObject /** * A definition of an OPTIONS operation on this path. */ - options?: OperationObject; + options?: OperationObject /** * A definition of a HEAD operation on this path. */ - head?: OperationObject; + head?: OperationObject /** * A definition of a PATCH operation on this path. */ - patch?: OperationObject; + patch?: OperationObject /** * A definition of a TRACE operation on this path. */ - trace?: OperationObject; + 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; + 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. @@ -319,13 +319,13 @@ export interface PathItemObject extends SpecificationExtensions { * 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; + 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[]; + 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 @@ -334,7 +334,7 @@ export interface PathItemObject extends SpecificationExtensions { * location. The list can use the Reference Object to link to parameters * defined in the Components Object's `parameters`. */ - parameters?: (ParameterObject | ReferenceObject)[]; + parameters?: (ParameterObject | ReferenceObject)[] } /** @@ -347,20 +347,20 @@ 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[]; + tags?: string[] /** * A short summary of what the operation does. */ - summary?: string; + summary?: string /** * A verbose explanation of the operation behavior. CommonMark syntax MAY be * used for rich text representation. */ - description?: string; + description?: string /** * Additional external documentation for this operation. */ - externalDocs?: ExternalDocumentationObject; + 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 @@ -368,7 +368,7 @@ export interface OperationObject extends SpecificationExtensions { * identify an operation, therefore, it is RECOMMENDED to follow common * programming naming conventions. */ - operationId?: string; + 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 @@ -377,7 +377,7 @@ export interface OperationObject extends SpecificationExtensions { * location. The list can use the Reference Object to link to parameters * defined in the Components Object's `parameters`. */ - parameters?: (ParameterObject | ReferenceObject)[]; + 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 @@ -386,26 +386,26 @@ export interface OperationObject extends SpecificationExtensions { * `requestBody` is permitted but does not have well-defined semantics and * SHOULD be avoided if possible. */ - requestBody?: RequestBodyObject | ReferenceObject; + requestBody?: RequestBodyObject | ReferenceObject /** * The list of possible responses as they are returned from executing this * operation. */ - responses?: ResponsesObject; + 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; + callbacks?: Record /** * Declares this operation to be deprecated. Consumers SHOULD refrain from * usage of the declared operation. * * @default false */ - deprecated?: boolean; + deprecated?: boolean /** * A declaration of which security mechanisms can be used for this * operation. Only one of the Security Requirement Objects needs to be @@ -414,13 +414,13 @@ export interface OperationObject extends SpecificationExtensions { * overrides any declared top-level `security`. To remove a top-level * security declaration, an empty array can be used. */ - security?: SecurityRequirementObject[]; + 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[]; + servers?: ServerObject[] } /** @@ -429,12 +429,12 @@ export interface OperationObject extends SpecificationExtensions { * * @see {@link https://spec.openapis.org/oas/v3.2.0.html#parameter-locations} */ -export type ParameterLocation = - | "cookie" - | "header" - | "path" - | "query" - | "querystring"; +export type ParameterLocation + = | 'cookie' + | 'header' + | 'path' + | 'query' + | 'querystring' /** * Describes how a parameter value will be serialized depending on the type of @@ -457,15 +457,15 @@ export type ParameterLocation = * * @see {@link https://spec.openapis.org/oas/v3.2.0.html#style-values} */ -export type ParameterStyle = - | "cookie" - | "deepObject" - | "form" - | "label" - | "matrix" - | "pipeDelimited" - | "simple" - | "spaceDelimited"; +export type ParameterStyle + = | 'cookie' + | 'deepObject' + | 'form' + | 'label' + | 'matrix' + | 'pipeDelimited' + | 'simple' + | 'spaceDelimited' /** * Describes a single operation parameter. @@ -499,17 +499,17 @@ export interface ParameterObject extends SpecificationExtensions { * - For all other cases, the `name` corresponds to the parameter name used * by the `in` field. */ - name: string; + name: string /** * REQUIRED. The location of the parameter. Possible values are `"query"`, * `"querystring"`, `"header"`, `"path"` or `"cookie"`. */ - in: ParameterLocation; + 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; + description?: string /** * Determines whether this parameter is mandatory. If the parameter location * is `"path"`, this field is REQUIRED and its value MUST be `true`. @@ -517,14 +517,14 @@ export interface ParameterObject extends SpecificationExtensions { * * @default false */ - required?: boolean; + required?: boolean /** * Specifies that a parameter is deprecated and SHOULD be transitioned out * of usage. * * @default false */ - deprecated?: boolean; + 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 @@ -537,7 +537,7 @@ export interface ParameterObject extends SpecificationExtensions { * @deprecated Use of this field is NOT RECOMMENDED, and it is likely to be * removed in a later revision. */ - allowEmptyValue?: boolean; + 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 @@ -545,7 +545,7 @@ export interface ParameterObject extends SpecificationExtensions { * `"simple"`; for `"cookie"` - `"form"` (for compatibility; `"cookie"` * SHOULD be used). This field MUST NOT be used with `in: "querystring"`. */ - style?: ParameterStyle; + 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 @@ -553,7 +553,7 @@ export interface ParameterObject extends SpecificationExtensions { * 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; + explode?: boolean /** * When true, parameter values are serialized using reserved expansion, as * defined by RFC6570, which allows RFC3986's reserved character set, as @@ -567,30 +567,30 @@ export interface ParameterObject extends SpecificationExtensions { * * @default false */ - allowReserved?: boolean; + allowReserved?: boolean /** * The schema defining the type used for the parameter. This field MUST NOT * be used with `in: "querystring"`. */ - schema?: SchemaObject; + schema?: SchemaObject /** * Example of the parameter's potential value. The `example` field is * mutually exclusive of the `examples` field. */ - example?: unknown; + 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; + 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; + content?: Record } /** @@ -603,7 +603,7 @@ 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; + 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 @@ -611,13 +611,13 @@ export interface RequestBodyObject extends SpecificationExtensions { * `"text/plain"` overrides `"text/*"`. The map SHOULD have at least one * entry; if it does not, the behavior is implementation-defined. */ - content: Record; + content: Record /** * Determines if the request body is required in the request. * * @default false */ - required?: boolean; + required?: boolean } /** @@ -640,12 +640,12 @@ export interface MediaTypeObject extends SpecificationExtensions { * @see {@link https://spec.openapis.org/oas/3.2/schema/2025-09-17} * @see {@link https://github.com/OAI/OpenAPI-Specification/pull/4728} */ - description?: string; + description?: string /** * A schema describing the complete content of the request, response, * parameter, or header. */ - schema?: SchemaObject; + 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 @@ -654,21 +654,21 @@ export interface MediaTypeObject extends SpecificationExtensions { * stream. Both `schema` and `itemSchema` MAY be used in the same Media Type * Object. */ - itemSchema?: SchemaObject; + 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; + 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; + 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 @@ -677,7 +677,7 @@ export interface MediaTypeObject extends SpecificationExtensions { * type is `multipart` or `application/x-www-form-urlencoded`. This field * MUST NOT be present if `prefixEncoding` or `itemEncoding` are present. */ - encoding?: Record; + encoding?: Record /** * An array of positional encoding information, as defined under Encoding By * Position (analogous to `prefixItems`): each Encoding Object applies to @@ -685,7 +685,7 @@ export interface MediaTypeObject extends SpecificationExtensions { * field SHALL only apply when the media type is `multipart`. This field * MUST NOT be present if `encoding` is present. */ - prefixEncoding?: EncodingObject[]; + prefixEncoding?: EncodingObject[] /** * A single Encoding Object that provides encoding information for multiple * array items, as defined under Encoding By Position (analogous to @@ -694,7 +694,7 @@ export interface MediaTypeObject extends SpecificationExtensions { * 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; + itemEncoding?: EncodingObject } /** @@ -725,29 +725,29 @@ export interface EncodingObject extends SpecificationExtensions { * is applied per array item, so this row only applies to array values * nested inside a top-level array). */ - contentType?: string; + 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; + headers?: Record /** * Applies nested Encoding Objects in the same manner as the Media Type * Object's `encoding` field. */ - encoding?: Record; + encoding?: Record /** * Applies nested Encoding Objects in the same manner as the Media Type * Object's `prefixEncoding` field. */ - prefixEncoding?: EncodingObject[]; + prefixEncoding?: EncodingObject[] /** * Applies nested Encoding Objects in the same manner as the Media Type * Object's `itemEncoding` field. */ - itemEncoding?: EncodingObject; + 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 @@ -760,7 +760,7 @@ export interface EncodingObject extends SpecificationExtensions { * `multipart/form-data`. If a value is explicitly defined, then the value * of `contentType` (implicit or explicit) SHALL be ignored. */ - style?: QueryParameterStyle; + 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 @@ -771,7 +771,7 @@ export interface EncodingObject extends SpecificationExtensions { * `multipart/form-data`. If a value is explicitly defined, then the value * of `contentType` (implicit or explicit) SHALL be ignored. */ - explode?: boolean; + explode?: boolean /** * When true, values are serialized using reserved expansion, as defined by * RFC6570, which allows RFC3986's reserved character set, as well as @@ -786,7 +786,7 @@ export interface EncodingObject extends SpecificationExtensions { * * @default false */ - allowReserved?: boolean; + allowReserved?: boolean } /** @@ -804,7 +804,7 @@ 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; + 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 @@ -819,7 +819,7 @@ export interface ResponsesObject extends SpecificationExtensions { */ [statusCode: `${1 | 2 | 3 | 4 | 5}${string}`]: | ResponseObject - | ReferenceObject; + | ReferenceObject } /** @@ -832,32 +832,32 @@ export interface ResponseObject extends SpecificationExtensions { /** * A short summary of the meaning of the response. */ - summary?: string; + 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; + 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; + 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; + 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; + links?: Record } /** @@ -881,7 +881,7 @@ export interface CallbackObject { * callback request (e.g. `$request.body#/url`); expressions can be embedded * into string values by surrounding them with `{}` curly braces. */ - [expression: string]: PathItemObject; + [expression: string]: PathItemObject } /** @@ -904,17 +904,17 @@ export interface ExampleObject extends SpecificationExtensions { /** * Short description for the example. */ - summary?: string; + summary?: string /** * Long description for the example. CommonMark syntax MAY be used for rich * text representation. */ - description?: string; + 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; + dataValue?: unknown /** * An example of the serialized form of the value, including encoding and * escaping. If `dataValue` is present, this field SHOULD contain the @@ -922,7 +922,7 @@ export interface ExampleObject extends SpecificationExtensions { * 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; + 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 @@ -930,7 +930,7 @@ export interface ExampleObject extends SpecificationExtensions { * serialization of the given data. If this field is present, * `serializedValue` and `value` MUST be absent. */ - externalValue?: string; + externalValue?: string /** * Embedded literal example. The `value` field and `externalValue` field are * mutually exclusive. To represent examples of media types that cannot @@ -940,7 +940,7 @@ export interface ExampleObject extends SpecificationExtensions { * @deprecated For non-JSON serialization targets, use `dataValue` and/or * `serializedValue`, which have unambiguous syntax and semantics, instead. */ - value?: unknown; + value?: unknown } /** @@ -961,13 +961,13 @@ export interface LinkObject extends SpecificationExtensions { * `operationRef` values MAY be used to locate an existing Operation Object * in the OpenAPI Description. */ - operationRef?: string; + 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; + operationId?: string /** * A map representing parameters to pass to an operation as specified with * `operationId` or identified via `operationRef`. The key is the parameter @@ -976,21 +976,21 @@ export interface LinkObject extends SpecificationExtensions { * 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 + parameters?: Record /** * A literal value or runtime expression to use as a request body when * calling the target operation. */ - requestBody?: unknown; + requestBody?: unknown /** * A description of the link. CommonMark syntax MAY be used for rich text * representation. */ - description?: string; + description?: string /** * A server object to be used by the target operation. */ - server?: ServerObject; + server?: ServerObject } /** @@ -1016,27 +1016,27 @@ 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; + description?: string /** * Determines whether this header is mandatory. * * @default false */ - required?: boolean; + required?: boolean /** * Specifies that the header is deprecated and SHOULD be transitioned out of * usage. * * @default false */ - deprecated?: boolean; + deprecated?: boolean /** * Describes how the header value will be serialized. The default (and only * legal value for headers) is `"simple"`. * * @default "simple" */ - style?: "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 @@ -1045,27 +1045,27 @@ export interface HeaderObject extends SpecificationExtensions { * * @default false */ - explode?: boolean; + explode?: boolean /** * The schema defining the type used for the header. */ - schema?: SchemaObject; + schema?: SchemaObject /** * Example of the header's potential value. The `example` field is mutually * exclusive of the `examples` field. */ - example?: unknown; + 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; + 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; + content?: Record } /** @@ -1080,33 +1080,33 @@ export interface TagObject extends SpecificationExtensions { * REQUIRED. The name of the tag. Use this value in the `tags` array of an * Operation. */ - name: string; + name: string /** * A short summary of the tag, used for display purposes. */ - summary?: string; + summary?: string /** * A description for the tag. CommonMark syntax MAY be used for rich text * representation. */ - description?: string; + description?: string /** * Additional external documentation for this tag. */ - externalDocs?: ExternalDocumentationObject; + 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; + 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; + kind?: string } /** @@ -1131,7 +1131,7 @@ export interface SchemaObjectFields { * 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 + [keyword: string]: unknown // JSON Schema Core vocabulary @@ -1143,12 +1143,12 @@ export interface SchemaObjectFields { * 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; + $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; + $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 @@ -1156,38 +1156,38 @@ export interface SchemaObjectFields { * for serialization purposes (e.g. XML or sequential media types), * implementations MUST follow `$ref` and `allOf`. */ - $ref?: string; + $ref?: string /** * A plain-name fragment identifier for the enclosing schema, usable as a * `$ref` target. */ - $anchor?: string; + $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; + $dynamicRef?: string /** * A plain-name fragment identifier that is a candidate target for * `$dynamicRef` resolution. */ - $dynamicAnchor?: string; + $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; + $vocabulary?: Record /** * Reusable subschema definitions, addressable via `$ref`. */ - $defs?: Record; + $defs?: Record /** * A comment for schema maintainers, carrying no validation semantics. */ - $comment?: string; + $comment?: string // JSON Schema Applicator vocabulary @@ -1197,75 +1197,75 @@ export interface SchemaObjectFields { * `discriminator`, polymorphism. When inspecting schemas for serialization * purposes, implementations MUST follow `$ref` and `allOf`. */ - allOf?: SchemaObject[]; + allOf?: SchemaObject[] /** * An instance is valid against this keyword if it is valid against exactly * one subschema in this array. */ - oneOf?: SchemaObject[]; + oneOf?: SchemaObject[] /** * An instance is valid against this keyword if it is valid against at least * one subschema in this array. */ - anyOf?: SchemaObject[]; + anyOf?: SchemaObject[] /** * An instance is valid against this keyword if it is not valid against the * given subschema. */ - not?: SchemaObject; + not?: SchemaObject /** * If the instance validates against this subschema, it must also validate * against `then` (if present); otherwise against `else` (if present). */ - if?: SchemaObject; + if?: SchemaObject /** * Applied when the instance validates against `if`. */ - then?: SchemaObject; + then?: SchemaObject /** * Applied when the instance fails validation against `if`. */ - else?: SchemaObject; + else?: SchemaObject /** * A map of property names to subschemas that the whole instance must * validate against when the named property is present. */ - dependentSchemas?: Record; + 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[]; + prefixItems?: SchemaObject[] /** * A subschema applied to all array items not covered by `prefixItems`. */ - items?: SchemaObject; + items?: SchemaObject /** * An array instance is valid if at least one item (subject to * `minContains`/`maxContains`) validates against this subschema. */ - contains?: SchemaObject; + contains?: SchemaObject /** * A map of property names to subschemas validating the corresponding * property values of an object instance. */ - properties?: Record; + properties?: Record /** * A map of ECMA-262 regular expressions to subschemas validating the values * of all properties whose names match each expression. */ - patternProperties?: Record; + patternProperties?: Record /** * A subschema applied to the values of all object properties not covered by * `properties` or `patternProperties`. */ - additionalProperties?: SchemaObject; + additionalProperties?: SchemaObject /** * A subschema every property name of an object instance must validate * against. */ - propertyNames?: SchemaObject; + propertyNames?: SchemaObject // JSON Schema Unevaluated vocabulary @@ -1273,13 +1273,13 @@ export interface SchemaObjectFields { * A subschema applied to array items not successfully evaluated by any * `prefixItems`, `items`, or `contains` in this schema or its subschemas. */ - unevaluatedItems?: SchemaObject; + 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; + unevaluatedProperties?: SchemaObject // JSON Schema Validation vocabulary @@ -1291,7 +1291,7 @@ export interface SchemaObjectFields { * types during schema inspection: raw binary content omits `type`, while * encoded binary uses `type: "string"` with `contentEncoding`. */ - type?: SchemaObjectType | SchemaObjectType[]; + 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 @@ -1299,32 +1299,32 @@ export interface SchemaObjectFields { * plus annotations (e.g. `title`, `description`) as an annotated * enumeration. */ - enum?: T[]; + enum?: T[] /** * The instance is valid only if its value equals this value. */ - const?: T; + 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; + multipleOf?: number /** * An inclusive upper limit for a numeric instance. */ - maximum?: number; + maximum?: number /** * An exclusive upper limit for a numeric instance. */ - exclusiveMaximum?: number; + exclusiveMaximum?: number /** * An inclusive lower limit for a numeric instance. */ - minimum?: number; + minimum?: number /** * An exclusive lower limit for a numeric instance. */ - exclusiveMinimum?: number; + 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 @@ -1332,94 +1332,94 @@ export interface SchemaObjectFields { * number of octets); for that use it MAY be implemented outside of regular * JSON Schema evaluation. */ - maxLength?: number; + maxLength?: number /** * The minimum length of a string instance. MUST be a non-negative integer. * * @default 0 */ - minLength?: number; + minLength?: number /** * A string instance is valid if the ECMA-262 regular expression matches it. */ - pattern?: string; + pattern?: string /** * The maximum number of items in an array instance. MUST be a non-negative * integer. */ - maxItems?: number; + maxItems?: number /** * The minimum number of items in an array instance. MUST be a non-negative * integer. * * @default 0 */ - minItems?: number; + minItems?: number /** * If `true`, all items in an array instance must be unique. * * @default false */ - uniqueItems?: boolean; + uniqueItems?: boolean /** * The maximum number of items matching `contains`. MUST be a non-negative * integer. */ - maxContains?: number; + maxContains?: number /** * The minimum number of items matching `contains`. MUST be a non-negative * integer. * * @default 1 */ - minContains?: number; + minContains?: number /** * The maximum number of properties of an object instance. MUST be a * non-negative integer. */ - maxProperties?: number; + maxProperties?: number /** * The minimum number of properties of an object instance. MUST be a * non-negative integer. * * @default 0 */ - minProperties?: number; + minProperties?: number /** * Property names that must be present in an object instance. Elements MUST * be unique. */ - required?: string[]; + 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; + dependentRequired?: Record // JSON Schema Meta-Data vocabulary /** * A short title for the schema. */ - title?: string; + title?: string /** * A description of the schema. CommonMark syntax MAY be used for rich text * representation. */ - description?: string; + 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; + default?: T /** * Indicates that applications SHOULD refrain from using the described * value(s). * * @default false */ - deprecated?: boolean; + 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 @@ -1428,20 +1428,20 @@ export interface SchemaObjectFields { * * @default false */ - readOnly?: boolean; + readOnly?: boolean /** * Indicates the value may be sent in a request but SHOULD NOT be included * in a response. * * @default false */ - writeOnly?: boolean; + 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[]; + examples?: T[] // JSON Schema Format-Annotation vocabulary @@ -1454,7 +1454,7 @@ export interface SchemaObjectFields { * recognize a format MAY default back to `type` alone. Support for any * format registered in the OpenAPI Format Registry is strictly OPTIONAL. */ - format?: string; + format?: string // JSON Schema Content vocabulary @@ -1465,7 +1465,7 @@ export interface SchemaObjectFields { * is equivalent to requiring a `Content-Transfer-Encoding` header. Treated * as an annotation rather than validated directly. */ - contentEncoding?: string; + 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 @@ -1473,13 +1473,13 @@ export interface SchemaObjectFields { * ignored if it contradicts them. Treated as an annotation rather than * validated directly. */ - contentMediaType?: string; + 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; + contentSchema?: SchemaObject // OAS base vocabulary @@ -1491,17 +1491,17 @@ export interface SchemaObjectFields { * outcome. When the discriminating property is optional, the Discriminator * Object MUST include a `defaultMapping` field. */ - discriminator?: DiscriminatorObject; + 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; + xml?: XMLObject /** * Additional external documentation for this schema. */ - externalDocs?: ExternalDocumentationObject; + 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 @@ -1512,7 +1512,7 @@ export interface SchemaObjectFields { * Schema `examples` keyword. Use of `example` is discouraged, and later * versions of this specification may remove it. */ - example?: T; + example?: T } /** @@ -1536,7 +1536,7 @@ export interface SchemaObjectFields { * Defaults to `unknown`. * @see {@link https://spec.openapis.org/oas/v3.2.0.html#schema-object} */ -export type SchemaObject = boolean | SchemaObjectFields; +export type SchemaObject = boolean | SchemaObjectFields /** * When request bodies or response payloads may be one of a number of @@ -1557,7 +1557,7 @@ export interface DiscriminatorObject extends SpecificationExtensions { * required or optional, but when defined as optional the Discriminator * Object MUST include a `defaultMapping` field. */ - propertyName: string; + 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 @@ -1567,7 +1567,7 @@ export interface DiscriminatorObject extends SpecificationExtensions { * with the `"."` path segment (e.g. `"./foo"`). Mapping keys MUST be string * values. */ - mapping?: Record; + 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 @@ -1575,7 +1575,7 @@ export interface DiscriminatorObject extends SpecificationExtensions { * explicit or implicit mapping. REQUIRED when the discriminating property * is defined as optional. */ - defaultMapping?: string; + defaultMapping?: string } /** @@ -1592,7 +1592,7 @@ export interface DiscriminatorObject extends SpecificationExtensions { * * @see {@link https://spec.openapis.org/oas/v3.2.0.html#xml-node-types} */ -export type XMLNodeType = "attribute" | "cdata" | "element" | "none" | "text"; +export type XMLNodeType = 'attribute' | 'cdata' | 'element' | 'none' | 'text' /** * A metadata object that allows for more fine-tuned XML model definitions. @@ -1610,7 +1610,7 @@ export interface XMLObject extends SpecificationExtensions { * an explicit `nodeType: "element"` on an array schema to produce a * wrapping element. */ - nodeType?: XMLNodeType; + 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 @@ -1619,16 +1619,16 @@ export interface XMLObject extends SpecificationExtensions { * field SHALL be ignored if `nodeType` is `"text"`, `"cdata"`, or * `"none"`. */ - name?: string; + name?: string /** * The IRI (RFC3987) of the namespace definition. Value MUST be in the form * of a non-relative IRI. */ - namespace?: string; + namespace?: string /** * The prefix to be used for the name. */ - prefix?: string; + prefix?: string /** * Declares whether the property definition translates to an attribute * instead of an element. This field MUST NOT be present if `nodeType` is @@ -1637,7 +1637,7 @@ export interface XMLObject extends SpecificationExtensions { * @default false * @deprecated Use `nodeType: "attribute"` instead of `attribute: true`. */ - attribute?: boolean; + attribute?: boolean /** * MAY be used only for an array definition. Signifies whether the array is * wrapped (e.g. ``) or unwrapped @@ -1648,7 +1648,7 @@ export interface XMLObject extends SpecificationExtensions { * @default false * @deprecated Use `nodeType: "element"` instead of `wrapped: true`. */ - wrapped?: boolean; + wrapped?: boolean } /** @@ -1661,28 +1661,28 @@ export interface ApiKeySecuritySchemeObject extends SpecificationExtensions { /** * REQUIRED. The type of the security scheme. */ - type: "apiKey"; + type: 'apiKey' /** * A description for security scheme. CommonMark syntax MAY be used for rich * text representation. */ - description?: string; + description?: string /** * Declares this security scheme to be deprecated. Consumers SHOULD refrain * from usage of the declared scheme. * * @default false */ - deprecated?: boolean; + deprecated?: boolean /** * REQUIRED. The name of the header, query or cookie parameter to be used. */ - name: string; + name: string /** * REQUIRED. The location of the API key. Valid values are `"query"`, * `"header"`, or `"cookie"`. */ - in: "cookie" | "header" | "query"; + in: 'cookie' | 'header' | 'query' } /** @@ -1695,33 +1695,33 @@ export interface HttpSecuritySchemeObject extends SpecificationExtensions { /** * REQUIRED. The type of the security scheme. */ - type: "http"; + type: 'http' /** * A description for security scheme. CommonMark syntax MAY be used for rich * text representation. */ - description?: string; + description?: string /** * Declares this security scheme to be deprecated. Consumers SHOULD refrain * from usage of the declared scheme. * * @default false */ - deprecated?: boolean; + 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; + 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; + bearerFormat?: string } /** @@ -1734,19 +1734,19 @@ export interface MutualTlsSecuritySchemeObject extends SpecificationExtensions { /** * REQUIRED. The type of the security scheme. */ - type: "mutualTLS"; + type: 'mutualTLS' /** * A description for security scheme. CommonMark syntax MAY be used for rich * text representation. */ - description?: string; + description?: string /** * Declares this security scheme to be deprecated. Consumers SHOULD refrain * from usage of the declared scheme. * * @default false */ - deprecated?: boolean; + deprecated?: boolean } /** @@ -1761,29 +1761,29 @@ export interface OAuth2SecuritySchemeObject extends SpecificationExtensions { /** * REQUIRED. The type of the security scheme. */ - type: "oauth2"; + type: 'oauth2' /** * A description for security scheme. CommonMark syntax MAY be used for rich * text representation. */ - description?: string; + description?: string /** * Declares this security scheme to be deprecated. Consumers SHOULD refrain * from usage of the declared scheme. * * @default false */ - deprecated?: boolean; + deprecated?: boolean /** * REQUIRED. An object containing configuration information for the flow * types supported. */ - flows: OAuthFlowsObject; + flows: OAuthFlowsObject /** * URL to the OAuth2 authorization server metadata (RFC8414). TLS is * required. */ - oauth2MetadataUrl?: string; + oauth2MetadataUrl?: string } /** @@ -1796,24 +1796,24 @@ export interface OpenIdConnectSecuritySchemeObject extends SpecificationExtensio /** * REQUIRED. The type of the security scheme. */ - type: "openIdConnect"; + type: 'openIdConnect' /** * A description for security scheme. CommonMark syntax MAY be used for rich * text representation. */ - description?: string; + description?: string /** * Declares this security scheme to be deprecated. Consumers SHOULD refrain * from usage of the declared scheme. * * @default false */ - deprecated?: boolean; + deprecated?: boolean /** * REQUIRED. Well-known URL to discover the OpenID Connect Discovery * provider metadata. */ - openIdConnectUrl: string; + openIdConnectUrl: string } /** @@ -1827,12 +1827,12 @@ export interface OpenIdConnectSecuritySchemeObject extends SpecificationExtensio * * @see {@link https://spec.openapis.org/oas/v3.2.0.html#security-scheme-object} */ -export type SecuritySchemeObject = - | ApiKeySecuritySchemeObject - | HttpSecuritySchemeObject - | MutualTlsSecuritySchemeObject - | OAuth2SecuritySchemeObject - | OpenIdConnectSecuritySchemeObject; +export type SecuritySchemeObject + = | ApiKeySecuritySchemeObject + | HttpSecuritySchemeObject + | MutualTlsSecuritySchemeObject + | OAuth2SecuritySchemeObject + | OpenIdConnectSecuritySchemeObject /** * Allows configuration of the supported OAuth Flows. @@ -1843,25 +1843,25 @@ export interface OAuthFlowsObject extends SpecificationExtensions { /** * Configuration for the OAuth Implicit flow. */ - implicit?: ImplicitOAuthFlowObject; + implicit?: ImplicitOAuthFlowObject /** * Configuration for the OAuth Resource Owner Password flow. */ - password?: PasswordOAuthFlowObject; + password?: PasswordOAuthFlowObject /** * Configuration for the OAuth Client Credentials flow. Previously called * `application` in OpenAPI 2.0. */ - clientCredentials?: ClientCredentialsOAuthFlowObject; + clientCredentials?: ClientCredentialsOAuthFlowObject /** * Configuration for the OAuth Authorization Code flow. Previously called * `accessCode` in OpenAPI 2.0. */ - authorizationCode?: AuthorizationCodeOAuthFlowObject; + authorizationCode?: AuthorizationCodeOAuthFlowObject /** * Configuration for the OAuth Device Authorization flow. */ - deviceAuthorization?: DeviceAuthorizationOAuthFlowObject; + deviceAuthorization?: DeviceAuthorizationOAuthFlowObject } /** @@ -1875,12 +1875,12 @@ export interface DeviceAuthorizationOAuthFlowObject extends OAuthFlowObjectBase * MUST be in the form of a URL. The OAuth2 standard requires the use of * TLS. */ - deviceAuthorizationUrl: string; + 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; + tokenUrl: string } /** @@ -1888,12 +1888,12 @@ export interface DeviceAuthorizationOAuthFlowObject extends OAuthFlowObjectBase * * @see {@link https://spec.openapis.org/oas/v3.2.0.html#oauth-flow-object} */ -export type OAuthFlowObject = - | AuthorizationCodeOAuthFlowObject - | ClientCredentialsOAuthFlowObject - | DeviceAuthorizationOAuthFlowObject - | ImplicitOAuthFlowObject - | PasswordOAuthFlowObject; +export type OAuthFlowObject + = | AuthorizationCodeOAuthFlowObject + | ClientCredentialsOAuthFlowObject + | DeviceAuthorizationOAuthFlowObject + | ImplicitOAuthFlowObject + | PasswordOAuthFlowObject /** * Lists the required security schemes to execute this operation or the API as @@ -1923,5 +1923,5 @@ export interface SecurityRequirementObject { * contain a list of role names which are required for the execution, but * are not otherwise defined or exchanged in-band. */ - [name: string]: string[]; + [name: string]: string[] } diff --git a/packages/types/tests/examples/3-2-query-example.ts b/packages/types/tests/examples/3-2-query-example.ts index 3e3b19b..a7179e6 100644 --- a/packages/types/tests/examples/3-2-query-example.ts +++ b/packages/types/tests/examples/3-2-query-example.ts @@ -1,104 +1,103 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "Flight API", - version: "1.0.0", + title: 'Flight API', + version: '1.0.0', }, paths: { - "/flights/search": { + '/flights/search': { query: { - summary: "Search flights with complex criteria", + 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", + '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": { + 'application/json': { schema: { - type: "object", + type: 'object', properties: { origin: { - type: "string", - example: "ATL", + type: 'string', + example: 'ATL', }, destination: { - type: "string", - example: "LHR", + type: 'string', + example: 'LHR', }, departureDate: { - type: "string", - format: "date", - example: "2026-06-15", + type: 'string', + format: 'date', + example: '2026-06-15', }, returnDate: { - type: "string", - format: "date", - example: "2026-06-25", + type: 'string', + format: 'date', + example: '2026-06-25', }, passengers: { - type: "integer", + type: 'integer', minimum: 1, example: 2, }, cabinClass: { - type: "string", - enum: ["economy", "premium-economy", "business", "first"], - example: "business", + type: 'string', + enum: ['economy', 'premium-economy', 'business', 'first'], + example: 'business', }, nonStopOnly: { - type: "boolean", + type: 'boolean', example: true, }, }, - required: ["origin", "destination", "departureDate"], + required: ['origin', 'destination', 'departureDate'], }, }, }, }, responses: { - "200": { - description: "Matching flights", + 200: { + description: 'Matching flights', content: { - "application/json": { + 'application/json': { schema: { - type: "object", + type: 'object', properties: { flights: { - type: "array", + type: 'array', items: { - type: "object", + type: 'object', properties: { flightNumber: { - type: "string", - example: "DL30", + type: 'string', + example: 'DL30', }, origin: { - type: "string", - example: "ATL", + type: 'string', + example: 'ATL', }, destination: { - type: "string", - example: "LHR", + type: 'string', + example: 'LHR', }, departureTime: { - type: "string", - format: "date-time", - example: "2026-06-15T22:30:00Z", + type: 'string', + format: 'date-time', + example: '2026-06-15T22:30:00Z', }, arrivalTime: { - type: "string", - format: "date-time", - example: "2026-06-16T10:15:00Z", + type: 'string', + format: 'date-time', + example: '2026-06-16T10:15:00Z', }, price: { - type: "number", - format: "float", + type: 'number', + format: 'float', example: 1249.99, }, }, @@ -113,4 +112,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/examples/3-2-tags-example.ts b/packages/types/tests/examples/3-2-tags-example.ts index 2ba3011..5518c81 100644 --- a/packages/types/tests/examples/3-2-tags-example.ts +++ b/packages/types/tests/examples/3-2-tags-example.ts @@ -1,70 +1,69 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "Flight API", - version: "1.0.0", + title: 'Flight API', + version: '1.0.0', }, tags: [ { - name: "flights", - summary: "Flights", - description: "Core flight operations", - kind: "nav", + 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: '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: 'domestic', + summary: 'Domestic', + description: 'Flights within a single country', + parent: 'flights', + kind: 'nav', }, { - name: "delays", - summary: "Delays", - description: "Information about flight delays", - kind: "badge", + name: 'delays', + summary: 'Delays', + description: 'Information about flight delays', + kind: 'badge', externalDocs: { - description: "Delay compensation policies", - url: "https://docs.example.com/delay-policies", + description: 'Delay compensation policies', + url: 'https://docs.example.com/delay-policies', }, }, ], paths: { - "/flights": { + '/flights': { get: { - tags: ["flights"], - summary: "List all flights", + tags: ['flights'], + summary: 'List all flights', }, }, - "/flights/international": { + '/flights/international': { get: { - tags: ["international"], - summary: "List international flights", + tags: ['international'], + summary: 'List international flights', }, }, - "/flights/domestic": { + '/flights/domestic': { get: { - tags: ["domestic"], - summary: "List domestic flights", + tags: ['domestic'], + summary: 'List domestic flights', }, }, - "/flights/delayed": { + '/flights/delayed': { get: { - tags: ["delays"], - summary: "Get delayed flights", + tags: ['delays'], + summary: 'Get delayed flights', }, }, }, -} satisfies OpenAPIObject; +} 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 index 4c40df9..089a8b2 100644 --- a/packages/types/tests/examples/api-with-examples-3-0.ts +++ b/packages/types/tests/examples/api-with-examples-3-0.ts @@ -1,47 +1,46 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.0' export const doc = { - openapi: "3.0.0", + openapi: '3.0.0', info: { - title: "Simple API overview", - version: "2.0.0", + title: 'Simple API overview', + version: '2.0.0', }, paths: { - "/": { + '/': { get: { - operationId: "listVersionsv2", - summary: "List API versions", + operationId: 'listVersionsv2', + summary: 'List API versions', responses: { - "200": { - description: "200 response", + 200: { + description: '200 response', content: { - "application/json": { + 'application/json': { examples: { foo: { value: { versions: [ { - status: "CURRENT", - updated: "2011-01-21T11:33:21Z", - id: "v2.0", + status: 'CURRENT', + updated: '2011-01-21T11:33:21Z', + id: 'v2.0', links: [ { - href: "http://127.0.0.1:8774/v2/", - rel: "self", + href: 'http://127.0.0.1:8774/v2/', + rel: 'self', }, ], }, { - status: "EXPERIMENTAL", - updated: "2013-07-23T11:33:21Z", - id: "v3.0", + status: 'EXPERIMENTAL', + updated: '2013-07-23T11:33:21Z', + id: 'v3.0', links: [ { - href: "http://127.0.0.1:8774/v3/", - rel: "self", + href: 'http://127.0.0.1:8774/v3/', + rel: 'self', }, ], }, @@ -52,33 +51,33 @@ export const doc = { }, }, }, - "300": { - description: "300 response", + 300: { + description: '300 response', content: { - "application/json": { + 'application/json': { examples: { foo: { value: { versions: [ { - status: "CURRENT", - updated: "2011-01-21T11:33:21Z", - id: "v2.0", + status: 'CURRENT', + updated: '2011-01-21T11:33:21Z', + id: 'v2.0', links: [ { - href: "http://127.0.0.1:8774/v2/", - rel: "self", + href: 'http://127.0.0.1:8774/v2/', + rel: 'self', }, ], }, { - status: "EXPERIMENTAL", - updated: "2013-07-23T11:33:21Z", - id: "v3.0", + status: 'EXPERIMENTAL', + updated: '2013-07-23T11:33:21Z', + id: 'v3.0', links: [ { - href: "http://127.0.0.1:8774/v3/", - rel: "self", + href: 'http://127.0.0.1:8774/v3/', + rel: 'self', }, ], }, @@ -92,51 +91,51 @@ export const doc = { }, }, }, - "/v2": { + '/v2': { get: { - operationId: "getVersionDetailsv2", - summary: "Show API version details", + operationId: 'getVersionDetailsv2', + summary: 'Show API version details', responses: { - "200": { - description: "200 response", + 200: { + description: '200 response', content: { - "application/json": { + 'application/json': { examples: { foo: { value: { version: { - status: "CURRENT", - updated: "2011-01-21T11:33:21Z", - "media-types": [ + 'status': 'CURRENT', + 'updated': '2011-01-21T11:33:21Z', + 'media-types': [ { - base: "application/xml", - type: "application/vnd.openstack.compute+xml;version=2", + base: 'application/xml', + type: 'application/vnd.openstack.compute+xml;version=2', }, { - base: "application/json", - type: "application/vnd.openstack.compute+json;version=2", + base: 'application/json', + type: 'application/vnd.openstack.compute+json;version=2', }, ], - id: "v2.0", - links: [ + 'id': 'v2.0', + 'links': [ { - href: "http://127.0.0.1:8774/v2/", - rel: "self", + 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/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', }, { - 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', }, ], }, @@ -146,41 +145,41 @@ export const doc = { }, }, }, - "203": { - description: "203 response", + 203: { + description: '203 response', content: { - "application/json": { + 'application/json': { examples: { foo: { value: { version: { - status: "CURRENT", - updated: "2011-01-21T11:33:21Z", - "media-types": [ + 'status': 'CURRENT', + 'updated': '2011-01-21T11:33:21Z', + 'media-types': [ { - base: "application/xml", - type: "application/vnd.openstack.compute+xml;version=2", + base: 'application/xml', + type: 'application/vnd.openstack.compute+xml;version=2', }, { - base: "application/json", - type: "application/vnd.openstack.compute+json;version=2", + base: 'application/json', + type: 'application/vnd.openstack.compute+json;version=2', }, ], - id: "v2.0", - links: [ + 'id': 'v2.0', + 'links': [ { - href: "http://23.253.228.211:8774/v2/", - rel: "self", + 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/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', }, ], }, @@ -194,4 +193,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/examples/callback-example-3-0.ts b/packages/types/tests/examples/callback-example-3-0.ts index 641ba03..13f492a 100644 --- a/packages/types/tests/examples/callback-example-3-0.ts +++ b/packages/types/tests/examples/callback-example-3-0.ts @@ -1,47 +1,46 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.0' export const doc = { - openapi: "3.0.0", + openapi: '3.0.0', info: { - title: "Callback Example", - version: "1.0.0", + title: 'Callback Example', + version: '1.0.0', }, paths: { - "/streams": { + '/streams': { post: { - description: "subscribes a client to receive out-of-band data", + description: 'subscribes a client to receive out-of-band data', parameters: [ { - name: "callbackUrl", - in: "query", + name: 'callbackUrl', + in: 'query', required: true, description: - "the location where data will be sent. Must be network accessible\nby the source server\n", + '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", + type: 'string', + format: 'uri', + example: 'https://tonys-server.com', }, }, ], responses: { - "201": { - description: "subscription successfully created", + 201: { + description: 'subscription successfully created', content: { - "application/json": { + 'application/json': { schema: { - type: "object", - description: "subscription information", - required: ["subscriptionId"], + 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", + 'this unique identifier allows management of the subscription', + type: 'string', + example: '2531329f-fb09-4ef7-887e-84e648214436', }, }, }, @@ -51,21 +50,21 @@ export const doc = { }, callbacks: { onData: { - "{$request.query.callbackUrl}/data": { + '{$request.query.callbackUrl}/data': { post: { requestBody: { - description: "subscription payload", + description: 'subscription payload', content: { - "application/json": { + 'application/json': { schema: { - type: "object", + type: 'object', properties: { timestamp: { - type: "string", - format: "date-time", + type: 'string', + format: 'date-time', }, userData: { - type: "string", + type: 'string', }, }, }, @@ -73,13 +72,13 @@ export const doc = { }, }, responses: { - "202": { + 202: { description: - "Your server implementation should return this HTTP status code\nif the data was received successfully\n", + 'Your server implementation should return this HTTP status code\nif the data was received successfully\n', }, - "204": { + 204: { description: - "Your server should return this HTTP status code if no longer interested\nin further updates\n", + 'Your server should return this HTTP status code if no longer interested\nin further updates\n', }, }, }, @@ -89,4 +88,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/examples/link-example-3-0.ts b/packages/types/tests/examples/link-example-3-0.ts index 607d8cd..aec74be 100644 --- a/packages/types/tests/examples/link-example-3-0.ts +++ b/packages/types/tests/examples/link-example-3-0.ts @@ -1,160 +1,159 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.0' export const doc = { - openapi: "3.0.0", + openapi: '3.0.0', info: { - title: "Link Example", - version: "1.0.0", + title: 'Link Example', + version: '1.0.0', }, paths: { - "/2.0/users/{username}": { + '/2.0/users/{username}': { get: { - operationId: "getUserByName", + operationId: 'getUserByName', parameters: [ { - name: "username", - in: "path", + name: 'username', + in: 'path', required: true, schema: { - type: "string", + type: 'string', }, }, ], responses: { - "200": { - description: "The User", + 200: { + description: 'The User', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/user", + $ref: '#/components/schemas/user', }, }, }, links: { userRepositories: { - $ref: "#/components/links/UserRepositories", + $ref: '#/components/links/UserRepositories', }, }, }, }, }, }, - "/2.0/repositories/{username}": { + '/2.0/repositories/{username}': { get: { - operationId: "getRepositoriesByOwner", + operationId: 'getRepositoriesByOwner', parameters: [ { - name: "username", - in: "path", + name: 'username', + in: 'path', required: true, schema: { - type: "string", + type: 'string', }, }, ], responses: { - "200": { - description: "repositories owned by the supplied user", + 200: { + description: 'repositories owned by the supplied user', content: { - "application/json": { + 'application/json': { schema: { - type: "array", + type: 'array', items: { - $ref: "#/components/schemas/repository", + $ref: '#/components/schemas/repository', }, }, }, }, links: { userRepository: { - $ref: "#/components/links/UserRepository", + $ref: '#/components/links/UserRepository', }, }, }, }, }, }, - "/2.0/repositories/{username}/{slug}": { + '/2.0/repositories/{username}/{slug}': { get: { - operationId: "getRepository", + operationId: 'getRepository', parameters: [ { - name: "username", - in: "path", + name: 'username', + in: 'path', required: true, schema: { - type: "string", + type: 'string', }, }, { - name: "slug", - in: "path", + name: 'slug', + in: 'path', required: true, schema: { - type: "string", + type: 'string', }, }, ], responses: { - "200": { - description: "The repository", + 200: { + description: 'The repository', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/repository", + $ref: '#/components/schemas/repository', }, }, }, links: { repositoryPullRequests: { - $ref: "#/components/links/RepositoryPullRequests", + $ref: '#/components/links/RepositoryPullRequests', }, }, }, }, }, }, - "/2.0/repositories/{username}/{slug}/pullrequests": { + '/2.0/repositories/{username}/{slug}/pullrequests': { get: { - operationId: "getPullRequestsByRepository", + operationId: 'getPullRequestsByRepository', parameters: [ { - name: "username", - in: "path", + name: 'username', + in: 'path', required: true, schema: { - type: "string", + type: 'string', }, }, { - name: "slug", - in: "path", + name: 'slug', + in: 'path', required: true, schema: { - type: "string", + type: 'string', }, }, { - name: "state", - in: "query", + name: 'state', + in: 'query', schema: { - type: "string", - enum: ["open", "merged", "declined"], + type: 'string', + enum: ['open', 'merged', 'declined'], }, }, ], responses: { - "200": { - description: "an array of pull request objects", + 200: { + description: 'an array of pull request objects', content: { - "application/json": { + 'application/json': { schema: { - type: "array", + type: 'array', items: { - $ref: "#/components/schemas/pullrequest", + $ref: '#/components/schemas/pullrequest', }, }, }, @@ -163,86 +162,86 @@ export const doc = { }, }, }, - "/2.0/repositories/{username}/{slug}/pullrequests/{pid}": { + '/2.0/repositories/{username}/{slug}/pullrequests/{pid}': { get: { - operationId: "getPullRequestsById", + operationId: 'getPullRequestsById', parameters: [ { - name: "username", - in: "path", + name: 'username', + in: 'path', required: true, schema: { - type: "string", + type: 'string', }, }, { - name: "slug", - in: "path", + name: 'slug', + in: 'path', required: true, schema: { - type: "string", + type: 'string', }, }, { - name: "pid", - in: "path", + name: 'pid', + in: 'path', required: true, schema: { - type: "string", + type: 'string', }, }, ], responses: { - "200": { - description: "a pull request object", + 200: { + description: 'a pull request object', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/pullrequest", + $ref: '#/components/schemas/pullrequest', }, }, }, links: { pullRequestMerge: { - $ref: "#/components/links/PullRequestMerge", + $ref: '#/components/links/PullRequestMerge', }, }, }, }, }, }, - "/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge": { + '/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge': { post: { - operationId: "mergePullRequest", + operationId: 'mergePullRequest', parameters: [ { - name: "username", - in: "path", + name: 'username', + in: 'path', required: true, schema: { - type: "string", + type: 'string', }, }, { - name: "slug", - in: "path", + name: 'slug', + in: 'path', required: true, schema: { - type: "string", + type: 'string', }, }, { - name: "pid", - in: "path", + name: 'pid', + in: 'path', required: true, schema: { - type: "string", + type: 'string', }, }, ], responses: { - "204": { - description: "the PR was successfully merged", + 204: { + description: 'the PR was successfully merged', }, }, }, @@ -251,74 +250,74 @@ export const doc = { components: { links: { UserRepositories: { - operationId: "getRepositoriesByOwner", + operationId: 'getRepositoriesByOwner', parameters: { - username: "$response.body#/username", + username: '$response.body#/username', }, }, UserRepository: { - operationId: "getRepository", + operationId: 'getRepository', parameters: { - username: "$response.body#/owner/username", - slug: "$response.body#/slug", + username: '$response.body#/owner/username', + slug: '$response.body#/slug', }, }, RepositoryPullRequests: { - operationId: "getPullRequestsByRepository", + operationId: 'getPullRequestsByRepository', parameters: { - username: "$response.body#/owner/username", - slug: "$response.body#/slug", + username: '$response.body#/owner/username', + slug: '$response.body#/slug', }, }, PullRequestMerge: { - operationId: "mergePullRequest", + operationId: 'mergePullRequest', parameters: { - username: "$response.body#/author/username", - slug: "$response.body#/repository/slug", - pid: "$response.body#/id", + username: '$response.body#/author/username', + slug: '$response.body#/repository/slug', + pid: '$response.body#/id', }, }, }, schemas: { user: { - type: "object", + type: 'object', properties: { username: { - type: "string", + type: 'string', }, uuid: { - type: "string", + type: 'string', }, }, }, repository: { - type: "object", + type: 'object', properties: { slug: { - type: "string", + type: 'string', }, owner: { - $ref: "#/components/schemas/user", + $ref: '#/components/schemas/user', }, }, }, pullrequest: { - type: "object", + type: 'object', properties: { id: { - type: "integer", + type: 'integer', }, title: { - type: "string", + type: 'string', }, repository: { - $ref: "#/components/schemas/repository", + $ref: '#/components/schemas/repository', }, author: { - $ref: "#/components/schemas/user", + $ref: '#/components/schemas/user', }, }, }, }, }, -} satisfies OpenAPIObject; +} 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 index 8085e3d..97da6ee 100644 --- a/packages/types/tests/examples/non-oauth-scopes-3-1.ts +++ b/packages/types/tests/examples/non-oauth-scopes-3-1.ts @@ -1,20 +1,19 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "Non-oAuth Scopes example", - version: "1.0.0", + title: 'Non-oAuth Scopes example', + version: '1.0.0', }, paths: { - "/users": { + '/users': { get: { security: [ { - bearerAuth: ["read:users", "public"], + bearerAuth: ['read:users', 'public'], }, ], }, @@ -23,12 +22,12 @@ export const doc = { components: { securitySchemes: { bearerAuth: { - type: "http", - scheme: "bearer", - bearerFormat: "jwt", + type: 'http', + scheme: 'bearer', + bearerFormat: 'jwt', description: - "note: non-oauth scopes are not defined at the securityScheme level", + 'note: non-oauth scopes are not defined at the securityScheme level', }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/examples/petstore-3-0.ts b/packages/types/tests/examples/petstore-3-0.ts index 066109b..ca4d2d5 100644 --- a/packages/types/tests/examples/petstore-3-0.ts +++ b/packages/types/tests/examples/petstore-3-0.ts @@ -1,66 +1,65 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.0' export const doc = { - openapi: "3.0.0", + openapi: '3.0.0', info: { - version: "1.0.0", - title: "Swagger Petstore", + version: '1.0.0', + title: 'Swagger Petstore', license: { - name: "MIT", + name: 'MIT', }, }, servers: [ { - url: "http://petstore.swagger.io/v1", + url: 'http://petstore.swagger.io/v1', }, ], paths: { - "/pets": { + '/pets': { get: { - summary: "List all pets", - operationId: "listPets", - tags: ["pets"], + summary: 'List all pets', + operationId: 'listPets', + tags: ['pets'], parameters: [ { - name: "limit", - in: "query", - description: "How many items to return at one time (max 100)", + name: 'limit', + in: 'query', + description: 'How many items to return at one time (max 100)', required: false, schema: { - type: "integer", + type: 'integer', maximum: 100, - format: "int32", + format: 'int32', }, }, ], responses: { - "200": { - description: "A paged array of pets", + 200: { + description: 'A paged array of pets', headers: { - "x-next": { - description: "A link to the next page of responses", + 'x-next': { + description: 'A link to the next page of responses', schema: { - type: "string", + type: 'string', }, }, }, content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Pets", + $ref: '#/components/schemas/Pets', }, }, }, }, default: { - description: "unexpected error", + description: 'unexpected error', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Error", + $ref: '#/components/schemas/Error', }, }, }, @@ -68,29 +67,29 @@ export const doc = { }, }, post: { - summary: "Create a pet", - operationId: "createPets", - tags: ["pets"], + summary: 'Create a pet', + operationId: 'createPets', + tags: ['pets'], requestBody: { content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, required: true, }, responses: { - "201": { - description: "Null response", + 201: { + description: 'Null response', }, default: { - description: "unexpected error", + description: 'unexpected error', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Error", + $ref: '#/components/schemas/Error', }, }, }, @@ -98,39 +97,39 @@ export const doc = { }, }, }, - "/pets/{petId}": { + '/pets/{petId}': { get: { - summary: "Info for a specific pet", - operationId: "showPetById", - tags: ["pets"], + summary: 'Info for a specific pet', + operationId: 'showPetById', + tags: ['pets'], parameters: [ { - name: "petId", - in: "path", + name: 'petId', + in: 'path', required: true, - description: "The id of the pet to retrieve", + description: 'The id of the pet to retrieve', schema: { - type: "string", + type: 'string', }, }, ], responses: { - "200": { - description: "Expected response to a valid request", + 200: { + description: 'Expected response to a valid request', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, }, default: { - description: "unexpected error", + description: 'unexpected error', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Error", + $ref: '#/components/schemas/Error', }, }, }, @@ -142,41 +141,41 @@ export const doc = { components: { schemas: { Pet: { - type: "object", - required: ["id", "name"], + type: 'object', + required: ['id', 'name'], properties: { id: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, name: { - type: "string", + type: 'string', }, tag: { - type: "string", + type: 'string', }, }, }, Pets: { - type: "array", + type: 'array', maxItems: 100, items: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, Error: { - type: "object", - required: ["code", "message"], + type: 'object', + required: ['code', 'message'], properties: { code: { - type: "integer", - format: "int32", + type: 'integer', + format: 'int32', }, message: { - type: "string", + type: 'string', }, }, }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/examples/petstore-expanded-3-0.ts b/packages/types/tests/examples/petstore-expanded-3-0.ts index 0bba117..8ca4e7a 100644 --- a/packages/types/tests/examples/petstore-expanded-3-0.ts +++ b/packages/types/tests/examples/petstore-expanded-3-0.ts @@ -1,82 +1,81 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.0' export const doc = { - openapi: "3.0.0", + openapi: '3.0.0', info: { - version: "1.0.0", - title: "Swagger Petstore", + 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/", + '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", + 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", + name: 'Apache 2.0', + url: 'https://www.apache.org/licenses/LICENSE-2.0.html', }, }, servers: [ { - url: "https://petstore.swagger.io/v2", + url: 'https://petstore.swagger.io/v2', }, ], paths: { - "/pets": { + '/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", + '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", + name: 'tags', + in: 'query', + description: 'tags to filter by', required: false, - style: "form", + style: 'form', schema: { - type: "array", + type: 'array', items: { - type: "string", + type: 'string', }, }, }, { - name: "limit", - in: "query", - description: "maximum number of results to return", + name: 'limit', + in: 'query', + description: 'maximum number of results to return', required: false, schema: { - type: "integer", - format: "int32", + type: 'integer', + format: 'int32', }, }, ], responses: { - "200": { - description: "pet response", + 200: { + description: 'pet response', content: { - "application/json": { + 'application/json': { schema: { - type: "array", + type: 'array', items: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, }, }, default: { - description: "unexpected error", + description: 'unexpected error', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Error", + $ref: '#/components/schemas/Error', }, }, }, @@ -84,36 +83,36 @@ export const doc = { }, }, post: { - description: "Creates a new pet in the store. Duplicates are allowed", - operationId: "addPet", + description: 'Creates a new pet in the store. Duplicates are allowed', + operationId: 'addPet', requestBody: { - description: "Pet to add to the store", + description: 'Pet to add to the store', required: true, content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/NewPet", + $ref: '#/components/schemas/NewPet', }, }, }, }, responses: { - "200": { - description: "pet response", + 200: { + description: 'pet response', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, }, default: { - description: "unexpected error", + description: 'unexpected error', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Error", + $ref: '#/components/schemas/Error', }, }, }, @@ -121,40 +120,40 @@ export const doc = { }, }, }, - "/pets/{id}": { + '/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", + '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", + name: 'id', + in: 'path', + description: 'ID of pet to fetch', required: true, schema: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, }, ], responses: { - "200": { - description: "pet response", + 200: { + description: 'pet response', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, }, default: { - description: "unexpected error", + description: 'unexpected error', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Error", + $ref: '#/components/schemas/Error', }, }, }, @@ -162,30 +161,30 @@ export const doc = { }, }, delete: { - description: "deletes a single pet based on the ID supplied", - operationId: "deletePet", + description: 'deletes a single pet based on the ID supplied', + operationId: 'deletePet', parameters: [ { - name: "id", - in: "path", - description: "ID of pet to delete", + name: 'id', + in: 'path', + description: 'ID of pet to delete', required: true, schema: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, }, ], responses: { - "204": { - description: "pet deleted", + 204: { + description: 'pet deleted', }, default: { - description: "unexpected error", + description: 'unexpected error', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Error", + $ref: '#/components/schemas/Error', }, }, }, @@ -199,45 +198,45 @@ export const doc = { Pet: { allOf: [ { - $ref: "#/components/schemas/NewPet", + $ref: '#/components/schemas/NewPet', }, { - type: "object", - required: ["id"], + type: 'object', + required: ['id'], properties: { id: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, }, }, ], }, NewPet: { - type: "object", - required: ["name"], + type: 'object', + required: ['name'], properties: { name: { - type: "string", + type: 'string', }, tag: { - type: "string", + type: 'string', }, }, }, Error: { - type: "object", - required: ["code", "message"], + type: 'object', + required: ['code', 'message'], properties: { code: { - type: "integer", - format: "int32", + type: 'integer', + format: 'int32', }, message: { - type: "string", + type: 'string', }, }, }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/examples/tictactoe-3-1.ts b/packages/types/tests/examples/tictactoe-3-1.ts index 3429dfb..bbf6ac2 100644 --- a/packages/types/tests/examples/tictactoe-3-1.ts +++ b/packages/types/tests/examples/tictactoe-3-1.ts @@ -1,35 +1,34 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "Tic Tac Toe", + 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", + '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", + name: 'Gameplay', }, ], paths: { - "/board": { + '/board': { get: { - summary: "Get the whole board", - description: "Retrieves the current state of the board and the winner.", - tags: ["Gameplay"], - operationId: "get-board", + 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", + 200: { + description: 'OK', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/status", + $ref: '#/components/schemas/status', }, }, }, @@ -40,44 +39,44 @@ export const doc = { defaultApiKey: [], }, { - app2AppOauth: ["board:read"], + app2AppOauth: ['board:read'], }, ], }, }, - "/board/{row}/{column}": { + '/board/{row}/{column}': { parameters: [ { - $ref: "#/components/parameters/rowParam", + $ref: '#/components/parameters/rowParam', }, { - $ref: "#/components/parameters/columnParam", + $ref: '#/components/parameters/columnParam', }, ], get: { - summary: "Get a single board square", - description: "Retrieves the requested square.", - tags: ["Gameplay"], - operationId: "get-square", + summary: 'Get a single board square', + description: 'Retrieves the requested square.', + tags: ['Gameplay'], + operationId: 'get-square', responses: { - "200": { - description: "OK", + 200: { + description: 'OK', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/mark", + $ref: '#/components/schemas/mark', }, }, }, }, - "400": { - description: "The provided parameters are incorrect", + 400: { + description: 'The provided parameters are incorrect', content: { - "text/html": { + 'text/html': { schema: { - $ref: "#/components/schemas/errorMessage", + $ref: '#/components/schemas/errorMessage', }, - example: "Illegal coordinates", + example: 'Illegal coordinates', }, }, }, @@ -87,53 +86,53 @@ export const doc = { bearerHttpAuthentication: [], }, { - user2AppOauth: ["board:read"], + user2AppOauth: ['board:read'], }, ], }, put: { - summary: "Set a single board square", + 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", + '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": { + 'application/json': { schema: { - $ref: "#/components/schemas/mark", + $ref: '#/components/schemas/mark', }, }, }, }, responses: { - "200": { - description: "OK", + 200: { + description: 'OK', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/status", + $ref: '#/components/schemas/status', }, }, }, }, - "400": { - description: "The provided parameters are incorrect", + 400: { + description: 'The provided parameters are incorrect', content: { - "text/html": { + 'text/html': { schema: { - $ref: "#/components/schemas/errorMessage", + $ref: '#/components/schemas/errorMessage', }, examples: { illegalCoordinates: { - value: "Illegal coordinates.", + value: 'Illegal coordinates.', }, notEmpty: { - value: "Square is not empty.", + value: 'Square is not empty.', }, invalidMark: { - value: "Invalid Mark (X or O).", + value: 'Invalid Mark (X or O).', }, }, }, @@ -145,7 +144,7 @@ export const doc = { bearerHttpAuthentication: [], }, { - user2AppOauth: ["board:write"], + user2AppOauth: ['board:write'], }, ], }, @@ -154,116 +153,116 @@ export const doc = { components: { parameters: { rowParam: { - description: "Board row (vertical coordinate)", - name: "row", - in: "path", + description: 'Board row (vertical coordinate)', + name: 'row', + in: 'path', required: true, schema: { - $ref: "#/components/schemas/coordinate", + $ref: '#/components/schemas/coordinate', }, }, columnParam: { - description: "Board column (horizontal coordinate)", - name: "column", - in: "path", + description: 'Board column (horizontal coordinate)', + name: 'column', + in: 'path', required: true, schema: { - $ref: "#/components/schemas/coordinate", + $ref: '#/components/schemas/coordinate', }, }, }, schemas: { errorMessage: { - type: "string", + type: 'string', maxLength: 256, - description: "A text message describing an error", + description: 'A text message describing an error', }, coordinate: { - type: "integer", + type: 'integer', minimum: 1, maximum: 3, example: 1, }, mark: { - type: "string", - enum: [".", "X", "O"], + type: 'string', + enum: ['.', 'X', 'O'], description: - "Possible values for a board square. `.` means empty square.", - example: ".", + 'Possible values for a board square. `.` means empty square.', + example: '.', }, board: { - type: "array", + type: 'array', maxItems: 3, minItems: 3, items: { - type: "array", + type: 'array', maxItems: 3, minItems: 3, items: { - $ref: "#/components/schemas/mark", + $ref: '#/components/schemas/mark', }, }, }, winner: { - type: "string", - enum: [".", "X", "O"], - description: "Winner of the game. `.` means nobody has won yet.", - example: ".", + type: 'string', + enum: ['.', 'X', 'O'], + description: 'Winner of the game. `.` means nobody has won yet.', + example: '.', }, status: { - type: "object", + type: 'object', properties: { winner: { - $ref: "#/components/schemas/winner", + $ref: '#/components/schemas/winner', }, board: { - $ref: "#/components/schemas/board", + $ref: '#/components/schemas/board', }, }, }, }, securitySchemes: { defaultApiKey: { - description: "API key provided in console", - type: "apiKey", - name: "api-key", - in: "header", + description: 'API key provided in console', + type: 'apiKey', + name: 'api-key', + in: 'header', }, basicHttpAuthentication: { - description: "Basic HTTP Authentication", - type: "http", - scheme: "Basic", + description: 'Basic HTTP Authentication', + type: 'http', + scheme: 'Basic', }, bearerHttpAuthentication: { - description: "Bearer token using a JWT", - type: "http", - scheme: "Bearer", - bearerFormat: "JWT", + description: 'Bearer token using a JWT', + type: 'http', + scheme: 'Bearer', + bearerFormat: 'JWT', }, app2AppOauth: { - type: "oauth2", + type: 'oauth2', flows: { clientCredentials: { - tokenUrl: "https://learn.openapis.org/oauth/2.0/token", + tokenUrl: 'https://learn.openapis.org/oauth/2.0/token', scopes: { - "board:read": "Read the board", + 'board:read': 'Read the board', }, }, }, }, user2AppOauth: { - type: "oauth2", + type: 'oauth2', flows: { authorizationCode: { - authorizationUrl: "https://learn.openapis.org/oauth/2.0/auth", - tokenUrl: "https://learn.openapis.org/oauth/2.0/token", + 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", + 'board:read': 'Read the board', + 'board:write': 'Write to the board', }, }, }, }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/examples/uspto-3-0.ts b/packages/types/tests/examples/uspto-3-0.ts index ad96a24..57b4446 100644 --- a/packages/types/tests/examples/uspto-3-0.ts +++ b/packages/types/tests/examples/uspto-3-0.ts @@ -1,75 +1,74 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.0' export const doc = { - openapi: "3.0.1", + openapi: '3.0.1', servers: [ { - url: "{scheme}://developer.uspto.gov/ds-api", + 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", + 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", + '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", + name: 'Open Data Portal', + url: 'https://developer.uspto.gov', + email: 'developer@uspto.gov', }, }, tags: [ { - name: "metadata", - description: "Find out about the data sets", + name: 'metadata', + description: 'Find out about the data sets', }, { - name: "search", - description: "Search a data set", + name: 'search', + description: 'Search a data set', }, ], paths: { - "/": { + '/': { get: { - tags: ["metadata"], - operationId: "list-data-sets", - summary: "List available data sets", + tags: ['metadata'], + operationId: 'list-data-sets', + summary: 'List available data sets', responses: { - "200": { - description: "Returns a list of data sets", + 200: { + description: 'Returns a list of data sets', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/dataSetList", + $ref: '#/components/schemas/dataSetList', }, example: { total: 2, apis: [ { - apiKey: "oa_citations", - apiVersionNumber: "v1", + apiKey: 'oa_citations', + apiVersionNumber: 'v1', apiUrl: - "https://developer.uspto.gov/ds-api/oa_citations/v1/fields", + '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", + '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", + apiKey: 'cancer_moonshot', + apiVersionNumber: 'v1', apiUrl: - "https://developer.uspto.gov/ds-api/cancer_moonshot/v1/fields", + '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", + 'https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/cancer_moonshot.json', }, ], }, @@ -79,55 +78,55 @@ export const doc = { }, }, }, - "/{dataset}/{version}/fields": { + '/{dataset}/{version}/fields': { get: { - tags: ["metadata"], + tags: ['metadata'], summary: - "Provides the general information about the API and the list of fields that can be used to query the dataset.", + '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", + '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.", + name: 'dataset', + in: 'path', + description: 'Name of the dataset.', required: true, - example: "oa_citations", + example: 'oa_citations', schema: { - type: "string", + type: 'string', }, }, { - name: "version", - in: "path", - description: "Version of the dataset.", + name: 'version', + in: 'path', + description: 'Version of the dataset.', required: true, - example: "v1", + example: 'v1', schema: { - type: "string", + type: 'string', }, }, ], responses: { - "200": { + 200: { description: - "The dataset API for the given version is found and it is accessible to consume.", + 'The dataset API for the given version is found and it is accessible to consume.', content: { - "application/json": { + 'application/json': { schema: { - type: "string", + type: 'string', }, }, }, }, - "404": { + 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.", + '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": { + 'application/json': { schema: { - type: "string", + type: 'string', }, }, }, @@ -135,83 +134,83 @@ export const doc = { }, }, }, - "/{dataset}/{version}/records": { + '/{dataset}/{version}/records': { post: { - tags: ["search"], + tags: ['search'], summary: - "Provides search capability for the data set with the given search criteria.", + '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", + '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.", + name: 'version', + in: 'path', + description: 'Version of the dataset.', required: true, schema: { - type: "string", - default: "v1", + type: 'string', + default: 'v1', }, }, { - name: "dataset", - in: "path", + name: 'dataset', + in: 'path', description: - "Name of the dataset. In this case, the default value is oa_citations", + 'Name of the dataset. In this case, the default value is oa_citations', required: true, schema: { - type: "string", - default: "oa_citations", + type: 'string', + default: 'oa_citations', }, }, ], responses: { - "200": { - description: "successful operation", + 200: { + description: 'successful operation', content: { - "application/json": { + 'application/json': { schema: { - type: "array", + type: 'array', items: { - type: "object", + type: 'object', additionalProperties: { - type: "object", + type: 'object', }, }, }, }, }, }, - "404": { - description: "No matching record found for the given criteria.", + 404: { + description: 'No matching record found for the given criteria.', }, }, requestBody: { content: { - "application/x-www-form-urlencoded": { + 'application/x-www-form-urlencoded': { schema: { - type: "object", + 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: "*:*", + '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", + 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", + '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"], + required: ['criteria'], }, }, }, @@ -222,33 +221,33 @@ export const doc = { components: { schemas: { dataSetList: { - type: "object", + type: 'object', properties: { total: { - type: "integer", + type: 'integer', }, apis: { - type: "array", + type: 'array', items: { - type: "object", + type: 'object', properties: { apiKey: { - type: "string", - description: "To be used as a dataset parameter value", + type: 'string', + description: 'To be used as a dataset parameter value', }, apiVersionNumber: { - type: "string", - description: "To be used as a version parameter value", + 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", + 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", + type: 'string', + format: 'uri-reference', + description: 'A URL to the API console for each API', }, }, }, @@ -257,4 +256,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/examples/webhook-example-3-1.ts b/packages/types/tests/examples/webhook-example-3-1.ts index 481d05c..053f4b5 100644 --- a/packages/types/tests/examples/webhook-example-3-1.ts +++ b/packages/types/tests/examples/webhook-example-3-1.ts @@ -1,31 +1,30 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "Webhook Example", - version: "1.0.0", + title: 'Webhook Example', + version: '1.0.0', }, webhooks: { newPet: { post: { requestBody: { - description: "Information about a new pet in the system", + description: 'Information about a new pet in the system', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, }, responses: { - "200": { + 200: { description: - "Return a 200 status to indicate that the data was received successfully", + 'Return a 200 status to indicate that the data was received successfully', }, }, }, @@ -34,21 +33,21 @@ export const doc = { components: { schemas: { Pet: { - type: "object", - required: ["id", "name"], + type: 'object', + required: ['id', 'name'], properties: { id: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, name: { - type: "string", + type: 'string', }, tag: { - type: "string", + type: 'string', }, }, }, }, }, -} satisfies OpenAPIObject; +} 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 index a50b303..b165a05 100644 --- a/packages/types/tests/schema-tests-3.1/callback-object-examples.ts +++ b/packages/types/tests/schema-tests-3.1/callback-object-examples.ts @@ -1,54 +1,53 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { callbacks: { myCallback: { - "{$request.query.queryUrl}": { + '{$request.query.queryUrl}': { post: { requestBody: { - description: "Callback payload", + description: 'Callback payload', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/SomePayload", + $ref: '#/components/schemas/SomePayload', }, }, }, }, responses: { - "200": { - description: "callback successfully processed", + 200: { + description: 'callback successfully processed', }, }, }, }, }, transactionCallback: { - "http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}": + 'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}': { post: { requestBody: { - description: "Callback payload", + description: 'Callback payload', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/SomePayload", + $ref: '#/components/schemas/SomePayload', }, }, }, }, responses: { - "200": { - description: "callback successfully processed", + 200: { + description: 'callback successfully processed', }, }, }, @@ -59,4 +58,4 @@ export const doc = { SomePayload: {}, }, }, -} satisfies OpenAPIObject; +} 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 index 0b753c5..15b98a8 100644 --- a/packages/types/tests/schema-tests-3.1/comp-pathitems.ts +++ b/packages/types/tests/schema-tests-3.1/comp-pathitems.ts @@ -1,15 +1,14 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { pathItems: {}, }, -} satisfies OpenAPIObject; +} 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 index f826b93..167ee88 100644 --- a/packages/types/tests/schema-tests-3.1/components-object-example.ts +++ b/packages/types/tests/schema-tests-3.1/components-object-example.ts @@ -1,88 +1,87 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { schemas: { GeneralError: { - type: "object", + type: 'object', properties: { code: { - type: "integer", - format: "int32", + type: 'integer', + format: 'int32', }, message: { - type: "string", + type: 'string', }, }, }, Category: { - type: "object", + type: 'object', properties: { id: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, name: { - type: "string", + type: 'string', }, }, }, Tag: { - type: "object", + type: 'object', properties: { id: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, name: { - type: "string", + type: 'string', }, }, }, }, parameters: { skipParam: { - name: "skip", - in: "query", - description: "number of items to skip", + name: 'skip', + in: 'query', + description: 'number of items to skip', required: true, schema: { - type: "integer", - format: "int32", + type: 'integer', + format: 'int32', }, }, limitParam: { - name: "limit", - in: "query", - description: "max records to return", + name: 'limit', + in: 'query', + description: 'max records to return', required: true, schema: { - type: "integer", - format: "int32", + type: 'integer', + format: 'int32', }, }, }, responses: { NotFound: { - description: "Entity not found.", + description: 'Entity not found.', }, IllegalInput: { - description: "Illegal input for operation.", + description: 'Illegal input for operation.', }, GeneralError: { - description: "General Error", + description: 'General Error', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/GeneralError", + $ref: '#/components/schemas/GeneralError', }, }, }, @@ -90,22 +89,22 @@ export const doc = { }, securitySchemes: { api_key: { - type: "apiKey", - name: "api-key", - in: "header", + type: 'apiKey', + name: 'api-key', + in: 'header', }, petstore_auth: { - type: "oauth2", + type: 'oauth2', flows: { implicit: { - authorizationUrl: "https://example.org/api/oauth/dialog", + authorizationUrl: 'https://example.org/api/oauth/dialog', scopes: { - "write:pets": "modify pets in your account", - "read:pets": "read your pets", + 'write:pets': 'modify pets in your account', + 'read:pets': 'read your pets', }, }, }, }, }, }, -} satisfies OpenAPIObject; +} 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 index f4549bb..a67775e 100644 --- a/packages/types/tests/schema-tests-3.1/example-object-examples.ts +++ b/packages/types/tests/schema-tests-3.1/example-object-examples.ts @@ -1,59 +1,58 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { examples: { - "zip-example": {}, - "confirmation-success": {}, + 'zip-example': {}, + 'confirmation-success': {}, }, schemas: { SuccessResponse: {}, Address: {}, }, requestBodies: { - "with-example": { + 'with-example': { content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Address", + $ref: '#/components/schemas/Address', }, examples: { foo: { - summary: "A foo example", + summary: 'A foo example', value: { - foo: "bar", + foo: 'bar', }, }, bar: { - summary: "A bar example", + summary: 'A bar example', value: { - bar: "baz", + bar: 'baz', }, }, }, }, - "application/xml": { + 'application/xml': { examples: { xmlExample: { - summary: "This is an example in XML", + summary: 'This is an example in XML', externalValue: - "https://example.org/examples/address-example.xml", + 'https://example.org/examples/address-example.xml', }, }, }, - "text/plain": { + 'text/plain': { examples: { textExample: { - summary: "This is a text example", - externalValue: "https://foo.bar/examples/address-example.txt", + summary: 'This is a text example', + externalValue: 'https://foo.bar/examples/address-example.txt', }, }, }, @@ -61,52 +60,52 @@ export const doc = { }, }, parameters: { - "with-example": { - name: "zipCode", - in: "query", + 'with-example': { + name: 'zipCode', + in: 'query', schema: { - type: "string", - format: "zip-code", + type: 'string', + format: 'zip-code', }, examples: { - "zip-example": { - $ref: "#/components/examples/zip-example", + 'zip-example': { + $ref: '#/components/examples/zip-example', }, }, }, }, responses: { - "200": { - description: "your car appointment has been booked", + 200: { + description: 'your car appointment has been booked', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/SuccessResponse", + $ref: '#/components/schemas/SuccessResponse', }, examples: { - "confirmation-success": { - $ref: "#/components/examples/confirmation-success", + 'confirmation-success': { + $ref: '#/components/examples/confirmation-success', }, }, }, - "application/x-www-form-urlencoded": { + 'application/x-www-form-urlencoded': { schema: { - type: "object", + type: 'object', properties: { jsonValue: { - type: "string", + type: 'string', }, }, }, encoding: { jsonValue: { - contentType: "application/json", + contentType: 'application/json', }, }, examples: { jsonFormValue: { description: 'The JSON string "json" as a form value', - value: "jsonValue=%22json%22", + value: 'jsonValue=%22json%22', }, }, }, @@ -114,4 +113,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} 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 index ade0210..0f5626c 100644 --- a/packages/types/tests/schema-tests-3.1/header-object-examples.ts +++ b/packages/types/tests/schema-tests-3.1/header-object-examples.ts @@ -1,44 +1,43 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { headers: { - "X-Rate-Limit-Limit": { - description: "The number of allowed requests in the current period", + 'X-Rate-Limit-Limit': { + description: 'The number of allowed requests in the current period', deprecated: false, schema: { - type: "integer", + type: 'integer', }, }, - ETag: { + 'ETag': { required: true, content: { - "text/plain": { + 'text/plain': { schema: { - type: "string", + type: 'string', pattern: '^"', }, }, }, }, - Reference: { - $ref: "#/components/headers/ETag", + 'Reference': { + $ref: '#/components/headers/ETag', }, - Style: { + 'Style': { schema: { - type: "array", + type: 'array', }, - style: "simple", + style: 'simple', explode: true, }, }, }, -} satisfies OpenAPIObject; +} 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 index de2ae5a..b7dbdfe 100644 --- a/packages/types/tests/schema-tests-3.1/info-object-example.ts +++ b/packages/types/tests/schema-tests-3.1/info-object-example.ts @@ -1,29 +1,28 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + 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/", + 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", + 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", + name: 'Apache 2.0', + url: 'https://www.apache.org/licenses/LICENSE-2.0.html', }, - version: "1.0.1", + version: '1.0.1', }, externalDocs: { - description: "Find more info here", - url: "https://example.com", + description: 'Find more info here', + url: 'https://example.com', }, components: {}, -} satisfies OpenAPIObject; +} 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 index 3f665cf..a94c48f 100644 --- a/packages/types/tests/schema-tests-3.1/info-summary.ts +++ b/packages/types/tests/schema-tests-3.1/info-summary.ts @@ -1,14 +1,13 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - summary: "My lovely API", - version: "1.0.0", + title: 'API', + summary: 'My lovely API', + version: '1.0.0', }, components: {}, -} satisfies OpenAPIObject; +} 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 index cf97374..a3a2c6c 100644 --- a/packages/types/tests/schema-tests-3.1/json-schema-dialect.ts +++ b/packages/types/tests/schema-tests-3.1/json-schema-dialect.ts @@ -1,28 +1,27 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - summary: "Testing jsonSchemaDialect", - title: "My API", - version: "1.0.0", + summary: 'Testing jsonSchemaDialect', + title: 'My API', + version: '1.0.0', license: { - name: "Apache 2.0", - identifier: "Apache-2.0", + name: 'Apache 2.0', + identifier: 'Apache-2.0', }, }, jsonSchemaDialect: - "https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS", + '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", + $id: 'locked-metaschema', + $schema: 'https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS', }, }, }, paths: {}, -} satisfies OpenAPIObject; +} 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 index e5108ae..1f29468 100644 --- a/packages/types/tests/schema-tests-3.1/license-identifier.ts +++ b/packages/types/tests/schema-tests-3.1/license-identifier.ts @@ -1,18 +1,17 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - summary: "My lovely API", - version: "1.0.0", + title: 'API', + summary: 'My lovely API', + version: '1.0.0', license: { - name: "Apache", - identifier: "Apache-2.0", + name: 'Apache', + identifier: 'Apache-2.0', }, }, components: {}, -} satisfies OpenAPIObject; +} 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 index 0e09af0..c85cda7 100644 --- a/packages/types/tests/schema-tests-3.1/link-object-examples.ts +++ b/packages/types/tests/schema-tests-3.1/link-object-examples.ts @@ -1,39 +1,38 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/users/{id}": { + '/users/{id}': { parameters: [ { - name: "id", - in: "path", + name: 'id', + in: 'path', required: true, - description: "the user identifier, as userId", + description: 'the user identifier, as userId', schema: { - type: "string", + type: 'string', }, }, ], get: { responses: { - "200": { - description: "the user being returned", + 200: { + description: 'the user being returned', content: { - "application/json": { + 'application/json': { schema: { - type: "object", + type: 'object', properties: { uuid: { - type: "string", - format: "uuid", + type: 'string', + format: 'uuid', }, }, }, @@ -41,34 +40,34 @@ export const doc = { }, links: { address: { - operationId: "getUserAddress", + operationId: 'getUserAddress', parameters: { - userid: "$request.path.id", + userid: '$request.path.id', }, }, address2: { - operationId: "getUserAddressByUUID", + operationId: 'getUserAddressByUUID', parameters: { - userUuid: "$response.body#/uuid", + userUuid: '$response.body#/uuid', }, }, UserRepositories: { - operationRef: "#/paths/~12.0~1repositories~1%7Busername%7D/get", + operationRef: '#/paths/~12.0~1repositories~1%7Busername%7D/get', parameters: { - username: "$response.body#/username", + username: '$response.body#/username', }, }, UserRepositories2: { operationRef: - "https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1%7Busername%7D/get", + 'https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1%7Busername%7D/get', parameters: { - username: "$response.body#/username", + username: '$response.body#/username', }, }, withBody: { - operationId: "queryUserWithBody", + operationId: 'queryUserWithBody', requestBody: { - userId: "$request.path.id", + userId: '$request.path.id', }, }, }, @@ -76,26 +75,26 @@ export const doc = { }, }, }, - "/users/{userid}/address": { + '/users/{userid}/address': { parameters: [ { - name: "userid", - in: "path", + name: 'userid', + in: 'path', required: true, - description: "the user identifier, as userId", + description: 'the user identifier, as userId', schema: { - type: "string", + type: 'string', }, }, ], get: { - operationId: "getUserAddress", + operationId: 'getUserAddress', responses: { - "200": { - description: "the user's address", + 200: { + description: 'the user\'s address', }, }, }, }, }, -} satisfies OpenAPIObject; +} 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 index 9e1285f..5f9bc04 100644 --- a/packages/types/tests/schema-tests-3.1/media-type-examples.ts +++ b/packages/types/tests/schema-tests-3.1/media-type-examples.ts @@ -1,17 +1,16 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { examples: { - "frog-example": {}, + 'frog-example': {}, }, schemas: { Address: {}, @@ -19,63 +18,63 @@ export const doc = { }, }, paths: { - "/something": { + '/something': { put: { requestBody: { content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, examples: { cat: { - summary: "An example of a cat", + summary: 'An example of a cat', value: { - name: "Fluffy", - petType: "Cat", - color: "White", - gender: "male", - breed: "Persian", + name: 'Fluffy', + petType: 'Cat', + color: 'White', + gender: 'male', + breed: 'Persian', }, }, dog: { - summary: "An example of a dog with a cat's name", + summary: 'An example of a dog with a cat\'s name', value: { - name: "Puma", - petType: "Dog", - color: "Black", - gender: "Female", - breed: "Mixed", + name: 'Puma', + petType: 'Dog', + color: 'Black', + gender: 'Female', + breed: 'Mixed', }, }, frog: { - $ref: "#/components/examples/frog-example", + $ref: '#/components/examples/frog-example', }, }, }, - "application/xml": { + 'application/xml': { schema: { - type: "object", + type: 'object', properties: { foo: { - type: "string", + type: 'string', xml: { - namespace: "https://example.com", - prefix: "example", - name: "Foo", + namespace: 'https://example.com', + prefix: 'example', + name: 'Foo', }, }, bar: { - type: "array", + type: 'array', items: { - type: "number", + type: 'number', }, xml: { wrapped: true, }, }, attr: { - type: "string", + type: 'string', xml: { attribute: true, }, @@ -83,80 +82,80 @@ export const doc = { }, }, }, - "application/x-www-form-urlencoded": { + 'application/x-www-form-urlencoded': { schema: { - type: "object", + type: 'object', properties: { id: { - type: "string", - format: "uuid", + type: 'string', + format: 'uuid', }, address: { - type: "object", + type: 'object', properties: {}, }, icon: { - type: "string", - contentEncoding: "base64url", + type: 'string', + contentEncoding: 'base64url', }, }, }, encoding: { icon: { - contentType: "image/png, image/jpeg", + contentType: 'image/png, image/jpeg', }, }, }, - "multipart/form-data": { + 'multipart/form-data': { schema: { - type: "object", + type: 'object', properties: { id: { - type: "string", - format: "uuid", + type: 'string', + format: 'uuid', }, addresses: { - description: "addresses in XML format", - type: "array", + description: 'addresses in XML format', + type: 'array', items: { - $ref: "#/components/schemas/Address", + $ref: '#/components/schemas/Address', }, }, profileImage: { - type: "string", - format: "binary", + type: 'string', + format: 'binary', }, forCoverage: { - type: "string", + type: 'string', }, forCoverage2: { - type: "string", + type: 'string', }, }, }, encoding: { addresses: { - contentType: "application/xml; charset=utf-8", + contentType: 'application/xml; charset=utf-8', }, profileImage: { - contentType: "image/png, image/jpeg", + contentType: 'image/png, image/jpeg', headers: { - "X-Rate-Limit-Limit": { + 'X-Rate-Limit-Limit': { description: - "The number of allowed requests in the current period", + 'The number of allowed requests in the current period', schema: { - type: "integer", + type: 'integer', }, }, }, }, forCoverage: { - style: "form", + style: 'form', explode: false, allowReserved: true, }, forCoverage2: { - style: "spaceDelimited", + style: 'spaceDelimited', explode: true, }, }, @@ -166,4 +165,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/schema-tests-3.1/mega.ts b/packages/types/tests/schema-tests-3.1/mega.ts index 62b7d70..793743b 100644 --- a/packages/types/tests/schema-tests-3.1/mega.ts +++ b/packages/types/tests/schema-tests-3.1/mega.ts @@ -1,45 +1,44 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - summary: "My API's summary", - title: "My API", - version: "1.0.0", + summary: 'My API\'s summary', + title: 'My API', + version: '1.0.0', license: { - name: "Apache 2.0", - identifier: "Apache-2.0", + name: 'Apache 2.0', + identifier: 'Apache-2.0', }, }, paths: { - "/": { + '/': { get: { parameters: [], }, }, - "/{pathTest}": {}, + '/{pathTest}': {}, }, webhooks: { myWebhook: { - $ref: "#/components/pathItems/myPathItem", - description: "Overriding description", + $ref: '#/components/pathItems/myPathItem', + description: 'Overriding description', }, }, components: { securitySchemes: { mtls: { - type: "mutualTLS", + type: 'mutualTLS', }, }, schemas: { Foo: { - type: "object", + type: 'object', properties: { type: { - const: "foo", + const: 'foo', }, }, }, @@ -50,43 +49,43 @@ export const doc = { requestBody: { required: true, content: { - "application/json": { + 'application/json': { schema: { externalDocs: { - description: "More docs!", - url: "https://example.com/elsewhere.html", + description: 'More docs!', + url: 'https://example.com/elsewhere.html', }, - type: "object", + type: 'object', properties: { type: { - type: "string", + type: 'string', }, int: { - type: "integer", + type: 'integer', exclusiveMaximum: 100, exclusiveMinimum: 0, }, none: { - type: "null", + type: 'null', }, arr: { - type: "array", - $comment: "Array without items keyword", + type: 'array', + $comment: 'Array without items keyword', }, either: { - type: ["string", "null"], + type: ['string', 'null'], }, }, discriminator: { - propertyName: "type", - mapping: { - foo: "Foo", + 'propertyName': 'type', + 'mapping': { + foo: 'Foo', }, - "x-extension": true, + 'x-extension': true, }, anyOf: [ { - $ref: "#/components/schemas/Foo", + $ref: '#/components/schemas/Foo', }, ], myArbitraryKeyword: true, @@ -98,4 +97,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} 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 index f977f1e..6632b0f 100644 --- a/packages/types/tests/schema-tests-3.1/minimal-comp.ts +++ b/packages/types/tests/schema-tests-3.1/minimal-comp.ts @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: {}, -} satisfies OpenAPIObject; +} 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 index 1ef2a62..8d2c69e 100644 --- a/packages/types/tests/schema-tests-3.1/minimal-hooks.ts +++ b/packages/types/tests/schema-tests-3.1/minimal-hooks.ts @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, webhooks: {}, -} satisfies OpenAPIObject; +} 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 index 8c97109..1c0e7d2 100644 --- a/packages/types/tests/schema-tests-3.1/minimal-paths.ts +++ b/packages/types/tests/schema-tests-3.1/minimal-paths.ts @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: {}, -} satisfies OpenAPIObject; +} 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 index 9f960bd..f70dc57 100644 --- a/packages/types/tests/schema-tests-3.1/non-oauth-scopes.ts +++ b/packages/types/tests/schema-tests-3.1/non-oauth-scopes.ts @@ -1,20 +1,19 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "Non-oAuth Scopes example", - version: "1.0.0", + title: 'Non-oAuth Scopes example', + version: '1.0.0', }, paths: { - "/users": { + '/users': { get: { security: [ { - bearerAuth: ["read:users", "public"], + bearerAuth: ['read:users', 'public'], }, ], }, @@ -23,12 +22,12 @@ export const doc = { components: { securitySchemes: { bearerAuth: { - type: "http", - scheme: "bearer", - bearerFormat: "jwt", + type: 'http', + scheme: 'bearer', + bearerFormat: 'jwt', description: - "note: non-oauth scopes are not defined at the securityScheme level", + 'note: non-oauth scopes are not defined at the securityScheme level', }, }, }, -} satisfies OpenAPIObject; +} 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 index 15fb000..5b16d34 100644 --- a/packages/types/tests/schema-tests-3.1/operation-object-example.ts +++ b/packages/types/tests/schema-tests-3.1/operation-object-example.ts @@ -1,73 +1,72 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/pets/{id}": { + '/pets/{id}': { put: { - tags: ["pet"], - summary: "Updates a pet in the store with form data", - operationId: "updatePetWithForm", + 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", + name: 'petId', + in: 'path', + description: 'ID of pet that needs to be updated', required: true, schema: { - type: "string", + type: 'string', }, }, ], requestBody: { content: { - "application/x-www-form-urlencoded": { + 'application/x-www-form-urlencoded': { schema: { - type: "object", + type: 'object', properties: { name: { - description: "Updated name of the pet", - type: "string", + description: 'Updated name of the pet', + type: 'string', }, status: { - description: "Updated status of the pet", - type: "string", + description: 'Updated status of the pet', + type: 'string', }, }, - required: ["status"], + required: ['status'], }, }, }, }, responses: { - "200": { - description: "Pet updated.", + 200: { + description: 'Pet updated.', content: { - "application/json": {}, - "application/xml": {}, + 'application/json': {}, + 'application/xml': {}, }, }, - "405": { - description: "Method Not Allowed", + 405: { + description: 'Method Not Allowed', content: { - "application/json": {}, - "application/xml": {}, + 'application/json': {}, + 'application/xml': {}, }, }, }, security: [ { - petstore_auth: ["write:pets", "read:pets"], + petstore_auth: ['write:pets', 'read:pets'], }, ], }, }, }, -} satisfies OpenAPIObject; +} 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 index bf3a1c1..86337a7 100644 --- a/packages/types/tests/schema-tests-3.1/parameter-object-examples.ts +++ b/packages/types/tests/schema-tests-3.1/parameter-object-examples.ts @@ -1,81 +1,80 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/user/{username}": { + '/user/{username}': { parameters: [ { - name: "token", - in: "header", - description: "token to be passed as a header", + name: 'token', + in: 'header', + description: 'token to be passed as a header', required: true, explode: false, schema: { - type: "array", + type: 'array', items: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, }, - style: "simple", + style: 'simple', }, { - name: "usernames", - in: "path", - description: "usernames to fetch", + name: 'usernames', + in: 'path', + description: 'usernames to fetch', required: true, explode: false, schema: { - type: "array", + type: 'array', }, }, { - name: "id", - in: "query", - description: "IDs of the object to fetch", + name: 'id', + in: 'query', + description: 'IDs of the object to fetch', required: false, schema: { - type: "array", + type: 'array', items: { - type: "string", + type: 'string', }, }, - style: "form", + style: 'form', explode: true, }, { - in: "query", - name: "freeForm", + in: 'query', + name: 'freeForm', schema: { - type: "object", + type: 'object', additionalProperties: { - type: "integer", + type: 'integer', }, }, - style: "form", + style: 'form', }, { - in: "query", - name: "coordinates", + in: 'query', + name: 'coordinates', content: { - "application/json": { + 'application/json': { schema: { - type: "object", - required: ["lat", "long"], + type: 'object', + required: ['lat', 'long'], properties: { lat: { - type: "number", + type: 'number', }, long: { - type: "number", + type: 'number', }, }, }, @@ -83,13 +82,13 @@ export const doc = { }, }, { - in: "cookie", - name: "my_cookie1", - style: "form", + in: 'cookie', + name: 'my_cookie1', + style: 'form', explode: false, schema: {}, }, ], }, }, -} satisfies OpenAPIObject; +} 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 index 6a299d0..c9805e5 100644 --- 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 @@ -1,22 +1,21 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "allowReserved only permitted with in: query", - version: "1.0.0", + title: 'allowReserved only permitted with in: query', + version: '1.0.0', }, components: { parameters: { my_query: { - name: "my_query", - in: "query", + name: 'my_query', + in: 'query', allowReserved: true, schema: {}, }, }, }, -} satisfies OpenAPIObject; +} 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 index 935e974..27af38b 100644 --- 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 @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { schemas: { @@ -16,31 +15,31 @@ export const doc = { }, }, paths: { - "/pets/{id}": { + '/pets/{id}': { get: { - description: "Returns pets based on ID", - summary: "Find pets by ID", - operationId: "getPetsById", + description: 'Returns pets based on ID', + summary: 'Find pets by ID', + operationId: 'getPetsById', responses: { - "200": { - description: "pet response", + 200: { + description: 'pet response', content: { - "*/*": { + '*/*': { schema: { - type: "array", + type: 'array', items: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, }, }, default: { - description: "error payload", + description: 'error payload', content: { - "text/html": { + 'text/html': { schema: { - $ref: "#/components/schemas/ErrorModel", + $ref: '#/components/schemas/ErrorModel', }, }, }, @@ -49,19 +48,19 @@ export const doc = { }, parameters: [ { - name: "id", - in: "path", - description: "ID of pet to use", + name: 'id', + in: 'path', + description: 'ID of pet to use', required: true, schema: { - type: "array", + type: 'array', items: { - type: "string", + type: 'string', }, }, - style: "simple", + style: 'simple', }, ], }, }, -} satisfies OpenAPIObject; +} 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 index f9acb78..d4dd68d 100644 --- 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 @@ -1,80 +1,79 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/things": { - summary: "Lots of things", + '/things': { + summary: 'Lots of things', servers: [ { - url: "https://things.example.com", + url: 'https://things.example.com', }, ], get: { - summary: "Get a list of things", + summary: 'Get a list of things', externalDocs: { - description: "Find more info here", - url: "https://example.com", + 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", + $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", + description: 'A list of things', }, }, servers: [ { - url: "https://things.example.com", + url: 'https://things.example.com', }, ], }, post: { deprecated: false, requestBody: { - $ref: "#/components/requestBodies/ThingRequestBody", + $ref: '#/components/requestBodies/ThingRequestBody', }, responses: { - "201": { - $ref: "#/components/responses/ThingResponse", + 201: { + $ref: '#/components/responses/ThingResponse', }, }, callbacks: { myCallback: { - "{$request.query.queryUrl}": { + '{$request.query.queryUrl}': { post: { requestBody: { - description: "Callback payload", + description: 'Callback payload', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/SomePayload", + $ref: '#/components/schemas/SomePayload', }, }, }, }, responses: { - "200": { - description: "callback successfully processed", + 200: { + description: 'callback successfully processed', }, }, }, }, }, transactionCallback: { - $ref: "#/components/callbacks/transactionCallback", + $ref: '#/components/callbacks/transactionCallback', }, }, }, @@ -88,22 +87,22 @@ export const doc = { components: { callbacks: { transactionCallback: { - "http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}": + 'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}': { post: { requestBody: { - description: "Callback payload", + description: 'Callback payload', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/SomePayload", + $ref: '#/components/schemas/SomePayload', }, }, }, }, responses: { - "200": { - description: "callback successfully processed", + 200: { + description: 'callback successfully processed', }, }, }, @@ -112,58 +111,58 @@ export const doc = { }, examples: { ThingExample: { - summary: "A thing", - description: "A thing", + summary: 'A thing', + description: 'A thing', value: { id: 1, - name: "Thing", + name: 'Thing', }, }, }, links: { ThingLink: { - description: "A link to a thing", - operationId: "getThing", + description: 'A link to a thing', + operationId: 'getThing', parameters: { - thingId: "$response.body#/id", + thingId: '$response.body#/id', }, server: { - url: "https://things.example.com", + url: 'https://things.example.com', }, }, ThingyLink: { - $ref: "#/components/links/ThingLink", + $ref: '#/components/links/ThingLink', }, }, parameters: { limit: { - name: "limit", - in: "query", + name: 'limit', + in: 'query', required: false, allowEmptyValue: false, allowReserved: false, deprecated: true, - description: "The maximum number of list items to return", + description: 'The maximum number of list items to return', schema: { - type: "integer", + type: 'integer', minimum: 0, }, }, biscuit: { - name: "biscuit", - in: "cookie", - style: "form", + name: 'biscuit', + in: 'cookie', + style: 'form', schema: { - type: "string", + type: 'string', }, }, }, requestBodies: { ThingRequestBody: { content: { - "application/json": { + 'application/json': { schema: { - type: "object", + type: 'object', }, }, }, @@ -171,11 +170,11 @@ export const doc = { }, responses: { ThingResponse: { - description: "A thing", + description: 'A thing', content: { - "application/json": { + 'application/json': { schema: { - type: "object", + type: 'object', }, }, }, @@ -185,4 +184,4 @@ export const doc = { SomePayload: {}, }, }, -} satisfies OpenAPIObject; +} 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 index 7a28436..77a4ae4 100644 --- a/packages/types/tests/schema-tests-3.1/path-no-response.ts +++ b/packages/types/tests/schema-tests-3.1/path-no-response.ts @@ -1,17 +1,16 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/": { + '/': { get: {}, }, }, -} satisfies OpenAPIObject; +} 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 index 9c3b6ff..af62c1b 100644 --- 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 @@ -1,15 +1,14 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/{var}": {}, + '/{var}': {}, }, -} satisfies OpenAPIObject; +} 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 index 53864c5..bf16d12 100644 --- a/packages/types/tests/schema-tests-3.1/paths-object-example.ts +++ b/packages/types/tests/schema-tests-3.1/paths-object-example.ts @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { schemas: { @@ -15,19 +14,19 @@ export const doc = { }, }, paths: { - "/pets": { + '/pets': { get: { description: - "Returns all pets from the system that the user has access to", + 'Returns all pets from the system that the user has access to', responses: { - "200": { - description: "A list of pets.", + 200: { + description: 'A list of pets.', content: { - "application/json": { + 'application/json': { schema: { - type: "array", + type: 'array', items: { - $ref: "#/components/schemas/pet", + $ref: '#/components/schemas/pet', }, }, }, @@ -37,4 +36,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} 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 index 6c89808..521108e 100644 --- a/packages/types/tests/schema-tests-3.1/request-body-examples.ts +++ b/packages/types/tests/schema-tests-3.1/request-body-examples.ts @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { schemas: { @@ -15,47 +14,47 @@ export const doc = { }, }, paths: { - "/something": { + '/something': { put: { requestBody: { - description: "user to add to the system", + description: 'user to add to the system', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/User", + $ref: '#/components/schemas/User', }, examples: { user: { - summary: "User example", - externalValue: "https://foo.bar/examples/user-example.json", + summary: 'User example', + externalValue: 'https://foo.bar/examples/user-example.json', }, }, }, - "application/xml": { + 'application/xml': { schema: { - $ref: "#/components/schemas/User", + $ref: '#/components/schemas/User', }, examples: { user: { - summary: "User example in XML", - externalValue: "https://foo.bar/examples/user-example.xml", + summary: 'User example in XML', + externalValue: 'https://foo.bar/examples/user-example.xml', }, }, }, - "text/plain": { + 'text/plain': { examples: { user: { - summary: "User example in plain text", - externalValue: "https://foo.bar/examples/user-example.txt", + summary: 'User example in plain text', + externalValue: 'https://foo.bar/examples/user-example.txt', }, }, }, - "*/*": { + '*/*': { examples: { user: { - summary: "User example in other format", + summary: 'User example in other format', externalValue: - "https://foo.bar/examples/user-example.whatever", + 'https://foo.bar/examples/user-example.whatever', }, }, }, @@ -64,4 +63,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} 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 index 2102a8f..868a911 100644 --- a/packages/types/tests/schema-tests-3.1/response-object-examples.ts +++ b/packages/types/tests/schema-tests-3.1/response-object-examples.ts @@ -1,77 +1,76 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { responses: { - "complex-object-array": { - description: "A complex object array response", + 'complex-object-array': { + description: 'A complex object array response', content: { - "application/json": { + 'application/json': { schema: { - type: "array", + type: 'array', items: { - $ref: "#/components/schemas/VeryComplexType", + $ref: '#/components/schemas/VeryComplexType', }, }, }, }, }, - "simple-string": { - description: "A simple string response", + 'simple-string': { + description: 'A simple string response', content: { - "text/plain": { + 'text/plain': { schema: { - type: "string", + type: 'string', }, }, }, }, - "plain-text-with-headers": { - description: "A simple string response", + 'plain-text-with-headers': { + description: 'A simple string response', content: { - "text/plain": { + 'text/plain': { schema: { - type: "string", + type: 'string', }, - example: "whoa!", + example: 'whoa!', }, }, headers: { - "X-Rate-Limit-Limit": { - description: "The number of allowed requests in the current period", + 'X-Rate-Limit-Limit': { + description: 'The number of allowed requests in the current period', schema: { - type: "integer", + type: 'integer', }, }, - "X-Rate-Limit-Remaining": { + 'X-Rate-Limit-Remaining': { description: - "The number of remaining requests in the current period", + 'The number of remaining requests in the current period', schema: { - type: "integer", + type: 'integer', }, }, - "X-Rate-Limit-Reset": { - description: "The number of seconds left in the current period", + 'X-Rate-Limit-Reset': { + description: 'The number of seconds left in the current period', schema: { - type: "integer", + type: 'integer', }, }, }, }, - "no-return-value": { - description: "object created", + 'no-return-value': { + description: 'object created', }, }, schemas: { VeryComplexType: {}, }, }, -} satisfies OpenAPIObject; +} 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 index 5e751d7..e89318a 100644 --- 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 @@ -1,22 +1,21 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/user": { + '/user': { parameters: [ { - in: "query", - name: "example", + in: 'query', + name: 'example', schema: { - type: "object", + type: 'object', example: { numbers: [1, 2], flag: null, @@ -26,4 +25,4 @@ export const doc = { ], }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/schema-tests-3.1/schema.ts b/packages/types/tests/schema-tests-3.1/schema.ts index 07e655d..2bf1815 100644 --- a/packages/types/tests/schema-tests-3.1/schema.ts +++ b/packages/types/tests/schema-tests-3.1/schema.ts @@ -1,70 +1,69 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: {}, components: { schemas: { model: { - type: "object", + type: 'object', properties: { one: { - description: "type array", - type: ["integer", "string"], + description: 'type array', + type: ['integer', 'string'], }, two: { - description: "type 'null'", - type: "null", + description: 'type \'null\'', + type: 'null', }, three: { - description: "type array including 'null'", - type: ["string", "null"], + description: 'type array including \'null\'', + type: ['string', 'null'], }, four: { - description: "array with no items", - type: "array", + description: 'array with no items', + type: 'array', }, five: { - description: "singular example", - type: "string", - examples: ["exampleValue"], + description: 'singular example', + type: 'string', + examples: ['exampleValue'], }, six: { - description: "exclusiveMinimum true", + description: 'exclusiveMinimum true', exclusiveMinimum: 10, }, seven: { - description: "exclusiveMinimum false", + description: 'exclusiveMinimum false', minimum: 10, }, eight: { - description: "exclusiveMaximum true", + description: 'exclusiveMaximum true', exclusiveMaximum: 20, }, nine: { - description: "exclusiveMaximum false", + description: 'exclusiveMaximum false', maximum: 20, }, ten: { - description: "nullable string", - type: ["string", "null"], + description: 'nullable string', + type: ['string', 'null'], }, eleven: { - description: "x-nullable string", - type: ["string", "null"], + description: 'x-nullable string', + type: ['string', 'null'], }, twelve: { - description: "file/binary", + description: 'file/binary', }, }, }, }, }, -} satisfies OpenAPIObject; +} 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 index a847984..45617b8 100644 --- 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 @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, security: [ { @@ -17,78 +16,78 @@ export const doc = { apiKey: [], }, { - "JWT-bearer": [], + 'JWT-bearer': [], }, { mutualTLS: [], }, { - OAuth2: ["write:pets", "read:pets"], + OAuth2: ['write:pets', 'read:pets'], }, ], components: { securitySchemes: { - basic: { - type: "http", - scheme: "basic", + 'basic': { + type: 'http', + scheme: 'basic', }, - apiKey: { - type: "apiKey", - name: "api-key", - in: "header", + 'apiKey': { + type: 'apiKey', + name: 'api-key', + in: 'header', }, - "JWT-bearer": { - type: "http", - scheme: "bearer", - bearerFormat: "JWT", + 'JWT-bearer': { + type: 'http', + scheme: 'bearer', + bearerFormat: 'JWT', }, - mutualTLS: { - type: "mutualTLS", - description: "Cert must be signed by example.com CA", + 'mutualTLS': { + type: 'mutualTLS', + description: 'Cert must be signed by example.com CA', }, - OAuth2: { - type: "oauth2", + 'OAuth2': { + type: 'oauth2', flows: { implicit: { - authorizationUrl: "https://example.com/api/oauth/dialog", + authorizationUrl: 'https://example.com/api/oauth/dialog', scopes: { - "write:pets": "modify pets in your account", - "read:pets": "read your pets", + 'write:pets': 'modify pets in your account', + 'read:pets': 'read your pets', }, - refreshUrl: "https://example.com/api/oauth/refresh", + 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", + 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", + 'write:pets': 'modify pets in your account', + 'read:pets': 'read your pets', }, }, password: { - tokenUrl: "https://example.com/api/oauth/token", + tokenUrl: 'https://example.com/api/oauth/token', scopes: { - "read:pets": "read your pets", + 'read:pets': 'read your pets', }, - refreshUrl: "https://example.com/api/oauth/refresh", + refreshUrl: 'https://example.com/api/oauth/refresh', }, clientCredentials: { - tokenUrl: "https://example.com/api/oauth/token", + tokenUrl: 'https://example.com/api/oauth/token', scopes: { - "read:pets": "read your pets", + 'read:pets': 'read your pets', }, - refreshUrl: "https://example.com/api/oauth/refresh", + refreshUrl: 'https://example.com/api/oauth/refresh', }, }, }, - OpenIdConnect: { - type: "openIdConnect", - openIdConnectUrl: "https://example.com/api/oauth/openid", + 'OpenIdConnect': { + type: 'openIdConnect', + openIdConnectUrl: 'https://example.com/api/oauth/openid', }, - external: { - $ref: "https://example.com/api/openapi.json#/components/externalDocs/ThingExternalDocs", + 'external': { + $ref: 'https://example.com/api/openapi.json#/components/externalDocs/ThingExternalDocs', }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/schema-tests-3.1/servers.ts b/packages/types/tests/schema-tests-3.1/servers.ts index 8c5fad4..2d73479 100644 --- a/packages/types/tests/schema-tests-3.1/servers.ts +++ b/packages/types/tests/schema-tests-3.1/servers.ts @@ -1,41 +1,40 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: {}, servers: [ { - url: "/v1", - description: "Run locally.", + url: '/v1', + description: 'Run locally.', }, { - url: "https://production.com/v1", - description: "Run on production server.", + url: 'https://production.com/v1', + description: 'Run on production server.', }, { - url: "https://{username}.gigantic-server.com:{port}/{basePath}", - description: "The production API server", + url: 'https://{username}.gigantic-server.com:{port}/{basePath}', + description: 'The production API server', variables: { username: { - default: "demo", + default: 'demo', description: - "A user-specific subdomain. Use `demo` for a free sandbox environment.", + 'A user-specific subdomain. Use `demo` for a free sandbox environment.', }, port: { - enum: ["8443", "443"], - default: "8443", + enum: ['8443', '443'], + default: '8443', }, basePath: { - default: "v2", + default: 'v2', }, }, }, ], -} satisfies OpenAPIObject; +} 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 index 35adee3..2622e38 100644 --- a/packages/types/tests/schema-tests-3.1/specification-extensions.ts +++ b/packages/types/tests/schema-tests-3.1/specification-extensions.ts @@ -1,14 +1,13 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", - info: { - title: "API", - version: "1.0.0", + 'openapi': '3.1.0', + 'info': { + title: 'API', + version: '1.0.0', }, - paths: {}, - "x-tensions": "specification extensions are prefixed with `x-`", -} satisfies OpenAPIObject; + '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 index 0d33729..e6d1515 100644 --- a/packages/types/tests/schema-tests-3.1/style-defaults.ts +++ b/packages/types/tests/schema-tests-3.1/style-defaults.ts @@ -1,154 +1,153 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { title: - "various permutations of parameter objects, with non-required values left to their defaults", - version: "1.0.0", + '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", + 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", + '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", + 'x-comment': + 'expecting defaults: explode=true, allowReserved=false', + 'style': 'form', }, style_spaceDelimited: { - "x-comment": - "expecting defaults: explode=false, allowReserved=false", - style: "spaceDelimited", + 'x-comment': + 'expecting defaults: explode=false, allowReserved=false', + 'style': 'spaceDelimited', }, explode: { - "x-comment": - "expecting defaults: style=form, allowReserved=false", - explode: false, + 'x-comment': + 'expecting defaults: style=form, allowReserved=false', + 'explode': false, }, allowReserved: { - "x-comment": "expecting default: style=form, explode=true", - allowReserved: true, + '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/*": { + '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: {}, + '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: {}, + '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: {}, + '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/*": { + '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: {}, + '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: {}, + '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: {}, + '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: {}, + '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: {}, + '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/*": { + '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: {}, + 'x-comment': + 'expecting defaults: required=false, deprecated=false, style=form, explode=true, allowReserved=false', + 'name': 'cookie_form', + 'in': 'cookie', + 'schema': {}, }, }, }, -} satisfies OpenAPIObject; +} 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 index 5016661..22f55a5 100644 --- a/packages/types/tests/schema-tests-3.1/tag-object-example.ts +++ b/packages/types/tests/schema-tests-3.1/tag-object-example.ts @@ -1,27 +1,26 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: {}, tags: [ { - name: "pet", - description: "Pets operations", + name: 'pet', + description: 'Pets operations', }, { - name: "external", - description: "Operations available to external consumers", + name: 'external', + description: 'Operations available to external consumers', externalDocs: { - description: "Find more info here", - url: "https://example.com", + description: 'Find more info here', + url: 'https://example.com', }, }, ], -} satisfies OpenAPIObject; +} 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 index 4063f1b..c002639 100644 --- a/packages/types/tests/schema-tests-3.1/valid-schema-types.ts +++ b/packages/types/tests/schema-tests-3.1/valid-schema-types.ts @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.1", + openapi: '3.1.1', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { schemas: { @@ -19,4 +18,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} 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 index 3818956..b0ba75e 100644 --- a/packages/types/tests/schema-tests-3.1/webhook-example.ts +++ b/packages/types/tests/schema-tests-3.1/webhook-example.ts @@ -1,31 +1,30 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.1' export const doc = { - openapi: "3.1.0", + openapi: '3.1.0', info: { - title: "Webhook Example", - version: "1.0.0", + title: 'Webhook Example', + version: '1.0.0', }, webhooks: { newPet: { post: { requestBody: { - description: "Information about a new pet in the system", + description: 'Information about a new pet in the system', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, }, responses: { - "200": { + 200: { description: - "Return a 200 status to indicate that the data was received successfully", + 'Return a 200 status to indicate that the data was received successfully', }, }, }, @@ -34,20 +33,20 @@ export const doc = { components: { schemas: { Pet: { - required: ["id", "name"], + required: ['id', 'name'], properties: { id: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, name: { - type: "string", + type: 'string', }, tag: { - type: "string", + type: 'string', }, }, }, }, }, -} satisfies OpenAPIObject; +} 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 index 4ad9f8a..5e4d7fa 100644 --- a/packages/types/tests/schema-tests-3.2/callback-object-examples.ts +++ b/packages/types/tests/schema-tests-3.2/callback-object-examples.ts @@ -1,54 +1,53 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { callbacks: { myCallback: { - "{$request.query.queryUrl}": { + '{$request.query.queryUrl}': { post: { requestBody: { - description: "Callback payload", + description: 'Callback payload', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/SomePayload", + $ref: '#/components/schemas/SomePayload', }, }, }, }, responses: { - "200": { - description: "callback successfully processed", + 200: { + description: 'callback successfully processed', }, }, }, }, }, transactionCallback: { - "http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}": + 'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}': { post: { requestBody: { - description: "Callback payload", + description: 'Callback payload', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/SomePayload", + $ref: '#/components/schemas/SomePayload', }, }, }, }, responses: { - "200": { - description: "callback successfully processed", + 200: { + description: 'callback successfully processed', }, }, }, @@ -59,4 +58,4 @@ export const doc = { SomePayload: {}, }, }, -} satisfies OpenAPIObject; +} 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 index 5d7cf8e..213957d 100644 --- a/packages/types/tests/schema-tests-3.2/comp-pathitems.ts +++ b/packages/types/tests/schema-tests-3.2/comp-pathitems.ts @@ -1,15 +1,14 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { pathItems: {}, }, -} satisfies OpenAPIObject; +} 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 index eb773ca..f4f3472 100644 --- a/packages/types/tests/schema-tests-3.2/components-object-example.ts +++ b/packages/types/tests/schema-tests-3.2/components-object-example.ts @@ -1,88 +1,87 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { schemas: { GeneralError: { - type: "object", + type: 'object', properties: { code: { - type: "integer", - format: "int32", + type: 'integer', + format: 'int32', }, message: { - type: "string", + type: 'string', }, }, }, Category: { - type: "object", + type: 'object', properties: { id: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, name: { - type: "string", + type: 'string', }, }, }, Tag: { - type: "object", + type: 'object', properties: { id: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, name: { - type: "string", + type: 'string', }, }, }, }, parameters: { skipParam: { - name: "skip", - in: "query", - description: "number of items to skip", + name: 'skip', + in: 'query', + description: 'number of items to skip', required: true, schema: { - type: "integer", - format: "int32", + type: 'integer', + format: 'int32', }, }, limitParam: { - name: "limit", - in: "query", - description: "max records to return", + name: 'limit', + in: 'query', + description: 'max records to return', required: true, schema: { - type: "integer", - format: "int32", + type: 'integer', + format: 'int32', }, }, }, responses: { NotFound: { - description: "Entity not found.", + description: 'Entity not found.', }, IllegalInput: { - description: "Illegal input for operation.", + description: 'Illegal input for operation.', }, GeneralError: { - description: "General Error", + description: 'General Error', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/GeneralError", + $ref: '#/components/schemas/GeneralError', }, }, }, @@ -90,22 +89,22 @@ export const doc = { }, securitySchemes: { api_key: { - type: "apiKey", - name: "api-key", - in: "header", + type: 'apiKey', + name: 'api-key', + in: 'header', }, petstore_auth: { - type: "oauth2", + type: 'oauth2', flows: { implicit: { - authorizationUrl: "https://example.org/api/oauth/dialog", + authorizationUrl: 'https://example.org/api/oauth/dialog', scopes: { - "write:pets": "modify pets in your account", - "read:pets": "read your pets", + 'write:pets': 'modify pets in your account', + 'read:pets': 'read your pets', }, }, }, }, }, }, -} satisfies OpenAPIObject; +} 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 index 349b2b4..0e0c3aa 100644 --- a/packages/types/tests/schema-tests-3.2/example-object-examples.ts +++ b/packages/types/tests/schema-tests-3.2/example-object-examples.ts @@ -1,59 +1,58 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { examples: { - "zip-example": {}, - "confirmation-success": {}, + 'zip-example': {}, + 'confirmation-success': {}, }, schemas: { SuccessResponse: {}, Address: {}, }, requestBodies: { - "with-example": { + 'with-example': { content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Address", + $ref: '#/components/schemas/Address', }, examples: { foo: { - summary: "A foo example", + summary: 'A foo example', value: { - foo: "bar", + foo: 'bar', }, }, bar: { - summary: "A bar example", + summary: 'A bar example', value: { - bar: "baz", + bar: 'baz', }, }, }, }, - "application/xml": { + 'application/xml': { examples: { xmlExample: { - summary: "This is an example in XML", + summary: 'This is an example in XML', externalValue: - "https://example.org/examples/address-example.xml", + 'https://example.org/examples/address-example.xml', }, }, }, - "text/plain": { + 'text/plain': { examples: { textExample: { - summary: "This is a text example", - externalValue: "https://foo.bar/examples/address-example.txt", + summary: 'This is a text example', + externalValue: 'https://foo.bar/examples/address-example.txt', }, }, }, @@ -61,53 +60,53 @@ export const doc = { }, }, parameters: { - "with-example": { - name: "zipCode", - in: "query", + 'with-example': { + name: 'zipCode', + in: 'query', schema: { - type: "string", - format: "zip-code", + type: 'string', + format: 'zip-code', }, examples: { - "zip-example": { - $ref: "#/components/examples/zip-example", + 'zip-example': { + $ref: '#/components/examples/zip-example', }, }, }, }, responses: { - "200": { - description: "your car appointment has been booked", + 200: { + description: 'your car appointment has been booked', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/SuccessResponse", + $ref: '#/components/schemas/SuccessResponse', }, examples: { - "confirmation-success": { - $ref: "#/components/examples/confirmation-success", + 'confirmation-success': { + $ref: '#/components/examples/confirmation-success', }, }, }, - "application/x-www-form-urlencoded": { + 'application/x-www-form-urlencoded': { schema: { - type: "object", + type: 'object', properties: { jsonValue: { - type: "string", + type: 'string', }, }, }, encoding: { jsonValue: { - contentType: "application/json", + contentType: 'application/json', }, }, examples: { jsonFormValue: { description: 'The JSON string "json" as a form value', - dataValue: "json", - serializedValue: "jsonValue=%22json%22", + dataValue: 'json', + serializedValue: 'jsonValue=%22json%22', }, }, }, @@ -115,4 +114,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} 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 index 3754a7c..53dedcf 100644 --- a/packages/types/tests/schema-tests-3.2/header-object-examples.ts +++ b/packages/types/tests/schema-tests-3.2/header-object-examples.ts @@ -1,44 +1,43 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { headers: { - "X-Rate-Limit-Limit": { - description: "The number of allowed requests in the current period", + 'X-Rate-Limit-Limit': { + description: 'The number of allowed requests in the current period', deprecated: false, schema: { - type: "integer", + type: 'integer', }, }, - ETag: { + 'ETag': { required: true, content: { - "text/plain": { + 'text/plain': { schema: { - type: "string", + type: 'string', pattern: '^"', }, }, }, }, - Reference: { - $ref: "#/components/headers/ETag", + 'Reference': { + $ref: '#/components/headers/ETag', }, - Style: { + 'Style': { schema: { - type: "array", + type: 'array', }, - style: "simple", + style: 'simple', explode: true, }, }, }, -} satisfies OpenAPIObject; +} 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 index 96258dd..e0905e3 100644 --- a/packages/types/tests/schema-tests-3.2/info-object-example.ts +++ b/packages/types/tests/schema-tests-3.2/info-object-example.ts @@ -1,30 +1,29 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", - $self: "https://example.com/openapi", + 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/", + 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", + 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", + name: 'Apache 2.0', + url: 'https://www.apache.org/licenses/LICENSE-2.0.html', }, - version: "1.0.1", + version: '1.0.1', }, externalDocs: { - description: "Find more info here", - url: "https://example.com", + description: 'Find more info here', + url: 'https://example.com', }, components: {}, -} satisfies OpenAPIObject; +} 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 index fb15a28..4abbece 100644 --- a/packages/types/tests/schema-tests-3.2/info-summary.ts +++ b/packages/types/tests/schema-tests-3.2/info-summary.ts @@ -1,14 +1,13 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - summary: "My lovely API", - version: "1.0.0", + title: 'API', + summary: 'My lovely API', + version: '1.0.0', }, components: {}, -} satisfies OpenAPIObject; +} 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 index e8a3156..76f25d7 100644 --- a/packages/types/tests/schema-tests-3.2/json-schema-dialect.ts +++ b/packages/types/tests/schema-tests-3.2/json-schema-dialect.ts @@ -1,28 +1,27 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - summary: "Testing jsonSchemaDialect", - title: "My API", - version: "1.0.0", + summary: 'Testing jsonSchemaDialect', + title: 'My API', + version: '1.0.0', license: { - name: "Apache 2.0", - identifier: "Apache-2.0", + name: 'Apache 2.0', + identifier: 'Apache-2.0', }, }, jsonSchemaDialect: - "https://spec.openapis.org/oas/3.2/dialect/WORK-IN-PROGRESS", + '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", + $id: 'locked-metaschema', + $schema: 'https://spec.openapis.org/oas/3.2/dialect/WORK-IN-PROGRESS', }, }, }, paths: {}, -} satisfies OpenAPIObject; +} 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 index ea56da4..ea3f094 100644 --- a/packages/types/tests/schema-tests-3.2/license-identifier.ts +++ b/packages/types/tests/schema-tests-3.2/license-identifier.ts @@ -1,18 +1,17 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - summary: "My lovely API", - version: "1.0.0", + title: 'API', + summary: 'My lovely API', + version: '1.0.0', license: { - name: "Apache", - identifier: "Apache-2.0", + name: 'Apache', + identifier: 'Apache-2.0', }, }, components: {}, -} satisfies OpenAPIObject; +} 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 index a979aa9..70dc752 100644 --- a/packages/types/tests/schema-tests-3.2/link-object-examples.ts +++ b/packages/types/tests/schema-tests-3.2/link-object-examples.ts @@ -1,39 +1,38 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/users/{id}": { + '/users/{id}': { parameters: [ { - name: "id", - in: "path", + name: 'id', + in: 'path', required: true, - description: "the user identifier, as userId", + description: 'the user identifier, as userId', schema: { - type: "string", + type: 'string', }, }, ], get: { responses: { - "200": { - description: "the user being returned", + 200: { + description: 'the user being returned', content: { - "application/json": { + 'application/json': { schema: { - type: "object", + type: 'object', properties: { uuid: { - type: "string", - format: "uuid", + type: 'string', + format: 'uuid', }, }, }, @@ -41,34 +40,34 @@ export const doc = { }, links: { address: { - operationId: "getUserAddress", + operationId: 'getUserAddress', parameters: { - userid: "$request.path.id", + userid: '$request.path.id', }, }, address2: { - operationId: "getUserAddressByUUID", + operationId: 'getUserAddressByUUID', parameters: { - userUuid: "$response.body#/uuid", + userUuid: '$response.body#/uuid', }, }, UserRepositories: { - operationRef: "#/paths/~12.0~1repositories~1%7Busername%7D/get", + operationRef: '#/paths/~12.0~1repositories~1%7Busername%7D/get', parameters: { - username: "$response.body#/username", + username: '$response.body#/username', }, }, UserRepositories2: { operationRef: - "https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1%7Busername%7D/get", + 'https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1%7Busername%7D/get', parameters: { - username: "$response.body#/username", + username: '$response.body#/username', }, }, withBody: { - operationId: "queryUserWithBody", + operationId: 'queryUserWithBody', requestBody: { - userId: "$request.path.id", + userId: '$request.path.id', }, }, }, @@ -76,26 +75,26 @@ export const doc = { }, }, }, - "/users/{userid}/address": { + '/users/{userid}/address': { parameters: [ { - name: "userid", - in: "path", + name: 'userid', + in: 'path', required: true, - description: "the user identifier, as userId", + description: 'the user identifier, as userId', schema: { - type: "string", + type: 'string', }, }, ], get: { - operationId: "getUserAddress", + operationId: 'getUserAddress', responses: { - "200": { - description: "the user's address", + 200: { + description: 'the user\'s address', }, }, }, }, }, -} satisfies OpenAPIObject; +} 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 index c02ac87..ba0b434 100644 --- a/packages/types/tests/schema-tests-3.2/media-type-examples.ts +++ b/packages/types/tests/schema-tests-3.2/media-type-examples.ts @@ -1,17 +1,16 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { examples: { - "frog-example": {}, + 'frog-example': {}, }, schemas: { Address: {}, @@ -20,222 +19,222 @@ export const doc = { mediaTypes: { StreamingPets: { description: - "Streaming sequence of JSON pet representations,\nsuitable for use with any of the streaming JSON\nmedia types.\n", + 'Streaming sequence of JSON pet representations,\nsuitable for use with any of the streaming JSON\nmedia types.\n', itemSchema: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, }, paths: { - "/something": { + '/something': { put: { requestBody: { content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, examples: { cat: { - summary: "An example of a cat", + summary: 'An example of a cat', value: { - name: "Fluffy", - petType: "Cat", - color: "White", - gender: "male", - breed: "Persian", + name: 'Fluffy', + petType: 'Cat', + color: 'White', + gender: 'male', + breed: 'Persian', }, }, dog: { - summary: "An example of a dog with a cat's name", + summary: 'An example of a dog with a cat\'s name', value: { - name: "Puma", - petType: "Dog", - color: "Black", - gender: "Female", - breed: "Mixed", + name: 'Puma', + petType: 'Dog', + color: 'Black', + gender: 'Female', + breed: 'Mixed', }, }, frog: { - $ref: "#/components/examples/frog-example", + $ref: '#/components/examples/frog-example', }, }, }, - "application/jsonl": { - $ref: "#/components/mediaTypes/StreamingPets", + 'application/jsonl': { + $ref: '#/components/mediaTypes/StreamingPets', }, - "application/x-ndjson": { - $ref: "#/components/mediaTypes/StreamingPets", + 'application/x-ndjson': { + $ref: '#/components/mediaTypes/StreamingPets', }, - "application/xml": { + 'application/xml': { schema: { - type: "object", + type: 'object', properties: { foo: { - type: "string", + type: 'string', xml: { - namespace: "https://example.com", - prefix: "example", - name: "Foo", + namespace: 'https://example.com', + prefix: 'example', + name: 'Foo', }, }, bar: { - type: "array", + type: 'array', items: { - type: "number", + type: 'number', }, xml: { wrapped: true, }, }, attr: { - type: "string", + type: 'string', xml: { attribute: true, }, }, elementNode: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', xml: { - nodeType: "element", + nodeType: 'element', }, }, attributeNode: { - type: "string", + type: 'string', xml: { - nodeType: "attribute", + nodeType: 'attribute', }, }, textNode: { - type: "string", + type: 'string', xml: { - nodeType: "text", + nodeType: 'text', }, }, cdataNode: { - type: "string", + type: 'string', xml: { - nodeType: "cdata", + nodeType: 'cdata', }, }, noneNode: { - type: "object", + type: 'object', xml: { - nodeType: "none", + nodeType: 'none', }, }, }, }, }, - "application/x-www-form-urlencoded": { + 'application/x-www-form-urlencoded': { schema: { - type: "object", + type: 'object', properties: { id: { - type: "string", - format: "uuid", + type: 'string', + format: 'uuid', }, address: { - type: "object", + type: 'object', properties: {}, }, icon: { - type: "string", - contentEncoding: "base64url", + type: 'string', + contentEncoding: 'base64url', }, }, }, encoding: { icon: { - contentType: "image/png, image/jpeg", + contentType: 'image/png, image/jpeg', }, }, }, - "multipart/form-data": { + 'multipart/form-data': { schema: { - type: "object", + type: 'object', properties: { id: { - type: "string", - format: "uuid", + type: 'string', + format: 'uuid', }, addresses: { - description: "addresses in XML format", - type: "array", + description: 'addresses in XML format', + type: 'array', items: { - $ref: "#/components/schemas/Address", + $ref: '#/components/schemas/Address', }, }, profileImage: { - type: "string", - format: "binary", + type: 'string', + format: 'binary', }, forCoverage: { - type: "string", + type: 'string', }, forCoverage2: { - type: "string", + type: 'string', }, nested1: { - type: "object", + type: 'object', }, nested2: { - type: "array", + type: 'array', }, }, }, encoding: { addresses: { - contentType: "application/xml; charset=utf-8", + contentType: 'application/xml; charset=utf-8', }, profileImage: { - contentType: "image/png, image/jpeg", + contentType: 'image/png, image/jpeg', headers: { - "X-Rate-Limit-Limit": { + 'X-Rate-Limit-Limit': { description: - "The number of allowed requests in the current period", + 'The number of allowed requests in the current period', schema: { - type: "integer", + type: 'integer', }, }, }, }, forCoverage: { - style: "form", + style: 'form', explode: false, allowReserved: true, }, forCoverage2: { - style: "spaceDelimited", + style: 'spaceDelimited', explode: true, }, nested1: { - contentType: "multipart/form-data", + contentType: 'multipart/form-data', encoding: { inner: {}, }, }, nested2: { - contentType: "multipart/mixed", + contentType: 'multipart/mixed', prefixEncoding: [{}], itemEncoding: {}, }, }, }, - "multipart/related": { + 'multipart/related': { schema: { - type: "array", + type: 'array', }, itemEncoding: { - contentType: "text/plain", + contentType: 'text/plain', }, prefixEncoding: [ { headers: { - "Content-Location": { + 'Content-Location': { schema: { - type: "string", + type: 'string', }, }, }, @@ -247,4 +246,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/schema-tests-3.2/mega.ts b/packages/types/tests/schema-tests-3.2/mega.ts index ab6bd82..f09d7e5 100644 --- a/packages/types/tests/schema-tests-3.2/mega.ts +++ b/packages/types/tests/schema-tests-3.2/mega.ts @@ -1,45 +1,44 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - summary: "My API's summary", - title: "My API", - version: "1.0.0", + summary: 'My API\'s summary', + title: 'My API', + version: '1.0.0', license: { - name: "Apache 2.0", - identifier: "Apache-2.0", + name: 'Apache 2.0', + identifier: 'Apache-2.0', }, }, paths: { - "/": { + '/': { get: { parameters: [], }, }, - "/{pathTest}": {}, + '/{pathTest}': {}, }, webhooks: { myWebhook: { - $ref: "#/components/pathItems/myPathItem", - description: "Overriding description", + $ref: '#/components/pathItems/myPathItem', + description: 'Overriding description', }, }, components: { securitySchemes: { mtls: { - type: "mutualTLS", + type: 'mutualTLS', }, }, schemas: { Foo: { - type: "object", + type: 'object', properties: { type: { - const: "foo", + const: 'foo', }, }, }, @@ -50,44 +49,44 @@ export const doc = { requestBody: { required: true, content: { - "application/json": { + 'application/json': { schema: { externalDocs: { - description: "More docs!", - url: "https://example.com/elsewhere.html", + description: 'More docs!', + url: 'https://example.com/elsewhere.html', }, - type: "object", + type: 'object', properties: { type: { - type: "string", + type: 'string', }, int: { - type: "integer", + type: 'integer', exclusiveMaximum: 100, exclusiveMinimum: 0, }, none: { - type: "null", + type: 'null', }, arr: { - type: "array", - $comment: "Array without items keyword", + type: 'array', + $comment: 'Array without items keyword', }, either: { - type: ["string", "null"], + type: ['string', 'null'], }, }, discriminator: { - propertyName: "type", - mapping: { - foo: "Foo", + 'propertyName': 'type', + 'mapping': { + foo: 'Foo', }, - defaultMapping: "Bar", - "x-extension": true, + 'defaultMapping': 'Bar', + 'x-extension': true, }, anyOf: [ { - $ref: "#/components/schemas/Foo", + $ref: '#/components/schemas/Foo', }, ], myArbitraryKeyword: true, @@ -99,4 +98,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} 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 index fd3cc65..93e66c6 100644 --- a/packages/types/tests/schema-tests-3.2/minimal-comp.ts +++ b/packages/types/tests/schema-tests-3.2/minimal-comp.ts @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: {}, -} satisfies OpenAPIObject; +} 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 index 583d141..50b66b2 100644 --- a/packages/types/tests/schema-tests-3.2/minimal-hooks.ts +++ b/packages/types/tests/schema-tests-3.2/minimal-hooks.ts @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, webhooks: {}, -} satisfies OpenAPIObject; +} 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 index c9a0e04..ff577e5 100644 --- a/packages/types/tests/schema-tests-3.2/minimal-paths.ts +++ b/packages/types/tests/schema-tests-3.2/minimal-paths.ts @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: {}, -} satisfies OpenAPIObject; +} 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 index 7caa354..47b6e18 100644 --- a/packages/types/tests/schema-tests-3.2/non-oauth-scopes.ts +++ b/packages/types/tests/schema-tests-3.2/non-oauth-scopes.ts @@ -1,20 +1,19 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "Non-oAuth Scopes example", - version: "1.0.0", + title: 'Non-oAuth Scopes example', + version: '1.0.0', }, paths: { - "/users": { + '/users': { get: { security: [ { - bearerAuth: ["read:users", "public"], + bearerAuth: ['read:users', 'public'], }, ], }, @@ -23,12 +22,12 @@ export const doc = { components: { securitySchemes: { bearerAuth: { - type: "http", - scheme: "bearer", - bearerFormat: "jwt", + type: 'http', + scheme: 'bearer', + bearerFormat: 'jwt', description: - "note: non-oauth scopes are not defined at the securityScheme level", + 'note: non-oauth scopes are not defined at the securityScheme level', }, }, }, -} satisfies OpenAPIObject; +} 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 index da23532..0b57d5f 100644 --- a/packages/types/tests/schema-tests-3.2/operation-object-example.ts +++ b/packages/types/tests/schema-tests-3.2/operation-object-example.ts @@ -1,73 +1,72 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/pets/{id}": { + '/pets/{id}': { put: { - tags: ["pet"], - summary: "Updates a pet in the store with form data", - operationId: "updatePetWithForm", + 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", + name: 'petId', + in: 'path', + description: 'ID of pet that needs to be updated', required: true, schema: { - type: "string", + type: 'string', }, }, ], requestBody: { content: { - "application/x-www-form-urlencoded": { + 'application/x-www-form-urlencoded': { schema: { - type: "object", + type: 'object', properties: { name: { - description: "Updated name of the pet", - type: "string", + description: 'Updated name of the pet', + type: 'string', }, status: { - description: "Updated status of the pet", - type: "string", + description: 'Updated status of the pet', + type: 'string', }, }, - required: ["status"], + required: ['status'], }, }, }, }, responses: { - "200": { - description: "Pet updated.", + 200: { + description: 'Pet updated.', content: { - "application/json": {}, - "application/xml": {}, + 'application/json': {}, + 'application/xml': {}, }, }, - "405": { - description: "Method Not Allowed", + 405: { + description: 'Method Not Allowed', content: { - "application/json": {}, - "application/xml": {}, + 'application/json': {}, + 'application/xml': {}, }, }, }, security: [ { - petstore_auth: ["write:pets", "read:pets"], + petstore_auth: ['write:pets', 'read:pets'], }, ], }, }, }, -} satisfies OpenAPIObject; +} 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 index d95e4bf..ec18460 100644 --- 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 @@ -1,29 +1,28 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { title: - "allowReserved only permitted with in and style values that percent-encode", - version: "1.0.0", + '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", + name: 'my_form_cookie', + in: 'cookie', allowReserved: true, schema: {}, }, style_cookie: { - name: "my_cookie_cookie", - in: "cookie", - style: "cookie", + name: 'my_cookie_cookie', + in: 'cookie', + style: 'cookie', schema: {}, }, }, }, -} satisfies OpenAPIObject; +} 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 index 41b2f67..fe21ee5 100644 --- a/packages/types/tests/schema-tests-3.2/parameter-object-examples.ts +++ b/packages/types/tests/schema-tests-3.2/parameter-object-examples.ts @@ -1,81 +1,80 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/user/{username}": { + '/user/{username}': { parameters: [ { - name: "token", - in: "header", - description: "token to be passed as a header", + name: 'token', + in: 'header', + description: 'token to be passed as a header', required: true, explode: false, schema: { - type: "array", + type: 'array', items: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, }, - style: "simple", + style: 'simple', }, { - name: "usernames", - in: "path", - description: "usernames to fetch", + name: 'usernames', + in: 'path', + description: 'usernames to fetch', required: true, explode: false, schema: { - type: "array", + type: 'array', }, }, { - name: "id", - in: "query", - description: "IDs of the object to fetch", + name: 'id', + in: 'query', + description: 'IDs of the object to fetch', required: false, schema: { - type: "array", + type: 'array', items: { - type: "string", + type: 'string', }, }, - style: "form", + style: 'form', explode: true, }, { - in: "query", - name: "freeForm", + in: 'query', + name: 'freeForm', schema: { - type: "object", + type: 'object', additionalProperties: { - type: "integer", + type: 'integer', }, }, - style: "form", + style: 'form', }, { - in: "query", - name: "coordinates", + in: 'query', + name: 'coordinates', content: { - "application/json": { + 'application/json': { schema: { - type: "object", - required: ["lat", "long"], + type: 'object', + required: ['lat', 'long'], properties: { lat: { - type: "number", + type: 'number', }, long: { - type: "number", + type: 'number', }, }, }, @@ -83,30 +82,30 @@ export const doc = { }, }, { - in: "cookie", - name: "my_cookie1", - style: "form", + in: 'cookie', + name: 'my_cookie1', + style: 'form', explode: false, schema: {}, }, { - in: "cookie", - name: "my_cookie2", - style: "cookie", + in: 'cookie', + name: 'my_cookie2', + style: 'cookie', explode: true, schema: {}, }, ], }, - "/user": { + '/user': { parameters: [ { - in: "querystring", - name: "json", + in: 'querystring', + name: 'json', content: { - "application/json": { + 'application/json': { schema: { - type: "object", + type: 'object', }, example: { numbers: [1, 2], @@ -118,4 +117,4 @@ export const doc = { ], }, }, -} satisfies OpenAPIObject; +} 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 index ad75e4d..2350039 100644 --- 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 @@ -1,23 +1,22 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "api", - version: "1.0.0", + title: 'api', + version: '1.0.0', }, components: { parameters: { path: { - name: "my-path", - in: "path", + name: 'my-path', + in: 'path', required: true, allowReserved: false, schema: {}, }, }, }, -} satisfies OpenAPIObject; +} 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 index 97517e7..6848a6b 100644 --- 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 @@ -1,23 +1,22 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { title: - "allowReserved only permitted with in and style values that percent-encode", - version: "1.0.0", + 'allowReserved only permitted with in and style values that percent-encode', + version: '1.0.0', }, components: { parameters: { my_query: { - name: "my_query", - in: "query", + name: 'my_query', + in: 'query', allowReserved: true, schema: {}, }, }, }, -} satisfies OpenAPIObject; +} 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 index 5929de3..9da7fd1 100644 --- 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 @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { schemas: { @@ -16,31 +15,31 @@ export const doc = { }, }, paths: { - "/pets/{id}": { + '/pets/{id}': { get: { - description: "Returns pets based on ID", - summary: "Find pets by ID", - operationId: "getPetsById", + description: 'Returns pets based on ID', + summary: 'Find pets by ID', + operationId: 'getPetsById', responses: { - "200": { - description: "pet response", + 200: { + description: 'pet response', content: { - "*/*": { + '*/*': { schema: { - type: "array", + type: 'array', items: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, }, }, default: { - description: "error payload", + description: 'error payload', content: { - "text/html": { + 'text/html': { schema: { - $ref: "#/components/schemas/ErrorModel", + $ref: '#/components/schemas/ErrorModel', }, }, }, @@ -48,29 +47,29 @@ export const doc = { }, }, query: { - description: "Returns pets based on ID", - summary: "Find pets by ID", - operationId: "queryPetsById", + description: 'Returns pets based on ID', + summary: 'Find pets by ID', + operationId: 'queryPetsById', responses: { - "200": { - description: "pet response", + 200: { + description: 'pet response', content: { - "*/*": { + '*/*': { schema: { - type: "array", + type: 'array', items: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, }, }, default: { - description: "error payload", + description: 'error payload', content: { - "text/html": { + 'text/html': { schema: { - $ref: "#/components/schemas/ErrorModel", + $ref: '#/components/schemas/ErrorModel', }, }, }, @@ -79,44 +78,44 @@ export const doc = { }, parameters: [ { - name: "id", - in: "path", - description: "ID of pet to use", + name: 'id', + in: 'path', + description: 'ID of pet to use', required: true, schema: { - type: "array", + type: 'array', items: { - type: "string", + type: 'string', }, }, - style: "simple", + style: 'simple', }, ], additionalOperations: { COPY: { - description: "Copies pet information based on ID", - summary: "Copies pets by ID", - operationId: "copyPetsById", + description: 'Copies pet information based on ID', + summary: 'Copies pets by ID', + operationId: 'copyPetsById', responses: { - "200": { - description: "pet response", + 200: { + description: 'pet response', content: { - "*/*": { + '*/*': { schema: { - type: "array", + type: 'array', items: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, }, }, default: { - description: "error payload", + description: 'error payload', content: { - "text/html": { + 'text/html': { schema: { - $ref: "#/components/schemas/ErrorModel", + $ref: '#/components/schemas/ErrorModel', }, }, }, @@ -126,4 +125,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} 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 index 949425f..c8a3d6a 100644 --- 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 @@ -1,80 +1,79 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/things": { - summary: "Lots of things", + '/things': { + summary: 'Lots of things', servers: [ { - url: "https://things.example.com", + url: 'https://things.example.com', }, ], get: { - summary: "Get a list of things", + summary: 'Get a list of things', externalDocs: { - description: "Find more info here", - url: "https://example.com", + 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", + $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", + description: 'A list of things', }, }, servers: [ { - url: "https://things.example.com", + url: 'https://things.example.com', }, ], }, post: { deprecated: false, requestBody: { - $ref: "#/components/requestBodies/ThingRequestBody", + $ref: '#/components/requestBodies/ThingRequestBody', }, responses: { - "201": { - $ref: "#/components/responses/ThingResponse", + 201: { + $ref: '#/components/responses/ThingResponse', }, }, callbacks: { myCallback: { - "{$request.query.queryUrl}": { + '{$request.query.queryUrl}': { post: { requestBody: { - description: "Callback payload", + description: 'Callback payload', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/SomePayload", + $ref: '#/components/schemas/SomePayload', }, }, }, }, responses: { - "200": { - description: "callback successfully processed", + 200: { + description: 'callback successfully processed', }, }, }, }, }, transactionCallback: { - $ref: "#/components/callbacks/transactionCallback", + $ref: '#/components/callbacks/transactionCallback', }, }, }, @@ -88,22 +87,22 @@ export const doc = { components: { callbacks: { transactionCallback: { - "http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}": + 'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}': { post: { requestBody: { - description: "Callback payload", + description: 'Callback payload', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/SomePayload", + $ref: '#/components/schemas/SomePayload', }, }, }, }, responses: { - "200": { - description: "callback successfully processed", + 200: { + description: 'callback successfully processed', }, }, }, @@ -112,58 +111,58 @@ export const doc = { }, examples: { ThingExample: { - summary: "A thing", - description: "A thing", + summary: 'A thing', + description: 'A thing', value: { id: 1, - name: "Thing", + name: 'Thing', }, }, }, links: { ThingLink: { - description: "A link to a thing", - operationId: "getThing", + description: 'A link to a thing', + operationId: 'getThing', parameters: { - thingId: "$response.body#/id", + thingId: '$response.body#/id', }, server: { - url: "https://things.example.com", + url: 'https://things.example.com', }, }, ThingyLink: { - $ref: "#/components/links/ThingLink", + $ref: '#/components/links/ThingLink', }, }, parameters: { limit: { - name: "limit", - in: "query", + name: 'limit', + in: 'query', required: false, allowEmptyValue: false, allowReserved: false, deprecated: true, - description: "The maximum number of list items to return", + description: 'The maximum number of list items to return', schema: { - type: "integer", + type: 'integer', minimum: 0, }, }, biscuit: { - name: "biscuit", - in: "cookie", - style: "form", + name: 'biscuit', + in: 'cookie', + style: 'form', schema: { - type: "string", + type: 'string', }, }, }, requestBodies: { ThingRequestBody: { content: { - "application/json": { + 'application/json': { schema: { - type: "object", + type: 'object', }, }, }, @@ -171,11 +170,11 @@ export const doc = { }, responses: { ThingResponse: { - description: "A thing", + description: 'A thing', content: { - "application/json": { + 'application/json': { schema: { - type: "object", + type: 'object', }, }, }, @@ -185,4 +184,4 @@ export const doc = { SomePayload: {}, }, }, -} satisfies OpenAPIObject; +} 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 index d913f84..1a01708 100644 --- a/packages/types/tests/schema-tests-3.2/path-no-response.ts +++ b/packages/types/tests/schema-tests-3.2/path-no-response.ts @@ -1,17 +1,16 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/": { + '/': { get: {}, }, }, -} satisfies OpenAPIObject; +} 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 index b7db875..a6c13a6 100644 --- 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 @@ -1,15 +1,14 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/{var}": {}, + '/{var}': {}, }, -} satisfies OpenAPIObject; +} 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 index 2b32229..3f05aa0 100644 --- a/packages/types/tests/schema-tests-3.2/paths-object-example.ts +++ b/packages/types/tests/schema-tests-3.2/paths-object-example.ts @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { schemas: { @@ -15,19 +14,19 @@ export const doc = { }, }, paths: { - "/pets": { + '/pets': { get: { description: - "Returns all pets from the system that the user has access to", + 'Returns all pets from the system that the user has access to', responses: { - "200": { - description: "A list of pets.", + 200: { + description: 'A list of pets.', content: { - "application/json": { + 'application/json': { schema: { - type: "array", + type: 'array', items: { - $ref: "#/components/schemas/pet", + $ref: '#/components/schemas/pet', }, }, }, @@ -37,4 +36,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} 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 index 0c58920..c80e081 100644 --- a/packages/types/tests/schema-tests-3.2/request-body-examples.ts +++ b/packages/types/tests/schema-tests-3.2/request-body-examples.ts @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { schemas: { @@ -15,47 +14,47 @@ export const doc = { }, }, paths: { - "/something": { + '/something': { put: { requestBody: { - description: "user to add to the system", + description: 'user to add to the system', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/User", + $ref: '#/components/schemas/User', }, examples: { user: { - summary: "User example", - externalValue: "https://foo.bar/examples/user-example.json", + summary: 'User example', + externalValue: 'https://foo.bar/examples/user-example.json', }, }, }, - "application/xml": { + 'application/xml': { schema: { - $ref: "#/components/schemas/User", + $ref: '#/components/schemas/User', }, examples: { user: { - summary: "User example in XML", - externalValue: "https://foo.bar/examples/user-example.xml", + summary: 'User example in XML', + externalValue: 'https://foo.bar/examples/user-example.xml', }, }, }, - "text/plain": { + 'text/plain': { examples: { user: { - summary: "User example in plain text", - externalValue: "https://foo.bar/examples/user-example.txt", + summary: 'User example in plain text', + externalValue: 'https://foo.bar/examples/user-example.txt', }, }, }, - "*/*": { + '*/*': { examples: { user: { - summary: "User example in other format", + summary: 'User example in other format', externalValue: - "https://foo.bar/examples/user-example.whatever", + 'https://foo.bar/examples/user-example.whatever', }, }, }, @@ -64,4 +63,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} 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 index ce0464f..116db54 100644 --- a/packages/types/tests/schema-tests-3.2/response-object-examples.ts +++ b/packages/types/tests/schema-tests-3.2/response-object-examples.ts @@ -1,78 +1,77 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { responses: { - "complex-object-array": { - summary: "Complex object array", - description: "A complex object array response", + 'complex-object-array': { + summary: 'Complex object array', + description: 'A complex object array response', content: { - "application/json": { + 'application/json': { schema: { - type: "array", + type: 'array', items: { - $ref: "#/components/schemas/VeryComplexType", + $ref: '#/components/schemas/VeryComplexType', }, }, }, }, }, - "simple-string": { - description: "A simple string response", + 'simple-string': { + description: 'A simple string response', content: { - "text/plain": { + 'text/plain': { schema: { - type: "string", + type: 'string', }, }, }, }, - "plain-text-with-headers": { - description: "A simple string response", + 'plain-text-with-headers': { + description: 'A simple string response', content: { - "text/plain": { + 'text/plain': { schema: { - type: "string", + type: 'string', }, - example: "whoa!", + example: 'whoa!', }, }, headers: { - "X-Rate-Limit-Limit": { - description: "The number of allowed requests in the current period", + 'X-Rate-Limit-Limit': { + description: 'The number of allowed requests in the current period', schema: { - type: "integer", + type: 'integer', }, }, - "X-Rate-Limit-Remaining": { + 'X-Rate-Limit-Remaining': { description: - "The number of remaining requests in the current period", + 'The number of remaining requests in the current period', schema: { - type: "integer", + type: 'integer', }, }, - "X-Rate-Limit-Reset": { - description: "The number of seconds left in the current period", + 'X-Rate-Limit-Reset': { + description: 'The number of seconds left in the current period', schema: { - type: "integer", + type: 'integer', }, }, }, }, - "no-return-value": { - description: "object created", + 'no-return-value': { + description: 'object created', }, }, schemas: { VeryComplexType: {}, }, }, -} satisfies OpenAPIObject; +} 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 index 85c1365..7228755 100644 --- 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 @@ -1,22 +1,21 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: { - "/user": { + '/user': { parameters: [ { - in: "query", - name: "example", + in: 'query', + name: 'example', schema: { - type: "object", + type: 'object', example: { numbers: [1, 2], flag: null, @@ -26,4 +25,4 @@ export const doc = { ], }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/schema-tests-3.2/schema.ts b/packages/types/tests/schema-tests-3.2/schema.ts index 195c122..e530a89 100644 --- a/packages/types/tests/schema-tests-3.2/schema.ts +++ b/packages/types/tests/schema-tests-3.2/schema.ts @@ -1,70 +1,69 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: {}, components: { schemas: { model: { - type: "object", + type: 'object', properties: { one: { - description: "type array", - type: ["integer", "string"], + description: 'type array', + type: ['integer', 'string'], }, two: { - description: "type 'null'", - type: "null", + description: 'type \'null\'', + type: 'null', }, three: { - description: "type array including 'null'", - type: ["string", "null"], + description: 'type array including \'null\'', + type: ['string', 'null'], }, four: { - description: "array with no items", - type: "array", + description: 'array with no items', + type: 'array', }, five: { - description: "singular example", - type: "string", - examples: ["exampleValue"], + description: 'singular example', + type: 'string', + examples: ['exampleValue'], }, six: { - description: "exclusiveMinimum true", + description: 'exclusiveMinimum true', exclusiveMinimum: 10, }, seven: { - description: "exclusiveMinimum false", + description: 'exclusiveMinimum false', minimum: 10, }, eight: { - description: "exclusiveMaximum true", + description: 'exclusiveMaximum true', exclusiveMaximum: 20, }, nine: { - description: "exclusiveMaximum false", + description: 'exclusiveMaximum false', maximum: 20, }, ten: { - description: "nullable string", - type: ["string", "null"], + description: 'nullable string', + type: ['string', 'null'], }, eleven: { - description: "x-nullable string", - type: ["string", "null"], + description: 'x-nullable string', + type: ['string', 'null'], }, twelve: { - description: "file/binary", + description: 'file/binary', }, }, }, }, }, -} satisfies OpenAPIObject; +} 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 index a035dbb..a8f2a9d 100644 --- 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 @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, security: [ { @@ -17,92 +16,92 @@ export const doc = { apiKey: [], }, { - "JWT-bearer": [], + 'JWT-bearer': [], }, { mutualTLS: [], }, { - OAuth2: ["write:pets", "read:pets"], + OAuth2: ['write:pets', 'read:pets'], }, ], components: { securitySchemes: { - basic: { - type: "http", - scheme: "basic", + 'basic': { + type: 'http', + scheme: 'basic', }, - apiKey: { - type: "apiKey", - name: "api-key", - in: "header", + 'apiKey': { + type: 'apiKey', + name: 'api-key', + in: 'header', }, - "JWT-bearer": { - type: "http", - scheme: "bearer", - bearerFormat: "JWT", + 'JWT-bearer': { + type: 'http', + scheme: 'bearer', + bearerFormat: 'JWT', }, - mutualTLS: { - type: "mutualTLS", - description: "Cert must be signed by example.com CA", + 'mutualTLS': { + type: 'mutualTLS', + description: 'Cert must be signed by example.com CA', }, - OAuth2: { - type: "oauth2", - oauth2MetadataUrl: "https://example.com/api/oauth/metadata", + '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", + 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", + 'write:pets': 'modify pets in your account', + 'read:pets': 'read your pets', }, }, password: { - tokenUrl: "https://example.com/api/oauth/token", + tokenUrl: 'https://example.com/api/oauth/token', scopes: { - "read:pets": "read your pets", + 'read:pets': 'read your pets', }, - refreshUrl: "https://example.com/api/oauth/refresh", + refreshUrl: 'https://example.com/api/oauth/refresh', }, clientCredentials: { - tokenUrl: "https://example.com/api/oauth/token", + tokenUrl: 'https://example.com/api/oauth/token', scopes: { - "read:pets": "read your pets", + 'read:pets': 'read your pets', }, - refreshUrl: "https://example.com/api/oauth/refresh", + refreshUrl: 'https://example.com/api/oauth/refresh', }, deviceAuthorization: { - deviceAuthorizationUrl: "https://example.com/api/oauth/device", - tokenUrl: "https://example.com/api/oauth/token", + deviceAuthorizationUrl: 'https://example.com/api/oauth/device', + tokenUrl: 'https://example.com/api/oauth/token', scopes: { - "read:pets": "read your pets", + 'read:pets': 'read your pets', }, - refreshUrl: "https://example.com/api/oauth/refresh", + refreshUrl: 'https://example.com/api/oauth/refresh', }, }, }, - OAuth2Old: { + 'OAuth2Old': { deprecated: true, - type: "oauth2", + type: 'oauth2', flows: { implicit: { - authorizationUrl: "https://example.com/api/oauth/dialog", + authorizationUrl: 'https://example.com/api/oauth/dialog', scopes: { - "read:pets": "read your pets", + 'read:pets': 'read your pets', }, - refreshUrl: "https://example.com/api/oauth/refresh", + refreshUrl: 'https://example.com/api/oauth/refresh', }, }, }, - OpenIdConnect: { - type: "openIdConnect", - openIdConnectUrl: "https://example.com/api/oauth/openid", + 'OpenIdConnect': { + type: 'openIdConnect', + openIdConnectUrl: 'https://example.com/api/oauth/openid', }, - external: { - $ref: "https://example.com/api/openapi.json#/components/externalDocs/ThingExternalDocs", + 'external': { + $ref: 'https://example.com/api/openapi.json#/components/externalDocs/ThingExternalDocs', }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/packages/types/tests/schema-tests-3.2/servers.ts b/packages/types/tests/schema-tests-3.2/servers.ts index 06ef770..7fb4251 100644 --- a/packages/types/tests/schema-tests-3.2/servers.ts +++ b/packages/types/tests/schema-tests-3.2/servers.ts @@ -1,42 +1,41 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: {}, servers: [ { - url: "/v1", - description: "Run locally.", - name: "local", + url: '/v1', + description: 'Run locally.', + name: 'local', }, { - url: "https://production.com/v1", - description: "Run on production server.", + url: 'https://production.com/v1', + description: 'Run on production server.', }, { - url: "https://{username}.gigantic-server.com:{port}/{basePath}", - description: "The production API server", + url: 'https://{username}.gigantic-server.com:{port}/{basePath}', + description: 'The production API server', variables: { username: { - default: "demo", + default: 'demo', description: - "A user-specific subdomain. Use `demo` for a free sandbox environment.", + 'A user-specific subdomain. Use `demo` for a free sandbox environment.', }, port: { - enum: ["8443", "443"], - default: "8443", + enum: ['8443', '443'], + default: '8443', }, basePath: { - default: "v2", + default: 'v2', }, }, }, ], -} satisfies OpenAPIObject; +} 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 index a466349..d2ae897 100644 --- a/packages/types/tests/schema-tests-3.2/specification-extensions.ts +++ b/packages/types/tests/schema-tests-3.2/specification-extensions.ts @@ -1,14 +1,13 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", - info: { - title: "API", - version: "1.0.0", + 'openapi': '3.2.0', + 'info': { + title: 'API', + version: '1.0.0', }, - paths: {}, - "x-tensions": "specification extensions are prefixed with `x-`", -} satisfies OpenAPIObject; + '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 index 9ed7c89..5062963 100644 --- a/packages/types/tests/schema-tests-3.2/style-defaults.ts +++ b/packages/types/tests/schema-tests-3.2/style-defaults.ts @@ -1,157 +1,156 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { title: - "various permutations of parameter objects, with non-required values left to their defaults", - version: "1.0.0", + '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", + '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", + 'x-comment': + 'expecting defaults: explode=true, allowReserved=false', + 'style': 'form', }, style_spaceDelimited: { - "x-comment": - "expecting defaults: explode=false, allowReserved=false", - style: "spaceDelimited", + 'x-comment': + 'expecting defaults: explode=false, allowReserved=false', + 'style': 'spaceDelimited', }, explode: { - "x-comment": "expecting defaults: style=form, allowReserved=false", - explode: false, + 'x-comment': 'expecting defaults: style=form, allowReserved=false', + 'explode': false, }, allowReserved: { - "x-comment": "expecting default: style=form, explode=true", - allowReserved: true, + '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/*": { + '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: {}, + '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: {}, + '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: {}, + '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/*": { + '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: {}, + '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: {}, + '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: {}, + '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: {}, + '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: {}, + '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/*": { + '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: {}, + '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: {}, + 'x-comment': + 'expecting defaults: required=false, deprecated=false, explode=true', + 'name': 'cookie_cookie', + 'in': 'cookie', + 'style': 'cookie', + 'schema': {}, }, }, }, -} satisfies OpenAPIObject; +} 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 index b6598ca..03b458b 100644 --- a/packages/types/tests/schema-tests-3.2/tag-object-example.ts +++ b/packages/types/tests/schema-tests-3.2/tag-object-example.ts @@ -1,38 +1,37 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, paths: {}, tags: [ { - name: "account-updates", - summary: "Account Updates", - description: "Account update operations", - kind: "nav", + 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: '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", + name: 'external', + summary: 'External', + description: 'Operations available to external consumers', + kind: 'audience', externalDocs: { - description: "Find more info here", - url: "https://example.com", + description: 'Find more info here', + url: 'https://example.com', }, }, ], -} satisfies OpenAPIObject; +} 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 index 7f5e566..88215cf 100644 --- a/packages/types/tests/schema-tests-3.2/valid-schema-types.ts +++ b/packages/types/tests/schema-tests-3.2/valid-schema-types.ts @@ -1,13 +1,12 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.1", + openapi: '3.2.1', info: { - title: "API", - version: "1.0.0", + title: 'API', + version: '1.0.0', }, components: { schemas: { @@ -19,4 +18,4 @@ export const doc = { }, }, }, -} satisfies OpenAPIObject; +} 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 index fff2b0e..20e8398 100644 --- a/packages/types/tests/schema-tests-3.2/webhook-example.ts +++ b/packages/types/tests/schema-tests-3.2/webhook-example.ts @@ -1,31 +1,30 @@ -/* 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"; +import type { OpenAPIObject } from '../../src/v3.2' export const doc = { - openapi: "3.2.0", + openapi: '3.2.0', info: { - title: "Webhook Example", - version: "1.0.0", + title: 'Webhook Example', + version: '1.0.0', }, webhooks: { newPet: { post: { requestBody: { - description: "Information about a new pet in the system", + description: 'Information about a new pet in the system', content: { - "application/json": { + 'application/json': { schema: { - $ref: "#/components/schemas/Pet", + $ref: '#/components/schemas/Pet', }, }, }, }, responses: { - "200": { + 200: { description: - "Return a 200 status to indicate that the data was received successfully", + 'Return a 200 status to indicate that the data was received successfully', }, }, }, @@ -34,20 +33,20 @@ export const doc = { components: { schemas: { Pet: { - required: ["id", "name"], + required: ['id', 'name'], properties: { id: { - type: "integer", - format: "int64", + type: 'integer', + format: 'int64', }, name: { - type: "string", + type: 'string', }, tag: { - type: "string", + type: 'string', }, }, }, }, }, -} satisfies OpenAPIObject; +} satisfies OpenAPIObject diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index de35647..116c245 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -109,6 +109,9 @@ importers: .: devDependencies: + '@antfu/eslint-config': + specifier: ^9.5.1 + version: 9.5.1(@typescript-eslint/typescript-estree@8.69.0(supports-color@7.2.0)(typescript@6.0.3))(@typescript-eslint/utils@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(@vue/compiler-sfc@3.5.42)(eslint-plugin-format@2.0.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(oxlint@1.80.0)(supports-color@7.2.0)(typescript@6.0.3)(vitest@4.1.11) '@seriousme/openapi-schema-validator': specifier: ^2.9.1 version: 2.9.1 @@ -118,15 +121,15 @@ importers: '@vitest/coverage-v8': specifier: ^4.1.11 version: 4.1.11(vitest@4.1.11) + eslint: + specifier: ^10.10.0 + version: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + eslint-plugin-format: + specifier: ^2.0.1 + version: 2.0.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) lint-staged: specifier: ^17.4.1 version: 17.4.1 - oxfmt: - specifier: ^0.65.0 - version: 0.65.0 - oxlint: - specifier: ^1.80.0 - version: 1.80.0 sherif: specifier: ^1.13.0 version: 1.13.0 @@ -136,9 +139,6 @@ importers: typescript: 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) @@ -156,6 +156,79 @@ importers: packages: + '@antfu/eslint-config@9.5.1': + resolution: {integrity: sha512-BoQGe5lY9spYmGqtUOC6hWohxob4SNn+7o5nHsOXoLn+9vJqNGqC/2/vRoXbcOa3dT4Rx/ZV/Qkr6uf72KTbxQ==} + hasBin: true + peerDependencies: + '@angular-eslint/eslint-plugin': ^21.1.0 + '@angular-eslint/eslint-plugin-template': ^21.1.0 + '@angular-eslint/template-parser': ^21.1.0 + '@eslint-react/eslint-plugin': ^5.6.0 + '@next/eslint-plugin-next': '>=15.0.0' + '@prettier/plugin-xml': ^3.4.1 + '@unocss/eslint-plugin': '>=0.50.0' + astro-eslint-parser: '>=1.0.2' + eslint: ^9.10.0 || ^10.0.0 + eslint-plugin-astro: '>=1.2.0' + eslint-plugin-erasable-syntax-only: ^0.7.1 + eslint-plugin-format: '>=0.1.0' + eslint-plugin-jsx-a11y: '>=6.10.2' + eslint-plugin-react-refresh: ^0.5.0 + eslint-plugin-slop: '>=0.1.1' + eslint-plugin-solid: ^0.17.0 + eslint-plugin-sonarjs: '>=4.0.0' + eslint-plugin-svelte: '>=2.35.1' + eslint-plugin-vuejs-accessibility: ^2.4.1 + prettier-plugin-astro: ^0.14.0 + prettier-plugin-slidev: ^1.0.5 + svelte-eslint-parser: '>=0.37.0' + peerDependenciesMeta: + '@angular-eslint/eslint-plugin': + optional: true + '@angular-eslint/eslint-plugin-template': + optional: true + '@angular-eslint/template-parser': + optional: true + '@eslint-react/eslint-plugin': + optional: true + '@next/eslint-plugin-next': + optional: true + '@prettier/plugin-xml': + optional: true + '@unocss/eslint-plugin': + optional: true + astro-eslint-parser: + optional: true + eslint-plugin-astro: + optional: true + eslint-plugin-erasable-syntax-only: + optional: true + eslint-plugin-format: + optional: true + eslint-plugin-jsx-a11y: + optional: true + eslint-plugin-react-refresh: + optional: true + eslint-plugin-slop: + optional: true + eslint-plugin-solid: + optional: true + eslint-plugin-sonarjs: + optional: true + eslint-plugin-svelte: + optional: true + eslint-plugin-vuejs-accessibility: + optional: true + prettier-plugin-astro: + optional: true + prettier-plugin-slidev: + optional: true + svelte-eslint-parser: + optional: true + + '@antfu/install-pkg@2.0.1': + resolution: {integrity: sha512-iCKVQcIC0e3oDxEfs3SHQGW+ovhBMZmS1TE+bTk50rVyMCBmCfClv7Qi3HQKlumYwvjb/iIMeWCW2i67q6kFfQ==} + '@babel/code-frame@8.0.0': resolution: {integrity: sha512-dYYg153EyN2Ekbqw2zAsbd6/JR+9N2SEoC7YV2GyyqMM7x9bLDTjBD6XBhSMLH0wtIVyJj03jWNriQhaN+eoCw==} engines: {node: ^22.18.0 || >=24.11.0} @@ -185,6 +258,12 @@ packages: resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} + '@cacheable/memory@2.2.0': + resolution: {integrity: sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ==} + + '@cacheable/utils@2.5.0': + resolution: {integrity: sha512-buipgOVDkkPXNR5+xBpDw7Zk2n1EvU7qBJCNUcL7rhQ//kfpOXPAvQ511Os0vpLYJ1pZnvudNytkQt2hst3wqA==} + '@clack/core@1.4.3': resolution: {integrity: sha512-/kr3UWNtdJfxZtPgDqUOmG2pvwlmcLGheex5yiZKdwbzZJxhV+HMNR9QNmyY5cGwTNV6LrR7Jtp+KjhUAP1qBQ==} engines: {node: '>= 20.12.0'} @@ -196,6 +275,38 @@ packages: '@colordx/core@5.6.0': resolution: {integrity: sha512-EDlcg/Hmlj1WuFh/Os9YhA+A2aasB2XlgwFfGePUDuW7fVHC07HBi5AFIMx0Ct1eM8kHM9NRyOtZ0MuVYa8xvg==} + '@dprint/formatter@0.5.1': + resolution: {integrity: sha512-cdZUrm0iv/FnnY3CKE2dEcVhNEzrC551aE2h2mTFwQCRBrqyARLDnb7D+3PlXTUVp3s34ftlnGOVCmhLT9DeKA==} + + '@dprint/markdown@0.21.1': + resolution: {integrity: sha512-XbZ/R7vRrBaZFYXG6vAvLvtaMVXHu8XB+xwie7OYrG+dPoGDP8UADGirIbzUyX8TmrAZcl6QBmalipTGlpzRmQ==} + + '@dprint/toml@0.7.0': + resolution: {integrity: sha512-eFaQTcfxKHB+YyTh83x7GEv+gDPuj9q5NFOTaoj5rZmQTbj6OgjjMxUicmS1R8zYcx8YAq5oA9J3YFa5U6x2gA==} + + '@e18e/eslint-plugin@0.8.0': + resolution: {integrity: sha512-js/TeM+XJyoJ2Zk4if5uTEchv3MEbqugc9gLgq8YdB6Dy+LvwGACpQiAwcul0r4LUl0TvhuzAKUeIUPtGp2cew==} + peerDependencies: + eslint: ^9.0.0 || ^10.0.0 + oxlint: ^1.72.0 + peerDependenciesMeta: + eslint: + optional: true + oxlint: + optional: true + + '@es-joy/jsdoccomment@0.92.0': + resolution: {integrity: sha512-WivZqV5jPTYDQJgIMp0hTsyQESKYNY6yCJr4b0l84tYtQntkAMkc6zARh2vlRQyeg4aYHPUkCUDpvr2IWAiGpQ==} + engines: {node: ^22.22.2 || >=24.15.0} + + '@es-joy/jsdoccomment@0.96.0': + resolution: {integrity: sha512-nvtxrDqAJOKMPSsMHqshCnHvnCqFnJTsKpTaTSaZoUi9VxGVe2JvgQeAY/Qvh2wyqXByIAqNTgI7h9elXzn0yQ==} + engines: {node: ^22.22.2 || >=24.15.0} + + '@es-joy/resolve.exports@1.2.0': + resolution: {integrity: sha512-Q9hjxWI5xBM+qW2enxfe8wDKdFWMfd0Z29k5ZJnuBqD/CasY5Zryj09aCA6owbGATWz+39p5uIdaHXpopOcG8g==} + engines: {node: '>=10'} + '@esbuild/aix-ppc64@0.25.12': resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==} engines: {node: '>=18'} @@ -352,6 +463,83 @@ packages: cpu: [x64] os: [win32] + '@eslint-community/eslint-plugin-eslint-comments@4.7.2': + resolution: {integrity: sha512-LF03qURSwEWm2dz5wtdDCzNk+7Opl0X7q6I3undsaIuNsEiNvRV3BCtqu14Q/6Pzg1tBj44LcxpW2EpSLZStZw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 + + '@eslint-community/eslint-utils@4.10.1': + resolution: {integrity: sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + + '@eslint-community/regexpp@4.12.2': + resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + '@eslint/compat@2.1.1': + resolution: {integrity: sha512-rMcy8GSrwNzcISX/BlTDY/GLB4eCopEuy9woIls3To+15OLxykZrxxq+WUcylCPCQ6F4MujjBM1DX5V1aqI3Vw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: ^8.40 || 9 || 10 + peerDependenciesMeta: + eslint: + optional: true + + '@eslint/config-array@0.23.5': + resolution: {integrity: sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/config-helpers@0.5.5': + resolution: {integrity: sha512-eIJYKTCECbP/nsKaaruF6LW967mtbQbsw4JTtSVkUQc9MneSkbrgPJAbKl9nWr0ZeowV8BfsarBmPpBzGelA2w==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/config-helpers@0.7.0': + resolution: {integrity: sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/core@1.2.1': + resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/css-tree@4.1.0': + resolution: {integrity: sha512-cg0ohyrAG3swyGqt8t1K/OK97DqBw/ftDvlvyY1fmEst5B40UOmsimwLENq74z2dyw5CDM+3zJIW+CV2nFNDdA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/markdown@8.0.3': + resolution: {integrity: sha512-rBTSSShrq7e4O+PWfeE4azH4/CWPNrC+VGxBXiW00o3vYVJnznsZiDayj3KC9JztIMVRZxZHn2nrDIUau/4j7A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/object-schema@3.0.5': + resolution: {integrity: sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/plugin-kit@0.7.3': + resolution: {integrity: sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@humanfs/core@0.19.2': + resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} + engines: {node: '>=18.18.0'} + + '@humanfs/node@0.16.8': + resolution: {integrity: sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==} + engines: {node: '>=18.18.0'} + + '@humanfs/types@0.15.0': + resolution: {integrity: sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==} + engines: {node: '>=18.18.0'} + + '@humanwhocodes/module-importer@1.0.1': + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + + '@humanwhocodes/retry@0.4.3': + resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} + engines: {node: '>=18.18'} + '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} @@ -368,6 +556,15 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@keyv/bigmap@1.3.1': + resolution: {integrity: sha512-WbzE9sdmQtKy8vrNPa9BRnwZh5UF4s1KTmSK0KUVLo3eff5BlQNNWDnFOouNpKfPKDnms9xynJjsMYjMaT/aFQ==} + engines: {node: '>= 18'} + peerDependencies: + keyv: ^5.6.0 + + '@keyv/serialize@1.1.1': + resolution: {integrity: sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==} + '@napi-rs/lzma-linux-x64-gnu@1.5.1': resolution: {integrity: sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==} engines: {node: ^22.20 || ^24.12 || >=25} @@ -375,139 +572,131 @@ packages: os: [linux] libc: [glibc] - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} + '@ota-meshi/ast-token-store@0.3.0': + resolution: {integrity: sha512-XRO0zi2NIUKq2lUk3T1ecFSld1fMWRKE6naRFGkgkdeosx7IslyUKNv5Dcb5PJTja9tHJoFu0v/7yEpAkrkrTg==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@oxc-project/types@0.147.0': resolution: {integrity: sha512-IJ3s6ltHLp45S0bh7phkX+gJO7A1Wuz2EaqpAhb8WjqDwbzMiWKHhyyT42tskaWjEYXtHtVCPpnBJVT9+dcRLg==} - '@oxfmt/binding-android-arm-eabi@0.65.0': - resolution: {integrity: sha512-M10Gs1SSpTNI6ahGx3M/OlIdUF4hkaP6OgUb+MS79t/Pgflk3r1nW5gPFqsZGUAXg0H1AfANT9AvLdBSTIhZKg==} + '@oxfmt/binding-android-arm-eabi@0.35.0': + resolution: {integrity: sha512-BaRKlM3DyG81y/xWTsE6gZiv89F/3pHe2BqX2H4JbiB8HNVlWWtplzgATAE5IDSdwChdeuWLDTQzJ92Lglw3ZA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] - '@oxfmt/binding-android-arm64@0.65.0': - resolution: {integrity: sha512-6DXH5sftNlaHpWJG50hFMF+Qxtq5D2TmahvcDPxWNcGIf8qrC9Y0YgHYcYZ2hlWzaccKXh/f3GcssH8vtkl4JA==} + '@oxfmt/binding-android-arm64@0.35.0': + resolution: {integrity: sha512-/O+EbuAJYs6nde/anv+aID6uHsGQApyE9JtYBo/79KyU8e6RBN3DMbT0ix97y1SOnCglurmL2iZ+hlohjP2PnQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@oxfmt/binding-darwin-arm64@0.65.0': - resolution: {integrity: sha512-K9m7lr53pcOLETNsC88sWes/GWHUGjZyHx95UhYcSXy0r30haLdeXlSufSenEAtoLaW753WN8/l4M7GYcRt6cg==} + '@oxfmt/binding-darwin-arm64@0.35.0': + resolution: {integrity: sha512-pGqRtqlNdn9d4VrmGUWVyQjkw79ryhI6je9y2jfqNUIZCfqceob+R97YYAoG7C5TFyt8ILdLVoN+L2vw/hSFyA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@oxfmt/binding-darwin-x64@0.65.0': - resolution: {integrity: sha512-sTNwIx1gre3MyiHOPLu7IGW4UyMScYL4DTmJT01p4vzB0En+OJUQz6KuH8t0PpsClRSaMuY3b0QmtoPItfO8Lg==} + '@oxfmt/binding-darwin-x64@0.35.0': + resolution: {integrity: sha512-8GmsDcSozTPjrCJeGpp+sCmS9+9V5yRrdEZ1p/sTWxPG5nYeAfSLuS0nuEYjXSO+CtdSbStIW6dxa+4NM58yRw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@oxfmt/binding-freebsd-x64@0.65.0': - resolution: {integrity: sha512-lYZMVIiIpnjGu5hJb2jxA8NYQ/e0OTGuaiAf4dqlGPNnPmUTu23FZRMltmjro/KkQm1uE4NT4n5yJ2zWmKcpfA==} + '@oxfmt/binding-freebsd-x64@0.35.0': + resolution: {integrity: sha512-QyfKfTe0ytHpFKHAcHCGQEzN45QSqq1AHJOYYxQMgLM3KY4xu8OsXHpCnINjDsV4XGnQzczJDU9e04Zmd8XqIQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@oxfmt/binding-linux-arm-gnueabihf@0.65.0': - resolution: {integrity: sha512-gIdXFAt/bURnjxuoedDEWdZ0PEWEmdDcm8qdpoFYYvW3QMk/5D4vUaH4mlMeRpeTdST4izUgHVO6RawQ4QulJw==} + '@oxfmt/binding-linux-arm-gnueabihf@0.35.0': + resolution: {integrity: sha512-u+kv3JD6P3J38oOyUaiCqgY5TNESzBRZJ5lyZQ6c2czUW2v5SIN9E/KWWa9vxoc+P8AFXQFUVrdzGy1tK+nbPQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@oxfmt/binding-linux-arm-musleabihf@0.65.0': - resolution: {integrity: sha512-jJVyADto7gA2AaX5qAjAexrxx9PJQaKWOe8PICE7yKMbjBRyOHcmj9TtVJ+MZYDUQ3hodU0AcoTj0jFQ1W4C6Q==} + '@oxfmt/binding-linux-arm-musleabihf@0.35.0': + resolution: {integrity: sha512-1NiZroCiV57I7Pf8kOH4XGR366kW5zir3VfSMBU2D0V14GpYjiYmPYFAoJboZvp8ACnZKUReWyMkNKSa5ad58A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@oxfmt/binding-linux-arm64-gnu@0.65.0': - resolution: {integrity: sha512-p3RFkB+u7u+8up99b/NEcI1hdpLDiGgJYNwDorB60n7eH+eKposAKuMBxx+NqB3b+sJP4CZmYDh9G7X62tUsKg==} + '@oxfmt/binding-linux-arm64-gnu@0.35.0': + resolution: {integrity: sha512-7Q0Xeg7ZnW2nxnZ4R7aF6DEbCFls4skgHZg+I63XitpNvJCbVIU8MFOTZlvZGRsY9+rPgWPQGeUpLHlyx0wvMA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] - '@oxfmt/binding-linux-arm64-musl@0.65.0': - resolution: {integrity: sha512-5Prb0uFzJHr+OUD/qS/TmU526wD+PaHDsm3KoRiUXbMIDpTSErjeQYkK3OQeshAvD/PuLa9WGEi9WPajjdOZJg==} + '@oxfmt/binding-linux-arm64-musl@0.35.0': + resolution: {integrity: sha512-5Okqi+uhYFxwKz8hcnUftNNwdm8BCkf6GSCbcz9xJxYMm87k1E4p7PEmAAbhLTk7cjSdDre6TDL0pDzNX+Y22Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] - '@oxfmt/binding-linux-ppc64-gnu@0.65.0': - resolution: {integrity: sha512-S8svxTp81obnF3admN9yd+u2rOYXtyzThLGBTg1PY6TPtGcC09BaaXLQD+TBSMa7yvqhCDZ8DFri+S/yG60qCg==} + '@oxfmt/binding-linux-ppc64-gnu@0.35.0': + resolution: {integrity: sha512-9k66pbZQXM/lBJWys3Xbc5yhl4JexyfqkEf/tvtq8976VIJnLAAL3M127xHA3ifYSqxdVHfVGTg84eiBHCGcNw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] - '@oxfmt/binding-linux-riscv64-gnu@0.65.0': - resolution: {integrity: sha512-WtXBr75G/h2qOHy8SiGtC1R6aS3jt4mE52v1D8AtwMXIgoOmSNP9lKvbSaTRoL0e5wsMPoi6T72QWDYPu+S+nA==} + '@oxfmt/binding-linux-riscv64-gnu@0.35.0': + resolution: {integrity: sha512-aUcY9ofKPtjO52idT6t0SAQvEF6ctjzUQa1lLp7GDsRpSBvuTrBQGeq0rYKz3gN8dMIQ7mtMdGD9tT4LhR8jAQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [glibc] - '@oxfmt/binding-linux-riscv64-musl@0.65.0': - resolution: {integrity: sha512-YwSLVvpaz4o/nv/miiPEBJz+eJ+VmbgNIrao6RccK9ce+L5EA8wP+ZD0uFeq6wKOza6zoWv/dR0sj6lip6R3EA==} + '@oxfmt/binding-linux-riscv64-musl@0.35.0': + resolution: {integrity: sha512-C6yhY5Hvc2sGM+mCPek9ZLe5xRUOC/BvhAt2qIWFAeXMn4il04EYIjl3DsWiJr0xDMTJhvMOmD55xTRPlNp39w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [musl] - '@oxfmt/binding-linux-s390x-gnu@0.65.0': - resolution: {integrity: sha512-XQTPqgvyrgkKcFq+Tp2eK6JS7sqqJ+nRmy2Fav4j3I+i4dJoPJm7YwEdoeSDX9xkqj9jZ/lWfF3bXUWztIrn6A==} + '@oxfmt/binding-linux-s390x-gnu@0.35.0': + resolution: {integrity: sha512-RG2hlvOMK4OMZpO3mt8MpxLQ0AAezlFqhn5mI/g5YrVbPFyoCv9a34AAvbSJS501ocOxlFIRcKEuw5hFvddf9g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] - '@oxfmt/binding-linux-x64-gnu@0.65.0': - resolution: {integrity: sha512-cjZlx6S/VkeCNWCbwZriTnLnZeTcV3DEyeRGSw/2wwLP9viq+C0bJ4bC1k/ZLkFxDcB1lUgSasPkYGP1bdraOg==} + '@oxfmt/binding-linux-x64-gnu@0.35.0': + resolution: {integrity: sha512-wzmh90Pwvqj9xOKHJjkQYBpydRkaXG77ZvDz+iFDRRQpnqIEqGm5gmim2s6vnZIkDGsvKCuTdtxm0GFmBjM1+w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] - '@oxfmt/binding-linux-x64-musl@0.65.0': - resolution: {integrity: sha512-2azCjxdLtK4zCcIOU1dlXlU0xxfbPi6EjwWx7Ac7teWPidIIDOcIhudup83xNCKYhtqeVd/gaVDOxbUq4syXWA==} + '@oxfmt/binding-linux-x64-musl@0.35.0': + resolution: {integrity: sha512-+HCqYCJPCUy5I+b2cf+gUVaApfgtoQT3HdnSg/l7NIcLHOhKstlYaGyrFZLmUpQt4WkFbpGKZZayG6zjRU0KFA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] - '@oxfmt/binding-openharmony-arm64@0.65.0': - resolution: {integrity: sha512-KXQ7xi1e/voP0IQaw6fG6XY4Z5+Llf1XmRSZS1t7pVFCecFJ0iXaboKmVwjFtp5MLlT5iWQrJ2U1C3GJdZ2u+Q==} + '@oxfmt/binding-openharmony-arm64@0.35.0': + resolution: {integrity: sha512-kFYmWfR9YL78XyO5ws+1dsxNvZoD973qfVMNFOS4e9bcHXGF7DvGC2tY5UDFwyMCeB33t3sDIuGONKggnVNSJA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@oxfmt/binding-win32-arm64-msvc@0.65.0': - resolution: {integrity: sha512-2FbbjG5jEqLSLKVJwBap84uJfpn5Y5A53KEO0aUNr+zeiRB9nyPUIFMcSbZVMFLitfBytFWRNngozXYjb6Rsbw==} + '@oxfmt/binding-win32-arm64-msvc@0.35.0': + resolution: {integrity: sha512-uD/NGdM65eKNCDGyTGdO8e9n3IHX+wwuorBvEYrPJXhDXL9qz6gzddmXH8EN04ejUXUujlq4FsoSeCfbg0Y+Jg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@oxfmt/binding-win32-ia32-msvc@0.65.0': - resolution: {integrity: sha512-LJ+ZacAPSjegDOnSLyA1TMWAhdDrsK4el3REdr1oL2UtVBCMhO2II/Sb3cEW6mF2MfLhl8hDNCSvc7KSbgk3LQ==} + '@oxfmt/binding-win32-ia32-msvc@0.35.0': + resolution: {integrity: sha512-oSRD2k8J2uxYDEKR2nAE/YTY9PobOEnhZgCmspHu0+yBQ665yH8lFErQVSTE7fcGJmJp/cC6322/gc8VFuQf7g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] - '@oxfmt/binding-win32-x64-msvc@0.65.0': - resolution: {integrity: sha512-higu9cWEO6XXFzATD1jf0mCK34rNfN2H9JrJie7QB1IhleVpTh0QlLH9Ip2C1H/Nd5n0v5pvRtC+5R0uE4HpVg==} + '@oxfmt/binding-win32-x64-msvc@0.35.0': + resolution: {integrity: sha512-WCDJjlS95NboR0ugI2BEwzt1tYvRDorDRM9Lvctls1SLyKYuNRCyrPwp1urUPFBnwgBNn9p2/gnmo7gFMySRoQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -634,6 +823,10 @@ packages: cpu: [x64] os: [win32] + '@pkgr/core@0.3.6': + resolution: {integrity: sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==} + engines: {node: ^14.18.0 || >=16.0.0} + '@rolldown/binding-android-arm-eabi@1.2.6': resolution: {integrity: sha512-b+jTcARdTiFLI6jB4a5XjTm0RWd6KcRfQj/I2356fxUZemiho9zQLxo0RtCuMDAyKcLo6cEltkgbQp6d1+sjjQ==} engines: {node: ^20.19.0 || >=22.12.0} @@ -925,35 +1118,121 @@ packages: cpu: [x64] os: [win32] - '@sec-ant/readable-stream@0.4.1': - resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} - '@seriousme/openapi-schema-validator@2.9.1': resolution: {integrity: sha512-EgGqVIP8xiKHmNTHWbrxec+RhD/WPUay7D/erEc7vWoZKxTT9f2aCEu1egKVpxcEbT1z0wdAbWFR9o2Is5FJEw==} hasBin: true - '@sindresorhus/merge-streams@4.0.0': - resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} + '@sindresorhus/base62@1.0.0': + resolution: {integrity: sha512-TeheYy0ILzBEI/CO55CP6zJCSdSWeRtGnHy8U8dWSUH4I68iqTsy7HkMktR4xakThc9jotkPQUXT4ITdbV7cHA==} engines: {node: '>=18'} '@standard-schema/spec@1.1.0': resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + '@stylistic/eslint-plugin@5.10.0': + resolution: {integrity: sha512-nPK52ZHvot8Ju/0A4ucSX1dcPV2/1clx0kLcH5wDmrE4naKso7TUC/voUyU1O9OTKTrR6MYip6LP0ogEMQ9jPQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^9.0.0 || ^10.0.0 + '@types/chai@5.2.3': resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + '@types/debug@4.1.13': + resolution: {integrity: sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==} + '@types/deep-eql@4.0.2': resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@types/esrecurse@4.3.1': + resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==} + '@types/estree@1.0.9': resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + '@types/hast@3.0.5': + resolution: {integrity: sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==} + + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/katex@0.16.8': + resolution: {integrity: sha512-trgaNyfU+Xh2Tc+ABIb44a5AYUpicB3uwirOioeOkNPPbmgRNtcWyDeeFRzjPZENO9Vq8gvVqfhaaXWLlevVwg==} + + '@types/mdast@4.0.4': + resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} + + '@types/ms@2.1.0': + resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} + '@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==} + '@types/unist@3.0.3': + resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} + + '@typescript-eslint/eslint-plugin@8.69.0': + resolution: {integrity: sha512-t5jQTKPIgVW1PE6dR6H6Qz5gm8zjMlX5/2gRaOGd9eO6V7J+tQc6iWKukEe7dY8u9HyYasQ0yfF0/FSSTEO2gA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + '@typescript-eslint/parser': ^8.69.0 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/parser@8.69.0': + resolution: {integrity: sha512-l4b0DhWioGg6Gt2ebGlvfkFMOjRsauxtsnDRwUSRX1qHq3HdTfQHV8wW9zEXeciai6HfeaKOedQn2Zoofx3WBw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/project-service@8.69.0': + resolution: {integrity: sha512-yi4obFrHMmnsesWehHbkg9zMA7Jt8cXT+mKM08G999pH1yT6nqgsHx7MYm0uY1wAj8CqiBXYRJ7WAT0QdQHQXg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/scope-manager@8.69.0': + resolution: {integrity: sha512-ewfspqWvSxKSOaplqAUNbaSFO0eB6w1EtQ+esfYFRm3614Ty4uNtExkcbgd6nWsXphbqKyf9ZYdbZdv2xEoWEQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/tsconfig-utils@8.69.0': + resolution: {integrity: sha512-xNqK7YTDZsLniQMV/4rpFR8Z5JlqeRvVjuG1YgF/mdPVH84HSD19L8CczMA0qg2RfwEV231GHH3VnToJDo4MfQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/type-utils@8.69.0': + resolution: {integrity: sha512-ZfoJAVg3JZndQEpEl9petVlxau3lRuElc4HRMuAlLCf8to04/iHz692RUSNmXKDjEuJmIL+KZ2/BsOcBc16dsA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/types@8.69.0': + resolution: {integrity: sha512-K3VrubUPhlo9VDBS6QdI8YB5j7ClpqLRdefcz6PFrhnwicehBweqQ9Evhl4l+FYz0HdDmMqIiSX0aldGRYtDCA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/typescript-estree@8.69.0': + resolution: {integrity: sha512-AdFkgqck3Vudb/kWnxlyafU/4aBhHrbQ9locP2N4psXTy5mOBg0SHJumnLvx7r6g1gV4DKvUFwV2nJZBoqOD8w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/utils@8.69.0': + resolution: {integrity: sha512-tUbx60BBqQa31kXF5MCsOOLL5E/WzUuxIn7YpAvq+eaUlqvk8/NXnXMBNAdLCr0icjkzem7iUA5QqWHe/hJ1aw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/visitor-keys@8.69.0': + resolution: {integrity: sha512-+rmdgPA+EXkNgKYvHvFfhrs35utXbwaC5PGpDquSXcoXQDKUA5UjV0LmTucG/4JXkM31BTu4TilHtrN8IVBe8w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@vitest/coverage-v8@4.1.11': resolution: {integrity: sha512-8MVGEFnJIcdGjcbfKmeq8z0pZHH0JlVtoVZH9Q/qwUp6wyFnEJUBMrw9DCaj+ra3vShGmhavjalMIhPNxZAUcw==} peerDependencies: @@ -963,6 +1242,22 @@ packages: '@vitest/browser': optional: true + '@vitest/eslint-plugin@1.6.27': + resolution: {integrity: sha512-X1RCAfwbatG4GFbJ/1PIHP9MSZMt0JJThqbYID+vS4L783k6QGlLPe421wQE8dHXuGCcenVLsydiM4qzsYWxhg==} + engines: {node: '>=18'} + peerDependencies: + '@typescript-eslint/eslint-plugin': '*' + eslint: '>=8.57.0' + typescript: '>=5.0.0' + vitest: '*' + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + typescript: + optional: true + vitest: + optional: true + '@vitest/expect@4.1.11': resolution: {integrity: sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==} @@ -992,6 +1287,26 @@ packages: '@vitest/utils@4.1.11': resolution: {integrity: sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==} + '@vue/compiler-core@3.5.42': + resolution: {integrity: sha512-2Ye1ilMtKXxl8qZUrQ5j0CdgenFp/HFQmta6rfRyfEsTG69L6Wk+tWuNoHYHMx9E8tF2Slvdg1FuwDvAXdy1LQ==} + + '@vue/compiler-dom@3.5.42': + resolution: {integrity: sha512-qbhQZEFmycr+ni/qyuccS4sucNN7VAbDfbkvNxWOX2VfgFm90MNs3/UhRNKoPMEIVn0F8gdlYjLPvqxHwHeQOA==} + + '@vue/compiler-sfc@3.5.42': + resolution: {integrity: sha512-fkCAFB4okcAANGMThboWnScp/gzWjU0ZSkVnjTIiplmMDq2uq0tIB3j+xVu4rhv5rvOgBySCysudmbMd6xRRqw==} + + '@vue/compiler-ssr@3.5.42': + resolution: {integrity: sha512-xmLk3wLkbizPAiLyomjgFFosf2ys9b5Ghb+oh/k2tnvipNz8OFrQOiTcWCzyK7MpBp9KkyGtfvgfLUivbmuGYA==} + + '@vue/shared@3.5.42': + resolution: {integrity: sha512-2rPxex1jQf4jvl9MOHl6YaXCPcrNqz/FstMOEh3QWY+/OME9nQTvl9WYeCwhW7AFjaR0SnngZGlp/wkR6rkI6g==} + + acorn-jsx@5.3.2: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + acorn@8.18.0: resolution: {integrity: sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==} engines: {node: '>=0.4.0'} @@ -1013,20 +1328,19 @@ packages: ajv: optional: true + ajv@6.15.0: + resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} + ajv@8.20.0: resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} - ansi-escapes@7.3.0: - resolution: {integrity: sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==} - engines: {node: '>=18'} - - ansi-regex@6.3.0: - resolution: {integrity: sha512-WpDfL7NO6j7tH88IDBNVdUJxDh9nmCteAVW9dsep846XdwF4naCBK+/tGLX3KJgcpgMRXCFlTM2hKGoK9FsdrQ==} - engines: {node: '>=12'} + ansis@4.3.1: + resolution: {integrity: sha512-BJ8/l4R5LRE7hW9WdSuGYrLSHi2ynxeFpDFbH0K/CgNeY/tyhk+vO6TYxXC5r5CpUhNVX310xzPsN/H9lCdfOA==} + engines: {node: '>=14'} - ansi-styles@6.2.3: - resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} - engines: {node: '>=12'} + are-docs-informative@0.1.1: + resolution: {integrity: sha512-sqRsNQBwbKLRX0jV5Cu5uzmtflf892n4Vukz7T659ebL4pz3mpOqCMU7lxMoBTFwnp10E3YB5ZcyHM41W5bcDA==} + engines: {node: '>=18'} assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} @@ -1042,6 +1356,10 @@ packages: peerDependencies: postcss: ^8.1.0 + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} + baseline-browser-mapping@2.11.20: resolution: {integrity: sha512-H0ulySigv6icDJ1F7SjtdCD6PrhTpdYCmP0CactWy1+ekh0AFd0o1Wn5T8b+hnTmdBx19u9yhL6wvCylXMY7zw==} engines: {node: '>=6.0.0'} @@ -1050,46 +1368,67 @@ packages: 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'} + brace-expansion@5.0.9: + resolution: {integrity: sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==} + engines: {node: 20 || >=22} 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 + builtin-modules@5.3.0: + resolution: {integrity: sha512-hMQUl2bUFG339QygPM97E+mc8OY1IAchORZxm4a/frcYwKzozMzRVDBwHW0NjOqGElLm2O37AVQE8ikxlZHrMQ==} + engines: {node: '>=18.20'} + + cac@7.0.0: + resolution: {integrity: sha512-tixWYgm5ZoOD+3g6UTea91eow5z6AAHaho3g0V9CNSNb45gM8SmflpAc+GRd1InC4AqN/07Unrgp56Y94N9hJQ==} + engines: {node: '>=20.19.0'} + + cacheable@2.5.0: + resolution: {integrity: sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g==} + 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==} + ccount@2.0.1: + resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} + chai@6.2.2: resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} engines: {node: '>=18'} - citty@0.1.6: - resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} + change-case@5.4.4: + resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} - citty@0.2.2: - resolution: {integrity: sha512-+6vJA3L98yv+IdfKGZHBNiGW5KHn22e/JwID0Strsz8h4S/csAu/OuICwxrg44k5MRiZHWIo8XXuJgQTriRP4w==} + character-entities@2.0.2: + resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} - cli-cursor@5.0.0: - resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} - engines: {node: '>=18'} + ci-info@4.4.0: + resolution: {integrity: sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==} + engines: {node: '>=8'} - cli-truncate@6.1.1: - resolution: {integrity: sha512-06p9vyLahLa4zkGcgsGxU6iEkSOiuI4fhCH6Emhe2lPAcoUv73n72DnODsnHA+5wwXGnV0n9M9/qOQJSjYhFhw==} - engines: {node: '>=22'} + citty@0.1.6: + resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} 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'} + commander@8.3.0: + resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} + engines: {node: '>= 12'} + + comment-parser@1.4.7: + resolution: {integrity: sha512-0h+uSNtQGW3D98eQt3jJ8L06Fves8hncB4V/PKdw/Qb8Hnk19VaKuTr55UNRYiSoVa7WwrFls+rh3ux9agmkeQ==} + engines: {node: '>= 12.0.0'} + + comment-parser@1.4.8: + resolution: {integrity: sha512-rKZTGo4fzKYna8UcL0isTg5wkBNla7bxTypLwZQXjIdi++IdP1OJ41rI5Mti3/jltkPujbu4i9LIARYA+zpotQ==} + engines: {node: '>= 12.0.0'} commondir@1.0.1: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} @@ -1104,9 +1443,21 @@ packages: resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} engines: {node: ^14.18.0 || >=16.10.0} + convert-hrtime@5.0.0: + resolution: {integrity: sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==} + engines: {node: '>=12'} + convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + core-js-compat@3.50.0: + resolution: {integrity: sha512-XGpFGbMLHwSt74YLTKho7Ib242qi6O8MSX+sRokV4oz7iKXvQWGYZthjIhjRGMxjzVkAubBO512dKGYcefmX3Q==} + engines: {node: '>=6.4.0'} + + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + css-declaration-sorter@7.4.0: resolution: {integrity: sha512-LTuzjPoyA2vMGKKcaOqKSp7Ub2eGrNfKiZH4LpezxpNrsICGCSFvsQOI29psISxNZtaXibkC2CXzrQ5enMeGGw==} engines: {node: ^14 || ^16 || >=18} @@ -1155,6 +1506,21 @@ packages: resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + decode-named-character-reference@1.3.0: + resolution: {integrity: sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==} + + deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} @@ -1162,10 +1528,25 @@ packages: defu@6.1.7: resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + dequal@2.0.3: + resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} + engines: {node: '>=6'} + + detect-indent@7.0.2: + resolution: {integrity: sha512-y+8xyqdGLL+6sh0tVeHcfP/QDd8gUgbasolJJpY7NgeQGSZ739bDtSiaiDgtoicy+mtYB81dKLxO9xRhCyIB3A==} + engines: {node: '>=12.20'} + detect-libc@2.1.2: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} + devlop@1.1.0: + resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + + diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dom-serializer@2.0.0: resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} @@ -1186,13 +1567,21 @@ packages: resolution: {integrity: sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==} engines: {node: '>=14'} + enhanced-resolve@5.24.5: + resolution: {integrity: sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A==} + engines: {node: '>=10.13.0'} + 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'} + entities@7.0.1: + resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==} + engines: {node: '>=0.12'} + + entities@8.0.0: + resolution: {integrity: sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==} + engines: {node: '>=20.19.0'} es-errors@1.3.0: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} @@ -1210,15 +1599,230 @@ packages: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} + escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + escape-string-regexp@5.0.0: + resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} + engines: {node: '>=12'} + + eslint-compat-utils@0.5.1: + resolution: {integrity: sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==} + engines: {node: '>=12'} + peerDependencies: + eslint: '>=6.0.0' + + eslint-config-flat-gitignore@2.4.0: + resolution: {integrity: sha512-JhYC+V7qEDiCDsbJcVP8fxNc62fk4+i91YLP/YvmVHlkaQ8Xo99olYN8MO5COdxl7onGlsrfZVONe5NYsZP1UA==} + peerDependencies: + eslint: ^9.5.0 || ^10.0.0 + + eslint-flat-config-utils@3.2.0: + resolution: {integrity: sha512-PHgo1X5uqIorJONLVD9BIaOSdoYFD3z/AeJljdqDPlWVRpeCYkDbK9k0AXoYVqqNJr6FEYIEr5Rm2TSktLQcHw==} + + eslint-formatting-reporter@0.0.0: + resolution: {integrity: sha512-k9RdyTqxqN/wNYVaTk/ds5B5rA8lgoAmvceYN7bcZMBwU7TuXx5ntewJv81eF3pIL/CiJE+pJZm36llG8yhyyw==} + peerDependencies: + eslint: '>=8.40.0' + + eslint-json-compat-utils@0.2.3: + resolution: {integrity: sha512-RbBmDFyu7FqnjE8F0ZxPNzx5UaptdeS9Uu50r7A+D7s/+FCX+ybiyViYEgFUaFIFqSWJgZRTpL5d8Kanxxl2lQ==} + engines: {node: '>=12'} + peerDependencies: + '@eslint/json': '*' + eslint: '*' + jsonc-eslint-parser: ^2.4.0 || ^3.0.0 + peerDependenciesMeta: + '@eslint/json': + optional: true + + eslint-merge-processors@2.0.0: + resolution: {integrity: sha512-sUuhSf3IrJdGooquEUB5TNpGNpBoQccbnaLHsb1XkBLUPPqCNivCpY05ZcpCOiV9uHwO2yxXEWVczVclzMxYlA==} + peerDependencies: + eslint: '*' + + eslint-parser-plain@0.1.1: + resolution: {integrity: sha512-KRgd6wuxH4U8kczqPp+Oyk4irThIhHWxgFgLDtpgjUGVIS3wGrJntvZW/p6hHq1T4FOwnOtCNkvAI4Kr+mQ/Hw==} + + eslint-plugin-antfu@3.2.3: + resolution: {integrity: sha512-U2fnz/H0gFPxpuC7QpaHa0Jv2AgCZ5hunp36SOP/yWo8yFzgvMh8X4pZ4uN4IKoqtBhk7G3HuVa93Urf51+sZg==} + peerDependencies: + eslint: '*' + + eslint-plugin-command@4.0.0: + resolution: {integrity: sha512-mM1UdKu39YF5nUBVbA+PaVvpB3R3Niwjes8CQ8rJTTbgIThgrfQILgDqmtpAAQL1xGaolCoES1SfiwzwPVGkXQ==} + engines: {node: ^22.22.2 || >=24.15.0} + peerDependencies: + '@typescript-eslint/typescript-estree': '*' + '@typescript-eslint/utils': '*' + eslint: '*' + + eslint-plugin-es-x@7.8.0: + resolution: {integrity: sha512-7Ds8+wAAoV3T+LAKeu39Y5BzXCrGKrcISfgKEqTS4BDN8SFEDQd0S43jiQ8vIa3wUKD07qitZdfzlenSi8/0qQ==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + eslint: '>=8' + + eslint-plugin-format@2.0.1: + resolution: {integrity: sha512-0BA65p5DAiuKtx5MmMJfPk9WaTjoHHbyVW7ZXRhaZoA1fdiMHhay9QRiDL2wr0hJWZxdF7CRThOK/70VUKVg2g==} + peerDependencies: + eslint: ^8.40.0 || ^9.0.0 || ^10.0.0 + + eslint-plugin-import-lite@0.6.0: + resolution: {integrity: sha512-80vevx2A7i3H7n1/6pqDO8cc5wRz6OwLDvIyVl9UflBV1N1f46e9Ihzi65IOLYoSxM6YykK2fTw1xm0Ixx6aTQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^9.0.0 || ^10.0.0 + + eslint-plugin-jsdoc@64.3.5: + resolution: {integrity: sha512-BqRUwfREoBH+7pzDD+uIQ3aema5P7BnPYcHj3mU0DLm+p/5TEHdimkXgnQfYl0AGgB9PZxZW/Lk7D69FTJSLXw==} + engines: {node: ^22.22.2 || >=24.15.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 + + eslint-plugin-jsonc@3.4.2: + resolution: {integrity: sha512-q5xzjCYFQuhFomTbctXzd3STfDJ8XduvaigjQmMEbP2gzSKrc58y3Fv6D775/cIK1/sRUn+4kpljiU2iW8k0zw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: '>=9.38.0' + + eslint-plugin-n@18.3.0: + resolution: {integrity: sha512-cPVguuDe6DrIPb/qUXHf8P89MaVTUmiYWwpt5gX5AILsvRIiZAxMFXcFR6QHYBksqKJpjfUBlL/RleCJUWcD7w==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: '>=8.57.1' + ts-declaration-location: ^1.0.6 + typescript: '>=5.0.0' + peerDependenciesMeta: + ts-declaration-location: + optional: true + typescript: + optional: true + + eslint-plugin-no-only-tests@3.4.0: + resolution: {integrity: sha512-4S3/9Nb7A2tiMcpzEQE9bQSlpeOz6WJkgryBuou/SA8W2x2c8Zf4j0NvTKBjv6qNhF9T79tmkecm/0CHqV0UGg==} + engines: {node: '>=5.0.0'} + + eslint-plugin-perfectionist@5.11.0: + resolution: {integrity: sha512-kZV1otBcu4xT5R1p+0x1N1wRv4pS+OIbxrA47n5a1fTnN3MWbexOx5eQgbQhGyCNbpvF/rqrbnpkGjumHF+Y0Q==} + engines: {node: ^20.0.0 || >=22.0.0} + peerDependencies: + eslint: ^8.45.0 || ^9.0.0 || ^10.0.0 + + eslint-plugin-pnpm@1.9.1: + resolution: {integrity: sha512-8++1Egww2cqc9Wylmt7P+xXNMQVCosAZ4m4W4Gc0V5lGea8HFByHTRvUI+ZvvpO8fLXGg2O4MQc90EhuI3mMdQ==} + peerDependencies: + eslint: ^9.0.0 || ^10.0.0 + + eslint-plugin-regexp@3.3.0: + resolution: {integrity: sha512-TT0JTQbW7CRKohntpGAsMdQ1K3MsmJK4gdAhKJtIwlJ0JvuYxauymFgJdvqxIY4lqNj0EuRZWVrymQtEdJYEFg==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: '>=9.38.0' + + eslint-plugin-toml@1.5.0: + resolution: {integrity: sha512-qBjRywEkKxO2uYOjus//6GVF1r+Hg5QDkRO8RTY6XcaXgWfBU0DhwpFmJa2Ljf0Sz49r7DdZlpKwwHmJ4nmH1Q==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: '>=9.38.0' + + eslint-plugin-unicorn@74.0.0: + resolution: {integrity: sha512-AGnsGi2SxHg1HEAXxn9nSnZfyjvTWkxm8E8hpd/9tD6dLjBUdcD7+D6ZN64HmmCXTSXlrwVyUqe20Uyb2CaurA==} + engines: {node: '>=22'} + peerDependencies: + eslint: '>=10.4' + + eslint-plugin-unused-imports@4.4.1: + resolution: {integrity: sha512-oZGYUz1X3sRMGUB+0cZyK2VcvRX5lm/vB56PgNNcU+7ficUCKm66oZWKUubXWnOuPjQ8PvmXtCViXBMONPe7tQ==} + peerDependencies: + '@typescript-eslint/eslint-plugin': ^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0 + eslint: ^10.0.0 || ^9.0.0 || ^8.0.0 + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + + eslint-plugin-vue@10.10.0: + resolution: {integrity: sha512-dL9x9rBHqqNcByWiLOHK6L0SB97V82/NC0cZRn9cXPjM7pCuWlpQQP9bFH4vjBv80ej1ZpzAkuD8zWH1o9bZbA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + '@stylistic/eslint-plugin': ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 + '@typescript-eslint/parser': ^7.0.0 || ^8.0.0 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + vue-eslint-parser: ^10.3.0 + peerDependenciesMeta: + '@stylistic/eslint-plugin': + optional: true + '@typescript-eslint/parser': + optional: true + + eslint-plugin-yml@3.8.1: + resolution: {integrity: sha512-E/70psRwxz5EJ8dBtzrFfqSiiInuSytbdtFCjueb/GcKjsWzPBfxfhtQePImMAPjHwMA/VDurO7DJwStDJ4wWg==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24.0.0} + peerDependencies: + eslint: '>=9.38.0' + + eslint-processor-vue-blocks@2.0.0: + resolution: {integrity: sha512-u4W0CJwGoWY3bjXAuFpc/b6eK3NQEI8MoeW7ritKj3G3z/WtHrKjkqf+wk8mPEy5rlMGS+k6AZYOw2XBoN/02Q==} + peerDependencies: + '@vue/compiler-sfc': ^3.3.0 + eslint: '>=9.0.0' + + eslint-scope@9.1.2: + resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint-visitor-keys@4.2.1: + resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + eslint-visitor-keys@5.0.1: + resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + eslint@10.10.0: + resolution: {integrity: sha512-NPXn6r5zl4uET1DAVPaOwzX3rut4c0wcmw3dWJAfOsTM5+TogXo0DDjz8pwm/hL8cyVNpHqeK4JpN0NjnyFFNw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true + + espree@10.4.0: + resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + espree@11.2.0: + resolution: {integrity: sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + esquery@1.7.0: + resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} + engines: {node: '>=0.10'} + + esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} - execa@10.0.1: - resolution: {integrity: sha512-ge98qjkRK4IB7tL7Ju/6qmm5LHoH1eEMt5FNZrz3f4UIYhF28lggX20z3FaX1sgc67msLEn0N0BscOs29iuwyw==} - engines: {node: '>=22'} + esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} expect-type@1.4.0: resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} @@ -1230,9 +1834,14 @@ packages: fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - fast-glob@3.3.3: - resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} - engines: {node: '>=8.6.0'} + fast-diff@1.3.0: + resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} + + fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} fast-string-truncated-width@3.0.3: resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} @@ -1246,8 +1855,8 @@ packages: fast-wrap-ansi@0.2.2: resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} - fastq@1.20.1: - resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==} + fault@2.0.1: + resolution: {integrity: sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==} fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} @@ -1258,20 +1867,30 @@ packages: picomatch: optional: true - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} + file-entry-cache@11.1.5: + resolution: {integrity: sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q==} - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} + find-up-simple@1.0.1: + resolution: {integrity: sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==} + engines: {node: '>=18'} - find-workspaces@0.3.1: - resolution: {integrity: sha512-UDkGILGJSA1LN5Aa7McxCid4sqW3/e+UYsVwyxki3dDT0F8+ym0rAfnCkEfkL0rO7M+8/mvkim4t/s3IPHmg+w==} + find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} fix-dts-default-cjs-exports@1.0.1: resolution: {integrity: sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==} + flat-cache@6.1.23: + resolution: {integrity: sha512-f++BY9pTk+983xK1FLzlLpmM0i0z+jHmx3QESGkURMXujQZz1k5wzwX6hjnQ8goaD0B+sYnDK1yZ6MTyZfUaqA==} + + flatted@3.4.4: + resolution: {integrity: sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==} + + format@0.2.2: + resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} + engines: {node: '>=0.4.x'} + fraction.js@5.3.4: resolution: {integrity: sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==} @@ -1283,22 +1902,42 @@ packages: function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - get-east-asian-width@1.6.0: - resolution: {integrity: sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==} + function-timeout@1.0.2: + resolution: {integrity: sha512-939eZS4gJ3htTHAldmyyuzlrD58P03fHG49v2JfFXbV6OhvZKRC9j2yAtdHw/zrp2zXHuv05zMIy40F0ge7spA==} engines: {node: '>=18'} - get-stream@9.0.1: - resolution: {integrity: sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==} + get-tsconfig@4.14.3: + resolution: {integrity: sha512-++QEw4DIY7WGoukz+/+A/8dGYPT9l9yIadnmSgZ8Rjr3YVSVDipQSO9CdnJo9ePqFqUUqh+wk9uIaoiAwsiPkA==} + + github-slugger@2.0.0: + resolution: {integrity: sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==} + + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + globals@15.15.0: + resolution: {integrity: sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==} engines: {node: '>=18'} - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} + globals@17.12.0: + resolution: {integrity: sha512-cezEd/DTyyht9cvSSURyygXPfy04GtWO/5e6ZPvH7fCtjKz9PYOmuawphw1Ctd1f6C+5JypXfGD7ahNMXvevBA==} + engines: {node: '>=18'} + + globrex@0.1.2: + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + hashery@1.5.1: + resolution: {integrity: sha512-iZyKG96/JwPz1N55vj2Ie2vXbhu440zfUfJvSwEqEbeLluk7NnapfGqa7LH0mOsnDxTF85Mx8/dyR6HfqcbmbQ==} + engines: {node: '>=20'} + hasown@2.0.4: resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==} engines: {node: '>= 0.4'} @@ -1306,12 +1945,41 @@ packages: hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} + hookified@1.15.1: + resolution: {integrity: sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg==} + + hookified@2.2.0: + resolution: {integrity: sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA==} + + html-entities@2.6.0: + resolution: {integrity: sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==} + html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - human-signals@8.0.1: - resolution: {integrity: sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==} - engines: {node: '>=18.18.0'} + identifier-regex@1.1.0: + resolution: {integrity: sha512-SLX4H/vtcYlYnL7XqnuJKHU7Z8517TgsW9nmQiGOgMCjQ8V/deLYu6bEmbGoXe7WMMhc9+EUGyFFneHja8KabA==} + engines: {node: '>=18'} + + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + + ignore@7.0.8: + resolution: {integrity: sha512-YYNsSlXBjMk92SKnkwvB5LOVSa6OznlFUGcsvrFgNJbJCd0M1XKeFVRc8ZByeCqz32FivYNHJVooLmdqrmvp/Q==} + engines: {node: '>= 4'} + + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + indent-string@5.0.0: + resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} + engines: {node: '>=12'} + + is-builtin-module@5.0.0: + resolution: {integrity: sha512-f4RqJKBUe5rQkJ2eJEJBXSticB3hGbN9j0yxxMQFqIW89Jp9WYFtzfTcRlstDKVUTRzSOTLKRfO9vIztenwtxA==} + engines: {node: '>=18.20'} is-core-module@2.16.2: resolution: {integrity: sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==} @@ -1321,35 +1989,22 @@ packages: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} - is-fullwidth-code-point@5.1.0: - resolution: {integrity: sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==} - engines: {node: '>=18'} - is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-identifier@1.1.0: + resolution: {integrity: sha512-NhOds0mDx9lJu+1lBRO0xbwFo5nobA7GCk/0e5xjr6+6XugX985+0OyGX35BNrTkPAsdLcIKg02HUQJOK8D8kw==} + engines: {node: '>=18'} + 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'} - - is-plain-obj@4.1.0: - 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'} - - is-unicode-supported@2.1.0: - resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} - engines: {node: '>=18'} + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} @@ -1374,15 +2029,46 @@ packages: js-tokens@10.0.0: resolution: {integrity: sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==} + jsdoc-type-pratt-parser@9.0.1: + resolution: {integrity: sha512-1LJ/negRKJxH0+ulOsJYEpUgzIs1DAOz9QctuS4In2LW/Ro3l8C4ej5al+5FU2hBGEOAY3R3SCnP6x8226JMIw==} + engines: {node: ^22.22.2 || >=24.15.0} + + jsdoc-type-pratt-parser@9.2.1: + resolution: {integrity: sha512-V4Ww4EHnTcTLSOMoB0FsF72JhQvcAsriCm/LWnxJeGWoxIjEL2l9na11abQok5SYShq8m0Gl02el/xAbTCulvQ==} + engines: {node: ^22.22.2 || >=24.15.0} + + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + + json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} - jsonc-parser@3.3.1: - resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + jsonc-eslint-parser@3.3.0: + resolution: {integrity: sha512-hYTGkHGNRZnXOFZ1urhINADoqDrGfpy53cjw+dxk84QE0pUDujQzeUeamNs6Mz44/TKD49z2x6/GVSu4ZrtA+Q==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + katex@0.16.47: + resolution: {integrity: sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==} + hasBin: true + + keyv@5.6.0: + resolution: {integrity: sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==} knitwork@1.3.0: resolution: {integrity: sha512-4LqMNoONzR43B1W0ek0fhXMsDNW/zxa1NdFAVMY+k28pgZLovR4G3PB5MrpTxCy1QaZCqNoiaKPr5w5qZHfSNw==} + levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + lightningcss-android-arm64@1.33.0: resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==} engines: {node: '>= 12.0.0'} @@ -1466,15 +2152,22 @@ packages: engines: {node: '>=22.22.1'} hasBin: true + local-pkg@1.2.1: + resolution: {integrity: sha512-++gUqRDEvcnN6Zhqrr+y/CkVEHhlrR96vZn3nZZPYzMcBUyBtTKzB9NadClFIsIVSsu+3i9tfk/erqy9kAmt7Q==} + engines: {node: '>=14'} + + locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + 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'} + longest-streak@3.1.0: + resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} @@ -1482,27 +2175,158 @@ packages: magicast@0.5.4: resolution: {integrity: sha512-llBEhWm1SacoRwgHUoQJYtwp4PBLF4faQi5TCpIGyGs9n4y5+juI0tDgyKIfpqxckRHaHzouUEph3THklWh03w==} + make-asynchronous@1.1.0: + resolution: {integrity: sha512-ayF7iT+44LXdxJLTrTd3TLQpFDDvPCBxXxbv+pMUSuHA5Q8zyAfwkRP6aHHwNVFBUFWtxAHqwNJxF8vMZLAbVg==} + engines: {node: '>=18'} + make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} + markdown-table@3.0.4: + resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==} + + mdast-util-find-and-replace@3.0.2: + resolution: {integrity: sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==} + + mdast-util-from-markdown@2.0.3: + resolution: {integrity: sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==} + + mdast-util-frontmatter@2.0.1: + resolution: {integrity: sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==} + + mdast-util-gfm-autolink-literal@2.0.1: + resolution: {integrity: sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==} + + mdast-util-gfm-footnote@2.1.0: + resolution: {integrity: sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==} + + mdast-util-gfm-strikethrough@2.0.0: + resolution: {integrity: sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==} + + mdast-util-gfm-table@2.0.0: + resolution: {integrity: sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==} + + mdast-util-gfm-task-list-item@2.0.0: + resolution: {integrity: sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==} + + mdast-util-gfm@3.1.0: + resolution: {integrity: sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==} + + mdast-util-math@3.0.0: + resolution: {integrity: sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==} + + mdast-util-phrasing@4.1.0: + resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==} + + mdast-util-to-markdown@2.1.2: + resolution: {integrity: sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==} + + mdast-util-to-string@4.0.0: + resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} + 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'} + mdn-data@2.34.0: + resolution: {integrity: sha512-OgIlLv0NxJKVW4GTSAoEgpRGd4F2XCqGinK0MsMlBCCS/Zcm2/LsbercNWNA7PeMMcjl75NnI97eqyo7zkdxWA==} - micromatch@4.0.8: - resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} - engines: {node: '>=8.6'} + micromark-core-commonmark@2.0.3: + resolution: {integrity: sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==} - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} + micromark-extension-frontmatter@2.0.0: + resolution: {integrity: sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==} + + micromark-extension-gfm-autolink-literal@2.1.0: + resolution: {integrity: sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==} + + micromark-extension-gfm-footnote@2.1.0: + resolution: {integrity: sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==} + + micromark-extension-gfm-strikethrough@2.1.0: + resolution: {integrity: sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==} + + micromark-extension-gfm-table@2.1.1: + resolution: {integrity: sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==} + + micromark-extension-gfm-tagfilter@2.0.0: + resolution: {integrity: sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==} + + micromark-extension-gfm-task-list-item@2.1.0: + resolution: {integrity: sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==} + + micromark-extension-gfm@3.0.0: + resolution: {integrity: sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==} + + micromark-extension-math@3.1.0: + resolution: {integrity: sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==} + + micromark-factory-destination@2.0.1: + resolution: {integrity: sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==} + + micromark-factory-label@2.0.1: + resolution: {integrity: sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==} + + micromark-factory-space@2.0.1: + resolution: {integrity: sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==} + + micromark-factory-title@2.0.1: + resolution: {integrity: sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==} + + micromark-factory-whitespace@2.0.1: + resolution: {integrity: sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==} + + micromark-util-character@2.1.1: + resolution: {integrity: sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==} + + micromark-util-chunked@2.0.1: + resolution: {integrity: sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==} + + micromark-util-classify-character@2.0.1: + resolution: {integrity: sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==} + + micromark-util-combine-extensions@2.0.1: + resolution: {integrity: sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==} + + micromark-util-decode-numeric-character-reference@2.0.2: + resolution: {integrity: sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==} + + micromark-util-decode-string@2.0.1: + resolution: {integrity: sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==} + + micromark-util-encode@2.0.1: + resolution: {integrity: sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==} + + micromark-util-html-tag-name@2.0.1: + resolution: {integrity: sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==} + + micromark-util-normalize-identifier@2.0.1: + resolution: {integrity: sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==} + + micromark-util-resolve-all@2.0.1: + resolution: {integrity: sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==} + + micromark-util-sanitize-uri@2.0.1: + resolution: {integrity: sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==} + + micromark-util-subtokenize@2.1.0: + resolution: {integrity: sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==} + + micromark-util-symbol@2.0.1: + resolution: {integrity: sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==} + + micromark-util-types@2.0.2: + resolution: {integrity: sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==} + + micromark@4.0.2: + resolution: {integrity: sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==} + + minimatch@10.2.6: + resolution: {integrity: sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==} + engines: {node: 18 || 20 || >=22} mkdist@2.4.1: resolution: {integrity: sha512-Ezk0gi04GJBkqMfsksICU5Rjoemc4biIekwgrONWVPor2EO/N9nBgN6MZXAf7Yw4mDDhrNyKbdETaHNevfumKg==} @@ -1528,47 +2352,49 @@ packages: mlly@1.8.2: resolution: {integrity: sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==} + module-replacements@3.3.0: + resolution: {integrity: sha512-AVZL23uePazQOZlb/QMGwxsUa1oWA62Cfe6ApPzgasUoF4cdCWAiRPVq4KkaQzXbIDAlpLhLG61Jx8Lju4wjTg==} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + nanoid@3.3.18: resolution: {integrity: sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - node-releases@2.0.54: - resolution: {integrity: sha512-YHs7BmmcsdAI5Ozuf8JZo6PT0mv2GIWC9vMfvUC3dp65M8hn7Ux8CPL+2oBI7juNuj9d0ndhTcznq2ODBps9cQ==} + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + natural-orderby@5.0.0: + resolution: {integrity: sha512-kKHJhxwpR/Okycz4HhQKKlhWe4ASEfPgkSWNmKFHd7+ezuQlxkA5cM3+XkBPvm1gmHen3w53qsYAv+8GwRrBlg==} engines: {node: '>=18'} - npm-run-path@6.0.0: - resolution: {integrity: sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==} + node-releases@2.0.54: + resolution: {integrity: sha512-YHs7BmmcsdAI5Ozuf8JZo6PT0mv2GIWC9vMfvUC3dp65M8hn7Ux8CPL+2oBI7juNuj9d0ndhTcznq2ODBps9cQ==} 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'} - hasBin: true + object-deep-merge@2.0.1: + resolution: {integrity: sha512-aKttDKcU3pyZqKcCkDhsMn70WmZFG2JGDQLP9EcLyTSIFQRCPWLAmBZRLJnrVUrhPG1jETEEbfdgbNtJf1LyMg==} obug@2.1.4: resolution: {integrity: sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==} engines: {node: '>=12.20.0'} - onetime@7.0.0: - resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} - engines: {node: '>=18'} + ohash@2.0.12: + resolution: {integrity: sha512-65S/5gk9YSsaRjcyf7Nfa6h/d3E8/1gslpXfI4W7Dxn/oap8IKRuNT5VXkLQ1YFKIEg4apRY4Pj6aiwFzrDdmw==} + + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + engines: {node: '>= 0.8.0'} - oxfmt@0.65.0: - resolution: {integrity: sha512-SgS5VgnP42T0zl3zWD+xoH8FCqg1SAFnSRoOT/qeoa6gxcYIqrDMOmcXIg/EWSN92Du4ogB4riuKhKd6Y4CGhw==} + oxfmt@0.35.0: + resolution: {integrity: sha512-QYeXWkP+aLt7utt5SLivNIk09glWx9QE235ODjgcEZ3sd1VMaUBSpLymh6ZRCA76gD2rMP4bXanUz/fx+nLM9Q==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true - peerDependencies: - svelte: ^5.0.0 - vite-plus: '*' - peerDependenciesMeta: - svelte: - optional: true - vite-plus: - optional: true oxlint@1.80.0: resolution: {integrity: sha512-5nTiSps4qdbCWLbxzuO00alHkEO2exR9YMN/ig6QXWrLsYSG0KaObOAM+l6oU2LcKPWoSAGYbkZIGEu1ViiWKA==} @@ -1583,13 +2409,42 @@ packages: vite-plus: optional: true - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} + p-event@6.0.1: + resolution: {integrity: sha512-Q6Bekk5wpzW5qIyUP4gdMEujObYstZl6DMMOSenwBvV0BlE5LkDwkjs5yHbZmdCEq2o4RJx4tE1vwxFVf2FG1w==} + engines: {node: '>=16.17'} - path-key@4.0.0: - resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} - engines: {node: '>=12'} + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + + p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + + p-timeout@6.1.4: + resolution: {integrity: sha512-MyIV3ZA/PmyBN/ud8vV9XzwTrNtR4jFrObymZYnZqMmW0zA8Z17vnT0rBgFE/TlohB+YCHqXMgZzb3Csp49vqg==} + engines: {node: '>=14.16'} + + package-manager-detector@1.8.0: + resolution: {integrity: sha512-yQA4H19AmPEoMUeavPMDIe1higySl/gH/yaQrkT/s07Qp+7pp2hYz30N3z2l5BkjVkF9Ow6o0wjJamm2y7Sn0A==} + + parse-gitignore@2.0.0: + resolution: {integrity: sha512-RmVuCHWsfu0QPNW+mraxh/xjQVw/lhUCUru8Zni3Ctq3AoMhpDTq0OVdKS6iesd6Kqb7viCV3isAL43dciOSog==} + engines: {node: '>=14'} + + parse-imports-exports@0.2.4: + resolution: {integrity: sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==} + + parse-statements@1.0.11: + resolution: {integrity: sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -1600,10 +2455,6 @@ packages: picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - picomatch@2.3.2: - resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} - engines: {node: '>=8.6'} - picomatch@4.0.7: resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} engines: {node: '>=12'} @@ -1614,6 +2465,13 @@ packages: pkg-types@2.3.1: resolution: {integrity: sha512-y+ichcgc2LrADuhLNAx8DFjVfgz91pRxfZdI3UDhxHvcVEZsenLO+7XaU5vOp0u/7V/wZ+plyuQxtrDlZJ+yeg==} + pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + + pnpm-workspace-yaml@1.9.1: + resolution: {integrity: sha512-Xj/T2X6DNAWbtk/9UQ0/TJRswltiHZevmcMjqoL7WrpJi67lu3qaslU4+I+zJ8wtwqmuvAE0KkB8rbv2ZdogBg==} + postcss-calc@10.1.1: resolution: {integrity: sha512-NYEsLHh8DgG/PRH2+G9BTuUdtf9ViS+vdoQ0YA5OQdGsfN4ztiwtDWNtBl9EKeqNMFnIu8IKZ0cLxEQ5r5KVMw==} engines: {node: ^18.12 || ^20.9 || >=22.0} @@ -1793,38 +2651,66 @@ packages: resolution: {integrity: sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==} engines: {node: ^10 || ^12 || >=14} + prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + prettier-linter-helpers@1.0.1: + resolution: {integrity: sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg==} + engines: {node: '>=6.0.0'} + + prettier@3.9.6: + resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==} + engines: {node: '>=14'} + hasBin: true + 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'} + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + qified@0.10.1: + resolution: {integrity: sha512-+Owyggi9IxT1ePKGafcI87ubSmxol6smwJ+RAHDQlx9+9cPwFWDiKFFCPuWhr9ignlGpZ9vDQLw67N4dcTVFEA==} + engines: {node: '>=20'} + + quansync@0.2.11: + resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + + quote-js-string@0.1.0: + resolution: {integrity: sha512-Y3NoRtprEEZQD8RfxMCfS0ZTqc4e+i18OrXEXAvpM6TfC/3y+0L5rNbZiSnbBBEkDfFzbpd8o+cE8q3/anjMGA==} + engines: {node: '>=22'} - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + refa@0.12.1: + resolution: {integrity: sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + regexp-ast-analysis@0.7.1: + resolution: {integrity: sha512-sZuz1dYW/ZsfG17WSAG7eS85r5a0dDsvg+7BiiYR5o6lKCAtUrEwdmRmaGF6rwVj3LcmAeYkOWKEPlbPzN3Y3A==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + regjsparser@0.13.2: + resolution: {integrity: sha512-NgRBy2Nx/bE+9F27nVHnqcN5HjyLmecqsqx2PJHu3/IEtADD4WuxuXIVExD5PoSDFVrl78dOonfcOe5O+5nbzQ==} + hasBin: true require-from-string@2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} - resolve.exports@2.0.3: - resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} - engines: {node: '>=10'} + reserved-identifiers@1.2.0: + resolution: {integrity: sha512-yE7KUfFvaBFzGPs5H3Ops1RevfUEsDc5Iz65rOwWg4lE8HJSYtle77uul3+573457oHvBKuHYDl/xqUkKpEEdw==} + engines: {node: '>=18'} + + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} 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'} - - reusify@1.1.0: - resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rolldown@1.2.6: resolution: {integrity: sha512-vMM4q3aixf46GiF1Kok8jDPFsEpXgFWGjUHXNkNHNm+Y2adXAG2dbX91jkti3i0ZRsOlcmbuzAz1poObSHCmUA==} engines: {node: ^20.19.0 || >=22.12.0} @@ -1846,13 +2732,14 @@ packages: 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'} + scslre@0.3.0: + resolution: {integrity: sha512-3A6sD0WYP7+QrjbfNA2FN3FsOaGGFoekCVgTyypy53gPxhbkCIjtO6YWgdrfM+n/8sI8JeXZOIxsHjMTNxQ4nQ==} + engines: {node: ^14.0.0 || >=16.0.0} + scule@1.3.0: resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==} @@ -1861,6 +2748,14 @@ packages: engines: {node: '>=10'} hasBin: true + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + sherif-darwin-arm64@1.13.0: resolution: {integrity: sha512-k38jpGpZIEWS5dpSRLSvVi53LZuGO3hDqB88jgdLMDN11LZM6yTDcP0GytnQ8OpE6Br/Js6bDCLsdWDarZdV9g==} cpu: [arm64] @@ -1912,10 +2807,6 @@ packages: siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - simple-git-hooks@2.13.1: resolution: {integrity: sha512-WszCLXwT4h2k1ufIXAgsbiTOazqqevFCIncOuUBZJ91DdvWcC5+OFkluWRQPrcuSYd8fjq+o2y1QfWqYMoAToQ==} hasBin: true @@ -1923,14 +2814,19 @@ packages: sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} - slice-ansi@9.0.0: - resolution: {integrity: sha512-SO/3iYL5S3W57LLEniscOGPZgOqZUPCx6d3dB+52B80yJ0XstzsC/eV8gnA4tM3MHDrKz+OCFSLNjswdSC+/bA==} - engines: {node: '>=22'} - source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} + spdx-exceptions@2.5.0: + resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} + + spdx-expression-parse@5.0.0: + resolution: {integrity: sha512-vngmw3Rgn+o2arXNbnZaj5UtOEBuWBfvaI+Wc8GFfykIhA5/vdK9/Sp/XkLv63dykz2rxKDvKEHupF5P0FORcQ==} + + spdx-license-ids@3.0.23: + resolution: {integrity: sha512-CWLcCCH7VLu13TgOH+r8p1O/Znwhqv/dbb6lqWy67G+pT1kHmeD/+V36AVb/vq8QMIQwVShJ6Ssl5FPh0fuSdw==} + stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -1941,24 +2837,20 @@ packages: resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} engines: {node: '>=0.6.19'} - string-width@8.2.2: - resolution: {integrity: sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==} - engines: {node: '>=20'} - - strip-ansi@7.2.0: - resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + strip-indent@4.1.1: + resolution: {integrity: sha512-SlyRoSkdh1dYP0PzclLE7r0M9sgbFKKMFXpFRUMNuKhQSbC6VQIGzq3E0qsfvGJaUFJPGv6Ws1NZ/haTAjfbMA==} engines: {node: '>=12'} - strip-final-newline@4.0.0: - 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 + super-regex@1.1.0: + resolution: {integrity: sha512-WHkws2ZflZe41zj6AolvvmaTrWds/VuyeYr9iPVv/oQeaIoVxMKaushfFWpOGDT+GuBrM/sVqF8KUCYQlSSTdQ==} + engines: {node: '>=18'} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -1972,6 +2864,18 @@ packages: engines: {node: '>=16'} hasBin: true + synckit@0.11.13: + resolution: {integrity: sha512-eNRKgb3z66Yp3D2CixVujOUvXLFUTij/zVnV8KRyvFdQwpz7I5DS8UfRkTeLzb64u+dkzDSdelE24izu+zSSUg==} + engines: {node: ^14.18.0 || >=16.0.0} + + tapable@2.3.3: + resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} + engines: {node: '>=6'} + + time-span@5.1.0: + resolution: {integrity: sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==} + engines: {node: '>=12'} + tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} @@ -1991,9 +2895,27 @@ packages: resolution: {integrity: sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==} engines: {node: '>=14.0.0'} - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} + to-valid-identifier@1.0.0: + resolution: {integrity: sha512-41wJyvKep3yT2tyPqX/4blcfybknGB4D+oETKLs7Q76UiPqRpUJK3hr1nxelyYO0PHKVzJwlu0aCeEAsGI6rpw==} + engines: {node: '>=20'} + + toml-eslint-parser@1.0.3: + resolution: {integrity: sha512-A5F0cM6+mDleacLIEUkmfpkBbnHJFV1d2rprHU2MXNk7mlxHq2zGojA+SRvQD1RoMo9gqjZPWEaKG4v1BQ48lw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + ts-api-utils@2.5.0: + resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} + engines: {node: '>=18.12'} + peerDependencies: + typescript: '>=4.8.4' + + type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + type-fest@4.41.0: + resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} + engines: {node: '>=16'} typescript@6.0.3: resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} @@ -2003,18 +2925,6 @@ packages: ufo@1.6.4: resolution: {integrity: sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==} - ultracite@7.10.7: - resolution: {integrity: sha512-rc+TG/zLCV+Uk1PL4XPmsq7CW8GtlaV4g7Q53Bt5o7UNGSKKNRoPY4syz1BDWwSoNBcvWKpSnfSVflsecok4EA==} - hasBin: true - peerDependencies: - oxfmt: '>=0.1.0' - oxlint: ^1.79.0 - peerDependenciesMeta: - oxfmt: - optional: true - oxlint: - optional: true - unbuild@3.6.1: resolution: {integrity: sha512-+U5CdtrdjfWkZhuO4N9l5UhyiccoeMEXIc2Lbs30Haxb+tRwB3VwB8AoZRxlAzORXunenSo+j6lh45jx+xkKgg==} hasBin: true @@ -2027,9 +2937,20 @@ packages: undici-types@8.3.0: resolution: {integrity: sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==} - unicorn-magic@0.3.0: - resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} - engines: {node: '>=18'} + unist-util-is@6.0.1: + resolution: {integrity: sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==} + + unist-util-remove-position@5.0.0: + resolution: {integrity: sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==} + + unist-util-stringify-position@4.0.0: + resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} + + unist-util-visit-parents@6.0.2: + resolution: {integrity: sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==} + + unist-util-visit@5.1.0: + resolution: {integrity: sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==} untyped@2.0.0: resolution: {integrity: sha512-nwNCjxJTjNuLCgFr42fEak5OcLuB3ecca+9ksPFNvtfYSLpjf+iJqSIaSnIile6ZPbKYxI5k2AfXqeopGudK/g==} @@ -2041,9 +2962,16 @@ packages: peerDependencies: browserslist: '>= 4.21.0' + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + verkit@0.3.2: + resolution: {integrity: sha512-zj/ob3UsvJGN0whEAKFp53REA5X66hvffVqoCtVQAakJKnKlH+/PcOfMoFwIG/o4rElqLv/ycAFlx8ZlXUorCg==} + engines: {node: '>=18.12.0'} + vite@8.2.2: resolution: {integrity: sha512-cFKLV/PRgAUlIRm5WjMjJ86jrftzpqcgH+Us+DS8mI3CDNiH30Whrz8uHL3+MOLPAgqbMBAqWdAHAphOAM+z/Q==} engines: {node: ^20.19.0 || >=22.12.0} @@ -2128,9 +3056,18 @@ packages: jsdom: optional: true - which-command@0.1.0: - resolution: {integrity: sha512-XZyoF5/5hZtXitIwzrU4NKK+Wtbb9aB9CezUEw2Q0wlYK8NUYQxC1rRXgNueYLtBAJwXIb+/tFVk4dozciNJMA==} - engines: {node: '>=22'} + vue-eslint-parser@10.4.1: + resolution: {integrity: sha512-Gk6gRDj0n/fkRa3C3l0bBheoBckUq/Rs0F/TvMWIS6nzzx67amAViMe9CkNgsP2tXyQONvGiHQESHwFtZ3aYDA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + + web-worker@1.5.0: + resolution: {integrity: sha512-RiMReJrTAiA+mBjGONMnjVDP2u3p9R1vkcGz6gDIrOMT3oGuYwX2WRMYI9ipkphSuE5XKEhydbhNEJh4NY9mlw==} + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} hasBin: true why-is-node-running@2.3.0: @@ -2138,24 +3075,89 @@ packages: engines: {node: '>=8'} hasBin: true - wrap-ansi@10.0.1: - resolution: {integrity: sha512-M0N4xzyzosiIok3svYlEo1sdLZts/8FPgYH/GPC3wvlmPoRvnoManGMrE54waYj3tISA8w6lsdesfVv67qSr8Q==} - engines: {node: '>=20'} + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + + xml-name-validator@5.0.0: + resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} + engines: {node: '>=18'} + + yaml-eslint-parser@2.1.0: + resolution: {integrity: sha512-1zo9KRfp6vIAXBEhWAz09ex3hUwh3T+/6dGbGteHvNseA0Uk4FgQnPES55klZ6cDzSy9FpgKS0D/CoLUvCCj4w==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} yaml@2.9.0: resolution: {integrity: sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==} engines: {node: '>= 14.6'} hasBin: true - yoctocolors@2.2.0: - resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} - engines: {node: '>=18'} + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} - zod@4.4.3: - resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + zwitch@2.0.4: + resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} snapshots: + '@antfu/eslint-config@9.5.1(@typescript-eslint/typescript-estree@8.69.0(supports-color@7.2.0)(typescript@6.0.3))(@typescript-eslint/utils@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(@vue/compiler-sfc@3.5.42)(eslint-plugin-format@2.0.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(oxlint@1.80.0)(supports-color@7.2.0)(typescript@6.0.3)(vitest@4.1.11)': + dependencies: + '@antfu/install-pkg': 2.0.1 + '@clack/prompts': 1.7.0 + '@e18e/eslint-plugin': 0.8.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(oxlint@1.80.0) + '@eslint-community/eslint-plugin-eslint-comments': 4.7.2(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint/markdown': 8.0.3(supports-color@7.2.0) + '@stylistic/eslint-plugin': 5.10.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + '@typescript-eslint/eslint-plugin': 8.69.0(@typescript-eslint/parser@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/parser': 8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + '@vitest/eslint-plugin': 1.6.27(@typescript-eslint/eslint-plugin@8.69.0(@typescript-eslint/parser@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)(vitest@4.1.11) + ansis: 4.3.1 + cac: 7.0.0 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + eslint-config-flat-gitignore: 2.4.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-flat-config-utils: 3.2.0 + eslint-merge-processors: 2.0.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-plugin-antfu: 3.2.3(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-plugin-command: 4.0.0(@typescript-eslint/typescript-estree@8.69.0(supports-color@7.2.0)(typescript@6.0.3))(@typescript-eslint/utils@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-plugin-import-lite: 0.6.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-plugin-jsdoc: 64.3.5(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + eslint-plugin-jsonc: 3.4.2(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-plugin-n: 18.3.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(typescript@6.0.3) + eslint-plugin-no-only-tests: 3.4.0 + eslint-plugin-perfectionist: 5.11.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + eslint-plugin-pnpm: 1.9.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-plugin-regexp: 3.3.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-plugin-toml: 1.5.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + eslint-plugin-unicorn: 74.0.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-plugin-unused-imports: 4.4.1(@typescript-eslint/eslint-plugin@8.69.0(@typescript-eslint/parser@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-plugin-vue: 10.10.0(@stylistic/eslint-plugin@5.10.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)))(@typescript-eslint/parser@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(vue-eslint-parser@10.4.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)) + eslint-plugin-yml: 3.8.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-processor-vue-blocks: 2.0.0(@vue/compiler-sfc@3.5.42)(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + globals: 17.12.0 + local-pkg: 1.2.1 + parse-gitignore: 2.0.0 + toml-eslint-parser: 1.0.3 + vue-eslint-parser: 10.4.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + yaml-eslint-parser: 2.1.0 + optionalDependencies: + eslint-plugin-format: 2.0.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + transitivePeerDependencies: + - '@eslint/json' + - '@typescript-eslint/typescript-estree' + - '@typescript-eslint/utils' + - '@vue/compiler-sfc' + - oxlint + - supports-color + - ts-declaration-location + - typescript + - vitest + + '@antfu/install-pkg@2.0.1': + dependencies: + package-manager-detector: 1.8.0 + tinyexec: 1.3.0 + '@babel/code-frame@8.0.0': dependencies: '@babel/helper-validator-identifier': 8.0.4 @@ -2180,6 +3182,18 @@ snapshots: '@bcoe/v8-coverage@1.0.2': {} + '@cacheable/memory@2.2.0': + dependencies: + '@cacheable/utils': 2.5.0 + '@keyv/bigmap': 1.3.1(keyv@5.6.0) + hookified: 1.15.1 + keyv: 5.6.0 + + '@cacheable/utils@2.5.0': + dependencies: + hashery: 1.5.1 + keyv: 5.6.0 + '@clack/core@1.4.3': dependencies: fast-wrap-ansi: 0.2.2 @@ -2194,6 +3208,39 @@ snapshots: '@colordx/core@5.6.0': {} + '@dprint/formatter@0.5.1': {} + + '@dprint/markdown@0.21.1': {} + + '@dprint/toml@0.7.0': {} + + '@e18e/eslint-plugin@0.8.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(oxlint@1.80.0)': + dependencies: + empathic: 2.0.1 + module-replacements: 3.3.0 + semver: 7.8.5 + optionalDependencies: + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + oxlint: 1.80.0 + + '@es-joy/jsdoccomment@0.92.0': + dependencies: + '@types/estree': 1.0.9 + '@typescript-eslint/types': 8.69.0 + comment-parser: 1.4.7 + esquery: 1.7.0 + jsdoc-type-pratt-parser: 9.0.1 + + '@es-joy/jsdoccomment@0.96.0': + dependencies: + '@types/estree': 1.0.9 + '@typescript-eslint/types': 8.69.0 + comment-parser: 1.4.8 + esquery: 1.7.0 + jsdoc-type-pratt-parser: 9.2.1 + + '@es-joy/resolve.exports@1.2.0': {} + '@esbuild/aix-ppc64@0.25.12': optional: true @@ -2272,97 +3319,178 @@ snapshots: '@esbuild/win32-x64@0.25.12': optional: true - '@jridgewell/gen-mapping@0.3.13': + '@eslint-community/eslint-plugin-eslint-comments@4.7.2(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))': dependencies: - '@jridgewell/sourcemap-codec': 1.5.5 - '@jridgewell/trace-mapping': 0.3.31 + escape-string-regexp: 4.0.0 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + ignore: 7.0.8 - '@jridgewell/remapping@2.3.5': + '@eslint-community/eslint-utils@4.10.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))': dependencies: - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + eslint-visitor-keys: 3.4.3 - '@jridgewell/resolve-uri@3.1.2': {} + '@eslint-community/regexpp@4.12.2': {} - '@jridgewell/sourcemap-codec@1.5.5': {} + '@eslint/compat@2.1.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))': + dependencies: + '@eslint/core': 1.2.1 + optionalDependencies: + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) - '@jridgewell/trace-mapping@0.3.31': + '@eslint/config-array@0.23.5(supports-color@7.2.0)': dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.5 + '@eslint/object-schema': 3.0.5 + debug: 4.4.3(supports-color@7.2.0) + minimatch: 10.2.6 + transitivePeerDependencies: + - supports-color - '@napi-rs/lzma-linux-x64-gnu@1.5.1': - optional: true + '@eslint/config-helpers@0.5.5': + dependencies: + '@eslint/core': 1.2.1 - '@nodelib/fs.scandir@2.1.5': + '@eslint/config-helpers@0.7.0': dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 + '@eslint/core': 1.2.1 - '@nodelib/fs.stat@2.0.5': {} + '@eslint/core@1.2.1': + dependencies: + '@types/json-schema': 7.0.15 - '@nodelib/fs.walk@1.2.8': + '@eslint/css-tree@4.1.0': dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.20.1 + mdn-data: 2.34.0 + source-map-js: 1.2.1 - '@oxc-project/types@0.147.0': {} + '@eslint/markdown@8.0.3(supports-color@7.2.0)': + dependencies: + '@eslint/core': 1.2.1 + '@eslint/plugin-kit': 0.7.3 + github-slugger: 2.0.0 + mdast-util-from-markdown: 2.0.3(supports-color@7.2.0) + mdast-util-frontmatter: 2.0.1(supports-color@7.2.0) + mdast-util-gfm: 3.1.0(supports-color@7.2.0) + mdast-util-math: 3.0.0(supports-color@7.2.0) + micromark-extension-frontmatter: 2.0.0 + micromark-extension-gfm: 3.0.0 + micromark-extension-math: 3.1.0 + micromark-util-normalize-identifier: 2.0.1 + transitivePeerDependencies: + - supports-color + + '@eslint/object-schema@3.0.5': {} + + '@eslint/plugin-kit@0.7.3': + dependencies: + '@eslint/core': 1.2.1 + levn: 0.4.1 + + '@humanfs/core@0.19.2': + dependencies: + '@humanfs/types': 0.15.0 + + '@humanfs/node@0.16.8': + dependencies: + '@humanfs/core': 0.19.2 + '@humanfs/types': 0.15.0 + '@humanwhocodes/retry': 0.4.3 + + '@humanfs/types@0.15.0': {} + + '@humanwhocodes/module-importer@1.0.1': {} + + '@humanwhocodes/retry@0.4.3': {} + + '@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': {} + + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + + '@keyv/bigmap@1.3.1(keyv@5.6.0)': + dependencies: + hashery: 1.5.1 + hookified: 1.15.1 + keyv: 5.6.0 + + '@keyv/serialize@1.1.1': {} + + '@napi-rs/lzma-linux-x64-gnu@1.5.1': + optional: true + + '@ota-meshi/ast-token-store@0.3.0': {} + + '@oxc-project/types@0.147.0': {} - '@oxfmt/binding-android-arm-eabi@0.65.0': + '@oxfmt/binding-android-arm-eabi@0.35.0': optional: true - '@oxfmt/binding-android-arm64@0.65.0': + '@oxfmt/binding-android-arm64@0.35.0': optional: true - '@oxfmt/binding-darwin-arm64@0.65.0': + '@oxfmt/binding-darwin-arm64@0.35.0': optional: true - '@oxfmt/binding-darwin-x64@0.65.0': + '@oxfmt/binding-darwin-x64@0.35.0': optional: true - '@oxfmt/binding-freebsd-x64@0.65.0': + '@oxfmt/binding-freebsd-x64@0.35.0': optional: true - '@oxfmt/binding-linux-arm-gnueabihf@0.65.0': + '@oxfmt/binding-linux-arm-gnueabihf@0.35.0': optional: true - '@oxfmt/binding-linux-arm-musleabihf@0.65.0': + '@oxfmt/binding-linux-arm-musleabihf@0.35.0': optional: true - '@oxfmt/binding-linux-arm64-gnu@0.65.0': + '@oxfmt/binding-linux-arm64-gnu@0.35.0': optional: true - '@oxfmt/binding-linux-arm64-musl@0.65.0': + '@oxfmt/binding-linux-arm64-musl@0.35.0': optional: true - '@oxfmt/binding-linux-ppc64-gnu@0.65.0': + '@oxfmt/binding-linux-ppc64-gnu@0.35.0': optional: true - '@oxfmt/binding-linux-riscv64-gnu@0.65.0': + '@oxfmt/binding-linux-riscv64-gnu@0.35.0': optional: true - '@oxfmt/binding-linux-riscv64-musl@0.65.0': + '@oxfmt/binding-linux-riscv64-musl@0.35.0': optional: true - '@oxfmt/binding-linux-s390x-gnu@0.65.0': + '@oxfmt/binding-linux-s390x-gnu@0.35.0': optional: true - '@oxfmt/binding-linux-x64-gnu@0.65.0': + '@oxfmt/binding-linux-x64-gnu@0.35.0': optional: true - '@oxfmt/binding-linux-x64-musl@0.65.0': + '@oxfmt/binding-linux-x64-musl@0.35.0': optional: true - '@oxfmt/binding-openharmony-arm64@0.65.0': + '@oxfmt/binding-openharmony-arm64@0.35.0': optional: true - '@oxfmt/binding-win32-arm64-msvc@0.65.0': + '@oxfmt/binding-win32-arm64-msvc@0.35.0': optional: true - '@oxfmt/binding-win32-ia32-msvc@0.65.0': + '@oxfmt/binding-win32-ia32-msvc@0.35.0': optional: true - '@oxfmt/binding-win32-x64-msvc@0.65.0': + '@oxfmt/binding-win32-x64-msvc@0.35.0': optional: true '@oxlint/binding-android-arm-eabi@1.80.0': @@ -2422,6 +3550,8 @@ snapshots: '@oxlint/binding-win32-x64-msvc@1.80.0': optional: true + '@pkgr/core@0.3.6': {} + '@rolldown/binding-android-arm-eabi@1.2.6': optional: true @@ -2591,8 +3721,6 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.63.0': optional: true - '@sec-ant/readable-stream@0.4.1': {} - '@seriousme/openapi-schema-validator@2.9.1': dependencies: ajv: 8.20.0 @@ -2600,25 +3728,148 @@ snapshots: ajv-formats: 3.0.1(ajv@8.20.0) yaml: 2.9.0 - '@sindresorhus/merge-streams@4.0.0': {} + '@sindresorhus/base62@1.0.0': {} '@standard-schema/spec@1.1.0': {} + '@stylistic/eslint-plugin@5.10.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))': + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + '@typescript-eslint/types': 8.69.0 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + eslint-visitor-keys: 4.2.1 + espree: 10.4.0 + estraverse: 5.3.0 + picomatch: 4.0.7 + '@types/chai@5.2.3': dependencies: '@types/deep-eql': 4.0.2 assertion-error: 2.0.1 + '@types/debug@4.1.13': + dependencies: + '@types/ms': 2.1.0 + '@types/deep-eql@4.0.2': {} + '@types/esrecurse@4.3.1': {} + '@types/estree@1.0.9': {} + '@types/hast@3.0.5': + dependencies: + '@types/unist': 3.0.3 + + '@types/json-schema@7.0.15': {} + + '@types/katex@0.16.8': {} + + '@types/mdast@4.0.4': + dependencies: + '@types/unist': 3.0.3 + + '@types/ms@2.1.0': {} + '@types/node@26.4.0': dependencies: undici-types: 8.3.0 '@types/resolve@1.20.2': {} + '@types/unist@3.0.3': {} + + '@typescript-eslint/eslint-plugin@8.69.0(@typescript-eslint/parser@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)': + dependencies: + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/scope-manager': 8.69.0 + '@typescript-eslint/type-utils': 8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/utils': 8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/visitor-keys': 8.69.0 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + ignore: 7.0.8 + natural-compare: 1.4.0 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.69.0 + '@typescript-eslint/types': 8.69.0 + '@typescript-eslint/typescript-estree': 8.69.0(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/visitor-keys': 8.69.0 + debug: 4.4.3(supports-color@7.2.0) + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/project-service@8.69.0(supports-color@7.2.0)(typescript@6.0.3)': + dependencies: + '@typescript-eslint/tsconfig-utils': 8.69.0(typescript@6.0.3) + '@typescript-eslint/types': 8.69.0 + debug: 4.4.3(supports-color@7.2.0) + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/scope-manager@8.69.0': + dependencies: + '@typescript-eslint/types': 8.69.0 + '@typescript-eslint/visitor-keys': 8.69.0 + + '@typescript-eslint/tsconfig-utils@8.69.0(typescript@6.0.3)': + dependencies: + typescript: 6.0.3 + + '@typescript-eslint/type-utils@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)': + dependencies: + '@typescript-eslint/types': 8.69.0 + '@typescript-eslint/typescript-estree': 8.69.0(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/utils': 8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + debug: 4.4.3(supports-color@7.2.0) + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/types@8.69.0': {} + + '@typescript-eslint/typescript-estree@8.69.0(supports-color@7.2.0)(typescript@6.0.3)': + dependencies: + '@typescript-eslint/project-service': 8.69.0(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/tsconfig-utils': 8.69.0(typescript@6.0.3) + '@typescript-eslint/types': 8.69.0 + '@typescript-eslint/visitor-keys': 8.69.0 + debug: 4.4.3(supports-color@7.2.0) + minimatch: 10.2.6 + semver: 7.8.5 + tinyglobby: 0.2.17 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)': + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + '@typescript-eslint/scope-manager': 8.69.0 + '@typescript-eslint/types': 8.69.0 + '@typescript-eslint/typescript-estree': 8.69.0(supports-color@7.2.0)(typescript@6.0.3) + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/visitor-keys@8.69.0': + dependencies: + '@typescript-eslint/types': 8.69.0 + eslint-visitor-keys: 5.0.1 + '@vitest/coverage-v8@4.1.11(vitest@4.1.11)': dependencies: '@bcoe/v8-coverage': 1.0.2 @@ -2633,6 +3884,18 @@ snapshots: 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)(jiti@2.7.0)(yaml@2.9.0)) + '@vitest/eslint-plugin@1.6.27(@typescript-eslint/eslint-plugin@8.69.0(@typescript-eslint/parser@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)(vitest@4.1.11)': + dependencies: + '@typescript-eslint/scope-manager': 8.69.0 + '@typescript-eslint/utils': 8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + optionalDependencies: + '@typescript-eslint/eslint-plugin': 8.69.0(@typescript-eslint/parser@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + typescript: 6.0.3 + 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)) + transitivePeerDependencies: + - supports-color + '@vitest/expect@4.1.11': dependencies: '@standard-schema/spec': 1.1.0 @@ -2674,6 +3937,42 @@ snapshots: convert-source-map: 2.0.0 tinyrainbow: 3.1.1 + '@vue/compiler-core@3.5.42': + dependencies: + '@babel/parser': 7.29.8 + '@vue/shared': 3.5.42 + entities: 7.0.1 + estree-walker: 2.0.2 + source-map-js: 1.2.1 + + '@vue/compiler-dom@3.5.42': + dependencies: + '@vue/compiler-core': 3.5.42 + '@vue/shared': 3.5.42 + + '@vue/compiler-sfc@3.5.42': + dependencies: + '@babel/parser': 7.29.8 + '@vue/compiler-core': 3.5.42 + '@vue/compiler-dom': 3.5.42 + '@vue/compiler-ssr': 3.5.42 + '@vue/shared': 3.5.42 + estree-walker: 2.0.2 + magic-string: 0.30.21 + postcss: 8.5.26 + source-map-js: 1.2.1 + + '@vue/compiler-ssr@3.5.42': + dependencies: + '@vue/compiler-dom': 3.5.42 + '@vue/shared': 3.5.42 + + '@vue/shared@3.5.42': {} + + acorn-jsx@5.3.2(acorn@8.18.0): + dependencies: + acorn: 8.18.0 + acorn@8.18.0: {} ajv-draft-04@1.0.0(ajv@8.20.0): @@ -2684,6 +3983,13 @@ snapshots: optionalDependencies: ajv: 8.20.0 + ajv@6.15.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + ajv@8.20.0: dependencies: fast-deep-equal: 3.1.3 @@ -2691,13 +3997,9 @@ snapshots: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 - ansi-escapes@7.3.0: - dependencies: - environment: 1.1.0 - - ansi-regex@6.3.0: {} + ansis@4.3.1: {} - ansi-styles@6.2.3: {} + are-docs-informative@0.1.1: {} assertion-error@2.0.1: {} @@ -2716,13 +4018,15 @@ snapshots: postcss: 8.5.26 postcss-value-parser: 4.2.0 + balanced-match@4.0.4: {} + baseline-browser-mapping@2.11.20: {} boolbase@1.0.0: {} - braces@3.0.3: + brace-expansion@5.0.9: dependencies: - fill-range: 7.1.1 + balanced-match: 4.0.4 browserslist@4.28.8: dependencies: @@ -2732,6 +4036,18 @@ snapshots: node-releases: 2.0.54 update-browserslist-db: 1.3.2(browserslist@4.28.8) + builtin-modules@5.3.0: {} + + cac@7.0.0: {} + + cacheable@2.5.0: + dependencies: + '@cacheable/memory': 2.2.0 + '@cacheable/utils': 2.5.0 + hookified: 1.15.1 + keyv: 5.6.0 + qified: 0.10.1 + caniuse-api@3.0.0: dependencies: browserslist: 4.28.8 @@ -2741,26 +4057,27 @@ snapshots: caniuse-lite@1.0.30001810: {} + ccount@2.0.1: {} + chai@6.2.2: {} - citty@0.1.6: - dependencies: - consola: 3.4.2 + change-case@5.4.4: {} - citty@0.2.2: {} + character-entities@2.0.2: {} - cli-cursor@5.0.0: - dependencies: - restore-cursor: 5.1.0 + ci-info@4.4.0: {} - cli-truncate@6.1.1: + citty@0.1.6: dependencies: - slice-ansi: 9.0.0 - string-width: 8.2.2 + consola: 3.4.2 commander@11.1.0: {} - commander@15.0.0: {} + commander@8.3.0: {} + + comment-parser@1.4.7: {} + + comment-parser@1.4.8: {} commondir@1.0.1: {} @@ -2770,8 +4087,20 @@ snapshots: consola@3.4.2: {} + convert-hrtime@5.0.0: {} + convert-source-map@2.0.0: {} + core-js-compat@3.50.0: + dependencies: + browserslist: 4.28.8 + + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + css-declaration-sorter@7.4.0(postcss@8.5.26): dependencies: postcss: 8.5.26 @@ -2846,12 +4175,34 @@ snapshots: dependencies: css-tree: 2.2.1 + debug@4.4.3(supports-color@7.2.0): + dependencies: + ms: 2.1.3 + optionalDependencies: + supports-color: 7.2.0 + + decode-named-character-reference@1.3.0: + dependencies: + character-entities: 2.0.2 + + deep-is@0.1.4: {} + deepmerge@4.3.1: {} defu@6.1.7: {} + dequal@2.0.3: {} + + detect-indent@7.0.2: {} + detect-libc@2.1.2: {} + devlop@1.1.0: + dependencies: + dequal: 2.0.3 + + diff-sequences@29.6.3: {} + dom-serializer@2.0.0: dependencies: domelementtype: 2.3.0 @@ -2874,9 +4225,16 @@ snapshots: empathic@2.0.1: {} + enhanced-resolve@5.24.5: + dependencies: + graceful-fs: 4.2.11 + tapable: 2.3.3 + entities@4.5.0: {} - environment@1.1.0: {} + entities@7.0.1: {} + + entities@8.0.0: {} es-errors@1.3.0: {} @@ -2913,26 +4271,314 @@ snapshots: escalade@3.2.0: {} + escape-string-regexp@4.0.0: {} + + escape-string-regexp@5.0.0: {} + + eslint-compat-utils@0.5.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + semver: 7.8.5 + + eslint-config-flat-gitignore@2.4.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + '@eslint/compat': 2.1.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + + eslint-flat-config-utils@3.2.0: + dependencies: + '@eslint/config-helpers': 0.5.5 + pathe: 2.0.3 + + eslint-formatting-reporter@0.0.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + prettier-linter-helpers: 1.0.1 + + eslint-json-compat-utils@0.2.3(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(jsonc-eslint-parser@3.3.0): + dependencies: + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + esquery: 1.7.0 + jsonc-eslint-parser: 3.3.0 + + eslint-merge-processors@2.0.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + + eslint-parser-plain@0.1.1: {} + + eslint-plugin-antfu@3.2.3(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + + eslint-plugin-command@4.0.0(@typescript-eslint/typescript-estree@8.69.0(supports-color@7.2.0)(typescript@6.0.3))(@typescript-eslint/utils@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + '@es-joy/jsdoccomment': 0.92.0 + '@typescript-eslint/typescript-estree': 8.69.0(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/utils': 8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + + eslint-plugin-es-x@7.8.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint-community/regexpp': 4.12.2 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + eslint-compat-utils: 0.5.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + + eslint-plugin-format@2.0.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + '@dprint/formatter': 0.5.1 + '@dprint/markdown': 0.21.1 + '@dprint/toml': 0.7.0 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + eslint-formatting-reporter: 0.0.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-parser-plain: 0.1.1 + ohash: 2.0.12 + oxfmt: 0.35.0 + prettier: 3.9.6 + synckit: 0.11.13 + + eslint-plugin-import-lite@0.6.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + + eslint-plugin-jsdoc@64.3.5(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3): + dependencies: + '@es-joy/jsdoccomment': 0.96.0 + '@es-joy/resolve.exports': 1.2.0 + '@typescript-eslint/utils': 8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + are-docs-informative: 0.1.1 + comment-parser: 1.4.8 + debug: 4.4.3(supports-color@7.2.0) + escape-string-regexp: 5.0.0 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + espree: 11.2.0 + esquery: 1.7.0 + html-entities: 2.6.0 + object-deep-merge: 2.0.1 + parse-imports-exports: 0.2.4 + semver: 7.8.5 + spdx-expression-parse: 5.0.0 + to-valid-identifier: 1.0.0 + transitivePeerDependencies: + - supports-color + - typescript + + eslint-plugin-jsonc@3.4.2(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint/core': 1.2.1 + '@eslint/plugin-kit': 0.7.3 + '@ota-meshi/ast-token-store': 0.3.0 + diff-sequences: 29.6.3 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + eslint-json-compat-utils: 0.2.3(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(jsonc-eslint-parser@3.3.0) + jsonc-eslint-parser: 3.3.0 + natural-compare: 1.4.0 + synckit: 0.11.13 + transitivePeerDependencies: + - '@eslint/json' + + eslint-plugin-n@18.3.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(typescript@6.0.3): + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + enhanced-resolve: 5.24.5 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + eslint-plugin-es-x: 7.8.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + get-tsconfig: 4.14.3 + globals: 15.15.0 + globrex: 0.1.2 + ignore: 5.3.2 + semver: 7.8.5 + optionalDependencies: + typescript: 6.0.3 + + eslint-plugin-no-only-tests@3.4.0: {} + + eslint-plugin-perfectionist@5.11.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3): + dependencies: + '@typescript-eslint/utils': 8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + natural-orderby: 5.0.0 + transitivePeerDependencies: + - supports-color + - typescript + + eslint-plugin-pnpm@1.9.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + empathic: 2.0.1 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + eslint-json-compat-utils: 0.2.3(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(jsonc-eslint-parser@3.3.0) + jsonc-eslint-parser: 3.3.0 + pathe: 2.0.3 + pnpm-workspace-yaml: 1.9.1 + tinyglobby: 0.2.17 + yaml: 2.9.0 + yaml-eslint-parser: 2.1.0 + transitivePeerDependencies: + - '@eslint/json' + + eslint-plugin-regexp@3.3.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint-community/regexpp': 4.12.2 + comment-parser: 1.4.8 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + jsdoc-type-pratt-parser: 9.2.1 + refa: 0.12.1 + regexp-ast-analysis: 0.7.1 + scslre: 0.3.0 + + eslint-plugin-toml@1.5.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + dependencies: + '@eslint/core': 1.2.1 + '@eslint/plugin-kit': 0.7.3 + '@ota-meshi/ast-token-store': 0.3.0 + debug: 4.4.3(supports-color@7.2.0) + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + toml-eslint-parser: 1.0.3 + transitivePeerDependencies: + - supports-color + + eslint-plugin-unicorn@74.0.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint/css-tree': 4.1.0 + browserslist: 4.28.8 + change-case: 5.4.4 + ci-info: 4.4.0 + core-js-compat: 3.50.0 + detect-indent: 7.0.2 + entities: 8.0.0 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + find-up-simple: 1.0.1 + globals: 17.12.0 + indent-string: 5.0.0 + is-builtin-module: 5.0.0 + is-identifier: 1.1.0 + pluralize: 8.0.0 + quote-js-string: 0.1.0 + regjsparser: 0.13.2 + reserved-identifiers: 1.2.0 + semver: 7.8.5 + strip-indent: 4.1.1 + yaml: 2.9.0 + + eslint-plugin-unused-imports@4.4.1(@typescript-eslint/eslint-plugin@8.69.0(@typescript-eslint/parser@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + optionalDependencies: + '@typescript-eslint/eslint-plugin': 8.69.0(@typescript-eslint/parser@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + + eslint-plugin-vue@10.10.0(@stylistic/eslint-plugin@5.10.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)))(@typescript-eslint/parser@8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(vue-eslint-parser@10.4.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)): + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + natural-compare: 1.4.0 + nth-check: 2.1.1 + postcss-selector-parser: 7.1.5 + semver: 7.8.5 + vue-eslint-parser: 10.4.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + xml-name-validator: 5.0.0 + optionalDependencies: + '@stylistic/eslint-plugin': 5.10.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + '@typescript-eslint/parser': 8.69.0(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + + eslint-plugin-yml@3.8.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + '@eslint/core': 1.2.1 + '@eslint/plugin-kit': 0.7.3 + '@ota-meshi/ast-token-store': 0.3.0 + diff-sequences: 29.6.3 + escape-string-regexp: 5.0.0 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + natural-compare: 1.4.0 + yaml-eslint-parser: 2.1.0 + + eslint-processor-vue-blocks@2.0.0(@vue/compiler-sfc@3.5.42)(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)): + dependencies: + '@vue/compiler-sfc': 3.5.42 + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + + eslint-scope@9.1.2: + dependencies: + '@types/esrecurse': 4.3.1 + '@types/estree': 1.0.9 + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-visitor-keys@3.4.3: {} + + eslint-visitor-keys@4.2.1: {} + + eslint-visitor-keys@5.0.1: {} + + eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0): + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint-community/regexpp': 4.12.2 + '@eslint/config-array': 0.23.5(supports-color@7.2.0) + '@eslint/config-helpers': 0.7.0 + '@eslint/core': 1.2.1 + '@eslint/plugin-kit': 0.7.3 + '@humanfs/node': 0.16.8 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.4.3 + '@types/estree': 1.0.9 + ajv: 6.15.0 + cross-spawn: 7.0.6 + debug: 4.4.3(supports-color@7.2.0) + escape-string-regexp: 4.0.0 + eslint-scope: 9.1.2 + eslint-visitor-keys: 5.0.1 + espree: 11.2.0 + esquery: 1.7.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 11.1.5 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + minimatch: 10.2.6 + natural-compare: 1.4.0 + optionator: 0.9.4 + optionalDependencies: + jiti: 2.7.0 + transitivePeerDependencies: + - supports-color + + espree@10.4.0: + dependencies: + acorn: 8.18.0 + acorn-jsx: 5.3.2(acorn@8.18.0) + eslint-visitor-keys: 4.2.1 + + espree@11.2.0: + dependencies: + acorn: 8.18.0 + acorn-jsx: 5.3.2(acorn@8.18.0) + eslint-visitor-keys: 5.0.1 + + esquery@1.7.0: + dependencies: + estraverse: 5.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@5.3.0: {} + estree-walker@2.0.2: {} estree-walker@3.0.3: dependencies: '@types/estree': 1.0.9 - execa@10.0.1: - dependencies: - '@sindresorhus/merge-streams': 4.0.0 - figures: 6.1.0 - get-stream: 9.0.1 - human-signals: 8.0.1 - is-plain-obj: 4.1.0 - is-stream: 4.0.1 - npm-run-path: 6.0.0 - pretty-ms: 9.3.0 - signal-exit: 4.1.0 - strip-final-newline: 4.0.0 - which-command: 0.1.0 - yoctocolors: 2.2.0 + esutils@2.0.3: {} expect-type@1.4.0: {} @@ -2940,13 +4586,11 @@ snapshots: fast-deep-equal@3.1.3: {} - fast-glob@3.3.3: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.8 + fast-diff@1.3.0: {} + + fast-json-stable-stringify@2.1.0: {} + + fast-levenshtein@2.0.6: {} fast-string-truncated-width@3.0.3: {} @@ -2960,27 +4604,24 @@ snapshots: dependencies: fast-string-width: 3.0.2 - fastq@1.20.1: + fault@2.0.1: dependencies: - reusify: 1.1.0 + format: 0.2.2 fdir@6.5.0(picomatch@4.0.7): optionalDependencies: picomatch: 4.0.7 - figures@6.1.0: + file-entry-cache@11.1.5: dependencies: - is-unicode-supported: 2.1.0 + flat-cache: 6.1.23 - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 + find-up-simple@1.0.1: {} - find-workspaces@0.3.1: + find-up@5.0.0: dependencies: - fast-glob: 3.3.3 - pkg-types: 1.3.1 - yaml: 2.9.0 + locate-path: 6.0.0 + path-exists: 4.0.0 fix-dts-default-cjs-exports@1.0.1: dependencies: @@ -2988,6 +4629,16 @@ snapshots: mlly: 1.8.2 rollup: 4.63.0 + flat-cache@6.1.23: + dependencies: + cacheable: 2.5.0 + flatted: 3.4.4 + hookified: 1.15.1 + + flatted@3.4.4: {} + + format@0.2.2: {} + fraction.js@5.3.4: {} fsevents@2.3.3: @@ -2995,28 +4646,61 @@ snapshots: function-bind@1.1.2: {} - get-east-asian-width@1.6.0: {} + function-timeout@1.0.2: {} - get-stream@9.0.1: + get-tsconfig@4.14.3: dependencies: - '@sec-ant/readable-stream': 0.4.1 - is-stream: 4.0.1 + resolve-pkg-maps: 1.0.0 + + github-slugger@2.0.0: {} - glob-parent@5.1.2: + glob-parent@6.0.2: dependencies: is-glob: 4.0.3 + globals@15.15.0: {} + + globals@17.12.0: {} + + globrex@0.1.2: {} + + graceful-fs@4.2.11: {} + has-flag@4.0.0: {} + hashery@1.5.1: + dependencies: + hookified: 1.15.1 + hasown@2.0.4: dependencies: function-bind: 1.1.2 hookable@5.5.3: {} + hookified@1.15.1: {} + + hookified@2.2.0: {} + + html-entities@2.6.0: {} + html-escaper@2.0.2: {} - human-signals@8.0.1: {} + identifier-regex@1.1.0: + dependencies: + reserved-identifiers: 1.2.0 + + ignore@5.3.2: {} + + ignore@7.0.8: {} + + imurmurhash@0.1.4: {} + + indent-string@5.0.0: {} + + is-builtin-module@5.0.0: + dependencies: + builtin-modules: 5.3.0 is-core-module@2.16.2: dependencies: @@ -3024,27 +4708,22 @@ snapshots: is-extglob@2.1.1: {} - is-fullwidth-code-point@5.1.0: - dependencies: - get-east-asian-width: 1.6.0 - is-glob@4.0.3: dependencies: is-extglob: 2.1.1 - is-module@1.0.0: {} - - is-number@7.0.0: {} + is-identifier@1.1.0: + dependencies: + identifier-regex: 1.1.0 + super-regex: 1.1.0 - is-plain-obj@4.1.0: {} + is-module@1.0.0: {} is-reference@1.2.1: dependencies: '@types/estree': 1.0.9 - is-stream@4.0.1: {} - - is-unicode-supported@2.1.0: {} + isexe@2.0.0: {} istanbul-lib-coverage@3.2.2: {} @@ -3065,12 +4744,44 @@ snapshots: js-tokens@10.0.0: {} + jsdoc-type-pratt-parser@9.0.1: + dependencies: + '@types/estree': 1.0.9 + + jsdoc-type-pratt-parser@9.2.1: + dependencies: + '@types/estree': 1.0.9 + '@types/node': 26.4.0 + + jsesc@3.1.0: {} + + json-schema-traverse@0.4.1: {} + json-schema-traverse@1.0.0: {} - jsonc-parser@3.3.1: {} + json-stable-stringify-without-jsonify@1.0.1: {} + + jsonc-eslint-parser@3.3.0: + dependencies: + acorn: 8.18.0 + eslint-visitor-keys: 5.0.1 + verkit: 0.3.2 + + katex@0.16.47: + dependencies: + commander: 8.3.0 + + keyv@5.6.0: + dependencies: + '@keyv/serialize': 1.1.1 knitwork@1.3.0: {} + levn@0.4.1: + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + lightningcss-android-arm64@1.33.0: optional: true @@ -3130,18 +4841,21 @@ snapshots: optionalDependencies: yaml: 2.9.0 + local-pkg@1.2.1: + dependencies: + mlly: 1.8.2 + pkg-types: 2.3.1 + quansync: 0.2.11 + + locate-path@6.0.0: + dependencies: + p-locate: 5.0.0 + lodash.memoize@4.1.2: {} lodash.uniq@4.5.0: {} - log-update@8.0.0: - dependencies: - ansi-escapes: 7.3.0 - cli-cursor: 5.0.0 - slice-ansi: 9.0.0 - string-width: 8.2.2 - strip-ansi: 7.2.0 - wrap-ansi: 10.0.1 + longest-streak@3.1.0: {} magic-string@0.30.21: dependencies: @@ -3153,22 +4867,360 @@ snapshots: '@babel/types': 7.29.8 source-map-js: 1.2.1 + make-asynchronous@1.1.0: + dependencies: + p-event: 6.0.1 + type-fest: 4.41.0 + web-worker: 1.5.0 + make-dir@4.0.0: dependencies: semver: 7.8.5 + markdown-table@3.0.4: {} + + mdast-util-find-and-replace@3.0.2: + dependencies: + '@types/mdast': 4.0.4 + escape-string-regexp: 5.0.0 + unist-util-is: 6.0.1 + unist-util-visit-parents: 6.0.2 + + mdast-util-from-markdown@2.0.3(supports-color@7.2.0): + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + decode-named-character-reference: 1.3.0 + devlop: 1.1.0 + mdast-util-to-string: 4.0.0 + micromark: 4.0.2(supports-color@7.2.0) + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-decode-string: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + unist-util-stringify-position: 4.0.0 + transitivePeerDependencies: + - supports-color + + mdast-util-frontmatter@2.0.1(supports-color@7.2.0): + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + escape-string-regexp: 5.0.0 + mdast-util-from-markdown: 2.0.3(supports-color@7.2.0) + mdast-util-to-markdown: 2.1.2 + micromark-extension-frontmatter: 2.0.0 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm-autolink-literal@2.0.1: + dependencies: + '@types/mdast': 4.0.4 + ccount: 2.0.1 + devlop: 1.1.0 + mdast-util-find-and-replace: 3.0.2 + micromark-util-character: 2.1.1 + + mdast-util-gfm-footnote@2.1.0(supports-color@7.2.0): + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.3(supports-color@7.2.0) + mdast-util-to-markdown: 2.1.2 + micromark-util-normalize-identifier: 2.0.1 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm-strikethrough@2.0.0(supports-color@7.2.0): + dependencies: + '@types/mdast': 4.0.4 + mdast-util-from-markdown: 2.0.3(supports-color@7.2.0) + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm-table@2.0.0(supports-color@7.2.0): + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + markdown-table: 3.0.4 + mdast-util-from-markdown: 2.0.3(supports-color@7.2.0) + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm-task-list-item@2.0.0(supports-color@7.2.0): + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.3(supports-color@7.2.0) + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm@3.1.0(supports-color@7.2.0): + dependencies: + mdast-util-from-markdown: 2.0.3(supports-color@7.2.0) + mdast-util-gfm-autolink-literal: 2.0.1 + mdast-util-gfm-footnote: 2.1.0(supports-color@7.2.0) + mdast-util-gfm-strikethrough: 2.0.0(supports-color@7.2.0) + mdast-util-gfm-table: 2.0.0(supports-color@7.2.0) + mdast-util-gfm-task-list-item: 2.0.0(supports-color@7.2.0) + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-math@3.0.0(supports-color@7.2.0): + dependencies: + '@types/hast': 3.0.5 + '@types/mdast': 4.0.4 + devlop: 1.1.0 + longest-streak: 3.1.0 + mdast-util-from-markdown: 2.0.3(supports-color@7.2.0) + mdast-util-to-markdown: 2.1.2 + unist-util-remove-position: 5.0.0 + transitivePeerDependencies: + - supports-color + + mdast-util-phrasing@4.1.0: + dependencies: + '@types/mdast': 4.0.4 + unist-util-is: 6.0.1 + + mdast-util-to-markdown@2.1.2: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + longest-streak: 3.1.0 + mdast-util-phrasing: 4.1.0 + mdast-util-to-string: 4.0.0 + micromark-util-classify-character: 2.0.1 + micromark-util-decode-string: 2.0.1 + unist-util-visit: 5.1.0 + zwitch: 2.0.4 + + mdast-util-to-string@4.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdn-data@2.0.28: {} mdn-data@2.27.1: {} - merge2@1.4.1: {} + mdn-data@2.34.0: {} + + micromark-core-commonmark@2.0.3: + dependencies: + decode-named-character-reference: 1.3.0 + devlop: 1.1.0 + micromark-factory-destination: 2.0.1 + micromark-factory-label: 2.0.1 + micromark-factory-space: 2.0.1 + micromark-factory-title: 2.0.1 + micromark-factory-whitespace: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-chunked: 2.0.1 + micromark-util-classify-character: 2.0.1 + micromark-util-html-tag-name: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-subtokenize: 2.1.0 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-frontmatter@2.0.0: + dependencies: + fault: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-gfm-autolink-literal@2.1.0: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-sanitize-uri: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-gfm-footnote@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-core-commonmark: 2.0.3 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-sanitize-uri: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-gfm-strikethrough@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-util-chunked: 2.0.1 + micromark-util-classify-character: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-gfm-table@2.1.1: + dependencies: + devlop: 1.1.0 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-gfm-tagfilter@2.0.0: + dependencies: + micromark-util-types: 2.0.2 + + micromark-extension-gfm-task-list-item@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-gfm@3.0.0: + dependencies: + micromark-extension-gfm-autolink-literal: 2.1.0 + micromark-extension-gfm-footnote: 2.1.0 + micromark-extension-gfm-strikethrough: 2.1.0 + micromark-extension-gfm-table: 2.1.1 + micromark-extension-gfm-tagfilter: 2.0.0 + micromark-extension-gfm-task-list-item: 2.1.0 + micromark-util-combine-extensions: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-math@3.1.0: + dependencies: + '@types/katex': 0.16.8 + devlop: 1.1.0 + katex: 0.16.47 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-factory-destination@2.0.1: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-factory-label@2.0.1: + dependencies: + devlop: 1.1.0 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-factory-space@2.0.1: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-types: 2.0.2 + + micromark-factory-title@2.0.1: + dependencies: + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-factory-whitespace@2.0.1: + dependencies: + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-util-character@2.1.1: + dependencies: + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-util-chunked@2.0.1: + dependencies: + micromark-util-symbol: 2.0.1 + + micromark-util-classify-character@2.0.1: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-util-combine-extensions@2.0.1: + dependencies: + micromark-util-chunked: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-util-decode-numeric-character-reference@2.0.2: + dependencies: + micromark-util-symbol: 2.0.1 + + micromark-util-decode-string@2.0.1: + dependencies: + decode-named-character-reference: 1.3.0 + micromark-util-character: 2.1.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-symbol: 2.0.1 + + micromark-util-encode@2.0.1: {} + + micromark-util-html-tag-name@2.0.1: {} + + micromark-util-normalize-identifier@2.0.1: + dependencies: + micromark-util-symbol: 2.0.1 + + micromark-util-resolve-all@2.0.1: + dependencies: + micromark-util-types: 2.0.2 + + micromark-util-sanitize-uri@2.0.1: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-encode: 2.0.1 + micromark-util-symbol: 2.0.1 - micromatch@4.0.8: + micromark-util-subtokenize@2.1.0: dependencies: - braces: 3.0.3 - picomatch: 2.3.2 + devlop: 1.1.0 + micromark-util-chunked: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-util-symbol@2.0.1: {} - mimic-function@5.0.1: {} + micromark-util-types@2.0.2: {} + + micromark@4.0.2(supports-color@7.2.0): + dependencies: + '@types/debug': 4.1.13 + debug: 4.4.3(supports-color@7.2.0) + decode-named-character-reference: 1.3.0 + devlop: 1.1.0 + micromark-core-commonmark: 2.0.3 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-chunked: 2.0.1 + micromark-util-combine-extensions: 2.0.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-encode: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-sanitize-uri: 2.0.1 + micromark-util-subtokenize: 2.1.0 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + transitivePeerDependencies: + - supports-color + + minimatch@10.2.6: + dependencies: + brace-expansion: 5.0.9 mkdist@2.4.1(typescript@6.0.3): dependencies: @@ -3195,54 +5247,60 @@ snapshots: pkg-types: 1.3.1 ufo: 1.6.4 + module-replacements@3.3.0: {} + + ms@2.1.3: {} + nanoid@3.3.18: {} - node-releases@2.0.54: {} + natural-compare@1.4.0: {} - npm-run-path@6.0.0: - dependencies: - path-key: 4.0.0 - unicorn-magic: 0.3.0 + natural-orderby@5.0.0: {} + + node-releases@2.0.54: {} nth-check@2.1.1: dependencies: boolbase: 1.0.0 - nypm@0.6.9: - dependencies: - citty: 0.2.2 - pathe: 2.0.3 - tinyexec: 1.3.0 + object-deep-merge@2.0.1: {} obug@2.1.4: {} - onetime@7.0.0: + ohash@2.0.12: {} + + optionator@0.9.4: dependencies: - mimic-function: 5.0.1 + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.5 - oxfmt@0.65.0: + oxfmt@0.35.0: dependencies: tinypool: 2.1.0 optionalDependencies: - '@oxfmt/binding-android-arm-eabi': 0.65.0 - '@oxfmt/binding-android-arm64': 0.65.0 - '@oxfmt/binding-darwin-arm64': 0.65.0 - '@oxfmt/binding-darwin-x64': 0.65.0 - '@oxfmt/binding-freebsd-x64': 0.65.0 - '@oxfmt/binding-linux-arm-gnueabihf': 0.65.0 - '@oxfmt/binding-linux-arm-musleabihf': 0.65.0 - '@oxfmt/binding-linux-arm64-gnu': 0.65.0 - '@oxfmt/binding-linux-arm64-musl': 0.65.0 - '@oxfmt/binding-linux-ppc64-gnu': 0.65.0 - '@oxfmt/binding-linux-riscv64-gnu': 0.65.0 - '@oxfmt/binding-linux-riscv64-musl': 0.65.0 - '@oxfmt/binding-linux-s390x-gnu': 0.65.0 - '@oxfmt/binding-linux-x64-gnu': 0.65.0 - '@oxfmt/binding-linux-x64-musl': 0.65.0 - '@oxfmt/binding-openharmony-arm64': 0.65.0 - '@oxfmt/binding-win32-arm64-msvc': 0.65.0 - '@oxfmt/binding-win32-ia32-msvc': 0.65.0 - '@oxfmt/binding-win32-x64-msvc': 0.65.0 + '@oxfmt/binding-android-arm-eabi': 0.35.0 + '@oxfmt/binding-android-arm64': 0.35.0 + '@oxfmt/binding-darwin-arm64': 0.35.0 + '@oxfmt/binding-darwin-x64': 0.35.0 + '@oxfmt/binding-freebsd-x64': 0.35.0 + '@oxfmt/binding-linux-arm-gnueabihf': 0.35.0 + '@oxfmt/binding-linux-arm-musleabihf': 0.35.0 + '@oxfmt/binding-linux-arm64-gnu': 0.35.0 + '@oxfmt/binding-linux-arm64-musl': 0.35.0 + '@oxfmt/binding-linux-ppc64-gnu': 0.35.0 + '@oxfmt/binding-linux-riscv64-gnu': 0.35.0 + '@oxfmt/binding-linux-riscv64-musl': 0.35.0 + '@oxfmt/binding-linux-s390x-gnu': 0.35.0 + '@oxfmt/binding-linux-x64-gnu': 0.35.0 + '@oxfmt/binding-linux-x64-musl': 0.35.0 + '@oxfmt/binding-openharmony-arm64': 0.35.0 + '@oxfmt/binding-win32-arm64-msvc': 0.35.0 + '@oxfmt/binding-win32-ia32-msvc': 0.35.0 + '@oxfmt/binding-win32-x64-msvc': 0.35.0 oxlint@1.80.0: optionalDependencies: @@ -3265,10 +5323,35 @@ snapshots: '@oxlint/binding-win32-arm64-msvc': 1.80.0 '@oxlint/binding-win32-ia32-msvc': 1.80.0 '@oxlint/binding-win32-x64-msvc': 1.80.0 + optional: true + + p-event@6.0.1: + dependencies: + p-timeout: 6.1.4 + + p-limit@3.1.0: + dependencies: + yocto-queue: 0.1.0 + + p-locate@5.0.0: + dependencies: + p-limit: 3.1.0 + + p-timeout@6.1.4: {} + + package-manager-detector@1.8.0: {} + + parse-gitignore@2.0.0: {} - parse-ms@4.0.0: {} + parse-imports-exports@0.2.4: + dependencies: + parse-statements: 1.0.11 + + parse-statements@1.0.11: {} - path-key@4.0.0: {} + path-exists@4.0.0: {} + + path-key@3.1.1: {} path-parse@1.0.7: {} @@ -3276,8 +5359,6 @@ snapshots: picocolors@1.1.1: {} - picomatch@2.3.2: {} - picomatch@4.0.7: {} pkg-types@1.3.1: @@ -3292,6 +5373,12 @@ snapshots: exsolve: 1.1.1 pathe: 2.0.3 + pluralize@8.0.0: {} + + pnpm-workspace-yaml@1.9.1: + dependencies: + yaml: 2.9.0 + postcss-calc@10.1.1(postcss@8.5.26): dependencies: postcss: 8.5.26 @@ -3461,17 +5548,44 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + prelude-ls@1.2.1: {} + + prettier-linter-helpers@1.0.1: + dependencies: + fast-diff: 1.3.0 + + prettier@3.9.6: {} + pretty-bytes@7.1.1: {} - pretty-ms@9.3.0: + punycode@2.3.1: {} + + qified@0.10.1: dependencies: - parse-ms: 4.0.0 + hookified: 2.2.0 + + quansync@0.2.11: {} - queue-microtask@1.2.3: {} + quote-js-string@0.1.0: {} + + refa@0.12.1: + dependencies: + '@eslint-community/regexpp': 4.12.2 + + regexp-ast-analysis@0.7.1: + dependencies: + '@eslint-community/regexpp': 4.12.2 + refa: 0.12.1 + + regjsparser@0.13.2: + dependencies: + jsesc: 3.1.0 require-from-string@2.0.2: {} - resolve.exports@2.0.3: {} + reserved-identifiers@1.2.0: {} + + resolve-pkg-maps@1.0.0: {} resolve@1.22.12: dependencies: @@ -3480,13 +5594,6 @@ snapshots: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - restore-cursor@5.1.0: - dependencies: - onetime: 7.0.0 - signal-exit: 4.1.0 - - reusify@1.1.0: {} - rolldown@1.2.6: dependencies: '@oxc-project/types': 0.147.0 @@ -3551,16 +5658,24 @@ snapshots: '@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: {} + scslre@0.3.0: + dependencies: + '@eslint-community/regexpp': 4.12.2 + refa: 0.12.1 + regexp-ast-analysis: 0.7.1 + scule@1.3.0: {} semver@7.8.5: {} + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + sherif-darwin-arm64@1.13.0: optional: true @@ -3598,18 +5713,20 @@ snapshots: siginfo@2.0.0: {} - signal-exit@4.1.0: {} - simple-git-hooks@2.13.1: {} sisteransi@1.0.5: {} - slice-ansi@9.0.0: + source-map-js@1.2.1: {} + + spdx-exceptions@2.5.0: {} + + spdx-expression-parse@5.0.0: dependencies: - ansi-styles: 6.2.3 - is-fullwidth-code-point: 5.1.0 + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.23 - source-map-js@1.2.1: {} + spdx-license-ids@3.0.23: {} stackback@0.0.2: {} @@ -3617,16 +5734,7 @@ snapshots: string-argv@0.3.2: {} - string-width@8.2.2: - dependencies: - get-east-asian-width: 1.6.0 - strip-ansi: 7.2.0 - - strip-ansi@7.2.0: - dependencies: - ansi-regex: 6.3.0 - - strip-final-newline@4.0.0: {} + strip-indent@4.1.1: {} stylehacks@7.0.11(postcss@8.5.26): dependencies: @@ -3634,6 +5742,12 @@ snapshots: postcss: 8.5.26 postcss-selector-parser: 7.1.5 + super-regex@1.1.0: + dependencies: + function-timeout: 1.0.2 + make-asynchronous: 1.1.0 + time-span: 5.1.0 + supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -3650,6 +5764,16 @@ snapshots: picocolors: 1.1.1 sax: 1.6.1 + synckit@0.11.13: + dependencies: + '@pkgr/core': 0.3.6 + + tapable@2.3.3: {} + + time-span@5.1.0: + dependencies: + convert-hrtime: 5.0.0 + tinybench@2.9.0: {} tinyexec@1.3.0: {} @@ -3663,35 +5787,28 @@ snapshots: tinyrainbow@3.1.1: {} - to-regex-range@5.0.1: + to-valid-identifier@1.0.0: dependencies: - is-number: 7.0.0 + '@sindresorhus/base62': 1.0.0 + reserved-identifiers: 1.2.0 - typescript@6.0.3: {} + toml-eslint-parser@1.0.3: + dependencies: + eslint-visitor-keys: 5.0.1 - ufo@1.6.4: {} + ts-api-utils@2.5.0(typescript@6.0.3): + dependencies: + typescript: 6.0.3 - ultracite@7.10.7(oxfmt@0.65.0)(oxlint@1.80.0): + type-check@0.4.0: dependencies: - '@clack/prompts': 1.7.0 - cli-truncate: 6.1.1 - commander: 15.0.0 - deepmerge: 4.3.1 - empathic: 2.0.1 - execa: 10.0.1 - fast-glob: 3.3.3 - find-workspaces: 0.3.1 - jsonc-parser: 3.3.1 - log-update: 8.0.0 - magicast: 0.5.4 - nypm: 0.6.9 - resolve.exports: 2.0.3 - string-width: 8.2.2 - yaml: 2.9.0 - zod: 4.4.3 - optionalDependencies: - oxfmt: 0.65.0 - oxlint: 1.80.0 + prelude-ls: 1.2.1 + + type-fest@4.41.0: {} + + typescript@6.0.3: {} + + ufo@1.6.4: {} unbuild@3.6.1(typescript@6.0.3): dependencies: @@ -3730,7 +5847,29 @@ snapshots: undici-types@8.3.0: {} - unicorn-magic@0.3.0: {} + unist-util-is@6.0.1: + dependencies: + '@types/unist': 3.0.3 + + unist-util-remove-position@5.0.0: + dependencies: + '@types/unist': 3.0.3 + unist-util-visit: 5.1.0 + + unist-util-stringify-position@4.0.0: + dependencies: + '@types/unist': 3.0.3 + + unist-util-visit-parents@6.0.2: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.1 + + unist-util-visit@5.1.0: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.1 + unist-util-visit-parents: 6.0.2 untyped@2.0.0: dependencies: @@ -3746,8 +5885,14 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 + uri-js@4.4.1: + dependencies: + punycode: 2.3.1 + util-deprecate@1.0.2: {} + verkit@0.3.2: {} + vite@8.2.2(@types/node@26.4.0)(jiti@2.7.0)(yaml@2.9.0): dependencies: lightningcss: 1.33.0 @@ -3789,20 +5934,40 @@ snapshots: transitivePeerDependencies: - msw - which-command@0.1.0: {} + vue-eslint-parser@10.4.1(eslint@10.10.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + dependencies: + debug: 4.4.3(supports-color@7.2.0) + eslint: 10.10.0(jiti@2.7.0)(supports-color@7.2.0) + eslint-scope: 9.1.2 + eslint-visitor-keys: 5.0.1 + espree: 11.2.0 + esquery: 1.7.0 + semver: 7.8.5 + transitivePeerDependencies: + - supports-color + + web-worker@1.5.0: {} + + which@2.0.2: + dependencies: + isexe: 2.0.0 why-is-node-running@2.3.0: dependencies: siginfo: 2.0.0 stackback: 0.0.2 - wrap-ansi@10.0.1: + word-wrap@1.2.5: {} + + xml-name-validator@5.0.0: {} + + yaml-eslint-parser@2.1.0: dependencies: - ansi-styles: 6.2.3 - string-width: 8.2.2 + eslint-visitor-keys: 5.0.1 + yaml: 2.9.0 yaml@2.9.0: {} - yoctocolors@2.2.0: {} + yocto-queue@0.1.0: {} - zod@4.4.3: {} + zwitch@2.0.4: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 3e5baad..db89155 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,6 +1,6 @@ packages: - - "apps/*" - - "packages/*" + - 'apps/*' + - 'packages/*' # Lets playgrounds/* resolve local packages without the 'workspace:' protocol # during development. When a playground is cloned standalone, the same diff --git a/scripts/sync-sponsors.ts b/scripts/sync-sponsors.ts index 9f75f34..b49f362 100644 --- a/scripts/sync-sponsors.ts +++ b/scripts/sync-sponsors.ts @@ -1,87 +1,87 @@ -import { readdir, readFile, writeFile } from "node:fs/promises"; -import path from "node:path"; -import process from "node:process"; +import { readdir, readFile, writeFile } from 'node:fs/promises' +import path from 'node:path' +import process from 'node:process' interface Sponsor { - name: string | null; - login: string; - avatar: string; - amount: number; - createdAt: string; - tierTitle: string; - tierTitlePlural: string; - tierLevel: number; + name: string | null + login: string + avatar: string + amount: number + createdAt: string + tierTitle: string + tierTitlePlural: string + tierLevel: number /** Extra rel tokens for the sponsor's link (e.g. `sponsored`); may be empty. */ - rel: string; - link: string; + rel: string + link: string /** Tagline, present on sponsors that bought an ad slot. */ - description?: string; + description?: string /** 1-based ad-grid position the sponsor bought. */ - slot?: number; + slot?: number } -const SPONSORS_SOURCE_URL = - "https://raw.githubusercontent.com/middleapi/static/refs/heads/main/sponsors.json"; -const PAST_SPONSORS_URL = - "https://htmlpreview.github.io/?https://github.com/middleapi/static/blob/main/sponsors.svg"; -const ROOT_DIR = process.cwd(); -const README_FILE_NAME = "README.md"; +const SPONSORS_SOURCE_URL + = 'https://raw.githubusercontent.com/middleapi/static/refs/heads/main/sponsors.json' +const PAST_SPONSORS_URL + = 'https://htmlpreview.github.io/?https://github.com/middleapi/static/blob/main/sponsors.svg' +const ROOT_DIR = process.cwd() +const README_FILE_NAME = 'README.md' const SKIP_DIRS = new Set([ - "node_modules", - ".git", - "dist", - ".output", - ".next", - ".nuxt", - ".turbo", -]); - -const findReadmes = async (dir: string): Promise => { - const entries = await readdir(dir, { withFileTypes: true }); - const result: string[] = []; - const subdirPromises: Promise[] = []; + 'node_modules', + '.git', + 'dist', + '.output', + '.next', + '.nuxt', + '.turbo', +]) + +async function findReadmes(dir: string): Promise { + const entries = await readdir(dir, { withFileTypes: true }) + const result: string[] = [] + const subdirPromises: Promise[] = [] for (const entry of entries) { - const fullPath = path.join(dir, entry.name); + const fullPath = path.join(dir, entry.name) if (entry.isDirectory()) { if (SKIP_DIRS.has(entry.name)) { - continue; + continue } - subdirPromises.push(findReadmes(fullPath)); - } else if (entry.isFile() && entry.name === README_FILE_NAME) { - result.push(fullPath); + subdirPromises.push(findReadmes(fullPath)) + } + else if (entry.isFile() && entry.name === README_FILE_NAME) { + result.push(fullPath) } } - const subResults = await Promise.all(subdirPromises); - return [...result, ...subResults.flat()]; -}; + const subResults = await Promise.all(subdirPromises) + return [...result, ...subResults.flat()] +} /** `noopener` always, plus whatever extra tokens the data carries. */ -const relAttribute = (sponsor: Sponsor): string => - ["noopener", sponsor.rel].filter(Boolean).join(" "); - -const escapeHtml = (value: string): string => - value - .replaceAll("&", "&") - .replaceAll("<", "<") - .replaceAll(">", ">") - .replaceAll('"', """) - .replaceAll("'", "'"); - -const getTierImageSizeAndColumns = ( - tierLevel: number, - tierLevels: number[] -): [columns: number, imageSize: number] => { - const rank = tierLevels.indexOf(tierLevel); - - const columnByRank = [3, 4, 5, 6, 7, 8]; - const column = columnByRank[Math.min(rank, columnByRank.length - 1)] ?? 3; - return [column, Math.floor(838 / column)]; -}; +function relAttribute(sponsor: Sponsor): string { + return ['noopener', sponsor.rel].filter(Boolean).join(' ') +} + +function escapeHtml(value: string): string { + return value + .replaceAll('&', '&') + .replaceAll('<', '<') + .replaceAll('>', '>') + .replaceAll('"', '"') + .replaceAll('\'', ''') +} + +function getTierImageSizeAndColumns(tierLevel: number, tierLevels: number[]): [columns: number, imageSize: number] { + const rank = tierLevels.indexOf(tierLevel) + + const columnByRank = [3, 4, 5, 6, 7, 8] + const column = columnByRank[Math.min(rank, columnByRank.length - 1)] ?? 3 + return [column, Math.floor(838 / column)] +} /** * The slot sponsors' cards — logo on the left, name over tagline on the @@ -91,184 +91,182 @@ const getTierImageSizeAndColumns = ( * One cell per card, the logo floated with the deprecated-but-sanitizer-safe * `align`/`hspace` attributes, so no table border cuts through the card. */ -const buildSlotCards = (slotSponsors: Sponsor[]): string[] => { - const lines = [""]; +function buildSlotCards(slotSponsors: Sponsor[]): string[] { + const lines = ['
'] for (const sponsor of slotSponsors) { - const name = escapeHtml(sponsor.name ?? sponsor.login); - const description = escapeHtml(sponsor.description ?? ""); + const name = escapeHtml(sponsor.name ?? sponsor.login) + const description = escapeHtml(sponsor.description ?? '') lines.push( - " ", + ' ', ` `, - " " - ); + ' ', + ) } - lines.push("
${name}${name}
${description}
", ""); + lines.push('', '') - return lines; -}; + return lines +} -const buildSponsorsSection = (sponsors: Sponsor[]): string => { +function buildSponsorsSection(sponsors: Sponsor[]): string { const activeSponsors = sponsors.filter( - (sponsor) => sponsor.tierLevel > 0 && sponsor.amount > 0 - ); + sponsor => sponsor.tierLevel > 0 && sponsor.amount > 0, + ) const pastSponsors = sponsors.filter( - (sponsor) => sponsor.tierLevel <= 0 || sponsor.amount <= 0 - ); + sponsor => sponsor.tierLevel <= 0 || sponsor.amount <= 0, + ) // Slot sponsors are featured as cards up top; the tier tables below carry // everyone else so nobody appears twice. const slotSponsors = activeSponsors - .filter((sponsor) => sponsor.slot !== undefined) - .toSorted((a, b) => (a.slot ?? 0) - (b.slot ?? 0)); + .filter(sponsor => sponsor.slot !== undefined) + .toSorted((a, b) => (a.slot ?? 0) - (b.slot ?? 0)) const tieredSponsors = activeSponsors.filter( - (sponsor) => sponsor.slot === undefined - ); + sponsor => sponsor.slot === undefined, + ) - const groupedSponsors = new Map(); + const groupedSponsors = new Map() for (const sponsor of tieredSponsors) { - const group = groupedSponsors.get(sponsor.tierLevel); + const group = groupedSponsors.get(sponsor.tierLevel) if (group) { - group.push(sponsor); - continue; + group.push(sponsor) + continue } - groupedSponsors.set(sponsor.tierLevel, [sponsor]); + groupedSponsors.set(sponsor.tierLevel, [sponsor]) } const lines = [ - "## 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! 🚀", - "", - ]; + '## 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! 🚀', + '', + ] if (slotSponsors.length > 0) { - lines.push(...buildSlotCards(slotSponsors)); + lines.push(...buildSlotCards(slotSponsors)) } // Sizes rank against every active tier, slot sponsors' tiers included, so // featuring the top tiers as cards does not inflate the tables below them. const sizeTierLevels = [ - ...new Set(activeSponsors.map((sponsor) => sponsor.tierLevel)), - ].toSorted((a, b) => b - a); - const tierLevels = [...groupedSponsors.keys()].toSorted((a, b) => b - a); + ...new Set(activeSponsors.map(sponsor => sponsor.tierLevel)), + ].toSorted((a, b) => b - a) + const tierLevels = [...groupedSponsors.keys()].toSorted((a, b) => b - a) for (const tierLevel of tierLevels) { - const tierSponsors = groupedSponsors.get(tierLevel); + const tierSponsors = groupedSponsors.get(tierLevel) if (!tierSponsors || tierSponsors.length === 0) { - continue; + continue } - const tierTitle = tierSponsors[0]?.tierTitlePlural ?? `Tier ${tierLevel}`; + const tierTitle = tierSponsors[0]?.tierTitlePlural ?? `Tier ${tierLevel}` const [columns, imageSize] = getTierImageSizeAndColumns( tierLevel, - sizeTierLevels - ); + sizeTierLevels, + ) - lines.push(`### ${tierTitle}`, "", "", " "); + lines.push(`### ${tierTitle}`, '', '
', ' ') for (const [index, sponsor] of tierSponsors.entries()) { - const href = sponsor.link; - const displayName = sponsor.name ?? sponsor.login; - const escapedName = escapeHtml(displayName); + const href = sponsor.link + const displayName = sponsor.name ?? sponsor.login + const escapedName = escapeHtml(displayName) lines.push( - ` ` - ); + ` `, + ) - const isRowEnd = (index + 1) % columns === 0; - const isLast = index === tierSponsors.length - 1; + const isRowEnd = (index + 1) % columns === 0 + const isLast = index === tierSponsors.length - 1 if (isRowEnd && !isLast) { - lines.push(" ", " "); + lines.push(' ', ' ') } } - lines.push(" ", "
${escapedName}
${escapedName}
${escapedName}
${escapedName}
", ""); + lines.push(' ', '', '') } if (pastSponsors.length > 0) { - const noun = pastSponsors.length === 1 ? "past sponsor" : "past sponsors"; + const noun = pastSponsors.length === 1 ? 'past sponsor' : 'past sponsors' lines.push( `With thanks to [${pastSponsors.length} ${noun}](${PAST_SPONSORS_URL}) who helped get openapi-spec here.`, - "" - ); + '', + ) } - return `${lines.join("\n")}\n`; -}; + return `${lines.join('\n')}\n` +} -const replaceSponsorsSection = ( - content: string, - replacement: string -): string => { - const heading = "## Sponsors"; - const startIndex = content.indexOf(heading); +function replaceSponsorsSection(content: string, replacement: string): string { + const heading = '## Sponsors' + const startIndex = content.indexOf(heading) if (startIndex === -1) { - return content; + return content } const nextHeadingIndex = content.indexOf( - "\n## ", - startIndex + heading.length - ); - const endIndex = - nextHeadingIndex === -1 ? content.length : nextHeadingIndex + 1; + '\n## ', + startIndex + heading.length, + ) + const endIndex + = nextHeadingIndex === -1 ? content.length : nextHeadingIndex + 1 // Trimmed to a single trailing newline, or a section replaced at the end of // the file leaves a blank last line that the markdown fixer removes — and // the next sync would put back, forever. - return `${`${content.slice(0, startIndex)}${replacement}${content.slice(endIndex)}`.trimEnd()}\n`; -}; + return `${`${content.slice(0, startIndex)}${replacement}${content.slice(endIndex)}`.trimEnd()}\n` +} -const main = async (): Promise => { - const response = await fetch(SPONSORS_SOURCE_URL); +async function main(): Promise { + const response = await fetch(SPONSORS_SOURCE_URL) if (!response.ok) { throw new Error( - `Failed to fetch sponsors data: ${response.status} ${response.statusText}` - ); + `Failed to fetch sponsors data: ${response.status} ${response.statusText}`, + ) } // Links arrive with their tracking params already baked in upstream. // SAFETY: the payload is the trusted middleapi/static sponsors.json this // script exists to mirror; a shape drift shows up as a broken README diff. - const sponsors = (await response.json()) as Sponsor[]; - const readmeFiles = await findReadmes(ROOT_DIR); - const replacement = buildSponsorsSection(sponsors); + const sponsors = (await response.json()) as Sponsor[] + const readmeFiles = await findReadmes(ROOT_DIR) + const replacement = buildSponsorsSection(sponsors) const readmeContents = await Promise.all( - readmeFiles.map((readmePath) => readFile(readmePath, "utf-8")) - ); + readmeFiles.map(readmePath => readFile(readmePath, 'utf-8')), + ) - const writePromises: Promise[] = []; - let updatedCount = 0; + const writePromises: Promise[] = [] + let updatedCount = 0 for (const [i, content] of readmeContents.entries()) { - const nextContent = replaceSponsorsSection(content, replacement); - const readmePath = readmeFiles[i]; + const nextContent = replaceSponsorsSection(content, replacement) + const readmePath = readmeFiles[i] if (readmePath && nextContent !== content) { - writePromises.push(writeFile(readmePath, nextContent)); - updatedCount += 1; + writePromises.push(writeFile(readmePath, nextContent)) + updatedCount += 1 } } - await Promise.all(writePromises); - console.log(`Updated sponsors section in ${updatedCount} README files.`); -}; + await Promise.all(writePromises) + console.log(`Updated sponsors section in ${updatedCount} README files.`) +} try { - await main(); -} catch (error) { - console.error(error); - process.exitCode = 1; + await main() +} +catch (error) { + console.error(error) + process.exitCode = 1 } diff --git a/vitest.config.ts b/vitest.config.ts index 841b0c4..8af2e43 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,14 +1,14 @@ -import { defaultExclude, defineConfig } from "vitest/config"; +import { defaultExclude, defineConfig } from 'vitest/config' export default defineConfig({ test: { coverage: { - exclude: ["**.bench.*", "**.test-d.*", "**.test.*"], - include: ["apps/*/src/**", "packages/*/src/**"], + exclude: ['**.bench.*', '**.test-d.*', '**.test.*'], + include: ['apps/*/src/**', 'packages/*/src/**'], }, - exclude: [...defaultExclude, "**/.claude/**"], + exclude: [...defaultExclude, '**/.claude/**'], globals: true, - include: ["**/*.test.ts"], + include: ['**/*.test.ts'], passWithNoTests: true, }, -}); +})