@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
@@ -1,243 +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 {
16
- DateTimeFormatter,
17
- Instant,
18
- LocalDate,
19
- LocalDateTime,
20
- LocalTime,
21
- OffsetDateTime,
22
- OffsetTime,
23
- Temporal,
24
- ZonedDateTime,
25
- } from '@js-joda/core';
26
- import { JsonStringifier } from '@outfoxx/jackson-js';
27
- import { URLQueryParamsEncoder } from './media-type-encoder';
28
-
29
- export class WWWFormUrlEncoder implements URLQueryParamsEncoder {
30
- static get default(): WWWFormUrlEncoder {
31
- return new WWWFormUrlEncoder(
32
- WWWFormUrlEncoder.ArrayEncoding.UNBRACKETED,
33
- WWWFormUrlEncoder.BoolEncoding.LITERAL,
34
- WWWFormUrlEncoder.DateEncoding.DECIMAL_SECONDS_SINCE_EPOCH,
35
- );
36
- }
37
-
38
- constructor(
39
- private arrayEncoding: WWWFormUrlEncoder.ArrayEncoding,
40
- private boolEncoding: WWWFormUrlEncoder.BoolEncoding,
41
- private dateEncoding: WWWFormUrlEncoder.DateEncoding,
42
- private json = new JsonStringifier(),
43
- private encoder = new TextEncoder(),
44
- ) {}
45
-
46
- encode<T = unknown>(value: T): ArrayBuffer | SharedArrayBuffer {
47
- const parameters = this.json.transform(value);
48
-
49
- return this.encoder.encode(this.encodeQueryString(parameters));
50
- }
51
-
52
- encodeQueryString(parameters: Record<string, unknown>): string {
53
- const components: string[] = [];
54
-
55
- for (const key of Object.keys(parameters).sort()) {
56
- components.push(...this.encodeQueryComponent(key, parameters[key]));
57
- }
58
- return components.join('&');
59
- }
60
-
61
- encodeQueryComponent(key: string, value: unknown): string[] {
62
- const components: string[] = [];
63
-
64
- if (value === undefined) {
65
- return components;
66
- }
67
-
68
- if (value == null) {
69
- //
70
- components.push(encodeURIComponent(key));
71
- } else if (value instanceof Array) {
72
- // encode key according to `arrayEncoding`
73
- for (const item of value) {
74
- components.push(
75
- ...this.encodeQueryComponent(
76
- encodeArrayKey(key, this.arrayEncoding),
77
- item,
78
- ),
79
- );
80
- }
81
- } else if (value instanceof Date) {
82
- //
83
- components.push(
84
- encodeURIComponent(key) +
85
- '=' +
86
- encodeURIComponent(
87
- encodeInstant(
88
- Instant.ofEpochMilli(value.getTime()),
89
- this.dateEncoding,
90
- ),
91
- ),
92
- );
93
- } else if (value instanceof Temporal) {
94
- //
95
- components.push(
96
- encodeURIComponent(key) +
97
- '=' +
98
- encodeURIComponent(encodeTemporal(value, this.dateEncoding)),
99
- );
100
- } else if (typeof value === 'boolean') {
101
- //
102
- components.push(
103
- encodeURIComponent(key) +
104
- '=' +
105
- encodeURIComponent(encodeBoolean(value, this.boolEncoding)),
106
- );
107
- } else if (typeof value === 'object') {
108
- //
109
- const rec = (value ?? {}) as Record<string, unknown>;
110
-
111
- for (const nestedKey of Object.keys(rec).sort()) {
112
- components.push(
113
- ...this.encodeQueryComponent(`${key}[${nestedKey}]`, rec[nestedKey]),
114
- );
115
- }
116
- } else {
117
- //
118
- components.push(
119
- encodeURIComponent(key) + '=' + encodeURIComponent(`${value}`),
120
- );
121
- }
122
-
123
- return components;
124
- }
125
- }
126
-
127
- function encodeArrayKey(
128
- key: string,
129
- encoding: WWWFormUrlEncoder.ArrayEncoding,
130
- ): string {
131
- return encoding === WWWFormUrlEncoder.ArrayEncoding.BRACKETED
132
- ? `${key}[]`
133
- : key;
134
- }
135
-
136
- function encodeBoolean(
137
- value: boolean,
138
- encoding: WWWFormUrlEncoder.BoolEncoding,
139
- ): string {
140
- switch (encoding) {
141
- case WWWFormUrlEncoder.BoolEncoding.NUMERIC:
142
- return value ? '1' : '0';
143
- case WWWFormUrlEncoder.BoolEncoding.LITERAL:
144
- return value ? 'true' : 'false';
145
- default:
146
- throw new Error('unknown boolean encoding');
147
- }
148
- }
149
-
150
- function encodeTemporal(
151
- value: Temporal,
152
- encoding: WWWFormUrlEncoder.DateEncoding,
153
- ): string {
154
- if (value instanceof Instant) {
155
- return encodeInstant(value, encoding);
156
- } else if (value instanceof OffsetDateTime) {
157
- if (encoding == WWWFormUrlEncoder.DateEncoding.ISO8601) {
158
- return value.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
159
- }
160
- return encodeInstant(value.toInstant(), encoding);
161
- } else if (value instanceof ZonedDateTime) {
162
- if (encoding == WWWFormUrlEncoder.DateEncoding.ISO8601) {
163
- return value.format(DateTimeFormatter.ISO_ZONED_DATE_TIME);
164
- }
165
- return encodeInstant(value.toInstant(), encoding);
166
- } else if (value instanceof LocalDateTime) {
167
- return value.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
168
- } else if (value instanceof LocalDate) {
169
- return value.format(DateTimeFormatter.ISO_LOCAL_DATE);
170
- } else if (value instanceof LocalTime) {
171
- return value.format(DateTimeFormatter.ISO_LOCAL_TIME);
172
- } else if (value instanceof OffsetTime) {
173
- return value.format(DateTimeFormatter.ISO_OFFSET_TIME);
174
- } else {
175
- throw Error('unsupported temporal value for ');
176
- }
177
- }
178
-
179
- function encodeInstant(
180
- value: Instant,
181
- encoding: WWWFormUrlEncoder.DateEncoding,
182
- ): string {
183
- switch (encoding) {
184
- case WWWFormUrlEncoder.DateEncoding.DECIMAL_SECONDS_SINCE_EPOCH:
185
- return (value.epochSecond() + value.nano() / 1_000_000_000.0).toFixed(7);
186
- case WWWFormUrlEncoder.DateEncoding.MILLISECONDS_SINCE_EPOCH:
187
- return `${value.toEpochMilli()}`;
188
- case WWWFormUrlEncoder.DateEncoding.ISO8601:
189
- return DateTimeFormatter.ISO_INSTANT.format(value);
190
- default:
191
- throw new Error('unknown date encoding');
192
- }
193
- }
194
-
195
- export namespace WWWFormUrlEncoder {
196
- /**
197
- * Configures how `Array` parameters are encoded.
198
- */
199
- export enum ArrayEncoding {
200
- /**
201
- * An empty set of square brackets is appended to the key for every value. This is the default behavior.
202
- */
203
- BRACKETED,
204
- /**
205
- * No brackets are appended. The key is encoded as is.
206
- */
207
- UNBRACKETED,
208
- }
209
-
210
- /**
211
- * Configures how `Bool` parameters are encoded.
212
- */
213
- export enum BoolEncoding {
214
- /**
215
- * Encode `true` as `1` and `false` as `0`. This is the default behavior.
216
- */
217
- NUMERIC,
218
- /**
219
- * Encode `true` and `false` as string literals.
220
- */
221
- LITERAL,
222
- }
223
-
224
- /**
225
- * Configures how `Date` parameters are encoded.
226
- */
227
- export enum DateEncoding {
228
- /**
229
- * Encode the `Date` as a UNIX timestamp (decimal seconds since epoch).
230
- */
231
- DECIMAL_SECONDS_SINCE_EPOCH,
232
-
233
- /**
234
- * Encode the `Date` as UNIX millisecond timestamp (integer milliseconds since epoch).
235
- */
236
- MILLISECONDS_SINCE_EPOCH,
237
-
238
- /**
239
- * Encode the `Date` as an ISO-8601-formatted string (in RFC 3339 format). This is the default behavior.
240
- */
241
- ISO8601,
242
- }
243
- }
package/src/media-type.ts DELETED
@@ -1,362 +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 class MediaType {
16
- type: MediaType.Type;
17
- tree: MediaType.Tree;
18
- subtype: string;
19
- suffix?: MediaType.Suffix;
20
- parameters: Record<string, string>;
21
-
22
- constructor(params: {
23
- type: MediaType.Type;
24
- tree?: MediaType.Tree;
25
- subtype: string;
26
- suffix?: MediaType.Suffix;
27
- parameters?: Record<string, string>;
28
- }) {
29
- this.type = params.type;
30
- this.tree = params.tree ?? MediaType.Tree.Standard;
31
- this.subtype = params.subtype.toLowerCase();
32
- this.suffix = params.suffix;
33
- this.parameters = Object.entries(params.parameters ?? {}).reduce(
34
- (obj, [name, value]) => {
35
- obj[name.toLowerCase()] = value.toLowerCase();
36
- return obj;
37
- },
38
- {} as Record<string, string>,
39
- );
40
- }
41
-
42
- parameter(name: MediaType.ParameterName | string): string | undefined {
43
- return this.parameters[name];
44
- }
45
-
46
- with(params: {
47
- type?: MediaType.Type;
48
- tree?: MediaType.Tree;
49
- subtype?: string;
50
- suffix?: MediaType.Suffix;
51
- parameters?: Record<string, string>;
52
- }): MediaType {
53
- return new MediaType({
54
- type: params.type ?? this.type,
55
- tree: params.tree ?? this.tree,
56
- subtype: params.subtype ?? this.subtype,
57
- suffix: params.suffix ?? this.suffix,
58
- parameters: params.parameters ?? this.parameters,
59
- });
60
- }
61
-
62
- withParameter(
63
- parameter: MediaType.ParameterName | string,
64
- value: string,
65
- ): MediaType {
66
- const parameters = Object.assign({}, this.parameters, {
67
- [parameter]: value,
68
- });
69
- return this.with({ parameters });
70
- }
71
-
72
- get value(): string {
73
- const type = this.type;
74
- const tree = this.tree;
75
- const suffix = this.suffix ? `+${this.suffix.toLowerCase()}` : '';
76
- const parameters = Object.keys(this.parameters)
77
- .sort()
78
- .map((key) => `;${key}=${this.parameters[key]}`)
79
- .join('');
80
- return `${type}/${tree}${this.subtype}${suffix}${parameters}`;
81
- }
82
-
83
- compatible(other: MediaType): boolean {
84
- if (
85
- this.type != MediaType.Type.Any &&
86
- other.type != MediaType.Type.Any &&
87
- this.type != other.type
88
- ) {
89
- return false;
90
- }
91
- if (
92
- this.tree != MediaType.Tree.Any &&
93
- other.tree != MediaType.Tree.Any &&
94
- this.tree != other.tree
95
- ) {
96
- return false;
97
- }
98
- if (
99
- this.subtype != '*' &&
100
- other.subtype != '*' &&
101
- this.subtype != other.subtype
102
- ) {
103
- return false;
104
- }
105
- if (this.suffix != other.suffix) {
106
- return false;
107
- }
108
- const thisKeys = Object.keys(this.parameters);
109
- const otherKeys = Object.keys(other.parameters);
110
- return thisKeys
111
- .filter((key) => otherKeys.includes(key))
112
- .every((key) => this.parameters[key] == other.parameters[key]);
113
- }
114
-
115
- equals(other: MediaType): boolean {
116
- if (this === other) return true;
117
-
118
- if (this.type != other.type) return false;
119
- if (this.tree != other.tree) return false;
120
- if (this.suffix != other.suffix) return false;
121
- if (this.subtype != other.subtype) return false;
122
- for (const parameterName of Object.keys(this.parameters)) {
123
- if (this.parameters[parameterName] != other.parameters[parameterName]) {
124
- return false;
125
- }
126
- }
127
- return true;
128
- }
129
-
130
- toString(): string {
131
- return this.value;
132
- }
133
- }
134
-
135
- export namespace MediaType {
136
- export enum Type {
137
- Application = 'application',
138
- Audio = 'audio',
139
- Example = 'example',
140
- Font = 'font',
141
- Image = 'image',
142
- Message = 'message',
143
- Model = 'model',
144
- Multipart = 'multipart',
145
- Text = 'text',
146
- Video = 'video',
147
- Any = '*',
148
- }
149
-
150
- export namespace Type {
151
- export function from(value: string): Type | undefined {
152
- return Object.values(Type).includes(value as Type)
153
- ? (value as Type)
154
- : undefined;
155
- }
156
- }
157
-
158
- export enum Tree {
159
- Standard = '',
160
- Vendor = 'vnd.',
161
- Personal = 'prs.',
162
- Unregistered = 'x.',
163
- Obsolete = 'x-',
164
- Any = '*',
165
- }
166
-
167
- export namespace Tree {
168
- export function from(value: string): Tree | undefined {
169
- return Object.values(Tree).includes(value as Tree)
170
- ? (value as Tree)
171
- : undefined;
172
- }
173
- }
174
-
175
- export enum Suffix {
176
- XML = 'xml',
177
- JSON = 'json',
178
- BER = 'ber',
179
- DER = 'der',
180
- FastInfoSet = 'fastinfoset',
181
- WBXML = 'wbxml',
182
- Zip = 'zip',
183
- CBOR = 'cbor',
184
- }
185
-
186
- export namespace Suffix {
187
- export function from(value: string): Suffix | undefined {
188
- return Object.values(Suffix).includes(value as Suffix)
189
- ? (value as Suffix)
190
- : undefined;
191
- }
192
- }
193
-
194
- export enum ParameterName {
195
- CharSet = 'charset',
196
- }
197
-
198
- export function from(value?: string | null): MediaType;
199
- export function from(
200
- value: string | null | undefined,
201
- def: MediaType,
202
- ): MediaType;
203
- export function from(
204
- value?: string | null,
205
- def: MediaType | undefined = undefined,
206
- ): MediaType {
207
- const reqDef = () => {
208
- if (!def) {
209
- throw Error('Invalid media type');
210
- }
211
- return def;
212
- };
213
-
214
- if (!value) {
215
- return reqDef();
216
- }
217
-
218
- fullRegex.lastIndex = 0;
219
- const match = fullRegex.exec(value);
220
- if (match?.[0] != value) {
221
- return reqDef();
222
- }
223
-
224
- const type = MediaType.Type.from(match[1]?.toLowerCase());
225
- if (!type) {
226
- return reqDef();
227
- }
228
-
229
- const tree =
230
- MediaType.Tree.from(match[2]?.toLowerCase()) ?? MediaType.Tree.Standard;
231
-
232
- const subtype = match[3]?.toLowerCase();
233
- if (!subtype) {
234
- return reqDef();
235
- }
236
-
237
- const suffix = MediaType.Suffix.from(match[4]?.toLowerCase());
238
-
239
- const parameters: Record<string, string> = {};
240
-
241
- let parametersMatch = paramRegex.exec(match[5] ?? '');
242
- while (parametersMatch?.[0]) {
243
- const name = parametersMatch[1];
244
- if (!name) continue;
245
-
246
- const value = parametersMatch[2];
247
- if (!value) continue;
248
-
249
- parameters[name.toLowerCase()] = value.toLowerCase();
250
-
251
- parametersMatch = paramRegex.exec(match[5]);
252
- }
253
-
254
- return new MediaType({
255
- type,
256
- tree,
257
- subtype,
258
- suffix,
259
- parameters,
260
- });
261
- }
262
-
263
- const fullRegex =
264
- /^((?:[a-z]+|\*))\/(x(?:-|\\.)|(?:(?:vnd|prs|x)\.)|\*)?([a-z0-9\-.]+|\*)(?:\+([a-z]+))?( *(?:; *(?:(?:[\w.-]+) *= *(?:[\w.-]+)) *)*)$/gi;
265
- const paramRegex = / *; *([\w.-]+) *= *([\w.-]+)/gi;
266
-
267
- export const Plain = new MediaType({
268
- type: MediaType.Type.Text,
269
- subtype: 'plain',
270
- });
271
- export const HTML = new MediaType({
272
- type: MediaType.Type.Text,
273
- subtype: 'html',
274
- });
275
- export const JSON = new MediaType({
276
- type: MediaType.Type.Application,
277
- subtype: 'json',
278
- });
279
- export const YAML = new MediaType({
280
- type: MediaType.Type.Application,
281
- subtype: 'yaml',
282
- });
283
- export const CBOR = new MediaType({
284
- type: MediaType.Type.Application,
285
- subtype: 'cbor',
286
- });
287
- export const EventStream = new MediaType({
288
- type: MediaType.Type.Text,
289
- subtype: 'event-stream',
290
- });
291
- export const OctetStream = new MediaType({
292
- type: MediaType.Type.Application,
293
- subtype: 'octet-stream',
294
- });
295
- export const WWWFormUrlEncoded = new MediaType({
296
- type: MediaType.Type.Application,
297
- tree: MediaType.Tree.Obsolete,
298
- subtype: 'www-form-urlencoded',
299
- });
300
- export const X509CACert = new MediaType({
301
- type: MediaType.Type.Application,
302
- tree: MediaType.Tree.Obsolete,
303
- subtype: 'x509-ca-cert',
304
- });
305
- export const X509UserCert = new MediaType({
306
- type: MediaType.Type.Application,
307
- tree: MediaType.Tree.Obsolete,
308
- subtype: 'x509-user-cert',
309
- });
310
-
311
- export const Any = new MediaType({
312
- type: MediaType.Type.Any,
313
- subtype: '*',
314
- });
315
- export const AnyText = new MediaType({
316
- type: MediaType.Type.Text,
317
- subtype: '*',
318
- });
319
- export const AnyImage = new MediaType({
320
- type: MediaType.Type.Image,
321
- subtype: '*',
322
- });
323
- export const AnyAudio = new MediaType({
324
- type: MediaType.Type.Audio,
325
- subtype: '*',
326
- });
327
- export const AnyVideo = new MediaType({
328
- type: MediaType.Type.Video,
329
- subtype: '*',
330
- });
331
-
332
- export const JSONStructured = new MediaType({
333
- type: MediaType.Type.Any,
334
- tree: MediaType.Tree.Any,
335
- subtype: '*',
336
- suffix: Suffix.JSON,
337
- });
338
- export const XMLStructured = new MediaType({
339
- type: MediaType.Type.Any,
340
- tree: MediaType.Tree.Any,
341
- subtype: '*',
342
- suffix: Suffix.XML,
343
- });
344
-
345
- export const Problem = new MediaType({
346
- type: MediaType.Type.Application,
347
- subtype: 'problem',
348
- suffix: Suffix.JSON,
349
- });
350
-
351
- export const JsonPatch = new MediaType({
352
- type: MediaType.Type.Application,
353
- subtype: 'json-patch',
354
- suffix: Suffix.JSON,
355
- });
356
-
357
- export const MergePatch = new MediaType({
358
- type: MediaType.Type.Application,
359
- subtype: 'merge-patch',
360
- suffix: Suffix.JSON,
361
- });
362
- }