@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.
Files changed (403) hide show
  1. package/{dist → build/esm}/any-type.d.ts +0 -0
  2. package/{dist → build/esm}/any-type.js +0 -0
  3. package/build/esm/any-type.js.map +1 -0
  4. package/{dist → build/esm}/class-type.d.ts +0 -0
  5. package/{dist → build/esm}/class-type.js +0 -0
  6. package/build/esm/class-type.js.map +1 -0
  7. package/{dist → build/esm}/date-time-types.d.ts +0 -0
  8. package/{dist → build/esm}/date-time-types.js +0 -0
  9. package/build/esm/date-time-types.js.map +1 -0
  10. package/{dist → build/esm}/event-parser.d.ts +0 -0
  11. package/{dist → build/esm}/event-parser.js +0 -0
  12. package/build/esm/event-parser.js.map +1 -0
  13. package/{dist → build/esm}/fetch-event-source.d.ts +0 -0
  14. package/{dist → build/esm}/fetch-event-source.js +0 -0
  15. package/build/esm/fetch-event-source.js.map +1 -0
  16. package/{dist → build/esm}/fetch-request-factory.d.ts +0 -0
  17. package/{dist → build/esm}/fetch-request-factory.js +17 -8
  18. package/build/esm/fetch-request-factory.js.map +1 -0
  19. package/{dist → build/esm}/fetch.d.ts +0 -0
  20. package/build/esm/fetch.js +103 -0
  21. package/build/esm/fetch.js.map +1 -0
  22. package/{dist → build/esm}/header-parameters.d.ts +0 -0
  23. package/{dist → build/esm}/header-parameters.js +0 -0
  24. package/build/esm/header-parameters.js.map +1 -0
  25. package/{dist → build/esm}/index.d.ts +0 -0
  26. package/{dist → build/esm}/index.js +0 -0
  27. package/build/esm/index.js.map +1 -0
  28. package/{dist → build/esm}/logger.d.ts +0 -0
  29. package/{dist → build/esm}/logger.js +0 -0
  30. package/build/esm/logger.js.map +1 -0
  31. package/{dist → build/esm}/media-type-codecs/any-text-decoder.d.ts +0 -0
  32. package/build/esm/media-type-codecs/any-text-decoder.js +40 -0
  33. package/build/esm/media-type-codecs/any-text-decoder.js.map +1 -0
  34. package/{dist → build/esm}/media-type-codecs/any-text-encoder.d.ts +0 -0
  35. package/{dist → build/esm}/media-type-codecs/any-text-encoder.js +0 -0
  36. package/build/esm/media-type-codecs/any-text-encoder.js.map +1 -0
  37. package/{dist → build/esm}/media-type-codecs/binary-decoder.d.ts +0 -0
  38. package/build/esm/media-type-codecs/binary-decoder.js +40 -0
  39. package/build/esm/media-type-codecs/binary-decoder.js.map +1 -0
  40. package/{dist → build/esm}/media-type-codecs/binary-encoder.d.ts +0 -0
  41. package/{dist → build/esm}/media-type-codecs/binary-encoder.js +0 -0
  42. package/build/esm/media-type-codecs/binary-encoder.js.map +1 -0
  43. package/{dist → build/esm}/media-type-codecs/cbor-decoder.d.ts +0 -0
  44. package/{dist → build/esm}/media-type-codecs/cbor-decoder.js +13 -2
  45. package/build/esm/media-type-codecs/cbor-decoder.js.map +1 -0
  46. package/{dist → build/esm}/media-type-codecs/cbor-encoder.d.ts +0 -0
  47. package/{dist → build/esm}/media-type-codecs/cbor-encoder.js +0 -0
  48. package/build/esm/media-type-codecs/cbor-encoder.js.map +1 -0
  49. package/{dist → build/esm}/media-type-codecs/cbor-tags.d.ts +0 -0
  50. package/{dist → build/esm}/media-type-codecs/cbor-tags.js +0 -0
  51. package/build/esm/media-type-codecs/cbor-tags.js.map +1 -0
  52. package/{dist → build/esm}/media-type-codecs/json-decoder.d.ts +0 -0
  53. package/{dist → build/esm}/media-type-codecs/json-decoder.js +13 -2
  54. package/build/esm/media-type-codecs/json-decoder.js.map +1 -0
  55. package/{dist → build/esm}/media-type-codecs/json-encoder.d.ts +0 -0
  56. package/{dist → build/esm}/media-type-codecs/json-encoder.js +0 -0
  57. package/build/esm/media-type-codecs/json-encoder.js.map +1 -0
  58. package/{dist → build/esm}/media-type-codecs/media-type-decoder.d.ts +0 -0
  59. package/{dist → build/esm}/media-type-codecs/media-type-decoder.js +0 -0
  60. package/build/esm/media-type-codecs/media-type-decoder.js.map +1 -0
  61. package/{dist → build/esm}/media-type-codecs/media-type-decoders.d.ts +0 -0
  62. package/{dist → build/esm}/media-type-codecs/media-type-decoders.js +0 -0
  63. package/build/esm/media-type-codecs/media-type-decoders.js.map +1 -0
  64. package/{dist → build/esm}/media-type-codecs/media-type-encoder.d.ts +0 -0
  65. package/{dist → build/esm}/media-type-codecs/media-type-encoder.js +0 -0
  66. package/build/esm/media-type-codecs/media-type-encoder.js.map +1 -0
  67. package/{dist → build/esm}/media-type-codecs/media-type-encoders.d.ts +0 -0
  68. package/{dist → build/esm}/media-type-codecs/media-type-encoders.js +0 -0
  69. package/build/esm/media-type-codecs/media-type-encoders.js.map +1 -0
  70. package/{dist → build/esm}/media-type-codecs/www-form-url-encoder.d.ts +0 -0
  71. package/{dist → build/esm}/media-type-codecs/www-form-url-encoder.js +0 -0
  72. package/build/esm/media-type-codecs/www-form-url-encoder.js.map +1 -0
  73. package/{dist → build/esm}/media-type.d.ts +0 -0
  74. package/{dist → build/esm}/media-type.js +0 -0
  75. package/build/esm/media-type.js.map +1 -0
  76. package/{dist → build/esm}/problem.d.ts +0 -0
  77. package/{dist → build/esm}/problem.js +30 -19
  78. package/build/esm/problem.js.map +1 -0
  79. package/{dist → build/esm}/request-factory.d.ts +0 -0
  80. package/{dist → build/esm}/request-factory.js +0 -0
  81. package/build/esm/request-factory.js.map +1 -0
  82. package/{dist → build/esm}/result-response.d.ts +0 -0
  83. package/{dist → build/esm}/result-response.js +0 -0
  84. package/build/esm/result-response.js.map +1 -0
  85. package/{dist → build/esm}/sunday-error.d.ts +0 -0
  86. package/build/esm/sunday-error.js +42 -0
  87. package/build/esm/sunday-error.js.map +1 -0
  88. package/{dist → build/esm}/url-template.d.ts +0 -0
  89. package/{dist → build/esm}/url-template.js +0 -0
  90. package/build/esm/url-template.js.map +1 -0
  91. package/{dist → build/esm}/util/any.d.ts +0 -0
  92. package/{dist → build/esm}/util/any.js +0 -0
  93. package/build/esm/util/any.js.map +1 -0
  94. package/{dist → build/esm}/util/base64.d.ts +0 -0
  95. package/{dist → build/esm}/util/base64.js +0 -0
  96. package/build/esm/util/base64.js.map +1 -0
  97. package/{dist → build/esm}/util/error.d.ts +0 -0
  98. package/{dist → build/esm}/util/error.js +0 -0
  99. package/build/esm/util/error.js.map +1 -0
  100. package/{dist → build/esm}/util/hex.d.ts +0 -0
  101. package/{dist → build/esm}/util/hex.js +0 -0
  102. package/build/esm/util/hex.js.map +1 -0
  103. package/{dist → build/esm}/util/rxjs.d.ts +0 -0
  104. package/{dist → build/esm}/util/rxjs.js +0 -0
  105. package/build/esm/util/rxjs.js.map +1 -0
  106. package/{dist → build/esm}/util/stream-rxjs.d.ts +0 -0
  107. package/build/esm/util/stream-rxjs.js +50 -0
  108. package/build/esm/util/stream-rxjs.js.map +1 -0
  109. package/{dist → build/esm}/util/temporal.d.ts +0 -0
  110. package/{dist → build/esm}/util/temporal.js +0 -0
  111. package/build/esm/util/temporal.js.map +1 -0
  112. package/build/esnext/any-type.d.ts +4 -0
  113. package/build/esnext/any-type.js +15 -0
  114. package/build/esnext/any-type.js.map +1 -0
  115. package/build/esnext/class-type.d.ts +2 -0
  116. package/build/esnext/class-type.js +15 -0
  117. package/build/esnext/class-type.js.map +1 -0
  118. package/build/esnext/date-time-types.d.ts +2 -0
  119. package/build/esnext/date-time-types.js +16 -0
  120. package/build/esnext/date-time-types.js.map +1 -0
  121. package/build/esnext/event-parser.d.ts +17 -0
  122. package/build/esnext/event-parser.js +153 -0
  123. package/build/esnext/event-parser.js.map +1 -0
  124. package/build/esnext/fetch-event-source.d.ts +58 -0
  125. package/build/esnext/fetch-event-source.js +290 -0
  126. package/build/esnext/fetch-event-source.js.map +1 -0
  127. package/build/esnext/fetch-request-factory.d.ts +34 -0
  128. package/build/esnext/fetch-request-factory.js +190 -0
  129. package/build/esnext/fetch-request-factory.js.map +1 -0
  130. package/build/esnext/fetch.d.ts +7 -0
  131. package/build/esnext/fetch.js +103 -0
  132. package/build/esnext/fetch.js.map +1 -0
  133. package/build/esnext/header-parameters.d.ts +3 -0
  134. package/build/esnext/header-parameters.js +53 -0
  135. package/build/esnext/header-parameters.js.map +1 -0
  136. package/build/esnext/index.d.ts +26 -0
  137. package/{src/index.ts → build/esnext/index.js} +1 -2
  138. package/build/esnext/index.js.map +1 -0
  139. package/build/esnext/logger.d.ts +8 -0
  140. package/build/esnext/logger.js +15 -0
  141. package/build/esnext/logger.js.map +1 -0
  142. package/build/esnext/media-type-codecs/any-text-decoder.d.ts +7 -0
  143. package/build/esnext/media-type-codecs/any-text-decoder.js +40 -0
  144. package/build/esnext/media-type-codecs/any-text-decoder.js.map +1 -0
  145. package/build/esnext/media-type-codecs/any-text-encoder.d.ts +5 -0
  146. package/build/esnext/media-type-codecs/any-text-encoder.js +23 -0
  147. package/build/esnext/media-type-codecs/any-text-encoder.js.map +1 -0
  148. package/build/esnext/media-type-codecs/binary-decoder.d.ts +6 -0
  149. package/build/esnext/media-type-codecs/binary-decoder.js +40 -0
  150. package/build/esnext/media-type-codecs/binary-decoder.js.map +1 -0
  151. package/build/esnext/media-type-codecs/binary-encoder.d.ts +5 -0
  152. package/build/esnext/media-type-codecs/binary-encoder.js +26 -0
  153. package/build/esnext/media-type-codecs/binary-encoder.js.map +1 -0
  154. package/build/esnext/media-type-codecs/cbor-decoder.d.ts +39 -0
  155. package/build/esnext/media-type-codecs/cbor-decoder.js +437 -0
  156. package/build/esnext/media-type-codecs/cbor-decoder.js.map +1 -0
  157. package/build/esnext/media-type-codecs/cbor-encoder.d.ts +43 -0
  158. package/build/esnext/media-type-codecs/cbor-encoder.js +236 -0
  159. package/build/esnext/media-type-codecs/cbor-encoder.js.map +1 -0
  160. package/build/esnext/media-type-codecs/cbor-tags.d.ts +4 -0
  161. package/{src/media-type-codecs/cbor-tags.ts → build/esnext/media-type-codecs/cbor-tags.js} +1 -1
  162. package/build/esnext/media-type-codecs/cbor-tags.js.map +1 -0
  163. package/build/esnext/media-type-codecs/json-decoder.d.ts +39 -0
  164. package/build/esnext/media-type-codecs/json-decoder.js +391 -0
  165. package/build/esnext/media-type-codecs/json-decoder.js.map +1 -0
  166. package/build/esnext/media-type-codecs/json-encoder.d.ts +44 -0
  167. package/build/esnext/media-type-codecs/json-encoder.js +273 -0
  168. package/build/esnext/media-type-codecs/json-encoder.js.map +1 -0
  169. package/build/esnext/media-type-codecs/media-type-decoder.d.ts +11 -0
  170. package/{src/result-response.ts → build/esnext/media-type-codecs/media-type-decoder.js} +5 -4
  171. package/build/esnext/media-type-codecs/media-type-decoder.js.map +1 -0
  172. package/build/esnext/media-type-codecs/media-type-decoders.d.ts +18 -0
  173. package/build/esnext/media-type-codecs/media-type-decoders.js +58 -0
  174. package/build/esnext/media-type-codecs/media-type-decoders.js.map +1 -0
  175. package/build/esnext/media-type-codecs/media-type-encoder.d.ts +12 -0
  176. package/{src/util/any.ts → build/esnext/media-type-codecs/media-type-encoder.js} +9 -9
  177. package/build/esnext/media-type-codecs/media-type-encoder.js.map +1 -0
  178. package/build/esnext/media-type-codecs/media-type-encoders.d.ts +18 -0
  179. package/build/esnext/media-type-codecs/media-type-encoders.js +60 -0
  180. package/build/esnext/media-type-codecs/media-type-encoders.js.map +1 -0
  181. package/build/esnext/media-type-codecs/www-form-url-encoder.d.ts +59 -0
  182. package/build/esnext/media-type-codecs/www-form-url-encoder.js +192 -0
  183. package/build/esnext/media-type-codecs/www-form-url-encoder.js.map +1 -0
  184. package/build/esnext/media-type.d.ts +94 -0
  185. package/build/esnext/media-type.js +305 -0
  186. package/build/esnext/media-type.js.map +1 -0
  187. package/build/esnext/problem.d.ts +31 -0
  188. package/build/esnext/problem.js +169 -0
  189. package/build/esnext/problem.js.map +1 -0
  190. package/build/esnext/request-factory.d.ts +44 -0
  191. package/build/esnext/request-factory.js +15 -0
  192. package/build/esnext/request-factory.js.map +1 -0
  193. package/build/esnext/result-response.d.ts +4 -0
  194. package/build/esnext/result-response.js +15 -0
  195. package/build/esnext/result-response.js.map +1 -0
  196. package/build/esnext/sunday-error.d.ts +11 -0
  197. package/build/esnext/sunday-error.js +42 -0
  198. package/build/esnext/sunday-error.js.map +1 -0
  199. package/build/esnext/url-template.d.ts +6 -0
  200. package/{src/url-template.ts → build/esnext/url-template.js} +15 -19
  201. package/build/esnext/url-template.js.map +1 -0
  202. package/build/esnext/util/any.d.ts +2 -0
  203. package/{src/logger.ts → build/esnext/util/any.js} +10 -8
  204. package/build/esnext/util/any.js.map +1 -0
  205. package/build/esnext/util/base64.d.ts +5 -0
  206. package/build/esnext/util/base64.js +77 -0
  207. package/build/esnext/util/base64.js.map +1 -0
  208. package/build/esnext/util/error.d.ts +2 -0
  209. package/{src/media-type-codecs/any-text-encoder.ts → build/esnext/util/error.js} +11 -11
  210. package/build/esnext/util/error.js.map +1 -0
  211. package/build/esnext/util/hex.d.ts +4 -0
  212. package/build/esnext/util/hex.js +32 -0
  213. package/build/esnext/util/hex.js.map +1 -0
  214. package/build/esnext/util/rxjs.d.ts +5 -0
  215. package/build/esnext/util/rxjs.js +31 -0
  216. package/build/esnext/util/rxjs.js.map +1 -0
  217. package/build/esnext/util/stream-rxjs.d.ts +2 -0
  218. package/build/esnext/util/stream-rxjs.js +50 -0
  219. package/build/esnext/util/stream-rxjs.js.map +1 -0
  220. package/build/esnext/util/temporal.d.ts +2 -0
  221. package/{dist/media-type-codecs/any-text-decoder.js → build/esnext/util/temporal.js} +14 -12
  222. package/build/esnext/util/temporal.js.map +1 -0
  223. package/build/main/any-type.d.ts +4 -0
  224. package/build/main/any-type.js +16 -0
  225. package/build/main/any-type.js.map +1 -0
  226. package/build/main/class-type.d.ts +2 -0
  227. package/build/main/class-type.js +16 -0
  228. package/build/main/class-type.js.map +1 -0
  229. package/build/main/date-time-types.d.ts +2 -0
  230. package/build/main/date-time-types.js +27 -0
  231. package/build/main/date-time-types.js.map +1 -0
  232. package/build/main/event-parser.d.ts +17 -0
  233. package/build/main/event-parser.js +157 -0
  234. package/build/main/event-parser.js.map +1 -0
  235. package/build/main/fetch-event-source.d.ts +58 -0
  236. package/build/main/fetch-event-source.js +294 -0
  237. package/build/main/fetch-event-source.js.map +1 -0
  238. package/build/main/fetch-request-factory.d.ts +34 -0
  239. package/build/main/fetch-request-factory.js +194 -0
  240. package/build/main/fetch-request-factory.js.map +1 -0
  241. package/build/main/fetch.d.ts +7 -0
  242. package/build/main/fetch.js +107 -0
  243. package/build/main/fetch.js.map +1 -0
  244. package/build/main/header-parameters.d.ts +3 -0
  245. package/build/main/header-parameters.js +56 -0
  246. package/build/main/header-parameters.js.map +1 -0
  247. package/build/main/index.d.ts +26 -0
  248. package/build/main/index.js +52 -0
  249. package/build/main/index.js.map +1 -0
  250. package/build/main/logger.d.ts +8 -0
  251. package/build/main/logger.js +16 -0
  252. package/build/main/logger.js.map +1 -0
  253. package/build/main/media-type-codecs/any-text-decoder.d.ts +7 -0
  254. package/build/main/media-type-codecs/any-text-decoder.js +44 -0
  255. package/build/main/media-type-codecs/any-text-decoder.js.map +1 -0
  256. package/build/main/media-type-codecs/any-text-encoder.d.ts +5 -0
  257. package/build/main/media-type-codecs/any-text-encoder.js +27 -0
  258. package/build/main/media-type-codecs/any-text-encoder.js.map +1 -0
  259. package/build/main/media-type-codecs/binary-decoder.d.ts +6 -0
  260. package/build/main/media-type-codecs/binary-decoder.js +44 -0
  261. package/build/main/media-type-codecs/binary-decoder.js.map +1 -0
  262. package/build/main/media-type-codecs/binary-encoder.d.ts +5 -0
  263. package/{dist/media-type-codecs/binary-decoder.js → build/main/media-type-codecs/binary-encoder.js} +14 -13
  264. package/build/main/media-type-codecs/binary-encoder.js.map +1 -0
  265. package/build/main/media-type-codecs/cbor-decoder.d.ts +39 -0
  266. package/build/main/media-type-codecs/cbor-decoder.js +441 -0
  267. package/build/main/media-type-codecs/cbor-decoder.js.map +1 -0
  268. package/build/main/media-type-codecs/cbor-encoder.d.ts +43 -0
  269. package/build/main/media-type-codecs/cbor-encoder.js +240 -0
  270. package/build/main/media-type-codecs/cbor-encoder.js.map +1 -0
  271. package/build/main/media-type-codecs/cbor-tags.d.ts +4 -0
  272. package/build/main/media-type-codecs/cbor-tags.js +21 -0
  273. package/build/main/media-type-codecs/cbor-tags.js.map +1 -0
  274. package/build/main/media-type-codecs/json-decoder.d.ts +39 -0
  275. package/build/main/media-type-codecs/json-decoder.js +395 -0
  276. package/build/main/media-type-codecs/json-decoder.js.map +1 -0
  277. package/build/main/media-type-codecs/json-encoder.d.ts +44 -0
  278. package/build/main/media-type-codecs/json-encoder.js +277 -0
  279. package/build/main/media-type-codecs/json-encoder.js.map +1 -0
  280. package/build/main/media-type-codecs/media-type-decoder.d.ts +11 -0
  281. package/build/main/media-type-codecs/media-type-decoder.js +23 -0
  282. package/build/main/media-type-codecs/media-type-decoder.js.map +1 -0
  283. package/build/main/media-type-codecs/media-type-decoders.d.ts +18 -0
  284. package/build/main/media-type-codecs/media-type-decoders.js +62 -0
  285. package/build/main/media-type-codecs/media-type-decoders.js.map +1 -0
  286. package/build/main/media-type-codecs/media-type-encoder.d.ts +12 -0
  287. package/build/main/media-type-codecs/media-type-encoder.js +29 -0
  288. package/build/main/media-type-codecs/media-type-encoder.js.map +1 -0
  289. package/build/main/media-type-codecs/media-type-encoders.d.ts +18 -0
  290. package/build/main/media-type-codecs/media-type-encoders.js +64 -0
  291. package/build/main/media-type-codecs/media-type-encoders.js.map +1 -0
  292. package/build/main/media-type-codecs/www-form-url-encoder.d.ts +59 -0
  293. package/build/main/media-type-codecs/www-form-url-encoder.js +196 -0
  294. package/build/main/media-type-codecs/www-form-url-encoder.js.map +1 -0
  295. package/build/main/media-type.d.ts +94 -0
  296. package/build/main/media-type.js +309 -0
  297. package/build/main/media-type.js.map +1 -0
  298. package/build/main/problem.d.ts +31 -0
  299. package/build/main/problem.js +172 -0
  300. package/build/main/problem.js.map +1 -0
  301. package/build/main/request-factory.d.ts +44 -0
  302. package/build/main/request-factory.js +16 -0
  303. package/build/main/request-factory.js.map +1 -0
  304. package/build/main/result-response.d.ts +4 -0
  305. package/build/main/result-response.js +16 -0
  306. package/build/main/result-response.js.map +1 -0
  307. package/build/main/sunday-error.d.ts +11 -0
  308. package/build/main/sunday-error.js +46 -0
  309. package/build/main/sunday-error.js.map +1 -0
  310. package/build/main/url-template.d.ts +6 -0
  311. package/build/main/url-template.js +35 -0
  312. package/build/main/url-template.js.map +1 -0
  313. package/build/main/util/any.d.ts +2 -0
  314. package/build/main/util/any.js +29 -0
  315. package/build/main/util/any.js.map +1 -0
  316. package/build/main/util/base64.d.ts +5 -0
  317. package/build/main/util/base64.js +80 -0
  318. package/build/main/util/base64.js.map +1 -0
  319. package/build/main/util/error.d.ts +2 -0
  320. package/{src/util/temporal.ts → build/main/util/error.js} +15 -16
  321. package/build/main/util/error.js.map +1 -0
  322. package/build/main/util/hex.d.ts +4 -0
  323. package/build/main/util/hex.js +35 -0
  324. package/build/main/util/hex.js.map +1 -0
  325. package/build/main/util/rxjs.d.ts +5 -0
  326. package/build/main/util/rxjs.js +36 -0
  327. package/build/main/util/rxjs.js.map +1 -0
  328. package/build/main/util/stream-rxjs.d.ts +2 -0
  329. package/build/main/util/stream-rxjs.js +54 -0
  330. package/build/main/util/stream-rxjs.js.map +1 -0
  331. package/build/main/util/temporal.d.ts +2 -0
  332. package/build/main/util/temporal.js +36 -0
  333. package/build/main/util/temporal.js.map +1 -0
  334. package/package.json +37 -27
  335. package/dist/any-type.js.map +0 -1
  336. package/dist/class-type.js.map +0 -1
  337. package/dist/date-time-types.js.map +0 -1
  338. package/dist/event-parser.js.map +0 -1
  339. package/dist/fetch-event-source.js.map +0 -1
  340. package/dist/fetch-request-factory.js.map +0 -1
  341. package/dist/fetch.js +0 -90
  342. package/dist/fetch.js.map +0 -1
  343. package/dist/header-parameters.js.map +0 -1
  344. package/dist/index.js.map +0 -1
  345. package/dist/logger.js.map +0 -1
  346. package/dist/media-type-codecs/any-text-decoder.js.map +0 -1
  347. package/dist/media-type-codecs/any-text-encoder.js.map +0 -1
  348. package/dist/media-type-codecs/binary-decoder.js.map +0 -1
  349. package/dist/media-type-codecs/binary-encoder.js.map +0 -1
  350. package/dist/media-type-codecs/cbor-decoder.js.map +0 -1
  351. package/dist/media-type-codecs/cbor-encoder.js.map +0 -1
  352. package/dist/media-type-codecs/cbor-tags.js.map +0 -1
  353. package/dist/media-type-codecs/json-decoder.js.map +0 -1
  354. package/dist/media-type-codecs/json-encoder.js.map +0 -1
  355. package/dist/media-type-codecs/media-type-decoder.js.map +0 -1
  356. package/dist/media-type-codecs/media-type-decoders.js.map +0 -1
  357. package/dist/media-type-codecs/media-type-encoder.js.map +0 -1
  358. package/dist/media-type-codecs/media-type-encoders.js.map +0 -1
  359. package/dist/media-type-codecs/www-form-url-encoder.js.map +0 -1
  360. package/dist/media-type.js.map +0 -1
  361. package/dist/problem.js.map +0 -1
  362. package/dist/request-factory.js.map +0 -1
  363. package/dist/result-response.js.map +0 -1
  364. package/dist/sunday-error.js +0 -31
  365. package/dist/sunday-error.js.map +0 -1
  366. package/dist/url-template.js.map +0 -1
  367. package/dist/util/any.js.map +0 -1
  368. package/dist/util/base64.js.map +0 -1
  369. package/dist/util/error.js.map +0 -1
  370. package/dist/util/hex.js.map +0 -1
  371. package/dist/util/rxjs.js.map +0 -1
  372. package/dist/util/stream-rxjs.js +0 -39
  373. package/dist/util/stream-rxjs.js.map +0 -1
  374. package/dist/util/temporal.js.map +0 -1
  375. package/src/any-type.ts +0 -22
  376. package/src/class-type.ts +0 -21
  377. package/src/date-time-types.ts +0 -37
  378. package/src/event-parser.ts +0 -204
  379. package/src/fetch-event-source.ts +0 -406
  380. package/src/fetch-request-factory.ts +0 -315
  381. package/src/fetch.ts +0 -99
  382. package/src/header-parameters.ts +0 -66
  383. package/src/media-type-codecs/any-text-decoder.ts +0 -34
  384. package/src/media-type-codecs/binary-decoder.ts +0 -38
  385. package/src/media-type-codecs/binary-encoder.ts +0 -33
  386. package/src/media-type-codecs/cbor-decoder.ts +0 -529
  387. package/src/media-type-codecs/cbor-encoder.ts +0 -314
  388. package/src/media-type-codecs/json-decoder.ts +0 -484
  389. package/src/media-type-codecs/json-encoder.ts +0 -335
  390. package/src/media-type-codecs/media-type-decoder.ts +0 -34
  391. package/src/media-type-codecs/media-type-decoders.ts +0 -86
  392. package/src/media-type-codecs/media-type-encoder.ts +0 -45
  393. package/src/media-type-codecs/media-type-encoders.ts +0 -88
  394. package/src/media-type-codecs/www-form-url-encoder.ts +0 -243
  395. package/src/media-type.ts +0 -362
  396. package/src/problem.ts +0 -171
  397. package/src/request-factory.ts +0 -124
  398. package/src/sunday-error.ts +0 -51
  399. package/src/util/base64.ts +0 -91
  400. package/src/util/error.ts +0 -28
  401. package/src/util/hex.ts +0 -30
  402. package/src/util/rxjs.ts +0 -43
  403. package/src/util/stream-rxjs.ts +0 -42
@@ -0,0 +1,103 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import { MediaType } from './media-type';
24
+ import { Problem } from './problem';
25
+ import { SundayError } from './sunday-error';
26
+ import { Base64 } from './util/base64';
27
+ import { errorToMessage } from './util/error';
28
+ export function validate(response, dataExpected, problemTypes) {
29
+ var _a, _b;
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ if (response.status < 200 || response.status >= 300) {
32
+ const mediaType = MediaType.from(response.headers.get('content-type'), MediaType.OctetStream);
33
+ const isProblem = (_a = mediaType === null || mediaType === void 0 ? void 0 : mediaType.compatible(MediaType.Problem)) !== null && _a !== void 0 ? _a : false;
34
+ if (!isProblem) {
35
+ throw yield Problem.fromResponse(response);
36
+ }
37
+ const problemData = yield response.json();
38
+ const problemType = (_b = problemTypes === null || problemTypes === void 0 ? void 0 : problemTypes.get(problemData.type)) !== null && _b !== void 0 ? _b : Problem;
39
+ if (problemType.name === 'Problem') {
40
+ throw new Problem(problemData);
41
+ }
42
+ else {
43
+ throw new problemType(problemData === null || problemData === void 0 ? void 0 : problemData.instance);
44
+ }
45
+ }
46
+ if (dataExpected && (response.status === 204 || response.status === 205)) {
47
+ throw yield SundayError.fromResponse('Unexpected Empty Response', response);
48
+ }
49
+ return response;
50
+ });
51
+ }
52
+ export var ResponseExample;
53
+ (function (ResponseExample) {
54
+ function build(response, bodyExample) {
55
+ return (`HTTP/?.? ${response.status} ${response.statusText}\n` +
56
+ Array.from(response.headers.entries())
57
+ .map(([name, value]) => `${name}: ${value}\n`)
58
+ .join('') +
59
+ '\n' +
60
+ (bodyExample !== null && bodyExample !== void 0 ? bodyExample : '<none>'));
61
+ }
62
+ ResponseExample.build = build;
63
+ function bodyExcerpt(response, maxLength) {
64
+ var _a;
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ let body;
67
+ let bodyExcerpt;
68
+ try {
69
+ if ((_a = response.headers.get('content-type')) === null || _a === void 0 ? void 0 : _a.startsWith('text/')) {
70
+ const text = yield response.text();
71
+ body = text;
72
+ if (text.length > maxLength) {
73
+ const exampleText = text.slice(0, maxLength);
74
+ const remainingTextLength = text.length - maxLength;
75
+ bodyExcerpt = `${exampleText}<<... ${remainingTextLength} characters>>`;
76
+ }
77
+ else {
78
+ bodyExcerpt = text;
79
+ }
80
+ }
81
+ else {
82
+ const blob = yield response.blob();
83
+ body = blob;
84
+ if (blob.size > maxLength) {
85
+ bodyExcerpt = `<<binary data: ${blob.size} bytes>>`;
86
+ }
87
+ else {
88
+ const dataSlice = yield blob.slice(0, maxLength).arrayBuffer();
89
+ bodyExcerpt = Base64.encode(dataSlice);
90
+ }
91
+ }
92
+ }
93
+ catch (error) {
94
+ // ignore errors
95
+ const message = errorToMessage(error);
96
+ body = bodyExcerpt = `<<error displaying response data: ${message}>>`;
97
+ }
98
+ return [bodyExcerpt, body];
99
+ });
100
+ }
101
+ ResponseExample.bodyExcerpt = bodyExcerpt;
102
+ })(ResponseExample || (ResponseExample = {}));
103
+ //# sourceMappingURL=fetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/fetch.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ export declare namespace HeaderParameters {
2
+ function encode(parameters?: Record<string, unknown>): [string, string][];
3
+ }
@@ -0,0 +1,53 @@
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
+ export var HeaderParameters;
15
+ (function (HeaderParameters) {
16
+ function encode(parameters) {
17
+ if (parameters == null) {
18
+ return [];
19
+ }
20
+ const headers = [];
21
+ Object.entries(parameters).forEach(([name, parameter]) => {
22
+ for (const value of encodeParam(name, parameter)) {
23
+ headers.push([name, value]);
24
+ }
25
+ });
26
+ return headers;
27
+ }
28
+ HeaderParameters.encode = encode;
29
+ function encodeParam(name, value) {
30
+ if (value == null) {
31
+ return [];
32
+ }
33
+ if (value instanceof Array) {
34
+ const result = [];
35
+ for (const item of value) {
36
+ if (item == null) {
37
+ continue;
38
+ }
39
+ result.push(validate(name, `${item}`));
40
+ }
41
+ return result;
42
+ }
43
+ return [validate(name, `${value}`)];
44
+ }
45
+ const asciiRegex = /^[\x20-\x7F]*$/;
46
+ function validate(name, value) {
47
+ if (!asciiRegex.test(value)) {
48
+ throw new Error(`The encoded header value contains one or more invalid characters: header=${name}, value=${value}`);
49
+ }
50
+ return value;
51
+ }
52
+ })(HeaderParameters || (HeaderParameters = {}));
53
+ //# sourceMappingURL=header-parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header-parameters.js","sourceRoot":"","sources":["../../src/header-parameters.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,MAAM,KAAW,gBAAgB,CAmDhC;AAnDD,WAAiB,gBAAgB;IAC/B,SAAgB,MAAM,CACpB,UAAoC;QAEpC,IAAI,UAAU,IAAI,IAAI,EAAE;YACtB,OAAO,EAAE,CAAC;SACX;QAED,MAAM,OAAO,GAAuB,EAAE,CAAC;QAEvC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE;YACvD,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE;gBAChD,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;aAC7B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC;IAhBe,uBAAM,SAgBrB,CAAA;IAED,SAAS,WAAW,CAAC,IAAY,EAAE,KAAc;QAC/C,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,OAAO,EAAE,CAAC;SACX;QAED,IAAI,KAAK,YAAY,KAAK,EAAE;YAC1B,MAAM,MAAM,GAAa,EAAE,CAAC;YAE5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBACxB,IAAI,IAAI,IAAI,IAAI,EAAE;oBAChB,SAAS;iBACV;gBAED,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;aACxC;YAED,OAAO,MAAM,CAAC;SACf;QAED,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,UAAU,GAAG,gBAAgB,CAAC;IAEpC,SAAS,QAAQ,CAAC,IAAY,EAAE,KAAa;QAC3C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YAC3B,MAAM,IAAI,KAAK,CACb,4EAA4E,IAAI,WAAW,KAAK,EAAE,CACnG,CAAC;SACH;QACD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,EAnDgB,gBAAgB,KAAhB,gBAAgB,QAmDhC"}
@@ -0,0 +1,26 @@
1
+ export * from './any-type';
2
+ export * from './class-type';
3
+ export * from './request-factory';
4
+ export * from './fetch-request-factory';
5
+ export * from './fetch-event-source';
6
+ export * from './url-template';
7
+ export * from './media-type';
8
+ export * from './media-type-codecs/media-type-decoder';
9
+ export * from './media-type-codecs/media-type-decoders';
10
+ export * from './media-type-codecs/media-type-encoder';
11
+ export * from './media-type-codecs/media-type-encoders';
12
+ export * from './media-type-codecs/json-decoder';
13
+ export * from './media-type-codecs/json-encoder';
14
+ export * from './media-type-codecs/cbor-decoder';
15
+ export * from './media-type-codecs/cbor-encoder';
16
+ export * from './media-type-codecs/binary-decoder';
17
+ export * from './media-type-codecs/binary-encoder';
18
+ export * from './media-type-codecs/www-form-url-encoder';
19
+ export * from './logger';
20
+ export * from './sunday-error';
21
+ export * from './problem';
22
+ export * from './date-time-types';
23
+ export * from './result-response';
24
+ export * from './util/base64';
25
+ export * from './util/hex';
26
+ export * from './util/rxjs';
@@ -11,7 +11,6 @@
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
-
15
14
  export * from './any-type';
16
15
  export * from './class-type';
17
16
  export * from './request-factory';
@@ -35,7 +34,7 @@ export * from './sunday-error';
35
34
  export * from './problem';
36
35
  export * from './date-time-types';
37
36
  export * from './result-response';
38
-
39
37
  export * from './util/base64';
40
38
  export * from './util/hex';
41
39
  export * from './util/rxjs';
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAElC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ export interface Logger {
2
+ trace?(...data: unknown[]): void;
3
+ debug?(...data: unknown[]): void;
4
+ info?(...data: unknown[]): void;
5
+ log?(...data: unknown[]): void;
6
+ warn?(...data: unknown[]): void;
7
+ error?(...data: unknown[]): void;
8
+ }
@@ -0,0 +1,15 @@
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
+ export {};
15
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC"}
@@ -0,0 +1,7 @@
1
+ import { AnyType } from '../any-type';
2
+ import { TextMediaTypeDecoder } from './media-type-decoder';
3
+ export declare class AnyTextDecoder implements TextMediaTypeDecoder {
4
+ static default: AnyTextDecoder;
5
+ decode<T>(response: Response, type: AnyType): Promise<T>;
6
+ decodeText<T>(text: string, type: AnyType): T;
7
+ }
@@ -0,0 +1,40 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ export class AnyTextDecoder {
24
+ decode(response, type) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ if (type[0] != String) {
27
+ throw Error('Invalid type, expected String');
28
+ }
29
+ return (yield response.text());
30
+ });
31
+ }
32
+ decodeText(text, type) {
33
+ if (type[0] != String) {
34
+ throw Error('Invalid type, expected String');
35
+ }
36
+ return text;
37
+ }
38
+ }
39
+ AnyTextDecoder.default = new AnyTextDecoder();
40
+ //# sourceMappingURL=any-text-decoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"any-text-decoder.js","sourceRoot":"","sources":["../../../src/media-type-codecs/any-text-decoder.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;;;;AAKjC,MAAM,OAAO,cAAc;IAGnB,MAAM,CAAI,QAAkB,EAAE,IAAa;;YAC/C,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE;gBACrB,MAAM,KAAK,CAAC,+BAA+B,CAAC,CAAC;aAC9C;YACD,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAiB,CAAC;QACjD,CAAC;KAAA;IAED,UAAU,CAAI,IAAY,EAAE,IAAa;QACvC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE;YACrB,MAAM,KAAK,CAAC,+BAA+B,CAAC,CAAC;SAC9C;QACD,OAAO,IAAoB,CAAC;IAC9B,CAAC;;AAdM,sBAAO,GAAG,IAAI,cAAc,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { MediaTypeEncoder } from './media-type-encoder';
2
+ export declare class AnyTextEncoder implements MediaTypeEncoder {
3
+ static default: AnyTextEncoder;
4
+ encode(value: unknown): BodyInit;
5
+ }
@@ -0,0 +1,23 @@
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
+ export class AnyTextEncoder {
15
+ encode(value) {
16
+ if (typeof value != 'string') {
17
+ throw Error('Invalid value, expected string');
18
+ }
19
+ return value;
20
+ }
21
+ }
22
+ AnyTextEncoder.default = new AnyTextEncoder();
23
+ //# sourceMappingURL=any-text-encoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"any-text-encoder.js","sourceRoot":"","sources":["../../../src/media-type-codecs/any-text-encoder.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,MAAM,OAAO,cAAc;IAGzB,MAAM,CAAC,KAAc;QACnB,IAAI,OAAO,KAAK,IAAI,QAAQ,EAAE;YAC5B,MAAM,KAAK,CAAC,gCAAgC,CAAC,CAAC;SAC/C;QACD,OAAO,KAAK,CAAC;IACf,CAAC;;AAPM,sBAAO,GAAG,IAAI,cAAc,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { MediaTypeDecoder } from './media-type-decoder';
2
+ import { AnyConstructableType } from '../any-type';
3
+ export declare class BinaryDecoder implements MediaTypeDecoder {
4
+ static default: BinaryDecoder;
5
+ decode<T>(response: Response, type: AnyConstructableType): Promise<T>;
6
+ }
@@ -0,0 +1,40 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ export class BinaryDecoder {
24
+ decode(response, type) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ const arrayBuffer = yield response.arrayBuffer();
27
+ if (type[0] === ArrayBuffer) {
28
+ return arrayBuffer;
29
+ }
30
+ else if (type[0] === Uint8Array ||
31
+ type[0] === Int8Array ||
32
+ type[0] === DataView) {
33
+ return new type[0](arrayBuffer);
34
+ }
35
+ throw Error('Invalid value, expected ArrayBuffer, (Int|Uint)Array or DataView');
36
+ });
37
+ }
38
+ }
39
+ BinaryDecoder.default = new BinaryDecoder();
40
+ //# sourceMappingURL=binary-decoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-decoder.js","sourceRoot":"","sources":["../../../src/media-type-codecs/binary-decoder.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;;;;AAKjC,MAAM,OAAO,aAAa;IAGlB,MAAM,CAAI,QAAkB,EAAE,IAA0B;;YAC5D,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;YAEjD,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,WAAW,EAAE;gBAC3B,OAAO,WAA2B,CAAC;aACpC;iBAAM,IACL,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU;gBACtB,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS;gBACrB,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EACpB;gBACA,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAM,CAAC;aACtC;YAED,MAAM,KAAK,CACT,kEAAkE,CACnE,CAAC;QACJ,CAAC;KAAA;;AAlBM,qBAAO,GAAG,IAAI,aAAa,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { MediaTypeEncoder } from './media-type-encoder';
2
+ export declare class BinaryEncoder implements MediaTypeEncoder {
3
+ static default: BinaryEncoder;
4
+ encode(value: unknown): BodyInit;
5
+ }
@@ -0,0 +1,26 @@
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
+ export class BinaryEncoder {
15
+ encode(value) {
16
+ if (!ArrayBuffer.isView(value) &&
17
+ !(value instanceof ArrayBuffer) &&
18
+ !(value instanceof Blob) &&
19
+ !(value instanceof ReadableStream)) {
20
+ throw Error('Invalid value, expected BufferSource, Blob or ReadableStream');
21
+ }
22
+ return value;
23
+ }
24
+ }
25
+ BinaryEncoder.default = new BinaryEncoder();
26
+ //# sourceMappingURL=binary-encoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-encoder.js","sourceRoot":"","sources":["../../../src/media-type-codecs/binary-encoder.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,MAAM,OAAO,aAAa;IAGxB,MAAM,CAAC,KAAc;QACnB,IACE,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;YAC1B,CAAC,CAAC,KAAK,YAAY,WAAW,CAAC;YAC/B,CAAC,CAAC,KAAK,YAAY,IAAI,CAAC;YACxB,CAAC,CAAC,KAAK,YAAY,cAAc,CAAC,EAClC;YACA,MAAM,KAAK,CACT,8DAA8D,CAC/D,CAAC;SACH;QACD,OAAO,KAAK,CAAC;IACf,CAAC;;AAdM,qBAAO,GAAG,IAAI,aAAa,EAAE,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { AnyType } from '../any-type';
2
+ import { MediaTypeDecoder } from './media-type-decoder';
3
+ export declare class CBORDecoder implements MediaTypeDecoder {
4
+ readonly numericDateDecoding: CBORDecoder.NumericDateDecoding;
5
+ static get default(): CBORDecoder;
6
+ private readonly customDeserializers;
7
+ private readonly parser;
8
+ constructor(numericDateDecoding: CBORDecoder.NumericDateDecoding);
9
+ decode<T>(response: Response, type: AnyType): Promise<T>;
10
+ decodeData<T>(buffer: ArrayBuffer, type: AnyType): T;
11
+ private untag;
12
+ private instantDeserializer;
13
+ private zonedDateTimeDeserializer;
14
+ private offsetDateTimeDeserializer;
15
+ private offsetTimeFormatter;
16
+ private offsetTimeDeserializer;
17
+ private localDateTimeDeserializer;
18
+ private localDateDeserializer;
19
+ private localTimeDeserializer;
20
+ private dateDeserializer;
21
+ private urlDeserializer;
22
+ private arrayBufferDeserializer;
23
+ }
24
+ export declare namespace CBORDecoder {
25
+ /**
26
+ * Configures how numeric temporal values are decoded.
27
+ */
28
+ enum NumericDateDecoding {
29
+ /**
30
+ * Decode numeric temporal values assuming they are seconds with decimal
31
+ * sub-second precision.
32
+ */
33
+ DECIMAL_SECONDS_SINCE_EPOCH = 0,
34
+ /**
35
+ * Decode numeric temporal values assuming they are integer milliseconds.
36
+ */
37
+ MILLISECONDS_SINCE_EPOCH = 1
38
+ }
39
+ }