@scalar/api-client 2.3.17 → 2.3.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 +20 -0
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +9 -9
- package/dist/components/SideNav/SideHelp.vue.js +1 -1
- package/dist/hooks/useClientConfig.d.ts +69 -0
- package/dist/hooks/useClientConfig.d.ts.map +1 -0
- package/dist/hooks/useClientConfig.js +7 -0
- package/dist/layouts/App/create-api-client-app.d.ts +34 -34
- package/dist/layouts/Modal/create-api-client-modal.d.ts +68 -68
- package/dist/layouts/Web/create-api-client-web.d.ts +34 -34
- package/dist/libs/create-client.d.ts +34 -34
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +63 -62
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/store/collections.d.ts +4 -4
- package/dist/store/request-example.d.ts +2 -2
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/security-schemes.d.ts +10 -10
- package/dist/store/servers.d.ts +4 -4
- package/dist/store/store.d.ts +34 -34
- package/dist/store/tags.d.ts +2 -2
- package/dist/store/workspace.d.ts +4 -4
- 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 +67 -66
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +5 -5
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestRoot.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestRoot.vue"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"RequestRoot.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestRoot.vue"],"names":[],"mappings":";;cAkQ8C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAmTjE,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestRoot.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-985ee6ae"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,76 +1,77 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isDefined as
|
|
3
|
-
import { safeJSON as
|
|
4
|
-
import { useToasts as
|
|
5
|
-
import { RouterView as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
1
|
+
import { defineComponent as Q, ref as m, computed as F, onMounted as G, onBeforeUnmount as K, watch as X, openBlock as d, createElementBlock as Y, normalizeClass as g, unref as r, createBlock as B, isRef as Z, createCommentVNode as T, createElementVNode as A, createVNode as ee } from "vue";
|
|
2
|
+
import { isDefined as te } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import { safeJSON as oe } from "@scalar/object-utils/parse";
|
|
4
|
+
import { useToasts as re } from "@scalar/use-toasts";
|
|
5
|
+
import { RouterView as se } from "vue-router";
|
|
6
|
+
import ae from "../../components/Sidebar/SidebarToggle.vue.js";
|
|
7
|
+
import { useClientConfig as le } from "../../hooks/useClientConfig.js";
|
|
8
|
+
import { useSidebar as ne } from "../../hooks/useSidebar.js";
|
|
9
|
+
import { validateParameters as ue } from "../../libs/validate-parameters.js";
|
|
10
|
+
import { useActiveEntities as ie } from "../../store/active-entities.js";
|
|
11
|
+
import { useOpenApiWatcher as ce } from "./hooks/useOpenApiWatcher.js";
|
|
12
|
+
import me from "./RequestSidebar.vue.js";
|
|
13
|
+
import { createRequestOperation as fe } from "../../libs/send-request/create-request-operation.js";
|
|
14
|
+
import { ERRORS as de } from "../../libs/errors.js";
|
|
15
|
+
import { useWorkspace as pe } from "../../store/store.js";
|
|
16
|
+
import { useLayout as ve } from "../../hooks/useLayout.js";
|
|
17
|
+
const Se = { class: "flex h-full" }, Re = { class: "flex h-full flex-1 flex-col" }, Ae = /* @__PURE__ */ Q({
|
|
17
18
|
__name: "RequestRoot",
|
|
18
19
|
emits: ["newTab"],
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
20
|
+
setup(ye) {
|
|
21
|
+
const D = pe(), { toast: p } = re(), { layout: v } = ve(), P = le(), { isSidebarOpen: s } = ne(), {
|
|
21
22
|
activeCollection: l,
|
|
22
23
|
activeExample: n,
|
|
23
|
-
activeEnvironment:
|
|
24
|
-
activeRequest:
|
|
25
|
-
activeWorkspace:
|
|
26
|
-
activeServer:
|
|
27
|
-
} =
|
|
24
|
+
activeEnvironment: S,
|
|
25
|
+
activeRequest: u,
|
|
26
|
+
activeWorkspace: R,
|
|
27
|
+
activeServer: z
|
|
28
|
+
} = ie(), { cookies: I, requestHistory: J, showSidebar: y, securitySchemes: W, events: i } = D, j = m(), q = m(), f = m(/* @__PURE__ */ new Set()), x = m(null), b = F(
|
|
28
29
|
() => {
|
|
29
30
|
var e, t, o;
|
|
30
|
-
return ((e = l.value) != null && e.useCollectionSecurity ? (t = l.value) == null ? void 0 : t.selectedSecuritySchemeUids : (o =
|
|
31
|
+
return ((e = l.value) != null && e.useCollectionSecurity ? (t = l.value) == null ? void 0 : t.selectedSecuritySchemeUids : (o = u.value) == null ? void 0 : o.selectedSecuritySchemeUids) ?? [];
|
|
31
32
|
}
|
|
32
|
-
),
|
|
33
|
-
var U, _, w, O;
|
|
34
|
-
if (!
|
|
33
|
+
), h = async () => {
|
|
34
|
+
var U, _, w, O, c, V;
|
|
35
|
+
if (!u.value || !n.value || !l.value)
|
|
35
36
|
return;
|
|
36
|
-
|
|
37
|
-
const e = typeof
|
|
37
|
+
f.value = ue(n.value);
|
|
38
|
+
const e = typeof S.value == "object" ? S.value.value : "{}", t = oe.parse(e);
|
|
38
39
|
t.error && console.error("INVALID ENVIRONMENT!");
|
|
39
|
-
const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, a = ((U =
|
|
40
|
-
request:
|
|
40
|
+
const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, a = ((U = R.value) == null ? void 0 : U.cookies.map((H) => I[H]).filter(te)) ?? [], $ = ((w = (_ = l.value) == null ? void 0 : _.info) == null ? void 0 : w.title) === "Drafts" ? void 0 : z.value, [k, E] = fe({
|
|
41
|
+
request: u.value,
|
|
41
42
|
example: n.value,
|
|
42
|
-
selectedSecuritySchemeUids:
|
|
43
|
-
proxyUrl: ((O =
|
|
43
|
+
selectedSecuritySchemeUids: b.value,
|
|
44
|
+
proxyUrl: ((O = R.value) == null ? void 0 : O.proxyUrl) ?? "",
|
|
44
45
|
environment: o,
|
|
45
46
|
globalCookies: a,
|
|
46
|
-
status:
|
|
47
|
-
securitySchemes:
|
|
48
|
-
server:
|
|
47
|
+
status: i.requestStatus,
|
|
48
|
+
securitySchemes: W,
|
|
49
|
+
server: $
|
|
49
50
|
});
|
|
50
|
-
if (
|
|
51
|
-
|
|
51
|
+
if ((V = (c = P.value) == null ? void 0 : c.onRequestSent) == null || V.call(c, u.value.path ?? ""), k) {
|
|
52
|
+
p(k.message, "error");
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
-
const [
|
|
56
|
-
|
|
57
|
-
},
|
|
55
|
+
q.value = E.controller;
|
|
56
|
+
const [C, N] = await E.sendRequest();
|
|
57
|
+
x.value = N, C ? p(C.message, "error") : J.push(M(N));
|
|
58
|
+
}, L = async () => {
|
|
58
59
|
var e;
|
|
59
|
-
return (e =
|
|
60
|
+
return (e = q.value) == null ? void 0 : e.abort(de.REQUEST_ABORTED);
|
|
60
61
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}),
|
|
62
|
+
G(() => {
|
|
63
|
+
i.executeRequest.on(h), i.cancelRequest.on(L);
|
|
64
|
+
}), ce(), K(() => i.executeRequest.off(h)), X(
|
|
64
65
|
() => {
|
|
65
66
|
var e;
|
|
66
67
|
return (e = n.value) == null ? void 0 : e.parameters;
|
|
67
68
|
},
|
|
68
69
|
() => {
|
|
69
|
-
|
|
70
|
+
f.value.clear();
|
|
70
71
|
},
|
|
71
72
|
{ deep: !0 }
|
|
72
73
|
);
|
|
73
|
-
const
|
|
74
|
+
const M = (e) => {
|
|
74
75
|
var t;
|
|
75
76
|
try {
|
|
76
77
|
return structuredClone(e);
|
|
@@ -79,33 +80,33 @@ const fe = { class: "flex h-full" }, de = { class: "flex h-full flex-1 flex-col"
|
|
|
79
80
|
return (t = e.response) != null && t.data && (e.response.data instanceof Blob || e.response.data instanceof ArrayBuffer ? a.response.data = e.response.data : a.response.data = JSON.parse(JSON.stringify(e.response.data))), a;
|
|
80
81
|
}
|
|
81
82
|
};
|
|
82
|
-
return (e, t) => (
|
|
83
|
+
return (e, t) => (d(), Y("div", {
|
|
83
84
|
ref_key: "element",
|
|
84
|
-
ref:
|
|
85
|
-
class:
|
|
86
|
-
"!mb-0 !mr-0 !border-0": r(
|
|
85
|
+
ref: j,
|
|
86
|
+
class: g(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
|
|
87
|
+
"!mb-0 !mr-0 !border-0": r(v) === "modal"
|
|
87
88
|
}])
|
|
88
89
|
}, [
|
|
89
|
-
r(
|
|
90
|
+
r(y) ? (d(), B(ae, {
|
|
90
91
|
key: 0,
|
|
91
92
|
modelValue: r(s),
|
|
92
|
-
"onUpdate:modelValue": t[0] || (t[0] = (o) =>
|
|
93
|
-
class:
|
|
93
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => Z(s) ? s.value = o : null),
|
|
94
|
+
class: g(["absolute left-3 top-2 z-50", [
|
|
94
95
|
{ hidden: r(s) },
|
|
95
96
|
{ "xl:!flex": !r(s) },
|
|
96
|
-
{ "!flex": r(
|
|
97
|
+
{ "!flex": r(v) === "modal" }
|
|
97
98
|
]])
|
|
98
|
-
}, null, 8, ["modelValue", "class"])) :
|
|
99
|
-
|
|
100
|
-
r(
|
|
99
|
+
}, null, 8, ["modelValue", "class"])) : T("", !0),
|
|
100
|
+
A("div", Se, [
|
|
101
|
+
r(y) ? (d(), B(me, {
|
|
101
102
|
key: 0,
|
|
102
103
|
onNewTab: t[1] || (t[1] = (o) => e.$emit("newTab", o))
|
|
103
|
-
})) :
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
invalidParams:
|
|
107
|
-
selectedSecuritySchemeUids:
|
|
108
|
-
requestResult:
|
|
104
|
+
})) : T("", !0),
|
|
105
|
+
A("div", Re, [
|
|
106
|
+
ee(r(se), {
|
|
107
|
+
invalidParams: f.value,
|
|
108
|
+
selectedSecuritySchemeUids: b.value,
|
|
109
|
+
requestResult: x.value
|
|
109
110
|
}, null, 8, ["invalidParams", "selectedSecuritySchemeUids", "requestResult"])
|
|
110
111
|
])
|
|
111
112
|
])
|
|
@@ -113,5 +114,5 @@ const fe = { class: "flex h-full" }, de = { class: "flex h-full flex-1 flex-col"
|
|
|
113
114
|
}
|
|
114
115
|
});
|
|
115
116
|
export {
|
|
116
|
-
|
|
117
|
+
Ae as default
|
|
117
118
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestBody.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-435b665f"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestTable.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-682f7941"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -30,9 +30,9 @@ const j = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify
|
|
|
30
30
|
setup(C, { emit: F }) {
|
|
31
31
|
const b = C, s = F, U = ["", "", "36px"], y = (e, a, l) => {
|
|
32
32
|
s("updateRow", e, a, l);
|
|
33
|
-
},
|
|
33
|
+
}, $ = (e) => {
|
|
34
34
|
s("uploadFile", e);
|
|
35
|
-
},
|
|
35
|
+
}, S = (e) => Array.isArray(e.default) && e.default.length === 1 ? e.default[0] : e.default;
|
|
36
36
|
return (e, a) => (r(), p(E, {
|
|
37
37
|
class: "group/table flex-1",
|
|
38
38
|
columns: U
|
|
@@ -157,7 +157,7 @@ const j = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify
|
|
|
157
157
|
icon: n(() => [
|
|
158
158
|
u(R)(l) ? (r(), p(P, {
|
|
159
159
|
key: 0,
|
|
160
|
-
item: { ...l, default:
|
|
160
|
+
item: { ...l, default: S(l) }
|
|
161
161
|
}, null, 8, ["item"])) : g("", !0)
|
|
162
162
|
]),
|
|
163
163
|
_: 2
|
|
@@ -186,13 +186,13 @@ const j = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify
|
|
|
186
186
|
class: "bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none",
|
|
187
187
|
size: "sm",
|
|
188
188
|
variant: "outlined",
|
|
189
|
-
onClick: (T) =>
|
|
189
|
+
onClick: (T) => $(d)
|
|
190
190
|
}, {
|
|
191
191
|
default: n(() => [
|
|
192
192
|
a[6] || (a[6] = i("span", null, "Upload File", -1)),
|
|
193
193
|
t(u(B), {
|
|
194
194
|
class: "ml-1",
|
|
195
|
-
icon: "
|
|
195
|
+
icon: "Upload",
|
|
196
196
|
size: "xs",
|
|
197
197
|
thickness: "2.5"
|
|
198
198
|
})
|
|
@@ -34,7 +34,7 @@ const W = { class: "col-1 flex-center relative gap-6 p-2 capitalize" }, $ = {
|
|
|
34
34
|
}));
|
|
35
35
|
}, k = (o) => {
|
|
36
36
|
o != null && o.createNew && x.name === "request" && f();
|
|
37
|
-
}, w = "2.3.
|
|
37
|
+
}, w = "2.3.18";
|
|
38
38
|
return R(() => a.hotKeys.on(k)), v(() => a.hotKeys.off(k)), (o, e) => (l(), u("div", W, [
|
|
39
39
|
s("div", {
|
|
40
40
|
class: y(["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.3.
|
|
21
|
+
"version": "2.3.18",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -189,21 +189,21 @@
|
|
|
189
189
|
"whatwg-mimetype": "^4.0.0",
|
|
190
190
|
"yaml": "^2.4.5",
|
|
191
191
|
"zod": "^3.23.8",
|
|
192
|
-
"@scalar/components": "0.13.
|
|
193
|
-
"@scalar/import": "0.3.12",
|
|
192
|
+
"@scalar/components": "0.13.47",
|
|
194
193
|
"@scalar/icons": "0.1.3",
|
|
195
194
|
"@scalar/draggable": "0.1.11",
|
|
196
|
-
"@scalar/
|
|
197
|
-
"@scalar/openapi-parser": "0.10.14",
|
|
195
|
+
"@scalar/import": "0.3.13",
|
|
198
196
|
"@scalar/object-utils": "1.1.13",
|
|
197
|
+
"@scalar/oas-utils": "0.2.130",
|
|
199
198
|
"@scalar/openapi-types": "0.2.0",
|
|
199
|
+
"@scalar/postman-to-openapi": "0.2.3",
|
|
200
|
+
"@scalar/themes": "0.9.86",
|
|
200
201
|
"@scalar/snippetz": "0.2.19",
|
|
201
|
-
"@scalar/
|
|
202
|
-
"@scalar/
|
|
203
|
-
"@scalar/
|
|
202
|
+
"@scalar/types": "0.1.7",
|
|
203
|
+
"@scalar/openapi-parser": "0.10.14",
|
|
204
|
+
"@scalar/use-codemirror": "0.11.92",
|
|
205
|
+
"@scalar/use-hooks": "0.1.40",
|
|
204
206
|
"@scalar/use-toasts": "0.7.9",
|
|
205
|
-
"@scalar/use-codemirror": "0.11.91",
|
|
206
|
-
"@scalar/use-hooks": "0.1.39",
|
|
207
207
|
"@scalar/use-tooltip": "1.0.6"
|
|
208
208
|
},
|
|
209
209
|
"devDependencies": {
|