@scalar/api-client 2.0.0 → 2.0.2
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 +22 -0
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/App.vue.js +25 -736
- package/dist/Modal/ApiClientModal.vue.d.ts +1 -1
- package/dist/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/Modal/ApiClientModal.vue.js +6 -22
- package/dist/Modal/ApiClientModal.vue2.js +32 -0
- package/dist/Modal/api-client-modal.d.ts +3 -1
- package/dist/Modal/api-client-modal.d.ts.map +1 -1
- package/dist/Modal/api-client-modal.js +63 -45
- package/dist/Modal/index.js +4 -4
- package/dist/index.js +11 -12
- package/dist/libs/sendRequest.js +19 -19
- 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 +67 -67
- package/package.json +6 -6
- package/dist/Modal/ApiClientModal.vue3.js +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { useModal } from '@scalar/components';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
3
3
|
/** Controls opening and closing the modal */
|
|
4
4
|
modalState: ReturnType<typeof useModal>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../src/Modal/ApiClientModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../src/Modal/ApiClientModal.vue"],"names":[],"mappings":"AAyKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;;IAOhD,6CAA6C;gBACjC,UAAU,CAAC,OAAO,QAAQ,CAAC;;IADvC,6CAA6C;gBACjC,UAAU,CAAC,OAAO,QAAQ,CAAC;;AAqGzC,wBAMG;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,24 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
props: {
|
|
7
|
-
modalState: {}
|
|
8
|
-
},
|
|
9
|
-
setup(u) {
|
|
10
|
-
return a(() => d()), (t, m) => (r(), l(e(f), {
|
|
11
|
-
bodyClass: "h-full",
|
|
12
|
-
size: "full",
|
|
13
|
-
state: t.modalState
|
|
14
|
-
}, {
|
|
15
|
-
default: s(() => [
|
|
16
|
-
n(e(p), { key: "$route.fullPath" })
|
|
17
|
-
]),
|
|
18
|
-
_: 1
|
|
19
|
-
}, 8, ["state"]));
|
|
20
|
-
}
|
|
21
|
-
});
|
|
1
|
+
import o from "./ApiClientModal.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d109beff"]]);
|
|
22
6
|
export {
|
|
23
|
-
|
|
7
|
+
m as default
|
|
24
8
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineComponent as l, watch as r, onBeforeUnmount as s, withDirectives as c, openBlock as m, createElementBlock as d, createElementVNode as t, createVNode as i, unref as p, vShow as u } from "vue";
|
|
2
|
+
import { RouterView as f } from "vue-router";
|
|
3
|
+
const v = { class: "scalar" }, h = { className: "scalar-container" }, _ = { className: "scalar-app scalar-client" }, S = /* @__PURE__ */ l({
|
|
4
|
+
__name: "ApiClientModal",
|
|
5
|
+
props: {
|
|
6
|
+
modalState: {}
|
|
7
|
+
},
|
|
8
|
+
setup(n) {
|
|
9
|
+
const a = n;
|
|
10
|
+
return r(
|
|
11
|
+
() => a.modalState.open,
|
|
12
|
+
(e) => {
|
|
13
|
+
e ? document.documentElement.style.overflow = "hidden" : document.documentElement.style.removeProperty("overflow");
|
|
14
|
+
}
|
|
15
|
+
), s(() => document.documentElement.style.removeProperty("overflow")), (e, o) => c((m(), d("div", v, [
|
|
16
|
+
t("div", h, [
|
|
17
|
+
t("div", _, [
|
|
18
|
+
i(p(f), { key: "$route.fullPath" })
|
|
19
|
+
]),
|
|
20
|
+
t("div", {
|
|
21
|
+
class: "scalar-app-exit",
|
|
22
|
+
onClick: o[0] || (o[0] = (w) => e.modalState.hide())
|
|
23
|
+
})
|
|
24
|
+
])
|
|
25
|
+
], 512)), [
|
|
26
|
+
[u, e.modalState.open]
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
S as default
|
|
32
|
+
};
|
|
@@ -20,6 +20,8 @@ export type OpenClientPayload = {
|
|
|
20
20
|
};
|
|
21
21
|
/** Initialize Scalar API Client Modal */
|
|
22
22
|
export declare const createScalarApiClient: (el: HTMLElement | null, initialConfig: ClientConfiguration, mountOnInitialize?: boolean) => Promise<{
|
|
23
|
+
/** The vue app instance for the modal, be careful with this */
|
|
24
|
+
app: import("vue").App<Element>;
|
|
23
25
|
/** Update the API client config */
|
|
24
26
|
updateConfig(newConfig: ClientConfiguration, mergeConfigs?: boolean): void;
|
|
25
27
|
/**
|
|
@@ -33,7 +35,7 @@ export declare const createScalarApiClient: (el: HTMLElement | null, initialConf
|
|
|
33
35
|
*/
|
|
34
36
|
updateAuth: (auth: AuthenticationState) => void;
|
|
35
37
|
/** Update the spec file, this will re-parse it and clear your store */
|
|
36
|
-
updateSpec: (spec: SpecConfiguration) =>
|
|
38
|
+
updateSpec: (spec: SpecConfiguration) => void;
|
|
37
39
|
/** Open the API client modal */
|
|
38
40
|
open: (payload?: OpenClientPayload) => void;
|
|
39
41
|
/** Mount the references to a given element */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client-modal.d.ts","sourceRoot":"","sources":["../../src/Modal/api-client-modal.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"api-client-modal.d.ts","sourceRoot":"","sources":["../../src/Modal/api-client-modal.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAG/E,OAAO,EAAE,KAAK,aAAa,EAAe,MAAM,2BAA2B,CAAA;AAQ3E,sDAAsD;AACtD,MAAM,MAAM,mBAAmB,GAAG;IAChC,yCAAyC;IACzC,IAAI,EAAE,iBAAiB,CAAA;IACvB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,4DAA4D;IAE5D,mFAAmF;IACnF,YAAY,CAAC,EACT,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAA;CACR,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAAA;AAEvE,yCAAyC;AACzC,eAAO,MAAM,qBAAqB,OAE5B,WAAW,GAAG,IAAI,iBAEP,mBAAmB;IA+DhC,+DAA+D;;IAE/D,mCAAmC;4BACX,mBAAmB;IAQ3C;;;OAGG;iCAC0B,MAAM;IAMnC;;;OAGG;uBACgB,mBAAmB;IAyEtC,uEAAuE;uBACpD,iBAAiB;IAapC,iCAAiC;qBAChB,iBAAiB;IAalC,8CAA8C;;;;;;;EAIjD,CAAA"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { clientRouter as
|
|
2
|
-
import { useWorkspace as
|
|
3
|
-
import { objectMerge as
|
|
4
|
-
import { getNestedValue as
|
|
5
|
-
import { toRaw as
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
importSpecFile:
|
|
13
|
-
importSpecFromUrl:
|
|
14
|
-
modalState:
|
|
15
|
-
requests:
|
|
16
|
-
securitySchemeMutators:
|
|
17
|
-
securitySchemes:
|
|
18
|
-
serverMutators:
|
|
19
|
-
workspaceMutators:
|
|
20
|
-
} =
|
|
21
|
-
(
|
|
1
|
+
import { clientRouter as b } from "../router.js";
|
|
2
|
+
import { useWorkspace as O } from "../store/workspace.js";
|
|
3
|
+
import { objectMerge as R } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { getNestedValue as j } from "@scalar/object-utils/nested";
|
|
5
|
+
import { toRaw as i, createApp as C } from "vue";
|
|
6
|
+
import q from "./ApiClientModal.vue.js";
|
|
7
|
+
const N = async (k, v, I = !0) => {
|
|
8
|
+
var h, S, w;
|
|
9
|
+
const o = i(v), {
|
|
10
|
+
activeCollection: u,
|
|
11
|
+
collectionMutators: g,
|
|
12
|
+
importSpecFile: a,
|
|
13
|
+
importSpecFromUrl: m,
|
|
14
|
+
modalState: n,
|
|
15
|
+
requests: U,
|
|
16
|
+
securitySchemeMutators: M,
|
|
17
|
+
securitySchemes: P,
|
|
18
|
+
serverMutators: x,
|
|
19
|
+
workspaceMutators: p
|
|
20
|
+
} = O();
|
|
21
|
+
(h = o.spec) != null && h.url ? m(i(o.spec.url), i(o.proxyUrl)) : (S = o.spec) != null && S.content ? a(i((w = o.spec) == null ? void 0 : w.content)) : console.error(
|
|
22
22
|
"[@scalar/api-client-modal] Could not create the API client.",
|
|
23
23
|
"Please provide an OpenAPI document: { spec: { url: '…' } }",
|
|
24
24
|
"Read more: https://github.com/scalar/scalar/tree/main/packages/api-client-modal"
|
|
25
25
|
);
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
const
|
|
26
|
+
const d = C(q, { config: i(o), modalState: n });
|
|
27
|
+
d.use(b);
|
|
28
|
+
const f = (e = k) => {
|
|
29
29
|
if (!e) {
|
|
30
30
|
console.error(
|
|
31
31
|
"[@scalar/api-client-modal] Could not create the API client.",
|
|
@@ -34,21 +34,23 @@ const _ = async (b, k, A = !0) => {
|
|
|
34
34
|
);
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
d.mount(e);
|
|
38
38
|
};
|
|
39
|
-
return
|
|
39
|
+
return I && f(), p.edit("isReadOnly", !0), o.proxyUrl && p.edit("proxyUrl", o.proxyUrl), o.themeId && p.edit("themeId", o.themeId), {
|
|
40
|
+
/** The vue app instance for the modal, be careful with this */
|
|
41
|
+
app: d,
|
|
40
42
|
/** Update the API client config */
|
|
41
|
-
updateConfig(e,
|
|
42
|
-
|
|
43
|
+
updateConfig(e, s = !0) {
|
|
44
|
+
s ? Object.assign(o, e) : R(o, e), e.spec && a(e.spec);
|
|
43
45
|
},
|
|
44
46
|
/**
|
|
45
47
|
* TODO this is just temporary for the modal, we'll put in a proper solution later
|
|
46
48
|
* Here we update the currently selected serverUrl
|
|
47
49
|
*/
|
|
48
50
|
updateServerUrl: (e) => {
|
|
49
|
-
var
|
|
50
|
-
return
|
|
51
|
-
((
|
|
51
|
+
var s;
|
|
52
|
+
return x.edit(
|
|
53
|
+
((s = u.value) == null ? void 0 : s.selectedServerUid) ?? "",
|
|
52
54
|
"url",
|
|
53
55
|
e
|
|
54
56
|
);
|
|
@@ -58,41 +60,57 @@ const _ = async (b, k, A = !0) => {
|
|
|
58
60
|
* maps the references useAuthenticationStore to the client auth
|
|
59
61
|
*/
|
|
60
62
|
updateAuth: (e) => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
var c, l;
|
|
64
|
+
if (Object.values(P).forEach((r) => {
|
|
65
|
+
const t = (y, A = "value") => y.length && !j(r, A).length && M.edit(r.uid, A, y);
|
|
66
|
+
switch (r.type) {
|
|
64
67
|
case "apiKey":
|
|
65
68
|
t(e.apiKey.token);
|
|
66
69
|
break;
|
|
67
70
|
case "http":
|
|
68
|
-
|
|
71
|
+
r.scheme === "bearer" ? t(e.http.bearer.token) : r.scheme === "basic" && (t(e.http.basic.username), t(e.http.basic.password, "secondValue"));
|
|
69
72
|
break;
|
|
70
73
|
case "oauth2":
|
|
71
|
-
t(e.oAuth2.clientId, "clientId"),
|
|
74
|
+
t(e.oAuth2.clientId, "clientId"), r.flows.implicit ? (t(e.oAuth2.accessToken, "flows.implicit.token"), t(e.oAuth2.scopes, "flows.implicit.selectedScopes")) : r.flows.password && (t(e.oAuth2.accessToken, "flows.password.token"), t(e.oAuth2.scopes, "flows.password.selectedScopes"), t(e.oAuth2.username, "flows.password.value"), t(e.oAuth2.password, "flows.password.secondValue"));
|
|
72
75
|
break;
|
|
73
76
|
}
|
|
74
|
-
})
|
|
77
|
+
}), e.preferredSecurityScheme) {
|
|
78
|
+
const r = {
|
|
79
|
+
uid: e.preferredSecurityScheme
|
|
80
|
+
}, t = (c = e.securitySchemes) == null ? void 0 : c[e.preferredSecurityScheme ?? ""];
|
|
81
|
+
(t == null ? void 0 : t.type) === "oauth2" && (r.flowKey = (l = t.flows) != null && l.implicit ? "implicit" : "password"), g.edit(
|
|
82
|
+
u.value.uid,
|
|
83
|
+
"selectedSecuritySchemes",
|
|
84
|
+
[r]
|
|
85
|
+
);
|
|
86
|
+
}
|
|
75
87
|
},
|
|
76
88
|
/** Update the spec file, this will re-parse it and clear your store */
|
|
77
|
-
updateSpec: (e) =>
|
|
89
|
+
updateSpec: (e) => {
|
|
90
|
+
e != null && e.url ? m(i(e.url), i(o.proxyUrl)) : e != null && e.content ? a(i(e == null ? void 0 : e.content)) : console.error(
|
|
91
|
+
"[@scalar/api-client-modal] Could not create the API client.",
|
|
92
|
+
"Please provide an OpenAPI document: { spec: { url: '…' } }",
|
|
93
|
+
"Read more: https://github.com/scalar/scalar/tree/main/packages/api-client-modal"
|
|
94
|
+
);
|
|
95
|
+
},
|
|
78
96
|
/** Open the API client modal */
|
|
79
97
|
open: (e) => {
|
|
80
|
-
const
|
|
81
|
-
({ path:
|
|
98
|
+
const s = Object.values(U).find(
|
|
99
|
+
({ path: c, method: l }) => e ? (
|
|
82
100
|
// The given operation
|
|
83
|
-
|
|
101
|
+
c === e.path && l === e.method
|
|
84
102
|
) : (
|
|
85
103
|
// Or the first request
|
|
86
104
|
!0
|
|
87
105
|
)
|
|
88
106
|
);
|
|
89
|
-
|
|
107
|
+
s && b.push(`/request/${s.uid}`), n.open = !0;
|
|
90
108
|
},
|
|
91
109
|
/** Mount the references to a given element */
|
|
92
|
-
mount:
|
|
93
|
-
modalState:
|
|
110
|
+
mount: f,
|
|
111
|
+
modalState: n
|
|
94
112
|
};
|
|
95
113
|
};
|
|
96
114
|
export {
|
|
97
|
-
|
|
115
|
+
N as createScalarApiClient
|
|
98
116
|
};
|
package/dist/Modal/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { default as r } from "./ApiClientModal.vue.js";
|
|
2
|
+
import { createScalarApiClient as l } from "./api-client-modal.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
r as ApiClientModal,
|
|
5
|
+
l as createScalarApiClient
|
|
6
6
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as o } from "./App.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { useWorkspace as
|
|
4
|
-
import { clientRouter as
|
|
5
|
-
import { default as
|
|
6
|
-
|
|
7
|
-
import { createScalarApiClient as u } from "./Modal/api-client-modal.js";
|
|
3
|
+
import { useWorkspace as l } from "./store/workspace.js";
|
|
4
|
+
import { clientRouter as i, clientRoutes as f } from "./router.js";
|
|
5
|
+
import { default as m } from "./Modal/ApiClientModal.vue.js";
|
|
6
|
+
import { createScalarApiClient as s } from "./Modal/api-client-modal.js";
|
|
8
7
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
m as ApiClientModal,
|
|
9
|
+
o as ScalarClient,
|
|
10
|
+
i as clientRouter,
|
|
11
|
+
f as clientRoutes,
|
|
12
|
+
s as createScalarApiClient,
|
|
13
|
+
l as useWorkspace
|
|
15
14
|
};
|
package/dist/libs/sendRequest.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { redirectToProxy as A, shouldUseProxy as C } from "@scalar/oas-utils/helpers";
|
|
2
2
|
import E from "axios";
|
|
3
3
|
import R from "js-cookie";
|
|
4
|
-
const
|
|
4
|
+
const c = (d = []) => d.reduce(
|
|
5
5
|
(o, i) => (i.key && (o[i.key] = i.value), o),
|
|
6
6
|
{}
|
|
7
|
-
), g = async (
|
|
7
|
+
), g = async (d, o, i, s, y) => {
|
|
8
8
|
var w;
|
|
9
9
|
let n = i;
|
|
10
10
|
o.parameters.path.forEach((e) => {
|
|
11
11
|
!e.key || !e.value || (n = n.replace(`{${e.key}}`, e.value));
|
|
12
12
|
});
|
|
13
|
-
const r =
|
|
14
|
-
|
|
13
|
+
const r = c(
|
|
14
|
+
o.parameters.headers.filter(({ enabled: e }) => e)
|
|
15
|
+
);
|
|
16
|
+
let u = null;
|
|
15
17
|
if (o.body.activeBody === "binary" && o.body.binary)
|
|
16
|
-
r["Content-Type"] = o.body.binary.type, r["Content-Disposition"] = `attachment; filename="${o.body.binary.name}"`,
|
|
18
|
+
r["Content-Type"] = o.body.binary.type, r["Content-Disposition"] = `attachment; filename="${o.body.binary.name}"`, u = o.body.binary;
|
|
17
19
|
else if (o.body.activeBody === "raw")
|
|
18
|
-
|
|
20
|
+
u = o.body.raw.value;
|
|
19
21
|
else if (o.body.activeBody === "formData") {
|
|
20
22
|
r["Content-Type"] = "multipart/form-data";
|
|
21
23
|
const e = new FormData();
|
|
@@ -23,7 +25,7 @@ const u = (c = []) => c.reduce(
|
|
|
23
25
|
(t) => {
|
|
24
26
|
t.key && t.value ? e.append(t.key, t.value) : t.file && e.append(t.file.name, t.file);
|
|
25
27
|
}
|
|
26
|
-
),
|
|
28
|
+
), u = e);
|
|
27
29
|
}
|
|
28
30
|
const f = [], [k, p] = n.split("?");
|
|
29
31
|
new URLSearchParams(p ?? "").forEach((e, t) => {
|
|
@@ -33,14 +35,12 @@ const u = (c = []) => c.reduce(
|
|
|
33
35
|
enabled: !0
|
|
34
36
|
});
|
|
35
37
|
});
|
|
36
|
-
const
|
|
37
|
-
...
|
|
38
|
-
...
|
|
38
|
+
const h = {
|
|
39
|
+
...c(o.parameters.query.filter(({ enabled: e }) => e)),
|
|
40
|
+
...c(f)
|
|
39
41
|
}, l = {
|
|
40
|
-
...
|
|
41
|
-
(o.parameters.cookies ?? []).filter(
|
|
42
|
-
(e) => e.enabled
|
|
43
|
-
)
|
|
42
|
+
...c(
|
|
43
|
+
(o.parameters.cookies ?? []).filter(({ enabled: e }) => e)
|
|
44
44
|
)
|
|
45
45
|
};
|
|
46
46
|
if (s != null && s.scheme) {
|
|
@@ -51,7 +51,7 @@ const u = (c = []) => c.reduce(
|
|
|
51
51
|
l[e.name] = e.value;
|
|
52
52
|
break;
|
|
53
53
|
case "query":
|
|
54
|
-
|
|
54
|
+
h[e.name] = e.value;
|
|
55
55
|
break;
|
|
56
56
|
case "header":
|
|
57
57
|
r[e.name] = e.value;
|
|
@@ -67,13 +67,13 @@ const u = (c = []) => c.reduce(
|
|
|
67
67
|
secure: !0
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
|
-
const
|
|
71
|
-
n = `${k}${
|
|
70
|
+
const b = new URLSearchParams(h).toString();
|
|
71
|
+
n = `${k}${b ? "?" + b : ""}`;
|
|
72
72
|
const D = {
|
|
73
73
|
url: A(y, n),
|
|
74
|
-
method:
|
|
74
|
+
method: d.method,
|
|
75
75
|
headers: r,
|
|
76
|
-
data:
|
|
76
|
+
data: u
|
|
77
77
|
}, v = Date.now();
|
|
78
78
|
try {
|
|
79
79
|
const e = await E(D);
|