@scalar/snippetz 0.2.19 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clients.js +153 -155
- package/dist/clients.js.map +7 -0
- package/dist/httpsnippet-lite/esm/helpers/code-builder.js +44 -59
- package/dist/httpsnippet-lite/esm/helpers/code-builder.js.map +7 -0
- package/dist/httpsnippet-lite/esm/helpers/escape.js +41 -69
- package/dist/httpsnippet-lite/esm/helpers/escape.js.map +7 -0
- package/dist/httpsnippet-lite/esm/helpers/form-data.js +59 -0
- package/dist/httpsnippet-lite/esm/helpers/form-data.js.map +7 -0
- package/dist/httpsnippet-lite/esm/helpers/headers.js +23 -18
- package/dist/httpsnippet-lite/esm/helpers/headers.js.map +7 -0
- package/dist/httpsnippet-lite/esm/helpers/reducer.js +20 -0
- package/dist/httpsnippet-lite/esm/helpers/reducer.js.map +7 -0
- package/dist/httpsnippet-lite/esm/helpers/shell.js +13 -16
- package/dist/httpsnippet-lite/esm/helpers/shell.js.map +7 -0
- package/dist/httpsnippet-lite/esm/helpers/url.js +20 -0
- package/dist/httpsnippet-lite/esm/helpers/url.js.map +7 -0
- package/dist/httpsnippet-lite/esm/helpers/utils.js +16 -0
- package/dist/httpsnippet-lite/esm/helpers/utils.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.d.ts.map +1 -1
- package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.js +72 -40
- package/dist/httpsnippet-lite/esm/targets/c/libcurl/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/c/target.js +16 -0
- package/dist/httpsnippet-lite/esm/targets/c/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.js +149 -166
- package/dist/httpsnippet-lite/esm/targets/clojure/clj_http/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/clojure/target.js +16 -0
- package/dist/httpsnippet-lite/esm/targets/clojure/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/csharp/httpclient/client.js +165 -161
- package/dist/httpsnippet-lite/esm/targets/csharp/httpclient/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.js +47 -46
- package/dist/httpsnippet-lite/esm/targets/csharp/restsharp/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/csharp/target.js +18 -0
- package/dist/httpsnippet-lite/esm/targets/csharp/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/go/native/client.d.ts.map +1 -1
- package/dist/httpsnippet-lite/esm/targets/go/native/client.js +167 -116
- package/dist/httpsnippet-lite/esm/targets/go/native/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/go/target.js +16 -0
- package/dist/httpsnippet-lite/esm/targets/go/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.js +37 -44
- package/dist/httpsnippet-lite/esm/targets/java/asynchttp/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.js +41 -43
- package/dist/httpsnippet-lite/esm/targets/java/nethttp/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.d.ts.map +1 -1
- package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.js +75 -67
- package/dist/httpsnippet-lite/esm/targets/java/okhttp/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/java/target.js +22 -0
- package/dist/httpsnippet-lite/esm/targets/java/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/java/unirest/client.js +37 -44
- package/dist/httpsnippet-lite/esm/targets/java/unirest/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.js +79 -84
- package/dist/httpsnippet-lite/esm/targets/javascript/axios/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.js +76 -83
- package/dist/httpsnippet-lite/esm/targets/javascript/jquery/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/javascript/target.js +22 -0
- package/dist/httpsnippet-lite/esm/targets/javascript/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.js +78 -79
- package/dist/httpsnippet-lite/esm/targets/javascript/xhr/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.d.ts.map +1 -1
- package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.js +75 -67
- package/dist/httpsnippet-lite/esm/targets/kotlin/okhttp/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/kotlin/target.js +16 -0
- package/dist/httpsnippet-lite/esm/targets/kotlin/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/node/axios/client.js +70 -77
- package/dist/httpsnippet-lite/esm/targets/node/axios/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/node/request/client.js +100 -0
- package/dist/httpsnippet-lite/esm/targets/node/request/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/node/target.js +24 -0
- package/dist/httpsnippet-lite/esm/targets/node/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/objc/helpers.js +36 -52
- package/dist/httpsnippet-lite/esm/targets/objc/helpers.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.js +157 -128
- package/dist/httpsnippet-lite/esm/targets/objc/nsurlsession/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/objc/target.js +16 -0
- package/dist/httpsnippet-lite/esm/targets/objc/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.js +50 -65
- package/dist/httpsnippet-lite/esm/targets/ocaml/cohttp/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/ocaml/target.js +16 -0
- package/dist/httpsnippet-lite/esm/targets/ocaml/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/php/helpers.js +72 -0
- package/dist/httpsnippet-lite/esm/targets/php/helpers.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/php/http1/client.js +85 -0
- package/dist/httpsnippet-lite/esm/targets/php/http1/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/php/http2/client.js +127 -0
- package/dist/httpsnippet-lite/esm/targets/php/http2/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/php/target.js +22 -0
- package/dist/httpsnippet-lite/esm/targets/php/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/powershell/common.js +61 -49
- package/dist/httpsnippet-lite/esm/targets/powershell/common.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.js +12 -12
- package/dist/httpsnippet-lite/esm/targets/powershell/restmethod/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/powershell/target.js +18 -0
- package/dist/httpsnippet-lite/esm/targets/powershell/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.js +12 -12
- package/dist/httpsnippet-lite/esm/targets/powershell/webrequest/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/python/helpers.js +68 -0
- package/dist/httpsnippet-lite/esm/targets/python/helpers.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/python/python3/client.js +71 -90
- package/dist/httpsnippet-lite/esm/targets/python/python3/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/python/target.js +16 -0
- package/dist/httpsnippet-lite/esm/targets/python/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/r/httr/client.js +99 -124
- package/dist/httpsnippet-lite/esm/targets/r/httr/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/r/target.js +16 -0
- package/dist/httpsnippet-lite/esm/targets/r/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/ruby/native/client.js +69 -69
- package/dist/httpsnippet-lite/esm/targets/ruby/native/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/ruby/target.js +16 -0
- package/dist/httpsnippet-lite/esm/targets/ruby/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.d.ts.map +1 -1
- package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.js +106 -113
- package/dist/httpsnippet-lite/esm/targets/shell/httpie/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/shell/target.js +20 -0
- package/dist/httpsnippet-lite/esm/targets/shell/target.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/shell/wget/client.js +42 -51
- package/dist/httpsnippet-lite/esm/targets/shell/wget/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/swift/helpers.js +51 -67
- package/dist/httpsnippet-lite/esm/targets/swift/helpers.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.js +132 -133
- package/dist/httpsnippet-lite/esm/targets/swift/nsurlsession/client.js.map +7 -0
- package/dist/httpsnippet-lite/esm/targets/swift/target.js +16 -0
- package/dist/httpsnippet-lite/esm/targets/swift/target.js.map +7 -0
- package/dist/httpsnippet-lite/types/helpers/code-builder.d.js +1 -0
- package/dist/httpsnippet-lite/types/helpers/code-builder.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/helpers/escape.d.js +1 -0
- package/dist/httpsnippet-lite/types/helpers/escape.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/helpers/form-data.d.js +28 -0
- package/dist/httpsnippet-lite/types/helpers/form-data.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/helpers/headers.d.js +1 -0
- package/dist/httpsnippet-lite/types/helpers/headers.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/helpers/reducer.d.js +1 -0
- package/dist/httpsnippet-lite/types/helpers/reducer.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/helpers/shell.d.js +1 -0
- package/dist/httpsnippet-lite/types/helpers/shell.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/helpers/url.d.js +1 -0
- package/dist/httpsnippet-lite/types/helpers/url.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/helpers/utils.d.js +1 -0
- package/dist/httpsnippet-lite/types/helpers/utils.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/httpsnippet.d.js +19 -0
- package/dist/httpsnippet-lite/types/httpsnippet.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/c/libcurl/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/c/libcurl/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/c/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/c/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/clojure/clj_http/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/clojure/clj_http/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/clojure/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/clojure/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/csharp/httpclient/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/csharp/httpclient/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/csharp/restsharp/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/csharp/restsharp/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/csharp/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/csharp/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/dart/http/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/dart/http/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/dart/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/dart/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/go/native/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/go/native/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/go/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/go/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/http/http1.1/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/http/http1.1/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/http/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/http/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/java/asynchttp/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/java/asynchttp/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/java/nethttp/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/java/nethttp/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/java/okhttp/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/java/okhttp/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/java/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/java/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/java/unirest/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/java/unirest/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/javascript/axios/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/javascript/axios/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/javascript/fetch/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/javascript/fetch/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/javascript/jquery/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/javascript/jquery/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/javascript/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/javascript/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/javascript/xhr/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/javascript/xhr/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/kotlin/okhttp/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/kotlin/okhttp/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/kotlin/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/kotlin/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/node/axios/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/node/axios/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/node/fetch/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/node/fetch/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/node/native/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/node/native/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/node/request/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/node/request/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/node/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/node/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/node/unirest/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/node/unirest/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/objc/helpers.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/objc/helpers.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/objc/nsurlsession/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/objc/nsurlsession/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/objc/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/objc/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/ocaml/cohttp/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/ocaml/cohttp/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/ocaml/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/ocaml/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/php/curl/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/php/curl/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/php/guzzle/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/php/guzzle/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/php/helpers.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/php/helpers.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/php/http1/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/php/http1/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/php/http2/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/php/http2/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/php/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/php/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/powershell/common.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/powershell/common.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/powershell/restmethod/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/powershell/restmethod/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/powershell/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/powershell/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/powershell/webrequest/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/powershell/webrequest/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/python/helpers.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/python/helpers.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/python/python3/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/python/python3/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/python/requests/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/python/requests/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/python/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/python/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/r/httr/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/r/httr/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/r/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/r/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/ruby/native/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/ruby/native/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/ruby/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/ruby/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/shell/curl/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/shell/curl/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/shell/httpie/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/shell/httpie/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/shell/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/shell/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/shell/wget/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/shell/wget/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/swift/helpers.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/swift/helpers.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/swift/nsurlsession/client.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/swift/nsurlsession/client.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/swift/target.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/swift/target.d.js.map +7 -0
- package/dist/httpsnippet-lite/types/targets/targets.d.js +1 -0
- package/dist/httpsnippet-lite/types/targets/targets.d.js.map +7 -0
- package/dist/index.js +3 -2
- package/dist/index.js.map +7 -0
- package/dist/plugins/c/libcurl/index.js +2 -1
- package/dist/plugins/c/libcurl/index.js.map +7 -0
- package/dist/plugins/c/libcurl/libcurl.js +12 -15
- package/dist/plugins/c/libcurl/libcurl.js.map +7 -0
- package/dist/plugins/c/libcurl/libcurl.test.js +208 -0
- package/dist/plugins/c/libcurl/libcurl.test.js.map +7 -0
- package/dist/plugins/clojure/clj_http/clj_http.js +12 -15
- package/dist/plugins/clojure/clj_http/clj_http.js.map +7 -0
- package/dist/plugins/clojure/clj_http/clj_http.test.js +151 -0
- package/dist/plugins/clojure/clj_http/clj_http.test.js.map +7 -0
- package/dist/plugins/clojure/clj_http/index.js +2 -1
- package/dist/plugins/clojure/clj_http/index.js.map +7 -0
- package/dist/plugins/csharp/httpclient/httpclient.js +12 -15
- package/dist/plugins/csharp/httpclient/httpclient.js.map +7 -0
- package/dist/plugins/csharp/httpclient/index.js +2 -1
- package/dist/plugins/csharp/httpclient/index.js.map +7 -0
- package/dist/plugins/csharp/restsharp/index.js +2 -1
- package/dist/plugins/csharp/restsharp/index.js.map +7 -0
- package/dist/plugins/csharp/restsharp/restsharp.js +12 -15
- package/dist/plugins/csharp/restsharp/restsharp.js.map +7 -0
- package/dist/plugins/dart/http/http.js +92 -96
- package/dist/plugins/dart/http/http.js.map +7 -0
- package/dist/plugins/dart/http/http.test.js +550 -0
- package/dist/plugins/dart/http/http.test.js.map +7 -0
- package/dist/plugins/dart/http/index.js +2 -1
- package/dist/plugins/dart/http/index.js.map +7 -0
- package/dist/plugins/go/native/index.js +2 -1
- package/dist/plugins/go/native/index.js.map +7 -0
- package/dist/plugins/go/native/native.js +12 -15
- package/dist/plugins/go/native/native.js.map +7 -0
- package/dist/plugins/go/native/native.test.js +366 -0
- package/dist/plugins/go/native/native.test.js.map +7 -0
- package/dist/plugins/http/http11/http11.js +84 -104
- package/dist/plugins/http/http11/http11.js.map +7 -0
- package/dist/plugins/http/http11/http11.test.js +175 -0
- package/dist/plugins/http/http11/http11.test.js.map +7 -0
- package/dist/plugins/http/http11/index.js +2 -1
- package/dist/plugins/http/http11/index.js.map +7 -0
- package/dist/plugins/java/asynchttp/asynchttp.js +12 -15
- package/dist/plugins/java/asynchttp/asynchttp.js.map +7 -0
- package/dist/plugins/java/asynchttp/index.js +2 -1
- package/dist/plugins/java/asynchttp/index.js.map +7 -0
- package/dist/plugins/java/nethttp/index.js +2 -1
- package/dist/plugins/java/nethttp/index.js.map +7 -0
- package/dist/plugins/java/nethttp/nethttp.js +12 -15
- package/dist/plugins/java/nethttp/nethttp.js.map +7 -0
- package/dist/plugins/java/okhttp/index.js +2 -1
- package/dist/plugins/java/okhttp/index.js.map +7 -0
- package/dist/plugins/java/okhttp/okhttp.js +12 -15
- package/dist/plugins/java/okhttp/okhttp.js.map +7 -0
- package/dist/plugins/java/okhttp/okhttp.test.js +164 -0
- package/dist/plugins/java/okhttp/okhttp.test.js.map +7 -0
- package/dist/plugins/java/unirest/index.js +2 -1
- package/dist/plugins/java/unirest/index.js.map +7 -0
- package/dist/plugins/java/unirest/unirest.js +12 -15
- package/dist/plugins/java/unirest/unirest.js.map +7 -0
- package/dist/plugins/js/axios/axios.js +12 -15
- package/dist/plugins/js/axios/axios.js.map +7 -0
- package/dist/plugins/js/axios/index.d.ts +1 -1
- package/dist/plugins/js/axios/index.d.ts.map +1 -1
- package/dist/plugins/js/axios/index.js +5 -1
- package/dist/plugins/js/axios/index.js.map +7 -0
- package/dist/plugins/js/fetch/fetch.d.ts.map +1 -1
- package/dist/plugins/js/fetch/fetch.js +67 -60
- package/dist/plugins/js/fetch/fetch.js.map +7 -0
- package/dist/plugins/js/fetch/fetch.test.js +214 -0
- package/dist/plugins/js/fetch/fetch.test.js.map +7 -0
- package/dist/plugins/js/fetch/index.d.ts +1 -1
- package/dist/plugins/js/fetch/index.d.ts.map +1 -1
- package/dist/plugins/js/fetch/index.js +5 -1
- package/dist/plugins/js/fetch/index.js.map +7 -0
- package/dist/plugins/js/jquery/index.js +2 -1
- package/dist/plugins/js/jquery/index.js.map +7 -0
- package/dist/plugins/js/jquery/jquery.js +12 -15
- package/dist/plugins/js/jquery/jquery.js.map +7 -0
- package/dist/plugins/js/ofetch/index.js +2 -1
- package/dist/plugins/js/ofetch/index.js.map +7 -0
- package/dist/plugins/js/ofetch/ofetch.d.ts.map +1 -1
- package/dist/plugins/js/ofetch/ofetch.js +44 -67
- package/dist/plugins/js/ofetch/ofetch.js.map +7 -0
- package/dist/plugins/js/ofetch/ofetch.test.js +126 -0
- package/dist/plugins/js/ofetch/ofetch.test.js.map +7 -0
- package/dist/plugins/js/xhr/index.js +2 -1
- package/dist/plugins/js/xhr/index.js.map +7 -0
- package/dist/plugins/js/xhr/xhr.js +12 -15
- package/dist/plugins/js/xhr/xhr.js.map +7 -0
- package/dist/plugins/kotlin/okhttp/index.js +2 -1
- package/dist/plugins/kotlin/okhttp/index.js.map +7 -0
- package/dist/plugins/kotlin/okhttp/okhttp.js +12 -15
- package/dist/plugins/kotlin/okhttp/okhttp.js.map +7 -0
- package/dist/plugins/kotlin/okhttp/okhttp.test.js +164 -0
- package/dist/plugins/kotlin/okhttp/okhttp.test.js.map +7 -0
- package/dist/plugins/node/axios/axios.js +12 -15
- package/dist/plugins/node/axios/axios.js.map +7 -0
- package/dist/plugins/node/axios/index.js +2 -1
- package/dist/plugins/node/axios/index.js.map +7 -0
- package/dist/plugins/node/fetch/fetch.d.ts.map +1 -1
- package/dist/plugins/node/fetch/fetch.js +73 -59
- package/dist/plugins/node/fetch/fetch.js.map +7 -0
- package/dist/plugins/node/fetch/fetch.test.js +200 -0
- package/dist/plugins/node/fetch/fetch.test.js.map +7 -0
- package/dist/plugins/node/fetch/index.js +2 -1
- package/dist/plugins/node/fetch/index.js.map +7 -0
- package/dist/plugins/node/ofetch/index.js +2 -1
- package/dist/plugins/node/ofetch/index.js.map +7 -0
- package/dist/plugins/node/ofetch/ofetch.d.ts.map +1 -1
- package/dist/plugins/node/ofetch/ofetch.js +44 -67
- package/dist/plugins/node/ofetch/ofetch.js.map +7 -0
- package/dist/plugins/node/ofetch/ofetch.test.js +126 -0
- package/dist/plugins/node/ofetch/ofetch.test.js.map +7 -0
- package/dist/plugins/node/undici/index.js +2 -1
- package/dist/plugins/node/undici/index.js.map +7 -0
- package/dist/plugins/node/undici/undici.d.ts.map +1 -1
- package/dist/plugins/node/undici/undici.js +46 -62
- package/dist/plugins/node/undici/undici.js.map +7 -0
- package/dist/plugins/node/undici/undici.test.js +133 -0
- package/dist/plugins/node/undici/undici.test.js.map +7 -0
- package/dist/plugins/objc/nsurlsession/index.js +2 -1
- package/dist/plugins/objc/nsurlsession/index.js.map +7 -0
- package/dist/plugins/objc/nsurlsession/nsurlsession.js +12 -15
- package/dist/plugins/objc/nsurlsession/nsurlsession.js.map +7 -0
- package/dist/plugins/ocaml/cohttp/cohttp.js +12 -15
- package/dist/plugins/ocaml/cohttp/cohttp.js.map +7 -0
- package/dist/plugins/ocaml/cohttp/index.js +2 -1
- package/dist/plugins/ocaml/cohttp/index.js.map +7 -0
- package/dist/plugins/php/curl/curl.js +119 -157
- package/dist/plugins/php/curl/curl.js.map +7 -0
- package/dist/plugins/php/curl/curl.test.js +564 -0
- package/dist/plugins/php/curl/curl.test.js.map +7 -0
- package/dist/plugins/php/curl/index.js +2 -1
- package/dist/plugins/php/curl/index.js.map +7 -0
- package/dist/plugins/php/guzzle/guzzle.js +115 -148
- package/dist/plugins/php/guzzle/guzzle.js.map +7 -0
- package/dist/plugins/php/guzzle/guzzle.test.js +546 -0
- package/dist/plugins/php/guzzle/guzzle.test.js.map +7 -0
- package/dist/plugins/php/guzzle/index.js +2 -1
- package/dist/plugins/php/guzzle/index.js.map +7 -0
- package/dist/plugins/powershell/restmethod/index.js +2 -1
- package/dist/plugins/powershell/restmethod/index.js.map +7 -0
- package/dist/plugins/powershell/restmethod/restmethod.js +12 -15
- package/dist/plugins/powershell/restmethod/restmethod.js.map +7 -0
- package/dist/plugins/powershell/webrequest/index.js +2 -1
- package/dist/plugins/powershell/webrequest/index.js.map +7 -0
- package/dist/plugins/powershell/webrequest/webrequest.js +12 -15
- package/dist/plugins/powershell/webrequest/webrequest.js.map +7 -0
- package/dist/plugins/python/python3/index.js +2 -1
- package/dist/plugins/python/python3/index.js.map +7 -0
- package/dist/plugins/python/python3/python3.js +12 -15
- package/dist/plugins/python/python3/python3.js.map +7 -0
- package/dist/plugins/python/requests/index.js +2 -1
- package/dist/plugins/python/requests/index.js.map +7 -0
- package/dist/plugins/python/requests/requests.d.ts.map +1 -1
- package/dist/plugins/python/requests/requests.js +98 -126
- package/dist/plugins/python/requests/requests.js.map +7 -0
- package/dist/plugins/python/requests/requests.test.js +419 -0
- package/dist/plugins/python/requests/requests.test.js.map +7 -0
- package/dist/plugins/r/httr/httr.js +12 -15
- package/dist/plugins/r/httr/httr.js.map +7 -0
- package/dist/plugins/r/httr/index.js +2 -1
- package/dist/plugins/r/httr/index.js.map +7 -0
- package/dist/plugins/ruby/native/index.js +2 -1
- package/dist/plugins/ruby/native/index.js.map +7 -0
- package/dist/plugins/ruby/native/native.js +12 -15
- package/dist/plugins/ruby/native/native.js.map +7 -0
- package/dist/plugins/ruby/native/native.test.js +240 -0
- package/dist/plugins/ruby/native/native.test.js.map +7 -0
- package/dist/plugins/shell/curl/curl.js +81 -114
- package/dist/plugins/shell/curl/curl.js.map +7 -0
- package/dist/plugins/shell/curl/curl.test.js +427 -0
- package/dist/plugins/shell/curl/curl.test.js.map +7 -0
- package/dist/plugins/shell/curl/index.js +2 -1
- package/dist/plugins/shell/curl/index.js.map +7 -0
- package/dist/plugins/shell/httpie/httpie.js +12 -15
- package/dist/plugins/shell/httpie/httpie.js.map +7 -0
- package/dist/plugins/shell/httpie/httpie.test.js +113 -0
- package/dist/plugins/shell/httpie/httpie.test.js.map +7 -0
- package/dist/plugins/shell/httpie/index.js +2 -1
- package/dist/plugins/shell/httpie/index.js.map +7 -0
- package/dist/plugins/shell/wget/index.js +2 -1
- package/dist/plugins/shell/wget/index.js.map +7 -0
- package/dist/plugins/shell/wget/wget.js +12 -15
- package/dist/plugins/shell/wget/wget.js.map +7 -0
- package/dist/plugins/shell/wget/wget.test.js +143 -0
- package/dist/plugins/shell/wget/wget.test.js.map +7 -0
- package/dist/plugins/swift/nsurlsession/index.js +2 -1
- package/dist/plugins/swift/nsurlsession/index.js.map +7 -0
- package/dist/plugins/swift/nsurlsession/nsurlsession.js +12 -15
- package/dist/plugins/swift/nsurlsession/nsurlsession.js.map +7 -0
- package/dist/plugins/swift/nsurlsession/nsurlsession.test.js +344 -0
- package/dist/plugins/swift/nsurlsession/nsurlsession.test.js.map +7 -0
- package/dist/snippetz.js +27 -27
- package/dist/snippetz.js.map +7 -0
- package/dist/snippetz.test.js +79 -0
- package/dist/snippetz.test.js.map +7 -0
- package/dist/utils/convertWithHttpSnippetLite.js +101 -104
- package/dist/utils/convertWithHttpSnippetLite.js.map +7 -0
- package/dist/utils/convertWithHttpSnippetLite.test.js +106 -0
- package/dist/utils/convertWithHttpSnippetLite.test.js.map +7 -0
- package/dist/utils/create-search-params.d.ts +4 -0
- package/dist/utils/create-search-params.d.ts.map +1 -0
- package/dist/utils/create-search-params.js +11 -0
- package/dist/utils/create-search-params.js.map +7 -0
- package/dist/utils/create-search-params.test.js +49 -0
- package/dist/utils/create-search-params.test.js.map +7 -0
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -4
- package/dist/utils/index.js.map +7 -0
- package/dist/utils/needsQuotes.js +5 -8
- package/dist/utils/needsQuotes.js.map +7 -0
- package/dist/utils/objectToString.d.ts +8 -0
- package/dist/utils/objectToString.d.ts.map +1 -1
- package/dist/utils/objectToString.js +48 -54
- package/dist/utils/objectToString.js.map +7 -0
- package/package.json +147 -151
- package/dist/utils/arrayToObject.d.ts +0 -8
- package/dist/utils/arrayToObject.d.ts.map +0 -1
- package/dist/utils/arrayToObject.js +0 -14
package/dist/snippetz.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { clients } from
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Generate code examples for HAR requests
|
|
5
|
-
*/
|
|
1
|
+
import { clients } from "./clients.js";
|
|
6
2
|
function snippetz() {
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
function findPlugin(target, client) {
|
|
4
|
+
return clients.find(({ key }) => key === target)?.clients.find((plugin) => plugin.client === client);
|
|
5
|
+
}
|
|
6
|
+
return {
|
|
7
|
+
print(target, client, request) {
|
|
8
|
+
return findPlugin(target, client)?.generate(request);
|
|
9
|
+
},
|
|
10
|
+
clients() {
|
|
11
|
+
return clients;
|
|
12
|
+
},
|
|
13
|
+
plugins() {
|
|
14
|
+
return clients.flatMap(
|
|
15
|
+
({ key, clients: clients2 }) => clients2.map((plugin) => ({
|
|
16
|
+
target: key,
|
|
17
|
+
client: plugin.client
|
|
18
|
+
}))
|
|
19
|
+
);
|
|
20
|
+
},
|
|
21
|
+
findPlugin,
|
|
22
|
+
hasPlugin(target, client) {
|
|
23
|
+
return Boolean(findPlugin(target, client));
|
|
9
24
|
}
|
|
10
|
-
|
|
11
|
-
print(target, client, request) {
|
|
12
|
-
return findPlugin(target, client)?.generate(request);
|
|
13
|
-
},
|
|
14
|
-
clients() {
|
|
15
|
-
return clients;
|
|
16
|
-
},
|
|
17
|
-
plugins() {
|
|
18
|
-
return clients.flatMap(({ key, clients }) => clients.map((plugin) => ({
|
|
19
|
-
target: key,
|
|
20
|
-
client: plugin.client,
|
|
21
|
-
})));
|
|
22
|
-
},
|
|
23
|
-
findPlugin,
|
|
24
|
-
hasPlugin(target, client) {
|
|
25
|
-
return Boolean(findPlugin(target, client));
|
|
26
|
-
},
|
|
27
|
-
};
|
|
25
|
+
};
|
|
28
26
|
}
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
export {
|
|
28
|
+
snippetz
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=snippetz.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/snippetz.ts"],
|
|
4
|
+
"sourcesContent": ["import { clients } from '@/clients'\nimport type { ClientId, HarRequest, TargetId } from '@scalar/types/snippetz'\n\n/**\n * Generate code examples for HAR requests\n */\nexport function snippetz() {\n function findPlugin<T extends TargetId>(target: T | string, client: ClientId<T> | string) {\n return clients.find(({ key }) => key === target)?.clients.find((plugin) => plugin.client === client)\n }\n\n return {\n print<T extends TargetId>(target: T, client: ClientId<T>, request: Partial<HarRequest>) {\n return findPlugin(target, client)?.generate(request)\n },\n clients() {\n return clients\n },\n plugins() {\n return clients.flatMap(({ key, clients }) =>\n clients.map((plugin) => ({\n target: key,\n client: plugin.client,\n })),\n )\n },\n findPlugin,\n hasPlugin<T extends TargetId>(target: T | string, client: ClientId<T> | string) {\n return Boolean(findPlugin(target, client))\n },\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAe;AAMjB,SAAS,WAAW;AACzB,WAAS,WAA+B,QAAoB,QAA8B;AACxF,WAAO,QAAQ,KAAK,CAAC,EAAE,IAAI,MAAM,QAAQ,MAAM,GAAG,QAAQ,KAAK,CAAC,WAAW,OAAO,WAAW,MAAM;AAAA,EACrG;AAEA,SAAO;AAAA,IACL,MAA0B,QAAW,QAAqB,SAA8B;AACtF,aAAO,WAAW,QAAQ,MAAM,GAAG,SAAS,OAAO;AAAA,IACrD;AAAA,IACA,UAAU;AACR,aAAO;AAAA,IACT;AAAA,IACA,UAAU;AACR,aAAO,QAAQ;AAAA,QAAQ,CAAC,EAAE,KAAK,SAAAA,SAAQ,MACrCA,SAAQ,IAAI,CAAC,YAAY;AAAA,UACvB,QAAQ;AAAA,UACR,QAAQ,OAAO;AAAA,QACjB,EAAE;AAAA,MACJ;AAAA,IACF;AAAA,IACA;AAAA,IACA,UAA8B,QAAoB,QAA8B;AAC9E,aAAO,QAAQ,WAAW,QAAQ,MAAM,CAAC;AAAA,IAC3C;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["clients"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { snippetz } from "./snippetz.js";
|
|
3
|
+
describe("snippetz", async () => {
|
|
4
|
+
it("returns code for undici", async () => {
|
|
5
|
+
const snippet = snippetz().print("node", "undici", {
|
|
6
|
+
url: "https://example.com"
|
|
7
|
+
});
|
|
8
|
+
expect(snippet).toBe(`import { request } from 'undici'
|
|
9
|
+
|
|
10
|
+
const { statusCode, body } = await request('https://example.com')`);
|
|
11
|
+
});
|
|
12
|
+
it("loads some clients by default", async () => {
|
|
13
|
+
expect(snippetz().clients()).toEqual(
|
|
14
|
+
expect.arrayContaining([
|
|
15
|
+
{
|
|
16
|
+
key: "node",
|
|
17
|
+
title: "Node.js",
|
|
18
|
+
default: "fetch",
|
|
19
|
+
clients: expect.arrayContaining([
|
|
20
|
+
expect.objectContaining({
|
|
21
|
+
client: "undici"
|
|
22
|
+
}),
|
|
23
|
+
expect.objectContaining({
|
|
24
|
+
client: "fetch"
|
|
25
|
+
})
|
|
26
|
+
])
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: "shell",
|
|
30
|
+
title: "Shell",
|
|
31
|
+
default: "curl",
|
|
32
|
+
clients: expect.arrayContaining([
|
|
33
|
+
expect.objectContaining({
|
|
34
|
+
client: "curl"
|
|
35
|
+
}),
|
|
36
|
+
expect.objectContaining({
|
|
37
|
+
client: "wget"
|
|
38
|
+
}),
|
|
39
|
+
expect.objectContaining({
|
|
40
|
+
client: "httpie"
|
|
41
|
+
})
|
|
42
|
+
])
|
|
43
|
+
}
|
|
44
|
+
])
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe("plugins", async () => {
|
|
49
|
+
it("returns true if it has the plugin", async () => {
|
|
50
|
+
const result = snippetz().plugins();
|
|
51
|
+
expect(result).toEqual(
|
|
52
|
+
expect.arrayContaining([
|
|
53
|
+
{
|
|
54
|
+
target: "node",
|
|
55
|
+
client: "undici"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
target: "node",
|
|
59
|
+
client: "fetch"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
target: "shell",
|
|
63
|
+
client: "curl"
|
|
64
|
+
}
|
|
65
|
+
])
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
describe("hasPlugin", async () => {
|
|
70
|
+
it("returns true if it has the plugin", async () => {
|
|
71
|
+
const result = snippetz().hasPlugin("node", "undici");
|
|
72
|
+
expect(result).toBe(true);
|
|
73
|
+
});
|
|
74
|
+
it("returns false if it doesn\u2019t know the plugin", async () => {
|
|
75
|
+
const result = snippetz().hasPlugin("node", "fantasy");
|
|
76
|
+
expect(result).toBe(false);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=snippetz.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/snippetz.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { snippetz } from './snippetz'\n\ndescribe('snippetz', async () => {\n it('returns code for undici', async () => {\n const snippet = snippetz().print('node', 'undici', {\n url: 'https://example.com',\n })\n\n expect(snippet).toBe(`import { request } from 'undici'\n\nconst { statusCode, body } = await request('https://example.com')`)\n })\n\n it('loads some clients by default', async () => {\n expect(snippetz().clients()).toEqual(\n expect.arrayContaining([\n {\n key: 'node',\n title: 'Node.js',\n default: 'fetch',\n clients: expect.arrayContaining([\n expect.objectContaining({\n client: 'undici',\n }),\n expect.objectContaining({\n client: 'fetch',\n }),\n ]),\n },\n {\n key: 'shell',\n title: 'Shell',\n default: 'curl',\n clients: expect.arrayContaining([\n expect.objectContaining({\n client: 'curl',\n }),\n expect.objectContaining({\n client: 'wget',\n }),\n expect.objectContaining({\n client: 'httpie',\n }),\n ]),\n },\n ]),\n )\n })\n})\n\ndescribe('plugins', async () => {\n it('returns true if it has the plugin', async () => {\n const result = snippetz().plugins()\n\n expect(result).toEqual(\n expect.arrayContaining([\n {\n target: 'node',\n client: 'undici',\n },\n {\n target: 'node',\n client: 'fetch',\n },\n {\n target: 'shell',\n client: 'curl',\n },\n ]),\n )\n })\n})\n\ndescribe('hasPlugin', async () => {\n it('returns true if it has the plugin', async () => {\n const result = snippetz().hasPlugin('node', 'undici')\n\n expect(result).toBe(true)\n })\n\n it('returns false if it doesn\u2019t know the plugin', async () => {\n const result = snippetz().hasPlugin('node', 'fantasy')\n\n expect(result).toBe(false)\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,gBAAgB;AAEzB,SAAS,YAAY,YAAY;AAC/B,KAAG,2BAA2B,YAAY;AACxC,UAAM,UAAU,SAAS,EAAE,MAAM,QAAQ,UAAU;AAAA,MACjD,KAAK;AAAA,IACP,CAAC;AAED,WAAO,OAAO,EAAE,KAAK;AAAA;AAAA,kEAEyC;AAAA,EAChE,CAAC;AAED,KAAG,iCAAiC,YAAY;AAC9C,WAAO,SAAS,EAAE,QAAQ,CAAC,EAAE;AAAA,MAC3B,OAAO,gBAAgB;AAAA,QACrB;AAAA,UACE,KAAK;AAAA,UACL,OAAO;AAAA,UACP,SAAS;AAAA,UACT,SAAS,OAAO,gBAAgB;AAAA,YAC9B,OAAO,iBAAiB;AAAA,cACtB,QAAQ;AAAA,YACV,CAAC;AAAA,YACD,OAAO,iBAAiB;AAAA,cACtB,QAAQ;AAAA,YACV,CAAC;AAAA,UACH,CAAC;AAAA,QACH;AAAA,QACA;AAAA,UACE,KAAK;AAAA,UACL,OAAO;AAAA,UACP,SAAS;AAAA,UACT,SAAS,OAAO,gBAAgB;AAAA,YAC9B,OAAO,iBAAiB;AAAA,cACtB,QAAQ;AAAA,YACV,CAAC;AAAA,YACD,OAAO,iBAAiB;AAAA,cACtB,QAAQ;AAAA,YACV,CAAC;AAAA,YACD,OAAO,iBAAiB;AAAA,cACtB,QAAQ;AAAA,YACV,CAAC;AAAA,UACH,CAAC;AAAA,QACH;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH,CAAC;AAED,SAAS,WAAW,YAAY;AAC9B,KAAG,qCAAqC,YAAY;AAClD,UAAM,SAAS,SAAS,EAAE,QAAQ;AAElC,WAAO,MAAM,EAAE;AAAA,MACb,OAAO,gBAAgB;AAAA,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|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
try {
|
|
94
|
-
convertRequest.postData.jsonObj = JSON.parse(convertRequest.postData.text);
|
|
95
|
-
}
|
|
96
|
-
catch (error) {
|
|
97
|
-
console.error('Error parsing JSON:', error);
|
|
98
|
-
}
|
|
1
|
+
function convertWithHttpSnippetLite(client, request) {
|
|
2
|
+
const urlObject = new URL(request?.url ?? "");
|
|
3
|
+
const url = urlObject.pathname === "/" ? urlObject.origin : urlObject.toString();
|
|
4
|
+
const harRequest = {
|
|
5
|
+
method: request?.method ?? "GET",
|
|
6
|
+
url,
|
|
7
|
+
httpVersion: "HTTP/1.1",
|
|
8
|
+
cookies: [],
|
|
9
|
+
// Cookies are handled through headers
|
|
10
|
+
headers: request?.headers ?? [],
|
|
11
|
+
headersSize: -1,
|
|
12
|
+
bodySize: -1,
|
|
13
|
+
queryString: Array.from(urlObject.searchParams.entries()).map(([name, value]) => ({
|
|
14
|
+
name,
|
|
15
|
+
value
|
|
16
|
+
})),
|
|
17
|
+
postData: request?.postData
|
|
18
|
+
};
|
|
19
|
+
const allHeaders = (harRequest?.headers ?? []).reduce(
|
|
20
|
+
(acc, header) => ({
|
|
21
|
+
...acc,
|
|
22
|
+
[header.name]: header.value
|
|
23
|
+
}),
|
|
24
|
+
{}
|
|
25
|
+
);
|
|
26
|
+
const queryObj = (harRequest.queryString ?? []).reduce(
|
|
27
|
+
(acc, param) => ({
|
|
28
|
+
...acc,
|
|
29
|
+
[param.name]: param.value
|
|
30
|
+
}),
|
|
31
|
+
{}
|
|
32
|
+
);
|
|
33
|
+
const cookiesObj = (harRequest.cookies ?? []).reduce(
|
|
34
|
+
(acc, cookie) => ({
|
|
35
|
+
...acc,
|
|
36
|
+
[cookie.name]: cookie.value
|
|
37
|
+
}),
|
|
38
|
+
{}
|
|
39
|
+
);
|
|
40
|
+
const parsedUrl = new URL(harRequest.url);
|
|
41
|
+
const uriObj = {
|
|
42
|
+
protocol: parsedUrl.protocol,
|
|
43
|
+
hostname: parsedUrl.hostname,
|
|
44
|
+
host: parsedUrl.hostname,
|
|
45
|
+
port: parsedUrl.port,
|
|
46
|
+
pathname: parsedUrl.pathname.split("/").map((segment) => encodeURIComponent(decodeURIComponent(segment))).join("/") + parsedUrl.search,
|
|
47
|
+
path: parsedUrl.pathname.split("/").map((segment) => encodeURIComponent(decodeURIComponent(segment))).join("/") + parsedUrl.search,
|
|
48
|
+
search: parsedUrl.search,
|
|
49
|
+
hash: parsedUrl.hash,
|
|
50
|
+
href: parsedUrl.href,
|
|
51
|
+
origin: parsedUrl.origin,
|
|
52
|
+
password: parsedUrl.password,
|
|
53
|
+
searchParams: parsedUrl.searchParams,
|
|
54
|
+
username: parsedUrl.username,
|
|
55
|
+
toString: parsedUrl.toString,
|
|
56
|
+
toJSON: () => parsedUrl.toJSON()
|
|
57
|
+
};
|
|
58
|
+
const convertRequest = {
|
|
59
|
+
url: harRequest.url,
|
|
60
|
+
uriObj,
|
|
61
|
+
method: harRequest.method?.toLocaleUpperCase() ?? "GET",
|
|
62
|
+
httpVersion: harRequest.httpVersion,
|
|
63
|
+
cookies: harRequest.cookies ?? [],
|
|
64
|
+
headers: harRequest.headers ?? [],
|
|
65
|
+
headersSize: harRequest.headersSize ?? 0,
|
|
66
|
+
headersObj: allHeaders ?? {},
|
|
67
|
+
bodySize: harRequest.bodySize ?? 0,
|
|
68
|
+
queryString: harRequest.queryString ?? [],
|
|
69
|
+
postData: harRequest.postData ? {
|
|
70
|
+
mimeType: harRequest.postData.mimeType ?? "application/json",
|
|
71
|
+
text: harRequest.postData.text ?? "",
|
|
72
|
+
params: harRequest.postData.params ?? [],
|
|
73
|
+
paramsObj: harRequest.postData.params?.reduce(
|
|
74
|
+
(acc, param) => {
|
|
75
|
+
if (param.name && param.value !== void 0) {
|
|
76
|
+
acc[param.name] = param.value;
|
|
77
|
+
}
|
|
78
|
+
return acc;
|
|
79
|
+
},
|
|
80
|
+
{}
|
|
81
|
+
) ?? {}
|
|
82
|
+
} : void 0,
|
|
83
|
+
allHeaders: allHeaders ?? {},
|
|
84
|
+
fullUrl: harRequest.url,
|
|
85
|
+
queryObj: queryObj ?? {},
|
|
86
|
+
cookiesObj: cookiesObj ?? {}
|
|
87
|
+
};
|
|
88
|
+
if (convertRequest.postData?.mimeType === "application/json" && convertRequest.postData?.text) {
|
|
89
|
+
try {
|
|
90
|
+
convertRequest.postData.jsonObj = JSON.parse(convertRequest.postData.text);
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.error("Error parsing JSON:", error);
|
|
99
93
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
}
|
|
95
|
+
if (typeof client.convert === "function") {
|
|
96
|
+
return client.convert(convertRequest);
|
|
97
|
+
}
|
|
98
|
+
return "";
|
|
104
99
|
}
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
export {
|
|
101
|
+
convertWithHttpSnippetLite
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=convertWithHttpSnippetLite.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/convertWithHttpSnippetLite.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Request } from '@/httpsnippet-lite/types/httpsnippet'\nimport type { HarRequest } from '@scalar/types/snippetz'\n\n/**\n * Takes a httpsnippet-lite client and converts the given request to a code example with it.\n *\n * @deprecated This a temporary wrapper around httpsnippet-lite. Let\u2019s write all the generators ourselves instead.\n */\nexport function convertWithHttpSnippetLite(\n // Couldn\u2019t find the proper type, there was always a mismatch.\n client: Record<string, unknown>,\n request?: Partial<HarRequest>,\n): string {\n const urlObject = new URL(request?.url ?? '')\n\n // If it's just the domain, omit the trailing slash\n const url = urlObject.pathname === '/' ? urlObject.origin : urlObject.toString()\n\n const harRequest: HarRequest = {\n method: request?.method ?? 'GET',\n url,\n httpVersion: 'HTTP/1.1',\n cookies: [], // Cookies are handled through headers\n headers: request?.headers ?? [],\n headersSize: -1,\n bodySize: -1,\n queryString: Array.from(urlObject.searchParams.entries()).map(([name, value]) => ({\n name,\n value,\n })),\n postData: request?.postData,\n }\n\n const allHeaders = (harRequest?.headers ?? []).reduce(\n (acc, header) => ({\n ...acc,\n [header.name]: header.value,\n }),\n {} as Record<string, string>,\n )\n\n const queryObj = (harRequest.queryString ?? []).reduce(\n (acc, param) => ({\n ...acc,\n [param.name]: param.value,\n }),\n {} as Record<string, string>,\n )\n\n const cookiesObj = (harRequest.cookies ?? []).reduce(\n (acc, cookie) => ({\n ...acc,\n [cookie.name]: cookie.value,\n }),\n {} as Record<string, string>,\n )\n\n const parsedUrl = new URL(harRequest.url)\n const uriObj = {\n protocol: parsedUrl.protocol,\n hostname: parsedUrl.hostname,\n host: parsedUrl.hostname,\n port: parsedUrl.port,\n pathname:\n parsedUrl.pathname\n .split('/')\n .map((segment) => encodeURIComponent(decodeURIComponent(segment)))\n .join('/') + parsedUrl.search,\n path:\n parsedUrl.pathname\n .split('/')\n .map((segment) => encodeURIComponent(decodeURIComponent(segment)))\n .join('/') + parsedUrl.search,\n search: parsedUrl.search,\n hash: parsedUrl.hash,\n href: parsedUrl.href,\n origin: parsedUrl.origin,\n password: parsedUrl.password,\n searchParams: parsedUrl.searchParams,\n username: parsedUrl.username,\n toString: parsedUrl.toString,\n toJSON: () => parsedUrl.toJSON(),\n }\n\n const convertRequest = {\n url: harRequest.url,\n uriObj,\n method: harRequest.method?.toLocaleUpperCase() ?? 'GET',\n httpVersion: harRequest.httpVersion,\n cookies: harRequest.cookies ?? [],\n headers: harRequest.headers ?? [],\n headersSize: harRequest.headersSize ?? 0,\n headersObj: allHeaders ?? {},\n bodySize: harRequest.bodySize ?? 0,\n queryString: harRequest.queryString ?? [],\n postData: harRequest.postData\n ? {\n mimeType: harRequest.postData.mimeType ?? 'application/json',\n text: harRequest.postData.text ?? '',\n params: harRequest.postData.params ?? [],\n paramsObj:\n harRequest.postData.params?.reduce(\n (acc, param) => {\n if (param.name && param.value !== undefined) {\n acc[param.name] = param.value\n }\n return acc\n },\n {} as Record<string, string>,\n ) ?? {},\n }\n : undefined,\n allHeaders: allHeaders ?? {},\n fullUrl: harRequest.url,\n queryObj: queryObj ?? {},\n cookiesObj: cookiesObj ?? {},\n } as Request\n\n // If the request is a JSON request, parse the text as JSON\n if (convertRequest.postData?.mimeType === 'application/json' && convertRequest.postData?.text) {\n try {\n convertRequest.postData.jsonObj = JSON.parse(convertRequest.postData.text)\n } catch (error) {\n console.error('Error parsing JSON:', error)\n }\n }\n\n if (typeof client.convert === 'function') {\n return client.convert(convertRequest)\n }\n\n return ''\n}\n"],
|
|
5
|
+
"mappings": "AAQO,SAAS,2BAEd,QACA,SACQ;AACR,QAAM,YAAY,IAAI,IAAI,SAAS,OAAO,EAAE;AAG5C,QAAM,MAAM,UAAU,aAAa,MAAM,UAAU,SAAS,UAAU,SAAS;AAE/E,QAAM,aAAyB;AAAA,IAC7B,QAAQ,SAAS,UAAU;AAAA,IAC3B;AAAA,IACA,aAAa;AAAA,IACb,SAAS,CAAC;AAAA;AAAA,IACV,SAAS,SAAS,WAAW,CAAC;AAAA,IAC9B,aAAa;AAAA,IACb,UAAU;AAAA,IACV,aAAa,MAAM,KAAK,UAAU,aAAa,QAAQ,CAA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+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { convertWithHttpSnippetLite } from "./convertWithHttpSnippetLite.js";
|
|
3
|
+
describe("convertWithHttpSnippetLite", () => {
|
|
4
|
+
it("converts a basic GET request", () => {
|
|
5
|
+
const mockClient = {
|
|
6
|
+
convert: (request) => JSON.stringify(request, null, 2)
|
|
7
|
+
};
|
|
8
|
+
const result = convertWithHttpSnippetLite(mockClient, {
|
|
9
|
+
url: "https://api.example.com/users",
|
|
10
|
+
method: "GET"
|
|
11
|
+
});
|
|
12
|
+
const parsed = JSON.parse(result);
|
|
13
|
+
expect(parsed.method).toBe("GET");
|
|
14
|
+
expect(parsed.url).toBe("https://api.example.com/users");
|
|
15
|
+
expect(parsed.headers).toEqual([]);
|
|
16
|
+
});
|
|
17
|
+
it("handles query parameters", () => {
|
|
18
|
+
const mockClient = {
|
|
19
|
+
convert: (request) => JSON.stringify(request, null, 2)
|
|
20
|
+
};
|
|
21
|
+
const result = convertWithHttpSnippetLite(mockClient, {
|
|
22
|
+
url: "https://api.example.com/search?q=test&page=1",
|
|
23
|
+
method: "GET"
|
|
24
|
+
});
|
|
25
|
+
const parsed = JSON.parse(result);
|
|
26
|
+
expect(parsed.queryObj).toEqual({
|
|
27
|
+
q: "test",
|
|
28
|
+
page: "1"
|
|
29
|
+
});
|
|
30
|
+
expect(parsed.queryString).toEqual([
|
|
31
|
+
{ name: "q", value: "test" },
|
|
32
|
+
{ name: "page", value: "1" }
|
|
33
|
+
]);
|
|
34
|
+
});
|
|
35
|
+
it("processes headers correctly", () => {
|
|
36
|
+
const mockClient = {
|
|
37
|
+
convert: (request) => JSON.stringify(request, null, 2)
|
|
38
|
+
};
|
|
39
|
+
const result = convertWithHttpSnippetLite(mockClient, {
|
|
40
|
+
url: "https://api.example.com/data",
|
|
41
|
+
method: "GET",
|
|
42
|
+
headers: [
|
|
43
|
+
{ name: "Content-Type", value: "application/json" },
|
|
44
|
+
{ name: "Authorization", value: "Bearer token" }
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
const parsed = JSON.parse(result);
|
|
48
|
+
expect(parsed.headersObj).toEqual({
|
|
49
|
+
"Content-Type": "application/json",
|
|
50
|
+
"Authorization": "Bearer token"
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
it("handles POST requests with JSON body", () => {
|
|
54
|
+
const mockClient = {
|
|
55
|
+
convert: (request) => JSON.stringify(request, null, 2)
|
|
56
|
+
};
|
|
57
|
+
const result = convertWithHttpSnippetLite(mockClient, {
|
|
58
|
+
url: "https://api.example.com/users",
|
|
59
|
+
method: "POST",
|
|
60
|
+
postData: {
|
|
61
|
+
mimeType: "application/json",
|
|
62
|
+
text: JSON.stringify({ name: "John", age: 30 })
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const parsed = JSON.parse(result);
|
|
66
|
+
expect(parsed.method).toBe("POST");
|
|
67
|
+
expect(parsed.postData.jsonObj).toEqual({
|
|
68
|
+
name: "John",
|
|
69
|
+
age: 30
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
it("handles invalid JSON body gracefully", () => {
|
|
73
|
+
const mockClient = {
|
|
74
|
+
convert: (request) => JSON.stringify(request, null, 2)
|
|
75
|
+
};
|
|
76
|
+
const result = convertWithHttpSnippetLite(mockClient, {
|
|
77
|
+
url: "https://api.example.com/users",
|
|
78
|
+
method: "POST",
|
|
79
|
+
postData: {
|
|
80
|
+
mimeType: "application/json",
|
|
81
|
+
text: "invalid json"
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
const parsed = JSON.parse(result);
|
|
85
|
+
expect(parsed.postData.jsonObj).toBeUndefined();
|
|
86
|
+
});
|
|
87
|
+
it("returns empty string if client.convert is not a function", () => {
|
|
88
|
+
const mockClient = {};
|
|
89
|
+
const result = convertWithHttpSnippetLite(mockClient, {
|
|
90
|
+
url: "https://api.example.com/users",
|
|
91
|
+
method: "GET"
|
|
92
|
+
});
|
|
93
|
+
expect(result).toBe("");
|
|
94
|
+
});
|
|
95
|
+
it("handles URLs with trailing slash correctly", () => {
|
|
96
|
+
const mockClient = {
|
|
97
|
+
convert: (request) => JSON.stringify(request, null, 2)
|
|
98
|
+
};
|
|
99
|
+
const result = convertWithHttpSnippetLite(mockClient, {
|
|
100
|
+
url: "https://api.example.com/"
|
|
101
|
+
});
|
|
102
|
+
const parsed = JSON.parse(result);
|
|
103
|
+
expect(parsed.url).toBe("https://api.example.com");
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=convertWithHttpSnippetLite.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/convertWithHttpSnippetLite.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport type { HarRequest } from '@scalar/types/snippetz'\nimport { convertWithHttpSnippetLite } from './convertWithHttpSnippetLite'\n\ndescribe('convertWithHttpSnippetLite', () => {\n it('converts a basic GET request', () => {\n const mockClient = {\n convert: (request: HarRequest) => JSON.stringify(request, null, 2),\n }\n\n const result = convertWithHttpSnippetLite(mockClient, {\n url: 'https://api.example.com/users',\n method: 'GET',\n })\n\n const parsed = JSON.parse(result)\n expect(parsed.method).toBe('GET')\n expect(parsed.url).toBe('https://api.example.com/users')\n expect(parsed.headers).toEqual([])\n })\n\n it('handles query parameters', () => {\n const mockClient = {\n convert: (request: HarRequest) => JSON.stringify(request, null, 2),\n }\n\n const result = convertWithHttpSnippetLite(mockClient, {\n url: 'https://api.example.com/search?q=test&page=1',\n method: 'GET',\n })\n\n const parsed = JSON.parse(result)\n expect(parsed.queryObj).toEqual({\n q: 'test',\n page: '1',\n })\n expect(parsed.queryString).toEqual([\n { name: 'q', value: 'test' },\n { name: 'page', value: '1' },\n ])\n })\n\n it('processes headers correctly', () => {\n const mockClient = {\n convert: (request: HarRequest) => JSON.stringify(request, null, 2),\n }\n\n const result = convertWithHttpSnippetLite(mockClient, {\n url: 'https://api.example.com/data',\n method: 'GET',\n headers: [\n { name: 'Content-Type', value: 'application/json' },\n { name: 'Authorization', value: 'Bearer token' },\n ],\n })\n\n const parsed = JSON.parse(result)\n expect(parsed.headersObj).toEqual({\n 'Content-Type': 'application/json',\n 'Authorization': 'Bearer token',\n })\n })\n\n it('handles POST requests with JSON body', () => {\n const mockClient = {\n convert: (request: HarRequest) => JSON.stringify(request, null, 2),\n }\n\n const result = convertWithHttpSnippetLite(mockClient, {\n url: 'https://api.example.com/users',\n method: 'POST',\n postData: {\n mimeType: 'application/json',\n text: JSON.stringify({ name: 'John', age: 30 }),\n },\n })\n\n const parsed = JSON.parse(result)\n expect(parsed.method).toBe('POST')\n expect(parsed.postData.jsonObj).toEqual({\n name: 'John',\n age: 30,\n })\n })\n\n it('handles invalid JSON body gracefully', () => {\n const mockClient = {\n convert: (request: HarRequest) => JSON.stringify(request, null, 2),\n }\n\n const result = convertWithHttpSnippetLite(mockClient, {\n url: 'https://api.example.com/users',\n method: 'POST',\n postData: {\n mimeType: 'application/json',\n text: 'invalid json',\n },\n })\n\n const parsed = JSON.parse(result)\n expect(parsed.postData.jsonObj).toBeUndefined()\n })\n\n it('returns empty string if client.convert is not a function', () => {\n const mockClient = {}\n\n const result = convertWithHttpSnippetLite(mockClient, {\n url: 'https://api.example.com/users',\n method: 'GET',\n })\n\n expect(result).toBe('')\n })\n\n it('handles URLs with trailing slash correctly', () => {\n const mockClient = {\n convert: (request: HarRequest) => JSON.stringify(request, null, 2),\n }\n\n const result = convertWithHttpSnippetLite(mockClient, {\n url: 'https://api.example.com/',\n })\n\n const parsed = JSON.parse(result)\n expect(parsed.url).toBe('https://api.example.com')\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAGrC,SAAS,kCAAkC;AAE3C,SAAS,8BAA8B,MAAM;AAC3C,KAAG,gCAAgC,MAAM;AACvC,UAAM,aAAa;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AA,IACnE;AAEA,UAAM,SAAS,2BAA2B,YAAY;AAAA,MACpD,KAAK;AAAA,IACP,CAAC;AAED,UAAM,SAAS,KAAK,MAAM,MAAM;AAChC,WAAO,OAAO,GAAG,EAAE,KAAK,yBAAyB;AAAA,EACnD,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HarRequest } from '@scalar/types/snippetz';
|
|
2
|
+
/** Creates a new URL search params object and sets query params so we can handle arrays */
|
|
3
|
+
export declare const createSearchParams: (query?: HarRequest["queryString"]) => URLSearchParams;
|
|
4
|
+
//# sourceMappingURL=create-search-params.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-search-params.d.ts","sourceRoot":"","sources":["../../src/utils/create-search-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAExD,2FAA2F;AAC3F,eAAO,MAAM,kBAAkB,WAAW,UAAU,CAAC,aAAa,CAAC,oBAMlE,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const createSearchParams = (query = []) => {
|
|
2
|
+
const searchParams = new URLSearchParams();
|
|
3
|
+
query.forEach((q) => {
|
|
4
|
+
searchParams.append(q.name, q.value);
|
|
5
|
+
});
|
|
6
|
+
return searchParams;
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
createSearchParams
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=create-search-params.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/create-search-params.ts"],
|
|
4
|
+
"sourcesContent": ["import type { HarRequest } from '@scalar/types/snippetz'\n\n/** Creates a new URL search params object and sets query params so we can handle arrays */\nexport const createSearchParams = (query: HarRequest['queryString'] = []) => {\n const searchParams = new URLSearchParams()\n query.forEach((q) => {\n searchParams.append(q.name, q.value)\n })\n return searchParams\n}\n"],
|
|
5
|
+
"mappings": "AAGO,MAAM,qBAAqB,CAAC,QAAmC,CAAC,MAAM;AAC3E,QAAM,eAAe,IAAI,gBAAgB;AACzC,QAAM,QAAQ,CAAC,MAAM;AACnB,iBAAa,OAAO,EAAE,MAAM,EAAE,KAAK;AAAA,EACrC,CAAC;AACD,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { createSearchParams } from "./create-search-params.js";
|
|
3
|
+
describe("createSearchParams", () => {
|
|
4
|
+
it("creates search params from empty query array", () => {
|
|
5
|
+
const query = [];
|
|
6
|
+
const result = createSearchParams(query);
|
|
7
|
+
expect(result.toString()).toBe("");
|
|
8
|
+
});
|
|
9
|
+
it("creates search params from single query parameter", () => {
|
|
10
|
+
const query = [{ name: "foo", value: "bar" }];
|
|
11
|
+
const result = createSearchParams(query);
|
|
12
|
+
expect(result.toString()).toBe("foo=bar");
|
|
13
|
+
});
|
|
14
|
+
it("creates search params from multiple query parameters", () => {
|
|
15
|
+
const query = [
|
|
16
|
+
{ name: "foo", value: "bar" },
|
|
17
|
+
{ name: "baz", value: "qux" }
|
|
18
|
+
];
|
|
19
|
+
const result = createSearchParams(query);
|
|
20
|
+
expect(result.toString()).toBe("foo=bar&baz=qux");
|
|
21
|
+
});
|
|
22
|
+
it("handles multiple parameters with the same name", () => {
|
|
23
|
+
const query = [
|
|
24
|
+
{ name: "foo", value: "bar" },
|
|
25
|
+
{ name: "foo", value: "baz" }
|
|
26
|
+
];
|
|
27
|
+
const result = createSearchParams(query);
|
|
28
|
+
expect(result.toString()).toBe("foo=bar&foo=baz");
|
|
29
|
+
});
|
|
30
|
+
it("handles special characters in parameter names and values", () => {
|
|
31
|
+
const query = [
|
|
32
|
+
{ name: "special!@#", value: "value!@#" },
|
|
33
|
+
{ name: "space name", value: "space value" }
|
|
34
|
+
];
|
|
35
|
+
const result = createSearchParams(query);
|
|
36
|
+
expect(result.toString()).toBe("special%21%40%23=value%21%40%23&space+name=space+value");
|
|
37
|
+
});
|
|
38
|
+
it("handles empty parameter values", () => {
|
|
39
|
+
const query = [{ name: "empty", value: "" }];
|
|
40
|
+
const result = createSearchParams(query);
|
|
41
|
+
expect(result.toString()).toBe("empty=");
|
|
42
|
+
});
|
|
43
|
+
it("handles URL-encoded values", () => {
|
|
44
|
+
const query = [{ name: "encoded", value: "hello%20world" }];
|
|
45
|
+
const result = createSearchParams(query);
|
|
46
|
+
expect(result.toString()).toBe("encoded=hello%2520world");
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=create-search-params.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/create-search-params.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\nimport { createSearchParams } from './create-search-params'\nimport type { HarRequest } from '@scalar/types/snippetz'\n\ndescribe('createSearchParams', () => {\n it('creates search params from empty query array', () => {\n const query: HarRequest['queryString'] = []\n const result = createSearchParams(query)\n expect(result.toString()).toBe('')\n })\n\n it('creates search params from single query parameter', () => {\n const query: HarRequest['queryString'] = [{ name: 'foo', value: 'bar' }]\n const result = createSearchParams(query)\n expect(result.toString()).toBe('foo=bar')\n })\n\n it('creates search params from multiple query parameters', () => {\n const query: HarRequest['queryString'] = [\n { name: 'foo', value: 'bar' },\n { name: 'baz', value: 'qux' },\n ]\n const result = createSearchParams(query)\n expect(result.toString()).toBe('foo=bar&baz=qux')\n })\n\n it('handles multiple parameters with the same name', () => {\n const query: HarRequest['queryString'] = [\n { name: 'foo', value: 'bar' },\n { name: 'foo', value: 'baz' },\n ]\n const result = createSearchParams(query)\n expect(result.toString()).toBe('foo=bar&foo=baz')\n })\n\n it('handles special characters in parameter names and values', () => {\n const query: HarRequest['queryString'] = [\n { name: 'special!@#', value: 'value!@#' },\n { name: 'space name', value: 'space value' },\n ]\n const result = createSearchParams(query)\n expect(result.toString()).toBe('special%21%40%23=value%21%40%23&space+name=space+value')\n })\n\n it('handles empty parameter values', () => {\n const query: HarRequest['queryString'] = [{ name: 'empty', value: '' }]\n const result = createSearchParams(query)\n expect(result.toString()).toBe('empty=')\n })\n\n it('handles URL-encoded values', () => {\n const query: HarRequest['queryString'] = [{ name: 'encoded', value: 'hello%20world' }]\n const result = createSearchParams(query)\n expect(result.toString()).toBe('encoded=hello%2520world')\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AACrC,SAAS,0BAA0B;AAGnC,SAAS,sBAAsB,MAAM;AACnC,KAAG,gDAAgD,MAAM;AACvD,UAAM,QAAmC,CAAC;AAC1C,UAAM,SAAS,mBAAmB,KAAK;AACvC,WAAO,OAAO,SAAS,CAAC,EAAE,KAAK,EAAE;AAAA,EACnC,CAAC;AAED,KAAG,qDAAqD,MAAM;AAC5D,UAAM,QAAmC,CAAC,EAAE,MAAM,OAAO,OAAO,MAAM,CAAC;AACvE,UAAM,SAAS,mBAAmB,KAAK;AACvC,WAAO,OAAO,SAAS,CAAC,EAAE,KAAK,SAAS;AAAA,EAC1C,CAAC;AAED,KAAG,wDAAwD,MAAM;AAC/D,UAAM,QAAmC;AAAA,MACvC,EAAE,MAAM,OAAO,OAAO,MAAM;AAAA,MAC5B,EAAE,MAAM,OAAO,OAAO,MAAM;AAAA,IAC9B;AACA,UAAM,SAAS,mBAAmB,KAAK;AACvC,WAAO,OAAO,SAAS,CAAC,EAAE,KAAK,iBAAiB;AAAA,EAClD,CAAC;AAED,KAAG,kDAAkD,MAAM;AACzD,UAAM,QAAmC;AAAA,MACvC,EAAE,MAAM,OAAO,OAAO,MAAM;AAAA,MAC5B,EAAE,MAAM,OAAO,OAAO,MAAM;AAAA,IAC9B;AACA,UAAM,SAAS,mBAAmB,KAAK;AACvC,WAAO,OAAO,SAAS,CAAC,EAAE,KAAK,iBAAiB;AAAA,EAClD,CAAC;AAED,KAAG,4DAA4D,MAAM;AACnE,UAAM,QAAmC;AAAA,MACvC,EAAE,MAAM,cAAc,OAAO,WAAW;AAAA,MACxC,EAAE,MAAM,cAAc,OAAO,cAAc;AAAA,IAC7C;AACA,UAAM,SAAS,mBAAmB,KAAK;AACvC,WAAO,OAAO,SAAS,CAAC,EAAE,KAAK,wDAAwD;AAAA,EACzF,CAAC;AAED,KAAG,kCAAkC,MAAM;AACzC,UAAM,QAAmC,CAAC,EAAE,MAAM,SAAS,OAAO,GAAG,CAAC;AACtE,UAAM,SAAS,mBAAmB,KAAK;AACvC,WAAO,OAAO,SAAS,CAAC,EAAE,KAAK,QAAQ;AAAA,EACzC,CAAC;AAED,KAAG,8BAA8B,MAAM;AACrC,UAAM,QAAmC,CAAC,EAAE,MAAM,WAAW,OAAO,gBAAgB,CAAC;AACrF,UAAM,SAAS,mBAAmB,KAAK;AACvC,WAAO,OAAO,SAAS,CAAC,EAAE,KAAK,yBAAyB;AAAA,EAC1D,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
export * from "./convertWithHttpSnippetLite.js";
|
|
2
|
+
export * from "./needsQuotes.js";
|
|
3
|
+
export * from "./objectToString.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|