fumadocs-openapi 10.10.3 → 11.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/generated/shared.css +1 -1159
- package/css/preset.css +1 -0
- package/dist/.translations/index.d.ts +80 -0
- package/dist/.translations/keys.js +80 -0
- package/dist/_virtual/_rolldown/runtime.js +1 -10
- package/dist/generate-file.d.ts +0 -4
- package/dist/generate-file.js +4 -5
- package/dist/i18n.d.ts +5 -100
- package/dist/i18n.js +8 -108
- package/dist/index.d.ts +4 -4
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.8 → @scalar_openapi-upgrader@0.2.9}/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.8 → @scalar_openapi-upgrader@0.2.9}/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.8 → @scalar_openapi-upgrader@0.2.9}/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.8 → @scalar_openapi-upgrader@0.2.9}/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.8 → @scalar_openapi-upgrader@0.2.9}/node_modules/@scalar/openapi-upgrader/dist/upgrade.js +1 -1
- package/dist/playground/auth.js +4 -4
- package/dist/playground/client.d.ts +12 -21
- package/dist/playground/client.js +80 -59
- package/dist/playground/components/oauth-dialog.js +33 -33
- package/dist/playground/components/result-display.d.ts +1 -2
- package/dist/playground/components/result-display.js +7 -8
- package/dist/playground/components/server-select.js +11 -11
- package/dist/playground/status-info.js +29 -37
- package/dist/requests/generators/csharp.js +3 -3
- package/dist/requests/generators/curl.js +2 -2
- package/dist/requests/generators/go.js +2 -2
- package/dist/requests/generators/index.d.ts +28 -41
- package/dist/requests/generators/index.js +18 -35
- package/dist/requests/generators/java.js +2 -2
- package/dist/requests/generators/javascript.js +2 -2
- package/dist/requests/generators/python.js +2 -2
- package/dist/scalar/client.js +3 -2
- package/dist/scalar/index.d.ts +2 -2
- package/dist/scalar/index.js +10 -9
- package/dist/server/index.d.ts +23 -27
- package/dist/server/index.js +42 -38
- package/dist/server/proxy.d.ts +0 -6
- package/dist/server/proxy.js +2 -4
- package/dist/{_openapi/types.d.ts → types/openapi.d.ts} +127 -136
- package/dist/types.d.ts +14 -18
- package/dist/ui/base.d.ts +15 -162
- package/dist/ui/base.js +148 -107
- package/dist/ui/components/codeblock.js +6 -14
- package/dist/ui/components/heading.js +8 -4
- package/dist/ui/components/markdown.js +12 -0
- package/dist/ui/contexts/api.js +8 -26
- package/dist/ui/index.d.ts +204 -7
- package/dist/ui/index.js +10 -15
- package/dist/ui/operation/context.js +48 -0
- package/dist/ui/operation/index.js +168 -126
- package/dist/ui/operation/request-tabs.d.ts +10 -5
- package/dist/ui/operation/request-tabs.js +35 -22
- package/dist/ui/operation/response-tabs.d.ts +5 -2
- package/dist/ui/operation/response-tabs.js +22 -15
- package/dist/ui/operation/usage-tabs.js +144 -0
- package/dist/utils/document/dereference.d.ts +1 -1
- package/dist/utils/document/dereference.js +5 -8
- package/dist/utils/document/load.js +17 -0
- package/dist/utils/get-example-requests.d.ts +13 -0
- package/dist/{ui/operation → utils}/get-example-requests.js +31 -20
- package/dist/utils/pages/builder.d.ts +38 -10
- package/dist/utils/pages/builder.js +12 -10
- package/dist/utils/pages/preset-auto.d.ts +1 -2
- package/dist/utils/pages/preset-auto.js +15 -15
- package/dist/utils/pages/to-static-data.js +5 -4
- package/dist/utils/pages/to-text.d.ts +1 -0
- package/dist/utils/pages/to-text.js +21 -11
- package/dist/utils/remove-undefined.js +14 -9
- package/dist/utils/schema.d.ts +2 -0
- package/dist/utils/{schema/index.js → schema.js} +3 -30
- package/dist/{ui/client → utils}/storage-key.js +3 -3
- package/package.json +16 -29
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/bundle.js +0 -239
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/dereference.js +0 -187
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/index.js +0 -136
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/normalize-args.js +0 -41
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/options.js +0 -124
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parse.js +0 -109
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/binary.js +0 -30
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/json.js +0 -46
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/text.js +0 -36
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/yaml.js +0 -49
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/pointer.js +0 -242
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/ref.js +0 -247
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/refs.js +0 -210
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolve-external.js +0 -100
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/file.js +0 -41
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/http.js +0 -112
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/convert-path-to-posix.js +0 -8
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/errors.js +0 -146
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/is-windows.js +0 -5
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/maybe.js +0 -18
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/next.js +0 -11
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/plugins.js +0 -99
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/schema-resources.js +0 -30
- package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/url.js +0 -315
- package/dist/node_modules/.pnpm/@fastify_deepmerge@3.2.1/node_modules/@fastify/deepmerge/index.js +0 -108
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/2020.js +0 -110
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js +0 -138
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +0 -674
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js +0 -141
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +0 -102
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +0 -223
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +0 -28
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js +0 -18
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js +0 -133
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js +0 -61
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +0 -146
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +0 -23
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +0 -48
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +0 -172
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +0 -31
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +0 -433
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +0 -113
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +0 -72
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +0 -583
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.js +0 -18
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +0 -42
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.js +0 -50
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.js +0 -20
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.js +0 -51
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.js +0 -16
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.js +0 -36
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.js +0 -19
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.js +0 -85
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.js +0 -59
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js +0 -12
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js +0 -25
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +0 -12
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +0 -16
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +0 -57
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -96
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +0 -29
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +0 -16
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +0 -89
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +0 -87
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +0 -16
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +0 -62
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +0 -60
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +0 -59
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +0 -34
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js +0 -31
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +0 -51
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +0 -61
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +0 -17
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +0 -52
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +0 -41
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +0 -17
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +0 -130
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js +0 -14
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +0 -22
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +0 -112
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +0 -101
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +0 -14
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js +0 -35
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +0 -46
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +0 -45
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js +0 -22
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +0 -20
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +0 -15
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +0 -92
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +0 -10
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js +0 -23
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js +0 -19
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js +0 -13
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +0 -46
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +0 -59
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +0 -27
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +0 -17
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +0 -49
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +0 -48
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js +0 -18
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +0 -28
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +0 -33
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +0 -47
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +0 -28
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +0 -27
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +0 -38
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +0 -72
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +0 -70
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +0 -33
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js +0 -236
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js +0 -187
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js +0 -282
- package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +0 -78
- package/dist/playground/components/inputs.js +0 -419
- package/dist/playground/components/spinner.js +0 -15
- package/dist/playground/schema.d.ts +0 -15
- package/dist/playground/schema.js +0 -144
- package/dist/ui/api-page.d.ts +0 -31
- package/dist/ui/api-page.js +0 -59
- package/dist/ui/client/boundary.d.ts +0 -11
- package/dist/ui/client/boundary.js +0 -17
- package/dist/ui/client/boundary.lazy.js +0 -19
- package/dist/ui/client/full.js +0 -13
- package/dist/ui/client/i18n.js +0 -16
- package/dist/ui/client/index.d.ts +0 -42
- package/dist/ui/client/index.js +0 -7
- package/dist/ui/components/accordion.js +0 -67
- package/dist/ui/components/codeblock.d.ts +0 -14
- package/dist/ui/components/dialog.js +0 -56
- package/dist/ui/components/input.js +0 -17
- package/dist/ui/components/select-tab.js +0 -56
- package/dist/ui/components/select.js +0 -71
- package/dist/ui/contexts/api.d.ts +0 -29
- package/dist/ui/create-client.d.ts +0 -26
- package/dist/ui/create-client.js +0 -125
- package/dist/ui/operation/client.js +0 -78
- package/dist/ui/operation/get-example-requests.d.ts +0 -11
- package/dist/ui/operation/usage-tabs/client.d.ts +0 -14
- package/dist/ui/operation/usage-tabs/client.js +0 -91
- package/dist/ui/operation/usage-tabs/index.js +0 -54
- package/dist/ui/schema/client.d.ts +0 -18
- package/dist/ui/schema/client.js +0 -410
- package/dist/ui/schema/index.d.ts +0 -61
- package/dist/ui/schema/index.js +0 -256
- package/dist/utils/auto-anchor.client.js +0 -20
- package/dist/utils/auto-anchor.js +0 -17
- package/dist/utils/deep-equal.js +0 -21
- package/dist/utils/document/process.d.ts +0 -6
- package/dist/utils/document/process.js +0 -18
- package/dist/utils/id-to-title.js +0 -12
- package/dist/utils/is-plain-object.js +0 -8
- package/dist/utils/merge-refs.js +0 -11
- package/dist/utils/schema/dereference.js +0 -45
- package/dist/utils/schema/index.d.ts +0 -18
- package/dist/utils/schema/merge.js +0 -156
- package/dist/utils/schema/pick.js +0 -44
- package/dist/utils/schema/ref.js +0 -35
- package/dist/utils/schema/resolve-ref.js +0 -11
- package/dist/utils/schema/sample.js +0 -442
- package/dist/utils/schema/to-string.d.ts +0 -1
- package/dist/utils/schema/to-string.js +0 -53
- package/dist/utils/url.js +0 -39
package/dist/server/proxy.js
CHANGED
|
@@ -14,9 +14,7 @@ const methodsWithBody = new Set([
|
|
|
14
14
|
"DELETE"
|
|
15
15
|
]);
|
|
16
16
|
function createProxy(options = {}) {
|
|
17
|
-
const { allowedOrigins,
|
|
18
|
-
return !allowedUrls || allowedUrls.some((item) => req.url.startsWith(item));
|
|
19
|
-
}, overrides } = options;
|
|
17
|
+
const { allowedOrigins, filterRequest, overrides } = options;
|
|
20
18
|
const handlers = { handle: handler };
|
|
21
19
|
async function handler(req) {
|
|
22
20
|
const searchParams = new URL(req.url).searchParams;
|
|
@@ -26,7 +24,7 @@ function createProxy(options = {}) {
|
|
|
26
24
|
if (!targetUrl) return Response.json("[Proxy] Invalid `url` parameter value.", { status: 400 });
|
|
27
25
|
if (allowedOrigins && !allowedOrigins.includes(targetUrl.origin)) return Response.json(`[Proxy] The origin "${targetUrl.origin}" is not allowed.`, { status: 400 });
|
|
28
26
|
const proxied = await rewriteRequest(req, targetUrl, searchParams.get("cookie"));
|
|
29
|
-
if (!filterRequest(proxied)) return Response.json("[Proxy] The proxied request is not allowed", { status: 403 });
|
|
27
|
+
if (filterRequest && !filterRequest(proxied)) return Response.json("[Proxy] The proxied request is not allowed", { status: 403 });
|
|
30
28
|
try {
|
|
31
29
|
return rewriteResponse(await fetch(proxied));
|
|
32
30
|
} catch (err) {
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
//#region src/
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* - all attributes are optional, you can't rely on the specification for user input
|
|
6
|
-
* - extensions (basically any attributes, not only prefixed with an `x-`) are allowed
|
|
7
|
-
*
|
|
8
|
-
* We deal with user input and can't assume they really stick to any official specification.
|
|
1
|
+
//#region src/types/openapi.d.ts
|
|
2
|
+
/** Original copy: https://github.com/scalar/scalar/blob/main/packages/openapi-types/src/openapi-types.ts
|
|
3
|
+
* - Removed Record<string, unknown> fallbacks
|
|
9
4
|
*/
|
|
10
|
-
/** any other attribute, for example x-* extensions */
|
|
11
5
|
declare namespace OpenAPI {
|
|
12
6
|
type Document<T = {}> = OpenAPIV2.Document<T> | OpenAPIV3.Document<T> | OpenAPIV3_1.Document<T> | OpenAPIV3_2.Document<T>;
|
|
13
7
|
type Operation<T = {}> = OpenAPIV2.OperationObject<T> | OpenAPIV3.OperationObject<T> | OpenAPIV3_1.OperationObject<T> | OpenAPIV3_2.OperationObject<T>;
|
|
@@ -27,12 +21,12 @@ declare namespace OpenAPI {
|
|
|
27
21
|
}
|
|
28
22
|
declare namespace OpenAPIV3_2 {
|
|
29
23
|
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
30
|
-
|
|
24
|
+
type PathsWebhooksComponents<T = {}> = {
|
|
31
25
|
paths?: PathsObject<T>;
|
|
32
26
|
webhooks?: Record<string, PathItemObject | ReferenceObject>;
|
|
33
27
|
components?: ComponentsObject;
|
|
34
28
|
};
|
|
35
|
-
|
|
29
|
+
type Document<T = {}> = Modify<Omit<OpenAPIV3_1.Document<T>, 'paths' | 'components' | 'webhooks' | 'tags'>, {
|
|
36
30
|
/**
|
|
37
31
|
* Version of the OpenAPI specification
|
|
38
32
|
* @see https://github.com/OAI/OpenAPI-Specification/tree/main/versions
|
|
@@ -43,25 +37,25 @@ declare namespace OpenAPIV3_2 {
|
|
|
43
37
|
$self?: string;
|
|
44
38
|
tags?: TagObject[];
|
|
45
39
|
} & ((Pick<PathsWebhooksComponents<T>, 'paths'> & Omit<Partial<PathsWebhooksComponents<T>>, 'paths'>) | (Pick<PathsWebhooksComponents<T>, 'webhooks'> & Omit<Partial<PathsWebhooksComponents<T>>, 'webhooks'>) | (Pick<PathsWebhooksComponents<T>, 'components'> & Omit<Partial<PathsWebhooksComponents<T>>, 'components'>)) & T>;
|
|
46
|
-
|
|
40
|
+
type ServerObject = Modify<OpenAPIV3_1.ServerObject, {
|
|
47
41
|
name?: string;
|
|
48
42
|
}>;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
type PathsObject<T = {}, P extends {} = {}> = Record<string, (PathItemObject<T> & P) | undefined>;
|
|
44
|
+
type HttpMethods = OpenAPIV3_1.HttpMethods | 'query';
|
|
45
|
+
type PathItemObject<T = {}> = Modify<OpenAPIV3_1.PathItemObject<T>, { [method in HttpMethods]?: OperationObject<T> }> & {
|
|
52
46
|
additionalOperations?: Record<string, OperationObject<T>>;
|
|
53
47
|
parameters?: (ReferenceObject | ParameterObject)[];
|
|
54
48
|
};
|
|
55
|
-
|
|
49
|
+
type OperationObject<T = {}> = Modify<OpenAPIV3_1.OperationObject<T>, {
|
|
56
50
|
parameters?: (ReferenceObject | ParameterObject)[];
|
|
57
51
|
requestBody?: ReferenceObject | RequestBodyObject;
|
|
58
52
|
responses?: ResponsesObject;
|
|
59
53
|
callbacks?: Record<string, ReferenceObject | CallbackObject>;
|
|
60
54
|
servers?: ServerObject[];
|
|
61
55
|
}> & T;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
type ParameterStyle = OpenAPIV3_1.ParameterStyle | 'cookie';
|
|
57
|
+
type ParameterLocation = OpenAPIV3_1.ParameterLocation | 'querystring';
|
|
58
|
+
type ParameterObject = Modify<OpenAPIV3_1.ParameterObject, {
|
|
65
59
|
style?: ParameterStyle;
|
|
66
60
|
in?: ParameterLocation;
|
|
67
61
|
schema?: ReferenceObject | SchemaObject;
|
|
@@ -69,49 +63,49 @@ declare namespace OpenAPIV3_2 {
|
|
|
69
63
|
[media: string]: ReferenceObject | ExampleObject;
|
|
70
64
|
};
|
|
71
65
|
}>;
|
|
72
|
-
|
|
66
|
+
type HeaderObject = Modify<OpenAPIV3_1.HeaderObject, {
|
|
73
67
|
content?: {
|
|
74
68
|
[media: string]: ReferenceObject | MediaTypeObject;
|
|
75
69
|
};
|
|
76
70
|
schema?: ReferenceObject | SchemaObject;
|
|
77
71
|
}>;
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
type NonArraySchemaObjectType = OpenAPIV3_1.NonArraySchemaObjectType;
|
|
73
|
+
type ArraySchemaObjectType = OpenAPIV3_1.ArraySchemaObjectType;
|
|
80
74
|
/**
|
|
81
75
|
* There is no way to tell typescript to require items when type is either 'array' or array containing 'array' type
|
|
82
76
|
* 'items' will be always visible as optional
|
|
83
77
|
* Casting schema object to ArraySchemaObject or NonArraySchemaObject will work fine
|
|
84
78
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
type SchemaObject = ArraySchemaObject | NonArraySchemaObject | MixedSchemaObject | boolean;
|
|
80
|
+
type ArraySchemaObject = {
|
|
87
81
|
type?: ArraySchemaObjectType;
|
|
88
82
|
items?: ReferenceObject | SchemaObject;
|
|
89
83
|
} & BaseSchemaObject;
|
|
90
|
-
|
|
84
|
+
type NonArraySchemaObject = {
|
|
91
85
|
type?: NonArraySchemaObjectType;
|
|
92
86
|
} & BaseSchemaObject;
|
|
93
87
|
type MixedSchemaObject = {
|
|
94
88
|
type?: (ArraySchemaObjectType | NonArraySchemaObjectType)[];
|
|
95
89
|
items?: ReferenceObject | SchemaObject;
|
|
96
90
|
} & BaseSchemaObject;
|
|
97
|
-
|
|
91
|
+
type BaseSchemaObject = Modify<OpenAPIV3_1.BaseSchemaObject, {
|
|
98
92
|
examples?: ExampleObject[];
|
|
99
93
|
discriminator?: DiscriminatorObject;
|
|
100
94
|
xml?: XMLObject;
|
|
101
95
|
}>;
|
|
102
|
-
|
|
96
|
+
type DiscriminatorObject = OpenAPIV3_1.DiscriminatorObject & {
|
|
103
97
|
defaultMapping?: string;
|
|
104
98
|
};
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
type XMLNodeType = 'element' | 'attribute' | 'text' | 'cdata' | 'comment';
|
|
100
|
+
type XMLObject = Omit<OpenAPIV3_1.XMLObject, 'wrapped' | 'attribute'> & {
|
|
107
101
|
nodeType?: XMLNodeType;
|
|
108
102
|
};
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
type ReferenceObject = OpenAPIV3_1.ReferenceObject;
|
|
104
|
+
type ExampleObject = OpenAPIV3_1.ExampleObject & {
|
|
111
105
|
dataValue?: any;
|
|
112
106
|
serializedValue?: string;
|
|
113
107
|
};
|
|
114
|
-
|
|
108
|
+
type MediaTypeObject = Modify<OpenAPIV3_1.MediaTypeObject, {
|
|
115
109
|
schema?: ReferenceObject | SchemaObject;
|
|
116
110
|
examples?: Record<string, ReferenceObject | ExampleObject>;
|
|
117
111
|
encoding?: {
|
|
@@ -122,7 +116,7 @@ declare namespace OpenAPIV3_2 {
|
|
|
122
116
|
itemEncoding?: EncodingObject;
|
|
123
117
|
prefixEncoding?: EncodingObject[];
|
|
124
118
|
};
|
|
125
|
-
|
|
119
|
+
type EncodingObject = Modify<OpenAPIV3_1.EncodingObject, {
|
|
126
120
|
headers?: {
|
|
127
121
|
[header: string]: ReferenceObject | HeaderObject;
|
|
128
122
|
};
|
|
@@ -131,13 +125,13 @@ declare namespace OpenAPIV3_2 {
|
|
|
131
125
|
prefixEncoding?: EncodingObject[];
|
|
132
126
|
itemEncoding?: EncodingObject;
|
|
133
127
|
};
|
|
134
|
-
|
|
128
|
+
type RequestBodyObject = Modify<OpenAPIV3_1.RequestBodyObject, {
|
|
135
129
|
content?: {
|
|
136
130
|
[media: string]: ReferenceObject | MediaTypeObject;
|
|
137
131
|
};
|
|
138
132
|
}>;
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
type ResponsesObject = Record<string, ReferenceObject | ResponseObject>;
|
|
134
|
+
type ResponseObject = Modify<OpenAPIV3_1.ResponseObject, {
|
|
141
135
|
headers?: {
|
|
142
136
|
[header: string]: ReferenceObject | HeaderObject;
|
|
143
137
|
};
|
|
@@ -150,11 +144,11 @@ declare namespace OpenAPIV3_2 {
|
|
|
150
144
|
}> & {
|
|
151
145
|
summary?: string;
|
|
152
146
|
};
|
|
153
|
-
|
|
147
|
+
type LinkObject = Modify<OpenAPIV3_1.LinkObject, {
|
|
154
148
|
server?: ServerObject;
|
|
155
149
|
}>;
|
|
156
|
-
|
|
157
|
-
|
|
150
|
+
type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
|
|
151
|
+
type ComponentsObject = Modify<OpenAPIV3_1.ComponentsObject, {
|
|
158
152
|
schemas?: Record<string, SchemaObject>;
|
|
159
153
|
responses?: Record<string, ReferenceObject | ResponseObject>;
|
|
160
154
|
parameters?: Record<string, ReferenceObject | ParameterObject>;
|
|
@@ -167,35 +161,34 @@ declare namespace OpenAPIV3_2 {
|
|
|
167
161
|
pathItems?: Record<string, ReferenceObject | PathItemObject>;
|
|
168
162
|
mediaTypes?: Record<string, MediaTypeObject | ReferenceObject>;
|
|
169
163
|
}>;
|
|
170
|
-
|
|
164
|
+
type SecuritySchemeObject = (HttpSecurityScheme | ApiKeySecurityScheme | OAuth2SecurityScheme | OpenIdSecurityScheme) & {
|
|
171
165
|
deprecated?: boolean;
|
|
172
166
|
};
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
167
|
+
type HttpSecurityScheme = OpenAPIV3_1.HttpSecurityScheme;
|
|
168
|
+
type ApiKeySecurityScheme = OpenAPIV3_1.ApiKeySecurityScheme;
|
|
169
|
+
type OAuthFlows = OpenAPIV3_1.OAuthFlows & {
|
|
176
170
|
deviceAuthorization?: OpenAPIV3.OAuthFlowBase & OpenAPIV3.OAuthFlowTokenUrlTrait & {
|
|
177
171
|
deviceAuthorizationUrl?: string;
|
|
178
172
|
};
|
|
179
173
|
};
|
|
180
|
-
|
|
174
|
+
type OAuth2SecurityScheme = Modify<OpenAPIV3_1.OAuth2SecurityScheme, {
|
|
181
175
|
flows?: OAuthFlows;
|
|
182
176
|
}>;
|
|
183
|
-
|
|
184
|
-
|
|
177
|
+
type OpenIdSecurityScheme = OpenAPIV3_1.OpenIdSecurityScheme;
|
|
178
|
+
type TagObject = OpenAPIV3_1.TagObject & {
|
|
185
179
|
summary?: string;
|
|
186
180
|
parent?: string;
|
|
187
181
|
kind?: string;
|
|
188
182
|
};
|
|
189
|
-
export {};
|
|
190
183
|
}
|
|
191
184
|
declare namespace OpenAPIV3_1 {
|
|
192
185
|
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
193
|
-
|
|
186
|
+
type PathsWebhooksComponents<T = {}> = {
|
|
194
187
|
paths?: PathsObject<T>;
|
|
195
188
|
webhooks?: Record<string, PathItemObject | ReferenceObject>;
|
|
196
189
|
components?: ComponentsObject;
|
|
197
190
|
};
|
|
198
|
-
|
|
191
|
+
type Document<T = {}> = Modify<Omit<OpenAPIV3.Document<T>, 'paths' | 'components'>, {
|
|
199
192
|
/**
|
|
200
193
|
* Version of the OpenAPI specification
|
|
201
194
|
* @see https://github.com/OAI/OpenAPI-Specification/tree/main/versions
|
|
@@ -206,69 +199,69 @@ declare namespace OpenAPIV3_1 {
|
|
|
206
199
|
jsonSchemaDialect?: string;
|
|
207
200
|
servers?: ServerObject[];
|
|
208
201
|
} & ((Pick<PathsWebhooksComponents<T>, 'paths'> & Omit<Partial<PathsWebhooksComponents<T>>, 'paths'>) | (Pick<PathsWebhooksComponents<T>, 'webhooks'> & Omit<Partial<PathsWebhooksComponents<T>>, 'webhooks'>) | (Pick<PathsWebhooksComponents<T>, 'components'> & Omit<Partial<PathsWebhooksComponents<T>>, 'components'>)) & T>;
|
|
209
|
-
|
|
202
|
+
type InfoObject = Modify<OpenAPIV3.InfoObject, {
|
|
210
203
|
summary?: string;
|
|
211
204
|
license?: LicenseObject;
|
|
212
205
|
}>;
|
|
213
|
-
|
|
214
|
-
|
|
206
|
+
type ContactObject = OpenAPIV3.ContactObject;
|
|
207
|
+
type LicenseObject = Modify<OpenAPIV3.LicenseObject, {
|
|
215
208
|
identifier?: string;
|
|
216
209
|
}>;
|
|
217
|
-
|
|
210
|
+
type ServerObject = Modify<OpenAPIV3.ServerObject, {
|
|
218
211
|
url?: string;
|
|
219
212
|
description?: string;
|
|
220
213
|
variables?: Record<string, ServerVariableObject>;
|
|
221
214
|
}>;
|
|
222
|
-
|
|
215
|
+
type ServerVariableObject = Modify<OpenAPIV3.ServerVariableObject, {
|
|
223
216
|
enum?: [string, ...string[]];
|
|
224
217
|
}>;
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
218
|
+
type PathsObject<T = {}, P extends {} = {}> = Record<string, (PathItemObject<T> & P) | undefined>;
|
|
219
|
+
type HttpMethods = OpenAPIV3.HttpMethods;
|
|
220
|
+
type PathItemObject<T = {}> = Modify<OpenAPIV3.PathItemObject<T>, {
|
|
228
221
|
servers?: ServerObject[];
|
|
229
222
|
parameters?: (ReferenceObject | ParameterObject)[];
|
|
230
223
|
}> & { [method in HttpMethods]?: OperationObject<T> };
|
|
231
|
-
|
|
224
|
+
type OperationObject<T = {}> = Modify<OpenAPIV3.OperationObject<T>, {
|
|
232
225
|
parameters?: (ReferenceObject | ParameterObject)[];
|
|
233
226
|
requestBody?: ReferenceObject | RequestBodyObject;
|
|
234
227
|
responses?: ResponsesObject;
|
|
235
228
|
callbacks?: Record<string, ReferenceObject | CallbackObject>;
|
|
236
229
|
servers?: ServerObject[];
|
|
237
230
|
}> & T;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
231
|
+
type ExternalDocumentationObject = OpenAPIV3.ExternalDocumentationObject;
|
|
232
|
+
type ParameterStyle = OpenAPIV3.ParameterStyle;
|
|
233
|
+
type ParameterLocation = OpenAPIV3.ParameterLocation;
|
|
234
|
+
type ParameterObject = OpenAPIV3.ParameterObject;
|
|
235
|
+
type HeaderObject = Modify<OpenAPIV3.HeaderObject, {
|
|
243
236
|
content?: {
|
|
244
237
|
[media: string]: MediaTypeObject;
|
|
245
238
|
};
|
|
246
239
|
}>;
|
|
247
|
-
|
|
240
|
+
type ParameterBaseObject = Modify<OpenAPIV3.ParameterBaseObject, {
|
|
248
241
|
content?: {
|
|
249
242
|
[media: string]: MediaTypeObject;
|
|
250
243
|
};
|
|
251
244
|
}>;
|
|
252
|
-
|
|
253
|
-
|
|
245
|
+
type NonArraySchemaObjectType = OpenAPIV3.NonArraySchemaObjectType | 'null';
|
|
246
|
+
type ArraySchemaObjectType = OpenAPIV3.ArraySchemaObjectType;
|
|
254
247
|
/**
|
|
255
248
|
* There is no way to tell typescript to require items when type is either 'array' or array containing 'array' type
|
|
256
249
|
* 'items' will be always visible as optional
|
|
257
250
|
* Casting schema object to ArraySchemaObject or NonArraySchemaObject will work fine
|
|
258
251
|
*/
|
|
259
|
-
|
|
260
|
-
|
|
252
|
+
type SchemaObject = ArraySchemaObject | NonArraySchemaObject | MixedSchemaObject | boolean;
|
|
253
|
+
type ArraySchemaObject = {
|
|
261
254
|
type?: ArraySchemaObjectType;
|
|
262
255
|
items?: ReferenceObject | SchemaObject;
|
|
263
256
|
} & BaseSchemaObject;
|
|
264
|
-
|
|
257
|
+
type NonArraySchemaObject = {
|
|
265
258
|
type?: NonArraySchemaObjectType;
|
|
266
259
|
} & BaseSchemaObject;
|
|
267
260
|
type MixedSchemaObject = {
|
|
268
261
|
type?: (ArraySchemaObjectType | NonArraySchemaObjectType)[];
|
|
269
262
|
items?: ReferenceObject | SchemaObject;
|
|
270
263
|
} & BaseSchemaObject;
|
|
271
|
-
|
|
264
|
+
type BaseSchemaObject = Modify<Omit<OpenAPIV3.BaseSchemaObject, 'nullable'>, {
|
|
272
265
|
examples?: OpenAPIV3.BaseSchemaObject['example'][];
|
|
273
266
|
exclusiveMinimum?: number;
|
|
274
267
|
exclusiveMaximum?: number;
|
|
@@ -290,25 +283,25 @@ declare namespace OpenAPIV3_1 {
|
|
|
290
283
|
xml?: XMLObject;
|
|
291
284
|
const?: any;
|
|
292
285
|
}>;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
286
|
+
type DiscriminatorObject = OpenAPIV3.DiscriminatorObject;
|
|
287
|
+
type XMLObject = OpenAPIV3.XMLObject;
|
|
288
|
+
type ReferenceObject = Modify<OpenAPIV3.ReferenceObject, {
|
|
296
289
|
summary?: string;
|
|
297
290
|
description?: string;
|
|
298
291
|
}>;
|
|
299
|
-
|
|
300
|
-
|
|
292
|
+
type ExampleObject = OpenAPIV3.ExampleObject;
|
|
293
|
+
type MediaTypeObject = Modify<OpenAPIV3.MediaTypeObject, {
|
|
301
294
|
schema?: SchemaObject | ReferenceObject;
|
|
302
295
|
examples?: Record<string, ReferenceObject | ExampleObject>;
|
|
303
296
|
}>;
|
|
304
|
-
|
|
305
|
-
|
|
297
|
+
type EncodingObject = OpenAPIV3.EncodingObject;
|
|
298
|
+
type RequestBodyObject = Modify<OpenAPIV3.RequestBodyObject, {
|
|
306
299
|
content?: {
|
|
307
300
|
[media: string]: MediaTypeObject;
|
|
308
301
|
};
|
|
309
302
|
}>;
|
|
310
|
-
|
|
311
|
-
|
|
303
|
+
type ResponsesObject = Record<string, ReferenceObject | ResponseObject>;
|
|
304
|
+
type ResponseObject = Modify<OpenAPIV3.ResponseObject, {
|
|
312
305
|
headers?: {
|
|
313
306
|
[header: string]: ReferenceObject | HeaderObject;
|
|
314
307
|
};
|
|
@@ -319,12 +312,12 @@ declare namespace OpenAPIV3_1 {
|
|
|
319
312
|
[link: string]: ReferenceObject | LinkObject;
|
|
320
313
|
};
|
|
321
314
|
}>;
|
|
322
|
-
|
|
315
|
+
type LinkObject = Modify<OpenAPIV3.LinkObject, {
|
|
323
316
|
server?: ServerObject;
|
|
324
317
|
}>;
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
318
|
+
type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
|
|
319
|
+
type SecurityRequirementObject = OpenAPIV3.SecurityRequirementObject;
|
|
320
|
+
type ComponentsObject = Modify<OpenAPIV3.ComponentsObject, {
|
|
328
321
|
schemas?: Record<string, SchemaObject>;
|
|
329
322
|
responses?: Record<string, ReferenceObject | ResponseObject>;
|
|
330
323
|
parameters?: Record<string, ReferenceObject | ParameterObject>;
|
|
@@ -336,17 +329,16 @@ declare namespace OpenAPIV3_1 {
|
|
|
336
329
|
callbacks?: Record<string, ReferenceObject | CallbackObject>;
|
|
337
330
|
pathItems?: Record<string, ReferenceObject | PathItemObject>;
|
|
338
331
|
}>;
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
export {};
|
|
332
|
+
type SecuritySchemeObject = OpenAPIV3.SecuritySchemeObject;
|
|
333
|
+
type HttpSecurityScheme = OpenAPIV3.HttpSecurityScheme;
|
|
334
|
+
type ApiKeySecurityScheme = OpenAPIV3.ApiKeySecurityScheme;
|
|
335
|
+
type OAuthFlows = OpenAPIV3.OAuthFlows;
|
|
336
|
+
type OAuth2SecurityScheme = OpenAPIV3.OAuth2SecurityScheme;
|
|
337
|
+
type OpenIdSecurityScheme = OpenAPIV3.OpenIdSecurityScheme;
|
|
338
|
+
type TagObject = OpenAPIV3.TagObject;
|
|
347
339
|
}
|
|
348
340
|
declare namespace OpenAPIV3 {
|
|
349
|
-
|
|
341
|
+
type Document<T = {}> = {
|
|
350
342
|
/**
|
|
351
343
|
* Version of the OpenAPI specification
|
|
352
344
|
* @see https://github.com/OAI/OpenAPI-Specification/tree/main/versions
|
|
@@ -361,7 +353,7 @@ declare namespace OpenAPIV3 {
|
|
|
361
353
|
tags?: TagObject[];
|
|
362
354
|
externalDocs?: ExternalDocumentationObject;
|
|
363
355
|
} & T;
|
|
364
|
-
|
|
356
|
+
type InfoObject = {
|
|
365
357
|
title?: string;
|
|
366
358
|
description?: string;
|
|
367
359
|
termsOfService?: string;
|
|
@@ -369,39 +361,39 @@ declare namespace OpenAPIV3 {
|
|
|
369
361
|
license?: LicenseObject;
|
|
370
362
|
version?: string;
|
|
371
363
|
};
|
|
372
|
-
|
|
364
|
+
type ContactObject = {
|
|
373
365
|
name?: string;
|
|
374
366
|
url?: string;
|
|
375
367
|
email?: string;
|
|
376
368
|
};
|
|
377
|
-
|
|
369
|
+
type LicenseObject = {
|
|
378
370
|
name?: string;
|
|
379
371
|
url?: string;
|
|
380
372
|
};
|
|
381
|
-
|
|
373
|
+
type ServerObject = {
|
|
382
374
|
url?: string;
|
|
383
375
|
description?: string;
|
|
384
376
|
variables?: {
|
|
385
377
|
[variable: string]: ServerVariableObject;
|
|
386
378
|
};
|
|
387
379
|
};
|
|
388
|
-
|
|
380
|
+
type ServerVariableObject = {
|
|
389
381
|
enum?: string[] | number[];
|
|
390
382
|
default?: string | number;
|
|
391
383
|
description?: string;
|
|
392
384
|
};
|
|
393
|
-
|
|
385
|
+
type PathsObject<T = {}, P extends {} = {}> = {
|
|
394
386
|
[pattern: string]: (PathItemObject<T> & P) | undefined;
|
|
395
387
|
};
|
|
396
|
-
|
|
397
|
-
|
|
388
|
+
type HttpMethods = OpenAPIV2.HttpMethods | 'trace';
|
|
389
|
+
type PathItemObject<T = {}> = {
|
|
398
390
|
$ref?: string;
|
|
399
391
|
summary?: string;
|
|
400
392
|
description?: string;
|
|
401
393
|
servers?: ServerObject[];
|
|
402
394
|
parameters?: (ReferenceObject | ParameterObject)[];
|
|
403
395
|
} & { [method in HttpMethods]?: OperationObject<T> } & T;
|
|
404
|
-
|
|
396
|
+
type OperationObject<T = {}> = {
|
|
405
397
|
tags?: string[];
|
|
406
398
|
summary?: string;
|
|
407
399
|
description?: string;
|
|
@@ -417,18 +409,18 @@ declare namespace OpenAPIV3 {
|
|
|
417
409
|
security?: SecurityRequirementObject[];
|
|
418
410
|
servers?: ServerObject[];
|
|
419
411
|
} & T;
|
|
420
|
-
|
|
412
|
+
type ExternalDocumentationObject = {
|
|
421
413
|
description?: string;
|
|
422
414
|
url?: string;
|
|
423
415
|
};
|
|
424
|
-
|
|
425
|
-
|
|
416
|
+
type ParameterLocation = 'query' | 'header' | 'path' | 'cookie';
|
|
417
|
+
type ParameterObject = {
|
|
426
418
|
name?: string;
|
|
427
419
|
in?: ParameterLocation;
|
|
428
420
|
} & ParameterBaseObject;
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
421
|
+
type HeaderObject = {} & ParameterBaseObject;
|
|
422
|
+
type ParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject';
|
|
423
|
+
type ParameterBaseObject = {
|
|
432
424
|
description?: string;
|
|
433
425
|
required?: boolean;
|
|
434
426
|
deprecated?: boolean;
|
|
@@ -445,17 +437,17 @@ declare namespace OpenAPIV3 {
|
|
|
445
437
|
[media: string]: MediaTypeObject;
|
|
446
438
|
};
|
|
447
439
|
};
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
440
|
+
type NonArraySchemaObjectType = 'boolean' | 'object' | 'number' | 'string' | 'integer';
|
|
441
|
+
type ArraySchemaObjectType = 'array';
|
|
442
|
+
type SchemaObject = ArraySchemaObject | NonArraySchemaObject;
|
|
443
|
+
type ArraySchemaObject = {
|
|
452
444
|
type?: ArraySchemaObjectType;
|
|
453
445
|
items?: ReferenceObject | SchemaObject;
|
|
454
446
|
} & BaseSchemaObject;
|
|
455
|
-
|
|
447
|
+
type NonArraySchemaObject = {
|
|
456
448
|
type?: NonArraySchemaObjectType;
|
|
457
449
|
} & BaseSchemaObject;
|
|
458
|
-
|
|
450
|
+
type BaseSchemaObject = {
|
|
459
451
|
title?: string;
|
|
460
452
|
description?: string;
|
|
461
453
|
format?: string;
|
|
@@ -495,29 +487,29 @@ declare namespace OpenAPIV3 {
|
|
|
495
487
|
example?: any;
|
|
496
488
|
deprecated?: boolean;
|
|
497
489
|
};
|
|
498
|
-
|
|
490
|
+
type DiscriminatorObject = {
|
|
499
491
|
propertyName?: string;
|
|
500
492
|
mapping?: {
|
|
501
493
|
[value: string]: string;
|
|
502
494
|
};
|
|
503
495
|
};
|
|
504
|
-
|
|
496
|
+
type XMLObject = {
|
|
505
497
|
name?: string;
|
|
506
498
|
namespace?: string;
|
|
507
499
|
prefix?: string;
|
|
508
500
|
attribute?: boolean;
|
|
509
501
|
wrapped?: boolean;
|
|
510
502
|
};
|
|
511
|
-
|
|
503
|
+
type ReferenceObject = {
|
|
512
504
|
$ref: string;
|
|
513
505
|
};
|
|
514
|
-
|
|
506
|
+
type ExampleObject = {
|
|
515
507
|
summary?: string;
|
|
516
508
|
description?: string;
|
|
517
509
|
value?: any;
|
|
518
510
|
externalValue?: string;
|
|
519
511
|
};
|
|
520
|
-
|
|
512
|
+
type MediaTypeObject = {
|
|
521
513
|
schema?: ReferenceObject | SchemaObject;
|
|
522
514
|
example?: any;
|
|
523
515
|
examples?: {
|
|
@@ -527,7 +519,7 @@ declare namespace OpenAPIV3 {
|
|
|
527
519
|
[media: string]: EncodingObject;
|
|
528
520
|
};
|
|
529
521
|
};
|
|
530
|
-
|
|
522
|
+
type EncodingObject = {
|
|
531
523
|
contentType?: string;
|
|
532
524
|
headers?: {
|
|
533
525
|
[header: string]: ReferenceObject | HeaderObject;
|
|
@@ -536,17 +528,17 @@ declare namespace OpenAPIV3 {
|
|
|
536
528
|
explode?: boolean;
|
|
537
529
|
allowReserved?: boolean;
|
|
538
530
|
};
|
|
539
|
-
|
|
531
|
+
type RequestBodyObject = {
|
|
540
532
|
description?: string;
|
|
541
533
|
content?: {
|
|
542
534
|
[media: string]: MediaTypeObject;
|
|
543
535
|
};
|
|
544
536
|
required?: boolean;
|
|
545
537
|
};
|
|
546
|
-
|
|
538
|
+
type ResponsesObject = {
|
|
547
539
|
[code: string]: ReferenceObject | ResponseObject;
|
|
548
540
|
};
|
|
549
|
-
|
|
541
|
+
type ResponseObject = {
|
|
550
542
|
description?: string;
|
|
551
543
|
headers?: {
|
|
552
544
|
[header: string]: ReferenceObject | HeaderObject;
|
|
@@ -558,7 +550,7 @@ declare namespace OpenAPIV3 {
|
|
|
558
550
|
[link: string]: ReferenceObject | LinkObject;
|
|
559
551
|
};
|
|
560
552
|
};
|
|
561
|
-
|
|
553
|
+
type LinkObject = {
|
|
562
554
|
operationRef?: string;
|
|
563
555
|
operationId?: string;
|
|
564
556
|
parameters?: {
|
|
@@ -568,13 +560,13 @@ declare namespace OpenAPIV3 {
|
|
|
568
560
|
description?: string;
|
|
569
561
|
server?: ServerObject;
|
|
570
562
|
};
|
|
571
|
-
|
|
563
|
+
type CallbackObject = {
|
|
572
564
|
[url: string]: PathItemObject;
|
|
573
565
|
};
|
|
574
|
-
|
|
566
|
+
type SecurityRequirementObject = {
|
|
575
567
|
[name: string]: string[];
|
|
576
568
|
};
|
|
577
|
-
|
|
569
|
+
type ComponentsObject = {
|
|
578
570
|
schemas?: {
|
|
579
571
|
[key: string]: ReferenceObject | SchemaObject;
|
|
580
572
|
};
|
|
@@ -603,20 +595,20 @@ declare namespace OpenAPIV3 {
|
|
|
603
595
|
[key: string]: ReferenceObject | CallbackObject;
|
|
604
596
|
};
|
|
605
597
|
};
|
|
606
|
-
|
|
607
|
-
|
|
598
|
+
type SecuritySchemeObject = HttpSecurityScheme | ApiKeySecurityScheme | OAuth2SecurityScheme | OpenIdSecurityScheme;
|
|
599
|
+
type HttpSecurityScheme = {
|
|
608
600
|
type?: 'http';
|
|
609
601
|
description?: string;
|
|
610
602
|
scheme?: string;
|
|
611
603
|
bearerFormat?: string;
|
|
612
604
|
};
|
|
613
|
-
|
|
605
|
+
type ApiKeySecurityScheme = {
|
|
614
606
|
type?: 'apiKey';
|
|
615
607
|
description?: string;
|
|
616
608
|
name?: string;
|
|
617
609
|
in?: string;
|
|
618
610
|
};
|
|
619
|
-
|
|
611
|
+
type OAuthFlowBase = {
|
|
620
612
|
scopes?: {
|
|
621
613
|
[scope: string]: string;
|
|
622
614
|
};
|
|
@@ -625,31 +617,30 @@ declare namespace OpenAPIV3 {
|
|
|
625
617
|
type OAuthFlowAuthorizationUrlTrait = {
|
|
626
618
|
authorizationUrl?: string;
|
|
627
619
|
};
|
|
628
|
-
|
|
620
|
+
type OAuthFlowTokenUrlTrait = {
|
|
629
621
|
tokenUrl?: string;
|
|
630
622
|
};
|
|
631
|
-
|
|
623
|
+
type OAuthFlows = {
|
|
632
624
|
implicit?: OAuthFlowBase & OAuthFlowAuthorizationUrlTrait;
|
|
633
625
|
password?: OAuthFlowBase & OAuthFlowTokenUrlTrait;
|
|
634
626
|
clientCredentials?: OAuthFlowBase & OAuthFlowTokenUrlTrait;
|
|
635
627
|
authorizationCode?: OAuthFlowBase & OAuthFlowAuthorizationUrlTrait & OAuthFlowTokenUrlTrait;
|
|
636
628
|
};
|
|
637
|
-
|
|
629
|
+
type OAuth2SecurityScheme = {
|
|
638
630
|
type?: 'oauth2';
|
|
639
631
|
description?: string;
|
|
640
632
|
flows?: OAuthFlows;
|
|
641
633
|
};
|
|
642
|
-
|
|
634
|
+
type OpenIdSecurityScheme = {
|
|
643
635
|
type?: 'openIdConnect';
|
|
644
636
|
description?: string;
|
|
645
637
|
openIdConnectUrl?: string;
|
|
646
638
|
};
|
|
647
|
-
|
|
639
|
+
type TagObject = {
|
|
648
640
|
name?: string;
|
|
649
641
|
description?: string;
|
|
650
642
|
externalDocs?: ExternalDocumentationObject;
|
|
651
643
|
};
|
|
652
|
-
export {};
|
|
653
644
|
}
|
|
654
645
|
declare namespace OpenAPIV2 {
|
|
655
646
|
type Document<T = {}> = {
|