@scalar/api-client 2.2.16 → 2.2.18
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 +31 -0
- package/dist/components/SideNav/SideNav.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarListElement.vue2.js +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +2 -2
- package/dist/layouts/Web/create-api-client-web.d.ts +1 -1
- 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 +51 -64
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +43 -41
- package/dist/style.css +1 -1
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +42 -42
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +11 -11
package/dist/store/store.js
CHANGED
|
@@ -3,64 +3,66 @@ import { createStoreCookies as L } from "./cookies.js";
|
|
|
3
3
|
import { createStoreEnvironments as ee, extendedEnvironmentDataFactory as te } from "./environment.js";
|
|
4
4
|
import { createStoreEvents as re } from "./events.js";
|
|
5
5
|
import { importSpecFileFactory as oe } from "./import-spec.js";
|
|
6
|
-
import { createStoreRequestExamples as se, extendedExampleDataFactory as
|
|
7
|
-
import { createStoreRequests as
|
|
8
|
-
import { createStoreSecuritySchemes as
|
|
6
|
+
import { createStoreRequestExamples as se, extendedExampleDataFactory as de } from "./request-example.js";
|
|
7
|
+
import { createStoreRequests as ae, extendedRequestDataFactory as ne } from "./requests.js";
|
|
8
|
+
import { createStoreSecuritySchemes as ce, extendedSecurityDataFactory as ie } from "./security-schemes.js";
|
|
9
9
|
import { createStoreServers as me, extendedServerDataFactory as le } from "./servers.js";
|
|
10
10
|
import { createStoreTags as pe, extendedTagDataFactory as ue } from "./tags.js";
|
|
11
|
-
import { createStoreWorkspaces as
|
|
11
|
+
import { createStoreWorkspaces as ve, extendedWorkspaceDataFactory as Se } from "./workspace.js";
|
|
12
12
|
import { useModal as fe } from "@scalar/components";
|
|
13
13
|
import { reactive as ye, ref as Ee, toRaw as r, inject as Me } from "vue";
|
|
14
|
-
const
|
|
14
|
+
const je = ({
|
|
15
15
|
useLocalStorage: e = !0,
|
|
16
16
|
isReadOnly: D = !1,
|
|
17
|
-
proxyUrl:
|
|
17
|
+
proxyUrl: a,
|
|
18
18
|
themeId: q,
|
|
19
19
|
hideClientButton: A
|
|
20
20
|
}) => {
|
|
21
|
-
const { collections:
|
|
22
|
-
collections:
|
|
23
|
-
collectionMutators:
|
|
21
|
+
const { collections: n, collectionMutators: c } = $(e), { tags: i, tagMutators: m } = pe(e), { requests: l, requestMutators: p } = ae(e), { requestExamples: u, requestExampleMutators: v } = se(e), { cookies: S, cookieMutators: w } = L(e), { environments: f, environmentMutators: k } = ee(e), { servers: y, serverMutators: E } = me(e), { securitySchemes: M, securitySchemeMutators: x } = ce(e), { workspaces: d, workspaceMutators: o } = ve(e), t = {
|
|
22
|
+
collections: n,
|
|
23
|
+
collectionMutators: c,
|
|
24
24
|
tags: i,
|
|
25
25
|
tagMutators: m,
|
|
26
26
|
requests: l,
|
|
27
27
|
requestMutators: p,
|
|
28
28
|
requestExamples: u,
|
|
29
|
-
requestExampleMutators:
|
|
30
|
-
cookies:
|
|
31
|
-
cookieMutators:
|
|
29
|
+
requestExampleMutators: v,
|
|
30
|
+
cookies: S,
|
|
31
|
+
cookieMutators: w,
|
|
32
32
|
environments: f,
|
|
33
|
-
environmentMutators:
|
|
33
|
+
environmentMutators: k,
|
|
34
34
|
servers: y,
|
|
35
35
|
serverMutators: E,
|
|
36
36
|
securitySchemes: M,
|
|
37
37
|
securitySchemeMutators: x,
|
|
38
|
-
workspaces:
|
|
38
|
+
workspaces: d,
|
|
39
39
|
workspaceMutators: o
|
|
40
|
-
}, { addTag: h, deleteTag: b } = ue(t), { addRequest: T, deleteRequest:
|
|
41
|
-
|
|
40
|
+
}, { addTag: h, deleteTag: b } = ue(t), { addRequest: T, deleteRequest: O, findRequestParents: j } = ne(t, h), { deleteEnvironment: I } = te(t), { addServer: P, deleteServer: g } = le(t), { addCollection: B, deleteCollection: H } = C(t), { addRequestExample: K, deleteRequestExample: Y } = de(t), { addWorkspace: _, deleteWorkspace: z } = Se(t), { addSecurityScheme: G, deleteSecurityScheme: J } = ie(t), { addCollectionEnvironment: F, removeCollectionEnvironment: W } = C(t), N = ye([]), { importSpecFile: Q, importSpecFromUrl: U } = oe(t), R = Ee(
|
|
41
|
+
(e ? localStorage == null ? void 0 : localStorage.getItem("sidebarWidth") : void 0) || "280px"
|
|
42
|
+
), V = (s) => {
|
|
43
|
+
R.value = s, e && (localStorage == null || localStorage.setItem("sidebarWidth", s));
|
|
42
44
|
}, X = fe();
|
|
43
|
-
Object.keys(
|
|
44
|
-
|
|
45
|
-
}), window.dataDump = () => ({
|
|
46
|
-
collections: r(
|
|
47
|
-
cookies: r(
|
|
45
|
+
Object.keys(d).forEach((s) => {
|
|
46
|
+
a && o.edit(s, "proxyUrl", a), q && o.edit(s, "themeId", q);
|
|
47
|
+
}), typeof window < "u" && (window.dataDump = () => ({
|
|
48
|
+
collections: r(n),
|
|
49
|
+
cookies: r(S),
|
|
48
50
|
environments: r(f),
|
|
49
51
|
requestExamples: r(u),
|
|
50
52
|
requests: r(l),
|
|
51
53
|
securitySchemes: r(M),
|
|
52
54
|
servers: r(y),
|
|
53
55
|
tags: r(i),
|
|
54
|
-
workspaces: r(
|
|
55
|
-
});
|
|
56
|
+
workspaces: r(d)
|
|
57
|
+
}));
|
|
56
58
|
const Z = re();
|
|
57
59
|
return {
|
|
58
60
|
// ---------------------------------------------------------------------------
|
|
59
61
|
// STATE
|
|
60
|
-
workspaces:
|
|
61
|
-
collections:
|
|
62
|
+
workspaces: d,
|
|
63
|
+
collections: n,
|
|
62
64
|
tags: i,
|
|
63
|
-
cookies:
|
|
65
|
+
cookies: S,
|
|
64
66
|
environments: f,
|
|
65
67
|
requestExamples: u,
|
|
66
68
|
requests: l,
|
|
@@ -68,7 +70,7 @@ const Oe = ({
|
|
|
68
70
|
securitySchemes: M,
|
|
69
71
|
modalState: X,
|
|
70
72
|
events: Z,
|
|
71
|
-
proxyUrl:
|
|
73
|
+
proxyUrl: a,
|
|
72
74
|
sidebarWidth: R,
|
|
73
75
|
setSidebarWidth: V,
|
|
74
76
|
isReadOnly: D,
|
|
@@ -77,29 +79,29 @@ const Oe = ({
|
|
|
77
79
|
// METHODS
|
|
78
80
|
importSpecFile: Q,
|
|
79
81
|
importSpecFromUrl: U,
|
|
80
|
-
cookieMutators:
|
|
82
|
+
cookieMutators: w,
|
|
81
83
|
collectionMutators: {
|
|
82
|
-
...
|
|
83
|
-
rawAdd:
|
|
84
|
+
...c,
|
|
85
|
+
rawAdd: c.add,
|
|
84
86
|
add: B,
|
|
85
87
|
delete: H,
|
|
86
88
|
addEnvironment: F,
|
|
87
89
|
removeEnvironment: W
|
|
88
90
|
},
|
|
89
91
|
environmentMutators: {
|
|
90
|
-
...
|
|
91
|
-
delete:
|
|
92
|
+
...k,
|
|
93
|
+
delete: I
|
|
92
94
|
},
|
|
93
95
|
requestMutators: {
|
|
94
96
|
...p,
|
|
95
97
|
rawAdd: p.add,
|
|
96
98
|
add: T,
|
|
97
|
-
delete:
|
|
99
|
+
delete: O
|
|
98
100
|
},
|
|
99
|
-
findRequestParents:
|
|
101
|
+
findRequestParents: j,
|
|
100
102
|
requestExampleMutators: {
|
|
101
|
-
...
|
|
102
|
-
rawAdd:
|
|
103
|
+
...v,
|
|
104
|
+
rawAdd: v.add,
|
|
103
105
|
add: K,
|
|
104
106
|
delete: Y
|
|
105
107
|
},
|
|
@@ -113,8 +115,8 @@ const Oe = ({
|
|
|
113
115
|
serverMutators: {
|
|
114
116
|
...E,
|
|
115
117
|
rawAdd: E.add,
|
|
116
|
-
add:
|
|
117
|
-
delete:
|
|
118
|
+
add: P,
|
|
119
|
+
delete: g
|
|
118
120
|
},
|
|
119
121
|
tagMutators: {
|
|
120
122
|
...m,
|
|
@@ -131,13 +133,13 @@ const Oe = ({
|
|
|
131
133
|
addCollectionEnvironment: F,
|
|
132
134
|
removeCollectionEnvironment: W
|
|
133
135
|
};
|
|
134
|
-
}, xe = Symbol(),
|
|
136
|
+
}, xe = Symbol(), Ie = () => {
|
|
135
137
|
const e = Me(xe);
|
|
136
138
|
if (!e) throw new Error("Workspace store not provided");
|
|
137
139
|
return e;
|
|
138
140
|
};
|
|
139
141
|
export {
|
|
140
142
|
xe as WORKSPACE_SYMBOL,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
je as createWorkspaceStore,
|
|
144
|
+
Ie as useWorkspace
|
|
143
145
|
};
|