@scalar/snippetz 0.2.15 → 0.2.17

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.
Files changed (87) hide show
  1. package/README.md +0 -2
  2. package/dist/clients.d.ts +1 -1
  3. package/dist/clients.d.ts.map +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/plugins/c/libcurl/libcurl.d.ts +1 -1
  8. package/dist/plugins/c/libcurl/libcurl.d.ts.map +1 -1
  9. package/dist/plugins/clojure/clj_http/clj_http.d.ts +1 -1
  10. package/dist/plugins/clojure/clj_http/clj_http.d.ts.map +1 -1
  11. package/dist/plugins/csharp/httpclient/httpclient.d.ts +1 -1
  12. package/dist/plugins/csharp/httpclient/httpclient.d.ts.map +1 -1
  13. package/dist/plugins/csharp/restsharp/restsharp.d.ts +1 -1
  14. package/dist/plugins/csharp/restsharp/restsharp.d.ts.map +1 -1
  15. package/dist/plugins/dart/http/http.d.ts +1 -1
  16. package/dist/plugins/dart/http/http.d.ts.map +1 -1
  17. package/dist/plugins/go/native/native.d.ts +1 -1
  18. package/dist/plugins/go/native/native.d.ts.map +1 -1
  19. package/dist/plugins/http/http11/http11.d.ts +1 -1
  20. package/dist/plugins/http/http11/http11.d.ts.map +1 -1
  21. package/dist/plugins/java/asynchttp/asynchttp.d.ts +1 -1
  22. package/dist/plugins/java/asynchttp/asynchttp.d.ts.map +1 -1
  23. package/dist/plugins/java/nethttp/nethttp.d.ts +1 -1
  24. package/dist/plugins/java/nethttp/nethttp.d.ts.map +1 -1
  25. package/dist/plugins/java/okhttp/okhttp.d.ts +1 -1
  26. package/dist/plugins/java/okhttp/okhttp.d.ts.map +1 -1
  27. package/dist/plugins/java/unirest/unirest.d.ts +1 -1
  28. package/dist/plugins/java/unirest/unirest.d.ts.map +1 -1
  29. package/dist/plugins/js/axios/axios.d.ts +1 -1
  30. package/dist/plugins/js/axios/axios.d.ts.map +1 -1
  31. package/dist/plugins/js/fetch/fetch.d.ts +1 -1
  32. package/dist/plugins/js/fetch/fetch.d.ts.map +1 -1
  33. package/dist/plugins/js/jquery/jquery.d.ts +1 -1
  34. package/dist/plugins/js/jquery/jquery.d.ts.map +1 -1
  35. package/dist/plugins/js/ofetch/ofetch.d.ts +1 -1
  36. package/dist/plugins/js/ofetch/ofetch.d.ts.map +1 -1
  37. package/dist/plugins/js/xhr/xhr.d.ts +1 -1
  38. package/dist/plugins/js/xhr/xhr.d.ts.map +1 -1
  39. package/dist/plugins/kotlin/okhttp/okhttp.d.ts +1 -1
  40. package/dist/plugins/kotlin/okhttp/okhttp.d.ts.map +1 -1
  41. package/dist/plugins/node/axios/axios.d.ts +1 -1
  42. package/dist/plugins/node/axios/axios.d.ts.map +1 -1
  43. package/dist/plugins/node/fetch/fetch.d.ts +1 -1
  44. package/dist/plugins/node/fetch/fetch.d.ts.map +1 -1
  45. package/dist/plugins/node/ofetch/ofetch.d.ts +1 -1
  46. package/dist/plugins/node/ofetch/ofetch.d.ts.map +1 -1
  47. package/dist/plugins/node/undici/undici.d.ts +1 -1
  48. package/dist/plugins/node/undici/undici.d.ts.map +1 -1
  49. package/dist/plugins/objc/nsurlsession/nsurlsession.d.ts +1 -1
  50. package/dist/plugins/objc/nsurlsession/nsurlsession.d.ts.map +1 -1
  51. package/dist/plugins/ocaml/cohttp/cohttp.d.ts +1 -1
  52. package/dist/plugins/ocaml/cohttp/cohttp.d.ts.map +1 -1
  53. package/dist/plugins/php/curl/curl.d.ts +1 -1
  54. package/dist/plugins/php/curl/curl.d.ts.map +1 -1
  55. package/dist/plugins/php/guzzle/guzzle.d.ts +1 -1
  56. package/dist/plugins/php/guzzle/guzzle.d.ts.map +1 -1
  57. package/dist/plugins/powershell/restmethod/restmethod.d.ts +1 -1
  58. package/dist/plugins/powershell/restmethod/restmethod.d.ts.map +1 -1
  59. package/dist/plugins/powershell/webrequest/webrequest.d.ts +1 -1
  60. package/dist/plugins/powershell/webrequest/webrequest.d.ts.map +1 -1
  61. package/dist/plugins/python/python3/python3.d.ts +1 -1
  62. package/dist/plugins/python/python3/python3.d.ts.map +1 -1
  63. package/dist/plugins/python/requests/requests.d.ts +1 -1
  64. package/dist/plugins/python/requests/requests.d.ts.map +1 -1
  65. package/dist/plugins/r/httr/httr.d.ts +1 -1
  66. package/dist/plugins/r/httr/httr.d.ts.map +1 -1
  67. package/dist/plugins/ruby/native/native.d.ts +1 -1
  68. package/dist/plugins/ruby/native/native.d.ts.map +1 -1
  69. package/dist/plugins/shell/curl/curl.d.ts +1 -1
  70. package/dist/plugins/shell/curl/curl.d.ts.map +1 -1
  71. package/dist/plugins/shell/curl/curl.js +18 -4
  72. package/dist/plugins/shell/httpie/httpie.d.ts +1 -1
  73. package/dist/plugins/shell/httpie/httpie.d.ts.map +1 -1
  74. package/dist/plugins/shell/wget/wget.d.ts +1 -1
  75. package/dist/plugins/shell/wget/wget.d.ts.map +1 -1
  76. package/dist/plugins/swift/nsurlsession/nsurlsession.d.ts +1 -1
  77. package/dist/plugins/swift/nsurlsession/nsurlsession.d.ts.map +1 -1
  78. package/dist/snippetz.d.ts +3 -3
  79. package/dist/snippetz.d.ts.map +1 -1
  80. package/dist/utils/convertWithHttpSnippetLite.d.ts +1 -1
  81. package/dist/utils/convertWithHttpSnippetLite.d.ts.map +1 -1
  82. package/package.json +3 -8
  83. package/dist/types/index.d.ts +0 -42
  84. package/dist/types/index.d.ts.map +0 -1
  85. package/dist/types/index.js +0 -42
  86. package/dist/types/index.test-d.d.ts +0 -2
  87. package/dist/types/index.test-d.d.ts.map +0 -1
package/README.md CHANGED
@@ -7,8 +7,6 @@
7
7
 
8
8
  A modern way to generate HTTP request examples for different languages and libraries.
9
9
 
10
- Check out some examples [here](https://scalar-snippetz-801498848929.us-central1.run.app/)
11
-
12
10
  ## Installation
13
11
 
14
12
  ```bash
package/dist/clients.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Target } from './types/index.js';
1
+ import type { Target } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * All available clients
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../src/clients.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,EAmH3B,CAAA"}
1
+ {"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../src/clients.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,EAmH3B,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './snippetz.js';
2
- export * from './types/index.js';
2
+ export * from '@scalar/types/snippetz';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAE1B,cAAc,wBAAwB,CAAA"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export { snippetz } from './snippetz.js';
2
- export { AVAILABLE_CLIENTS } from './types/index.js';
2
+ export * from '@scalar/types/snippetz';
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * c/libcurl
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"libcurl.d.ts","sourceRoot":"","sources":["../../../../src/plugins/c/libcurl/libcurl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAQtB,CAAA"}
1
+ {"version":3,"file":"libcurl.d.ts","sourceRoot":"","sources":["../../../../src/plugins/c/libcurl/libcurl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAQtB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * clojure/clj_http
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"clj_http.d.ts","sourceRoot":"","sources":["../../../../src/plugins/clojure/clj_http/clj_http.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAQ5B,CAAA"}
1
+ {"version":3,"file":"clj_http.d.ts","sourceRoot":"","sources":["../../../../src/plugins/clojure/clj_http/clj_http.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAQ5B,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * csharp/httpclient
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"httpclient.d.ts","sourceRoot":"","sources":["../../../../src/plugins/csharp/httpclient/httpclient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAQ9B,CAAA"}
1
+ {"version":3,"file":"httpclient.d.ts","sourceRoot":"","sources":["../../../../src/plugins/csharp/httpclient/httpclient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAQ9B,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * csharp/restsharp
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"restsharp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/csharp/restsharp/restsharp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAQ7B,CAAA"}
1
+ {"version":3,"file":"restsharp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/csharp/restsharp/restsharp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAQ7B,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * dart/http
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dart/http/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MA4GtB,CAAA"}
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dart/http/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MA4GtB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * go/native
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../src/plugins/go/native/native.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAQtB,CAAA"}
1
+ {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../src/plugins/go/native/native.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAQtB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * http/http1.1
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"http11.d.ts","sourceRoot":"","sources":["../../../../src/plugins/http/http11/http11.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAoHxB,CAAA"}
1
+ {"version":3,"file":"http11.d.ts","sourceRoot":"","sources":["../../../../src/plugins/http/http11/http11.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAoHxB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * java/asynchttp
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"asynchttp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/java/asynchttp/asynchttp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAQ3B,CAAA"}
1
+ {"version":3,"file":"asynchttp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/java/asynchttp/asynchttp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAQ3B,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * java/nethttp
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"nethttp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/java/nethttp/nethttp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAQzB,CAAA"}
1
+ {"version":3,"file":"nethttp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/java/nethttp/nethttp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAQzB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * java/okhttp
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"okhttp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/java/okhttp/okhttp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAQxB,CAAA"}
1
+ {"version":3,"file":"okhttp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/java/okhttp/okhttp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAQxB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * java/unirest
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"unirest.d.ts","sourceRoot":"","sources":["../../../../src/plugins/java/unirest/unirest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAQzB,CAAA"}
1
+ {"version":3,"file":"unirest.d.ts","sourceRoot":"","sources":["../../../../src/plugins/java/unirest/unirest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAQzB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * js/axios
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"axios.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/axios/axios.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAQrB,CAAA"}
1
+ {"version":3,"file":"axios.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/axios/axios.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAQrB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * js/fetch
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/fetch/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIrC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAqErB,CAAA"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/fetch/fetch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAqErB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * js/jquery
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"jquery.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/jquery/jquery.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAQtB,CAAA"}
1
+ {"version":3,"file":"jquery.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/jquery/jquery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAQtB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * js/ofetch
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ofetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/ofetch/ofetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIrC;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MA6EtB,CAAA"}
1
+ {"version":3,"file":"ofetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/ofetch/ofetch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MA6EtB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * js/xhr
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"xhr.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/xhr/xhr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,MAQnB,CAAA"}
1
+ {"version":3,"file":"xhr.d.ts","sourceRoot":"","sources":["../../../../src/plugins/js/xhr/xhr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,MAQnB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * kotlin/okhttp
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"okhttp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/kotlin/okhttp/okhttp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAQ1B,CAAA"}
1
+ {"version":3,"file":"okhttp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/kotlin/okhttp/okhttp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAQ1B,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * node/axios
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"axios.d.ts","sourceRoot":"","sources":["../../../../src/plugins/node/axios/axios.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAQvB,CAAA"}
1
+ {"version":3,"file":"axios.d.ts","sourceRoot":"","sources":["../../../../src/plugins/node/axios/axios.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAQvB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * node/fetch
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/node/fetch/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIrC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAqEvB,CAAA"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/node/fetch/fetch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAqEvB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * node/ofetch
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ofetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/node/ofetch/ofetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIrC;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MA6ExB,CAAA"}
1
+ {"version":3,"file":"ofetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/node/ofetch/ofetch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MA6ExB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * node/undici
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"undici.d.ts","sourceRoot":"","sources":["../../../../src/plugins/node/undici/undici.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIrC;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAuExB,CAAA"}
1
+ {"version":3,"file":"undici.d.ts","sourceRoot":"","sources":["../../../../src/plugins/node/undici/undici.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAuExB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * objc/nsurlsession
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"nsurlsession.d.ts","sourceRoot":"","sources":["../../../../src/plugins/objc/nsurlsession/nsurlsession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAQ9B,CAAA"}
1
+ {"version":3,"file":"nsurlsession.d.ts","sourceRoot":"","sources":["../../../../src/plugins/objc/nsurlsession/nsurlsession.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAQ9B,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * ocaml/cohttp
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"cohttp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/ocaml/cohttp/cohttp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAQzB,CAAA"}
1
+ {"version":3,"file":"cohttp.d.ts","sourceRoot":"","sources":["../../../../src/plugins/ocaml/cohttp/cohttp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAQzB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * php/curl
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../../src/plugins/php/curl/curl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAQrB,CAAA"}
1
+ {"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../../src/plugins/php/curl/curl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAQrB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * php/guzzle
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"guzzle.d.ts","sourceRoot":"","sources":["../../../../src/plugins/php/guzzle/guzzle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAQvB,CAAA"}
1
+ {"version":3,"file":"guzzle.d.ts","sourceRoot":"","sources":["../../../../src/plugins/php/guzzle/guzzle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAQvB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * powershell/restmethod
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"restmethod.d.ts","sourceRoot":"","sources":["../../../../src/plugins/powershell/restmethod/restmethod.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAQlC,CAAA"}
1
+ {"version":3,"file":"restmethod.d.ts","sourceRoot":"","sources":["../../../../src/plugins/powershell/restmethod/restmethod.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAQlC,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * powershell/webrequest
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"webrequest.d.ts","sourceRoot":"","sources":["../../../../src/plugins/powershell/webrequest/webrequest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAQlC,CAAA"}
1
+ {"version":3,"file":"webrequest.d.ts","sourceRoot":"","sources":["../../../../src/plugins/powershell/webrequest/webrequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAQlC,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * python/python3
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"python3.d.ts","sourceRoot":"","sources":["../../../../src/plugins/python/python3/python3.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAQ3B,CAAA"}
1
+ {"version":3,"file":"python3.d.ts","sourceRoot":"","sources":["../../../../src/plugins/python/python3/python3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAQ3B,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * python/requests
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/plugins/python/requests/requests.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAQ5B,CAAA"}
1
+ {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/plugins/python/requests/requests.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAQ5B,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * r/httr
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"httr.d.ts","sourceRoot":"","sources":["../../../../src/plugins/r/httr/httr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,MAQnB,CAAA"}
1
+ {"version":3,"file":"httr.d.ts","sourceRoot":"","sources":["../../../../src/plugins/r/httr/httr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,MAQnB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * ruby/native
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../src/plugins/ruby/native/native.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAQxB,CAAA"}
1
+ {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../src/plugins/ruby/native/native.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAQxB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * shell/curl
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../../src/plugins/shell/curl/curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAyGvB,CAAA"}
1
+ {"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../../src/plugins/shell/curl/curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAqHvB,CAAA"}
@@ -67,9 +67,15 @@ const shellCurl = {
67
67
  if (normalizedRequest.postData.mimeType === 'application/json') {
68
68
  // Pretty print JSON data
69
69
  if (normalizedRequest.postData.text) {
70
- const jsonData = JSON.parse(normalizedRequest.postData.text);
71
- const prettyJson = JSON.stringify(jsonData, null, 2);
72
- parts.push(`--data '${prettyJson}'`);
70
+ try {
71
+ const jsonData = JSON.parse(normalizedRequest.postData.text);
72
+ const prettyJson = JSON.stringify(jsonData, null, 2);
73
+ parts.push(`--data '${prettyJson}'`);
74
+ }
75
+ catch {
76
+ // If JSON parsing fails, use the original text
77
+ parts.push(`--data '${normalizedRequest.postData.text}'`);
78
+ }
73
79
  }
74
80
  }
75
81
  else if (normalizedRequest.postData.mimeType === 'application/octet-stream') {
@@ -94,7 +100,15 @@ const shellCurl = {
94
100
  });
95
101
  }
96
102
  else {
97
- parts.push(`--data "${normalizedRequest.postData.text}"`);
103
+ // Try to parse and pretty print if it's JSON, otherwise use raw text
104
+ try {
105
+ const jsonData = JSON.parse(normalizedRequest.postData.text ?? '');
106
+ const prettyJson = JSON.stringify(jsonData, null, 2);
107
+ parts.push(`--data '${prettyJson}'`);
108
+ }
109
+ catch {
110
+ parts.push(`--data '${normalizedRequest.postData.text}'`);
111
+ }
98
112
  }
99
113
  }
100
114
  return parts.join(' \\\n ');
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * shell/httpie
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"httpie.d.ts","sourceRoot":"","sources":["../../../../src/plugins/shell/httpie/httpie.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAQzB,CAAA"}
1
+ {"version":3,"file":"httpie.d.ts","sourceRoot":"","sources":["../../../../src/plugins/shell/httpie/httpie.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAQzB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * shell/wget
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"wget.d.ts","sourceRoot":"","sources":["../../../../src/plugins/shell/wget/wget.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAQvB,CAAA"}
1
+ {"version":3,"file":"wget.d.ts","sourceRoot":"","sources":["../../../../src/plugins/shell/wget/wget.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAQvB,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../../types/index.js';
1
+ import type { Plugin } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * swift/nsurlsession
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"nsurlsession.d.ts","sourceRoot":"","sources":["../../../../src/plugins/swift/nsurlsession/nsurlsession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAQ/B,CAAA"}
1
+ {"version":3,"file":"nsurlsession.d.ts","sourceRoot":"","sources":["../../../../src/plugins/swift/nsurlsession/nsurlsession.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAQ/B,CAAA"}
@@ -1,15 +1,15 @@
1
- import type { ClientId, HarRequest, TargetId } from './types/index.js';
1
+ import type { ClientId, HarRequest, TargetId } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * Generate code examples for HAR requests
4
4
  */
5
5
  export declare function snippetz(): {
6
6
  print<T extends TargetId>(target: T, client: ClientId<T>, request: Partial<HarRequest>): string | undefined;
7
- clients(): import("./types/index.js").Target[];
7
+ clients(): import("@scalar/types/snippetz").Target[];
8
8
  plugins(): {
9
9
  target: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
10
10
  client: "libcurl" | "clj_http" | "httpclient" | "restsharp" | "native" | "http" | "http1.1" | "asynchttp" | "nethttp" | "okhttp" | "unirest" | "axios" | "fetch" | "jquery" | "ofetch" | "xhr" | "undici" | "nsurlsession" | "cohttp" | "curl" | "guzzle" | "restmethod" | "webrequest" | "python3" | "requests" | "httr" | "httpie" | "wget";
11
11
  }[];
12
- findPlugin: <T extends TargetId>(target: T | string, client: ClientId<T> | string) => import("./types/index.js").Plugin | undefined;
12
+ findPlugin: <T extends TargetId>(target: T | string, client: ClientId<T> | string) => import("@scalar/types/snippetz").Plugin | undefined;
13
13
  hasPlugin<T extends TargetId>(target: T | string, client: ClientId<T> | string): boolean;
14
14
  };
15
15
  //# sourceMappingURL=snippetz.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"snippetz.d.ts","sourceRoot":"","sources":["../src/snippetz.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE7D;;GAEG;AACH,wBAAgB,QAAQ;UAMd,CAAC,SAAS,QAAQ,UAAU,CAAC,UAAU,QAAQ,CAAC,CAAC,CAAC,WAAW,OAAO,CAAC,UAAU,CAAC;;;;;;iBALpE,CAAC,SAAS,QAAQ,UAAU,CAAC,GAAG,MAAM,UAAU,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;cAoB5E,CAAC,SAAS,QAAQ,UAAU,CAAC,GAAG,MAAM,UAAU,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;EAIjF"}
1
+ {"version":3,"file":"snippetz.d.ts","sourceRoot":"","sources":["../src/snippetz.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAE5E;;GAEG;AACH,wBAAgB,QAAQ;UAMd,CAAC,SAAS,QAAQ,UAAU,CAAC,UAAU,QAAQ,CAAC,CAAC,CAAC,WAAW,OAAO,CAAC,UAAU,CAAC;;;;;;iBALpE,CAAC,SAAS,QAAQ,UAAU,CAAC,GAAG,MAAM,UAAU,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;cAoB5E,CAAC,SAAS,QAAQ,UAAU,CAAC,GAAG,MAAM,UAAU,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;EAIjF"}
@@ -1,4 +1,4 @@
1
- import type { HarRequest } from '../types/index.js';
1
+ import type { HarRequest } from '@scalar/types/snippetz';
2
2
  /**
3
3
  * Takes a httpsnippet-lite client and converts the given request to a code example with it.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"convertWithHttpSnippetLite.d.ts","sourceRoot":"","sources":["../../src/utils/convertWithHttpSnippetLite.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC;;;;GAIG;AACH,wBAAgB,0BAA0B,CAExC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAC5B,MAAM,CAwHR"}
1
+ {"version":3,"file":"convertWithHttpSnippetLite.d.ts","sourceRoot":"","sources":["../../src/utils/convertWithHttpSnippetLite.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAExD;;;;GAIG;AACH,wBAAgB,0BAA0B,CAExC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAC5B,MAAM,CAwHR"}
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "url": "git+https://github.com/scalar/scalar.git",
10
10
  "directory": "packages/snippetz"
11
11
  },
12
- "version": "0.2.15",
12
+ "version": "0.2.17",
13
13
  "engines": {
14
14
  "node": ">=18"
15
15
  },
@@ -26,11 +26,6 @@
26
26
  "types": "./dist/utils/index.d.ts",
27
27
  "default": "./dist/utils/index.js"
28
28
  },
29
- "./types": {
30
- "import": "./dist/types/index.js",
31
- "types": "./dist/types/index.d.ts",
32
- "default": "./dist/types/index.js"
33
- },
34
29
  "./plugins/swift/nsurlsession": {
35
30
  "import": "./dist/plugins/swift/nsurlsession/index.js",
36
31
  "types": "./dist/plugins/swift/nsurlsession/index.d.ts",
@@ -216,9 +211,9 @@
216
211
  "stringify-object": "^5.0.0"
217
212
  },
218
213
  "devDependencies": {
219
- "@types/har-format": "^1.2.15",
220
214
  "vite": "^5.4.10",
221
- "@scalar/build-tooling": "0.1.15"
215
+ "@scalar/types": "0.1.2",
216
+ "@scalar/build-tooling": "0.1.17"
222
217
  },
223
218
  "scripts": {
224
219
  "build": "scalar-build-rollup",
@@ -1,42 +0,0 @@
1
- import type { Request as HarRequest } from 'har-format';
2
- export type { Request as HarRequest } from 'har-format';
3
- /**
4
- * List of available clients
5
- */
6
- export declare const AVAILABLE_CLIENTS: readonly ["c/libcurl", "clojure/clj_http", "csharp/httpclient", "csharp/restsharp", "go/native", "http/http1.1", "java/asynchttp", "java/nethttp", "java/okhttp", "java/unirest", "js/axios", "js/fetch", "js/jquery", "js/ofetch", "js/xhr", "kotlin/okhttp", "node/axios", "node/fetch", "node/ofetch", "node/undici", "objc/nsurlsession", "ocaml/cohttp", "php/curl", "php/guzzle", "powershell/restmethod", "powershell/webrequest", "python/python3", "python/requests", "r/httr", "ruby/native", "shell/curl", "shell/httpie", "shell/wget", "swift/nsurlsession", "dart/http"];
7
- export type AvailableClients = typeof AVAILABLE_CLIENTS;
8
- /** Programming language */
9
- export type TargetId = AvailableClients[number] extends `${infer T}/${string}` ? T : never;
10
- /** Configuration for a target */
11
- export type Target = {
12
- [K in TargetId]: {
13
- key: K;
14
- title: string;
15
- default: ClientId<K>;
16
- clients: Plugin[];
17
- };
18
- }[TargetId];
19
- /** HTTP client */
20
- export type ClientId<T extends string> = T extends TargetId ? Extract<AvailableClients[number], `${T}/${string}`> extends `${T}/${infer C}` ? C : never : never;
21
- /** What any plugins needs to return */
22
- export type Plugin = {
23
- /** The language or environment. */
24
- target: TargetId;
25
- /** The identifier of the client. */
26
- client: ClientId<TargetId>;
27
- /** The title of the client. */
28
- title: string;
29
- /** The actual source code. */
30
- generate: (request?: Partial<HarRequest>, configuration?: PluginConfiguration) => string;
31
- };
32
- /**
33
- * Optional configuration for any plugin
34
- */
35
- export type PluginConfiguration = {
36
- /** Credentials to add HTTP Basic Authentication */
37
- auth?: {
38
- username: string;
39
- password: string;
40
- };
41
- };
42
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD,YAAY,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD;;GAEG;AACH,eAAO,MAAM,iBAAiB,wjBAoCpB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,OAAO,iBAAiB,CAAA;AAEvD,2BAA2B;AAC3B,MAAM,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAAA;AAE1F,iCAAiC;AACjC,MAAM,MAAM,MAAM,GAAG;KAClB,CAAC,IAAI,QAAQ,GAAG;QACf,GAAG,EAAE,CAAC,CAAA;QACN,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;QACpB,OAAO,EAAE,MAAM,EAAE,CAAA;KAClB;CACF,CAAC,QAAQ,CAAC,CAAA;AAEX,kBAAkB;AAClB,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,QAAQ,GACvD,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,EAAE,CAAC,SAAS,GAAG,CAAC,IAAI,MAAM,CAAC,EAAE,GAC3E,CAAC,GACD,KAAK,GACP,KAAK,CAAA;AAET,uCAAuC;AACvC,MAAM,MAAM,MAAM,GAAG;IACnB,mCAAmC;IACnC,MAAM,EAAE,QAAQ,CAAA;IAChB,oCAAoC;IACpC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC1B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,8BAA8B;IAC9B,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,EAAE,mBAAmB,KAAK,MAAM,CAAA;CACzF,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,mDAAmD;IACnD,IAAI,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9C,CAAA"}
@@ -1,42 +0,0 @@
1
- /**
2
- * List of available clients
3
- */
4
- const AVAILABLE_CLIENTS = [
5
- 'c/libcurl',
6
- 'clojure/clj_http',
7
- 'csharp/httpclient',
8
- 'csharp/restsharp',
9
- 'go/native',
10
- 'http/http1.1',
11
- 'java/asynchttp',
12
- 'java/nethttp',
13
- 'java/okhttp',
14
- 'java/unirest',
15
- 'js/axios',
16
- 'js/fetch',
17
- 'js/jquery',
18
- 'js/ofetch',
19
- 'js/xhr',
20
- 'kotlin/okhttp',
21
- 'node/axios',
22
- 'node/fetch',
23
- 'node/ofetch',
24
- 'node/undici',
25
- 'objc/nsurlsession',
26
- 'ocaml/cohttp',
27
- 'php/curl',
28
- 'php/guzzle',
29
- 'powershell/restmethod',
30
- 'powershell/webrequest',
31
- 'python/python3',
32
- 'python/requests',
33
- 'r/httr',
34
- 'ruby/native',
35
- 'shell/curl',
36
- 'shell/httpie',
37
- 'shell/wget',
38
- 'swift/nsurlsession',
39
- 'dart/http',
40
- ];
41
-
42
- export { AVAILABLE_CLIENTS };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test-d.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test-d.d.ts","sourceRoot":"","sources":["../../src/types/index.test-d.ts"],"names":[],"mappings":""}