@atxp/client 0.10.3 → 0.10.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/additionalItems.js +4 -0
- package/dist/_virtual/additionalItems.js.map +1 -0
- package/dist/_virtual/additionalItems2.js +4 -0
- package/dist/_virtual/additionalItems2.js.map +1 -0
- package/dist/_virtual/additionalProperties.js +4 -0
- package/dist/_virtual/additionalProperties.js.map +1 -0
- package/dist/_virtual/additionalProperties2.js +4 -0
- package/dist/_virtual/additionalProperties2.js.map +1 -0
- package/dist/_virtual/ajv.js +1 -1
- package/dist/_virtual/ajv2.js +4 -0
- package/dist/_virtual/ajv2.js.map +1 -0
- package/dist/_virtual/ajv3.js +4 -0
- package/dist/_virtual/ajv3.js.map +1 -0
- package/dist/_virtual/allOf.js +4 -0
- package/dist/_virtual/allOf.js.map +1 -0
- package/dist/_virtual/allOf2.js +4 -0
- package/dist/_virtual/allOf2.js.map +1 -0
- package/dist/_virtual/anyOf.js +4 -0
- package/dist/_virtual/anyOf.js.map +1 -0
- package/dist/_virtual/anyOf2.js +4 -0
- package/dist/_virtual/anyOf2.js.map +1 -0
- package/dist/_virtual/applicability.js +4 -0
- package/dist/_virtual/applicability.js.map +1 -0
- package/dist/_virtual/applicability2.js +4 -0
- package/dist/_virtual/applicability2.js.map +1 -0
- package/dist/_virtual/boolSchema.js +4 -0
- package/dist/_virtual/boolSchema.js.map +1 -0
- package/dist/_virtual/boolSchema2.js +4 -0
- package/dist/_virtual/boolSchema2.js.map +1 -0
- package/dist/_virtual/code.js +4 -0
- package/dist/_virtual/code.js.map +1 -0
- package/dist/_virtual/code2.js +4 -0
- package/dist/_virtual/code2.js.map +1 -0
- package/dist/_virtual/code3.js +4 -0
- package/dist/_virtual/code3.js.map +1 -0
- package/dist/_virtual/code4.js +4 -0
- package/dist/_virtual/code4.js.map +1 -0
- package/dist/_virtual/const.js +4 -0
- package/dist/_virtual/const.js.map +1 -0
- package/dist/_virtual/const2.js +4 -0
- package/dist/_virtual/const2.js.map +1 -0
- package/dist/_virtual/contains.js +4 -0
- package/dist/_virtual/contains.js.map +1 -0
- package/dist/_virtual/contains2.js +4 -0
- package/dist/_virtual/contains2.js.map +1 -0
- package/dist/_virtual/core.js +4 -0
- package/dist/_virtual/core.js.map +1 -0
- package/dist/_virtual/core2.js +4 -0
- package/dist/_virtual/core2.js.map +1 -0
- package/dist/_virtual/dataType.js +4 -0
- package/dist/_virtual/dataType.js.map +1 -0
- package/dist/_virtual/dataType2.js +4 -0
- package/dist/_virtual/dataType2.js.map +1 -0
- package/dist/_virtual/defaults.js +4 -0
- package/dist/_virtual/defaults.js.map +1 -0
- package/dist/_virtual/defaults2.js +4 -0
- package/dist/_virtual/defaults2.js.map +1 -0
- package/dist/_virtual/dependencies.js +4 -0
- package/dist/_virtual/dependencies.js.map +1 -0
- package/dist/_virtual/dependencies2.js +4 -0
- package/dist/_virtual/dependencies2.js.map +1 -0
- package/dist/_virtual/draft7.js +4 -0
- package/dist/_virtual/draft7.js.map +1 -0
- package/dist/_virtual/draft72.js +4 -0
- package/dist/_virtual/draft72.js.map +1 -0
- package/dist/_virtual/enum.js +4 -0
- package/dist/_virtual/enum.js.map +1 -0
- package/dist/_virtual/enum2.js +4 -0
- package/dist/_virtual/enum2.js.map +1 -0
- package/dist/_virtual/equal.js +4 -0
- package/dist/_virtual/equal.js.map +1 -0
- package/dist/_virtual/equal2.js +4 -0
- package/dist/_virtual/equal2.js.map +1 -0
- package/dist/_virtual/errors.js +4 -0
- package/dist/_virtual/errors.js.map +1 -0
- package/dist/_virtual/errors2.js +4 -0
- package/dist/_virtual/errors2.js.map +1 -0
- package/dist/_virtual/format.js +4 -0
- package/dist/_virtual/format.js.map +1 -0
- package/dist/_virtual/format2.js +4 -0
- package/dist/_virtual/format2.js.map +1 -0
- package/dist/_virtual/formats.js +4 -0
- package/dist/_virtual/formats.js.map +1 -0
- package/dist/_virtual/id.js +4 -0
- package/dist/_virtual/id.js.map +1 -0
- package/dist/_virtual/id2.js +4 -0
- package/dist/_virtual/id2.js.map +1 -0
- package/dist/_virtual/if.js +4 -0
- package/dist/_virtual/if.js.map +1 -0
- package/dist/_virtual/if2.js +4 -0
- package/dist/_virtual/if2.js.map +1 -0
- package/dist/_virtual/index.js +6 -2
- package/dist/_virtual/index.js.map +1 -1
- package/dist/_virtual/index10.js +4 -0
- package/dist/_virtual/index10.js.map +1 -0
- package/dist/_virtual/index11.js +4 -0
- package/dist/_virtual/index11.js.map +1 -0
- package/dist/_virtual/index12.js +4 -0
- package/dist/_virtual/index12.js.map +1 -0
- package/dist/_virtual/index13.js +4 -0
- package/dist/_virtual/index13.js.map +1 -0
- package/dist/_virtual/index14.js +4 -0
- package/dist/_virtual/index14.js.map +1 -0
- package/dist/_virtual/index15.js +4 -0
- package/dist/_virtual/index15.js.map +1 -0
- package/dist/_virtual/index16.js +4 -0
- package/dist/_virtual/index16.js.map +1 -0
- package/dist/_virtual/index17.js +4 -0
- package/dist/_virtual/index17.js.map +1 -0
- package/dist/_virtual/index18.js +4 -0
- package/dist/_virtual/index18.js.map +1 -0
- package/dist/_virtual/index19.js +4 -0
- package/dist/_virtual/index19.js.map +1 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/index20.js +4 -0
- package/dist/_virtual/index20.js.map +1 -0
- package/dist/_virtual/index21.js +4 -0
- package/dist/_virtual/index21.js.map +1 -0
- package/dist/_virtual/index3.js +4 -0
- package/dist/_virtual/index3.js.map +1 -0
- package/dist/_virtual/index4.js +4 -0
- package/dist/_virtual/index4.js.map +1 -0
- package/dist/_virtual/index5.js +4 -0
- package/dist/_virtual/index5.js.map +1 -0
- package/dist/_virtual/index6.js +4 -0
- package/dist/_virtual/index6.js.map +1 -0
- package/dist/_virtual/index7.js +4 -0
- package/dist/_virtual/index7.js.map +1 -0
- package/dist/_virtual/index8.js +4 -0
- package/dist/_virtual/index8.js.map +1 -0
- package/dist/_virtual/index9.js +4 -0
- package/dist/_virtual/index9.js.map +1 -0
- package/dist/_virtual/items.js +4 -0
- package/dist/_virtual/items.js.map +1 -0
- package/dist/_virtual/items2.js +4 -0
- package/dist/_virtual/items2.js.map +1 -0
- package/dist/_virtual/items2020.js +4 -0
- package/dist/_virtual/items2020.js.map +1 -0
- package/dist/_virtual/items20202.js +4 -0
- package/dist/_virtual/items20202.js.map +1 -0
- package/dist/_virtual/keyword.js +4 -0
- package/dist/_virtual/keyword.js.map +1 -0
- package/dist/_virtual/keyword2.js +4 -0
- package/dist/_virtual/keyword2.js.map +1 -0
- package/dist/_virtual/limit.js +4 -0
- package/dist/_virtual/limit.js.map +1 -0
- package/dist/_virtual/limitItems.js +4 -0
- package/dist/_virtual/limitItems.js.map +1 -0
- package/dist/_virtual/limitItems2.js +4 -0
- package/dist/_virtual/limitItems2.js.map +1 -0
- package/dist/_virtual/limitLength.js +4 -0
- package/dist/_virtual/limitLength.js.map +1 -0
- package/dist/_virtual/limitLength2.js +4 -0
- package/dist/_virtual/limitLength2.js.map +1 -0
- package/dist/_virtual/limitNumber.js +4 -0
- package/dist/_virtual/limitNumber.js.map +1 -0
- package/dist/_virtual/limitNumber2.js +4 -0
- package/dist/_virtual/limitNumber2.js.map +1 -0
- package/dist/_virtual/limitProperties.js +4 -0
- package/dist/_virtual/limitProperties.js.map +1 -0
- package/dist/_virtual/limitProperties2.js +4 -0
- package/dist/_virtual/limitProperties2.js.map +1 -0
- package/dist/_virtual/metadata.js +4 -0
- package/dist/_virtual/metadata.js.map +1 -0
- package/dist/_virtual/metadata2.js +4 -0
- package/dist/_virtual/metadata2.js.map +1 -0
- package/dist/_virtual/multipleOf.js +4 -0
- package/dist/_virtual/multipleOf.js.map +1 -0
- package/dist/_virtual/multipleOf2.js +4 -0
- package/dist/_virtual/multipleOf2.js.map +1 -0
- package/dist/_virtual/names.js +4 -0
- package/dist/_virtual/names.js.map +1 -0
- package/dist/_virtual/names2.js +4 -0
- package/dist/_virtual/names2.js.map +1 -0
- package/dist/_virtual/not.js +4 -0
- package/dist/_virtual/not.js.map +1 -0
- package/dist/_virtual/not2.js +4 -0
- package/dist/_virtual/not2.js.map +1 -0
- package/dist/_virtual/oneOf.js +4 -0
- package/dist/_virtual/oneOf.js.map +1 -0
- package/dist/_virtual/oneOf2.js +4 -0
- package/dist/_virtual/oneOf2.js.map +1 -0
- package/dist/_virtual/pattern.js +4 -0
- package/dist/_virtual/pattern.js.map +1 -0
- package/dist/_virtual/pattern2.js +4 -0
- package/dist/_virtual/pattern2.js.map +1 -0
- package/dist/_virtual/patternProperties.js +4 -0
- package/dist/_virtual/patternProperties.js.map +1 -0
- package/dist/_virtual/patternProperties2.js +4 -0
- package/dist/_virtual/patternProperties2.js.map +1 -0
- package/dist/_virtual/prefixItems.js +4 -0
- package/dist/_virtual/prefixItems.js.map +1 -0
- package/dist/_virtual/prefixItems2.js +4 -0
- package/dist/_virtual/prefixItems2.js.map +1 -0
- package/dist/_virtual/properties.js +4 -0
- package/dist/_virtual/properties.js.map +1 -0
- package/dist/_virtual/properties2.js +4 -0
- package/dist/_virtual/properties2.js.map +1 -0
- package/dist/_virtual/propertyNames.js +4 -0
- package/dist/_virtual/propertyNames.js.map +1 -0
- package/dist/_virtual/propertyNames2.js +4 -0
- package/dist/_virtual/propertyNames2.js.map +1 -0
- package/dist/_virtual/ref.js +4 -0
- package/dist/_virtual/ref.js.map +1 -0
- package/dist/_virtual/ref2.js +4 -0
- package/dist/_virtual/ref2.js.map +1 -0
- package/dist/_virtual/ref_error.js +4 -0
- package/dist/_virtual/ref_error.js.map +1 -0
- package/dist/_virtual/ref_error2.js +4 -0
- package/dist/_virtual/ref_error2.js.map +1 -0
- package/dist/_virtual/required.js +4 -0
- package/dist/_virtual/required.js.map +1 -0
- package/dist/_virtual/required2.js +4 -0
- package/dist/_virtual/required2.js.map +1 -0
- package/dist/_virtual/resolve.js +4 -0
- package/dist/_virtual/resolve.js.map +1 -0
- package/dist/_virtual/resolve2.js +4 -0
- package/dist/_virtual/resolve2.js.map +1 -0
- package/dist/_virtual/rules.js +4 -0
- package/dist/_virtual/rules.js.map +1 -0
- package/dist/_virtual/rules2.js +4 -0
- package/dist/_virtual/rules2.js.map +1 -0
- package/dist/_virtual/scope.js +4 -0
- package/dist/_virtual/scope.js.map +1 -0
- package/dist/_virtual/scope2.js +4 -0
- package/dist/_virtual/scope2.js.map +1 -0
- package/dist/_virtual/subschema.js +4 -0
- package/dist/_virtual/subschema.js.map +1 -0
- package/dist/_virtual/subschema2.js +4 -0
- package/dist/_virtual/subschema2.js.map +1 -0
- package/dist/_virtual/thenElse.js +4 -0
- package/dist/_virtual/thenElse.js.map +1 -0
- package/dist/_virtual/thenElse2.js +4 -0
- package/dist/_virtual/thenElse2.js.map +1 -0
- package/dist/_virtual/types.js +4 -0
- package/dist/_virtual/types.js.map +1 -0
- package/dist/_virtual/types2.js +4 -0
- package/dist/_virtual/types2.js.map +1 -0
- package/dist/_virtual/ucs2length.js +4 -0
- package/dist/_virtual/ucs2length.js.map +1 -0
- package/dist/_virtual/ucs2length2.js +4 -0
- package/dist/_virtual/ucs2length2.js.map +1 -0
- package/dist/_virtual/uniqueItems.js +4 -0
- package/dist/_virtual/uniqueItems.js.map +1 -0
- package/dist/_virtual/uniqueItems2.js +4 -0
- package/dist/_virtual/uniqueItems2.js.map +1 -0
- package/dist/_virtual/uri.js +4 -0
- package/dist/_virtual/uri.js.map +1 -0
- package/dist/_virtual/uri2.js +4 -0
- package/dist/_virtual/uri2.js.map +1 -0
- package/dist/_virtual/util.js +4 -0
- package/dist/_virtual/util.js.map +1 -0
- package/dist/_virtual/util2.js +4 -0
- package/dist/_virtual/util2.js.map +1 -0
- package/dist/_virtual/validation_error.js +4 -0
- package/dist/_virtual/validation_error.js.map +1 -0
- package/dist/_virtual/validation_error2.js +4 -0
- package/dist/_virtual/validation_error2.js.map +1 -0
- package/dist/atxpFetcher.d.ts.map +1 -1
- package/dist/atxpFetcher.js +19 -3
- package/dist/atxpFetcher.js.map +1 -1
- package/dist/index.cjs +20003 -11644
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +20003 -11644
- package/dist/index.js.map +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js +277 -202
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js.map +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +399 -65
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js +195 -93
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js.map +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js +187 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js +60 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js +18 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js +25 -17
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js.map +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +85 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +30 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js +3 -3
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js.map +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js +129 -123
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js.map +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +785 -114
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js +41 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1207 -513
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +90 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js +71 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js +169 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js +712 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js +157 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js +139 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js +259 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js +40 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js +24 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js +169 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js +37 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js +191 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js +30 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js +64 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js +219 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js +48 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js +541 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js +139 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js +94 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js +642 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js.map +1 -0
- package/dist/node_modules/{ajv/lib → @modelcontextprotocol/sdk/node_modules/ajv/dist}/refs/data.json.js +3 -5
- package/dist/node_modules/{ajv/lib → @modelcontextprotocol/sdk/node_modules/ajv/dist}/refs/data.json.js.map +1 -1
- package/dist/node_modules/{ajv/lib → @modelcontextprotocol/sdk/node_modules/ajv/dist}/refs/json-schema-draft-07.json.js +2 -2
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js +19 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js +35 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js +18 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js +22 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +62 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +121 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js +35 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +24 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js +108 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +101 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js +79 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js +71 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js +66 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js +45 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js +38 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +73 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +89 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +24 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js +69 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +51 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +25 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js +145 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js +21 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js +29 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js +139 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js +120 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js +20 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js +33 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js +104 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js +18 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js +29 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js +39 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js +62 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js +54 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js +36 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js +41 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +39 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +36 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +38 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js +37 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js +93 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +79 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js +104 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/formats.js +221 -0
- package/dist/node_modules/ajv-formats/dist/formats.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/index.js +53 -0
- package/dist/node_modules/ajv-formats/dist/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/limit.js +84 -0
- package/dist/node_modules/ajv-formats/dist/limit.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.js +71 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js +169 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.js +712 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.js +157 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.js +139 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js +259 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/names.js +40 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.js +24 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js +169 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/rules.js +37 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.js +191 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/applicability.js +30 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/boolSchema.js +64 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.js +219 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/defaults.js +48 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.js +541 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/keyword.js +139 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.js +94 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.js +642 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/data.json.js +31 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/data.json.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +254 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/equal.js +19 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/ucs2length.js +35 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js +18 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/validation_error.js +22 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +62 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +121 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/allOf.js +35 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +24 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.js +108 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +101 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.js +79 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.js +71 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items.js +66 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items2020.js +45 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.js +38 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +73 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +89 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +24 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/properties.js +69 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +51 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +25 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/code.js +145 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/id.js +21 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/index.js +29 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.js +139 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js +120 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.js +20 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/draft7.js +33 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.js +104 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/index.js +18 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/metadata.js +29 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.js +39 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.js +62 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.js +54 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitItems.js +36 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitLength.js +41 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +39 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +36 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +38 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/pattern.js +37 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.js +93 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +79 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/dist/node_modules/{json-schema-traverse → ajv-formats/node_modules/json-schema-traverse}/index.js +6 -2
- package/dist/node_modules/ajv-formats/node_modules/json-schema-traverse/index.js.map +1 -0
- package/dist/node_modules/fast-uri/index.js +353 -0
- package/dist/node_modules/fast-uri/index.js.map +1 -0
- package/dist/node_modules/fast-uri/lib/schemes.js +279 -0
- package/dist/node_modules/fast-uri/lib/schemes.js.map +1 -0
- package/dist/node_modules/fast-uri/lib/utils.js +345 -0
- package/dist/node_modules/fast-uri/lib/utils.js.map +1 -0
- package/dist/node_modules/pkce-challenge/dist/index.browser.js +8 -5
- package/dist/node_modules/pkce-challenge/dist/index.browser.js.map +1 -1
- package/dist/node_modules/zod/v4/classic/coerce.js +9 -0
- package/dist/node_modules/zod/v4/classic/coerce.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/compat.js +8 -0
- package/dist/node_modules/zod/v4/classic/compat.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/errors.js +44 -0
- package/dist/node_modules/zod/v4/classic/errors.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/iso.js +36 -0
- package/dist/node_modules/zod/v4/classic/iso.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/parse.js +10 -0
- package/dist/node_modules/zod/v4/classic/parse.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/schemas.js +674 -0
- package/dist/node_modules/zod/v4/classic/schemas.js.map +1 -0
- package/dist/node_modules/zod/v4/core/api.js +468 -0
- package/dist/node_modules/zod/v4/core/api.js.map +1 -0
- package/dist/node_modules/zod/v4/core/checks.js +413 -0
- package/dist/node_modules/zod/v4/core/checks.js.map +1 -0
- package/dist/node_modules/zod/v4/core/core.js +60 -0
- package/dist/node_modules/zod/v4/core/core.js.map +1 -0
- package/dist/node_modules/zod/v4/core/doc.js +38 -0
- package/dist/node_modules/zod/v4/core/doc.js.map +1 -0
- package/dist/node_modules/zod/v4/core/errors.js +86 -0
- package/dist/node_modules/zod/v4/core/errors.js.map +1 -0
- package/dist/node_modules/zod/v4/core/parse.js +59 -0
- package/dist/node_modules/zod/v4/core/parse.js.map +1 -0
- package/dist/node_modules/zod/v4/core/regexes.js +81 -0
- package/dist/node_modules/zod/v4/core/regexes.js.map +1 -0
- package/dist/node_modules/zod/v4/core/registries.js +52 -0
- package/dist/node_modules/zod/v4/core/registries.js.map +1 -0
- package/dist/node_modules/zod/v4/core/schemas.js +1328 -0
- package/dist/node_modules/zod/v4/core/schemas.js.map +1 -0
- package/dist/node_modules/zod/v4/core/util.js +335 -0
- package/dist/node_modules/zod/v4/core/util.js.map +1 -0
- package/dist/node_modules/zod/v4/core/versions.js +8 -0
- package/dist/node_modules/zod/v4/core/versions.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +2 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
- package/dist/oAuth.d.ts +3 -1
- package/dist/oAuth.d.ts.map +1 -1
- package/dist/oAuth.js +7 -1
- package/dist/oAuth.js.map +1 -1
- package/package.json +9 -9
- package/dist/_virtual/cache.js +0 -4
- package/dist/_virtual/cache.js.map +0 -1
- package/dist/_virtual/uri.all.js +0 -4
- package/dist/_virtual/uri.all.js.map +0 -1
- package/dist/atxpClient.d.ts +0 -12
- package/dist/atxpLocalAccount.d.ts +0 -50
- package/dist/clientTestHelpers.d.ts +0 -6
- package/dist/destinationMakers/atxpDestinationMaker.d.ts +0 -15
- package/dist/destinationMakers/index.d.ts +0 -9
- package/dist/destinationMakers/passthroughDestinationMaker.d.ts +0 -8
- package/dist/errors.d.ts +0 -117
- package/dist/node_modules/ajv/lib/ajv.js +0 -531
- package/dist/node_modules/ajv/lib/ajv.js.map +0 -1
- package/dist/node_modules/ajv/lib/cache.js +0 -37
- package/dist/node_modules/ajv/lib/cache.js.map +0 -1
- package/dist/node_modules/ajv/lib/compile/async.js +0 -102
- package/dist/node_modules/ajv/lib/compile/async.js.map +0 -1
- package/dist/node_modules/ajv/lib/compile/error_classes.js +0 -46
- package/dist/node_modules/ajv/lib/compile/error_classes.js.map +0 -1
- package/dist/node_modules/ajv/lib/compile/formats.js +0 -154
- package/dist/node_modules/ajv/lib/compile/formats.js.map +0 -1
- package/dist/node_modules/ajv/lib/compile/index.js +0 -404
- package/dist/node_modules/ajv/lib/compile/index.js.map +0 -1
- package/dist/node_modules/ajv/lib/compile/resolve.js +0 -286
- package/dist/node_modules/ajv/lib/compile/resolve.js.map +0 -1
- package/dist/node_modules/ajv/lib/compile/rules.js +0 -79
- package/dist/node_modules/ajv/lib/compile/rules.js.map +0 -1
- package/dist/node_modules/ajv/lib/compile/schema_obj.js +0 -21
- package/dist/node_modules/ajv/lib/compile/schema_obj.js.map +0 -1
- package/dist/node_modules/ajv/lib/compile/ucs2length.js +0 -30
- package/dist/node_modules/ajv/lib/compile/ucs2length.js.map +0 -1
- package/dist/node_modules/ajv/lib/compile/util.js +0 -252
- package/dist/node_modules/ajv/lib/compile/util.js.map +0 -1
- package/dist/node_modules/ajv/lib/data.js +0 -59
- package/dist/node_modules/ajv/lib/data.js.map +0 -1
- package/dist/node_modules/ajv/lib/definition_schema.js +0 -49
- package/dist/node_modules/ajv/lib/definition_schema.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/_limit.js +0 -173
- package/dist/node_modules/ajv/lib/dotjs/_limit.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/_limitItems.js +0 -90
- package/dist/node_modules/ajv/lib/dotjs/_limitItems.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/_limitLength.js +0 -95
- package/dist/node_modules/ajv/lib/dotjs/_limitLength.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/_limitProperties.js +0 -90
- package/dist/node_modules/ajv/lib/dotjs/_limitProperties.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/allOf.js +0 -52
- package/dist/node_modules/ajv/lib/dotjs/allOf.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/anyOf.js +0 -83
- package/dist/node_modules/ajv/lib/dotjs/anyOf.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/comment.js +0 -24
- package/dist/node_modules/ajv/lib/dotjs/comment.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/const.js +0 -62
- package/dist/node_modules/ajv/lib/dotjs/const.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/contains.js +0 -91
- package/dist/node_modules/ajv/lib/dotjs/contains.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/custom.js +0 -238
- package/dist/node_modules/ajv/lib/dotjs/custom.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/dependencies.js +0 -178
- package/dist/node_modules/ajv/lib/dotjs/dependencies.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/enum.js +0 -72
- package/dist/node_modules/ajv/lib/dotjs/enum.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/format.js +0 -160
- package/dist/node_modules/ajv/lib/dotjs/format.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/if.js +0 -113
- package/dist/node_modules/ajv/lib/dotjs/if.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/index.js +0 -68
- package/dist/node_modules/ajv/lib/dotjs/index.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/items.js +0 -150
- package/dist/node_modules/ajv/lib/dotjs/items.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/multipleOf.js +0 -90
- package/dist/node_modules/ajv/lib/dotjs/multipleOf.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/not.js +0 -94
- package/dist/node_modules/ajv/lib/dotjs/not.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/oneOf.js +0 -83
- package/dist/node_modules/ajv/lib/dotjs/oneOf.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/pattern.js +0 -85
- package/dist/node_modules/ajv/lib/dotjs/pattern.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/properties.js +0 -345
- package/dist/node_modules/ajv/lib/dotjs/properties.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/propertyNames.js +0 -91
- package/dist/node_modules/ajv/lib/dotjs/propertyNames.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/ref.js +0 -134
- package/dist/node_modules/ajv/lib/dotjs/ref.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/required.js +0 -276
- package/dist/node_modules/ajv/lib/dotjs/required.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/uniqueItems.js +0 -96
- package/dist/node_modules/ajv/lib/dotjs/uniqueItems.js.map +0 -1
- package/dist/node_modules/ajv/lib/dotjs/validate.js +0 -492
- package/dist/node_modules/ajv/lib/dotjs/validate.js.map +0 -1
- package/dist/node_modules/ajv/lib/keyword.js +0 -159
- package/dist/node_modules/ajv/lib/keyword.js.map +0 -1
- package/dist/node_modules/fast-json-stable-stringify/index.js +0 -69
- package/dist/node_modules/fast-json-stable-stringify/index.js.map +0 -1
- package/dist/node_modules/json-schema-traverse/index.js.map +0 -1
- package/dist/node_modules/uri-js/dist/es5/uri.all.js +0 -1418
- package/dist/node_modules/uri-js/dist/es5/uri.all.js.map +0 -1
- package/dist/node_modules/zod/v3/ZodError.js +0 -133
- package/dist/node_modules/zod/v3/ZodError.js.map +0 -1
- package/dist/node_modules/zod/v3/errors.js +0 -9
- package/dist/node_modules/zod/v3/errors.js.map +0 -1
- package/dist/node_modules/zod/v3/helpers/errorUtil.js +0 -9
- package/dist/node_modules/zod/v3/helpers/errorUtil.js.map +0 -1
- package/dist/node_modules/zod/v3/helpers/parseUtil.js +0 -112
- package/dist/node_modules/zod/v3/helpers/parseUtil.js.map +0 -1
- package/dist/node_modules/zod/v3/helpers/util.js +0 -136
- package/dist/node_modules/zod/v3/helpers/util.js.map +0 -1
- package/dist/node_modules/zod/v3/locales/en.js +0 -112
- package/dist/node_modules/zod/v3/locales/en.js.map +0 -1
- package/dist/node_modules/zod/v3/types.js +0 -3491
- package/dist/node_modules/zod/v3/types.js.map +0 -1
- package/dist/polygonConstants.d.ts +0 -53
- package/dist/setup.expo.d.ts +0 -2
- package/dist/types.d.ts +0 -75
- package/dist/worldConstants.d.ts +0 -53
- /package/dist/node_modules/{ajv/lib → @modelcontextprotocol/sdk/node_modules/ajv/dist}/refs/json-schema-draft-07.json.js.map +0 -0
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import pkceChallenge from '../../../../../pkce-challenge/dist/index.browser.js';
|
|
2
2
|
import { LATEST_PROTOCOL_VERSION } from '../types.js';
|
|
3
|
-
import { OAuthProtectedResourceMetadataSchema, OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema, OAuthClientInformationFullSchema,
|
|
3
|
+
import { OAuthProtectedResourceMetadataSchema, OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema, OAuthClientInformationFullSchema, OAuthErrorResponseSchema, OAuthTokensSchema } from '../shared/auth.js';
|
|
4
4
|
import { resourceUrlFromServerUrl, checkResourceAllowed } from '../shared/auth-utils.js';
|
|
5
|
-
import { InvalidClientError, UnauthorizedClientError, InvalidGrantError, OAuthError, ServerError, OAUTH_ERRORS } from '../server/auth/errors.js';
|
|
5
|
+
import { InvalidClientError, UnauthorizedClientError, InvalidGrantError, InvalidClientMetadataError, OAuthError, ServerError, OAUTH_ERRORS } from '../server/auth/errors.js';
|
|
6
6
|
|
|
7
7
|
class UnauthorizedError extends Error {
|
|
8
8
|
constructor(message) {
|
|
9
|
-
super(message
|
|
9
|
+
super(message ?? 'Unauthorized');
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
function isClientAuthMethod(method) {
|
|
13
|
+
return ['client_secret_basic', 'client_secret_post', 'none'].includes(method);
|
|
14
|
+
}
|
|
15
|
+
const AUTHORIZATION_CODE_RESPONSE_TYPE = 'code';
|
|
16
|
+
const AUTHORIZATION_CODE_CHALLENGE_METHOD = 'S256';
|
|
12
17
|
/**
|
|
13
18
|
* Determines the best client authentication method to use based on server support and client configuration.
|
|
14
19
|
*
|
|
@@ -25,20 +30,27 @@ function selectClientAuthMethod(clientInformation, supportedMethods) {
|
|
|
25
30
|
const hasClientSecret = clientInformation.client_secret !== undefined;
|
|
26
31
|
// If server doesn't specify supported methods, use RFC 6749 defaults
|
|
27
32
|
if (supportedMethods.length === 0) {
|
|
28
|
-
return hasClientSecret ?
|
|
33
|
+
return hasClientSecret ? 'client_secret_post' : 'none';
|
|
34
|
+
}
|
|
35
|
+
// Prefer the method returned by the server during client registration if valid and supported
|
|
36
|
+
if ('token_endpoint_auth_method' in clientInformation &&
|
|
37
|
+
clientInformation.token_endpoint_auth_method &&
|
|
38
|
+
isClientAuthMethod(clientInformation.token_endpoint_auth_method) &&
|
|
39
|
+
supportedMethods.includes(clientInformation.token_endpoint_auth_method)) {
|
|
40
|
+
return clientInformation.token_endpoint_auth_method;
|
|
29
41
|
}
|
|
30
42
|
// Try methods in priority order (most secure first)
|
|
31
|
-
if (hasClientSecret && supportedMethods.includes(
|
|
32
|
-
return
|
|
43
|
+
if (hasClientSecret && supportedMethods.includes('client_secret_basic')) {
|
|
44
|
+
return 'client_secret_basic';
|
|
33
45
|
}
|
|
34
|
-
if (hasClientSecret && supportedMethods.includes(
|
|
35
|
-
return
|
|
46
|
+
if (hasClientSecret && supportedMethods.includes('client_secret_post')) {
|
|
47
|
+
return 'client_secret_post';
|
|
36
48
|
}
|
|
37
|
-
if (supportedMethods.includes(
|
|
38
|
-
return
|
|
49
|
+
if (supportedMethods.includes('none')) {
|
|
50
|
+
return 'none';
|
|
39
51
|
}
|
|
40
52
|
// Fallback: use what we have
|
|
41
|
-
return hasClientSecret ?
|
|
53
|
+
return hasClientSecret ? 'client_secret_post' : 'none';
|
|
42
54
|
}
|
|
43
55
|
/**
|
|
44
56
|
* Applies client authentication to the request based on the specified method.
|
|
@@ -57,13 +69,13 @@ function selectClientAuthMethod(clientInformation, supportedMethods) {
|
|
|
57
69
|
function applyClientAuthentication(method, clientInformation, headers, params) {
|
|
58
70
|
const { client_id, client_secret } = clientInformation;
|
|
59
71
|
switch (method) {
|
|
60
|
-
case
|
|
72
|
+
case 'client_secret_basic':
|
|
61
73
|
applyBasicAuth(client_id, client_secret, headers);
|
|
62
74
|
return;
|
|
63
|
-
case
|
|
75
|
+
case 'client_secret_post':
|
|
64
76
|
applyPostAuth(client_id, client_secret, params);
|
|
65
77
|
return;
|
|
66
|
-
case
|
|
78
|
+
case 'none':
|
|
67
79
|
applyPublicAuth(client_id, params);
|
|
68
80
|
return;
|
|
69
81
|
default:
|
|
@@ -75,25 +87,25 @@ function applyClientAuthentication(method, clientInformation, headers, params) {
|
|
|
75
87
|
*/
|
|
76
88
|
function applyBasicAuth(clientId, clientSecret, headers) {
|
|
77
89
|
if (!clientSecret) {
|
|
78
|
-
throw new Error(
|
|
90
|
+
throw new Error('client_secret_basic authentication requires a client_secret');
|
|
79
91
|
}
|
|
80
92
|
const credentials = btoa(`${clientId}:${clientSecret}`);
|
|
81
|
-
headers.set(
|
|
93
|
+
headers.set('Authorization', `Basic ${credentials}`);
|
|
82
94
|
}
|
|
83
95
|
/**
|
|
84
96
|
* Applies POST body authentication (RFC 6749 Section 2.3.1)
|
|
85
97
|
*/
|
|
86
98
|
function applyPostAuth(clientId, clientSecret, params) {
|
|
87
|
-
params.set(
|
|
99
|
+
params.set('client_id', clientId);
|
|
88
100
|
if (clientSecret) {
|
|
89
|
-
params.set(
|
|
101
|
+
params.set('client_secret', clientSecret);
|
|
90
102
|
}
|
|
91
103
|
}
|
|
92
104
|
/**
|
|
93
105
|
* Applies public client authentication (RFC 6749 Section 2.1)
|
|
94
106
|
*/
|
|
95
107
|
function applyPublicAuth(clientId, params) {
|
|
96
|
-
params.set(
|
|
108
|
+
params.set('client_id', clientId);
|
|
97
109
|
}
|
|
98
110
|
/**
|
|
99
111
|
* Parses an OAuth error response from a string or Response object.
|
|
@@ -128,25 +140,24 @@ async function parseErrorResponse(input) {
|
|
|
128
140
|
* instead of linking together the other lower-level functions in this module.
|
|
129
141
|
*/
|
|
130
142
|
async function auth(provider, options) {
|
|
131
|
-
var _a, _b;
|
|
132
143
|
try {
|
|
133
144
|
return await authInternal(provider, options);
|
|
134
145
|
}
|
|
135
146
|
catch (error) {
|
|
136
147
|
// Handle recoverable error types by invalidating credentials and retrying
|
|
137
148
|
if (error instanceof InvalidClientError || error instanceof UnauthorizedClientError) {
|
|
138
|
-
await
|
|
149
|
+
await provider.invalidateCredentials?.('all');
|
|
139
150
|
return await authInternal(provider, options);
|
|
140
151
|
}
|
|
141
152
|
else if (error instanceof InvalidGrantError) {
|
|
142
|
-
await
|
|
153
|
+
await provider.invalidateCredentials?.('tokens');
|
|
143
154
|
return await authInternal(provider, options);
|
|
144
155
|
}
|
|
145
156
|
// Throw otherwise
|
|
146
157
|
throw error;
|
|
147
158
|
}
|
|
148
159
|
}
|
|
149
|
-
async function authInternal(provider, { serverUrl, authorizationCode, scope, resourceMetadataUrl, fetchFn
|
|
160
|
+
async function authInternal(provider, { serverUrl, authorizationCode, scope, resourceMetadataUrl, fetchFn }) {
|
|
150
161
|
let resourceMetadata;
|
|
151
162
|
let authorizationServerUrl;
|
|
152
163
|
try {
|
|
@@ -155,56 +166,69 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope, res
|
|
|
155
166
|
authorizationServerUrl = resourceMetadata.authorization_servers[0];
|
|
156
167
|
}
|
|
157
168
|
}
|
|
158
|
-
catch
|
|
169
|
+
catch {
|
|
159
170
|
// Ignore errors and fall back to /.well-known/oauth-authorization-server
|
|
160
171
|
}
|
|
161
172
|
/**
|
|
162
173
|
* If we don't get a valid authorization server metadata from protected resource metadata,
|
|
163
|
-
* fallback to the legacy MCP spec's implementation (version 2025-03-26): MCP server acts as the Authorization server.
|
|
174
|
+
* fallback to the legacy MCP spec's implementation (version 2025-03-26): MCP server base URL acts as the Authorization server.
|
|
164
175
|
*/
|
|
165
176
|
if (!authorizationServerUrl) {
|
|
166
|
-
authorizationServerUrl = serverUrl;
|
|
177
|
+
authorizationServerUrl = new URL('/', serverUrl);
|
|
167
178
|
}
|
|
168
179
|
const resource = await selectResourceURL(serverUrl, provider, resourceMetadata);
|
|
169
180
|
const metadata = await discoverAuthorizationServerMetadata(authorizationServerUrl, {
|
|
170
|
-
fetchFn
|
|
181
|
+
fetchFn
|
|
171
182
|
});
|
|
172
183
|
// Handle client registration if needed
|
|
173
184
|
let clientInformation = await Promise.resolve(provider.clientInformation());
|
|
174
185
|
if (!clientInformation) {
|
|
175
186
|
if (authorizationCode !== undefined) {
|
|
176
|
-
throw new Error(
|
|
187
|
+
throw new Error('Existing OAuth client information is required when exchanging an authorization code');
|
|
177
188
|
}
|
|
178
|
-
|
|
179
|
-
|
|
189
|
+
const supportsUrlBasedClientId = metadata?.client_id_metadata_document_supported === true;
|
|
190
|
+
const clientMetadataUrl = provider.clientMetadataUrl;
|
|
191
|
+
if (clientMetadataUrl && !isHttpsUrl(clientMetadataUrl)) {
|
|
192
|
+
throw new InvalidClientMetadataError(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${clientMetadataUrl}`);
|
|
193
|
+
}
|
|
194
|
+
const shouldUseUrlBasedClientId = supportsUrlBasedClientId && clientMetadataUrl;
|
|
195
|
+
if (shouldUseUrlBasedClientId) {
|
|
196
|
+
// SEP-991: URL-based Client IDs
|
|
197
|
+
clientInformation = {
|
|
198
|
+
client_id: clientMetadataUrl
|
|
199
|
+
};
|
|
200
|
+
await provider.saveClientInformation?.(clientInformation);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
// Fallback to dynamic registration
|
|
204
|
+
if (!provider.saveClientInformation) {
|
|
205
|
+
throw new Error('OAuth client information must be saveable for dynamic registration');
|
|
206
|
+
}
|
|
207
|
+
const fullInformation = await registerClient(authorizationServerUrl, {
|
|
208
|
+
metadata,
|
|
209
|
+
clientMetadata: provider.clientMetadata,
|
|
210
|
+
fetchFn
|
|
211
|
+
});
|
|
212
|
+
await provider.saveClientInformation(fullInformation);
|
|
213
|
+
clientInformation = fullInformation;
|
|
180
214
|
}
|
|
181
|
-
const fullInformation = await registerClient(authorizationServerUrl, {
|
|
182
|
-
metadata,
|
|
183
|
-
clientMetadata: provider.clientMetadata,
|
|
184
|
-
fetchFn,
|
|
185
|
-
});
|
|
186
|
-
await provider.saveClientInformation(fullInformation);
|
|
187
|
-
clientInformation = fullInformation;
|
|
188
215
|
}
|
|
189
|
-
//
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
216
|
+
// Non-interactive flows (e.g., client_credentials, jwt-bearer) don't need a redirect URL
|
|
217
|
+
const nonInteractiveFlow = !provider.redirectUrl;
|
|
218
|
+
// Exchange authorization code for tokens, or fetch tokens directly for non-interactive flows
|
|
219
|
+
if (authorizationCode !== undefined || nonInteractiveFlow) {
|
|
220
|
+
const tokens = await fetchToken(provider, authorizationServerUrl, {
|
|
193
221
|
metadata,
|
|
194
|
-
clientInformation,
|
|
195
|
-
authorizationCode,
|
|
196
|
-
codeVerifier,
|
|
197
|
-
redirectUri: provider.redirectUrl,
|
|
198
222
|
resource,
|
|
199
|
-
|
|
200
|
-
fetchFn
|
|
223
|
+
authorizationCode,
|
|
224
|
+
fetchFn
|
|
201
225
|
});
|
|
202
226
|
await provider.saveTokens(tokens);
|
|
203
|
-
return
|
|
227
|
+
return 'AUTHORIZED';
|
|
204
228
|
}
|
|
205
229
|
const tokens = await provider.tokens();
|
|
206
230
|
// Handle token refresh or new authorization
|
|
207
|
-
if (tokens
|
|
231
|
+
if (tokens?.refresh_token) {
|
|
208
232
|
try {
|
|
209
233
|
// Attempt to refresh the token
|
|
210
234
|
const newTokens = await refreshAuthorization(authorizationServerUrl, {
|
|
@@ -213,10 +237,10 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope, res
|
|
|
213
237
|
refreshToken: tokens.refresh_token,
|
|
214
238
|
resource,
|
|
215
239
|
addClientAuthentication: provider.addClientAuthentication,
|
|
216
|
-
fetchFn
|
|
240
|
+
fetchFn
|
|
217
241
|
});
|
|
218
242
|
await provider.saveTokens(newTokens);
|
|
219
|
-
return
|
|
243
|
+
return 'AUTHORIZED';
|
|
220
244
|
}
|
|
221
245
|
catch (error) {
|
|
222
246
|
// If this is a ServerError, or an unknown type, log it out and try to continue. Otherwise, escalate so we can fix things and retry.
|
|
@@ -234,18 +258,33 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope, res
|
|
|
234
258
|
clientInformation,
|
|
235
259
|
state,
|
|
236
260
|
redirectUrl: provider.redirectUrl,
|
|
237
|
-
scope: scope || provider.clientMetadata.scope,
|
|
238
|
-
resource
|
|
261
|
+
scope: scope || resourceMetadata?.scopes_supported?.join(' ') || provider.clientMetadata.scope,
|
|
262
|
+
resource
|
|
239
263
|
});
|
|
240
264
|
await provider.saveCodeVerifier(codeVerifier);
|
|
241
265
|
await provider.redirectToAuthorization(authorizationUrl);
|
|
242
|
-
return
|
|
266
|
+
return 'REDIRECT';
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* SEP-991: URL-based Client IDs
|
|
270
|
+
* Validate that the client_id is a valid URL with https scheme
|
|
271
|
+
*/
|
|
272
|
+
function isHttpsUrl(value) {
|
|
273
|
+
if (!value)
|
|
274
|
+
return false;
|
|
275
|
+
try {
|
|
276
|
+
const url = new URL(value);
|
|
277
|
+
return url.protocol === 'https:' && url.pathname !== '/';
|
|
278
|
+
}
|
|
279
|
+
catch {
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
243
282
|
}
|
|
244
283
|
async function selectResourceURL(serverUrl, provider, resourceMetadata) {
|
|
245
284
|
const defaultResource = resourceUrlFromServerUrl(serverUrl);
|
|
246
285
|
// If provider has custom validation, delegate to it
|
|
247
286
|
if (provider.validateResourceURL) {
|
|
248
|
-
return await provider.validateResourceURL(defaultResource, resourceMetadata
|
|
287
|
+
return await provider.validateResourceURL(defaultResource, resourceMetadata?.resource);
|
|
249
288
|
}
|
|
250
289
|
// Only include resource parameter when Protected Resource Metadata is present
|
|
251
290
|
if (!resourceMetadata) {
|
|
@@ -259,28 +298,54 @@ async function selectResourceURL(serverUrl, provider, resourceMetadata) {
|
|
|
259
298
|
return new URL(resourceMetadata.resource);
|
|
260
299
|
}
|
|
261
300
|
/**
|
|
262
|
-
* Extract resource_metadata from
|
|
301
|
+
* Extract resource_metadata, scope, and error from WWW-Authenticate header.
|
|
263
302
|
*/
|
|
264
|
-
function
|
|
265
|
-
const authenticateHeader = res.headers.get(
|
|
303
|
+
function extractWWWAuthenticateParams(res) {
|
|
304
|
+
const authenticateHeader = res.headers.get('WWW-Authenticate');
|
|
266
305
|
if (!authenticateHeader) {
|
|
267
|
-
return
|
|
306
|
+
return {};
|
|
268
307
|
}
|
|
269
308
|
const [type, scheme] = authenticateHeader.split(' ');
|
|
270
309
|
if (type.toLowerCase() !== 'bearer' || !scheme) {
|
|
271
|
-
return
|
|
310
|
+
return {};
|
|
272
311
|
}
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
if (
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return undefined;
|
|
312
|
+
const resourceMetadataMatch = extractFieldFromWwwAuth(res, 'resource_metadata') || undefined;
|
|
313
|
+
let resourceMetadataUrl;
|
|
314
|
+
if (resourceMetadataMatch) {
|
|
315
|
+
try {
|
|
316
|
+
resourceMetadataUrl = new URL(resourceMetadataMatch);
|
|
317
|
+
}
|
|
318
|
+
catch {
|
|
319
|
+
// Ignore invalid URL
|
|
320
|
+
}
|
|
283
321
|
}
|
|
322
|
+
const scope = extractFieldFromWwwAuth(res, 'scope') || undefined;
|
|
323
|
+
const error = extractFieldFromWwwAuth(res, 'error') || undefined;
|
|
324
|
+
return {
|
|
325
|
+
resourceMetadataUrl,
|
|
326
|
+
scope,
|
|
327
|
+
error
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Extracts a specific field's value from the WWW-Authenticate header string.
|
|
332
|
+
*
|
|
333
|
+
* @param response The HTTP response object containing the headers.
|
|
334
|
+
* @param fieldName The name of the field to extract (e.g., "realm", "nonce").
|
|
335
|
+
* @returns The field value
|
|
336
|
+
*/
|
|
337
|
+
function extractFieldFromWwwAuth(response, fieldName) {
|
|
338
|
+
const wwwAuthHeader = response.headers.get('WWW-Authenticate');
|
|
339
|
+
if (!wwwAuthHeader) {
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
const pattern = new RegExp(`${fieldName}=(?:"([^"]+)"|([^\\s,]+))`);
|
|
343
|
+
const match = wwwAuthHeader.match(pattern);
|
|
344
|
+
if (match) {
|
|
345
|
+
// Pattern matches: field_name="value" or field_name=value (unquoted)
|
|
346
|
+
return match[1] || match[2];
|
|
347
|
+
}
|
|
348
|
+
return null;
|
|
284
349
|
}
|
|
285
350
|
/**
|
|
286
351
|
* Looks up RFC 9728 OAuth 2.0 Protected Resource Metadata.
|
|
@@ -290,13 +355,15 @@ function extractResourceMetadataUrl(res) {
|
|
|
290
355
|
*/
|
|
291
356
|
async function discoverOAuthProtectedResourceMetadata(serverUrl, opts, fetchFn = fetch) {
|
|
292
357
|
const response = await discoverMetadataWithFallback(serverUrl, 'oauth-protected-resource', fetchFn, {
|
|
293
|
-
protocolVersion: opts
|
|
294
|
-
metadataUrl: opts
|
|
358
|
+
protocolVersion: opts?.protocolVersion,
|
|
359
|
+
metadataUrl: opts?.resourceMetadataUrl
|
|
295
360
|
});
|
|
296
361
|
if (!response || response.status === 404) {
|
|
362
|
+
await response?.body?.cancel();
|
|
297
363
|
throw new Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);
|
|
298
364
|
}
|
|
299
365
|
if (!response.ok) {
|
|
366
|
+
await response.body?.cancel();
|
|
300
367
|
throw new Error(`HTTP ${response.status} trying to load well-known OAuth protected resource metadata.`);
|
|
301
368
|
}
|
|
302
369
|
return OAuthProtectedResourceMetadataSchema.parse(await response.json());
|
|
@@ -330,16 +397,14 @@ function buildWellKnownPath(wellKnownPrefix, pathname = '', options = {}) {
|
|
|
330
397
|
if (pathname.endsWith('/')) {
|
|
331
398
|
pathname = pathname.slice(0, -1);
|
|
332
399
|
}
|
|
333
|
-
return options.prependPathname
|
|
334
|
-
? `${pathname}/.well-known/${wellKnownPrefix}`
|
|
335
|
-
: `/.well-known/${wellKnownPrefix}${pathname}`;
|
|
400
|
+
return options.prependPathname ? `${pathname}/.well-known/${wellKnownPrefix}` : `/.well-known/${wellKnownPrefix}${pathname}`;
|
|
336
401
|
}
|
|
337
402
|
/**
|
|
338
403
|
* Tries to discover OAuth metadata at a specific URL
|
|
339
404
|
*/
|
|
340
405
|
async function tryMetadataDiscovery(url, protocolVersion, fetchFn = fetch) {
|
|
341
406
|
const headers = {
|
|
342
|
-
|
|
407
|
+
'MCP-Protocol-Version': protocolVersion
|
|
343
408
|
};
|
|
344
409
|
return await fetchWithCorsRetry(url, headers, fetchFn);
|
|
345
410
|
}
|
|
@@ -347,28 +412,27 @@ async function tryMetadataDiscovery(url, protocolVersion, fetchFn = fetch) {
|
|
|
347
412
|
* Determines if fallback to root discovery should be attempted
|
|
348
413
|
*/
|
|
349
414
|
function shouldAttemptFallback(response, pathname) {
|
|
350
|
-
return !response || (response.status >= 400 && response.status < 500
|
|
415
|
+
return !response || (response.status >= 400 && response.status < 500 && pathname !== '/');
|
|
351
416
|
}
|
|
352
417
|
/**
|
|
353
418
|
* Generic function for discovering OAuth metadata with fallback support
|
|
354
419
|
*/
|
|
355
420
|
async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, opts) {
|
|
356
|
-
var _a, _b;
|
|
357
421
|
const issuer = new URL(serverUrl);
|
|
358
|
-
const protocolVersion =
|
|
422
|
+
const protocolVersion = opts?.protocolVersion ?? LATEST_PROTOCOL_VERSION;
|
|
359
423
|
let url;
|
|
360
|
-
if (opts
|
|
424
|
+
if (opts?.metadataUrl) {
|
|
361
425
|
url = new URL(opts.metadataUrl);
|
|
362
426
|
}
|
|
363
427
|
else {
|
|
364
428
|
// Try path-aware discovery first
|
|
365
429
|
const wellKnownPath = buildWellKnownPath(wellKnownType, issuer.pathname);
|
|
366
|
-
url = new URL(wellKnownPath,
|
|
430
|
+
url = new URL(wellKnownPath, opts?.metadataServerUrl ?? issuer);
|
|
367
431
|
url.search = issuer.search;
|
|
368
432
|
}
|
|
369
433
|
let response = await tryMetadataDiscovery(url, protocolVersion, fetchFn);
|
|
370
434
|
// If path-aware discovery fails with 404 and we're not already at root, try fallback to root discovery
|
|
371
|
-
if (!
|
|
435
|
+
if (!opts?.metadataUrl && shouldAttemptFallback(response, issuer.pathname)) {
|
|
372
436
|
const rootUrl = new URL(`/.well-known/${wellKnownType}`, issuer);
|
|
373
437
|
response = await tryMetadataDiscovery(rootUrl, protocolVersion, fetchFn);
|
|
374
438
|
}
|
|
@@ -378,8 +442,7 @@ async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, o
|
|
|
378
442
|
* Builds a list of discovery URLs to try for authorization server metadata.
|
|
379
443
|
* URLs are returned in priority order:
|
|
380
444
|
* 1. OAuth metadata at the given URL
|
|
381
|
-
* 2.
|
|
382
|
-
* 3. OIDC metadata endpoints
|
|
445
|
+
* 2. OIDC metadata endpoints at the given URL
|
|
383
446
|
*/
|
|
384
447
|
function buildDiscoveryUrls(authorizationServerUrl) {
|
|
385
448
|
const url = typeof authorizationServerUrl === 'string' ? new URL(authorizationServerUrl) : authorizationServerUrl;
|
|
@@ -409,12 +472,7 @@ function buildDiscoveryUrls(authorizationServerUrl) {
|
|
|
409
472
|
url: new URL(`/.well-known/oauth-authorization-server${pathname}`, url.origin),
|
|
410
473
|
type: 'oauth'
|
|
411
474
|
});
|
|
412
|
-
//
|
|
413
|
-
urlsToTry.push({
|
|
414
|
-
url: new URL('/.well-known/oauth-authorization-server', url.origin),
|
|
415
|
-
type: 'oauth'
|
|
416
|
-
});
|
|
417
|
-
// 3. OIDC metadata endpoints
|
|
475
|
+
// 2. OIDC metadata endpoints
|
|
418
476
|
// RFC 8414 style: Insert /.well-known/openid-configuration before the path
|
|
419
477
|
urlsToTry.push({
|
|
420
478
|
url: new URL(`/.well-known/openid-configuration${pathname}`, url.origin),
|
|
@@ -443,9 +501,11 @@ function buildDiscoveryUrls(authorizationServerUrl) {
|
|
|
443
501
|
* @param options.protocolVersion - MCP protocol version to use, defaults to LATEST_PROTOCOL_VERSION
|
|
444
502
|
* @returns Promise resolving to authorization server metadata, or undefined if discovery fails
|
|
445
503
|
*/
|
|
446
|
-
async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn = fetch, protocolVersion = LATEST_PROTOCOL_VERSION
|
|
447
|
-
|
|
448
|
-
|
|
504
|
+
async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn = fetch, protocolVersion = LATEST_PROTOCOL_VERSION } = {}) {
|
|
505
|
+
const headers = {
|
|
506
|
+
'MCP-Protocol-Version': protocolVersion,
|
|
507
|
+
Accept: 'application/json'
|
|
508
|
+
};
|
|
449
509
|
// Get the list of URLs to try
|
|
450
510
|
const urlsToTry = buildDiscoveryUrls(authorizationServerUrl);
|
|
451
511
|
// Try each URL in order
|
|
@@ -459,6 +519,7 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fet
|
|
|
459
519
|
continue;
|
|
460
520
|
}
|
|
461
521
|
if (!response.ok) {
|
|
522
|
+
await response.body?.cancel();
|
|
462
523
|
// Continue looking for any 4xx response code.
|
|
463
524
|
if (response.status >= 400 && response.status < 500) {
|
|
464
525
|
continue; // Try next URL
|
|
@@ -470,12 +531,7 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fet
|
|
|
470
531
|
return OAuthMetadataSchema.parse(await response.json());
|
|
471
532
|
}
|
|
472
533
|
else {
|
|
473
|
-
|
|
474
|
-
// MCP spec requires OIDC providers to support S256 PKCE
|
|
475
|
-
if (!((_a = metadata.code_challenge_methods_supported) === null || _a === void 0 ? void 0 : _a.includes('S256'))) {
|
|
476
|
-
throw new Error(`Incompatible OIDC provider at ${endpointUrl}: does not support S256 code challenge method required by MCP specification`);
|
|
477
|
-
}
|
|
478
|
-
return metadata;
|
|
534
|
+
return OpenIdProviderDiscoveryMetadataSchema.parse(await response.json());
|
|
479
535
|
}
|
|
480
536
|
}
|
|
481
537
|
return undefined;
|
|
@@ -483,98 +539,91 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fet
|
|
|
483
539
|
/**
|
|
484
540
|
* Begins the authorization flow with the given server, by generating a PKCE challenge and constructing the authorization URL.
|
|
485
541
|
*/
|
|
486
|
-
async function startAuthorization(authorizationServerUrl, { metadata, clientInformation, redirectUrl, scope, state, resource
|
|
487
|
-
const responseType = "code";
|
|
488
|
-
const codeChallengeMethod = "S256";
|
|
542
|
+
async function startAuthorization(authorizationServerUrl, { metadata, clientInformation, redirectUrl, scope, state, resource }) {
|
|
489
543
|
let authorizationUrl;
|
|
490
544
|
if (metadata) {
|
|
491
545
|
authorizationUrl = new URL(metadata.authorization_endpoint);
|
|
492
|
-
if (!metadata.response_types_supported.includes(
|
|
493
|
-
throw new Error(`Incompatible auth server: does not support response type ${
|
|
546
|
+
if (!metadata.response_types_supported.includes(AUTHORIZATION_CODE_RESPONSE_TYPE)) {
|
|
547
|
+
throw new Error(`Incompatible auth server: does not support response type ${AUTHORIZATION_CODE_RESPONSE_TYPE}`);
|
|
494
548
|
}
|
|
495
|
-
if (
|
|
496
|
-
!metadata.code_challenge_methods_supported.includes(
|
|
497
|
-
throw new Error(`Incompatible auth server: does not support code challenge method ${
|
|
549
|
+
if (metadata.code_challenge_methods_supported &&
|
|
550
|
+
!metadata.code_challenge_methods_supported.includes(AUTHORIZATION_CODE_CHALLENGE_METHOD)) {
|
|
551
|
+
throw new Error(`Incompatible auth server: does not support code challenge method ${AUTHORIZATION_CODE_CHALLENGE_METHOD}`);
|
|
498
552
|
}
|
|
499
553
|
}
|
|
500
554
|
else {
|
|
501
|
-
authorizationUrl = new URL(
|
|
555
|
+
authorizationUrl = new URL('/authorize', authorizationServerUrl);
|
|
502
556
|
}
|
|
503
557
|
// Generate PKCE challenge
|
|
504
558
|
const challenge = await pkceChallenge();
|
|
505
559
|
const codeVerifier = challenge.code_verifier;
|
|
506
560
|
const codeChallenge = challenge.code_challenge;
|
|
507
|
-
authorizationUrl.searchParams.set(
|
|
508
|
-
authorizationUrl.searchParams.set(
|
|
509
|
-
authorizationUrl.searchParams.set(
|
|
510
|
-
authorizationUrl.searchParams.set(
|
|
511
|
-
authorizationUrl.searchParams.set(
|
|
561
|
+
authorizationUrl.searchParams.set('response_type', AUTHORIZATION_CODE_RESPONSE_TYPE);
|
|
562
|
+
authorizationUrl.searchParams.set('client_id', clientInformation.client_id);
|
|
563
|
+
authorizationUrl.searchParams.set('code_challenge', codeChallenge);
|
|
564
|
+
authorizationUrl.searchParams.set('code_challenge_method', AUTHORIZATION_CODE_CHALLENGE_METHOD);
|
|
565
|
+
authorizationUrl.searchParams.set('redirect_uri', String(redirectUrl));
|
|
512
566
|
if (state) {
|
|
513
|
-
authorizationUrl.searchParams.set(
|
|
567
|
+
authorizationUrl.searchParams.set('state', state);
|
|
514
568
|
}
|
|
515
569
|
if (scope) {
|
|
516
|
-
authorizationUrl.searchParams.set(
|
|
570
|
+
authorizationUrl.searchParams.set('scope', scope);
|
|
517
571
|
}
|
|
518
|
-
if (scope
|
|
572
|
+
if (scope?.includes('offline_access')) {
|
|
519
573
|
// if the request includes the OIDC-only "offline_access" scope,
|
|
520
574
|
// we need to set the prompt to "consent" to ensure the user is prompted to grant offline access
|
|
521
575
|
// https://openid.net/specs/openid-connect-core-1_0.html#OfflineAccess
|
|
522
|
-
authorizationUrl.searchParams.append(
|
|
576
|
+
authorizationUrl.searchParams.append('prompt', 'consent');
|
|
523
577
|
}
|
|
524
578
|
if (resource) {
|
|
525
|
-
authorizationUrl.searchParams.set(
|
|
579
|
+
authorizationUrl.searchParams.set('resource', resource.href);
|
|
526
580
|
}
|
|
527
581
|
return { authorizationUrl, codeVerifier };
|
|
528
582
|
}
|
|
529
583
|
/**
|
|
530
|
-
*
|
|
584
|
+
* Prepares token request parameters for an authorization code exchange.
|
|
531
585
|
*
|
|
532
|
-
*
|
|
533
|
-
*
|
|
534
|
-
* - Falls back to appropriate defaults when server metadata is unavailable
|
|
586
|
+
* This is the default implementation used by fetchToken when the provider
|
|
587
|
+
* doesn't implement prepareTokenRequest.
|
|
535
588
|
*
|
|
536
|
-
* @param
|
|
537
|
-
* @param
|
|
538
|
-
* @
|
|
539
|
-
* @
|
|
589
|
+
* @param authorizationCode - The authorization code received from the authorization endpoint
|
|
590
|
+
* @param codeVerifier - The PKCE code verifier
|
|
591
|
+
* @param redirectUri - The redirect URI used in the authorization request
|
|
592
|
+
* @returns URLSearchParams for the authorization_code grant
|
|
540
593
|
*/
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
const tokenUrl = (metadata === null || metadata === void 0 ? void 0 : metadata.token_endpoint)
|
|
545
|
-
? new URL(metadata.token_endpoint)
|
|
546
|
-
: new URL("/token", authorizationServerUrl);
|
|
547
|
-
if ((metadata === null || metadata === void 0 ? void 0 : metadata.grant_types_supported) &&
|
|
548
|
-
!metadata.grant_types_supported.includes(grantType)) {
|
|
549
|
-
throw new Error(`Incompatible auth server: does not support grant type ${grantType}`);
|
|
550
|
-
}
|
|
551
|
-
// Exchange code for tokens
|
|
552
|
-
const headers = new Headers({
|
|
553
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
554
|
-
"Accept": "application/json",
|
|
555
|
-
});
|
|
556
|
-
const params = new URLSearchParams({
|
|
557
|
-
grant_type: grantType,
|
|
594
|
+
function prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, redirectUri) {
|
|
595
|
+
return new URLSearchParams({
|
|
596
|
+
grant_type: 'authorization_code',
|
|
558
597
|
code: authorizationCode,
|
|
559
598
|
code_verifier: codeVerifier,
|
|
560
|
-
redirect_uri: String(redirectUri)
|
|
599
|
+
redirect_uri: String(redirectUri)
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Internal helper to execute a token request with the given parameters.
|
|
604
|
+
* Used by exchangeAuthorization, refreshAuthorization, and fetchToken.
|
|
605
|
+
*/
|
|
606
|
+
async function executeTokenRequest(authorizationServerUrl, { metadata, tokenRequestParams, clientInformation, addClientAuthentication, resource, fetchFn }) {
|
|
607
|
+
const tokenUrl = metadata?.token_endpoint ? new URL(metadata.token_endpoint) : new URL('/token', authorizationServerUrl);
|
|
608
|
+
const headers = new Headers({
|
|
609
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
610
|
+
Accept: 'application/json'
|
|
561
611
|
});
|
|
612
|
+
if (resource) {
|
|
613
|
+
tokenRequestParams.set('resource', resource.href);
|
|
614
|
+
}
|
|
562
615
|
if (addClientAuthentication) {
|
|
563
|
-
addClientAuthentication(headers,
|
|
616
|
+
await addClientAuthentication(headers, tokenRequestParams, tokenUrl, metadata);
|
|
564
617
|
}
|
|
565
|
-
else {
|
|
566
|
-
|
|
567
|
-
const supportedMethods = (_a = metadata === null || metadata === void 0 ? void 0 : metadata.token_endpoint_auth_methods_supported) !== null && _a !== void 0 ? _a : [];
|
|
618
|
+
else if (clientInformation) {
|
|
619
|
+
const supportedMethods = metadata?.token_endpoint_auth_methods_supported ?? [];
|
|
568
620
|
const authMethod = selectClientAuthMethod(clientInformation, supportedMethods);
|
|
569
|
-
applyClientAuthentication(authMethod, clientInformation, headers,
|
|
570
|
-
}
|
|
571
|
-
if (resource) {
|
|
572
|
-
params.set("resource", resource.href);
|
|
621
|
+
applyClientAuthentication(authMethod, clientInformation, headers, tokenRequestParams);
|
|
573
622
|
}
|
|
574
|
-
const response = await (fetchFn
|
|
575
|
-
method:
|
|
623
|
+
const response = await (fetchFn ?? fetch)(tokenUrl, {
|
|
624
|
+
method: 'POST',
|
|
576
625
|
headers,
|
|
577
|
-
body:
|
|
626
|
+
body: tokenRequestParams
|
|
578
627
|
});
|
|
579
628
|
if (!response.ok) {
|
|
580
629
|
throw await parseErrorResponse(response);
|
|
@@ -593,70 +642,96 @@ async function exchangeAuthorization(authorizationServerUrl, { metadata, clientI
|
|
|
593
642
|
* @returns Promise resolving to OAuth tokens (preserves original refresh_token if not replaced)
|
|
594
643
|
* @throws {Error} When token refresh fails or authentication is invalid
|
|
595
644
|
*/
|
|
596
|
-
async function refreshAuthorization(authorizationServerUrl, { metadata, clientInformation, refreshToken, resource, addClientAuthentication, fetchFn
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
if (metadata) {
|
|
601
|
-
tokenUrl = new URL(metadata.token_endpoint);
|
|
602
|
-
if (metadata.grant_types_supported &&
|
|
603
|
-
!metadata.grant_types_supported.includes(grantType)) {
|
|
604
|
-
throw new Error(`Incompatible auth server: does not support grant type ${grantType}`);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
else {
|
|
608
|
-
tokenUrl = new URL("/token", authorizationServerUrl);
|
|
609
|
-
}
|
|
610
|
-
// Exchange refresh token
|
|
611
|
-
const headers = new Headers({
|
|
612
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
645
|
+
async function refreshAuthorization(authorizationServerUrl, { metadata, clientInformation, refreshToken, resource, addClientAuthentication, fetchFn }) {
|
|
646
|
+
const tokenRequestParams = new URLSearchParams({
|
|
647
|
+
grant_type: 'refresh_token',
|
|
648
|
+
refresh_token: refreshToken
|
|
613
649
|
});
|
|
614
|
-
const
|
|
615
|
-
|
|
616
|
-
|
|
650
|
+
const tokens = await executeTokenRequest(authorizationServerUrl, {
|
|
651
|
+
metadata,
|
|
652
|
+
tokenRequestParams,
|
|
653
|
+
clientInformation,
|
|
654
|
+
addClientAuthentication,
|
|
655
|
+
resource,
|
|
656
|
+
fetchFn
|
|
617
657
|
});
|
|
618
|
-
if
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
658
|
+
// Preserve original refresh token if server didn't return a new one
|
|
659
|
+
return { refresh_token: refreshToken, ...tokens };
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Unified token fetching that works with any grant type via provider.prepareTokenRequest().
|
|
663
|
+
*
|
|
664
|
+
* This function provides a single entry point for obtaining tokens regardless of the
|
|
665
|
+
* OAuth grant type. The provider's prepareTokenRequest() method determines which grant
|
|
666
|
+
* to use and supplies the grant-specific parameters.
|
|
667
|
+
*
|
|
668
|
+
* @param provider - OAuth client provider that implements prepareTokenRequest()
|
|
669
|
+
* @param authorizationServerUrl - The authorization server's base URL
|
|
670
|
+
* @param options - Configuration for the token request
|
|
671
|
+
* @returns Promise resolving to OAuth tokens
|
|
672
|
+
* @throws {Error} When provider doesn't implement prepareTokenRequest or token fetch fails
|
|
673
|
+
*
|
|
674
|
+
* @example
|
|
675
|
+
* // Provider for client_credentials:
|
|
676
|
+
* class MyProvider implements OAuthClientProvider {
|
|
677
|
+
* prepareTokenRequest(scope) {
|
|
678
|
+
* const params = new URLSearchParams({ grant_type: 'client_credentials' });
|
|
679
|
+
* if (scope) params.set('scope', scope);
|
|
680
|
+
* return params;
|
|
681
|
+
* }
|
|
682
|
+
* // ... other methods
|
|
683
|
+
* }
|
|
684
|
+
*
|
|
685
|
+
* const tokens = await fetchToken(provider, authServerUrl, { metadata });
|
|
686
|
+
*/
|
|
687
|
+
async function fetchToken(provider, authorizationServerUrl, { metadata, resource, authorizationCode, fetchFn } = {}) {
|
|
688
|
+
const scope = provider.clientMetadata.scope;
|
|
689
|
+
// Use provider's prepareTokenRequest if available, otherwise fall back to authorization_code
|
|
690
|
+
let tokenRequestParams;
|
|
691
|
+
if (provider.prepareTokenRequest) {
|
|
692
|
+
tokenRequestParams = await provider.prepareTokenRequest(scope);
|
|
693
|
+
}
|
|
694
|
+
// Default to authorization_code grant if no custom prepareTokenRequest
|
|
695
|
+
if (!tokenRequestParams) {
|
|
696
|
+
if (!authorizationCode) {
|
|
697
|
+
throw new Error('Either provider.prepareTokenRequest() or authorizationCode is required');
|
|
698
|
+
}
|
|
699
|
+
if (!provider.redirectUrl) {
|
|
700
|
+
throw new Error('redirectUrl is required for authorization_code flow');
|
|
701
|
+
}
|
|
702
|
+
const codeVerifier = await provider.codeVerifier();
|
|
703
|
+
tokenRequestParams = prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, provider.redirectUrl);
|
|
629
704
|
}
|
|
630
|
-
const
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
705
|
+
const clientInformation = await provider.clientInformation();
|
|
706
|
+
return executeTokenRequest(authorizationServerUrl, {
|
|
707
|
+
metadata,
|
|
708
|
+
tokenRequestParams,
|
|
709
|
+
clientInformation: clientInformation ?? undefined,
|
|
710
|
+
addClientAuthentication: provider.addClientAuthentication,
|
|
711
|
+
resource,
|
|
712
|
+
fetchFn
|
|
634
713
|
});
|
|
635
|
-
if (!response.ok) {
|
|
636
|
-
throw await parseErrorResponse(response);
|
|
637
|
-
}
|
|
638
|
-
return OAuthTokensSchema.parse({ refresh_token: refreshToken, ...(await response.json()) });
|
|
639
714
|
}
|
|
640
715
|
/**
|
|
641
716
|
* Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591.
|
|
642
717
|
*/
|
|
643
|
-
async function registerClient(authorizationServerUrl, { metadata, clientMetadata, fetchFn
|
|
718
|
+
async function registerClient(authorizationServerUrl, { metadata, clientMetadata, fetchFn }) {
|
|
644
719
|
let registrationUrl;
|
|
645
720
|
if (metadata) {
|
|
646
721
|
if (!metadata.registration_endpoint) {
|
|
647
|
-
throw new Error(
|
|
722
|
+
throw new Error('Incompatible auth server: does not support dynamic client registration');
|
|
648
723
|
}
|
|
649
724
|
registrationUrl = new URL(metadata.registration_endpoint);
|
|
650
725
|
}
|
|
651
726
|
else {
|
|
652
|
-
registrationUrl = new URL(
|
|
727
|
+
registrationUrl = new URL('/register', authorizationServerUrl);
|
|
653
728
|
}
|
|
654
|
-
const response = await (fetchFn
|
|
655
|
-
method:
|
|
729
|
+
const response = await (fetchFn ?? fetch)(registrationUrl, {
|
|
730
|
+
method: 'POST',
|
|
656
731
|
headers: {
|
|
657
|
-
|
|
732
|
+
'Content-Type': 'application/json'
|
|
658
733
|
},
|
|
659
|
-
body: JSON.stringify(clientMetadata)
|
|
734
|
+
body: JSON.stringify(clientMetadata)
|
|
660
735
|
});
|
|
661
736
|
if (!response.ok) {
|
|
662
737
|
throw await parseErrorResponse(response);
|
|
@@ -664,5 +739,5 @@ async function registerClient(authorizationServerUrl, { metadata, clientMetadata
|
|
|
664
739
|
return OAuthClientInformationFullSchema.parse(await response.json());
|
|
665
740
|
}
|
|
666
741
|
|
|
667
|
-
export { UnauthorizedError, auth, buildDiscoveryUrls, discoverAuthorizationServerMetadata, discoverOAuthProtectedResourceMetadata,
|
|
742
|
+
export { UnauthorizedError, auth, buildDiscoveryUrls, discoverAuthorizationServerMetadata, discoverOAuthProtectedResourceMetadata, extractWWWAuthenticateParams, fetchToken, isHttpsUrl, parseErrorResponse, prepareAuthorizationCodeRequest, refreshAuthorization, registerClient, selectClientAuthMethod, selectResourceURL, startAuthorization };
|
|
668
743
|
//# sourceMappingURL=auth.js.map
|