@scalar/api-client 2.2.34 → 2.2.37

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 (89) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
  3. package/dist/components/AddressBar/AddressBarHistory.vue2.js +18 -18
  4. package/dist/components/CodeInput/CodeInput.vue.d.ts +3 -0
  5. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  6. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  7. package/dist/components/CodeInput/CodeInput.vue2.js +114 -108
  8. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +1 -0
  9. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/CommandActionInput.vue.js +21 -18
  11. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  12. package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
  13. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +2 -2
  14. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  15. package/dist/components/ContextBar.vue.js +1 -1
  16. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  17. package/dist/components/DataTable/DataTableCheckbox.vue.js +20 -15
  18. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  19. package/dist/components/DataTable/DataTableInput.vue.js +2 -2
  20. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  21. package/dist/components/DataTable/DataTableInputSelect.vue.js +43 -43
  22. package/dist/components/Form/Form.vue.d.ts.map +1 -1
  23. package/dist/components/Form/Form.vue.js +3 -3
  24. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  25. package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
  26. package/dist/components/TopNav/TopNav.vue.js +27 -27
  27. package/dist/layouts/App/create-api-client-app.d.ts +4 -58
  28. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  29. package/dist/layouts/Modal/create-api-client-modal.d.ts +8 -116
  30. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  31. package/dist/layouts/Web/create-api-client-web.d.ts +4 -58
  32. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  33. package/dist/libs/create-client.d.ts +4 -58
  34. package/dist/libs/create-client.d.ts.map +1 -1
  35. package/dist/libs/index.js +18 -19
  36. package/dist/libs/send-request/index.js +3 -4
  37. package/dist/libs/send-request/send-request.d.ts +0 -14
  38. package/dist/libs/send-request/send-request.d.ts.map +1 -1
  39. package/dist/libs/send-request/send-request.js +120 -142
  40. package/dist/libs/send-request/set-request-cookies.d.ts +27 -0
  41. package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -0
  42. package/dist/libs/send-request/set-request-cookies.js +54 -0
  43. package/dist/store/active-entities.d.ts.map +1 -1
  44. package/dist/store/active-entities.js +15 -12
  45. package/dist/store/cookies.d.ts +4 -58
  46. package/dist/store/cookies.d.ts.map +1 -1
  47. package/dist/store/cookies.js +5 -17
  48. package/dist/store/store.d.ts +4 -58
  49. package/dist/store/store.d.ts.map +1 -1
  50. package/dist/style.css +1 -1
  51. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  52. package/dist/views/Cookies/CookieForm.vue.js +24 -37
  53. package/dist/views/Cookies/CookieModal.vue.d.ts +21 -0
  54. package/dist/views/Cookies/CookieModal.vue.d.ts.map +1 -0
  55. package/dist/views/Cookies/CookieModal.vue.js +7 -0
  56. package/dist/views/Cookies/CookieModal.vue2.js +88 -0
  57. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  58. package/dist/views/Cookies/Cookies.vue2.js +98 -119
  59. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
  60. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +30 -27
  61. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  62. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  63. package/dist/views/Request/RequestSection/RequestBody.vue2.js +6 -6
  64. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +7 -0
  65. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  66. package/dist/views/Request/RequestSection/RequestParams.vue.js +79 -66
  67. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  68. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +51 -42
  69. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  70. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  71. package/dist/views/Request/RequestSection/RequestSection.vue2.js +90 -64
  72. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +10 -3
  73. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  74. package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
  75. package/dist/views/Request/RequestSection/RequestTable.vue2.js +170 -132
  76. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  77. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +5 -64
  78. package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +46 -2
  79. package/dist/views/Request/ResponseSection/ResponseCookies.vue.js +19 -17
  80. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  81. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +31 -31
  82. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  83. package/dist/views/Request/libs/oauth2.js +1 -1
  84. package/dist/views/Request/libs/request.d.ts +12 -0
  85. package/dist/views/Request/libs/request.d.ts.map +1 -0
  86. package/dist/views/Request/libs/request.js +4 -0
  87. package/package.json +14 -16
  88. package/dist/views/Cookies/CookieRaw.vue.js +0 -28
  89. package/dist/views/Cookies/CookieRaw.vue2.js +0 -4
@@ -16,8 +16,8 @@ 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: {}
@@ -174,14 +174,14 @@ const ve = {
174
174
  encoding: t,
175
175
  value: ((u = o.value.body.formData) == null ? void 0 : u.value) ?? []
176
176
  });
177
- else if (!t) {
177
+ else if (!t && a !== "binary") {
178
178
  const { raw: p, ...h } = o.value.body;
179
179
  i.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"
183
183
  );
184
- r >= 0 ? n && l[r] ? l[r].value = n : l[r] && l.splice(r, 1) : n && l.unshift({
184
+ r >= 0 ? n && l[r] ? l[r].value = n : l[r] && l.splice(r, 1) : n && l.push({
185
185
  key: "Content-Type",
186
186
  value: n,
187
187
  enabled: !0
@@ -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
  }, {
@@ -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,7 +1,14 @@
1
1
  import { type RequestExample } from '@scalar/oas-utils/entities/spec';
2
+ import type { RouteLocationRaw } from 'vue-router';
2
3
  type __VLS_Props = {
3
4
  title: string;
4
5
  paramKey: keyof RequestExample['parameters'];
6
+ readOnlyEntries?: {
7
+ key: string;
8
+ value: string;
9
+ enabled: boolean;
10
+ route: RouteLocationRaw;
11
+ }[];
5
12
  };
6
13
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
14
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AAiNA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAA;AAKxC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;CAC7C,CAAC;;AA4UF,wBAOG"}
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,74 +1,75 @@
1
- import { defineComponent as E, computed as f, onMounted as S, ref as A, watch as N, openBlock as y, createBlock as h, withCtx as n, createTextVNode as k, toDisplayString as R, createElementVNode as o, unref as x, createVNode as b, withModifiers as V, createCommentVNode as z, nextTick as _ } from "vue";
2
- import B from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
- import { useActiveEntities as M } from "../../../store/active-entities.js";
4
- import W from "./RequestTable.vue.js";
5
- import { ScalarTooltip as D, ScalarButton as O } from "@scalar/components";
6
- import { requestExampleParametersSchema as C } from "@scalar/oas-utils/entities/spec";
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";
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
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" }, ee = /* @__PURE__ */ E({
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({
9
9
  __name: "RequestParams",
10
10
  props: {
11
11
  title: {},
12
- paramKey: {}
12
+ paramKey: {},
13
+ readOnlyEntries: {}
13
14
  },
14
- setup(q) {
15
- const r = q, { activeRequest: u, activeExample: s } = M(), { requestExampleMutators: i } = U(), l = f(
15
+ setup(w) {
16
+ const n = w, { activeRequest: u, activeExample: s } = z(), { requestExampleMutators: o } = U(), l = m(
16
17
  () => {
17
18
  var e;
18
- return ((e = s.value) == null ? void 0 : e.parameters[r.paramKey]) ?? [];
19
+ return ((e = s.value) == null ? void 0 : e.parameters[n.paramKey]) ?? [];
19
20
  }
20
21
  );
21
- S(() => {
22
- v();
22
+ N(() => {
23
+ y();
23
24
  });
24
25
  const p = () => {
25
26
  if (!u.value || !s.value) return;
26
- const e = C.parse({ enabled: !1 }), t = [...l.value, e];
27
- i.edit(
27
+ const e = q.parse({ enabled: !1 }), t = [...l.value, e];
28
+ o.edit(
28
29
  s.value.uid,
29
- `parameters.${r.paramKey}`,
30
+ `parameters.${n.paramKey}`,
30
31
  t
31
32
  );
32
- }, m = A(null), w = (e, t, d) => {
33
+ }, c = V(null), P = (e, t, g) => {
33
34
  if (!u.value || !s.value) return;
34
- const c = l.value;
35
- if (c.length > e) {
36
- const a = [...c];
35
+ const f = l.value;
36
+ if (f.length > e) {
37
+ const a = [...f];
37
38
  if (!a[e]) return;
38
- a[e] = { ...a[e], [t]: d }, (a[e].key !== "" || a[e].value !== "") && (a[e].enabled = !0), a[e].key === "" && a[e].value === "" && a.splice(e, 1), i.edit(
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
40
  s.value.uid,
40
- `parameters.${r.paramKey}`,
41
+ `parameters.${n.paramKey}`,
41
42
  a
42
43
  );
43
44
  } else {
44
- const a = [C.parse({ [t]: d })];
45
- i.edit(
45
+ const a = [q.parse({ [t]: g })];
46
+ o.edit(
46
47
  s.value.uid,
47
- `parameters.${r.paramKey}`,
48
+ `parameters.${n.paramKey}`,
48
49
  a
49
- ), _(() => {
50
- var g;
51
- if (!m.value) return;
52
- (g = m.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || g.focus();
50
+ ), E(() => {
51
+ var h;
52
+ if (!c.value) return;
53
+ (h = c.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || h.focus();
53
54
  });
54
55
  }
55
- e === c.length - 1 && p();
56
- }, P = (e, t) => u.value && s.value && i.edit(
56
+ e === f.length - 1 && p();
57
+ }, K = (e, t) => u.value && s.value && o.edit(
57
58
  s.value.uid,
58
- `parameters.${r.paramKey}.${e}.enabled`,
59
+ `parameters.${n.paramKey}.${e}.enabled`,
59
60
  t
60
- ), K = () => {
61
+ ), $ = () => {
61
62
  if (!u.value || !s.value) return;
62
63
  const e = l.value.filter((t) => t.required);
63
- i.edit(
64
+ o.edit(
64
65
  s.value.uid,
65
- `parameters.${r.paramKey}`,
66
+ `parameters.${n.paramKey}`,
66
67
  e
67
- ), _(() => {
68
+ ), E(() => {
68
69
  p();
69
70
  });
70
71
  };
71
- function v() {
72
+ function y() {
72
73
  if (l.value.length === 0)
73
74
  p();
74
75
  else if (l.value.length >= 1) {
@@ -76,65 +77,77 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
76
77
  e && e.key !== "" && e.value !== "" && p();
77
78
  }
78
79
  }
79
- const $ = f(
80
+ const O = m(
80
81
  () => l.value.filter((e) => e.key || e.value).length
81
- ), T = f(() => l.value.length > 1);
82
- return N(
82
+ ), T = m(() => l.value.length > 1);
83
+ B(
83
84
  () => s.value,
84
85
  (e, t) => {
85
- e !== t && v();
86
+ e !== t && y();
86
87
  },
87
88
  { immediate: !0 }
88
- ), (e, t) => (y(), h(B, {
89
+ );
90
+ const S = m(
91
+ () => (n.readOnlyEntries ?? []).length > 0
92
+ );
93
+ return (e, t) => (v(), d(W, {
89
94
  class: "group/params",
90
- itemCount: $.value
95
+ itemCount: O.value
91
96
  }, {
92
- title: n(() => [
93
- k(R(e.title), 1)
97
+ title: r(() => [
98
+ R(k(e.title), 1)
94
99
  ]),
95
- actions: n(() => [
96
- o("div", j, [
97
- T.value ? (y(), h(x(D), {
100
+ actions: r(() => [
101
+ i("div", j, [
102
+ T.value ? (v(), d(b(D), {
98
103
  key: 0,
99
104
  side: "right",
100
105
  sideOffset: 12
101
106
  }, {
102
- trigger: n(() => [
103
- b(x(O), {
107
+ trigger: r(() => [
108
+ x(b(G), {
104
109
  class: "px-1 transition-none",
105
110
  size: "sm",
106
111
  variant: "ghost",
107
- onClick: V(K, ["stop"])
112
+ onClick: M($, ["stop"])
108
113
  }, {
109
- default: n(() => [
110
- t[0] || (t[0] = k(" Clear ")),
111
- o("span", F, "All " + R(e.title), 1)
114
+ default: r(() => [
115
+ t[0] || (t[0] = R(" Clear ")),
116
+ i("span", F, "All " + k(e.title), 1)
112
117
  ]),
113
118
  _: 1
114
119
  })
115
120
  ]),
116
- content: n(() => t[1] || (t[1] = [
117
- o("div", { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 z-context p-2 text-xxs leading-5 z-10 text-c-1" }, [
118
- o("div", { class: "flex items-center text-c-2" }, [
119
- o("span", null, "Clear optional parameters")
121
+ content: r(() => t[1] || (t[1] = [
122
+ i("div", { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 p-2 text-xxs leading-5 z-10 text-c-1" }, [
123
+ i("div", { class: "flex items-center text-c-2" }, [
124
+ i("span", null, "Clear optional parameters")
120
125
  ])
121
126
  ], -1)
122
127
  ])),
123
128
  _: 1
124
- })) : z("", !0)
129
+ })) : C("", !0)
125
130
  ])
126
131
  ]),
127
- default: n(() => [
128
- o("div", {
132
+ default: r(() => [
133
+ i("div", {
129
134
  ref_key: "tableWrapperRef",
130
- ref: m
135
+ ref: c
131
136
  }, [
132
- b(W, {
137
+ S.value ? (v(), d(_, {
138
+ key: 0,
139
+ class: "flex-1",
140
+ columns: ["32px", "", ""],
141
+ isGlobal: "",
142
+ isReadOnly: "",
143
+ items: e.readOnlyEntries
144
+ }, null, 8, ["items"])) : C("", !0),
145
+ x(_, {
133
146
  class: "flex-1",
134
147
  columns: ["32px", "", ""],
135
148
  items: l.value,
136
- onToggleRow: P,
137
- onUpdateRow: w
149
+ onToggleRow: K,
150
+ onUpdateRow: P
138
151
  }, null, 8, ["items"])
139
152
  ], 512)
140
153
  ]),
@@ -143,5 +156,5 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
143
156
  }
144
157
  });
145
158
  export {
146
- ee as default
159
+ te as default
147
160
  };
@@ -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 +1 @@
1
- {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA4KA,KAAK,WAAW,GAAG;IACjB,0BAA0B,EAAE,MAAM,EAAE,CAAA;CACrC,CAAC;;AAkQF,wBAOG"}
1
+ {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA4MA,KAAK,WAAW,GAAG;IACjB,0BAA0B,EAAE,MAAM,EAAE,CAAA;CACrC,CAAC;;AA8RF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestSection.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4daacc06"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-582c4535"]]);
5
5
  export {
6
- r as default
6
+ m as default
7
7
  };