@scalar/snippetz 0.2.19 → 0.3.0

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 (483) hide show
  1. package/dist/clients.js +153 -155
  2. package/dist/clients.js.map +7 -0
  3. package/dist/httpsnippet-lite/esm/helpers/code-builder.js +44 -59
  4. package/dist/httpsnippet-lite/esm/helpers/code-builder.js.map +7 -0
  5. package/dist/httpsnippet-lite/esm/helpers/escape.js +41 -69
  6. package/dist/httpsnippet-lite/esm/helpers/escape.js.map +7 -0
  7. package/dist/httpsnippet-lite/esm/helpers/form-data.js +59 -0
  8. package/dist/httpsnippet-lite/esm/helpers/form-data.js.map +7 -0
  9. package/dist/httpsnippet-lite/esm/helpers/headers.js +23 -18
  10. package/dist/httpsnippet-lite/esm/helpers/headers.js.map +7 -0
  11. package/dist/httpsnippet-lite/esm/helpers/reducer.js +20 -0
  12. package/dist/httpsnippet-lite/esm/helpers/reducer.js.map +7 -0
  13. package/dist/httpsnippet-lite/esm/helpers/shell.js +13 -16
  14. package/dist/httpsnippet-lite/esm/helpers/shell.js.map +7 -0
  15. package/dist/httpsnippet-lite/esm/helpers/url.js +20 -0
  16. package/dist/httpsnippet-lite/esm/helpers/url.js.map +7 -0
  17. package/dist/httpsnippet-lite/esm/helpers/utils.js +16 -0
  18. package/dist/httpsnippet-lite/esm/helpers/utils.js.map +7 -0
  19. package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.d.ts.map +1 -1
  20. package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.js +72 -40
  21. package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.js.map +7 -0
  22. package/dist/httpsnippet-lite/esm/targets/c/target.js +16 -0
  23. package/dist/httpsnippet-lite/esm/targets/c/target.js.map +7 -0
  24. package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.js +149 -166
  25. package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.js.map +7 -0
  26. package/dist/httpsnippet-lite/esm/targets/clojure/target.js +16 -0
  27. package/dist/httpsnippet-lite/esm/targets/clojure/target.js.map +7 -0
  28. package/dist/httpsnippet-lite/esm/targets/csharp/httpclient/client.js +165 -161
  29. package/dist/httpsnippet-lite/esm/targets/csharp/httpclient/client.js.map +7 -0
  30. package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.js +47 -46
  31. package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.js.map +7 -0
  32. package/dist/httpsnippet-lite/esm/targets/csharp/target.js +18 -0
  33. package/dist/httpsnippet-lite/esm/targets/csharp/target.js.map +7 -0
  34. package/dist/httpsnippet-lite/esm/targets/go/native/client.d.ts.map +1 -1
  35. package/dist/httpsnippet-lite/esm/targets/go/native/client.js +167 -116
  36. package/dist/httpsnippet-lite/esm/targets/go/native/client.js.map +7 -0
  37. package/dist/httpsnippet-lite/esm/targets/go/target.js +16 -0
  38. package/dist/httpsnippet-lite/esm/targets/go/target.js.map +7 -0
  39. package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.js +37 -44
  40. package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.js.map +7 -0
  41. package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.js +41 -43
  42. package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.js.map +7 -0
  43. package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.d.ts.map +1 -1
  44. package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.js +75 -67
  45. package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.js.map +7 -0
  46. package/dist/httpsnippet-lite/esm/targets/java/target.js +22 -0
  47. package/dist/httpsnippet-lite/esm/targets/java/target.js.map +7 -0
  48. package/dist/httpsnippet-lite/esm/targets/java/unirest/client.js +37 -44
  49. package/dist/httpsnippet-lite/esm/targets/java/unirest/client.js.map +7 -0
  50. package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.js +79 -84
  51. package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.js.map +7 -0
  52. package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.js +76 -83
  53. package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.js.map +7 -0
  54. package/dist/httpsnippet-lite/esm/targets/javascript/target.js +22 -0
  55. package/dist/httpsnippet-lite/esm/targets/javascript/target.js.map +7 -0
  56. package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.js +78 -79
  57. package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.js.map +7 -0
  58. package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.d.ts.map +1 -1
  59. package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.js +75 -67
  60. package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.js.map +7 -0
  61. package/dist/httpsnippet-lite/esm/targets/kotlin/target.js +16 -0
  62. package/dist/httpsnippet-lite/esm/targets/kotlin/target.js.map +7 -0
  63. package/dist/httpsnippet-lite/esm/targets/node/axios/client.js +70 -77
  64. package/dist/httpsnippet-lite/esm/targets/node/axios/client.js.map +7 -0
  65. package/dist/httpsnippet-lite/esm/targets/node/request/client.js +100 -0
  66. package/dist/httpsnippet-lite/esm/targets/node/request/client.js.map +7 -0
  67. package/dist/httpsnippet-lite/esm/targets/node/target.js +24 -0
  68. package/dist/httpsnippet-lite/esm/targets/node/target.js.map +7 -0
  69. package/dist/httpsnippet-lite/esm/targets/objc/helpers.js +36 -52
  70. package/dist/httpsnippet-lite/esm/targets/objc/helpers.js.map +7 -0
  71. package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.js +157 -128
  72. package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.js.map +7 -0
  73. package/dist/httpsnippet-lite/esm/targets/objc/target.js +16 -0
  74. package/dist/httpsnippet-lite/esm/targets/objc/target.js.map +7 -0
  75. package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.js +50 -65
  76. package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.js.map +7 -0
  77. package/dist/httpsnippet-lite/esm/targets/ocaml/target.js +16 -0
  78. package/dist/httpsnippet-lite/esm/targets/ocaml/target.js.map +7 -0
  79. package/dist/httpsnippet-lite/esm/targets/php/helpers.js +72 -0
  80. package/dist/httpsnippet-lite/esm/targets/php/helpers.js.map +7 -0
  81. package/dist/httpsnippet-lite/esm/targets/php/http1/client.js +85 -0
  82. package/dist/httpsnippet-lite/esm/targets/php/http1/client.js.map +7 -0
  83. package/dist/httpsnippet-lite/esm/targets/php/http2/client.js +127 -0
  84. package/dist/httpsnippet-lite/esm/targets/php/http2/client.js.map +7 -0
  85. package/dist/httpsnippet-lite/esm/targets/php/target.js +22 -0
  86. package/dist/httpsnippet-lite/esm/targets/php/target.js.map +7 -0
  87. package/dist/httpsnippet-lite/esm/targets/powershell/common.js +61 -49
  88. package/dist/httpsnippet-lite/esm/targets/powershell/common.js.map +7 -0
  89. package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.js +12 -12
  90. package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.js.map +7 -0
  91. package/dist/httpsnippet-lite/esm/targets/powershell/target.js +18 -0
  92. package/dist/httpsnippet-lite/esm/targets/powershell/target.js.map +7 -0
  93. package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.js +12 -12
  94. package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.js.map +7 -0
  95. package/dist/httpsnippet-lite/esm/targets/python/helpers.js +68 -0
  96. package/dist/httpsnippet-lite/esm/targets/python/helpers.js.map +7 -0
  97. package/dist/httpsnippet-lite/esm/targets/python/python3/client.js +71 -90
  98. package/dist/httpsnippet-lite/esm/targets/python/python3/client.js.map +7 -0
  99. package/dist/httpsnippet-lite/esm/targets/python/target.js +16 -0
  100. package/dist/httpsnippet-lite/esm/targets/python/target.js.map +7 -0
  101. package/dist/httpsnippet-lite/esm/targets/r/httr/client.js +99 -124
  102. package/dist/httpsnippet-lite/esm/targets/r/httr/client.js.map +7 -0
  103. package/dist/httpsnippet-lite/esm/targets/r/target.js +16 -0
  104. package/dist/httpsnippet-lite/esm/targets/r/target.js.map +7 -0
  105. package/dist/httpsnippet-lite/esm/targets/ruby/native/client.js +69 -69
  106. package/dist/httpsnippet-lite/esm/targets/ruby/native/client.js.map +7 -0
  107. package/dist/httpsnippet-lite/esm/targets/ruby/target.js +16 -0
  108. package/dist/httpsnippet-lite/esm/targets/ruby/target.js.map +7 -0
  109. package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.d.ts.map +1 -1
  110. package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.js +106 -113
  111. package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.js.map +7 -0
  112. package/dist/httpsnippet-lite/esm/targets/shell/target.js +20 -0
  113. package/dist/httpsnippet-lite/esm/targets/shell/target.js.map +7 -0
  114. package/dist/httpsnippet-lite/esm/targets/shell/wget/client.js +42 -51
  115. package/dist/httpsnippet-lite/esm/targets/shell/wget/client.js.map +7 -0
  116. package/dist/httpsnippet-lite/esm/targets/swift/helpers.js +51 -67
  117. package/dist/httpsnippet-lite/esm/targets/swift/helpers.js.map +7 -0
  118. package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.js +132 -133
  119. package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.js.map +7 -0
  120. package/dist/httpsnippet-lite/esm/targets/swift/target.js +16 -0
  121. package/dist/httpsnippet-lite/esm/targets/swift/target.js.map +7 -0
  122. package/dist/httpsnippet-lite/types/helpers/code-builder.d.js +1 -0
  123. package/dist/httpsnippet-lite/types/helpers/code-builder.d.js.map +7 -0
  124. package/dist/httpsnippet-lite/types/helpers/escape.d.js +1 -0
  125. package/dist/httpsnippet-lite/types/helpers/escape.d.js.map +7 -0
  126. package/dist/httpsnippet-lite/types/helpers/form-data.d.js +28 -0
  127. package/dist/httpsnippet-lite/types/helpers/form-data.d.js.map +7 -0
  128. package/dist/httpsnippet-lite/types/helpers/headers.d.js +1 -0
  129. package/dist/httpsnippet-lite/types/helpers/headers.d.js.map +7 -0
  130. package/dist/httpsnippet-lite/types/helpers/reducer.d.js +1 -0
  131. package/dist/httpsnippet-lite/types/helpers/reducer.d.js.map +7 -0
  132. package/dist/httpsnippet-lite/types/helpers/shell.d.js +1 -0
  133. package/dist/httpsnippet-lite/types/helpers/shell.d.js.map +7 -0
  134. package/dist/httpsnippet-lite/types/helpers/url.d.js +1 -0
  135. package/dist/httpsnippet-lite/types/helpers/url.d.js.map +7 -0
  136. package/dist/httpsnippet-lite/types/helpers/utils.d.js +1 -0
  137. package/dist/httpsnippet-lite/types/helpers/utils.d.js.map +7 -0
  138. package/dist/httpsnippet-lite/types/httpsnippet.d.js +19 -0
  139. package/dist/httpsnippet-lite/types/httpsnippet.d.js.map +7 -0
  140. package/dist/httpsnippet-lite/types/targets/c/libcurl/client.d.js +1 -0
  141. package/dist/httpsnippet-lite/types/targets/c/libcurl/client.d.js.map +7 -0
  142. package/dist/httpsnippet-lite/types/targets/c/target.d.js +1 -0
  143. package/dist/httpsnippet-lite/types/targets/c/target.d.js.map +7 -0
  144. package/dist/httpsnippet-lite/types/targets/clojure/clj_http/client.d.js +1 -0
  145. package/dist/httpsnippet-lite/types/targets/clojure/clj_http/client.d.js.map +7 -0
  146. package/dist/httpsnippet-lite/types/targets/clojure/target.d.js +1 -0
  147. package/dist/httpsnippet-lite/types/targets/clojure/target.d.js.map +7 -0
  148. package/dist/httpsnippet-lite/types/targets/csharp/httpclient/client.d.js +1 -0
  149. package/dist/httpsnippet-lite/types/targets/csharp/httpclient/client.d.js.map +7 -0
  150. package/dist/httpsnippet-lite/types/targets/csharp/restsharp/client.d.js +1 -0
  151. package/dist/httpsnippet-lite/types/targets/csharp/restsharp/client.d.js.map +7 -0
  152. package/dist/httpsnippet-lite/types/targets/csharp/target.d.js +1 -0
  153. package/dist/httpsnippet-lite/types/targets/csharp/target.d.js.map +7 -0
  154. package/dist/httpsnippet-lite/types/targets/dart/http/client.d.js +1 -0
  155. package/dist/httpsnippet-lite/types/targets/dart/http/client.d.js.map +7 -0
  156. package/dist/httpsnippet-lite/types/targets/dart/target.d.js +1 -0
  157. package/dist/httpsnippet-lite/types/targets/dart/target.d.js.map +7 -0
  158. package/dist/httpsnippet-lite/types/targets/go/native/client.d.js +1 -0
  159. package/dist/httpsnippet-lite/types/targets/go/native/client.d.js.map +7 -0
  160. package/dist/httpsnippet-lite/types/targets/go/target.d.js +1 -0
  161. package/dist/httpsnippet-lite/types/targets/go/target.d.js.map +7 -0
  162. package/dist/httpsnippet-lite/types/targets/http/http1.1/client.d.js +1 -0
  163. package/dist/httpsnippet-lite/types/targets/http/http1.1/client.d.js.map +7 -0
  164. package/dist/httpsnippet-lite/types/targets/http/target.d.js +1 -0
  165. package/dist/httpsnippet-lite/types/targets/http/target.d.js.map +7 -0
  166. package/dist/httpsnippet-lite/types/targets/java/asynchttp/client.d.js +1 -0
  167. package/dist/httpsnippet-lite/types/targets/java/asynchttp/client.d.js.map +7 -0
  168. package/dist/httpsnippet-lite/types/targets/java/nethttp/client.d.js +1 -0
  169. package/dist/httpsnippet-lite/types/targets/java/nethttp/client.d.js.map +7 -0
  170. package/dist/httpsnippet-lite/types/targets/java/okhttp/client.d.js +1 -0
  171. package/dist/httpsnippet-lite/types/targets/java/okhttp/client.d.js.map +7 -0
  172. package/dist/httpsnippet-lite/types/targets/java/target.d.js +1 -0
  173. package/dist/httpsnippet-lite/types/targets/java/target.d.js.map +7 -0
  174. package/dist/httpsnippet-lite/types/targets/java/unirest/client.d.js +1 -0
  175. package/dist/httpsnippet-lite/types/targets/java/unirest/client.d.js.map +7 -0
  176. package/dist/httpsnippet-lite/types/targets/javascript/axios/client.d.js +1 -0
  177. package/dist/httpsnippet-lite/types/targets/javascript/axios/client.d.js.map +7 -0
  178. package/dist/httpsnippet-lite/types/targets/javascript/fetch/client.d.js +1 -0
  179. package/dist/httpsnippet-lite/types/targets/javascript/fetch/client.d.js.map +7 -0
  180. package/dist/httpsnippet-lite/types/targets/javascript/jquery/client.d.js +1 -0
  181. package/dist/httpsnippet-lite/types/targets/javascript/jquery/client.d.js.map +7 -0
  182. package/dist/httpsnippet-lite/types/targets/javascript/target.d.js +1 -0
  183. package/dist/httpsnippet-lite/types/targets/javascript/target.d.js.map +7 -0
  184. package/dist/httpsnippet-lite/types/targets/javascript/xhr/client.d.js +1 -0
  185. package/dist/httpsnippet-lite/types/targets/javascript/xhr/client.d.js.map +7 -0
  186. package/dist/httpsnippet-lite/types/targets/kotlin/okhttp/client.d.js +1 -0
  187. package/dist/httpsnippet-lite/types/targets/kotlin/okhttp/client.d.js.map +7 -0
  188. package/dist/httpsnippet-lite/types/targets/kotlin/target.d.js +1 -0
  189. package/dist/httpsnippet-lite/types/targets/kotlin/target.d.js.map +7 -0
  190. package/dist/httpsnippet-lite/types/targets/node/axios/client.d.js +1 -0
  191. package/dist/httpsnippet-lite/types/targets/node/axios/client.d.js.map +7 -0
  192. package/dist/httpsnippet-lite/types/targets/node/fetch/client.d.js +1 -0
  193. package/dist/httpsnippet-lite/types/targets/node/fetch/client.d.js.map +7 -0
  194. package/dist/httpsnippet-lite/types/targets/node/native/client.d.js +1 -0
  195. package/dist/httpsnippet-lite/types/targets/node/native/client.d.js.map +7 -0
  196. package/dist/httpsnippet-lite/types/targets/node/request/client.d.js +1 -0
  197. package/dist/httpsnippet-lite/types/targets/node/request/client.d.js.map +7 -0
  198. package/dist/httpsnippet-lite/types/targets/node/target.d.js +1 -0
  199. package/dist/httpsnippet-lite/types/targets/node/target.d.js.map +7 -0
  200. package/dist/httpsnippet-lite/types/targets/node/unirest/client.d.js +1 -0
  201. package/dist/httpsnippet-lite/types/targets/node/unirest/client.d.js.map +7 -0
  202. package/dist/httpsnippet-lite/types/targets/objc/helpers.d.js +1 -0
  203. package/dist/httpsnippet-lite/types/targets/objc/helpers.d.js.map +7 -0
  204. package/dist/httpsnippet-lite/types/targets/objc/nsurlsession/client.d.js +1 -0
  205. package/dist/httpsnippet-lite/types/targets/objc/nsurlsession/client.d.js.map +7 -0
  206. package/dist/httpsnippet-lite/types/targets/objc/target.d.js +1 -0
  207. package/dist/httpsnippet-lite/types/targets/objc/target.d.js.map +7 -0
  208. package/dist/httpsnippet-lite/types/targets/ocaml/cohttp/client.d.js +1 -0
  209. package/dist/httpsnippet-lite/types/targets/ocaml/cohttp/client.d.js.map +7 -0
  210. package/dist/httpsnippet-lite/types/targets/ocaml/target.d.js +1 -0
  211. package/dist/httpsnippet-lite/types/targets/ocaml/target.d.js.map +7 -0
  212. package/dist/httpsnippet-lite/types/targets/php/curl/client.d.js +1 -0
  213. package/dist/httpsnippet-lite/types/targets/php/curl/client.d.js.map +7 -0
  214. package/dist/httpsnippet-lite/types/targets/php/guzzle/client.d.js +1 -0
  215. package/dist/httpsnippet-lite/types/targets/php/guzzle/client.d.js.map +7 -0
  216. package/dist/httpsnippet-lite/types/targets/php/helpers.d.js +1 -0
  217. package/dist/httpsnippet-lite/types/targets/php/helpers.d.js.map +7 -0
  218. package/dist/httpsnippet-lite/types/targets/php/http1/client.d.js +1 -0
  219. package/dist/httpsnippet-lite/types/targets/php/http1/client.d.js.map +7 -0
  220. package/dist/httpsnippet-lite/types/targets/php/http2/client.d.js +1 -0
  221. package/dist/httpsnippet-lite/types/targets/php/http2/client.d.js.map +7 -0
  222. package/dist/httpsnippet-lite/types/targets/php/target.d.js +1 -0
  223. package/dist/httpsnippet-lite/types/targets/php/target.d.js.map +7 -0
  224. package/dist/httpsnippet-lite/types/targets/powershell/common.d.js +1 -0
  225. package/dist/httpsnippet-lite/types/targets/powershell/common.d.js.map +7 -0
  226. package/dist/httpsnippet-lite/types/targets/powershell/restmethod/client.d.js +1 -0
  227. package/dist/httpsnippet-lite/types/targets/powershell/restmethod/client.d.js.map +7 -0
  228. package/dist/httpsnippet-lite/types/targets/powershell/target.d.js +1 -0
  229. package/dist/httpsnippet-lite/types/targets/powershell/target.d.js.map +7 -0
  230. package/dist/httpsnippet-lite/types/targets/powershell/webrequest/client.d.js +1 -0
  231. package/dist/httpsnippet-lite/types/targets/powershell/webrequest/client.d.js.map +7 -0
  232. package/dist/httpsnippet-lite/types/targets/python/helpers.d.js +1 -0
  233. package/dist/httpsnippet-lite/types/targets/python/helpers.d.js.map +7 -0
  234. package/dist/httpsnippet-lite/types/targets/python/python3/client.d.js +1 -0
  235. package/dist/httpsnippet-lite/types/targets/python/python3/client.d.js.map +7 -0
  236. package/dist/httpsnippet-lite/types/targets/python/requests/client.d.js +1 -0
  237. package/dist/httpsnippet-lite/types/targets/python/requests/client.d.js.map +7 -0
  238. package/dist/httpsnippet-lite/types/targets/python/target.d.js +1 -0
  239. package/dist/httpsnippet-lite/types/targets/python/target.d.js.map +7 -0
  240. package/dist/httpsnippet-lite/types/targets/r/httr/client.d.js +1 -0
  241. package/dist/httpsnippet-lite/types/targets/r/httr/client.d.js.map +7 -0
  242. package/dist/httpsnippet-lite/types/targets/r/target.d.js +1 -0
  243. package/dist/httpsnippet-lite/types/targets/r/target.d.js.map +7 -0
  244. package/dist/httpsnippet-lite/types/targets/ruby/native/client.d.js +1 -0
  245. package/dist/httpsnippet-lite/types/targets/ruby/native/client.d.js.map +7 -0
  246. package/dist/httpsnippet-lite/types/targets/ruby/target.d.js +1 -0
  247. package/dist/httpsnippet-lite/types/targets/ruby/target.d.js.map +7 -0
  248. package/dist/httpsnippet-lite/types/targets/shell/curl/client.d.js +1 -0
  249. package/dist/httpsnippet-lite/types/targets/shell/curl/client.d.js.map +7 -0
  250. package/dist/httpsnippet-lite/types/targets/shell/httpie/client.d.js +1 -0
  251. package/dist/httpsnippet-lite/types/targets/shell/httpie/client.d.js.map +7 -0
  252. package/dist/httpsnippet-lite/types/targets/shell/target.d.js +1 -0
  253. package/dist/httpsnippet-lite/types/targets/shell/target.d.js.map +7 -0
  254. package/dist/httpsnippet-lite/types/targets/shell/wget/client.d.js +1 -0
  255. package/dist/httpsnippet-lite/types/targets/shell/wget/client.d.js.map +7 -0
  256. package/dist/httpsnippet-lite/types/targets/swift/helpers.d.js +1 -0
  257. package/dist/httpsnippet-lite/types/targets/swift/helpers.d.js.map +7 -0
  258. package/dist/httpsnippet-lite/types/targets/swift/nsurlsession/client.d.js +1 -0
  259. package/dist/httpsnippet-lite/types/targets/swift/nsurlsession/client.d.js.map +7 -0
  260. package/dist/httpsnippet-lite/types/targets/swift/target.d.js +1 -0
  261. package/dist/httpsnippet-lite/types/targets/swift/target.d.js.map +7 -0
  262. package/dist/httpsnippet-lite/types/targets/targets.d.js +1 -0
  263. package/dist/httpsnippet-lite/types/targets/targets.d.js.map +7 -0
  264. package/dist/index.js +3 -2
  265. package/dist/index.js.map +7 -0
  266. package/dist/plugins/c/libcurl/index.js +2 -1
  267. package/dist/plugins/c/libcurl/index.js.map +7 -0
  268. package/dist/plugins/c/libcurl/libcurl.js +12 -15
  269. package/dist/plugins/c/libcurl/libcurl.js.map +7 -0
  270. package/dist/plugins/c/libcurl/libcurl.test.js +208 -0
  271. package/dist/plugins/c/libcurl/libcurl.test.js.map +7 -0
  272. package/dist/plugins/clojure/clj_http/clj_http.js +12 -15
  273. package/dist/plugins/clojure/clj_http/clj_http.js.map +7 -0
  274. package/dist/plugins/clojure/clj_http/clj_http.test.js +151 -0
  275. package/dist/plugins/clojure/clj_http/clj_http.test.js.map +7 -0
  276. package/dist/plugins/clojure/clj_http/index.js +2 -1
  277. package/dist/plugins/clojure/clj_http/index.js.map +7 -0
  278. package/dist/plugins/csharp/httpclient/httpclient.js +12 -15
  279. package/dist/plugins/csharp/httpclient/httpclient.js.map +7 -0
  280. package/dist/plugins/csharp/httpclient/index.js +2 -1
  281. package/dist/plugins/csharp/httpclient/index.js.map +7 -0
  282. package/dist/plugins/csharp/restsharp/index.js +2 -1
  283. package/dist/plugins/csharp/restsharp/index.js.map +7 -0
  284. package/dist/plugins/csharp/restsharp/restsharp.js +12 -15
  285. package/dist/plugins/csharp/restsharp/restsharp.js.map +7 -0
  286. package/dist/plugins/dart/http/http.js +92 -96
  287. package/dist/plugins/dart/http/http.js.map +7 -0
  288. package/dist/plugins/dart/http/http.test.js +550 -0
  289. package/dist/plugins/dart/http/http.test.js.map +7 -0
  290. package/dist/plugins/dart/http/index.js +2 -1
  291. package/dist/plugins/dart/http/index.js.map +7 -0
  292. package/dist/plugins/go/native/index.js +2 -1
  293. package/dist/plugins/go/native/index.js.map +7 -0
  294. package/dist/plugins/go/native/native.js +12 -15
  295. package/dist/plugins/go/native/native.js.map +7 -0
  296. package/dist/plugins/go/native/native.test.js +366 -0
  297. package/dist/plugins/go/native/native.test.js.map +7 -0
  298. package/dist/plugins/http/http11/http11.js +84 -104
  299. package/dist/plugins/http/http11/http11.js.map +7 -0
  300. package/dist/plugins/http/http11/http11.test.js +175 -0
  301. package/dist/plugins/http/http11/http11.test.js.map +7 -0
  302. package/dist/plugins/http/http11/index.js +2 -1
  303. package/dist/plugins/http/http11/index.js.map +7 -0
  304. package/dist/plugins/java/asynchttp/asynchttp.js +12 -15
  305. package/dist/plugins/java/asynchttp/asynchttp.js.map +7 -0
  306. package/dist/plugins/java/asynchttp/index.js +2 -1
  307. package/dist/plugins/java/asynchttp/index.js.map +7 -0
  308. package/dist/plugins/java/nethttp/index.js +2 -1
  309. package/dist/plugins/java/nethttp/index.js.map +7 -0
  310. package/dist/plugins/java/nethttp/nethttp.js +12 -15
  311. package/dist/plugins/java/nethttp/nethttp.js.map +7 -0
  312. package/dist/plugins/java/okhttp/index.js +2 -1
  313. package/dist/plugins/java/okhttp/index.js.map +7 -0
  314. package/dist/plugins/java/okhttp/okhttp.js +12 -15
  315. package/dist/plugins/java/okhttp/okhttp.js.map +7 -0
  316. package/dist/plugins/java/okhttp/okhttp.test.js +164 -0
  317. package/dist/plugins/java/okhttp/okhttp.test.js.map +7 -0
  318. package/dist/plugins/java/unirest/index.js +2 -1
  319. package/dist/plugins/java/unirest/index.js.map +7 -0
  320. package/dist/plugins/java/unirest/unirest.js +12 -15
  321. package/dist/plugins/java/unirest/unirest.js.map +7 -0
  322. package/dist/plugins/js/axios/axios.js +12 -15
  323. package/dist/plugins/js/axios/axios.js.map +7 -0
  324. package/dist/plugins/js/axios/index.d.ts +1 -1
  325. package/dist/plugins/js/axios/index.d.ts.map +1 -1
  326. package/dist/plugins/js/axios/index.js +5 -1
  327. package/dist/plugins/js/axios/index.js.map +7 -0
  328. package/dist/plugins/js/fetch/fetch.d.ts.map +1 -1
  329. package/dist/plugins/js/fetch/fetch.js +67 -60
  330. package/dist/plugins/js/fetch/fetch.js.map +7 -0
  331. package/dist/plugins/js/fetch/fetch.test.js +214 -0
  332. package/dist/plugins/js/fetch/fetch.test.js.map +7 -0
  333. package/dist/plugins/js/fetch/index.d.ts +1 -1
  334. package/dist/plugins/js/fetch/index.d.ts.map +1 -1
  335. package/dist/plugins/js/fetch/index.js +5 -1
  336. package/dist/plugins/js/fetch/index.js.map +7 -0
  337. package/dist/plugins/js/jquery/index.js +2 -1
  338. package/dist/plugins/js/jquery/index.js.map +7 -0
  339. package/dist/plugins/js/jquery/jquery.js +12 -15
  340. package/dist/plugins/js/jquery/jquery.js.map +7 -0
  341. package/dist/plugins/js/ofetch/index.js +2 -1
  342. package/dist/plugins/js/ofetch/index.js.map +7 -0
  343. package/dist/plugins/js/ofetch/ofetch.d.ts.map +1 -1
  344. package/dist/plugins/js/ofetch/ofetch.js +44 -67
  345. package/dist/plugins/js/ofetch/ofetch.js.map +7 -0
  346. package/dist/plugins/js/ofetch/ofetch.test.js +126 -0
  347. package/dist/plugins/js/ofetch/ofetch.test.js.map +7 -0
  348. package/dist/plugins/js/xhr/index.js +2 -1
  349. package/dist/plugins/js/xhr/index.js.map +7 -0
  350. package/dist/plugins/js/xhr/xhr.js +12 -15
  351. package/dist/plugins/js/xhr/xhr.js.map +7 -0
  352. package/dist/plugins/kotlin/okhttp/index.js +2 -1
  353. package/dist/plugins/kotlin/okhttp/index.js.map +7 -0
  354. package/dist/plugins/kotlin/okhttp/okhttp.js +12 -15
  355. package/dist/plugins/kotlin/okhttp/okhttp.js.map +7 -0
  356. package/dist/plugins/kotlin/okhttp/okhttp.test.js +164 -0
  357. package/dist/plugins/kotlin/okhttp/okhttp.test.js.map +7 -0
  358. package/dist/plugins/node/axios/axios.js +12 -15
  359. package/dist/plugins/node/axios/axios.js.map +7 -0
  360. package/dist/plugins/node/axios/index.js +2 -1
  361. package/dist/plugins/node/axios/index.js.map +7 -0
  362. package/dist/plugins/node/fetch/fetch.d.ts.map +1 -1
  363. package/dist/plugins/node/fetch/fetch.js +73 -59
  364. package/dist/plugins/node/fetch/fetch.js.map +7 -0
  365. package/dist/plugins/node/fetch/fetch.test.js +200 -0
  366. package/dist/plugins/node/fetch/fetch.test.js.map +7 -0
  367. package/dist/plugins/node/fetch/index.js +2 -1
  368. package/dist/plugins/node/fetch/index.js.map +7 -0
  369. package/dist/plugins/node/ofetch/index.js +2 -1
  370. package/dist/plugins/node/ofetch/index.js.map +7 -0
  371. package/dist/plugins/node/ofetch/ofetch.d.ts.map +1 -1
  372. package/dist/plugins/node/ofetch/ofetch.js +44 -67
  373. package/dist/plugins/node/ofetch/ofetch.js.map +7 -0
  374. package/dist/plugins/node/ofetch/ofetch.test.js +126 -0
  375. package/dist/plugins/node/ofetch/ofetch.test.js.map +7 -0
  376. package/dist/plugins/node/undici/index.js +2 -1
  377. package/dist/plugins/node/undici/index.js.map +7 -0
  378. package/dist/plugins/node/undici/undici.d.ts.map +1 -1
  379. package/dist/plugins/node/undici/undici.js +46 -62
  380. package/dist/plugins/node/undici/undici.js.map +7 -0
  381. package/dist/plugins/node/undici/undici.test.js +133 -0
  382. package/dist/plugins/node/undici/undici.test.js.map +7 -0
  383. package/dist/plugins/objc/nsurlsession/index.js +2 -1
  384. package/dist/plugins/objc/nsurlsession/index.js.map +7 -0
  385. package/dist/plugins/objc/nsurlsession/nsurlsession.js +12 -15
  386. package/dist/plugins/objc/nsurlsession/nsurlsession.js.map +7 -0
  387. package/dist/plugins/ocaml/cohttp/cohttp.js +12 -15
  388. package/dist/plugins/ocaml/cohttp/cohttp.js.map +7 -0
  389. package/dist/plugins/ocaml/cohttp/index.js +2 -1
  390. package/dist/plugins/ocaml/cohttp/index.js.map +7 -0
  391. package/dist/plugins/php/curl/curl.js +119 -157
  392. package/dist/plugins/php/curl/curl.js.map +7 -0
  393. package/dist/plugins/php/curl/curl.test.js +564 -0
  394. package/dist/plugins/php/curl/curl.test.js.map +7 -0
  395. package/dist/plugins/php/curl/index.js +2 -1
  396. package/dist/plugins/php/curl/index.js.map +7 -0
  397. package/dist/plugins/php/guzzle/guzzle.js +115 -148
  398. package/dist/plugins/php/guzzle/guzzle.js.map +7 -0
  399. package/dist/plugins/php/guzzle/guzzle.test.js +546 -0
  400. package/dist/plugins/php/guzzle/guzzle.test.js.map +7 -0
  401. package/dist/plugins/php/guzzle/index.js +2 -1
  402. package/dist/plugins/php/guzzle/index.js.map +7 -0
  403. package/dist/plugins/powershell/restmethod/index.js +2 -1
  404. package/dist/plugins/powershell/restmethod/index.js.map +7 -0
  405. package/dist/plugins/powershell/restmethod/restmethod.js +12 -15
  406. package/dist/plugins/powershell/restmethod/restmethod.js.map +7 -0
  407. package/dist/plugins/powershell/webrequest/index.js +2 -1
  408. package/dist/plugins/powershell/webrequest/index.js.map +7 -0
  409. package/dist/plugins/powershell/webrequest/webrequest.js +12 -15
  410. package/dist/plugins/powershell/webrequest/webrequest.js.map +7 -0
  411. package/dist/plugins/python/python3/index.js +2 -1
  412. package/dist/plugins/python/python3/index.js.map +7 -0
  413. package/dist/plugins/python/python3/python3.js +12 -15
  414. package/dist/plugins/python/python3/python3.js.map +7 -0
  415. package/dist/plugins/python/requests/index.js +2 -1
  416. package/dist/plugins/python/requests/index.js.map +7 -0
  417. package/dist/plugins/python/requests/requests.d.ts.map +1 -1
  418. package/dist/plugins/python/requests/requests.js +98 -126
  419. package/dist/plugins/python/requests/requests.js.map +7 -0
  420. package/dist/plugins/python/requests/requests.test.js +419 -0
  421. package/dist/plugins/python/requests/requests.test.js.map +7 -0
  422. package/dist/plugins/r/httr/httr.js +12 -15
  423. package/dist/plugins/r/httr/httr.js.map +7 -0
  424. package/dist/plugins/r/httr/index.js +2 -1
  425. package/dist/plugins/r/httr/index.js.map +7 -0
  426. package/dist/plugins/ruby/native/index.js +2 -1
  427. package/dist/plugins/ruby/native/index.js.map +7 -0
  428. package/dist/plugins/ruby/native/native.js +12 -15
  429. package/dist/plugins/ruby/native/native.js.map +7 -0
  430. package/dist/plugins/ruby/native/native.test.js +240 -0
  431. package/dist/plugins/ruby/native/native.test.js.map +7 -0
  432. package/dist/plugins/shell/curl/curl.js +81 -114
  433. package/dist/plugins/shell/curl/curl.js.map +7 -0
  434. package/dist/plugins/shell/curl/curl.test.js +427 -0
  435. package/dist/plugins/shell/curl/curl.test.js.map +7 -0
  436. package/dist/plugins/shell/curl/index.js +2 -1
  437. package/dist/plugins/shell/curl/index.js.map +7 -0
  438. package/dist/plugins/shell/httpie/httpie.js +12 -15
  439. package/dist/plugins/shell/httpie/httpie.js.map +7 -0
  440. package/dist/plugins/shell/httpie/httpie.test.js +113 -0
  441. package/dist/plugins/shell/httpie/httpie.test.js.map +7 -0
  442. package/dist/plugins/shell/httpie/index.js +2 -1
  443. package/dist/plugins/shell/httpie/index.js.map +7 -0
  444. package/dist/plugins/shell/wget/index.js +2 -1
  445. package/dist/plugins/shell/wget/index.js.map +7 -0
  446. package/dist/plugins/shell/wget/wget.js +12 -15
  447. package/dist/plugins/shell/wget/wget.js.map +7 -0
  448. package/dist/plugins/shell/wget/wget.test.js +143 -0
  449. package/dist/plugins/shell/wget/wget.test.js.map +7 -0
  450. package/dist/plugins/swift/nsurlsession/index.js +2 -1
  451. package/dist/plugins/swift/nsurlsession/index.js.map +7 -0
  452. package/dist/plugins/swift/nsurlsession/nsurlsession.js +12 -15
  453. package/dist/plugins/swift/nsurlsession/nsurlsession.js.map +7 -0
  454. package/dist/plugins/swift/nsurlsession/nsurlsession.test.js +344 -0
  455. package/dist/plugins/swift/nsurlsession/nsurlsession.test.js.map +7 -0
  456. package/dist/snippetz.js +27 -27
  457. package/dist/snippetz.js.map +7 -0
  458. package/dist/snippetz.test.js +79 -0
  459. package/dist/snippetz.test.js.map +7 -0
  460. package/dist/utils/convertWithHttpSnippetLite.js +101 -104
  461. package/dist/utils/convertWithHttpSnippetLite.js.map +7 -0
  462. package/dist/utils/convertWithHttpSnippetLite.test.js +106 -0
  463. package/dist/utils/convertWithHttpSnippetLite.test.js.map +7 -0
  464. package/dist/utils/create-search-params.d.ts +4 -0
  465. package/dist/utils/create-search-params.d.ts.map +1 -0
  466. package/dist/utils/create-search-params.js +11 -0
  467. package/dist/utils/create-search-params.js.map +7 -0
  468. package/dist/utils/create-search-params.test.js +49 -0
  469. package/dist/utils/create-search-params.test.js.map +7 -0
  470. package/dist/utils/index.d.ts +0 -1
  471. package/dist/utils/index.d.ts.map +1 -1
  472. package/dist/utils/index.js +4 -4
  473. package/dist/utils/index.js.map +7 -0
  474. package/dist/utils/needsQuotes.js +5 -8
  475. package/dist/utils/needsQuotes.js.map +7 -0
  476. package/dist/utils/objectToString.d.ts +8 -0
  477. package/dist/utils/objectToString.d.ts.map +1 -1
  478. package/dist/utils/objectToString.js +48 -54
  479. package/dist/utils/objectToString.js.map +7 -0
  480. package/package.json +147 -151
  481. package/dist/utils/arrayToObject.d.ts +0 -8
  482. package/dist/utils/arrayToObject.d.ts.map +0 -1
  483. package/dist/utils/arrayToObject.js +0 -14
@@ -1,17 +1,14 @@
1
- import { axios } from '../../../httpsnippet-lite/esm/targets/javascript/axios/client.js';
2
- import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
-
4
- /**
5
- * js/axios
6
- */
1
+ import { axios } from "../../../httpsnippet-lite/esm/targets/javascript/axios/client.js";
2
+ import { convertWithHttpSnippetLite } from "../../../utils/convertWithHttpSnippetLite.js";
7
3
  const jsAxios = {
8
- target: 'js',
9
- client: 'axios',
10
- title: 'Axios',
11
- generate(request) {
12
- // TODO: Write an own converter
13
- return convertWithHttpSnippetLite(axios, request);
14
- },
4
+ target: "js",
5
+ client: "axios",
6
+ title: "Axios",
7
+ generate(request) {
8
+ return convertWithHttpSnippetLite(axios, request);
9
+ }
15
10
  };
16
-
17
- export { jsAxios };
11
+ export {
12
+ jsAxios
13
+ };
14
+ //# sourceMappingURL=axios.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/plugins/js/axios/axios.ts"],
4
+ "sourcesContent": ["import { axios } from '@/httpsnippet-lite/esm/targets/javascript/axios/client'\nimport { convertWithHttpSnippetLite } from '@/utils/convertWithHttpSnippetLite'\nimport type { Plugin } from '@scalar/types/snippetz'\n\n/**\n * js/axios\n */\nexport const jsAxios: Plugin = {\n target: 'js',\n client: 'axios',\n title: 'Axios',\n generate(request) {\n // TODO: Write an own converter\n return convertWithHttpSnippetLite(axios, request)\n },\n}\n"],
5
+ "mappings": "AAAA,SAAS,aAAa;AACtB,SAAS,kCAAkC;AAMpC,MAAM,UAAkB;AAAA,EAC7B,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS,SAAS;AAEhB,WAAO,2BAA2B,OAAO,OAAO;AAAA,EAClD;AACF;",
6
+ "names": []
7
+ }
@@ -1,2 +1,2 @@
1
- export * from './axios.js';
1
+ export { jsAxios } from './axios.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/axios/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/axios/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA"}
@@ -1 +1,5 @@
1
- export { jsAxios } from './axios.js';
1
+ import { jsAxios } from "./axios.js";
2
+ export {
3
+ jsAxios
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/plugins/js/axios/index.ts"],
4
+ "sourcesContent": ["export { jsAxios } from './axios'\n"],
5
+ "mappings": "AAAA,SAAS,eAAe;",
6
+ "names": []
7
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/fetch/fetch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAqErB,CAAA"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/fetch/fetch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAuFrB,CAAA"}
@@ -1,64 +1,71 @@
1
- import { arrayToObject } from '../../../utils/arrayToObject.js';
2
- import { objectToString } from '../../../utils/objectToString.js';
3
-
4
- /**
5
- * js/fetch
6
- */
1
+ import { createSearchParams } from "../../../utils/create-search-params.js";
2
+ import { objectToString, Unquoted } from "../../../utils/objectToString.js";
7
3
  const jsFetch = {
8
- target: 'js',
9
- client: 'fetch',
10
- title: 'Fetch',
11
- generate(request) {
12
- // Defaults
13
- const normalizedRequest = {
14
- method: 'GET',
15
- ...request,
16
- };
17
- // Normalization
18
- normalizedRequest.method = normalizedRequest.method.toUpperCase();
19
- // Reset fetch defaults
20
- const options = {
21
- method: normalizedRequest.method === 'GET' ? undefined : normalizedRequest.method,
22
- };
23
- // Query
24
- const searchParams = new URLSearchParams(normalizedRequest.queryString ? arrayToObject(normalizedRequest.queryString) : undefined);
25
- const queryString = searchParams.size ? `?${searchParams.toString()}` : '';
26
- // Headers
27
- if (normalizedRequest.headers?.length) {
28
- options.headers = {};
29
- normalizedRequest.headers.forEach((header) => {
30
- options.headers[header.name] = header.value;
31
- });
4
+ target: "js",
5
+ client: "fetch",
6
+ title: "Fetch",
7
+ generate(request) {
8
+ const normalizedRequest = {
9
+ method: "GET",
10
+ ...request
11
+ };
12
+ let prefix = "";
13
+ normalizedRequest.method = normalizedRequest.method.toUpperCase();
14
+ const options = {
15
+ method: normalizedRequest.method === "GET" ? void 0 : normalizedRequest.method
16
+ };
17
+ const searchParams = createSearchParams(normalizedRequest.queryString);
18
+ const queryString = searchParams.size ? `?${searchParams.toString()}` : "";
19
+ if (normalizedRequest.headers?.length) {
20
+ options.headers = {};
21
+ normalizedRequest.headers.forEach((header) => {
22
+ options.headers[header.name] = header.value;
23
+ });
24
+ }
25
+ if (normalizedRequest.cookies?.length) {
26
+ options.headers = options.headers || {};
27
+ normalizedRequest.cookies.forEach((cookie) => {
28
+ options.headers["Set-Cookie"] = options.headers["Set-Cookie"] ? `${options.headers["Set-Cookie"]}; ${cookie.name}=${cookie.value}` : `${cookie.name}=${cookie.value}`;
29
+ });
30
+ }
31
+ Object.keys(options).forEach((key) => {
32
+ if (options[key] === void 0) {
33
+ delete options[key];
34
+ }
35
+ });
36
+ if (normalizedRequest.postData) {
37
+ const { mimeType, text, params } = normalizedRequest.postData;
38
+ if (mimeType === "application/json" && text) {
39
+ try {
40
+ options.body = new Unquoted(`JSON.stringify(${objectToString(JSON.parse(text))})`);
41
+ } catch (e) {
42
+ options.body = text;
32
43
  }
33
- // Cookies
34
- if (normalizedRequest.cookies?.length) {
35
- options.headers = options.headers || {};
36
- normalizedRequest.cookies.forEach((cookie) => {
37
- options.headers['Set-Cookie'] = options.headers['Set-Cookie']
38
- ? `${options.headers['Set-Cookie']}; ${cookie.name}=${cookie.value}`
39
- : `${cookie.name}=${cookie.value}`;
40
- });
41
- }
42
- // Remove undefined keys
43
- Object.keys(options).forEach((key) => {
44
- if (options[key] === undefined) {
45
- delete options[key];
46
- }
44
+ } else if (mimeType === "multipart/form-data" && params) {
45
+ prefix = "const formData = new FormData()\n";
46
+ params.forEach((param) => {
47
+ if (param.fileName !== void 0) {
48
+ prefix += `formData.append('${param.name}', new Blob([]), '${param.fileName}')
49
+ `;
50
+ } else if (param.value !== void 0) {
51
+ prefix += `formData.append('${param.name}', '${param.value}')
52
+ `;
53
+ }
47
54
  });
48
- // Add body
49
- if (normalizedRequest.postData) {
50
- // Plain text
51
- options.body = normalizedRequest.postData.text;
52
- // JSON
53
- if (normalizedRequest.postData.mimeType === 'application/json') {
54
- options.body = `JSON.stringify(${objectToString(JSON.parse(options.body))})`;
55
- }
56
- }
57
- // Transform to JSON
58
- const jsonOptions = Object.keys(options).length ? `, ${objectToString(options)}` : '';
59
- // Code Template
60
- return `fetch('${normalizedRequest.url}${queryString}'${jsonOptions})`;
61
- },
55
+ prefix += "\n";
56
+ options.body = new Unquoted("formData");
57
+ } else if (mimeType === "application/x-www-form-urlencoded" && params) {
58
+ const form = Object.fromEntries(params.map((p) => [p.name, p.value]));
59
+ options.body = new Unquoted(`new URLSearchParams(${objectToString(form)})`);
60
+ } else {
61
+ options.body = normalizedRequest.postData.text;
62
+ }
63
+ }
64
+ const jsonOptions = Object.keys(options).length ? `, ${objectToString(options)}` : "";
65
+ return `${prefix}fetch('${normalizedRequest.url}${queryString}'${jsonOptions})`;
66
+ }
67
+ };
68
+ export {
69
+ jsFetch
62
70
  };
63
-
64
- export { jsFetch };
71
+ //# sourceMappingURL=fetch.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/plugins/js/fetch/fetch.ts"],
4
+ "sourcesContent": ["import { createSearchParams } from '@/utils/create-search-params'\nimport { objectToString, Unquoted } from '@/utils/objectToString'\nimport type { Plugin } from '@scalar/types/snippetz'\n\n/**\n * js/fetch\n */\nexport const jsFetch: Plugin = {\n target: 'js',\n client: 'fetch',\n title: 'Fetch',\n generate(request) {\n // Defaults\n const normalizedRequest = {\n method: 'GET',\n ...request,\n }\n\n let prefix = ''\n\n // Normalization\n normalizedRequest.method = normalizedRequest.method.toUpperCase()\n\n // Reset fetch defaults\n const options: Record<string, any> = {\n method: normalizedRequest.method === 'GET' ? undefined : normalizedRequest.method,\n }\n\n // Query\n const searchParams = createSearchParams(normalizedRequest.queryString)\n const queryString = searchParams.size ? `?${searchParams.toString()}` : ''\n\n // Headers\n if (normalizedRequest.headers?.length) {\n options.headers = {}\n\n normalizedRequest.headers.forEach((header) => {\n options.headers![header.name] = header.value\n })\n }\n\n // Cookies\n if (normalizedRequest.cookies?.length) {\n options.headers = options.headers || {}\n\n normalizedRequest.cookies.forEach((cookie) => {\n options.headers!['Set-Cookie'] = options.headers!['Set-Cookie']\n ? `${options.headers!['Set-Cookie']}; ${cookie.name}=${cookie.value}`\n : `${cookie.name}=${cookie.value}`\n })\n }\n\n // Remove undefined keys\n Object.keys(options).forEach((key) => {\n if (options[key] === undefined) {\n delete options[key]\n }\n })\n\n // Add body\n if (normalizedRequest.postData) {\n const { mimeType, text, params } = normalizedRequest.postData\n\n if (mimeType === 'application/json' && text) {\n try {\n options.body = new Unquoted(`JSON.stringify(${objectToString(JSON.parse(text))})`)\n } catch (e) {\n options.body = text\n }\n } else if (mimeType === 'multipart/form-data' && params) {\n prefix = 'const formData = new FormData()\\n'\n params.forEach((param) => {\n if (param.fileName !== undefined) {\n prefix += `formData.append('${param.name}', new Blob([]), '${param.fileName}')\\n`\n } else if (param.value !== undefined) {\n prefix += `formData.append('${param.name}', '${param.value}')\\n`\n }\n })\n prefix += '\\n'\n options.body = new Unquoted('formData')\n } else if (mimeType === 'application/x-www-form-urlencoded' && params) {\n const form = Object.fromEntries(params.map((p) => [p.name, p.value]))\n options.body = new Unquoted(`new URLSearchParams(${objectToString(form)})`)\n } else {\n options.body = normalizedRequest.postData.text\n }\n }\n\n // Transform to JSON\n const jsonOptions = Object.keys(options).length ? `, ${objectToString(options)}` : ''\n\n // Code Template\n return `${prefix}fetch('${normalizedRequest.url}${queryString}'${jsonOptions})`\n },\n}\n"],
5
+ "mappings": "AAAA,SAAS,0BAA0B;AACnC,SAAS,gBAAgB,gBAAgB;AAMlC,MAAM,UAAkB;AAAA,EAC7B,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS,SAAS;AAEhB,UAAM,oBAAoB;AAAA,MACxB,QAAQ;AAAA,MACR,GAAG;AAAA,IACL;AAEA,QAAI,SAAS;AAGb,sBAAkB,SAAS,kBAAkB,OAAO,YAAY;AAGhE,UAAM,UAA+B;AAAA,MACnC,QAAQ,kBAAkB,WAAW,QAAQ,SAAY,kBAAkB;AAAA,IAC7E;AAGA,UAAM,eAAe,mBAAmB,kBAAkB,WAAW;AACrE,UAAM,cAAc,aAAa,OAAO,IAAI,aAAa,SAAS,CAAC,KAAK;AAGxE,QAAI,kBAAkB,SAAS,QAAQ;AACrC,cAAQ,UAAU,CAAC;AAEnB,wBAAkB,QAAQ,QAAQ,CAAC,WAAW;AAC5C,gBAAQ,QAAS,OAAO,IAAI,IAAI,OAAO;AAAA,MACzC,CAAC;AAAA,IACH;AAGA,QAAI,kBAAkB,SAAS,QAAQ;AACrC,cAAQ,UAAU,QAAQ,WAAW,CAAC;AAEtC,wBAAkB,QAAQ,QAAQ,CAAC,WAAW;AAC5C,gBAAQ,QAAS,YAAY,IAAI,QAAQ,QAAS,YAAY,IAC1D,GAAG,QAAQ,QAAS,YAAY,CAAC,KAAK,OAAO,IAAI,IAAI,OAAO,KAAK,KACjE,GAAG,OAAO,IAAI,IAAI,OAAO,KAAK;AAAA,MACpC,CAAC;AAAA,IACH;AAGA,WAAO,KAAK,OAAO,EAAE,QAAQ,CAAC,QAAQ;AACpC,UAAI,QAAQ,GAAG,MAAM,QAAW;AAC9B,eAAO,QAAQ,GAAG;AAAA,MACpB;AAAA,IACF,CAAC;AAGD,QAAI,kBAAkB,UAAU;AAC9B,YAAM,EAAE,UAAU,MAAM,OAAO,IAAI,kBAAkB;AAErD,UAAI,aAAa,sBAAsB,MAAM;AAC3C,YAAI;AACF,kBAAQ,OAAO,IAAI,SAAS,kBAAkB,eAAe,KAAK,MAAM,IAAI,CAAC,CAAC,GAAG;AAAA,QACnF,SAAS,GAAG;AACV,kBAAQ,OAAO;AAAA,QACjB;AAAA,MACF,WAAW,aAAa,yBAAyB,QAAQ;AACvD,iBAAS;AACT,eAAO,QAAQ,CAAC,UAAU;AACxB,cAAI,MAAM,aAAa,QAAW;AAChC,sBAAU,oBAAoB,MAAM,IAAI,qBAAqB,MAAM,QAAQ;AAAA;AAAA,UAC7E,WAAW,MAAM,UAAU,QAAW;AACpC,sBAAU,oBAAoB,MAAM,IAAI,OAAO,MAAM,KAAK;AAAA;AAAA,UAC5D;AAAA,QACF,CAAC;AACD,kBAAU;AACV,gBAAQ,OAAO,IAAI,SAAS,UAAU;AAAA,MACxC,WAAW,aAAa,uCAAuC,QAAQ;AACrE,cAAM,OAAO,OAAO,YAAY,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACpE,gBAAQ,OAAO,IAAI,SAAS,uBAAuB,eAAe,IAAI,CAAC,GAAG;AAAA,MAC5E,OAAO;AACL,gBAAQ,OAAO,kBAAkB,SAAS;AAAA,MAC5C;AAAA,IACF;AAGA,UAAM,cAAc,OAAO,KAAK,OAAO,EAAE,SAAS,KAAK,eAAe,OAAO,CAAC,KAAK;AAGnF,WAAO,GAAG,MAAM,UAAU,kBAAkB,GAAG,GAAG,WAAW,IAAI,WAAW;AAAA,EAC9E;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,214 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { jsFetch } from "./fetch.js";
3
+ describe("jsFetch", () => {
4
+ it("returns a basic request", () => {
5
+ const result = jsFetch.generate({
6
+ url: "https://example.com"
7
+ });
8
+ expect(result).toBe(`fetch('https://example.com')`);
9
+ });
10
+ it("returns a POST request", () => {
11
+ const result = jsFetch.generate({
12
+ url: "https://example.com",
13
+ method: "post"
14
+ });
15
+ expect(result).toBe(`fetch('https://example.com', {
16
+ method: 'POST'
17
+ })`);
18
+ });
19
+ it("has headers", () => {
20
+ const result = jsFetch.generate({
21
+ url: "https://example.com",
22
+ headers: [
23
+ {
24
+ name: "Content-Type",
25
+ value: "application/json"
26
+ }
27
+ ]
28
+ });
29
+ expect(result).toBe(`fetch('https://example.com', {
30
+ headers: {
31
+ 'Content-Type': 'application/json'
32
+ }
33
+ })`);
34
+ });
35
+ it("doesn\u2019t add empty headers", () => {
36
+ const result = jsFetch.generate({
37
+ url: "https://example.com",
38
+ headers: []
39
+ });
40
+ expect(result).toBe(`fetch('https://example.com')`);
41
+ });
42
+ it("has JSON body", () => {
43
+ const result = jsFetch.generate({
44
+ url: "https://example.com",
45
+ method: "POST",
46
+ headers: [
47
+ {
48
+ name: "Content-Type",
49
+ value: "application/json"
50
+ }
51
+ ],
52
+ postData: {
53
+ mimeType: "application/json",
54
+ text: JSON.stringify({
55
+ hello: "world"
56
+ })
57
+ }
58
+ });
59
+ expect(result).toBe(`fetch('https://example.com', {
60
+ method: 'POST',
61
+ headers: {
62
+ 'Content-Type': 'application/json'
63
+ },
64
+ body: JSON.stringify({
65
+ hello: 'world'
66
+ })
67
+ })`);
68
+ });
69
+ it("has raw body", () => {
70
+ const result = jsFetch.generate({
71
+ url: "https://example.com",
72
+ method: "POST",
73
+ headers: [
74
+ {
75
+ name: "Content-Type",
76
+ value: "application/octet-stream"
77
+ }
78
+ ],
79
+ postData: {
80
+ mimeType: "application/octet-stream",
81
+ text: "hello world"
82
+ }
83
+ });
84
+ expect(result).toBe(`fetch('https://example.com', {
85
+ method: 'POST',
86
+ headers: {
87
+ 'Content-Type': 'application/octet-stream'
88
+ },
89
+ body: 'hello world'
90
+ })`);
91
+ });
92
+ it("has query string", () => {
93
+ const result = jsFetch.generate({
94
+ url: "https://example.com",
95
+ queryString: [
96
+ {
97
+ name: "foo",
98
+ value: "bar"
99
+ },
100
+ {
101
+ name: "bar",
102
+ value: "foo"
103
+ }
104
+ ]
105
+ });
106
+ expect(result).toBe(`fetch('https://example.com?foo=bar&bar=foo')`);
107
+ });
108
+ it("has query string with array values", () => {
109
+ const result = jsFetch.generate({
110
+ url: "https://example.com",
111
+ queryString: [
112
+ {
113
+ name: "foo",
114
+ value: "bar"
115
+ },
116
+ {
117
+ name: "foo",
118
+ value: "baz"
119
+ }
120
+ ]
121
+ });
122
+ expect(result).toBe(`fetch('https://example.com?foo=bar&foo=baz')`);
123
+ });
124
+ it("has cookies", () => {
125
+ const result = jsFetch.generate({
126
+ url: "https://example.com",
127
+ cookies: [
128
+ {
129
+ name: "foo",
130
+ value: "bar"
131
+ },
132
+ {
133
+ name: "bar",
134
+ value: "foo"
135
+ }
136
+ ]
137
+ });
138
+ expect(result).toBe(`fetch('https://example.com', {
139
+ headers: {
140
+ 'Set-Cookie': 'foo=bar; bar=foo'
141
+ }
142
+ })`);
143
+ });
144
+ it("doesn\u2019t add empty cookies", () => {
145
+ const result = jsFetch.generate({
146
+ url: "https://example.com",
147
+ cookies: []
148
+ });
149
+ expect(result).toBe(`fetch('https://example.com')`);
150
+ });
151
+ it("has urlencoded body", () => {
152
+ const result = jsFetch.generate({
153
+ url: "https://example.com",
154
+ method: "POST",
155
+ headers: [
156
+ {
157
+ name: "Content-Type",
158
+ value: "application/x-www-form-urlencoded"
159
+ }
160
+ ],
161
+ postData: {
162
+ mimeType: "application/x-www-form-urlencoded",
163
+ params: [
164
+ {
165
+ name: "foo",
166
+ value: "bar"
167
+ },
168
+ {
169
+ name: "baz",
170
+ value: "foo"
171
+ }
172
+ ]
173
+ }
174
+ });
175
+ expect(result).toBe(`fetch('https://example.com', {
176
+ method: 'POST',
177
+ headers: {
178
+ 'Content-Type': 'application/x-www-form-urlencoded'
179
+ },
180
+ body: new URLSearchParams({
181
+ foo: 'bar',
182
+ baz: 'foo'
183
+ })
184
+ })`);
185
+ });
186
+ it("has multipart body", () => {
187
+ const result = jsFetch.generate({
188
+ url: "https://example.com",
189
+ method: "POST",
190
+ postData: {
191
+ mimeType: "multipart/form-data",
192
+ params: [
193
+ {
194
+ name: "foo",
195
+ value: "bar"
196
+ },
197
+ {
198
+ name: "file",
199
+ fileName: "baz.txt"
200
+ }
201
+ ]
202
+ }
203
+ });
204
+ expect(result).toBe(`const formData = new FormData()
205
+ formData.append('foo', 'bar')
206
+ formData.append('file', new Blob([]), 'baz.txt')
207
+
208
+ fetch('https://example.com', {
209
+ method: 'POST',
210
+ body: formData
211
+ })`);
212
+ });
213
+ });
214
+ //# sourceMappingURL=fetch.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/plugins/js/fetch/fetch.test.ts"],
4
+ "sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { jsFetch } from './fetch'\n\ndescribe('jsFetch', () => {\n it('returns a basic request', () => {\n const result = jsFetch.generate({\n url: 'https://example.com',\n })\n\n expect(result).toBe(`fetch('https://example.com')`)\n })\n\n it('returns a POST request', () => {\n const result = jsFetch.generate({\n url: 'https://example.com',\n method: 'post',\n })\n\n expect(result).toBe(`fetch('https://example.com', {\n method: 'POST'\n})`)\n })\n\n it('has headers', () => {\n const result = jsFetch.generate({\n url: 'https://example.com',\n headers: [\n {\n name: 'Content-Type',\n value: 'application/json',\n },\n ],\n })\n\n expect(result).toBe(`fetch('https://example.com', {\n headers: {\n 'Content-Type': 'application/json'\n }\n})`)\n })\n\n it('doesn\u2019t add empty headers', () => {\n const result = jsFetch.generate({\n url: 'https://example.com',\n headers: [],\n })\n\n expect(result).toBe(`fetch('https://example.com')`)\n })\n\n it('has JSON body', () => {\n const result = jsFetch.generate({\n url: 'https://example.com',\n method: 'POST',\n headers: [\n {\n name: 'Content-Type',\n value: 'application/json',\n },\n ],\n postData: {\n mimeType: 'application/json',\n text: JSON.stringify({\n hello: 'world',\n }),\n },\n })\n\n expect(result).toBe(`fetch('https://example.com', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n hello: 'world'\n })\n})`)\n })\n\n it('has raw body', () => {\n const result = jsFetch.generate({\n url: 'https://example.com',\n method: 'POST',\n headers: [\n {\n name: 'Content-Type',\n value: 'application/octet-stream',\n },\n ],\n postData: {\n mimeType: 'application/octet-stream',\n text: 'hello world',\n },\n })\n\n expect(result).toBe(`fetch('https://example.com', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/octet-stream'\n },\n body: 'hello world'\n})`)\n })\n\n it('has query string', () => {\n const result = jsFetch.generate({\n url: 'https://example.com',\n queryString: [\n {\n name: 'foo',\n value: 'bar',\n },\n {\n name: 'bar',\n value: 'foo',\n },\n ],\n })\n\n expect(result).toBe(`fetch('https://example.com?foo=bar&bar=foo')`)\n })\n\n it('has query string with array values', () => {\n const result = jsFetch.generate({\n url: 'https://example.com',\n queryString: [\n {\n name: 'foo',\n value: 'bar',\n },\n {\n name: 'foo',\n value: 'baz',\n },\n ],\n })\n\n expect(result).toBe(`fetch('https://example.com?foo=bar&foo=baz')`)\n })\n\n it('has cookies', () => {\n const result = jsFetch.generate({\n url: 'https://example.com',\n cookies: [\n {\n name: 'foo',\n value: 'bar',\n },\n {\n name: 'bar',\n value: 'foo',\n },\n ],\n })\n\n expect(result).toBe(`fetch('https://example.com', {\n headers: {\n 'Set-Cookie': 'foo=bar; bar=foo'\n }\n})`)\n })\n\n it('doesn\u2019t add empty cookies', () => {\n const result = jsFetch.generate({\n url: 'https://example.com',\n cookies: [],\n })\n\n expect(result).toBe(`fetch('https://example.com')`)\n })\n\n it('has urlencoded body', () => {\n const result = jsFetch.generate({\n url: 'https://example.com',\n method: 'POST',\n headers: [\n {\n name: 'Content-Type',\n value: 'application/x-www-form-urlencoded',\n },\n ],\n postData: {\n mimeType: 'application/x-www-form-urlencoded',\n params: [\n {\n name: 'foo',\n value: 'bar',\n },\n {\n name: 'baz',\n value: 'foo',\n },\n ],\n },\n })\n\n expect(result).toBe(`fetch('https://example.com', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n },\n body: new URLSearchParams({\n foo: 'bar',\n baz: 'foo'\n })\n})`)\n })\n\n it('has multipart body', () => {\n const result = jsFetch.generate({\n url: 'https://example.com',\n method: 'POST',\n postData: {\n mimeType: 'multipart/form-data',\n params: [\n {\n name: 'foo',\n value: 'bar',\n },\n {\n name: 'file',\n fileName: 'baz.txt',\n },\n ],\n },\n })\n\n expect(result).toBe(`const formData = new FormData()\nformData.append('foo', 'bar')\nformData.append('file', new Blob([]), 'baz.txt')\n\nfetch('https://example.com', {\n method: 'POST',\n body: formData\n})`)\n })\n})\n"],
5
+ "mappings": "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",
6
+ "names": []
7
+ }
@@ -1,2 +1,2 @@
1
- export * from './fetch.js';
1
+ export { jsFetch } from './fetch.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/fetch/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/fetch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA"}
@@ -1 +1,5 @@
1
- export { jsFetch } from './fetch.js';
1
+ import { jsFetch } from "./fetch.js";
2
+ export {
3
+ jsFetch
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/plugins/js/fetch/index.ts"],
4
+ "sourcesContent": ["export { jsFetch } from './fetch'\n"],
5
+ "mappings": "AAAA,SAAS,eAAe;",
6
+ "names": []
7
+ }
@@ -1 +1,2 @@
1
- export { jsJquery } from './jquery.js';
1
+ export * from "./jquery.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/plugins/js/jquery/index.ts"],
4
+ "sourcesContent": ["export * from './jquery'\n"],
5
+ "mappings": "AAAA,cAAc;",
6
+ "names": []
7
+ }
@@ -1,17 +1,14 @@
1
- import { jquery } from '../../../httpsnippet-lite/esm/targets/javascript/jquery/client.js';
2
- import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
-
4
- /**
5
- * js/jquery
6
- */
1
+ import { jquery } from "../../../httpsnippet-lite/esm/targets/javascript/jquery/client.js";
2
+ import { convertWithHttpSnippetLite } from "../../../utils/convertWithHttpSnippetLite.js";
7
3
  const jsJquery = {
8
- target: 'js',
9
- client: 'jquery',
10
- title: 'jQuery',
11
- generate(request) {
12
- // TODO: Write an own converter
13
- return convertWithHttpSnippetLite(jquery, request);
14
- },
4
+ target: "js",
5
+ client: "jquery",
6
+ title: "jQuery",
7
+ generate(request) {
8
+ return convertWithHttpSnippetLite(jquery, request);
9
+ }
15
10
  };
16
-
17
- export { jsJquery };
11
+ export {
12
+ jsJquery
13
+ };
14
+ //# sourceMappingURL=jquery.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/plugins/js/jquery/jquery.ts"],
4
+ "sourcesContent": ["import { jquery } from '@/httpsnippet-lite/esm/targets/javascript/jquery/client'\nimport { convertWithHttpSnippetLite } from '@/utils/convertWithHttpSnippetLite'\nimport type { Plugin } from '@scalar/types/snippetz'\n\n/**\n * js/jquery\n */\nexport const jsJquery: Plugin = {\n target: 'js',\n client: 'jquery',\n title: 'jQuery',\n generate(request) {\n // TODO: Write an own converter\n return convertWithHttpSnippetLite(jquery, request)\n },\n}\n"],
5
+ "mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,kCAAkC;AAMpC,MAAM,WAAmB;AAAA,EAC9B,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS,SAAS;AAEhB,WAAO,2BAA2B,QAAQ,OAAO;AAAA,EACnD;AACF;",
6
+ "names": []
7
+ }
@@ -1 +1,2 @@
1
- export { jsOfetch } from './ofetch.js';
1
+ export * from "./ofetch.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/plugins/js/ofetch/index.ts"],
4
+ "sourcesContent": ["export * from './ofetch'\n"],
5
+ "mappings": "AAAA,cAAc;",
6
+ "names": []
7
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"ofetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/ofetch/ofetch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MA6EtB,CAAA"}
1
+ {"version":3,"file":"ofetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/ofetch/ofetch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAoEtB,CAAA"}