@scalar/api-client 2.2.35 → 2.2.38
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 +61 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +107 -116
- package/dist/components/AddressBar/AddressBarHistory.vue.d.ts +2 -1
- package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +96 -76
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts +5 -1
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +92 -86
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts +7 -10
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServerItem.vue.js +5 -52
- package/dist/components/AddressBar/AddressBarServerItem.vue2.js +75 -2
- package/dist/components/CodeInput/CodeInput.vue.d.ts +5 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +1 -1
- package/dist/components/CodeInput/CodeInput.vue2.js +126 -112
- package/dist/components/CodeInput/codeVariableWidget.d.ts +1 -4
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +1 -0
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionInput.vue.js +21 -18
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +2 -2
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +2 -2
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts +1 -0
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +86 -54
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +22 -21
- package/dist/components/Form/Form.vue.d.ts.map +1 -1
- package/dist/components/Form/Form.vue.js +3 -3
- package/dist/components/Server/ServerVariablesForm.vue.d.ts +14 -0
- package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -0
- package/dist/components/Server/ServerVariablesForm.vue.js +47 -0
- package/dist/components/Server/ServerVariablesForm.vue2.js +4 -0
- package/dist/components/Server/ServerVariablesSelect.vue.d.ts +12 -0
- package/dist/components/Server/ServerVariablesSelect.vue.d.ts.map +1 -0
- package/dist/components/Server/ServerVariablesSelect.vue.js +54 -0
- package/dist/components/Server/ServerVariablesSelect.vue2.js +4 -0
- package/dist/components/Server/ServerVariablesTextbox.vue.d.ts +11 -0
- package/dist/components/Server/ServerVariablesTextbox.vue.d.ts.map +1 -0
- package/dist/components/Server/ServerVariablesTextbox.vue.js +29 -0
- package/dist/components/Server/ServerVariablesTextbox.vue2.js +4 -0
- package/dist/components/Server/types.d.ts +9 -0
- package/dist/components/Server/types.d.ts.map +1 -0
- package/dist/components/SideNav/SideHelp.vue.js +16 -16
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +11 -10
- 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 +10 -9
- package/dist/components/TopNav/TopNav.vue.js +27 -27
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +99 -84
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +198 -168
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +99 -84
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +110 -90
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +86 -81
- package/dist/libs/find-request.d.ts.map +1 -1
- package/dist/libs/importers/curl.js +4 -4
- package/dist/libs/index.js +18 -19
- package/dist/libs/send-request/index.js +3 -4
- package/dist/libs/send-request/send-request.d.ts +0 -14
- package/dist/libs/send-request/send-request.d.ts.map +1 -1
- package/dist/libs/send-request/send-request.js +120 -142
- package/dist/libs/send-request/set-request-cookies.d.ts +27 -0
- package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -0
- package/dist/libs/send-request/set-request-cookies.js +54 -0
- package/dist/store/active-entities.d.ts +13 -4
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +15 -12
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/cookies.d.ts +4 -58
- package/dist/store/cookies.d.ts.map +1 -1
- package/dist/store/cookies.js +5 -17
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/request-example.d.ts +52 -2
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/requests.d.ts +2 -2
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/servers.d.ts +40 -20
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/store.d.ts +99 -86
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +51 -53
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +24 -37
- package/dist/views/Cookies/CookieModal.vue.d.ts +21 -0
- package/dist/views/Cookies/CookieModal.vue.d.ts.map +1 -0
- package/dist/views/Cookies/CookieModal.vue.js +7 -0
- package/dist/views/Cookies/CookieModal.vue2.js +88 -0
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +98 -119
- package/dist/views/Environment/Environment.vue2.js +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 +88 -89
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +87 -88
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +2 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +3 -3
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +16 -17
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +34 -34
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +7 -0
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +79 -66
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +57 -74
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +91 -64
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +9 -2
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +168 -129
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +5 -64
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +46 -2
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +2 -2
- package/dist/views/Request/RequestSidebar.vue2.js +143 -143
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue2.js +71 -71
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue2.js +37 -37
- package/dist/views/Request/ResponseSection/ResponseCookies.vue.js +19 -17
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +27 -27
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +31 -31
- package/dist/views/Request/handle-drag.d.ts +1 -1
- package/dist/views/Request/handle-drag.d.ts.map +1 -1
- package/dist/views/Request/handle-drag.js +27 -26
- package/dist/views/Request/hooks/useOpenApiWatcher.js +1 -1
- package/dist/views/Request/libs/request.d.ts +12 -0
- package/dist/views/Request/libs/request.d.ts.map +1 -0
- package/dist/views/Request/libs/request.js +4 -0
- package/dist/views/Request/libs/{live-sync.d.ts → watch-mode.d.ts} +1 -1
- package/dist/views/Request/libs/watch-mode.d.ts.map +1 -0
- package/dist/views/Request/libs/{live-sync.js → watch-mode.js} +6 -6
- package/dist/views/Servers/Servers.vue2.js +29 -29
- package/package.json +10 -12
- package/dist/views/Cookies/CookieRaw.vue.js +0 -28
- package/dist/views/Cookies/CookieRaw.vue2.js +0 -4
- package/dist/views/Request/libs/live-sync.d.ts.map +0 -1
|
@@ -1,199 +1,177 @@
|
|
|
1
|
-
import { ERRORS as
|
|
1
|
+
import { ERRORS as v, normalizeError as U } from "../errors.js";
|
|
2
2
|
import { normalizeHeaders as $ } from "../normalize-headers.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { textMediaTypes as
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
return
|
|
3
|
+
import { setRequestCookies as F, getCookieHeader as _ } from "./set-request-cookies.js";
|
|
4
|
+
import { replaceTemplateVariables as c } from "../string-template.js";
|
|
5
|
+
import { canMethodHaveBody as z, isRelativePath as B, concatenateUrlAndPath as K, shouldUseProxy as T, REGEX as M } from "@scalar/oas-utils/helpers";
|
|
6
|
+
import W from "whatwg-mimetype";
|
|
7
|
+
import { textMediaTypes as X } from "../../views/Request/consts/mediaTypes.js";
|
|
8
|
+
function Y(a, o) {
|
|
9
|
+
const t = new W(o);
|
|
10
|
+
return X.includes(t.essence) ? new TextDecoder(t.parameters.get("charset")).decode(a) : new Blob([a], { type: t.essence });
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
}),
|
|
12
|
+
function j(a, o) {
|
|
13
|
+
const t = {};
|
|
14
|
+
return a.parameters.headers.forEach((n) => {
|
|
15
|
+
const f = n.key.trim().toLowerCase();
|
|
16
|
+
n.enabled && (f !== "content-type" || n.value !== "multipart/form-data") && (t[f] = c(n.value, o));
|
|
17
|
+
}), t;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
}),
|
|
19
|
+
function I(a, o) {
|
|
20
|
+
const t = new URLSearchParams();
|
|
21
|
+
return a.parameters.query.forEach((n) => {
|
|
22
|
+
n.enabled && (n.type === "array" ? c(n.value ?? "", o).split(",") : [c(n.value ?? "", o)]).forEach((p) => t.append(n.key, p.trim()));
|
|
23
|
+
}), t;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
globalCookies: o,
|
|
29
|
-
domain: a,
|
|
30
|
-
proxyUrl: m
|
|
31
|
-
}) {
|
|
32
|
-
let p;
|
|
33
|
-
try {
|
|
34
|
-
p = new URL(m || a).host;
|
|
35
|
-
} catch {
|
|
36
|
-
typeof window < "u" && (p = window.location.host);
|
|
37
|
-
}
|
|
38
|
-
const r = {
|
|
39
|
-
// Must point all cookies to the proxy and let it sort them out
|
|
40
|
-
domain: p,
|
|
41
|
-
// Means that the browser sends the cookie with both cross-site and same-site requests.
|
|
42
|
-
sameSite: "None",
|
|
43
|
-
// The Secure attribute must also be set when setting SameSite=None.
|
|
44
|
-
secure: !0
|
|
45
|
-
};
|
|
46
|
-
return n.parameters.cookies.forEach((s) => {
|
|
47
|
-
s.enabled && D.set(s.key, h(s.value, t));
|
|
48
|
-
}), o.forEach((s) => {
|
|
49
|
-
var E;
|
|
50
|
-
const { name: d, value: i, ...u } = s;
|
|
51
|
-
(u.domain === a || ((E = u.domain) == null ? void 0 : E.startsWith(".")) && a.endsWith(u.domain ?? "")) && D.set(d, i, {
|
|
52
|
-
/** Override the domain with the proxy value */
|
|
53
|
-
domain: p,
|
|
54
|
-
// TODO: path cookies probably don't worth with the proxy
|
|
55
|
-
path: u.path,
|
|
56
|
-
expires: u.expires ? new Date(u.expires) : void 0,
|
|
57
|
-
httpOnly: u.httpOnly,
|
|
58
|
-
secure: u.secure
|
|
59
|
-
});
|
|
60
|
-
}), {
|
|
61
|
-
cookieParams: r
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
function j(n, t, o) {
|
|
65
|
-
var a, m, p;
|
|
66
|
-
if (!q(n))
|
|
25
|
+
function N(a, o, t) {
|
|
26
|
+
var n, f, p;
|
|
27
|
+
if (!z(a))
|
|
67
28
|
return { body: void 0, contentType: void 0 };
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
return
|
|
71
|
-
!
|
|
72
|
-
}), { body:
|
|
29
|
+
if (o.body.activeBody === "formData" && o.body.formData) {
|
|
30
|
+
const i = o.body.formData.encoding === "form-data" ? "multipart/form-data" : "application/x-www-form-urlencoded", b = o.body.formData.encoding === "form-data" ? new FormData() : new URLSearchParams();
|
|
31
|
+
return o.body.formData.value.forEach((h) => {
|
|
32
|
+
!h.enabled || !h.key || (h.file && b instanceof FormData ? b.append(h.key, h.file, h.file.name) : h.value !== void 0 && b.append(h.key, c(h.value, t)));
|
|
33
|
+
}), { body: b, contentType: i };
|
|
73
34
|
}
|
|
74
|
-
return
|
|
75
|
-
body:
|
|
76
|
-
contentType: (
|
|
77
|
-
} :
|
|
78
|
-
body:
|
|
79
|
-
contentType: (p =
|
|
35
|
+
return o.body.activeBody === "raw" ? {
|
|
36
|
+
body: c(((n = o.body.raw) == null ? void 0 : n.value) ?? "", t),
|
|
37
|
+
contentType: (f = o.body.raw) == null ? void 0 : f.encoding
|
|
38
|
+
} : o.body.activeBody === "binary" ? {
|
|
39
|
+
body: o.body.binary,
|
|
40
|
+
contentType: (p = o.body.binary) == null ? void 0 : p.type
|
|
80
41
|
} : {
|
|
81
42
|
body: void 0,
|
|
82
43
|
contentType: void 0
|
|
83
44
|
};
|
|
84
45
|
}
|
|
85
|
-
function Q(
|
|
86
|
-
return
|
|
46
|
+
function Q(a) {
|
|
47
|
+
return M.PATH.test(a) || a.startsWith("http://") || a.startsWith("https://") ? a : `http://${a}`;
|
|
87
48
|
}
|
|
88
|
-
const
|
|
89
|
-
request:
|
|
90
|
-
example:
|
|
91
|
-
server:
|
|
92
|
-
securitySchemes:
|
|
93
|
-
selectedSecuritySchemeUids:
|
|
49
|
+
const P = "YOUR_SECRET_TOKEN", ae = ({
|
|
50
|
+
request: a,
|
|
51
|
+
example: o,
|
|
52
|
+
server: t,
|
|
53
|
+
securitySchemes: n,
|
|
54
|
+
selectedSecuritySchemeUids: f = [],
|
|
94
55
|
proxyUrl: p,
|
|
95
|
-
status:
|
|
96
|
-
environment:
|
|
97
|
-
globalCookies:
|
|
56
|
+
status: i,
|
|
57
|
+
environment: b,
|
|
58
|
+
globalCookies: h
|
|
98
59
|
}) => {
|
|
99
60
|
try {
|
|
100
|
-
const
|
|
101
|
-
let
|
|
102
|
-
if (!
|
|
103
|
-
Object.entries((
|
|
104
|
-
|
|
105
|
-
[
|
|
61
|
+
const s = b ?? {}, E = new AbortController(), C = o.parameters.path.reduce((m, e) => (e.enabled && (m[e.key] = c(e.value, s)), m), {}), q = c((t == null ? void 0 : t.url) ?? "", s), g = c(a.path, C);
|
|
62
|
+
let r = q || g;
|
|
63
|
+
if (!r) throw v.URL_EMPTY;
|
|
64
|
+
Object.entries((t == null ? void 0 : t.variables) ?? {}).forEach(([m, e]) => {
|
|
65
|
+
r = c(r, {
|
|
66
|
+
[m]: C[m] || e.default
|
|
106
67
|
});
|
|
107
68
|
});
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
domain: c,
|
|
69
|
+
const R = I(o, s), l = j(o, s), { body: H } = N(a.method, o, s), { cookieParams: L } = F({
|
|
70
|
+
example: o,
|
|
71
|
+
env: s,
|
|
72
|
+
globalCookies: h,
|
|
73
|
+
serverUrl: r,
|
|
114
74
|
proxyUrl: p
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
|
|
75
|
+
});
|
|
76
|
+
if (f == null || f.forEach((m) => {
|
|
77
|
+
var w;
|
|
78
|
+
const e = n[m];
|
|
118
79
|
if (e) {
|
|
119
80
|
if (e.type === "apiKey") {
|
|
120
|
-
const
|
|
121
|
-
e.in === "header" && (
|
|
81
|
+
const d = c(e.value, s) || P;
|
|
82
|
+
e.in === "header" && (l[e.name] = d), e.in === "query" && R.append(e.name, d), e.in === "cookie" && L.push({
|
|
83
|
+
name: e.name,
|
|
84
|
+
value: d,
|
|
85
|
+
path: "/",
|
|
86
|
+
uid: e.name
|
|
87
|
+
});
|
|
122
88
|
}
|
|
123
89
|
if (e.type === "http")
|
|
124
90
|
if (e.scheme === "basic") {
|
|
125
|
-
const
|
|
126
|
-
|
|
91
|
+
const d = c(e.username, s), u = c(e.password, s), y = `${d}:${u}`;
|
|
92
|
+
l.Authorization = `Basic ${y === ":" ? "username:password" : btoa(y)}`;
|
|
127
93
|
} else {
|
|
128
|
-
const
|
|
129
|
-
|
|
94
|
+
const d = c(e.token, s);
|
|
95
|
+
l.Authorization = `Bearer ${d || P}`;
|
|
130
96
|
}
|
|
131
97
|
if (e.type === "oauth2") {
|
|
132
|
-
const
|
|
133
|
-
|
|
98
|
+
const u = (w = Object.values(e.flows).find((y) => y.token)) == null ? void 0 : w.token;
|
|
99
|
+
l.Authorization = `Bearer ${u || P}`;
|
|
134
100
|
}
|
|
135
101
|
}
|
|
136
|
-
}),
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
102
|
+
}), r && (!B(r) || typeof window < "u")) {
|
|
103
|
+
const m = B(r) ? K(window.location.origin, r) : Q(r), e = new URL(m), w = new URL(g, e.origin), d = g.split("?")[0] ?? "", u = new URL(e);
|
|
104
|
+
t != null && t.url && (e.pathname === "/" ? u.pathname = d : u.pathname = e.pathname + d);
|
|
105
|
+
const y = t != null && t.url ? [...e.searchParams, ...w.searchParams, ...R] : [...w.searchParams, ...R];
|
|
106
|
+
u.search = new URLSearchParams(y).toString(), r = u.toString();
|
|
141
107
|
}
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
108
|
+
const k = c(
|
|
109
|
+
_(L, l.Cookie),
|
|
110
|
+
s
|
|
111
|
+
);
|
|
112
|
+
k && (T(p, r) ? (console.warn(
|
|
113
|
+
"We’re using a `X-Scalar-Cookie` custom header to the request. The proxy will forward this as a `Cookie` header. We do this to avoid the browser omitting the `Cookie` header for cross-origin requests for security reasons."
|
|
114
|
+
), l["X-Scalar-Cookie"] = k) : (console.warn(
|
|
115
|
+
`We’re trying to add a Cookie header, but browsers often omit them for cross-origin requests for various security reasons. If it’s not working, that’s probably why. Here are the requirements for it to work:
|
|
116
|
+
|
|
117
|
+
- The browser URL must be on the same domain as the server URL.
|
|
118
|
+
- The connection must be made over HTTPS.
|
|
119
|
+
`
|
|
120
|
+
), l.Cookie = k));
|
|
121
|
+
const S = new URLSearchParams([["scalar_url", r.toString()]]), A = T(p, r) ? `${p}?${S.toString()}` : r, D = new Request(A, {
|
|
122
|
+
method: a.method.toUpperCase(),
|
|
123
|
+
body: H,
|
|
124
|
+
headers: l
|
|
146
125
|
});
|
|
147
126
|
return [
|
|
148
127
|
null,
|
|
149
128
|
{
|
|
150
|
-
request:
|
|
129
|
+
request: D,
|
|
151
130
|
sendRequest: async () => {
|
|
152
|
-
|
|
153
|
-
const
|
|
131
|
+
i == null || i.emit("start");
|
|
132
|
+
const m = Date.now();
|
|
154
133
|
try {
|
|
155
|
-
const e = await fetch(
|
|
156
|
-
signal:
|
|
134
|
+
const e = await fetch(D, {
|
|
135
|
+
signal: E.signal
|
|
157
136
|
});
|
|
158
|
-
|
|
159
|
-
const
|
|
137
|
+
i == null || i.emit("stop");
|
|
138
|
+
const w = $(
|
|
160
139
|
e.headers,
|
|
161
|
-
|
|
162
|
-
),
|
|
140
|
+
T(p, r)
|
|
141
|
+
), d = e.headers.get("content-type") ?? "text/plain;charset=UTF-8", u = await e.arrayBuffer(), y = Y(u, d), O = "getSetCookie" in e.headers && typeof e.headers.getSetCookie == "function" ? e.headers.getSetCookie() : [];
|
|
163
142
|
return [
|
|
164
143
|
null,
|
|
165
144
|
{
|
|
166
145
|
timestamp: Date.now(),
|
|
167
|
-
request:
|
|
146
|
+
request: o,
|
|
168
147
|
response: {
|
|
169
148
|
...e,
|
|
170
|
-
headers:
|
|
171
|
-
cookieHeaderKeys:
|
|
172
|
-
data:
|
|
173
|
-
size:
|
|
174
|
-
duration: Date.now() -
|
|
175
|
-
method:
|
|
149
|
+
headers: w,
|
|
150
|
+
cookieHeaderKeys: O,
|
|
151
|
+
data: y,
|
|
152
|
+
size: u.byteLength,
|
|
153
|
+
duration: Date.now() - m,
|
|
154
|
+
method: a.method,
|
|
176
155
|
status: e.status,
|
|
177
156
|
path: g
|
|
178
157
|
}
|
|
179
158
|
}
|
|
180
159
|
];
|
|
181
160
|
} catch (e) {
|
|
182
|
-
return
|
|
161
|
+
return i == null || i.emit("abort"), [U(e, v.REQUEST_FAILED), null];
|
|
183
162
|
}
|
|
184
163
|
},
|
|
185
|
-
controller:
|
|
164
|
+
controller: E
|
|
186
165
|
}
|
|
187
166
|
];
|
|
188
|
-
} catch (
|
|
189
|
-
return console.error(
|
|
167
|
+
} catch (s) {
|
|
168
|
+
return console.error(s), i == null || i.emit("abort"), [U(s), null];
|
|
190
169
|
}
|
|
191
170
|
};
|
|
192
171
|
export {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
Y as setRequestCookies
|
|
172
|
+
N as createFetchBody,
|
|
173
|
+
j as createFetchHeaders,
|
|
174
|
+
I as createFetchQueryParams,
|
|
175
|
+
ae as createRequestOperation,
|
|
176
|
+
Y as decodeBuffer
|
|
199
177
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Cookie } from '@scalar/oas-utils/entities/cookie';
|
|
2
|
+
import type { RequestExample } from '@scalar/oas-utils/entities/spec';
|
|
3
|
+
/**
|
|
4
|
+
* Set all cookie params and workspace level cookies that are applicable
|
|
5
|
+
*/
|
|
6
|
+
export declare function setRequestCookies({ example, env, globalCookies, serverUrl, proxyUrl, }: {
|
|
7
|
+
example: RequestExample;
|
|
8
|
+
env: object;
|
|
9
|
+
globalCookies: Cookie[];
|
|
10
|
+
serverUrl: string;
|
|
11
|
+
proxyUrl?: string;
|
|
12
|
+
}): {
|
|
13
|
+
cookieParams: Cookie[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Matches, when:
|
|
17
|
+
* - Isn’t scoped to a domain, or
|
|
18
|
+
* - matches the current host, or
|
|
19
|
+
* - or ends with the current host, or
|
|
20
|
+
* - matches the current host with a wildcard.
|
|
21
|
+
*/
|
|
22
|
+
export declare const matchesDomain: (givenUrl?: string, configuredHostname?: string) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Generate a cookie header from the cookie params
|
|
25
|
+
*/
|
|
26
|
+
export declare const getCookieHeader: (cookieParams: Cookie[], originalCookieHeader?: string) => string;
|
|
27
|
+
//# sourceMappingURL=set-request-cookies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-request-cookies.d.ts","sourceRoot":"","sources":["../../../src/libs/send-request/set-request-cookies.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAUrE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,GAAG,EACH,aAAa,EACb,SAAS,EACT,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,cAAc,CAAA;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG;IACF,YAAY,EAAE,MAAM,EAAE,CAAA;CACvB,CAqDA;AA0BD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,cACb,MAAM,uBACI,MAAM,KAC1B,OA+BF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,iBACZ,MAAM,EAAE,yBACC,MAAM,KAC5B,MAYF,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { replaceTemplateVariables as p } from "../string-template.js";
|
|
2
|
+
import { shouldUseProxy as f } from "@scalar/oas-utils/helpers";
|
|
3
|
+
const $ = "/";
|
|
4
|
+
function P({
|
|
5
|
+
example: a,
|
|
6
|
+
env: t,
|
|
7
|
+
globalCookies: s,
|
|
8
|
+
serverUrl: e,
|
|
9
|
+
proxyUrl: r
|
|
10
|
+
}) {
|
|
11
|
+
const n = [], h = f(r, e), i = l(
|
|
12
|
+
h ? r : e ?? "http://localhost"
|
|
13
|
+
);
|
|
14
|
+
return s.forEach((o) => {
|
|
15
|
+
const { name: c, value: u, domain: m, ...d } = o;
|
|
16
|
+
W(e, m) && c && n.push({
|
|
17
|
+
uid: c,
|
|
18
|
+
name: c,
|
|
19
|
+
value: u,
|
|
20
|
+
domain: m,
|
|
21
|
+
path: d.path
|
|
22
|
+
});
|
|
23
|
+
}), a.parameters.cookies.forEach((o) => {
|
|
24
|
+
o.enabled && o.key && n.push({
|
|
25
|
+
uid: o.key,
|
|
26
|
+
name: o.key,
|
|
27
|
+
value: p(o.value, t),
|
|
28
|
+
domain: i,
|
|
29
|
+
path: $
|
|
30
|
+
});
|
|
31
|
+
}), {
|
|
32
|
+
cookieParams: n
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const l = (a) => {
|
|
36
|
+
const t = new URL(a.startsWith("http") ? a : `http://${a}`).hostname;
|
|
37
|
+
return t.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) || t.match(/^[a-fA-F0-9:]+$/) || t.startsWith(".") ? t : `.${t}`;
|
|
38
|
+
}, W = (a, t) => {
|
|
39
|
+
if (!a || !t) return !0;
|
|
40
|
+
try {
|
|
41
|
+
const s = a.startsWith("http") ? a : `http://${a}`, e = new URL(s).hostname, r = !t, n = t === e, h = t.startsWith(".") && t === `.${e}`, i = t.startsWith(".") && (e == null ? void 0 : e.endsWith(t));
|
|
42
|
+
return r || n || i || h;
|
|
43
|
+
} catch {
|
|
44
|
+
return !1;
|
|
45
|
+
}
|
|
46
|
+
}, b = (a, t) => {
|
|
47
|
+
const s = a.map((e) => `${e.name}=${e.value}`).join("; ");
|
|
48
|
+
return t ? `${t}; ${s}`.trim() : s.trim();
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
b as getCookieHeader,
|
|
52
|
+
W as matchesDomain,
|
|
53
|
+
P as setRequestCookies
|
|
54
|
+
};
|
|
@@ -99,6 +99,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
99
99
|
required?: boolean | undefined;
|
|
100
100
|
description?: string | undefined;
|
|
101
101
|
enum?: string[] | undefined;
|
|
102
|
+
examples?: string[] | undefined;
|
|
102
103
|
format?: string | undefined;
|
|
103
104
|
file?: any;
|
|
104
105
|
nullable?: boolean | undefined;
|
|
@@ -114,6 +115,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
114
115
|
required?: boolean | undefined;
|
|
115
116
|
description?: string | undefined;
|
|
116
117
|
enum?: string[] | undefined;
|
|
118
|
+
examples?: string[] | undefined;
|
|
117
119
|
format?: string | undefined;
|
|
118
120
|
file?: any;
|
|
119
121
|
nullable?: boolean | undefined;
|
|
@@ -129,6 +131,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
129
131
|
required?: boolean | undefined;
|
|
130
132
|
description?: string | undefined;
|
|
131
133
|
enum?: string[] | undefined;
|
|
134
|
+
examples?: string[] | undefined;
|
|
132
135
|
format?: string | undefined;
|
|
133
136
|
file?: any;
|
|
134
137
|
nullable?: boolean | undefined;
|
|
@@ -144,6 +147,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
144
147
|
required?: boolean | undefined;
|
|
145
148
|
description?: string | undefined;
|
|
146
149
|
enum?: string[] | undefined;
|
|
150
|
+
examples?: string[] | undefined;
|
|
147
151
|
format?: string | undefined;
|
|
148
152
|
file?: any;
|
|
149
153
|
nullable?: boolean | undefined;
|
|
@@ -164,6 +168,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
164
168
|
required?: boolean | undefined;
|
|
165
169
|
description?: string | undefined;
|
|
166
170
|
enum?: string[] | undefined;
|
|
171
|
+
examples?: string[] | undefined;
|
|
167
172
|
format?: string | undefined;
|
|
168
173
|
file?: any;
|
|
169
174
|
nullable?: boolean | undefined;
|
|
@@ -245,8 +250,10 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
245
250
|
uid: string;
|
|
246
251
|
url: string;
|
|
247
252
|
description?: string | undefined;
|
|
248
|
-
variables?: Record<string,
|
|
249
|
-
|
|
253
|
+
variables?: Record<string, {
|
|
254
|
+
default?: string | undefined;
|
|
255
|
+
description?: string | undefined;
|
|
256
|
+
enum?: string[] | undefined;
|
|
250
257
|
}> | undefined;
|
|
251
258
|
} | undefined>;
|
|
252
259
|
activeWorkspace: ComputedRef<{
|
|
@@ -326,8 +333,10 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
326
333
|
uid: string;
|
|
327
334
|
url: string;
|
|
328
335
|
description?: string | undefined;
|
|
329
|
-
variables?: Record<string,
|
|
330
|
-
|
|
336
|
+
variables?: Record<string, {
|
|
337
|
+
default?: string | undefined;
|
|
338
|
+
description?: string | undefined;
|
|
339
|
+
enum?: string[] | undefined;
|
|
331
340
|
}> | undefined;
|
|
332
341
|
} | undefined)[]>;
|
|
333
342
|
activeEnvVariables: ComputedRef<EnvVariable[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active-entities.d.ts","sourceRoot":"","sources":["../../src/store/active-entities.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,cAAc,EACd,MAAM,EACP,MAAM,iCA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;;;;;;;;;;;;;;;;;;uBAAilT,CAAC;;;;;;uBAAqK,CAAC;mBAAqC,CAAC;0BAA4C,CAAC;mBAAqC,CAAC;oBAAoB,CAAC;mBAAqC,CAAC;qBAAuC,CAAC;;mBAA4D,CAAC;;0BAAoD,CAAC;mBAAqC,CAAC;;;;;;;;;2BAAkX,CAAC;;uBAAqD,CAAC;iBAAmC,CAAC;;;uBAAuG,CAAC;mBAAqC,CAAC;;;;;;;;;;mBAtD31X,CAAC;uBAAyC,CAAC;gBAC3B,CAAC;;;;;CAoC3B,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAC9E,eAAO,MAAM,sBAAsB,EACrB,YAAY,CAAC,mBAAmB,CAAC,CAAA;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,QAAO,mBAIpC,CAAA"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { flattenEnvVars as
|
|
1
|
+
import { flattenEnvVars as C } from "../libs/string-template.js";
|
|
2
2
|
import { isDefined as j } from "@scalar/oas-utils/helpers";
|
|
3
3
|
import { computed as i, inject as w } from "vue";
|
|
4
4
|
import { getRouterParams as P } from "./router-params.js";
|
|
5
5
|
import { PathId as m } from "../routes.js";
|
|
6
6
|
const z = ({
|
|
7
7
|
collections: v,
|
|
8
|
-
requestExamples:
|
|
8
|
+
requestExamples: D,
|
|
9
9
|
requests: I,
|
|
10
|
-
router:
|
|
10
|
+
router: N,
|
|
11
11
|
servers: S,
|
|
12
12
|
workspaces: E,
|
|
13
13
|
// TODO: these are temporary until we allow providing each entity individually
|
|
14
|
-
activeRequestOverride:
|
|
15
|
-
activeExampleOverride:
|
|
14
|
+
activeRequestOverride: O,
|
|
15
|
+
activeExampleOverride: q
|
|
16
16
|
}) => {
|
|
17
|
-
const l = i(P(
|
|
17
|
+
const l = i(P(N)), a = i(() => E[l.value[m.Workspace]] ?? E[Object.keys(E)[0] ?? ""]), f = i(
|
|
18
18
|
() => {
|
|
19
19
|
var e;
|
|
20
20
|
return ((e = a.value) == null ? void 0 : e.collections.map((t) => v[t]).filter(j).sort((t, n) => {
|
|
@@ -67,14 +67,14 @@ const z = ({
|
|
|
67
67
|
name: "No Environment",
|
|
68
68
|
value: JSON.stringify(a.value.environments, null, 2)
|
|
69
69
|
};
|
|
70
|
-
}), d =
|
|
70
|
+
}), d = O ?? i(() => {
|
|
71
71
|
var n;
|
|
72
72
|
const e = l.value[m.Request], t = v[l.value.collection] || v[((n = a.value) == null ? void 0 : n.collections[0]) ?? ""];
|
|
73
73
|
return I[e] || I[(t == null ? void 0 : t.requests[0]) ?? ""];
|
|
74
|
-
}), R =
|
|
74
|
+
}), R = q ?? i(() => {
|
|
75
75
|
var t;
|
|
76
76
|
const e = l.value[m.Examples] === "default" ? ((t = d.value) == null ? void 0 : t.examples[0]) || "" : l.value[m.Examples];
|
|
77
|
-
return
|
|
77
|
+
return D[e];
|
|
78
78
|
}), k = i(() => {
|
|
79
79
|
var n, s, o;
|
|
80
80
|
const e = (n = d.value) == null ? void 0 : n.uid;
|
|
@@ -93,16 +93,19 @@ const z = ({
|
|
|
93
93
|
return S[(((e = d.value) == null ? void 0 : e.selectedServerUid) || ((t = k.value) == null ? void 0 : t.selectedServerUid) || ((n = k.value) == null ? void 0 : n.servers[0])) ?? ""];
|
|
94
94
|
}
|
|
95
95
|
), J = i(
|
|
96
|
-
() =>
|
|
96
|
+
() => {
|
|
97
|
+
var e;
|
|
98
|
+
return l.value[m.Cookies] === "default" ? ((e = a.value) == null ? void 0 : e.cookies[0]) ?? "default" : l.value[m.Cookies];
|
|
99
|
+
}
|
|
97
100
|
), M = i(() => {
|
|
98
101
|
var c;
|
|
99
|
-
const e = ((c = a.value) == null ? void 0 : c.environments) ?? {}, t = p.value.uid ? JSON.parse(p.value.value) : {}, n =
|
|
102
|
+
const e = ((c = a.value) == null ? void 0 : c.environments) ?? {}, t = p.value.uid ? JSON.parse(p.value.value) : {}, n = C(e).map(
|
|
100
103
|
([r, u]) => ({
|
|
101
104
|
key: r,
|
|
102
105
|
value: u,
|
|
103
106
|
source: "global"
|
|
104
107
|
})
|
|
105
|
-
), s =
|
|
108
|
+
), s = C(
|
|
106
109
|
t
|
|
107
110
|
).map(([r, u]) => ({
|
|
108
111
|
key: r,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/store/collections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAExB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAKrE,yCAAyC;AACzC,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,OAAO;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/store/collections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAExB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAKrE,yCAAyC;AACzC,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,OAAO;;;;;;;;;;;;;;;;;;uBAwHyhe,CAAC;;;;;;uBAAqK,CAAC;mBAAqC,CAAC;0BAA4C,CAAC;mBAAqC,CAAC;oBAAoB,CAAC;mBAAqC,CAAC;qBAAuC,CAAC;;mBAA4D,CAAC;;0BAAoD,CAAC;mBAAqC,CAAC;;;;;;;;;2BAAkX,CAAC;;uBAAqD,CAAC;iBAAmC,CAAC;;;uBAAuG,CAAC;mBAAqC,CAAC;;;;;;;;;;;;;;;;;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