@scalar/snippetz 0.2.8 → 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/{dist/esm → esm}/helpers/code-builder.js +4 -2
  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/{dist/esm → esm}/helpers/escape.js +3 -1
  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/{dist/esm → esm}/helpers/headers.js +3 -1
  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/{dist/esm → esm}/helpers/shell.js +2 -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/{_virtual/client28.js → httpsnippet-lite/esm/targets/c/libcurl/client.js} +5 -3
  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/{_virtual/client27.js → httpsnippet-lite/esm/targets/clojure/clj_http/client.js} +15 -7
  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/{_virtual/client26.js → httpsnippet-lite/esm/targets/csharp/httpclient/client.js} +45 -30
  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/{_virtual/client25.js → httpsnippet-lite/esm/targets/csharp/restsharp/client.js} +20 -8
  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/{_virtual/client24.js → httpsnippet-lite/esm/targets/go/native/client.js} +5 -3
  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/{_virtual/client23.js → httpsnippet-lite/esm/targets/http/http1.1/client.js} +10 -4
  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/{_virtual/client22.js → httpsnippet-lite/esm/targets/java/asynchttp/client.js} +5 -3
  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/{_virtual/client20.js → httpsnippet-lite/esm/targets/java/nethttp/client.js} +5 -3
  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/{_virtual/client21.js → httpsnippet-lite/esm/targets/java/okhttp/client.js} +5 -3
  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/{_virtual/client19.js → httpsnippet-lite/esm/targets/java/unirest/client.js} +5 -3
  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/{_virtual/client18.js → httpsnippet-lite/esm/targets/javascript/axios/client.js} +9 -5
  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/{_virtual/client17.js → httpsnippet-lite/esm/targets/javascript/jquery/client.js} +13 -6
  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/{_virtual/client15.js → httpsnippet-lite/esm/targets/javascript/xhr/client.js} +12 -7
  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/{_virtual/client14.js → httpsnippet-lite/esm/targets/kotlin/okhttp/client.js} +5 -3
  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/{_virtual/client16.js → httpsnippet-lite/esm/targets/node/axios/client.js} +12 -5
  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/{dist/esm → esm}/targets/objc/helpers.js +2 -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/{_virtual/client13.js → httpsnippet-lite/esm/targets/objc/nsurlsession/client.js} +8 -4
  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/{_virtual/client12.js → httpsnippet-lite/esm/targets/ocaml/cohttp/client.js} +8 -4
  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/{_virtual/client11.js → httpsnippet-lite/esm/targets/php/curl/client.js} +13 -7
  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/{_virtual/client10.js → httpsnippet-lite/esm/targets/php/guzzle/client.js} +12 -7
  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/{dist/esm → esm}/targets/php/helpers.js +2 -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/{dist/esm → esm}/targets/powershell/common.js +4 -2
  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/{_virtual/client9.js → httpsnippet-lite/esm/targets/powershell/restmethod/client.js} +3 -1
  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/{_virtual/client8.js → httpsnippet-lite/esm/targets/powershell/webrequest/client.js} +3 -1
  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/{dist/esm → esm}/targets/python/helpers.js +4 -2
  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/{_virtual/client7.js → httpsnippet-lite/esm/targets/python/python3/client.js} +7 -3
  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/{_virtual/client6.js → httpsnippet-lite/esm/targets/python/requests/client.js} +18 -7
  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/{_virtual/client5.js → httpsnippet-lite/esm/targets/r/httr/client.js} +10 -6
  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/{_virtual/client4.js → httpsnippet-lite/esm/targets/ruby/native/client.js} +5 -3
  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/{_virtual/client3.js → httpsnippet-lite/esm/targets/shell/httpie/client.js} +14 -9
  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/{_virtual/client2.js → httpsnippet-lite/esm/targets/shell/wget/client.js} +5 -3
  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/{dist/esm → esm}/targets/swift/helpers.js +2 -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/{_virtual → httpsnippet-lite/esm/targets/swift/nsurlsession}/client.js +8 -4
  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 -6
  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
@@ -0,0 +1,19 @@
1
+ export declare const python3: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ link: string;
6
+ description: string;
7
+ };
8
+ convert: ({ uriObj: { path, protocol, host }, postData, allHeaders, method }: {
9
+ uriObj: {
10
+ path: any;
11
+ protocol: any;
12
+ host: any;
13
+ };
14
+ postData: any;
15
+ allHeaders: any;
16
+ method: any;
17
+ }, options?: {}) => any;
18
+ };
19
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/python/python3/client.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;CA+EnB,CAAA"}
@@ -1,6 +1,8 @@
1
- import { CodeBuilder } from '../httpsnippet-lite/dist/esm/helpers/code-builder.js';
2
- import { escapeForDoubleQuotes } from '../httpsnippet-lite/dist/esm/helpers/escape.js';
1
+ import { CodeBuilder } from '../../../helpers/code-builder.js';
2
+ import { escapeForDoubleQuotes } from '../../../helpers/escape.js';
3
3
 
4
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5
+ // @ts-nocheck
4
6
  /**
5
7
  * @description
6
8
  * HTTP code snippet generator for native Python3.
@@ -28,7 +30,9 @@ const python3 = {
28
30
  blank();
29
31
  // Check which protocol to be used for the client connection
30
32
  if (protocol === 'https:') {
31
- const sslContext = insecureSkipVerify ? ', context = ssl._create_unverified_context()' : '';
33
+ const sslContext = insecureSkipVerify
34
+ ? ', context = ssl._create_unverified_context()'
35
+ : '';
32
36
  push(`conn = http.client.HTTPSConnection("${host}"${sslContext})`);
33
37
  blank();
34
38
  }
@@ -0,0 +1,16 @@
1
+ export declare const requests: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ link: string;
6
+ description: string;
7
+ };
8
+ convert: ({ queryObj, url, postData, allHeaders, method }: {
9
+ queryObj: any;
10
+ url: any;
11
+ postData: any;
12
+ allHeaders: any;
13
+ method: any;
14
+ }, options: any) => any;
15
+ };
16
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/python/requests/client.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;CAqJpB,CAAA"}
@@ -1,8 +1,10 @@
1
- import { CodeBuilder } from '../httpsnippet-lite/dist/esm/helpers/code-builder.js';
2
- import { escapeForDoubleQuotes } from '../httpsnippet-lite/dist/esm/helpers/escape.js';
3
- import { getHeaderName } from '../httpsnippet-lite/dist/esm/helpers/headers.js';
4
- import { literalRepresentation } from '../httpsnippet-lite/dist/esm/targets/python/helpers.js';
1
+ import { CodeBuilder } from '../../../helpers/code-builder.js';
2
+ import { escapeForDoubleQuotes } from '../../../helpers/escape.js';
3
+ import { getHeaderName } from '../../../helpers/headers.js';
4
+ import { literalRepresentation } from '../helpers.js';
5
5
 
6
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
7
+ // @ts-nocheck
6
8
  /**
7
9
  * @description
8
10
  * HTTP code snippet generator for Python using Requests
@@ -12,7 +14,15 @@ import { literalRepresentation } from '../httpsnippet-lite/dist/esm/targets/pyth
12
14
  *
13
15
  * for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
14
16
  */
15
- const builtInMethods = ['HEAD', 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'];
17
+ const builtInMethods = [
18
+ 'HEAD',
19
+ 'GET',
20
+ 'POST',
21
+ 'PUT',
22
+ 'PATCH',
23
+ 'DELETE',
24
+ 'OPTIONS',
25
+ ];
16
26
  const requests = {
17
27
  info: {
18
28
  key: 'requests',
@@ -61,7 +71,7 @@ const requests = {
61
71
  break;
62
72
  }
63
73
  payload = {};
64
- postData.params.forEach(p => {
74
+ postData.params.forEach((p) => {
65
75
  if (p.fileName) {
66
76
  files[p.name] = `open('${p.fileName}', 'rb')`;
67
77
  hasFiles = true;
@@ -94,7 +104,8 @@ const requests = {
94
104
  if (!postData) {
95
105
  break;
96
106
  }
97
- if (postData.mimeType === 'application/x-www-form-urlencoded' && postData.paramsObj) {
107
+ if (postData.mimeType === 'application/x-www-form-urlencoded' &&
108
+ postData.paramsObj) {
98
109
  push(`payload = ${literalRepresentation(postData.paramsObj, opts)}`);
99
110
  hasPayload = true;
100
111
  break;
@@ -0,0 +1,44 @@
1
+ export declare const python: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ extname: string;
6
+ default: string;
7
+ };
8
+ clientsById: {
9
+ python3: {
10
+ info: {
11
+ key: string;
12
+ title: string;
13
+ link: string;
14
+ description: string;
15
+ };
16
+ convert: ({ uriObj: { path, protocol, host }, postData, allHeaders, method }: {
17
+ uriObj: {
18
+ path: any;
19
+ protocol: any;
20
+ host: any;
21
+ };
22
+ postData: any;
23
+ allHeaders: any;
24
+ method: any;
25
+ }, options?: {}) => any;
26
+ };
27
+ requests: {
28
+ info: {
29
+ key: string;
30
+ title: string;
31
+ link: string;
32
+ description: string;
33
+ };
34
+ convert: ({ queryObj, url, postData, allHeaders, method }: {
35
+ queryObj: any;
36
+ url: any;
37
+ postData: any;
38
+ allHeaders: any;
39
+ method: any;
40
+ }, options: any) => any;
41
+ };
42
+ };
43
+ };
44
+ //# sourceMappingURL=target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/python/target.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWlB,CAAA"}
@@ -0,0 +1,17 @@
1
+ export declare const httr: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ link: string;
6
+ description: string;
7
+ };
8
+ convert: ({ url, queryObj, queryString, postData, allHeaders, method }: {
9
+ url: any;
10
+ queryObj: any;
11
+ queryString: any;
12
+ postData: any;
13
+ allHeaders: any;
14
+ method: any;
15
+ }, options?: {}) => any;
16
+ };
17
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/r/httr/client.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;CAoHhB,CAAA"}
@@ -1,7 +1,9 @@
1
- import { CodeBuilder } from '../httpsnippet-lite/dist/esm/helpers/code-builder.js';
2
- import { escapeForDoubleQuotes, escapeForSingleQuotes } from '../httpsnippet-lite/dist/esm/helpers/escape.js';
3
- import { getHeader } from '../httpsnippet-lite/dist/esm/helpers/headers.js';
1
+ import { CodeBuilder } from '../../../helpers/code-builder.js';
2
+ import { escapeForDoubleQuotes, escapeForSingleQuotes } from '../../../helpers/escape.js';
3
+ import { getHeader } from '../../../helpers/headers.js';
4
4
 
5
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6
+ // @ts-nocheck
5
7
  /**
6
8
  * @description
7
9
  * HTTP code snippet generator for R using httr
@@ -19,7 +21,7 @@ const httr = {
19
21
  description: 'httr: Tools for Working with URLs and HTTP',
20
22
  },
21
23
  convert: ({ url, queryObj, queryString, postData, allHeaders, method }, options = {}) => {
22
- var _a, _b;
24
+ let _a, _b;
23
25
  // Start snippet
24
26
  const { push, blank, join } = new CodeBuilder({
25
27
  indent: (_a = options.indent) !== null && _a !== void 0 ? _a : ' ',
@@ -86,7 +88,9 @@ const httr = {
86
88
  .replace(/` /g, '`')
87
89
  .replace(/[=]/g, '` = "')}")`
88
90
  : undefined;
89
- const setAccept = acceptHeader ? `accept("${escapeForDoubleQuotes(acceptHeader)}")` : undefined;
91
+ const setAccept = acceptHeader
92
+ ? `accept("${escapeForDoubleQuotes(acceptHeader)}")`
93
+ : undefined;
90
94
  const setContentType = `content_type("${escapeForDoubleQuotes((_b = postData === null || postData === void 0 ? void 0 : postData.mimeType) !== null && _b !== void 0 ? _b : 'application/octet-stream')}")`;
91
95
  const otherHeaders = Object.entries(allHeaders)
92
96
  // These headers are all handled separately:
@@ -103,7 +107,7 @@ const httr = {
103
107
  request += ', query = queryString';
104
108
  }
105
109
  const headerAdditions = [setHeaders, setContentType, setAccept, setCookies]
106
- .filter(x => !!x)
110
+ .filter((x) => !!x)
107
111
  .join(', ');
108
112
  if (headerAdditions) {
109
113
  request += `, ${headerAdditions}`;
@@ -0,0 +1,27 @@
1
+ export declare const r: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ extname: string;
6
+ default: string;
7
+ };
8
+ clientsById: {
9
+ httr: {
10
+ info: {
11
+ key: string;
12
+ title: string;
13
+ link: string;
14
+ description: string;
15
+ };
16
+ convert: ({ url, queryObj, queryString, postData, allHeaders, method }: {
17
+ url: any;
18
+ queryObj: any;
19
+ queryString: any;
20
+ postData: any;
21
+ allHeaders: any;
22
+ method: any;
23
+ }, options?: {}) => any;
24
+ };
25
+ };
26
+ };
27
+ //# sourceMappingURL=target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/r/target.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CAUb,CAAA"}
@@ -0,0 +1,16 @@
1
+ export declare const native: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ link: string;
6
+ description: string;
7
+ };
8
+ convert: ({ uriObj, method: rawMethod, fullUrl, postData, allHeaders }: {
9
+ uriObj: any;
10
+ method: any;
11
+ fullUrl: any;
12
+ postData: any;
13
+ allHeaders: any;
14
+ }, options?: {}) => any;
15
+ };
16
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/ruby/native/client.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;CAqElB,CAAA"}
@@ -1,6 +1,8 @@
1
- import { CodeBuilder } from '../httpsnippet-lite/dist/esm/helpers/code-builder.js';
2
- import { escapeForSingleQuotes } from '../httpsnippet-lite/dist/esm/helpers/escape.js';
1
+ import { CodeBuilder } from '../../../helpers/code-builder.js';
2
+ import { escapeForSingleQuotes } from '../../../helpers/escape.js';
3
3
 
4
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5
+ // @ts-nocheck
4
6
  const native = {
5
7
  info: {
6
8
  key: 'native',
@@ -53,7 +55,7 @@ const native = {
53
55
  push(`request = Net::HTTP::${capMethod}.new(url)`);
54
56
  const headers = Object.keys(allHeaders);
55
57
  if (headers.length) {
56
- headers.forEach(key => {
58
+ headers.forEach((key) => {
57
59
  push(`request["${key}"] = '${escapeForSingleQuotes(allHeaders[key])}'`);
58
60
  });
59
61
  }
@@ -0,0 +1,26 @@
1
+ export declare const ruby: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ extname: string;
6
+ default: string;
7
+ };
8
+ clientsById: {
9
+ native: {
10
+ info: {
11
+ key: string;
12
+ title: string;
13
+ link: string;
14
+ description: string;
15
+ };
16
+ convert: ({ uriObj, method: rawMethod, fullUrl, postData, allHeaders }: {
17
+ uriObj: any;
18
+ method: any;
19
+ fullUrl: any;
20
+ postData: any;
21
+ allHeaders: any;
22
+ }, options?: {}) => any;
23
+ };
24
+ };
25
+ };
26
+ //# sourceMappingURL=target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/ruby/target.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;CAUhB,CAAA"}
@@ -0,0 +1,17 @@
1
+ export declare const curl: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ link: string;
6
+ description: string;
7
+ };
8
+ convert: ({ fullUrl, method, httpVersion, headersObj, allHeaders, postData }: {
9
+ fullUrl: any;
10
+ method: any;
11
+ httpVersion: any;
12
+ headersObj: any;
13
+ allHeaders: any;
14
+ postData: any;
15
+ }, options?: {}) => any;
16
+ };
17
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/shell/curl/client.ts"],"names":[],"mappings":"AA4CA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;CAsJhB,CAAA"}
@@ -0,0 +1,17 @@
1
+ export declare const httpie: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ link: string;
6
+ description: string;
7
+ };
8
+ convert: ({ allHeaders, postData, queryObj, fullUrl, method, url }: {
9
+ allHeaders: any;
10
+ postData: any;
11
+ queryObj: any;
12
+ fullUrl: any;
13
+ method: any;
14
+ url: any;
15
+ }, options: any) => any;
16
+ };
17
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/shell/httpie/client.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;CA0GlB,CAAA"}
@@ -1,6 +1,8 @@
1
- import { CodeBuilder } from '../httpsnippet-lite/dist/esm/helpers/code-builder.js';
2
- import { quote } from '../httpsnippet-lite/dist/esm/helpers/shell.js';
1
+ import { CodeBuilder } from '../../../helpers/code-builder.js';
2
+ import { quote } from '../../../helpers/shell.js';
3
3
 
4
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5
+ // @ts-nocheck
4
6
  /**
5
7
  * @description
6
8
  * HTTP code snippet generator for the Shell using HTTPie.
@@ -69,10 +71,10 @@ const httpie = {
69
71
  }
70
72
  // construct query params
71
73
  if (opts.queryParams) {
72
- Object.keys(queryObj).forEach(name => {
74
+ Object.keys(queryObj).forEach((name) => {
73
75
  const value = queryObj[name];
74
76
  if (Array.isArray(value)) {
75
- value.forEach(val => {
77
+ value.forEach((val) => {
76
78
  push(`${name}==${quote(val)}`);
77
79
  });
78
80
  }
@@ -84,14 +86,16 @@ const httpie = {
84
86
  // construct headers
85
87
  Object.keys(allHeaders)
86
88
  .sort()
87
- .forEach(key => {
89
+ .forEach((key) => {
88
90
  push(`${key}:${quote(allHeaders[key])}`);
89
91
  });
90
- if ((postData === null || postData === void 0 ? void 0 : postData.mimeType) === 'application/x-www-form-urlencoded') {
92
+ if ((postData === null || postData === void 0
93
+ ? void 0
94
+ : postData.mimeType) === 'application/x-www-form-urlencoded') {
91
95
  // construct post params
92
- if (postData.params && postData.params.length) {
96
+ if (postData.params?.length) {
93
97
  flags.push(opts.short ? '-f' : '--form');
94
- postData.params.forEach(param => {
98
+ postData.params.forEach((param) => {
95
99
  push(`${param.name}=${quote(param.value)}`);
96
100
  });
97
101
  }
@@ -102,7 +106,8 @@ const httpie = {
102
106
  const cliFlags = flags.length ? `${flags.join(' ')} ` : '';
103
107
  url = quote(opts.queryParams ? url : fullUrl);
104
108
  unshift(`http ${cliFlags}${method} ${url}`);
105
- if (raw && (postData === null || postData === void 0 ? void 0 : postData.text)) {
109
+ if (raw &&
110
+ (postData === null || postData === void 0 ? void 0 : postData.text)) {
106
111
  const postDataText = quote(postData.text);
107
112
  unshift(`echo ${postDataText} | `);
108
113
  }
@@ -0,0 +1,57 @@
1
+ export declare const shell: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ extname: string;
6
+ default: string;
7
+ };
8
+ clientsById: {
9
+ curl: {
10
+ info: {
11
+ key: string;
12
+ title: string;
13
+ link: string;
14
+ description: string;
15
+ };
16
+ convert: ({ fullUrl, method, httpVersion, headersObj, allHeaders, postData }: {
17
+ fullUrl: any;
18
+ method: any;
19
+ httpVersion: any;
20
+ headersObj: any;
21
+ allHeaders: any;
22
+ postData: any;
23
+ }, options?: {}) => any;
24
+ };
25
+ httpie: {
26
+ info: {
27
+ key: string;
28
+ title: string;
29
+ link: string;
30
+ description: string;
31
+ };
32
+ convert: ({ allHeaders, postData, queryObj, fullUrl, method, url }: {
33
+ allHeaders: any;
34
+ postData: any;
35
+ queryObj: any;
36
+ fullUrl: any;
37
+ method: any;
38
+ url: any;
39
+ }, options: any) => any;
40
+ };
41
+ wget: {
42
+ info: {
43
+ key: string;
44
+ title: string;
45
+ link: string;
46
+ description: string;
47
+ };
48
+ convert: ({ method, postData, allHeaders, fullUrl }: {
49
+ method: any;
50
+ postData: any;
51
+ allHeaders: any;
52
+ fullUrl: any;
53
+ }, options: any) => any;
54
+ };
55
+ };
56
+ };
57
+ //# sourceMappingURL=target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/shell/target.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYjB,CAAA"}
@@ -0,0 +1,15 @@
1
+ export declare const wget: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ link: string;
6
+ description: string;
7
+ };
8
+ convert: ({ method, postData, allHeaders, fullUrl }: {
9
+ method: any;
10
+ postData: any;
11
+ allHeaders: any;
12
+ fullUrl: any;
13
+ }, options: any) => any;
14
+ };
15
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/shell/wget/client.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,IAAI;;;;;;;;;;;;;CAqChB,CAAA"}
@@ -1,6 +1,8 @@
1
- import { CodeBuilder } from '../httpsnippet-lite/dist/esm/helpers/code-builder.js';
2
- import { quote, escape } from '../httpsnippet-lite/dist/esm/helpers/shell.js';
1
+ import { CodeBuilder } from '../../../helpers/code-builder.js';
2
+ import { quote, escape } from '../../../helpers/shell.js';
3
3
 
4
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5
+ // @ts-nocheck
4
6
  /**
5
7
  * @description
6
8
  * HTTP code snippet generator for the Shell using Wget.
@@ -36,7 +38,7 @@ const wget = {
36
38
  push(`wget ${opts.short ? '-q' : '--quiet'}`);
37
39
  }
38
40
  push(`--method ${quote(method)}`);
39
- Object.keys(allHeaders).forEach(key => {
41
+ Object.keys(allHeaders).forEach((key) => {
40
42
  const header = `${key}: ${allHeaders[key]}`;
41
43
  push(`--header ${quote(header)}`);
42
44
  });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Create a string corresponding to a valid declaration and initialization of a Swift array or dictionary literal
3
+ *
4
+ * @param name Desired name of the instance
5
+ * @param parameters Key-value object of parameters to translate to a Swift object litearal
6
+ * @param opts Target options
7
+ * @return {string}
8
+ */
9
+ export declare const literalDeclaration: (name: any, parameters: any, opts: any) => string;
10
+ /**
11
+ * Create a valid Swift string of a literal value according to its type.
12
+ *
13
+ * @param value Any JavaScript literal
14
+ * @param opts Target options
15
+ */
16
+ export declare const literalRepresentation: (value: any, opts: any, indentLevel: any) => any;
17
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/swift/helpers.ts"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,mDAC6B,CAAA;AAC5D;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,kDA0CjC,CAAA"}
@@ -1,3 +1,5 @@
1
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
+ // @ts-nocheck
1
3
  /**
2
4
  * Create an string of given length filled with blank spaces
3
5
  *
@@ -0,0 +1,15 @@
1
+ export declare const nsurlsession: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ link: string;
6
+ description: string;
7
+ };
8
+ convert: ({ allHeaders, postData, fullUrl, method }: {
9
+ allHeaders: any;
10
+ postData: any;
11
+ fullUrl: any;
12
+ method: any;
13
+ }, options: any) => any;
14
+ };
15
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/swift/nsurlsession/client.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAgJxB,CAAA"}
@@ -1,6 +1,8 @@
1
- import { CodeBuilder } from '../httpsnippet-lite/dist/esm/helpers/code-builder.js';
2
- import { literalDeclaration } from '../httpsnippet-lite/dist/esm/targets/swift/helpers.js';
1
+ import { CodeBuilder } from '../../../helpers/code-builder.js';
2
+ import { literalDeclaration } from '../helpers.js';
3
3
 
4
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5
+ // @ts-nocheck
4
6
  /**
5
7
  * @description
6
8
  * HTTP code snippet generator for Swift using NSURLSession.
@@ -18,7 +20,7 @@ const nsurlsession = {
18
20
  description: "Foundation's NSURLSession request",
19
21
  },
20
22
  convert: ({ allHeaders, postData, fullUrl, method }, options) => {
21
- var _a;
23
+ let _a;
22
24
  const opts = {
23
25
  indent: ' ',
24
26
  pretty: true,
@@ -46,7 +48,9 @@ const nsurlsession = {
46
48
  // we make it easier for the user to edit it according to his or her needs after pasting.
47
49
  // The user can just add/remove lines adding/removing body parameters.
48
50
  blank();
49
- if ((_a = postData.params) === null || _a === void 0 ? void 0 : _a.length) {
51
+ if ((_a = postData.params) === null || _a === void 0
52
+ ? void 0
53
+ : _a.length) {
50
54
  const [head, ...tail] = postData.params;
51
55
  push(`let postData = NSMutableData(data: "${head.name}=${head.value}".data(using: String.Encoding.utf8)!)`);
52
56
  tail.forEach(({ name, value }) => {
@@ -0,0 +1,25 @@
1
+ export declare const swift: {
2
+ info: {
3
+ key: string;
4
+ title: string;
5
+ extname: string;
6
+ default: string;
7
+ };
8
+ clientsById: {
9
+ nsurlsession: {
10
+ info: {
11
+ key: string;
12
+ title: string;
13
+ link: string;
14
+ description: string;
15
+ };
16
+ convert: ({ allHeaders, postData, fullUrl, method }: {
17
+ allHeaders: any;
18
+ postData: any;
19
+ fullUrl: any;
20
+ method: any;
21
+ }, options: any) => any;
22
+ };
23
+ };
24
+ };
25
+ //# sourceMappingURL=target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/swift/target.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;CAUjB,CAAA"}