@scalar/api-client 2.18.0 → 2.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +85 -0
- package/dist/components/AddressBar/AddressBar.vue2.js +52 -52
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +15 -15
- package/dist/components/AddressBar/httpStatusCodeColors.d.ts +0 -33
- package/dist/components/AddressBar/httpStatusCodeColors.d.ts.map +1 -1
- package/dist/components/AddressBar/httpStatusCodeColors.js +0 -1
- package/dist/components/CodeInput/CodeInput.vue2.js +112 -112
- package/dist/components/CommandPalette/CommandActionForm.vue.js +18 -18
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +25 -25
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +0 -1
- package/dist/components/CommandPalette/WatchModeToggle.vue.js +14 -14
- package/dist/components/DataTable/DataTable.vue.js +17 -17
- package/dist/components/DataTable/DataTableCell.vue.js +9 -9
- package/dist/components/DataTable/DataTableCheckbox.vue.js +17 -17
- package/dist/components/DataTable/DataTableInput.vue2.js +48 -48
- package/dist/components/DataTable/DataTableInputSelect.vue.js +35 -35
- package/dist/components/DataTable/DataTableText.vue.js +10 -10
- package/dist/components/Form/Form.vue.js +32 -32
- package/dist/components/Form/LabelInput.vue2.js +15 -15
- package/dist/components/HelpfulLink.vue.js +7 -7
- package/dist/components/HttpMethod/HttpMethod.vue2.js +22 -22
- package/dist/components/IconSelector.vue.js +16 -16
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +50 -50
- package/dist/components/ImportCollection/ImportNowButton.vue.js +23 -23
- package/dist/components/ImportCollection/PrefetchError.vue.js +8 -8
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +0 -7
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +16 -16
- package/dist/components/SectionFilter.vue2.js +21 -21
- package/dist/components/SectionFilterButton.vue.js +7 -7
- package/dist/components/Server/ServerDropdown.vue.js +32 -32
- package/dist/components/Server/ServerDropdownItem.vue2.js +39 -39
- package/dist/components/Server/ServerSelector.vue.js +27 -27
- package/dist/components/Server/ServerVariablesForm.vue.js +26 -26
- package/dist/components/Server/ServerVariablesSelect.vue.js +21 -21
- package/dist/components/Server/ServerVariablesTextbox.vue.js +10 -10
- package/dist/components/Server/types.d.ts +2 -1
- package/dist/components/Server/types.d.ts.map +1 -1
- package/dist/components/SideNav/SideNavLink.vue.js +18 -18
- package/dist/components/SideNav/SideNavRouterLink.vue.js +13 -13
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +11 -11
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +16 -16
- package/dist/components/Sidebar/Sidebar.vue2.js +28 -28
- package/dist/components/Sidebar/SidebarButton.vue.js +12 -12
- package/dist/components/Sidebar/SidebarListElement.vue2.js +34 -34
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +33 -33
- package/dist/components/TopNav/TopNavItem.vue2.js +41 -41
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +43 -43
- package/dist/data/httpHeaders.d.ts +2 -1
- package/dist/data/httpHeaders.d.ts.map +1 -1
- package/dist/hooks/useClientConfig.js +1 -1
- package/dist/hooks/useLayout.js +1 -1
- package/dist/hooks/useSidebar.js +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/plugins/hooks/usePluginManager.d.ts +1 -1
- package/dist/plugins/hooks/usePluginManager.d.ts.map +1 -1
- package/dist/plugins/hooks/usePluginManager.js +5 -5
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +5 -5
- package/dist/plugins/plugin-manager.d.ts +0 -2
- package/dist/plugins/plugin-manager.d.ts.map +1 -1
- package/dist/routes.d.ts +0 -10
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +0 -1
- package/dist/store/active-entities.js +1 -1
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +44 -44
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +20 -20
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +14 -14
- package/dist/v2/blocks/operation-block/helpers/get-delimiter.js +0 -2
- package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue.js +12 -12
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +65 -65
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +2 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +6 -6
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.d.ts +4 -3
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.js +9 -7
- 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 +40 -32
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts +1 -3
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +0 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +144 -149
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +25 -45
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +90 -139
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts +22 -0
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js +77 -0
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue2.js +4 -0
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +4 -4
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js +34 -34
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +6 -6
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +3 -3
- package/dist/v2/blocks/request-block/components/RequestTable.vue2.js +30 -32
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +2 -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 +64 -64
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue2.js +29 -29
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +2 -2
- 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 +12 -13
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts +8 -0
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +9 -0
- package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +3 -1
- package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +9 -8
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +67 -67
- package/dist/v2/blocks/response-block/components/Headers.vue.js +35 -35
- package/dist/v2/blocks/response-block/components/ResponseBody.vue2.js +24 -24
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.js +10 -10
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue2.js +24 -24
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.js +10 -10
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +11 -11
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +14 -14
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue2.js +11 -11
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js +33 -33
- package/dist/v2/blocks/response-block/helpers/media-types.d.ts +3 -6
- package/dist/v2/blocks/response-block/helpers/media-types.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/helpers/media-types.js +0 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +72 -72
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue2.js +9 -9
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.d.ts +0 -33
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +83 -82
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js +10 -10
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +121 -121
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue2.js +13 -13
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +33 -33
- 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 +26 -26
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +26 -26
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -2
- 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 +130 -122
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +0 -21
- 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 +1 -3
- package/dist/v2/components/code-input/CodeInput.vue2.js +93 -93
- package/dist/v2/components/data-table/DataTable.vue.js +17 -17
- package/dist/v2/components/data-table/DataTableCell.vue.js +9 -9
- package/dist/v2/components/data-table/DataTableCheckbox.vue.js +17 -17
- package/dist/v2/components/data-table/DataTableInput.vue2.js +48 -48
- package/dist/v2/components/data-table/DataTableInputSelect.vue.js +35 -35
- package/dist/v2/components/data-table/DataTableText.vue.js +10 -10
- package/dist/v2/components/forms/ConfirmationForm.vue.js +13 -13
- package/dist/v2/components/layout/CollapsibleSection.vue.js +42 -42
- package/dist/v2/components/modals/DeleteModal.vue.js +13 -13
- package/dist/v2/components/resize/Resize.vue2.js +11 -11
- package/dist/v2/components/server/ServerDropdown.vue.js +30 -30
- package/dist/v2/components/server/ServerDropdownItem.vue2.js +27 -27
- package/dist/v2/components/sidebar/Sidebar.vue.js +32 -32
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +20 -20
- package/dist/v2/features/app/App.vue.js +25 -25
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +55 -61
- package/dist/v2/features/app/components/AppSidebar.vue2.js +97 -97
- package/dist/v2/features/app/components/CreateWorkspaceModal.vue.js +20 -20
- package/dist/v2/features/app/components/DesktopTab.vue2.js +59 -59
- package/dist/v2/features/app/components/DesktopTabs.vue.js +22 -22
- package/dist/v2/features/app/components/SidebarItemMenu.vue.js +6 -6
- package/dist/v2/features/app/components/WebTopNav.vue.js +9 -9
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -5
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.js +1 -2
- package/dist/v2/features/app/helpers/routes.d.ts +5 -1
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +31 -31
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +17 -17
- package/dist/v2/features/collection/components/Authentication.vue2.js +18 -18
- package/dist/v2/features/collection/components/Cookies.vue.js +10 -10
- package/dist/v2/features/collection/components/Environment.vue.js +10 -10
- package/dist/v2/features/collection/components/Form.vue.js +21 -21
- package/dist/v2/features/collection/components/Overview.vue2.js +25 -25
- package/dist/v2/features/collection/components/Servers.vue.js +37 -37
- package/dist/v2/features/collection/components/Settings.vue.js +22 -22
- package/dist/v2/features/collection/components/Tabs.vue.js +18 -18
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.js +20 -20
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.js +17 -17
- package/dist/v2/features/command-palette/components/TheCommandPalette.vue2.js +68 -68
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue.js +11 -11
- package/dist/v2/features/command-palette/helpers/get-openapi-document-details.d.ts +2 -1
- package/dist/v2/features/command-palette/helpers/get-openapi-document-details.d.ts.map +1 -1
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.d.ts +2 -1
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.d.ts.map +1 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +3 -3
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +0 -1
- package/dist/v2/features/command-palette/types.d.ts +11 -10
- package/dist/v2/features/command-palette/types.d.ts.map +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue.js +36 -36
- package/dist/v2/features/environments/components/Environment.vue.js +16 -16
- package/dist/v2/features/environments/components/EnvironmentColors.vue.js +37 -37
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js +19 -19
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js +14 -14
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js +24 -24
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue2.js +58 -58
- package/dist/v2/features/global-cookies/components/CookiesTable.vue2.js +23 -23
- package/dist/v2/features/modal/Modal.vue.d.ts +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +1 -1
- package/dist/v2/features/modal/Modal.vue2.js +57 -56
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +5 -4
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -1
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +17 -21
- package/dist/v2/features/operation/Operation.vue.d.ts +5 -1
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +41 -39
- package/dist/v2/features/search/components/SearchButton.vue.js +40 -40
- package/dist/v2/features/search/components/SearchModal.vue2.js +43 -43
- package/dist/v2/features/search/components/SearchResult.vue.js +34 -34
- package/dist/v2/features/search/types.d.ts +5 -4
- package/dist/v2/features/search/types.d.ts.map +1 -1
- package/dist/v2/features/settings/CollectionSettings.vue.js +51 -51
- package/dist/v2/features/settings/DocumentSettings.vue.js +25 -25
- package/dist/v2/features/settings/components/Appearance.vue.js +27 -27
- package/dist/v2/helpers/handle-hotkeys.d.ts +1 -12
- package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +0 -2
- package/dist/v2/helpers/plugins.d.ts +2 -2
- package/dist/v2/helpers/plugins.d.ts.map +1 -1
- package/dist/views/Collection/CollectionNavigation.vue.js +13 -13
- package/dist/views/Collection/components/EnvironmentForm.vue2.js +114 -114
- package/dist/views/Collection/components/MarkdownInput.vue2.js +31 -31
- package/dist/views/Cookies/CookieModal.vue2.js +26 -26
- package/dist/views/Environment/EnvironmentColorModal.vue.js +10 -10
- package/dist/views/Environment/EnvironmentColors.vue.js +56 -56
- package/dist/views/Environment/EnvironmentModal.vue.js +26 -26
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +24 -24
- package/dist/views/Request/Request.vue2.js +55 -55
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +17 -17
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +102 -102
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +27 -27
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +91 -91
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +36 -36
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +101 -101
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +154 -154
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +35 -35
- package/dist/views/Request/RequestSection/RequestParams.vue.js +81 -81
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +47 -47
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +90 -90
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +111 -111
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +29 -29
- package/dist/views/Request/RequestSection/index.d.ts +1 -1
- package/dist/views/Request/RequestSection/index.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/index.js +4 -4
- package/dist/views/Request/RequestSidebarItem.vue2.js +149 -149
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +79 -79
- package/dist/views/Request/RequestSubpageHeader.vue2.js +30 -30
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +29 -29
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +37 -37
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +10 -10
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +24 -24
- package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue.js +10 -10
- package/dist/views/Request/ResponseSection/ResponseCookies.vue.js +16 -16
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +21 -21
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +30 -30
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +37 -37
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +61 -61
- package/package.json +24 -24
- package/dist/components/ImportCollection/OpenAppButton.vue.d.ts +0 -6
- package/dist/components/ImportCollection/OpenAppButton.vue.d.ts.map +0 -1
- package/dist/components/ImportCollection/OperationBadge.vue.d.ts +0 -8
- package/dist/components/ImportCollection/OperationBadge.vue.d.ts.map +0 -1
- package/dist/components/ScreenReader.vue.d.ts +0 -20
- package/dist/components/ScreenReader.vue.d.ts.map +0 -1
- package/dist/components/SideNav/WorkspaceProfileIcon.vue.d.ts +0 -9
- package/dist/components/SideNav/WorkspaceProfileIcon.vue.d.ts.map +0 -1
- package/dist/views/Components/RequestBodies/RequestBodies.vue.d.ts +0 -3
- package/dist/views/Components/RequestBodies/RequestBodies.vue.d.ts.map +0 -1
- package/dist/views/Request/RequestSection/types/post-response.d.ts +0 -7
- package/dist/views/Request/RequestSection/types/post-response.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as R, computed as
|
|
1
|
+
import { defineComponent as R, computed as r, ref as a, onMounted as C, onBeforeUnmount as U, watch as k, createElementBlock as E, openBlock as b, createElementVNode as O, createVNode as n, withCtx as B, unref as c } from "vue";
|
|
2
2
|
import { AVAILABLE_CLIENTS as V } from "@scalar/types/snippetz";
|
|
3
3
|
import { useToasts as K } from "@scalar/use-toasts";
|
|
4
4
|
import w from "../../../components/ViewLayout/ViewLayout.vue.js";
|
|
@@ -47,54 +47,54 @@ const z = { class: "bg-b-1 flex h-full flex-col" }, F = { class: "lg:min-h-heade
|
|
|
47
47
|
proxyUrl: {}
|
|
48
48
|
},
|
|
49
49
|
emits: ["update:servers"],
|
|
50
|
-
setup(
|
|
51
|
-
const
|
|
52
|
-
() => j(
|
|
53
|
-
), d =
|
|
50
|
+
setup(e, { emit: g }) {
|
|
51
|
+
const x = g, q = r(() => $(e.httpClients)), m = r(
|
|
52
|
+
() => j(e.documentSecurity, e.operation.security)
|
|
53
|
+
), d = r(
|
|
54
54
|
() => D(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
e.documentSelectedSecurity,
|
|
56
|
+
e.operation["x-scalar-selected-security"],
|
|
57
|
+
m.value,
|
|
58
|
+
e.setOperationSecurity
|
|
59
59
|
)
|
|
60
|
-
), v =
|
|
61
|
-
() => T(
|
|
62
|
-
), { toast: y } = K(), h = a(null), u = a(null), l = a(null),
|
|
63
|
-
const [
|
|
64
|
-
environment:
|
|
65
|
-
exampleKey:
|
|
66
|
-
globalCookies:
|
|
67
|
-
method:
|
|
68
|
-
operation:
|
|
69
|
-
path:
|
|
60
|
+
), v = r(
|
|
61
|
+
() => T(e.securitySchemes, d.value.selectedSchemes)
|
|
62
|
+
), { toast: y } = K(), h = a(null), u = a(null), l = a(null), f = () => h.value?.abort(M.REQUEST_ABORTED), o = async () => {
|
|
63
|
+
const [s, t] = L({
|
|
64
|
+
environment: e.environment,
|
|
65
|
+
exampleKey: e.exampleKey,
|
|
66
|
+
globalCookies: e.globalCookies,
|
|
67
|
+
method: e.method,
|
|
68
|
+
operation: e.operation,
|
|
69
|
+
path: e.path,
|
|
70
70
|
selectedSecuritySchemes: v.value,
|
|
71
|
-
server:
|
|
72
|
-
proxyUrl:
|
|
71
|
+
server: e.server,
|
|
72
|
+
proxyUrl: e.proxyUrl
|
|
73
73
|
});
|
|
74
|
-
if (
|
|
75
|
-
y(
|
|
74
|
+
if (s) {
|
|
75
|
+
y(s.message, "error");
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
-
h.value =
|
|
79
|
-
const [i,
|
|
80
|
-
isUsingProxy:
|
|
81
|
-
operation:
|
|
82
|
-
plugins:
|
|
83
|
-
request:
|
|
78
|
+
h.value = t.controller, e.eventBus.emit("hooks:on:request:sent");
|
|
79
|
+
const [i, S] = await N({
|
|
80
|
+
isUsingProxy: t.isUsingProxy,
|
|
81
|
+
operation: e.operation,
|
|
82
|
+
plugins: e.plugins,
|
|
83
|
+
request: t.request
|
|
84
84
|
});
|
|
85
|
-
if (
|
|
85
|
+
if (e.eventBus.emit("hooks:on:request:complete"), i) {
|
|
86
86
|
y(i.message, "error");
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
u.value =
|
|
89
|
+
u.value = S.response, l.value = S.request;
|
|
90
90
|
};
|
|
91
91
|
return C(() => {
|
|
92
|
-
|
|
92
|
+
e.eventBus.on("operation:send:request:hotkey", o), e.eventBus.on("operation:cancel:request", f);
|
|
93
93
|
}), U(() => {
|
|
94
|
-
|
|
95
|
-
}), k([() =>
|
|
94
|
+
e.eventBus.off("operation:send:request:hotkey", o), e.eventBus.off("operation:cancel:request", f);
|
|
95
|
+
}), k([() => e.path, () => e.method, () => e.exampleKey], () => {
|
|
96
96
|
u.value = null, l.value = null;
|
|
97
|
-
}), (
|
|
97
|
+
}), (s, t) => (b(), E("div", z, [
|
|
98
98
|
O("div", F, [
|
|
99
99
|
n(I, {
|
|
100
100
|
documentUrl: e.documentUrl,
|
|
@@ -109,15 +109,15 @@ const z = { class: "bg-b-1 flex h-full flex-col" }, F = { class: "lg:min-h-heade
|
|
|
109
109
|
server: e.server,
|
|
110
110
|
servers: e.servers,
|
|
111
111
|
source: e.source,
|
|
112
|
-
onExecute:
|
|
113
|
-
"onUpdate:servers":
|
|
112
|
+
onExecute: o,
|
|
113
|
+
"onUpdate:servers": t[0] || (t[0] = (i) => x("update:servers"))
|
|
114
114
|
}, null, 8, ["documentUrl", "environment", "eventBus", "hideClientButton", "history", "integration", "layout", "method", "path", "server", "servers", "source"])
|
|
115
115
|
]),
|
|
116
116
|
n(w, { class: "border-t" }, {
|
|
117
|
-
default:
|
|
117
|
+
default: B(() => [
|
|
118
118
|
n(P, { class: "flex-1" }, {
|
|
119
|
-
default:
|
|
120
|
-
n(
|
|
119
|
+
default: B(() => [
|
|
120
|
+
n(c(H), {
|
|
121
121
|
authMeta: e.authMeta,
|
|
122
122
|
clientOptions: q.value,
|
|
123
123
|
environment: e.environment,
|
|
@@ -129,23 +129,23 @@ const z = { class: "bg-b-1 flex h-full flex-col" }, F = { class: "lg:min-h-heade
|
|
|
129
129
|
path: e.path,
|
|
130
130
|
plugins: e.plugins,
|
|
131
131
|
proxyUrl: e.proxyUrl,
|
|
132
|
-
securityRequirements:
|
|
132
|
+
securityRequirements: m.value,
|
|
133
133
|
securitySchemes: e.securitySchemes,
|
|
134
134
|
selectedClient: e.selectedClient,
|
|
135
135
|
selectedSecurity: d.value,
|
|
136
136
|
selectedSecuritySchemes: v.value,
|
|
137
137
|
server: e.server
|
|
138
138
|
}, null, 8, ["authMeta", "clientOptions", "environment", "eventBus", "exampleKey", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securityRequirements", "securitySchemes", "selectedClient", "selectedSecurity", "selectedSecuritySchemes", "server"]),
|
|
139
|
-
n(
|
|
139
|
+
n(c(Q), {
|
|
140
140
|
appVersion: e.appVersion,
|
|
141
141
|
eventBus: e.eventBus,
|
|
142
|
-
events:
|
|
142
|
+
events: c(A)(),
|
|
143
143
|
layout: e.layout,
|
|
144
144
|
plugins: e.plugins,
|
|
145
145
|
request: l.value,
|
|
146
146
|
response: u.value,
|
|
147
147
|
totalPerformedRequests: e.totalPerformedRequests,
|
|
148
|
-
onSendRequest:
|
|
148
|
+
onSendRequest: o
|
|
149
149
|
}, null, 8, ["appVersion", "eventBus", "events", "layout", "plugins", "request", "response", "totalPerformedRequests"])
|
|
150
150
|
]),
|
|
151
151
|
_: 1
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as c, createElementBlock as i, openBlock as o, createElementVNode as n, createVNode as s, unref as l, createBlock as v, createCommentVNode as u } from "vue";
|
|
2
2
|
import { ScalarIcon as a } from "@scalar/components";
|
|
3
3
|
import f from "../../scalar-address-bar-block/components/AddressBar.vue.js";
|
|
4
4
|
import g from "../../../../components/OpenApiClientButton.vue.js";
|
|
5
|
-
const y = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1" },
|
|
5
|
+
const y = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1" }, x = { class: "mb-2 flex w-1/2 flex-row items-center justify-end gap-1 lg:mb-0 lg:flex-1 lg:px-2.5" }, w = /* @__PURE__ */ c({
|
|
6
6
|
__name: "Header",
|
|
7
7
|
props: {
|
|
8
8
|
path: {},
|
|
@@ -19,13 +19,13 @@ const y = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap i
|
|
|
19
19
|
environment: {}
|
|
20
20
|
},
|
|
21
21
|
emits: ["execute", "update:servers"],
|
|
22
|
-
setup(
|
|
23
|
-
const m =
|
|
24
|
-
return (
|
|
25
|
-
t[6] || (t[6] =
|
|
26
|
-
|
|
22
|
+
setup(e, { emit: d }) {
|
|
23
|
+
const m = d;
|
|
24
|
+
return (b, t) => (o(), i("div", y, [
|
|
25
|
+
t[6] || (t[6] = n("div", { class: "mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1" }, [
|
|
26
|
+
n("div", { class: "size-8" })
|
|
27
27
|
], -1)),
|
|
28
|
-
|
|
28
|
+
s(l(f), {
|
|
29
29
|
environment: e.environment,
|
|
30
30
|
eventBus: e.eventBus,
|
|
31
31
|
history: e.history,
|
|
@@ -34,11 +34,11 @@ const y = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap i
|
|
|
34
34
|
path: e.path,
|
|
35
35
|
server: e.server,
|
|
36
36
|
servers: e.servers,
|
|
37
|
-
onExecute: t[0] || (t[0] = (
|
|
38
|
-
"onUpdate:servers": t[1] || (t[1] = (
|
|
37
|
+
onExecute: t[0] || (t[0] = (r) => m("execute")),
|
|
38
|
+
"onUpdate:servers": t[1] || (t[1] = (r) => m("update:servers"))
|
|
39
39
|
}, null, 8, ["environment", "eventBus", "history", "layout", "method", "path", "server", "servers"]),
|
|
40
|
-
|
|
41
|
-
e.layout === "modal" && e.documentUrl && !e.hideClientButton ? (
|
|
40
|
+
n("div", x, [
|
|
41
|
+
e.layout === "modal" && e.documentUrl && !e.hideClientButton ? (o(), v(l(g), {
|
|
42
42
|
key: 0,
|
|
43
43
|
buttonSource: "modal",
|
|
44
44
|
class: "!w-fit lg:-mr-1",
|
|
@@ -46,31 +46,31 @@ const y = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap i
|
|
|
46
46
|
source: e.source ?? "api-reference",
|
|
47
47
|
url: e.documentUrl
|
|
48
48
|
}, null, 8, ["integration", "source", "url"])) : u("", !0),
|
|
49
|
-
e.layout === "modal" && e.source !== "gitbook" ? (
|
|
49
|
+
e.layout === "modal" && e.source !== "gitbook" ? (o(), i("button", {
|
|
50
50
|
key: 1,
|
|
51
51
|
class: "app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2",
|
|
52
52
|
type: "button",
|
|
53
|
-
onClick: t[2] || (t[2] = (
|
|
53
|
+
onClick: t[2] || (t[2] = (r) => e.eventBus.emit("ui:close:client-modal"))
|
|
54
54
|
}, [
|
|
55
|
-
|
|
55
|
+
s(l(a), {
|
|
56
56
|
icon: "Close",
|
|
57
57
|
size: "lg",
|
|
58
58
|
thickness: "2"
|
|
59
59
|
}),
|
|
60
|
-
t[4] || (t[4] =
|
|
60
|
+
t[4] || (t[4] = n("span", { class: "sr-only" }, "Close Client", -1))
|
|
61
61
|
])) : u("", !0),
|
|
62
|
-
e.layout === "modal" && e.source === "gitbook" ? (
|
|
62
|
+
e.layout === "modal" && e.source === "gitbook" ? (o(), i("button", {
|
|
63
63
|
key: 2,
|
|
64
64
|
class: "text-c-1 hover:bg-b-2 active:text-c-1 -mr-1.5 rounded p-2",
|
|
65
65
|
type: "button",
|
|
66
|
-
onClick: t[3] || (t[3] = (
|
|
66
|
+
onClick: t[3] || (t[3] = (r) => e.eventBus.emit("ui:close:client-modal"))
|
|
67
67
|
}, [
|
|
68
|
-
|
|
68
|
+
s(l(a), {
|
|
69
69
|
icon: "Close",
|
|
70
70
|
size: "md",
|
|
71
71
|
thickness: "1.75"
|
|
72
72
|
}),
|
|
73
|
-
t[5] || (t[5] =
|
|
73
|
+
t[5] || (t[5] = n("span", { class: "sr-only" }, "Close Client", -1))
|
|
74
74
|
])) : u("", !0)
|
|
75
75
|
])
|
|
76
76
|
]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-request-body.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-body.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAA;AAIjG;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,aAAa,iBAAiB,GAAG,SAAS;AAC1C,8DAA8D;AAC9D,MAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;AAChC,qCAAqC;AACrC,mBAAsB,KACrB,QAAQ,GAAG,
|
|
1
|
+
{"version":3,"file":"build-request-body.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-body.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAA;AAIjG;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,aAAa,iBAAiB,GAAG,SAAS;AAC1C,8DAA8D;AAC9D,MAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;AAChC,qCAAqC;AACrC,mBAAsB,KACrB,QAAQ,GAAG,IAyDb,CAAA"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { replaceEnvVariables as
|
|
1
|
+
import { replaceEnvVariables as l } from "@scalar/helpers/regex/replace-variables";
|
|
2
2
|
import { unpackProxyObject as m } from "@scalar/workspace-store/helpers/unpack-proxy";
|
|
3
3
|
import { getExampleFromBody as u } from "../../request-block/helpers/get-request-body-example.js";
|
|
4
|
-
const
|
|
5
|
-
if (!
|
|
4
|
+
const w = (e, a = {}, p = "default") => {
|
|
5
|
+
if (!e)
|
|
6
6
|
return null;
|
|
7
|
-
const
|
|
7
|
+
const r = e?.["x-scalar-selected-content-type"]?.[p] ?? Object.keys(e?.content ?? {})[0] ?? "application/json", t = u(e, r, p);
|
|
8
8
|
if (!t)
|
|
9
9
|
return null;
|
|
10
|
-
if ((
|
|
11
|
-
const n =
|
|
12
|
-
return
|
|
13
|
-
if (!
|
|
10
|
+
if ((r === "multipart/form-data" || r === "application/x-www-form-urlencoded") && Array.isArray(t.value)) {
|
|
11
|
+
const s = t.value.filter((o) => !o.isDisabled), n = r === "multipart/form-data" ? new FormData() : new URLSearchParams();
|
|
12
|
+
return s.forEach(({ name: o, value: i }) => {
|
|
13
|
+
if (!o)
|
|
14
14
|
return;
|
|
15
|
-
const c =
|
|
16
|
-
if (
|
|
17
|
-
const f = m(
|
|
15
|
+
const c = l(o, a);
|
|
16
|
+
if (i instanceof File && n instanceof FormData) {
|
|
17
|
+
const f = m(i);
|
|
18
18
|
n.append(c, f, f.name);
|
|
19
|
-
} else typeof
|
|
19
|
+
} else typeof i == "string" && n.append(c, l(i, a));
|
|
20
20
|
}), n;
|
|
21
21
|
}
|
|
22
|
-
return typeof t.value == "object" ?
|
|
22
|
+
return typeof t.value == "object" ? l(JSON.stringify(t.value), a) : typeof t.value == "string" ? l(t.value, a) : t.value;
|
|
23
23
|
};
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
w as buildRequestBody
|
|
26
26
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as l, computed as r, createBlock as s, openBlock as p, resolveDynamicComponent as m, normalizeStyle as c, withCtx as d, renderSlot as h, createTextVNode as i, toDisplayString as u } from "vue";
|
|
2
2
|
import { getHttpMethodInfo as f } from "@scalar/helpers/http/http-info";
|
|
3
3
|
import { normalizeHttpMethod as y } from "@scalar/helpers/http/normalize-http-method";
|
|
4
|
-
const
|
|
4
|
+
const x = /* @__PURE__ */ l({
|
|
5
5
|
__name: "HttpMethod",
|
|
6
6
|
props: {
|
|
7
7
|
as: {},
|
|
@@ -9,22 +9,22 @@ const z = /* @__PURE__ */ a({
|
|
|
9
9
|
short: { type: Boolean },
|
|
10
10
|
method: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
() => f(String(
|
|
15
|
-
), n = r(() => y(
|
|
16
|
-
return (
|
|
12
|
+
setup(t) {
|
|
13
|
+
const e = t, o = r(
|
|
14
|
+
() => f(String(e.method || ""))
|
|
15
|
+
), n = r(() => y(e.method));
|
|
16
|
+
return (a, v) => (p(), s(m(t.as ?? "span"), {
|
|
17
17
|
class: "uppercase",
|
|
18
|
-
style:
|
|
18
|
+
style: c({ [t.property || "color"]: o.value.colorVar })
|
|
19
19
|
}, {
|
|
20
|
-
default:
|
|
21
|
-
h(
|
|
22
|
-
i(" " + u(
|
|
20
|
+
default: d(() => [
|
|
21
|
+
h(a.$slots, "default"),
|
|
22
|
+
i(" " + u(t.short ? o.value.short : n.value), 1)
|
|
23
23
|
]),
|
|
24
24
|
_: 3
|
|
25
25
|
}, 8, ["style"]));
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
x as default
|
|
30
30
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as $, computed as
|
|
2
|
-
import { ScalarCard as
|
|
1
|
+
import { defineComponent as $, computed as o, ref as b, watch as D, useId as I, createBlock as u, createCommentVNode as d, openBlock as s, unref as a, withCtx as n, createVNode as r, createSlots as N, createElementVNode as x, createElementBlock as g, renderSlot as p, createTextVNode as W, toDisplayString as R } from "vue";
|
|
2
|
+
import { ScalarCard as S, ScalarCardHeader as z, ScalarCombobox as U, ScalarButton as A, ScalarCardSection as T, ScalarCodeBlock as F, ScalarVirtualText as M, ScalarCardFooter as K } from "@scalar/components";
|
|
3
3
|
import { freezeElement as Z } from "@scalar/helpers/dom/freeze-element";
|
|
4
4
|
import { ScalarIconCaretDown as G } from "@scalar/icons";
|
|
5
5
|
import { getResolvedRef as J } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
@@ -11,10 +11,10 @@ import { getCustomCodeSamples as X } from "../helpers/get-custom-code-samples.js
|
|
|
11
11
|
import { getSecrets as Y } from "../helpers/get-secrets.js";
|
|
12
12
|
import { generateCodeSnippet as _ } from "../helpers/generate-code-snippet.js";
|
|
13
13
|
import ee from "./ExamplePicker.vue.js";
|
|
14
|
-
const te = ["innerHTML"], le = ["id"],
|
|
14
|
+
const te = ["innerHTML"], le = ["id"], ae = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "request-card-footer-addon"
|
|
17
|
-
},
|
|
17
|
+
}, oe = { class: "request-header" }, ne = {}, be = /* @__PURE__ */ $({
|
|
18
18
|
...ne,
|
|
19
19
|
__name: "OperationCodeSample",
|
|
20
20
|
props: {
|
|
@@ -32,104 +32,104 @@ const te = ["innerHTML"], le = ["id"], oe = {
|
|
|
32
32
|
generateLabel: { type: Function },
|
|
33
33
|
isWebhook: { type: Boolean }
|
|
34
34
|
},
|
|
35
|
-
setup(
|
|
36
|
-
const i =
|
|
37
|
-
const
|
|
38
|
-
return l ?
|
|
35
|
+
setup(e) {
|
|
36
|
+
const i = o(() => {
|
|
37
|
+
const t = J(e.operation.requestBody)?.content ?? {}, l = e.selectedContentType || Object.keys(t)[0];
|
|
38
|
+
return l ? t[l]?.examples ?? {} : {};
|
|
39
39
|
}), m = b(
|
|
40
|
-
|
|
41
|
-
),
|
|
42
|
-
() => Q(
|
|
43
|
-
),
|
|
44
|
-
q(f.value,
|
|
40
|
+
e.selectedExample ?? Object.keys(i.value)[0] ?? ""
|
|
41
|
+
), C = o(() => X(e.operation)), f = o(
|
|
42
|
+
() => Q(C.value, e.clientOptions)
|
|
43
|
+
), c = b(
|
|
44
|
+
q(f.value, e.selectedClient)
|
|
45
45
|
);
|
|
46
46
|
D(
|
|
47
|
-
() =>
|
|
48
|
-
(
|
|
49
|
-
const l = q(f.value,
|
|
50
|
-
l && (
|
|
47
|
+
() => e.selectedClient,
|
|
48
|
+
(t) => {
|
|
49
|
+
const l = q(f.value, t);
|
|
50
|
+
l && (c.value = l);
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
|
-
const y =
|
|
54
|
-
if (!
|
|
53
|
+
const y = o(() => {
|
|
54
|
+
if (!e.isWebhook) return null;
|
|
55
55
|
try {
|
|
56
56
|
return P({
|
|
57
|
-
operation:
|
|
58
|
-
method:
|
|
59
|
-
path:
|
|
57
|
+
operation: e.operation,
|
|
58
|
+
method: e.method,
|
|
59
|
+
path: e.path,
|
|
60
60
|
example: m.value
|
|
61
61
|
});
|
|
62
|
-
} catch (
|
|
63
|
-
return console.error("[webhookHar]",
|
|
62
|
+
} catch (t) {
|
|
63
|
+
return console.error("[webhookHar]", t), null;
|
|
64
64
|
}
|
|
65
|
-
}), h =
|
|
66
|
-
clientId:
|
|
67
|
-
customCodeSamples:
|
|
68
|
-
operation:
|
|
69
|
-
method:
|
|
70
|
-
path:
|
|
71
|
-
contentType:
|
|
72
|
-
server:
|
|
73
|
-
securitySchemes:
|
|
65
|
+
}), h = o(() => e.isWebhook ? y.value?.postData?.text ?? "" : _({
|
|
66
|
+
clientId: c.value?.id,
|
|
67
|
+
customCodeSamples: C.value,
|
|
68
|
+
operation: e.operation,
|
|
69
|
+
method: e.method,
|
|
70
|
+
path: e.path,
|
|
71
|
+
contentType: e.selectedContentType,
|
|
72
|
+
server: e.selectedServer,
|
|
73
|
+
securitySchemes: e.securitySchemes,
|
|
74
74
|
example: m.value
|
|
75
|
-
})), B =
|
|
75
|
+
})), B = o(() => e.isWebhook ? w.value : c.value?.lang), w = o(() => {
|
|
76
76
|
if (!y.value?.postData) return "json";
|
|
77
|
-
const
|
|
78
|
-
return
|
|
79
|
-
}), O =
|
|
77
|
+
const t = y.value.postData.mimeType;
|
|
78
|
+
return t?.includes("json") ? "json" : t?.includes("xml") ? "xml" : t?.includes("yaml") || t?.includes("yml") ? "yaml" : t?.includes("text/plain") ? "text" : "json";
|
|
79
|
+
}), O = o(() => Y(e.securitySchemes)), k = b(null), j = (t) => {
|
|
80
80
|
if (k.value) {
|
|
81
81
|
const l = Z(k.value.$el);
|
|
82
82
|
setTimeout(() => {
|
|
83
83
|
l();
|
|
84
84
|
}, 300);
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
}, E = 2e4, H =
|
|
86
|
+
c.value = t, t && !t.id.startsWith("custom") && e.eventBus.emit("workspace:update:selected-client", t.id);
|
|
87
|
+
}, E = 2e4, H = o(
|
|
88
88
|
() => (h.value.length ?? 0) > E
|
|
89
89
|
), L = I();
|
|
90
|
-
return (
|
|
90
|
+
return (t, l) => h.value ? (s(), u(a(S), {
|
|
91
91
|
key: 0,
|
|
92
92
|
ref_key: "elem",
|
|
93
93
|
ref: k,
|
|
94
94
|
class: "request-card dark-mode"
|
|
95
95
|
}, {
|
|
96
96
|
default: n(() => [
|
|
97
|
-
r(
|
|
97
|
+
r(a(z), { class: "pr-2.5" }, N({
|
|
98
98
|
default: n(() => [
|
|
99
|
-
l[2] || (l[2] =
|
|
99
|
+
l[2] || (l[2] = x("span", { class: "sr-only" }, "Request Example for", -1)),
|
|
100
100
|
r(V, {
|
|
101
101
|
as: "span",
|
|
102
102
|
class: "request-method",
|
|
103
103
|
method: e.method
|
|
104
104
|
}, null, 8, ["method"]),
|
|
105
|
-
e.generateLabel ? (s(),
|
|
105
|
+
e.generateLabel ? (s(), g("span", {
|
|
106
106
|
key: 0,
|
|
107
107
|
innerHTML: e.generateLabel()
|
|
108
108
|
}, null, 8, te)) : d("", !0),
|
|
109
|
-
|
|
109
|
+
p(t.$slots, "header", {}, void 0, !0)
|
|
110
110
|
]),
|
|
111
111
|
_: 2
|
|
112
112
|
}, [
|
|
113
113
|
!e.isWebhook && f.value.length ? {
|
|
114
114
|
name: "actions",
|
|
115
115
|
fn: n(() => [
|
|
116
|
-
r(
|
|
116
|
+
r(a(U), {
|
|
117
117
|
class: "max-h-80",
|
|
118
|
-
modelValue:
|
|
118
|
+
modelValue: c.value,
|
|
119
119
|
options: f.value,
|
|
120
120
|
placement: "bottom-end",
|
|
121
121
|
teleport: "",
|
|
122
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
122
|
+
"onUpdate:modelValue": l[0] || (l[0] = (v) => j(v))
|
|
123
123
|
}, {
|
|
124
124
|
default: n(() => [
|
|
125
|
-
r(
|
|
125
|
+
r(a(A), {
|
|
126
126
|
class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5 py-0 text-base font-normal",
|
|
127
127
|
"data-testid": "client-picker",
|
|
128
128
|
variant: "ghost"
|
|
129
129
|
}, {
|
|
130
130
|
default: n(() => [
|
|
131
|
-
W(R(
|
|
132
|
-
r(
|
|
131
|
+
W(R(c.value?.title) + " ", 1),
|
|
132
|
+
r(a(G), {
|
|
133
133
|
class: "ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100",
|
|
134
134
|
weight: "bold"
|
|
135
135
|
})
|
|
@@ -143,19 +143,19 @@ const te = ["innerHTML"], le = ["id"], oe = {
|
|
|
143
143
|
key: "0"
|
|
144
144
|
} : void 0
|
|
145
145
|
]), 1024),
|
|
146
|
-
r(
|
|
146
|
+
r(a(T), { class: "request-editor-section custom-scroll p-0" }, {
|
|
147
147
|
default: n(() => [
|
|
148
|
-
|
|
149
|
-
id: `${
|
|
148
|
+
x("div", {
|
|
149
|
+
id: `${a(L)}-example`,
|
|
150
150
|
class: "code-snippet"
|
|
151
151
|
}, [
|
|
152
|
-
H.value ? (s(),
|
|
152
|
+
H.value ? (s(), u(a(M), {
|
|
153
153
|
key: 1,
|
|
154
154
|
containerClass: "custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen",
|
|
155
155
|
contentClass: "language-plaintext whitespace-pre font-code text-base",
|
|
156
156
|
lineHeight: 20,
|
|
157
157
|
text: h.value
|
|
158
|
-
}, null, 8, ["text"])) : (s(),
|
|
158
|
+
}, null, 8, ["text"])) : (s(), u(a(F), {
|
|
159
159
|
key: 0,
|
|
160
160
|
class: "bg-b-2 !min-h-full -outline-offset-2",
|
|
161
161
|
content: h.value,
|
|
@@ -167,41 +167,41 @@ const te = ["innerHTML"], le = ["id"], oe = {
|
|
|
167
167
|
]),
|
|
168
168
|
_: 1
|
|
169
169
|
}),
|
|
170
|
-
Object.keys(i.value).length > 1 ||
|
|
170
|
+
Object.keys(i.value).length > 1 || t.$slots.footer ? (s(), u(a(K), {
|
|
171
171
|
key: 0,
|
|
172
172
|
class: "request-card-footer bg-b-3"
|
|
173
173
|
}, {
|
|
174
174
|
default: n(() => [
|
|
175
|
-
Object.keys(i.value).length > 1 ? (s(),
|
|
176
|
-
Object.keys(i.value).length ? (s(),
|
|
175
|
+
Object.keys(i.value).length > 1 ? (s(), g("div", ae, [
|
|
176
|
+
Object.keys(i.value).length ? (s(), u(ee, {
|
|
177
177
|
key: 0,
|
|
178
178
|
modelValue: m.value,
|
|
179
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
179
|
+
"onUpdate:modelValue": l[1] || (l[1] = (v) => m.value = v),
|
|
180
180
|
examples: i.value
|
|
181
181
|
}, null, 8, ["modelValue", "examples"])) : d("", !0)
|
|
182
182
|
])) : d("", !0),
|
|
183
|
-
|
|
183
|
+
p(t.$slots, "footer", {}, void 0, !0)
|
|
184
184
|
]),
|
|
185
185
|
_: 3
|
|
186
186
|
})) : d("", !0)
|
|
187
187
|
]),
|
|
188
188
|
_: 3
|
|
189
|
-
}, 512)) : e.fallback ? (s(),
|
|
189
|
+
}, 512)) : e.fallback ? (s(), u(a(S), {
|
|
190
190
|
key: 1,
|
|
191
191
|
class: "request-card dark-mode"
|
|
192
192
|
}, {
|
|
193
193
|
default: n(() => [
|
|
194
|
-
r(
|
|
194
|
+
r(a(T), { class: "request-card-simple" }, {
|
|
195
195
|
default: n(() => [
|
|
196
|
-
|
|
196
|
+
x("div", oe, [
|
|
197
197
|
r(V, {
|
|
198
198
|
as: "span",
|
|
199
199
|
class: "request-method",
|
|
200
200
|
method: e.method
|
|
201
201
|
}, null, 8, ["method"]),
|
|
202
|
-
|
|
202
|
+
p(t.$slots, "header", {}, void 0, !0)
|
|
203
203
|
]),
|
|
204
|
-
|
|
204
|
+
p(t.$slots, "footer", {}, void 0, !0)
|
|
205
205
|
]),
|
|
206
206
|
_: 3
|
|
207
207
|
})
|
|
@@ -3,7 +3,7 @@ import type { AvailableClient } from '@scalar/snippetz';
|
|
|
3
3
|
import type { XCodeSample } from '@scalar/workspace-store/schemas/extensions/operation';
|
|
4
4
|
import type { OperationObject, SecuritySchemeObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
5
5
|
import { type CustomCodeSampleId } from './generate-client-options.js';
|
|
6
|
-
|
|
6
|
+
type GenerateCodeSnippetProps = {
|
|
7
7
|
/** The selected client/language for code generation (e.g., 'node/fetch') or a custom code sample ID. */
|
|
8
8
|
clientId: AvailableClient | CustomCodeSampleId | undefined;
|
|
9
9
|
/** The Content-Type header value for the request body (e.g., 'application/json'). */
|
|
@@ -25,4 +25,5 @@ export type GenerateCodeSnippetProps = {
|
|
|
25
25
|
};
|
|
26
26
|
/** Generate the code snippet for the selected example OR operation */
|
|
27
27
|
export declare const generateCodeSnippet: ({ clientId, customCodeSamples, operation, method, path, example, contentType, server, securitySchemes, }: GenerateCodeSnippetProps) => string;
|
|
28
|
+
export {};
|
|
28
29
|
//# sourceMappingURL=generate-code-snippet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-code-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/generate-code-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,kBAAkB,CAAA;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAA;AACvF,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,EAAE,KAAK,kBAAkB,EAAoB,MAAM,2BAA2B,CAAA;AAErF,
|
|
1
|
+
{"version":3,"file":"generate-code-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/generate-code-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,kBAAkB,CAAA;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAA;AACvF,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,EAAE,KAAK,kBAAkB,EAAoB,MAAM,2BAA2B,CAAA;AAErF,KAAK,wBAAwB,GAAG;IAC9B,wGAAwG;IACxG,QAAQ,EAAE,eAAe,GAAG,kBAAkB,GAAG,SAAS,CAAA;IAC1D,qFAAqF;IACrF,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,mFAAmF;IACnF,iBAAiB,EAAE,WAAW,EAAE,CAAA;IAChC,0EAA0E;IAC1E,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,gEAAgE;IAChE,MAAM,EAAE,UAAU,CAAA;IAClB,wEAAwE;IACxE,SAAS,EAAE,eAAe,CAAA;IAC1B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAA;IACZ,iFAAiF;IACjF,eAAe,EAAE,oBAAoB,EAAE,CAAA;IACvC,mEAAmE;IACnE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;CAC5B,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,GAAI,0GAUjC,wBAAwB,KAAG,MAqC7B,CAAA"}
|