@scalar/api-client 2.1.35 → 2.1.36

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 (86) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  3. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +105 -119
  4. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  5. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  6. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +14 -14
  7. package/dist/components/CommandPalette/WatchModeToggle.vue.d.ts +15 -0
  8. package/dist/components/CommandPalette/WatchModeToggle.vue.d.ts.map +1 -0
  9. package/dist/components/CommandPalette/WatchModeToggle.vue.js +39 -0
  10. package/dist/components/CommandPalette/WatchModeToggle.vue2.js +4 -0
  11. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +1 -1
  12. package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
  13. package/dist/components/ImportCollection/DropEventListener.vue.js +39 -33
  14. package/dist/components/ImportCollection/ImportCollectionListener.vue.d.ts.map +1 -1
  15. package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -20
  16. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts +2 -0
  17. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  18. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +159 -100
  19. package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +5 -0
  20. package/dist/components/ImportCollection/ImportNowButton.vue.d.ts +2 -0
  21. package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
  22. package/dist/components/ImportCollection/ImportNowButton.vue.js +35 -31
  23. package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts +7 -0
  24. package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -0
  25. package/dist/components/ImportCollection/IntegrationLogo.vue.js +46 -0
  26. package/dist/components/ImportCollection/IntegrationLogo.vue2.js +4 -0
  27. package/dist/components/ImportCollection/PrefetchError.vue.d.ts +8 -0
  28. package/dist/components/ImportCollection/PrefetchError.vue.d.ts.map +1 -0
  29. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts +2 -2
  30. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts.map +1 -1
  31. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.js +7 -7
  32. package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
  33. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +2 -2
  34. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +29 -12
  35. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
  36. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +34 -42
  37. package/dist/components/OpenApiClientButton.vue.d.ts +13 -0
  38. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -0
  39. package/dist/components/OpenApiClientButton.vue.js +7 -0
  40. package/dist/components/OpenApiClientButton.vue2.js +36 -0
  41. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  42. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
  43. package/dist/components/index.d.ts +1 -0
  44. package/dist/components/index.d.ts.map +1 -1
  45. package/dist/components/index.js +4 -2
  46. package/dist/layouts/App/create-api-client-app.d.ts +58 -41
  47. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  48. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  49. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  50. package/dist/layouts/Modal/create-api-client-modal.d.ts +116 -82
  51. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  52. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  53. package/dist/layouts/Web/ApiClientWeb.vue.js +42 -38
  54. package/dist/layouts/Web/create-api-client-web.d.ts +58 -41
  55. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  56. package/dist/libs/create-client.d.ts +58 -41
  57. package/dist/libs/create-client.d.ts.map +1 -1
  58. package/dist/store/collections.d.ts +34 -24
  59. package/dist/store/collections.d.ts.map +1 -1
  60. package/dist/store/import-spec.d.ts +6 -4
  61. package/dist/store/import-spec.d.ts.map +1 -1
  62. package/dist/store/store.d.ts +116 -82
  63. package/dist/store/store.d.ts.map +1 -1
  64. package/dist/style.css +1 -1
  65. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  66. package/dist/views/Request/RequestSection/RequestSection.vue2.js +7 -7
  67. package/dist/views/Request/RequestSidebar.vue.js +3 -3
  68. package/dist/views/Request/RequestSidebar.vue2.js +29 -29
  69. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  70. package/dist/views/Request/RequestSidebarItem.vue2.js +76 -76
  71. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +2 -2
  72. package/dist/views/Request/RequestSidebarItemMenu.vue.js +3 -3
  73. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +47 -47
  74. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  75. package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
  76. package/dist/views/Request/RequestSubpageHeader.vue2.js +67 -42
  77. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  78. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  79. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +3 -3
  80. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
  81. package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
  82. package/dist/views/Request/hooks/useOpenApiWatcher.js +24 -24
  83. package/dist/views/Request/types/sidebar-item.d.ts +1 -1
  84. package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
  85. package/package.json +6 -6
  86. package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
@@ -1,30 +1,32 @@
1
- import { defineComponent as a, ref as c, openBlock as l, createElementBlock as m, Fragment as u, createVNode as n, renderSlot as i, nextTick as s } from "vue";
2
- import p from "./DropEventListener.vue.js";
3
- import f from "./ImportCollectionModal.vue.js";
4
- import _ from "./PasteEventListener.vue.js";
5
- import d from "./UrlQueryParameterChecker.vue.js";
6
- const y = /* @__PURE__ */ a({
1
+ import { defineComponent as u, ref as i, openBlock as c, createElementBlock as m, Fragment as s, createVNode as n, renderSlot as p, nextTick as f } from "vue";
2
+ import _ from "./DropEventListener.vue.js";
3
+ import d from "./ImportCollectionModal.vue.js";
4
+ /* empty css */
5
+ import v from "./PasteEventListener.vue.js";
6
+ import I from "./UrlQueryParameterChecker.vue.js";
7
+ const B = /* @__PURE__ */ u({
7
8
  __name: "ImportCollectionListener",
8
- setup(I) {
9
- const e = c(null);
10
- async function r() {
11
- e.value = null, await s();
9
+ setup($) {
10
+ const e = i(null), t = i(null);
11
+ async function a() {
12
+ e.value = null, t.value = null, await f();
12
13
  }
13
- async function o(t) {
14
- await r(), e.value = t;
14
+ async function o(r, l = null) {
15
+ await a(), e.value = r, t.value = l;
15
16
  }
16
- return (t, $) => (l(), m(u, null, [
17
- n(f, {
17
+ return (r, l) => (c(), m(s, null, [
18
+ n(d, {
19
+ integration: t.value,
18
20
  source: e.value,
19
- onImportFinished: r
20
- }, null, 8, ["source"]),
21
+ onImportFinished: a
22
+ }, null, 8, ["integration", "source"]),
23
+ n(v, { onInput: o }),
21
24
  n(_, { onInput: o }),
22
- n(p, { onInput: o }),
23
- n(d, { onInput: o }),
24
- i(t.$slots, "default")
25
+ n(I, { onInput: o }),
26
+ p(r.$slots, "default")
25
27
  ], 64));
26
28
  }
27
29
  });
28
30
  export {
29
- y as default
31
+ B as default
30
32
  };
@@ -1,9 +1,11 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
2
  source: string | null;
3
+ integration: string | null;
3
4
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
5
  importFinished: () => any;
5
6
  }, string, import("vue").PublicProps, Readonly<{
6
7
  source: string | null;
8
+ integration: string | null;
7
9
  }> & Readonly<{
8
10
  onImportFinished?: (() => any) | undefined;
9
11
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":";YA2LU,MAAM,GAAG,IAAI;;;;YAAb,MAAM,GAAG,IAAI;;;;AAmTvB,wBASG"}
1
+ {"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":";YAiVU,MAAM,GAAG,IAAI;iBACR,MAAM,GAAG,IAAI;;;;YADlB,MAAM,GAAG,IAAI;iBACR,MAAM,GAAG,IAAI;;;;AA+b5B,wBASG"}
@@ -1,119 +1,178 @@
1
- import { defineComponent as S, computed as a, watch as C, openBlock as l, createBlock as z, unref as o, withCtx as D, createElementVNode as e, toDisplayString as h, createElementBlock as d, createVNode as i, Fragment as F, createCommentVNode as x, createTextVNode as I } from "vue";
2
- import { useUrlPrefetcher as V } from "./hooks/useUrlPrefetcher.js";
3
- import { getOpenApiDocumentVersion as _ } from "./utils/getOpenApiDocumentVersion.js";
4
- import { isDocument as j } from "./utils/isDocument.js";
5
- import { isUrl as A } from "./utils/isUrl.js";
6
- import { useModal as B, ScalarModal as E, ScalarIcon as m, ScalarCodeBlock as N } from "@scalar/components";
7
- import { normalize as O } from "@scalar/openapi-parser";
8
- import U from "./ImportNowButton.vue.js";
9
- import M from "./WorkspaceSelector.vue.js";
10
- import { useWorkspace as $ } from "../../store/store.js";
11
- const P = { class: "flex flex-col h-screen justify-center overflow-hidden relative" }, T = { class: "flex items-center flex-col m-auto" }, W = { class: "text-center text-[50px] tracking-[-3px] leading-tight font-medium text-pretty" }, K = {
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";
6
+ import { isUrl as h } from "./utils/isUrl.js";
7
+ import { useModal as U, ScalarModal as L, 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 = {
12
15
  key: 0,
13
- class: "flex gap-2 items-center p-3 font-code text-sm border rounded break-words my-4"
14
- }, L = { class: "break-all" }, R = { class: "flex gap-2 items-center p-3 font-code text-sm border rounded" }, q = { class: "bg-b-2 h-48 border rounded custom-scroll" }, G = {
15
- key: 2,
16
- class: "inline-flex flex-col gap-2 items-center mt-2"
17
- }, H = { class: "flex justify-center" }, J = { class: "inline-block py-1 px-4" }, Q = { class: "flex flex-col justify-center items-center pb-4" }, X = { class: "text-center flex items-center flex-col" }, Y = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, ae = /* @__PURE__ */ S({
16
+ 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 = {
21
+ href: "https://scalar.com/download",
22
+ target: "_blank"
23
+ }, be = { class: "text-sm" }, De = /* @__PURE__ */ K({
18
24
  __name: "ImportCollectionModal",
19
25
  props: {
20
- source: {}
26
+ source: {},
27
+ integration: {}
21
28
  },
22
29
  emits: ["importFinished"],
23
- setup(v) {
24
- const c = v, { activeWorkspace: k, events: g } = $(), { prefetchResult: r, prefetchUrl: y } = V(), n = B();
25
- g.hotKeys.on(() => n.hide());
26
- const b = a(() => {
30
+ setup(S) {
31
+ const n = S, { activeWorkspace: V, events: z } = ne(), { prefetchResult: r, prefetchUrl: D } = Y(), l = U(), E = U(), j = w(""), d = w(!0);
32
+ z.hotKeys.on(() => l.hide());
33
+ const B = c(() => {
27
34
  try {
28
- return O(
29
- r.content || c.source || ""
35
+ return te(
36
+ r.content || n.source || ""
30
37
  );
31
38
  } catch {
32
39
  return;
33
40
  }
34
- }), w = a(() => {
35
- var t, s;
36
- return (s = (t = b.value) == null ? void 0 : t.info) == null ? void 0 : s.title;
37
- }), p = a(
38
- () => _(r.content || c.source || "")
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
46
  );
40
- return C(
41
- () => c.source,
42
- (t) => {
43
- y(t, k.value.proxyUrl), t && (A(t) || j(t) && _(t)) ? n.show() : n.hide();
47
+ u(
48
+ () => n.source,
49
+ (o) => {
50
+ h(o) && D(o, V.value.proxyUrl), o && (h(o) || A(o) && M(o)) ? l.show() : l.hide();
44
51
  }
45
- ), (t, s) => (l(), z(o(E), {
46
- size: "full",
47
- state: o(n)
48
- }, {
49
- default: D(() => {
50
- var f, u;
51
- return [
52
- e("div", P, [
53
- e("div", T, [
54
- e("div", W, h(w.value ?? "Import Collection"), 1),
55
- o(r).state !== "loading" && o(r).error ? (l(), d("div", K, [
56
- i(o(m), {
57
- class: "text-red flex-shrink-0",
58
- icon: "Error",
59
- size: "sm"
60
- }),
61
- e("div", L, h(o(r).error), 1)
62
- ])) : p.value ? x("", !0) : (l(), d(F, { key: 1 }, [
63
- e("div", R, [
64
- i(o(m), {
65
- class: "text-red",
66
- icon: "Error",
67
- size: "sm"
68
- }),
69
- s[1] || (s[1] = e("div", null, "This doesn’t look like a valid OpenAPI/Swagger document.", -1))
70
- ]),
71
- e("div", q, [
72
- i(o(N), {
73
- content: ((f = o(r).content) == null ? void 0 : f.trim()) || ((u = c.source) == null ? void 0 : u.trim()) || "",
74
- copy: !1
75
- }, null, 8, ["content"])
76
- ])
77
- ], 64)),
78
- p.value ? (l(), d("div", G, [
79
- i(U, {
80
- source: t.source,
81
- variant: "button",
82
- onImportFinished: s[0] || (s[0] = () => t.$emit("importFinished"))
83
- }, null, 8, ["source"])
84
- ])) : x("", !0),
85
- e("div", H, [
86
- e("div", J, [
87
- i(M)
52
+ );
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
+ ($.value || F.value) && l.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
55
+ }, T = () => {
56
+ document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
57
+ };
58
+ return u(
59
+ () => l.open,
60
+ (o) => {
61
+ o ? m() : T();
62
+ }
63
+ ), u(
64
+ () => n.source,
65
+ () => {
66
+ m();
67
+ }
68
+ ), R(() => {
69
+ m();
70
+ }), G(() => {
71
+ 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(L), {
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, {
86
+ key: 0,
87
+ 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,
98
+ variant: "button",
99
+ watchMode: d.value,
100
+ onImportFinished: t[0] || (t[0] = () => o.$emit("importFinished"))
101
+ }, null, 8, ["source", "watchMode"])
102
+ ]),
103
+ e("div", ae, [
104
+ e("div", de, [
105
+ t[2] || (t[2] = C(" Import to: ")),
106
+ i(re)
107
+ ])
108
+ ]),
109
+ (y = s(r)) != null && y.url ? (a(), x("div", me, [
110
+ e("div", ue, [
111
+ i(X, {
112
+ modelValue: d.value,
113
+ "onUpdate:modelValue": t[1] || (t[1] = (W) => d.value = W),
114
+ disableToolTip: !0
115
+ }, null, 8, ["modelValue"])
116
+ ]),
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"])
133
+ ])
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))
88
155
  ])
89
- ])
90
- ]),
91
- e("div", Q, [
92
- e("div", X, [
93
- e("div", Y, [
94
- i(o(m), {
95
- icon: "Logo",
96
- size: "xl"
97
- })
156
+ ]),
157
+ i(s(L), {
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)
98
165
  ]),
99
- s[2] || (s[2] = e("span", { class: "text-c-2" }, [
100
- e("a", {
101
- class: "hover:text-c-1",
102
- href: "https://scalar.com/download",
103
- target: "_blank"
104
- }, " Download Scalar App "),
105
- e("br"),
106
- I(" Offline First - Open Source ")
107
- ], -1))
108
- ])
166
+ _: 1
167
+ }, 8, ["state"])
109
168
  ])
110
- ])
111
- ];
112
- }),
113
- _: 1
114
- }, 8, ["state"]));
169
+ ];
170
+ }),
171
+ _: 1
172
+ }, 8, ["state"]);
173
+ };
115
174
  }
116
175
  });
117
176
  export {
118
- ae as default
177
+ De as default
119
178
  };
@@ -0,0 +1,5 @@
1
+ import o from "./ImportCollectionModal.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -1,11 +1,13 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
2
  source?: string | null;
3
3
  variant?: "button" | "link";
4
+ watchMode?: boolean;
4
5
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
5
6
  importFinished: () => any;
6
7
  }, string, import("vue").PublicProps, Readonly<{
7
8
  source?: string | null;
8
9
  variant?: "button" | "link";
10
+ watchMode?: boolean;
9
11
  }> & Readonly<{
10
12
  onImportFinished?: (() => any) | undefined;
11
13
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"ImportNowButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportNowButton.vue"],"names":[],"mappings":";aA2GW,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;;;;aADlB,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;;;;AAgL7B,wBASG"}
1
+ {"version":3,"file":"ImportNowButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportNowButton.vue"],"names":[],"mappings":";aA+GW,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;gBACf,OAAO;;;;aAFV,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;gBACf,OAAO;;;;AAkLrB,wBASG"}
@@ -1,72 +1,76 @@
1
- import { defineComponent as b, openBlock as s, createElementBlock as v, Fragment as w, createBlock as m, unref as a, withCtx as p, createTextVNode as c, createCommentVNode as g } from "vue";
2
- import { isUrl as h } from "./utils/isUrl.js";
1
+ import { defineComponent as C, openBlock as s, createElementBlock as v, Fragment as b, createBlock as u, unref as m, withCtx as p, createTextVNode as c, createCommentVNode as g } from "vue";
2
+ import { isUrl as x } from "./utils/isUrl.js";
3
3
  import { ScalarButton as l } from "@scalar/components";
4
- import { useToasts as F } from "@scalar/use-toasts";
5
- import { useRouter as B } from "vue-router";
4
+ import { useToasts as B } from "@scalar/use-toasts";
5
+ import { useRouter as F } from "vue-router";
6
6
  import { useWorkspace as I } from "../../store/store.js";
7
- const R = /* @__PURE__ */ b({
7
+ const z = /* @__PURE__ */ C({
8
8
  __name: "ImportNowButton",
9
9
  props: {
10
10
  source: {},
11
- variant: {}
11
+ variant: {},
12
+ watchMode: { type: Boolean }
12
13
  },
13
14
  emits: ["importFinished"],
14
15
  setup(f, { emit: d }) {
15
- const o = f, k = d, y = B(), { importSpecFromUrl: C, importSpecFile: x, activeWorkspace: r } = I(), { toast: i } = F();
16
- async function n() {
16
+ const o = f, k = d, w = F(), { importSpecFromUrl: y, importSpecFile: h, activeWorkspace: r } = I(), { toast: n } = B();
17
+ async function i() {
17
18
  try {
18
19
  if (o.source) {
19
- if (h(o.source)) {
20
- const [t, e] = await C(
20
+ if (x(o.source)) {
21
+ const [e, t] = await y(
21
22
  o.source,
22
- r.value.uid
23
+ r.value.uid,
24
+ {
25
+ watchMode: o.watchMode
26
+ }
23
27
  );
24
- t || u(e);
28
+ e || a(t);
25
29
  } else {
26
- const t = await x(
30
+ const e = await h(
27
31
  o.source,
28
32
  r.value.uid
29
33
  );
30
- u(t);
34
+ a(e);
31
35
  }
32
- i("Import successful", "info"), k("importFinished");
36
+ n("Import successful", "info"), k("importFinished");
33
37
  }
34
- } catch (t) {
35
- console.error("[importCollection]", t);
36
- const e = (t == null ? void 0 : t.message) || "Unknown error";
37
- i(`Import failed: ${e}`, "error");
38
+ } catch (e) {
39
+ console.error("[importCollection]", e);
40
+ const t = (e == null ? void 0 : e.message) || "Unknown error";
41
+ n(`Import failed: ${t}`, "error");
38
42
  }
39
43
  }
40
- function u(t) {
41
- t && y.push({
44
+ function a(e) {
45
+ e && w.push({
42
46
  name: "request",
43
47
  params: {
44
48
  workspace: r.value.uid,
45
- request: t == null ? void 0 : t.requests[0]
49
+ request: e == null ? void 0 : e.requests[0]
46
50
  }
47
51
  });
48
52
  }
49
- return (t, e) => t.source ? (s(), v(w, { key: 0 }, [
50
- t.variant === "button" ? (s(), m(a(l), {
53
+ return (e, t) => e.source ? (s(), v(b, { key: 0 }, [
54
+ e.variant === "button" ? (s(), u(m(l), {
51
55
  key: 0,
52
- class: "text-[21px] py-2.5 px-6 rounded-lg font-bold h-fit mt-3 mb-1.5",
56
+ class: "py-2.5 px-6 rounded-lg font-bold h-fit mt-3 w-full",
53
57
  size: "md",
54
58
  type: "button",
55
- onClick: n
59
+ onClick: i
56
60
  }, {
57
- default: p(() => e[0] || (e[0] = [
61
+ default: p(() => t[0] || (t[0] = [
58
62
  c(" Import Collection ")
59
63
  ])),
60
64
  _: 1
61
- })) : (s(), m(a(l), {
65
+ })) : (s(), u(m(l), {
62
66
  key: 1,
63
67
  class: "text-[21px] py-2.5 px-6 rounded-lg font-bold h-fit",
64
68
  size: "md",
65
69
  type: "button",
66
70
  variant: "ghost",
67
- onClick: n
71
+ onClick: i
68
72
  }, {
69
- default: p(() => e[1] || (e[1] = [
73
+ default: p(() => t[1] || (t[1] = [
70
74
  c(" Try it in the browser ")
71
75
  ])),
72
76
  _: 1
@@ -75,5 +79,5 @@ const R = /* @__PURE__ */ b({
75
79
  }
76
80
  });
77
81
  export {
78
- R as default
82
+ z as default
79
83
  };
@@ -0,0 +1,7 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ integration: string | null;
3
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
4
+ integration: string | null;
5
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
7
+ //# sourceMappingURL=IntegrationLogo.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IntegrationLogo.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/IntegrationLogo.vue"],"names":[],"mappings":";iBAkEe,MAAM,GAAG,IAAI;;iBAAb,MAAM,GAAG,IAAI;;AAqG5B,wBAMG"}
@@ -0,0 +1,46 @@
1
+ import { defineComponent as i, computed as l, openBlock as p, createElementBlock as d, createElementVNode as u, createVNode as f, unref as m } from "vue";
2
+ import { ScalarIcon as g } from "@scalar/components";
3
+ const _ = { class: "flex justify-center items-center mb-2 p-1" }, x = { class: "rounded-xl" }, j = /* @__PURE__ */ i({
4
+ __name: "IntegrationLogo",
5
+ props: {
6
+ integration: {}
7
+ },
8
+ setup(n) {
9
+ const s = n, a = [
10
+ "adonisjs",
11
+ "dotnet",
12
+ "elysiajs",
13
+ "express",
14
+ "fastapi",
15
+ "fastify",
16
+ "go",
17
+ "hono",
18
+ "laravel",
19
+ "litestar",
20
+ "nestjs",
21
+ "nextjs",
22
+ "nitro",
23
+ "nuxt",
24
+ "platformatic",
25
+ "react",
26
+ "rust"
27
+ ], r = l(() => {
28
+ var o;
29
+ const t = "Openapi", e = (o = s.integration) == null ? void 0 : o.toLocaleLowerCase();
30
+ if (!e) return t;
31
+ const c = e.charAt(0).toUpperCase() + e.slice(1);
32
+ return a.includes(e) ? c : t;
33
+ });
34
+ return (t, e) => (p(), d("div", _, [
35
+ u("div", x, [
36
+ f(m(g), {
37
+ class: "size-10 rounded-lg",
38
+ logo: r.value
39
+ }, null, 8, ["logo"])
40
+ ])
41
+ ]));
42
+ }
43
+ });
44
+ export {
45
+ j as default
46
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./IntegrationLogo.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,8 @@
1
+ import type { PrefetchResult } from '../../components/ImportCollection/hooks/useUrlPrefetcher.js';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ prefetchResult: PrefetchResult;
4
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
5
+ prefetchResult: PrefetchResult;
6
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ export default _default;
8
+ //# sourceMappingURL=PrefetchError.vue.d.ts.map
@@ -0,0 +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,7 +1,7 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
2
- input: (input: string) => any;
2
+ input: (url: string, integration: string | null) => any;
3
3
  }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
4
- onInput?: ((input: string) => any) | undefined;
4
+ onInput?: ((url: string, integration: string | null) => any) | undefined;
5
5
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
6
  export default _default;
7
7
  //# sourceMappingURL=UrlQueryParameterChecker.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UrlQueryParameterChecker.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/UrlQueryParameterChecker.vue"],"names":[],"mappings":";;;;;AA+EA,wBAQG"}
1
+ {"version":3,"file":"UrlQueryParameterChecker.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/UrlQueryParameterChecker.vue"],"names":[],"mappings":";;;;;AAiFA,wBAQG"}
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as a, onMounted as o } from "vue";
2
- const s = /* @__PURE__ */ a({
2
+ const c = /* @__PURE__ */ a({
3
3
  __name: "UrlQueryParameterChecker",
4
4
  emits: ["input"],
5
- setup(u, { emit: r }) {
6
- const t = r;
5
+ setup(i, { emit: r }) {
6
+ const n = r;
7
7
  return o(() => {
8
- const e = new URLSearchParams(window.location.search).get("url");
9
- e && t("input", e);
10
- }), (n, e) => null;
8
+ const e = new URLSearchParams(window.location.search), t = e.get("url");
9
+ t && n("input", t, e.get("integration"));
10
+ }), (e, t) => null;
11
11
  }
12
12
  });
13
13
  export {
14
- s as default
14
+ c as default
15
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/WorkspaceSelector.vue"],"names":[],"mappings":";AAgeA,wBAKG"}
1
+ {"version":3,"file":"WorkspaceSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/WorkspaceSelector.vue"],"names":[],"mappings":";AAkeA,wBAKG"}