@scalar/api-client 2.1.25 → 2.1.27

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 (71) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  3. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +150 -90
  4. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
  5. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  7. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +42 -42
  8. package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
  9. package/dist/components/ImportCollection/ImportNowButton.vue.js +7 -9
  10. package/dist/layouts/App/create-api-client-app.d.ts +77 -20
  11. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  12. package/dist/layouts/App/create-api-client-app.js +14 -12
  13. package/dist/layouts/Modal/create-api-client-modal.d.ts +154 -40
  14. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  15. package/dist/layouts/Modal/create-api-client-modal.js +23 -26
  16. package/dist/layouts/Web/create-api-client-web.d.ts +77 -20
  17. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  18. package/dist/layouts/Web/create-api-client-web.js +12 -10
  19. package/dist/libs/create-client.d.ts +77 -20
  20. package/dist/libs/create-client.d.ts.map +1 -1
  21. package/dist/libs/create-client.js +60 -58
  22. package/dist/store/collections.d.ts +34 -4
  23. package/dist/store/collections.d.ts.map +1 -1
  24. package/dist/store/import-spec.d.ts +43 -4
  25. package/dist/store/import-spec.d.ts.map +1 -1
  26. package/dist/store/import-spec.js +60 -36
  27. package/dist/store/requests.d.ts +4 -1
  28. package/dist/store/requests.d.ts.map +1 -1
  29. package/dist/store/requests.js +76 -76
  30. package/dist/store/security-schemes.d.ts +2 -2
  31. package/dist/store/security-schemes.d.ts.map +1 -1
  32. package/dist/store/security-schemes.js +35 -37
  33. package/dist/store/servers.d.ts +10 -10
  34. package/dist/store/servers.d.ts.map +1 -1
  35. package/dist/store/store.d.ts +154 -40
  36. package/dist/store/store.d.ts.map +1 -1
  37. package/dist/store/store.js +74 -72
  38. package/dist/store/workspace.d.ts.map +1 -1
  39. package/dist/store/workspace.js +23 -18
  40. package/dist/style.css +1 -1
  41. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  42. package/dist/views/Request/Request.vue.js +1 -1
  43. package/dist/views/Request/Request.vue2.js +39 -38
  44. package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.d.ts.map +1 -1
  45. package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +12 -12
  46. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  47. package/dist/views/Request/RequestSidebar.vue.js +4 -4
  48. package/dist/views/Request/RequestSidebar.vue2.js +107 -102
  49. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  50. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  51. package/dist/views/Request/RequestSidebarItem.vue2.js +165 -135
  52. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +3 -1
  53. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  54. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  55. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +96 -71
  56. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  57. package/dist/views/Request/hooks/useOpenApiWatcher.d.ts +9 -0
  58. package/dist/views/Request/hooks/useOpenApiWatcher.d.ts.map +1 -0
  59. package/dist/views/Request/hooks/useOpenApiWatcher.js +86 -0
  60. package/dist/views/Request/libs/live-sync.d.ts +59 -0
  61. package/dist/views/Request/libs/live-sync.d.ts.map +1 -0
  62. package/dist/views/Request/libs/live-sync.js +289 -0
  63. package/dist/views/Request/types/sidebar-item.d.ts +2 -0
  64. package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
  65. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  66. package/dist/views/Settings/Settings.vue2.js +15 -45
  67. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
  68. package/dist/views/Settings/SettingsGeneral.vue.js +135 -102
  69. package/dist/views/Settings/SettingsGeneralMode.vue.d.ts.map +1 -1
  70. package/dist/views/Settings/SettingsGeneralMode.vue.js +76 -68
  71. package/package.json +8 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.1.27
4
+
5
+ ### Patch Changes
6
+
7
+ - 4e50d65: feat: added openapi watcher to live update the api client
8
+ - 4e50d65: feat: adds watch toggle in request sidebar item menu
9
+ - Updated dependencies [4e50d65]
10
+ - Updated dependencies [4e50d65]
11
+ - Updated dependencies [4e50d65]
12
+ - Updated dependencies [4e50d65]
13
+ - Updated dependencies [4e50d65]
14
+ - Updated dependencies [6bbb815]
15
+ - @scalar/components@0.12.56
16
+ - @scalar/oas-utils@0.2.59
17
+ - @scalar/themes@0.9.40
18
+ - @scalar/use-codemirror@0.11.23
19
+
20
+ ## 2.1.26
21
+
22
+ ### Patch Changes
23
+
24
+ - 8223e31: fix: updates proxy default setting
25
+ - f8b81ee: fix: new settings page
26
+ - 9e769df: fix: sets default request uid to request example
27
+ - a80a931: fix: command palette modal overflow
28
+
3
29
  ## 2.1.25
4
30
 
5
31
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AAmfA,wBASG"}
1
+ {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AA6sBA,wBASG"}
@@ -1,133 +1,193 @@
1
- import { defineComponent as $, ref as R, computed as v, openBlock as l, createBlock as k, unref as r, withCtx as p, createVNode as y, createTextVNode as i, createElementBlock as u, Fragment as m, toDisplayString as w, createElementVNode as U, createCommentVNode as T } from "vue";
2
- import { useLoadingState as j, ScalarButton as D, ScalarIcon as M, ScalarCodeBlock as _ } from "@scalar/components";
3
- import { useToasts as z } from "@scalar/use-toasts";
4
- import E from "./CommandActionForm.vue.js";
5
- import W from "./CommandActionInput.vue.js";
6
- import { getOpenApiDocumentDetails as h } from "../../libs/getOpenApiDocumentDetails.js";
7
- import { isUrl as x } from "../../libs/isUrl.js";
8
- import { useFileDialog as J } from "../../hooks/useFileDialog.js";
9
- import { useWorkspace as Y } from "../../store/store.js";
10
- const q = { class: "flex justify-between" }, le = /* @__PURE__ */ $({
1
+ import { defineComponent as M, ref as U, computed as w, watch as O, openBlock as a, createBlock as h, unref as l, withCtx as c, createElementVNode as d, createVNode as f, createTextVNode as n, normalizeClass as V, createElementBlock as i, Fragment as g, toDisplayString as _, createCommentVNode as N } from "vue";
2
+ import { useLoadingState as $, ScalarButton as F, ScalarIcon as L, ScalarTooltip as j, ScalarToggle as E, ScalarCodeBlock as J } from "@scalar/components";
3
+ import { useToasts as Y } from "@scalar/use-toasts";
4
+ import q from "./CommandActionForm.vue.js";
5
+ import G from "./CommandActionInput.vue.js";
6
+ import { getOpenApiDocumentDetails as H } from "../../libs/getOpenApiDocumentDetails.js";
7
+ import { isUrl as k } from "../../libs/isUrl.js";
8
+ import { useFileDialog as K } from "../../hooks/useFileDialog.js";
9
+ import { useWorkspace as Q } from "../../store/store.js";
10
+ const X = { class: "flex justify-between" }, Z = { class: "flex flex-row items-center justify-between gap-3 w-full" }, ee = { class: "grid gap-1.5 pointer-events-none max-w-[320px] w-content shadow-lg rounded bg-b-1 z-100 p-2 text-xxs leading-5 z-10 text-c-1" }, te = { class: "flex items-center text-c-2" }, oe = { key: 0 }, ae = {
11
+ key: 1,
12
+ class: "text-pretty"
13
+ }, ve = /* @__PURE__ */ M({
11
14
  __name: "CommandPaletteImport",
12
15
  emits: ["close", "back"],
13
- setup(G, { emit: F }) {
14
- const f = F, { activeWorkspace: g, importSpecFile: b, importSpecFromUrl: L } = Y(), { toast: c } = z(), s = j(), t = R(""), o = v(
15
- () => h(t.value)
16
- ), C = v(
17
- () => o.value ? o.value.type : "json"
18
- ), S = v(() => x(t.value)), V = v(() => !!o.value), { open: A } = J({
19
- onChange: async (a) => {
20
- const e = a == null ? void 0 : a[0];
16
+ setup(le, { emit: A }) {
17
+ const b = A, { activeWorkspace: x, importSpecFile: C, importSpecFromUrl: D } = Q(), { toast: m } = Y(), u = $(), t = U(""), p = U(!0), r = w(
18
+ () => H(t.value)
19
+ ), S = w(
20
+ () => r.value ? r.value.type : "json"
21
+ ), v = w(() => k(t.value)), R = w(() => !!r.value), { open: z } = K({
22
+ onChange: async (o) => {
23
+ const e = o == null ? void 0 : o[0];
21
24
  if (e) {
22
- const n = new FileReader();
23
- n.onload = async (N) => {
25
+ const s = new FileReader();
26
+ s.onload = async (T) => {
24
27
  var I;
25
- const O = (I = N.target) == null ? void 0 : I.result;
28
+ const W = (I = T.target) == null ? void 0 : I.result;
26
29
  try {
27
- await b(O, g.value.uid), c("Import successful", "info"), f("close");
28
- } catch (d) {
29
- console.error(d);
30
- const P = (d == null ? void 0 : d.message) || "Unknown error";
31
- c(`Import failed: ${P}`, "error");
30
+ await C(W, x.value.uid), m("Import successful", "info"), b("close");
31
+ } catch (y) {
32
+ console.error(y);
33
+ const B = (y == null ? void 0 : y.message) || "Unknown error";
34
+ m(`Import failed: ${B}`, "error");
32
35
  }
33
- }, n.readAsText(e);
36
+ }, s.readAsText(e);
34
37
  }
35
38
  },
36
39
  multiple: !1,
37
40
  accept: ".json,.yaml,.yml"
38
41
  });
39
- async function B() {
40
- if (!(!t.value || s.isLoading)) {
41
- s.startLoading();
42
+ O(v, (o) => {
43
+ o || (p.value = !1);
44
+ }), O(t, (o) => {
45
+ k(o) || (p.value = !1);
46
+ });
47
+ async function P() {
48
+ if (!(!t.value || u.isLoading)) {
49
+ u.startLoading();
42
50
  try {
43
- if (S.value)
44
- await L(
51
+ if (v.value) {
52
+ const [o] = await D(
45
53
  t.value,
46
- void 0,
47
- void 0,
48
- g.value.uid
54
+ x.value.uid,
55
+ {
56
+ proxy: x.value.proxyUrl,
57
+ watchForChanges: p.value
58
+ }
49
59
  );
50
- else if (V.value)
51
- await b(
60
+ if (o) {
61
+ m(
62
+ "There was a possible CORS error while importing your spec, please make sure this server is allowed in the CORS policy of your OpenAPI document.",
63
+ "error",
64
+ { timeout: 5e3 }
65
+ ), u.invalidate(2e3, !0);
66
+ return;
67
+ }
68
+ } else if (R.value)
69
+ await C(
52
70
  String(t.value),
53
- g.value.uid
71
+ x.value.uid
54
72
  );
55
73
  else {
56
- c("Import failed: Invalid URL or OpenAPI document", "error"), s.invalidate(2e3, !0);
74
+ m("Import failed: Invalid URL or OpenAPI document", "error"), u.invalidate(2e3, !0);
57
75
  return;
58
76
  }
59
- s.clear(), f("close"), c("Import successful", "info");
60
- } catch (a) {
61
- console.error("[importCollection]", a);
62
- const e = (a == null ? void 0 : a.message) || "Unknown error";
63
- s.invalidate(2e3, !0), c(`Import failed: ${e}`, "error");
77
+ u.clear(), b("close"), m("Import successful", "info");
78
+ } catch (o) {
79
+ console.error("[importCollection]", o);
80
+ const e = (o == null ? void 0 : o.message) || "Unknown error";
81
+ u.invalidate(2e3, !0), m(`Import failed: ${e}`, "error");
64
82
  }
65
83
  }
66
84
  }
67
- return (a, e) => (l(), k(E, {
85
+ return (o, e) => (a(), h(q, {
68
86
  disabled: !t.value.trim(),
69
- loading: r(s),
70
- onSubmit: B
87
+ loading: l(u),
88
+ onSubmit: P
71
89
  }, {
72
- options: p(() => [
73
- y(r(D), {
74
- class: "p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
75
- variant: "outlined",
76
- onClick: r(A)
77
- }, {
78
- default: p(() => [
79
- e[5] || (e[5] = i(" JSON, or YAML File ")),
80
- y(r(M), {
81
- class: "text-c-3",
82
- icon: "UploadSimple",
83
- size: "md"
84
- })
85
- ]),
86
- _: 1
87
- }, 8, ["onClick"])
90
+ options: c(() => [
91
+ d("div", Z, [
92
+ f(l(F), {
93
+ class: "p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
94
+ variant: "outlined",
95
+ onClick: l(z)
96
+ }, {
97
+ default: c(() => [
98
+ e[6] || (e[6] = n(" JSON, or YAML File ")),
99
+ f(l(L), {
100
+ class: "text-c-3",
101
+ icon: "UploadSimple",
102
+ size: "md"
103
+ })
104
+ ]),
105
+ _: 1
106
+ }, 8, ["onClick"]),
107
+ f(l(j), {
108
+ as: "div",
109
+ class: "z-[10001]",
110
+ side: "bottom",
111
+ sideOffset: 5
112
+ }, {
113
+ trigger: c(() => [
114
+ d("label", {
115
+ class: V([
116
+ "p-3 py-1.5 rounded flex items-center text-sm text-c-2 gap-2 select-none",
117
+ t.value && !v.value ? "cursor-default" : "cursor-pointer"
118
+ ]),
119
+ for: "watch-toggle"
120
+ }, [
121
+ d("span", {
122
+ class: V(["text-c-1 flex gap-1 items-center font-medium text-xs", { "text-c-3": !p.value }])
123
+ }, [
124
+ f(l(L), {
125
+ icon: "Watch",
126
+ size: "sm"
127
+ }),
128
+ e[7] || (e[7] = n(" Watch Mode "))
129
+ ], 2),
130
+ f(l(E), {
131
+ id: "watch-toggle",
132
+ modelValue: p.value,
133
+ "onUpdate:modelValue": e[3] || (e[3] = (s) => p.value = s),
134
+ disabled: !!t.value && !v.value
135
+ }, null, 8, ["modelValue", "disabled"])
136
+ ], 2)
137
+ ]),
138
+ content: c(() => [
139
+ d("div", ee, [
140
+ d("div", te, [
141
+ t.value && !v.value ? (a(), i("span", oe, "Watch Mode is only supported with URL")) : (a(), i("span", ae, "Watch your OpenAPI URL for changes. Enabled it will update the API client for you."))
142
+ ])
143
+ ])
144
+ ]),
145
+ _: 1
146
+ })
147
+ ])
88
148
  ]),
89
- submit: p(() => [
90
- e[6] || (e[6] = i(" Import ")),
91
- S.value ? (l(), u(m, { key: 0 }, [
92
- i(" from URL ")
93
- ], 64)) : o.value && C.value ? (l(), u(m, { key: 1 }, [
94
- o.value.title ? (l(), u(m, { key: 0 }, [
95
- i(' "' + w(o.value.title) + '" ', 1)
96
- ], 64)) : (l(), u(m, { key: 1 }, [
97
- i(w(o.value.version) + " Spec", 1)
149
+ submit: c(() => [
150
+ e[8] || (e[8] = n(" Import ")),
151
+ v.value ? (a(), i(g, { key: 0 }, [
152
+ n(" from URL ")
153
+ ], 64)) : r.value && S.value ? (a(), i(g, { key: 1 }, [
154
+ r.value.title ? (a(), i(g, { key: 0 }, [
155
+ n(' "' + _(r.value.title) + '" ', 1)
156
+ ], 64)) : (a(), i(g, { key: 1 }, [
157
+ n(_(r.value.version) + " Spec", 1)
98
158
  ], 64))
99
- ], 64)) : (l(), u(m, { key: 2 }, [
100
- i("Collection")
159
+ ], 64)) : (a(), i(g, { key: 2 }, [
160
+ n("Collection")
101
161
  ], 64))
102
162
  ]),
103
- default: p(() => [
104
- !o.value || r(x)(t.value) ? (l(), k(W, {
163
+ default: c(() => [
164
+ !r.value || l(k)(t.value) ? (a(), h(G, {
105
165
  key: 0,
106
166
  modelValue: t.value,
107
- "onUpdate:modelValue": e[0] || (e[0] = (n) => t.value = n),
108
- placeholder: "Paste Swagger/OpenAPI File URL or content",
109
- onOnDelete: e[1] || (e[1] = (n) => f("back", n))
110
- }, null, 8, ["modelValue"])) : (l(), u(m, { key: 1 }, [
111
- U("div", q, [
112
- e[4] || (e[4] = U("div", { class: "pl-8 text-xs min-h-8 py-2 text-c-2" }, "Preview", -1)),
113
- y(r(D), {
167
+ "onUpdate:modelValue": e[0] || (e[0] = (s) => t.value = s),
168
+ placeholder: "OpenAPI/Swagger URL or document",
169
+ onOnDelete: e[1] || (e[1] = (s) => b("back", s))
170
+ }, null, 8, ["modelValue"])) : (a(), i(g, { key: 1 }, [
171
+ d("div", X, [
172
+ e[5] || (e[5] = d("div", { class: "pl-8 text-xs min-h-8 py-2 text-c-2" }, "Preview", -1)),
173
+ f(l(F), {
114
174
  class: "ml-auto p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
115
175
  variant: "ghost",
116
- onClick: e[2] || (e[2] = (n) => t.value = "")
176
+ onClick: e[2] || (e[2] = (s) => t.value = "")
117
177
  }, {
118
- default: p(() => e[3] || (e[3] = [
119
- i(" Clear ")
178
+ default: c(() => e[4] || (e[4] = [
179
+ n(" Clear ")
120
180
  ])),
121
181
  _: 1
122
182
  })
123
183
  ]),
124
- o.value && !r(x)(t.value) ? (l(), k(r(_), {
184
+ r.value && !l(k)(t.value) ? (a(), h(l(J), {
125
185
  key: 0,
126
186
  class: "border max-h-[40dvh] mt-1 bg-b-2 rounded [--scalar-small:--scalar-font-size-4]",
127
187
  content: t.value,
128
188
  copy: !1,
129
- lang: C.value
130
- }, null, 8, ["content", "lang"])) : T("", !0)
189
+ lang: S.value
190
+ }, null, 8, ["content", "lang"])) : N("", !0)
131
191
  ], 64))
132
192
  ]),
133
193
  _: 1
@@ -135,5 +195,5 @@ const q = { class: "flex justify-between" }, le = /* @__PURE__ */ $({
135
195
  }
136
196
  });
137
197
  export {
138
- le as default
198
+ ve as default
139
199
  };
@@ -6,7 +6,7 @@
6
6
  declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7
7
  export default _default;
8
8
  export declare const PaletteComponents: {
9
- readonly 'Import Collection': import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
+ readonly 'Import from OpenAPI/Swagger': import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
10
10
  close: () => any;
11
11
  back: (e: KeyboardEvent) => any;
12
12
  }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"AA2XA;;;;GAIG;;AACH,wBAgfI;AAEJ,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQpB,CAAA;AAEV,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,iBAAiB,CAAA;AAEzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,8DAA8D;IAC9D,WAAW,CAAC,EAAE,YAAY,CAAA;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B,CACA"}
1
+ {"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"AA2XA;;;;GAIG;;AACH,wBA+eI;AAEJ,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQpB,CAAA;AAEV,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,iBAAiB,CAAA;AAEzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,8DAA8D;IAC9D,WAAW,CAAC,EAAE,YAAY,CAAA;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B,CACA"}
@@ -1,9 +1,9 @@
1
1
  import o from "./TheCommandPalette.vue2.js";
2
- import { PaletteComponents as s } from "./TheCommandPalette.vue2.js";
2
+ import { PaletteComponents as f } from "./TheCommandPalette.vue2.js";
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c50523ba"]]);
5
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d5ed30d9"]]);
6
6
  export {
7
- s as PaletteComponents,
8
- r as default
7
+ f as PaletteComponents,
8
+ a as default
9
9
  };
@@ -1,12 +1,12 @@
1
- import { defineComponent as U, ref as i, computed as E, watch as G, onMounted as Q, onBeforeUnmount as j, openBlock as a, createBlock as K, unref as r, withCtx as _, createElementVNode as u, createVNode as f, createTextVNode as M, createElementBlock as m, Fragment as p, withDirectives as T, withKeys as g, withModifiers as D, vModelText as J, renderList as B, toDisplayString as V, vShow as O, normalizeClass as X, createCommentVNode as Y, resolveDynamicComponent as Z, mergeProps as ee, nextTick as W } from "vue";
2
- import { useModal as oe, ScalarIcon as $ } from "@scalar/components";
1
+ import { defineComponent as O, ref as c, computed as E, watch as U, onMounted as G, onBeforeUnmount as Q, openBlock as a, createBlock as K, unref as r, withCtx as _, createElementVNode as u, createVNode as f, createTextVNode as M, createElementBlock as m, Fragment as p, withDirectives as T, withKeys as g, withModifiers as A, vModelText as j, renderList as B, toDisplayString as V, vShow as J, normalizeClass as X, createCommentVNode as Y, resolveDynamicComponent as Z, mergeProps as ee, nextTick as W } from "vue";
2
+ import { useModal as oe, ScalarIcon as S } from "@scalar/components";
3
3
  import { Dialog as te, DialogPanel as ne, DialogTitle as ae } from "@headlessui/vue";
4
4
  import { useRouter as le } from "vue-router";
5
5
  import se from "./CommandPaletteCollection.vue.js";
6
6
  import re from "./CommandPaletteExample.vue.js";
7
7
  import me from "./CommandPaletteImport.vue.js";
8
- import ce from "./CommandPaletteRequest.vue.js";
9
- import ie from "./CommandPaletteServer.vue.js";
8
+ import ie from "./CommandPaletteRequest.vue.js";
9
+ import ce from "./CommandPaletteServer.vue.js";
10
10
  import ue from "./CommandPaletteTag.vue.js";
11
11
  import de from "./CommandPaletteWorkspace.vue.js";
12
12
  import { useWorkspace as fe } from "../../store/store.js";
@@ -16,17 +16,17 @@ const pe = { class: "bg-b-2 flex items-center rounded-md mb-2.5 pl-2 focus-withi
16
16
  }, xe = {
17
17
  name: "TheCommandPalette"
18
18
  }, be = {
19
- "Import Collection": me,
20
- "Create Request": ce,
19
+ "Import from OpenAPI/Swagger": me,
20
+ "Create Request": ie,
21
21
  "Create Workspace": de,
22
22
  "Add Tag": ue,
23
- "Add Server": ie,
23
+ "Add Server": ce,
24
24
  "Create Collection": se,
25
25
  "Add Example": re
26
- }, Ee = /* @__PURE__ */ U({
26
+ }, Ee = /* @__PURE__ */ O({
27
27
  ...xe,
28
- setup(ye) {
29
- const A = [
28
+ setup(we) {
29
+ const D = [
30
30
  {
31
31
  label: "",
32
32
  commands: [
@@ -35,7 +35,7 @@ const pe = { class: "bg-b-2 flex items-center rounded-md mb-2.5 pl-2 focus-withi
35
35
  icon: "ExternalLink"
36
36
  },
37
37
  {
38
- name: "Import Collection",
38
+ name: "Import from OpenAPI/Swagger",
39
39
  icon: "Import"
40
40
  },
41
41
  {
@@ -75,23 +75,23 @@ const pe = { class: "bg-b-2 flex items-center rounded-md mb-2.5 pl-2 focus-withi
75
75
  }
76
76
  ]
77
77
  }
78
- ], d = oe(), { push: N } = le(), { activeWorkspace: H, events: v } = fe(), x = i(), l = i(""), s = i(null), c = i(-1), S = i([]), C = E(
79
- () => A.reduce((o, e) => {
78
+ ], d = oe(), { push: N } = le(), { activeWorkspace: H, events: v } = fe(), x = c(), l = c(""), s = c(null), i = c(-1), P = c([]), C = E(
79
+ () => D.reduce((o, e) => {
80
80
  const t = e.commands.filter(
81
81
  (n) => n.name.toLowerCase().includes(l.value.toLowerCase())
82
82
  );
83
83
  return [...o, ...t];
84
84
  }, [])
85
85
  ), h = () => {
86
- d.hide(), l.value = "", s.value = null, c.value = -1;
86
+ d.hide(), l.value = "", s.value = null, i.value = -1;
87
87
  }, q = (o) => {
88
88
  l.value !== "" && (o == null || o.preventDefault()), s.value = null, W(() => {
89
89
  var e;
90
90
  return (e = b.value) == null ? void 0 : e.focus();
91
91
  });
92
- }, P = (o) => {
92
+ }, $ = (o) => {
93
93
  "path" in o ? (N(`/workspace/${H.value.uid}${o.path}`), h()) : s.value = o.name;
94
- }, b = i(), L = ({
94
+ }, b = c(), I = ({
95
95
  commandName: o,
96
96
  metaData: e
97
97
  } = {}) => {
@@ -100,36 +100,36 @@ const pe = { class: "bg-b-2 flex items-center rounded-md mb-2.5 pl-2 focus-withi
100
100
  return (t = b.value) == null ? void 0 : t.focus();
101
101
  });
102
102
  };
103
- G(l, (o) => {
104
- o && C.value.length > 0 && (c.value = 0);
103
+ U(l, (o) => {
104
+ o && C.value.length > 0 && (i.value = 0);
105
105
  });
106
- const R = (o, e) => {
106
+ const L = (o, e) => {
107
107
  var k;
108
108
  if (!d.open) return;
109
109
  e.preventDefault();
110
110
  const t = o === "up" ? -1 : 1, n = C.value.length;
111
- c.value = (c.value + t + n) % n, (k = S.value[c.value]) == null || k.scrollIntoView({
111
+ i.value = (i.value + t + n) % n, (k = P.value[i.value]) == null || k.scrollIntoView({
112
112
  behavior: "smooth",
113
113
  block: "nearest"
114
114
  });
115
- }, y = E(
116
- () => C.value[c.value]
115
+ }, w = E(
116
+ () => C.value[i.value]
117
117
  ), F = (o) => {
118
- !y.value || s.value || (o.preventDefault(), o.stopPropagation(), P(y.value));
119
- }, I = (o) => {
118
+ !w.value || s.value || (o.preventDefault(), o.stopPropagation(), $(w.value));
119
+ }, R = (o) => {
120
120
  d.open && o != null && o.closeModal && h();
121
121
  };
122
- return Q(() => {
123
- v.commandPalette.on(L), v.hotKeys.on(I);
124
- }), j(() => {
125
- v.commandPalette.off(L), v.hotKeys.off(I);
122
+ return G(() => {
123
+ v.commandPalette.on(I), v.hotKeys.on(R);
124
+ }), Q(() => {
125
+ v.commandPalette.off(I), v.hotKeys.off(R);
126
126
  }), (o, e) => (a(), K(r(te), {
127
127
  open: r(d).open,
128
128
  onClose: e[5] || (e[5] = (t) => h())
129
129
  }, {
130
130
  default: _(() => [
131
131
  e[7] || (e[7] = u("div", { class: "commandmenu-overlay z-overlay" }, null, -1)),
132
- f(r(ne), { class: "commandmenu z-overlay custom-scroll" }, {
132
+ f(r(ne), { class: "commandmenu z-overlay" }, {
133
133
  default: _(() => [
134
134
  f(r(ae), { class: "sr-only" }, {
135
135
  default: _(() => e[6] || (e[6] = [
@@ -143,7 +143,7 @@ const pe = { class: "bg-b-2 flex items-center rounded-md mb-2.5 pl-2 focus-withi
143
143
  type: "button",
144
144
  onClick: e[3] || (e[3] = (t) => s.value = null)
145
145
  }, [
146
- f(r($), {
146
+ f(r(S), {
147
147
  icon: "ChevronLeft",
148
148
  size: "md",
149
149
  thickness: "1.5"
@@ -156,7 +156,7 @@ const pe = { class: "bg-b-2 flex items-center rounded-md mb-2.5 pl-2 focus-withi
156
156
  ], 64)) : (a(), m(p, { key: 0 }, [
157
157
  u("div", pe, [
158
158
  u("label", ve, [
159
- f(r($), {
159
+ f(r(S), {
160
160
  class: "text-c-2 mr-2.5",
161
161
  icon: "Search",
162
162
  size: "md",
@@ -174,20 +174,20 @@ const pe = { class: "bg-b-2 flex items-center rounded-md mb-2.5 pl-2 focus-withi
174
174
  placeholder: "Search commands...",
175
175
  type: "text",
176
176
  onKeydown: [
177
- e[1] || (e[1] = g(D((t) => R("down", t), ["stop"]), ["down"])),
178
- g(D(F, ["stop"]), ["enter"]),
179
- e[2] || (e[2] = g(D((t) => R("up", t), ["stop"]), ["up"]))
177
+ e[1] || (e[1] = g(A((t) => L("down", t), ["stop"]), ["down"])),
178
+ g(A(F, ["stop"]), ["enter"]),
179
+ e[2] || (e[2] = g(A((t) => L("up", t), ["stop"]), ["up"]))
180
180
  ]
181
181
  }, null, 40, Ce), [
182
- [J, l.value]
182
+ [j, l.value]
183
183
  ])
184
184
  ]),
185
- (a(), m(p, null, B(A, (t) => (a(), m(p, {
185
+ (a(), m(p, null, B(D, (t) => (a(), m(p, {
186
186
  key: t.label
187
187
  }, [
188
188
  T(u("div", { class: "text-c-3 font-medium text-xs px-2 mb-1 mt-2" }, V(t.label), 513), [
189
189
  [
190
- O,
190
+ J,
191
191
  t.commands.filter(
192
192
  (n) => n.name.toLowerCase().includes(l.value.toLowerCase())
193
193
  ).length > 0
@@ -200,15 +200,15 @@ const pe = { class: "bg-b-2 flex items-center rounded-md mb-2.5 pl-2 focus-withi
200
200
  return a(), m("div", {
201
201
  key: n.name,
202
202
  ref_for: !0,
203
- ref: (w) => {
204
- w && (S.value[k] = w);
203
+ ref: (y) => {
204
+ y && (P.value[k] = y);
205
205
  },
206
206
  class: X(["commandmenu-item text-sm flex items-center py-1.5 px-2 rounded hover:bg-b-2 cursor-pointer", {
207
- "bg-b-2": n.name === ((z = y.value) == null ? void 0 : z.name)
207
+ "bg-b-2": n.name === ((z = w.value) == null ? void 0 : z.name)
208
208
  }]),
209
- onClick: (w) => P(n)
209
+ onClick: (y) => $(n)
210
210
  }, [
211
- f(r($), {
211
+ f(r(S), {
212
212
  class: "text-c-2 mr-2.5",
213
213
  icon: n.icon,
214
214
  size: "md",
@@ -1 +1 @@
1
- {"version":3,"file":"ImportNowButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportNowButton.vue"],"names":[],"mappings":";aA6GW,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;;;;aADlB,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;;;;AAkL7B,wBASG"}
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,10 +1,10 @@
1
- import { defineComponent as x, openBlock as s, createElementBlock as b, Fragment as w, createBlock as m, unref as a, withCtx as p, createTextVNode as c, createCommentVNode as g } from "vue";
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
2
  import { isUrl as h } from "./utils/isUrl.js";
3
3
  import { ScalarButton as l } from "@scalar/components";
4
4
  import { useToasts as F } from "@scalar/use-toasts";
5
5
  import { useRouter as B } from "vue-router";
6
6
  import { useWorkspace as I } from "../../store/store.js";
7
- const R = /* @__PURE__ */ x({
7
+ const R = /* @__PURE__ */ b({
8
8
  __name: "ImportNowButton",
9
9
  props: {
10
10
  source: {},
@@ -12,20 +12,18 @@ const R = /* @__PURE__ */ x({
12
12
  },
13
13
  emits: ["importFinished"],
14
14
  setup(f, { emit: d }) {
15
- const o = f, k = d, y = B(), { importSpecFromUrl: v, importSpecFile: C, activeWorkspace: r } = I(), { toast: i } = F();
15
+ const o = f, k = d, y = B(), { importSpecFromUrl: C, importSpecFile: x, activeWorkspace: r } = I(), { toast: i } = F();
16
16
  async function n() {
17
17
  try {
18
18
  if (o.source) {
19
19
  if (h(o.source)) {
20
- const t = await v(
20
+ const [t, e] = await C(
21
21
  o.source,
22
- void 0,
23
- void 0,
24
22
  r.value.uid
25
23
  );
26
- u(t);
24
+ t || u(e);
27
25
  } else {
28
- const t = await C(
26
+ const t = await x(
29
27
  o.source,
30
28
  r.value.uid
31
29
  );
@@ -48,7 +46,7 @@ const R = /* @__PURE__ */ x({
48
46
  }
49
47
  });
50
48
  }
51
- return (t, e) => t.source ? (s(), b(w, { key: 0 }, [
49
+ return (t, e) => t.source ? (s(), v(w, { key: 0 }, [
52
50
  t.variant === "button" ? (s(), m(a(l), {
53
51
  key: 0,
54
52
  class: "text-[21px] py-2.5 px-6 rounded-lg font-bold h-fit mt-3 mb-1.5",