@scalar/snippetz 0.2.7 → 0.2.9

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 (318) hide show
  1. package/dist/clients.d.ts +6 -0
  2. package/dist/clients.d.ts.map +1 -0
  3. package/dist/clients.js +150 -0
  4. package/dist/httpsnippet-lite/esm/helpers/code-builder.d.ts +8 -0
  5. package/dist/httpsnippet-lite/esm/helpers/code-builder.d.ts.map +1 -0
  6. package/dist/httpsnippet-lite/esm/helpers/code-builder.js +62 -0
  7. package/dist/httpsnippet-lite/esm/helpers/escape.d.ts +29 -0
  8. package/dist/httpsnippet-lite/esm/helpers/escape.d.ts.map +1 -0
  9. package/dist/httpsnippet-lite/esm/helpers/escape.js +74 -0
  10. package/dist/httpsnippet-lite/esm/helpers/form-data.d.ts +3 -0
  11. package/dist/httpsnippet-lite/esm/helpers/form-data.d.ts.map +1 -0
  12. package/dist/httpsnippet-lite/esm/helpers/headers.d.ts +17 -0
  13. package/dist/httpsnippet-lite/esm/helpers/headers.d.ts.map +1 -0
  14. package/dist/httpsnippet-lite/esm/helpers/headers.js +22 -0
  15. package/dist/httpsnippet-lite/esm/helpers/reducer.d.ts +2 -0
  16. package/dist/httpsnippet-lite/esm/helpers/reducer.d.ts.map +1 -0
  17. package/dist/httpsnippet-lite/esm/helpers/shell.d.ts +7 -0
  18. package/dist/httpsnippet-lite/esm/helpers/shell.d.ts.map +1 -0
  19. package/dist/httpsnippet-lite/esm/helpers/shell.js +18 -0
  20. package/dist/httpsnippet-lite/esm/helpers/url.d.ts +5 -0
  21. package/dist/httpsnippet-lite/esm/helpers/url.d.ts.map +1 -0
  22. package/dist/httpsnippet-lite/esm/helpers/utils.d.ts +3 -0
  23. package/dist/httpsnippet-lite/esm/helpers/utils.d.ts.map +1 -0
  24. package/dist/httpsnippet-lite/esm/httpsnippet.d.ts +10 -0
  25. package/dist/httpsnippet-lite/esm/httpsnippet.d.ts.map +1 -0
  26. package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.d.ts +16 -0
  27. package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.d.ts.map +1 -0
  28. package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.js +45 -0
  29. package/dist/httpsnippet-lite/esm/targets/c/target.d.ts +26 -0
  30. package/dist/httpsnippet-lite/esm/targets/c/target.d.ts.map +1 -0
  31. package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.d.ts +16 -0
  32. package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.d.ts.map +1 -0
  33. package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.js +189 -0
  34. package/dist/httpsnippet-lite/esm/targets/clojure/target.d.ts +26 -0
  35. package/dist/httpsnippet-lite/esm/targets/clojure/target.d.ts.map +1 -0
  36. package/dist/httpsnippet-lite/esm/targets/csharp/httpclient/client.d.ts +15 -0
  37. package/dist/httpsnippet-lite/esm/targets/csharp/httpclient/client.d.ts.map +1 -0
  38. package/dist/httpsnippet-lite/esm/targets/csharp/httpclient/client.js +169 -0
  39. package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.d.ts +17 -0
  40. package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.d.ts.map +1 -0
  41. package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.js +49 -0
  42. package/dist/httpsnippet-lite/esm/targets/csharp/target.d.ts +41 -0
  43. package/dist/httpsnippet-lite/esm/targets/csharp/target.d.ts.map +1 -0
  44. package/dist/httpsnippet-lite/esm/targets/go/native/client.d.ts +15 -0
  45. package/dist/httpsnippet-lite/esm/targets/go/native/client.d.ts.map +1 -0
  46. package/dist/httpsnippet-lite/esm/targets/go/native/client.js +124 -0
  47. package/dist/httpsnippet-lite/esm/targets/go/target.d.ts +25 -0
  48. package/dist/httpsnippet-lite/esm/targets/go/target.d.ts.map +1 -0
  49. package/dist/httpsnippet-lite/esm/targets/http/http1.1/client.d.ts +22 -0
  50. package/dist/httpsnippet-lite/esm/targets/http/http1.1/client.d.ts.map +1 -0
  51. package/dist/httpsnippet-lite/esm/targets/http/http1.1/client.js +77 -0
  52. package/dist/httpsnippet-lite/esm/targets/http/target.d.ts +27 -0
  53. package/dist/httpsnippet-lite/esm/targets/http/target.d.ts.map +1 -0
  54. package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.d.ts +15 -0
  55. package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.d.ts.map +1 -0
  56. package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.js +47 -0
  57. package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.d.ts +15 -0
  58. package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.d.ts.map +1 -0
  59. package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.js +46 -0
  60. package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.d.ts +15 -0
  61. package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.d.ts.map +1 -0
  62. package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.js +73 -0
  63. package/dist/httpsnippet-lite/esm/targets/java/target.d.ts +67 -0
  64. package/dist/httpsnippet-lite/esm/targets/java/target.d.ts.map +1 -0
  65. package/dist/httpsnippet-lite/esm/targets/java/unirest/client.d.ts +15 -0
  66. package/dist/httpsnippet-lite/esm/targets/java/unirest/client.d.ts.map +1 -0
  67. package/dist/httpsnippet-lite/esm/targets/java/unirest/client.js +47 -0
  68. package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.d.ts +16 -0
  69. package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.d.ts.map +1 -0
  70. package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.js +91 -0
  71. package/dist/httpsnippet-lite/esm/targets/javascript/fetch/client.d.ts +15 -0
  72. package/dist/httpsnippet-lite/esm/targets/javascript/fetch/client.d.ts.map +1 -0
  73. package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.d.ts +15 -0
  74. package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.d.ts.map +1 -0
  75. package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.js +88 -0
  76. package/dist/httpsnippet-lite/esm/targets/javascript/target.d.ts +68 -0
  77. package/dist/httpsnippet-lite/esm/targets/javascript/target.d.ts.map +1 -0
  78. package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.d.ts +15 -0
  79. package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.d.ts.map +1 -0
  80. package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.js +86 -0
  81. package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.d.ts +15 -0
  82. package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.d.ts.map +1 -0
  83. package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.js +73 -0
  84. package/dist/httpsnippet-lite/esm/targets/kotlin/target.d.ts +25 -0
  85. package/dist/httpsnippet-lite/esm/targets/kotlin/target.d.ts.map +1 -0
  86. package/dist/httpsnippet-lite/esm/targets/node/axios/client.d.ts +16 -0
  87. package/dist/httpsnippet-lite/esm/targets/node/axios/client.d.ts.map +1 -0
  88. package/dist/httpsnippet-lite/esm/targets/node/axios/client.js +83 -0
  89. package/dist/httpsnippet-lite/esm/targets/node/fetch/client.d.ts +16 -0
  90. package/dist/httpsnippet-lite/esm/targets/node/fetch/client.d.ts.map +1 -0
  91. package/dist/httpsnippet-lite/esm/targets/node/native/client.d.ts +15 -0
  92. package/dist/httpsnippet-lite/esm/targets/node/native/client.d.ts.map +1 -0
  93. package/dist/httpsnippet-lite/esm/targets/node/request/client.d.ts +17 -0
  94. package/dist/httpsnippet-lite/esm/targets/node/request/client.d.ts.map +1 -0
  95. package/dist/httpsnippet-lite/esm/targets/node/target.d.ts +87 -0
  96. package/dist/httpsnippet-lite/esm/targets/node/target.d.ts.map +1 -0
  97. package/dist/httpsnippet-lite/esm/targets/node/unirest/client.d.ts +17 -0
  98. package/dist/httpsnippet-lite/esm/targets/node/unirest/client.d.ts.map +1 -0
  99. package/dist/httpsnippet-lite/esm/targets/objc/helpers.d.ts +27 -0
  100. package/dist/httpsnippet-lite/esm/targets/objc/helpers.d.ts.map +1 -0
  101. package/dist/httpsnippet-lite/esm/targets/objc/helpers.js +58 -0
  102. package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.d.ts +15 -0
  103. package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.d.ts.map +1 -0
  104. package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.js +132 -0
  105. package/dist/httpsnippet-lite/esm/targets/objc/target.d.ts +25 -0
  106. package/dist/httpsnippet-lite/esm/targets/objc/target.d.ts.map +1 -0
  107. package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.d.ts +15 -0
  108. package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.d.ts.map +1 -0
  109. package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.js +68 -0
  110. package/dist/httpsnippet-lite/esm/targets/ocaml/target.d.ts +25 -0
  111. package/dist/httpsnippet-lite/esm/targets/ocaml/target.d.ts.map +1 -0
  112. package/dist/httpsnippet-lite/esm/targets/php/curl/client.d.ts +18 -0
  113. package/dist/httpsnippet-lite/esm/targets/php/curl/client.d.ts.map +1 -0
  114. package/dist/httpsnippet-lite/esm/targets/php/curl/client.js +134 -0
  115. package/dist/httpsnippet-lite/esm/targets/php/guzzle/client.d.ts +16 -0
  116. package/dist/httpsnippet-lite/esm/targets/php/guzzle/client.d.ts.map +1 -0
  117. package/dist/httpsnippet-lite/esm/targets/php/guzzle/client.js +126 -0
  118. package/dist/httpsnippet-lite/esm/targets/php/helpers.d.ts +3 -0
  119. package/dist/httpsnippet-lite/esm/targets/php/helpers.d.ts.map +1 -0
  120. package/dist/httpsnippet-lite/esm/targets/php/helpers.js +37 -0
  121. package/dist/httpsnippet-lite/esm/targets/php/http1/client.d.ts +17 -0
  122. package/dist/httpsnippet-lite/esm/targets/php/http1/client.d.ts.map +1 -0
  123. package/dist/httpsnippet-lite/esm/targets/php/http2/client.d.ts +17 -0
  124. package/dist/httpsnippet-lite/esm/targets/php/http2/client.d.ts.map +1 -0
  125. package/dist/httpsnippet-lite/esm/targets/php/target.d.ts +75 -0
  126. package/dist/httpsnippet-lite/esm/targets/php/target.d.ts.map +1 -0
  127. package/dist/httpsnippet-lite/esm/targets/powershell/common.d.ts +10 -0
  128. package/dist/httpsnippet-lite/esm/targets/powershell/common.d.ts.map +1 -0
  129. package/dist/httpsnippet-lite/esm/targets/powershell/common.js +53 -0
  130. package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.d.ts +18 -0
  131. package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.d.ts.map +1 -0
  132. package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.js +15 -0
  133. package/dist/httpsnippet-lite/esm/targets/powershell/target.d.ts +45 -0
  134. package/dist/httpsnippet-lite/esm/targets/powershell/target.d.ts.map +1 -0
  135. package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.d.ts +18 -0
  136. package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.d.ts.map +1 -0
  137. package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.js +15 -0
  138. package/dist/httpsnippet-lite/esm/targets/python/helpers.d.ts +9 -0
  139. package/dist/httpsnippet-lite/esm/targets/python/helpers.d.ts.map +1 -0
  140. package/dist/httpsnippet-lite/esm/targets/python/helpers.js +63 -0
  141. package/dist/httpsnippet-lite/esm/targets/python/python3/client.d.ts +19 -0
  142. package/dist/httpsnippet-lite/esm/targets/python/python3/client.d.ts.map +1 -0
  143. package/dist/httpsnippet-lite/esm/targets/python/python3/client.js +95 -0
  144. package/dist/httpsnippet-lite/esm/targets/python/requests/client.d.ts +16 -0
  145. package/dist/httpsnippet-lite/esm/targets/python/requests/client.d.ts.map +1 -0
  146. package/dist/httpsnippet-lite/esm/targets/python/requests/client.js +177 -0
  147. package/dist/httpsnippet-lite/esm/targets/python/target.d.ts +44 -0
  148. package/dist/httpsnippet-lite/esm/targets/python/target.d.ts.map +1 -0
  149. package/dist/httpsnippet-lite/esm/targets/r/httr/client.d.ts +17 -0
  150. package/dist/httpsnippet-lite/esm/targets/r/httr/client.d.ts.map +1 -0
  151. package/dist/httpsnippet-lite/esm/targets/r/httr/client.js +127 -0
  152. package/dist/httpsnippet-lite/esm/targets/r/target.d.ts +27 -0
  153. package/dist/httpsnippet-lite/esm/targets/r/target.d.ts.map +1 -0
  154. package/dist/httpsnippet-lite/esm/targets/ruby/native/client.d.ts +16 -0
  155. package/dist/httpsnippet-lite/esm/targets/ruby/native/client.d.ts.map +1 -0
  156. package/dist/httpsnippet-lite/esm/targets/ruby/native/client.js +72 -0
  157. package/dist/httpsnippet-lite/esm/targets/ruby/target.d.ts +26 -0
  158. package/dist/httpsnippet-lite/esm/targets/ruby/target.d.ts.map +1 -0
  159. package/dist/httpsnippet-lite/esm/targets/shell/curl/client.d.ts +17 -0
  160. package/dist/httpsnippet-lite/esm/targets/shell/curl/client.d.ts.map +1 -0
  161. package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.d.ts +17 -0
  162. package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.d.ts.map +1 -0
  163. package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.js +118 -0
  164. package/dist/httpsnippet-lite/esm/targets/shell/target.d.ts +57 -0
  165. package/dist/httpsnippet-lite/esm/targets/shell/target.d.ts.map +1 -0
  166. package/dist/httpsnippet-lite/esm/targets/shell/wget/client.d.ts +15 -0
  167. package/dist/httpsnippet-lite/esm/targets/shell/wget/client.d.ts.map +1 -0
  168. package/dist/httpsnippet-lite/esm/targets/shell/wget/client.js +54 -0
  169. package/dist/httpsnippet-lite/esm/targets/swift/helpers.d.ts +17 -0
  170. package/dist/httpsnippet-lite/esm/targets/swift/helpers.d.ts.map +1 -0
  171. package/dist/httpsnippet-lite/esm/targets/swift/helpers.js +76 -0
  172. package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.d.ts +15 -0
  173. package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.d.ts.map +1 -0
  174. package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.js +137 -0
  175. package/dist/httpsnippet-lite/esm/targets/swift/target.d.ts +25 -0
  176. package/dist/httpsnippet-lite/esm/targets/swift/target.d.ts.map +1 -0
  177. package/dist/httpsnippet-lite/esm/targets/targets.d.ts +731 -0
  178. package/dist/httpsnippet-lite/esm/targets/targets.d.ts.map +1 -0
  179. package/dist/index.d.ts +1 -1
  180. package/dist/index.d.ts.map +1 -1
  181. package/dist/plugins/c/libcurl/libcurl.d.ts +1 -1
  182. package/dist/plugins/c/libcurl/libcurl.d.ts.map +1 -1
  183. package/dist/plugins/c/libcurl/libcurl.js +3 -2
  184. package/dist/plugins/clojure/clj_http/clj_http.d.ts +1 -1
  185. package/dist/plugins/clojure/clj_http/clj_http.d.ts.map +1 -1
  186. package/dist/plugins/clojure/clj_http/clj_http.js +3 -2
  187. package/dist/plugins/csharp/httpclient/httpclient.d.ts +1 -1
  188. package/dist/plugins/csharp/httpclient/httpclient.d.ts.map +1 -1
  189. package/dist/plugins/csharp/httpclient/httpclient.js +3 -2
  190. package/dist/plugins/csharp/restsharp/restsharp.d.ts +1 -1
  191. package/dist/plugins/csharp/restsharp/restsharp.d.ts.map +1 -1
  192. package/dist/plugins/csharp/restsharp/restsharp.js +3 -2
  193. package/dist/plugins/go/native/native.d.ts +1 -1
  194. package/dist/plugins/go/native/native.d.ts.map +1 -1
  195. package/dist/plugins/go/native/native.js +3 -2
  196. package/dist/plugins/http/http11/http11.d.ts +1 -1
  197. package/dist/plugins/http/http11/http11.d.ts.map +1 -1
  198. package/dist/plugins/http/http11/http11.js +3 -2
  199. package/dist/plugins/java/asynchttp/asynchttp.d.ts +1 -1
  200. package/dist/plugins/java/asynchttp/asynchttp.d.ts.map +1 -1
  201. package/dist/plugins/java/asynchttp/asynchttp.js +3 -2
  202. package/dist/plugins/java/nethttp/nethttp.d.ts +1 -1
  203. package/dist/plugins/java/nethttp/nethttp.d.ts.map +1 -1
  204. package/dist/plugins/java/nethttp/nethttp.js +3 -2
  205. package/dist/plugins/java/okhttp/okhttp.d.ts +1 -1
  206. package/dist/plugins/java/okhttp/okhttp.d.ts.map +1 -1
  207. package/dist/plugins/java/okhttp/okhttp.js +3 -2
  208. package/dist/plugins/java/unirest/unirest.d.ts +1 -1
  209. package/dist/plugins/java/unirest/unirest.d.ts.map +1 -1
  210. package/dist/plugins/java/unirest/unirest.js +3 -2
  211. package/dist/plugins/js/axios/axios.d.ts +1 -1
  212. package/dist/plugins/js/axios/axios.d.ts.map +1 -1
  213. package/dist/plugins/js/axios/axios.js +3 -2
  214. package/dist/plugins/js/fetch/fetch.d.ts +1 -1
  215. package/dist/plugins/js/fetch/fetch.d.ts.map +1 -1
  216. package/dist/plugins/js/fetch/fetch.js +3 -2
  217. package/dist/plugins/js/jquery/jquery.d.ts +1 -1
  218. package/dist/plugins/js/jquery/jquery.d.ts.map +1 -1
  219. package/dist/plugins/js/jquery/jquery.js +3 -2
  220. package/dist/plugins/js/ofetch/ofetch.d.ts +1 -1
  221. package/dist/plugins/js/ofetch/ofetch.d.ts.map +1 -1
  222. package/dist/plugins/js/ofetch/ofetch.js +3 -2
  223. package/dist/plugins/js/xhr/xhr.d.ts +1 -1
  224. package/dist/plugins/js/xhr/xhr.d.ts.map +1 -1
  225. package/dist/plugins/js/xhr/xhr.js +3 -2
  226. package/dist/plugins/kotlin/okhttp/okhttp.d.ts +1 -1
  227. package/dist/plugins/kotlin/okhttp/okhttp.d.ts.map +1 -1
  228. package/dist/plugins/kotlin/okhttp/okhttp.js +3 -2
  229. package/dist/plugins/node/axios/axios.d.ts +1 -1
  230. package/dist/plugins/node/axios/axios.d.ts.map +1 -1
  231. package/dist/plugins/node/axios/axios.js +3 -2
  232. package/dist/plugins/node/fetch/fetch.d.ts +1 -1
  233. package/dist/plugins/node/fetch/fetch.d.ts.map +1 -1
  234. package/dist/plugins/node/fetch/fetch.js +3 -2
  235. package/dist/plugins/node/ofetch/ofetch.d.ts +1 -1
  236. package/dist/plugins/node/ofetch/ofetch.d.ts.map +1 -1
  237. package/dist/plugins/node/ofetch/ofetch.js +3 -2
  238. package/dist/plugins/node/undici/undici.d.ts +1 -1
  239. package/dist/plugins/node/undici/undici.d.ts.map +1 -1
  240. package/dist/plugins/node/undici/undici.js +3 -2
  241. package/dist/plugins/objc/nsurlsession/nsurlsession.d.ts +1 -1
  242. package/dist/plugins/objc/nsurlsession/nsurlsession.d.ts.map +1 -1
  243. package/dist/plugins/objc/nsurlsession/nsurlsession.js +3 -2
  244. package/dist/plugins/ocaml/cohttp/cohttp.d.ts +1 -1
  245. package/dist/plugins/ocaml/cohttp/cohttp.d.ts.map +1 -1
  246. package/dist/plugins/ocaml/cohttp/cohttp.js +3 -2
  247. package/dist/plugins/php/curl/curl.d.ts +1 -1
  248. package/dist/plugins/php/curl/curl.d.ts.map +1 -1
  249. package/dist/plugins/php/curl/curl.js +3 -2
  250. package/dist/plugins/php/guzzle/guzzle.d.ts +1 -1
  251. package/dist/plugins/php/guzzle/guzzle.d.ts.map +1 -1
  252. package/dist/plugins/php/guzzle/guzzle.js +3 -2
  253. package/dist/plugins/powershell/restmethod/restmethod.d.ts +1 -1
  254. package/dist/plugins/powershell/restmethod/restmethod.d.ts.map +1 -1
  255. package/dist/plugins/powershell/restmethod/restmethod.js +3 -2
  256. package/dist/plugins/powershell/webrequest/webrequest.d.ts +1 -1
  257. package/dist/plugins/powershell/webrequest/webrequest.d.ts.map +1 -1
  258. package/dist/plugins/powershell/webrequest/webrequest.js +3 -2
  259. package/dist/plugins/python/python3/python3.d.ts +1 -1
  260. package/dist/plugins/python/python3/python3.d.ts.map +1 -1
  261. package/dist/plugins/python/python3/python3.js +3 -2
  262. package/dist/plugins/python/requests/requests.d.ts +1 -1
  263. package/dist/plugins/python/requests/requests.d.ts.map +1 -1
  264. package/dist/plugins/python/requests/requests.js +3 -2
  265. package/dist/plugins/r/httr/httr.d.ts +1 -1
  266. package/dist/plugins/r/httr/httr.d.ts.map +1 -1
  267. package/dist/plugins/r/httr/httr.js +3 -2
  268. package/dist/plugins/ruby/native/native.d.ts +1 -1
  269. package/dist/plugins/ruby/native/native.d.ts.map +1 -1
  270. package/dist/plugins/ruby/native/native.js +3 -2
  271. package/dist/plugins/shell/curl/curl.d.ts +1 -1
  272. package/dist/plugins/shell/curl/curl.d.ts.map +1 -1
  273. package/dist/plugins/shell/curl/curl.js +1 -0
  274. package/dist/plugins/shell/httpie/httpie.d.ts +1 -1
  275. package/dist/plugins/shell/httpie/httpie.d.ts.map +1 -1
  276. package/dist/plugins/shell/httpie/httpie.js +3 -2
  277. package/dist/plugins/shell/wget/wget.d.ts +1 -1
  278. package/dist/plugins/shell/wget/wget.d.ts.map +1 -1
  279. package/dist/plugins/shell/wget/wget.js +3 -2
  280. package/dist/plugins/swift/nsurlsession/nsurlsession.d.ts +1 -1
  281. package/dist/plugins/swift/nsurlsession/nsurlsession.d.ts.map +1 -1
  282. package/dist/plugins/swift/nsurlsession/nsurlsession.js +3 -2
  283. package/dist/snippetz.d.ts +4 -6
  284. package/dist/snippetz.d.ts.map +1 -1
  285. package/dist/snippetz.js +10 -91
  286. package/dist/{core/types.d.ts → types/index.d.ts} +15 -4
  287. package/dist/types/index.d.ts.map +1 -0
  288. package/dist/types/index.js +1 -0
  289. package/dist/types/index.test-d.d.ts +2 -0
  290. package/dist/types/index.test-d.d.ts.map +1 -0
  291. package/dist/utils/arrayToObject.d.ts.map +1 -0
  292. package/dist/utils/convertWithHttpSnippetLite.d.ts +6 -0
  293. package/dist/utils/convertWithHttpSnippetLite.d.ts.map +1 -0
  294. package/dist/utils/convertWithHttpSnippetLite.js +95 -0
  295. package/dist/utils/index.d.ts +5 -0
  296. package/dist/utils/index.d.ts.map +1 -0
  297. package/dist/utils/index.js +4 -0
  298. package/dist/utils/needsQuotes.d.ts.map +1 -0
  299. package/dist/utils/objectToString.d.ts.map +1 -0
  300. package/package.json +11 -7
  301. package/dist/core/index.d.ts +0 -5
  302. package/dist/core/index.d.ts.map +0 -1
  303. package/dist/core/index.js +0 -3
  304. package/dist/core/types.d.ts.map +0 -1
  305. package/dist/core/types.test-d.d.ts +0 -2
  306. package/dist/core/types.test-d.d.ts.map +0 -1
  307. package/dist/core/utils/arrayToObject.d.ts.map +0 -1
  308. package/dist/core/utils/convertWithHttpSnippetLite.d.ts +0 -7
  309. package/dist/core/utils/convertWithHttpSnippetLite.d.ts.map +0 -1
  310. package/dist/core/utils/convertWithHttpSnippetLite.js +0 -83
  311. package/dist/core/utils/needsQuotes.d.ts.map +0 -1
  312. package/dist/core/utils/objectToString.d.ts.map +0 -1
  313. /package/dist/{core/utils → utils}/arrayToObject.d.ts +0 -0
  314. /package/dist/{core/utils → utils}/arrayToObject.js +0 -0
  315. /package/dist/{core/utils → utils}/needsQuotes.d.ts +0 -0
  316. /package/dist/{core/utils → utils}/needsQuotes.js +0 -0
  317. /package/dist/{core/utils → utils}/objectToString.d.ts +0 -0
  318. /package/dist/{core/utils → utils}/objectToString.js +0 -0
@@ -1,5 +1,5 @@
1
- import { arrayToObject } from '../../../core/utils/arrayToObject.js';
2
- import { objectToString } from '../../../core/utils/objectToString.js';
1
+ import { arrayToObject } from '../../../utils/arrayToObject.js';
2
+ import { objectToString } from '../../../utils/objectToString.js';
3
3
 
4
4
  /**
5
5
  * node/undici
@@ -7,6 +7,7 @@ import { objectToString } from '../../../core/utils/objectToString.js';
7
7
  const nodeUndici = {
8
8
  target: 'node',
9
9
  client: 'undici',
10
+ title: 'undici',
10
11
  generate(request) {
11
12
  // Defaults
12
13
  const normalizedRequest = {
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * objc/nsurlsession
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"nsurlsession.d.ts","sourceRoot":"","sources":["../../../../src/plugins/objc/nsurlsession/nsurlsession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAO9B,CAAA"}
1
+ {"version":3,"file":"nsurlsession.d.ts","sourceRoot":"","sources":["../../../../src/plugins/objc/nsurlsession/nsurlsession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAQ9B,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { nsurlsession } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/objc/nsurlsession/client.mjs';
1
+ import { nsurlsession } from '../../../httpsnippet-lite/esm/targets/objc/nsurlsession/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * objc/nsurlsession
@@ -7,6 +7,7 @@ import { nsurlsession } from '../../../../node_modules/httpsnippet-lite/dist/esm
7
7
  const objcNsurlsession = {
8
8
  target: 'objc',
9
9
  client: 'nsurlsession',
10
+ title: 'NSURLSession',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(nsurlsession, request);
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * ocaml/cohttp
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"cohttp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/ocaml/cohttp/cohttp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAOzB,CAAA"}
1
+ {"version":3,"file":"cohttp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/ocaml/cohttp/cohttp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAQzB,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { cohttp } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/ocaml/cohttp/client.mjs';
1
+ import { cohttp } from '../../../httpsnippet-lite/esm/targets/ocaml/cohttp/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * ocaml/cohttp
@@ -7,6 +7,7 @@ import { cohttp } from '../../../../node_modules/httpsnippet-lite/dist/esm/targe
7
7
  const ocamlCohttp = {
8
8
  target: 'ocaml',
9
9
  client: 'cohttp',
10
+ title: 'Cohttp',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(cohttp, request);
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * php/curl
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../../src/plugins/php/curl/curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAOrB,CAAA"}
1
+ {"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../../src/plugins/php/curl/curl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAQrB,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { curl } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/php/curl/client.mjs';
1
+ import { curl } from '../../../httpsnippet-lite/esm/targets/php/curl/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * php/curl
@@ -7,6 +7,7 @@ import { curl } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets
7
7
  const phpCurl = {
8
8
  target: 'php',
9
9
  client: 'curl',
10
+ title: 'cURL',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(curl, request);
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * php/guzzle
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"guzzle.d.ts","sourceRoot":"","sources":["../../../../src/plugins/php/guzzle/guzzle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAOvB,CAAA"}
1
+ {"version":3,"file":"guzzle.d.ts","sourceRoot":"","sources":["../../../../src/plugins/php/guzzle/guzzle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAQvB,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { guzzle } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/php/guzzle/client.mjs';
1
+ import { guzzle } from '../../../httpsnippet-lite/esm/targets/php/guzzle/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * php/guzzle
@@ -7,6 +7,7 @@ import { guzzle } from '../../../../node_modules/httpsnippet-lite/dist/esm/targe
7
7
  const phpGuzzle = {
8
8
  target: 'php',
9
9
  client: 'guzzle',
10
+ title: 'Guzzle',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(guzzle, request);
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * powershell/restmethod
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"restmethod.d.ts","sourceRoot":"","sources":["../../../../src/plugins/powershell/restmethod/restmethod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAOlC,CAAA"}
1
+ {"version":3,"file":"restmethod.d.ts","sourceRoot":"","sources":["../../../../src/plugins/powershell/restmethod/restmethod.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAQlC,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { restmethod } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/powershell/restmethod/client.mjs';
1
+ import { restmethod } from '../../../httpsnippet-lite/esm/targets/powershell/restmethod/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * powershell/restmethod
@@ -7,6 +7,7 @@ import { restmethod } from '../../../../node_modules/httpsnippet-lite/dist/esm/t
7
7
  const powershellRestmethod = {
8
8
  target: 'powershell',
9
9
  client: 'restmethod',
10
+ title: 'Invoke-RestMethod',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(restmethod, request);
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * powershell/webrequest
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"webrequest.d.ts","sourceRoot":"","sources":["../../../../src/plugins/powershell/webrequest/webrequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAOlC,CAAA"}
1
+ {"version":3,"file":"webrequest.d.ts","sourceRoot":"","sources":["../../../../src/plugins/powershell/webrequest/webrequest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAQlC,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { webrequest } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/powershell/webrequest/client.mjs';
1
+ import { webrequest } from '../../../httpsnippet-lite/esm/targets/powershell/webrequest/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * powershell/webrequest
@@ -7,6 +7,7 @@ import { webrequest } from '../../../../node_modules/httpsnippet-lite/dist/esm/t
7
7
  const powershellWebrequest = {
8
8
  target: 'powershell',
9
9
  client: 'webrequest',
10
+ title: 'Invoke-WebRequest',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(webrequest, request);
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * python/python3
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"python3.d.ts","sourceRoot":"","sources":["../../../../src/plugins/python/python3/python3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAO3B,CAAA"}
1
+ {"version":3,"file":"python3.d.ts","sourceRoot":"","sources":["../../../../src/plugins/python/python3/python3.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAQ3B,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { python3 } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/python/python3/client.mjs';
1
+ import { python3 } from '../../../httpsnippet-lite/esm/targets/python/python3/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * python/python3
@@ -7,6 +7,7 @@ import { python3 } from '../../../../node_modules/httpsnippet-lite/dist/esm/targ
7
7
  const pythonPython3 = {
8
8
  target: 'python',
9
9
  client: 'python3',
10
+ title: 'http.client',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(python3, request);
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * python/requests
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/plugins/python/requests/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAO5B,CAAA"}
1
+ {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/plugins/python/requests/requests.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAQ5B,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { requests } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/python/requests/client.mjs';
1
+ import { requests } from '../../../httpsnippet-lite/esm/targets/python/requests/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * python/requests
@@ -7,6 +7,7 @@ import { requests } from '../../../../node_modules/httpsnippet-lite/dist/esm/tar
7
7
  const pythonRequests = {
8
8
  target: 'python',
9
9
  client: 'requests',
10
+ title: 'Requests',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(requests, request);
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * r/httr
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"httr.d.ts","sourceRoot":"","sources":["../../../../src/plugins/r/httr/httr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,MAOnB,CAAA"}
1
+ {"version":3,"file":"httr.d.ts","sourceRoot":"","sources":["../../../../src/plugins/r/httr/httr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,MAQnB,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { httr } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/r/httr/client.mjs';
1
+ import { httr } from '../../../httpsnippet-lite/esm/targets/r/httr/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * r/httr
@@ -7,6 +7,7 @@ import { httr } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets
7
7
  const rHttr = {
8
8
  target: 'r',
9
9
  client: 'httr',
10
+ title: 'httr',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(httr, request);
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * ruby/native
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../src/plugins/ruby/native/native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAOxB,CAAA"}
1
+ {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../src/plugins/ruby/native/native.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAQxB,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { native } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/ruby/native/client.mjs';
1
+ import { native } from '../../../httpsnippet-lite/esm/targets/ruby/native/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * ruby/native
@@ -7,6 +7,7 @@ import { native } from '../../../../node_modules/httpsnippet-lite/dist/esm/targe
7
7
  const rubyNative = {
8
8
  target: 'ruby',
9
9
  client: 'native',
10
+ title: 'net::http',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(native, request);
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * shell/curl
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../../src/plugins/shell/curl/curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAoHvB,CAAA"}
1
+ {"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../../src/plugins/shell/curl/curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAqHvB,CAAA"}
@@ -4,6 +4,7 @@
4
4
  const shellCurl = {
5
5
  target: 'shell',
6
6
  client: 'curl',
7
+ title: 'Curl',
7
8
  generate(request, configuration) {
8
9
  // Defaults
9
10
  const normalizedRequest = {
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * shell/httpie
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"httpie.d.ts","sourceRoot":"","sources":["../../../../src/plugins/shell/httpie/httpie.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAOzB,CAAA"}
1
+ {"version":3,"file":"httpie.d.ts","sourceRoot":"","sources":["../../../../src/plugins/shell/httpie/httpie.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAQzB,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { httpie } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/shell/httpie/client.mjs';
1
+ import { httpie } from '../../../httpsnippet-lite/esm/targets/shell/httpie/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * shell/httpie
@@ -7,6 +7,7 @@ import { httpie } from '../../../../node_modules/httpsnippet-lite/dist/esm/targe
7
7
  const shellHttpie = {
8
8
  target: 'shell',
9
9
  client: 'httpie',
10
+ title: 'HTTPie',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(httpie, request);
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * shell/wget
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"wget.d.ts","sourceRoot":"","sources":["../../../../src/plugins/shell/wget/wget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAOvB,CAAA"}
1
+ {"version":3,"file":"wget.d.ts","sourceRoot":"","sources":["../../../../src/plugins/shell/wget/wget.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAQvB,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { wget } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/shell/wget/client.mjs';
1
+ import { wget } from '../../../httpsnippet-lite/esm/targets/shell/wget/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * shell/wget
@@ -7,6 +7,7 @@ import { wget } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets
7
7
  const shellWget = {
8
8
  target: 'shell',
9
9
  client: 'wget',
10
+ title: 'Wget',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(wget, request);
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../core/index.js';
1
+ import type { Plugin } from '../../../types/index.js';
2
2
  /**
3
3
  * swift/nsurlsession
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"nsurlsession.d.ts","sourceRoot":"","sources":["../../../../src/plugins/swift/nsurlsession/nsurlsession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKpC;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAO/B,CAAA"}
1
+ {"version":3,"file":"nsurlsession.d.ts","sourceRoot":"","sources":["../../../../src/plugins/swift/nsurlsession/nsurlsession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAQ/B,CAAA"}
@@ -1,5 +1,5 @@
1
- import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
2
- import { nsurlsession } from '../../../../node_modules/httpsnippet-lite/dist/esm/targets/swift/nsurlsession/client.mjs';
1
+ import { nsurlsession } from '../../../httpsnippet-lite/esm/targets/swift/nsurlsession/client.js';
2
+ import { convertWithHttpSnippetLite } from '../../../utils/convertWithHttpSnippetLite.js';
3
3
 
4
4
  /**
5
5
  * swift/nsurlsession
@@ -7,6 +7,7 @@ import { nsurlsession } from '../../../../node_modules/httpsnippet-lite/dist/esm
7
7
  const swiftNsurlsession = {
8
8
  target: 'swift',
9
9
  client: 'nsurlsession',
10
+ title: 'NSURLSession',
10
11
  generate(request) {
11
12
  // TODO: Write an own converter
12
13
  return convertWithHttpSnippetLite(nsurlsession, request);
@@ -1,17 +1,15 @@
1
- import type { ClientId, Plugin, Request, TargetId } from './core/index.js';
1
+ import type { ClientId, HarRequest, TargetId } from './types/index.js';
2
2
  /**
3
3
  * Generate code examples for HAR requests
4
4
  */
5
5
  export declare function snippetz(): {
6
- get(target: TargetId, client: ClientId<TargetId>): Plugin | undefined;
7
- print<T extends TargetId>(target: T, client: ClientId<T>, request: Partial<Request>): string | undefined;
8
- targets(): ("c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift")[];
9
- clients(): ("libcurl" | "clj_http" | "httpclient" | "restsharp" | "native" | "http1.1" | "asynchttp" | "nethttp" | "okhttp" | "unirest" | "axios" | "fetch" | "jquery" | "ofetch" | "xhr" | "undici" | "nsurlsession" | "cohttp" | "curl" | "guzzle" | "restmethod" | "webrequest" | "python3" | "requests" | "httr" | "httpie" | "wget")[];
6
+ print<T extends TargetId>(target: T, client: ClientId<T>, request: Partial<HarRequest>): string | undefined;
7
+ clients(): import("./types/index.js").Target[];
10
8
  plugins(): {
11
9
  target: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift";
12
10
  client: "libcurl" | "clj_http" | "httpclient" | "restsharp" | "native" | "http1.1" | "asynchttp" | "nethttp" | "okhttp" | "unirest" | "axios" | "fetch" | "jquery" | "ofetch" | "xhr" | "undici" | "nsurlsession" | "cohttp" | "curl" | "guzzle" | "restmethod" | "webrequest" | "python3" | "requests" | "httr" | "httpie" | "wget";
13
11
  }[];
14
- findPlugin<T extends TargetId>(target: T | string, client: ClientId<T> | string): Plugin | undefined;
12
+ findPlugin<T extends TargetId>(target: T | string, client: ClientId<T> | string): import("./types/index.js").Plugin | undefined;
15
13
  hasPlugin<T extends TargetId>(target: T | string, client: ClientId<T> | string): boolean;
16
14
  };
17
15
  //# sourceMappingURL=snippetz.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"snippetz.d.ts","sourceRoot":"","sources":["../src/snippetz.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEjE;;GAEG;AACH,wBAAgB,QAAQ;gBAuCR,QAAQ,UAAU,QAAQ,CAAC,QAAQ,CAAC;UAG1C,CAAC,SAAS,QAAQ,UACd,CAAC,UACD,QAAQ,CAAC,CAAC,CAAC,WACV,OAAO,CAAC,OAAO,CAAC;;;;;;;eAwBhB,CAAC,SAAS,QAAQ,UACnB,CAAC,GAAG,MAAM,UACV,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;cAMpB,CAAC,SAAS,QAAQ,UAClB,CAAC,GAAG,MAAM,UACV,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;EAKjC"}
1
+ {"version":3,"file":"snippetz.d.ts","sourceRoot":"","sources":["../src/snippetz.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE7D;;GAEG;AACH,wBAAgB,QAAQ;UAEd,CAAC,SAAS,QAAQ,UACd,CAAC,UACD,QAAQ,CAAC,CAAC,CAAC,WACV,OAAO,CAAC,UAAU,CAAC;;;;;;eAenB,CAAC,SAAS,QAAQ,UACnB,CAAC,GAAG,MAAM,UACV,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;cAMpB,CAAC,SAAS,QAAQ,UAClB,CAAC,GAAG,MAAM,UACV,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;EAKjC"}
package/dist/snippetz.js CHANGED
@@ -1,107 +1,26 @@
1
- import { cLibcurl } from './plugins/c/libcurl/libcurl.js';
2
- import { javaNethttp } from './plugins/java/nethttp/nethttp.js';
3
- import { javaOkhttp } from './plugins/java/okhttp/okhttp.js';
4
- import { javaUnirest } from './plugins/java/unirest/unirest.js';
5
- import { clojureCljhttp } from './plugins/clojure/clj_http/clj_http.js';
6
- import { csharpHttpclient } from './plugins/csharp/httpclient/httpclient.js';
7
- import { csharpRestsharp } from './plugins/csharp/restsharp/restsharp.js';
8
- import { goNative } from './plugins/go/native/native.js';
9
- import { httpHttp11 } from './plugins/http/http11/http11.js';
10
- import { javaAsynchttp } from './plugins/java/asynchttp/asynchttp.js';
11
- import { jsAxios } from './plugins/js/axios/axios.js';
12
- import { jsFetch } from './plugins/js/fetch/fetch.js';
13
- import { jsJquery } from './plugins/js/jquery/jquery.js';
14
- import { jsOfetch } from './plugins/js/ofetch/ofetch.js';
15
- import { jsXhr } from './plugins/js/xhr/xhr.js';
16
- import { kotlinOkhttp } from './plugins/kotlin/okhttp/okhttp.js';
17
- import { nodeAxios } from './plugins/node/axios/axios.js';
18
- import { nodeFetch } from './plugins/node/fetch/fetch.js';
19
- import { nodeOfetch } from './plugins/node/ofetch/ofetch.js';
20
- import { nodeUndici } from './plugins/node/undici/undici.js';
21
- import { objcNsurlsession } from './plugins/objc/nsurlsession/nsurlsession.js';
22
- import { ocamlCohttp } from './plugins/ocaml/cohttp/cohttp.js';
23
- import { phpCurl } from './plugins/php/curl/curl.js';
24
- import { phpGuzzle } from './plugins/php/guzzle/guzzle.js';
25
- import { powershellRestmethod } from './plugins/powershell/restmethod/restmethod.js';
26
- import { powershellWebrequest } from './plugins/powershell/webrequest/webrequest.js';
27
- import { pythonPython3 } from './plugins/python/python3/python3.js';
28
- import { pythonRequests } from './plugins/python/requests/requests.js';
29
- import { rHttr } from './plugins/r/httr/httr.js';
30
- import { rubyNative } from './plugins/ruby/native/native.js';
31
- import { shellCurl } from './plugins/shell/curl/curl.js';
32
- import { shellHttpie } from './plugins/shell/httpie/httpie.js';
33
- import { shellWget } from './plugins/shell/wget/wget.js';
34
- import { swiftNsurlsession } from './plugins/swift/nsurlsession/nsurlsession.js';
1
+ import { clients } from './clients.js';
35
2
 
36
3
  /**
37
4
  * Generate code examples for HAR requests
38
5
  */
39
6
  function snippetz() {
40
- const plugins = [
41
- cLibcurl,
42
- clojureCljhttp,
43
- csharpHttpclient,
44
- csharpRestsharp,
45
- goNative,
46
- httpHttp11,
47
- javaAsynchttp,
48
- javaNethttp,
49
- javaOkhttp,
50
- javaUnirest,
51
- jsAxios,
52
- jsFetch,
53
- jsJquery,
54
- jsOfetch,
55
- jsXhr,
56
- kotlinOkhttp,
57
- nodeAxios,
58
- nodeFetch,
59
- nodeOfetch,
60
- nodeUndici,
61
- objcNsurlsession,
62
- ocamlCohttp,
63
- phpCurl,
64
- phpGuzzle,
65
- powershellRestmethod,
66
- powershellWebrequest,
67
- pythonPython3,
68
- pythonRequests,
69
- rHttr,
70
- rubyNative,
71
- shellCurl,
72
- shellHttpie,
73
- shellWget,
74
- swiftNsurlsession,
75
- ];
76
7
  return {
77
- get(target, client) {
78
- return this.findPlugin(target, client);
79
- },
80
8
  print(target, client, request) {
81
- return this.get(target, client)?.generate(request);
82
- },
83
- targets() {
84
- return (plugins
85
- // all targets
86
- .map((plugin) => plugin.target)
87
- // unique values
88
- .filter((value, index, self) => self.indexOf(value) === index));
9
+ return this.findPlugin(target, client)?.generate(request);
89
10
  },
90
11
  clients() {
91
- return plugins.map((plugin) => plugin.client);
12
+ return clients;
92
13
  },
93
14
  plugins() {
94
- return plugins.map((plugin) => {
95
- return {
96
- target: plugin.target,
97
- client: plugin.client,
98
- };
99
- });
15
+ return clients.flatMap(({ key, clients }) => clients.map((plugin) => ({
16
+ target: key,
17
+ client: plugin.client,
18
+ })));
100
19
  },
101
20
  findPlugin(target, client) {
102
- return plugins.find((plugin) => {
103
- return plugin.target === target && plugin.client === client;
104
- });
21
+ return clients
22
+ .find(({ key }) => key === target)
23
+ ?.clients.find((plugin) => plugin.client === client);
105
24
  },
106
25
  hasPlugin(target, client) {
107
26
  return Boolean(this.findPlugin(target, client));
@@ -1,5 +1,5 @@
1
- import type { Request } from 'har-format';
2
- export type { Request } from 'har-format';
1
+ import type { Request as HarRequest } from 'har-format';
2
+ export type { Request as HarRequest } from 'har-format';
3
3
  /**
4
4
  * List of available clients
5
5
  */
@@ -41,6 +41,15 @@ export type AvailableClients = [
41
41
  ];
42
42
  /** Programming language */
43
43
  export type TargetId = AvailableClients[number] extends `${infer T}/${string}` ? T : never;
44
+ /** Configuration for a target */
45
+ export type Target = {
46
+ [K in TargetId]: {
47
+ key: K;
48
+ title: string;
49
+ default: ClientId<K>;
50
+ clients: Plugin[];
51
+ };
52
+ }[TargetId];
44
53
  /** HTTP client */
45
54
  export type ClientId<T extends string> = T extends TargetId ? Extract<AvailableClients[number], `${T}/${string}`> extends `${T}/${infer C}` ? C : never : never;
46
55
  /** What any plugins needs to return */
@@ -49,8 +58,10 @@ export type Plugin = {
49
58
  target: TargetId;
50
59
  /** The identifier of the client. */
51
60
  client: ClientId<TargetId>;
61
+ /** The title of the client. */
62
+ title: string;
52
63
  /** The actual source code. */
53
- generate: (request?: Partial<Request>, configuration?: PluginConfiguration) => string;
64
+ generate: (request?: Partial<HarRequest>, configuration?: PluginConfiguration) => string;
54
65
  };
55
66
  /**
56
67
  * Optional configuration for any plugin
@@ -62,4 +73,4 @@ export type PluginConfiguration = {
62
73
  password: string;
63
74
  };
64
75
  };
65
- //# sourceMappingURL=types.d.ts.map
76
+ //# sourceMappingURL=index.d.ts.map