@scalar/api-client 2.2.62 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/README.md +2 -6
- 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 +38 -38
- 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 +21 -21
- package/dist/components/DataTable/DataTableHeader.vue.js +9 -9
- package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -0
- 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 +48 -47
- package/dist/components/DataTable/DataTableRow.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableRow.vue.js +8 -8
- package/dist/components/SectionFilter.vue.js +2 -2
- package/dist/components/Server/ServerDropdown.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerDropdown.vue.js +49 -38
- package/dist/components/Server/ServerDropdownItem.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
- package/dist/components/Server/ServerDropdownItem.vue2.js +49 -46
- package/dist/components/Sidebar/Actions/EditSidebarListCollection.vue.js +7 -7
- package/dist/components/Sidebar/Actions/EditSidebarListElement.vue.js +3 -3
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.js +13 -14
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.js +18 -19
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.js +13 -14
- package/dist/libs/create-client.d.ts +1 -1
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +20 -20
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +69 -64
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestRoot.vue.js +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +71 -64
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +8 -7
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +21 -23
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +74 -63
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +31 -31
- 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 +120 -96
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +32 -27
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +10 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { flattenEnvVars as O } from "../libs/string-template.js";
|
|
2
|
-
import { environmentSchema as
|
|
3
|
-
import { isDefined as
|
|
4
|
-
import { computed as i, inject as
|
|
2
|
+
import { environmentSchema as I } from "@scalar/oas-utils/entities/environment";
|
|
3
|
+
import { isDefined as J } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { computed as i, inject as M } from "vue";
|
|
5
5
|
import { getRouterParams as P } from "./router-params.js";
|
|
6
6
|
import { PathId as m } from "../routes.js";
|
|
7
7
|
const z = ({
|
|
@@ -9,122 +9,127 @@ const z = ({
|
|
|
9
9
|
requestExamples: D,
|
|
10
10
|
requests: E,
|
|
11
11
|
router: N,
|
|
12
|
-
servers:
|
|
12
|
+
servers: p,
|
|
13
13
|
workspaces: b
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
() => b[
|
|
17
|
-
),
|
|
15
|
+
const s = i(P(N)), r = i(
|
|
16
|
+
() => b[s.value[m.Workspace]] ?? Object.values(b)[0]
|
|
17
|
+
), d = i(
|
|
18
18
|
() => {
|
|
19
19
|
var e;
|
|
20
|
-
return ((e =
|
|
21
|
-
var
|
|
22
|
-
return ((
|
|
20
|
+
return ((e = r.value) == null ? void 0 : e.collections.map((t) => l[t]).filter(J).sort((t, n) => {
|
|
21
|
+
var v, o;
|
|
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
|
})) ?? [];
|
|
24
24
|
}
|
|
25
25
|
), h = i(
|
|
26
26
|
() => {
|
|
27
27
|
var e;
|
|
28
|
-
return (e =
|
|
28
|
+
return (e = d.value) == null ? void 0 : e.flatMap((t) => t.servers.map((n) => p[n]));
|
|
29
29
|
}
|
|
30
|
-
),
|
|
30
|
+
), U = i(
|
|
31
31
|
() => {
|
|
32
32
|
var e;
|
|
33
|
-
return ((e =
|
|
33
|
+
return ((e = d.value) == null ? void 0 : e.flatMap((t) => t.requests)) ?? [];
|
|
34
34
|
}
|
|
35
|
-
),
|
|
36
|
-
var t, n,
|
|
37
|
-
if (!((t =
|
|
38
|
-
return
|
|
35
|
+
), S = i(() => {
|
|
36
|
+
var t, n, v, o, u, a, c, y, g;
|
|
37
|
+
if (!((t = r.value) != null && t.activeEnvironmentId))
|
|
38
|
+
return I.parse({
|
|
39
39
|
uid: "default",
|
|
40
40
|
color: "#0082D0",
|
|
41
41
|
name: "No Environment",
|
|
42
|
-
value: JSON.stringify((n =
|
|
42
|
+
value: JSON.stringify((n = r.value) == null ? void 0 : n.environments, null, 2)
|
|
43
43
|
});
|
|
44
|
-
const e =
|
|
45
|
-
(
|
|
44
|
+
const e = d.value.find(
|
|
45
|
+
(j) => {
|
|
46
46
|
var x, C;
|
|
47
|
-
return (C =
|
|
47
|
+
return (C = j["x-scalar-environments"]) == null ? void 0 : C[((x = r.value) == null ? void 0 : x.activeEnvironmentId) ?? ""];
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
|
-
return e && ((
|
|
51
|
-
uid:
|
|
52
|
-
name:
|
|
50
|
+
return e && ((v = r.value) != null && v.activeEnvironmentId) ? I.parse({
|
|
51
|
+
uid: r.value.activeEnvironmentId,
|
|
52
|
+
name: r.value.activeEnvironmentId,
|
|
53
53
|
value: JSON.stringify(
|
|
54
|
-
(
|
|
54
|
+
(a = (u = e["x-scalar-environments"]) == null ? void 0 : u[(o = r.value) == null ? void 0 : o.activeEnvironmentId]) == null ? void 0 : a.variables,
|
|
55
55
|
null,
|
|
56
56
|
2
|
|
57
57
|
),
|
|
58
|
-
color: ((g = (y = e["x-scalar-environments"]) == null ? void 0 : y[(c =
|
|
58
|
+
color: ((g = (y = e["x-scalar-environments"]) == null ? void 0 : y[(c = r.value) == null ? void 0 : c.activeEnvironmentId]) == null ? void 0 : g.color) || "#0082D0",
|
|
59
59
|
isDefault: !1
|
|
60
|
-
}) :
|
|
60
|
+
}) : I.parse({
|
|
61
61
|
uid: "default",
|
|
62
62
|
color: "#0082D0",
|
|
63
63
|
name: "No Environment",
|
|
64
|
-
value: JSON.stringify(
|
|
64
|
+
value: JSON.stringify(r.value.environments, null, 2)
|
|
65
65
|
});
|
|
66
|
-
}),
|
|
66
|
+
}), f = i(() => {
|
|
67
67
|
var n;
|
|
68
|
-
const e =
|
|
68
|
+
const e = s.value[m.Request], t = l[s.value.collection] || l[((n = r.value) == null ? void 0 : n.collections[0]) ?? ""];
|
|
69
69
|
return E[e] || E[(t == null ? void 0 : t.requests[0]) ?? ""] || Object.values(E)[0];
|
|
70
|
-
}),
|
|
70
|
+
}), q = i(() => {
|
|
71
71
|
var t;
|
|
72
|
-
const e =
|
|
72
|
+
const e = s.value[m.Examples] === "default" ? ((t = f.value) == null ? void 0 : t.examples[0]) || "" : s.value[m.Examples];
|
|
73
73
|
return D[e];
|
|
74
74
|
}), k = i(() => {
|
|
75
|
-
var
|
|
76
|
-
const e = l[
|
|
75
|
+
var v, o, u;
|
|
76
|
+
const e = l[s.value[m.Collection]];
|
|
77
77
|
if (e) return e;
|
|
78
|
-
const t = (
|
|
79
|
-
if (t) return Object.values(l).find((
|
|
78
|
+
const t = (v = f.value) == null ? void 0 : v.uid;
|
|
79
|
+
if (t) return Object.values(l).find((a) => {
|
|
80
80
|
var c;
|
|
81
|
-
return (c =
|
|
81
|
+
return (c = a.requests) == null ? void 0 : c.includes(t);
|
|
82
82
|
});
|
|
83
|
-
const n = ((o =
|
|
83
|
+
const n = ((o = r.value) == null ? void 0 : o.collections[0]) ?? ((u = l[0]) == null ? void 0 : u.uid) ?? "";
|
|
84
84
|
return l[n];
|
|
85
|
-
}),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
}), A = i(() => {
|
|
86
|
+
var e, t;
|
|
87
|
+
if ((e = f.value) != null && e.selectedServerUid) {
|
|
88
|
+
const n = p[f.value.selectedServerUid];
|
|
89
|
+
if (n) return n;
|
|
90
|
+
}
|
|
91
|
+
if ((t = k.value) != null && t.selectedServerUid) {
|
|
92
|
+
const n = p[k.value.selectedServerUid];
|
|
93
|
+
if (n) return n;
|
|
89
94
|
}
|
|
90
|
-
),
|
|
95
|
+
}), R = i(
|
|
91
96
|
() => {
|
|
92
97
|
var e;
|
|
93
|
-
return
|
|
98
|
+
return s.value[m.Cookies] === "default" ? ((e = r.value) == null ? void 0 : e.cookies[0]) ?? "default" : s.value[m.Cookies];
|
|
94
99
|
}
|
|
95
|
-
),
|
|
100
|
+
), W = i(() => {
|
|
96
101
|
var u;
|
|
97
|
-
const e = ((u =
|
|
98
|
-
key:
|
|
102
|
+
const e = ((u = r.value) == null ? void 0 : u.environments) ?? {}, t = S.value.uid ? JSON.parse(S.value.value) : {}, n = O(e).map(([a, c]) => ({
|
|
103
|
+
key: a,
|
|
99
104
|
value: c,
|
|
100
105
|
source: "global"
|
|
101
|
-
})),
|
|
102
|
-
key:
|
|
106
|
+
})), v = O(t).map(([a, c]) => ({
|
|
107
|
+
key: a,
|
|
103
108
|
value: c,
|
|
104
109
|
source: "collection"
|
|
105
110
|
})), o = /* @__PURE__ */ new Map();
|
|
106
|
-
return
|
|
107
|
-
o.set(
|
|
108
|
-
}), n.forEach((
|
|
109
|
-
o.has(
|
|
111
|
+
return v.forEach((a) => {
|
|
112
|
+
o.set(a.key, a);
|
|
113
|
+
}), n.forEach((a) => {
|
|
114
|
+
o.has(a.key) || o.set(a.key, a);
|
|
110
115
|
}), Array.from(o.values());
|
|
111
116
|
});
|
|
112
117
|
return {
|
|
113
118
|
activeCollection: k,
|
|
114
|
-
activeCookieId:
|
|
115
|
-
activeExample:
|
|
116
|
-
activeRequest:
|
|
117
|
-
activeRouterParams:
|
|
118
|
-
activeEnvironment:
|
|
119
|
-
activeServer:
|
|
120
|
-
activeWorkspace:
|
|
121
|
-
activeWorkspaceCollections:
|
|
119
|
+
activeCookieId: R,
|
|
120
|
+
activeExample: q,
|
|
121
|
+
activeRequest: f,
|
|
122
|
+
activeRouterParams: s,
|
|
123
|
+
activeEnvironment: S,
|
|
124
|
+
activeServer: A,
|
|
125
|
+
activeWorkspace: r,
|
|
126
|
+
activeWorkspaceCollections: d,
|
|
122
127
|
activeWorkspaceServers: h,
|
|
123
|
-
activeEnvVariables:
|
|
124
|
-
activeWorkspaceRequests:
|
|
128
|
+
activeEnvVariables: W,
|
|
129
|
+
activeWorkspaceRequests: U
|
|
125
130
|
};
|
|
126
131
|
}, T = Symbol(), F = () => {
|
|
127
|
-
const l =
|
|
132
|
+
const l = M(T);
|
|
128
133
|
if (!l) throw new Error("Active entities store not provided");
|
|
129
134
|
return l;
|
|
130
135
|
};
|