@outfoxx/sunday 1.1.0-beta.6 → 1.1.0-beta.7
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 → build/esm}/any-type.d.ts +0 -0
- package/{dist → build/esm}/any-type.js +0 -0
- package/build/esm/any-type.js.map +1 -0
- package/{dist → build/esm}/class-type.d.ts +0 -0
- package/{dist → build/esm}/class-type.js +0 -0
- package/build/esm/class-type.js.map +1 -0
- package/{dist → build/esm}/date-time-types.d.ts +0 -0
- package/{dist → build/esm}/date-time-types.js +0 -0
- package/build/esm/date-time-types.js.map +1 -0
- package/{dist → build/esm}/event-parser.d.ts +0 -0
- package/{dist → build/esm}/event-parser.js +0 -0
- package/build/esm/event-parser.js.map +1 -0
- package/{dist → build/esm}/fetch-event-source.d.ts +0 -0
- package/{dist → build/esm}/fetch-event-source.js +0 -0
- package/build/esm/fetch-event-source.js.map +1 -0
- package/{dist → build/esm}/fetch-request-factory.d.ts +0 -0
- package/{dist → build/esm}/fetch-request-factory.js +17 -8
- package/build/esm/fetch-request-factory.js.map +1 -0
- package/{dist → build/esm}/fetch.d.ts +0 -0
- package/build/esm/fetch.js +103 -0
- package/build/esm/fetch.js.map +1 -0
- package/{dist → build/esm}/header-parameters.d.ts +0 -0
- package/{dist → build/esm}/header-parameters.js +0 -0
- package/build/esm/header-parameters.js.map +1 -0
- package/{dist → build/esm}/index.d.ts +0 -0
- package/{dist → build/esm}/index.js +0 -0
- package/build/esm/index.js.map +1 -0
- package/{dist → build/esm}/logger.d.ts +0 -0
- package/{dist → build/esm}/logger.js +0 -0
- package/build/esm/logger.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/any-text-decoder.d.ts +0 -0
- package/build/esm/media-type-codecs/any-text-decoder.js +40 -0
- package/build/esm/media-type-codecs/any-text-decoder.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/any-text-encoder.d.ts +0 -0
- package/{dist → build/esm}/media-type-codecs/any-text-encoder.js +0 -0
- package/build/esm/media-type-codecs/any-text-encoder.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/binary-decoder.d.ts +0 -0
- package/build/esm/media-type-codecs/binary-decoder.js +40 -0
- package/build/esm/media-type-codecs/binary-decoder.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/binary-encoder.d.ts +0 -0
- package/{dist → build/esm}/media-type-codecs/binary-encoder.js +0 -0
- package/build/esm/media-type-codecs/binary-encoder.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/cbor-decoder.d.ts +0 -0
- package/{dist → build/esm}/media-type-codecs/cbor-decoder.js +13 -2
- package/build/esm/media-type-codecs/cbor-decoder.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/cbor-encoder.d.ts +0 -0
- package/{dist → build/esm}/media-type-codecs/cbor-encoder.js +0 -0
- package/build/esm/media-type-codecs/cbor-encoder.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/cbor-tags.d.ts +0 -0
- package/{dist → build/esm}/media-type-codecs/cbor-tags.js +0 -0
- package/build/esm/media-type-codecs/cbor-tags.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/json-decoder.d.ts +0 -0
- package/{dist → build/esm}/media-type-codecs/json-decoder.js +13 -2
- package/build/esm/media-type-codecs/json-decoder.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/json-encoder.d.ts +0 -0
- package/{dist → build/esm}/media-type-codecs/json-encoder.js +0 -0
- package/build/esm/media-type-codecs/json-encoder.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/media-type-decoder.d.ts +0 -0
- package/{dist → build/esm}/media-type-codecs/media-type-decoder.js +0 -0
- package/build/esm/media-type-codecs/media-type-decoder.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/media-type-decoders.d.ts +0 -0
- package/{dist → build/esm}/media-type-codecs/media-type-decoders.js +0 -0
- package/build/esm/media-type-codecs/media-type-decoders.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/media-type-encoder.d.ts +0 -0
- package/{dist → build/esm}/media-type-codecs/media-type-encoder.js +0 -0
- package/build/esm/media-type-codecs/media-type-encoder.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/media-type-encoders.d.ts +0 -0
- package/{dist → build/esm}/media-type-codecs/media-type-encoders.js +0 -0
- package/build/esm/media-type-codecs/media-type-encoders.js.map +1 -0
- package/{dist → build/esm}/media-type-codecs/www-form-url-encoder.d.ts +0 -0
- package/{dist → build/esm}/media-type-codecs/www-form-url-encoder.js +0 -0
- package/build/esm/media-type-codecs/www-form-url-encoder.js.map +1 -0
- package/{dist → build/esm}/media-type.d.ts +0 -0
- package/{dist → build/esm}/media-type.js +0 -0
- package/build/esm/media-type.js.map +1 -0
- package/{dist → build/esm}/problem.d.ts +0 -0
- package/{dist → build/esm}/problem.js +30 -19
- package/build/esm/problem.js.map +1 -0
- package/{dist → build/esm}/request-factory.d.ts +0 -0
- package/{dist → build/esm}/request-factory.js +0 -0
- package/build/esm/request-factory.js.map +1 -0
- package/{dist → build/esm}/result-response.d.ts +0 -0
- package/{dist → build/esm}/result-response.js +0 -0
- package/build/esm/result-response.js.map +1 -0
- package/{dist → build/esm}/sunday-error.d.ts +0 -0
- package/build/esm/sunday-error.js +42 -0
- package/build/esm/sunday-error.js.map +1 -0
- package/{dist → build/esm}/url-template.d.ts +0 -0
- package/{dist → build/esm}/url-template.js +0 -0
- package/build/esm/url-template.js.map +1 -0
- package/{dist → build/esm}/util/any.d.ts +0 -0
- package/{dist → build/esm}/util/any.js +0 -0
- package/build/esm/util/any.js.map +1 -0
- package/{dist → build/esm}/util/base64.d.ts +0 -0
- package/{dist → build/esm}/util/base64.js +0 -0
- package/build/esm/util/base64.js.map +1 -0
- package/{dist → build/esm}/util/error.d.ts +0 -0
- package/{dist → build/esm}/util/error.js +0 -0
- package/build/esm/util/error.js.map +1 -0
- package/{dist → build/esm}/util/hex.d.ts +0 -0
- package/{dist → build/esm}/util/hex.js +0 -0
- package/build/esm/util/hex.js.map +1 -0
- package/{dist → build/esm}/util/rxjs.d.ts +0 -0
- package/{dist → build/esm}/util/rxjs.js +0 -0
- package/build/esm/util/rxjs.js.map +1 -0
- package/{dist → build/esm}/util/stream-rxjs.d.ts +0 -0
- package/build/esm/util/stream-rxjs.js +50 -0
- package/build/esm/util/stream-rxjs.js.map +1 -0
- package/{dist → build/esm}/util/temporal.d.ts +0 -0
- package/{dist → build/esm}/util/temporal.js +0 -0
- package/build/esm/util/temporal.js.map +1 -0
- package/build/esnext/any-type.d.ts +4 -0
- package/build/esnext/any-type.js +15 -0
- package/build/esnext/any-type.js.map +1 -0
- package/build/esnext/class-type.d.ts +2 -0
- package/build/esnext/class-type.js +15 -0
- package/build/esnext/class-type.js.map +1 -0
- package/build/esnext/date-time-types.d.ts +2 -0
- package/build/esnext/date-time-types.js +16 -0
- package/build/esnext/date-time-types.js.map +1 -0
- package/build/esnext/event-parser.d.ts +17 -0
- package/build/esnext/event-parser.js +153 -0
- package/build/esnext/event-parser.js.map +1 -0
- package/build/esnext/fetch-event-source.d.ts +58 -0
- package/build/esnext/fetch-event-source.js +290 -0
- package/build/esnext/fetch-event-source.js.map +1 -0
- package/build/esnext/fetch-request-factory.d.ts +34 -0
- package/build/esnext/fetch-request-factory.js +190 -0
- package/build/esnext/fetch-request-factory.js.map +1 -0
- package/build/esnext/fetch.d.ts +7 -0
- package/build/esnext/fetch.js +103 -0
- package/build/esnext/fetch.js.map +1 -0
- package/build/esnext/header-parameters.d.ts +3 -0
- package/build/esnext/header-parameters.js +53 -0
- package/build/esnext/header-parameters.js.map +1 -0
- package/build/esnext/index.d.ts +26 -0
- package/{src/index.ts → build/esnext/index.js} +1 -2
- package/build/esnext/index.js.map +1 -0
- package/build/esnext/logger.d.ts +8 -0
- package/build/esnext/logger.js +15 -0
- package/build/esnext/logger.js.map +1 -0
- package/build/esnext/media-type-codecs/any-text-decoder.d.ts +7 -0
- package/build/esnext/media-type-codecs/any-text-decoder.js +40 -0
- package/build/esnext/media-type-codecs/any-text-decoder.js.map +1 -0
- package/build/esnext/media-type-codecs/any-text-encoder.d.ts +5 -0
- package/build/esnext/media-type-codecs/any-text-encoder.js +23 -0
- package/build/esnext/media-type-codecs/any-text-encoder.js.map +1 -0
- package/build/esnext/media-type-codecs/binary-decoder.d.ts +6 -0
- package/build/esnext/media-type-codecs/binary-decoder.js +40 -0
- package/build/esnext/media-type-codecs/binary-decoder.js.map +1 -0
- package/build/esnext/media-type-codecs/binary-encoder.d.ts +5 -0
- package/build/esnext/media-type-codecs/binary-encoder.js +26 -0
- package/build/esnext/media-type-codecs/binary-encoder.js.map +1 -0
- package/build/esnext/media-type-codecs/cbor-decoder.d.ts +39 -0
- package/build/esnext/media-type-codecs/cbor-decoder.js +437 -0
- package/build/esnext/media-type-codecs/cbor-decoder.js.map +1 -0
- package/build/esnext/media-type-codecs/cbor-encoder.d.ts +43 -0
- package/build/esnext/media-type-codecs/cbor-encoder.js +236 -0
- package/build/esnext/media-type-codecs/cbor-encoder.js.map +1 -0
- package/build/esnext/media-type-codecs/cbor-tags.d.ts +4 -0
- package/{src/media-type-codecs/cbor-tags.ts → build/esnext/media-type-codecs/cbor-tags.js} +1 -1
- package/build/esnext/media-type-codecs/cbor-tags.js.map +1 -0
- package/build/esnext/media-type-codecs/json-decoder.d.ts +39 -0
- package/build/esnext/media-type-codecs/json-decoder.js +391 -0
- package/build/esnext/media-type-codecs/json-decoder.js.map +1 -0
- package/build/esnext/media-type-codecs/json-encoder.d.ts +44 -0
- package/build/esnext/media-type-codecs/json-encoder.js +273 -0
- package/build/esnext/media-type-codecs/json-encoder.js.map +1 -0
- package/build/esnext/media-type-codecs/media-type-decoder.d.ts +11 -0
- package/{src/result-response.ts → build/esnext/media-type-codecs/media-type-decoder.js} +5 -4
- package/build/esnext/media-type-codecs/media-type-decoder.js.map +1 -0
- package/build/esnext/media-type-codecs/media-type-decoders.d.ts +18 -0
- package/build/esnext/media-type-codecs/media-type-decoders.js +58 -0
- package/build/esnext/media-type-codecs/media-type-decoders.js.map +1 -0
- package/build/esnext/media-type-codecs/media-type-encoder.d.ts +12 -0
- package/{src/util/any.ts → build/esnext/media-type-codecs/media-type-encoder.js} +9 -9
- package/build/esnext/media-type-codecs/media-type-encoder.js.map +1 -0
- package/build/esnext/media-type-codecs/media-type-encoders.d.ts +18 -0
- package/build/esnext/media-type-codecs/media-type-encoders.js +60 -0
- package/build/esnext/media-type-codecs/media-type-encoders.js.map +1 -0
- package/build/esnext/media-type-codecs/www-form-url-encoder.d.ts +59 -0
- package/build/esnext/media-type-codecs/www-form-url-encoder.js +192 -0
- package/build/esnext/media-type-codecs/www-form-url-encoder.js.map +1 -0
- package/build/esnext/media-type.d.ts +94 -0
- package/build/esnext/media-type.js +305 -0
- package/build/esnext/media-type.js.map +1 -0
- package/build/esnext/problem.d.ts +31 -0
- package/build/esnext/problem.js +169 -0
- package/build/esnext/problem.js.map +1 -0
- package/build/esnext/request-factory.d.ts +44 -0
- package/build/esnext/request-factory.js +15 -0
- package/build/esnext/request-factory.js.map +1 -0
- package/build/esnext/result-response.d.ts +4 -0
- package/build/esnext/result-response.js +15 -0
- package/build/esnext/result-response.js.map +1 -0
- package/build/esnext/sunday-error.d.ts +11 -0
- package/build/esnext/sunday-error.js +42 -0
- package/build/esnext/sunday-error.js.map +1 -0
- package/build/esnext/url-template.d.ts +6 -0
- package/{src/url-template.ts → build/esnext/url-template.js} +15 -19
- package/build/esnext/url-template.js.map +1 -0
- package/build/esnext/util/any.d.ts +2 -0
- package/{src/logger.ts → build/esnext/util/any.js} +10 -8
- package/build/esnext/util/any.js.map +1 -0
- package/build/esnext/util/base64.d.ts +5 -0
- package/build/esnext/util/base64.js +77 -0
- package/build/esnext/util/base64.js.map +1 -0
- package/build/esnext/util/error.d.ts +2 -0
- package/{src/media-type-codecs/any-text-encoder.ts → build/esnext/util/error.js} +11 -11
- package/build/esnext/util/error.js.map +1 -0
- package/build/esnext/util/hex.d.ts +4 -0
- package/build/esnext/util/hex.js +32 -0
- package/build/esnext/util/hex.js.map +1 -0
- package/build/esnext/util/rxjs.d.ts +5 -0
- package/build/esnext/util/rxjs.js +31 -0
- package/build/esnext/util/rxjs.js.map +1 -0
- package/build/esnext/util/stream-rxjs.d.ts +2 -0
- package/build/esnext/util/stream-rxjs.js +50 -0
- package/build/esnext/util/stream-rxjs.js.map +1 -0
- package/build/esnext/util/temporal.d.ts +2 -0
- package/{dist/media-type-codecs/any-text-decoder.js → build/esnext/util/temporal.js} +14 -12
- package/build/esnext/util/temporal.js.map +1 -0
- package/build/main/any-type.d.ts +4 -0
- package/build/main/any-type.js +16 -0
- package/build/main/any-type.js.map +1 -0
- package/build/main/class-type.d.ts +2 -0
- package/build/main/class-type.js +16 -0
- package/build/main/class-type.js.map +1 -0
- package/build/main/date-time-types.d.ts +2 -0
- package/build/main/date-time-types.js +27 -0
- package/build/main/date-time-types.js.map +1 -0
- package/build/main/event-parser.d.ts +17 -0
- package/build/main/event-parser.js +157 -0
- package/build/main/event-parser.js.map +1 -0
- package/build/main/fetch-event-source.d.ts +58 -0
- package/build/main/fetch-event-source.js +294 -0
- package/build/main/fetch-event-source.js.map +1 -0
- package/build/main/fetch-request-factory.d.ts +34 -0
- package/build/main/fetch-request-factory.js +194 -0
- package/build/main/fetch-request-factory.js.map +1 -0
- package/build/main/fetch.d.ts +7 -0
- package/build/main/fetch.js +107 -0
- package/build/main/fetch.js.map +1 -0
- package/build/main/header-parameters.d.ts +3 -0
- package/build/main/header-parameters.js +56 -0
- package/build/main/header-parameters.js.map +1 -0
- package/build/main/index.d.ts +26 -0
- package/build/main/index.js +52 -0
- package/build/main/index.js.map +1 -0
- package/build/main/logger.d.ts +8 -0
- package/build/main/logger.js +16 -0
- package/build/main/logger.js.map +1 -0
- package/build/main/media-type-codecs/any-text-decoder.d.ts +7 -0
- package/build/main/media-type-codecs/any-text-decoder.js +44 -0
- package/build/main/media-type-codecs/any-text-decoder.js.map +1 -0
- package/build/main/media-type-codecs/any-text-encoder.d.ts +5 -0
- package/build/main/media-type-codecs/any-text-encoder.js +27 -0
- package/build/main/media-type-codecs/any-text-encoder.js.map +1 -0
- package/build/main/media-type-codecs/binary-decoder.d.ts +6 -0
- package/build/main/media-type-codecs/binary-decoder.js +44 -0
- package/build/main/media-type-codecs/binary-decoder.js.map +1 -0
- package/build/main/media-type-codecs/binary-encoder.d.ts +5 -0
- package/{dist/media-type-codecs/binary-decoder.js → build/main/media-type-codecs/binary-encoder.js} +14 -13
- package/build/main/media-type-codecs/binary-encoder.js.map +1 -0
- package/build/main/media-type-codecs/cbor-decoder.d.ts +39 -0
- package/build/main/media-type-codecs/cbor-decoder.js +441 -0
- package/build/main/media-type-codecs/cbor-decoder.js.map +1 -0
- package/build/main/media-type-codecs/cbor-encoder.d.ts +43 -0
- package/build/main/media-type-codecs/cbor-encoder.js +240 -0
- package/build/main/media-type-codecs/cbor-encoder.js.map +1 -0
- package/build/main/media-type-codecs/cbor-tags.d.ts +4 -0
- package/build/main/media-type-codecs/cbor-tags.js +21 -0
- package/build/main/media-type-codecs/cbor-tags.js.map +1 -0
- package/build/main/media-type-codecs/json-decoder.d.ts +39 -0
- package/build/main/media-type-codecs/json-decoder.js +395 -0
- package/build/main/media-type-codecs/json-decoder.js.map +1 -0
- package/build/main/media-type-codecs/json-encoder.d.ts +44 -0
- package/build/main/media-type-codecs/json-encoder.js +277 -0
- package/build/main/media-type-codecs/json-encoder.js.map +1 -0
- package/build/main/media-type-codecs/media-type-decoder.d.ts +11 -0
- package/build/main/media-type-codecs/media-type-decoder.js +23 -0
- package/build/main/media-type-codecs/media-type-decoder.js.map +1 -0
- package/build/main/media-type-codecs/media-type-decoders.d.ts +18 -0
- package/build/main/media-type-codecs/media-type-decoders.js +62 -0
- package/build/main/media-type-codecs/media-type-decoders.js.map +1 -0
- package/build/main/media-type-codecs/media-type-encoder.d.ts +12 -0
- package/build/main/media-type-codecs/media-type-encoder.js +29 -0
- package/build/main/media-type-codecs/media-type-encoder.js.map +1 -0
- package/build/main/media-type-codecs/media-type-encoders.d.ts +18 -0
- package/build/main/media-type-codecs/media-type-encoders.js +64 -0
- package/build/main/media-type-codecs/media-type-encoders.js.map +1 -0
- package/build/main/media-type-codecs/www-form-url-encoder.d.ts +59 -0
- package/build/main/media-type-codecs/www-form-url-encoder.js +196 -0
- package/build/main/media-type-codecs/www-form-url-encoder.js.map +1 -0
- package/build/main/media-type.d.ts +94 -0
- package/build/main/media-type.js +309 -0
- package/build/main/media-type.js.map +1 -0
- package/build/main/problem.d.ts +31 -0
- package/build/main/problem.js +172 -0
- package/build/main/problem.js.map +1 -0
- package/build/main/request-factory.d.ts +44 -0
- package/build/main/request-factory.js +16 -0
- package/build/main/request-factory.js.map +1 -0
- package/build/main/result-response.d.ts +4 -0
- package/build/main/result-response.js +16 -0
- package/build/main/result-response.js.map +1 -0
- package/build/main/sunday-error.d.ts +11 -0
- package/build/main/sunday-error.js +46 -0
- package/build/main/sunday-error.js.map +1 -0
- package/build/main/url-template.d.ts +6 -0
- package/build/main/url-template.js +35 -0
- package/build/main/url-template.js.map +1 -0
- package/build/main/util/any.d.ts +2 -0
- package/build/main/util/any.js +29 -0
- package/build/main/util/any.js.map +1 -0
- package/build/main/util/base64.d.ts +5 -0
- package/build/main/util/base64.js +80 -0
- package/build/main/util/base64.js.map +1 -0
- package/build/main/util/error.d.ts +2 -0
- package/{src/util/temporal.ts → build/main/util/error.js} +15 -16
- package/build/main/util/error.js.map +1 -0
- package/build/main/util/hex.d.ts +4 -0
- package/build/main/util/hex.js +35 -0
- package/build/main/util/hex.js.map +1 -0
- package/build/main/util/rxjs.d.ts +5 -0
- package/build/main/util/rxjs.js +36 -0
- package/build/main/util/rxjs.js.map +1 -0
- package/build/main/util/stream-rxjs.d.ts +2 -0
- package/build/main/util/stream-rxjs.js +54 -0
- package/build/main/util/stream-rxjs.js.map +1 -0
- package/build/main/util/temporal.d.ts +2 -0
- package/build/main/util/temporal.js +36 -0
- package/build/main/util/temporal.js.map +1 -0
- package/package.json +37 -27
- package/dist/any-type.js.map +0 -1
- package/dist/class-type.js.map +0 -1
- package/dist/date-time-types.js.map +0 -1
- package/dist/event-parser.js.map +0 -1
- package/dist/fetch-event-source.js.map +0 -1
- package/dist/fetch-request-factory.js.map +0 -1
- package/dist/fetch.js +0 -90
- package/dist/fetch.js.map +0 -1
- package/dist/header-parameters.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/logger.js.map +0 -1
- package/dist/media-type-codecs/any-text-decoder.js.map +0 -1
- package/dist/media-type-codecs/any-text-encoder.js.map +0 -1
- package/dist/media-type-codecs/binary-decoder.js.map +0 -1
- package/dist/media-type-codecs/binary-encoder.js.map +0 -1
- package/dist/media-type-codecs/cbor-decoder.js.map +0 -1
- package/dist/media-type-codecs/cbor-encoder.js.map +0 -1
- package/dist/media-type-codecs/cbor-tags.js.map +0 -1
- package/dist/media-type-codecs/json-decoder.js.map +0 -1
- package/dist/media-type-codecs/json-encoder.js.map +0 -1
- package/dist/media-type-codecs/media-type-decoder.js.map +0 -1
- package/dist/media-type-codecs/media-type-decoders.js.map +0 -1
- package/dist/media-type-codecs/media-type-encoder.js.map +0 -1
- package/dist/media-type-codecs/media-type-encoders.js.map +0 -1
- package/dist/media-type-codecs/www-form-url-encoder.js.map +0 -1
- package/dist/media-type.js.map +0 -1
- package/dist/problem.js.map +0 -1
- package/dist/request-factory.js.map +0 -1
- package/dist/result-response.js.map +0 -1
- package/dist/sunday-error.js +0 -31
- package/dist/sunday-error.js.map +0 -1
- package/dist/url-template.js.map +0 -1
- package/dist/util/any.js.map +0 -1
- package/dist/util/base64.js.map +0 -1
- package/dist/util/error.js.map +0 -1
- package/dist/util/hex.js.map +0 -1
- package/dist/util/rxjs.js.map +0 -1
- package/dist/util/stream-rxjs.js +0 -39
- package/dist/util/stream-rxjs.js.map +0 -1
- package/dist/util/temporal.js.map +0 -1
- package/src/any-type.ts +0 -22
- package/src/class-type.ts +0 -21
- package/src/date-time-types.ts +0 -37
- package/src/event-parser.ts +0 -204
- package/src/fetch-event-source.ts +0 -406
- package/src/fetch-request-factory.ts +0 -315
- package/src/fetch.ts +0 -99
- package/src/header-parameters.ts +0 -66
- package/src/media-type-codecs/any-text-decoder.ts +0 -34
- package/src/media-type-codecs/binary-decoder.ts +0 -38
- package/src/media-type-codecs/binary-encoder.ts +0 -33
- package/src/media-type-codecs/cbor-decoder.ts +0 -529
- package/src/media-type-codecs/cbor-encoder.ts +0 -314
- package/src/media-type-codecs/json-decoder.ts +0 -484
- package/src/media-type-codecs/json-encoder.ts +0 -335
- package/src/media-type-codecs/media-type-decoder.ts +0 -34
- package/src/media-type-codecs/media-type-decoders.ts +0 -86
- package/src/media-type-codecs/media-type-encoder.ts +0 -45
- package/src/media-type-codecs/media-type-encoders.ts +0 -88
- package/src/media-type-codecs/www-form-url-encoder.ts +0 -243
- package/src/media-type.ts +0 -362
- package/src/problem.ts +0 -171
- package/src/request-factory.ts +0 -124
- package/src/sunday-error.ts +0 -51
- package/src/util/base64.ts +0 -91
- package/src/util/error.ts +0 -28
- package/src/util/hex.ts +0 -30
- package/src/util/rxjs.ts +0 -43
- package/src/util/stream-rxjs.ts +0 -42
package/src/fetch.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 Outfox, Inc.
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
import { ConstructableClassType } from './class-type';
|
|
16
|
-
import { MediaType } from './media-type';
|
|
17
|
-
import { Problem } from './problem';
|
|
18
|
-
import { SundayError } from './sunday-error';
|
|
19
|
-
import { Base64 } from './util/base64';
|
|
20
|
-
import { errorToMessage } from './util/error';
|
|
21
|
-
|
|
22
|
-
export async function validate(
|
|
23
|
-
response: Response,
|
|
24
|
-
dataExpected: boolean,
|
|
25
|
-
problemTypes?: Map<string, ConstructableClassType<Problem>>,
|
|
26
|
-
): Promise<Response> {
|
|
27
|
-
if (response.status < 200 || response.status >= 300) {
|
|
28
|
-
const mediaType = MediaType.from(
|
|
29
|
-
response.headers.get('content-type'),
|
|
30
|
-
MediaType.OctetStream,
|
|
31
|
-
);
|
|
32
|
-
const isProblem = mediaType?.compatible(MediaType.Problem) ?? false;
|
|
33
|
-
if (!isProblem) {
|
|
34
|
-
throw await Problem.fromResponse(response);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const problemData = await response.json();
|
|
38
|
-
const problemType = problemTypes?.get(problemData.type) ?? Problem;
|
|
39
|
-
if (problemType.name === 'Problem') {
|
|
40
|
-
throw new Problem(problemData);
|
|
41
|
-
} else {
|
|
42
|
-
throw new problemType(problemData?.instance);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (dataExpected && (response.status === 204 || response.status === 205)) {
|
|
47
|
-
throw await SundayError.fromResponse('Unexpected Empty Response', response);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return response;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export namespace ResponseExample {
|
|
54
|
-
export function build(response: Response, bodyExample?: string): string {
|
|
55
|
-
return (
|
|
56
|
-
`HTTP/?.? ${response.status} ${response.statusText}\n` +
|
|
57
|
-
Array.from(response.headers.entries())
|
|
58
|
-
.map(([name, value]) => `${name}: ${value}\n`)
|
|
59
|
-
.join('') +
|
|
60
|
-
'\n' +
|
|
61
|
-
(bodyExample ?? '<none>')
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export async function bodyExcerpt(
|
|
66
|
-
response: Response,
|
|
67
|
-
maxLength: number,
|
|
68
|
-
): Promise<[string, unknown]> {
|
|
69
|
-
let body: unknown;
|
|
70
|
-
let bodyExcerpt: string;
|
|
71
|
-
try {
|
|
72
|
-
if (response.headers.get('content-type')?.startsWith('text/')) {
|
|
73
|
-
const text = await response.text();
|
|
74
|
-
body = text;
|
|
75
|
-
if (text.length > maxLength) {
|
|
76
|
-
const exampleText = text.slice(0, maxLength);
|
|
77
|
-
const remainingTextLength = text.length - maxLength;
|
|
78
|
-
bodyExcerpt = `${exampleText}<<... ${remainingTextLength} characters>>`;
|
|
79
|
-
} else {
|
|
80
|
-
bodyExcerpt = text;
|
|
81
|
-
}
|
|
82
|
-
} else {
|
|
83
|
-
const blob = await response.blob();
|
|
84
|
-
body = blob;
|
|
85
|
-
if (blob.size > maxLength) {
|
|
86
|
-
bodyExcerpt = `<<binary data: ${blob.size} bytes>>`;
|
|
87
|
-
} else {
|
|
88
|
-
const dataSlice = await blob.slice(0, maxLength).arrayBuffer();
|
|
89
|
-
bodyExcerpt = Base64.encode(dataSlice);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
} catch (error) {
|
|
93
|
-
// ignore errors
|
|
94
|
-
const message = errorToMessage(error);
|
|
95
|
-
body = bodyExcerpt = `<<error displaying response data: ${message}>>`;
|
|
96
|
-
}
|
|
97
|
-
return [bodyExcerpt, body];
|
|
98
|
-
}
|
|
99
|
-
}
|
package/src/header-parameters.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 Outfox, Inc.
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
export namespace HeaderParameters {
|
|
16
|
-
export function encode(
|
|
17
|
-
parameters?: Record<string, unknown>,
|
|
18
|
-
): [string, string][] {
|
|
19
|
-
if (parameters == null) {
|
|
20
|
-
return [];
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const headers: [string, string][] = [];
|
|
24
|
-
|
|
25
|
-
Object.entries(parameters).forEach(([name, parameter]) => {
|
|
26
|
-
for (const value of encodeParam(name, parameter)) {
|
|
27
|
-
headers.push([name, value]);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
return headers;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function encodeParam(name: string, value: unknown): string[] {
|
|
35
|
-
if (value == null) {
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (value instanceof Array) {
|
|
40
|
-
const result: string[] = [];
|
|
41
|
-
|
|
42
|
-
for (const item of value) {
|
|
43
|
-
if (item == null) {
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
result.push(validate(name, `${item}`));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return result;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return [validate(name, `${value}`)];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const asciiRegex = /^[\x20-\x7F]*$/;
|
|
57
|
-
|
|
58
|
-
function validate(name: string, value: string): string {
|
|
59
|
-
if (!asciiRegex.test(value)) {
|
|
60
|
-
throw new Error(
|
|
61
|
-
`The encoded header value contains one or more invalid characters: header=${name}, value=${value}`,
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
return value;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 Outfox, Inc.
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
import { AnyType } from '../any-type';
|
|
16
|
-
import { TextMediaTypeDecoder } from './media-type-decoder';
|
|
17
|
-
|
|
18
|
-
export class AnyTextDecoder implements TextMediaTypeDecoder {
|
|
19
|
-
static default = new AnyTextDecoder();
|
|
20
|
-
|
|
21
|
-
async decode<T>(response: Response, type: AnyType): Promise<T> {
|
|
22
|
-
if (type[0] != String) {
|
|
23
|
-
throw Error('Invalid type, expected String');
|
|
24
|
-
}
|
|
25
|
-
return (await response.text()) as unknown as T;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
decodeText<T>(text: string, type: AnyType): T {
|
|
29
|
-
if (type[0] != String) {
|
|
30
|
-
throw Error('Invalid type, expected String');
|
|
31
|
-
}
|
|
32
|
-
return text as unknown as T;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 Outfox, Inc.
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
import { MediaTypeDecoder } from './media-type-decoder';
|
|
16
|
-
import { AnyConstructableType } from '../any-type';
|
|
17
|
-
|
|
18
|
-
export class BinaryDecoder implements MediaTypeDecoder {
|
|
19
|
-
static default = new BinaryDecoder();
|
|
20
|
-
|
|
21
|
-
async decode<T>(response: Response, type: AnyConstructableType): Promise<T> {
|
|
22
|
-
const arrayBuffer = await response.arrayBuffer();
|
|
23
|
-
|
|
24
|
-
if (type[0] === ArrayBuffer) {
|
|
25
|
-
return arrayBuffer as unknown as T;
|
|
26
|
-
} else if (
|
|
27
|
-
type[0] === Uint8Array ||
|
|
28
|
-
type[0] === Int8Array ||
|
|
29
|
-
type[0] === DataView
|
|
30
|
-
) {
|
|
31
|
-
return new type[0](arrayBuffer) as T;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
throw Error(
|
|
35
|
-
'Invalid value, expected ArrayBuffer, (Int|Uint)Array or DataView',
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 Outfox, Inc.
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
import { MediaTypeEncoder } from './media-type-encoder';
|
|
16
|
-
|
|
17
|
-
export class BinaryEncoder implements MediaTypeEncoder {
|
|
18
|
-
static default = new BinaryEncoder();
|
|
19
|
-
|
|
20
|
-
encode(value: unknown): BodyInit {
|
|
21
|
-
if (
|
|
22
|
-
!ArrayBuffer.isView(value) &&
|
|
23
|
-
!(value instanceof ArrayBuffer) &&
|
|
24
|
-
!(value instanceof Blob) &&
|
|
25
|
-
!(value instanceof ReadableStream)
|
|
26
|
-
) {
|
|
27
|
-
throw Error(
|
|
28
|
-
'Invalid value, expected BufferSource, Blob or ReadableStream',
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
return value;
|
|
32
|
-
}
|
|
33
|
-
}
|