@scalar/api-client 2.1.18 → 2.1.20
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 +41 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts +5 -1
- 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 +70 -69
- package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +8 -8
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +29 -29
- package/dist/components/CodeInput/CodeInput.vue.d.ts +6 -2
- 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 +57 -49
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +62 -45
- package/dist/components/CommandPalette/CommandPaletteTag.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +13 -7
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +87 -89
- package/dist/components/ContextBar.vue.d.ts.map +1 -1
- package/dist/components/ContextBar.vue.js +2 -2
- package/dist/components/DataTable/DataTableCheckbox.vue.d.ts +19 -3
- package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCheckbox.vue.js +27 -14
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +8 -8
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +29 -32
- package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts +39 -0
- package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts.map +1 -0
- package/dist/components/ImportCurl/ImportCurlModal.vue.js +7 -0
- package/dist/components/ImportCurl/ImportCurlModal.vue2.js +88 -0
- package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +1 -1
- package/dist/components/SideNav/SideNav.vue2.js +37 -26
- package/dist/components/SideNav/SideNavLink.vue.d.ts +2 -2
- package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNavLink.vue.js +10 -11
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +1 -1
- package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
- package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +24 -3
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarListElement.vue2.js +26 -22
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts +4 -0
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +35 -32
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +3 -3
- package/dist/components/TopNav/TopNav.vue2.js +41 -40
- 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 +1 -1
- package/dist/components/ViewLayout/ViewLayoutContent.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +11 -11
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/hooks/useDarkModeState.d.ts +4 -3
- package/dist/hooks/useDarkModeState.d.ts.map +1 -1
- package/dist/hooks/useDarkModeState.js +36 -21
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +40 -44
- package/dist/layouts/App/create-api-client-app.d.ts +46 -36
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +17 -17
- package/dist/layouts/Modal/create-api-client-modal.d.ts +92 -72
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +30 -34
- package/dist/layouts/Web/create-api-client-web.d.ts +46 -36
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +46 -36
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/event-bus.d.ts +41 -0
- package/dist/libs/event-bus.d.ts.map +1 -0
- package/dist/libs/event-bus.js +32 -0
- package/dist/libs/{event-busses/hot-keys-bus.d.ts → hot-keys.d.ts} +6 -7
- package/dist/libs/hot-keys.d.ts.map +1 -0
- package/dist/libs/hot-keys.js +45 -0
- package/dist/libs/importers/curl.d.ts +3 -0
- package/dist/libs/importers/curl.d.ts.map +1 -0
- package/dist/libs/importers/curl.js +61 -0
- package/dist/libs/importers/index.d.ts +2 -0
- package/dist/libs/importers/index.d.ts.map +1 -0
- package/dist/libs/importers/index.js +4 -0
- package/dist/libs/index.d.ts +4 -1
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +31 -31
- package/dist/libs/parse-curl.d.ts +12 -0
- package/dist/libs/parse-curl.d.ts.map +1 -0
- package/dist/libs/parse-curl.js +70 -0
- package/dist/libs/send-request.d.ts +4 -1
- package/dist/libs/send-request.d.ts.map +1 -1
- package/dist/libs/send-request.js +103 -103
- package/dist/router.d.ts +2 -1
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +33 -24
- package/dist/store/collections.d.ts +4 -4
- package/dist/store/cookies.d.ts +4 -4
- package/dist/store/environment.d.ts +4 -4
- package/dist/store/events.d.ts +29 -0
- package/dist/store/events.d.ts.map +1 -0
- package/dist/store/events.js +31 -0
- package/dist/store/request-example.d.ts +4 -4
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/router-params.d.ts +1 -0
- package/dist/store/router-params.d.ts.map +1 -1
- package/dist/store/router-params.js +2 -1
- package/dist/store/security-schemes.d.ts +4 -4
- package/dist/store/servers.d.ts +4 -4
- package/dist/store/store.d.ts +92 -72
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +138 -129
- package/dist/store/tags.d.ts +4 -4
- package/dist/store/workspace.d.ts +4 -4
- package/dist/style.css +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +18 -18
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +9 -9
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +148 -98
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +4 -4
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +3 -3
- package/dist/views/Request/RequestSidebar.vue2.js +101 -102
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +73 -73
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +33 -34
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts +2 -0
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +4 -4
- package/dist/views/Request/RequestSubpageHeader.vue2.js +17 -15
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts +16 -0
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +31 -0
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +5 -0
- 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 +30 -33
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +18 -19
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +20 -20
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +68 -56
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +29 -30
- package/dist/views/Settings/Settings.vue.d.ts +4 -0
- package/dist/views/Settings/Settings.vue.d.ts.map +1 -0
- package/dist/views/Settings/Settings.vue.js +4 -0
- package/dist/views/Settings/Settings.vue2.js +59 -0
- package/dist/{components/DarkModeToggle/DarkModeIconToggle.vue.d.ts → views/Settings/SettingsGeneral.vue.d.ts} +1 -1
- package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -0
- package/dist/views/Settings/SettingsGeneral.vue.js +124 -0
- package/dist/views/Settings/SettingsGeneral.vue2.js +4 -0
- package/dist/views/Settings/SettingsGeneralMode.vue.d.ts +3 -0
- package/dist/views/Settings/SettingsGeneralMode.vue.d.ts.map +1 -0
- package/dist/views/Settings/SettingsGeneralMode.vue.js +78 -0
- package/dist/views/Settings/SettingsGeneralMode.vue2.js +4 -0
- package/package.json +59 -35
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +0 -1
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +0 -31
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue2.js +0 -4
- package/dist/components/DarkModeToggle/index.d.ts +0 -2
- package/dist/components/DarkModeToggle/index.d.ts.map +0 -1
- package/dist/components/DarkModeToggle/index.js +0 -4
- package/dist/components/ScreenReader.vue.js +0 -7
- package/dist/components/ScreenReader.vue2.js +0 -18
- package/dist/libs/event-busses/cancel-request-bus.d.ts +0 -2
- package/dist/libs/event-busses/cancel-request-bus.d.ts.map +0 -1
- package/dist/libs/event-busses/cancel-request-bus.js +0 -5
- package/dist/libs/event-busses/command-palette-bus.d.ts +0 -14
- package/dist/libs/event-busses/command-palette-bus.d.ts.map +0 -1
- package/dist/libs/event-busses/command-palette-bus.js +0 -5
- package/dist/libs/event-busses/execute-request-bus.d.ts +0 -2
- package/dist/libs/event-busses/execute-request-bus.d.ts.map +0 -1
- package/dist/libs/event-busses/execute-request-bus.js +0 -5
- package/dist/libs/event-busses/hot-keys-bus.d.ts.map +0 -1
- package/dist/libs/event-busses/hot-keys-bus.js +0 -47
- package/dist/libs/event-busses/index.d.ts +0 -6
- package/dist/libs/event-busses/index.d.ts.map +0 -1
- package/dist/libs/event-busses/index.js +0 -15
- package/dist/libs/event-busses/request-status-bus.d.ts +0 -5
- package/dist/libs/event-busses/request-status-bus.d.ts.map +0 -1
- package/dist/libs/event-busses/request-status-bus.js +0 -5
|
@@ -1,192 +1,192 @@
|
|
|
1
|
-
import { ERRORS as
|
|
1
|
+
import { ERRORS as L, normalizeError as P } from "./errors.js";
|
|
2
2
|
import { normalizeHeaders as M } from "./normalize-headers.js";
|
|
3
|
-
import { replaceTemplateVariables as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import { replaceTemplateVariables as f } from "./string-template.js";
|
|
4
|
+
import { canMethodHaveBody as z, isRelativePath as E, shouldUseProxy as B } from "@scalar/oas-utils/helpers";
|
|
5
|
+
import R from "js-cookie";
|
|
6
6
|
import H from "whatwg-mimetype";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
function K(r, n) {
|
|
7
|
+
import { textMediaTypes as K } from "../views/Request/consts/mediaTypes.js";
|
|
8
|
+
function _(r, n) {
|
|
10
9
|
const o = new H(n);
|
|
11
|
-
if (
|
|
12
|
-
const
|
|
13
|
-
return o.subtype === "json" ? JSON.parse(
|
|
10
|
+
if (K.includes(o.essence)) {
|
|
11
|
+
const d = new TextDecoder(o.parameters.get("charset")).decode(r);
|
|
12
|
+
return o.subtype === "json" ? JSON.parse(d) : d;
|
|
14
13
|
}
|
|
15
14
|
return new Blob([r], { type: o.essence });
|
|
16
15
|
}
|
|
17
|
-
function
|
|
16
|
+
function q(r, n) {
|
|
18
17
|
const o = {};
|
|
19
|
-
return r.parameters.headers.forEach((
|
|
20
|
-
const
|
|
21
|
-
|
|
18
|
+
return r.parameters.headers.forEach((e) => {
|
|
19
|
+
const d = e.key.trim().toLowerCase();
|
|
20
|
+
e.enabled && (d !== "content-type" || e.value !== "multipart/form-data") && (o[d] = f(e.value, n));
|
|
22
21
|
}), o;
|
|
23
22
|
}
|
|
24
23
|
function j(r, n) {
|
|
25
24
|
const o = new URLSearchParams();
|
|
26
|
-
return r.parameters.query.forEach((
|
|
27
|
-
|
|
25
|
+
return r.parameters.query.forEach((e) => {
|
|
26
|
+
e.enabled && e.value && o.append(e.key, f(e.value, n));
|
|
28
27
|
}), o;
|
|
29
28
|
}
|
|
30
29
|
function N({
|
|
31
30
|
example: r,
|
|
32
31
|
env: n,
|
|
33
32
|
globalCookies: o,
|
|
34
|
-
domain:
|
|
35
|
-
proxy:
|
|
33
|
+
domain: e,
|
|
34
|
+
proxy: d
|
|
36
35
|
}) {
|
|
37
|
-
let
|
|
36
|
+
let h;
|
|
38
37
|
try {
|
|
39
|
-
|
|
38
|
+
h = new URL(d || e).host;
|
|
40
39
|
} catch {
|
|
41
|
-
typeof window < "u" && (
|
|
40
|
+
typeof window < "u" && (h = window.location.host);
|
|
42
41
|
}
|
|
43
|
-
const
|
|
42
|
+
const i = {
|
|
44
43
|
// Must point all cookies to the proxy and let it sort them out
|
|
45
|
-
domain:
|
|
44
|
+
domain: h,
|
|
46
45
|
// Means that the browser sends the cookie with both cross-site and same-site requests.
|
|
47
46
|
sameSite: "None",
|
|
48
47
|
// The Secure attribute must also be set when setting SameSite=None.
|
|
49
48
|
secure: !0
|
|
50
|
-
},
|
|
51
|
-
return Object.keys(
|
|
52
|
-
|
|
53
|
-
}), o.forEach((
|
|
54
|
-
var
|
|
55
|
-
const { name:
|
|
56
|
-
(
|
|
49
|
+
}, l = R.get();
|
|
50
|
+
return Object.keys(l).forEach((a) => R.remove(a)), r.parameters.cookies.forEach((a) => {
|
|
51
|
+
a.enabled && R.set(a.key, f(a.value, n));
|
|
52
|
+
}), o.forEach((a) => {
|
|
53
|
+
var u;
|
|
54
|
+
const { name: s, value: g, ...p } = a;
|
|
55
|
+
(p.domain === e || ((u = p.domain) == null ? void 0 : u.startsWith(".")) && e.endsWith(p.domain ?? "")) && R.set(s, g, {
|
|
57
56
|
/** Override the domain with the proxy value */
|
|
58
|
-
domain:
|
|
57
|
+
domain: h,
|
|
59
58
|
// TODO: path cookies probably don't worth with the proxy
|
|
60
|
-
path:
|
|
61
|
-
expires:
|
|
62
|
-
httpOnly:
|
|
63
|
-
secure:
|
|
59
|
+
path: p.path,
|
|
60
|
+
expires: p.expires ? new Date(p.expires) : void 0,
|
|
61
|
+
httpOnly: p.httpOnly,
|
|
62
|
+
secure: p.secure
|
|
64
63
|
});
|
|
65
64
|
}), {
|
|
66
|
-
cookieParams:
|
|
65
|
+
cookieParams: i
|
|
67
66
|
};
|
|
68
67
|
}
|
|
69
68
|
function Q(r, n, o) {
|
|
70
|
-
var
|
|
69
|
+
var e, d, h;
|
|
71
70
|
if (!z(r))
|
|
72
71
|
return { body: void 0, contentType: void 0 };
|
|
73
72
|
if (n.body.activeBody === "formData" && n.body.formData) {
|
|
74
|
-
const
|
|
75
|
-
return n.body.formData.value.forEach((
|
|
76
|
-
!
|
|
77
|
-
}), { body:
|
|
73
|
+
const i = n.body.formData.encoding === "form-data" ? "multipart/form-data" : "application/x-www-form-urlencoded", l = n.body.formData.encoding === "form-data" ? new FormData() : new URLSearchParams();
|
|
74
|
+
return n.body.formData.value.forEach((a) => {
|
|
75
|
+
!a.enabled || !a.key || (a.file && l instanceof FormData ? l.append(a.key, a.file, a.file.name) : a.value !== void 0 && l.append(a.key, f(a.value, o)));
|
|
76
|
+
}), { body: l, contentType: i };
|
|
78
77
|
}
|
|
79
78
|
return n.body.activeBody === "raw" ? {
|
|
80
|
-
body:
|
|
81
|
-
contentType: (
|
|
79
|
+
body: f(((e = n.body.raw) == null ? void 0 : e.value) ?? "", o),
|
|
80
|
+
contentType: (d = n.body.raw) == null ? void 0 : d.encoding
|
|
82
81
|
} : n.body.activeBody === "binary" ? {
|
|
83
82
|
body: n.body.binary,
|
|
84
|
-
contentType: (
|
|
83
|
+
contentType: (h = n.body.binary) == null ? void 0 : h.type
|
|
85
84
|
} : {
|
|
86
85
|
body: void 0,
|
|
87
86
|
contentType: void 0
|
|
88
87
|
};
|
|
89
88
|
}
|
|
90
|
-
const
|
|
89
|
+
const x = ({
|
|
91
90
|
request: r,
|
|
92
91
|
auth: n,
|
|
93
92
|
example: o,
|
|
94
|
-
server:
|
|
95
|
-
securitySchemes:
|
|
96
|
-
proxy:
|
|
93
|
+
server: e,
|
|
94
|
+
securitySchemes: d,
|
|
95
|
+
proxy: h,
|
|
96
|
+
status: i,
|
|
97
97
|
environment: l,
|
|
98
|
-
globalCookies:
|
|
98
|
+
globalCookies: a
|
|
99
99
|
}) => {
|
|
100
100
|
try {
|
|
101
|
-
const
|
|
102
|
-
let
|
|
103
|
-
if (!
|
|
104
|
-
const
|
|
101
|
+
const s = l ?? {}, g = new AbortController(), p = o.parameters.path.reduce((w, t) => (t.enabled && (w[t.key] = f(t.value, s)), w), {}), D = f((e == null ? void 0 : e.url) ?? "", s), u = f(r.path, p);
|
|
102
|
+
let m = D || u;
|
|
103
|
+
if (!m) throw L.URL_EMPTY;
|
|
104
|
+
const T = j(o, s), b = q(o, s), { body: C } = Q(r.method, o, s);
|
|
105
|
+
return N({
|
|
105
106
|
example: o,
|
|
106
|
-
env:
|
|
107
|
-
globalCookies:
|
|
108
|
-
domain:
|
|
109
|
-
proxy:
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
h.in === "header" && (w[a.name] = s), h.in === "query" && P.append(a.name, s), h.in === "cookie" && k.set(a.name, s);
|
|
107
|
+
env: s,
|
|
108
|
+
globalCookies: a,
|
|
109
|
+
domain: m,
|
|
110
|
+
proxy: h
|
|
111
|
+
}), r.selectedSecuritySchemeUids.forEach((w) => {
|
|
112
|
+
const t = n[w], y = d[w];
|
|
113
|
+
if (!(!t || !y)) {
|
|
114
|
+
if (y.type === "apiKey" && t.type === "apiKey") {
|
|
115
|
+
const c = f(t.value, s);
|
|
116
|
+
y.in === "header" && (b[t.name] = c), y.in === "query" && T.append(t.name, c), y.in === "cookie" && R.set(t.name, c);
|
|
117
117
|
}
|
|
118
|
-
if (
|
|
119
|
-
if (
|
|
120
|
-
const
|
|
121
|
-
|
|
118
|
+
if (y.type === "http" && t.type === "http")
|
|
119
|
+
if (y.scheme === "basic") {
|
|
120
|
+
const c = f(t.username, s), S = f(t.password, s), U = `${c}:${S}`;
|
|
121
|
+
b.Authorization = `Basic ${btoa(U)}`;
|
|
122
122
|
} else {
|
|
123
|
-
const
|
|
124
|
-
|
|
123
|
+
const c = f(t.token, s);
|
|
124
|
+
b.Authorization = `Bearer ${c}`;
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
y.type === "oauth2" && t.type.includes("oauth") && "token" in t && (t.token || console.error("OAuth token was not created"), b.Authorization = `Bearer ${t.token}`);
|
|
127
127
|
}
|
|
128
128
|
}), [
|
|
129
129
|
null,
|
|
130
130
|
{
|
|
131
131
|
sendRequest: async () => {
|
|
132
|
-
|
|
133
|
-
const
|
|
132
|
+
i == null || i.emit("start");
|
|
133
|
+
const w = Date.now();
|
|
134
134
|
try {
|
|
135
|
-
if (
|
|
136
|
-
const O = E(
|
|
137
|
-
|
|
138
|
-
...
|
|
135
|
+
if (m && (!E(m) || typeof window < "u")) {
|
|
136
|
+
const O = E(m) ? window.location.origin + m : m, k = new URL(O), $ = new URL(u, k.origin), v = new URL(k);
|
|
137
|
+
e != null && e.url && (k.pathname === "/" ? v.pathname = u : v.pathname = k.pathname + u), v.search = new URLSearchParams([
|
|
138
|
+
...k.searchParams,
|
|
139
139
|
...$.searchParams,
|
|
140
|
-
...
|
|
141
|
-
]).toString(),
|
|
140
|
+
...T
|
|
141
|
+
]).toString(), m = v.toString();
|
|
142
142
|
}
|
|
143
|
-
const
|
|
144
|
-
signal:
|
|
143
|
+
const t = new URLSearchParams([["scalar_url", m.toString()]]), y = B(h, m) ? `${h}?${t.toString()}` : m, c = await fetch(y, {
|
|
144
|
+
signal: g.signal,
|
|
145
145
|
method: r.method.toUpperCase(),
|
|
146
146
|
body: C,
|
|
147
|
-
headers:
|
|
147
|
+
headers: b
|
|
148
148
|
});
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
B(
|
|
153
|
-
),
|
|
154
|
-
await
|
|
155
|
-
|
|
156
|
-
), F = "getSetCookie" in
|
|
149
|
+
i == null || i.emit("stop");
|
|
150
|
+
const S = M(
|
|
151
|
+
c.headers,
|
|
152
|
+
B(h, m)
|
|
153
|
+
), U = c.headers.get("content-type") ?? "text/plain;charset=UTF-8", A = _(
|
|
154
|
+
await c.arrayBuffer(),
|
|
155
|
+
U
|
|
156
|
+
), F = "getSetCookie" in c.headers && typeof c.headers.getSetCookie == "function" ? c.headers.getSetCookie() : [];
|
|
157
157
|
return [
|
|
158
158
|
null,
|
|
159
159
|
{
|
|
160
160
|
timestamp: Date.now(),
|
|
161
161
|
request: o,
|
|
162
162
|
response: {
|
|
163
|
-
...
|
|
164
|
-
headers:
|
|
163
|
+
...c,
|
|
164
|
+
headers: S,
|
|
165
165
|
cookieHeaderKeys: F,
|
|
166
166
|
data: A,
|
|
167
|
-
duration: Date.now() -
|
|
167
|
+
duration: Date.now() - w,
|
|
168
168
|
method: r.method,
|
|
169
|
-
status:
|
|
170
|
-
path:
|
|
169
|
+
status: c.status,
|
|
170
|
+
path: u
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
];
|
|
174
|
-
} catch (
|
|
175
|
-
return
|
|
174
|
+
} catch (t) {
|
|
175
|
+
return i == null || i.emit("abort"), [P(t, L.REQUEST_FAILED), null];
|
|
176
176
|
}
|
|
177
177
|
},
|
|
178
|
-
controller:
|
|
178
|
+
controller: g
|
|
179
179
|
}
|
|
180
180
|
];
|
|
181
|
-
} catch (
|
|
182
|
-
return
|
|
181
|
+
} catch (s) {
|
|
182
|
+
return i == null || i.emit("abort"), [P(s), null];
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
185
|
export {
|
|
186
186
|
Q as createFetchBody,
|
|
187
|
-
|
|
187
|
+
q as createFetchHeaders,
|
|
188
188
|
j as createFetchQueryParams,
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
x as createRequestOperation,
|
|
190
|
+
_ as decodeBuffer,
|
|
191
191
|
N as setRequestCookies
|
|
192
192
|
};
|
package/dist/router.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ export declare enum PathId {
|
|
|
7
7
|
Schema = "schema",
|
|
8
8
|
Environment = "environment",
|
|
9
9
|
Servers = "servers",
|
|
10
|
-
Workspace = "workspace"
|
|
10
|
+
Workspace = "workspace",
|
|
11
|
+
Settings = "settings"
|
|
11
12
|
}
|
|
12
13
|
/** Routes required by the API client modal */
|
|
13
14
|
export declare const modalRoutes: ({
|
package/dist/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;IACvB,QAAQ,aAAa;CACtB;AAwBD,8CAA8C;AAC9C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;IAaI,CAAA;AAoF5B,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
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
|
|
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.Settings = "settings", e))(f || {});
|
|
3
|
+
const n = [
|
|
4
4
|
{
|
|
5
5
|
path: "",
|
|
6
6
|
redirect: (e) => `${e.fullPath.replace(/\/$/, "")}/request/default`
|
|
@@ -30,9 +30,9 @@ const p = [
|
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
path: "/workspace/:workspace",
|
|
33
|
-
children:
|
|
33
|
+
children: n
|
|
34
34
|
}
|
|
35
|
-
],
|
|
35
|
+
], p = [
|
|
36
36
|
{
|
|
37
37
|
path: "/",
|
|
38
38
|
redirect: c
|
|
@@ -44,7 +44,7 @@ const p = [
|
|
|
44
44
|
{
|
|
45
45
|
path: "/workspace/:workspace",
|
|
46
46
|
children: [
|
|
47
|
-
...
|
|
47
|
+
...n,
|
|
48
48
|
// {
|
|
49
49
|
// path: 'collection',
|
|
50
50
|
// redirect: (to) =>
|
|
@@ -99,44 +99,53 @@ const p = [
|
|
|
99
99
|
name: "servers",
|
|
100
100
|
path: "servers/:servers",
|
|
101
101
|
component: () => import("./views/Servers/Servers.vue.js")
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
path: "settings",
|
|
105
|
+
redirect: (e) => `${e.fullPath.replace(/\/$/, "")}/general`
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "settings",
|
|
109
|
+
path: "settings/:settings",
|
|
110
|
+
component: () => import("./views/Settings/Settings.vue.js")
|
|
102
111
|
}
|
|
103
112
|
]
|
|
104
113
|
}
|
|
105
|
-
],
|
|
114
|
+
], t = a({
|
|
106
115
|
history: l(),
|
|
107
|
-
routes:
|
|
108
|
-
}),
|
|
116
|
+
routes: p
|
|
117
|
+
}), k = () => a({
|
|
109
118
|
history: i(),
|
|
110
|
-
routes:
|
|
111
|
-
}),
|
|
119
|
+
routes: p
|
|
120
|
+
}), d = () => a({
|
|
112
121
|
history: m(),
|
|
113
122
|
routes: h
|
|
114
|
-
}),
|
|
115
|
-
function
|
|
116
|
-
const
|
|
117
|
-
|
|
123
|
+
}), u = "activeWorkspace";
|
|
124
|
+
function v(e) {
|
|
125
|
+
const r = e.params.workspace;
|
|
126
|
+
r && localStorage.setItem(u, `${r}`);
|
|
118
127
|
}
|
|
119
128
|
function c() {
|
|
120
|
-
return `/workspace/${localStorage.getItem(
|
|
129
|
+
return `/workspace/${localStorage.getItem(u) ?? "default"}/request/default`;
|
|
121
130
|
}
|
|
122
|
-
function w(e,
|
|
131
|
+
function w(e, r) {
|
|
123
132
|
var o, s;
|
|
124
|
-
|
|
125
|
-
!
|
|
126
|
-
|
|
133
|
+
t.currentRoute.value && // If the item is missing then we know the UID is no longer in use and redirect to the default
|
|
134
|
+
!r && ((o = t.currentRoute.value) != null && o.params[e]) && ((s = t.currentRoute.value) == null ? void 0 : s.params[e]) !== "default" && // We only redirect if the key is missing for the matching route
|
|
135
|
+
t.currentRoute.value.path.includes(e) && t.push({
|
|
127
136
|
params: {
|
|
128
|
-
...
|
|
137
|
+
...t.currentRoute.value.params,
|
|
129
138
|
[e]: "default"
|
|
130
139
|
}
|
|
131
140
|
});
|
|
132
141
|
}
|
|
133
142
|
export {
|
|
134
143
|
f as PathId,
|
|
135
|
-
|
|
136
|
-
|
|
144
|
+
d as createModalRouter,
|
|
145
|
+
k as createWebHashRouter,
|
|
137
146
|
w as fallbackMissingParams,
|
|
138
147
|
h as modalRoutes,
|
|
139
148
|
c as redirectToDefaultWorkspace,
|
|
140
|
-
|
|
141
|
-
|
|
149
|
+
t as router,
|
|
150
|
+
v as saveWorkspace
|
|
142
151
|
};
|
|
@@ -197,7 +197,7 @@ export declare function createStoreCollections(useLocalStorage: boolean): {
|
|
|
197
197
|
components?: Record<string, unknown> | undefined;
|
|
198
198
|
webhooks?: Record<string, unknown> | undefined;
|
|
199
199
|
}) => void;
|
|
200
|
-
edit: <P extends "type" | "children" | "
|
|
200
|
+
edit: <P extends "type" | "children" | "info" | "servers" | "uid" | "auth" | "securitySchemes" | "tags" | "requests" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "selectedServerUid" | `servers.${number}` | `tags.${number}` | `security.${number}` | `security.${number}.${string}` | "externalDocs.url" | "externalDocs.description" | "x-scalar-icon" | `children.${number}` | "info.summary" | "info.title" | "info.description" | "info.termsOfService" | "info.contact" | "info.license" | "info.version" | "info.contact.url" | "info.contact.name" | "info.contact.email" | "info.license.url" | "info.license.name" | "info.license.identifier" | `auth.${string}` | `securitySchemes.${number}` | `requests.${number}` | `components.${string}` | `webhooks.${string}`>(uid: string, path: P, value: P extends "type" | "children" | "info" | "servers" | "uid" | "auth" | "securitySchemes" | "tags" | "requests" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "selectedServerUid" | "x-scalar-icon" ? {
|
|
201
201
|
type: "collection";
|
|
202
202
|
uid: string;
|
|
203
203
|
children: string[];
|
|
@@ -260,7 +260,7 @@ export declare function createStoreCollections(useLocalStorage: boolean): {
|
|
|
260
260
|
} | undefined;
|
|
261
261
|
components?: Record<string, unknown> | undefined;
|
|
262
262
|
webhooks?: Record<string, unknown> | undefined;
|
|
263
|
-
}[P] : P extends `${infer K}.${infer R}` ? K extends "type" | "children" | "
|
|
263
|
+
}[P] : P extends `${infer K}.${infer R}` ? K extends "type" | "children" | "info" | "servers" | "uid" | "auth" | "securitySchemes" | "tags" | "requests" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "selectedServerUid" | "x-scalar-icon" ? R extends import("@scalar/object-utils/nested").Path<{
|
|
264
264
|
type: "collection";
|
|
265
265
|
uid: string;
|
|
266
266
|
children: string[];
|
|
@@ -387,7 +387,7 @@ export declare function createStoreCollections(useLocalStorage: boolean): {
|
|
|
387
387
|
components?: Record<string, unknown> | undefined;
|
|
388
388
|
webhooks?: Record<string, unknown> | undefined;
|
|
389
389
|
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) => void;
|
|
390
|
-
untrackedEdit: <P extends "type" | "children" | "
|
|
390
|
+
untrackedEdit: <P extends "type" | "children" | "info" | "servers" | "uid" | "auth" | "securitySchemes" | "tags" | "requests" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "selectedServerUid" | `servers.${number}` | `tags.${number}` | `security.${number}` | `security.${number}.${string}` | "externalDocs.url" | "externalDocs.description" | "x-scalar-icon" | `children.${number}` | "info.summary" | "info.title" | "info.description" | "info.termsOfService" | "info.contact" | "info.license" | "info.version" | "info.contact.url" | "info.contact.name" | "info.contact.email" | "info.license.url" | "info.license.name" | "info.license.identifier" | `auth.${string}` | `securitySchemes.${number}` | `requests.${number}` | `components.${string}` | `webhooks.${string}`>(uid: string, path: P, value: P extends "type" | "children" | "info" | "servers" | "uid" | "auth" | "securitySchemes" | "tags" | "requests" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "selectedServerUid" | "x-scalar-icon" ? {
|
|
391
391
|
type: "collection";
|
|
392
392
|
uid: string;
|
|
393
393
|
children: string[];
|
|
@@ -450,7 +450,7 @@ export declare function createStoreCollections(useLocalStorage: boolean): {
|
|
|
450
450
|
} | undefined;
|
|
451
451
|
components?: Record<string, unknown> | undefined;
|
|
452
452
|
webhooks?: Record<string, unknown> | undefined;
|
|
453
|
-
}[P] : P extends `${infer K}.${infer R}` ? K extends "type" | "children" | "
|
|
453
|
+
}[P] : P extends `${infer K}.${infer R}` ? K extends "type" | "children" | "info" | "servers" | "uid" | "auth" | "securitySchemes" | "tags" | "requests" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "selectedServerUid" | "x-scalar-icon" ? R extends import("@scalar/object-utils/nested").Path<{
|
|
454
454
|
type: "collection";
|
|
455
455
|
uid: string;
|
|
456
456
|
children: string[];
|
package/dist/store/cookies.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export declare function createStoreCookies(useLocalStorage: boolean): {
|
|
|
41
41
|
partitioned?: boolean | undefined;
|
|
42
42
|
secure?: boolean | undefined;
|
|
43
43
|
}) => void;
|
|
44
|
-
edit: <P extends "path" | "
|
|
44
|
+
edit: <P extends "path" | "value" | "name" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure">(uid: string, path: P, value: P extends "path" | "value" | "name" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure" ? {
|
|
45
45
|
value: string;
|
|
46
46
|
uid: string;
|
|
47
47
|
name: string;
|
|
@@ -53,7 +53,7 @@ export declare function createStoreCookies(useLocalStorage: boolean): {
|
|
|
53
53
|
maxAge?: number | undefined;
|
|
54
54
|
partitioned?: boolean | undefined;
|
|
55
55
|
secure?: boolean | undefined;
|
|
56
|
-
}[P] : P extends `${infer K}.${infer R}` ? K extends "path" | "
|
|
56
|
+
}[P] : P extends `${infer K}.${infer R}` ? K extends "path" | "value" | "name" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure" ? R extends import("@scalar/object-utils/nested").Path<{
|
|
57
57
|
value: string;
|
|
58
58
|
uid: string;
|
|
59
59
|
name: string;
|
|
@@ -78,7 +78,7 @@ export declare function createStoreCookies(useLocalStorage: boolean): {
|
|
|
78
78
|
partitioned?: boolean | undefined;
|
|
79
79
|
secure?: boolean | undefined;
|
|
80
80
|
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) => void;
|
|
81
|
-
untrackedEdit: <P extends "path" | "
|
|
81
|
+
untrackedEdit: <P extends "path" | "value" | "name" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure">(uid: string, path: P, value: P extends "path" | "value" | "name" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure" ? {
|
|
82
82
|
value: string;
|
|
83
83
|
uid: string;
|
|
84
84
|
name: string;
|
|
@@ -90,7 +90,7 @@ export declare function createStoreCookies(useLocalStorage: boolean): {
|
|
|
90
90
|
maxAge?: number | undefined;
|
|
91
91
|
partitioned?: boolean | undefined;
|
|
92
92
|
secure?: boolean | undefined;
|
|
93
|
-
}[P] : P extends `${infer K}.${infer R}` ? K extends "path" | "
|
|
93
|
+
}[P] : P extends `${infer K}.${infer R}` ? K extends "path" | "value" | "name" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure" ? R extends import("@scalar/object-utils/nested").Path<{
|
|
94
94
|
value: string;
|
|
95
95
|
uid: string;
|
|
96
96
|
name: string;
|
|
@@ -24,13 +24,13 @@ export declare function createStoreEnvironments(useLocalStorage: boolean): {
|
|
|
24
24
|
color: string;
|
|
25
25
|
isDefault?: boolean | undefined;
|
|
26
26
|
}) => void;
|
|
27
|
-
edit: <P extends "
|
|
27
|
+
edit: <P extends "color" | "value" | "name" | "uid" | "isDefault">(uid: string, path: P, value: P extends "color" | "value" | "name" | "uid" | "isDefault" ? {
|
|
28
28
|
value: string;
|
|
29
29
|
uid: string;
|
|
30
30
|
name: string;
|
|
31
31
|
color: string;
|
|
32
32
|
isDefault?: boolean | undefined;
|
|
33
|
-
}[P] : P extends `${infer K}.${infer R}` ? K extends "
|
|
33
|
+
}[P] : P extends `${infer K}.${infer R}` ? K extends "color" | "value" | "name" | "uid" | "isDefault" ? R extends import("@scalar/object-utils/nested").Path<{
|
|
34
34
|
value: string;
|
|
35
35
|
uid: string;
|
|
36
36
|
name: string;
|
|
@@ -43,13 +43,13 @@ export declare function createStoreEnvironments(useLocalStorage: boolean): {
|
|
|
43
43
|
color: string;
|
|
44
44
|
isDefault?: boolean | undefined;
|
|
45
45
|
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) => void;
|
|
46
|
-
untrackedEdit: <P extends "
|
|
46
|
+
untrackedEdit: <P extends "color" | "value" | "name" | "uid" | "isDefault">(uid: string, path: P, value: P extends "color" | "value" | "name" | "uid" | "isDefault" ? {
|
|
47
47
|
value: string;
|
|
48
48
|
uid: string;
|
|
49
49
|
name: string;
|
|
50
50
|
color: string;
|
|
51
51
|
isDefault?: boolean | undefined;
|
|
52
|
-
}[P] : P extends `${infer K}.${infer R}` ? K extends "
|
|
52
|
+
}[P] : P extends `${infer K}.${infer R}` ? K extends "color" | "value" | "name" | "uid" | "isDefault" ? R extends import("@scalar/object-utils/nested").Path<{
|
|
53
53
|
value: string;
|
|
54
54
|
uid: string;
|
|
55
55
|
name: string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CommandPaletteEvent } from '../components/CommandPalette/TheCommandPalette.vue.js';
|
|
2
|
+
import type { RequestStatus } from '../libs/send-request.js';
|
|
3
|
+
/** Create the store for the api client events */
|
|
4
|
+
export declare function createStoreEvents(): {
|
|
5
|
+
/**
|
|
6
|
+
* Event bus to execute requests, usually triggered by the send button in the address bar
|
|
7
|
+
* OR the keyboard shortcut
|
|
8
|
+
*/
|
|
9
|
+
executeRequest: import("../libs/event-bus.js").EventBus<any>;
|
|
10
|
+
/**
|
|
11
|
+
* Event bus to cancel requests, usually triggered by response loading overlay
|
|
12
|
+
*/
|
|
13
|
+
cancelRequest: import("../libs/event-bus.js").EventBus<any>;
|
|
14
|
+
/**
|
|
15
|
+
* Event bus to keep track of when a request is started, stopped, or aborted
|
|
16
|
+
*/
|
|
17
|
+
requestStatus: import("../libs/event-bus.js").EventBus<RequestStatus>;
|
|
18
|
+
/**
|
|
19
|
+
* Event bus for controlling the Command Palette
|
|
20
|
+
*
|
|
21
|
+
* @param commandName - the command name you wish to execute, leave empty for the full palette
|
|
22
|
+
*/
|
|
23
|
+
commandPalette: import("../libs/event-bus.js").EventBus<CommandPaletteEvent>;
|
|
24
|
+
/**
|
|
25
|
+
* Event bus for handling hot keys
|
|
26
|
+
*/
|
|
27
|
+
hotKeys: import("../libs/event-bus.js").EventBus<Partial<Record<"closeModal" | "navigateSearchResultsDown" | "selectSearchResult" | "navigateSearchResultsUp" | "openCommandPalette" | "openCommandPaletteRequest" | "toggleSidebar" | "addTopNav" | "closeTopNav" | "navigateTopNavLeft" | "navigateTopNavRight" | "focusAddressBar" | "jumpToTab" | "jumpToLastTab" | "focusRequestSearch", KeyboardEvent>>>;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/store/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAA;AAG5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,iDAAiD;AACjD,wBAAgB,iBAAiB;IAE7B;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;OAEG;;EAGN"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createEventBus as e } from "../libs/event-bus.js";
|
|
2
|
+
function r() {
|
|
3
|
+
return {
|
|
4
|
+
/**
|
|
5
|
+
* Event bus to execute requests, usually triggered by the send button in the address bar
|
|
6
|
+
* OR the keyboard shortcut
|
|
7
|
+
*/
|
|
8
|
+
executeRequest: e(),
|
|
9
|
+
/**
|
|
10
|
+
* Event bus to cancel requests, usually triggered by response loading overlay
|
|
11
|
+
*/
|
|
12
|
+
cancelRequest: e(),
|
|
13
|
+
/**
|
|
14
|
+
* Event bus to keep track of when a request is started, stopped, or aborted
|
|
15
|
+
*/
|
|
16
|
+
requestStatus: e(),
|
|
17
|
+
/**
|
|
18
|
+
* Event bus for controlling the Command Palette
|
|
19
|
+
*
|
|
20
|
+
* @param commandName - the command name you wish to execute, leave empty for the full palette
|
|
21
|
+
*/
|
|
22
|
+
commandPalette: e(),
|
|
23
|
+
/**
|
|
24
|
+
* Event bus for handling hot keys
|
|
25
|
+
*/
|
|
26
|
+
hotKeys: e()
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
r as createStoreEvents
|
|
31
|
+
};
|