@scalar/api-client 2.2.21 → 2.2.22
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 +6 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +1 -1
- package/dist/components/Sidebar/Sidebar.vue.d.ts +2 -2
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +16 -16
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarToggle.vue.js +3 -3
- package/dist/layouts/App/create-api-client-app.d.ts +2 -1
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +4 -2
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +2 -1
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +2 -1
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +19 -18
- package/dist/store/store.d.ts +5 -5
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +53 -48
- 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 +105 -108
- package/dist/views/Request/RequestSidebar.vue.d.ts +3 -4
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +160 -163
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts +0 -1
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
- package/dist/views/Request/RequestSubpageHeader.vue2.js +44 -49
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +6 -6
|
@@ -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":";;cAqS8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAmajD,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-8b8ff238"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as re, ref as
|
|
1
|
+
import { defineComponent as re, ref as S, computed as L, watch as se, onMounted as ue, onBeforeUnmount as ae, openBlock as y, createElementBlock as le, Fragment as ie, createElementVNode as k, normalizeClass as D, unref as u, createBlock as w, createCommentVNode as E, createVNode as q, withCtx as H } from "vue";
|
|
2
2
|
import ne from "../../components/ImportCurl/ImportCurlModal.vue.js";
|
|
3
3
|
import ce from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
4
4
|
import me from "../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
@@ -6,181 +6,178 @@ import { importCurlCommand as de } from "../../libs/importers/curl.js";
|
|
|
6
6
|
import { useActiveEntities as ve } from "../../store/active-entities.js";
|
|
7
7
|
import fe from "./RequestSection/RequestSection.vue.js";
|
|
8
8
|
import pe from "./RequestSubpageHeader.vue.js";
|
|
9
|
-
import
|
|
10
|
-
import { useOpenApiWatcher as
|
|
11
|
-
import { safeJSON as
|
|
12
|
-
import { useBreakpoints as
|
|
13
|
-
import { useToasts as
|
|
14
|
-
import { useRouter as
|
|
15
|
-
import
|
|
16
|
-
import { createRequestOperation as
|
|
17
|
-
import { ERRORS as
|
|
18
|
-
import { useWorkspace as
|
|
9
|
+
import Se from "./ResponseSection/ResponseSection.vue.js";
|
|
10
|
+
import { useOpenApiWatcher as ye } from "./hooks/useOpenApiWatcher.js";
|
|
11
|
+
import { safeJSON as qe } from "@scalar/object-utils/parse";
|
|
12
|
+
import { useBreakpoints as Re } from "@scalar/use-hooks/useBreakpoints";
|
|
13
|
+
import { useToasts as be } from "@scalar/use-toasts";
|
|
14
|
+
import { useRouter as he } from "vue-router";
|
|
15
|
+
import xe from "./RequestSidebar.vue.js";
|
|
16
|
+
import { createRequestOperation as Ue } from "../../libs/send-request/send-request.js";
|
|
17
|
+
import { ERRORS as ke } from "../../libs/errors.js";
|
|
18
|
+
import { useWorkspace as we } from "../../store/store.js";
|
|
19
19
|
import { useLayout as Ee } from "../../hooks/useLayout.js";
|
|
20
|
-
const
|
|
20
|
+
const Oe = { class: "flex h-full" }, Ve = { class: "flex flex-1 flex-col h-full" }, Ke = /* @__PURE__ */ re({
|
|
21
21
|
__name: "Request",
|
|
22
22
|
emits: ["newTab"],
|
|
23
23
|
setup(Ce) {
|
|
24
|
-
const
|
|
25
|
-
activeCollection:
|
|
26
|
-
activeExample:
|
|
27
|
-
activeEnvironment:
|
|
28
|
-
activeRequest:
|
|
29
|
-
activeWorkspace:
|
|
24
|
+
const W = we(), { toast: O } = be(), { layout: _ } = Ee(), {
|
|
25
|
+
activeCollection: R,
|
|
26
|
+
activeExample: m,
|
|
27
|
+
activeEnvironment: V,
|
|
28
|
+
activeRequest: b,
|
|
29
|
+
activeWorkspace: h,
|
|
30
30
|
activeServer: $,
|
|
31
31
|
activeWorkspaceCollections: j
|
|
32
32
|
} = ve(), {
|
|
33
33
|
cookies: z,
|
|
34
|
-
isReadOnly:
|
|
35
|
-
modalState:
|
|
36
|
-
requestHistory:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
isReadOnly: x,
|
|
35
|
+
modalState: l,
|
|
36
|
+
requestHistory: C,
|
|
37
|
+
showSidebar: F,
|
|
38
|
+
securitySchemes: Q,
|
|
39
|
+
requestMutators: J,
|
|
40
|
+
serverMutators: G,
|
|
41
|
+
servers: K,
|
|
42
|
+
events: d
|
|
43
|
+
} = W, a = S(!x), N = S(), e = S(), U = S(""), P = he(), X = L(
|
|
44
|
+
() => C.findLast((o) => {
|
|
44
45
|
var t;
|
|
45
|
-
return o.request.uid === ((t =
|
|
46
|
+
return o.request.uid === ((t = m.value) == null ? void 0 : t.uid);
|
|
46
47
|
})
|
|
47
|
-
), { mediaQueries:
|
|
48
|
-
se(
|
|
49
|
-
immediate:
|
|
48
|
+
), { mediaQueries: Y } = Re();
|
|
49
|
+
se(Y.xl, (o) => a.value = o, {
|
|
50
|
+
immediate: _ !== "modal"
|
|
50
51
|
});
|
|
51
|
-
const
|
|
52
|
+
const B = L(
|
|
52
53
|
() => {
|
|
53
54
|
var o, t;
|
|
54
|
-
return (
|
|
55
|
+
return (x ? (o = R.value) == null ? void 0 : o.selectedSecuritySchemeUids : (t = b.value) == null ? void 0 : t.selectedSecuritySchemeUids) ?? [];
|
|
55
56
|
}
|
|
56
|
-
),
|
|
57
|
-
if (!
|
|
57
|
+
), g = async () => {
|
|
58
|
+
if (!b.value || !m.value || !R.value)
|
|
58
59
|
return;
|
|
59
|
-
const o = typeof
|
|
60
|
+
const o = typeof V.value == "object" ? V.value.value : "{}", t = qe.parse(o);
|
|
60
61
|
t.error && console.error("INVALID ENVIRONMENT!");
|
|
61
|
-
const s = t.error || typeof t.data != "object" ? {} : t.data ?? {}, r =
|
|
62
|
-
request:
|
|
63
|
-
example:
|
|
64
|
-
selectedSecuritySchemeUids:
|
|
65
|
-
proxyUrl:
|
|
62
|
+
const s = t.error || typeof t.data != "object" ? {} : t.data ?? {}, r = h.value.cookies.map((f) => z[f]), [i, n] = Ue({
|
|
63
|
+
request: b.value,
|
|
64
|
+
example: m.value,
|
|
65
|
+
selectedSecuritySchemeUids: B.value,
|
|
66
|
+
proxyUrl: h.value.proxyUrl ?? "",
|
|
66
67
|
environment: s,
|
|
67
68
|
globalCookies: r,
|
|
68
|
-
status:
|
|
69
|
-
securitySchemes:
|
|
69
|
+
status: d.requestStatus,
|
|
70
|
+
securitySchemes: Q,
|
|
70
71
|
server: $.value
|
|
71
72
|
});
|
|
72
|
-
if (
|
|
73
|
-
|
|
73
|
+
if (i) {
|
|
74
|
+
O(i.message, "error");
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
|
|
77
|
-
const [
|
|
78
|
-
|
|
79
|
-
},
|
|
77
|
+
N.value = n.controller;
|
|
78
|
+
const [c, v] = await n.sendRequest();
|
|
79
|
+
c ? O(c.message, "error") : C.push(v);
|
|
80
|
+
}, Z = async () => {
|
|
80
81
|
var o;
|
|
81
|
-
return (o =
|
|
82
|
+
return (o = N.value) == null ? void 0 : o.abort(ke.REQUEST_ABORTED);
|
|
82
83
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}),
|
|
86
|
-
function
|
|
84
|
+
ue(() => {
|
|
85
|
+
d.executeRequest.on(g), d.cancelRequest.on(Z);
|
|
86
|
+
}), ye(), ae(() => d.executeRequest.off(g));
|
|
87
|
+
function ee({
|
|
87
88
|
requestName: o,
|
|
88
89
|
collectionUid: t
|
|
89
90
|
}) {
|
|
90
|
-
var
|
|
91
|
+
var n, c, v, f, I, T;
|
|
91
92
|
if (!e.value) return;
|
|
92
93
|
const s = j.value.find(
|
|
93
|
-
(
|
|
94
|
+
(p) => p.uid === t
|
|
94
95
|
);
|
|
95
96
|
if (!s) return;
|
|
96
|
-
const r = ((
|
|
97
|
+
const r = ((n = s == null ? void 0 : s.info) == null ? void 0 : n.title) === "Drafts";
|
|
97
98
|
if (!r && e.value.servers) {
|
|
98
|
-
const
|
|
99
|
+
const p = Object.values(K).find(
|
|
99
100
|
(oe) => {
|
|
100
|
-
var
|
|
101
|
-
return oe.url === ((
|
|
101
|
+
var M, A;
|
|
102
|
+
return oe.url === ((A = (M = e == null ? void 0 : e.value) == null ? void 0 : M.servers) == null ? void 0 : A[0]);
|
|
102
103
|
}
|
|
103
104
|
);
|
|
104
|
-
|
|
105
|
+
p ? U.value = p.uid : U.value = G.add(
|
|
105
106
|
{ url: e.value.servers[0] },
|
|
106
107
|
s.uid
|
|
107
108
|
).uid;
|
|
108
109
|
}
|
|
109
|
-
const
|
|
110
|
+
const i = J.add(
|
|
110
111
|
{
|
|
111
112
|
summary: o,
|
|
112
|
-
path: r ? (
|
|
113
|
-
method: (
|
|
114
|
-
parameters: (
|
|
115
|
-
selectedServerUid: r ? void 0 :
|
|
116
|
-
requestBody: (
|
|
113
|
+
path: r ? (c = e == null ? void 0 : e.value) == null ? void 0 : c.url : (v = e == null ? void 0 : e.value) == null ? void 0 : v.path,
|
|
114
|
+
method: (f = e == null ? void 0 : e.value) == null ? void 0 : f.method,
|
|
115
|
+
parameters: (I = e == null ? void 0 : e.value) == null ? void 0 : I.parameters,
|
|
116
|
+
selectedServerUid: r ? void 0 : U.value,
|
|
117
|
+
requestBody: (T = e == null ? void 0 : e.value) == null ? void 0 : T.requestBody
|
|
117
118
|
},
|
|
118
119
|
s.uid
|
|
119
120
|
);
|
|
120
|
-
|
|
121
|
-
`/workspace/${
|
|
122
|
-
),
|
|
123
|
-
}
|
|
124
|
-
function ee(o) {
|
|
125
|
-
e.value = de(o), i.show();
|
|
121
|
+
i && P.push(
|
|
122
|
+
`/workspace/${h.value.uid}/request/${i.uid}`
|
|
123
|
+
), l.hide();
|
|
126
124
|
}
|
|
127
125
|
function te(o) {
|
|
128
|
-
|
|
126
|
+
e.value = de(o), l.show();
|
|
129
127
|
}
|
|
130
128
|
return (o, t) => {
|
|
131
129
|
var s;
|
|
132
|
-
return
|
|
133
|
-
|
|
134
|
-
class:
|
|
135
|
-
"!mr-0 !mb-0 !border-0":
|
|
130
|
+
return y(), le(ie, null, [
|
|
131
|
+
k("div", {
|
|
132
|
+
class: D(["flex flex-1 flex-col pt-0 h-full bg-b-1 relative z-0 overflow-hidden", {
|
|
133
|
+
"!mr-0 !mb-0 !border-0": u(x)
|
|
136
134
|
}])
|
|
137
135
|
}, [
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
k("div", Oe, [
|
|
137
|
+
u(F) ? (y(), w(xe, {
|
|
138
|
+
key: 0,
|
|
139
|
+
isSidebarOpen: a.value,
|
|
142
140
|
onNewTab: t[0] || (t[0] = (r) => o.$emit("newTab", r)),
|
|
143
|
-
"onUpdate:
|
|
144
|
-
}, null, 8, ["
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
modelValue:
|
|
148
|
-
"onUpdate:modelValue": t[
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
l(v) ? (w(), L(me, {
|
|
141
|
+
"onUpdate:isSidebarOpen": t[1] || (t[1] = (r) => a.value = r)
|
|
142
|
+
}, null, 8, ["isSidebarOpen"])) : E("", !0),
|
|
143
|
+
k("div", Ve, [
|
|
144
|
+
q(pe, {
|
|
145
|
+
modelValue: a.value,
|
|
146
|
+
"onUpdate:modelValue": t[2] || (t[2] = (r) => a.value = r),
|
|
147
|
+
onHideModal: t[3] || (t[3] = () => u(l).hide()),
|
|
148
|
+
onImportCurl: te
|
|
149
|
+
}, null, 8, ["modelValue"]),
|
|
150
|
+
q(ce, null, {
|
|
151
|
+
default: H(() => [
|
|
152
|
+
u(m) ? (y(), w(me, {
|
|
156
153
|
key: 0,
|
|
157
|
-
class:
|
|
154
|
+
class: D(["flex-1", [a.value ? "sidebar-active-hide-layout" : ""]])
|
|
158
155
|
}, {
|
|
159
|
-
default:
|
|
156
|
+
default: H(() => {
|
|
160
157
|
var r;
|
|
161
158
|
return [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
response: (r =
|
|
159
|
+
q(fe, { selectedSecuritySchemeUids: B.value }, null, 8, ["selectedSecuritySchemeUids"]),
|
|
160
|
+
q(Se, {
|
|
161
|
+
response: (r = X.value) == null ? void 0 : r.response
|
|
165
162
|
}, null, 8, ["response"])
|
|
166
163
|
];
|
|
167
164
|
}),
|
|
168
165
|
_: 1
|
|
169
|
-
}, 8, ["class"])) :
|
|
166
|
+
}, 8, ["class"])) : E("", !0)
|
|
170
167
|
]),
|
|
171
168
|
_: 1
|
|
172
169
|
})
|
|
173
170
|
])
|
|
174
171
|
])
|
|
175
172
|
], 2),
|
|
176
|
-
e.value ? (
|
|
173
|
+
e.value ? (y(), w(ne, {
|
|
177
174
|
key: 0,
|
|
178
|
-
collectionUid: ((s =
|
|
175
|
+
collectionUid: ((s = u(R)) == null ? void 0 : s.uid) ?? "",
|
|
179
176
|
parsedCurl: e.value,
|
|
180
|
-
state: l
|
|
181
|
-
onClose: t[
|
|
182
|
-
onImportCurl:
|
|
183
|
-
}, null, 8, ["collectionUid", "parsedCurl", "state"])) :
|
|
177
|
+
state: u(l),
|
|
178
|
+
onClose: t[4] || (t[4] = (r) => u(l).hide()),
|
|
179
|
+
onImportCurl: ee
|
|
180
|
+
}, null, 8, ["collectionUid", "parsedCurl", "state"])) : E("", !0)
|
|
184
181
|
], 64);
|
|
185
182
|
};
|
|
186
183
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
|
|
3
|
-
isReadonly: boolean;
|
|
2
|
+
isSidebarOpen: boolean;
|
|
4
3
|
};
|
|
5
4
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
6
5
|
"update:modelValue": (v: boolean) => any;
|
|
@@ -9,7 +8,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
9
8
|
name: string;
|
|
10
9
|
uid: string;
|
|
11
10
|
}) => any;
|
|
12
|
-
"update:
|
|
11
|
+
"update:isSidebarOpen": (v: boolean) => any;
|
|
13
12
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
13
|
"onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
|
|
15
14
|
onClearDrafts?: (() => any) | undefined;
|
|
@@ -17,7 +16,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
17
16
|
name: string;
|
|
18
17
|
uid: string;
|
|
19
18
|
}) => any) | undefined;
|
|
20
|
-
"onUpdate:
|
|
19
|
+
"onUpdate:isSidebarOpen"?: ((v: boolean) => any) | undefined;
|
|
21
20
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
21
|
export default _default;
|
|
23
22
|
//# sourceMappingURL=RequestSidebar.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"AA0eA,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,OAAO,CAAA;CACvB,CAAC;;;;;cAMqC,MAAM;aAAO,MAAM;;;;;;;cAAnB,MAAM;aAAO,MAAM;;;;AAgwB1D,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSidebar.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-189ce360"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|