@scalar/api-client 2.38.1 → 2.38.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/AddressBar-CX8xiYoe.js +302 -0
- package/dist/AddressBar-CX8xiYoe.js.map +1 -0
- package/dist/App-BpNPKHmM.js +533 -0
- package/dist/App-BpNPKHmM.js.map +1 -0
- package/dist/App-Ckirvnv1.js +2510 -0
- package/dist/App-Ckirvnv1.js.map +1 -0
- package/dist/CodeInput-BN7uw3Bh.js +694 -0
- package/dist/CodeInput-BN7uw3Bh.js.map +1 -0
- package/dist/CodeSnippet-D7Heh1nd.js +218 -0
- package/dist/CodeSnippet-D7Heh1nd.js.map +1 -0
- package/dist/Collection-ChAxs3rz.js +219 -0
- package/dist/Collection-ChAxs3rz.js.map +1 -0
- package/dist/CollectionAuthentication-BDpvv8cA.js +56 -0
- package/dist/CollectionAuthentication-BDpvv8cA.js.map +1 -0
- package/dist/CollectionCookies-DyjPPMdt.js +19 -0
- package/dist/CollectionCookies-DyjPPMdt.js.map +1 -0
- package/dist/CollectionEnvironment-dwisJ-h5.js +514 -0
- package/dist/CollectionEnvironment-dwisJ-h5.js.map +1 -0
- package/dist/CollectionOverview-CJ9-Vmei.js +131 -0
- package/dist/CollectionOverview-CJ9-Vmei.js.map +1 -0
- package/dist/CollectionScripts-CMNlBlby.js +19 -0
- package/dist/CollectionScripts-CMNlBlby.js.map +1 -0
- package/dist/CollectionServers-BWkIGwz4.js +168 -0
- package/dist/CollectionServers-BWkIGwz4.js.map +1 -0
- package/dist/CollectionSettings-CqUUYOym.js +87 -0
- package/dist/CollectionSettings-CqUUYOym.js.map +1 -0
- package/dist/CollectionSync-CAflc5yW.js +19 -0
- package/dist/CollectionSync-CAflc5yW.js.map +1 -0
- package/dist/CommandActionInput-TkcAx6E8.js +97 -0
- package/dist/CommandActionInput-TkcAx6E8.js.map +1 -0
- package/dist/CommandPalette-BiA0IgO8.js +964 -0
- package/dist/CommandPalette-BiA0IgO8.js.map +1 -0
- package/dist/CommandPaletteImport-Diu5dDIY.js +622 -0
- package/dist/CommandPaletteImport-Diu5dDIY.js.map +1 -0
- package/dist/Cookies-CNRSxP8J.js +284 -0
- package/dist/Cookies-CNRSxP8J.js.map +1 -0
- package/dist/DataTable-BqbZKW3K.js +62 -0
- package/dist/DataTable-BqbZKW3K.js.map +1 -0
- package/dist/DataTableHeader-DJVB0jCZ.js +21 -0
- package/dist/DataTableHeader-DJVB0jCZ.js.map +1 -0
- package/dist/DataTableInput-SkIUPlrB.js +166 -0
- package/dist/DataTableInput-SkIUPlrB.js.map +1 -0
- package/dist/DataTableRow-c3XveEUO.js +57 -0
- package/dist/DataTableRow-c3XveEUO.js.map +1 -0
- package/dist/DeleteSidebarListElement-C-p87d03.js +78 -0
- package/dist/DeleteSidebarListElement-C-p87d03.js.map +1 -0
- package/dist/EditSidebarListElement-CodWPnM6.js +32 -0
- package/dist/EditSidebarListElement-CodWPnM6.js.map +1 -0
- package/dist/Editor-BomsGWHx.js +909 -0
- package/dist/Editor-BomsGWHx.js.map +1 -0
- package/dist/EmptyState-Cnm7hGW5.js +46 -0
- package/dist/EmptyState-Cnm7hGW5.js.map +1 -0
- package/dist/Environment-D_CbZk0A.js +416 -0
- package/dist/Environment-D_CbZk0A.js.map +1 -0
- package/dist/EnvironmentModal-CcyqnPc2.js +288 -0
- package/dist/EnvironmentModal-CcyqnPc2.js.map +1 -0
- package/dist/Form-bA4bV_oA.js +83 -0
- package/dist/Form-bA4bV_oA.js.map +1 -0
- package/dist/HttpMethod-rnWEgC3T.js +78 -0
- package/dist/HttpMethod-rnWEgC3T.js.map +1 -0
- package/dist/IconSelector-BDC_GQXv.js +67 -0
- package/dist/IconSelector-BDC_GQXv.js.map +1 -0
- package/dist/ImportCollection-BIYMxB9Q.js +804 -0
- package/dist/ImportCollection-BIYMxB9Q.js.map +1 -0
- package/dist/IntegrationLogo-B9EDW8db.js +51 -0
- package/dist/IntegrationLogo-B9EDW8db.js.map +1 -0
- package/dist/MainLayout-oMIJ5QXF.js +281 -0
- package/dist/MainLayout-oMIJ5QXF.js.map +1 -0
- package/dist/Modal-DkOa_KK0.js +67 -0
- package/dist/Modal-DkOa_KK0.js.map +1 -0
- package/dist/ModalClientContainer-qHsZi4wQ.js +65 -0
- package/dist/ModalClientContainer-qHsZi4wQ.js.map +1 -0
- package/dist/Request-BWfYWyBa.js +212 -0
- package/dist/Request-BWfYWyBa.js.map +1 -0
- package/dist/RequestAuth-BU6ubH-c.js +989 -0
- package/dist/RequestAuth-BU6ubH-c.js.map +1 -0
- package/dist/RequestRoot-7xhK5_qr.js +1611 -0
- package/dist/RequestRoot-7xhK5_qr.js.map +1 -0
- package/dist/RequestSection-Bx8UHW-k.js +1582 -0
- package/dist/RequestSection-Bx8UHW-k.js.map +1 -0
- package/dist/ResponseSection-CLrgLMN_.js +949 -0
- package/dist/ResponseSection-CLrgLMN_.js.map +1 -0
- package/dist/ScalarAsciiArt-BjuSnj8e.js +45 -0
- package/dist/ScalarAsciiArt-BjuSnj8e.js.map +1 -0
- package/dist/SectionFilter-hrtoRLwj.js +99 -0
- package/dist/SectionFilter-hrtoRLwj.js.map +1 -0
- package/dist/Server-BS4zjUdO.js +303 -0
- package/dist/Server-BS4zjUdO.js.map +1 -0
- package/dist/ServerVariablesForm-BRZ9XC8o.js +145 -0
- package/dist/ServerVariablesForm-BRZ9XC8o.js.map +1 -0
- package/dist/Settings-BuLKHzRY.js +347 -0
- package/dist/Settings-BuLKHzRY.js.map +1 -0
- package/dist/Sidebar-Xl9_nFXX.js +73 -0
- package/dist/Sidebar-Xl9_nFXX.js.map +1 -0
- package/dist/SidebarButton-BAagdMDe.js +37 -0
- package/dist/SidebarButton-BAagdMDe.js.map +1 -0
- package/dist/SidebarListElement-BfTPiihc.js +232 -0
- package/dist/SidebarListElement-BfTPiihc.js.map +1 -0
- package/dist/TheCommandPalette-Dl9TAeke.js +204 -0
- package/dist/TheCommandPalette-Dl9TAeke.js.map +1 -0
- package/dist/ValueEmitter-QYkZ9Hdc.js +20 -0
- package/dist/ValueEmitter-QYkZ9Hdc.js.map +1 -0
- package/dist/ViewLayout-BOXN0IYo.js +17 -0
- package/dist/ViewLayout-BOXN0IYo.js.map +1 -0
- package/dist/ViewLayoutCollapse-CiTb-Uml.js +86 -0
- package/dist/ViewLayoutCollapse-CiTb-Uml.js.map +1 -0
- package/dist/ViewLayoutContent-CvMoJYPF.js +13 -0
- package/dist/ViewLayoutContent-CvMoJYPF.js.map +1 -0
- package/dist/ViewLayoutSection-mUqKbQry.js +23 -0
- package/dist/ViewLayoutSection-mUqKbQry.js.map +1 -0
- package/dist/WatchModeToggle-D_eAiTWJ.js +41 -0
- package/dist/WatchModeToggle-D_eAiTWJ.js.map +1 -0
- package/dist/_plugin-vue_export-helper-BmmBcIzD.js +8 -0
- package/dist/analytics-BZimCWcw.js +7 -0
- package/dist/analytics-BZimCWcw.js.map +1 -0
- package/dist/build-request-security-BQjNr2MD.js +41 -0
- package/dist/build-request-security-BQjNr2MD.js.map +1 -0
- package/dist/code-input-iq-moLxi.js +775 -0
- package/dist/code-input-iq-moLxi.js.map +1 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts +1 -1
- package/dist/components/AddressBar/index.d.ts +1 -1
- package/dist/components/AddressBar/index.js +5 -4
- package/dist/components/CodeInput/CodeInput.vue.d.ts +1 -1
- package/dist/components/CodeInput/codeVariableWidget.d.ts +1 -1
- package/dist/components/CodeInput/index.d.ts +1 -1
- package/dist/components/CodeInput/index.js +2 -4
- package/dist/components/CommandPalette/index.d.ts +1 -1
- package/dist/components/CommandPalette/index.js +3 -4
- package/dist/components/DataTable/DataTableInput.vue.d.ts +2 -2
- package/dist/components/DataTable/index.d.ts +8 -8
- package/dist/components/DataTable/index.js +6 -18
- package/dist/components/Form/LabelInput.vue.d.ts +1 -1
- package/dist/components/HttpMethod/index.d.ts +1 -1
- package/dist/components/HttpMethod/index.js +2 -4
- package/dist/components/ImportCollection/index.d.ts +1 -1
- package/dist/components/ImportCollection/index.js +2 -4
- package/dist/components/ImportCollection/utils/import-collection.d.ts +1 -1
- package/dist/components/ImportCollection/utils/workspace-store-is-empty.d.ts +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.d.ts +1 -1
- package/dist/components/Server/index.d.ts +3 -3
- package/dist/components/Server/index.js +3 -8
- package/dist/components/Sidebar/index.d.ts +1 -1
- package/dist/components/Sidebar/index.js +2 -4
- package/dist/components/ViewLayout/index.d.ts +1 -1
- package/dist/components/ViewLayout/index.js +2 -4
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +7 -8
- package/dist/components-ChixwQhN.js +61 -0
- package/dist/components-ChixwQhN.js.map +1 -0
- package/dist/components-DfJHvSLM.js +183 -0
- package/dist/components-DfJHvSLM.js.map +1 -0
- package/dist/computer-D7VW3Ruy.js +562 -0
- package/dist/computer-D7VW3Ruy.js.map +1 -0
- package/dist/consts-CyGRb9dl.js +318 -0
- package/dist/consts-CyGRb9dl.js.map +1 -0
- package/dist/curl-nbw1OxbV.js +54 -0
- package/dist/curl-nbw1OxbV.js.map +1 -0
- package/dist/data-table-PL7e8NRO.js +282 -0
- package/dist/data-table-PL7e8NRO.js.map +1 -0
- package/dist/editor-BZ_J0eze.js +466 -0
- package/dist/editor-BZ_J0eze.js.map +1 -0
- package/dist/environments-ByLK9lnC.js +592 -0
- package/dist/environments-ByLK9lnC.js.map +1 -0
- package/dist/formatters-DOGXZq9R.js +36 -0
- package/dist/formatters-DOGXZq9R.js.map +1 -0
- package/dist/forms-CZX6cFDS.js +42 -0
- package/dist/forms-CZX6cFDS.js.map +1 -0
- package/dist/get-active-environment-CkxyQ1dM.js +19 -0
- package/dist/get-active-environment-CkxyQ1dM.js.map +1 -0
- package/dist/get-resolved-url-SybDPV0U.js +85 -0
- package/dist/get-resolved-url-SybDPV0U.js.map +1 -0
- package/dist/get-server-url-UVN-dx79.js +32 -0
- package/dist/get-server-url-UVN-dx79.js.map +1 -0
- package/dist/get-servers-B_WNlQWB.js +106 -0
- package/dist/get-servers-B_WNlQWB.js.map +1 -0
- package/dist/get-snippet-DBRUSfZ2.js +39 -0
- package/dist/get-snippet-DBRUSfZ2.js.map +1 -0
- package/dist/global-cookies-D3ZS9ON3.js +184 -0
- package/dist/global-cookies-D3ZS9ON3.js.map +1 -0
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/index.js +3 -11
- package/dist/hooks/useSidebar.d.ts +1 -1
- package/dist/hooks-BvZxH4XB.js +80 -0
- package/dist/hooks-BvZxH4XB.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -12
- package/dist/layout-BWiL7dfb.js +81 -0
- package/dist/layout-BWiL7dfb.js.map +1 -0
- package/dist/layouts/App/create-api-client-app.d.ts +9 -9
- package/dist/layouts/App/index.d.ts +2 -2
- package/dist/layouts/App/index.js +5 -7
- package/dist/layouts/Modal/create-api-client-modal.d.ts +1 -1
- package/dist/layouts/Modal/index.d.ts +2 -2
- package/dist/layouts/Modal/index.js +3 -4
- package/dist/layouts/Web/create-api-client-web.d.ts +9 -9
- package/dist/layouts/Web/index.d.ts +2 -2
- package/dist/layouts/Web/index.js +101 -6
- package/dist/layouts/Web/index.js.map +1 -0
- package/dist/libs/create-client.d.ts +9 -9
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/environment-parser.d.ts +1 -1
- package/dist/libs/get-request-uid-by-path-method.d.ts +1 -1
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/libs/importers/index.d.ts +1 -1
- package/dist/libs/importers/index.js +2 -4
- package/dist/libs/index.d.ts +15 -15
- package/dist/libs/index.js +6 -45
- package/dist/libs/local-storage.d.ts +1 -1
- package/dist/libs/send-request/create-request-operation.d.ts +3 -3
- package/dist/libs/send-request/index.d.ts +3 -3
- package/dist/libs/send-request/index.js +3 -8
- package/dist/libs-spbv4P0g.js +249 -0
- package/dist/libs-spbv4P0g.js.map +1 -0
- package/dist/monacoeditorwork/json.worker.bundle.js +8 -8
- package/dist/monacoeditorwork/yaml.worker.bundle.js +151 -151
- package/dist/operation-block-DE-hoO03.js +1674 -0
- package/dist/operation-block-DE-hoO03.js.map +1 -0
- package/dist/operation-code-sample-xgx4qi2H.js +1738 -0
- package/dist/operation-code-sample-xgx4qi2H.js.map +1 -0
- package/dist/parse-curl-BtypQT3D.js +106 -0
- package/dist/parse-curl-BtypQT3D.js.map +1 -0
- package/dist/plugins/hooks/usePluginManager.d.ts +1 -1
- package/dist/plugins/index.d.ts +2 -2
- package/dist/plugins/index.js +2 -7
- package/dist/plugins/plugin-manager.d.ts +10 -4
- package/dist/plugins/plugin-manager.d.ts.map +1 -1
- package/dist/plugins-B52hCIyZ.js +50 -0
- package/dist/plugins-B52hCIyZ.js.map +1 -0
- package/dist/rabbitjump-CMZXAR6d.js +9 -0
- package/dist/rabbitjump-CMZXAR6d.js.map +1 -0
- package/dist/request-block-N7dPFyrG.js +1466 -0
- package/dist/request-block-N7dPFyrG.js.map +1 -0
- package/dist/resize-D2IYvVdh.js +114 -0
- package/dist/resize-D2IYvVdh.js.map +1 -0
- package/dist/response-block-DmkaDZYs.js +1188 -0
- package/dist/response-block-DmkaDZYs.js.map +1 -0
- package/dist/scalar-address-bar-block-BbysOhkE.js +425 -0
- package/dist/scalar-address-bar-block-BbysOhkE.js.map +1 -0
- package/dist/scalar-auth-selector-block-Bs79QOMA.js +1889 -0
- package/dist/scalar-auth-selector-block-Bs79QOMA.js.map +1 -0
- package/dist/search-CmsQQkjn.js +151 -0
- package/dist/search-CmsQQkjn.js.map +1 -0
- package/dist/send-request-BsTfRiBC.js +348 -0
- package/dist/send-request-BsTfRiBC.js.map +1 -0
- package/dist/server-tcI-OCyx.js +140 -0
- package/dist/server-tcI-OCyx.js.map +1 -0
- package/dist/set-request-cookies-BJJhsU4A.js +88 -0
- package/dist/set-request-cookies-BJJhsU4A.js.map +1 -0
- package/dist/settings-BKk_1lcH.js +455 -0
- package/dist/settings-BKk_1lcH.js.map +1 -0
- package/dist/sidebar-ceSbYmnt.js +217 -0
- package/dist/sidebar-ceSbYmnt.js.map +1 -0
- package/dist/store/collections.d.ts +1 -1
- package/dist/store/environment.d.ts +1 -1
- package/dist/store/events.d.ts +8 -8
- package/dist/store/import-spec.d.ts +2 -2
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +2 -10
- package/dist/store/request-example.d.ts +1 -1
- package/dist/store/requests.d.ts +1 -1
- package/dist/store/security-schemes.d.ts +1 -1
- package/dist/store/servers.d.ts +1 -1
- package/dist/store/store.d.ts +7 -7
- package/dist/store/tags.d.ts +1 -1
- package/dist/store/workspace.d.ts +1 -1
- package/dist/store-DaPoVtIS.js +1512 -0
- package/dist/store-DaPoVtIS.js.map +1 -0
- package/dist/string-template-sS5PtY6T.js +64 -0
- package/dist/string-template-sS5PtY6T.js.map +1 -0
- package/dist/style.css +10372 -1
- package/dist/types/index.js +0 -1
- package/dist/use-global-hot-keys-D8Ai8Qbm.js +274 -0
- package/dist/use-global-hot-keys-D8Ai8Qbm.js.map +1 -0
- package/dist/useSidebar-DLTwHDI-.js +45 -0
- package/dist/useSidebar-DLTwHDI-.js.map +1 -0
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +3 -3
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts +6 -0
- package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts +2 -1
- package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.d.ts +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -1
- package/dist/v2/blocks/operation-block/index.d.ts +4 -4
- package/dist/v2/blocks/operation-block/index.js +20 -11
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/index.d.ts +6 -6
- package/dist/v2/blocks/operation-code-sample/index.js +2 -16
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +4 -4
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts +3 -2
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts +1 -1
- package/dist/v2/blocks/request-block/index.d.ts +1 -1
- package/dist/v2/blocks/request-block/index.js +9 -4
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.d.ts +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +1 -1
- package/dist/v2/blocks/response-block/index.d.ts +1 -1
- package/dist/v2/blocks/response-block/index.js +6 -4
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/index.d.ts +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/index.js +5 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +3 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +4 -4
- package/dist/v2/blocks/scalar-auth-selector-block/index.js +6 -8
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +1 -1
- package/dist/v2/components/code-input/index.d.ts +1 -1
- package/dist/v2/components/code-input/index.js +2 -4
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +1 -1
- package/dist/v2/components/data-table/index.d.ts +8 -8
- package/dist/v2/components/data-table/index.js +3 -18
- package/dist/v2/components/forms/index.d.ts +1 -1
- package/dist/v2/components/forms/index.js +2 -4
- package/dist/v2/components/layout/index.d.ts +1 -1
- package/dist/v2/components/layout/index.js +2 -4
- package/dist/v2/components/modals/index.d.ts +1 -1
- package/dist/v2/components/modals/index.js +37 -3
- package/dist/v2/components/modals/index.js.map +1 -0
- package/dist/v2/components/resize/index.d.ts +2 -2
- package/dist/v2/components/resize/index.js +2 -6
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +1 -1
- package/dist/v2/components/server/index.d.ts +1 -1
- package/dist/v2/components/server/index.js +2 -4
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +1 -1
- package/dist/v2/components/sidebar/index.d.ts +3 -3
- package/dist/v2/components/sidebar/index.js +3 -8
- package/dist/v2/constants.d.ts +3 -0
- package/dist/v2/constants.d.ts.map +1 -0
- package/dist/v2/features/app/App.vue.d.ts +4 -4
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +1 -1
- package/dist/v2/features/app/components/index.d.ts +1 -1
- package/dist/v2/features/app/components/index.js +10 -5
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +3 -3
- package/dist/v2/features/app/helpers/get-route-param.d.ts +1 -1
- package/dist/v2/features/app/helpers/routes.d.ts +5 -5
- package/dist/v2/features/app/hooks/use-theme.d.ts +1 -1
- package/dist/v2/features/app/index.d.ts +8 -8
- package/dist/v2/features/app/index.js +3161 -19
- package/dist/v2/features/app/index.js.map +1 -0
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts +1 -1
- package/dist/v2/features/collection/OperationCollection.vue.d.ts +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Cookies.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Editor/Editor.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Editor/index.d.ts +1 -1
- package/dist/v2/features/collection/components/Editor/index.js +2 -4
- package/dist/v2/features/collection/components/Environment.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Overview.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Servers.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Settings.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Tabs.vue.d.ts +1 -1
- package/dist/v2/features/command-palette/TheCommandPalette.vue.d.ts +1 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +10 -45
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
- package/dist/v2/features/command-palette/index.d.ts +2 -2
- package/dist/v2/features/command-palette/index.js +3 -6
- package/dist/v2/features/editor/helpers/json/create-json-model.d.ts +1 -1
- package/dist/v2/features/editor/helpers/json/get-json-ast-node-from-path.d.ts +1 -1
- package/dist/v2/features/editor/helpers/json/json-pointer-path.d.ts +1 -1
- package/dist/v2/features/editor/helpers/yaml/create-yaml-model.d.ts +1 -1
- package/dist/v2/features/editor/helpers/yaml/get-yaml-node-range-from-path.d.ts +1 -1
- package/dist/v2/features/editor/hooks/use-editor.d.ts +1 -1
- package/dist/v2/features/editor/hooks/use-json-pointer-link-support.d.ts +1 -1
- package/dist/v2/features/editor/index.d.ts +4 -4
- package/dist/v2/features/editor/index.js +2 -10
- package/dist/v2/features/environments/index.d.ts +1 -1
- package/dist/v2/features/environments/index.js +4 -4
- package/dist/v2/features/global-cookies/index.d.ts +1 -1
- package/dist/v2/features/global-cookies/index.js +4 -4
- package/dist/v2/features/modal/Modal.vue.d.ts +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +2 -2
- package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +1 -1
- package/dist/v2/features/modal/index.d.ts +3 -3
- package/dist/v2/features/modal/index.js +639 -7
- package/dist/v2/features/modal/index.js.map +1 -0
- package/dist/v2/features/modal/modal-events.d.ts +1 -1
- package/dist/v2/features/operation/Operation.vue.d.ts +2 -2
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts +6 -1
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
- package/dist/v2/features/operation/index.d.ts +5 -5
- package/dist/v2/features/operation/index.js +19 -12
- package/dist/v2/features/search/helpers/create-fuse-instance.d.ts +1 -1
- package/dist/v2/features/search/helpers/create-search-index.d.ts +1 -1
- package/dist/v2/features/search/index.d.ts +1 -1
- package/dist/v2/features/search/index.js +2 -4
- package/dist/v2/features/settings/index.d.ts +2 -2
- package/dist/v2/features/settings/index.js +2 -6
- package/dist/v2/helpers/get-active-proxy-url.d.ts +1 -1
- package/dist/v2/helpers/get-tab-details.d.ts +1 -1
- package/dist/v2/helpers/handle-hotkeys.d.ts +1 -1
- package/dist/v2/helpers/index.d.ts +2 -2
- package/dist/v2/helpers/index.js +3 -6
- package/dist/v2/hooks/use-global-hot-keys.d.ts +1 -1
- package/dist/views/Collection/components/EnvironmentForm.vue.d.ts +1 -1
- package/dist/views/Collection/components/MarkdownInput.vue.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/index.d.ts +4 -4
- package/dist/views/Components/CodeSnippet/index.js +3 -10
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +1 -1
- package/dist/views/Environment/handle-drag.d.ts +1 -1
- package/dist/views/Request/Request.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +3 -3
- package/dist/views/Request/RequestSection/RequestAuth/index.js +4 -8
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts +1 -1
- package/dist/views/Request/RequestSection/index.d.ts +2 -2
- package/dist/views/Request/RequestSection/index.js +42 -5
- package/dist/views/Request/RequestSection/index.js.map +1 -0
- package/dist/views/Request/RequestSidebarItem.vue.d.ts +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +3 -3
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +1 -1
- package/dist/views/Request/ResponseSection/index.d.ts +2 -2
- package/dist/views/Request/ResponseSection/index.js +7 -6
- package/dist/views/Request/components/index.d.ts +1 -1
- package/dist/views/Request/components/index.js +2 -4
- package/dist/views/Request/consts/index.d.ts +2 -2
- package/dist/views/Request/consts/index.js +2 -10
- package/dist/views/Request/handle-drag.d.ts +2 -2
- package/dist/views/Request/libs/auth.d.ts +1 -1
- package/dist/views/Request/libs/index.d.ts +3 -3
- package/dist/views/Request/libs/index.js +3 -22
- package/dist/views/Request/libs/oauth2.d.ts +1 -1
- package/dist/views/Request/libs/watch-mode.d.ts +2 -2
- package/dist/views/Request/types/index.js +0 -1
- package/dist/watch-mode-Dbaqd9bG.js +375 -0
- package/dist/watch-mode-Dbaqd9bG.js.map +1 -0
- package/package.json +29 -33
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -9
- package/dist/analytics.js +0 -9
- package/dist/assets/computer.ascii.js +0 -34
- package/dist/assets/keycap.ascii.js +0 -25
- package/dist/assets/rabbit.ascii.js +0 -11
- package/dist/assets/rabbitjump.ascii.js +0 -11
- package/dist/components/AddressBar/AddressBar.vue.js +0 -7
- package/dist/components/AddressBar/AddressBar.vue2.js +0 -160
- package/dist/components/AddressBar/AddressBarHistory.vue.js +0 -7
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +0 -98
- package/dist/components/AddressBar/httpStatusCodeColors.js +0 -38
- package/dist/components/CodeInput/CodeInput.vue.js +0 -8
- package/dist/components/CodeInput/CodeInput.vue2.js +0 -209
- package/dist/components/CodeInput/codeVariableWidget.js +0 -111
- package/dist/components/CommandPalette/CommandActionForm.vue.js +0 -44
- package/dist/components/CommandPalette/CommandActionForm.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandActionInput.vue.js +0 -52
- package/dist/components/CommandPalette/CommandActionInput.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +0 -80
- package/dist/components/CommandPalette/CommandPaletteCollection.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +0 -116
- package/dist/components/CommandPalette/CommandPaletteExample.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +0 -217
- package/dist/components/CommandPalette/CommandPaletteImport.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +0 -7
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +0 -136
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +0 -123
- package/dist/components/CommandPalette/CommandPaletteServer.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +0 -84
- package/dist/components/CommandPalette/CommandPaletteTag.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +0 -48
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue2.js +0 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +0 -7
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +0 -305
- package/dist/components/CommandPalette/WatchModeToggle.vue.js +0 -39
- package/dist/components/CommandPalette/WatchModeToggle.vue2.js +0 -4
- package/dist/components/DataTable/DataTable.vue.js +0 -38
- package/dist/components/DataTable/DataTable.vue2.js +0 -4
- package/dist/components/DataTable/DataTableCell.vue.js +0 -26
- package/dist/components/DataTable/DataTableCell.vue2.js +0 -4
- package/dist/components/DataTable/DataTableCheckbox.vue.js +0 -53
- package/dist/components/DataTable/DataTableCheckbox.vue2.js +0 -4
- package/dist/components/DataTable/DataTableHeader.vue.js +0 -18
- package/dist/components/DataTable/DataTableHeader.vue2.js +0 -4
- package/dist/components/DataTable/DataTableInput.vue.js +0 -7
- package/dist/components/DataTable/DataTableInput.vue2.js +0 -124
- package/dist/components/DataTable/DataTableInputSelect.vue.js +0 -146
- package/dist/components/DataTable/DataTableInputSelect.vue2.js +0 -4
- package/dist/components/DataTable/DataTableRow.vue.js +0 -12
- package/dist/components/DataTable/DataTableText.vue.js +0 -23
- package/dist/components/DataTable/DataTableText.vue2.js +0 -4
- package/dist/components/EmptyState.vue.js +0 -7
- package/dist/components/EmptyState.vue2.js +0 -42
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +0 -113
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue2.js +0 -4
- package/dist/components/Form/Form.vue.js +0 -83
- package/dist/components/Form/Form.vue2.js +0 -4
- package/dist/components/Form/LabelInput.vue.js +0 -7
- package/dist/components/Form/LabelInput.vue2.js +0 -42
- package/dist/components/HelpfulLink.vue.js +0 -20
- package/dist/components/HelpfulLink.vue2.js +0 -4
- package/dist/components/HttpMethod/HttpMethod.vue.js +0 -7
- package/dist/components/HttpMethod/HttpMethod.vue2.js +0 -62
- package/dist/components/IconSelector.vue.js +0 -75
- package/dist/components/IconSelector.vue2.js +0 -4
- package/dist/components/ImportCollection/DropEventListener.vue.js +0 -81
- package/dist/components/ImportCollection/DropEventListener.vue2.js +0 -4
- package/dist/components/ImportCollection/ImportCollectionListener.vue.js +0 -77
- package/dist/components/ImportCollection/ImportCollectionListener.vue2.js +0 -4
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +0 -208
- package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +0 -5
- package/dist/components/ImportCollection/ImportNowButton.vue.js +0 -73
- package/dist/components/ImportCollection/ImportNowButton.vue2.js +0 -4
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +0 -44
- package/dist/components/ImportCollection/IntegrationLogo.vue2.js +0 -4
- package/dist/components/ImportCollection/PasteEventListener.vue.js +0 -24
- package/dist/components/ImportCollection/PasteEventListener.vue2.js +0 -4
- package/dist/components/ImportCollection/PrefetchError.vue.js +0 -27
- package/dist/components/ImportCollection/PrefetchError.vue2.js +0 -4
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.js +0 -20
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue2.js +0 -4
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +0 -134
- package/dist/components/ImportCollection/WorkspaceSelector.vue2.js +0 -4
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +0 -106
- package/dist/components/ImportCollection/utils/get-openapi-version.js +0 -20
- package/dist/components/ImportCollection/utils/import-collection.js +0 -29
- package/dist/components/ImportCollection/utils/is-document.js +0 -9
- package/dist/components/ImportCollection/utils/is-url.js +0 -9
- package/dist/components/ImportCollection/utils/workspace-store-is-empty.js +0 -7
- package/dist/components/OpenApiClientButton.vue.js +0 -7
- package/dist/components/OpenApiClientButton.vue2.js +0 -48
- package/dist/components/ScalarAsciiArt.vue.js +0 -7
- package/dist/components/ScalarAsciiArt.vue2.js +0 -37
- package/dist/components/Search/useSearch.js +0 -78
- package/dist/components/SectionFilter.vue.js +0 -7
- package/dist/components/SectionFilter.vue2.js +0 -64
- package/dist/components/SectionFilterButton.vue.js +0 -23
- package/dist/components/SectionFilterButton.vue2.js +0 -4
- package/dist/components/Server/ServerDropdown.vue.js +0 -132
- package/dist/components/Server/ServerDropdown.vue2.js +0 -4
- package/dist/components/Server/ServerDropdownItem.vue.js +0 -7
- package/dist/components/Server/ServerDropdownItem.vue2.js +0 -84
- package/dist/components/Server/ServerSelector.vue.js +0 -82
- package/dist/components/Server/ServerSelector.vue2.js +0 -4
- package/dist/components/Server/ServerVariablesForm.vue.js +0 -49
- package/dist/components/Server/ServerVariablesForm.vue2.js +0 -4
- package/dist/components/Server/ServerVariablesSelect.vue.js +0 -54
- package/dist/components/Server/ServerVariablesSelect.vue2.js +0 -4
- package/dist/components/Server/ServerVariablesTextbox.vue.js +0 -29
- package/dist/components/Server/ServerVariablesTextbox.vue2.js +0 -4
- package/dist/components/SideNav/DownloadAppButton.vue.js +0 -7
- package/dist/components/SideNav/DownloadAppButton.vue2.js +0 -33
- package/dist/components/SideNav/SideHelp.vue.js +0 -127
- package/dist/components/SideNav/SideHelp.vue2.js +0 -4
- package/dist/components/SideNav/SideNav.vue.js +0 -96
- package/dist/components/SideNav/SideNav.vue2.js +0 -4
- package/dist/components/SideNav/SideNavGroup.vue.js +0 -16
- package/dist/components/SideNav/SideNavGroup.vue2.js +0 -4
- package/dist/components/SideNav/SideNavLink.vue.js +0 -39
- package/dist/components/SideNav/SideNavLink.vue2.js +0 -4
- package/dist/components/SideNav/SideNavRouterLink.vue.js +0 -27
- package/dist/components/SideNav/SideNavRouterLink.vue2.js +0 -4
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +0 -30
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue2.js +0 -4
- package/dist/components/Sidebar/Actions/EditSidebarListCollection.vue.js +0 -58
- package/dist/components/Sidebar/Actions/EditSidebarListCollection.vue2.js +0 -4
- package/dist/components/Sidebar/Actions/EditSidebarListElement.vue.js +0 -29
- package/dist/components/Sidebar/Actions/EditSidebarListElement.vue2.js +0 -4
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +0 -46
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +0 -4
- package/dist/components/Sidebar/Sidebar.vue.js +0 -7
- package/dist/components/Sidebar/Sidebar.vue2.js +0 -63
- package/dist/components/Sidebar/SidebarButton.vue.js +0 -33
- package/dist/components/Sidebar/SidebarButton.vue2.js +0 -4
- package/dist/components/Sidebar/SidebarList.vue.js +0 -12
- package/dist/components/Sidebar/SidebarListElement.vue.js +0 -8
- package/dist/components/Sidebar/SidebarListElement.vue2.js +0 -94
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +0 -86
- package/dist/components/Sidebar/SidebarListElementActions.vue2.js +0 -4
- package/dist/components/Sidebar/SidebarToggle.vue.js +0 -49
- package/dist/components/Sidebar/SidebarToggle.vue2.js +0 -4
- package/dist/components/TopNav/TopNav.vue.js +0 -210
- package/dist/components/TopNav/TopNav.vue2.js +0 -4
- package/dist/components/TopNav/TopNavItem.vue.js +0 -7
- package/dist/components/TopNav/TopNavItem.vue2.js +0 -138
- package/dist/components/ViewLayout/ViewLayout.vue.js +0 -18
- package/dist/components/ViewLayout/ViewLayout.vue2.js +0 -4
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +0 -92
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue2.js +0 -4
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js +0 -12
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +0 -23
- package/dist/components/ViewLayout/ViewLayoutSection.vue2.js +0 -4
- package/dist/constants.js +0 -40
- package/dist/data/httpHeaders.js +0 -537
- package/dist/hooks/useAnalytics.js +0 -11
- package/dist/hooks/useClientConfig.js +0 -7
- package/dist/hooks/useFileDialog.js +0 -21
- package/dist/hooks/useLayout.js +0 -8
- package/dist/hooks/useResponseBody.js +0 -20
- package/dist/hooks/useSidebar.js +0 -28
- package/dist/layouts/App/ApiClientApp.vue.js +0 -70
- package/dist/layouts/App/ApiClientApp.vue3.js +0 -5
- package/dist/layouts/App/MainLayout.vue.js +0 -26
- package/dist/layouts/App/MainLayout.vue2.js +0 -4
- package/dist/layouts/App/create-api-client-app.js +0 -35
- package/dist/layouts/App/hotkeys.js +0 -21
- package/dist/layouts/Modal/ApiClientModal.vue.js +0 -30
- package/dist/layouts/Modal/ApiClientModal.vue2.js +0 -4
- package/dist/layouts/Modal/create-api-client-modal.js +0 -32
- package/dist/layouts/Web/ApiClientWeb.vue.js +0 -64
- package/dist/layouts/Web/ApiClientWeb.vue3.js +0 -5
- package/dist/layouts/Web/create-api-client-web.js +0 -32
- package/dist/libs/create-client.js +0 -189
- package/dist/libs/electron.js +0 -4
- package/dist/libs/env-helpers.js +0 -6
- package/dist/libs/environment-parser.js +0 -18
- package/dist/libs/errors.js +0 -16
- package/dist/libs/event-bus.js +0 -32
- package/dist/libs/extractAttachmentFilename.js +0 -18
- package/dist/libs/find-request.js +0 -23
- package/dist/libs/formatters.js +0 -10
- package/dist/libs/get-request-uid-by-path-method.js +0 -18
- package/dist/libs/getOpenApiDocumentDetails.js +0 -40
- package/dist/libs/hot-keys.js +0 -44
- package/dist/libs/importers/curl.js +0 -53
- package/dist/libs/isUrl.js +0 -7
- package/dist/libs/local-storage.js +0 -41
- package/dist/libs/normalize-headers.js +0 -27
- package/dist/libs/parse-curl.js +0 -59
- package/dist/libs/postman.js +0 -37
- package/dist/libs/send-request/build-request-security.js +0 -35
- package/dist/libs/send-request/create-fetch-body.js +0 -25
- package/dist/libs/send-request/create-fetch-headers.js +0 -11
- package/dist/libs/send-request/create-fetch-query-params.js +0 -33
- package/dist/libs/send-request/create-request-operation.js +0 -140
- package/dist/libs/send-request/decode-buffer.js +0 -9
- package/dist/libs/send-request/set-request-cookies.js +0 -58
- package/dist/libs/string-template.js +0 -42
- package/dist/libs/validate-parameters.js +0 -16
- package/dist/plugins/hooks/usePluginManager.js +0 -10
- package/dist/plugins/plugin-manager.js +0 -26
- package/dist/routes.js +0 -210
- package/dist/store/active-entities.js +0 -118
- package/dist/store/collections.js +0 -73
- package/dist/store/cookies.js +0 -13
- package/dist/store/environment.js +0 -32
- package/dist/store/events.js +0 -35
- package/dist/store/import-spec.js +0 -55
- package/dist/store/request-example.js +0 -43
- package/dist/store/requests.js +0 -97
- package/dist/store/router-params.js +0 -22
- package/dist/store/security-schemes.js +0 -55
- package/dist/store/servers.js +0 -39
- package/dist/store/store.js +0 -144
- package/dist/store/tags.js +0 -45
- package/dist/store/workspace.js +0 -52
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +0 -242
- package/dist/v2/blocks/operation-block/OperationBlock.vue2.js +0 -4
- package/dist/v2/blocks/operation-block/components/Header.vue.js +0 -7
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +0 -100
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +0 -40
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +0 -31
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +0 -107
- package/dist/v2/blocks/operation-block/helpers/build-request-security.js +0 -46
- package/dist/v2/blocks/operation-block/helpers/build-request.js +0 -70
- package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +0 -25
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +0 -9
- package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js +0 -14
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js +0 -4
- package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js +0 -7
- package/dist/v2/blocks/operation-block/helpers/get-example.js +0 -36
- package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js +0 -17
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +0 -4
- package/dist/v2/blocks/operation-block/helpers/get-server-url.js +0 -12
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js +0 -31
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.js +0 -43
- package/dist/v2/blocks/operation-block/helpers/response-cache.js +0 -12
- package/dist/v2/blocks/operation-block/helpers/send-request.js +0 -122
- package/dist/v2/blocks/operation-block/helpers/serialize-parameter.js +0 -49
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +0 -17
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.js +0 -56
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue2.js +0 -4
- package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue.js +0 -30
- package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue2.js +0 -4
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +0 -7
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +0 -227
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.js +0 -22
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +0 -27
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +0 -40
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.js +0 -20
- package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.js +0 -4
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +0 -302
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.js +0 -28
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.js +0 -10
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +0 -67
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +0 -66
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +0 -172
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.js +0 -55
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.js +0 -18
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +0 -7
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +0 -347
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +0 -7
- package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +0 -191
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js +0 -84
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue2.js +0 -4
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +0 -135
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue2.js +0 -4
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js +0 -78
- package/dist/v2/blocks/request-block/components/RequestParams.vue2.js +0 -4
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +0 -7
- package/dist/v2/blocks/request-block/components/RequestTable.vue2.js +0 -74
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +0 -204
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue2.js +0 -4
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +0 -7
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue2.js +0 -63
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +0 -55
- package/dist/v2/blocks/request-block/helpers/files.js +0 -7
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +0 -26
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +0 -29
- package/dist/v2/blocks/request-block/helpers/get-parameter-content.js +0 -9
- package/dist/v2/blocks/request-block/helpers/get-parameter-schema.js +0 -6
- package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +0 -16
- package/dist/v2/blocks/request-block/helpers/group-by.js +0 -10
- package/dist/v2/blocks/request-block/helpers/is-param-disabled.js +0 -7
- package/dist/v2/blocks/request-block/helpers/validate-parameter.js +0 -32
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +0 -7
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +0 -180
- package/dist/v2/blocks/response-block/components/Headers.vue.js +0 -96
- package/dist/v2/blocks/response-block/components/Headers.vue2.js +0 -4
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +0 -7
- package/dist/v2/blocks/response-block/components/ResponseBody.vue2.js +0 -87
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.js +0 -36
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue2.js +0 -4
- package/dist/v2/blocks/response-block/components/ResponseBodyInfo.vue.js +0 -14
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +0 -7
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue2.js +0 -63
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +0 -7
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue2.js +0 -41
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +0 -94
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue2.js +0 -4
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.js +0 -25
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue2.js +0 -4
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.js +0 -52
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue3.js +0 -5
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +0 -54
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue2.js +0 -4
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +0 -7
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +0 -79
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +0 -7
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue2.js +0 -46
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js +0 -67
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue2.js +0 -4
- package/dist/v2/blocks/response-block/helpers/extract-filename.js +0 -18
- package/dist/v2/blocks/response-block/helpers/get-content-length.js +0 -12
- package/dist/v2/blocks/response-block/helpers/media-types.js +0 -126
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +0 -12
- package/dist/v2/blocks/response-block/helpers/process-response-body.js +0 -16
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +0 -7
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +0 -208
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +0 -7
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue2.js +0 -95
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +0 -145
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue2.js +0 -4
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js +0 -38
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +0 -25
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +0 -184
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js +0 -51
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +0 -330
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js +0 -7
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue2.js +0 -76
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +0 -165
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue3.js +0 -5
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js +0 -91
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +0 -83
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +0 -46
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +0 -244
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +0 -97
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +0 -135
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +0 -35
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +0 -7
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +0 -23
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +0 -139
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +0 -27
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +0 -64
- package/dist/v2/components/callout/Callout.vue.js +0 -7
- package/dist/v2/components/callout/Callout.vue2.js +0 -43
- package/dist/v2/components/code-input/CodeInput.vue.js +0 -8
- package/dist/v2/components/code-input/CodeInput.vue2.js +0 -213
- package/dist/v2/components/code-input/code-variable-widget.js +0 -106
- package/dist/v2/components/data-table/DataTable.vue.js +0 -38
- package/dist/v2/components/data-table/DataTable.vue2.js +0 -4
- package/dist/v2/components/data-table/DataTableCell.vue.js +0 -26
- package/dist/v2/components/data-table/DataTableCell.vue2.js +0 -4
- package/dist/v2/components/data-table/DataTableCheckbox.vue.js +0 -53
- package/dist/v2/components/data-table/DataTableCheckbox.vue2.js +0 -4
- package/dist/v2/components/data-table/DataTableHeader.vue.js +0 -18
- package/dist/v2/components/data-table/DataTableHeader.vue2.js +0 -4
- package/dist/v2/components/data-table/DataTableInput.vue.js +0 -7
- package/dist/v2/components/data-table/DataTableInput.vue2.js +0 -121
- package/dist/v2/components/data-table/DataTableInputSelect.vue.js +0 -149
- package/dist/v2/components/data-table/DataTableInputSelect.vue2.js +0 -4
- package/dist/v2/components/data-table/DataTableRow.vue.js +0 -12
- package/dist/v2/components/data-table/DataTableText.vue.js +0 -23
- package/dist/v2/components/data-table/DataTableText.vue2.js +0 -4
- package/dist/v2/components/forms/ConfirmationForm.vue.js +0 -45
- package/dist/v2/components/forms/ConfirmationForm.vue2.js +0 -4
- package/dist/v2/components/layout/CollapsibleSection.vue.js +0 -89
- package/dist/v2/components/layout/CollapsibleSection.vue2.js +0 -4
- package/dist/v2/components/layout/ValueEmitter.vue.js +0 -21
- package/dist/v2/components/layout/ValueEmitter.vue2.js +0 -4
- package/dist/v2/components/modals/DeleteModal.vue.js +0 -31
- package/dist/v2/components/modals/DeleteModal.vue2.js +0 -4
- package/dist/v2/components/modals/ModalClientContainer.vue.js +0 -7
- package/dist/v2/components/modals/ModalClientContainer.vue2.js +0 -60
- package/dist/v2/components/resize/Resize.vue.js +0 -8
- package/dist/v2/components/resize/Resize.vue2.js +0 -36
- package/dist/v2/components/resize/use-split-resize.js +0 -57
- package/dist/v2/components/server/ServerDropdown.vue.js +0 -91
- package/dist/v2/components/server/ServerDropdown.vue2.js +0 -4
- package/dist/v2/components/server/ServerDropdownItem.vue.js +0 -7
- package/dist/v2/components/server/ServerDropdownItem.vue2.js +0 -49
- package/dist/v2/components/sidebar/Sidebar.vue.js +0 -115
- package/dist/v2/components/sidebar/Sidebar.vue2.js +0 -4
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +0 -52
- package/dist/v2/components/sidebar/SidebarMenu.vue2.js +0 -4
- package/dist/v2/components/sidebar/SidebarToggle.vue.js +0 -52
- package/dist/v2/components/sidebar/SidebarToggle.vue2.js +0 -4
- package/dist/v2/features/app/App.vue.js +0 -152
- package/dist/v2/features/app/App.vue3.js +0 -5
- package/dist/v2/features/app/app-events.js +0 -251
- package/dist/v2/features/app/app-state.js +0 -415
- package/dist/v2/features/app/components/AppSidebar.vue.js +0 -7
- package/dist/v2/features/app/components/AppSidebar.vue2.js +0 -304
- package/dist/v2/features/app/components/CreateWorkspaceModal.vue.js +0 -56
- package/dist/v2/features/app/components/CreateWorkspaceModal.vue2.js +0 -4
- package/dist/v2/features/app/components/DesktopTab.vue.js +0 -7
- package/dist/v2/features/app/components/DesktopTab.vue2.js +0 -134
- package/dist/v2/features/app/components/DesktopTabs.vue.js +0 -56
- package/dist/v2/features/app/components/DesktopTabs.vue2.js +0 -4
- package/dist/v2/features/app/components/DownloadAppButton.vue.js +0 -7
- package/dist/v2/features/app/components/DownloadAppButton.vue2.js +0 -19
- package/dist/v2/features/app/components/SidebarItemMenu.vue.js +0 -185
- package/dist/v2/features/app/components/SidebarItemMenu.vue2.js +0 -4
- package/dist/v2/features/app/components/SplashScreen.vue.js +0 -7
- package/dist/v2/features/app/components/SplashScreen.vue2.js +0 -18
- package/dist/v2/features/app/helpers/create-api-client-app.js +0 -36
- package/dist/v2/features/app/helpers/filter-workspaces.js +0 -5
- package/dist/v2/features/app/helpers/get-route-param.js +0 -9
- package/dist/v2/features/app/helpers/group-workspaces.js +0 -23
- package/dist/v2/features/app/helpers/routes.js +0 -157
- package/dist/v2/features/app/hooks/use-document-watcher.js +0 -66
- package/dist/v2/features/app/hooks/use-theme.js +0 -48
- package/dist/v2/features/collection/DocumentCollection.vue.js +0 -336
- package/dist/v2/features/collection/DocumentCollection.vue3.js +0 -5
- package/dist/v2/features/collection/OperationCollection.vue.js +0 -86
- package/dist/v2/features/collection/OperationCollection.vue2.js +0 -4
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +0 -68
- package/dist/v2/features/collection/WorkspaceCollection.vue2.js +0 -4
- package/dist/v2/features/collection/components/Authentication.vue.js +0 -7
- package/dist/v2/features/collection/components/Authentication.vue2.js +0 -154
- package/dist/v2/features/collection/components/Cookies.vue.js +0 -52
- package/dist/v2/features/collection/components/Cookies.vue2.js +0 -4
- package/dist/v2/features/collection/components/Editor/Editor.vue.js +0 -7
- package/dist/v2/features/collection/components/Editor/Editor.vue2.js +0 -344
- package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue.js +0 -78
- package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue2.js +0 -4
- package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue.js +0 -83
- package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue2.js +0 -4
- package/dist/v2/features/collection/components/Editor/helpers/get-diagnostic-counts.js +0 -10
- package/dist/v2/features/collection/components/Editor/helpers/get-operation-context.js +0 -5
- package/dist/v2/features/collection/components/Editor/helpers/get-visible-diagnostics.js +0 -5
- package/dist/v2/features/collection/components/Editor/helpers/parse-editor-object.js +0 -21
- package/dist/v2/features/collection/components/Editor/helpers/stringify-document.js +0 -5
- package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.js +0 -25
- package/dist/v2/features/collection/components/Environment.vue.js +0 -54
- package/dist/v2/features/collection/components/Environment.vue2.js +0 -4
- package/dist/v2/features/collection/components/Form.vue.js +0 -78
- package/dist/v2/features/collection/components/Form.vue2.js +0 -4
- package/dist/v2/features/collection/components/LabelInput.vue.js +0 -7
- package/dist/v2/features/collection/components/LabelInput.vue2.js +0 -35
- package/dist/v2/features/collection/components/Overview.vue.js +0 -7
- package/dist/v2/features/collection/components/Overview.vue2.js +0 -208
- package/dist/v2/features/collection/components/Servers.vue.js +0 -210
- package/dist/v2/features/collection/components/Servers.vue2.js +0 -4
- package/dist/v2/features/collection/components/Settings.vue.js +0 -61
- package/dist/v2/features/collection/components/Settings.vue2.js +0 -4
- package/dist/v2/features/collection/components/SyncConflictResolutionEditor.vue.js +0 -7
- package/dist/v2/features/collection/components/SyncConflictResolutionEditor.vue2.js +0 -136
- package/dist/v2/features/collection/components/Tabs.vue.js +0 -44
- package/dist/v2/features/collection/components/Tabs.vue2.js +0 -4
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.js +0 -13
- package/dist/v2/features/command-palette/TheCommandPalette.vue.js +0 -7
- package/dist/v2/features/command-palette/TheCommandPalette.vue2.js +0 -152
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.js +0 -48
- package/dist/v2/features/command-palette/components/CommandActionForm.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.js +0 -52
- package/dist/v2/features/command-palette/components/CommandActionInput.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +0 -211
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +0 -182
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.js +0 -7
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue2.js +0 -115
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.js +0 -78
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +0 -221
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +0 -114
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue.js +0 -40
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue2.js +0 -4
- package/dist/v2/features/command-palette/helpers/generate-unique-slug.js +0 -11
- package/dist/v2/features/command-palette/helpers/get-openapi-document-details.js +0 -31
- package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.js +0 -11
- package/dist/v2/features/command-palette/helpers/get-operation-from-curl.js +0 -76
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.js +0 -18
- package/dist/v2/features/command-palette/helpers/import-document-to-workspace.js +0 -33
- package/dist/v2/features/command-palette/helpers/is-postman-collection.js +0 -11
- package/dist/v2/features/command-palette/helpers/load-document-from-source.js +0 -52
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +0 -139
- package/dist/v2/features/editor/config.js +0 -16
- package/dist/v2/features/editor/helpers/configure-language-support.js +0 -39
- package/dist/v2/features/editor/helpers/ensure-monaco-environment.js +0 -20
- package/dist/v2/features/editor/helpers/json/create-json-model.js +0 -19
- package/dist/v2/features/editor/helpers/json/get-json-ast-node-from-path.js +0 -9
- package/dist/v2/features/editor/helpers/json/json-ast.js +0 -24
- package/dist/v2/features/editor/helpers/json/json-pointer-links.js +0 -72
- package/dist/v2/features/editor/helpers/json/json-pointer-path.js +0 -21
- package/dist/v2/features/editor/helpers/range-to-whole-line.js +0 -8
- package/dist/v2/features/editor/helpers/theme/apply-scalar-theme.js +0 -56
- package/dist/v2/features/editor/helpers/theme/load-css-variables.js +0 -21
- package/dist/v2/features/editor/helpers/yaml/create-yaml-model.js +0 -19
- package/dist/v2/features/editor/helpers/yaml/get-yaml-node-range-from-path.js +0 -50
- package/dist/v2/features/editor/hooks/use-editor-markers.js +0 -34
- package/dist/v2/features/editor/hooks/use-editor.js +0 -107
- package/dist/v2/features/editor/hooks/use-json-pointer-link-support.js +0 -27
- package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js +0 -316
- package/dist/v2/features/editor/schemas/openapi-3.1-schema.json.js +0 -25
- package/dist/v2/features/environments/EnvironmentsList.vue.js +0 -68
- package/dist/v2/features/environments/EnvironmentsList.vue2.js +0 -4
- package/dist/v2/features/environments/components/Environment.vue.js +0 -66
- package/dist/v2/features/environments/components/Environment.vue2.js +0 -4
- package/dist/v2/features/environments/components/EnvironmentColors.vue.js +0 -121
- package/dist/v2/features/environments/components/EnvironmentColors.vue2.js +0 -4
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js +0 -85
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue2.js +0 -4
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js +0 -53
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue2.js +0 -4
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js +0 -109
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue2.js +0 -4
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +0 -7
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue2.js +0 -136
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +0 -7
- package/dist/v2/features/global-cookies/components/CookiesTable.vue2.js +0 -189
- package/dist/v2/features/modal/Modal.vue.js +0 -122
- package/dist/v2/features/modal/Modal.vue2.js +0 -4
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +0 -89
- package/dist/v2/features/modal/helpers/map-hidden-clients-config.js +0 -36
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js +0 -29
- package/dist/v2/features/modal/helpers/restore-workspace-state.js +0 -36
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js +0 -93
- package/dist/v2/features/modal/modal-events.js +0 -44
- package/dist/v2/features/operation/Operation.vue.js +0 -126
- package/dist/v2/features/operation/Operation.vue2.js +0 -4
- package/dist/v2/features/operation/helpers/combine-params.js +0 -14
- package/dist/v2/features/operation/helpers/get-security-requirements.js +0 -4
- package/dist/v2/features/operation/helpers/get-selected-security.js +0 -18
- package/dist/v2/features/operation/helpers/get-selected-server.js +0 -4
- package/dist/v2/features/search/helpers/create-fuse-instance.js +0 -43
- package/dist/v2/features/search/helpers/create-search-index.js +0 -63
- package/dist/v2/features/search/hooks/use-search-index.js +0 -18
- package/dist/v2/features/settings/CollectionSettings.vue.js +0 -275
- package/dist/v2/features/settings/CollectionSettings.vue2.js +0 -4
- package/dist/v2/features/settings/DocumentSettings.vue.js +0 -115
- package/dist/v2/features/settings/DocumentSettings.vue2.js +0 -4
- package/dist/v2/features/settings/components/Appearance.vue.js +0 -88
- package/dist/v2/features/settings/components/Appearance.vue2.js +0 -4
- package/dist/v2/features/settings/components/Section.vue.js +0 -35
- package/dist/v2/features/settings/components/Section.vue2.js +0 -4
- package/dist/v2/features/settings/helpers/get-theme-colors.js +0 -16
- package/dist/v2/helpers/drag-handle-factory.js +0 -120
- package/dist/v2/helpers/generate-location-id.js +0 -10
- package/dist/v2/helpers/get-active-environment.js +0 -22
- package/dist/v2/helpers/get-active-proxy-url.js +0 -5
- package/dist/v2/helpers/get-servers.js +0 -66
- package/dist/v2/helpers/get-tab-details.js +0 -34
- package/dist/v2/helpers/handle-hotkeys.js +0 -54
- package/dist/v2/helpers/is-url.js +0 -5
- package/dist/v2/helpers/slugify.js +0 -4
- package/dist/v2/helpers/storage.js +0 -16
- package/dist/v2/hooks/use-color-mode.js +0 -24
- package/dist/v2/hooks/use-global-hot-keys.js +0 -11
- package/dist/v2/hooks/use-scroll-lock.js +0 -21
- package/dist/v2/workspace-events.js +0 -252
- package/dist/views/Collection/Collection.vue.js +0 -4
- package/dist/views/Collection/Collection.vue2.js +0 -49
- package/dist/views/Collection/CollectionAuthentication.vue.js +0 -7
- package/dist/views/Collection/CollectionAuthentication.vue2.js +0 -56
- package/dist/views/Collection/CollectionCookies.vue.js +0 -4
- package/dist/views/Collection/CollectionCookies.vue2.js +0 -16
- package/dist/views/Collection/CollectionEnvironment.vue.js +0 -5
- package/dist/views/Collection/CollectionEnvironment.vue2.js +0 -229
- package/dist/views/Collection/CollectionInfoForm.vue.js +0 -7
- package/dist/views/Collection/CollectionInfoForm.vue2.js +0 -63
- package/dist/views/Collection/CollectionNavigation.vue.js +0 -133
- package/dist/views/Collection/CollectionNavigation.vue2.js +0 -4
- package/dist/views/Collection/CollectionOverview.vue.js +0 -4
- package/dist/views/Collection/CollectionOverview.vue2.js +0 -34
- package/dist/views/Collection/CollectionScripts.vue.js +0 -4
- package/dist/views/Collection/CollectionScripts.vue2.js +0 -16
- package/dist/views/Collection/CollectionServerForm.vue.js +0 -75
- package/dist/views/Collection/CollectionServerForm.vue2.js +0 -4
- package/dist/views/Collection/CollectionServers.vue.js +0 -4
- package/dist/views/Collection/CollectionServers.vue2.js +0 -94
- package/dist/views/Collection/CollectionSettings.vue.js +0 -4
- package/dist/views/Collection/CollectionSettings.vue2.js +0 -118
- package/dist/views/Collection/CollectionSync.vue.js +0 -4
- package/dist/views/Collection/CollectionSync.vue2.js +0 -16
- package/dist/views/Collection/components/EnvironmentForm.vue.js +0 -7
- package/dist/views/Collection/components/EnvironmentForm.vue2.js +0 -270
- package/dist/views/Collection/components/MarkdownInput.vue.js +0 -7
- package/dist/views/Collection/components/MarkdownInput.vue2.js +0 -100
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +0 -50
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue2.js +0 -4
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +0 -62
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +0 -82
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +0 -30
- package/dist/views/Cookies/CookieForm.vue.js +0 -34
- package/dist/views/Cookies/CookieForm.vue2.js +0 -4
- package/dist/views/Cookies/CookieModal.vue.js +0 -7
- package/dist/views/Cookies/CookieModal.vue2.js +0 -88
- package/dist/views/Cookies/Cookies.vue.js +0 -4
- package/dist/views/Cookies/Cookies.vue2.js +0 -162
- package/dist/views/Environment/Environment.vue.js +0 -4
- package/dist/views/Environment/Environment.vue2.js +0 -402
- package/dist/views/Environment/EnvironmentColorModal.vue.js +0 -42
- package/dist/views/Environment/EnvironmentColorModal.vue2.js +0 -4
- package/dist/views/Environment/EnvironmentColors.vue.js +0 -118
- package/dist/views/Environment/EnvironmentColors.vue2.js +0 -4
- package/dist/views/Environment/EnvironmentModal.vue.js +0 -131
- package/dist/views/Environment/EnvironmentModal.vue2.js +0 -4
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +0 -129
- package/dist/views/Environment/EnvironmentVariableDropdown.vue2.js +0 -4
- package/dist/views/Environment/handle-drag.js +0 -32
- package/dist/views/Request/Request.vue.js +0 -7
- package/dist/views/Request/Request.vue2.js +0 -105
- package/dist/views/Request/RequestRoot.vue.js +0 -7
- package/dist/views/Request/RequestRoot.vue2.js +0 -123
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +0 -52
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +0 -246
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +0 -135
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +0 -209
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +0 -116
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.js +0 -50
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +0 -219
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.js +0 -28
- package/dist/views/Request/RequestSection/RequestBody.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +0 -451
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +0 -170
- package/dist/views/Request/RequestSection/RequestParams.vue.js +0 -162
- package/dist/views/Request/RequestSection/RequestParams.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +0 -96
- package/dist/views/Request/RequestSection/RequestPathParams.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestSection.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +0 -247
- package/dist/views/Request/RequestSection/RequestTable.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +0 -227
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +0 -61
- package/dist/views/Request/RequestSection/helpers/filter-security-requirements.js +0 -29
- package/dist/views/Request/RequestSection/helpers/getting-started.js +0 -13
- package/dist/views/Request/RequestSection/helpers/update-scheme.js +0 -16
- package/dist/views/Request/RequestSidebar.vue.js +0 -7
- package/dist/views/Request/RequestSidebar.vue2.js +0 -341
- package/dist/views/Request/RequestSidebarItem.vue.js +0 -8
- package/dist/views/Request/RequestSidebarItem.vue2.js +0 -464
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +0 -7
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +0 -236
- package/dist/views/Request/RequestSubpageHeader.vue.js +0 -7
- package/dist/views/Request/RequestSubpageHeader.vue2.js +0 -79
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +0 -96
- package/dist/views/Request/ResponseSection/RequestHeaders.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +0 -7
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +0 -83
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +0 -36
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyInfo.vue.js +0 -14
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +0 -7
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +0 -63
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +0 -7
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +0 -42
- package/dist/views/Request/ResponseSection/ResponseBodyStreaming.vue.js +0 -74
- package/dist/views/Request/ResponseSection/ResponseBodyStreaming.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue.js +0 -25
- package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +0 -50
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +0 -5
- package/dist/views/Request/ResponseSection/ResponseCookies.vue.js +0 -51
- package/dist/views/Request/ResponseSection/ResponseCookies.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +0 -7
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +0 -103
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +0 -96
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +0 -7
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +0 -38
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +0 -67
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +0 -7
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +0 -189
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +0 -182
- package/dist/views/Request/components/WorkspaceDropdown.vue2.js +0 -4
- package/dist/views/Request/consts/mediaTypes.js +0 -131
- package/dist/views/Request/consts/new-auth-options.js +0 -100
- package/dist/views/Request/handle-drag.js +0 -42
- package/dist/views/Request/hooks/useOpenApiWatcher.js +0 -57
- package/dist/views/Request/libs/auth.js +0 -52
- package/dist/views/Request/libs/oauth2.js +0 -127
- package/dist/views/Request/libs/request.js +0 -40
- package/dist/views/Request/libs/watch-mode.js +0 -337
- package/dist/views/Settings/Settings.vue.js +0 -4
- package/dist/views/Settings/Settings.vue2.js +0 -29
- package/dist/views/Settings/SettingsGeneral.vue.js +0 -286
- package/dist/views/Settings/SettingsGeneral.vue2.js +0 -4
- package/dist/views/Settings/components/SettingsAppearance.vue.js +0 -85
- package/dist/views/Settings/components/SettingsAppearance.vue2.js +0 -4
- package/dist/views/Settings/components/SettingsSection.vue.js +0 -24
- package/dist/views/Settings/components/SettingsSection.vue2.js +0 -4
|
@@ -0,0 +1,1582 @@
|
|
|
1
|
+
import { r as useWorkspace } from "./store-DaPoVtIS.js";
|
|
2
|
+
import { a as useLayout } from "./useSidebar-DLTwHDI-.js";
|
|
3
|
+
import { n as usePluginManager } from "./plugins-B52hCIyZ.js";
|
|
4
|
+
import { n as matchesDomain } from "./set-request-cookies-BJJhsU4A.js";
|
|
5
|
+
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BmmBcIzD.js";
|
|
6
|
+
import { n as useFileDialog } from "./hooks-BvZxH4XB.js";
|
|
7
|
+
import { t as CodeInput_default } from "./CodeInput-BN7uw3Bh.js";
|
|
8
|
+
import { n as DataTableCell_default, r as DataTable_default, t as DataTableRow_default } from "./DataTableRow-c3XveEUO.js";
|
|
9
|
+
import { n as DataTableCheckbox_default } from "./DataTable-BqbZKW3K.js";
|
|
10
|
+
import { t as DataTableHeader_default } from "./DataTableHeader-DJVB0jCZ.js";
|
|
11
|
+
import { t as ViewLayoutCollapse_default } from "./ViewLayoutCollapse-CiTb-Uml.js";
|
|
12
|
+
import { t as SectionFilter_default } from "./SectionFilter-hrtoRLwj.js";
|
|
13
|
+
import { t as ViewLayoutSection_default } from "./ViewLayoutSection-mUqKbQry.js";
|
|
14
|
+
import { r as CodeSnippet_default } from "./CodeSnippet-D7Heh1nd.js";
|
|
15
|
+
import { t as RequestAuth_default } from "./RequestAuth-BU6ubH-c.js";
|
|
16
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, normalizeClass, onMounted, openBlock, ref, renderList, resolveDynamicComponent, toDisplayString, unref, useId, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
17
|
+
import { ScalarButton, ScalarCodeBlock, ScalarCombobox, ScalarErrorBoundary, ScalarIcon, ScalarListbox, ScalarPopover, ScalarTooltip } from "@scalar/components";
|
|
18
|
+
import { RouterLink } from "vue-router";
|
|
19
|
+
import { REGEX, canMethodHaveBody, isDefined } from "@scalar/oas-utils/helpers";
|
|
20
|
+
import { requestExampleParametersSchema } from "@scalar/oas-utils/entities/spec";
|
|
21
|
+
import { ScalarIconInfo, ScalarIconTrash, ScalarIconWarning } from "@scalar/icons";
|
|
22
|
+
import { snippetz } from "@scalar/snippetz";
|
|
23
|
+
//#region src/views/Request/libs/request.ts
|
|
24
|
+
/**
|
|
25
|
+
* Check if a RequestExampleParameter has any of the following properties:
|
|
26
|
+
* - description
|
|
27
|
+
* - type
|
|
28
|
+
* - default
|
|
29
|
+
* - format
|
|
30
|
+
* - minimum
|
|
31
|
+
* - maximum
|
|
32
|
+
*/
|
|
33
|
+
var hasItemProperties = (item) => Boolean(item.description || item.type || item.default || item.format || item.minimum || item.maximum);
|
|
34
|
+
/**
|
|
35
|
+
* Checks if the value of a RequestExampleParameter is the expected type or format
|
|
36
|
+
* Returns an alert message if the value is not in the correct type or format, otherwise false
|
|
37
|
+
*/
|
|
38
|
+
var parameterIsInvalid = (item) => {
|
|
39
|
+
return computed(() => {
|
|
40
|
+
if (item.value === void 0 || item.value === "") return false;
|
|
41
|
+
if (item.type) {
|
|
42
|
+
if (item.type === "integer") {
|
|
43
|
+
const value = Number(item.value);
|
|
44
|
+
if (isNaN(value) || !Number.isInteger(value)) return "Value must be a whole number (e.g., 42)";
|
|
45
|
+
if (item.minimum !== void 0 && value < item.minimum) return `Value must be ${item.minimum} or greater`;
|
|
46
|
+
if (item.maximum !== void 0 && value > item.maximum) return `Value must be ${item.maximum} or less`;
|
|
47
|
+
}
|
|
48
|
+
if (item.type === "number") {
|
|
49
|
+
const value = Number(item.value);
|
|
50
|
+
if (isNaN(value)) return "Value must be a number (e.g., 42.5)";
|
|
51
|
+
if (item.minimum !== void 0 && value < item.minimum) return `Value must be ${item.minimum} or greater`;
|
|
52
|
+
if (item.maximum !== void 0 && value > item.maximum) return `Value must be ${item.maximum} or less`;
|
|
53
|
+
}
|
|
54
|
+
if (item.type === "string" && item.format) {
|
|
55
|
+
if (item.format === "date" && !/^\d{4}-\d{2}-\d{2}$/.test(item.value)) return "Please enter a valid date in YYYY-MM-DD format (e.g., 2024-03-20)";
|
|
56
|
+
if (item.format === "date-time" && !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/.test(item.value)) return "Please enter a valid date and time in RFC 3339 format (e.g., 2024-03-20T13:45:30Z)";
|
|
57
|
+
if (item.format === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(item.value)) return "Please enter a valid email address (e.g., user@example.com)";
|
|
58
|
+
if (item.format === "uri" && !/^[a-zA-Z][a-zA-Z0-9+.-]*:.+$/.test(item.value)) return "Please enter a valid URI (e.g., https://example.com)";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/views/Request/RequestSection/RequestTableTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
66
|
+
var _hoisted_1$5 = ["aria-label", "role"];
|
|
67
|
+
var _hoisted_2$5 = { class: "w-content text-xxs text-c-1 grid min-w-48 gap-1.5 rounded px-1.5 pt-2 pb-1.5 leading-none" };
|
|
68
|
+
var _hoisted_3$4 = {
|
|
69
|
+
key: 0,
|
|
70
|
+
class: "text-error-1"
|
|
71
|
+
};
|
|
72
|
+
var _hoisted_4$1 = {
|
|
73
|
+
key: 1,
|
|
74
|
+
class: "schema text-c-2 flex items-center"
|
|
75
|
+
};
|
|
76
|
+
var _hoisted_5$1 = { key: 0 };
|
|
77
|
+
var _hoisted_6 = { key: 1 };
|
|
78
|
+
var _hoisted_7 = { key: 2 };
|
|
79
|
+
var _hoisted_8 = { key: 3 };
|
|
80
|
+
var _hoisted_9 = { key: 4 };
|
|
81
|
+
var _hoisted_10 = {
|
|
82
|
+
key: 2,
|
|
83
|
+
class: "text-sm leading-snug text-pretty",
|
|
84
|
+
style: { maxWidth: "16rem" }
|
|
85
|
+
};
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/views/Request/RequestSection/RequestTableTooltip.vue
|
|
88
|
+
var RequestTableTooltip_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
89
|
+
__name: "RequestTableTooltip",
|
|
90
|
+
props: { item: {} },
|
|
91
|
+
setup(__props) {
|
|
92
|
+
const isInvalid = computed(() => !!parameterIsInvalid(__props.item).value);
|
|
93
|
+
return (_ctx, _cache) => {
|
|
94
|
+
return openBlock(), createBlock(unref(ScalarPopover), {
|
|
95
|
+
teleport: "",
|
|
96
|
+
offset: 4,
|
|
97
|
+
placement: "left"
|
|
98
|
+
}, {
|
|
99
|
+
popover: withCtx(() => [createElementVNode("div", _hoisted_2$5, [isInvalid.value ? (openBlock(), createElementBlock("div", _hoisted_3$4, toDisplayString(unref(parameterIsInvalid)(__props.item).value), 1)) : __props.item.type || __props.item.format || __props.item.minimum || __props.item.maximum || __props.item.default ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
100
|
+
__props.item.type ? (openBlock(), createElementBlock("span", _hoisted_5$1, toDisplayString(__props.item.type), 1)) : createCommentVNode("", true),
|
|
101
|
+
__props.item.format ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(__props.item.format), 1)) : createCommentVNode("", true),
|
|
102
|
+
__props.item.minimum ? (openBlock(), createElementBlock("span", _hoisted_7, "min: " + toDisplayString(__props.item.minimum), 1)) : createCommentVNode("", true),
|
|
103
|
+
__props.item.maximum ? (openBlock(), createElementBlock("span", _hoisted_8, "max: " + toDisplayString(__props.item.maximum), 1)) : createCommentVNode("", true),
|
|
104
|
+
__props.item.default ? (openBlock(), createElementBlock("span", _hoisted_9, "default: " + toDisplayString(__props.item.default), 1)) : createCommentVNode("", true)
|
|
105
|
+
])) : createCommentVNode("", true), __props.item.description && !isInvalid.value ? (openBlock(), createElementBlock("span", _hoisted_10, toDisplayString(__props.item.description), 1)) : createCommentVNode("", true)])]),
|
|
106
|
+
default: withCtx(() => [createElementVNode("button", {
|
|
107
|
+
type: "button",
|
|
108
|
+
"aria-label": isInvalid.value ? "Input is invalid" : "More Information",
|
|
109
|
+
class: "text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1",
|
|
110
|
+
role: isInvalid.value ? "alert" : "none"
|
|
111
|
+
}, [isInvalid.value ? (openBlock(), createBlock(unref(ScalarIconWarning), {
|
|
112
|
+
key: 0,
|
|
113
|
+
class: "text-orange size-3.5 brightness-90 hover:brightness-75"
|
|
114
|
+
})) : (openBlock(), createBlock(unref(ScalarIconInfo), {
|
|
115
|
+
key: 1,
|
|
116
|
+
class: "text-c-2 hover:text-c-1 size-3.5"
|
|
117
|
+
}))], 8, _hoisted_1$5)]),
|
|
118
|
+
_: 1
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}), [["__scopeId", "data-v-4df72868"]]);
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/views/Request/RequestSection/RequestTable.vue?vue&type=script&setup=true&lang.ts
|
|
125
|
+
var _hoisted_1$4 = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify-end overflow-hidden p-1" };
|
|
126
|
+
var _hoisted_2$4 = ["onClick"];
|
|
127
|
+
var _hoisted_3$3 = {
|
|
128
|
+
key: 1,
|
|
129
|
+
class: "p-0.5"
|
|
130
|
+
};
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/views/Request/RequestSection/RequestTable.vue
|
|
133
|
+
var RequestTable_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
134
|
+
__name: "RequestTable",
|
|
135
|
+
props: {
|
|
136
|
+
items: {},
|
|
137
|
+
hasCheckboxDisabled: {
|
|
138
|
+
type: Boolean,
|
|
139
|
+
default: false
|
|
140
|
+
},
|
|
141
|
+
showUploadButton: {
|
|
142
|
+
type: Boolean,
|
|
143
|
+
default: false
|
|
144
|
+
},
|
|
145
|
+
isGlobal: {
|
|
146
|
+
type: Boolean,
|
|
147
|
+
default: false
|
|
148
|
+
},
|
|
149
|
+
isReadOnly: {
|
|
150
|
+
type: Boolean,
|
|
151
|
+
default: false
|
|
152
|
+
},
|
|
153
|
+
environment: {},
|
|
154
|
+
envVariables: {},
|
|
155
|
+
workspace: {},
|
|
156
|
+
invalidParams: {},
|
|
157
|
+
label: {}
|
|
158
|
+
},
|
|
159
|
+
emits: [
|
|
160
|
+
"updateRow",
|
|
161
|
+
"toggleRow",
|
|
162
|
+
"addRow",
|
|
163
|
+
"deleteRow",
|
|
164
|
+
"inputFocus",
|
|
165
|
+
"inputBlur",
|
|
166
|
+
"uploadFile",
|
|
167
|
+
"removeFile"
|
|
168
|
+
],
|
|
169
|
+
setup(__props, { emit: __emit }) {
|
|
170
|
+
const props = __props;
|
|
171
|
+
const emit = __emit;
|
|
172
|
+
const columns = [
|
|
173
|
+
"",
|
|
174
|
+
"",
|
|
175
|
+
"36px"
|
|
176
|
+
];
|
|
177
|
+
const handleSelectVariable = (idx, field, value) => {
|
|
178
|
+
emit("updateRow", idx, field, value);
|
|
179
|
+
};
|
|
180
|
+
const handleFileUpload = (idx) => {
|
|
181
|
+
emit("uploadFile", idx);
|
|
182
|
+
};
|
|
183
|
+
const flattenValue = (item) => {
|
|
184
|
+
return Array.isArray(item.default) && item.default.length === 1 ? item.default[0] : item.default;
|
|
185
|
+
};
|
|
186
|
+
const showDeleteButton = (item) => {
|
|
187
|
+
return Boolean(item.key || item.value);
|
|
188
|
+
};
|
|
189
|
+
return (_ctx, _cache) => {
|
|
190
|
+
return openBlock(), createBlock(DataTable_default, {
|
|
191
|
+
class: "group/table flex-1",
|
|
192
|
+
columns
|
|
193
|
+
}, {
|
|
194
|
+
default: withCtx(() => [createVNode(DataTableRow_default, { class: "sr-only !block" }, {
|
|
195
|
+
default: withCtx(() => [
|
|
196
|
+
createVNode(DataTableHeader_default, null, {
|
|
197
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.label) + " Enabled", 1)]),
|
|
198
|
+
_: 1
|
|
199
|
+
}),
|
|
200
|
+
createVNode(DataTableHeader_default, null, {
|
|
201
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.label) + " Key", 1)]),
|
|
202
|
+
_: 1
|
|
203
|
+
}),
|
|
204
|
+
createVNode(DataTableHeader_default, null, {
|
|
205
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.label) + " Value", 1)]),
|
|
206
|
+
_: 1
|
|
207
|
+
})
|
|
208
|
+
]),
|
|
209
|
+
_: 1
|
|
210
|
+
}), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, idx) => {
|
|
211
|
+
return openBlock(), createBlock(DataTableRow_default, {
|
|
212
|
+
id: item.key,
|
|
213
|
+
key: idx,
|
|
214
|
+
class: normalizeClass({
|
|
215
|
+
alert: unref(parameterIsInvalid)(item).value,
|
|
216
|
+
error: __props.invalidParams && __props.invalidParams.has(item.key)
|
|
217
|
+
})
|
|
218
|
+
}, {
|
|
219
|
+
default: withCtx(() => [
|
|
220
|
+
__props.isGlobal ? (openBlock(), createBlock(unref(RouterLink), {
|
|
221
|
+
key: 0,
|
|
222
|
+
class: "text-c-2 flex items-center justify-center border-t !border-r",
|
|
223
|
+
to: item.route ?? {}
|
|
224
|
+
}, {
|
|
225
|
+
default: withCtx(() => [_cache[4] || (_cache[4] = createElementVNode("span", { class: "sr-only" }, "Global", -1)), createVNode(unref(ScalarTooltip), {
|
|
226
|
+
content: "Global cookies are shared across the whole workspace.",
|
|
227
|
+
placement: "top"
|
|
228
|
+
}, {
|
|
229
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
230
|
+
tabindex: "0",
|
|
231
|
+
class: "text-c-1",
|
|
232
|
+
icon: "Globe",
|
|
233
|
+
size: "xs"
|
|
234
|
+
})]),
|
|
235
|
+
_: 1
|
|
236
|
+
})]),
|
|
237
|
+
_: 1
|
|
238
|
+
}, 8, ["to"])) : (openBlock(), createBlock(DataTableCheckbox_default, {
|
|
239
|
+
key: 1,
|
|
240
|
+
class: "!border-r",
|
|
241
|
+
disabled: props.hasCheckboxDisabled,
|
|
242
|
+
modelValue: item.enabled,
|
|
243
|
+
"onUpdate:modelValue": (v) => emit("toggleRow", idx, v)
|
|
244
|
+
}, null, 8, [
|
|
245
|
+
"disabled",
|
|
246
|
+
"modelValue",
|
|
247
|
+
"onUpdate:modelValue"
|
|
248
|
+
])),
|
|
249
|
+
createVNode(DataTableCell_default, null, {
|
|
250
|
+
default: withCtx(() => [createVNode(CodeInput_default, {
|
|
251
|
+
"aria-label": `${__props.label} Key`,
|
|
252
|
+
disableCloseBrackets: "",
|
|
253
|
+
disabled: props.isReadOnly,
|
|
254
|
+
disableEnter: "",
|
|
255
|
+
disableTabIndent: "",
|
|
256
|
+
lineWrapping: "",
|
|
257
|
+
envVariables: __props.envVariables,
|
|
258
|
+
environment: __props.environment,
|
|
259
|
+
modelValue: item.key,
|
|
260
|
+
placeholder: "Key",
|
|
261
|
+
required: Boolean(item.required),
|
|
262
|
+
workspace: __props.workspace,
|
|
263
|
+
onBlur: _cache[0] || (_cache[0] = ($event) => emit("inputBlur")),
|
|
264
|
+
onFocus: _cache[1] || (_cache[1] = ($event) => emit("inputFocus")),
|
|
265
|
+
onSelectVariable: (v) => handleSelectVariable(idx, "key", v),
|
|
266
|
+
"onUpdate:modelValue": (v) => emit("updateRow", idx, "key", v)
|
|
267
|
+
}, null, 8, [
|
|
268
|
+
"aria-label",
|
|
269
|
+
"disabled",
|
|
270
|
+
"envVariables",
|
|
271
|
+
"environment",
|
|
272
|
+
"modelValue",
|
|
273
|
+
"required",
|
|
274
|
+
"workspace",
|
|
275
|
+
"onSelectVariable",
|
|
276
|
+
"onUpdate:modelValue"
|
|
277
|
+
])]),
|
|
278
|
+
_: 2
|
|
279
|
+
}, 1024),
|
|
280
|
+
createVNode(DataTableCell_default, null, {
|
|
281
|
+
default: withCtx(() => [createVNode(CodeInput_default, {
|
|
282
|
+
"aria-label": `${__props.label} Value`,
|
|
283
|
+
class: normalizeClass(unref(hasItemProperties)(item) ? "pr-6 group-hover:pr-10 group-has-[.cm-focused]:pr-10" : "group-hover:pr-6 group-has-[.cm-focused]:pr-6"),
|
|
284
|
+
default: item.default,
|
|
285
|
+
disableCloseBrackets: "",
|
|
286
|
+
disabled: props.isReadOnly,
|
|
287
|
+
disableEnter: "",
|
|
288
|
+
disableTabIndent: "",
|
|
289
|
+
lineWrapping: "",
|
|
290
|
+
enum: item.enum ?? [],
|
|
291
|
+
envVariables: __props.envVariables,
|
|
292
|
+
environment: __props.environment,
|
|
293
|
+
examples: item.examples ?? [],
|
|
294
|
+
max: item.maximum,
|
|
295
|
+
min: item.minimum,
|
|
296
|
+
modelValue: item.value,
|
|
297
|
+
nullable: Boolean(item.nullable),
|
|
298
|
+
placeholder: "Value",
|
|
299
|
+
type: item.type,
|
|
300
|
+
workspace: __props.workspace,
|
|
301
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => emit("inputBlur")),
|
|
302
|
+
onFocus: _cache[3] || (_cache[3] = ($event) => emit("inputFocus")),
|
|
303
|
+
onSelectVariable: (v) => handleSelectVariable(idx, "value", v),
|
|
304
|
+
"onUpdate:modelValue": (v) => emit("updateRow", idx, "value", v)
|
|
305
|
+
}, {
|
|
306
|
+
icon: withCtx(() => [showDeleteButton(item) && !item.required ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
307
|
+
key: 0,
|
|
308
|
+
class: normalizeClass([{ "-mr-0.5": unref(hasItemProperties)(item) }, "text-c-2 hover:text-c-1 hover:bg-b-2 z-context hidden h-fit rounded p-1 group-hover:flex group-has-[.cm-focused]:flex"]),
|
|
309
|
+
size: "sm",
|
|
310
|
+
variant: "ghost",
|
|
311
|
+
onClick: ($event) => emit("deleteRow", idx)
|
|
312
|
+
}, {
|
|
313
|
+
default: withCtx(() => [createVNode(unref(ScalarIconTrash), { class: "size-3.5" })]),
|
|
314
|
+
_: 1
|
|
315
|
+
}, 8, ["class", "onClick"])) : createCommentVNode("", true), unref(hasItemProperties)(item) ? (openBlock(), createBlock(RequestTableTooltip_default, {
|
|
316
|
+
key: 1,
|
|
317
|
+
item: {
|
|
318
|
+
...item,
|
|
319
|
+
default: flattenValue(item)
|
|
320
|
+
}
|
|
321
|
+
}, null, 8, ["item"])) : createCommentVNode("", true)]),
|
|
322
|
+
_: 2
|
|
323
|
+
}, 1032, [
|
|
324
|
+
"aria-label",
|
|
325
|
+
"class",
|
|
326
|
+
"default",
|
|
327
|
+
"disabled",
|
|
328
|
+
"enum",
|
|
329
|
+
"envVariables",
|
|
330
|
+
"environment",
|
|
331
|
+
"examples",
|
|
332
|
+
"max",
|
|
333
|
+
"min",
|
|
334
|
+
"modelValue",
|
|
335
|
+
"nullable",
|
|
336
|
+
"type",
|
|
337
|
+
"workspace",
|
|
338
|
+
"onSelectVariable",
|
|
339
|
+
"onUpdate:modelValue"
|
|
340
|
+
])]),
|
|
341
|
+
_: 2
|
|
342
|
+
}, 1024),
|
|
343
|
+
__props.showUploadButton ? (openBlock(), createBlock(DataTableCell_default, {
|
|
344
|
+
key: 2,
|
|
345
|
+
class: "group/upload flex items-center justify-center whitespace-nowrap"
|
|
346
|
+
}, {
|
|
347
|
+
default: withCtx(() => [item.file ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("div", _hoisted_1$4, [createElementVNode("span", null, toDisplayString(item.file?.name), 1)]), createElementVNode("button", {
|
|
348
|
+
class: "bg-b-2 centered-x centered-y absolute hidden w-[calc(100%_-_8px)] rounded p-0.5 text-center text-xs font-medium group-hover/upload:block",
|
|
349
|
+
type: "button",
|
|
350
|
+
onClick: ($event) => emit("removeFile", idx)
|
|
351
|
+
}, " Delete ", 8, _hoisted_2$4)], 64)) : (openBlock(), createElementBlock("div", _hoisted_3$3, [createVNode(unref(ScalarButton), {
|
|
352
|
+
class: "bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none",
|
|
353
|
+
size: "sm",
|
|
354
|
+
variant: "outlined",
|
|
355
|
+
onClick: ($event) => handleFileUpload(idx)
|
|
356
|
+
}, {
|
|
357
|
+
default: withCtx(() => [_cache[5] || (_cache[5] = createElementVNode("span", null, "Upload File", -1)), createVNode(unref(ScalarIcon), {
|
|
358
|
+
class: "ml-1",
|
|
359
|
+
icon: "Upload",
|
|
360
|
+
size: "xs",
|
|
361
|
+
thickness: "2.5"
|
|
362
|
+
})]),
|
|
363
|
+
_: 1
|
|
364
|
+
}, 8, ["onClick"])]))]),
|
|
365
|
+
_: 2
|
|
366
|
+
}, 1024)) : createCommentVNode("", true)
|
|
367
|
+
]),
|
|
368
|
+
_: 2
|
|
369
|
+
}, 1032, ["id", "class"]);
|
|
370
|
+
}), 128))]),
|
|
371
|
+
_: 1
|
|
372
|
+
});
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
}), [["__scopeId", "data-v-04661eb4"]]);
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region src/views/Request/RequestSection/RequestBody.vue?vue&type=script&setup=true&lang.ts
|
|
378
|
+
var _hoisted_1$3 = {
|
|
379
|
+
key: 0,
|
|
380
|
+
class: "text-c-3 flex min-h-10 w-full items-center justify-center border-t p-2 text-sm"
|
|
381
|
+
};
|
|
382
|
+
var _hoisted_2$3 = {
|
|
383
|
+
key: 1,
|
|
384
|
+
class: "flex items-center justify-center overflow-hidden border-t p-1.5"
|
|
385
|
+
};
|
|
386
|
+
var _hoisted_3$2 = { class: "text-c-2 w-full max-w-full overflow-hidden rounded border px-1.5 py-1 text-xs whitespace-nowrap" };
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region src/views/Request/RequestSection/RequestBody.vue
|
|
389
|
+
var RequestBody_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
390
|
+
__name: "RequestBody",
|
|
391
|
+
props: {
|
|
392
|
+
example: {},
|
|
393
|
+
operation: {},
|
|
394
|
+
environment: {},
|
|
395
|
+
envVariables: {},
|
|
396
|
+
workspace: {},
|
|
397
|
+
title: {}
|
|
398
|
+
},
|
|
399
|
+
setup(__props) {
|
|
400
|
+
const { requestExampleMutators } = useWorkspace();
|
|
401
|
+
/** use-codemirror package to be updated accordingly */
|
|
402
|
+
const contentTypeToLanguageMap = {
|
|
403
|
+
json: "json",
|
|
404
|
+
xml: "xml",
|
|
405
|
+
yaml: "yaml",
|
|
406
|
+
edn: "edn",
|
|
407
|
+
other: "html"
|
|
408
|
+
};
|
|
409
|
+
const contentTypeOptions = Object.entries({
|
|
410
|
+
multipartForm: "Multipart Form",
|
|
411
|
+
formUrlEncoded: "Form URL Encoded",
|
|
412
|
+
binaryFile: "Binary File",
|
|
413
|
+
json: "JSON",
|
|
414
|
+
xml: "XML",
|
|
415
|
+
yaml: "YAML",
|
|
416
|
+
edn: "EDN",
|
|
417
|
+
other: "Other",
|
|
418
|
+
none: "None"
|
|
419
|
+
}).map(([id, label]) => ({
|
|
420
|
+
id,
|
|
421
|
+
label
|
|
422
|
+
}));
|
|
423
|
+
/** Match the activeBody to the contentTypeOptions */
|
|
424
|
+
const activeExampleContentType = computed(() => {
|
|
425
|
+
const { activeBody, formData, raw } = __props.example.body;
|
|
426
|
+
if (activeBody === "formData") return formData?.encoding === "urlencoded" ? "formUrlEncoded" : "multipartForm";
|
|
427
|
+
if (activeBody === "binary") return "binaryFile";
|
|
428
|
+
if (activeBody === "raw" && raw?.encoding) {
|
|
429
|
+
if (raw.encoding === "html" || raw.encoding === "text") return "other";
|
|
430
|
+
return raw.encoding;
|
|
431
|
+
}
|
|
432
|
+
return Object.keys(__props.operation.requestBody?.content || {})[0] || "none";
|
|
433
|
+
});
|
|
434
|
+
/** Selected ref from options above */
|
|
435
|
+
const selectedContentType = computed({
|
|
436
|
+
get: () => contentTypeOptions.find((opt) => opt.id === activeExampleContentType.value) ?? contentTypeOptions[contentTypeOptions.length - 1] ?? contentTypeOptions[0],
|
|
437
|
+
set: (opt) => {
|
|
438
|
+
if (opt?.id) updateActiveBody(opt.id);
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
const tableWrapperRef = ref(null);
|
|
442
|
+
const codeInputLanguage = computed(() => {
|
|
443
|
+
return contentTypeToLanguageMap[selectedContentType.value?.id] ?? "plaintext";
|
|
444
|
+
});
|
|
445
|
+
const deleteRow = (rowIdx) => {
|
|
446
|
+
const currentParams = formParams.value;
|
|
447
|
+
if (currentParams.length > rowIdx) {
|
|
448
|
+
const updatedParams = [...currentParams];
|
|
449
|
+
updatedParams.splice(rowIdx, 1);
|
|
450
|
+
requestExampleMutators.edit(__props.example.uid, "body.formData.value", updatedParams);
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
/** Update a field in a parameter row */
|
|
454
|
+
const updateRow = (rowIdx, field, value) => {
|
|
455
|
+
const currentParams = formParams.value;
|
|
456
|
+
if (currentParams.length > rowIdx) {
|
|
457
|
+
const updatedParams = [...currentParams];
|
|
458
|
+
updatedParams[rowIdx] = {
|
|
459
|
+
...updatedParams[rowIdx],
|
|
460
|
+
value: updatedParams[rowIdx]?.value || "",
|
|
461
|
+
key: updatedParams[rowIdx]?.key || "",
|
|
462
|
+
enabled: updatedParams[rowIdx]?.enabled ?? false,
|
|
463
|
+
[field]: value || ""
|
|
464
|
+
};
|
|
465
|
+
/** enable row key or value is filled */
|
|
466
|
+
if (updatedParams[rowIdx]?.key !== "" || updatedParams[rowIdx]?.value !== "") updatedParams[rowIdx].enabled = true;
|
|
467
|
+
/** check key and value input state */
|
|
468
|
+
if (updatedParams[rowIdx]?.key === "" && updatedParams[rowIdx]?.value === "")
|
|
469
|
+
/** remove if empty */
|
|
470
|
+
updatedParams.splice(rowIdx, 1);
|
|
471
|
+
requestExampleMutators.edit(__props.example.uid, "body.formData.value", updatedParams);
|
|
472
|
+
} else {
|
|
473
|
+
/** if there is no row at the index, add a new one */
|
|
474
|
+
const payload = [requestExampleParametersSchema.parse({ [field]: value })];
|
|
475
|
+
requestExampleMutators.edit(__props.example.uid, "body.formData.value", payload);
|
|
476
|
+
/** focus the new row */
|
|
477
|
+
nextTick(() => {
|
|
478
|
+
if (!tableWrapperRef.value) return;
|
|
479
|
+
tableWrapperRef.value.querySelectorAll("input")[field === "key" ? 0 : 1]?.focus();
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
if (rowIdx === currentParams.length - 1) addRow();
|
|
483
|
+
};
|
|
484
|
+
const formParams = computed(() => __props.example.body.formData?.value ?? []);
|
|
485
|
+
/** ensure one empty row by default */
|
|
486
|
+
const defaultRow = () => {
|
|
487
|
+
const lastParam = formParams.value[formParams.value.length - 1];
|
|
488
|
+
if (!lastParam || lastParam.key !== "" || lastParam.value !== "") addRow();
|
|
489
|
+
};
|
|
490
|
+
/** Add a new row to a given parameter list */
|
|
491
|
+
const addRow = () => {
|
|
492
|
+
/** Create a new parameter instance with 'enabled' set to false */
|
|
493
|
+
const newParam = requestExampleParametersSchema.parse({ enabled: false });
|
|
494
|
+
const newParams = [...formParams.value, newParam];
|
|
495
|
+
if (__props.example.body.formData) requestExampleMutators.edit(__props.example.uid, "body.formData.value", newParams);
|
|
496
|
+
else requestExampleMutators.edit(__props.example.uid, "body.formData", {
|
|
497
|
+
value: newParams,
|
|
498
|
+
encoding: "form-data"
|
|
499
|
+
});
|
|
500
|
+
};
|
|
501
|
+
/** Enable and disables the row */
|
|
502
|
+
const toggleRow = (rowIdx, enabled) => {
|
|
503
|
+
const currentParams = formParams.value;
|
|
504
|
+
if (currentParams.length > rowIdx) {
|
|
505
|
+
const updatedParams = [...currentParams];
|
|
506
|
+
if (updatedParams[rowIdx]) updatedParams[rowIdx].enabled = enabled;
|
|
507
|
+
requestExampleMutators.edit(__props.example.uid, "body.formData.value", updatedParams);
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
const updateRequestBody = (value) => requestExampleMutators.edit(__props.example.uid, "body.raw.value", value);
|
|
511
|
+
/** Take the select option and return bodyType with encoding and header */
|
|
512
|
+
const getBodyType = (type) => {
|
|
513
|
+
if (type === "multipartForm") return {
|
|
514
|
+
activeBody: "formData",
|
|
515
|
+
encoding: "form-data",
|
|
516
|
+
header: "multipart/form-data"
|
|
517
|
+
};
|
|
518
|
+
if (type === "formUrlEncoded") return {
|
|
519
|
+
activeBody: "formData",
|
|
520
|
+
encoding: "urlencoded",
|
|
521
|
+
header: "application/x-www-form-urlencoded"
|
|
522
|
+
};
|
|
523
|
+
if (type === "binaryFile") return {
|
|
524
|
+
activeBody: "binary",
|
|
525
|
+
encoding: void 0,
|
|
526
|
+
header: "application/octet-stream"
|
|
527
|
+
};
|
|
528
|
+
if (type === "json") return {
|
|
529
|
+
activeBody: "raw",
|
|
530
|
+
encoding: "json",
|
|
531
|
+
header: Object.keys(__props.operation.requestBody?.content ?? {}).find((t) => t.includes("json") || t.endsWith("+json")) || "application/json"
|
|
532
|
+
};
|
|
533
|
+
if (type === "xml") return {
|
|
534
|
+
activeBody: "raw",
|
|
535
|
+
encoding: "xml",
|
|
536
|
+
header: "application/xml"
|
|
537
|
+
};
|
|
538
|
+
if (type === "yaml") return {
|
|
539
|
+
activeBody: "raw",
|
|
540
|
+
encoding: "yaml",
|
|
541
|
+
header: "application/yaml"
|
|
542
|
+
};
|
|
543
|
+
if (type === "edn") return {
|
|
544
|
+
activeBody: "raw",
|
|
545
|
+
encoding: "edn",
|
|
546
|
+
header: "application/edn"
|
|
547
|
+
};
|
|
548
|
+
if (type === "other") {
|
|
549
|
+
const textContentType = Object.keys(__props.operation.requestBody?.content ?? {}).find((t) => t.startsWith("text/"));
|
|
550
|
+
return {
|
|
551
|
+
activeBody: "raw",
|
|
552
|
+
encoding: textContentType ? "text" : "html",
|
|
553
|
+
header: textContentType ?? "application/html"
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
return {
|
|
557
|
+
activeBody: "raw",
|
|
558
|
+
encoding: void 0,
|
|
559
|
+
header: void 0
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
/** Set active body AND encoding */
|
|
563
|
+
const updateActiveBody = (type) => {
|
|
564
|
+
const { activeBody, encoding, header } = getBodyType(type);
|
|
565
|
+
requestExampleMutators.edit(__props.example.uid, "body.activeBody", activeBody);
|
|
566
|
+
if (encoding && activeBody === "raw") requestExampleMutators.edit(__props.example.uid, "body.raw", {
|
|
567
|
+
encoding,
|
|
568
|
+
value: __props.example.body.raw?.value ?? ""
|
|
569
|
+
});
|
|
570
|
+
else if (encoding && activeBody === "formData") requestExampleMutators.edit(__props.example.uid, "body.formData", {
|
|
571
|
+
encoding,
|
|
572
|
+
value: __props.example.body.formData?.value ?? []
|
|
573
|
+
});
|
|
574
|
+
else if (!encoding && activeBody !== "binary") {
|
|
575
|
+
const { raw: deleteMe, ...body } = __props.example.body;
|
|
576
|
+
requestExampleMutators.edit(__props.example.uid, "body", body);
|
|
577
|
+
}
|
|
578
|
+
const headers = [...__props.example.parameters.headers];
|
|
579
|
+
const contentTypeIdx = headers.findIndex((h) => h.key.toLowerCase() === "content-type");
|
|
580
|
+
if (contentTypeIdx >= 0) {
|
|
581
|
+
if (header && headers[contentTypeIdx]) headers[contentTypeIdx].value = header;
|
|
582
|
+
else if (headers[contentTypeIdx] && (activeBody !== "raw" || type === "none")) headers.splice(contentTypeIdx, 1);
|
|
583
|
+
} else if (header) {
|
|
584
|
+
const lastHeader = headers[headers.length - 1];
|
|
585
|
+
if (lastHeader && lastHeader.key === "" && lastHeader.value === "") headers.splice(headers.length - 1, 0, {
|
|
586
|
+
key: "Content-Type",
|
|
587
|
+
value: header,
|
|
588
|
+
enabled: true
|
|
589
|
+
});
|
|
590
|
+
else headers.push({
|
|
591
|
+
key: "Content-Type",
|
|
592
|
+
value: header,
|
|
593
|
+
enabled: true
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
requestExampleMutators.edit(__props.example.uid, "parameters.headers", headers);
|
|
597
|
+
};
|
|
598
|
+
const handleFileUploadFormData = (rowIdx) => {
|
|
599
|
+
const { open } = useFileDialog({
|
|
600
|
+
onChange: (files) => {
|
|
601
|
+
const file = files?.[0];
|
|
602
|
+
if (file) {
|
|
603
|
+
const updatedParams = [...formParams.value];
|
|
604
|
+
updatedParams[rowIdx] = {
|
|
605
|
+
...updatedParams[rowIdx],
|
|
606
|
+
file,
|
|
607
|
+
value: updatedParams[rowIdx]?.value || file.name,
|
|
608
|
+
key: updatedParams[rowIdx]?.key || file.name,
|
|
609
|
+
enabled: true
|
|
610
|
+
};
|
|
611
|
+
requestExampleMutators.edit(__props.example.uid, "body.formData.value", updatedParams);
|
|
612
|
+
defaultRow();
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
multiple: false,
|
|
616
|
+
accept: "*/*"
|
|
617
|
+
});
|
|
618
|
+
open();
|
|
619
|
+
};
|
|
620
|
+
const removeBinaryFile = () => requestExampleMutators.edit(__props.example.uid, "body.binary", void 0);
|
|
621
|
+
function handleRemoveFileFormData(rowIdx) {
|
|
622
|
+
const currentParams = formParams.value;
|
|
623
|
+
const updatedParams = [...currentParams];
|
|
624
|
+
const param = currentParams[rowIdx];
|
|
625
|
+
const file = param?.file;
|
|
626
|
+
if (currentParams.length > 1 && (!param?.key && !param?.value || file && param?.key === file.name && param?.value === file.name)) updatedParams.splice(rowIdx, 1);
|
|
627
|
+
else if (updatedParams[rowIdx]) updatedParams[rowIdx].file = void 0;
|
|
628
|
+
requestExampleMutators.edit(__props.example.uid, "body.formData.value", updatedParams);
|
|
629
|
+
}
|
|
630
|
+
function handleFileUpload() {
|
|
631
|
+
const { open } = useFileDialog({
|
|
632
|
+
onChange: (files) => {
|
|
633
|
+
const file = files?.[0];
|
|
634
|
+
if (file) requestExampleMutators.edit(__props.example.uid, "body.binary", file);
|
|
635
|
+
},
|
|
636
|
+
multiple: false,
|
|
637
|
+
accept: "*/*"
|
|
638
|
+
});
|
|
639
|
+
open();
|
|
640
|
+
}
|
|
641
|
+
watch(selectedContentType, (val) => {
|
|
642
|
+
if (["multipartForm", "formUrlEncoded"].includes(val?.id || "")) defaultRow();
|
|
643
|
+
}, { immediate: true });
|
|
644
|
+
watch(() => __props.example.uid, () => {
|
|
645
|
+
__props.operation.method && canMethodHaveBody(__props.operation.method) && updateActiveBody(activeExampleContentType.value);
|
|
646
|
+
if (["multipartForm", "formUrlEncoded"].includes(activeExampleContentType.value)) defaultRow();
|
|
647
|
+
}, { immediate: true });
|
|
648
|
+
const exampleOptions = computed(() => {
|
|
649
|
+
const contentType = selectedContentType.value?.id;
|
|
650
|
+
const { header } = getBodyType(contentType);
|
|
651
|
+
const content = __props.operation.requestBody?.content || {};
|
|
652
|
+
const examples = header ? content[header]?.examples || {} : {};
|
|
653
|
+
return Object.entries(examples).map(([key, value]) => ({
|
|
654
|
+
id: key,
|
|
655
|
+
label: key,
|
|
656
|
+
value
|
|
657
|
+
}));
|
|
658
|
+
});
|
|
659
|
+
const selectedExample = computed({
|
|
660
|
+
get: () => {
|
|
661
|
+
const rawValue = __props.example.body.raw?.value ?? "{}";
|
|
662
|
+
try {
|
|
663
|
+
const parsedValue = JSON.parse(rawValue);
|
|
664
|
+
return exampleOptions.value.find((e) => {
|
|
665
|
+
const exampleValue = e.value;
|
|
666
|
+
return JSON.stringify(exampleValue.value) === JSON.stringify(parsedValue);
|
|
667
|
+
}) ?? exampleOptions.value[0];
|
|
668
|
+
} catch {
|
|
669
|
+
return exampleOptions.value[0];
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
set: (opt) => {
|
|
673
|
+
if (opt?.id) {
|
|
674
|
+
const exampleOption = exampleOptions.value.find((e) => e.id === opt.id);
|
|
675
|
+
if (exampleOption) {
|
|
676
|
+
const exampleValue = exampleOption.value;
|
|
677
|
+
updateRequestBody(JSON.stringify(exampleValue.value, null, 2));
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
return (_ctx, _cache) => {
|
|
683
|
+
return openBlock(), createBlock(ViewLayoutCollapse_default, null, {
|
|
684
|
+
title: withCtx(() => [createTextVNode(toDisplayString(__props.title), 1)]),
|
|
685
|
+
default: withCtx(() => [createVNode(DataTable_default, {
|
|
686
|
+
columns: [""],
|
|
687
|
+
presentational: ""
|
|
688
|
+
}, {
|
|
689
|
+
default: withCtx(() => [
|
|
690
|
+
createVNode(DataTableRow_default, null, {
|
|
691
|
+
default: withCtx(() => [createVNode(DataTableHeader_default, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
|
|
692
|
+
default: withCtx(() => [createVNode(unref(ScalarListbox), {
|
|
693
|
+
modelValue: selectedContentType.value,
|
|
694
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedContentType.value = $event),
|
|
695
|
+
options: unref(contentTypeOptions),
|
|
696
|
+
teleport: ""
|
|
697
|
+
}, {
|
|
698
|
+
default: withCtx(() => [createVNode(unref(ScalarButton), {
|
|
699
|
+
class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-3 font-normal",
|
|
700
|
+
variant: "ghost"
|
|
701
|
+
}, {
|
|
702
|
+
default: withCtx(() => [createElementVNode("span", null, toDisplayString(selectedContentType.value?.label), 1), createVNode(unref(ScalarIcon), {
|
|
703
|
+
icon: "ChevronDown",
|
|
704
|
+
size: "md"
|
|
705
|
+
})]),
|
|
706
|
+
_: 1
|
|
707
|
+
})]),
|
|
708
|
+
_: 1
|
|
709
|
+
}, 8, ["modelValue", "options"]), exampleOptions.value.length > 0 ? (openBlock(), createBlock(unref(ScalarListbox), {
|
|
710
|
+
key: 0,
|
|
711
|
+
modelValue: selectedExample.value,
|
|
712
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedExample.value = $event),
|
|
713
|
+
options: exampleOptions.value,
|
|
714
|
+
side: "left",
|
|
715
|
+
teleport: ""
|
|
716
|
+
}, {
|
|
717
|
+
default: withCtx(() => [createVNode(unref(ScalarButton), {
|
|
718
|
+
class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-2 font-normal",
|
|
719
|
+
fullWidth: "",
|
|
720
|
+
variant: "ghost"
|
|
721
|
+
}, {
|
|
722
|
+
default: withCtx(() => [createElementVNode("span", null, toDisplayString(selectedExample.value?.label), 1), createVNode(unref(ScalarIcon), {
|
|
723
|
+
icon: "ChevronDown",
|
|
724
|
+
size: "md"
|
|
725
|
+
})]),
|
|
726
|
+
_: 1
|
|
727
|
+
})]),
|
|
728
|
+
_: 1
|
|
729
|
+
}, 8, ["modelValue", "options"])) : createCommentVNode("", true)]),
|
|
730
|
+
_: 1
|
|
731
|
+
})]),
|
|
732
|
+
_: 1
|
|
733
|
+
}),
|
|
734
|
+
createVNode(DataTableRow_default, null, {
|
|
735
|
+
default: withCtx(() => [selectedContentType.value?.id === "none" ? (openBlock(), createElementBlock("div", _hoisted_1$3, [..._cache[2] || (_cache[2] = [createElementVNode("span", null, "No Body", -1)])])) : selectedContentType.value?.id === "binaryFile" ? (openBlock(), createElementBlock("div", _hoisted_2$3, [__props.example.body.binary ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_3$2, toDisplayString(__props.example.body.binary.name), 1), createVNode(unref(ScalarButton), {
|
|
736
|
+
class: "bg-b-2 hover:bg-b-3 text-c-2 ml-1 border-0 shadow-none",
|
|
737
|
+
size: "sm",
|
|
738
|
+
variant: "outlined",
|
|
739
|
+
onClick: removeBinaryFile
|
|
740
|
+
}, {
|
|
741
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode(" Delete ", -1)])]),
|
|
742
|
+
_: 1
|
|
743
|
+
})], 64)) : (openBlock(), createBlock(unref(ScalarButton), {
|
|
744
|
+
key: 1,
|
|
745
|
+
class: "bg-b-2 hover:bg-b-3 text-c-2 border-0 shadow-none",
|
|
746
|
+
size: "sm",
|
|
747
|
+
variant: "outlined",
|
|
748
|
+
onClick: handleFileUpload
|
|
749
|
+
}, {
|
|
750
|
+
default: withCtx(() => [_cache[4] || (_cache[4] = createElementVNode("span", null, "Upload File", -1)), createVNode(unref(ScalarIcon), {
|
|
751
|
+
class: "ml-1",
|
|
752
|
+
icon: "Upload",
|
|
753
|
+
size: "xs",
|
|
754
|
+
thickness: "2.5"
|
|
755
|
+
})]),
|
|
756
|
+
_: 1
|
|
757
|
+
}))])) : selectedContentType.value?.id == "multipartForm" ? (openBlock(), createBlock(RequestTable_default, {
|
|
758
|
+
key: 2,
|
|
759
|
+
ref_key: "tableWrapperRef",
|
|
760
|
+
ref: tableWrapperRef,
|
|
761
|
+
class: "!m-0 rounded-t-none border-t-0 border-r-0 border-b-0 border-l-0 shadow-none",
|
|
762
|
+
columns: [
|
|
763
|
+
"32px",
|
|
764
|
+
"",
|
|
765
|
+
"",
|
|
766
|
+
"104px"
|
|
767
|
+
],
|
|
768
|
+
envVariables: __props.envVariables,
|
|
769
|
+
environment: __props.environment,
|
|
770
|
+
items: formParams.value,
|
|
771
|
+
showUploadButton: "",
|
|
772
|
+
workspace: __props.workspace,
|
|
773
|
+
onDeleteRow: deleteRow,
|
|
774
|
+
onRemoveFile: handleRemoveFileFormData,
|
|
775
|
+
onToggleRow: toggleRow,
|
|
776
|
+
onUpdateRow: updateRow,
|
|
777
|
+
onUploadFile: handleFileUploadFormData
|
|
778
|
+
}, null, 8, [
|
|
779
|
+
"envVariables",
|
|
780
|
+
"environment",
|
|
781
|
+
"items",
|
|
782
|
+
"workspace"
|
|
783
|
+
])) : selectedContentType.value?.id == "formUrlEncoded" ? (openBlock(), createBlock(RequestTable_default, {
|
|
784
|
+
key: 3,
|
|
785
|
+
ref_key: "tableWrapperRef",
|
|
786
|
+
ref: tableWrapperRef,
|
|
787
|
+
class: "!m-0 rounded-t-none border-t-0 border-r-0 border-b-0 border-l-0 shadow-none",
|
|
788
|
+
columns: [
|
|
789
|
+
"32px",
|
|
790
|
+
"",
|
|
791
|
+
"",
|
|
792
|
+
"104px"
|
|
793
|
+
],
|
|
794
|
+
envVariables: __props.envVariables,
|
|
795
|
+
environment: __props.environment,
|
|
796
|
+
items: formParams.value,
|
|
797
|
+
showUploadButton: "",
|
|
798
|
+
workspace: __props.workspace,
|
|
799
|
+
onDeleteRow: deleteRow,
|
|
800
|
+
onRemoveFile: handleRemoveFileFormData,
|
|
801
|
+
onToggleRow: toggleRow,
|
|
802
|
+
onUpdateRow: updateRow,
|
|
803
|
+
onUploadFile: handleFileUploadFormData
|
|
804
|
+
}, null, 8, [
|
|
805
|
+
"envVariables",
|
|
806
|
+
"environment",
|
|
807
|
+
"items",
|
|
808
|
+
"workspace"
|
|
809
|
+
])) : (openBlock(), createBlock(CodeInput_default, {
|
|
810
|
+
key: 4,
|
|
811
|
+
class: "border-t px-3",
|
|
812
|
+
content: "",
|
|
813
|
+
envVariables: __props.envVariables,
|
|
814
|
+
environment: __props.environment,
|
|
815
|
+
language: codeInputLanguage.value,
|
|
816
|
+
lineNumbers: "",
|
|
817
|
+
lint: "",
|
|
818
|
+
modelValue: __props.example.body?.raw?.value ?? "",
|
|
819
|
+
workspace: __props.workspace,
|
|
820
|
+
"onUpdate:modelValue": updateRequestBody
|
|
821
|
+
}, null, 8, [
|
|
822
|
+
"envVariables",
|
|
823
|
+
"environment",
|
|
824
|
+
"language",
|
|
825
|
+
"modelValue",
|
|
826
|
+
"workspace"
|
|
827
|
+
]))]),
|
|
828
|
+
_: 1
|
|
829
|
+
}),
|
|
830
|
+
createVNode(DataTableRow_default)
|
|
831
|
+
]),
|
|
832
|
+
_: 1
|
|
833
|
+
})]),
|
|
834
|
+
_: 1
|
|
835
|
+
});
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
}), [["__scopeId", "data-v-9aa4b63a"]]);
|
|
839
|
+
//#endregion
|
|
840
|
+
//#region src/views/Request/RequestSection/RequestParams.vue?vue&type=script&setup=true&lang.ts
|
|
841
|
+
var _hoisted_1$2 = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100" };
|
|
842
|
+
var _hoisted_2$2 = { class: "sr-only" };
|
|
843
|
+
//#endregion
|
|
844
|
+
//#region src/views/Request/RequestSection/RequestParams.vue
|
|
845
|
+
var RequestParams_default = /* @__PURE__ */ defineComponent({
|
|
846
|
+
__name: "RequestParams",
|
|
847
|
+
props: {
|
|
848
|
+
example: {},
|
|
849
|
+
environment: {},
|
|
850
|
+
envVariables: {},
|
|
851
|
+
workspace: {},
|
|
852
|
+
title: {},
|
|
853
|
+
label: {},
|
|
854
|
+
paramKey: {},
|
|
855
|
+
readOnlyEntries: { default: () => [] },
|
|
856
|
+
invalidParams: {}
|
|
857
|
+
},
|
|
858
|
+
setup(__props) {
|
|
859
|
+
const { requestExampleMutators } = useWorkspace();
|
|
860
|
+
const params = computed(() => __props.example.parameters[__props.paramKey] ?? []);
|
|
861
|
+
onMounted(() => {
|
|
862
|
+
nextTick(() => {
|
|
863
|
+
defaultRow();
|
|
864
|
+
});
|
|
865
|
+
});
|
|
866
|
+
/** Add a new row to a given parameter list */
|
|
867
|
+
const addRow = () => {
|
|
868
|
+
/** Create a new parameter instance with 'enabled' set to false */
|
|
869
|
+
const newParam = requestExampleParametersSchema.parse({ enabled: false });
|
|
870
|
+
const newParams = [...params.value, newParam];
|
|
871
|
+
requestExampleMutators.edit(__props.example.uid, `parameters.${__props.paramKey}`, newParams);
|
|
872
|
+
};
|
|
873
|
+
const tableWrapperRef = ref(null);
|
|
874
|
+
/** Update a field in a parameter row */
|
|
875
|
+
const updateRow = (rowIdx, field, value) => {
|
|
876
|
+
const currentParams = params.value;
|
|
877
|
+
if (currentParams.length > rowIdx) {
|
|
878
|
+
const updatedParams = [...currentParams];
|
|
879
|
+
if (!updatedParams[rowIdx]) return;
|
|
880
|
+
updatedParams[rowIdx] = {
|
|
881
|
+
...updatedParams[rowIdx],
|
|
882
|
+
[field]: value
|
|
883
|
+
};
|
|
884
|
+
/** enable row key or value is filled */
|
|
885
|
+
if (updatedParams[rowIdx].key !== "" || updatedParams[rowIdx].value !== "") updatedParams[rowIdx].enabled = true;
|
|
886
|
+
/** check key and value input state */
|
|
887
|
+
if (updatedParams[rowIdx].key === "" && updatedParams[rowIdx].value === "")
|
|
888
|
+
/** remove if empty */
|
|
889
|
+
updatedParams.splice(rowIdx, 1);
|
|
890
|
+
requestExampleMutators.edit(__props.example.uid, `parameters.${__props.paramKey}`, updatedParams);
|
|
891
|
+
} else {
|
|
892
|
+
/** if there is no row at the index, add a new one */
|
|
893
|
+
const payload = [requestExampleParametersSchema.parse({ [field]: value })];
|
|
894
|
+
requestExampleMutators.edit(__props.example.uid, `parameters.${__props.paramKey}`, payload);
|
|
895
|
+
/** focus the new row */
|
|
896
|
+
nextTick(() => {
|
|
897
|
+
if (!tableWrapperRef.value) return;
|
|
898
|
+
tableWrapperRef.value.querySelectorAll("input")[field === "key" ? 0 : 1]?.focus();
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
if (rowIdx === currentParams.length - 1) addRow();
|
|
902
|
+
};
|
|
903
|
+
/** Toggle a parameter row on or off */
|
|
904
|
+
const toggleRow = (rowIdx, enabled) => requestExampleMutators.edit(__props.example.uid, `parameters.${__props.paramKey}.${rowIdx}.enabled`, enabled);
|
|
905
|
+
const deleteAllRows = () => {
|
|
906
|
+
const exampleParams = params.value.filter((param) => param.required);
|
|
907
|
+
requestExampleMutators.edit(__props.example.uid, `parameters.${__props.paramKey}`, exampleParams);
|
|
908
|
+
/** ensure one empty row after deleting all rows */
|
|
909
|
+
nextTick(() => addRow());
|
|
910
|
+
};
|
|
911
|
+
const deleteRow = (rowIdx) => {
|
|
912
|
+
const currentParams = params.value;
|
|
913
|
+
if (currentParams.length > rowIdx) {
|
|
914
|
+
const updatedParams = [...currentParams];
|
|
915
|
+
updatedParams.splice(rowIdx, 1);
|
|
916
|
+
requestExampleMutators.edit(__props.example.uid, `parameters.${__props.paramKey}`, updatedParams);
|
|
917
|
+
}
|
|
918
|
+
};
|
|
919
|
+
function defaultRow() {
|
|
920
|
+
/** ensure one empty row by default */
|
|
921
|
+
if (params.value.length === 0) addRow();
|
|
922
|
+
else if (params.value.length >= 1) {
|
|
923
|
+
/** ensure we always have a trailing empty row */
|
|
924
|
+
const lastParam = params.value[params.value.length - 1];
|
|
925
|
+
if (lastParam && lastParam.key !== "" && lastParam.value !== "") addRow();
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
const itemCount = computed(() => params.value.filter((param) => param.key || param.value).length);
|
|
929
|
+
const showTooltip = computed(() => params.value.length > 1);
|
|
930
|
+
watch(() => __props.example, (newVal, oldVal) => {
|
|
931
|
+
if (newVal !== oldVal) defaultRow();
|
|
932
|
+
}, { immediate: true });
|
|
933
|
+
const hasReadOnlyEntries = computed(() => (__props.readOnlyEntries ?? []).length > 0);
|
|
934
|
+
return (_ctx, _cache) => {
|
|
935
|
+
return openBlock(), createBlock(ViewLayoutCollapse_default, {
|
|
936
|
+
class: "group/params",
|
|
937
|
+
itemCount: itemCount.value
|
|
938
|
+
}, {
|
|
939
|
+
title: withCtx(() => [createTextVNode(toDisplayString(__props.title), 1)]),
|
|
940
|
+
actions: withCtx(() => [createElementVNode("div", _hoisted_1$2, [showTooltip.value ? (openBlock(), createBlock(unref(ScalarTooltip), {
|
|
941
|
+
key: 0,
|
|
942
|
+
content: "Clear optional parameters",
|
|
943
|
+
placement: "left"
|
|
944
|
+
}, {
|
|
945
|
+
default: withCtx(() => [createVNode(unref(ScalarButton), {
|
|
946
|
+
class: "pr-0.75 pl-1 transition-none",
|
|
947
|
+
size: "sm",
|
|
948
|
+
variant: "ghost",
|
|
949
|
+
onClick: withModifiers(deleteAllRows, ["stop"])
|
|
950
|
+
}, {
|
|
951
|
+
default: withCtx(() => [_cache[0] || (_cache[0] = createTextVNode(" Clear ", -1)), createElementVNode("span", _hoisted_2$2, "All " + toDisplayString(__props.title), 1)]),
|
|
952
|
+
_: 1
|
|
953
|
+
})]),
|
|
954
|
+
_: 1
|
|
955
|
+
})) : createCommentVNode("", true)])]),
|
|
956
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
957
|
+
ref_key: "tableWrapperRef",
|
|
958
|
+
ref: tableWrapperRef
|
|
959
|
+
}, [hasReadOnlyEntries.value ? (openBlock(), createBlock(RequestTable_default, {
|
|
960
|
+
key: 0,
|
|
961
|
+
class: normalizeClass(["flex-1", { "bg-c-3/5": hasReadOnlyEntries.value }]),
|
|
962
|
+
columns: [
|
|
963
|
+
"32px",
|
|
964
|
+
"",
|
|
965
|
+
""
|
|
966
|
+
],
|
|
967
|
+
envVariables: __props.envVariables,
|
|
968
|
+
environment: __props.environment,
|
|
969
|
+
invalidParams: __props.invalidParams,
|
|
970
|
+
isGlobal: "",
|
|
971
|
+
isReadOnly: "",
|
|
972
|
+
items: __props.readOnlyEntries,
|
|
973
|
+
label: __props.label,
|
|
974
|
+
workspace: __props.workspace
|
|
975
|
+
}, null, 8, [
|
|
976
|
+
"class",
|
|
977
|
+
"envVariables",
|
|
978
|
+
"environment",
|
|
979
|
+
"invalidParams",
|
|
980
|
+
"items",
|
|
981
|
+
"label",
|
|
982
|
+
"workspace"
|
|
983
|
+
])) : createCommentVNode("", true), createVNode(RequestTable_default, {
|
|
984
|
+
class: "flex-1",
|
|
985
|
+
columns: [
|
|
986
|
+
"32px",
|
|
987
|
+
"",
|
|
988
|
+
""
|
|
989
|
+
],
|
|
990
|
+
envVariables: __props.envVariables,
|
|
991
|
+
environment: __props.environment,
|
|
992
|
+
invalidParams: __props.invalidParams,
|
|
993
|
+
items: params.value,
|
|
994
|
+
label: __props.label,
|
|
995
|
+
workspace: __props.workspace,
|
|
996
|
+
onToggleRow: toggleRow,
|
|
997
|
+
onUpdateRow: updateRow,
|
|
998
|
+
onDeleteRow: deleteRow
|
|
999
|
+
}, null, 8, [
|
|
1000
|
+
"envVariables",
|
|
1001
|
+
"environment",
|
|
1002
|
+
"invalidParams",
|
|
1003
|
+
"items",
|
|
1004
|
+
"label",
|
|
1005
|
+
"workspace"
|
|
1006
|
+
])], 512)]),
|
|
1007
|
+
_: 1
|
|
1008
|
+
}, 8, ["itemCount"]);
|
|
1009
|
+
};
|
|
1010
|
+
}
|
|
1011
|
+
});
|
|
1012
|
+
//#endregion
|
|
1013
|
+
//#region src/views/Request/RequestSection/RequestPathParams.vue
|
|
1014
|
+
var RequestPathParams_default = /* @__PURE__ */ defineComponent({
|
|
1015
|
+
__name: "RequestPathParams",
|
|
1016
|
+
props: {
|
|
1017
|
+
example: {},
|
|
1018
|
+
operation: {},
|
|
1019
|
+
paramKey: {},
|
|
1020
|
+
title: {},
|
|
1021
|
+
environment: {},
|
|
1022
|
+
envVariables: {},
|
|
1023
|
+
workspace: {},
|
|
1024
|
+
invalidParams: {}
|
|
1025
|
+
},
|
|
1026
|
+
setup(__props) {
|
|
1027
|
+
const { requestMutators, requestExampleMutators } = useWorkspace();
|
|
1028
|
+
const params = computed(() => __props.example.parameters[__props.paramKey].map((param) => ({
|
|
1029
|
+
...param,
|
|
1030
|
+
enum: param.enum
|
|
1031
|
+
})));
|
|
1032
|
+
/** Update a field in a parameter row */
|
|
1033
|
+
const updateRow = (rowIdx, field, value) => {
|
|
1034
|
+
const parameters = __props.example.parameters[__props.paramKey];
|
|
1035
|
+
const oldKey = parameters[rowIdx]?.key;
|
|
1036
|
+
if (!oldKey) return;
|
|
1037
|
+
/** Change variable in path as well */
|
|
1038
|
+
if (field === "key") {
|
|
1039
|
+
if (parameters[rowIdx]?.required)
|
|
1040
|
+
/** Prevent updating the key of a required item */
|
|
1041
|
+
return;
|
|
1042
|
+
if (!value) {
|
|
1043
|
+
/** Remove parameter if path params table key is empty */
|
|
1044
|
+
parameters.splice(rowIdx, 1);
|
|
1045
|
+
const regx = new RegExp(`/:${encodeURIComponent(oldKey)}(?=[/?#]|$)`, "g");
|
|
1046
|
+
const newPath = __props.operation.path.replace(regx, "");
|
|
1047
|
+
requestMutators.edit(__props.operation.uid, "path", newPath);
|
|
1048
|
+
} else {
|
|
1049
|
+
/** Update URL with path params table key */
|
|
1050
|
+
const encodedOldKey = encodeURIComponent(oldKey);
|
|
1051
|
+
const encodedNewKey = encodeURIComponent(value);
|
|
1052
|
+
const regx = new RegExp(`(?<=/):${encodedOldKey}(?=[/?#]|$)`, "g");
|
|
1053
|
+
const newPath = __props.operation.path.replace(regx, `:${encodedNewKey}`);
|
|
1054
|
+
requestMutators.edit(__props.operation.uid, "path", newPath);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
requestExampleMutators.edit(__props.example.uid, `parameters.${__props.paramKey}.${rowIdx}.${field}`, value);
|
|
1058
|
+
};
|
|
1059
|
+
const deleteRow = (rowIdx) => {
|
|
1060
|
+
const currentParams = params.value;
|
|
1061
|
+
if (currentParams.length > rowIdx) {
|
|
1062
|
+
const updatedParams = [...currentParams];
|
|
1063
|
+
updatedParams.splice(rowIdx, 1);
|
|
1064
|
+
requestExampleMutators.edit(__props.example.uid, `parameters.${__props.paramKey}`, updatedParams);
|
|
1065
|
+
}
|
|
1066
|
+
};
|
|
1067
|
+
const setPathVariable = (url) => {
|
|
1068
|
+
const pathVariables = url.match(REGEX.PATH)?.map((v) => v.slice(1, -1)) || [];
|
|
1069
|
+
const parameters = __props.example.parameters[__props.paramKey];
|
|
1070
|
+
const paramMap = new Map(parameters.map((param) => [param.key, param]));
|
|
1071
|
+
const updatedParameters = pathVariables.map((key) => paramMap.get(key) || {
|
|
1072
|
+
key,
|
|
1073
|
+
value: "",
|
|
1074
|
+
enabled: true
|
|
1075
|
+
});
|
|
1076
|
+
parameters.forEach((param) => {
|
|
1077
|
+
/** prevent removing required parameters or with a value */
|
|
1078
|
+
if (!pathVariables.includes(param.key) && (param.value || param.required)) updatedParameters.push(param);
|
|
1079
|
+
});
|
|
1080
|
+
parameters.splice(0, parameters.length, ...updatedParameters);
|
|
1081
|
+
requestExampleMutators.edit(__props.example.uid, `parameters.${__props.paramKey}`, parameters);
|
|
1082
|
+
};
|
|
1083
|
+
const handlePathVariableUpdate = (url) => {
|
|
1084
|
+
if (url) setPathVariable(url);
|
|
1085
|
+
};
|
|
1086
|
+
watch(() => __props.operation.path, (newURL) => {
|
|
1087
|
+
if (newURL) handlePathVariableUpdate(newURL);
|
|
1088
|
+
});
|
|
1089
|
+
return (_ctx, _cache) => {
|
|
1090
|
+
return openBlock(), createBlock(ViewLayoutCollapse_default, { itemCount: params.value.length }, {
|
|
1091
|
+
title: withCtx(() => [createTextVNode(toDisplayString(__props.title), 1)]),
|
|
1092
|
+
default: withCtx(() => [params.value.length ? (openBlock(), createBlock(RequestTable_default, {
|
|
1093
|
+
key: 0,
|
|
1094
|
+
class: "flex-1",
|
|
1095
|
+
columns: [
|
|
1096
|
+
"32px",
|
|
1097
|
+
"",
|
|
1098
|
+
""
|
|
1099
|
+
],
|
|
1100
|
+
envVariables: __props.envVariables,
|
|
1101
|
+
environment: __props.environment,
|
|
1102
|
+
invalidParams: __props.invalidParams,
|
|
1103
|
+
items: params.value,
|
|
1104
|
+
workspace: __props.workspace,
|
|
1105
|
+
onUpdateRow: updateRow,
|
|
1106
|
+
onDeleteRow: deleteRow
|
|
1107
|
+
}, null, 8, [
|
|
1108
|
+
"envVariables",
|
|
1109
|
+
"environment",
|
|
1110
|
+
"invalidParams",
|
|
1111
|
+
"items",
|
|
1112
|
+
"workspace"
|
|
1113
|
+
])) : createCommentVNode("", true)]),
|
|
1114
|
+
_: 1
|
|
1115
|
+
}, 8, ["itemCount"]);
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
});
|
|
1119
|
+
//#endregion
|
|
1120
|
+
//#region src/views/Request/RequestSection/RequestCodeExample.vue?vue&type=script&setup=true&lang.ts
|
|
1121
|
+
var _hoisted_1$1 = { class: "w-full" };
|
|
1122
|
+
var _hoisted_2$1 = { class: "flex flex-1" };
|
|
1123
|
+
var _hoisted_3$1 = { class: "bg-b-1 flex items-center justify-center overflow-hidden border-t" };
|
|
1124
|
+
//#endregion
|
|
1125
|
+
//#region src/views/Request/RequestSection/RequestCodeExample.vue
|
|
1126
|
+
var RequestCodeExample_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1127
|
+
__name: "RequestCodeExample",
|
|
1128
|
+
props: {
|
|
1129
|
+
collection: {},
|
|
1130
|
+
example: {},
|
|
1131
|
+
operation: {},
|
|
1132
|
+
server: {},
|
|
1133
|
+
workspace: {},
|
|
1134
|
+
environment: {}
|
|
1135
|
+
},
|
|
1136
|
+
setup(__props) {
|
|
1137
|
+
const { securitySchemes, workspaceMutators } = useWorkspace();
|
|
1138
|
+
const localSelectedClient = computed(() => {
|
|
1139
|
+
if (localSelectedClientState.value.targetKey === "custom") {
|
|
1140
|
+
if (codeSamples.value?.some((sample) => sample.lang === localSelectedClientState.value.clientKey)) return localSelectedClientState.value;
|
|
1141
|
+
}
|
|
1142
|
+
return {
|
|
1143
|
+
targetKey: __props.workspace.selectedHttpClient?.targetKey ?? "js",
|
|
1144
|
+
clientKey: __props.workspace.selectedHttpClient?.clientKey ?? "fetch"
|
|
1145
|
+
};
|
|
1146
|
+
});
|
|
1147
|
+
const codeSamples = computed(() => __props.operation["x-codeSamples"] || __props.operation["x-code-samples"] || __props.operation["x-custom-examples"]);
|
|
1148
|
+
const localSelectedClientState = ref(codeSamples.value?.length ? {
|
|
1149
|
+
targetKey: "custom",
|
|
1150
|
+
clientKey: codeSamples.value[0]?.lang
|
|
1151
|
+
} : {
|
|
1152
|
+
targetKey: __props.workspace.selectedHttpClient?.targetKey ?? "js",
|
|
1153
|
+
clientKey: __props.workspace.selectedHttpClient?.clientKey ?? "fetch"
|
|
1154
|
+
});
|
|
1155
|
+
/**
|
|
1156
|
+
* Returns selected security schemes for the request
|
|
1157
|
+
*/
|
|
1158
|
+
const selectedSecuritySchemes = computed(() => {
|
|
1159
|
+
return (__props.operation.selectedSecuritySchemeUids || __props.collection.selectedSecuritySchemeUids || []).flat().map((uid) => securitySchemes[uid]).filter((scheme) => Boolean(scheme));
|
|
1160
|
+
});
|
|
1161
|
+
/**
|
|
1162
|
+
* Group plugins by target/language to show in a dropdown, also build a dictionary in the same loop
|
|
1163
|
+
**/
|
|
1164
|
+
const snippets = computed(() => {
|
|
1165
|
+
const dict = {};
|
|
1166
|
+
const builtInOptions = snippetz().clients().map((group) => ({
|
|
1167
|
+
label: group.title,
|
|
1168
|
+
options: group.clients.map((plugin) => {
|
|
1169
|
+
dict[`${group.key},${plugin.client}`] = plugin.title;
|
|
1170
|
+
return {
|
|
1171
|
+
id: `${group.key},${plugin.client}`,
|
|
1172
|
+
label: plugin.title
|
|
1173
|
+
};
|
|
1174
|
+
})
|
|
1175
|
+
}));
|
|
1176
|
+
const customExamples = (__props.operation["x-codeSamples"] || __props.operation["x-code-samples"] || __props.operation["x-custom-examples"] || []).map((sample) => ({
|
|
1177
|
+
id: `custom,${sample.lang}`,
|
|
1178
|
+
label: sample.label || sample.lang
|
|
1179
|
+
}));
|
|
1180
|
+
const options = customExamples.length > 0 ? [{
|
|
1181
|
+
id: "customExamples",
|
|
1182
|
+
label: "Code Examples",
|
|
1183
|
+
options: customExamples.map((customExample) => ({
|
|
1184
|
+
id: customExample.id,
|
|
1185
|
+
label: customExample.label ?? customExample.id
|
|
1186
|
+
}))
|
|
1187
|
+
}, ...builtInOptions] : builtInOptions;
|
|
1188
|
+
customExamples.forEach((sample) => {
|
|
1189
|
+
dict[sample.id] = sample.label ?? sample.id;
|
|
1190
|
+
});
|
|
1191
|
+
return {
|
|
1192
|
+
options,
|
|
1193
|
+
dict
|
|
1194
|
+
};
|
|
1195
|
+
});
|
|
1196
|
+
/** The currently selected plugin */
|
|
1197
|
+
const selectedPlugin = computed(() => {
|
|
1198
|
+
const client = localSelectedClient.value;
|
|
1199
|
+
if (client.targetKey === "custom") {
|
|
1200
|
+
const id = `custom,${client.clientKey}`;
|
|
1201
|
+
return {
|
|
1202
|
+
id,
|
|
1203
|
+
label: snippets.value.dict[id] ?? "Unknown"
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
const id = `${client.targetKey},${client.clientKey}`;
|
|
1207
|
+
return {
|
|
1208
|
+
id,
|
|
1209
|
+
label: snippets.value.dict[id] ?? "Unknown"
|
|
1210
|
+
};
|
|
1211
|
+
});
|
|
1212
|
+
/** The currently selected target */
|
|
1213
|
+
const selectedTarget = computed(() => localSelectedClient.value.targetKey);
|
|
1214
|
+
/** The currently selected client */
|
|
1215
|
+
const selectedClient = computed(() => localSelectedClient.value.clientKey);
|
|
1216
|
+
/** Update the selection when a new client is picked */
|
|
1217
|
+
const selectClient = (value) => {
|
|
1218
|
+
if (!value) return;
|
|
1219
|
+
const { id } = value;
|
|
1220
|
+
const [target, client] = id.split(",");
|
|
1221
|
+
if (!target || !client) return;
|
|
1222
|
+
localSelectedClientState.value = {
|
|
1223
|
+
targetKey: target,
|
|
1224
|
+
clientKey: client
|
|
1225
|
+
};
|
|
1226
|
+
if (target !== "custom") workspaceMutators.edit(__props.workspace.uid, "selectedHttpClient", {
|
|
1227
|
+
targetKey: target,
|
|
1228
|
+
clientKey: client
|
|
1229
|
+
});
|
|
1230
|
+
};
|
|
1231
|
+
/** Get the code sample content for a custom example */
|
|
1232
|
+
const customCodeContent = computed(() => {
|
|
1233
|
+
if (!selectedPlugin.value.id.startsWith("custom,")) return;
|
|
1234
|
+
const lang = selectedPlugin.value.id.split(",")[1];
|
|
1235
|
+
return (codeSamples.value?.find((s) => s.lang === lang))?.source;
|
|
1236
|
+
});
|
|
1237
|
+
return (_ctx, _cache) => {
|
|
1238
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [createVNode(ViewLayoutCollapse_default, {
|
|
1239
|
+
class: "group/preview w-full border-b-0",
|
|
1240
|
+
defaultOpen: false
|
|
1241
|
+
}, {
|
|
1242
|
+
title: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("Code Snippet", -1)])]),
|
|
1243
|
+
actions: withCtx(() => [createElementVNode("div", _hoisted_2$1, [createVNode(unref(ScalarCombobox), {
|
|
1244
|
+
modelValue: selectedPlugin.value,
|
|
1245
|
+
options: snippets.value.options,
|
|
1246
|
+
placement: "bottom-end",
|
|
1247
|
+
"onUpdate:modelValue": selectClient
|
|
1248
|
+
}, {
|
|
1249
|
+
default: withCtx(() => [createVNode(unref(ScalarButton), {
|
|
1250
|
+
class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-1.25 py-0.75 font-normal",
|
|
1251
|
+
variant: "ghost"
|
|
1252
|
+
}, {
|
|
1253
|
+
default: withCtx(() => [createElementVNode("span", null, toDisplayString(selectedPlugin.value?.label), 1), createVNode(unref(ScalarIcon), {
|
|
1254
|
+
icon: "ChevronDown",
|
|
1255
|
+
size: "md"
|
|
1256
|
+
})]),
|
|
1257
|
+
_: 1
|
|
1258
|
+
})]),
|
|
1259
|
+
_: 1
|
|
1260
|
+
}, 8, ["modelValue", "options"])])]),
|
|
1261
|
+
default: withCtx(() => [createVNode(DataTable_default, {
|
|
1262
|
+
columns: [""],
|
|
1263
|
+
presentational: ""
|
|
1264
|
+
}, {
|
|
1265
|
+
default: withCtx(() => [createVNode(DataTableRow_default, null, {
|
|
1266
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_3$1, [customCodeContent.value ? (openBlock(), createBlock(unref(ScalarCodeBlock), {
|
|
1267
|
+
key: 0,
|
|
1268
|
+
content: customCodeContent.value,
|
|
1269
|
+
lang: selectedPlugin.value.id.split(",")[1] ?? "plaintext"
|
|
1270
|
+
}, null, 8, ["content", "lang"])) : (openBlock(), createBlock(unref(CodeSnippet_default), {
|
|
1271
|
+
key: 1,
|
|
1272
|
+
client: selectedClient.value,
|
|
1273
|
+
example: __props.example,
|
|
1274
|
+
operation: __props.operation,
|
|
1275
|
+
securitySchemes: selectedSecuritySchemes.value,
|
|
1276
|
+
server: __props.server,
|
|
1277
|
+
target: selectedTarget.value,
|
|
1278
|
+
environment: __props.environment
|
|
1279
|
+
}, null, 8, [
|
|
1280
|
+
"client",
|
|
1281
|
+
"example",
|
|
1282
|
+
"operation",
|
|
1283
|
+
"securitySchemes",
|
|
1284
|
+
"server",
|
|
1285
|
+
"target",
|
|
1286
|
+
"environment"
|
|
1287
|
+
]))])]),
|
|
1288
|
+
_: 1
|
|
1289
|
+
})]),
|
|
1290
|
+
_: 1
|
|
1291
|
+
})]),
|
|
1292
|
+
_: 1
|
|
1293
|
+
})]);
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
}), [["__scopeId", "data-v-2891f052"]]);
|
|
1297
|
+
//#endregion
|
|
1298
|
+
//#region src/views/Request/RequestSection/RequestSection.vue?vue&type=script&setup=true&lang.ts
|
|
1299
|
+
var _hoisted_1 = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24" };
|
|
1300
|
+
var _hoisted_2 = ["for"];
|
|
1301
|
+
var _hoisted_3 = [
|
|
1302
|
+
"id",
|
|
1303
|
+
"placeholder",
|
|
1304
|
+
"value"
|
|
1305
|
+
];
|
|
1306
|
+
var _hoisted_4 = {
|
|
1307
|
+
key: 2,
|
|
1308
|
+
class: "text-c-1 flex h-8 items-center"
|
|
1309
|
+
};
|
|
1310
|
+
var _hoisted_5 = ["id", "role"];
|
|
1311
|
+
//#endregion
|
|
1312
|
+
//#region src/views/Request/RequestSection/RequestSection.vue
|
|
1313
|
+
var RequestSection_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1314
|
+
__name: "RequestSection",
|
|
1315
|
+
props: {
|
|
1316
|
+
collection: {},
|
|
1317
|
+
environment: {},
|
|
1318
|
+
envVariables: {},
|
|
1319
|
+
example: {},
|
|
1320
|
+
invalidParams: {},
|
|
1321
|
+
operation: {},
|
|
1322
|
+
selectedSecuritySchemeUids: {},
|
|
1323
|
+
server: {},
|
|
1324
|
+
workspace: {}
|
|
1325
|
+
},
|
|
1326
|
+
setup(__props) {
|
|
1327
|
+
const requestSections = [
|
|
1328
|
+
"Auth",
|
|
1329
|
+
"Path Parameters",
|
|
1330
|
+
"Cookies",
|
|
1331
|
+
"Headers",
|
|
1332
|
+
"Query",
|
|
1333
|
+
"Body"
|
|
1334
|
+
];
|
|
1335
|
+
const { requestMutators, cookies, securitySchemes } = useWorkspace();
|
|
1336
|
+
const { layout } = useLayout();
|
|
1337
|
+
const filters = computed(() => {
|
|
1338
|
+
const allSections = new Set(["All", ...requestSections]);
|
|
1339
|
+
if (!__props.example.parameters.path.length) allSections.delete("Path Parameters");
|
|
1340
|
+
if (!canMethodHaveBody(__props.operation.method ?? "get")) allSections.delete("Body");
|
|
1341
|
+
if (isAuthHidden.value) allSections.delete("Auth");
|
|
1342
|
+
return [...allSections];
|
|
1343
|
+
});
|
|
1344
|
+
/** A list of section ids */
|
|
1345
|
+
const filterIds = computed(() => Object.fromEntries(filters.value.map((section) => [section, useId()])));
|
|
1346
|
+
const isAuthHidden = computed(() => layout === "modal" && !__props.operation.security && !Object.keys(securitySchemes ?? {}).length);
|
|
1347
|
+
const selectedFilter = ref("All");
|
|
1348
|
+
watch(() => __props.operation, (newOperation) => {
|
|
1349
|
+
if (selectedFilter.value === "Body" && newOperation && !canMethodHaveBody(newOperation.method)) selectedFilter.value = "All";
|
|
1350
|
+
});
|
|
1351
|
+
const updateRequestNameHandler = (event) => {
|
|
1352
|
+
const target = event.target;
|
|
1353
|
+
requestMutators.edit(__props.operation.uid, "summary", target.value);
|
|
1354
|
+
};
|
|
1355
|
+
/**
|
|
1356
|
+
* Add the global cookies as static entries to the cookies section
|
|
1357
|
+
*/
|
|
1358
|
+
const activeWorkspaceCookies = computed(() => (__props.workspace.cookies ?? []).map((uid) => cookies[uid]).filter(isDefined).filter((cookie) => cookie.name).filter((cookie) => matchesDomain(__props.server?.url || __props.operation.path, cookie.domain)).map((cookie) => ({
|
|
1359
|
+
key: cookie.name,
|
|
1360
|
+
value: cookie.value,
|
|
1361
|
+
route: {
|
|
1362
|
+
name: "cookies",
|
|
1363
|
+
params: { cookies: cookie.uid }
|
|
1364
|
+
},
|
|
1365
|
+
enabled: true
|
|
1366
|
+
})));
|
|
1367
|
+
const handleRequestNamePlaceholder = () => {
|
|
1368
|
+
return __props.operation.summary ? __props.operation.summary : __props.operation.path.replace(REGEX.PROTOCOL, "") ? __props.operation.path.replace(REGEX.PROTOCOL, "") : "Request Name";
|
|
1369
|
+
};
|
|
1370
|
+
const labelRequestNameId = useId();
|
|
1371
|
+
const requestSectionViews = usePluginManager().getViewComponents("request.section");
|
|
1372
|
+
const updateOperationHandler = (key, value) => requestMutators.edit(__props.operation.uid, key, value);
|
|
1373
|
+
watch(() => isAuthHidden.value, (authHidden) => {
|
|
1374
|
+
if (authHidden && selectedFilter.value === "Auth") selectedFilter.value = "All";
|
|
1375
|
+
});
|
|
1376
|
+
return (_ctx, _cache) => {
|
|
1377
|
+
return openBlock(), createBlock(ViewLayoutSection_default, { "aria-label": `Request: ${__props.operation.summary}` }, {
|
|
1378
|
+
title: withCtx(() => [createElementVNode("div", _hoisted_1, [unref(layout) !== "modal" ? (openBlock(), createElementBlock("label", {
|
|
1379
|
+
key: 0,
|
|
1380
|
+
class: "pointer-events-auto absolute top-0 left-0 h-full w-full cursor-text opacity-0",
|
|
1381
|
+
for: unref(labelRequestNameId)
|
|
1382
|
+
}, null, 8, _hoisted_2)) : createCommentVNode("", true), unref(layout) !== "modal" ? (openBlock(), createElementBlock("input", {
|
|
1383
|
+
key: 1,
|
|
1384
|
+
id: unref(labelRequestNameId),
|
|
1385
|
+
class: "text-c-1 group-hover-input pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded pl-1.25 has-[:focus-visible]:outline md:-ml-1.25",
|
|
1386
|
+
placeholder: handleRequestNamePlaceholder(),
|
|
1387
|
+
value: __props.operation.summary,
|
|
1388
|
+
onInput: updateRequestNameHandler
|
|
1389
|
+
}, null, 40, _hoisted_3)) : (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(__props.operation.summary), 1))]), createVNode(SectionFilter_default, {
|
|
1390
|
+
modelValue: selectedFilter.value,
|
|
1391
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedFilter.value = $event),
|
|
1392
|
+
filterIds: filterIds.value,
|
|
1393
|
+
filters: filters.value
|
|
1394
|
+
}, null, 8, [
|
|
1395
|
+
"modelValue",
|
|
1396
|
+
"filterIds",
|
|
1397
|
+
"filters"
|
|
1398
|
+
])]),
|
|
1399
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
1400
|
+
id: filterIds.value.All,
|
|
1401
|
+
class: "request-section-content custom-scroll relative flex flex-1 flex-col",
|
|
1402
|
+
role: selectedFilter.value === "All" ? "tabpanel" : "none"
|
|
1403
|
+
}, [
|
|
1404
|
+
__props.collection && __props.workspace && (unref(layout) !== "modal" || Object.keys(unref(securitySchemes) ?? {}).length) ? withDirectives((openBlock(), createBlock(RequestAuth_default, {
|
|
1405
|
+
key: 0,
|
|
1406
|
+
id: filterIds.value.Auth,
|
|
1407
|
+
class: "request-section-content-auth",
|
|
1408
|
+
collection: __props.collection,
|
|
1409
|
+
envVariables: __props.envVariables,
|
|
1410
|
+
environment: __props.environment,
|
|
1411
|
+
isReadOnly: unref(layout) === "modal",
|
|
1412
|
+
layout: "client",
|
|
1413
|
+
operation: __props.operation,
|
|
1414
|
+
role: selectedFilter.value === "All" ? "none" : "tabpanel",
|
|
1415
|
+
selectedSecuritySchemeUids: __props.selectedSecuritySchemeUids,
|
|
1416
|
+
server: __props.server,
|
|
1417
|
+
title: "Authentication",
|
|
1418
|
+
workspace: __props.workspace
|
|
1419
|
+
}, null, 8, [
|
|
1420
|
+
"id",
|
|
1421
|
+
"collection",
|
|
1422
|
+
"envVariables",
|
|
1423
|
+
"environment",
|
|
1424
|
+
"isReadOnly",
|
|
1425
|
+
"operation",
|
|
1426
|
+
"role",
|
|
1427
|
+
"selectedSecuritySchemeUids",
|
|
1428
|
+
"server",
|
|
1429
|
+
"workspace"
|
|
1430
|
+
])), [[vShow, !isAuthHidden.value && (selectedFilter.value === "All" || selectedFilter.value === "Auth")]]) : createCommentVNode("", true),
|
|
1431
|
+
withDirectives(createVNode(RequestPathParams_default, {
|
|
1432
|
+
id: filterIds.value["Path Parameters"],
|
|
1433
|
+
class: "request-section-content-path-params",
|
|
1434
|
+
envVariables: __props.envVariables,
|
|
1435
|
+
environment: __props.environment,
|
|
1436
|
+
example: __props.example,
|
|
1437
|
+
invalidParams: __props.invalidParams,
|
|
1438
|
+
operation: __props.operation,
|
|
1439
|
+
paramKey: "path",
|
|
1440
|
+
role: selectedFilter.value === "All" ? "none" : "tabpanel",
|
|
1441
|
+
title: "Path Parameters",
|
|
1442
|
+
workspace: __props.workspace
|
|
1443
|
+
}, null, 8, [
|
|
1444
|
+
"id",
|
|
1445
|
+
"envVariables",
|
|
1446
|
+
"environment",
|
|
1447
|
+
"example",
|
|
1448
|
+
"invalidParams",
|
|
1449
|
+
"operation",
|
|
1450
|
+
"role",
|
|
1451
|
+
"workspace"
|
|
1452
|
+
]), [[vShow, (selectedFilter.value === "All" || selectedFilter.value === "Path Parameters") && __props.example.parameters.path.length]]),
|
|
1453
|
+
withDirectives(createVNode(RequestParams_default, {
|
|
1454
|
+
id: filterIds.value.Cookies,
|
|
1455
|
+
class: "request-section-content-cookies",
|
|
1456
|
+
envVariables: __props.envVariables,
|
|
1457
|
+
environment: __props.environment,
|
|
1458
|
+
example: __props.example,
|
|
1459
|
+
invalidParams: __props.invalidParams,
|
|
1460
|
+
label: "Cookie",
|
|
1461
|
+
operation: __props.operation,
|
|
1462
|
+
paramKey: "cookies",
|
|
1463
|
+
readOnlyEntries: activeWorkspaceCookies.value,
|
|
1464
|
+
role: selectedFilter.value === "All" ? "none" : "tabpanel",
|
|
1465
|
+
title: "Cookies",
|
|
1466
|
+
workspace: __props.workspace
|
|
1467
|
+
}, null, 8, [
|
|
1468
|
+
"id",
|
|
1469
|
+
"envVariables",
|
|
1470
|
+
"environment",
|
|
1471
|
+
"example",
|
|
1472
|
+
"invalidParams",
|
|
1473
|
+
"operation",
|
|
1474
|
+
"readOnlyEntries",
|
|
1475
|
+
"role",
|
|
1476
|
+
"workspace"
|
|
1477
|
+
]), [[vShow, selectedFilter.value === "All" || selectedFilter.value === "Cookies"]]),
|
|
1478
|
+
withDirectives(createVNode(RequestParams_default, {
|
|
1479
|
+
id: filterIds.value.Headers,
|
|
1480
|
+
class: "request-section-content-headers",
|
|
1481
|
+
envVariables: __props.envVariables,
|
|
1482
|
+
environment: __props.environment,
|
|
1483
|
+
example: __props.example,
|
|
1484
|
+
invalidParams: __props.invalidParams,
|
|
1485
|
+
label: "Header",
|
|
1486
|
+
operation: __props.operation,
|
|
1487
|
+
paramKey: "headers",
|
|
1488
|
+
role: selectedFilter.value === "All" ? "none" : "tabpanel",
|
|
1489
|
+
title: "Headers",
|
|
1490
|
+
workspace: __props.workspace
|
|
1491
|
+
}, null, 8, [
|
|
1492
|
+
"id",
|
|
1493
|
+
"envVariables",
|
|
1494
|
+
"environment",
|
|
1495
|
+
"example",
|
|
1496
|
+
"invalidParams",
|
|
1497
|
+
"operation",
|
|
1498
|
+
"role",
|
|
1499
|
+
"workspace"
|
|
1500
|
+
]), [[vShow, selectedFilter.value === "All" || selectedFilter.value === "Headers"]]),
|
|
1501
|
+
withDirectives(createVNode(RequestParams_default, {
|
|
1502
|
+
id: filterIds.value.Query,
|
|
1503
|
+
class: "request-section-content-query",
|
|
1504
|
+
envVariables: __props.envVariables,
|
|
1505
|
+
environment: __props.environment,
|
|
1506
|
+
example: __props.example,
|
|
1507
|
+
invalidParams: __props.invalidParams,
|
|
1508
|
+
label: "Parameter",
|
|
1509
|
+
operation: __props.operation,
|
|
1510
|
+
paramKey: "query",
|
|
1511
|
+
role: selectedFilter.value === "All" ? "none" : "tabpanel",
|
|
1512
|
+
title: "Query Parameters",
|
|
1513
|
+
workspace: __props.workspace
|
|
1514
|
+
}, null, 8, [
|
|
1515
|
+
"id",
|
|
1516
|
+
"envVariables",
|
|
1517
|
+
"environment",
|
|
1518
|
+
"example",
|
|
1519
|
+
"invalidParams",
|
|
1520
|
+
"operation",
|
|
1521
|
+
"role",
|
|
1522
|
+
"workspace"
|
|
1523
|
+
]), [[vShow, selectedFilter.value === "All" || selectedFilter.value === "Query"]]),
|
|
1524
|
+
__props.operation.method && (selectedFilter.value === "All" || selectedFilter.value === "Body") && unref(canMethodHaveBody)(__props.operation.method) ? (openBlock(), createBlock(RequestBody_default, {
|
|
1525
|
+
key: 1,
|
|
1526
|
+
id: filterIds.value.Body,
|
|
1527
|
+
class: "request-section-content-body",
|
|
1528
|
+
envVariables: __props.envVariables,
|
|
1529
|
+
environment: __props.environment,
|
|
1530
|
+
example: __props.example,
|
|
1531
|
+
operation: __props.operation,
|
|
1532
|
+
role: selectedFilter.value === "All" ? "none" : "tabpanel",
|
|
1533
|
+
title: "Body",
|
|
1534
|
+
workspace: __props.workspace
|
|
1535
|
+
}, null, 8, [
|
|
1536
|
+
"id",
|
|
1537
|
+
"envVariables",
|
|
1538
|
+
"environment",
|
|
1539
|
+
"example",
|
|
1540
|
+
"operation",
|
|
1541
|
+
"role",
|
|
1542
|
+
"workspace"
|
|
1543
|
+
])) : createCommentVNode("", true),
|
|
1544
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(requestSectionViews), (view, index) => {
|
|
1545
|
+
return openBlock(), createBlock(unref(ScalarErrorBoundary), { key: view.title ?? index }, {
|
|
1546
|
+
default: withCtx(() => [withDirectives((openBlock(), createBlock(resolveDynamicComponent(view.component), {
|
|
1547
|
+
operation: __props.operation,
|
|
1548
|
+
"onUpdate:operation": updateOperationHandler
|
|
1549
|
+
}, null, 40, ["operation"])), [[vShow, selectedFilter.value === "All" || selectedFilter.value === view.title]])]),
|
|
1550
|
+
_: 2
|
|
1551
|
+
}, 1024);
|
|
1552
|
+
}), 128)),
|
|
1553
|
+
_cache[1] || (_cache[1] = createElementVNode("div", { class: "flex flex-grow" }, null, -1)),
|
|
1554
|
+
createVNode(unref(ScalarErrorBoundary), null, {
|
|
1555
|
+
default: withCtx(() => [createVNode(RequestCodeExample_default, {
|
|
1556
|
+
class: "request-section-content-code-example -mt-1/2 border-t",
|
|
1557
|
+
collection: __props.collection,
|
|
1558
|
+
environment: __props.envVariables,
|
|
1559
|
+
example: __props.example,
|
|
1560
|
+
operation: __props.operation,
|
|
1561
|
+
server: __props.server,
|
|
1562
|
+
workspace: __props.workspace
|
|
1563
|
+
}, null, 8, [
|
|
1564
|
+
"collection",
|
|
1565
|
+
"environment",
|
|
1566
|
+
"example",
|
|
1567
|
+
"operation",
|
|
1568
|
+
"server",
|
|
1569
|
+
"workspace"
|
|
1570
|
+
])]),
|
|
1571
|
+
_: 1
|
|
1572
|
+
})
|
|
1573
|
+
], 8, _hoisted_5)]),
|
|
1574
|
+
_: 1
|
|
1575
|
+
}, 8, ["aria-label"]);
|
|
1576
|
+
};
|
|
1577
|
+
}
|
|
1578
|
+
}), [["__scopeId", "data-v-287f5ecf"]]);
|
|
1579
|
+
//#endregion
|
|
1580
|
+
export { RequestSection_default as t };
|
|
1581
|
+
|
|
1582
|
+
//# sourceMappingURL=RequestSection-Bx8UHW-k.js.map
|