@scalar/snippetz 0.5.5 → 0.6.2

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 (702) hide show
  1. package/dist/clients/index.js +5 -5
  2. package/dist/clients/index.js.map +1 -1
  3. package/dist/httpsnippet-lite/helpers/code-builder.d.ts +51 -0
  4. package/dist/httpsnippet-lite/helpers/code-builder.d.ts.map +1 -0
  5. package/dist/httpsnippet-lite/{esm/helpers → helpers}/code-builder.js +29 -0
  6. package/dist/httpsnippet-lite/helpers/code-builder.js.map +7 -0
  7. package/dist/httpsnippet-lite/{esm/helpers → helpers}/escape.d.ts +22 -3
  8. package/dist/httpsnippet-lite/helpers/escape.d.ts.map +1 -0
  9. package/dist/httpsnippet-lite/helpers/escape.js.map +7 -0
  10. package/dist/httpsnippet-lite/helpers/headers.d.ts +15 -0
  11. package/dist/httpsnippet-lite/helpers/headers.d.ts.map +1 -0
  12. package/dist/httpsnippet-lite/{esm/helpers → helpers}/headers.js +2 -13
  13. package/dist/httpsnippet-lite/helpers/headers.js.map +7 -0
  14. package/dist/httpsnippet-lite/helpers/reducer.d.ts +2 -0
  15. package/dist/httpsnippet-lite/helpers/reducer.d.ts.map +1 -0
  16. package/dist/httpsnippet-lite/helpers/reducer.js +1 -0
  17. package/dist/httpsnippet-lite/{esm/helpers → helpers}/shell.d.ts +2 -2
  18. package/dist/httpsnippet-lite/helpers/shell.d.ts.map +1 -0
  19. package/dist/httpsnippet-lite/{esm/helpers → helpers}/shell.js +4 -4
  20. package/dist/httpsnippet-lite/helpers/shell.js.map +7 -0
  21. package/dist/httpsnippet-lite/helpers/snippet-request.d.ts +33 -0
  22. package/dist/httpsnippet-lite/helpers/snippet-request.d.ts.map +1 -0
  23. package/dist/httpsnippet-lite/helpers/snippet-request.js +1 -0
  24. package/dist/httpsnippet-lite/helpers/url.d.ts +4 -0
  25. package/dist/httpsnippet-lite/helpers/url.d.ts.map +1 -0
  26. package/dist/httpsnippet-lite/helpers/url.js +9 -0
  27. package/dist/httpsnippet-lite/helpers/url.js.map +7 -0
  28. package/dist/httpsnippet-lite/targets/c/libcurl/client.d.ts +3 -0
  29. package/dist/httpsnippet-lite/targets/c/libcurl/client.d.ts.map +1 -0
  30. package/dist/httpsnippet-lite/{esm/targets → targets}/c/libcurl/client.js +7 -13
  31. package/dist/httpsnippet-lite/targets/c/libcurl/client.js.map +7 -0
  32. package/dist/httpsnippet-lite/targets/clojure/clj_http/client.d.ts +12 -0
  33. package/dist/httpsnippet-lite/targets/clojure/clj_http/client.d.ts.map +1 -0
  34. package/dist/httpsnippet-lite/{esm/targets → targets}/clojure/clj_http/client.js +7 -3
  35. package/dist/httpsnippet-lite/targets/clojure/clj_http/client.js.map +7 -0
  36. package/dist/httpsnippet-lite/targets/csharp/restsharp/client.d.ts +3 -0
  37. package/dist/httpsnippet-lite/targets/csharp/restsharp/client.d.ts.map +1 -0
  38. package/dist/httpsnippet-lite/{esm/targets → targets}/csharp/restsharp/client.js +8 -18
  39. package/dist/httpsnippet-lite/targets/csharp/restsharp/client.js.map +7 -0
  40. package/dist/httpsnippet-lite/targets/go/native/client.d.ts +12 -0
  41. package/dist/httpsnippet-lite/targets/go/native/client.d.ts.map +1 -0
  42. package/dist/httpsnippet-lite/{esm/targets → targets}/go/native/client.js +14 -35
  43. package/dist/httpsnippet-lite/targets/go/native/client.js.map +7 -0
  44. package/dist/httpsnippet-lite/targets/java/asynchttp/client.d.ts +12 -0
  45. package/dist/httpsnippet-lite/targets/java/asynchttp/client.d.ts.map +1 -0
  46. package/dist/httpsnippet-lite/{esm/targets → targets}/java/asynchttp/client.js +1 -4
  47. package/dist/httpsnippet-lite/targets/java/asynchttp/client.js.map +7 -0
  48. package/dist/httpsnippet-lite/targets/java/nethttp/client.d.ts +3 -0
  49. package/dist/httpsnippet-lite/targets/java/nethttp/client.d.ts.map +1 -0
  50. package/dist/httpsnippet-lite/{esm/targets → targets}/java/nethttp/client.js +3 -6
  51. package/dist/httpsnippet-lite/targets/java/nethttp/client.js.map +7 -0
  52. package/dist/httpsnippet-lite/targets/java/okhttp/client.d.ts +12 -0
  53. package/dist/httpsnippet-lite/targets/java/okhttp/client.d.ts.map +1 -0
  54. package/dist/httpsnippet-lite/{esm/targets → targets}/java/okhttp/client.js +5 -8
  55. package/dist/httpsnippet-lite/targets/java/okhttp/client.js.map +7 -0
  56. package/dist/httpsnippet-lite/targets/java/unirest/client.d.ts +12 -0
  57. package/dist/httpsnippet-lite/targets/java/unirest/client.d.ts.map +1 -0
  58. package/dist/httpsnippet-lite/{esm/targets → targets}/java/unirest/client.js +4 -8
  59. package/dist/httpsnippet-lite/targets/java/unirest/client.js.map +7 -0
  60. package/dist/httpsnippet-lite/targets/javascript/axios/client.d.ts +12 -0
  61. package/dist/httpsnippet-lite/targets/javascript/axios/client.d.ts.map +1 -0
  62. package/dist/httpsnippet-lite/{esm/targets → targets}/javascript/axios/client.js +6 -10
  63. package/dist/httpsnippet-lite/targets/javascript/axios/client.js.map +7 -0
  64. package/dist/httpsnippet-lite/targets/javascript/jquery/client.d.ts +3 -0
  65. package/dist/httpsnippet-lite/targets/javascript/jquery/client.d.ts.map +1 -0
  66. package/dist/httpsnippet-lite/{esm/targets → targets}/javascript/jquery/client.js +5 -11
  67. package/dist/httpsnippet-lite/targets/javascript/jquery/client.js.map +7 -0
  68. package/dist/httpsnippet-lite/targets/javascript/xhr/client.d.ts +3 -0
  69. package/dist/httpsnippet-lite/targets/javascript/xhr/client.d.ts.map +1 -0
  70. package/dist/httpsnippet-lite/{esm/targets → targets}/javascript/xhr/client.js +7 -15
  71. package/dist/httpsnippet-lite/targets/javascript/xhr/client.js.map +7 -0
  72. package/dist/httpsnippet-lite/targets/kotlin/okhttp/client.d.ts +12 -0
  73. package/dist/httpsnippet-lite/targets/kotlin/okhttp/client.d.ts.map +1 -0
  74. package/dist/httpsnippet-lite/{esm/targets → targets}/kotlin/okhttp/client.js +6 -9
  75. package/dist/httpsnippet-lite/targets/kotlin/okhttp/client.js.map +7 -0
  76. package/dist/httpsnippet-lite/targets/node/axios/client.d.ts +3 -0
  77. package/dist/httpsnippet-lite/targets/node/axios/client.d.ts.map +1 -0
  78. package/dist/httpsnippet-lite/{esm/targets → targets}/node/axios/client.js +3 -5
  79. package/dist/httpsnippet-lite/targets/node/axios/client.js.map +7 -0
  80. package/dist/httpsnippet-lite/{esm/targets → targets}/objc/helpers.d.ts +5 -11
  81. package/dist/httpsnippet-lite/targets/objc/helpers.d.ts.map +1 -0
  82. package/dist/httpsnippet-lite/{esm/targets → targets}/objc/helpers.js +7 -10
  83. package/dist/httpsnippet-lite/targets/objc/helpers.js.map +7 -0
  84. package/dist/httpsnippet-lite/targets/objc/nsurlsession/client.d.ts +12 -0
  85. package/dist/httpsnippet-lite/targets/objc/nsurlsession/client.d.ts.map +1 -0
  86. package/dist/httpsnippet-lite/{esm/targets → targets}/objc/nsurlsession/client.js +14 -51
  87. package/dist/httpsnippet-lite/targets/objc/nsurlsession/client.js.map +7 -0
  88. package/dist/httpsnippet-lite/targets/ocaml/cohttp/client.d.ts +3 -0
  89. package/dist/httpsnippet-lite/targets/ocaml/cohttp/client.d.ts.map +1 -0
  90. package/dist/httpsnippet-lite/{esm/targets → targets}/ocaml/cohttp/client.js +3 -5
  91. package/dist/httpsnippet-lite/targets/ocaml/cohttp/client.js.map +7 -0
  92. package/dist/httpsnippet-lite/targets/powershell/common.d.ts +3 -0
  93. package/dist/httpsnippet-lite/targets/powershell/common.d.ts.map +1 -0
  94. package/dist/httpsnippet-lite/{esm/targets → targets}/powershell/common.js +6 -12
  95. package/dist/httpsnippet-lite/targets/powershell/common.js.map +7 -0
  96. package/dist/httpsnippet-lite/targets/powershell/restmethod/client.d.ts +3 -0
  97. package/dist/httpsnippet-lite/targets/powershell/restmethod/client.d.ts.map +1 -0
  98. package/dist/httpsnippet-lite/targets/powershell/restmethod/client.js.map +7 -0
  99. package/dist/httpsnippet-lite/targets/powershell/webrequest/client.d.ts +3 -0
  100. package/dist/httpsnippet-lite/targets/powershell/webrequest/client.d.ts.map +1 -0
  101. package/dist/httpsnippet-lite/targets/powershell/webrequest/client.js.map +7 -0
  102. package/dist/httpsnippet-lite/targets/python/python3/client.d.ts +12 -0
  103. package/dist/httpsnippet-lite/targets/python/python3/client.d.ts.map +1 -0
  104. package/dist/httpsnippet-lite/{esm/targets → targets}/python/python3/client.js +4 -8
  105. package/dist/httpsnippet-lite/targets/python/python3/client.js.map +7 -0
  106. package/dist/httpsnippet-lite/targets/r/httr/client.d.ts +12 -0
  107. package/dist/httpsnippet-lite/targets/r/httr/client.d.ts.map +1 -0
  108. package/dist/httpsnippet-lite/{esm/targets → targets}/r/httr/client.js +5 -12
  109. package/dist/httpsnippet-lite/targets/r/httr/client.js.map +7 -0
  110. package/dist/httpsnippet-lite/targets/ruby/native/client.d.ts +3 -0
  111. package/dist/httpsnippet-lite/targets/ruby/native/client.d.ts.map +1 -0
  112. package/dist/httpsnippet-lite/{esm/targets → targets}/ruby/native/client.js +2 -2
  113. package/dist/httpsnippet-lite/targets/ruby/native/client.js.map +7 -0
  114. package/dist/httpsnippet-lite/targets/shell/httpie/client.d.ts +12 -0
  115. package/dist/httpsnippet-lite/targets/shell/httpie/client.d.ts.map +1 -0
  116. package/dist/httpsnippet-lite/{esm/targets → targets}/shell/httpie/client.js +11 -11
  117. package/dist/httpsnippet-lite/targets/shell/httpie/client.js.map +7 -0
  118. package/dist/httpsnippet-lite/targets/shell/wget/client.d.ts +12 -0
  119. package/dist/httpsnippet-lite/targets/shell/wget/client.d.ts.map +1 -0
  120. package/dist/httpsnippet-lite/{esm/targets → targets}/shell/wget/client.js +6 -6
  121. package/dist/httpsnippet-lite/targets/shell/wget/client.js.map +7 -0
  122. package/dist/httpsnippet-lite/targets/swift/helpers.d.ts +15 -0
  123. package/dist/httpsnippet-lite/targets/swift/helpers.d.ts.map +1 -0
  124. package/dist/httpsnippet-lite/{esm/targets → targets}/swift/helpers.js +9 -16
  125. package/dist/httpsnippet-lite/targets/swift/helpers.js.map +7 -0
  126. package/dist/httpsnippet-lite/targets/swift/nsurlsession/client.d.ts +12 -0
  127. package/dist/httpsnippet-lite/targets/swift/nsurlsession/client.d.ts.map +1 -0
  128. package/dist/httpsnippet-lite/{esm/targets → targets}/swift/nsurlsession/client.js +11 -32
  129. package/dist/httpsnippet-lite/targets/swift/nsurlsession/client.js.map +7 -0
  130. package/dist/httpsnippet-lite/targets/target.d.ts +19 -0
  131. package/dist/httpsnippet-lite/targets/target.d.ts.map +1 -0
  132. package/dist/httpsnippet-lite/targets/target.js +1 -0
  133. package/dist/index.d.ts +2 -2
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +8 -2
  136. package/dist/index.js.map +2 -2
  137. package/dist/plugins/c/libcurl/index.d.ts +1 -1
  138. package/dist/plugins/c/libcurl/index.d.ts.map +1 -1
  139. package/dist/plugins/c/libcurl/index.js +4 -1
  140. package/dist/plugins/c/libcurl/index.js.map +2 -2
  141. package/dist/plugins/c/libcurl/libcurl.js +1 -1
  142. package/dist/plugins/c/libcurl/libcurl.js.map +1 -1
  143. package/dist/plugins/clojure/clj_http/clj_http.d.ts.map +1 -1
  144. package/dist/plugins/clojure/clj_http/clj_http.js +1 -1
  145. package/dist/plugins/clojure/clj_http/clj_http.js.map +2 -2
  146. package/dist/plugins/clojure/clj_http/index.d.ts +1 -1
  147. package/dist/plugins/clojure/clj_http/index.d.ts.map +1 -1
  148. package/dist/plugins/clojure/clj_http/index.js +4 -1
  149. package/dist/plugins/clojure/clj_http/index.js.map +2 -2
  150. package/dist/plugins/csharp/httpclient/index.d.ts +1 -1
  151. package/dist/plugins/csharp/httpclient/index.d.ts.map +1 -1
  152. package/dist/plugins/csharp/httpclient/index.js +4 -1
  153. package/dist/plugins/csharp/httpclient/index.js.map +2 -2
  154. package/dist/plugins/csharp/restsharp/index.d.ts +1 -1
  155. package/dist/plugins/csharp/restsharp/index.d.ts.map +1 -1
  156. package/dist/plugins/csharp/restsharp/index.js +4 -1
  157. package/dist/plugins/csharp/restsharp/index.js.map +2 -2
  158. package/dist/plugins/csharp/restsharp/restsharp.d.ts.map +1 -1
  159. package/dist/plugins/csharp/restsharp/restsharp.js +1 -1
  160. package/dist/plugins/csharp/restsharp/restsharp.js.map +2 -2
  161. package/dist/plugins/dart/http/index.d.ts +1 -1
  162. package/dist/plugins/dart/http/index.d.ts.map +1 -1
  163. package/dist/plugins/dart/http/index.js +4 -1
  164. package/dist/plugins/dart/http/index.js.map +2 -2
  165. package/dist/plugins/fsharp/httpclient/index.d.ts +1 -1
  166. package/dist/plugins/fsharp/httpclient/index.d.ts.map +1 -1
  167. package/dist/plugins/fsharp/httpclient/index.js +4 -1
  168. package/dist/plugins/fsharp/httpclient/index.js.map +2 -2
  169. package/dist/plugins/go/native/index.d.ts +1 -1
  170. package/dist/plugins/go/native/index.d.ts.map +1 -1
  171. package/dist/plugins/go/native/index.js +4 -1
  172. package/dist/plugins/go/native/index.js.map +2 -2
  173. package/dist/plugins/go/native/native.d.ts.map +1 -1
  174. package/dist/plugins/go/native/native.js +1 -1
  175. package/dist/plugins/go/native/native.js.map +2 -2
  176. package/dist/plugins/http/http11/index.d.ts +1 -1
  177. package/dist/plugins/http/http11/index.d.ts.map +1 -1
  178. package/dist/plugins/http/http11/index.js +4 -1
  179. package/dist/plugins/http/http11/index.js.map +2 -2
  180. package/dist/plugins/java/asynchttp/asynchttp.d.ts.map +1 -1
  181. package/dist/plugins/java/asynchttp/asynchttp.js +1 -1
  182. package/dist/plugins/java/asynchttp/asynchttp.js.map +2 -2
  183. package/dist/plugins/java/asynchttp/index.d.ts +1 -1
  184. package/dist/plugins/java/asynchttp/index.d.ts.map +1 -1
  185. package/dist/plugins/java/asynchttp/index.js +4 -1
  186. package/dist/plugins/java/asynchttp/index.js.map +2 -2
  187. package/dist/plugins/java/nethttp/index.d.ts +1 -1
  188. package/dist/plugins/java/nethttp/index.d.ts.map +1 -1
  189. package/dist/plugins/java/nethttp/index.js +4 -1
  190. package/dist/plugins/java/nethttp/index.js.map +2 -2
  191. package/dist/plugins/java/nethttp/nethttp.d.ts.map +1 -1
  192. package/dist/plugins/java/nethttp/nethttp.js +1 -1
  193. package/dist/plugins/java/nethttp/nethttp.js.map +2 -2
  194. package/dist/plugins/java/okhttp/index.d.ts +1 -1
  195. package/dist/plugins/java/okhttp/index.d.ts.map +1 -1
  196. package/dist/plugins/java/okhttp/index.js +4 -1
  197. package/dist/plugins/java/okhttp/index.js.map +2 -2
  198. package/dist/plugins/java/okhttp/okhttp.d.ts.map +1 -1
  199. package/dist/plugins/java/okhttp/okhttp.js +1 -1
  200. package/dist/plugins/java/okhttp/okhttp.js.map +2 -2
  201. package/dist/plugins/java/unirest/index.d.ts +1 -1
  202. package/dist/plugins/java/unirest/index.d.ts.map +1 -1
  203. package/dist/plugins/java/unirest/index.js +4 -1
  204. package/dist/plugins/java/unirest/index.js.map +2 -2
  205. package/dist/plugins/java/unirest/unirest.d.ts.map +1 -1
  206. package/dist/plugins/java/unirest/unirest.js +1 -1
  207. package/dist/plugins/java/unirest/unirest.js.map +2 -2
  208. package/dist/plugins/js/axios/axios.js +1 -1
  209. package/dist/plugins/js/axios/axios.js.map +1 -1
  210. package/dist/plugins/js/fetch/fetch.js +1 -1
  211. package/dist/plugins/js/fetch/fetch.js.map +2 -2
  212. package/dist/plugins/js/jquery/index.d.ts +1 -1
  213. package/dist/plugins/js/jquery/index.d.ts.map +1 -1
  214. package/dist/plugins/js/jquery/index.js +4 -1
  215. package/dist/plugins/js/jquery/index.js.map +2 -2
  216. package/dist/plugins/js/jquery/jquery.d.ts.map +1 -1
  217. package/dist/plugins/js/jquery/jquery.js +1 -1
  218. package/dist/plugins/js/jquery/jquery.js.map +2 -2
  219. package/dist/plugins/js/ofetch/index.d.ts +1 -1
  220. package/dist/plugins/js/ofetch/index.d.ts.map +1 -1
  221. package/dist/plugins/js/ofetch/index.js +4 -1
  222. package/dist/plugins/js/ofetch/index.js.map +2 -2
  223. package/dist/plugins/js/xhr/index.d.ts +1 -1
  224. package/dist/plugins/js/xhr/index.d.ts.map +1 -1
  225. package/dist/plugins/js/xhr/index.js +4 -1
  226. package/dist/plugins/js/xhr/index.js.map +2 -2
  227. package/dist/plugins/js/xhr/xhr.d.ts.map +1 -1
  228. package/dist/plugins/js/xhr/xhr.js +1 -1
  229. package/dist/plugins/js/xhr/xhr.js.map +2 -2
  230. package/dist/plugins/kotlin/okhttp/index.d.ts +1 -1
  231. package/dist/plugins/kotlin/okhttp/index.d.ts.map +1 -1
  232. package/dist/plugins/kotlin/okhttp/index.js +4 -1
  233. package/dist/plugins/kotlin/okhttp/index.js.map +2 -2
  234. package/dist/plugins/kotlin/okhttp/okhttp.d.ts.map +1 -1
  235. package/dist/plugins/kotlin/okhttp/okhttp.js +1 -1
  236. package/dist/plugins/kotlin/okhttp/okhttp.js.map +2 -2
  237. package/dist/plugins/node/axios/axios.js +1 -1
  238. package/dist/plugins/node/axios/axios.js.map +1 -1
  239. package/dist/plugins/node/axios/index.d.ts +1 -1
  240. package/dist/plugins/node/axios/index.d.ts.map +1 -1
  241. package/dist/plugins/node/axios/index.js +4 -1
  242. package/dist/plugins/node/axios/index.js.map +2 -2
  243. package/dist/plugins/node/fetch/fetch.js +1 -1
  244. package/dist/plugins/node/fetch/fetch.js.map +2 -2
  245. package/dist/plugins/node/fetch/index.d.ts +1 -1
  246. package/dist/plugins/node/fetch/index.d.ts.map +1 -1
  247. package/dist/plugins/node/fetch/index.js +4 -1
  248. package/dist/plugins/node/fetch/index.js.map +2 -2
  249. package/dist/plugins/node/ofetch/index.d.ts +1 -1
  250. package/dist/plugins/node/ofetch/index.d.ts.map +1 -1
  251. package/dist/plugins/node/ofetch/index.js +4 -1
  252. package/dist/plugins/node/ofetch/index.js.map +2 -2
  253. package/dist/plugins/node/undici/index.d.ts +1 -1
  254. package/dist/plugins/node/undici/index.d.ts.map +1 -1
  255. package/dist/plugins/node/undici/index.js +4 -1
  256. package/dist/plugins/node/undici/index.js.map +2 -2
  257. package/dist/plugins/node/undici/undici.js +1 -1
  258. package/dist/plugins/node/undici/undici.js.map +2 -2
  259. package/dist/plugins/objc/nsurlsession/index.d.ts +1 -1
  260. package/dist/plugins/objc/nsurlsession/index.d.ts.map +1 -1
  261. package/dist/plugins/objc/nsurlsession/index.js +4 -1
  262. package/dist/plugins/objc/nsurlsession/index.js.map +2 -2
  263. package/dist/plugins/objc/nsurlsession/nsurlsession.d.ts.map +1 -1
  264. package/dist/plugins/objc/nsurlsession/nsurlsession.js +1 -1
  265. package/dist/plugins/objc/nsurlsession/nsurlsession.js.map +2 -2
  266. package/dist/plugins/ocaml/cohttp/cohttp.d.ts.map +1 -1
  267. package/dist/plugins/ocaml/cohttp/cohttp.js +1 -1
  268. package/dist/plugins/ocaml/cohttp/cohttp.js.map +2 -2
  269. package/dist/plugins/ocaml/cohttp/index.d.ts +1 -1
  270. package/dist/plugins/ocaml/cohttp/index.d.ts.map +1 -1
  271. package/dist/plugins/ocaml/cohttp/index.js +4 -1
  272. package/dist/plugins/ocaml/cohttp/index.js.map +2 -2
  273. package/dist/plugins/php/curl/index.d.ts +1 -1
  274. package/dist/plugins/php/curl/index.d.ts.map +1 -1
  275. package/dist/plugins/php/curl/index.js +4 -1
  276. package/dist/plugins/php/curl/index.js.map +2 -2
  277. package/dist/plugins/php/guzzle/index.d.ts +1 -1
  278. package/dist/plugins/php/guzzle/index.d.ts.map +1 -1
  279. package/dist/plugins/php/guzzle/index.js +4 -1
  280. package/dist/plugins/php/guzzle/index.js.map +2 -2
  281. package/dist/plugins/powershell/restmethod/index.d.ts +1 -1
  282. package/dist/plugins/powershell/restmethod/index.d.ts.map +1 -1
  283. package/dist/plugins/powershell/restmethod/index.js +4 -1
  284. package/dist/plugins/powershell/restmethod/index.js.map +2 -2
  285. package/dist/plugins/powershell/restmethod/restmethod.d.ts.map +1 -1
  286. package/dist/plugins/powershell/restmethod/restmethod.js +1 -1
  287. package/dist/plugins/powershell/restmethod/restmethod.js.map +2 -2
  288. package/dist/plugins/powershell/webrequest/index.d.ts +1 -1
  289. package/dist/plugins/powershell/webrequest/index.d.ts.map +1 -1
  290. package/dist/plugins/powershell/webrequest/index.js +4 -1
  291. package/dist/plugins/powershell/webrequest/index.js.map +2 -2
  292. package/dist/plugins/powershell/webrequest/webrequest.d.ts.map +1 -1
  293. package/dist/plugins/powershell/webrequest/webrequest.js +1 -1
  294. package/dist/plugins/powershell/webrequest/webrequest.js.map +2 -2
  295. package/dist/plugins/python/httpx/async.d.ts.map +1 -1
  296. package/dist/plugins/python/httpx/async.js.map +2 -2
  297. package/dist/plugins/python/httpx/index.d.ts +2 -2
  298. package/dist/plugins/python/httpx/index.d.ts.map +1 -1
  299. package/dist/plugins/python/httpx/index.js +6 -2
  300. package/dist/plugins/python/httpx/index.js.map +2 -2
  301. package/dist/plugins/python/httpx/sync.d.ts.map +1 -1
  302. package/dist/plugins/python/httpx/sync.js.map +2 -2
  303. package/dist/plugins/python/python3/index.d.ts +1 -1
  304. package/dist/plugins/python/python3/index.d.ts.map +1 -1
  305. package/dist/plugins/python/python3/index.js +4 -1
  306. package/dist/plugins/python/python3/index.js.map +2 -2
  307. package/dist/plugins/python/python3/python3.d.ts.map +1 -1
  308. package/dist/plugins/python/python3/python3.js +1 -1
  309. package/dist/plugins/python/python3/python3.js.map +2 -2
  310. package/dist/plugins/python/requests/index.d.ts +1 -1
  311. package/dist/plugins/python/requests/index.d.ts.map +1 -1
  312. package/dist/plugins/python/requests/index.js +4 -1
  313. package/dist/plugins/python/requests/index.js.map +2 -2
  314. package/dist/plugins/python/requests/requests.d.ts.map +1 -1
  315. package/dist/plugins/python/requests/requests.js.map +2 -2
  316. package/dist/plugins/r/httr/httr.d.ts.map +1 -1
  317. package/dist/plugins/r/httr/httr.js +1 -1
  318. package/dist/plugins/r/httr/httr.js.map +2 -2
  319. package/dist/plugins/r/httr/index.d.ts +1 -1
  320. package/dist/plugins/r/httr/index.d.ts.map +1 -1
  321. package/dist/plugins/r/httr/index.js +4 -1
  322. package/dist/plugins/r/httr/index.js.map +2 -2
  323. package/dist/plugins/ruby/native/index.d.ts +1 -1
  324. package/dist/plugins/ruby/native/index.d.ts.map +1 -1
  325. package/dist/plugins/ruby/native/index.js +4 -1
  326. package/dist/plugins/ruby/native/index.js.map +2 -2
  327. package/dist/plugins/ruby/native/native.d.ts.map +1 -1
  328. package/dist/plugins/ruby/native/native.js +1 -1
  329. package/dist/plugins/ruby/native/native.js.map +2 -2
  330. package/dist/plugins/rust/reqwest/index.d.ts +1 -1
  331. package/dist/plugins/rust/reqwest/index.d.ts.map +1 -1
  332. package/dist/plugins/rust/reqwest/index.js +4 -1
  333. package/dist/plugins/rust/reqwest/index.js.map +2 -2
  334. package/dist/plugins/shell/curl/index.d.ts +1 -1
  335. package/dist/plugins/shell/curl/index.d.ts.map +1 -1
  336. package/dist/plugins/shell/curl/index.js +4 -1
  337. package/dist/plugins/shell/curl/index.js.map +2 -2
  338. package/dist/plugins/shell/httpie/httpie.d.ts.map +1 -1
  339. package/dist/plugins/shell/httpie/httpie.js +1 -1
  340. package/dist/plugins/shell/httpie/httpie.js.map +2 -2
  341. package/dist/plugins/shell/httpie/index.d.ts +1 -1
  342. package/dist/plugins/shell/httpie/index.d.ts.map +1 -1
  343. package/dist/plugins/shell/httpie/index.js +4 -1
  344. package/dist/plugins/shell/httpie/index.js.map +2 -2
  345. package/dist/plugins/shell/wget/index.d.ts +1 -1
  346. package/dist/plugins/shell/wget/index.d.ts.map +1 -1
  347. package/dist/plugins/shell/wget/index.js +4 -1
  348. package/dist/plugins/shell/wget/index.js.map +2 -2
  349. package/dist/plugins/shell/wget/wget.d.ts.map +1 -1
  350. package/dist/plugins/shell/wget/wget.js +1 -1
  351. package/dist/plugins/shell/wget/wget.js.map +2 -2
  352. package/dist/plugins/swift/nsurlsession/index.d.ts +1 -1
  353. package/dist/plugins/swift/nsurlsession/index.d.ts.map +1 -1
  354. package/dist/plugins/swift/nsurlsession/index.js +4 -1
  355. package/dist/plugins/swift/nsurlsession/index.js.map +2 -2
  356. package/dist/plugins/swift/nsurlsession/nsurlsession.d.ts.map +1 -1
  357. package/dist/plugins/swift/nsurlsession/nsurlsession.js +1 -1
  358. package/dist/plugins/swift/nsurlsession/nsurlsession.js.map +2 -2
  359. package/dist/snippetz.d.ts +2 -2
  360. package/dist/snippetz.d.ts.map +1 -1
  361. package/dist/snippetz.js.map +2 -2
  362. package/dist/utils/convertWithHttpSnippetLite.js +1 -1
  363. package/dist/utils/convertWithHttpSnippetLite.js.map +2 -2
  364. package/dist/utils/index.d.ts +1 -1
  365. package/dist/utils/index.d.ts.map +1 -1
  366. package/dist/utils/index.js +4 -1
  367. package/dist/utils/index.js.map +2 -2
  368. package/package.json +4 -3
  369. package/dist/httpsnippet-lite/esm/helpers/code-builder.d.ts +0 -8
  370. package/dist/httpsnippet-lite/esm/helpers/code-builder.d.ts.map +0 -1
  371. package/dist/httpsnippet-lite/esm/helpers/code-builder.js.map +0 -7
  372. package/dist/httpsnippet-lite/esm/helpers/escape.d.ts.map +0 -1
  373. package/dist/httpsnippet-lite/esm/helpers/escape.js.map +0 -7
  374. package/dist/httpsnippet-lite/esm/helpers/form-data.d.ts +0 -3
  375. package/dist/httpsnippet-lite/esm/helpers/form-data.d.ts.map +0 -1
  376. package/dist/httpsnippet-lite/esm/helpers/form-data.js +0 -59
  377. package/dist/httpsnippet-lite/esm/helpers/form-data.js.map +0 -7
  378. package/dist/httpsnippet-lite/esm/helpers/headers.d.ts +0 -17
  379. package/dist/httpsnippet-lite/esm/helpers/headers.d.ts.map +0 -1
  380. package/dist/httpsnippet-lite/esm/helpers/headers.js.map +0 -7
  381. package/dist/httpsnippet-lite/esm/helpers/reducer.d.ts +0 -2
  382. package/dist/httpsnippet-lite/esm/helpers/reducer.d.ts.map +0 -1
  383. package/dist/httpsnippet-lite/esm/helpers/reducer.js +0 -20
  384. package/dist/httpsnippet-lite/esm/helpers/reducer.js.map +0 -7
  385. package/dist/httpsnippet-lite/esm/helpers/shell.d.ts.map +0 -1
  386. package/dist/httpsnippet-lite/esm/helpers/shell.js.map +0 -7
  387. package/dist/httpsnippet-lite/esm/helpers/url.d.ts +0 -5
  388. package/dist/httpsnippet-lite/esm/helpers/url.d.ts.map +0 -1
  389. package/dist/httpsnippet-lite/esm/helpers/url.js +0 -20
  390. package/dist/httpsnippet-lite/esm/helpers/url.js.map +0 -7
  391. package/dist/httpsnippet-lite/esm/helpers/utils.d.ts +0 -3
  392. package/dist/httpsnippet-lite/esm/helpers/utils.d.ts.map +0 -1
  393. package/dist/httpsnippet-lite/esm/helpers/utils.js +0 -16
  394. package/dist/httpsnippet-lite/esm/helpers/utils.js.map +0 -7
  395. package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.d.ts +0 -16
  396. package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.d.ts.map +0 -1
  397. package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.js.map +0 -7
  398. package/dist/httpsnippet-lite/esm/targets/c/target.d.ts +0 -26
  399. package/dist/httpsnippet-lite/esm/targets/c/target.d.ts.map +0 -1
  400. package/dist/httpsnippet-lite/esm/targets/c/target.js +0 -16
  401. package/dist/httpsnippet-lite/esm/targets/c/target.js.map +0 -7
  402. package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.d.ts +0 -16
  403. package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.d.ts.map +0 -1
  404. package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.js.map +0 -7
  405. package/dist/httpsnippet-lite/esm/targets/clojure/target.d.ts +0 -26
  406. package/dist/httpsnippet-lite/esm/targets/clojure/target.d.ts.map +0 -1
  407. package/dist/httpsnippet-lite/esm/targets/clojure/target.js +0 -16
  408. package/dist/httpsnippet-lite/esm/targets/clojure/target.js.map +0 -7
  409. package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.d.ts +0 -17
  410. package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.d.ts.map +0 -1
  411. package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.js.map +0 -7
  412. package/dist/httpsnippet-lite/esm/targets/csharp/target.d.ts +0 -27
  413. package/dist/httpsnippet-lite/esm/targets/csharp/target.d.ts.map +0 -1
  414. package/dist/httpsnippet-lite/esm/targets/csharp/target.js +0 -16
  415. package/dist/httpsnippet-lite/esm/targets/csharp/target.js.map +0 -7
  416. package/dist/httpsnippet-lite/esm/targets/go/native/client.d.ts +0 -15
  417. package/dist/httpsnippet-lite/esm/targets/go/native/client.d.ts.map +0 -1
  418. package/dist/httpsnippet-lite/esm/targets/go/native/client.js.map +0 -7
  419. package/dist/httpsnippet-lite/esm/targets/go/target.d.ts +0 -25
  420. package/dist/httpsnippet-lite/esm/targets/go/target.d.ts.map +0 -1
  421. package/dist/httpsnippet-lite/esm/targets/go/target.js +0 -16
  422. package/dist/httpsnippet-lite/esm/targets/go/target.js.map +0 -7
  423. package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.d.ts +0 -15
  424. package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.d.ts.map +0 -1
  425. package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.js.map +0 -7
  426. package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.d.ts +0 -15
  427. package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.d.ts.map +0 -1
  428. package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.js.map +0 -7
  429. package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.d.ts +0 -15
  430. package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.d.ts.map +0 -1
  431. package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.js.map +0 -7
  432. package/dist/httpsnippet-lite/esm/targets/java/target.d.ts +0 -67
  433. package/dist/httpsnippet-lite/esm/targets/java/target.d.ts.map +0 -1
  434. package/dist/httpsnippet-lite/esm/targets/java/target.js +0 -22
  435. package/dist/httpsnippet-lite/esm/targets/java/target.js.map +0 -7
  436. package/dist/httpsnippet-lite/esm/targets/java/unirest/client.d.ts +0 -15
  437. package/dist/httpsnippet-lite/esm/targets/java/unirest/client.d.ts.map +0 -1
  438. package/dist/httpsnippet-lite/esm/targets/java/unirest/client.js.map +0 -7
  439. package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.d.ts +0 -16
  440. package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.d.ts.map +0 -1
  441. package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.js.map +0 -7
  442. package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.d.ts +0 -15
  443. package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.d.ts.map +0 -1
  444. package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.js.map +0 -7
  445. package/dist/httpsnippet-lite/esm/targets/javascript/target.d.ts +0 -55
  446. package/dist/httpsnippet-lite/esm/targets/javascript/target.d.ts.map +0 -1
  447. package/dist/httpsnippet-lite/esm/targets/javascript/target.js +0 -22
  448. package/dist/httpsnippet-lite/esm/targets/javascript/target.js.map +0 -7
  449. package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.d.ts +0 -15
  450. package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.d.ts.map +0 -1
  451. package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.js.map +0 -7
  452. package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.d.ts +0 -15
  453. package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.d.ts.map +0 -1
  454. package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.js.map +0 -7
  455. package/dist/httpsnippet-lite/esm/targets/kotlin/target.d.ts +0 -25
  456. package/dist/httpsnippet-lite/esm/targets/kotlin/target.d.ts.map +0 -1
  457. package/dist/httpsnippet-lite/esm/targets/kotlin/target.js +0 -16
  458. package/dist/httpsnippet-lite/esm/targets/kotlin/target.js.map +0 -7
  459. package/dist/httpsnippet-lite/esm/targets/node/axios/client.d.ts +0 -16
  460. package/dist/httpsnippet-lite/esm/targets/node/axios/client.d.ts.map +0 -1
  461. package/dist/httpsnippet-lite/esm/targets/node/axios/client.js.map +0 -7
  462. package/dist/httpsnippet-lite/esm/targets/node/request/client.d.ts +0 -17
  463. package/dist/httpsnippet-lite/esm/targets/node/request/client.d.ts.map +0 -1
  464. package/dist/httpsnippet-lite/esm/targets/node/request/client.js +0 -100
  465. package/dist/httpsnippet-lite/esm/targets/node/request/client.js.map +0 -7
  466. package/dist/httpsnippet-lite/esm/targets/node/target.d.ts +0 -45
  467. package/dist/httpsnippet-lite/esm/targets/node/target.d.ts.map +0 -1
  468. package/dist/httpsnippet-lite/esm/targets/node/target.js +0 -24
  469. package/dist/httpsnippet-lite/esm/targets/node/target.js.map +0 -7
  470. package/dist/httpsnippet-lite/esm/targets/objc/helpers.d.ts.map +0 -1
  471. package/dist/httpsnippet-lite/esm/targets/objc/helpers.js.map +0 -7
  472. package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.d.ts +0 -15
  473. package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.d.ts.map +0 -1
  474. package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.js.map +0 -7
  475. package/dist/httpsnippet-lite/esm/targets/objc/target.d.ts +0 -25
  476. package/dist/httpsnippet-lite/esm/targets/objc/target.d.ts.map +0 -1
  477. package/dist/httpsnippet-lite/esm/targets/objc/target.js +0 -16
  478. package/dist/httpsnippet-lite/esm/targets/objc/target.js.map +0 -7
  479. package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.d.ts +0 -15
  480. package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.d.ts.map +0 -1
  481. package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.js.map +0 -7
  482. package/dist/httpsnippet-lite/esm/targets/ocaml/target.d.ts +0 -25
  483. package/dist/httpsnippet-lite/esm/targets/ocaml/target.d.ts.map +0 -1
  484. package/dist/httpsnippet-lite/esm/targets/ocaml/target.js +0 -16
  485. package/dist/httpsnippet-lite/esm/targets/ocaml/target.js.map +0 -7
  486. package/dist/httpsnippet-lite/esm/targets/php/helpers.d.ts +0 -3
  487. package/dist/httpsnippet-lite/esm/targets/php/helpers.d.ts.map +0 -1
  488. package/dist/httpsnippet-lite/esm/targets/php/helpers.js +0 -72
  489. package/dist/httpsnippet-lite/esm/targets/php/helpers.js.map +0 -7
  490. package/dist/httpsnippet-lite/esm/targets/php/http1/client.d.ts +0 -17
  491. package/dist/httpsnippet-lite/esm/targets/php/http1/client.d.ts.map +0 -1
  492. package/dist/httpsnippet-lite/esm/targets/php/http1/client.js +0 -85
  493. package/dist/httpsnippet-lite/esm/targets/php/http1/client.js.map +0 -7
  494. package/dist/httpsnippet-lite/esm/targets/php/http2/client.d.ts +0 -17
  495. package/dist/httpsnippet-lite/esm/targets/php/http2/client.d.ts.map +0 -1
  496. package/dist/httpsnippet-lite/esm/targets/php/http2/client.js +0 -127
  497. package/dist/httpsnippet-lite/esm/targets/php/http2/client.js.map +0 -7
  498. package/dist/httpsnippet-lite/esm/targets/php/target.d.ts +0 -45
  499. package/dist/httpsnippet-lite/esm/targets/php/target.d.ts.map +0 -1
  500. package/dist/httpsnippet-lite/esm/targets/php/target.js +0 -22
  501. package/dist/httpsnippet-lite/esm/targets/php/target.js.map +0 -7
  502. package/dist/httpsnippet-lite/esm/targets/powershell/common.d.ts +0 -10
  503. package/dist/httpsnippet-lite/esm/targets/powershell/common.d.ts.map +0 -1
  504. package/dist/httpsnippet-lite/esm/targets/powershell/common.js.map +0 -7
  505. package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.d.ts +0 -18
  506. package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.d.ts.map +0 -1
  507. package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.js.map +0 -7
  508. package/dist/httpsnippet-lite/esm/targets/powershell/target.d.ts +0 -45
  509. package/dist/httpsnippet-lite/esm/targets/powershell/target.d.ts.map +0 -1
  510. package/dist/httpsnippet-lite/esm/targets/powershell/target.js +0 -18
  511. package/dist/httpsnippet-lite/esm/targets/powershell/target.js.map +0 -7
  512. package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.d.ts +0 -18
  513. package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.d.ts.map +0 -1
  514. package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.js.map +0 -7
  515. package/dist/httpsnippet-lite/esm/targets/python/helpers.d.ts +0 -9
  516. package/dist/httpsnippet-lite/esm/targets/python/helpers.d.ts.map +0 -1
  517. package/dist/httpsnippet-lite/esm/targets/python/helpers.js +0 -68
  518. package/dist/httpsnippet-lite/esm/targets/python/helpers.js.map +0 -7
  519. package/dist/httpsnippet-lite/esm/targets/python/python3/client.d.ts +0 -19
  520. package/dist/httpsnippet-lite/esm/targets/python/python3/client.d.ts.map +0 -1
  521. package/dist/httpsnippet-lite/esm/targets/python/python3/client.js.map +0 -7
  522. package/dist/httpsnippet-lite/esm/targets/python/target.d.ts +0 -29
  523. package/dist/httpsnippet-lite/esm/targets/python/target.d.ts.map +0 -1
  524. package/dist/httpsnippet-lite/esm/targets/python/target.js +0 -16
  525. package/dist/httpsnippet-lite/esm/targets/python/target.js.map +0 -7
  526. package/dist/httpsnippet-lite/esm/targets/r/httr/client.d.ts +0 -17
  527. package/dist/httpsnippet-lite/esm/targets/r/httr/client.d.ts.map +0 -1
  528. package/dist/httpsnippet-lite/esm/targets/r/httr/client.js.map +0 -7
  529. package/dist/httpsnippet-lite/esm/targets/r/target.d.ts +0 -27
  530. package/dist/httpsnippet-lite/esm/targets/r/target.d.ts.map +0 -1
  531. package/dist/httpsnippet-lite/esm/targets/r/target.js +0 -16
  532. package/dist/httpsnippet-lite/esm/targets/r/target.js.map +0 -7
  533. package/dist/httpsnippet-lite/esm/targets/ruby/native/client.d.ts +0 -16
  534. package/dist/httpsnippet-lite/esm/targets/ruby/native/client.d.ts.map +0 -1
  535. package/dist/httpsnippet-lite/esm/targets/ruby/native/client.js.map +0 -7
  536. package/dist/httpsnippet-lite/esm/targets/ruby/target.d.ts +0 -26
  537. package/dist/httpsnippet-lite/esm/targets/ruby/target.d.ts.map +0 -1
  538. package/dist/httpsnippet-lite/esm/targets/ruby/target.js +0 -16
  539. package/dist/httpsnippet-lite/esm/targets/ruby/target.js.map +0 -7
  540. package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.d.ts +0 -17
  541. package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.d.ts.map +0 -1
  542. package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.js.map +0 -7
  543. package/dist/httpsnippet-lite/esm/targets/shell/target.d.ts +0 -42
  544. package/dist/httpsnippet-lite/esm/targets/shell/target.d.ts.map +0 -1
  545. package/dist/httpsnippet-lite/esm/targets/shell/target.js +0 -20
  546. package/dist/httpsnippet-lite/esm/targets/shell/target.js.map +0 -7
  547. package/dist/httpsnippet-lite/esm/targets/shell/wget/client.d.ts +0 -15
  548. package/dist/httpsnippet-lite/esm/targets/shell/wget/client.d.ts.map +0 -1
  549. package/dist/httpsnippet-lite/esm/targets/shell/wget/client.js.map +0 -7
  550. package/dist/httpsnippet-lite/esm/targets/swift/helpers.d.ts +0 -17
  551. package/dist/httpsnippet-lite/esm/targets/swift/helpers.d.ts.map +0 -1
  552. package/dist/httpsnippet-lite/esm/targets/swift/helpers.js.map +0 -7
  553. package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.d.ts +0 -15
  554. package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.d.ts.map +0 -1
  555. package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.js.map +0 -7
  556. package/dist/httpsnippet-lite/esm/targets/swift/target.d.ts +0 -25
  557. package/dist/httpsnippet-lite/esm/targets/swift/target.d.ts.map +0 -1
  558. package/dist/httpsnippet-lite/esm/targets/swift/target.js +0 -16
  559. package/dist/httpsnippet-lite/esm/targets/swift/target.js.map +0 -7
  560. package/dist/httpsnippet-lite/types/helpers/code-builder.d.js +0 -1
  561. package/dist/httpsnippet-lite/types/helpers/escape.d.js +0 -1
  562. package/dist/httpsnippet-lite/types/helpers/form-data.d.js +0 -28
  563. package/dist/httpsnippet-lite/types/helpers/form-data.d.js.map +0 -7
  564. package/dist/httpsnippet-lite/types/helpers/headers.d.js +0 -1
  565. package/dist/httpsnippet-lite/types/helpers/reducer.d.js +0 -1
  566. package/dist/httpsnippet-lite/types/helpers/reducer.d.js.map +0 -7
  567. package/dist/httpsnippet-lite/types/helpers/shell.d.js +0 -1
  568. package/dist/httpsnippet-lite/types/helpers/shell.d.js.map +0 -7
  569. package/dist/httpsnippet-lite/types/helpers/url.d.js +0 -1
  570. package/dist/httpsnippet-lite/types/helpers/url.d.js.map +0 -7
  571. package/dist/httpsnippet-lite/types/helpers/utils.d.js +0 -1
  572. package/dist/httpsnippet-lite/types/helpers/utils.d.js.map +0 -7
  573. package/dist/httpsnippet-lite/types/httpsnippet.d.js +0 -19
  574. package/dist/httpsnippet-lite/types/httpsnippet.d.js.map +0 -7
  575. package/dist/httpsnippet-lite/types/targets/c/libcurl/client.d.js +0 -1
  576. package/dist/httpsnippet-lite/types/targets/c/libcurl/client.d.js.map +0 -7
  577. package/dist/httpsnippet-lite/types/targets/c/target.d.js +0 -1
  578. package/dist/httpsnippet-lite/types/targets/c/target.d.js.map +0 -7
  579. package/dist/httpsnippet-lite/types/targets/clojure/clj_http/client.d.js +0 -1
  580. package/dist/httpsnippet-lite/types/targets/clojure/clj_http/client.d.js.map +0 -7
  581. package/dist/httpsnippet-lite/types/targets/clojure/target.d.js +0 -1
  582. package/dist/httpsnippet-lite/types/targets/clojure/target.d.js.map +0 -7
  583. package/dist/httpsnippet-lite/types/targets/csharp/restsharp/client.d.js +0 -1
  584. package/dist/httpsnippet-lite/types/targets/csharp/restsharp/client.d.js.map +0 -7
  585. package/dist/httpsnippet-lite/types/targets/csharp/target.d.js +0 -1
  586. package/dist/httpsnippet-lite/types/targets/csharp/target.d.js.map +0 -7
  587. package/dist/httpsnippet-lite/types/targets/dart/http/client.d.js +0 -1
  588. package/dist/httpsnippet-lite/types/targets/dart/http/client.d.js.map +0 -7
  589. package/dist/httpsnippet-lite/types/targets/dart/target.d.js +0 -1
  590. package/dist/httpsnippet-lite/types/targets/dart/target.d.js.map +0 -7
  591. package/dist/httpsnippet-lite/types/targets/go/native/client.d.js +0 -1
  592. package/dist/httpsnippet-lite/types/targets/go/native/client.d.js.map +0 -7
  593. package/dist/httpsnippet-lite/types/targets/go/target.d.js +0 -1
  594. package/dist/httpsnippet-lite/types/targets/go/target.d.js.map +0 -7
  595. package/dist/httpsnippet-lite/types/targets/http/http1.1/client.d.js +0 -1
  596. package/dist/httpsnippet-lite/types/targets/http/http1.1/client.d.js.map +0 -7
  597. package/dist/httpsnippet-lite/types/targets/http/target.d.js +0 -1
  598. package/dist/httpsnippet-lite/types/targets/http/target.d.js.map +0 -7
  599. package/dist/httpsnippet-lite/types/targets/java/asynchttp/client.d.js +0 -1
  600. package/dist/httpsnippet-lite/types/targets/java/asynchttp/client.d.js.map +0 -7
  601. package/dist/httpsnippet-lite/types/targets/java/nethttp/client.d.js +0 -1
  602. package/dist/httpsnippet-lite/types/targets/java/nethttp/client.d.js.map +0 -7
  603. package/dist/httpsnippet-lite/types/targets/java/okhttp/client.d.js +0 -1
  604. package/dist/httpsnippet-lite/types/targets/java/okhttp/client.d.js.map +0 -7
  605. package/dist/httpsnippet-lite/types/targets/java/target.d.js +0 -1
  606. package/dist/httpsnippet-lite/types/targets/java/target.d.js.map +0 -7
  607. package/dist/httpsnippet-lite/types/targets/java/unirest/client.d.js +0 -1
  608. package/dist/httpsnippet-lite/types/targets/java/unirest/client.d.js.map +0 -7
  609. package/dist/httpsnippet-lite/types/targets/javascript/axios/client.d.js +0 -1
  610. package/dist/httpsnippet-lite/types/targets/javascript/axios/client.d.js.map +0 -7
  611. package/dist/httpsnippet-lite/types/targets/javascript/fetch/client.d.js +0 -1
  612. package/dist/httpsnippet-lite/types/targets/javascript/fetch/client.d.js.map +0 -7
  613. package/dist/httpsnippet-lite/types/targets/javascript/jquery/client.d.js +0 -1
  614. package/dist/httpsnippet-lite/types/targets/javascript/jquery/client.d.js.map +0 -7
  615. package/dist/httpsnippet-lite/types/targets/javascript/target.d.js +0 -1
  616. package/dist/httpsnippet-lite/types/targets/javascript/target.d.js.map +0 -7
  617. package/dist/httpsnippet-lite/types/targets/javascript/xhr/client.d.js +0 -1
  618. package/dist/httpsnippet-lite/types/targets/javascript/xhr/client.d.js.map +0 -7
  619. package/dist/httpsnippet-lite/types/targets/kotlin/okhttp/client.d.js +0 -1
  620. package/dist/httpsnippet-lite/types/targets/kotlin/okhttp/client.d.js.map +0 -7
  621. package/dist/httpsnippet-lite/types/targets/kotlin/target.d.js +0 -1
  622. package/dist/httpsnippet-lite/types/targets/kotlin/target.d.js.map +0 -7
  623. package/dist/httpsnippet-lite/types/targets/node/axios/client.d.js +0 -1
  624. package/dist/httpsnippet-lite/types/targets/node/axios/client.d.js.map +0 -7
  625. package/dist/httpsnippet-lite/types/targets/node/fetch/client.d.js +0 -1
  626. package/dist/httpsnippet-lite/types/targets/node/fetch/client.d.js.map +0 -7
  627. package/dist/httpsnippet-lite/types/targets/node/native/client.d.js +0 -1
  628. package/dist/httpsnippet-lite/types/targets/node/native/client.d.js.map +0 -7
  629. package/dist/httpsnippet-lite/types/targets/node/request/client.d.js +0 -1
  630. package/dist/httpsnippet-lite/types/targets/node/request/client.d.js.map +0 -7
  631. package/dist/httpsnippet-lite/types/targets/node/target.d.js +0 -1
  632. package/dist/httpsnippet-lite/types/targets/node/target.d.js.map +0 -7
  633. package/dist/httpsnippet-lite/types/targets/node/unirest/client.d.js +0 -1
  634. package/dist/httpsnippet-lite/types/targets/node/unirest/client.d.js.map +0 -7
  635. package/dist/httpsnippet-lite/types/targets/objc/helpers.d.js +0 -1
  636. package/dist/httpsnippet-lite/types/targets/objc/helpers.d.js.map +0 -7
  637. package/dist/httpsnippet-lite/types/targets/objc/nsurlsession/client.d.js +0 -1
  638. package/dist/httpsnippet-lite/types/targets/objc/nsurlsession/client.d.js.map +0 -7
  639. package/dist/httpsnippet-lite/types/targets/objc/target.d.js +0 -1
  640. package/dist/httpsnippet-lite/types/targets/objc/target.d.js.map +0 -7
  641. package/dist/httpsnippet-lite/types/targets/ocaml/cohttp/client.d.js +0 -1
  642. package/dist/httpsnippet-lite/types/targets/ocaml/cohttp/client.d.js.map +0 -7
  643. package/dist/httpsnippet-lite/types/targets/ocaml/target.d.js +0 -1
  644. package/dist/httpsnippet-lite/types/targets/ocaml/target.d.js.map +0 -7
  645. package/dist/httpsnippet-lite/types/targets/php/curl/client.d.js +0 -1
  646. package/dist/httpsnippet-lite/types/targets/php/curl/client.d.js.map +0 -7
  647. package/dist/httpsnippet-lite/types/targets/php/guzzle/client.d.js +0 -1
  648. package/dist/httpsnippet-lite/types/targets/php/guzzle/client.d.js.map +0 -7
  649. package/dist/httpsnippet-lite/types/targets/php/helpers.d.js +0 -1
  650. package/dist/httpsnippet-lite/types/targets/php/helpers.d.js.map +0 -7
  651. package/dist/httpsnippet-lite/types/targets/php/http1/client.d.js +0 -1
  652. package/dist/httpsnippet-lite/types/targets/php/http1/client.d.js.map +0 -7
  653. package/dist/httpsnippet-lite/types/targets/php/http2/client.d.js +0 -1
  654. package/dist/httpsnippet-lite/types/targets/php/http2/client.d.js.map +0 -7
  655. package/dist/httpsnippet-lite/types/targets/php/target.d.js +0 -1
  656. package/dist/httpsnippet-lite/types/targets/php/target.d.js.map +0 -7
  657. package/dist/httpsnippet-lite/types/targets/powershell/common.d.js +0 -1
  658. package/dist/httpsnippet-lite/types/targets/powershell/common.d.js.map +0 -7
  659. package/dist/httpsnippet-lite/types/targets/powershell/restmethod/client.d.js +0 -1
  660. package/dist/httpsnippet-lite/types/targets/powershell/restmethod/client.d.js.map +0 -7
  661. package/dist/httpsnippet-lite/types/targets/powershell/target.d.js +0 -1
  662. package/dist/httpsnippet-lite/types/targets/powershell/target.d.js.map +0 -7
  663. package/dist/httpsnippet-lite/types/targets/powershell/webrequest/client.d.js +0 -1
  664. package/dist/httpsnippet-lite/types/targets/powershell/webrequest/client.d.js.map +0 -7
  665. package/dist/httpsnippet-lite/types/targets/python/helpers.d.js +0 -1
  666. package/dist/httpsnippet-lite/types/targets/python/helpers.d.js.map +0 -7
  667. package/dist/httpsnippet-lite/types/targets/python/python3/client.d.js +0 -1
  668. package/dist/httpsnippet-lite/types/targets/python/python3/client.d.js.map +0 -7
  669. package/dist/httpsnippet-lite/types/targets/python/requests/client.d.js +0 -1
  670. package/dist/httpsnippet-lite/types/targets/python/requests/client.d.js.map +0 -7
  671. package/dist/httpsnippet-lite/types/targets/python/target.d.js +0 -1
  672. package/dist/httpsnippet-lite/types/targets/python/target.d.js.map +0 -7
  673. package/dist/httpsnippet-lite/types/targets/r/httr/client.d.js +0 -1
  674. package/dist/httpsnippet-lite/types/targets/r/httr/client.d.js.map +0 -7
  675. package/dist/httpsnippet-lite/types/targets/r/target.d.js +0 -1
  676. package/dist/httpsnippet-lite/types/targets/r/target.d.js.map +0 -7
  677. package/dist/httpsnippet-lite/types/targets/ruby/native/client.d.js +0 -1
  678. package/dist/httpsnippet-lite/types/targets/ruby/native/client.d.js.map +0 -7
  679. package/dist/httpsnippet-lite/types/targets/ruby/target.d.js +0 -1
  680. package/dist/httpsnippet-lite/types/targets/ruby/target.d.js.map +0 -7
  681. package/dist/httpsnippet-lite/types/targets/shell/curl/client.d.js +0 -1
  682. package/dist/httpsnippet-lite/types/targets/shell/curl/client.d.js.map +0 -7
  683. package/dist/httpsnippet-lite/types/targets/shell/httpie/client.d.js +0 -1
  684. package/dist/httpsnippet-lite/types/targets/shell/httpie/client.d.js.map +0 -7
  685. package/dist/httpsnippet-lite/types/targets/shell/target.d.js +0 -1
  686. package/dist/httpsnippet-lite/types/targets/shell/target.d.js.map +0 -7
  687. package/dist/httpsnippet-lite/types/targets/shell/wget/client.d.js +0 -1
  688. package/dist/httpsnippet-lite/types/targets/shell/wget/client.d.js.map +0 -7
  689. package/dist/httpsnippet-lite/types/targets/swift/helpers.d.js +0 -1
  690. package/dist/httpsnippet-lite/types/targets/swift/helpers.d.js.map +0 -7
  691. package/dist/httpsnippet-lite/types/targets/swift/nsurlsession/client.d.js +0 -1
  692. package/dist/httpsnippet-lite/types/targets/swift/nsurlsession/client.d.js.map +0 -7
  693. package/dist/httpsnippet-lite/types/targets/swift/target.d.js +0 -1
  694. package/dist/httpsnippet-lite/types/targets/swift/target.d.js.map +0 -7
  695. package/dist/httpsnippet-lite/types/targets/targets.d.js +0 -1
  696. package/dist/httpsnippet-lite/types/targets/targets.d.js.map +0 -7
  697. /package/dist/httpsnippet-lite/{esm/helpers → helpers}/escape.js +0 -0
  698. /package/dist/httpsnippet-lite/{types/helpers/code-builder.d.js.map → helpers/reducer.js.map} +0 -0
  699. /package/dist/httpsnippet-lite/{types/helpers/escape.d.js.map → helpers/snippet-request.js.map} +0 -0
  700. /package/dist/httpsnippet-lite/{esm/targets → targets}/powershell/restmethod/client.js +0 -0
  701. /package/dist/httpsnippet-lite/{esm/targets → targets}/powershell/webrequest/client.js +0 -0
  702. /package/dist/httpsnippet-lite/{types/helpers/headers.d.js.map → targets/target.js.map} +0 -0
@@ -1,15 +1,15 @@
1
- import { cLibcurl } from "../plugins/c/libcurl/libcurl.js";
1
+ import { cLibcurl } from "../plugins/c/libcurl/index.js";
2
2
  import { clojureCljhttp } from "../plugins/clojure/clj_http/index.js";
3
3
  import { csharpHttpclient } from "../plugins/csharp/httpclient/index.js";
4
4
  import { csharpRestsharp } from "../plugins/csharp/restsharp/index.js";
5
5
  import { dartHttp } from "../plugins/dart/http/index.js";
6
- import { fsharpHttpclient } from "../plugins/fsharp/httpclient/httpclient.js";
6
+ import { fsharpHttpclient } from "../plugins/fsharp/httpclient/index.js";
7
7
  import { goNative } from "../plugins/go/native/index.js";
8
8
  import { httpHttp11 } from "../plugins/http/http11/index.js";
9
9
  import { javaAsynchttp } from "../plugins/java/asynchttp/index.js";
10
- import { javaNethttp } from "../plugins/java/nethttp/nethttp.js";
11
- import { javaOkhttp } from "../plugins/java/okhttp/okhttp.js";
12
- import { javaUnirest } from "../plugins/java/unirest/unirest.js";
10
+ import { javaNethttp } from "../plugins/java/nethttp/index.js";
11
+ import { javaOkhttp } from "../plugins/java/okhttp/index.js";
12
+ import { javaUnirest } from "../plugins/java/unirest/index.js";
13
13
  import { jsAxios } from "../plugins/js/axios/index.js";
14
14
  import { jsFetch } from "../plugins/js/fetch/index.js";
15
15
  import { jsJquery } from "../plugins/js/jquery/index.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/clients/index.ts"],
4
- "sourcesContent": ["import type { Target } from '@scalar/types/snippetz'\n\nimport { cLibcurl } from '@/plugins/c/libcurl/libcurl'\nimport { clojureCljhttp } from '@/plugins/clojure/clj_http'\nimport { csharpHttpclient } from '@/plugins/csharp/httpclient'\nimport { csharpRestsharp } from '@/plugins/csharp/restsharp'\nimport { dartHttp } from '@/plugins/dart/http'\nimport { fsharpHttpclient } from '@/plugins/fsharp/httpclient/httpclient'\nimport { goNative } from '@/plugins/go/native'\nimport { httpHttp11 } from '@/plugins/http/http11'\nimport { javaAsynchttp } from '@/plugins/java/asynchttp'\nimport { javaNethttp } from '@/plugins/java/nethttp/nethttp'\nimport { javaOkhttp } from '@/plugins/java/okhttp/okhttp'\nimport { javaUnirest } from '@/plugins/java/unirest/unirest'\nimport { jsAxios } from '@/plugins/js/axios'\nimport { jsFetch } from '@/plugins/js/fetch'\nimport { jsJquery } from '@/plugins/js/jquery'\nimport { jsOfetch } from '@/plugins/js/ofetch'\nimport { jsXhr } from '@/plugins/js/xhr'\nimport { kotlinOkhttp } from '@/plugins/kotlin/okhttp'\nimport { nodeAxios } from '@/plugins/node/axios'\nimport { nodeFetch } from '@/plugins/node/fetch'\nimport { nodeOfetch } from '@/plugins/node/ofetch'\nimport { nodeUndici } from '@/plugins/node/undici'\nimport { objcNsurlsession } from '@/plugins/objc/nsurlsession'\nimport { ocamlCohttp } from '@/plugins/ocaml/cohttp'\nimport { phpCurl } from '@/plugins/php/curl'\nimport { phpGuzzle } from '@/plugins/php/guzzle'\nimport { powershellRestmethod } from '@/plugins/powershell/restmethod'\nimport { powershellWebrequest } from '@/plugins/powershell/webrequest'\nimport { pythonHttpxAsync, pythonHttpxSync } from '@/plugins/python/httpx'\nimport { pythonPython3 } from '@/plugins/python/python3'\nimport { pythonRequests } from '@/plugins/python/requests'\nimport { rHttr } from '@/plugins/r/httr'\nimport { rubyNative } from '@/plugins/ruby/native'\nimport { rustReqwest } from '@/plugins/rust/reqwest'\nimport { shellCurl } from '@/plugins/shell/curl'\nimport { shellHttpie } from '@/plugins/shell/httpie'\nimport { shellWget } from '@/plugins/shell/wget'\nimport { swiftNsurlsession } from '@/plugins/swift/nsurlsession'\n\n/**\n * All available clients\n */\nexport const clients: Target[] = [\n {\n key: 'c',\n title: 'C',\n default: 'libcurl',\n clients: [cLibcurl],\n },\n {\n key: 'csharp',\n title: 'C#',\n default: 'restsharp',\n clients: [csharpHttpclient, csharpRestsharp],\n },\n {\n key: 'clojure',\n title: 'Clojure',\n default: 'clj_http',\n clients: [clojureCljhttp],\n },\n {\n key: 'dart',\n title: 'Dart',\n default: 'http',\n clients: [dartHttp],\n },\n {\n key: 'fsharp',\n title: 'F#',\n default: 'httpclient',\n clients: [fsharpHttpclient],\n },\n {\n key: 'go',\n title: 'Go',\n default: 'native',\n clients: [goNative],\n },\n {\n key: 'http',\n title: 'HTTP',\n default: 'http1.1',\n clients: [httpHttp11],\n },\n {\n key: 'java',\n title: 'Java',\n default: 'unirest',\n clients: [javaAsynchttp, javaNethttp, javaOkhttp, javaUnirest],\n },\n {\n key: 'js',\n title: 'JavaScript',\n default: 'fetch',\n clients: [jsFetch, jsAxios, jsOfetch, jsJquery, jsXhr],\n },\n {\n key: 'kotlin',\n title: 'Kotlin',\n default: 'okhttp',\n clients: [kotlinOkhttp],\n },\n {\n key: 'node',\n title: 'Node.js',\n default: 'fetch',\n clients: [nodeFetch, nodeAxios, nodeOfetch, nodeUndici],\n },\n {\n key: 'objc',\n title: 'Objective-C',\n default: 'nsurlsession',\n clients: [objcNsurlsession],\n },\n {\n key: 'ocaml',\n title: 'OCaml',\n default: 'cohttp',\n clients: [ocamlCohttp],\n },\n {\n key: 'php',\n title: 'PHP',\n default: 'curl',\n clients: [phpCurl, phpGuzzle],\n },\n {\n key: 'powershell',\n title: 'PowerShell',\n default: 'webrequest',\n clients: [powershellWebrequest, powershellRestmethod],\n },\n {\n key: 'python',\n title: 'Python',\n default: 'python3',\n clients: [pythonPython3, pythonRequests, pythonHttpxSync, pythonHttpxAsync],\n },\n {\n key: 'r',\n title: 'R',\n default: 'httr',\n clients: [rHttr],\n },\n {\n key: 'ruby',\n title: 'Ruby',\n default: 'native',\n clients: [rubyNative],\n },\n {\n key: 'rust',\n title: 'Rust',\n default: 'reqwest',\n clients: [rustReqwest],\n },\n {\n key: 'shell',\n title: 'Shell',\n default: 'curl',\n clients: [shellCurl, shellWget, shellHttpie],\n },\n {\n key: 'swift',\n title: 'Swift',\n default: 'nsurlsession',\n clients: [swiftNsurlsession],\n },\n]\n"],
4
+ "sourcesContent": ["import type { Target } from '@scalar/types/snippetz'\n\nimport { cLibcurl } from '@/plugins/c/libcurl'\nimport { clojureCljhttp } from '@/plugins/clojure/clj_http'\nimport { csharpHttpclient } from '@/plugins/csharp/httpclient'\nimport { csharpRestsharp } from '@/plugins/csharp/restsharp'\nimport { dartHttp } from '@/plugins/dart/http'\nimport { fsharpHttpclient } from '@/plugins/fsharp/httpclient'\nimport { goNative } from '@/plugins/go/native'\nimport { httpHttp11 } from '@/plugins/http/http11'\nimport { javaAsynchttp } from '@/plugins/java/asynchttp'\nimport { javaNethttp } from '@/plugins/java/nethttp'\nimport { javaOkhttp } from '@/plugins/java/okhttp'\nimport { javaUnirest } from '@/plugins/java/unirest'\nimport { jsAxios } from '@/plugins/js/axios'\nimport { jsFetch } from '@/plugins/js/fetch'\nimport { jsJquery } from '@/plugins/js/jquery'\nimport { jsOfetch } from '@/plugins/js/ofetch'\nimport { jsXhr } from '@/plugins/js/xhr'\nimport { kotlinOkhttp } from '@/plugins/kotlin/okhttp'\nimport { nodeAxios } from '@/plugins/node/axios'\nimport { nodeFetch } from '@/plugins/node/fetch'\nimport { nodeOfetch } from '@/plugins/node/ofetch'\nimport { nodeUndici } from '@/plugins/node/undici'\nimport { objcNsurlsession } from '@/plugins/objc/nsurlsession'\nimport { ocamlCohttp } from '@/plugins/ocaml/cohttp'\nimport { phpCurl } from '@/plugins/php/curl'\nimport { phpGuzzle } from '@/plugins/php/guzzle'\nimport { powershellRestmethod } from '@/plugins/powershell/restmethod'\nimport { powershellWebrequest } from '@/plugins/powershell/webrequest'\nimport { pythonHttpxAsync, pythonHttpxSync } from '@/plugins/python/httpx'\nimport { pythonPython3 } from '@/plugins/python/python3'\nimport { pythonRequests } from '@/plugins/python/requests'\nimport { rHttr } from '@/plugins/r/httr'\nimport { rubyNative } from '@/plugins/ruby/native'\nimport { rustReqwest } from '@/plugins/rust/reqwest'\nimport { shellCurl } from '@/plugins/shell/curl'\nimport { shellHttpie } from '@/plugins/shell/httpie'\nimport { shellWget } from '@/plugins/shell/wget'\nimport { swiftNsurlsession } from '@/plugins/swift/nsurlsession'\n\n/**\n * All available clients\n */\nexport const clients: Target[] = [\n {\n key: 'c',\n title: 'C',\n default: 'libcurl',\n clients: [cLibcurl],\n },\n {\n key: 'csharp',\n title: 'C#',\n default: 'restsharp',\n clients: [csharpHttpclient, csharpRestsharp],\n },\n {\n key: 'clojure',\n title: 'Clojure',\n default: 'clj_http',\n clients: [clojureCljhttp],\n },\n {\n key: 'dart',\n title: 'Dart',\n default: 'http',\n clients: [dartHttp],\n },\n {\n key: 'fsharp',\n title: 'F#',\n default: 'httpclient',\n clients: [fsharpHttpclient],\n },\n {\n key: 'go',\n title: 'Go',\n default: 'native',\n clients: [goNative],\n },\n {\n key: 'http',\n title: 'HTTP',\n default: 'http1.1',\n clients: [httpHttp11],\n },\n {\n key: 'java',\n title: 'Java',\n default: 'unirest',\n clients: [javaAsynchttp, javaNethttp, javaOkhttp, javaUnirest],\n },\n {\n key: 'js',\n title: 'JavaScript',\n default: 'fetch',\n clients: [jsFetch, jsAxios, jsOfetch, jsJquery, jsXhr],\n },\n {\n key: 'kotlin',\n title: 'Kotlin',\n default: 'okhttp',\n clients: [kotlinOkhttp],\n },\n {\n key: 'node',\n title: 'Node.js',\n default: 'fetch',\n clients: [nodeFetch, nodeAxios, nodeOfetch, nodeUndici],\n },\n {\n key: 'objc',\n title: 'Objective-C',\n default: 'nsurlsession',\n clients: [objcNsurlsession],\n },\n {\n key: 'ocaml',\n title: 'OCaml',\n default: 'cohttp',\n clients: [ocamlCohttp],\n },\n {\n key: 'php',\n title: 'PHP',\n default: 'curl',\n clients: [phpCurl, phpGuzzle],\n },\n {\n key: 'powershell',\n title: 'PowerShell',\n default: 'webrequest',\n clients: [powershellWebrequest, powershellRestmethod],\n },\n {\n key: 'python',\n title: 'Python',\n default: 'python3',\n clients: [pythonPython3, pythonRequests, pythonHttpxSync, pythonHttpxAsync],\n },\n {\n key: 'r',\n title: 'R',\n default: 'httr',\n clients: [rHttr],\n },\n {\n key: 'ruby',\n title: 'Ruby',\n default: 'native',\n clients: [rubyNative],\n },\n {\n key: 'rust',\n title: 'Rust',\n default: 'reqwest',\n clients: [rustReqwest],\n },\n {\n key: 'shell',\n title: 'Shell',\n default: 'curl',\n clients: [shellCurl, shellWget, shellHttpie],\n },\n {\n key: 'swift',\n title: 'Swift',\n default: 'nsurlsession',\n clients: [swiftNsurlsession],\n },\n]\n"],
5
5
  "mappings": "AAEA,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAA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jB;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS,CAAC,UAAU;AAAA,EACtB;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS,CAAC,WAAW;AAAA,EACvB;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS,CAAC,WAAW,WAAW,WAAW;AAAA,EAC7C;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS,CAAC,iBAAiB;AAAA,EAC7B;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,51 @@
1
+ type PostProcessor = (unreplacedCode: string) => string;
2
+ export type CodeBuilderOptions = {
3
+ /**
4
+ * Desired indentation character for aggregated lines of code
5
+ * @default ''
6
+ */
7
+ indent?: string;
8
+ /**
9
+ * Desired character to join each line of code
10
+ * @default \n
11
+ */
12
+ join?: string;
13
+ };
14
+ export declare class CodeBuilder {
15
+ postProcessors: PostProcessor[];
16
+ code: string[];
17
+ indentationCharacter: string;
18
+ lineJoin: string;
19
+ /**
20
+ * Add given indentation level to given line of code
21
+ */
22
+ indentLine: (line: string, indentationLevel?: number) => string;
23
+ /**
24
+ * Add the line at the beginning of the current lines
25
+ */
26
+ unshift: (line: string, indentationLevel?: number) => void;
27
+ /**
28
+ * Add the line at the end of the current lines
29
+ */
30
+ push: (line: string, indentationLevel?: number) => void;
31
+ /**
32
+ * Add an empty line at the end of current lines
33
+ */
34
+ blank: () => void;
35
+ /**
36
+ * Concatenate all current lines using the given lineJoin, then apply any replacers that may have been added
37
+ */
38
+ join: () => string;
39
+ /**
40
+ * Often when writing modules you may wish to add a literal tag or bit of metadata that you wish to transform after other processing as a final step.
41
+ * To do so, you can provide a PostProcessor function and it will be run automatically for you when you call `join()` later on.
42
+ */
43
+ addPostProcessor: (postProcessor: PostProcessor) => void;
44
+ /**
45
+ * Helper object to format and aggragate lines of code.
46
+ * Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.
47
+ */
48
+ constructor({ indent, join }?: CodeBuilderOptions);
49
+ }
50
+ export {};
51
+ //# sourceMappingURL=code-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-builder.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/code-builder.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,CAAA;AAEvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAKD,qBAAa,WAAW;IACtB,cAAc,EAAE,aAAa,EAAE,CAAA;IAC/B,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,oBAAoB,EAAE,MAAM,CAAA;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/D;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1D;;OAEG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACvD;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB;;OAEG;IACH,IAAI,EAAE,MAAM,MAAM,CAAA;IAClB;;;OAGG;IACH,gBAAgB,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAA;IAExD;;;OAGG;gBACS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAE,kBAAuB;CAsDtD"}
@@ -1,6 +1,35 @@
1
1
  const DEFAULT_INDENTATION_CHARACTER = "";
2
2
  const DEFAULT_LINE_JOIN = "\n";
3
3
  class CodeBuilder {
4
+ postProcessors;
5
+ code;
6
+ indentationCharacter;
7
+ lineJoin;
8
+ /**
9
+ * Add given indentation level to given line of code
10
+ */
11
+ indentLine;
12
+ /**
13
+ * Add the line at the beginning of the current lines
14
+ */
15
+ unshift;
16
+ /**
17
+ * Add the line at the end of the current lines
18
+ */
19
+ push;
20
+ /**
21
+ * Add an empty line at the end of current lines
22
+ */
23
+ blank;
24
+ /**
25
+ * Concatenate all current lines using the given lineJoin, then apply any replacers that may have been added
26
+ */
27
+ join;
28
+ /**
29
+ * Often when writing modules you may wish to add a literal tag or bit of metadata that you wish to transform after other processing as a final step.
30
+ * To do so, you can provide a PostProcessor function and it will be run automatically for you when you call `join()` later on.
31
+ */
32
+ addPostProcessor;
4
33
  /**
5
34
  * Helper object to format and aggragate lines of code.
6
35
  * Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/httpsnippet-lite/helpers/code-builder.ts"],
4
+ "sourcesContent": ["type PostProcessor = (unreplacedCode: string) => string\n\nexport type CodeBuilderOptions = {\n /**\n * Desired indentation character for aggregated lines of code\n * @default ''\n */\n indent?: string\n /**\n * Desired character to join each line of code\n * @default \\n\n */\n join?: string\n}\n\nconst DEFAULT_INDENTATION_CHARACTER = ''\nconst DEFAULT_LINE_JOIN = '\\n'\n\nexport class CodeBuilder {\n postProcessors: PostProcessor[]\n code: string[]\n indentationCharacter: string\n lineJoin: string\n\n /**\n * Add given indentation level to given line of code\n */\n indentLine: (line: string, indentationLevel?: number) => string\n /**\n * Add the line at the beginning of the current lines\n */\n unshift: (line: string, indentationLevel?: number) => void\n /**\n * Add the line at the end of the current lines\n */\n push: (line: string, indentationLevel?: number) => void\n /**\n * Add an empty line at the end of current lines\n */\n blank: () => void\n /**\n * Concatenate all current lines using the given lineJoin, then apply any replacers that may have been added\n */\n join: () => string\n /**\n * Often when writing modules you may wish to add a literal tag or bit of metadata that you wish to transform after other processing as a final step.\n * To do so, you can provide a PostProcessor function and it will be run automatically for you when you call `join()` later on.\n */\n addPostProcessor: (postProcessor: PostProcessor) => void\n\n /**\n * Helper object to format and aggragate lines of code.\n * Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.\n */\n constructor({ indent, join }: CodeBuilderOptions = {}) {\n this.postProcessors = []\n this.code = []\n this.indentationCharacter = DEFAULT_INDENTATION_CHARACTER\n this.lineJoin = DEFAULT_LINE_JOIN\n\n /**\n * Add given indentation level to given line of code\n */\n this.indentLine = (line, indentationLevel = 0) => {\n const whitespace = this.indentationCharacter.repeat(indentationLevel)\n return `${whitespace}${line}`\n }\n /**\n * Add the line at the beginning of the current lines\n */\n this.unshift = (line, indentationLevel) => {\n const newLine = this.indentLine(line, indentationLevel)\n this.code.unshift(newLine)\n }\n /**\n * Add the line at the end of the current lines\n */\n this.push = (line, indentationLevel) => {\n const newLine = this.indentLine(line, indentationLevel)\n this.code.push(newLine)\n }\n /**\n * Add an empty line at the end of current lines\n */\n this.blank = () => {\n this.code.push('')\n }\n /**\n * Concatenate all current lines using the given lineJoin, then apply any replacers that may have been added\n */\n this.join = () => {\n const unreplacedCode = this.code.join(this.lineJoin)\n const replacedOutput = this.postProcessors.reduce(\n (accumulator, replacer) => replacer(accumulator),\n unreplacedCode,\n )\n return replacedOutput\n }\n /**\n * Often when writing modules you may wish to add a literal tag or bit of metadata that you wish to transform after other processing as a final step.\n * To do so, you can provide a PostProcessor function and it will be run automatically for you when you call `join()` later on.\n */\n this.addPostProcessor = (postProcessor) => {\n this.postProcessors = [...this.postProcessors, postProcessor]\n }\n this.indentationCharacter = indent || DEFAULT_INDENTATION_CHARACTER\n this.lineJoin = join !== null && join !== void 0 ? join : DEFAULT_LINE_JOIN\n }\n}\n"],
5
+ "mappings": "AAeA,MAAM,gCAAgC;AACtC,M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AW,SAAS,QAAQ,SAAS,SAAS,OAAO;AAAA,EAC5D;AACF;",
6
+ "names": []
7
+ }
@@ -1,3 +1,21 @@
1
+ type EscapeOptions = {
2
+ /**
3
+ * The delimiter that will be used to wrap the string (and so must be escaped
4
+ * when used within the string).
5
+ * Defaults to "
6
+ */
7
+ delimiter?: string;
8
+ /**
9
+ * The char to use to escape the delimiter and other special characters.
10
+ * Defaults to \
11
+ */
12
+ escapeChar?: string;
13
+ /**
14
+ * Whether newlines (\n and \r) should be escaped within the string.
15
+ * Defaults to true.
16
+ */
17
+ escapeNewlines?: boolean;
18
+ };
1
19
  /**
2
20
  * Escape characters within a value to make it safe to insert directly into a
3
21
  * snippet. Takes options which define the escape requirements.
@@ -9,7 +27,7 @@
9
27
  * See https://tc39.es/ecma262/multipage/structured-data.html#sec-quotejsonstring
10
28
  * for the complete original algorithm.
11
29
  */
12
- export declare function escapeString(rawValue: any, options?: {}): string;
30
+ export declare function escapeString(rawValue: string, options?: EscapeOptions): string;
13
31
  /**
14
32
  * Make a string value safe to insert literally into a snippet within single quotes,
15
33
  * by escaping problematic characters, including single quotes inside the string,
@@ -17,7 +35,7 @@ export declare function escapeString(rawValue: any, options?: {}): string;
17
35
  *
18
36
  * If value is not a string, it will be stringified with .toString() first.
19
37
  */
20
- export declare const escapeForSingleQuotes: (value: any) => string;
38
+ export declare const escapeForSingleQuotes: (value: string) => string;
21
39
  /**
22
40
  * Make a string value safe to insert literally into a snippet within double quotes,
23
41
  * by escaping problematic characters, including double quotes inside the string,
@@ -25,5 +43,6 @@ export declare const escapeForSingleQuotes: (value: any) => string;
25
43
  *
26
44
  * If value is not a string, it will be stringified with .toString() first.
27
45
  */
28
- export declare const escapeForDoubleQuotes: (value: any) => string;
46
+ export declare const escapeForDoubleQuotes: (value: string) => string;
47
+ export {};
29
48
  //# sourceMappingURL=escape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/escape.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,UA0CzE;AACD;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,KAAG,MAAiD,CAAA;AACvG;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,KAAG,MAAiD,CAAA"}
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/httpsnippet-lite/helpers/escape.ts"],
4
+ "sourcesContent": ["type EscapeOptions = {\n /**\n * The delimiter that will be used to wrap the string (and so must be escaped\n * when used within the string).\n * Defaults to \"\n */\n delimiter?: string\n /**\n * The char to use to escape the delimiter and other special characters.\n * Defaults to \\\n */\n escapeChar?: string\n /**\n * Whether newlines (\\n and \\r) should be escaped within the string.\n * Defaults to true.\n */\n escapeNewlines?: boolean\n}\n\n/**\n * Escape characters within a value to make it safe to insert directly into a\n * snippet. Takes options which define the escape requirements.\n *\n * This is closely based on the JSON-stringify string serialization algorithm,\n * but generalized for other string delimiters (e.g. \" or ') and different escape\n * characters (e.g. Powershell uses `)\n *\n * See https://tc39.es/ecma262/multipage/structured-data.html#sec-quotejsonstring\n * for the complete original algorithm.\n */\nexport function escapeString(rawValue: string, options: EscapeOptions = {}) {\n const { delimiter = '\"', escapeChar = '\\\\', escapeNewlines = true } = options\n const stringValue = rawValue.toString()\n return [...stringValue]\n .map((c) => {\n if (c === '\\b') {\n return `${escapeChar}b`\n }\n if (c === '\\t') {\n return `${escapeChar}t`\n }\n if (c === '\\n') {\n if (escapeNewlines) {\n return `${escapeChar}n`\n }\n return c // Don't just continue, or this is caught by < \\u0020\n }\n if (c === '\\f') {\n return `${escapeChar}f`\n }\n if (c === '\\r') {\n if (escapeNewlines) {\n return `${escapeChar}r`\n }\n return c // Don't just continue, or this is caught by < \\u0020\n }\n if (c === escapeChar) {\n return escapeChar + escapeChar\n }\n if (c === delimiter) {\n return escapeChar + delimiter\n }\n if (c < '\\u0020' || c > '\\u007E') {\n // Delegate the trickier non-ASCII cases to the normal algorithm. Some of these\n // are escaped as \\uXXXX, whilst others are represented literally. Since we're\n // using this primarily for header values that are generally (though not 100%\n // strictly?) ASCII-only, this should almost never happen.\n return JSON.stringify(c).slice(1, -1)\n }\n return c\n })\n .join('')\n}\n/**\n * Make a string value safe to insert literally into a snippet within single quotes,\n * by escaping problematic characters, including single quotes inside the string,\n * backslashes, newlines, and other special characters.\n *\n * If value is not a string, it will be stringified with .toString() first.\n */\nexport const escapeForSingleQuotes = (value: string): string => escapeString(value, { delimiter: \"'\" })\n/**\n * Make a string value safe to insert literally into a snippet within double quotes,\n * by escaping problematic characters, including double quotes inside the string,\n * backslashes, newlines, and other special characters.\n *\n * If value is not a string, it will be stringified with .toString() first.\n */\nexport const escapeForDoubleQuotes = (value: string): string => escapeString(value, { delimiter: '\"' })\n"],
5
+ "mappings": "AA8BO,SAAS,aAAa,UAAkB,UAAyB,CAAC,GAAG;AAC1E,QAAM,EAAE,YAAY,KAAK,aAAa,MAAM,iBAAiB,KAAK,IAAI;AACtE,QAAM,cAAc,SAAS,SAAS;AACtC,SAAO,CAAC,GAAG,WAAW,EACnB,IAAI,CAAC,MAAM;AACV,QAAI,MAAM,MAAM;AACd,aAAO,GAAG,UAAU;AAAA,IACtB;AACA,QAAI,MAAM,KAAM;AACd,aAAO,GAAG,UAAU;AAAA,IACtB;AACA,QAAI,MAAM,MAAM;AACd,UAAI,gBAAgB;AAClB,eAAO,GAAG,UAAU;AAAA,MACtB;AACA,aAAO;AAAA,IACT;AACA,QAAI,MAAM,MAAM;AACd,aAAO,GAAG,UAAU;AAAA,IACtB;AACA,QAAI,MAAM,MAAM;AACd,UAAI,gBAAgB;AAClB,eAAO,GAAG,UAAU;AAAA,MACtB;AACA,aAAO;AAAA,IACT;AACA,QAAI,MAAM,YAAY;AACpB,aAAO,aAAa;AAAA,IACtB;AACA,QAAI,MAAM,WAAW;AACnB,aAAO,aAAa;AAAA,IACtB;AACA,QAAI,IAAI,OAAY,IAAI,KAAU;AAKhC,aAAO,KAAK,UAAU,CAAC,EAAE,MAAM,GAAG,EAAE;AAAA,IACtC;AACA,WAAO;AAAA,EACT,CAAC,EACA,KAAK,EAAE;AACZ;AAQO,MAAM,wBAAwB,CAAC,UAA0B,aAAa,OAAO,EAAE,WAAW,IAAI,CAAC;AAQ/F,MAAM,wBAAwB,CAAC,UAA0B,aAAa,OAAO,EAAE,WAAW,IAAI,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,15 @@
1
+ type Headers<T> = Record<string, T>;
2
+ /**
3
+ * Given a headers object retrieve a specific header out of it via a case-insensitive key.
4
+ */
5
+ export declare const getHeaderName: <T>(headers: Headers<T>, name: string) => string | undefined;
6
+ /**
7
+ * Given a headers object retrieve the contents of a header out of it via a case-insensitive key.
8
+ */
9
+ export declare const getHeader: <T>(headers: Headers<T>, name: string) => T;
10
+ /**
11
+ * Determine if a given case-insensitive header exists within a header object.
12
+ */
13
+ export declare const hasHeader: <T>(headers: Headers<T>, name: string) => boolean;
14
+ export {};
15
+ //# sourceMappingURL=headers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/headers.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAEnC;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,MAAM,KAAG,MAAM,GAAG,SACM,CAAA;AAEpF;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,MAAM,KAAG,CAMhE,CAAA;AACD;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,MAAM,KAAG,OAAgD,CAAA"}
@@ -1,6 +1,4 @@
1
- const getHeaderName = (headers, name) => Object.keys(headers).find(
2
- (header) => header.toLowerCase() === name.toLowerCase()
3
- );
1
+ const getHeaderName = (headers, name) => Object.keys(headers).find((header) => header.toLowerCase() === name.toLowerCase());
4
2
  const getHeader = (headers, name) => {
5
3
  const headerName = getHeaderName(headers, name);
6
4
  if (!headerName) {
@@ -9,18 +7,9 @@ const getHeader = (headers, name) => {
9
7
  return headers[headerName];
10
8
  };
11
9
  const hasHeader = (headers, name) => Boolean(getHeaderName(headers, name));
12
- const mimeTypeJson = [
13
- "application/json",
14
- "application/x-json",
15
- "text/json",
16
- "text/x-json",
17
- "+json"
18
- ];
19
- const isMimeTypeJSON = (mimeType) => mimeTypeJson.some((type) => mimeType.includes(type));
20
10
  export {
21
11
  getHeader,
22
12
  getHeaderName,
23
- hasHeader,
24
- isMimeTypeJSON
13
+ hasHeader
25
14
  };
26
15
  //# sourceMappingURL=headers.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/httpsnippet-lite/helpers/headers.ts"],
4
+ "sourcesContent": ["type Headers<T> = Record<string, T>\n\n/**\n * Given a headers object retrieve a specific header out of it via a case-insensitive key.\n */\nexport const getHeaderName = <T>(headers: Headers<T>, name: string): string | undefined =>\n Object.keys(headers).find((header) => header.toLowerCase() === name.toLowerCase())\n\n/**\n * Given a headers object retrieve the contents of a header out of it via a case-insensitive key.\n */\nexport const getHeader = <T>(headers: Headers<T>, name: string): T => {\n const headerName = getHeaderName(headers, name)\n if (!headerName) {\n return undefined as T\n }\n return headers[headerName] as T\n}\n/**\n * Determine if a given case-insensitive header exists within a header object.\n */\nexport const hasHeader = <T>(headers: Headers<T>, name: string): boolean => Boolean(getHeaderName(headers, name))\n"],
5
+ "mappings": "AAKO,MAAM,gBAAgB,CAAI,SAAqB,SACpD,OAAO,KAAK,OAAO,EAAE,KAAK,CAAC,WAAW,OAAO,YAAY,MAAM,KAAK,YAAY,CAAC;AAK5E,MAAM,YAAY,CAAI,SAAqB,SAAoB;AACpE,QAAM,aAAa,cAAc,SAAS,IAAI;AAC9C,MAAI,CAAC,YAAY;AACf,WAAO;AAAA,EACT;AACA,SAAO,QAAQ,UAAU;AAC3B;AAIO,MAAM,YAAY,CAAI,SAAqB,SAA0B,QAAQ,cAAc,SAAS,IAAI,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export type ReducedHelperObject = Record<string, string[] | string>;
2
+ //# sourceMappingURL=reducer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/reducer.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=reducer.js.map
@@ -2,6 +2,6 @@
2
2
  * Use 'strong quoting' using single quotes so that we only need to deal with nested single quote characters.
3
3
  * see: http://wiki.bash-hackers.org/syntax/quoting#strong_quoting
4
4
  */
5
- export declare const quote: (value?: string) => string;
6
- export declare const escape: (value: any) => any;
5
+ export declare const shellQuote: (value?: string) => string;
6
+ export declare const shellEscape: (value: string) => string;
7
7
  //# sourceMappingURL=shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/shell.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,cAAU,KAAG,MAQvC,CAAA;AACD,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,MAA2D,CAAA"}
@@ -1,4 +1,4 @@
1
- const quote = (value = "") => {
1
+ const shellQuote = (value = "") => {
2
2
  const safe = /^[a-z0-9-_/.@%^=:]+$/i;
3
3
  const isShellSafe = safe.test(value);
4
4
  if (isShellSafe) {
@@ -6,9 +6,9 @@ const quote = (value = "") => {
6
6
  }
7
7
  return `'${value.replace(/'/g, "'\\''")}'`;
8
8
  };
9
- const escape = (value) => value.replace(/\r/g, "\\r").replace(/\n/g, "\\n");
9
+ const shellEscape = (value) => value.replace(/\r/g, "\\r").replace(/\n/g, "\\n");
10
10
  export {
11
- escape,
12
- quote
11
+ shellEscape,
12
+ shellQuote
13
13
  };
14
14
  //# sourceMappingURL=shell.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/httpsnippet-lite/helpers/shell.ts"],
4
+ "sourcesContent": ["/**\n * Use 'strong quoting' using single quotes so that we only need to deal with nested single quote characters.\n * see: http://wiki.bash-hackers.org/syntax/quoting#strong_quoting\n */\nexport const shellQuote = (value = ''): string => {\n const safe = /^[a-z0-9-_/.@%^=:]+$/i\n const isShellSafe = safe.test(value)\n if (isShellSafe) {\n return value\n }\n // if the value is not shell safe, then quote it\n return `'${value.replace(/'/g, \"'\\\\''\")}'`\n}\nexport const shellEscape = (value: string): string => value.replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n')\n"],
5
+ "mappings": "AAIO,MAAM,aAAa,CAAC,QAAQ,OAAe;AAChD,QAAM,OAAO;AACb,QAAM,cAAc,KAAK,KAAK,KAAK;AACnC,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,MAAM,QAAQ,MAAM,OAAO,CAAC;AACzC;AACO,MAAM,cAAc,CAAC,UAA0B,MAAM,QAAQ,OAAO,KAAK,EAAE,QAAQ,OAAO,KAAK;",
6
+ "names": []
7
+ }
@@ -0,0 +1,33 @@
1
+ import type { HarRequest as NpmHarRequest, FormDataParam as Param, PostDataCommon } from '@scalar/types/snippetz';
2
+ import type { ReducedHelperObject } from '../../httpsnippet-lite/helpers/reducer.js';
3
+ import type { ExtendedURL } from '../../httpsnippet-lite/helpers/url.js';
4
+ /**
5
+ * is this wrong? yes. according to the spec (http://www.softwareishard.com/blog/har-12-spec/#postData) it's technically wrong since `params` and `text` are (by the spec) mutually exclusive. However, in practice, this is not what is often the case.
6
+ *
7
+ * In general, this library takes a _descriptive_ rather than _perscriptive_ approach (see https://amyrey.web.unc.edu/classes/ling-101-online/tutorials/understanding-prescriptive-vs-descriptive-grammar/).
8
+ *
9
+ * Then, in addition to that, it really adds to complexity with TypeScript (TypeScript takes this constraint very very seriously) in a way that's not actually super useful. So, we treat this object as though it could have both or either of `params` and/or `text`.
10
+ */
11
+ type PostDataBase = PostDataCommon & {
12
+ text?: string;
13
+ params?: Param[];
14
+ };
15
+ type HarRequest = Omit<NpmHarRequest, 'postData'> & {
16
+ postData?: PostDataBase;
17
+ };
18
+ type RequestExtras = {
19
+ postData?: PostDataBase & {
20
+ jsonObj?: ReducedHelperObject;
21
+ paramsObj?: ReducedHelperObject;
22
+ boundary?: string;
23
+ };
24
+ fullUrl: string;
25
+ queryObj: ReducedHelperObject;
26
+ headersObj: ReducedHelperObject;
27
+ uriObj: ExtendedURL;
28
+ cookiesObj: ReducedHelperObject;
29
+ allHeaders: ReducedHelperObject;
30
+ };
31
+ export type SnippetRequest = HarRequest & RequestExtras;
32
+ export {};
33
+ //# sourceMappingURL=snippet-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snippet-request.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/snippet-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,aAAa,EAAE,aAAa,IAAI,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEjH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAEjE;;;;;;GAMG;AACH,KAAK,YAAY,GAAG,cAAc,GAAG;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;CACjB,CAAA;AACD,KAAK,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,GAAG;IAClD,QAAQ,CAAC,EAAE,YAAY,CAAA;CACxB,CAAA;AACD,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,EAAE,YAAY,GAAG;QACxB,OAAO,CAAC,EAAE,mBAAmB,CAAA;QAC7B,SAAS,CAAC,EAAE,mBAAmB,CAAA;QAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,UAAU,EAAE,mBAAmB,CAAA;IAC/B,MAAM,EAAE,WAAW,CAAA;IACnB,UAAU,EAAE,mBAAmB,CAAA;IAC/B,UAAU,EAAE,mBAAmB,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,aAAa,CAAA"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=snippet-request.js.map
@@ -0,0 +1,4 @@
1
+ export declare class ExtendedURL extends URL {
2
+ get path(): string;
3
+ }
4
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/url.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAY,SAAQ,GAAG;IAClC,IAAI,IAAI,WAEP;CACF"}
@@ -0,0 +1,9 @@
1
+ class ExtendedURL extends URL {
2
+ get path() {
3
+ return this.pathname + this.search;
4
+ }
5
+ }
6
+ export {
7
+ ExtendedURL
8
+ };
9
+ //# sourceMappingURL=url.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/httpsnippet-lite/helpers/url.ts"],
4
+ "sourcesContent": ["export class ExtendedURL extends URL {\n get path() {\n return this.pathname + this.search\n }\n}\n"],
5
+ "mappings": "AAAO,MAAM,oBAAoB,IAAI;AAAA,EACnC,IAAI,OAAO;AACT,WAAO,KAAK,WAAW,KAAK;AAAA,EAC9B;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { Client } from '../../../../httpsnippet-lite/targets/target.js';
2
+ export declare const libcurl: Client;
3
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/targets/c/libcurl/client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAG/D,eAAO,MAAM,OAAO,EAAE,MAkErB,CAAA"}
@@ -1,6 +1,6 @@
1
- import { createSearchParams } from "../../../../../libs/http.js";
2
- import { CodeBuilder } from "../../../helpers/code-builder.js";
3
- import { escapeForDoubleQuotes } from "../../../helpers/escape.js";
1
+ import { CodeBuilder } from "../../../../httpsnippet-lite/helpers/code-builder.js";
2
+ import { escapeForDoubleQuotes } from "../../../../httpsnippet-lite/helpers/escape.js";
3
+ import { createSearchParams } from "../../../../libs/http.js";
4
4
  const libcurl = {
5
5
  info: {
6
6
  key: "libcurl",
@@ -12,9 +12,7 @@ const libcurl = {
12
12
  const { push, blank, join } = new CodeBuilder({ indent: " " });
13
13
  push("CURL *hnd = curl_easy_init();");
14
14
  blank();
15
- push(
16
- `curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${method.toUpperCase()}");`
17
- );
15
+ push(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${method.toUpperCase()}");`);
18
16
  push(`curl_easy_setopt(hnd, CURLOPT_URL, "${fullUrl}");`);
19
17
  const headers = Object.keys(headersObj);
20
18
  if (headers.length) {
@@ -38,19 +36,15 @@ const libcurl = {
38
36
  if (postData !== null && postData !== void 0) {
39
37
  blank();
40
38
  if (postData.text) {
41
- push(
42
- `curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(postData.text)});`
43
- );
39
+ push(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(postData.text)});`);
44
40
  } else if (postData.mimeType === "application/x-www-form-urlencoded" && postData.params) {
45
- push(
46
- `curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "${createSearchParams(postData.params).toString()}");`
47
- );
41
+ push(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "${createSearchParams(postData.params).toString()}");`);
48
42
  } else if (postData.mimeType === "multipart/form-data" && postData.params) {
49
43
  push("curl_mime *mime = curl_mime_init(hnd);");
50
44
  postData.params.forEach((param) => {
51
45
  blank();
52
46
  push("{");
53
- push(`curl_mimepart *part = curl_mime_addpart(mime);`, 1);
47
+ push("curl_mimepart *part = curl_mime_addpart(mime);", 1);
54
48
  if (param.name) {
55
49
  push(`curl_mime_name(part, "${param.name}");`, 1);
56
50
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/httpsnippet-lite/targets/c/libcurl/client.ts"],
4
+ "sourcesContent": ["import { CodeBuilder } from '@/httpsnippet-lite/helpers/code-builder'\nimport { escapeForDoubleQuotes } from '@/httpsnippet-lite/helpers/escape'\nimport type { Client } from '@/httpsnippet-lite/targets/target'\nimport { createSearchParams } from '@/libs/http'\n\nexport const libcurl: Client = {\n info: {\n key: 'libcurl',\n title: 'Libcurl',\n link: 'http://curl.haxx.se/libcurl',\n description: 'Simple REST and HTTP API Client for C',\n },\n convert: ({ method, fullUrl, headersObj, allHeaders, postData }) => {\n const { push, blank, join } = new CodeBuilder({ indent: ' ' })\n push('CURL *hnd = curl_easy_init();')\n blank()\n push(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"${method.toUpperCase()}\");`)\n push(`curl_easy_setopt(hnd, CURLOPT_URL, \"${fullUrl}\");`)\n // Add headers, including the cookies\n const headers = Object.keys(headersObj)\n // construct headers\n if (headers.length) {\n blank()\n push('struct curl_slist *headers = NULL;')\n headers.forEach((header) => {\n // See https://curl.se/libcurl/c/httpcustomheader.html for syntax\n if (headersObj[header]) {\n push(\n `headers = curl_slist_append(headers, \"${header}: ${escapeForDoubleQuotes(headersObj[header] as string)}\");`,\n )\n } else {\n push(`headers = curl_slist_append(headers, \"${header};\");`)\n }\n })\n push('curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);')\n }\n // construct cookies\n if (allHeaders.cookie) {\n blank()\n push(`curl_easy_setopt(hnd, CURLOPT_COOKIE, \"${allHeaders.cookie}\");`)\n }\n if (postData !== null && postData !== void 0) {\n blank()\n if (postData.text) {\n push(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(postData.text)});`)\n } else if (postData.mimeType === 'application/x-www-form-urlencoded' && postData.params) {\n push(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"${createSearchParams(postData.params as never).toString()}\");`)\n } else if (postData.mimeType === 'multipart/form-data' && postData.params) {\n push('curl_mime *mime = curl_mime_init(hnd);')\n postData.params.forEach((param) => {\n blank()\n push('{')\n push('curl_mimepart *part = curl_mime_addpart(mime);', 1)\n if (param.name) {\n push(`curl_mime_name(part, \"${param.name}\");`, 1)\n }\n if (param.fileName) {\n push(`curl_mime_filedata(part, \"${param.fileName}\");`, 1)\n } else if (param.value) {\n push(`curl_mime_data(part, \"${escapeForDoubleQuotes(param.value)}\", CURL_ZERO_TERMINATED);`, 1)\n }\n push('}')\n })\n blank()\n push('curl_easy_setopt(hnd, CURLOPT_MIMEPOST, mime);')\n }\n }\n blank()\n push('CURLcode ret = curl_easy_perform(hnd);')\n return join()\n },\n}\n"],
5
+ "mappings": "AAAA,SAAS,mBAAmB;AAC5B,SA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AG;AACR,eAAK,kDAAkD,CAAC;AACxD,cAAI,MAAM,MAAM;AACd,iBAAK,yBAAyB,MAAM,IAAI,OAAO,CAAC;AAAA,UAClD;AACA,cAAI,MAAM,UAAU;AAClB,iBAAK,6BAA6B,MAAM,QAAQ,OAAO,CAAC;AAAA,UAC1D,WAAW,MAAM,OAAO;AACtB,iBAAK,yBAAyB,sBAAsB,MAAM,KAAK,CAAC,6BAA6B,CAAC;AAAA,UAChG;AACA,eAAK,GAAG;AAAA,QACV,CAAC;AACD,cAAM;AACN,aAAK,gDAAgD;AAAA,MACvD;AAAA,IACF;AACA,UAAM;AACN,SAAK,wCAAwC;AAC7C,WAAO,KAAK;AAAA,EACd;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @description
3
+ * HTTP code snippet generator for Clojure using clj-http.
4
+ *
5
+ * @author
6
+ * @tggreene
7
+ *
8
+ * for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
9
+ */
10
+ import type { Client } from '../../../../httpsnippet-lite/targets/target.js';
11
+ export declare const clj_http: Client;
12
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/targets/clojure/clj_http/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAgF/D,eAAO,MAAM,QAAQ,EAAE,MAuGtB,CAAA"}
@@ -1,6 +1,8 @@
1
- import { CodeBuilder } from "../../../helpers/code-builder.js";
2
- import { getHeader, getHeaderName } from "../../../helpers/headers.js";
1
+ import { CodeBuilder } from "../../../../httpsnippet-lite/helpers/code-builder.js";
2
+ import { getHeader, getHeaderName } from "../../../../httpsnippet-lite/helpers/headers.js";
3
3
  class Keyword {
4
+ name;
5
+ toString;
4
6
  constructor(name) {
5
7
  this.name = "";
6
8
  this.toString = () => `:${this.name}`;
@@ -8,6 +10,8 @@ class Keyword {
8
10
  }
9
11
  }
10
12
  class File {
13
+ path;
14
+ toString;
11
15
  constructor(path) {
12
16
  this.path = "";
13
17
  this.toString = () => `(clojure.java.io/file "${this.path}")`;
@@ -122,7 +126,7 @@ const clj_http = {
122
126
  }
123
127
  break;
124
128
  case "multipart/form-data": {
125
- if (postData.params) {
129
+ if (postData?.params) {
126
130
  params.multipart = postData.params.map((param) => {
127
131
  if (param.fileName && !param.value) {
128
132
  return {
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/httpsnippet-lite/targets/clojure/clj_http/client.ts"],
4
+ "sourcesContent": ["/**\n * @description\n * HTTP code snippet generator for Clojure using clj-http.\n *\n * @author\n * @tggreene\n *\n * for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.\n */\n\nimport { CodeBuilder } from '@/httpsnippet-lite/helpers/code-builder'\nimport { getHeader, getHeaderName } from '@/httpsnippet-lite/helpers/headers'\nimport type { ReducedHelperObject } from '@/httpsnippet-lite/helpers/reducer'\nimport type { Client } from '@/httpsnippet-lite/targets/target'\n\nclass Keyword {\n name: string\n toString: () => string\n\n constructor(name: string) {\n this.name = ''\n this.toString = () => `:${this.name}`\n this.name = name\n }\n}\nclass File {\n path: string\n toString: () => string\n\n constructor(path: string) {\n this.path = ''\n this.toString = () => `(clojure.java.io/file \"${this.path}\")`\n this.path = path\n }\n}\nconst jsType = (input: unknown): string | null => {\n if (input === undefined) {\n return null\n }\n if (input === null) {\n return 'null'\n }\n return input.constructor.name.toLowerCase()\n}\nconst objEmpty = (input: unknown): boolean => {\n if (jsType(input) === 'object') {\n return Object.keys(input as {}).length === 0\n }\n return false\n}\nconst filterEmpty = (input: Record<string, unknown>) => {\n Object.keys(input)\n .filter((x) => objEmpty(input[x]))\n .forEach((x) => {\n delete input[x]\n })\n return input\n}\nconst padBlock = (padSize: number, input: string): string => {\n const padding = ' '.repeat(padSize)\n return input.replace(/\\n/g, `\\n${padding}`)\n}\nconst jsToEdn = (js: any) => {\n switch (jsType(js)) {\n case 'string':\n return `\"${js.replace(/\"/g, '\\\\\"')}\"`\n case 'file':\n return js.toString()\n case 'keyword':\n return js.toString()\n case 'null':\n return 'nil'\n case 'regexp':\n return `#\"${js.source}\"`\n case 'object': {\n // simple vertical format\n const obj = Object.keys(js)\n .reduce((accumulator, key) => {\n const val = padBlock(key.length + 2, jsToEdn(js[key]))\n return `${accumulator}:${key} ${val}\\n `\n }, '')\n .trim()\n return `{${padBlock(1, obj)}}`\n }\n case 'array': {\n // simple horizontal format\n const arr = js.reduce((accumulator: string, value: any) => `${accumulator} ${jsToEdn(value)}`, '').trim()\n return `[${padBlock(1, arr)}]`\n }\n default: // 'number' 'boolean'\n return js.toString()\n }\n}\nexport const clj_http: Client = {\n info: {\n key: 'clj_http',\n title: 'clj-http',\n link: 'https://github.com/dakrone/clj-http',\n description: 'An idiomatic clojure http client wrapping the apache client.',\n },\n convert: ({ queryObj, method, postData, url, allHeaders }, options) => {\n const { push, join } = new CodeBuilder({\n indent: options === null || options === void 0 ? void 0 : options.indent,\n })\n const methods = ['get', 'post', 'put', 'delete', 'patch', 'head', 'options']\n method = method.toLowerCase()\n if (!methods.includes(method)) {\n push('Method not supported')\n return join()\n }\n const params: {\n 'headers': ReducedHelperObject\n 'query-params': ReducedHelperObject\n [key: string]: unknown\n } = {\n 'headers': allHeaders,\n 'query-params': queryObj,\n }\n\n // Remove query string from URL if queryObj has parameters\n if (queryObj && Object.keys(queryObj).length > 0) {\n url = url.split('?')[0]!\n }\n\n switch (postData === null || postData === void 0 ? void 0 : postData.mimeType) {\n case 'application/json':\n {\n params['content-type'] = new Keyword('json')\n params['form-params'] = postData!.jsonObj\n const header = getHeaderName(params.headers, 'content-type')\n if (header) {\n delete params.headers[header]\n }\n }\n break\n case 'application/x-www-form-urlencoded':\n {\n params['form-params'] = postData!.paramsObj\n const header = getHeaderName(params.headers, 'content-type')\n if (header) {\n delete params.headers[header]\n }\n }\n break\n case 'text/plain':\n {\n params.body = postData!.text\n const header = getHeaderName(params.headers, 'content-type')\n if (header) {\n delete params.headers[header]\n }\n }\n break\n case 'multipart/form-data': {\n if (postData?.params) {\n params.multipart = postData.params.map((param) => {\n if (param.fileName && !param.value) {\n return {\n name: param.name,\n content: new File(param.fileName),\n }\n }\n return {\n name: param.name,\n content: param.value,\n }\n })\n const header = getHeaderName(params.headers as Record<string, unknown>, 'content-type')\n if (header) {\n delete params.headers[header]\n }\n }\n break\n }\n }\n switch (getHeader(params.headers as Record<string, unknown>, 'accept')) {\n case 'application/json':\n {\n params.accept = new Keyword('json')\n const header = getHeaderName(params.headers as Record<string, unknown>, 'accept')\n if (header) {\n delete params.headers[header]\n }\n }\n break\n }\n push(\"(require '[clj-http.client :as client])\\n\")\n if (objEmpty(filterEmpty(params))) {\n push(`(client/${method} \"${url}\")`)\n } else {\n const padding = 11 + method.length + url.length\n const formattedParams = padBlock(padding, jsToEdn(filterEmpty(params)))\n push(`(client/${method} \"${url}\" ${formattedParams})`)\n }\n return join()\n },\n}\n"],
5
+ "mappings": "AAUA,SAAS,mBAAmB;AAC5B,SAAS,WAAW,qBAAqB;AAIzC,MAAM,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,EAEA,YAAY,MAAc;AACxB,SAAK,OAAO;AACZ,SAAK,WAAW,MAAM,IAAI,KAAK,IAAI;AACnC,SAAK,OAAO;AAAA,EACd;AACF;AACA,MAAM,KAAK;AAAA,EACT;AAAA,EACA;AAAA,EAEA,YAAY,MAAc;AACxB,SAAK,OAAO;AACZ,SAAK,WAAW,MAAM,0BAA0B,KAAK,IAAI;AACzD,SAAK,OAAO;AAAA,EACd;AACF;AACA,MAAM,SAAS,CAAC,UAAkC;AAChD,MAAI,UAAU,QAAW;AACvB,WAAO;AAAA,EACT;AACA,MAAI,UAAU,MAAM;AAClB,WAAO;AAAA,EACT;AACA,SAAO,MAAM,YAAY,KAAK,YAAY;AAC5C;AACA,MAAM,WAAW,CAAC,UAA4B;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.js';
2
+ export declare const restsharp: Client;
3
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/targets/csharp/restsharp/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAE/D,eAAO,MAAM,SAAS,EAAE,MAkCvB,CAAA"}