@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.
- package/CHANGELOG.md +17 -0
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +39 -31
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +65 -55
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +53 -44
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +42 -34
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +126 -70
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +37 -29
- 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 +97 -85
- package/dist/components/CommandPalette/handleKeyDown.d.ts +2 -0
- package/dist/components/CommandPalette/handleKeyDown.d.ts.map +1 -0
- package/dist/components/CommandPalette/handleKeyDown.js +7 -0
- package/dist/components/Form/Form.vue.js +1 -1
- package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/components/Search/SearchButton.vue.js +14 -16
- package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
- package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarList.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue2.js +9 -9
- package/dist/constants.d.ts +0 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -2
- package/dist/libs/sendRequest.d.ts +2 -1
- package/dist/libs/sendRequest.d.ts.map +1 -1
- package/dist/libs/sendRequest.js +54 -45
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/Request.vue2.js +106 -107
- package/package.json +6 -6
|
@@ -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-
|
|
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":";;;;;
|
|
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
|
|
2
|
-
import l from "
|
|
3
|
-
|
|
4
|
-
|
|
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:
|
|
8
|
-
const
|
|
9
|
-
return (
|
|
8
|
+
setup(u, { emit: s }) {
|
|
9
|
+
const o = s;
|
|
10
|
+
return (f, t) => (c(), r("div", p, [
|
|
10
11
|
e("button", {
|
|
11
|
-
class: "
|
|
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] = (
|
|
14
|
+
onClick: t[0] || (t[0] = (_) => o("openSearchModal"))
|
|
14
15
|
}, [
|
|
15
|
-
e("div",
|
|
16
|
-
|
|
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
|
-
|
|
23
|
-
_,
|
|
24
|
-
s(l, { hotkey: "k" })
|
|
25
|
-
])
|
|
23
|
+
m
|
|
26
24
|
])
|
|
27
25
|
]));
|
|
28
26
|
}
|
|
29
27
|
});
|
|
30
28
|
export {
|
|
31
|
-
|
|
29
|
+
b as default
|
|
32
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarList.vue"],"names":[],"mappings":"AAcA,iBAAS,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
|
|
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;;;;
|
|
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-
|
|
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
|
|
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
|
-
},
|
|
17
|
+
}, u = (e) => {
|
|
18
18
|
i("delete", e);
|
|
19
19
|
};
|
|
20
20
|
return (e, o) => {
|
|
21
|
-
const
|
|
21
|
+
const d = b("router-link");
|
|
22
22
|
return t(), l("li", null, [
|
|
23
|
-
|
|
24
|
-
class:
|
|
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((
|
|
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:
|
|
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
|
-
|
|
36
|
+
r(_, {
|
|
37
37
|
variable: { ...e.variable, isDefault: e.variable.isDefault ?? !1 },
|
|
38
|
-
onDelete:
|
|
38
|
+
onDelete: u
|
|
39
39
|
}, null, 8, ["variable"])
|
|
40
40
|
]),
|
|
41
41
|
_: 1
|
package/dist/constants.d.ts
CHANGED
|
@@ -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
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM
|
|
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:
|
|
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;
|
|
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"}
|
package/dist/libs/sendRequest.js
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { redirectToProxy as A, shouldUseProxy as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const u = (
|
|
5
|
-
(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
|
-
),
|
|
8
|
-
var
|
|
9
|
-
let
|
|
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 || (
|
|
11
|
+
!e.key || !e.value || (i = i.replace(`{${e.key}}`, e.value));
|
|
12
12
|
});
|
|
13
|
-
const
|
|
13
|
+
const n = u(
|
|
14
14
|
o.parameters.headers.filter(({ enabled: e }) => e)
|
|
15
15
|
);
|
|
16
|
-
let
|
|
16
|
+
let c = null;
|
|
17
17
|
if (o.body.activeBody === "binary" && o.body.binary)
|
|
18
|
-
|
|
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
|
-
|
|
20
|
+
c = o.body.raw.value;
|
|
21
21
|
else if (o.body.activeBody === "formData") {
|
|
22
|
-
|
|
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
|
-
(
|
|
26
|
-
t
|
|
25
|
+
(r) => {
|
|
26
|
+
const t = r.file ? r.file : r.value;
|
|
27
|
+
r.key && t && e.append(r.key, t);
|
|
27
28
|
}
|
|
28
|
-
),
|
|
29
|
+
), c = e);
|
|
29
30
|
}
|
|
30
|
-
const
|
|
31
|
-
new URLSearchParams(D ?? "").forEach((e,
|
|
32
|
-
|
|
33
|
-
key:
|
|
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(
|
|
43
|
-
},
|
|
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
|
-
|
|
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
|
-
|
|
68
|
+
n[e.name] = e.value;
|
|
60
69
|
break;
|
|
61
70
|
}
|
|
62
|
-
else e.type === "http" && e.value ? e.scheme === "basic" && e.secondValue ?
|
|
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(
|
|
65
|
-
|
|
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
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
url: A(y,
|
|
76
|
-
method:
|
|
77
|
-
headers:
|
|
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
|
-
|
|
80
|
-
const
|
|
88
|
+
c && (w.data = c);
|
|
89
|
+
const k = Date.now();
|
|
81
90
|
try {
|
|
82
|
-
const e = await
|
|
83
|
-
return
|
|
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((
|
|
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() -
|
|
102
|
+
duration: Date.now() - k
|
|
94
103
|
}
|
|
95
104
|
};
|
|
96
105
|
} catch (e) {
|
|
97
|
-
const
|
|
106
|
+
const t = e.response;
|
|
98
107
|
return console.error("ERROR", e), {
|
|
99
108
|
sentTime: Date.now(),
|
|
100
109
|
request: o,
|
|
101
|
-
response:
|
|
102
|
-
...
|
|
103
|
-
duration: Date.now() -
|
|
110
|
+
response: t ? {
|
|
111
|
+
...t,
|
|
112
|
+
duration: Date.now() - k
|
|
104
113
|
} : void 0
|
|
105
114
|
};
|
|
106
115
|
}
|
|
107
116
|
};
|
|
108
117
|
export {
|
|
109
|
-
|
|
118
|
+
O as sendRequest
|
|
110
119
|
};
|