@scalar/api-client 2.2.23 → 2.2.24
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 +12 -0
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +63 -55
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServerItem.vue.js +17 -16
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +97 -97
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cA+S8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA2ajD,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Request.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-90ff0226"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as se, ref as
|
|
1
|
+
import { defineComponent as se, ref as h, computed as H, watch as ue, onMounted as le, onBeforeUnmount as ae, openBlock as x, createElementBlock as ie, Fragment as ne, createElementVNode as V, normalizeClass as W, unref as l, createBlock as C, createCommentVNode as N, createVNode as U, withCtx as _ } from "vue";
|
|
2
2
|
import ce from "../../components/ImportCurl/ImportCurlModal.vue.js";
|
|
3
3
|
import me from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
4
4
|
import de from "../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
@@ -22,164 +22,164 @@ const Ce = { class: "flex h-full" }, Ne = { class: "flex flex-1 flex-col h-full"
|
|
|
22
22
|
__name: "Request",
|
|
23
23
|
emits: ["newTab"],
|
|
24
24
|
setup(Be) {
|
|
25
|
-
const
|
|
26
|
-
activeCollection:
|
|
27
|
-
activeExample:
|
|
28
|
-
activeEnvironment:
|
|
29
|
-
activeRequest:
|
|
30
|
-
activeWorkspace:
|
|
31
|
-
activeServer:
|
|
32
|
-
activeWorkspaceCollections:
|
|
25
|
+
const $ = Oe(), { toast: B } = xe(), { layout: j } = Ve(), {
|
|
26
|
+
activeCollection: p,
|
|
27
|
+
activeExample: S,
|
|
28
|
+
activeEnvironment: g,
|
|
29
|
+
activeRequest: k,
|
|
30
|
+
activeWorkspace: y,
|
|
31
|
+
activeServer: z,
|
|
32
|
+
activeWorkspaceCollections: F
|
|
33
33
|
} = fe(), {
|
|
34
|
-
cookies:
|
|
35
|
-
isReadOnly:
|
|
36
|
-
modalState:
|
|
37
|
-
requestHistory:
|
|
38
|
-
showSidebar:
|
|
39
|
-
securitySchemes:
|
|
40
|
-
requestMutators:
|
|
41
|
-
serverMutators:
|
|
42
|
-
servers:
|
|
43
|
-
events:
|
|
44
|
-
} =
|
|
45
|
-
() =>
|
|
34
|
+
cookies: Q,
|
|
35
|
+
isReadOnly: w,
|
|
36
|
+
modalState: i,
|
|
37
|
+
requestHistory: I,
|
|
38
|
+
showSidebar: J,
|
|
39
|
+
securitySchemes: G,
|
|
40
|
+
requestMutators: K,
|
|
41
|
+
serverMutators: P,
|
|
42
|
+
servers: X,
|
|
43
|
+
events: q
|
|
44
|
+
} = $, a = h(!w), T = h(), e = h(), E = h(""), Y = Ue(), Z = H(
|
|
45
|
+
() => I.findLast((o) => {
|
|
46
46
|
var t;
|
|
47
|
-
return o.request.uid === ((t =
|
|
47
|
+
return o.request.uid === ((t = S.value) == null ? void 0 : t.uid);
|
|
48
48
|
})
|
|
49
|
-
), { mediaQueries:
|
|
50
|
-
ue(
|
|
51
|
-
immediate:
|
|
49
|
+
), { mediaQueries: ee } = he();
|
|
50
|
+
ue(ee.xl, (o) => a.value = o, {
|
|
51
|
+
immediate: j !== "modal"
|
|
52
52
|
});
|
|
53
|
-
const
|
|
53
|
+
const D = H(
|
|
54
54
|
() => {
|
|
55
55
|
var o, t;
|
|
56
|
-
return (
|
|
56
|
+
return (w ? (o = p.value) == null ? void 0 : o.selectedSecuritySchemeUids : (t = k.value) == null ? void 0 : t.selectedSecuritySchemeUids) ?? [];
|
|
57
57
|
}
|
|
58
|
-
),
|
|
59
|
-
var
|
|
60
|
-
if (!
|
|
58
|
+
), M = async () => {
|
|
59
|
+
var d, v, f, u;
|
|
60
|
+
if (!k.value || !S.value || !p.value)
|
|
61
61
|
return;
|
|
62
|
-
const o = typeof
|
|
62
|
+
const o = typeof g.value == "object" ? g.value.value : "{}", t = be.parse(o);
|
|
63
63
|
t.error && console.error("INVALID ENVIRONMENT!");
|
|
64
|
-
const s = t.error || typeof t.data != "object" ? {} : t.data ?? {}, r = ((
|
|
65
|
-
request:
|
|
66
|
-
example:
|
|
67
|
-
selectedSecuritySchemeUids:
|
|
68
|
-
proxyUrl: ((
|
|
64
|
+
const s = t.error || typeof t.data != "object" ? {} : t.data ?? {}, r = ((d = y.value) == null ? void 0 : d.cookies.map((O) => Q[O]).filter(Re)) ?? [], R = ((f = (v = p.value) == null ? void 0 : v.info) == null ? void 0 : f.title) === "Drafts" ? void 0 : z.value, [n, c] = we({
|
|
65
|
+
request: k.value,
|
|
66
|
+
example: S.value,
|
|
67
|
+
selectedSecuritySchemeUids: D.value,
|
|
68
|
+
proxyUrl: ((u = y.value) == null ? void 0 : u.proxyUrl) ?? "",
|
|
69
69
|
environment: s,
|
|
70
70
|
globalCookies: r,
|
|
71
|
-
status:
|
|
72
|
-
securitySchemes:
|
|
73
|
-
server:
|
|
71
|
+
status: q.requestStatus,
|
|
72
|
+
securitySchemes: G,
|
|
73
|
+
server: R
|
|
74
74
|
});
|
|
75
|
-
if (
|
|
76
|
-
|
|
75
|
+
if (n) {
|
|
76
|
+
B(n.message, "error");
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
|
|
80
|
-
const [
|
|
81
|
-
|
|
82
|
-
},
|
|
79
|
+
T.value = c.controller;
|
|
80
|
+
const [m, b] = await c.sendRequest();
|
|
81
|
+
m ? B(m.message, "error") : I.push(b);
|
|
82
|
+
}, te = async () => {
|
|
83
83
|
var o;
|
|
84
|
-
return (o =
|
|
84
|
+
return (o = T.value) == null ? void 0 : o.abort(Ee.REQUEST_ABORTED);
|
|
85
85
|
};
|
|
86
86
|
le(() => {
|
|
87
|
-
|
|
88
|
-
}), qe(), ae(() =>
|
|
89
|
-
function
|
|
87
|
+
q.executeRequest.on(M), q.cancelRequest.on(te);
|
|
88
|
+
}), qe(), ae(() => q.executeRequest.off(M));
|
|
89
|
+
function oe({
|
|
90
90
|
requestName: o,
|
|
91
91
|
collectionUid: t
|
|
92
92
|
}) {
|
|
93
|
-
var n, c,
|
|
93
|
+
var n, c, m, b, d, v, f;
|
|
94
94
|
if (!e.value) return;
|
|
95
|
-
const s =
|
|
96
|
-
(
|
|
95
|
+
const s = F.value.find(
|
|
96
|
+
(u) => u.uid === t
|
|
97
97
|
);
|
|
98
98
|
if (!s) return;
|
|
99
99
|
const r = ((n = s == null ? void 0 : s.info) == null ? void 0 : n.title) === "Drafts";
|
|
100
100
|
if (!r && e.value.servers) {
|
|
101
|
-
const
|
|
102
|
-
(
|
|
103
|
-
var A,
|
|
104
|
-
return
|
|
101
|
+
const u = Object.values(X).find(
|
|
102
|
+
(O) => {
|
|
103
|
+
var A, L;
|
|
104
|
+
return O.url === ((L = (A = e == null ? void 0 : e.value) == null ? void 0 : A.servers) == null ? void 0 : L[0]);
|
|
105
105
|
}
|
|
106
106
|
);
|
|
107
|
-
|
|
107
|
+
u ? E.value = u.uid : E.value = P.add(
|
|
108
108
|
{ url: e.value.servers[0] },
|
|
109
109
|
s.uid
|
|
110
110
|
).uid;
|
|
111
111
|
}
|
|
112
|
-
const
|
|
112
|
+
const R = K.add(
|
|
113
113
|
{
|
|
114
114
|
summary: o,
|
|
115
|
-
path: r ? (c = e == null ? void 0 : e.value) == null ? void 0 : c.url : (
|
|
116
|
-
method: (
|
|
115
|
+
path: r ? (c = e == null ? void 0 : e.value) == null ? void 0 : c.url : (m = e == null ? void 0 : e.value) == null ? void 0 : m.path,
|
|
116
|
+
method: (b = e == null ? void 0 : e.value) == null ? void 0 : b.method,
|
|
117
117
|
parameters: (d = e == null ? void 0 : e.value) == null ? void 0 : d.parameters,
|
|
118
|
-
selectedServerUid: r ? void 0 :
|
|
119
|
-
requestBody: (
|
|
118
|
+
selectedServerUid: r ? void 0 : E.value,
|
|
119
|
+
requestBody: (v = e == null ? void 0 : e.value) == null ? void 0 : v.requestBody
|
|
120
120
|
},
|
|
121
121
|
s.uid
|
|
122
122
|
);
|
|
123
|
-
|
|
124
|
-
`/workspace/${
|
|
125
|
-
),
|
|
123
|
+
R && ((f = y.value) != null && f.uid) && Y.push(
|
|
124
|
+
`/workspace/${y.value.uid}/request/${R.uid}`
|
|
125
|
+
), i.hide();
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
e.value = ve(o),
|
|
127
|
+
function re(o) {
|
|
128
|
+
e.value = ve(o), i.show();
|
|
129
129
|
}
|
|
130
130
|
return (o, t) => {
|
|
131
131
|
var s;
|
|
132
|
-
return
|
|
133
|
-
|
|
134
|
-
class:
|
|
135
|
-
"!mr-0 !mb-0 !border-0":
|
|
132
|
+
return x(), ie(ne, null, [
|
|
133
|
+
V("div", {
|
|
134
|
+
class: W(["flex flex-1 flex-col pt-0 h-full bg-b-1 relative z-0 overflow-hidden", {
|
|
135
|
+
"!mr-0 !mb-0 !border-0": l(w)
|
|
136
136
|
}])
|
|
137
137
|
}, [
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
V("div", Ce, [
|
|
139
|
+
l(J) ? (x(), C(ke, {
|
|
140
140
|
key: 0,
|
|
141
|
-
isSidebarOpen:
|
|
141
|
+
isSidebarOpen: a.value,
|
|
142
142
|
onNewTab: t[0] || (t[0] = (r) => o.$emit("newTab", r)),
|
|
143
|
-
"onUpdate:isSidebarOpen": t[1] || (t[1] = (r) =>
|
|
144
|
-
}, null, 8, ["isSidebarOpen"])) :
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
modelValue:
|
|
148
|
-
"onUpdate:modelValue": t[2] || (t[2] = (r) =>
|
|
149
|
-
onHideModal: t[3] || (t[3] = () =>
|
|
150
|
-
onImportCurl:
|
|
143
|
+
"onUpdate:isSidebarOpen": t[1] || (t[1] = (r) => a.value = r)
|
|
144
|
+
}, null, 8, ["isSidebarOpen"])) : N("", !0),
|
|
145
|
+
V("div", Ne, [
|
|
146
|
+
U(Se, {
|
|
147
|
+
modelValue: a.value,
|
|
148
|
+
"onUpdate:modelValue": t[2] || (t[2] = (r) => a.value = r),
|
|
149
|
+
onHideModal: t[3] || (t[3] = () => l(i).hide()),
|
|
150
|
+
onImportCurl: re
|
|
151
151
|
}, null, 8, ["modelValue"]),
|
|
152
|
-
|
|
153
|
-
default:
|
|
154
|
-
|
|
152
|
+
U(me, null, {
|
|
153
|
+
default: _(() => [
|
|
154
|
+
l(S) ? (x(), C(de, {
|
|
155
155
|
key: 0,
|
|
156
|
-
class:
|
|
156
|
+
class: W(["flex-1", [a.value ? "sidebar-active-hide-layout" : ""]])
|
|
157
157
|
}, {
|
|
158
|
-
default:
|
|
158
|
+
default: _(() => {
|
|
159
159
|
var r;
|
|
160
160
|
return [
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
response: (r =
|
|
161
|
+
U(pe, { selectedSecuritySchemeUids: D.value }, null, 8, ["selectedSecuritySchemeUids"]),
|
|
162
|
+
U(ye, {
|
|
163
|
+
response: (r = Z.value) == null ? void 0 : r.response
|
|
164
164
|
}, null, 8, ["response"])
|
|
165
165
|
];
|
|
166
166
|
}),
|
|
167
167
|
_: 1
|
|
168
|
-
}, 8, ["class"])) :
|
|
168
|
+
}, 8, ["class"])) : N("", !0)
|
|
169
169
|
]),
|
|
170
170
|
_: 1
|
|
171
171
|
})
|
|
172
172
|
])
|
|
173
173
|
])
|
|
174
174
|
], 2),
|
|
175
|
-
e.value ? (
|
|
175
|
+
e.value ? (x(), C(ce, {
|
|
176
176
|
key: 0,
|
|
177
|
-
collectionUid: ((s =
|
|
177
|
+
collectionUid: ((s = l(p)) == null ? void 0 : s.uid) ?? "",
|
|
178
178
|
parsedCurl: e.value,
|
|
179
|
-
state:
|
|
180
|
-
onClose: t[4] || (t[4] = (r) =>
|
|
181
|
-
onImportCurl:
|
|
182
|
-
}, null, 8, ["collectionUid", "parsedCurl", "state"])) :
|
|
179
|
+
state: l(i),
|
|
180
|
+
onClose: t[4] || (t[4] = (r) => l(i).hide()),
|
|
181
|
+
onImportCurl: oe
|
|
182
|
+
}, null, 8, ["collectionUid", "parsedCurl", "state"])) : N("", !0)
|
|
183
183
|
], 64);
|
|
184
184
|
};
|
|
185
185
|
}
|
|
@@ -17,7 +17,7 @@ const K = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, A = {
|
|
|
17
17
|
a.commandPalette.emit({ commandName: "Create Request" });
|
|
18
18
|
}, y = (i) => {
|
|
19
19
|
i != null && i.createNew && v.name === "request" && f();
|
|
20
|
-
}, h = "2.2.
|
|
20
|
+
}, h = "2.2.24";
|
|
21
21
|
return R(() => a.hotKeys.on(y)), C(() => a.hotKeys.off(y)), (i, e) => (r(), l("div", K, [
|
|
22
22
|
o("div", {
|
|
23
23
|
class: k(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.2.
|
|
21
|
+
"version": "2.2.24",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -171,19 +171,19 @@
|
|
|
171
171
|
"zod": "^3.23.8",
|
|
172
172
|
"@scalar/components": "0.13.10",
|
|
173
173
|
"@scalar/draggable": "0.1.8",
|
|
174
|
-
"@scalar/import": "0.2.12",
|
|
175
174
|
"@scalar/icons": "0.1.2",
|
|
176
|
-
"@scalar/
|
|
175
|
+
"@scalar/import": "0.2.13",
|
|
176
|
+
"@scalar/oas-utils": "0.2.93",
|
|
177
177
|
"@scalar/openapi-parser": "0.10.2",
|
|
178
|
-
"@scalar/openapi-types": "0.1.5",
|
|
179
178
|
"@scalar/object-utils": "1.1.12",
|
|
179
|
+
"@scalar/openapi-types": "0.1.5",
|
|
180
180
|
"@scalar/themes": "0.9.58",
|
|
181
|
-
"@scalar/postman-to-openapi": "0.1.
|
|
182
|
-
"@scalar/use-codemirror": "0.11.54",
|
|
183
|
-
"@scalar/use-hooks": "0.1.11",
|
|
181
|
+
"@scalar/postman-to-openapi": "0.1.16",
|
|
184
182
|
"@scalar/types": "0.0.25",
|
|
183
|
+
"@scalar/use-codemirror": "0.11.54",
|
|
185
184
|
"@scalar/use-tooltip": "1.0.4",
|
|
186
|
-
"@scalar/use-toasts": "0.7.7"
|
|
185
|
+
"@scalar/use-toasts": "0.7.7",
|
|
186
|
+
"@scalar/use-hooks": "0.1.11"
|
|
187
187
|
},
|
|
188
188
|
"devDependencies": {
|
|
189
189
|
"@types/js-cookie": "^3.0.6",
|