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
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import convertPathToPosix from "./util/convert-path-to-posix.js";
|
|
2
|
-
import { resolve, stripHash, toFileSystemPath } from "./util/url.js";
|
|
3
|
-
import $Ref from "./ref.js";
|
|
4
|
-
//#region ../../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
|
|
5
|
-
/**
|
|
6
|
-
* When you call the resolve method, the value that gets passed to the callback function (or Promise) is a $Refs object. This same object is accessible via the parser.$refs property of $RefParser objects.
|
|
7
|
-
*
|
|
8
|
-
* This object is a map of JSON References and their resolved values. It also has several convenient helper methods that make it easy for you to navigate and manipulate the JSON References.
|
|
9
|
-
*
|
|
10
|
-
* See https://apidevtools.com/json-schema-ref-parser/docs/refs.html
|
|
11
|
-
*/
|
|
12
|
-
var $Refs = class {
|
|
13
|
-
/**
|
|
14
|
-
* This property is true if the schema contains any circular references. You may want to check this property before serializing the dereferenced schema as JSON, since JSON.stringify() does not support circular references by default.
|
|
15
|
-
*
|
|
16
|
-
* See https://apidevtools.com/json-schema-ref-parser/docs/refs.html#circular
|
|
17
|
-
*/
|
|
18
|
-
circular;
|
|
19
|
-
/**
|
|
20
|
-
* Returns the paths/URLs of all the files in your schema (including the main schema file).
|
|
21
|
-
*
|
|
22
|
-
* See https://apidevtools.com/json-schema-ref-parser/docs/refs.html#pathstypes
|
|
23
|
-
*
|
|
24
|
-
* @param types (optional) Optionally only return certain types of paths ("file", "http", etc.)
|
|
25
|
-
*/
|
|
26
|
-
paths(...types) {
|
|
27
|
-
return getPaths(this._$refs, types.flat()).map((path) => {
|
|
28
|
-
return convertPathToPosix(path.decoded);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Returns a map of paths/URLs and their correspond values.
|
|
33
|
-
*
|
|
34
|
-
* See https://apidevtools.com/json-schema-ref-parser/docs/refs.html#valuestypes
|
|
35
|
-
*
|
|
36
|
-
* @param types (optional) Optionally only return values from certain locations ("file", "http", etc.)
|
|
37
|
-
*/
|
|
38
|
-
values(...types) {
|
|
39
|
-
const $refs = this._$refs;
|
|
40
|
-
return getPaths($refs, types.flat()).reduce((obj, path) => {
|
|
41
|
-
obj[convertPathToPosix(path.decoded)] = $refs[path.encoded].value;
|
|
42
|
-
return obj;
|
|
43
|
-
}, {});
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Returns `true` if the given path exists in the schema; otherwise, returns `false`
|
|
47
|
-
*
|
|
48
|
-
* See https://apidevtools.com/json-schema-ref-parser/docs/refs.html#existsref
|
|
49
|
-
*
|
|
50
|
-
* @param $ref The JSON Reference path, optionally with a JSON Pointer in the hash
|
|
51
|
-
*/
|
|
52
|
-
/**
|
|
53
|
-
* Determines whether the given JSON reference exists.
|
|
54
|
-
*
|
|
55
|
-
* @param path - The path being resolved, optionally with a JSON pointer in the hash
|
|
56
|
-
* @param [options]
|
|
57
|
-
* @returns
|
|
58
|
-
*/
|
|
59
|
-
exists(path, options) {
|
|
60
|
-
try {
|
|
61
|
-
this._resolve(path, "", options);
|
|
62
|
-
return true;
|
|
63
|
-
} catch {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Resolves the given JSON reference and returns the resolved value.
|
|
69
|
-
*
|
|
70
|
-
* @param path - The path being resolved, with a JSON pointer in the hash
|
|
71
|
-
* @param [options]
|
|
72
|
-
* @returns - Returns the resolved value
|
|
73
|
-
*/
|
|
74
|
-
get(path, options) {
|
|
75
|
-
return this._resolve(path, "", options).value;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Sets the value at the given path in the schema. If the property, or any of its parents, don't exist, they will be created.
|
|
79
|
-
*
|
|
80
|
-
* @param path The JSON Reference path, optionally with a JSON Pointer in the hash
|
|
81
|
-
* @param value The value to assign. Can be anything (object, string, number, etc.)
|
|
82
|
-
*/
|
|
83
|
-
set(path, value) {
|
|
84
|
-
const absPath = resolve(this._root$Ref.path, path);
|
|
85
|
-
const $ref = this._getRef(absPath);
|
|
86
|
-
if (!$ref) throw new Error(`Error resolving $ref pointer "${path}". \n"${stripHash(absPath)}" not found.`);
|
|
87
|
-
$ref.set(absPath, value);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Returns the specified {@link $Ref} object, or undefined.
|
|
91
|
-
*
|
|
92
|
-
* @param path - The path being resolved, optionally with a JSON pointer in the hash
|
|
93
|
-
* @returns
|
|
94
|
-
* @protected
|
|
95
|
-
*/
|
|
96
|
-
_get$Ref(path) {
|
|
97
|
-
path = resolve(this._root$Ref.path, path);
|
|
98
|
-
return this._getRef(path);
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Creates a new {@link $Ref} object and adds it to this {@link $Refs} object.
|
|
102
|
-
*
|
|
103
|
-
* @param path - The file path or URL of the referenced file
|
|
104
|
-
*/
|
|
105
|
-
_add(path) {
|
|
106
|
-
const withoutHash = stripHash(path);
|
|
107
|
-
const $ref = new $Ref(this);
|
|
108
|
-
$ref.path = withoutHash;
|
|
109
|
-
this._$refs[withoutHash] = $ref;
|
|
110
|
-
this._root$Ref = this._root$Ref || $ref;
|
|
111
|
-
return $ref;
|
|
112
|
-
}
|
|
113
|
-
_addAlias(path, value, pathType, dynamicIdScope = false) {
|
|
114
|
-
const withoutHash = stripHash(path);
|
|
115
|
-
if (!withoutHash || this._$refs[withoutHash] || this._aliases[withoutHash]) return this._$refs[withoutHash] || this._aliases[withoutHash];
|
|
116
|
-
const $ref = new $Ref(this);
|
|
117
|
-
$ref.path = withoutHash;
|
|
118
|
-
$ref.pathType = pathType;
|
|
119
|
-
$ref.value = value;
|
|
120
|
-
$ref.dynamicIdScope = dynamicIdScope;
|
|
121
|
-
this._aliases[withoutHash] = $ref;
|
|
122
|
-
return $ref;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Resolves the given JSON reference.
|
|
126
|
-
*
|
|
127
|
-
* @param path - The path being resolved, optionally with a JSON pointer in the hash
|
|
128
|
-
* @param pathFromRoot - The path of `obj` from the schema root
|
|
129
|
-
* @param [options]
|
|
130
|
-
* @returns
|
|
131
|
-
* @protected
|
|
132
|
-
*/
|
|
133
|
-
_resolve(path, pathFromRoot, options) {
|
|
134
|
-
const absPath = resolve(this._root$Ref.path, path);
|
|
135
|
-
const $ref = this._getRef(absPath);
|
|
136
|
-
if (!$ref) throw new Error(`Error resolving $ref pointer "${path}". \n"${stripHash(absPath)}" not found.`);
|
|
137
|
-
return $ref.resolve(absPath, options, path, pathFromRoot);
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* A map of paths/urls to {@link $Ref} objects
|
|
141
|
-
*
|
|
142
|
-
* @type {object}
|
|
143
|
-
* @protected
|
|
144
|
-
*/
|
|
145
|
-
_$refs = {};
|
|
146
|
-
_aliases = {};
|
|
147
|
-
/**
|
|
148
|
-
* The {@link $Ref} object that is the root of the JSON schema.
|
|
149
|
-
*
|
|
150
|
-
* @type {$Ref}
|
|
151
|
-
* @protected
|
|
152
|
-
*/
|
|
153
|
-
_root$Ref;
|
|
154
|
-
constructor() {
|
|
155
|
-
/**
|
|
156
|
-
* Indicates whether the schema contains any circular references.
|
|
157
|
-
*
|
|
158
|
-
* @type {boolean}
|
|
159
|
-
*/
|
|
160
|
-
this.circular = false;
|
|
161
|
-
this._$refs = {};
|
|
162
|
-
this._aliases = {};
|
|
163
|
-
this._root$Ref = null;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Returns the paths of all the files/URLs that are referenced by the JSON schema,
|
|
167
|
-
* including the schema itself.
|
|
168
|
-
*
|
|
169
|
-
* @param [types] - Only return paths of the given types ("file", "http", etc.)
|
|
170
|
-
* @returns
|
|
171
|
-
*/
|
|
172
|
-
/**
|
|
173
|
-
* Returns the map of JSON references and their resolved values.
|
|
174
|
-
*
|
|
175
|
-
* @param [types] - Only return references of the given types ("file", "http", etc.)
|
|
176
|
-
* @returns
|
|
177
|
-
*/
|
|
178
|
-
/**
|
|
179
|
-
* Returns a POJO (plain old JavaScript object) for serialization as JSON.
|
|
180
|
-
*
|
|
181
|
-
* @returns {object}
|
|
182
|
-
*/
|
|
183
|
-
toJSON = this.values;
|
|
184
|
-
_getRef(path) {
|
|
185
|
-
const withoutHash = stripHash(path);
|
|
186
|
-
return this._$refs[withoutHash] || this._aliases[withoutHash];
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
/**
|
|
190
|
-
* Returns the encoded and decoded paths keys of the given object.
|
|
191
|
-
*
|
|
192
|
-
* @param $refs - The object whose keys are URL-encoded paths
|
|
193
|
-
* @param [types] - Only return paths of the given types ("file", "http", etc.)
|
|
194
|
-
* @returns
|
|
195
|
-
*/
|
|
196
|
-
function getPaths($refs, types) {
|
|
197
|
-
let paths = Object.keys($refs);
|
|
198
|
-
types = Array.isArray(types[0]) ? types[0] : Array.prototype.slice.call(types);
|
|
199
|
-
if (types.length > 0 && types[0]) paths = paths.filter((key) => {
|
|
200
|
-
return types.includes($refs[key].pathType);
|
|
201
|
-
});
|
|
202
|
-
return paths.map((path) => {
|
|
203
|
-
return {
|
|
204
|
-
encoded: path,
|
|
205
|
-
decoded: $refs[path].pathType === "file" ? toFileSystemPath(path, true) : path
|
|
206
|
-
};
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
//#endregion
|
|
210
|
-
export { $Refs as default };
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { cwd, getHash, resolve, safePointerToPath, stripHash } from "./util/url.js";
|
|
2
|
-
import { isHandledError } from "./util/errors.js";
|
|
3
|
-
import { getSchemaBasePath } from "./util/schema-resources.js";
|
|
4
|
-
import Pointer from "./pointer.js";
|
|
5
|
-
import $Ref from "./ref.js";
|
|
6
|
-
import parse from "./parse.js";
|
|
7
|
-
//#region ../../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
|
|
8
|
-
/**
|
|
9
|
-
* Crawls the JSON schema, finds all external JSON references, and resolves their values.
|
|
10
|
-
* This method does not mutate the JSON schema. The resolved values are added to {@link $RefParser#$refs}.
|
|
11
|
-
*
|
|
12
|
-
* NOTE: We only care about EXTERNAL references here. INTERNAL references are only relevant when dereferencing.
|
|
13
|
-
*
|
|
14
|
-
* @returns
|
|
15
|
-
* The promise resolves once all JSON references in the schema have been resolved,
|
|
16
|
-
* including nested references that are contained in externally-referenced files.
|
|
17
|
-
*/
|
|
18
|
-
function resolveExternal(parser, options) {
|
|
19
|
-
if (!options.resolve?.external) return Promise.resolve();
|
|
20
|
-
try {
|
|
21
|
-
const rootScopeBase = parser.$refs._root$Ref.dynamicIdScope ? getSchemaBasePath(parser.$refs._root$Ref.path, parser.schema) : parser.$refs._root$Ref.path;
|
|
22
|
-
const promises = crawl(parser.schema, parser.$refs._root$Ref.path + "#", rootScopeBase, parser.$refs._root$Ref.dynamicIdScope, parser.$refs, options);
|
|
23
|
-
return Promise.all(promises);
|
|
24
|
-
} catch (e) {
|
|
25
|
-
return Promise.reject(e);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Recursively crawls the given value, and resolves any external JSON references.
|
|
30
|
-
*
|
|
31
|
-
* @param obj - The value to crawl. If it's not an object or array, it will be ignored.
|
|
32
|
-
* @param path - The full path of `obj`, possibly with a JSON Pointer in the hash
|
|
33
|
-
* @param {boolean} external - Whether `obj` was found in an external document.
|
|
34
|
-
* @param $refs
|
|
35
|
-
* @param options
|
|
36
|
-
* @param seen - Internal.
|
|
37
|
-
*
|
|
38
|
-
* @returns
|
|
39
|
-
* Returns an array of promises. There will be one promise for each JSON reference in `obj`.
|
|
40
|
-
* If `obj` does not contain any JSON references, then the array will be empty.
|
|
41
|
-
* If any of the JSON references point to files that contain additional JSON references,
|
|
42
|
-
* then the corresponding promise will internally reference an array of promises.
|
|
43
|
-
*/
|
|
44
|
-
function crawl(obj, path, scopeBase, dynamicIdScope, $refs, options, seen, external) {
|
|
45
|
-
seen ||= /* @__PURE__ */ new Set();
|
|
46
|
-
let promises = [];
|
|
47
|
-
if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj) && !seen.has(obj)) {
|
|
48
|
-
seen.add(obj);
|
|
49
|
-
const currentScopeBase = scopeBase;
|
|
50
|
-
if ($Ref.isExternal$Ref(obj)) promises.push(resolve$Ref(obj, path, currentScopeBase, dynamicIdScope, $refs, options));
|
|
51
|
-
const keys = Object.keys(obj);
|
|
52
|
-
for (const key of keys) {
|
|
53
|
-
const keyPath = Pointer.join(path, key);
|
|
54
|
-
const value = obj[key];
|
|
55
|
-
const childScopeBase = dynamicIdScope && value && typeof value === "object" && !ArrayBuffer.isView(value) ? getSchemaBasePath(currentScopeBase, value) : currentScopeBase;
|
|
56
|
-
promises = promises.concat(crawl(value, keyPath, childScopeBase, dynamicIdScope, $refs, options, seen, external));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return promises;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Resolves the given JSON Reference, and then crawls the resulting value.
|
|
63
|
-
*
|
|
64
|
-
* @param $ref - The JSON Reference to resolve
|
|
65
|
-
* @param path - The full path of `$ref`, possibly with a JSON Pointer in the hash
|
|
66
|
-
* @param $refs
|
|
67
|
-
* @param options
|
|
68
|
-
*
|
|
69
|
-
* @returns
|
|
70
|
-
* The promise resolves once all JSON references in the object have been resolved,
|
|
71
|
-
* including nested references that are contained in externally-referenced files.
|
|
72
|
-
*/
|
|
73
|
-
async function resolve$Ref($ref, path, scopeBase, dynamicIdScope, $refs, options) {
|
|
74
|
-
const resolutionBase = options.dereference?.externalReferenceResolution === "root" ? cwd() : dynamicIdScope ? scopeBase : path;
|
|
75
|
-
const resolvedPath = resolve(resolutionBase, $ref.$ref);
|
|
76
|
-
const withoutHash = stripHash(resolvedPath);
|
|
77
|
-
const ref = $refs._get$Ref(withoutHash);
|
|
78
|
-
if (ref) return Promise.resolve(ref.value);
|
|
79
|
-
try {
|
|
80
|
-
const reference = $ref.$ref;
|
|
81
|
-
const parseTarget = {
|
|
82
|
-
url: resolvedPath,
|
|
83
|
-
baseUrl: resolutionBase
|
|
84
|
-
};
|
|
85
|
-
if (typeof reference === "string") parseTarget.reference = reference;
|
|
86
|
-
const result = await parse(parseTarget, $refs, options);
|
|
87
|
-
const parsedRef = $refs._get$Ref(withoutHash);
|
|
88
|
-
const promises = crawl(result, withoutHash + "#", withoutHash, parsedRef?.dynamicIdScope ?? false, $refs, options, /* @__PURE__ */ new Set(), true);
|
|
89
|
-
return Promise.all(promises);
|
|
90
|
-
} catch (err) {
|
|
91
|
-
if (!options?.continueOnError || !isHandledError(err)) throw err;
|
|
92
|
-
if ($refs._$refs[withoutHash]) {
|
|
93
|
-
err.source = decodeURI(stripHash(path));
|
|
94
|
-
err.path = safePointerToPath(getHash(path));
|
|
95
|
-
}
|
|
96
|
-
return [];
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
//#endregion
|
|
100
|
-
export { resolveExternal as default };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { isFileSystemPath, toFileSystemPath } from "../util/url.js";
|
|
2
|
-
import { ResolverError } from "../util/errors.js";
|
|
3
|
-
//#region ../../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
|
|
4
|
-
var file_default = {
|
|
5
|
-
/**
|
|
6
|
-
* The order that this resolver will run, in relation to other resolvers.
|
|
7
|
-
*/
|
|
8
|
-
order: 100,
|
|
9
|
-
/**
|
|
10
|
-
* Determines whether this resolver can read a given file reference.
|
|
11
|
-
* Resolvers that return true will be tried, in order, until one successfully resolves the file.
|
|
12
|
-
* Resolvers that return false will not be given a chance to resolve the file.
|
|
13
|
-
*/
|
|
14
|
-
canRead(file) {
|
|
15
|
-
return isFileSystemPath(file.url);
|
|
16
|
-
},
|
|
17
|
-
/**
|
|
18
|
-
* Reads the given file and returns its raw contents as a Buffer.
|
|
19
|
-
*/
|
|
20
|
-
async read(file) {
|
|
21
|
-
let path;
|
|
22
|
-
const fs = await import("fs");
|
|
23
|
-
try {
|
|
24
|
-
path = toFileSystemPath(file.url);
|
|
25
|
-
} catch (err) {
|
|
26
|
-
const e = err;
|
|
27
|
-
e.message = `Malformed URI: ${file.url}: ${e.message}`;
|
|
28
|
-
throw new ResolverError(e, file.url);
|
|
29
|
-
}
|
|
30
|
-
if (path.endsWith("/") || path.endsWith("\\")) path = path.slice(0, -1);
|
|
31
|
-
try {
|
|
32
|
-
return await fs.promises.readFile(path);
|
|
33
|
-
} catch (err) {
|
|
34
|
-
const e = err;
|
|
35
|
-
e.message = `Error opening file ${path}: ${e.message}`;
|
|
36
|
-
throw new ResolverError(e, path);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
//#endregion
|
|
41
|
-
export { file_default as default };
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { isHttp, isUnsafeUrl, parse, resolve } from "../util/url.js";
|
|
2
|
-
import { ResolverError } from "../util/errors.js";
|
|
3
|
-
//#region ../../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
|
|
4
|
-
var http_default = {
|
|
5
|
-
/**
|
|
6
|
-
* The order that this resolver will run, in relation to other resolvers.
|
|
7
|
-
*/
|
|
8
|
-
order: 200,
|
|
9
|
-
/**
|
|
10
|
-
* HTTP headers to send when downloading files.
|
|
11
|
-
*
|
|
12
|
-
* @example:
|
|
13
|
-
* {
|
|
14
|
-
* "User-Agent": "JSON Schema $Ref Parser",
|
|
15
|
-
* Accept: "application/json"
|
|
16
|
-
* }
|
|
17
|
-
*/
|
|
18
|
-
headers: null,
|
|
19
|
-
/**
|
|
20
|
-
* HTTP request timeout (in milliseconds).
|
|
21
|
-
*/
|
|
22
|
-
timeout: 6e4,
|
|
23
|
-
/**
|
|
24
|
-
* The maximum number of HTTP redirects to follow.
|
|
25
|
-
* To disable automatic following of redirects, set this to zero.
|
|
26
|
-
*/
|
|
27
|
-
redirects: 5,
|
|
28
|
-
/**
|
|
29
|
-
* The `withCredentials` option of XMLHttpRequest.
|
|
30
|
-
* Set this to `true` if you're downloading files from a CORS-enabled server that requires authentication
|
|
31
|
-
*/
|
|
32
|
-
withCredentials: false,
|
|
33
|
-
/**
|
|
34
|
-
* Set this to `false` if you want to allow unsafe URLs (e.g., `127.0.0.1`, localhost, and other internal URLs).
|
|
35
|
-
*/
|
|
36
|
-
safeUrlResolver: true,
|
|
37
|
-
/**
|
|
38
|
-
* Determines whether this resolver can read a given file reference.
|
|
39
|
-
* Resolvers that return true will be tried in order, until one successfully resolves the file.
|
|
40
|
-
* Resolvers that return false will not be given a chance to resolve the file.
|
|
41
|
-
*/
|
|
42
|
-
canRead(file) {
|
|
43
|
-
return isHttp(file.url) && (!this.safeUrlResolver || !isUnsafeUrl(file.url));
|
|
44
|
-
},
|
|
45
|
-
/**
|
|
46
|
-
* Reads the given URL and returns its raw contents as a Buffer.
|
|
47
|
-
*/
|
|
48
|
-
read(file) {
|
|
49
|
-
const u = parse(file.url);
|
|
50
|
-
if (typeof window !== "undefined" && !u.protocol) u.protocol = parse(location.href).protocol;
|
|
51
|
-
return download(u, this);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Downloads the given file.
|
|
56
|
-
* @returns
|
|
57
|
-
* The promise resolves with the raw downloaded data, or rejects if there is an HTTP error.
|
|
58
|
-
*/
|
|
59
|
-
async function download(u, httpOptions, _redirects) {
|
|
60
|
-
u = parse(u);
|
|
61
|
-
const redirects = _redirects || [];
|
|
62
|
-
redirects.push(u.href);
|
|
63
|
-
try {
|
|
64
|
-
const res = await get(u, httpOptions);
|
|
65
|
-
if (res.status >= 400) {
|
|
66
|
-
const error = /* @__PURE__ */ new Error(`HTTP ERROR ${res.status}`);
|
|
67
|
-
error.status = res.status;
|
|
68
|
-
throw error;
|
|
69
|
-
} else if (res.status >= 300) if (!Number.isNaN(httpOptions.redirects) && redirects.length > httpOptions.redirects) {
|
|
70
|
-
const error = /* @__PURE__ */ new Error(`Error downloading ${redirects[0]}. \nToo many redirects: \n ${redirects.join(" \n ")}`);
|
|
71
|
-
error.status = res.status;
|
|
72
|
-
throw new ResolverError(error);
|
|
73
|
-
} else if (!("location" in res.headers) || !res.headers.location) {
|
|
74
|
-
const error = /* @__PURE__ */ new Error(`HTTP ${res.status} redirect with no location header`);
|
|
75
|
-
error.status = res.status;
|
|
76
|
-
throw error;
|
|
77
|
-
} else return download(resolve(u.href, res.headers.location), httpOptions, redirects);
|
|
78
|
-
else {
|
|
79
|
-
if (res.body) {
|
|
80
|
-
const buf = await res.arrayBuffer();
|
|
81
|
-
return Buffer.from(buf);
|
|
82
|
-
}
|
|
83
|
-
return Buffer.alloc(0);
|
|
84
|
-
}
|
|
85
|
-
} catch (err) {
|
|
86
|
-
const e = err;
|
|
87
|
-
e.message = `Error downloading ${u.href}: ${e.message}`;
|
|
88
|
-
throw new ResolverError(e, u.href);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Sends an HTTP GET request.
|
|
93
|
-
* The promise resolves with the HTTP Response object.
|
|
94
|
-
*/
|
|
95
|
-
async function get(u, httpOptions) {
|
|
96
|
-
let controller;
|
|
97
|
-
let timeoutId;
|
|
98
|
-
if (httpOptions.timeout && typeof AbortController !== "undefined") {
|
|
99
|
-
controller = new AbortController();
|
|
100
|
-
timeoutId = setTimeout(() => controller.abort(), httpOptions.timeout);
|
|
101
|
-
}
|
|
102
|
-
const response = await fetch(u, {
|
|
103
|
-
method: "GET",
|
|
104
|
-
headers: httpOptions.headers || {},
|
|
105
|
-
credentials: httpOptions.withCredentials ? "include" : "same-origin",
|
|
106
|
-
signal: controller ? controller.signal : null
|
|
107
|
-
});
|
|
108
|
-
if (timeoutId) clearTimeout(timeoutId);
|
|
109
|
-
return response;
|
|
110
|
-
}
|
|
111
|
-
//#endregion
|
|
112
|
-
export { http_default as default };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//#region ../../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
|
|
2
|
-
const win32Sep = "\\";
|
|
3
|
-
function convertPathToPosix(filePath) {
|
|
4
|
-
if (filePath.startsWith("\\\\?\\")) return filePath;
|
|
5
|
-
return filePath.split(win32Sep).join("/");
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { convertPathToPosix as default };
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { getHash, stripHash, toFileSystemPath } from "./url.js";
|
|
2
|
-
//#region ../../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
|
|
3
|
-
const nonJsonTypes = [
|
|
4
|
-
"function",
|
|
5
|
-
"symbol",
|
|
6
|
-
"undefined"
|
|
7
|
-
];
|
|
8
|
-
const protectedProps = [
|
|
9
|
-
"constructor",
|
|
10
|
-
"prototype",
|
|
11
|
-
"__proto__"
|
|
12
|
-
];
|
|
13
|
-
const objectPrototype = Object.getPrototypeOf({});
|
|
14
|
-
/**
|
|
15
|
-
* Custom JSON serializer for Error objects.
|
|
16
|
-
* Returns all built-in error properties, as well as extended properties.
|
|
17
|
-
*/
|
|
18
|
-
function toJSON() {
|
|
19
|
-
const pojo = {};
|
|
20
|
-
const error = this;
|
|
21
|
-
for (const key of getDeepKeys(error)) if (typeof key === "string") {
|
|
22
|
-
const value = error[key];
|
|
23
|
-
const type = typeof value;
|
|
24
|
-
if (!nonJsonTypes.includes(type)) pojo[key] = value;
|
|
25
|
-
}
|
|
26
|
-
return pojo;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Returns own, inherited, enumerable, non-enumerable, string, and symbol keys of `obj`.
|
|
30
|
-
* Does NOT return members of the base Object prototype, or the specified omitted keys.
|
|
31
|
-
*/
|
|
32
|
-
function getDeepKeys(obj, omit = []) {
|
|
33
|
-
let keys = [];
|
|
34
|
-
while (obj && obj !== objectPrototype) {
|
|
35
|
-
keys = keys.concat(Object.getOwnPropertyNames(obj), Object.getOwnPropertySymbols(obj));
|
|
36
|
-
obj = Object.getPrototypeOf(obj);
|
|
37
|
-
}
|
|
38
|
-
const uniqueKeys = new Set(keys);
|
|
39
|
-
for (const key of omit.concat(protectedProps)) uniqueKeys.delete(key);
|
|
40
|
-
return uniqueKeys;
|
|
41
|
-
}
|
|
42
|
-
var JSONParserError = class extends Error {
|
|
43
|
-
name;
|
|
44
|
-
message;
|
|
45
|
-
source;
|
|
46
|
-
path;
|
|
47
|
-
code;
|
|
48
|
-
constructor(message, source) {
|
|
49
|
-
super();
|
|
50
|
-
this.code = "EUNKNOWN";
|
|
51
|
-
this.name = "JSONParserError";
|
|
52
|
-
this.message = message;
|
|
53
|
-
this.source = source;
|
|
54
|
-
this.path = null;
|
|
55
|
-
}
|
|
56
|
-
toJSON = toJSON.bind(this);
|
|
57
|
-
get footprint() {
|
|
58
|
-
return `${this.path}+${this.source}+${this.code}+${this.message}`;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
var JSONParserErrorGroup = class JSONParserErrorGroup extends Error {
|
|
62
|
-
files;
|
|
63
|
-
constructor(parser) {
|
|
64
|
-
super();
|
|
65
|
-
this.files = parser;
|
|
66
|
-
this.name = "JSONParserErrorGroup";
|
|
67
|
-
this.message = `${this.errors.length} error${this.errors.length > 1 ? "s" : ""} occurred while reading '${toFileSystemPath(parser.$refs._root$Ref.path)}'`;
|
|
68
|
-
}
|
|
69
|
-
toJSON = toJSON.bind(this);
|
|
70
|
-
static getParserErrors(parser) {
|
|
71
|
-
const errors = [];
|
|
72
|
-
for (const $ref of Object.values(parser.$refs._$refs)) if ($ref.errors) errors.push(...$ref.errors);
|
|
73
|
-
return errors;
|
|
74
|
-
}
|
|
75
|
-
get errors() {
|
|
76
|
-
return JSONParserErrorGroup.getParserErrors(this.files);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
var ParserError = class extends JSONParserError {
|
|
80
|
-
code = "EPARSER";
|
|
81
|
-
name = "ParserError";
|
|
82
|
-
constructor(message, source) {
|
|
83
|
-
super(`Error parsing ${source}: ${message}`, source);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
var UnmatchedParserError = class extends JSONParserError {
|
|
87
|
-
code = "EUNMATCHEDPARSER";
|
|
88
|
-
name = "UnmatchedParserError";
|
|
89
|
-
constructor(source) {
|
|
90
|
-
super(`Could not find parser for "${source}"`, source);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
var ResolverError = class extends JSONParserError {
|
|
94
|
-
code = "ERESOLVER";
|
|
95
|
-
name = "ResolverError";
|
|
96
|
-
ioErrorCode;
|
|
97
|
-
constructor(ex, source) {
|
|
98
|
-
super(ex.message || `Error reading file "${source}"`, source);
|
|
99
|
-
if ("code" in ex) this.ioErrorCode = String(ex.code);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
var UnmatchedResolverError = class extends JSONParserError {
|
|
103
|
-
code = "EUNMATCHEDRESOLVER";
|
|
104
|
-
name = "UnmatchedResolverError";
|
|
105
|
-
constructor(source) {
|
|
106
|
-
super(`Could not find resolver for "${source}"`, source);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
var MissingPointerError = class extends JSONParserError {
|
|
110
|
-
code = "EMISSINGPOINTER";
|
|
111
|
-
name = "MissingPointerError";
|
|
112
|
-
targetToken;
|
|
113
|
-
targetRef;
|
|
114
|
-
targetFound;
|
|
115
|
-
parentPath;
|
|
116
|
-
constructor(token, path, targetRef, targetFound, parentPath) {
|
|
117
|
-
super(`Missing $ref pointer "${getHash(path)}". Token "${token}" does not exist.`, stripHash(path));
|
|
118
|
-
this.targetToken = token;
|
|
119
|
-
this.targetRef = targetRef;
|
|
120
|
-
this.targetFound = targetFound;
|
|
121
|
-
this.parentPath = parentPath;
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
var TimeoutError = class extends JSONParserError {
|
|
125
|
-
code = "ETIMEOUT";
|
|
126
|
-
name = "TimeoutError";
|
|
127
|
-
constructor(timeout) {
|
|
128
|
-
super(`Dereferencing timeout reached: ${timeout}ms`);
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
var InvalidPointerError = class extends JSONParserError {
|
|
132
|
-
code = "EUNMATCHEDRESOLVER";
|
|
133
|
-
name = "InvalidPointerError";
|
|
134
|
-
constructor(pointer, path) {
|
|
135
|
-
super(`Invalid $ref pointer "${pointer}". Pointers must begin with "#/"`, stripHash(path));
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
function isHandledError(err) {
|
|
139
|
-
return err instanceof JSONParserError || err instanceof JSONParserErrorGroup;
|
|
140
|
-
}
|
|
141
|
-
function normalizeError(err) {
|
|
142
|
-
if (err.path === null) err.path = [];
|
|
143
|
-
return err;
|
|
144
|
-
}
|
|
145
|
-
//#endregion
|
|
146
|
-
export { InvalidPointerError, JSONParserError, JSONParserErrorGroup, MissingPointerError, ParserError, ResolverError, TimeoutError, UnmatchedParserError, UnmatchedResolverError, isHandledError, normalizeError };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
//#region ../../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
|
|
2
|
-
const isWindowsConst = /^win/.test(globalThis.process ? globalThis.process.platform : "");
|
|
3
|
-
const isWindows = () => isWindowsConst;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { isWindows };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import next_default from "./next.js";
|
|
2
|
-
//#region ../../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
|
|
3
|
-
function maybe(cb, promise) {
|
|
4
|
-
if (cb) {
|
|
5
|
-
promise.then(function(result) {
|
|
6
|
-
next_default(function() {
|
|
7
|
-
cb(null, result);
|
|
8
|
-
});
|
|
9
|
-
}, function(err) {
|
|
10
|
-
next_default(function() {
|
|
11
|
-
cb(err);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
return;
|
|
15
|
-
} else return promise;
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { maybe as default };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region ../../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
|
|
2
|
-
function makeNext() {
|
|
3
|
-
if (typeof process === "object" && typeof process.nextTick === "function") return process.nextTick;
|
|
4
|
-
else if (typeof setImmediate === "function") return setImmediate;
|
|
5
|
-
else return function next(f) {
|
|
6
|
-
setTimeout(f, 0);
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
var next_default = makeNext();
|
|
10
|
-
//#endregion
|
|
11
|
-
export { next_default as default };
|