@scalar/api-client 2.1.19 → 2.1.21
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 +20 -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 +77 -79
- package/dist/components/AddressBar/AddressBarServer.vue.js +23 -23
- package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +62 -45
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +6 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +89 -91
- package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +29 -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/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +38 -38
- package/dist/layouts/App/create-api-client-app.d.ts +33 -26
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue2.js +15 -15
- package/dist/layouts/Modal/create-api-client-modal.d.ts +66 -52
- 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 -30
- package/dist/layouts/Web/create-api-client-web.d.ts +33 -26
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +33 -26
- 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/index.d.ts +3 -1
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +31 -33
- 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/store/collections.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 +2 -2
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/security-schemes.d.ts +4 -4
- package/dist/store/servers.d.ts +4 -4
- package/dist/store/store.d.ts +66 -52
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +75 -73
- 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/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +63 -63
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- 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 +76 -76
- 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/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 +17 -18
- 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/package.json +6 -6
- 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,8 +1,7 @@
|
|
|
1
|
+
import type { EventBus } from '../libs/index.js';
|
|
1
2
|
import type { HotkeyEventName } from '@scalar/oas-utils/entities/hotkeys';
|
|
2
3
|
import type { HotKeyConfig, HotKeyModifiers } from '@scalar/oas-utils/entities/workspace';
|
|
3
|
-
export type
|
|
4
|
-
/** Event bus for hot keys */
|
|
5
|
-
export declare const hotKeyBus: import("@vueuse/core").UseEventBusReturn<Partial<Record<"closeModal" | "navigateSearchResultsDown" | "selectSearchResult" | "navigateSearchResultsUp" | "openCommandPalette" | "openCommandPaletteRequest" | "toggleSidebar" | "addTopNav" | "closeTopNav" | "navigateTopNavLeft" | "navigateTopNavRight" | "focusAddressBar" | "jumpToTab" | "jumpToLastTab" | "focusRequestSearch", KeyboardEvent>>, any>;
|
|
4
|
+
export type HotKeyEvent = Partial<Record<HotkeyEventName, KeyboardEvent>>;
|
|
6
5
|
/**
|
|
7
6
|
* Default set of keybindings
|
|
8
7
|
*
|
|
@@ -18,17 +17,17 @@ export declare const hotKeyBus: import("@vueuse/core").UseEventBusReturn<Partial
|
|
|
18
17
|
*/
|
|
19
18
|
export declare const DEFAULT_HOTKEYS: HotKeyConfig;
|
|
20
19
|
/** Converts our modifier config to the eventKey */
|
|
21
|
-
export declare const getModifiers: (modifiers: HotKeyModifiers) => ("
|
|
20
|
+
export declare const getModifiers: (modifiers: HotKeyModifiers) => ("metaKey" | "ctrlKey" | "altKey" | "shiftKey")[];
|
|
22
21
|
/**
|
|
23
22
|
* Global keydown handler for hotkeys
|
|
24
23
|
*
|
|
25
24
|
* This is the brain of the operation, we turn keybindings -> events
|
|
26
25
|
*/
|
|
27
|
-
export declare const handleHotKeyDown: (ev: KeyboardEvent, { hotKeys, modifiers, }?: {
|
|
28
|
-
hotKeys?: Partial<Record<"" | "." | "a" | "b" | "i" | "p" | "q" | "s" | "u" | "g" | ";" | "/" | "=" | "0" | "-" | "
|
|
26
|
+
export declare const handleHotKeyDown: (ev: KeyboardEvent, eventBus: EventBus<HotKeyEvent>, { hotKeys, modifiers, }?: {
|
|
27
|
+
hotKeys?: Partial<Record<"" | "." | "a" | "b" | "i" | "p" | "q" | "s" | "u" | "g" | ";" | "/" | "=" | "0" | "-" | "1" | "2" | "ArrowLeft" | "ArrowRight" | "Delete" | "Backspace" | "n" | "]" | "3" | "4" | "5" | "6" | "Space" | "Tab" | "Enter" | "Escape" | "ArrowDown" | "ArrowUp" | "End" | "Home" | "PageDown" | "PageUp" | "7" | "8" | "9" | "c" | "d" | "e" | "f" | "h" | "j" | "k" | "l" | "m" | "o" | "r" | "t" | "v" | "w" | "x" | "y" | "z" | "*" | "+" | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | "," | "`" | "[" | "\\", {
|
|
29
28
|
event: "closeModal" | "navigateSearchResultsDown" | "selectSearchResult" | "navigateSearchResultsUp" | "openCommandPalette" | "openCommandPaletteRequest" | "toggleSidebar" | "addTopNav" | "closeTopNav" | "navigateTopNavLeft" | "navigateTopNavRight" | "focusAddressBar" | "jumpToTab" | "jumpToLastTab" | "focusRequestSearch";
|
|
30
29
|
modifiers?: ("Meta" | "Control" | "Shift" | "Alt" | "default")[] | undefined;
|
|
31
30
|
}>> | undefined;
|
|
32
31
|
modifiers?: ("default" | "Meta" | "Control" | "Shift" | "Alt")[] | undefined;
|
|
33
32
|
}) => void;
|
|
34
|
-
//# sourceMappingURL=hot-keys
|
|
33
|
+
//# sourceMappingURL=hot-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hot-keys.d.ts","sourceRoot":"","sources":["../../src/libs/hot-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAChB,MAAM,sCAAsC,CAAA;AAG7C,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,CAAA;AAyBzE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAI7B,CAAA;AAsBD,mDAAmD;AACnD,eAAO,MAAM,YAAY,cAAe,eAAe,sDAQtD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,OACvB,aAAa,YACP,QAAQ,CAAC,WAAW,CAAC;;;;;;UA2BhC,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { isMacOS as f } from "@scalar/use-tooltip";
|
|
2
|
+
const c = [
|
|
3
|
+
"Escape",
|
|
4
|
+
"ArrowDown",
|
|
5
|
+
"ArrowUp",
|
|
6
|
+
"Enter",
|
|
7
|
+
"F1",
|
|
8
|
+
"F2",
|
|
9
|
+
"F3",
|
|
10
|
+
"F4",
|
|
11
|
+
"F5",
|
|
12
|
+
"F6",
|
|
13
|
+
"F7",
|
|
14
|
+
"F8",
|
|
15
|
+
"F9",
|
|
16
|
+
"F10",
|
|
17
|
+
"F11",
|
|
18
|
+
"F12"
|
|
19
|
+
], d = {
|
|
20
|
+
Escape: { event: "closeModal" },
|
|
21
|
+
b: { event: "toggleSidebar", modifiers: ["default"] },
|
|
22
|
+
k: { event: "openCommandPalette", modifiers: ["default"] }
|
|
23
|
+
}, o = (e) => {
|
|
24
|
+
if (!(e.target instanceof HTMLElement)) return !1;
|
|
25
|
+
const t = e.target;
|
|
26
|
+
return t.tagName === "INPUT" ? !c.includes(e.key) : !!(t.tagName === "TEXTAREA" || t.getAttribute("contenteditable"));
|
|
27
|
+
}, l = {
|
|
28
|
+
Alt: "altKey",
|
|
29
|
+
Control: "ctrlKey",
|
|
30
|
+
Shift: "shiftKey",
|
|
31
|
+
Meta: "metaKey"
|
|
32
|
+
}, m = (e) => e.map(
|
|
33
|
+
(t) => t === "default" ? f() ? "metaKey" : "ctrlKey" : l[t]
|
|
34
|
+
), p = (e, t, {
|
|
35
|
+
hotKeys: n = d,
|
|
36
|
+
modifiers: s = ["default"]
|
|
37
|
+
} = {}) => {
|
|
38
|
+
const i = e.key === " " ? "Space" : e.key, r = n[i];
|
|
39
|
+
r && (i === "Escape" ? t.emit({ [r.event]: e }) : m(r.modifiers || s).every((a) => e[a] === !0) && !o(e) ? t.emit({ [r.event]: e }) : !o(e) && r.modifiers === void 0 && t.emit({ [r.event]: e }));
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
d as DEFAULT_HOTKEYS,
|
|
43
|
+
m as getModifiers,
|
|
44
|
+
p as handleHotKeyDown
|
|
45
|
+
};
|
package/dist/libs/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './create-client.js';
|
|
2
2
|
export * from './formatters.js';
|
|
3
3
|
export * from './errors.js';
|
|
4
|
-
export * from './
|
|
4
|
+
export * from './hot-keys.js';
|
|
5
|
+
export * from './event-bus.js';
|
|
6
|
+
export * from './send-request.js';
|
|
5
7
|
export * from './errors.js';
|
|
6
8
|
export * from './normalize-headers.js';
|
|
7
9
|
export * from './local-storage.js';
|
package/dist/libs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/libs/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,cAAc,SAAS,CAAA;AACvB,cAAc,6BAA6B,CAAA;AAC3C,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/libs/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,cAAc,SAAS,CAAA;AACvB,cAAc,6BAA6B,CAAA;AAC3C,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/libs/index.js
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
import { createApiClient as o } from "./create-client.js";
|
|
2
|
-
import { formatBytes as
|
|
3
|
-
import { ERRORS as p, normalizeError as f, prettyErrorMessage as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { executeRequestBus as U } from "./event-busses/execute-request-bus.js";
|
|
14
|
-
import { cancelRequestBus as v } from "./event-busses/cancel-request-bus.js";
|
|
15
|
-
import { requestStatusBus as F } from "./event-busses/request-status-bus.js";
|
|
2
|
+
import { formatBytes as a, formatMs as m } from "./formatters.js";
|
|
3
|
+
import { ERRORS as p, normalizeError as f, prettyErrorMessage as c } from "./errors.js";
|
|
4
|
+
import { DEFAULT_HOTKEYS as x, getModifiers as l, handleHotKeyDown as n } from "./hot-keys.js";
|
|
5
|
+
import { createEventBus as u } from "./event-bus.js";
|
|
6
|
+
import { createFetchBody as y, createFetchHeaders as R, createFetchQueryParams as H, createRequestOperation as h, decodeBuffer as A, setRequestCookies as B } from "./send-request.js";
|
|
7
|
+
import { formatHeaderKey as D, normalizeHeaders as F } from "./normalize-headers.js";
|
|
8
|
+
import { loadAllResources as g } from "./local-storage.js";
|
|
9
|
+
import { parseEnvVariables as M } from "./environment-parser.js";
|
|
10
|
+
import { isUrl as v } from "./isUrl.js";
|
|
11
|
+
import { getOpenApiDocumentDetails as S } from "./getOpenApiDocumentDetails.js";
|
|
12
|
+
import { parseCurlCommand as U } from "./parse-curl.js";
|
|
16
13
|
export {
|
|
17
|
-
|
|
14
|
+
x as DEFAULT_HOTKEYS,
|
|
18
15
|
p as ERRORS,
|
|
19
|
-
v as cancelRequestBus,
|
|
20
|
-
g as commandPaletteBus,
|
|
21
16
|
o as createApiClient,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
u as createEventBus,
|
|
18
|
+
y as createFetchBody,
|
|
19
|
+
R as createFetchHeaders,
|
|
20
|
+
H as createFetchQueryParams,
|
|
21
|
+
h as createRequestOperation,
|
|
22
|
+
A as decodeBuffer,
|
|
23
|
+
a as formatBytes,
|
|
24
|
+
D as formatHeaderKey,
|
|
25
|
+
m as formatMs,
|
|
26
|
+
l as getModifiers,
|
|
27
|
+
S as getOpenApiDocumentDetails,
|
|
28
|
+
n as handleHotKeyDown,
|
|
29
|
+
v as isUrl,
|
|
30
|
+
g as loadAllResources,
|
|
33
31
|
f as normalizeError,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
F as normalizeHeaders,
|
|
33
|
+
U as parseCurlCommand,
|
|
34
|
+
M as parseEnvVariables,
|
|
35
|
+
c as prettyErrorMessage,
|
|
36
|
+
B as setRequestCookies
|
|
39
37
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type ErrorResponse } from '../libs/errors.js';
|
|
2
|
+
import type { EventBus } from '../libs/event-bus.js';
|
|
2
3
|
import type { Cookie } from '@scalar/oas-utils/entities/cookie';
|
|
3
4
|
import type { Collection, Request, RequestExample, RequestMethod, ResponseInstance, SecurityScheme, Server } from '@scalar/oas-utils/entities/spec';
|
|
5
|
+
export type RequestStatus = 'start' | 'stop' | 'abort';
|
|
4
6
|
/** Decode the buffer according to its content-type */
|
|
5
7
|
export declare function decodeBuffer(buffer: ArrayBuffer, contentType: string): any;
|
|
6
8
|
/** Populate the headers from enabled parameters */
|
|
@@ -47,11 +49,12 @@ type SendRequestResponse<ResponseDataType = unknown> = Promise<ErrorResponse<{
|
|
|
47
49
|
* Execute the request
|
|
48
50
|
* called from the send button as well as keyboard shortcuts
|
|
49
51
|
*/
|
|
50
|
-
export declare const createRequestOperation: <ResponseDataType = unknown>({ request, auth, example, server, securitySchemes, proxy, environment, globalCookies, }: {
|
|
52
|
+
export declare const createRequestOperation: <ResponseDataType = unknown>({ request, auth, example, server, securitySchemes, proxy, status, environment, globalCookies, }: {
|
|
51
53
|
auth: Collection["auth"];
|
|
52
54
|
request: Request;
|
|
53
55
|
example: RequestExample;
|
|
54
56
|
proxy?: string;
|
|
57
|
+
status?: EventBus<RequestStatus>;
|
|
55
58
|
environment: object | undefined;
|
|
56
59
|
server?: Server;
|
|
57
60
|
securitySchemes: Record<string, SecurityScheme>;
|
|
@@ -1 +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;
|
|
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;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAIhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC/D,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AASxC,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;AAGtD,sDAAsD;AACtD,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,OAkBpE;AAED,mDAAmD;AACnD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC,EAC3C,GAAG,EAAE,MAAM,0BAgBZ;AAED,sDAAsD;AACtD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC,EAC3C,GAAG,EAAE,MAAM,mBASZ;AAED,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,GAAG,EACH,aAAa,EACb,MAAM,EACN,KAAK,GACN,EAAE;IACD,OAAO,EAAE,cAAc,CAAA;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;;;;;;EA+DA;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,cAAc,EACvB,GAAG,EAAE,MAAM;;;;;;;;;EAgDZ;AAED,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,6GAUpD;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,MAAM,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAA;IAChC,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"}
|
|
@@ -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
|
};
|
|
@@ -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" | "info" | "servers" | "
|
|
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" | "info" | "servers" | "
|
|
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" | "info" | "servers" | "
|
|
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" | "info" | "servers" | "
|
|
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[];
|
|
@@ -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"}
|