@scalar/api-client 2.38.1 → 2.38.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/AddressBar-B4xnl66I.js +302 -0
- package/dist/AddressBar-B4xnl66I.js.map +1 -0
- package/dist/App-BVH4lIe8.js +533 -0
- package/dist/App-BVH4lIe8.js.map +1 -0
- package/dist/App-CvClwSlM.js +2510 -0
- package/dist/App-CvClwSlM.js.map +1 -0
- package/dist/CodeInput-C-igR77V.js +694 -0
- package/dist/CodeInput-C-igR77V.js.map +1 -0
- package/dist/CodeSnippet-D7Heh1nd.js +218 -0
- package/dist/CodeSnippet-D7Heh1nd.js.map +1 -0
- package/dist/Collection-4MT9WmDD.js +219 -0
- package/dist/Collection-4MT9WmDD.js.map +1 -0
- package/dist/CollectionAuthentication-MHWQpw74.js +56 -0
- package/dist/CollectionAuthentication-MHWQpw74.js.map +1 -0
- package/dist/CollectionCookies-DyjPPMdt.js +19 -0
- package/dist/CollectionCookies-DyjPPMdt.js.map +1 -0
- package/dist/CollectionEnvironment-Dw35vIqo.js +514 -0
- package/dist/CollectionEnvironment-Dw35vIqo.js.map +1 -0
- package/dist/CollectionOverview-TUdDIu5f.js +131 -0
- package/dist/CollectionOverview-TUdDIu5f.js.map +1 -0
- package/dist/CollectionScripts-CMNlBlby.js +19 -0
- package/dist/CollectionScripts-CMNlBlby.js.map +1 -0
- package/dist/CollectionServers-BrjTCfDe.js +168 -0
- package/dist/CollectionServers-BrjTCfDe.js.map +1 -0
- package/dist/CollectionSettings-HVSlp2Gv.js +87 -0
- package/dist/CollectionSettings-HVSlp2Gv.js.map +1 -0
- package/dist/CollectionSync-CAflc5yW.js +19 -0
- package/dist/CollectionSync-CAflc5yW.js.map +1 -0
- package/dist/CommandActionInput-TkcAx6E8.js +97 -0
- package/dist/CommandActionInput-TkcAx6E8.js.map +1 -0
- package/dist/CommandPalette-CL8k4CoN.js +964 -0
- package/dist/CommandPalette-CL8k4CoN.js.map +1 -0
- package/dist/CommandPaletteImport-Diu5dDIY.js +622 -0
- package/dist/CommandPaletteImport-Diu5dDIY.js.map +1 -0
- package/dist/Cookies-DbOKTi1f.js +284 -0
- package/dist/Cookies-DbOKTi1f.js.map +1 -0
- package/dist/DataTable-BqbZKW3K.js +62 -0
- package/dist/DataTable-BqbZKW3K.js.map +1 -0
- package/dist/DataTableHeader-DJVB0jCZ.js +21 -0
- package/dist/DataTableHeader-DJVB0jCZ.js.map +1 -0
- package/dist/DataTableInput-yaU5g-kP.js +166 -0
- package/dist/DataTableInput-yaU5g-kP.js.map +1 -0
- package/dist/DataTableRow-c3XveEUO.js +57 -0
- package/dist/DataTableRow-c3XveEUO.js.map +1 -0
- package/dist/DeleteSidebarListElement-C-p87d03.js +78 -0
- package/dist/DeleteSidebarListElement-C-p87d03.js.map +1 -0
- package/dist/EditSidebarListElement-CodWPnM6.js +32 -0
- package/dist/EditSidebarListElement-CodWPnM6.js.map +1 -0
- package/dist/Editor-BomsGWHx.js +909 -0
- package/dist/Editor-BomsGWHx.js.map +1 -0
- package/dist/EmptyState-Cnm7hGW5.js +46 -0
- package/dist/EmptyState-Cnm7hGW5.js.map +1 -0
- package/dist/Environment-DJatRQIg.js +416 -0
- package/dist/Environment-DJatRQIg.js.map +1 -0
- package/dist/EnvironmentModal-DBEJ4Kzj.js +288 -0
- package/dist/EnvironmentModal-DBEJ4Kzj.js.map +1 -0
- package/dist/Form-CSKzyHGO.js +83 -0
- package/dist/Form-CSKzyHGO.js.map +1 -0
- package/dist/HttpMethod-rnWEgC3T.js +78 -0
- package/dist/HttpMethod-rnWEgC3T.js.map +1 -0
- package/dist/IconSelector-BDC_GQXv.js +67 -0
- package/dist/IconSelector-BDC_GQXv.js.map +1 -0
- package/dist/ImportCollection-DfX1UQ5u.js +804 -0
- package/dist/ImportCollection-DfX1UQ5u.js.map +1 -0
- package/dist/IntegrationLogo-B9EDW8db.js +51 -0
- package/dist/IntegrationLogo-B9EDW8db.js.map +1 -0
- package/dist/MainLayout-BEFMl1ud.js +281 -0
- package/dist/MainLayout-BEFMl1ud.js.map +1 -0
- package/dist/Modal-sQ9vH6MN.js +67 -0
- package/dist/Modal-sQ9vH6MN.js.map +1 -0
- package/dist/ModalClientContainer-qHsZi4wQ.js +65 -0
- package/dist/ModalClientContainer-qHsZi4wQ.js.map +1 -0
- package/dist/Request-gscRsGQ8.js +212 -0
- package/dist/Request-gscRsGQ8.js.map +1 -0
- package/dist/RequestAuth-BzBfIysT.js +989 -0
- package/dist/RequestAuth-BzBfIysT.js.map +1 -0
- package/dist/RequestRoot-3Bj8JZD-.js +1611 -0
- package/dist/RequestRoot-3Bj8JZD-.js.map +1 -0
- package/dist/RequestSection-HhdJj9hW.js +1582 -0
- package/dist/RequestSection-HhdJj9hW.js.map +1 -0
- package/dist/ResponseSection-DMJ0tw8E.js +949 -0
- package/dist/ResponseSection-DMJ0tw8E.js.map +1 -0
- package/dist/ScalarAsciiArt-BjuSnj8e.js +45 -0
- package/dist/ScalarAsciiArt-BjuSnj8e.js.map +1 -0
- package/dist/SectionFilter-hrtoRLwj.js +99 -0
- package/dist/SectionFilter-hrtoRLwj.js.map +1 -0
- package/dist/Server-DnA_BzPS.js +303 -0
- package/dist/Server-DnA_BzPS.js.map +1 -0
- package/dist/ServerVariablesForm-BRZ9XC8o.js +145 -0
- package/dist/ServerVariablesForm-BRZ9XC8o.js.map +1 -0
- package/dist/Settings-CYZzdJPO.js +347 -0
- package/dist/Settings-CYZzdJPO.js.map +1 -0
- package/dist/Sidebar-C6AdX6-N.js +73 -0
- package/dist/Sidebar-C6AdX6-N.js.map +1 -0
- package/dist/SidebarButton-BAagdMDe.js +37 -0
- package/dist/SidebarButton-BAagdMDe.js.map +1 -0
- package/dist/SidebarListElement-BfTPiihc.js +232 -0
- package/dist/SidebarListElement-BfTPiihc.js.map +1 -0
- package/dist/TheCommandPalette-Dl9TAeke.js +204 -0
- package/dist/TheCommandPalette-Dl9TAeke.js.map +1 -0
- package/dist/ValueEmitter-QYkZ9Hdc.js +20 -0
- package/dist/ValueEmitter-QYkZ9Hdc.js.map +1 -0
- package/dist/ViewLayout-BOXN0IYo.js +17 -0
- package/dist/ViewLayout-BOXN0IYo.js.map +1 -0
- package/dist/ViewLayoutCollapse-CiTb-Uml.js +86 -0
- package/dist/ViewLayoutCollapse-CiTb-Uml.js.map +1 -0
- package/dist/ViewLayoutContent-CvMoJYPF.js +13 -0
- package/dist/ViewLayoutContent-CvMoJYPF.js.map +1 -0
- package/dist/ViewLayoutSection-mUqKbQry.js +23 -0
- package/dist/ViewLayoutSection-mUqKbQry.js.map +1 -0
- package/dist/WatchModeToggle-D_eAiTWJ.js +41 -0
- package/dist/WatchModeToggle-D_eAiTWJ.js.map +1 -0
- package/dist/_plugin-vue_export-helper-BmmBcIzD.js +8 -0
- package/dist/analytics-BZimCWcw.js +7 -0
- package/dist/analytics-BZimCWcw.js.map +1 -0
- package/dist/build-request-security-BQjNr2MD.js +41 -0
- package/dist/build-request-security-BQjNr2MD.js.map +1 -0
- package/dist/code-input-iq-moLxi.js +775 -0
- package/dist/code-input-iq-moLxi.js.map +1 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts +1 -1
- package/dist/components/AddressBar/index.d.ts +1 -1
- package/dist/components/AddressBar/index.js +5 -4
- package/dist/components/CodeInput/CodeInput.vue.d.ts +1 -1
- package/dist/components/CodeInput/codeVariableWidget.d.ts +1 -1
- package/dist/components/CodeInput/index.d.ts +1 -1
- package/dist/components/CodeInput/index.js +2 -4
- package/dist/components/CommandPalette/index.d.ts +1 -1
- package/dist/components/CommandPalette/index.js +3 -4
- package/dist/components/DataTable/DataTableInput.vue.d.ts +2 -2
- package/dist/components/DataTable/index.d.ts +8 -8
- package/dist/components/DataTable/index.js +6 -18
- package/dist/components/Form/LabelInput.vue.d.ts +1 -1
- package/dist/components/HttpMethod/index.d.ts +1 -1
- package/dist/components/HttpMethod/index.js +2 -4
- package/dist/components/ImportCollection/index.d.ts +1 -1
- package/dist/components/ImportCollection/index.js +2 -4
- package/dist/components/ImportCollection/utils/import-collection.d.ts +1 -1
- package/dist/components/ImportCollection/utils/workspace-store-is-empty.d.ts +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.d.ts +1 -1
- package/dist/components/Server/index.d.ts +3 -3
- package/dist/components/Server/index.js +3 -8
- package/dist/components/Sidebar/index.d.ts +1 -1
- package/dist/components/Sidebar/index.js +2 -4
- package/dist/components/ViewLayout/index.d.ts +1 -1
- package/dist/components/ViewLayout/index.js +2 -4
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +7 -8
- package/dist/components-CSxJTn6F.js +183 -0
- package/dist/components-CSxJTn6F.js.map +1 -0
- package/dist/components-ChixwQhN.js +61 -0
- package/dist/components-ChixwQhN.js.map +1 -0
- package/dist/computer-D7VW3Ruy.js +562 -0
- package/dist/computer-D7VW3Ruy.js.map +1 -0
- package/dist/consts-CyGRb9dl.js +318 -0
- package/dist/consts-CyGRb9dl.js.map +1 -0
- package/dist/curl-nbw1OxbV.js +54 -0
- package/dist/curl-nbw1OxbV.js.map +1 -0
- package/dist/data-table-PL7e8NRO.js +282 -0
- package/dist/data-table-PL7e8NRO.js.map +1 -0
- package/dist/editor-BZ_J0eze.js +466 -0
- package/dist/editor-BZ_J0eze.js.map +1 -0
- package/dist/environments-ByLK9lnC.js +592 -0
- package/dist/environments-ByLK9lnC.js.map +1 -0
- package/dist/formatters-DOGXZq9R.js +36 -0
- package/dist/formatters-DOGXZq9R.js.map +1 -0
- package/dist/forms-CZX6cFDS.js +42 -0
- package/dist/forms-CZX6cFDS.js.map +1 -0
- package/dist/get-active-environment-CkxyQ1dM.js +19 -0
- package/dist/get-active-environment-CkxyQ1dM.js.map +1 -0
- package/dist/get-resolved-url-BUCwrBzc.js +30 -0
- package/dist/get-resolved-url-BUCwrBzc.js.map +1 -0
- package/dist/get-server-url-o3On8CEr.js +32 -0
- package/dist/get-server-url-o3On8CEr.js.map +1 -0
- package/dist/get-servers-B_WNlQWB.js +106 -0
- package/dist/get-servers-B_WNlQWB.js.map +1 -0
- package/dist/get-snippet-DBRUSfZ2.js +39 -0
- package/dist/get-snippet-DBRUSfZ2.js.map +1 -0
- package/dist/global-cookies-D3ZS9ON3.js +184 -0
- package/dist/global-cookies-D3ZS9ON3.js.map +1 -0
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/index.js +3 -11
- package/dist/hooks/useSidebar.d.ts +1 -1
- package/dist/hooks-BvZxH4XB.js +80 -0
- package/dist/hooks-BvZxH4XB.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -12
- package/dist/layout-BWiL7dfb.js +81 -0
- package/dist/layout-BWiL7dfb.js.map +1 -0
- package/dist/layouts/App/create-api-client-app.d.ts +9 -9
- package/dist/layouts/App/index.d.ts +2 -2
- package/dist/layouts/App/index.js +5 -7
- package/dist/layouts/Modal/create-api-client-modal.d.ts +1 -1
- package/dist/layouts/Modal/index.d.ts +2 -2
- package/dist/layouts/Modal/index.js +3 -4
- package/dist/layouts/Web/create-api-client-web.d.ts +9 -9
- package/dist/layouts/Web/index.d.ts +2 -2
- package/dist/layouts/Web/index.js +101 -6
- package/dist/layouts/Web/index.js.map +1 -0
- package/dist/libs/create-client.d.ts +9 -9
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/environment-parser.d.ts +1 -1
- package/dist/libs/get-request-uid-by-path-method.d.ts +1 -1
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/libs/importers/index.d.ts +1 -1
- package/dist/libs/importers/index.js +2 -4
- package/dist/libs/index.d.ts +15 -15
- package/dist/libs/index.js +6 -45
- package/dist/libs/local-storage.d.ts +1 -1
- package/dist/libs/send-request/create-request-operation.d.ts +3 -3
- package/dist/libs/send-request/index.d.ts +3 -3
- package/dist/libs/send-request/index.js +3 -8
- package/dist/libs-spbv4P0g.js +249 -0
- package/dist/libs-spbv4P0g.js.map +1 -0
- package/dist/monacoeditorwork/json.worker.bundle.js +8 -8
- package/dist/monacoeditorwork/yaml.worker.bundle.js +151 -151
- package/dist/operation-block-BnMIKAOh.js +1624 -0
- package/dist/operation-block-BnMIKAOh.js.map +1 -0
- package/dist/operation-code-sample-ZUTueV3v.js +1726 -0
- package/dist/operation-code-sample-ZUTueV3v.js.map +1 -0
- package/dist/parse-curl-BtypQT3D.js +106 -0
- package/dist/parse-curl-BtypQT3D.js.map +1 -0
- package/dist/plugins/hooks/usePluginManager.d.ts +1 -1
- package/dist/plugins/index.d.ts +2 -2
- package/dist/plugins/index.js +2 -7
- package/dist/plugins/plugin-manager.d.ts +10 -4
- package/dist/plugins/plugin-manager.d.ts.map +1 -1
- package/dist/plugins-B52hCIyZ.js +50 -0
- package/dist/plugins-B52hCIyZ.js.map +1 -0
- package/dist/rabbitjump-CMZXAR6d.js +9 -0
- package/dist/rabbitjump-CMZXAR6d.js.map +1 -0
- package/dist/request-block-DwsGy64Q.js +1466 -0
- package/dist/request-block-DwsGy64Q.js.map +1 -0
- package/dist/resize-D2IYvVdh.js +114 -0
- package/dist/resize-D2IYvVdh.js.map +1 -0
- package/dist/response-block-DmkaDZYs.js +1188 -0
- package/dist/response-block-DmkaDZYs.js.map +1 -0
- package/dist/scalar-address-bar-block--Vs6IBU1.js +425 -0
- package/dist/scalar-address-bar-block--Vs6IBU1.js.map +1 -0
- package/dist/scalar-auth-selector-block-DI3DLag9.js +1886 -0
- package/dist/scalar-auth-selector-block-DI3DLag9.js.map +1 -0
- package/dist/search-CmsQQkjn.js +151 -0
- package/dist/search-CmsQQkjn.js.map +1 -0
- package/dist/send-request-BsTfRiBC.js +348 -0
- package/dist/send-request-BsTfRiBC.js.map +1 -0
- package/dist/server-tcI-OCyx.js +140 -0
- package/dist/server-tcI-OCyx.js.map +1 -0
- package/dist/set-request-cookies-BJJhsU4A.js +88 -0
- package/dist/set-request-cookies-BJJhsU4A.js.map +1 -0
- package/dist/settings-BKk_1lcH.js +455 -0
- package/dist/settings-BKk_1lcH.js.map +1 -0
- package/dist/sidebar-ceSbYmnt.js +217 -0
- package/dist/sidebar-ceSbYmnt.js.map +1 -0
- package/dist/store/collections.d.ts +1 -1
- package/dist/store/environment.d.ts +1 -1
- package/dist/store/events.d.ts +8 -8
- package/dist/store/import-spec.d.ts +2 -2
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +2 -10
- package/dist/store/request-example.d.ts +1 -1
- package/dist/store/requests.d.ts +1 -1
- package/dist/store/security-schemes.d.ts +1 -1
- package/dist/store/servers.d.ts +1 -1
- package/dist/store/store.d.ts +7 -7
- package/dist/store/tags.d.ts +1 -1
- package/dist/store/workspace.d.ts +1 -1
- package/dist/store-DpSUVhjp.js +1512 -0
- package/dist/store-DpSUVhjp.js.map +1 -0
- package/dist/string-template-sS5PtY6T.js +64 -0
- package/dist/string-template-sS5PtY6T.js.map +1 -0
- package/dist/style.css +10372 -1
- package/dist/types/index.js +0 -1
- package/dist/use-global-hot-keys-D8Ai8Qbm.js +274 -0
- package/dist/use-global-hot-keys-D8Ai8Qbm.js.map +1 -0
- package/dist/useSidebar-DLTwHDI-.js +45 -0
- package/dist/useSidebar-DLTwHDI-.js.map +1 -0
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +3 -3
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.d.ts +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -1
- package/dist/v2/blocks/operation-block/index.d.ts +4 -4
- package/dist/v2/blocks/operation-block/index.js +20 -11
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/index.d.ts +6 -6
- package/dist/v2/blocks/operation-code-sample/index.js +2 -16
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +4 -4
- package/dist/v2/blocks/request-block/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/fetch-openid-connect-discovery.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +4 -4
- package/dist/v2/blocks/scalar-auth-selector-block/index.js +6 -8
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +1 -1
- package/dist/v2/components/code-input/index.d.ts +1 -1
- package/dist/v2/components/code-input/index.js +2 -4
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +1 -1
- package/dist/v2/components/data-table/index.d.ts +8 -8
- package/dist/v2/components/data-table/index.js +3 -18
- package/dist/v2/components/forms/index.d.ts +1 -1
- package/dist/v2/components/forms/index.js +2 -4
- package/dist/v2/components/layout/index.d.ts +1 -1
- package/dist/v2/components/layout/index.js +2 -4
- package/dist/v2/components/modals/index.d.ts +1 -1
- package/dist/v2/components/modals/index.js +37 -3
- package/dist/v2/components/modals/index.js.map +1 -0
- package/dist/v2/components/resize/index.d.ts +2 -2
- package/dist/v2/components/resize/index.js +2 -6
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +1 -1
- package/dist/v2/components/server/index.d.ts +1 -1
- package/dist/v2/components/server/index.js +2 -4
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +1 -1
- package/dist/v2/components/sidebar/index.d.ts +3 -3
- package/dist/v2/components/sidebar/index.js +3 -8
- package/dist/v2/features/app/App.vue.d.ts +4 -4
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +1 -1
- package/dist/v2/features/app/components/index.d.ts +1 -1
- package/dist/v2/features/app/components/index.js +10 -5
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +3 -3
- package/dist/v2/features/app/helpers/get-route-param.d.ts +1 -1
- package/dist/v2/features/app/helpers/routes.d.ts +5 -5
- package/dist/v2/features/app/hooks/use-theme.d.ts +1 -1
- package/dist/v2/features/app/index.d.ts +8 -8
- package/dist/v2/features/app/index.js +3161 -19
- package/dist/v2/features/app/index.js.map +1 -0
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts +1 -1
- package/dist/v2/features/collection/OperationCollection.vue.d.ts +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Cookies.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Editor/Editor.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Editor/index.d.ts +1 -1
- package/dist/v2/features/collection/components/Editor/index.js +2 -4
- package/dist/v2/features/collection/components/Environment.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/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/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,1886 @@
|
|
|
1
|
+
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BmmBcIzD.js";
|
|
2
|
+
import { n as CommandActionForm_default, t as CommandActionInput_default } from "./CommandActionInput-TkcAx6E8.js";
|
|
3
|
+
import { n as DataTableCell_default, t as DataTableRow_default } from "./DataTableRow-c3XveEUO.js";
|
|
4
|
+
import { n as DataTableCheckbox_default } from "./DataTable-BqbZKW3K.js";
|
|
5
|
+
import { n as getEnvironmentVariables, t as getServerUrl } from "./get-server-url-o3On8CEr.js";
|
|
6
|
+
import { n as DataTableRow_default$1, o as DataTableCell_default$1, r as DataTableInput_default, s as DataTable_default } from "./data-table-PL7e8NRO.js";
|
|
7
|
+
import { t as CollapsibleSection_default } from "./layout-BWiL7dfb.js";
|
|
8
|
+
import { Fragment, capitalize, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useId, useModel, watch, withCtx, withModifiers } from "vue";
|
|
9
|
+
import { ScalarButton, ScalarComboboxMultiselect, ScalarIcon, ScalarIconButton, ScalarListboxCheckbox, ScalarMarkdownSummary, ScalarModal, ScalarSearchInput, useLoadingState, useModal } from "@scalar/components";
|
|
10
|
+
import { useToasts } from "@scalar/use-toasts";
|
|
11
|
+
import { pkceOptions } from "@scalar/oas-utils/entities/spec";
|
|
12
|
+
import { encode, fromUint8Array } from "js-base64";
|
|
13
|
+
import { redirectToProxy, shouldUseProxy } from "@scalar/helpers/url/redirect-to-proxy";
|
|
14
|
+
import { Disclosure, DisclosureButton, DisclosurePanel } from "@headlessui/vue";
|
|
15
|
+
import { ScalarIconCaretDown, ScalarIconTrash } from "@scalar/icons";
|
|
16
|
+
import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
17
|
+
import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
|
|
18
|
+
import { isObject } from "@scalar/helpers/object/is-object";
|
|
19
|
+
import { unpackProxyObject } from "@scalar/workspace-store/helpers/unpack-proxy";
|
|
20
|
+
import { objectEntries } from "@scalar/helpers/object/object-entries";
|
|
21
|
+
import { generateHash } from "@scalar/helpers/string/generate-hash";
|
|
22
|
+
import { isRelativePath } from "@scalar/helpers/url/is-relative-path";
|
|
23
|
+
import { makeUrlAbsolute } from "@scalar/helpers/url/make-url-absolute";
|
|
24
|
+
import { SecuritySchemeObjectSchema } from "@scalar/workspace-store/schemas/v3.1/strict/openapi-document";
|
|
25
|
+
import { Type } from "@scalar/typebox";
|
|
26
|
+
import { OpenIDConnectSchema } from "@scalar/workspace-store/entities/auth";
|
|
27
|
+
import { deepClone } from "@scalar/workspace-store/helpers/deep-clone";
|
|
28
|
+
import { mergeObjects } from "@scalar/workspace-store/helpers/merge-object";
|
|
29
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue?vue&type=script&setup=true&lang.ts
|
|
30
|
+
var _hoisted_1$8 = { class: "text-c-2 mb-4 text-sm leading-normal" };
|
|
31
|
+
var _hoisted_2$6 = { class: "flex justify-between gap-2" };
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue
|
|
34
|
+
var DeleteRequestAuthModal_default = /* @__PURE__ */ defineComponent({
|
|
35
|
+
__name: "DeleteRequestAuthModal",
|
|
36
|
+
props: {
|
|
37
|
+
state: {},
|
|
38
|
+
label: {}
|
|
39
|
+
},
|
|
40
|
+
emits: ["close", "delete"],
|
|
41
|
+
setup(__props, { emit: __emit }) {
|
|
42
|
+
const emit = __emit;
|
|
43
|
+
const deleteScheme = () => {
|
|
44
|
+
emit("delete");
|
|
45
|
+
};
|
|
46
|
+
return (_ctx, _cache) => {
|
|
47
|
+
return openBlock(), createBlock(unref(ScalarModal), {
|
|
48
|
+
size: "xxs",
|
|
49
|
+
state: __props.state,
|
|
50
|
+
title: "Delete Security Scheme"
|
|
51
|
+
}, {
|
|
52
|
+
default: withCtx(() => [createElementVNode("p", _hoisted_1$8, " This cannot be undone. You're about to delete the " + toDisplayString(__props.label) + " security scheme from the collection. ", 1), createElementVNode("div", _hoisted_2$6, [createVNode(unref(ScalarButton), {
|
|
53
|
+
class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
|
|
54
|
+
type: "button",
|
|
55
|
+
variant: "outlined",
|
|
56
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
|
|
57
|
+
}, {
|
|
58
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" Cancel ", -1)])]),
|
|
59
|
+
_: 1
|
|
60
|
+
}), createVNode(unref(ScalarButton), {
|
|
61
|
+
class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
|
|
62
|
+
type: "submit",
|
|
63
|
+
onClick: deleteScheme
|
|
64
|
+
}, {
|
|
65
|
+
default: withCtx(() => [createTextVNode(" Delete " + toDisplayString(__props.label), 1)]),
|
|
66
|
+
_: 1
|
|
67
|
+
})])]),
|
|
68
|
+
_: 1
|
|
69
|
+
}, 8, ["state"]);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.ts
|
|
75
|
+
/** Determines if the authentication is optional */
|
|
76
|
+
var isAuthOptional = (securityRequirements) => {
|
|
77
|
+
const hasComplexRequirement = securityRequirements.some((requirement) => Object.keys(requirement).length > 1);
|
|
78
|
+
return securityRequirements.some((requirement) => Object.keys(requirement).length === 0) && !hasComplexRequirement;
|
|
79
|
+
};
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/v2/blocks/scalar-auth-selector-block/helpers/auth-options.ts
|
|
82
|
+
/** Predefined authentication options */
|
|
83
|
+
var authOptions = {
|
|
84
|
+
apiKeyCookie: {
|
|
85
|
+
label: "API Key in Cookies",
|
|
86
|
+
payload: {
|
|
87
|
+
type: "apiKey",
|
|
88
|
+
in: "cookie",
|
|
89
|
+
name: "apiKeyCookie"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
apiKeyHeader: {
|
|
93
|
+
label: "API Key in Headers",
|
|
94
|
+
payload: {
|
|
95
|
+
type: "apiKey",
|
|
96
|
+
in: "header",
|
|
97
|
+
name: "apiKeyHeader"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
apiKeyQuery: {
|
|
101
|
+
label: "API Key in Query Params",
|
|
102
|
+
payload: {
|
|
103
|
+
type: "apiKey",
|
|
104
|
+
in: "query",
|
|
105
|
+
name: "apiKeyQuery"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
httpBasic: {
|
|
109
|
+
label: "HTTP Basic",
|
|
110
|
+
payload: {
|
|
111
|
+
type: "http",
|
|
112
|
+
scheme: "basic"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
httpBearer: {
|
|
116
|
+
label: "HTTP Bearer",
|
|
117
|
+
payload: {
|
|
118
|
+
type: "http",
|
|
119
|
+
scheme: "bearer"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
oauth2Implicit: {
|
|
123
|
+
label: "Oauth2 Implicit Flow",
|
|
124
|
+
payload: {
|
|
125
|
+
type: "oauth2",
|
|
126
|
+
flows: { implicit: {
|
|
127
|
+
authorizationUrl: "",
|
|
128
|
+
refreshUrl: "",
|
|
129
|
+
scopes: {}
|
|
130
|
+
} }
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
oauth2Password: {
|
|
134
|
+
label: "Oauth2 Password Flow",
|
|
135
|
+
payload: {
|
|
136
|
+
type: "oauth2",
|
|
137
|
+
flows: { password: {
|
|
138
|
+
tokenUrl: "",
|
|
139
|
+
refreshUrl: "",
|
|
140
|
+
scopes: {}
|
|
141
|
+
} }
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
oauth2ClientCredentials: {
|
|
145
|
+
label: "Oauth2 Client Credentials",
|
|
146
|
+
payload: {
|
|
147
|
+
type: "oauth2",
|
|
148
|
+
flows: { clientCredentials: {
|
|
149
|
+
tokenUrl: "",
|
|
150
|
+
refreshUrl: "",
|
|
151
|
+
scopes: {}
|
|
152
|
+
} }
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
oauth2AuthorizationFlow: {
|
|
156
|
+
label: "Oauth2 Authorization Code",
|
|
157
|
+
payload: {
|
|
158
|
+
type: "oauth2",
|
|
159
|
+
flows: { authorizationCode: {
|
|
160
|
+
authorizationUrl: "",
|
|
161
|
+
tokenUrl: "",
|
|
162
|
+
refreshUrl: "",
|
|
163
|
+
"x-usePkce": "no",
|
|
164
|
+
scopes: {}
|
|
165
|
+
} }
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.ts
|
|
171
|
+
/**
|
|
172
|
+
* Format a scheme object into a display object
|
|
173
|
+
*
|
|
174
|
+
* We also add a hash to the id to ensure it is unique across
|
|
175
|
+
* multiple requirements of the same scheme with different scopes
|
|
176
|
+
*/
|
|
177
|
+
var formatScheme = ({ name, value }) => ({
|
|
178
|
+
id: generateHash(JSON.stringify(value)),
|
|
179
|
+
label: name,
|
|
180
|
+
value,
|
|
181
|
+
isDeletable: true
|
|
182
|
+
});
|
|
183
|
+
/** Formats complex security schemes */
|
|
184
|
+
var formatComplexScheme = (scheme) => formatScheme({
|
|
185
|
+
name: Object.keys(scheme).join(" & "),
|
|
186
|
+
value: scheme
|
|
187
|
+
});
|
|
188
|
+
/**
|
|
189
|
+
* Formats a security requirement into a SecuritySchemeOption.
|
|
190
|
+
* Handles both simple (single key) and complex (multiple keys) auth schemes.
|
|
191
|
+
*/
|
|
192
|
+
var formatSecurityRequirement = (requirement, securitySchemes) => {
|
|
193
|
+
const keys = Object.keys(requirement);
|
|
194
|
+
if (keys.length > 1) return formatComplexScheme(requirement);
|
|
195
|
+
if (keys[0]) {
|
|
196
|
+
if (!getResolvedRef(securitySchemes[keys[0]])) return;
|
|
197
|
+
return formatScheme({
|
|
198
|
+
name: keys[0],
|
|
199
|
+
value: requirement
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Generates the options for the security scheme combobox
|
|
205
|
+
*
|
|
206
|
+
* Contains either a flat list, or different groups of required, available, and add new
|
|
207
|
+
*/
|
|
208
|
+
var getSecuritySchemeOptions = (security, securitySchemes, selectedSchemes, canAddNewAuth = false) => {
|
|
209
|
+
/**
|
|
210
|
+
* Build required schemes formatted as options and track scheme names in a single pass.
|
|
211
|
+
* We use names (not full IDs) because we want to exclude any scheme that is already
|
|
212
|
+
* required, regardless of its specific scopes or hash.
|
|
213
|
+
*/
|
|
214
|
+
const { requiredFormatted, requiredSchemeNames, existingIds } = security.reduce((acc, requirement) => {
|
|
215
|
+
const formatted = formatSecurityRequirement(requirement, securitySchemes);
|
|
216
|
+
if (formatted) {
|
|
217
|
+
acc.requiredFormatted.push(formatted);
|
|
218
|
+
acc.existingIds.add(formatted.id);
|
|
219
|
+
}
|
|
220
|
+
for (const name of Object.keys(requirement)) acc.requiredSchemeNames.add(name);
|
|
221
|
+
return acc;
|
|
222
|
+
}, {
|
|
223
|
+
requiredFormatted: [],
|
|
224
|
+
requiredSchemeNames: /* @__PURE__ */ new Set(),
|
|
225
|
+
existingIds: /* @__PURE__ */ new Set()
|
|
226
|
+
});
|
|
227
|
+
const availableFormatted = [];
|
|
228
|
+
for (const [name, schemeRef] of Object.entries(securitySchemes)) {
|
|
229
|
+
if (requiredSchemeNames.has(name)) continue;
|
|
230
|
+
if (getResolvedRef(schemeRef)) {
|
|
231
|
+
const formatted = formatScheme({
|
|
232
|
+
name,
|
|
233
|
+
value: { [name]: [] }
|
|
234
|
+
});
|
|
235
|
+
availableFormatted.push(formatted);
|
|
236
|
+
existingIds.add(formatted.id);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Add selected schemes to available if they do not already exist
|
|
241
|
+
* This ensures that selected schemes with specific scopes are always available as options
|
|
242
|
+
*/
|
|
243
|
+
for (const selectedScheme of selectedSchemes) {
|
|
244
|
+
const formatted = formatSecurityRequirement(selectedScheme, securitySchemes);
|
|
245
|
+
if (formatted && !existingIds.has(formatted.id)) {
|
|
246
|
+
availableFormatted.push(formatted);
|
|
247
|
+
existingIds.add(formatted.id);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const options = [{
|
|
251
|
+
label: "Required authentication",
|
|
252
|
+
options: requiredFormatted
|
|
253
|
+
}, {
|
|
254
|
+
label: "Available authentication",
|
|
255
|
+
options: availableFormatted
|
|
256
|
+
}];
|
|
257
|
+
if (!canAddNewAuth) return requiredFormatted.length ? options : availableFormatted;
|
|
258
|
+
options.push({
|
|
259
|
+
label: "Add new authentication",
|
|
260
|
+
options: Object.entries(authOptions).map(([key, value]) => ({
|
|
261
|
+
id: key,
|
|
262
|
+
label: value.label,
|
|
263
|
+
value: { [key]: [] },
|
|
264
|
+
payload: value.payload,
|
|
265
|
+
isDeletable: false
|
|
266
|
+
}))
|
|
267
|
+
});
|
|
268
|
+
return options;
|
|
269
|
+
};
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue?vue&type=script&setup=true&lang.ts
|
|
272
|
+
var _hoisted_1$7 = { class: "flex h-8 items-start gap-2 text-sm" };
|
|
273
|
+
var _hoisted_2$5 = { class: "flex h-8 items-start gap-2 text-sm" };
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue
|
|
276
|
+
var OAuthScopesAddModal_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
277
|
+
__name: "OAuthScopesAddModal",
|
|
278
|
+
props: {
|
|
279
|
+
state: {},
|
|
280
|
+
scopes: {}
|
|
281
|
+
},
|
|
282
|
+
emits: ["cancel", "submit"],
|
|
283
|
+
setup(__props, { emit: __emit }) {
|
|
284
|
+
const emit = __emit;
|
|
285
|
+
const scopeData = ref({
|
|
286
|
+
name: "",
|
|
287
|
+
description: ""
|
|
288
|
+
});
|
|
289
|
+
const { toast } = useToasts();
|
|
290
|
+
const handleSubmit = () => {
|
|
291
|
+
if (!scopeData.value.name) {
|
|
292
|
+
toast("Please fill in the name before adding a scope.", "error");
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
emit("submit", scopeData.value);
|
|
296
|
+
__props.state.hide();
|
|
297
|
+
};
|
|
298
|
+
watch(() => __props.state.open, (isOpen) => {
|
|
299
|
+
if (isOpen) scopeData.value = {
|
|
300
|
+
name: "",
|
|
301
|
+
description: ""
|
|
302
|
+
};
|
|
303
|
+
});
|
|
304
|
+
return (_ctx, _cache) => {
|
|
305
|
+
return openBlock(), createBlock(unref(ScalarModal), {
|
|
306
|
+
size: "xs",
|
|
307
|
+
state: __props.state,
|
|
308
|
+
title: "Add Scope"
|
|
309
|
+
}, {
|
|
310
|
+
default: withCtx(() => [createVNode(CommandActionForm_default, {
|
|
311
|
+
disabled: !scopeData.value.name || __props.scopes.includes(scopeData.value.name),
|
|
312
|
+
onCancel: _cache[2] || (_cache[2] = ($event) => emit("cancel")),
|
|
313
|
+
onSubmit: handleSubmit
|
|
314
|
+
}, {
|
|
315
|
+
submit: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("Add Scope", -1)])]),
|
|
316
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$7, [_cache[3] || (_cache[3] = createTextVNode(" Name: ", -1)), createVNode(CommandActionInput_default, {
|
|
317
|
+
modelValue: scopeData.value.name,
|
|
318
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => scopeData.value.name = $event),
|
|
319
|
+
autofocus: "",
|
|
320
|
+
class: "!p-0",
|
|
321
|
+
placeholder: "read:user"
|
|
322
|
+
}, null, 8, ["modelValue"])]), createElementVNode("div", _hoisted_2$5, [_cache[4] || (_cache[4] = createTextVNode(" Description: ", -1)), createVNode(CommandActionInput_default, {
|
|
323
|
+
modelValue: scopeData.value.description,
|
|
324
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => scopeData.value.description = $event),
|
|
325
|
+
class: "!p-0",
|
|
326
|
+
placeholder: "Read user data"
|
|
327
|
+
}, null, 8, ["modelValue"])])]),
|
|
328
|
+
_: 1
|
|
329
|
+
}, 8, ["disabled"])]),
|
|
330
|
+
_: 1
|
|
331
|
+
}, 8, ["state"]);
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
}), [["__scopeId", "data-v-43df1726"]]);
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue?vue&type=script&setup=true&lang.ts
|
|
337
|
+
var _hoisted_1$6 = { class: "flex h-fit w-full" };
|
|
338
|
+
var _hoisted_2$4 = { class: "flex-1" };
|
|
339
|
+
var _hoisted_3$2 = { class: "flex items-center gap-1.75" };
|
|
340
|
+
var _hoisted_4$1 = {
|
|
341
|
+
class: "grid max-h-40 auto-rows-auto overflow-x-hidden overflow-y-scroll",
|
|
342
|
+
style: { gridTemplateColumns: "1fr auto" }
|
|
343
|
+
};
|
|
344
|
+
var _hoisted_5$1 = { class: "font-code text-xs" };
|
|
345
|
+
var _hoisted_6$1 = { key: 0 };
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue
|
|
348
|
+
var OAuthScopesInput_default = /* @__PURE__ */ defineComponent({
|
|
349
|
+
__name: "OAuthScopesInput",
|
|
350
|
+
props: {
|
|
351
|
+
flowType: {},
|
|
352
|
+
flow: {},
|
|
353
|
+
selectedScopes: {}
|
|
354
|
+
},
|
|
355
|
+
emits: ["update:selectedScopes"],
|
|
356
|
+
setup(__props, { emit: __emit }) {
|
|
357
|
+
const emits = __emit;
|
|
358
|
+
const searchQuery = ref("");
|
|
359
|
+
/** List of all available scopes */
|
|
360
|
+
const scopes = computed(() => Object.entries(__props.flow?.scopes ?? {}).map(([key, val]) => ({
|
|
361
|
+
id: key,
|
|
362
|
+
label: key,
|
|
363
|
+
description: val
|
|
364
|
+
})));
|
|
365
|
+
const filteredScopes = computed(() => {
|
|
366
|
+
if (!searchQuery.value) return scopes.value;
|
|
367
|
+
const regex = new RegExp(searchQuery.value.split("").map((c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join(".*"), "i");
|
|
368
|
+
return scopes.value.filter(({ label, description }) => regex.test(`${label} ${description}`));
|
|
369
|
+
});
|
|
370
|
+
const allScopesSelected = computed(() => __props.selectedScopes.length === Object.keys(__props.flow?.scopes ?? {}).length);
|
|
371
|
+
function setScope(scopeKey, checked) {
|
|
372
|
+
if (checked) return emits("update:selectedScopes", { scopes: Array.from(new Set([...__props.selectedScopes, scopeKey])) });
|
|
373
|
+
emits("update:selectedScopes", { scopes: __props.selectedScopes.filter((scope) => scope !== scopeKey) });
|
|
374
|
+
}
|
|
375
|
+
/** Select all scopes */
|
|
376
|
+
const selectAllScopes = () => emits("update:selectedScopes", { scopes: Object.keys(__props.flow?.scopes ?? {}) });
|
|
377
|
+
/** Deselect all scopes */
|
|
378
|
+
const deselectAllScopes = () => emits("update:selectedScopes", { scopes: [] });
|
|
379
|
+
const addNewScopeModal = useModal();
|
|
380
|
+
return (_ctx, _cache) => {
|
|
381
|
+
return openBlock(), createBlock(unref(DataTableCell_default), { class: "h-auto !max-h-[initial] min-h-8 items-center" }, {
|
|
382
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$6, [_cache[7] || (_cache[7] = createElementVNode("div", { class: "text-c-1 h-full items-center" }, null, -1)), createVNode(unref(Disclosure), {
|
|
383
|
+
as: "div",
|
|
384
|
+
class: "bl flex w-full flex-col"
|
|
385
|
+
}, {
|
|
386
|
+
default: withCtx(() => [createVNode(unref(DisclosureButton), { class: normalizeClass(["group/scopes-accordion hover:text-c-1 flex h-auto min-h-8 cursor-pointer items-center gap-1.5 pr-2.25 pl-3 text-left", (__props.selectedScopes.length || 0) > 0 ? "text-c-1" : "text-c-3"]) }, {
|
|
387
|
+
default: withCtx(({ open }) => [createElementVNode("div", _hoisted_2$4, " Scopes Selected " + toDisplayString(__props.selectedScopes.length || 0) + " / " + toDisplayString(Object.keys(__props.flow?.scopes ?? {}).length || 0), 1), createElementVNode("div", _hoisted_3$2, [
|
|
388
|
+
createVNode(unref(ScalarButton), {
|
|
389
|
+
class: "pr-0.75 pl-1 transition-none",
|
|
390
|
+
size: "sm",
|
|
391
|
+
variant: "ghost",
|
|
392
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(addNewScopeModal).show(), ["stop"]))
|
|
393
|
+
}, {
|
|
394
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode(" Add Scope ", -1)])]),
|
|
395
|
+
_: 1
|
|
396
|
+
}),
|
|
397
|
+
allScopesSelected.value ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
398
|
+
key: 0,
|
|
399
|
+
class: "pr-0.75 pl-1 transition-none",
|
|
400
|
+
size: "sm",
|
|
401
|
+
variant: "ghost",
|
|
402
|
+
onClick: withModifiers(deselectAllScopes, ["stop"])
|
|
403
|
+
}, {
|
|
404
|
+
default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode(" Deselect All ", -1)])]),
|
|
405
|
+
_: 1
|
|
406
|
+
})) : createCommentVNode("", true),
|
|
407
|
+
!allScopesSelected.value ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
408
|
+
key: 1,
|
|
409
|
+
class: "pr-0.75 pl-1 transition-none",
|
|
410
|
+
size: "sm",
|
|
411
|
+
variant: "ghost",
|
|
412
|
+
onClick: withModifiers(selectAllScopes, ["stop"])
|
|
413
|
+
}, {
|
|
414
|
+
default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode(" Select All ", -1)])]),
|
|
415
|
+
_: 1
|
|
416
|
+
})) : createCommentVNode("", true),
|
|
417
|
+
createVNode(unref(ScalarIcon), {
|
|
418
|
+
class: "text-c-3 group-hover/scopes-accordion:text-c-2",
|
|
419
|
+
icon: open ? "ChevronDown" : "ChevronRight",
|
|
420
|
+
size: "md"
|
|
421
|
+
}, null, 8, ["icon"])
|
|
422
|
+
])]),
|
|
423
|
+
_: 1
|
|
424
|
+
}, 8, ["class"]), createVNode(unref(DisclosurePanel), { as: "template" }, {
|
|
425
|
+
default: withCtx(() => [createElementVNode("div", null, [createVNode(unref(ScalarSearchInput), {
|
|
426
|
+
modelValue: searchQuery.value,
|
|
427
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchQuery.value = $event),
|
|
428
|
+
class: "flex items-center text-xs"
|
|
429
|
+
}, null, 8, ["modelValue"]), createElementVNode("table", _hoisted_4$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredScopes.value, ({ id, label, description }) => {
|
|
430
|
+
return openBlock(), createBlock(unref(DataTableRow_default), {
|
|
431
|
+
key: id,
|
|
432
|
+
class: "text-c-2",
|
|
433
|
+
onClick: ($event) => setScope(id, !__props.selectedScopes.includes(id))
|
|
434
|
+
}, {
|
|
435
|
+
default: withCtx(() => [createVNode(unref(DataTableCell_default), { class: "no-scrollbar hover:text-c-1 box-border flex !max-h-[initial] w-full cursor-pointer items-center gap-1 overflow-x-scroll px-3 py-1.5 text-nowrap" }, {
|
|
436
|
+
default: withCtx(() => [
|
|
437
|
+
createElementVNode("span", _hoisted_5$1, toDisplayString(label), 1),
|
|
438
|
+
_cache[6] || (_cache[6] = createElementVNode("span", null, "–", -1)),
|
|
439
|
+
description ? (openBlock(), createElementBlock("span", _hoisted_6$1, toDisplayString(description), 1)) : createCommentVNode("", true)
|
|
440
|
+
]),
|
|
441
|
+
_: 2
|
|
442
|
+
}, 1024), createVNode(unref(DataTableCheckbox_default), {
|
|
443
|
+
modelValue: __props.selectedScopes.includes(id),
|
|
444
|
+
"onUpdate:modelValue": ($event) => setScope(id, $event)
|
|
445
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])]),
|
|
446
|
+
_: 2
|
|
447
|
+
}, 1032, ["onClick"]);
|
|
448
|
+
}), 128))])])]),
|
|
449
|
+
_: 1
|
|
450
|
+
})]),
|
|
451
|
+
_: 1
|
|
452
|
+
})]), createVNode(OAuthScopesAddModal_default, {
|
|
453
|
+
scopes: Object.keys(__props.flow.scopes ?? {}),
|
|
454
|
+
state: unref(addNewScopeModal),
|
|
455
|
+
onSubmit: _cache[2] || (_cache[2] = (payload) => emits("update:selectedScopes", {
|
|
456
|
+
scopes: __props.selectedScopes,
|
|
457
|
+
newScopePayload: {
|
|
458
|
+
...payload,
|
|
459
|
+
flowType: __props.flowType
|
|
460
|
+
}
|
|
461
|
+
}))
|
|
462
|
+
}, null, 8, ["scopes", "state"])]),
|
|
463
|
+
_: 1
|
|
464
|
+
});
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
//#endregion
|
|
469
|
+
//#region src/v2/blocks/scalar-auth-selector-block/helpers/oauth.ts
|
|
470
|
+
var getActiveServerBase = (activeServer, environmentVariables = {}) => {
|
|
471
|
+
const serverUrl = getServerUrl(activeServer, environmentVariables);
|
|
472
|
+
if (!serverUrl) return {};
|
|
473
|
+
if (isRelativePath(serverUrl)) return typeof window === "undefined" ? {} : { basePath: serverUrl };
|
|
474
|
+
return { baseUrl: serverUrl };
|
|
475
|
+
};
|
|
476
|
+
/**
|
|
477
|
+
* Generates a random string for PKCE code verifier
|
|
478
|
+
*
|
|
479
|
+
* @see https://www.rfc-editor.org/rfc/rfc7636#page-8
|
|
480
|
+
*/
|
|
481
|
+
var generateCodeVerifier = () => {
|
|
482
|
+
const buffer = new Uint8Array(32);
|
|
483
|
+
crypto.getRandomValues(buffer);
|
|
484
|
+
return fromUint8Array(buffer, true);
|
|
485
|
+
};
|
|
486
|
+
/**
|
|
487
|
+
* Creates a code challenge from the code verifier
|
|
488
|
+
*/
|
|
489
|
+
var generateCodeChallenge = async (verifier, encoding) => {
|
|
490
|
+
if (encoding === "plain") return verifier;
|
|
491
|
+
if (typeof crypto?.subtle?.digest !== "function") {
|
|
492
|
+
console.warn("SHA-256 is only supported when using https, using a plain text code challenge instead.");
|
|
493
|
+
return verifier;
|
|
494
|
+
}
|
|
495
|
+
const data = new TextEncoder().encode(verifier);
|
|
496
|
+
const digest = await crypto.subtle.digest("SHA-256", data);
|
|
497
|
+
return fromUint8Array(new Uint8Array(digest), true);
|
|
498
|
+
};
|
|
499
|
+
/**
|
|
500
|
+
* Authorize oauth2 flow
|
|
501
|
+
*
|
|
502
|
+
* @returns the resolved oauth2 tokens
|
|
503
|
+
*/
|
|
504
|
+
var authorizeOauth2 = async (flows, type, selectedScopes, activeServer, proxyUrl, environmentVariables = {}) => {
|
|
505
|
+
const flow = flows[type];
|
|
506
|
+
try {
|
|
507
|
+
if (!flow) return [/* @__PURE__ */ new Error("Flow not found"), null];
|
|
508
|
+
const scopes = selectedScopes.join(" ");
|
|
509
|
+
if (type === "clientCredentials" || type === "password") return authorizeServers(flows, type, scopes, { proxyUrl }, activeServer, environmentVariables);
|
|
510
|
+
const state = (Math.random() + 1).toString(36).substring(2, 10);
|
|
511
|
+
const authorizationUrl = makeUrlAbsolute(flows[type]["x-scalar-secret-auth-url"] ?? flows[type].authorizationUrl, getActiveServerBase(activeServer, environmentVariables));
|
|
512
|
+
const url = new URL(authorizationUrl);
|
|
513
|
+
/** Special PKCE state */
|
|
514
|
+
let pkce = null;
|
|
515
|
+
if (type === "implicit") url.searchParams.set("response_type", "token");
|
|
516
|
+
else if (type === "authorizationCode") {
|
|
517
|
+
const typedFlow = flows[type];
|
|
518
|
+
url.searchParams.set("response_type", "code");
|
|
519
|
+
if (typedFlow["x-usePkce"] !== "no") {
|
|
520
|
+
const codeVerifier = generateCodeVerifier();
|
|
521
|
+
const codeChallenge = await generateCodeChallenge(codeVerifier, typedFlow["x-usePkce"]);
|
|
522
|
+
pkce = {
|
|
523
|
+
codeVerifier,
|
|
524
|
+
codeChallenge,
|
|
525
|
+
codeChallengeMethod: typedFlow["x-usePkce"] === "SHA-256" ? "S256" : "plain"
|
|
526
|
+
};
|
|
527
|
+
url.searchParams.set("code_challenge", codeChallenge);
|
|
528
|
+
url.searchParams.set("code_challenge_method", pkce.codeChallengeMethod);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
const typedFlow = flows[type];
|
|
532
|
+
if (typedFlow["x-scalar-secret-redirect-uri"].startsWith("/")) {
|
|
533
|
+
const baseUrl = getServerUrl(activeServer, environmentVariables) || window.location.origin + window.location.pathname;
|
|
534
|
+
const redirectUri = new URL(typedFlow["x-scalar-secret-redirect-uri"], baseUrl).toString();
|
|
535
|
+
url.searchParams.set("redirect_uri", redirectUri);
|
|
536
|
+
} else url.searchParams.set("redirect_uri", typedFlow["x-scalar-secret-redirect-uri"]);
|
|
537
|
+
if (flow["x-scalar-security-query"]) Object.keys(flow["x-scalar-security-query"]).forEach((key) => {
|
|
538
|
+
const value = flow["x-scalar-security-query"]?.[key];
|
|
539
|
+
if (!value) return;
|
|
540
|
+
url.searchParams.set(key, value);
|
|
541
|
+
});
|
|
542
|
+
url.searchParams.set("client_id", flow["x-scalar-secret-client-id"]);
|
|
543
|
+
url.searchParams.set("state", state);
|
|
544
|
+
if (scopes) url.searchParams.set("scope", scopes);
|
|
545
|
+
const authWindow = window.open(url, "openAuth2Window", "left=100,top=100,width=800,height=600");
|
|
546
|
+
if (authWindow) return new Promise((resolve) => {
|
|
547
|
+
const checkWindowClosed = setInterval(() => {
|
|
548
|
+
let accessToken = null;
|
|
549
|
+
let refreshToken = null;
|
|
550
|
+
let code = null;
|
|
551
|
+
let error = null;
|
|
552
|
+
let errorDescription = null;
|
|
553
|
+
try {
|
|
554
|
+
const urlParams = new URL(authWindow.location.href).searchParams;
|
|
555
|
+
const tokenName = flow["x-tokenName"] || "access_token";
|
|
556
|
+
accessToken = urlParams.get(tokenName);
|
|
557
|
+
refreshToken = urlParams.get("refresh_token");
|
|
558
|
+
code = urlParams.get("code");
|
|
559
|
+
error = urlParams.get("error");
|
|
560
|
+
errorDescription = urlParams.get("error_description");
|
|
561
|
+
const hashParams = new URLSearchParams(authWindow.location.href.split("#")[1]);
|
|
562
|
+
accessToken ||= hashParams.get(tokenName);
|
|
563
|
+
refreshToken ||= hashParams.get("refresh_token");
|
|
564
|
+
code ||= hashParams.get("code");
|
|
565
|
+
error ||= hashParams.get("error");
|
|
566
|
+
errorDescription ||= hashParams.get("error_description");
|
|
567
|
+
} catch (_e) {}
|
|
568
|
+
if (authWindow.closed || accessToken || code || error) {
|
|
569
|
+
clearInterval(checkWindowClosed);
|
|
570
|
+
authWindow.close();
|
|
571
|
+
if (error) resolve([/* @__PURE__ */ new Error(`OAuth error: ${error}${errorDescription ? ` (${errorDescription})` : ""}`), null]);
|
|
572
|
+
else if (accessToken) if (authWindow.location.href.match(/state=([^&]*)/)?.[1] === state) resolve([null, {
|
|
573
|
+
accessToken,
|
|
574
|
+
...refreshToken ? { refreshToken } : {}
|
|
575
|
+
}]);
|
|
576
|
+
else resolve([/* @__PURE__ */ new Error("State mismatch"), null]);
|
|
577
|
+
else if (code && type === "authorizationCode") if (new URL(authWindow.location.href).searchParams.get("state") === state) authorizeServers(flows, type, scopes, {
|
|
578
|
+
code,
|
|
579
|
+
pkce,
|
|
580
|
+
proxyUrl
|
|
581
|
+
}, activeServer, environmentVariables).then(resolve);
|
|
582
|
+
else resolve([/* @__PURE__ */ new Error("State mismatch"), null]);
|
|
583
|
+
else {
|
|
584
|
+
clearInterval(checkWindowClosed);
|
|
585
|
+
resolve([/* @__PURE__ */ new Error("Window was closed without granting authorization"), null]);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}, 200);
|
|
589
|
+
});
|
|
590
|
+
return [/* @__PURE__ */ new Error("Failed to open auth window"), null];
|
|
591
|
+
} catch (_) {
|
|
592
|
+
return [/* @__PURE__ */ new Error("Failed to authorize oauth2 flow"), null];
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
/**
|
|
596
|
+
* Makes the BE authorization call to grab the token server to server
|
|
597
|
+
* Used for clientCredentials and authorizationCode
|
|
598
|
+
*/
|
|
599
|
+
var authorizeServers = async (flows, type, scopes, { code, pkce, proxyUrl } = {}, activeServer, environmentVariables = {}) => {
|
|
600
|
+
const flow = flows[type];
|
|
601
|
+
if (!flow) return [/* @__PURE__ */ new Error("OAuth2 flow was not defined"), null];
|
|
602
|
+
const formData = new URLSearchParams();
|
|
603
|
+
if (scopes && (type === "clientCredentials" || type === "password")) formData.set("scope", scopes);
|
|
604
|
+
/** Where to add the credentials */
|
|
605
|
+
const addCredentialsToBody = flow["x-scalar-credentials-location"] === "body";
|
|
606
|
+
if (addCredentialsToBody) {
|
|
607
|
+
formData.set("client_id", flow["x-scalar-secret-client-id"]);
|
|
608
|
+
formData.set("client_secret", flow["x-scalar-secret-client-secret"]);
|
|
609
|
+
}
|
|
610
|
+
if ("x-scalar-secret-redirect-uri" in flow && flow["x-scalar-secret-redirect-uri"]) formData.set("redirect_uri", flow["x-scalar-secret-redirect-uri"]);
|
|
611
|
+
if (code) {
|
|
612
|
+
formData.set("code", code);
|
|
613
|
+
formData.set("grant_type", "authorization_code");
|
|
614
|
+
if (pkce) formData.set("code_verifier", pkce.codeVerifier);
|
|
615
|
+
} else if (type === "password") {
|
|
616
|
+
const typedFlow = flows[type];
|
|
617
|
+
formData.set("grant_type", "password");
|
|
618
|
+
formData.set("username", typedFlow["x-scalar-secret-username"]);
|
|
619
|
+
formData.set("password", typedFlow["x-scalar-secret-password"]);
|
|
620
|
+
} else formData.set("grant_type", "client_credentials");
|
|
621
|
+
if (flow["x-scalar-security-body"]) Object.entries(flow["x-scalar-security-body"]).forEach(([key, value]) => {
|
|
622
|
+
if (value) formData.set(key, String(value));
|
|
623
|
+
});
|
|
624
|
+
try {
|
|
625
|
+
const headers = { "Content-Type": "application/x-www-form-urlencoded" };
|
|
626
|
+
if (!addCredentialsToBody) headers.Authorization = `Basic ${encode(`${flow["x-scalar-secret-client-id"]}:${flow["x-scalar-secret-client-secret"]}`)}`;
|
|
627
|
+
const tokenUrl = makeUrlAbsolute(flow["x-scalar-secret-token-url"] ?? flow.tokenUrl, getActiveServerBase(activeServer, environmentVariables));
|
|
628
|
+
const url = shouldUseProxy(proxyUrl, tokenUrl) ? `${proxyUrl}?${new URLSearchParams([["scalar_url", tokenUrl]]).toString()}` : tokenUrl;
|
|
629
|
+
const responseData = await (await fetch(url, {
|
|
630
|
+
method: "POST",
|
|
631
|
+
headers,
|
|
632
|
+
body: formData
|
|
633
|
+
})).json();
|
|
634
|
+
const accessToken = responseData[flow["x-tokenName"] || "access_token"];
|
|
635
|
+
const refreshToken = responseData.refresh_token;
|
|
636
|
+
return [null, {
|
|
637
|
+
accessToken,
|
|
638
|
+
...typeof refreshToken === "string" ? { refreshToken } : {}
|
|
639
|
+
}];
|
|
640
|
+
} catch {
|
|
641
|
+
return [/* @__PURE__ */ new Error("Failed to get an access token. Please check your credentials."), null];
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
//#endregion
|
|
645
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue?vue&type=script&setup=true&lang.ts
|
|
646
|
+
var _hoisted_1$5 = ["for"];
|
|
647
|
+
//#endregion
|
|
648
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue
|
|
649
|
+
var RequestAuthDataTableInput_default = /* @__PURE__ */ defineComponent({
|
|
650
|
+
__name: "RequestAuthDataTableInput",
|
|
651
|
+
props: /* @__PURE__ */ mergeModels({
|
|
652
|
+
containerClass: {},
|
|
653
|
+
environment: {},
|
|
654
|
+
readOnly: {
|
|
655
|
+
type: Boolean,
|
|
656
|
+
default: false
|
|
657
|
+
},
|
|
658
|
+
required: {
|
|
659
|
+
type: Boolean,
|
|
660
|
+
default: false
|
|
661
|
+
},
|
|
662
|
+
type: {}
|
|
663
|
+
}, {
|
|
664
|
+
"modelValue": {
|
|
665
|
+
default: "",
|
|
666
|
+
required: true
|
|
667
|
+
},
|
|
668
|
+
"modelModifiers": {}
|
|
669
|
+
}),
|
|
670
|
+
emits: /* @__PURE__ */ mergeModels([
|
|
671
|
+
"inputFocus",
|
|
672
|
+
"inputBlur",
|
|
673
|
+
"selectVariable"
|
|
674
|
+
], ["update:modelValue"]),
|
|
675
|
+
setup(__props, { emit: __emit }) {
|
|
676
|
+
const emit = __emit;
|
|
677
|
+
const modelValue = useModel(__props, "modelValue");
|
|
678
|
+
const id = useId();
|
|
679
|
+
return (_ctx, _cache) => {
|
|
680
|
+
return openBlock(), createBlock(unref(DataTableInput_default), mergeProps({ id: unref(id) }, _ctx.$attrs, {
|
|
681
|
+
modelValue: modelValue.value,
|
|
682
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
683
|
+
canAddCustomEnumValue: !__props.readOnly,
|
|
684
|
+
containerClass: __props.containerClass,
|
|
685
|
+
environment: __props.environment,
|
|
686
|
+
lineWrapping: "",
|
|
687
|
+
readOnly: __props.readOnly,
|
|
688
|
+
required: __props.required,
|
|
689
|
+
type: __props.type,
|
|
690
|
+
onInputBlur: _cache[1] || (_cache[1] = ($event) => emit("inputBlur")),
|
|
691
|
+
onInputFocus: _cache[2] || (_cache[2] = ($event) => emit("inputFocus")),
|
|
692
|
+
onSelectVariable: _cache[3] || (_cache[3] = ($event) => emit("selectVariable", $event))
|
|
693
|
+
}), {
|
|
694
|
+
default: withCtx(() => [createElementVNode("label", { for: unref(id) }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$5)]),
|
|
695
|
+
icon: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
|
|
696
|
+
_: 3
|
|
697
|
+
}, 16, [
|
|
698
|
+
"id",
|
|
699
|
+
"modelValue",
|
|
700
|
+
"canAddCustomEnumValue",
|
|
701
|
+
"containerClass",
|
|
702
|
+
"environment",
|
|
703
|
+
"readOnly",
|
|
704
|
+
"required",
|
|
705
|
+
"type"
|
|
706
|
+
]);
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
//#endregion
|
|
711
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue?vue&type=script&setup=true&lang.ts
|
|
712
|
+
var _hoisted_1$4 = { class: "flex h-8 items-center justify-end gap-2 border-t" };
|
|
713
|
+
var _hoisted_2$3 = { class: "flex h-8 w-full items-center justify-end border-t" };
|
|
714
|
+
//#endregion
|
|
715
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue
|
|
716
|
+
var OAuth2_default = /* @__PURE__ */ defineComponent({
|
|
717
|
+
__name: "OAuth2",
|
|
718
|
+
props: {
|
|
719
|
+
environment: {},
|
|
720
|
+
flows: {},
|
|
721
|
+
type: {},
|
|
722
|
+
selectedScopes: {},
|
|
723
|
+
scheme: {},
|
|
724
|
+
server: {},
|
|
725
|
+
proxyUrl: {},
|
|
726
|
+
name: {},
|
|
727
|
+
eventBus: {}
|
|
728
|
+
},
|
|
729
|
+
emits: ["update:selectedScopes"],
|
|
730
|
+
setup(__props, { emit: __emit }) {
|
|
731
|
+
const emits = __emit;
|
|
732
|
+
const loader = useLoadingState();
|
|
733
|
+
const { toast } = useToasts();
|
|
734
|
+
/** The current OAuth flow based on the selected type */
|
|
735
|
+
const flow = computed(() => __props.flows[__props.type]);
|
|
736
|
+
const selectedScopes = computed(() => __props.selectedScopes.filter((scope) => scope in (flow.value.scopes ?? {})));
|
|
737
|
+
/** Updates the security scheme base */
|
|
738
|
+
const handleOauth2Update = (payload) => {
|
|
739
|
+
if (__props.scheme.type === "openIdConnect") return handleOauth2SecretsUpdate(payload);
|
|
740
|
+
__props.eventBus.emit("auth:update:security-scheme", {
|
|
741
|
+
payload: {
|
|
742
|
+
type: __props.scheme.type,
|
|
743
|
+
flows: { [__props.type]: payload }
|
|
744
|
+
},
|
|
745
|
+
name: __props.name
|
|
746
|
+
});
|
|
747
|
+
};
|
|
748
|
+
/** Updates the flow secrets */
|
|
749
|
+
const handleOauth2SecretsUpdate = (payload) => __props.eventBus.emit("auth:update:security-scheme-secrets", {
|
|
750
|
+
payload: {
|
|
751
|
+
type: __props.scheme.type,
|
|
752
|
+
[__props.type]: payload
|
|
753
|
+
},
|
|
754
|
+
name: __props.name
|
|
755
|
+
});
|
|
756
|
+
/** Clears the flow secrets */
|
|
757
|
+
const clearOauth2Secrets = () => __props.eventBus.emit("auth:clear:security-scheme-secrets", { name: __props.name });
|
|
758
|
+
/** Track if we have set the redirect uri */
|
|
759
|
+
const hasPrefilledRedirectUri = ref(false);
|
|
760
|
+
/** Default the redirect-uri to the current origin if we have access to window */
|
|
761
|
+
watch(() => flow.value["x-scalar-secret-redirect-uri"], (newRedirectUri) => {
|
|
762
|
+
if (hasPrefilledRedirectUri.value || newRedirectUri || typeof window === "undefined" || !("x-scalar-secret-redirect-uri" in flow.value)) return;
|
|
763
|
+
hasPrefilledRedirectUri.value = true;
|
|
764
|
+
handleOauth2SecretsUpdate({ "x-scalar-secret-redirect-uri": window.location.origin + window.location.pathname });
|
|
765
|
+
}, { immediate: true });
|
|
766
|
+
/**
|
|
767
|
+
* Authorizes the user using the specified OAuth flow.
|
|
768
|
+
* Opens the appropriate OAuth dialog and/or performs the token exchange.
|
|
769
|
+
*/
|
|
770
|
+
const handleAuthorize = async () => {
|
|
771
|
+
if (loader.isLoading) return;
|
|
772
|
+
loader.start();
|
|
773
|
+
const [error, tokens] = await authorizeOauth2(__props.flows, __props.type, selectedScopes.value, __props.server, __props.proxyUrl, getEnvironmentVariables(__props.environment));
|
|
774
|
+
await loader.clear();
|
|
775
|
+
if (tokens?.accessToken) handleOauth2SecretsUpdate({
|
|
776
|
+
"x-scalar-secret-token": tokens.accessToken,
|
|
777
|
+
...tokens.refreshToken ? { "x-scalar-secret-refresh-token": tokens.refreshToken } : {}
|
|
778
|
+
});
|
|
779
|
+
else {
|
|
780
|
+
console.error(error);
|
|
781
|
+
toast(error?.message ?? "Failed to authorize", "error");
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
/** Updates the secret location */
|
|
785
|
+
const handleSecretLocationUpdate = (value) => {
|
|
786
|
+
const credentialsLocation = value === "body" ? "body" : "header";
|
|
787
|
+
if (__props.scheme.type !== "openIdConnect") handleOauth2Update({ "x-scalar-credentials-location": credentialsLocation });
|
|
788
|
+
handleOauth2SecretsUpdate({ "x-scalar-credentials-location": credentialsLocation });
|
|
789
|
+
};
|
|
790
|
+
return (_ctx, _cache) => {
|
|
791
|
+
return Boolean(flow.value["x-scalar-secret-token"]) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(unref(DataTableRow_default), null, {
|
|
792
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
793
|
+
class: "border-r-transparent",
|
|
794
|
+
environment: __props.environment,
|
|
795
|
+
modelValue: flow.value["x-scalar-secret-token"],
|
|
796
|
+
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
797
|
+
type: "password",
|
|
798
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-token": v }))
|
|
799
|
+
}, {
|
|
800
|
+
default: withCtx(() => [..._cache[12] || (_cache[12] = [createTextVNode(" Access Token ", -1)])]),
|
|
801
|
+
_: 1
|
|
802
|
+
}, 8, ["environment", "modelValue"])]),
|
|
803
|
+
_: 1
|
|
804
|
+
}), createVNode(unref(DataTableRow_default), { class: "min-w-full" }, {
|
|
805
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$4, [createVNode(unref(ScalarButton), {
|
|
806
|
+
class: "mr-1 p-0 px-2 py-0.5",
|
|
807
|
+
loader: unref(loader),
|
|
808
|
+
size: "sm",
|
|
809
|
+
variant: "outlined",
|
|
810
|
+
onClick: _cache[1] || (_cache[1] = () => handleOauth2SecretsUpdate({
|
|
811
|
+
"x-scalar-secret-token": "",
|
|
812
|
+
"x-scalar-secret-refresh-token": ""
|
|
813
|
+
}))
|
|
814
|
+
}, {
|
|
815
|
+
default: withCtx(() => [..._cache[13] || (_cache[13] = [createTextVNode(" Clear ", -1)])]),
|
|
816
|
+
_: 1
|
|
817
|
+
}, 8, ["loader"])])]),
|
|
818
|
+
_: 1
|
|
819
|
+
})], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
820
|
+
createVNode(unref(DataTableRow_default), null, {
|
|
821
|
+
default: withCtx(() => ["authorizationUrl" in flow.value ? (openBlock(), createBlock(RequestAuthDataTableInput_default, {
|
|
822
|
+
key: 0,
|
|
823
|
+
containerClass: "border-r-0",
|
|
824
|
+
environment: __props.environment,
|
|
825
|
+
modelValue: flow.value["x-scalar-secret-auth-url"] ?? "",
|
|
826
|
+
placeholder: "https://galaxy.scalar.com/authorize",
|
|
827
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = (v) => {
|
|
828
|
+
handleOauth2SecretsUpdate({ "x-scalar-secret-auth-url": v });
|
|
829
|
+
handleOauth2Update({ authorizationUrl: v });
|
|
830
|
+
})
|
|
831
|
+
}, {
|
|
832
|
+
default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode(" Auth URL ", -1)])]),
|
|
833
|
+
_: 1
|
|
834
|
+
}, 8, ["environment", "modelValue"])) : createCommentVNode("", true), "tokenUrl" in flow.value ? (openBlock(), createBlock(RequestAuthDataTableInput_default, {
|
|
835
|
+
key: 1,
|
|
836
|
+
environment: __props.environment,
|
|
837
|
+
modelValue: flow.value["x-scalar-secret-token-url"] ?? "",
|
|
838
|
+
placeholder: "https://galaxy.scalar.com/token",
|
|
839
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = (v) => {
|
|
840
|
+
handleOauth2SecretsUpdate({ "x-scalar-secret-token-url": v });
|
|
841
|
+
handleOauth2Update({ tokenUrl: v });
|
|
842
|
+
})
|
|
843
|
+
}, {
|
|
844
|
+
default: withCtx(() => [..._cache[15] || (_cache[15] = [createTextVNode(" Token URL ", -1)])]),
|
|
845
|
+
_: 1
|
|
846
|
+
}, 8, ["environment", "modelValue"])) : createCommentVNode("", true)]),
|
|
847
|
+
_: 1
|
|
848
|
+
}),
|
|
849
|
+
"x-scalar-secret-redirect-uri" in flow.value ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 0 }, {
|
|
850
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
851
|
+
environment: __props.environment,
|
|
852
|
+
modelValue: flow.value["x-scalar-secret-redirect-uri"],
|
|
853
|
+
placeholder: "https://galaxy.scalar.com/callback",
|
|
854
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = (v) => {
|
|
855
|
+
handleOauth2SecretsUpdate({ "x-scalar-secret-redirect-uri": v });
|
|
856
|
+
})
|
|
857
|
+
}, {
|
|
858
|
+
default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode(" Redirect URL ", -1)])]),
|
|
859
|
+
_: 1
|
|
860
|
+
}, 8, ["environment", "modelValue"])]),
|
|
861
|
+
_: 1
|
|
862
|
+
})) : createCommentVNode("", true),
|
|
863
|
+
"x-scalar-secret-username" in flow.value && "x-scalar-secret-password" in flow.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(unref(DataTableRow_default), null, {
|
|
864
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
865
|
+
class: "text-c-2",
|
|
866
|
+
environment: __props.environment,
|
|
867
|
+
modelValue: flow.value["x-scalar-secret-username"],
|
|
868
|
+
placeholder: "janedoe",
|
|
869
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-username": v }))
|
|
870
|
+
}, {
|
|
871
|
+
default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode(" Username ", -1)])]),
|
|
872
|
+
_: 1
|
|
873
|
+
}, 8, ["environment", "modelValue"])]),
|
|
874
|
+
_: 1
|
|
875
|
+
}), createVNode(unref(DataTableRow_default), null, {
|
|
876
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
877
|
+
environment: __props.environment,
|
|
878
|
+
modelValue: flow.value["x-scalar-secret-password"],
|
|
879
|
+
placeholder: "********",
|
|
880
|
+
type: "password",
|
|
881
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-password": v }))
|
|
882
|
+
}, {
|
|
883
|
+
default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode(" Password ", -1)])]),
|
|
884
|
+
_: 1
|
|
885
|
+
}, 8, ["environment", "modelValue"])]),
|
|
886
|
+
_: 1
|
|
887
|
+
})], 64)) : createCommentVNode("", true),
|
|
888
|
+
createVNode(unref(DataTableRow_default), null, {
|
|
889
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
890
|
+
environment: __props.environment,
|
|
891
|
+
modelValue: flow.value["x-scalar-secret-client-id"],
|
|
892
|
+
placeholder: "12345",
|
|
893
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-client-id": v }))
|
|
894
|
+
}, {
|
|
895
|
+
default: withCtx(() => [..._cache[19] || (_cache[19] = [createTextVNode(" Client ID ", -1)])]),
|
|
896
|
+
_: 1
|
|
897
|
+
}, 8, ["environment", "modelValue"])]),
|
|
898
|
+
_: 1
|
|
899
|
+
}),
|
|
900
|
+
"x-scalar-secret-client-secret" in flow.value ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 2 }, {
|
|
901
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
902
|
+
environment: __props.environment,
|
|
903
|
+
modelValue: flow.value["x-scalar-secret-client-secret"],
|
|
904
|
+
placeholder: "XYZ123",
|
|
905
|
+
type: "password",
|
|
906
|
+
"onUpdate:modelValue": _cache[8] || (_cache[8] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-client-secret": v }))
|
|
907
|
+
}, {
|
|
908
|
+
default: withCtx(() => [..._cache[20] || (_cache[20] = [createTextVNode(" Client Secret ", -1)])]),
|
|
909
|
+
_: 1
|
|
910
|
+
}, 8, ["environment", "modelValue"])]),
|
|
911
|
+
_: 1
|
|
912
|
+
})) : createCommentVNode("", true),
|
|
913
|
+
"x-usePkce" in flow.value ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 3 }, {
|
|
914
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
915
|
+
enum: unref(pkceOptions),
|
|
916
|
+
environment: __props.environment,
|
|
917
|
+
modelValue: flow.value["x-usePkce"],
|
|
918
|
+
readOnly: "",
|
|
919
|
+
"onUpdate:modelValue": _cache[9] || (_cache[9] = (v) => handleOauth2Update({ "x-usePkce": v }))
|
|
920
|
+
}, {
|
|
921
|
+
default: withCtx(() => [..._cache[21] || (_cache[21] = [createTextVNode(" Use PKCE ", -1)])]),
|
|
922
|
+
_: 1
|
|
923
|
+
}, 8, [
|
|
924
|
+
"enum",
|
|
925
|
+
"environment",
|
|
926
|
+
"modelValue"
|
|
927
|
+
])]),
|
|
928
|
+
_: 1
|
|
929
|
+
})) : createCommentVNode("", true),
|
|
930
|
+
__props.type !== "implicit" ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 4 }, {
|
|
931
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
932
|
+
enum: ["header", "body"],
|
|
933
|
+
environment: __props.environment,
|
|
934
|
+
modelValue: flow.value["x-scalar-credentials-location"] || "header",
|
|
935
|
+
placeholder: "header",
|
|
936
|
+
readOnly: "",
|
|
937
|
+
"onUpdate:modelValue": _cache[10] || (_cache[10] = (v) => handleSecretLocationUpdate(v))
|
|
938
|
+
}, {
|
|
939
|
+
default: withCtx(() => [..._cache[22] || (_cache[22] = [createTextVNode(" Credentials Location ", -1)])]),
|
|
940
|
+
_: 1
|
|
941
|
+
}, 8, ["environment", "modelValue"])]),
|
|
942
|
+
_: 1
|
|
943
|
+
})) : createCommentVNode("", true),
|
|
944
|
+
createVNode(unref(DataTableRow_default), null, {
|
|
945
|
+
default: withCtx(() => [createVNode(OAuthScopesInput_default, {
|
|
946
|
+
flow: flow.value,
|
|
947
|
+
flowType: __props.type,
|
|
948
|
+
selectedScopes: selectedScopes.value,
|
|
949
|
+
"onUpdate:selectedScopes": _cache[11] || (_cache[11] = (v) => emits("update:selectedScopes", v))
|
|
950
|
+
}, null, 8, [
|
|
951
|
+
"flow",
|
|
952
|
+
"flowType",
|
|
953
|
+
"selectedScopes"
|
|
954
|
+
])]),
|
|
955
|
+
_: 1
|
|
956
|
+
}),
|
|
957
|
+
createVNode(unref(DataTableRow_default), { class: "min-w-full" }, {
|
|
958
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_2$3, [__props.scheme.type === "openIdConnect" ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
959
|
+
key: 0,
|
|
960
|
+
class: "mr-1 p-0 px-2 py-0.5",
|
|
961
|
+
loader: unref(loader),
|
|
962
|
+
size: "sm",
|
|
963
|
+
variant: "outlined",
|
|
964
|
+
onClick: clearOauth2Secrets
|
|
965
|
+
}, {
|
|
966
|
+
default: withCtx(() => [..._cache[23] || (_cache[23] = [createTextVNode(" Clear ", -1)])]),
|
|
967
|
+
_: 1
|
|
968
|
+
}, 8, ["loader"])) : createCommentVNode("", true), createVNode(unref(ScalarButton), {
|
|
969
|
+
class: "mr-0.75 p-0 px-2 py-0.5",
|
|
970
|
+
loader: unref(loader),
|
|
971
|
+
size: "sm",
|
|
972
|
+
variant: "outlined",
|
|
973
|
+
onClick: handleAuthorize
|
|
974
|
+
}, {
|
|
975
|
+
default: withCtx(() => [..._cache[24] || (_cache[24] = [createTextVNode(" Authorize ", -1)])]),
|
|
976
|
+
_: 1
|
|
977
|
+
}, 8, ["loader"])])]),
|
|
978
|
+
_: 1
|
|
979
|
+
})
|
|
980
|
+
], 64));
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
//#endregion
|
|
985
|
+
//#region src/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.ts
|
|
986
|
+
/**
|
|
987
|
+
* OpenID Connect Discovery Document (subset)
|
|
988
|
+
* Represents the metadata fields consumed by the auth selector flow conversion.
|
|
989
|
+
*
|
|
990
|
+
* @see https://openid.net/specs/openid-connect-discovery-1_0.html
|
|
991
|
+
*/
|
|
992
|
+
var OpenIDConnectDiscoverySchema = Type.Object({
|
|
993
|
+
authorization_endpoint: Type.Optional(Type.String()),
|
|
994
|
+
token_endpoint: Type.Optional(Type.String()),
|
|
995
|
+
scopes_supported: Type.Optional(Type.Array(Type.String())),
|
|
996
|
+
grant_types_supported: Type.Optional(Type.Array(Type.String())),
|
|
997
|
+
code_challenge_methods_supported: Type.Optional(Type.Array(Type.String()))
|
|
998
|
+
});
|
|
999
|
+
/**
|
|
1000
|
+
* Fetches the OpenID Connect discovery document from the specified URL.
|
|
1001
|
+
* Supports both full discovery URLs and issuer URLs.
|
|
1002
|
+
*
|
|
1003
|
+
* @param url - The OpenID Connect discovery URL or issuer URL
|
|
1004
|
+
* @returns The discovery document or an error
|
|
1005
|
+
*/
|
|
1006
|
+
var fetchOpenIDConnectDiscovery = async (url, proxyUrl) => {
|
|
1007
|
+
try {
|
|
1008
|
+
let discoveryUrl = url.trim();
|
|
1009
|
+
if (!discoveryUrl) return [/* @__PURE__ */ new Error("URL cannot be empty"), null];
|
|
1010
|
+
if (discoveryUrl.endsWith("/")) discoveryUrl = discoveryUrl.slice(0, -1);
|
|
1011
|
+
if (!discoveryUrl.includes("/.well-known/openid-configuration")) discoveryUrl = `${discoveryUrl}/.well-known/openid-configuration`;
|
|
1012
|
+
const proxiedUrl = redirectToProxy(proxyUrl, discoveryUrl);
|
|
1013
|
+
const response = await fetch(proxiedUrl);
|
|
1014
|
+
if (!response.ok) return [/* @__PURE__ */ new Error(`Failed to fetch OpenID Connect discovery document: ${response.status} ${response.statusText}`), null];
|
|
1015
|
+
const data = coerceValue(OpenIDConnectDiscoverySchema, await response.json());
|
|
1016
|
+
if (!data.authorization_endpoint && !data.token_endpoint) return [/* @__PURE__ */ new Error("Invalid OpenID Connect discovery document: missing required endpoints"), null];
|
|
1017
|
+
return [null, data];
|
|
1018
|
+
} catch (error) {
|
|
1019
|
+
if (error instanceof Error) return [error, null];
|
|
1020
|
+
return [/* @__PURE__ */ new Error("Failed to fetch OpenID Connect discovery document"), null];
|
|
1021
|
+
}
|
|
1022
|
+
};
|
|
1023
|
+
//#endregion
|
|
1024
|
+
//#region src/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.ts
|
|
1025
|
+
/** Takes in an open ID Connect discovery response and converts it into an oauth flow to be used for authorization */
|
|
1026
|
+
var openIDDiscoveryToFlows = (discovery) => {
|
|
1027
|
+
const scopes = Object.fromEntries((discovery.scopes_supported ?? []).map((scope) => [scope, ""]));
|
|
1028
|
+
const grantTypes = new Set(discovery.grant_types_supported ?? ["authorization_code", "implicit"]);
|
|
1029
|
+
const authorizationUrl = discovery.authorization_endpoint;
|
|
1030
|
+
const tokenUrl = discovery.token_endpoint;
|
|
1031
|
+
const usePkce = discovery.code_challenge_methods_supported?.includes("S256") ? "SHA-256" : discovery.code_challenge_methods_supported?.includes("plain") ? "plain" : "no";
|
|
1032
|
+
const flows = {};
|
|
1033
|
+
if (grantTypes.has("implicit") && authorizationUrl) flows.implicit = {
|
|
1034
|
+
authorizationUrl,
|
|
1035
|
+
refreshUrl: authorizationUrl,
|
|
1036
|
+
scopes
|
|
1037
|
+
};
|
|
1038
|
+
if (grantTypes.has("password") && tokenUrl) flows.password = {
|
|
1039
|
+
tokenUrl,
|
|
1040
|
+
refreshUrl: tokenUrl,
|
|
1041
|
+
scopes
|
|
1042
|
+
};
|
|
1043
|
+
if (grantTypes.has("client_credentials") && tokenUrl) flows.clientCredentials = {
|
|
1044
|
+
tokenUrl,
|
|
1045
|
+
refreshUrl: tokenUrl,
|
|
1046
|
+
scopes
|
|
1047
|
+
};
|
|
1048
|
+
if (grantTypes.has("authorization_code") && authorizationUrl && tokenUrl) flows.authorizationCode = {
|
|
1049
|
+
authorizationUrl,
|
|
1050
|
+
tokenUrl,
|
|
1051
|
+
refreshUrl: tokenUrl,
|
|
1052
|
+
"x-usePkce": usePkce,
|
|
1053
|
+
scopes
|
|
1054
|
+
};
|
|
1055
|
+
return coerceValue(OpenIDConnectSchema, flows);
|
|
1056
|
+
};
|
|
1057
|
+
//#endregion
|
|
1058
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue?vue&type=script&setup=true&lang.ts
|
|
1059
|
+
var _hoisted_1$3 = { class: "flex h-8 w-full items-center justify-end border-t" };
|
|
1060
|
+
//#endregion
|
|
1061
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue
|
|
1062
|
+
var OpenIDConnect_default = /* @__PURE__ */ defineComponent({
|
|
1063
|
+
__name: "OpenIDConnect",
|
|
1064
|
+
props: {
|
|
1065
|
+
environment: {},
|
|
1066
|
+
eventBus: {},
|
|
1067
|
+
getStaticBorderClass: { type: Function },
|
|
1068
|
+
name: {},
|
|
1069
|
+
proxyUrl: {},
|
|
1070
|
+
scheme: {}
|
|
1071
|
+
},
|
|
1072
|
+
setup(__props) {
|
|
1073
|
+
const loader = useLoadingState();
|
|
1074
|
+
const { toast } = useToasts();
|
|
1075
|
+
/**
|
|
1076
|
+
* Fetches the OpenID Connect discovery document and triggers authorization
|
|
1077
|
+
*/
|
|
1078
|
+
const handleOpenIdConnect = async () => {
|
|
1079
|
+
if (loader.isLoading || !__props.scheme.openIdConnectUrl) return;
|
|
1080
|
+
loader.start();
|
|
1081
|
+
const [error, _discovery] = await fetchOpenIDConnectDiscovery(__props.scheme.openIdConnectUrl, __props.proxyUrl);
|
|
1082
|
+
await loader.clear();
|
|
1083
|
+
if (error) {
|
|
1084
|
+
console.error(error);
|
|
1085
|
+
toast(error?.message ?? "Failed to fetch OpenID Connect configuration", "error");
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
/** Set the newly discovered params in the secret store */
|
|
1089
|
+
const openIdConnect = openIDDiscoveryToFlows(_discovery);
|
|
1090
|
+
__props.eventBus.emit("auth:update:security-scheme-secrets", {
|
|
1091
|
+
payload: openIdConnect,
|
|
1092
|
+
name: __props.name,
|
|
1093
|
+
overwrite: true
|
|
1094
|
+
});
|
|
1095
|
+
};
|
|
1096
|
+
const handleUpdateOpenIdConnectUrl = (value) => __props.eventBus.emit("auth:update:security-scheme", {
|
|
1097
|
+
payload: {
|
|
1098
|
+
type: "openIdConnect",
|
|
1099
|
+
openIdConnectUrl: value
|
|
1100
|
+
},
|
|
1101
|
+
name: __props.name
|
|
1102
|
+
});
|
|
1103
|
+
return (_ctx, _cache) => {
|
|
1104
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(DataTableRow_default), null, {
|
|
1105
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
1106
|
+
containerClass: __props.getStaticBorderClass(),
|
|
1107
|
+
environment: __props.environment,
|
|
1108
|
+
modelValue: __props.scheme.openIdConnectUrl,
|
|
1109
|
+
placeholder: "https://example.com/.well-known/openid-configuration",
|
|
1110
|
+
required: "",
|
|
1111
|
+
"onUpdate:modelValue": handleUpdateOpenIdConnectUrl
|
|
1112
|
+
}, {
|
|
1113
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Discovery URL ", -1)])]),
|
|
1114
|
+
_: 1
|
|
1115
|
+
}, 8, [
|
|
1116
|
+
"containerClass",
|
|
1117
|
+
"environment",
|
|
1118
|
+
"modelValue"
|
|
1119
|
+
])]),
|
|
1120
|
+
_: 1
|
|
1121
|
+
}), createVNode(unref(DataTableRow_default), { class: "min-w-full" }, {
|
|
1122
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$3, [createVNode(unref(ScalarButton), {
|
|
1123
|
+
class: "mr-0.75 p-0 px-2 py-0.5",
|
|
1124
|
+
disabled: !__props.scheme.openIdConnectUrl,
|
|
1125
|
+
loader: unref(loader),
|
|
1126
|
+
size: "sm",
|
|
1127
|
+
variant: "outlined",
|
|
1128
|
+
onClick: handleOpenIdConnect
|
|
1129
|
+
}, {
|
|
1130
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" Fetch Configuration ", -1)])]),
|
|
1131
|
+
_: 1
|
|
1132
|
+
}, 8, ["disabled", "loader"])])]),
|
|
1133
|
+
_: 1
|
|
1134
|
+
})], 64);
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
});
|
|
1138
|
+
//#endregion
|
|
1139
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue?vue&type=script&setup=true&lang.ts
|
|
1140
|
+
var _hoisted_1$2 = { class: "bg-b-1 min-w-0 flex-1 px-3 py-1.25" };
|
|
1141
|
+
var _hoisted_2$2 = { class: "text-c-1 leading-5.5 font-medium" };
|
|
1142
|
+
var _hoisted_3$1 = { class: "flex min-h-8 border-t text-base" };
|
|
1143
|
+
var _hoisted_4 = { class: "flex h-8 max-w-full gap-2.5 overflow-x-auto px-3" };
|
|
1144
|
+
var _hoisted_5 = ["onClick"];
|
|
1145
|
+
var _hoisted_6 = { class: "relative z-10" };
|
|
1146
|
+
var _hoisted_7 = {
|
|
1147
|
+
key: 5,
|
|
1148
|
+
class: "text-c-3 flex items-center justify-center border-t p-4 px-4 text-center text-xs text-balance"
|
|
1149
|
+
};
|
|
1150
|
+
//#endregion
|
|
1151
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue
|
|
1152
|
+
var RequestAuthTab_default = /* @__PURE__ */ defineComponent({
|
|
1153
|
+
__name: "RequestAuthTab",
|
|
1154
|
+
props: {
|
|
1155
|
+
environment: {},
|
|
1156
|
+
isStatic: { type: Boolean },
|
|
1157
|
+
proxyUrl: {},
|
|
1158
|
+
selectedSecuritySchemas: {},
|
|
1159
|
+
securitySchemes: {},
|
|
1160
|
+
server: {},
|
|
1161
|
+
eventBus: {}
|
|
1162
|
+
},
|
|
1163
|
+
emits: ["update:selectedScopes"],
|
|
1164
|
+
setup(__props, { emit: __emit }) {
|
|
1165
|
+
const emits = __emit;
|
|
1166
|
+
/**
|
|
1167
|
+
* Resolves security schemes from the OpenAPI document and combines them with their selected scopes.
|
|
1168
|
+
* Each item includes the scheme definition, name, and associated scopes.
|
|
1169
|
+
*/
|
|
1170
|
+
const security = computed(() => Object.entries(__props.selectedSecuritySchemas).map(([name, scopes = []]) => ({
|
|
1171
|
+
scheme: getResolvedRef(__props.securitySchemes[name]),
|
|
1172
|
+
name,
|
|
1173
|
+
scopes
|
|
1174
|
+
})));
|
|
1175
|
+
/** Tracks which OAuth2 flow is currently active when multiple flows are available. */
|
|
1176
|
+
const activeFlow = ref("");
|
|
1177
|
+
/** Keeps the selected flow in sync with currently available flow keys. */
|
|
1178
|
+
const selectedFlow = computed(() => {
|
|
1179
|
+
return security.value.flatMap(({ scheme }) => {
|
|
1180
|
+
if (scheme?.type !== "oauth2" && scheme?.type !== "openIdConnect") return [];
|
|
1181
|
+
return Object.keys(scheme.flows ?? {});
|
|
1182
|
+
}).includes(activeFlow.value) ? activeFlow.value : "";
|
|
1183
|
+
});
|
|
1184
|
+
const setActiveFlow = (flow) => {
|
|
1185
|
+
activeFlow.value = flow;
|
|
1186
|
+
};
|
|
1187
|
+
/** Determines if multiple auth schemes are configured, which affects the UI layout. */
|
|
1188
|
+
const hasMultipleSchemes = computed(() => security.value.length > 1);
|
|
1189
|
+
/**
|
|
1190
|
+
* Generates a human-readable label for the security scheme.
|
|
1191
|
+
* Intentionally omits the description here — it is rendered separately as
|
|
1192
|
+
* rich text via ScalarMarkdownSummary so markdown formatting is preserved.
|
|
1193
|
+
*/
|
|
1194
|
+
const generateLabel = (name, scheme) => {
|
|
1195
|
+
const capitalizedName = capitalize(name);
|
|
1196
|
+
switch (scheme.type) {
|
|
1197
|
+
case "apiKey": return `${capitalizedName}: ${scheme.in}`;
|
|
1198
|
+
case "openIdConnect":
|
|
1199
|
+
case "oauth2": {
|
|
1200
|
+
const firstFlow = Object.keys(scheme.flows ?? {})[0];
|
|
1201
|
+
const currentFlow = selectedFlow.value || firstFlow;
|
|
1202
|
+
if (!currentFlow) return capitalizedName;
|
|
1203
|
+
return `${capitalizedName}: ${currentFlow}`;
|
|
1204
|
+
}
|
|
1205
|
+
case "http": return `${capitalizedName}: ${scheme.scheme}`;
|
|
1206
|
+
default: return capitalizedName;
|
|
1207
|
+
}
|
|
1208
|
+
};
|
|
1209
|
+
/**
|
|
1210
|
+
* Determines if an OAuth2 flow tab should be active.
|
|
1211
|
+
* The first flow is active by default if no flow is explicitly selected.
|
|
1212
|
+
*/
|
|
1213
|
+
const isFlowActive = (flowKey, index) => selectedFlow.value === flowKey || index === 0 && !selectedFlow.value;
|
|
1214
|
+
/** Computes the container class for static display mode. */
|
|
1215
|
+
const getStaticBorderClass = () => __props.isStatic && "border-t";
|
|
1216
|
+
const handleHttpSecretsUpdate = (payload, name) => __props.eventBus.emit("auth:update:security-scheme-secrets", {
|
|
1217
|
+
payload: {
|
|
1218
|
+
type: "http",
|
|
1219
|
+
...payload
|
|
1220
|
+
},
|
|
1221
|
+
name
|
|
1222
|
+
});
|
|
1223
|
+
const handleApiKeySecretsUpdate = (payload, name) => __props.eventBus.emit("auth:update:security-scheme-secrets", {
|
|
1224
|
+
payload: {
|
|
1225
|
+
type: "apiKey",
|
|
1226
|
+
...payload
|
|
1227
|
+
},
|
|
1228
|
+
name
|
|
1229
|
+
});
|
|
1230
|
+
const handleApiKeySecuritySchemeUpdate = (payload, name) => __props.eventBus.emit("auth:update:security-scheme", {
|
|
1231
|
+
payload: {
|
|
1232
|
+
type: "apiKey",
|
|
1233
|
+
...payload
|
|
1234
|
+
},
|
|
1235
|
+
name
|
|
1236
|
+
});
|
|
1237
|
+
/** Handles scope selection updates for OAuth2 */
|
|
1238
|
+
const handleScopesUpdate = (name, event) => {
|
|
1239
|
+
emits("update:selectedScopes", {
|
|
1240
|
+
id: Object.keys(__props.selectedSecuritySchemas),
|
|
1241
|
+
name,
|
|
1242
|
+
...event
|
|
1243
|
+
});
|
|
1244
|
+
};
|
|
1245
|
+
/**
|
|
1246
|
+
* Computes dynamic classes for OAuth2 flow tabs based on active state.
|
|
1247
|
+
*/
|
|
1248
|
+
const getFlowTabClasses = (flowKey, index) => {
|
|
1249
|
+
const baseClasses = "floating-bg text-c-3 relative cursor-pointer border-b border-transparent py-1 text-base font-medium";
|
|
1250
|
+
return isFlowActive(flowKey, index) ? `${baseClasses} !text-c-1 !rounded-none border-b !border-current ${__props.isStatic ? "opacity-100" : ""}` : baseClasses;
|
|
1251
|
+
};
|
|
1252
|
+
return (_ctx, _cache) => {
|
|
1253
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(security.value, ({ scheme, name, scopes }) => {
|
|
1254
|
+
return openBlock(), createElementBlock(Fragment, { key: name }, [
|
|
1255
|
+
hasMultipleSchemes.value && scheme ? (openBlock(), createBlock(unref(DataTableRow_default$1), { key: 0 }, {
|
|
1256
|
+
default: withCtx(() => [createVNode(unref(DataTableCell_default$1), {
|
|
1257
|
+
"aria-label": generateLabel(name, scheme),
|
|
1258
|
+
class: "max-h-[auto]"
|
|
1259
|
+
}, {
|
|
1260
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$2, [createElementVNode("p", _hoisted_2$2, toDisplayString(generateLabel(name, scheme)), 1), scheme.description ? (openBlock(), createBlock(unref(ScalarMarkdownSummary), {
|
|
1261
|
+
key: 0,
|
|
1262
|
+
class: "auth-description text-c-2 w-full",
|
|
1263
|
+
value: scheme.description
|
|
1264
|
+
}, null, 8, ["value"])) : createCommentVNode("", true)])]),
|
|
1265
|
+
_: 2
|
|
1266
|
+
}, 1032, ["aria-label"])]),
|
|
1267
|
+
_: 2
|
|
1268
|
+
}, 1024)) : createCommentVNode("", true),
|
|
1269
|
+
scheme?.description && !hasMultipleSchemes.value ? (openBlock(), createBlock(unref(DataTableRow_default$1), { key: 1 }, {
|
|
1270
|
+
default: withCtx(() => [createVNode(unref(DataTableCell_default$1), {
|
|
1271
|
+
"aria-label": scheme.description,
|
|
1272
|
+
class: "max-h-[auto]"
|
|
1273
|
+
}, {
|
|
1274
|
+
default: withCtx(() => [createVNode(unref(ScalarMarkdownSummary), {
|
|
1275
|
+
class: "auth-description bg-b-1 text-c-2 min-w-0 flex-1 px-3 py-1.25",
|
|
1276
|
+
value: scheme.description
|
|
1277
|
+
}, null, 8, ["value"])]),
|
|
1278
|
+
_: 2
|
|
1279
|
+
}, 1032, ["aria-label"])]),
|
|
1280
|
+
_: 2
|
|
1281
|
+
}, 1024)) : createCommentVNode("", true),
|
|
1282
|
+
scheme?.type === "http" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [scheme.scheme === "bearer" ? (openBlock(), createBlock(unref(DataTableRow_default$1), { key: 0 }, {
|
|
1283
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
1284
|
+
containerClass: getStaticBorderClass(),
|
|
1285
|
+
environment: __props.environment,
|
|
1286
|
+
modelValue: scheme["x-scalar-secret-token"],
|
|
1287
|
+
placeholder: "Token",
|
|
1288
|
+
type: "password",
|
|
1289
|
+
"onUpdate:modelValue": (v) => handleHttpSecretsUpdate({ "x-scalar-secret-token": v }, name)
|
|
1290
|
+
}, {
|
|
1291
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Bearer Token ", -1)])]),
|
|
1292
|
+
_: 1
|
|
1293
|
+
}, 8, [
|
|
1294
|
+
"containerClass",
|
|
1295
|
+
"environment",
|
|
1296
|
+
"modelValue",
|
|
1297
|
+
"onUpdate:modelValue"
|
|
1298
|
+
])]),
|
|
1299
|
+
_: 2
|
|
1300
|
+
}, 1024)) : scheme?.scheme === "basic" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(unref(DataTableRow_default$1), null, {
|
|
1301
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
1302
|
+
class: "text-c-2",
|
|
1303
|
+
environment: __props.environment,
|
|
1304
|
+
modelValue: scheme["x-scalar-secret-username"],
|
|
1305
|
+
placeholder: "janedoe",
|
|
1306
|
+
required: "",
|
|
1307
|
+
"onUpdate:modelValue": (v) => handleHttpSecretsUpdate({ "x-scalar-secret-username": v }, name)
|
|
1308
|
+
}, {
|
|
1309
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" Username ", -1)])]),
|
|
1310
|
+
_: 1
|
|
1311
|
+
}, 8, [
|
|
1312
|
+
"environment",
|
|
1313
|
+
"modelValue",
|
|
1314
|
+
"onUpdate:modelValue"
|
|
1315
|
+
])]),
|
|
1316
|
+
_: 2
|
|
1317
|
+
}, 1024), createVNode(unref(DataTableRow_default$1), null, {
|
|
1318
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
1319
|
+
environment: __props.environment,
|
|
1320
|
+
modelValue: scheme["x-scalar-secret-password"],
|
|
1321
|
+
placeholder: "********",
|
|
1322
|
+
type: "password",
|
|
1323
|
+
"onUpdate:modelValue": (v) => handleHttpSecretsUpdate({ "x-scalar-secret-password": v }, name)
|
|
1324
|
+
}, {
|
|
1325
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" Password ", -1)])]),
|
|
1326
|
+
_: 1
|
|
1327
|
+
}, 8, [
|
|
1328
|
+
"environment",
|
|
1329
|
+
"modelValue",
|
|
1330
|
+
"onUpdate:modelValue"
|
|
1331
|
+
])]),
|
|
1332
|
+
_: 2
|
|
1333
|
+
}, 1024)], 64)) : createCommentVNode("", true)], 64)) : scheme?.type === "apiKey" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createVNode(unref(DataTableRow_default$1), null, {
|
|
1334
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
1335
|
+
containerClass: getStaticBorderClass(),
|
|
1336
|
+
environment: __props.environment,
|
|
1337
|
+
modelValue: scheme.name,
|
|
1338
|
+
placeholder: "api-key",
|
|
1339
|
+
"onUpdate:modelValue": (v) => handleApiKeySecuritySchemeUpdate({ name: v }, name)
|
|
1340
|
+
}, {
|
|
1341
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode(" Name ", -1)])]),
|
|
1342
|
+
_: 1
|
|
1343
|
+
}, 8, [
|
|
1344
|
+
"containerClass",
|
|
1345
|
+
"environment",
|
|
1346
|
+
"modelValue",
|
|
1347
|
+
"onUpdate:modelValue"
|
|
1348
|
+
])]),
|
|
1349
|
+
_: 2
|
|
1350
|
+
}, 1024), createVNode(unref(DataTableRow_default$1), null, {
|
|
1351
|
+
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
1352
|
+
environment: __props.environment,
|
|
1353
|
+
modelValue: scheme["x-scalar-secret-token"],
|
|
1354
|
+
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
1355
|
+
type: "password",
|
|
1356
|
+
"onUpdate:modelValue": (v) => handleApiKeySecretsUpdate({ "x-scalar-secret-token": v }, name)
|
|
1357
|
+
}, {
|
|
1358
|
+
default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode(" Value ", -1)])]),
|
|
1359
|
+
_: 1
|
|
1360
|
+
}, 8, [
|
|
1361
|
+
"environment",
|
|
1362
|
+
"modelValue",
|
|
1363
|
+
"onUpdate:modelValue"
|
|
1364
|
+
])]),
|
|
1365
|
+
_: 2
|
|
1366
|
+
}, 1024)], 64)) : scheme?.type === "oauth2" || scheme?.type === "openIdConnect" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
1367
|
+
scheme?.type === "openIdConnect" && !Object.keys(scheme.flows ?? {}).length ? (openBlock(), createBlock(OpenIDConnect_default, {
|
|
1368
|
+
key: 0,
|
|
1369
|
+
environment: __props.environment,
|
|
1370
|
+
eventBus: __props.eventBus,
|
|
1371
|
+
getStaticBorderClass,
|
|
1372
|
+
name,
|
|
1373
|
+
proxyUrl: __props.proxyUrl,
|
|
1374
|
+
scheme
|
|
1375
|
+
}, null, 8, [
|
|
1376
|
+
"environment",
|
|
1377
|
+
"eventBus",
|
|
1378
|
+
"name",
|
|
1379
|
+
"proxyUrl",
|
|
1380
|
+
"scheme"
|
|
1381
|
+
])) : createCommentVNode("", true),
|
|
1382
|
+
Object.keys(scheme.flows ?? {}).length > 1 ? (openBlock(), createBlock(unref(DataTableRow_default$1), { key: 1 }, {
|
|
1383
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_3$1, [createElementVNode("div", _hoisted_4, [(openBlock(true), createElementBlock(Fragment, null, renderList(scheme.flows, (_, key, ind) => {
|
|
1384
|
+
return openBlock(), createElementBlock("button", {
|
|
1385
|
+
key,
|
|
1386
|
+
class: normalizeClass(getFlowTabClasses(key, ind)),
|
|
1387
|
+
type: "button",
|
|
1388
|
+
onClick: ($event) => setActiveFlow(key)
|
|
1389
|
+
}, [createElementVNode("span", _hoisted_6, toDisplayString(key), 1)], 10, _hoisted_5);
|
|
1390
|
+
}), 128))])])]),
|
|
1391
|
+
_: 2
|
|
1392
|
+
}, 1024)) : createCommentVNode("", true),
|
|
1393
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(scheme.flows, (_flow, key, ind) => {
|
|
1394
|
+
return openBlock(), createElementBlock(Fragment, { key }, [scheme.flows && isFlowActive(key, ind) ? (openBlock(), createBlock(OAuth2_default, {
|
|
1395
|
+
key: 0,
|
|
1396
|
+
environment: __props.environment,
|
|
1397
|
+
eventBus: __props.eventBus,
|
|
1398
|
+
flows: scheme.flows,
|
|
1399
|
+
name,
|
|
1400
|
+
proxyUrl: __props.proxyUrl,
|
|
1401
|
+
scheme,
|
|
1402
|
+
selectedScopes: scopes,
|
|
1403
|
+
server: __props.server,
|
|
1404
|
+
type: key,
|
|
1405
|
+
"onUpdate:selectedScopes": (event) => handleScopesUpdate(name, event)
|
|
1406
|
+
}, null, 8, [
|
|
1407
|
+
"environment",
|
|
1408
|
+
"eventBus",
|
|
1409
|
+
"flows",
|
|
1410
|
+
"name",
|
|
1411
|
+
"proxyUrl",
|
|
1412
|
+
"scheme",
|
|
1413
|
+
"selectedScopes",
|
|
1414
|
+
"server",
|
|
1415
|
+
"type",
|
|
1416
|
+
"onUpdate:selectedScopes"
|
|
1417
|
+
])) : createCommentVNode("", true)], 64);
|
|
1418
|
+
}), 128))
|
|
1419
|
+
], 64)) : (openBlock(), createElementBlock("div", _hoisted_7, " The security scheme is missing a type, please double check your OpenAPI document or Authentication Configuration "))
|
|
1420
|
+
], 64);
|
|
1421
|
+
}), 128);
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
});
|
|
1425
|
+
//#endregion
|
|
1426
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue?vue&type=script&setup=true&lang.ts
|
|
1427
|
+
var _hoisted_1$1 = ["onClick"];
|
|
1428
|
+
var _hoisted_2$1 = { class: "relative z-10 font-medium whitespace-nowrap" };
|
|
1429
|
+
var _hoisted_3 = {
|
|
1430
|
+
key: 0,
|
|
1431
|
+
class: "absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current"
|
|
1432
|
+
};
|
|
1433
|
+
//#endregion
|
|
1434
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue
|
|
1435
|
+
var RequestAuthDataTable_default = /* @__PURE__ */ defineComponent({
|
|
1436
|
+
__name: "RequestAuthDataTable",
|
|
1437
|
+
props: {
|
|
1438
|
+
environment: {},
|
|
1439
|
+
isStatic: { type: Boolean },
|
|
1440
|
+
selectedSchemeOptions: {},
|
|
1441
|
+
activeAuthIndex: {},
|
|
1442
|
+
proxyUrl: {},
|
|
1443
|
+
securitySchemes: { default: () => ({}) },
|
|
1444
|
+
server: {},
|
|
1445
|
+
eventBus: {},
|
|
1446
|
+
meta: {}
|
|
1447
|
+
},
|
|
1448
|
+
setup(__props, { expose: __expose }) {
|
|
1449
|
+
/** Currently selected authentication scheme based on the active tab index */
|
|
1450
|
+
const activeScheme = computed(() => __props.selectedSchemeOptions[__props.activeAuthIndex]);
|
|
1451
|
+
/**
|
|
1452
|
+
* Whether to display multiple authentication tabs.
|
|
1453
|
+
* Only shows tabs when there are 2 or more schemes available.
|
|
1454
|
+
*/
|
|
1455
|
+
const shouldShowTabs = computed(() => __props.selectedSchemeOptions.length > 1);
|
|
1456
|
+
/** Handles authentication tab selection */
|
|
1457
|
+
const handleTabChange = (index) => __props.eventBus.emit("auth:update:active-index", {
|
|
1458
|
+
index,
|
|
1459
|
+
meta: __props.meta
|
|
1460
|
+
});
|
|
1461
|
+
/** Handles updates to OAuth scope selection */
|
|
1462
|
+
const handleScopesUpdate = (params) => __props.eventBus.emit("auth:update:selected-scopes", {
|
|
1463
|
+
...params,
|
|
1464
|
+
meta: __props.meta
|
|
1465
|
+
});
|
|
1466
|
+
/** Determines if a tab is currently active */
|
|
1467
|
+
const isTabActive = (index) => __props.activeAuthIndex === index;
|
|
1468
|
+
/** Expose the active scheme for parent component access */
|
|
1469
|
+
__expose({ activeScheme });
|
|
1470
|
+
return (_ctx, _cache) => {
|
|
1471
|
+
return openBlock(), createElementBlock("form", { onSubmit: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"])) }, [shouldShowTabs.value ? (openBlock(), createElementBlock("div", {
|
|
1472
|
+
key: 0,
|
|
1473
|
+
class: normalizeClass(["box-content flex flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3", { "border-x-0": !__props.isStatic }]),
|
|
1474
|
+
"data-testid": "auth-tabs"
|
|
1475
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.selectedSchemeOptions, (option, index) => {
|
|
1476
|
+
return openBlock(), createElementBlock("div", {
|
|
1477
|
+
key: option.id,
|
|
1478
|
+
class: "relative z-1 -mb-[var(--scalar-border-width)] flex h-8"
|
|
1479
|
+
}, [createElementVNode("button", {
|
|
1480
|
+
class: normalizeClass(["floating-bg relative cursor-pointer border-b border-transparent py-1 text-sm font-medium transition-colors", isTabActive(index) ? "text-c-1" : "text-c-3"]),
|
|
1481
|
+
type: "button",
|
|
1482
|
+
onClick: ($event) => handleTabChange(index)
|
|
1483
|
+
}, [createElementVNode("span", _hoisted_2$1, toDisplayString(option.label), 1)], 10, _hoisted_1$1), isTabActive(index) ? (openBlock(), createElementBlock("div", _hoisted_3)) : createCommentVNode("", true)]);
|
|
1484
|
+
}), 128))], 2)) : createCommentVNode("", true), activeScheme.value ? (openBlock(), createBlock(unref(DataTable_default), {
|
|
1485
|
+
key: 1,
|
|
1486
|
+
class: normalizeClass(["flex-1", { "bg-b-1 rounded-b-lg border border-t-0": __props.isStatic }]),
|
|
1487
|
+
columns: [""],
|
|
1488
|
+
presentational: ""
|
|
1489
|
+
}, {
|
|
1490
|
+
default: withCtx(() => [createVNode(RequestAuthTab_default, {
|
|
1491
|
+
environment: __props.environment,
|
|
1492
|
+
eventBus: __props.eventBus,
|
|
1493
|
+
isStatic: __props.isStatic,
|
|
1494
|
+
proxyUrl: __props.proxyUrl,
|
|
1495
|
+
securitySchemes: __props.securitySchemes,
|
|
1496
|
+
selectedSecuritySchemas: activeScheme.value.value,
|
|
1497
|
+
server: __props.server,
|
|
1498
|
+
"onUpdate:selectedScopes": handleScopesUpdate
|
|
1499
|
+
}, null, 8, [
|
|
1500
|
+
"environment",
|
|
1501
|
+
"eventBus",
|
|
1502
|
+
"isStatic",
|
|
1503
|
+
"proxyUrl",
|
|
1504
|
+
"securitySchemes",
|
|
1505
|
+
"selectedSecuritySchemas",
|
|
1506
|
+
"server"
|
|
1507
|
+
])]),
|
|
1508
|
+
_: 1
|
|
1509
|
+
}, 8, ["class"])) : (openBlock(), createElementBlock("div", {
|
|
1510
|
+
key: 2,
|
|
1511
|
+
class: normalizeClass(["bg-b-1 text-c-3 flex min-h-16 items-center justify-center border-t px-4 text-sm", { "min-h-[calc(4rem+0.5px)] rounded-b-lg border": __props.isStatic }])
|
|
1512
|
+
}, " No authentication selected ", 2))], 32);
|
|
1513
|
+
};
|
|
1514
|
+
}
|
|
1515
|
+
});
|
|
1516
|
+
//#endregion
|
|
1517
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue?vue&type=script&setup=true&lang.ts
|
|
1518
|
+
var _hoisted_1 = ["id"];
|
|
1519
|
+
var _hoisted_2 = { class: "min-w-0 flex-1 truncate" };
|
|
1520
|
+
//#endregion
|
|
1521
|
+
//#region src/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue
|
|
1522
|
+
var AuthSelector_default = /* @__PURE__ */ defineComponent({
|
|
1523
|
+
__name: "AuthSelector",
|
|
1524
|
+
props: {
|
|
1525
|
+
environment: {},
|
|
1526
|
+
eventBus: {},
|
|
1527
|
+
createAnySecurityScheme: {
|
|
1528
|
+
type: Boolean,
|
|
1529
|
+
default: false
|
|
1530
|
+
},
|
|
1531
|
+
defaultOpen: {
|
|
1532
|
+
type: Boolean,
|
|
1533
|
+
default: true
|
|
1534
|
+
},
|
|
1535
|
+
isStatic: {
|
|
1536
|
+
type: Boolean,
|
|
1537
|
+
default: false
|
|
1538
|
+
},
|
|
1539
|
+
meta: {},
|
|
1540
|
+
proxyUrl: {},
|
|
1541
|
+
securityRequirements: {},
|
|
1542
|
+
securitySchemes: {},
|
|
1543
|
+
selectedSecurity: {},
|
|
1544
|
+
server: {},
|
|
1545
|
+
title: {}
|
|
1546
|
+
},
|
|
1547
|
+
setup(__props, { expose: __expose }) {
|
|
1548
|
+
const titleId = useId();
|
|
1549
|
+
const comboboxButtonRef = ref(null);
|
|
1550
|
+
const isDisclosureOpen = ref(false);
|
|
1551
|
+
const deleteModal = useModal();
|
|
1552
|
+
const schemeToDelete = ref(null);
|
|
1553
|
+
/**
|
|
1554
|
+
* Determines if authentication is required or optional
|
|
1555
|
+
*
|
|
1556
|
+
* Auth is optional when there is an empty security requirement and no complex requirements.
|
|
1557
|
+
* Complex requirements have multiple auth schemes combined (e.g., API key + OAuth).
|
|
1558
|
+
*/
|
|
1559
|
+
const authIndicator = computed(() => {
|
|
1560
|
+
if (!__props.securityRequirements?.length) return null;
|
|
1561
|
+
const isOptional = isAuthOptional(__props.securityRequirements);
|
|
1562
|
+
return {
|
|
1563
|
+
icon: isOptional ? "Unlock" : "Lock",
|
|
1564
|
+
text: isOptional ? "Optional" : "Required"
|
|
1565
|
+
};
|
|
1566
|
+
});
|
|
1567
|
+
/** All available auth scheme options for the dropdown */
|
|
1568
|
+
const availableSchemeOptions = computed(() => getSecuritySchemeOptions(__props.securityRequirements ?? [], __props.securitySchemes ?? {}, __props.selectedSecurity?.selectedSchemes ?? [], __props.createAnySecurityScheme));
|
|
1569
|
+
/** Currently active auth schemes selected for this operation or collection */
|
|
1570
|
+
const activeSchemeOptions = computed(() => {
|
|
1571
|
+
const schemes = __props.selectedSecurity?.selectedSchemes;
|
|
1572
|
+
if (!schemes?.length) return [];
|
|
1573
|
+
return schemes.flatMap((requirement) => {
|
|
1574
|
+
const schemeNames = Object.keys(requirement);
|
|
1575
|
+
if (schemeNames.length === 0) return [];
|
|
1576
|
+
if (schemeNames.length > 1) return formatComplexScheme(requirement);
|
|
1577
|
+
const schemeName = schemeNames[0];
|
|
1578
|
+
if (!schemeName) return [];
|
|
1579
|
+
if (!getResolvedRef(__props.securitySchemes?.[schemeName])) return [];
|
|
1580
|
+
return formatScheme({
|
|
1581
|
+
name: schemeName,
|
|
1582
|
+
value: requirement
|
|
1583
|
+
});
|
|
1584
|
+
});
|
|
1585
|
+
});
|
|
1586
|
+
/**
|
|
1587
|
+
* Opens the combobox dropdown when clicking the auth indicator badge.
|
|
1588
|
+
* Prevents the disclosure from toggling if it is already open.
|
|
1589
|
+
*/
|
|
1590
|
+
const handleAuthIndicatorClick = (event) => {
|
|
1591
|
+
if (isDisclosureOpen.value) event.stopPropagation();
|
|
1592
|
+
comboboxButtonRef.value?.$el.click();
|
|
1593
|
+
};
|
|
1594
|
+
/**
|
|
1595
|
+
* Updates the selected auth schemes.
|
|
1596
|
+
* Separates existing schemes from newly created ones for the event payload.
|
|
1597
|
+
*/
|
|
1598
|
+
const handleSchemeSelection = (selected) => {
|
|
1599
|
+
const existingSchemes = selected.filter((option) => option.payload === void 0).map((option) => unpackProxyObject(option.value, { depth: 2 }));
|
|
1600
|
+
const newSchemes = selected.filter((option) => option.payload !== void 0).map((option) => ({
|
|
1601
|
+
name: option.label,
|
|
1602
|
+
scheme: option.payload
|
|
1603
|
+
}));
|
|
1604
|
+
__props.eventBus.emit("auth:update:selected-security-schemes", {
|
|
1605
|
+
selectedRequirements: existingSchemes,
|
|
1606
|
+
newSchemes,
|
|
1607
|
+
meta: __props.meta
|
|
1608
|
+
});
|
|
1609
|
+
};
|
|
1610
|
+
/** Shows the delete confirmation modal for the selected scheme */
|
|
1611
|
+
const handleDeleteRequest = (option) => {
|
|
1612
|
+
schemeToDelete.value = {
|
|
1613
|
+
label: option.label,
|
|
1614
|
+
payload: option.value
|
|
1615
|
+
};
|
|
1616
|
+
deleteModal.show();
|
|
1617
|
+
};
|
|
1618
|
+
/** Deletes the selected auth scheme after confirmation */
|
|
1619
|
+
const handleDeleteConfirm = () => {
|
|
1620
|
+
if (!schemeToDelete.value) return;
|
|
1621
|
+
__props.eventBus.emit("auth:delete:security-scheme", { names: Object.keys(schemeToDelete.value.payload) });
|
|
1622
|
+
schemeToDelete.value = null;
|
|
1623
|
+
deleteModal.hide();
|
|
1624
|
+
};
|
|
1625
|
+
__expose({
|
|
1626
|
+
authIndicator,
|
|
1627
|
+
selectedSchemeOptions: activeSchemeOptions,
|
|
1628
|
+
schemeOptions: availableSchemeOptions
|
|
1629
|
+
});
|
|
1630
|
+
return (_ctx, _cache) => {
|
|
1631
|
+
return openBlock(), createBlock(unref(CollapsibleSection_default), {
|
|
1632
|
+
class: "group/params relative",
|
|
1633
|
+
defaultOpen: __props.defaultOpen,
|
|
1634
|
+
isStatic: __props.isStatic,
|
|
1635
|
+
itemCount: activeSchemeOptions.value.length,
|
|
1636
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = (open) => isDisclosureOpen.value = open)
|
|
1637
|
+
}, {
|
|
1638
|
+
title: withCtx(() => [createElementVNode("div", {
|
|
1639
|
+
id: unref(titleId),
|
|
1640
|
+
class: "inline-flex items-center gap-0.5 leading-[20px]"
|
|
1641
|
+
}, [createElementVNode("span", null, toDisplayString(__props.title), 1), authIndicator.value ? (openBlock(), createElementBlock("span", {
|
|
1642
|
+
key: 0,
|
|
1643
|
+
class: normalizeClass(["text-c-3 hover:bg-b-3 hover:text-c-1 -my-0.5 -mr-1 cursor-pointer rounded px-1 py-0.5 leading-[normal] font-normal", { "text-c-1": authIndicator.value.text === "Required" }]),
|
|
1644
|
+
"data-testid": "auth-indicator",
|
|
1645
|
+
onClick: handleAuthIndicatorClick
|
|
1646
|
+
}, toDisplayString(authIndicator.value.text), 3)) : createCommentVNode("", true)], 8, _hoisted_1)]),
|
|
1647
|
+
actions: withCtx(() => [createVNode(unref(ScalarComboboxMultiselect), {
|
|
1648
|
+
class: "w-72 text-xs",
|
|
1649
|
+
modelValue: activeSchemeOptions.value,
|
|
1650
|
+
multiple: "",
|
|
1651
|
+
options: availableSchemeOptions.value,
|
|
1652
|
+
placement: "bottom-end",
|
|
1653
|
+
teleport: "",
|
|
1654
|
+
onDelete: handleDeleteRequest,
|
|
1655
|
+
"onUpdate:modelValue": handleSchemeSelection
|
|
1656
|
+
}, {
|
|
1657
|
+
option: withCtx(({ option, selected }) => [
|
|
1658
|
+
createVNode(unref(ScalarListboxCheckbox), {
|
|
1659
|
+
multiselect: "",
|
|
1660
|
+
selected
|
|
1661
|
+
}, null, 8, ["selected"]),
|
|
1662
|
+
createElementVNode("div", _hoisted_2, toDisplayString(option.label), 1),
|
|
1663
|
+
option.isDeletable ? (openBlock(), createBlock(unref(ScalarIconButton), {
|
|
1664
|
+
key: 0,
|
|
1665
|
+
class: "-m-0.5 shrink-0 p-0.5 opacity-0 group-hover/item:opacity-100",
|
|
1666
|
+
icon: unref(ScalarIconTrash),
|
|
1667
|
+
label: `Delete ${option.label}`,
|
|
1668
|
+
size: "xs",
|
|
1669
|
+
onClick: withModifiers(($event) => handleDeleteRequest(option), ["stop"])
|
|
1670
|
+
}, null, 8, [
|
|
1671
|
+
"icon",
|
|
1672
|
+
"label",
|
|
1673
|
+
"onClick"
|
|
1674
|
+
])) : createCommentVNode("", true)
|
|
1675
|
+
]),
|
|
1676
|
+
default: withCtx(() => [createVNode(unref(ScalarButton), {
|
|
1677
|
+
ref_key: "comboboxButtonRef",
|
|
1678
|
+
ref: comboboxButtonRef,
|
|
1679
|
+
"aria-describedby": unref(titleId),
|
|
1680
|
+
class: "group/combobox-button hover:text-c-1 text-c-2 flex h-fit w-full items-center gap-1 px-0.75 py-0.25 text-base font-normal",
|
|
1681
|
+
variant: "ghost"
|
|
1682
|
+
}, {
|
|
1683
|
+
default: withCtx(() => [activeSchemeOptions.value.length === 1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[2] || (_cache[2] = createElementVNode("span", { class: "sr-only" }, "Selected Auth Type:", -1)), createTextVNode(" " + toDisplayString(activeSchemeOptions.value[0]?.label), 1)], 64)) : activeSchemeOptions.value.length > 1 ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [_cache[3] || (_cache[3] = createTextVNode(" Multiple ", -1)), _cache[4] || (_cache[4] = createElementVNode("span", { class: "sr-only" }, "Auth Types Selected", -1))], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [_cache[5] || (_cache[5] = createElementVNode("span", { class: "sr-only" }, "Select", -1)), _cache[6] || (_cache[6] = createTextVNode(" Auth Type ", -1))], 64)), createVNode(unref(ScalarIconCaretDown), {
|
|
1684
|
+
class: "size-3 shrink-0 transition-transform duration-100 group-aria-expanded/combobox-button:rotate-180",
|
|
1685
|
+
weight: "bold"
|
|
1686
|
+
})]),
|
|
1687
|
+
_: 1
|
|
1688
|
+
}, 8, ["aria-describedby"])]),
|
|
1689
|
+
_: 1
|
|
1690
|
+
}, 8, ["modelValue", "options"])]),
|
|
1691
|
+
default: withCtx(() => [createVNode(RequestAuthDataTable_default, {
|
|
1692
|
+
activeAuthIndex: __props.selectedSecurity?.selectedIndex ?? 0,
|
|
1693
|
+
environment: __props.environment,
|
|
1694
|
+
eventBus: __props.eventBus,
|
|
1695
|
+
isStatic: __props.isStatic,
|
|
1696
|
+
meta: __props.meta,
|
|
1697
|
+
proxyUrl: __props.proxyUrl,
|
|
1698
|
+
securitySchemes: __props.securitySchemes,
|
|
1699
|
+
selectedSchemeOptions: activeSchemeOptions.value,
|
|
1700
|
+
server: __props.server
|
|
1701
|
+
}, null, 8, [
|
|
1702
|
+
"activeAuthIndex",
|
|
1703
|
+
"environment",
|
|
1704
|
+
"eventBus",
|
|
1705
|
+
"isStatic",
|
|
1706
|
+
"meta",
|
|
1707
|
+
"proxyUrl",
|
|
1708
|
+
"securitySchemes",
|
|
1709
|
+
"selectedSchemeOptions",
|
|
1710
|
+
"server"
|
|
1711
|
+
]), schemeToDelete.value ? (openBlock(), createBlock(DeleteRequestAuthModal_default, {
|
|
1712
|
+
key: 0,
|
|
1713
|
+
label: schemeToDelete.value.label,
|
|
1714
|
+
scheme: schemeToDelete.value,
|
|
1715
|
+
state: unref(deleteModal),
|
|
1716
|
+
onClose: _cache[0] || (_cache[0] = ($event) => unref(deleteModal).hide()),
|
|
1717
|
+
onDelete: handleDeleteConfirm
|
|
1718
|
+
}, null, 8, [
|
|
1719
|
+
"label",
|
|
1720
|
+
"scheme",
|
|
1721
|
+
"state"
|
|
1722
|
+
])) : createCommentVNode("", true)]),
|
|
1723
|
+
_: 1
|
|
1724
|
+
}, 8, [
|
|
1725
|
+
"defaultOpen",
|
|
1726
|
+
"isStatic",
|
|
1727
|
+
"itemCount"
|
|
1728
|
+
]);
|
|
1729
|
+
};
|
|
1730
|
+
}
|
|
1731
|
+
});
|
|
1732
|
+
//#endregion
|
|
1733
|
+
//#region src/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.ts
|
|
1734
|
+
/**
|
|
1735
|
+
* Maps x-scalar-secret fields to their corresponding input field names.
|
|
1736
|
+
* This allows us to fall back to config values when auth store secrets are not available.
|
|
1737
|
+
*/
|
|
1738
|
+
var SECRET_TO_INPUT_FIELD_MAP = {
|
|
1739
|
+
"x-scalar-secret-client-id": "x-scalar-client-id",
|
|
1740
|
+
"x-scalar-secret-client-secret": "clientSecret",
|
|
1741
|
+
"x-scalar-secret-password": "password",
|
|
1742
|
+
"x-scalar-secret-redirect-uri": "x-scalar-redirect-uri",
|
|
1743
|
+
"x-scalar-secret-token": "token",
|
|
1744
|
+
"x-scalar-secret-username": "username",
|
|
1745
|
+
"x-scalar-secret-auth-url": "authorizationUrl",
|
|
1746
|
+
"x-scalar-secret-token-url": "tokenUrl"
|
|
1747
|
+
};
|
|
1748
|
+
var mergeFlowSecrets = (properties, configSecrets, authStoreSecrets = {}) => Object.fromEntries(properties.map((property) => {
|
|
1749
|
+
return [property, authStoreSecrets[property] || configSecrets[property] || configSecrets[SECRET_TO_INPUT_FIELD_MAP[property]] || ""];
|
|
1750
|
+
}));
|
|
1751
|
+
var extractRefreshTokenSecret = (authStoreSecrets = {}) => {
|
|
1752
|
+
const refreshToken = authStoreSecrets["x-scalar-secret-refresh-token"];
|
|
1753
|
+
if (typeof refreshToken === "string") return { "x-scalar-secret-refresh-token": refreshToken };
|
|
1754
|
+
return {};
|
|
1755
|
+
};
|
|
1756
|
+
var extractCredentialsLocation = (configSecrets, authStoreSecrets = {}) => {
|
|
1757
|
+
const credentialsLocation = authStoreSecrets["x-scalar-credentials-location"] ?? configSecrets["x-scalar-credentials-location"];
|
|
1758
|
+
return credentialsLocation ? { "x-scalar-credentials-location": credentialsLocation } : {};
|
|
1759
|
+
};
|
|
1760
|
+
/**
|
|
1761
|
+
* Extract flow secrets and selected scopes for OAuth-like flows.
|
|
1762
|
+
* Reused by both oauth2 and openIdConnect security schemes.
|
|
1763
|
+
*/
|
|
1764
|
+
var extractOAuthFlowSecrets = (flows, storeSecrets) => {
|
|
1765
|
+
const selectedScopes = /* @__PURE__ */ new Set();
|
|
1766
|
+
return {
|
|
1767
|
+
flows: objectEntries(flows ?? {}).reduce((acc, [key, flow]) => {
|
|
1768
|
+
if (!isObject(flow)) return acc;
|
|
1769
|
+
const flowSelectedScopes = flow["selectedScopes"];
|
|
1770
|
+
if (Array.isArray(flowSelectedScopes)) flowSelectedScopes.forEach((scope) => typeof scope === "string" && selectedScopes.add(scope));
|
|
1771
|
+
if (key === "implicit") acc.implicit = {
|
|
1772
|
+
...flow,
|
|
1773
|
+
...mergeFlowSecrets([
|
|
1774
|
+
"x-scalar-secret-client-id",
|
|
1775
|
+
"x-scalar-secret-redirect-uri",
|
|
1776
|
+
"x-scalar-secret-token",
|
|
1777
|
+
"x-scalar-secret-auth-url"
|
|
1778
|
+
], flow, storeSecrets?.implicit),
|
|
1779
|
+
...extractRefreshTokenSecret(storeSecrets?.implicit)
|
|
1780
|
+
};
|
|
1781
|
+
if (key === "password") acc[key] = {
|
|
1782
|
+
...flow,
|
|
1783
|
+
...mergeFlowSecrets([
|
|
1784
|
+
"x-scalar-secret-client-id",
|
|
1785
|
+
"x-scalar-secret-client-secret",
|
|
1786
|
+
"x-scalar-secret-username",
|
|
1787
|
+
"x-scalar-secret-password",
|
|
1788
|
+
"x-scalar-secret-token",
|
|
1789
|
+
"x-scalar-secret-token-url"
|
|
1790
|
+
], flow, storeSecrets?.password),
|
|
1791
|
+
...extractCredentialsLocation(flow, storeSecrets?.password),
|
|
1792
|
+
...extractRefreshTokenSecret(storeSecrets?.password)
|
|
1793
|
+
};
|
|
1794
|
+
if (key === "clientCredentials") acc[key] = {
|
|
1795
|
+
...flow,
|
|
1796
|
+
...mergeFlowSecrets([
|
|
1797
|
+
"x-scalar-secret-client-id",
|
|
1798
|
+
"x-scalar-secret-client-secret",
|
|
1799
|
+
"x-scalar-secret-token",
|
|
1800
|
+
"x-scalar-secret-token-url"
|
|
1801
|
+
], flow, storeSecrets?.clientCredentials),
|
|
1802
|
+
...extractCredentialsLocation(flow, storeSecrets?.clientCredentials),
|
|
1803
|
+
...extractRefreshTokenSecret(storeSecrets?.clientCredentials)
|
|
1804
|
+
};
|
|
1805
|
+
if (key === "authorizationCode") acc[key] = {
|
|
1806
|
+
...flow,
|
|
1807
|
+
...mergeFlowSecrets([
|
|
1808
|
+
"x-scalar-secret-client-id",
|
|
1809
|
+
"x-scalar-secret-client-secret",
|
|
1810
|
+
"x-scalar-secret-redirect-uri",
|
|
1811
|
+
"x-scalar-secret-token",
|
|
1812
|
+
"x-scalar-secret-auth-url",
|
|
1813
|
+
"x-scalar-secret-token-url"
|
|
1814
|
+
], flow, storeSecrets?.authorizationCode),
|
|
1815
|
+
...extractCredentialsLocation(flow, storeSecrets?.authorizationCode),
|
|
1816
|
+
...extractRefreshTokenSecret(storeSecrets?.authorizationCode)
|
|
1817
|
+
};
|
|
1818
|
+
return acc;
|
|
1819
|
+
}, {}),
|
|
1820
|
+
selectedScopes: Array.from(selectedScopes)
|
|
1821
|
+
};
|
|
1822
|
+
};
|
|
1823
|
+
/** Extract the secrets from the config and the auth store */
|
|
1824
|
+
var extractSecuritySchemeSecrets = (scheme, authStore, name, documentSlug) => {
|
|
1825
|
+
const secrets = authStore.getAuthSecrets(documentSlug, name);
|
|
1826
|
+
if (scheme.type === "apiKey") {
|
|
1827
|
+
const storeSecrets = secrets?.type === "apiKey" ? secrets : void 0;
|
|
1828
|
+
return {
|
|
1829
|
+
...scheme,
|
|
1830
|
+
"x-scalar-secret-token": storeSecrets?.["x-scalar-secret-token"] || scheme.value || ""
|
|
1831
|
+
};
|
|
1832
|
+
}
|
|
1833
|
+
if (scheme.type === "http") {
|
|
1834
|
+
const storeSecrets = secrets?.type === "http" ? secrets : void 0;
|
|
1835
|
+
return {
|
|
1836
|
+
...scheme,
|
|
1837
|
+
"x-scalar-secret-token": storeSecrets?.["x-scalar-secret-token"] || scheme.token || "",
|
|
1838
|
+
"x-scalar-secret-username": storeSecrets?.["x-scalar-secret-username"] || scheme.username || "",
|
|
1839
|
+
"x-scalar-secret-password": storeSecrets?.["x-scalar-secret-password"] || scheme.password || ""
|
|
1840
|
+
};
|
|
1841
|
+
}
|
|
1842
|
+
if (scheme.type === "oauth2") {
|
|
1843
|
+
const storeSecrets = secrets?.type === "oauth2" ? secrets : void 0;
|
|
1844
|
+
const extracted = extractOAuthFlowSecrets(scheme.flows, storeSecrets);
|
|
1845
|
+
return {
|
|
1846
|
+
...scheme,
|
|
1847
|
+
flows: extracted.flows,
|
|
1848
|
+
"x-default-scopes": extracted.selectedScopes
|
|
1849
|
+
};
|
|
1850
|
+
}
|
|
1851
|
+
if (scheme.type === "openIdConnect") {
|
|
1852
|
+
const storeSecrets = secrets?.type === "openIdConnect" ? secrets : void 0;
|
|
1853
|
+
const extracted = extractOAuthFlowSecrets({
|
|
1854
|
+
implicit: storeSecrets?.implicit,
|
|
1855
|
+
password: storeSecrets?.password,
|
|
1856
|
+
clientCredentials: storeSecrets?.clientCredentials,
|
|
1857
|
+
authorizationCode: storeSecrets?.authorizationCode
|
|
1858
|
+
}, storeSecrets);
|
|
1859
|
+
return {
|
|
1860
|
+
...scheme,
|
|
1861
|
+
...objectEntries(extracted.flows).length ? { flows: extracted.flows } : {}
|
|
1862
|
+
};
|
|
1863
|
+
}
|
|
1864
|
+
return scheme;
|
|
1865
|
+
};
|
|
1866
|
+
//#endregion
|
|
1867
|
+
//#region src/v2/blocks/scalar-auth-selector-block/helpers/merge-security.ts
|
|
1868
|
+
/** Merge the authentication config with the document security schemes + the auth store secrets */
|
|
1869
|
+
var mergeSecurity = (documentSecuritySchemes = {}, configSecuritySchemes = {}, authStore, documentSlug) => {
|
|
1870
|
+
/** Convert the config secrets to the new secret extensions */
|
|
1871
|
+
return objectEntries(mergeObjects(objectEntries(documentSecuritySchemes).reduce((acc, [key, value]) => {
|
|
1872
|
+
const resolved = deepClone(getResolvedRef(value));
|
|
1873
|
+
if (resolved) acc[key] = resolved;
|
|
1874
|
+
return acc;
|
|
1875
|
+
}, {}), configSecuritySchemes) ?? {}).reduce((acc, [name, value]) => {
|
|
1876
|
+
acc[name] = extractSecuritySchemeSecrets({
|
|
1877
|
+
...coerceValue(SecuritySchemeObjectSchema, value),
|
|
1878
|
+
...value
|
|
1879
|
+
}, authStore, name, documentSlug);
|
|
1880
|
+
return acc;
|
|
1881
|
+
}, {});
|
|
1882
|
+
};
|
|
1883
|
+
//#endregion
|
|
1884
|
+
export { AuthSelector_default as n, isAuthOptional as r, mergeSecurity as t };
|
|
1885
|
+
|
|
1886
|
+
//# sourceMappingURL=scalar-auth-selector-block-DI3DLag9.js.map
|