@scalar/api-client 2.0.63 → 2.1.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 +63 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +64 -62
- package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue.js +77 -69
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +121 -0
- package/dist/components/AddressBar/AddressBarServer.vue2.js +4 -0
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts +22 -0
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -0
- package/dist/components/AddressBar/AddressBarServerItem.vue.js +57 -0
- package/dist/components/AddressBar/AddressBarServerItem.vue2.js +4 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts +1 -6
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +87 -82
- package/dist/components/CodeInput/codeVariableWidget.d.ts +4 -4
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +70 -63
- package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +33 -0
- package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -0
- package/dist/components/CommandPalette/CommandActionForm.vue.js +41 -0
- package/dist/components/CommandPalette/CommandActionForm.vue2.js +4 -0
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +20 -0
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -0
- package/dist/components/CommandPalette/CommandActionInput.vue.js +42 -0
- package/dist/components/CommandPalette/CommandActionInput.vue2.js +4 -0
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +33 -56
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +88 -109
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +56 -73
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +21 -2
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +122 -133
- package/dist/components/CommandPalette/{CommandPaletteFolder.vue.d.ts → CommandPaletteServer.vue.d.ts} +1 -1
- package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -0
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +92 -0
- package/dist/components/CommandPalette/CommandPaletteServer.vue2.js +4 -0
- package/dist/components/CommandPalette/CommandPaletteTag.vue.d.ts +7 -0
- package/dist/components/CommandPalette/CommandPaletteTag.vue.d.ts.map +1 -0
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +87 -0
- package/dist/components/CommandPalette/CommandPaletteTag.vue2.js +4 -0
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +33 -49
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +22 -3
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +3 -3
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +107 -101
- package/dist/components/ContextBar.vue.d.ts.map +1 -1
- package/dist/components/ContextBar.vue.js +2 -2
- package/dist/components/ContextBar.vue2.js +2 -2
- package/dist/components/DataTable/DataTable.vue.js +1 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +2 -2
- package/dist/components/DataTable/DataTableInput.vue2.js +13 -13
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +39 -40
- package/dist/components/DataTable/index.js +12 -12
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +7 -7
- package/dist/components/Form/Form.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
- package/dist/components/HttpMethod/HttpMethod.vue2.js +30 -30
- package/dist/components/HttpMethod/helpers.d.ts +4 -0
- package/dist/components/HttpMethod/helpers.d.ts.map +1 -0
- package/dist/components/HttpMethod/helpers.js +5 -0
- package/dist/components/HttpMethod/index.d.ts +1 -0
- package/dist/components/HttpMethod/index.d.ts.map +1 -1
- package/dist/components/HttpMethod/index.js +4 -2
- package/dist/components/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/components/Search/SearchModal.vue.js +2 -2
- package/dist/components/Search/SearchModal.vue2.js +29 -27
- package/dist/components/Search/useSearch.js +35 -35
- package/dist/components/SideNav/SideNavLink.vue.js +6 -6
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +14 -17
- package/dist/components/Sidebar/Actions/RenameSidebarListElement.vue.d.ts +22 -0
- package/dist/components/Sidebar/Actions/RenameSidebarListElement.vue.d.ts.map +1 -0
- package/dist/components/Sidebar/Actions/RenameSidebarListElement.vue.js +29 -0
- package/dist/components/Sidebar/Actions/RenameSidebarListElement.vue2.js +4 -0
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +38 -35
- package/dist/components/Sidebar/Sidebar.vue.d.ts +2 -1
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +5 -54
- package/dist/components/Sidebar/Sidebar.vue2.js +59 -0
- package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarButton.vue.js +11 -11
- package/dist/components/Sidebar/index.js +2 -3
- package/dist/components/SubpageHeader.vue.d.ts.map +1 -1
- package/dist/components/SubpageHeader.vue.js +3 -3
- package/dist/components/SubpageHeader.vue2.js +3 -3
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue2.js +23 -23
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +2 -2
- package/dist/components/TopNav/TopNavItem.vue2.js +21 -21
- package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.js +7 -7
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +5 -5
- package/dist/components/ViewLayout/ViewLayoutContent.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js +4 -4
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
- package/dist/components/index.js +4 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +39 -53
- package/dist/layouts/App/create-api-client-app.d.ts +2058 -1941
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.js +12 -12
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue2.js +6 -6
- package/dist/layouts/Modal/create-api-client-modal.d.ts +4590 -4356
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.js +18 -23
- package/dist/libs/create-client.d.ts +2086 -1972
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +85 -76
- package/dist/libs/environment-parser.d.ts +9 -0
- package/dist/libs/environment-parser.d.ts.map +1 -0
- package/dist/libs/environment-parser.js +17 -0
- package/dist/libs/errors.d.ts +21 -0
- package/dist/libs/errors.d.ts.map +1 -0
- package/dist/libs/errors.js +14 -0
- package/dist/libs/event-busses/command-palette-bus.d.ts +1 -1
- package/dist/libs/event-busses/command-palette-bus.d.ts.map +1 -1
- package/dist/libs/event-busses/hot-keys-bus.d.ts +4 -4
- package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
- package/dist/libs/event-busses/hot-keys-bus.js +17 -19
- package/dist/libs/index.d.ts +5 -2
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +31 -24
- package/dist/libs/local-storage.d.ts +3 -3
- package/dist/libs/local-storage.d.ts.map +1 -1
- package/dist/libs/local-storage.js +24 -12
- package/dist/libs/normalize-headers.d.ts +14 -0
- package/dist/libs/normalize-headers.d.ts.map +1 -0
- package/dist/libs/normalize-headers.js +32 -0
- package/dist/libs/send-request.d.ts +28 -0
- package/dist/libs/send-request.d.ts.map +1 -0
- package/dist/libs/send-request.js +186 -0
- package/dist/libs/string-template.d.ts +19 -0
- package/dist/libs/string-template.d.ts.map +1 -0
- package/dist/libs/string-template.js +30 -0
- package/dist/router.d.ts +5 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +36 -27
- package/dist/store/collections.d.ts +705 -0
- package/dist/store/collections.d.ts.map +1 -0
- package/dist/store/collections.js +63 -0
- package/dist/store/cookies.d.ts +135 -0
- package/dist/store/cookies.d.ts.map +1 -0
- package/dist/store/cookies.js +29 -0
- package/dist/store/environment.d.ts +80 -0
- package/dist/store/environment.d.ts.map +1 -0
- package/dist/store/environment.js +39 -0
- package/dist/store/import-spec.d.ts +8 -0
- package/dist/store/import-spec.d.ts.map +1 -0
- package/dist/store/import-spec.js +45 -0
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/request-example.d.ts +1111 -0
- package/dist/store/request-example.d.ts.map +1 -0
- package/dist/store/request-example.js +47 -0
- package/dist/store/requests.d.ts +371 -0
- package/dist/store/requests.d.ts.map +1 -0
- package/dist/store/requests.js +107 -0
- package/dist/store/router-params.d.ts +15 -0
- package/dist/store/router-params.d.ts.map +1 -0
- package/dist/store/router-params.js +21 -0
- package/dist/store/security-schemes.d.ts +616 -0
- package/dist/store/security-schemes.d.ts.map +1 -0
- package/dist/store/security-schemes.js +68 -0
- package/dist/store/servers.d.ts +99 -0
- package/dist/store/servers.d.ts.map +1 -0
- package/dist/store/servers.js +46 -0
- package/dist/store/store-context.d.ts +29 -0
- package/dist/store/store-context.d.ts.map +1 -0
- package/dist/store/store.d.ts +7504 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +200 -0
- package/dist/store/tags.d.ts +169 -0
- package/dist/store/tags.d.ts.map +1 -0
- package/dist/store/tags.js +57 -0
- package/dist/store/workspace.d.ts +93 -7150
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +49 -543
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +2 -2
- package/dist/views/Cookies/CookieRaw.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieRaw.vue.js +10 -10
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +29 -32
- package/dist/views/Environment/Environment.vue2.js +31 -33
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +11 -5
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +79 -59
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/Request.vue2.js +87 -319
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.d.ts +36 -0
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +59 -0
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue2.js +4 -0
- package/dist/views/Request/{components → RequestSection/RequestAuth}/OAuth2.vue.d.ts +3 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +216 -0
- package/dist/views/Request/{components → RequestSection/RequestAuth}/OAuthScopesInput.vue.d.ts +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -0
- package/dist/views/Request/{components → RequestSection/RequestAuth}/OAuthScopesInput.vue.js +3 -3
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +7 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +183 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthModal.vue.d.ts +30 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthModal.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts +3 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +140 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +4 -0
- package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +167 -186
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +49 -49
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +26 -22
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +103 -102
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +5 -5
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.d.ts +30 -0
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSidebar.vue.js +7 -0
- package/dist/views/Request/RequestSidebar.vue2.js +179 -0
- package/dist/views/Request/RequestSidebarItem.vue.d.ts +6 -7
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue2.js +283 -254
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +3 -5
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +9 -7
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts +24 -0
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSubpageHeader.vue.js +7 -0
- package/dist/views/Request/RequestSubpageHeader.vue2.js +48 -0
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +21 -21
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +17 -16
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +37 -30
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +2 -2
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +69 -90
- package/dist/views/Request/components/index.d.ts +0 -1
- package/dist/views/Request/components/index.d.ts.map +1 -1
- package/dist/views/Request/components/index.js +2 -4
- package/dist/views/Request/consts/new-auth-options.d.ts +11 -1
- package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -1
- package/dist/views/Request/consts/new-auth-options.js +17 -7
- package/dist/views/Request/handle-drag.d.ts +8 -0
- package/dist/views/Request/handle-drag.d.ts.map +1 -0
- package/dist/views/Request/handle-drag.js +56 -0
- package/dist/views/Request/libs/auth.d.ts +35 -0
- package/dist/views/Request/libs/auth.d.ts.map +1 -0
- package/dist/views/Request/libs/auth.js +14 -0
- package/dist/views/Request/libs/index.d.ts +1 -0
- package/dist/views/Request/libs/index.d.ts.map +1 -1
- package/dist/views/Request/libs/index.js +7 -3
- package/dist/views/Request/libs/oauth2.d.ts +12 -3
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +42 -27
- package/dist/views/Servers/ServerForm.vue.js +22 -22
- package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue2.js +18 -16
- package/package.json +11 -11
- package/dist/components/CodeInput/codeDropdownWidget.d.ts +0 -32
- package/dist/components/CodeInput/codeDropdownWidget.d.ts.map +0 -1
- package/dist/components/CodeInput/codeDropdownWidget.js +0 -121
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +0 -1
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +0 -106
- package/dist/components/CommandPalette/CommandPaletteFolder.vue2.js +0 -4
- package/dist/components/Sidebar/Sidebar.vue3.js +0 -5
- package/dist/errors.d.ts +0 -5
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -7
- package/dist/libs/normalizeHeaders.d.ts +0 -11
- package/dist/libs/normalizeHeaders.d.ts.map +0 -1
- package/dist/libs/normalizeHeaders.js +0 -25
- package/dist/libs/pathParams.d.ts +0 -10
- package/dist/libs/pathParams.d.ts.map +0 -1
- package/dist/libs/pathParams.js +0 -36
- package/dist/libs/sendRequest.d.ts +0 -14
- package/dist/libs/sendRequest.d.ts.map +0 -1
- package/dist/libs/sendRequest.js +0 -163
- package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +0 -1
- package/dist/views/Request/RequestSection/RequestAuth.vue.js +0 -7
- package/dist/views/Request/RequestSection/RequestAuth.vue2.js +0 -351
- package/dist/views/Request/components/OAuth2.vue.d.ts.map +0 -1
- package/dist/views/Request/components/OAuth2.vue.js +0 -208
- package/dist/views/Request/components/OAuthScopesInput.vue.d.ts.map +0 -1
- /package/dist/views/Request/{components → RequestSection/RequestAuth}/OAuth2.vue2.js +0 -0
- /package/dist/views/Request/{components → RequestSection/RequestAuth}/OAuthScopesInput.vue2.js +0 -0
- /package/dist/views/Request/RequestSection/{RequestAuth.vue.d.ts → RequestAuth/RequestAuth.vue.d.ts} +0 -0
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
import { migrator as E, DATA_VERSION_LS_LEY as k, DATA_VERSION as q } from "@scalar/oas-utils/migrations";
|
|
2
|
+
const _ = (t) => {
|
|
2
3
|
const {
|
|
3
|
-
collectionMutators:
|
|
4
|
-
cookieMutators:
|
|
4
|
+
collectionMutators: e,
|
|
5
|
+
cookieMutators: a,
|
|
5
6
|
environmentMutators: r,
|
|
6
|
-
|
|
7
|
-
requestExampleMutators:
|
|
8
|
-
requestMutators:
|
|
7
|
+
tagMutators: s,
|
|
8
|
+
requestExampleMutators: l,
|
|
9
|
+
requestMutators: c,
|
|
9
10
|
serverMutators: u,
|
|
10
|
-
securitySchemeMutators:
|
|
11
|
-
workspaceMutators:
|
|
12
|
-
} =
|
|
11
|
+
securitySchemeMutators: S,
|
|
12
|
+
workspaceMutators: g
|
|
13
|
+
} = t;
|
|
13
14
|
try {
|
|
14
|
-
|
|
15
|
+
const {
|
|
16
|
+
collections: o,
|
|
17
|
+
cookies: n,
|
|
18
|
+
environments: L,
|
|
19
|
+
requestExamples: d,
|
|
20
|
+
requests: i,
|
|
21
|
+
servers: m,
|
|
22
|
+
securitySchemes: M,
|
|
23
|
+
tags: p,
|
|
24
|
+
workspaces: A
|
|
25
|
+
} = E();
|
|
26
|
+
e.loadLocalStorage(o), a.loadLocalStorage(n), r.loadLocalStorage(L), l.loadLocalStorage(d), c.loadLocalStorage(i), u.loadLocalStorage(m), S.loadLocalStorage(M), s.loadLocalStorage(p), g.loadLocalStorage(A), localStorage.setItem(k, q);
|
|
15
27
|
} catch (o) {
|
|
16
|
-
|
|
28
|
+
console.error(o);
|
|
17
29
|
}
|
|
18
30
|
};
|
|
19
31
|
export {
|
|
20
|
-
|
|
32
|
+
_ as loadAllResources
|
|
21
33
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize headers:
|
|
3
|
+
*
|
|
4
|
+
* - Electron modifies the headers to allow CORS, this function hides the modifications
|
|
5
|
+
* - Restores original headers
|
|
6
|
+
* - Normalizes the header keys
|
|
7
|
+
* - Sorts headers alphabetically
|
|
8
|
+
* - converts to an object
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export declare const normalizeHeaders: (_headers: Headers, removeProxyHeaders?: boolean) => Record<string, string>;
|
|
12
|
+
/** Make the first letter and all letters after a dash uppercase */
|
|
13
|
+
export declare const formatHeaderKey: (key: string) => string;
|
|
14
|
+
//# sourceMappingURL=normalize-headers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-headers.d.ts","sourceRoot":"","sources":["../../src/libs/normalize-headers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,aACjB,OAAO,mCAEhB,MAAM,CAAC,MAAM,EAAE,MAAM,CAqEvB,CAAA;AAED,mEAAmE;AACnE,eAAO,MAAM,eAAe,QAAS,MAAM,WAM7B,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const f = (a, t = !1) => {
|
|
2
|
+
var c, l;
|
|
3
|
+
const o = Object.fromEntries(a);
|
|
4
|
+
t && [
|
|
5
|
+
"Access-Control-Allow-Credentials",
|
|
6
|
+
"Access-Control-Allow-Headers",
|
|
7
|
+
"Access-Control-Allow-Methods",
|
|
8
|
+
"Access-Control-Allow-Origin",
|
|
9
|
+
"Access-Control-Expose-Headers"
|
|
10
|
+
].map((s) => s.toLowerCase()).forEach((s) => delete o[s]);
|
|
11
|
+
const r = Object.keys(o).find(
|
|
12
|
+
(e) => e.toLowerCase() === "x-scalar-modified-headers"
|
|
13
|
+
), i = r ? ((l = (c = o[r]) == null ? void 0 : c.toString().split(", ")) == null ? void 0 : l.map((e) => e.toLowerCase())) ?? [] : [];
|
|
14
|
+
return Object.keys(o).forEach((e) => {
|
|
15
|
+
i.includes(e.toLowerCase()) && delete o[e];
|
|
16
|
+
}), r && delete o[r], Object.keys(o).forEach((e) => {
|
|
17
|
+
const s = /^x-scalar-original-/i;
|
|
18
|
+
if (s.test(e)) {
|
|
19
|
+
const n = e.replace(s, "");
|
|
20
|
+
o[n] = o[e], delete o[e];
|
|
21
|
+
}
|
|
22
|
+
}), Object.keys(o).forEach((e) => {
|
|
23
|
+
const s = d(e);
|
|
24
|
+
e !== s && (o[s] = o[e], delete o[e]);
|
|
25
|
+
}), Object.fromEntries(
|
|
26
|
+
Object.entries(o).sort(([e], [s]) => e.localeCompare(s))
|
|
27
|
+
);
|
|
28
|
+
}, d = (a) => a.split("-").map((t) => t.charAt(0).toUpperCase() + t.toLowerCase().slice(1)).join("-");
|
|
29
|
+
export {
|
|
30
|
+
d as formatHeaderKey,
|
|
31
|
+
f as normalizeHeaders
|
|
32
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ErrorResponse } from '../libs/errors.js';
|
|
2
|
+
import type { Cookie } from '@scalar/oas-utils/entities/cookie';
|
|
3
|
+
import type { Collection, Request, RequestExample, ResponseInstance, SecurityScheme, Server } from '@scalar/oas-utils/entities/spec';
|
|
4
|
+
/** Response from sendRequest hoisted so we can use it as the return type for createRequestOperation */
|
|
5
|
+
type SendRequestResponse<ResponseDataType = unknown> = Promise<ErrorResponse<{
|
|
6
|
+
response: ResponseInstance<ResponseDataType>;
|
|
7
|
+
request: RequestExample;
|
|
8
|
+
timestamp: number;
|
|
9
|
+
}>>;
|
|
10
|
+
/**
|
|
11
|
+
* Execute the request
|
|
12
|
+
* called from the send button as well as keyboard shortcuts
|
|
13
|
+
*/
|
|
14
|
+
export declare const createRequestOperation: <ResponseDataType = unknown>({ request, auth, example, server, securitySchemes, proxy, environment, globalCookies, }: {
|
|
15
|
+
auth: Collection["auth"];
|
|
16
|
+
request: Request;
|
|
17
|
+
example: RequestExample;
|
|
18
|
+
proxy?: string;
|
|
19
|
+
environment: object | undefined;
|
|
20
|
+
server?: Server;
|
|
21
|
+
securitySchemes: Record<string, SecurityScheme>;
|
|
22
|
+
globalCookies: Cookie[];
|
|
23
|
+
}) => ErrorResponse<{
|
|
24
|
+
controller: AbortController;
|
|
25
|
+
sendRequest: () => SendRequestResponse<ResponseDataType>;
|
|
26
|
+
}>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=send-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-request.d.ts","sourceRoot":"","sources":["../../src/libs/send-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,aAAa,EAAkB,MAAM,eAAe,CAAA;AAK1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC/D,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,cAAc,EAEd,gBAAgB,EAChB,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AA8LxC,uGAAuG;AACvG,KAAK,mBAAmB,CAAC,gBAAgB,GAAG,OAAO,IAAI,OAAO,CAC5D,aAAa,CAAC;IACZ,QAAQ,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAA;IAC5C,OAAO,EAAE,cAAc,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAC,CACH,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,gBAAgB,qGASpD;IACD,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,cAAc,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC/C,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB,KAAG,aAAa,CAAC;IAChB,UAAU,EAAE,eAAe,CAAA;IAC3B,WAAW,EAAE,MAAM,mBAAmB,CAAC,gBAAgB,CAAC,CAAA;CACzD,CA2LA,CAAA"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { ERRORS as T, normalizeError as L } from "./errors.js";
|
|
2
|
+
import { normalizeHeaders as M } from "./normalize-headers.js";
|
|
3
|
+
import { replaceTemplateVariables as d } from "./string-template.js";
|
|
4
|
+
import { isRelativePath as E, shouldUseProxy as B, canMethodHaveBody as z } from "@scalar/oas-utils/helpers";
|
|
5
|
+
import k from "js-cookie";
|
|
6
|
+
import H from "whatwg-mimetype";
|
|
7
|
+
import { requestStatusBus as v } from "./event-busses/request-status-bus.js";
|
|
8
|
+
import { textMediaTypes as q } from "../views/Request/consts/mediaTypes.js";
|
|
9
|
+
function _(s, n) {
|
|
10
|
+
const t = new H(n);
|
|
11
|
+
if (q.includes(t.essence)) {
|
|
12
|
+
const m = new TextDecoder(t.parameters.get("charset")).decode(s);
|
|
13
|
+
return t.subtype === "json" ? JSON.parse(m) : m;
|
|
14
|
+
}
|
|
15
|
+
return new Blob([s], { type: t.essence });
|
|
16
|
+
}
|
|
17
|
+
function K(s, n) {
|
|
18
|
+
const t = {};
|
|
19
|
+
return s.parameters.headers.forEach((o) => {
|
|
20
|
+
o.enabled && (t[o.key.toLowerCase()] = d(o.value, n));
|
|
21
|
+
}), t;
|
|
22
|
+
}
|
|
23
|
+
function j(s, n) {
|
|
24
|
+
const t = new URLSearchParams();
|
|
25
|
+
return s.parameters.query.forEach((o) => {
|
|
26
|
+
o.enabled && t.append(o.key, d(o.value, n));
|
|
27
|
+
}), t;
|
|
28
|
+
}
|
|
29
|
+
function N({
|
|
30
|
+
example: s,
|
|
31
|
+
env: n,
|
|
32
|
+
globalCookies: t,
|
|
33
|
+
domain: o,
|
|
34
|
+
proxy: m
|
|
35
|
+
}) {
|
|
36
|
+
let c;
|
|
37
|
+
try {
|
|
38
|
+
c = new URL(m || o).host;
|
|
39
|
+
} catch {
|
|
40
|
+
typeof window < "u" && (c = window.location.host);
|
|
41
|
+
}
|
|
42
|
+
const l = {
|
|
43
|
+
// Must point all cookies to the proxy and let it sort them out
|
|
44
|
+
domain: c,
|
|
45
|
+
// Means that the browser sends the cookie with both cross-site and same-site requests.
|
|
46
|
+
sameSite: "None",
|
|
47
|
+
// The Secure attribute must also be set when setting SameSite=None.
|
|
48
|
+
secure: !0
|
|
49
|
+
}, f = k.get();
|
|
50
|
+
return Object.keys(f).forEach((e) => k.remove(e)), s.parameters.cookies.forEach((e) => {
|
|
51
|
+
e.enabled && k.set(e.key, d(e.value, n));
|
|
52
|
+
}), t.forEach((e) => {
|
|
53
|
+
var i;
|
|
54
|
+
const { name: R, value: U, ...u } = e;
|
|
55
|
+
(u.domain === o || ((i = u.domain) == null ? void 0 : i.startsWith(".")) && o.endsWith(u.domain ?? "")) && k.set(R, U, {
|
|
56
|
+
/** Override the domain with the proxy value */
|
|
57
|
+
domain: c,
|
|
58
|
+
// TODO: path cookies probably don't worth with the proxy
|
|
59
|
+
path: u.path,
|
|
60
|
+
expires: u.expires ? new Date(u.expires) : void 0,
|
|
61
|
+
httpOnly: u.httpOnly,
|
|
62
|
+
secure: u.secure
|
|
63
|
+
});
|
|
64
|
+
}), {
|
|
65
|
+
cookieParams: l
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function Q(s, n, t) {
|
|
69
|
+
var o, m, c;
|
|
70
|
+
if (!z(s))
|
|
71
|
+
return { body: void 0, contentType: void 0 };
|
|
72
|
+
if (n.body.activeBody === "formData" && n.body.formData) {
|
|
73
|
+
const l = n.body.formData.encoding === "form-data" ? "multipart/form-data" : "application/x-www-form-urlencoded", f = n.body.formData.encoding === "form-data" ? new FormData() : new URLSearchParams();
|
|
74
|
+
return n.body.formData.value.forEach((e) => {
|
|
75
|
+
!e.enabled || !e.key || (e.file && f instanceof FormData ? f.append(e.key, e.file, e.file.name) : e.value !== void 0 && f.append(e.key, d(e.value, t)));
|
|
76
|
+
}), { body: f, contentType: l };
|
|
77
|
+
}
|
|
78
|
+
return n.body.activeBody === "raw" ? {
|
|
79
|
+
body: d(((o = n.body.raw) == null ? void 0 : o.value) ?? "", t),
|
|
80
|
+
contentType: (m = n.body.raw) == null ? void 0 : m.encoding
|
|
81
|
+
} : n.body.activeBody === "binary" ? {
|
|
82
|
+
body: n.body.binary,
|
|
83
|
+
contentType: (c = n.body.binary) == null ? void 0 : c.type
|
|
84
|
+
} : {
|
|
85
|
+
body: void 0,
|
|
86
|
+
contentType: void 0
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
const te = ({
|
|
90
|
+
request: s,
|
|
91
|
+
auth: n,
|
|
92
|
+
example: t,
|
|
93
|
+
server: o,
|
|
94
|
+
securitySchemes: m,
|
|
95
|
+
proxy: c,
|
|
96
|
+
environment: l,
|
|
97
|
+
globalCookies: f
|
|
98
|
+
}) => {
|
|
99
|
+
try {
|
|
100
|
+
const e = l ?? {}, R = new AbortController(), U = t.parameters.path.reduce((p, a) => (a.enabled && (p[a.key] = d(a.value, e)), p), {}), u = d((o == null ? void 0 : o.url) ?? "", e), y = d(s.path, U);
|
|
101
|
+
let i = u || y;
|
|
102
|
+
if (!i) throw T.URL_EMPTY;
|
|
103
|
+
const P = j(t, e), w = K(t, e), { body: C } = Q(s.method, t, e), { cookieParams: V } = N({
|
|
104
|
+
example: t,
|
|
105
|
+
env: e,
|
|
106
|
+
globalCookies: f,
|
|
107
|
+
domain: i,
|
|
108
|
+
proxy: c
|
|
109
|
+
});
|
|
110
|
+
return s.selectedSecuritySchemeUids.forEach((p) => {
|
|
111
|
+
const a = n[p], h = m[p];
|
|
112
|
+
if (!(!a || !h)) {
|
|
113
|
+
if (h.type === "apiKey" && a.type === "apiKey") {
|
|
114
|
+
const r = d(a.value, e);
|
|
115
|
+
h.in === "header" && (w[a.name] = r), h.in === "query" && P.append(a.name, r), h.in === "cookie" && k.set(a.name, r);
|
|
116
|
+
}
|
|
117
|
+
if (h.type === "http" && a.type === "http")
|
|
118
|
+
if (h.scheme === "basic") {
|
|
119
|
+
const r = d(a.username, e), g = d(a.password, e), D = g ? `${r}:${g}` : r;
|
|
120
|
+
w.Authorization = `Basic ${btoa(D)}`;
|
|
121
|
+
} else {
|
|
122
|
+
const r = d(a.token, e);
|
|
123
|
+
w.Authorization = `Bearer ${r}`;
|
|
124
|
+
}
|
|
125
|
+
h.type === "oauth2" && a.type.includes("oauth") && "token" in a && (a.token || console.error("OAuth token was not created"), w.Authorization = `Bearer ${a.token}`);
|
|
126
|
+
}
|
|
127
|
+
}), [
|
|
128
|
+
null,
|
|
129
|
+
{
|
|
130
|
+
sendRequest: async () => {
|
|
131
|
+
v.emit("start");
|
|
132
|
+
const p = Date.now();
|
|
133
|
+
try {
|
|
134
|
+
if (i && (!E(i) || typeof window < "u")) {
|
|
135
|
+
const O = E(i) ? window.location.origin + i : i, b = new URL(O), $ = new URL(y, b.origin), S = new URL(b);
|
|
136
|
+
o != null && o.url && (b.pathname === "/" ? S.pathname = y : S.pathname = b.pathname + y), S.search = new URLSearchParams([
|
|
137
|
+
...b.searchParams,
|
|
138
|
+
...$.searchParams,
|
|
139
|
+
...P
|
|
140
|
+
]).toString(), i = S.toString();
|
|
141
|
+
}
|
|
142
|
+
const a = new URLSearchParams([["scalar_url", i.toString()]]), h = B(c, i) ? `${c}?${a.toString()}` : i, r = await fetch(h, {
|
|
143
|
+
signal: R.signal,
|
|
144
|
+
method: s.method,
|
|
145
|
+
body: C,
|
|
146
|
+
headers: w
|
|
147
|
+
});
|
|
148
|
+
v.emit("stop");
|
|
149
|
+
const g = M(
|
|
150
|
+
r.headers,
|
|
151
|
+
B(c, i)
|
|
152
|
+
), D = r.headers.get("content-type") ?? "text/plain;charset=UTF-8", A = _(
|
|
153
|
+
await r.arrayBuffer(),
|
|
154
|
+
D
|
|
155
|
+
), F = "getSetCookie" in r.headers && typeof r.headers.getSetCookie == "function" ? r.headers.getSetCookie() : [];
|
|
156
|
+
return [
|
|
157
|
+
null,
|
|
158
|
+
{
|
|
159
|
+
timestamp: Date.now(),
|
|
160
|
+
request: t,
|
|
161
|
+
response: {
|
|
162
|
+
...r,
|
|
163
|
+
headers: g,
|
|
164
|
+
cookieHeaderKeys: F,
|
|
165
|
+
data: A,
|
|
166
|
+
duration: Date.now() - p,
|
|
167
|
+
method: s.method,
|
|
168
|
+
status: r.status,
|
|
169
|
+
path: y
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
];
|
|
173
|
+
} catch (a) {
|
|
174
|
+
return v.emit("abort"), [L(a, T.REQUEST_FAILED), null];
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
controller: R
|
|
178
|
+
}
|
|
179
|
+
];
|
|
180
|
+
} catch (e) {
|
|
181
|
+
return v.emit("abort"), [L(e), null];
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
export {
|
|
185
|
+
te as createRequestOperation
|
|
186
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the nested value from a context object
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export declare function getDotPathValue(path: string, context: object): string;
|
|
6
|
+
/**
|
|
7
|
+
* Replace all variables with values from a context object
|
|
8
|
+
*
|
|
9
|
+
* - {{ double curly }}
|
|
10
|
+
* - { single curly }
|
|
11
|
+
* - :colon
|
|
12
|
+
*/
|
|
13
|
+
export declare function replaceTemplateVariables(templateString: string, context: object): string;
|
|
14
|
+
/**
|
|
15
|
+
* Return a list of key/value pairs for the environment
|
|
16
|
+
* Nested values will be dot-path referenced
|
|
17
|
+
*/
|
|
18
|
+
export declare function flattenEnvVars(environment: object): [string, string][];
|
|
19
|
+
//# sourceMappingURL=string-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-template.d.ts","sourceRoot":"","sources":["../../src/libs/string-template.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAQ5D;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,UAgBhB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,sBAoBjD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function u(n, a) {
|
|
2
|
+
const s = n.split(".").reduce(
|
|
3
|
+
(e, t) => e == null ? void 0 : e[t],
|
|
4
|
+
a
|
|
5
|
+
);
|
|
6
|
+
return typeof s == "string" ? s : JSON.stringify(s);
|
|
7
|
+
}
|
|
8
|
+
function l(n, a) {
|
|
9
|
+
const c = /{{\s*([^}\s]+?)\s*}}|{\s*([^}\s]+?)\s*}|:\b[\w.]+\b/g, s = n.match(c) ?? [];
|
|
10
|
+
let e = n;
|
|
11
|
+
return s.forEach((t) => {
|
|
12
|
+
const r = t.startsWith(":") ? t.slice(1) : t.replace(/[{}]/g, "").trim(), o = u(r, a);
|
|
13
|
+
o && (e = e.replaceAll(t, o));
|
|
14
|
+
}), e;
|
|
15
|
+
}
|
|
16
|
+
function i(n) {
|
|
17
|
+
function a(c, s) {
|
|
18
|
+
const e = Object.keys(c), t = [];
|
|
19
|
+
return e.forEach((r) => {
|
|
20
|
+
const o = s ? `${s}.${r}` : r;
|
|
21
|
+
typeof c[r] == "object" ? t.push(...a(c[r], o)) : t.push([o, String(c[r])]);
|
|
22
|
+
}), t;
|
|
23
|
+
}
|
|
24
|
+
return a(n);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
i as flattenEnvVars,
|
|
28
|
+
u as getDotPathValue,
|
|
29
|
+
l as replaceTemplateVariables
|
|
30
|
+
};
|
package/dist/router.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RouteLocationNormalized } from 'vue-router';
|
|
1
2
|
export declare enum PathId {
|
|
2
3
|
Request = "request",
|
|
3
4
|
Examples = "examples",
|
|
@@ -34,6 +35,10 @@ export declare const router: import("vue-router").Router;
|
|
|
34
35
|
export declare const createWebHashRouter: () => import("vue-router").Router;
|
|
35
36
|
/** Router factory for the API Client modal */
|
|
36
37
|
export declare const createModalRouter: () => import("vue-router").Router;
|
|
38
|
+
/** Save the active workspace in localstorage for when the client reloads */
|
|
39
|
+
export declare function saveWorkspace(to: RouteLocationNormalized): void;
|
|
40
|
+
/** Redirect to the saved workspace or the default workspace */
|
|
41
|
+
export declare function redirectToDefaultWorkspace(): string;
|
|
37
42
|
/** If we try to navigate to a entity UID that does not exist then we fallback to the default */
|
|
38
43
|
export declare function fallbackMissingParams(key: PathId, item: Record<string, any> | undefined): void;
|
|
39
44
|
//# sourceMappingURL=router.d.ts.map
|
package/dist/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAM7B,MAAM,YAAY,CAAA;AAEnB,oBAAY,MAAM;IAChB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,SAAS,cAAc;CACxB;AAwBD,8CAA8C;AAC9C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;IAaI,CAAA;AA2E5B,oCAAoC;AACpC,eAAO,MAAM,MAAM,6BAGjB,CAAA;AAEF,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,mCAI5B,CAAA;AAEJ,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,mCAI1B,CAAA;AAKJ,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,EAAE,EAAE,uBAAuB,QAGxD;AAED,+DAA+D;AAC/D,wBAAgB,0BAA0B,WAGzC;AAED,gGAAgG;AAChG,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,QAmBtC"}
|
package/dist/router.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createRouter as
|
|
2
|
-
var
|
|
3
|
-
const
|
|
1
|
+
import { createRouter as a, createWebHistory as l, createWebHashHistory as i, createMemoryHistory as m } from "vue-router";
|
|
2
|
+
var f = /* @__PURE__ */ ((e) => (e.Request = "request", e.Examples = "examples", e.Cookies = "cookies", e.Collection = "collection", e.Schema = "schema", e.Environment = "environment", e.Servers = "servers", e.Workspace = "workspace", e))(f || {});
|
|
3
|
+
const p = [
|
|
4
4
|
{
|
|
5
5
|
path: "",
|
|
6
6
|
redirect: (e) => `${e.fullPath.replace(/\/$/, "")}/request/default`
|
|
@@ -19,7 +19,7 @@ const s = [
|
|
|
19
19
|
path: "request/:request/examples/:examples",
|
|
20
20
|
component: () => import("./views/Request/Request.vue.js")
|
|
21
21
|
}
|
|
22
|
-
],
|
|
22
|
+
], h = [
|
|
23
23
|
{
|
|
24
24
|
path: "/",
|
|
25
25
|
redirect: "/workspace/default/request/default"
|
|
@@ -30,21 +30,21 @@ const s = [
|
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
path: "/workspace/:workspace",
|
|
33
|
-
children:
|
|
33
|
+
children: p
|
|
34
34
|
}
|
|
35
|
-
],
|
|
35
|
+
], u = [
|
|
36
36
|
{
|
|
37
37
|
path: "/",
|
|
38
|
-
redirect:
|
|
38
|
+
redirect: c
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
path: "/workspace",
|
|
42
|
-
redirect:
|
|
42
|
+
redirect: c
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
path: "/workspace/:workspace",
|
|
46
46
|
children: [
|
|
47
|
-
...
|
|
47
|
+
...p,
|
|
48
48
|
// {
|
|
49
49
|
// path: 'collection',
|
|
50
50
|
// redirect: (to) =>
|
|
@@ -102,20 +102,27 @@ const s = [
|
|
|
102
102
|
}
|
|
103
103
|
]
|
|
104
104
|
}
|
|
105
|
-
], r =
|
|
106
|
-
history: p(),
|
|
107
|
-
routes: c
|
|
108
|
-
}), f = () => t({
|
|
109
|
-
history: n(),
|
|
110
|
-
routes: c
|
|
111
|
-
}), d = () => t({
|
|
105
|
+
], r = a({
|
|
112
106
|
history: l(),
|
|
113
|
-
routes:
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
routes: u
|
|
108
|
+
}), d = () => a({
|
|
109
|
+
history: i(),
|
|
110
|
+
routes: u
|
|
111
|
+
}), v = () => a({
|
|
112
|
+
history: m(),
|
|
113
|
+
routes: h
|
|
114
|
+
}), n = "activeWorkspace";
|
|
115
|
+
function $(e) {
|
|
116
|
+
const t = e.params.workspace;
|
|
117
|
+
t && localStorage.setItem(n, `${t}`);
|
|
118
|
+
}
|
|
119
|
+
function c() {
|
|
120
|
+
return `/workspace/${localStorage.getItem(n) ?? "default"}/request/default`;
|
|
121
|
+
}
|
|
122
|
+
function w(e, t) {
|
|
123
|
+
var o, s;
|
|
117
124
|
r.currentRoute.value && // If the item is missing then we know the UID is no longer in use and redirect to the default
|
|
118
|
-
!
|
|
125
|
+
!t && ((o = r.currentRoute.value) != null && o.params[e]) && ((s = r.currentRoute.value) == null ? void 0 : s.params[e]) !== "default" && // We only redirect if the key is missing for the matching route
|
|
119
126
|
r.currentRoute.value.path.includes(e) && r.push({
|
|
120
127
|
params: {
|
|
121
128
|
...r.currentRoute.value.params,
|
|
@@ -124,10 +131,12 @@ function v(e, u) {
|
|
|
124
131
|
});
|
|
125
132
|
}
|
|
126
133
|
export {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
134
|
+
f as PathId,
|
|
135
|
+
v as createModalRouter,
|
|
136
|
+
d as createWebHashRouter,
|
|
137
|
+
w as fallbackMissingParams,
|
|
138
|
+
h as modalRoutes,
|
|
139
|
+
c as redirectToDefaultWorkspace,
|
|
140
|
+
r as router,
|
|
141
|
+
$ as saveWorkspace
|
|
133
142
|
};
|