@scalar/api-client 2.2.33 → 2.2.35

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 (35) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  3. package/dist/components/AddressBar/AddressBar.vue2.js +27 -26
  4. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  5. package/dist/components/ContextBar.vue.js +1 -1
  6. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  7. package/dist/components/DataTable/DataTableCheckbox.vue.js +20 -15
  8. package/dist/layouts/App/create-api-client-app.d.ts +3 -1
  9. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  10. package/dist/layouts/Modal/create-api-client-modal.d.ts +6 -2
  11. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  12. package/dist/layouts/Web/create-api-client-web.d.ts +3 -1
  13. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  14. package/dist/libs/create-client.d.ts +3 -1
  15. package/dist/libs/create-client.d.ts.map +1 -1
  16. package/dist/store/events.d.ts +3 -1
  17. package/dist/store/events.d.ts.map +1 -1
  18. package/dist/store/store.d.ts +3 -1
  19. package/dist/store/store.d.ts.map +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
  22. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +30 -27
  23. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  24. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  25. package/dist/views/Request/RequestSection/RequestBody.vue2.js +38 -38
  26. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  27. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +51 -42
  28. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +3 -3
  29. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  30. package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
  31. package/dist/views/Request/RequestSection/RequestTable.vue2.js +68 -68
  32. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  33. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  34. package/dist/views/Request/libs/oauth2.js +1 -1
  35. package/package.json +11 -11
@@ -1,7 +1,7 @@
1
1
  import t from "./RequestAuthDataTable.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-77c33357"]]);
4
+ const c = /* @__PURE__ */ o(t, [["__scopeId", "data-v-296c081c"]]);
5
5
  export {
6
- m as default
6
+ c as default
7
7
  };
@@ -1,71 +1,74 @@
1
- import { defineComponent as y, ref as f, computed as S, watch as x, openBlock as r, createElementBlock as l, Fragment as k, renderList as g, normalizeClass as p, createElementVNode as i, toDisplayString as w, unref as s, createCommentVNode as c, createBlock as _, withCtx as C, createVNode as v } from "vue";
2
- import { useModal as U } from "@scalar/components";
3
- import z from "./DeleteRequestAuthModal.vue.js";
4
- import A from "./RequestExampleAuth.vue.js";
1
+ import { defineComponent as y, ref as f, computed as S, watch as x, openBlock as r, createElementBlock as s, withModifiers as k, Fragment as w, renderList as g, normalizeClass as p, createElementVNode as n, toDisplayString as _, unref as o, createCommentVNode as c, createBlock as C, withCtx as U, createVNode as v } from "vue";
2
+ import { useModal as z } from "@scalar/components";
3
+ import A from "./DeleteRequestAuthModal.vue.js";
4
+ import M from "./RequestExampleAuth.vue.js";
5
5
  import { displaySchemeFormatter as N } from "../../libs/auth.js";
6
6
  import $ from "../../../../components/DataTable/DataTable.vue.js";
7
7
  import { useWorkspace as B } from "../../../../store/store.js";
8
8
  const E = {
9
9
  key: 0,
10
10
  class: "border-t flex px-3 flex-wrap gap-x-2.5 overflow-hidden"
11
- }, M = ["onClick"], V = { class: "whitespace-nowrap font-medium z-10 relative" }, q = {
11
+ }, V = ["onClick"], q = { class: "whitespace-nowrap font-medium z-10 relative" }, D = {
12
12
  key: 0,
13
13
  class: "absolute bottom-[var(--scalar-border-width)] z-1 inset-x-1 h-px bg-current left-1/2 -translate-x-1/2 w-full"
14
- }, D = {
14
+ }, F = {
15
15
  key: 2,
16
16
  class: "text-c-3 px-4 text-sm border-t min-h-16 justify-center flex items-center bg-b-1"
17
- }, H = /* @__PURE__ */ y({
17
+ }, J = /* @__PURE__ */ y({
18
18
  __name: "RequestAuthDataTable",
19
19
  props: {
20
20
  selectedSecuritySchemeUids: {},
21
21
  layout: { default: "client" }
22
22
  },
23
23
  setup(u) {
24
- const { securitySchemes: d } = B(), m = U(), b = f(null), e = f(0), h = S(() => u.selectedSecuritySchemeUids[e.value] || null);
24
+ const { securitySchemes: d } = B(), m = z(), b = f(null), e = f(0), h = S(() => u.selectedSecuritySchemeUids[e.value] || null);
25
25
  return x(
26
26
  () => u.selectedSecuritySchemeUids,
27
27
  (t) => {
28
28
  t[e.value] || (e.value = Math.max(0, e.value - 1));
29
29
  }
30
- ), (t, o) => (r(), l("form", null, [
31
- t.selectedSecuritySchemeUids.length > 1 ? (r(), l("div", E, [
32
- (r(!0), l(k, null, g(t.selectedSecuritySchemeUids, (a, n) => (r(), l("div", {
30
+ ), (t, l) => (r(), s("form", {
31
+ onSubmit: l[1] || (l[1] = k(() => {
32
+ }, ["prevent"]))
33
+ }, [
34
+ t.selectedSecuritySchemeUids.length > 1 ? (r(), s("div", E, [
35
+ (r(!0), s(w, null, g(t.selectedSecuritySchemeUids, (a, i) => (r(), s("div", {
33
36
  key: a,
34
- class: p(["flex relative h-8 z-1 cursor-pointer -mb-[var(--scalar-border-width)]", [e.value === n ? "text-c-1" : "text-c-3"]])
37
+ class: p(["flex relative h-8 z-1 cursor-pointer -mb-[var(--scalar-border-width)]", [e.value === i ? "text-c-1" : "text-c-3"]])
35
38
  }, [
36
- i("button", {
39
+ n("button", {
37
40
  class: "floating-bg py-1 text-sm border-b-[1px] border-transparent relative cursor-pointer font-medium",
38
41
  type: "button",
39
- onClick: (F) => e.value = n
42
+ onClick: (R) => e.value = i
40
43
  }, [
41
- i("span", V, w(s(d)[a] ? s(N)(s(d)[a]).label : ""), 1)
42
- ], 8, M),
43
- o[1] || (o[1] = i("div", { class: "absolute bottom-0 z-0 -inset-x-96 h-[var(--scalar-border-width)] bg-border" }, null, -1)),
44
- e.value === n ? (r(), l("div", q)) : c("", !0)
44
+ n("span", q, _(o(d)[a] ? o(N)(o(d)[a]).label : ""), 1)
45
+ ], 8, V),
46
+ l[2] || (l[2] = n("div", { class: "absolute bottom-0 z-0 -inset-x-96 h-[var(--scalar-border-width)] bg-border" }, null, -1)),
47
+ e.value === i ? (r(), s("div", D)) : c("", !0)
45
48
  ], 2))), 128))
46
49
  ])) : c("", !0),
47
- h.value ? (r(), _(s($), {
50
+ h.value ? (r(), C(o($), {
48
51
  key: 1,
49
52
  class: p(["flex-1", t.layout === "reference" && "border-0"]),
50
53
  columns: [""]
51
54
  }, {
52
- default: C(() => [
53
- v(A, {
55
+ default: U(() => [
56
+ v(M, {
54
57
  layout: t.layout,
55
58
  selectedSecuritySchemeUids: [h.value]
56
59
  }, null, 8, ["layout", "selectedSecuritySchemeUids"])
57
60
  ]),
58
61
  _: 1
59
62
  }, 8, ["class"])) : c("", !0),
60
- t.selectedSecuritySchemeUids.length ? c("", !0) : (r(), l("div", D, " No authentication selected ")),
61
- v(z, {
63
+ t.selectedSecuritySchemeUids.length ? c("", !0) : (r(), s("div", F, " No authentication selected ")),
64
+ v(A, {
62
65
  scheme: b.value,
63
- state: s(m),
64
- onClose: o[0] || (o[0] = (a) => s(m).hide())
66
+ state: o(m),
67
+ onClose: l[0] || (l[0] = (a) => o(m).hide())
65
68
  }, null, 8, ["scheme", "state"])
66
- ]));
69
+ ], 32));
67
70
  }
68
71
  });
69
72
  export {
70
- H as default
73
+ J as default
71
74
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"AAumBA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AA05BF,wBAOG"}
1
+ {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"AAymBA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AA85BF,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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d84d8b55"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d2c26e53"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as ae, computed as w, ref as te, watch as $, openBlock as g, createBlock as x, withCtx as m, createTextVNode as H, toDisplayString as _, createVNode as v, unref as c, 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
- import ue from "../../../components/DataTable/DataTable.vue.js";
4
- import ie from "../../../components/DataTable/DataTableHeader.vue.js";
3
+ import ie from "../../../components/DataTable/DataTable.vue.js";
4
+ import ue from "../../../components/DataTable/DataTableHeader.vue.js";
5
5
  import P 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";
@@ -16,14 +16,14 @@ const ve = {
16
16
  class: "border-t-1/2 text-c-3 flex min-h-10 w-full items-center justify-center p-2 text-sm"
17
17
  }, fe = {
18
18
  key: 1,
19
- class: "flex items-center justify-center p-1.5 overflow-hidden"
20
- }, pe = { class: "text-c-2 text-xs w-full border rounded p-1 max-w-full overflow-hidden whitespace-nowrap" }, Ce = /* @__PURE__ */ ae({
19
+ class: "border-t flex items-center justify-center p-1.5 overflow-hidden"
20
+ }, pe = { class: "text-c-2 text-xs w-full border rounded py-1 px-1.5 max-w-full overflow-hidden whitespace-nowrap" }, Ce = /* @__PURE__ */ ae({
21
21
  __name: "RequestBody",
22
22
  props: {
23
23
  title: {}
24
24
  },
25
25
  setup(ye) {
26
- const { activeRequest: f, activeExample: o } = se(), { requestExampleMutators: i } = me(), Q = {
26
+ const { activeRequest: f, activeExample: o } = se(), { requestExampleMutators: u } = me(), Q = {
27
27
  json: "json",
28
28
  xml: "xml",
29
29
  yaml: "yaml",
@@ -61,7 +61,7 @@ const ve = {
61
61
  console.log("deleteRow");
62
62
  }
63
63
  const S = (e, a, t) => {
64
- var l, r, d, u, p, h, k;
64
+ var l, r, d, i, p, h, k;
65
65
  if (!f.value || !o.value) return;
66
66
  const n = b.value;
67
67
  if (n.length > e) {
@@ -72,14 +72,14 @@ const ve = {
72
72
  key: ((r = s[e]) == null ? void 0 : r.key) || "",
73
73
  enabled: ((d = s[e]) == null ? void 0 : d.enabled) ?? !1,
74
74
  [a]: t || ""
75
- }, (((u = s[e]) == null ? void 0 : u.key) !== "" || ((p = s[e]) == null ? void 0 : p.value) !== "") && (s[e].enabled = !0), ((h = s[e]) == null ? void 0 : h.key) === "" && ((k = s[e]) == null ? void 0 : k.value) === "" && s.splice(e, 1), i.edit(
75
+ }, (((i = s[e]) == null ? void 0 : i.key) !== "" || ((p = s[e]) == null ? void 0 : p.value) !== "") && (s[e].enabled = !0), ((h = s[e]) == null ? void 0 : h.key) === "" && ((k = s[e]) == null ? void 0 : k.value) === "" && s.splice(e, 1), u.edit(
76
76
  o.value.uid,
77
77
  "body.formData.value",
78
78
  s
79
79
  );
80
80
  } else {
81
81
  const s = [Y.parse({ [a]: t })];
82
- i.edit(
82
+ u.edit(
83
83
  o.value.uid,
84
84
  "body.formData.value",
85
85
  s
@@ -103,11 +103,11 @@ const ve = {
103
103
  const e = Y.parse({
104
104
  enabled: !1
105
105
  }), a = [...b.value, e];
106
- o.value.body.formData ? i.edit(
106
+ o.value.body.formData ? u.edit(
107
107
  o.value.uid,
108
108
  "body.formData.value",
109
109
  a
110
- ) : i.edit(o.value.uid, "body.formData", {
110
+ ) : u.edit(o.value.uid, "body.formData", {
111
111
  value: a,
112
112
  encoding: "form-data"
113
113
  });
@@ -116,14 +116,14 @@ const ve = {
116
116
  const t = b.value;
117
117
  if (t.length > e) {
118
118
  const n = [...t];
119
- n[e] && (n[e].enabled = a), i.edit(
119
+ n[e] && (n[e].enabled = a), u.edit(
120
120
  o.value.uid,
121
121
  "body.formData.value",
122
122
  n
123
123
  );
124
124
  }
125
125
  }, L = (e) => {
126
- !f.value || !o.value || i.edit(o.value.uid, "body.raw.value", e);
126
+ !f.value || !o.value || u.edit(o.value.uid, "body.raw.value", e);
127
127
  }, M = (e) => e === "multipartForm" ? {
128
128
  activeBody: "formData",
129
129
  encoding: "form-data",
@@ -157,26 +157,26 @@ const ve = {
157
157
  encoding: "html",
158
158
  header: "application/html"
159
159
  } : { activeBody: "raw", encoding: void 0, header: void 0 }, W = (e) => {
160
- var d, u;
160
+ var d, i;
161
161
  if (!o.value) return;
162
162
  const { activeBody: a, encoding: t, header: n } = M(e);
163
- if (i.edit(
163
+ if (u.edit(
164
164
  o.value.uid,
165
165
  "body.activeBody",
166
166
  a
167
167
  ), t && a === "raw")
168
- i.edit(o.value.uid, "body.raw", {
168
+ u.edit(o.value.uid, "body.raw", {
169
169
  encoding: t,
170
170
  value: ((d = o.value.body.raw) == null ? void 0 : d.value) ?? ""
171
171
  });
172
172
  else if (t && a === "formData")
173
- i.edit(o.value.uid, "body.formData", {
173
+ u.edit(o.value.uid, "body.formData", {
174
174
  encoding: t,
175
- value: ((u = o.value.body.formData) == null ? void 0 : u.value) ?? []
175
+ value: ((i = o.value.body.formData) == null ? void 0 : i.value) ?? []
176
176
  });
177
- else if (!t) {
177
+ else if (!t && a !== "binary") {
178
178
  const { raw: p, ...h } = o.value.body;
179
- i.edit(o.value.uid, "body", h);
179
+ u.edit(o.value.uid, "body", h);
180
180
  }
181
181
  const l = [...o.value.parameters.headers], r = l.findIndex(
182
182
  (p) => p.key.toLowerCase() === "content-type"
@@ -185,7 +185,7 @@ const ve = {
185
185
  key: "Content-Type",
186
186
  value: n,
187
187
  enabled: !0
188
- }), i.edit(
188
+ }), u.edit(
189
189
  o.value.uid,
190
190
  "parameters.headers",
191
191
  l
@@ -196,17 +196,17 @@ const ve = {
196
196
  var l, r;
197
197
  const n = t == null ? void 0 : t[0];
198
198
  if (n && f.value && o.value) {
199
- const u = [...b.value];
200
- u[e] = {
201
- ...u[e],
199
+ const i = [...b.value];
200
+ i[e] = {
201
+ ...i[e],
202
202
  file: n,
203
- value: ((l = u[e]) == null ? void 0 : l.value) || n.name,
204
- key: ((r = u[e]) == null ? void 0 : r.key) || n.name,
203
+ value: ((l = i[e]) == null ? void 0 : l.value) || n.name,
204
+ key: ((r = i[e]) == null ? void 0 : r.key) || n.name,
205
205
  enabled: !0
206
- }, i.edit(
206
+ }, u.edit(
207
207
  o.value.uid,
208
208
  "body.formData.value",
209
- u
209
+ i
210
210
  );
211
211
  }
212
212
  },
@@ -216,7 +216,7 @@ const ve = {
216
216
  a();
217
217
  };
218
218
  function I() {
219
- !f.value || !o.value || i.edit(o.value.uid, "body.binary", void 0);
219
+ !f.value || !o.value || u.edit(o.value.uid, "body.binary", void 0);
220
220
  }
221
221
  function J(e) {
222
222
  if (!f.value || !o.value) return;
@@ -227,7 +227,7 @@ const ve = {
227
227
  value: "",
228
228
  key: "",
229
229
  enabled: !1
230
- }, i.edit(
230
+ }, u.edit(
231
231
  o.value.uid,
232
232
  "body.formData.value",
233
233
  t
@@ -237,7 +237,7 @@ const ve = {
237
237
  const { open: e } = K({
238
238
  onChange: async (a) => {
239
239
  const t = a == null ? void 0 : a[0];
240
- t && f.value && o.value && i.edit(
240
+ t && f.value && o.value && u.edit(
241
241
  o.value.uid,
242
242
  "body.binary",
243
243
  t
@@ -268,8 +268,8 @@ const ve = {
268
268
  { immediate: !0 }
269
269
  );
270
270
  const B = w(() => {
271
- var l, r, d, u;
272
- const e = (l = y.value) == null ? void 0 : l.id, { header: a } = M(e), t = ((d = (r = f.value) == null ? void 0 : r.requestBody) == null ? void 0 : d.content) || {}, n = a ? ((u = t[a]) == null ? void 0 : u.examples) || {} : {};
271
+ var l, r, d, i;
272
+ const e = (l = y.value) == null ? void 0 : l.id, { header: a } = M(e), t = ((d = (r = f.value) == null ? void 0 : r.requestBody) == null ? void 0 : d.content) || {}, n = a ? ((i = t[a]) == null ? void 0 : i.examples) || {} : {};
273
273
  return Object.entries(n).map(([p, h]) => ({
274
274
  id: p,
275
275
  label: p,
@@ -301,11 +301,11 @@ const ve = {
301
301
  H(_(e.title), 1)
302
302
  ]),
303
303
  default: m(() => [
304
- v(ue, { columns: [""] }, {
304
+ v(ie, { columns: [""] }, {
305
305
  default: m(() => [
306
306
  v(P, null, {
307
307
  default: m(() => [
308
- v(ie, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
308
+ v(ue, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
309
309
  default: m(() => [
310
310
  v(c(X), {
311
311
  modelValue: y.value,
@@ -315,7 +315,7 @@ const ve = {
315
315
  }, {
316
316
  default: m(() => [
317
317
  v(c(U), {
318
- class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
318
+ class: "flex gap-1.5 h-full px-3 text-c-2 font-normal hover:text-c-1 w-fit",
319
319
  fullWidth: "",
320
320
  variant: "ghost"
321
321
  }, {
@@ -371,7 +371,7 @@ const ve = {
371
371
  }),
372
372
  v(P, null, {
373
373
  default: m(() => {
374
- var t, n, l, r, d, u, p, h, k;
374
+ var t, n, l, r, d, i, p, h, k;
375
375
  return [
376
376
  ((t = y.value) == null ? void 0 : t.id) === "none" ? (g(), V("div", ve, a[2] || (a[2] = [
377
377
  D("span", null, "No Body", -1)
@@ -420,7 +420,7 @@ const ve = {
420
420
  onToggleRow: q,
421
421
  onUpdateRow: S,
422
422
  onUploadFile: z
423
- }, null, 8, ["items"])) : ((u = y.value) == null ? void 0 : u.id) == "formUrlEncoded" ? (g(), x(G, {
423
+ }, null, 8, ["items"])) : ((i = y.value) == null ? void 0 : i.id) == "formUrlEncoded" ? (g(), x(G, {
424
424
  key: 3,
425
425
  ref_key: "tableWrapperRef",
426
426
  ref: R,
@@ -435,7 +435,7 @@ const ve = {
435
435
  onUploadFile: z
436
436
  }, null, 8, ["items"])) : (g(), x(re, {
437
437
  key: 4,
438
- class: "border-t-1/2",
438
+ class: "border-t-1/2 px-1",
439
439
  content: "",
440
440
  language: Z.value,
441
441
  lineNumbers: "",
@@ -1 +1 @@
1
- {"version":3,"file":"RequestPathParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestPathParams.vue"],"names":[],"mappings":"AA+IA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAMrE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;CAC7C,CAAC;;AA0MF,wBAOG"}
1
+ {"version":3,"file":"RequestPathParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestPathParams.vue"],"names":[],"mappings":"AAyJA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAMrE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;CAC7C,CAAC;;AAmNF,wBAOG"}
@@ -1,18 +1,18 @@
1
- import { defineComponent as P, computed as _, watch as y, openBlock as g, createBlock as R, withCtx as $, createTextVNode as b, toDisplayString as q, createCommentVNode as V } from "vue";
1
+ import { defineComponent as E, computed as P, watch as v, openBlock as g, createBlock as x, withCtx as R, createTextVNode as _, toDisplayString as q, createCommentVNode as V } from "vue";
2
2
  import w from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
3
  import { useActiveEntities as M } from "../../../store/active-entities.js";
4
4
  import N from "./RequestTable.vue.js";
5
5
  import { REGEX as T } from "@scalar/oas-utils/helpers";
6
- import { useWorkspace as U } from "../../../store/store.js";
7
- const W = /* @__PURE__ */ P({
6
+ import { useWorkspace as A } from "../../../store/store.js";
7
+ const W = /* @__PURE__ */ E({
8
8
  __name: "RequestPathParams",
9
9
  props: {
10
10
  title: {},
11
11
  paramKey: {}
12
12
  },
13
- setup(E) {
14
- const u = E, { activeRequest: o, activeExample: n, activeServer: l } = M(), { requestMutators: f, requestExampleMutators: v } = U(), c = _(() => {
15
- const e = n.value;
13
+ setup($) {
14
+ const u = $, { activeRequest: o, activeExample: s, activeServer: l } = M(), { requestMutators: h, requestExampleMutators: y } = A(), c = P(() => {
15
+ const e = s.value;
16
16
  return e ? e.parameters[u.paramKey].map((t) => {
17
17
  var a;
18
18
  return {
@@ -20,75 +20,84 @@ const W = /* @__PURE__ */ P({
20
20
  enum: t.enum || ((a = e.serverVariables) == null ? void 0 : a[t.key])
21
21
  };
22
22
  }) : [];
23
- }), K = (e, t, a) => {
24
- var p, r;
25
- if (!o.value || !n.value) return;
26
- const i = n.value.parameters[u.paramKey], s = (p = i[e]) == null ? void 0 : p.key;
27
- if (s) {
23
+ }), k = (e, t, a) => {
24
+ var i, r;
25
+ if (!o.value || !s.value) return;
26
+ const p = s.value.parameters[u.paramKey], n = (i = p[e]) == null ? void 0 : i.key;
27
+ if (n) {
28
28
  if (t === "key") {
29
- if ((r = i[e]) != null && r.required)
29
+ if ((r = p[e]) != null && r.required)
30
30
  return;
31
31
  if (a) {
32
- const m = encodeURIComponent(s), d = encodeURIComponent(a), x = new RegExp(`(?<=/):${m}(?=[/?#]|$)`, "g"), C = o.value.path.replace(
33
- x,
34
- `:${d}`
32
+ const d = encodeURIComponent(n), f = encodeURIComponent(a), K = new RegExp(`(?<=/):${d}(?=[/?#]|$)`, "g"), b = o.value.path.replace(
33
+ K,
34
+ `:${f}`
35
35
  );
36
- f.edit(o.value.uid, "path", C);
36
+ h.edit(o.value.uid, "path", b);
37
37
  } else {
38
- i.splice(e, 1);
39
- const m = new RegExp(`/:${encodeURIComponent(s)}(?=[/?#]|$)`, "g"), d = o.value.path.replace(m, "");
40
- f.edit(o.value.uid, "path", d);
38
+ p.splice(e, 1);
39
+ const d = new RegExp(`/:${encodeURIComponent(n)}(?=[/?#]|$)`, "g"), f = o.value.path.replace(d, "");
40
+ h.edit(o.value.uid, "path", f);
41
41
  }
42
42
  }
43
- v.edit(
44
- n.value.uid,
43
+ y.edit(
44
+ s.value.uid,
45
45
  `parameters.${u.paramKey}.${e}.${t}`,
46
46
  a
47
47
  );
48
48
  }
49
- }, k = (e) => {
50
- var p;
51
- if (!n.value) return;
52
- const t = ((p = e.match(T.PATH)) == null ? void 0 : p.map((r) => r.slice(1, -1))) || [], a = n.value.parameters[u.paramKey], i = new Map(a.map((r) => [r.key, r])), s = t.map(
53
- (r) => i.get(r) || { key: r, value: "", enabled: !0 }
49
+ }, C = (e) => {
50
+ var i;
51
+ if (!s.value) return;
52
+ const t = ((i = e.match(T.PATH)) == null ? void 0 : i.map((r) => r.slice(1, -1))) || [], a = s.value.parameters[u.paramKey], p = new Map(a.map((r) => [r.key, r])), n = t.map(
53
+ (r) => p.get(r) || { key: r, value: "", enabled: !0 }
54
54
  );
55
55
  a.forEach((r) => {
56
- !t.includes(r.key) && (r.value || r.required) && s.push(r);
57
- }), a.splice(0, a.length, ...s), v.edit(
58
- n.value.uid,
56
+ !t.includes(r.key) && (r.value || r.required) && n.push(r);
57
+ }), a.splice(0, a.length, ...n), y.edit(
58
+ s.value.uid,
59
59
  `parameters.${u.paramKey}`,
60
60
  a
61
61
  );
62
- }, h = (e) => {
63
- e && k(e);
62
+ }, m = (e) => {
63
+ e && C(e);
64
64
  };
65
- return y(
65
+ return v(
66
66
  () => o.value,
67
67
  (e) => {
68
68
  var t, a;
69
- e && ((t = l.value) != null && t.url) && h((a = l.value) == null ? void 0 : a.url);
69
+ e && ((t = l.value) != null && t.url) && m((a = l.value) == null ? void 0 : a.url);
70
70
  }
71
- ), y(
71
+ ), v(
72
72
  () => {
73
73
  var e;
74
74
  return (e = l.value) == null ? void 0 : e.url;
75
75
  },
76
76
  (e, t) => {
77
- e && e !== t && h(e);
77
+ e && e !== t && m(e);
78
78
  }
79
- ), (e, t) => (g(), R(w, {
79
+ ), v(
80
+ () => {
81
+ var e;
82
+ return (e = o.value) == null ? void 0 : e.path;
83
+ },
84
+ (e) => {
85
+ e && m(e);
86
+ }
87
+ ), (e, t) => (g(), x(w, {
80
88
  itemCount: c.value.length
81
89
  }, {
82
- title: $(() => [
83
- b(q(e.title), 1)
90
+ title: R(() => [
91
+ _(q(e.title), 1)
84
92
  ]),
85
- default: $(() => [
86
- c.value.length ? (g(), R(N, {
93
+ default: R(() => [
94
+ c.value.length ? (g(), x(N, {
87
95
  key: 0,
88
96
  class: "flex-1",
89
- isEnabledHidden: "",
97
+ columns: ["32px", "", ""],
98
+ hasCheckboxDisabled: "",
90
99
  items: c.value,
91
- onUpdateRow: K
100
+ onUpdateRow: k
92
101
  }, null, 8, ["items"])) : V("", !0)
93
102
  ]),
94
103
  _: 1
@@ -1,8 +1,8 @@
1
1
  import type { RequestExampleParameter } from '@scalar/oas-utils/entities/spec';
2
2
  type __VLS_Props = {
3
3
  items?: RequestExampleParameter[];
4
- /** Hide the enabled column */
5
- isEnabledHidden?: boolean;
4
+ /** Disable the checkbox */
5
+ hasCheckboxDisabled?: boolean;
6
6
  showUploadButton?: boolean;
7
7
  };
8
8
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
@@ -24,7 +24,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
24
24
  onUploadFile?: ((idx: number) => any) | undefined;
25
25
  onRemoveFile?: ((idx: number) => any) | undefined;
26
26
  }>, {
27
- isEnabledHidden: boolean;
27
+ hasCheckboxDisabled: boolean;
28
28
  showUploadButton: boolean;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
30
30
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AAiNA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAO9E,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,uBAAuB,EAAE,CAAA;IACjC,8BAA8B;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC;;;;;;;;;;;;;;;;;;;;qBAFkB,OAAO;sBACN,OAAO;;AA8a9B,wBASG"}
1
+ {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AAiNA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAO9E,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,uBAAuB,EAAE,CAAA;IACjC,2BAA2B;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC;;;;;;;;;;;;;;;;;;;;yBAFsB,OAAO;sBACV,OAAO;;AA4a9B,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-79278ac7"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d205bf31"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };