@scalar/api-client 2.1.19 → 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.
Files changed (103) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +77 -79
  5. package/dist/components/AddressBar/AddressBarServer.vue.js +23 -23
  6. package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +62 -45
  8. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +6 -0
  9. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  11. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +89 -91
  12. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  13. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +29 -32
  14. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  15. package/dist/components/TopNav/TopNav.vue.js +3 -3
  16. package/dist/components/TopNav/TopNav.vue2.js +41 -40
  17. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  18. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
  19. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  20. package/dist/layouts/App/ApiClientApp.vue.js +38 -38
  21. package/dist/layouts/App/create-api-client-app.d.ts +33 -26
  22. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  23. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  24. package/dist/layouts/Modal/ApiClientModal.vue2.js +15 -15
  25. package/dist/layouts/Modal/create-api-client-modal.d.ts +66 -52
  26. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  27. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  28. package/dist/layouts/Web/ApiClientWeb.vue.js +30 -30
  29. package/dist/layouts/Web/create-api-client-web.d.ts +33 -26
  30. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  31. package/dist/libs/create-client.d.ts +33 -26
  32. package/dist/libs/create-client.d.ts.map +1 -1
  33. package/dist/libs/event-bus.d.ts +41 -0
  34. package/dist/libs/event-bus.d.ts.map +1 -0
  35. package/dist/libs/event-bus.js +32 -0
  36. package/dist/libs/{event-busses/hot-keys-bus.d.ts → hot-keys.d.ts} +6 -7
  37. package/dist/libs/hot-keys.d.ts.map +1 -0
  38. package/dist/libs/hot-keys.js +45 -0
  39. package/dist/libs/index.d.ts +3 -1
  40. package/dist/libs/index.d.ts.map +1 -1
  41. package/dist/libs/index.js +31 -33
  42. package/dist/libs/send-request.d.ts +4 -1
  43. package/dist/libs/send-request.d.ts.map +1 -1
  44. package/dist/libs/send-request.js +103 -103
  45. package/dist/store/collections.d.ts +4 -4
  46. package/dist/store/events.d.ts +29 -0
  47. package/dist/store/events.d.ts.map +1 -0
  48. package/dist/store/events.js +31 -0
  49. package/dist/store/request-example.d.ts +2 -2
  50. package/dist/store/requests.d.ts +4 -4
  51. package/dist/store/security-schemes.d.ts +4 -4
  52. package/dist/store/servers.d.ts +4 -4
  53. package/dist/store/store.d.ts +66 -52
  54. package/dist/store/store.d.ts.map +1 -1
  55. package/dist/store/store.js +75 -73
  56. package/dist/store/tags.d.ts +4 -4
  57. package/dist/store/workspace.d.ts +4 -4
  58. package/dist/style.css +1 -1
  59. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  60. package/dist/views/Request/Request.vue.js +1 -1
  61. package/dist/views/Request/Request.vue2.js +63 -63
  62. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  63. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  64. package/dist/views/Request/RequestSidebar.vue2.js +101 -102
  65. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  66. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  67. package/dist/views/Request/RequestSidebarItem.vue2.js +76 -76
  68. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  69. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  70. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +33 -34
  71. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts +16 -0
  72. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts.map +1 -0
  73. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +31 -0
  74. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +5 -0
  75. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  76. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  77. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +30 -33
  78. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  79. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +3 -3
  80. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +17 -18
  81. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  82. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +20 -20
  83. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  84. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +68 -56
  85. package/dist/views/Request/components/WorkspaceDropdown.vue.js +29 -30
  86. package/package.json +5 -5
  87. package/dist/libs/event-busses/cancel-request-bus.d.ts +0 -2
  88. package/dist/libs/event-busses/cancel-request-bus.d.ts.map +0 -1
  89. package/dist/libs/event-busses/cancel-request-bus.js +0 -5
  90. package/dist/libs/event-busses/command-palette-bus.d.ts +0 -14
  91. package/dist/libs/event-busses/command-palette-bus.d.ts.map +0 -1
  92. package/dist/libs/event-busses/command-palette-bus.js +0 -5
  93. package/dist/libs/event-busses/execute-request-bus.d.ts +0 -2
  94. package/dist/libs/event-busses/execute-request-bus.d.ts.map +0 -1
  95. package/dist/libs/event-busses/execute-request-bus.js +0 -5
  96. package/dist/libs/event-busses/hot-keys-bus.d.ts.map +0 -1
  97. package/dist/libs/event-busses/hot-keys-bus.js +0 -47
  98. package/dist/libs/event-busses/index.d.ts +0 -6
  99. package/dist/libs/event-busses/index.d.ts.map +0 -1
  100. package/dist/libs/event-busses/index.js +0 -15
  101. package/dist/libs/event-busses/request-status-bus.d.ts +0 -5
  102. package/dist/libs/event-busses/request-status-bus.d.ts.map +0 -1
  103. 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 HotKeyEvents = Partial<Record<HotkeyEventName, KeyboardEvent>>;
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) => ("altKey" | "ctrlKey" | "shiftKey" | "metaKey")[];
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" | "-" | "ArrowLeft" | "ArrowRight" | "Delete" | "1" | "n" | "Escape" | "ArrowDown" | "ArrowUp" | "Enter" | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | "Space" | "Backspace" | "Tab" | "End" | "Home" | "PageDown" | "PageUp" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "c" | "d" | "e" | "f" | "h" | "j" | "k" | "l" | "m" | "o" | "r" | "t" | "v" | "w" | "x" | "y" | "z" | "*" | "+" | "," | "`" | "[" | "\\" | "]", {
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-bus.d.ts.map
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
+ };
@@ -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 './event-busses/index.js';
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';
@@ -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"}
@@ -1,39 +1,37 @@
1
1
  import { createApiClient as o } from "./create-client.js";
2
- import { formatBytes as m, formatMs as a } from "./formatters.js";
3
- import { ERRORS as p, normalizeError as f, prettyErrorMessage as x } from "./errors.js";
4
- import { formatHeaderKey as l, normalizeHeaders as n } from "./normalize-headers.js";
5
- import { loadAllResources as c } from "./local-storage.js";
6
- import { parseEnvVariables as R } from "./environment-parser.js";
7
- import { isUrl as E } from "./isUrl.js";
8
- import { getOpenApiDocumentDetails as q } from "./getOpenApiDocumentDetails.js";
9
- import { parseCurlCommand as D } from "./parse-curl.js";
10
- import { createRequestOperation as K } from "./send-request.js";
11
- import { commandPaletteBus as g } from "./event-busses/command-palette-bus.js";
12
- import { DEFAULT_HOTKEYS as M, getModifiers as S, handleHotKeyDown as h, hotKeyBus as z } from "./event-busses/hot-keys-bus.js";
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
- M as DEFAULT_HOTKEYS,
14
+ x as DEFAULT_HOTKEYS,
18
15
  p as ERRORS,
19
- v as cancelRequestBus,
20
- g as commandPaletteBus,
21
16
  o as createApiClient,
22
- K as createRequestOperation,
23
- U as executeRequestBus,
24
- m as formatBytes,
25
- l as formatHeaderKey,
26
- a as formatMs,
27
- S as getModifiers,
28
- q as getOpenApiDocumentDetails,
29
- h as handleHotKeyDown,
30
- z as hotKeyBus,
31
- E as isUrl,
32
- c as loadAllResources,
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
- n as normalizeHeaders,
35
- D as parseCurlCommand,
36
- R as parseEnvVariables,
37
- x as prettyErrorMessage,
38
- F as requestStatusBus
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;AAK1E,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;AAUxC,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,qGASpD;IACD,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,cAAc,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC/C,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB,KAAG,aAAa,CAAC;IAChB,UAAU,EAAE,eAAe,CAAA;IAC3B,WAAW,EAAE,MAAM,mBAAmB,CAAC,gBAAgB,CAAC,CAAA;CACzD,CA2LA,CAAA"}
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 T, normalizeError as L } from "./errors.js";
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 u } from "./string-template.js";
4
- import { isRelativePath as E, shouldUseProxy as B, canMethodHaveBody as z } from "@scalar/oas-utils/helpers";
5
- import k from "js-cookie";
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 { requestStatusBus as S } from "./event-busses/request-status-bus.js";
8
- import { textMediaTypes as q } from "../views/Request/consts/mediaTypes.js";
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 (q.includes(o.essence)) {
12
- const c = new TextDecoder(o.parameters.get("charset")).decode(r);
13
- return o.subtype === "json" ? JSON.parse(c) : c;
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 _(r, n) {
16
+ function q(r, n) {
18
17
  const o = {};
19
- return r.parameters.headers.forEach((t) => {
20
- const c = t.key.trim().toLowerCase();
21
- t.enabled && (c !== "content-type" || t.value !== "multipart/form-data") && (o[c] = u(t.value, n));
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((t) => {
27
- t.enabled && t.value && o.append(t.key, u(t.value, n));
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: t,
35
- proxy: c
33
+ domain: e,
34
+ proxy: d
36
35
  }) {
37
- let d;
36
+ let h;
38
37
  try {
39
- d = new URL(c || t).host;
38
+ h = new URL(d || e).host;
40
39
  } catch {
41
- typeof window < "u" && (d = window.location.host);
40
+ typeof window < "u" && (h = window.location.host);
42
41
  }
43
- const l = {
42
+ const i = {
44
43
  // Must point all cookies to the proxy and let it sort them out
45
- domain: d,
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
- }, f = k.get();
51
- return Object.keys(f).forEach((e) => k.remove(e)), r.parameters.cookies.forEach((e) => {
52
- e.enabled && k.set(e.key, u(e.value, n));
53
- }), o.forEach((e) => {
54
- var i;
55
- const { name: R, value: v, ...m } = e;
56
- (m.domain === t || ((i = m.domain) == null ? void 0 : i.startsWith(".")) && t.endsWith(m.domain ?? "")) && k.set(R, v, {
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: d,
57
+ domain: h,
59
58
  // TODO: path cookies probably don't worth with the proxy
60
- path: m.path,
61
- expires: m.expires ? new Date(m.expires) : void 0,
62
- httpOnly: m.httpOnly,
63
- secure: m.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: l
65
+ cookieParams: i
67
66
  };
68
67
  }
69
68
  function Q(r, n, o) {
70
- var t, c, d;
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 l = n.body.formData.encoding === "form-data" ? "multipart/form-data" : "application/x-www-form-urlencoded", f = n.body.formData.encoding === "form-data" ? new FormData() : new URLSearchParams();
75
- return n.body.formData.value.forEach((e) => {
76
- !e.enabled || !e.key || (e.file && f instanceof FormData ? f.append(e.key, e.file, e.file.name) : e.value !== void 0 && f.append(e.key, u(e.value, o)));
77
- }), { body: f, contentType: l };
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: u(((t = n.body.raw) == null ? void 0 : t.value) ?? "", o),
81
- contentType: (c = n.body.raw) == null ? void 0 : c.encoding
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: (d = n.body.binary) == null ? void 0 : d.type
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 te = ({
89
+ const x = ({
91
90
  request: r,
92
91
  auth: n,
93
92
  example: o,
94
- server: t,
95
- securitySchemes: c,
96
- proxy: d,
93
+ server: e,
94
+ securitySchemes: d,
95
+ proxy: h,
96
+ status: i,
97
97
  environment: l,
98
- globalCookies: f
98
+ globalCookies: a
99
99
  }) => {
100
100
  try {
101
- const e = l ?? {}, R = new AbortController(), v = o.parameters.path.reduce((p, a) => (a.enabled && (p[a.key] = u(a.value, e)), p), {}), m = u((t == null ? void 0 : t.url) ?? "", e), y = u(r.path, v);
102
- let i = m || y;
103
- if (!i) throw T.URL_EMPTY;
104
- const P = j(o, e), w = _(o, e), { body: C } = Q(r.method, o, e), { cookieParams: V } = N({
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: e,
107
- globalCookies: f,
108
- domain: i,
109
- proxy: d
110
- });
111
- return r.selectedSecuritySchemeUids.forEach((p) => {
112
- const a = n[p], h = c[p];
113
- if (!(!a || !h)) {
114
- if (h.type === "apiKey" && a.type === "apiKey") {
115
- const s = u(a.value, e);
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 (h.type === "http" && a.type === "http")
119
- if (h.scheme === "basic") {
120
- const s = u(a.username, e), U = u(a.password, e), D = `${s}:${U}`;
121
- w.Authorization = `Basic ${btoa(D)}`;
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 s = u(a.token, e);
124
- w.Authorization = `Bearer ${s}`;
123
+ const c = f(t.token, s);
124
+ b.Authorization = `Bearer ${c}`;
125
125
  }
126
- h.type === "oauth2" && a.type.includes("oauth") && "token" in a && (a.token || console.error("OAuth token was not created"), w.Authorization = `Bearer ${a.token}`);
126
+ 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
- S.emit("start");
133
- const p = Date.now();
132
+ i == null || i.emit("start");
133
+ const w = Date.now();
134
134
  try {
135
- if (i && (!E(i) || typeof window < "u")) {
136
- const O = E(i) ? window.location.origin + i : i, b = new URL(O), $ = new URL(y, b.origin), g = new URL(b);
137
- t != null && t.url && (b.pathname === "/" ? g.pathname = y : g.pathname = b.pathname + y), g.search = new URLSearchParams([
138
- ...b.searchParams,
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
- ...P
141
- ]).toString(), i = g.toString();
140
+ ...T
141
+ ]).toString(), m = v.toString();
142
142
  }
143
- const a = new URLSearchParams([["scalar_url", i.toString()]]), h = B(d, i) ? `${d}?${a.toString()}` : i, s = await fetch(h, {
144
- signal: R.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: w
147
+ headers: b
148
148
  });
149
- S.emit("stop");
150
- const U = M(
151
- s.headers,
152
- B(d, i)
153
- ), D = s.headers.get("content-type") ?? "text/plain;charset=UTF-8", A = K(
154
- await s.arrayBuffer(),
155
- D
156
- ), F = "getSetCookie" in s.headers && typeof s.headers.getSetCookie == "function" ? s.headers.getSetCookie() : [];
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
- ...s,
164
- headers: U,
163
+ ...c,
164
+ headers: S,
165
165
  cookieHeaderKeys: F,
166
166
  data: A,
167
- duration: Date.now() - p,
167
+ duration: Date.now() - w,
168
168
  method: r.method,
169
- status: s.status,
170
- path: y
169
+ status: c.status,
170
+ path: u
171
171
  }
172
172
  }
173
173
  ];
174
- } catch (a) {
175
- return S.emit("abort"), [L(a, T.REQUEST_FAILED), null];
174
+ } catch (t) {
175
+ return i == null || i.emit("abort"), [P(t, L.REQUEST_FAILED), null];
176
176
  }
177
177
  },
178
- controller: R
178
+ controller: g
179
179
  }
180
180
  ];
181
- } catch (e) {
182
- return S.emit("abort"), [L(e), null];
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
- _ as createFetchHeaders,
187
+ q as createFetchHeaders,
188
188
  j as createFetchQueryParams,
189
- te as createRequestOperation,
190
- K as decodeBuffer,
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" | "tags" | "requests" | "securitySchemes" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "uid" | "selectedServerUid" | "x-scalar-icon" | "auth" | `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" | `servers.${number}` | `tags.${number}` | `requests.${number}` | `securitySchemes.${number}` | `components.${string}` | `security.${number}` | `security.${number}.${string}` | "externalDocs.url" | "externalDocs.description" | `webhooks.${string}` | `auth.${string}`>(uid: string, path: P, value: P extends "type" | "children" | "info" | "servers" | "tags" | "requests" | "securitySchemes" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "uid" | "selectedServerUid" | "x-scalar-icon" | "auth" ? {
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" | "tags" | "requests" | "securitySchemes" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "uid" | "selectedServerUid" | "x-scalar-icon" | "auth" ? R extends import("@scalar/object-utils/nested").Path<{
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" | "tags" | "requests" | "securitySchemes" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "uid" | "selectedServerUid" | "x-scalar-icon" | "auth" | `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" | `servers.${number}` | `tags.${number}` | `requests.${number}` | `securitySchemes.${number}` | `components.${string}` | `security.${number}` | `security.${number}.${string}` | "externalDocs.url" | "externalDocs.description" | `webhooks.${string}` | `auth.${string}`>(uid: string, path: P, value: P extends "type" | "children" | "info" | "servers" | "tags" | "requests" | "securitySchemes" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "uid" | "selectedServerUid" | "x-scalar-icon" | "auth" ? {
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" | "tags" | "requests" | "securitySchemes" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "uid" | "selectedServerUid" | "x-scalar-icon" | "auth" ? R extends import("@scalar/object-utils/nested").Path<{
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"}