@scalar/snippetz 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clients.d.ts +6 -0
- package/dist/clients.d.ts.map +1 -0
- package/dist/clients.js +150 -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/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 +4 -6
- package/dist/snippetz.d.ts.map +1 -1
- package/dist/snippetz.js +10 -91
- package/dist/{core/types.d.ts → types/index.d.ts} +15 -4
- 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 +11 -6
- 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,16 @@
|
|
|
1
|
+
export declare const axios: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ allHeaders, method, url, queryObj, postData }: {
|
|
9
|
+
allHeaders: any;
|
|
10
|
+
method: any;
|
|
11
|
+
url: any;
|
|
12
|
+
queryObj: any;
|
|
13
|
+
postData: 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/javascript/axios/client.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;CAgFjB,CAAA"}
|
package/dist/{_virtual/client18.js → httpsnippet-lite/esm/targets/javascript/axios/client.js}
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import stringifyObject from 'stringify-object';
|
|
2
|
-
import { CodeBuilder } from '
|
|
2
|
+
import { CodeBuilder } from '../../../helpers/code-builder.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 Javascript & Node.js using Axios.
|
|
@@ -22,7 +24,9 @@ const axios = {
|
|
|
22
24
|
indent: ' ',
|
|
23
25
|
...options,
|
|
24
26
|
};
|
|
25
|
-
const { blank, push, join, addPostProcessor } = new CodeBuilder({
|
|
27
|
+
const { blank, push, join, addPostProcessor } = new CodeBuilder({
|
|
28
|
+
indent: opts.indent,
|
|
29
|
+
});
|
|
26
30
|
push("import axios from 'axios';");
|
|
27
31
|
blank();
|
|
28
32
|
const requestOptions = {
|
|
@@ -39,12 +43,12 @@ const axios = {
|
|
|
39
43
|
case 'application/x-www-form-urlencoded':
|
|
40
44
|
if (postData.params) {
|
|
41
45
|
push('const encodedParams = new URLSearchParams();');
|
|
42
|
-
postData.params.forEach(param => {
|
|
46
|
+
postData.params.forEach((param) => {
|
|
43
47
|
push(`encodedParams.set('${param.name}', '${param.value}');`);
|
|
44
48
|
});
|
|
45
49
|
blank();
|
|
46
50
|
requestOptions.data = 'encodedParams,';
|
|
47
|
-
addPostProcessor(code => code.replace(/'encodedParams,'/, 'encodedParams,'));
|
|
51
|
+
addPostProcessor((code) => code.replace(/'encodedParams,'/, 'encodedParams,'));
|
|
48
52
|
}
|
|
49
53
|
break;
|
|
50
54
|
case 'application/json':
|
|
@@ -57,7 +61,7 @@ const axios = {
|
|
|
57
61
|
break;
|
|
58
62
|
}
|
|
59
63
|
push('const form = new FormData();');
|
|
60
|
-
postData.params.forEach(param => {
|
|
64
|
+
postData.params.forEach((param) => {
|
|
61
65
|
push(`form.append('${param.name}', '${param.value || param.fileName || ''}');`);
|
|
62
66
|
});
|
|
63
67
|
blank();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const fetch: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ method, allHeaders, postData, fullUrl }: {
|
|
9
|
+
method: any;
|
|
10
|
+
allHeaders: any;
|
|
11
|
+
postData: any;
|
|
12
|
+
fullUrl: any;
|
|
13
|
+
}, inputOpts: 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/javascript/fetch/client.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,KAAK;;;;;;;;;;;;;CA6FjB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const jquery: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ fullUrl, method, allHeaders, postData }: {
|
|
9
|
+
fullUrl: any;
|
|
10
|
+
method: any;
|
|
11
|
+
allHeaders: any;
|
|
12
|
+
postData: 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/javascript/jquery/client.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;CA4ElB,CAAA"}
|
package/dist/{_virtual/client17.js → httpsnippet-lite/esm/targets/javascript/jquery/client.js}
RENAMED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import stringifyObject from 'stringify-object';
|
|
2
|
-
import { CodeBuilder } from '
|
|
3
|
-
import { hasHeader, getHeader, getHeaderName } from '
|
|
2
|
+
import { CodeBuilder } from '../../../helpers/code-builder.js';
|
|
3
|
+
import { hasHeader, getHeader, getHeaderName } from '../../../helpers/headers.js';
|
|
4
4
|
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
+
// @ts-nocheck
|
|
5
7
|
/**
|
|
6
8
|
* @description
|
|
7
9
|
* HTTP code snippet generator for native XMLHttpRequest
|
|
@@ -19,7 +21,7 @@ const jquery = {
|
|
|
19
21
|
description: 'Perform an asynchronous HTTP (Ajax) requests with jQuery',
|
|
20
22
|
},
|
|
21
23
|
convert: ({ fullUrl, method, allHeaders, postData }, options) => {
|
|
22
|
-
|
|
24
|
+
let _a;
|
|
23
25
|
const opts = {
|
|
24
26
|
indent: ' ',
|
|
25
27
|
...options,
|
|
@@ -45,7 +47,7 @@ const jquery = {
|
|
|
45
47
|
break;
|
|
46
48
|
}
|
|
47
49
|
push('const form = new FormData();');
|
|
48
|
-
postData.params.forEach(param => {
|
|
50
|
+
postData.params.forEach((param) => {
|
|
49
51
|
push(`form.append('${param.name}', '${param.value || param.fileName || ''}');`);
|
|
50
52
|
});
|
|
51
53
|
settings.processData = false;
|
|
@@ -54,7 +56,10 @@ const jquery = {
|
|
|
54
56
|
settings.data = '[form]';
|
|
55
57
|
// remove the contentType header
|
|
56
58
|
if (hasHeader(allHeaders, 'content-type')) {
|
|
57
|
-
if ((_a = getHeader(allHeaders, 'content-type')) === null ||
|
|
59
|
+
if ((_a = getHeader(allHeaders, 'content-type')) === null ||
|
|
60
|
+
_a === void 0
|
|
61
|
+
? void 0
|
|
62
|
+
: _a.includes('boundary')) {
|
|
58
63
|
const headerName = getHeaderName(allHeaders, 'content-type');
|
|
59
64
|
if (headerName) {
|
|
60
65
|
delete settings.headers[headerName];
|
|
@@ -68,7 +73,9 @@ const jquery = {
|
|
|
68
73
|
settings.data = postData.text;
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
|
-
const stringifiedSettings = stringifyObject(settings, {
|
|
76
|
+
const stringifiedSettings = stringifyObject(settings, {
|
|
77
|
+
indent: opts.indent,
|
|
78
|
+
}).replace("'[form]'", 'form');
|
|
72
79
|
push(`const settings = ${stringifiedSettings};`);
|
|
73
80
|
blank();
|
|
74
81
|
push('$.ajax(settings).done(function (response) {');
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare const javascript: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
extname: string;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
clientsById: {
|
|
9
|
+
xhr: {
|
|
10
|
+
info: {
|
|
11
|
+
key: string;
|
|
12
|
+
title: string;
|
|
13
|
+
link: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
convert: ({ postData, allHeaders, method, fullUrl }: {
|
|
17
|
+
postData: any;
|
|
18
|
+
allHeaders: any;
|
|
19
|
+
method: any;
|
|
20
|
+
fullUrl: any;
|
|
21
|
+
}, options: any) => any;
|
|
22
|
+
};
|
|
23
|
+
axios: {
|
|
24
|
+
info: {
|
|
25
|
+
key: string;
|
|
26
|
+
title: string;
|
|
27
|
+
link: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
convert: ({ allHeaders, method, url, queryObj, postData }: {
|
|
31
|
+
allHeaders: any;
|
|
32
|
+
method: any;
|
|
33
|
+
url: any;
|
|
34
|
+
queryObj: any;
|
|
35
|
+
postData: any;
|
|
36
|
+
}, options: any) => any;
|
|
37
|
+
};
|
|
38
|
+
fetch: {
|
|
39
|
+
info: {
|
|
40
|
+
key: string;
|
|
41
|
+
title: string;
|
|
42
|
+
link: string;
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
convert: ({ method, allHeaders, postData, fullUrl }: {
|
|
46
|
+
method: any;
|
|
47
|
+
allHeaders: any;
|
|
48
|
+
postData: any;
|
|
49
|
+
fullUrl: any;
|
|
50
|
+
}, inputOpts: any) => any;
|
|
51
|
+
};
|
|
52
|
+
jquery: {
|
|
53
|
+
info: {
|
|
54
|
+
key: string;
|
|
55
|
+
title: string;
|
|
56
|
+
link: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
convert: ({ fullUrl, method, allHeaders, postData }: {
|
|
60
|
+
fullUrl: any;
|
|
61
|
+
method: any;
|
|
62
|
+
allHeaders: any;
|
|
63
|
+
postData: any;
|
|
64
|
+
}, options: any) => any;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/javascript/target.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAatB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const xhr: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ postData, allHeaders, method, fullUrl }: {
|
|
9
|
+
postData: any;
|
|
10
|
+
allHeaders: 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/javascript/xhr/client.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,GAAG;;;;;;;;;;;;;CA+Ef,CAAA"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import stringifyObject from 'stringify-object';
|
|
2
|
-
import { CodeBuilder } from '
|
|
3
|
-
import { escapeForSingleQuotes } from '
|
|
4
|
-
import { hasHeader, getHeader, getHeaderName } from '
|
|
2
|
+
import { CodeBuilder } from '../../../helpers/code-builder.js';
|
|
3
|
+
import { escapeForSingleQuotes } from '../../../helpers/escape.js';
|
|
4
|
+
import { hasHeader, getHeader, getHeaderName } from '../../../helpers/headers.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 native XMLHttpRequest
|
|
@@ -20,7 +22,7 @@ const xhr = {
|
|
|
20
22
|
description: 'W3C Standard API that provides scripted client functionality',
|
|
21
23
|
},
|
|
22
24
|
convert: ({ postData, allHeaders, method, fullUrl }, options) => {
|
|
23
|
-
|
|
25
|
+
let _a;
|
|
24
26
|
const opts = {
|
|
25
27
|
indent: ' ',
|
|
26
28
|
cors: true,
|
|
@@ -39,12 +41,15 @@ const xhr = {
|
|
|
39
41
|
break;
|
|
40
42
|
}
|
|
41
43
|
push('const data = new FormData();');
|
|
42
|
-
postData.params.forEach(param => {
|
|
44
|
+
postData.params.forEach((param) => {
|
|
43
45
|
push(`data.append('${param.name}', '${param.value || param.fileName || ''}');`);
|
|
44
46
|
});
|
|
45
47
|
// remove the contentType header
|
|
46
48
|
if (hasHeader(allHeaders, 'content-type')) {
|
|
47
|
-
if ((_a = getHeader(allHeaders, 'content-type')) === null ||
|
|
49
|
+
if ((_a = getHeader(allHeaders, 'content-type')) === null ||
|
|
50
|
+
_a === void 0
|
|
51
|
+
? void 0
|
|
52
|
+
: _a.includes('boundary')) {
|
|
48
53
|
const headerName = getHeaderName(allHeaders, 'content-type');
|
|
49
54
|
if (headerName) {
|
|
50
55
|
delete allHeaders[headerName];
|
|
@@ -69,7 +74,7 @@ const xhr = {
|
|
|
69
74
|
push('});');
|
|
70
75
|
blank();
|
|
71
76
|
push(`xhr.open('${method}', '${fullUrl}');`);
|
|
72
|
-
Object.keys(allHeaders).forEach(key => {
|
|
77
|
+
Object.keys(allHeaders).forEach((key) => {
|
|
73
78
|
push(`xhr.setRequestHeader('${key}', '${escapeForSingleQuotes(allHeaders[key])}');`);
|
|
74
79
|
});
|
|
75
80
|
blank();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const okhttp: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ postData, fullUrl, method, allHeaders }: {
|
|
9
|
+
postData: any;
|
|
10
|
+
fullUrl: any;
|
|
11
|
+
method: any;
|
|
12
|
+
allHeaders: 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/kotlin/okhttp/client.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,MAAM;;;;;;;;;;;;;CA0DlB,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 Kotlin using OkHttp.
|
|
@@ -58,7 +60,7 @@ const okhttp = {
|
|
|
58
60
|
push(`.${method.toLowerCase()}()`, 1);
|
|
59
61
|
}
|
|
60
62
|
// Add headers, including the cookies
|
|
61
|
-
Object.keys(allHeaders).forEach(key => {
|
|
63
|
+
Object.keys(allHeaders).forEach((key) => {
|
|
62
64
|
push(`.addHeader("${key}", "${escapeForDoubleQuotes(allHeaders[key])}")`, 1);
|
|
63
65
|
});
|
|
64
66
|
push('.build()', 1);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const kotlin: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
extname: string;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
clientsById: {
|
|
9
|
+
okhttp: {
|
|
10
|
+
info: {
|
|
11
|
+
key: string;
|
|
12
|
+
title: string;
|
|
13
|
+
link: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
convert: ({ postData, fullUrl, method, allHeaders }: {
|
|
17
|
+
postData: any;
|
|
18
|
+
fullUrl: any;
|
|
19
|
+
method: any;
|
|
20
|
+
allHeaders: 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/kotlin/target.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;CAUlB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const axios: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ method, url, queryObj, allHeaders, postData }: {
|
|
9
|
+
method: any;
|
|
10
|
+
url: any;
|
|
11
|
+
queryObj: any;
|
|
12
|
+
allHeaders: any;
|
|
13
|
+
postData: 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/node/axios/client.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;CAsEjB,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import stringifyObject from 'stringify-object';
|
|
2
|
-
import { CodeBuilder } from '
|
|
2
|
+
import { CodeBuilder } from '../../../helpers/code-builder.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 Javascript & Node.js using Axios.
|
|
@@ -22,7 +24,9 @@ const axios = {
|
|
|
22
24
|
indent: ' ',
|
|
23
25
|
...options,
|
|
24
26
|
};
|
|
25
|
-
const { blank, join, push, addPostProcessor } = new CodeBuilder({
|
|
27
|
+
const { blank, join, push, addPostProcessor } = new CodeBuilder({
|
|
28
|
+
indent: opts.indent,
|
|
29
|
+
});
|
|
26
30
|
push("const axios = require('axios').default;");
|
|
27
31
|
const reqOpts = {
|
|
28
32
|
method,
|
|
@@ -40,12 +44,12 @@ const axios = {
|
|
|
40
44
|
push("const { URLSearchParams } = require('url');");
|
|
41
45
|
blank();
|
|
42
46
|
push('const encodedParams = new URLSearchParams();');
|
|
43
|
-
postData.params.forEach(param => {
|
|
47
|
+
postData.params.forEach((param) => {
|
|
44
48
|
push(`encodedParams.set('${param.name}', '${param.value}');`);
|
|
45
49
|
});
|
|
46
50
|
blank();
|
|
47
51
|
reqOpts.data = 'encodedParams,';
|
|
48
|
-
addPostProcessor(code => code.replace(/'encodedParams,'/, 'encodedParams,'));
|
|
52
|
+
addPostProcessor((code) => code.replace(/'encodedParams,'/, 'encodedParams,'));
|
|
49
53
|
}
|
|
50
54
|
break;
|
|
51
55
|
case 'application/json':
|
|
@@ -60,7 +64,10 @@ const axios = {
|
|
|
60
64
|
reqOpts.data = postData.text;
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
|
-
const stringifiedOptions = stringifyObject(reqOpts, {
|
|
67
|
+
const stringifiedOptions = stringifyObject(reqOpts, {
|
|
68
|
+
indent: ' ',
|
|
69
|
+
inlineCharacterLimit: 80,
|
|
70
|
+
});
|
|
64
71
|
push(`const options = ${stringifiedOptions};`);
|
|
65
72
|
blank();
|
|
66
73
|
push('try {');
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const fetch: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ method, fullUrl, postData, headersObj, cookies }: {
|
|
9
|
+
method: any;
|
|
10
|
+
fullUrl: any;
|
|
11
|
+
postData: any;
|
|
12
|
+
headersObj: any;
|
|
13
|
+
cookies: 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/node/fetch/client.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;CA4HjB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const native: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ uriObj, method, allHeaders, postData }: {
|
|
9
|
+
uriObj: any;
|
|
10
|
+
method: any;
|
|
11
|
+
allHeaders: any;
|
|
12
|
+
postData: any;
|
|
13
|
+
}, options?: {}) => 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/node/native/client.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAmElB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const request: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ method, url, queryObj, postData, headersObj, cookies }: {
|
|
9
|
+
method: any;
|
|
10
|
+
url: any;
|
|
11
|
+
queryObj: any;
|
|
12
|
+
postData: any;
|
|
13
|
+
headersObj: any;
|
|
14
|
+
cookies: any;
|
|
15
|
+
}, options: any) => any;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/node/request/client.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;CAqGnB,CAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export declare const node: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
extname: string;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
clientsById: {
|
|
9
|
+
native: {
|
|
10
|
+
info: {
|
|
11
|
+
key: string;
|
|
12
|
+
title: string;
|
|
13
|
+
link: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
convert: ({ uriObj, method, allHeaders, postData }: {
|
|
17
|
+
uriObj: any;
|
|
18
|
+
method: any;
|
|
19
|
+
allHeaders: any;
|
|
20
|
+
postData: any;
|
|
21
|
+
}, options?: {}) => any;
|
|
22
|
+
};
|
|
23
|
+
request: {
|
|
24
|
+
info: {
|
|
25
|
+
key: string;
|
|
26
|
+
title: string;
|
|
27
|
+
link: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
convert: ({ method, url, queryObj, postData, headersObj, cookies }: {
|
|
31
|
+
method: any;
|
|
32
|
+
url: any;
|
|
33
|
+
queryObj: any;
|
|
34
|
+
postData: any;
|
|
35
|
+
headersObj: any;
|
|
36
|
+
cookies: any;
|
|
37
|
+
}, options: any) => any;
|
|
38
|
+
};
|
|
39
|
+
unirest: {
|
|
40
|
+
info: {
|
|
41
|
+
key: string;
|
|
42
|
+
title: string;
|
|
43
|
+
link: string;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
convert: ({ method, url, cookies, queryObj, postData, headersObj }: {
|
|
47
|
+
method: any;
|
|
48
|
+
url: any;
|
|
49
|
+
cookies: any;
|
|
50
|
+
queryObj: any;
|
|
51
|
+
postData: any;
|
|
52
|
+
headersObj: any;
|
|
53
|
+
}, options: any) => any;
|
|
54
|
+
};
|
|
55
|
+
axios: {
|
|
56
|
+
info: {
|
|
57
|
+
key: string;
|
|
58
|
+
title: string;
|
|
59
|
+
link: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
convert: ({ method, url, queryObj, allHeaders, postData }: {
|
|
63
|
+
method: any;
|
|
64
|
+
url: any;
|
|
65
|
+
queryObj: any;
|
|
66
|
+
allHeaders: any;
|
|
67
|
+
postData: any;
|
|
68
|
+
}, options: any) => any;
|
|
69
|
+
};
|
|
70
|
+
fetch: {
|
|
71
|
+
info: {
|
|
72
|
+
key: string;
|
|
73
|
+
title: string;
|
|
74
|
+
link: string;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
convert: ({ method, fullUrl, postData, headersObj, cookies }: {
|
|
78
|
+
method: any;
|
|
79
|
+
fullUrl: any;
|
|
80
|
+
postData: any;
|
|
81
|
+
headersObj: any;
|
|
82
|
+
cookies: any;
|
|
83
|
+
}, options: any) => any;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/node/target.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAchB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const unirest: {
|
|
2
|
+
info: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
link: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
convert: ({ method, url, cookies, queryObj, postData, headersObj }: {
|
|
9
|
+
method: any;
|
|
10
|
+
url: any;
|
|
11
|
+
cookies: any;
|
|
12
|
+
queryObj: any;
|
|
13
|
+
postData: any;
|
|
14
|
+
headersObj: any;
|
|
15
|
+
}, options: any) => any;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/node/unirest/client.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;CAiHnB,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a string corresponding to a valid declaration and initialization of an Objective-C object literal.
|
|
3
|
+
*
|
|
4
|
+
* @param nsClass Class of the litteral
|
|
5
|
+
* @param name Desired name of the instance
|
|
6
|
+
* @param parameters Key-value object of parameters to translate to an Objective-C object litearal
|
|
7
|
+
* @param indent If true, will declare the litteral by indenting each new key/value pair.
|
|
8
|
+
* @return A valid Objective-C declaration and initialization of an Objective-C object litteral.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* nsDeclaration('NSDictionary', 'params', {a: 'b', c: 'd'}, true)
|
|
12
|
+
* // returns:
|
|
13
|
+
* NSDictionary *params = @{ @"a": @"b",
|
|
14
|
+
* @"c": @"d" };
|
|
15
|
+
*
|
|
16
|
+
* nsDeclaration('NSDictionary', 'params', {a: 'b', c: 'd'})
|
|
17
|
+
* // returns:
|
|
18
|
+
* NSDictionary *params = @{ @"a": @"b", @"c": @"d" };
|
|
19
|
+
*/
|
|
20
|
+
export declare const nsDeclaration: (nsClass: any, name: any, parameters: any, indent: any) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Create a valid Objective-C string of a literal value according to its type.
|
|
23
|
+
*
|
|
24
|
+
* @param value Any JavaScript literal
|
|
25
|
+
*/
|
|
26
|
+
export declare const literalRepresentation: (value: any, indentation: any) => any;
|
|
27
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/objc/helpers.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,mEAOzB,CAAA;AACD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,uCA2BjC,CAAA"}
|