@scalar/snippetz 0.2.8 → 0.2.10
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.
- package/dist/clients.d.ts +6 -0
- package/dist/clients.d.ts.map +1 -0
- package/dist/clients.js +157 -0
- package/dist/httpsnippet-lite/esm/helpers/code-builder.d.ts +8 -0
- package/dist/httpsnippet-lite/esm/helpers/code-builder.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{dist/esm → esm}/helpers/code-builder.js +4 -2
- package/dist/httpsnippet-lite/esm/helpers/escape.d.ts +29 -0
- package/dist/httpsnippet-lite/esm/helpers/escape.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{dist/esm → esm}/helpers/escape.js +3 -1
- package/dist/httpsnippet-lite/esm/helpers/form-data.d.ts +3 -0
- package/dist/httpsnippet-lite/esm/helpers/form-data.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/helpers/headers.d.ts +17 -0
- package/dist/httpsnippet-lite/esm/helpers/headers.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{dist/esm → esm}/helpers/headers.js +3 -1
- package/dist/httpsnippet-lite/esm/helpers/reducer.d.ts +2 -0
- package/dist/httpsnippet-lite/esm/helpers/reducer.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/helpers/shell.d.ts +7 -0
- package/dist/httpsnippet-lite/esm/helpers/shell.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{dist/esm → esm}/helpers/shell.js +2 -0
- package/dist/httpsnippet-lite/esm/helpers/url.d.ts +5 -0
- package/dist/httpsnippet-lite/esm/helpers/url.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/helpers/utils.d.ts +3 -0
- package/dist/httpsnippet-lite/esm/helpers/utils.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/httpsnippet.d.ts +10 -0
- package/dist/httpsnippet-lite/esm/httpsnippet.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.d.ts +16 -0
- package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.d.ts.map +1 -0
- package/dist/{_virtual/client28.js → httpsnippet-lite/esm/targets/c/libcurl/client.js} +5 -3
- package/dist/httpsnippet-lite/esm/targets/c/target.d.ts +26 -0
- package/dist/httpsnippet-lite/esm/targets/c/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.d.ts +16 -0
- package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.d.ts.map +1 -0
- package/dist/{_virtual/client27.js → httpsnippet-lite/esm/targets/clojure/clj_http/client.js} +15 -7
- package/dist/httpsnippet-lite/esm/targets/clojure/target.d.ts +26 -0
- package/dist/httpsnippet-lite/esm/targets/clojure/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/csharp/httpclient/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/csharp/httpclient/client.d.ts.map +1 -0
- package/dist/{_virtual/client26.js → httpsnippet-lite/esm/targets/csharp/httpclient/client.js} +45 -30
- package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.d.ts +17 -0
- package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.d.ts.map +1 -0
- package/dist/{_virtual/client25.js → httpsnippet-lite/esm/targets/csharp/restsharp/client.js} +20 -8
- package/dist/httpsnippet-lite/esm/targets/csharp/target.d.ts +41 -0
- package/dist/httpsnippet-lite/esm/targets/csharp/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/go/native/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/go/native/client.d.ts.map +1 -0
- package/dist/{_virtual/client24.js → httpsnippet-lite/esm/targets/go/native/client.js} +5 -3
- package/dist/httpsnippet-lite/esm/targets/go/target.d.ts +25 -0
- package/dist/httpsnippet-lite/esm/targets/go/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/http/http1.1/client.d.ts +22 -0
- package/dist/httpsnippet-lite/esm/targets/http/http1.1/client.d.ts.map +1 -0
- package/dist/{_virtual/client23.js → httpsnippet-lite/esm/targets/http/http1.1/client.js} +10 -4
- package/dist/httpsnippet-lite/esm/targets/http/target.d.ts +27 -0
- package/dist/httpsnippet-lite/esm/targets/http/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.d.ts.map +1 -0
- package/dist/{_virtual/client22.js → httpsnippet-lite/esm/targets/java/asynchttp/client.js} +5 -3
- package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.d.ts.map +1 -0
- package/dist/{_virtual/client20.js → httpsnippet-lite/esm/targets/java/nethttp/client.js} +5 -3
- package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.d.ts.map +1 -0
- package/dist/{_virtual/client21.js → httpsnippet-lite/esm/targets/java/okhttp/client.js} +5 -3
- package/dist/httpsnippet-lite/esm/targets/java/target.d.ts +67 -0
- package/dist/httpsnippet-lite/esm/targets/java/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/java/unirest/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/java/unirest/client.d.ts.map +1 -0
- package/dist/{_virtual/client19.js → httpsnippet-lite/esm/targets/java/unirest/client.js} +5 -3
- package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.d.ts +16 -0
- package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.d.ts.map +1 -0
- package/dist/{_virtual/client18.js → httpsnippet-lite/esm/targets/javascript/axios/client.js} +9 -5
- package/dist/httpsnippet-lite/esm/targets/javascript/fetch/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/javascript/fetch/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.d.ts.map +1 -0
- package/dist/{_virtual/client17.js → httpsnippet-lite/esm/targets/javascript/jquery/client.js} +13 -6
- package/dist/httpsnippet-lite/esm/targets/javascript/target.d.ts +68 -0
- package/dist/httpsnippet-lite/esm/targets/javascript/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.d.ts.map +1 -0
- package/dist/{_virtual/client15.js → httpsnippet-lite/esm/targets/javascript/xhr/client.js} +12 -7
- package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.d.ts.map +1 -0
- package/dist/{_virtual/client14.js → httpsnippet-lite/esm/targets/kotlin/okhttp/client.js} +5 -3
- package/dist/httpsnippet-lite/esm/targets/kotlin/target.d.ts +25 -0
- package/dist/httpsnippet-lite/esm/targets/kotlin/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/node/axios/client.d.ts +16 -0
- package/dist/httpsnippet-lite/esm/targets/node/axios/client.d.ts.map +1 -0
- package/dist/{_virtual/client16.js → httpsnippet-lite/esm/targets/node/axios/client.js} +12 -5
- package/dist/httpsnippet-lite/esm/targets/node/fetch/client.d.ts +16 -0
- package/dist/httpsnippet-lite/esm/targets/node/fetch/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/node/native/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/node/native/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/node/request/client.d.ts +17 -0
- package/dist/httpsnippet-lite/esm/targets/node/request/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/node/target.d.ts +87 -0
- package/dist/httpsnippet-lite/esm/targets/node/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/node/unirest/client.d.ts +17 -0
- package/dist/httpsnippet-lite/esm/targets/node/unirest/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/objc/helpers.d.ts +27 -0
- package/dist/httpsnippet-lite/esm/targets/objc/helpers.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{dist/esm → esm}/targets/objc/helpers.js +2 -0
- package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.d.ts.map +1 -0
- package/dist/{_virtual/client13.js → httpsnippet-lite/esm/targets/objc/nsurlsession/client.js} +8 -4
- package/dist/httpsnippet-lite/esm/targets/objc/target.d.ts +25 -0
- package/dist/httpsnippet-lite/esm/targets/objc/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.d.ts.map +1 -0
- package/dist/{_virtual/client12.js → httpsnippet-lite/esm/targets/ocaml/cohttp/client.js} +8 -4
- package/dist/httpsnippet-lite/esm/targets/ocaml/target.d.ts +25 -0
- package/dist/httpsnippet-lite/esm/targets/ocaml/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/php/curl/client.d.ts +18 -0
- package/dist/httpsnippet-lite/esm/targets/php/curl/client.d.ts.map +1 -0
- package/dist/{_virtual/client11.js → httpsnippet-lite/esm/targets/php/curl/client.js} +13 -7
- package/dist/httpsnippet-lite/esm/targets/php/guzzle/client.d.ts +16 -0
- package/dist/httpsnippet-lite/esm/targets/php/guzzle/client.d.ts.map +1 -0
- package/dist/{_virtual/client10.js → httpsnippet-lite/esm/targets/php/guzzle/client.js} +12 -7
- package/dist/httpsnippet-lite/esm/targets/php/helpers.d.ts +3 -0
- package/dist/httpsnippet-lite/esm/targets/php/helpers.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{dist/esm → esm}/targets/php/helpers.js +2 -0
- package/dist/httpsnippet-lite/esm/targets/php/http1/client.d.ts +17 -0
- package/dist/httpsnippet-lite/esm/targets/php/http1/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/php/http2/client.d.ts +17 -0
- package/dist/httpsnippet-lite/esm/targets/php/http2/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/php/target.d.ts +75 -0
- package/dist/httpsnippet-lite/esm/targets/php/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/powershell/common.d.ts +10 -0
- package/dist/httpsnippet-lite/esm/targets/powershell/common.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{dist/esm → esm}/targets/powershell/common.js +4 -2
- package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.d.ts +18 -0
- package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.d.ts.map +1 -0
- package/dist/{_virtual/client9.js → httpsnippet-lite/esm/targets/powershell/restmethod/client.js} +3 -1
- package/dist/httpsnippet-lite/esm/targets/powershell/target.d.ts +45 -0
- package/dist/httpsnippet-lite/esm/targets/powershell/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.d.ts +18 -0
- package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.d.ts.map +1 -0
- package/dist/{_virtual/client8.js → httpsnippet-lite/esm/targets/powershell/webrequest/client.js} +3 -1
- package/dist/httpsnippet-lite/esm/targets/python/helpers.d.ts +9 -0
- package/dist/httpsnippet-lite/esm/targets/python/helpers.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{dist/esm → esm}/targets/python/helpers.js +4 -2
- package/dist/httpsnippet-lite/esm/targets/python/python3/client.d.ts +19 -0
- package/dist/httpsnippet-lite/esm/targets/python/python3/client.d.ts.map +1 -0
- package/dist/{_virtual/client7.js → httpsnippet-lite/esm/targets/python/python3/client.js} +7 -3
- package/dist/httpsnippet-lite/esm/targets/python/requests/client.d.ts +16 -0
- package/dist/httpsnippet-lite/esm/targets/python/requests/client.d.ts.map +1 -0
- package/dist/{_virtual/client6.js → httpsnippet-lite/esm/targets/python/requests/client.js} +18 -7
- package/dist/httpsnippet-lite/esm/targets/python/target.d.ts +44 -0
- package/dist/httpsnippet-lite/esm/targets/python/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/r/httr/client.d.ts +17 -0
- package/dist/httpsnippet-lite/esm/targets/r/httr/client.d.ts.map +1 -0
- package/dist/{_virtual/client5.js → httpsnippet-lite/esm/targets/r/httr/client.js} +10 -6
- package/dist/httpsnippet-lite/esm/targets/r/target.d.ts +27 -0
- package/dist/httpsnippet-lite/esm/targets/r/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/ruby/native/client.d.ts +16 -0
- package/dist/httpsnippet-lite/esm/targets/ruby/native/client.d.ts.map +1 -0
- package/dist/{_virtual/client4.js → httpsnippet-lite/esm/targets/ruby/native/client.js} +5 -3
- package/dist/httpsnippet-lite/esm/targets/ruby/target.d.ts +26 -0
- package/dist/httpsnippet-lite/esm/targets/ruby/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/shell/curl/client.d.ts +17 -0
- package/dist/httpsnippet-lite/esm/targets/shell/curl/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.d.ts +17 -0
- package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.d.ts.map +1 -0
- package/dist/{_virtual/client3.js → httpsnippet-lite/esm/targets/shell/httpie/client.js} +14 -9
- package/dist/httpsnippet-lite/esm/targets/shell/target.d.ts +57 -0
- package/dist/httpsnippet-lite/esm/targets/shell/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/shell/wget/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/shell/wget/client.d.ts.map +1 -0
- package/dist/{_virtual/client2.js → httpsnippet-lite/esm/targets/shell/wget/client.js} +5 -3
- package/dist/httpsnippet-lite/esm/targets/swift/helpers.d.ts +17 -0
- package/dist/httpsnippet-lite/esm/targets/swift/helpers.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{dist/esm → esm}/targets/swift/helpers.js +2 -0
- package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.d.ts +15 -0
- package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.d.ts.map +1 -0
- package/dist/{_virtual → httpsnippet-lite/esm/targets/swift/nsurlsession}/client.js +8 -4
- package/dist/httpsnippet-lite/esm/targets/swift/target.d.ts +25 -0
- package/dist/httpsnippet-lite/esm/targets/swift/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/esm/targets/targets.d.ts +731 -0
- package/dist/httpsnippet-lite/esm/targets/targets.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/plugins/c/libcurl/libcurl.d.ts +1 -1
- package/dist/plugins/c/libcurl/libcurl.d.ts.map +1 -1
- package/dist/plugins/c/libcurl/libcurl.js +3 -2
- package/dist/plugins/clojure/clj_http/clj_http.d.ts +1 -1
- package/dist/plugins/clojure/clj_http/clj_http.d.ts.map +1 -1
- package/dist/plugins/clojure/clj_http/clj_http.js +3 -2
- package/dist/plugins/csharp/httpclient/httpclient.d.ts +1 -1
- package/dist/plugins/csharp/httpclient/httpclient.d.ts.map +1 -1
- package/dist/plugins/csharp/httpclient/httpclient.js +3 -2
- package/dist/plugins/csharp/restsharp/restsharp.d.ts +1 -1
- package/dist/plugins/csharp/restsharp/restsharp.d.ts.map +1 -1
- package/dist/plugins/csharp/restsharp/restsharp.js +3 -2
- package/dist/plugins/dart/http/http.d.ts +6 -0
- package/dist/plugins/dart/http/http.d.ts.map +1 -0
- package/dist/plugins/dart/http/http.js +103 -0
- package/dist/plugins/dart/http/index.d.ts +2 -0
- package/dist/plugins/dart/http/index.d.ts.map +1 -0
- package/dist/plugins/dart/http/index.js +1 -0
- package/dist/plugins/go/native/native.d.ts +1 -1
- package/dist/plugins/go/native/native.d.ts.map +1 -1
- package/dist/plugins/go/native/native.js +3 -2
- package/dist/plugins/http/http11/http11.d.ts +1 -1
- package/dist/plugins/http/http11/http11.d.ts.map +1 -1
- package/dist/plugins/http/http11/http11.js +3 -2
- package/dist/plugins/java/asynchttp/asynchttp.d.ts +1 -1
- package/dist/plugins/java/asynchttp/asynchttp.d.ts.map +1 -1
- package/dist/plugins/java/asynchttp/asynchttp.js +3 -2
- package/dist/plugins/java/nethttp/nethttp.d.ts +1 -1
- package/dist/plugins/java/nethttp/nethttp.d.ts.map +1 -1
- package/dist/plugins/java/nethttp/nethttp.js +3 -2
- package/dist/plugins/java/okhttp/okhttp.d.ts +1 -1
- package/dist/plugins/java/okhttp/okhttp.d.ts.map +1 -1
- package/dist/plugins/java/okhttp/okhttp.js +3 -2
- package/dist/plugins/java/unirest/unirest.d.ts +1 -1
- package/dist/plugins/java/unirest/unirest.d.ts.map +1 -1
- package/dist/plugins/java/unirest/unirest.js +3 -2
- package/dist/plugins/js/axios/axios.d.ts +1 -1
- package/dist/plugins/js/axios/axios.d.ts.map +1 -1
- package/dist/plugins/js/axios/axios.js +3 -2
- package/dist/plugins/js/fetch/fetch.d.ts +1 -1
- package/dist/plugins/js/fetch/fetch.d.ts.map +1 -1
- package/dist/plugins/js/fetch/fetch.js +3 -2
- package/dist/plugins/js/jquery/jquery.d.ts +1 -1
- package/dist/plugins/js/jquery/jquery.d.ts.map +1 -1
- package/dist/plugins/js/jquery/jquery.js +3 -2
- package/dist/plugins/js/ofetch/ofetch.d.ts +1 -1
- package/dist/plugins/js/ofetch/ofetch.d.ts.map +1 -1
- package/dist/plugins/js/ofetch/ofetch.js +3 -2
- package/dist/plugins/js/xhr/xhr.d.ts +1 -1
- package/dist/plugins/js/xhr/xhr.d.ts.map +1 -1
- package/dist/plugins/js/xhr/xhr.js +3 -2
- package/dist/plugins/kotlin/okhttp/okhttp.d.ts +1 -1
- package/dist/plugins/kotlin/okhttp/okhttp.d.ts.map +1 -1
- package/dist/plugins/kotlin/okhttp/okhttp.js +3 -2
- package/dist/plugins/node/axios/axios.d.ts +1 -1
- package/dist/plugins/node/axios/axios.d.ts.map +1 -1
- package/dist/plugins/node/axios/axios.js +3 -2
- package/dist/plugins/node/fetch/fetch.d.ts +1 -1
- package/dist/plugins/node/fetch/fetch.d.ts.map +1 -1
- package/dist/plugins/node/fetch/fetch.js +3 -2
- package/dist/plugins/node/ofetch/ofetch.d.ts +1 -1
- package/dist/plugins/node/ofetch/ofetch.d.ts.map +1 -1
- package/dist/plugins/node/ofetch/ofetch.js +3 -2
- package/dist/plugins/node/undici/undici.d.ts +1 -1
- package/dist/plugins/node/undici/undici.d.ts.map +1 -1
- package/dist/plugins/node/undici/undici.js +3 -2
- package/dist/plugins/objc/nsurlsession/nsurlsession.d.ts +1 -1
- package/dist/plugins/objc/nsurlsession/nsurlsession.d.ts.map +1 -1
- package/dist/plugins/objc/nsurlsession/nsurlsession.js +3 -2
- package/dist/plugins/ocaml/cohttp/cohttp.d.ts +1 -1
- package/dist/plugins/ocaml/cohttp/cohttp.d.ts.map +1 -1
- package/dist/plugins/ocaml/cohttp/cohttp.js +3 -2
- package/dist/plugins/php/curl/curl.d.ts +1 -1
- package/dist/plugins/php/curl/curl.d.ts.map +1 -1
- package/dist/plugins/php/curl/curl.js +3 -2
- package/dist/plugins/php/guzzle/guzzle.d.ts +1 -1
- package/dist/plugins/php/guzzle/guzzle.d.ts.map +1 -1
- package/dist/plugins/php/guzzle/guzzle.js +3 -2
- package/dist/plugins/powershell/restmethod/restmethod.d.ts +1 -1
- package/dist/plugins/powershell/restmethod/restmethod.d.ts.map +1 -1
- package/dist/plugins/powershell/restmethod/restmethod.js +3 -2
- package/dist/plugins/powershell/webrequest/webrequest.d.ts +1 -1
- package/dist/plugins/powershell/webrequest/webrequest.d.ts.map +1 -1
- package/dist/plugins/powershell/webrequest/webrequest.js +3 -2
- package/dist/plugins/python/python3/python3.d.ts +1 -1
- package/dist/plugins/python/python3/python3.d.ts.map +1 -1
- package/dist/plugins/python/python3/python3.js +3 -2
- package/dist/plugins/python/requests/requests.d.ts +1 -1
- package/dist/plugins/python/requests/requests.d.ts.map +1 -1
- package/dist/plugins/python/requests/requests.js +3 -2
- package/dist/plugins/r/httr/httr.d.ts +1 -1
- package/dist/plugins/r/httr/httr.d.ts.map +1 -1
- package/dist/plugins/r/httr/httr.js +3 -2
- package/dist/plugins/ruby/native/native.d.ts +1 -1
- package/dist/plugins/ruby/native/native.d.ts.map +1 -1
- package/dist/plugins/ruby/native/native.js +3 -2
- package/dist/plugins/shell/curl/curl.d.ts +1 -1
- package/dist/plugins/shell/curl/curl.d.ts.map +1 -1
- package/dist/plugins/shell/curl/curl.js +1 -0
- package/dist/plugins/shell/httpie/httpie.d.ts +1 -1
- package/dist/plugins/shell/httpie/httpie.d.ts.map +1 -1
- package/dist/plugins/shell/httpie/httpie.js +3 -2
- package/dist/plugins/shell/wget/wget.d.ts +1 -1
- package/dist/plugins/shell/wget/wget.d.ts.map +1 -1
- package/dist/plugins/shell/wget/wget.js +3 -2
- package/dist/plugins/swift/nsurlsession/nsurlsession.d.ts +1 -1
- package/dist/plugins/swift/nsurlsession/nsurlsession.d.ts.map +1 -1
- package/dist/plugins/swift/nsurlsession/nsurlsession.js +3 -2
- package/dist/snippetz.d.ts +6 -8
- package/dist/snippetz.d.ts.map +1 -1
- package/dist/snippetz.js +10 -91
- package/dist/{core/types.d.ts → types/index.d.ts} +17 -5
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.test-d.d.ts +2 -0
- package/dist/types/index.test-d.d.ts.map +1 -0
- package/dist/utils/arrayToObject.d.ts.map +1 -0
- package/dist/utils/convertWithHttpSnippetLite.d.ts +6 -0
- package/dist/utils/convertWithHttpSnippetLite.d.ts.map +1 -0
- package/dist/utils/convertWithHttpSnippetLite.js +95 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/needsQuotes.d.ts.map +1 -0
- package/dist/utils/objectToString.d.ts.map +1 -0
- package/package.json +17 -7
- package/dist/core/index.d.ts +0 -5
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -3
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.test-d.d.ts +0 -2
- package/dist/core/types.test-d.d.ts.map +0 -1
- package/dist/core/utils/arrayToObject.d.ts.map +0 -1
- package/dist/core/utils/convertWithHttpSnippetLite.d.ts +0 -7
- package/dist/core/utils/convertWithHttpSnippetLite.d.ts.map +0 -1
- package/dist/core/utils/convertWithHttpSnippetLite.js +0 -83
- package/dist/core/utils/needsQuotes.d.ts.map +0 -1
- package/dist/core/utils/objectToString.d.ts.map +0 -1
- /package/dist/{core/utils → utils}/arrayToObject.d.ts +0 -0
- /package/dist/{core/utils → utils}/arrayToObject.js +0 -0
- /package/dist/{core/utils → utils}/needsQuotes.d.ts +0 -0
- /package/dist/{core/utils → utils}/needsQuotes.js +0 -0
- /package/dist/{core/utils → utils}/objectToString.d.ts +0 -0
- /package/dist/{core/utils → utils}/objectToString.js +0 -0
|
@@ -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, method, fullUrl }: {
|
|
9
|
+
allHeaders: any;
|
|
10
|
+
postData: any;
|
|
11
|
+
method: 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/objc/nsurlsession/client.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAwKxB,CAAA"}
|
package/dist/{_virtual/client13.js → httpsnippet-lite/esm/targets/objc/nsurlsession/client.js}
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { CodeBuilder } from '
|
|
2
|
-
import { nsDeclaration } from '../
|
|
1
|
+
import { CodeBuilder } from '../../../helpers/code-builder.js';
|
|
2
|
+
import { nsDeclaration } 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 Objective-C using NSURLSession.
|
|
@@ -18,7 +20,7 @@ const nsurlsession = {
|
|
|
18
20
|
description: "Foundation's NSURLSession request",
|
|
19
21
|
},
|
|
20
22
|
convert: ({ allHeaders, postData, method, fullUrl }, options) => {
|
|
21
|
-
|
|
23
|
+
let _a;
|
|
22
24
|
const opts = {
|
|
23
25
|
indent: ' ',
|
|
24
26
|
pretty: true,
|
|
@@ -42,7 +44,9 @@ const nsurlsession = {
|
|
|
42
44
|
req.hasBody = true;
|
|
43
45
|
switch (postData.mimeType) {
|
|
44
46
|
case 'application/x-www-form-urlencoded':
|
|
45
|
-
if ((_a = postData.params) === null || _a === void 0
|
|
47
|
+
if ((_a = postData.params) === null || _a === void 0
|
|
48
|
+
? void 0
|
|
49
|
+
: _a.length) {
|
|
46
50
|
// By appending parameters one by one in the resulting snippet,
|
|
47
51
|
// we make it easier for the user to edit it according to his or her needs after pasting.
|
|
48
52
|
// The user can just add/remove lines adding/removing body parameters.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const objc: {
|
|
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, method, fullUrl }: {
|
|
17
|
+
allHeaders: any;
|
|
18
|
+
postData: any;
|
|
19
|
+
method: any;
|
|
20
|
+
fullUrl: 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/objc/target.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;CAUhB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const cohttp: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ fullUrl, allHeaders, postData, method }: {
|
|
9
|
+
fullUrl: any;
|
|
10
|
+
allHeaders: any;
|
|
11
|
+
postData: 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/ocaml/cohttp/client.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAyDlB,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { CodeBuilder } from '
|
|
2
|
-
import { escapeForDoubleQuotes } from '
|
|
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 OCaml using CoHTTP.
|
|
@@ -36,7 +38,7 @@ const cohttp = {
|
|
|
36
38
|
}
|
|
37
39
|
else if (headers.length > 1) {
|
|
38
40
|
push('let headers = Header.add_list (Header.init ()) [');
|
|
39
|
-
headers.forEach(key => {
|
|
41
|
+
headers.forEach((key) => {
|
|
40
42
|
push(`("${key}", "${escapeForDoubleQuotes(allHeaders[key])}");`, 1);
|
|
41
43
|
});
|
|
42
44
|
push('] in');
|
|
@@ -49,7 +51,9 @@ const cohttp = {
|
|
|
49
51
|
// Do the request
|
|
50
52
|
blank();
|
|
51
53
|
const h = headers.length ? '~headers ' : '';
|
|
52
|
-
const b = (postData === null || postData === void 0 ? void 0 : postData.text)
|
|
54
|
+
const b = (postData === null || postData === void 0 ? void 0 : postData.text)
|
|
55
|
+
? '~body '
|
|
56
|
+
: '';
|
|
53
57
|
const m = methods.includes(method.toLowerCase())
|
|
54
58
|
? `\`${method.toUpperCase()}`
|
|
55
59
|
: `(Code.method_of_string "${method}")`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const ocaml: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
extname: string;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
clientsById: {
|
|
9
|
+
cohttp: {
|
|
10
|
+
info: {
|
|
11
|
+
key: string;
|
|
12
|
+
title: string;
|
|
13
|
+
link: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
convert: ({ fullUrl, allHeaders, postData, method }: {
|
|
17
|
+
fullUrl: any;
|
|
18
|
+
allHeaders: any;
|
|
19
|
+
postData: 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/ocaml/target.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;CAUjB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const curl: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ uriObj, postData, fullUrl, method, httpVersion, cookies, headersObj }: {
|
|
9
|
+
uriObj: any;
|
|
10
|
+
postData: any;
|
|
11
|
+
fullUrl: any;
|
|
12
|
+
method: any;
|
|
13
|
+
httpVersion: any;
|
|
14
|
+
cookies: any;
|
|
15
|
+
headersObj: any;
|
|
16
|
+
}, options?: {}) => any;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/php/curl/client.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;CAkIhB,CAAA"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { CodeBuilder } from '
|
|
2
|
-
import { escapeForDoubleQuotes } from '
|
|
3
|
-
import { convertType } from '../
|
|
1
|
+
import { CodeBuilder } from '../../../helpers/code-builder.js';
|
|
2
|
+
import { escapeForDoubleQuotes } from '../../../helpers/escape.js';
|
|
3
|
+
import { convertType } from '../helpers.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 PHP using curl-ext.
|
|
@@ -61,7 +63,9 @@ const curl = {
|
|
|
61
63
|
{
|
|
62
64
|
escape: false,
|
|
63
65
|
name: 'CURLOPT_HTTP_VERSION',
|
|
64
|
-
value: httpVersion === 'HTTP/1.0'
|
|
66
|
+
value: httpVersion === 'HTTP/1.0'
|
|
67
|
+
? 'CURL_HTTP_VERSION_1_0'
|
|
68
|
+
: 'CURL_HTTP_VERSION_1_1',
|
|
65
69
|
},
|
|
66
70
|
{
|
|
67
71
|
escape: true,
|
|
@@ -69,7 +73,9 @@ const curl = {
|
|
|
69
73
|
value: method,
|
|
70
74
|
},
|
|
71
75
|
{
|
|
72
|
-
escape: !(postData === null || postData === void 0
|
|
76
|
+
escape: !(postData === null || postData === void 0
|
|
77
|
+
? void 0
|
|
78
|
+
: postData.jsonObj),
|
|
73
79
|
name: 'CURLOPT_POSTFIELDS',
|
|
74
80
|
value: postData
|
|
75
81
|
? postData.jsonObj
|
|
@@ -86,14 +92,14 @@ const curl = {
|
|
|
86
92
|
}
|
|
87
93
|
});
|
|
88
94
|
// construct cookies
|
|
89
|
-
const curlCookies = cookies.map(cookie => `${encodeURIComponent(cookie.name)}=${encodeURIComponent(cookie.value)}`);
|
|
95
|
+
const curlCookies = cookies.map((cookie) => `${encodeURIComponent(cookie.name)}=${encodeURIComponent(cookie.value)}`);
|
|
90
96
|
if (curlCookies.length) {
|
|
91
97
|
curlopts.push(`CURLOPT_COOKIE => "${curlCookies.join('; ')}",`);
|
|
92
98
|
}
|
|
93
99
|
// construct cookies
|
|
94
100
|
const headers = Object.keys(headersObj)
|
|
95
101
|
.sort()
|
|
96
|
-
.map(key => `"${key}: ${escapeForDoubleQuotes(headersObj[key])}"`);
|
|
102
|
+
.map((key) => `"${key}: ${escapeForDoubleQuotes(headersObj[key])}"`);
|
|
97
103
|
if (headers.length) {
|
|
98
104
|
curlopts.push('CURLOPT_HTTPHEADER => [');
|
|
99
105
|
curlopts.push(headers.join(`,\n${indent}${indent}`), 1);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const guzzle: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ postData, fullUrl, method, cookies, headersObj }: {
|
|
9
|
+
postData: any;
|
|
10
|
+
fullUrl: any;
|
|
11
|
+
method: any;
|
|
12
|
+
cookies: any;
|
|
13
|
+
headersObj: 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/php/guzzle/client.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;CA4HlB,CAAA"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { CodeBuilder } from '
|
|
2
|
-
import { escapeForSingleQuotes } from '
|
|
3
|
-
import { hasHeader, getHeader, getHeaderName } from '
|
|
4
|
-
import { convertType } from '../
|
|
1
|
+
import { CodeBuilder } from '../../../helpers/code-builder.js';
|
|
2
|
+
import { escapeForSingleQuotes } from '../../../helpers/escape.js';
|
|
3
|
+
import { hasHeader, getHeader, getHeaderName } from '../../../helpers/headers.js';
|
|
4
|
+
import { convertType } 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 PHP using Guzzle.
|
|
@@ -20,7 +22,7 @@ const guzzle = {
|
|
|
20
22
|
description: 'PHP with Guzzle',
|
|
21
23
|
},
|
|
22
24
|
convert: ({ postData, fullUrl, method, cookies, headersObj }, options) => {
|
|
23
|
-
|
|
25
|
+
let _a;
|
|
24
26
|
const opts = {
|
|
25
27
|
closingTag: false,
|
|
26
28
|
indent: ' ',
|
|
@@ -65,7 +67,10 @@ const guzzle = {
|
|
|
65
67
|
requestPush(`'multipart' => ${convertType(fields, opts.indent + opts.indent, opts.indent)}`, 1);
|
|
66
68
|
// Guzzle adds its own boundary for multipart requests.
|
|
67
69
|
if (hasHeader(headersObj, 'content-type')) {
|
|
68
|
-
if ((_a = getHeader(headersObj, 'content-type')) === null ||
|
|
70
|
+
if ((_a = getHeader(headersObj, 'content-type')) === null ||
|
|
71
|
+
_a === void 0
|
|
72
|
+
? void 0
|
|
73
|
+
: _a.indexOf('boundary')) {
|
|
69
74
|
const headerName = getHeaderName(headersObj, 'content-type');
|
|
70
75
|
if (headerName) {
|
|
71
76
|
delete headersObj[headerName];
|
|
@@ -88,7 +93,7 @@ const guzzle = {
|
|
|
88
93
|
});
|
|
89
94
|
// construct cookies
|
|
90
95
|
const cookieString = cookies
|
|
91
|
-
.map(cookie => `${encodeURIComponent(cookie.name)}=${encodeURIComponent(cookie.value)}`)
|
|
96
|
+
.map((cookie) => `${encodeURIComponent(cookie.name)}=${encodeURIComponent(cookie.value)}`)
|
|
92
97
|
.join('; ');
|
|
93
98
|
if (cookieString.length) {
|
|
94
99
|
headers.push(`${opts.indent}${opts.indent}'cookie' => '${escapeForSingleQuotes(cookieString)}',`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/php/helpers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,iDAgCvB,CAAA;AACD,eAAO,MAAM,gBAAgB,UA4B5B,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const http1: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ method, url, postData, queryObj, headersObj, cookiesObj }: {
|
|
9
|
+
method: any;
|
|
10
|
+
url: any;
|
|
11
|
+
postData: any;
|
|
12
|
+
queryObj: any;
|
|
13
|
+
headersObj: any;
|
|
14
|
+
cookiesObj: 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/php/http1/client.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;CAmFjB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const http2: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ postData, headersObj, method, queryObj, cookiesObj, url }: {
|
|
9
|
+
postData: any;
|
|
10
|
+
headersObj: any;
|
|
11
|
+
method: any;
|
|
12
|
+
queryObj: any;
|
|
13
|
+
cookiesObj: any;
|
|
14
|
+
url: 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/php/http2/client.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;CAgIjB,CAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export declare const php: {
|
|
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: ({ uriObj, postData, fullUrl, method, httpVersion, cookies, headersObj }: {
|
|
17
|
+
uriObj: any;
|
|
18
|
+
postData: any;
|
|
19
|
+
fullUrl: any;
|
|
20
|
+
method: any;
|
|
21
|
+
httpVersion: any;
|
|
22
|
+
cookies: any;
|
|
23
|
+
headersObj: any;
|
|
24
|
+
}, options?: {}) => any;
|
|
25
|
+
};
|
|
26
|
+
guzzle: {
|
|
27
|
+
info: {
|
|
28
|
+
key: string;
|
|
29
|
+
title: string;
|
|
30
|
+
link: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
convert: ({ postData, fullUrl, method, cookies, headersObj }: {
|
|
34
|
+
postData: any;
|
|
35
|
+
fullUrl: any;
|
|
36
|
+
method: any;
|
|
37
|
+
cookies: any;
|
|
38
|
+
headersObj: any;
|
|
39
|
+
}, options: any) => any;
|
|
40
|
+
};
|
|
41
|
+
http1: {
|
|
42
|
+
info: {
|
|
43
|
+
key: string;
|
|
44
|
+
title: string;
|
|
45
|
+
link: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
convert: ({ method, url, postData, queryObj, headersObj, cookiesObj }: {
|
|
49
|
+
method: any;
|
|
50
|
+
url: any;
|
|
51
|
+
postData: any;
|
|
52
|
+
queryObj: any;
|
|
53
|
+
headersObj: any;
|
|
54
|
+
cookiesObj: any;
|
|
55
|
+
}, options?: {}) => any;
|
|
56
|
+
};
|
|
57
|
+
http2: {
|
|
58
|
+
info: {
|
|
59
|
+
key: string;
|
|
60
|
+
title: string;
|
|
61
|
+
link: string;
|
|
62
|
+
description: string;
|
|
63
|
+
};
|
|
64
|
+
convert: ({ postData, headersObj, method, queryObj, cookiesObj, url }: {
|
|
65
|
+
postData: any;
|
|
66
|
+
headersObj: any;
|
|
67
|
+
method: any;
|
|
68
|
+
queryObj: any;
|
|
69
|
+
cookiesObj: any;
|
|
70
|
+
url: any;
|
|
71
|
+
}, options?: {}) => any;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/php/target.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAaf,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const generatePowershellConvert: (command: any) => ({ method, headersObj, cookies, uriObj, fullUrl, postData, allHeaders, }: {
|
|
2
|
+
method: any;
|
|
3
|
+
headersObj: any;
|
|
4
|
+
cookies: any;
|
|
5
|
+
uriObj: any;
|
|
6
|
+
fullUrl: any;
|
|
7
|
+
postData: any;
|
|
8
|
+
allHeaders: any;
|
|
9
|
+
}) => any;
|
|
10
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/powershell/common.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,yBAAyB;;;;;;;;SA4DrC,CAAA"}
|
|
@@ -2,6 +2,8 @@ import { CodeBuilder } from '../../helpers/code-builder.js';
|
|
|
2
2
|
import { escapeString } from '../../helpers/escape.js';
|
|
3
3
|
import { getHeader } from '../../helpers/headers.js';
|
|
4
4
|
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
+
// @ts-nocheck
|
|
5
7
|
const generatePowershellConvert = (command) => {
|
|
6
8
|
const convert = ({ method, headersObj, cookies, uriObj, fullUrl, postData, allHeaders, }) => {
|
|
7
9
|
const { push, join } = new CodeBuilder();
|
|
@@ -15,7 +17,7 @@ const generatePowershellConvert = (command) => {
|
|
|
15
17
|
// construct headers
|
|
16
18
|
if (headers.length) {
|
|
17
19
|
push('$headers=@{}');
|
|
18
|
-
headers.forEach(key => {
|
|
20
|
+
headers.forEach((key) => {
|
|
19
21
|
if (key !== 'connection') {
|
|
20
22
|
// Not allowed
|
|
21
23
|
push(`$headers.Add("${key}", "${escapeString(headersObj[key], { escapeChar: '`' })}")`);
|
|
@@ -26,7 +28,7 @@ const generatePowershellConvert = (command) => {
|
|
|
26
28
|
// construct cookies
|
|
27
29
|
if (cookies.length) {
|
|
28
30
|
push('$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession');
|
|
29
|
-
cookies.forEach(cookie => {
|
|
31
|
+
cookies.forEach((cookie) => {
|
|
30
32
|
push('$cookie = New-Object System.Net.Cookie');
|
|
31
33
|
push(`$cookie.Name = '${cookie.name}'`);
|
|
32
34
|
push(`$cookie.Value = '${cookie.value}'`);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const restmethod: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ method, headersObj, cookies, uriObj, fullUrl, postData, allHeaders, }: {
|
|
9
|
+
method: any;
|
|
10
|
+
headersObj: any;
|
|
11
|
+
cookies: any;
|
|
12
|
+
uriObj: any;
|
|
13
|
+
fullUrl: any;
|
|
14
|
+
postData: any;
|
|
15
|
+
allHeaders: any;
|
|
16
|
+
}) => any;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/powershell/restmethod/client.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;CAQtB,CAAA"}
|
package/dist/{_virtual/client9.js → httpsnippet-lite/esm/targets/powershell/restmethod/client.js}
RENAMED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { generatePowershellConvert } from '../
|
|
1
|
+
import { generatePowershellConvert } from '../common.js';
|
|
2
2
|
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
|
+
// @ts-nocheck
|
|
3
5
|
const restmethod = {
|
|
4
6
|
info: {
|
|
5
7
|
key: 'restmethod',
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const powershell: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
extname: string;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
clientsById: {
|
|
9
|
+
webrequest: {
|
|
10
|
+
info: {
|
|
11
|
+
key: string;
|
|
12
|
+
title: string;
|
|
13
|
+
link: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
convert: ({ method, headersObj, cookies, uriObj, fullUrl, postData, allHeaders, }: {
|
|
17
|
+
method: any;
|
|
18
|
+
headersObj: any;
|
|
19
|
+
cookies: any;
|
|
20
|
+
uriObj: any;
|
|
21
|
+
fullUrl: any;
|
|
22
|
+
postData: any;
|
|
23
|
+
allHeaders: any;
|
|
24
|
+
}) => any;
|
|
25
|
+
};
|
|
26
|
+
restmethod: {
|
|
27
|
+
info: {
|
|
28
|
+
key: string;
|
|
29
|
+
title: string;
|
|
30
|
+
link: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
convert: ({ method, headersObj, cookies, uriObj, fullUrl, postData, allHeaders, }: {
|
|
34
|
+
method: any;
|
|
35
|
+
headersObj: any;
|
|
36
|
+
cookies: any;
|
|
37
|
+
uriObj: any;
|
|
38
|
+
fullUrl: any;
|
|
39
|
+
postData: any;
|
|
40
|
+
allHeaders: any;
|
|
41
|
+
}) => any;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/powershell/target.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWtB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const webrequest: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ method, headersObj, cookies, uriObj, fullUrl, postData, allHeaders, }: {
|
|
9
|
+
method: any;
|
|
10
|
+
headersObj: any;
|
|
11
|
+
cookies: any;
|
|
12
|
+
uriObj: any;
|
|
13
|
+
fullUrl: any;
|
|
14
|
+
postData: any;
|
|
15
|
+
allHeaders: any;
|
|
16
|
+
}) => any;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/powershell/webrequest/client.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;CAQtB,CAAA"}
|
package/dist/{_virtual/client8.js → httpsnippet-lite/esm/targets/powershell/webrequest/client.js}
RENAMED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { generatePowershellConvert } from '../
|
|
1
|
+
import { generatePowershellConvert } from '../common.js';
|
|
2
2
|
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
|
+
// @ts-nocheck
|
|
3
5
|
const webrequest = {
|
|
4
6
|
info: {
|
|
5
7
|
key: 'webrequest',
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a valid Python string of a literal value according to its type.
|
|
3
|
+
*
|
|
4
|
+
* @param {*} value Any JavaScript literal
|
|
5
|
+
* @param {object} opts Target options
|
|
6
|
+
* @return {string}
|
|
7
|
+
*/
|
|
8
|
+
export declare const literalRepresentation: (value: any, opts: any, indentLevel: any) => any;
|
|
9
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/python/helpers.ts"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,kDA+CjC,CAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
+
// @ts-nocheck
|
|
1
3
|
/**
|
|
2
4
|
* Create a string corresponding to a Dictionary or Array literal representation with pretty option
|
|
3
5
|
* and indentation.
|
|
@@ -20,7 +22,7 @@ function concatValues(concatType, values, pretty, indentation, indentLevel) {
|
|
|
20
22
|
* Create a valid Python string of a literal value according to its type.
|
|
21
23
|
*
|
|
22
24
|
* @param {*} value Any JavaScript literal
|
|
23
|
-
* @param {
|
|
25
|
+
* @param {object} opts Target options
|
|
24
26
|
* @return {string}
|
|
25
27
|
*/
|
|
26
28
|
const literalRepresentation = (value, opts, indentLevel) => {
|
|
@@ -30,7 +32,7 @@ const literalRepresentation = (value, opts, indentLevel) => {
|
|
|
30
32
|
return value;
|
|
31
33
|
case '[object Array]': {
|
|
32
34
|
let pretty = false;
|
|
33
|
-
const valuesRepresentation = value.map(v => {
|
|
35
|
+
const valuesRepresentation = value.map((v) => {
|
|
34
36
|
// Switch to prettify if the value is a dictionary with multiple keys
|
|
35
37
|
if (Object.prototype.toString.call(v) === '[object Object]') {
|
|
36
38
|
pretty = Object.keys(v).length > 1;
|