@scalar/api-client 2.0.43 → 2.0.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 (87) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +77 -69
  5. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  6. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  7. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  8. package/dist/components/ContextBar.vue.js +5 -23
  9. package/dist/components/ContextBar.vue2.js +25 -2
  10. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +1 -1
  11. package/dist/components/Form/Form.vue.d.ts +12 -3
  12. package/dist/components/Form/Form.vue.d.ts.map +1 -1
  13. package/dist/components/Form/Form.vue.js +24 -24
  14. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  15. package/dist/components/HttpMethod/HttpMethod.vue.js +25 -22
  16. package/dist/components/SideNav/SideHelp.vue.js +1 -1
  17. package/dist/components/SideNav/SideNavLink.vue.js +2 -2
  18. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  19. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  20. package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
  21. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  22. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  23. package/dist/components/Sidebar/SidebarListElement.vue2.js +21 -21
  24. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  25. package/dist/components/Sidebar/SidebarListElementActions.vue.js +19 -18
  26. package/dist/components/Sidebar/SidebarToggle.vue.js +1 -1
  27. package/dist/components/SubpageHeader.vue.d.ts.map +1 -1
  28. package/dist/components/SubpageHeader.vue.js +3 -3
  29. package/dist/components/SubpageHeader.vue2.js +7 -7
  30. package/dist/components/TopNav/TopNav.vue.js +2 -2
  31. package/dist/components/TopNav/TopNav.vue2.js +2 -2
  32. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  33. package/dist/components/TopNav/TopNavItem.vue.js +2 -2
  34. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  35. package/dist/components/ViewLayout/ViewLayout.vue.js +6 -6
  36. package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -1
  37. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
  38. package/dist/errors.d.ts +5 -0
  39. package/dist/errors.d.ts.map +1 -0
  40. package/dist/errors.js +7 -0
  41. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  42. package/dist/layouts/App/create-api-client-app.d.ts +36 -36
  43. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  44. package/dist/layouts/Modal/create-api-client-modal.d.ts +72 -72
  45. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  46. package/dist/layouts/Modal/create-api-client-modal.js +26 -18
  47. package/dist/libs/create-client.d.ts +39 -37
  48. package/dist/libs/create-client.d.ts.map +1 -1
  49. package/dist/libs/eventBusses/index.d.ts +1 -0
  50. package/dist/libs/eventBusses/index.d.ts.map +1 -1
  51. package/dist/libs/eventBusses/index.js +3 -1
  52. package/dist/libs/eventBusses/requestStatusBus.d.ts +5 -0
  53. package/dist/libs/eventBusses/requestStatusBus.d.ts.map +1 -0
  54. package/dist/libs/eventBusses/requestStatusBus.js +5 -0
  55. package/dist/libs/index.js +7 -5
  56. package/dist/libs/sendRequest.d.ts +2 -0
  57. package/dist/libs/sendRequest.d.ts.map +1 -1
  58. package/dist/libs/sendRequest.js +46 -37
  59. package/dist/store/workspace.d.ts +121 -120
  60. package/dist/store/workspace.d.ts.map +1 -1
  61. package/dist/store/workspace.js +274 -274
  62. package/dist/style.css +1 -1
  63. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  64. package/dist/views/Cookies/CookieForm.vue.js +34 -17
  65. package/dist/views/Cookies/Cookies.vue2.js +9 -9
  66. package/dist/views/Environment/Environment.vue2.js +24 -24
  67. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  68. package/dist/views/Request/Request.vue.js +2 -2
  69. package/dist/views/Request/Request.vue2.js +170 -166
  70. package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
  71. package/dist/views/Request/RequestSection/RequestAuth.vue.js +2 -2
  72. package/dist/views/Request/RequestSection/RequestAuth.vue2.js +115 -126
  73. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  74. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +63 -42
  75. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  76. package/dist/views/Request/RequestSection/RequestSection.vue.js +69 -51
  77. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  78. package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
  79. package/dist/views/Request/RequestSection/RequestTable.vue2.js +47 -44
  80. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  81. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +30 -28
  82. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  83. package/dist/views/Request/RequestSidebarItem.vue2.js +4 -4
  84. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +18 -18
  85. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  86. package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
  87. package/package.json +4 -4
@@ -1,44 +1,44 @@
1
- import { defineComponent as H, ref as E, computed as I, openBlock as i, createBlock as b, withCtx as a, createElementVNode as _, toDisplayString as k, createVNode as u, unref as n, createElementBlock as p, Fragment as v, renderList as A, createTextVNode as f, withModifiers as B, createCommentVNode as $, capitalize as F, pushScopeId as K, popScopeId as L } from "vue";
2
- import G from "../../../components/DataTable/DataTableCell.vue.js";
3
- import J from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
4
- import { useWorkspace as X } from "../../../store/workspace.js";
5
- import x from "./RequestAuthDataTableInput.vue.js";
6
- import { ScalarComboboxMultiselect as Y, ScalarButton as W, ScalarIcon as P } from "@scalar/components";
7
- import { camelToTitleWords as Z } from "@scalar/oas-utils/helpers";
8
- import { ADD_AUTH_OPTIONS as ee, ADD_AUTH_DICT as te } from "../consts/new-auth-options.js";
9
- import le from "../../../components/DataTable/DataTable.vue.js";
10
- import m from "../../../components/DataTable/DataTableRow.vue.js";
11
- import ae from "../../../components/DataTable/DataTableHeader.vue.js";
12
- import oe from "../components/OAuth2.vue.js";
13
- const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex gap-1" }, ne = /* @__PURE__ */ w(() => /* @__PURE__ */ _("div", { class: "text-c-2 h-8 flex min-w-[120px] items-center border-r-1/2 pr-0 pl-2" }, " Auth Type ", -1)), ie = {
1
+ import { defineComponent as j, ref as z, computed as I, openBlock as i, createBlock as k, withCtx as a, createElementVNode as h, toDisplayString as U, createVNode as u, unref as n, createElementBlock as c, Fragment as v, renderList as B, createTextVNode as p, withModifiers as E, createCommentVNode as w, capitalize as W, pushScopeId as H, popScopeId as Q } from "vue";
2
+ import K from "../../../components/DataTable/DataTableCell.vue.js";
3
+ import L from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
4
+ import { useWorkspace as G } from "../../../store/workspace.js";
5
+ import V from "./RequestAuthDataTableInput.vue.js";
6
+ import { ScalarComboboxMultiselect as J, ScalarButton as X, ScalarIcon as O } from "@scalar/components";
7
+ import { camelToTitleWords as Y } from "@scalar/oas-utils/helpers";
8
+ import { ADD_AUTH_OPTIONS as Z, ADD_AUTH_DICT as ee } from "../consts/new-auth-options.js";
9
+ import te from "../../../components/DataTable/DataTable.vue.js";
10
+ import f from "../../../components/DataTable/DataTableRow.vue.js";
11
+ import le from "../../../components/DataTable/DataTableHeader.vue.js";
12
+ import ae from "../components/OAuth2.vue.js";
13
+ const C = (S) => (H("data-v-24e41ef0"), S = S(), Q(), S), oe = { class: "flex gap-1" }, ue = /* @__PURE__ */ C(() => /* @__PURE__ */ h("div", { class: "text-c-2 h-8 flex min-w-[120px] items-center border-r-1/2 pr-0 pl-2" }, " Auth Type ", -1)), ne = {
14
14
  key: 0,
15
15
  class: "flex relative scroll-timeline-x w-full"
16
- }, de = /* @__PURE__ */ w(() => /* @__PURE__ */ _("div", { class: "fade-left" }, null, -1)), re = { class: "flex flex-1 gap-0.75 mr-1.5" }, se = /* @__PURE__ */ w(() => /* @__PURE__ */ _("div", { class: "fade-right" }, null, -1)), ce = {
16
+ }, ie = /* @__PURE__ */ C(() => /* @__PURE__ */ h("div", { class: "fade-left" }, null, -1)), de = { class: "flex flex-1 gap-0.75 mr-1.5 items-center" }, re = /* @__PURE__ */ C(() => /* @__PURE__ */ h("div", { class: "fade-right" }, null, -1)), se = {
17
17
  key: 1,
18
18
  class: "pl-2"
19
- }, pe = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/delete:opacity-100 request-meta-buttons pr-2" }, Ue = /* @__PURE__ */ H({
19
+ }, Se = /* @__PURE__ */ j({
20
20
  __name: "RequestAuth",
21
21
  props: {
22
22
  title: {}
23
23
  },
24
- setup(h) {
24
+ setup(S) {
25
25
  const {
26
- activeCollection: S,
27
- activeRequest: V,
26
+ activeCollection: g,
27
+ activeRequest: b,
28
28
  activeSecurityRequirements: q,
29
- activeSecuritySchemes: C,
30
- isReadOnly: g,
31
- requestMutators: O,
32
- securitySchemeMutators: U,
33
- securitySchemes: T
34
- } = X(), D = E(null), R = (l) => {
29
+ activeSecuritySchemes: T,
30
+ isReadOnly: $,
31
+ requestMutators: F,
32
+ securitySchemeMutators: D,
33
+ securitySchemes: N
34
+ } = G(), R = z(null), A = (l) => {
35
35
  switch (l == null ? void 0 : l.type) {
36
36
  case "apiKey":
37
- return `${F(l.in)}`;
37
+ return `${W(l.in)}`;
38
38
  case "http":
39
- return `${F(l.scheme)} Authentication`;
39
+ return `${W(l.scheme)} Authentication`;
40
40
  case "oauth2":
41
- return Z(l.flow.type);
41
+ return Y(l.flow.type);
42
42
  case "openIdConnect":
43
43
  return "Open ID Connect";
44
44
  default:
@@ -47,34 +47,36 @@ const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex ga
47
47
  }, M = I(
48
48
  () => {
49
49
  var e;
50
- const l = (e = S.value) == null ? void 0 : e.securitySchemeDict, o = q.value.flatMap((r) => {
50
+ const l = (e = g.value) == null ? void 0 : e.securitySchemeDict, o = q.value.flatMap((r) => {
51
51
  const t = Object.keys(r);
52
- return t.length === 0 && g.value ? { id: "none", label: "None", labelWithoutId: "None" } : t.flatMap((s) => {
52
+ return t.length === 0 && $.value ? { id: "none", label: "None", labelWithoutId: "None" } : t.flatMap((m) => {
53
53
  if (!l) return [];
54
- const c = l[s], z = T[c], N = R(z);
54
+ const s = l[m], y = N[s], x = A(y);
55
55
  return {
56
- id: c,
57
- label: `${N} (${s})`,
58
- labelWithoutId: N
56
+ id: s,
57
+ label: `${x} (${m})`,
58
+ labelWithoutId: x
59
59
  };
60
60
  });
61
61
  });
62
- if (g.value)
62
+ if ($.value)
63
63
  return o;
64
64
  {
65
- const r = V.value.securitySchemeUids.map((t) => {
66
- const s = T[t], c = R(s);
65
+ const r = b.value.securitySchemeUids.map((s) => {
66
+ const y = N[s], x = A(y);
67
67
  return {
68
- id: t,
69
- label: "name" in s && s.name.length ? `${c} (${s.name})` : c,
70
- labelWithoutId: c
68
+ id: s,
69
+ label: "name" in y && y.name.length ? `${x} (${y.name})` : x,
70
+ labelWithoutId: x
71
71
  };
72
- });
72
+ }), t = b.value.selectedSecuritySchemeUids, m = r.filter(
73
+ (s) => t.includes(s.id)
74
+ );
73
75
  return [
74
- { label: "Select auth", options: [...o, ...r] },
76
+ { label: "Select auth", options: [...o, ...m] },
75
77
  {
76
78
  label: "Add new auth",
77
- options: ee
79
+ options: Z
78
80
  }
79
81
  ];
80
82
  }
@@ -86,57 +88,57 @@ const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex ga
86
88
  ).filter(
87
89
  ({ id: o }) => {
88
90
  var e, r;
89
- return (r = (e = V.value) == null ? void 0 : e.selectedSecuritySchemeUids) == null ? void 0 : r.find(
91
+ return (r = (e = b.value) == null ? void 0 : e.selectedSecuritySchemeUids) == null ? void 0 : r.find(
90
92
  (t) => t === o
91
93
  );
92
94
  }
93
95
  ),
94
96
  // Update the selected auth per this request
95
97
  set: (l) => {
96
- var e, r, t, s;
98
+ var e, r, t, m;
97
99
  const o = l.find(
98
- (c) => te[c.id]
100
+ (s) => ee[s.id]
99
101
  );
100
- o != null && o.payload && S.value ? ((s = (t = (r = (e = D.value) == null ? void 0 : e.comboboxPopoverRef) == null ? void 0 : r.popoverButtonRef) == null ? void 0 : t.el) == null || s.click(), U.add(
102
+ o != null && o.payload && g.value ? ((m = (t = (r = (e = R.value) == null ? void 0 : e.comboboxPopoverRef) == null ? void 0 : r.popoverButtonRef) == null ? void 0 : t.el) == null || m.click(), D.add(
101
103
  o.payload,
102
- S.value.uid,
103
- V.value,
104
+ g.value.uid,
105
+ b.value,
104
106
  !0
105
- )) : O.edit(
106
- V.value.uid,
107
+ )) : F.edit(
108
+ b.value.uid,
107
109
  "selectedSecuritySchemeUids",
108
- l.map((c) => c.id)
110
+ l.map((s) => s.id)
109
111
  );
110
112
  }
111
- }), y = (l, o, e) => U.edit(l.uid ?? "", o, e);
113
+ }), _ = (l, o, e) => D.edit(l.uid ?? "", o, e);
112
114
  I(() => d.value.length > 1 ? d.value.map(({ labelWithoutId: l }) => l).join(", ") : d.value.length ? d.value[0].label : "None");
113
- const Q = (l) => U.delete(l, V.value), j = (l) => {
115
+ const P = (l) => {
114
116
  const o = d.value.filter(
115
117
  (e) => e.id !== l
116
118
  );
117
119
  d.value = o;
118
120
  };
119
- return (l, o) => (i(), b(J, {
121
+ return (l, o) => (i(), k(L, {
120
122
  class: "group/params",
121
123
  itemCount: d.value.length
122
124
  }, {
123
125
  title: a(() => [
124
- _("div", ue, k(l.title), 1)
126
+ h("div", oe, U(l.title), 1)
125
127
  ]),
126
128
  default: a(() => [
127
- _("form", null, [
128
- u(n(le), {
129
+ h("form", null, [
130
+ u(n(te), {
129
131
  class: "flex-1",
130
132
  columns: [""]
131
133
  }, {
132
134
  default: a(() => [
133
- u(n(m), null, {
135
+ u(n(f), null, {
134
136
  default: a(() => [
135
- u(n(ae), { class: "relative col-span-full cursor-pointer py-[0px] px-[0px] flex items-center" }, {
137
+ u(n(le), { class: "relative col-span-full cursor-pointer py-[0px] px-[0px] flex items-center" }, {
136
138
  default: a(() => [
137
- u(n(Y), {
139
+ u(n(J), {
138
140
  ref_key: "comboboxRef",
139
- ref: D,
141
+ ref: R,
140
142
  modelValue: d.value,
141
143
  "onUpdate:modelValue": o[0] || (o[0] = (e) => d.value = e),
142
144
  class: "text-xs w-full",
@@ -147,32 +149,32 @@ const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex ga
147
149
  teleport: ""
148
150
  }, {
149
151
  default: a(() => [
150
- u(n(W), {
152
+ u(n(X), {
151
153
  class: "h-auto py-0 px-0 text-c-2 hover:text-c-1 font-normal justify-start",
152
154
  fullWidth: "",
153
155
  variant: "ghost"
154
156
  }, {
155
157
  default: a(() => [
156
- ne,
157
- d.value.length ? (i(), p("div", ie, [
158
- de,
159
- _("div", re, [
160
- (i(!0), p(v, null, A(d.value, (e) => (i(), p("span", {
158
+ ue,
159
+ d.value.length ? (i(), c("div", ne, [
160
+ ie,
161
+ h("div", de, [
162
+ (i(!0), c(v, null, B(d.value, (e) => (i(), c("span", {
161
163
  key: e.id,
162
- class: "cm-pill flex items-center mx-0"
164
+ class: "cm-pill flex items-center mx-0 h-fit"
163
165
  }, [
164
- f(k(e.labelWithoutId) + " ", 1),
165
- u(n(P), {
166
- class: "ml-1 cursor-pointer hover:text-c-1",
166
+ p(U(e.labelWithoutId) + " ", 1),
167
+ u(n(O), {
168
+ class: "ml-1 cursor-pointer text-c-3 hover:text-c-1",
167
169
  icon: "Close",
168
170
  size: "xs",
169
- onClick: B((r) => j(e.id), ["stop"])
171
+ onClick: E((r) => P(e.id), ["stop"])
170
172
  }, null, 8, ["onClick"])
171
173
  ]))), 128))
172
174
  ]),
173
- se
174
- ])) : (i(), p("div", ce, " None ")),
175
- u(n(P), {
175
+ re
176
+ ])) : (i(), c("div", se, " None ")),
177
+ u(n(O), {
176
178
  class: "min-w-3 ml-auto mr-2.5",
177
179
  icon: "ChevronDown",
178
180
  size: "xs"
@@ -189,136 +191,123 @@ const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex ga
189
191
  ]),
190
192
  _: 1
191
193
  }),
192
- (i(!0), p(v, null, A(n(C), (e, r) => (i(), p(v, {
194
+ (i(!0), c(v, null, B(n(T), (e, r) => (i(), c(v, {
193
195
  key: e.uid
194
196
  }, [
195
- n(C).length > 1 ? (i(), b(n(m), {
197
+ n(T).length > 1 ? (i(), k(n(f), {
196
198
  key: 0,
197
199
  class: "group/delete"
198
200
  }, {
199
201
  default: a(() => [
200
- u(G, { class: "text-c-2 pl-2 text-xs font-medium flex items-center justify-between bg-b-2" }, {
202
+ u(K, { class: "text-c-2 pl-2 text-xs font-medium flex items-center bg-b-2" }, {
201
203
  default: a(() => {
202
204
  var t;
203
205
  return [
204
- f(k((t = d.value[r]) == null ? void 0 : t.label) + " ", 1),
205
- _("div", pe, [
206
- u(n(W), {
207
- class: "px-1 transition-none",
208
- size: "sm",
209
- variant: "ghost",
210
- onClick: B((s) => Q(e), ["stop"])
211
- }, {
212
- default: a(() => [
213
- f(" Delete ")
214
- ]),
215
- _: 2
216
- }, 1032, ["onClick"])
217
- ])
206
+ p(U((t = d.value[r]) == null ? void 0 : t.label), 1)
218
207
  ];
219
208
  }),
220
209
  _: 2
221
210
  }, 1024)
222
211
  ]),
223
212
  _: 2
224
- }, 1024)) : $("", !0),
225
- e.type === "http" ? (i(), p(v, { key: 1 }, [
226
- e.scheme === "bearer" ? (i(), b(n(m), { key: 0 }, {
213
+ }, 1024)) : w("", !0),
214
+ e.type === "http" ? (i(), c(v, { key: 1 }, [
215
+ e.scheme === "bearer" ? (i(), k(n(f), { key: 0 }, {
227
216
  default: a(() => [
228
- u(x, {
217
+ u(V, {
229
218
  id: `http-bearer-token-${e.uid}`,
230
219
  modelValue: e.value,
231
- placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
220
+ placeholder: "Token",
232
221
  type: "password",
233
- "onUpdate:modelValue": (t) => y(e, "value", t)
222
+ "onUpdate:modelValue": (t) => _(e, "value", t)
234
223
  }, {
235
224
  default: a(() => [
236
- f(" Bearer Token ")
225
+ p(" Bearer Token ")
237
226
  ]),
238
227
  _: 2
239
228
  }, 1032, ["id", "modelValue", "onUpdate:modelValue"])
240
229
  ]),
241
230
  _: 2
242
- }, 1024)) : e.scheme === "basic" ? (i(), p(v, { key: 1 }, [
243
- u(n(m), null, {
231
+ }, 1024)) : e.scheme === "basic" ? (i(), c(v, { key: 1 }, [
232
+ u(n(f), null, {
244
233
  default: a(() => [
245
- u(x, {
234
+ u(V, {
246
235
  id: `http-basic-username-${e.uid}`,
247
236
  class: "text-c-2",
248
237
  modelValue: e.value,
249
238
  placeholder: "ScalarEnjoyer01",
250
239
  required: "",
251
- "onUpdate:modelValue": (t) => y(e, "value", t)
240
+ "onUpdate:modelValue": (t) => _(e, "value", t)
252
241
  }, {
253
242
  default: a(() => [
254
- f(" Username ")
243
+ p(" Username ")
255
244
  ]),
256
245
  _: 2
257
246
  }, 1032, ["id", "modelValue", "onUpdate:modelValue"])
258
247
  ]),
259
248
  _: 2
260
249
  }, 1024),
261
- u(n(m), null, {
250
+ u(n(f), null, {
262
251
  default: a(() => [
263
- u(x, {
252
+ u(V, {
264
253
  id: `http-basic-password-${e.uid}`,
265
254
  modelValue: e.secondValue,
266
255
  placeholder: "xxxxxx",
267
256
  type: "password",
268
- "onUpdate:modelValue": (t) => y(e, "secondValue", t)
257
+ "onUpdate:modelValue": (t) => _(e, "secondValue", t)
269
258
  }, {
270
259
  default: a(() => [
271
- f(" Password ")
260
+ p(" Password ")
272
261
  ]),
273
262
  _: 2
274
263
  }, 1032, ["id", "modelValue", "onUpdate:modelValue"])
275
264
  ]),
276
265
  _: 2
277
266
  }, 1024)
278
- ], 64)) : $("", !0)
279
- ], 64)) : e.type === "apiKey" ? (i(), p(v, { key: 2 }, [
280
- n(g) ? (i(), b(n(m), { key: 1 }, {
267
+ ], 64)) : w("", !0)
268
+ ], 64)) : e.type === "apiKey" ? (i(), c(v, { key: 2 }, [
269
+ n($) ? (i(), k(n(f), { key: 1 }, {
281
270
  default: a(() => [
282
- u(x, {
271
+ u(V, {
283
272
  id: `api-key-value-${e.uid}`,
284
273
  modelValue: e.value,
285
274
  placeholder: "Value",
286
- "onUpdate:modelValue": (t) => y(e, "value", t)
275
+ "onUpdate:modelValue": (t) => _(e, "value", t)
287
276
  }, {
288
277
  default: a(() => [
289
- f(k(e.name), 1)
278
+ p(U(e.name), 1)
290
279
  ]),
291
280
  _: 2
292
281
  }, 1032, ["id", "modelValue", "onUpdate:modelValue"])
293
282
  ]),
294
283
  _: 2
295
- }, 1024)) : (i(), p(v, { key: 0 }, [
296
- u(n(m), null, {
284
+ }, 1024)) : (i(), c(v, { key: 0 }, [
285
+ u(n(f), null, {
297
286
  default: a(() => [
298
- u(x, {
287
+ u(V, {
299
288
  id: `api-key-name-${e.uid}`,
300
289
  modelValue: e.name,
301
290
  placeholder: "api-key",
302
- "onUpdate:modelValue": (t) => y(e, "name", t)
291
+ "onUpdate:modelValue": (t) => _(e, "name", t)
303
292
  }, {
304
293
  default: a(() => [
305
- f(" Name ")
294
+ p(" Name ")
306
295
  ]),
307
296
  _: 2
308
297
  }, 1032, ["id", "modelValue", "onUpdate:modelValue"])
309
298
  ]),
310
299
  _: 2
311
300
  }, 1024),
312
- u(n(m), null, {
301
+ u(n(f), null, {
313
302
  default: a(() => [
314
- u(x, {
303
+ u(V, {
315
304
  id: `api-key-value-add-${e.uid}`,
316
305
  modelValue: e.value,
317
306
  placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
318
- "onUpdate:modelValue": (t) => y(e, "value", t)
307
+ "onUpdate:modelValue": (t) => _(e, "value", t)
319
308
  }, {
320
309
  default: a(() => [
321
- f(" Value ")
310
+ p(" Value ")
322
311
  ]),
323
312
  _: 2
324
313
  }, 1032, ["id", "modelValue", "onUpdate:modelValue"])
@@ -326,10 +315,10 @@ const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex ga
326
315
  _: 2
327
316
  }, 1024)
328
317
  ], 64))
329
- ], 64)) : e.type === "oauth2" ? (i(), b(n(oe), {
318
+ ], 64)) : e.type === "oauth2" ? (i(), k(n(ae), {
330
319
  key: 3,
331
320
  scheme: e
332
- }, null, 8, ["scheme"])) : $("", !0)
321
+ }, null, 8, ["scheme"])) : w("", !0)
333
322
  ], 64))), 128))
334
323
  ]),
335
324
  _: 1
@@ -341,5 +330,5 @@ const w = (h) => (K("data-v-411d2b35"), h = h(), L(), h), ue = { class: "flex ga
341
330
  }
342
331
  });
343
332
  export {
344
- Ue as default
333
+ Se as default
345
334
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestPathParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestPathParams.vue"],"names":[],"mappings":"AA0FA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAA;;WAMtE,MAAM;cACH,MAAM,cAAc,CAAC,YAAY,CAAC;;WADrC,MAAM;cACH,MAAM,cAAc,CAAC,YAAY,CAAC;;AAuJ9C,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"RequestPathParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestPathParams.vue"],"names":[],"mappings":"AAgIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAA;;WAMtE,MAAM;cACH,MAAM,cAAc,CAAC,YAAY,CAAC;;WADrC,MAAM;cACH,MAAM,cAAc,CAAC,YAAY,CAAC;;AA6L9C,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,68 +1,89 @@
1
- import { defineComponent as $, computed as k, openBlock as l, createBlock as f, withCtx as v, createTextVNode as y, toDisplayString as C, createElementBlock as E, createElementVNode as K } from "vue";
2
- import q from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
- import { useWorkspace as w } from "../../../store/workspace.js";
4
- import P from "./RequestTable.vue.js";
5
- const U = {
1
+ import { defineComponent as K, computed as R, watch as E, openBlock as d, createBlock as f, withCtx as y, createTextVNode as g, toDisplayString as q, createElementBlock as C, createElementVNode as w } from "vue";
2
+ import P from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
+ import { useWorkspace as M } from "../../../store/workspace.js";
4
+ import V from "./RequestTable.vue.js";
5
+ const B = {
6
6
  key: 1,
7
7
  class: "text-c-3 px-4 text-sm border rounded min-h-12 justify-center flex items-center bg-b-1 mx-1"
8
- }, B = /* @__PURE__ */ K("code", { class: "bg-b-2 ml-1 px-1 rounded" }, "/endpoint/{my_path_variable}", -1), j = /* @__PURE__ */ $({
8
+ }, N = /* @__PURE__ */ w("code", { class: "bg-b-2 ml-1 px-1 rounded" }, "/endpoint/{my_path_variable}", -1), H = /* @__PURE__ */ K({
9
9
  __name: "RequestPathParams",
10
10
  props: {
11
11
  title: {},
12
12
  paramKey: {}
13
13
  },
14
14
  setup(_) {
15
- const o = _, {
16
- activeRequest: t,
17
- activeExample: a,
18
- requestMutators: m,
19
- requestExampleMutators: x
20
- } = w(), n = k(
15
+ const s = _, {
16
+ activeRequest: o,
17
+ activeExample: r,
18
+ requestMutators: h,
19
+ requestExampleMutators: v
20
+ } = M(), u = R(
21
21
  () => {
22
22
  var e;
23
- return ((e = a.value) == null ? void 0 : e.parameters[o.paramKey]) ?? [];
23
+ return ((e = r.value) == null ? void 0 : e.parameters[s.paramKey]) ?? [];
24
24
  }
25
- ), g = (e, r, s) => {
26
- var d, h;
27
- if (!t.value || !a.value) return;
28
- const c = a.value.parameters[o.paramKey], u = (d = c[e]) == null ? void 0 : d.key;
29
- if (r === "key") {
30
- if ((h = c[e]) != null && h.required)
25
+ ), x = (e, n, a) => {
26
+ var p, t;
27
+ if (!o.value || !r.value) return;
28
+ const c = r.value.parameters[s.paramKey], l = (p = c[e]) == null ? void 0 : p.key;
29
+ if (n === "key") {
30
+ if ((t = c[e]) != null && t.required)
31
31
  return;
32
- if (s) {
33
- const p = encodeURIComponent(u), i = encodeURIComponent(s), R = new RegExp(`(?<=/):${p}(?=[/?#]|$)`, "g"), b = t.value.path.replace(
34
- R,
35
- `:${i}`
32
+ if (a) {
33
+ const i = encodeURIComponent(l), m = encodeURIComponent(a), $ = new RegExp(`(?<=/):${i}(?=[/?#]|$)`, "g"), k = o.value.path.replace(
34
+ $,
35
+ `:${m}`
36
36
  );
37
- m.edit(t.value.uid, "path", b);
37
+ h.edit(o.value.uid, "path", k);
38
38
  } else {
39
39
  c.splice(e, 1);
40
- const p = new RegExp(`/:${encodeURIComponent(u)}(?=[/?#]|$)`, "g"), i = t.value.path.replace(p, "");
41
- m.edit(t.value.uid, "path", i);
40
+ const i = new RegExp(`/:${encodeURIComponent(l)}(?=[/?#]|$)`, "g"), m = o.value.path.replace(i, "");
41
+ h.edit(o.value.uid, "path", m);
42
42
  }
43
43
  }
44
- x.edit(
45
- a.value.uid,
46
- `parameters.${o.paramKey}.${e}.${r}`,
47
- s
44
+ v.edit(
45
+ r.value.uid,
46
+ `parameters.${s.paramKey}.${e}.${n}`,
47
+ a
48
+ );
49
+ }, b = (e) => {
50
+ var p;
51
+ if (!r.value) return;
52
+ const n = ((p = e.match(new RegExp("(?<!{){([^{}]+)}(?!})", "g"))) == null ? void 0 : p.map((t) => t.slice(1, -1))) || [], a = r.value.parameters[s.paramKey], c = new Map(a.map((t) => [t.key, t])), l = n.map(
53
+ (t) => c.get(t) || { key: t, value: "", enabled: !0 }
54
+ );
55
+ a.forEach((t) => {
56
+ !n.includes(t.key) && (t.value || t.required) && l.push(t);
57
+ }), a.splice(0, a.length, ...l), v.edit(
58
+ r.value.uid,
59
+ `parameters.${s.paramKey}`,
60
+ a
48
61
  );
49
62
  };
50
- return (e, r) => (l(), f(q, {
51
- itemCount: n.value.length
63
+ return E(
64
+ () => {
65
+ var e;
66
+ return (e = r.value) == null ? void 0 : e.url;
67
+ },
68
+ (e) => {
69
+ e && b(e);
70
+ }
71
+ ), (e, n) => (d(), f(P, {
72
+ itemCount: u.value.length
52
73
  }, {
53
- title: v(() => [
54
- y(C(e.title), 1)
74
+ title: y(() => [
75
+ g(q(e.title), 1)
55
76
  ]),
56
- default: v(() => [
57
- n.value.length ? (l(), f(P, {
77
+ default: y(() => [
78
+ u.value.length ? (d(), f(V, {
58
79
  key: 0,
59
80
  class: "flex-1",
60
81
  isEnabledHidden: "",
61
- items: n.value,
62
- onUpdateRow: g
63
- }, null, 8, ["items"])) : (l(), E("div", U, [
64
- y(" You can use variables in your path: "),
65
- B
82
+ items: u.value,
83
+ onUpdateRow: x
84
+ }, null, 8, ["items"])) : (d(), C("div", B, [
85
+ g(" You can use variables in your path: "),
86
+ N
66
87
  ]))
67
88
  ]),
68
89
  _: 1
@@ -70,5 +91,5 @@ const U = {
70
91
  }
71
92
  });
72
93
  export {
73
- j as default
94
+ H as default
74
95
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":";AAgYA,wBAKG"}
1
+ {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":";AA8aA,wBAKG"}