@scalar/api-client 2.0.33 → 2.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  3. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  4. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +39 -31
  5. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +65 -55
  7. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  8. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +53 -44
  9. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +42 -34
  11. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  12. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +126 -70
  13. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
  14. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +37 -29
  15. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  16. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  17. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +97 -85
  18. package/dist/components/CommandPalette/handleKeyDown.d.ts +2 -0
  19. package/dist/components/CommandPalette/handleKeyDown.d.ts.map +1 -0
  20. package/dist/components/CommandPalette/handleKeyDown.js +7 -0
  21. package/dist/components/Form/Form.vue.js +1 -1
  22. package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
  23. package/dist/components/Search/SearchButton.vue.js +14 -16
  24. package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
  25. package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
  26. package/dist/components/Sidebar/SidebarList.vue.js +1 -1
  27. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  28. package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
  29. package/dist/components/Sidebar/SidebarListElement.vue2.js +9 -9
  30. package/dist/constants.d.ts +0 -4
  31. package/dist/constants.d.ts.map +1 -1
  32. package/dist/constants.js +2 -2
  33. package/dist/libs/sendRequest.d.ts +2 -1
  34. package/dist/libs/sendRequest.d.ts.map +1 -1
  35. package/dist/libs/sendRequest.js +54 -45
  36. package/dist/style.css +1 -1
  37. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  38. package/dist/views/Request/Request.vue.js +2 -2
  39. package/dist/views/Request/Request.vue2.js +106 -107
  40. package/package.json +6 -6
@@ -0,0 +1,7 @@
1
+ import { isMacOS as t } from "@scalar/use-tooltip";
2
+ const a = (r, o) => {
3
+ e(r) && (r.stopPropagation(), r.preventDefault(), o());
4
+ }, e = (r) => t() ? r.metaKey && r.key === "Enter" : r.ctrlKey && r.key === "Enter";
5
+ export {
6
+ a as handleKeyDown
7
+ };
@@ -3,7 +3,7 @@ import y from "../DataTable/DataTable.vue.js";
3
3
  import V from "../DataTable/DataTableInput.vue.js";
4
4
  import h from "../DataTable/DataTableRow.vue.js";
5
5
  import b from "../ViewLayout/ViewLayoutSection.vue.js";
6
- const g = { class: "custom-scroll flex flex-1 flex-col gap-1.5 px-5 py-2" }, w = /* @__PURE__ */ s({
6
+ const g = { class: "custom-scroll flex flex-1 flex-col gap-1.5 px-5 py-5" }, w = /* @__PURE__ */ s({
7
7
  __name: "Form",
8
8
  props: {
9
9
  title: {},
@@ -1 +1 @@
1
- {"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Search/SearchButton.vue"],"names":[],"mappings":";;;;;AAmIA,wBAMG"}
1
+ {"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Search/SearchButton.vue"],"names":[],"mappings":";;;;;AAwHA,wBAMG"}
@@ -1,32 +1,30 @@
1
- import { defineComponent as c, openBlock as r, createElementBlock as i, createElementVNode as e, createVNode as s, unref as a } from "vue";
2
- import l from "../ScalarHotkey.vue.js";
3
- import { ScalarIcon as m } from "@scalar/components";
4
- const d = { class: "bg-b-1 sticky top-0 z-50 px-3 py-2.5 pb-0" }, p = { class: "w-[15px] flex items-center justify-center" }, f = { class: "sidebar-search-input ml-1.5 flex w-full items-center justify-between text-sm font-medium" }, _ = /* @__PURE__ */ e("span", { class: "sidebar-search-placeholder" }, "Search", -1), S = /* @__PURE__ */ c({
1
+ import { defineComponent as n, openBlock as c, createElementBlock as r, createElementVNode as e, createVNode as i, unref as a } from "vue";
2
+ import { ScalarIcon as l } from "@scalar/components";
3
+ const p = { class: "bg-b-1 sticky top-0 z-50 px-3 py-2.5 pb-0" }, d = { class: "w-[15px] flex items-center justify-center" }, m = /* @__PURE__ */ e("div", { class: "sidebar-search-input ml-1.5 flex w-full items-center justify-between text-sm font-medium" }, [
4
+ /* @__PURE__ */ e("span", { class: "sidebar-search-placeholder" }, "Search")
5
+ ], -1), b = /* @__PURE__ */ n({
5
6
  __name: "SearchButton",
6
7
  emits: ["openSearchModal"],
7
- setup(u, { emit: o }) {
8
- const n = o;
9
- return (h, t) => (r(), i("div", d, [
8
+ setup(u, { emit: s }) {
9
+ const o = s;
10
+ return (f, t) => (c(), r("div", p, [
10
11
  e("button", {
11
- class: "shadow-border text-c-2 flex w-full items-center rounded p-1.5",
12
+ class: "border-1/2 text-c-2 flex w-full items-center rounded p-1.5",
12
13
  type: "button",
13
- onClick: t[0] || (t[0] = (x) => n("openSearchModal"))
14
+ onClick: t[0] || (t[0] = (_) => o("openSearchModal"))
14
15
  }, [
15
- e("div", p, [
16
- s(a(m), {
16
+ e("div", d, [
17
+ i(a(l), {
17
18
  icon: "Search",
18
19
  size: "xs",
19
20
  thickness: "2.5"
20
21
  })
21
22
  ]),
22
- e("div", f, [
23
- _,
24
- s(l, { hotkey: "k" })
25
- ])
23
+ m
26
24
  ])
27
25
  ]));
28
26
  }
29
27
  });
30
28
  export {
31
- S as default
29
+ b as default
32
30
  };
@@ -21,7 +21,7 @@ const f = { class: "fixed relative bottom-[50px] z-10 flex p-2" }, k = /* @__PUR
21
21
  p(c.$slots, "title"),
22
22
  e(u, {
23
23
  class: "absolute right-2 group-hover:opacity-80 text-c-2",
24
- hotkey: "N",
24
+ hotkey: "K",
25
25
  onHotkeyPressed: t
26
26
  })
27
27
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarList.vue"],"names":[],"mappings":"AAcA,iBAAS,cAAc;qBAqBM,GAAG;EAa/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SidebarList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarList.vue"],"names":[],"mappings":"AAcA,iBAAS,cAAc;qBAoBM,GAAG;EAa/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { openBlock as o, createElementBlock as t, renderSlot as r } from "vue";
2
2
  import c from "../../_virtual/_plugin-vue_export-helper.js";
3
- const s = {}, l = { class: "flex flex-col gap-1 p-2" };
3
+ const s = {}, l = { class: "flex flex-col p-2" };
4
4
  function n(e, f) {
5
5
  return o(), t("ul", l, [
6
6
  r(e.$slots, "default")
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarListElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarListElement.vue"],"names":[],"mappings":";cAmEY;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB;;;;cALS;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB;;;;AAkJH,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"SidebarListElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarListElement.vue"],"names":[],"mappings":";cAmEY;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB;;;;cALS;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB;;;;AAmJH,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import t from "./SidebarListElement.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-f43d5cfd"]]);
4
+ const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-1d9aeaf7"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as c, resolveComponent as b, openBlock as t, createElementBlock as l, createVNode as a, normalizeClass as r, withModifiers as v, withCtx as f, createElementVNode as k, createCommentVNode as h, createTextVNode as g, toDisplayString as C } from "vue";
1
+ import { defineComponent as c, resolveComponent as b, openBlock as t, createElementBlock as l, createVNode as r, normalizeClass as a, withModifiers as v, withCtx as f, createElementVNode as k, createCommentVNode as h, createTextVNode as g, toDisplayString as C } from "vue";
2
2
  import _ from "./SidebarListElementActions.vue.js";
3
3
  import { useRouter as w } from "vue-router";
4
4
  const y = {
@@ -14,28 +14,28 @@ const y = {
14
14
  setup(D, { emit: n }) {
15
15
  const i = n, s = w(), m = (e, o) => {
16
16
  e.metaKey ? window.open(o, "_blank") : s.push(o);
17
- }, p = (e) => {
17
+ }, u = (e) => {
18
18
  i("delete", e);
19
19
  };
20
20
  return (e, o) => {
21
- const u = b("router-link");
21
+ const d = b("router-link");
22
22
  return t(), l("li", null, [
23
- a(u, {
24
- class: r(["text-c-2 hover:bg-b-2 group relative block flex items-center gap-1 rounded py-1 pr-2 font-medium", [e.variable.color ? "pl-1" : "pl-2"]]),
23
+ r(d, {
24
+ class: a(["text-c-2 hover:bg-b-2 group relative block flex items-center gap-1 rounded py-1 pr-2 font-medium no-underline", [e.variable.color ? "pl-1" : "pl-2"]]),
25
25
  exactActiveClass: "active-link",
26
26
  to: `${e.variable.uid}`,
27
- onClick: o[0] || (o[0] = v((d) => m(d, e.variable.uid), ["prevent"]))
27
+ onClick: o[0] || (o[0] = v((p) => m(p, e.variable.uid), ["prevent"]))
28
28
  }, {
29
29
  default: f(() => [
30
30
  e.variable.color ? (t(), l("button", y, [
31
31
  k("div", {
32
- class: r(["h-2.5 w-2.5 rounded-xl", `bg-${e.variable.color}`])
32
+ class: a(["h-2.5 w-2.5 rounded-xl", `bg-${e.variable.color}`])
33
33
  }, null, 2)
34
34
  ])) : h("", !0),
35
35
  g(" " + C(e.variable.name) + " ", 1),
36
- a(_, {
36
+ r(_, {
37
37
  variable: { ...e.variable, isDefault: e.variable.isDefault ?? !1 },
38
- onDelete: p
38
+ onDelete: u
39
39
  }, null, 8, ["variable"])
40
40
  ]),
41
41
  _: 1
@@ -10,9 +10,5 @@ export declare const ROUTES: readonly [{
10
10
  readonly prettyName: "Env Vars";
11
11
  readonly name: "environment";
12
12
  readonly icon: "Brackets";
13
- }, {
14
- readonly prettyName: "Servers";
15
- readonly name: "servers";
16
- readonly icon: "Server";
17
13
  }];
18
14
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;EAMT,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;EAMT,CAAA"}
package/dist/constants.js CHANGED
@@ -1,8 +1,8 @@
1
1
  const e = [
2
2
  { prettyName: "Request", name: "request", icon: "ExternalLink" },
3
3
  { prettyName: "Cookies", name: "cookies", icon: "Cookie" },
4
- { prettyName: "Env Vars", name: "environment", icon: "Brackets" },
5
- { prettyName: "Servers", name: "servers", icon: "Server" }
4
+ { prettyName: "Env Vars", name: "environment", icon: "Brackets" }
5
+ // { prettyName: 'Servers', name: 'servers', icon: 'Server' },
6
6
  // { label: 'Git Sync', icon: 'Branch', path: '/git-sync' },
7
7
  ];
8
8
  export {
@@ -1,3 +1,4 @@
1
+ import type { Cookie } from '@scalar/oas-utils/entities/workspace/cookie';
1
2
  import type { SecurityScheme, SelectedSchemeOauth2 } from '@scalar/oas-utils/entities/workspace/security';
2
3
  import type { Request, RequestExample, ResponseInstance } from '@scalar/oas-utils/entities/workspace/spec';
3
4
  /**
@@ -7,7 +8,7 @@ import type { Request, RequestExample, ResponseInstance } from '@scalar/oas-util
7
8
  export declare const sendRequest: (request: Request, example: RequestExample, rawUrl: string, securityScheme?: {
8
9
  scheme: SecurityScheme;
9
10
  flow?: SelectedSchemeOauth2["flow"];
10
- }, proxyUrl?: string) => Promise<{
11
+ }, proxyUrl?: string, workspaceCookies?: Record<string, Cookie>) => Promise<{
11
12
  sentTime?: number;
12
13
  request?: RequestExample;
13
14
  response?: ResponseInstance;
@@ -1 +1 @@
1
- {"version":3,"file":"sendRequest.d.ts","sourceRoot":"","sources":["../../src/libs/sendRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACrB,MAAM,+CAA+C,CAAA;AACtD,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EAEd,gBAAgB,EACjB,MAAM,2CAA2C,CAAA;AAkBlD;;;GAGG;AACH,eAAO,MAAM,WAAW,YACb,OAAO,WACP,cAAc,UACf,MAAM,mBACG;IACf,MAAM,EAAE,cAAc,CAAA;IACtB,IAAI,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAA;CACpC,aACU,MAAM,KAChB,OAAO,CAAC;IACT,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,QAAQ,CAAC,EAAE,gBAAgB,CAAA;CAC5B,CA2LA,CAAA"}
1
+ {"version":3,"file":"sendRequest.d.ts","sourceRoot":"","sources":["../../src/libs/sendRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACrB,MAAM,+CAA+C,CAAA;AACtD,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EAEd,gBAAgB,EACjB,MAAM,2CAA2C,CAAA;AAsBlD;;;GAGG;AACH,eAAO,MAAM,WAAW,YACb,OAAO,WACP,cAAc,UACf,MAAM,mBACG;IACf,MAAM,EAAE,cAAc,CAAA;IACtB,IAAI,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAA;CACpC,aACU,MAAM,qBACE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KACxC,OAAO,CAAC;IACT,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,QAAQ,CAAC,EAAE,gBAAgB,CAAA;CAC5B,CA0MA,CAAA"}
@@ -1,36 +1,37 @@
1
- import { redirectToProxy as A, shouldUseProxy as C } from "@scalar/oas-utils/helpers";
2
- import E from "axios";
3
- import R from "js-cookie";
4
- const u = (c = []) => c.reduce(
5
- (o, i) => (i.key && (o[i.key] = i.value), o),
1
+ import { isValidUrl as R, redirectToProxy as A, shouldUseProxy as E } from "@scalar/oas-utils/helpers";
2
+ import $ from "axios";
3
+ import p from "js-cookie";
4
+ const u = (l = []) => l.reduce(
5
+ (o, a) => (a.key && (o[a.key] = a.value), o),
6
6
  {}
7
- ), g = async (c, o, i, s, y) => {
8
- var k;
9
- let a = i;
7
+ ), O = async (l, o, a, s, y, f) => {
8
+ var g;
9
+ let i = a;
10
10
  o.parameters.path.forEach((e) => {
11
- !e.key || !e.value || (a = a.replace(`{${e.key}}`, e.value));
11
+ !e.key || !e.value || (i = i.replace(`{${e.key}}`, e.value));
12
12
  });
13
- const r = u(
13
+ const n = u(
14
14
  o.parameters.headers.filter(({ enabled: e }) => e)
15
15
  );
16
- let d = null;
16
+ let c = null;
17
17
  if (o.body.activeBody === "binary" && o.body.binary)
18
- r["Content-Type"] = o.body.binary.type, r["Content-Disposition"] = `attachment; filename="${o.body.binary.name}"`, d = o.body.binary;
18
+ n["Content-Type"] = o.body.binary.type, n["Content-Disposition"] = `attachment; filename="${o.body.binary.name}"`, c = o.body.binary;
19
19
  else if (o.body.activeBody === "raw" && o.body.raw.value)
20
- d = o.body.raw.value;
20
+ c = o.body.raw.value;
21
21
  else if (o.body.activeBody === "formData") {
22
- r["Content-Type"] = "multipart/form-data";
22
+ n["Content-Type"] = "multipart/form-data";
23
23
  const e = new FormData();
24
24
  o.body.formData.encoding === "form-data" && (o.body.formData.value.forEach(
25
- (t) => {
26
- t.key && t.value ? e.append(t.key, t.value) : t.file && e.append(t.file.name, t.file);
25
+ (r) => {
26
+ const t = r.file ? r.file : r.value;
27
+ r.key && t && e.append(r.key, t);
27
28
  }
28
- ), d = e);
29
+ ), c = e);
29
30
  }
30
- const f = [], [p, D] = a.split("?");
31
- new URLSearchParams(D ?? "").forEach((e, t) => {
32
- f.push({
33
- key: t,
31
+ const h = [], [m, D] = i.split("?");
32
+ new URLSearchParams(D ?? "").forEach((e, r) => {
33
+ h.push({
34
+ key: r,
34
35
  value: e,
35
36
  enabled: !0
36
37
  });
@@ -39,72 +40,80 @@ const u = (c = []) => c.reduce(
39
40
  ...u(
40
41
  o.parameters.query.filter(({ enabled: e }) => e).filter(({ value: e }) => e !== "")
41
42
  ),
42
- ...u(f)
43
- }, l = {
43
+ ...u(h)
44
+ }, d = {
44
45
  ...u(
45
46
  (o.parameters.cookies ?? []).filter(({ enabled: e }) => e)
46
47
  )
47
48
  };
49
+ if (f) {
50
+ const e = new URL(a).host;
51
+ Object.keys(f).forEach((r) => {
52
+ const t = f[r];
53
+ if (!t.domain) return;
54
+ (R(t.domain) ? new URL(t.domain).origin : t.domain) === e && (d[t.name] = t.domain);
55
+ });
56
+ }
48
57
  if (s != null && s.scheme) {
49
58
  const { scheme: e } = s;
50
59
  if (e.type === "apiKey" && e.value)
51
60
  switch (e.in) {
52
61
  case "cookie":
53
- l[e.name] = e.value;
62
+ d[e.name] = e.value;
54
63
  break;
55
64
  case "query":
56
65
  b[e.name] = e.value;
57
66
  break;
58
67
  case "header":
59
- r[e.name] = e.value;
68
+ n[e.name] = e.value;
60
69
  break;
61
70
  }
62
- else e.type === "http" && e.value ? e.scheme === "basic" && e.secondValue ? r.Authorization = `Basic ${btoa(`${e.value}:${e.secondValue}`)}` : r.Authorization = `Bearer ${e.value}` : e.type === "oauth2" && ((k = s.flow) != null && k.token) && (r.Authorization = `Bearer ${s.flow.token}`);
71
+ else e.type === "http" && e.value ? e.scheme === "basic" && e.secondValue ? n.Authorization = `Basic ${btoa(`${e.value}:${e.secondValue}`)}` : n.Authorization = `Bearer ${e.value}` : e.type === "oauth2" && ((g = s.flow) != null && g.token) && (n.Authorization = `Bearer ${s.flow.token}`);
63
72
  }
64
- Object.keys(l).forEach((e) => {
65
- R.set(e, l[e], {
73
+ Object.keys(d).forEach((e) => {
74
+ p.set(e, d[e], {
66
75
  // Means that the browser sends the cookie with both cross-site and same-site requests.
67
76
  sameSite: "None",
68
77
  // The Secure attribute must also be set when setting SameSite=None.
69
78
  secure: !0
70
79
  });
71
80
  });
72
- const h = new URLSearchParams(b).toString();
73
- a = `${p}${h ? "?" + h : ""}`;
74
- const v = {
75
- url: A(y, a),
76
- method: c.method,
77
- headers: r
81
+ const v = new URLSearchParams(b).toString();
82
+ i = `${m}${v ? "?" + v : ""}`;
83
+ const w = {
84
+ url: A(y, i),
85
+ method: l.method,
86
+ headers: n
78
87
  };
79
- d && (v.data = d);
80
- const w = Date.now();
88
+ c && (w.data = c);
89
+ const k = Date.now();
81
90
  try {
82
- const e = await E(v);
83
- return C(y, a) && [
91
+ const e = await $(w);
92
+ return E(y, i) && [
84
93
  "Access-Control-Allow-Headers",
85
94
  "Access-Control-Allow-Origin",
86
95
  "Access-Control-Allow-Methods",
87
96
  "Access-Control-Expose-Headers"
88
- ].map((n) => n.toLowerCase()).forEach((n) => delete e.headers[n]), {
97
+ ].map((t) => t.toLowerCase()).forEach((t) => delete e.headers[t]), {
89
98
  sentTime: Date.now(),
90
99
  request: o,
91
100
  response: {
92
101
  ...e,
93
- duration: Date.now() - w
102
+ duration: Date.now() - k
94
103
  }
95
104
  };
96
105
  } catch (e) {
97
- const n = e.response;
106
+ const t = e.response;
98
107
  return console.error("ERROR", e), {
99
108
  sentTime: Date.now(),
100
109
  request: o,
101
- response: n ? {
102
- ...n,
103
- duration: Date.now() - w
110
+ response: t ? {
111
+ ...t,
112
+ duration: Date.now() - k
104
113
  } : void 0
105
114
  };
106
115
  }
107
116
  };
108
117
  export {
109
- g as sendRequest
118
+ O as sendRequest
110
119
  };