@scalar/api-client 2.2.29 → 2.2.31
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 +33 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +81 -87
- package/dist/components/ContextBar.vue.js +2 -2
- package/dist/components/ContextBar.vue2.js +3 -3
- package/dist/components/DataTable/index.js +16 -16
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +5 -5
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +2 -2
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
- package/dist/hooks/useLayout.js +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +11 -11
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +22 -22
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +11 -11
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +21 -21
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/find-request.d.ts +53 -0
- package/dist/libs/find-request.d.ts.map +1 -0
- package/dist/libs/find-request.js +22 -0
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/libs/hot-keys.d.ts.map +1 -1
- package/dist/libs/hot-keys.js +3 -2
- package/dist/libs/importers/index.d.ts +1 -1
- package/dist/libs/importers/index.d.ts.map +1 -1
- package/dist/libs/index.d.ts +1 -0
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +31 -29
- package/dist/libs/parse-curl.d.ts +4 -1
- package/dist/libs/parse-curl.d.ts.map +1 -1
- package/dist/libs/parse-curl.js +55 -69
- package/dist/libs/send-request/send-request.js +1 -1
- package/dist/store/active-entities.d.ts +19 -15
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +30 -27
- package/dist/store/events.d.ts +1 -1
- package/dist/store/store.d.ts +11 -11
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/workspace.d.ts +10 -10
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +67 -66
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +100 -60
- 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 +1 -1
- package/dist/views/Request/RequestSection/index.d.ts +2 -0
- package/dist/views/Request/RequestSection/index.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/index.js +4 -0
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +4 -4
- package/dist/views/Request/RequestSidebar.vue2.js +123 -121
- package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
- package/dist/views/Request/RequestSubpageHeader.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +9 -9
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +1 -1
- package/dist/views/Request/ResponseSection/index.d.ts +2 -0
- package/dist/views/Request/ResponseSection/index.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/index.js +4 -0
- package/package.json +19 -9
|
@@ -1 +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,
|
|
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,YAK7B,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"}
|
package/dist/libs/hot-keys.js
CHANGED
|
@@ -18,6 +18,7 @@ const c = [
|
|
|
18
18
|
"F12"
|
|
19
19
|
], d = {
|
|
20
20
|
Escape: { event: "closeModal" },
|
|
21
|
+
Enter: { event: "executeRequest", modifiers: ["default"] },
|
|
21
22
|
b: { event: "toggleSidebar", modifiers: ["default"] },
|
|
22
23
|
k: { event: "openCommandPalette", modifiers: ["default"] }
|
|
23
24
|
}, o = (e) => {
|
|
@@ -31,7 +32,7 @@ const c = [
|
|
|
31
32
|
Meta: "metaKey"
|
|
32
33
|
}, m = (e) => e.map(
|
|
33
34
|
(t) => t === "default" ? f() ? "metaKey" : "ctrlKey" : l[t]
|
|
34
|
-
),
|
|
35
|
+
), E = (e, t, {
|
|
35
36
|
hotKeys: n = d,
|
|
36
37
|
modifiers: s = ["default"]
|
|
37
38
|
} = {}) => {
|
|
@@ -41,5 +42,5 @@ const c = [
|
|
|
41
42
|
export {
|
|
42
43
|
d as DEFAULT_HOTKEYS,
|
|
43
44
|
m as getModifiers,
|
|
44
|
-
|
|
45
|
+
E as handleHotKeyDown
|
|
45
46
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { importCurlCommand } from './curl.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/libs/importers/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/libs/importers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA"}
|
package/dist/libs/index.d.ts
CHANGED
package/dist/libs/index.d.ts.map
CHANGED
|
@@ -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,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,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,cAAc,WAAW,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,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AACxD,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,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,cAAc,WAAW,CAAA"}
|
package/dist/libs/index.js
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
import { createApiClient as o } from "./create-client.js";
|
|
2
2
|
import { formatBytes as a, formatMs as m } from "./formatters.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { findRequestByPathMethod as p } from "./find-request.js";
|
|
4
|
+
import { ERRORS as n, normalizeError as i, prettyErrorMessage as c } from "./errors.js";
|
|
5
|
+
import { DEFAULT_HOTKEYS as x, getModifiers as d, handleHotKeyDown as u } from "./hot-keys.js";
|
|
6
|
+
import { createEventBus as y } from "./event-bus.js";
|
|
7
|
+
import { getEnvColor as h } from "./env-helpers.js";
|
|
8
|
+
import { formatHeaderKey as D, normalizeHeaders as g } from "./normalize-headers.js";
|
|
9
|
+
import { loadAllResources as B } from "./local-storage.js";
|
|
9
10
|
import { parseEnvVariables as O } from "./environment-parser.js";
|
|
10
11
|
import { isUrl as v } from "./isUrl.js";
|
|
11
|
-
import { getOpenApiDocumentDetails as
|
|
12
|
+
import { getOpenApiDocumentDetails as M } from "./getOpenApiDocumentDetails.js";
|
|
12
13
|
import { parseCurlCommand as K } from "./parse-curl.js";
|
|
13
|
-
import { convertPostmanToOpenApi as
|
|
14
|
-
import { createFetchBody as
|
|
14
|
+
import { convertPostmanToOpenApi as z, getPostmanDocumentDetails as S, isPostmanCollection as U } from "./postman.js";
|
|
15
|
+
import { createFetchBody as k, createFetchHeaders as w, createFetchQueryParams as L, createRequestOperation as Q, decodeBuffer as V, setRequestCookies as Y } from "./send-request/send-request.js";
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
x as DEFAULT_HOTKEYS,
|
|
18
|
+
n as ERRORS,
|
|
19
|
+
z as convertPostmanToOpenApi,
|
|
19
20
|
o as createApiClient,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
y as createEventBus,
|
|
22
|
+
k as createFetchBody,
|
|
23
|
+
w as createFetchHeaders,
|
|
24
|
+
L as createFetchQueryParams,
|
|
25
|
+
Q as createRequestOperation,
|
|
26
|
+
V as decodeBuffer,
|
|
27
|
+
p as findRequestByPathMethod,
|
|
26
28
|
a as formatBytes,
|
|
27
29
|
D as formatHeaderKey,
|
|
28
30
|
m as formatMs,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
h as getEnvColor,
|
|
32
|
+
d as getModifiers,
|
|
33
|
+
M as getOpenApiDocumentDetails,
|
|
34
|
+
S as getPostmanDocumentDetails,
|
|
35
|
+
u as handleHotKeyDown,
|
|
36
|
+
U as isPostmanCollection,
|
|
35
37
|
v as isUrl,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
B as loadAllResources,
|
|
39
|
+
i as normalizeError,
|
|
40
|
+
g as normalizeHeaders,
|
|
39
41
|
K as parseCurlCommand,
|
|
40
42
|
O as parseEnvVariables,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
c as prettyErrorMessage,
|
|
44
|
+
Y as setRequestCookies
|
|
43
45
|
};
|
|
@@ -5,7 +5,10 @@ export declare function parseCurlCommand(curlCommand: string): {
|
|
|
5
5
|
method?: RequestMethod;
|
|
6
6
|
headers?: Record<string, string>;
|
|
7
7
|
body?: string;
|
|
8
|
-
queryParameters?:
|
|
8
|
+
queryParameters?: Array<{
|
|
9
|
+
key: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}>;
|
|
9
12
|
servers?: string[];
|
|
10
13
|
};
|
|
11
14
|
//# sourceMappingURL=parse-curl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-curl.d.ts","sourceRoot":"","sources":["../../src/libs/parse-curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAGpE,yCAAyC;AACzC,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM;SAW3C,MAAM;aACF,aAAa;cACZ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;WACzB,MAAM;sBACK,
|
|
1
|
+
{"version":3,"file":"parse-curl.d.ts","sourceRoot":"","sources":["../../src/libs/parse-curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAGpE,yCAAyC;AACzC,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM;SAW3C,MAAM;aACF,aAAa;cACZ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;WACzB,MAAM;sBACK,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;cAC7C,MAAM,EAAE;EAoDrB"}
|
package/dist/libs/parse-curl.js
CHANGED
|
@@ -1,76 +1,62 @@
|
|
|
1
|
-
import { parse as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
let r =
|
|
5
|
-
for (; r; )
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const i = n.next().value;
|
|
31
|
-
typeof i == "string" && (e.body = i);
|
|
32
|
-
} else typeof r == "string" && !e.url && (r.startsWith("http") || r.startsWith("www.")) ? d([r][Symbol.iterator](), e) : r === "-P" ? y(n, e) : typeof r == "string" && r.toLowerCase().includes("content-type") ? v(r, e) : r === "-u" || r === "--user" ? x(n, e) : (r === "-b" || r === "--cookie") && b(n, e);
|
|
33
|
-
r = n.next().value;
|
|
34
|
-
}
|
|
35
|
-
return e;
|
|
36
|
-
}
|
|
37
|
-
function l(a, t) {
|
|
38
|
-
t.method = a.next().value.toLowerCase();
|
|
39
|
-
}
|
|
40
|
-
function d(a, t) {
|
|
41
|
-
const e = new URL(a.next().value.replace(/['"]/g, ""));
|
|
42
|
-
t.servers = [e.origin], t.path = e.pathname !== "/" ? e.pathname : "", t.url = t.servers[0] + t.path, t.queryParameters = f(e.search);
|
|
43
|
-
}
|
|
44
|
-
function u(a, t) {
|
|
45
|
-
const e = a.next().value.replace(/['"]/g, "").split(/:(.*)/);
|
|
46
|
-
t.headers = t.headers || {}, e[1] !== void 0 ? t.headers[e[0].trim()] = e[1].trim() : t.headers[e[0].trim()] = "";
|
|
47
|
-
}
|
|
48
|
-
function y(a, t) {
|
|
49
|
-
const e = a.next().value.replace(/['"]/g, "").split("=");
|
|
50
|
-
t.pathVariables = t.pathVariables || {}, e[1] !== void 0 ? t.pathVariables[e[0].trim()] = e[1].trim() : t.pathVariables[e[0].trim()] = "";
|
|
51
|
-
}
|
|
52
|
-
function f(a) {
|
|
53
|
-
const t = a.indexOf("?"), e = [];
|
|
54
|
-
return t !== -1 && a.substring(t + 1).split("&").forEach((i) => {
|
|
55
|
-
const [p, o] = i.split("=");
|
|
56
|
-
if (p) {
|
|
57
|
-
const s = decodeURIComponent(p.trim()), c = o ? decodeURIComponent(o.trim()) : "";
|
|
58
|
-
e.push({ key: s, value: c });
|
|
59
|
-
}
|
|
1
|
+
import { parse as c } from "shell-quote";
|
|
2
|
+
function b(i) {
|
|
3
|
+
const e = c(i).map((o) => typeof o == "object" && "op" in o && o.op === "glob" ? o.pattern.trim() : typeof o == "string" ? o.trim() : o).filter((o) => o !== ""), a = { url: "" }, t = e[Symbol.iterator]();
|
|
4
|
+
let r = t.next().value;
|
|
5
|
+
for (; r; )
|
|
6
|
+
r === "-X" || r === "--request" ? h(t, a) : r === "--url" ? s(t, a) : r === "-H" || r === "--header" ? p(t, a) : r === "--data" || r === "-d" || r === "--data-raw" || r === "--data-urlencode" || r === "--data-binary" || r === "--data-ascii" ? u(t, a, i) : typeof r == "string" && !a.url && (r.startsWith("http") || r.startsWith("www.")) ? s([r][Symbol.iterator](), a) : r === "-P" ? d(t, a) : typeof r == "string" && r.toLowerCase().includes("content-type") ? f(r, a) : r === "-u" || r === "--user" ? m(t, a) : (r === "-b" || r === "--cookie") && l(t, a), r = t.next().value;
|
|
7
|
+
return a;
|
|
8
|
+
}
|
|
9
|
+
function h(i, e) {
|
|
10
|
+
e.method = i.next().value.toLowerCase();
|
|
11
|
+
}
|
|
12
|
+
function s(i, e) {
|
|
13
|
+
const a = new URL(i.next().value.replace(/['"]/g, ""));
|
|
14
|
+
e.servers = [a.origin], e.path = a.pathname !== "/" ? a.pathname : "", e.url = e.servers[0] + e.path;
|
|
15
|
+
const t = n(a.search);
|
|
16
|
+
e.queryParameters = e.queryParameters ? [...e.queryParameters, ...t] : t;
|
|
17
|
+
}
|
|
18
|
+
function p(i, e) {
|
|
19
|
+
const a = i.next().value.split(/:(.*)/);
|
|
20
|
+
e.headers = e.headers || {}, a[1] !== void 0 ? e.headers[a[0].trim()] = a[1].trim() : e.headers[a[0].trim()] = "";
|
|
21
|
+
}
|
|
22
|
+
function d(i, e) {
|
|
23
|
+
const a = i.next().value.replace(/['"]/g, "").split("=");
|
|
24
|
+
e.pathVariables = e.pathVariables || {}, a[1] !== void 0 ? e.pathVariables[a[0].trim()] = a[1].trim() : e.pathVariables[a[0].trim()] = "";
|
|
25
|
+
}
|
|
26
|
+
function n(i) {
|
|
27
|
+
const e = [];
|
|
28
|
+
return new URL(i, "http://example.com").searchParams.forEach((t, r) => {
|
|
29
|
+
e.push({ key: r, value: t });
|
|
60
30
|
}), e;
|
|
61
31
|
}
|
|
62
|
-
function
|
|
63
|
-
const
|
|
64
|
-
|
|
32
|
+
function f(i, e) {
|
|
33
|
+
const a = i.replace(/['"]/g, "").split(/:(.+)/);
|
|
34
|
+
e.headers = e.headers || {}, a[0] && (a[1] !== void 0 ? e.headers[a[0].trim()] = a[1].trim() : e.headers[a[0].trim()] = "");
|
|
35
|
+
}
|
|
36
|
+
function m(i, e) {
|
|
37
|
+
const a = i.next().value;
|
|
38
|
+
try {
|
|
39
|
+
const t = btoa(a);
|
|
40
|
+
e.headers = e.headers || {}, e.headers.Authorization = `Basic ${t}`;
|
|
41
|
+
} catch (t) {
|
|
42
|
+
console.warn(
|
|
43
|
+
"Could not base64 encode these HTTP basic auth credentials:",
|
|
44
|
+
a,
|
|
45
|
+
t
|
|
46
|
+
);
|
|
47
|
+
}
|
|
65
48
|
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
68
|
-
|
|
49
|
+
function l(i, e) {
|
|
50
|
+
const a = i.next().value;
|
|
51
|
+
e.headers = e.headers || {}, e.headers.Cookie ? e.headers.Cookie += `; ${a}` : e.headers.Cookie = a.replace(/;$/, "");
|
|
69
52
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
-
t.
|
|
53
|
+
function u(i, e, a) {
|
|
54
|
+
const t = i.next().value;
|
|
55
|
+
if (typeof t == "string" && (t.startsWith("@") ? e.body = "" : e.body = t, !e.url || a.includes("-G"))) {
|
|
56
|
+
const r = n(`?${e.body}`);
|
|
57
|
+
e.queryParameters = e.queryParameters ? [...e.queryParameters, ...r] : r;
|
|
58
|
+
}
|
|
73
59
|
}
|
|
74
60
|
export {
|
|
75
|
-
|
|
61
|
+
b as parseCurlCommand
|
|
76
62
|
};
|
|
@@ -19,7 +19,7 @@ function W(n, o) {
|
|
|
19
19
|
function j(n, o) {
|
|
20
20
|
const t = new URLSearchParams();
|
|
21
21
|
return n.parameters.query.forEach((r) => {
|
|
22
|
-
r.enabled &&
|
|
22
|
+
r.enabled && t.append(r.key, f(r.value ?? "", o));
|
|
23
23
|
}), t;
|
|
24
24
|
}
|
|
25
25
|
function N({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Environment } from '@scalar/oas-utils/entities/environment';
|
|
2
2
|
import type { Collection, Request, RequestExample, Server } from '@scalar/oas-utils/entities/spec';
|
|
3
3
|
import type { Workspace } from '@scalar/oas-utils/entities/workspace';
|
|
4
|
-
import { type InjectionKey } from 'vue';
|
|
4
|
+
import { type ComputedRef, type InjectionKey } from 'vue';
|
|
5
5
|
import type { Router } from 'vue-router';
|
|
6
6
|
type CreateActiveEntitiesStoreParams = {
|
|
7
7
|
collections: Record<string, Collection>;
|
|
@@ -11,6 +11,10 @@ type CreateActiveEntitiesStoreParams = {
|
|
|
11
11
|
servers: Record<string, Server>;
|
|
12
12
|
workspaces: Record<string, Workspace>;
|
|
13
13
|
router?: Router;
|
|
14
|
+
/** Override the active request */
|
|
15
|
+
activeRequestOverride?: ComputedRef<Request | undefined>;
|
|
16
|
+
/** Override the active request example */
|
|
17
|
+
activeExampleOverride?: ComputedRef<RequestExample | undefined>;
|
|
14
18
|
};
|
|
15
19
|
type EnvVariable = {
|
|
16
20
|
key: string;
|
|
@@ -22,8 +26,8 @@ type EnvVariable = {
|
|
|
22
26
|
*
|
|
23
27
|
* We need the factory function to pass the router instance
|
|
24
28
|
*/
|
|
25
|
-
export declare const createActiveEntitiesStore: ({ collections, requestExamples, requests, router, servers, workspaces, }: CreateActiveEntitiesStoreParams) => {
|
|
26
|
-
activeCollection:
|
|
29
|
+
export declare const createActiveEntitiesStore: ({ collections, requestExamples, requests, router, servers, workspaces, activeRequestOverride, activeExampleOverride, }: CreateActiveEntitiesStoreParams) => {
|
|
30
|
+
activeCollection: ComputedRef<{
|
|
27
31
|
type: "collection";
|
|
28
32
|
uid: string;
|
|
29
33
|
children: string[];
|
|
@@ -78,8 +82,8 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
78
82
|
documentUrl?: string | undefined;
|
|
79
83
|
integration?: string | null | undefined;
|
|
80
84
|
} | undefined>;
|
|
81
|
-
activeCookieId:
|
|
82
|
-
activeExample:
|
|
85
|
+
activeCookieId: ComputedRef<string>;
|
|
86
|
+
activeExample: ComputedRef<{
|
|
83
87
|
type: "requestExample";
|
|
84
88
|
uid: string;
|
|
85
89
|
name: string;
|
|
@@ -174,7 +178,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
174
178
|
};
|
|
175
179
|
serverVariables?: Record<string, string[]> | undefined;
|
|
176
180
|
} | undefined>;
|
|
177
|
-
activeRequest:
|
|
181
|
+
activeRequest: ComputedRef<{
|
|
178
182
|
path: string;
|
|
179
183
|
type: "request";
|
|
180
184
|
uid: string;
|
|
@@ -211,7 +215,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
211
215
|
requestBody?: any;
|
|
212
216
|
responses?: Record<string, any> | undefined;
|
|
213
217
|
} | undefined>;
|
|
214
|
-
activeRouterParams:
|
|
218
|
+
activeRouterParams: ComputedRef<{
|
|
215
219
|
collection: string;
|
|
216
220
|
environment: string;
|
|
217
221
|
request: string;
|
|
@@ -222,7 +226,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
222
226
|
workspace: string;
|
|
223
227
|
settings: string;
|
|
224
228
|
}>;
|
|
225
|
-
activeEnvironment:
|
|
229
|
+
activeEnvironment: ComputedRef<{
|
|
226
230
|
uid: string;
|
|
227
231
|
color: string;
|
|
228
232
|
name: string;
|
|
@@ -235,7 +239,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
235
239
|
color: string;
|
|
236
240
|
isDefault: boolean;
|
|
237
241
|
}>;
|
|
238
|
-
activeServer:
|
|
242
|
+
activeServer: ComputedRef<{
|
|
239
243
|
uid: string;
|
|
240
244
|
url: string;
|
|
241
245
|
description?: string | undefined;
|
|
@@ -243,7 +247,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
243
247
|
enum?: [string, ...string[]];
|
|
244
248
|
}> | undefined;
|
|
245
249
|
} | undefined>;
|
|
246
|
-
activeWorkspace:
|
|
250
|
+
activeWorkspace: ComputedRef<{
|
|
247
251
|
uid: string;
|
|
248
252
|
name: string;
|
|
249
253
|
description: string;
|
|
@@ -255,13 +259,13 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
255
259
|
hotKeyConfig?: {
|
|
256
260
|
modifiers: ("Meta" | "Control" | "Shift" | "Alt" | "default")[];
|
|
257
261
|
hotKeys?: Partial<Record<"" | "/" | "Space" | "Backspace" | "Tab" | "Enter" | "Escape" | "ArrowDown" | "ArrowLeft" | "ArrowRight" | "ArrowUp" | "End" | "Home" | "PageDown" | "PageUp" | "Delete" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "*" | "+" | "-" | "." | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | ";" | "=" | "," | "`" | "[" | "\\" | "]", {
|
|
258
|
-
event: "closeModal" | "
|
|
262
|
+
event: "addTopNav" | "closeModal" | "closeTopNav" | "createNew" | "executeRequest" | "focusAddressBar" | "focusRequestSearch" | "jumpToLastTab" | "jumpToTab" | "navigateSearchResultsDown" | "navigateSearchResultsUp" | "navigateTopNavLeft" | "navigateTopNavRight" | "openCommandPalette" | "selectSearchResult" | "toggleSidebar";
|
|
259
263
|
modifiers?: ("Meta" | "Control" | "Shift" | "Alt" | "default")[] | undefined;
|
|
260
264
|
}>> | undefined;
|
|
261
265
|
} | undefined;
|
|
262
266
|
proxyUrl?: string | undefined;
|
|
263
267
|
} | undefined>;
|
|
264
|
-
activeWorkspaceCollections:
|
|
268
|
+
activeWorkspaceCollections: ComputedRef<{
|
|
265
269
|
type: "collection";
|
|
266
270
|
uid: string;
|
|
267
271
|
children: string[];
|
|
@@ -316,7 +320,7 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
316
320
|
documentUrl?: string | undefined;
|
|
317
321
|
integration?: string | null | undefined;
|
|
318
322
|
}[]>;
|
|
319
|
-
activeWorkspaceServers:
|
|
323
|
+
activeWorkspaceServers: ComputedRef<({
|
|
320
324
|
uid: string;
|
|
321
325
|
url: string;
|
|
322
326
|
description?: string | undefined;
|
|
@@ -324,8 +328,8 @@ export declare const createActiveEntitiesStore: ({ collections, requestExamples,
|
|
|
324
328
|
enum?: [string, ...string[]];
|
|
325
329
|
}> | undefined;
|
|
326
330
|
} | undefined)[]>;
|
|
327
|
-
activeEnvVariables:
|
|
328
|
-
activeWorkspaceRequests:
|
|
331
|
+
activeEnvVariables: ComputedRef<EnvVariable[]>;
|
|
332
|
+
activeWorkspaceRequests: ComputedRef<string[]>;
|
|
329
333
|
};
|
|
330
334
|
export type ActiveEntitiesStore = ReturnType<typeof createActiveEntitiesStore>;
|
|
331
335
|
export declare const ACTIVE_ENTITIES_SYMBOL: InjectionKey<ActiveEntitiesStore>;
|
|
@@ -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,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,EAAE,KAAK,YAAY,EAAoB,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"active-entities.d.ts","sourceRoot":"","sources":["../../src/store/active-entities.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
import { flattenEnvVars as D } from "../libs/string-template.js";
|
|
2
|
-
import { isDefined as
|
|
3
|
-
import { computed as i, inject as
|
|
4
|
-
import { getRouterParams as
|
|
2
|
+
import { isDefined as j } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import { computed as i, inject as w } from "vue";
|
|
4
|
+
import { getRouterParams as P } from "./router-params.js";
|
|
5
5
|
import { PathId as m } from "../routes.js";
|
|
6
|
-
const
|
|
6
|
+
const z = ({
|
|
7
7
|
collections: v,
|
|
8
8
|
requestExamples: N,
|
|
9
9
|
requests: I,
|
|
10
10
|
router: O,
|
|
11
11
|
servers: S,
|
|
12
|
-
workspaces: E
|
|
12
|
+
workspaces: E,
|
|
13
|
+
// TODO: these are temporary until we allow providing each entity individually
|
|
14
|
+
activeRequestOverride: q,
|
|
15
|
+
activeExampleOverride: C
|
|
13
16
|
}) => {
|
|
14
|
-
const l = i(
|
|
17
|
+
const l = i(P(O)), a = i(() => E[l.value[m.Workspace]] ?? E[Object.keys(E)[0] ?? ""]), f = i(
|
|
15
18
|
() => {
|
|
16
19
|
var e;
|
|
17
|
-
return ((e = a.value) == null ? void 0 : e.collections.map((t) => v[t]).filter(
|
|
20
|
+
return ((e = a.value) == null ? void 0 : e.collections.map((t) => v[t]).filter(j).sort((t, n) => {
|
|
18
21
|
var s, o;
|
|
19
22
|
return ((s = t.info) == null ? void 0 : s.title) === "Drafts" ? 1 : ((o = n.info) == null ? void 0 : o.title) === "Drafts" ? -1 : 0;
|
|
20
23
|
})) ?? [];
|
|
21
24
|
}
|
|
22
|
-
),
|
|
25
|
+
), h = i(
|
|
23
26
|
() => {
|
|
24
27
|
var e;
|
|
25
28
|
return (e = f.value) == null ? void 0 : e.flatMap(
|
|
26
29
|
(t) => t.servers.map((n) => S[n])
|
|
27
30
|
);
|
|
28
31
|
}
|
|
29
|
-
),
|
|
32
|
+
), A = i(
|
|
30
33
|
() => {
|
|
31
34
|
var e;
|
|
32
35
|
return ((e = f.value) == null ? void 0 : e.flatMap(
|
|
@@ -43,9 +46,9 @@ const L = ({
|
|
|
43
46
|
value: JSON.stringify((n = a.value) == null ? void 0 : n.environments, null, 2)
|
|
44
47
|
};
|
|
45
48
|
const e = f.value.find(
|
|
46
|
-
(
|
|
49
|
+
(U) => {
|
|
47
50
|
var g, x;
|
|
48
|
-
return (x =
|
|
51
|
+
return (x = U["x-scalar-environments"]) == null ? void 0 : x[((g = a.value) == null ? void 0 : g.activeEnvironmentId) ?? ""];
|
|
49
52
|
}
|
|
50
53
|
);
|
|
51
54
|
return e && ((s = a.value) != null && s.activeEnvironmentId) ? {
|
|
@@ -64,11 +67,11 @@ const L = ({
|
|
|
64
67
|
name: "No Environment",
|
|
65
68
|
value: JSON.stringify(a.value.environments, null, 2)
|
|
66
69
|
};
|
|
67
|
-
}), d = i(() => {
|
|
70
|
+
}), d = q ?? i(() => {
|
|
68
71
|
var n;
|
|
69
72
|
const e = l.value[m.Request], t = v[l.value.collection] || v[((n = a.value) == null ? void 0 : n.collections[0]) ?? ""];
|
|
70
73
|
return I[e] || I[(t == null ? void 0 : t.requests[0]) ?? ""];
|
|
71
|
-
}),
|
|
74
|
+
}), R = C ?? i(() => {
|
|
72
75
|
var t;
|
|
73
76
|
const e = l.value[m.Examples] === "default" ? ((t = d.value) == null ? void 0 : t.examples[0]) || "" : l.value[m.Examples];
|
|
74
77
|
return N[e];
|
|
@@ -84,14 +87,14 @@ const L = ({
|
|
|
84
87
|
);
|
|
85
88
|
const t = ((s = a.value) == null ? void 0 : s.collections[0]) ?? ((o = v[0]) == null ? void 0 : o.uid) ?? "";
|
|
86
89
|
return v[t];
|
|
87
|
-
}),
|
|
90
|
+
}), W = i(
|
|
88
91
|
() => {
|
|
89
92
|
var e, t, n;
|
|
90
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])) ?? ""];
|
|
91
94
|
}
|
|
92
|
-
),
|
|
95
|
+
), J = i(
|
|
93
96
|
() => l.value[m.Cookies]
|
|
94
|
-
),
|
|
97
|
+
), M = i(() => {
|
|
95
98
|
var c;
|
|
96
99
|
const e = ((c = a.value) == null ? void 0 : c.environments) ?? {}, t = p.value.uid ? JSON.parse(p.value.value) : {}, n = D(e).map(
|
|
97
100
|
([r, u]) => ({
|
|
@@ -114,25 +117,25 @@ const L = ({
|
|
|
114
117
|
});
|
|
115
118
|
return {
|
|
116
119
|
activeCollection: k,
|
|
117
|
-
activeCookieId:
|
|
118
|
-
activeExample:
|
|
120
|
+
activeCookieId: J,
|
|
121
|
+
activeExample: R,
|
|
119
122
|
activeRequest: d,
|
|
120
123
|
activeRouterParams: l,
|
|
121
124
|
activeEnvironment: p,
|
|
122
|
-
activeServer:
|
|
125
|
+
activeServer: W,
|
|
123
126
|
activeWorkspace: a,
|
|
124
127
|
activeWorkspaceCollections: f,
|
|
125
|
-
activeWorkspaceServers:
|
|
126
|
-
activeEnvVariables:
|
|
127
|
-
activeWorkspaceRequests:
|
|
128
|
+
activeWorkspaceServers: h,
|
|
129
|
+
activeEnvVariables: M,
|
|
130
|
+
activeWorkspaceRequests: A
|
|
128
131
|
};
|
|
129
|
-
},
|
|
130
|
-
const v =
|
|
132
|
+
}, T = Symbol(), F = () => {
|
|
133
|
+
const v = w(T);
|
|
131
134
|
if (!v) throw new Error("Active entities store not provided");
|
|
132
135
|
return v;
|
|
133
136
|
};
|
|
134
137
|
export {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
+
T as ACTIVE_ENTITIES_SYMBOL,
|
|
139
|
+
z as createActiveEntitiesStore,
|
|
140
|
+
F as useActiveEntities
|
|
138
141
|
};
|
package/dist/store/events.d.ts
CHANGED
|
@@ -24,6 +24,6 @@ export declare function createStoreEvents(): {
|
|
|
24
24
|
/**
|
|
25
25
|
* Event bus for handling hot keys
|
|
26
26
|
*/
|
|
27
|
-
hotKeys: import("../libs/event-bus.js").EventBus<Partial<Record<"closeModal" | "
|
|
27
|
+
hotKeys: import("../libs/event-bus.js").EventBus<Partial<Record<"addTopNav" | "closeModal" | "closeTopNav" | "createNew" | "executeRequest" | "focusAddressBar" | "focusRequestSearch" | "jumpToLastTab" | "jumpToTab" | "navigateSearchResultsDown" | "navigateSearchResultsUp" | "navigateTopNavLeft" | "navigateTopNavRight" | "openCommandPalette" | "selectSearchResult" | "toggleSidebar", KeyboardEvent>>>;
|
|
28
28
|
};
|
|
29
29
|
//# sourceMappingURL=events.d.ts.map
|