@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,1512 @@
|
|
|
1
|
+
import { t as flattenEnvVars } from "./string-template-sS5PtY6T.js";
|
|
2
|
+
import { i as LAYOUT_SYMBOL, n as createSidebarState, t as SIDEBAR_SYMBOL } from "./useSidebar-DLTwHDI-.js";
|
|
3
|
+
import { r as createPluginManager, t as PLUGIN_MANAGER_SYMBOL } from "./plugins-B52hCIyZ.js";
|
|
4
|
+
import { o as normalizeError } from "./send-request-BsTfRiBC.js";
|
|
5
|
+
import { computed, createApp, inject, reactive, ref, toRaw, watch } from "vue";
|
|
6
|
+
import { useModal } from "@scalar/components";
|
|
7
|
+
import { environmentSchema } from "@scalar/oas-utils/entities/environment";
|
|
8
|
+
import { createHash, fetchDocument, isDefined, isValidUrl, json, schemaModel, yaml } from "@scalar/oas-utils/helpers";
|
|
9
|
+
import { LS_KEYS } from "@scalar/helpers/object/local-storage";
|
|
10
|
+
import { collectionSchema, createExampleFromRequest, requestExampleSchema, requestSchema, securitySchemeSchema, serverSchema, tagSchema } from "@scalar/oas-utils/entities/spec";
|
|
11
|
+
import { mutationFactory } from "@scalar/object-utils/mutator-record";
|
|
12
|
+
import { importSpecToWorkspace } from "@scalar/oas-utils/transforms";
|
|
13
|
+
import { prettyPrintJson } from "@scalar/helpers/json/pretty-print-json";
|
|
14
|
+
import { workspaceSchema } from "@scalar/oas-utils/entities/workspace";
|
|
15
|
+
import { DATA_VERSION, DATA_VERSION_LS_LEY, migrator } from "@scalar/oas-utils/migrations";
|
|
16
|
+
import { apiClientConfigurationSchema } from "@scalar/types/api-reference";
|
|
17
|
+
import { cookieSchema } from "@scalar/oas-utils/entities/cookie";
|
|
18
|
+
import { isMacOS } from "@scalar/helpers/general/is-mac-os";
|
|
19
|
+
import { convert } from "@scalar/postman-to-openapi";
|
|
20
|
+
import { iterateTitle } from "@scalar/helpers/string/iterate-title";
|
|
21
|
+
//#region src/routes.ts
|
|
22
|
+
var PathId = /* @__PURE__ */ function(PathId) {
|
|
23
|
+
PathId["Request"] = "request";
|
|
24
|
+
PathId["Examples"] = "examples";
|
|
25
|
+
PathId["Cookies"] = "cookies";
|
|
26
|
+
PathId["Collection"] = "collection";
|
|
27
|
+
PathId["Schema"] = "schema";
|
|
28
|
+
PathId["Environment"] = "environment";
|
|
29
|
+
PathId["Servers"] = "servers";
|
|
30
|
+
PathId["Workspace"] = "workspace";
|
|
31
|
+
PathId["Settings"] = "settings";
|
|
32
|
+
return PathId;
|
|
33
|
+
}({});
|
|
34
|
+
/** Tracks the active workspace in localStorage for when the client reloads */
|
|
35
|
+
var ACTIVE_WORKSPACE_KEY = "activeWorkspace";
|
|
36
|
+
/** Save the active workspace in localStorage for when the client reloads */
|
|
37
|
+
function saveActiveWorkspace(to) {
|
|
38
|
+
const workspace = to.params[PathId.Workspace];
|
|
39
|
+
if (workspace) localStorage.setItem(ACTIVE_WORKSPACE_KEY, `${workspace}`);
|
|
40
|
+
}
|
|
41
|
+
/** Redirect to the saved workspace or the default workspace */
|
|
42
|
+
function redirectToActiveWorkspace() {
|
|
43
|
+
const activeWorkspace = localStorage.getItem(ACTIVE_WORKSPACE_KEY);
|
|
44
|
+
if (!activeWorkspace) return { name: "workspace.default" };
|
|
45
|
+
return {
|
|
46
|
+
name: "request.root",
|
|
47
|
+
params: { [PathId.Workspace]: activeWorkspace }
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** Shared request routes between modal and app */
|
|
51
|
+
var requestRoutes = [{
|
|
52
|
+
name: "request.root",
|
|
53
|
+
path: "",
|
|
54
|
+
component: () => import("./RequestRoot-7xhK5_qr.js"),
|
|
55
|
+
redirect: (to, _from) => ({
|
|
56
|
+
name: "request",
|
|
57
|
+
params: {
|
|
58
|
+
...to.params,
|
|
59
|
+
request: "default"
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
children: [
|
|
63
|
+
{
|
|
64
|
+
name: "request",
|
|
65
|
+
path: `request/:${PathId.Request}`,
|
|
66
|
+
component: () => import("./Request-BWfYWyBa.js")
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "request.examples",
|
|
70
|
+
path: `request/:${PathId.Request}/examples/:${PathId.Examples}`,
|
|
71
|
+
component: () => import("./Request-BWfYWyBa.js")
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "collection",
|
|
75
|
+
path: `collection/:${PathId.Collection}`,
|
|
76
|
+
component: () => import("./Collection-ChAxs3rz.js"),
|
|
77
|
+
redirect: (_to, _from) => {
|
|
78
|
+
return { name: "collection.overview" };
|
|
79
|
+
},
|
|
80
|
+
children: [
|
|
81
|
+
{
|
|
82
|
+
name: "collection.overview",
|
|
83
|
+
path: "overview",
|
|
84
|
+
component: () => import("./CollectionOverview-CJ9-Vmei.js")
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "collection.servers",
|
|
88
|
+
path: "servers",
|
|
89
|
+
component: () => import("./CollectionServers-BWkIGwz4.js"),
|
|
90
|
+
children: [{
|
|
91
|
+
name: "collection.servers.edit",
|
|
92
|
+
path: `:${PathId.Servers}`,
|
|
93
|
+
component: () => import("./CollectionServers-BWkIGwz4.js")
|
|
94
|
+
}]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "collection.environment",
|
|
98
|
+
path: "environment",
|
|
99
|
+
component: () => import("./CollectionEnvironment-dwisJ-h5.js")
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "collection.authentication",
|
|
103
|
+
path: "authentication",
|
|
104
|
+
component: () => import("./CollectionAuthentication-BDpvv8cA.js")
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "collection.cookies",
|
|
108
|
+
path: "cookies",
|
|
109
|
+
component: () => import("./CollectionCookies-DyjPPMdt.js")
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "collection.scripts",
|
|
113
|
+
path: "scripts",
|
|
114
|
+
component: () => import("./CollectionScripts-CMNlBlby.js")
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "collection.sync",
|
|
118
|
+
path: "sync",
|
|
119
|
+
component: () => import("./CollectionSync-CAflc5yW.js")
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: "collection.settings",
|
|
123
|
+
path: "settings",
|
|
124
|
+
component: () => import("./CollectionSettings-CqUUYOym.js")
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}];
|
|
130
|
+
/** Routes required by the API client modal */
|
|
131
|
+
var modalRoutes = [
|
|
132
|
+
{
|
|
133
|
+
name: "root",
|
|
134
|
+
path: "/",
|
|
135
|
+
redirect: redirectToActiveWorkspace
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "workspace.default",
|
|
139
|
+
path: "/workspace",
|
|
140
|
+
redirect: {
|
|
141
|
+
name: "workspace",
|
|
142
|
+
params: { [PathId.Workspace]: "default" }
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "workspace",
|
|
147
|
+
path: `/workspace/:${PathId.Workspace}`,
|
|
148
|
+
redirect: { name: "request.root" },
|
|
149
|
+
children: requestRoutes
|
|
150
|
+
}
|
|
151
|
+
];
|
|
152
|
+
/** Routes for the API client app */
|
|
153
|
+
var routes = [
|
|
154
|
+
{
|
|
155
|
+
name: "root",
|
|
156
|
+
path: "/",
|
|
157
|
+
redirect: redirectToActiveWorkspace
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: "workspace.default",
|
|
161
|
+
path: "/workspace",
|
|
162
|
+
redirect: {
|
|
163
|
+
name: "request.root",
|
|
164
|
+
params: { [PathId.Workspace]: "default" }
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "workspace",
|
|
169
|
+
path: `/workspace/:${PathId.Workspace}`,
|
|
170
|
+
redirect: { name: "request.root" },
|
|
171
|
+
children: [
|
|
172
|
+
...requestRoutes,
|
|
173
|
+
{
|
|
174
|
+
name: "environment.default",
|
|
175
|
+
path: "environment",
|
|
176
|
+
redirect: (to, _from) => ({
|
|
177
|
+
name: "environment",
|
|
178
|
+
params: {
|
|
179
|
+
...to.params,
|
|
180
|
+
[PathId.Environment]: "default"
|
|
181
|
+
}
|
|
182
|
+
})
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: "environment",
|
|
186
|
+
path: `environment/:${PathId.Environment}`,
|
|
187
|
+
component: () => import("./Environment-D_CbZk0A.js")
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: "environment.collection",
|
|
191
|
+
path: `environment/:${PathId.Collection}/:${PathId.Environment}`,
|
|
192
|
+
component: () => import("./Environment-D_CbZk0A.js"),
|
|
193
|
+
props: true
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "cookies.default",
|
|
197
|
+
path: "cookies",
|
|
198
|
+
redirect: (to, _from) => ({
|
|
199
|
+
name: "cookies",
|
|
200
|
+
params: {
|
|
201
|
+
...to.params,
|
|
202
|
+
[PathId.Cookies]: "default"
|
|
203
|
+
}
|
|
204
|
+
})
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "cookies",
|
|
208
|
+
path: `cookies/:${PathId.Cookies}`,
|
|
209
|
+
component: () => import("./Cookies-CNRSxP8J.js")
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "servers.default",
|
|
213
|
+
path: "servers",
|
|
214
|
+
redirect: (to, _from) => ({
|
|
215
|
+
name: "servers",
|
|
216
|
+
params: {
|
|
217
|
+
...to.params,
|
|
218
|
+
[PathId.Collection]: "default",
|
|
219
|
+
[PathId.Servers]: "default"
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: "settings.default",
|
|
225
|
+
path: "settings",
|
|
226
|
+
redirect: (to, _from) => ({
|
|
227
|
+
name: "settings",
|
|
228
|
+
params: {
|
|
229
|
+
...to.params,
|
|
230
|
+
[PathId.Settings]: "general"
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "settings",
|
|
236
|
+
path: `settings/:${PathId.Settings}`,
|
|
237
|
+
component: () => import("./Settings-BuLKHzRY.js")
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
];
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/store/router-params.ts
|
|
244
|
+
/** Getter function for router parameters */
|
|
245
|
+
function getRouterParams(router) {
|
|
246
|
+
return () => {
|
|
247
|
+
const pathParams = {
|
|
248
|
+
[PathId.Collection]: "default",
|
|
249
|
+
[PathId.Environment]: "default",
|
|
250
|
+
[PathId.Request]: "default",
|
|
251
|
+
[PathId.Examples]: "default",
|
|
252
|
+
[PathId.Schema]: "default",
|
|
253
|
+
[PathId.Cookies]: "default",
|
|
254
|
+
[PathId.Servers]: "default",
|
|
255
|
+
[PathId.Workspace]: "default",
|
|
256
|
+
[PathId.Settings]: "default"
|
|
257
|
+
};
|
|
258
|
+
const currentRoute = router?.currentRoute.value;
|
|
259
|
+
if (currentRoute) Object.keys(pathParams).forEach((k) => {
|
|
260
|
+
if (currentRoute.params[k]) pathParams[k] = currentRoute.params[k];
|
|
261
|
+
});
|
|
262
|
+
return pathParams;
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/store/active-entities.ts
|
|
267
|
+
/**
|
|
268
|
+
* Create the active entities store
|
|
269
|
+
*
|
|
270
|
+
* We need the factory function to pass the router instance
|
|
271
|
+
*/
|
|
272
|
+
var createActiveEntitiesStore = ({ collections, requestExamples, requests, router, servers, workspaces }) => {
|
|
273
|
+
/** Gives the required UID usually per route */
|
|
274
|
+
const activeRouterParams = computed(getRouterParams(router));
|
|
275
|
+
/** The currently selected workspace OR the first one */
|
|
276
|
+
const activeWorkspace = computed(() => workspaces[activeRouterParams.value[PathId.Workspace]] ?? Object.values(workspaces)[0]);
|
|
277
|
+
/** Ordered list of the active workspace's collections with drafts last */
|
|
278
|
+
const activeWorkspaceCollections = computed(() => activeWorkspace.value?.collections.map((uid) => collections[uid]).filter(isDefined).sort((a, b) => {
|
|
279
|
+
if (a.info?.title === "Drafts") return 1;
|
|
280
|
+
if (b.info?.title === "Drafts") return -1;
|
|
281
|
+
return 0;
|
|
282
|
+
}) ?? []);
|
|
283
|
+
/** Simplified list of servers in the workspace for displaying */
|
|
284
|
+
const activeWorkspaceServers = computed(() => activeWorkspaceCollections.value?.flatMap((collection) => collection.servers.map((uid) => servers[uid])));
|
|
285
|
+
/** Simplified list of requests in the workspace for displaying */
|
|
286
|
+
const activeWorkspaceRequests = computed(() => activeWorkspaceCollections.value?.flatMap((collection) => collection.requests) ?? []);
|
|
287
|
+
/** The currently selected environment */
|
|
288
|
+
const activeEnvironment = computed(() => {
|
|
289
|
+
if (!activeWorkspace.value?.activeEnvironmentId) return environmentSchema.parse({
|
|
290
|
+
uid: "default",
|
|
291
|
+
color: "#FFFFFF",
|
|
292
|
+
name: "No Environment",
|
|
293
|
+
value: JSON.stringify(activeWorkspace.value?.environments, null, 2)
|
|
294
|
+
});
|
|
295
|
+
const activeEnvironmentCollection = activeWorkspaceCollections.value.find((c) => c["x-scalar-environments"]?.[activeWorkspace.value?.activeEnvironmentId ?? ""]);
|
|
296
|
+
if (activeEnvironmentCollection && activeWorkspace.value?.activeEnvironmentId) return environmentSchema.parse({
|
|
297
|
+
uid: activeWorkspace.value.activeEnvironmentId,
|
|
298
|
+
name: activeWorkspace.value.activeEnvironmentId,
|
|
299
|
+
value: JSON.stringify(activeEnvironmentCollection["x-scalar-environments"]?.[activeWorkspace.value?.activeEnvironmentId]?.variables, null, 2),
|
|
300
|
+
color: activeEnvironmentCollection["x-scalar-environments"]?.[activeWorkspace.value?.activeEnvironmentId]?.color || "#FFFFFF",
|
|
301
|
+
isDefault: false
|
|
302
|
+
});
|
|
303
|
+
return environmentSchema.parse({
|
|
304
|
+
uid: "default",
|
|
305
|
+
color: "#FFFFFF",
|
|
306
|
+
name: "No Environment",
|
|
307
|
+
value: JSON.stringify(activeWorkspace.value.environments, null, 2)
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
/**
|
|
311
|
+
* Request associated with the current route
|
|
312
|
+
*
|
|
313
|
+
* undefined must be handled as we may have no requests
|
|
314
|
+
*/
|
|
315
|
+
const activeRequest = computed(() => {
|
|
316
|
+
const key = activeRouterParams.value[PathId.Request];
|
|
317
|
+
const collection = collections[activeRouterParams.value.collection] || collections[activeWorkspace.value?.collections[0] ?? ""];
|
|
318
|
+
return requests[key] || requests[collection?.requests[0] ?? ""] || Object.values(requests)[0];
|
|
319
|
+
});
|
|
320
|
+
/** Grabs the currently active example using the path param */
|
|
321
|
+
const activeExample = computed(() => {
|
|
322
|
+
return requestExamples[activeRouterParams.value[PathId.Examples] === "default" ? activeRequest.value?.examples[0] || "" : activeRouterParams.value[PathId.Examples]];
|
|
323
|
+
});
|
|
324
|
+
/**
|
|
325
|
+
* First collection that the active request is in
|
|
326
|
+
*/
|
|
327
|
+
const activeCollection = computed(() => {
|
|
328
|
+
const collection = collections[activeRouterParams.value[PathId.Collection]];
|
|
329
|
+
if (collection) return collection;
|
|
330
|
+
const requestUid = activeRequest.value?.uid;
|
|
331
|
+
if (requestUid) return Object.values(collections).find((c) => c.requests?.includes(requestUid));
|
|
332
|
+
return collections[activeWorkspace.value?.collections[0] ?? collections[0]?.uid ?? ""];
|
|
333
|
+
});
|
|
334
|
+
/** The currently selected server in the addressBar */
|
|
335
|
+
const activeServer = computed(() => {
|
|
336
|
+
if (activeRequest.value?.selectedServerUid) {
|
|
337
|
+
const server = servers[activeRequest.value.selectedServerUid];
|
|
338
|
+
if (server) return server;
|
|
339
|
+
}
|
|
340
|
+
if (activeCollection.value?.selectedServerUid) {
|
|
341
|
+
const server = servers[activeCollection.value.selectedServerUid];
|
|
342
|
+
if (server) return server;
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
return {
|
|
346
|
+
activeCollection,
|
|
347
|
+
activeCookieId: computed(() => activeRouterParams.value[PathId.Cookies] === "default" ? activeWorkspace.value?.cookies[0] ?? "default" : activeRouterParams.value[PathId.Cookies]),
|
|
348
|
+
activeExample,
|
|
349
|
+
activeRequest,
|
|
350
|
+
activeRouterParams,
|
|
351
|
+
activeEnvironment,
|
|
352
|
+
activeServer,
|
|
353
|
+
activeWorkspace,
|
|
354
|
+
activeWorkspaceCollections,
|
|
355
|
+
activeWorkspaceServers,
|
|
356
|
+
activeEnvVariables: computed(() => {
|
|
357
|
+
const globalEnvironment = activeWorkspace.value?.environments ?? {};
|
|
358
|
+
const collectionEnvironment = activeEnvironment.value.uid ? JSON.parse(activeEnvironment.value.value) : {};
|
|
359
|
+
const globalEnvVars = flattenEnvVars(globalEnvironment).map(([key, value]) => ({
|
|
360
|
+
key,
|
|
361
|
+
value,
|
|
362
|
+
source: "global"
|
|
363
|
+
}));
|
|
364
|
+
const collectionEnvVars = flattenEnvVars(collectionEnvironment).map(([key, value]) => ({
|
|
365
|
+
key,
|
|
366
|
+
value,
|
|
367
|
+
source: "collection"
|
|
368
|
+
}));
|
|
369
|
+
const mergedEnvVars = /* @__PURE__ */ new Map();
|
|
370
|
+
collectionEnvVars.forEach((envVar) => {
|
|
371
|
+
mergedEnvVars.set(envVar.key, envVar);
|
|
372
|
+
});
|
|
373
|
+
globalEnvVars.forEach((envVar) => {
|
|
374
|
+
if (!mergedEnvVars.has(envVar.key)) mergedEnvVars.set(envVar.key, envVar);
|
|
375
|
+
});
|
|
376
|
+
return Array.from(mergedEnvVars.values());
|
|
377
|
+
}),
|
|
378
|
+
activeWorkspaceRequests
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
var ACTIVE_ENTITIES_SYMBOL = Symbol();
|
|
382
|
+
/**
|
|
383
|
+
* The active entities store
|
|
384
|
+
*
|
|
385
|
+
* This store returns anything related to the currently active entities
|
|
386
|
+
* The only reason this is a store and not a simple hook is due to storing the current router here
|
|
387
|
+
*
|
|
388
|
+
* @deprecated due to components being used outside of the client now, we should prop drill instead of this hook/store
|
|
389
|
+
*/
|
|
390
|
+
var useActiveEntities = () => {
|
|
391
|
+
const store = inject(ACTIVE_ENTITIES_SYMBOL);
|
|
392
|
+
if (!store) throw new Error("Active entities store not provided");
|
|
393
|
+
return store;
|
|
394
|
+
};
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region src/store/collections.ts
|
|
397
|
+
/** Initiate the workspace collections */
|
|
398
|
+
function createStoreCollections(useLocalStorage) {
|
|
399
|
+
const collections = reactive({});
|
|
400
|
+
return {
|
|
401
|
+
collections,
|
|
402
|
+
collectionMutators: mutationFactory(collections, reactive({}), useLocalStorage && LS_KEYS.COLLECTION)
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
/** Extended mutators and data for collections that required workspace access */
|
|
406
|
+
function extendedCollectionDataFactory({ requests, requestMutators, requestExamples, requestExampleMutators, workspaces, workspaceMutators, collections, collectionMutators, tagMutators, serverMutators }) {
|
|
407
|
+
const addCollection = (payload, workspaceUid) => {
|
|
408
|
+
const collection = collectionSchema.parse(payload);
|
|
409
|
+
const workspace = workspaces[workspaceUid];
|
|
410
|
+
if (workspace) workspaceMutators.edit(workspaceUid, "collections", [...workspace.collections, collection.uid]);
|
|
411
|
+
collectionMutators.add(collection);
|
|
412
|
+
return collection;
|
|
413
|
+
};
|
|
414
|
+
const deleteCollection = (collection, workspace) => {
|
|
415
|
+
if (!workspace.uid) return;
|
|
416
|
+
if (collections[collection.uid]?.info?.title === "Drafts") {
|
|
417
|
+
console.warn("The drafts collection cannot be deleted");
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
if (Object.values(collections).length === 1) {
|
|
421
|
+
console.warn("You must have at least one collection");
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
collection.tags.forEach((uid) => tagMutators.delete(uid));
|
|
425
|
+
collection.requests.forEach((uid) => {
|
|
426
|
+
const request = requests[uid];
|
|
427
|
+
if (!request) return;
|
|
428
|
+
requestMutators.delete(uid);
|
|
429
|
+
request.examples.forEach((e) => requestExamples[e] && requestExampleMutators.delete(e));
|
|
430
|
+
});
|
|
431
|
+
collection.servers.forEach((uid) => {
|
|
432
|
+
if (uid) serverMutators.delete(uid);
|
|
433
|
+
});
|
|
434
|
+
workspaceMutators.edit(workspace.uid, "collections", workspace.collections.filter((uid) => uid !== collection.uid));
|
|
435
|
+
collectionMutators.delete(collection.uid);
|
|
436
|
+
};
|
|
437
|
+
const addCollectionEnvironment = (environmentName, environment, collectionUid) => {
|
|
438
|
+
const collection = collections[collectionUid];
|
|
439
|
+
if (collection) {
|
|
440
|
+
const currentEnvironments = collection["x-scalar-environments"] || {};
|
|
441
|
+
collectionMutators.edit(collectionUid, "x-scalar-environments", {
|
|
442
|
+
...currentEnvironments,
|
|
443
|
+
[environmentName]: environment
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
const removeCollectionEnvironment = (environmentName, collectionUid) => {
|
|
448
|
+
const collection = collections[collectionUid];
|
|
449
|
+
if (collection) {
|
|
450
|
+
const currentEnvironments = collection["x-scalar-environments"] || {};
|
|
451
|
+
if (environmentName in currentEnvironments) {
|
|
452
|
+
delete currentEnvironments[environmentName];
|
|
453
|
+
collectionMutators.edit(collectionUid, "x-scalar-environments", currentEnvironments);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
return {
|
|
458
|
+
addCollection,
|
|
459
|
+
deleteCollection,
|
|
460
|
+
addCollectionEnvironment,
|
|
461
|
+
removeCollectionEnvironment
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/store/cookies.ts
|
|
466
|
+
/** Create cookie mutators for the workspace */
|
|
467
|
+
function createStoreCookies(useLocalStorage) {
|
|
468
|
+
const cookies = reactive({});
|
|
469
|
+
return {
|
|
470
|
+
cookies,
|
|
471
|
+
cookieMutators: mutationFactory(cookies, reactive({}), useLocalStorage && LS_KEYS.COOKIE)
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
//#endregion
|
|
475
|
+
//#region src/store/environment.ts
|
|
476
|
+
/** Generate reactive environments for the workspace */
|
|
477
|
+
function createStoreEnvironments(useLocalStorage) {
|
|
478
|
+
/** Initialize default environment */
|
|
479
|
+
const environments = reactive({});
|
|
480
|
+
const environmentMutators = mutationFactory(environments, reactive({}), useLocalStorage && LS_KEYS.ENVIRONMENT);
|
|
481
|
+
environmentMutators.add(environmentSchema.parse({
|
|
482
|
+
uid: "default",
|
|
483
|
+
name: "Default Environment",
|
|
484
|
+
color: "#FFFFFF",
|
|
485
|
+
value: JSON.stringify({ exampleKey: "exampleValue" }, null, 2),
|
|
486
|
+
isDefault: true
|
|
487
|
+
}));
|
|
488
|
+
return {
|
|
489
|
+
environments,
|
|
490
|
+
environmentMutators
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
/** Extended environment data factory where workspace access is needed */
|
|
494
|
+
function extendedEnvironmentDataFactory({ environmentMutators }) {
|
|
495
|
+
/** prevent deletion of the default environment */
|
|
496
|
+
const deleteEnvironment = (uid) => {
|
|
497
|
+
if (uid === "default") {
|
|
498
|
+
console.warn("Default environment cannot be deleted.");
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
environmentMutators.delete(uid);
|
|
502
|
+
};
|
|
503
|
+
return { deleteEnvironment };
|
|
504
|
+
}
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/libs/event-bus.ts
|
|
507
|
+
/**
|
|
508
|
+
* Creates a ClientEvent with a payload of type P
|
|
509
|
+
*
|
|
510
|
+
* Modified from `@vueuse/core/useEventBus`
|
|
511
|
+
* @see https://github.com/vueuse/vueuse/tree/v10.10.0/packages/core/useEventBus
|
|
512
|
+
*/
|
|
513
|
+
function createEventBus() {
|
|
514
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
515
|
+
function on(listener) {
|
|
516
|
+
listeners.add(listener);
|
|
517
|
+
const _off = () => off(listener);
|
|
518
|
+
return _off;
|
|
519
|
+
}
|
|
520
|
+
function once(listener) {
|
|
521
|
+
function _listener(...args) {
|
|
522
|
+
off(_listener);
|
|
523
|
+
listener(...args);
|
|
524
|
+
}
|
|
525
|
+
return on(_listener);
|
|
526
|
+
}
|
|
527
|
+
function off(listener) {
|
|
528
|
+
listeners.delete(listener);
|
|
529
|
+
}
|
|
530
|
+
function reset() {
|
|
531
|
+
listeners.clear();
|
|
532
|
+
}
|
|
533
|
+
function emit(payload) {
|
|
534
|
+
listeners?.forEach((v) => v(payload));
|
|
535
|
+
}
|
|
536
|
+
return {
|
|
537
|
+
on,
|
|
538
|
+
once,
|
|
539
|
+
off,
|
|
540
|
+
emit,
|
|
541
|
+
reset,
|
|
542
|
+
listeners: () => Array.from(listeners)
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
//#endregion
|
|
546
|
+
//#region src/store/events.ts
|
|
547
|
+
/** Create the store for the api client events */
|
|
548
|
+
function createStoreEvents() {
|
|
549
|
+
return {
|
|
550
|
+
executeRequest: createEventBus(),
|
|
551
|
+
focusAddressBar: createEventBus(),
|
|
552
|
+
cancelRequest: createEventBus(),
|
|
553
|
+
requestStatus: createEventBus(),
|
|
554
|
+
commandPalette: createEventBus(),
|
|
555
|
+
hotKeys: createEventBus()
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
//#endregion
|
|
559
|
+
//#region src/hooks/useClientConfig.ts
|
|
560
|
+
var CLIENT_CONFIGURATION_SYMBOL = Symbol();
|
|
561
|
+
/** Hook for easy access to the reference configuration */
|
|
562
|
+
var useClientConfig = () => inject(CLIENT_CONFIGURATION_SYMBOL, ref(apiClientConfigurationSchema.parse({})));
|
|
563
|
+
//#endregion
|
|
564
|
+
//#region src/libs/find-request.ts
|
|
565
|
+
/** Convert path string like '/planets/{planetId}' to regex pattern /\/planets/([^/]+)/ */
|
|
566
|
+
var pathToRegex = (path) => {
|
|
567
|
+
const regxStr = "^" + path.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\\\{([^}]+)\\\}/g, "([^/]+)") + "(\\?.*)?$";
|
|
568
|
+
return new RegExp(regxStr);
|
|
569
|
+
};
|
|
570
|
+
/**
|
|
571
|
+
* Takes a path and method and returns the request that matches the path and method while taking
|
|
572
|
+
* path params into account by converting to a regex. Will also return the path params if they exist.
|
|
573
|
+
*
|
|
574
|
+
* @example path can be /planets/{planetId} OR /planets/1
|
|
575
|
+
*/
|
|
576
|
+
var findRequestByPathMethod = (path, method, requests) => {
|
|
577
|
+
let pathParams = [];
|
|
578
|
+
return {
|
|
579
|
+
request: requests.find((r) => {
|
|
580
|
+
if (r.method.toLowerCase() !== method.toLowerCase()) return false;
|
|
581
|
+
if (r.path === path) return true;
|
|
582
|
+
const regex = pathToRegex(r.path);
|
|
583
|
+
const match = path.match(regex);
|
|
584
|
+
if (match) {
|
|
585
|
+
pathParams = match.slice(1).flatMap((value, index) => {
|
|
586
|
+
const key = r.path.split("{")[index + 1]?.split("}")[0];
|
|
587
|
+
if (!key) return [];
|
|
588
|
+
return [{
|
|
589
|
+
key,
|
|
590
|
+
value
|
|
591
|
+
}];
|
|
592
|
+
});
|
|
593
|
+
return true;
|
|
594
|
+
}
|
|
595
|
+
return false;
|
|
596
|
+
}),
|
|
597
|
+
pathParams
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
//#endregion
|
|
601
|
+
//#region src/libs/get-request-uid-by-path-method.ts
|
|
602
|
+
/**
|
|
603
|
+
* Get the request uid by path and method
|
|
604
|
+
*/
|
|
605
|
+
var getRequestUidByPathMethod = (requests, payload) => {
|
|
606
|
+
const { requestUid, method, path } = payload ?? {};
|
|
607
|
+
if (requestUid) return requestUid;
|
|
608
|
+
if (!path || !method) return Object.keys(requests)[0];
|
|
609
|
+
const requestsArray = Object.values(requests);
|
|
610
|
+
const exactMatch = requestsArray.find((item) => item.path.toLowerCase() === path.toLowerCase() && item.method.toLowerCase() === method.toLowerCase());
|
|
611
|
+
if (exactMatch) return exactMatch.uid;
|
|
612
|
+
const { request } = findRequestByPathMethod(path, method, requestsArray);
|
|
613
|
+
return request?.uid || Object.keys(requests)[0];
|
|
614
|
+
};
|
|
615
|
+
//#endregion
|
|
616
|
+
//#region src/libs/local-storage.ts
|
|
617
|
+
/** Loads the migrated resource into the mutator safely */
|
|
618
|
+
var loadResources = (resources, schema, add) => resources.forEach((payload) => {
|
|
619
|
+
const resource = schemaModel(payload, schema, false);
|
|
620
|
+
if (resource) add(resource);
|
|
621
|
+
});
|
|
622
|
+
/**
|
|
623
|
+
* Loads all resources from localStorage and applies any migrations, then loads into mutators
|
|
624
|
+
* We use the raw mutator.add here instead of the custom ones because we do NOT want any side effects
|
|
625
|
+
*
|
|
626
|
+
* Currently not working for workspace
|
|
627
|
+
*/
|
|
628
|
+
var loadAllResources = (mutators) => {
|
|
629
|
+
const { collectionMutators, cookieMutators, environmentMutators, tagMutators, requestExampleMutators, requestMutators, serverMutators, securitySchemeMutators, workspaceMutators } = mutators;
|
|
630
|
+
try {
|
|
631
|
+
const { collections, cookies, environments, requestExamples, requests, servers, securitySchemes, tags, workspaces } = migrator().arrays;
|
|
632
|
+
loadResources(collections, collectionSchema, collectionMutators.rawAdd);
|
|
633
|
+
loadResources(cookies, cookieSchema, cookieMutators.add);
|
|
634
|
+
loadResources(environments, environmentSchema, environmentMutators.add);
|
|
635
|
+
loadResources(requestExamples, requestExampleSchema, requestExampleMutators.rawAdd);
|
|
636
|
+
loadResources(requests, requestSchema, requestMutators.rawAdd);
|
|
637
|
+
loadResources(servers, serverSchema, serverMutators.rawAdd);
|
|
638
|
+
loadResources(securitySchemes, securitySchemeSchema, securitySchemeMutators.rawAdd);
|
|
639
|
+
loadResources(tags, tagSchema, tagMutators.rawAdd);
|
|
640
|
+
loadResources(workspaces, workspaceSchema, workspaceMutators.rawAdd);
|
|
641
|
+
localStorage.setItem(DATA_VERSION_LS_LEY, DATA_VERSION);
|
|
642
|
+
} catch (e) {
|
|
643
|
+
console.error(e);
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
//#endregion
|
|
647
|
+
//#region src/libs/create-client.ts
|
|
648
|
+
/**
|
|
649
|
+
* Sync method to create the api client vue app and store
|
|
650
|
+
*
|
|
651
|
+
* This method will NOT import the spec, just create the modal so you must use update/updateConfig before opening
|
|
652
|
+
*/
|
|
653
|
+
var createApiClient = ({ el, appComponent, configuration: _configuration = {}, isReadOnly = false, store: _store, persistData = true, mountOnInitialize = true, layout = "desktop", router }) => {
|
|
654
|
+
const configuration = ref(apiClientConfigurationSchema.parse(_configuration));
|
|
655
|
+
const store = _store || createWorkspaceStore({
|
|
656
|
+
proxyUrl: configuration.value.proxyUrl,
|
|
657
|
+
theme: configuration.value.theme,
|
|
658
|
+
showSidebar: configuration.value.showSidebar ?? true,
|
|
659
|
+
hideClientButton: configuration.value.hideClientButton ?? false,
|
|
660
|
+
_integration: configuration.value._integration,
|
|
661
|
+
useLocalStorage: persistData
|
|
662
|
+
});
|
|
663
|
+
const activeEntities = createActiveEntitiesStore({
|
|
664
|
+
...store,
|
|
665
|
+
router
|
|
666
|
+
});
|
|
667
|
+
const sidebarState = createSidebarState({ layout });
|
|
668
|
+
const pluginManager = createPluginManager({ plugins: configuration.value.plugins ?? [] });
|
|
669
|
+
const hasLocalStorage = () => {
|
|
670
|
+
try {
|
|
671
|
+
return typeof window !== "undefined" && window.localStorage !== void 0;
|
|
672
|
+
} catch {
|
|
673
|
+
return false;
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
if (hasLocalStorage() && localStorage.getItem(LS_KEYS.WORKSPACE) && !isReadOnly) try {
|
|
677
|
+
const size = {};
|
|
678
|
+
let _lsTotal = 0;
|
|
679
|
+
let _xLen = 0;
|
|
680
|
+
let _key = "";
|
|
681
|
+
for (_key in localStorage) {
|
|
682
|
+
if (!Object.hasOwn(localStorage, _key)) continue;
|
|
683
|
+
_xLen = (localStorage[_key].length + _key.length) * 2;
|
|
684
|
+
_lsTotal += _xLen;
|
|
685
|
+
size[_key] = (_xLen / 1024).toFixed(2) + " KB";
|
|
686
|
+
}
|
|
687
|
+
size["Total"] = (_lsTotal / 1024).toFixed(2) + " KB";
|
|
688
|
+
console.table(size);
|
|
689
|
+
loadAllResources(store);
|
|
690
|
+
} catch (error) {
|
|
691
|
+
console.warn("Failed to load from localStorage:", error);
|
|
692
|
+
}
|
|
693
|
+
else if (!isReadOnly && !configuration.value.url && !configuration.value.content) {
|
|
694
|
+
store.workspaceMutators.add({
|
|
695
|
+
uid: "default",
|
|
696
|
+
name: "Workspace",
|
|
697
|
+
proxyUrl: configuration.value.proxyUrl
|
|
698
|
+
});
|
|
699
|
+
if (hasLocalStorage()) try {
|
|
700
|
+
localStorage.setItem(DATA_VERSION_LS_LEY, DATA_VERSION);
|
|
701
|
+
} catch (error) {
|
|
702
|
+
console.warn("Failed to set localStorage version:", error);
|
|
703
|
+
}
|
|
704
|
+
} else {
|
|
705
|
+
const workspace = workspaceSchema.parse({
|
|
706
|
+
uid: "default",
|
|
707
|
+
name: "Workspace",
|
|
708
|
+
proxyUrl: configuration.value.proxyUrl
|
|
709
|
+
});
|
|
710
|
+
store.workspaceMutators.rawAdd(workspace);
|
|
711
|
+
}
|
|
712
|
+
const app = createApp(appComponent);
|
|
713
|
+
app.use(router);
|
|
714
|
+
app.provide(WORKSPACE_SYMBOL, store);
|
|
715
|
+
app.provide(LAYOUT_SYMBOL, layout);
|
|
716
|
+
app.provide(ACTIVE_ENTITIES_SYMBOL, activeEntities);
|
|
717
|
+
app.provide(SIDEBAR_SYMBOL, sidebarState);
|
|
718
|
+
app.provide(CLIENT_CONFIGURATION_SYMBOL, configuration);
|
|
719
|
+
app.provide(PLUGIN_MANAGER_SYMBOL, pluginManager);
|
|
720
|
+
app.config.idPrefix = "scalar-client";
|
|
721
|
+
const { collectionMutators, importSpecFile, importSpecFromUrl, modalState, requests, securitySchemes, securitySchemeMutators, servers, workspaceMutators, requestExampleMutators } = store;
|
|
722
|
+
const { activeCollection, activeWorkspace } = activeEntities;
|
|
723
|
+
const mount = (mountingEl = el) => {
|
|
724
|
+
if (!mountingEl) {
|
|
725
|
+
console.error("[@scalar/api-client-modal] Could not create the API client.", "Invalid HTML element provided.", "Read more: https://github.com/scalar/scalar/tree/main/packages/api-client");
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
app.mount(mountingEl);
|
|
729
|
+
};
|
|
730
|
+
if (mountOnInitialize) mount();
|
|
731
|
+
/** Route to the specified method and path */
|
|
732
|
+
const route = (payload) => {
|
|
733
|
+
const resolvedRequestUid = getRequestUidByPathMethod(requests, payload);
|
|
734
|
+
if (resolvedRequestUid) router.push({
|
|
735
|
+
name: "request",
|
|
736
|
+
query: payload?._source ? { source: payload._source } : {},
|
|
737
|
+
params: {
|
|
738
|
+
workspace: "default",
|
|
739
|
+
request: resolvedRequestUid
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
else console.warn("[@scalar/api-client] Could not find request for path and method", payload);
|
|
743
|
+
};
|
|
744
|
+
/** Reset the client store */
|
|
745
|
+
const resetStore = () => {
|
|
746
|
+
store.collectionMutators.reset();
|
|
747
|
+
store.requestMutators.reset();
|
|
748
|
+
store.requestExampleMutators.reset();
|
|
749
|
+
store.securitySchemeMutators.reset();
|
|
750
|
+
store.serverMutators.reset();
|
|
751
|
+
store.tagMutators.reset();
|
|
752
|
+
workspaceMutators.edit(activeWorkspace.value?.uid, "collections", []);
|
|
753
|
+
};
|
|
754
|
+
return {
|
|
755
|
+
app,
|
|
756
|
+
resetStore,
|
|
757
|
+
updateConfig: async (_newConfig) => {
|
|
758
|
+
const newConfig = apiClientConfigurationSchema.parse(_newConfig);
|
|
759
|
+
if (newConfig.url || newConfig.content || newConfig.servers || newConfig.authentication || newConfig.slug || newConfig.title || newConfig.baseServerURL || newConfig.proxyUrl || newConfig.showSidebar) {
|
|
760
|
+
resetStore();
|
|
761
|
+
/** Add any extra properties to the config */
|
|
762
|
+
const config = {
|
|
763
|
+
...newConfig,
|
|
764
|
+
useCollectionSecurity: isReadOnly
|
|
765
|
+
};
|
|
766
|
+
configuration.value = config;
|
|
767
|
+
if (newConfig.url) await importSpecFromUrl(newConfig.url, activeWorkspace.value?.uid ?? "default", config);
|
|
768
|
+
else if (newConfig.content) await importSpecFile(newConfig.content, activeWorkspace.value?.uid ?? "default", config);
|
|
769
|
+
else console.error("[@scalar/api-client-modal] Could not create the API client.", "Please provide an OpenAPI document: { url: \"…\" }", "Read more: https://github.com/scalar/scalar/tree/main/packages/api-client");
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
updateServer: (serverUrl) => {
|
|
773
|
+
const server = Object.values(servers).find((s) => s.url === serverUrl);
|
|
774
|
+
if (server && activeCollection.value) collectionMutators.edit(activeCollection.value?.uid, "selectedServerUid", server.uid);
|
|
775
|
+
},
|
|
776
|
+
onUpdateServer: (callback) => {
|
|
777
|
+
watch(() => activeCollection.value?.selectedServerUid, (uid) => {
|
|
778
|
+
const server = Object.values(servers).find((s) => s.uid === uid);
|
|
779
|
+
if (server?.url) callback(server.url);
|
|
780
|
+
});
|
|
781
|
+
},
|
|
782
|
+
updateAuth: ({ nameKey, propertyKey, value }) => {
|
|
783
|
+
const scheme = Object.values(securitySchemes).find((s) => s.nameKey === nameKey);
|
|
784
|
+
if (scheme) securitySchemeMutators.edit(scheme.uid, propertyKey, value);
|
|
785
|
+
},
|
|
786
|
+
route,
|
|
787
|
+
open: (payload) => {
|
|
788
|
+
const { method, path, requestUid } = payload ?? {};
|
|
789
|
+
if (method && path || requestUid) route(payload);
|
|
790
|
+
modalState.open = true;
|
|
791
|
+
},
|
|
792
|
+
mount,
|
|
793
|
+
modalState,
|
|
794
|
+
store,
|
|
795
|
+
updateExample: (exampleKey, operationId) => {
|
|
796
|
+
if (!exampleKey || !operationId) return;
|
|
797
|
+
const request = Object.values(requests).find(({ operationId: reqOperationId, path }) => reqOperationId === operationId || path === operationId);
|
|
798
|
+
if (!request) return;
|
|
799
|
+
const contentType = Object.keys(request.requestBody?.content || {})[0] || "";
|
|
800
|
+
const example = request.requestBody?.content?.[contentType]?.examples?.[exampleKey];
|
|
801
|
+
if (!example) return;
|
|
802
|
+
requestExampleMutators.edit(request.examples[0], "body.raw.value", prettyPrintJson(example.value));
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
//#endregion
|
|
807
|
+
//#region src/libs/env-helpers.ts
|
|
808
|
+
/** Gets the color of an environment with default fallback */
|
|
809
|
+
function getEnvColor(environment) {
|
|
810
|
+
return environment?.color || "#FFFFFF";
|
|
811
|
+
}
|
|
812
|
+
//#endregion
|
|
813
|
+
//#region src/libs/environment-parser.ts
|
|
814
|
+
/** Parses the active environment variables and extracts key-value pairs. */
|
|
815
|
+
function parseEnvVariables(activeEnvVariables) {
|
|
816
|
+
return activeEnvVariables.flatMap((variable) => {
|
|
817
|
+
if (variable.key === "value") try {
|
|
818
|
+
const parsedValue = JSON.parse(variable.value);
|
|
819
|
+
return Object.keys(parsedValue).map((key) => ({
|
|
820
|
+
key,
|
|
821
|
+
value: parsedValue[key],
|
|
822
|
+
source: variable.source
|
|
823
|
+
}));
|
|
824
|
+
} catch (_e) {}
|
|
825
|
+
return [variable];
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
//#endregion
|
|
829
|
+
//#region src/libs/isUrl.ts
|
|
830
|
+
/** Checks whether the given string is an URL */
|
|
831
|
+
function isUrl(input) {
|
|
832
|
+
if (!input) return false;
|
|
833
|
+
if (!(input.startsWith("http://") || input.startsWith("https://"))) return false;
|
|
834
|
+
return isValidUrl(input);
|
|
835
|
+
}
|
|
836
|
+
//#endregion
|
|
837
|
+
//#region src/libs/getOpenApiDocumentDetails.ts
|
|
838
|
+
/** Try to extract details from the info */
|
|
839
|
+
function tryGetInfo(info) {
|
|
840
|
+
return { title: typeof info?.title === "string" ? `${info?.title}` : void 0 };
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* Get the base Swagger/OpenAPI details from the given string
|
|
844
|
+
*/
|
|
845
|
+
function getOpenApiDocumentDetails(input) {
|
|
846
|
+
if (!input || isUrl(input)) return;
|
|
847
|
+
try {
|
|
848
|
+
const result = json.parse(input ?? "");
|
|
849
|
+
if (typeof result?.openapi === "string") return {
|
|
850
|
+
version: `OpenAPI ${result.openapi}`,
|
|
851
|
+
type: "json",
|
|
852
|
+
...tryGetInfo(result.info)
|
|
853
|
+
};
|
|
854
|
+
if (typeof result?.swagger === "string") return {
|
|
855
|
+
version: `Swagger ${result.swagger}`,
|
|
856
|
+
type: "json",
|
|
857
|
+
...tryGetInfo(result.info)
|
|
858
|
+
};
|
|
859
|
+
return;
|
|
860
|
+
} catch {}
|
|
861
|
+
try {
|
|
862
|
+
const result = yaml.parse(input ?? "");
|
|
863
|
+
if (typeof result?.openapi === "string") return {
|
|
864
|
+
version: `OpenAPI ${result.openapi}`,
|
|
865
|
+
type: "yaml",
|
|
866
|
+
...tryGetInfo(result.info)
|
|
867
|
+
};
|
|
868
|
+
if (typeof result?.swagger === "string") return {
|
|
869
|
+
version: `Swagger ${result.swagger}`,
|
|
870
|
+
type: "yaml",
|
|
871
|
+
...tryGetInfo(result.info)
|
|
872
|
+
};
|
|
873
|
+
return;
|
|
874
|
+
} catch {}
|
|
875
|
+
}
|
|
876
|
+
//#endregion
|
|
877
|
+
//#region src/libs/hot-keys.ts
|
|
878
|
+
/**
|
|
879
|
+
* These are unrelated to an input so they will still fire if we are in one,
|
|
880
|
+
* this is not for a textarea in which you should be able to use arrow keys, enter etc
|
|
881
|
+
*/
|
|
882
|
+
var inputHotkeys = [
|
|
883
|
+
"Escape",
|
|
884
|
+
"ArrowDown",
|
|
885
|
+
"ArrowUp",
|
|
886
|
+
"Enter",
|
|
887
|
+
"F1",
|
|
888
|
+
"F2",
|
|
889
|
+
"F3",
|
|
890
|
+
"F4",
|
|
891
|
+
"F5",
|
|
892
|
+
"F6",
|
|
893
|
+
"F7",
|
|
894
|
+
"F8",
|
|
895
|
+
"F9",
|
|
896
|
+
"F10",
|
|
897
|
+
"F11",
|
|
898
|
+
"F12"
|
|
899
|
+
];
|
|
900
|
+
/**
|
|
901
|
+
* Default set of keybindings
|
|
902
|
+
*
|
|
903
|
+
* Passing an empty object for hotkeys will disable them
|
|
904
|
+
*
|
|
905
|
+
* TODO we can add a merge or overwrite option
|
|
906
|
+
*
|
|
907
|
+
* The modifier can be set by the user but defaults to ctrl for windows/linux and meta for macos
|
|
908
|
+
*
|
|
909
|
+
* For the modifier key:
|
|
910
|
+
* - if you leave it blank it can be true or false
|
|
911
|
+
* - if you explicitly set it, the event must match ex: modifier false will not trigger if the modifier was pressed
|
|
912
|
+
*/
|
|
913
|
+
var DEFAULT_HOTKEYS = {
|
|
914
|
+
Escape: { event: "closeModal" },
|
|
915
|
+
Enter: {
|
|
916
|
+
event: "executeRequest",
|
|
917
|
+
modifiers: ["default"]
|
|
918
|
+
},
|
|
919
|
+
b: {
|
|
920
|
+
event: "toggleSidebar",
|
|
921
|
+
modifiers: ["default"]
|
|
922
|
+
},
|
|
923
|
+
k: {
|
|
924
|
+
event: "openCommandPalette",
|
|
925
|
+
modifiers: ["default"]
|
|
926
|
+
},
|
|
927
|
+
l: {
|
|
928
|
+
event: "focusAddressBar",
|
|
929
|
+
modifiers: ["default"]
|
|
930
|
+
}
|
|
931
|
+
};
|
|
932
|
+
/** Checks if we are in an "input" */
|
|
933
|
+
var isInput = (ev) => {
|
|
934
|
+
if (!(ev.target instanceof HTMLElement)) return false;
|
|
935
|
+
const target = ev.target;
|
|
936
|
+
if (target.tagName === "INPUT") return !inputHotkeys.includes(ev.key);
|
|
937
|
+
if (target.tagName === "TEXTAREA") return true;
|
|
938
|
+
if (target.getAttribute("contenteditable")) return true;
|
|
939
|
+
if (target.contentEditable === "true") return true;
|
|
940
|
+
return false;
|
|
941
|
+
};
|
|
942
|
+
var MODIFIER_DICT = {
|
|
943
|
+
Alt: "altKey",
|
|
944
|
+
Control: "ctrlKey",
|
|
945
|
+
Shift: "shiftKey",
|
|
946
|
+
Meta: "metaKey"
|
|
947
|
+
};
|
|
948
|
+
/** Converts our modifier config to the eventKey */
|
|
949
|
+
var getModifiers = (modifiers) => modifiers.map((modifier) => modifier === "default" ? isMacOS() ? "metaKey" : "ctrlKey" : MODIFIER_DICT[modifier]);
|
|
950
|
+
/**
|
|
951
|
+
* Global keydown handler for hotkeys
|
|
952
|
+
*
|
|
953
|
+
* This is the brain of the operation, we turn keybindings -> events
|
|
954
|
+
*/
|
|
955
|
+
var handleHotKeyDown = (ev, eventBus, { hotKeys = DEFAULT_HOTKEYS, modifiers = ["default"] } = {}) => {
|
|
956
|
+
const key = ev.key === " " ? "Space" : ev.key;
|
|
957
|
+
const hotKeyEvent = hotKeys[key];
|
|
958
|
+
if (hotKeyEvent) {
|
|
959
|
+
if (key === "Escape") eventBus.emit({ [hotKeyEvent.event]: ev });
|
|
960
|
+
else if (getModifiers(hotKeyEvent.modifiers || modifiers).every((mod) => ev[mod] === true)) eventBus.emit({ [hotKeyEvent.event]: ev });
|
|
961
|
+
else if (!isInput(ev) && hotKeyEvent.modifiers === void 0) eventBus.emit({ [hotKeyEvent.event]: ev });
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
//#endregion
|
|
965
|
+
//#region src/libs/postman.ts
|
|
966
|
+
/** Checks if the given content is a Postman collection */
|
|
967
|
+
function isPostmanCollection(content) {
|
|
968
|
+
try {
|
|
969
|
+
const parsed = JSON.parse(content);
|
|
970
|
+
return parsed.info?._postman_id !== void 0 && new URL(parsed.info?.schema).host === "schema.getpostman.com";
|
|
971
|
+
} catch (_error) {
|
|
972
|
+
return false;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
/** Converts a Postman collection JSON string to an OpenAPI JSON string */
|
|
976
|
+
function convertPostmanToOpenApi(postmanJson) {
|
|
977
|
+
try {
|
|
978
|
+
const openApiDoc = convert(JSON.parse(postmanJson));
|
|
979
|
+
return JSON.stringify(openApiDoc, null, 2);
|
|
980
|
+
} catch (_error) {
|
|
981
|
+
throw new Error("Failed to convert Postman collection to OpenAPI");
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
/** Extracts details from a Postman collection JSON string */
|
|
985
|
+
function getPostmanDocumentDetails(content) {
|
|
986
|
+
try {
|
|
987
|
+
if (isPostmanCollection(content)) {
|
|
988
|
+
const parsed = JSON.parse(content);
|
|
989
|
+
return {
|
|
990
|
+
type: "json",
|
|
991
|
+
title: parsed.info?.name || "Postman Collection",
|
|
992
|
+
version: parsed.info?.version || "1.0"
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
return null;
|
|
996
|
+
} catch {
|
|
997
|
+
return null;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
//#endregion
|
|
1001
|
+
//#region src/store/import-spec.ts
|
|
1002
|
+
/** Maps the specs by URL */
|
|
1003
|
+
var specDictionary = {};
|
|
1004
|
+
/** Generate the import functions from a store context */
|
|
1005
|
+
function importSpecFileFactory({ requestMutators, collectionMutators, serverMutators, tagMutators, securitySchemeMutators, requestExampleMutators, workspaceMutators, workspaces }) {
|
|
1006
|
+
const importSpecFile = async (_spec, workspaceUid, options = {}) => {
|
|
1007
|
+
const spec = toRaw(_spec);
|
|
1008
|
+
const workspaceEntities = await importSpecToWorkspace(spec, options);
|
|
1009
|
+
if (workspaceEntities.error) {
|
|
1010
|
+
console.group("IMPORT ERRORS");
|
|
1011
|
+
workspaceEntities.importWarnings.forEach((w) => console.warn(w));
|
|
1012
|
+
console.groupEnd();
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
if (options.documentUrl && typeof spec === "string") specDictionary[options.documentUrl] = {
|
|
1016
|
+
hash: createHash(spec),
|
|
1017
|
+
schema: workspaceEntities.schema
|
|
1018
|
+
};
|
|
1019
|
+
workspaceEntities.examples.forEach((e) => requestExampleMutators.add(e));
|
|
1020
|
+
workspaceEntities.requests.forEach((r) => requestMutators.add(r));
|
|
1021
|
+
workspaceEntities.tags.forEach((t) => tagMutators.add(t));
|
|
1022
|
+
workspaceEntities.servers.forEach((s) => serverMutators.add(s));
|
|
1023
|
+
workspaceEntities.securitySchemes.forEach((s) => securitySchemeMutators.add(s));
|
|
1024
|
+
collectionMutators.add(workspaceEntities.collection);
|
|
1025
|
+
workspaceMutators.edit(workspaceUid, "collections", [...workspaces[workspaceUid]?.collections ?? [], workspaceEntities.collection.uid]);
|
|
1026
|
+
return workspaceEntities;
|
|
1027
|
+
};
|
|
1028
|
+
/**
|
|
1029
|
+
* Function to fetch and import a spec from a URL
|
|
1030
|
+
*
|
|
1031
|
+
* returns true for success
|
|
1032
|
+
*/
|
|
1033
|
+
async function importSpecFromUrl(url, workspaceUid, { proxyUrl, ...options } = {}) {
|
|
1034
|
+
try {
|
|
1035
|
+
return [null, await importSpecFile(await fetchDocument(url, proxyUrl), workspaceUid, {
|
|
1036
|
+
documentUrl: url,
|
|
1037
|
+
...options
|
|
1038
|
+
})];
|
|
1039
|
+
} catch (error) {
|
|
1040
|
+
console.error("Failed to fetch spec from URL:", error);
|
|
1041
|
+
return [normalizeError(error), null];
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
return {
|
|
1045
|
+
importSpecFile,
|
|
1046
|
+
importSpecFromUrl
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
//#endregion
|
|
1050
|
+
//#region src/store/request-example.ts
|
|
1051
|
+
/** Create top level examples storage for the workspace */
|
|
1052
|
+
function createStoreRequestExamples(useLocalStorage) {
|
|
1053
|
+
/**
|
|
1054
|
+
* Each request has multiple examples associated with it
|
|
1055
|
+
* An example is a set of request params that is saved to the example
|
|
1056
|
+
* Multiple test cases can each be saved as an example and switched between
|
|
1057
|
+
*/
|
|
1058
|
+
const requestExamples = reactive({});
|
|
1059
|
+
return {
|
|
1060
|
+
requestExamples,
|
|
1061
|
+
requestExampleMutators: mutationFactory(requestExamples, reactive({}), useLocalStorage && LS_KEYS.REQUEST_EXAMPLE)
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
/** Extended example data that needs store context */
|
|
1065
|
+
function extendedExampleDataFactory({ requestExamples, requestExampleMutators, requestMutators, requests }) {
|
|
1066
|
+
/** Ensure we add to the base examples as well as the request it is in */
|
|
1067
|
+
const addRequestExample = (request, _name) => {
|
|
1068
|
+
const example = createExampleFromRequest(request, _name ?? iterateTitle((request.summary ?? "Example") + " #1", (t) => request.examples.some((uid) => requestExamples[uid]?.name === t)));
|
|
1069
|
+
requestExampleMutators.add(example);
|
|
1070
|
+
requestMutators.edit(request.uid, "examples", [...request.examples, example.uid]);
|
|
1071
|
+
return example;
|
|
1072
|
+
};
|
|
1073
|
+
/** Ensure we remove from the base as well as from the request it is in */
|
|
1074
|
+
const deleteRequestExample = (requestExample) => {
|
|
1075
|
+
if (!requestExample.requestUid) return;
|
|
1076
|
+
requestMutators.edit(requestExample.requestUid, "examples", requests[requestExample.requestUid]?.examples.filter((uid) => uid !== requestExample.uid) || []);
|
|
1077
|
+
requestExampleMutators.delete(requestExample.uid);
|
|
1078
|
+
};
|
|
1079
|
+
return {
|
|
1080
|
+
addRequestExample,
|
|
1081
|
+
deleteRequestExample
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
//#endregion
|
|
1085
|
+
//#region src/store/requests.ts
|
|
1086
|
+
/** Create top level request handlers for a workspace */
|
|
1087
|
+
function createStoreRequests(useLocalStorage) {
|
|
1088
|
+
/** Local list of all requests (will be associated with a database collection) */
|
|
1089
|
+
const requests = reactive({});
|
|
1090
|
+
return {
|
|
1091
|
+
requests,
|
|
1092
|
+
requestMutators: mutationFactory(requests, reactive({}), useLocalStorage && LS_KEYS.REQUEST)
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Create the extended mutators for request where access to the workspace is required
|
|
1097
|
+
*/
|
|
1098
|
+
function extendedRequestDataFactory({ requestExamples, requestExampleMutators, requestMutators, collectionMutators, collections, tags, tagMutators }, addTag) {
|
|
1099
|
+
/** Add request */
|
|
1100
|
+
const addRequest = (payload, collectionUid) => {
|
|
1101
|
+
const request = schemaModel(payload, requestSchema, false);
|
|
1102
|
+
if (!request) return console.error("INVALID REQUEST DATA", payload);
|
|
1103
|
+
const collection = collections[collectionUid];
|
|
1104
|
+
const example = createExampleFromRequest(request, iterateTitle((request.summary ?? "Example") + " #1", (t) => request.examples.some((uid) => t === requestExamples[uid]?.name)));
|
|
1105
|
+
request.examples.push(example.uid);
|
|
1106
|
+
requestMutators.add(request);
|
|
1107
|
+
requestExampleMutators.add(example);
|
|
1108
|
+
if (collection) collectionMutators.edit(collectionUid, "requests", [...collection.requests, request.uid]);
|
|
1109
|
+
if (request.tags?.length) request.tags.forEach((tagName) => {
|
|
1110
|
+
const tagUid = collection?.tags.find((uid) => tags[uid]?.name === tagName);
|
|
1111
|
+
if (tagUid && tags[tagUid]) tagMutators.edit(tagUid, "children", [...tags[tagUid].children, request.uid]);
|
|
1112
|
+
else addTag({
|
|
1113
|
+
name: tagName,
|
|
1114
|
+
children: [request.uid]
|
|
1115
|
+
}, collectionUid);
|
|
1116
|
+
});
|
|
1117
|
+
else if (collection) collectionMutators.edit(collectionUid, "children", [...collection.children, request.uid]);
|
|
1118
|
+
return request;
|
|
1119
|
+
};
|
|
1120
|
+
/** Delete request */
|
|
1121
|
+
const deleteRequest = (request, collectionUid) => {
|
|
1122
|
+
const collection = collections[collectionUid];
|
|
1123
|
+
request.examples.forEach((uid) => requestExampleMutators.delete(uid));
|
|
1124
|
+
if (collection) {
|
|
1125
|
+
collectionMutators.edit(collectionUid, "requests", collection.requests.filter((r) => r !== request.uid));
|
|
1126
|
+
collectionMutators.edit(collectionUid, "children", collection.children.filter((r) => r !== request.uid));
|
|
1127
|
+
request.tags?.forEach((tagName) => {
|
|
1128
|
+
const tagUid = collection.tags.find((uid) => tags[uid]?.name === tagName);
|
|
1129
|
+
if (!tagUid) return;
|
|
1130
|
+
tagMutators.edit(tagUid, "children", tags[tagUid]?.children.filter((r) => r !== request.uid) || []);
|
|
1131
|
+
});
|
|
1132
|
+
}
|
|
1133
|
+
requestMutators.delete(request.uid);
|
|
1134
|
+
};
|
|
1135
|
+
return {
|
|
1136
|
+
addRequest,
|
|
1137
|
+
deleteRequest,
|
|
1138
|
+
findRequestParents: findRequestParentsFactory({
|
|
1139
|
+
collections,
|
|
1140
|
+
tags
|
|
1141
|
+
})
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
/** Factory function to allow testing of the function */
|
|
1145
|
+
function findRequestParentsFactory({ collections, tags }) {
|
|
1146
|
+
/** Recursively find all parent folders (tags and collections) of a request */
|
|
1147
|
+
function findRequestParentss(r) {
|
|
1148
|
+
const collection = Object.values(collections).find((c) => c.requests?.includes(r.uid));
|
|
1149
|
+
if (!collection) return [];
|
|
1150
|
+
const tagChildren = Object.keys(tags).reduce((obj, uid) => {
|
|
1151
|
+
obj[uid] = [];
|
|
1152
|
+
return obj;
|
|
1153
|
+
}, { [collection?.uid]: [] });
|
|
1154
|
+
function addChildren(current, parentUids) {
|
|
1155
|
+
parentUids.forEach((p) => tagChildren[p]?.push(...current.children));
|
|
1156
|
+
current.children.forEach((t) => {
|
|
1157
|
+
if (tags[t]) addChildren(tags[t], [...parentUids, t]);
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
addChildren(collection, [collection.uid]);
|
|
1161
|
+
const parents = /* @__PURE__ */ new Set();
|
|
1162
|
+
Object.entries(tagChildren).forEach(([tagUid, totalChildren]) => {
|
|
1163
|
+
if (totalChildren.includes(r.uid)) parents.add(tagUid);
|
|
1164
|
+
});
|
|
1165
|
+
return [...parents];
|
|
1166
|
+
}
|
|
1167
|
+
return findRequestParentss;
|
|
1168
|
+
}
|
|
1169
|
+
/** First draft request" */
|
|
1170
|
+
function createInitialRequest() {
|
|
1171
|
+
return { request: requestSchema.parse({
|
|
1172
|
+
method: "get",
|
|
1173
|
+
parameters: [],
|
|
1174
|
+
path: "",
|
|
1175
|
+
summary: "My First Request",
|
|
1176
|
+
examples: []
|
|
1177
|
+
}) };
|
|
1178
|
+
}
|
|
1179
|
+
//#endregion
|
|
1180
|
+
//#region src/store/security-schemes.ts
|
|
1181
|
+
/** Create storage entities for security schemes */
|
|
1182
|
+
function createStoreSecuritySchemes(useLocalStorage) {
|
|
1183
|
+
const securitySchemes = reactive({});
|
|
1184
|
+
return {
|
|
1185
|
+
securitySchemes,
|
|
1186
|
+
securitySchemeMutators: mutationFactory(securitySchemes, reactive({}), useLocalStorage && LS_KEYS.SECURITY_SCHEME)
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1189
|
+
/** Extended mutators and data for security schemas */
|
|
1190
|
+
function extendedSecurityDataFactory({ securitySchemeMutators, collectionMutators, collections, requests, requestMutators }) {
|
|
1191
|
+
/** Adds a security scheme and appends it to either a collection or a request */
|
|
1192
|
+
const addSecurityScheme = (payload, collectionUid) => {
|
|
1193
|
+
const scheme = securitySchemeSchema.parse(payload);
|
|
1194
|
+
securitySchemeMutators.add(scheme);
|
|
1195
|
+
if (collectionUid && collections[collectionUid]) collectionMutators.edit(collectionUid, "securitySchemes", [...collections[collectionUid].securitySchemes, scheme.uid]);
|
|
1196
|
+
return scheme;
|
|
1197
|
+
};
|
|
1198
|
+
/** Delete a security scheme and remove the key from its corresponding parent */
|
|
1199
|
+
const deleteSecurityScheme = (schemeUid) => {
|
|
1200
|
+
Object.values(collections).forEach((c) => {
|
|
1201
|
+
if (c.securitySchemes.includes(schemeUid)) collectionMutators.edit(c.uid, "securitySchemes", c.securitySchemes.filter((s) => s !== schemeUid));
|
|
1202
|
+
});
|
|
1203
|
+
Object.values(requests).forEach((r) => {
|
|
1204
|
+
if (r.security?.some((s) => Object.keys(s).includes(schemeUid))) requestMutators.edit(r.uid, "security", requests[r.uid]?.security?.filter((s) => !Object.keys(s).includes(schemeUid)));
|
|
1205
|
+
if (r.selectedSecuritySchemeUids.flat().includes(schemeUid)) requestMutators.edit(r.uid, "selectedSecuritySchemeUids", r.selectedSecuritySchemeUids?.filter((uid) => {
|
|
1206
|
+
if (Array.isArray(uid)) return !uid.includes(schemeUid);
|
|
1207
|
+
return uid !== schemeUid;
|
|
1208
|
+
}));
|
|
1209
|
+
});
|
|
1210
|
+
securitySchemeMutators.delete(schemeUid);
|
|
1211
|
+
};
|
|
1212
|
+
return {
|
|
1213
|
+
addSecurityScheme,
|
|
1214
|
+
deleteSecurityScheme
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
//#endregion
|
|
1218
|
+
//#region src/store/servers.ts
|
|
1219
|
+
/** Create storage objects for servers */
|
|
1220
|
+
function createStoreServers(useLocalStorage) {
|
|
1221
|
+
const servers = reactive({});
|
|
1222
|
+
return {
|
|
1223
|
+
servers,
|
|
1224
|
+
serverMutators: mutationFactory(servers, reactive({}), useLocalStorage && LS_KEYS.SERVER)
|
|
1225
|
+
};
|
|
1226
|
+
}
|
|
1227
|
+
/** Extended mutators and data for servers */
|
|
1228
|
+
function extendedServerDataFactory({ serverMutators, collections, collectionMutators, requests, requestMutators }) {
|
|
1229
|
+
/**
|
|
1230
|
+
* Add a server
|
|
1231
|
+
* If the collectionUid is included it is added to the collection as well
|
|
1232
|
+
*/
|
|
1233
|
+
const addServer = (payload, parentUid) => {
|
|
1234
|
+
const server = serverSchema.parse(payload);
|
|
1235
|
+
if (collections[parentUid]) collectionMutators.edit(parentUid, "servers", [...collections[parentUid].servers, server.uid]);
|
|
1236
|
+
else if (requests[parentUid]) requestMutators.edit(parentUid, "servers", [...requests[parentUid].servers, server.uid]);
|
|
1237
|
+
serverMutators.add(server);
|
|
1238
|
+
return server;
|
|
1239
|
+
};
|
|
1240
|
+
/** Delete a server */
|
|
1241
|
+
const deleteServer = (serverUid, collectionUid) => {
|
|
1242
|
+
if (!collections[collectionUid]) return;
|
|
1243
|
+
collectionMutators.edit(collectionUid, "servers", collections[collectionUid].servers.filter((uid) => uid !== serverUid));
|
|
1244
|
+
serverMutators.delete(serverUid);
|
|
1245
|
+
};
|
|
1246
|
+
return {
|
|
1247
|
+
addServer,
|
|
1248
|
+
deleteServer
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
//#endregion
|
|
1252
|
+
//#region src/store/tags.ts
|
|
1253
|
+
/** Create cookie mutators for the workspace */
|
|
1254
|
+
function createStoreTags(useLocalStorage) {
|
|
1255
|
+
const tags = reactive({});
|
|
1256
|
+
return {
|
|
1257
|
+
tags,
|
|
1258
|
+
tagMutators: mutationFactory(tags, reactive({}), useLocalStorage && LS_KEYS.TAG)
|
|
1259
|
+
};
|
|
1260
|
+
}
|
|
1261
|
+
/**
|
|
1262
|
+
* Create the extended mutators for tag with side effects
|
|
1263
|
+
* TODO:
|
|
1264
|
+
* - tag nesting, add/remove into another tag
|
|
1265
|
+
*/
|
|
1266
|
+
function extendedTagDataFactory({ collectionMutators, collections, requests, requestMutators, tagMutators }) {
|
|
1267
|
+
/** Add tag */
|
|
1268
|
+
const addTag = (payload, collectionUid) => {
|
|
1269
|
+
const collection = collections[collectionUid];
|
|
1270
|
+
const tag = schemaModel(payload, tagSchema, false);
|
|
1271
|
+
if (!tag || !collection) return console.error("INVALID TAG DATA", payload);
|
|
1272
|
+
collectionMutators.edit(collectionUid, "tags", [...collection.tags, tag.uid]);
|
|
1273
|
+
collectionMutators.edit(collectionUid, "children", [...collection.children, tag.uid]);
|
|
1274
|
+
tagMutators.add(tag);
|
|
1275
|
+
return tag;
|
|
1276
|
+
};
|
|
1277
|
+
/** Delete Tag */
|
|
1278
|
+
const deleteTag = (tag, collectionUid) => {
|
|
1279
|
+
const collection = collections[collectionUid];
|
|
1280
|
+
if (!collection) return;
|
|
1281
|
+
collectionMutators.edit(collectionUid, "tags", collection.tags.filter((uid) => uid !== tag.uid));
|
|
1282
|
+
collectionMutators.edit(collectionUid, "children", collection.children.filter((uid) => uid !== tag.uid));
|
|
1283
|
+
tag.children.forEach((childUid) => {
|
|
1284
|
+
const request = requests[childUid];
|
|
1285
|
+
if (!request) return;
|
|
1286
|
+
const filteredTags = request.tags?.filter((tagName) => tagName !== tag.name);
|
|
1287
|
+
requestMutators.edit(request.uid, "tags", filteredTags);
|
|
1288
|
+
if (!filteredTags?.length && !collection.children.includes(childUid)) collectionMutators.edit(collectionUid, "children", [...collection.children, childUid]);
|
|
1289
|
+
});
|
|
1290
|
+
tagMutators.delete(tag.uid);
|
|
1291
|
+
};
|
|
1292
|
+
return {
|
|
1293
|
+
addTag,
|
|
1294
|
+
deleteTag
|
|
1295
|
+
};
|
|
1296
|
+
}
|
|
1297
|
+
//#endregion
|
|
1298
|
+
//#region src/store/workspace.ts
|
|
1299
|
+
/** Create storage for workspace entities */
|
|
1300
|
+
function createStoreWorkspaces(useLocalStorage) {
|
|
1301
|
+
/** Active workspace object (will be associated with an entry in the workspace collection) */
|
|
1302
|
+
const workspaces = reactive({});
|
|
1303
|
+
return {
|
|
1304
|
+
workspaces,
|
|
1305
|
+
workspaceMutators: mutationFactory(workspaces, reactive({}), useLocalStorage && LS_KEYS.WORKSPACE)
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
/** Workspace entities that require store context */
|
|
1309
|
+
function extendedWorkspaceDataFactory({ workspaces, workspaceMutators, collectionMutators, requestMutators, requestExampleMutators }) {
|
|
1310
|
+
const addWorkspace = (payload = {}) => {
|
|
1311
|
+
const { request } = createInitialRequest();
|
|
1312
|
+
const example = requestExampleSchema.parse({
|
|
1313
|
+
name: "Example",
|
|
1314
|
+
requestUid: request.uid
|
|
1315
|
+
});
|
|
1316
|
+
request.examples.push(example.uid);
|
|
1317
|
+
const collection = collectionSchema.parse({
|
|
1318
|
+
info: { title: "Drafts" },
|
|
1319
|
+
children: [request.uid],
|
|
1320
|
+
requests: [request.uid]
|
|
1321
|
+
});
|
|
1322
|
+
const workspace = workspaceSchema.parse({
|
|
1323
|
+
...payload,
|
|
1324
|
+
collections: [collection.uid]
|
|
1325
|
+
});
|
|
1326
|
+
requestExampleMutators.add(example);
|
|
1327
|
+
requestMutators.add(request);
|
|
1328
|
+
collectionMutators.add(collection);
|
|
1329
|
+
workspaceMutators.add(workspace);
|
|
1330
|
+
return workspace;
|
|
1331
|
+
};
|
|
1332
|
+
/** Prevent deletion of the default workspace */
|
|
1333
|
+
const deleteWorkspace = (uid) => {
|
|
1334
|
+
if (Object.keys(workspaces).length <= 1) {
|
|
1335
|
+
console.warn("The last workspace cannot be deleted.");
|
|
1336
|
+
return;
|
|
1337
|
+
}
|
|
1338
|
+
workspaceMutators.delete(uid);
|
|
1339
|
+
};
|
|
1340
|
+
return {
|
|
1341
|
+
addWorkspace,
|
|
1342
|
+
deleteWorkspace
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
//#endregion
|
|
1346
|
+
//#region src/store/store.ts
|
|
1347
|
+
/**
|
|
1348
|
+
* Factory function for creating the centralized store for the API client.
|
|
1349
|
+
*
|
|
1350
|
+
* This store manages all data and state for the application.
|
|
1351
|
+
* It should be instantiated once and injected into the app's root component.
|
|
1352
|
+
*/
|
|
1353
|
+
var createWorkspaceStore = ({ useLocalStorage = true, showSidebar = true, proxyUrl, theme, hideClientButton = false, _integration }) => {
|
|
1354
|
+
const { collections, collectionMutators } = createStoreCollections(useLocalStorage);
|
|
1355
|
+
const { tags, tagMutators } = createStoreTags(useLocalStorage);
|
|
1356
|
+
const { requests, requestMutators } = createStoreRequests(useLocalStorage);
|
|
1357
|
+
const { requestExamples, requestExampleMutators } = createStoreRequestExamples(useLocalStorage);
|
|
1358
|
+
const { cookies, cookieMutators } = createStoreCookies(useLocalStorage);
|
|
1359
|
+
const { environments, environmentMutators } = createStoreEnvironments(useLocalStorage);
|
|
1360
|
+
const { servers, serverMutators } = createStoreServers(useLocalStorage);
|
|
1361
|
+
const { securitySchemes, securitySchemeMutators } = createStoreSecuritySchemes(useLocalStorage);
|
|
1362
|
+
const { workspaces, workspaceMutators } = createStoreWorkspaces(useLocalStorage);
|
|
1363
|
+
const storeContext = {
|
|
1364
|
+
collections,
|
|
1365
|
+
collectionMutators,
|
|
1366
|
+
tags,
|
|
1367
|
+
tagMutators,
|
|
1368
|
+
requests,
|
|
1369
|
+
requestMutators,
|
|
1370
|
+
requestExamples,
|
|
1371
|
+
requestExampleMutators,
|
|
1372
|
+
cookies,
|
|
1373
|
+
cookieMutators,
|
|
1374
|
+
environments,
|
|
1375
|
+
environmentMutators,
|
|
1376
|
+
servers,
|
|
1377
|
+
serverMutators,
|
|
1378
|
+
securitySchemes,
|
|
1379
|
+
securitySchemeMutators,
|
|
1380
|
+
workspaces,
|
|
1381
|
+
workspaceMutators
|
|
1382
|
+
};
|
|
1383
|
+
const { addTag, deleteTag } = extendedTagDataFactory(storeContext);
|
|
1384
|
+
const { addRequest, deleteRequest, findRequestParents } = extendedRequestDataFactory(storeContext, addTag);
|
|
1385
|
+
const { deleteEnvironment } = extendedEnvironmentDataFactory(storeContext);
|
|
1386
|
+
const { addServer, deleteServer } = extendedServerDataFactory(storeContext);
|
|
1387
|
+
const { addCollection, deleteCollection } = extendedCollectionDataFactory(storeContext);
|
|
1388
|
+
const { addRequestExample, deleteRequestExample } = extendedExampleDataFactory(storeContext);
|
|
1389
|
+
const { addWorkspace, deleteWorkspace } = extendedWorkspaceDataFactory(storeContext);
|
|
1390
|
+
const { addSecurityScheme, deleteSecurityScheme } = extendedSecurityDataFactory(storeContext);
|
|
1391
|
+
const { addCollectionEnvironment, removeCollectionEnvironment } = extendedCollectionDataFactory(storeContext);
|
|
1392
|
+
/** Running request history list */
|
|
1393
|
+
const requestHistory = reactive([]);
|
|
1394
|
+
const { importSpecFile, importSpecFromUrl } = importSpecFileFactory(storeContext);
|
|
1395
|
+
/** Helper function to manage the sidebar width */
|
|
1396
|
+
const sidebarWidth = ref((useLocalStorage ? localStorage?.getItem("sidebarWidth") : void 0) || "280px");
|
|
1397
|
+
const setSidebarWidth = (width) => {
|
|
1398
|
+
sidebarWidth.value = width;
|
|
1399
|
+
if (useLocalStorage) localStorage?.setItem("sidebarWidth", width);
|
|
1400
|
+
};
|
|
1401
|
+
/** This state is to be used by the API Client Modal component to control the modal */
|
|
1402
|
+
const modalState = useModal();
|
|
1403
|
+
Object.values(workspaces).forEach(({ uid }) => {
|
|
1404
|
+
if (proxyUrl) workspaceMutators.edit(uid, "proxyUrl", proxyUrl);
|
|
1405
|
+
if (theme) workspaceMutators.edit(uid, "themeId", theme);
|
|
1406
|
+
});
|
|
1407
|
+
/**
|
|
1408
|
+
* For debugging purposes, expose this method for dumping the data stores
|
|
1409
|
+
*/
|
|
1410
|
+
if (typeof window !== "undefined") window.dataDump = () => ({
|
|
1411
|
+
collections: toRaw(collections),
|
|
1412
|
+
cookies: toRaw(cookies),
|
|
1413
|
+
environments: toRaw(environments),
|
|
1414
|
+
requestExamples: toRaw(requestExamples),
|
|
1415
|
+
requests: toRaw(requests),
|
|
1416
|
+
securitySchemes: toRaw(securitySchemes),
|
|
1417
|
+
servers: toRaw(servers),
|
|
1418
|
+
tags: toRaw(tags),
|
|
1419
|
+
workspaces: toRaw(workspaces)
|
|
1420
|
+
});
|
|
1421
|
+
return {
|
|
1422
|
+
workspaces,
|
|
1423
|
+
collections,
|
|
1424
|
+
tags,
|
|
1425
|
+
cookies,
|
|
1426
|
+
environments,
|
|
1427
|
+
requestExamples,
|
|
1428
|
+
requests,
|
|
1429
|
+
servers,
|
|
1430
|
+
securitySchemes,
|
|
1431
|
+
modalState,
|
|
1432
|
+
events: createStoreEvents(),
|
|
1433
|
+
sidebarWidth,
|
|
1434
|
+
setSidebarWidth,
|
|
1435
|
+
proxyUrl,
|
|
1436
|
+
hideClientButton,
|
|
1437
|
+
showSidebar,
|
|
1438
|
+
integration: _integration,
|
|
1439
|
+
importSpecFile,
|
|
1440
|
+
importSpecFromUrl,
|
|
1441
|
+
cookieMutators,
|
|
1442
|
+
collectionMutators: {
|
|
1443
|
+
...collectionMutators,
|
|
1444
|
+
rawAdd: collectionMutators.add,
|
|
1445
|
+
add: addCollection,
|
|
1446
|
+
delete: deleteCollection,
|
|
1447
|
+
addEnvironment: addCollectionEnvironment,
|
|
1448
|
+
removeEnvironment: removeCollectionEnvironment
|
|
1449
|
+
},
|
|
1450
|
+
environmentMutators: {
|
|
1451
|
+
...environmentMutators,
|
|
1452
|
+
delete: deleteEnvironment
|
|
1453
|
+
},
|
|
1454
|
+
requestMutators: {
|
|
1455
|
+
...requestMutators,
|
|
1456
|
+
rawAdd: requestMutators.add,
|
|
1457
|
+
add: addRequest,
|
|
1458
|
+
delete: deleteRequest
|
|
1459
|
+
},
|
|
1460
|
+
findRequestParents,
|
|
1461
|
+
requestExampleMutators: {
|
|
1462
|
+
...requestExampleMutators,
|
|
1463
|
+
rawAdd: requestExampleMutators.add,
|
|
1464
|
+
add: addRequestExample,
|
|
1465
|
+
delete: deleteRequestExample
|
|
1466
|
+
},
|
|
1467
|
+
requestHistory,
|
|
1468
|
+
securitySchemeMutators: {
|
|
1469
|
+
...securitySchemeMutators,
|
|
1470
|
+
rawAdd: securitySchemeMutators.add,
|
|
1471
|
+
add: addSecurityScheme,
|
|
1472
|
+
delete: deleteSecurityScheme
|
|
1473
|
+
},
|
|
1474
|
+
serverMutators: {
|
|
1475
|
+
...serverMutators,
|
|
1476
|
+
rawAdd: serverMutators.add,
|
|
1477
|
+
add: addServer,
|
|
1478
|
+
delete: deleteServer
|
|
1479
|
+
},
|
|
1480
|
+
tagMutators: {
|
|
1481
|
+
...tagMutators,
|
|
1482
|
+
rawAdd: tagMutators.add,
|
|
1483
|
+
add: addTag,
|
|
1484
|
+
delete: deleteTag
|
|
1485
|
+
},
|
|
1486
|
+
workspaceMutators: {
|
|
1487
|
+
...workspaceMutators,
|
|
1488
|
+
rawAdd: workspaceMutators.add,
|
|
1489
|
+
add: addWorkspace,
|
|
1490
|
+
delete: deleteWorkspace
|
|
1491
|
+
},
|
|
1492
|
+
addCollectionEnvironment,
|
|
1493
|
+
removeCollectionEnvironment
|
|
1494
|
+
};
|
|
1495
|
+
};
|
|
1496
|
+
/** Set as a string so that different instances of api-client can reference inject the same store */
|
|
1497
|
+
var WORKSPACE_SYMBOL = "WORKSPACE_SYMBOL";
|
|
1498
|
+
/**
|
|
1499
|
+
* Global hook which contains the store for the whole app
|
|
1500
|
+
*
|
|
1501
|
+
* The rawAdd methods are the mutator.add methods. Some add methods have been replaced when we need some side effects
|
|
1502
|
+
* ex: add examples when adding a request
|
|
1503
|
+
*/
|
|
1504
|
+
var useWorkspace = () => {
|
|
1505
|
+
const store = inject(WORKSPACE_SYMBOL);
|
|
1506
|
+
if (!store) throw new Error("Workspace store not provided");
|
|
1507
|
+
return store;
|
|
1508
|
+
};
|
|
1509
|
+
//#endregion
|
|
1510
|
+
export { createActiveEntitiesStore as C, routes as D, modalRoutes as E, saveActiveWorkspace as O, ACTIVE_ENTITIES_SYMBOL as S, PathId as T, createApiClient as _, specDictionary as a, useClientConfig as b, isPostmanCollection as c, handleHotKeyDown as d, isInput as f, getEnvColor as g, parseEnvVariables as h, createInitialRequest as i, DEFAULT_HOTKEYS as l, isUrl as m, createWorkspaceStore as n, convertPostmanToOpenApi as o, getOpenApiDocumentDetails as p, useWorkspace as r, getPostmanDocumentDetails as s, WORKSPACE_SYMBOL as t, getModifiers as u, loadAllResources as v, useActiveEntities as w, createEventBus as x, findRequestByPathMethod as y };
|
|
1511
|
+
|
|
1512
|
+
//# sourceMappingURL=store-DaPoVtIS.js.map
|