@scalar/api-client 2.3.11 → 2.3.12
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 +22 -0
- package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +45 -51
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +3 -3
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +25 -26
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +40 -37
- package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
- package/dist/libs/send-request/create-request-operation.js +41 -41
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/import-spec.js +12 -12
- package/dist/style.css +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue.js +2 -2
- 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 -61
- 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 +32 -32
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +6 -6
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/hooks/useOpenApiWatcher.js +25 -25
- package/package.json +11 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./CollectionAuthentication.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-909b9799"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -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":";;cA2P8C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA8SjE,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-cc62b119"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,101 +1,111 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isDefined as
|
|
3
|
-
import { safeJSON as
|
|
4
|
-
import { useToasts as
|
|
5
|
-
import { RouterView as
|
|
6
|
-
import
|
|
7
|
-
import { useSidebar as
|
|
8
|
-
import { validateParameters as
|
|
9
|
-
import { useActiveEntities as
|
|
1
|
+
import { defineComponent as M, ref as c, computed as $, onMounted as H, onBeforeUnmount as Q, watch as F, openBlock as f, createElementBlock as G, normalizeClass as V, unref as r, createBlock as C, isRef as K, createCommentVNode as B, createElementVNode as T, createVNode as X } from "vue";
|
|
2
|
+
import { isDefined as Y } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import { safeJSON as Z } from "@scalar/object-utils/parse";
|
|
4
|
+
import { useToasts as ee } from "@scalar/use-toasts";
|
|
5
|
+
import { RouterView as te } from "vue-router";
|
|
6
|
+
import oe from "../../components/Sidebar/SidebarToggle.vue.js";
|
|
7
|
+
import { useSidebar as re } from "../../hooks/useSidebar.js";
|
|
8
|
+
import { validateParameters as se } from "../../libs/validate-parameters.js";
|
|
9
|
+
import { useActiveEntities as ae } from "../../store/active-entities.js";
|
|
10
10
|
import { useOpenApiWatcher as le } from "./hooks/useOpenApiWatcher.js";
|
|
11
|
-
import
|
|
11
|
+
import ne from "./RequestSidebar.vue.js";
|
|
12
12
|
import { createRequestOperation as ue } from "../../libs/send-request/create-request-operation.js";
|
|
13
|
-
import { ERRORS as
|
|
13
|
+
import { ERRORS as ce } from "../../libs/errors.js";
|
|
14
14
|
import { useWorkspace as ie } from "../../store/store.js";
|
|
15
|
-
import { useLayout as
|
|
16
|
-
const
|
|
15
|
+
import { useLayout as me } from "../../hooks/useLayout.js";
|
|
16
|
+
const fe = { class: "flex h-full" }, de = { class: "flex h-full flex-1 flex-col" }, Ve = /* @__PURE__ */ M({
|
|
17
17
|
__name: "RequestRoot",
|
|
18
18
|
emits: ["newTab"],
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
19
|
+
setup(pe) {
|
|
20
|
+
const A = ie(), { toast: d } = ee(), { layout: p } = me(), {
|
|
21
21
|
activeCollection: l,
|
|
22
|
-
activeExample:
|
|
22
|
+
activeExample: n,
|
|
23
23
|
activeEnvironment: v,
|
|
24
24
|
activeRequest: i,
|
|
25
|
-
activeWorkspace:
|
|
26
|
-
activeServer:
|
|
27
|
-
} =
|
|
25
|
+
activeWorkspace: S,
|
|
26
|
+
activeServer: g
|
|
27
|
+
} = ae(), { cookies: D, requestHistory: P, showSidebar: R, securitySchemes: z, events: u } = A, { isSidebarOpen: s } = re(), I = c(), y = c(), m = c(/* @__PURE__ */ new Set()), q = c(null), x = $(
|
|
28
28
|
() => {
|
|
29
29
|
var e, t, o;
|
|
30
30
|
return ((e = l.value) != null && e.useCollectionSecurity ? (t = l.value) == null ? void 0 : t.selectedSecuritySchemeUids : (o = i.value) == null ? void 0 : o.selectedSecuritySchemeUids) ?? [];
|
|
31
31
|
}
|
|
32
|
-
),
|
|
33
|
-
var
|
|
34
|
-
if (!i.value || !
|
|
32
|
+
), b = async () => {
|
|
33
|
+
var U, _, w, O;
|
|
34
|
+
if (!i.value || !n.value || !l.value)
|
|
35
35
|
return;
|
|
36
|
-
|
|
37
|
-
const e = typeof v.value == "object" ? v.value.value : "{}", t =
|
|
36
|
+
m.value = se(n.value);
|
|
37
|
+
const e = typeof v.value == "object" ? v.value.value : "{}", t = Z.parse(e);
|
|
38
38
|
t.error && console.error("INVALID ENVIRONMENT!");
|
|
39
|
-
const o = t.error || typeof t.data != "object" ? {} : t.data ?? {},
|
|
39
|
+
const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, a = ((U = S.value) == null ? void 0 : U.cookies.map((L) => D[L]).filter(Y)) ?? [], j = ((w = (_ = l.value) == null ? void 0 : _.info) == null ? void 0 : w.title) === "Drafts" ? void 0 : g.value, [h, k] = ue({
|
|
40
40
|
request: i.value,
|
|
41
|
-
example:
|
|
42
|
-
selectedSecuritySchemeUids:
|
|
43
|
-
proxyUrl: ((
|
|
41
|
+
example: n.value,
|
|
42
|
+
selectedSecuritySchemeUids: x.value,
|
|
43
|
+
proxyUrl: ((O = S.value) == null ? void 0 : O.proxyUrl) ?? "",
|
|
44
44
|
environment: o,
|
|
45
|
-
globalCookies:
|
|
45
|
+
globalCookies: a,
|
|
46
46
|
status: u.requestStatus,
|
|
47
|
-
securitySchemes:
|
|
48
|
-
server:
|
|
47
|
+
securitySchemes: z,
|
|
48
|
+
server: j
|
|
49
49
|
});
|
|
50
|
-
if (
|
|
51
|
-
|
|
50
|
+
if (h) {
|
|
51
|
+
d(h.message, "error");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
const [
|
|
56
|
-
|
|
57
|
-
},
|
|
54
|
+
y.value = k.controller;
|
|
55
|
+
const [E, N] = await k.sendRequest();
|
|
56
|
+
q.value = N, E ? d(E.message, "error") : P.push(W(N));
|
|
57
|
+
}, J = async () => {
|
|
58
58
|
var e;
|
|
59
|
-
return (e =
|
|
59
|
+
return (e = y.value) == null ? void 0 : e.abort(ce.REQUEST_ABORTED);
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
u.executeRequest.on(
|
|
63
|
-
}), le(),
|
|
61
|
+
H(() => {
|
|
62
|
+
u.executeRequest.on(b), u.cancelRequest.on(J);
|
|
63
|
+
}), le(), Q(() => u.executeRequest.off(b)), F(
|
|
64
64
|
() => {
|
|
65
65
|
var e;
|
|
66
|
-
return (e =
|
|
66
|
+
return (e = n.value) == null ? void 0 : e.parameters;
|
|
67
67
|
},
|
|
68
68
|
() => {
|
|
69
|
-
|
|
69
|
+
m.value.clear();
|
|
70
70
|
},
|
|
71
71
|
{ deep: !0 }
|
|
72
|
-
)
|
|
72
|
+
);
|
|
73
|
+
const W = (e) => {
|
|
74
|
+
var t;
|
|
75
|
+
try {
|
|
76
|
+
return structuredClone(e);
|
|
77
|
+
} catch {
|
|
78
|
+
const a = { ...e };
|
|
79
|
+
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
|
+
};
|
|
82
|
+
return (e, t) => (f(), G("div", {
|
|
73
83
|
ref_key: "element",
|
|
74
|
-
ref:
|
|
75
|
-
class:
|
|
76
|
-
"!mb-0 !mr-0 !border-0": r(
|
|
84
|
+
ref: I,
|
|
85
|
+
class: V(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
|
|
86
|
+
"!mb-0 !mr-0 !border-0": r(p) === "modal"
|
|
77
87
|
}])
|
|
78
88
|
}, [
|
|
79
|
-
r(
|
|
89
|
+
r(R) ? (f(), C(oe, {
|
|
80
90
|
key: 0,
|
|
81
91
|
modelValue: r(s),
|
|
82
|
-
"onUpdate:modelValue": t[0] || (t[0] = (o) =>
|
|
83
|
-
class:
|
|
92
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => K(s) ? s.value = o : null),
|
|
93
|
+
class: V(["absolute left-3 top-2 z-50", [
|
|
84
94
|
{ hidden: r(s) },
|
|
85
95
|
{ "xl:!flex": !r(s) },
|
|
86
|
-
{ "!flex": r(
|
|
96
|
+
{ "!flex": r(p) === "modal" }
|
|
87
97
|
]])
|
|
88
|
-
}, null, 8, ["modelValue", "class"])) :
|
|
89
|
-
T("div",
|
|
90
|
-
r(
|
|
98
|
+
}, null, 8, ["modelValue", "class"])) : B("", !0),
|
|
99
|
+
T("div", fe, [
|
|
100
|
+
r(R) ? (f(), C(ne, {
|
|
91
101
|
key: 0,
|
|
92
102
|
onNewTab: t[1] || (t[1] = (o) => e.$emit("newTab", o))
|
|
93
|
-
})) :
|
|
94
|
-
T("div",
|
|
95
|
-
|
|
96
|
-
invalidParams:
|
|
97
|
-
selectedSecuritySchemeUids:
|
|
98
|
-
requestResult:
|
|
103
|
+
})) : B("", !0),
|
|
104
|
+
T("div", de, [
|
|
105
|
+
X(r(te), {
|
|
106
|
+
invalidParams: m.value,
|
|
107
|
+
selectedSecuritySchemeUids: x.value,
|
|
108
|
+
requestResult: q.value
|
|
99
109
|
}, null, 8, ["invalidParams", "selectedSecuritySchemeUids", "requestResult"])
|
|
100
110
|
])
|
|
101
111
|
])
|
|
@@ -103,5 +113,5 @@ const me = { class: "flex h-full" }, fe = { class: "flex h-full flex-1 flex-col"
|
|
|
103
113
|
}
|
|
104
114
|
});
|
|
105
115
|
export {
|
|
106
|
-
|
|
116
|
+
Ve as default
|
|
107
117
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue"],"names":[],"mappings":"AAyPA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,UAAU,EAEV,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAKrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAQ1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAuaF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./RequestAuthTab.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-28fb8566"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as F, computed as N, ref as P, openBlock as
|
|
1
|
+
import { defineComponent as F, computed as N, ref as P, openBlock as l, createElementBlock as n, Fragment as p, renderList as g, createBlock as x, unref as d, normalizeClass as C, withCtx as a, createVNode as u, createTextVNode as y, toDisplayString as m, createCommentVNode as v, mergeProps as V, createElementVNode as T, capitalize as _ } from "vue";
|
|
2
2
|
import { useWorkspace as j } from "../../../../store/store.js";
|
|
3
3
|
import q from "./OAuth2.vue.js";
|
|
4
4
|
import w from "./RequestAuthDataTableInput.vue.js";
|
|
@@ -22,7 +22,7 @@ const R = {
|
|
|
22
22
|
workspace: {}
|
|
23
23
|
},
|
|
24
24
|
setup(c) {
|
|
25
|
-
const { securitySchemes: B, securitySchemeMutators: I } = j(),
|
|
25
|
+
const { securitySchemes: B, securitySchemeMutators: I } = j(), U = N(
|
|
26
26
|
() => c.securitySchemeUids.map((t) => ({
|
|
27
27
|
scheme: B[t]
|
|
28
28
|
}))
|
|
@@ -40,20 +40,20 @@ const R = {
|
|
|
40
40
|
envVariables: c.envVariables,
|
|
41
41
|
workspace: c.workspace
|
|
42
42
|
};
|
|
43
|
-
return (t, r) => (
|
|
43
|
+
return (t, r) => (l(!0), n(p, null, g(U.value, ({ scheme: e }) => (l(), n(p, {
|
|
44
44
|
key: e == null ? void 0 : e.uid
|
|
45
45
|
}, [
|
|
46
|
-
|
|
46
|
+
U.value.length > 1 ? (l(), x(d(s), {
|
|
47
47
|
key: 0,
|
|
48
48
|
class: C({
|
|
49
49
|
"request-example-references-header": t.layout === "reference"
|
|
50
50
|
})
|
|
51
51
|
}, {
|
|
52
|
-
default:
|
|
52
|
+
default: a(() => [
|
|
53
53
|
u(d(S), {
|
|
54
|
-
class: C(["
|
|
54
|
+
class: C(["text-c-2 flex items-center pl-3", t.layout === "reference" && "border-b"])
|
|
55
55
|
}, {
|
|
56
|
-
default:
|
|
56
|
+
default: a(() => [
|
|
57
57
|
y(m(K(e)), 1)
|
|
58
58
|
]),
|
|
59
59
|
_: 2
|
|
@@ -61,10 +61,10 @@ const R = {
|
|
|
61
61
|
]),
|
|
62
62
|
_: 2
|
|
63
63
|
}, 1032, ["class"])) : v("", !0),
|
|
64
|
-
e != null && e.description &&
|
|
65
|
-
default:
|
|
66
|
-
u(d(S), { class: "
|
|
67
|
-
default:
|
|
64
|
+
e != null && e.description && U.value.length <= 1 ? (l(), x(d(s), { key: 1 }, {
|
|
65
|
+
default: a(() => [
|
|
66
|
+
u(d(S), { class: "text-c-2 flex items-center overflow-auto whitespace-nowrap pl-3" }, {
|
|
67
|
+
default: a(() => [
|
|
68
68
|
y(m(e.description), 1)
|
|
69
69
|
]),
|
|
70
70
|
_: 2
|
|
@@ -72,9 +72,9 @@ const R = {
|
|
|
72
72
|
]),
|
|
73
73
|
_: 2
|
|
74
74
|
}, 1024)) : v("", !0),
|
|
75
|
-
(e == null ? void 0 : e.type) === "http" ? (
|
|
76
|
-
e.scheme === "bearer" ? (
|
|
77
|
-
default:
|
|
75
|
+
(e == null ? void 0 : e.type) === "http" ? (l(), n(p, { key: 2 }, [
|
|
76
|
+
e.scheme === "bearer" ? (l(), x(d(s), { key: 0 }, {
|
|
77
|
+
default: a(() => [
|
|
78
78
|
u(w, V({ ref_for: !0 }, b, {
|
|
79
79
|
containerClass: t.layout === "reference" && "border-t",
|
|
80
80
|
modelValue: e.token,
|
|
@@ -82,16 +82,16 @@ const R = {
|
|
|
82
82
|
type: "password",
|
|
83
83
|
"onUpdate:modelValue": (o) => k(e.uid, "token", o)
|
|
84
84
|
}), {
|
|
85
|
-
default:
|
|
85
|
+
default: a(() => r[0] || (r[0] = [
|
|
86
86
|
y(" Bearer Token ")
|
|
87
87
|
])),
|
|
88
88
|
_: 2
|
|
89
89
|
}, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
|
|
90
90
|
]),
|
|
91
91
|
_: 2
|
|
92
|
-
}, 1024)) : (e == null ? void 0 : e.scheme) === "basic" ? (
|
|
92
|
+
}, 1024)) : (e == null ? void 0 : e.scheme) === "basic" ? (l(), n(p, { key: 1 }, [
|
|
93
93
|
u(d(s), null, {
|
|
94
|
-
default:
|
|
94
|
+
default: a(() => [
|
|
95
95
|
u(w, V({ ref_for: !0 }, b, {
|
|
96
96
|
class: "text-c-2",
|
|
97
97
|
containerClass: t.layout === "reference" && "auth-blend-required border-t",
|
|
@@ -100,7 +100,7 @@ const R = {
|
|
|
100
100
|
required: "",
|
|
101
101
|
"onUpdate:modelValue": (o) => k(e.uid, "username", o)
|
|
102
102
|
}), {
|
|
103
|
-
default:
|
|
103
|
+
default: a(() => r[1] || (r[1] = [
|
|
104
104
|
y(" Username ")
|
|
105
105
|
])),
|
|
106
106
|
_: 2
|
|
@@ -109,14 +109,14 @@ const R = {
|
|
|
109
109
|
_: 2
|
|
110
110
|
}, 1024),
|
|
111
111
|
u(d(s), null, {
|
|
112
|
-
default:
|
|
112
|
+
default: a(() => [
|
|
113
113
|
u(w, V({ ref_for: !0 }, b, {
|
|
114
114
|
modelValue: e.password,
|
|
115
115
|
placeholder: "********",
|
|
116
116
|
type: "password",
|
|
117
117
|
"onUpdate:modelValue": (o) => k(e.uid, "password", o)
|
|
118
118
|
}), {
|
|
119
|
-
default:
|
|
119
|
+
default: a(() => r[2] || (r[2] = [
|
|
120
120
|
y(" Password ")
|
|
121
121
|
])),
|
|
122
122
|
_: 2
|
|
@@ -125,16 +125,16 @@ const R = {
|
|
|
125
125
|
_: 2
|
|
126
126
|
}, 1024)
|
|
127
127
|
], 64)) : v("", !0)
|
|
128
|
-
], 64)) : (e == null ? void 0 : e.type) === "apiKey" ? (
|
|
128
|
+
], 64)) : (e == null ? void 0 : e.type) === "apiKey" ? (l(), n(p, { key: 3 }, [
|
|
129
129
|
u(d(s), null, {
|
|
130
|
-
default:
|
|
130
|
+
default: a(() => [
|
|
131
131
|
u(w, V({ ref_for: !0 }, b, {
|
|
132
132
|
containerClass: t.layout === "reference" && "border-t",
|
|
133
133
|
modelValue: e.name,
|
|
134
134
|
placeholder: "api-key",
|
|
135
135
|
"onUpdate:modelValue": (o) => k(e.uid, "name", o)
|
|
136
136
|
}), {
|
|
137
|
-
default:
|
|
137
|
+
default: a(() => r[3] || (r[3] = [
|
|
138
138
|
y(" Name ")
|
|
139
139
|
])),
|
|
140
140
|
_: 2
|
|
@@ -143,13 +143,13 @@ const R = {
|
|
|
143
143
|
_: 2
|
|
144
144
|
}, 1024),
|
|
145
145
|
u(d(s), null, {
|
|
146
|
-
default:
|
|
146
|
+
default: a(() => [
|
|
147
147
|
u(w, V({ ref_for: !0 }, b, {
|
|
148
148
|
modelValue: e.value,
|
|
149
149
|
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
150
150
|
"onUpdate:modelValue": (o) => k(e.uid, "value", o)
|
|
151
151
|
}), {
|
|
152
|
-
default:
|
|
152
|
+
default: a(() => r[4] || (r[4] = [
|
|
153
153
|
y(" Value ")
|
|
154
154
|
])),
|
|
155
155
|
_: 2
|
|
@@ -157,12 +157,12 @@ const R = {
|
|
|
157
157
|
]),
|
|
158
158
|
_: 2
|
|
159
159
|
}, 1024)
|
|
160
|
-
], 64)) : (e == null ? void 0 : e.type) === "oauth2" ? (
|
|
160
|
+
], 64)) : (e == null ? void 0 : e.type) === "oauth2" ? (l(), n(p, { key: 4 }, [
|
|
161
161
|
u(d(s), null, {
|
|
162
|
-
default:
|
|
163
|
-
Object.keys(e.flows).length > 1 ? (
|
|
162
|
+
default: a(() => [
|
|
163
|
+
Object.keys(e.flows).length > 1 ? (l(), n("div", R, [
|
|
164
164
|
T("div", z, [
|
|
165
|
-
(
|
|
165
|
+
(l(!0), n(p, null, g(e == null ? void 0 : e.flows, (o, f, $) => (l(), n("button", {
|
|
166
166
|
key: f,
|
|
167
167
|
class: C(["floating-bg text-c-3 relative cursor-pointer border-b-[1px] border-transparent py-1 text-sm font-medium", {
|
|
168
168
|
"!text-c-1 !rounded-none border-b-[1px] !border-current": t.layout !== "reference" && (i.value === f || $ === 0 && !i.value),
|
|
@@ -178,8 +178,8 @@ const R = {
|
|
|
178
178
|
]),
|
|
179
179
|
_: 2
|
|
180
180
|
}, 1024),
|
|
181
|
-
(
|
|
182
|
-
i.value === f || $ === 0 && !i.value ? (
|
|
181
|
+
(l(!0), n(p, null, g(e == null ? void 0 : e.flows, (o, f, $) => (l(), n(p, { key: f }, [
|
|
182
|
+
i.value === f || $ === 0 && !i.value ? (l(), x(q, V({
|
|
183
183
|
key: 0,
|
|
184
184
|
ref_for: !0
|
|
185
185
|
}, b, {
|
|
@@ -190,7 +190,7 @@ const R = {
|
|
|
190
190
|
workspace: t.workspace
|
|
191
191
|
}), null, 16, ["collection", "flow", "scheme", "server", "workspace"])) : v("", !0)
|
|
192
192
|
], 64))), 128))
|
|
193
|
-
], 64)) : (e == null ? void 0 : e.type) === "openIdConnect" ? (
|
|
193
|
+
], 64)) : (e == null ? void 0 : e.type) === "openIdConnect" ? (l(), n("div", Q, " Coming soon ")) : v("", !0)
|
|
194
194
|
], 64))), 128));
|
|
195
195
|
}
|
|
196
196
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestCodeExample.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const r = /* @__PURE__ */
|
|
3
|
+
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-57c43f8c"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|
|
@@ -68,7 +68,7 @@ const D = { class: "w-full" }, E = { class: "-mx-1 flex flex-1" }, N = { class:
|
|
|
68
68
|
return (e, l) => (w(), x("div", D, [
|
|
69
69
|
n(U, {
|
|
70
70
|
class: "group/preview w-full border-b-0",
|
|
71
|
-
defaultOpen: !
|
|
71
|
+
defaultOpen: !0
|
|
72
72
|
}, {
|
|
73
73
|
title: c(() => l[0] || (l[0] = [
|
|
74
74
|
S("Code Snippet")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA4TA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AASrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;
|
|
1
|
+
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA4TA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AASrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAgVF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSection.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-fde565f2"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -109,7 +109,7 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
109
109
|
}, [
|
|
110
110
|
e.collection && e.workspace && (t(u) !== "modal" || Object.keys(t(S) ?? {}).length) ? i((m(), b(F, {
|
|
111
111
|
key: 0,
|
|
112
|
-
class: "request-section-content-auth",
|
|
112
|
+
class: "request-section-content-auth border-b-0",
|
|
113
113
|
id: r.value.Auth,
|
|
114
114
|
collection: e.collection,
|
|
115
115
|
envVariables: e.envVariables,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":"AAkGA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAC9D,CAAC;;AAyKF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ResponseBody.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-51934a33"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as b, ref as C, computed as d, openBlock as o, createBlock as n, createSlots as N, withCtx as u, createTextVNode as
|
|
1
|
+
import { defineComponent as b, ref as C, computed as d, openBlock as o, createBlock as n, createSlots as N, withCtx as u, createTextVNode as w, toDisplayString as g, createElementBlock as T, createElementVNode as _, unref as a, createCommentVNode as s, createVNode as $ } from "vue";
|
|
2
2
|
import E from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
3
|
import { useResponseBody as P } from "../../../hooks/useResponseBody.js";
|
|
4
4
|
import S from "./ResponseBodyDownload.vue.js";
|
|
@@ -10,7 +10,7 @@ import { mediaTypes as I } from "../consts/mediaTypes.js";
|
|
|
10
10
|
const q = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "bg-b-1 flex max-h-[calc(100%-32px)] flex-col overflow-hidden"
|
|
13
|
-
}, z = { class: "flex items-center justify-between border-
|
|
13
|
+
}, z = { class: "flex min-h-8 items-center justify-between border-y px-3 py-1.5" }, A = { class: "text-xxs font-code leading-3" }, X = /* @__PURE__ */ b({
|
|
14
14
|
__name: "ResponseBody",
|
|
15
15
|
props: {
|
|
16
16
|
title: {},
|
|
@@ -29,10 +29,10 @@ const q = {
|
|
|
29
29
|
}), e = d(() => I[i.value.essence]);
|
|
30
30
|
return (t, m) => (o(), n(E, { class: "max-h-content overflow-y-hidden" }, N({
|
|
31
31
|
title: u(() => [
|
|
32
|
-
|
|
32
|
+
w(g(t.title), 1)
|
|
33
33
|
]),
|
|
34
34
|
default: u(() => {
|
|
35
|
-
var f, v, y,
|
|
35
|
+
var f, v, y, h;
|
|
36
36
|
return [
|
|
37
37
|
t.data ? (o(), T("div", q, [
|
|
38
38
|
_("div", z, [
|
|
@@ -55,9 +55,9 @@ const q = {
|
|
|
55
55
|
src: a(l),
|
|
56
56
|
type: a(i).essence
|
|
57
57
|
}, null, 8, ["alpha", "mode", "src", "type"])) : s("", !0),
|
|
58
|
-
!((y = e.value) != null && y.raw) && !((
|
|
58
|
+
!((y = e.value) != null && y.raw) && !((h = e.value) != null && h.preview) ? (o(), n(U, { key: 2 }, {
|
|
59
59
|
default: u(() => m[1] || (m[1] = [
|
|
60
|
-
|
|
60
|
+
w(" Binary file ")
|
|
61
61
|
])),
|
|
62
62
|
_: 1
|
|
63
63
|
})) : s("", !0)
|
|
@@ -37,7 +37,7 @@ const P = { class: "col-1 flex-center relative gap-6 p-2 capitalize" }, T = {
|
|
|
37
37
|
}));
|
|
38
38
|
}, y = (s) => {
|
|
39
39
|
s != null && s.createNew && w.name === "request" && k();
|
|
40
|
-
}, N = "2.3.
|
|
40
|
+
}, N = "2.3.12";
|
|
41
41
|
return B(() => r.hotKeys.on(y)), E(() => r.hotKeys.off(y)), (s, e) => (u(), i("div", P, [
|
|
42
42
|
o("div", {
|
|
43
43
|
class: q(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { useActiveEntities as
|
|
1
|
+
import { useActiveEntities as D } from "../../../store/active-entities.js";
|
|
2
2
|
import { specDictionary as f } from "../../../store/import-spec.js";
|
|
3
|
-
import { combineRenameDiffs as
|
|
4
|
-
import {
|
|
3
|
+
import { combineRenameDiffs as R, mutateCollectionDiff as d, mutateSecuritySchemeDiff as g, mutateServerDiff as S, mutateTagDiff as T, mutateRequestDiff as M } from "../libs/watch-mode.js";
|
|
4
|
+
import { fetchDocument as I, createHash as C } from "@scalar/oas-utils/helpers";
|
|
5
5
|
import { parseSchema as O } from "@scalar/oas-utils/transforms";
|
|
6
|
-
import { useToasts as
|
|
7
|
-
import { useTimeoutPoll as
|
|
8
|
-
import
|
|
6
|
+
import { useToasts as L } from "@scalar/use-toasts";
|
|
7
|
+
import { useTimeoutPoll as N } from "@vueuse/core";
|
|
8
|
+
import U from "microdiff";
|
|
9
9
|
import { watch as b } from "vue";
|
|
10
10
|
import { useWorkspace as P } from "../../../store/store.js";
|
|
11
11
|
const k = 5 * 1e3, q = 60 * 1e3, J = () => {
|
|
12
|
-
const { toast: h } =
|
|
13
|
-
e.path[0] === "info" || e.path[0] === "security" ? d(e, c, o) ||
|
|
14
|
-
}, { pause: p, resume: m } =
|
|
12
|
+
const { toast: h } = L(), c = D(), o = P(), { activeCollection: s, activeWorkspace: W } = c, { collectionMutators: n } = o, a = (e) => h(`[useOpenApiWatcher] Changes to the ${e} were not applied`, "error"), w = (e) => {
|
|
13
|
+
e.path[0] === "info" || e.path[0] === "security" ? d(e, c, o) || a("collection") : e.path[0] === "components" && e.path[1] === "securitySchemes" ? g(e, c, o) || a("securitySchemes") : e.path[0] === "servers" ? S(e, c, o) || a("servers") : e.path[0] === "tags" ? T(e, c, o) || a("tags") : e.path[0] === "paths" && (M(e, c, o) || a("requests"));
|
|
14
|
+
}, { pause: p, resume: m } = N(async () => {
|
|
15
15
|
var l, v;
|
|
16
|
-
const e = (l =
|
|
16
|
+
const e = (l = s.value) == null ? void 0 : l.documentUrl;
|
|
17
17
|
if (!e)
|
|
18
18
|
return;
|
|
19
|
-
const
|
|
19
|
+
const t = f[e];
|
|
20
20
|
try {
|
|
21
|
-
const
|
|
22
|
-
if (n.edit(
|
|
23
|
-
if (
|
|
24
|
-
const { schema:
|
|
21
|
+
const i = await I(e, (v = W.value) == null ? void 0 : v.proxyUrl, !1), u = C(i);
|
|
22
|
+
if (n.edit(s.value.uid, "watchModeStatus", "WATCHING"), t != null && t.hash)
|
|
23
|
+
if (t.hash && t.hash !== u) {
|
|
24
|
+
const { schema: r } = await O(i), A = U(t.schema, r), y = R(A);
|
|
25
25
|
try {
|
|
26
26
|
y.forEach(w), f[e] = {
|
|
27
27
|
hash: u,
|
|
28
|
-
schema:
|
|
28
|
+
schema: r
|
|
29
29
|
};
|
|
30
30
|
} catch (E) {
|
|
31
31
|
console.error("[useOpenApiWatcher] Error:", E);
|
|
@@ -33,14 +33,14 @@ const k = 5 * 1e3, q = 60 * 1e3, J = () => {
|
|
|
33
33
|
} else
|
|
34
34
|
console.log("[useOpenApiWatcher] No changes detected yet…");
|
|
35
35
|
else {
|
|
36
|
-
const { schema:
|
|
37
|
-
|
|
36
|
+
const { schema: r } = await O(i);
|
|
37
|
+
r && (f[e] = {
|
|
38
38
|
hash: u,
|
|
39
|
-
schema:
|
|
39
|
+
schema: r
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
} catch (
|
|
43
|
-
console.error("[useOpenApiWatcher] Error:",
|
|
42
|
+
} catch (i) {
|
|
43
|
+
console.error("[useOpenApiWatcher] Error:", i), console.info("[useOpenApiWatcher] Pausing watcher for 60 seconds"), p(), n.edit(s.value.uid, "watchModeStatus", "ERROR"), h("[useOpenApiWatcher] Unable to fetch the spec file, paused the watcher for 60 seconds", "error"), setTimeout(() => {
|
|
44
44
|
console.info("[useOpenApiWatcher] Resuming watcher"), m();
|
|
45
45
|
}, q);
|
|
46
46
|
}
|
|
@@ -48,13 +48,13 @@ const k = 5 * 1e3, q = 60 * 1e3, J = () => {
|
|
|
48
48
|
b(
|
|
49
49
|
[() => {
|
|
50
50
|
var e;
|
|
51
|
-
return (e =
|
|
51
|
+
return (e = s.value) == null ? void 0 : e.documentUrl;
|
|
52
52
|
}, () => {
|
|
53
53
|
var e;
|
|
54
|
-
return (e =
|
|
54
|
+
return (e = s.value) == null ? void 0 : e.watchMode;
|
|
55
55
|
}],
|
|
56
|
-
([e,
|
|
57
|
-
e &&
|
|
56
|
+
([e, t]) => {
|
|
57
|
+
e && t ? (console.info(`[useOpenApiWatcher] Watching ${e} …`), m()) : s.value && (p(), n.edit(s.value.uid, "watchModeStatus", "IDLE"));
|
|
58
58
|
},
|
|
59
59
|
{ immediate: !0 }
|
|
60
60
|
);
|