@scalar/api-client 2.1.39 → 2.1.41

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts +3 -0
  3. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  4. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  5. package/dist/components/CodeInput/CodeInput.vue2.js +105 -84
  6. package/dist/components/CodeInput/codeVariableWidget.d.ts +3 -0
  7. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  8. package/dist/components/CodeInput/codeVariableWidget.js +51 -47
  9. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  10. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +102 -129
  11. package/dist/components/ImportCollection/PrefetchError.vue.d.ts +2 -3
  12. package/dist/components/ImportCollection/PrefetchError.vue.d.ts.map +1 -1
  13. package/dist/components/ImportCollection/PrefetchError.vue.js +27 -0
  14. package/dist/components/ImportCollection/PrefetchError.vue2.js +4 -0
  15. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +11 -17
  16. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
  17. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +72 -29
  18. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  19. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
  20. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +20 -28
  21. package/dist/components/Sidebar/SidebarButton.vue.d.ts +5 -3
  22. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  23. package/dist/components/Sidebar/SidebarButton.vue.js +16 -16
  24. package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
  25. package/dist/components/Sidebar/SidebarList.vue.js +5 -5
  26. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +1 -1
  27. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  28. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  29. package/dist/layouts/App/ApiClientApp.vue.js +37 -37
  30. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  31. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  32. package/dist/layouts/Modal/ApiClientModal.vue2.js +23 -21
  33. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  34. package/dist/layouts/Web/ApiClientWeb.vue.js +30 -30
  35. package/dist/store/environment.js +1 -1
  36. package/dist/style.css +1 -1
  37. package/dist/views/Cookies/Cookies.vue.d.ts +1 -5
  38. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  39. package/dist/views/Cookies/Cookies.vue2.js +58 -61
  40. package/dist/views/Environment/Environment.vue.d.ts +1 -5
  41. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  42. package/dist/views/Environment/Environment.vue2.js +142 -96
  43. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  44. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +17 -18
  45. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  46. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +36 -34
  47. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  48. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +3 -3
  49. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +25 -25
  50. package/dist/views/Request/libs/oauth2.d.ts +2 -2
  51. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  52. package/dist/views/Request/libs/oauth2.js +45 -36
  53. package/package.json +7 -6
@@ -1,178 +1,151 @@
1
- import { defineComponent as K, ref as w, computed as c, watch as u, onMounted as R, onUnmounted as G, resolveComponent as H, openBlock as a, createBlock as p, unref as s, withCtx as k, createElementVNode as e, normalizeClass as J, createCommentVNode as f, toDisplayString as I, createElementBlock as x, Fragment as Q, createVNode as i, createTextVNode as C } from "vue";
2
- import X from "../CommandPalette/WatchModeToggle.vue.js";
3
- import { useUrlPrefetcher as Y } from "./hooks/useUrlPrefetcher.js";
4
- import { getOpenApiDocumentVersion as M } from "./utils/getOpenApiDocumentVersion.js";
5
- import { isDocument as A } from "./utils/isDocument.js";
1
+ import { defineComponent as z, ref as S, computed as i, watch as p, onMounted as B, onUnmounted as F, openBlock as c, createBlock as g, unref as r, withCtx as O, createElementVNode as t, normalizeClass as T, createElementBlock as m, Fragment as f, createVNode as a, createCommentVNode as x, toDisplayString as q, createTextVNode as w } from "vue";
2
+ import E from "../CommandPalette/WatchModeToggle.vue.js";
3
+ import W from "./ImportNowButton.vue.js";
4
+ import K from "./IntegrationLogo.vue.js";
5
+ import R from "./PrefetchError.vue.js";
6
+ import G from "./WorkspaceSelector.vue.js";
7
+ import { useUrlPrefetcher as H } from "./hooks/useUrlPrefetcher.js";
8
+ import { getOpenApiDocumentVersion as k } from "./utils/getOpenApiDocumentVersion.js";
9
+ import { isDocument as I } from "./utils/isDocument.js";
6
10
  import { isUrl as h } from "./utils/isUrl.js";
7
- import { useModal as L, ScalarModal as U, ScalarIcon as P, ScalarCodeBlock as Z } from "@scalar/components";
8
- import { isLocalUrl as ee } from "@scalar/oas-utils/helpers";
9
- import { normalize as te } from "@scalar/openapi-parser";
10
- import oe from "./ImportNowButton.vue.js";
11
- import se from "./IntegrationLogo.vue.js";
12
- import re from "./WorkspaceSelector.vue.js";
13
- import { useWorkspace as ne } from "../../store/store.js";
14
- const le = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, ie = { class: "text-center text-md font-bold mb-2 line-clamp-1" }, ce = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, ae = { class: "flex justify-center" }, de = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, me = {
11
+ import { useModal as J, ScalarModal as Q, ScalarIcon as X } from "@scalar/components";
12
+ import { isLocalUrl as Y } from "@scalar/oas-utils/helpers";
13
+ import { normalize as Z } from "@scalar/openapi-parser";
14
+ import { useWorkspace as ee } from "../../store/store.js";
15
+ const te = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, oe = { class: "text-center text-md font-bold mb-2 line-clamp-1" }, se = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, ne = { class: "flex justify-center" }, re = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, le = {
15
16
  key: 0,
16
17
  class: "text-sm overflow-hidden mt-5 pt-4 border-t-1/2"
17
- }, ue = { class: "flex items-center justify-center" }, pe = {
18
- key: 3,
19
- class: "flex flex-col gap-2"
20
- }, fe = { class: "flex gap-2 items-center p-3 font-code text-sm border rounded" }, xe = { class: "bg-b-2 h-48 border rounded custom-scroll" }, he = { class: "flex flex-col justify-center items-center pb-8" }, ve = { class: "text-center flex items-center flex-col" }, _e = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, ye = {
18
+ }, ie = { class: "flex items-center justify-center" }, ce = { class: "flex flex-col justify-center items-center pb-8" }, ae = { class: "text-center flex items-center flex-col" }, me = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, de = {
21
19
  href: "https://scalar.com/download",
22
20
  target: "_blank"
23
- }, be = { class: "text-sm" }, De = /* @__PURE__ */ K({
21
+ }, Le = /* @__PURE__ */ z({
24
22
  __name: "ImportCollectionModal",
25
23
  props: {
26
24
  source: {},
27
25
  integration: {}
28
26
  },
29
27
  emits: ["importFinished"],
30
- setup(S) {
31
- const n = S, { activeWorkspace: V, events: z } = ne(), { prefetchResult: r, prefetchUrl: D } = Y(), l = L(), E = L(), j = w(""), d = w(!0);
32
- z.hotKeys.on(() => l.hide());
33
- const B = c(() => {
28
+ setup(A) {
29
+ const n = A, { activeWorkspace: L, events: U } = ee(), { prefetchResult: s, prefetchUrl: C } = H(), l = J(), d = S(!0);
30
+ U.hotKeys.on(() => l.hide());
31
+ const M = i(() => {
34
32
  try {
35
- return te(
36
- r.content || n.source || ""
33
+ return Z(
34
+ s.content || n.source || ""
37
35
  );
38
36
  } catch {
39
37
  return;
40
38
  }
41
- }), N = c(() => {
42
- var o, t;
43
- return (t = (o = B.value) == null ? void 0 : o.info) == null ? void 0 : t.title;
44
- }), v = c(
45
- () => M(r.content || n.source || "")
39
+ }), V = i(() => {
40
+ var o, e;
41
+ return (e = (o = M.value) == null ? void 0 : o.info) == null ? void 0 : e.title;
42
+ }), v = i(
43
+ () => k(s.content || n.source || "")
46
44
  );
47
- u(
45
+ p(
48
46
  () => n.source,
49
47
  (o) => {
50
- h(o) && D(o, V.value.proxyUrl), o && (h(o) || A(o) && M(o)) ? l.show() : l.hide();
48
+ h(o) && C(o, L.value.proxyUrl), o && (h(o) || I(o) && k(o)) ? l.show() : l.hide();
51
49
  }
52
50
  );
53
- const $ = c(() => !!n.source && h(n.source)), F = c(() => !!n.source && A(n.source)), O = c(() => r.url && ee(r.url)), m = (o) => {
54
- document.body.classList.remove("has-no-import-url"), ($.value || F.value) && l.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
55
- }, T = () => {
51
+ const D = i(() => !!n.source && h(n.source)), N = i(() => !!n.source && I(n.source)), P = i(() => s.url && Y(s.url)), u = (o) => {
52
+ document.body.classList.remove("has-no-import-url"), (D.value || N.value) && l.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
53
+ }, $ = () => {
56
54
  document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
57
55
  };
58
- return u(
56
+ return p(
59
57
  () => l.open,
60
58
  (o) => {
61
- o ? m() : T();
59
+ o ? u() : $();
62
60
  }
63
- ), u(
61
+ ), p(
64
62
  () => n.source,
65
63
  () => {
66
- m();
64
+ u();
67
65
  }
68
- ), R(() => {
69
- m();
70
- }), G(() => {
66
+ ), B(() => {
67
+ u();
68
+ }), F(() => {
71
69
  document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
72
- }), (o, t) => {
73
- const q = H("PrefetchError");
74
- return a(), p(s(U), {
75
- size: "full",
76
- state: s(l)
77
- }, {
78
- default: k(() => {
79
- var _, y, b, g;
80
- return [
81
- e("div", le, [
82
- e("div", {
83
- class: J(["flex items-center flex-col m-auto px-8 py-8 rounded-xl border-1/2 max-w-[380px] w-full transition-opacity", { "opacity-0": s(r).state === "loading" }])
84
- }, [
85
- O.value ? (a(), p(se, {
70
+ }), (o, e) => (c(), g(r(Q), {
71
+ size: "full",
72
+ state: r(l)
73
+ }, {
74
+ default: O(() => {
75
+ var y, b, _;
76
+ return [
77
+ t("div", te, [
78
+ t("div", {
79
+ class: T(["flex items-center flex-col m-auto px-8 py-8 rounded-xl border-1/2 max-w-[380px] w-full transition-opacity", { "opacity-0": r(s).state === "loading" }])
80
+ }, [
81
+ r(s).error && r(s).state === "idle" && !v.value ? (c(), m(f, { key: 0 }, [
82
+ e[2] || (e[2] = t("div", { class: "text-center text-md font-bold mb-2 line-clamp-1" }, " No OpenAPI document found ", -1)),
83
+ a(R, {
84
+ url: ((y = r(s)) == null ? void 0 : y.input) || n.source
85
+ }, null, 8, ["url"])
86
+ ], 64)) : (c(), m(f, { key: 1 }, [
87
+ P.value ? (c(), g(K, {
86
88
  key: 0,
87
89
  integration: o.integration
88
- }, null, 8, ["integration"])) : f("", !0),
89
- e("div", ie, I(N.value ?? "Untitled Collection"), 1),
90
- t[5] || (t[5] = e("div", { class: "text-c-1 text-sm font-medium mb-2 text-center text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
91
- s(r).error ? (a(), p(q, {
92
- key: 1,
93
- result: s(r)
94
- }, null, 8, ["result"])) : v.value ? (a(), x(Q, { key: 2 }, [
95
- e("div", ce, [
96
- i(oe, {
97
- source: ((_ = s(r)) == null ? void 0 : _.url) ?? o.source,
90
+ }, null, 8, ["integration"])) : x("", !0),
91
+ t("div", oe, q(V.value || "Untitled Collection"), 1),
92
+ e[5] || (e[5] = t("div", { class: "text-c-1 text-sm font-medium text-center text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
93
+ v.value ? (c(), m(f, { key: 1 }, [
94
+ t("div", se, [
95
+ a(W, {
96
+ source: ((b = r(s)) == null ? void 0 : b.url) ?? o.source,
98
97
  variant: "button",
99
98
  watchMode: d.value,
100
- onImportFinished: t[0] || (t[0] = () => o.$emit("importFinished"))
99
+ onImportFinished: e[0] || (e[0] = () => o.$emit("importFinished"))
101
100
  }, null, 8, ["source", "watchMode"])
102
101
  ]),
103
- e("div", ae, [
104
- e("div", de, [
105
- t[2] || (t[2] = C(" Import to: ")),
106
- i(re)
102
+ t("div", ne, [
103
+ t("div", re, [
104
+ e[3] || (e[3] = w(" Import to: ")),
105
+ a(G)
107
106
  ])
108
107
  ]),
109
- (y = s(r)) != null && y.url ? (a(), x("div", me, [
110
- e("div", ue, [
111
- i(X, {
108
+ (_ = r(s)) != null && _.url ? (c(), m("div", le, [
109
+ t("div", ie, [
110
+ a(E, {
112
111
  modelValue: d.value,
113
- "onUpdate:modelValue": t[1] || (t[1] = (W) => d.value = W),
112
+ "onUpdate:modelValue": e[1] || (e[1] = (j) => d.value = j),
114
113
  disableToolTip: !0
115
114
  }, null, 8, ["modelValue"])
116
115
  ]),
117
- t[3] || (t[3] = e("div", { class: "pt-0 text-center text-balance font-medium text-xs text-c-3" }, " Automatically update your API client when the OpenAPI document content changes. ", -1))
118
- ])) : f("", !0)
119
- ], 64)) : v.value ? f("", !0) : (a(), x("div", pe, [
120
- e("div", fe, [
121
- i(s(P), {
122
- class: "text-red",
123
- icon: "Error",
124
- size: "sm"
125
- }),
126
- t[4] || (t[4] = e("div", null, " This doesn’t look like a valid OpenAPI/Swagger document. ", -1))
127
- ]),
128
- e("div", xe, [
129
- i(s(Z), {
130
- content: ((b = s(r).content) == null ? void 0 : b.trim()) || ((g = n.source) == null ? void 0 : g.trim()) || "",
131
- copy: !1
132
- }, null, 8, ["content"])
116
+ e[4] || (e[4] = t("div", { class: "pt-0 text-center text-balance font-medium text-xs text-c-3" }, " Automatically update your API client when the OpenAPI document content changes. ", -1))
117
+ ])) : x("", !0)
118
+ ], 64)) : x("", !0)
119
+ ], 64))
120
+ ], 2),
121
+ t("div", ce, [
122
+ t("div", ae, [
123
+ t("div", me, [
124
+ t("a", de, [
125
+ a(r(X), {
126
+ icon: "Logo",
127
+ size: "xl"
128
+ })
133
129
  ])
134
- ]))
135
- ], 2),
136
- e("div", he, [
137
- e("div", ve, [
138
- e("div", _e, [
139
- e("a", ye, [
140
- i(s(P), {
141
- icon: "Logo",
142
- size: "xl"
143
- })
144
- ])
145
- ]),
146
- t[6] || (t[6] = e("span", { class: "text-c-2 leading-snug text-sm font-medium" }, [
147
- e("a", {
148
- class: "hover:text-c-1 underline-offset-2 mb-1 inline-block",
149
- href: "https://scalar.com/download",
150
- target: "_blank"
151
- }, " Download Desktop App "),
152
- e("br"),
153
- C(" free · open-source · offline first ")
154
- ], -1))
155
- ])
156
- ]),
157
- i(s(U), {
158
- size: "md",
159
- state: s(E),
160
- title: "Error Details",
161
- variant: "error"
162
- }, {
163
- default: k(() => [
164
- e("div", be, I(j.value), 1)
165
130
  ]),
166
- _: 1
167
- }, 8, ["state"])
131
+ e[6] || (e[6] = t("span", { class: "text-c-2 leading-snug text-sm font-medium" }, [
132
+ t("a", {
133
+ class: "hover:text-c-1 underline-offset-2 mb-1 inline-block",
134
+ href: "https://scalar.com/download",
135
+ target: "_blank"
136
+ }, " Download Desktop App "),
137
+ t("br"),
138
+ w(" free · open-source · offline first ")
139
+ ], -1))
140
+ ])
168
141
  ])
169
- ];
170
- }),
171
- _: 1
172
- }, 8, ["state"]);
173
- };
142
+ ])
143
+ ];
144
+ }),
145
+ _: 1
146
+ }, 8, ["state"]));
174
147
  }
175
148
  });
176
149
  export {
177
- De as default
150
+ Le as default
178
151
  };
@@ -1,8 +1,7 @@
1
- import type { PrefetchResult } from '../../components/ImportCollection/hooks/useUrlPrefetcher.js';
2
1
  declare const _default: import("vue").DefineComponent<{
3
- prefetchResult: PrefetchResult;
2
+ url?: string | null;
4
3
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
5
- prefetchResult: PrefetchResult;
4
+ url?: string | null;
6
5
  }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
6
  export default _default;
8
7
  //# sourceMappingURL=PrefetchError.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PrefetchError.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/PrefetchError.vue"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAA;;oBAOxE,cAAc;;oBAAd,cAAc;;AA2GhC,wBAMG"}
1
+ {"version":3,"file":"PrefetchError.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/PrefetchError.vue"],"names":[],"mappings":";UA8BQ,MAAM,GAAG,IAAI;;UAAb,MAAM,GAAG,IAAI;;AAwDrB,wBAMG"}
@@ -0,0 +1,27 @@
1
+ import { defineComponent as l, openBlock as n, createElementBlock as o, createTextVNode as r, unref as d } from "vue";
2
+ import { isUrl as s } from "../../libs/isUrl.js";
3
+ const a = { class: "text-sm break-words text-center w-full font-medium" }, u = ["href"], m = {
4
+ key: 1,
5
+ textContent: "OpenAPI document manually"
6
+ }, c = /* @__PURE__ */ l({
7
+ __name: "PrefetchError",
8
+ props: {
9
+ url: {}
10
+ },
11
+ setup(p) {
12
+ return (t, e) => (n(), o("div", a, [
13
+ e[0] || (e[0] = r(" We couldn’t find an OpenAPI document at the provided URL. Please download and import the ")),
14
+ t.url && d(s)(t.url) ? (n(), o("a", {
15
+ key: 0,
16
+ href: t.url,
17
+ rel: "noopener nofollow",
18
+ target: "_blank",
19
+ textContent: "OpenAPI document manually"
20
+ }, null, 8, u)) : (n(), o("span", m)),
21
+ e[1] || (e[1] = r(". "))
22
+ ]));
23
+ }
24
+ });
25
+ export {
26
+ c as default
27
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./PrefetchError.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,25 +1,10 @@
1
1
  export type PrefetchResult = {
2
2
  state: 'idle' | 'loading';
3
3
  content: string | null;
4
+ input: string | null;
4
5
  url: string | null;
5
6
  error: string | null;
6
7
  };
7
- /**
8
- * Core logic for fetching and processing a URL
9
- */
10
- export declare function createUrlPrefetcher(): {
11
- prefetchUrl: (value: string | null, proxy?: string) => Promise<{
12
- state: string;
13
- content: string;
14
- url: string;
15
- error: null;
16
- } | {
17
- state: string;
18
- content: null;
19
- url: null;
20
- error: any;
21
- }>;
22
- };
23
8
  /**
24
9
  * Vue composable for URL prefetching
25
10
  */
@@ -27,18 +12,27 @@ export declare function useUrlPrefetcher(): {
27
12
  prefetchResult: {
28
13
  state: "idle" | "loading";
29
14
  content: string | null;
15
+ input: string | null;
30
16
  url: string | null;
31
17
  error: string | null;
32
18
  };
33
- prefetchUrl: (value: string | null, proxy?: string) => Promise<{
19
+ prefetchUrl: (input: string | null, proxy?: string) => Promise<{
20
+ state: string;
21
+ content: null;
22
+ url: null;
23
+ input: string | null;
24
+ error: null;
25
+ } | {
34
26
  state: string;
35
27
  content: string;
36
28
  url: string;
37
29
  error: null;
30
+ input?: undefined;
38
31
  } | {
39
32
  state: string;
40
33
  content: null;
41
34
  url: null;
35
+ input: string;
42
36
  error: any;
43
37
  }>;
44
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useUrlPrefetcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/hooks/useUrlPrefetcher.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,wBAAgB,mBAAmB;yBACC,MAAM,GAAG,IAAI,UAAU,MAAM;;;;;;;;;;;EAgChE;AAED;;GAEG;AACH,wBAAgB,gBAAgB;;eA/CvB,MAAM,GAAG,SAAS;iBAChB,MAAM,GAAG,IAAI;aACjB,MAAM,GAAG,IAAI;eACX,MAAM,GAAG,IAAI;;yBAuDX,MAAM,GAAG,IAAI,UACZ,MAAM;;;;;;;;;;;EAoBjB"}
1
+ {"version":3,"file":"useUrlPrefetcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/hooks/useUrlPrefetcher.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,wBAAgB,gBAAgB;;eAVvB,MAAM,GAAG,SAAS;iBAChB,MAAM,GAAG,IAAI;eACf,MAAM,GAAG,IAAI;aACf,MAAM,GAAG,IAAI;eACX,MAAM,GAAG,IAAI;;yBAuGX,MAAM,GAAG,IAAI,UACZ,MAAM;;;;;;;;;;;;;;;;;;;EAmBjB"}
@@ -1,47 +1,90 @@
1
- import { fetchWithProxyFallback as s } from "@scalar/oas-utils/helpers";
2
- import { reactive as o } from "vue";
3
- function u() {
4
- async function r(e, c) {
5
- var n;
6
- if (!e || typeof e != "string")
7
- return { state: "idle", content: null, url: null, error: null };
1
+ import { resolve as a } from "@scalar/import";
2
+ import { redirectToProxy as i, fetchWithProxyFallback as f } from "@scalar/oas-utils/helpers";
3
+ import { reactive as d } from "vue";
4
+ import { isUrl as h } from "../../../libs/isUrl.js";
5
+ function v() {
6
+ const l = d({
7
+ state: "idle",
8
+ content: null,
9
+ url: null,
10
+ input: null,
11
+ error: null
12
+ });
13
+ async function u(t, r) {
14
+ if (!t)
15
+ return {
16
+ state: "idle",
17
+ content: null,
18
+ url: null,
19
+ input: t,
20
+ error: null
21
+ };
8
22
  try {
9
- const t = await s(e, c);
10
- return t.ok ? { state: "idle", content: await t.text(), url: e, error: null } : {
23
+ const e = await a(t, {
24
+ fetch: (c) => fetch(r ? i(r, c) : c, {
25
+ cache: "no-cache"
26
+ })
27
+ });
28
+ if (typeof e == "object" && e !== null)
29
+ return { state: "idle", content: JSON.stringify(e, null, 2), url: t, error: null };
30
+ if (e === void 0)
31
+ return {
32
+ state: "idle",
33
+ content: null,
34
+ url: null,
35
+ input: t,
36
+ error: `Could not find an OpenAPI document in ${t}`
37
+ };
38
+ if (!h(e))
39
+ return {
40
+ state: "idle",
41
+ content: null,
42
+ url: null,
43
+ input: t,
44
+ error: "Oops, we got invalid content for the given URL."
45
+ };
46
+ const o = e, n = await f(o, {
47
+ proxy: r,
48
+ cache: "no-cache"
49
+ });
50
+ return n.ok ? {
51
+ state: "idle",
52
+ content: await n.text(),
53
+ url: o,
54
+ error: null
55
+ } : {
11
56
  state: "idle",
12
57
  content: null,
13
58
  url: null,
14
- error: `Couldn't fetch ${e}, got error ${[t.status, t.statusText].join(" ").trim()}.`
59
+ input: t,
60
+ error: `Couldn't fetch ${o}, got error ${[n.status, n.statusText].join(" ").trim()}.`
61
+ };
62
+ } catch (e) {
63
+ return console.error("[prefetchDocument]", e), {
64
+ state: "idle",
65
+ content: null,
66
+ url: null,
67
+ input: t,
68
+ error: e.message
15
69
  };
16
- } catch (t) {
17
- return console.error("[prefetchDocument]", t), { state: "idle", content: null, url: null, error: (n = t == null ? void 0 : t.message) != null && n.includes("Can’t fetch") ? `Couldn't reach ${e} — is it publicly accessible?` : t == null ? void 0 : t.message };
18
70
  }
19
71
  }
20
- return { prefetchUrl: r };
21
- }
22
- function f() {
23
- const r = o({
24
- state: "idle",
25
- content: null,
26
- url: null,
27
- error: null
28
- }), { prefetchUrl: e } = u();
29
- async function c(n, t) {
30
- Object.assign(r, {
72
+ async function s(t, r) {
73
+ Object.assign(l, {
31
74
  state: "loading",
32
75
  content: null,
33
76
  url: null,
77
+ input: t,
34
78
  error: null
35
79
  });
36
- const l = await e(n, t);
37
- return Object.assign(r, l), l;
80
+ const e = await u(t, r);
81
+ return Object.assign(l, e), e;
38
82
  }
39
83
  return {
40
- prefetchResult: r,
41
- prefetchUrl: c
84
+ prefetchResult: l,
85
+ prefetchUrl: s
42
86
  };
43
87
  }
44
88
  export {
45
- u as createUrlPrefetcher,
46
- f as useUrlPrefetcher
89
+ v as useUrlPrefetcher
47
90
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarListElementForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Sidebar/Actions/SidebarListElementForm.vue"],"names":[],"mappings":"AA6FA,iBAAS,cAAc;qBA8FM,GAAG;EAsB/B;AACD,QAAA,MAAM,eAAe;aAlJV,OAAO;YACR,MAAM;;;;;aADL,OAAO;YACR,MAAM;;;;kFA2Jd,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SidebarListElementForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Sidebar/Actions/SidebarListElementForm.vue"],"names":[],"mappings":"AAuEA,iBAAS,cAAc;qBAmGM,GAAG;EAoB/B;AACD,QAAA,MAAM,eAAe;aA3IV,OAAO;YACR,MAAM;;;;;aADL,OAAO;YACR,MAAM;;;;kFAoJd,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SidebarListElementForm.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c3d3d457"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-194bccb5"]]);
5
5
  export {
6
6
  a as default
7
7
  };
@@ -1,53 +1,45 @@
1
- import { defineComponent as p, openBlock as d, createElementBlock as c, withModifiers as f, renderSlot as b, createElementVNode as g, createVNode as a, unref as t, withCtx as s, createTextVNode as r, normalizeClass as v, toDisplayString as x } from "vue";
1
+ import { defineComponent as u, openBlock as m, createElementBlock as d, withModifiers as f, renderSlot as c, createElementVNode as b, createVNode as n, unref as a, withCtx as r, createTextVNode as s, toDisplayString as v } from "vue";
2
2
  import { ScalarButton as l } from "@scalar/components";
3
- import { cva as w, cx as S } from "cva";
4
- const y = { class: "flex gap-10 justify-between" }, E = /* @__PURE__ */ p({
3
+ const g = { class: "flex gap-10 justify-between" }, y = /* @__PURE__ */ u({
5
4
  __name: "SidebarListElementForm",
6
5
  props: {
7
6
  danger: { type: Boolean },
8
7
  label: {}
9
8
  },
10
9
  emits: ["cancel", "submit"],
11
- setup(C, { emit: i }) {
12
- const o = i, m = w({
13
- base: "gap-1.5 font-medium px-2.5 h-8 shadow-none focus:outline-none",
14
- variants: {
15
- danger: {
16
- true: "delete-warning-button",
17
- false: ""
18
- }
19
- }
20
- });
21
- return (n, e) => (d(), c("form", {
10
+ setup(x, { emit: i }) {
11
+ const o = i;
12
+ return (t, e) => (m(), d("form", {
22
13
  class: "flex flex-col gap-4 text-base",
23
- onSubmit: e[1] || (e[1] = f((u) => o("submit"), ["prevent"]))
14
+ onSubmit: e[1] || (e[1] = f((p) => o("submit"), ["prevent"]))
24
15
  }, [
25
- b(n.$slots, "default", {}, void 0, !0),
26
- g("div", y, [
27
- a(t(l), {
16
+ c(t.$slots, "default", {}, void 0, !0),
17
+ b("div", g, [
18
+ n(a(l), {
28
19
  class: "gap-1.5 px-2.5 h-8 shadow-none focus:outline-none flex items-center cursor-pointer",
29
20
  type: "button",
30
21
  variant: "outlined",
31
- onClick: e[0] || (e[0] = (u) => o("cancel"))
22
+ onClick: e[0] || (e[0] = (p) => o("cancel"))
32
23
  }, {
33
- default: s(() => e[2] || (e[2] = [
34
- r(" Cancel ")
24
+ default: r(() => e[2] || (e[2] = [
25
+ s(" Cancel ")
35
26
  ])),
36
27
  _: 1
37
28
  }),
38
- a(t(l), {
39
- class: v(["custom-scroll whitespace-nowrap", t(S)(t(m)({ danger: n.danger }))]),
40
- type: "submit"
29
+ n(a(l), {
30
+ class: "gap-1.5 font-medium px-2.5 h-8 shadow-none focus:outline-none custom-scroll whitespace-nowrap",
31
+ type: "submit",
32
+ variant: t.danger ? "danger" : "solid"
41
33
  }, {
42
- default: s(() => [
43
- r(x(n.label ?? "Save"), 1)
34
+ default: r(() => [
35
+ s(v(t.label ?? "Save"), 1)
44
36
  ]),
45
37
  _: 1
46
- }, 8, ["class"])
38
+ }, 8, ["variant"])
47
39
  ])
48
40
  ], 32));
49
41
  }
50
42
  });
51
43
  export {
52
- E as default
44
+ y as default
53
45
  };
@@ -4,12 +4,14 @@ declare function __VLS_template(): {
4
4
  declare const __VLS_component: import("vue").DefineComponent<{
5
5
  click: () => void;
6
6
  hotkey?: string;
7
- isApp?: boolean;
7
+ layout?: "modal" | "web" | "desktop";
8
8
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
9
9
  click: () => void;
10
10
  hotkey?: string;
11
- isApp?: boolean;
12
- }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ layout?: "modal" | "web" | "desktop";
12
+ }> & Readonly<{}>, {
13
+ layout: "modal" | "web" | "desktop";
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
15
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
14
16
  export default _default;
15
17
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarButton.vue"],"names":[],"mappings":"AAkDA,iBAAS,cAAc;mBA4EI,GAAG;EAiB7B;AACD,QAAA,MAAM,eAAe;WA7GZ,MAAM,IAAI;aACR,MAAM;YACP,OAAO;;WAFR,MAAM,IAAI;aACR,MAAM;YACP,OAAO;iGAiHf,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SidebarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarButton.vue"],"names":[],"mappings":"AA+DA,iBAAS,cAAc;mBA4EI,GAAG;EAkB7B;AACD,QAAA,MAAM,eAAe;WAtHV,MAAM,IAAI;aACR,MAAM;aACN,OAAO,GAAG,KAAK,GAAG,SAAS;;WAF7B,MAAM,IAAI;aACR,MAAM;aACN,OAAO,GAAG,KAAK,GAAG,SAAS;;YAA3B,OAAO,GAAG,KAAK,GAAG,SAAS;6EA2HtC,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAexG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}