@scalar/api-client 2.38.0 → 2.38.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/AddressBar-B4xnl66I.js +302 -0
- package/dist/AddressBar-B4xnl66I.js.map +1 -0
- package/dist/App-BVH4lIe8.js +533 -0
- package/dist/App-BVH4lIe8.js.map +1 -0
- package/dist/App-CvClwSlM.js +2510 -0
- package/dist/App-CvClwSlM.js.map +1 -0
- package/dist/CodeInput-C-igR77V.js +694 -0
- package/dist/CodeInput-C-igR77V.js.map +1 -0
- package/dist/CodeSnippet-D7Heh1nd.js +218 -0
- package/dist/CodeSnippet-D7Heh1nd.js.map +1 -0
- package/dist/Collection-4MT9WmDD.js +219 -0
- package/dist/Collection-4MT9WmDD.js.map +1 -0
- package/dist/CollectionAuthentication-MHWQpw74.js +56 -0
- package/dist/CollectionAuthentication-MHWQpw74.js.map +1 -0
- package/dist/CollectionCookies-DyjPPMdt.js +19 -0
- package/dist/CollectionCookies-DyjPPMdt.js.map +1 -0
- package/dist/CollectionEnvironment-Dw35vIqo.js +514 -0
- package/dist/CollectionEnvironment-Dw35vIqo.js.map +1 -0
- package/dist/CollectionOverview-TUdDIu5f.js +131 -0
- package/dist/CollectionOverview-TUdDIu5f.js.map +1 -0
- package/dist/CollectionScripts-CMNlBlby.js +19 -0
- package/dist/CollectionScripts-CMNlBlby.js.map +1 -0
- package/dist/CollectionServers-BrjTCfDe.js +168 -0
- package/dist/CollectionServers-BrjTCfDe.js.map +1 -0
- package/dist/CollectionSettings-HVSlp2Gv.js +87 -0
- package/dist/CollectionSettings-HVSlp2Gv.js.map +1 -0
- package/dist/CollectionSync-CAflc5yW.js +19 -0
- package/dist/CollectionSync-CAflc5yW.js.map +1 -0
- package/dist/CommandActionInput-TkcAx6E8.js +97 -0
- package/dist/CommandActionInput-TkcAx6E8.js.map +1 -0
- package/dist/CommandPalette-CL8k4CoN.js +964 -0
- package/dist/CommandPalette-CL8k4CoN.js.map +1 -0
- package/dist/CommandPaletteImport-Diu5dDIY.js +622 -0
- package/dist/CommandPaletteImport-Diu5dDIY.js.map +1 -0
- package/dist/Cookies-DbOKTi1f.js +284 -0
- package/dist/Cookies-DbOKTi1f.js.map +1 -0
- package/dist/DataTable-BqbZKW3K.js +62 -0
- package/dist/DataTable-BqbZKW3K.js.map +1 -0
- package/dist/DataTableHeader-DJVB0jCZ.js +21 -0
- package/dist/DataTableHeader-DJVB0jCZ.js.map +1 -0
- package/dist/DataTableInput-yaU5g-kP.js +166 -0
- package/dist/DataTableInput-yaU5g-kP.js.map +1 -0
- package/dist/DataTableRow-c3XveEUO.js +57 -0
- package/dist/DataTableRow-c3XveEUO.js.map +1 -0
- package/dist/DeleteSidebarListElement-C-p87d03.js +78 -0
- package/dist/DeleteSidebarListElement-C-p87d03.js.map +1 -0
- package/dist/EditSidebarListElement-CodWPnM6.js +32 -0
- package/dist/EditSidebarListElement-CodWPnM6.js.map +1 -0
- package/dist/Editor-BomsGWHx.js +909 -0
- package/dist/Editor-BomsGWHx.js.map +1 -0
- package/dist/EmptyState-Cnm7hGW5.js +46 -0
- package/dist/EmptyState-Cnm7hGW5.js.map +1 -0
- package/dist/Environment-DJatRQIg.js +416 -0
- package/dist/Environment-DJatRQIg.js.map +1 -0
- package/dist/EnvironmentModal-DBEJ4Kzj.js +288 -0
- package/dist/EnvironmentModal-DBEJ4Kzj.js.map +1 -0
- package/dist/Form-CSKzyHGO.js +83 -0
- package/dist/Form-CSKzyHGO.js.map +1 -0
- package/dist/HttpMethod-rnWEgC3T.js +78 -0
- package/dist/HttpMethod-rnWEgC3T.js.map +1 -0
- package/dist/IconSelector-BDC_GQXv.js +67 -0
- package/dist/IconSelector-BDC_GQXv.js.map +1 -0
- package/dist/ImportCollection-DfX1UQ5u.js +804 -0
- package/dist/ImportCollection-DfX1UQ5u.js.map +1 -0
- package/dist/IntegrationLogo-B9EDW8db.js +51 -0
- package/dist/IntegrationLogo-B9EDW8db.js.map +1 -0
- package/dist/MainLayout-BEFMl1ud.js +281 -0
- package/dist/MainLayout-BEFMl1ud.js.map +1 -0
- package/dist/Modal-sQ9vH6MN.js +67 -0
- package/dist/Modal-sQ9vH6MN.js.map +1 -0
- package/dist/ModalClientContainer-qHsZi4wQ.js +65 -0
- package/dist/ModalClientContainer-qHsZi4wQ.js.map +1 -0
- package/dist/Request-gscRsGQ8.js +212 -0
- package/dist/Request-gscRsGQ8.js.map +1 -0
- package/dist/RequestAuth-BzBfIysT.js +989 -0
- package/dist/RequestAuth-BzBfIysT.js.map +1 -0
- package/dist/RequestRoot-3Bj8JZD-.js +1611 -0
- package/dist/RequestRoot-3Bj8JZD-.js.map +1 -0
- package/dist/RequestSection-HhdJj9hW.js +1582 -0
- package/dist/RequestSection-HhdJj9hW.js.map +1 -0
- package/dist/ResponseSection-DMJ0tw8E.js +949 -0
- package/dist/ResponseSection-DMJ0tw8E.js.map +1 -0
- package/dist/ScalarAsciiArt-BjuSnj8e.js +45 -0
- package/dist/ScalarAsciiArt-BjuSnj8e.js.map +1 -0
- package/dist/SectionFilter-hrtoRLwj.js +99 -0
- package/dist/SectionFilter-hrtoRLwj.js.map +1 -0
- package/dist/Server-DnA_BzPS.js +303 -0
- package/dist/Server-DnA_BzPS.js.map +1 -0
- package/dist/ServerVariablesForm-BRZ9XC8o.js +145 -0
- package/dist/ServerVariablesForm-BRZ9XC8o.js.map +1 -0
- package/dist/Settings-CYZzdJPO.js +347 -0
- package/dist/Settings-CYZzdJPO.js.map +1 -0
- package/dist/Sidebar-C6AdX6-N.js +73 -0
- package/dist/Sidebar-C6AdX6-N.js.map +1 -0
- package/dist/SidebarButton-BAagdMDe.js +37 -0
- package/dist/SidebarButton-BAagdMDe.js.map +1 -0
- package/dist/SidebarListElement-BfTPiihc.js +232 -0
- package/dist/SidebarListElement-BfTPiihc.js.map +1 -0
- package/dist/TheCommandPalette-Dl9TAeke.js +204 -0
- package/dist/TheCommandPalette-Dl9TAeke.js.map +1 -0
- package/dist/ValueEmitter-QYkZ9Hdc.js +20 -0
- package/dist/ValueEmitter-QYkZ9Hdc.js.map +1 -0
- package/dist/ViewLayout-BOXN0IYo.js +17 -0
- package/dist/ViewLayout-BOXN0IYo.js.map +1 -0
- package/dist/ViewLayoutCollapse-CiTb-Uml.js +86 -0
- package/dist/ViewLayoutCollapse-CiTb-Uml.js.map +1 -0
- package/dist/ViewLayoutContent-CvMoJYPF.js +13 -0
- package/dist/ViewLayoutContent-CvMoJYPF.js.map +1 -0
- package/dist/ViewLayoutSection-mUqKbQry.js +23 -0
- package/dist/ViewLayoutSection-mUqKbQry.js.map +1 -0
- package/dist/WatchModeToggle-D_eAiTWJ.js +41 -0
- package/dist/WatchModeToggle-D_eAiTWJ.js.map +1 -0
- package/dist/_plugin-vue_export-helper-BmmBcIzD.js +8 -0
- package/dist/analytics-BZimCWcw.js +7 -0
- package/dist/analytics-BZimCWcw.js.map +1 -0
- package/dist/build-request-security-BQjNr2MD.js +41 -0
- package/dist/build-request-security-BQjNr2MD.js.map +1 -0
- package/dist/code-input-iq-moLxi.js +775 -0
- package/dist/code-input-iq-moLxi.js.map +1 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts +1 -1
- package/dist/components/AddressBar/index.d.ts +1 -1
- package/dist/components/AddressBar/index.js +5 -4
- package/dist/components/CodeInput/CodeInput.vue.d.ts +1 -1
- package/dist/components/CodeInput/codeVariableWidget.d.ts +1 -1
- package/dist/components/CodeInput/index.d.ts +1 -1
- package/dist/components/CodeInput/index.js +2 -4
- package/dist/components/CommandPalette/index.d.ts +1 -1
- package/dist/components/CommandPalette/index.js +3 -4
- package/dist/components/DataTable/DataTableInput.vue.d.ts +2 -2
- package/dist/components/DataTable/index.d.ts +8 -8
- package/dist/components/DataTable/index.js +6 -18
- package/dist/components/Form/LabelInput.vue.d.ts +1 -1
- package/dist/components/HttpMethod/index.d.ts +1 -1
- package/dist/components/HttpMethod/index.js +2 -4
- package/dist/components/ImportCollection/index.d.ts +1 -1
- package/dist/components/ImportCollection/index.js +2 -4
- package/dist/components/ImportCollection/utils/import-collection.d.ts +1 -1
- package/dist/components/ImportCollection/utils/workspace-store-is-empty.d.ts +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.d.ts +1 -1
- package/dist/components/Server/index.d.ts +3 -3
- package/dist/components/Server/index.js +3 -8
- package/dist/components/Sidebar/index.d.ts +1 -1
- package/dist/components/Sidebar/index.js +2 -4
- package/dist/components/ViewLayout/index.d.ts +1 -1
- package/dist/components/ViewLayout/index.js +2 -4
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +7 -8
- package/dist/components-CSxJTn6F.js +183 -0
- package/dist/components-CSxJTn6F.js.map +1 -0
- package/dist/components-ChixwQhN.js +61 -0
- package/dist/components-ChixwQhN.js.map +1 -0
- package/dist/computer-D7VW3Ruy.js +562 -0
- package/dist/computer-D7VW3Ruy.js.map +1 -0
- package/dist/consts-CyGRb9dl.js +318 -0
- package/dist/consts-CyGRb9dl.js.map +1 -0
- package/dist/curl-nbw1OxbV.js +54 -0
- package/dist/curl-nbw1OxbV.js.map +1 -0
- package/dist/data-table-PL7e8NRO.js +282 -0
- package/dist/data-table-PL7e8NRO.js.map +1 -0
- package/dist/editor-BZ_J0eze.js +466 -0
- package/dist/editor-BZ_J0eze.js.map +1 -0
- package/dist/environments-ByLK9lnC.js +592 -0
- package/dist/environments-ByLK9lnC.js.map +1 -0
- package/dist/formatters-DOGXZq9R.js +36 -0
- package/dist/formatters-DOGXZq9R.js.map +1 -0
- package/dist/forms-CZX6cFDS.js +42 -0
- package/dist/forms-CZX6cFDS.js.map +1 -0
- package/dist/get-active-environment-CkxyQ1dM.js +19 -0
- package/dist/get-active-environment-CkxyQ1dM.js.map +1 -0
- package/dist/get-resolved-url-BUCwrBzc.js +30 -0
- package/dist/get-resolved-url-BUCwrBzc.js.map +1 -0
- package/dist/get-server-url-o3On8CEr.js +32 -0
- package/dist/get-server-url-o3On8CEr.js.map +1 -0
- package/dist/get-servers-B_WNlQWB.js +106 -0
- package/dist/get-servers-B_WNlQWB.js.map +1 -0
- package/dist/get-snippet-DBRUSfZ2.js +39 -0
- package/dist/get-snippet-DBRUSfZ2.js.map +1 -0
- package/dist/global-cookies-D3ZS9ON3.js +184 -0
- package/dist/global-cookies-D3ZS9ON3.js.map +1 -0
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/index.js +3 -11
- package/dist/hooks/useSidebar.d.ts +1 -1
- package/dist/hooks-BvZxH4XB.js +80 -0
- package/dist/hooks-BvZxH4XB.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -12
- package/dist/layout-BWiL7dfb.js +81 -0
- package/dist/layout-BWiL7dfb.js.map +1 -0
- package/dist/layouts/App/create-api-client-app.d.ts +9 -9
- package/dist/layouts/App/index.d.ts +2 -2
- package/dist/layouts/App/index.js +5 -7
- package/dist/layouts/Modal/create-api-client-modal.d.ts +1 -1
- package/dist/layouts/Modal/index.d.ts +2 -2
- package/dist/layouts/Modal/index.js +3 -4
- package/dist/layouts/Web/create-api-client-web.d.ts +9 -9
- package/dist/layouts/Web/index.d.ts +2 -2
- package/dist/layouts/Web/index.js +101 -6
- package/dist/layouts/Web/index.js.map +1 -0
- package/dist/libs/create-client.d.ts +9 -9
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/environment-parser.d.ts +1 -1
- package/dist/libs/get-request-uid-by-path-method.d.ts +1 -1
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/libs/importers/index.d.ts +1 -1
- package/dist/libs/importers/index.js +2 -4
- package/dist/libs/index.d.ts +15 -15
- package/dist/libs/index.js +6 -45
- package/dist/libs/local-storage.d.ts +1 -1
- package/dist/libs/send-request/create-request-operation.d.ts +3 -3
- package/dist/libs/send-request/index.d.ts +3 -3
- package/dist/libs/send-request/index.js +3 -8
- package/dist/libs-spbv4P0g.js +249 -0
- package/dist/libs-spbv4P0g.js.map +1 -0
- package/dist/monacoeditorwork/json.worker.bundle.js +8 -8
- package/dist/monacoeditorwork/yaml.worker.bundle.js +151 -151
- package/dist/operation-block-BnMIKAOh.js +1624 -0
- package/dist/operation-block-BnMIKAOh.js.map +1 -0
- package/dist/operation-code-sample-ZUTueV3v.js +1726 -0
- package/dist/operation-code-sample-ZUTueV3v.js.map +1 -0
- package/dist/parse-curl-BtypQT3D.js +106 -0
- package/dist/parse-curl-BtypQT3D.js.map +1 -0
- package/dist/plugins/hooks/usePluginManager.d.ts +1 -1
- package/dist/plugins/index.d.ts +2 -2
- package/dist/plugins/index.js +2 -7
- package/dist/plugins/plugin-manager.d.ts +10 -4
- package/dist/plugins/plugin-manager.d.ts.map +1 -1
- package/dist/plugins-B52hCIyZ.js +50 -0
- package/dist/plugins-B52hCIyZ.js.map +1 -0
- package/dist/rabbitjump-CMZXAR6d.js +9 -0
- package/dist/rabbitjump-CMZXAR6d.js.map +1 -0
- package/dist/request-block-DwsGy64Q.js +1466 -0
- package/dist/request-block-DwsGy64Q.js.map +1 -0
- package/dist/resize-D2IYvVdh.js +114 -0
- package/dist/resize-D2IYvVdh.js.map +1 -0
- package/dist/response-block-DmkaDZYs.js +1188 -0
- package/dist/response-block-DmkaDZYs.js.map +1 -0
- package/dist/scalar-address-bar-block--Vs6IBU1.js +425 -0
- package/dist/scalar-address-bar-block--Vs6IBU1.js.map +1 -0
- package/dist/scalar-auth-selector-block-DI3DLag9.js +1886 -0
- package/dist/scalar-auth-selector-block-DI3DLag9.js.map +1 -0
- package/dist/search-CmsQQkjn.js +151 -0
- package/dist/search-CmsQQkjn.js.map +1 -0
- package/dist/send-request-BsTfRiBC.js +348 -0
- package/dist/send-request-BsTfRiBC.js.map +1 -0
- package/dist/server-tcI-OCyx.js +140 -0
- package/dist/server-tcI-OCyx.js.map +1 -0
- package/dist/set-request-cookies-BJJhsU4A.js +88 -0
- package/dist/set-request-cookies-BJJhsU4A.js.map +1 -0
- package/dist/settings-BKk_1lcH.js +455 -0
- package/dist/settings-BKk_1lcH.js.map +1 -0
- package/dist/sidebar-ceSbYmnt.js +217 -0
- package/dist/sidebar-ceSbYmnt.js.map +1 -0
- package/dist/store/collections.d.ts +1 -1
- package/dist/store/environment.d.ts +1 -1
- package/dist/store/events.d.ts +8 -8
- package/dist/store/import-spec.d.ts +2 -2
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +2 -10
- package/dist/store/request-example.d.ts +1 -1
- package/dist/store/requests.d.ts +1 -1
- package/dist/store/security-schemes.d.ts +1 -1
- package/dist/store/servers.d.ts +1 -1
- package/dist/store/store.d.ts +7 -7
- package/dist/store/tags.d.ts +1 -1
- package/dist/store/workspace.d.ts +1 -1
- package/dist/store-DpSUVhjp.js +1512 -0
- package/dist/store-DpSUVhjp.js.map +1 -0
- package/dist/string-template-sS5PtY6T.js +64 -0
- package/dist/string-template-sS5PtY6T.js.map +1 -0
- package/dist/style.css +10372 -1
- package/dist/types/index.js +0 -1
- package/dist/use-global-hot-keys-D8Ai8Qbm.js +274 -0
- package/dist/use-global-hot-keys-D8Ai8Qbm.js.map +1 -0
- package/dist/useSidebar-DLTwHDI-.js +45 -0
- package/dist/useSidebar-DLTwHDI-.js.map +1 -0
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +3 -3
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.d.ts +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -1
- package/dist/v2/blocks/operation-block/index.d.ts +4 -4
- package/dist/v2/blocks/operation-block/index.js +20 -11
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/index.d.ts +6 -6
- package/dist/v2/blocks/operation-code-sample/index.js +2 -16
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +4 -4
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts +3 -2
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts +1 -1
- package/dist/v2/blocks/request-block/index.d.ts +1 -1
- package/dist/v2/blocks/request-block/index.js +9 -4
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.d.ts +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +1 -1
- package/dist/v2/blocks/response-block/index.d.ts +1 -1
- package/dist/v2/blocks/response-block/index.js +6 -4
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/index.d.ts +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/index.js +5 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +5 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +4 -4
- package/dist/v2/blocks/scalar-auth-selector-block/index.js +6 -8
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +1 -1
- package/dist/v2/components/code-input/index.d.ts +1 -1
- package/dist/v2/components/code-input/index.js +2 -4
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +1 -1
- package/dist/v2/components/data-table/index.d.ts +8 -8
- package/dist/v2/components/data-table/index.js +3 -18
- package/dist/v2/components/forms/index.d.ts +1 -1
- package/dist/v2/components/forms/index.js +2 -4
- package/dist/v2/components/layout/index.d.ts +1 -1
- package/dist/v2/components/layout/index.js +2 -4
- package/dist/v2/components/modals/index.d.ts +1 -1
- package/dist/v2/components/modals/index.js +37 -3
- package/dist/v2/components/modals/index.js.map +1 -0
- package/dist/v2/components/resize/index.d.ts +2 -2
- package/dist/v2/components/resize/index.js +2 -6
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +1 -1
- package/dist/v2/components/server/index.d.ts +1 -1
- package/dist/v2/components/server/index.js +2 -4
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/index.d.ts +3 -3
- package/dist/v2/components/sidebar/index.js +3 -8
- package/dist/v2/features/app/App.vue.d.ts +4 -4
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +1 -1
- package/dist/v2/features/app/components/index.d.ts +1 -1
- package/dist/v2/features/app/components/index.js +10 -5
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +3 -3
- package/dist/v2/features/app/helpers/get-route-param.d.ts +1 -1
- package/dist/v2/features/app/helpers/routes.d.ts +5 -5
- package/dist/v2/features/app/hooks/use-theme.d.ts +1 -1
- package/dist/v2/features/app/index.d.ts +8 -8
- package/dist/v2/features/app/index.js +3161 -19
- package/dist/v2/features/app/index.js.map +1 -0
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts +1 -1
- package/dist/v2/features/collection/OperationCollection.vue.d.ts +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Cookies.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Editor/Editor.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Editor/index.d.ts +1 -1
- package/dist/v2/features/collection/components/Editor/index.js +2 -4
- package/dist/v2/features/collection/components/Environment.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Form.vue.d.ts +1 -0
- package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Overview.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Servers.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Settings.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Tabs.vue.d.ts +1 -1
- package/dist/v2/features/command-palette/TheCommandPalette.vue.d.ts +1 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +10 -45
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
- package/dist/v2/features/command-palette/index.d.ts +2 -2
- package/dist/v2/features/command-palette/index.js +3 -6
- package/dist/v2/features/editor/helpers/json/create-json-model.d.ts +1 -1
- package/dist/v2/features/editor/helpers/json/get-json-ast-node-from-path.d.ts +1 -1
- package/dist/v2/features/editor/helpers/json/json-pointer-path.d.ts +1 -1
- package/dist/v2/features/editor/helpers/yaml/create-yaml-model.d.ts +1 -1
- package/dist/v2/features/editor/helpers/yaml/get-yaml-node-range-from-path.d.ts +1 -1
- package/dist/v2/features/editor/hooks/use-editor.d.ts +1 -1
- package/dist/v2/features/editor/hooks/use-json-pointer-link-support.d.ts +1 -1
- package/dist/v2/features/editor/index.d.ts +4 -4
- package/dist/v2/features/editor/index.js +2 -10
- package/dist/v2/features/environments/index.d.ts +1 -1
- package/dist/v2/features/environments/index.js +4 -4
- package/dist/v2/features/global-cookies/index.d.ts +1 -1
- package/dist/v2/features/global-cookies/index.js +4 -4
- package/dist/v2/features/modal/Modal.vue.d.ts +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +2 -2
- package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +1 -1
- package/dist/v2/features/modal/index.d.ts +3 -3
- package/dist/v2/features/modal/index.js +639 -7
- package/dist/v2/features/modal/index.js.map +1 -0
- package/dist/v2/features/modal/modal-events.d.ts +1 -1
- package/dist/v2/features/operation/Operation.vue.d.ts +2 -2
- package/dist/v2/features/operation/index.d.ts +5 -5
- package/dist/v2/features/operation/index.js +19 -12
- package/dist/v2/features/search/helpers/create-fuse-instance.d.ts +1 -1
- package/dist/v2/features/search/helpers/create-search-index.d.ts +1 -1
- package/dist/v2/features/search/index.d.ts +1 -1
- package/dist/v2/features/search/index.js +2 -4
- package/dist/v2/features/settings/components/Section.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/index.d.ts +2 -2
- package/dist/v2/features/settings/index.js +2 -6
- package/dist/v2/helpers/get-active-proxy-url.d.ts +1 -1
- package/dist/v2/helpers/get-tab-details.d.ts +1 -1
- package/dist/v2/helpers/handle-hotkeys.d.ts +1 -1
- package/dist/v2/helpers/index.d.ts +2 -2
- package/dist/v2/helpers/index.js +3 -6
- package/dist/v2/hooks/use-global-hot-keys.d.ts +1 -1
- package/dist/views/Collection/components/EnvironmentForm.vue.d.ts +1 -1
- package/dist/views/Collection/components/MarkdownInput.vue.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/index.d.ts +4 -4
- package/dist/views/Components/CodeSnippet/index.js +3 -10
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +1 -1
- package/dist/views/Environment/handle-drag.d.ts +1 -1
- package/dist/views/Request/Request.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +3 -3
- package/dist/views/Request/RequestSection/RequestAuth/index.js +4 -8
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts +1 -1
- package/dist/views/Request/RequestSection/index.d.ts +2 -2
- package/dist/views/Request/RequestSection/index.js +42 -5
- package/dist/views/Request/RequestSection/index.js.map +1 -0
- package/dist/views/Request/RequestSidebarItem.vue.d.ts +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +3 -3
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +1 -1
- package/dist/views/Request/ResponseSection/index.d.ts +2 -2
- package/dist/views/Request/ResponseSection/index.js +7 -6
- package/dist/views/Request/components/index.d.ts +1 -1
- package/dist/views/Request/components/index.js +2 -4
- package/dist/views/Request/consts/index.d.ts +2 -2
- package/dist/views/Request/consts/index.js +2 -10
- package/dist/views/Request/handle-drag.d.ts +2 -2
- package/dist/views/Request/libs/auth.d.ts +1 -1
- package/dist/views/Request/libs/index.d.ts +3 -3
- package/dist/views/Request/libs/index.js +3 -22
- package/dist/views/Request/libs/oauth2.d.ts +1 -1
- package/dist/views/Request/libs/watch-mode.d.ts +2 -2
- package/dist/views/Request/types/index.js +0 -1
- package/dist/watch-mode-Dbaqd9bG.js +375 -0
- package/dist/watch-mode-Dbaqd9bG.js.map +1 -0
- package/package.json +29 -33
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -9
- package/dist/analytics.js +0 -9
- package/dist/assets/computer.ascii.js +0 -34
- package/dist/assets/keycap.ascii.js +0 -25
- package/dist/assets/rabbit.ascii.js +0 -11
- package/dist/assets/rabbitjump.ascii.js +0 -11
- package/dist/components/AddressBar/AddressBar.vue.js +0 -7
- package/dist/components/AddressBar/AddressBar.vue2.js +0 -160
- package/dist/components/AddressBar/AddressBarHistory.vue.js +0 -7
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +0 -98
- package/dist/components/AddressBar/httpStatusCodeColors.js +0 -38
- package/dist/components/CodeInput/CodeInput.vue.js +0 -8
- package/dist/components/CodeInput/CodeInput.vue2.js +0 -209
- package/dist/components/CodeInput/codeVariableWidget.js +0 -111
- package/dist/components/CommandPalette/CommandActionForm.vue.js +0 -44
- package/dist/components/CommandPalette/CommandActionForm.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandActionInput.vue.js +0 -52
- package/dist/components/CommandPalette/CommandActionInput.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +0 -80
- package/dist/components/CommandPalette/CommandPaletteCollection.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +0 -116
- package/dist/components/CommandPalette/CommandPaletteExample.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +0 -217
- package/dist/components/CommandPalette/CommandPaletteImport.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +0 -7
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +0 -136
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +0 -123
- package/dist/components/CommandPalette/CommandPaletteServer.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +0 -84
- package/dist/components/CommandPalette/CommandPaletteTag.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +0 -48
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue2.js +0 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +0 -7
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +0 -305
- package/dist/components/CommandPalette/WatchModeToggle.vue.js +0 -39
- package/dist/components/CommandPalette/WatchModeToggle.vue2.js +0 -4
- package/dist/components/DataTable/DataTable.vue.js +0 -38
- package/dist/components/DataTable/DataTable.vue2.js +0 -4
- package/dist/components/DataTable/DataTableCell.vue.js +0 -26
- package/dist/components/DataTable/DataTableCell.vue2.js +0 -4
- package/dist/components/DataTable/DataTableCheckbox.vue.js +0 -53
- package/dist/components/DataTable/DataTableCheckbox.vue2.js +0 -4
- package/dist/components/DataTable/DataTableHeader.vue.js +0 -18
- package/dist/components/DataTable/DataTableHeader.vue2.js +0 -4
- package/dist/components/DataTable/DataTableInput.vue.js +0 -7
- package/dist/components/DataTable/DataTableInput.vue2.js +0 -124
- package/dist/components/DataTable/DataTableInputSelect.vue.js +0 -146
- package/dist/components/DataTable/DataTableInputSelect.vue2.js +0 -4
- package/dist/components/DataTable/DataTableRow.vue.js +0 -12
- package/dist/components/DataTable/DataTableText.vue.js +0 -23
- package/dist/components/DataTable/DataTableText.vue2.js +0 -4
- package/dist/components/EmptyState.vue.js +0 -7
- package/dist/components/EmptyState.vue2.js +0 -42
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +0 -113
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue2.js +0 -4
- package/dist/components/Form/Form.vue.js +0 -83
- package/dist/components/Form/Form.vue2.js +0 -4
- package/dist/components/Form/LabelInput.vue.js +0 -7
- package/dist/components/Form/LabelInput.vue2.js +0 -42
- package/dist/components/HelpfulLink.vue.js +0 -20
- package/dist/components/HelpfulLink.vue2.js +0 -4
- package/dist/components/HttpMethod/HttpMethod.vue.js +0 -7
- package/dist/components/HttpMethod/HttpMethod.vue2.js +0 -62
- package/dist/components/IconSelector.vue.js +0 -75
- package/dist/components/IconSelector.vue2.js +0 -4
- package/dist/components/ImportCollection/DropEventListener.vue.js +0 -81
- package/dist/components/ImportCollection/DropEventListener.vue2.js +0 -4
- package/dist/components/ImportCollection/ImportCollectionListener.vue.js +0 -77
- package/dist/components/ImportCollection/ImportCollectionListener.vue2.js +0 -4
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +0 -208
- package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +0 -5
- package/dist/components/ImportCollection/ImportNowButton.vue.js +0 -73
- package/dist/components/ImportCollection/ImportNowButton.vue2.js +0 -4
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +0 -44
- package/dist/components/ImportCollection/IntegrationLogo.vue2.js +0 -4
- package/dist/components/ImportCollection/PasteEventListener.vue.js +0 -24
- package/dist/components/ImportCollection/PasteEventListener.vue2.js +0 -4
- package/dist/components/ImportCollection/PrefetchError.vue.js +0 -27
- package/dist/components/ImportCollection/PrefetchError.vue2.js +0 -4
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.js +0 -20
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue2.js +0 -4
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +0 -134
- package/dist/components/ImportCollection/WorkspaceSelector.vue2.js +0 -4
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +0 -106
- package/dist/components/ImportCollection/utils/get-openapi-version.js +0 -20
- package/dist/components/ImportCollection/utils/import-collection.js +0 -29
- package/dist/components/ImportCollection/utils/is-document.js +0 -9
- package/dist/components/ImportCollection/utils/is-url.js +0 -9
- package/dist/components/ImportCollection/utils/workspace-store-is-empty.js +0 -7
- package/dist/components/OpenApiClientButton.vue.js +0 -7
- package/dist/components/OpenApiClientButton.vue2.js +0 -48
- package/dist/components/ScalarAsciiArt.vue.js +0 -7
- package/dist/components/ScalarAsciiArt.vue2.js +0 -37
- package/dist/components/Search/useSearch.js +0 -78
- package/dist/components/SectionFilter.vue.js +0 -7
- package/dist/components/SectionFilter.vue2.js +0 -64
- package/dist/components/SectionFilterButton.vue.js +0 -23
- package/dist/components/SectionFilterButton.vue2.js +0 -4
- package/dist/components/Server/ServerDropdown.vue.js +0 -132
- package/dist/components/Server/ServerDropdown.vue2.js +0 -4
- package/dist/components/Server/ServerDropdownItem.vue.js +0 -7
- package/dist/components/Server/ServerDropdownItem.vue2.js +0 -84
- package/dist/components/Server/ServerSelector.vue.js +0 -82
- package/dist/components/Server/ServerSelector.vue2.js +0 -4
- package/dist/components/Server/ServerVariablesForm.vue.js +0 -49
- package/dist/components/Server/ServerVariablesForm.vue2.js +0 -4
- package/dist/components/Server/ServerVariablesSelect.vue.js +0 -54
- package/dist/components/Server/ServerVariablesSelect.vue2.js +0 -4
- package/dist/components/Server/ServerVariablesTextbox.vue.js +0 -29
- package/dist/components/Server/ServerVariablesTextbox.vue2.js +0 -4
- package/dist/components/SideNav/DownloadAppButton.vue.js +0 -7
- package/dist/components/SideNav/DownloadAppButton.vue2.js +0 -33
- package/dist/components/SideNav/SideHelp.vue.js +0 -127
- package/dist/components/SideNav/SideHelp.vue2.js +0 -4
- package/dist/components/SideNav/SideNav.vue.js +0 -96
- package/dist/components/SideNav/SideNav.vue2.js +0 -4
- package/dist/components/SideNav/SideNavGroup.vue.js +0 -16
- package/dist/components/SideNav/SideNavGroup.vue2.js +0 -4
- package/dist/components/SideNav/SideNavLink.vue.js +0 -39
- package/dist/components/SideNav/SideNavLink.vue2.js +0 -4
- package/dist/components/SideNav/SideNavRouterLink.vue.js +0 -27
- package/dist/components/SideNav/SideNavRouterLink.vue2.js +0 -4
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +0 -30
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue2.js +0 -4
- package/dist/components/Sidebar/Actions/EditSidebarListCollection.vue.js +0 -58
- package/dist/components/Sidebar/Actions/EditSidebarListCollection.vue2.js +0 -4
- package/dist/components/Sidebar/Actions/EditSidebarListElement.vue.js +0 -29
- package/dist/components/Sidebar/Actions/EditSidebarListElement.vue2.js +0 -4
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +0 -46
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +0 -4
- package/dist/components/Sidebar/Sidebar.vue.js +0 -7
- package/dist/components/Sidebar/Sidebar.vue2.js +0 -63
- package/dist/components/Sidebar/SidebarButton.vue.js +0 -33
- package/dist/components/Sidebar/SidebarButton.vue2.js +0 -4
- package/dist/components/Sidebar/SidebarList.vue.js +0 -12
- package/dist/components/Sidebar/SidebarListElement.vue.js +0 -8
- package/dist/components/Sidebar/SidebarListElement.vue2.js +0 -94
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +0 -86
- package/dist/components/Sidebar/SidebarListElementActions.vue2.js +0 -4
- package/dist/components/Sidebar/SidebarToggle.vue.js +0 -49
- package/dist/components/Sidebar/SidebarToggle.vue2.js +0 -4
- package/dist/components/TopNav/TopNav.vue.js +0 -210
- package/dist/components/TopNav/TopNav.vue2.js +0 -4
- package/dist/components/TopNav/TopNavItem.vue.js +0 -7
- package/dist/components/TopNav/TopNavItem.vue2.js +0 -138
- package/dist/components/ViewLayout/ViewLayout.vue.js +0 -18
- package/dist/components/ViewLayout/ViewLayout.vue2.js +0 -4
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +0 -92
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue2.js +0 -4
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js +0 -12
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +0 -23
- package/dist/components/ViewLayout/ViewLayoutSection.vue2.js +0 -4
- package/dist/constants.js +0 -40
- package/dist/data/httpHeaders.js +0 -537
- package/dist/hooks/useAnalytics.js +0 -11
- package/dist/hooks/useClientConfig.js +0 -7
- package/dist/hooks/useFileDialog.js +0 -21
- package/dist/hooks/useLayout.js +0 -8
- package/dist/hooks/useResponseBody.js +0 -20
- package/dist/hooks/useSidebar.js +0 -28
- package/dist/layouts/App/ApiClientApp.vue.js +0 -70
- package/dist/layouts/App/ApiClientApp.vue3.js +0 -5
- package/dist/layouts/App/MainLayout.vue.js +0 -26
- package/dist/layouts/App/MainLayout.vue2.js +0 -4
- package/dist/layouts/App/create-api-client-app.js +0 -35
- package/dist/layouts/App/hotkeys.js +0 -21
- package/dist/layouts/Modal/ApiClientModal.vue.js +0 -30
- package/dist/layouts/Modal/ApiClientModal.vue2.js +0 -4
- package/dist/layouts/Modal/create-api-client-modal.js +0 -32
- package/dist/layouts/Web/ApiClientWeb.vue.js +0 -64
- package/dist/layouts/Web/ApiClientWeb.vue3.js +0 -5
- package/dist/layouts/Web/create-api-client-web.js +0 -32
- package/dist/libs/create-client.js +0 -189
- package/dist/libs/electron.js +0 -4
- package/dist/libs/env-helpers.js +0 -6
- package/dist/libs/environment-parser.js +0 -18
- package/dist/libs/errors.js +0 -16
- package/dist/libs/event-bus.js +0 -32
- package/dist/libs/extractAttachmentFilename.js +0 -18
- package/dist/libs/find-request.js +0 -23
- package/dist/libs/formatters.js +0 -10
- package/dist/libs/get-request-uid-by-path-method.js +0 -18
- package/dist/libs/getOpenApiDocumentDetails.js +0 -40
- package/dist/libs/hot-keys.js +0 -44
- package/dist/libs/importers/curl.js +0 -53
- package/dist/libs/isUrl.js +0 -7
- package/dist/libs/local-storage.js +0 -41
- package/dist/libs/normalize-headers.js +0 -27
- package/dist/libs/parse-curl.js +0 -59
- package/dist/libs/postman.js +0 -37
- package/dist/libs/send-request/build-request-security.js +0 -35
- package/dist/libs/send-request/create-fetch-body.js +0 -25
- package/dist/libs/send-request/create-fetch-headers.js +0 -11
- package/dist/libs/send-request/create-fetch-query-params.js +0 -33
- package/dist/libs/send-request/create-request-operation.js +0 -140
- package/dist/libs/send-request/decode-buffer.js +0 -9
- package/dist/libs/send-request/set-request-cookies.js +0 -58
- package/dist/libs/string-template.js +0 -42
- package/dist/libs/validate-parameters.js +0 -16
- package/dist/plugins/hooks/usePluginManager.js +0 -10
- package/dist/plugins/plugin-manager.js +0 -26
- package/dist/routes.js +0 -210
- package/dist/store/active-entities.js +0 -118
- package/dist/store/collections.js +0 -73
- package/dist/store/cookies.js +0 -13
- package/dist/store/environment.js +0 -32
- package/dist/store/events.js +0 -35
- package/dist/store/import-spec.js +0 -55
- package/dist/store/request-example.js +0 -43
- package/dist/store/requests.js +0 -97
- package/dist/store/router-params.js +0 -22
- package/dist/store/security-schemes.js +0 -55
- package/dist/store/servers.js +0 -39
- package/dist/store/store.js +0 -144
- package/dist/store/tags.js +0 -45
- package/dist/store/workspace.js +0 -52
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +0 -242
- package/dist/v2/blocks/operation-block/OperationBlock.vue2.js +0 -4
- package/dist/v2/blocks/operation-block/components/Header.vue.js +0 -7
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +0 -100
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +0 -40
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +0 -31
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +0 -107
- package/dist/v2/blocks/operation-block/helpers/build-request-security.js +0 -46
- package/dist/v2/blocks/operation-block/helpers/build-request.js +0 -70
- package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +0 -25
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +0 -9
- package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js +0 -14
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js +0 -4
- package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js +0 -7
- package/dist/v2/blocks/operation-block/helpers/get-example.js +0 -36
- package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js +0 -17
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +0 -4
- package/dist/v2/blocks/operation-block/helpers/get-server-url.js +0 -12
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js +0 -31
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.js +0 -43
- package/dist/v2/blocks/operation-block/helpers/response-cache.js +0 -12
- package/dist/v2/blocks/operation-block/helpers/send-request.js +0 -122
- package/dist/v2/blocks/operation-block/helpers/serialize-parameter.js +0 -49
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +0 -17
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.js +0 -56
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue2.js +0 -4
- package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue.js +0 -30
- package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue2.js +0 -4
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +0 -7
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +0 -227
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.js +0 -22
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +0 -27
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +0 -40
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.js +0 -20
- package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.js +0 -4
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +0 -302
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.js +0 -28
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.js +0 -10
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +0 -67
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +0 -66
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +0 -172
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.js +0 -55
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.js +0 -18
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +0 -7
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +0 -344
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +0 -7
- package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +0 -191
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js +0 -84
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue2.js +0 -4
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +0 -135
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue2.js +0 -4
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js +0 -78
- package/dist/v2/blocks/request-block/components/RequestParams.vue2.js +0 -4
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +0 -7
- package/dist/v2/blocks/request-block/components/RequestTable.vue2.js +0 -74
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +0 -204
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue2.js +0 -4
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +0 -7
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue2.js +0 -63
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +0 -55
- package/dist/v2/blocks/request-block/helpers/files.js +0 -7
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +0 -26
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +0 -29
- package/dist/v2/blocks/request-block/helpers/get-parameter-content.js +0 -9
- package/dist/v2/blocks/request-block/helpers/get-parameter-schema.js +0 -6
- package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +0 -16
- package/dist/v2/blocks/request-block/helpers/group-by.js +0 -10
- package/dist/v2/blocks/request-block/helpers/is-param-disabled.js +0 -7
- package/dist/v2/blocks/request-block/helpers/validate-parameter.js +0 -32
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +0 -7
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +0 -180
- package/dist/v2/blocks/response-block/components/Headers.vue.js +0 -96
- package/dist/v2/blocks/response-block/components/Headers.vue2.js +0 -4
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +0 -7
- package/dist/v2/blocks/response-block/components/ResponseBody.vue2.js +0 -87
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.js +0 -36
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue2.js +0 -4
- package/dist/v2/blocks/response-block/components/ResponseBodyInfo.vue.js +0 -14
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +0 -7
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue2.js +0 -63
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +0 -7
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue2.js +0 -41
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +0 -94
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue2.js +0 -4
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.js +0 -25
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue2.js +0 -4
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.js +0 -52
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue3.js +0 -5
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +0 -54
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue2.js +0 -4
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +0 -7
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +0 -79
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +0 -7
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue2.js +0 -46
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js +0 -67
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue2.js +0 -4
- package/dist/v2/blocks/response-block/helpers/extract-filename.js +0 -18
- package/dist/v2/blocks/response-block/helpers/get-content-length.js +0 -12
- package/dist/v2/blocks/response-block/helpers/media-types.js +0 -126
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +0 -12
- package/dist/v2/blocks/response-block/helpers/process-response-body.js +0 -16
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +0 -7
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +0 -208
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +0 -7
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue2.js +0 -95
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +0 -145
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue2.js +0 -4
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js +0 -38
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +0 -25
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +0 -182
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js +0 -51
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +0 -330
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js +0 -7
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue2.js +0 -76
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +0 -165
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue3.js +0 -5
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js +0 -91
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +0 -83
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +0 -46
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +0 -244
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +0 -97
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +0 -135
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +0 -35
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +0 -7
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +0 -23
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +0 -139
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +0 -27
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +0 -64
- package/dist/v2/components/callout/Callout.vue.js +0 -7
- package/dist/v2/components/callout/Callout.vue2.js +0 -43
- package/dist/v2/components/code-input/CodeInput.vue.js +0 -8
- package/dist/v2/components/code-input/CodeInput.vue2.js +0 -213
- package/dist/v2/components/code-input/code-variable-widget.js +0 -106
- package/dist/v2/components/data-table/DataTable.vue.js +0 -38
- package/dist/v2/components/data-table/DataTable.vue2.js +0 -4
- package/dist/v2/components/data-table/DataTableCell.vue.js +0 -26
- package/dist/v2/components/data-table/DataTableCell.vue2.js +0 -4
- package/dist/v2/components/data-table/DataTableCheckbox.vue.js +0 -53
- package/dist/v2/components/data-table/DataTableCheckbox.vue2.js +0 -4
- package/dist/v2/components/data-table/DataTableHeader.vue.js +0 -18
- package/dist/v2/components/data-table/DataTableHeader.vue2.js +0 -4
- package/dist/v2/components/data-table/DataTableInput.vue.js +0 -7
- package/dist/v2/components/data-table/DataTableInput.vue2.js +0 -121
- package/dist/v2/components/data-table/DataTableInputSelect.vue.js +0 -149
- package/dist/v2/components/data-table/DataTableInputSelect.vue2.js +0 -4
- package/dist/v2/components/data-table/DataTableRow.vue.js +0 -12
- package/dist/v2/components/data-table/DataTableText.vue.js +0 -23
- package/dist/v2/components/data-table/DataTableText.vue2.js +0 -4
- package/dist/v2/components/forms/ConfirmationForm.vue.js +0 -45
- package/dist/v2/components/forms/ConfirmationForm.vue2.js +0 -4
- package/dist/v2/components/layout/CollapsibleSection.vue.js +0 -89
- package/dist/v2/components/layout/CollapsibleSection.vue2.js +0 -4
- package/dist/v2/components/layout/ValueEmitter.vue.js +0 -21
- package/dist/v2/components/layout/ValueEmitter.vue2.js +0 -4
- package/dist/v2/components/modals/DeleteModal.vue.js +0 -31
- package/dist/v2/components/modals/DeleteModal.vue2.js +0 -4
- package/dist/v2/components/modals/ModalClientContainer.vue.js +0 -7
- package/dist/v2/components/modals/ModalClientContainer.vue2.js +0 -60
- package/dist/v2/components/resize/Resize.vue.js +0 -8
- package/dist/v2/components/resize/Resize.vue2.js +0 -36
- package/dist/v2/components/resize/use-split-resize.js +0 -57
- package/dist/v2/components/server/ServerDropdown.vue.js +0 -91
- package/dist/v2/components/server/ServerDropdown.vue2.js +0 -4
- package/dist/v2/components/server/ServerDropdownItem.vue.js +0 -7
- package/dist/v2/components/server/ServerDropdownItem.vue2.js +0 -49
- package/dist/v2/components/sidebar/Sidebar.vue.js +0 -115
- package/dist/v2/components/sidebar/Sidebar.vue2.js +0 -4
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +0 -50
- package/dist/v2/components/sidebar/SidebarMenu.vue2.js +0 -4
- package/dist/v2/components/sidebar/SidebarToggle.vue.js +0 -52
- package/dist/v2/components/sidebar/SidebarToggle.vue2.js +0 -4
- package/dist/v2/features/app/App.vue.js +0 -152
- package/dist/v2/features/app/App.vue3.js +0 -5
- package/dist/v2/features/app/app-events.js +0 -251
- package/dist/v2/features/app/app-state.js +0 -415
- package/dist/v2/features/app/components/AppSidebar.vue.js +0 -7
- package/dist/v2/features/app/components/AppSidebar.vue2.js +0 -304
- package/dist/v2/features/app/components/CreateWorkspaceModal.vue.js +0 -56
- package/dist/v2/features/app/components/CreateWorkspaceModal.vue2.js +0 -4
- package/dist/v2/features/app/components/DesktopTab.vue.js +0 -7
- package/dist/v2/features/app/components/DesktopTab.vue2.js +0 -134
- package/dist/v2/features/app/components/DesktopTabs.vue.js +0 -56
- package/dist/v2/features/app/components/DesktopTabs.vue2.js +0 -4
- package/dist/v2/features/app/components/DownloadAppButton.vue.js +0 -7
- package/dist/v2/features/app/components/DownloadAppButton.vue2.js +0 -19
- package/dist/v2/features/app/components/SidebarItemMenu.vue.js +0 -185
- package/dist/v2/features/app/components/SidebarItemMenu.vue2.js +0 -4
- package/dist/v2/features/app/components/SplashScreen.vue.js +0 -7
- package/dist/v2/features/app/components/SplashScreen.vue2.js +0 -18
- package/dist/v2/features/app/helpers/create-api-client-app.js +0 -36
- package/dist/v2/features/app/helpers/filter-workspaces.js +0 -5
- package/dist/v2/features/app/helpers/get-route-param.js +0 -9
- package/dist/v2/features/app/helpers/group-workspaces.js +0 -23
- package/dist/v2/features/app/helpers/routes.js +0 -157
- package/dist/v2/features/app/hooks/use-document-watcher.js +0 -66
- package/dist/v2/features/app/hooks/use-theme.js +0 -48
- package/dist/v2/features/collection/DocumentCollection.vue.js +0 -336
- package/dist/v2/features/collection/DocumentCollection.vue3.js +0 -5
- package/dist/v2/features/collection/OperationCollection.vue.js +0 -86
- package/dist/v2/features/collection/OperationCollection.vue2.js +0 -4
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +0 -68
- package/dist/v2/features/collection/WorkspaceCollection.vue2.js +0 -4
- package/dist/v2/features/collection/components/Authentication.vue.js +0 -7
- package/dist/v2/features/collection/components/Authentication.vue2.js +0 -154
- package/dist/v2/features/collection/components/Cookies.vue.js +0 -52
- package/dist/v2/features/collection/components/Cookies.vue2.js +0 -4
- package/dist/v2/features/collection/components/Editor/Editor.vue.js +0 -7
- package/dist/v2/features/collection/components/Editor/Editor.vue2.js +0 -344
- package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue.js +0 -78
- package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue2.js +0 -4
- package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue.js +0 -83
- package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue2.js +0 -4
- package/dist/v2/features/collection/components/Editor/helpers/get-diagnostic-counts.js +0 -10
- package/dist/v2/features/collection/components/Editor/helpers/get-operation-context.js +0 -5
- package/dist/v2/features/collection/components/Editor/helpers/get-visible-diagnostics.js +0 -5
- package/dist/v2/features/collection/components/Editor/helpers/parse-editor-object.js +0 -21
- package/dist/v2/features/collection/components/Editor/helpers/stringify-document.js +0 -5
- package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.js +0 -25
- package/dist/v2/features/collection/components/Environment.vue.js +0 -54
- package/dist/v2/features/collection/components/Environment.vue2.js +0 -4
- package/dist/v2/features/collection/components/Form.vue.js +0 -78
- package/dist/v2/features/collection/components/Form.vue2.js +0 -4
- package/dist/v2/features/collection/components/LabelInput.vue.js +0 -7
- package/dist/v2/features/collection/components/LabelInput.vue2.js +0 -35
- package/dist/v2/features/collection/components/Overview.vue.js +0 -7
- package/dist/v2/features/collection/components/Overview.vue2.js +0 -208
- package/dist/v2/features/collection/components/Servers.vue.js +0 -209
- package/dist/v2/features/collection/components/Servers.vue2.js +0 -4
- package/dist/v2/features/collection/components/Settings.vue.js +0 -61
- package/dist/v2/features/collection/components/Settings.vue2.js +0 -4
- package/dist/v2/features/collection/components/SyncConflictResolutionEditor.vue.js +0 -7
- package/dist/v2/features/collection/components/SyncConflictResolutionEditor.vue2.js +0 -136
- package/dist/v2/features/collection/components/Tabs.vue.js +0 -44
- package/dist/v2/features/collection/components/Tabs.vue2.js +0 -4
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.js +0 -13
- package/dist/v2/features/command-palette/TheCommandPalette.vue.js +0 -7
- package/dist/v2/features/command-palette/TheCommandPalette.vue2.js +0 -152
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.js +0 -48
- package/dist/v2/features/command-palette/components/CommandActionForm.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.js +0 -52
- package/dist/v2/features/command-palette/components/CommandActionInput.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +0 -211
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +0 -182
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.js +0 -7
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue2.js +0 -115
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.js +0 -78
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +0 -221
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +0 -114
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue.js +0 -40
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue2.js +0 -4
- package/dist/v2/features/command-palette/helpers/generate-unique-slug.js +0 -11
- package/dist/v2/features/command-palette/helpers/get-openapi-document-details.js +0 -31
- package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.js +0 -11
- package/dist/v2/features/command-palette/helpers/get-operation-from-curl.js +0 -76
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.js +0 -18
- package/dist/v2/features/command-palette/helpers/import-document-to-workspace.js +0 -33
- package/dist/v2/features/command-palette/helpers/is-postman-collection.js +0 -11
- package/dist/v2/features/command-palette/helpers/load-document-from-source.js +0 -52
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +0 -139
- package/dist/v2/features/editor/config.js +0 -16
- package/dist/v2/features/editor/helpers/configure-language-support.js +0 -39
- package/dist/v2/features/editor/helpers/ensure-monaco-environment.js +0 -20
- package/dist/v2/features/editor/helpers/json/create-json-model.js +0 -19
- package/dist/v2/features/editor/helpers/json/get-json-ast-node-from-path.js +0 -9
- package/dist/v2/features/editor/helpers/json/json-ast.js +0 -24
- package/dist/v2/features/editor/helpers/json/json-pointer-links.js +0 -72
- package/dist/v2/features/editor/helpers/json/json-pointer-path.js +0 -21
- package/dist/v2/features/editor/helpers/range-to-whole-line.js +0 -8
- package/dist/v2/features/editor/helpers/theme/apply-scalar-theme.js +0 -56
- package/dist/v2/features/editor/helpers/theme/load-css-variables.js +0 -21
- package/dist/v2/features/editor/helpers/yaml/create-yaml-model.js +0 -19
- package/dist/v2/features/editor/helpers/yaml/get-yaml-node-range-from-path.js +0 -50
- package/dist/v2/features/editor/hooks/use-editor-markers.js +0 -34
- package/dist/v2/features/editor/hooks/use-editor.js +0 -107
- package/dist/v2/features/editor/hooks/use-json-pointer-link-support.js +0 -27
- package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js +0 -316
- package/dist/v2/features/editor/schemas/openapi-3.1-schema.json.js +0 -25
- package/dist/v2/features/environments/EnvironmentsList.vue.js +0 -68
- package/dist/v2/features/environments/EnvironmentsList.vue2.js +0 -4
- package/dist/v2/features/environments/components/Environment.vue.js +0 -66
- package/dist/v2/features/environments/components/Environment.vue2.js +0 -4
- package/dist/v2/features/environments/components/EnvironmentColors.vue.js +0 -121
- package/dist/v2/features/environments/components/EnvironmentColors.vue2.js +0 -4
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js +0 -85
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue2.js +0 -4
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js +0 -53
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue2.js +0 -4
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js +0 -109
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue2.js +0 -4
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +0 -7
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue2.js +0 -136
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +0 -7
- package/dist/v2/features/global-cookies/components/CookiesTable.vue2.js +0 -189
- package/dist/v2/features/modal/Modal.vue.js +0 -122
- package/dist/v2/features/modal/Modal.vue2.js +0 -4
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +0 -89
- package/dist/v2/features/modal/helpers/map-hidden-clients-config.js +0 -36
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js +0 -29
- package/dist/v2/features/modal/helpers/restore-workspace-state.js +0 -36
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js +0 -93
- package/dist/v2/features/modal/modal-events.js +0 -44
- package/dist/v2/features/operation/Operation.vue.js +0 -126
- package/dist/v2/features/operation/Operation.vue2.js +0 -4
- package/dist/v2/features/operation/helpers/combine-params.js +0 -14
- package/dist/v2/features/operation/helpers/get-security-requirements.js +0 -4
- package/dist/v2/features/operation/helpers/get-selected-security.js +0 -18
- package/dist/v2/features/operation/helpers/get-selected-server.js +0 -4
- package/dist/v2/features/search/helpers/create-fuse-instance.js +0 -43
- package/dist/v2/features/search/helpers/create-search-index.js +0 -63
- package/dist/v2/features/search/hooks/use-search-index.js +0 -18
- package/dist/v2/features/settings/CollectionSettings.vue.js +0 -275
- package/dist/v2/features/settings/CollectionSettings.vue2.js +0 -4
- package/dist/v2/features/settings/DocumentSettings.vue.js +0 -115
- package/dist/v2/features/settings/DocumentSettings.vue2.js +0 -4
- package/dist/v2/features/settings/components/Appearance.vue.js +0 -88
- package/dist/v2/features/settings/components/Appearance.vue2.js +0 -4
- package/dist/v2/features/settings/components/Section.vue.js +0 -35
- package/dist/v2/features/settings/components/Section.vue2.js +0 -4
- package/dist/v2/features/settings/helpers/get-theme-colors.js +0 -16
- package/dist/v2/helpers/drag-handle-factory.js +0 -120
- package/dist/v2/helpers/generate-location-id.js +0 -10
- package/dist/v2/helpers/get-active-environment.js +0 -22
- package/dist/v2/helpers/get-active-proxy-url.js +0 -5
- package/dist/v2/helpers/get-servers.js +0 -66
- package/dist/v2/helpers/get-tab-details.js +0 -34
- package/dist/v2/helpers/handle-hotkeys.js +0 -54
- package/dist/v2/helpers/is-url.js +0 -5
- package/dist/v2/helpers/slugify.js +0 -4
- package/dist/v2/helpers/storage.js +0 -16
- package/dist/v2/hooks/use-color-mode.js +0 -24
- package/dist/v2/hooks/use-global-hot-keys.js +0 -11
- package/dist/v2/hooks/use-scroll-lock.js +0 -21
- package/dist/v2/workspace-events.js +0 -252
- package/dist/views/Collection/Collection.vue.js +0 -4
- package/dist/views/Collection/Collection.vue2.js +0 -49
- package/dist/views/Collection/CollectionAuthentication.vue.js +0 -7
- package/dist/views/Collection/CollectionAuthentication.vue2.js +0 -56
- package/dist/views/Collection/CollectionCookies.vue.js +0 -4
- package/dist/views/Collection/CollectionCookies.vue2.js +0 -16
- package/dist/views/Collection/CollectionEnvironment.vue.js +0 -5
- package/dist/views/Collection/CollectionEnvironment.vue2.js +0 -229
- package/dist/views/Collection/CollectionInfoForm.vue.js +0 -7
- package/dist/views/Collection/CollectionInfoForm.vue2.js +0 -63
- package/dist/views/Collection/CollectionNavigation.vue.js +0 -133
- package/dist/views/Collection/CollectionNavigation.vue2.js +0 -4
- package/dist/views/Collection/CollectionOverview.vue.js +0 -4
- package/dist/views/Collection/CollectionOverview.vue2.js +0 -34
- package/dist/views/Collection/CollectionScripts.vue.js +0 -4
- package/dist/views/Collection/CollectionScripts.vue2.js +0 -16
- package/dist/views/Collection/CollectionServerForm.vue.js +0 -75
- package/dist/views/Collection/CollectionServerForm.vue2.js +0 -4
- package/dist/views/Collection/CollectionServers.vue.js +0 -4
- package/dist/views/Collection/CollectionServers.vue2.js +0 -94
- package/dist/views/Collection/CollectionSettings.vue.js +0 -4
- package/dist/views/Collection/CollectionSettings.vue2.js +0 -118
- package/dist/views/Collection/CollectionSync.vue.js +0 -4
- package/dist/views/Collection/CollectionSync.vue2.js +0 -16
- package/dist/views/Collection/components/EnvironmentForm.vue.js +0 -7
- package/dist/views/Collection/components/EnvironmentForm.vue2.js +0 -270
- package/dist/views/Collection/components/MarkdownInput.vue.js +0 -7
- package/dist/views/Collection/components/MarkdownInput.vue2.js +0 -100
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +0 -50
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue2.js +0 -4
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +0 -62
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +0 -82
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +0 -30
- package/dist/views/Cookies/CookieForm.vue.js +0 -34
- package/dist/views/Cookies/CookieForm.vue2.js +0 -4
- package/dist/views/Cookies/CookieModal.vue.js +0 -7
- package/dist/views/Cookies/CookieModal.vue2.js +0 -88
- package/dist/views/Cookies/Cookies.vue.js +0 -4
- package/dist/views/Cookies/Cookies.vue2.js +0 -162
- package/dist/views/Environment/Environment.vue.js +0 -4
- package/dist/views/Environment/Environment.vue2.js +0 -402
- package/dist/views/Environment/EnvironmentColorModal.vue.js +0 -42
- package/dist/views/Environment/EnvironmentColorModal.vue2.js +0 -4
- package/dist/views/Environment/EnvironmentColors.vue.js +0 -118
- package/dist/views/Environment/EnvironmentColors.vue2.js +0 -4
- package/dist/views/Environment/EnvironmentModal.vue.js +0 -131
- package/dist/views/Environment/EnvironmentModal.vue2.js +0 -4
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +0 -129
- package/dist/views/Environment/EnvironmentVariableDropdown.vue2.js +0 -4
- package/dist/views/Environment/handle-drag.js +0 -32
- package/dist/views/Request/Request.vue.js +0 -7
- package/dist/views/Request/Request.vue2.js +0 -105
- package/dist/views/Request/RequestRoot.vue.js +0 -7
- package/dist/views/Request/RequestRoot.vue2.js +0 -123
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +0 -52
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +0 -246
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +0 -135
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +0 -209
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +0 -116
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.js +0 -50
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +0 -219
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.js +0 -28
- package/dist/views/Request/RequestSection/RequestBody.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +0 -451
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +0 -170
- package/dist/views/Request/RequestSection/RequestParams.vue.js +0 -162
- package/dist/views/Request/RequestSection/RequestParams.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +0 -96
- package/dist/views/Request/RequestSection/RequestPathParams.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestSection.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +0 -247
- package/dist/views/Request/RequestSection/RequestTable.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +0 -227
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +0 -61
- package/dist/views/Request/RequestSection/helpers/filter-security-requirements.js +0 -29
- package/dist/views/Request/RequestSection/helpers/getting-started.js +0 -13
- package/dist/views/Request/RequestSection/helpers/update-scheme.js +0 -16
- package/dist/views/Request/RequestSidebar.vue.js +0 -7
- package/dist/views/Request/RequestSidebar.vue2.js +0 -341
- package/dist/views/Request/RequestSidebarItem.vue.js +0 -8
- package/dist/views/Request/RequestSidebarItem.vue2.js +0 -464
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +0 -7
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +0 -236
- package/dist/views/Request/RequestSubpageHeader.vue.js +0 -7
- package/dist/views/Request/RequestSubpageHeader.vue2.js +0 -79
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +0 -96
- package/dist/views/Request/ResponseSection/RequestHeaders.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +0 -7
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +0 -83
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +0 -36
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyInfo.vue.js +0 -14
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +0 -7
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +0 -63
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +0 -7
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +0 -42
- package/dist/views/Request/ResponseSection/ResponseBodyStreaming.vue.js +0 -74
- package/dist/views/Request/ResponseSection/ResponseBodyStreaming.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue.js +0 -25
- package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +0 -50
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +0 -5
- package/dist/views/Request/ResponseSection/ResponseCookies.vue.js +0 -51
- package/dist/views/Request/ResponseSection/ResponseCookies.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +0 -7
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +0 -103
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +0 -96
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +0 -7
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +0 -38
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +0 -67
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +0 -7
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +0 -189
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +0 -182
- package/dist/views/Request/components/WorkspaceDropdown.vue2.js +0 -4
- package/dist/views/Request/consts/mediaTypes.js +0 -131
- package/dist/views/Request/consts/new-auth-options.js +0 -100
- package/dist/views/Request/handle-drag.js +0 -42
- package/dist/views/Request/hooks/useOpenApiWatcher.js +0 -57
- package/dist/views/Request/libs/auth.js +0 -52
- package/dist/views/Request/libs/oauth2.js +0 -127
- package/dist/views/Request/libs/request.js +0 -40
- package/dist/views/Request/libs/watch-mode.js +0 -337
- package/dist/views/Settings/Settings.vue.js +0 -4
- package/dist/views/Settings/Settings.vue2.js +0 -29
- package/dist/views/Settings/SettingsGeneral.vue.js +0 -286
- package/dist/views/Settings/SettingsGeneral.vue2.js +0 -4
- package/dist/views/Settings/components/SettingsAppearance.vue.js +0 -85
- package/dist/views/Settings/components/SettingsAppearance.vue2.js +0 -4
- package/dist/views/Settings/components/SettingsSection.vue.js +0 -24
- package/dist/views/Settings/components/SettingsSection.vue2.js +0 -4
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { computed, ref, toValue } from "vue";
|
|
2
|
+
import Fuse from "fuse.js";
|
|
3
|
+
import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
4
|
+
//#region src/v2/features/search/helpers/create-fuse-instance.ts
|
|
5
|
+
/**
|
|
6
|
+
* Create a Fuse instance for searching the API reference.
|
|
7
|
+
*
|
|
8
|
+
* Doesn't have any data yet, so it's empty.
|
|
9
|
+
*/
|
|
10
|
+
function createFuseInstance() {
|
|
11
|
+
return new Fuse([], {
|
|
12
|
+
keys: [
|
|
13
|
+
{
|
|
14
|
+
name: "title",
|
|
15
|
+
weight: .7
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "description",
|
|
19
|
+
weight: .3
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "operationId",
|
|
23
|
+
weight: .6
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "path",
|
|
27
|
+
weight: .5
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "tag",
|
|
31
|
+
weight: .4
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "method",
|
|
35
|
+
weight: .3
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "documentName",
|
|
39
|
+
weight: .3
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
threshold: .3,
|
|
43
|
+
distance: 100,
|
|
44
|
+
includeScore: true,
|
|
45
|
+
includeMatches: true,
|
|
46
|
+
ignoreLocation: true,
|
|
47
|
+
useExtendedSearch: true,
|
|
48
|
+
findAllMatches: true
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/v2/features/search/helpers/create-search-index.ts
|
|
53
|
+
/**
|
|
54
|
+
* Create a search index from a list of entries.
|
|
55
|
+
*/
|
|
56
|
+
function createSearchIndex(documents) {
|
|
57
|
+
const index = [];
|
|
58
|
+
/**
|
|
59
|
+
* Recursively processes entries and their children to build the search index.
|
|
60
|
+
*/
|
|
61
|
+
function processEntries(entriesToProcess, document) {
|
|
62
|
+
entriesToProcess.forEach((entry) => {
|
|
63
|
+
addEntryToIndex(entry, index, document);
|
|
64
|
+
if ("children" in entry && entry.children) processEntries(entry.children, document);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
documents?.forEach((document) => processEntries(document["x-scalar-navigation"]?.children ?? [], document));
|
|
68
|
+
return index;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Adds a single entry to the search index, handling all entry types recursively.
|
|
72
|
+
*/
|
|
73
|
+
function addEntryToIndex(entry, index, document) {
|
|
74
|
+
if (entry.type === "operation") {
|
|
75
|
+
const operation = getResolvedRef(document?.paths?.[entry.path]?.[entry.method]) ?? {};
|
|
76
|
+
index.push({
|
|
77
|
+
type: "operation",
|
|
78
|
+
title: entry.title,
|
|
79
|
+
id: entry.id,
|
|
80
|
+
description: operation.description || "",
|
|
81
|
+
method: entry.method,
|
|
82
|
+
path: entry.path,
|
|
83
|
+
operationId: operation.operationId,
|
|
84
|
+
entry,
|
|
85
|
+
documentName: document?.info.title ?? ""
|
|
86
|
+
});
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (entry.type === "tag" && entry.isGroup === false) {
|
|
90
|
+
index.push({
|
|
91
|
+
id: entry.id,
|
|
92
|
+
title: entry.title,
|
|
93
|
+
description: entry.description || "",
|
|
94
|
+
type: "tag",
|
|
95
|
+
entry,
|
|
96
|
+
documentName: document?.info.title ?? ""
|
|
97
|
+
});
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (entry.type === "tag" && entry.isGroup === true) {
|
|
101
|
+
index.push({
|
|
102
|
+
id: entry.id,
|
|
103
|
+
title: entry.title,
|
|
104
|
+
description: "Tag Group",
|
|
105
|
+
type: "tag",
|
|
106
|
+
entry,
|
|
107
|
+
documentName: document?.info.title ?? ""
|
|
108
|
+
});
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (entry.type === "text") {
|
|
112
|
+
index.push({
|
|
113
|
+
id: entry.id,
|
|
114
|
+
type: "heading",
|
|
115
|
+
title: entry.title ?? "",
|
|
116
|
+
description: "Heading",
|
|
117
|
+
entry,
|
|
118
|
+
documentName: document?.info.title ?? ""
|
|
119
|
+
});
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/v2/features/search/hooks/use-search-index.ts
|
|
125
|
+
var MAX_SEARCH_RESULTS = 25;
|
|
126
|
+
/**
|
|
127
|
+
* Creates the search index from multiple OpenAPI documents
|
|
128
|
+
*/
|
|
129
|
+
var useSearchIndex = (documents) => {
|
|
130
|
+
/** When the document changes we replace the search index */
|
|
131
|
+
const fuse = computed(() => {
|
|
132
|
+
const instance = createFuseInstance();
|
|
133
|
+
instance.setCollection(createSearchIndex(toValue(documents)));
|
|
134
|
+
return instance;
|
|
135
|
+
});
|
|
136
|
+
const query = ref("");
|
|
137
|
+
return {
|
|
138
|
+
results: computed(() => {
|
|
139
|
+
if (query.value.length !== 0) return fuse.value.search(query.value, { limit: MAX_SEARCH_RESULTS }).flatMap((result) => {
|
|
140
|
+
if (result.item.entry.type !== "operation") return [];
|
|
141
|
+
return result.item.entry;
|
|
142
|
+
});
|
|
143
|
+
return null;
|
|
144
|
+
}),
|
|
145
|
+
query
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
export { useSearchIndex as t };
|
|
150
|
+
|
|
151
|
+
//# sourceMappingURL=search-CmsQQkjn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-CmsQQkjn.js","names":[],"sources":["../src/v2/features/search/helpers/create-fuse-instance.ts","../src/v2/features/search/helpers/create-search-index.ts","../src/v2/features/search/hooks/use-search-index.ts"],"sourcesContent":["import Fuse from 'fuse.js'\n\nimport type { FuseData } from '@/v2/features/search/types'\n\n/**\n * Create a Fuse instance for searching the API reference.\n *\n * Doesn't have any data yet, so it's empty.\n */\nexport function createFuseInstance(): Fuse<FuseData> {\n return new Fuse([], {\n // Define searchable fields with weights to prioritize more important matches\n keys: [\n // Highest weight - titles are most descriptive\n { name: 'title', weight: 0.7 },\n // Medium weight - helpful but often verbose\n { name: 'description', weight: 0.3 },\n // High weight - unique identifiers for operations\n { name: 'operationId', weight: 0.6 },\n // Good weight - endpoint paths are searchable\n { name: 'path', weight: 0.5 },\n // Medium-high weight - helps with categorization\n { name: 'tag', weight: 0.4 },\n // Medium weight - useful for filtering by method\n { name: 'method', weight: 0.3 },\n // Medium weight - useful for filtering by document name\n { name: 'documentName', weight: 0.3 },\n ],\n\n // Threshold controls how strict the matching is (0.0 = perfect match, 1.0 = very loose)\n // 0.3 allows for some typos and partial matches while maintaining relevance\n threshold: 0.3,\n\n // Maximum distance between characters that can be matched\n // Higher values allow matches even when characters are far apart in long text\n distance: 100,\n\n // Include the match score in results for debugging and potential UI enhancements\n includeScore: true,\n\n // Include detailed match information showing which parts of the text matched\n includeMatches: true,\n\n // Don't require matches to be at the beginning of strings\n // Makes search more flexible and user-friendly\n ignoreLocation: true,\n\n // Enable advanced search syntax like 'exact' for exact matches or !exclude for exclusions\n useExtendedSearch: true,\n\n // Find all possible matches in each item, not just the first one\n // Ensures comprehensive search results\n findAllMatches: true,\n })\n}\n","import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport type { FuseData } from '@/v2/features/search/types'\n\n/**\n * Create a search index from a list of entries.\n */\nexport function createSearchIndex(documents: OpenApiDocument[]): FuseData[] {\n const index: FuseData[] = []\n\n /**\n * Recursively processes entries and their children to build the search index.\n */\n function processEntries(entriesToProcess: TraversedEntry[], document?: OpenApiDocument): void {\n entriesToProcess.forEach((entry) => {\n addEntryToIndex(entry, index, document)\n\n // Recursively process children if they exist\n if ('children' in entry && entry.children) {\n processEntries(entry.children, document)\n }\n })\n }\n\n documents?.forEach((document) => processEntries(document['x-scalar-navigation']?.children ?? [], document))\n\n return index\n}\n\n/**\n * Adds a single entry to the search index, handling all entry types recursively.\n */\nfunction addEntryToIndex(entry: TraversedEntry, index: FuseData[], document?: OpenApiDocument): void {\n // Operation\n if (entry.type === 'operation') {\n const operation = getResolvedRef(document?.paths?.[entry.path]?.[entry.method]) ?? {}\n\n index.push({\n type: 'operation',\n title: entry.title,\n id: entry.id,\n description: operation.description || '',\n method: entry.method,\n path: entry.path,\n operationId: operation.operationId,\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n if (entry.type === 'tag' && entry.isGroup === false) {\n index.push({\n id: entry.id,\n title: entry.title,\n description: entry.description || '',\n type: 'tag',\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n // Tag group\n if (entry.type === 'tag' && entry.isGroup === true) {\n index.push({\n id: entry.id,\n title: entry.title,\n description: 'Tag Group',\n type: 'tag',\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n // Headings from info.description\n if (entry.type === 'text') {\n index.push({\n id: entry.id,\n type: 'heading',\n title: entry.title ?? '',\n description: 'Heading',\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n}\n","import type { Item } from '@scalar/sidebar'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { type MaybeRefOrGetter, computed, ref, toValue } from 'vue'\n\nimport { createFuseInstance } from '../helpers/create-fuse-instance'\nimport { createSearchIndex } from '../helpers/create-search-index'\n\nconst MAX_SEARCH_RESULTS = 25\n\n/**\n * Creates the search index from multiple OpenAPI documents\n */\nexport const useSearchIndex = (documents: MaybeRefOrGetter<OpenApiDocument[]>) => {\n /** When the document changes we replace the search index */\n const fuse = computed(() => {\n const instance = createFuseInstance()\n instance.setCollection(createSearchIndex(toValue(documents)))\n return instance\n })\n\n const query = ref<string>('')\n\n const results = computed<Item[] | null>(() => {\n if (query.value.length !== 0) {\n const fuseResults = fuse.value.search(query.value, {\n limit: MAX_SEARCH_RESULTS,\n })\n\n // Lets only show operations for now to match previous behavior\n return fuseResults.flatMap((result) => {\n if (result.item.entry.type !== 'operation') {\n return []\n }\n\n return result.item.entry\n })\n }\n\n return null\n })\n\n return {\n results,\n query,\n }\n}\n"],"mappings":";;;;;;;;;AASA,SAAgB,qBAAqC;AACnD,QAAO,IAAI,KAAK,EAAE,EAAE;EAElB,MAAM;GAEJ;IAAE,MAAM;IAAS,QAAQ;IAAK;GAE9B;IAAE,MAAM;IAAe,QAAQ;IAAK;GAEpC;IAAE,MAAM;IAAe,QAAQ;IAAK;GAEpC;IAAE,MAAM;IAAQ,QAAQ;IAAK;GAE7B;IAAE,MAAM;IAAO,QAAQ;IAAK;GAE5B;IAAE,MAAM;IAAU,QAAQ;IAAK;GAE/B;IAAE,MAAM;IAAgB,QAAQ;IAAK;GACtC;EAID,WAAW;EAIX,UAAU;EAGV,cAAc;EAGd,gBAAgB;EAIhB,gBAAgB;EAGhB,mBAAmB;EAInB,gBAAgB;EACjB,CAAC;;;;;;;AC5CJ,SAAgB,kBAAkB,WAA0C;CAC1E,MAAM,QAAoB,EAAE;;;;CAK5B,SAAS,eAAe,kBAAoC,UAAkC;AAC5F,mBAAiB,SAAS,UAAU;AAClC,mBAAgB,OAAO,OAAO,SAAS;AAGvC,OAAI,cAAc,SAAS,MAAM,SAC/B,gBAAe,MAAM,UAAU,SAAS;IAE1C;;AAGJ,YAAW,SAAS,aAAa,eAAe,SAAS,wBAAwB,YAAY,EAAE,EAAE,SAAS,CAAC;AAE3G,QAAO;;;;;AAMT,SAAS,gBAAgB,OAAuB,OAAmB,UAAkC;AAEnG,KAAI,MAAM,SAAS,aAAa;EAC9B,MAAM,YAAY,eAAe,UAAU,QAAQ,MAAM,QAAQ,MAAM,QAAQ,IAAI,EAAE;AAErF,QAAM,KAAK;GACT,MAAM;GACN,OAAO,MAAM;GACb,IAAI,MAAM;GACV,aAAa,UAAU,eAAe;GACtC,QAAQ,MAAM;GACd,MAAM,MAAM;GACZ,aAAa,UAAU;GACvB;GACA,cAAc,UAAU,KAAK,SAAS;GACvC,CAAC;AAEF;;AAGF,KAAI,MAAM,SAAS,SAAS,MAAM,YAAY,OAAO;AACnD,QAAM,KAAK;GACT,IAAI,MAAM;GACV,OAAO,MAAM;GACb,aAAa,MAAM,eAAe;GAClC,MAAM;GACN;GACA,cAAc,UAAU,KAAK,SAAS;GACvC,CAAC;AAEF;;AAIF,KAAI,MAAM,SAAS,SAAS,MAAM,YAAY,MAAM;AAClD,QAAM,KAAK;GACT,IAAI,MAAM;GACV,OAAO,MAAM;GACb,aAAa;GACb,MAAM;GACN;GACA,cAAc,UAAU,KAAK,SAAS;GACvC,CAAC;AAEF;;AAIF,KAAI,MAAM,SAAS,QAAQ;AACzB,QAAM,KAAK;GACT,IAAI,MAAM;GACV,MAAM;GACN,OAAO,MAAM,SAAS;GACtB,aAAa;GACb;GACA,cAAc,UAAU,KAAK,SAAS;GACvC,CAAC;AAEF;;;;;ACrFJ,IAAM,qBAAqB;;;;AAK3B,IAAa,kBAAkB,cAAmD;;CAEhF,MAAM,OAAO,eAAe;EAC1B,MAAM,WAAW,oBAAoB;AACrC,WAAS,cAAc,kBAAkB,QAAQ,UAAU,CAAC,CAAC;AAC7D,SAAO;GACP;CAEF,MAAM,QAAQ,IAAY,GAAG;AAqB7B,QAAO;EACL,SApBc,eAA8B;AAC5C,OAAI,MAAM,MAAM,WAAW,EAMzB,QALoB,KAAK,MAAM,OAAO,MAAM,OAAO,EACjD,OAAO,oBACR,CAAC,CAGiB,SAAS,WAAW;AACrC,QAAI,OAAO,KAAK,MAAM,SAAS,YAC7B,QAAO,EAAE;AAGX,WAAO,OAAO,KAAK;KACnB;AAGJ,UAAO;IACP;EAIA;EACD"}
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { n as replaceTemplateVariables } from "./string-template-sS5PtY6T.js";
|
|
2
|
+
import { t as buildRequestSecurity } from "./build-request-security-BQjNr2MD.js";
|
|
3
|
+
import { i as isElectron, r as setRequestCookies, t as getCookieHeader } from "./set-request-cookies-BJJhsU4A.js";
|
|
4
|
+
import { i as isTextMediaType } from "./consts-CyGRb9dl.js";
|
|
5
|
+
import { canMethodHaveBody } from "@scalar/oas-utils/helpers";
|
|
6
|
+
import { isDefined as isDefined$1 } from "@scalar/helpers/array/is-defined";
|
|
7
|
+
import { httpStatusCodes as httpStatusCodes$1 } from "@scalar/helpers/http/http-status-codes";
|
|
8
|
+
import { mergeUrls as mergeUrls$1 } from "@scalar/helpers/url/merge-urls";
|
|
9
|
+
import { redirectToProxy, shouldUseProxy } from "@scalar/helpers/url/redirect-to-proxy";
|
|
10
|
+
import MimeTypeParser from "whatwg-mimetype";
|
|
11
|
+
//#region src/libs/errors.ts
|
|
12
|
+
/** Centralized list of all error messages */
|
|
13
|
+
var ERRORS = {
|
|
14
|
+
BUILDING_REQUEST_FAILED: "An error occurred while building the request",
|
|
15
|
+
DEFAULT: "An unknown error has occurred.",
|
|
16
|
+
INVALID_URL: "The URL seems to be invalid. Try adding a valid URL.",
|
|
17
|
+
INVALID_HEADER: "There is an invalid header present, please double check your params.",
|
|
18
|
+
MISSING_FILE: "File uploads are not saved in history, you must re-upload the file.",
|
|
19
|
+
REQUEST_ABORTED: "The request has been cancelled",
|
|
20
|
+
REQUEST_FAILED: "An error occurred while making the request",
|
|
21
|
+
URL_EMPTY: "The address bar input seems to be empty. Try adding a URL.",
|
|
22
|
+
ON_BEFORE_REQUEST_FAILED: "onBeforeRequest request hook failed"
|
|
23
|
+
};
|
|
24
|
+
/** Normalizes caught error into an error instance */
|
|
25
|
+
var normalizeError = (e, defaultMessage = ERRORS.DEFAULT) => {
|
|
26
|
+
console.error(e);
|
|
27
|
+
if (e instanceof Error) {
|
|
28
|
+
e.message = prettyErrorMessage(e.message);
|
|
29
|
+
return e;
|
|
30
|
+
}
|
|
31
|
+
if (typeof e === "string") return new Error(prettyErrorMessage(e));
|
|
32
|
+
return new Error(defaultMessage);
|
|
33
|
+
};
|
|
34
|
+
/** Takes javascript errors and returns a prettier message */
|
|
35
|
+
var prettyErrorMessage = (message) => {
|
|
36
|
+
if (message === `Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'.`) return ERRORS.MISSING_FILE;
|
|
37
|
+
if (message === `Failed to construct 'URL': Invalid URL`) return ERRORS.INVALID_URL;
|
|
38
|
+
if (message === `Failed to execute 'fetch' on 'Window': Invalid name`) return ERRORS.INVALID_HEADER;
|
|
39
|
+
return message;
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/libs/normalize-headers.ts
|
|
43
|
+
/**
|
|
44
|
+
* Normalize headers:
|
|
45
|
+
*
|
|
46
|
+
* - Electron modifies the headers to allow CORS, this function hides the modifications
|
|
47
|
+
* - Restores original headers
|
|
48
|
+
* - Normalizes the header keys
|
|
49
|
+
* - Sorts headers alphabetically
|
|
50
|
+
* - converts to an object
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
var normalizeHeaders = (_headers, removeProxyHeaders = false) => {
|
|
54
|
+
const headers = Object.fromEntries(_headers);
|
|
55
|
+
if (removeProxyHeaders) [
|
|
56
|
+
"Access-Control-Allow-Credentials",
|
|
57
|
+
"Access-Control-Allow-Headers",
|
|
58
|
+
"Access-Control-Allow-Methods",
|
|
59
|
+
"Access-Control-Allow-Origin",
|
|
60
|
+
"Access-Control-Expose-Headers"
|
|
61
|
+
].map((header) => header.toLowerCase()).forEach((header) => delete headers[header]);
|
|
62
|
+
/** Exact key of the modified headers header */
|
|
63
|
+
const modifiedHeaderKey = Object.keys(headers).find((key) => key.toLowerCase() === "x-scalar-modified-headers");
|
|
64
|
+
/** List of modified headers */
|
|
65
|
+
const modifiedHeaders = modifiedHeaderKey ? headers[modifiedHeaderKey]?.toString().split(", ")?.map((value) => value.toLowerCase()) ?? [] : [];
|
|
66
|
+
Object.keys(headers).forEach((key) => {
|
|
67
|
+
if (modifiedHeaders.includes(key.toLowerCase())) delete headers[key];
|
|
68
|
+
});
|
|
69
|
+
if (modifiedHeaderKey) delete headers[modifiedHeaderKey];
|
|
70
|
+
Object.keys(headers).forEach((key) => {
|
|
71
|
+
const ORIGINAL_KEY_REGEX = /^x-scalar-original-/i;
|
|
72
|
+
if (ORIGINAL_KEY_REGEX.test(key)) {
|
|
73
|
+
const originalKey = key.replace(ORIGINAL_KEY_REGEX, "");
|
|
74
|
+
if (headers[key]) {
|
|
75
|
+
headers[originalKey] = headers[key];
|
|
76
|
+
delete headers[key];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
Object.keys(headers).forEach((key) => {
|
|
81
|
+
const formattedKey = formatHeaderKey(key);
|
|
82
|
+
if (key !== formattedKey && headers[key]) {
|
|
83
|
+
headers[formattedKey] = headers[key];
|
|
84
|
+
delete headers[key];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return Object.fromEntries(Object.entries(headers).sort(([a], [b]) => a.localeCompare(b)));
|
|
88
|
+
};
|
|
89
|
+
/** Make the first letter and all letters after a dash uppercase */
|
|
90
|
+
var formatHeaderKey = (key) => key.split("-").map((word) => {
|
|
91
|
+
return word.charAt(0).toUpperCase() + word.toLowerCase().slice(1);
|
|
92
|
+
}).join("-");
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/libs/send-request/create-fetch-body.ts
|
|
95
|
+
/**
|
|
96
|
+
* Create the fetch request body from an example
|
|
97
|
+
*
|
|
98
|
+
* TODO: Should we be setting the content type headers here?
|
|
99
|
+
* If so we must allow the user to override the content type header
|
|
100
|
+
*/
|
|
101
|
+
function createFetchBody(method, example, env) {
|
|
102
|
+
if (!canMethodHaveBody(method)) return {
|
|
103
|
+
body: void 0,
|
|
104
|
+
contentType: void 0
|
|
105
|
+
};
|
|
106
|
+
if (example.body.activeBody === "formData" && example.body.formData) {
|
|
107
|
+
const contentType = example.body.formData.encoding === "form-data" ? "multipart/form-data" : "application/x-www-form-urlencoded";
|
|
108
|
+
const form = example.body.formData.encoding === "form-data" ? new FormData() : new URLSearchParams();
|
|
109
|
+
example.body.formData.value.forEach((entry) => {
|
|
110
|
+
if (!entry.enabled || !entry.key) return;
|
|
111
|
+
if (entry.file && form instanceof FormData) form.append(entry.key, entry.file, entry.file.name);
|
|
112
|
+
else if (entry.value !== void 0) form.append(entry.key, replaceTemplateVariables(entry.value, env));
|
|
113
|
+
});
|
|
114
|
+
return {
|
|
115
|
+
body: form,
|
|
116
|
+
contentType
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
if (example.body.activeBody === "raw") return {
|
|
120
|
+
body: replaceTemplateVariables(example.body.raw?.value ?? "", env),
|
|
121
|
+
contentType: example.body.raw?.encoding
|
|
122
|
+
};
|
|
123
|
+
if (example.body.activeBody === "binary") return {
|
|
124
|
+
body: example.body.binary,
|
|
125
|
+
contentType: example.body.binary?.type
|
|
126
|
+
};
|
|
127
|
+
return {
|
|
128
|
+
body: void 0,
|
|
129
|
+
contentType: void 0
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/libs/send-request/create-fetch-headers.ts
|
|
134
|
+
/** Populate the headers from enabled parameters */
|
|
135
|
+
function createFetchHeaders(example, env) {
|
|
136
|
+
const headers = {};
|
|
137
|
+
example.parameters.headers.forEach((h) => {
|
|
138
|
+
const lowerCaseKey = h.key.trim().toLowerCase();
|
|
139
|
+
if (h.enabled && (lowerCaseKey !== "content-type" || h.value !== "multipart/form-data")) headers[lowerCaseKey] = replaceTemplateVariables(h.value, env);
|
|
140
|
+
});
|
|
141
|
+
return headers;
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/libs/send-request/create-fetch-query-params.ts
|
|
145
|
+
/**
|
|
146
|
+
* Populate the query parameters from the example parameters. This is an incomplete implementation that currently
|
|
147
|
+
* only supports the following styles and options:
|
|
148
|
+
*
|
|
149
|
+
* - `form` style with `explode` set to true or false
|
|
150
|
+
*
|
|
151
|
+
* @see https://spec.openapis.org/oas/v3.1.1.html#style-values
|
|
152
|
+
*/
|
|
153
|
+
function createFetchQueryParams(example, env, request) {
|
|
154
|
+
const params = new URLSearchParams();
|
|
155
|
+
const parameterSchemaMap = (request?.parameters ?? []).reduce((acc, param) => {
|
|
156
|
+
if (param.in === "query") acc[param.name] = param;
|
|
157
|
+
return acc;
|
|
158
|
+
}, {});
|
|
159
|
+
example.parameters.query.forEach((p) => {
|
|
160
|
+
if (!p.enabled) return;
|
|
161
|
+
const schema = parameterSchemaMap[p.key];
|
|
162
|
+
switch (p.type) {
|
|
163
|
+
case "array": {
|
|
164
|
+
const values = replaceTemplateVariables(p.value ?? "", env).split(/,\ ?/);
|
|
165
|
+
if (schema?.explode === false) {
|
|
166
|
+
const csv = values.join(",");
|
|
167
|
+
params.append(p.key, csv);
|
|
168
|
+
} else values.forEach((value) => {
|
|
169
|
+
params.append(p.key, value.trim());
|
|
170
|
+
});
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
default: {
|
|
174
|
+
const value = replaceTemplateVariables(p.value ?? "", env);
|
|
175
|
+
params.append(p.key, value.trim());
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
return params;
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/libs/send-request/decode-buffer.ts
|
|
184
|
+
/** Decode the buffer according to its content-type */
|
|
185
|
+
function decodeBuffer(buffer, contentType) {
|
|
186
|
+
const mimeType = new MimeTypeParser(contentType);
|
|
187
|
+
if (isTextMediaType(mimeType.essence)) return new TextDecoder(mimeType.parameters.get("charset")).decode(buffer);
|
|
188
|
+
return new Blob([buffer], { type: mimeType.essence });
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/libs/send-request/create-request-operation.ts
|
|
192
|
+
/** Execute the request */
|
|
193
|
+
var createRequestOperation = ({ environment, example, globalCookies, proxyUrl, request, securitySchemes, selectedSecuritySchemeUids = [], server, status, pluginManager }) => {
|
|
194
|
+
try {
|
|
195
|
+
const env = environment ?? {};
|
|
196
|
+
const controller = new AbortController();
|
|
197
|
+
/** Parsed and evaluated values for path parameters */
|
|
198
|
+
const pathVariables = example.parameters.path.reduce((vars, param) => {
|
|
199
|
+
if (param.enabled) {
|
|
200
|
+
const substitutedValue = replaceTemplateVariables(param.value, env);
|
|
201
|
+
vars[param.key] = encodeURIComponent(substitutedValue);
|
|
202
|
+
}
|
|
203
|
+
return vars;
|
|
204
|
+
}, {});
|
|
205
|
+
const serverString = replaceTemplateVariables(server?.url ?? "", env);
|
|
206
|
+
const pathString = replaceTemplateVariables(replaceTemplateVariables(request.path, env), pathVariables);
|
|
207
|
+
/**
|
|
208
|
+
* Start building the main URL, we cannot use the URL class yet as it does not work with relative servers
|
|
209
|
+
* Also handles the case of no server with pathString
|
|
210
|
+
*/
|
|
211
|
+
let url = serverString || pathString;
|
|
212
|
+
if (!url) throw ERRORS.URL_EMPTY;
|
|
213
|
+
Object.entries(server?.variables ?? {}).forEach(([k, v]) => {
|
|
214
|
+
url = replaceTemplateVariables(url, { [k]: pathVariables[k] || v.default });
|
|
215
|
+
});
|
|
216
|
+
const _urlParams = createFetchQueryParams(example, env, request);
|
|
217
|
+
const _headers = createFetchHeaders(example, env);
|
|
218
|
+
const { body } = createFetchBody(request.method, example, env);
|
|
219
|
+
const { cookieParams: _cookieParams } = setRequestCookies({
|
|
220
|
+
example,
|
|
221
|
+
env,
|
|
222
|
+
globalCookies,
|
|
223
|
+
serverUrl: url,
|
|
224
|
+
proxyUrl
|
|
225
|
+
});
|
|
226
|
+
const security = buildRequestSecurity(selectedSecuritySchemeUids.flat().map((uid) => securitySchemes[uid]).filter(isDefined$1), env);
|
|
227
|
+
const headers = {
|
|
228
|
+
...Object.entries(security.headers).reduce((acc, [key, value]) => {
|
|
229
|
+
acc[key.toLowerCase()] = value;
|
|
230
|
+
return acc;
|
|
231
|
+
}, {}),
|
|
232
|
+
..._headers
|
|
233
|
+
};
|
|
234
|
+
const cookieParams = [..._cookieParams, ...security.cookies];
|
|
235
|
+
const urlParams = new URLSearchParams([..._urlParams, ...security.urlParams]);
|
|
236
|
+
if (isElectron() && headers["user-agent"]) headers["X-Scalar-User-Agent"] = headers["user-agent"];
|
|
237
|
+
url = mergeUrls$1(url, pathString, urlParams);
|
|
238
|
+
/** Cookie header */
|
|
239
|
+
const cookieHeader = replaceTemplateVariables(getCookieHeader(cookieParams, headers["Cookie"]), env);
|
|
240
|
+
if (cookieHeader) if (isElectron() || shouldUseProxy(proxyUrl, url)) {
|
|
241
|
+
console.warn("We're using a `X-Scalar-Cookie` custom header to the request. The proxy will forward this as a `Cookie` header. We do this to avoid the browser omitting the `Cookie` header for cross-origin requests for security reasons.");
|
|
242
|
+
headers["X-Scalar-Cookie"] = cookieHeader;
|
|
243
|
+
} else {
|
|
244
|
+
console.warn(`We're trying to add a Cookie header, but browsers often omit them for cross-origin requests for various security reasons. If it's not working, that's probably why. Here are the requirements for it to work:
|
|
245
|
+
|
|
246
|
+
- The browser URL must be on the same domain as the server URL.
|
|
247
|
+
- The connection must be made over HTTPS.
|
|
248
|
+
`);
|
|
249
|
+
headers["Cookie"] = cookieHeader;
|
|
250
|
+
}
|
|
251
|
+
const proxiedUrl = redirectToProxy(proxyUrl, url);
|
|
252
|
+
const proxiedRequest = new Request(proxiedUrl, {
|
|
253
|
+
method: request.method.toUpperCase(),
|
|
254
|
+
body: body ?? null,
|
|
255
|
+
headers
|
|
256
|
+
});
|
|
257
|
+
const sendRequest = async () => {
|
|
258
|
+
status?.emit("start");
|
|
259
|
+
if (pluginManager) try {
|
|
260
|
+
await pluginManager.executeHook("onBeforeRequest", { request: proxiedRequest });
|
|
261
|
+
} catch (e) {
|
|
262
|
+
const _e = new Error(ERRORS.ON_BEFORE_REQUEST_FAILED, { cause: e });
|
|
263
|
+
status?.emit("abort");
|
|
264
|
+
return [normalizeError(_e), null];
|
|
265
|
+
}
|
|
266
|
+
const startTime = Date.now();
|
|
267
|
+
try {
|
|
268
|
+
const response = await fetch(proxiedRequest, { signal: controller.signal });
|
|
269
|
+
/**
|
|
270
|
+
* Checks if the response is streaming
|
|
271
|
+
* Unfortunately we cannot check the transfer-encoding header as it is not set by the browser so not quite sure how to test when
|
|
272
|
+
* content-type === 'text/plain' and transfer-encoding === 'chunked'
|
|
273
|
+
*
|
|
274
|
+
* Currently we are only checking for server sent events. In OpenApi 3.2.0 streams will be added to the spec
|
|
275
|
+
*/
|
|
276
|
+
const isStreaming = response.headers.get("content-type")?.startsWith("text/event-stream");
|
|
277
|
+
status?.emit("stop");
|
|
278
|
+
const duration = Date.now() - startTime;
|
|
279
|
+
const responseToRead = response.clone();
|
|
280
|
+
const responseHeaders = normalizeHeaders(response.headers, shouldUseProxy(proxyUrl, url));
|
|
281
|
+
const responseType = response.headers.get("content-type") ?? "text/plain;charset=UTF-8";
|
|
282
|
+
const arrayBuffer = await responseToRead.arrayBuffer();
|
|
283
|
+
const responseData = decodeBuffer(arrayBuffer, responseType);
|
|
284
|
+
const clonedResponse = response.clone();
|
|
285
|
+
const statusText = clonedResponse.statusText || httpStatusCodes$1[clonedResponse.status]?.name || "";
|
|
286
|
+
const shouldSkipBody = [
|
|
287
|
+
204,
|
|
288
|
+
205,
|
|
289
|
+
304
|
|
290
|
+
].includes(clonedResponse.status);
|
|
291
|
+
const normalizedResponse = new Response(!shouldSkipBody ? clonedResponse.body : null, {
|
|
292
|
+
status: clonedResponse.status,
|
|
293
|
+
statusText,
|
|
294
|
+
headers: clonedResponse.headers
|
|
295
|
+
});
|
|
296
|
+
if (pluginManager) await pluginManager.executeHook("onResponseReceived", {
|
|
297
|
+
response: normalizedResponse,
|
|
298
|
+
operation: request
|
|
299
|
+
});
|
|
300
|
+
const cookieHeaderKeys = "getSetCookie" in normalizedResponse.headers && typeof normalizedResponse.headers.getSetCookie === "function" ? normalizedResponse.headers.getSetCookie() : [];
|
|
301
|
+
if (isStreaming && response.body) return [null, {
|
|
302
|
+
timestamp: Date.now(),
|
|
303
|
+
request: example,
|
|
304
|
+
response: {
|
|
305
|
+
...normalizedResponse,
|
|
306
|
+
headers: responseHeaders,
|
|
307
|
+
cookieHeaderKeys,
|
|
308
|
+
reader: response.body?.getReader(),
|
|
309
|
+
duration,
|
|
310
|
+
method: request.method,
|
|
311
|
+
path: pathString
|
|
312
|
+
}
|
|
313
|
+
}];
|
|
314
|
+
return [null, {
|
|
315
|
+
timestamp: Date.now(),
|
|
316
|
+
request: example,
|
|
317
|
+
response: {
|
|
318
|
+
...response,
|
|
319
|
+
headers: responseHeaders,
|
|
320
|
+
cookieHeaderKeys,
|
|
321
|
+
data: responseData,
|
|
322
|
+
size: arrayBuffer.byteLength,
|
|
323
|
+
duration: Date.now() - startTime,
|
|
324
|
+
method: request.method,
|
|
325
|
+
status: response.status,
|
|
326
|
+
path: pathString
|
|
327
|
+
}
|
|
328
|
+
}];
|
|
329
|
+
} catch (e) {
|
|
330
|
+
status?.emit("abort");
|
|
331
|
+
return [normalizeError(e, ERRORS.REQUEST_FAILED), null];
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
return [null, {
|
|
335
|
+
request: proxiedRequest,
|
|
336
|
+
sendRequest,
|
|
337
|
+
controller
|
|
338
|
+
}];
|
|
339
|
+
} catch (e) {
|
|
340
|
+
console.error(e);
|
|
341
|
+
status?.emit("abort");
|
|
342
|
+
return [normalizeError(e), null];
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
//#endregion
|
|
346
|
+
export { ERRORS as a, normalizeHeaders as i, decodeBuffer as n, normalizeError as o, formatHeaderKey as r, prettyErrorMessage as s, createRequestOperation as t };
|
|
347
|
+
|
|
348
|
+
//# sourceMappingURL=send-request-BsTfRiBC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-request-BsTfRiBC.js","names":[],"sources":["../src/libs/errors.ts","../src/libs/normalize-headers.ts","../src/libs/send-request/create-fetch-body.ts","../src/libs/send-request/create-fetch-headers.ts","../src/libs/send-request/create-fetch-query-params.ts","../src/libs/send-request/decode-buffer.ts","../src/libs/send-request/create-request-operation.ts"],"sourcesContent":["/** Centralized list of all error messages */\nexport const ERRORS = {\n BUILDING_REQUEST_FAILED: 'An error occurred while building the request',\n DEFAULT: 'An unknown error has occurred.',\n INVALID_URL: 'The URL seems to be invalid. Try adding a valid URL.',\n INVALID_HEADER: 'There is an invalid header present, please double check your params.',\n MISSING_FILE: 'File uploads are not saved in history, you must re-upload the file.',\n REQUEST_ABORTED: 'The request has been cancelled',\n REQUEST_FAILED: 'An error occurred while making the request',\n URL_EMPTY: 'The address bar input seems to be empty. Try adding a URL.',\n ON_BEFORE_REQUEST_FAILED: 'onBeforeRequest request hook failed',\n} as const\n\n/** Normalizes caught error into an error instance */\nexport const normalizeError = (e: unknown, defaultMessage: string = ERRORS.DEFAULT): Error => {\n console.error(e)\n\n // If we have an error, update the message but keep the rest\n if (e instanceof Error) {\n e.message = prettyErrorMessage(e.message)\n return e\n }\n // If we have a string, return an error\n if (typeof e === 'string') {\n return new Error(prettyErrorMessage(e))\n }\n\n return new Error(defaultMessage)\n}\n\n/**\n * Go like error handling\n *\n * Ensure we return an error or response in an array\n */\nexport type ErrorResponse<ResponseType> = [Error, null] | [null, ResponseType]\n\n/** Takes javascript errors and returns a prettier message */\nexport const prettyErrorMessage = (message: string) => {\n // Missing file\n if (message === `Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'.`) {\n return ERRORS.MISSING_FILE\n }\n\n // Invalid URL\n if (message === `Failed to construct 'URL': Invalid URL`) {\n return ERRORS.INVALID_URL\n }\n\n // Invalid Header\n if (message === `Failed to execute 'fetch' on 'Window': Invalid name`) {\n return ERRORS.INVALID_HEADER\n }\n\n return message\n}\n","/**\n * Normalize headers:\n *\n * - Electron modifies the headers to allow CORS, this function hides the modifications\n * - Restores original headers\n * - Normalizes the header keys\n * - Sorts headers alphabetically\n * - converts to an object\n *\n */\nexport const normalizeHeaders = (_headers: Headers, removeProxyHeaders = false): Record<string, string> => {\n // Convert headers to an object\n const headers = Object.fromEntries(_headers)\n\n // Remove headers, that are added by the proxy\n if (removeProxyHeaders) {\n const headersToRemove = [\n 'Access-Control-Allow-Credentials',\n 'Access-Control-Allow-Headers',\n 'Access-Control-Allow-Methods',\n 'Access-Control-Allow-Origin',\n 'Access-Control-Expose-Headers',\n ]\n\n headersToRemove.map((header) => header.toLowerCase()).forEach((header) => delete headers[header])\n }\n\n /** Exact key of the modified headers header */\n const modifiedHeaderKey = Object.keys(headers).find((key) => key.toLowerCase() === 'x-scalar-modified-headers')\n\n /** List of modified headers */\n const modifiedHeaders = modifiedHeaderKey\n ? (headers[modifiedHeaderKey]\n ?.toString()\n .split(', ')\n ?.map((value: string) => value.toLowerCase()) ?? [])\n : []\n\n // Remove headers listed in `X-Scalar-Modified-Headers`\n Object.keys(headers).forEach((key) => {\n if (modifiedHeaders.includes(key.toLowerCase())) {\n delete headers[key]\n }\n })\n\n // Remove `X-Scalar-Modified-Headers` header\n if (modifiedHeaderKey) {\n delete headers[modifiedHeaderKey]\n }\n\n // Restore original headers (remove the `X-Scalar-Original-` prefix)\n Object.keys(headers).forEach((key) => {\n // Case-insensitive regular expression\n const ORIGINAL_KEY_REGEX = /^x-scalar-original-/i\n\n if (ORIGINAL_KEY_REGEX.test(key)) {\n const originalKey = key.replace(ORIGINAL_KEY_REGEX, '')\n if (headers[key]) {\n headers[originalKey] = headers[key]\n delete headers[key]\n }\n }\n })\n\n // Normalizes the header keys\n Object.keys(headers).forEach((key) => {\n const formattedKey = formatHeaderKey(key)\n if (key !== formattedKey && headers[key]) {\n headers[formattedKey] = headers[key]\n delete headers[key]\n }\n })\n\n // Sort headers alphebetically by key\n return Object.fromEntries(Object.entries(headers).sort(([a], [b]) => a.localeCompare(b)))\n}\n\n/** Make the first letter and all letters after a dash uppercase */\nexport const formatHeaderKey = (key: string) =>\n key\n .split('-')\n .map((word) => {\n return word.charAt(0).toUpperCase() + word.toLowerCase().slice(1)\n })\n .join('-')\n","import type { RequestExample, RequestMethod } from '@scalar/oas-utils/entities/spec'\nimport { canMethodHaveBody } from '@scalar/oas-utils/helpers'\n\nimport { replaceTemplateVariables } from '@/libs/string-template'\n\n/**\n * Create the fetch request body from an example\n *\n * TODO: Should we be setting the content type headers here?\n * If so we must allow the user to override the content type header\n */\nexport function createFetchBody(method: RequestMethod, example: RequestExample, env: object) {\n if (!canMethodHaveBody(method)) {\n return { body: undefined, contentType: undefined }\n }\n\n if (example.body.activeBody === 'formData' && example.body.formData) {\n const contentType =\n example.body.formData.encoding === 'form-data' ? 'multipart/form-data' : 'application/x-www-form-urlencoded'\n\n const form = example.body.formData.encoding === 'form-data' ? new FormData() : new URLSearchParams()\n\n // Build formData\n example.body.formData.value.forEach((entry) => {\n if (!entry.enabled || !entry.key) {\n return\n }\n\n // File upload\n if (entry.file && form instanceof FormData) {\n form.append(entry.key, entry.file, entry.file.name)\n }\n // Text input with variable replacement\n else if (entry.value !== undefined) {\n form.append(entry.key, replaceTemplateVariables(entry.value, env))\n }\n })\n return { body: form, contentType }\n }\n\n if (example.body.activeBody === 'raw') {\n return {\n body: replaceTemplateVariables(example.body.raw?.value ?? '', env),\n contentType: example.body.raw?.encoding,\n }\n }\n\n if (example.body.activeBody === 'binary') {\n return {\n body: example.body.binary,\n contentType: example.body.binary?.type,\n }\n }\n\n return {\n body: undefined,\n contentType: undefined,\n }\n}\n","import type { RequestExample } from '@scalar/oas-utils/entities/spec'\n\nimport { replaceTemplateVariables } from '@/libs/string-template'\n\n/** Populate the headers from enabled parameters */\nexport function createFetchHeaders(example: Pick<RequestExample, 'parameters'>, env: object) {\n const headers: NonNullable<RequestInit['headers']> = {}\n\n example.parameters.headers.forEach((h) => {\n const lowerCaseKey = h.key.trim().toLowerCase()\n\n // Ensure we remove the mutlipart/form-data header so fetch can properly set boundaries\n if (h.enabled && (lowerCaseKey !== 'content-type' || h.value !== 'multipart/form-data')) {\n headers[lowerCaseKey] = replaceTemplateVariables(h.value, env)\n }\n })\n\n return headers\n}\n","import type { RequestExample, RequestPayload } from '@scalar/oas-utils/entities/spec'\n\nimport { replaceTemplateVariables } from '@/libs/string-template'\n\n/**\n * Populate the query parameters from the example parameters. This is an incomplete implementation that currently\n * only supports the following styles and options:\n *\n * - `form` style with `explode` set to true or false\n *\n * @see https://spec.openapis.org/oas/v3.1.1.html#style-values\n */\nexport function createFetchQueryParams(\n example: Pick<RequestExample, 'parameters'>,\n env: object,\n // TODO: remove this when example.parameters contains query parameters schema\n request?: RequestPayload,\n): URLSearchParams {\n const params = new URLSearchParams()\n\n const parameterSchemaMap = (request?.parameters ?? []).reduce(\n (acc, param) => {\n if (param.in === 'query') {\n acc[param.name] = param\n }\n return acc\n },\n {} as Record<string, NonNullable<RequestPayload['parameters']>[number]>,\n )\n\n example.parameters.query.forEach((p) => {\n if (!p.enabled) {\n return\n }\n\n const schema = parameterSchemaMap[p.key]\n\n switch (p.type) {\n case 'array': {\n const values = replaceTemplateVariables(p.value ?? '', env).split(/,\\ ?/)\n // NOTE: we explicitly check for `false` here because the property is optional and the default serialization behavior is exploded.\n if (schema?.explode === false) {\n const csv = values.join(',')\n params.append(p.key, csv)\n } else {\n values.forEach((value) => {\n params.append(p.key, value.trim())\n })\n }\n break\n }\n default: {\n const value = replaceTemplateVariables(p.value ?? '', env)\n params.append(p.key, value.trim())\n break\n }\n }\n })\n\n return params\n}\n","import MimeTypeParser from 'whatwg-mimetype'\n\nimport { isTextMediaType } from '@/views/Request/consts'\n\n// TODO: This should return `unknown` to acknowledge we don't know type, shouldn't it?\n/** Decode the buffer according to its content-type */\nexport function decodeBuffer(buffer: ArrayBuffer, contentType: string) {\n const mimeType = new MimeTypeParser(contentType)\n\n if (isTextMediaType(mimeType.essence)) {\n const decoder = new TextDecoder(mimeType.parameters.get('charset'))\n const string = decoder.decode(buffer)\n\n // Text\n return string\n }\n\n // Binary\n return new Blob([buffer], { type: mimeType.essence })\n}\n","import { isDefined } from '@scalar/helpers/array/is-defined'\nimport { httpStatusCodes } from '@scalar/helpers/http/http-status-codes'\nimport { mergeUrls } from '@scalar/helpers/url/merge-urls'\nimport { redirectToProxy, shouldUseProxy } from '@scalar/helpers/url/redirect-to-proxy'\nimport type { Cookie } from '@scalar/oas-utils/entities/cookie'\nimport type {\n Operation,\n RequestExample,\n ResponseInstance,\n SecurityScheme,\n Server,\n} from '@scalar/oas-utils/entities/spec'\n\nimport { isElectron } from '@/libs/electron'\nimport { ERRORS, type ErrorResponse, normalizeError } from '@/libs/errors'\nimport type { EventBus } from '@/libs/event-bus'\nimport { normalizeHeaders } from '@/libs/normalize-headers'\nimport { createFetchBody } from '@/libs/send-request/create-fetch-body'\nimport { createFetchHeaders } from '@/libs/send-request/create-fetch-headers'\nimport { createFetchQueryParams } from '@/libs/send-request/create-fetch-query-params'\nimport { decodeBuffer } from '@/libs/send-request/decode-buffer'\nimport { getCookieHeader, setRequestCookies } from '@/libs/send-request/set-request-cookies'\nimport { replaceTemplateVariables } from '@/libs/string-template'\nimport type { PluginManager } from '@/plugins'\n\nimport { buildRequestSecurity } from './build-request-security'\n\nexport type RequestStatus = 'start' | 'stop' | 'abort'\n\n/** Response from sendRequest hoisted so we can use it as the return type for createRequestOperation */\ntype SendRequestResponse = ErrorResponse<{\n response: ResponseInstance\n request: RequestExample\n timestamp: number\n}>\n\nexport type SendRequestResult = SendRequestResponse[1]\n\n/** Execute the request */\nexport const createRequestOperation = ({\n environment,\n example,\n globalCookies,\n proxyUrl,\n request,\n securitySchemes,\n selectedSecuritySchemeUids = [],\n server,\n status,\n pluginManager,\n}: {\n environment: object | undefined\n example: RequestExample\n globalCookies: Cookie[]\n proxyUrl: string | undefined\n request: Operation\n securitySchemes: Record<string, SecurityScheme>\n selectedSecuritySchemeUids?: Operation['selectedSecuritySchemeUids']\n server?: Server | undefined\n status?: EventBus<RequestStatus>\n pluginManager?: PluginManager\n}): ErrorResponse<{\n controller: AbortController\n sendRequest: () => Promise<SendRequestResponse>\n request: Request\n}> => {\n try {\n const env = environment ?? {}\n const controller = new AbortController()\n\n /** Parsed and evaluated values for path parameters */\n const pathVariables = example.parameters.path.reduce<Record<string, string>>((vars, param) => {\n if (param.enabled) {\n // First substitute environment variables, then URL encode for path usage\n const substitutedValue = replaceTemplateVariables(param.value, env)\n vars[param.key] = encodeURIComponent(substitutedValue)\n }\n\n return vars\n }, {})\n\n const serverString = replaceTemplateVariables(server?.url ?? '', env)\n // Replace environment variables, then path variables\n const pathString = replaceTemplateVariables(replaceTemplateVariables(request.path, env), pathVariables)\n\n /**\n * Start building the main URL, we cannot use the URL class yet as it does not work with relative servers\n * Also handles the case of no server with pathString\n */\n let url = serverString || pathString\n\n // Handle empty url\n if (!url) {\n throw ERRORS.URL_EMPTY\n }\n\n // lets set the server variables\n // for now we only support default values\n Object.entries(server?.variables ?? {}).forEach(([k, v]) => {\n url = replaceTemplateVariables(url, {\n [k]: pathVariables[k] || v.default,\n })\n })\n\n const _urlParams = createFetchQueryParams(example, env, request)\n const _headers = createFetchHeaders(example, env)\n const { body } = createFetchBody(request.method, example, env)\n const { cookieParams: _cookieParams } = setRequestCookies({\n example,\n env,\n globalCookies,\n serverUrl: url,\n proxyUrl,\n })\n\n // We flatten the array of arrays for complex auth\n const flatSelectedSecuritySchemeUids = selectedSecuritySchemeUids.flat()\n const selectedSecuritySchemes = flatSelectedSecuritySchemeUids.map((uid) => securitySchemes[uid]).filter(isDefined)\n\n // Grab the security headers, cookies and url params\n const security = buildRequestSecurity(selectedSecuritySchemes, env)\n\n // For securityheaders, we lowercase them so they can be uppercased later (in normalizeHeaders)\n const normalizedSecurityHeaders = Object.entries(security.headers).reduce<Record<string, string>>(\n (acc, [key, value]) => {\n acc[key.toLowerCase()] = value\n return acc\n },\n {},\n )\n\n // Populate all forms of auth to the request segments\n const headers = { ...normalizedSecurityHeaders, ..._headers }\n const cookieParams = [..._cookieParams, ...security.cookies]\n const urlParams = new URLSearchParams([..._urlParams, ...security.urlParams])\n\n // If we are running in Electron, we need to add a custom header\n // that's then forwarded as a `User-Agent` header.\n if (isElectron() && headers['user-agent']) {\n headers['X-Scalar-User-Agent'] = headers['user-agent']\n }\n\n // Combine the url with the path and server + query params\n url = mergeUrls(url, pathString, urlParams)\n\n /** Cookie header */\n const cookieHeader = replaceTemplateVariables(getCookieHeader(cookieParams, headers['Cookie']), env)\n\n if (cookieHeader) {\n /**\n * If we are running in Electron, we need to add a custom header\n * that's then forwarded as a `Cookie` header.\n */\n const useCustomCookieHeader = isElectron() || shouldUseProxy(proxyUrl, url)\n\n // Add a custom header for the proxy (that's then forwarded as `Cookie`)\n if (useCustomCookieHeader) {\n console.warn(\n \"We're using a `X-Scalar-Cookie` custom header to the request. The proxy will forward this as a `Cookie` header. We do this to avoid the browser omitting the `Cookie` header for cross-origin requests for security reasons.\",\n )\n\n headers['X-Scalar-Cookie'] = cookieHeader\n }\n // or stick to the original header (which might be removed by the browser)\n else {\n console.warn(\n `We're trying to add a Cookie header, but browsers often omit them for cross-origin requests for various security reasons. If it's not working, that's probably why. Here are the requirements for it to work:\n\n - The browser URL must be on the same domain as the server URL.\n - The connection must be made over HTTPS.\n `,\n )\n\n headers['Cookie'] = cookieHeader\n }\n }\n\n const proxiedUrl = redirectToProxy(proxyUrl, url)\n\n const proxiedRequest = new Request(proxiedUrl, {\n method: request.method.toUpperCase(),\n body: body ?? null,\n headers,\n })\n\n const sendRequest = async (): Promise<SendRequestResponse> => {\n status?.emit('start')\n\n if (pluginManager) {\n try {\n await pluginManager.executeHook('onBeforeRequest', { request: proxiedRequest })\n } catch (e) {\n const _e = new Error(ERRORS.ON_BEFORE_REQUEST_FAILED, { cause: e })\n status?.emit('abort')\n return [normalizeError(_e), null]\n }\n }\n\n // Start timer to get response duration\n const startTime = Date.now()\n\n try {\n const response = await fetch(proxiedRequest, {\n signal: controller.signal,\n })\n\n /**\n * Checks if the response is streaming\n * Unfortunately we cannot check the transfer-encoding header as it is not set by the browser so not quite sure how to test when\n * content-type === 'text/plain' and transfer-encoding === 'chunked'\n *\n * Currently we are only checking for server sent events. In OpenApi 3.2.0 streams will be added to the spec\n */\n const isStreaming = response.headers.get('content-type')?.startsWith('text/event-stream')\n status?.emit('stop')\n\n const duration = Date.now() - startTime\n\n // Clone the response before reading it\n const responseToRead = response.clone()\n\n const responseHeaders = normalizeHeaders(response.headers, shouldUseProxy(proxyUrl, url))\n const responseType = response.headers.get('content-type') ?? 'text/plain;charset=UTF-8'\n\n const arrayBuffer = await responseToRead.arrayBuffer()\n const responseData = decodeBuffer(arrayBuffer, responseType)\n\n // Create a new response with the statusText\n const clonedResponse = response.clone()\n\n // This is missing in HTTP/2 requests. But we need it for the post-clonedResponse scripts.\n const statusText = clonedResponse.statusText || httpStatusCodes[clonedResponse.status]?.name || ''\n\n // Skip the body when creating the normalized response if the status is 204, 205, 304\n const shouldSkipBody = [204, 205, 304].includes(clonedResponse.status)\n\n const normalizedResponse = new Response(!shouldSkipBody ? clonedResponse.body : null, {\n status: clonedResponse.status,\n statusText,\n headers: clonedResponse.headers,\n })\n\n if (pluginManager) {\n await pluginManager.executeHook('onResponseReceived', { response: normalizedResponse, operation: request })\n }\n\n // Safely check for cookie headers\n // TODO: polyfill\n const cookieHeaderKeys =\n 'getSetCookie' in normalizedResponse.headers && typeof normalizedResponse.headers.getSetCookie === 'function'\n ? normalizedResponse.headers.getSetCookie()\n : []\n\n // We want to return the response so that it can be streamed\n if (isStreaming && response.body) {\n return [\n null,\n {\n timestamp: Date.now(),\n request: example,\n response: {\n ...normalizedResponse,\n headers: responseHeaders,\n cookieHeaderKeys,\n reader: response.body?.getReader(),\n duration,\n method: request.method,\n path: pathString,\n },\n },\n ]\n }\n\n return [\n null,\n {\n timestamp: Date.now(),\n request: example,\n response: {\n ...response,\n headers: responseHeaders,\n cookieHeaderKeys,\n data: responseData,\n size: arrayBuffer.byteLength,\n duration: Date.now() - startTime,\n method: request.method,\n status: response.status,\n path: pathString,\n },\n },\n ]\n } catch (e) {\n status?.emit('abort')\n return [normalizeError(e, ERRORS.REQUEST_FAILED), null]\n }\n }\n\n return [\n null,\n {\n request: proxiedRequest,\n sendRequest,\n controller,\n },\n ]\n } catch (e) {\n console.error(e)\n status?.emit('abort')\n return [normalizeError(e), null]\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAa,SAAS;CACpB,yBAAyB;CACzB,SAAS;CACT,aAAa;CACb,gBAAgB;CAChB,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,WAAW;CACX,0BAA0B;CAC3B;;AAGD,IAAa,kBAAkB,GAAY,iBAAyB,OAAO,YAAmB;AAC5F,SAAQ,MAAM,EAAE;AAGhB,KAAI,aAAa,OAAO;AACtB,IAAE,UAAU,mBAAmB,EAAE,QAAQ;AACzC,SAAO;;AAGT,KAAI,OAAO,MAAM,SACf,QAAO,IAAI,MAAM,mBAAmB,EAAE,CAAC;AAGzC,QAAO,IAAI,MAAM,eAAe;;;AAWlC,IAAa,sBAAsB,YAAoB;AAErD,KAAI,YAAY,+EACd,QAAO,OAAO;AAIhB,KAAI,YAAY,yCACd,QAAO,OAAO;AAIhB,KAAI,YAAY,sDACd,QAAO,OAAO;AAGhB,QAAO;;;;;;;;;;;;;;AC5CT,IAAa,oBAAoB,UAAmB,qBAAqB,UAAkC;CAEzG,MAAM,UAAU,OAAO,YAAY,SAAS;AAG5C,KAAI,mBACsB;EACtB;EACA;EACA;EACA;EACA;EACD,CAEe,KAAK,WAAW,OAAO,aAAa,CAAC,CAAC,SAAS,WAAW,OAAO,QAAQ,QAAQ;;CAInG,MAAM,oBAAoB,OAAO,KAAK,QAAQ,CAAC,MAAM,QAAQ,IAAI,aAAa,KAAK,4BAA4B;;CAG/G,MAAM,kBAAkB,oBACnB,QAAQ,oBACL,UAAU,CACX,MAAM,KAAK,EACV,KAAK,UAAkB,MAAM,aAAa,CAAC,IAAI,EAAE,GACrD,EAAE;AAGN,QAAO,KAAK,QAAQ,CAAC,SAAS,QAAQ;AACpC,MAAI,gBAAgB,SAAS,IAAI,aAAa,CAAC,CAC7C,QAAO,QAAQ;GAEjB;AAGF,KAAI,kBACF,QAAO,QAAQ;AAIjB,QAAO,KAAK,QAAQ,CAAC,SAAS,QAAQ;EAEpC,MAAM,qBAAqB;AAE3B,MAAI,mBAAmB,KAAK,IAAI,EAAE;GAChC,MAAM,cAAc,IAAI,QAAQ,oBAAoB,GAAG;AACvD,OAAI,QAAQ,MAAM;AAChB,YAAQ,eAAe,QAAQ;AAC/B,WAAO,QAAQ;;;GAGnB;AAGF,QAAO,KAAK,QAAQ,CAAC,SAAS,QAAQ;EACpC,MAAM,eAAe,gBAAgB,IAAI;AACzC,MAAI,QAAQ,gBAAgB,QAAQ,MAAM;AACxC,WAAQ,gBAAgB,QAAQ;AAChC,UAAO,QAAQ;;GAEjB;AAGF,QAAO,OAAO,YAAY,OAAO,QAAQ,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;;;AAI3F,IAAa,mBAAmB,QAC9B,IACG,MAAM,IAAI,CACV,KAAK,SAAS;AACb,QAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,aAAa,CAAC,MAAM,EAAE;EACjE,CACD,KAAK,IAAI;;;;;;;;;ACzEd,SAAgB,gBAAgB,QAAuB,SAAyB,KAAa;AAC3F,KAAI,CAAC,kBAAkB,OAAO,CAC5B,QAAO;EAAE,MAAM,KAAA;EAAW,aAAa,KAAA;EAAW;AAGpD,KAAI,QAAQ,KAAK,eAAe,cAAc,QAAQ,KAAK,UAAU;EACnE,MAAM,cACJ,QAAQ,KAAK,SAAS,aAAa,cAAc,wBAAwB;EAE3E,MAAM,OAAO,QAAQ,KAAK,SAAS,aAAa,cAAc,IAAI,UAAU,GAAG,IAAI,iBAAiB;AAGpG,UAAQ,KAAK,SAAS,MAAM,SAAS,UAAU;AAC7C,OAAI,CAAC,MAAM,WAAW,CAAC,MAAM,IAC3B;AAIF,OAAI,MAAM,QAAQ,gBAAgB,SAChC,MAAK,OAAO,MAAM,KAAK,MAAM,MAAM,MAAM,KAAK,KAAK;YAG5C,MAAM,UAAU,KAAA,EACvB,MAAK,OAAO,MAAM,KAAK,yBAAyB,MAAM,OAAO,IAAI,CAAC;IAEpE;AACF,SAAO;GAAE,MAAM;GAAM;GAAa;;AAGpC,KAAI,QAAQ,KAAK,eAAe,MAC9B,QAAO;EACL,MAAM,yBAAyB,QAAQ,KAAK,KAAK,SAAS,IAAI,IAAI;EAClE,aAAa,QAAQ,KAAK,KAAK;EAChC;AAGH,KAAI,QAAQ,KAAK,eAAe,SAC9B,QAAO;EACL,MAAM,QAAQ,KAAK;EACnB,aAAa,QAAQ,KAAK,QAAQ;EACnC;AAGH,QAAO;EACL,MAAM,KAAA;EACN,aAAa,KAAA;EACd;;;;;ACpDH,SAAgB,mBAAmB,SAA6C,KAAa;CAC3F,MAAM,UAA+C,EAAE;AAEvD,SAAQ,WAAW,QAAQ,SAAS,MAAM;EACxC,MAAM,eAAe,EAAE,IAAI,MAAM,CAAC,aAAa;AAG/C,MAAI,EAAE,YAAY,iBAAiB,kBAAkB,EAAE,UAAU,uBAC/D,SAAQ,gBAAgB,yBAAyB,EAAE,OAAO,IAAI;GAEhE;AAEF,QAAO;;;;;;;;;;;;ACLT,SAAgB,uBACd,SACA,KAEA,SACiB;CACjB,MAAM,SAAS,IAAI,iBAAiB;CAEpC,MAAM,sBAAsB,SAAS,cAAc,EAAE,EAAE,QACpD,KAAK,UAAU;AACd,MAAI,MAAM,OAAO,QACf,KAAI,MAAM,QAAQ;AAEpB,SAAO;IAET,EAAE,CACH;AAED,SAAQ,WAAW,MAAM,SAAS,MAAM;AACtC,MAAI,CAAC,EAAE,QACL;EAGF,MAAM,SAAS,mBAAmB,EAAE;AAEpC,UAAQ,EAAE,MAAV;GACE,KAAK,SAAS;IACZ,MAAM,SAAS,yBAAyB,EAAE,SAAS,IAAI,IAAI,CAAC,MAAM,OAAO;AAEzE,QAAI,QAAQ,YAAY,OAAO;KAC7B,MAAM,MAAM,OAAO,KAAK,IAAI;AAC5B,YAAO,OAAO,EAAE,KAAK,IAAI;UAEzB,QAAO,SAAS,UAAU;AACxB,YAAO,OAAO,EAAE,KAAK,MAAM,MAAM,CAAC;MAClC;AAEJ;;GAEF,SAAS;IACP,MAAM,QAAQ,yBAAyB,EAAE,SAAS,IAAI,IAAI;AAC1D,WAAO,OAAO,EAAE,KAAK,MAAM,MAAM,CAAC;AAClC;;;GAGJ;AAEF,QAAO;;;;;ACrDT,SAAgB,aAAa,QAAqB,aAAqB;CACrE,MAAM,WAAW,IAAI,eAAe,YAAY;AAEhD,KAAI,gBAAgB,SAAS,QAAQ,CAKnC,QAJgB,IAAI,YAAY,SAAS,WAAW,IAAI,UAAU,CAAC,CAC5C,OAAO,OAAO;AAOvC,QAAO,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,MAAM,SAAS,SAAS,CAAC;;;;;ACqBvD,IAAa,0BAA0B,EACrC,aACA,SACA,eACA,UACA,SACA,iBACA,6BAA6B,EAAE,EAC/B,QACA,QACA,oBAgBI;AACJ,KAAI;EACF,MAAM,MAAM,eAAe,EAAE;EAC7B,MAAM,aAAa,IAAI,iBAAiB;;EAGxC,MAAM,gBAAgB,QAAQ,WAAW,KAAK,QAAgC,MAAM,UAAU;AAC5F,OAAI,MAAM,SAAS;IAEjB,MAAM,mBAAmB,yBAAyB,MAAM,OAAO,IAAI;AACnE,SAAK,MAAM,OAAO,mBAAmB,iBAAiB;;AAGxD,UAAO;KACN,EAAE,CAAC;EAEN,MAAM,eAAe,yBAAyB,QAAQ,OAAO,IAAI,IAAI;EAErE,MAAM,aAAa,yBAAyB,yBAAyB,QAAQ,MAAM,IAAI,EAAE,cAAc;;;;;EAMvG,IAAI,MAAM,gBAAgB;AAG1B,MAAI,CAAC,IACH,OAAM,OAAO;AAKf,SAAO,QAAQ,QAAQ,aAAa,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,OAAO;AAC1D,SAAM,yBAAyB,KAAK,GACjC,IAAI,cAAc,MAAM,EAAE,SAC5B,CAAC;IACF;EAEF,MAAM,aAAa,uBAAuB,SAAS,KAAK,QAAQ;EAChE,MAAM,WAAW,mBAAmB,SAAS,IAAI;EACjD,MAAM,EAAE,SAAS,gBAAgB,QAAQ,QAAQ,SAAS,IAAI;EAC9D,MAAM,EAAE,cAAc,kBAAkB,kBAAkB;GACxD;GACA;GACA;GACA,WAAW;GACX;GACD,CAAC;EAOF,MAAM,WAAW,qBAJsB,2BAA2B,MAAM,CACT,KAAK,QAAQ,gBAAgB,KAAK,CAAC,OAAO,YAAU,EAGpD,IAAI;EAYnE,MAAM,UAAU;GAAE,GATgB,OAAO,QAAQ,SAAS,QAAQ,CAAC,QAChE,KAAK,CAAC,KAAK,WAAW;AACrB,QAAI,IAAI,aAAa,IAAI;AACzB,WAAO;MAET,EAAE,CACH;GAG+C,GAAG;GAAU;EAC7D,MAAM,eAAe,CAAC,GAAG,eAAe,GAAG,SAAS,QAAQ;EAC5D,MAAM,YAAY,IAAI,gBAAgB,CAAC,GAAG,YAAY,GAAG,SAAS,UAAU,CAAC;AAI7E,MAAI,YAAY,IAAI,QAAQ,cAC1B,SAAQ,yBAAyB,QAAQ;AAI3C,QAAM,YAAU,KAAK,YAAY,UAAU;;EAG3C,MAAM,eAAe,yBAAyB,gBAAgB,cAAc,QAAQ,UAAU,EAAE,IAAI;AAEpG,MAAI,aAQF,KAH8B,YAAY,IAAI,eAAe,UAAU,IAAI,EAGhD;AACzB,WAAQ,KACN,+NACD;AAED,WAAQ,qBAAqB;SAG1B;AACH,WAAQ,KACN;;;;YAKD;AAED,WAAQ,YAAY;;EAIxB,MAAM,aAAa,gBAAgB,UAAU,IAAI;EAEjD,MAAM,iBAAiB,IAAI,QAAQ,YAAY;GAC7C,QAAQ,QAAQ,OAAO,aAAa;GACpC,MAAM,QAAQ;GACd;GACD,CAAC;EAEF,MAAM,cAAc,YAA0C;AAC5D,WAAQ,KAAK,QAAQ;AAErB,OAAI,cACF,KAAI;AACF,UAAM,cAAc,YAAY,mBAAmB,EAAE,SAAS,gBAAgB,CAAC;YACxE,GAAG;IACV,MAAM,KAAK,IAAI,MAAM,OAAO,0BAA0B,EAAE,OAAO,GAAG,CAAC;AACnE,YAAQ,KAAK,QAAQ;AACrB,WAAO,CAAC,eAAe,GAAG,EAAE,KAAK;;GAKrC,MAAM,YAAY,KAAK,KAAK;AAE5B,OAAI;IACF,MAAM,WAAW,MAAM,MAAM,gBAAgB,EAC3C,QAAQ,WAAW,QACpB,CAAC;;;;;;;;IASF,MAAM,cAAc,SAAS,QAAQ,IAAI,eAAe,EAAE,WAAW,oBAAoB;AACzF,YAAQ,KAAK,OAAO;IAEpB,MAAM,WAAW,KAAK,KAAK,GAAG;IAG9B,MAAM,iBAAiB,SAAS,OAAO;IAEvC,MAAM,kBAAkB,iBAAiB,SAAS,SAAS,eAAe,UAAU,IAAI,CAAC;IACzF,MAAM,eAAe,SAAS,QAAQ,IAAI,eAAe,IAAI;IAE7D,MAAM,cAAc,MAAM,eAAe,aAAa;IACtD,MAAM,eAAe,aAAa,aAAa,aAAa;IAG5D,MAAM,iBAAiB,SAAS,OAAO;IAGvC,MAAM,aAAa,eAAe,cAAc,kBAAgB,eAAe,SAAS,QAAQ;IAGhG,MAAM,iBAAiB;KAAC;KAAK;KAAK;KAAI,CAAC,SAAS,eAAe,OAAO;IAEtE,MAAM,qBAAqB,IAAI,SAAS,CAAC,iBAAiB,eAAe,OAAO,MAAM;KACpF,QAAQ,eAAe;KACvB;KACA,SAAS,eAAe;KACzB,CAAC;AAEF,QAAI,cACF,OAAM,cAAc,YAAY,sBAAsB;KAAE,UAAU;KAAoB,WAAW;KAAS,CAAC;IAK7G,MAAM,mBACJ,kBAAkB,mBAAmB,WAAW,OAAO,mBAAmB,QAAQ,iBAAiB,aAC/F,mBAAmB,QAAQ,cAAc,GACzC,EAAE;AAGR,QAAI,eAAe,SAAS,KAC1B,QAAO,CACL,MACA;KACE,WAAW,KAAK,KAAK;KACrB,SAAS;KACT,UAAU;MACR,GAAG;MACH,SAAS;MACT;MACA,QAAQ,SAAS,MAAM,WAAW;MAClC;MACA,QAAQ,QAAQ;MAChB,MAAM;MACP;KACF,CACF;AAGH,WAAO,CACL,MACA;KACE,WAAW,KAAK,KAAK;KACrB,SAAS;KACT,UAAU;MACR,GAAG;MACH,SAAS;MACT;MACA,MAAM;MACN,MAAM,YAAY;MAClB,UAAU,KAAK,KAAK,GAAG;MACvB,QAAQ,QAAQ;MAChB,QAAQ,SAAS;MACjB,MAAM;MACP;KACF,CACF;YACM,GAAG;AACV,YAAQ,KAAK,QAAQ;AACrB,WAAO,CAAC,eAAe,GAAG,OAAO,eAAe,EAAE,KAAK;;;AAI3D,SAAO,CACL,MACA;GACE,SAAS;GACT;GACA;GACD,CACF;UACM,GAAG;AACV,UAAQ,MAAM,EAAE;AAChB,UAAQ,KAAK,QAAQ;AACrB,SAAO,CAAC,eAAe,EAAE,EAAE,KAAK"}
|