@scalar/api-client 2.14.1 → 2.17.0
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 +176 -0
- package/dist/hooks/useResponseBody.js +6 -6
- package/dist/libs/errors.d.ts +1 -0
- package/dist/libs/errors.d.ts.map +1 -1
- package/dist/libs/errors.js +1 -0
- package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
- package/dist/libs/send-request/create-request-operation.js +41 -35
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +28 -38
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +81 -65
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -23
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +3 -3
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +29 -38
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts +10 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +22 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +31 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +31 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +3 -9
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +56 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +10 -3
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-security.js +46 -0
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +45 -0
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request.js +66 -0
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +9 -0
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts +16 -0
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js +4 -0
- package/dist/v2/blocks/operation-block/helpers/get-delimiter.js +17 -0
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +9 -3
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +21 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +53 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.js +120 -0
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +89 -110
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +8 -13
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +22 -28
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +19 -8
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +30 -24
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts +12 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.js +20 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts +10 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.js +4 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +14 -12
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +191 -169
- 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 +10 -10
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts +2 -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 +15 -19
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +2 -2
- package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/types.d.ts +16 -0
- package/dist/v2/blocks/operation-code-sample/types.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +15 -10
- 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.vue2.js +202 -160
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +2 -0
- 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.vue2.js +60 -51
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts +8 -0
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +127 -0
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue2.js +4 -0
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +2 -2
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js +24 -23
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -4
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +3 -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 +146 -147
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts +1 -0
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue2.js +28 -27
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +1 -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 +21 -15
- package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +3 -2
- 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 +13 -3
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +4 -4
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +3 -3
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +41 -45
- package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/Headers.vue.js +27 -27
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +1 -1
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts +18 -0
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts.map +1 -0
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +12 -0
- package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +4 -15
- 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 +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +117 -71
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +19 -0
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +24 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +3 -2
- 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 +59 -56
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
- 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/RequestAuthDataTable.vue.d.ts +3 -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 +26 -24
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -1
- 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 +44 -43
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +4 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +7 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +4 -4
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -2
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +16 -6
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
- package/dist/v2/components/code-input/CodeInput.vue2.js +81 -65
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +2 -2
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.js +44 -44
- package/dist/v2/components/resize/index.d.ts +0 -1
- package/dist/v2/components/resize/index.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +9 -5
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +51 -46
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.d.ts +3 -0
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +130 -143
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +3 -3
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue2.js +216 -106
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +1 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/ItemDecorator.vue.d.ts +22 -0
- package/dist/v2/features/app/components/ItemDecorator.vue.d.ts.map +1 -0
- package/dist/v2/features/app/components/ItemDecorator.vue.js +138 -0
- package/dist/v2/features/app/components/ItemDecorator.vue2.js +4 -0
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts +1 -1
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
- 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 +8 -8
- package/dist/v2/features/app/helpers/routes.d.ts +32 -6
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +25 -16
- package/dist/v2/{hooks/use-sidebar-state.d.ts → features/app/hooks/use-app-sidebar.d.ts} +10 -11
- package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +1 -0
- package/dist/v2/{hooks/use-sidebar-state.js → features/app/hooks/use-app-sidebar.js} +19 -19
- package/dist/v2/features/app/hooks/use-document-watcher.d.ts.map +1 -0
- package/dist/v2/{hooks → features/app/hooks}/use-sync-path.d.ts +2 -2
- package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-sync-path.js +52 -0
- package/dist/v2/{hooks → features/app/hooks}/use-tabs.d.ts +2 -2
- package/dist/v2/features/app/hooks/use-tabs.d.ts.map +1 -0
- package/dist/v2/{hooks → features/app/hooks}/use-tabs.js +1 -1
- package/dist/v2/{hooks/use-workspace-client-events.d.ts → features/app/hooks/use-workspace-client-app-events.d.ts} +5 -5
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.js +156 -0
- package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +1 -0
- package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.js +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +92 -2
- package/dist/v2/features/collection/DocumentCollection.vue2.js +2 -91
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +42 -2
- package/dist/v2/features/collection/WorkspaceCollection.vue2.js +2 -41
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
- package/dist/v2/features/collection/components/Authentication.vue2.js +14 -12
- package/dist/v2/features/collection/components/Cookies.vue.js +30 -1
- package/dist/v2/features/collection/components/Cookies.vue2.js +1 -29
- package/dist/v2/features/collection/components/Environment.vue.js +32 -1
- package/dist/v2/features/collection/components/Environment.vue2.js +1 -31
- package/dist/v2/features/collection/components/Overview.vue2.js +5 -4
- package/dist/v2/features/collection/components/Servers.vue.js +142 -2
- package/dist/v2/features/collection/components/Servers.vue2.js +2 -141
- package/dist/v2/features/collection/components/Settings.vue.js +58 -2
- package/dist/v2/features/collection/components/Settings.vue2.js +2 -57
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +8 -0
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +76 -68
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +8 -0
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +83 -75
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +4 -0
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +32 -34
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +16 -0
- 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 +24 -21
- package/dist/v2/features/modal/Modal.vue.d.ts +23 -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 +118 -31
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +18 -32
- 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 +46 -26
- package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +55 -0
- package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -0
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js +29 -0
- package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +42 -0
- package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -0
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js +93 -0
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +18 -0
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -0
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +30 -0
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +59 -28
- package/dist/v2/features/operation/helpers/get-operation-header.d.ts +17 -0
- package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +1 -0
- package/dist/v2/features/operation/helpers/get-operation-header.js +12 -0
- package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
- package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts +7 -0
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -0
- package/dist/v2/features/operation/helpers/get-selected-security.js +19 -0
- package/dist/v2/features/operation/index.d.ts +0 -1
- package/dist/v2/features/operation/index.d.ts.map +1 -1
- package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +1 -1
- package/dist/v2/features/search/components/SearchModal.vue.js +3 -3
- package/dist/v2/features/search/components/SearchModal.vue2.js +45 -44
- package/dist/v2/features/settings/DocumentSettings.vue.js +2 -2
- package/dist/v2/features/settings/DocumentSettings.vue2.js +1 -1
- package/dist/v2/helpers/generate-location-id.d.ts +19 -0
- package/dist/v2/helpers/generate-location-id.d.ts.map +1 -0
- package/dist/v2/helpers/generate-location-id.js +10 -0
- package/dist/v2/helpers/get-active-environment.d.ts +5 -0
- package/dist/v2/helpers/get-active-environment.d.ts.map +1 -0
- package/dist/v2/helpers/get-active-environment.js +22 -0
- package/dist/v2/helpers/get-tab-details.d.ts +2 -2
- package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +1 -1
- package/dist/v2/helpers/plugins.d.ts +59 -0
- package/dist/v2/helpers/plugins.d.ts.map +1 -0
- package/dist/v2/helpers/plugins.js +11 -0
- package/dist/v2/helpers/storage.d.ts.map +1 -1
- package/dist/v2/helpers/storage.js +5 -5
- package/dist/v2/hooks/use-scroll-lock.d.ts +28 -0
- package/dist/v2/hooks/use-scroll-lock.d.ts.map +1 -0
- package/dist/v2/hooks/use-scroll-lock.js +21 -0
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +2 -0
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +0 -1
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +19 -19
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts +0 -7
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts.map +0 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.js +0 -28
- package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts +0 -6
- package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts.map +0 -1
- package/dist/v2/blocks/request-block/helpers/get-parameter-example.js +0 -12
- package/dist/v2/hooks/use-document-watcher.d.ts.map +0 -1
- package/dist/v2/hooks/use-sidebar-state.d.ts.map +0 -1
- package/dist/v2/hooks/use-sync-path.d.ts.map +0 -1
- package/dist/v2/hooks/use-sync-path.js +0 -51
- package/dist/v2/hooks/use-tabs.d.ts.map +0 -1
- package/dist/v2/hooks/use-workspace-client-events.d.ts.map +0 -1
- package/dist/v2/hooks/use-workspace-client-events.js +0 -112
- package/dist/v2/hooks/use-workspace-selector.d.ts.map +0 -1
- package/dist/v2/plugins.d.ts +0 -44
- package/dist/v2/plugins.d.ts.map +0 -1
- /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.d.ts +0 -0
- /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.js +0 -0
- /package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-example-from-schema.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-example-from-schema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;
|
|
1
|
+
{"version":3,"file":"get-example-from-schema.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-example-from-schema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAichG,KAAK,2BAA2B,GAAG;IACjC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,qDAAqD;IACrD,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACzC,CAAA;AAYD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,YAAY,EACpB,UAAU,2BAA2B,EACrC,uCAKG,OAAO,CAAC;IACT,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,YAAY,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;CACtB,CAAM,KACN,OAuJF,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isDefined as v } from "@scalar/helpers/array/is-defined";
|
|
2
|
-
import { getRaw as
|
|
2
|
+
import { getRaw as E } from "@scalar/json-magic/magic-proxy";
|
|
3
3
|
import { getResolvedRef as m } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
4
4
|
import { unpackOverridesProxy as N } from "@scalar/workspace-store/helpers/overrides-proxy";
|
|
5
|
-
const
|
|
6
|
-
"date-time":
|
|
5
|
+
const D = 10, P = 10, M = "propertyName*", j = (/* @__PURE__ */ new Date()).toISOString(), q = j.split("T")[0], k = j.split("T")[1].split(".")[0], C = {
|
|
6
|
+
"date-time": j,
|
|
7
7
|
date: q,
|
|
8
8
|
email: "hello@example.com",
|
|
9
9
|
hostname: "example.com",
|
|
@@ -29,248 +29,270 @@ const T = 10, j = 10, D = "propertyName*", A = (/* @__PURE__ */ new Date()).toIS
|
|
|
29
29
|
uri: "https://example.com",
|
|
30
30
|
uuid: "123e4567-e89b-12d3-a456-426614174000",
|
|
31
31
|
"object-id": "6592008029c8c3e4dc76256c"
|
|
32
|
-
},
|
|
33
|
-
if (!
|
|
32
|
+
}, w = (t, i = !1, o = "") => "type" in t && t.type === "string" && "format" in t && t.format === "binary" ? new File([""], "filename") : i && "format" in t && t.format ? C[t.format] ?? o : o, A = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), I = (t) => {
|
|
33
|
+
if (!t)
|
|
34
34
|
return;
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
38
|
-
if ("required" in
|
|
39
|
-
const
|
|
40
|
-
if (Array.isArray(
|
|
41
|
-
const
|
|
42
|
-
return
|
|
35
|
+
const i = S.get(t);
|
|
36
|
+
if (i)
|
|
37
|
+
return i;
|
|
38
|
+
if ("required" in t) {
|
|
39
|
+
const o = t.required;
|
|
40
|
+
if (Array.isArray(o) && o.length > 0) {
|
|
41
|
+
const l = new Set(o);
|
|
42
|
+
return S.set(t, l), l;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
},
|
|
46
|
-
if (
|
|
45
|
+
}, a = (t, i, o) => {
|
|
46
|
+
if (typeof i != "object" || i === null)
|
|
47
|
+
return i;
|
|
48
|
+
const l = E(N(t)), d = A.get(l) ?? /* @__PURE__ */ new Map();
|
|
49
|
+
return d && d.set(o, i), A.set(l, d), i;
|
|
50
|
+
}, _ = (t) => !!(t.allOf || t.oneOf || t.anyOf), F = (t, i, o, l) => {
|
|
51
|
+
if (t.deprecated || l?.mode === "write" && t.readOnly || l?.mode === "read" && t.writeOnly)
|
|
52
|
+
return !0;
|
|
53
|
+
if (l?.omitEmptyAndOptionalProperties !== !0 || "type" in t && (t.type === "object" || t.type === "array") || _(t) || "examples" in t && Array.isArray(t.examples) && t.examples.length > 0 || "example" in t && t.example !== void 0 || "default" in t && t.default !== void 0 || "const" in t && t.const !== void 0 || "enum" in t && Array.isArray(t.enum) && t.enum.length > 0)
|
|
47
54
|
return !1;
|
|
48
|
-
const
|
|
49
|
-
return !(
|
|
50
|
-
}, R = (
|
|
51
|
-
const
|
|
52
|
-
if ("properties" in
|
|
53
|
-
const
|
|
54
|
-
for (let
|
|
55
|
-
const
|
|
55
|
+
const r = o ?? t.title ?? "", e = I(i);
|
|
56
|
+
return !(e ? e.has(r) : !1);
|
|
57
|
+
}, R = (t, i) => Array.isArray(t) && Array.isArray(i) ? [...t, ...i] : t && typeof t == "object" && i && typeof i == "object" ? { ...t, ...i } : i, L = (t, i, o, l, d) => {
|
|
58
|
+
const r = {};
|
|
59
|
+
if ("properties" in t && t.properties) {
|
|
60
|
+
const e = Object.keys(t.properties), n = o > 3 ? Math.min(P, e.length) : e.length;
|
|
61
|
+
for (let p = 0; p < n; p++) {
|
|
62
|
+
const x = e[p], u = m(t.properties[x]);
|
|
56
63
|
if (!u)
|
|
57
64
|
continue;
|
|
58
|
-
const
|
|
59
|
-
level:
|
|
60
|
-
parentSchema:
|
|
61
|
-
name:
|
|
62
|
-
seen:
|
|
65
|
+
const s = i?.xml && "xml" in u ? u.xml?.name : void 0, y = c(u, i, {
|
|
66
|
+
level: o + 1,
|
|
67
|
+
parentSchema: t,
|
|
68
|
+
name: x,
|
|
69
|
+
seen: l
|
|
63
70
|
});
|
|
64
|
-
typeof y < "u" && (
|
|
71
|
+
typeof y < "u" && (r[s ?? x] = y);
|
|
65
72
|
}
|
|
66
|
-
|
|
73
|
+
o > 3 && e.length > P && (r["..."] = "[Additional Properties Truncated]");
|
|
67
74
|
}
|
|
68
|
-
if ("patternProperties" in
|
|
69
|
-
for (const
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
level:
|
|
73
|
-
parentSchema:
|
|
74
|
-
name:
|
|
75
|
-
seen:
|
|
75
|
+
if ("patternProperties" in t && t.patternProperties)
|
|
76
|
+
for (const e of Object.keys(t.patternProperties)) {
|
|
77
|
+
const n = m(t.patternProperties[e]);
|
|
78
|
+
n && (r[e] = c(n, i, {
|
|
79
|
+
level: o + 1,
|
|
80
|
+
parentSchema: t,
|
|
81
|
+
name: e,
|
|
82
|
+
seen: l
|
|
76
83
|
}));
|
|
77
84
|
}
|
|
78
|
-
if ("additionalProperties" in
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
level:
|
|
82
|
-
seen:
|
|
85
|
+
if ("additionalProperties" in t && t.additionalProperties) {
|
|
86
|
+
const e = m(t.additionalProperties), n = t.additionalProperties === !0 || typeof t.additionalProperties == "object" && Object.keys(t.additionalProperties).length === 0, p = typeof e == "object" && "x-additionalPropertiesName" in e && typeof e["x-additionalPropertiesName"] == "string" && e["x-additionalPropertiesName"].trim().length > 0 ? `${e["x-additionalPropertiesName"].trim()}*` : M;
|
|
87
|
+
r[p] = n ? "anything" : typeof e == "object" ? c(e, i, {
|
|
88
|
+
level: o + 1,
|
|
89
|
+
seen: l
|
|
83
90
|
}) : "anything";
|
|
84
91
|
}
|
|
85
|
-
if (
|
|
92
|
+
if (t.oneOf?.[0])
|
|
86
93
|
Object.assign(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
level:
|
|
90
|
-
seen:
|
|
94
|
+
r,
|
|
95
|
+
c(m(t.oneOf[0]), i, {
|
|
96
|
+
level: o + 1,
|
|
97
|
+
seen: l
|
|
91
98
|
})
|
|
92
99
|
);
|
|
93
|
-
else if (
|
|
100
|
+
else if (t.anyOf?.[0])
|
|
94
101
|
Object.assign(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
level:
|
|
98
|
-
seen:
|
|
102
|
+
r,
|
|
103
|
+
c(m(t.anyOf[0]), i, {
|
|
104
|
+
level: o + 1,
|
|
105
|
+
seen: l
|
|
99
106
|
})
|
|
100
107
|
);
|
|
101
|
-
else if (Array.isArray(
|
|
102
|
-
let
|
|
103
|
-
for (const
|
|
104
|
-
const
|
|
105
|
-
level:
|
|
106
|
-
parentSchema:
|
|
107
|
-
seen:
|
|
108
|
+
else if (Array.isArray(t.allOf) && t.allOf.length > 0) {
|
|
109
|
+
let e = r;
|
|
110
|
+
for (const n of t.allOf) {
|
|
111
|
+
const p = c(m(n), i, {
|
|
112
|
+
level: o + 1,
|
|
113
|
+
parentSchema: t,
|
|
114
|
+
seen: l
|
|
108
115
|
});
|
|
109
|
-
|
|
116
|
+
e = R(e, p);
|
|
110
117
|
}
|
|
111
|
-
|
|
118
|
+
e && typeof e == "object" && Object.assign(r, e);
|
|
112
119
|
}
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
return
|
|
120
|
+
if (i?.xml && "xml" in t && t.xml?.name && o === 0) {
|
|
121
|
+
const e = {};
|
|
122
|
+
return e[t.xml.name] = r, a(t, e, d);
|
|
116
123
|
}
|
|
117
|
-
return
|
|
118
|
-
},
|
|
119
|
-
const
|
|
120
|
-
if (
|
|
121
|
-
return
|
|
122
|
-
if (
|
|
123
|
-
if (Array.isArray(
|
|
124
|
-
const
|
|
124
|
+
return a(t, r, d);
|
|
125
|
+
}, X = (t, i, o, l, d) => {
|
|
126
|
+
const r = "items" in t ? m(t.items) : void 0, e = r && typeof r == "object" && "xml" in r ? r.xml?.name : void 0, n = !!(i?.xml && "xml" in t && t.xml?.wrapped && e);
|
|
127
|
+
if (t.example !== void 0)
|
|
128
|
+
return a(t, n ? { [e]: t.example } : t.example, d);
|
|
129
|
+
if (r && typeof r == "object") {
|
|
130
|
+
if (Array.isArray(r.allOf) && r.allOf.length > 0) {
|
|
131
|
+
const s = r.allOf.filter(v), y = m(s[0]);
|
|
125
132
|
if (y && typeof y == "object" && "type" in y && y.type === "object") {
|
|
126
|
-
const
|
|
127
|
-
level:
|
|
128
|
-
parentSchema:
|
|
129
|
-
seen:
|
|
133
|
+
const g = c({ type: "object", allOf: s }, i, {
|
|
134
|
+
level: o + 1,
|
|
135
|
+
parentSchema: t,
|
|
136
|
+
seen: l
|
|
130
137
|
});
|
|
131
|
-
return
|
|
138
|
+
return a(t, n ? [{ [e]: g }] : [g], d);
|
|
132
139
|
}
|
|
133
|
-
const
|
|
134
|
-
(f) =>
|
|
135
|
-
level:
|
|
136
|
-
parentSchema:
|
|
137
|
-
seen:
|
|
140
|
+
const O = s.map(
|
|
141
|
+
(f) => c(m(f), i, {
|
|
142
|
+
level: o + 1,
|
|
143
|
+
parentSchema: t,
|
|
144
|
+
seen: l
|
|
138
145
|
})
|
|
139
146
|
).filter(v);
|
|
140
|
-
return
|
|
141
|
-
|
|
142
|
-
|
|
147
|
+
return a(
|
|
148
|
+
t,
|
|
149
|
+
n ? O.map((f) => ({ [e]: f })) : O,
|
|
150
|
+
d
|
|
143
151
|
);
|
|
144
152
|
}
|
|
145
|
-
const u =
|
|
153
|
+
const u = r.anyOf || r.oneOf;
|
|
146
154
|
if (u && u.length > 0) {
|
|
147
|
-
const
|
|
148
|
-
level:
|
|
149
|
-
parentSchema:
|
|
150
|
-
seen:
|
|
155
|
+
const s = u[0], y = c(m(s), i, {
|
|
156
|
+
level: o + 1,
|
|
157
|
+
parentSchema: t,
|
|
158
|
+
seen: l
|
|
151
159
|
});
|
|
152
|
-
return
|
|
160
|
+
return a(t, n ? [{ [e]: y }] : [y], d);
|
|
153
161
|
}
|
|
154
162
|
}
|
|
155
|
-
const
|
|
156
|
-
if (
|
|
157
|
-
const u =
|
|
158
|
-
level:
|
|
159
|
-
seen:
|
|
163
|
+
const p = r && typeof r == "object" && ("type" in r && r.type === "object" || "properties" in r), x = r && typeof r == "object" && ("type" in r && r.type === "array" || "items" in r);
|
|
164
|
+
if (r && typeof r == "object" && ("type" in r && r.type || p || x)) {
|
|
165
|
+
const u = c(r, i, {
|
|
166
|
+
level: o + 1,
|
|
167
|
+
seen: l
|
|
160
168
|
});
|
|
161
|
-
return
|
|
169
|
+
return a(t, n ? [{ [e]: u }] : [u], d);
|
|
162
170
|
}
|
|
163
|
-
return
|
|
164
|
-
},
|
|
165
|
-
if ("type" in
|
|
166
|
-
switch (
|
|
171
|
+
return a(t, [], d);
|
|
172
|
+
}, U = (t, i, o) => {
|
|
173
|
+
if ("type" in t && t.type && !Array.isArray(t.type))
|
|
174
|
+
switch (t.type) {
|
|
167
175
|
case "string":
|
|
168
|
-
return
|
|
176
|
+
return w(t, i, o ?? "");
|
|
169
177
|
case "boolean":
|
|
170
178
|
return !0;
|
|
171
179
|
case "integer":
|
|
172
|
-
return "minimum" in
|
|
180
|
+
return "minimum" in t && typeof t.minimum == "number" ? t.minimum : 1;
|
|
173
181
|
case "number":
|
|
174
|
-
return "minimum" in
|
|
182
|
+
return "minimum" in t && typeof t.minimum == "number" ? t.minimum : 1;
|
|
175
183
|
case "array":
|
|
176
184
|
return [];
|
|
177
185
|
default:
|
|
178
186
|
return;
|
|
179
187
|
}
|
|
180
|
-
},
|
|
181
|
-
if ("type" in
|
|
182
|
-
if (
|
|
188
|
+
}, W = (t, i, o) => {
|
|
189
|
+
if ("type" in t && Array.isArray(t.type)) {
|
|
190
|
+
if (t.type.includes("null"))
|
|
183
191
|
return null;
|
|
184
|
-
const
|
|
185
|
-
if (
|
|
186
|
-
switch (
|
|
192
|
+
const l = t.type[0];
|
|
193
|
+
if (l)
|
|
194
|
+
switch (l) {
|
|
187
195
|
case "string":
|
|
188
|
-
return
|
|
196
|
+
return w(t, i, o ?? "");
|
|
189
197
|
case "boolean":
|
|
190
198
|
return !0;
|
|
191
199
|
case "integer":
|
|
192
|
-
return "minimum" in
|
|
200
|
+
return "minimum" in t && typeof t.minimum == "number" ? t.minimum : 1;
|
|
193
201
|
case "number":
|
|
194
|
-
return "minimum" in
|
|
202
|
+
return "minimum" in t && typeof t.minimum == "number" ? t.minimum : 1;
|
|
195
203
|
case "null":
|
|
196
204
|
return null;
|
|
197
205
|
default:
|
|
198
206
|
return;
|
|
199
207
|
}
|
|
200
208
|
}
|
|
201
|
-
},
|
|
202
|
-
|
|
203
|
-
|
|
209
|
+
}, z = (t) => JSON.stringify({
|
|
210
|
+
emptyString: t?.emptyString,
|
|
211
|
+
xml: t?.xml,
|
|
212
|
+
mode: t?.mode,
|
|
213
|
+
variables: t?.variables,
|
|
214
|
+
omitEmptyAndOptionalProperties: t?.omitEmptyAndOptionalProperties
|
|
215
|
+
}), c = (t, i, {
|
|
216
|
+
level: o = 0,
|
|
217
|
+
parentSchema: l,
|
|
218
|
+
name: d,
|
|
219
|
+
seen: r = /* @__PURE__ */ new WeakSet()
|
|
220
|
+
} = {}) => {
|
|
221
|
+
const e = m(t);
|
|
222
|
+
if (!v(e))
|
|
204
223
|
return;
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
224
|
+
const n = E(N(e));
|
|
225
|
+
if (r.has(n))
|
|
207
226
|
return "[Circular Reference]";
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
if (
|
|
211
|
-
return
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
227
|
+
r.add(n);
|
|
228
|
+
const p = z(i), x = A.get(n)?.get(p);
|
|
229
|
+
if (typeof x < "u")
|
|
230
|
+
return r.delete(n), x;
|
|
231
|
+
if (o > D)
|
|
232
|
+
return r.delete(n), "[Max Depth Exceeded]";
|
|
233
|
+
const u = !!i?.emptyString;
|
|
234
|
+
if (F(e, l, d, i)) {
|
|
235
|
+
r.delete(n);
|
|
215
236
|
return;
|
|
216
237
|
}
|
|
217
|
-
if ("x-variable" in
|
|
218
|
-
const f =
|
|
238
|
+
if ("x-variable" in e && e["x-variable"]) {
|
|
239
|
+
const f = i?.variables?.[e["x-variable"]];
|
|
219
240
|
if (f !== void 0)
|
|
220
|
-
return "type" in
|
|
241
|
+
return "type" in e && (e.type === "number" || e.type === "integer") ? (r.delete(n), a(e, Number(f), p)) : (r.delete(n), a(e, f, p));
|
|
221
242
|
}
|
|
222
|
-
if (Array.isArray(
|
|
223
|
-
return
|
|
224
|
-
if (
|
|
225
|
-
return
|
|
226
|
-
if (
|
|
227
|
-
return
|
|
228
|
-
if (
|
|
229
|
-
return
|
|
230
|
-
if (Array.isArray(
|
|
231
|
-
return
|
|
232
|
-
if ("properties" in
|
|
233
|
-
const f =
|
|
234
|
-
return
|
|
243
|
+
if (Array.isArray(e.examples) && e.examples.length > 0)
|
|
244
|
+
return r.delete(n), a(e, e.examples[0], p);
|
|
245
|
+
if (e.example !== void 0)
|
|
246
|
+
return r.delete(n), a(e, e.example, p);
|
|
247
|
+
if (e.default !== void 0)
|
|
248
|
+
return r.delete(n), a(e, e.default, p);
|
|
249
|
+
if (e.const !== void 0)
|
|
250
|
+
return r.delete(n), a(e, e.const, p);
|
|
251
|
+
if (Array.isArray(e.enum) && e.enum.length > 0)
|
|
252
|
+
return r.delete(n), a(e, e.enum[0], p);
|
|
253
|
+
if ("properties" in e || "type" in e && e.type === "object") {
|
|
254
|
+
const f = L(e, i, o, r, p);
|
|
255
|
+
return r.delete(n), f;
|
|
235
256
|
}
|
|
236
|
-
if ("type" in
|
|
237
|
-
const f =
|
|
238
|
-
return
|
|
257
|
+
if ("type" in e && e.type === "array" || "items" in e) {
|
|
258
|
+
const f = X(e, i, o, r, p);
|
|
259
|
+
return r.delete(n), f;
|
|
239
260
|
}
|
|
240
|
-
const
|
|
241
|
-
if (
|
|
242
|
-
return
|
|
243
|
-
const y =
|
|
261
|
+
const s = U(e, u, i?.emptyString);
|
|
262
|
+
if (s !== void 0)
|
|
263
|
+
return r.delete(n), a(e, s, p);
|
|
264
|
+
const y = e.oneOf || e.anyOf;
|
|
244
265
|
if (Array.isArray(y) && y.length > 0) {
|
|
245
266
|
for (const f of y) {
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
248
|
-
return
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
level:
|
|
252
|
-
seen:
|
|
253
|
-
})
|
|
267
|
+
const g = m(f);
|
|
268
|
+
if (g && (!("type" in g) || g.type !== "null"))
|
|
269
|
+
return r.delete(n), a(
|
|
270
|
+
e,
|
|
271
|
+
c(g, i, {
|
|
272
|
+
level: o + 1,
|
|
273
|
+
seen: r
|
|
274
|
+
}),
|
|
275
|
+
p
|
|
254
276
|
);
|
|
255
277
|
}
|
|
256
|
-
return
|
|
278
|
+
return r.delete(n), a(e, null, p);
|
|
257
279
|
}
|
|
258
|
-
if (Array.isArray(
|
|
280
|
+
if (Array.isArray(e.allOf) && e.allOf.length > 0) {
|
|
259
281
|
let f;
|
|
260
|
-
const
|
|
261
|
-
for (const
|
|
262
|
-
const b =
|
|
263
|
-
level:
|
|
264
|
-
parentSchema:
|
|
265
|
-
seen:
|
|
282
|
+
const g = e.allOf;
|
|
283
|
+
for (const T of g) {
|
|
284
|
+
const b = c(T, i, {
|
|
285
|
+
level: o + 1,
|
|
286
|
+
parentSchema: e,
|
|
287
|
+
seen: r
|
|
266
288
|
});
|
|
267
289
|
f === void 0 ? f = b : f && typeof f == "object" && b && typeof b == "object" ? f = R(f, b) : b !== void 0 && (f = b);
|
|
268
290
|
}
|
|
269
|
-
return
|
|
291
|
+
return r.delete(n), a(e, f ?? null, p);
|
|
270
292
|
}
|
|
271
|
-
const
|
|
272
|
-
return
|
|
293
|
+
const O = W(e, u, i?.emptyString);
|
|
294
|
+
return O !== void 0 ? (r.delete(n), a(e, O, p)) : (r.delete(n), a(e, null, p));
|
|
273
295
|
};
|
|
274
296
|
export {
|
|
275
|
-
|
|
297
|
+
c as getExampleFromSchema
|
|
276
298
|
};
|
package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-to-har.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAOvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,SAAS,EAAE,eAAe,CAAA;IAC1B,mCAAmC;IACnC,MAAM,EAAE,UAAU,CAAA;IAClB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACjC,2EAA2E;IAC3E,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;CACzC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,6EAQ5B,mBAAmB,KAAG,
|
|
1
|
+
{"version":3,"file":"operation-to-har.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAOvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,SAAS,EAAE,eAAe,CAAA;IAC1B,mCAAmC;IACnC,MAAM,EAAE,UAAU,CAAA;IAClB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACjC,2EAA2E;IAC3E,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;CACzC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,6EAQ5B,mBAAmB,KAAG,UAgFxB,CAAA"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { getResolvedRef as
|
|
2
|
-
import { processBody as
|
|
1
|
+
import { getResolvedRef as f } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
import { processBody as y } from "./process-body.js";
|
|
3
3
|
import { processParameters as l } from "./process-parameters.js";
|
|
4
4
|
import { processSecuritySchemes as S } from "./process-security-schemes.js";
|
|
5
5
|
import { processServerUrl as g } from "./process-server-url.js";
|
|
6
6
|
const b = ({
|
|
7
7
|
operation: t,
|
|
8
|
-
contentType:
|
|
8
|
+
contentType: i,
|
|
9
9
|
method: h,
|
|
10
|
-
path:
|
|
10
|
+
path: a,
|
|
11
11
|
server: n,
|
|
12
12
|
example: p,
|
|
13
13
|
securitySchemes: m
|
|
14
14
|
}) => {
|
|
15
15
|
const e = {
|
|
16
16
|
method: h,
|
|
17
|
-
url:
|
|
17
|
+
url: a,
|
|
18
18
|
headers: [],
|
|
19
19
|
queryString: [],
|
|
20
20
|
postData: void 0,
|
|
@@ -23,19 +23,19 @@ const b = ({
|
|
|
23
23
|
headersSize: -1,
|
|
24
24
|
bodySize: -1
|
|
25
25
|
};
|
|
26
|
-
if (n?.url && (e.url = g(n,
|
|
26
|
+
if (n?.url && (e.url = g(n, a)), t.parameters) {
|
|
27
27
|
const { url: r, headers: o, queryString: s, cookies: c } = l({
|
|
28
28
|
harRequest: e,
|
|
29
29
|
parameters: t.parameters,
|
|
30
30
|
example: p,
|
|
31
|
-
contentType:
|
|
31
|
+
contentType: i
|
|
32
32
|
});
|
|
33
33
|
e.url = r, e.headers = o, e.queryString = s, e.cookies = c;
|
|
34
34
|
}
|
|
35
|
-
const u =
|
|
35
|
+
const u = f(t.requestBody);
|
|
36
36
|
if (u?.content) {
|
|
37
|
-
const r =
|
|
38
|
-
if (e.postData = r, e.bodySize = r.text?.length ?? -1, r.mimeType) {
|
|
37
|
+
const r = y({ requestBody: u, contentType: i, example: p });
|
|
38
|
+
if (r && (e.postData = r, e.bodySize = r.text?.length ?? -1, r.mimeType)) {
|
|
39
39
|
const o = e.headers.find(
|
|
40
40
|
(s) => s.name.toLowerCase() === "content-type"
|
|
41
41
|
);
|
|
@@ -6,7 +6,8 @@ type ProcessBodyProps = Pick<OperationToHarProps, 'contentType' | 'example'> & {
|
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* Processes the request body and returns the processed data
|
|
9
|
+
* Returns undefined if no example is found
|
|
9
10
|
*/
|
|
10
|
-
export declare const processBody: ({ requestBody, contentType, example }: ProcessBodyProps) => PostData;
|
|
11
|
+
export declare const processBody: ({ requestBody, contentType, example }: ProcessBodyProps) => PostData | undefined;
|
|
11
12
|
export {};
|
|
12
13
|
//# sourceMappingURL=process-body.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-body.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAErG,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"process-body.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAErG,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,KAAK,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,GAAG,SAAS,CAAC,GAAG;IAC7E,WAAW,EAAE,iBAAiB,CAAA;CAC/B,CAAA;AAoCD;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,uCAAuC,gBAAgB,KAAG,QAAQ,GAAG,SAiEhG,CAAA"}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { json2xml as s } from "@scalar/helpers/file/json2xml";
|
|
2
2
|
import { getResolvedRef as c } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
3
|
import { getExampleFromSchema as l } from "../get-example-from-schema.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getExample as u } from "../../../operation-block/helpers/get-example.js";
|
|
5
5
|
const p = (i) => {
|
|
6
6
|
const n = [];
|
|
7
7
|
for (const [a, e] of Object.entries(i))
|
|
8
8
|
if (e != null)
|
|
9
9
|
if (Array.isArray(e))
|
|
10
|
-
for (const
|
|
11
|
-
n.push({ name: a, value: String(
|
|
10
|
+
for (const r of e)
|
|
11
|
+
n.push({ name: a, value: String(r) });
|
|
12
12
|
else if (typeof e == "object") {
|
|
13
|
-
const
|
|
14
|
-
for (const
|
|
15
|
-
n.push({ name: `${a}.${
|
|
13
|
+
const r = p(e);
|
|
14
|
+
for (const m of r)
|
|
15
|
+
n.push({ name: `${a}.${m.name}`, value: m.value });
|
|
16
16
|
} else
|
|
17
17
|
n.push({ name: a, value: String(e) });
|
|
18
18
|
return n;
|
|
19
|
-
},
|
|
20
|
-
const e = n || Object.keys(i.content)[0] || "",
|
|
19
|
+
}, j = ({ requestBody: i, contentType: n, example: a }) => {
|
|
20
|
+
const e = n || Object.keys(i.content)[0] || "", r = e === "multipart/form-data" || e === "application/x-www-form-urlencoded", m = e === "application/xml", t = u(i, a, n)?.value;
|
|
21
21
|
if (typeof t < "u")
|
|
22
|
-
return
|
|
22
|
+
return r && typeof t == "object" && t !== null ? {
|
|
23
23
|
mimeType: e,
|
|
24
24
|
params: p(t)
|
|
25
|
-
} :
|
|
25
|
+
} : m && typeof t == "object" && t !== null ? {
|
|
26
26
|
mimeType: e,
|
|
27
27
|
text: s(t)
|
|
28
28
|
} : {
|
|
29
29
|
mimeType: e,
|
|
30
|
-
text: JSON.stringify(t)
|
|
30
|
+
text: typeof t == "string" ? t : JSON.stringify(t)
|
|
31
31
|
};
|
|
32
32
|
const f = c(i.content[e]?.schema);
|
|
33
33
|
if (typeof f < "u") {
|
|
34
34
|
const o = l(f, {
|
|
35
35
|
mode: "write",
|
|
36
|
-
xml:
|
|
36
|
+
xml: m
|
|
37
37
|
});
|
|
38
38
|
if (o !== void 0)
|
|
39
|
-
return
|
|
39
|
+
return r && typeof o == "object" && o !== null ? {
|
|
40
40
|
mimeType: e,
|
|
41
41
|
params: p(o)
|
|
42
|
-
} :
|
|
42
|
+
} : m && typeof o == "object" && o !== null ? {
|
|
43
43
|
mimeType: e,
|
|
44
44
|
text: s(o)
|
|
45
45
|
} : {
|
|
@@ -47,11 +47,7 @@ const p = (i) => {
|
|
|
47
47
|
text: JSON.stringify(o)
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
return {
|
|
51
|
-
mimeType: e,
|
|
52
|
-
text: "null"
|
|
53
|
-
};
|
|
54
50
|
};
|
|
55
51
|
export {
|
|
56
|
-
|
|
52
|
+
j as processBody
|
|
57
53
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getResolvedRef as d } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
2
|
import { getExampleFromSchema as p } from "../get-example-from-schema.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getExample as h } from "../../../operation-block/helpers/get-example.js";
|
|
4
4
|
const A = (e) => (e ?? []).map((o) => d(o)), g = (e) => {
|
|
5
5
|
if (e.in === "header")
|
|
6
6
|
return { style: "simple", explode: "explode" in e && e.explode !== void 0 ? e.explode : !1 };
|
|
@@ -14,7 +14,7 @@ const A = (e) => (e ?? []).map((o) => d(o)), g = (e) => {
|
|
|
14
14
|
}[e.in], t = "style" in e && e.style ? e.style : o, $ = "explode" in e && e.explode !== void 0 ? e.explode : t === "form";
|
|
15
15
|
return { style: t, explode: $ };
|
|
16
16
|
}, S = (e, o, t) => {
|
|
17
|
-
const $ = h(e, o, t);
|
|
17
|
+
const $ = h(e, o, t)?.value;
|
|
18
18
|
if ($ !== void 0)
|
|
19
19
|
return $;
|
|
20
20
|
if ("schema" in e && e.schema) {
|