@scalar/api-client 2.38.1 → 2.38.3
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 +17 -0
- package/dist/AddressBar-CX8xiYoe.js +302 -0
- package/dist/AddressBar-CX8xiYoe.js.map +1 -0
- package/dist/App-BpNPKHmM.js +533 -0
- package/dist/App-BpNPKHmM.js.map +1 -0
- package/dist/App-Ckirvnv1.js +2510 -0
- package/dist/App-Ckirvnv1.js.map +1 -0
- package/dist/CodeInput-BN7uw3Bh.js +694 -0
- package/dist/CodeInput-BN7uw3Bh.js.map +1 -0
- package/dist/CodeSnippet-D7Heh1nd.js +218 -0
- package/dist/CodeSnippet-D7Heh1nd.js.map +1 -0
- package/dist/Collection-ChAxs3rz.js +219 -0
- package/dist/Collection-ChAxs3rz.js.map +1 -0
- package/dist/CollectionAuthentication-BDpvv8cA.js +56 -0
- package/dist/CollectionAuthentication-BDpvv8cA.js.map +1 -0
- package/dist/CollectionCookies-DyjPPMdt.js +19 -0
- package/dist/CollectionCookies-DyjPPMdt.js.map +1 -0
- package/dist/CollectionEnvironment-dwisJ-h5.js +514 -0
- package/dist/CollectionEnvironment-dwisJ-h5.js.map +1 -0
- package/dist/CollectionOverview-CJ9-Vmei.js +131 -0
- package/dist/CollectionOverview-CJ9-Vmei.js.map +1 -0
- package/dist/CollectionScripts-CMNlBlby.js +19 -0
- package/dist/CollectionScripts-CMNlBlby.js.map +1 -0
- package/dist/CollectionServers-BWkIGwz4.js +168 -0
- package/dist/CollectionServers-BWkIGwz4.js.map +1 -0
- package/dist/CollectionSettings-CqUUYOym.js +87 -0
- package/dist/CollectionSettings-CqUUYOym.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-BiA0IgO8.js +964 -0
- package/dist/CommandPalette-BiA0IgO8.js.map +1 -0
- package/dist/CommandPaletteImport-Diu5dDIY.js +622 -0
- package/dist/CommandPaletteImport-Diu5dDIY.js.map +1 -0
- package/dist/Cookies-CNRSxP8J.js +284 -0
- package/dist/Cookies-CNRSxP8J.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-SkIUPlrB.js +166 -0
- package/dist/DataTableInput-SkIUPlrB.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-D_CbZk0A.js +416 -0
- package/dist/Environment-D_CbZk0A.js.map +1 -0
- package/dist/EnvironmentModal-CcyqnPc2.js +288 -0
- package/dist/EnvironmentModal-CcyqnPc2.js.map +1 -0
- package/dist/Form-bA4bV_oA.js +83 -0
- package/dist/Form-bA4bV_oA.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-BIYMxB9Q.js +804 -0
- package/dist/ImportCollection-BIYMxB9Q.js.map +1 -0
- package/dist/IntegrationLogo-B9EDW8db.js +51 -0
- package/dist/IntegrationLogo-B9EDW8db.js.map +1 -0
- package/dist/MainLayout-oMIJ5QXF.js +281 -0
- package/dist/MainLayout-oMIJ5QXF.js.map +1 -0
- package/dist/Modal-DkOa_KK0.js +67 -0
- package/dist/Modal-DkOa_KK0.js.map +1 -0
- package/dist/ModalClientContainer-qHsZi4wQ.js +65 -0
- package/dist/ModalClientContainer-qHsZi4wQ.js.map +1 -0
- package/dist/Request-BWfYWyBa.js +212 -0
- package/dist/Request-BWfYWyBa.js.map +1 -0
- package/dist/RequestAuth-BU6ubH-c.js +989 -0
- package/dist/RequestAuth-BU6ubH-c.js.map +1 -0
- package/dist/RequestRoot-7xhK5_qr.js +1611 -0
- package/dist/RequestRoot-7xhK5_qr.js.map +1 -0
- package/dist/RequestSection-Bx8UHW-k.js +1582 -0
- package/dist/RequestSection-Bx8UHW-k.js.map +1 -0
- package/dist/ResponseSection-CLrgLMN_.js +949 -0
- package/dist/ResponseSection-CLrgLMN_.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-BS4zjUdO.js +303 -0
- package/dist/Server-BS4zjUdO.js.map +1 -0
- package/dist/ServerVariablesForm-BRZ9XC8o.js +145 -0
- package/dist/ServerVariablesForm-BRZ9XC8o.js.map +1 -0
- package/dist/Settings-BuLKHzRY.js +347 -0
- package/dist/Settings-BuLKHzRY.js.map +1 -0
- package/dist/Sidebar-Xl9_nFXX.js +73 -0
- package/dist/Sidebar-Xl9_nFXX.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-ChixwQhN.js +61 -0
- package/dist/components-ChixwQhN.js.map +1 -0
- package/dist/components-DfJHvSLM.js +183 -0
- package/dist/components-DfJHvSLM.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-SybDPV0U.js +85 -0
- package/dist/get-resolved-url-SybDPV0U.js.map +1 -0
- package/dist/get-server-url-UVN-dx79.js +32 -0
- package/dist/get-server-url-UVN-dx79.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-DE-hoO03.js +1674 -0
- package/dist/operation-block-DE-hoO03.js.map +1 -0
- package/dist/operation-code-sample-xgx4qi2H.js +1738 -0
- package/dist/operation-code-sample-xgx4qi2H.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-N7dPFyrG.js +1466 -0
- package/dist/request-block-N7dPFyrG.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-BbysOhkE.js +425 -0
- package/dist/scalar-address-bar-block-BbysOhkE.js.map +1 -0
- package/dist/scalar-auth-selector-block-Bs79QOMA.js +1889 -0
- package/dist/scalar-auth-selector-block-Bs79QOMA.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-DaPoVtIS.js +1512 -0
- package/dist/store-DaPoVtIS.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/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts +6 -0
- package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
- 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/get-resolved-url.d.ts +2 -1
- package/dist/v2/blocks/operation-block/helpers/get-resolved-url.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-body.d.ts.map +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/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 +3 -3
- 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/extract-security-scheme-secrets.d.ts.map +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/helpers/security-scheme.d.ts.map +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/index.d.ts +3 -3
- package/dist/v2/components/sidebar/index.js +3 -8
- package/dist/v2/constants.d.ts +3 -0
- package/dist/v2/constants.d.ts.map +1 -0
- 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/Authentication.vue.d.ts.map +1 -1
- 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/Overview.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Servers.vue.d.ts +4 -4
- 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/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts +6 -1
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
- 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/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 -347
- 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 -184
- 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 -52
- 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 -210
- 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,1611 @@
|
|
|
1
|
+
import { T as PathId, a as specDictionary, b as useClientConfig, i as createInitialRequest, r as useWorkspace, u as getModifiers, w as useActiveEntities } from "./store-DaPoVtIS.js";
|
|
2
|
+
import { a as useLayout, r as useSidebar } from "./useSidebar-DLTwHDI-.js";
|
|
3
|
+
import { n as usePluginManager } from "./plugins-B52hCIyZ.js";
|
|
4
|
+
import { a as ERRORS, t as createRequestOperation } from "./send-request-BsTfRiBC.js";
|
|
5
|
+
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BmmBcIzD.js";
|
|
6
|
+
import { t as IconSelector_default } from "./IconSelector-BDC_GQXv.js";
|
|
7
|
+
import { t as HttpMethod_default } from "./HttpMethod-rnWEgC3T.js";
|
|
8
|
+
import { t as analytics } from "./analytics-BZimCWcw.js";
|
|
9
|
+
import "./CodeInput-BN7uw3Bh.js";
|
|
10
|
+
import "./Server-BS4zjUdO.js";
|
|
11
|
+
import "./AddressBar-CX8xiYoe.js";
|
|
12
|
+
import "./components-ChixwQhN.js";
|
|
13
|
+
import { t as Sidebar_default } from "./Sidebar-Xl9_nFXX.js";
|
|
14
|
+
import { t as ScalarAsciiArt_default } from "./ScalarAsciiArt-BjuSnj8e.js";
|
|
15
|
+
import { n as rabbit_default, t as rabbitjump_default } from "./rabbitjump-CMZXAR6d.js";
|
|
16
|
+
import { n as SidebarListElementForm_default, t as DeleteSidebarListElement_default } from "./DeleteSidebarListElement-C-p87d03.js";
|
|
17
|
+
import { t as EditSidebarListElement_default } from "./EditSidebarListElement-CodWPnM6.js";
|
|
18
|
+
import { t as WorkspaceDropdown_default } from "./components-DfJHvSLM.js";
|
|
19
|
+
import { a as mutateSecuritySchemeDiff, i as mutateRequestDiff, o as mutateServerDiff, r as mutateCollectionDiff, s as mutateTagDiff, t as combineRenameDiffs } from "./watch-mode-Dbaqd9bG.js";
|
|
20
|
+
import { t as SidebarButton_default } from "./SidebarButton-BAagdMDe.js";
|
|
21
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, isRef, nextTick, normalizeClass, onBeforeUnmount, onMounted, openBlock, reactive, ref, renderList, renderSlot, resolveComponent, toDisplayString, unref, useCssVars, useId, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
22
|
+
import { ScalarButton, ScalarDropdown, ScalarDropdownButton, ScalarDropdownDivider, ScalarDropdownItem, ScalarDropdownMenu, ScalarFloating, ScalarIcon, ScalarListboxCheckbox, ScalarModal, ScalarSearchResultItem, ScalarSearchResultList, ScalarSidebarGroupToggle, ScalarSidebarSearchInput, ScalarTextInput, ScalarTooltip, useModal } from "@scalar/components";
|
|
23
|
+
import { useToasts } from "@scalar/use-toasts";
|
|
24
|
+
import { RouterLink, RouterView, useRouter } from "vue-router";
|
|
25
|
+
import { LibraryIcon } from "@scalar/icons/library";
|
|
26
|
+
import { createHash, fetchDocument, isDefined, shouldIgnoreEntity } from "@scalar/oas-utils/helpers";
|
|
27
|
+
import { parseSchema } from "@scalar/oas-utils/transforms";
|
|
28
|
+
import { isDefined as isDefined$1 } from "@scalar/helpers/array/is-defined";
|
|
29
|
+
import { useTimeoutPoll } from "@vueuse/core";
|
|
30
|
+
import Fuse from "fuse.js";
|
|
31
|
+
import microdiff from "microdiff";
|
|
32
|
+
import { Draggable } from "@scalar/draggable";
|
|
33
|
+
import { safeJSON } from "@scalar/object-utils/parse";
|
|
34
|
+
//#region src/components/Sidebar/SidebarToggle.vue?vue&type=script&setup=true&lang.ts
|
|
35
|
+
var _hoisted_1$5 = ["aria-pressed"];
|
|
36
|
+
var _hoisted_2$5 = { class: "sr-only" };
|
|
37
|
+
var _hoisted_3$2 = {
|
|
38
|
+
class: "size-4",
|
|
39
|
+
fill: "none",
|
|
40
|
+
viewBox: "0 0 24 24",
|
|
41
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
42
|
+
};
|
|
43
|
+
var _hoisted_4$2 = { "clip-path": "url(#mask)" };
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/components/Sidebar/SidebarToggle.vue
|
|
46
|
+
var SidebarToggle_default = /* @__PURE__ */ defineComponent({
|
|
47
|
+
__name: "SidebarToggle",
|
|
48
|
+
setup(__props) {
|
|
49
|
+
const { isSidebarOpen, toggleSidebarOpen } = useSidebar();
|
|
50
|
+
return (_ctx, _cache) => {
|
|
51
|
+
return openBlock(), createElementBlock("button", {
|
|
52
|
+
"aria-pressed": unref(isSidebarOpen),
|
|
53
|
+
class: "scalar-sidebar-toggle text-c-3 hover:bg-b-2 active:text-c-1 rounded-lg p-2",
|
|
54
|
+
type: "button",
|
|
55
|
+
onClick: _cache[0] || (_cache[0] = (...args) => unref(toggleSidebarOpen) && unref(toggleSidebarOpen)(...args))
|
|
56
|
+
}, [createElementVNode("span", _hoisted_2$5, toDisplayString(unref(isSidebarOpen) ? "Hide" : "Show") + " sidebar", 1), (openBlock(), createElementBlock("svg", _hoisted_3$2, [
|
|
57
|
+
_cache[1] || (_cache[1] = createElementVNode("defs", null, [createElementVNode("clipPath", { id: "mask" }, [createElementVNode("path", {
|
|
58
|
+
"clip-rule": "evenodd",
|
|
59
|
+
d: "M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z"
|
|
60
|
+
})])], -1)),
|
|
61
|
+
createElementVNode("g", _hoisted_4$2, [createElementVNode("path", {
|
|
62
|
+
class: normalizeClass(["transition-transform duration-300", unref(isSidebarOpen) ? "translate-x-0" : "-translate-x-1/2"]),
|
|
63
|
+
d: "M1 3.2h8v17.5H1z",
|
|
64
|
+
fill: "currentColor"
|
|
65
|
+
}, null, 2)]),
|
|
66
|
+
_cache[2] || (_cache[2] = createElementVNode("path", {
|
|
67
|
+
d: "M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5",
|
|
68
|
+
stroke: "currentColor",
|
|
69
|
+
"stroke-linecap": "round",
|
|
70
|
+
"stroke-linejoin": "round",
|
|
71
|
+
"stroke-width": "2"
|
|
72
|
+
}, null, -1))
|
|
73
|
+
]))], 8, _hoisted_1$5);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/hooks/useAnalytics.ts
|
|
79
|
+
/** Gets the correct analytics client based on the layout. */
|
|
80
|
+
function useAnalytics() {
|
|
81
|
+
const { layout } = useLayout();
|
|
82
|
+
if (!useClientConfig().value.telemetry || layout === "modal") return;
|
|
83
|
+
return analytics;
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/libs/validate-parameters.ts
|
|
87
|
+
/**
|
|
88
|
+
* Validate required parameters from an example.
|
|
89
|
+
*
|
|
90
|
+
* Returns both the set of invalid parameter keys and a flag indicating
|
|
91
|
+
* if there are blocking errors (empty required path parameters) that
|
|
92
|
+
* should prevent the request from being sent.
|
|
93
|
+
*/
|
|
94
|
+
var validateParameters = (example) => {
|
|
95
|
+
const result = {
|
|
96
|
+
invalidParams: /* @__PURE__ */ new Set(),
|
|
97
|
+
hasBlockingErrors: false
|
|
98
|
+
};
|
|
99
|
+
if (!example) return result;
|
|
100
|
+
example.parameters?.path?.forEach((param) => {
|
|
101
|
+
if (param.enabled && param.value.trim() === "") {
|
|
102
|
+
result.invalidParams.add(param.key);
|
|
103
|
+
result.hasBlockingErrors = true;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
[
|
|
107
|
+
"query",
|
|
108
|
+
"headers",
|
|
109
|
+
"cookies"
|
|
110
|
+
].forEach((paramType) => {
|
|
111
|
+
example.parameters?.[paramType]?.forEach((param) => {
|
|
112
|
+
if (param.required && param.value === "") result.invalidParams.add(param.key);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
return result;
|
|
116
|
+
};
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/views/Request/hooks/useOpenApiWatcher.ts
|
|
119
|
+
/** Timeout for the watch mode polling */
|
|
120
|
+
var POLLING_INTERVAL = 5 * 1e3;
|
|
121
|
+
/** Pause for 60 seconds after an error */
|
|
122
|
+
var ERROR_TIMEOUT = 60 * 1e3;
|
|
123
|
+
/**
|
|
124
|
+
* Hook which handles polling the documentUrl for changes then attempts to merge what is new
|
|
125
|
+
*
|
|
126
|
+
* TODO:
|
|
127
|
+
* - check lastModified or similar headers
|
|
128
|
+
* - speed up the polling when there's a change then slowly slow it down
|
|
129
|
+
*/
|
|
130
|
+
var useOpenApiWatcher = () => {
|
|
131
|
+
const { toast } = useToasts();
|
|
132
|
+
const activeEntities = useActiveEntities();
|
|
133
|
+
const store = useWorkspace();
|
|
134
|
+
const { activeCollection, activeWorkspace } = activeEntities;
|
|
135
|
+
const { collectionMutators } = store;
|
|
136
|
+
/** Little toast helper */
|
|
137
|
+
const toastError = (type) => toast(`[useOpenApiWatcher] Changes to the ${type} were not applied`, "error");
|
|
138
|
+
const applyDiff = (d) => {
|
|
139
|
+
if (d.path[0] === "info" || d.path[0] === "security") {
|
|
140
|
+
if (!mutateCollectionDiff(d, activeEntities, store)) toastError("collection");
|
|
141
|
+
} else if (d.path[0] === "components" && d.path[1] === "securitySchemes") {
|
|
142
|
+
if (!mutateSecuritySchemeDiff(d, activeEntities, store)) toastError("securitySchemes");
|
|
143
|
+
} else if (d.path[0] === "servers") {
|
|
144
|
+
if (!mutateServerDiff(d, activeEntities, store)) toastError("servers");
|
|
145
|
+
} else if (d.path[0] === "tags") {
|
|
146
|
+
if (!mutateTagDiff(d, activeEntities, store)) toastError("tags");
|
|
147
|
+
} else if (d.path[0] === "paths") {
|
|
148
|
+
if (!mutateRequestDiff(d, activeEntities, store)) toastError("requests");
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const { pause, resume } = useTimeoutPoll(async () => {
|
|
152
|
+
const url = activeCollection.value?.documentUrl;
|
|
153
|
+
if (!url) return;
|
|
154
|
+
const old = specDictionary[url];
|
|
155
|
+
try {
|
|
156
|
+
const spec = await fetchDocument(url, activeWorkspace.value?.proxyUrl, void 0, false);
|
|
157
|
+
const hash = createHash(spec);
|
|
158
|
+
collectionMutators.edit(activeCollection.value.uid, "watchModeStatus", "WATCHING");
|
|
159
|
+
if (!old?.hash) {
|
|
160
|
+
const { schema } = await parseSchema(spec);
|
|
161
|
+
if (schema) specDictionary[url] = {
|
|
162
|
+
hash,
|
|
163
|
+
schema
|
|
164
|
+
};
|
|
165
|
+
} else if (old.hash && old.hash !== hash) {
|
|
166
|
+
const { schema } = await parseSchema(spec);
|
|
167
|
+
const combined = combineRenameDiffs(microdiff(old.schema, schema));
|
|
168
|
+
try {
|
|
169
|
+
combined.forEach(applyDiff);
|
|
170
|
+
specDictionary[url] = {
|
|
171
|
+
hash,
|
|
172
|
+
schema
|
|
173
|
+
};
|
|
174
|
+
} catch (e) {
|
|
175
|
+
console.error("[useOpenApiWatcher] Error:", e);
|
|
176
|
+
}
|
|
177
|
+
} else console.log("[useOpenApiWatcher] No changes detected yet…");
|
|
178
|
+
} catch (e) {
|
|
179
|
+
console.error("[useOpenApiWatcher] Error:", e);
|
|
180
|
+
console.info("[useOpenApiWatcher] Pausing watcher for 60 seconds");
|
|
181
|
+
pause();
|
|
182
|
+
collectionMutators.edit(activeCollection.value.uid, "watchModeStatus", "ERROR");
|
|
183
|
+
toast("[useOpenApiWatcher] Unable to fetch the spec file, paused the watcher for 60 seconds", "error");
|
|
184
|
+
setTimeout(() => {
|
|
185
|
+
console.info("[useOpenApiWatcher] Resuming watcher");
|
|
186
|
+
resume();
|
|
187
|
+
}, ERROR_TIMEOUT);
|
|
188
|
+
}
|
|
189
|
+
}, POLLING_INTERVAL);
|
|
190
|
+
watch([() => activeCollection.value?.documentUrl, () => activeCollection.value?.watchMode], ([documentUrl, watchMode]) => {
|
|
191
|
+
if (documentUrl && watchMode) {
|
|
192
|
+
console.info(`[useOpenApiWatcher] Watching ${documentUrl} …`);
|
|
193
|
+
resume();
|
|
194
|
+
} else if (activeCollection.value) {
|
|
195
|
+
pause();
|
|
196
|
+
collectionMutators.edit(activeCollection.value.uid, "watchModeStatus", "IDLE");
|
|
197
|
+
}
|
|
198
|
+
}, { immediate: true });
|
|
199
|
+
};
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/components/EnvironmentSelector/EnvironmentSelector.vue?vue&type=script&setup=true&lang.ts
|
|
202
|
+
var _hoisted_1$4 = { class: "m-0 flex items-center gap-1.5 font-medium whitespace-nowrap" };
|
|
203
|
+
var _hoisted_2$4 = { class: "flex h-4 w-4 items-center justify-center" };
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/components/EnvironmentSelector/EnvironmentSelector.vue
|
|
206
|
+
var EnvironmentSelector_default = /* @__PURE__ */ defineComponent({
|
|
207
|
+
__name: "EnvironmentSelector",
|
|
208
|
+
setup(__props) {
|
|
209
|
+
const { activeCollection, activeWorkspace, activeEnvironment } = useActiveEntities();
|
|
210
|
+
const { collectionMutators } = useWorkspace();
|
|
211
|
+
const { layout } = useLayout();
|
|
212
|
+
const router = useRouter();
|
|
213
|
+
const updateSelected = (uid) => {
|
|
214
|
+
if (activeCollection.value && activeWorkspace.value) {
|
|
215
|
+
collectionMutators.edit(activeCollection.value.uid, "x-scalar-active-environment", uid);
|
|
216
|
+
activeWorkspace.value.activeEnvironmentId = uid;
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
const redirectToEnvironments = () => router.push({
|
|
220
|
+
name: "environment.default",
|
|
221
|
+
params: { [PathId.Workspace]: activeWorkspace.value?.uid }
|
|
222
|
+
});
|
|
223
|
+
const selectedEnvironment = computed(() => {
|
|
224
|
+
const { value: environment } = activeEnvironment;
|
|
225
|
+
const { value: collection } = activeCollection;
|
|
226
|
+
return environment?.name || collection?.["x-scalar-active-environment"] || "No Environment";
|
|
227
|
+
});
|
|
228
|
+
const availableEnvironments = computed(() => {
|
|
229
|
+
const { value: collection } = activeCollection;
|
|
230
|
+
const environments = collection?.["x-scalar-environments"];
|
|
231
|
+
return environments ? Object.entries(environments).map(([key, env]) => ({
|
|
232
|
+
...env,
|
|
233
|
+
uid: key,
|
|
234
|
+
name: key
|
|
235
|
+
})) : [];
|
|
236
|
+
});
|
|
237
|
+
const selectLatestEnvironment = () => {
|
|
238
|
+
const environments = availableEnvironments.value;
|
|
239
|
+
if (environments.length > 0) {
|
|
240
|
+
const latestEnvironment = environments[environments.length - 1];
|
|
241
|
+
if (latestEnvironment?.uid) updateSelected(latestEnvironment.uid);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
watch(availableEnvironments, (newEnvs, oldEnvs) => {
|
|
245
|
+
if (newEnvs.length > oldEnvs.length) selectLatestEnvironment();
|
|
246
|
+
});
|
|
247
|
+
const setInitialEnvironment = (collection) => {
|
|
248
|
+
const activeEnv = collection["x-scalar-active-environment"];
|
|
249
|
+
if (activeEnv && activeCollection.value && activeWorkspace.value) {
|
|
250
|
+
activeCollection.value["x-scalar-active-environment"] = activeEnv;
|
|
251
|
+
activeWorkspace.value.activeEnvironmentId = activeEnv;
|
|
252
|
+
} else if (activeWorkspace.value) activeWorkspace.value.activeEnvironmentId = "";
|
|
253
|
+
};
|
|
254
|
+
watch(activeCollection, (newCollection) => newCollection && setInitialEnvironment(newCollection));
|
|
255
|
+
onMounted(() => {
|
|
256
|
+
activeCollection.value && setInitialEnvironment(activeCollection.value);
|
|
257
|
+
});
|
|
258
|
+
return (_ctx, _cache) => {
|
|
259
|
+
return openBlock(), createBlock(unref(ScalarDropdown), { teleport: "" }, {
|
|
260
|
+
items: withCtx(() => [
|
|
261
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(availableEnvironments.value, (environment) => {
|
|
262
|
+
return openBlock(), createBlock(unref(ScalarDropdownItem), {
|
|
263
|
+
key: environment.uid,
|
|
264
|
+
class: "group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
265
|
+
onClick: withModifiers(($event) => updateSelected(environment.uid), ["stop"])
|
|
266
|
+
}, {
|
|
267
|
+
default: withCtx(() => [createVNode(unref(ScalarListboxCheckbox), { selected: unref(activeCollection)?.["x-scalar-active-environment"] === environment.uid }, null, 8, ["selected"]), createTextVNode(" " + toDisplayString(environment.name), 1)]),
|
|
268
|
+
_: 2
|
|
269
|
+
}, 1032, ["onClick"]);
|
|
270
|
+
}), 128)),
|
|
271
|
+
createVNode(unref(ScalarDropdownItem), {
|
|
272
|
+
class: "group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
273
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => updateSelected(""), ["stop"]))
|
|
274
|
+
}, {
|
|
275
|
+
default: withCtx(() => [createVNode(unref(ScalarListboxCheckbox), { selected: unref(activeEnvironment)?.uid === "" && unref(activeCollection)?.["x-scalar-active-environment"] === "" || unref(activeEnvironment)?.name === "No Environment" }, null, 8, ["selected"]), _cache[1] || (_cache[1] = createTextVNode(" No Environment ", -1))]),
|
|
276
|
+
_: 1
|
|
277
|
+
}),
|
|
278
|
+
createVNode(unref(ScalarDropdownDivider)),
|
|
279
|
+
unref(layout) !== "modal" ? (openBlock(), createBlock(unref(ScalarDropdownItem), {
|
|
280
|
+
key: 0,
|
|
281
|
+
class: "flex items-center gap-1.5",
|
|
282
|
+
onClick: redirectToEnvironments
|
|
283
|
+
}, {
|
|
284
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_2$4, [createVNode(unref(ScalarIcon), {
|
|
285
|
+
icon: "Brackets",
|
|
286
|
+
size: "sm"
|
|
287
|
+
})]), _cache[2] || (_cache[2] = createElementVNode("span", { class: "leading-none" }, "Manage Environments", -1))]),
|
|
288
|
+
_: 1
|
|
289
|
+
})) : createCommentVNode("", true)
|
|
290
|
+
]),
|
|
291
|
+
default: withCtx(() => [createVNode(unref(ScalarButton), {
|
|
292
|
+
class: "text-c-1 hover:bg-b-2 line-clamp-1 h-auto w-fit justify-start px-1.5 py-1.5 font-normal",
|
|
293
|
+
variant: "ghost"
|
|
294
|
+
}, {
|
|
295
|
+
default: withCtx(() => [createElementVNode("h2", _hoisted_1$4, toDisplayString(selectedEnvironment.value), 1)]),
|
|
296
|
+
_: 1
|
|
297
|
+
})]),
|
|
298
|
+
_: 1
|
|
299
|
+
});
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/components/Search/useSearch.ts
|
|
305
|
+
/**
|
|
306
|
+
* Hook for managing search functionality.
|
|
307
|
+
* Provides search state, results, and methods for searching.
|
|
308
|
+
*/
|
|
309
|
+
function useSearch() {
|
|
310
|
+
const router = useRouter();
|
|
311
|
+
const { activeWorkspace, activeWorkspaceRequests, activeWorkspaceCollections } = useActiveEntities();
|
|
312
|
+
const { requests, tags } = useWorkspace();
|
|
313
|
+
const fuseDataArray = ref([]);
|
|
314
|
+
const searchResults = ref([]);
|
|
315
|
+
const selectedSearchResult = ref(0);
|
|
316
|
+
const searchText = ref("");
|
|
317
|
+
const searchInputRef = ref(null);
|
|
318
|
+
const searchResultRefs = ref([]);
|
|
319
|
+
const fuse = new Fuse(fuseDataArray.value, { keys: [
|
|
320
|
+
"title",
|
|
321
|
+
"description",
|
|
322
|
+
"body"
|
|
323
|
+
] });
|
|
324
|
+
const resetSearch = () => {
|
|
325
|
+
searchText.value = "";
|
|
326
|
+
selectedSearchResult.value = 0;
|
|
327
|
+
searchResults.value = [];
|
|
328
|
+
if (searchInputRef.value instanceof HTMLInputElement) searchInputRef.value.blur();
|
|
329
|
+
};
|
|
330
|
+
const populateFuseDataArray = (items) => {
|
|
331
|
+
fuseDataArray.value = items.filter((request) => !shouldIgnoreEntity(request)).filter((request) => {
|
|
332
|
+
const collection = activeWorkspaceCollections.value?.find((activeWorkspaceCollection) => activeWorkspaceCollection.requests.includes(request.uid));
|
|
333
|
+
return !Boolean(collection?.tags.map((uid) => tags[uid]).filter(isDefined).filter((tag) => request.tags?.includes(tag.name)).filter((tag) => shouldIgnoreEntity(tag)).length);
|
|
334
|
+
}).map((request) => ({
|
|
335
|
+
id: request.uid,
|
|
336
|
+
title: request.summary ?? request.method,
|
|
337
|
+
description: request.description ?? "",
|
|
338
|
+
httpVerb: request.method,
|
|
339
|
+
path: request.path,
|
|
340
|
+
link: router?.resolve({
|
|
341
|
+
name: "request",
|
|
342
|
+
params: {
|
|
343
|
+
[PathId.Request]: request.uid,
|
|
344
|
+
[PathId.Workspace]: activeWorkspace.value?.uid
|
|
345
|
+
}
|
|
346
|
+
})?.href
|
|
347
|
+
}));
|
|
348
|
+
fuse.setCollection(fuseDataArray.value);
|
|
349
|
+
};
|
|
350
|
+
const fuseSearch = () => {
|
|
351
|
+
selectedSearchResult.value = 0;
|
|
352
|
+
searchResults.value = fuse.search(searchText.value);
|
|
353
|
+
};
|
|
354
|
+
watch(searchText, (newValue) => {
|
|
355
|
+
if (newValue.length) fuseSearch();
|
|
356
|
+
else searchResults.value = [];
|
|
357
|
+
});
|
|
358
|
+
const navigateSearchResults = (direction) => {
|
|
359
|
+
const offset = direction === "up" ? -1 : 1;
|
|
360
|
+
const length = searchResultsWithPlaceholderResults.value.length;
|
|
361
|
+
selectedSearchResult.value = (selectedSearchResult.value + offset + length) % length;
|
|
362
|
+
nextTick(() => {
|
|
363
|
+
const element = searchResultRefs.value[selectedSearchResult.value];
|
|
364
|
+
if (element instanceof HTMLElement) element.scrollIntoView({
|
|
365
|
+
behavior: "smooth",
|
|
366
|
+
block: "center"
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
const selectSearchResult = () => {
|
|
371
|
+
if (selectedSearchResult.value >= 0) {
|
|
372
|
+
const selectedResult = searchResultsWithPlaceholderResults.value[selectedSearchResult.value];
|
|
373
|
+
if (selectedResult) onSearchResultClick(selectedResult);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
const validRequests = computed(() => activeWorkspaceRequests.value.map((uid) => requests[uid]).filter(isDefined));
|
|
377
|
+
watch(activeWorkspaceRequests, () => {
|
|
378
|
+
populateFuseDataArray(validRequests.value);
|
|
379
|
+
}, { immediate: true });
|
|
380
|
+
const onSearchResultClick = (entry) => {
|
|
381
|
+
router.push(entry.item.id);
|
|
382
|
+
resetSearch();
|
|
383
|
+
};
|
|
384
|
+
const searchResultsWithPlaceholderResults = computed(() => {
|
|
385
|
+
if (searchText.value.length === 0) return fuseDataArray.value.map((item) => {
|
|
386
|
+
return { item };
|
|
387
|
+
});
|
|
388
|
+
return searchResults.value;
|
|
389
|
+
});
|
|
390
|
+
return {
|
|
391
|
+
searchText,
|
|
392
|
+
searchResultsWithPlaceholderResults,
|
|
393
|
+
selectedSearchResult,
|
|
394
|
+
onSearchResultClick,
|
|
395
|
+
fuseSearch,
|
|
396
|
+
searchInputRef,
|
|
397
|
+
searchResultRefs,
|
|
398
|
+
navigateSearchResults,
|
|
399
|
+
selectSearchResult,
|
|
400
|
+
populateFuseDataArray
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/views/Request/handle-drag.ts
|
|
405
|
+
/** Create DnD handlers */
|
|
406
|
+
function dragHandlerFactory(activeWorkspace, { collections, collectionMutators, tags, tagMutators, workspaceMutators }) {
|
|
407
|
+
const { layout } = useLayout();
|
|
408
|
+
/** Mutate tag OR collection */
|
|
409
|
+
const mutateTagOrCollection = (parent, childUids) => {
|
|
410
|
+
if (parent.type === "collection") collectionMutators.edit(parent.uid, "children", childUids);
|
|
411
|
+
else if (parent.type === "tag") tagMutators.edit(parent.uid, "children", childUids);
|
|
412
|
+
};
|
|
413
|
+
/** Drag handler that mutates depending on the entity types */
|
|
414
|
+
const handleDragEnd = (draggingItem, hoveredItem) => {
|
|
415
|
+
if (!draggingItem || !hoveredItem) return;
|
|
416
|
+
const { id: draggingUid, parentId: draggingParentUid } = draggingItem;
|
|
417
|
+
const { id: hoveredUid, parentId: hoveredParentUid, offset } = hoveredItem;
|
|
418
|
+
if (!draggingParentUid) workspaceMutators.edit(activeWorkspace.value?.uid, "collections", activeWorkspace.value?.collections.filter((uid) => uid !== draggingUid) ?? []);
|
|
419
|
+
else if (collections[draggingParentUid]) collectionMutators.edit(draggingParentUid, "children", collections[draggingParentUid].children.filter((uid) => uid !== draggingUid));
|
|
420
|
+
else if (tags[draggingParentUid]) tagMutators.edit(draggingParentUid, "children", tags[draggingParentUid].children.filter((uid) => uid !== draggingUid));
|
|
421
|
+
if (offset === 2) {
|
|
422
|
+
const parent = collections[hoveredUid] || tags[hoveredUid];
|
|
423
|
+
if (parent) mutateTagOrCollection(parent, [...parent.children ?? [], draggingUid]);
|
|
424
|
+
} else if (!hoveredParentUid) {
|
|
425
|
+
const newChildUids = [...activeWorkspace.value?.collections ?? []];
|
|
426
|
+
const hoveredIndex = newChildUids.findIndex((uid) => hoveredUid === uid) ?? 0;
|
|
427
|
+
newChildUids.splice(hoveredIndex + offset, 0, draggingUid);
|
|
428
|
+
workspaceMutators.edit(activeWorkspace.value?.uid, "collections", newChildUids);
|
|
429
|
+
} else {
|
|
430
|
+
const parent = collections[hoveredParentUid] || tags[hoveredParentUid];
|
|
431
|
+
if (!parent) return;
|
|
432
|
+
const newChildUids = [...parent.children ?? []];
|
|
433
|
+
const hoveredIndex = newChildUids.findIndex((uid) => hoveredUid === uid) ?? 0;
|
|
434
|
+
newChildUids.splice(hoveredIndex + offset, 0, draggingUid);
|
|
435
|
+
mutateTagOrCollection(parent, newChildUids);
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
/** Ensure only collections are allowed at the top level OR resources dropped INTO (offset 2) */
|
|
439
|
+
const isDroppable = (draggingItem, hoveredItem) => {
|
|
440
|
+
if (layout === "modal") return false;
|
|
441
|
+
if (!collections[draggingItem.id] && hoveredItem.offset !== 2) return false;
|
|
442
|
+
if (collections[draggingItem.id] && collections[hoveredItem.id]?.info?.title === "Drafts") return false;
|
|
443
|
+
return true;
|
|
444
|
+
};
|
|
445
|
+
return {
|
|
446
|
+
handleDragEnd,
|
|
447
|
+
isDroppable
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region src/components/Sidebar/Actions/EditSidebarListCollection.vue?vue&type=script&setup=true&lang.ts
|
|
452
|
+
var _hoisted_1$3 = { class: "grid grid-cols-[auto_1fr] gap-2" };
|
|
453
|
+
var _hoisted_2$3 = { class: "flex aspect-square" };
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/components/Sidebar/Actions/EditSidebarListCollection.vue
|
|
456
|
+
var EditSidebarListCollection_default = /* @__PURE__ */ defineComponent({
|
|
457
|
+
__name: "EditSidebarListCollection",
|
|
458
|
+
props: {
|
|
459
|
+
name: {},
|
|
460
|
+
icon: {}
|
|
461
|
+
},
|
|
462
|
+
emits: ["close", "edit"],
|
|
463
|
+
setup(__props, { emit: __emit }) {
|
|
464
|
+
const props = __props;
|
|
465
|
+
const emit = __emit;
|
|
466
|
+
const newName = ref(props.name);
|
|
467
|
+
const newIcon = ref(props.icon);
|
|
468
|
+
return (_ctx, _cache) => {
|
|
469
|
+
return openBlock(), createBlock(SidebarListElementForm_default, {
|
|
470
|
+
onCancel: _cache[2] || (_cache[2] = ($event) => emit("close")),
|
|
471
|
+
onSubmit: _cache[3] || (_cache[3] = ($event) => emit("edit", newName.value, newIcon.value))
|
|
472
|
+
}, {
|
|
473
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$3, [createElementVNode("div", _hoisted_2$3, [createVNode(IconSelector_default, {
|
|
474
|
+
modelValue: newIcon.value,
|
|
475
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => newIcon.value = $event),
|
|
476
|
+
placement: "bottom-start"
|
|
477
|
+
}, {
|
|
478
|
+
default: withCtx(() => [createVNode(unref(ScalarButton), {
|
|
479
|
+
class: "aspect-square h-auto px-0",
|
|
480
|
+
variant: "outlined"
|
|
481
|
+
}, {
|
|
482
|
+
default: withCtx(() => [createVNode(unref(LibraryIcon), {
|
|
483
|
+
class: "text-c-2 size-4",
|
|
484
|
+
src: newIcon.value
|
|
485
|
+
}, null, 8, ["src"])]),
|
|
486
|
+
_: 1
|
|
487
|
+
})]),
|
|
488
|
+
_: 1
|
|
489
|
+
}, 8, ["modelValue"])]), createVNode(unref(ScalarTextInput), {
|
|
490
|
+
modelValue: newName.value,
|
|
491
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => newName.value = $event),
|
|
492
|
+
autofocus: "",
|
|
493
|
+
class: "flex-1"
|
|
494
|
+
}, null, 8, ["modelValue"])])]),
|
|
495
|
+
_: 1
|
|
496
|
+
});
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region src/views/Request/RequestSidebarItemMenu.vue
|
|
502
|
+
var RequestSidebarItemMenu_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
503
|
+
__name: "RequestSidebarItemMenu",
|
|
504
|
+
props: { menuItem: {} },
|
|
505
|
+
emits: [
|
|
506
|
+
"closeMenu",
|
|
507
|
+
"toggleWatchMode",
|
|
508
|
+
"clearDrafts"
|
|
509
|
+
],
|
|
510
|
+
setup(__props, { emit: __emit }) {
|
|
511
|
+
const props = __props;
|
|
512
|
+
const emit = __emit;
|
|
513
|
+
const { replace } = useRouter();
|
|
514
|
+
const { activeRouterParams, activeWorkspaceCollections, activeWorkspaceRequests } = useActiveEntities();
|
|
515
|
+
const { events, requestMutators } = useWorkspace();
|
|
516
|
+
const editModal = useModal();
|
|
517
|
+
const deleteModal = useModal();
|
|
518
|
+
const clearDraftsModal = useModal();
|
|
519
|
+
/** Add example */
|
|
520
|
+
const handleAddExample = () => events.commandPalette.emit({
|
|
521
|
+
commandName: "Add Example",
|
|
522
|
+
metaData: { itemUid: props.menuItem.item?.entity.uid }
|
|
523
|
+
});
|
|
524
|
+
const handleEdit = (newName, newIcon) => {
|
|
525
|
+
props.menuItem.item?.edit(newName, newIcon);
|
|
526
|
+
editModal.hide();
|
|
527
|
+
};
|
|
528
|
+
/** Delete with redirect for both requests and requestExamples */
|
|
529
|
+
const handleItemDelete = () => {
|
|
530
|
+
props.menuItem.item?.delete();
|
|
531
|
+
if (!activeWorkspaceRequests.value.length) {
|
|
532
|
+
const { request } = createInitialRequest();
|
|
533
|
+
const draftCollection = activeWorkspaceCollections.value.find((collection) => collection.info?.title === "Drafts");
|
|
534
|
+
if (draftCollection) {
|
|
535
|
+
requestMutators.add(request, draftCollection.uid);
|
|
536
|
+
replace({
|
|
537
|
+
name: "request",
|
|
538
|
+
params: { [PathId.Request]: request.uid }
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
if (activeRouterParams.value[PathId.Request] === props.menuItem.item?.entity.uid) replace({
|
|
543
|
+
name: "request",
|
|
544
|
+
params: { [PathId.Request]: "default" }
|
|
545
|
+
});
|
|
546
|
+
if (activeRouterParams.value[PathId.Examples] === props.menuItem.item?.entity.uid) replace({
|
|
547
|
+
name: "request",
|
|
548
|
+
params: { [PathId.Request]: "default" }
|
|
549
|
+
});
|
|
550
|
+
if (activeWorkspaceCollections.value[0]) {
|
|
551
|
+
const firstRequest = activeWorkspaceCollections.value[0].requests[0];
|
|
552
|
+
replace({
|
|
553
|
+
name: "request",
|
|
554
|
+
params: { [PathId.Request]: firstRequest }
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
deleteModal.hide();
|
|
558
|
+
};
|
|
559
|
+
const menuRef = ref(null);
|
|
560
|
+
watch([() => props.menuItem.open, menuRef], ([open]) => {
|
|
561
|
+
if (open && menuRef.value?.$parent?.$el) menuRef.value.$parent.$el.focus();
|
|
562
|
+
});
|
|
563
|
+
const globalClickListener = () => props.menuItem.open && emit("closeMenu");
|
|
564
|
+
onMounted(() => window.addEventListener("click", globalClickListener));
|
|
565
|
+
onBeforeUnmount(() => window.removeEventListener("click", globalClickListener));
|
|
566
|
+
const toggleWatchMode = () => {
|
|
567
|
+
emit("toggleWatchMode", props.menuItem.item);
|
|
568
|
+
};
|
|
569
|
+
const handleClearDrafts = () => {
|
|
570
|
+
emit("clearDrafts");
|
|
571
|
+
clearDraftsModal.hide();
|
|
572
|
+
};
|
|
573
|
+
const isDraftsMenuItem = computed(() => {
|
|
574
|
+
return props.menuItem.item?.title === "Drafts";
|
|
575
|
+
});
|
|
576
|
+
return (_ctx, _cache) => {
|
|
577
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
578
|
+
__props.menuItem.targetRef && __props.menuItem.open ? (openBlock(), createBlock(unref(ScalarFloating), {
|
|
579
|
+
key: 0,
|
|
580
|
+
placement: "right-start",
|
|
581
|
+
target: __props.menuItem.targetRef,
|
|
582
|
+
teleport: ""
|
|
583
|
+
}, {
|
|
584
|
+
floating: withCtx(() => [createVNode(unref(ScalarDropdownMenu), { onKeydown: _cache[3] || (_cache[3] = withKeys(($event) => _ctx.$emit("closeMenu"), ["escape"])) }, {
|
|
585
|
+
default: withCtx(() => [
|
|
586
|
+
__props.menuItem.item?.entity.type === "request" ? (openBlock(), createBlock(unref(ScalarDropdownButton), {
|
|
587
|
+
key: 0,
|
|
588
|
+
class: "flex items-center gap-2",
|
|
589
|
+
onClick: handleAddExample
|
|
590
|
+
}, {
|
|
591
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
592
|
+
class: "inline-flex",
|
|
593
|
+
icon: "Example",
|
|
594
|
+
size: "md",
|
|
595
|
+
thickness: "1.5"
|
|
596
|
+
}), _cache[8] || (_cache[8] = createElementVNode("span", null, "Add Example", -1))]),
|
|
597
|
+
_: 1
|
|
598
|
+
})) : createCommentVNode("", true),
|
|
599
|
+
!isDraftsMenuItem.value ? (openBlock(), createBlock(unref(ScalarDropdownButton), {
|
|
600
|
+
key: 1,
|
|
601
|
+
ref_key: "menuRef",
|
|
602
|
+
ref: menuRef,
|
|
603
|
+
class: "flex items-center gap-2",
|
|
604
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(editModal).show())
|
|
605
|
+
}, {
|
|
606
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
607
|
+
class: "inline-flex",
|
|
608
|
+
icon: "Edit",
|
|
609
|
+
size: "md",
|
|
610
|
+
thickness: "1.5"
|
|
611
|
+
}), createElementVNode("span", null, [__props.menuItem.item?.entity.type === "collection" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" Edit ")], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(" Rename ")], 64))])]),
|
|
612
|
+
_: 1
|
|
613
|
+
}, 512)) : createCommentVNode("", true),
|
|
614
|
+
__props.menuItem.item?.documentUrl ? (openBlock(), createBlock(unref(ScalarDropdownButton), {
|
|
615
|
+
key: 2,
|
|
616
|
+
ref_key: "menuRef",
|
|
617
|
+
ref: menuRef,
|
|
618
|
+
class: "flex items-center gap-2",
|
|
619
|
+
onClick: toggleWatchMode
|
|
620
|
+
}, {
|
|
621
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
622
|
+
class: "inline-flex",
|
|
623
|
+
icon: __props.menuItem.item?.watchMode ? "Unwatch" : "Watch",
|
|
624
|
+
size: "md",
|
|
625
|
+
thickness: "1.5"
|
|
626
|
+
}, null, 8, ["icon"]), createElementVNode("span", null, toDisplayString(__props.menuItem.item?.watchMode ? "Disable Watch Mode" : "Enable Watch Mode"), 1)]),
|
|
627
|
+
_: 1
|
|
628
|
+
}, 512)) : createCommentVNode("", true),
|
|
629
|
+
!isDraftsMenuItem.value ? (openBlock(), createBlock(unref(ScalarDropdownButton), {
|
|
630
|
+
key: 3,
|
|
631
|
+
class: "flex items-center gap-2",
|
|
632
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(deleteModal).show())
|
|
633
|
+
}, {
|
|
634
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
635
|
+
class: "inline-flex",
|
|
636
|
+
icon: "Delete",
|
|
637
|
+
size: "md",
|
|
638
|
+
thickness: "1.5"
|
|
639
|
+
}), _cache[9] || (_cache[9] = createElementVNode("span", null, "Delete", -1))]),
|
|
640
|
+
_: 1
|
|
641
|
+
})) : createCommentVNode("", true),
|
|
642
|
+
isDraftsMenuItem.value ? (openBlock(), createBlock(unref(ScalarDropdownButton), {
|
|
643
|
+
key: 4,
|
|
644
|
+
class: "flex items-center gap-2",
|
|
645
|
+
onClick: _cache[2] || (_cache[2] = ($event) => unref(clearDraftsModal).show())
|
|
646
|
+
}, {
|
|
647
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
648
|
+
class: "inline-flex",
|
|
649
|
+
icon: "Delete",
|
|
650
|
+
size: "md",
|
|
651
|
+
thickness: "1.5"
|
|
652
|
+
}), _cache[10] || (_cache[10] = createElementVNode("span", null, "Clear Drafts", -1))]),
|
|
653
|
+
_: 1
|
|
654
|
+
})) : createCommentVNode("", true)
|
|
655
|
+
]),
|
|
656
|
+
_: 1
|
|
657
|
+
})]),
|
|
658
|
+
_: 1
|
|
659
|
+
}, 8, ["target"])) : createCommentVNode("", true),
|
|
660
|
+
createVNode(unref(ScalarModal), {
|
|
661
|
+
size: "xxs",
|
|
662
|
+
state: unref(deleteModal),
|
|
663
|
+
title: `Delete ${__props.menuItem.item?.resourceTitle}`
|
|
664
|
+
}, {
|
|
665
|
+
default: withCtx(() => [createVNode(DeleteSidebarListElement_default, {
|
|
666
|
+
variableName: __props.menuItem.item?.title ?? "",
|
|
667
|
+
warningMessage: __props.menuItem.item?.warning,
|
|
668
|
+
onClose: _cache[4] || (_cache[4] = ($event) => unref(deleteModal).hide()),
|
|
669
|
+
onDelete: handleItemDelete
|
|
670
|
+
}, null, 8, ["variableName", "warningMessage"])]),
|
|
671
|
+
_: 1
|
|
672
|
+
}, 8, ["state", "title"]),
|
|
673
|
+
createVNode(unref(ScalarModal), {
|
|
674
|
+
size: "xxs",
|
|
675
|
+
state: unref(editModal),
|
|
676
|
+
title: `Edit ${__props.menuItem.item?.resourceTitle}`
|
|
677
|
+
}, {
|
|
678
|
+
default: withCtx(() => [__props.menuItem.item?.resourceTitle === "Collection" ? (openBlock(), createBlock(EditSidebarListCollection_default, {
|
|
679
|
+
key: 0,
|
|
680
|
+
icon: __props.menuItem.item?.icon || "interface-content-folder",
|
|
681
|
+
name: __props.menuItem.item?.title,
|
|
682
|
+
onClose: _cache[5] || (_cache[5] = ($event) => unref(editModal).hide()),
|
|
683
|
+
onEdit: handleEdit
|
|
684
|
+
}, null, 8, ["icon", "name"])) : (openBlock(), createBlock(EditSidebarListElement_default, {
|
|
685
|
+
key: 1,
|
|
686
|
+
name: __props.menuItem.item?.title ?? "",
|
|
687
|
+
onClose: _cache[6] || (_cache[6] = ($event) => unref(editModal).hide()),
|
|
688
|
+
onEdit: handleEdit
|
|
689
|
+
}, null, 8, ["name"]))]),
|
|
690
|
+
_: 1
|
|
691
|
+
}, 8, ["state", "title"]),
|
|
692
|
+
createVNode(unref(ScalarModal), {
|
|
693
|
+
size: "xxs",
|
|
694
|
+
state: unref(clearDraftsModal),
|
|
695
|
+
title: "Clear Drafts"
|
|
696
|
+
}, {
|
|
697
|
+
default: withCtx(() => [createVNode(DeleteSidebarListElement_default, {
|
|
698
|
+
variableName: "All Drafts",
|
|
699
|
+
warningMessage: "This action will clear all drafts. This cannot be undone.",
|
|
700
|
+
onClose: _cache[7] || (_cache[7] = ($event) => unref(clearDraftsModal).hide()),
|
|
701
|
+
onDelete: handleClearDrafts
|
|
702
|
+
})]),
|
|
703
|
+
_: 1
|
|
704
|
+
}, 8, ["state"])
|
|
705
|
+
], 64);
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
}), [["__scopeId", "data-v-01a1ab71"]]);
|
|
709
|
+
//#endregion
|
|
710
|
+
//#region src/views/Request/RequestSection/helpers/getting-started.ts
|
|
711
|
+
/**
|
|
712
|
+
* Checks if the user gets the getting started state displayed
|
|
713
|
+
*/
|
|
714
|
+
var isGettingStarted = (activeWorkspaceCollections, activeWorkspaceRequests, requests) => {
|
|
715
|
+
const draftCollection = activeWorkspaceCollections.find((collection) => collection.info?.title === "Drafts");
|
|
716
|
+
const hasSingleRequest = activeWorkspaceRequests.length === 1;
|
|
717
|
+
if (!activeWorkspaceRequests[0]) return false;
|
|
718
|
+
const isDraftsRequest = draftCollection?.requests.includes(activeWorkspaceRequests[0]);
|
|
719
|
+
if (!isDraftsRequest) return false;
|
|
720
|
+
const isRenamed = requests[draftCollection?.requests[0] ?? ""]?.summary !== "My First Request";
|
|
721
|
+
return hasSingleRequest && isDraftsRequest && !isRenamed;
|
|
722
|
+
};
|
|
723
|
+
//#endregion
|
|
724
|
+
//#region src/views/Request/RequestSidebarItem.vue?vue&type=script&setup=true&lang.ts
|
|
725
|
+
var _hoisted_1$2 = { class: "line-clamp-1 w-full pl-2 break-all" };
|
|
726
|
+
var _hoisted_2$2 = { class: "flex flex-row items-center gap-1" };
|
|
727
|
+
var _hoisted_3$1 = { class: "relative" };
|
|
728
|
+
var _hoisted_4$1 = { class: "flex items-start" };
|
|
729
|
+
var _hoisted_5$1 = { class: "flex h-5 max-w-[14px] shrink-0 items-center justify-center" };
|
|
730
|
+
var _hoisted_6$1 = { class: "flex flex-1 flex-row justify-between font-medium" };
|
|
731
|
+
var _hoisted_7$1 = { class: "line-clamp-1 w-full text-left break-all" };
|
|
732
|
+
var _hoisted_8$1 = { class: "relative flex h-fit items-center justify-end gap-0.5" };
|
|
733
|
+
var _hoisted_9 = {
|
|
734
|
+
class: "flex items-center justify-center",
|
|
735
|
+
type: "button"
|
|
736
|
+
};
|
|
737
|
+
var _hoisted_10 = ["aria-expanded"];
|
|
738
|
+
var _hoisted_11 = { class: "flex h-5 max-w-[14px] shrink-0 items-center justify-center" };
|
|
739
|
+
var _hoisted_12 = { class: "flex flex-1 flex-row justify-between" };
|
|
740
|
+
var _hoisted_13 = { class: "line-clamp-1 w-full text-left font-medium break-all" };
|
|
741
|
+
var _hoisted_14 = { class: "relative flex h-fit items-center justify-end gap-0.5" };
|
|
742
|
+
var _hoisted_15 = {
|
|
743
|
+
class: "flex items-center justify-center",
|
|
744
|
+
type: "button"
|
|
745
|
+
};
|
|
746
|
+
var _hoisted_16 = { key: 3 };
|
|
747
|
+
var highlightClasses = "hover:bg-sidebar-b-active indent-padding-left";
|
|
748
|
+
//#endregion
|
|
749
|
+
//#region src/views/Request/RequestSidebarItem.vue
|
|
750
|
+
var RequestSidebarItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
751
|
+
__name: "RequestSidebarItem",
|
|
752
|
+
props: {
|
|
753
|
+
isDraggable: {
|
|
754
|
+
type: Boolean,
|
|
755
|
+
default: false
|
|
756
|
+
},
|
|
757
|
+
isDroppable: {
|
|
758
|
+
type: [Boolean, Function],
|
|
759
|
+
default: false
|
|
760
|
+
},
|
|
761
|
+
parentUids: {},
|
|
762
|
+
uid: {},
|
|
763
|
+
menuItem: {}
|
|
764
|
+
},
|
|
765
|
+
emits: [
|
|
766
|
+
"onDragEnd",
|
|
767
|
+
"newTab",
|
|
768
|
+
"openMenu"
|
|
769
|
+
],
|
|
770
|
+
setup(__props, { emit: __emit }) {
|
|
771
|
+
useCssVars((_ctx) => ({
|
|
772
|
+
"v2bb71a6d": leftOffset.value,
|
|
773
|
+
"b961af9e": paddingOffset.value
|
|
774
|
+
}));
|
|
775
|
+
const emit = __emit;
|
|
776
|
+
const { activeCollection, activeRequest, activeRouterParams, activeWorkspace } = useActiveEntities();
|
|
777
|
+
const { collections, tags, requests, requestExamples, collectionMutators, tagMutators, requestMutators, requestExampleMutators, events } = useWorkspace();
|
|
778
|
+
const router = useRouter();
|
|
779
|
+
const { collapsedSidebarFolders, toggleSidebarFolder } = useSidebar();
|
|
780
|
+
const { layout } = useLayout();
|
|
781
|
+
/** Normalize properties across different types for easy consumption */
|
|
782
|
+
const item = computed(() => {
|
|
783
|
+
const collection = collections[__props.uid];
|
|
784
|
+
const tag = tags[__props.uid];
|
|
785
|
+
const request = requests[__props.uid];
|
|
786
|
+
const requestExample = requestExamples[__props.uid];
|
|
787
|
+
if (collection) return {
|
|
788
|
+
title: collection.info?.title || "Untitled Collection",
|
|
789
|
+
entity: collection,
|
|
790
|
+
resourceTitle: "Collection",
|
|
791
|
+
children: collection.children,
|
|
792
|
+
icon: collection["x-scalar-icon"],
|
|
793
|
+
documentUrl: collection.documentUrl,
|
|
794
|
+
watchMode: collection.watchMode,
|
|
795
|
+
to: collection.uid && collection?.info?.title !== "Drafts" ? {
|
|
796
|
+
name: "collection",
|
|
797
|
+
params: {
|
|
798
|
+
[PathId.Workspace]: activeWorkspace.value?.uid,
|
|
799
|
+
[PathId.Collection]: collection.uid
|
|
800
|
+
}
|
|
801
|
+
} : void 0,
|
|
802
|
+
warning: "This cannot be undone. You're about to delete the collection and all folders and requests inside it.",
|
|
803
|
+
edit: (name, icon) => {
|
|
804
|
+
collectionMutators.edit(collection.uid, "info.title", name);
|
|
805
|
+
if (icon) collectionMutators.edit(collection.uid, "x-scalar-icon", icon);
|
|
806
|
+
},
|
|
807
|
+
delete: () => {
|
|
808
|
+
if (activeWorkspace.value) collectionMutators.delete(collection, activeWorkspace.value);
|
|
809
|
+
}
|
|
810
|
+
};
|
|
811
|
+
if (tag) return {
|
|
812
|
+
title: tag.name,
|
|
813
|
+
entity: tag,
|
|
814
|
+
resourceTitle: "Tag",
|
|
815
|
+
children: tag.children,
|
|
816
|
+
warning: "This cannot be undone. You're about to delete the tag and all requests inside it",
|
|
817
|
+
edit: (name) => tagMutators.edit(tag.uid, "name", name),
|
|
818
|
+
delete: () => __props.parentUids[0] && tagMutators.delete(tag, __props.parentUids[0])
|
|
819
|
+
};
|
|
820
|
+
if (request) return {
|
|
821
|
+
title: request.summary ?? request.path,
|
|
822
|
+
to: {
|
|
823
|
+
name: "request",
|
|
824
|
+
params: {
|
|
825
|
+
workspace: activeWorkspace.value?.uid,
|
|
826
|
+
request: request.uid
|
|
827
|
+
}
|
|
828
|
+
},
|
|
829
|
+
method: request.method,
|
|
830
|
+
entity: request,
|
|
831
|
+
resourceTitle: "Request",
|
|
832
|
+
warning: "This cannot be undone. You're about to delete the request.",
|
|
833
|
+
children: request.examples.slice(1),
|
|
834
|
+
edit: (name) => requestMutators.edit(request.uid, "summary", name),
|
|
835
|
+
delete: () => __props.parentUids[0] && requestMutators.delete(request, __props.parentUids[0])
|
|
836
|
+
};
|
|
837
|
+
if (requestExample?.requestUid) return {
|
|
838
|
+
title: requestExample.name,
|
|
839
|
+
to: {
|
|
840
|
+
name: "request.examples",
|
|
841
|
+
params: {
|
|
842
|
+
workspace: activeWorkspace.value?.uid,
|
|
843
|
+
request: requestExample.requestUid,
|
|
844
|
+
examples: requestExample.uid
|
|
845
|
+
}
|
|
846
|
+
},
|
|
847
|
+
method: requests[requestExample.requestUid]?.method,
|
|
848
|
+
entity: requestExample,
|
|
849
|
+
resourceTitle: "Example",
|
|
850
|
+
warning: "This cannot be undone. You're about to delete the example from the request.",
|
|
851
|
+
children: [],
|
|
852
|
+
edit: (name) => requestExampleMutators.edit(requestExample.uid, "name", name),
|
|
853
|
+
delete: () => requestExampleMutators.delete(requestExample)
|
|
854
|
+
};
|
|
855
|
+
return {
|
|
856
|
+
title: "Unknown",
|
|
857
|
+
entity: {
|
|
858
|
+
uid: "",
|
|
859
|
+
type: "unknown"
|
|
860
|
+
},
|
|
861
|
+
resourceTitle: "Unknown",
|
|
862
|
+
children: [],
|
|
863
|
+
edit: () => null,
|
|
864
|
+
delete: () => null
|
|
865
|
+
};
|
|
866
|
+
});
|
|
867
|
+
/** Checks to see if it is a draft collection with the title of Drafts */
|
|
868
|
+
const isDraftCollection = computed(() => item.value.entity.type === "collection" && item.value.title === "Drafts");
|
|
869
|
+
const leftOffset = computed(() => {
|
|
870
|
+
if (!__props.parentUids.length) return "12px";
|
|
871
|
+
if (layout === "modal") return `${(__props.parentUids.length - 1) * 12}px`;
|
|
872
|
+
return `${__props.parentUids.length * 12}px`;
|
|
873
|
+
});
|
|
874
|
+
const paddingOffset = computed(() => {
|
|
875
|
+
if (!__props.parentUids.length) return "0px";
|
|
876
|
+
if (layout === "modal") return `${(__props.parentUids.length - 1) * 12}px`;
|
|
877
|
+
return `${__props.parentUids.length * 12}px`;
|
|
878
|
+
});
|
|
879
|
+
/**
|
|
880
|
+
* Show folders if they are open,
|
|
881
|
+
* show examples if there are more than one and the request is active
|
|
882
|
+
*/
|
|
883
|
+
const showChildren = computed(() => collapsedSidebarFolders[__props.uid] || activeRequest.value?.uid === __props.uid && item.value.entity.examples.length > 1);
|
|
884
|
+
/** Since we have exact routing, we should check if the default request is active */
|
|
885
|
+
const isDefaultActive = computed(() => typeof router.currentRoute.value.name === "string" && router.currentRoute.value.name.startsWith("request") && activeRouterParams.value[PathId.Request] === "default" && activeRequest.value?.uid === __props.uid);
|
|
886
|
+
/** The draggable component */
|
|
887
|
+
const draggableRef = ref(null);
|
|
888
|
+
/** Calculate offsets which change a little depending on whats being dragged and hovered over */
|
|
889
|
+
const getDraggableOffsets = computed(() => {
|
|
890
|
+
let ceiling = .5;
|
|
891
|
+
let floor = .5;
|
|
892
|
+
if (!draggableRef.value) return {
|
|
893
|
+
ceiling,
|
|
894
|
+
floor
|
|
895
|
+
};
|
|
896
|
+
const { draggingItem } = draggableRef.value;
|
|
897
|
+
if (!collections[draggingItem?.id] && item.value.entity.type === "collection") {
|
|
898
|
+
ceiling = 1;
|
|
899
|
+
floor = 0;
|
|
900
|
+
} else if (item.value.entity.type === "tag") {
|
|
901
|
+
ceiling = .8;
|
|
902
|
+
floor = .2;
|
|
903
|
+
}
|
|
904
|
+
return {
|
|
905
|
+
ceiling,
|
|
906
|
+
floor
|
|
907
|
+
};
|
|
908
|
+
});
|
|
909
|
+
/** Guard to check if an element is able to be dropped on */
|
|
910
|
+
const _isDroppable = (draggingItem, hoveredItem) => {
|
|
911
|
+
if (layout === "modal") return false;
|
|
912
|
+
if (requestExamples[hoveredItem.id]) return false;
|
|
913
|
+
if (collections[draggingItem.id]) return false;
|
|
914
|
+
return true;
|
|
915
|
+
};
|
|
916
|
+
const handleNavigation = (event, _item) => {
|
|
917
|
+
if (event) {
|
|
918
|
+
if (getModifiers(["default"]).some((key) => event[key])) emit("newTab", _item.title || "", _item.entity.uid);
|
|
919
|
+
else if (_item.to) router.push(_item.to);
|
|
920
|
+
nextTick(() => events.focusAddressBar.emit());
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
function addRequest(entityUid) {
|
|
924
|
+
const collectionUid = __props.parentUids[0] ? collections[__props.parentUids[0]]?.uid || "" : entityUid;
|
|
925
|
+
const requestData = __props.parentUids[0] && tags[entityUid]?.name ? { tags: [tags[entityUid].name] } : {};
|
|
926
|
+
const newRequest = requestMutators.add(requestData, collectionUid);
|
|
927
|
+
if (newRequest) {
|
|
928
|
+
router.push({
|
|
929
|
+
name: "request",
|
|
930
|
+
params: {
|
|
931
|
+
workspace: activeWorkspace.value?.uid,
|
|
932
|
+
request: newRequest.uid
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
events.hotKeys.emit({ focusAddressBar: new KeyboardEvent("keydown", { key: "l" }) });
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
const watchIconColor = computed(() => {
|
|
939
|
+
const { uid: _uid, watchModeStatus } = activeCollection.value || {};
|
|
940
|
+
if (_uid !== item.value.entity.uid) return "text-c-3";
|
|
941
|
+
if (watchModeStatus === "WATCHING") return "text-c-1";
|
|
942
|
+
if (watchModeStatus === "ERROR") return "text-red";
|
|
943
|
+
return "text-c-3";
|
|
944
|
+
});
|
|
945
|
+
const hasDraftRequests = computed(() => {
|
|
946
|
+
return item.value.title === "Drafts" && layout !== "modal" && item.value.children.length > 0;
|
|
947
|
+
});
|
|
948
|
+
/**
|
|
949
|
+
* Check if the item should be shown.
|
|
950
|
+
* This is used to hide items that are marked as hidden/internal.
|
|
951
|
+
*/
|
|
952
|
+
const shouldShowItem = computed(() => {
|
|
953
|
+
const request = requests[__props.uid];
|
|
954
|
+
if (request) return !shouldIgnoreEntity(request);
|
|
955
|
+
const tag = tags[__props.uid];
|
|
956
|
+
if (tag) return !shouldIgnoreEntity(tag);
|
|
957
|
+
return true;
|
|
958
|
+
});
|
|
959
|
+
return (_ctx, _cache) => {
|
|
960
|
+
const _component_RequestSidebarItem = resolveComponent("RequestSidebarItem", true);
|
|
961
|
+
return shouldShowItem.value ? (openBlock(), createElementBlock("li", {
|
|
962
|
+
key: 0,
|
|
963
|
+
class: normalizeClass(["relative flex flex-row", [unref(layout) === "modal" && __props.parentUids.length > 1 || unref(layout) !== "modal" && __props.parentUids.length ? "before:bg-border indent-border-line-offset mb-[.5px] before:pointer-events-none before:absolute before:top-0 before:left-[calc(.75rem_+_.5px)] before:z-1 before:h-[calc(100%_+_.5px)] before:w-[.5px] last:mb-0 last:before:h-full" : ""]])
|
|
964
|
+
}, [createVNode(unref(Draggable), {
|
|
965
|
+
id: item.value.entity.uid,
|
|
966
|
+
ref_key: "draggableRef",
|
|
967
|
+
ref: draggableRef,
|
|
968
|
+
ceiling: getDraggableOffsets.value.ceiling,
|
|
969
|
+
class: "gap-1/2 flex flex-1 flex-col text-base/5",
|
|
970
|
+
floor: getDraggableOffsets.value.floor,
|
|
971
|
+
isDraggable: __props.isDraggable,
|
|
972
|
+
isDroppable: __props.isDroppable,
|
|
973
|
+
parentIds: __props.parentUids,
|
|
974
|
+
onOnDragEnd: _cache[13] || (_cache[13] = (...args) => _ctx.$emit("onDragEnd", ...args))
|
|
975
|
+
}, {
|
|
976
|
+
default: withCtx(() => [(item.value.entity.type === "request" || item.value.entity.type === "requestExample") && item.value.to ? (openBlock(), createBlock(unref(RouterLink), {
|
|
977
|
+
key: 0,
|
|
978
|
+
class: "group no-underline",
|
|
979
|
+
to: item.value.to,
|
|
980
|
+
onClick: _cache[1] || (_cache[1] = withModifiers((event) => handleNavigation(event, item.value), ["prevent"]))
|
|
981
|
+
}, {
|
|
982
|
+
default: withCtx(({ isExactActive }) => [createElementVNode("div", { class: normalizeClass(["relative flex min-h-8 w-full cursor-pointer flex-row items-start justify-between gap-0.5 rounded py-1.5 pr-2", [highlightClasses, isExactActive || isDefaultActive.value ? "bg-sidebar-b-active text-sidebar-c-active font-medium transition-none" : "text-sidebar-c-2"]]) }, [createElementVNode("span", _hoisted_1$2, toDisplayString(item.value.title || "Untitled"), 1), createElementVNode("div", _hoisted_2$2, [createElementVNode("div", _hoisted_3$1, [unref(layout) !== "modal" ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
983
|
+
key: 0,
|
|
984
|
+
class: normalizeClass(["hover:bg-b-3 hidden aspect-square h-fit px-0.5 py-0 opacity-0 group-hover:flex group-hover:opacity-100 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100", { flex: __props.menuItem?.item?.entity.uid === item.value.entity.uid && __props.menuItem.open }]),
|
|
985
|
+
size: "sm",
|
|
986
|
+
type: "button",
|
|
987
|
+
variant: "ghost",
|
|
988
|
+
onClick: _cache[0] || (_cache[0] = withModifiers((ev) => _ctx.$emit("openMenu", {
|
|
989
|
+
item: item.value,
|
|
990
|
+
parentUids: __props.parentUids,
|
|
991
|
+
targetRef: ev.currentTarget,
|
|
992
|
+
open: !__props.menuItem.open
|
|
993
|
+
}), ["stop", "prevent"]))
|
|
994
|
+
}, {
|
|
995
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
996
|
+
icon: "Ellipses",
|
|
997
|
+
size: "md"
|
|
998
|
+
})]),
|
|
999
|
+
_: 1
|
|
1000
|
+
}, 8, ["class"])) : createCommentVNode("", true)]), createElementVNode("span", _hoisted_4$1, [
|
|
1001
|
+
_cache[14] || (_cache[14] = createTextVNode(" ", -1)),
|
|
1002
|
+
_cache[15] || (_cache[15] = createElementVNode("span", { class: "sr-only" }, "HTTP Method:", -1)),
|
|
1003
|
+
item.value.method ? (openBlock(), createBlock(unref(HttpMethod_default), {
|
|
1004
|
+
key: 0,
|
|
1005
|
+
class: "font-bold",
|
|
1006
|
+
method: item.value.method
|
|
1007
|
+
}, null, 8, ["method"])) : createCommentVNode("", true)
|
|
1008
|
+
])])], 2)]),
|
|
1009
|
+
_: 1
|
|
1010
|
+
}, 8, ["to"])) : (unref(layout) !== "modal" || __props.parentUids.length) && item.value.entity.type === "collection" && item.value.to ? (openBlock(), createBlock(unref(RouterLink), {
|
|
1011
|
+
key: 1,
|
|
1012
|
+
"aria-expanded": Boolean(unref(collapsedSidebarFolders)[item.value.entity.uid]),
|
|
1013
|
+
class: normalizeClass(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 no-underline focus-visible:z-10", [highlightClasses, {
|
|
1014
|
+
"bg-sidebar-b-active text-sidebar-c-active transition-none": typeof unref(router).currentRoute.value.name === "string" && unref(router).currentRoute.value.name.startsWith("collection") && unref(router).currentRoute.value.params[unref(PathId).Collection] === item.value.entity.uid,
|
|
1015
|
+
"text-c-2": item.value.title === "Untitled Collection"
|
|
1016
|
+
}]]),
|
|
1017
|
+
to: item.value.to
|
|
1018
|
+
}, {
|
|
1019
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_5$1, [renderSlot(_ctx.$slots, "leftIcon", {}, void 0, true), _cache[16] || (_cache[16] = createTextVNode(" ", -1))]), createElementVNode("div", _hoisted_6$1, [createElementVNode("span", _hoisted_7$1, toDisplayString(item.value.title), 1), createElementVNode("div", _hoisted_8$1, [
|
|
1020
|
+
createElementVNode("div", { class: normalizeClass(["items-center gap-px opacity-0 group-hover:flex group-hover:opacity-100 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100", {
|
|
1021
|
+
flex: __props.menuItem.open,
|
|
1022
|
+
hidden: !__props.menuItem.open || __props.menuItem.item?.entity.uid !== item.value.entity.uid
|
|
1023
|
+
}]) }, [unref(layout) !== "modal" && !isDraftCollection.value || isDraftCollection.value && hasDraftRequests.value ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
1024
|
+
key: 0,
|
|
1025
|
+
class: "hover:bg-b-3 hover:text-c-1 aspect-square h-fit px-0.5 py-0 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100",
|
|
1026
|
+
size: "sm",
|
|
1027
|
+
variant: "ghost",
|
|
1028
|
+
onClick: _cache[2] || (_cache[2] = withModifiers((ev) => _ctx.$emit("openMenu", {
|
|
1029
|
+
item: item.value,
|
|
1030
|
+
parentUids: __props.parentUids,
|
|
1031
|
+
targetRef: ev.currentTarget?.parentNode,
|
|
1032
|
+
open: true
|
|
1033
|
+
}), ["stop", "prevent"]))
|
|
1034
|
+
}, {
|
|
1035
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
1036
|
+
icon: "Ellipses",
|
|
1037
|
+
size: "md"
|
|
1038
|
+
})]),
|
|
1039
|
+
_: 1
|
|
1040
|
+
})) : createCommentVNode("", true), unref(layout) !== "modal" ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
1041
|
+
key: 1,
|
|
1042
|
+
class: "hover:bg-b-3 hover:text-c-1 aspect-square h-fit px-0.5 py-0 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100",
|
|
1043
|
+
size: "sm",
|
|
1044
|
+
variant: "ghost",
|
|
1045
|
+
onClick: _cache[3] || (_cache[3] = withModifiers(($event) => addRequest(item.value.entity.uid), ["stop", "prevent"]))
|
|
1046
|
+
}, {
|
|
1047
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
1048
|
+
icon: "Add",
|
|
1049
|
+
size: "md",
|
|
1050
|
+
thickness: "2"
|
|
1051
|
+
})]),
|
|
1052
|
+
_: 1
|
|
1053
|
+
})) : createCommentVNode("", true)], 2),
|
|
1054
|
+
item.value.watchMode ? (openBlock(), createBlock(unref(ScalarTooltip), {
|
|
1055
|
+
key: 0,
|
|
1056
|
+
content: `Watching: ${item.value.documentUrl}`,
|
|
1057
|
+
offset: 12,
|
|
1058
|
+
placement: "right"
|
|
1059
|
+
}, {
|
|
1060
|
+
default: withCtx(() => [createElementVNode("button", _hoisted_9, [createVNode(unref(ScalarIcon), {
|
|
1061
|
+
class: normalizeClass(["ml-0.5 text-sm", watchIconColor.value]),
|
|
1062
|
+
icon: "Watch",
|
|
1063
|
+
size: "md",
|
|
1064
|
+
thickness: "2"
|
|
1065
|
+
}, null, 8, ["class"])])]),
|
|
1066
|
+
_: 1
|
|
1067
|
+
}, 8, ["content"])) : createCommentVNode("", true),
|
|
1068
|
+
createElementVNode("span", {
|
|
1069
|
+
class: "flex cursor-pointer items-center justify-center",
|
|
1070
|
+
onClick: _cache[4] || (_cache[4] = withModifiers(($event) => unref(toggleSidebarFolder)(item.value.entity.uid), ["stop", "prevent"]))
|
|
1071
|
+
}, [createVNode(unref(ScalarSidebarGroupToggle), {
|
|
1072
|
+
class: "text-c-3 hover:text-c-1 shrink-0",
|
|
1073
|
+
open: Boolean(unref(collapsedSidebarFolders)[item.value.entity.uid])
|
|
1074
|
+
}, null, 8, ["open"])])
|
|
1075
|
+
])])]),
|
|
1076
|
+
_: 3
|
|
1077
|
+
}, 8, [
|
|
1078
|
+
"aria-expanded",
|
|
1079
|
+
"class",
|
|
1080
|
+
"to"
|
|
1081
|
+
])) : unref(layout) !== "modal" || __props.parentUids.length ? (openBlock(), createElementBlock("button", {
|
|
1082
|
+
key: 2,
|
|
1083
|
+
"aria-expanded": Boolean(unref(collapsedSidebarFolders)[item.value.entity.uid]),
|
|
1084
|
+
class: normalizeClass(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 focus-visible:z-10", [highlightClasses]]),
|
|
1085
|
+
type: "button",
|
|
1086
|
+
onClick: _cache[8] || (_cache[8] = ($event) => unref(toggleSidebarFolder)(item.value.entity.uid))
|
|
1087
|
+
}, [createElementVNode("span", _hoisted_11, [renderSlot(_ctx.$slots, "leftIcon", {}, void 0, true), _cache[17] || (_cache[17] = createTextVNode(" ", -1))]), createElementVNode("div", _hoisted_12, [createElementVNode("span", _hoisted_13, toDisplayString(item.value.title), 1), createElementVNode("div", _hoisted_14, [
|
|
1088
|
+
createElementVNode("div", { class: normalizeClass(["items-center gap-px opacity-0 group-hover:flex group-hover:opacity-100 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100", {
|
|
1089
|
+
flex: __props.menuItem.open,
|
|
1090
|
+
hidden: !__props.menuItem.open || __props.menuItem.item?.entity.uid !== item.value.entity.uid
|
|
1091
|
+
}]) }, [unref(layout) !== "modal" && !isDraftCollection.value || isDraftCollection.value && hasDraftRequests.value ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
1092
|
+
key: 0,
|
|
1093
|
+
class: "hover:bg-b-3 hover:text-c-1 aspect-square h-fit px-0.5 py-0 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100",
|
|
1094
|
+
size: "sm",
|
|
1095
|
+
variant: "ghost",
|
|
1096
|
+
onClick: _cache[5] || (_cache[5] = withModifiers((ev) => _ctx.$emit("openMenu", {
|
|
1097
|
+
item: item.value,
|
|
1098
|
+
parentUids: __props.parentUids,
|
|
1099
|
+
targetRef: ev.currentTarget?.parentNode,
|
|
1100
|
+
open: true
|
|
1101
|
+
}), ["stop", "prevent"]))
|
|
1102
|
+
}, {
|
|
1103
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
1104
|
+
icon: "Ellipses",
|
|
1105
|
+
size: "md"
|
|
1106
|
+
})]),
|
|
1107
|
+
_: 1
|
|
1108
|
+
})) : createCommentVNode("", true), unref(layout) !== "modal" ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
1109
|
+
key: 1,
|
|
1110
|
+
class: "hover:bg-b-3 hover:text-c-1 aspect-square h-fit px-0.5 py-0 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100",
|
|
1111
|
+
size: "sm",
|
|
1112
|
+
variant: "ghost",
|
|
1113
|
+
onClick: _cache[6] || (_cache[6] = withModifiers(($event) => addRequest(item.value.entity.uid), ["stop", "prevent"]))
|
|
1114
|
+
}, {
|
|
1115
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
1116
|
+
icon: "Add",
|
|
1117
|
+
size: "md",
|
|
1118
|
+
thickness: "2"
|
|
1119
|
+
})]),
|
|
1120
|
+
_: 1
|
|
1121
|
+
})) : createCommentVNode("", true)], 2),
|
|
1122
|
+
item.value.watchMode ? (openBlock(), createBlock(unref(ScalarTooltip), {
|
|
1123
|
+
key: 0,
|
|
1124
|
+
content: "Watching: {{ item.documentUrl }}",
|
|
1125
|
+
offset: 12,
|
|
1126
|
+
placement: "right"
|
|
1127
|
+
}, {
|
|
1128
|
+
default: withCtx(() => [createElementVNode("button", _hoisted_15, [createVNode(unref(ScalarIcon), {
|
|
1129
|
+
class: normalizeClass(["ml-0.5 text-sm", watchIconColor.value]),
|
|
1130
|
+
icon: "Watch",
|
|
1131
|
+
size: "md",
|
|
1132
|
+
thickness: "2"
|
|
1133
|
+
}, null, 8, ["class"])])]),
|
|
1134
|
+
_: 1
|
|
1135
|
+
})) : createCommentVNode("", true),
|
|
1136
|
+
createElementVNode("span", {
|
|
1137
|
+
class: "flex cursor-pointer items-center justify-center",
|
|
1138
|
+
onClick: _cache[7] || (_cache[7] = withModifiers(($event) => unref(toggleSidebarFolder)(item.value.entity.uid), ["stop", "prevent"]))
|
|
1139
|
+
}, [createVNode(unref(ScalarSidebarGroupToggle), {
|
|
1140
|
+
class: "text-c-3 hover:text-c-1 shrink-0",
|
|
1141
|
+
open: Boolean(unref(collapsedSidebarFolders)[item.value.entity.uid])
|
|
1142
|
+
}, null, 8, ["open"])])
|
|
1143
|
+
])])], 10, _hoisted_10)) : createCommentVNode("", true), showChildren.value ? (openBlock(), createElementBlock("ul", _hoisted_16, [(openBlock(true), createElementBlock(Fragment, null, renderList(item.value.children, (childUid) => {
|
|
1144
|
+
return openBlock(), createBlock(_component_RequestSidebarItem, {
|
|
1145
|
+
key: childUid,
|
|
1146
|
+
isDraggable: !unref(requestExamples)[childUid],
|
|
1147
|
+
isDroppable: _isDroppable,
|
|
1148
|
+
menuItem: __props.menuItem,
|
|
1149
|
+
parentUids: [...__props.parentUids, __props.uid],
|
|
1150
|
+
uid: childUid,
|
|
1151
|
+
onNewTab: _cache[9] || (_cache[9] = (name, uid) => _ctx.$emit("newTab", name, uid)),
|
|
1152
|
+
onOnDragEnd: _cache[10] || (_cache[10] = (...args) => _ctx.$emit("onDragEnd", ...args)),
|
|
1153
|
+
onOpenMenu: _cache[11] || (_cache[11] = (item) => _ctx.$emit("openMenu", item))
|
|
1154
|
+
}, null, 8, [
|
|
1155
|
+
"isDraggable",
|
|
1156
|
+
"menuItem",
|
|
1157
|
+
"parentUids",
|
|
1158
|
+
"uid"
|
|
1159
|
+
]);
|
|
1160
|
+
}), 128)), item.value.children.length === 0 ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
1161
|
+
key: 0,
|
|
1162
|
+
class: normalizeClass(["text-c-1 hover:bg-b-2 flex h-8 w-full justify-start gap-1.5 py-0 text-xs", __props.parentUids.length ? "pl-9" : ""]),
|
|
1163
|
+
variant: "ghost",
|
|
1164
|
+
onClick: _cache[12] || (_cache[12] = ($event) => addRequest(item.value.entity.uid))
|
|
1165
|
+
}, {
|
|
1166
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
1167
|
+
icon: "Add",
|
|
1168
|
+
size: "sm"
|
|
1169
|
+
}), _cache[18] || (_cache[18] = createElementVNode("span", null, "Add Request", -1))]),
|
|
1170
|
+
_: 1
|
|
1171
|
+
}, 8, ["class"])) : createCommentVNode("", true)])) : createCommentVNode("", true)]),
|
|
1172
|
+
_: 3
|
|
1173
|
+
}, 8, [
|
|
1174
|
+
"id",
|
|
1175
|
+
"ceiling",
|
|
1176
|
+
"floor",
|
|
1177
|
+
"isDraggable",
|
|
1178
|
+
"isDroppable",
|
|
1179
|
+
"parentIds"
|
|
1180
|
+
])], 2)) : createCommentVNode("", true);
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
}), [["__scopeId", "data-v-b2f06757"]]);
|
|
1184
|
+
//#endregion
|
|
1185
|
+
//#region src/views/Request/RequestSidebar.vue?vue&type=script&setup=true&lang.ts
|
|
1186
|
+
var _hoisted_1$1 = { class: "bg-b-1 sticky top-0 z-20 flex h-12 items-center px-3" };
|
|
1187
|
+
var _hoisted_2$1 = {
|
|
1188
|
+
key: 1,
|
|
1189
|
+
class: "text-c-3"
|
|
1190
|
+
};
|
|
1191
|
+
var _hoisted_3 = ["aria-pressed"];
|
|
1192
|
+
var _hoisted_4 = { class: "sr-only" };
|
|
1193
|
+
var _hoisted_5 = {
|
|
1194
|
+
key: 0,
|
|
1195
|
+
class: "search-button-fade sticky top-12 z-10 px-3 py-2.5 pt-0 focus-within:z-20",
|
|
1196
|
+
role: "search"
|
|
1197
|
+
};
|
|
1198
|
+
var _hoisted_6 = {
|
|
1199
|
+
key: 1,
|
|
1200
|
+
class: "contents"
|
|
1201
|
+
};
|
|
1202
|
+
var _hoisted_7 = {
|
|
1203
|
+
key: 0,
|
|
1204
|
+
class: "empty-sidebar-item-content px-2.5 py-2.5"
|
|
1205
|
+
};
|
|
1206
|
+
var _hoisted_8 = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" };
|
|
1207
|
+
//#endregion
|
|
1208
|
+
//#region src/views/Request/RequestSidebar.vue
|
|
1209
|
+
var RequestSidebar_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1210
|
+
__name: "RequestSidebar",
|
|
1211
|
+
emits: ["newTab", "clearDrafts"],
|
|
1212
|
+
setup(__props, { emit: __emit }) {
|
|
1213
|
+
const emit = __emit;
|
|
1214
|
+
const { isSidebarOpen, setCollapsedSidebarFolder, toggleSidebarOpen } = useSidebar();
|
|
1215
|
+
const { layout } = useLayout();
|
|
1216
|
+
const workspaceContext = useWorkspace();
|
|
1217
|
+
const { activeCollection, activeWorkspaceCollections, activeRequest, activeWorkspaceRequests, activeWorkspace } = useActiveEntities();
|
|
1218
|
+
const { findRequestParents, events, requestMutators, requests } = workspaceContext;
|
|
1219
|
+
const { handleDragEnd, isDroppable } = dragHandlerFactory(activeWorkspace, workspaceContext);
|
|
1220
|
+
const { replace } = useRouter();
|
|
1221
|
+
const openCommandPaletteImport = () => {
|
|
1222
|
+
events.commandPalette.emit({ commandName: "Import from OpenAPI/Swagger/Postman/cURL" });
|
|
1223
|
+
};
|
|
1224
|
+
const searchResultsId = useId();
|
|
1225
|
+
const { toast } = useToasts();
|
|
1226
|
+
/** The currently selected sidebarMenuItem for the context menu */
|
|
1227
|
+
const menuItem = reactive({ open: false });
|
|
1228
|
+
const isSearchVisible = ref(false);
|
|
1229
|
+
/** Watch to see if activeRequest changes and ensure we open any folders */
|
|
1230
|
+
watch(activeRequest, (request) => {
|
|
1231
|
+
if (!request) return;
|
|
1232
|
+
findRequestParents(request).forEach((uid) => setCollapsedSidebarFolder(uid, true));
|
|
1233
|
+
}, { immediate: true });
|
|
1234
|
+
const { searchText, searchResultsWithPlaceholderResults, selectedSearchResult, onSearchResultClick, fuseSearch, searchInputRef, searchResultRefs, navigateSearchResults, selectSearchResult } = useSearch();
|
|
1235
|
+
const searchToggleRef = ref();
|
|
1236
|
+
/** Handle hotkey events from the bus */
|
|
1237
|
+
const handleHotKey = (event) => {
|
|
1238
|
+
if (!event) return;
|
|
1239
|
+
if (event.toggleSidebar) toggleSidebarOpen();
|
|
1240
|
+
if (event.focusRequestSearch) searchInputRef.value?.focus();
|
|
1241
|
+
};
|
|
1242
|
+
onMounted(() => events.hotKeys.on(handleHotKey));
|
|
1243
|
+
/**
|
|
1244
|
+
* Need to manually remove listener on unmount due to vueuse memory leak
|
|
1245
|
+
*
|
|
1246
|
+
* @see https://github.com/vueuse/vueuse/issues/3498#issuecomment-2055546566
|
|
1247
|
+
*/
|
|
1248
|
+
onBeforeUnmount(() => {
|
|
1249
|
+
events.hotKeys.off(handleHotKey);
|
|
1250
|
+
});
|
|
1251
|
+
const handleToggleWatchMode = (item) => {
|
|
1252
|
+
if (item?.documentUrl) {
|
|
1253
|
+
item.watchMode = !item.watchMode;
|
|
1254
|
+
const currentCollection = activeWorkspaceCollections.value.find((collection) => collection.uid === item.entity.uid);
|
|
1255
|
+
if (currentCollection) currentCollection.watchMode = item.watchMode;
|
|
1256
|
+
}
|
|
1257
|
+
};
|
|
1258
|
+
watch(() => activeWorkspaceCollections.value.map((collection) => collection.watchMode), (newWatchModes, oldWatchModes) => {
|
|
1259
|
+
newWatchModes.forEach((newWatchMode, index) => {
|
|
1260
|
+
if (layout !== "modal" && newWatchMode !== oldWatchModes[index] && activeWorkspaceCollections.value[index]?.info?.title !== "Drafts" && activeWorkspaceCollections.value[index]) {
|
|
1261
|
+
const currentCollection = activeWorkspaceCollections.value[index];
|
|
1262
|
+
if (!currentCollection) return;
|
|
1263
|
+
toast(`${currentCollection.info?.title}: Watch Mode ${newWatchMode ? "enabled" : "disabled"}`, "info");
|
|
1264
|
+
}
|
|
1265
|
+
});
|
|
1266
|
+
});
|
|
1267
|
+
/** Screen reader label for the search input */
|
|
1268
|
+
const srLabel = computed(() => {
|
|
1269
|
+
const results = searchResultsWithPlaceholderResults.value;
|
|
1270
|
+
if (!results.length) return "No results found";
|
|
1271
|
+
const result = results[selectedSearchResult.value]?.item;
|
|
1272
|
+
if (!result) return "No result selected";
|
|
1273
|
+
const resultsFoundLabel = searchText.value.length ? `${results.length} result${results.length === 1 ? "" : "s"} found, ` : "";
|
|
1274
|
+
const selectedResultDescription = `, HTTP Method ${result.httpVerb}, Path ${result.path}`;
|
|
1275
|
+
return `${resultsFoundLabel}Selected: ${`${result.title} ${selectedResultDescription}`}`;
|
|
1276
|
+
});
|
|
1277
|
+
const handleClearDrafts = () => {
|
|
1278
|
+
const draftCollection = activeWorkspaceCollections.value.find((collection) => collection.info?.title === "Drafts");
|
|
1279
|
+
if (draftCollection) draftCollection.requests.forEach((requestUid) => {
|
|
1280
|
+
if (requests[requestUid]) requestMutators.delete(requests[requestUid], draftCollection.uid);
|
|
1281
|
+
});
|
|
1282
|
+
if (activeWorkspaceRequests.value.length) {
|
|
1283
|
+
const firstRequest = activeWorkspaceCollections.value[0]?.requests[0];
|
|
1284
|
+
if (firstRequest) replace({
|
|
1285
|
+
name: "request",
|
|
1286
|
+
params: { [PathId.Request]: firstRequest }
|
|
1287
|
+
});
|
|
1288
|
+
} else {
|
|
1289
|
+
const { request } = createInitialRequest();
|
|
1290
|
+
if (draftCollection) {
|
|
1291
|
+
requestMutators.add(request, draftCollection.uid);
|
|
1292
|
+
replace({
|
|
1293
|
+
name: "request",
|
|
1294
|
+
params: { [PathId.Request]: request.uid }
|
|
1295
|
+
});
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
watch(isSearchVisible, (isVisible) => {
|
|
1300
|
+
if (!isVisible) searchText.value = "";
|
|
1301
|
+
});
|
|
1302
|
+
const showGettingStarted = computed(() => isGettingStarted(activeWorkspaceCollections.value, activeWorkspaceRequests.value, requests));
|
|
1303
|
+
/** We ensure in modal mode we only show the current requests collection */
|
|
1304
|
+
const collections = computed(() => {
|
|
1305
|
+
if (layout === "modal" && activeCollection.value) return [activeCollection.value];
|
|
1306
|
+
return activeWorkspaceCollections.value;
|
|
1307
|
+
});
|
|
1308
|
+
/** Hide the search input if the text is empty */
|
|
1309
|
+
function handleBlur(e) {
|
|
1310
|
+
if (!searchText.value && e.relatedTarget !== searchToggleRef.value) isSearchVisible.value = false;
|
|
1311
|
+
}
|
|
1312
|
+
return (_ctx, _cache) => {
|
|
1313
|
+
return openBlock(), createElementBlock(Fragment, null, [withDirectives(createVNode(unref(Sidebar_default), { class: normalizeClass([unref(isSidebarOpen) ? "sidebar-active-width" : ""]) }, createSlots({
|
|
1314
|
+
content: withCtx(() => [
|
|
1315
|
+
createElementVNode("div", _hoisted_1$1, [
|
|
1316
|
+
createElementVNode("div", { class: normalizeClass(["size-8", { "xl:hidden": unref(layout) !== "modal" }]) }, null, 2),
|
|
1317
|
+
unref(layout) !== "modal" ? (openBlock(), createBlock(unref(WorkspaceDropdown_default), { key: 0 })) : createCommentVNode("", true),
|
|
1318
|
+
unref(layout) !== "modal" ? (openBlock(), createElementBlock("span", _hoisted_2$1, " / ")) : createCommentVNode("", true),
|
|
1319
|
+
unref(layout) !== "modal" ? (openBlock(), createBlock(EnvironmentSelector_default, { key: 2 })) : createCommentVNode("", true),
|
|
1320
|
+
createElementVNode("button", {
|
|
1321
|
+
ref_key: "searchToggleRef",
|
|
1322
|
+
ref: searchToggleRef,
|
|
1323
|
+
"aria-pressed": isSearchVisible.value,
|
|
1324
|
+
class: "ml-auto",
|
|
1325
|
+
type: "button",
|
|
1326
|
+
onClick: _cache[0] || (_cache[0] = ($event) => isSearchVisible.value = !isSearchVisible.value)
|
|
1327
|
+
}, [createElementVNode("span", _hoisted_4, toDisplayString(isSearchVisible.value ? "Hide" : "Show") + " search ", 1), createVNode(unref(ScalarIcon), {
|
|
1328
|
+
class: "text-c-3 hover:bg-b-2 max-h-8 max-w-8 rounded-lg p-1.75 text-sm",
|
|
1329
|
+
icon: "Search"
|
|
1330
|
+
})], 8, _hoisted_3)
|
|
1331
|
+
]),
|
|
1332
|
+
isSearchVisible.value ? (openBlock(), createElementBlock("div", _hoisted_5, [createVNode(unref(ScalarSidebarSearchInput), {
|
|
1333
|
+
ref_key: "searchInputRef",
|
|
1334
|
+
ref: searchInputRef,
|
|
1335
|
+
modelValue: unref(searchText),
|
|
1336
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(searchText) ? searchText.value = $event : null),
|
|
1337
|
+
autofocus: "",
|
|
1338
|
+
"aria-controls": unref(searchResultsId),
|
|
1339
|
+
label: srLabel.value,
|
|
1340
|
+
onInput: unref(fuseSearch),
|
|
1341
|
+
onKeydown: [
|
|
1342
|
+
_cache[2] || (_cache[2] = withKeys(withModifiers(($event) => unref(navigateSearchResults)("down"), ["stop"]), ["down"])),
|
|
1343
|
+
_cache[3] || (_cache[3] = withKeys(withModifiers(($event) => unref(selectSearchResult)(), ["stop"]), ["enter"])),
|
|
1344
|
+
_cache[4] || (_cache[4] = withKeys(withModifiers(($event) => unref(navigateSearchResults)("up"), ["stop"]), ["up"]))
|
|
1345
|
+
],
|
|
1346
|
+
onBlur: handleBlur
|
|
1347
|
+
}, null, 8, [
|
|
1348
|
+
"modelValue",
|
|
1349
|
+
"aria-controls",
|
|
1350
|
+
"label",
|
|
1351
|
+
"onInput"
|
|
1352
|
+
])])) : createCommentVNode("", true),
|
|
1353
|
+
createElementVNode("div", {
|
|
1354
|
+
class: normalizeClass(["gap-1/2 flex flex-1 flex-col overflow-visible overflow-y-auto px-3 pt-0 pb-3", [{ "pb-14": unref(layout) !== "modal" }, { "h-[calc(100%-273.5px)]": showGettingStarted.value }]]),
|
|
1355
|
+
onDragenter: _cache[7] || (_cache[7] = withModifiers(() => {}, ["prevent"])),
|
|
1356
|
+
onDragover: _cache[8] || (_cache[8] = withModifiers(() => {}, ["prevent"]))
|
|
1357
|
+
}, [unref(searchText) ? (openBlock(), createBlock(unref(ScalarSearchResultList), {
|
|
1358
|
+
key: 0,
|
|
1359
|
+
id: unref(searchResultsId),
|
|
1360
|
+
"aria-label": "Search Results",
|
|
1361
|
+
class: "gap-px",
|
|
1362
|
+
noResults: !unref(searchResultsWithPlaceholderResults).length
|
|
1363
|
+
}, {
|
|
1364
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(searchResultsWithPlaceholderResults), (entry, index) => {
|
|
1365
|
+
return openBlock(), createBlock(unref(ScalarSearchResultItem), {
|
|
1366
|
+
id: `#search-input-${entry.item.id}`,
|
|
1367
|
+
key: entry.refIndex,
|
|
1368
|
+
ref_for: true,
|
|
1369
|
+
ref: (el) => unref(searchResultRefs)[index] = el,
|
|
1370
|
+
selected: unref(selectedSearchResult) === index,
|
|
1371
|
+
class: "px-2",
|
|
1372
|
+
href: entry.item.link,
|
|
1373
|
+
onClick: withModifiers(($event) => unref(onSearchResultClick)(entry), ["prevent"]),
|
|
1374
|
+
onFocus: ($event) => selectedSearchResult.value = index
|
|
1375
|
+
}, {
|
|
1376
|
+
addon: withCtx(() => [_cache[10] || (_cache[10] = createElementVNode("span", { class: "sr-only" }, "HTTP Method:", -1)), createVNode(HttpMethod_default, {
|
|
1377
|
+
class: "font-bold",
|
|
1378
|
+
method: entry.item.httpVerb ?? "get"
|
|
1379
|
+
}, null, 8, ["method"])]),
|
|
1380
|
+
default: withCtx(() => [createTextVNode(toDisplayString(entry.item.title) + " ", 1)]),
|
|
1381
|
+
_: 2
|
|
1382
|
+
}, 1032, [
|
|
1383
|
+
"id",
|
|
1384
|
+
"selected",
|
|
1385
|
+
"href",
|
|
1386
|
+
"onClick",
|
|
1387
|
+
"onFocus"
|
|
1388
|
+
]);
|
|
1389
|
+
}), 128))]),
|
|
1390
|
+
_: 1
|
|
1391
|
+
}, 8, ["id", "noResults"])) : (openBlock(), createElementBlock("nav", _hoisted_6, [(openBlock(true), createElementBlock(Fragment, null, renderList(collections.value, (collection) => {
|
|
1392
|
+
return openBlock(), createBlock(RequestSidebarItem_default, {
|
|
1393
|
+
key: collection.uid,
|
|
1394
|
+
isDraggable: unref(layout) !== "modal" && collection.info?.title !== "Drafts",
|
|
1395
|
+
isDroppable: unref(isDroppable),
|
|
1396
|
+
menuItem,
|
|
1397
|
+
parentUids: [],
|
|
1398
|
+
uid: collection.uid,
|
|
1399
|
+
onNewTab: _cache[5] || (_cache[5] = (name, uid) => emit("newTab", {
|
|
1400
|
+
name,
|
|
1401
|
+
uid
|
|
1402
|
+
})),
|
|
1403
|
+
onOnDragEnd: unref(handleDragEnd),
|
|
1404
|
+
onOpenMenu: _cache[6] || (_cache[6] = (item) => Object.assign(menuItem, item))
|
|
1405
|
+
}, {
|
|
1406
|
+
leftIcon: withCtx(() => [collection.info?.title === "Drafts" ? (openBlock(), createBlock(unref(ScalarIcon), {
|
|
1407
|
+
key: 0,
|
|
1408
|
+
class: "text-sidebar-c-2",
|
|
1409
|
+
icon: "Scribble",
|
|
1410
|
+
thickness: "2.25"
|
|
1411
|
+
})) : (openBlock(), createBlock(unref(LibraryIcon), {
|
|
1412
|
+
key: 1,
|
|
1413
|
+
class: "text-sidebar-c-2 size-3.5 min-w-3.5 stroke-2",
|
|
1414
|
+
src: collection["x-scalar-icon"] || "interface-content-folder"
|
|
1415
|
+
}, null, 8, ["src"]))]),
|
|
1416
|
+
_: 2
|
|
1417
|
+
}, 1032, [
|
|
1418
|
+
"isDraggable",
|
|
1419
|
+
"isDroppable",
|
|
1420
|
+
"menuItem",
|
|
1421
|
+
"uid",
|
|
1422
|
+
"onOnDragEnd"
|
|
1423
|
+
]);
|
|
1424
|
+
}), 128))]))], 34)
|
|
1425
|
+
]),
|
|
1426
|
+
button: withCtx(() => [createElementVNode("div", { class: normalizeClass({ "empty-sidebar-item": showGettingStarted.value }) }, [
|
|
1427
|
+
showGettingStarted.value ? (openBlock(), createElementBlock("div", _hoisted_7, [createElementVNode("div", _hoisted_8, [createVNode(ScalarAsciiArt_default, {
|
|
1428
|
+
art: unref(rabbit_default),
|
|
1429
|
+
class: "rabbitsit font-bold"
|
|
1430
|
+
}, null, 8, ["art"]), createVNode(ScalarAsciiArt_default, {
|
|
1431
|
+
art: unref(rabbitjump_default),
|
|
1432
|
+
class: "rabbitjump absolute top-0 left-0 font-bold"
|
|
1433
|
+
}, null, 8, ["art"])]), _cache[11] || (_cache[11] = createElementVNode("div", { class: "mt-2 mb-2 text-center text-sm text-balance" }, [createElementVNode("b", { class: "font-medium" }, "Let's Get Started"), createElementVNode("p", { class: "mt-2" }, " Create request, folder, collection or import from OpenAPI/Postman ")], -1))])) : createCommentVNode("", true),
|
|
1434
|
+
unref(layout) !== "modal" ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
1435
|
+
key: 1,
|
|
1436
|
+
class: normalizeClass(["mb-1.5 hidden h-fit w-full p-1.5 opacity-0", { "flex opacity-100": showGettingStarted.value }]),
|
|
1437
|
+
onClick: openCommandPaletteImport
|
|
1438
|
+
}, {
|
|
1439
|
+
default: withCtx(() => [..._cache[12] || (_cache[12] = [createTextVNode(" Import Collection ", -1)])]),
|
|
1440
|
+
_: 1
|
|
1441
|
+
}, 8, ["class"])) : createCommentVNode("", true),
|
|
1442
|
+
unref(layout) !== "modal" ? (openBlock(), createBlock(SidebarButton_default, {
|
|
1443
|
+
key: 2,
|
|
1444
|
+
click: unref(events).commandPalette.emit,
|
|
1445
|
+
hotkey: "K"
|
|
1446
|
+
}, {
|
|
1447
|
+
title: withCtx(() => [..._cache[13] || (_cache[13] = [createTextVNode(" Add Item ", -1)])]),
|
|
1448
|
+
_: 1
|
|
1449
|
+
}, 8, ["click"])) : createCommentVNode("", true)
|
|
1450
|
+
], 2)]),
|
|
1451
|
+
_: 2
|
|
1452
|
+
}, [unref(layout) !== "modal" ? {
|
|
1453
|
+
name: "header",
|
|
1454
|
+
fn: withCtx(() => []),
|
|
1455
|
+
key: "0"
|
|
1456
|
+
} : void 0]), 1032, ["class"]), [[vShow, unref(isSidebarOpen)]]), unref(layout) !== "modal" && menuItem ? (openBlock(), createBlock(RequestSidebarItemMenu_default, {
|
|
1457
|
+
key: 0,
|
|
1458
|
+
menuItem,
|
|
1459
|
+
onClearDrafts: handleClearDrafts,
|
|
1460
|
+
onCloseMenu: _cache[9] || (_cache[9] = ($event) => menuItem.open = false),
|
|
1461
|
+
onToggleWatchMode: handleToggleWatchMode
|
|
1462
|
+
}, null, 8, ["menuItem"])) : createCommentVNode("", true)], 64);
|
|
1463
|
+
};
|
|
1464
|
+
}
|
|
1465
|
+
}), [["__scopeId", "data-v-23d35bb5"]]);
|
|
1466
|
+
//#endregion
|
|
1467
|
+
//#region src/views/Request/RequestRoot.vue?vue&type=script&setup=true&lang.ts
|
|
1468
|
+
var _hoisted_1 = { class: "flex h-full" };
|
|
1469
|
+
var _hoisted_2 = { class: "flex h-full flex-1 flex-col" };
|
|
1470
|
+
//#endregion
|
|
1471
|
+
//#region src/views/Request/RequestRoot.vue
|
|
1472
|
+
var RequestRoot_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1473
|
+
__name: "RequestRoot",
|
|
1474
|
+
emits: ["newTab"],
|
|
1475
|
+
setup(__props) {
|
|
1476
|
+
const workspaceContext = useWorkspace();
|
|
1477
|
+
const { toast } = useToasts();
|
|
1478
|
+
const { layout } = useLayout();
|
|
1479
|
+
const config = useClientConfig();
|
|
1480
|
+
const { isSidebarOpen } = useSidebar();
|
|
1481
|
+
const analytics = useAnalytics();
|
|
1482
|
+
const { activeCollection, activeExample, activeEnvironment, activeRequest, activeWorkspace, activeServer } = useActiveEntities();
|
|
1483
|
+
const { cookies, requestHistory, showSidebar, securitySchemes, modalState, events } = workspaceContext;
|
|
1484
|
+
const pluginManager = usePluginManager();
|
|
1485
|
+
/** Root element (bound in template via ref="_element") */
|
|
1486
|
+
const _element = ref();
|
|
1487
|
+
const requestAbortController = ref();
|
|
1488
|
+
/** Computed Validation State Update on Example Change */
|
|
1489
|
+
const validation = computed(() => validateParameters(activeExample.value ?? null));
|
|
1490
|
+
const requestResult = ref(null);
|
|
1491
|
+
/**
|
|
1492
|
+
* Selected scheme UIDs
|
|
1493
|
+
*
|
|
1494
|
+
* In the modal we use collection.selectedSecuritySchemes and in the
|
|
1495
|
+
* standalone client we use request.selectedSecuritySchemeUids
|
|
1496
|
+
*
|
|
1497
|
+
* These are centralized here so they can be drilled down AND used in send-request
|
|
1498
|
+
*/
|
|
1499
|
+
const selectedSecuritySchemeUids = computed(() => (activeCollection.value?.useCollectionSecurity ? activeCollection.value?.selectedSecuritySchemeUids : activeRequest.value?.selectedSecuritySchemeUids) ?? []);
|
|
1500
|
+
/**
|
|
1501
|
+
* Execute the request
|
|
1502
|
+
* called from the send button as well as keyboard shortcuts
|
|
1503
|
+
*/
|
|
1504
|
+
const executeRequest = async () => {
|
|
1505
|
+
if (!activeRequest.value || !activeExample.value || !activeCollection.value) return;
|
|
1506
|
+
if (validation.value.hasBlockingErrors) {
|
|
1507
|
+
toast("Path parameters must have values.", "error");
|
|
1508
|
+
events.requestStatus.emit("abort");
|
|
1509
|
+
return;
|
|
1510
|
+
}
|
|
1511
|
+
const environmentValue = typeof activeEnvironment.value === "object" ? activeEnvironment.value.value : "{}";
|
|
1512
|
+
const e = safeJSON.parse(environmentValue);
|
|
1513
|
+
if (e.error) console.error("INVALID ENVIRONMENT!");
|
|
1514
|
+
const environment = e.error || typeof e.data !== "object" ? {} : e.data ?? {};
|
|
1515
|
+
const globalCookies = activeWorkspace.value?.cookies.map((c) => cookies[c]).filter(isDefined$1) ?? [];
|
|
1516
|
+
const server = activeCollection.value?.info?.title === "Drafts" ? void 0 : activeServer.value;
|
|
1517
|
+
const [error, requestOperation] = createRequestOperation({
|
|
1518
|
+
request: activeRequest.value,
|
|
1519
|
+
example: activeExample.value,
|
|
1520
|
+
selectedSecuritySchemeUids: selectedSecuritySchemeUids.value,
|
|
1521
|
+
proxyUrl: activeWorkspace.value?.proxyUrl ?? "",
|
|
1522
|
+
environment,
|
|
1523
|
+
globalCookies,
|
|
1524
|
+
status: events.requestStatus,
|
|
1525
|
+
securitySchemes,
|
|
1526
|
+
server,
|
|
1527
|
+
pluginManager
|
|
1528
|
+
});
|
|
1529
|
+
config.value?.onRequestSent?.(activeRequest.value.path ?? "");
|
|
1530
|
+
if (error) {
|
|
1531
|
+
toast(error.message, "error");
|
|
1532
|
+
return;
|
|
1533
|
+
}
|
|
1534
|
+
requestAbortController.value = requestOperation.controller;
|
|
1535
|
+
const [sendRequestError, result] = await requestOperation.sendRequest();
|
|
1536
|
+
requestResult.value = result;
|
|
1537
|
+
if (sendRequestError) toast(sendRequestError.message, "error");
|
|
1538
|
+
else requestHistory.push(cloneRequestResult(result));
|
|
1539
|
+
};
|
|
1540
|
+
/** Cancel a live request */
|
|
1541
|
+
const cancelRequest = async () => requestAbortController.value?.abort(ERRORS.REQUEST_ABORTED);
|
|
1542
|
+
/** Subscribed to executeRequest, used for logging / analytics. */
|
|
1543
|
+
function logRequest() {
|
|
1544
|
+
analytics?.capture("client-send-request");
|
|
1545
|
+
}
|
|
1546
|
+
/**
|
|
1547
|
+
* Cancel request when closing the modal
|
|
1548
|
+
* @see https://github.com/scalar/scalar/issues/7115
|
|
1549
|
+
*/
|
|
1550
|
+
watch(modalState, ({ open }) => {
|
|
1551
|
+
if (!open) cancelRequest();
|
|
1552
|
+
});
|
|
1553
|
+
onMounted(() => {
|
|
1554
|
+
events.executeRequest.on(executeRequest);
|
|
1555
|
+
events.executeRequest.on(logRequest);
|
|
1556
|
+
events.cancelRequest.on(cancelRequest);
|
|
1557
|
+
});
|
|
1558
|
+
useOpenApiWatcher();
|
|
1559
|
+
/**
|
|
1560
|
+
* Need to manually remove listener on unmount due to vueuse memory leak
|
|
1561
|
+
*
|
|
1562
|
+
* @see https://github.com/vueuse/vueuse/issues/3498#issuecomment-2055546566
|
|
1563
|
+
*/
|
|
1564
|
+
onBeforeUnmount(() => {
|
|
1565
|
+
events.executeRequest.off(executeRequest);
|
|
1566
|
+
events.executeRequest.off(logRequest);
|
|
1567
|
+
events.cancelRequest.off(cancelRequest);
|
|
1568
|
+
});
|
|
1569
|
+
const cloneRequestResult = (result) => {
|
|
1570
|
+
try {
|
|
1571
|
+
return structuredClone(result);
|
|
1572
|
+
} catch {
|
|
1573
|
+
const clone = { ...result };
|
|
1574
|
+
if (result.response?.data) if (result.response.data instanceof Blob || result.response.data instanceof ArrayBuffer) clone.response.data = result.response.data;
|
|
1575
|
+
else clone.response.data = JSON.parse(JSON.stringify(result.response.data));
|
|
1576
|
+
return clone;
|
|
1577
|
+
}
|
|
1578
|
+
};
|
|
1579
|
+
return (_ctx, _cache) => {
|
|
1580
|
+
return openBlock(), createElementBlock("div", {
|
|
1581
|
+
ref_key: "_element",
|
|
1582
|
+
ref: _element,
|
|
1583
|
+
class: normalizeClass(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", { "!mr-0 !mb-0 !border-0": unref(layout) === "modal" }])
|
|
1584
|
+
}, [unref(showSidebar) ? (openBlock(), createBlock(SidebarToggle_default, {
|
|
1585
|
+
key: 0,
|
|
1586
|
+
modelValue: unref(isSidebarOpen),
|
|
1587
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(isSidebarOpen) ? isSidebarOpen.value = $event : null),
|
|
1588
|
+
class: normalizeClass(["absolute top-2 left-3 z-50", [
|
|
1589
|
+
{ hidden: unref(isSidebarOpen) },
|
|
1590
|
+
{ "xl:!flex": !unref(isSidebarOpen) },
|
|
1591
|
+
{ "!flex": unref(layout) === "modal" }
|
|
1592
|
+
]])
|
|
1593
|
+
}, null, 8, ["modelValue", "class"])) : createCommentVNode("", true), createElementVNode("div", _hoisted_1, [unref(showSidebar) ? (openBlock(), createBlock(RequestSidebar_default, {
|
|
1594
|
+
key: 0,
|
|
1595
|
+
onNewTab: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("newTab", $event))
|
|
1596
|
+
})) : createCommentVNode("", true), createElementVNode("div", _hoisted_2, [createVNode(unref(RouterView), {
|
|
1597
|
+
invalidParams: validation.value.invalidParams,
|
|
1598
|
+
requestResult: requestResult.value,
|
|
1599
|
+
selectedSecuritySchemeUids: selectedSecuritySchemeUids.value
|
|
1600
|
+
}, null, 8, [
|
|
1601
|
+
"invalidParams",
|
|
1602
|
+
"requestResult",
|
|
1603
|
+
"selectedSecuritySchemeUids"
|
|
1604
|
+
])])])], 2);
|
|
1605
|
+
};
|
|
1606
|
+
}
|
|
1607
|
+
}), [["__scopeId", "data-v-02af05d1"]]);
|
|
1608
|
+
//#endregion
|
|
1609
|
+
export { RequestRoot_default as default };
|
|
1610
|
+
|
|
1611
|
+
//# sourceMappingURL=RequestRoot-7xhK5_qr.js.map
|