@scalar/api-client 2.2.4 → 2.2.7

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 (93) hide show
  1. package/CHANGELOG.md +62 -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.d.ts.map +1 -1
  5. package/dist/components/AddressBar/AddressBarServer.vue.js +28 -28
  6. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +1 -1
  7. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  8. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +41 -41
  9. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +2 -2
  10. package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -5
  11. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  12. package/dist/components/DataTable/DataTableCheckbox.vue.js +5 -6
  13. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  14. package/dist/components/DataTable/DataTableInputSelect.vue.js +8 -8
  15. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  16. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +9 -10
  17. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  18. package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
  19. package/dist/components/HttpMethod/HttpMethod.vue2.js +24 -25
  20. package/dist/components/HttpMethod/index.d.ts +0 -1
  21. package/dist/components/HttpMethod/index.d.ts.map +1 -1
  22. package/dist/components/HttpMethod/index.js +2 -4
  23. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  24. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +121 -103
  25. package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
  26. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +24 -26
  27. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +6 -0
  28. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
  29. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +28 -23
  30. package/dist/components/OpenApiClientButton.vue.d.ts +1 -0
  31. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
  32. package/dist/components/OpenApiClientButton.vue.js +2 -2
  33. package/dist/components/OpenApiClientButton.vue2.js +21 -15
  34. package/dist/components/Search/useSearch.d.ts.map +1 -1
  35. package/dist/components/Search/useSearch.js +45 -41
  36. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  37. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +5 -6
  38. package/dist/layouts/App/create-api-client-app.d.ts +1 -0
  39. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  40. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  41. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  42. package/dist/layouts/Modal/ApiClientModal.vue2.js +28 -23
  43. package/dist/layouts/Modal/create-api-client-modal.d.ts +2 -0
  44. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  45. package/dist/layouts/Web/create-api-client-web.d.ts +1 -0
  46. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  47. package/dist/libs/create-client.d.ts +3 -1
  48. package/dist/libs/create-client.d.ts.map +1 -1
  49. package/dist/libs/create-client.js +50 -48
  50. package/dist/store/store.d.ts +3 -1
  51. package/dist/store/store.d.ts.map +1 -1
  52. package/dist/store/store.js +47 -45
  53. package/dist/style.css +1 -1
  54. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  55. package/dist/views/Cookies/Cookies.vue2.js +18 -20
  56. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  57. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +63 -60
  58. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  59. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +20 -19
  60. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  61. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  62. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +84 -86
  63. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  64. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  65. package/dist/views/Request/RequestSection/RequestBody.vue2.js +37 -36
  66. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  67. package/dist/views/Request/RequestSidebar.vue.js +3 -3
  68. package/dist/views/Request/RequestSidebar.vue2.js +60 -61
  69. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  70. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  71. package/dist/views/Request/RequestSidebarItem.vue2.js +187 -195
  72. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  73. package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
  74. package/dist/views/Request/RequestSubpageHeader.vue2.js +34 -36
  75. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts.map +1 -1
  76. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
  77. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +5 -5
  78. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  79. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
  80. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +30 -25
  81. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  82. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +41 -30
  83. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  84. package/dist/views/Request/components/WorkspaceDropdown.vue.js +3 -5
  85. package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
  86. package/dist/views/Request/libs/live-sync.js +77 -78
  87. package/dist/views/Request/libs/oauth2.d.ts +6 -2
  88. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  89. package/dist/views/Request/libs/oauth2.js +43 -37
  90. package/package.json +10 -11
  91. package/dist/components/HttpMethod/helpers.d.ts +0 -4
  92. package/dist/components/HttpMethod/helpers.d.ts.map +0 -1
  93. package/dist/components/HttpMethod/helpers.js +0 -5
@@ -1,78 +1,77 @@
1
- import { defineComponent as z, ref as b, computed as f, openBlock as m, createBlock as W, withCtx as r, createElementVNode as a, createTextVNode as _, toDisplayString as g, createElementBlock as p, createVNode as c, unref as i, createCommentVNode as L, Fragment as H, renderList as P, withModifiers as O, withKeys as G } from "vue";
2
- import J from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
- import { useActiveEntities as Q } from "../../../../store/active-entities.js";
4
- import { useModal as X, ScalarIcon as B, ScalarComboboxMultiselect as Y, ScalarButton as Z, ScalarIconButton as ee } from "@scalar/components";
5
- import { nanoid as te } from "nanoid";
6
- import le from "./DeleteRequestAuthModal.vue.js";
7
- import oe from "./RequestExampleAuth.vue.js";
1
+ import { defineComponent as F, ref as b, computed as f, openBlock as u, createBlock as z, withCtx as r, createElementVNode as m, createTextVNode as _, toDisplayString as g, createElementBlock as p, createVNode as c, unref as i, createCommentVNode as W, Fragment as L, renderList as H, withModifiers as D, withKeys as P } from "vue";
2
+ import G from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
+ import { useActiveEntities as J } from "../../../../store/active-entities.js";
4
+ import { useModal as Q, ScalarIcon as O, ScalarComboboxMultiselect as X, ScalarButton as Y, ScalarIconButton as Z } from "@scalar/components";
5
+ import ee from "./DeleteRequestAuthModal.vue.js";
6
+ import te from "./RequestExampleAuth.vue.js";
8
7
  import { displaySchemeFormatter as k } from "../../libs/auth.js";
9
- import { ADD_AUTH_OPTIONS as se } from "../../consts/new-auth-options.js";
10
- import ie from "../../../../components/DataTable/DataTable.vue.js";
11
- import ne from "../../../../components/DataTable/DataTableRow.vue.js";
12
- import ce from "../../../../components/DataTable/DataTableHeader.vue.js";
13
- import { useWorkspace as re } from "../../../../store/store.js";
14
- const ae = { class: "flex flex-1 gap-1 items-center justify-between" }, ue = {
8
+ import { ADD_AUTH_OPTIONS as le } from "../../consts/new-auth-options.js";
9
+ import se from "../../../../components/DataTable/DataTable.vue.js";
10
+ import oe from "../../../../components/DataTable/DataTableRow.vue.js";
11
+ import ie from "../../../../components/DataTable/DataTableHeader.vue.js";
12
+ import { useWorkspace as ne } from "../../../../store/store.js";
13
+ const ce = { class: "flex flex-1 gap-1 items-center justify-between" }, re = {
15
14
  key: 0,
16
15
  class: "flex items-center gap-1 text-c-3"
17
- }, me = {
16
+ }, ae = {
18
17
  key: 0,
19
18
  class: "flex relative scroll-timeline-x w-full"
20
- }, de = { class: "flex flex-1 gap-0.25 mr-1.5 items-center" }, fe = {
19
+ }, ue = { class: "flex flex-1 gap-0.25 mr-1.5 items-center" }, me = {
21
20
  key: 1,
22
21
  class: "pl-2"
23
- }, we = /* @__PURE__ */ z({
22
+ }, Re = /* @__PURE__ */ F({
24
23
  __name: "RequestAuth",
25
24
  props: {
26
25
  selectedSecuritySchemeUids: {},
27
26
  title: {}
28
27
  },
29
28
  setup(R) {
30
- const { activeCollection: u, activeRequest: h } = Q(), {
31
- collectionMutators: M,
29
+ const { activeCollection: a, activeRequest: h } = J(), {
30
+ collectionMutators: B,
32
31
  isReadOnly: x,
33
- requestMutators: V,
32
+ requestMutators: M,
34
33
  securitySchemes: q,
35
- securitySchemeMutators: I
36
- } = re(), K = b(null), $ = b(null), y = X(), w = b(void 0), C = `combobox-${te()}`, U = f(() => {
37
- var l, s;
38
- const e = ((l = h.value) == null ? void 0 : l.security) ?? ((s = u.value) == null ? void 0 : s.security) ?? [];
34
+ securitySchemeMutators: V
35
+ } = ne(), K = b(null), w = b(null), y = Q(), C = b(void 0), U = f(() => {
36
+ var l, o;
37
+ const e = ((l = h.value) == null ? void 0 : l.security) ?? ((o = a.value) == null ? void 0 : o.security) ?? [];
39
38
  return { filteredRequirements: e.filter((n) => Object.keys(n).length), requirements: e };
40
39
  }), T = f(() => {
41
40
  var t;
42
- return (((t = u.value) == null ? void 0 : t.securitySchemes) ?? []).map((l) => q[l]).filter((l) => l);
41
+ return (((t = a.value) == null ? void 0 : t.securitySchemes) ?? []).map((l) => q[l]).filter((l) => l);
43
42
  }), j = f(
44
43
  () => {
45
44
  const e = [...T.value], t = [];
46
- U.value.filteredRequirements.forEach((o) => {
45
+ U.value.filteredRequirements.forEach((s) => {
47
46
  const d = e.findIndex(
48
- (F) => F.nameKey === Object.keys(o)[0]
47
+ (E) => E.nameKey === Object.keys(s)[0]
49
48
  );
50
49
  d > -1 && (t.push(e[d]), e.splice(d, 1));
51
50
  });
52
51
  const l = e.map(
53
- (o) => k(o)
54
- ), s = t.map(
55
- (o) => k(o)
52
+ (s) => k(s)
53
+ ), o = t.map(
54
+ (s) => k(s)
56
55
  ), n = [
57
- { label: "Required authentication", options: s },
56
+ { label: "Required authentication", options: o },
58
57
  { label: "Available authentication", options: l }
59
58
  ];
60
- return x ? s.length ? n : l : (n.push({
59
+ return x ? o.length ? n : l : (n.push({
61
60
  label: "Add new authentication",
62
- options: se
61
+ options: le
63
62
  }), n);
64
63
  }
65
64
  ), S = f(() => {
66
65
  const { filteredRequirements: e, requirements: t } = U.value;
67
66
  if (!t.length) return null;
68
- const l = e.length < t.length, s = l ? "Unlock" : "Lock", n = l ? "Optional" : "Required", d = `${e.length === 1 ? Object.keys(e[0])[0] : "Authentication"} ${n}`;
69
- return { icon: s, text: d };
70
- }), A = (e) => {
71
- !u.value || !h.value || (x ? M.edit(
72
- u.value.uid,
67
+ const l = e.length < t.length, o = l ? "Unlock" : "Lock", n = l ? "Optional" : "Required", d = `${e.length === 1 ? Object.keys(e[0])[0] : "Authentication"} ${n}`;
68
+ return { icon: o, text: d };
69
+ }), $ = (e) => {
70
+ !a.value || !h.value || (x ? B.edit(
71
+ a.value.uid,
73
72
  "selectedSecuritySchemeUids",
74
73
  e
75
- ) : V.edit(
74
+ ) : M.edit(
76
75
  h.value.uid,
77
76
  "selectedSecuritySchemeUids",
78
77
  e
@@ -82,57 +81,57 @@ const ae = { class: "flex flex-1 gap-1 items-center justify-between" }, ue = {
82
81
  (e) => k(q[e])
83
82
  )
84
83
  );
85
- function N(e) {
86
- var s, n;
87
- if (!((s = u.value) != null && s.uid) || !((n = h.value) != null && n.uid)) return;
88
- const t = e.find((o) => o.payload), l = e.filter((o) => !o.payload).map(({ id: o }) => o);
84
+ function I(e) {
85
+ var o, n;
86
+ if (!((o = a.value) != null && o.uid) || !((n = h.value) != null && n.uid)) return;
87
+ const t = e.find((s) => s.payload), l = e.filter((s) => !s.payload).map(({ id: s }) => s);
89
88
  if (t != null && t.payload) {
90
- const o = I.add(
89
+ const s = V.add(
91
90
  t.payload,
92
- u.value.uid
91
+ a.value.uid
93
92
  );
94
- o && l.push(o.uid);
93
+ s && l.push(s.uid);
95
94
  }
96
- A(l);
95
+ $(l);
97
96
  }
98
- const D = (e) => {
97
+ const A = (e) => {
99
98
  var t;
100
- A(
99
+ $(
101
100
  R.selectedSecuritySchemeUids.filter((l) => l !== e)
102
- ), (t = $.value) == null || t.$el.focus();
101
+ ), (t = w.value) == null || t.$el.focus();
103
102
  };
104
- function E(e) {
105
- w.value = e, y.show();
103
+ function N(e) {
104
+ C.value = e, y.show();
106
105
  }
107
- return (e, t) => (m(), W(J, {
106
+ return (e, t) => (u(), z(G, {
108
107
  class: "group/params",
109
108
  itemCount: v.value.length
110
109
  }, {
111
110
  title: r(() => [
112
- a("div", ae, [
111
+ m("div", ce, [
113
112
  _(g(e.title) + " ", 1),
114
- S.value ? (m(), p("div", ue, [
113
+ S.value ? (u(), p("div", re, [
115
114
  _(g(S.value.text) + " ", 1),
116
- c(i(B), {
115
+ c(i(O), {
117
116
  class: "text-c-3",
118
117
  icon: S.value.icon,
119
118
  size: "xs"
120
119
  }, null, 8, ["icon"])
121
- ])) : L("", !0)
120
+ ])) : W("", !0)
122
121
  ])
123
122
  ]),
124
123
  default: r(() => [
125
- a("form", null, [
126
- c(i(ie), {
124
+ m("form", null, [
125
+ c(i(se), {
127
126
  class: "flex-1",
128
127
  columns: [""]
129
128
  }, {
130
129
  default: r(() => [
131
- c(i(ne), null, {
130
+ c(i(oe), null, {
132
131
  default: r(() => [
133
- c(i(ce), { class: "relative col-span-full cursor-pointer py-[0px] px-[0px] flex items-center" }, {
132
+ c(i(ie), { class: "relative col-span-full cursor-pointer py-[0px] px-[0px] flex items-center" }, {
134
133
  default: r(() => [
135
- c(i(Y), {
134
+ c(i(X), {
136
135
  ref_key: "comboboxRef",
137
136
  ref: K,
138
137
  class: "text-xs w-full",
@@ -142,67 +141,66 @@ const ae = { class: "flex flex-1 gap-1 items-center justify-between" }, ue = {
142
141
  multiple: "",
143
142
  options: j.value,
144
143
  style: { "margin-left": "120px" },
145
- teleport: `#${C}`,
146
- onDelete: E,
147
- "onUpdate:modelValue": N
144
+ teleport: "",
145
+ onDelete: N,
146
+ "onUpdate:modelValue": I
148
147
  }, {
149
148
  default: r(() => [
150
- c(i(Z), {
149
+ c(i(Y), {
151
150
  ref_key: "comboboxButtonRef",
152
- ref: $,
151
+ ref: w,
153
152
  class: "h-auto py-0 px-0 text-c-2 hover:text-c-1 font-normal justify-start -outline-offset-2",
154
153
  fullWidth: "",
155
154
  variant: "ghost"
156
155
  }, {
157
156
  default: r(() => [
158
- t[3] || (t[3] = a("div", { class: "text-c-1 h-8 flex min-w-[94px] items-center pr-0 pl-2" }, " Auth Type ", -1)),
159
- v.value.length ? (m(), p("div", me, [
160
- t[1] || (t[1] = a("div", { class: "fade-left" }, null, -1)),
161
- a("div", de, [
162
- (m(!0), p(H, null, P(v.value, (l) => (m(), p("span", {
157
+ t[3] || (t[3] = m("div", { class: "text-c-1 h-8 flex min-w-[94px] items-center pr-0 pl-2" }, " Auth Type ", -1)),
158
+ v.value.length ? (u(), p("div", ae, [
159
+ t[1] || (t[1] = m("div", { class: "fade-left" }, null, -1)),
160
+ m("div", ue, [
161
+ (u(!0), p(L, null, H(v.value, (l) => (u(), p("span", {
163
162
  key: l.id,
164
163
  class: "cm-pill flex items-center mx-0 h-fit pr-0.5 !bg-b-2 text-c-1"
165
164
  }, [
166
165
  _(g(l.label) + " ", 1),
167
- c(i(ee), {
166
+ c(i(Z), {
168
167
  class: "cursor-pointer -ml-0.5 text-c-3 hover:text-c-1 rounded-full",
169
168
  icon: "Close",
170
169
  label: `Remove ${l.label}`,
171
170
  size: "xs",
172
- onClick: O((s) => D(l.id), ["stop"]),
173
- onKeydown: G(O((s) => D(l.id), ["stop"]), ["enter"])
171
+ onClick: D((o) => A(l.id), ["stop"]),
172
+ onKeydown: P(D((o) => A(l.id), ["stop"]), ["enter"])
174
173
  }, null, 8, ["label", "onClick", "onKeydown"])
175
174
  ]))), 128))
176
175
  ]),
177
- t[2] || (t[2] = a("div", { class: "fade-right" }, null, -1))
178
- ])) : (m(), p("div", fe, " None ")),
179
- c(i(B), {
180
- class: "min-w-3 ml-auto mr-2.5",
176
+ t[2] || (t[2] = m("div", { class: "fade-right" }, null, -1))
177
+ ])) : (u(), p("div", me, " None ")),
178
+ c(i(O), {
179
+ class: "mr-[9px]",
181
180
  icon: "ChevronDown",
182
- size: "xs"
181
+ size: "md"
183
182
  })
184
183
  ]),
185
184
  _: 1
186
185
  }, 512)
187
186
  ]),
188
187
  _: 1
189
- }, 8, ["isDeletable", "modelValue", "options", "teleport"])
188
+ }, 8, ["isDeletable", "modelValue", "options"])
190
189
  ]),
191
190
  _: 1
192
191
  })
193
192
  ]),
194
193
  _: 1
195
194
  }),
196
- c(oe, { selectedSecuritySchemeUids: e.selectedSecuritySchemeUids }, null, 8, ["selectedSecuritySchemeUids"])
195
+ c(te, { selectedSecuritySchemeUids: e.selectedSecuritySchemeUids }, null, 8, ["selectedSecuritySchemeUids"])
197
196
  ]),
198
197
  _: 1
199
198
  }),
200
- c(le, {
201
- scheme: w.value,
199
+ c(ee, {
200
+ scheme: C.value,
202
201
  state: i(y),
203
202
  onClose: t[0] || (t[0] = (l) => i(y).hide())
204
- }, null, 8, ["scheme", "state"]),
205
- a("div", { id: C })
203
+ }, null, 8, ["scheme", "state"])
206
204
  ])
207
205
  ]),
208
206
  _: 1
@@ -210,5 +208,5 @@ const ae = { class: "flex flex-1 gap-1 items-center justify-between" }, ue = {
210
208
  }
211
209
  });
212
210
  export {
213
- we as default
211
+ Re as default
214
212
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"AA+kBA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AA+3BF,wBAOG"}
1
+ {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"AAklBA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AAo4BF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestBody.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1876b784"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-77d0f477"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as Z, computed as b, ref as I, watch as W, openBlock as f, createBlock as h, withCtx as d, createTextVNode as z, toDisplayString as k, createVNode as s, unref as u, createElementVNode as w, createCommentVNode as ee, createElementBlock as U, Fragment as ae, nextTick as te } from "vue";
1
+ import { defineComponent as Z, computed as b, ref as I, watch as W, openBlock as p, createBlock as h, withCtx as d, createTextVNode as z, toDisplayString as F, createVNode as s, unref as u, createElementVNode as w, createCommentVNode as ee, createElementBlock as U, Fragment as ae, nextTick as te } from "vue";
2
2
  import oe from "../../../components/CodeInput/CodeInput.vue.js";
3
3
  import ne from "../../../components/DataTable/DataTable.vue.js";
4
4
  import le from "../../../components/DataTable/DataTableHeader.vue.js";
5
5
  import T from "../../../components/DataTable/DataTableRow.vue.js";
6
6
  import re from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
7
  import { useActiveEntities as ie } from "../../../store/active-entities.js";
8
- import { ScalarListbox as A, ScalarButton as F, ScalarIcon as E } from "@scalar/components";
8
+ import { ScalarListbox as A, ScalarButton as k, ScalarIcon as E } from "@scalar/components";
9
9
  import { requestExampleParametersSchema as J } from "@scalar/oas-utils/entities/spec";
10
10
  import { canMethodHaveBody as ue } from "@scalar/oas-utils/helpers";
11
11
  import $ from "./RequestTable.vue.js";
@@ -59,9 +59,9 @@ const se = {
59
59
  function V() {
60
60
  console.log("deleteRow");
61
61
  }
62
- const C = (e, a, t) => {
62
+ const P = (e, a, t) => {
63
63
  if (!c.value || !o.value) return;
64
- const l = p.value;
64
+ const l = f.value;
65
65
  if (l.length > e) {
66
66
  const n = [...l];
67
67
  n[e] = { ...n[e], [a]: t }, (n[e].key !== "" || n[e].value !== "") && (n[e].enabled = !0), n[e].key === "" && n[e].value === "" && n.splice(e, 1), i.edit(
@@ -82,16 +82,19 @@ const se = {
82
82
  });
83
83
  }
84
84
  e === l.length - 1 && j();
85
- }, p = b(
85
+ }, f = b(
86
86
  () => {
87
87
  var e, a, t;
88
88
  return ((t = (a = (e = o.value) == null ? void 0 : e.body) == null ? void 0 : a.formData) == null ? void 0 : t.value) ?? [];
89
89
  }
90
- ), P = () => p.value.length === 0 && j(), j = () => {
90
+ ), C = () => {
91
+ const e = f.value[f.value.length - 1];
92
+ (!e || e.key !== "" || e.value !== "") && j();
93
+ }, j = () => {
91
94
  if (!c.value || !o.value) return;
92
95
  const e = J.parse({
93
96
  enabled: !1
94
- }), a = [...p.value, e];
97
+ }), a = [...f.value, e];
95
98
  o.value.body.formData ? i.edit(
96
99
  o.value.uid,
97
100
  "body.formData.value",
@@ -102,7 +105,7 @@ const se = {
102
105
  });
103
106
  }, N = (e, a) => {
104
107
  if (!c.value || !o.value) return;
105
- const t = p.value;
108
+ const t = f.value;
106
109
  if (t.length > e) {
107
110
  const l = [...t];
108
111
  l[e].enabled = a, i.edit(
@@ -184,7 +187,7 @@ const se = {
184
187
  onChange: async (t) => {
185
188
  const l = t == null ? void 0 : t[0];
186
189
  if (l && c.value && o.value) {
187
- const r = [...p.value];
190
+ const r = [...f.value];
188
191
  r[e] = {
189
192
  ...r[e],
190
193
  file: l
@@ -205,7 +208,7 @@ const se = {
205
208
  }
206
209
  function M(e) {
207
210
  if (!c.value || !o.value) return;
208
- const t = [...p.value];
211
+ const t = [...f.value];
209
212
  t[e] = {
210
213
  ...t[e],
211
214
  file: void 0
@@ -233,7 +236,7 @@ const se = {
233
236
  W(
234
237
  v,
235
238
  (e) => {
236
- ["multipartForm", "formUrlEncoded"].includes(e == null ? void 0 : e.id) && P();
239
+ ["multipartForm", "formUrlEncoded"].includes(e == null ? void 0 : e.id) && C();
237
240
  },
238
241
  { immediate: !0 }
239
242
  ), W(
@@ -245,7 +248,7 @@ const se = {
245
248
  var e;
246
249
  (e = c.value) != null && e.method && ue(c.value.method) && q(R.value), ["multipartForm", "formUrlEncoded"].includes(
247
250
  R.value
248
- ) && P();
251
+ ) && C();
249
252
  },
250
253
  { immediate: !0 }
251
254
  );
@@ -275,9 +278,9 @@ const se = {
275
278
  }
276
279
  }
277
280
  });
278
- return (e, a) => (f(), h(re, null, {
281
+ return (e, a) => (p(), h(re, null, {
279
282
  title: d(() => [
280
- z(k(e.title), 1)
283
+ z(F(e.title), 1)
281
284
  ]),
282
285
  default: d(() => [
283
286
  s(ne, { columns: [""] }, {
@@ -293,7 +296,7 @@ const se = {
293
296
  teleport: ""
294
297
  }, {
295
298
  default: d(() => [
296
- s(u(F), {
299
+ s(u(k), {
297
300
  class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
298
301
  fullWidth: "",
299
302
  variant: "ghost"
@@ -301,11 +304,10 @@ const se = {
301
304
  default: d(() => {
302
305
  var t;
303
306
  return [
304
- w("span", null, k((t = v.value) == null ? void 0 : t.label), 1),
307
+ w("span", null, F((t = v.value) == null ? void 0 : t.label), 1),
305
308
  s(u(E), {
306
309
  icon: "ChevronDown",
307
- size: "xs",
308
- thickness: "2.5"
310
+ size: "md"
309
311
  })
310
312
  ];
311
313
  }),
@@ -314,7 +316,7 @@ const se = {
314
316
  ]),
315
317
  _: 1
316
318
  }, 8, ["modelValue", "options"]),
317
- g.value.length > 0 ? (f(), h(u(A), {
319
+ g.value.length > 0 ? (p(), h(u(A), {
318
320
  key: 0,
319
321
  modelValue: _.value,
320
322
  "onUpdate:modelValue": a[1] || (a[1] = (t) => _.value = t),
@@ -323,7 +325,7 @@ const se = {
323
325
  teleport: ""
324
326
  }, {
325
327
  default: d(() => [
326
- s(u(F), {
328
+ s(u(k), {
327
329
  class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
328
330
  fullWidth: "",
329
331
  variant: "ghost"
@@ -331,11 +333,10 @@ const se = {
331
333
  default: d(() => {
332
334
  var t;
333
335
  return [
334
- w("span", null, k((t = _.value) == null ? void 0 : t.label), 1),
336
+ w("span", null, F((t = _.value) == null ? void 0 : t.label), 1),
335
337
  s(u(E), {
336
338
  icon: "ChevronDown",
337
- size: "xs",
338
- thickness: "2.5"
339
+ size: "md"
339
340
  })
340
341
  ];
341
342
  }),
@@ -354,12 +355,12 @@ const se = {
354
355
  default: d(() => {
355
356
  var t, l, n, r, m;
356
357
  return [
357
- v.value.id === "none" ? (f(), U("div", se, a[2] || (a[2] = [
358
+ v.value.id === "none" ? (p(), U("div", se, a[2] || (a[2] = [
358
359
  w("span", null, "No Body", -1)
359
- ]))) : v.value.id === "binaryFile" ? (f(), U("div", ce, [
360
- (t = u(o)) != null && t.body.binary ? (f(), U(ae, { key: 0 }, [
361
- w("span", me, k(((l = u(o)) == null ? void 0 : l.body.binary).name), 1),
362
- s(u(F), {
360
+ ]))) : v.value.id === "binaryFile" ? (p(), U("div", ce, [
361
+ (t = u(o)) != null && t.body.binary ? (p(), U(ae, { key: 0 }, [
362
+ w("span", me, F(((l = u(o)) == null ? void 0 : l.body.binary).name), 1),
363
+ s(u(k), {
363
364
  class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 ml-1 shadow-none",
364
365
  size: "sm",
365
366
  variant: "outlined",
@@ -370,7 +371,7 @@ const se = {
370
371
  ])),
371
372
  _: 1
372
373
  })
373
- ], 64)) : (f(), h(u(F), {
374
+ ], 64)) : (p(), h(u(k), {
374
375
  key: 1,
375
376
  class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 shadow-none",
376
377
  size: "sm",
@@ -388,33 +389,33 @@ const se = {
388
389
  ]),
389
390
  _: 1
390
391
  }))
391
- ])) : v.value.id == "multipartForm" ? (f(), h($, {
392
+ ])) : v.value.id == "multipartForm" ? (p(), h($, {
392
393
  key: 2,
393
394
  ref_key: "tableWrapperRef",
394
395
  ref: B,
395
396
  class: "!m-0 rounded-t-none shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
396
397
  columns: ["32px", "", "", "61px"],
397
- items: p.value,
398
+ items: f.value,
398
399
  showUploadButton: "",
399
400
  onDeleteRow: V,
400
401
  onRemoveFile: M,
401
402
  onToggleRow: N,
402
- onUpdateRow: C,
403
+ onUpdateRow: P,
403
404
  onUploadFile: L
404
- }, null, 8, ["items"])) : v.value.id == "formUrlEncoded" ? (f(), h($, {
405
+ }, null, 8, ["items"])) : v.value.id == "formUrlEncoded" ? (p(), h($, {
405
406
  key: 3,
406
407
  ref_key: "tableWrapperRef",
407
408
  ref: B,
408
409
  class: "!m-0 rounded-t-none border-t-0 shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
409
410
  columns: ["32px", "", "", "61px"],
410
- items: p.value,
411
+ items: f.value,
411
412
  showUploadButton: "",
412
413
  onDeleteRow: V,
413
414
  onRemoveFile: M,
414
415
  onToggleRow: N,
415
- onUpdateRow: C,
416
+ onUpdateRow: P,
416
417
  onUploadFile: L
417
- }, null, 8, ["items"])) : (f(), h(oe, {
418
+ }, null, 8, ["items"])) : (p(), h(oe, {
418
419
  key: 4,
419
420
  content: "",
420
421
  language: Y.value,
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"AAqaA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;;;;cAKqC,MAAM;aAAO,MAAM;;;;;;cAAnB,MAAM;aAAO,MAAM;;;;AAioB1D,wBAOG"}
1
+ {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"AA+ZA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;;;;cAKqC,MAAM;aAAO,MAAM;;;;;;cAAnB,MAAM;aAAO,MAAM;;;;AA+nB1D,wBAOG"}
@@ -1,7 +1,7 @@
1
- import o from "./RequestSidebar.vue2.js";
1
+ import e from "./RequestSidebar.vue2.js";
2
2
  /* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6a96336d"]]);
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ o(e, [["__scopeId", "data-v-360eb73e"]]);
5
5
  export {
6
6
  m as default
7
7
  };