@scalar/api-client 2.2.55 → 2.2.57

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 (84) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBarHistory.vue2.js +53 -54
  5. package/dist/components/CodeInput/CodeInput.vue.d.ts +1 -1
  6. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +3 -19
  8. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  9. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  10. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +154 -129
  11. package/dist/components/DataTable/DataTableInput.vue.d.ts +4 -4
  12. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  13. package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -1
  14. package/dist/components/Sidebar/SidebarToggle.vue.js +17 -16
  15. package/dist/layouts/App/create-api-client-app.d.ts +62 -52
  16. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  17. package/dist/layouts/Modal/create-api-client-modal.d.ts +120 -100
  18. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  19. package/dist/layouts/Modal/create-api-client-modal.js +1 -2
  20. package/dist/layouts/Web/create-api-client-web.d.ts +62 -52
  21. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  22. package/dist/libs/create-client.d.ts +64 -58
  23. package/dist/libs/create-client.d.ts.map +1 -1
  24. package/dist/libs/create-client.js +82 -80
  25. package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
  26. package/dist/libs/extractAttachmentFilename.js +8 -7
  27. package/dist/libs/find-request.d.ts +1 -1
  28. package/dist/libs/find-request.d.ts.map +1 -1
  29. package/dist/libs/hot-keys.d.ts +1 -1
  30. package/dist/libs/hot-keys.d.ts.map +1 -1
  31. package/dist/libs/hot-keys.js +9 -8
  32. package/dist/libs/send-request/create-request-operation.test.d.ts +3 -2
  33. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  34. package/dist/store/active-entities.d.ts +4 -3
  35. package/dist/store/active-entities.d.ts.map +1 -1
  36. package/dist/store/import-spec.d.ts +3 -3
  37. package/dist/store/import-spec.d.ts.map +1 -1
  38. package/dist/store/import-spec.js +4 -1
  39. package/dist/store/request-example.d.ts +22 -12
  40. package/dist/store/request-example.d.ts.map +1 -1
  41. package/dist/store/requests.d.ts +13 -13
  42. package/dist/store/requests.d.ts.map +1 -1
  43. package/dist/store/security-schemes.d.ts +6 -6
  44. package/dist/store/store.d.ts +92 -67
  45. package/dist/store/store.d.ts.map +1 -1
  46. package/dist/store/store.js +12 -12
  47. package/dist/store/workspace.d.ts +12 -12
  48. package/dist/store/workspace.d.ts.map +1 -1
  49. package/dist/style.css +1 -1
  50. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  51. package/dist/views/Request/Request.vue.js +2 -2
  52. package/dist/views/Request/RequestRoot.test.d.ts +2 -0
  53. package/dist/views/Request/RequestRoot.test.d.ts.map +1 -0
  54. package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
  55. package/dist/views/Request/RequestRoot.vue.js +2 -2
  56. package/dist/views/Request/RequestRoot.vue2.js +72 -60
  57. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts +1 -1
  58. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  59. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  60. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  61. package/dist/views/Request/RequestSection/RequestBody.vue2.js +113 -107
  62. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  63. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  64. package/dist/views/Request/RequestSection/RequestSection.vue2.js +37 -37
  65. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  66. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  67. package/dist/views/Request/RequestSection/RequestTable.vue2.js +55 -51
  68. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  69. package/dist/views/Request/RequestSidebar.vue.js +2 -2
  70. package/dist/views/Request/RequestSidebar.vue2.js +171 -166
  71. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  72. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  73. package/dist/views/Request/RequestSidebarItem.vue2.js +187 -180
  74. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  75. package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
  76. package/dist/views/Request/RequestSubpageHeader.vue2.js +41 -49
  77. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  78. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
  79. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +62 -45
  80. package/package.json +13 -13
  81. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +0 -15
  82. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +0 -1
  83. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +0 -176
  84. package/dist/components/CommandPalette/CommandPaletteRequest.vue2.js +0 -4
@@ -1,11 +1,11 @@
1
- import { defineComponent as ee, computed as h, ref as ae, watch as $, openBlock as b, createBlock as g, withCtx as m, createTextVNode as H, toDisplayString as D, createVNode as c, unref as v, createElementVNode as k, createCommentVNode as ne, createElementBlock as E, Fragment as te, nextTick as oe } from "vue";
2
- import { ScalarListbox as X, ScalarButton as R, ScalarIcon as C } from "@scalar/components";
1
+ import { defineComponent as ee, computed as h, ref as ae, watch as A, openBlock as b, createBlock as g, withCtx as m, createTextVNode as H, toDisplayString as F, createVNode as c, unref as v, createElementVNode as k, createCommentVNode as ne, createElementBlock as E, Fragment as te, nextTick as oe } from "vue";
2
+ import { ScalarListbox as X, ScalarButton as D, ScalarIcon as C } from "@scalar/components";
3
3
  import { requestExampleParametersSchema as Y } from "@scalar/oas-utils/entities/spec";
4
4
  import { canMethodHaveBody as le } from "@scalar/oas-utils/helpers";
5
- import re from "../../../components/CodeInput/CodeInput.vue.js";
6
- import ie from "../../../components/DataTable/DataTable.vue.js";
5
+ import ie from "../../../components/CodeInput/CodeInput.vue.js";
6
+ import re from "../../../components/DataTable/DataTable.vue.js";
7
7
  import de from "../../../components/DataTable/DataTableHeader.vue.js";
8
- import P from "../../../components/DataTable/DataTableRow.vue.js";
8
+ import j from "../../../components/DataTable/DataTableRow.vue.js";
9
9
  import ue from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
10
10
  import G from "./RequestTable.vue.js";
11
11
  import { useWorkspace as se } from "../../../store/store.js";
@@ -26,7 +26,7 @@ const me = {
26
26
  workspace: {},
27
27
  title: {}
28
28
  },
29
- setup(t) {
29
+ setup(l) {
30
30
  const { requestExampleMutators: d } = se(), Q = {
31
31
  json: "json",
32
32
  xml: "xml",
@@ -46,75 +46,75 @@ const me = {
46
46
  }).map(([e, a]) => ({
47
47
  id: e,
48
48
  label: a
49
- })), T = h(() => {
49
+ })), R = h(() => {
50
50
  var o;
51
- const { activeBody: e, formData: a, raw: n } = t.example.body;
52
- return e === "formData" ? (a == null ? void 0 : a.encoding) === "urlencoded" ? "formUrlEncoded" : "multipartForm" : e === "binary" ? "binaryFile" : e === "raw" && (n != null && n.encoding) ? n.encoding === "html" ? "other" : n.encoding : Object.keys(((o = t.operation.requestBody) == null ? void 0 : o.content) || {})[0] || "none";
51
+ const { activeBody: e, formData: a, raw: n } = l.example.body;
52
+ return n != null && n.mimeType ? n.mimeType : e === "formData" ? (a == null ? void 0 : a.encoding) === "urlencoded" ? "formUrlEncoded" : "multipartForm" : e === "binary" ? "binaryFile" : e === "raw" && (n != null && n.encoding) ? n.encoding === "html" ? "other" : n.encoding : Object.keys(((o = l.operation.requestBody) == null ? void 0 : o.content) || {})[0] || "none";
53
53
  }), p = h({
54
54
  get: () => x.find(
55
- (e) => e.id === T.value
55
+ (e) => e.id === R.value
56
56
  ) ?? x[x.length - 1] ?? x[0],
57
57
  set: (e) => {
58
- e != null && e.id && M(e.id);
58
+ e != null && e.id && L(e.id);
59
59
  }
60
60
  }), B = ae(null), Z = h(() => {
61
61
  var a;
62
62
  const e = (a = p.value) == null ? void 0 : a.id;
63
63
  return Q[e] ?? "plaintext";
64
64
  });
65
- function N() {
65
+ function P() {
66
66
  console.log("deleteRow");
67
67
  }
68
- const j = (e, a, n) => {
69
- var o, r, s, i, f, F, J;
70
- const l = y.value;
71
- if (l.length > e) {
72
- const u = [...l];
68
+ const N = (e, a, n) => {
69
+ var o, i, s, r, f, V, J;
70
+ const t = y.value;
71
+ if (t.length > e) {
72
+ const u = [...t];
73
73
  u[e] = {
74
74
  ...u[e],
75
75
  value: ((o = u[e]) == null ? void 0 : o.value) || "",
76
- key: ((r = u[e]) == null ? void 0 : r.key) || "",
76
+ key: ((i = u[e]) == null ? void 0 : i.key) || "",
77
77
  enabled: ((s = u[e]) == null ? void 0 : s.enabled) ?? !1,
78
78
  [a]: n || ""
79
- }, (((i = u[e]) == null ? void 0 : i.key) !== "" || ((f = u[e]) == null ? void 0 : f.value) !== "") && (u[e].enabled = !0), ((F = u[e]) == null ? void 0 : F.key) === "" && ((J = u[e]) == null ? void 0 : J.value) === "" && u.splice(e, 1), d.edit(
80
- t.example.uid,
79
+ }, (((r = u[e]) == null ? void 0 : r.key) !== "" || ((f = u[e]) == null ? void 0 : f.value) !== "") && (u[e].enabled = !0), ((V = u[e]) == null ? void 0 : V.key) === "" && ((J = u[e]) == null ? void 0 : J.value) === "" && u.splice(e, 1), d.edit(
80
+ l.example.uid,
81
81
  "body.formData.value",
82
82
  u
83
83
  );
84
84
  } else {
85
85
  const u = [Y.parse({ [a]: n })];
86
- d.edit(t.example.uid, "body.formData.value", u), oe(() => {
87
- var A;
86
+ d.edit(l.example.uid, "body.formData.value", u), oe(() => {
87
+ var $;
88
88
  if (!B.value) return;
89
- (A = B.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || A.focus();
89
+ ($ = B.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || $.focus();
90
90
  });
91
91
  }
92
- e === l.length - 1 && O();
92
+ e === t.length - 1 && O();
93
93
  }, y = h(() => {
94
94
  var e;
95
- return ((e = t.example.body.formData) == null ? void 0 : e.value) ?? [];
96
- }), V = () => {
95
+ return ((e = l.example.body.formData) == null ? void 0 : e.value) ?? [];
96
+ }), T = () => {
97
97
  const e = y.value[y.value.length - 1];
98
98
  (!e || e.key !== "" || e.value !== "") && O();
99
99
  }, O = () => {
100
100
  const e = Y.parse({
101
101
  enabled: !1
102
102
  }), a = [...y.value, e];
103
- t.example.body.formData ? d.edit(t.example.uid, "body.formData.value", a) : d.edit(t.example.uid, "body.formData", {
103
+ l.example.body.formData ? d.edit(l.example.uid, "body.formData.value", a) : d.edit(l.example.uid, "body.formData", {
104
104
  value: a,
105
105
  encoding: "form-data"
106
106
  });
107
107
  }, S = (e, a) => {
108
108
  const n = y.value;
109
109
  if (n.length > e) {
110
- const l = [...n];
111
- l[e] && (l[e].enabled = a), d.edit(
112
- t.example.uid,
110
+ const t = [...n];
111
+ t[e] && (t[e].enabled = a), d.edit(
112
+ l.example.uid,
113
113
  "body.formData.value",
114
- l
114
+ t
115
115
  );
116
116
  }
117
- }, q = (e) => d.edit(t.example.uid, "body.raw.value", e), L = (e) => e === "multipartForm" ? {
117
+ }, q = (e) => d.edit(l.example.uid, "body.raw.value", e), W = (e) => e === "multipartForm" ? {
118
118
  activeBody: "formData",
119
119
  encoding: "form-data",
120
120
  header: "multipart/form-data"
@@ -126,10 +126,10 @@ const me = {
126
126
  activeBody: "binary",
127
127
  encoding: void 0,
128
128
  header: "application/octet-stream"
129
- } : e === "json" ? {
129
+ } : e === "json" || e.endsWith("+json") ? {
130
130
  activeBody: "raw",
131
131
  encoding: "json",
132
- header: "application/json"
132
+ header: e.endsWith("+json") ? `application/${e}` : "application/json"
133
133
  } : e === "xml" ? {
134
134
  activeBody: "raw",
135
135
  encoding: "xml",
@@ -146,111 +146,117 @@ const me = {
146
146
  activeBody: "raw",
147
147
  encoding: "html",
148
148
  header: "application/html"
149
- } : { activeBody: "raw", encoding: void 0, header: void 0 }, M = (e) => {
150
- var s, i;
151
- const { activeBody: a, encoding: n, header: l } = L(e);
152
- if (d.edit(t.example.uid, "body.activeBody", a), n && a === "raw")
153
- d.edit(t.example.uid, "body.raw", {
149
+ } : { activeBody: "raw", encoding: void 0, header: void 0 }, L = (e) => {
150
+ var s, r;
151
+ const { activeBody: a, encoding: n, header: t } = W(e);
152
+ if (d.edit(l.example.uid, "body.activeBody", a), n && a === "raw")
153
+ d.edit(l.example.uid, "body.raw", {
154
154
  encoding: n,
155
- value: ((s = t.example.body.raw) == null ? void 0 : s.value) ?? ""
155
+ value: ((s = l.example.body.raw) == null ? void 0 : s.value) ?? ""
156
156
  });
157
157
  else if (n && a === "formData")
158
- d.edit(t.example.uid, "body.formData", {
158
+ d.edit(l.example.uid, "body.formData", {
159
159
  encoding: n,
160
- value: ((i = t.example.body.formData) == null ? void 0 : i.value) ?? []
160
+ value: ((r = l.example.body.formData) == null ? void 0 : r.value) ?? []
161
161
  });
162
162
  else if (!n && a !== "binary") {
163
- const { raw: f, ...F } = t.example.body;
164
- d.edit(t.example.uid, "body", F);
163
+ const { raw: f, ...V } = l.example.body;
164
+ d.edit(l.example.uid, "body", V);
165
165
  }
166
- const o = [...t.example.parameters.headers], r = o.findIndex(
166
+ const o = [...l.example.parameters.headers], i = o.findIndex(
167
167
  (f) => f.key.toLowerCase() === "content-type"
168
168
  );
169
- if (r >= 0)
170
- l && o[r] ? o[r].value = l : o[r] && o.splice(r, 1);
171
- else if (l) {
169
+ if (i >= 0)
170
+ t && o[i] ? o[i].value = t : o[i] && (a !== "raw" || e === "none") && o.splice(i, 1);
171
+ else if (t) {
172
172
  const f = o[o.length - 1];
173
173
  f && f.key === "" && f.value === "" ? o.splice(o.length - 1, 0, {
174
174
  key: "Content-Type",
175
- value: l,
175
+ value: t,
176
176
  enabled: !0
177
177
  }) : o.push({
178
178
  key: "Content-Type",
179
- value: l,
179
+ value: t,
180
180
  enabled: !0
181
181
  });
182
182
  }
183
- d.edit(t.example.uid, "parameters.headers", o);
184
- }, W = async (e) => {
183
+ d.edit(l.example.uid, "parameters.headers", o);
184
+ }, M = async (e) => {
185
185
  const { open: a } = K({
186
186
  onChange: async (n) => {
187
- var o, r;
188
- const l = n == null ? void 0 : n[0];
189
- if (l) {
190
- const i = [...y.value];
191
- i[e] = {
192
- ...i[e],
193
- file: l,
194
- value: ((o = i[e]) == null ? void 0 : o.value) || l.name,
195
- key: ((r = i[e]) == null ? void 0 : r.key) || l.name,
187
+ var o, i;
188
+ const t = n == null ? void 0 : n[0];
189
+ if (t) {
190
+ const r = [...y.value];
191
+ r[e] = {
192
+ ...r[e],
193
+ file: t,
194
+ value: ((o = r[e]) == null ? void 0 : o.value) || t.name,
195
+ key: ((i = r[e]) == null ? void 0 : i.key) || t.name,
196
196
  enabled: !0
197
197
  }, d.edit(
198
- t.example.uid,
198
+ l.example.uid,
199
199
  "body.formData.value",
200
- i
201
- ), V();
200
+ r
201
+ ), T();
202
202
  }
203
203
  },
204
204
  multiple: !1,
205
205
  accept: "*/*"
206
206
  });
207
207
  a();
208
- }, I = () => d.edit(t.example.uid, "body.binary", void 0);
208
+ }, I = () => d.edit(l.example.uid, "body.binary", void 0);
209
209
  function z(e) {
210
- const a = y.value, n = [...a];
211
- a.length > 1 ? n.splice(e, 1) : V(), d.edit(t.example.uid, "body.formData.value", n);
210
+ const a = y.value, n = [...a], t = a[e], o = t == null ? void 0 : t.file;
211
+ if (a.length > 1 && (!(t != null && t.key) && !(t != null && t.value) || o && (t == null ? void 0 : t.key) === o.name && (t == null ? void 0 : t.value) === o.name))
212
+ n.splice(e, 1);
213
+ else {
214
+ const i = n[e];
215
+ i && (i.file = void 0);
216
+ }
217
+ d.edit(l.example.uid, "body.formData.value", n);
212
218
  }
213
219
  function _() {
214
220
  const { open: e } = K({
215
221
  onChange: async (a) => {
216
222
  const n = a == null ? void 0 : a[0];
217
- n && d.edit(t.example.uid, "body.binary", n);
223
+ n && d.edit(l.example.uid, "body.binary", n);
218
224
  },
219
225
  multiple: !1,
220
226
  accept: "*/*"
221
227
  });
222
228
  e();
223
229
  }
224
- $(
230
+ A(
225
231
  p,
226
232
  (e) => {
227
- ["multipartForm", "formUrlEncoded"].includes((e == null ? void 0 : e.id) || "") && V();
233
+ ["multipartForm", "formUrlEncoded"].includes((e == null ? void 0 : e.id) || "") && T();
228
234
  },
229
235
  { immediate: !0 }
230
- ), $(
231
- () => t.example.uid,
236
+ ), A(
237
+ () => l.example.uid,
232
238
  () => {
233
- t.operation.method && le(t.operation.method) && M(T.value), ["multipartForm", "formUrlEncoded"].includes(
234
- T.value
235
- ) && V();
239
+ l.operation.method && le(l.operation.method) && L(R.value), ["multipartForm", "formUrlEncoded"].includes(
240
+ R.value
241
+ ) && T();
236
242
  },
237
243
  { immediate: !0 }
238
244
  );
239
245
  const w = h(() => {
240
- var o, r, s;
241
- const e = (o = p.value) == null ? void 0 : o.id, { header: a } = L(e), n = ((r = t.operation.requestBody) == null ? void 0 : r.content) || {}, l = a ? ((s = n[a]) == null ? void 0 : s.examples) || {} : {};
242
- return Object.entries(l).map(([i, f]) => ({
243
- id: i,
244
- label: i,
246
+ var o, i, s;
247
+ const e = (o = p.value) == null ? void 0 : o.id, { header: a } = W(e), n = ((i = l.operation.requestBody) == null ? void 0 : i.content) || {}, t = a ? ((s = n[a]) == null ? void 0 : s.examples) || {} : {};
248
+ return Object.entries(t).map(([r, f]) => ({
249
+ id: r,
250
+ label: r,
245
251
  value: f
246
252
  }));
247
253
  }), U = h({
248
254
  get: () => {
249
- var l;
250
- const e = ((l = t.example.body.raw) == null ? void 0 : l.value) ?? "{}", a = JSON.parse(e);
255
+ var t;
256
+ const e = ((t = l.example.body.raw) == null ? void 0 : t.value) ?? "{}", a = JSON.parse(e);
251
257
  return w.value.find((o) => {
252
- const r = o.value;
253
- return JSON.stringify(r.value) === JSON.stringify(a);
258
+ const i = o.value;
259
+ return JSON.stringify(i.value) === JSON.stringify(a);
254
260
  }) ?? w.value[0];
255
261
  },
256
262
  set: (e) => {
@@ -265,12 +271,12 @@ const me = {
265
271
  });
266
272
  return (e, a) => (b(), g(ue, null, {
267
273
  title: m(() => [
268
- H(D(e.title), 1)
274
+ H(F(e.title), 1)
269
275
  ]),
270
276
  default: m(() => [
271
- c(ie, { columns: [""] }, {
277
+ c(re, { columns: [""] }, {
272
278
  default: m(() => [
273
- c(P, null, {
279
+ c(j, null, {
274
280
  default: m(() => [
275
281
  c(de, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
276
282
  default: m(() => [
@@ -281,7 +287,7 @@ const me = {
281
287
  teleport: ""
282
288
  }, {
283
289
  default: m(() => [
284
- c(v(R), {
290
+ c(v(D), {
285
291
  class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-3 font-normal",
286
292
  fullWidth: "",
287
293
  variant: "ghost"
@@ -289,7 +295,7 @@ const me = {
289
295
  default: m(() => {
290
296
  var n;
291
297
  return [
292
- k("span", null, D((n = p.value) == null ? void 0 : n.label), 1),
298
+ k("span", null, F((n = p.value) == null ? void 0 : n.label), 1),
293
299
  c(v(C), {
294
300
  icon: "ChevronDown",
295
301
  size: "md"
@@ -310,7 +316,7 @@ const me = {
310
316
  teleport: ""
311
317
  }, {
312
318
  default: m(() => [
313
- c(v(R), {
319
+ c(v(D), {
314
320
  class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-2 font-normal",
315
321
  fullWidth: "",
316
322
  variant: "ghost"
@@ -318,7 +324,7 @@ const me = {
318
324
  default: m(() => {
319
325
  var n;
320
326
  return [
321
- k("span", null, D((n = U.value) == null ? void 0 : n.label), 1),
327
+ k("span", null, F((n = U.value) == null ? void 0 : n.label), 1),
322
328
  c(v(C), {
323
329
  icon: "ChevronDown",
324
330
  size: "md"
@@ -336,16 +342,16 @@ const me = {
336
342
  ]),
337
343
  _: 1
338
344
  }),
339
- c(P, null, {
345
+ c(j, null, {
340
346
  default: m(() => {
341
- var n, l, o, r, s, i;
347
+ var n, t, o, i, s, r;
342
348
  return [
343
349
  ((n = p.value) == null ? void 0 : n.id) === "none" ? (b(), E("div", me, a[2] || (a[2] = [
344
350
  k("span", null, "No Body", -1)
345
- ]))) : ((l = p.value) == null ? void 0 : l.id) === "binaryFile" ? (b(), E("div", ce, [
351
+ ]))) : ((t = p.value) == null ? void 0 : t.id) === "binaryFile" ? (b(), E("div", ce, [
346
352
  e.example.body.binary ? (b(), E(te, { key: 0 }, [
347
- k("span", fe, D(e.example.body.binary.name), 1),
348
- c(v(R), {
353
+ k("span", fe, F(e.example.body.binary.name), 1),
354
+ c(v(D), {
349
355
  class: "bg-b-2 hover:bg-b-3 text-c-2 ml-1 border-0 shadow-none",
350
356
  size: "sm",
351
357
  variant: "outlined",
@@ -356,7 +362,7 @@ const me = {
356
362
  ])),
357
363
  _: 1
358
364
  })
359
- ], 64)) : (b(), g(v(R), {
365
+ ], 64)) : (b(), g(v(D), {
360
366
  key: 1,
361
367
  class: "bg-b-2 hover:bg-b-3 text-c-2 border-0 shadow-none",
362
368
  size: "sm",
@@ -385,12 +391,12 @@ const me = {
385
391
  items: y.value,
386
392
  showUploadButton: "",
387
393
  workspace: e.workspace,
388
- onDeleteRow: N,
394
+ onDeleteRow: P,
389
395
  onRemoveFile: z,
390
396
  onToggleRow: S,
391
- onUpdateRow: j,
392
- onUploadFile: W
393
- }, null, 8, ["envVariables", "environment", "items", "workspace"])) : ((r = p.value) == null ? void 0 : r.id) == "formUrlEncoded" ? (b(), g(G, {
397
+ onUpdateRow: N,
398
+ onUploadFile: M
399
+ }, null, 8, ["envVariables", "environment", "items", "workspace"])) : ((i = p.value) == null ? void 0 : i.id) == "formUrlEncoded" ? (b(), g(G, {
394
400
  key: 3,
395
401
  ref_key: "tableWrapperRef",
396
402
  ref: B,
@@ -401,12 +407,12 @@ const me = {
401
407
  items: y.value,
402
408
  showUploadButton: "",
403
409
  workspace: e.workspace,
404
- onDeleteRow: N,
410
+ onDeleteRow: P,
405
411
  onRemoveFile: z,
406
412
  onToggleRow: S,
407
- onUpdateRow: j,
408
- onUploadFile: W
409
- }, null, 8, ["envVariables", "environment", "items", "workspace"])) : (b(), g(re, {
413
+ onUpdateRow: N,
414
+ onUploadFile: M
415
+ }, null, 8, ["envVariables", "environment", "items", "workspace"])) : (b(), g(ie, {
410
416
  key: 4,
411
417
  class: "border-t-1/2 px-1",
412
418
  content: "",
@@ -415,7 +421,7 @@ const me = {
415
421
  language: Z.value,
416
422
  lineNumbers: "",
417
423
  lint: "",
418
- modelValue: ((i = (s = e.example.body) == null ? void 0 : s.raw) == null ? void 0 : i.value) ?? "",
424
+ modelValue: ((r = (s = e.example.body) == null ? void 0 : s.raw) == null ? void 0 : r.value) ?? "",
419
425
  workspace: e.workspace,
420
426
  "onUpdate:modelValue": q
421
427
  }, null, 8, ["envVariables", "environment", "language", "modelValue", "workspace"]))
@@ -423,7 +429,7 @@ const me = {
423
429
  }),
424
430
  _: 1
425
431
  }),
426
- c(P)
432
+ c(j)
427
433
  ]),
428
434
  _: 1
429
435
  })
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA8QA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AASxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AA8TF,wBAOG"}
1
+ {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAuRA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AASxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAwUF,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 c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5ec43a7d"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c67b3580"]]);
5
5
  export {
6
- c as default
6
+ m as default
7
7
  };
@@ -1,24 +1,24 @@
1
- import { defineComponent as q, computed as p, ref as B, watch as C, openBlock as s, createBlock as y, withCtx as u, createElementVNode as v, unref as l, createElementBlock as d, createCommentVNode as h, toDisplayString as R, createVNode as n, withDirectives as i, vShow as t } from "vue";
2
- import { ScalarErrorBoundary as E } from "@scalar/components";
3
- import { canMethodHaveBody as c, isDefined as H } from "@scalar/oas-utils/helpers";
1
+ import { defineComponent as C, computed as p, ref as R, watch as E, openBlock as s, createBlock as y, withCtx as u, createElementVNode as v, unref as l, createElementBlock as d, createCommentVNode as h, toDisplayString as O, createVNode as n, withDirectives as i, vShow as t } from "vue";
2
+ import { ScalarErrorBoundary as H } from "@scalar/components";
3
+ import { canMethodHaveBody as c, isDefined as N, REGEX as w } from "@scalar/oas-utils/helpers";
4
4
  import K from "../../../components/ContextBar.vue.js";
5
- import N from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
6
- import { matchesDomain as D } from "../../../libs/send-request/set-request-cookies.js";
7
- import U from "./RequestBody.vue.js";
5
+ import D from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
6
+ import { matchesDomain as U } from "../../../libs/send-request/set-request-cookies.js";
7
+ import $ from "./RequestBody.vue.js";
8
8
  import f from "./RequestParams.vue.js";
9
- import $ from "./RequestPathParams.vue.js";
9
+ import L from "./RequestPathParams.vue.js";
10
10
  import Q from "./RequestAuth/RequestAuth.vue.js";
11
11
  import M from "./RequestCodeExample.vue.js";
12
- import { useWorkspace as O } from "../../../store/store.js";
12
+ import { useWorkspace as T } from "../../../store/store.js";
13
13
  import { useLayout as W } from "../../../hooks/useLayout.js";
14
14
  const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24" }, z = {
15
15
  key: 0,
16
16
  class: "pointer-events-auto absolute left-0 top-0 h-full w-full cursor-text opacity-0",
17
17
  for: "requestname"
18
- }, I = ["value"], L = {
18
+ }, G = ["placeholder", "value"], I = {
19
19
  key: 2,
20
20
  class: "text-c-1 flex h-8 items-center"
21
- }, F = { class: "request-section-content custom-scroll relative flex flex-1 flex-col divide-y" }, le = /* @__PURE__ */ q({
21
+ }, X = { class: "request-section-content custom-scroll relative flex flex-1 flex-col divide-y" }, te = /* @__PURE__ */ C({
22
22
  __name: "RequestSection",
23
23
  props: {
24
24
  collection: {},
@@ -31,8 +31,8 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
31
31
  server: {},
32
32
  workspace: {}
33
33
  },
34
- setup(r) {
35
- const { requestMutators: w, cookies: b, securitySchemes: V } = O(), { layout: m } = W(), S = p(() => {
34
+ setup(o) {
35
+ const { requestMutators: b, cookies: V, securitySchemes: S } = T(), { layout: m } = W(), P = p(() => {
36
36
  const e = /* @__PURE__ */ new Set([
37
37
  "All",
38
38
  "Query",
@@ -42,27 +42,27 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
42
42
  "Headers",
43
43
  "Body"
44
44
  ]);
45
- return r.example.parameters.path.length || e.delete("Variables"), c(r.operation.method ?? "get") || e.delete("Body"), k.value && e.delete("Auth"), [...e];
45
+ return o.example.parameters.path.length || e.delete("Variables"), c(o.operation.method ?? "get") || e.delete("Body"), k.value && e.delete("Auth"), [...e];
46
46
  }), k = p(
47
47
  () => {
48
48
  var e;
49
- return m === "modal" && ((e = r.operation.security) == null ? void 0 : e.length) === 0;
49
+ return m === "modal" && ((e = o.operation.security) == null ? void 0 : e.length) === 0;
50
50
  }
51
- ), a = B("All");
52
- C(
53
- () => r.operation,
51
+ ), a = R("All");
52
+ E(
53
+ () => o.operation,
54
54
  (e) => {
55
55
  a.value === "Body" && e && !c(e.method) && (a.value = "All");
56
56
  }
57
57
  );
58
58
  const A = (e) => {
59
- const o = e.target;
60
- w.edit(r.operation.uid, "summary", o.value);
61
- }, P = p(
62
- () => (r.workspace.cookies ?? []).map((e) => b[e]).filter(H).filter((e) => e.name).filter(
59
+ const r = e.target;
60
+ b.edit(o.operation.uid, "summary", r.value);
61
+ }, g = p(
62
+ () => (o.workspace.cookies ?? []).map((e) => V[e]).filter(N).filter((e) => e.name).filter(
63
63
  (e) => {
64
- var o;
65
- return D(((o = r.server) == null ? void 0 : o.url) || r.operation.path, e.domain);
64
+ var r;
65
+ return U(((r = o.server) == null ? void 0 : r.url) || o.operation.path, e.domain);
66
66
  }
67
67
  ).map((e) => ({
68
68
  key: e.name,
@@ -75,8 +75,8 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
75
75
  },
76
76
  enabled: !0
77
77
  }))
78
- );
79
- return (e, o) => (s(), y(N, {
78
+ ), q = () => o.operation.summary ? o.operation.summary : o.operation.path.replace(w.PROTOCOL, "") ? o.operation.path.replace(w.PROTOCOL, "") : "Request Name";
79
+ return (e, r) => (s(), y(D, {
80
80
  "aria-label": `Request: ${e.operation.summary}`
81
81
  }, {
82
82
  title: u(() => [
@@ -86,20 +86,20 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
86
86
  key: 1,
87
87
  id: "requestname",
88
88
  class: "text-c-1 group-hover-input pl-1.25 md:-ml-1.25 pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded has-[:focus-visible]:outline",
89
- placeholder: "Request Name",
89
+ placeholder: q(),
90
90
  value: e.operation.summary,
91
91
  onInput: A
92
- }, null, 40, I)) : (s(), d("span", L, R(e.operation.summary), 1))
92
+ }, null, 40, G)) : (s(), d("span", I, O(e.operation.summary), 1))
93
93
  ]),
94
94
  n(K, {
95
95
  activeSection: a.value,
96
- sections: S.value,
97
- onSetActiveSection: o[0] || (o[0] = (g) => a.value = g)
96
+ sections: P.value,
97
+ onSetActiveSection: r[0] || (r[0] = (B) => a.value = B)
98
98
  }, null, 8, ["activeSection", "sections"])
99
99
  ]),
100
100
  default: u(() => [
101
- v("div", F, [
102
- e.collection && e.workspace && (l(m) !== "modal" || Object.keys(l(V) ?? {}).length) ? i((s(), y(Q, {
101
+ v("div", X, [
102
+ e.collection && e.workspace && (l(m) !== "modal" || Object.keys(l(S) ?? {}).length) ? i((s(), y(Q, {
103
103
  key: 0,
104
104
  collection: e.collection,
105
105
  envVariables: e.envVariables,
@@ -116,7 +116,7 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
116
116
  !k.value && (a.value === "All" || a.value === "Auth")
117
117
  ]
118
118
  ]) : h("", !0),
119
- i(n($, {
119
+ i(n(L, {
120
120
  envVariables: e.envVariables,
121
121
  environment: e.environment,
122
122
  example: e.example,
@@ -138,7 +138,7 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
138
138
  invalidParams: e.invalidParams,
139
139
  operation: e.operation,
140
140
  paramKey: "cookies",
141
- readOnlyEntries: P.value,
141
+ readOnlyEntries: g.value,
142
142
  title: "Cookies",
143
143
  workspace: e.workspace,
144
144
  workspaceParamKey: "cookies"
@@ -169,7 +169,7 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
169
169
  }, null, 8, ["envVariables", "environment", "example", "invalidParams", "operation", "workspace"]), [
170
170
  [t, a.value === "All" || a.value === "Query"]
171
171
  ]),
172
- i(n(U, {
172
+ i(n($, {
173
173
  envVariables: e.envVariables,
174
174
  environment: e.environment,
175
175
  example: e.example,
@@ -182,8 +182,8 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
182
182
  e.operation.method && (a.value === "All" || a.value === "Body") && l(c)(e.operation.method)
183
183
  ]
184
184
  ]),
185
- o[1] || (o[1] = v("div", { class: "-my-0.25 flex flex-grow" }, null, -1)),
186
- n(l(E), null, {
185
+ r[1] || (r[1] = v("div", { class: "-my-0.25 flex flex-grow" }, null, -1)),
186
+ n(l(H), null, {
187
187
  default: u(() => [
188
188
  n(M, {
189
189
  collection: e.collection,
@@ -202,5 +202,5 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
202
202
  }
203
203
  });
204
204
  export {
205
- le as default
205
+ te as default
206
206
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AAiPA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAOlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAO1D,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;IACpB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC5B,CAAC;;;;;;;;;;;;;;;;;;;;yBARsB,OAAO;sBACV,OAAO;cACf,OAAO;gBACL,OAAO;;AAyexB,wBASG"}
1
+ {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AAmPA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAOlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAO1D,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;IACpB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC5B,CAAC;;;;;;;;;;;;;;;;;;;;yBARsB,OAAO;sBACV,OAAO;cACf,OAAO;gBACL,OAAO;;AA6exB,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-22d199d5"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cabdb6a1"]]);
5
5
  export {
6
6
  m as default
7
7
  };