@scalar/snippetz 0.5.5 → 0.6.2
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/index.js +5 -5
- package/dist/clients/index.js.map +1 -1
- package/dist/httpsnippet-lite/helpers/code-builder.d.ts +51 -0
- package/dist/httpsnippet-lite/helpers/code-builder.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/helpers → helpers}/code-builder.js +29 -0
- package/dist/httpsnippet-lite/helpers/code-builder.js.map +7 -0
- package/dist/httpsnippet-lite/{esm/helpers → helpers}/escape.d.ts +22 -3
- package/dist/httpsnippet-lite/helpers/escape.d.ts.map +1 -0
- package/dist/httpsnippet-lite/helpers/escape.js.map +7 -0
- package/dist/httpsnippet-lite/helpers/headers.d.ts +15 -0
- package/dist/httpsnippet-lite/helpers/headers.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/helpers → helpers}/headers.js +2 -13
- package/dist/httpsnippet-lite/helpers/headers.js.map +7 -0
- package/dist/httpsnippet-lite/helpers/reducer.d.ts +2 -0
- package/dist/httpsnippet-lite/helpers/reducer.d.ts.map +1 -0
- package/dist/httpsnippet-lite/helpers/reducer.js +1 -0
- package/dist/httpsnippet-lite/{esm/helpers → helpers}/shell.d.ts +2 -2
- package/dist/httpsnippet-lite/helpers/shell.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/helpers → helpers}/shell.js +4 -4
- package/dist/httpsnippet-lite/helpers/shell.js.map +7 -0
- package/dist/httpsnippet-lite/helpers/snippet-request.d.ts +33 -0
- package/dist/httpsnippet-lite/helpers/snippet-request.d.ts.map +1 -0
- package/dist/httpsnippet-lite/helpers/snippet-request.js +1 -0
- package/dist/httpsnippet-lite/helpers/url.d.ts +4 -0
- package/dist/httpsnippet-lite/helpers/url.d.ts.map +1 -0
- package/dist/httpsnippet-lite/helpers/url.js +9 -0
- package/dist/httpsnippet-lite/helpers/url.js.map +7 -0
- package/dist/httpsnippet-lite/targets/c/libcurl/client.d.ts +3 -0
- package/dist/httpsnippet-lite/targets/c/libcurl/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/c/libcurl/client.js +7 -13
- package/dist/httpsnippet-lite/targets/c/libcurl/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/clojure/clj_http/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/clojure/clj_http/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/clojure/clj_http/client.js +7 -3
- package/dist/httpsnippet-lite/targets/clojure/clj_http/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/csharp/restsharp/client.d.ts +3 -0
- package/dist/httpsnippet-lite/targets/csharp/restsharp/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/csharp/restsharp/client.js +8 -18
- package/dist/httpsnippet-lite/targets/csharp/restsharp/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/go/native/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/go/native/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/go/native/client.js +14 -35
- package/dist/httpsnippet-lite/targets/go/native/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/java/asynchttp/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/java/asynchttp/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/java/asynchttp/client.js +1 -4
- package/dist/httpsnippet-lite/targets/java/asynchttp/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/java/nethttp/client.d.ts +3 -0
- package/dist/httpsnippet-lite/targets/java/nethttp/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/java/nethttp/client.js +3 -6
- package/dist/httpsnippet-lite/targets/java/nethttp/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/java/okhttp/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/java/okhttp/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/java/okhttp/client.js +5 -8
- package/dist/httpsnippet-lite/targets/java/okhttp/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/java/unirest/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/java/unirest/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/java/unirest/client.js +4 -8
- package/dist/httpsnippet-lite/targets/java/unirest/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/javascript/axios/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/javascript/axios/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/javascript/axios/client.js +6 -10
- package/dist/httpsnippet-lite/targets/javascript/axios/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/javascript/jquery/client.d.ts +3 -0
- package/dist/httpsnippet-lite/targets/javascript/jquery/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/javascript/jquery/client.js +5 -11
- package/dist/httpsnippet-lite/targets/javascript/jquery/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/javascript/xhr/client.d.ts +3 -0
- package/dist/httpsnippet-lite/targets/javascript/xhr/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/javascript/xhr/client.js +7 -15
- package/dist/httpsnippet-lite/targets/javascript/xhr/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/kotlin/okhttp/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/kotlin/okhttp/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/kotlin/okhttp/client.js +6 -9
- package/dist/httpsnippet-lite/targets/kotlin/okhttp/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/node/axios/client.d.ts +3 -0
- package/dist/httpsnippet-lite/targets/node/axios/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/node/axios/client.js +3 -5
- package/dist/httpsnippet-lite/targets/node/axios/client.js.map +7 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/objc/helpers.d.ts +5 -11
- package/dist/httpsnippet-lite/targets/objc/helpers.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/objc/helpers.js +7 -10
- package/dist/httpsnippet-lite/targets/objc/helpers.js.map +7 -0
- package/dist/httpsnippet-lite/targets/objc/nsurlsession/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/objc/nsurlsession/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/objc/nsurlsession/client.js +14 -51
- package/dist/httpsnippet-lite/targets/objc/nsurlsession/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/ocaml/cohttp/client.d.ts +3 -0
- package/dist/httpsnippet-lite/targets/ocaml/cohttp/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/ocaml/cohttp/client.js +3 -5
- package/dist/httpsnippet-lite/targets/ocaml/cohttp/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/powershell/common.d.ts +3 -0
- package/dist/httpsnippet-lite/targets/powershell/common.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/powershell/common.js +6 -12
- package/dist/httpsnippet-lite/targets/powershell/common.js.map +7 -0
- package/dist/httpsnippet-lite/targets/powershell/restmethod/client.d.ts +3 -0
- package/dist/httpsnippet-lite/targets/powershell/restmethod/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/targets/powershell/restmethod/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/powershell/webrequest/client.d.ts +3 -0
- package/dist/httpsnippet-lite/targets/powershell/webrequest/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/targets/powershell/webrequest/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/python/python3/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/python/python3/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/python/python3/client.js +4 -8
- package/dist/httpsnippet-lite/targets/python/python3/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/r/httr/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/r/httr/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/r/httr/client.js +5 -12
- package/dist/httpsnippet-lite/targets/r/httr/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/ruby/native/client.d.ts +3 -0
- package/dist/httpsnippet-lite/targets/ruby/native/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/ruby/native/client.js +2 -2
- package/dist/httpsnippet-lite/targets/ruby/native/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/shell/httpie/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/shell/httpie/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/shell/httpie/client.js +11 -11
- package/dist/httpsnippet-lite/targets/shell/httpie/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/shell/wget/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/shell/wget/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/shell/wget/client.js +6 -6
- package/dist/httpsnippet-lite/targets/shell/wget/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/swift/helpers.d.ts +15 -0
- package/dist/httpsnippet-lite/targets/swift/helpers.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/swift/helpers.js +9 -16
- package/dist/httpsnippet-lite/targets/swift/helpers.js.map +7 -0
- package/dist/httpsnippet-lite/targets/swift/nsurlsession/client.d.ts +12 -0
- package/dist/httpsnippet-lite/targets/swift/nsurlsession/client.d.ts.map +1 -0
- package/dist/httpsnippet-lite/{esm/targets → targets}/swift/nsurlsession/client.js +11 -32
- package/dist/httpsnippet-lite/targets/swift/nsurlsession/client.js.map +7 -0
- package/dist/httpsnippet-lite/targets/target.d.ts +19 -0
- package/dist/httpsnippet-lite/targets/target.d.ts.map +1 -0
- package/dist/httpsnippet-lite/targets/target.js +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +2 -2
- package/dist/plugins/c/libcurl/index.d.ts +1 -1
- package/dist/plugins/c/libcurl/index.d.ts.map +1 -1
- package/dist/plugins/c/libcurl/index.js +4 -1
- package/dist/plugins/c/libcurl/index.js.map +2 -2
- package/dist/plugins/c/libcurl/libcurl.js +1 -1
- package/dist/plugins/c/libcurl/libcurl.js.map +1 -1
- package/dist/plugins/clojure/clj_http/clj_http.d.ts.map +1 -1
- package/dist/plugins/clojure/clj_http/clj_http.js +1 -1
- package/dist/plugins/clojure/clj_http/clj_http.js.map +2 -2
- package/dist/plugins/clojure/clj_http/index.d.ts +1 -1
- package/dist/plugins/clojure/clj_http/index.d.ts.map +1 -1
- package/dist/plugins/clojure/clj_http/index.js +4 -1
- package/dist/plugins/clojure/clj_http/index.js.map +2 -2
- package/dist/plugins/csharp/httpclient/index.d.ts +1 -1
- package/dist/plugins/csharp/httpclient/index.d.ts.map +1 -1
- package/dist/plugins/csharp/httpclient/index.js +4 -1
- package/dist/plugins/csharp/httpclient/index.js.map +2 -2
- package/dist/plugins/csharp/restsharp/index.d.ts +1 -1
- package/dist/plugins/csharp/restsharp/index.d.ts.map +1 -1
- package/dist/plugins/csharp/restsharp/index.js +4 -1
- package/dist/plugins/csharp/restsharp/index.js.map +2 -2
- package/dist/plugins/csharp/restsharp/restsharp.d.ts.map +1 -1
- package/dist/plugins/csharp/restsharp/restsharp.js +1 -1
- package/dist/plugins/csharp/restsharp/restsharp.js.map +2 -2
- package/dist/plugins/dart/http/index.d.ts +1 -1
- package/dist/plugins/dart/http/index.d.ts.map +1 -1
- package/dist/plugins/dart/http/index.js +4 -1
- package/dist/plugins/dart/http/index.js.map +2 -2
- package/dist/plugins/fsharp/httpclient/index.d.ts +1 -1
- package/dist/plugins/fsharp/httpclient/index.d.ts.map +1 -1
- package/dist/plugins/fsharp/httpclient/index.js +4 -1
- package/dist/plugins/fsharp/httpclient/index.js.map +2 -2
- package/dist/plugins/go/native/index.d.ts +1 -1
- package/dist/plugins/go/native/index.d.ts.map +1 -1
- package/dist/plugins/go/native/index.js +4 -1
- package/dist/plugins/go/native/index.js.map +2 -2
- package/dist/plugins/go/native/native.d.ts.map +1 -1
- package/dist/plugins/go/native/native.js +1 -1
- package/dist/plugins/go/native/native.js.map +2 -2
- package/dist/plugins/http/http11/index.d.ts +1 -1
- package/dist/plugins/http/http11/index.d.ts.map +1 -1
- package/dist/plugins/http/http11/index.js +4 -1
- package/dist/plugins/http/http11/index.js.map +2 -2
- package/dist/plugins/java/asynchttp/asynchttp.d.ts.map +1 -1
- package/dist/plugins/java/asynchttp/asynchttp.js +1 -1
- package/dist/plugins/java/asynchttp/asynchttp.js.map +2 -2
- package/dist/plugins/java/asynchttp/index.d.ts +1 -1
- package/dist/plugins/java/asynchttp/index.d.ts.map +1 -1
- package/dist/plugins/java/asynchttp/index.js +4 -1
- package/dist/plugins/java/asynchttp/index.js.map +2 -2
- package/dist/plugins/java/nethttp/index.d.ts +1 -1
- package/dist/plugins/java/nethttp/index.d.ts.map +1 -1
- package/dist/plugins/java/nethttp/index.js +4 -1
- package/dist/plugins/java/nethttp/index.js.map +2 -2
- package/dist/plugins/java/nethttp/nethttp.d.ts.map +1 -1
- package/dist/plugins/java/nethttp/nethttp.js +1 -1
- package/dist/plugins/java/nethttp/nethttp.js.map +2 -2
- package/dist/plugins/java/okhttp/index.d.ts +1 -1
- package/dist/plugins/java/okhttp/index.d.ts.map +1 -1
- package/dist/plugins/java/okhttp/index.js +4 -1
- package/dist/plugins/java/okhttp/index.js.map +2 -2
- package/dist/plugins/java/okhttp/okhttp.d.ts.map +1 -1
- package/dist/plugins/java/okhttp/okhttp.js +1 -1
- package/dist/plugins/java/okhttp/okhttp.js.map +2 -2
- package/dist/plugins/java/unirest/index.d.ts +1 -1
- package/dist/plugins/java/unirest/index.d.ts.map +1 -1
- package/dist/plugins/java/unirest/index.js +4 -1
- package/dist/plugins/java/unirest/index.js.map +2 -2
- package/dist/plugins/java/unirest/unirest.d.ts.map +1 -1
- package/dist/plugins/java/unirest/unirest.js +1 -1
- package/dist/plugins/java/unirest/unirest.js.map +2 -2
- package/dist/plugins/js/axios/axios.js +1 -1
- package/dist/plugins/js/axios/axios.js.map +1 -1
- package/dist/plugins/js/fetch/fetch.js +1 -1
- package/dist/plugins/js/fetch/fetch.js.map +2 -2
- package/dist/plugins/js/jquery/index.d.ts +1 -1
- package/dist/plugins/js/jquery/index.d.ts.map +1 -1
- package/dist/plugins/js/jquery/index.js +4 -1
- package/dist/plugins/js/jquery/index.js.map +2 -2
- package/dist/plugins/js/jquery/jquery.d.ts.map +1 -1
- package/dist/plugins/js/jquery/jquery.js +1 -1
- package/dist/plugins/js/jquery/jquery.js.map +2 -2
- package/dist/plugins/js/ofetch/index.d.ts +1 -1
- package/dist/plugins/js/ofetch/index.d.ts.map +1 -1
- package/dist/plugins/js/ofetch/index.js +4 -1
- package/dist/plugins/js/ofetch/index.js.map +2 -2
- package/dist/plugins/js/xhr/index.d.ts +1 -1
- package/dist/plugins/js/xhr/index.d.ts.map +1 -1
- package/dist/plugins/js/xhr/index.js +4 -1
- package/dist/plugins/js/xhr/index.js.map +2 -2
- package/dist/plugins/js/xhr/xhr.d.ts.map +1 -1
- package/dist/plugins/js/xhr/xhr.js +1 -1
- package/dist/plugins/js/xhr/xhr.js.map +2 -2
- package/dist/plugins/kotlin/okhttp/index.d.ts +1 -1
- package/dist/plugins/kotlin/okhttp/index.d.ts.map +1 -1
- package/dist/plugins/kotlin/okhttp/index.js +4 -1
- package/dist/plugins/kotlin/okhttp/index.js.map +2 -2
- package/dist/plugins/kotlin/okhttp/okhttp.d.ts.map +1 -1
- package/dist/plugins/kotlin/okhttp/okhttp.js +1 -1
- package/dist/plugins/kotlin/okhttp/okhttp.js.map +2 -2
- package/dist/plugins/node/axios/axios.js +1 -1
- package/dist/plugins/node/axios/axios.js.map +1 -1
- package/dist/plugins/node/axios/index.d.ts +1 -1
- package/dist/plugins/node/axios/index.d.ts.map +1 -1
- package/dist/plugins/node/axios/index.js +4 -1
- package/dist/plugins/node/axios/index.js.map +2 -2
- package/dist/plugins/node/fetch/fetch.js +1 -1
- package/dist/plugins/node/fetch/fetch.js.map +2 -2
- package/dist/plugins/node/fetch/index.d.ts +1 -1
- package/dist/plugins/node/fetch/index.d.ts.map +1 -1
- package/dist/plugins/node/fetch/index.js +4 -1
- package/dist/plugins/node/fetch/index.js.map +2 -2
- package/dist/plugins/node/ofetch/index.d.ts +1 -1
- package/dist/plugins/node/ofetch/index.d.ts.map +1 -1
- package/dist/plugins/node/ofetch/index.js +4 -1
- package/dist/plugins/node/ofetch/index.js.map +2 -2
- package/dist/plugins/node/undici/index.d.ts +1 -1
- package/dist/plugins/node/undici/index.d.ts.map +1 -1
- package/dist/plugins/node/undici/index.js +4 -1
- package/dist/plugins/node/undici/index.js.map +2 -2
- package/dist/plugins/node/undici/undici.js +1 -1
- package/dist/plugins/node/undici/undici.js.map +2 -2
- package/dist/plugins/objc/nsurlsession/index.d.ts +1 -1
- package/dist/plugins/objc/nsurlsession/index.d.ts.map +1 -1
- package/dist/plugins/objc/nsurlsession/index.js +4 -1
- package/dist/plugins/objc/nsurlsession/index.js.map +2 -2
- package/dist/plugins/objc/nsurlsession/nsurlsession.d.ts.map +1 -1
- package/dist/plugins/objc/nsurlsession/nsurlsession.js +1 -1
- package/dist/plugins/objc/nsurlsession/nsurlsession.js.map +2 -2
- package/dist/plugins/ocaml/cohttp/cohttp.d.ts.map +1 -1
- package/dist/plugins/ocaml/cohttp/cohttp.js +1 -1
- package/dist/plugins/ocaml/cohttp/cohttp.js.map +2 -2
- package/dist/plugins/ocaml/cohttp/index.d.ts +1 -1
- package/dist/plugins/ocaml/cohttp/index.d.ts.map +1 -1
- package/dist/plugins/ocaml/cohttp/index.js +4 -1
- package/dist/plugins/ocaml/cohttp/index.js.map +2 -2
- package/dist/plugins/php/curl/index.d.ts +1 -1
- package/dist/plugins/php/curl/index.d.ts.map +1 -1
- package/dist/plugins/php/curl/index.js +4 -1
- package/dist/plugins/php/curl/index.js.map +2 -2
- package/dist/plugins/php/guzzle/index.d.ts +1 -1
- package/dist/plugins/php/guzzle/index.d.ts.map +1 -1
- package/dist/plugins/php/guzzle/index.js +4 -1
- package/dist/plugins/php/guzzle/index.js.map +2 -2
- package/dist/plugins/powershell/restmethod/index.d.ts +1 -1
- package/dist/plugins/powershell/restmethod/index.d.ts.map +1 -1
- package/dist/plugins/powershell/restmethod/index.js +4 -1
- package/dist/plugins/powershell/restmethod/index.js.map +2 -2
- package/dist/plugins/powershell/restmethod/restmethod.d.ts.map +1 -1
- package/dist/plugins/powershell/restmethod/restmethod.js +1 -1
- package/dist/plugins/powershell/restmethod/restmethod.js.map +2 -2
- package/dist/plugins/powershell/webrequest/index.d.ts +1 -1
- package/dist/plugins/powershell/webrequest/index.d.ts.map +1 -1
- package/dist/plugins/powershell/webrequest/index.js +4 -1
- package/dist/plugins/powershell/webrequest/index.js.map +2 -2
- package/dist/plugins/powershell/webrequest/webrequest.d.ts.map +1 -1
- package/dist/plugins/powershell/webrequest/webrequest.js +1 -1
- package/dist/plugins/powershell/webrequest/webrequest.js.map +2 -2
- package/dist/plugins/python/httpx/async.d.ts.map +1 -1
- package/dist/plugins/python/httpx/async.js.map +2 -2
- package/dist/plugins/python/httpx/index.d.ts +2 -2
- package/dist/plugins/python/httpx/index.d.ts.map +1 -1
- package/dist/plugins/python/httpx/index.js +6 -2
- package/dist/plugins/python/httpx/index.js.map +2 -2
- package/dist/plugins/python/httpx/sync.d.ts.map +1 -1
- package/dist/plugins/python/httpx/sync.js.map +2 -2
- package/dist/plugins/python/python3/index.d.ts +1 -1
- package/dist/plugins/python/python3/index.d.ts.map +1 -1
- package/dist/plugins/python/python3/index.js +4 -1
- package/dist/plugins/python/python3/index.js.map +2 -2
- package/dist/plugins/python/python3/python3.d.ts.map +1 -1
- package/dist/plugins/python/python3/python3.js +1 -1
- package/dist/plugins/python/python3/python3.js.map +2 -2
- package/dist/plugins/python/requests/index.d.ts +1 -1
- package/dist/plugins/python/requests/index.d.ts.map +1 -1
- package/dist/plugins/python/requests/index.js +4 -1
- package/dist/plugins/python/requests/index.js.map +2 -2
- package/dist/plugins/python/requests/requests.d.ts.map +1 -1
- package/dist/plugins/python/requests/requests.js.map +2 -2
- package/dist/plugins/r/httr/httr.d.ts.map +1 -1
- package/dist/plugins/r/httr/httr.js +1 -1
- package/dist/plugins/r/httr/httr.js.map +2 -2
- package/dist/plugins/r/httr/index.d.ts +1 -1
- package/dist/plugins/r/httr/index.d.ts.map +1 -1
- package/dist/plugins/r/httr/index.js +4 -1
- package/dist/plugins/r/httr/index.js.map +2 -2
- package/dist/plugins/ruby/native/index.d.ts +1 -1
- package/dist/plugins/ruby/native/index.d.ts.map +1 -1
- package/dist/plugins/ruby/native/index.js +4 -1
- package/dist/plugins/ruby/native/index.js.map +2 -2
- package/dist/plugins/ruby/native/native.d.ts.map +1 -1
- package/dist/plugins/ruby/native/native.js +1 -1
- package/dist/plugins/ruby/native/native.js.map +2 -2
- package/dist/plugins/rust/reqwest/index.d.ts +1 -1
- package/dist/plugins/rust/reqwest/index.d.ts.map +1 -1
- package/dist/plugins/rust/reqwest/index.js +4 -1
- package/dist/plugins/rust/reqwest/index.js.map +2 -2
- package/dist/plugins/shell/curl/index.d.ts +1 -1
- package/dist/plugins/shell/curl/index.d.ts.map +1 -1
- package/dist/plugins/shell/curl/index.js +4 -1
- package/dist/plugins/shell/curl/index.js.map +2 -2
- package/dist/plugins/shell/httpie/httpie.d.ts.map +1 -1
- package/dist/plugins/shell/httpie/httpie.js +1 -1
- package/dist/plugins/shell/httpie/httpie.js.map +2 -2
- package/dist/plugins/shell/httpie/index.d.ts +1 -1
- package/dist/plugins/shell/httpie/index.d.ts.map +1 -1
- package/dist/plugins/shell/httpie/index.js +4 -1
- package/dist/plugins/shell/httpie/index.js.map +2 -2
- package/dist/plugins/shell/wget/index.d.ts +1 -1
- package/dist/plugins/shell/wget/index.d.ts.map +1 -1
- package/dist/plugins/shell/wget/index.js +4 -1
- package/dist/plugins/shell/wget/index.js.map +2 -2
- package/dist/plugins/shell/wget/wget.d.ts.map +1 -1
- package/dist/plugins/shell/wget/wget.js +1 -1
- package/dist/plugins/shell/wget/wget.js.map +2 -2
- package/dist/plugins/swift/nsurlsession/index.d.ts +1 -1
- package/dist/plugins/swift/nsurlsession/index.d.ts.map +1 -1
- package/dist/plugins/swift/nsurlsession/index.js +4 -1
- package/dist/plugins/swift/nsurlsession/index.js.map +2 -2
- package/dist/plugins/swift/nsurlsession/nsurlsession.d.ts.map +1 -1
- package/dist/plugins/swift/nsurlsession/nsurlsession.js +1 -1
- package/dist/plugins/swift/nsurlsession/nsurlsession.js.map +2 -2
- package/dist/snippetz.d.ts +2 -2
- package/dist/snippetz.d.ts.map +1 -1
- package/dist/snippetz.js.map +2 -2
- package/dist/utils/convertWithHttpSnippetLite.js +1 -1
- package/dist/utils/convertWithHttpSnippetLite.js.map +2 -2
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -1
- package/dist/utils/index.js.map +2 -2
- package/package.json +4 -3
- package/dist/httpsnippet-lite/esm/helpers/code-builder.d.ts +0 -8
- package/dist/httpsnippet-lite/esm/helpers/code-builder.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/helpers/code-builder.js.map +0 -7
- package/dist/httpsnippet-lite/esm/helpers/escape.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/helpers/escape.js.map +0 -7
- package/dist/httpsnippet-lite/esm/helpers/form-data.d.ts +0 -3
- package/dist/httpsnippet-lite/esm/helpers/form-data.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/helpers/form-data.js +0 -59
- package/dist/httpsnippet-lite/esm/helpers/form-data.js.map +0 -7
- package/dist/httpsnippet-lite/esm/helpers/headers.d.ts +0 -17
- package/dist/httpsnippet-lite/esm/helpers/headers.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/helpers/headers.js.map +0 -7
- package/dist/httpsnippet-lite/esm/helpers/reducer.d.ts +0 -2
- package/dist/httpsnippet-lite/esm/helpers/reducer.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/helpers/reducer.js +0 -20
- package/dist/httpsnippet-lite/esm/helpers/reducer.js.map +0 -7
- package/dist/httpsnippet-lite/esm/helpers/shell.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/helpers/shell.js.map +0 -7
- package/dist/httpsnippet-lite/esm/helpers/url.d.ts +0 -5
- package/dist/httpsnippet-lite/esm/helpers/url.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/helpers/url.js +0 -20
- package/dist/httpsnippet-lite/esm/helpers/url.js.map +0 -7
- package/dist/httpsnippet-lite/esm/helpers/utils.d.ts +0 -3
- package/dist/httpsnippet-lite/esm/helpers/utils.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/helpers/utils.js +0 -16
- package/dist/httpsnippet-lite/esm/helpers/utils.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.d.ts +0 -16
- package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/c/target.d.ts +0 -26
- package/dist/httpsnippet-lite/esm/targets/c/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/c/target.js +0 -16
- package/dist/httpsnippet-lite/esm/targets/c/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.d.ts +0 -16
- package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/clojure/target.d.ts +0 -26
- package/dist/httpsnippet-lite/esm/targets/clojure/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/clojure/target.js +0 -16
- package/dist/httpsnippet-lite/esm/targets/clojure/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.d.ts +0 -17
- package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/csharp/target.d.ts +0 -27
- package/dist/httpsnippet-lite/esm/targets/csharp/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/csharp/target.js +0 -16
- package/dist/httpsnippet-lite/esm/targets/csharp/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/go/native/client.d.ts +0 -15
- package/dist/httpsnippet-lite/esm/targets/go/native/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/go/native/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/go/target.d.ts +0 -25
- package/dist/httpsnippet-lite/esm/targets/go/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/go/target.js +0 -16
- package/dist/httpsnippet-lite/esm/targets/go/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.d.ts +0 -15
- package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.d.ts +0 -15
- package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.d.ts +0 -15
- package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/java/target.d.ts +0 -67
- package/dist/httpsnippet-lite/esm/targets/java/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/java/target.js +0 -22
- package/dist/httpsnippet-lite/esm/targets/java/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/java/unirest/client.d.ts +0 -15
- package/dist/httpsnippet-lite/esm/targets/java/unirest/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/java/unirest/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.d.ts +0 -16
- package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.d.ts +0 -15
- package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/javascript/target.d.ts +0 -55
- package/dist/httpsnippet-lite/esm/targets/javascript/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/javascript/target.js +0 -22
- package/dist/httpsnippet-lite/esm/targets/javascript/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.d.ts +0 -15
- package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.d.ts +0 -15
- package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/kotlin/target.d.ts +0 -25
- package/dist/httpsnippet-lite/esm/targets/kotlin/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/kotlin/target.js +0 -16
- package/dist/httpsnippet-lite/esm/targets/kotlin/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/node/axios/client.d.ts +0 -16
- package/dist/httpsnippet-lite/esm/targets/node/axios/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/node/axios/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/node/request/client.d.ts +0 -17
- package/dist/httpsnippet-lite/esm/targets/node/request/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/node/request/client.js +0 -100
- package/dist/httpsnippet-lite/esm/targets/node/request/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/node/target.d.ts +0 -45
- package/dist/httpsnippet-lite/esm/targets/node/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/node/target.js +0 -24
- package/dist/httpsnippet-lite/esm/targets/node/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/objc/helpers.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/objc/helpers.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.d.ts +0 -15
- package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/objc/target.d.ts +0 -25
- package/dist/httpsnippet-lite/esm/targets/objc/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/objc/target.js +0 -16
- package/dist/httpsnippet-lite/esm/targets/objc/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.d.ts +0 -15
- package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/ocaml/target.d.ts +0 -25
- package/dist/httpsnippet-lite/esm/targets/ocaml/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/ocaml/target.js +0 -16
- package/dist/httpsnippet-lite/esm/targets/ocaml/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/php/helpers.d.ts +0 -3
- package/dist/httpsnippet-lite/esm/targets/php/helpers.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/php/helpers.js +0 -72
- package/dist/httpsnippet-lite/esm/targets/php/helpers.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/php/http1/client.d.ts +0 -17
- package/dist/httpsnippet-lite/esm/targets/php/http1/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/php/http1/client.js +0 -85
- package/dist/httpsnippet-lite/esm/targets/php/http1/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/php/http2/client.d.ts +0 -17
- package/dist/httpsnippet-lite/esm/targets/php/http2/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/php/http2/client.js +0 -127
- package/dist/httpsnippet-lite/esm/targets/php/http2/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/php/target.d.ts +0 -45
- package/dist/httpsnippet-lite/esm/targets/php/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/php/target.js +0 -22
- package/dist/httpsnippet-lite/esm/targets/php/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/powershell/common.d.ts +0 -10
- package/dist/httpsnippet-lite/esm/targets/powershell/common.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/powershell/common.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.d.ts +0 -18
- package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/powershell/target.d.ts +0 -45
- package/dist/httpsnippet-lite/esm/targets/powershell/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/powershell/target.js +0 -18
- package/dist/httpsnippet-lite/esm/targets/powershell/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.d.ts +0 -18
- package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/python/helpers.d.ts +0 -9
- package/dist/httpsnippet-lite/esm/targets/python/helpers.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/python/helpers.js +0 -68
- package/dist/httpsnippet-lite/esm/targets/python/helpers.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/python/python3/client.d.ts +0 -19
- package/dist/httpsnippet-lite/esm/targets/python/python3/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/python/python3/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/python/target.d.ts +0 -29
- package/dist/httpsnippet-lite/esm/targets/python/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/python/target.js +0 -16
- package/dist/httpsnippet-lite/esm/targets/python/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/r/httr/client.d.ts +0 -17
- package/dist/httpsnippet-lite/esm/targets/r/httr/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/r/httr/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/r/target.d.ts +0 -27
- package/dist/httpsnippet-lite/esm/targets/r/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/r/target.js +0 -16
- package/dist/httpsnippet-lite/esm/targets/r/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/ruby/native/client.d.ts +0 -16
- package/dist/httpsnippet-lite/esm/targets/ruby/native/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/ruby/native/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/ruby/target.d.ts +0 -26
- package/dist/httpsnippet-lite/esm/targets/ruby/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/ruby/target.js +0 -16
- package/dist/httpsnippet-lite/esm/targets/ruby/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.d.ts +0 -17
- package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/shell/target.d.ts +0 -42
- package/dist/httpsnippet-lite/esm/targets/shell/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/shell/target.js +0 -20
- package/dist/httpsnippet-lite/esm/targets/shell/target.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/shell/wget/client.d.ts +0 -15
- package/dist/httpsnippet-lite/esm/targets/shell/wget/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/shell/wget/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/swift/helpers.d.ts +0 -17
- package/dist/httpsnippet-lite/esm/targets/swift/helpers.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/swift/helpers.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.d.ts +0 -15
- package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.js.map +0 -7
- package/dist/httpsnippet-lite/esm/targets/swift/target.d.ts +0 -25
- package/dist/httpsnippet-lite/esm/targets/swift/target.d.ts.map +0 -1
- package/dist/httpsnippet-lite/esm/targets/swift/target.js +0 -16
- package/dist/httpsnippet-lite/esm/targets/swift/target.js.map +0 -7
- package/dist/httpsnippet-lite/types/helpers/code-builder.d.js +0 -1
- package/dist/httpsnippet-lite/types/helpers/escape.d.js +0 -1
- package/dist/httpsnippet-lite/types/helpers/form-data.d.js +0 -28
- package/dist/httpsnippet-lite/types/helpers/form-data.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/helpers/headers.d.js +0 -1
- package/dist/httpsnippet-lite/types/helpers/reducer.d.js +0 -1
- package/dist/httpsnippet-lite/types/helpers/reducer.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/helpers/shell.d.js +0 -1
- package/dist/httpsnippet-lite/types/helpers/shell.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/helpers/url.d.js +0 -1
- package/dist/httpsnippet-lite/types/helpers/url.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/helpers/utils.d.js +0 -1
- package/dist/httpsnippet-lite/types/helpers/utils.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/httpsnippet.d.js +0 -19
- package/dist/httpsnippet-lite/types/httpsnippet.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/c/libcurl/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/c/libcurl/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/c/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/c/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/clojure/clj_http/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/clojure/clj_http/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/clojure/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/clojure/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/csharp/restsharp/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/csharp/restsharp/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/csharp/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/csharp/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/dart/http/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/dart/http/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/dart/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/dart/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/go/native/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/go/native/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/go/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/go/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/http/http1.1/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/http/http1.1/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/http/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/http/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/java/asynchttp/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/java/asynchttp/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/java/nethttp/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/java/nethttp/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/java/okhttp/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/java/okhttp/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/java/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/java/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/java/unirest/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/java/unirest/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/javascript/axios/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/javascript/axios/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/javascript/fetch/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/javascript/fetch/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/javascript/jquery/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/javascript/jquery/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/javascript/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/javascript/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/javascript/xhr/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/javascript/xhr/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/kotlin/okhttp/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/kotlin/okhttp/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/kotlin/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/kotlin/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/node/axios/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/node/axios/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/node/fetch/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/node/fetch/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/node/native/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/node/native/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/node/request/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/node/request/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/node/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/node/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/node/unirest/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/node/unirest/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/objc/helpers.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/objc/helpers.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/objc/nsurlsession/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/objc/nsurlsession/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/objc/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/objc/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/ocaml/cohttp/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/ocaml/cohttp/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/ocaml/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/ocaml/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/php/curl/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/php/curl/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/php/guzzle/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/php/guzzle/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/php/helpers.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/php/helpers.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/php/http1/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/php/http1/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/php/http2/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/php/http2/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/php/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/php/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/powershell/common.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/powershell/common.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/powershell/restmethod/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/powershell/restmethod/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/powershell/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/powershell/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/powershell/webrequest/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/powershell/webrequest/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/python/helpers.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/python/helpers.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/python/python3/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/python/python3/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/python/requests/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/python/requests/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/python/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/python/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/r/httr/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/r/httr/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/r/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/r/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/ruby/native/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/ruby/native/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/ruby/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/ruby/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/shell/curl/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/shell/curl/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/shell/httpie/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/shell/httpie/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/shell/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/shell/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/shell/wget/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/shell/wget/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/swift/helpers.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/swift/helpers.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/swift/nsurlsession/client.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/swift/nsurlsession/client.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/swift/target.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/swift/target.d.js.map +0 -7
- package/dist/httpsnippet-lite/types/targets/targets.d.js +0 -1
- package/dist/httpsnippet-lite/types/targets/targets.d.js.map +0 -7
- /package/dist/httpsnippet-lite/{esm/helpers → helpers}/escape.js +0 -0
- /package/dist/httpsnippet-lite/{types/helpers/code-builder.d.js.map → helpers/reducer.js.map} +0 -0
- /package/dist/httpsnippet-lite/{types/helpers/escape.d.js.map → helpers/snippet-request.js.map} +0 -0
- /package/dist/httpsnippet-lite/{esm/targets → targets}/powershell/restmethod/client.js +0 -0
- /package/dist/httpsnippet-lite/{esm/targets → targets}/powershell/webrequest/client.js +0 -0
- /package/dist/httpsnippet-lite/{types/helpers/headers.d.js.map → targets/target.js.map} +0 -0
package/dist/clients/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { cLibcurl } from "../plugins/c/libcurl/
|
|
1
|
+
import { cLibcurl } from "../plugins/c/libcurl/index.js";
|
|
2
2
|
import { clojureCljhttp } from "../plugins/clojure/clj_http/index.js";
|
|
3
3
|
import { csharpHttpclient } from "../plugins/csharp/httpclient/index.js";
|
|
4
4
|
import { csharpRestsharp } from "../plugins/csharp/restsharp/index.js";
|
|
5
5
|
import { dartHttp } from "../plugins/dart/http/index.js";
|
|
6
|
-
import { fsharpHttpclient } from "../plugins/fsharp/httpclient/
|
|
6
|
+
import { fsharpHttpclient } from "../plugins/fsharp/httpclient/index.js";
|
|
7
7
|
import { goNative } from "../plugins/go/native/index.js";
|
|
8
8
|
import { httpHttp11 } from "../plugins/http/http11/index.js";
|
|
9
9
|
import { javaAsynchttp } from "../plugins/java/asynchttp/index.js";
|
|
10
|
-
import { javaNethttp } from "../plugins/java/nethttp/
|
|
11
|
-
import { javaOkhttp } from "../plugins/java/okhttp/
|
|
12
|
-
import { javaUnirest } from "../plugins/java/unirest/
|
|
10
|
+
import { javaNethttp } from "../plugins/java/nethttp/index.js";
|
|
11
|
+
import { javaOkhttp } from "../plugins/java/okhttp/index.js";
|
|
12
|
+
import { javaUnirest } from "../plugins/java/unirest/index.js";
|
|
13
13
|
import { jsAxios } from "../plugins/js/axios/index.js";
|
|
14
14
|
import { jsFetch } from "../plugins/js/fetch/index.js";
|
|
15
15
|
import { jsJquery } from "../plugins/js/jquery/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/clients/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Target } from '@scalar/types/snippetz'\n\nimport { cLibcurl } from '@/plugins/c/libcurl
|
|
4
|
+
"sourcesContent": ["import type { Target } from '@scalar/types/snippetz'\n\nimport { cLibcurl } from '@/plugins/c/libcurl'\nimport { clojureCljhttp } from '@/plugins/clojure/clj_http'\nimport { csharpHttpclient } from '@/plugins/csharp/httpclient'\nimport { csharpRestsharp } from '@/plugins/csharp/restsharp'\nimport { dartHttp } from '@/plugins/dart/http'\nimport { fsharpHttpclient } from '@/plugins/fsharp/httpclient'\nimport { goNative } from '@/plugins/go/native'\nimport { httpHttp11 } from '@/plugins/http/http11'\nimport { javaAsynchttp } from '@/plugins/java/asynchttp'\nimport { javaNethttp } from '@/plugins/java/nethttp'\nimport { javaOkhttp } from '@/plugins/java/okhttp'\nimport { javaUnirest } from '@/plugins/java/unirest'\nimport { jsAxios } from '@/plugins/js/axios'\nimport { jsFetch } from '@/plugins/js/fetch'\nimport { jsJquery } from '@/plugins/js/jquery'\nimport { jsOfetch } from '@/plugins/js/ofetch'\nimport { jsXhr } from '@/plugins/js/xhr'\nimport { kotlinOkhttp } from '@/plugins/kotlin/okhttp'\nimport { nodeAxios } from '@/plugins/node/axios'\nimport { nodeFetch } from '@/plugins/node/fetch'\nimport { nodeOfetch } from '@/plugins/node/ofetch'\nimport { nodeUndici } from '@/plugins/node/undici'\nimport { objcNsurlsession } from '@/plugins/objc/nsurlsession'\nimport { ocamlCohttp } from '@/plugins/ocaml/cohttp'\nimport { phpCurl } from '@/plugins/php/curl'\nimport { phpGuzzle } from '@/plugins/php/guzzle'\nimport { powershellRestmethod } from '@/plugins/powershell/restmethod'\nimport { powershellWebrequest } from '@/plugins/powershell/webrequest'\nimport { pythonHttpxAsync, pythonHttpxSync } from '@/plugins/python/httpx'\nimport { pythonPython3 } from '@/plugins/python/python3'\nimport { pythonRequests } from '@/plugins/python/requests'\nimport { rHttr } from '@/plugins/r/httr'\nimport { rubyNative } from '@/plugins/ruby/native'\nimport { rustReqwest } from '@/plugins/rust/reqwest'\nimport { shellCurl } from '@/plugins/shell/curl'\nimport { shellHttpie } from '@/plugins/shell/httpie'\nimport { shellWget } from '@/plugins/shell/wget'\nimport { swiftNsurlsession } from '@/plugins/swift/nsurlsession'\n\n/**\n * All available clients\n */\nexport const clients: Target[] = [\n {\n key: 'c',\n title: 'C',\n default: 'libcurl',\n clients: [cLibcurl],\n },\n {\n key: 'csharp',\n title: 'C#',\n default: 'restsharp',\n clients: [csharpHttpclient, csharpRestsharp],\n },\n {\n key: 'clojure',\n title: 'Clojure',\n default: 'clj_http',\n clients: [clojureCljhttp],\n },\n {\n key: 'dart',\n title: 'Dart',\n default: 'http',\n clients: [dartHttp],\n },\n {\n key: 'fsharp',\n title: 'F#',\n default: 'httpclient',\n clients: [fsharpHttpclient],\n },\n {\n key: 'go',\n title: 'Go',\n default: 'native',\n clients: [goNative],\n },\n {\n key: 'http',\n title: 'HTTP',\n default: 'http1.1',\n clients: [httpHttp11],\n },\n {\n key: 'java',\n title: 'Java',\n default: 'unirest',\n clients: [javaAsynchttp, javaNethttp, javaOkhttp, javaUnirest],\n },\n {\n key: 'js',\n title: 'JavaScript',\n default: 'fetch',\n clients: [jsFetch, jsAxios, jsOfetch, jsJquery, jsXhr],\n },\n {\n key: 'kotlin',\n title: 'Kotlin',\n default: 'okhttp',\n clients: [kotlinOkhttp],\n },\n {\n key: 'node',\n title: 'Node.js',\n default: 'fetch',\n clients: [nodeFetch, nodeAxios, nodeOfetch, nodeUndici],\n },\n {\n key: 'objc',\n title: 'Objective-C',\n default: 'nsurlsession',\n clients: [objcNsurlsession],\n },\n {\n key: 'ocaml',\n title: 'OCaml',\n default: 'cohttp',\n clients: [ocamlCohttp],\n },\n {\n key: 'php',\n title: 'PHP',\n default: 'curl',\n clients: [phpCurl, phpGuzzle],\n },\n {\n key: 'powershell',\n title: 'PowerShell',\n default: 'webrequest',\n clients: [powershellWebrequest, powershellRestmethod],\n },\n {\n key: 'python',\n title: 'Python',\n default: 'python3',\n clients: [pythonPython3, pythonRequests, pythonHttpxSync, pythonHttpxAsync],\n },\n {\n key: 'r',\n title: 'R',\n default: 'httr',\n clients: [rHttr],\n },\n {\n key: 'ruby',\n title: 'Ruby',\n default: 'native',\n clients: [rubyNative],\n },\n {\n key: 'rust',\n title: 'Rust',\n default: 'reqwest',\n clients: [rustReqwest],\n },\n {\n key: 'shell',\n title: 'Shell',\n default: 'curl',\n clients: [shellCurl, shellWget, shellHttpie],\n },\n {\n key: 'swift',\n title: 'Swift',\n default: 'nsurlsession',\n clients: [swiftNsurlsession],\n },\n]\n"],
|
|
5
5
|
"mappings": "AAEA,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AACrC,SAAS,kBAAkB,uBAAuB;AAClD,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,S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
+
export type CodeBuilderOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Desired indentation character for aggregated lines of code
|
|
5
|
+
* @default ''
|
|
6
|
+
*/
|
|
7
|
+
indent?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Desired character to join each line of code
|
|
10
|
+
* @default \n
|
|
11
|
+
*/
|
|
12
|
+
join?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare class CodeBuilder {
|
|
15
|
+
postProcessors: PostProcessor[];
|
|
16
|
+
code: string[];
|
|
17
|
+
indentationCharacter: string;
|
|
18
|
+
lineJoin: string;
|
|
19
|
+
/**
|
|
20
|
+
* Add given indentation level to given line of code
|
|
21
|
+
*/
|
|
22
|
+
indentLine: (line: string, indentationLevel?: number) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Add the line at the beginning of the current lines
|
|
25
|
+
*/
|
|
26
|
+
unshift: (line: string, indentationLevel?: number) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Add the line at the end of the current lines
|
|
29
|
+
*/
|
|
30
|
+
push: (line: string, indentationLevel?: number) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Add an empty line at the end of current lines
|
|
33
|
+
*/
|
|
34
|
+
blank: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* Concatenate all current lines using the given lineJoin, then apply any replacers that may have been added
|
|
37
|
+
*/
|
|
38
|
+
join: () => string;
|
|
39
|
+
/**
|
|
40
|
+
* Often when writing modules you may wish to add a literal tag or bit of metadata that you wish to transform after other processing as a final step.
|
|
41
|
+
* To do so, you can provide a PostProcessor function and it will be run automatically for you when you call `join()` later on.
|
|
42
|
+
*/
|
|
43
|
+
addPostProcessor: (postProcessor: PostProcessor) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Helper object to format and aggragate lines of code.
|
|
46
|
+
* Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.
|
|
47
|
+
*/
|
|
48
|
+
constructor({ indent, join }?: CodeBuilderOptions);
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=code-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-builder.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/code-builder.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,CAAA;AAEvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAKD,qBAAa,WAAW;IACtB,cAAc,EAAE,aAAa,EAAE,CAAA;IAC/B,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,oBAAoB,EAAE,MAAM,CAAA;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/D;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1D;;OAEG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACvD;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB;;OAEG;IACH,IAAI,EAAE,MAAM,MAAM,CAAA;IAClB;;;OAGG;IACH,gBAAgB,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAA;IAExD;;;OAGG;gBACS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAE,kBAAuB;CAsDtD"}
|
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
const DEFAULT_INDENTATION_CHARACTER = "";
|
|
2
2
|
const DEFAULT_LINE_JOIN = "\n";
|
|
3
3
|
class CodeBuilder {
|
|
4
|
+
postProcessors;
|
|
5
|
+
code;
|
|
6
|
+
indentationCharacter;
|
|
7
|
+
lineJoin;
|
|
8
|
+
/**
|
|
9
|
+
* Add given indentation level to given line of code
|
|
10
|
+
*/
|
|
11
|
+
indentLine;
|
|
12
|
+
/**
|
|
13
|
+
* Add the line at the beginning of the current lines
|
|
14
|
+
*/
|
|
15
|
+
unshift;
|
|
16
|
+
/**
|
|
17
|
+
* Add the line at the end of the current lines
|
|
18
|
+
*/
|
|
19
|
+
push;
|
|
20
|
+
/**
|
|
21
|
+
* Add an empty line at the end of current lines
|
|
22
|
+
*/
|
|
23
|
+
blank;
|
|
24
|
+
/**
|
|
25
|
+
* Concatenate all current lines using the given lineJoin, then apply any replacers that may have been added
|
|
26
|
+
*/
|
|
27
|
+
join;
|
|
28
|
+
/**
|
|
29
|
+
* Often when writing modules you may wish to add a literal tag or bit of metadata that you wish to transform after other processing as a final step.
|
|
30
|
+
* To do so, you can provide a PostProcessor function and it will be run automatically for you when you call `join()` later on.
|
|
31
|
+
*/
|
|
32
|
+
addPostProcessor;
|
|
4
33
|
/**
|
|
5
34
|
* Helper object to format and aggragate lines of code.
|
|
6
35
|
* Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/httpsnippet-lite/helpers/code-builder.ts"],
|
|
4
|
+
"sourcesContent": ["type PostProcessor = (unreplacedCode: string) => string\n\nexport type CodeBuilderOptions = {\n /**\n * Desired indentation character for aggregated lines of code\n * @default ''\n */\n indent?: string\n /**\n * Desired character to join each line of code\n * @default \\n\n */\n join?: string\n}\n\nconst DEFAULT_INDENTATION_CHARACTER = ''\nconst DEFAULT_LINE_JOIN = '\\n'\n\nexport class CodeBuilder {\n postProcessors: PostProcessor[]\n code: string[]\n indentationCharacter: string\n lineJoin: string\n\n /**\n * Add given indentation level to given line of code\n */\n indentLine: (line: string, indentationLevel?: number) => string\n /**\n * Add the line at the beginning of the current lines\n */\n unshift: (line: string, indentationLevel?: number) => void\n /**\n * Add the line at the end of the current lines\n */\n push: (line: string, indentationLevel?: number) => void\n /**\n * Add an empty line at the end of current lines\n */\n blank: () => void\n /**\n * Concatenate all current lines using the given lineJoin, then apply any replacers that may have been added\n */\n join: () => string\n /**\n * Often when writing modules you may wish to add a literal tag or bit of metadata that you wish to transform after other processing as a final step.\n * To do so, you can provide a PostProcessor function and it will be run automatically for you when you call `join()` later on.\n */\n addPostProcessor: (postProcessor: PostProcessor) => void\n\n /**\n * Helper object to format and aggragate lines of code.\n * Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.\n */\n constructor({ indent, join }: CodeBuilderOptions = {}) {\n this.postProcessors = []\n this.code = []\n this.indentationCharacter = DEFAULT_INDENTATION_CHARACTER\n this.lineJoin = DEFAULT_LINE_JOIN\n\n /**\n * Add given indentation level to given line of code\n */\n this.indentLine = (line, indentationLevel = 0) => {\n const whitespace = this.indentationCharacter.repeat(indentationLevel)\n return `${whitespace}${line}`\n }\n /**\n * Add the line at the beginning of the current lines\n */\n this.unshift = (line, indentationLevel) => {\n const newLine = this.indentLine(line, indentationLevel)\n this.code.unshift(newLine)\n }\n /**\n * Add the line at the end of the current lines\n */\n this.push = (line, indentationLevel) => {\n const newLine = this.indentLine(line, indentationLevel)\n this.code.push(newLine)\n }\n /**\n * Add an empty line at the end of current lines\n */\n this.blank = () => {\n this.code.push('')\n }\n /**\n * Concatenate all current lines using the given lineJoin, then apply any replacers that may have been added\n */\n this.join = () => {\n const unreplacedCode = this.code.join(this.lineJoin)\n const replacedOutput = this.postProcessors.reduce(\n (accumulator, replacer) => replacer(accumulator),\n unreplacedCode,\n )\n return replacedOutput\n }\n /**\n * Often when writing modules you may wish to add a literal tag or bit of metadata that you wish to transform after other processing as a final step.\n * To do so, you can provide a PostProcessor function and it will be run automatically for you when you call `join()` later on.\n */\n this.addPostProcessor = (postProcessor) => {\n this.postProcessors = [...this.postProcessors, postProcessor]\n }\n this.indentationCharacter = indent || DEFAULT_INDENTATION_CHARACTER\n this.lineJoin = join !== null && join !== void 0 ? join : DEFAULT_LINE_JOIN\n }\n}\n"],
|
|
5
|
+
"mappings": "AAeA,MAAM,gCAAgC;AACtC,MAAM,oBAAoB;AAEnB,MAAM,YAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA;AAAA;AAAA,EAIA;AAAA;AAAA;AAAA;AAAA,EAIA;AAAA;AAAA;AAAA;AAAA,EAIA;AAAA;AAAA;AAAA;AAAA,EAIA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAAY,EAAE,QAAQ,KAAK,IAAwB,CAAC,GAAG;AACrD,SAAK,iBAAiB,CAAC;AACvB,SAAK,OAAO,CAAC;AACb,SAAK,uBAAuB;AAC5B,SAAK,WAAW;AAKhB,SAAK,aAAa,CAAC,MAAM,mBAAmB,MAAM;AAChD,YAAM,aAAa,KAAK,qBAAqB,OAAO,gBAAgB;AACpE,aAAO,GAAG,UAAU,GAAG,IAAI;AAAA,IAC7B;AAIA,SAAK,UAAU,CAAC,MAAM,qBAAqB;AACzC,YAAM,UAAU,KAAK,WAAW,MAAM,gBAAgB;AACtD,WAAK,KAAK,QAAQ,OAAO;AAAA,IAC3B;AAIA,SAAK,OAAO,CAAC,MAAM,qBAAqB;AACtC,YAAM,UAAU,KAAK,WAAW,MAAM,gBAAgB;AACtD,WAAK,KAAK,KAAK,OAAO;AAAA,IACxB;AAIA,SAAK,QAAQ,MAAM;AACjB,WAAK,KAAK,KAAK,EAAE;AAAA,IACnB;AAIA,SAAK,OAAO,MAAM;AAChB,YAAM,iBAAiB,KAAK,KAAK,KAAK,KAAK,QAAQ;AACnD,YAAM,iBAAiB,KAAK,eAAe;AAAA,QACzC,CAAC,aAAa,aAAa,SAAS,WAAW;AAAA,QAC/C;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAKA,SAAK,mBAAmB,CAAC,kBAAkB;AACzC,WAAK,iBAAiB,CAAC,GAAG,KAAK,gBAAgB,aAAa;AAAA,IAC9D;AACA,SAAK,uBAAuB,UAAU;AACtC,SAAK,WAAW,SAAS,QAAQ,SAAS,SAAS,OAAO;AAAA,EAC5D;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
type EscapeOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* The delimiter that will be used to wrap the string (and so must be escaped
|
|
4
|
+
* when used within the string).
|
|
5
|
+
* Defaults to "
|
|
6
|
+
*/
|
|
7
|
+
delimiter?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The char to use to escape the delimiter and other special characters.
|
|
10
|
+
* Defaults to \
|
|
11
|
+
*/
|
|
12
|
+
escapeChar?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether newlines (\n and \r) should be escaped within the string.
|
|
15
|
+
* Defaults to true.
|
|
16
|
+
*/
|
|
17
|
+
escapeNewlines?: boolean;
|
|
18
|
+
};
|
|
1
19
|
/**
|
|
2
20
|
* Escape characters within a value to make it safe to insert directly into a
|
|
3
21
|
* snippet. Takes options which define the escape requirements.
|
|
@@ -9,7 +27,7 @@
|
|
|
9
27
|
* See https://tc39.es/ecma262/multipage/structured-data.html#sec-quotejsonstring
|
|
10
28
|
* for the complete original algorithm.
|
|
11
29
|
*/
|
|
12
|
-
export declare function escapeString(rawValue:
|
|
30
|
+
export declare function escapeString(rawValue: string, options?: EscapeOptions): string;
|
|
13
31
|
/**
|
|
14
32
|
* Make a string value safe to insert literally into a snippet within single quotes,
|
|
15
33
|
* by escaping problematic characters, including single quotes inside the string,
|
|
@@ -17,7 +35,7 @@ export declare function escapeString(rawValue: any, options?: {}): string;
|
|
|
17
35
|
*
|
|
18
36
|
* If value is not a string, it will be stringified with .toString() first.
|
|
19
37
|
*/
|
|
20
|
-
export declare const escapeForSingleQuotes: (value:
|
|
38
|
+
export declare const escapeForSingleQuotes: (value: string) => string;
|
|
21
39
|
/**
|
|
22
40
|
* Make a string value safe to insert literally into a snippet within double quotes,
|
|
23
41
|
* by escaping problematic characters, including double quotes inside the string,
|
|
@@ -25,5 +43,6 @@ export declare const escapeForSingleQuotes: (value: any) => string;
|
|
|
25
43
|
*
|
|
26
44
|
* If value is not a string, it will be stringified with .toString() first.
|
|
27
45
|
*/
|
|
28
|
-
export declare const escapeForDoubleQuotes: (value:
|
|
46
|
+
export declare const escapeForDoubleQuotes: (value: string) => string;
|
|
47
|
+
export {};
|
|
29
48
|
//# sourceMappingURL=escape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/escape.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,UA0CzE;AACD;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,KAAG,MAAiD,CAAA;AACvG;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,KAAG,MAAiD,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/httpsnippet-lite/helpers/escape.ts"],
|
|
4
|
+
"sourcesContent": ["type EscapeOptions = {\n /**\n * The delimiter that will be used to wrap the string (and so must be escaped\n * when used within the string).\n * Defaults to \"\n */\n delimiter?: string\n /**\n * The char to use to escape the delimiter and other special characters.\n * Defaults to \\\n */\n escapeChar?: string\n /**\n * Whether newlines (\\n and \\r) should be escaped within the string.\n * Defaults to true.\n */\n escapeNewlines?: boolean\n}\n\n/**\n * Escape characters within a value to make it safe to insert directly into a\n * snippet. Takes options which define the escape requirements.\n *\n * This is closely based on the JSON-stringify string serialization algorithm,\n * but generalized for other string delimiters (e.g. \" or ') and different escape\n * characters (e.g. Powershell uses `)\n *\n * See https://tc39.es/ecma262/multipage/structured-data.html#sec-quotejsonstring\n * for the complete original algorithm.\n */\nexport function escapeString(rawValue: string, options: EscapeOptions = {}) {\n const { delimiter = '\"', escapeChar = '\\\\', escapeNewlines = true } = options\n const stringValue = rawValue.toString()\n return [...stringValue]\n .map((c) => {\n if (c === '\\b') {\n return `${escapeChar}b`\n }\n if (c === '\\t') {\n return `${escapeChar}t`\n }\n if (c === '\\n') {\n if (escapeNewlines) {\n return `${escapeChar}n`\n }\n return c // Don't just continue, or this is caught by < \\u0020\n }\n if (c === '\\f') {\n return `${escapeChar}f`\n }\n if (c === '\\r') {\n if (escapeNewlines) {\n return `${escapeChar}r`\n }\n return c // Don't just continue, or this is caught by < \\u0020\n }\n if (c === escapeChar) {\n return escapeChar + escapeChar\n }\n if (c === delimiter) {\n return escapeChar + delimiter\n }\n if (c < '\\u0020' || c > '\\u007E') {\n // Delegate the trickier non-ASCII cases to the normal algorithm. Some of these\n // are escaped as \\uXXXX, whilst others are represented literally. Since we're\n // using this primarily for header values that are generally (though not 100%\n // strictly?) ASCII-only, this should almost never happen.\n return JSON.stringify(c).slice(1, -1)\n }\n return c\n })\n .join('')\n}\n/**\n * Make a string value safe to insert literally into a snippet within single quotes,\n * by escaping problematic characters, including single quotes inside the string,\n * backslashes, newlines, and other special characters.\n *\n * If value is not a string, it will be stringified with .toString() first.\n */\nexport const escapeForSingleQuotes = (value: string): string => escapeString(value, { delimiter: \"'\" })\n/**\n * Make a string value safe to insert literally into a snippet within double quotes,\n * by escaping problematic characters, including double quotes inside the string,\n * backslashes, newlines, and other special characters.\n *\n * If value is not a string, it will be stringified with .toString() first.\n */\nexport const escapeForDoubleQuotes = (value: string): string => escapeString(value, { delimiter: '\"' })\n"],
|
|
5
|
+
"mappings": "AA8BO,SAAS,aAAa,UAAkB,UAAyB,CAAC,GAAG;AAC1E,QAAM,EAAE,YAAY,KAAK,aAAa,MAAM,iBAAiB,KAAK,IAAI;AACtE,QAAM,cAAc,SAAS,SAAS;AACtC,SAAO,CAAC,GAAG,WAAW,EACnB,IAAI,CAAC,MAAM;AACV,QAAI,MAAM,MAAM;AACd,aAAO,GAAG,UAAU;AAAA,IACtB;AACA,QAAI,MAAM,KAAM;AACd,aAAO,GAAG,UAAU;AAAA,IACtB;AACA,QAAI,MAAM,MAAM;AACd,UAAI,gBAAgB;AAClB,eAAO,GAAG,UAAU;AAAA,MACtB;AACA,aAAO;AAAA,IACT;AACA,QAAI,MAAM,MAAM;AACd,aAAO,GAAG,UAAU;AAAA,IACtB;AACA,QAAI,MAAM,MAAM;AACd,UAAI,gBAAgB;AAClB,eAAO,GAAG,UAAU;AAAA,MACtB;AACA,aAAO;AAAA,IACT;AACA,QAAI,MAAM,YAAY;AACpB,aAAO,aAAa;AAAA,IACtB;AACA,QAAI,MAAM,WAAW;AACnB,aAAO,aAAa;AAAA,IACtB;AACA,QAAI,IAAI,OAAY,IAAI,KAAU;AAKhC,aAAO,KAAK,UAAU,CAAC,EAAE,MAAM,GAAG,EAAE;AAAA,IACtC;AACA,WAAO;AAAA,EACT,CAAC,EACA,KAAK,EAAE;AACZ;AAQO,MAAM,wBAAwB,CAAC,UAA0B,aAAa,OAAO,EAAE,WAAW,IAAI,CAAC;AAQ/F,MAAM,wBAAwB,CAAC,UAA0B,aAAa,OAAO,EAAE,WAAW,IAAI,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type Headers<T> = Record<string, T>;
|
|
2
|
+
/**
|
|
3
|
+
* Given a headers object retrieve a specific header out of it via a case-insensitive key.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getHeaderName: <T>(headers: Headers<T>, name: string) => string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Given a headers object retrieve the contents of a header out of it via a case-insensitive key.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getHeader: <T>(headers: Headers<T>, name: string) => T;
|
|
10
|
+
/**
|
|
11
|
+
* Determine if a given case-insensitive header exists within a header object.
|
|
12
|
+
*/
|
|
13
|
+
export declare const hasHeader: <T>(headers: Headers<T>, name: string) => boolean;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=headers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/headers.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAEnC;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,MAAM,KAAG,MAAM,GAAG,SACM,CAAA;AAEpF;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,MAAM,KAAG,CAMhE,CAAA;AACD;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,MAAM,KAAG,OAAgD,CAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
const getHeaderName = (headers, name) => Object.keys(headers).find(
|
|
2
|
-
(header) => header.toLowerCase() === name.toLowerCase()
|
|
3
|
-
);
|
|
1
|
+
const getHeaderName = (headers, name) => Object.keys(headers).find((header) => header.toLowerCase() === name.toLowerCase());
|
|
4
2
|
const getHeader = (headers, name) => {
|
|
5
3
|
const headerName = getHeaderName(headers, name);
|
|
6
4
|
if (!headerName) {
|
|
@@ -9,18 +7,9 @@ const getHeader = (headers, name) => {
|
|
|
9
7
|
return headers[headerName];
|
|
10
8
|
};
|
|
11
9
|
const hasHeader = (headers, name) => Boolean(getHeaderName(headers, name));
|
|
12
|
-
const mimeTypeJson = [
|
|
13
|
-
"application/json",
|
|
14
|
-
"application/x-json",
|
|
15
|
-
"text/json",
|
|
16
|
-
"text/x-json",
|
|
17
|
-
"+json"
|
|
18
|
-
];
|
|
19
|
-
const isMimeTypeJSON = (mimeType) => mimeTypeJson.some((type) => mimeType.includes(type));
|
|
20
10
|
export {
|
|
21
11
|
getHeader,
|
|
22
12
|
getHeaderName,
|
|
23
|
-
hasHeader
|
|
24
|
-
isMimeTypeJSON
|
|
13
|
+
hasHeader
|
|
25
14
|
};
|
|
26
15
|
//# sourceMappingURL=headers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/httpsnippet-lite/helpers/headers.ts"],
|
|
4
|
+
"sourcesContent": ["type Headers<T> = Record<string, T>\n\n/**\n * Given a headers object retrieve a specific header out of it via a case-insensitive key.\n */\nexport const getHeaderName = <T>(headers: Headers<T>, name: string): string | undefined =>\n Object.keys(headers).find((header) => header.toLowerCase() === name.toLowerCase())\n\n/**\n * Given a headers object retrieve the contents of a header out of it via a case-insensitive key.\n */\nexport const getHeader = <T>(headers: Headers<T>, name: string): T => {\n const headerName = getHeaderName(headers, name)\n if (!headerName) {\n return undefined as T\n }\n return headers[headerName] as T\n}\n/**\n * Determine if a given case-insensitive header exists within a header object.\n */\nexport const hasHeader = <T>(headers: Headers<T>, name: string): boolean => Boolean(getHeaderName(headers, name))\n"],
|
|
5
|
+
"mappings": "AAKO,MAAM,gBAAgB,CAAI,SAAqB,SACpD,OAAO,KAAK,OAAO,EAAE,KAAK,CAAC,WAAW,OAAO,YAAY,MAAM,KAAK,YAAY,CAAC;AAK5E,MAAM,YAAY,CAAI,SAAqB,SAAoB;AACpE,QAAM,aAAa,cAAc,SAAS,IAAI;AAC9C,MAAI,CAAC,YAAY;AACf,WAAO;AAAA,EACT;AACA,SAAO,QAAQ,UAAU;AAC3B;AAIO,MAAM,YAAY,CAAI,SAAqB,SAA0B,QAAQ,cAAc,SAAS,IAAI,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/reducer.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=reducer.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Use 'strong quoting' using single quotes so that we only need to deal with nested single quote characters.
|
|
3
3
|
* see: http://wiki.bash-hackers.org/syntax/quoting#strong_quoting
|
|
4
4
|
*/
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
5
|
+
export declare const shellQuote: (value?: string) => string;
|
|
6
|
+
export declare const shellEscape: (value: string) => string;
|
|
7
7
|
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/shell.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,cAAU,KAAG,MAQvC,CAAA;AACD,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,MAA2D,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const shellQuote = (value = "") => {
|
|
2
2
|
const safe = /^[a-z0-9-_/.@%^=:]+$/i;
|
|
3
3
|
const isShellSafe = safe.test(value);
|
|
4
4
|
if (isShellSafe) {
|
|
@@ -6,9 +6,9 @@ const quote = (value = "") => {
|
|
|
6
6
|
}
|
|
7
7
|
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
8
8
|
};
|
|
9
|
-
const
|
|
9
|
+
const shellEscape = (value) => value.replace(/\r/g, "\\r").replace(/\n/g, "\\n");
|
|
10
10
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
shellEscape,
|
|
12
|
+
shellQuote
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=shell.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/httpsnippet-lite/helpers/shell.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Use 'strong quoting' using single quotes so that we only need to deal with nested single quote characters.\n * see: http://wiki.bash-hackers.org/syntax/quoting#strong_quoting\n */\nexport const shellQuote = (value = ''): string => {\n const safe = /^[a-z0-9-_/.@%^=:]+$/i\n const isShellSafe = safe.test(value)\n if (isShellSafe) {\n return value\n }\n // if the value is not shell safe, then quote it\n return `'${value.replace(/'/g, \"'\\\\''\")}'`\n}\nexport const shellEscape = (value: string): string => value.replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n')\n"],
|
|
5
|
+
"mappings": "AAIO,MAAM,aAAa,CAAC,QAAQ,OAAe;AAChD,QAAM,OAAO;AACb,QAAM,cAAc,KAAK,KAAK,KAAK;AACnC,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,MAAM,QAAQ,MAAM,OAAO,CAAC;AACzC;AACO,MAAM,cAAc,CAAC,UAA0B,MAAM,QAAQ,OAAO,KAAK,EAAE,QAAQ,OAAO,KAAK;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { HarRequest as NpmHarRequest, FormDataParam as Param, PostDataCommon } from '@scalar/types/snippetz';
|
|
2
|
+
import type { ReducedHelperObject } from '../../httpsnippet-lite/helpers/reducer.js';
|
|
3
|
+
import type { ExtendedURL } from '../../httpsnippet-lite/helpers/url.js';
|
|
4
|
+
/**
|
|
5
|
+
* is this wrong? yes. according to the spec (http://www.softwareishard.com/blog/har-12-spec/#postData) it's technically wrong since `params` and `text` are (by the spec) mutually exclusive. However, in practice, this is not what is often the case.
|
|
6
|
+
*
|
|
7
|
+
* In general, this library takes a _descriptive_ rather than _perscriptive_ approach (see https://amyrey.web.unc.edu/classes/ling-101-online/tutorials/understanding-prescriptive-vs-descriptive-grammar/).
|
|
8
|
+
*
|
|
9
|
+
* Then, in addition to that, it really adds to complexity with TypeScript (TypeScript takes this constraint very very seriously) in a way that's not actually super useful. So, we treat this object as though it could have both or either of `params` and/or `text`.
|
|
10
|
+
*/
|
|
11
|
+
type PostDataBase = PostDataCommon & {
|
|
12
|
+
text?: string;
|
|
13
|
+
params?: Param[];
|
|
14
|
+
};
|
|
15
|
+
type HarRequest = Omit<NpmHarRequest, 'postData'> & {
|
|
16
|
+
postData?: PostDataBase;
|
|
17
|
+
};
|
|
18
|
+
type RequestExtras = {
|
|
19
|
+
postData?: PostDataBase & {
|
|
20
|
+
jsonObj?: ReducedHelperObject;
|
|
21
|
+
paramsObj?: ReducedHelperObject;
|
|
22
|
+
boundary?: string;
|
|
23
|
+
};
|
|
24
|
+
fullUrl: string;
|
|
25
|
+
queryObj: ReducedHelperObject;
|
|
26
|
+
headersObj: ReducedHelperObject;
|
|
27
|
+
uriObj: ExtendedURL;
|
|
28
|
+
cookiesObj: ReducedHelperObject;
|
|
29
|
+
allHeaders: ReducedHelperObject;
|
|
30
|
+
};
|
|
31
|
+
export type SnippetRequest = HarRequest & RequestExtras;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=snippet-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippet-request.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/snippet-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,aAAa,EAAE,aAAa,IAAI,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEjH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAEjE;;;;;;GAMG;AACH,KAAK,YAAY,GAAG,cAAc,GAAG;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;CACjB,CAAA;AACD,KAAK,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,GAAG;IAClD,QAAQ,CAAC,EAAE,YAAY,CAAA;CACxB,CAAA;AACD,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,EAAE,YAAY,GAAG;QACxB,OAAO,CAAC,EAAE,mBAAmB,CAAA;QAC7B,SAAS,CAAC,EAAE,mBAAmB,CAAA;QAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,UAAU,EAAE,mBAAmB,CAAA;IAC/B,MAAM,EAAE,WAAW,CAAA;IACnB,UAAU,EAAE,mBAAmB,CAAA;IAC/B,UAAU,EAAE,mBAAmB,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=snippet-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/httpsnippet-lite/helpers/url.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAY,SAAQ,GAAG;IAClC,IAAI,IAAI,WAEP;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/httpsnippet-lite/helpers/url.ts"],
|
|
4
|
+
"sourcesContent": ["export class ExtendedURL extends URL {\n get path() {\n return this.pathname + this.search\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAO,MAAM,oBAAoB,IAAI;AAAA,EACnC,IAAI,OAAO;AACT,WAAO,KAAK,WAAW,KAAK;AAAA,EAC9B;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/targets/c/libcurl/client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAG/D,eAAO,MAAM,OAAO,EAAE,MAkErB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { CodeBuilder } from "../../../../httpsnippet-lite/helpers/code-builder.js";
|
|
2
|
+
import { escapeForDoubleQuotes } from "../../../../httpsnippet-lite/helpers/escape.js";
|
|
3
|
+
import { createSearchParams } from "../../../../libs/http.js";
|
|
4
4
|
const libcurl = {
|
|
5
5
|
info: {
|
|
6
6
|
key: "libcurl",
|
|
@@ -12,9 +12,7 @@ const libcurl = {
|
|
|
12
12
|
const { push, blank, join } = new CodeBuilder({ indent: " " });
|
|
13
13
|
push("CURL *hnd = curl_easy_init();");
|
|
14
14
|
blank();
|
|
15
|
-
push(
|
|
16
|
-
`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${method.toUpperCase()}");`
|
|
17
|
-
);
|
|
15
|
+
push(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${method.toUpperCase()}");`);
|
|
18
16
|
push(`curl_easy_setopt(hnd, CURLOPT_URL, "${fullUrl}");`);
|
|
19
17
|
const headers = Object.keys(headersObj);
|
|
20
18
|
if (headers.length) {
|
|
@@ -38,19 +36,15 @@ const libcurl = {
|
|
|
38
36
|
if (postData !== null && postData !== void 0) {
|
|
39
37
|
blank();
|
|
40
38
|
if (postData.text) {
|
|
41
|
-
push(
|
|
42
|
-
`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(postData.text)});`
|
|
43
|
-
);
|
|
39
|
+
push(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(postData.text)});`);
|
|
44
40
|
} else if (postData.mimeType === "application/x-www-form-urlencoded" && postData.params) {
|
|
45
|
-
push(
|
|
46
|
-
`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "${createSearchParams(postData.params).toString()}");`
|
|
47
|
-
);
|
|
41
|
+
push(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "${createSearchParams(postData.params).toString()}");`);
|
|
48
42
|
} else if (postData.mimeType === "multipart/form-data" && postData.params) {
|
|
49
43
|
push("curl_mime *mime = curl_mime_init(hnd);");
|
|
50
44
|
postData.params.forEach((param) => {
|
|
51
45
|
blank();
|
|
52
46
|
push("{");
|
|
53
|
-
push(
|
|
47
|
+
push("curl_mimepart *part = curl_mime_addpart(mime);", 1);
|
|
54
48
|
if (param.name) {
|
|
55
49
|
push(`curl_mime_name(part, "${param.name}");`, 1);
|
|
56
50
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/httpsnippet-lite/targets/c/libcurl/client.ts"],
|
|
4
|
+
"sourcesContent": ["import { CodeBuilder } from '@/httpsnippet-lite/helpers/code-builder'\nimport { escapeForDoubleQuotes } from '@/httpsnippet-lite/helpers/escape'\nimport type { Client } from '@/httpsnippet-lite/targets/target'\nimport { createSearchParams } from '@/libs/http'\n\nexport const libcurl: Client = {\n info: {\n key: 'libcurl',\n title: 'Libcurl',\n link: 'http://curl.haxx.se/libcurl',\n description: 'Simple REST and HTTP API Client for C',\n },\n convert: ({ method, fullUrl, headersObj, allHeaders, postData }) => {\n const { push, blank, join } = new CodeBuilder({ indent: ' ' })\n push('CURL *hnd = curl_easy_init();')\n blank()\n push(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"${method.toUpperCase()}\");`)\n push(`curl_easy_setopt(hnd, CURLOPT_URL, \"${fullUrl}\");`)\n // Add headers, including the cookies\n const headers = Object.keys(headersObj)\n // construct headers\n if (headers.length) {\n blank()\n push('struct curl_slist *headers = NULL;')\n headers.forEach((header) => {\n // See https://curl.se/libcurl/c/httpcustomheader.html for syntax\n if (headersObj[header]) {\n push(\n `headers = curl_slist_append(headers, \"${header}: ${escapeForDoubleQuotes(headersObj[header] as string)}\");`,\n )\n } else {\n push(`headers = curl_slist_append(headers, \"${header};\");`)\n }\n })\n push('curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);')\n }\n // construct cookies\n if (allHeaders.cookie) {\n blank()\n push(`curl_easy_setopt(hnd, CURLOPT_COOKIE, \"${allHeaders.cookie}\");`)\n }\n if (postData !== null && postData !== void 0) {\n blank()\n if (postData.text) {\n push(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(postData.text)});`)\n } else if (postData.mimeType === 'application/x-www-form-urlencoded' && postData.params) {\n push(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"${createSearchParams(postData.params as never).toString()}\");`)\n } else if (postData.mimeType === 'multipart/form-data' && postData.params) {\n push('curl_mime *mime = curl_mime_init(hnd);')\n postData.params.forEach((param) => {\n blank()\n push('{')\n push('curl_mimepart *part = curl_mime_addpart(mime);', 1)\n if (param.name) {\n push(`curl_mime_name(part, \"${param.name}\");`, 1)\n }\n if (param.fileName) {\n push(`curl_mime_filedata(part, \"${param.fileName}\");`, 1)\n } else if (param.value) {\n push(`curl_mime_data(part, \"${escapeForDoubleQuotes(param.value)}\", CURL_ZERO_TERMINATED);`, 1)\n }\n push('}')\n })\n blank()\n push('curl_easy_setopt(hnd, CURLOPT_MIMEPOST, mime);')\n }\n }\n blank()\n push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S,QAAQ;AACzE,aAAK,wCAAwC;AAC7C,iBAAS,OAAO,QAAQ,CAAC,UAAU;AACjC,gBAAM;AACN,eAAK,GAAG;AACR,eAAK,kDAAkD,CAAC;AACxD,cAAI,MAAM,MAAM;AACd,iBAAK,yBAAyB,MAAM,IAAI,OAAO,CAAC;AAAA,UAClD;AACA,cAAI,MAAM,UAAU;AAClB,iBAAK,6BAA6B,MAAM,QAAQ,OAAO,CAAC;AAAA,UAC1D,WAAW,MAAM,OAAO;AACtB,iBAAK,yBAAyB,sBAAsB,MAAM,KAAK,CAAC,6BAA6B,CAAC;AAAA,UAChG;AACA,eAAK,GAAG;AAAA,QACV,CAAC;AACD,cAAM;AACN,aAAK,gDAAgD;AAAA,MACvD;AAAA,IACF;AACA,UAAM;AACN,SAAK,wCAAwC;AAC7C,WAAO,KAAK;AAAA,EACd;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description
|
|
3
|
+
* HTTP code snippet generator for Clojure using clj-http.
|
|
4
|
+
*
|
|
5
|
+
* @author
|
|
6
|
+
* @tggreene
|
|
7
|
+
*
|
|
8
|
+
* for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
|
|
9
|
+
*/
|
|
10
|
+
import type { Client } from '../../../../httpsnippet-lite/targets/target.js';
|
|
11
|
+
export declare const clj_http: Client;
|
|
12
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/targets/clojure/clj_http/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAgF/D,eAAO,MAAM,QAAQ,EAAE,MAuGtB,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { CodeBuilder } from "
|
|
2
|
-
import { getHeader, getHeaderName } from "
|
|
1
|
+
import { CodeBuilder } from "../../../../httpsnippet-lite/helpers/code-builder.js";
|
|
2
|
+
import { getHeader, getHeaderName } from "../../../../httpsnippet-lite/helpers/headers.js";
|
|
3
3
|
class Keyword {
|
|
4
|
+
name;
|
|
5
|
+
toString;
|
|
4
6
|
constructor(name) {
|
|
5
7
|
this.name = "";
|
|
6
8
|
this.toString = () => `:${this.name}`;
|
|
@@ -8,6 +10,8 @@ class Keyword {
|
|
|
8
10
|
}
|
|
9
11
|
}
|
|
10
12
|
class File {
|
|
13
|
+
path;
|
|
14
|
+
toString;
|
|
11
15
|
constructor(path) {
|
|
12
16
|
this.path = "";
|
|
13
17
|
this.toString = () => `(clojure.java.io/file "${this.path}")`;
|
|
@@ -122,7 +126,7 @@ const clj_http = {
|
|
|
122
126
|
}
|
|
123
127
|
break;
|
|
124
128
|
case "multipart/form-data": {
|
|
125
|
-
if (postData
|
|
129
|
+
if (postData?.params) {
|
|
126
130
|
params.multipart = postData.params.map((param) => {
|
|
127
131
|
if (param.fileName && !param.value) {
|
|
128
132
|
return {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/httpsnippet-lite/targets/clojure/clj_http/client.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @description\n * HTTP code snippet generator for Clojure using clj-http.\n *\n * @author\n * @tggreene\n *\n * for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.\n */\n\nimport { CodeBuilder } from '@/httpsnippet-lite/helpers/code-builder'\nimport { getHeader, getHeaderName } from '@/httpsnippet-lite/helpers/headers'\nimport type { ReducedHelperObject } from '@/httpsnippet-lite/helpers/reducer'\nimport type { Client } from '@/httpsnippet-lite/targets/target'\n\nclass Keyword {\n name: string\n toString: () => string\n\n constructor(name: string) {\n this.name = ''\n this.toString = () => `:${this.name}`\n this.name = name\n }\n}\nclass File {\n path: string\n toString: () => string\n\n constructor(path: string) {\n this.path = ''\n this.toString = () => `(clojure.java.io/file \"${this.path}\")`\n this.path = path\n }\n}\nconst jsType = (input: unknown): string | null => {\n if (input === undefined) {\n return null\n }\n if (input === null) {\n return 'null'\n }\n return input.constructor.name.toLowerCase()\n}\nconst objEmpty = (input: unknown): boolean => {\n if (jsType(input) === 'object') {\n return Object.keys(input as {}).length === 0\n }\n return false\n}\nconst filterEmpty = (input: Record<string, unknown>) => {\n Object.keys(input)\n .filter((x) => objEmpty(input[x]))\n .forEach((x) => {\n delete input[x]\n })\n return input\n}\nconst padBlock = (padSize: number, input: string): string => {\n const padding = ' '.repeat(padSize)\n return input.replace(/\\n/g, `\\n${padding}`)\n}\nconst jsToEdn = (js: any) => {\n switch (jsType(js)) {\n case 'string':\n return `\"${js.replace(/\"/g, '\\\\\"')}\"`\n case 'file':\n return js.toString()\n case 'keyword':\n return js.toString()\n case 'null':\n return 'nil'\n case 'regexp':\n return `#\"${js.source}\"`\n case 'object': {\n // simple vertical format\n const obj = Object.keys(js)\n .reduce((accumulator, key) => {\n const val = padBlock(key.length + 2, jsToEdn(js[key]))\n return `${accumulator}:${key} ${val}\\n `\n }, '')\n .trim()\n return `{${padBlock(1, obj)}}`\n }\n case 'array': {\n // simple horizontal format\n const arr = js.reduce((accumulator: string, value: any) => `${accumulator} ${jsToEdn(value)}`, '').trim()\n return `[${padBlock(1, arr)}]`\n }\n default: // 'number' 'boolean'\n return js.toString()\n }\n}\nexport const clj_http: Client = {\n info: {\n key: 'clj_http',\n title: 'clj-http',\n link: 'https://github.com/dakrone/clj-http',\n description: 'An idiomatic clojure http client wrapping the apache client.',\n },\n convert: ({ queryObj, method, postData, url, allHeaders }, options) => {\n const { push, join } = new CodeBuilder({\n indent: options === null || options === void 0 ? void 0 : options.indent,\n })\n const methods = ['get', 'post', 'put', 'delete', 'patch', 'head', 'options']\n method = method.toLowerCase()\n if (!methods.includes(method)) {\n push('Method not supported')\n return join()\n }\n const params: {\n 'headers': ReducedHelperObject\n 'query-params': ReducedHelperObject\n [key: string]: unknown\n } = {\n 'headers': allHeaders,\n 'query-params': queryObj,\n }\n\n // Remove query string from URL if queryObj has parameters\n if (queryObj && Object.keys(queryObj).length > 0) {\n url = url.split('?')[0]!\n }\n\n switch (postData === null || postData === void 0 ? void 0 : postData.mimeType) {\n case 'application/json':\n {\n params['content-type'] = new Keyword('json')\n params['form-params'] = postData!.jsonObj\n const header = getHeaderName(params.headers, 'content-type')\n if (header) {\n delete params.headers[header]\n }\n }\n break\n case 'application/x-www-form-urlencoded':\n {\n params['form-params'] = postData!.paramsObj\n const header = getHeaderName(params.headers, 'content-type')\n if (header) {\n delete params.headers[header]\n }\n }\n break\n case 'text/plain':\n {\n params.body = postData!.text\n const header = getHeaderName(params.headers, 'content-type')\n if (header) {\n delete params.headers[header]\n }\n }\n break\n case 'multipart/form-data': {\n if (postData?.params) {\n params.multipart = postData.params.map((param) => {\n if (param.fileName && !param.value) {\n return {\n name: param.name,\n content: new File(param.fileName),\n }\n }\n return {\n name: param.name,\n content: param.value,\n }\n })\n const header = getHeaderName(params.headers as Record<string, unknown>, 'content-type')\n if (header) {\n delete params.headers[header]\n }\n }\n break\n }\n }\n switch (getHeader(params.headers as Record<string, unknown>, 'accept')) {\n case 'application/json':\n {\n params.accept = new Keyword('json')\n const header = getHeaderName(params.headers as Record<string, unknown>, 'accept')\n if (header) {\n delete params.headers[header]\n }\n }\n break\n }\n push(\"(require '[clj-http.client :as client])\\n\")\n if (objEmpty(filterEmpty(params))) {\n push(`(client/${method} \"${url}\")`)\n } else {\n const padding = 11 + method.length + url.length\n const formattedParams = padBlock(padding, jsToEdn(filterEmpty(params)))\n push(`(client/${method} \"${url}\" ${formattedParams})`)\n }\n return join()\n },\n}\n"],
|
|
5
|
+
"mappings": "AAUA,SAAS,mBAAmB;AAC5B,SAAS,WAAW,qBAAqB;AAIzC,MAAM,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,EAEA,YAAY,MAAc;AACxB,SAAK,OAAO;AACZ,SA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ACF;AACA;AAAA,IACJ;AACA,SAAK,2CAA2C;AAChD,QAAI,SAAS,YAAY,MAAM,CAAC,GAAG;AACjC,WAAK,WAAW,MAAM,KAAK,GAAG,IAAI;AAAA,IACpC,OAAO;AACL,YAAM,UAAU,KAAK,OAAO,SAAS,IAAI;AACzC,YAAM,kBAAkB,SAAS,SAAS,QAAQ,YAAY,MAAM,CAAC,CAAC;AACtE,WAAK,WAAW,MAAM,KAAK,GAAG,KAAK,eAAe,GAAG;AAAA,IACvD;AACA,WAAO,KAAK;AAAA,EACd;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/targets/csharp/restsharp/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAE/D,eAAO,MAAM,SAAS,EAAE,MAkCvB,CAAA"}
|