@scalar/snippetz 0.2.19 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) hide show
  1. package/dist/clients.js +153 -155
  2. package/dist/clients.js.map +7 -0
  3. package/dist/httpsnippet-lite/esm/helpers/code-builder.js +44 -59
  4. package/dist/httpsnippet-lite/esm/helpers/code-builder.js.map +7 -0
  5. package/dist/httpsnippet-lite/esm/helpers/escape.js +41 -69
  6. package/dist/httpsnippet-lite/esm/helpers/escape.js.map +7 -0
  7. package/dist/httpsnippet-lite/esm/helpers/form-data.js +59 -0
  8. package/dist/httpsnippet-lite/esm/helpers/form-data.js.map +7 -0
  9. package/dist/httpsnippet-lite/esm/helpers/headers.js +23 -18
  10. package/dist/httpsnippet-lite/esm/helpers/headers.js.map +7 -0
  11. package/dist/httpsnippet-lite/esm/helpers/reducer.js +20 -0
  12. package/dist/httpsnippet-lite/esm/helpers/reducer.js.map +7 -0
  13. package/dist/httpsnippet-lite/esm/helpers/shell.js +13 -16
  14. package/dist/httpsnippet-lite/esm/helpers/shell.js.map +7 -0
  15. package/dist/httpsnippet-lite/esm/helpers/url.js +20 -0
  16. package/dist/httpsnippet-lite/esm/helpers/url.js.map +7 -0
  17. package/dist/httpsnippet-lite/esm/helpers/utils.js +16 -0
  18. package/dist/httpsnippet-lite/esm/helpers/utils.js.map +7 -0
  19. package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.d.ts.map +1 -1
  20. package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.js +72 -40
  21. package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.js.map +7 -0
  22. package/dist/httpsnippet-lite/esm/targets/c/target.js +16 -0
  23. package/dist/httpsnippet-lite/esm/targets/c/target.js.map +7 -0
  24. package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.js +149 -166
  25. package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.js.map +7 -0
  26. package/dist/httpsnippet-lite/esm/targets/clojure/target.js +16 -0
  27. package/dist/httpsnippet-lite/esm/targets/clojure/target.js.map +7 -0
  28. package/dist/httpsnippet-lite/esm/targets/csharp/httpclient/client.js +165 -161
  29. package/dist/httpsnippet-lite/esm/targets/csharp/httpclient/client.js.map +7 -0
  30. package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.js +47 -46
  31. package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.js.map +7 -0
  32. package/dist/httpsnippet-lite/esm/targets/csharp/target.js +18 -0
  33. package/dist/httpsnippet-lite/esm/targets/csharp/target.js.map +7 -0
  34. package/dist/httpsnippet-lite/esm/targets/go/native/client.d.ts.map +1 -1
  35. package/dist/httpsnippet-lite/esm/targets/go/native/client.js +167 -116
  36. package/dist/httpsnippet-lite/esm/targets/go/native/client.js.map +7 -0
  37. package/dist/httpsnippet-lite/esm/targets/go/target.js +16 -0
  38. package/dist/httpsnippet-lite/esm/targets/go/target.js.map +7 -0
  39. package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.js +37 -44
  40. package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.js.map +7 -0
  41. package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.js +41 -43
  42. package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.js.map +7 -0
  43. package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.d.ts.map +1 -1
  44. package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.js +75 -67
  45. package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.js.map +7 -0
  46. package/dist/httpsnippet-lite/esm/targets/java/target.js +22 -0
  47. package/dist/httpsnippet-lite/esm/targets/java/target.js.map +7 -0
  48. package/dist/httpsnippet-lite/esm/targets/java/unirest/client.js +37 -44
  49. package/dist/httpsnippet-lite/esm/targets/java/unirest/client.js.map +7 -0
  50. package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.js +79 -84
  51. package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.js.map +7 -0
  52. package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.js +76 -83
  53. package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.js.map +7 -0
  54. package/dist/httpsnippet-lite/esm/targets/javascript/target.js +22 -0
  55. package/dist/httpsnippet-lite/esm/targets/javascript/target.js.map +7 -0
  56. package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.js +78 -79
  57. package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.js.map +7 -0
  58. package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.d.ts.map +1 -1
  59. package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.js +75 -67
  60. package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.js.map +7 -0
  61. package/dist/httpsnippet-lite/esm/targets/kotlin/target.js +16 -0
  62. package/dist/httpsnippet-lite/esm/targets/kotlin/target.js.map +7 -0
  63. package/dist/httpsnippet-lite/esm/targets/node/axios/client.js +70 -77
  64. package/dist/httpsnippet-lite/esm/targets/node/axios/client.js.map +7 -0
  65. package/dist/httpsnippet-lite/esm/targets/node/request/client.js +100 -0
  66. package/dist/httpsnippet-lite/esm/targets/node/request/client.js.map +7 -0
  67. package/dist/httpsnippet-lite/esm/targets/node/target.js +24 -0
  68. package/dist/httpsnippet-lite/esm/targets/node/target.js.map +7 -0
  69. package/dist/httpsnippet-lite/esm/targets/objc/helpers.js +36 -52
  70. package/dist/httpsnippet-lite/esm/targets/objc/helpers.js.map +7 -0
  71. package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.js +157 -128
  72. package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.js.map +7 -0
  73. package/dist/httpsnippet-lite/esm/targets/objc/target.js +16 -0
  74. package/dist/httpsnippet-lite/esm/targets/objc/target.js.map +7 -0
  75. package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.js +50 -65
  76. package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.js.map +7 -0
  77. package/dist/httpsnippet-lite/esm/targets/ocaml/target.js +16 -0
  78. package/dist/httpsnippet-lite/esm/targets/ocaml/target.js.map +7 -0
  79. package/dist/httpsnippet-lite/esm/targets/php/helpers.js +72 -0
  80. package/dist/httpsnippet-lite/esm/targets/php/helpers.js.map +7 -0
  81. package/dist/httpsnippet-lite/esm/targets/php/http1/client.js +85 -0
  82. package/dist/httpsnippet-lite/esm/targets/php/http1/client.js.map +7 -0
  83. package/dist/httpsnippet-lite/esm/targets/php/http2/client.js +127 -0
  84. package/dist/httpsnippet-lite/esm/targets/php/http2/client.js.map +7 -0
  85. package/dist/httpsnippet-lite/esm/targets/php/target.js +22 -0
  86. package/dist/httpsnippet-lite/esm/targets/php/target.js.map +7 -0
  87. package/dist/httpsnippet-lite/esm/targets/powershell/common.js +61 -49
  88. package/dist/httpsnippet-lite/esm/targets/powershell/common.js.map +7 -0
  89. package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.js +12 -12
  90. package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.js.map +7 -0
  91. package/dist/httpsnippet-lite/esm/targets/powershell/target.js +18 -0
  92. package/dist/httpsnippet-lite/esm/targets/powershell/target.js.map +7 -0
  93. package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.js +12 -12
  94. package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.js.map +7 -0
  95. package/dist/httpsnippet-lite/esm/targets/python/helpers.js +68 -0
  96. package/dist/httpsnippet-lite/esm/targets/python/helpers.js.map +7 -0
  97. package/dist/httpsnippet-lite/esm/targets/python/python3/client.js +71 -90
  98. package/dist/httpsnippet-lite/esm/targets/python/python3/client.js.map +7 -0
  99. package/dist/httpsnippet-lite/esm/targets/python/target.js +16 -0
  100. package/dist/httpsnippet-lite/esm/targets/python/target.js.map +7 -0
  101. package/dist/httpsnippet-lite/esm/targets/r/httr/client.js +99 -124
  102. package/dist/httpsnippet-lite/esm/targets/r/httr/client.js.map +7 -0
  103. package/dist/httpsnippet-lite/esm/targets/r/target.js +16 -0
  104. package/dist/httpsnippet-lite/esm/targets/r/target.js.map +7 -0
  105. package/dist/httpsnippet-lite/esm/targets/ruby/native/client.js +69 -69
  106. package/dist/httpsnippet-lite/esm/targets/ruby/native/client.js.map +7 -0
  107. package/dist/httpsnippet-lite/esm/targets/ruby/target.js +16 -0
  108. package/dist/httpsnippet-lite/esm/targets/ruby/target.js.map +7 -0
  109. package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.d.ts.map +1 -1
  110. package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.js +106 -113
  111. package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.js.map +7 -0
  112. package/dist/httpsnippet-lite/esm/targets/shell/target.js +20 -0
  113. package/dist/httpsnippet-lite/esm/targets/shell/target.js.map +7 -0
  114. package/dist/httpsnippet-lite/esm/targets/shell/wget/client.js +42 -51
  115. package/dist/httpsnippet-lite/esm/targets/shell/wget/client.js.map +7 -0
  116. package/dist/httpsnippet-lite/esm/targets/swift/helpers.js +51 -67
  117. package/dist/httpsnippet-lite/esm/targets/swift/helpers.js.map +7 -0
  118. package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.js +132 -133
  119. package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.js.map +7 -0
  120. package/dist/httpsnippet-lite/esm/targets/swift/target.js +16 -0
  121. package/dist/httpsnippet-lite/esm/targets/swift/target.js.map +7 -0
  122. package/dist/httpsnippet-lite/types/helpers/code-builder.d.js +1 -0
  123. package/dist/httpsnippet-lite/types/helpers/code-builder.d.js.map +7 -0
  124. package/dist/httpsnippet-lite/types/helpers/escape.d.js +1 -0
  125. package/dist/httpsnippet-lite/types/helpers/escape.d.js.map +7 -0
  126. package/dist/httpsnippet-lite/types/helpers/form-data.d.js +28 -0
  127. package/dist/httpsnippet-lite/types/helpers/form-data.d.js.map +7 -0
  128. package/dist/httpsnippet-lite/types/helpers/headers.d.js +1 -0
  129. package/dist/httpsnippet-lite/types/helpers/headers.d.js.map +7 -0
  130. package/dist/httpsnippet-lite/types/helpers/reducer.d.js +1 -0
  131. package/dist/httpsnippet-lite/types/helpers/reducer.d.js.map +7 -0
  132. package/dist/httpsnippet-lite/types/helpers/shell.d.js +1 -0
  133. package/dist/httpsnippet-lite/types/helpers/shell.d.js.map +7 -0
  134. package/dist/httpsnippet-lite/types/helpers/url.d.js +1 -0
  135. package/dist/httpsnippet-lite/types/helpers/url.d.js.map +7 -0
  136. package/dist/httpsnippet-lite/types/helpers/utils.d.js +1 -0
  137. package/dist/httpsnippet-lite/types/helpers/utils.d.js.map +7 -0
  138. package/dist/httpsnippet-lite/types/httpsnippet.d.js +19 -0
  139. package/dist/httpsnippet-lite/types/httpsnippet.d.js.map +7 -0
  140. package/dist/httpsnippet-lite/types/targets/c/libcurl/client.d.js +1 -0
  141. package/dist/httpsnippet-lite/types/targets/c/libcurl/client.d.js.map +7 -0
  142. package/dist/httpsnippet-lite/types/targets/c/target.d.js +1 -0
  143. package/dist/httpsnippet-lite/types/targets/c/target.d.js.map +7 -0
  144. package/dist/httpsnippet-lite/types/targets/clojure/clj_http/client.d.js +1 -0
  145. package/dist/httpsnippet-lite/types/targets/clojure/clj_http/client.d.js.map +7 -0
  146. package/dist/httpsnippet-lite/types/targets/clojure/target.d.js +1 -0
  147. package/dist/httpsnippet-lite/types/targets/clojure/target.d.js.map +7 -0
  148. package/dist/httpsnippet-lite/types/targets/csharp/httpclient/client.d.js +1 -0
  149. package/dist/httpsnippet-lite/types/targets/csharp/httpclient/client.d.js.map +7 -0
  150. package/dist/httpsnippet-lite/types/targets/csharp/restsharp/client.d.js +1 -0
  151. package/dist/httpsnippet-lite/types/targets/csharp/restsharp/client.d.js.map +7 -0
  152. package/dist/httpsnippet-lite/types/targets/csharp/target.d.js +1 -0
  153. package/dist/httpsnippet-lite/types/targets/csharp/target.d.js.map +7 -0
  154. package/dist/httpsnippet-lite/types/targets/dart/http/client.d.js +1 -0
  155. package/dist/httpsnippet-lite/types/targets/dart/http/client.d.js.map +7 -0
  156. package/dist/httpsnippet-lite/types/targets/dart/target.d.js +1 -0
  157. package/dist/httpsnippet-lite/types/targets/dart/target.d.js.map +7 -0
  158. package/dist/httpsnippet-lite/types/targets/go/native/client.d.js +1 -0
  159. package/dist/httpsnippet-lite/types/targets/go/native/client.d.js.map +7 -0
  160. package/dist/httpsnippet-lite/types/targets/go/target.d.js +1 -0
  161. package/dist/httpsnippet-lite/types/targets/go/target.d.js.map +7 -0
  162. package/dist/httpsnippet-lite/types/targets/http/http1.1/client.d.js +1 -0
  163. package/dist/httpsnippet-lite/types/targets/http/http1.1/client.d.js.map +7 -0
  164. package/dist/httpsnippet-lite/types/targets/http/target.d.js +1 -0
  165. package/dist/httpsnippet-lite/types/targets/http/target.d.js.map +7 -0
  166. package/dist/httpsnippet-lite/types/targets/java/asynchttp/client.d.js +1 -0
  167. package/dist/httpsnippet-lite/types/targets/java/asynchttp/client.d.js.map +7 -0
  168. package/dist/httpsnippet-lite/types/targets/java/nethttp/client.d.js +1 -0
  169. package/dist/httpsnippet-lite/types/targets/java/nethttp/client.d.js.map +7 -0
  170. package/dist/httpsnippet-lite/types/targets/java/okhttp/client.d.js +1 -0
  171. package/dist/httpsnippet-lite/types/targets/java/okhttp/client.d.js.map +7 -0
  172. package/dist/httpsnippet-lite/types/targets/java/target.d.js +1 -0
  173. package/dist/httpsnippet-lite/types/targets/java/target.d.js.map +7 -0
  174. package/dist/httpsnippet-lite/types/targets/java/unirest/client.d.js +1 -0
  175. package/dist/httpsnippet-lite/types/targets/java/unirest/client.d.js.map +7 -0
  176. package/dist/httpsnippet-lite/types/targets/javascript/axios/client.d.js +1 -0
  177. package/dist/httpsnippet-lite/types/targets/javascript/axios/client.d.js.map +7 -0
  178. package/dist/httpsnippet-lite/types/targets/javascript/fetch/client.d.js +1 -0
  179. package/dist/httpsnippet-lite/types/targets/javascript/fetch/client.d.js.map +7 -0
  180. package/dist/httpsnippet-lite/types/targets/javascript/jquery/client.d.js +1 -0
  181. package/dist/httpsnippet-lite/types/targets/javascript/jquery/client.d.js.map +7 -0
  182. package/dist/httpsnippet-lite/types/targets/javascript/target.d.js +1 -0
  183. package/dist/httpsnippet-lite/types/targets/javascript/target.d.js.map +7 -0
  184. package/dist/httpsnippet-lite/types/targets/javascript/xhr/client.d.js +1 -0
  185. package/dist/httpsnippet-lite/types/targets/javascript/xhr/client.d.js.map +7 -0
  186. package/dist/httpsnippet-lite/types/targets/kotlin/okhttp/client.d.js +1 -0
  187. package/dist/httpsnippet-lite/types/targets/kotlin/okhttp/client.d.js.map +7 -0
  188. package/dist/httpsnippet-lite/types/targets/kotlin/target.d.js +1 -0
  189. package/dist/httpsnippet-lite/types/targets/kotlin/target.d.js.map +7 -0
  190. package/dist/httpsnippet-lite/types/targets/node/axios/client.d.js +1 -0
  191. package/dist/httpsnippet-lite/types/targets/node/axios/client.d.js.map +7 -0
  192. package/dist/httpsnippet-lite/types/targets/node/fetch/client.d.js +1 -0
  193. package/dist/httpsnippet-lite/types/targets/node/fetch/client.d.js.map +7 -0
  194. package/dist/httpsnippet-lite/types/targets/node/native/client.d.js +1 -0
  195. package/dist/httpsnippet-lite/types/targets/node/native/client.d.js.map +7 -0
  196. package/dist/httpsnippet-lite/types/targets/node/request/client.d.js +1 -0
  197. package/dist/httpsnippet-lite/types/targets/node/request/client.d.js.map +7 -0
  198. package/dist/httpsnippet-lite/types/targets/node/target.d.js +1 -0
  199. package/dist/httpsnippet-lite/types/targets/node/target.d.js.map +7 -0
  200. package/dist/httpsnippet-lite/types/targets/node/unirest/client.d.js +1 -0
  201. package/dist/httpsnippet-lite/types/targets/node/unirest/client.d.js.map +7 -0
  202. package/dist/httpsnippet-lite/types/targets/objc/helpers.d.js +1 -0
  203. package/dist/httpsnippet-lite/types/targets/objc/helpers.d.js.map +7 -0
  204. package/dist/httpsnippet-lite/types/targets/objc/nsurlsession/client.d.js +1 -0
  205. package/dist/httpsnippet-lite/types/targets/objc/nsurlsession/client.d.js.map +7 -0
  206. package/dist/httpsnippet-lite/types/targets/objc/target.d.js +1 -0
  207. package/dist/httpsnippet-lite/types/targets/objc/target.d.js.map +7 -0
  208. package/dist/httpsnippet-lite/types/targets/ocaml/cohttp/client.d.js +1 -0
  209. package/dist/httpsnippet-lite/types/targets/ocaml/cohttp/client.d.js.map +7 -0
  210. package/dist/httpsnippet-lite/types/targets/ocaml/target.d.js +1 -0
  211. package/dist/httpsnippet-lite/types/targets/ocaml/target.d.js.map +7 -0
  212. package/dist/httpsnippet-lite/types/targets/php/curl/client.d.js +1 -0
  213. package/dist/httpsnippet-lite/types/targets/php/curl/client.d.js.map +7 -0
  214. package/dist/httpsnippet-lite/types/targets/php/guzzle/client.d.js +1 -0
  215. package/dist/httpsnippet-lite/types/targets/php/guzzle/client.d.js.map +7 -0
  216. package/dist/httpsnippet-lite/types/targets/php/helpers.d.js +1 -0
  217. package/dist/httpsnippet-lite/types/targets/php/helpers.d.js.map +7 -0
  218. package/dist/httpsnippet-lite/types/targets/php/http1/client.d.js +1 -0
  219. package/dist/httpsnippet-lite/types/targets/php/http1/client.d.js.map +7 -0
  220. package/dist/httpsnippet-lite/types/targets/php/http2/client.d.js +1 -0
  221. package/dist/httpsnippet-lite/types/targets/php/http2/client.d.js.map +7 -0
  222. package/dist/httpsnippet-lite/types/targets/php/target.d.js +1 -0
  223. package/dist/httpsnippet-lite/types/targets/php/target.d.js.map +7 -0
  224. package/dist/httpsnippet-lite/types/targets/powershell/common.d.js +1 -0
  225. package/dist/httpsnippet-lite/types/targets/powershell/common.d.js.map +7 -0
  226. package/dist/httpsnippet-lite/types/targets/powershell/restmethod/client.d.js +1 -0
  227. package/dist/httpsnippet-lite/types/targets/powershell/restmethod/client.d.js.map +7 -0
  228. package/dist/httpsnippet-lite/types/targets/powershell/target.d.js +1 -0
  229. package/dist/httpsnippet-lite/types/targets/powershell/target.d.js.map +7 -0
  230. package/dist/httpsnippet-lite/types/targets/powershell/webrequest/client.d.js +1 -0
  231. package/dist/httpsnippet-lite/types/targets/powershell/webrequest/client.d.js.map +7 -0
  232. package/dist/httpsnippet-lite/types/targets/python/helpers.d.js +1 -0
  233. package/dist/httpsnippet-lite/types/targets/python/helpers.d.js.map +7 -0
  234. package/dist/httpsnippet-lite/types/targets/python/python3/client.d.js +1 -0
  235. package/dist/httpsnippet-lite/types/targets/python/python3/client.d.js.map +7 -0
  236. package/dist/httpsnippet-lite/types/targets/python/requests/client.d.js +1 -0
  237. package/dist/httpsnippet-lite/types/targets/python/requests/client.d.js.map +7 -0
  238. package/dist/httpsnippet-lite/types/targets/python/target.d.js +1 -0
  239. package/dist/httpsnippet-lite/types/targets/python/target.d.js.map +7 -0
  240. package/dist/httpsnippet-lite/types/targets/r/httr/client.d.js +1 -0
  241. package/dist/httpsnippet-lite/types/targets/r/httr/client.d.js.map +7 -0
  242. package/dist/httpsnippet-lite/types/targets/r/target.d.js +1 -0
  243. package/dist/httpsnippet-lite/types/targets/r/target.d.js.map +7 -0
  244. package/dist/httpsnippet-lite/types/targets/ruby/native/client.d.js +1 -0
  245. package/dist/httpsnippet-lite/types/targets/ruby/native/client.d.js.map +7 -0
  246. package/dist/httpsnippet-lite/types/targets/ruby/target.d.js +1 -0
  247. package/dist/httpsnippet-lite/types/targets/ruby/target.d.js.map +7 -0
  248. package/dist/httpsnippet-lite/types/targets/shell/curl/client.d.js +1 -0
  249. package/dist/httpsnippet-lite/types/targets/shell/curl/client.d.js.map +7 -0
  250. package/dist/httpsnippet-lite/types/targets/shell/httpie/client.d.js +1 -0
  251. package/dist/httpsnippet-lite/types/targets/shell/httpie/client.d.js.map +7 -0
  252. package/dist/httpsnippet-lite/types/targets/shell/target.d.js +1 -0
  253. package/dist/httpsnippet-lite/types/targets/shell/target.d.js.map +7 -0
  254. package/dist/httpsnippet-lite/types/targets/shell/wget/client.d.js +1 -0
  255. package/dist/httpsnippet-lite/types/targets/shell/wget/client.d.js.map +7 -0
  256. package/dist/httpsnippet-lite/types/targets/swift/helpers.d.js +1 -0
  257. package/dist/httpsnippet-lite/types/targets/swift/helpers.d.js.map +7 -0
  258. package/dist/httpsnippet-lite/types/targets/swift/nsurlsession/client.d.js +1 -0
  259. package/dist/httpsnippet-lite/types/targets/swift/nsurlsession/client.d.js.map +7 -0
  260. package/dist/httpsnippet-lite/types/targets/swift/target.d.js +1 -0
  261. package/dist/httpsnippet-lite/types/targets/swift/target.d.js.map +7 -0
  262. package/dist/httpsnippet-lite/types/targets/targets.d.js +1 -0
  263. package/dist/httpsnippet-lite/types/targets/targets.d.js.map +7 -0
  264. package/dist/index.js +3 -2
  265. package/dist/index.js.map +7 -0
  266. package/dist/plugins/c/libcurl/index.js +2 -1
  267. package/dist/plugins/c/libcurl/index.js.map +7 -0
  268. package/dist/plugins/c/libcurl/libcurl.js +12 -15
  269. package/dist/plugins/c/libcurl/libcurl.js.map +7 -0
  270. package/dist/plugins/c/libcurl/libcurl.test.js +208 -0
  271. package/dist/plugins/c/libcurl/libcurl.test.js.map +7 -0
  272. package/dist/plugins/clojure/clj_http/clj_http.js +12 -15
  273. package/dist/plugins/clojure/clj_http/clj_http.js.map +7 -0
  274. package/dist/plugins/clojure/clj_http/clj_http.test.js +151 -0
  275. package/dist/plugins/clojure/clj_http/clj_http.test.js.map +7 -0
  276. package/dist/plugins/clojure/clj_http/index.js +2 -1
  277. package/dist/plugins/clojure/clj_http/index.js.map +7 -0
  278. package/dist/plugins/csharp/httpclient/httpclient.js +12 -15
  279. package/dist/plugins/csharp/httpclient/httpclient.js.map +7 -0
  280. package/dist/plugins/csharp/httpclient/index.js +2 -1
  281. package/dist/plugins/csharp/httpclient/index.js.map +7 -0
  282. package/dist/plugins/csharp/restsharp/index.js +2 -1
  283. package/dist/plugins/csharp/restsharp/index.js.map +7 -0
  284. package/dist/plugins/csharp/restsharp/restsharp.js +12 -15
  285. package/dist/plugins/csharp/restsharp/restsharp.js.map +7 -0
  286. package/dist/plugins/dart/http/http.js +92 -96
  287. package/dist/plugins/dart/http/http.js.map +7 -0
  288. package/dist/plugins/dart/http/http.test.js +550 -0
  289. package/dist/plugins/dart/http/http.test.js.map +7 -0
  290. package/dist/plugins/dart/http/index.js +2 -1
  291. package/dist/plugins/dart/http/index.js.map +7 -0
  292. package/dist/plugins/go/native/index.js +2 -1
  293. package/dist/plugins/go/native/index.js.map +7 -0
  294. package/dist/plugins/go/native/native.js +12 -15
  295. package/dist/plugins/go/native/native.js.map +7 -0
  296. package/dist/plugins/go/native/native.test.js +366 -0
  297. package/dist/plugins/go/native/native.test.js.map +7 -0
  298. package/dist/plugins/http/http11/http11.js +84 -104
  299. package/dist/plugins/http/http11/http11.js.map +7 -0
  300. package/dist/plugins/http/http11/http11.test.js +175 -0
  301. package/dist/plugins/http/http11/http11.test.js.map +7 -0
  302. package/dist/plugins/http/http11/index.js +2 -1
  303. package/dist/plugins/http/http11/index.js.map +7 -0
  304. package/dist/plugins/java/asynchttp/asynchttp.js +12 -15
  305. package/dist/plugins/java/asynchttp/asynchttp.js.map +7 -0
  306. package/dist/plugins/java/asynchttp/index.js +2 -1
  307. package/dist/plugins/java/asynchttp/index.js.map +7 -0
  308. package/dist/plugins/java/nethttp/index.js +2 -1
  309. package/dist/plugins/java/nethttp/index.js.map +7 -0
  310. package/dist/plugins/java/nethttp/nethttp.js +12 -15
  311. package/dist/plugins/java/nethttp/nethttp.js.map +7 -0
  312. package/dist/plugins/java/okhttp/index.js +2 -1
  313. package/dist/plugins/java/okhttp/index.js.map +7 -0
  314. package/dist/plugins/java/okhttp/okhttp.js +12 -15
  315. package/dist/plugins/java/okhttp/okhttp.js.map +7 -0
  316. package/dist/plugins/java/okhttp/okhttp.test.js +164 -0
  317. package/dist/plugins/java/okhttp/okhttp.test.js.map +7 -0
  318. package/dist/plugins/java/unirest/index.js +2 -1
  319. package/dist/plugins/java/unirest/index.js.map +7 -0
  320. package/dist/plugins/java/unirest/unirest.js +12 -15
  321. package/dist/plugins/java/unirest/unirest.js.map +7 -0
  322. package/dist/plugins/js/axios/axios.js +12 -15
  323. package/dist/plugins/js/axios/axios.js.map +7 -0
  324. package/dist/plugins/js/axios/index.d.ts +1 -1
  325. package/dist/plugins/js/axios/index.d.ts.map +1 -1
  326. package/dist/plugins/js/axios/index.js +5 -1
  327. package/dist/plugins/js/axios/index.js.map +7 -0
  328. package/dist/plugins/js/fetch/fetch.d.ts.map +1 -1
  329. package/dist/plugins/js/fetch/fetch.js +67 -60
  330. package/dist/plugins/js/fetch/fetch.js.map +7 -0
  331. package/dist/plugins/js/fetch/fetch.test.js +214 -0
  332. package/dist/plugins/js/fetch/fetch.test.js.map +7 -0
  333. package/dist/plugins/js/fetch/index.d.ts +1 -1
  334. package/dist/plugins/js/fetch/index.d.ts.map +1 -1
  335. package/dist/plugins/js/fetch/index.js +5 -1
  336. package/dist/plugins/js/fetch/index.js.map +7 -0
  337. package/dist/plugins/js/jquery/index.js +2 -1
  338. package/dist/plugins/js/jquery/index.js.map +7 -0
  339. package/dist/plugins/js/jquery/jquery.js +12 -15
  340. package/dist/plugins/js/jquery/jquery.js.map +7 -0
  341. package/dist/plugins/js/ofetch/index.js +2 -1
  342. package/dist/plugins/js/ofetch/index.js.map +7 -0
  343. package/dist/plugins/js/ofetch/ofetch.d.ts.map +1 -1
  344. package/dist/plugins/js/ofetch/ofetch.js +44 -67
  345. package/dist/plugins/js/ofetch/ofetch.js.map +7 -0
  346. package/dist/plugins/js/ofetch/ofetch.test.js +126 -0
  347. package/dist/plugins/js/ofetch/ofetch.test.js.map +7 -0
  348. package/dist/plugins/js/xhr/index.js +2 -1
  349. package/dist/plugins/js/xhr/index.js.map +7 -0
  350. package/dist/plugins/js/xhr/xhr.js +12 -15
  351. package/dist/plugins/js/xhr/xhr.js.map +7 -0
  352. package/dist/plugins/kotlin/okhttp/index.js +2 -1
  353. package/dist/plugins/kotlin/okhttp/index.js.map +7 -0
  354. package/dist/plugins/kotlin/okhttp/okhttp.js +12 -15
  355. package/dist/plugins/kotlin/okhttp/okhttp.js.map +7 -0
  356. package/dist/plugins/kotlin/okhttp/okhttp.test.js +164 -0
  357. package/dist/plugins/kotlin/okhttp/okhttp.test.js.map +7 -0
  358. package/dist/plugins/node/axios/axios.js +12 -15
  359. package/dist/plugins/node/axios/axios.js.map +7 -0
  360. package/dist/plugins/node/axios/index.js +2 -1
  361. package/dist/plugins/node/axios/index.js.map +7 -0
  362. package/dist/plugins/node/fetch/fetch.d.ts.map +1 -1
  363. package/dist/plugins/node/fetch/fetch.js +73 -59
  364. package/dist/plugins/node/fetch/fetch.js.map +7 -0
  365. package/dist/plugins/node/fetch/fetch.test.js +200 -0
  366. package/dist/plugins/node/fetch/fetch.test.js.map +7 -0
  367. package/dist/plugins/node/fetch/index.js +2 -1
  368. package/dist/plugins/node/fetch/index.js.map +7 -0
  369. package/dist/plugins/node/ofetch/index.js +2 -1
  370. package/dist/plugins/node/ofetch/index.js.map +7 -0
  371. package/dist/plugins/node/ofetch/ofetch.d.ts.map +1 -1
  372. package/dist/plugins/node/ofetch/ofetch.js +44 -67
  373. package/dist/plugins/node/ofetch/ofetch.js.map +7 -0
  374. package/dist/plugins/node/ofetch/ofetch.test.js +126 -0
  375. package/dist/plugins/node/ofetch/ofetch.test.js.map +7 -0
  376. package/dist/plugins/node/undici/index.js +2 -1
  377. package/dist/plugins/node/undici/index.js.map +7 -0
  378. package/dist/plugins/node/undici/undici.d.ts.map +1 -1
  379. package/dist/plugins/node/undici/undici.js +46 -62
  380. package/dist/plugins/node/undici/undici.js.map +7 -0
  381. package/dist/plugins/node/undici/undici.test.js +133 -0
  382. package/dist/plugins/node/undici/undici.test.js.map +7 -0
  383. package/dist/plugins/objc/nsurlsession/index.js +2 -1
  384. package/dist/plugins/objc/nsurlsession/index.js.map +7 -0
  385. package/dist/plugins/objc/nsurlsession/nsurlsession.js +12 -15
  386. package/dist/plugins/objc/nsurlsession/nsurlsession.js.map +7 -0
  387. package/dist/plugins/ocaml/cohttp/cohttp.js +12 -15
  388. package/dist/plugins/ocaml/cohttp/cohttp.js.map +7 -0
  389. package/dist/plugins/ocaml/cohttp/index.js +2 -1
  390. package/dist/plugins/ocaml/cohttp/index.js.map +7 -0
  391. package/dist/plugins/php/curl/curl.js +119 -157
  392. package/dist/plugins/php/curl/curl.js.map +7 -0
  393. package/dist/plugins/php/curl/curl.test.js +564 -0
  394. package/dist/plugins/php/curl/curl.test.js.map +7 -0
  395. package/dist/plugins/php/curl/index.js +2 -1
  396. package/dist/plugins/php/curl/index.js.map +7 -0
  397. package/dist/plugins/php/guzzle/guzzle.js +115 -148
  398. package/dist/plugins/php/guzzle/guzzle.js.map +7 -0
  399. package/dist/plugins/php/guzzle/guzzle.test.js +546 -0
  400. package/dist/plugins/php/guzzle/guzzle.test.js.map +7 -0
  401. package/dist/plugins/php/guzzle/index.js +2 -1
  402. package/dist/plugins/php/guzzle/index.js.map +7 -0
  403. package/dist/plugins/powershell/restmethod/index.js +2 -1
  404. package/dist/plugins/powershell/restmethod/index.js.map +7 -0
  405. package/dist/plugins/powershell/restmethod/restmethod.js +12 -15
  406. package/dist/plugins/powershell/restmethod/restmethod.js.map +7 -0
  407. package/dist/plugins/powershell/webrequest/index.js +2 -1
  408. package/dist/plugins/powershell/webrequest/index.js.map +7 -0
  409. package/dist/plugins/powershell/webrequest/webrequest.js +12 -15
  410. package/dist/plugins/powershell/webrequest/webrequest.js.map +7 -0
  411. package/dist/plugins/python/python3/index.js +2 -1
  412. package/dist/plugins/python/python3/index.js.map +7 -0
  413. package/dist/plugins/python/python3/python3.js +12 -15
  414. package/dist/plugins/python/python3/python3.js.map +7 -0
  415. package/dist/plugins/python/requests/index.js +2 -1
  416. package/dist/plugins/python/requests/index.js.map +7 -0
  417. package/dist/plugins/python/requests/requests.d.ts.map +1 -1
  418. package/dist/plugins/python/requests/requests.js +98 -126
  419. package/dist/plugins/python/requests/requests.js.map +7 -0
  420. package/dist/plugins/python/requests/requests.test.js +419 -0
  421. package/dist/plugins/python/requests/requests.test.js.map +7 -0
  422. package/dist/plugins/r/httr/httr.js +12 -15
  423. package/dist/plugins/r/httr/httr.js.map +7 -0
  424. package/dist/plugins/r/httr/index.js +2 -1
  425. package/dist/plugins/r/httr/index.js.map +7 -0
  426. package/dist/plugins/ruby/native/index.js +2 -1
  427. package/dist/plugins/ruby/native/index.js.map +7 -0
  428. package/dist/plugins/ruby/native/native.js +12 -15
  429. package/dist/plugins/ruby/native/native.js.map +7 -0
  430. package/dist/plugins/ruby/native/native.test.js +240 -0
  431. package/dist/plugins/ruby/native/native.test.js.map +7 -0
  432. package/dist/plugins/shell/curl/curl.js +81 -114
  433. package/dist/plugins/shell/curl/curl.js.map +7 -0
  434. package/dist/plugins/shell/curl/curl.test.js +427 -0
  435. package/dist/plugins/shell/curl/curl.test.js.map +7 -0
  436. package/dist/plugins/shell/curl/index.js +2 -1
  437. package/dist/plugins/shell/curl/index.js.map +7 -0
  438. package/dist/plugins/shell/httpie/httpie.js +12 -15
  439. package/dist/plugins/shell/httpie/httpie.js.map +7 -0
  440. package/dist/plugins/shell/httpie/httpie.test.js +113 -0
  441. package/dist/plugins/shell/httpie/httpie.test.js.map +7 -0
  442. package/dist/plugins/shell/httpie/index.js +2 -1
  443. package/dist/plugins/shell/httpie/index.js.map +7 -0
  444. package/dist/plugins/shell/wget/index.js +2 -1
  445. package/dist/plugins/shell/wget/index.js.map +7 -0
  446. package/dist/plugins/shell/wget/wget.js +12 -15
  447. package/dist/plugins/shell/wget/wget.js.map +7 -0
  448. package/dist/plugins/shell/wget/wget.test.js +143 -0
  449. package/dist/plugins/shell/wget/wget.test.js.map +7 -0
  450. package/dist/plugins/swift/nsurlsession/index.js +2 -1
  451. package/dist/plugins/swift/nsurlsession/index.js.map +7 -0
  452. package/dist/plugins/swift/nsurlsession/nsurlsession.js +12 -15
  453. package/dist/plugins/swift/nsurlsession/nsurlsession.js.map +7 -0
  454. package/dist/plugins/swift/nsurlsession/nsurlsession.test.js +344 -0
  455. package/dist/plugins/swift/nsurlsession/nsurlsession.test.js.map +7 -0
  456. package/dist/snippetz.js +27 -27
  457. package/dist/snippetz.js.map +7 -0
  458. package/dist/snippetz.test.js +79 -0
  459. package/dist/snippetz.test.js.map +7 -0
  460. package/dist/utils/convertWithHttpSnippetLite.js +101 -104
  461. package/dist/utils/convertWithHttpSnippetLite.js.map +7 -0
  462. package/dist/utils/convertWithHttpSnippetLite.test.js +106 -0
  463. package/dist/utils/convertWithHttpSnippetLite.test.js.map +7 -0
  464. package/dist/utils/create-search-params.d.ts +4 -0
  465. package/dist/utils/create-search-params.d.ts.map +1 -0
  466. package/dist/utils/create-search-params.js +11 -0
  467. package/dist/utils/create-search-params.js.map +7 -0
  468. package/dist/utils/create-search-params.test.js +49 -0
  469. package/dist/utils/create-search-params.test.js.map +7 -0
  470. package/dist/utils/index.d.ts +0 -1
  471. package/dist/utils/index.d.ts.map +1 -1
  472. package/dist/utils/index.js +4 -4
  473. package/dist/utils/index.js.map +7 -0
  474. package/dist/utils/needsQuotes.js +5 -8
  475. package/dist/utils/needsQuotes.js.map +7 -0
  476. package/dist/utils/objectToString.d.ts +8 -0
  477. package/dist/utils/objectToString.d.ts.map +1 -1
  478. package/dist/utils/objectToString.js +48 -54
  479. package/dist/utils/objectToString.js.map +7 -0
  480. package/package.json +147 -151
  481. package/dist/utils/arrayToObject.d.ts +0 -8
  482. package/dist/utils/arrayToObject.d.ts.map +0 -1
  483. package/dist/utils/arrayToObject.js +0 -14
@@ -1,136 +1,135 @@
1
- import { CodeBuilder } from '../../../helpers/code-builder.js';
2
- import { literalDeclaration } from '../helpers.js';
3
-
4
- // @ts-nocheck
5
- /**
6
- * @description
7
- * HTTP code snippet generator for Swift using NSURLSession.
8
- *
9
- * @author
10
- * @thibaultCha
11
- *
12
- * for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
13
- */
1
+ import { CodeBuilder } from "../../../helpers/code-builder.js";
2
+ import { literalDeclaration } from "../helpers.js";
14
3
  const nsurlsession = {
15
- info: {
16
- key: 'nsurlsession',
17
- title: 'NSURLSession',
18
- link: 'https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html',
19
- description: "Foundation's NSURLSession request",
20
- },
21
- convert: ({ allHeaders, postData, fullUrl, method }, options) => {
22
- let _a;
23
- const opts = {
24
- indent: ' ',
25
- pretty: true,
26
- timeout: '10',
27
- ...options,
28
- };
29
- const { push, blank, join } = new CodeBuilder({ indent: opts.indent });
30
- // Markers for headers to be created as litteral objects and later be set on the NSURLRequest if exist
31
- const req = {
32
- hasHeaders: false,
33
- hasBody: false,
34
- };
35
- // We just want to make sure people understand that is the only dependency
36
- push('import Foundation');
37
- if (Object.keys(allHeaders).length) {
38
- req.hasHeaders = true;
4
+ info: {
5
+ key: "nsurlsession",
6
+ title: "NSURLSession",
7
+ link: "https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html",
8
+ description: "Foundation's NSURLSession request"
9
+ },
10
+ convert: ({ allHeaders, postData, fullUrl, method }, options) => {
11
+ let _a;
12
+ const opts = {
13
+ indent: " ",
14
+ pretty: true,
15
+ timeout: "10",
16
+ ...options
17
+ };
18
+ const { push, blank, join } = new CodeBuilder({ indent: opts.indent });
19
+ const req = {
20
+ hasHeaders: false,
21
+ hasBody: false
22
+ };
23
+ push("import Foundation");
24
+ if (Object.keys(allHeaders).length) {
25
+ req.hasHeaders = true;
26
+ blank();
27
+ push(literalDeclaration("headers", allHeaders, opts));
28
+ }
29
+ if (postData && (postData.text || postData.jsonObj || postData.params)) {
30
+ req.hasBody = true;
31
+ switch (postData.mimeType) {
32
+ case "application/x-www-form-urlencoded":
33
+ blank();
34
+ if ((_a = postData.params) === null || _a === void 0 ? void 0 : _a.length) {
35
+ const [head, ...tail] = postData.params;
36
+ push(
37
+ `let postData = NSMutableData(data: "${head.name}=${head.value}".data(using: String.Encoding.utf8)!)`
38
+ );
39
+ tail.forEach(({ name, value }) => {
40
+ push(
41
+ `postData.append("&${name}=${value}".data(using: String.Encoding.utf8)!)`
42
+ );
43
+ });
44
+ } else {
45
+ req.hasBody = false;
46
+ }
47
+ break;
48
+ case "application/json":
49
+ if (postData.jsonObj) {
50
+ push(
51
+ `${literalDeclaration("parameters", postData.jsonObj, opts)} as [String : Any]`
52
+ );
39
53
  blank();
40
- push(literalDeclaration('headers', allHeaders, opts));
41
- }
42
- if (postData && (postData.text || postData.jsonObj || postData.params)) {
43
- req.hasBody = true;
44
- switch (postData.mimeType) {
45
- case 'application/x-www-form-urlencoded':
46
- // By appending parameters one by one in the resulting snippet,
47
- // we make it easier for the user to edit it according to his or her needs after pasting.
48
- // The user can just add/remove lines adding/removing body parameters.
49
- blank();
50
- if ((_a = postData.params) === null || _a === void 0
51
- ? void 0
52
- : _a.length) {
53
- const [head, ...tail] = postData.params;
54
- push(`let postData = NSMutableData(data: "${head.name}=${head.value}".data(using: String.Encoding.utf8)!)`);
55
- tail.forEach(({ name, value }) => {
56
- push(`postData.append("&${name}=${value}".data(using: String.Encoding.utf8)!)`);
57
- });
58
- }
59
- else {
60
- req.hasBody = false;
61
- }
62
- break;
63
- case 'application/json':
64
- if (postData.jsonObj) {
65
- push(`${literalDeclaration('parameters', postData.jsonObj, opts)} as [String : Any]`);
66
- blank();
67
- push('let postData = JSONSerialization.data(withJSONObject: parameters, options: [])');
68
- }
69
- break;
70
- case 'multipart/form-data':
71
- /**
72
- * By appending multipart parameters one by one in the resulting snippet,
73
- * we make it easier for the user to edit it according to his or her needs after pasting.
74
- * The user can just edit the parameters NSDictionary or put this part of a snippet in a multipart builder method.
75
- */
76
- push(literalDeclaration('parameters', postData.params, opts));
77
- blank();
78
- push(`let boundary = "${postData.boundary}"`);
79
- blank();
80
- push('var body = ""');
81
- push('var error: NSError? = nil');
82
- push('for param in parameters {');
83
- push('let paramName = param["name"]!', 1);
84
- push('body += "--\\(boundary)\\r\\n"', 1);
85
- push('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""', 1);
86
- push('if let filename = param["fileName"] {', 1);
87
- push('let contentType = param["content-type"]!', 2);
88
- push('let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)', 2);
89
- push('if (error != nil) {', 2);
90
- push('print(error as Any)', 3);
91
- push('}', 2);
92
- push('body += "; filename=\\"\\(filename)\\"\\r\\n"', 2);
93
- push('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"', 2);
94
- push('body += fileContent', 2);
95
- push('} else if let paramValue = param["value"] {', 1);
96
- push('body += "\\r\\n\\r\\n\\(paramValue)"', 2);
97
- push('}', 1);
98
- push('}');
99
- break;
100
- default:
101
- blank();
102
- push(`let postData = NSData(data: "${postData.text}".data(using: String.Encoding.utf8)!)`);
103
- }
104
- }
105
- blank();
106
- // NSURLRequestUseProtocolCachePolicy is the default policy, let's just always set it to avoid confusion.
107
- push(`let request = NSMutableURLRequest(url: NSURL(string: "${fullUrl}")! as URL,`);
108
- push(' cachePolicy: .useProtocolCachePolicy,');
109
- push(
110
- // @ts-expect-error needs better types
111
- ` timeoutInterval: ${Number.parseInt(opts.timeout, 10).toFixed(1)})`);
112
- push(`request.httpMethod = "${method}"`);
113
- if (req.hasHeaders) {
114
- push('request.allHTTPHeaderFields = headers');
115
- }
116
- if (req.hasBody) {
117
- push('request.httpBody = postData as Data');
118
- }
119
- blank();
120
- // Retrieving the shared session will be less verbose than creating a new one.
121
- push('let session = URLSession.shared');
122
- push('let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in');
123
- push('if (error != nil) {', 1);
124
- push('print(error as Any)', 2);
125
- push('} else {', 1); // Casting the NSURLResponse to NSHTTPURLResponse so the user can see the status .
126
- push('let httpResponse = response as? HTTPURLResponse', 2);
127
- push('print(httpResponse)', 2);
128
- push('}', 1);
129
- push('})');
130
- blank();
131
- push('dataTask.resume()');
132
- return join();
133
- },
54
+ push(
55
+ "let postData = JSONSerialization.data(withJSONObject: parameters, options: [])"
56
+ );
57
+ }
58
+ break;
59
+ case "multipart/form-data":
60
+ push(literalDeclaration("parameters", postData.params, opts));
61
+ blank();
62
+ push(`let boundary = "${postData.boundary}"`);
63
+ blank();
64
+ push('var body = ""');
65
+ push("var error: NSError? = nil");
66
+ push("for param in parameters {");
67
+ push('let paramName = param["name"]!', 1);
68
+ push('body += "--\\(boundary)\\r\\n"', 1);
69
+ push(
70
+ 'body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""',
71
+ 1
72
+ );
73
+ push('if let filename = param["fileName"] {', 1);
74
+ push('let contentType = param["content-type"]!', 2);
75
+ push(
76
+ "let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)",
77
+ 2
78
+ );
79
+ push("if (error != nil) {", 2);
80
+ push("print(error as Any)", 3);
81
+ push("}", 2);
82
+ push('body += "; filename=\\"\\(filename)\\"\\r\\n"', 2);
83
+ push('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"', 2);
84
+ push("body += fileContent", 2);
85
+ push('} else if let paramValue = param["value"] {', 1);
86
+ push('body += "\\r\\n\\r\\n\\(paramValue)"', 2);
87
+ push("}", 1);
88
+ push("}");
89
+ break;
90
+ default:
91
+ blank();
92
+ push(
93
+ `let postData = NSData(data: "${postData.text}".data(using: String.Encoding.utf8)!)`
94
+ );
95
+ }
96
+ }
97
+ blank();
98
+ push(
99
+ `let request = NSMutableURLRequest(url: NSURL(string: "${fullUrl}")! as URL,`
100
+ );
101
+ push(
102
+ " cachePolicy: .useProtocolCachePolicy,"
103
+ );
104
+ push(
105
+ // @ts-expect-error needs better types
106
+ ` timeoutInterval: ${Number.parseInt(opts.timeout, 10).toFixed(1)})`
107
+ );
108
+ push(`request.httpMethod = "${method}"`);
109
+ if (req.hasHeaders) {
110
+ push("request.allHTTPHeaderFields = headers");
111
+ }
112
+ if (req.hasBody) {
113
+ push("request.httpBody = postData as Data");
114
+ }
115
+ blank();
116
+ push("let session = URLSession.shared");
117
+ push(
118
+ "let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in"
119
+ );
120
+ push("if (error != nil) {", 1);
121
+ push("print(error as Any)", 2);
122
+ push("} else {", 1);
123
+ push("let httpResponse = response as? HTTPURLResponse", 2);
124
+ push("print(httpResponse)", 2);
125
+ push("}", 1);
126
+ push("})");
127
+ blank();
128
+ push("dataTask.resume()");
129
+ return join();
130
+ }
134
131
  };
135
-
136
- export { nsurlsession };
132
+ export {
133
+ nsurlsession
134
+ };
135
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/httpsnippet-lite/esm/targets/swift/nsurlsession/client.ts"],
4
+ "sourcesContent": ["// @ts-nocheck\n/**\n * @description\n * HTTP code snippet generator for Swift using NSURLSession.\n *\n * @author\n * @thibaultCha\n *\n * for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.\n */\nimport { CodeBuilder } from '../../../helpers/code-builder.js'\nimport { literalDeclaration } from '../helpers.js'\n\nexport const nsurlsession = {\n info: {\n key: 'nsurlsession',\n title: 'NSURLSession',\n link: 'https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html',\n description: \"Foundation's NSURLSession request\",\n },\n convert: ({ allHeaders, postData, fullUrl, method }, options) => {\n let _a\n const opts = {\n indent: ' ',\n pretty: true,\n timeout: '10',\n ...options,\n }\n const { push, blank, join } = new CodeBuilder({ indent: opts.indent })\n // Markers for headers to be created as litteral objects and later be set on the NSURLRequest if exist\n const req = {\n hasHeaders: false,\n hasBody: false,\n }\n // We just want to make sure people understand that is the only dependency\n push('import Foundation')\n if (Object.keys(allHeaders).length) {\n req.hasHeaders = true\n blank()\n push(literalDeclaration('headers', allHeaders, opts))\n }\n if (postData && (postData.text || postData.jsonObj || postData.params)) {\n req.hasBody = true\n switch (postData.mimeType) {\n case 'application/x-www-form-urlencoded':\n // By appending parameters one by one in the resulting snippet,\n // we make it easier for the user to edit it according to his or her needs after pasting.\n // The user can just add/remove lines adding/removing body parameters.\n blank()\n if (\n (_a = postData.params) === null || _a === void 0\n ? void 0\n : _a.length\n ) {\n const [head, ...tail] = postData.params\n push(\n `let postData = NSMutableData(data: \"${head.name}=${head.value}\".data(using: String.Encoding.utf8)!)`,\n )\n tail.forEach(({ name, value }) => {\n push(\n `postData.append(\"&${name}=${value}\".data(using: String.Encoding.utf8)!)`,\n )\n })\n } else {\n req.hasBody = false\n }\n break\n case 'application/json':\n if (postData.jsonObj) {\n push(\n `${literalDeclaration('parameters', postData.jsonObj, opts)} as [String : Any]`,\n )\n blank()\n push(\n 'let postData = JSONSerialization.data(withJSONObject: parameters, options: [])',\n )\n }\n break\n case 'multipart/form-data':\n /**\n * By appending multipart parameters one by one in the resulting snippet,\n * we make it easier for the user to edit it according to his or her needs after pasting.\n * The user can just edit the parameters NSDictionary or put this part of a snippet in a multipart builder method.\n */\n push(literalDeclaration('parameters', postData.params, opts))\n blank()\n push(`let boundary = \"${postData.boundary}\"`)\n blank()\n push('var body = \"\"')\n push('var error: NSError? = nil')\n push('for param in parameters {')\n push('let paramName = param[\"name\"]!', 1)\n push('body += \"--\\\\(boundary)\\\\r\\\\n\"', 1)\n push(\n 'body += \"Content-Disposition:form-data; name=\\\\\"\\\\(paramName)\\\\\"\"',\n 1,\n )\n push('if let filename = param[\"fileName\"] {', 1)\n push('let contentType = param[\"content-type\"]!', 2)\n push(\n 'let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)',\n 2,\n )\n push('if (error != nil) {', 2)\n push('print(error as Any)', 3)\n push('}', 2)\n push('body += \"; filename=\\\\\"\\\\(filename)\\\\\"\\\\r\\\\n\"', 2)\n push('body += \"Content-Type: \\\\(contentType)\\\\r\\\\n\\\\r\\\\n\"', 2)\n push('body += fileContent', 2)\n push('} else if let paramValue = param[\"value\"] {', 1)\n push('body += \"\\\\r\\\\n\\\\r\\\\n\\\\(paramValue)\"', 2)\n push('}', 1)\n push('}')\n break\n default:\n blank()\n push(\n `let postData = NSData(data: \"${postData.text}\".data(using: String.Encoding.utf8)!)`,\n )\n }\n }\n blank()\n // NSURLRequestUseProtocolCachePolicy is the default policy, let's just always set it to avoid confusion.\n push(\n `let request = NSMutableURLRequest(url: NSURL(string: \"${fullUrl}\")! as URL,`,\n )\n push(\n ' cachePolicy: .useProtocolCachePolicy,',\n )\n push(\n // @ts-expect-error needs better types\n ` timeoutInterval: ${Number.parseInt(opts.timeout, 10).toFixed(1)})`,\n )\n push(`request.httpMethod = \"${method}\"`)\n if (req.hasHeaders) {\n push('request.allHTTPHeaderFields = headers')\n }\n if (req.hasBody) {\n push('request.httpBody = postData as Data')\n }\n blank()\n // Retrieving the shared session will be less verbose than creating a new one.\n push('let session = URLSession.shared')\n push(\n 'let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in',\n )\n push('if (error != nil) {', 1)\n push('print(error as Any)', 2)\n push('} else {', 1) // Casting the NSURLResponse to NSHTTPURLResponse so the user can see the status .\n push('let httpResponse = response as? HTTPURLResponse', 2)\n push('print(httpResponse)', 2)\n push('}', 1)\n push('})')\n blank()\n push('dataTask.resume()')\n return join()\n },\n}\n"],
5
+ "mappings": "AAUA,SAAS,mBAAmB;AAC5B,SAAS,0BAA0B;AAE5B,MAAM,eAAe;AAAA,EAC1B,MAAM;AAAA,IACJ,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA,SAAS,CAAC,EAAE,YAAY,UAAU,SAAS,OAAO,GAAG,YAAY;AAC/D,QAAI;AACJ,UAAM,OAAO;AAAA,MACX,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,GAAG;AAAA,IACL;AACA,UAAM,EAAE,MAAM,OAAO,KAAK,IAAI,IAAI,YAAY,EAAE,QAAQ,KAAK,OAAO,CAAC;AAErE,UAAM,MAAM;AAAA,MACV,YAAY;AAAA,MACZ,SAAS;AAAA,IACX;AAEA,SAAK,mBAAmB;AACxB,QAAI,OAAO,KAAK,UAAU,EAAE,QAAQ;AAClC,UAAI,aAAa;AACjB,YAAM;AACN,WAAK,mBAAmB,WAAW,YAAY,IAAI,CAAC;AAAA,IACtD;AACA,QAAI,aAAa,SAAS,QAAQ,SAAS,WAAW,SAAS,SAAS;AACtE,UAAI,UAAU;AACd,cAAQ,SAAS,UAAU;AAAA,QACzB,KAAK;AAIH,gBAAM;AACN,eACG,KAAK,SAAS,YAAY,QAAQ,OAAO,SACtC,SACA,GAAG,QACP;AACA,kBAAM,CAAC,MAAM,GAAG,IAAI,IAAI,SAAS;AACjC;AAAA,cACE,uCAAuC,KAAK,IAAI,IAAI,KAAK,KAAK;AAAA,YAChE;AACA,iBAAK,QAAQ,CAAC,EAAE,MAAM,MAAM,MAAM;AAChC;AAAA,gBACE,qBAAqB,IAAI,IAAI,KAAK;AAAA,cACpC;AAAA,YACF,CAAC;AAAA,UACH,OAAO;AACL,gBAAI,UAAU;AAAA,UAChB;AACA;AAAA,QACF,KAAK;AACH,cAAI,SAAS,SAAS;AACpB;AAAA,cACE,GAAG,mBAAmB,cAAc,SAAS,SAAS,IAAI,CAAC;AAAA,YAC7D;AACA,kBAAM;AACN;AAAA,cACE;AAAA,YACF;AAAA,UACF;AACA;AAAA,QACF,KAAK;AAMH,eAAK,mBAAmB,cAAc,SAAS,QAAQ,IAAI,CAAC;AAC5D,gBAAM;AACN,eAAK,mBAAmB,SAAS,QAAQ,GAAG;AAC5C,gBAAM;AACN,eAAK,eAAe;AACpB,eAAK,2BAA2B;AAChC,eAAK,2BAA2B;AAChC,eAAK,kCAAkC,CAAC;AACxC,eAAK,kCAAkC,CAAC;AACxC;AAAA,YACE;AAAA,YACA;AAAA,UACF;AACA,eAAK,yCAAyC,CAAC;AAC/C,eAAK,4CAA4C,CAAC;AAClD;AAAA,YACE;AAAA,YACA;AAAA,UACF;AACA,eAAK,uBAAuB,CAAC;AAC7B,eAAK,uBAAuB,CAAC;AAC7B,eAAK,KAAK,CAAC;AACX,eAAK,iDAAiD,CAAC;AACvD,eAAK,uDAAuD,CAAC;AAC7D,eAAK,uBAAuB,CAAC;AAC7B,eAAK,+CAA+C,CAAC;AACrD,eAAK,wCAAwC,CAAC;AAC9C,eAAK,KAAK,CAAC;AACX,eAAK,GAAG;AACR;AAAA,QACF;AACE,gBAAM;AACN;AAAA,YACE,gCAAgC,SAAS,IAAI;AAAA,UAC/C;AAAA,MACJ;AAAA,IACF;AACA,UAAM;AAEN;AAAA,MACE,yDAAyD,OAAO;AAAA,IAClE;AACA;AAAA,MACE;AAAA,IACF;AACA;AAAA;AAAA,MAEE,wDAAwD,OAAO,SAAS,KAAK,SAAS,EAAE,EAAE,QAAQ,CAAC,CAAC;AAAA,IACtG;AACA,SAAK,yBAAyB,MAAM,GAAG;AACvC,QAAI,IAAI,YAAY;AAClB,WAAK,uCAAuC;AAAA,IAC9C;AACA,QAAI,IAAI,SAAS;AACf,WAAK,qCAAqC;AAAA,IAC5C;AACA,UAAM;AAEN,SAAK,iCAAiC;AACtC;AAAA,MACE;AAAA,IACF;AACA,SAAK,uBAAuB,CAAC;AAC7B,SAAK,uBAAuB,CAAC;AAC7B,SAAK,YAAY,CAAC;AAClB,SAAK,mDAAmD,CAAC;AACzD,SAAK,uBAAuB,CAAC;AAC7B,SAAK,KAAK,CAAC;AACX,SAAK,IAAI;AACT,UAAM;AACN,SAAK,mBAAmB;AACxB,WAAO,KAAK;AAAA,EACd;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,16 @@
1
+ import { nsurlsession } from "./nsurlsession/client.js";
2
+ const swift = {
3
+ info: {
4
+ key: "swift",
5
+ title: "Swift",
6
+ extname: ".swift",
7
+ default: "nsurlsession"
8
+ },
9
+ clientsById: {
10
+ nsurlsession
11
+ }
12
+ };
13
+ export {
14
+ swift
15
+ };
16
+ //# sourceMappingURL=target.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/httpsnippet-lite/esm/targets/swift/target.ts"],
4
+ "sourcesContent": ["// @ts-nocheck\nimport { nsurlsession } from './nsurlsession/client.js'\n\nexport const swift = {\n info: {\n key: 'swift',\n title: 'Swift',\n extname: '.swift',\n default: 'nsurlsession',\n },\n clientsById: {\n nsurlsession,\n },\n}\n"],
5
+ "mappings": "AACA,SAAS,oBAAoB;AAEtB,MAAM,QAAQ;AAAA,EACnB,MAAM;AAAA,IACJ,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AAAA,EACA,aAAa;AAAA,IACX;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=code-builder.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=escape.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license https://raw.githubusercontent.com/node-fetch/node-fetch/master/LICENSE.md
3
+ *
4
+ * The MIT License (MIT)
5
+ *
6
+ * Copyright (c) 2016 - 2020 Node Fetch Team
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * Extracted from https://github.com/node-fetch/node-fetch/blob/64c5c296a0250b852010746c76144cb9e14698d9/src/utils/form-data.js
27
+ */
28
+ //# sourceMappingURL=form-data.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/httpsnippet-lite/types/helpers/form-data.d.ts"],
4
+ "sourcesContent": ["/**\n * @license https://raw.githubusercontent.com/node-fetch/node-fetch/master/LICENSE.md\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 - 2020 Node Fetch Team\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * Extracted from https://github.com/node-fetch/node-fetch/blob/64c5c296a0250b852010746c76144cb9e14698d9/src/utils/form-data.js\n */\nimport type { FormData } from 'formdata-node'\n\nexport declare const isBlob: (object: any) => boolean\nexport declare const formDataIterator: (\n form: FormData,\n boundary: string,\n) => AsyncGenerator<string, void, unknown>\n"],
5
+ "mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=headers.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=reducer.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=shell.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=url.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=utils.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ import { CodeBuilder } from "./helpers/code-builder.js";
2
+ import { availableTargets, extname } from "./helpers/utils.js";
3
+ import { isClient, isTarget } from "./targets/targets.js";
4
+ import {
5
+ addTarget,
6
+ addTargetClient,
7
+ isValidTargetId
8
+ } from "./targets/targets.js";
9
+ export {
10
+ CodeBuilder,
11
+ addTarget,
12
+ addTargetClient,
13
+ availableTargets,
14
+ extname,
15
+ isClient,
16
+ isTarget,
17
+ isValidTargetId
18
+ };
19
+ //# sourceMappingURL=httpsnippet.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/httpsnippet-lite/types/httpsnippet.d.ts"],
4
+ "sourcesContent": ["import type {\n Request as NpmHarRequest,\n Param,\n PostDataCommon,\n} from 'har-format'\n\nimport type { ReducedHelperObject } from './helpers/reducer.js'\nimport type { ExtendedURL } from './helpers/url.js'\nimport type { ClientId, TargetId } from './targets/targets.js'\n\nexport { CodeBuilder } from './helpers/code-builder.js'\nexport { availableTargets, extname } from './helpers/utils.js'\nexport { isClient, isTarget } from './targets/targets.js'\nexport type { ClientId, TargetId }\nexport {\n addTarget,\n addTargetClient,\n isValidTargetId,\n} from './targets/targets.js'\n/**\n * is this wrong? yes. according to the spec (http://www.softwareishard.com/blog/har-12-spec/#postData) it's technically wrong since `params` and `text` are (by the spec) mutually exclusive. However, in practice, this is not what is often the case.\n *\n * In general, this library takes a _descriptive_ rather than _perscriptive_ approach (see https://amyrey.web.unc.edu/classes/ling-101-online/tutorials/understanding-prescriptive-vs-descriptive-grammar/).\n *\n * Then, in addition to that, it really adds to complexity with TypeScript (TypeScript takes this constraint very very seriously) in a way that's not actually super useful. So, we treat this object as though it could have both or either of `params` and/or `text`.\n */\ntype PostDataBase = PostDataCommon & {\n text?: string\n params?: Param[]\n}\nexport type HarRequest = Omit<NpmHarRequest, 'postData'> & {\n postData?: PostDataBase\n}\nexport type RequestExtras = {\n postData?: PostDataBase & {\n jsonObj?: ReducedHelperObject\n paramsObj?: ReducedHelperObject\n boundary?: string\n }\n fullUrl: string\n queryObj: ReducedHelperObject\n headersObj: ReducedHelperObject\n uriObj: ExtendedURL\n cookiesObj: ReducedHelperObject\n allHeaders: ReducedHelperObject\n}\nexport type Request = HarRequest & RequestExtras\ntype Entry = {\n request: Partial<HarRequest>\n}\ntype HarEntry = {\n log: {\n version: string\n creator: {\n name: string\n version: string\n }\n entries: Entry[]\n }\n}\nexport declare class HTTPSnippet {\n readonly requests: Promise<Request[]>\n constructor(input: HarEntry | HarRequest)\n prepare(harRequest: HarRequest): Promise<{\n allHeaders: {\n [x: string]: string | string[]\n }\n fullUrl: string\n url: string\n uriObj: ExtendedURL\n method: string\n headers: import('har-format').Header[]\n comment?: string | undefined\n postData?:\n | (PostDataCommon & {\n text?: string | undefined\n params?: Param[] | undefined\n } & {\n jsonObj?: ReducedHelperObject | undefined\n paramsObj?: ReducedHelperObject | undefined\n boundary?: string | undefined\n })\n | undefined\n httpVersion: string\n cookies: import('har-format').Cookie[]\n queryString: import('har-format').QueryString[]\n headersSize: number\n bodySize: number\n headersObj: ReducedHelperObject\n queryObj: ReducedHelperObject\n cookiesObj: ReducedHelperObject\n }>\n convert(\n targetId: TargetId,\n clientId?: ClientId,\n options?: any,\n ): Promise<string | string[] | null>\n}\n"],
5
+ "mappings": "AAUA,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB,eAAe;AAC1C,SAAS,UAAU,gBAAgB;AAEnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=client.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=target.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=client.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=target.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=client.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=client.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=target.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=client.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=target.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=client.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=target.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }