@scalar/api-client 2.2.6 → 2.2.8

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 (58) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  3. package/dist/components/AddressBar/AddressBar.vue2.js +1 -1
  4. package/dist/components/AddressBar/AddressBarServer.vue.js +18 -18
  5. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +108 -106
  7. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +20 -20
  8. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
  9. package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
  10. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +12 -12
  11. package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
  12. package/dist/components/HttpMethod/HttpMethod.vue2.js +12 -12
  13. package/dist/components/HttpMethod/index.d.ts +0 -1
  14. package/dist/components/HttpMethod/index.d.ts.map +1 -1
  15. package/dist/components/HttpMethod/index.js +2 -4
  16. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  17. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +119 -102
  18. package/dist/components/OpenApiClientButton.vue.d.ts +1 -0
  19. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
  20. package/dist/components/OpenApiClientButton.vue.js +2 -2
  21. package/dist/components/OpenApiClientButton.vue2.js +23 -17
  22. package/dist/components/Search/useSearch.d.ts.map +1 -1
  23. package/dist/components/Search/useSearch.js +45 -41
  24. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  25. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  26. package/dist/layouts/Modal/ApiClientModal.vue2.js +28 -23
  27. package/dist/libs/create-client.d.ts +1 -0
  28. package/dist/libs/create-client.d.ts.map +1 -1
  29. package/dist/libs/create-client.js +31 -30
  30. package/dist/libs/index.d.ts +1 -0
  31. package/dist/libs/index.d.ts.map +1 -1
  32. package/dist/libs/index.js +28 -24
  33. package/dist/libs/postman.d.ts +11 -0
  34. package/dist/libs/postman.d.ts.map +1 -0
  35. package/dist/libs/postman.js +39 -0
  36. package/dist/style.css +1 -1
  37. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  38. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +65 -62
  39. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  40. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  41. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +82 -84
  42. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  43. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  44. package/dist/views/Request/RequestSection/RequestBody.vue2.js +27 -24
  45. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  46. package/dist/views/Request/RequestSidebar.vue.js +4 -4
  47. package/dist/views/Request/RequestSidebar.vue2.js +32 -30
  48. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  49. package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
  50. package/dist/views/Request/RequestSubpageHeader.vue2.js +34 -32
  51. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  52. package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
  53. package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
  54. package/dist/views/Request/libs/live-sync.js +77 -78
  55. package/package.json +10 -9
  56. package/dist/components/HttpMethod/helpers.d.ts +0 -4
  57. package/dist/components/HttpMethod/helpers.d.ts.map +0 -1
  58. package/dist/components/HttpMethod/helpers.js +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.2.8
4
+
5
+ ### Patch Changes
6
+
7
+ - f2ec59d: feat: add postman import
8
+
9
+ ## 2.2.7
10
+
11
+ ### Patch Changes
12
+
13
+ - a90d827: feat(components): create ScalarTeleport component
14
+ - d0adebf: fix: updates tailwind config content
15
+ - c2be791: fix: watches text input to fuse search
16
+ - 3b4a788: fix: updates default row for request body
17
+ - f4440f5: feat: added logo functionality to the importer
18
+ - 4c5be96: feat: adds isHttpMethod to helpers
19
+ - Updated dependencies [a90d827]
20
+ - Updated dependencies [3b4a788]
21
+ - Updated dependencies [4c5be96]
22
+ - Updated dependencies [4c5be96]
23
+ - @scalar/components@0.13.2
24
+ - @scalar/oas-utils@0.2.85
25
+ - @scalar/use-codemirror@0.11.46
26
+ - @scalar/import@0.2.3
27
+
3
28
  ## 2.2.6
4
29
 
5
30
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  import o from "./AddressBar.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-4d3290fc"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-455b0236"]]);
5
5
  export {
6
- d as default
6
+ m as default
7
7
  };
@@ -95,7 +95,7 @@ const te = {
95
95
  isEditable: !a(c),
96
96
  isSquare: "",
97
97
  method: a(l).method,
98
- teleport: ".scalar-client",
98
+ teleport: "",
99
99
  onChange: V
100
100
  }, null, 8, ["isEditable", "method"])
101
101
  ]),
@@ -1,4 +1,4 @@
1
- import { defineComponent as V, computed as u, watch as E, openBlock as l, createBlock as S, unref as n, withCtx as w, createElementBlock as o, createCommentVNode as v, Fragment as m, renderList as g, createVNode as p, createElementVNode as a, createTextVNode as O, toDisplayString as b } from "vue";
1
+ import { defineComponent as V, computed as c, watch as E, openBlock as l, createBlock as S, unref as o, withCtx as w, createElementBlock as n, createCommentVNode as v, Fragment as m, renderList as g, createVNode as p, createElementVNode as a, createTextVNode as O, toDisplayString as b } from "vue";
2
2
  import { useActiveEntities as R } from "../../store/active-entities.js";
3
3
  import { ScalarDropdown as W, ScalarDropdownDivider as A, ScalarDropdownItem as I, ScalarIcon as L } from "@scalar/components";
4
4
  import C from "./AddressBarServerItem.vue.js";
@@ -15,7 +15,7 @@ const j = {
15
15
  }, K = /* @__PURE__ */ V({
16
16
  __name: "AddressBarServer",
17
17
  setup(P) {
18
- const { activeRequest: y, activeCollection: k, activeServer: x } = R(), { isReadOnly: D, servers: _, collectionMutators: N, events: B } = T(), c = u(
18
+ const { activeRequest: y, activeCollection: k, activeServer: x } = R(), { isReadOnly: D, servers: _, collectionMutators: N, events: B } = T(), d = c(
19
19
  () => {
20
20
  var t, e;
21
21
  return (e = (t = y.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
@@ -26,7 +26,7 @@ const j = {
26
26
  };
27
27
  });
28
28
  }
29
- ), d = u(
29
+ ), u = c(
30
30
  () => {
31
31
  var t, e;
32
32
  return (e = (t = k.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
@@ -37,10 +37,10 @@ const j = {
37
37
  };
38
38
  });
39
39
  }
40
- ), h = u(
40
+ ), h = c(
41
41
  () => {
42
42
  var t, e;
43
- return ((t = c.value) == null ? void 0 : t.length) && ((e = d.value) == null ? void 0 : e.length);
43
+ return ((t = d.value) == null ? void 0 : t.length) && ((e = u.value) == null ? void 0 : e.length);
44
44
  }
45
45
  );
46
46
  E([k, y], ([t, e]) => {
@@ -52,43 +52,43 @@ const j = {
52
52
  });
53
53
  const U = () => B.commandPalette.emit({
54
54
  commandName: "Add Server"
55
- }), f = u(() => {
55
+ }), f = c(() => {
56
56
  var t, e, r;
57
57
  return (e = (t = x.value) == null ? void 0 : t.url) != null && e.endsWith("/") ? x.value.url.slice(0, -1) : ((r = x.value) == null ? void 0 : r.url) || "";
58
58
  });
59
59
  return (t, e) => {
60
60
  var r, s;
61
- return c.value && ((r = c.value) == null ? void 0 : r.length) > 1 || d.value && ((s = d.value) == null ? void 0 : s.length) > 1 ? (l(), S(n(W), {
61
+ return d.value && ((r = d.value) == null ? void 0 : r.length) > 1 || u.value && ((s = u.value) == null ? void 0 : s.length) > 1 ? (l(), S(o(W), {
62
62
  key: 0,
63
63
  class: "w-max",
64
- teleport: ".scalar-client"
64
+ teleport: ""
65
65
  }, {
66
66
  items: w(() => [
67
- h.value ? (l(), o("div", z, " Request Servers ")) : v("", !0),
68
- (l(!0), o(m, null, g(c.value, (i) => (l(), S(C, {
67
+ h.value ? (l(), n("div", z, " Request Servers ")) : v("", !0),
68
+ (l(!0), n(m, null, g(d.value, (i) => (l(), S(C, {
69
69
  key: i.id,
70
70
  serverOption: i,
71
71
  type: "request"
72
72
  }, null, 8, ["serverOption"]))), 128)),
73
- h.value ? (l(), o(m, { key: 1 }, [
74
- p(n(A)),
73
+ h.value ? (l(), n(m, { key: 1 }, [
74
+ p(o(A)),
75
75
  e[1] || (e[1] = a("div", { class: "text-xxs text-c-2 ml-8" }, "Collection Servers", -1))
76
76
  ], 64)) : v("", !0),
77
- (l(!0), o(m, null, g(d.value, (i) => (l(), S(C, {
77
+ (l(!0), n(m, null, g(u.value, (i) => (l(), S(C, {
78
78
  key: i.id,
79
79
  serverOption: i,
80
80
  type: "collection"
81
81
  }, null, 8, ["serverOption"]))), 128)),
82
- n(D) ? v("", !0) : (l(), o(m, { key: 2 }, [
83
- p(n(A)),
84
- p(n(I), null, {
82
+ o(D) ? v("", !0) : (l(), n(m, { key: 2 }, [
83
+ p(o(A)),
84
+ p(o(I), null, {
85
85
  default: w(() => [
86
86
  a("div", {
87
87
  class: "font-code text-xxs flex items-center gap-1.5",
88
88
  onClick: U
89
89
  }, [
90
90
  a("div", F, [
91
- p(n(L), {
91
+ p(o(L), {
92
92
  icon: "Add",
93
93
  size: "sm"
94
94
  })
@@ -107,7 +107,7 @@ const j = {
107
107
  ])
108
108
  ]),
109
109
  _: 1
110
- })) : f.value ? (l(), o("div", M, b(f.value), 1)) : v("", !0);
110
+ })) : f.value ? (l(), n("div", M, b(f.value), 1)) : v("", !0);
111
111
  };
112
112
  }
113
113
  });
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AA+mBA,wBAOG"}
1
+ {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AA2pBA,wBAOG"}
@@ -1,42 +1,44 @@
1
- import { defineComponent as $, ref as U, computed as k, watch as _, openBlock as a, createBlock as h, unref as r, withCtx as u, createElementVNode as f, createVNode as g, createTextVNode as c, createElementBlock as s, Fragment as d, toDisplayString as A, createCommentVNode as z } from "vue";
2
- import { useActiveEntities as B } from "../../store/active-entities.js";
3
- import { useLoadingState as N, ScalarButton as O, ScalarIcon as j, ScalarTooltip as E, ScalarCodeBlock as W } from "@scalar/components";
4
- import { useToasts as J } from "@scalar/use-toasts";
5
- import Y from "./CommandActionForm.vue.js";
6
- import q from "./CommandActionInput.vue.js";
7
- import G from "./WatchModeToggle.vue.js";
8
- import { getOpenApiDocumentDetails as H } from "../../libs/getOpenApiDocumentDetails.js";
9
- import { isUrl as w } from "../../libs/isUrl.js";
10
- import { useFileDialog as K } from "../../hooks/useFileDialog.js";
11
- import { useWorkspace as Q } from "../../store/store.js";
12
- 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 = {
1
+ import { defineComponent as B, ref as _, computed as k, watch as A, openBlock as a, createBlock as C, unref as s, withCtx as c, createElementVNode as g, createVNode as y, createTextVNode as m, createElementBlock as r, Fragment as p, toDisplayString as O, createCommentVNode as N } from "vue";
2
+ import { useActiveEntities as j } from "../../store/active-entities.js";
3
+ import { useLoadingState as E, ScalarButton as D, ScalarIcon as W, ScalarTooltip as J, ScalarCodeBlock as Y } from "@scalar/components";
4
+ import { useToasts as q } from "@scalar/use-toasts";
5
+ import G from "./CommandActionForm.vue.js";
6
+ import H from "./CommandActionInput.vue.js";
7
+ import K from "./WatchModeToggle.vue.js";
8
+ import { isPostmanCollection as S, getPostmanDocumentDetails as Q, convertPostmanToOpenApi as L } from "../../libs/postman.js";
9
+ import { getOpenApiDocumentDetails as X } from "../../libs/getOpenApiDocumentDetails.js";
10
+ import { isUrl as b } from "../../libs/isUrl.js";
11
+ import { useFileDialog as Z } from "../../hooks/useFileDialog.js";
12
+ import { useWorkspace as ee } from "../../store/store.js";
13
+ const te = { class: "flex justify-between" }, oe = { class: "flex flex-row items-center justify-between gap-3 w-full" }, ae = { 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" }, le = { class: "flex items-center text-c-2" }, ne = {
13
14
  key: 0,
14
15
  class: "text-pretty"
15
- }, ae = {
16
+ }, se = {
16
17
  key: 1,
17
18
  class: "text-pretty"
18
- }, ge = /* @__PURE__ */ $({
19
+ }, ke = /* @__PURE__ */ B({
19
20
  __name: "CommandPaletteImport",
20
21
  emits: ["close", "back"],
21
- setup(le, { emit: L }) {
22
- const b = L, { activeWorkspace: y } = B(), { importSpecFile: I, importSpecFromUrl: V } = Q(), { toast: m } = J(), i = N(), o = U(""), p = U(!0), l = k(
23
- () => H(o.value)
24
- ), S = k(
22
+ setup(re, { emit: V }) {
23
+ const h = V, { activeWorkspace: d } = j(), { importSpecFile: x, importSpecFromUrl: R } = ee(), { toast: i } = q(), u = E(), t = _(""), v = _(!0), l = k(() => S(t.value) ? Q(t.value) : X(t.value)), U = k(
25
24
  () => l.value ? l.value.type : "json"
26
- ), v = k(() => w(o.value)), P = k(() => !!l.value), { open: R } = K({
27
- onChange: async (t) => {
28
- const e = t == null ? void 0 : t[0];
25
+ ), f = k(() => b(t.value)), F = k(() => !!l.value), { open: T } = Z({
26
+ onChange: async (o) => {
27
+ const e = o == null ? void 0 : o[0];
29
28
  if (e) {
30
29
  const n = new FileReader();
31
- n.onload = async (F) => {
32
- var C;
33
- const M = (C = F.target) == null ? void 0 : C.result;
30
+ n.onload = async ($) => {
31
+ var P;
32
+ const I = (P = $.target) == null ? void 0 : P.result;
34
33
  try {
35
- await I(M, y.value.uid), m("Import successful", "info"), b("close");
36
- } catch (x) {
37
- console.error(x);
38
- const T = (x == null ? void 0 : x.message) || "Unknown error";
39
- m(`Import failed: ${T}`, "error");
34
+ S(I) ? await x(
35
+ await L(I),
36
+ d.value.uid
37
+ ) : await x(I, d.value.uid), i("Import successful", "info"), h("close");
38
+ } catch (w) {
39
+ console.error(w);
40
+ const z = (w == null ? void 0 : w.message) || "Unknown error";
41
+ i(`Import failed: ${z}`, "error");
40
42
  }
41
43
  }, n.readAsText(e);
42
44
  }
@@ -44,64 +46,64 @@ const X = { class: "flex justify-between" }, Z = { class: "flex flex-row items-c
44
46
  multiple: !1,
45
47
  accept: ".json,.yaml,.yml"
46
48
  });
47
- _(v, (t) => {
48
- t || (p.value = !1);
49
- }), _(o, (t) => {
50
- w(t) || (p.value = !1);
49
+ A(f, (o) => {
50
+ o || (v.value = !1);
51
+ }), A(t, (o) => {
52
+ b(o) || (v.value = !1);
51
53
  });
52
- async function D() {
53
- if (!(!o.value || i.isLoading)) {
54
- i.startLoading();
54
+ async function M() {
55
+ if (!(!t.value || u.isLoading)) {
56
+ u.startLoading();
55
57
  try {
56
- if (v.value) {
57
- const [t] = await V(
58
- o.value,
59
- y.value.uid,
58
+ if (f.value) {
59
+ const [o] = await R(
60
+ t.value,
61
+ d.value.uid,
60
62
  {
61
- proxyUrl: y.value.proxyUrl,
62
- watchMode: p.value
63
+ proxyUrl: d.value.proxyUrl,
64
+ watchMode: v.value
63
65
  }
64
66
  );
65
- if (t) {
66
- m(
67
+ if (o) {
68
+ i(
67
69
  "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.",
68
70
  "error",
69
71
  { timeout: 5e3 }
70
- ), i.invalidate(2e3, !0);
72
+ ), u.invalidate(2e3, !0);
71
73
  return;
72
74
  }
73
- } else if (P.value)
74
- await I(
75
- String(o.value),
76
- y.value.uid
77
- );
75
+ } else if (F.value)
76
+ S(t.value) ? (await x(
77
+ await L(t.value),
78
+ d.value.uid
79
+ ), i("Successfully converted Postman collection", "info")) : await x(t.value, d.value.uid);
78
80
  else {
79
- m("Import failed: Invalid URL or OpenAPI document", "error"), i.invalidate(2e3, !0);
81
+ i("Import failed: Invalid URL or OpenAPI document", "error"), u.invalidate(2e3, !0);
80
82
  return;
81
83
  }
82
- i.clear(), b("close"), m("Import successful", "info");
83
- } catch (t) {
84
- console.error("[importCollection]", t);
85
- const e = (t == null ? void 0 : t.message) || "Unknown error";
86
- i.invalidate(2e3, !0), m(`Import failed: ${e}`, "error");
84
+ u.clear(), h("close"), i("Import successful", "info");
85
+ } catch (o) {
86
+ console.error("[importCollection]", o);
87
+ const e = (o == null ? void 0 : o.message) || "Unknown error";
88
+ u.invalidate(2e3, !0), i(`Import failed: ${e}`, "error");
87
89
  }
88
90
  }
89
91
  }
90
- return (t, e) => (a(), h(Y, {
91
- disabled: !o.value.trim(),
92
- loading: r(i),
93
- onSubmit: D
92
+ return (o, e) => (a(), C(G, {
93
+ disabled: !t.value.trim(),
94
+ loading: s(u),
95
+ onSubmit: M
94
96
  }, {
95
- options: u(() => [
96
- f("div", Z, [
97
- g(r(O), {
97
+ options: c(() => [
98
+ g("div", oe, [
99
+ y(s(D), {
98
100
  class: "p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
99
101
  variant: "outlined",
100
- onClick: r(R)
102
+ onClick: s(T)
101
103
  }, {
102
- default: u(() => [
103
- e[6] || (e[6] = c(" JSON, or YAML File ")),
104
- g(r(j), {
104
+ default: c(() => [
105
+ e[6] || (e[6] = m(" JSON, or YAML File ")),
106
+ y(s(W), {
105
107
  class: "text-c-3",
106
108
  icon: "UploadSimple",
107
109
  size: "md"
@@ -109,23 +111,23 @@ const X = { class: "flex justify-between" }, Z = { class: "flex flex-row items-c
109
111
  ]),
110
112
  _: 1
111
113
  }, 8, ["onClick"]),
112
- g(r(E), {
114
+ y(s(J), {
113
115
  as: "div",
114
116
  class: "z-[10001]",
115
117
  side: "bottom",
116
118
  sideOffset: 5
117
119
  }, {
118
- trigger: u(() => [
119
- g(G, {
120
- modelValue: p.value,
121
- "onUpdate:modelValue": e[3] || (e[3] = (n) => p.value = n),
122
- disabled: !v.value
120
+ trigger: c(() => [
121
+ y(K, {
122
+ modelValue: v.value,
123
+ "onUpdate:modelValue": e[3] || (e[3] = (n) => v.value = n),
124
+ disabled: !f.value
123
125
  }, null, 8, ["modelValue", "disabled"])
124
126
  ]),
125
- content: u(() => [
126
- f("div", ee, [
127
- f("div", te, [
128
- v.value ? (a(), s("span", oe, " Automatically updates the API client when the OpenAPI URL content changes, ensuring your client remains up-to-date. ")) : (a(), s("span", ae, " Watch Mode is only available for URL imports. It automatically updates the API client when the OpenAPI URL content changes. "))
127
+ content: c(() => [
128
+ g("div", ae, [
129
+ g("div", le, [
130
+ f.value ? (a(), r("span", ne, " Automatically updates the API client when the OpenAPI URL content changes, ensuring your client remains up-to-date. ")) : (a(), r("span", se, " Watch Mode is only available for URL imports. It automatically updates the API client when the OpenAPI URL content changes. "))
129
131
  ])
130
132
  ])
131
133
  ]),
@@ -133,48 +135,48 @@ const X = { class: "flex justify-between" }, Z = { class: "flex flex-row items-c
133
135
  })
134
136
  ])
135
137
  ]),
136
- submit: u(() => [
137
- e[7] || (e[7] = c(" Import ")),
138
- v.value ? (a(), s(d, { key: 0 }, [
139
- c(" from URL ")
140
- ], 64)) : l.value && S.value ? (a(), s(d, { key: 1 }, [
141
- l.value.title ? (a(), s(d, { key: 0 }, [
142
- c(' "' + A(l.value.title) + '" ', 1)
143
- ], 64)) : (a(), s(d, { key: 1 }, [
144
- c(A(l.value.version) + " Spec", 1)
138
+ submit: c(() => [
139
+ e[7] || (e[7] = m(" Import ")),
140
+ f.value ? (a(), r(p, { key: 0 }, [
141
+ m(" from URL ")
142
+ ], 64)) : l.value && U.value ? (a(), r(p, { key: 1 }, [
143
+ l.value.title ? (a(), r(p, { key: 0 }, [
144
+ m(' "' + O(l.value.title) + '" ', 1)
145
+ ], 64)) : (a(), r(p, { key: 1 }, [
146
+ m(O(l.value.version) + " Spec", 1)
145
147
  ], 64))
146
- ], 64)) : (a(), s(d, { key: 2 }, [
147
- c("Collection")
148
+ ], 64)) : (a(), r(p, { key: 2 }, [
149
+ m("Collection")
148
150
  ], 64))
149
151
  ]),
150
- default: u(() => [
151
- !l.value || r(w)(o.value) ? (a(), h(q, {
152
+ default: c(() => [
153
+ !l.value || s(b)(t.value) ? (a(), C(H, {
152
154
  key: 0,
153
- modelValue: o.value,
154
- "onUpdate:modelValue": e[0] || (e[0] = (n) => o.value = n),
155
- placeholder: "OpenAPI/Swagger URL or document",
156
- onOnDelete: e[1] || (e[1] = (n) => b("back", n))
157
- }, null, 8, ["modelValue"])) : (a(), s(d, { key: 1 }, [
158
- f("div", X, [
159
- e[5] || (e[5] = f("div", { class: "pl-8 text-xs min-h-8 py-2 text-c-2" }, "Preview", -1)),
160
- g(r(O), {
155
+ modelValue: t.value,
156
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => t.value = n),
157
+ placeholder: "OpenAPI/Swagger/Postman URL or document",
158
+ onOnDelete: e[1] || (e[1] = (n) => h("back", n))
159
+ }, null, 8, ["modelValue"])) : (a(), r(p, { key: 1 }, [
160
+ g("div", te, [
161
+ e[5] || (e[5] = g("div", { class: "pl-8 text-xs min-h-8 py-2 text-c-2" }, "Preview", -1)),
162
+ y(s(D), {
161
163
  class: "ml-auto p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
162
164
  variant: "ghost",
163
- onClick: e[2] || (e[2] = (n) => o.value = "")
165
+ onClick: e[2] || (e[2] = (n) => t.value = "")
164
166
  }, {
165
- default: u(() => e[4] || (e[4] = [
166
- c(" Clear ")
167
+ default: c(() => e[4] || (e[4] = [
168
+ m(" Clear ")
167
169
  ])),
168
170
  _: 1
169
171
  })
170
172
  ]),
171
- l.value && !r(w)(o.value) ? (a(), h(r(W), {
173
+ l.value && !s(b)(t.value) ? (a(), C(s(Y), {
172
174
  key: 0,
173
175
  class: "border max-h-[40dvh] mt-1 bg-b-2 rounded [--scalar-small:--scalar-font-size-4]",
174
- content: o.value,
176
+ content: t.value,
175
177
  copy: !1,
176
- lang: S.value
177
- }, null, 8, ["content", "lang"])) : z("", !0)
178
+ lang: U.value
179
+ }, null, 8, ["content", "lang"])) : N("", !0)
178
180
  ], 64))
179
181
  ]),
180
182
  _: 1
@@ -182,5 +184,5 @@ const X = { class: "flex justify-between" }, Z = { class: "flex flex-row items-c
182
184
  }
183
185
  });
184
186
  export {
185
- ge as default
187
+ ke as default
186
188
  };
@@ -1,26 +1,26 @@
1
- import { defineComponent as P, ref as c, computed as x, openBlock as h, createBlock as C, withCtx as u, createElementVNode as f, createVNode as i, unref as n, normalizeClass as q, toDisplayString as V, createCommentVNode as W, createTextVNode as j } from "vue";
2
- import H from "../HttpMethod/HttpMethod.vue.js";
3
- import { useActiveEntities as I } from "../../store/active-entities.js";
1
+ import { defineComponent as W, ref as c, computed as x, openBlock as h, createBlock as C, withCtx as u, createElementVNode as f, createVNode as i, unref as n, normalizeClass as q, toDisplayString as V, createCommentVNode as j, createTextVNode as H } from "vue";
2
+ import I from "../HttpMethod/HttpMethod.vue.js";
3
+ import { useActiveEntities as P } from "../../store/active-entities.js";
4
4
  import { ScalarListbox as w, ScalarButton as D, ScalarIcon as k } from "@scalar/components";
5
- import { useToasts as $ } from "@scalar/use-toasts";
6
- import { useRouter as A } from "vue-router";
7
- import L from "./CommandActionForm.vue.js";
8
- import O from "./CommandActionInput.vue.js";
9
- import { isHTTPMethod as F } from "../HttpMethod/helpers.js";
5
+ import { isHttpMethod as $ } from "@scalar/oas-utils/helpers";
6
+ import { useToasts as A } from "@scalar/use-toasts";
7
+ import { useRouter as L } from "vue-router";
8
+ import O from "./CommandActionForm.vue.js";
9
+ import F from "./CommandActionInput.vue.js";
10
10
  import { useWorkspace as G } from "../../store/store.js";
11
- const J = { class: "flex" }, se = /* @__PURE__ */ P({
11
+ const J = { class: "flex" }, se = /* @__PURE__ */ W({
12
12
  __name: "CommandPaletteRequest",
13
13
  props: {
14
14
  metaData: {}
15
15
  },
16
16
  emits: ["close", "back"],
17
17
  setup(S, { emit: _ }) {
18
- const r = S, b = _, { push: M } = A(), { toast: N } = $(), {
18
+ const r = S, b = _, { push: M } = L(), { toast: N } = A(), {
19
19
  activeCollection: R,
20
20
  activeWorkspace: U,
21
21
  activeWorkspaceCollections: g,
22
- activeRequest: T
23
- } = I(), { requestMutators: y, tags: z } = G(), o = c(""), m = c("get"), p = x(
22
+ activeRequest: y
23
+ } = P(), { requestMutators: T, tags: z } = G(), o = c(""), m = c("get"), p = x(
24
24
  () => g.value.map((t) => {
25
25
  var e;
26
26
  return {
@@ -61,7 +61,7 @@ const J = { class: "flex" }, se = /* @__PURE__ */ P({
61
61
  return t.id === ((e = r.metaData) == null ? void 0 : e.itemUid);
62
62
  }) : d.value.find((t) => {
63
63
  var e, a;
64
- return t.label === ((a = (e = T.value) == null ? void 0 : e.tags) == null ? void 0 : a[0]);
64
+ return t.label === ((a = (e = y.value) == null ? void 0 : e.tags) == null ? void 0 : a[0]);
65
65
  })
66
66
  ), B = (t) => m.value = t, E = () => {
67
67
  var e;
@@ -69,9 +69,9 @@ const J = { class: "flex" }, se = /* @__PURE__ */ P({
69
69
  N("Please enter a name before creating a request.", "error");
70
70
  return;
71
71
  }
72
- if (!((e = l.value) != null && e.id) || !F(m.value))
72
+ if (!((e = l.value) != null && e.id) || !$(m.value))
73
73
  return;
74
- const t = y.add(
74
+ const t = T.add(
75
75
  {
76
76
  path: "",
77
77
  method: m.value,
@@ -90,13 +90,13 @@ const J = { class: "flex" }, se = /* @__PURE__ */ P({
90
90
  }
91
91
  }), b("close");
92
92
  };
93
- return (t, e) => (h(), C(L, {
93
+ return (t, e) => (h(), C(O, {
94
94
  disabled: !o.value.trim(),
95
95
  onSubmit: E
96
96
  }, {
97
97
  options: u(() => [
98
98
  f("div", J, [
99
- i(H, {
99
+ i(I, {
100
100
  isEditable: !0,
101
101
  isSquare: "",
102
102
  method: m.value,
@@ -152,14 +152,14 @@ const J = { class: "flex" }, se = /* @__PURE__ */ P({
152
152
  })
153
153
  ]),
154
154
  _: 1
155
- }, 8, ["modelValue", "options"])) : W("", !0)
155
+ }, 8, ["modelValue", "options"])) : j("", !0)
156
156
  ])
157
157
  ]),
158
158
  submit: u(() => e[4] || (e[4] = [
159
- j("Create Request")
159
+ H("Create Request")
160
160
  ])),
161
161
  default: u(() => [
162
- i(O, {
162
+ i(F, {
163
163
  modelValue: o.value,
164
164
  "onUpdate:modelValue": e[0] || (e[0] = (a) => o.value = a),
165
165
  label: "Request Name",
@@ -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 from OpenAPI/Swagger': import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
+ readonly 'Import from OpenAPI/Swagger/Postman': 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<{
@@ -2,8 +2,8 @@ import o from "./TheCommandPalette.vue2.js";
2
2
  import { PaletteComponents as s } 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-a44888ad"]]);
5
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c09436db"]]);
6
6
  export {
7
7
  s as PaletteComponents,
8
- r as default
8
+ a as default
9
9
  };