@scalar/api-client 3.6.1 → 3.8.1
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 +157 -0
- package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
- package/dist/components/HttpMethod/index.js +2 -0
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.d.ts.map +1 -0
- package/dist/components/{ScalarAsciiArt.vue.js → ScalarAsciiArt/ScalarAsciiArt.vue.js} +3 -3
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js.map +1 -0
- package/dist/components/{ScalarAsciiArt.vue.script.js → ScalarAsciiArt/ScalarAsciiArt.vue.script.js} +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js.map +1 -0
- package/dist/components/ScalarAsciiArt/index.d.ts +2 -0
- package/dist/components/ScalarAsciiArt/index.d.ts.map +1 -0
- package/dist/components/ScalarAsciiArt/index.js +2 -0
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts +2 -2
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts +2 -2
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Sidebar/index.d.ts.map +1 -0
- package/dist/components/Sidebar/index.js +2 -0
- package/dist/components/ViewLayout/index.d.ts +4 -0
- package/dist/components/ViewLayout/index.d.ts.map +1 -0
- package/dist/components/ViewLayout/index.js +4 -0
- package/dist/plugins/posthog/index.d.ts.map +1 -1
- package/dist/plugins/posthog/index.js +21 -12
- package/dist/plugins/posthog/index.js.map +1 -1
- package/dist/plugins/posthog/sanitize-event-payload.d.ts +25 -0
- package/dist/plugins/posthog/sanitize-event-payload.d.ts.map +1 -0
- package/dist/plugins/posthog/sanitize-event-payload.js +136 -0
- package/dist/plugins/posthog/sanitize-event-payload.js.map +1 -0
- package/dist/style.css +214 -1651
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +72 -32
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +2 -2
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js +3 -3
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js +1 -1
- package/dist/v2/blocks/operation-block/index.d.ts +1 -0
- package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/index.js +2 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js +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/operation-to-har.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +15 -9
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js.map +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-body.js +9 -7
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js.map +1 -1
- package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -0
- package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/index.js +2 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +30 -17
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +43 -10
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +2 -2
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -2
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +4 -2
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js +4 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +2 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +42 -13
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts +14 -0
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +136 -0
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -0
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +12 -10
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.d.ts +2 -0
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js +17 -4
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.d.ts +3 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js +21 -9
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +2 -2
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js +2 -2
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js +1 -0
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/media-types.d.ts +1 -1
- package/dist/v2/blocks/response-block/helpers/media-types.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/helpers/media-types.js +14 -7
- package/dist/v2/blocks/response-block/helpers/media-types.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/prettify-jsonc-string.d.ts +6 -0
- package/dist/v2/blocks/response-block/helpers/prettify-jsonc-string.d.ts.map +1 -0
- package/dist/v2/blocks/response-block/helpers/prettify-jsonc-string.js +22 -0
- package/dist/v2/blocks/response-block/helpers/prettify-jsonc-string.js.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +124 -91
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +30 -20
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +43 -21
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts +15 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js +1 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js +74 -28
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +30 -20
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js +190 -72
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js +7 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +26 -10
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +25 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +12 -3
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +4 -4
- package/dist/v2/components/code-input/CodeInput.vue.script.js +1 -1
- package/dist/v2/components/code-input/code-variable-widget.js +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.d.ts +2 -2
- package/dist/v2/components/modals/DeleteModal.vue.d.ts +2 -2
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +2 -2
- package/dist/v2/components/server/ServerDropdown.vue.js.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.script.js +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.script.js.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.script.js +4 -3
- package/dist/v2/components/sidebar/Sidebar.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts +2 -2
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.d.ts +2 -2
- package/dist/v2/features/command-palette/index.d.ts +0 -2
- package/dist/v2/features/command-palette/index.d.ts.map +1 -1
- package/dist/v2/features/command-palette/index.js +1 -3
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts +2 -2
- package/dist/v2/features/modal/Modal.vue.d.ts +5 -7
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js.map +1 -1
- package/dist/v2/features/modal/Modal.vue.script.js +3 -3
- package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +8 -3
- package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +5 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js +15 -4
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js.map +1 -1
- package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -1
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js +5 -1
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js.map +1 -1
- package/dist/v2/features/modal/index.js +1 -1
- package/dist/v2/features/modal/modal-events.d.ts.map +1 -1
- package/dist/v2/features/modal/modal-events.js +10 -6
- package/dist/v2/features/modal/modal-events.js.map +1 -1
- package/dist/v2/features/operation/Operation.vue.d.ts +35 -3
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js.map +1 -1
- package/dist/v2/features/operation/Operation.vue.script.js +1 -9
- package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +4 -0
- package/dist/v2/helpers/handle-hotkeys.js.map +1 -1
- package/dist/v2/helpers/test-utils.d.ts +2 -0
- package/dist/v2/helpers/test-utils.d.ts.map +1 -1
- package/dist/v2/helpers/test-utils.js +18 -0
- package/dist/v2/helpers/test-utils.js.map +1 -0
- package/dist/v2/hooks/index.d.ts +2 -0
- package/dist/v2/hooks/index.d.ts.map +1 -0
- package/dist/v2/hooks/index.js +2 -0
- package/dist/v2/types/options.d.ts +1 -1
- package/dist/v2/types/options.d.ts.map +1 -1
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +2 -0
- package/dist/v2/workspace-events.js.map +1 -1
- package/dist/vue-styles.css +108 -658
- package/package.json +68 -97
- package/dist/components/IconSelector.vue.d.ts +0 -27
- package/dist/components/IconSelector.vue.d.ts.map +0 -1
- package/dist/components/IconSelector.vue.js +0 -7
- package/dist/components/IconSelector.vue.js.map +0 -1
- package/dist/components/IconSelector.vue.script.js +0 -65
- package/dist/components/IconSelector.vue.script.js.map +0 -1
- package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts +0 -7
- package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +0 -1
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +0 -7
- package/dist/components/ImportCollection/IntegrationLogo.vue.js.map +0 -1
- package/dist/components/ImportCollection/IntegrationLogo.vue.script.js +0 -50
- package/dist/components/ImportCollection/IntegrationLogo.vue.script.js.map +0 -1
- package/dist/components/ScalarAsciiArt.vue.d.ts.map +0 -1
- package/dist/components/ScalarAsciiArt.vue.js.map +0 -1
- package/dist/components/ScalarAsciiArt.vue.script.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/monacoeditorwork/editor.worker.bundle.js +0 -14319
- package/dist/monacoeditorwork/json.worker.bundle.js +0 -22098
- package/dist/monacoeditorwork/yaml.worker.bundle.js +0 -38414
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts +0 -42
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +0 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +0 -61
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js.map +0 -1
- package/dist/v2/features/app/App.vue.d.ts +0 -75
- package/dist/v2/features/app/App.vue.d.ts.map +0 -1
- package/dist/v2/features/app/App.vue.js +0 -8
- package/dist/v2/features/app/App.vue.js.map +0 -1
- package/dist/v2/features/app/App.vue.script.js +0 -284
- package/dist/v2/features/app/App.vue.script.js.map +0 -1
- package/dist/v2/features/app/app-events.d.ts +0 -20
- package/dist/v2/features/app/app-events.d.ts.map +0 -1
- package/dist/v2/features/app/app-events.js +0 -254
- package/dist/v2/features/app/app-events.js.map +0 -1
- package/dist/v2/features/app/app-state.d.ts +0 -156
- package/dist/v2/features/app/app-state.d.ts.map +0 -1
- package/dist/v2/features/app/app-state.js +0 -717
- package/dist/v2/features/app/app-state.js.map +0 -1
- package/dist/v2/features/app/components/AppHeader.vue.d.ts +0 -43
- package/dist/v2/features/app/components/AppHeader.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/AppHeader.vue.js +0 -7
- package/dist/v2/features/app/components/AppHeader.vue.js.map +0 -1
- package/dist/v2/features/app/components/AppHeader.vue.script.js +0 -53
- package/dist/v2/features/app/components/AppHeader.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/AppHeaderActions.vue.d.ts +0 -32
- package/dist/v2/features/app/components/AppHeaderActions.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/AppHeaderActions.vue.js +0 -7
- package/dist/v2/features/app/components/AppHeaderActions.vue.js.map +0 -1
- package/dist/v2/features/app/components/AppHeaderActions.vue.script.js +0 -172
- package/dist/v2/features/app/components/AppHeaderActions.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +0 -37
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +0 -9
- package/dist/v2/features/app/components/AppSidebar.vue.js.map +0 -1
- package/dist/v2/features/app/components/AppSidebar.vue.script.js +0 -466
- package/dist/v2/features/app/components/AppSidebar.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/CreateVersionModal.vue.d.ts +0 -28
- package/dist/v2/features/app/components/CreateVersionModal.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/CreateVersionModal.vue.js +0 -7
- package/dist/v2/features/app/components/CreateVersionModal.vue.js.map +0 -1
- package/dist/v2/features/app/components/CreateVersionModal.vue.script.js +0 -84
- package/dist/v2/features/app/components/CreateVersionModal.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/CreateWorkspaceModal.vue.d.ts +0 -16
- package/dist/v2/features/app/components/CreateWorkspaceModal.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/CreateWorkspaceModal.vue.js +0 -7
- package/dist/v2/features/app/components/CreateWorkspaceModal.vue.js.map +0 -1
- package/dist/v2/features/app/components/CreateWorkspaceModal.vue.script.js +0 -58
- package/dist/v2/features/app/components/CreateWorkspaceModal.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/DesktopTab.vue.d.ts +0 -27
- package/dist/v2/features/app/components/DesktopTab.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/DesktopTab.vue.js +0 -9
- package/dist/v2/features/app/components/DesktopTab.vue.js.map +0 -1
- package/dist/v2/features/app/components/DesktopTab.vue.script.js +0 -121
- package/dist/v2/features/app/components/DesktopTab.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +0 -14
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.js +0 -7
- package/dist/v2/features/app/components/DesktopTabs.vue.js.map +0 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.script.js +0 -75
- package/dist/v2/features/app/components/DesktopTabs.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.d.ts +0 -25
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.js +0 -9
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.js.map +0 -1
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.script.js +0 -345
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.d.ts +0 -16
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/PublishDocumentModal.vue.d.ts +0 -77
- package/dist/v2/features/app/components/PublishDocumentModal.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/PublishDocumentModal.vue.js +0 -7
- package/dist/v2/features/app/components/PublishDocumentModal.vue.js.map +0 -1
- package/dist/v2/features/app/components/PublishDocumentModal.vue.script.js +0 -209
- package/dist/v2/features/app/components/PublishDocumentModal.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/SidebarDocument.vue.d.ts +0 -45
- package/dist/v2/features/app/components/SidebarDocument.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/SidebarDocument.vue.js +0 -7
- package/dist/v2/features/app/components/SidebarDocument.vue.js.map +0 -1
- package/dist/v2/features/app/components/SidebarDocument.vue.script.js +0 -137
- package/dist/v2/features/app/components/SidebarDocument.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts +0 -26
- package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/SidebarItemMenu.vue.js +0 -7
- package/dist/v2/features/app/components/SidebarItemMenu.vue.js.map +0 -1
- package/dist/v2/features/app/components/SidebarItemMenu.vue.script.js +0 -175
- package/dist/v2/features/app/components/SidebarItemMenu.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/SplashScreen.vue.d.ts +0 -4
- package/dist/v2/features/app/components/SplashScreen.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/SplashScreen.vue.js +0 -9
- package/dist/v2/features/app/components/SplashScreen.vue.js.map +0 -1
- package/dist/v2/features/app/components/SplashScreen.vue.script.js +0 -20
- package/dist/v2/features/app/components/SplashScreen.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/SyncConflictResolutionEditor.vue.d.ts +0 -18
- package/dist/v2/features/app/components/SyncConflictResolutionEditor.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/SyncConflictResolutionEditor.vue.js +0 -9
- package/dist/v2/features/app/components/SyncConflictResolutionEditor.vue.js.map +0 -1
- package/dist/v2/features/app/components/SyncConflictResolutionEditor.vue.script.js +0 -136
- package/dist/v2/features/app/components/SyncConflictResolutionEditor.vue.script.js.map +0 -1
- package/dist/v2/features/app/components/index.d.ts +0 -2
- package/dist/v2/features/app/components/index.d.ts.map +0 -1
- package/dist/v2/features/app/components/index.js +0 -2
- package/dist/v2/features/app/helpers/check-version-conflict.d.ts +0 -54
- package/dist/v2/features/app/helpers/check-version-conflict.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/check-version-conflict.js +0 -82
- package/dist/v2/features/app/helpers/check-version-conflict.js.map +0 -1
- package/dist/v2/features/app/helpers/compute-version-status.d.ts +0 -45
- package/dist/v2/features/app/helpers/compute-version-status.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/compute-version-status.js +0 -18
- package/dist/v2/features/app/helpers/compute-version-status.js.map +0 -1
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +0 -59
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/create-api-client-app.js +0 -55
- package/dist/v2/features/app/helpers/create-api-client-app.js.map +0 -1
- package/dist/v2/features/app/helpers/create-draft-registry-document.d.ts +0 -39
- package/dist/v2/features/app/helpers/create-draft-registry-document.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/create-draft-registry-document.js +0 -64
- package/dist/v2/features/app/helpers/create-draft-registry-document.js.map +0 -1
- package/dist/v2/features/app/helpers/create-temp-operation.d.ts +0 -14
- package/dist/v2/features/app/helpers/create-temp-operation.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/create-temp-operation.js +0 -52
- package/dist/v2/features/app/helpers/create-temp-operation.js.map +0 -1
- package/dist/v2/features/app/helpers/detect-document-conflicts.d.ts +0 -26
- package/dist/v2/features/app/helpers/detect-document-conflicts.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/detect-document-conflicts.js +0 -27
- package/dist/v2/features/app/helpers/detect-document-conflicts.js.map +0 -1
- package/dist/v2/features/app/helpers/filter-workspaces.d.ts +0 -49
- package/dist/v2/features/app/helpers/filter-workspaces.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/filter-workspaces.js +0 -55
- package/dist/v2/features/app/helpers/filter-workspaces.js.map +0 -1
- package/dist/v2/features/app/helpers/get-route-param.d.ts +0 -7
- package/dist/v2/features/app/helpers/get-route-param.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/get-route-param.js +0 -12
- package/dist/v2/features/app/helpers/get-route-param.js.map +0 -1
- package/dist/v2/features/app/helpers/group-workspaces.d.ts +0 -44
- package/dist/v2/features/app/helpers/group-workspaces.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/group-workspaces.js +0 -53
- package/dist/v2/features/app/helpers/group-workspaces.js.map +0 -1
- package/dist/v2/features/app/helpers/load-registry-document.d.ts +0 -24
- package/dist/v2/features/app/helpers/load-registry-document.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/load-registry-document.js +0 -47
- package/dist/v2/features/app/helpers/load-registry-document.js.map +0 -1
- package/dist/v2/features/app/helpers/registry-error-messages.d.ts +0 -23
- package/dist/v2/features/app/helpers/registry-error-messages.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/registry-error-messages.js +0 -63
- package/dist/v2/features/app/helpers/registry-error-messages.js.map +0 -1
- package/dist/v2/features/app/helpers/routes.d.ts +0 -184
- package/dist/v2/features/app/helpers/routes.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/routes.js +0 -153
- package/dist/v2/features/app/helpers/routes.js.map +0 -1
- package/dist/v2/features/app/helpers/version-status-presentation.d.ts +0 -24
- package/dist/v2/features/app/helpers/version-status-presentation.d.ts.map +0 -1
- package/dist/v2/features/app/helpers/version-status-presentation.js +0 -43
- package/dist/v2/features/app/helpers/version-status-presentation.js.map +0 -1
- package/dist/v2/features/app/hooks/use-active-document-version.d.ts +0 -42
- package/dist/v2/features/app/hooks/use-active-document-version.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-active-document-version.js +0 -60
- package/dist/v2/features/app/hooks/use-active-document-version.js.map +0 -1
- package/dist/v2/features/app/hooks/use-document-filter.d.ts +0 -38
- package/dist/v2/features/app/hooks/use-document-filter.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-document-filter.js +0 -63
- package/dist/v2/features/app/hooks/use-document-filter.js.map +0 -1
- package/dist/v2/features/app/hooks/use-document-sync.d.ts +0 -126
- package/dist/v2/features/app/hooks/use-document-sync.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-document-sync.js +0 -448
- package/dist/v2/features/app/hooks/use-document-sync.js.map +0 -1
- package/dist/v2/features/app/hooks/use-document-watcher.d.ts +0 -30
- package/dist/v2/features/app/hooks/use-document-watcher.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-document-watcher.js +0 -168
- package/dist/v2/features/app/hooks/use-document-watcher.js.map +0 -1
- package/dist/v2/features/app/hooks/use-network-status.d.ts +0 -29
- package/dist/v2/features/app/hooks/use-network-status.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-network-status.js +0 -58
- package/dist/v2/features/app/hooks/use-network-status.js.map +0 -1
- package/dist/v2/features/app/hooks/use-sidebar-context-menu.d.ts +0 -17258
- package/dist/v2/features/app/hooks/use-sidebar-context-menu.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-sidebar-context-menu.js +0 -107
- package/dist/v2/features/app/hooks/use-sidebar-context-menu.js.map +0 -1
- package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts +0 -119
- package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-sidebar-documents.js +0 -219
- package/dist/v2/features/app/hooks/use-sidebar-documents.js.map +0 -1
- package/dist/v2/features/app/hooks/use-theme.d.ts +0 -56
- package/dist/v2/features/app/hooks/use-theme.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-theme.js +0 -94
- package/dist/v2/features/app/hooks/use-theme.js.map +0 -1
- package/dist/v2/features/app/hooks/use-version-conflict-check.d.ts +0 -35
- package/dist/v2/features/app/hooks/use-version-conflict-check.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-version-conflict-check.js +0 -62
- package/dist/v2/features/app/hooks/use-version-conflict-check.js.map +0 -1
- package/dist/v2/features/app/index.d.ts +0 -10
- package/dist/v2/features/app/index.d.ts.map +0 -1
- package/dist/v2/features/app/index.js +0 -8
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts +0 -13
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +0 -8
- package/dist/v2/features/collection/DocumentCollection.vue.js.map +0 -1
- package/dist/v2/features/collection/DocumentCollection.vue.script.js +0 -112
- package/dist/v2/features/collection/DocumentCollection.vue.script.js.map +0 -1
- package/dist/v2/features/collection/OperationCollection.vue.d.ts +0 -6
- package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/OperationCollection.vue.js +0 -7
- package/dist/v2/features/collection/OperationCollection.vue.js.map +0 -1
- package/dist/v2/features/collection/OperationCollection.vue.script.js +0 -95
- package/dist/v2/features/collection/OperationCollection.vue.script.js.map +0 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts +0 -6
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +0 -7
- package/dist/v2/features/collection/WorkspaceCollection.vue.js.map +0 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.script.js +0 -74
- package/dist/v2/features/collection/WorkspaceCollection.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Authentication.vue.d.ts +0 -16
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +0 -9
- package/dist/v2/features/collection/components/Authentication.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Authentication.vue.script.js +0 -174
- package/dist/v2/features/collection/components/Authentication.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Cookies.vue.d.ts +0 -21
- package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Cookies.vue.js +0 -7
- package/dist/v2/features/collection/components/Cookies.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Cookies.vue.script.js +0 -58
- package/dist/v2/features/collection/components/Cookies.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/DocumentScriptsEditors.vue.d.ts +0 -12
- package/dist/v2/features/collection/components/DocumentScriptsEditors.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/DocumentScriptsEditors.vue.js +0 -9
- package/dist/v2/features/collection/components/DocumentScriptsEditors.vue.js.map +0 -1
- package/dist/v2/features/collection/components/DocumentScriptsEditors.vue.script.js +0 -174
- package/dist/v2/features/collection/components/DocumentScriptsEditors.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/Editor.vue.d.ts +0 -16
- package/dist/v2/features/collection/components/Editor/Editor.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/Editor.vue.js +0 -9
- package/dist/v2/features/collection/components/Editor/Editor.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/Editor.vue.script.js +0 -361
- package/dist/v2/features/collection/components/Editor/Editor.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue.d.ts +0 -19
- package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue.js +0 -7
- package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue.script.js +0 -69
- package/dist/v2/features/collection/components/Editor/components/EditorDiagnosticsPanel.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue.d.ts +0 -16
- package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue.js +0 -7
- package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue.script.js +0 -91
- package/dist/v2/features/collection/components/Editor/components/EditorSavePanel.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/get-diagnostic-counts.d.ts +0 -12
- package/dist/v2/features/collection/components/Editor/helpers/get-diagnostic-counts.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/get-diagnostic-counts.js +0 -22
- package/dist/v2/features/collection/components/Editor/helpers/get-diagnostic-counts.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/get-operation-context.d.ts +0 -11
- package/dist/v2/features/collection/components/Editor/helpers/get-operation-context.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/get-operation-context.js +0 -17
- package/dist/v2/features/collection/components/Editor/helpers/get-operation-context.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/get-visible-diagnostics.d.ts +0 -7
- package/dist/v2/features/collection/components/Editor/helpers/get-visible-diagnostics.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/get-visible-diagnostics.js +0 -17
- package/dist/v2/features/collection/components/Editor/helpers/get-visible-diagnostics.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/parse-editor-object.d.ts +0 -10
- package/dist/v2/features/collection/components/Editor/helpers/parse-editor-object.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/parse-editor-object.js +0 -34
- package/dist/v2/features/collection/components/Editor/helpers/parse-editor-object.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/stringify-document.d.ts +0 -10
- package/dist/v2/features/collection/components/Editor/helpers/stringify-document.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/stringify-document.js +0 -18
- package/dist/v2/features/collection/components/Editor/helpers/stringify-document.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.d.ts +0 -15
- package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.js +0 -36
- package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.js.map +0 -1
- package/dist/v2/features/collection/components/Editor/index.d.ts +0 -2
- package/dist/v2/features/collection/components/Editor/index.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/index.js +0 -2
- package/dist/v2/features/collection/components/Environment.vue.d.ts +0 -21
- package/dist/v2/features/collection/components/Environment.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Environment.vue.js +0 -7
- package/dist/v2/features/collection/components/Environment.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Environment.vue.script.js +0 -61
- package/dist/v2/features/collection/components/Environment.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Form.vue.d.ts +0 -29
- package/dist/v2/features/collection/components/Form.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Form.vue.js +0 -7
- package/dist/v2/features/collection/components/Form.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Form.vue.script.js +0 -78
- package/dist/v2/features/collection/components/Form.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/GetStarted.vue.d.ts +0 -21
- package/dist/v2/features/collection/components/GetStarted.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/GetStarted.vue.js +0 -7
- package/dist/v2/features/collection/components/GetStarted.vue.js.map +0 -1
- package/dist/v2/features/collection/components/GetStarted.vue.script.js +0 -144
- package/dist/v2/features/collection/components/GetStarted.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts +0 -18
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/LabelInput.vue.js +0 -9
- package/dist/v2/features/collection/components/LabelInput.vue.js.map +0 -1
- package/dist/v2/features/collection/components/LabelInput.vue.script.js +0 -38
- package/dist/v2/features/collection/components/LabelInput.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Overview.vue.d.ts +0 -16
- package/dist/v2/features/collection/components/Overview.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Overview.vue.js +0 -9
- package/dist/v2/features/collection/components/Overview.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Overview.vue.script.js +0 -204
- package/dist/v2/features/collection/components/Overview.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/Runner.vue.d.ts +0 -16
- package/dist/v2/features/collection/components/Runner/components/Runner.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/Runner.vue.js +0 -7
- package/dist/v2/features/collection/components/Runner/components/Runner.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/Runner.vue.script.js +0 -223
- package/dist/v2/features/collection/components/Runner/components/Runner.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerCard.vue.d.ts +0 -20
- package/dist/v2/features/collection/components/Runner/components/RunnerCard.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerCard.vue.js +0 -7
- package/dist/v2/features/collection/components/Runner/components/RunnerCard.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerCard.vue.script.js +0 -45
- package/dist/v2/features/collection/components/Runner/components/RunnerCard.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerOrderItem.vue.d.ts +0 -19
- package/dist/v2/features/collection/components/Runner/components/RunnerOrderItem.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerOrderItem.vue.js +0 -7
- package/dist/v2/features/collection/components/Runner/components/RunnerOrderItem.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerOrderItem.vue.script.js +0 -73
- package/dist/v2/features/collection/components/Runner/components/RunnerOrderItem.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerResultRow.vue.d.ts +0 -16
- package/dist/v2/features/collection/components/Runner/components/RunnerResultRow.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerResultRow.vue.js +0 -7
- package/dist/v2/features/collection/components/Runner/components/RunnerResultRow.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerResultRow.vue.script.js +0 -124
- package/dist/v2/features/collection/components/Runner/components/RunnerResultRow.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerResults.vue.d.ts +0 -17
- package/dist/v2/features/collection/components/Runner/components/RunnerResults.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerResults.vue.js +0 -7
- package/dist/v2/features/collection/components/Runner/components/RunnerResults.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerResults.vue.script.js +0 -126
- package/dist/v2/features/collection/components/Runner/components/RunnerResults.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTree.vue.d.ts +0 -18
- package/dist/v2/features/collection/components/Runner/components/RunnerTree.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTree.vue.js +0 -7
- package/dist/v2/features/collection/components/Runner/components/RunnerTree.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTree.vue.script.js +0 -180
- package/dist/v2/features/collection/components/Runner/components/RunnerTree.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeExample.vue.d.ts +0 -14
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeExample.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeExample.vue.js +0 -7
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeExample.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeExample.vue.script.js +0 -44
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeExample.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeGroup.vue.d.ts +0 -19
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeGroup.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeGroup.vue.js +0 -7
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeGroup.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeGroup.vue.script.js +0 -53
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeGroup.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeOperation.vue.d.ts +0 -23
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeOperation.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeOperation.vue.js +0 -7
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeOperation.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeOperation.vue.script.js +0 -75
- package/dist/v2/features/collection/components/Runner/components/RunnerTreeOperation.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/hooks/index.d.ts +0 -3
- package/dist/v2/features/collection/components/Runner/hooks/index.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.d.ts +0 -75
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js +0 -191
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-selection.d.ts +0 -46
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-selection.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-selection.js +0 -114
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-selection.js.map +0 -1
- package/dist/v2/features/collection/components/Runner/index.d.ts +0 -2
- package/dist/v2/features/collection/components/Runner/index.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Scripts.vue.d.ts +0 -16
- package/dist/v2/features/collection/components/Scripts.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Scripts.vue.js +0 -7
- package/dist/v2/features/collection/components/Scripts.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Scripts.vue.script.js +0 -49
- package/dist/v2/features/collection/components/Scripts.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Servers.vue.d.ts +0 -16
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Servers.vue.js +0 -7
- package/dist/v2/features/collection/components/Servers.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Servers.vue.script.js +0 -219
- package/dist/v2/features/collection/components/Servers.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Settings.vue.d.ts +0 -16
- package/dist/v2/features/collection/components/Settings.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Settings.vue.js +0 -7
- package/dist/v2/features/collection/components/Settings.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Settings.vue.script.js +0 -81
- package/dist/v2/features/collection/components/Settings.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/Tabs.vue.d.ts +0 -8
- package/dist/v2/features/collection/components/Tabs.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Tabs.vue.js +0 -7
- package/dist/v2/features/collection/components/Tabs.vue.js.map +0 -1
- package/dist/v2/features/collection/components/Tabs.vue.script.js +0 -55
- package/dist/v2/features/collection/components/Tabs.vue.script.js.map +0 -1
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.d.ts +0 -12
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.d.ts.map +0 -1
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.js +0 -19
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.js.map +0 -1
- package/dist/v2/features/command-palette/TheCommandPalette.vue.d.ts +0 -42
- package/dist/v2/features/command-palette/TheCommandPalette.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/TheCommandPalette.vue.js +0 -9
- package/dist/v2/features/command-palette/TheCommandPalette.vue.js.map +0 -1
- package/dist/v2/features/command-palette/TheCommandPalette.vue.script.js +0 -189
- package/dist/v2/features/command-palette/TheCommandPalette.vue.script.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +0 -49
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +0 -7
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.script.js +0 -225
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.script.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +0 -53
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +0 -7
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.script.js +0 -227
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.script.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts +0 -44
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.js +0 -9
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.script.js +0 -137
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.script.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.d.ts +0 -30
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.js +0 -7
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.script.js +0 -156
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.script.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.d.ts +0 -37
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.js +0 -7
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.script.js +0 -105
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.script.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +0 -48
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +0 -7
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.script.js +0 -228
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.script.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +0 -65
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +0 -7
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.script.js +0 -142
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.script.js.map +0 -1
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.d.ts +0 -58
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.js +0 -9
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.js.map +0 -1
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.script.js +0 -142
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.script.js.map +0 -1
- package/dist/v2/features/command-palette/components/PostmanRequestTreeRow.vue.d.ts +0 -23
- package/dist/v2/features/command-palette/components/PostmanRequestTreeRow.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/PostmanRequestTreeRow.vue.js +0 -9
- package/dist/v2/features/command-palette/components/PostmanRequestTreeRow.vue.js.map +0 -1
- package/dist/v2/features/command-palette/components/PostmanRequestTreeRow.vue.script.js +0 -138
- package/dist/v2/features/command-palette/components/PostmanRequestTreeRow.vue.script.js.map +0 -1
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue.d.ts +0 -34
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue.js +0 -7
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue.js.map +0 -1
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue.script.js +0 -39
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue.script.js.map +0 -1
- package/dist/v2/features/command-palette/helpers/generate-unique-slug.d.ts +0 -20
- package/dist/v2/features/command-palette/helpers/generate-unique-slug.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/generate-unique-slug.js +0 -33
- package/dist/v2/features/command-palette/helpers/generate-unique-slug.js.map +0 -1
- package/dist/v2/features/command-palette/helpers/get-merge-key.d.ts +0 -11
- package/dist/v2/features/command-palette/helpers/get-merge-key.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/get-merge-key.js +0 -32
- package/dist/v2/features/command-palette/helpers/get-merge-key.js.map +0 -1
- package/dist/v2/features/command-palette/helpers/get-openapi-document-details.d.ts +0 -24
- package/dist/v2/features/command-palette/helpers/get-openapi-document-details.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/get-openapi-document-details.js +0 -56
- package/dist/v2/features/command-palette/helpers/get-openapi-document-details.js.map +0 -1
- package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts +0 -24
- package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.js +0 -22
- package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.js.map +0 -1
- package/dist/v2/features/command-palette/helpers/get-operation-from-curl.d.ts +0 -26
- package/dist/v2/features/command-palette/helpers/get-operation-from-curl.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/get-operation-from-curl.js +0 -119
- package/dist/v2/features/command-palette/helpers/get-operation-from-curl.js.map +0 -1
- package/dist/v2/features/command-palette/helpers/get-postman-convert-options.d.ts +0 -14
- package/dist/v2/features/command-palette/helpers/get-postman-convert-options.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/get-postman-convert-options.js +0 -19
- package/dist/v2/features/command-palette/helpers/get-postman-convert-options.js.map +0 -1
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.d.ts +0 -28
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.js +0 -36
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.js.map +0 -1
- package/dist/v2/features/command-palette/helpers/import-document-to-workspace.d.ts +0 -30
- package/dist/v2/features/command-palette/helpers/import-document-to-workspace.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/import-document-to-workspace.js +0 -70
- package/dist/v2/features/command-palette/helpers/import-document-to-workspace.js.map +0 -1
- package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts +0 -20
- package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/load-document-from-source.js +0 -72
- package/dist/v2/features/command-palette/helpers/load-document-from-source.js.map +0 -1
- package/dist/v2/features/command-palette/helpers/parse-curl.d.ts +0 -14
- package/dist/v2/features/command-palette/helpers/parse-curl.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/parse-curl.js +0 -106
- package/dist/v2/features/command-palette/helpers/parse-curl.js.map +0 -1
- package/dist/v2/features/command-palette/helpers/postman-request-collisions.d.ts +0 -11
- package/dist/v2/features/command-palette/helpers/postman-request-collisions.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/postman-request-collisions.js +0 -35
- package/dist/v2/features/command-palette/helpers/postman-request-collisions.js.map +0 -1
- package/dist/v2/features/command-palette/helpers/postman-request-tree.d.ts +0 -41
- package/dist/v2/features/command-palette/helpers/postman-request-tree.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/postman-request-tree.js +0 -139
- package/dist/v2/features/command-palette/helpers/postman-request-tree.js.map +0 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +0 -426
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +0 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +0 -207
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js.map +0 -1
- package/dist/v2/features/editor/config.d.ts +0 -16
- package/dist/v2/features/editor/config.d.ts.map +0 -1
- package/dist/v2/features/editor/config.js +0 -19
- package/dist/v2/features/editor/config.js.map +0 -1
- package/dist/v2/features/editor/helpers/configure-language-support.d.ts +0 -13
- package/dist/v2/features/editor/helpers/configure-language-support.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/configure-language-support.js +0 -48
- package/dist/v2/features/editor/helpers/configure-language-support.js.map +0 -1
- package/dist/v2/features/editor/helpers/ensure-monaco-environment.d.ts +0 -6
- package/dist/v2/features/editor/helpers/ensure-monaco-environment.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/ensure-monaco-environment.js +0 -21
- package/dist/v2/features/editor/helpers/ensure-monaco-environment.js.map +0 -1
- package/dist/v2/features/editor/helpers/json/create-json-model.d.ts +0 -12
- package/dist/v2/features/editor/helpers/json/create-json-model.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/json/create-json-model.js +0 -31
- package/dist/v2/features/editor/helpers/json/create-json-model.js.map +0 -1
- package/dist/v2/features/editor/helpers/json/get-json-ast-node-from-path.d.ts +0 -14
- package/dist/v2/features/editor/helpers/json/get-json-ast-node-from-path.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/json/get-json-ast-node-from-path.js +0 -22
- package/dist/v2/features/editor/helpers/json/get-json-ast-node-from-path.js.map +0 -1
- package/dist/v2/features/editor/helpers/json/json-ast.d.ts +0 -12
- package/dist/v2/features/editor/helpers/json/json-ast.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/json/json-ast.js +0 -32
- package/dist/v2/features/editor/helpers/json/json-ast.js.map +0 -1
- package/dist/v2/features/editor/helpers/json/json-pointer-links.d.ts +0 -15
- package/dist/v2/features/editor/helpers/json/json-pointer-links.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/json/json-pointer-links.js +0 -104
- package/dist/v2/features/editor/helpers/json/json-pointer-links.js.map +0 -1
- package/dist/v2/features/editor/helpers/json/json-pointer-path.d.ts +0 -7
- package/dist/v2/features/editor/helpers/json/json-pointer-path.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/json/json-pointer-path.js +0 -27
- package/dist/v2/features/editor/helpers/json/json-pointer-path.js.map +0 -1
- package/dist/v2/features/editor/helpers/model.d.ts +0 -9
- package/dist/v2/features/editor/helpers/model.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/range-to-whole-line.d.ts +0 -14
- package/dist/v2/features/editor/helpers/range-to-whole-line.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/range-to-whole-line.js +0 -27
- package/dist/v2/features/editor/helpers/range-to-whole-line.js.map +0 -1
- package/dist/v2/features/editor/helpers/theme/apply-scalar-theme.d.ts +0 -16
- package/dist/v2/features/editor/helpers/theme/apply-scalar-theme.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/theme/apply-scalar-theme.js +0 -84
- package/dist/v2/features/editor/helpers/theme/apply-scalar-theme.js.map +0 -1
- package/dist/v2/features/editor/helpers/theme/load-css-variables.d.ts +0 -36
- package/dist/v2/features/editor/helpers/theme/load-css-variables.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/theme/load-css-variables.js +0 -117
- package/dist/v2/features/editor/helpers/theme/load-css-variables.js.map +0 -1
- package/dist/v2/features/editor/helpers/yaml/create-yaml-model.d.ts +0 -13
- package/dist/v2/features/editor/helpers/yaml/create-yaml-model.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/yaml/create-yaml-model.js +0 -32
- package/dist/v2/features/editor/helpers/yaml/create-yaml-model.js.map +0 -1
- package/dist/v2/features/editor/helpers/yaml/get-yaml-node-range-from-path.d.ts +0 -19
- package/dist/v2/features/editor/helpers/yaml/get-yaml-node-range-from-path.d.ts.map +0 -1
- package/dist/v2/features/editor/helpers/yaml/get-yaml-node-range-from-path.js +0 -70
- package/dist/v2/features/editor/helpers/yaml/get-yaml-node-range-from-path.js.map +0 -1
- package/dist/v2/features/editor/hooks/use-editor-markers.d.ts +0 -152
- package/dist/v2/features/editor/hooks/use-editor-markers.d.ts.map +0 -1
- package/dist/v2/features/editor/hooks/use-editor-markers.js +0 -37
- package/dist/v2/features/editor/hooks/use-editor-markers.js.map +0 -1
- package/dist/v2/features/editor/hooks/use-editor.d.ts +0 -39
- package/dist/v2/features/editor/hooks/use-editor.d.ts.map +0 -1
- package/dist/v2/features/editor/hooks/use-editor.js +0 -133
- package/dist/v2/features/editor/hooks/use-editor.js.map +0 -1
- package/dist/v2/features/editor/hooks/use-json-pointer-link-support.d.ts +0 -16
- package/dist/v2/features/editor/hooks/use-json-pointer-link-support.d.ts.map +0 -1
- package/dist/v2/features/editor/hooks/use-json-pointer-link-support.js +0 -45
- package/dist/v2/features/editor/hooks/use-json-pointer-link-support.js.map +0 -1
- package/dist/v2/features/editor/hooks/use-three-way-merge-editor.d.ts +0 -77
- package/dist/v2/features/editor/hooks/use-three-way-merge-editor.d.ts.map +0 -1
- package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js +0 -396
- package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js.map +0 -1
- package/dist/v2/features/editor/index.d.ts +0 -5
- package/dist/v2/features/editor/index.d.ts.map +0 -1
- package/dist/v2/features/editor/index.js +0 -5
- package/dist/v2/features/editor/schemas/openapi-3.1-schema.json.js +0 -51
- package/dist/v2/features/editor/schemas/openapi-3.1-schema.json.js.map +0 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts +0 -10
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts.map +0 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +0 -9
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.js.map +0 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.script.js +0 -188
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.script.js.map +0 -1
- package/dist/v2/features/global-cookies/index.d.ts +0 -2
- package/dist/v2/features/global-cookies/index.d.ts.map +0 -1
- package/dist/v2/features/global-cookies/index.js +0 -2
- package/dist/v2/features/settings/CollectionSettings.vue.d.ts +0 -28
- package/dist/v2/features/settings/CollectionSettings.vue.d.ts.map +0 -1
- package/dist/v2/features/settings/CollectionSettings.vue.js +0 -7
- package/dist/v2/features/settings/CollectionSettings.vue.js.map +0 -1
- package/dist/v2/features/settings/CollectionSettings.vue.script.js +0 -229
- package/dist/v2/features/settings/CollectionSettings.vue.script.js.map +0 -1
- package/dist/v2/features/settings/DocumentSettings.vue.d.ts +0 -20
- package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +0 -1
- package/dist/v2/features/settings/DocumentSettings.vue.js +0 -7
- package/dist/v2/features/settings/DocumentSettings.vue.js.map +0 -1
- package/dist/v2/features/settings/DocumentSettings.vue.script.js +0 -92
- package/dist/v2/features/settings/DocumentSettings.vue.script.js.map +0 -1
- package/dist/v2/features/settings/components/Appearance.vue.d.ts +0 -11
- package/dist/v2/features/settings/components/Appearance.vue.d.ts.map +0 -1
- package/dist/v2/features/settings/components/Appearance.vue.js +0 -7
- package/dist/v2/features/settings/components/Appearance.vue.js.map +0 -1
- package/dist/v2/features/settings/components/Appearance.vue.script.js +0 -63
- package/dist/v2/features/settings/components/Appearance.vue.script.js.map +0 -1
- package/dist/v2/features/settings/components/Section.vue.d.ts +0 -16
- package/dist/v2/features/settings/components/Section.vue.d.ts.map +0 -1
- package/dist/v2/features/settings/components/Section.vue.js +0 -7
- package/dist/v2/features/settings/components/Section.vue.js.map +0 -1
- package/dist/v2/features/settings/components/Section.vue.script.js +0 -30
- package/dist/v2/features/settings/components/Section.vue.script.js.map +0 -1
- package/dist/v2/features/settings/helpers/get-theme-colors.d.ts +0 -10
- package/dist/v2/features/settings/helpers/get-theme-colors.d.ts.map +0 -1
- package/dist/v2/features/settings/helpers/get-theme-colors.js +0 -68
- package/dist/v2/features/settings/helpers/get-theme-colors.js.map +0 -1
- package/dist/v2/features/settings/index.d.ts +0 -3
- package/dist/v2/features/settings/index.d.ts.map +0 -1
- package/dist/v2/features/settings/index.js +0 -3
- package/dist/v2/helpers/download-document.d.ts +0 -2
- package/dist/v2/helpers/download-document.d.ts.map +0 -1
- package/dist/v2/helpers/download-document.js +0 -42
- package/dist/v2/helpers/download-document.js.map +0 -1
- package/dist/v2/helpers/drag-handle-factory.d.ts +0 -16
- package/dist/v2/helpers/drag-handle-factory.d.ts.map +0 -1
- package/dist/v2/helpers/drag-handle-factory.js +0 -258
- package/dist/v2/helpers/drag-handle-factory.js.map +0 -1
- package/dist/v2/helpers/get-tab-details.d.ts +0 -43
- package/dist/v2/helpers/get-tab-details.d.ts.map +0 -1
- package/dist/v2/helpers/get-tab-details.js +0 -54
- package/dist/v2/helpers/get-tab-details.js.map +0 -1
- package/dist/v2/helpers/is-url.d.ts +0 -2
- package/dist/v2/helpers/is-url.d.ts.map +0 -1
- package/dist/v2/helpers/is-url.js +0 -10
- package/dist/v2/helpers/is-url.js.map +0 -1
- package/dist/v2/helpers/safe-run.d.ts +0 -34
- package/dist/v2/helpers/safe-run.d.ts.map +0 -1
- package/dist/v2/helpers/safe-run.js +0 -43
- package/dist/v2/helpers/safe-run.js.map +0 -1
- package/dist/v2/helpers/storage.d.ts +0 -31
- package/dist/v2/helpers/storage.d.ts.map +0 -1
- package/dist/v2/helpers/storage.js +0 -37
- package/dist/v2/helpers/storage.js.map +0 -1
- package/dist/v2/hooks/use-color-mode.d.ts +0 -20
- package/dist/v2/hooks/use-color-mode.d.ts.map +0 -1
- package/dist/v2/hooks/use-color-mode.js +0 -72
- package/dist/v2/hooks/use-color-mode.js.map +0 -1
- package/dist/v2/types/configuration.d.ts +0 -278
- package/dist/v2/types/configuration.d.ts.map +0 -1
- /package/dist/components/{ScalarAsciiArt.vue.d.ts → ScalarAsciiArt/ScalarAsciiArt.vue.d.ts} +0 -0
- /package/dist/{index.js → types/index.js} +0 -0
|
@@ -29,17 +29,22 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
29
29
|
/** Any config options required for the OAuth2 flow */
|
|
30
30
|
options?: OAuth2Options;
|
|
31
31
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
32
|
-
"update:selectedScopes": (payload:
|
|
33
|
-
id: string[];
|
|
34
|
-
name: string;
|
|
32
|
+
"update:selectedScopes": (payload: {
|
|
35
33
|
scopes: string[];
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
}) => any;
|
|
35
|
+
"upsert:scope": (payload: Omit<{
|
|
36
|
+
name: string;
|
|
37
|
+
flowType: keyof import("@scalar/workspace-store/schemas/v3.1/strict/oauthflows").OAuthFlowsObject;
|
|
38
|
+
scope: string;
|
|
39
|
+
description: string;
|
|
40
|
+
oldScope?: string;
|
|
41
|
+
enable?: boolean;
|
|
42
|
+
}, "name">) => any;
|
|
43
|
+
"delete:scope": (payload: Omit<{
|
|
44
|
+
name: string;
|
|
45
|
+
flowType: keyof import("@scalar/workspace-store/schemas/v3.1/strict/oauthflows").OAuthFlowsObject;
|
|
46
|
+
scope: string;
|
|
47
|
+
}, "name">) => any;
|
|
43
48
|
}, string, import("vue").PublicProps, Readonly<{
|
|
44
49
|
/** Current environment configuration */
|
|
45
50
|
environment: XScalarEnvironment;
|
|
@@ -62,16 +67,21 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
62
67
|
/** Any config options required for the OAuth2 flow */
|
|
63
68
|
options?: OAuth2Options;
|
|
64
69
|
}> & Readonly<{
|
|
65
|
-
"onUpdate:selectedScopes"?: ((payload:
|
|
66
|
-
id: string[];
|
|
67
|
-
name: string;
|
|
70
|
+
"onUpdate:selectedScopes"?: ((payload: {
|
|
68
71
|
scopes: string[];
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
}) => any) | undefined;
|
|
73
|
+
"onUpsert:scope"?: ((payload: Omit<{
|
|
74
|
+
name: string;
|
|
75
|
+
flowType: keyof import("@scalar/workspace-store/schemas/v3.1/strict/oauthflows").OAuthFlowsObject;
|
|
76
|
+
scope: string;
|
|
77
|
+
description: string;
|
|
78
|
+
oldScope?: string;
|
|
79
|
+
enable?: boolean;
|
|
80
|
+
}, "name">) => any) | undefined;
|
|
81
|
+
"onDelete:scope"?: ((payload: Omit<{
|
|
82
|
+
name: string;
|
|
83
|
+
flowType: keyof import("@scalar/workspace-store/schemas/v3.1/strict/oauthflows").OAuthFlowsObject;
|
|
84
|
+
scope: string;
|
|
85
|
+
}, "name">) => any) | undefined;
|
|
76
86
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
77
87
|
//# sourceMappingURL=OAuth2.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"AAijBA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAIzE,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAKL,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAChC,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,8DAA8D,CAAA;AAcrE,uDAAuD;AACvD,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,EAAE,mBAAmB,CAAC,CAAA;wBACxD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,QAAA,MAAM,YAAY;IAEhB,wCAAwC;iBAC3B,kBAAkB;IAC/B,kBAAkB;WACX,sBAAsB;IAC7B,6BAA6B;UACvB,MAAM,sBAAsB;IAClC,sBAAsB;oBACN,MAAM,EAAE;IACxB,sBAAsB;YACd,0BAA0B;IAClC,mCAAmC;YAC3B,YAAY,GAAG,IAAI;IAC3B,gBAAgB;cACN,MAAM;IAChB,kCAAkC;UAC5B,MAAM;IACZ,2CAA2C;cACjC,iBAAiB;IAC3B,uDAAuD;cAC7C,aAAa;;;gBAiByB,MAAM,EAAE;;;;;;;;;;;;;;;;IApCxD,wCAAwC;iBAC3B,kBAAkB;IAC/B,kBAAkB;WACX,sBAAsB;IAC7B,6BAA6B;UACvB,MAAM,sBAAsB;IAClC,sBAAsB;oBACN,MAAM,EAAE;IACxB,sBAAsB;YACd,0BAA0B;IAClC,mCAAmC;YAC3B,YAAY,GAAG,IAAI;IAC3B,gBAAgB;cACN,MAAM;IAChB,kCAAkC;UAC5B,MAAM;IACZ,2CAA2C;cACjC,iBAAiB;IAC3B,uDAAuD;cAC7C,aAAa;;;gBAiByB,MAAM,EAAE;;;;;;;;;;;;;;;kFA08BtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuth2.vue.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Any config options required for the OAuth2 flow */\nexport type OAuth2Options = Pick<ApiClientConfiguration, 'oauth2RedirectUri'>\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton, useLoadingState } from '@scalar/components'\nimport type { ApiClientConfiguration } from '@scalar/types/api-reference'\nimport { pkceOptions } from '@scalar/types/entities'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { SecretsOAuthFlows } from '@scalar/workspace-store/entities/auth'\nimport type {\n ApiReferenceEvents,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport {\n getEnvironmentVariables,\n type OAuthFlowAuthorizationCodeSecret,\n type OAuthFlowClientCredentialsSecret,\n type OAuthFlowPasswordSecret,\n type OAuthFlowsObjectSecret,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCredentialsLocation } from '@scalar/workspace-store/schemas/extensions/security/x-scalar-credentials-location'\nimport { type XusePkce } from '@scalar/workspace-store/schemas/extensions/security/x-use-pkce'\nimport type {\n OAuthFlow,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, watch } from 'vue'\n\nimport OAuthScopesInput from '@/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue'\nimport {\n authorizeOauth2,\n refreshOauth2Token,\n} from '@/v2/blocks/scalar-auth-selector-block/helpers/oauth'\nimport { resolveDefaultOAuth2RedirectUri } from '@/v2/blocks/scalar-auth-selector-block/helpers/resolve-default-oauth2-redirect-url'\nimport { DataTableRow } from '@/v2/components/data-table'\n\nimport RequestAuthDataTableInput from './RequestAuthDataTableInput.vue'\n\nconst {\n environment,\n flows,\n type,\n scheme,\n selectedScopes: selectedScopesProp,\n server,\n proxyUrl,\n eventBus,\n name,\n options = {},\n} = defineProps<{\n /** Current environment configuration */\n environment: XScalarEnvironment\n /** OAuth flows */\n flows: OAuthFlowsObjectSecret\n /** Type of the OAuth flow */\n type: keyof OAuthFlowsObjectSecret\n /** Selected scopes */\n selectedScopes: string[]\n /** Security scheme */\n scheme: SecuritySchemeObjectSecret\n /** Current server configuration */\n server: ServerObject | null\n /** Proxy URL */\n proxyUrl: string\n /** Name of the security scheme */\n name: string\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n}>()\n\nconst emits = defineEmits<{\n (\n e: 'update:selectedScopes',\n payload: Pick<\n ApiReferenceEvents['auth:update:selected-scopes'],\n 'scopes' | 'newScopePayload'\n >,\n ): void\n}>()\n\nconst loader = useLoadingState()\nconst { toast } = useToasts()\n\n/** The current OAuth flow based on the selected type */\nconst flow = computed(() => flows[type]!)\ntype NonImplicitFlow =\n | OAuthFlowPasswordSecret\n | OAuthFlowClientCredentialsSecret\n | OAuthFlowAuthorizationCodeSecret\n\n/** We filter selected scopes to only include scopes that are in this flow*/\nconst selectedScopes = computed(() =>\n selectedScopesProp.filter((scope) => scope in (flow.value.scopes ?? {})),\n)\n\n/** Updates the security scheme base */\nconst handleOauth2Update = (\n payload: Partial<OAuthFlow & XScalarCredentialsLocation>,\n): void => {\n // OpenIdConnect uses the secrets update for all\n if (scheme.type === 'openIdConnect') {\n return handleOauth2SecretsUpdate(payload)\n }\n\n eventBus.emit('auth:update:security-scheme', {\n payload: {\n type: scheme.type,\n flows: {\n [type]: payload,\n },\n },\n name,\n })\n}\n\n/** Updates the flow secrets */\nconst handleOauth2SecretsUpdate = (\n payload: Omit<Partial<SecretsOAuthFlows[keyof SecretsOAuthFlows]>, 'type'>,\n): void =>\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: {\n type: scheme.type,\n [type]: payload,\n },\n name,\n })\n\n/** Clears the flow secrets */\nconst clearOauth2Secrets = (): void => {\n if (loader.isLoading) {\n return\n }\n eventBus.emit('auth:clear:security-scheme-secrets', {\n name,\n })\n}\n\n/** Clears stored access and refresh tokens (authorized state) */\nconst handleClearAccessTokens = (): void => {\n if (loader.isLoading) {\n return\n }\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': '',\n 'x-scalar-secret-refresh-token': '',\n })\n}\n\n/** Track redirect URI prefill per flow instance to support document switching */\nconst prefilledFlowIdentity = ref<string | null>(null)\nconst hasHandledRedirectPrefill = ref(false)\n\nconst resolveFlowIdentity = (\n currentFlow: OAuthFlowsObjectSecret[keyof OAuthFlowsObjectSecret] | undefined,\n): string =>\n JSON.stringify({\n type,\n authorizationUrl:\n currentFlow && 'authorizationUrl' in currentFlow\n ? currentFlow.authorizationUrl\n : '',\n tokenUrl:\n currentFlow && 'tokenUrl' in currentFlow ? currentFlow.tokenUrl : '',\n refreshUrl: currentFlow?.refreshUrl ?? '',\n scopes: Object.keys(currentFlow?.scopes ?? {}),\n })\n\n/** Default the redirect-uri to the current origin if we have access to window */\nwatch(\n () => flow.value,\n (currentFlow) => {\n if (!currentFlow || !('x-scalar-secret-redirect-uri' in currentFlow)) {\n return\n }\n\n const flowIdentity = resolveFlowIdentity(currentFlow)\n if (prefilledFlowIdentity.value !== flowIdentity) {\n prefilledFlowIdentity.value = flowIdentity\n hasHandledRedirectPrefill.value = false\n }\n\n if (hasHandledRedirectPrefill.value) {\n return\n }\n\n const newRedirectUri = (currentFlow as OAuthFlowAuthorizationCodeSecret)[\n 'x-scalar-secret-redirect-uri'\n ]\n const defaultRedirectUri = resolveDefaultOAuth2RedirectUri(options)\n\n hasHandledRedirectPrefill.value = true\n\n if (newRedirectUri || !defaultRedirectUri) {\n return\n }\n\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-redirect-uri': defaultRedirectUri,\n })\n },\n { immediate: true },\n)\n\n/**\n * Authorizes the user using the specified OAuth flow.\n * Opens the appropriate OAuth dialog and/or performs the token exchange.\n */\nconst handleAuthorize = async (): Promise<void> => {\n if (loader.isLoading) {\n return\n }\n\n loader.start()\n\n const [error, tokens] = await authorizeOauth2(\n flows,\n type,\n selectedScopes.value,\n server,\n proxyUrl,\n getEnvironmentVariables(environment),\n )\n\n await loader.clear()\n\n if (tokens?.accessToken) {\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': tokens.accessToken,\n ...(tokens.refreshToken\n ? { 'x-scalar-secret-refresh-token': tokens.refreshToken }\n : {}),\n })\n } else {\n console.error(error)\n toast(error?.message ?? 'Failed to authorize', 'error')\n }\n}\n\n/** Whether the current flow supports refreshing the access token */\nconst supportsRefreshToken = computed(() => type !== 'implicit')\n\n/**\n * Refresh URL placeholder, shows tokenUrl as hint if refreshUrl is not specified.\n * This helps users understand that tokenUrl will be used as fallback.\n */\nconst refreshUrlPlaceholder = computed(() => {\n if ('tokenUrl' in flow.value && flow.value.tokenUrl) {\n return flow.value.tokenUrl\n }\n return 'https://galaxy.scalar.com/oauth/refresh'\n})\n\n/**\n * Uses the stored refresh token to obtain a new access token\n * via grant_type=refresh_token.\n */\nconst handleRefresh = async (): Promise<void> => {\n if (loader.isLoading || type === 'implicit') {\n return\n }\n\n loader.start()\n\n const [error, tokens] = await refreshOauth2Token(\n flows,\n type,\n proxyUrl,\n server,\n getEnvironmentVariables(environment),\n )\n\n await loader.clear()\n\n if (tokens?.accessToken) {\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': tokens.accessToken,\n ...(tokens.refreshToken\n ? { 'x-scalar-secret-refresh-token': tokens.refreshToken }\n : {}),\n })\n } else {\n console.error(error)\n toast(error?.message ?? 'Failed to refresh token', 'error')\n }\n}\n\n/** Updates the secret location */\nconst handleSecretLocationUpdate = (value: string): void => {\n const credentialsLocation = value === 'body' ? 'body' : 'header'\n\n if (scheme.type !== 'openIdConnect') {\n handleOauth2Update({\n 'x-scalar-credentials-location': credentialsLocation,\n })\n }\n\n handleOauth2SecretsUpdate({\n 'x-scalar-credentials-location': credentialsLocation,\n })\n}\n</script>\n\n<template>\n <!-- Access Token Display: Shows when user is already authorized -->\n <template v-if=\"Boolean(flow['x-scalar-secret-token'])\">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"border-r-transparent\"\n :environment\n :modelValue=\"flow['x-scalar-secret-token']\"\n placeholder=\"QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT\"\n type=\"password\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-token': v })\n \">\n Access Token\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"supportsRefreshToken\">\n <RequestAuthDataTableInput\n class=\"border-r-transparent\"\n :environment\n :modelValue=\"flow.refreshUrl ?? ''\"\n :placeholder=\"refreshUrlPlaceholder\"\n @update:modelValue=\"(v) => handleOauth2Update({ refreshUrl: v })\">\n Refresh URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow class=\"min-w-full\">\n <div class=\"flex h-8 items-center justify-end gap-2 border-t\">\n <ScalarButton\n v-if=\"supportsRefreshToken\"\n class=\"p-0 px-2 py-0.5\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleRefresh\">\n Refresh\n </ScalarButton>\n <ScalarButton\n class=\"mr-1 p-0 px-2 py-0.5\"\n :disabled=\"loader.isLoading\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleClearAccessTokens\">\n Clear\n </ScalarButton>\n </div>\n </DataTableRow>\n </template>\n\n <!-- Authorization Form: Shows when user needs to authorize -->\n <template v-else>\n <DataTableRow>\n <RequestAuthDataTableInput\n v-if=\"'authorizationUrl' in flow\"\n containerClass=\"border-r-0\"\n :environment\n :modelValue=\"flow['x-scalar-secret-auth-url'] ?? ''\"\n placeholder=\"https://galaxy.scalar.com/authorize\"\n @update:modelValue=\"\n (v) => {\n handleOauth2SecretsUpdate({ 'x-scalar-secret-auth-url': v })\n handleOauth2Update({ authorizationUrl: v })\n }\n \">\n Auth URL\n </RequestAuthDataTableInput>\n\n <RequestAuthDataTableInput\n v-if=\"'tokenUrl' in flow\"\n :environment\n :modelValue=\"flow['x-scalar-secret-token-url'] ?? ''\"\n placeholder=\"https://galaxy.scalar.com/token\"\n @update:modelValue=\"\n (v) => {\n handleOauth2SecretsUpdate({ 'x-scalar-secret-token-url': v })\n handleOauth2Update({ tokenUrl: v })\n }\n \">\n Token URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-scalar-secret-redirect-uri' in flow\">\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-redirect-uri']\"\n placeholder=\"Optional redirect URL\"\n @update:modelValue=\"\n (v) => {\n hasHandledRedirectPrefill = true\n handleOauth2SecretsUpdate({ 'x-scalar-secret-redirect-uri': v })\n }\n \">\n Redirect URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <template\n v-if=\"\n 'x-scalar-secret-username' in flow && 'x-scalar-secret-password' in flow\n \">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"text-c-2\"\n :environment\n :modelValue=\"flow['x-scalar-secret-username']\"\n placeholder=\"janedoe\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-username': v })\n \">\n Username\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-password']\"\n placeholder=\"********\"\n type=\"password\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-password': v })\n \">\n Password\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-client-id']\"\n placeholder=\"12345\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-client-id': v })\n \">\n Client ID\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-scalar-secret-client-secret' in flow\">\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-client-secret']\"\n placeholder=\"XYZ123\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleOauth2SecretsUpdate({ 'x-scalar-secret-client-secret': v })\n \">\n Client Secret\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-usePkce' in flow\">\n <RequestAuthDataTableInput\n :enum=\"pkceOptions\"\n :environment\n :modelValue=\"flow['x-usePkce']\"\n readOnly\n @update:modelValue=\"\n (v) =>\n handleOauth2Update({\n 'x-usePkce': v as XusePkce['x-usePkce'],\n })\n \">\n Use PKCE\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- Credentials Location -->\n <DataTableRow v-if=\"type !== 'implicit'\">\n <RequestAuthDataTableInput\n :enum=\"['header', 'body']\"\n :environment\n :modelValue=\"\n (flow as NonImplicitFlow)['x-scalar-credentials-location'] || 'header'\n \"\n placeholder=\"header\"\n readOnly\n @update:modelValue=\"(v) => handleSecretLocationUpdate(v)\">\n Credentials Location\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- Scopes -->\n <DataTableRow>\n <OAuthScopesInput\n :flow\n :flowType=\"type\"\n :selectedScopes\n @update:selectedScopes=\"(v) => emits('update:selectedScopes', v)\" />\n </DataTableRow>\n\n <DataTableRow class=\"min-w-full\">\n <div class=\"flex h-8 w-full items-center justify-end border-t\">\n <!-- Allow clearing the oauth section and going back to discovery -->\n <ScalarButton\n v-if=\"scheme.type === 'openIdConnect'\"\n class=\"mr-1 p-0 px-2 py-0.5\"\n :disabled=\"loader.isLoading\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"clearOauth2Secrets\">\n Clear\n </ScalarButton>\n\n <ScalarButton\n class=\"mr-0.75 p-0 px-2 py-0.5\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleAuthorize\">\n Authorize\n </ScalarButton>\n </div>\n </DataTableRow>\n </template>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"OAuth2.vue.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Any config options required for the OAuth2 flow */\nexport type OAuth2Options = Pick<ApiClientConfiguration, 'oauth2RedirectUri'>\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton, useLoadingState } from '@scalar/components'\nimport type { ApiClientConfiguration } from '@scalar/types/api-reference'\nimport { pkceOptions } from '@scalar/types/entities'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { SecretsOAuthFlows } from '@scalar/workspace-store/entities/auth'\nimport type {\n ApiReferenceEvents,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport {\n getEnvironmentVariables,\n type OAuthFlowAuthorizationCodeSecret,\n type OAuthFlowClientCredentialsSecret,\n type OAuthFlowPasswordSecret,\n type OAuthFlowsObjectSecret,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCredentialsLocation } from '@scalar/workspace-store/schemas/extensions/security/x-scalar-credentials-location'\nimport { type XusePkce } from '@scalar/workspace-store/schemas/extensions/security/x-use-pkce'\nimport type {\n OAuthFlow,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, watch } from 'vue'\n\nimport OAuthScopesInput from '@/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue'\nimport {\n authorizeOauth2,\n refreshOauth2Token,\n} from '@/v2/blocks/scalar-auth-selector-block/helpers/oauth'\nimport { resolveDefaultOAuth2RedirectUri } from '@/v2/blocks/scalar-auth-selector-block/helpers/resolve-default-oauth2-redirect-url'\nimport { DataTableRow } from '@/v2/components/data-table'\n\nimport RequestAuthDataTableInput from './RequestAuthDataTableInput.vue'\n\nconst {\n environment,\n flows,\n type,\n scheme,\n selectedScopes: selectedScopesProp,\n server,\n proxyUrl,\n eventBus,\n name,\n options = {},\n} = defineProps<{\n /** Current environment configuration */\n environment: XScalarEnvironment\n /** OAuth flows */\n flows: OAuthFlowsObjectSecret\n /** Type of the OAuth flow */\n type: keyof OAuthFlowsObjectSecret\n /** Selected scopes */\n selectedScopes: string[]\n /** Security scheme */\n scheme: SecuritySchemeObjectSecret\n /** Current server configuration */\n server: ServerObject | null\n /** Proxy URL */\n proxyUrl: string\n /** Name of the security scheme */\n name: string\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n}>()\n\nconst emits = defineEmits<{\n (e: 'update:selectedScopes', payload: { scopes: string[] }): void\n (\n e: 'upsert:scope',\n payload: Omit<ApiReferenceEvents['auth:upsert:scopes'], 'name'>,\n ): void\n (\n e: 'delete:scope',\n payload: Omit<ApiReferenceEvents['auth:delete:scopes'], 'name'>,\n ): void\n}>()\n\nconst loader = useLoadingState()\nconst { toast } = useToasts()\n\n/** The current OAuth flow based on the selected type */\nconst flow = computed(() => flows[type]!)\ntype NonImplicitFlow =\n | OAuthFlowPasswordSecret\n | OAuthFlowClientCredentialsSecret\n | OAuthFlowAuthorizationCodeSecret\n\n/** We filter selected scopes to only include scopes that are defined on this flow (own keys only). */\nconst selectedScopes = computed(() => {\n const definedScopes = flow.value.scopes\n if (!definedScopes) {\n return []\n }\n return selectedScopesProp.filter((scope) =>\n Object.hasOwn(definedScopes, scope),\n )\n})\n\n/**\n * PKCE public clients do not use a client_secret. Hide the field when the\n * document enables PKCE so readers are not prompted for an unused secret.\n */\nconst showClientSecret = computed(() => {\n if (!('x-scalar-secret-client-secret' in flow.value)) {\n return false\n }\n const pkceMode =\n 'x-usePkce' in flow.value ? flow.value['x-usePkce'] : undefined\n return pkceMode !== 'SHA-256' && pkceMode !== 'plain'\n})\n\nconst clientSecretValue = computed((): string => {\n const f = flow.value as { 'x-scalar-secret-client-secret'?: string }\n return f['x-scalar-secret-client-secret'] ?? ''\n})\n\n/** Updates the security scheme base */\nconst handleOauth2Update = (\n payload: Partial<OAuthFlow & XScalarCredentialsLocation>,\n): void => {\n // OpenIdConnect uses the secrets update for all\n if (scheme.type === 'openIdConnect') {\n return handleOauth2SecretsUpdate(payload)\n }\n\n eventBus.emit('auth:update:security-scheme', {\n payload: {\n type: scheme.type,\n flows: {\n [type]: payload,\n },\n },\n name,\n })\n}\n\n/** Updates the flow secrets */\nconst handleOauth2SecretsUpdate = (\n payload: Omit<Partial<SecretsOAuthFlows[keyof SecretsOAuthFlows]>, 'type'>,\n): void =>\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: {\n type: scheme.type,\n [type]: payload,\n },\n name,\n })\n\n/** Clears the flow secrets */\nconst clearOauth2Secrets = (): void => {\n if (loader.isLoading) {\n return\n }\n eventBus.emit('auth:clear:security-scheme-secrets', {\n name,\n })\n}\n\n/** Clears stored access and refresh tokens (authorized state) */\nconst handleClearAccessTokens = (): void => {\n if (loader.isLoading) {\n return\n }\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': '',\n 'x-scalar-secret-refresh-token': '',\n })\n}\n\n/** Track redirect URI prefill per flow instance to support document switching */\nconst prefilledFlowIdentity = ref<string | null>(null)\nconst hasHandledRedirectPrefill = ref(false)\n\nconst resolveFlowIdentity = (\n currentFlow: OAuthFlowsObjectSecret[keyof OAuthFlowsObjectSecret] | undefined,\n): string =>\n JSON.stringify({\n type,\n authorizationUrl:\n currentFlow && 'authorizationUrl' in currentFlow\n ? currentFlow.authorizationUrl\n : '',\n tokenUrl:\n currentFlow && 'tokenUrl' in currentFlow ? currentFlow.tokenUrl : '',\n refreshUrl: currentFlow?.refreshUrl ?? '',\n scopes: Object.keys(currentFlow?.scopes ?? {}),\n })\n\n/** Default the redirect-uri to the current origin if we have access to window */\nwatch(\n () => flow.value,\n (currentFlow) => {\n if (!currentFlow || !('x-scalar-secret-redirect-uri' in currentFlow)) {\n return\n }\n\n const flowIdentity = resolveFlowIdentity(currentFlow)\n if (prefilledFlowIdentity.value !== flowIdentity) {\n prefilledFlowIdentity.value = flowIdentity\n hasHandledRedirectPrefill.value = false\n }\n\n if (hasHandledRedirectPrefill.value) {\n return\n }\n\n const newRedirectUri = (currentFlow as OAuthFlowAuthorizationCodeSecret)[\n 'x-scalar-secret-redirect-uri'\n ]\n const defaultRedirectUri = resolveDefaultOAuth2RedirectUri(options)\n\n hasHandledRedirectPrefill.value = true\n\n if (newRedirectUri || !defaultRedirectUri) {\n return\n }\n\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-redirect-uri': defaultRedirectUri,\n })\n },\n { immediate: true },\n)\n\n/**\n * Authorizes the user using the specified OAuth flow.\n * Opens the appropriate OAuth dialog and/or performs the token exchange.\n */\nconst handleAuthorize = async (): Promise<void> => {\n if (loader.isLoading) {\n return\n }\n\n loader.start()\n\n const [error, tokens] = await authorizeOauth2(\n flows,\n type,\n selectedScopes.value,\n server,\n proxyUrl,\n getEnvironmentVariables(environment),\n )\n\n await loader.clear()\n\n if (tokens?.accessToken) {\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': tokens.accessToken,\n ...(tokens.refreshToken\n ? { 'x-scalar-secret-refresh-token': tokens.refreshToken }\n : {}),\n })\n } else {\n console.error(error)\n toast(error?.message ?? 'Failed to authorize', 'error')\n }\n}\n\n/** Whether the current flow supports refreshing the access token */\nconst supportsRefreshToken = computed(() => type !== 'implicit')\n\n/**\n * Refresh URL placeholder, shows tokenUrl as hint if refreshUrl is not specified.\n * This helps users understand that tokenUrl will be used as fallback.\n */\nconst refreshUrlPlaceholder = computed(() => {\n if ('tokenUrl' in flow.value && flow.value.tokenUrl) {\n return flow.value.tokenUrl\n }\n return 'https://galaxy.scalar.com/oauth/refresh'\n})\n\n/**\n * Uses the stored refresh token to obtain a new access token\n * via grant_type=refresh_token.\n */\nconst handleRefresh = async (): Promise<void> => {\n if (loader.isLoading || type === 'implicit') {\n return\n }\n\n loader.start()\n\n const [error, tokens] = await refreshOauth2Token(\n flows,\n type,\n proxyUrl,\n server,\n getEnvironmentVariables(environment),\n )\n\n await loader.clear()\n\n if (tokens?.accessToken) {\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': tokens.accessToken,\n ...(tokens.refreshToken\n ? { 'x-scalar-secret-refresh-token': tokens.refreshToken }\n : {}),\n })\n } else {\n console.error(error)\n toast(error?.message ?? 'Failed to refresh token', 'error')\n }\n}\n\n/** Updates the secret location */\nconst handleSecretLocationUpdate = (value: string): void => {\n const credentialsLocation = value === 'body' ? 'body' : 'header'\n\n if (scheme.type !== 'openIdConnect') {\n handleOauth2Update({\n 'x-scalar-credentials-location': credentialsLocation,\n })\n }\n\n handleOauth2SecretsUpdate({\n 'x-scalar-credentials-location': credentialsLocation,\n })\n}\n</script>\n\n<template>\n <!-- Access Token Display: Shows when user is already authorized -->\n <template v-if=\"Boolean(flow['x-scalar-secret-token'])\">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"border-r-transparent\"\n :environment\n :modelValue=\"flow['x-scalar-secret-token']\"\n placeholder=\"QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT\"\n type=\"password\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-token': v })\n \">\n Access Token\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"supportsRefreshToken\">\n <RequestAuthDataTableInput\n class=\"border-r-transparent\"\n :environment\n :modelValue=\"flow.refreshUrl ?? ''\"\n :placeholder=\"refreshUrlPlaceholder\"\n @update:modelValue=\"(v) => handleOauth2Update({ refreshUrl: v })\">\n Refresh URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow class=\"min-w-full\">\n <div class=\"flex h-8 items-center justify-end gap-2 border-t\">\n <ScalarButton\n v-if=\"supportsRefreshToken\"\n class=\"p-0 px-2 py-0.5\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleRefresh\">\n Refresh\n </ScalarButton>\n <ScalarButton\n class=\"mr-1 p-0 px-2 py-0.5\"\n :disabled=\"loader.isLoading\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleClearAccessTokens\">\n Clear\n </ScalarButton>\n </div>\n </DataTableRow>\n </template>\n\n <!-- Authorization Form: Shows when user needs to authorize -->\n <template v-else>\n <DataTableRow>\n <RequestAuthDataTableInput\n v-if=\"'authorizationUrl' in flow\"\n containerClass=\"border-r-0\"\n :environment\n :modelValue=\"flow['x-scalar-secret-auth-url'] ?? ''\"\n placeholder=\"https://galaxy.scalar.com/authorize\"\n @update:modelValue=\"\n (v) => {\n handleOauth2SecretsUpdate({ 'x-scalar-secret-auth-url': v })\n handleOauth2Update({ authorizationUrl: v })\n }\n \">\n Auth URL\n </RequestAuthDataTableInput>\n\n <RequestAuthDataTableInput\n v-if=\"'tokenUrl' in flow\"\n :environment\n :modelValue=\"flow['x-scalar-secret-token-url'] ?? ''\"\n placeholder=\"https://galaxy.scalar.com/token\"\n @update:modelValue=\"\n (v) => {\n handleOauth2SecretsUpdate({ 'x-scalar-secret-token-url': v })\n handleOauth2Update({ tokenUrl: v })\n }\n \">\n Token URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-scalar-secret-redirect-uri' in flow\">\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-redirect-uri']\"\n placeholder=\"Optional redirect URL\"\n @update:modelValue=\"\n (v) => {\n hasHandledRedirectPrefill = true\n handleOauth2SecretsUpdate({ 'x-scalar-secret-redirect-uri': v })\n }\n \">\n Redirect URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <template\n v-if=\"\n 'x-scalar-secret-username' in flow && 'x-scalar-secret-password' in flow\n \">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"text-c-2\"\n :environment\n :modelValue=\"flow['x-scalar-secret-username']\"\n placeholder=\"janedoe\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-username': v })\n \">\n Username\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-password']\"\n placeholder=\"********\"\n type=\"password\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-password': v })\n \">\n Password\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-client-id']\"\n placeholder=\"12345\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-client-id': v })\n \">\n Client ID\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"showClientSecret\">\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"clientSecretValue\"\n placeholder=\"XYZ123\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleOauth2SecretsUpdate({ 'x-scalar-secret-client-secret': v })\n \">\n Client Secret\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-usePkce' in flow\">\n <RequestAuthDataTableInput\n :enum=\"pkceOptions\"\n :environment\n :modelValue=\"flow['x-usePkce']\"\n readOnly\n @update:modelValue=\"\n (v) =>\n handleOauth2Update({\n 'x-usePkce': v as XusePkce['x-usePkce'],\n })\n \">\n Use PKCE\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- Credentials Location -->\n <DataTableRow v-if=\"type !== 'implicit'\">\n <RequestAuthDataTableInput\n :enum=\"['header', 'body']\"\n :environment\n :modelValue=\"\n (flow as NonImplicitFlow)['x-scalar-credentials-location'] || 'header'\n \"\n placeholder=\"header\"\n readOnly\n @update:modelValue=\"(v) => handleSecretLocationUpdate(v)\">\n Credentials Location\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- Scopes -->\n <DataTableRow>\n <OAuthScopesInput\n :flow\n :flowType=\"type\"\n :selectedScopes\n @update:selectedScopes=\"(v) => emits('update:selectedScopes', v)\"\n @upsert:scope=\"(v) => emits('upsert:scope', v)\"\n @delete:scope=\"(v) => emits('delete:scope', v)\" />\n </DataTableRow>\n\n <DataTableRow class=\"min-w-full\">\n <div class=\"flex h-8 w-full items-center justify-end border-t\">\n <!-- Allow clearing the oauth section and going back to discovery -->\n <ScalarButton\n v-if=\"scheme.type === 'openIdConnect'\"\n class=\"mr-1 p-0 px-2 py-0.5\"\n :disabled=\"loader.isLoading\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"clearOauth2Secrets\">\n Clear\n </ScalarButton>\n\n <ScalarButton\n class=\"mr-0.75 p-0 px-2 py-0.5\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleAuthorize\">\n Authorize\n </ScalarButton>\n </div>\n </DataTableRow>\n </template>\n</template>\n"],"mappings":""}
|
|
@@ -5,8 +5,8 @@ import { resolveDefaultOAuth2RedirectUri } from "../helpers/resolve-default-oaut
|
|
|
5
5
|
import RequestAuthDataTableInput_default from "./RequestAuthDataTableInput.vue.js";
|
|
6
6
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, unref, watch, withCtx } from "vue";
|
|
7
7
|
import { ScalarButton, useLoadingState } from "@scalar/components";
|
|
8
|
-
import { useToasts } from "@scalar/use-toasts";
|
|
9
8
|
import { getEnvironmentVariables } from "@scalar/workspace-store/request-example";
|
|
9
|
+
import { useToasts } from "@scalar/use-toasts";
|
|
10
10
|
import { pkceOptions } from "@scalar/types/entities";
|
|
11
11
|
//#region src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue?vue&type=script&setup=true&lang.ts
|
|
12
12
|
var _hoisted_1 = { class: "flex h-8 items-center justify-end gap-2 border-t" };
|
|
@@ -25,14 +25,34 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
25
25
|
eventBus: {},
|
|
26
26
|
options: { default: () => ({}) }
|
|
27
27
|
},
|
|
28
|
-
emits: [
|
|
28
|
+
emits: [
|
|
29
|
+
"update:selectedScopes",
|
|
30
|
+
"upsert:scope",
|
|
31
|
+
"delete:scope"
|
|
32
|
+
],
|
|
29
33
|
setup(__props, { emit: __emit }) {
|
|
30
34
|
const emits = __emit;
|
|
31
35
|
const loader = useLoadingState();
|
|
32
36
|
const { toast } = useToasts();
|
|
33
37
|
/** The current OAuth flow based on the selected type */
|
|
34
38
|
const flow = computed(() => __props.flows[__props.type]);
|
|
35
|
-
const selectedScopes = computed(() =>
|
|
39
|
+
const selectedScopes = computed(() => {
|
|
40
|
+
const definedScopes = flow.value.scopes;
|
|
41
|
+
if (!definedScopes) return [];
|
|
42
|
+
return __props.selectedScopes.filter((scope) => Object.hasOwn(definedScopes, scope));
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* PKCE public clients do not use a client_secret. Hide the field when the
|
|
46
|
+
* document enables PKCE so readers are not prompted for an unused secret.
|
|
47
|
+
*/
|
|
48
|
+
const showClientSecret = computed(() => {
|
|
49
|
+
if (!("x-scalar-secret-client-secret" in flow.value)) return false;
|
|
50
|
+
const pkceMode = "x-usePkce" in flow.value ? flow.value["x-usePkce"] : void 0;
|
|
51
|
+
return pkceMode !== "SHA-256" && pkceMode !== "plain";
|
|
52
|
+
});
|
|
53
|
+
const clientSecretValue = computed(() => {
|
|
54
|
+
return flow.value["x-scalar-secret-client-secret"] ?? "";
|
|
55
|
+
});
|
|
36
56
|
/** Updates the security scheme base */
|
|
37
57
|
const handleOauth2Update = (payload) => {
|
|
38
58
|
if (__props.scheme.type === "openIdConnect") return handleOauth2SecretsUpdate(payload);
|
|
@@ -153,7 +173,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
153
173
|
type: "password",
|
|
154
174
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-token": v }))
|
|
155
175
|
}, {
|
|
156
|
-
default: withCtx(() => [..._cache[
|
|
176
|
+
default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode(" Access Token ", -1)])]),
|
|
157
177
|
_: 1
|
|
158
178
|
}, 8, ["environment", "modelValue"])]),
|
|
159
179
|
_: 1
|
|
@@ -166,7 +186,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
166
186
|
placeholder: refreshUrlPlaceholder.value,
|
|
167
187
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = (v) => handleOauth2Update({ refreshUrl: v }))
|
|
168
188
|
}, {
|
|
169
|
-
default: withCtx(() => [..._cache[
|
|
189
|
+
default: withCtx(() => [..._cache[15] || (_cache[15] = [createTextVNode(" Refresh URL ", -1)])]),
|
|
170
190
|
_: 1
|
|
171
191
|
}, 8, [
|
|
172
192
|
"environment",
|
|
@@ -184,7 +204,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
184
204
|
variant: "outlined",
|
|
185
205
|
onClick: handleRefresh
|
|
186
206
|
}, {
|
|
187
|
-
default: withCtx(() => [..._cache[
|
|
207
|
+
default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode(" Refresh ", -1)])]),
|
|
188
208
|
_: 1
|
|
189
209
|
}, 8, ["loader"])) : createCommentVNode("", true), createVNode(unref(ScalarButton), {
|
|
190
210
|
class: "mr-1 p-0 px-2 py-0.5",
|
|
@@ -193,7 +213,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
193
213
|
variant: "outlined",
|
|
194
214
|
onClick: handleClearAccessTokens
|
|
195
215
|
}, {
|
|
196
|
-
default: withCtx(() => [..._cache[
|
|
216
|
+
default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode(" Clear ", -1)])]),
|
|
197
217
|
_: 1
|
|
198
218
|
}, 8, ["disabled"])])]),
|
|
199
219
|
_: 1
|
|
@@ -211,7 +231,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
211
231
|
handleOauth2Update({ authorizationUrl: v });
|
|
212
232
|
})
|
|
213
233
|
}, {
|
|
214
|
-
default: withCtx(() => [..._cache[
|
|
234
|
+
default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode(" Auth URL ", -1)])]),
|
|
215
235
|
_: 1
|
|
216
236
|
}, 8, ["environment", "modelValue"])) : createCommentVNode("", true), "tokenUrl" in flow.value ? (openBlock(), createBlock(RequestAuthDataTableInput_default, {
|
|
217
237
|
key: 1,
|
|
@@ -223,7 +243,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
223
243
|
handleOauth2Update({ tokenUrl: v });
|
|
224
244
|
})
|
|
225
245
|
}, {
|
|
226
|
-
default: withCtx(() => [..._cache[
|
|
246
|
+
default: withCtx(() => [..._cache[19] || (_cache[19] = [createTextVNode(" Token URL ", -1)])]),
|
|
227
247
|
_: 1
|
|
228
248
|
}, 8, ["environment", "modelValue"])) : createCommentVNode("", true)]),
|
|
229
249
|
_: 1
|
|
@@ -238,7 +258,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
238
258
|
handleOauth2SecretsUpdate({ "x-scalar-secret-redirect-uri": v });
|
|
239
259
|
})
|
|
240
260
|
}, {
|
|
241
|
-
default: withCtx(() => [..._cache[
|
|
261
|
+
default: withCtx(() => [..._cache[20] || (_cache[20] = [createTextVNode(" Redirect URL ", -1)])]),
|
|
242
262
|
_: 1
|
|
243
263
|
}, 8, ["environment", "modelValue"])]),
|
|
244
264
|
_: 1
|
|
@@ -251,7 +271,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
251
271
|
placeholder: "janedoe",
|
|
252
272
|
"onUpdate:modelValue": _cache[5] || (_cache[5] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-username": v }))
|
|
253
273
|
}, {
|
|
254
|
-
default: withCtx(() => [..._cache[
|
|
274
|
+
default: withCtx(() => [..._cache[21] || (_cache[21] = [createTextVNode(" Username ", -1)])]),
|
|
255
275
|
_: 1
|
|
256
276
|
}, 8, ["environment", "modelValue"])]),
|
|
257
277
|
_: 1
|
|
@@ -263,7 +283,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
263
283
|
type: "password",
|
|
264
284
|
"onUpdate:modelValue": _cache[6] || (_cache[6] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-password": v }))
|
|
265
285
|
}, {
|
|
266
|
-
default: withCtx(() => [..._cache[
|
|
286
|
+
default: withCtx(() => [..._cache[22] || (_cache[22] = [createTextVNode(" Password ", -1)])]),
|
|
267
287
|
_: 1
|
|
268
288
|
}, 8, ["environment", "modelValue"])]),
|
|
269
289
|
_: 1
|
|
@@ -275,20 +295,20 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
275
295
|
placeholder: "12345",
|
|
276
296
|
"onUpdate:modelValue": _cache[7] || (_cache[7] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-client-id": v }))
|
|
277
297
|
}, {
|
|
278
|
-
default: withCtx(() => [..._cache[
|
|
298
|
+
default: withCtx(() => [..._cache[23] || (_cache[23] = [createTextVNode(" Client ID ", -1)])]),
|
|
279
299
|
_: 1
|
|
280
300
|
}, 8, ["environment", "modelValue"])]),
|
|
281
301
|
_: 1
|
|
282
302
|
}),
|
|
283
|
-
|
|
303
|
+
showClientSecret.value ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 2 }, {
|
|
284
304
|
default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
|
|
285
305
|
environment: __props.environment,
|
|
286
|
-
modelValue:
|
|
306
|
+
modelValue: clientSecretValue.value,
|
|
287
307
|
placeholder: "XYZ123",
|
|
288
308
|
type: "password",
|
|
289
309
|
"onUpdate:modelValue": _cache[8] || (_cache[8] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-client-secret": v }))
|
|
290
310
|
}, {
|
|
291
|
-
default: withCtx(() => [..._cache[
|
|
311
|
+
default: withCtx(() => [..._cache[24] || (_cache[24] = [createTextVNode(" Client Secret ", -1)])]),
|
|
292
312
|
_: 1
|
|
293
313
|
}, 8, ["environment", "modelValue"])]),
|
|
294
314
|
_: 1
|
|
@@ -301,7 +321,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
301
321
|
readOnly: "",
|
|
302
322
|
"onUpdate:modelValue": _cache[9] || (_cache[9] = (v) => handleOauth2Update({ "x-usePkce": v }))
|
|
303
323
|
}, {
|
|
304
|
-
default: withCtx(() => [..._cache[
|
|
324
|
+
default: withCtx(() => [..._cache[25] || (_cache[25] = [createTextVNode(" Use PKCE ", -1)])]),
|
|
305
325
|
_: 1
|
|
306
326
|
}, 8, [
|
|
307
327
|
"enum",
|
|
@@ -319,7 +339,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
319
339
|
readOnly: "",
|
|
320
340
|
"onUpdate:modelValue": _cache[10] || (_cache[10] = (v) => handleSecretLocationUpdate(v))
|
|
321
341
|
}, {
|
|
322
|
-
default: withCtx(() => [..._cache[
|
|
342
|
+
default: withCtx(() => [..._cache[26] || (_cache[26] = [createTextVNode(" Credentials Location ", -1)])]),
|
|
323
343
|
_: 1
|
|
324
344
|
}, 8, ["environment", "modelValue"])]),
|
|
325
345
|
_: 1
|
|
@@ -329,7 +349,9 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
329
349
|
flow: flow.value,
|
|
330
350
|
flowType: __props.type,
|
|
331
351
|
selectedScopes: selectedScopes.value,
|
|
332
|
-
"onUpdate:selectedScopes": _cache[11] || (_cache[11] = (v) => emits("update:selectedScopes", v))
|
|
352
|
+
"onUpdate:selectedScopes": _cache[11] || (_cache[11] = (v) => emits("update:selectedScopes", v)),
|
|
353
|
+
"onUpsert:scope": _cache[12] || (_cache[12] = (v) => emits("upsert:scope", v)),
|
|
354
|
+
"onDelete:scope": _cache[13] || (_cache[13] = (v) => emits("delete:scope", v))
|
|
333
355
|
}, null, 8, [
|
|
334
356
|
"flow",
|
|
335
357
|
"flowType",
|
|
@@ -346,7 +368,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
346
368
|
variant: "outlined",
|
|
347
369
|
onClick: clearOauth2Secrets
|
|
348
370
|
}, {
|
|
349
|
-
default: withCtx(() => [..._cache[
|
|
371
|
+
default: withCtx(() => [..._cache[27] || (_cache[27] = [createTextVNode(" Clear ", -1)])]),
|
|
350
372
|
_: 1
|
|
351
373
|
}, 8, ["disabled"])) : createCommentVNode("", true), createVNode(unref(ScalarButton), {
|
|
352
374
|
class: "mr-0.75 p-0 px-2 py-0.5",
|
|
@@ -355,7 +377,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
355
377
|
variant: "outlined",
|
|
356
378
|
onClick: handleAuthorize
|
|
357
379
|
}, {
|
|
358
|
-
default: withCtx(() => [..._cache[
|
|
380
|
+
default: withCtx(() => [..._cache[28] || (_cache[28] = [createTextVNode(" Authorize ", -1)])]),
|
|
359
381
|
_: 1
|
|
360
382
|
}, 8, ["loader"])])]),
|
|
361
383
|
_: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuth2.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Any config options required for the OAuth2 flow */\nexport type OAuth2Options = Pick<ApiClientConfiguration, 'oauth2RedirectUri'>\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton, useLoadingState } from '@scalar/components'\nimport type { ApiClientConfiguration } from '@scalar/types/api-reference'\nimport { pkceOptions } from '@scalar/types/entities'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { SecretsOAuthFlows } from '@scalar/workspace-store/entities/auth'\nimport type {\n ApiReferenceEvents,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport {\n getEnvironmentVariables,\n type OAuthFlowAuthorizationCodeSecret,\n type OAuthFlowClientCredentialsSecret,\n type OAuthFlowPasswordSecret,\n type OAuthFlowsObjectSecret,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCredentialsLocation } from '@scalar/workspace-store/schemas/extensions/security/x-scalar-credentials-location'\nimport { type XusePkce } from '@scalar/workspace-store/schemas/extensions/security/x-use-pkce'\nimport type {\n OAuthFlow,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, watch } from 'vue'\n\nimport OAuthScopesInput from '@/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue'\nimport {\n authorizeOauth2,\n refreshOauth2Token,\n} from '@/v2/blocks/scalar-auth-selector-block/helpers/oauth'\nimport { resolveDefaultOAuth2RedirectUri } from '@/v2/blocks/scalar-auth-selector-block/helpers/resolve-default-oauth2-redirect-url'\nimport { DataTableRow } from '@/v2/components/data-table'\n\nimport RequestAuthDataTableInput from './RequestAuthDataTableInput.vue'\n\nconst {\n environment,\n flows,\n type,\n scheme,\n selectedScopes: selectedScopesProp,\n server,\n proxyUrl,\n eventBus,\n name,\n options = {},\n} = defineProps<{\n /** Current environment configuration */\n environment: XScalarEnvironment\n /** OAuth flows */\n flows: OAuthFlowsObjectSecret\n /** Type of the OAuth flow */\n type: keyof OAuthFlowsObjectSecret\n /** Selected scopes */\n selectedScopes: string[]\n /** Security scheme */\n scheme: SecuritySchemeObjectSecret\n /** Current server configuration */\n server: ServerObject | null\n /** Proxy URL */\n proxyUrl: string\n /** Name of the security scheme */\n name: string\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n}>()\n\nconst emits = defineEmits<{\n (\n e: 'update:selectedScopes',\n payload: Pick<\n ApiReferenceEvents['auth:update:selected-scopes'],\n 'scopes' | 'newScopePayload'\n >,\n ): void\n}>()\n\nconst loader = useLoadingState()\nconst { toast } = useToasts()\n\n/** The current OAuth flow based on the selected type */\nconst flow = computed(() => flows[type]!)\ntype NonImplicitFlow =\n | OAuthFlowPasswordSecret\n | OAuthFlowClientCredentialsSecret\n | OAuthFlowAuthorizationCodeSecret\n\n/** We filter selected scopes to only include scopes that are in this flow*/\nconst selectedScopes = computed(() =>\n selectedScopesProp.filter((scope) => scope in (flow.value.scopes ?? {})),\n)\n\n/** Updates the security scheme base */\nconst handleOauth2Update = (\n payload: Partial<OAuthFlow & XScalarCredentialsLocation>,\n): void => {\n // OpenIdConnect uses the secrets update for all\n if (scheme.type === 'openIdConnect') {\n return handleOauth2SecretsUpdate(payload)\n }\n\n eventBus.emit('auth:update:security-scheme', {\n payload: {\n type: scheme.type,\n flows: {\n [type]: payload,\n },\n },\n name,\n })\n}\n\n/** Updates the flow secrets */\nconst handleOauth2SecretsUpdate = (\n payload: Omit<Partial<SecretsOAuthFlows[keyof SecretsOAuthFlows]>, 'type'>,\n): void =>\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: {\n type: scheme.type,\n [type]: payload,\n },\n name,\n })\n\n/** Clears the flow secrets */\nconst clearOauth2Secrets = (): void => {\n if (loader.isLoading) {\n return\n }\n eventBus.emit('auth:clear:security-scheme-secrets', {\n name,\n })\n}\n\n/** Clears stored access and refresh tokens (authorized state) */\nconst handleClearAccessTokens = (): void => {\n if (loader.isLoading) {\n return\n }\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': '',\n 'x-scalar-secret-refresh-token': '',\n })\n}\n\n/** Track redirect URI prefill per flow instance to support document switching */\nconst prefilledFlowIdentity = ref<string | null>(null)\nconst hasHandledRedirectPrefill = ref(false)\n\nconst resolveFlowIdentity = (\n currentFlow: OAuthFlowsObjectSecret[keyof OAuthFlowsObjectSecret] | undefined,\n): string =>\n JSON.stringify({\n type,\n authorizationUrl:\n currentFlow && 'authorizationUrl' in currentFlow\n ? currentFlow.authorizationUrl\n : '',\n tokenUrl:\n currentFlow && 'tokenUrl' in currentFlow ? currentFlow.tokenUrl : '',\n refreshUrl: currentFlow?.refreshUrl ?? '',\n scopes: Object.keys(currentFlow?.scopes ?? {}),\n })\n\n/** Default the redirect-uri to the current origin if we have access to window */\nwatch(\n () => flow.value,\n (currentFlow) => {\n if (!currentFlow || !('x-scalar-secret-redirect-uri' in currentFlow)) {\n return\n }\n\n const flowIdentity = resolveFlowIdentity(currentFlow)\n if (prefilledFlowIdentity.value !== flowIdentity) {\n prefilledFlowIdentity.value = flowIdentity\n hasHandledRedirectPrefill.value = false\n }\n\n if (hasHandledRedirectPrefill.value) {\n return\n }\n\n const newRedirectUri = (currentFlow as OAuthFlowAuthorizationCodeSecret)[\n 'x-scalar-secret-redirect-uri'\n ]\n const defaultRedirectUri = resolveDefaultOAuth2RedirectUri(options)\n\n hasHandledRedirectPrefill.value = true\n\n if (newRedirectUri || !defaultRedirectUri) {\n return\n }\n\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-redirect-uri': defaultRedirectUri,\n })\n },\n { immediate: true },\n)\n\n/**\n * Authorizes the user using the specified OAuth flow.\n * Opens the appropriate OAuth dialog and/or performs the token exchange.\n */\nconst handleAuthorize = async (): Promise<void> => {\n if (loader.isLoading) {\n return\n }\n\n loader.start()\n\n const [error, tokens] = await authorizeOauth2(\n flows,\n type,\n selectedScopes.value,\n server,\n proxyUrl,\n getEnvironmentVariables(environment),\n )\n\n await loader.clear()\n\n if (tokens?.accessToken) {\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': tokens.accessToken,\n ...(tokens.refreshToken\n ? { 'x-scalar-secret-refresh-token': tokens.refreshToken }\n : {}),\n })\n } else {\n console.error(error)\n toast(error?.message ?? 'Failed to authorize', 'error')\n }\n}\n\n/** Whether the current flow supports refreshing the access token */\nconst supportsRefreshToken = computed(() => type !== 'implicit')\n\n/**\n * Refresh URL placeholder, shows tokenUrl as hint if refreshUrl is not specified.\n * This helps users understand that tokenUrl will be used as fallback.\n */\nconst refreshUrlPlaceholder = computed(() => {\n if ('tokenUrl' in flow.value && flow.value.tokenUrl) {\n return flow.value.tokenUrl\n }\n return 'https://galaxy.scalar.com/oauth/refresh'\n})\n\n/**\n * Uses the stored refresh token to obtain a new access token\n * via grant_type=refresh_token.\n */\nconst handleRefresh = async (): Promise<void> => {\n if (loader.isLoading || type === 'implicit') {\n return\n }\n\n loader.start()\n\n const [error, tokens] = await refreshOauth2Token(\n flows,\n type,\n proxyUrl,\n server,\n getEnvironmentVariables(environment),\n )\n\n await loader.clear()\n\n if (tokens?.accessToken) {\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': tokens.accessToken,\n ...(tokens.refreshToken\n ? { 'x-scalar-secret-refresh-token': tokens.refreshToken }\n : {}),\n })\n } else {\n console.error(error)\n toast(error?.message ?? 'Failed to refresh token', 'error')\n }\n}\n\n/** Updates the secret location */\nconst handleSecretLocationUpdate = (value: string): void => {\n const credentialsLocation = value === 'body' ? 'body' : 'header'\n\n if (scheme.type !== 'openIdConnect') {\n handleOauth2Update({\n 'x-scalar-credentials-location': credentialsLocation,\n })\n }\n\n handleOauth2SecretsUpdate({\n 'x-scalar-credentials-location': credentialsLocation,\n })\n}\n</script>\n\n<template>\n <!-- Access Token Display: Shows when user is already authorized -->\n <template v-if=\"Boolean(flow['x-scalar-secret-token'])\">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"border-r-transparent\"\n :environment\n :modelValue=\"flow['x-scalar-secret-token']\"\n placeholder=\"QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT\"\n type=\"password\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-token': v })\n \">\n Access Token\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"supportsRefreshToken\">\n <RequestAuthDataTableInput\n class=\"border-r-transparent\"\n :environment\n :modelValue=\"flow.refreshUrl ?? ''\"\n :placeholder=\"refreshUrlPlaceholder\"\n @update:modelValue=\"(v) => handleOauth2Update({ refreshUrl: v })\">\n Refresh URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow class=\"min-w-full\">\n <div class=\"flex h-8 items-center justify-end gap-2 border-t\">\n <ScalarButton\n v-if=\"supportsRefreshToken\"\n class=\"p-0 px-2 py-0.5\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleRefresh\">\n Refresh\n </ScalarButton>\n <ScalarButton\n class=\"mr-1 p-0 px-2 py-0.5\"\n :disabled=\"loader.isLoading\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleClearAccessTokens\">\n Clear\n </ScalarButton>\n </div>\n </DataTableRow>\n </template>\n\n <!-- Authorization Form: Shows when user needs to authorize -->\n <template v-else>\n <DataTableRow>\n <RequestAuthDataTableInput\n v-if=\"'authorizationUrl' in flow\"\n containerClass=\"border-r-0\"\n :environment\n :modelValue=\"flow['x-scalar-secret-auth-url'] ?? ''\"\n placeholder=\"https://galaxy.scalar.com/authorize\"\n @update:modelValue=\"\n (v) => {\n handleOauth2SecretsUpdate({ 'x-scalar-secret-auth-url': v })\n handleOauth2Update({ authorizationUrl: v })\n }\n \">\n Auth URL\n </RequestAuthDataTableInput>\n\n <RequestAuthDataTableInput\n v-if=\"'tokenUrl' in flow\"\n :environment\n :modelValue=\"flow['x-scalar-secret-token-url'] ?? ''\"\n placeholder=\"https://galaxy.scalar.com/token\"\n @update:modelValue=\"\n (v) => {\n handleOauth2SecretsUpdate({ 'x-scalar-secret-token-url': v })\n handleOauth2Update({ tokenUrl: v })\n }\n \">\n Token URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-scalar-secret-redirect-uri' in flow\">\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-redirect-uri']\"\n placeholder=\"Optional redirect URL\"\n @update:modelValue=\"\n (v) => {\n hasHandledRedirectPrefill = true\n handleOauth2SecretsUpdate({ 'x-scalar-secret-redirect-uri': v })\n }\n \">\n Redirect URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <template\n v-if=\"\n 'x-scalar-secret-username' in flow && 'x-scalar-secret-password' in flow\n \">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"text-c-2\"\n :environment\n :modelValue=\"flow['x-scalar-secret-username']\"\n placeholder=\"janedoe\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-username': v })\n \">\n Username\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-password']\"\n placeholder=\"********\"\n type=\"password\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-password': v })\n \">\n Password\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-client-id']\"\n placeholder=\"12345\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-client-id': v })\n \">\n Client ID\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-scalar-secret-client-secret' in flow\">\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-client-secret']\"\n placeholder=\"XYZ123\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleOauth2SecretsUpdate({ 'x-scalar-secret-client-secret': v })\n \">\n Client Secret\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-usePkce' in flow\">\n <RequestAuthDataTableInput\n :enum=\"pkceOptions\"\n :environment\n :modelValue=\"flow['x-usePkce']\"\n readOnly\n @update:modelValue=\"\n (v) =>\n handleOauth2Update({\n 'x-usePkce': v as XusePkce['x-usePkce'],\n })\n \">\n Use PKCE\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- Credentials Location -->\n <DataTableRow v-if=\"type !== 'implicit'\">\n <RequestAuthDataTableInput\n :enum=\"['header', 'body']\"\n :environment\n :modelValue=\"\n (flow as NonImplicitFlow)['x-scalar-credentials-location'] || 'header'\n \"\n placeholder=\"header\"\n readOnly\n @update:modelValue=\"(v) => handleSecretLocationUpdate(v)\">\n Credentials Location\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- Scopes -->\n <DataTableRow>\n <OAuthScopesInput\n :flow\n :flowType=\"type\"\n :selectedScopes\n @update:selectedScopes=\"(v) => emits('update:selectedScopes', v)\" />\n </DataTableRow>\n\n <DataTableRow class=\"min-w-full\">\n <div class=\"flex h-8 w-full items-center justify-end border-t\">\n <!-- Allow clearing the oauth section and going back to discovery -->\n <ScalarButton\n v-if=\"scheme.type === 'openIdConnect'\"\n class=\"mr-1 p-0 px-2 py-0.5\"\n :disabled=\"loader.isLoading\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"clearOauth2Secrets\">\n Clear\n </ScalarButton>\n\n <ScalarButton\n class=\"mr-0.75 p-0 px-2 py-0.5\"\n :loader\n size=\"sm\"\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JtE,YAIsE,0BAAA;MAHnE,MAAA,KAAA;MACA,UAAU,QAAA;MACV,gBAAA,eAAA;MACA,2BAAqB,OAAA,QAAA,OAAA,OAAG,MAAM,MAAK,yBAA0B,EAAC;;;;;;;;IAGnE,YAsBe,MAAA,qBAAA,EAAA,EAtBD,OAAM,cAAY,EAAA;4BAqBxB,CApBN,mBAoBM,OApBN,YAoBM,CAjBI,QAAA,OAAO,SAAI,mBAAA,WAAA,EADnB,YAQe,MAAA,aAAA,EAAA;;MANb,OAAM;MACL,UAAU,MAAA,OAAM,CAAC;MAClB,MAAK;MACL,SAAQ;MACP,SAAO;;6BAEV,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAF8B,WAE9B,GAAA,CAAA,EAAA,CAAA;;0DAEA,YAOe,MAAA,aAAA,EAAA;MANb,OAAM;MACL,QAAA,MAAA,OAAM;MACP,MAAK;MACL,SAAQ;MACP,SAAO;;6BAEV,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAF2B,eAE3B,GAAA,CAAA,EAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"OAuth2.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Any config options required for the OAuth2 flow */\nexport type OAuth2Options = Pick<ApiClientConfiguration, 'oauth2RedirectUri'>\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton, useLoadingState } from '@scalar/components'\nimport type { ApiClientConfiguration } from '@scalar/types/api-reference'\nimport { pkceOptions } from '@scalar/types/entities'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { SecretsOAuthFlows } from '@scalar/workspace-store/entities/auth'\nimport type {\n ApiReferenceEvents,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport {\n getEnvironmentVariables,\n type OAuthFlowAuthorizationCodeSecret,\n type OAuthFlowClientCredentialsSecret,\n type OAuthFlowPasswordSecret,\n type OAuthFlowsObjectSecret,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCredentialsLocation } from '@scalar/workspace-store/schemas/extensions/security/x-scalar-credentials-location'\nimport { type XusePkce } from '@scalar/workspace-store/schemas/extensions/security/x-use-pkce'\nimport type {\n OAuthFlow,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, watch } from 'vue'\n\nimport OAuthScopesInput from '@/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue'\nimport {\n authorizeOauth2,\n refreshOauth2Token,\n} from '@/v2/blocks/scalar-auth-selector-block/helpers/oauth'\nimport { resolveDefaultOAuth2RedirectUri } from '@/v2/blocks/scalar-auth-selector-block/helpers/resolve-default-oauth2-redirect-url'\nimport { DataTableRow } from '@/v2/components/data-table'\n\nimport RequestAuthDataTableInput from './RequestAuthDataTableInput.vue'\n\nconst {\n environment,\n flows,\n type,\n scheme,\n selectedScopes: selectedScopesProp,\n server,\n proxyUrl,\n eventBus,\n name,\n options = {},\n} = defineProps<{\n /** Current environment configuration */\n environment: XScalarEnvironment\n /** OAuth flows */\n flows: OAuthFlowsObjectSecret\n /** Type of the OAuth flow */\n type: keyof OAuthFlowsObjectSecret\n /** Selected scopes */\n selectedScopes: string[]\n /** Security scheme */\n scheme: SecuritySchemeObjectSecret\n /** Current server configuration */\n server: ServerObject | null\n /** Proxy URL */\n proxyUrl: string\n /** Name of the security scheme */\n name: string\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n}>()\n\nconst emits = defineEmits<{\n (e: 'update:selectedScopes', payload: { scopes: string[] }): void\n (\n e: 'upsert:scope',\n payload: Omit<ApiReferenceEvents['auth:upsert:scopes'], 'name'>,\n ): void\n (\n e: 'delete:scope',\n payload: Omit<ApiReferenceEvents['auth:delete:scopes'], 'name'>,\n ): void\n}>()\n\nconst loader = useLoadingState()\nconst { toast } = useToasts()\n\n/** The current OAuth flow based on the selected type */\nconst flow = computed(() => flows[type]!)\ntype NonImplicitFlow =\n | OAuthFlowPasswordSecret\n | OAuthFlowClientCredentialsSecret\n | OAuthFlowAuthorizationCodeSecret\n\n/** We filter selected scopes to only include scopes that are defined on this flow (own keys only). */\nconst selectedScopes = computed(() => {\n const definedScopes = flow.value.scopes\n if (!definedScopes) {\n return []\n }\n return selectedScopesProp.filter((scope) =>\n Object.hasOwn(definedScopes, scope),\n )\n})\n\n/**\n * PKCE public clients do not use a client_secret. Hide the field when the\n * document enables PKCE so readers are not prompted for an unused secret.\n */\nconst showClientSecret = computed(() => {\n if (!('x-scalar-secret-client-secret' in flow.value)) {\n return false\n }\n const pkceMode =\n 'x-usePkce' in flow.value ? flow.value['x-usePkce'] : undefined\n return pkceMode !== 'SHA-256' && pkceMode !== 'plain'\n})\n\nconst clientSecretValue = computed((): string => {\n const f = flow.value as { 'x-scalar-secret-client-secret'?: string }\n return f['x-scalar-secret-client-secret'] ?? ''\n})\n\n/** Updates the security scheme base */\nconst handleOauth2Update = (\n payload: Partial<OAuthFlow & XScalarCredentialsLocation>,\n): void => {\n // OpenIdConnect uses the secrets update for all\n if (scheme.type === 'openIdConnect') {\n return handleOauth2SecretsUpdate(payload)\n }\n\n eventBus.emit('auth:update:security-scheme', {\n payload: {\n type: scheme.type,\n flows: {\n [type]: payload,\n },\n },\n name,\n })\n}\n\n/** Updates the flow secrets */\nconst handleOauth2SecretsUpdate = (\n payload: Omit<Partial<SecretsOAuthFlows[keyof SecretsOAuthFlows]>, 'type'>,\n): void =>\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: {\n type: scheme.type,\n [type]: payload,\n },\n name,\n })\n\n/** Clears the flow secrets */\nconst clearOauth2Secrets = (): void => {\n if (loader.isLoading) {\n return\n }\n eventBus.emit('auth:clear:security-scheme-secrets', {\n name,\n })\n}\n\n/** Clears stored access and refresh tokens (authorized state) */\nconst handleClearAccessTokens = (): void => {\n if (loader.isLoading) {\n return\n }\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': '',\n 'x-scalar-secret-refresh-token': '',\n })\n}\n\n/** Track redirect URI prefill per flow instance to support document switching */\nconst prefilledFlowIdentity = ref<string | null>(null)\nconst hasHandledRedirectPrefill = ref(false)\n\nconst resolveFlowIdentity = (\n currentFlow: OAuthFlowsObjectSecret[keyof OAuthFlowsObjectSecret] | undefined,\n): string =>\n JSON.stringify({\n type,\n authorizationUrl:\n currentFlow && 'authorizationUrl' in currentFlow\n ? currentFlow.authorizationUrl\n : '',\n tokenUrl:\n currentFlow && 'tokenUrl' in currentFlow ? currentFlow.tokenUrl : '',\n refreshUrl: currentFlow?.refreshUrl ?? '',\n scopes: Object.keys(currentFlow?.scopes ?? {}),\n })\n\n/** Default the redirect-uri to the current origin if we have access to window */\nwatch(\n () => flow.value,\n (currentFlow) => {\n if (!currentFlow || !('x-scalar-secret-redirect-uri' in currentFlow)) {\n return\n }\n\n const flowIdentity = resolveFlowIdentity(currentFlow)\n if (prefilledFlowIdentity.value !== flowIdentity) {\n prefilledFlowIdentity.value = flowIdentity\n hasHandledRedirectPrefill.value = false\n }\n\n if (hasHandledRedirectPrefill.value) {\n return\n }\n\n const newRedirectUri = (currentFlow as OAuthFlowAuthorizationCodeSecret)[\n 'x-scalar-secret-redirect-uri'\n ]\n const defaultRedirectUri = resolveDefaultOAuth2RedirectUri(options)\n\n hasHandledRedirectPrefill.value = true\n\n if (newRedirectUri || !defaultRedirectUri) {\n return\n }\n\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-redirect-uri': defaultRedirectUri,\n })\n },\n { immediate: true },\n)\n\n/**\n * Authorizes the user using the specified OAuth flow.\n * Opens the appropriate OAuth dialog and/or performs the token exchange.\n */\nconst handleAuthorize = async (): Promise<void> => {\n if (loader.isLoading) {\n return\n }\n\n loader.start()\n\n const [error, tokens] = await authorizeOauth2(\n flows,\n type,\n selectedScopes.value,\n server,\n proxyUrl,\n getEnvironmentVariables(environment),\n )\n\n await loader.clear()\n\n if (tokens?.accessToken) {\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': tokens.accessToken,\n ...(tokens.refreshToken\n ? { 'x-scalar-secret-refresh-token': tokens.refreshToken }\n : {}),\n })\n } else {\n console.error(error)\n toast(error?.message ?? 'Failed to authorize', 'error')\n }\n}\n\n/** Whether the current flow supports refreshing the access token */\nconst supportsRefreshToken = computed(() => type !== 'implicit')\n\n/**\n * Refresh URL placeholder, shows tokenUrl as hint if refreshUrl is not specified.\n * This helps users understand that tokenUrl will be used as fallback.\n */\nconst refreshUrlPlaceholder = computed(() => {\n if ('tokenUrl' in flow.value && flow.value.tokenUrl) {\n return flow.value.tokenUrl\n }\n return 'https://galaxy.scalar.com/oauth/refresh'\n})\n\n/**\n * Uses the stored refresh token to obtain a new access token\n * via grant_type=refresh_token.\n */\nconst handleRefresh = async (): Promise<void> => {\n if (loader.isLoading || type === 'implicit') {\n return\n }\n\n loader.start()\n\n const [error, tokens] = await refreshOauth2Token(\n flows,\n type,\n proxyUrl,\n server,\n getEnvironmentVariables(environment),\n )\n\n await loader.clear()\n\n if (tokens?.accessToken) {\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': tokens.accessToken,\n ...(tokens.refreshToken\n ? { 'x-scalar-secret-refresh-token': tokens.refreshToken }\n : {}),\n })\n } else {\n console.error(error)\n toast(error?.message ?? 'Failed to refresh token', 'error')\n }\n}\n\n/** Updates the secret location */\nconst handleSecretLocationUpdate = (value: string): void => {\n const credentialsLocation = value === 'body' ? 'body' : 'header'\n\n if (scheme.type !== 'openIdConnect') {\n handleOauth2Update({\n 'x-scalar-credentials-location': credentialsLocation,\n })\n }\n\n handleOauth2SecretsUpdate({\n 'x-scalar-credentials-location': credentialsLocation,\n })\n}\n</script>\n\n<template>\n <!-- Access Token Display: Shows when user is already authorized -->\n <template v-if=\"Boolean(flow['x-scalar-secret-token'])\">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"border-r-transparent\"\n :environment\n :modelValue=\"flow['x-scalar-secret-token']\"\n placeholder=\"QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT\"\n type=\"password\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-token': v })\n \">\n Access Token\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"supportsRefreshToken\">\n <RequestAuthDataTableInput\n class=\"border-r-transparent\"\n :environment\n :modelValue=\"flow.refreshUrl ?? ''\"\n :placeholder=\"refreshUrlPlaceholder\"\n @update:modelValue=\"(v) => handleOauth2Update({ refreshUrl: v })\">\n Refresh URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow class=\"min-w-full\">\n <div class=\"flex h-8 items-center justify-end gap-2 border-t\">\n <ScalarButton\n v-if=\"supportsRefreshToken\"\n class=\"p-0 px-2 py-0.5\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleRefresh\">\n Refresh\n </ScalarButton>\n <ScalarButton\n class=\"mr-1 p-0 px-2 py-0.5\"\n :disabled=\"loader.isLoading\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleClearAccessTokens\">\n Clear\n </ScalarButton>\n </div>\n </DataTableRow>\n </template>\n\n <!-- Authorization Form: Shows when user needs to authorize -->\n <template v-else>\n <DataTableRow>\n <RequestAuthDataTableInput\n v-if=\"'authorizationUrl' in flow\"\n containerClass=\"border-r-0\"\n :environment\n :modelValue=\"flow['x-scalar-secret-auth-url'] ?? ''\"\n placeholder=\"https://galaxy.scalar.com/authorize\"\n @update:modelValue=\"\n (v) => {\n handleOauth2SecretsUpdate({ 'x-scalar-secret-auth-url': v })\n handleOauth2Update({ authorizationUrl: v })\n }\n \">\n Auth URL\n </RequestAuthDataTableInput>\n\n <RequestAuthDataTableInput\n v-if=\"'tokenUrl' in flow\"\n :environment\n :modelValue=\"flow['x-scalar-secret-token-url'] ?? ''\"\n placeholder=\"https://galaxy.scalar.com/token\"\n @update:modelValue=\"\n (v) => {\n handleOauth2SecretsUpdate({ 'x-scalar-secret-token-url': v })\n handleOauth2Update({ tokenUrl: v })\n }\n \">\n Token URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-scalar-secret-redirect-uri' in flow\">\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-redirect-uri']\"\n placeholder=\"Optional redirect URL\"\n @update:modelValue=\"\n (v) => {\n hasHandledRedirectPrefill = true\n handleOauth2SecretsUpdate({ 'x-scalar-secret-redirect-uri': v })\n }\n \">\n Redirect URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <template\n v-if=\"\n 'x-scalar-secret-username' in flow && 'x-scalar-secret-password' in flow\n \">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"text-c-2\"\n :environment\n :modelValue=\"flow['x-scalar-secret-username']\"\n placeholder=\"janedoe\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-username': v })\n \">\n Username\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-password']\"\n placeholder=\"********\"\n type=\"password\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-password': v })\n \">\n Password\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-client-id']\"\n placeholder=\"12345\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-client-id': v })\n \">\n Client ID\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"showClientSecret\">\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"clientSecretValue\"\n placeholder=\"XYZ123\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleOauth2SecretsUpdate({ 'x-scalar-secret-client-secret': v })\n \">\n Client Secret\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-usePkce' in flow\">\n <RequestAuthDataTableInput\n :enum=\"pkceOptions\"\n :environment\n :modelValue=\"flow['x-usePkce']\"\n readOnly\n @update:modelValue=\"\n (v) =>\n handleOauth2Update({\n 'x-usePkce': v as XusePkce['x-usePkce'],\n })\n \">\n Use PKCE\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- Credentials Location -->\n <DataTableRow v-if=\"type !== 'implicit'\">\n <RequestAuthDataTableInput\n :enum=\"['header', 'body']\"\n :environment\n :modelValue=\"\n (flow as NonImplicitFlow)['x-scalar-credentials-location'] || 'header'\n \"\n placeholder=\"header\"\n readOnly\n @update:modelValue=\"(v) => handleSecretLocationUpdate(v)\">\n Credentials Location\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- Scopes -->\n <DataTableRow>\n <OAuthScopesInput\n :flow\n :flowType=\"type\"\n :selectedScopes\n @update:selectedScopes=\"(v) => emits('update:selectedScopes', v)\"\n @upsert:scope=\"(v) => emits('upsert:scope', v)\"\n @delete:scope=\"(v) => emits('delete:scope', v)\" />\n </DataTableRow>\n\n <DataTableRow class=\"min-w-full\">\n <div class=\"flex h-8 w-full items-center justify-end border-t\">\n <!-- Allow clearing the oauth section and going back to discovery -->\n <ScalarButton\n v-if=\"scheme.type === 'openIdConnect'\"\n class=\"mr-1 p-0 px-2 py-0.5\"\n :disabled=\"loader.isLoading\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"clearOauth2Secrets\">\n Clear\n </ScalarButton>\n\n <ScalarButton\n class=\"mr-0.75 p-0 px-2 py-0.5\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleAuthorize\">\n Authorize\n </ScalarButton>\n </div>\n </DataTableRow>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4EA,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AG,MAAM,2BAA2B,EAAC;;6BAEzD,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAF4D,0BAE5D,GAAA,CAAA,EAAA,CAAA;;;;;IAIF,YAQe,MAAA,qBAAA,EAAA,MAAA;4BADuC,CANpD,YAMoD,0BAAA;MALjD,MAAA,KAAA;MACA,UAAU,QAAA;MACV,gBAAA,eAAA;MACA,2BAAqB,OAAA,QAAA,OAAA,OAAG,MAAM,MAAK,yBAA0B,EAAC;MAC9D,kBAAY,OAAA,QAAA,OAAA,OAAG,MAAM,MAAK,gBAAiB,EAAC;MAC5C,kBAAY,OAAA,QAAA,OAAA,OAAG,MAAM,MAAK,gBAAiB,EAAC;;;;;;;;IAGjD,YAsBe,MAAA,qBAAA,EAAA,EAtBD,OAAM,cAAY,EAAA;4BAqBxB,CApBN,mBAoBM,OApBN,YAoBM,CAjBI,QAAA,OAAO,SAAI,mBAAA,WAAA,EADnB,YAQe,MAAA,aAAA,EAAA;;MANb,OAAM;MACL,UAAU,MAAA,OAAM,CAAC;MAClB,MAAK;MACL,SAAQ;MACP,SAAO;;6BAEV,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAF8B,WAE9B,GAAA,CAAA,EAAA,CAAA;;0DAEA,YAOe,MAAA,aAAA,EAAA;MANb,OAAM;MACL,QAAA,MAAA,OAAM;MACP,MAAK;MACL,SAAQ;MACP,SAAO;;6BAEV,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAF2B,eAE3B,GAAA,CAAA,EAAA,CAAA"}
|
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
import { type ModalState } from '@scalar/components';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
state: ModalState;
|
|
4
|
+
/** Existing scope names on the flow, used to prevent duplicates */
|
|
4
5
|
scopes: string[];
|
|
6
|
+
/**
|
|
7
|
+
* When provided, the modal switches to "edit" mode and is prefilled with this scope.
|
|
8
|
+
* The original name is retained so the consumer can rename it.
|
|
9
|
+
*/
|
|
10
|
+
scope?: {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
} | null;
|
|
5
14
|
};
|
|
6
15
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
7
|
-
cancel: () => any;
|
|
8
16
|
submit: (scopeData: {
|
|
9
17
|
name: string;
|
|
10
18
|
description: string;
|
|
19
|
+
/** The original name on the flow, only set when editing an existing scope */
|
|
20
|
+
oldName?: string;
|
|
11
21
|
}) => any;
|
|
22
|
+
cancel: () => any;
|
|
12
23
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
-
onCancel?: (() => any) | undefined;
|
|
14
24
|
onSubmit?: ((scopeData: {
|
|
15
25
|
name: string;
|
|
16
26
|
description: string;
|
|
27
|
+
/** The original name on the flow, only set when editing an existing scope */
|
|
28
|
+
oldName?: string;
|
|
17
29
|
}) => any) | undefined;
|
|
30
|
+
onCancel?: (() => any) | undefined;
|
|
18
31
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
32
|
declare const _default: typeof __VLS_export;
|
|
20
33
|
export default _default;
|
package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuthScopesAddModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OAuthScopesAddModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue"],"names":[],"mappings":"AAyKA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAQjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,mEAAmE;IACnE,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CACrD,CAAC;AAkQF,QAAA,MAAM,YAAY;;cArPN,MAAM;qBACC,MAAM;QACnB,6EAA6E;kBACnE,MAAM;;;;;cAHV,MAAM;qBACC,MAAM;QACnB,6EAA6E;kBACnE,MAAM;;;kFAqPpB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
2
1
|
import OAuthScopesAddModal_vue_vue_type_script_setup_true_lang_default from "./OAuthScopesAddModal.vue.script.js";
|
|
3
|
-
/* empty css */
|
|
4
2
|
//#region src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue
|
|
5
|
-
var OAuthScopesAddModal_default =
|
|
3
|
+
var OAuthScopesAddModal_default = OAuthScopesAddModal_vue_vue_type_script_setup_true_lang_default;
|
|
6
4
|
//#endregion
|
|
7
5
|
export { OAuthScopesAddModal_default as default };
|
|
8
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuthScopesAddModal.vue.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components'\nimport {
|
|
1
|
+
{"version":3,"file":"OAuthScopesAddModal.vue.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components'\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport {\n CommandActionForm,\n CommandActionInput,\n} from '@/v2/features/command-palette'\n\nconst {\n state,\n scopes,\n scope = null,\n} = defineProps<{\n state: ModalState\n /** Existing scope names on the flow, used to prevent duplicates */\n scopes: string[]\n /**\n * When provided, the modal switches to \"edit\" mode and is prefilled with this scope.\n * The original name is retained so the consumer can rename it.\n */\n scope?: { name: string; description: string } | null\n}>()\n\nconst emit = defineEmits<{\n (event: 'cancel'): void\n (\n event: 'submit',\n scopeData: {\n name: string\n description: string\n /** The original name on the flow, only set when editing an existing scope */\n oldName?: string\n },\n ): void\n}>()\n\nconst isEditMode = computed(() => scope !== null)\nconst title = computed(() => (isEditMode.value ? 'Edit Scope' : 'Add Scope'))\nconst submitLabel = computed(() => (isEditMode.value ? 'Save' : 'Add Scope'))\n\nconst scopeData = ref({\n name: '',\n description: '',\n})\n\n/**\n * Tracks whether the user has interacted with the name field so we can defer the\n * \"name is required\" hint until after the first edit, rather than on initial render.\n */\nconst hasTouchedName = ref(false)\n\nwatch(\n () => scopeData.value.name,\n () => {\n hasTouchedName.value = true\n },\n)\n\nconst trimmedName = computed(() => scopeData.value.name.trim())\n\n/**\n * Whether the chosen name collides with an existing scope on the flow.\n * In edit mode we allow keeping the original name unchanged.\n */\nconst isDuplicateName = computed(() => {\n if (!trimmedName.value) {\n return false\n }\n if (isEditMode.value && trimmedName.value === scope?.name) {\n return false\n }\n return scopes.includes(trimmedName.value)\n})\n\n/** Human readable validation message rendered inline in the modal */\nconst validationError = computed<string | null>(() => {\n if (isDuplicateName.value) {\n return `A scope named \"${trimmedName.value}\" already exists.`\n }\n if (hasTouchedName.value && !trimmedName.value) {\n return 'Scope name is required.'\n }\n return null\n})\n\nconst isSubmitDisabled = computed(\n () => !trimmedName.value || isDuplicateName.value,\n)\n\nconst handleSubmit = () => {\n if (isSubmitDisabled.value) {\n return\n }\n\n emit('submit', {\n name: trimmedName.value,\n description: scopeData.value.description,\n ...(isEditMode.value && scope ? { oldName: scope.name } : {}),\n })\n state.hide()\n}\n\nwatch(\n () => state.open,\n (isOpen) => {\n if (!isOpen) {\n return\n }\n\n scopeData.value = scope\n ? { name: scope.name, description: scope.description }\n : { name: '', description: '' }\n // Clearing `name` schedules the `scopeData.name` watcher, which sets\n // `hasTouchedName` back to true in the same flush. Defer the reset so it\n // runs after that watcher and reopening add mode does not show a false\n // \"Scope name is required\" error.\n void nextTick(() => {\n hasTouchedName.value = false\n })\n },\n)\n</script>\n\n<template>\n <ScalarModal\n bodyClass=\"overflow-y-auto\"\n size=\"xs\"\n :state=\"state\"\n :title=\"title\">\n <CommandActionForm\n :disabled=\"isSubmitDisabled\"\n @cancel=\"emit('cancel')\"\n @submit=\"handleSubmit\">\n <!-- Name -->\n <div class=\"flex min-h-8 items-start gap-2 text-sm\">\n Name:\n <CommandActionInput\n v-model=\"scopeData.name\"\n autofocus\n class=\"field-sizing-content !p-0\"\n placeholder=\"read:user\" />\n </div>\n\n <!-- Description -->\n <div class=\"flex min-h-8 items-start gap-2 text-sm\">\n Description:\n <CommandActionInput\n v-model=\"scopeData.description\"\n :autofocus=\"false\"\n class=\"field-sizing-content !p-0\"\n placeholder=\"Read user data\" />\n </div>\n\n <!-- Inline validation error -->\n <div\n v-if=\"validationError\"\n class=\"text-red text-xs\"\n role=\"alert\">\n {{ validationError }}\n </div>\n\n <template #submit>{{ submitLabel }}</template>\n </CommandActionForm>\n </ScalarModal>\n</template>\n"],"mappings":""}
|