@scalar/api-client 2.2.21 → 2.2.23

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 (144) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +70 -71
  5. package/dist/components/AddressBar/AddressBarServer.vue.js +26 -26
  6. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  7. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  8. package/dist/components/CodeInput/CodeInput.vue2.js +46 -46
  9. package/dist/components/CodeInput/codeVariableWidget.d.ts +4 -4
  10. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  11. package/dist/components/CodeInput/codeVariableWidget.js +42 -38
  12. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +25 -24
  13. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
  14. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  15. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +64 -55
  16. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  17. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +110 -106
  18. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +2 -2
  19. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
  20. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  21. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +38 -37
  22. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  23. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +52 -49
  24. package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
  25. package/dist/components/ImportCollection/DropEventListener.vue.js +46 -43
  26. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +40 -39
  27. package/dist/components/ImportCollection/ImportNowButton.vue.js +44 -42
  28. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +76 -69
  29. package/dist/components/ScalarAsciiArt.vue.js +1 -1
  30. package/dist/components/ScalarAsciiArt.vue2.js +22 -19
  31. package/dist/components/Search/useSearch.d.ts.map +1 -1
  32. package/dist/components/Search/useSearch.js +57 -49
  33. package/dist/components/SideNav/SideNavRouterLink.vue.d.ts.map +1 -1
  34. package/dist/components/SideNav/SideNavRouterLink.vue.js +22 -19
  35. package/dist/components/Sidebar/Sidebar.vue.d.ts +2 -2
  36. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  37. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  38. package/dist/components/Sidebar/Sidebar.vue2.js +16 -16
  39. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  40. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  41. package/dist/components/Sidebar/SidebarListElement.vue2.js +38 -36
  42. package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -1
  43. package/dist/components/Sidebar/SidebarToggle.vue.js +3 -3
  44. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  45. package/dist/components/TopNav/TopNav.vue.js +71 -64
  46. package/dist/layouts/App/ApiClientApp.vue.js +4 -1
  47. package/dist/layouts/App/create-api-client-app.d.ts +2 -1
  48. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  49. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  50. package/dist/layouts/Modal/ApiClientModal.vue2.js +22 -19
  51. package/dist/layouts/Modal/create-api-client-modal.d.ts +4 -2
  52. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  53. package/dist/layouts/Web/ApiClientWeb.vue.js +4 -1
  54. package/dist/layouts/Web/create-api-client-web.d.ts +2 -1
  55. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  56. package/dist/libs/create-client.d.ts +12 -11
  57. package/dist/libs/create-client.d.ts.map +1 -1
  58. package/dist/libs/create-client.js +54 -47
  59. package/dist/libs/extractAttachmentFilename.d.ts +3 -0
  60. package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
  61. package/dist/libs/extractAttachmentFilename.js +7 -7
  62. package/dist/libs/importers/curl.d.ts.map +1 -1
  63. package/dist/libs/importers/curl.js +18 -18
  64. package/dist/libs/normalize-headers.d.ts.map +1 -1
  65. package/dist/libs/normalize-headers.js +2 -2
  66. package/dist/libs/parse-curl.js +39 -36
  67. package/dist/store/active-entities.d.ts +4 -4
  68. package/dist/store/active-entities.d.ts.map +1 -1
  69. package/dist/store/active-entities.js +88 -86
  70. package/dist/store/collections.d.ts.map +1 -1
  71. package/dist/store/collections.js +29 -29
  72. package/dist/store/request-example.d.ts.map +1 -1
  73. package/dist/store/request-example.js +27 -23
  74. package/dist/store/requests.d.ts.map +1 -1
  75. package/dist/store/requests.js +94 -77
  76. package/dist/store/security-schemes.d.ts.map +1 -1
  77. package/dist/store/security-schemes.js +27 -27
  78. package/dist/store/servers.d.ts.map +1 -1
  79. package/dist/store/servers.js +18 -18
  80. package/dist/store/store.d.ts +5 -5
  81. package/dist/store/store.d.ts.map +1 -1
  82. package/dist/store/store.js +53 -48
  83. package/dist/store/tags.d.ts.map +1 -1
  84. package/dist/store/tags.js +35 -33
  85. package/dist/style.css +1 -1
  86. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  87. package/dist/views/Cookies/CookieForm.vue.js +14 -9
  88. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  89. package/dist/views/Cookies/Cookies.vue2.js +39 -37
  90. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  91. package/dist/views/Environment/Environment.vue2.js +94 -89
  92. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  93. package/dist/views/Request/Request.vue.js +1 -1
  94. package/dist/views/Request/Request.vue2.js +118 -119
  95. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  96. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +28 -25
  97. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  98. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  99. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +38 -37
  100. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  101. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
  102. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +76 -73
  103. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
  104. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +80 -80
  105. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  106. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  107. package/dist/views/Request/RequestSection/RequestBody.vue2.js +192 -178
  108. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  109. package/dist/views/Request/RequestSection/RequestParams.vue.js +80 -73
  110. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  111. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +50 -48
  112. package/dist/views/Request/RequestSidebar.vue.d.ts +3 -4
  113. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  114. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  115. package/dist/views/Request/RequestSidebar.vue2.js +166 -164
  116. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  117. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  118. package/dist/views/Request/RequestSidebarItem.vue2.js +168 -150
  119. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  120. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  121. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +80 -80
  122. package/dist/views/Request/RequestSubpageHeader.vue.d.ts +0 -1
  123. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  124. package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
  125. package/dist/views/Request/RequestSubpageHeader.vue2.js +44 -49
  126. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  127. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  128. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
  129. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  130. package/dist/views/Request/components/WorkspaceDropdown.vue.js +166 -156
  131. package/dist/views/Request/handle-drag.d.ts.map +1 -1
  132. package/dist/views/Request/handle-drag.js +37 -31
  133. package/dist/views/Request/hooks/useOpenApiWatcher.js +27 -27
  134. package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
  135. package/dist/views/Request/libs/live-sync.js +147 -130
  136. package/dist/views/Request/types/sidebar-item.d.ts +4 -1
  137. package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
  138. package/dist/views/Servers/ServerForm.vue.js +38 -35
  139. package/dist/views/Servers/Servers.vue2.js +38 -35
  140. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  141. package/dist/views/Settings/Settings.vue2.js +15 -15
  142. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
  143. package/dist/views/Settings/SettingsGeneral.vue.js +206 -174
  144. package/package.json +6 -6
@@ -1,21 +1,21 @@
1
1
  var h = Object.defineProperty;
2
- var u = (i, t, e) => t in i ? h(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var r = (i, t, e) => u(i, typeof t != "symbol" ? t + "" : t, e);
2
+ var u = (n, t, e) => t in n ? h(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var l = (n, t, e) => u(n, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { getEnvColor as f } from "../../libs/env-helpers.js";
5
5
  import { ScalarButton as b, ScalarIcon as v, ScalarTooltip as g } from "@scalar/components";
6
6
  import { REGEX as w } from "@scalar/oas-utils/helpers";
7
7
  import { ViewPlugin as y, RangeSetBuilder as x, Decoration as E, EditorView as N, WidgetType as k } from "@scalar/use-codemirror";
8
- import { defineComponent as C, h as s, createApp as R } from "vue";
9
- import { parseEnvVariables as S } from "../../libs/environment-parser.js";
8
+ import { defineComponent as C, h as s, createApp as V } from "vue";
9
+ import { parseEnvVariables as R } from "../../libs/environment-parser.js";
10
10
  class d extends k {
11
- constructor(e, o, n, l, a) {
11
+ constructor(e, o, i, c, a) {
12
12
  super();
13
- r(this, "app");
14
- r(this, "environment");
15
- r(this, "envVariables");
16
- r(this, "workspace");
17
- r(this, "isReadOnly");
18
- this.variableName = e, this.variableName = e, this.environment = o, this.envVariables = n, this.workspace = l, this.isReadOnly = a;
13
+ l(this, "app");
14
+ l(this, "environment");
15
+ l(this, "envVariables");
16
+ l(this, "workspace");
17
+ l(this, "isReadOnly");
18
+ this.variableName = e, this.variableName = e, this.environment = o, this.envVariables = i, this.workspace = c, this.isReadOnly = a;
19
19
  }
20
20
  toDOM() {
21
21
  const e = document.createElement("span");
@@ -23,11 +23,11 @@ class d extends k {
23
23
  const o = C({
24
24
  props: { variableName: { type: String, default: null } },
25
25
  render: () => {
26
- const n = S(this.envVariables).find(
27
- (c) => c.key === this.variableName
28
- ), l = n && this.environment ? f(this.environment) : "#8E8E8E";
29
- e.style.setProperty("--tw-bg-base", l || "#8E8E8E"), e.style.opacity = n != null && n.value ? "1" : "0.5";
30
- const a = n != null && n.value ? s("div", { class: "p-2" }, n.value) : s("div", { class: "divide-y divide-1/2 grid" }, [
26
+ const i = this.envVariables ? R(this.envVariables).find(
27
+ (r) => r.key === this.variableName
28
+ ) : void 0, c = i && this.environment ? f(this.environment) : "#8E8E8E";
29
+ e.style.setProperty("--tw-bg-base", c || "#8E8E8E"), e.style.opacity = i != null && i.value ? "1" : "0.5";
30
+ const a = i != null && i.value ? s("div", { class: "p-2" }, i.value) : s("div", { class: "divide-y divide-1/2 grid" }, [
31
31
  s("span", { class: "p-2 opacity-25" }, "No value"),
32
32
  !this.isReadOnly && s("div", { class: "p-1" }, [
33
33
  s(
@@ -35,7 +35,11 @@ class d extends k {
35
35
  {
36
36
  class: "gap-1.5 justify-start font-normal px-1 py-1.5 h-auto transition-colors rounded no-underline text-xxs w-full hover:bg-b-2",
37
37
  variant: "ghost",
38
- onClick: () => window.location.href = `/workspace/${this.workspace.uid}/environment`
38
+ // TODO: Use router instead
39
+ onClick: () => {
40
+ var r;
41
+ return window.location.href = `/workspace/${(r = this.workspace) == null ? void 0 : r.uid}/environment`;
42
+ }
39
43
  },
40
44
  {
41
45
  default: () => [
@@ -66,7 +70,7 @@ class d extends k {
66
70
  {
67
71
  class: [
68
72
  "border w-content rounded bg-b-1 brightness-lifted text-xxs leading-5 text-c-1",
69
- n != null && n.value ? "border-solid" : "border-dashed"
73
+ i != null && i.value ? "border-solid" : "border-dashed"
70
74
  ]
71
75
  },
72
76
  a
@@ -75,7 +79,7 @@ class d extends k {
75
79
  );
76
80
  }
77
81
  });
78
- return this.app = R(o, { variableName: this.variableName }), this.app.mount(e), e;
82
+ return this.app = V(o, { variableName: this.variableName }), this.app.mount(e), e;
79
83
  }
80
84
  destroy() {
81
85
  this.app && this.app.unmount();
@@ -87,10 +91,10 @@ class d extends k {
87
91
  return !1;
88
92
  }
89
93
  }
90
- const q = (i) => y.fromClass(
94
+ const q = (n) => y.fromClass(
91
95
  class {
92
96
  constructor(t) {
93
- r(this, "decorations");
97
+ l(this, "decorations");
94
98
  this.decorations = this.buildDecorations(t);
95
99
  }
96
100
  update(t) {
@@ -100,21 +104,21 @@ const q = (i) => y.fromClass(
100
104
  }
101
105
  buildDecorations(t) {
102
106
  const e = new x();
103
- for (const { from: o, to: n } of t.visibleRanges) {
104
- const l = t.state.doc.sliceString(o, n);
107
+ for (const { from: o, to: i } of t.visibleRanges) {
108
+ const c = t.state.doc.sliceString(o, i);
105
109
  let a;
106
- for (; (a = w.VARIABLES.exec(l)) !== null; ) {
107
- const c = o + a.index, p = c + a[0].length, m = a[1];
110
+ for (; (a = w.VARIABLES.exec(c)) !== null; ) {
111
+ const r = o + a.index, p = r + a[0].length, m = a[1] ?? "";
108
112
  e.add(
109
- c,
113
+ r,
110
114
  p,
111
115
  E.widget({
112
116
  widget: new d(
113
117
  m,
114
- i.environment,
115
- i.envVariables,
116
- i.workspace,
117
- i.isReadOnly
118
+ n.environment,
119
+ n.envVariables,
120
+ n.workspace,
121
+ n.isReadOnly
118
122
  ),
119
123
  side: 1
120
124
  })
@@ -128,19 +132,19 @@ const q = (i) => y.fromClass(
128
132
  decorations: (t) => t.decorations
129
133
  }
130
134
  ), I = N.domEventHandlers({
131
- keydown(i, t) {
132
- if (i.key === "Backspace") {
133
- const { state: e } = t, { from: o, to: n } = e.selection.main;
134
- if (o === 0 && n === e.doc.length)
135
+ keydown(n, t) {
136
+ if (n.key === "Backspace") {
137
+ const { state: e } = t, { from: o, to: i } = e.selection.main;
138
+ if (o === 0 && i === e.doc.length)
135
139
  return t.dispatch({
136
140
  changes: { from: 0, to: e.doc.length },
137
141
  selection: { anchor: 0 }
138
- }), i.preventDefault(), !0;
139
- if (o === n && o > 0 && e.doc.sliceString(o - 2, o) === "}}")
142
+ }), n.preventDefault(), !0;
143
+ if (o === i && o > 0 && e.doc.sliceString(o - 2, o) === "}}")
140
144
  return t.dispatch({
141
- changes: { from: o - 2, to: n },
145
+ changes: { from: o - 2, to: i },
142
146
  selection: { anchor: o - 2 }
143
- }), i.preventDefault(), !0;
147
+ }), n.preventDefault(), !0;
144
148
  }
145
149
  return !1;
146
150
  }
@@ -1,22 +1,23 @@
1
- import { defineComponent as f, ref as i, openBlock as v, createBlock as b, withCtx as l, createVNode as n, unref as s, createTextVNode as _ } from "vue";
2
- import C from "../IconSelector.vue.js";
3
- import { useActiveEntities as V } from "../../store/active-entities.js";
4
- import { ScalarButton as k } from "@scalar/components";
5
- import { LibraryIcon as x } from "@scalar/icons";
6
- import { useToasts as N } from "@scalar/use-toasts";
7
- import B from "./CommandActionForm.vue.js";
8
- import S from "./CommandActionInput.vue.js";
9
- import { useWorkspace as $ } from "../../store/store.js";
10
- const D = /* @__PURE__ */ f({
1
+ import { defineComponent as v, ref as s, openBlock as b, createBlock as _, withCtx as l, createVNode as n, unref as m, createTextVNode as C } from "vue";
2
+ import V from "../IconSelector.vue.js";
3
+ import { useActiveEntities as k } from "../../store/active-entities.js";
4
+ import { ScalarButton as x } from "@scalar/components";
5
+ import { LibraryIcon as N } from "@scalar/icons";
6
+ import { useToasts as B } from "@scalar/use-toasts";
7
+ import S from "./CommandActionForm.vue.js";
8
+ import $ from "./CommandActionInput.vue.js";
9
+ import { useWorkspace as I } from "../../store/store.js";
10
+ const D = /* @__PURE__ */ v({
11
11
  __name: "CommandPaletteCollection",
12
12
  emits: ["close", "back"],
13
- setup(I, { emit: m }) {
14
- const r = m, { activeWorkspace: c } = V(), { collectionMutators: u } = $(), o = i(""), a = i("interface-content-folder"), { toast: d } = N(), p = () => {
13
+ setup(P, { emit: c }) {
14
+ const i = c, { activeWorkspace: u } = k(), { collectionMutators: d } = I(), o = s(""), a = s("interface-content-folder"), { toast: p } = B(), f = () => {
15
+ var r;
15
16
  if (!o.value) {
16
- d("Please enter a name before creating a collection.", "error");
17
+ p("Please enter a name before creating a collection.", "error");
17
18
  return;
18
19
  }
19
- u.add(
20
+ d.add(
20
21
  {
21
22
  openapi: "3.1.0",
22
23
  info: {
@@ -25,26 +26,26 @@ const D = /* @__PURE__ */ f({
25
26
  },
26
27
  "x-scalar-icon": a.value
27
28
  },
28
- c.value.uid
29
- ), r("close");
29
+ ((r = u.value) == null ? void 0 : r.uid) ?? ""
30
+ ), i("close");
30
31
  };
31
- return (P, e) => (v(), b(B, {
32
+ return (r, e) => (b(), _(S, {
32
33
  disabled: !o.value.trim(),
33
- onSubmit: p
34
+ onSubmit: f
34
35
  }, {
35
36
  options: l(() => [
36
- n(C, {
37
+ n(V, {
37
38
  modelValue: a.value,
38
39
  "onUpdate:modelValue": e[2] || (e[2] = (t) => a.value = t),
39
40
  placement: "bottom-start"
40
41
  }, {
41
42
  default: l(() => [
42
- n(s(k), {
43
+ n(m(x), {
43
44
  class: "aspect-square px-0 h-auto",
44
45
  variant: "outlined"
45
46
  }, {
46
47
  default: l(() => [
47
- n(s(x), {
48
+ n(m(N), {
48
49
  class: "size-4 text-c-2 stroke-[1.75]",
49
50
  src: a.value
50
51
  }, null, 8, ["src"])
@@ -56,15 +57,15 @@ const D = /* @__PURE__ */ f({
56
57
  }, 8, ["modelValue"])
57
58
  ]),
58
59
  submit: l(() => e[3] || (e[3] = [
59
- _("Create Collection")
60
+ C("Create Collection")
60
61
  ])),
61
62
  default: l(() => [
62
- n(S, {
63
+ n($, {
63
64
  modelValue: o.value,
64
65
  "onUpdate:modelValue": e[0] || (e[0] = (t) => o.value = t),
65
66
  label: "Collection Name",
66
67
  placeholder: "Collection Name",
67
- onOnDelete: e[1] || (e[1] = (t) => r("back", t))
68
+ onOnDelete: e[1] || (e[1] = (t) => i("back", t))
68
69
  }, null, 8, ["modelValue"])
69
70
  ]),
70
71
  _: 1
@@ -10,6 +10,6 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
10
10
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
11
  onClose?: (() => any) | undefined;
12
12
  onBack?: ((e: KeyboardEvent) => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLFormElement>;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
14
  export default _default;
15
15
  //# sourceMappingURL=CommandPaletteExample.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":"AA8HA,KAAK,WAAW,GAAG;IACjB,oCAAoC;IACpC,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAC/B,CAAC;;;;;;;;AAuQF,wBAQG"}
1
+ {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":"AA4IA,KAAK,WAAW,GAAG;IACjB,oCAAoC;IACpC,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAC/B,CAAC;;;;;;;;AAqRF,wBAOG"}
@@ -1,75 +1,84 @@
1
- import { defineComponent as y, ref as f, openBlock as u, createBlock as v, withCtx as o, createVNode as s, unref as a, createElementVNode as x, createElementBlock as N, Fragment as V, renderList as B, createTextVNode as i, toDisplayString as b } from "vue";
2
- import k from "../HttpMethod/HttpMethod.vue.js";
3
- import { useActiveEntities as R } from "../../store/active-entities.js";
4
- import { ScalarDropdown as W, ScalarDropdownItem as j, ScalarButton as z, ScalarIcon as I } from "@scalar/components";
5
- import { useToasts as M } from "@scalar/use-toasts";
6
- import { useRouter as P } from "vue-router";
7
- import T from "./CommandActionForm.vue.js";
8
- import U from "./CommandActionInput.vue.js";
9
- import { useWorkspace as A } from "../../store/store.js";
10
- const F = { class: "flex items-center gap-2" }, H = { class: "max-h-40 custom-scroll" }, te = /* @__PURE__ */ y({
1
+ import { defineComponent as $, ref as v, computed as R, openBlock as i, createBlock as x, withCtx as l, createVNode as r, unref as n, createElementVNode as b, createElementBlock as B, Fragment as q, renderList as P, createTextVNode as u, toDisplayString as k, createCommentVNode as W } from "vue";
2
+ import h from "../HttpMethod/HttpMethod.vue.js";
3
+ import { useActiveEntities as j } from "../../store/active-entities.js";
4
+ import { ScalarDropdown as z, ScalarDropdownItem as I, ScalarButton as M, ScalarIcon as T } from "@scalar/components";
5
+ import { isDefined as U } from "@scalar/oas-utils/helpers";
6
+ import { useToasts as A } from "@scalar/use-toasts";
7
+ import { useRouter as F } from "vue-router";
8
+ import H from "./CommandActionForm.vue.js";
9
+ import L from "./CommandActionInput.vue.js";
10
+ import { useWorkspace as O } from "../../store/store.js";
11
+ const G = { class: "flex items-center gap-2" }, J = { class: "max-h-40 custom-scroll" }, me = /* @__PURE__ */ $({
11
12
  __name: "CommandPaletteExample",
12
13
  props: {
13
14
  metaData: {}
14
15
  },
15
16
  emits: ["close", "back"],
16
- setup(h, { emit: _ }) {
17
- var d;
18
- const w = h, c = _, { push: C } = P(), { activeRequest: E, activeWorkspace: S, activeWorkspaceRequests: D } = R(), { requests: n, requestExampleMutators: $ } = A(), { toast: g } = M(), r = f(""), l = f(
17
+ setup(_, { emit: w }) {
18
+ var f;
19
+ const C = _, c = w, { push: D } = F(), { activeRequest: E, activeWorkspace: S, activeWorkspaceRequests: g } = j(), { requests: s, requestExampleMutators: y } = O(), { toast: p } = A(), m = v(""), a = v(
19
20
  // Ensure we pre-select the correct request
20
- n[((d = w.metaData) == null ? void 0 : d.itemUid) ?? ""] ?? E.value
21
- ), p = (m) => l.value = m, q = () => {
22
- if (!r.value) {
23
- g("Please enter a name before creating an example.", "error");
21
+ s[((f = C.metaData) == null ? void 0 : f.itemUid) ?? ""] ?? E.value
22
+ ), d = (o) => a.value = o, N = () => {
23
+ var e;
24
+ if (!m.value) {
25
+ p("Please enter a name before creating an example.", "error");
24
26
  return;
25
27
  }
26
- const m = $.add(
27
- l.value,
28
- r.value
28
+ if (!a.value) {
29
+ p("Please select a request before creating an example.", "error");
30
+ return;
31
+ }
32
+ const o = y.add(
33
+ a.value,
34
+ m.value
29
35
  );
30
- m && (C(
31
- `/workspace/${S.value.uid}/request/${l.value.uid}/examples/${m.uid}`
36
+ o && (D(
37
+ `/workspace/${(e = S.value) == null ? void 0 : e.uid}/request/${a.value.uid}/examples/${o.uid}`
32
38
  ), c("close"));
33
- };
34
- return (m, t) => (u(), v(T, {
35
- disabled: !r.value.trim(),
36
- onSubmit: q
39
+ }, V = R(
40
+ () => g.value.map((o) => s == null ? void 0 : s[o]).filter(U)
41
+ );
42
+ return (o, e) => a.value ? (i(), x(H, {
43
+ key: 0,
44
+ disabled: !m.value.trim(),
45
+ onSubmit: N
37
46
  }, {
38
- options: o(() => [
39
- s(a(W), {
47
+ options: l(() => [
48
+ r(n(z), {
40
49
  placement: "bottom",
41
50
  resize: ""
42
51
  }, {
43
- items: o(() => [
44
- x("div", H, [
45
- (u(!0), N(V, null, B(a(D), (e) => (u(), v(a(j), {
46
- key: e,
52
+ items: l(() => [
53
+ b("div", J, [
54
+ (i(!0), B(q, null, P(V.value, (t) => (i(), x(n(I), {
55
+ key: t.uid,
47
56
  class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
48
- onClick: (L) => p(a(n)[e])
57
+ onClick: (K) => d(t)
49
58
  }, {
50
- default: o(() => [
51
- i(b(a(n)[e].summary) + " ", 1),
52
- s(k, {
53
- method: a(n)[e].method
59
+ default: l(() => [
60
+ u(k(t.summary) + " ", 1),
61
+ r(h, {
62
+ method: t.method
54
63
  }, null, 8, ["method"])
55
64
  ]),
56
65
  _: 2
57
66
  }, 1032, ["onClick"]))), 128))
58
67
  ])
59
68
  ]),
60
- default: o(() => [
61
- s(a(z), {
69
+ default: l(() => [
70
+ r(n(M), {
62
71
  class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
63
72
  variant: "outlined",
64
- onClick: t[2] || (t[2] = (e) => p(l.value))
73
+ onClick: e[2] || (e[2] = (t) => d(a.value))
65
74
  }, {
66
- default: o(() => [
67
- i(b(l.value.summary) + " ", 1),
68
- x("div", F, [
69
- s(k, {
70
- method: l.value.method
75
+ default: l(() => [
76
+ u(k(a.value.summary) + " ", 1),
77
+ b("div", G, [
78
+ r(h, {
79
+ method: a.value.method
71
80
  }, null, 8, ["method"]),
72
- s(a(I), {
81
+ r(n(T), {
73
82
  class: "text-c-3",
74
83
  icon: "ChevronDown",
75
84
  size: "md"
@@ -82,22 +91,22 @@ const F = { class: "flex items-center gap-2" }, H = { class: "max-h-40 custom-sc
82
91
  _: 1
83
92
  })
84
93
  ]),
85
- submit: o(() => t[3] || (t[3] = [
86
- i("Create Example")
94
+ submit: l(() => e[3] || (e[3] = [
95
+ u("Create Example")
87
96
  ])),
88
- default: o(() => [
89
- s(U, {
90
- modelValue: r.value,
91
- "onUpdate:modelValue": t[0] || (t[0] = (e) => r.value = e),
97
+ default: l(() => [
98
+ r(L, {
99
+ modelValue: m.value,
100
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => m.value = t),
92
101
  label: "Example Name",
93
102
  placeholder: "Example Name",
94
- onOnDelete: t[1] || (t[1] = (e) => c("back", e))
103
+ onOnDelete: e[1] || (e[1] = (t) => c("back", t))
95
104
  }, null, 8, ["modelValue"])
96
105
  ]),
97
106
  _: 1
98
- }, 8, ["disabled"]));
107
+ }, 8, ["disabled"])) : W("", !0);
99
108
  }
100
109
  });
101
110
  export {
102
- te as default
111
+ me as default
103
112
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AA2pBA,wBAOG"}
1
+ {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AAiqBA,wBAOG"}