@scalar/api-client 2.5.32 → 2.5.34
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 +39 -0
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +120 -128
- package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +57 -63
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +143 -150
- package/dist/components/CodeInput/codeVariableWidget.js +70 -75
- package/dist/components/CommandPalette/CommandActionInput.vue.js +17 -19
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +26 -27
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +53 -55
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +129 -133
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +1 -1
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +84 -98
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +64 -74
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -11
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +164 -183
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +4 -4
- package/dist/components/DataTable/DataTableInput.vue2.js +31 -31
- package/dist/components/DataTable/DataTableInputSelect.vue.js +1 -2
- package/dist/components/EmptyState.vue.js +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +75 -84
- package/dist/components/Form/LabelInput.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue2.js +11 -11
- package/dist/components/ImportCollection/DropEventListener.vue.js +42 -44
- package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -23
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +141 -149
- package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +1 -1
- package/dist/components/ImportCollection/ImportNowButton.vue.js +22 -23
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +12 -13
- package/dist/components/ImportCollection/PasteEventListener.vue.js +11 -12
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +69 -76
- package/dist/components/ImportCollection/utils/get-openapi-version.js +8 -8
- package/dist/components/ImportCollection/utils/import-collection.js +14 -14
- package/dist/components/OpenApiClientButton.vue.js +1 -1
- package/dist/components/OpenApiClientButton.vue2.js +10 -10
- package/dist/components/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +19 -22
- package/dist/components/Search/useSearch.js +51 -61
- package/dist/components/SectionFilter.vue.js +1 -1
- package/dist/components/SectionFilter.vue2.js +26 -29
- package/dist/components/Server/ServerDropdown.vue.js +70 -96
- package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
- package/dist/components/Server/ServerDropdownItem.vue2.js +57 -67
- package/dist/components/Server/ServerSelector.vue.js +44 -55
- package/dist/components/Server/ServerVariablesForm.vue.js +36 -42
- package/dist/components/Server/ServerVariablesSelect.vue.js +6 -6
- package/dist/components/SideNav/DownloadAppButton.vue.js +1 -1
- package/dist/components/SideNav/SideNav.vue.js +68 -74
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue.js +107 -122
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/hooks/useFileDialog.js +12 -12
- package/dist/hooks/useResponseBody.js +14 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/layouts/App/ApiClientApp.vue.js +50 -56
- package/dist/layouts/App/ApiClientApp.vue3.js +1 -1
- package/dist/layouts/App/create-api-client-app.js +19 -20
- package/dist/layouts/App/index.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue2.js +18 -21
- package/dist/layouts/Web/ApiClientWeb.vue.js +45 -51
- package/dist/layouts/Web/ApiClientWeb.vue3.js +1 -1
- package/dist/layouts/Web/create-api-client-web.js +19 -20
- package/dist/layouts/Web/index.js +1 -1
- package/dist/libs/create-client.js +102 -109
- package/dist/libs/env-helpers.js +3 -3
- package/dist/libs/event-bus.js +15 -15
- package/dist/libs/extractAttachmentFilename.js +5 -6
- package/dist/libs/find-request.js +9 -10
- package/dist/libs/get-request-uid-by-path-method.js +12 -12
- package/dist/libs/getOpenApiDocumentDetails.js +7 -7
- package/dist/libs/importers/curl.js +3 -3
- package/dist/libs/normalize-headers.js +9 -10
- package/dist/libs/postman.js +15 -17
- package/dist/libs/send-request/build-request-security.js +9 -10
- package/dist/libs/send-request/create-fetch-body.js +11 -12
- package/dist/libs/send-request/create-fetch-query-params.js +13 -13
- package/dist/libs/send-request/create-request-operation.js +83 -84
- package/dist/libs/send-request/decode-buffer.d.ts.map +1 -1
- package/dist/libs/send-request/set-request-cookies.js +12 -12
- package/dist/libs/string-template.js +21 -21
- package/dist/libs/validate-parameters.js +5 -8
- package/dist/plugins/plugin-manager.js +11 -17
- package/dist/store/active-entities.js +90 -117
- package/dist/store/collections.js +41 -42
- package/dist/store/import-spec.js +25 -26
- package/dist/store/request-example.js +20 -24
- package/dist/store/requests.js +63 -81
- package/dist/store/router-params.js +7 -7
- package/dist/store/security-schemes.js +35 -36
- package/dist/store/store.js +2 -2
- package/dist/store/tags.js +20 -21
- package/dist/style.css +1 -1
- package/dist/views/Collection/Collection.vue2.js +21 -22
- package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue2.js +43 -47
- package/dist/views/Collection/CollectionEnvironment.vue.js +1 -1
- package/dist/views/Collection/CollectionEnvironment.vue2.js +196 -207
- package/dist/views/Collection/CollectionInfoForm.vue.js +1 -1
- package/dist/views/Collection/CollectionInfoForm.vue2.js +34 -41
- package/dist/views/Collection/CollectionNavigation.vue.js +116 -125
- package/dist/views/Collection/CollectionOverview.vue2.js +22 -25
- package/dist/views/Collection/CollectionServerForm.vue.js +39 -45
- package/dist/views/Collection/CollectionServers.vue2.js +88 -98
- package/dist/views/Collection/CollectionSettings.vue.js +1 -1
- package/dist/views/Collection/CollectionSettings.vue2.js +101 -108
- package/dist/views/Collection/components/EnvironmentForm.vue.js +1 -1
- package/dist/views/Collection/components/EnvironmentForm.vue2.js +141 -145
- package/dist/views/Collection/components/MarkdownInput.vue.js +1 -1
- package/dist/views/Collection/components/MarkdownInput.vue2.js +1 -2
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +15 -15
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +15 -16
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +61 -64
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +9 -10
- package/dist/views/Cookies/CookieModal.vue.js +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +90 -93
- package/dist/views/Environment/Environment.vue2.js +267 -295
- package/dist/views/Environment/EnvironmentModal.vue.js +63 -70
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -42
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +60 -67
- package/dist/views/Request/RequestRoot.vue.js +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +78 -89
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +37 -44
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +44 -45
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +111 -127
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +120 -139
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +97 -97
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +287 -310
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +86 -94
- package/dist/views/Request/RequestSection/RequestParams.vue.js +37 -38
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +36 -38
- package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +28 -31
- package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +49 -52
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
- package/dist/views/Request/RequestSection/helpers/filter-security-requirements.js +16 -16
- package/dist/views/Request/RequestSection/helpers/getting-started.js +7 -11
- package/dist/views/Request/RequestSection/helpers/update-scheme.js +7 -8
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +199 -211
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +332 -349
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +210 -240
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +38 -41
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +58 -64
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +1 -2
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +20 -23
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +29 -30
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +38 -41
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +28 -29
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +128 -140
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +116 -124
- package/dist/views/Request/consts/mediaTypes.js +2 -3
- package/dist/views/Request/handle-drag.js +24 -28
- package/dist/views/Request/hooks/useOpenApiWatcher.js +26 -33
- package/dist/views/Request/libs/auth.js +37 -43
- package/dist/views/Request/libs/oauth2.js +30 -32
- package/dist/views/Request/libs/watch-mode.js +100 -103
- package/dist/views/Settings/SettingsGeneral.vue.js +206 -236
- package/package.json +22 -22
- package/dist/components/AddressBar/AddressBar.vue3.js +0 -4
- package/dist/components/AddressBar/AddressBarHistory.vue3.js +0 -4
- package/dist/components/CodeInput/CodeInput.vue3.js +0 -4
- package/dist/components/CodeInput/CodeInput.vue4.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue3.js +0 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue3.js +0 -4
- package/dist/components/DataTable/DataTableInput.vue3.js +0 -4
- package/dist/components/EmptyState.vue3.js +0 -4
- package/dist/components/Form/LabelInput.vue3.js +0 -4
- package/dist/components/HttpMethod/HttpMethod.vue3.js +0 -4
- package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
- package/dist/components/OpenApiClientButton.vue3.js +0 -4
- package/dist/components/ScalarAsciiArt.vue3.js +0 -4
- package/dist/components/SectionFilter.vue3.js +0 -4
- package/dist/components/Server/ServerDropdownItem.vue3.js +0 -4
- package/dist/components/SideNav/DownloadAppButton.vue3.js +0 -4
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue3.js +0 -4
- package/dist/components/Sidebar/Sidebar.vue3.js +0 -4
- package/dist/components/Sidebar/SidebarListElement.vue3.js +0 -4
- package/dist/components/Sidebar/SidebarListElement.vue4.js +0 -4
- package/dist/components/TopNav/TopNavItem.vue3.js +0 -4
- package/dist/layouts/App/ApiClientApp.vue2.js +0 -4
- package/dist/layouts/Modal/ApiClientModal.vue3.js +0 -4
- package/dist/layouts/Web/ApiClientWeb.vue2.js +0 -4
- package/dist/style.css.js +0 -4
- package/dist/views/Collection/CollectionAuthentication.vue3.js +0 -4
- package/dist/views/Collection/CollectionEnvironment.vue3.js +0 -4
- package/dist/views/Collection/CollectionInfoForm.vue3.js +0 -4
- package/dist/views/Collection/CollectionSettings.vue3.js +0 -4
- package/dist/views/Collection/components/EnvironmentForm.vue3.js +0 -4
- package/dist/views/Collection/components/MarkdownInput.vue3.js +0 -4
- package/dist/views/Cookies/CookieModal.vue3.js +0 -4
- package/dist/views/Request/Request.vue3.js +0 -4
- package/dist/views/Request/RequestRoot.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestBody.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestCodeExample.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestTable.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue3.js +0 -4
- package/dist/views/Request/RequestSidebar.vue3.js +0 -4
- package/dist/views/Request/RequestSidebarItem.vue3.js +0 -4
- package/dist/views/Request/RequestSidebarItem.vue4.js +0 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue3.js +0 -4
- package/dist/views/Request/RequestSubpageHeader.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBody.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseSection.vue3.js +0 -4
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
import { CLIENT_CONFIGURATION_SYMBOL as
|
|
2
|
-
import { LAYOUT_SYMBOL as
|
|
3
|
-
import { createSidebarState as
|
|
4
|
-
import { getRequestUidByPathMethod as
|
|
5
|
-
import { loadAllResources as
|
|
6
|
-
import { createActiveEntitiesStore as
|
|
7
|
-
import { createWorkspaceStore as
|
|
8
|
-
import { workspaceSchema as
|
|
9
|
-
import { prettyPrintJson as
|
|
10
|
-
import { LS_KEYS as
|
|
11
|
-
import { DATA_VERSION_LS_LEY as
|
|
12
|
-
import { apiClientConfigurationSchema as
|
|
13
|
-
import { ref as
|
|
14
|
-
import { createPluginManager as
|
|
15
|
-
import { PLUGIN_MANAGER_SYMBOL as
|
|
16
|
-
const
|
|
17
|
-
el:
|
|
18
|
-
appComponent:
|
|
19
|
-
configuration:
|
|
1
|
+
import { CLIENT_CONFIGURATION_SYMBOL as N } from "../hooks/useClientConfig.js";
|
|
2
|
+
import { LAYOUT_SYMBOL as F } from "../hooks/useLayout.js";
|
|
3
|
+
import { createSidebarState as j, SIDEBAR_SYMBOL as W } from "../hooks/useSidebar.js";
|
|
4
|
+
import { getRequestUidByPathMethod as K } from "./get-request-uid-by-path-method.js";
|
|
5
|
+
import { loadAllResources as D } from "./local-storage.js";
|
|
6
|
+
import { createActiveEntitiesStore as G, ACTIVE_ENTITIES_SYMBOL as V } from "../store/active-entities.js";
|
|
7
|
+
import { createWorkspaceStore as z, WORKSPACE_SYMBOL as H } from "../store/store.js";
|
|
8
|
+
import { workspaceSchema as J } from "@scalar/oas-utils/entities/workspace";
|
|
9
|
+
import { prettyPrintJson as Q } from "@scalar/oas-utils/helpers";
|
|
10
|
+
import { LS_KEYS as X } from "@scalar/helpers/object/local-storage";
|
|
11
|
+
import { DATA_VERSION_LS_LEY as Z, DATA_VERSION as $ } from "@scalar/oas-utils/migrations";
|
|
12
|
+
import { apiClientConfigurationSchema as _ } from "@scalar/types/api-reference";
|
|
13
|
+
import { ref as ee, createApp as te, watch as re } from "vue";
|
|
14
|
+
import { createPluginManager as oe } from "../plugins/plugin-manager.js";
|
|
15
|
+
import { PLUGIN_MANAGER_SYMBOL as ae } from "../plugins/hooks/usePluginManager.js";
|
|
16
|
+
const Me = ({
|
|
17
|
+
el: O,
|
|
18
|
+
appComponent: y,
|
|
19
|
+
configuration: U = {},
|
|
20
20
|
isReadOnly: l = !1,
|
|
21
|
-
store:
|
|
22
|
-
persistData:
|
|
23
|
-
mountOnInitialize:
|
|
21
|
+
store: x,
|
|
22
|
+
persistData: C = !0,
|
|
23
|
+
mountOnInitialize: L = !0,
|
|
24
24
|
layout: m = "desktop",
|
|
25
|
-
router:
|
|
25
|
+
router: n
|
|
26
26
|
}) => {
|
|
27
|
-
const
|
|
28
|
-
proxyUrl:
|
|
29
|
-
theme:
|
|
30
|
-
showSidebar:
|
|
31
|
-
hideClientButton:
|
|
32
|
-
_integration:
|
|
33
|
-
useLocalStorage:
|
|
34
|
-
}), f =
|
|
35
|
-
plugins:
|
|
36
|
-
}),
|
|
27
|
+
const a = ee(_.parse(U)), o = x || z({
|
|
28
|
+
proxyUrl: a.value.proxyUrl,
|
|
29
|
+
theme: a.value.theme,
|
|
30
|
+
showSidebar: a.value.showSidebar ?? !0,
|
|
31
|
+
hideClientButton: a.value.hideClientButton ?? !1,
|
|
32
|
+
_integration: a.value._integration,
|
|
33
|
+
useLocalStorage: C
|
|
34
|
+
}), f = G({ ...o, router: n }), b = j({ layout: m }), E = oe({
|
|
35
|
+
plugins: a.value.plugins ?? []
|
|
36
|
+
}), v = () => {
|
|
37
37
|
try {
|
|
38
38
|
return typeof window < "u" && window.localStorage !== void 0;
|
|
39
39
|
} catch {
|
|
40
40
|
return !1;
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
if (
|
|
43
|
+
if (v() && localStorage.getItem(X.WORKSPACE) && !l)
|
|
44
44
|
try {
|
|
45
|
-
const
|
|
46
|
-
let
|
|
47
|
-
for (
|
|
48
|
-
Object.hasOwn(localStorage,
|
|
49
|
-
|
|
50
|
-
} catch (
|
|
51
|
-
console.warn("Failed to load from localStorage:",
|
|
45
|
+
const t = {};
|
|
46
|
+
let e = 0, r = 0, s = "";
|
|
47
|
+
for (s in localStorage)
|
|
48
|
+
Object.hasOwn(localStorage, s) && (r = (localStorage[s].length + s.length) * 2, e += r, t[s] = (r / 1024).toFixed(2) + " KB");
|
|
49
|
+
t.Total = (e / 1024).toFixed(2) + " KB", console.table(t), D(o);
|
|
50
|
+
} catch (t) {
|
|
51
|
+
console.warn("Failed to load from localStorage:", t);
|
|
52
52
|
}
|
|
53
|
-
else if (!l && !
|
|
54
|
-
if (
|
|
53
|
+
else if (!l && !a.value.url && !a.value.content) {
|
|
54
|
+
if (o.workspaceMutators.add({
|
|
55
55
|
uid: "default",
|
|
56
56
|
name: "Workspace",
|
|
57
|
-
proxyUrl:
|
|
58
|
-
}),
|
|
57
|
+
proxyUrl: a.value.proxyUrl
|
|
58
|
+
}), v())
|
|
59
59
|
try {
|
|
60
|
-
localStorage.setItem(
|
|
61
|
-
} catch (
|
|
62
|
-
console.warn("Failed to set localStorage version:",
|
|
60
|
+
localStorage.setItem(Z, $);
|
|
61
|
+
} catch (t) {
|
|
62
|
+
console.warn("Failed to set localStorage version:", t);
|
|
63
63
|
}
|
|
64
64
|
} else {
|
|
65
|
-
const
|
|
65
|
+
const t = J.parse({
|
|
66
66
|
uid: "default",
|
|
67
67
|
name: "Workspace",
|
|
68
|
-
proxyUrl:
|
|
68
|
+
proxyUrl: a.value.proxyUrl
|
|
69
69
|
});
|
|
70
|
-
|
|
70
|
+
o.workspaceMutators.rawAdd(t);
|
|
71
71
|
}
|
|
72
|
-
const i =
|
|
73
|
-
i.use(
|
|
72
|
+
const i = te(y);
|
|
73
|
+
i.use(n), i.provide(H, o), i.provide(F, m), i.provide(V, f), i.provide(W, b), i.provide(N, a), i.provide(ae, E), i.config.idPrefix = "scalar-client";
|
|
74
74
|
const {
|
|
75
|
-
collectionMutators:
|
|
76
|
-
importSpecFile:
|
|
77
|
-
importSpecFromUrl:
|
|
78
|
-
modalState:
|
|
75
|
+
collectionMutators: k,
|
|
76
|
+
importSpecFile: I,
|
|
77
|
+
importSpecFromUrl: q,
|
|
78
|
+
modalState: S,
|
|
79
79
|
requests: h,
|
|
80
|
-
securitySchemes:
|
|
81
|
-
securitySchemeMutators:
|
|
80
|
+
securitySchemes: B,
|
|
81
|
+
securitySchemeMutators: T,
|
|
82
82
|
servers: g,
|
|
83
|
-
workspaceMutators:
|
|
84
|
-
requestExampleMutators:
|
|
85
|
-
} =
|
|
86
|
-
if (!
|
|
83
|
+
workspaceMutators: P,
|
|
84
|
+
requestExampleMutators: R
|
|
85
|
+
} = o, { activeCollection: u, activeWorkspace: p } = f, w = (t = O) => {
|
|
86
|
+
if (!t) {
|
|
87
87
|
console.error(
|
|
88
88
|
"[@scalar/api-client-modal] Could not create the API client.",
|
|
89
89
|
"Invalid HTML element provided.",
|
|
@@ -91,22 +91,21 @@ const xe = ({
|
|
|
91
91
|
);
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
|
-
i.mount(
|
|
94
|
+
i.mount(t);
|
|
95
95
|
};
|
|
96
|
-
|
|
97
|
-
const M = (
|
|
98
|
-
const
|
|
99
|
-
|
|
96
|
+
L && w();
|
|
97
|
+
const M = (t) => {
|
|
98
|
+
const e = K(h, t);
|
|
99
|
+
e ? n.push({
|
|
100
100
|
name: "request",
|
|
101
|
-
query:
|
|
101
|
+
query: t?._source ? { source: t._source } : {},
|
|
102
102
|
params: {
|
|
103
103
|
workspace: "default",
|
|
104
|
-
request:
|
|
104
|
+
request: e
|
|
105
105
|
}
|
|
106
|
-
}) : console.warn("[@scalar/api-client] Could not find request for path and method",
|
|
106
|
+
}) : console.warn("[@scalar/api-client] Could not find request for path and method", t);
|
|
107
107
|
}, A = () => {
|
|
108
|
-
|
|
109
|
-
a.collectionMutators.reset(), a.requestMutators.reset(), a.requestExampleMutators.reset(), a.securitySchemeMutators.reset(), a.serverMutators.reset(), a.tagMutators.reset(), F.edit((e = d.value) == null ? void 0 : e.uid, "collections", []);
|
|
108
|
+
o.collectionMutators.reset(), o.requestMutators.reset(), o.requestExampleMutators.reset(), o.securitySchemeMutators.reset(), o.serverMutators.reset(), o.tagMutators.reset(), P.edit(p.value?.uid, "collections", []);
|
|
110
109
|
};
|
|
111
110
|
return {
|
|
112
111
|
/** The vue app instance for the modal, be careful with this */
|
|
@@ -117,16 +116,15 @@ const xe = ({
|
|
|
117
116
|
*
|
|
118
117
|
* Deletes the current store before importing again for now, in the future will Diff and only update what is needed
|
|
119
118
|
*/
|
|
120
|
-
updateConfig: async (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (t.url || t.content || t.servers || t.authentication || t.slug || t.title || t.baseServerURL || t.proxyUrl || t.showSidebar) {
|
|
119
|
+
updateConfig: async (t) => {
|
|
120
|
+
const e = _.parse(t);
|
|
121
|
+
if (e.url || e.content || e.servers || e.authentication || e.slug || e.title || e.baseServerURL || e.proxyUrl || e.showSidebar) {
|
|
124
122
|
A();
|
|
125
|
-
const
|
|
126
|
-
...
|
|
123
|
+
const r = {
|
|
124
|
+
...e,
|
|
127
125
|
useCollectionSecurity: l
|
|
128
126
|
};
|
|
129
|
-
|
|
127
|
+
a.value = r, e.url ? await q(e.url, p.value?.uid ?? "default", r) : e.content ? await I(e.content, p.value?.uid ?? "default", r) : console.error(
|
|
130
128
|
"[@scalar/api-client-modal] Could not create the API client.",
|
|
131
129
|
'Please provide an OpenAPI document: { url: "…" }',
|
|
132
130
|
"Read more: https://github.com/scalar/scalar/tree/main/packages/api-client"
|
|
@@ -134,21 +132,17 @@ const xe = ({
|
|
|
134
132
|
}
|
|
135
133
|
},
|
|
136
134
|
/** Update the currently selected server via URL */
|
|
137
|
-
updateServer: (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
t && p.value && T.edit((r = p.value) == null ? void 0 : r.uid, "selectedServerUid", t.uid);
|
|
135
|
+
updateServer: (t) => {
|
|
136
|
+
const e = Object.values(g).find((r) => r.url === t);
|
|
137
|
+
e && u.value && k.edit(u.value?.uid, "selectedServerUid", e.uid);
|
|
141
138
|
},
|
|
142
139
|
/** Update the currently selected server via URL */
|
|
143
|
-
onUpdateServer: (
|
|
144
|
-
|
|
145
|
-
() =>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
(t) => {
|
|
150
|
-
const r = Object.values(g).find((o) => o.uid === t);
|
|
151
|
-
r != null && r.url && e(r.url);
|
|
140
|
+
onUpdateServer: (t) => {
|
|
141
|
+
re(
|
|
142
|
+
() => u.value?.selectedServerUid,
|
|
143
|
+
(e) => {
|
|
144
|
+
const r = Object.values(g).find((s) => s.uid === e);
|
|
145
|
+
r?.url && t(r.url);
|
|
152
146
|
}
|
|
153
147
|
);
|
|
154
148
|
},
|
|
@@ -156,41 +150,40 @@ const xe = ({
|
|
|
156
150
|
* Update the auth values, we currently don't change the auth selection
|
|
157
151
|
*/
|
|
158
152
|
updateAuth: ({
|
|
159
|
-
nameKey:
|
|
160
|
-
propertyKey:
|
|
153
|
+
nameKey: t,
|
|
154
|
+
propertyKey: e,
|
|
161
155
|
value: r
|
|
162
156
|
}) => {
|
|
163
|
-
const c = Object.values(
|
|
164
|
-
c &&
|
|
157
|
+
const c = Object.values(B).find((d) => d.nameKey === t);
|
|
158
|
+
c && T.edit(c.uid, e, r);
|
|
165
159
|
},
|
|
166
160
|
/** Route to a method + path */
|
|
167
161
|
route: M,
|
|
168
162
|
/** Open the API client modal and optionally route to a request */
|
|
169
|
-
open: (
|
|
170
|
-
const { method:
|
|
171
|
-
(
|
|
163
|
+
open: (t) => {
|
|
164
|
+
const { method: e, path: r, requestUid: s } = t ?? {};
|
|
165
|
+
(e && r || s) && M(t), S.open = !0;
|
|
172
166
|
},
|
|
173
167
|
/** Mount the references to a given element */
|
|
174
168
|
mount: w,
|
|
175
169
|
/** State for controlling the modal */
|
|
176
|
-
modalState:
|
|
170
|
+
modalState: S,
|
|
177
171
|
/* The workspace store */
|
|
178
|
-
store:
|
|
172
|
+
store: o,
|
|
179
173
|
/** Update the currently selected example */
|
|
180
|
-
updateExample: (
|
|
181
|
-
|
|
182
|
-
if (!e || !t)
|
|
174
|
+
updateExample: (t, e) => {
|
|
175
|
+
if (!t || !e)
|
|
183
176
|
return;
|
|
184
177
|
const r = Object.values(h).find(
|
|
185
|
-
({ operationId:
|
|
178
|
+
({ operationId: d, path: Y }) => d === e || Y === e
|
|
186
179
|
);
|
|
187
180
|
if (!r)
|
|
188
181
|
return;
|
|
189
|
-
const
|
|
190
|
-
c &&
|
|
182
|
+
const s = Object.keys(r.requestBody?.content || {})[0] || "", c = r.requestBody?.content?.[s]?.examples?.[t];
|
|
183
|
+
c && R.edit(r.examples[0], "body.raw.value", Q(c.value));
|
|
191
184
|
}
|
|
192
185
|
};
|
|
193
186
|
};
|
|
194
187
|
export {
|
|
195
|
-
|
|
188
|
+
Me as createApiClient
|
|
196
189
|
};
|
package/dist/libs/env-helpers.js
CHANGED
package/dist/libs/event-bus.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
3
|
-
function f(n) {
|
|
4
|
-
return t.add(n), () => o(n);
|
|
5
|
-
}
|
|
1
|
+
function s() {
|
|
2
|
+
const e = /* @__PURE__ */ new Set();
|
|
6
3
|
function r(n) {
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
return e.add(n), () => o(n);
|
|
5
|
+
}
|
|
6
|
+
function f(n) {
|
|
7
|
+
function t(...i) {
|
|
8
|
+
o(t), n(...i);
|
|
9
9
|
}
|
|
10
|
-
return
|
|
10
|
+
return r(t);
|
|
11
11
|
}
|
|
12
12
|
function o(n) {
|
|
13
|
-
|
|
13
|
+
e.delete(n);
|
|
14
14
|
}
|
|
15
15
|
function c() {
|
|
16
|
-
|
|
16
|
+
e.clear();
|
|
17
17
|
}
|
|
18
18
|
function u(n) {
|
|
19
|
-
|
|
19
|
+
e?.forEach((t) => t(n));
|
|
20
20
|
}
|
|
21
21
|
return {
|
|
22
|
-
on:
|
|
23
|
-
once:
|
|
22
|
+
on: r,
|
|
23
|
+
once: f,
|
|
24
24
|
off: o,
|
|
25
25
|
emit: u,
|
|
26
26
|
reset: c,
|
|
27
|
-
listeners: () => Array.from(
|
|
27
|
+
listeners: () => Array.from(e)
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
s as createEventBus
|
|
32
32
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
const
|
|
1
|
+
const m = (e) => {
|
|
2
2
|
try {
|
|
3
3
|
return decodeURIComponent(e);
|
|
4
4
|
} catch {
|
|
5
5
|
return e;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
|
-
function
|
|
9
|
-
var t, m;
|
|
8
|
+
function c(e) {
|
|
10
9
|
let a = "";
|
|
11
10
|
if (e) {
|
|
12
|
-
const
|
|
13
|
-
|
|
11
|
+
const t = e.match(/filename\*=UTF-8''([^;]+)/)?.[1] ?? e.match(/filename\s*=\s*"?([^";]+)"?/)?.[1];
|
|
12
|
+
t && (a = m(t.trim()));
|
|
14
13
|
}
|
|
15
14
|
return a;
|
|
16
15
|
}
|
|
17
16
|
export {
|
|
18
|
-
|
|
17
|
+
c as extractFilename
|
|
19
18
|
};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
const
|
|
1
|
+
const f = (e) => {
|
|
2
2
|
const r = "^" + // start anchor
|
|
3
3
|
e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\\\{([^}]+)\\\}/g, "([^/]+)") + // replace {param} with capture group
|
|
4
4
|
"(\\?.*)?$";
|
|
5
5
|
return new RegExp(r);
|
|
6
|
-
},
|
|
6
|
+
}, i = (e, r, o) => {
|
|
7
7
|
let n = [];
|
|
8
|
-
return { request:
|
|
8
|
+
return { request: o.find((t) => {
|
|
9
9
|
if (t.method.toLowerCase() !== r.toLowerCase())
|
|
10
10
|
return !1;
|
|
11
11
|
if (t.path === e)
|
|
12
12
|
return !0;
|
|
13
|
-
const
|
|
14
|
-
return s ? (n = s.slice(1).flatMap((
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return a ? [{ key: a, value: p }] : [];
|
|
13
|
+
const u = f(t.path), s = e.match(u);
|
|
14
|
+
return s ? (n = s.slice(1).flatMap((c, p) => {
|
|
15
|
+
const a = t.path.split("{")[p + 1]?.split("}")[0];
|
|
16
|
+
return a ? [{ key: a, value: c }] : [];
|
|
18
17
|
}), !0) : !1;
|
|
19
18
|
}), pathParams: n };
|
|
20
19
|
};
|
|
21
20
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
i as findRequestByPathMethod,
|
|
22
|
+
f as pathToRegex
|
|
24
23
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { findRequestByPathMethod as
|
|
2
|
-
const
|
|
3
|
-
const { requestUid:
|
|
4
|
-
if (
|
|
5
|
-
return
|
|
1
|
+
import { findRequestByPathMethod as u } from "./find-request.js";
|
|
2
|
+
const i = (t, c) => {
|
|
3
|
+
const { requestUid: r, method: e, path: o } = c ?? {};
|
|
4
|
+
if (r)
|
|
5
|
+
return r;
|
|
6
6
|
if (!o || !e)
|
|
7
7
|
return Object.keys(t)[0];
|
|
8
|
-
const s = Object.values(t),
|
|
9
|
-
(
|
|
8
|
+
const s = Object.values(t), a = s.find(
|
|
9
|
+
(n) => n.path.toLowerCase() === o.toLowerCase() && n.method.toLowerCase() === e.toLowerCase()
|
|
10
10
|
);
|
|
11
|
-
if (
|
|
12
|
-
return
|
|
13
|
-
const { request:
|
|
14
|
-
return
|
|
11
|
+
if (a)
|
|
12
|
+
return a.uid;
|
|
13
|
+
const { request: d } = u(o, e, s);
|
|
14
|
+
return d?.uid || Object.keys(t)[0];
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
i as getRequestUidByPathMethod
|
|
18
18
|
};
|
|
@@ -2,18 +2,18 @@ import { json as n, yaml as o } from "@scalar/oas-utils/helpers";
|
|
|
2
2
|
import { isUrl as i } from "./isUrl.js";
|
|
3
3
|
function t(r) {
|
|
4
4
|
return {
|
|
5
|
-
title: typeof
|
|
5
|
+
title: typeof r?.title == "string" ? `${r?.title}` : void 0
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function a(r) {
|
|
9
9
|
if (!(!r || i(r))) {
|
|
10
10
|
try {
|
|
11
11
|
const e = n.parse(r ?? "");
|
|
12
|
-
return typeof
|
|
12
|
+
return typeof e?.openapi == "string" ? {
|
|
13
13
|
version: `OpenAPI ${e.openapi}`,
|
|
14
14
|
type: "json",
|
|
15
15
|
...t(e.info)
|
|
16
|
-
} : typeof
|
|
16
|
+
} : typeof e?.swagger == "string" ? {
|
|
17
17
|
version: `Swagger ${e.swagger}`,
|
|
18
18
|
type: "json",
|
|
19
19
|
...t(e.info)
|
|
@@ -22,11 +22,11 @@ function g(r) {
|
|
|
22
22
|
}
|
|
23
23
|
try {
|
|
24
24
|
const e = o.parse(r ?? "");
|
|
25
|
-
return typeof
|
|
25
|
+
return typeof e?.openapi == "string" ? {
|
|
26
26
|
version: `OpenAPI ${e.openapi}`,
|
|
27
27
|
type: "yaml",
|
|
28
28
|
...t(e.info)
|
|
29
|
-
} : typeof
|
|
29
|
+
} : typeof e?.swagger == "string" ? {
|
|
30
30
|
version: `Swagger ${e.swagger}`,
|
|
31
31
|
type: "yaml",
|
|
32
32
|
...t(e.info)
|
|
@@ -36,5 +36,5 @@ function g(r) {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
a as getOpenApiDocumentDetails
|
|
40
40
|
};
|
|
@@ -11,7 +11,7 @@ function l(o) {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
function C(o) {
|
|
14
|
-
const s = h(o), { method: a = "get", url: r, body: e = "", headers: p = {}, servers:
|
|
14
|
+
const s = h(o), { method: a = "get", url: r, body: e = "", headers: p = {}, servers: y, queryParameters: m = [] } = s, i = new URL(r).pathname, d = e?.includes("=") && !e.startsWith("{") ? "application/x-www-form-urlencoded" : p["Content-Type"] || "", c = e ? l(e) : {}, u = [
|
|
15
15
|
...Array.isArray(m) ? m.map(({ key: n, value: t }) => ({
|
|
16
16
|
name: n,
|
|
17
17
|
in: "query",
|
|
@@ -27,9 +27,9 @@ function C(o) {
|
|
|
27
27
|
return {
|
|
28
28
|
method: a,
|
|
29
29
|
url: r,
|
|
30
|
-
path:
|
|
30
|
+
path: i,
|
|
31
31
|
headers: p,
|
|
32
|
-
servers:
|
|
32
|
+
servers: y ?? [],
|
|
33
33
|
...Object.keys(c).length > 0 && {
|
|
34
34
|
requestBody: {
|
|
35
35
|
content: {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
var c, l;
|
|
1
|
+
const n = (a, t = !1) => {
|
|
3
2
|
const o = Object.fromEntries(a);
|
|
4
3
|
t && [
|
|
5
4
|
"Access-Control-Allow-Credentials",
|
|
@@ -8,21 +7,21 @@ const f = (a, t = !1) => {
|
|
|
8
7
|
"Access-Control-Allow-Origin",
|
|
9
8
|
"Access-Control-Expose-Headers"
|
|
10
9
|
].map((s) => s.toLowerCase()).forEach((s) => delete o[s]);
|
|
11
|
-
const r = Object.keys(o).find((e) => e.toLowerCase() === "x-scalar-modified-headers"),
|
|
10
|
+
const r = Object.keys(o).find((e) => e.toLowerCase() === "x-scalar-modified-headers"), c = r ? o[r]?.toString().split(", ")?.map((e) => e.toLowerCase()) ?? [] : [];
|
|
12
11
|
return Object.keys(o).forEach((e) => {
|
|
13
|
-
|
|
12
|
+
c.includes(e.toLowerCase()) && delete o[e];
|
|
14
13
|
}), r && delete o[r], Object.keys(o).forEach((e) => {
|
|
15
14
|
const s = /^x-scalar-original-/i;
|
|
16
15
|
if (s.test(e)) {
|
|
17
|
-
const
|
|
18
|
-
o[e] && (o[
|
|
16
|
+
const l = e.replace(s, "");
|
|
17
|
+
o[e] && (o[l] = o[e], delete o[e]);
|
|
19
18
|
}
|
|
20
19
|
}), Object.keys(o).forEach((e) => {
|
|
21
|
-
const s =
|
|
20
|
+
const s = i(e);
|
|
22
21
|
e !== s && o[e] && (o[s] = o[e], delete o[e]);
|
|
23
22
|
}), Object.fromEntries(Object.entries(o).sort(([e], [s]) => e.localeCompare(s)));
|
|
24
|
-
},
|
|
23
|
+
}, i = (a) => a.split("-").map((t) => t.charAt(0).toUpperCase() + t.toLowerCase().slice(1)).join("-");
|
|
25
24
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
i as formatHeaderKey,
|
|
26
|
+
n as normalizeHeaders
|
|
28
27
|
};
|
package/dist/libs/postman.js
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
import { convert as
|
|
2
|
-
function
|
|
3
|
-
var n, o;
|
|
1
|
+
import { convert as r } from "@scalar/postman-to-openapi";
|
|
2
|
+
function e(o) {
|
|
4
3
|
try {
|
|
5
|
-
const
|
|
6
|
-
return
|
|
4
|
+
const n = JSON.parse(o);
|
|
5
|
+
return n.info?._postman_id !== void 0 && new URL(n.info?.schema).host === "schema.getpostman.com";
|
|
7
6
|
} catch {
|
|
8
7
|
return !1;
|
|
9
8
|
}
|
|
10
9
|
}
|
|
11
|
-
async function
|
|
10
|
+
async function c(o) {
|
|
12
11
|
try {
|
|
13
|
-
const n = JSON.parse(
|
|
14
|
-
return JSON.stringify(
|
|
12
|
+
const n = JSON.parse(o), t = r(n);
|
|
13
|
+
return JSON.stringify(t, null, 2);
|
|
15
14
|
} catch {
|
|
16
15
|
throw new Error("Failed to convert Postman collection to OpenAPI");
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
|
-
function
|
|
20
|
-
var n, o;
|
|
18
|
+
function i(o) {
|
|
21
19
|
try {
|
|
22
|
-
if (
|
|
23
|
-
const
|
|
20
|
+
if (e(o)) {
|
|
21
|
+
const n = JSON.parse(o);
|
|
24
22
|
return {
|
|
25
23
|
type: "json",
|
|
26
|
-
title:
|
|
27
|
-
version:
|
|
24
|
+
title: n.info?.name || "Postman Collection",
|
|
25
|
+
version: n.info?.version || "1.0"
|
|
28
26
|
};
|
|
29
27
|
}
|
|
30
28
|
return null;
|
|
@@ -33,7 +31,7 @@ function l(t) {
|
|
|
33
31
|
}
|
|
34
32
|
}
|
|
35
33
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
c as convertPostmanToOpenApi,
|
|
35
|
+
i as getPostmanDocumentDetails,
|
|
36
|
+
e as isPostmanCollection
|
|
39
37
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { replaceTemplateVariables as n } from "../string-template.js";
|
|
2
|
-
import { cookieSchema as
|
|
3
|
-
import { isDefined as
|
|
4
|
-
import { encode as
|
|
5
|
-
const
|
|
2
|
+
import { cookieSchema as l } from "@scalar/oas-utils/entities/cookie";
|
|
3
|
+
import { isDefined as d } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { encode as c } from "js-base64";
|
|
5
|
+
const y = (p = [], i = {}, s = "") => {
|
|
6
6
|
const t = {}, e = [], f = new URLSearchParams();
|
|
7
|
-
return
|
|
8
|
-
var p;
|
|
7
|
+
return p.forEach((o) => {
|
|
9
8
|
if (o.type === "apiKey") {
|
|
10
9
|
const a = n(o.value, i) || s;
|
|
11
10
|
o.in === "header" && (t[o.name] = a), o.in === "query" && f.append(o.name, a), o.in === "cookie" && e.push(
|
|
12
|
-
|
|
11
|
+
l.parse({
|
|
13
12
|
uid: o.uid,
|
|
14
13
|
name: o.name,
|
|
15
14
|
value: a,
|
|
@@ -20,17 +19,17 @@ const m = (l = [], i = {}, s = "") => {
|
|
|
20
19
|
if (o.type === "http")
|
|
21
20
|
if (o.scheme === "basic") {
|
|
22
21
|
const a = n(o.username, i), u = n(o.password, i), r = `${a}:${u}`;
|
|
23
|
-
t.Authorization = `Basic ${r === ":" ? "username:password" :
|
|
22
|
+
t.Authorization = `Basic ${r === ":" ? "username:password" : c(r)}`;
|
|
24
23
|
} else {
|
|
25
24
|
const a = n(o.token, i);
|
|
26
25
|
t.Authorization = `Bearer ${a || s}`;
|
|
27
26
|
}
|
|
28
27
|
if (o.type === "oauth2") {
|
|
29
|
-
const u =
|
|
28
|
+
const u = Object.values(o.flows).filter(d).find((r) => r.token)?.token;
|
|
30
29
|
t.Authorization = `Bearer ${u || s}`;
|
|
31
30
|
}
|
|
32
31
|
}), { headers: t, cookies: e, urlParams: f };
|
|
33
32
|
};
|
|
34
33
|
export {
|
|
35
|
-
|
|
34
|
+
y as buildRequestSecurity
|
|
36
35
|
};
|