@scalar/api-client 2.2.44 → 2.2.45

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 (67) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  3. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  4. package/dist/components/CodeInput/CodeInput.vue2.js +37 -37
  5. package/dist/components/EmptyState.vue.d.ts +3 -0
  6. package/dist/components/EmptyState.vue.d.ts.map +1 -0
  7. package/dist/components/EmptyState.vue.js +7 -0
  8. package/dist/components/EmptyState.vue2.js +31 -0
  9. package/dist/components/Form/Form.vue.js +1 -1
  10. package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
  11. package/dist/components/ScalarHotkey.vue.js +12 -7
  12. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  13. package/dist/layouts/App/create-api-client-app.d.ts +2 -2
  14. package/dist/layouts/Modal/create-api-client-modal.d.ts +4 -4
  15. package/dist/layouts/Web/create-api-client-web.d.ts +2 -2
  16. package/dist/libs/create-client.d.ts +2 -2
  17. package/dist/libs/index.js +31 -33
  18. package/dist/libs/send-request/build-request-security.d.ts +17 -0
  19. package/dist/libs/send-request/build-request-security.d.ts.map +1 -0
  20. package/dist/libs/send-request/build-request-security.js +31 -0
  21. package/dist/libs/send-request/create-fetch-body.d.ts +18 -0
  22. package/dist/libs/send-request/create-fetch-body.d.ts.map +1 -0
  23. package/dist/libs/send-request/create-fetch-body.js +26 -0
  24. package/dist/libs/send-request/create-fetch-headers.d.ts +4 -0
  25. package/dist/libs/send-request/create-fetch-headers.d.ts.map +1 -0
  26. package/dist/libs/send-request/create-fetch-headers.js +11 -0
  27. package/dist/libs/send-request/create-fetch-query-params.d.ts +4 -0
  28. package/dist/libs/send-request/create-fetch-query-params.d.ts.map +1 -0
  29. package/dist/libs/send-request/create-fetch-query-params.js +10 -0
  30. package/dist/libs/send-request/create-request-operation.d.ts +29 -0
  31. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -0
  32. package/dist/libs/send-request/create-request-operation.js +107 -0
  33. package/dist/libs/send-request/decode-buffer.d.ts +3 -0
  34. package/dist/libs/send-request/decode-buffer.d.ts.map +1 -0
  35. package/dist/libs/send-request/decode-buffer.js +9 -0
  36. package/dist/libs/send-request/index.d.ts +2 -1
  37. package/dist/libs/send-request/index.d.ts.map +1 -1
  38. package/dist/libs/send-request/index.js +4 -6
  39. package/dist/store/request-example.d.ts +2 -2
  40. package/dist/store/store.d.ts +2 -2
  41. package/dist/style.css +1 -1
  42. package/dist/views/Cookies/CookieModal.vue.d.ts.map +1 -1
  43. package/dist/views/Cookies/CookieModal.vue.js +2 -2
  44. package/dist/views/Cookies/CookieModal.vue2.js +11 -11
  45. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  46. package/dist/views/Cookies/Cookies.vue2.js +37 -36
  47. package/dist/views/Request/Request.vue2.js +1 -1
  48. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  49. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  50. package/dist/views/Request/RequestSection/RequestBody.vue2.js +89 -87
  51. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  52. package/dist/views/Request/RequestSection/RequestParams.vue.js +47 -45
  53. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  54. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  55. package/dist/views/Request/RequestSection/RequestTable.vue2.js +8 -7
  56. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  57. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  58. package/dist/views/Request/RequestSidebarItem.vue2.js +97 -104
  59. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  60. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
  61. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +39 -57
  62. package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
  63. package/dist/views/Servers/Servers.vue2.js +74 -71
  64. package/package.json +10 -10
  65. package/dist/libs/send-request/send-request.d.ts +0 -51
  66. package/dist/libs/send-request/send-request.d.ts.map +0 -1
  67. package/dist/libs/send-request/send-request.js +0 -177
@@ -1,11 +1,11 @@
1
- import { defineComponent as ae, computed as w, ref as te, watch as $, openBlock as g, createBlock as x, withCtx as v, createTextVNode as H, toDisplayString as _, createVNode as f, unref as m, createElementVNode as D, createCommentVNode as oe, createElementBlock as V, Fragment as le, nextTick as ne } from "vue";
1
+ import { defineComponent as ae, computed as w, ref as te, watch as $, openBlock as g, createBlock as x, withCtx as f, createTextVNode as H, toDisplayString as _, createVNode as p, unref as m, createElementVNode as D, createCommentVNode as oe, createElementBlock as V, Fragment as ne, nextTick as le } from "vue";
2
2
  import re from "../../../components/CodeInput/CodeInput.vue.js";
3
3
  import ue from "../../../components/DataTable/DataTable.vue.js";
4
4
  import ie from "../../../components/DataTable/DataTableHeader.vue.js";
5
5
  import C from "../../../components/DataTable/DataTableRow.vue.js";
6
6
  import de from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
7
  import { useActiveEntities as se } from "../../../store/active-entities.js";
8
- import { ScalarListbox as X, ScalarButton as U, ScalarIcon as P } from "@scalar/components";
8
+ import { ScalarListbox as X, ScalarButton as T, ScalarIcon as P } from "@scalar/components";
9
9
  import { requestExampleParametersSchema as Y } from "@scalar/oas-utils/entities/spec";
10
10
  import { canMethodHaveBody as ce } from "@scalar/oas-utils/helpers";
11
11
  import G from "./RequestTable.vue.js";
@@ -23,7 +23,7 @@ const ve = {
23
23
  title: {}
24
24
  },
25
25
  setup(ye) {
26
- const { activeRequest: p, activeExample: o } = se(), { requestExampleMutators: i } = me(), Q = {
26
+ const { activeRequest: v, activeExample: o } = se(), { requestExampleMutators: i } = me(), Q = {
27
27
  json: "json",
28
28
  xml: "xml",
29
29
  yaml: "yaml",
@@ -42,12 +42,14 @@ const ve = {
42
42
  }).map(([e, a]) => ({
43
43
  id: e,
44
44
  label: a
45
- })), E = w(() => {
46
- var e, a;
47
- return o.value ? o.value.body.activeBody === "formData" ? ((e = o.value.body.formData) == null ? void 0 : e.encoding) === "urlencoded" ? "formUrlEncoded" : "multipartForm" : o.value.body.activeBody === "binary" ? "binaryFile" : o.value.body.activeBody === "raw" && ((a = o.value.body.raw) != null && a.encoding) ? o.value.body.raw.encoding === "html" ? "other" : o.value.body.raw.encoding : "none" : "none";
45
+ })), U = w(() => {
46
+ var a, t, n, l;
47
+ return o.value ? o.value.body.activeBody === "formData" ? ((a = o.value.body.formData) == null ? void 0 : a.encoding) === "urlencoded" ? "formUrlEncoded" : "multipartForm" : o.value.body.activeBody === "binary" ? "binaryFile" : o.value.body.activeBody === "raw" && ((t = o.value.body.raw) != null && t.encoding) ? o.value.body.raw.encoding === "html" ? "other" : o.value.body.raw.encoding : Object.keys(
48
+ ((l = (n = v.value) == null ? void 0 : n.requestBody) == null ? void 0 : l.content) || {}
49
+ )[0] || "none" : "none";
48
50
  }), y = w({
49
51
  get: () => F.find(
50
- (e) => e.id === E.value
52
+ (e) => e.id === U.value
51
53
  ) ?? F[F.length - 1],
52
54
  set: (e) => {
53
55
  e != null && e.id && W(e.id);
@@ -60,15 +62,15 @@ const ve = {
60
62
  function N() {
61
63
  console.log("deleteRow");
62
64
  }
63
- const S = (e, a, t) => {
64
- var n, r, s, u, d, h, B;
65
- if (!p.value || !o.value) return;
66
- const l = b.value;
67
- if (l.length > e) {
68
- const c = [...l];
65
+ const j = (e, a, t) => {
66
+ var l, r, s, u, d, h, B;
67
+ if (!v.value || !o.value) return;
68
+ const n = b.value;
69
+ if (n.length > e) {
70
+ const c = [...n];
69
71
  c[e] = {
70
72
  ...c[e],
71
- value: ((n = c[e]) == null ? void 0 : n.value) || "",
73
+ value: ((l = c[e]) == null ? void 0 : l.value) || "",
72
74
  key: ((r = c[e]) == null ? void 0 : r.key) || "",
73
75
  enabled: ((s = c[e]) == null ? void 0 : s.enabled) ?? !1,
74
76
  [a]: t || ""
@@ -83,23 +85,23 @@ const ve = {
83
85
  o.value.uid,
84
86
  "body.formData.value",
85
87
  c
86
- ), ne(() => {
88
+ ), le(() => {
87
89
  var A;
88
90
  if (!R.value) return;
89
91
  (A = R.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || A.focus();
90
92
  });
91
93
  }
92
- e === l.length - 1 && O();
94
+ e === n.length - 1 && S();
93
95
  }, b = w(
94
96
  () => {
95
97
  var e, a, t;
96
98
  return ((t = (a = (e = o.value) == null ? void 0 : e.body) == null ? void 0 : a.formData) == null ? void 0 : t.value) ?? [];
97
99
  }
98
- ), j = () => {
100
+ ), O = () => {
99
101
  const e = b.value[b.value.length - 1];
100
- (!e || e.key !== "" || e.value !== "") && O();
101
- }, O = () => {
102
- if (!p.value || !o.value) return;
102
+ (!e || e.key !== "" || e.value !== "") && S();
103
+ }, S = () => {
104
+ if (!v.value || !o.value) return;
103
105
  const e = Y.parse({
104
106
  enabled: !1
105
107
  }), a = [...b.value, e];
@@ -112,18 +114,18 @@ const ve = {
112
114
  encoding: "form-data"
113
115
  });
114
116
  }, q = (e, a) => {
115
- if (!p.value || !o.value) return;
117
+ if (!v.value || !o.value) return;
116
118
  const t = b.value;
117
119
  if (t.length > e) {
118
- const l = [...t];
119
- l[e] && (l[e].enabled = a), i.edit(
120
+ const n = [...t];
121
+ n[e] && (n[e].enabled = a), i.edit(
120
122
  o.value.uid,
121
123
  "body.formData.value",
122
- l
124
+ n
123
125
  );
124
126
  }
125
127
  }, L = (e) => {
126
- !p.value || !o.value || i.edit(o.value.uid, "body.raw.value", e);
128
+ !v.value || !o.value || i.edit(o.value.uid, "body.raw.value", e);
127
129
  }, M = (e) => e === "multipartForm" ? {
128
130
  activeBody: "formData",
129
131
  encoding: "form-data",
@@ -159,7 +161,7 @@ const ve = {
159
161
  } : { activeBody: "raw", encoding: void 0, header: void 0 }, W = (e) => {
160
162
  var s, u;
161
163
  if (!o.value) return;
162
- const { activeBody: a, encoding: t, header: l } = M(e);
164
+ const { activeBody: a, encoding: t, header: n } = M(e);
163
165
  if (i.edit(
164
166
  o.value.uid,
165
167
  "body.activeBody",
@@ -178,40 +180,40 @@ const ve = {
178
180
  const { raw: d, ...h } = o.value.body;
179
181
  i.edit(o.value.uid, "body", h);
180
182
  }
181
- const n = [...o.value.parameters.headers], r = n.findIndex(
183
+ const l = [...o.value.parameters.headers], r = l.findIndex(
182
184
  (d) => d.key.toLowerCase() === "content-type"
183
185
  );
184
186
  if (r >= 0)
185
- l && n[r] ? n[r].value = l : n[r] && n.splice(r, 1);
186
- else if (l) {
187
- const d = n[n.length - 1];
188
- d && d.key === "" && d.value === "" ? n.splice(n.length - 1, 0, {
187
+ n && l[r] ? l[r].value = n : l[r] && l.splice(r, 1);
188
+ else if (n) {
189
+ const d = l[l.length - 1];
190
+ d && d.key === "" && d.value === "" ? l.splice(l.length - 1, 0, {
189
191
  key: "Content-Type",
190
- value: l,
192
+ value: n,
191
193
  enabled: !0
192
- }) : n.push({
194
+ }) : l.push({
193
195
  key: "Content-Type",
194
- value: l,
196
+ value: n,
195
197
  enabled: !0
196
198
  });
197
199
  }
198
200
  i.edit(
199
201
  o.value.uid,
200
202
  "parameters.headers",
201
- n
203
+ l
202
204
  );
203
205
  }, z = async (e) => {
204
206
  const { open: a } = K({
205
207
  onChange: async (t) => {
206
- var n, r;
207
- const l = t == null ? void 0 : t[0];
208
- if (l && p.value && o.value) {
208
+ var l, r;
209
+ const n = t == null ? void 0 : t[0];
210
+ if (n && v.value && o.value) {
209
211
  const u = [...b.value];
210
212
  u[e] = {
211
213
  ...u[e],
212
- file: l,
213
- value: ((n = u[e]) == null ? void 0 : n.value) || l.name,
214
- key: ((r = u[e]) == null ? void 0 : r.key) || l.name,
214
+ file: n,
215
+ value: ((l = u[e]) == null ? void 0 : l.value) || n.name,
216
+ key: ((r = u[e]) == null ? void 0 : r.key) || n.name,
215
217
  enabled: !0
216
218
  }, i.edit(
217
219
  o.value.uid,
@@ -226,10 +228,10 @@ const ve = {
226
228
  a();
227
229
  };
228
230
  function I() {
229
- !p.value || !o.value || i.edit(o.value.uid, "body.binary", void 0);
231
+ !v.value || !o.value || i.edit(o.value.uid, "body.binary", void 0);
230
232
  }
231
233
  function J(e) {
232
- if (!p.value || !o.value) return;
234
+ if (!v.value || !o.value) return;
233
235
  const t = [...b.value];
234
236
  t[e] = {
235
237
  ...t[e],
@@ -247,7 +249,7 @@ const ve = {
247
249
  const { open: e } = K({
248
250
  onChange: async (a) => {
249
251
  const t = a == null ? void 0 : a[0];
250
- t && p.value && o.value && i.edit(
252
+ t && v.value && o.value && i.edit(
251
253
  o.value.uid,
252
254
  "body.binary",
253
255
  t
@@ -261,7 +263,7 @@ const ve = {
261
263
  $(
262
264
  y,
263
265
  (e) => {
264
- ["multipartForm", "formUrlEncoded"].includes((e == null ? void 0 : e.id) || "") && j();
266
+ ["multipartForm", "formUrlEncoded"].includes((e == null ? void 0 : e.id) || "") && O();
265
267
  },
266
268
  { immediate: !0 }
267
269
  ), $(
@@ -271,24 +273,24 @@ const ve = {
271
273
  },
272
274
  () => {
273
275
  var e;
274
- (e = p.value) != null && e.method && ce(p.value.method) && W(E.value), ["multipartForm", "formUrlEncoded"].includes(
275
- E.value
276
- ) && j();
276
+ (e = v.value) != null && e.method && ce(v.value.method) && W(U.value), ["multipartForm", "formUrlEncoded"].includes(
277
+ U.value
278
+ ) && O();
277
279
  },
278
280
  { immediate: !0 }
279
281
  );
280
282
  const k = w(() => {
281
- var n, r, s, u;
282
- const e = (n = y.value) == null ? void 0 : n.id, { header: a } = M(e), t = ((s = (r = p.value) == null ? void 0 : r.requestBody) == null ? void 0 : s.content) || {}, l = a ? ((u = t[a]) == null ? void 0 : u.examples) || {} : {};
283
- return Object.entries(l).map(([d, h]) => ({
283
+ var l, r, s, u;
284
+ const e = (l = y.value) == null ? void 0 : l.id, { header: a } = M(e), t = ((s = (r = v.value) == null ? void 0 : r.requestBody) == null ? void 0 : s.content) || {}, n = a ? ((u = t[a]) == null ? void 0 : u.examples) || {} : {};
285
+ return Object.entries(n).map(([d, h]) => ({
284
286
  id: d,
285
287
  label: d,
286
288
  value: h
287
289
  }));
288
- }), T = w({
290
+ }), E = w({
289
291
  get: () => {
290
- var l, n;
291
- const e = ((n = (l = o.value) == null ? void 0 : l.body.raw) == null ? void 0 : n.value) ?? "{}", a = JSON.parse(e);
292
+ var n, l;
293
+ const e = ((l = (n = o.value) == null ? void 0 : n.body.raw) == null ? void 0 : l.value) ?? "{}", a = JSON.parse(e);
292
294
  return k.value.find((r) => {
293
295
  const s = r.value;
294
296
  return JSON.stringify(s.value) === JSON.stringify(a);
@@ -307,33 +309,33 @@ const ve = {
307
309
  }
308
310
  });
309
311
  return (e, a) => (g(), x(de, null, {
310
- title: v(() => [
312
+ title: f(() => [
311
313
  H(_(e.title), 1)
312
314
  ]),
313
- default: v(() => [
314
- f(ue, { columns: [""] }, {
315
- default: v(() => [
316
- f(C, null, {
317
- default: v(() => [
318
- f(ie, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
319
- default: v(() => [
320
- f(m(X), {
315
+ default: f(() => [
316
+ p(ue, { columns: [""] }, {
317
+ default: f(() => [
318
+ p(C, null, {
319
+ default: f(() => [
320
+ p(ie, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
321
+ default: f(() => [
322
+ p(m(X), {
321
323
  modelValue: y.value,
322
324
  "onUpdate:modelValue": a[0] || (a[0] = (t) => y.value = t),
323
325
  options: m(F),
324
326
  teleport: ""
325
327
  }, {
326
- default: v(() => [
327
- f(m(U), {
328
+ default: f(() => [
329
+ p(m(T), {
328
330
  class: "flex gap-1.5 h-full px-3 text-c-2 font-normal hover:text-c-1 w-fit",
329
331
  fullWidth: "",
330
332
  variant: "ghost"
331
333
  }, {
332
- default: v(() => {
334
+ default: f(() => {
333
335
  var t;
334
336
  return [
335
337
  D("span", null, _((t = y.value) == null ? void 0 : t.label), 1),
336
- f(m(P), {
338
+ p(m(P), {
337
339
  icon: "ChevronDown",
338
340
  size: "md"
339
341
  })
@@ -346,23 +348,23 @@ const ve = {
346
348
  }, 8, ["modelValue", "options"]),
347
349
  k.value.length > 0 ? (g(), x(m(X), {
348
350
  key: 0,
349
- modelValue: T.value,
350
- "onUpdate:modelValue": a[1] || (a[1] = (t) => T.value = t),
351
+ modelValue: E.value,
352
+ "onUpdate:modelValue": a[1] || (a[1] = (t) => E.value = t),
351
353
  options: k.value,
352
354
  side: "left",
353
355
  teleport: ""
354
356
  }, {
355
- default: v(() => [
356
- f(m(U), {
357
+ default: f(() => [
358
+ p(m(T), {
357
359
  class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
358
360
  fullWidth: "",
359
361
  variant: "ghost"
360
362
  }, {
361
- default: v(() => {
363
+ default: f(() => {
362
364
  var t;
363
365
  return [
364
- D("span", null, _((t = T.value) == null ? void 0 : t.label), 1),
365
- f(m(P), {
366
+ D("span", null, _((t = E.value) == null ? void 0 : t.label), 1),
367
+ p(m(P), {
366
368
  icon: "ChevronDown",
367
369
  size: "md"
368
370
  })
@@ -379,36 +381,36 @@ const ve = {
379
381
  ]),
380
382
  _: 1
381
383
  }),
382
- f(C, null, {
383
- default: v(() => {
384
- var t, l, n, r, s, u, d, h, B;
384
+ p(C, null, {
385
+ default: f(() => {
386
+ var t, n, l, r, s, u, d, h, B;
385
387
  return [
386
388
  ((t = y.value) == null ? void 0 : t.id) === "none" ? (g(), V("div", ve, a[2] || (a[2] = [
387
389
  D("span", null, "No Body", -1)
388
- ]))) : ((l = y.value) == null ? void 0 : l.id) === "binaryFile" ? (g(), V("div", fe, [
389
- (n = m(o)) != null && n.body.binary ? (g(), V(le, { key: 0 }, [
390
+ ]))) : ((n = y.value) == null ? void 0 : n.id) === "binaryFile" ? (g(), V("div", fe, [
391
+ (l = m(o)) != null && l.body.binary ? (g(), V(ne, { key: 0 }, [
390
392
  D("span", pe, _(((r = m(o)) == null ? void 0 : r.body.binary).name), 1),
391
- f(m(U), {
393
+ p(m(T), {
392
394
  class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 ml-1 shadow-none",
393
395
  size: "sm",
394
396
  variant: "outlined",
395
397
  onClick: I
396
398
  }, {
397
- default: v(() => a[3] || (a[3] = [
399
+ default: f(() => a[3] || (a[3] = [
398
400
  H(" Delete ")
399
401
  ])),
400
402
  _: 1
401
403
  })
402
- ], 64)) : (g(), x(m(U), {
404
+ ], 64)) : (g(), x(m(T), {
403
405
  key: 1,
404
406
  class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 shadow-none",
405
407
  size: "sm",
406
408
  variant: "outlined",
407
409
  onClick: ee
408
410
  }, {
409
- default: v(() => [
411
+ default: f(() => [
410
412
  a[4] || (a[4] = D("span", null, "Upload File", -1)),
411
- f(m(P), {
413
+ p(m(P), {
412
414
  class: "ml-1",
413
415
  icon: "UploadSimple",
414
416
  size: "xs",
@@ -428,7 +430,7 @@ const ve = {
428
430
  onDeleteRow: N,
429
431
  onRemoveFile: J,
430
432
  onToggleRow: q,
431
- onUpdateRow: S,
433
+ onUpdateRow: j,
432
434
  onUploadFile: z
433
435
  }, null, 8, ["items"])) : ((u = y.value) == null ? void 0 : u.id) == "formUrlEncoded" ? (g(), x(G, {
434
436
  key: 3,
@@ -441,7 +443,7 @@ const ve = {
441
443
  onDeleteRow: N,
442
444
  onRemoveFile: J,
443
445
  onToggleRow: q,
444
- onUpdateRow: S,
446
+ onUpdateRow: j,
445
447
  onUploadFile: z
446
448
  }, null, 8, ["items"])) : (g(), x(re, {
447
449
  key: 4,
@@ -457,7 +459,7 @@ const ve = {
457
459
  }),
458
460
  _: 1
459
461
  }),
460
- f(C)
462
+ p(C)
461
463
  ]),
462
464
  _: 1
463
465
  })
@@ -1 +1 @@
1
- {"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AAqOA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAIlD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;IAC5C,eAAe,CAAC,EAAE;QAChB,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,KAAK,EAAE,gBAAgB,CAAA;KACxB,EAAE,CAAA;CACJ,CAAC;;AAwVF,wBAOG"}
1
+ {"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AAwOA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAIlD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;IAC5C,eAAe,CAAC,EAAE;QAChB,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,KAAK,EAAE,gBAAgB,CAAA;KACxB,EAAE,CAAA;CACJ,CAAC;;AA+VF,wBAOG"}
@@ -1,75 +1,75 @@
1
- import { defineComponent as A, computed as m, onMounted as N, ref as V, watch as B, openBlock as v, createBlock as d, withCtx as r, createTextVNode as R, toDisplayString as k, createElementVNode as i, unref as b, createVNode as x, withModifiers as M, createCommentVNode as C, nextTick as E } from "vue";
1
+ import { defineComponent as A, computed as m, onMounted as N, ref as V, watch as z, openBlock as f, createBlock as d, withCtx as r, createTextVNode as R, toDisplayString as k, createElementVNode as i, unref as x, createVNode as C, withModifiers as B, createCommentVNode as E, normalizeClass as M, nextTick as _ } from "vue";
2
2
  import W from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
- import { useActiveEntities as z } from "../../../store/active-entities.js";
4
- import _ from "./RequestTable.vue.js";
5
- import { ScalarTooltip as D, ScalarButton as G } from "@scalar/components";
6
- import { requestExampleParametersSchema as q } from "@scalar/oas-utils/entities/spec";
7
- import { useWorkspace as U } from "../../../store/store.js";
8
- const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, F = { class: "sr-only" }, te = /* @__PURE__ */ A({
3
+ import { useActiveEntities as D } from "../../../store/active-entities.js";
4
+ import q from "./RequestTable.vue.js";
5
+ import { ScalarTooltip as G, ScalarButton as U } from "@scalar/components";
6
+ import { requestExampleParametersSchema as w } from "@scalar/oas-utils/entities/spec";
7
+ import { useWorkspace as j } from "../../../store/store.js";
8
+ const F = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, H = { class: "sr-only" }, ae = /* @__PURE__ */ A({
9
9
  __name: "RequestParams",
10
10
  props: {
11
11
  title: {},
12
12
  paramKey: {},
13
13
  readOnlyEntries: {}
14
14
  },
15
- setup(w) {
16
- const n = w, { activeRequest: u, activeExample: s } = z(), { requestExampleMutators: o } = U(), l = m(
15
+ setup(P) {
16
+ const n = P, { activeRequest: u, activeExample: s } = D(), { requestExampleMutators: o } = j(), l = m(
17
17
  () => {
18
18
  var e;
19
19
  return ((e = s.value) == null ? void 0 : e.parameters[n.paramKey]) ?? [];
20
20
  }
21
21
  );
22
22
  N(() => {
23
- y();
23
+ g();
24
24
  });
25
25
  const p = () => {
26
26
  if (!u.value || !s.value) return;
27
- const e = q.parse({ enabled: !1 }), t = [...l.value, e];
27
+ const e = w.parse({ enabled: !1 }), t = [...l.value, e];
28
28
  o.edit(
29
29
  s.value.uid,
30
30
  `parameters.${n.paramKey}`,
31
31
  t
32
32
  );
33
- }, c = V(null), P = (e, t, g) => {
33
+ }, c = V(null), K = (e, t, h) => {
34
34
  if (!u.value || !s.value) return;
35
- const f = l.value;
36
- if (f.length > e) {
37
- const a = [...f];
35
+ const v = l.value;
36
+ if (v.length > e) {
37
+ const a = [...v];
38
38
  if (!a[e]) return;
39
- a[e] = { ...a[e], [t]: g }, (a[e].key !== "" || a[e].value !== "") && (a[e].enabled = !0), a[e].key === "" && a[e].value === "" && a.splice(e, 1), o.edit(
39
+ a[e] = { ...a[e], [t]: h }, (a[e].key !== "" || a[e].value !== "") && (a[e].enabled = !0), a[e].key === "" && a[e].value === "" && a.splice(e, 1), o.edit(
40
40
  s.value.uid,
41
41
  `parameters.${n.paramKey}`,
42
42
  a
43
43
  );
44
44
  } else {
45
- const a = [q.parse({ [t]: g })];
45
+ const a = [w.parse({ [t]: h })];
46
46
  o.edit(
47
47
  s.value.uid,
48
48
  `parameters.${n.paramKey}`,
49
49
  a
50
- ), E(() => {
51
- var h;
50
+ ), _(() => {
51
+ var b;
52
52
  if (!c.value) return;
53
- (h = c.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || h.focus();
53
+ (b = c.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || b.focus();
54
54
  });
55
55
  }
56
- e === f.length - 1 && p();
57
- }, K = (e, t) => u.value && s.value && o.edit(
56
+ e === v.length - 1 && p();
57
+ }, $ = (e, t) => u.value && s.value && o.edit(
58
58
  s.value.uid,
59
59
  `parameters.${n.paramKey}.${e}.enabled`,
60
60
  t
61
- ), $ = () => {
61
+ ), O = () => {
62
62
  if (!u.value || !s.value) return;
63
63
  const e = l.value.filter((t) => t.required);
64
64
  o.edit(
65
65
  s.value.uid,
66
66
  `parameters.${n.paramKey}`,
67
67
  e
68
- ), E(() => {
68
+ ), _(() => {
69
69
  p();
70
70
  });
71
71
  };
72
- function y() {
72
+ function g() {
73
73
  if (l.value.length === 0)
74
74
  p();
75
75
  else if (l.value.length >= 1) {
@@ -77,43 +77,43 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
77
77
  e && e.key !== "" && e.value !== "" && p();
78
78
  }
79
79
  }
80
- const O = m(
80
+ const T = m(
81
81
  () => l.value.filter((e) => e.key || e.value).length
82
- ), T = m(() => l.value.length > 1);
83
- B(
82
+ ), S = m(() => l.value.length > 1);
83
+ z(
84
84
  () => s.value,
85
85
  (e, t) => {
86
- e !== t && y();
86
+ e !== t && g();
87
87
  },
88
88
  { immediate: !0 }
89
89
  );
90
- const S = m(
90
+ const y = m(
91
91
  () => (n.readOnlyEntries ?? []).length > 0
92
92
  );
93
- return (e, t) => (v(), d(W, {
93
+ return (e, t) => (f(), d(W, {
94
94
  class: "group/params",
95
- itemCount: O.value
95
+ itemCount: T.value
96
96
  }, {
97
97
  title: r(() => [
98
98
  R(k(e.title), 1)
99
99
  ]),
100
100
  actions: r(() => [
101
- i("div", j, [
102
- T.value ? (v(), d(b(D), {
101
+ i("div", F, [
102
+ S.value ? (f(), d(x(G), {
103
103
  key: 0,
104
104
  side: "right",
105
105
  sideOffset: 12
106
106
  }, {
107
107
  trigger: r(() => [
108
- x(b(G), {
108
+ C(x(U), {
109
109
  class: "px-1 transition-none",
110
110
  size: "sm",
111
111
  variant: "ghost",
112
- onClick: M($, ["stop"])
112
+ onClick: B(O, ["stop"])
113
113
  }, {
114
114
  default: r(() => [
115
115
  t[0] || (t[0] = R(" Clear ")),
116
- i("span", F, "All " + k(e.title), 1)
116
+ i("span", H, "All " + k(e.title), 1)
117
117
  ]),
118
118
  _: 1
119
119
  })
@@ -126,7 +126,7 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
126
126
  ], -1)
127
127
  ])),
128
128
  _: 1
129
- })) : C("", !0)
129
+ })) : E("", !0)
130
130
  ])
131
131
  ]),
132
132
  default: r(() => [
@@ -134,20 +134,22 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
134
134
  ref_key: "tableWrapperRef",
135
135
  ref: c
136
136
  }, [
137
- S.value ? (v(), d(_, {
137
+ y.value ? (f(), d(q, {
138
138
  key: 0,
139
- class: "flex-1",
139
+ class: M(["flex-1", {
140
+ "bg-mix-transparent bg-mix-amount-95 bg-c-3": y.value
141
+ }]),
140
142
  columns: ["32px", "", ""],
141
143
  isGlobal: "",
142
144
  isReadOnly: "",
143
145
  items: e.readOnlyEntries
144
- }, null, 8, ["items"])) : C("", !0),
145
- x(_, {
146
+ }, null, 8, ["class", "items"])) : E("", !0),
147
+ C(q, {
146
148
  class: "flex-1",
147
149
  columns: ["32px", "", ""],
148
150
  items: l.value,
149
- onToggleRow: K,
150
- onUpdateRow: P
151
+ onToggleRow: $,
152
+ onUpdateRow: K
151
153
  }, null, 8, ["items"])
152
154
  ], 512)
153
155
  ]),
@@ -156,5 +158,5 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
156
158
  }
157
159
  });
158
160
  export {
159
- te as default
161
+ ae as default
160
162
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AAuPA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAOlD,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,CAAC,uBAAuB,GAAG;QAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC,EAAE,CAAA;IAClE,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;;;;;;;;;;;;;;;;;;;;yBAJsB,OAAO;sBACV,OAAO;cACf,OAAO;gBACL,OAAO;;AAifxB,wBASG"}
1
+ {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AAwPA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAOlD,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,CAAC,uBAAuB,GAAG;QAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC,EAAE,CAAA;IAClE,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;;;;;;;;;;;;;;;;;;;;yBAJsB,OAAO;sBACV,OAAO;cACf,OAAO;gBACL,OAAO;;AAkfxB,wBASG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestTable.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-49d61d6c"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-68853319"]]);
5
5
  export {
6
6
  m as default
7
7
  };