@spotlightjs/spotlight 4.11.3 → 4.11.5
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/dist/_virtual/ajv.js +6 -3
- package/dist/_virtual/ajv2.js +13 -0
- package/dist/_virtual/index.js +6 -3
- package/dist/_virtual/index10.js +3 -3
- package/dist/_virtual/index11.js +3 -3
- package/dist/_virtual/index12.js +13 -0
- package/dist/_virtual/index2.js +3 -3
- package/dist/_virtual/index4.js +3 -3
- package/dist/_virtual/index5.js +3 -3
- package/dist/_virtual/index6.js +3 -3
- package/dist/_virtual/index7.js +3 -3
- package/dist/_virtual/index8.js +3 -3
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +1 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +1 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +3 -3
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js +203 -194
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js +47 -47
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js +77 -69
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js +80 -85
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js +145 -136
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js +692 -685
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js +143 -135
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js +122 -116
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js +218 -218
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js +43 -35
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js +19 -11
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js +149 -144
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js +31 -25
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js +164 -160
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js +23 -17
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js +52 -49
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js +174 -173
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js +36 -32
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js +473 -478
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js +113 -111
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js +81 -77
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js +573 -574
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.json.js +3 -17
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.json.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +4 -236
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js +16 -7
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js +27 -18
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js +16 -7
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js +17 -8
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +55 -48
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +104 -99
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +30 -22
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +20 -12
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -88
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +94 -88
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js +71 -64
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js +66 -73
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js +60 -54
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +41 -36
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js +34 -26
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -53
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +73 -67
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +20 -12
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +62 -57
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +46 -39
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +21 -13
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js +132 -129
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js +17 -8
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js +27 -20
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js +121 -118
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +103 -99
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +15 -9
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js +30 -26
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js +84 -76
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js +16 -8
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js +24 -18
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js +33 -27
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js +53 -47
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js +52 -53
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +32 -24
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +37 -31
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +35 -27
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +32 -24
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +31 -23
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +41 -35
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js +80 -74
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +71 -66
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -1
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +34 -27
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js.map +1 -1
- package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js +300 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js.map +1 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js +223 -0
- package/dist/node_modules/.pnpm/{fast-uri@3.1.0 → fast-uri@3.1.2}/node_modules/fast-uri/lib/schemes.js.map +1 -1
- package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js +325 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js.map +1 -0
- package/dist/node_modules/.pnpm/hono@4.12.18/node_modules/hono/dist/helper/streaming/sse.js.map +1 -0
- package/dist/node_modules/.pnpm/{hono@4.12.8 → hono@4.12.18}/node_modules/hono/dist/middleware/cors/index.js +8 -8
- package/dist/node_modules/.pnpm/hono@4.12.18/node_modules/hono/dist/middleware/cors/index.js.map +1 -0
- package/dist/node_modules/.pnpm/hono@4.12.18/node_modules/hono/dist/utils/html.js.map +1 -0
- package/dist/node_modules/.pnpm/hono@4.12.18/node_modules/hono/dist/utils/stream.js.map +1 -0
- package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +83 -78
- package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/Options.js +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -1
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/util.js +1 -1
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/util.js.map +1 -1
- package/dist/sentry-config.js +2 -2
- package/dist/server/cli/run.js +2 -2
- package/dist/server/cli.js +2 -2
- package/dist/server/main.js +2 -2
- package/dist/server/mcp/mcp.js +2 -2
- package/dist/server/routes/stream/streaming.js +2 -2
- package/dist/ui/assets/index.js +61 -70
- package/dist/ui/assets/index2.js +1 -1
- package/dist/ui/assets/instrumentation.js +18 -18
- package/dist/ui/assets/main.css +1 -1
- package/dist/ui/assets/main.js +1 -1
- package/dist/ui/assets/serverTimingMeta.js +23 -30
- package/package.json +9 -9
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js +0 -264
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js.map +0 -1
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js +0 -197
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js +0 -261
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/helper/streaming/sse.js.map +0 -1
- package/dist/node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/middleware/cors/index.js.map +0 -1
- package/dist/node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/utils/html.js.map +0 -1
- package/dist/node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/utils/stream.js.map +0 -1
- /package/dist/node_modules/.pnpm/{hono@4.12.8 → hono@4.12.18}/node_modules/hono/dist/helper/streaming/sse.js +0 -0
- /package/dist/node_modules/.pnpm/{hono@4.12.8 → hono@4.12.18}/node_modules/hono/dist/utils/html.js +0 -0
- /package/dist/node_modules/.pnpm/{hono@4.12.8 → hono@4.12.18}/node_modules/hono/dist/utils/stream.js +0 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
;
|
|
2
|
+
!(function() {
|
|
3
|
+
try {
|
|
4
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b4f0eda2-259a-4c7b-aaf9-58c9f879a0a3", e._sentryDebugIdIdentifier = "sentry-dbid-b4f0eda2-259a-4c7b-aaf9-58c9f879a0a3");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
})();
|
|
9
|
+
import { __module as fastUri } from "../../../../../_virtual/index12.js";
|
|
10
|
+
import { __require as requireUtils } from "./lib/utils.js";
|
|
11
|
+
import { __require as requireSchemes } from "./lib/schemes.js";
|
|
12
|
+
var hasRequiredFastUri;
|
|
13
|
+
function requireFastUri() {
|
|
14
|
+
if (hasRequiredFastUri) return fastUri.exports;
|
|
15
|
+
hasRequiredFastUri = 1;
|
|
16
|
+
const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = requireUtils();
|
|
17
|
+
const { SCHEMES, getSchemeHandler } = requireSchemes();
|
|
18
|
+
function normalize(uri, options) {
|
|
19
|
+
if (typeof uri === "string") {
|
|
20
|
+
uri = /** @type {T} */
|
|
21
|
+
normalizeString(uri, options);
|
|
22
|
+
} else if (typeof uri === "object") {
|
|
23
|
+
uri = /** @type {T} */
|
|
24
|
+
parse(serialize(uri, options), options);
|
|
25
|
+
}
|
|
26
|
+
return uri;
|
|
27
|
+
}
|
|
28
|
+
function resolve(baseURI, relativeURI, options) {
|
|
29
|
+
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
30
|
+
const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
31
|
+
schemelessOptions.skipEscape = true;
|
|
32
|
+
return serialize(resolved, schemelessOptions);
|
|
33
|
+
}
|
|
34
|
+
function resolveComponent(base, relative, options, skipNormalization) {
|
|
35
|
+
const target = {};
|
|
36
|
+
if (!skipNormalization) {
|
|
37
|
+
base = parse(serialize(base, options), options);
|
|
38
|
+
relative = parse(serialize(relative, options), options);
|
|
39
|
+
}
|
|
40
|
+
options = options || {};
|
|
41
|
+
if (!options.tolerant && relative.scheme) {
|
|
42
|
+
target.scheme = relative.scheme;
|
|
43
|
+
target.userinfo = relative.userinfo;
|
|
44
|
+
target.host = relative.host;
|
|
45
|
+
target.port = relative.port;
|
|
46
|
+
target.path = removeDotSegments(relative.path || "");
|
|
47
|
+
target.query = relative.query;
|
|
48
|
+
} else {
|
|
49
|
+
if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
|
|
50
|
+
target.userinfo = relative.userinfo;
|
|
51
|
+
target.host = relative.host;
|
|
52
|
+
target.port = relative.port;
|
|
53
|
+
target.path = removeDotSegments(relative.path || "");
|
|
54
|
+
target.query = relative.query;
|
|
55
|
+
} else {
|
|
56
|
+
if (!relative.path) {
|
|
57
|
+
target.path = base.path;
|
|
58
|
+
if (relative.query !== void 0) {
|
|
59
|
+
target.query = relative.query;
|
|
60
|
+
} else {
|
|
61
|
+
target.query = base.query;
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
if (relative.path[0] === "/") {
|
|
65
|
+
target.path = removeDotSegments(relative.path);
|
|
66
|
+
} else {
|
|
67
|
+
if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
|
|
68
|
+
target.path = "/" + relative.path;
|
|
69
|
+
} else if (!base.path) {
|
|
70
|
+
target.path = relative.path;
|
|
71
|
+
} else {
|
|
72
|
+
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
|
|
73
|
+
}
|
|
74
|
+
target.path = removeDotSegments(target.path);
|
|
75
|
+
}
|
|
76
|
+
target.query = relative.query;
|
|
77
|
+
}
|
|
78
|
+
target.userinfo = base.userinfo;
|
|
79
|
+
target.host = base.host;
|
|
80
|
+
target.port = base.port;
|
|
81
|
+
}
|
|
82
|
+
target.scheme = base.scheme;
|
|
83
|
+
}
|
|
84
|
+
target.fragment = relative.fragment;
|
|
85
|
+
return target;
|
|
86
|
+
}
|
|
87
|
+
function equal(uriA, uriB, options) {
|
|
88
|
+
const normalizedA = normalizeComparableURI(uriA, options);
|
|
89
|
+
const normalizedB = normalizeComparableURI(uriB, options);
|
|
90
|
+
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
|
|
91
|
+
}
|
|
92
|
+
function serialize(cmpts, opts) {
|
|
93
|
+
const component = {
|
|
94
|
+
host: cmpts.host,
|
|
95
|
+
scheme: cmpts.scheme,
|
|
96
|
+
userinfo: cmpts.userinfo,
|
|
97
|
+
port: cmpts.port,
|
|
98
|
+
path: cmpts.path,
|
|
99
|
+
query: cmpts.query,
|
|
100
|
+
nid: cmpts.nid,
|
|
101
|
+
nss: cmpts.nss,
|
|
102
|
+
uuid: cmpts.uuid,
|
|
103
|
+
fragment: cmpts.fragment,
|
|
104
|
+
reference: cmpts.reference,
|
|
105
|
+
resourceName: cmpts.resourceName,
|
|
106
|
+
secure: cmpts.secure,
|
|
107
|
+
error: ""
|
|
108
|
+
};
|
|
109
|
+
const options = Object.assign({}, opts);
|
|
110
|
+
const uriTokens = [];
|
|
111
|
+
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
112
|
+
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
113
|
+
if (component.path !== void 0) {
|
|
114
|
+
if (!options.skipEscape) {
|
|
115
|
+
component.path = escapePreservingEscapes(component.path);
|
|
116
|
+
if (component.scheme !== void 0) {
|
|
117
|
+
component.path = component.path.split("%3A").join(":");
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
component.path = normalizePercentEncoding(component.path);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (options.reference !== "suffix" && component.scheme) {
|
|
124
|
+
uriTokens.push(component.scheme, ":");
|
|
125
|
+
}
|
|
126
|
+
const authority = recomposeAuthority(component);
|
|
127
|
+
if (authority !== void 0) {
|
|
128
|
+
if (options.reference !== "suffix") {
|
|
129
|
+
uriTokens.push("//");
|
|
130
|
+
}
|
|
131
|
+
uriTokens.push(authority);
|
|
132
|
+
if (component.path && component.path[0] !== "/") {
|
|
133
|
+
uriTokens.push("/");
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (component.path !== void 0) {
|
|
137
|
+
let s = component.path;
|
|
138
|
+
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
139
|
+
s = removeDotSegments(s);
|
|
140
|
+
}
|
|
141
|
+
if (authority === void 0 && s[0] === "/" && s[1] === "/") {
|
|
142
|
+
s = "/%2F" + s.slice(2);
|
|
143
|
+
}
|
|
144
|
+
uriTokens.push(s);
|
|
145
|
+
}
|
|
146
|
+
if (component.query !== void 0) {
|
|
147
|
+
uriTokens.push("?", component.query);
|
|
148
|
+
}
|
|
149
|
+
if (component.fragment !== void 0) {
|
|
150
|
+
uriTokens.push("#", component.fragment);
|
|
151
|
+
}
|
|
152
|
+
return uriTokens.join("");
|
|
153
|
+
}
|
|
154
|
+
const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
155
|
+
function getParseError(parsed, matches) {
|
|
156
|
+
if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
|
|
157
|
+
return 'URI path must start with "/" when authority is present.';
|
|
158
|
+
}
|
|
159
|
+
if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
|
|
160
|
+
return "URI port is malformed.";
|
|
161
|
+
}
|
|
162
|
+
return void 0;
|
|
163
|
+
}
|
|
164
|
+
function parseWithStatus(uri, opts) {
|
|
165
|
+
const options = Object.assign({}, opts);
|
|
166
|
+
const parsed = {
|
|
167
|
+
scheme: void 0,
|
|
168
|
+
userinfo: void 0,
|
|
169
|
+
host: "",
|
|
170
|
+
port: void 0,
|
|
171
|
+
path: "",
|
|
172
|
+
query: void 0,
|
|
173
|
+
fragment: void 0
|
|
174
|
+
};
|
|
175
|
+
let malformedAuthorityOrPort = false;
|
|
176
|
+
let isIP = false;
|
|
177
|
+
if (options.reference === "suffix") {
|
|
178
|
+
if (options.scheme) {
|
|
179
|
+
uri = options.scheme + ":" + uri;
|
|
180
|
+
} else {
|
|
181
|
+
uri = "//" + uri;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
const matches = uri.match(URI_PARSE);
|
|
185
|
+
if (matches) {
|
|
186
|
+
parsed.scheme = matches[1];
|
|
187
|
+
parsed.userinfo = matches[3];
|
|
188
|
+
parsed.host = matches[4];
|
|
189
|
+
parsed.port = parseInt(matches[5], 10);
|
|
190
|
+
parsed.path = matches[6] || "";
|
|
191
|
+
parsed.query = matches[7];
|
|
192
|
+
parsed.fragment = matches[8];
|
|
193
|
+
if (isNaN(parsed.port)) {
|
|
194
|
+
parsed.port = matches[5];
|
|
195
|
+
}
|
|
196
|
+
const parseError = getParseError(parsed, matches);
|
|
197
|
+
if (parseError !== void 0) {
|
|
198
|
+
parsed.error = parsed.error || parseError;
|
|
199
|
+
malformedAuthorityOrPort = true;
|
|
200
|
+
}
|
|
201
|
+
if (parsed.host) {
|
|
202
|
+
const ipv4result = isIPv4(parsed.host);
|
|
203
|
+
if (ipv4result === false) {
|
|
204
|
+
const ipv6result = normalizeIPv6(parsed.host);
|
|
205
|
+
parsed.host = ipv6result.host.toLowerCase();
|
|
206
|
+
isIP = ipv6result.isIPV6;
|
|
207
|
+
} else {
|
|
208
|
+
isIP = true;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) {
|
|
212
|
+
parsed.reference = "same-document";
|
|
213
|
+
} else if (parsed.scheme === void 0) {
|
|
214
|
+
parsed.reference = "relative";
|
|
215
|
+
} else if (parsed.fragment === void 0) {
|
|
216
|
+
parsed.reference = "absolute";
|
|
217
|
+
} else {
|
|
218
|
+
parsed.reference = "uri";
|
|
219
|
+
}
|
|
220
|
+
if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) {
|
|
221
|
+
parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
|
|
222
|
+
}
|
|
223
|
+
const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
|
|
224
|
+
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
225
|
+
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
226
|
+
try {
|
|
227
|
+
parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
|
|
228
|
+
} catch (e) {
|
|
229
|
+
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
234
|
+
if (uri.indexOf("%") !== -1) {
|
|
235
|
+
if (parsed.scheme !== void 0) {
|
|
236
|
+
parsed.scheme = unescape(parsed.scheme);
|
|
237
|
+
}
|
|
238
|
+
if (parsed.host !== void 0) {
|
|
239
|
+
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
if (parsed.path) {
|
|
243
|
+
parsed.path = normalizePathEncoding(parsed.path);
|
|
244
|
+
}
|
|
245
|
+
if (parsed.fragment) {
|
|
246
|
+
try {
|
|
247
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
248
|
+
} catch {
|
|
249
|
+
parsed.error = parsed.error || "URI malformed";
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (schemeHandler && schemeHandler.parse) {
|
|
254
|
+
schemeHandler.parse(parsed, options);
|
|
255
|
+
}
|
|
256
|
+
} else {
|
|
257
|
+
parsed.error = parsed.error || "URI can not be parsed.";
|
|
258
|
+
}
|
|
259
|
+
return { parsed, malformedAuthorityOrPort };
|
|
260
|
+
}
|
|
261
|
+
function parse(uri, opts) {
|
|
262
|
+
return parseWithStatus(uri, opts).parsed;
|
|
263
|
+
}
|
|
264
|
+
function normalizeString(uri, opts) {
|
|
265
|
+
return normalizeStringWithStatus(uri, opts).normalized;
|
|
266
|
+
}
|
|
267
|
+
function normalizeStringWithStatus(uri, opts) {
|
|
268
|
+
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
269
|
+
return {
|
|
270
|
+
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
271
|
+
malformedAuthorityOrPort
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
function normalizeComparableURI(uri, opts) {
|
|
275
|
+
if (typeof uri === "string") {
|
|
276
|
+
const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
|
|
277
|
+
return malformedAuthorityOrPort ? void 0 : normalized;
|
|
278
|
+
}
|
|
279
|
+
if (typeof uri === "object") {
|
|
280
|
+
return serialize(uri, opts);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
const fastUri$1 = {
|
|
284
|
+
SCHEMES,
|
|
285
|
+
normalize,
|
|
286
|
+
resolve,
|
|
287
|
+
resolveComponent,
|
|
288
|
+
equal,
|
|
289
|
+
serialize,
|
|
290
|
+
parse
|
|
291
|
+
};
|
|
292
|
+
fastUri.exports = fastUri$1;
|
|
293
|
+
fastUri.exports.default = fastUri$1;
|
|
294
|
+
fastUri.exports.fastUri = fastUri$1;
|
|
295
|
+
return fastUri.exports;
|
|
296
|
+
}
|
|
297
|
+
export {
|
|
298
|
+
requireFastUri as __require
|
|
299
|
+
};
|
|
300
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js"],"sourcesContent":["'use strict'\n\nconst { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require('./lib/utils')\nconst { SCHEMES, getSchemeHandler } = require('./lib/schemes')\n\n/**\n * @template {import('./types/index').URIComponent|string} T\n * @param {T} uri\n * @param {import('./types/index').Options} [options]\n * @returns {T}\n */\nfunction normalize (uri, options) {\n if (typeof uri === 'string') {\n uri = /** @type {T} */ (normalizeString(uri, options))\n } else if (typeof uri === 'object') {\n uri = /** @type {T} */ (parse(serialize(uri, options), options))\n }\n return uri\n}\n\n/**\n * @param {string} baseURI\n * @param {string} relativeURI\n * @param {import('./types/index').Options} [options]\n * @returns {string}\n */\nfunction resolve (baseURI, relativeURI, options) {\n const schemelessOptions = options ? Object.assign({ scheme: 'null' }, options) : { scheme: 'null' }\n const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true)\n schemelessOptions.skipEscape = true\n return serialize(resolved, schemelessOptions)\n}\n\n/**\n * @param {import ('./types/index').URIComponent} base\n * @param {import ('./types/index').URIComponent} relative\n * @param {import('./types/index').Options} [options]\n * @param {boolean} [skipNormalization=false]\n * @returns {import ('./types/index').URIComponent}\n */\nfunction resolveComponent (base, relative, options, skipNormalization) {\n /** @type {import('./types/index').URIComponent} */\n const target = {}\n if (!skipNormalization) {\n base = parse(serialize(base, options), options) // normalize base component\n relative = parse(serialize(relative, options), options) // normalize relative component\n }\n options = options || {}\n\n if (!options.tolerant && relative.scheme) {\n target.scheme = relative.scheme\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (!relative.path) {\n target.path = base.path\n if (relative.query !== undefined) {\n target.query = relative.query\n } else {\n target.query = base.query\n }\n } else {\n if (relative.path[0] === '/') {\n target.path = removeDotSegments(relative.path)\n } else {\n if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n target.path = '/' + relative.path\n } else if (!base.path) {\n target.path = relative.path\n } else {\n target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path\n }\n target.path = removeDotSegments(target.path)\n }\n target.query = relative.query\n }\n // target.authority = base.authority;\n target.userinfo = base.userinfo\n target.host = base.host\n target.port = base.port\n }\n target.scheme = base.scheme\n }\n\n target.fragment = relative.fragment\n\n return target\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uriA\n * @param {import ('./types/index').URIComponent|string} uriB\n * @param {import ('./types/index').Options} options\n * @returns {boolean}\n */\nfunction equal (uriA, uriB, options) {\n const normalizedA = normalizeComparableURI(uriA, options)\n const normalizedB = normalizeComparableURI(uriB, options)\n\n return normalizedA !== undefined && normalizedB !== undefined && normalizedA.toLowerCase() === normalizedB.toLowerCase()\n}\n\n/**\n * @param {Readonly<import('./types/index').URIComponent>} cmpts\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction serialize (cmpts, opts) {\n const component = {\n host: cmpts.host,\n scheme: cmpts.scheme,\n userinfo: cmpts.userinfo,\n port: cmpts.port,\n path: cmpts.path,\n query: cmpts.query,\n nid: cmpts.nid,\n nss: cmpts.nss,\n uuid: cmpts.uuid,\n fragment: cmpts.fragment,\n reference: cmpts.reference,\n resourceName: cmpts.resourceName,\n secure: cmpts.secure,\n error: ''\n }\n const options = Object.assign({}, opts)\n const uriTokens = []\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || component.scheme)\n\n // perform scheme specific serialization\n if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options)\n\n if (component.path !== undefined) {\n if (!options.skipEscape) {\n component.path = escapePreservingEscapes(component.path)\n\n if (component.scheme !== undefined) {\n component.path = component.path.split('%3A').join(':')\n }\n } else {\n component.path = normalizePercentEncoding(component.path)\n }\n }\n\n if (options.reference !== 'suffix' && component.scheme) {\n uriTokens.push(component.scheme, ':')\n }\n\n const authority = recomposeAuthority(component)\n if (authority !== undefined) {\n if (options.reference !== 'suffix') {\n uriTokens.push('//')\n }\n\n uriTokens.push(authority)\n\n if (component.path && component.path[0] !== '/') {\n uriTokens.push('/')\n }\n }\n if (component.path !== undefined) {\n let s = component.path\n\n if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n s = removeDotSegments(s)\n }\n\n if (\n authority === undefined &&\n s[0] === '/' &&\n s[1] === '/'\n ) {\n // don't allow the path to start with \"//\"\n s = '/%2F' + s.slice(2)\n }\n\n uriTokens.push(s)\n }\n\n if (component.query !== undefined) {\n uriTokens.push('?', component.query)\n }\n\n if (component.fragment !== undefined) {\n uriTokens.push('#', component.fragment)\n }\n return uriTokens.join('')\n}\n\nconst URI_PARSE = /^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?/u\n\n/**\n * @param {import('./types/index').URIComponent} parsed\n * @param {RegExpMatchArray} matches\n * @returns {string|undefined}\n */\nfunction getParseError (parsed, matches) {\n if (matches[2] !== undefined && parsed.path && parsed.path[0] !== '/') {\n return 'URI path must start with \"/\" when authority is present.'\n }\n\n if (typeof parsed.port === 'number' && (parsed.port < 0 || parsed.port > 65535)) {\n return 'URI port is malformed.'\n }\n\n return undefined\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ parsed: import('./types/index').URIComponent, malformedAuthorityOrPort: boolean }}\n */\nfunction parseWithStatus (uri, opts) {\n const options = Object.assign({}, opts)\n /** @type {import('./types/index').URIComponent} */\n const parsed = {\n scheme: undefined,\n userinfo: undefined,\n host: '',\n port: undefined,\n path: '',\n query: undefined,\n fragment: undefined\n }\n\n let malformedAuthorityOrPort = false\n\n let isIP = false\n if (options.reference === 'suffix') {\n if (options.scheme) {\n uri = options.scheme + ':' + uri\n } else {\n uri = '//' + uri\n }\n }\n\n const matches = uri.match(URI_PARSE)\n\n if (matches) {\n // store each component\n parsed.scheme = matches[1]\n parsed.userinfo = matches[3]\n parsed.host = matches[4]\n parsed.port = parseInt(matches[5], 10)\n parsed.path = matches[6] || ''\n parsed.query = matches[7]\n parsed.fragment = matches[8]\n\n // fix port number\n if (isNaN(parsed.port)) {\n parsed.port = matches[5]\n }\n\n const parseError = getParseError(parsed, matches)\n if (parseError !== undefined) {\n parsed.error = parsed.error || parseError\n malformedAuthorityOrPort = true\n }\n\n if (parsed.host) {\n const ipv4result = isIPv4(parsed.host)\n if (ipv4result === false) {\n const ipv6result = normalizeIPv6(parsed.host)\n parsed.host = ipv6result.host.toLowerCase()\n isIP = ipv6result.isIPV6\n } else {\n isIP = true\n }\n }\n if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && parsed.query === undefined && !parsed.path) {\n parsed.reference = 'same-document'\n } else if (parsed.scheme === undefined) {\n parsed.reference = 'relative'\n } else if (parsed.fragment === undefined) {\n parsed.reference = 'absolute'\n } else {\n parsed.reference = 'uri'\n }\n\n // check for reference errors\n if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) {\n parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.'\n }\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme)\n\n // check if scheme can't handle IRIs\n if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n // if host component is a domain name\n if (parsed.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost)) && isIP === false && nonSimpleDomain(parsed.host)) {\n // convert Unicode IDN -> ASCII IDN\n try {\n parsed.host = URL.domainToASCII(parsed.host.toLowerCase())\n } catch (e) {\n parsed.error = parsed.error || \"Host's domain name can not be converted to ASCII: \" + e\n }\n }\n // convert IRI -> URI\n }\n\n if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {\n if (uri.indexOf('%') !== -1) {\n if (parsed.scheme !== undefined) {\n parsed.scheme = unescape(parsed.scheme)\n }\n if (parsed.host !== undefined) {\n parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP)\n }\n }\n if (parsed.path) {\n parsed.path = normalizePathEncoding(parsed.path)\n }\n if (parsed.fragment) {\n try {\n parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment))\n } catch {\n parsed.error = parsed.error || 'URI malformed'\n }\n }\n }\n\n // perform scheme specific parsing\n if (schemeHandler && schemeHandler.parse) {\n schemeHandler.parse(parsed, options)\n }\n } else {\n parsed.error = parsed.error || 'URI can not be parsed.'\n }\n return { parsed, malformedAuthorityOrPort }\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns\n */\nfunction parse (uri, opts) {\n return parseWithStatus(uri, opts).parsed\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction normalizeString (uri, opts) {\n return normalizeStringWithStatus(uri, opts).normalized\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ normalized: string, malformedAuthorityOrPort: boolean }}\n */\nfunction normalizeStringWithStatus (uri, opts) {\n const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts)\n return {\n normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),\n malformedAuthorityOrPort\n }\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string|undefined}\n */\nfunction normalizeComparableURI (uri, opts) {\n if (typeof uri === 'string') {\n const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts)\n return malformedAuthorityOrPort ? undefined : normalized\n }\n\n if (typeof uri === 'object') {\n return serialize(uri, opts)\n }\n}\n\nconst fastUri = {\n SCHEMES,\n normalize,\n resolve,\n resolveComponent,\n equal,\n serialize,\n parse\n}\n\nmodule.exports = fastUri\nmodule.exports.default = fastUri\nmodule.exports.fastUri = fastUri\n"],"names":["require$$0","require$$1","fastUri","fastUriModule"],"mappings":";;;;;;;;;;;;;;;AAEA,QAAM,EAAE,eAAe,mBAAmB,oBAAoB,0BAA0B,uBAAuB,yBAAyB,wBAAwB,QAAQ,gBAAe,IAAKA,aAAA;AAC5L,QAAM,EAAE,SAAS,iBAAgB,IAAKC,eAAA;AAQtC,WAAS,UAAW,KAAK,SAAS;AAChC,QAAI,OAAO,QAAQ,UAAU;AAC3B;AAAA,MAAwB,gBAAgB,KAAK,OAAO;AAAA,IACxD,WAAa,OAAO,QAAQ,UAAU;AAClC;AAAA,MAAwB,MAAM,UAAU,KAAK,OAAO,GAAG,OAAO;AAAA,IAClE;AACE,WAAO;AAAA,EACT;AAQA,WAAS,QAAS,SAAS,aAAa,SAAS;AAC/C,UAAM,oBAAoB,UAAU,OAAO,OAAO,EAAE,QAAQ,UAAU,OAAO,IAAI,EAAE,QAAQ,OAAM;AACjG,UAAM,WAAW,iBAAiB,MAAM,SAAS,iBAAiB,GAAG,MAAM,aAAa,iBAAiB,GAAG,mBAAmB,IAAI;AACnI,sBAAkB,aAAa;AAC/B,WAAO,UAAU,UAAU,iBAA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,CAAC;AAAA,UACzE,QAAgB;AACN,mBAAO,QAAQ,OAAO,SAAS;AAAA,UACzC;AAAA,QACA;AAAA,MACA;AAGI,UAAI,iBAAiB,cAAc,OAAO;AACxC,sBAAc,MAAM,QAAQ,OAAO;AAAA,MACzC;AAAA,IACA,OAAS;AACL,aAAO,QAAQ,OAAO,SAAS;AAAA,IACnC;AACE,WAAO,EAAE,QAAQ,yBAAwB;AAAA,EAC3C;AAOA,WAAS,MAAO,KAAK,MAAM;AACzB,WAAO,gBAAgB,KAAK,IAAI,EAAE;AAAA,EACpC;AAOA,WAAS,gBAAiB,KAAK,MAAM;AACnC,WAAO,0BAA0B,KAAK,IAAI,EAAE;AAAA,EAC9C;AAOA,WAAS,0BAA2B,KAAK,MAAM;AAC7C,UAAM,EAAE,QAAQ,yBAAwB,IAAK,gBAAgB,KAAK,IAAI;AACtE,WAAO;AAAA,MACL,YAAY,2BAA2B,MAAM,UAAU,QAAQ,IAAI;AAAA,MACnE;AAAA,IACJ;AAAA,EACA;AAOA,WAAS,uBAAwB,KAAK,MAAM;AAC1C,QAAI,OAAO,QAAQ,UAAU;AAC3B,YAAM,EAAE,YAAY,yBAAwB,IAAK,0BAA0B,KAAK,IAAI;AACpF,aAAO,2BAA2B,SAAY;AAAA,IAClD;AAEE,QAAI,OAAO,QAAQ,UAAU;AAC3B,aAAO,UAAU,KAAK,IAAI;AAAA,IAC9B;AAAA,EACA;AAEA,QAAMC,YAAU;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEAC,UAAA,UAAiBD;AACjBC,UAAA,QAAA,UAAyBD;AACzBC,UAAA,QAAA,UAAyBD;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
;
|
|
2
|
+
!(function() {
|
|
3
|
+
try {
|
|
4
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "eccedc5b-9c52-4853-ad3f-3ad17167337c", e._sentryDebugIdIdentifier = "sentry-dbid-eccedc5b-9c52-4853-ad3f-3ad17167337c");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
})();
|
|
9
|
+
import { __require as requireUtils } from "./utils.js";
|
|
10
|
+
var schemes;
|
|
11
|
+
var hasRequiredSchemes;
|
|
12
|
+
function requireSchemes() {
|
|
13
|
+
if (hasRequiredSchemes) return schemes;
|
|
14
|
+
hasRequiredSchemes = 1;
|
|
15
|
+
const { isUUID } = requireUtils();
|
|
16
|
+
const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
17
|
+
const supportedSchemeNames = (
|
|
18
|
+
/** @type {const} */
|
|
19
|
+
[
|
|
20
|
+
"http",
|
|
21
|
+
"https",
|
|
22
|
+
"ws",
|
|
23
|
+
"wss",
|
|
24
|
+
"urn",
|
|
25
|
+
"urn:uuid"
|
|
26
|
+
]
|
|
27
|
+
);
|
|
28
|
+
function isValidSchemeName(name) {
|
|
29
|
+
return supportedSchemeNames.indexOf(
|
|
30
|
+
/** @type {*} */
|
|
31
|
+
name
|
|
32
|
+
) !== -1;
|
|
33
|
+
}
|
|
34
|
+
function wsIsSecure(wsComponent) {
|
|
35
|
+
if (wsComponent.secure === true) {
|
|
36
|
+
return true;
|
|
37
|
+
} else if (wsComponent.secure === false) {
|
|
38
|
+
return false;
|
|
39
|
+
} else if (wsComponent.scheme) {
|
|
40
|
+
return wsComponent.scheme.length === 3 && (wsComponent.scheme[0] === "w" || wsComponent.scheme[0] === "W") && (wsComponent.scheme[1] === "s" || wsComponent.scheme[1] === "S") && (wsComponent.scheme[2] === "s" || wsComponent.scheme[2] === "S");
|
|
41
|
+
} else {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function httpParse(component) {
|
|
46
|
+
if (!component.host) {
|
|
47
|
+
component.error = component.error || "HTTP URIs must have a host.";
|
|
48
|
+
}
|
|
49
|
+
return component;
|
|
50
|
+
}
|
|
51
|
+
function httpSerialize(component) {
|
|
52
|
+
const secure = String(component.scheme).toLowerCase() === "https";
|
|
53
|
+
if (component.port === (secure ? 443 : 80) || component.port === "") {
|
|
54
|
+
component.port = void 0;
|
|
55
|
+
}
|
|
56
|
+
if (!component.path) {
|
|
57
|
+
component.path = "/";
|
|
58
|
+
}
|
|
59
|
+
return component;
|
|
60
|
+
}
|
|
61
|
+
function wsParse(wsComponent) {
|
|
62
|
+
wsComponent.secure = wsIsSecure(wsComponent);
|
|
63
|
+
wsComponent.resourceName = (wsComponent.path || "/") + (wsComponent.query ? "?" + wsComponent.query : "");
|
|
64
|
+
wsComponent.path = void 0;
|
|
65
|
+
wsComponent.query = void 0;
|
|
66
|
+
return wsComponent;
|
|
67
|
+
}
|
|
68
|
+
function wsSerialize(wsComponent) {
|
|
69
|
+
if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === "") {
|
|
70
|
+
wsComponent.port = void 0;
|
|
71
|
+
}
|
|
72
|
+
if (typeof wsComponent.secure === "boolean") {
|
|
73
|
+
wsComponent.scheme = wsComponent.secure ? "wss" : "ws";
|
|
74
|
+
wsComponent.secure = void 0;
|
|
75
|
+
}
|
|
76
|
+
if (wsComponent.resourceName) {
|
|
77
|
+
const [path, query] = wsComponent.resourceName.split("?");
|
|
78
|
+
wsComponent.path = path && path !== "/" ? path : void 0;
|
|
79
|
+
wsComponent.query = query;
|
|
80
|
+
wsComponent.resourceName = void 0;
|
|
81
|
+
}
|
|
82
|
+
wsComponent.fragment = void 0;
|
|
83
|
+
return wsComponent;
|
|
84
|
+
}
|
|
85
|
+
function urnParse(urnComponent, options) {
|
|
86
|
+
if (!urnComponent.path) {
|
|
87
|
+
urnComponent.error = "URN can not be parsed";
|
|
88
|
+
return urnComponent;
|
|
89
|
+
}
|
|
90
|
+
const matches = urnComponent.path.match(URN_REG);
|
|
91
|
+
if (matches) {
|
|
92
|
+
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
93
|
+
urnComponent.nid = matches[1].toLowerCase();
|
|
94
|
+
urnComponent.nss = matches[2];
|
|
95
|
+
const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`;
|
|
96
|
+
const schemeHandler = getSchemeHandler(urnScheme);
|
|
97
|
+
urnComponent.path = void 0;
|
|
98
|
+
if (schemeHandler) {
|
|
99
|
+
urnComponent = schemeHandler.parse(urnComponent, options);
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
urnComponent.error = urnComponent.error || "URN can not be parsed.";
|
|
103
|
+
}
|
|
104
|
+
return urnComponent;
|
|
105
|
+
}
|
|
106
|
+
function urnSerialize(urnComponent, options) {
|
|
107
|
+
if (urnComponent.nid === void 0) {
|
|
108
|
+
throw new Error("URN without nid cannot be serialized");
|
|
109
|
+
}
|
|
110
|
+
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
111
|
+
const nid = urnComponent.nid.toLowerCase();
|
|
112
|
+
const urnScheme = `${scheme}:${options.nid || nid}`;
|
|
113
|
+
const schemeHandler = getSchemeHandler(urnScheme);
|
|
114
|
+
if (schemeHandler) {
|
|
115
|
+
urnComponent = schemeHandler.serialize(urnComponent, options);
|
|
116
|
+
}
|
|
117
|
+
const uriComponent = urnComponent;
|
|
118
|
+
const nss = urnComponent.nss;
|
|
119
|
+
uriComponent.path = `${nid || options.nid}:${nss}`;
|
|
120
|
+
options.skipEscape = true;
|
|
121
|
+
return uriComponent;
|
|
122
|
+
}
|
|
123
|
+
function urnuuidParse(urnComponent, options) {
|
|
124
|
+
const uuidComponent = urnComponent;
|
|
125
|
+
uuidComponent.uuid = uuidComponent.nss;
|
|
126
|
+
uuidComponent.nss = void 0;
|
|
127
|
+
if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {
|
|
128
|
+
uuidComponent.error = uuidComponent.error || "UUID is not valid.";
|
|
129
|
+
}
|
|
130
|
+
return uuidComponent;
|
|
131
|
+
}
|
|
132
|
+
function urnuuidSerialize(uuidComponent) {
|
|
133
|
+
const urnComponent = uuidComponent;
|
|
134
|
+
urnComponent.nss = (uuidComponent.uuid || "").toLowerCase();
|
|
135
|
+
return urnComponent;
|
|
136
|
+
}
|
|
137
|
+
const http = (
|
|
138
|
+
/** @type {SchemeHandler} */
|
|
139
|
+
{
|
|
140
|
+
scheme: "http",
|
|
141
|
+
domainHost: true,
|
|
142
|
+
parse: httpParse,
|
|
143
|
+
serialize: httpSerialize
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
const https = (
|
|
147
|
+
/** @type {SchemeHandler} */
|
|
148
|
+
{
|
|
149
|
+
scheme: "https",
|
|
150
|
+
domainHost: http.domainHost,
|
|
151
|
+
parse: httpParse,
|
|
152
|
+
serialize: httpSerialize
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
const ws = (
|
|
156
|
+
/** @type {SchemeHandler} */
|
|
157
|
+
{
|
|
158
|
+
scheme: "ws",
|
|
159
|
+
domainHost: true,
|
|
160
|
+
parse: wsParse,
|
|
161
|
+
serialize: wsSerialize
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
const wss = (
|
|
165
|
+
/** @type {SchemeHandler} */
|
|
166
|
+
{
|
|
167
|
+
scheme: "wss",
|
|
168
|
+
domainHost: ws.domainHost,
|
|
169
|
+
parse: ws.parse,
|
|
170
|
+
serialize: ws.serialize
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
const urn = (
|
|
174
|
+
/** @type {SchemeHandler} */
|
|
175
|
+
{
|
|
176
|
+
scheme: "urn",
|
|
177
|
+
parse: urnParse,
|
|
178
|
+
serialize: urnSerialize,
|
|
179
|
+
skipNormalize: true
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
const urnuuid = (
|
|
183
|
+
/** @type {SchemeHandler} */
|
|
184
|
+
{
|
|
185
|
+
scheme: "urn:uuid",
|
|
186
|
+
parse: urnuuidParse,
|
|
187
|
+
serialize: urnuuidSerialize,
|
|
188
|
+
skipNormalize: true
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
const SCHEMES = (
|
|
192
|
+
/** @type {Record<SchemeName, SchemeHandler>} */
|
|
193
|
+
{
|
|
194
|
+
http,
|
|
195
|
+
https,
|
|
196
|
+
ws,
|
|
197
|
+
wss,
|
|
198
|
+
urn,
|
|
199
|
+
"urn:uuid": urnuuid
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
Object.setPrototypeOf(SCHEMES, null);
|
|
203
|
+
function getSchemeHandler(scheme) {
|
|
204
|
+
return scheme && (SCHEMES[
|
|
205
|
+
/** @type {SchemeName} */
|
|
206
|
+
scheme
|
|
207
|
+
] || SCHEMES[
|
|
208
|
+
/** @type {SchemeName} */
|
|
209
|
+
scheme.toLowerCase()
|
|
210
|
+
]) || void 0;
|
|
211
|
+
}
|
|
212
|
+
schemes = {
|
|
213
|
+
wsIsSecure,
|
|
214
|
+
SCHEMES,
|
|
215
|
+
isValidSchemeName,
|
|
216
|
+
getSchemeHandler
|
|
217
|
+
};
|
|
218
|
+
return schemes;
|
|
219
|
+
}
|
|
220
|
+
export {
|
|
221
|
+
requireSchemes as __require
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=schemes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemes.js","sources":["../../../../../../../../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js"],"sourcesContent":["'use strict'\n\nconst { isUUID } = require('./utils')\nconst URN_REG = /([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)/iu\n\nconst supportedSchemeNames = /** @type {const} */ (['http', 'https', 'ws',\n 'wss', 'urn', 'urn:uuid'])\n\n/** @typedef {supportedSchemeNames[number]} SchemeName */\n\n/**\n * @param {string} name\n * @returns {name is SchemeName}\n */\nfunction isValidSchemeName (name) {\n return supportedSchemeNames.indexOf(/** @type {*} */ (name)) !== -1\n}\n\n/**\n * @callback SchemeFn\n * @param {import('../types/index').URIComponent} component\n * @param {import('../types/index').Options} options\n * @returns {import('../types/index').URIComponent}\n */\n\n/**\n * @typedef {Object} SchemeHandler\n * @property {SchemeName} scheme - The scheme name.\n * @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.\n * @property {SchemeFn} parse - Function to parse the URI component for this scheme.\n * @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.\n * @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.\n * @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.\n * @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.\n */\n\n/**\n * @param {import('../types/index').URIComponent} wsComponent\n * @returns {boolean}\n */\nfunction wsIsSecure (wsComponent) {\n if (wsComponent.secure === true) {\n return true\n } else if (wsComponent.secure === false) {\n return false\n } else if (wsComponent.scheme) {\n return (\n wsComponent.scheme.length === 3 &&\n (wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') &&\n (wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') &&\n (wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S')\n )\n } else {\n return false\n }\n}\n\n/** @type {SchemeFn} */\nfunction httpParse (component) {\n if (!component.host) {\n component.error = component.error || 'HTTP URIs must have a host.'\n }\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction httpSerialize (component) {\n const secure = String(component.scheme).toLowerCase() === 'https'\n\n // normalize the default port\n if (component.port === (secure ? 443 : 80) || component.port === '') {\n component.port = undefined\n }\n\n // normalize the empty path\n if (!component.path) {\n component.path = '/'\n }\n\n // NOTE: We do not parse query strings for HTTP URIs\n // as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n // and not the HTTP spec.\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction wsParse (wsComponent) {\n// indicate if the secure flag is set\n wsComponent.secure = wsIsSecure(wsComponent)\n\n // construct resouce name\n wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : '')\n wsComponent.path = undefined\n wsComponent.query = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction wsSerialize (wsComponent) {\n// normalize the default port\n if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') {\n wsComponent.port = undefined\n }\n\n // ensure scheme matches secure flag\n if (typeof wsComponent.secure === 'boolean') {\n wsComponent.scheme = (wsComponent.secure ? 'wss' : 'ws')\n wsComponent.secure = undefined\n }\n\n // reconstruct path from resource name\n if (wsComponent.resourceName) {\n const [path, query] = wsComponent.resourceName.split('?')\n wsComponent.path = (path && path !== '/' ? path : undefined)\n wsComponent.query = query\n wsComponent.resourceName = undefined\n }\n\n // forbid fragment component\n wsComponent.fragment = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnParse (urnComponent, options) {\n if (!urnComponent.path) {\n urnComponent.error = 'URN can not be parsed'\n return urnComponent\n }\n const matches = urnComponent.path.match(URN_REG)\n if (matches) {\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n urnComponent.nid = matches[1].toLowerCase()\n urnComponent.nss = matches[2]\n const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n urnComponent.path = undefined\n\n if (schemeHandler) {\n urnComponent = schemeHandler.parse(urnComponent, options)\n }\n } else {\n urnComponent.error = urnComponent.error || 'URN can not be parsed.'\n }\n\n return urnComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnSerialize (urnComponent, options) {\n if (urnComponent.nid === undefined) {\n throw new Error('URN without nid cannot be serialized')\n }\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n const nid = urnComponent.nid.toLowerCase()\n const urnScheme = `${scheme}:${options.nid || nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n\n if (schemeHandler) {\n urnComponent = schemeHandler.serialize(urnComponent, options)\n }\n\n const uriComponent = urnComponent\n const nss = urnComponent.nss\n uriComponent.path = `${nid || options.nid}:${nss}`\n\n options.skipEscape = true\n return uriComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidParse (urnComponent, options) {\n const uuidComponent = urnComponent\n uuidComponent.uuid = uuidComponent.nss\n uuidComponent.nss = undefined\n\n if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {\n uuidComponent.error = uuidComponent.error || 'UUID is not valid.'\n }\n\n return uuidComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidSerialize (uuidComponent) {\n const urnComponent = uuidComponent\n // normalize UUID\n urnComponent.nss = (uuidComponent.uuid || '').toLowerCase()\n return urnComponent\n}\n\nconst http = /** @type {SchemeHandler} */ ({\n scheme: 'http',\n domainHost: true,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst https = /** @type {SchemeHandler} */ ({\n scheme: 'https',\n domainHost: http.domainHost,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst ws = /** @type {SchemeHandler} */ ({\n scheme: 'ws',\n domainHost: true,\n parse: wsParse,\n serialize: wsSerialize\n})\n\nconst wss = /** @type {SchemeHandler} */ ({\n scheme: 'wss',\n domainHost: ws.domainHost,\n parse: ws.parse,\n serialize: ws.serialize\n})\n\nconst urn = /** @type {SchemeHandler} */ ({\n scheme: 'urn',\n parse: urnParse,\n serialize: urnSerialize,\n skipNormalize: true\n})\n\nconst urnuuid = /** @type {SchemeHandler} */ ({\n scheme: 'urn:uuid',\n parse: urnuuidParse,\n serialize: urnuuidSerialize,\n skipNormalize: true\n})\n\nconst SCHEMES = /** @type {Record<SchemeName, SchemeHandler>} */ ({\n http,\n https,\n ws,\n wss,\n urn,\n 'urn:uuid': urnuuid\n})\n\nObject.setPrototypeOf(SCHEMES, null)\n\n/**\n * @param {string|undefined} scheme\n * @returns {SchemeHandler|undefined}\n */\nfunction getSchemeHandler (scheme) {\n return (\n scheme && (\n SCHEMES[/** @type {SchemeName} */ (scheme)] ||\n SCHEMES[/** @type {SchemeName} */(scheme.toLowerCase())])\n ) ||\n undefined\n}\n\nmodule.exports = {\n wsIsSecure,\n SCHEMES,\n isValidSchemeName,\n getSchemeHandler,\n}\n"],"names":["require$$0"],"mappings":";;;;;;;;;AAEA,MAAM,EAAE,OAAM,IAAKA;AACnB,MAAM,UAAU;AAqChB,SAAS,WAAY,aAAa;AAChC,MAAI,YAAY,WAAW,MAAM;AAC/B,WAAO;AAAA,EACX,WAAa,YAAY,WAAW,OAAO;AACvC,WAAO;AAAA,EACX,WAAa,YAAY,QAAQ;AAC7B,WACE,YAAY,OAAO,WAAW,MAC7B,YAAY,OAAO,CAAC,MAAM,OAAO,YAAY,OAAO,CAAC,MAAM,SAC3D,YAAY,OAAO,CAAC,MAAM,OAAO,YAAY,OAAO,CAAC,MAAM,SAC3D,YAAY,OAAO,CAAC,MAAM,OAAO,YAAY,OAAO,CAAC,MAAM;AAAA,EAElE,OAAS;AACL,WAAO;AAAA,EACX;AACA;AAGA,SAAS,UAAW,WAAW;AAC7B,MAAI,CAAC,UAAU,MAAM;AACnB,cAAU,QAAQ,UAAU,SAAS;AAAA,EACzC;AAEE,SAAO;AACT;AAGA,SAAS,cAAe,WAAW;AACjC,QAAM,SAAS,OAAO,UAAU,MAAM,EAAE,YAAW,MAAO;AAG1D,MAAI,UAAU,UAAU,SAAS,MAAM,OAAO,UAAU,SAAS,IAAI;AACnE,cAAU,OAAO;AAAA,EACrB;AAGE,MAAI,CAAC,UAAU,MAAM;AACnB,cAAU,OAAO;AAAA,EACrB;AAME,SAAO;AACT;AAGA,SAAS,QAAS,aAAa;AAE7B,cAAY,SAAS,WAAW,WAAW;AAG3C,cAAY,gBAAgB,YAAY,QAAQ,QAAQ,YAAY,QAAQ,MAAM,YAAY,QAAQ;AACtG,cAAY,OAAO;AAC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Ae;AAAA,EACjB;AAAA;AAEA,MAAM;AAAA;AAAA,EAAwC;AAAA,IAC5C,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,WAAW;AAAA,IACX,eAAe;AAAA,EACjB;AAAA;AAEA,MAAM;AAAA;AAAA,EAA4D;AAAA,IAChE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,EACd;AAAA;AAEA,OAAO,eAAe,SAAS,IAAI;AAMnC,SAAS,iBAAkB,QAAQ;AACjC,SACE,WACE;AAAA;AAAA,IAAmC;AAAA,EAAM,KACzC;AAAA;AAAA,IAAkC,OAAO;EAAa,MAExD;AACJ;AAEA,IAAA,UAAiB;AAAA,EAEf;AAAA,EAEA;AACF;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"schemes.js","sources":["../../../../../../../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js"],"sourcesContent":["'use strict'\n\nconst { isUUID } = require('./utils')\nconst URN_REG = /([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)/iu\n\nconst supportedSchemeNames = /** @type {const} */ (['http', 'https', 'ws',\n 'wss', 'urn', 'urn:uuid'])\n\n/** @typedef {supportedSchemeNames[number]} SchemeName */\n\n/**\n * @param {string} name\n * @returns {name is SchemeName}\n */\nfunction isValidSchemeName (name) {\n return supportedSchemeNames.indexOf(/** @type {*} */ (name)) !== -1\n}\n\n/**\n * @callback SchemeFn\n * @param {import('../types/index').URIComponent} component\n * @param {import('../types/index').Options} options\n * @returns {import('../types/index').URIComponent}\n */\n\n/**\n * @typedef {Object} SchemeHandler\n * @property {SchemeName} scheme - The scheme name.\n * @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.\n * @property {SchemeFn} parse - Function to parse the URI component for this scheme.\n * @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.\n * @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.\n * @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.\n * @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.\n */\n\n/**\n * @param {import('../types/index').URIComponent} wsComponent\n * @returns {boolean}\n */\nfunction wsIsSecure (wsComponent) {\n if (wsComponent.secure === true) {\n return true\n } else if (wsComponent.secure === false) {\n return false\n } else if (wsComponent.scheme) {\n return (\n wsComponent.scheme.length === 3 &&\n (wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') &&\n (wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') &&\n (wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S')\n )\n } else {\n return false\n }\n}\n\n/** @type {SchemeFn} */\nfunction httpParse (component) {\n if (!component.host) {\n component.error = component.error || 'HTTP URIs must have a host.'\n }\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction httpSerialize (component) {\n const secure = String(component.scheme).toLowerCase() === 'https'\n\n // normalize the default port\n if (component.port === (secure ? 443 : 80) || component.port === '') {\n component.port = undefined\n }\n\n // normalize the empty path\n if (!component.path) {\n component.path = '/'\n }\n\n // NOTE: We do not parse query strings for HTTP URIs\n // as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n // and not the HTTP spec.\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction wsParse (wsComponent) {\n// indicate if the secure flag is set\n wsComponent.secure = wsIsSecure(wsComponent)\n\n // construct resouce name\n wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : '')\n wsComponent.path = undefined\n wsComponent.query = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction wsSerialize (wsComponent) {\n// normalize the default port\n if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') {\n wsComponent.port = undefined\n }\n\n // ensure scheme matches secure flag\n if (typeof wsComponent.secure === 'boolean') {\n wsComponent.scheme = (wsComponent.secure ? 'wss' : 'ws')\n wsComponent.secure = undefined\n }\n\n // reconstruct path from resource name\n if (wsComponent.resourceName) {\n const [path, query] = wsComponent.resourceName.split('?')\n wsComponent.path = (path && path !== '/' ? path : undefined)\n wsComponent.query = query\n wsComponent.resourceName = undefined\n }\n\n // forbid fragment component\n wsComponent.fragment = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnParse (urnComponent, options) {\n if (!urnComponent.path) {\n urnComponent.error = 'URN can not be parsed'\n return urnComponent\n }\n const matches = urnComponent.path.match(URN_REG)\n if (matches) {\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n urnComponent.nid = matches[1].toLowerCase()\n urnComponent.nss = matches[2]\n const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n urnComponent.path = undefined\n\n if (schemeHandler) {\n urnComponent = schemeHandler.parse(urnComponent, options)\n }\n } else {\n urnComponent.error = urnComponent.error || 'URN can not be parsed.'\n }\n\n return urnComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnSerialize (urnComponent, options) {\n if (urnComponent.nid === undefined) {\n throw new Error('URN without nid cannot be serialized')\n }\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n const nid = urnComponent.nid.toLowerCase()\n const urnScheme = `${scheme}:${options.nid || nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n\n if (schemeHandler) {\n urnComponent = schemeHandler.serialize(urnComponent, options)\n }\n\n const uriComponent = urnComponent\n const nss = urnComponent.nss\n uriComponent.path = `${nid || options.nid}:${nss}`\n\n options.skipEscape = true\n return uriComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidParse (urnComponent, options) {\n const uuidComponent = urnComponent\n uuidComponent.uuid = uuidComponent.nss\n uuidComponent.nss = undefined\n\n if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {\n uuidComponent.error = uuidComponent.error || 'UUID is not valid.'\n }\n\n return uuidComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidSerialize (uuidComponent) {\n const urnComponent = uuidComponent\n // normalize UUID\n urnComponent.nss = (uuidComponent.uuid || '').toLowerCase()\n return urnComponent\n}\n\nconst http = /** @type {SchemeHandler} */ ({\n scheme: 'http',\n domainHost: true,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst https = /** @type {SchemeHandler} */ ({\n scheme: 'https',\n domainHost: http.domainHost,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst ws = /** @type {SchemeHandler} */ ({\n scheme: 'ws',\n domainHost: true,\n parse: wsParse,\n serialize: wsSerialize\n})\n\nconst wss = /** @type {SchemeHandler} */ ({\n scheme: 'wss',\n domainHost: ws.domainHost,\n parse: ws.parse,\n serialize: ws.serialize\n})\n\nconst urn = /** @type {SchemeHandler} */ ({\n scheme: 'urn',\n parse: urnParse,\n serialize: urnSerialize,\n skipNormalize: true\n})\n\nconst urnuuid = /** @type {SchemeHandler} */ ({\n scheme: 'urn:uuid',\n parse: urnuuidParse,\n serialize: urnuuidSerialize,\n skipNormalize: true\n})\n\nconst SCHEMES = /** @type {Record<SchemeName, SchemeHandler>} */ ({\n http,\n https,\n ws,\n wss,\n urn,\n 'urn:uuid': urnuuid\n})\n\nObject.setPrototypeOf(SCHEMES, null)\n\n/**\n * @param {string|undefined} scheme\n * @returns {SchemeHandler|undefined}\n */\nfunction getSchemeHandler (scheme) {\n return (\n scheme && (\n SCHEMES[/** @type {SchemeName} */ (scheme)] ||\n SCHEMES[/** @type {SchemeName} */(scheme.toLowerCase())])\n ) ||\n undefined\n}\n\nmodule.exports = {\n wsIsSecure,\n SCHEMES,\n isValidSchemeName,\n getSchemeHandler,\n}\n"],"names":["require$$0"],"mappings":";;;;;;;;;;;;;;AAEA,QAAM,EAAE,OAAM,IAAKA,aAAA;AACnB,QAAM,UAAU;AAEhB,QAAM;AAAA;AAAA,IAA6C;AAAA,MAAC;AAAA,MAAQ;AAAA,MAAS;AAAA,MACnE;AAAA,MAAO;AAAA,MAAO;AAAA,IAAU;AAAA;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