@scalar/api-client 2.3.26 → 2.3.28
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 +41 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts +4 -1
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +76 -72
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +48 -45
- package/dist/components/CodeInput/index.d.ts +2 -0
- package/dist/components/CodeInput/index.d.ts.map +1 -0
- package/dist/components/CodeInput/index.js +4 -0
- package/dist/components/DataTable/DataTableInput.vue.d.ts +8 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +3 -3
- package/dist/components/DataTable/DataTableInput.vue2.js +46 -43
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +82 -92
- package/dist/components/Form/Form.vue.d.ts +2 -2
- package/dist/components/Form/Form.vue.d.ts.map +1 -1
- package/dist/components/Form/Form.vue.js +17 -14
- package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +2 -1
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +30 -30
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +16 -0
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +3 -2
- package/dist/components/Sidebar/SidebarListElement.vue2.js +76 -54
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts +2 -2
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +5 -4
- package/dist/components/ViewLayout/index.d.ts +2 -0
- package/dist/components/ViewLayout/index.d.ts.map +1 -0
- package/dist/components/ViewLayout/index.js +4 -0
- package/dist/hooks/useClientConfig.d.ts +6 -6
- package/dist/hooks/useClientConfig.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +13 -13
- package/dist/layouts/Modal/create-api-client-modal.d.ts +26 -26
- package/dist/layouts/Web/create-api-client-web.d.ts +13 -13
- package/dist/libs/create-client.d.ts +13 -13
- package/dist/libs/env-helpers.d.ts +10 -2
- package/dist/libs/env-helpers.d.ts.map +1 -1
- package/dist/libs/env-helpers.js +4 -2
- package/dist/libs/environment-parser.d.ts +1 -1
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
- package/dist/libs/send-request/create-request-operation.js +9 -9
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/libs/string-template.d.ts.map +1 -1
- package/dist/libs/string-template.js +35 -21
- package/dist/routes.d.ts +10 -10
- package/dist/store/active-entities.js +34 -34
- package/dist/store/environment.js +1 -1
- package/dist/store/security-schemes.d.ts +10 -10
- package/dist/store/store.d.ts +13 -13
- package/dist/store/workspace.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/views/Collection/CollectionCookies.vue.d.ts +1 -1
- package/dist/views/Collection/CollectionEnvironment.vue.d.ts +1 -1
- package/dist/views/Collection/CollectionOverview.vue.d.ts +1 -1
- package/dist/views/Collection/CollectionScripts.vue.d.ts +1 -1
- package/dist/views/Collection/CollectionServerForm.vue.d.ts.map +1 -1
- package/dist/views/Collection/CollectionServerForm.vue.js +39 -34
- package/dist/views/Collection/CollectionServers.vue.d.ts.map +1 -1
- package/dist/views/Collection/CollectionServers.vue2.js +58 -78
- package/dist/views/Collection/CollectionSync.vue.d.ts +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts +1 -1
- package/dist/views/Cookies/CookieRaw.vue.d.ts +1 -1
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +208 -188
- package/dist/views/Environment/EnvironmentColors.vue.js +5 -5
- package/dist/views/Environment/EnvironmentModal.vue.js +21 -21
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +9 -9
- package/dist/views/Environment/handle-drag.d.ts +13 -0
- package/dist/views/Environment/handle-drag.d.ts.map +1 -0
- package/dist/views/Environment/handle-drag.js +32 -0
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +23 -22
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +111 -88
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.js +1 -0
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +62 -56
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +4 -4
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +42 -47
- package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +10 -10
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +1 -1
- package/package.json +24 -14
|
@@ -5,7 +5,7 @@ import { createFetchHeaders as X } from "./create-fetch-headers.js";
|
|
|
5
5
|
import { createFetchQueryParams as K } from "./create-fetch-query-params.js";
|
|
6
6
|
import { decodeBuffer as M } from "./decode-buffer.js";
|
|
7
7
|
import { setRequestCookies as Y, getCookieHeader as G } from "./set-request-cookies.js";
|
|
8
|
-
import { replaceTemplateVariables as
|
|
8
|
+
import { replaceTemplateVariables as c } from "../string-template.js";
|
|
9
9
|
import { isDefined as J, mergeUrls as N, shouldUseProxy as P, redirectToProxy as Z } from "@scalar/oas-utils/helpers";
|
|
10
10
|
import { buildRequestSecurity as $ } from "./build-request-security.js";
|
|
11
11
|
const he = ({
|
|
@@ -13,23 +13,23 @@ const he = ({
|
|
|
13
13
|
example: s,
|
|
14
14
|
globalCookies: q,
|
|
15
15
|
proxyUrl: m,
|
|
16
|
-
request:
|
|
16
|
+
request: d,
|
|
17
17
|
securitySchemes: H,
|
|
18
18
|
selectedSecuritySchemeUids: U = [],
|
|
19
19
|
server: i,
|
|
20
20
|
status: r
|
|
21
21
|
}) => {
|
|
22
22
|
try {
|
|
23
|
-
const t = T ?? {}, y = new AbortController(), b = s.parameters.path.reduce((o, n) => (n.enabled && (o[n.key] =
|
|
23
|
+
const t = T ?? {}, y = new AbortController(), b = s.parameters.path.reduce((o, n) => (n.enabled && (o[n.key] = c(n.value, t)), o), {}), D = c((i == null ? void 0 : i.url) ?? "", t), h = c(c(d.path, t), b);
|
|
24
24
|
let a = D || h;
|
|
25
25
|
if (!a)
|
|
26
26
|
throw R.URL_EMPTY;
|
|
27
27
|
Object.entries((i == null ? void 0 : i.variables) ?? {}).forEach(([o, n]) => {
|
|
28
|
-
a =
|
|
28
|
+
a = c(a, {
|
|
29
29
|
[o]: b[o] || n.default
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
-
const E = K(s, t), L = X(s, t), { body: z } = V(
|
|
32
|
+
const E = K(s, t), L = X(s, t), { body: z } = V(d.method, s, t), { cookieParams: F } = Y({
|
|
33
33
|
example: s,
|
|
34
34
|
env: t,
|
|
35
35
|
globalCookies: q,
|
|
@@ -40,7 +40,7 @@ const he = ({
|
|
|
40
40
|
{}
|
|
41
41
|
), ...L }, B = [...F, ...f.cookies], O = new URLSearchParams([...E, ...f.urlParams]);
|
|
42
42
|
a = N(a, h, O);
|
|
43
|
-
const p =
|
|
43
|
+
const p = c(G(B, l.Cookie), t);
|
|
44
44
|
p && (P(m, a) ? (console.warn(
|
|
45
45
|
"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."
|
|
46
46
|
), l["X-Scalar-Cookie"] = p) : (console.warn(
|
|
@@ -51,7 +51,7 @@ const he = ({
|
|
|
51
51
|
`
|
|
52
52
|
), l.Cookie = p));
|
|
53
53
|
const W = Z(m, a), S = new Request(W, {
|
|
54
|
-
method:
|
|
54
|
+
method: d.method.toUpperCase(),
|
|
55
55
|
body: z ?? null,
|
|
56
56
|
headers: l
|
|
57
57
|
});
|
|
@@ -81,7 +81,7 @@ const he = ({
|
|
|
81
81
|
cookieHeaderKeys: g,
|
|
82
82
|
reader: (u = e.body) == null ? void 0 : u.getReader(),
|
|
83
83
|
duration: Date.now() - o,
|
|
84
|
-
method:
|
|
84
|
+
method: d.method,
|
|
85
85
|
status: e.status,
|
|
86
86
|
path: h
|
|
87
87
|
}
|
|
@@ -100,7 +100,7 @@ const he = ({
|
|
|
100
100
|
data: I,
|
|
101
101
|
size: k.byteLength,
|
|
102
102
|
duration: Date.now() - o,
|
|
103
|
-
method:
|
|
103
|
+
method: d.method,
|
|
104
104
|
status: e.status,
|
|
105
105
|
path: h
|
|
106
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-request-operation.test.d.ts","sourceRoot":"","sources":["../../../src/libs/send-request/create-request-operation.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,oBAAoB,EAIrB,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAS5B,eAAO,MAAM,QAAQ,0BAAkC,CAAA;AAEvD,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,KAAK,kBAAkB,GAAG;IACxB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,qDAAqD;AACrD,eAAO,MAAM,oBAAoB,wBAAwB,kBAAkB;;;
|
|
1
|
+
{"version":3,"file":"create-request-operation.test.d.ts","sourceRoot":"","sources":["../../../src/libs/send-request/create-request-operation.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,oBAAoB,EAIrB,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAS5B,eAAO,MAAM,QAAQ,0BAAkC,CAAA;AAEvD,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,KAAK,kBAAkB,GAAG;IACxB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,qDAAqD;AACrD,eAAO,MAAM,oBAAoB,wBAAwB,kBAAkB;;;sBAy7BrE,EAAA,KAAE;;;+CAC+B,EAAG,KAAK,gCACnC,EAAG,KAAK;qCAGA,EAAE,KAAK;2BACP,EAAG,KAAK;4BACpB,EAAA,KAAC;;;;;;uBAOkB,CAAC;;;;;;;;;;;;;uBAWd,CAAL;mBAGD,CAAP;kBACc,CAAC;mBAA0B,CAAC;iBAAwB,CAAC;oBAMlB,CAAC;qBAE3B,CAAC;uBACP,CAAA;;;;;;;iBAIsB,CAAC;gBAI5B,CAAC;;;;iBAEN,CAAH;gBACK,CAAJ;;;;iBAGyB,CAAC;gBAChB,CAAC;;;;;;;sBAiF6uT,EAAG,KAAK;;;;;oBAA0I,CAAC;;;;;2BAA8I,CAAC;wBAA0C,CAAC;2BAAwD,CAAC;+BAAiD,CAAC;2BAA6C,CAAC;4BAA+B,CAAC;4BAA+C,CAAC;0BAA8C,CAAC;wBAA0C,CAAC;wBAA4C,CAAC;4BAA+B,CAAC;;;;kBAA+H,CAAC;eAA+B,CAAC;;;wBAA2I,CAAC;;;;;;;;uBAA2L,CAAC;oBAAsC,CAAC;uBAAoD,CAAC;2BAA6C,CAAC;uBAAyC,CAAC;wBAA2B,CAAC;wBAA2C,CAAC;sBAA0C,CAAC;oBAAsC,CAAC;oBAAwC,CAAC;wBAA2B,CAAC;;;;;;uBAA0J,CAAC;oBAAsC,CAAC;uBAAoD,CAAC;2BAA6C,CAAC;uBAAyC,CAAC;wBAA2B,CAAC;wBAA2C,CAAC;sBAA0C,CAAC;oBAAsC,CAAC;oBAAwC,CAAC;wBAA2B,CAAC;;;;;;uBAA4J,CAAC;oBAAsC,CAAC;uBAAoD,CAAC;2BAA6C,CAAC;uBAAyC,CAAC;wBAA2B,CAAC;wBAA2C,CAAC;sBAA0C,CAAC;oBAAsC,CAAC;oBAAwC,CAAC;wBAA2B,CAAC;;;;;;uBAA4J,CAAC;oBAAsC,CAAC;uBAAoD,CAAC;2BAA6C,CAAC;uBAAyC,CAAC;wBAA2B,CAAC;wBAA2C,CAAC;sBAA0C,CAAC;oBAAsC,CAAC;oBAAwC,CAAC;wBAA2B,CAAC;;;+BAAqE,EAAG,KAAK;;;;sBAj1Bt/Z,EAAG,KAAK;;;;iBAI/C,CAAC;uBAEE,CAAC;mBAAqC,CAAC;gBAExD,CAAF;;;;;CA/NH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-template.d.ts","sourceRoot":"","sources":["../../src/libs/string-template.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAK5D;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"string-template.d.ts","sourceRoot":"","sources":["../../src/libs/string-template.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAK5D;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAkC/E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,sBAoBjD"}
|
|
@@ -1,28 +1,42 @@
|
|
|
1
|
-
import { REGEX as
|
|
2
|
-
function l
|
|
3
|
-
const
|
|
4
|
-
return typeof
|
|
1
|
+
import { REGEX as a } from "@scalar/oas-utils/helpers";
|
|
2
|
+
function c(l, o) {
|
|
3
|
+
const s = l.split(".").reduce((n, r) => n == null ? void 0 : n[r], o);
|
|
4
|
+
return typeof s == "string" ? s : JSON.stringify(s);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return
|
|
10
|
-
const
|
|
11
|
-
s
|
|
6
|
+
function p(l, o) {
|
|
7
|
+
let t = l;
|
|
8
|
+
const s = /* @__PURE__ */ new Set();
|
|
9
|
+
return t = t.replace(a.VARIABLES, (n, r) => {
|
|
10
|
+
const e = r.trim();
|
|
11
|
+
s.add(e);
|
|
12
|
+
const u = c(e, o);
|
|
13
|
+
return u ?? `{{${e}}}`;
|
|
14
|
+
}), t = t.replace(a.PATH, (n, r) => {
|
|
15
|
+
const e = r.trim();
|
|
16
|
+
if (s.has(e))
|
|
17
|
+
return `{${e}}`;
|
|
18
|
+
const u = c(e, o);
|
|
19
|
+
return u ?? `{${e}}`;
|
|
20
|
+
}), t = t.replace(/:\b[\w.]+\b/g, (n) => {
|
|
21
|
+
const r = n.slice(1);
|
|
22
|
+
if (s.has(r))
|
|
23
|
+
return n;
|
|
24
|
+
const e = c(r, o);
|
|
25
|
+
return e ?? n;
|
|
12
26
|
}), t;
|
|
13
27
|
}
|
|
14
|
-
function
|
|
15
|
-
function o(
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
const
|
|
19
|
-
typeof
|
|
20
|
-
}),
|
|
28
|
+
function f(l) {
|
|
29
|
+
function o(t, s) {
|
|
30
|
+
const n = Object.keys(t), r = [];
|
|
31
|
+
return n.forEach((e) => {
|
|
32
|
+
const u = s ? `${s}.${e}` : e;
|
|
33
|
+
typeof t[e] == "object" ? r.push(...o(t[e], u)) : r.push([u, String(t[e])]);
|
|
34
|
+
}), r;
|
|
21
35
|
}
|
|
22
|
-
return o(
|
|
36
|
+
return o(l);
|
|
23
37
|
}
|
|
24
38
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
39
|
+
f as flattenEnvVars,
|
|
40
|
+
c as getDotPathValue,
|
|
41
|
+
p as replaceTemplateVariables
|
|
28
42
|
};
|
package/dist/routes.d.ts
CHANGED
|
@@ -69,6 +69,11 @@ export declare const modalRoutes: ({
|
|
|
69
69
|
name: string;
|
|
70
70
|
};
|
|
71
71
|
children: ({
|
|
72
|
+
name: string;
|
|
73
|
+
path: string;
|
|
74
|
+
component: () => Promise<typeof import("./views/Collection/CollectionOverview.vue")>;
|
|
75
|
+
children?: never;
|
|
76
|
+
} | {
|
|
72
77
|
name: string;
|
|
73
78
|
path: string;
|
|
74
79
|
component: () => Promise<typeof import("./views/Collection/CollectionServers.vue")>;
|
|
@@ -77,11 +82,6 @@ export declare const modalRoutes: ({
|
|
|
77
82
|
path: string;
|
|
78
83
|
component: () => Promise<typeof import("./views/Collection/CollectionServers.vue")>;
|
|
79
84
|
}[];
|
|
80
|
-
} | {
|
|
81
|
-
name: string;
|
|
82
|
-
path: string;
|
|
83
|
-
component: () => Promise<typeof import("./views/Collection/CollectionSettings.vue")>;
|
|
84
|
-
children?: never;
|
|
85
85
|
})[];
|
|
86
86
|
})[];
|
|
87
87
|
}[];
|
|
@@ -133,6 +133,11 @@ export declare const routes: ({
|
|
|
133
133
|
name: string;
|
|
134
134
|
};
|
|
135
135
|
children: ({
|
|
136
|
+
name: string;
|
|
137
|
+
path: string;
|
|
138
|
+
component: () => Promise<typeof import("./views/Collection/CollectionOverview.vue")>;
|
|
139
|
+
children?: never;
|
|
140
|
+
} | {
|
|
136
141
|
name: string;
|
|
137
142
|
path: string;
|
|
138
143
|
component: () => Promise<typeof import("./views/Collection/CollectionServers.vue")>;
|
|
@@ -141,11 +146,6 @@ export declare const routes: ({
|
|
|
141
146
|
path: string;
|
|
142
147
|
component: () => Promise<typeof import("./views/Collection/CollectionServers.vue")>;
|
|
143
148
|
}[];
|
|
144
|
-
} | {
|
|
145
|
-
name: string;
|
|
146
|
-
path: string;
|
|
147
|
-
component: () => Promise<typeof import("./views/Collection/CollectionSettings.vue")>;
|
|
148
|
-
children?: never;
|
|
149
149
|
})[];
|
|
150
150
|
})[];
|
|
151
151
|
} | {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { flattenEnvVars as
|
|
2
|
-
import { environmentSchema as
|
|
3
|
-
import { isDefined as
|
|
4
|
-
import { computed as i, inject as
|
|
5
|
-
import { getRouterParams as
|
|
1
|
+
import { flattenEnvVars as C } from "../libs/string-template.js";
|
|
2
|
+
import { environmentSchema as k } from "@scalar/oas-utils/entities/environment";
|
|
3
|
+
import { isDefined as D } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { computed as i, inject as J } from "vue";
|
|
5
|
+
import { getRouterParams as M } from "./router-params.js";
|
|
6
6
|
import { PathId as m } from "../routes.js";
|
|
7
|
-
const
|
|
7
|
+
const Y = ({
|
|
8
8
|
collections: l,
|
|
9
|
-
requestExamples:
|
|
9
|
+
requestExamples: O,
|
|
10
10
|
requests: E,
|
|
11
11
|
router: N,
|
|
12
12
|
servers: p,
|
|
13
|
-
workspaces:
|
|
13
|
+
workspaces: I
|
|
14
14
|
}) => {
|
|
15
|
-
const s = i(
|
|
16
|
-
() =>
|
|
15
|
+
const s = i(M(N)), r = i(
|
|
16
|
+
() => I[s.value[m.Workspace]] ?? Object.values(I)[0]
|
|
17
17
|
), d = i(
|
|
18
18
|
() => {
|
|
19
19
|
var e;
|
|
20
|
-
return ((e = r.value) == null ? void 0 : e.collections.map((t) => l[t]).filter(
|
|
20
|
+
return ((e = r.value) == null ? void 0 : e.collections.map((t) => l[t]).filter(D).sort((t, n) => {
|
|
21
21
|
var v, o;
|
|
22
22
|
return ((v = t.info) == null ? void 0 : v.title) === "Drafts" ? 1 : ((o = n.info) == null ? void 0 : o.title) === "Drafts" ? -1 : 0;
|
|
23
23
|
})) ?? [];
|
|
@@ -32,22 +32,22 @@ const z = ({
|
|
|
32
32
|
var e;
|
|
33
33
|
return ((e = d.value) == null ? void 0 : e.flatMap((t) => t.requests)) ?? [];
|
|
34
34
|
}
|
|
35
|
-
),
|
|
36
|
-
var t, n, v, o, u, a, c,
|
|
35
|
+
), F = i(() => {
|
|
36
|
+
var t, n, v, o, u, a, c, b, y;
|
|
37
37
|
if (!((t = r.value) != null && t.activeEnvironmentId))
|
|
38
|
-
return
|
|
38
|
+
return k.parse({
|
|
39
39
|
uid: "default",
|
|
40
|
-
color: "#
|
|
40
|
+
color: "#FFFFFF",
|
|
41
41
|
name: "No Environment",
|
|
42
42
|
value: JSON.stringify((n = r.value) == null ? void 0 : n.environments, null, 2)
|
|
43
43
|
});
|
|
44
44
|
const e = d.value.find(
|
|
45
45
|
(j) => {
|
|
46
|
-
var
|
|
47
|
-
return (
|
|
46
|
+
var g, x;
|
|
47
|
+
return (x = j["x-scalar-environments"]) == null ? void 0 : x[((g = r.value) == null ? void 0 : g.activeEnvironmentId) ?? ""];
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
|
-
return e && ((v = r.value) != null && v.activeEnvironmentId) ?
|
|
50
|
+
return e && ((v = r.value) != null && v.activeEnvironmentId) ? k.parse({
|
|
51
51
|
uid: r.value.activeEnvironmentId,
|
|
52
52
|
name: r.value.activeEnvironmentId,
|
|
53
53
|
value: JSON.stringify(
|
|
@@ -55,11 +55,11 @@ const z = ({
|
|
|
55
55
|
null,
|
|
56
56
|
2
|
|
57
57
|
),
|
|
58
|
-
color: ((
|
|
58
|
+
color: ((y = (b = e["x-scalar-environments"]) == null ? void 0 : b[(c = r.value) == null ? void 0 : c.activeEnvironmentId]) == null ? void 0 : y.color) || "#FFFFFF",
|
|
59
59
|
isDefault: !1
|
|
60
|
-
}) :
|
|
60
|
+
}) : k.parse({
|
|
61
61
|
uid: "default",
|
|
62
|
-
color: "#
|
|
62
|
+
color: "#FFFFFF",
|
|
63
63
|
name: "No Environment",
|
|
64
64
|
value: JSON.stringify(r.value.environments, null, 2)
|
|
65
65
|
});
|
|
@@ -70,8 +70,8 @@ const z = ({
|
|
|
70
70
|
}), q = i(() => {
|
|
71
71
|
var t;
|
|
72
72
|
const e = s.value[m.Examples] === "default" ? ((t = f.value) == null ? void 0 : t.examples[0]) || "" : s.value[m.Examples];
|
|
73
|
-
return
|
|
74
|
-
}),
|
|
73
|
+
return O[e];
|
|
74
|
+
}), S = i(() => {
|
|
75
75
|
var v, o, u;
|
|
76
76
|
const e = l[s.value[m.Collection]];
|
|
77
77
|
if (e)
|
|
@@ -91,8 +91,8 @@ const z = ({
|
|
|
91
91
|
if (n)
|
|
92
92
|
return n;
|
|
93
93
|
}
|
|
94
|
-
if ((t =
|
|
95
|
-
const n = p[
|
|
94
|
+
if ((t = S.value) != null && t.selectedServerUid) {
|
|
95
|
+
const n = p[S.value.selectedServerUid];
|
|
96
96
|
if (n)
|
|
97
97
|
return n;
|
|
98
98
|
}
|
|
@@ -103,11 +103,11 @@ const z = ({
|
|
|
103
103
|
}
|
|
104
104
|
), W = i(() => {
|
|
105
105
|
var u;
|
|
106
|
-
const e = ((u = r.value) == null ? void 0 : u.environments) ?? {}, t =
|
|
106
|
+
const e = ((u = r.value) == null ? void 0 : u.environments) ?? {}, t = F.value.uid ? JSON.parse(F.value.value) : {}, n = C(e).map(([a, c]) => ({
|
|
107
107
|
key: a,
|
|
108
108
|
value: c,
|
|
109
109
|
source: "global"
|
|
110
|
-
})), v =
|
|
110
|
+
})), v = C(t).map(([a, c]) => ({
|
|
111
111
|
key: a,
|
|
112
112
|
value: c,
|
|
113
113
|
source: "collection"
|
|
@@ -119,12 +119,12 @@ const z = ({
|
|
|
119
119
|
}), Array.from(o.values());
|
|
120
120
|
});
|
|
121
121
|
return {
|
|
122
|
-
activeCollection:
|
|
122
|
+
activeCollection: S,
|
|
123
123
|
activeCookieId: R,
|
|
124
124
|
activeExample: q,
|
|
125
125
|
activeRequest: f,
|
|
126
126
|
activeRouterParams: s,
|
|
127
|
-
activeEnvironment:
|
|
127
|
+
activeEnvironment: F,
|
|
128
128
|
activeServer: A,
|
|
129
129
|
activeWorkspace: r,
|
|
130
130
|
activeWorkspaceCollections: d,
|
|
@@ -132,14 +132,14 @@ const z = ({
|
|
|
132
132
|
activeEnvVariables: W,
|
|
133
133
|
activeWorkspaceRequests: U
|
|
134
134
|
};
|
|
135
|
-
},
|
|
136
|
-
const l =
|
|
135
|
+
}, P = Symbol(), z = () => {
|
|
136
|
+
const l = J(P);
|
|
137
137
|
if (!l)
|
|
138
138
|
throw new Error("Active entities store not provided");
|
|
139
139
|
return l;
|
|
140
140
|
};
|
|
141
141
|
export {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
P as ACTIVE_ENTITIES_SYMBOL,
|
|
143
|
+
Y as createActiveEntitiesStore,
|
|
144
|
+
z as useActiveEntities
|
|
145
145
|
};
|
|
@@ -4,8 +4,8 @@ import { type Collection, type SecurityScheme, type SecuritySchemePayload } from
|
|
|
4
4
|
export declare function createStoreSecuritySchemes(useLocalStorage: boolean): {
|
|
5
5
|
securitySchemes: Record<string, {
|
|
6
6
|
name: string;
|
|
7
|
-
type: "apiKey";
|
|
8
7
|
value: string;
|
|
8
|
+
type: "apiKey";
|
|
9
9
|
uid: string & import("zod").BRAND<"securityScheme">;
|
|
10
10
|
nameKey: string;
|
|
11
11
|
in: "cookie" | "query" | "header";
|
|
@@ -83,8 +83,8 @@ export declare function createStoreSecuritySchemes(useLocalStorage: boolean): {
|
|
|
83
83
|
securitySchemeMutators: {
|
|
84
84
|
add: (item: {
|
|
85
85
|
name: string;
|
|
86
|
-
type: "apiKey";
|
|
87
86
|
value: string;
|
|
87
|
+
type: "apiKey";
|
|
88
88
|
uid: string & import("zod").BRAND<"securityScheme">;
|
|
89
89
|
nameKey: string;
|
|
90
90
|
in: "cookie" | "query" | "header";
|
|
@@ -162,8 +162,8 @@ export declare function createStoreSecuritySchemes(useLocalStorage: boolean): {
|
|
|
162
162
|
delete: (uid: (string & import("zod").BRAND<"securityScheme">) | null | undefined) => void;
|
|
163
163
|
set: (item: {
|
|
164
164
|
name: string;
|
|
165
|
-
type: "apiKey";
|
|
166
165
|
value: string;
|
|
166
|
+
type: "apiKey";
|
|
167
167
|
uid: string & import("zod").BRAND<"securityScheme">;
|
|
168
168
|
nameKey: string;
|
|
169
169
|
in: "cookie" | "query" | "header";
|
|
@@ -240,24 +240,24 @@ export declare function createStoreSecuritySchemes(useLocalStorage: boolean): {
|
|
|
240
240
|
}) => void;
|
|
241
241
|
edit: <P extends "value" | "description" | "type" | "name" | "in" | "uid" | "nameKey" | "scheme" | "bearerFormat" | "openIdConnectUrl" | "x-default-scopes" | "flows" | "password" | "username" | "token" | `x-default-scopes.${number}` | "flows.password" | "flows.implicit" | "flows.clientCredentials" | "flows.authorizationCode" | "flows.password.type" | "flows.password.password" | "flows.password.username" | "flows.password.token" | "flows.password.refreshUrl" | "flows.password.scopes" | "flows.password.selectedScopes" | "flows.password.x-scalar-client-id" | "flows.password.tokenUrl" | "flows.password.clientSecret" | `flows.password.scopes.${string}` | `flows.password.selectedScopes.${number}` | "flows.implicit.type" | "flows.implicit.token" | "flows.implicit.refreshUrl" | "flows.implicit.scopes" | "flows.implicit.selectedScopes" | "flows.implicit.x-scalar-client-id" | `flows.implicit.scopes.${string}` | `flows.implicit.selectedScopes.${number}` | "flows.implicit.authorizationUrl" | "flows.implicit.x-scalar-redirect-uri" | "flows.clientCredentials.type" | "flows.clientCredentials.token" | "flows.clientCredentials.refreshUrl" | "flows.clientCredentials.scopes" | "flows.clientCredentials.selectedScopes" | "flows.clientCredentials.x-scalar-client-id" | "flows.clientCredentials.tokenUrl" | "flows.clientCredentials.clientSecret" | `flows.clientCredentials.scopes.${string}` | `flows.clientCredentials.selectedScopes.${number}` | "flows.authorizationCode.type" | "flows.authorizationCode.token" | "flows.authorizationCode.refreshUrl" | "flows.authorizationCode.scopes" | "flows.authorizationCode.selectedScopes" | "flows.authorizationCode.x-scalar-client-id" | "flows.authorizationCode.tokenUrl" | "flows.authorizationCode.clientSecret" | `flows.authorizationCode.scopes.${string}` | `flows.authorizationCode.selectedScopes.${number}` | "flows.authorizationCode.authorizationUrl" | "flows.authorizationCode.x-scalar-redirect-uri" | "flows.authorizationCode.x-usePkce">(uid: (string & import("zod").BRAND<"securityScheme">) | null | undefined, path: P, value: (P extends "value" | "description" | "type" | "name" | "in" | "uid" | "nameKey" ? {
|
|
242
242
|
name: string;
|
|
243
|
-
type: "apiKey";
|
|
244
243
|
value: string;
|
|
244
|
+
type: "apiKey";
|
|
245
245
|
uid: string & import("zod").BRAND<"securityScheme">;
|
|
246
246
|
nameKey: string;
|
|
247
247
|
in: "cookie" | "query" | "header";
|
|
248
248
|
description?: string | undefined;
|
|
249
249
|
}[P] : P extends `${infer K}.${infer R}` ? K extends "value" | "description" | "type" | "name" | "in" | "uid" | "nameKey" ? R extends import("@scalar/object-utils/nested").Path<{
|
|
250
250
|
name: string;
|
|
251
|
-
type: "apiKey";
|
|
252
251
|
value: string;
|
|
252
|
+
type: "apiKey";
|
|
253
253
|
uid: string & import("zod").BRAND<"securityScheme">;
|
|
254
254
|
nameKey: string;
|
|
255
255
|
in: "cookie" | "query" | "header";
|
|
256
256
|
description?: string | undefined;
|
|
257
257
|
}[K]> ? import("@scalar/object-utils/nested").PathValue<{
|
|
258
258
|
name: string;
|
|
259
|
-
type: "apiKey";
|
|
260
259
|
value: string;
|
|
260
|
+
type: "apiKey";
|
|
261
261
|
uid: string & import("zod").BRAND<"securityScheme">;
|
|
262
262
|
nameKey: string;
|
|
263
263
|
in: "cookie" | "query" | "header";
|
|
@@ -472,24 +472,24 @@ export declare function createStoreSecuritySchemes(useLocalStorage: boolean): {
|
|
|
472
472
|
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never)) => void;
|
|
473
473
|
untrackedEdit: <P extends "value" | "description" | "type" | "name" | "in" | "uid" | "nameKey" | "scheme" | "bearerFormat" | "openIdConnectUrl" | "x-default-scopes" | "flows" | "password" | "username" | "token" | `x-default-scopes.${number}` | "flows.password" | "flows.implicit" | "flows.clientCredentials" | "flows.authorizationCode" | "flows.password.type" | "flows.password.password" | "flows.password.username" | "flows.password.token" | "flows.password.refreshUrl" | "flows.password.scopes" | "flows.password.selectedScopes" | "flows.password.x-scalar-client-id" | "flows.password.tokenUrl" | "flows.password.clientSecret" | `flows.password.scopes.${string}` | `flows.password.selectedScopes.${number}` | "flows.implicit.type" | "flows.implicit.token" | "flows.implicit.refreshUrl" | "flows.implicit.scopes" | "flows.implicit.selectedScopes" | "flows.implicit.x-scalar-client-id" | `flows.implicit.scopes.${string}` | `flows.implicit.selectedScopes.${number}` | "flows.implicit.authorizationUrl" | "flows.implicit.x-scalar-redirect-uri" | "flows.clientCredentials.type" | "flows.clientCredentials.token" | "flows.clientCredentials.refreshUrl" | "flows.clientCredentials.scopes" | "flows.clientCredentials.selectedScopes" | "flows.clientCredentials.x-scalar-client-id" | "flows.clientCredentials.tokenUrl" | "flows.clientCredentials.clientSecret" | `flows.clientCredentials.scopes.${string}` | `flows.clientCredentials.selectedScopes.${number}` | "flows.authorizationCode.type" | "flows.authorizationCode.token" | "flows.authorizationCode.refreshUrl" | "flows.authorizationCode.scopes" | "flows.authorizationCode.selectedScopes" | "flows.authorizationCode.x-scalar-client-id" | "flows.authorizationCode.tokenUrl" | "flows.authorizationCode.clientSecret" | `flows.authorizationCode.scopes.${string}` | `flows.authorizationCode.selectedScopes.${number}` | "flows.authorizationCode.authorizationUrl" | "flows.authorizationCode.x-scalar-redirect-uri" | "flows.authorizationCode.x-usePkce">(uid: string & import("zod").BRAND<"securityScheme">, path: P, value: (P extends "value" | "description" | "type" | "name" | "in" | "uid" | "nameKey" ? {
|
|
474
474
|
name: string;
|
|
475
|
-
type: "apiKey";
|
|
476
475
|
value: string;
|
|
476
|
+
type: "apiKey";
|
|
477
477
|
uid: string & import("zod").BRAND<"securityScheme">;
|
|
478
478
|
nameKey: string;
|
|
479
479
|
in: "cookie" | "query" | "header";
|
|
480
480
|
description?: string | undefined;
|
|
481
481
|
}[P] : P extends `${infer K}.${infer R}` ? K extends "value" | "description" | "type" | "name" | "in" | "uid" | "nameKey" ? R extends import("@scalar/object-utils/nested").Path<{
|
|
482
482
|
name: string;
|
|
483
|
-
type: "apiKey";
|
|
484
483
|
value: string;
|
|
484
|
+
type: "apiKey";
|
|
485
485
|
uid: string & import("zod").BRAND<"securityScheme">;
|
|
486
486
|
nameKey: string;
|
|
487
487
|
in: "cookie" | "query" | "header";
|
|
488
488
|
description?: string | undefined;
|
|
489
489
|
}[K]> ? import("@scalar/object-utils/nested").PathValue<{
|
|
490
490
|
name: string;
|
|
491
|
-
type: "apiKey";
|
|
492
491
|
value: string;
|
|
492
|
+
type: "apiKey";
|
|
493
493
|
uid: string & import("zod").BRAND<"securityScheme">;
|
|
494
494
|
nameKey: string;
|
|
495
495
|
in: "cookie" | "query" | "header";
|
|
@@ -711,8 +711,8 @@ export declare function createStoreSecuritySchemes(useLocalStorage: boolean): {
|
|
|
711
711
|
export declare function extendedSecurityDataFactory({ securitySchemeMutators, collectionMutators, collections, requests, requestMutators, }: StoreContext): {
|
|
712
712
|
addSecurityScheme: (payload: SecuritySchemePayload, collectionUid: Collection["uid"]) => {
|
|
713
713
|
name: string;
|
|
714
|
-
type: "apiKey";
|
|
715
714
|
value: string;
|
|
715
|
+
type: "apiKey";
|
|
716
716
|
uid: string & import("zod").BRAND<"securityScheme">;
|
|
717
717
|
nameKey: string;
|
|
718
718
|
in: "cookie" | "query" | "header";
|