@scalar/snippetz 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/esm/helpers/code-builder.js +62 -0
- 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/esm/helpers/escape.js +74 -0
- 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/esm/helpers/headers.js +22 -0
- 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/esm/helpers/shell.js +18 -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/httpsnippet-lite/esm/targets/c/libcurl/client.js +45 -0
- 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/httpsnippet-lite/esm/targets/clojure/clj_http/client.js +189 -0
- 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/httpsnippet-lite/esm/targets/csharp/httpclient/client.js +169 -0
- 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/httpsnippet-lite/esm/targets/csharp/restsharp/client.js +49 -0
- 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/httpsnippet-lite/esm/targets/go/native/client.js +124 -0
- 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/httpsnippet-lite/esm/targets/http/http1.1/client.js +77 -0
- 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/httpsnippet-lite/esm/targets/java/asynchttp/client.js +47 -0
- 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/httpsnippet-lite/esm/targets/java/nethttp/client.js +46 -0
- 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/httpsnippet-lite/esm/targets/java/okhttp/client.js +73 -0
- 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/httpsnippet-lite/esm/targets/java/unirest/client.js +47 -0
- 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/httpsnippet-lite/esm/targets/javascript/axios/client.js +91 -0
- 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/httpsnippet-lite/esm/targets/javascript/jquery/client.js +88 -0
- 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/httpsnippet-lite/esm/targets/javascript/xhr/client.js +86 -0
- 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/httpsnippet-lite/esm/targets/kotlin/okhttp/client.js +73 -0
- 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/httpsnippet-lite/esm/targets/node/axios/client.js +83 -0
- 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/esm/targets/objc/helpers.js +58 -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/httpsnippet-lite/esm/targets/objc/nsurlsession/client.js +132 -0
- 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/httpsnippet-lite/esm/targets/ocaml/cohttp/client.js +68 -0
- 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/httpsnippet-lite/esm/targets/php/curl/client.js +134 -0
- 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/httpsnippet-lite/esm/targets/php/guzzle/client.js +126 -0
- 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/esm/targets/php/helpers.js +37 -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/esm/targets/powershell/common.js +53 -0
- 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/httpsnippet-lite/esm/targets/powershell/restmethod/client.js +15 -0
- 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/httpsnippet-lite/esm/targets/powershell/webrequest/client.js +15 -0
- 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/esm/targets/python/helpers.js +63 -0
- 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/httpsnippet-lite/esm/targets/python/python3/client.js +95 -0
- 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/httpsnippet-lite/esm/targets/python/requests/client.js +177 -0
- 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/httpsnippet-lite/esm/targets/r/httr/client.js +127 -0
- 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/httpsnippet-lite/esm/targets/ruby/native/client.js +72 -0
- 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/httpsnippet-lite/esm/targets/shell/httpie/client.js +118 -0
- 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/httpsnippet-lite/esm/targets/shell/wget/client.js +54 -0
- 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/esm/targets/swift/helpers.js +76 -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/httpsnippet-lite/esm/targets/swift/nsurlsession/client.js +137 -0
- 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 -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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD,YAAY,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW;IACX,kBAAkB;IAClB,mBAAmB;IACnB,kBAAkB;IAClB,WAAW;IACX,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,aAAa;IACb,cAAc;IACd,UAAU;IACV,UAAU;IACV,WAAW;IACX,WAAW;IACX,QAAQ;IACR,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,aAAa;IACb,mBAAmB;IACnB,cAAc;IACd,UAAU;IACV,YAAY;IACZ,uBAAuB;IACvB,uBAAuB;IACvB,gBAAgB;IAChB,iBAAiB;IACjB,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,cAAc;IACd,YAAY;IACZ,oBAAoB;CACrB,CAAA;AAED,2BAA2B;AAC3B,MAAM,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,MAAM,EAAE,GAC1E,CAAC,GACD,KAAK,CAAA;AAET,iCAAiC;AACjC,MAAM,MAAM,MAAM,GAAG;KAClB,CAAC,IAAI,QAAQ,GAAG;QACf,GAAG,EAAE,CAAC,CAAA;QACN,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;QACpB,OAAO,EAAE,MAAM,EAAE,CAAA;KAClB;CACF,CAAC,QAAQ,CAAC,CAAA;AAEX,kBAAkB;AAClB,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,QAAQ,GACvD,OAAO,CACL,gBAAgB,CAAC,MAAM,CAAC,EACxB,GAAG,CAAC,IAAI,MAAM,EAAE,CACjB,SAAS,GAAG,CAAC,IAAI,MAAM,CAAC,EAAE,GACzB,CAAC,GACD,KAAK,GACP,KAAK,CAAA;AAET,uCAAuC;AACvC,MAAM,MAAM,MAAM,GAAG;IACnB,mCAAmC;IACnC,MAAM,EAAE,QAAQ,CAAA;IAChB,oCAAoC;IACpC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC1B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,8BAA8B;IAC9B,QAAQ,EAAE,CACR,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,EAC7B,aAAa,CAAC,EAAE,mBAAmB,KAChC,MAAM,CAAA;CACZ,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,mDAAmD;IACnD,IAAI,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test-d.d.ts","sourceRoot":"","sources":["../../src/types/index.test-d.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrayToObject.d.ts","sourceRoot":"","sources":["../../src/utils/arrayToObject.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,OAKvC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HarRequest } from '../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Takes a httpsnippet-lite client and converts the given request to a code example with it.
|
|
4
|
+
*/
|
|
5
|
+
export declare function convertWithHttpSnippetLite(client: Record<string, unknown>, request?: Partial<HarRequest>): string;
|
|
6
|
+
//# sourceMappingURL=convertWithHttpSnippetLite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertWithHttpSnippetLite.d.ts","sourceRoot":"","sources":["../../src/utils/convertWithHttpSnippetLite.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC;;GAEG;AACH,wBAAgB,0BAA0B,CAExC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAC5B,MAAM,CAkHR"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Takes a httpsnippet-lite client and converts the given request to a code example with it.
|
|
3
|
+
*/
|
|
4
|
+
function convertWithHttpSnippetLite(
|
|
5
|
+
// Couldn’t find the proper type, there was always a mismatch.
|
|
6
|
+
client, request) {
|
|
7
|
+
const urlObject = new URL(request?.url ?? '');
|
|
8
|
+
// If it's just the domain, omit the trailing slash
|
|
9
|
+
const url = urlObject.pathname === '/' ? urlObject.origin : urlObject.toString();
|
|
10
|
+
const harRequest = {
|
|
11
|
+
method: request?.method ?? 'GET',
|
|
12
|
+
url,
|
|
13
|
+
httpVersion: 'HTTP/1.1',
|
|
14
|
+
cookies: [], // Cookies are handled through headers
|
|
15
|
+
headers: request?.headers ?? [],
|
|
16
|
+
headersSize: -1,
|
|
17
|
+
bodySize: -1,
|
|
18
|
+
queryString: Array.from(urlObject.searchParams.entries()).map(([name, value]) => ({
|
|
19
|
+
name,
|
|
20
|
+
value,
|
|
21
|
+
})),
|
|
22
|
+
postData: request?.postData,
|
|
23
|
+
};
|
|
24
|
+
const allHeaders = (harRequest?.headers ?? []).reduce((acc, header) => ({
|
|
25
|
+
...acc,
|
|
26
|
+
[header.name]: header.value,
|
|
27
|
+
}), {});
|
|
28
|
+
const queryObj = (harRequest.queryString ?? []).reduce((acc, param) => ({
|
|
29
|
+
...acc,
|
|
30
|
+
[param.name]: param.value,
|
|
31
|
+
}), {});
|
|
32
|
+
const cookiesObj = (harRequest.cookies ?? []).reduce((acc, cookie) => ({
|
|
33
|
+
...acc,
|
|
34
|
+
[cookie.name]: cookie.value,
|
|
35
|
+
}), {});
|
|
36
|
+
const parsedUrl = new URL(harRequest.url);
|
|
37
|
+
const uriObj = {
|
|
38
|
+
protocol: parsedUrl.protocol,
|
|
39
|
+
hostname: parsedUrl.hostname,
|
|
40
|
+
host: parsedUrl.hostname,
|
|
41
|
+
port: parsedUrl.port,
|
|
42
|
+
pathname: parsedUrl.pathname
|
|
43
|
+
.split('/')
|
|
44
|
+
.map((segment) => encodeURIComponent(decodeURIComponent(segment)))
|
|
45
|
+
.join('/') + parsedUrl.search,
|
|
46
|
+
path: parsedUrl.pathname
|
|
47
|
+
.split('/')
|
|
48
|
+
.map((segment) => encodeURIComponent(decodeURIComponent(segment)))
|
|
49
|
+
.join('/') + parsedUrl.search,
|
|
50
|
+
search: parsedUrl.search,
|
|
51
|
+
hash: parsedUrl.hash,
|
|
52
|
+
href: parsedUrl.href,
|
|
53
|
+
origin: parsedUrl.origin,
|
|
54
|
+
password: parsedUrl.password,
|
|
55
|
+
searchParams: parsedUrl.searchParams,
|
|
56
|
+
username: parsedUrl.username,
|
|
57
|
+
toString: parsedUrl.toString,
|
|
58
|
+
toJSON: () => parsedUrl.toJSON(),
|
|
59
|
+
};
|
|
60
|
+
const convertRequest = {
|
|
61
|
+
url: harRequest.url,
|
|
62
|
+
uriObj,
|
|
63
|
+
method: harRequest.method?.toLocaleUpperCase() ?? 'GET',
|
|
64
|
+
httpVersion: harRequest.httpVersion,
|
|
65
|
+
cookies: harRequest.cookies ?? [],
|
|
66
|
+
headers: harRequest.headers ?? [],
|
|
67
|
+
headersSize: harRequest.headersSize,
|
|
68
|
+
headersObj: allHeaders ?? {},
|
|
69
|
+
bodySize: harRequest.bodySize,
|
|
70
|
+
queryString: harRequest.queryString ?? [],
|
|
71
|
+
postData: harRequest.postData
|
|
72
|
+
? {
|
|
73
|
+
mimeType: harRequest.postData.mimeType ?? 'application/json',
|
|
74
|
+
text: harRequest.postData.text ?? '',
|
|
75
|
+
params: harRequest.postData.params ?? [],
|
|
76
|
+
paramsObj: harRequest.postData.params?.reduce((acc, param) => {
|
|
77
|
+
if (param.name && param.value !== undefined) {
|
|
78
|
+
acc[param.name] = param.value;
|
|
79
|
+
}
|
|
80
|
+
return acc;
|
|
81
|
+
}, {}) ?? {},
|
|
82
|
+
}
|
|
83
|
+
: undefined,
|
|
84
|
+
allHeaders: allHeaders ?? {},
|
|
85
|
+
fullUrl: harRequest.url,
|
|
86
|
+
queryObj: queryObj ?? {},
|
|
87
|
+
cookiesObj: cookiesObj ?? {},
|
|
88
|
+
};
|
|
89
|
+
if (typeof client.convert === 'function') {
|
|
90
|
+
return client.convert(convertRequest);
|
|
91
|
+
}
|
|
92
|
+
return '';
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export { convertWithHttpSnippetLite };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"needsQuotes.d.ts","sourceRoot":"","sources":["../../src/utils/needsQuotes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,WAEtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectToString.d.ts","sourceRoot":"","sources":["../../src/utils/objectToString.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,SAAI,GAAG,MAAM,CAyD3E"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"url": "https://github.com/scalar/scalar.git",
|
|
10
10
|
"directory": "packages/snippetz"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.2.
|
|
12
|
+
"version": "0.2.9",
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">=18"
|
|
15
15
|
},
|
|
@@ -21,6 +21,16 @@
|
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"default": "./dist/index.js"
|
|
23
23
|
},
|
|
24
|
+
"./utils": {
|
|
25
|
+
"import": "./dist/utils/index.js",
|
|
26
|
+
"types": "./dist/utils/index.d.ts",
|
|
27
|
+
"default": "./dist/utils/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./types": {
|
|
30
|
+
"import": "./dist/types/index.js",
|
|
31
|
+
"types": "./dist/types/index.d.ts",
|
|
32
|
+
"default": "./dist/types/index.js"
|
|
33
|
+
},
|
|
24
34
|
"./plugins/swift/nsurlsession": {
|
|
25
35
|
"import": "./dist/plugins/swift/nsurlsession/index.js",
|
|
26
36
|
"types": "./dist/plugins/swift/nsurlsession/index.d.ts",
|
|
@@ -190,11 +200,6 @@
|
|
|
190
200
|
"import": "./dist/plugins/c/libcurl/index.js",
|
|
191
201
|
"types": "./dist/plugins/c/libcurl/index.d.ts",
|
|
192
202
|
"default": "./dist/plugins/c/libcurl/index.js"
|
|
193
|
-
},
|
|
194
|
-
"./core": {
|
|
195
|
-
"import": "./dist/core/index.js",
|
|
196
|
-
"types": "./dist/core/index.d.ts",
|
|
197
|
-
"default": "./dist/core/index.js"
|
|
198
203
|
}
|
|
199
204
|
},
|
|
200
205
|
"files": [
|
|
@@ -203,7 +208,6 @@
|
|
|
203
208
|
],
|
|
204
209
|
"module": "./dist/index.js",
|
|
205
210
|
"dependencies": {
|
|
206
|
-
"httpsnippet-lite": "^3.0.5",
|
|
207
211
|
"stringify-object": "^5.0.0"
|
|
208
212
|
},
|
|
209
213
|
"devDependencies": {
|
package/dist/core/index.d.ts
DELETED
package/dist/core/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AAEtC,cAAc,SAAS,CAAA"}
|
package/dist/core/index.js
DELETED
package/dist/core/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW;IACX,kBAAkB;IAClB,mBAAmB;IACnB,kBAAkB;IAClB,WAAW;IACX,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,aAAa;IACb,cAAc;IACd,UAAU;IACV,UAAU;IACV,WAAW;IACX,WAAW;IACX,QAAQ;IACR,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,aAAa;IACb,mBAAmB;IACnB,cAAc;IACd,UAAU;IACV,YAAY;IACZ,uBAAuB;IACvB,uBAAuB;IACvB,gBAAgB;IAChB,iBAAiB;IACjB,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,cAAc;IACd,YAAY;IACZ,oBAAoB;CACrB,CAAA;AAED,2BAA2B;AAC3B,MAAM,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,MAAM,EAAE,GAC1E,CAAC,GACD,KAAK,CAAA;AAET,kBAAkB;AAClB,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,QAAQ,GACvD,OAAO,CACL,gBAAgB,CAAC,MAAM,CAAC,EACxB,GAAG,CAAC,IAAI,MAAM,EAAE,CACjB,SAAS,GAAG,CAAC,IAAI,MAAM,CAAC,EAAE,GACzB,CAAC,GACD,KAAK,GACP,KAAK,CAAA;AAET,uCAAuC;AACvC,MAAM,MAAM,MAAM,GAAG;IACnB,mCAAmC;IACnC,MAAM,EAAE,QAAQ,CAAA;IAChB,oCAAoC;IACpC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC1B,8BAA8B;IAC9B,QAAQ,EAAE,CACR,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,EAC1B,aAAa,CAAC,EAAE,mBAAmB,KAChC,MAAM,CAAA;CACZ,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,mDAAmD;IACnD,IAAI,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9C,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.test-d.d.ts","sourceRoot":"","sources":["../../src/core/types.test-d.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrayToObject.d.ts","sourceRoot":"","sources":["../../../src/core/utils/arrayToObject.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,OAKvC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Request } from 'har-format';
|
|
2
|
-
import type { Client } from '../../../node_modules/httpsnippet-lite/dist/types/targets/targets';
|
|
3
|
-
/**
|
|
4
|
-
* Takes a httpsnippet-lite client and converts the given request to a code example with it.
|
|
5
|
-
*/
|
|
6
|
-
export declare function convertWithHttpSnippetLite(client: Client<object>, partialRequest?: Partial<Request>): string;
|
|
7
|
-
//# sourceMappingURL=convertWithHttpSnippetLite.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convertWithHttpSnippetLite.d.ts","sourceRoot":"","sources":["../../../src/core/utils/convertWithHttpSnippetLite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAA;AAE1E;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EACtB,cAAc,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAChC,MAAM,CAiGR"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Takes a httpsnippet-lite client and converts the given request to a code example with it.
|
|
3
|
-
*/
|
|
4
|
-
function convertWithHttpSnippetLite(client, partialRequest) {
|
|
5
|
-
const request = {
|
|
6
|
-
url: partialRequest?.url ?? '',
|
|
7
|
-
httpVersion: partialRequest?.httpVersion ?? 'HTTP/1.1',
|
|
8
|
-
cookies: partialRequest?.cookies ?? [],
|
|
9
|
-
headers: partialRequest?.headers ?? [],
|
|
10
|
-
headersSize: partialRequest?.headersSize ?? 0,
|
|
11
|
-
bodySize: partialRequest?.bodySize ?? 0,
|
|
12
|
-
queryString: partialRequest?.queryString ?? [],
|
|
13
|
-
...partialRequest,
|
|
14
|
-
};
|
|
15
|
-
const allHeaders = (request?.headers ?? []).reduce((acc, header) => ({
|
|
16
|
-
...acc,
|
|
17
|
-
[header.name]: header.value,
|
|
18
|
-
}), {});
|
|
19
|
-
const queryObj = (request.queryString ?? []).reduce((acc, param) => ({
|
|
20
|
-
...acc,
|
|
21
|
-
[param.name]: param.value,
|
|
22
|
-
}), {});
|
|
23
|
-
const cookiesObj = (request.cookies ?? []).reduce((acc, cookie) => ({
|
|
24
|
-
...acc,
|
|
25
|
-
[cookie.name]: cookie.value,
|
|
26
|
-
}), {});
|
|
27
|
-
const parsedUrl = new URL(request.url);
|
|
28
|
-
const uriObj = {
|
|
29
|
-
protocol: parsedUrl.protocol,
|
|
30
|
-
hostname: parsedUrl.hostname,
|
|
31
|
-
host: parsedUrl.hostname,
|
|
32
|
-
port: parsedUrl.port,
|
|
33
|
-
pathname: parsedUrl.pathname
|
|
34
|
-
.split('/')
|
|
35
|
-
.map((segment) => encodeURIComponent(decodeURIComponent(segment)))
|
|
36
|
-
.join('/') + parsedUrl.search,
|
|
37
|
-
path: parsedUrl.pathname
|
|
38
|
-
.split('/')
|
|
39
|
-
.map((segment) => encodeURIComponent(decodeURIComponent(segment)))
|
|
40
|
-
.join('/') + parsedUrl.search,
|
|
41
|
-
search: parsedUrl.search,
|
|
42
|
-
hash: parsedUrl.hash,
|
|
43
|
-
href: parsedUrl.href,
|
|
44
|
-
origin: parsedUrl.origin,
|
|
45
|
-
password: parsedUrl.password,
|
|
46
|
-
searchParams: parsedUrl.searchParams,
|
|
47
|
-
username: parsedUrl.username,
|
|
48
|
-
toString: parsedUrl.toString,
|
|
49
|
-
toJSON: () => parsedUrl.toJSON(),
|
|
50
|
-
};
|
|
51
|
-
return client?.convert({
|
|
52
|
-
url: request.url,
|
|
53
|
-
uriObj,
|
|
54
|
-
method: request.method?.toLocaleUpperCase() ?? 'GET',
|
|
55
|
-
httpVersion: request.httpVersion,
|
|
56
|
-
cookies: request.cookies ?? [],
|
|
57
|
-
headers: request.headers ?? [],
|
|
58
|
-
headersSize: request.headersSize ?? 0,
|
|
59
|
-
headersObj: allHeaders ?? {},
|
|
60
|
-
bodySize: request.bodySize ?? 0,
|
|
61
|
-
queryString: request.queryString ?? [],
|
|
62
|
-
postData: request.postData
|
|
63
|
-
? {
|
|
64
|
-
mimeType: request.postData.mimeType ?? 'application/json',
|
|
65
|
-
text: request.postData.text,
|
|
66
|
-
params: request.postData.params ?? [],
|
|
67
|
-
jsonObj: request.postData.mimeType?.includes('json')
|
|
68
|
-
? JSON.parse(request.postData.text ?? '{}')
|
|
69
|
-
: undefined,
|
|
70
|
-
paramsObj: request.postData.params?.reduce((acc, param) => ({
|
|
71
|
-
...acc,
|
|
72
|
-
[param.name]: param.value ?? '',
|
|
73
|
-
}), {}) ?? {},
|
|
74
|
-
}
|
|
75
|
-
: undefined,
|
|
76
|
-
allHeaders: allHeaders ?? {},
|
|
77
|
-
fullUrl: request.url,
|
|
78
|
-
queryObj: queryObj ?? {},
|
|
79
|
-
cookiesObj: cookiesObj ?? {},
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export { convertWithHttpSnippetLite };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"needsQuotes.d.ts","sourceRoot":"","sources":["../../../src/core/utils/needsQuotes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,WAEtC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objectToString.d.ts","sourceRoot":"","sources":["../../../src/core/utils/objectToString.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,SAAI,GAAG,MAAM,CAyD3E"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|