@scalar/api-client 3.0.0 → 3.2.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.
Files changed (218) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +41 -0
  3. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  4. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts +2 -2
  5. package/dist/plugins/posthog/index.d.ts +23 -0
  6. package/dist/plugins/posthog/index.d.ts.map +1 -0
  7. package/dist/plugins/posthog/index.js +58 -0
  8. package/dist/plugins/posthog/index.js.map +1 -0
  9. package/dist/style.css +121 -61
  10. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  12. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +15 -12
  13. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  14. package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts +5 -2
  15. package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts.map +1 -1
  16. package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +5 -2
  17. package/dist/v2/blocks/operation-block/helpers/decode-buffer.js.map +1 -1
  18. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.d.ts +8 -9
  19. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.d.ts.map +1 -1
  20. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js +8 -10
  21. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js.map +1 -1
  22. package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts +2 -1
  23. package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts.map +1 -1
  24. package/dist/v2/blocks/operation-block/helpers/response-cache.js.map +1 -1
  25. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +11 -3
  26. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  27. package/dist/v2/blocks/operation-block/helpers/send-request.js +19 -12
  28. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  29. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  31. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js.map +1 -1
  32. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js +4 -0
  33. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js.map +1 -1
  34. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +1 -1
  35. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  36. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  37. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  38. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +1 -0
  39. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  40. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  41. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  42. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +1 -0
  43. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  44. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  45. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +3 -2
  46. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  47. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  48. package/dist/v2/blocks/response-block/ResponseBlock.vue.js.map +1 -1
  49. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +12 -6
  50. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
  51. package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts +2 -0
  52. package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts.map +1 -1
  53. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
  54. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js.map +1 -1
  55. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +34 -14
  56. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
  57. package/dist/v2/blocks/response-block/helpers/process-response-body.d.ts +1 -1
  58. package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -3
  59. package/dist/v2/blocks/response-block/helpers/process-response-body.js.map +1 -1
  60. package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.d.ts +11 -0
  61. package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.d.ts.map +1 -0
  62. package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js +44 -0
  63. package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js.map +1 -0
  64. package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.d.ts +14 -0
  65. package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.d.ts.map +1 -0
  66. package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js +13 -0
  67. package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js.map +1 -0
  68. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +1 -1
  69. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js.map +1 -1
  70. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js +3 -3
  71. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js.map +1 -1
  72. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  73. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  74. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  75. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +131 -48
  76. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  77. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts +2 -2
  78. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -1
  79. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  80. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +16 -0
  81. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  82. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +43 -1
  83. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  84. package/dist/v2/components/code-input/CodeInput.vue.d.ts +6 -2
  85. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  86. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  87. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  88. package/dist/v2/components/code-input/CodeInput.vue.script.js +9 -4
  89. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  90. package/dist/v2/components/data-table/DataTableInput.vue.d.ts +3 -0
  91. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  92. package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
  93. package/dist/v2/components/data-table/DataTableInput.vue.js.map +1 -1
  94. package/dist/v2/components/data-table/DataTableInput.vue.script.js +7 -1
  95. package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
  96. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts +2 -2
  97. package/dist/v2/constants.js +1 -1
  98. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  99. package/dist/v2/features/app/App.vue.js.map +1 -1
  100. package/dist/v2/features/app/App.vue.script.js +17 -4
  101. package/dist/v2/features/app/App.vue.script.js.map +1 -1
  102. package/dist/v2/features/app/app-state.d.ts +6 -1
  103. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  104. package/dist/v2/features/app/app-state.js +5 -3
  105. package/dist/v2/features/app/app-state.js.map +1 -1
  106. package/dist/v2/features/app/components/DesktopTab.vue.d.ts +2 -2
  107. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +9 -1
  108. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  109. package/dist/v2/features/app/helpers/create-api-client-app.js +3 -2
  110. package/dist/v2/features/app/helpers/create-api-client-app.js.map +1 -1
  111. package/dist/v2/features/app/helpers/create-temp-operation.d.ts.map +1 -1
  112. package/dist/v2/features/app/helpers/create-temp-operation.js +4 -1
  113. package/dist/v2/features/app/helpers/create-temp-operation.js.map +1 -1
  114. package/dist/v2/features/app/helpers/routes.d.ts +4 -2
  115. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  116. package/dist/v2/features/app/helpers/routes.js.map +1 -1
  117. package/dist/v2/features/collection/DocumentCollection.vue.script.js +2 -1
  118. package/dist/v2/features/collection/DocumentCollection.vue.script.js.map +1 -1
  119. package/dist/v2/features/collection/OperationCollection.vue.script.js +2 -1
  120. package/dist/v2/features/collection/OperationCollection.vue.script.js.map +1 -1
  121. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js +2 -1
  122. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js.map +1 -1
  123. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  124. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  125. package/dist/v2/features/collection/components/Authentication.vue.js.map +1 -1
  126. package/dist/v2/features/collection/components/Authentication.vue.script.js +10 -1
  127. package/dist/v2/features/collection/components/Authentication.vue.script.js.map +1 -1
  128. package/dist/v2/features/collection/components/Cookies.vue.script.js +1 -0
  129. package/dist/v2/features/collection/components/Cookies.vue.script.js.map +1 -1
  130. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js +1 -0
  131. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js.map +1 -1
  132. package/dist/v2/features/collection/components/Environment.vue.script.js +1 -0
  133. package/dist/v2/features/collection/components/Environment.vue.script.js.map +1 -1
  134. package/dist/v2/features/collection/components/Form.vue.d.ts +2 -0
  135. package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
  136. package/dist/v2/features/collection/components/Form.vue.js.map +1 -1
  137. package/dist/v2/features/collection/components/Form.vue.script.js +4 -1
  138. package/dist/v2/features/collection/components/Form.vue.script.js.map +1 -1
  139. package/dist/v2/features/collection/components/LabelInput.vue.d.ts +1 -1
  140. package/dist/v2/features/collection/components/Overview.vue.script.js +1 -0
  141. package/dist/v2/features/collection/components/Overview.vue.script.js.map +1 -1
  142. package/dist/v2/features/collection/components/Runner/components/Runner.vue.d.ts.map +1 -1
  143. package/dist/v2/features/collection/components/Runner/components/Runner.vue.js.map +1 -1
  144. package/dist/v2/features/collection/components/Runner/components/Runner.vue.script.js +4 -2
  145. package/dist/v2/features/collection/components/Runner/components/Runner.vue.script.js.map +1 -1
  146. package/dist/v2/features/collection/components/Runner/components/RunnerTree.vue.d.ts +2 -2
  147. package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.d.ts +4 -2
  148. package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.d.ts.map +1 -1
  149. package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js +3 -2
  150. package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js.map +1 -1
  151. package/dist/v2/features/collection/components/Scripts.vue.script.js +1 -0
  152. package/dist/v2/features/collection/components/Scripts.vue.script.js.map +1 -1
  153. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  154. package/dist/v2/features/collection/components/Servers.vue.js.map +1 -1
  155. package/dist/v2/features/collection/components/Servers.vue.script.js +3 -1
  156. package/dist/v2/features/collection/components/Servers.vue.script.js.map +1 -1
  157. package/dist/v2/features/collection/components/Settings.vue.script.js +1 -0
  158. package/dist/v2/features/collection/components/Settings.vue.script.js.map +1 -1
  159. package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts +2 -2
  160. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
  161. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js.map +1 -1
  162. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.script.js +1 -1
  163. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.script.js.map +1 -1
  164. package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.d.ts.map +1 -1
  165. package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.js.map +1 -1
  166. package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.script.js +26 -21
  167. package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.script.js.map +1 -1
  168. package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.js +1 -1
  169. package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.js.map +1 -1
  170. package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.script.js +1 -1
  171. package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.script.js.map +1 -1
  172. package/dist/v2/features/command-palette/helpers/get-postman-convert-options.d.ts +14 -0
  173. package/dist/v2/features/command-palette/helpers/get-postman-convert-options.d.ts.map +1 -0
  174. package/dist/v2/features/command-palette/helpers/get-postman-convert-options.js +19 -0
  175. package/dist/v2/features/command-palette/helpers/get-postman-convert-options.js.map +1 -0
  176. package/dist/v2/features/command-palette/helpers/get-postman-document-details.js +1 -1
  177. package/dist/v2/features/command-palette/helpers/get-postman-document-details.js.map +1 -1
  178. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +1 -1
  179. package/dist/v2/features/command-palette/helpers/load-document-from-source.js +1 -1
  180. package/dist/v2/features/command-palette/helpers/load-document-from-source.js.map +1 -1
  181. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts +2 -2
  182. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts +1 -1
  183. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
  184. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
  185. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +2 -2
  186. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
  187. package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts.map +1 -1
  188. package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +1 -1
  189. package/dist/v2/features/global-cookies/components/CookiesTable.vue.js.map +1 -1
  190. package/dist/v2/features/global-cookies/components/CookiesTable.vue.script.js +2 -0
  191. package/dist/v2/features/global-cookies/components/CookiesTable.vue.script.js.map +1 -1
  192. package/dist/v2/features/modal/Modal.vue.d.ts +7 -6
  193. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  194. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  195. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  196. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +5 -5
  197. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  198. package/dist/v2/features/modal/helpers/create-api-client-modal.js +11 -0
  199. package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
  200. package/dist/v2/features/modal/helpers/types.d.ts +1 -7
  201. package/dist/v2/features/modal/helpers/types.d.ts.map +1 -1
  202. package/dist/v2/features/modal/index.d.ts +1 -1
  203. package/dist/v2/features/modal/index.d.ts.map +1 -1
  204. package/dist/v2/features/operation/Operation.vue.d.ts +0 -5
  205. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  206. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  207. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  208. package/dist/v2/types/options.d.ts +15 -0
  209. package/dist/v2/types/options.d.ts.map +1 -0
  210. package/package.json +21 -16
  211. package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts +0 -11
  212. package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts.map +0 -1
  213. package/dist/v2/features/command-palette/helpers/is-postman-collection.js +0 -24
  214. package/dist/v2/features/command-palette/helpers/is-postman-collection.js.map +0 -1
  215. package/dist/v2/posthog.d.ts +0 -3
  216. package/dist/v2/posthog.d.ts.map +0 -1
  217. package/dist/v2/posthog.js +0 -20
  218. package/dist/v2/posthog.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  export { type ApiClientModal, createApiClientModal } from './helpers/create-api-client-modal.js';
2
2
  export { mapHiddenClientsConfig } from './helpers/map-hidden-clients-config.js';
3
3
  export type { RoutePayload } from './helpers/resolve-route-parameters.js';
4
- export type { ApiClientModalOptions } from './helpers/types';
4
+ export type { ApiClientOptions } from '../../../v2/types/options';
5
5
  export { initializeModalEvents } from './modal-events.js';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AACtE,YAAY,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AACtE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA"}
@@ -1,5 +1,4 @@
1
1
  import type { RouteProps } from '../../../v2/features/app/helpers/routes.js';
2
- import type { ApiClientModalOptionsRef } from '../../../v2/features/modal/helpers/types';
3
2
  /**
4
3
  * Operation example page
5
4
  *
@@ -11,13 +10,9 @@ import type { ApiClientModalOptionsRef } from '../../../v2/features/modal/helper
11
10
  declare const _default: typeof __VLS_export;
12
11
  export default _default;
13
12
  declare const __VLS_export: import("vue").DefineComponent<RouteProps & {
14
- /** Subset of config options for the modal */
15
- options?: ApiClientModalOptionsRef;
16
13
  /** Selected anyOf/oneOf request-body variants keyed by schema path */
17
14
  requestBodyCompositionSelection?: Record<string, number>;
18
15
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RouteProps & {
19
- /** Subset of config options for the modal */
20
- options?: ApiClientModalOptionsRef;
21
16
  /** Selected anyOf/oneOf request-body variants keyed by schema path */
22
17
  requestBodyCompositionSelection?: Record<string, number>;
23
18
  }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AAoMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAA;AAGjF;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEd,6CAA6C;cACnC,wBAAwB;IAClC,sEAAsE;sCACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;IAHxD,6CAA6C;cACnC,wBAAwB;IAClC,sEAAsE;sCACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;iGAyPxD,CAAC"}
1
+ {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AAiMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAIlE;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEd,sEAAsE;sCACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;IADxD,sEAAsE;sCACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;iGAyPxD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport { computed, toValue } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\nimport type { ApiClientModalOptionsRef } from '@/v2/features/modal/helpers/types'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n RouteProps & {\n /** Subset of config options for the modal */\n options?: ApiClientModalOptionsRef\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport { computed, toValue } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n RouteProps & {\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport { computed, toValue } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\nimport type { ApiClientModalOptionsRef } from '@/v2/features/modal/helpers/types'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n RouteProps & {\n /** Subset of config options for the modal */\n options?: ApiClientModalOptionsRef\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":"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"}
1
+ {"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport { computed, toValue } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n RouteProps & {\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":"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"}
@@ -0,0 +1,15 @@
1
+ import type { CustomFetch } from '../../v2/blocks/operation-block/helpers/send-request.js';
2
+ import type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference';
3
+ import type { Ref } from 'vue';
4
+ /**
5
+ * Configuration options for the API Client (app and modal).
6
+ */
7
+ export type ApiClientOptions = Partial<Pick<ApiReferenceConfigurationRaw, 'authentication' | 'baseServerURL' | 'hideClientButton' | 'hiddenClients' | 'oauth2RedirectUri' | 'proxyUrl' | 'servers'>> & {
8
+ /**
9
+ * Custom fetch implementation used for all outgoing API requests.
10
+ * When provided, replaces the global fetch in the request execution engine (sendRequest).
11
+ */
12
+ customFetch?: CustomFetch;
13
+ };
14
+ export type ApiClientOptionsRef = Ref<ApiClientOptions>;
15
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/v2/types/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAA;AACnF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CACpC,IAAI,CACF,4BAA4B,EAC1B,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,mBAAmB,GACnB,UAAU,GACV,SAAS,CACZ,CACF,GAAG;IACF;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,GAAG,CAAC,gBAAgB,CAAC,CAAA"}
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "3.0.0",
21
+ "version": "3.2.0",
22
22
  "engines": {
23
23
  "node": ">=22"
24
24
  },
@@ -39,6 +39,11 @@
39
39
  "require": "./dist/css/*.css",
40
40
  "default": "./dist/css/*.css"
41
41
  },
42
+ "./plugins/posthog": {
43
+ "import": "./dist/plugins/posthog/index.js",
44
+ "types": "./dist/plugins/posthog/index.d.ts",
45
+ "default": "./dist/plugins/posthog/index.js"
46
+ },
42
47
  "./components/Server": {
43
48
  "import": "./dist/components/Server/index.js",
44
49
  "types": "./dist/components/Server/index.d.ts",
@@ -318,7 +323,6 @@
318
323
  "monaco-editor": "0.55.1",
319
324
  "monaco-yaml": "5.4.1",
320
325
  "nanoid": "^5.1.6",
321
- "posthog-js": "1.363.2",
322
326
  "pretty-ms": "^9.3.0",
323
327
  "radix-vue": "^1.9.17",
324
328
  "set-cookie-parser": "3.1.0",
@@ -328,21 +332,21 @@
328
332
  "vue-router": "5.0.4",
329
333
  "yaml": "^2.8.0",
330
334
  "zod": "^4.3.5",
331
- "@scalar/components": "0.22.0",
332
- "@scalar/helpers": "0.5.0",
335
+ "@scalar/helpers": "0.5.1",
333
336
  "@scalar/icons": "0.7.2",
334
- "@scalar/json-magic": "0.12.6",
335
- "@scalar/oas-utils": "0.12.0",
336
- "@scalar/openapi-types": "0.7.0",
337
- "@scalar/sidebar": "0.9.1",
338
- "@scalar/postman-to-openapi": "0.6.2",
339
- "@scalar/snippetz": "0.9.0",
340
- "@scalar/use-codemirror": "0.14.11",
341
- "@scalar/types": "0.9.0",
337
+ "@scalar/oas-utils": "0.13.1",
338
+ "@scalar/components": "0.22.2",
339
+ "@scalar/openapi-types": "0.8.0",
340
+ "@scalar/json-magic": "0.12.7",
341
+ "@scalar/postman-to-openapi": "0.7.0",
342
+ "@scalar/sidebar": "0.9.3",
343
+ "@scalar/snippetz": "0.9.1",
342
344
  "@scalar/themes": "0.15.3",
343
- "@scalar/use-hooks": "0.4.2",
344
- "@scalar/workspace-store": "0.46.0",
345
- "@scalar/use-toasts": "0.10.1"
345
+ "@scalar/types": "0.9.1",
346
+ "@scalar/use-hooks": "0.4.3",
347
+ "@scalar/use-codemirror": "0.14.11",
348
+ "@scalar/use-toasts": "0.10.2",
349
+ "@scalar/workspace-store": "0.46.2"
346
350
  },
347
351
  "devDependencies": {
348
352
  "@tailwindcss/vite": "^4.2.0",
@@ -352,11 +356,12 @@
352
356
  "fake-indexeddb": "6.2.3",
353
357
  "fastify": "^5.8.1",
354
358
  "jsdom": "27.4.0",
359
+ "posthog-js": "1.363.2",
355
360
  "tailwindcss": "^4.1.18",
356
361
  "vite": "8.0.0",
357
362
  "vite-svg-loader": "5.1.1",
358
363
  "vitest": "4.1.0",
359
- "@scalar/pre-post-request-scripts": "0.4.2"
364
+ "@scalar/pre-post-request-scripts": "0.4.4"
360
365
  },
361
366
  "scripts": {
362
367
  "build": "vite build && vue-tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
@@ -1,11 +0,0 @@
1
- /**
2
- * Checks if the given string content is a Postman collection.
3
- *
4
- * Validates by checking for the `_postman_id` in the info object
5
- * and ensuring the schema URL's host matches 'schema.getpostman.com'.
6
- *
7
- * @param content - The JSON string which may be a Postman collection
8
- * @returns True if the content is a valid Postman collection
9
- */
10
- export declare const isPostmanCollection: (content: string) => boolean;
11
- //# sourceMappingURL=is-postman-collection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-postman-collection.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/helpers/is-postman-collection.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,KAAG,OAWrD,CAAA"}
@@ -1,24 +0,0 @@
1
- //#region src/v2/features/command-palette/helpers/is-postman-collection.ts
2
- /**
3
- * Checks if the given string content is a Postman collection.
4
- *
5
- * Validates by checking for the `_postman_id` in the info object
6
- * and ensuring the schema URL's host matches 'schema.getpostman.com'.
7
- *
8
- * @param content - The JSON string which may be a Postman collection
9
- * @returns True if the content is a valid Postman collection
10
- */
11
- var isPostmanCollection = (content) => {
12
- try {
13
- const parsed = JSON.parse(content);
14
- const hasPostmanId = parsed.info?._postman_id !== void 0;
15
- const hasValidSchema = parsed.info?.schema && new URL(parsed.info.schema).host === "schema.getpostman.com";
16
- return hasPostmanId && hasValidSchema;
17
- } catch {
18
- return false;
19
- }
20
- };
21
- //#endregion
22
- export { isPostmanCollection };
23
-
24
- //# sourceMappingURL=is-postman-collection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-postman-collection.js","names":[],"sources":["../../../../../src/v2/features/command-palette/helpers/is-postman-collection.ts"],"sourcesContent":["/**\n * Checks if the given string content is a Postman collection.\n *\n * Validates by checking for the `_postman_id` in the info object\n * and ensuring the schema URL's host matches 'schema.getpostman.com'.\n *\n * @param content - The JSON string which may be a Postman collection\n * @returns True if the content is a valid Postman collection\n */\nexport const isPostmanCollection = (content: string): boolean => {\n try {\n const parsed = JSON.parse(content)\n\n const hasPostmanId = parsed.info?._postman_id !== undefined\n const hasValidSchema = parsed.info?.schema && new URL(parsed.info.schema).host === 'schema.getpostman.com'\n\n return hasPostmanId && hasValidSchema\n } catch {\n return false\n }\n}\n"],"mappings":";;;;;;;;;;AASA,IAAa,uBAAuB,YAA6B;AAC/D,KAAI;EACF,MAAM,SAAS,KAAK,MAAM,QAAQ;EAElC,MAAM,eAAe,OAAO,MAAM,gBAAgB,KAAA;EAClD,MAAM,iBAAiB,OAAO,MAAM,UAAU,IAAI,IAAI,OAAO,KAAK,OAAO,CAAC,SAAS;AAEnF,SAAO,gBAAgB;SACjB;AACN,SAAO"}
@@ -1,3 +0,0 @@
1
- import { type Ref } from 'vue';
2
- export declare const usePosthog: (enabled: Ref<boolean>) => void;
3
- //# sourceMappingURL=posthog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"posthog.d.ts","sourceRoot":"","sources":["../../src/v2/posthog.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAS,MAAM,KAAK,CAAA;AAarC,eAAO,MAAM,UAAU,GAAI,SAAS,GAAG,CAAC,OAAO,CAAC,SAY/C,CAAA"}
@@ -1,20 +0,0 @@
1
- import { watch } from "vue";
2
- import ph from "posthog-js";
3
- //#region src/v2/posthog.ts
4
- var posthog = ph.init("phc_3elIjSOvGOo5aEwg6krzIY9IcQiRubsBtglOXsQ4Uu4", {
5
- api_host: "https://magic.scalar.com",
6
- ui_host: "https://us.posthog.com",
7
- defaults: "2025-11-30",
8
- opt_out_capturing_by_default: true
9
- });
10
- posthog.register({ product: "api-client" });
11
- var usePosthog = (enabled) => {
12
- watch(enabled, (value) => {
13
- if (value) posthog.opt_in_capturing();
14
- else posthog.opt_out_capturing();
15
- }, { immediate: true });
16
- };
17
- //#endregion
18
- export { usePosthog };
19
-
20
- //# sourceMappingURL=posthog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"posthog.js","names":[],"sources":["../../src/v2/posthog.ts"],"sourcesContent":["import ph from 'posthog-js'\nimport { type Ref, watch } from 'vue'\n\nconst posthog = ph.init('phc_3elIjSOvGOo5aEwg6krzIY9IcQiRubsBtglOXsQ4Uu4', {\n api_host: 'https://magic.scalar.com',\n ui_host: 'https://us.posthog.com',\n defaults: '2025-11-30',\n opt_out_capturing_by_default: true,\n})\n\nposthog.register({\n product: 'api-client',\n})\n\nexport const usePosthog = (enabled: Ref<boolean>) => {\n watch(\n enabled,\n (value) => {\n if (value) {\n posthog.opt_in_capturing()\n } else {\n posthog.opt_out_capturing()\n }\n },\n { immediate: true },\n )\n}\n"],"mappings":";;;AAGA,IAAM,UAAU,GAAG,KAAK,mDAAmD;CACzE,UAAU;CACV,SAAS;CACT,UAAU;CACV,8BAA8B;CAC/B,CAAC;AAEF,QAAQ,SAAS,EACf,SAAS,cACV,CAAC;AAEF,IAAa,cAAc,YAA0B;AACnD,OACE,UACC,UAAU;AACT,MAAI,MACF,SAAQ,kBAAkB;MAE1B,SAAQ,mBAAmB;IAG/B,EAAE,WAAW,MAAM,CACpB"}