@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
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { pythonRequests } from "./requests.js";
|
|
3
|
+
describe("pythonRequests", () => {
|
|
4
|
+
it("returns a basic request", () => {
|
|
5
|
+
const result = pythonRequests.generate({
|
|
6
|
+
url: "https://example.com"
|
|
7
|
+
});
|
|
8
|
+
expect(result).toBe('requests.get("https://example.com")');
|
|
9
|
+
});
|
|
10
|
+
it("returns a POST request", () => {
|
|
11
|
+
const result = pythonRequests.generate({
|
|
12
|
+
url: "https://example.com",
|
|
13
|
+
method: "post"
|
|
14
|
+
});
|
|
15
|
+
expect(result).toBe('requests.post("https://example.com")');
|
|
16
|
+
});
|
|
17
|
+
it("has headers", () => {
|
|
18
|
+
const result = pythonRequests.generate({
|
|
19
|
+
url: "https://example.com",
|
|
20
|
+
headers: [
|
|
21
|
+
{
|
|
22
|
+
name: "Content-Type",
|
|
23
|
+
value: "application/json"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
expect(result).toBe(`requests.get("https://example.com",
|
|
28
|
+
headers={
|
|
29
|
+
"Content-Type": "application/json"
|
|
30
|
+
}
|
|
31
|
+
)`);
|
|
32
|
+
});
|
|
33
|
+
it("doesn\u2019t add empty headers", () => {
|
|
34
|
+
const result = pythonRequests.generate({
|
|
35
|
+
url: "https://example.com",
|
|
36
|
+
headers: []
|
|
37
|
+
});
|
|
38
|
+
expect(result).toBe('requests.get("https://example.com")');
|
|
39
|
+
});
|
|
40
|
+
it("has JSON body", () => {
|
|
41
|
+
const result = pythonRequests.generate({
|
|
42
|
+
url: "https://example.com",
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers: [
|
|
45
|
+
{
|
|
46
|
+
name: "Content-Type",
|
|
47
|
+
value: "application/json"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
postData: {
|
|
51
|
+
mimeType: "application/json",
|
|
52
|
+
text: JSON.stringify({
|
|
53
|
+
hello: "world"
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
expect(result).toBe(`requests.post("https://example.com",
|
|
58
|
+
headers={
|
|
59
|
+
"Content-Type": "application/json"
|
|
60
|
+
},
|
|
61
|
+
json={
|
|
62
|
+
"hello": "world"
|
|
63
|
+
}
|
|
64
|
+
)`);
|
|
65
|
+
});
|
|
66
|
+
it("has query string", () => {
|
|
67
|
+
const result = pythonRequests.generate({
|
|
68
|
+
url: "https://example.com",
|
|
69
|
+
queryString: [
|
|
70
|
+
{
|
|
71
|
+
name: "foo",
|
|
72
|
+
value: "bar"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "bar",
|
|
76
|
+
value: "foo"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
expect(result).toBe(`requests.get("https://example.com",
|
|
81
|
+
params={
|
|
82
|
+
"foo": "bar",
|
|
83
|
+
"bar": "foo"
|
|
84
|
+
}
|
|
85
|
+
)`);
|
|
86
|
+
});
|
|
87
|
+
it("has cookies", () => {
|
|
88
|
+
const result = pythonRequests.generate({
|
|
89
|
+
url: "https://example.com",
|
|
90
|
+
cookies: [
|
|
91
|
+
{
|
|
92
|
+
name: "foo",
|
|
93
|
+
value: "bar"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "bar",
|
|
97
|
+
value: "foo"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
});
|
|
101
|
+
expect(result).toBe(`requests.get("https://example.com",
|
|
102
|
+
cookies={
|
|
103
|
+
"foo": "bar",
|
|
104
|
+
"bar": "foo"
|
|
105
|
+
}
|
|
106
|
+
)`);
|
|
107
|
+
});
|
|
108
|
+
it("doesn\u2019t add empty cookies", () => {
|
|
109
|
+
const result = pythonRequests.generate({
|
|
110
|
+
url: "https://example.com",
|
|
111
|
+
cookies: []
|
|
112
|
+
});
|
|
113
|
+
expect(result).toBe('requests.get("https://example.com")');
|
|
114
|
+
});
|
|
115
|
+
it("adds basic auth credentials", () => {
|
|
116
|
+
const result = pythonRequests.generate(
|
|
117
|
+
{
|
|
118
|
+
url: "https://example.com"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
auth: {
|
|
122
|
+
username: "user",
|
|
123
|
+
password: "pass"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
expect(result).toBe(`requests.get("https://example.com",
|
|
128
|
+
auth=("user", "pass")
|
|
129
|
+
)`);
|
|
130
|
+
});
|
|
131
|
+
it("handles multipart form data with files", () => {
|
|
132
|
+
const result = pythonRequests.generate({
|
|
133
|
+
url: "https://example.com",
|
|
134
|
+
method: "POST",
|
|
135
|
+
postData: {
|
|
136
|
+
mimeType: "multipart/form-data",
|
|
137
|
+
params: [
|
|
138
|
+
{
|
|
139
|
+
name: "file",
|
|
140
|
+
fileName: "test.txt"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "field",
|
|
144
|
+
value: "value"
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
expect(result).toBe(`requests.post("https://example.com",
|
|
150
|
+
files=[
|
|
151
|
+
("file", open("test.txt", "rb"))
|
|
152
|
+
],
|
|
153
|
+
data={
|
|
154
|
+
"field": "value"
|
|
155
|
+
}
|
|
156
|
+
)`);
|
|
157
|
+
});
|
|
158
|
+
it("handles multipart form data with multiple files", () => {
|
|
159
|
+
const result = pythonRequests.generate({
|
|
160
|
+
url: "https://example.com",
|
|
161
|
+
method: "POST",
|
|
162
|
+
postData: {
|
|
163
|
+
mimeType: "multipart/form-data",
|
|
164
|
+
params: [
|
|
165
|
+
{
|
|
166
|
+
name: "file",
|
|
167
|
+
fileName: "test.txt"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "file",
|
|
171
|
+
fileName: "another.txt"
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
expect(result).toBe(`requests.post("https://example.com",
|
|
177
|
+
files=[
|
|
178
|
+
("file", open("test.txt", "rb")),
|
|
179
|
+
("file", open("another.txt", "rb"))
|
|
180
|
+
]
|
|
181
|
+
)`);
|
|
182
|
+
});
|
|
183
|
+
it("handles url-encoded form data", () => {
|
|
184
|
+
const result = pythonRequests.generate({
|
|
185
|
+
url: "https://example.com",
|
|
186
|
+
method: "POST",
|
|
187
|
+
postData: {
|
|
188
|
+
mimeType: "application/x-www-form-urlencoded",
|
|
189
|
+
params: [
|
|
190
|
+
{
|
|
191
|
+
name: "special chars!@#",
|
|
192
|
+
value: "value"
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
expect(result).toBe(`requests.post("https://example.com",
|
|
198
|
+
data={
|
|
199
|
+
"special chars!@#": "value"
|
|
200
|
+
}
|
|
201
|
+
)`);
|
|
202
|
+
});
|
|
203
|
+
it("handles binary data flag", () => {
|
|
204
|
+
const result = pythonRequests.generate({
|
|
205
|
+
url: "https://example.com",
|
|
206
|
+
method: "POST",
|
|
207
|
+
postData: {
|
|
208
|
+
mimeType: "application/octet-stream",
|
|
209
|
+
text: "binary content"
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
expect(result).toBe(`requests.post("https://example.com",
|
|
213
|
+
data=b"binary content"
|
|
214
|
+
)`);
|
|
215
|
+
});
|
|
216
|
+
it("handles compressed response", () => {
|
|
217
|
+
const result = pythonRequests.generate({
|
|
218
|
+
url: "https://example.com",
|
|
219
|
+
headers: [
|
|
220
|
+
{
|
|
221
|
+
name: "Accept-Encoding",
|
|
222
|
+
value: "gzip, deflate"
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
});
|
|
226
|
+
expect(result).toBe(`requests.get("https://example.com",
|
|
227
|
+
headers={
|
|
228
|
+
"Accept-Encoding": "gzip, deflate"
|
|
229
|
+
}
|
|
230
|
+
)`);
|
|
231
|
+
});
|
|
232
|
+
it("handles special characters in URL", () => {
|
|
233
|
+
const result = pythonRequests.generate({
|
|
234
|
+
url: "https://example.com/path with spaces/[brackets]"
|
|
235
|
+
});
|
|
236
|
+
expect(result).toBe(`requests.get(
|
|
237
|
+
"https://example.com/path with spaces/[brackets]"
|
|
238
|
+
)`);
|
|
239
|
+
});
|
|
240
|
+
it("handles special characters in query parameters", () => {
|
|
241
|
+
const result = pythonRequests.generate({
|
|
242
|
+
url: "https://example.com",
|
|
243
|
+
queryString: [
|
|
244
|
+
{
|
|
245
|
+
name: "q",
|
|
246
|
+
value: "hello world & more"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: "special",
|
|
250
|
+
value: "!@#$%^&*()"
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
});
|
|
254
|
+
expect(result).toBe(`requests.get("https://example.com",
|
|
255
|
+
params={
|
|
256
|
+
"q": "hello world & more",
|
|
257
|
+
"special": "!@#$%^&*()"
|
|
258
|
+
}
|
|
259
|
+
)`);
|
|
260
|
+
});
|
|
261
|
+
it("handles empty URL", () => {
|
|
262
|
+
const result = pythonRequests.generate({
|
|
263
|
+
url: ""
|
|
264
|
+
});
|
|
265
|
+
expect(result).toBe('requests.get("")');
|
|
266
|
+
});
|
|
267
|
+
it("doesn\u2019t add a line break for a short URL", () => {
|
|
268
|
+
const result = pythonRequests.generate({
|
|
269
|
+
url: "https://example.com"
|
|
270
|
+
});
|
|
271
|
+
expect(result).toBe('requests.get("https://example.com")');
|
|
272
|
+
});
|
|
273
|
+
it("handles extremely long URLs", () => {
|
|
274
|
+
const result = pythonRequests.generate({
|
|
275
|
+
url: "https://example.com/" + "a".repeat(2e3)
|
|
276
|
+
});
|
|
277
|
+
expect(result).toBe(`requests.get(
|
|
278
|
+
"https://example.com/${"a".repeat(2e3)}"
|
|
279
|
+
)`);
|
|
280
|
+
});
|
|
281
|
+
it("handles multiple headers with same name", () => {
|
|
282
|
+
const result = pythonRequests.generate({
|
|
283
|
+
url: "https://example.com",
|
|
284
|
+
headers: [
|
|
285
|
+
{ name: "X-Custom", value: "value1" },
|
|
286
|
+
{ name: "X-Custom", value: "value2" }
|
|
287
|
+
]
|
|
288
|
+
});
|
|
289
|
+
expect(result).toBe(`requests.get("https://example.com",
|
|
290
|
+
headers={
|
|
291
|
+
"X-Custom": "value1"
|
|
292
|
+
}
|
|
293
|
+
)`);
|
|
294
|
+
});
|
|
295
|
+
it("handles headers with empty values", () => {
|
|
296
|
+
const result = pythonRequests.generate({
|
|
297
|
+
url: "https://example.com",
|
|
298
|
+
headers: [{ name: "X-Empty", value: "" }]
|
|
299
|
+
});
|
|
300
|
+
expect(result).toBe(`requests.get("https://example.com",
|
|
301
|
+
headers={
|
|
302
|
+
"X-Empty": ""
|
|
303
|
+
}
|
|
304
|
+
)`);
|
|
305
|
+
});
|
|
306
|
+
it("handles multipart form data with empty file names", () => {
|
|
307
|
+
const result = pythonRequests.generate({
|
|
308
|
+
url: "https://example.com",
|
|
309
|
+
method: "POST",
|
|
310
|
+
postData: {
|
|
311
|
+
mimeType: "multipart/form-data",
|
|
312
|
+
params: [
|
|
313
|
+
{
|
|
314
|
+
name: "file",
|
|
315
|
+
fileName: ""
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
expect(result).toBe(`requests.post("https://example.com",
|
|
321
|
+
files=[
|
|
322
|
+
("file", open("", "rb"))
|
|
323
|
+
]
|
|
324
|
+
)`);
|
|
325
|
+
});
|
|
326
|
+
it("handles JSON body with special characters", () => {
|
|
327
|
+
const result = pythonRequests.generate({
|
|
328
|
+
url: "https://example.com",
|
|
329
|
+
method: "POST",
|
|
330
|
+
headers: [
|
|
331
|
+
{
|
|
332
|
+
name: "Content-Type",
|
|
333
|
+
value: "application/json"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
postData: {
|
|
337
|
+
mimeType: "application/json",
|
|
338
|
+
text: JSON.stringify({
|
|
339
|
+
key: '"quotes" and \\backslashes\\',
|
|
340
|
+
nested: {
|
|
341
|
+
array: ["item1", null, void 0]
|
|
342
|
+
}
|
|
343
|
+
})
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
expect(result).toBe(`requests.post("https://example.com",
|
|
347
|
+
headers={
|
|
348
|
+
"Content-Type": "application/json"
|
|
349
|
+
},
|
|
350
|
+
json={
|
|
351
|
+
"key": "\\"quotes\\" and \\\\backslashes\\\\",
|
|
352
|
+
"nested": {
|
|
353
|
+
"array": [
|
|
354
|
+
"item1",
|
|
355
|
+
null,
|
|
356
|
+
null
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
)`);
|
|
361
|
+
});
|
|
362
|
+
it("handles cookies with special characters", () => {
|
|
363
|
+
const result = pythonRequests.generate({
|
|
364
|
+
url: "https://example.com",
|
|
365
|
+
cookies: [
|
|
366
|
+
{
|
|
367
|
+
name: "special;cookie",
|
|
368
|
+
value: "value with spaces"
|
|
369
|
+
}
|
|
370
|
+
]
|
|
371
|
+
});
|
|
372
|
+
expect(result).toBe(`requests.get("https://example.com",
|
|
373
|
+
cookies={
|
|
374
|
+
"special;cookie": "value with spaces"
|
|
375
|
+
}
|
|
376
|
+
)`);
|
|
377
|
+
});
|
|
378
|
+
it("prettifies JSON body", () => {
|
|
379
|
+
const result = pythonRequests.generate({
|
|
380
|
+
url: "https://example.com",
|
|
381
|
+
method: "POST",
|
|
382
|
+
headers: [
|
|
383
|
+
{
|
|
384
|
+
name: "Content-Type",
|
|
385
|
+
value: "application/json"
|
|
386
|
+
}
|
|
387
|
+
],
|
|
388
|
+
postData: {
|
|
389
|
+
mimeType: "application/json",
|
|
390
|
+
text: JSON.stringify({
|
|
391
|
+
nested: {
|
|
392
|
+
array: [1, 2, 3],
|
|
393
|
+
object: { foo: "bar" }
|
|
394
|
+
},
|
|
395
|
+
simple: "value"
|
|
396
|
+
})
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
expect(result).toBe(`requests.post("https://example.com",
|
|
400
|
+
headers={
|
|
401
|
+
"Content-Type": "application/json"
|
|
402
|
+
},
|
|
403
|
+
json={
|
|
404
|
+
"nested": {
|
|
405
|
+
"array": [
|
|
406
|
+
1,
|
|
407
|
+
2,
|
|
408
|
+
3
|
|
409
|
+
],
|
|
410
|
+
"object": {
|
|
411
|
+
"foo": "bar"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"simple": "value"
|
|
415
|
+
}
|
|
416
|
+
)`);
|
|
417
|
+
});
|
|
418
|
+
});
|
|
419
|
+
//# sourceMappingURL=requests.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/plugins/python/requests/requests.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\nimport { pythonRequests } from './requests'\n\ndescribe('pythonRequests', () => {\n it('returns a basic request', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n })\n\n expect(result).toBe('requests.get(\"https://example.com\")')\n })\n\n it('returns a POST request', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n method: 'post',\n })\n\n expect(result).toBe('requests.post(\"https://example.com\")')\n })\n\n it('has headers', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n headers: [\n {\n name: 'Content-Type',\n value: 'application/json',\n },\n ],\n })\n\n expect(result).toBe(`requests.get(\"https://example.com\",\n headers={\n \"Content-Type\": \"application/json\"\n }\n)`)\n })\n\n it('doesn\u2019t add empty headers', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n headers: [],\n })\n\n expect(result).toBe('requests.get(\"https://example.com\")')\n })\n\n it('has JSON body', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n method: 'POST',\n headers: [\n {\n name: 'Content-Type',\n value: 'application/json',\n },\n ],\n postData: {\n mimeType: 'application/json',\n text: JSON.stringify({\n hello: 'world',\n }),\n },\n })\n\n expect(result).toBe(`requests.post(\"https://example.com\",\n headers={\n \"Content-Type\": \"application/json\"\n },\n json={\n \"hello\": \"world\"\n }\n)`)\n })\n\n it('has query string', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n queryString: [\n {\n name: 'foo',\n value: 'bar',\n },\n {\n name: 'bar',\n value: 'foo',\n },\n ],\n })\n\n expect(result).toBe(`requests.get(\"https://example.com\",\n params={\n \"foo\": \"bar\",\n \"bar\": \"foo\"\n }\n)`)\n })\n\n it('has cookies', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n cookies: [\n {\n name: 'foo',\n value: 'bar',\n },\n {\n name: 'bar',\n value: 'foo',\n },\n ],\n })\n\n expect(result).toBe(`requests.get(\"https://example.com\",\n cookies={\n \"foo\": \"bar\",\n \"bar\": \"foo\"\n }\n)`)\n })\n\n it('doesn\u2019t add empty cookies', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n cookies: [],\n })\n\n expect(result).toBe('requests.get(\"https://example.com\")')\n })\n\n it('adds basic auth credentials', () => {\n const result = pythonRequests.generate(\n {\n url: 'https://example.com',\n },\n {\n auth: {\n username: 'user',\n password: 'pass',\n },\n },\n )\n\n expect(result).toBe(`requests.get(\"https://example.com\",\n auth=(\"user\", \"pass\")\n)`)\n })\n\n it('handles multipart form data with files', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n method: 'POST',\n postData: {\n mimeType: 'multipart/form-data',\n params: [\n {\n name: 'file',\n fileName: 'test.txt',\n },\n {\n name: 'field',\n value: 'value',\n },\n ],\n },\n })\n\n expect(result).toBe(`requests.post(\"https://example.com\",\n files=[\n (\"file\", open(\"test.txt\", \"rb\"))\n ],\n data={\n \"field\": \"value\"\n }\n)`)\n })\n\n it('handles multipart form data with multiple files', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n method: 'POST',\n postData: {\n mimeType: 'multipart/form-data',\n params: [\n {\n name: 'file',\n fileName: 'test.txt',\n },\n {\n name: 'file',\n fileName: 'another.txt',\n },\n ],\n },\n })\n\n expect(result).toBe(`requests.post(\"https://example.com\",\n files=[\n (\"file\", open(\"test.txt\", \"rb\")),\n (\"file\", open(\"another.txt\", \"rb\"))\n ]\n)`)\n })\n\n it('handles url-encoded form data', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n method: 'POST',\n postData: {\n mimeType: 'application/x-www-form-urlencoded',\n params: [\n {\n name: 'special chars!@#',\n value: 'value',\n },\n ],\n },\n })\n\n expect(result).toBe(`requests.post(\"https://example.com\",\n data={\n \"special chars!@#\": \"value\"\n }\n)`)\n })\n\n it('handles binary data flag', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n method: 'POST',\n postData: {\n mimeType: 'application/octet-stream',\n text: 'binary content',\n },\n })\n\n expect(result).toBe(`requests.post(\"https://example.com\",\n data=b\"binary content\"\n)`)\n })\n\n it('handles compressed response', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n headers: [\n {\n name: 'Accept-Encoding',\n value: 'gzip, deflate',\n },\n ],\n })\n\n expect(result).toBe(`requests.get(\"https://example.com\",\n headers={\n \"Accept-Encoding\": \"gzip, deflate\"\n }\n)`)\n })\n\n it('handles special characters in URL', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com/path with spaces/[brackets]',\n })\n\n expect(result).toBe(`requests.get(\n \"https://example.com/path with spaces/[brackets]\"\n)`)\n })\n\n it('handles special characters in query parameters', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n queryString: [\n {\n name: 'q',\n value: 'hello world & more',\n },\n {\n name: 'special',\n value: '!@#$%^&*()',\n },\n ],\n })\n\n expect(result).toBe(`requests.get(\"https://example.com\",\n params={\n \"q\": \"hello world & more\",\n \"special\": \"!@#$%^&*()\"\n }\n)`)\n })\n\n it('handles empty URL', () => {\n const result = pythonRequests.generate({\n url: '',\n })\n\n expect(result).toBe('requests.get(\"\")')\n })\n\n it('doesn\u2019t add a line break for a short URL', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n })\n\n expect(result).toBe('requests.get(\"https://example.com\")')\n })\n\n it('handles extremely long URLs', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com/' + 'a'.repeat(2000),\n })\n\n expect(result).toBe(`requests.get(\n \"https://example.com/${'a'.repeat(2000)}\"\n)`)\n })\n\n it('handles multiple headers with same name', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n headers: [\n { name: 'X-Custom', value: 'value1' },\n { name: 'X-Custom', value: 'value2' },\n ],\n })\n\n expect(result).toBe(`requests.get(\"https://example.com\",\n headers={\n \"X-Custom\": \"value1\"\n }\n)`)\n })\n\n it('handles headers with empty values', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n headers: [{ name: 'X-Empty', value: '' }],\n })\n\n expect(result).toBe(`requests.get(\"https://example.com\",\n headers={\n \"X-Empty\": \"\"\n }\n)`)\n })\n\n it('handles multipart form data with empty file names', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n method: 'POST',\n postData: {\n mimeType: 'multipart/form-data',\n params: [\n {\n name: 'file',\n fileName: '',\n },\n ],\n },\n })\n\n expect(result).toBe(`requests.post(\"https://example.com\",\n files=[\n (\"file\", open(\"\", \"rb\"))\n ]\n)`)\n })\n\n it('handles JSON body with special characters', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n method: 'POST',\n headers: [\n {\n name: 'Content-Type',\n value: 'application/json',\n },\n ],\n postData: {\n mimeType: 'application/json',\n text: JSON.stringify({\n key: '\"quotes\" and \\\\backslashes\\\\',\n nested: {\n array: ['item1', null, undefined],\n },\n }),\n },\n })\n\n expect(result).toBe(`requests.post(\"https://example.com\",\n headers={\n \"Content-Type\": \"application/json\"\n },\n json={\n \"key\": \"\\\\\"quotes\\\\\" and \\\\\\\\backslashes\\\\\\\\\",\n \"nested\": {\n \"array\": [\n \"item1\",\n null,\n null\n ]\n }\n }\n)`)\n })\n\n it('handles cookies with special characters', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n cookies: [\n {\n name: 'special;cookie',\n value: 'value with spaces',\n },\n ],\n })\n\n expect(result).toBe(`requests.get(\"https://example.com\",\n cookies={\n \"special;cookie\": \"value with spaces\"\n }\n)`)\n })\n\n it('prettifies JSON body', () => {\n const result = pythonRequests.generate({\n url: 'https://example.com',\n method: 'POST',\n headers: [\n {\n name: 'Content-Type',\n value: 'application/json',\n },\n ],\n postData: {\n mimeType: 'application/json',\n text: JSON.stringify({\n nested: {\n array: [1, 2, 3],\n object: { foo: 'bar' },\n },\n simple: 'value',\n }),\n },\n })\n\n expect(result).toBe(`requests.post(\"https://example.com\",\n headers={\n \"Content-Type\": \"application/json\"\n },\n json={\n \"nested\": {\n \"array\": [\n 1,\n 2,\n 3\n ],\n \"object\": {\n \"foo\": \"bar\"\n }\n },\n \"simple\": \"value\"\n }\n)`)\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AACrC,SAAS,sBAAsB;AAE/B,SAAS,kBAAkB,MAAM;AAC/B,KAAG,2BAA2B,MAAM;AAClC,UAAM,SAAS,eAAe,SAAS;AAAA,MACrC,KAAK;AAAA,IACP,CAAC;AAED,WAAO,MAAM,EAAE,KAAK,qCAAqC;AAAA,EAC3D,CAAC;AAED,KAAG,0BAA0B,MAAM;AACjC,UAAM,SAAS,eAAe,SAAS;AAAA,MACrC,KAAK;AAAA,MACL,QAAQ;AAAA,IACV,CAAC;AAED,WAAO,MAAM,EAAE,KAAK,sCAAsC;AAAA,EAC5D,CAAC;AAED,KAAG,eAAe,MAAM;AACtB,UAAM,SAAS,eAAe,SAAS;AAAA,MACrC,KAAK;AAAA,MACL,SAAS;AAAA,QACP;AAAA,UACE,MAAM;AAAA,UACN,OAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF,CAAC;AAED,WAAO,MAAM,EAAE,KAAK;AAAA;AAAA;AAAA;AAAA,EAItB;AAAA,EACA,CAAC;AAED,KAAG,kCAA6B,MAAM;AACpC,UAAM,SAAS,eAAe,SAAS;AAAA,MACrC,KAAK;AAAA,MACL,SAAS,CAAC;AAAA,IACZ,CAAC;AAED,WAAO,MAAM,EAAE,KAAK,qCAAqC;AAAA,EAC3D,CAAC;AAED,KAAG,iBAAiB,MAAM;AACxB,UAAM,SAAS,eAAe,SAAS;AAAA,MACrC,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,SAAS;AAAA,QACP;AAAA,UACE,MAAM;AAAA,UACN,OAAO;AAAA,QACT;AAAA,MACF;AAAA,MACA,UAAU;AAAA,QACR,UAAU;AAAA,QACV,MAAM,KAAK,UAAU;AAAA,UACnB,OAAO;AAAA,QACT,CA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AK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EActB;AAAA,EACA,CAAC;AAED,KAAG,2CAA2C,MAAM;AAClD,UAAM,SAAS,eAAe,SAAS;AAAA,MACrC,KAAK;AAAA,MACL,SAAS;AAAA,QACP;AAAA,UACE,MAAM;AAAA,UACN,OAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF,CAAC;AAED,WAAO,MAAM,EAAE,KAAK;AAAA;AAAA;AAAA;AAAA,EAItB;AAAA,EACA,CAAC;AAED,KAAG,wBAAwB,MAAM;AAC/B,UAAM,SAAS,eAAe,SAAS;AAAA,MACrC,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,SAAS;AAAA,QACP;AAAA,UACE,MAAM;AAAA,UACN,OAAO;AAAA,QACT;AAAA,MACF;AAAA,MACA,UAAU;AAAA,QACR,UAAU;AAAA,QACV,MAAM,KAAK,UAAU;AAAA,UACnB,QAAQ;AAAA,YACN,OAAO,CAAC,GAAG,GAAG,CAAC;AAAA,YACf,QAAQ,EAAE,KAAK,MAAM;AAAA,UACvB;AAAA,UACA,QAAQ;AAAA,QACV,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAED,WAAO,MAAM,EAAE,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBtB;AAAA,EACA,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { httr } from
|
|
2
|
-
import { convertWithHttpSnippetLite } from
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* r/httr
|
|
6
|
-
*/
|
|
1
|
+
import { httr } from "../../../httpsnippet-lite/esm/targets/r/httr/client.js";
|
|
2
|
+
import { convertWithHttpSnippetLite } from "../../../utils/convertWithHttpSnippetLite.js";
|
|
7
3
|
const rHttr = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
4
|
+
target: "r",
|
|
5
|
+
client: "httr",
|
|
6
|
+
title: "httr",
|
|
7
|
+
generate(request) {
|
|
8
|
+
return convertWithHttpSnippetLite(httr, request);
|
|
9
|
+
}
|
|
15
10
|
};
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
export {
|
|
12
|
+
rHttr
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=httr.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/plugins/r/httr/httr.ts"],
|
|
4
|
+
"sourcesContent": ["import { httr } from '@/httpsnippet-lite/esm/targets/r/httr/client'\nimport { convertWithHttpSnippetLite } from '@/utils/convertWithHttpSnippetLite'\nimport type { Plugin } from '@scalar/types/snippetz'\n\n/**\n * r/httr\n */\nexport const rHttr: Plugin = {\n target: 'r',\n client: 'httr',\n title: 'httr',\n generate(request) {\n // TODO: Write an own converter\n return convertWithHttpSnippetLite(httr, request)\n },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,YAAY;AACrB,SAAS,kCAAkC;AAMpC,MAAM,QAAgB;AAAA,EAC3B,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS,SAAS;AAEhB,WAAO,2BAA2B,MAAM,OAAO;AAAA,EACjD;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./httr.js";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./native.js";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { native } from
|
|
2
|
-
import { convertWithHttpSnippetLite } from
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* ruby/native
|
|
6
|
-
*/
|
|
1
|
+
import { native } from "../../../httpsnippet-lite/esm/targets/ruby/native/client.js";
|
|
2
|
+
import { convertWithHttpSnippetLite } from "../../../utils/convertWithHttpSnippetLite.js";
|
|
7
3
|
const rubyNative = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
4
|
+
target: "ruby",
|
|
5
|
+
client: "native",
|
|
6
|
+
title: "net::http",
|
|
7
|
+
generate(request) {
|
|
8
|
+
return convertWithHttpSnippetLite(native, request);
|
|
9
|
+
}
|
|
15
10
|
};
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
export {
|
|
12
|
+
rubyNative
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=native.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/plugins/ruby/native/native.ts"],
|
|
4
|
+
"sourcesContent": ["import { native } from '@/httpsnippet-lite/esm/targets/ruby/native/client'\nimport { convertWithHttpSnippetLite } from '@/utils/convertWithHttpSnippetLite'\nimport type { Plugin } from '@scalar/types/snippetz'\n\n/**\n * ruby/native\n */\nexport const rubyNative: Plugin = {\n target: 'ruby',\n client: 'native',\n title: 'net::http',\n generate(request) {\n // TODO: Write an own converter\n return convertWithHttpSnippetLite(native, request)\n },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,kCAAkC;AAMpC,MAAM,aAAqB;AAAA,EAChC,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS,SAAS;AAEhB,WAAO,2BAA2B,QAAQ,OAAO;AAAA,EACnD;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|