@scalar/api-client 2.2.3 → 2.2.6

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 (106) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarServer.vue.js +15 -15
  4. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +1 -1
  5. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +1 -1
  6. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +24 -24
  8. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +2 -2
  9. package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -5
  10. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  11. package/dist/components/DataTable/DataTableCheckbox.vue.js +5 -6
  12. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  13. package/dist/components/DataTable/DataTableInputSelect.vue.js +8 -8
  14. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  15. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +37 -47
  16. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  17. package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
  18. package/dist/components/HttpMethod/HttpMethod.vue2.js +16 -17
  19. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  20. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +85 -84
  21. package/dist/components/ImportCollection/ImportNowButton.vue.js +3 -3
  22. package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
  23. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +24 -26
  24. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +6 -0
  25. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
  26. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +28 -23
  27. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
  28. package/dist/components/OpenApiClientButton.vue.js +1 -1
  29. package/dist/components/OpenApiClientButton.vue2.js +16 -16
  30. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  31. package/dist/components/TopNav/TopNav.vue.js +72 -70
  32. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  33. package/dist/components/TopNav/TopNavItem.vue.js +1 -1
  34. package/dist/components/TopNav/TopNavItem.vue2.js +83 -81
  35. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  36. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +5 -6
  37. package/dist/layouts/App/create-api-client-app.d.ts +3 -2
  38. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  39. package/dist/layouts/App/create-api-client-app.js +6 -6
  40. package/dist/layouts/Modal/create-api-client-modal.d.ts +6 -4
  41. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  42. package/dist/layouts/Modal/create-api-client-modal.js +1 -1
  43. package/dist/layouts/Web/create-api-client-web.d.ts +3 -2
  44. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  45. package/dist/layouts/Web/create-api-client-web.js +4 -4
  46. package/dist/libs/create-client.d.ts +6 -5
  47. package/dist/libs/create-client.d.ts.map +1 -1
  48. package/dist/libs/create-client.js +38 -37
  49. package/dist/libs/index.d.ts +1 -2
  50. package/dist/libs/index.d.ts.map +1 -1
  51. package/dist/libs/index.js +20 -20
  52. package/dist/libs/send-request/index.d.ts +2 -0
  53. package/dist/libs/send-request/index.d.ts.map +1 -0
  54. package/dist/libs/send-request/index.js +9 -0
  55. package/dist/libs/{send-request.d.ts → send-request/send-request.d.ts} +6 -6
  56. package/dist/libs/send-request/send-request.d.ts.map +1 -0
  57. package/dist/libs/{send-request.js → send-request/send-request.js} +29 -29
  58. package/dist/store/events.d.ts +1 -1
  59. package/dist/store/import-spec.d.ts +1 -1
  60. package/dist/store/import-spec.d.ts.map +1 -1
  61. package/dist/store/import-spec.js +1 -1
  62. package/dist/store/store.d.ts +6 -4
  63. package/dist/store/store.d.ts.map +1 -1
  64. package/dist/store/store.js +47 -45
  65. package/dist/style.css +1 -1
  66. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  67. package/dist/views/Cookies/Cookies.vue2.js +18 -20
  68. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  69. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +76 -72
  70. package/dist/views/Request/Request.vue.js +1 -1
  71. package/dist/views/Request/Request.vue2.js +30 -30
  72. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  73. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +20 -19
  74. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  75. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  76. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +2 -2
  77. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  78. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  79. package/dist/views/Request/RequestSection/RequestBody.vue2.js +245 -191
  80. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  81. package/dist/views/Request/RequestSidebar.vue.js +3 -3
  82. package/dist/views/Request/RequestSidebar.vue2.js +60 -61
  83. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  84. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  85. package/dist/views/Request/RequestSidebarItem.vue2.js +188 -196
  86. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  87. package/dist/views/Request/RequestSidebarItemMenu.vue.js +3 -3
  88. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +153 -147
  89. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  90. package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
  91. package/dist/views/Request/RequestSubpageHeader.vue2.js +24 -28
  92. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts.map +1 -1
  93. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
  94. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +5 -5
  95. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  96. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
  97. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +30 -25
  98. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  99. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +41 -30
  100. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  101. package/dist/views/Request/components/WorkspaceDropdown.vue.js +50 -58
  102. package/dist/views/Request/libs/oauth2.d.ts +6 -2
  103. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  104. package/dist/views/Request/libs/oauth2.js +43 -37
  105. package/package.json +18 -14
  106. package/dist/libs/send-request.d.ts.map +0 -1
@@ -1,35 +1,35 @@
1
- import { defineComponent as G, computed as w, ref as K, watch as S, openBlock as f, createBlock as b, withCtx as u, createTextVNode as q, toDisplayString as D, createVNode as s, unref as c, createElementVNode as x, createElementBlock as F, Fragment as Q, nextTick as Z } from "vue";
2
- import I from "../../../components/CodeInput/CodeInput.vue.js";
3
- import ee from "../../../components/DataTable/DataTable.vue.js";
4
- import ae from "../../../components/DataTable/DataTableHeader.vue.js";
5
- import R from "../../../components/DataTable/DataTableRow.vue.js";
6
- import te from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
- import { useActiveEntities as oe } from "../../../store/active-entities.js";
8
- import { ScalarListbox as ne, ScalarButton as k, ScalarIcon as L } from "@scalar/components";
9
- import { requestExampleParametersSchema as M } from "@scalar/oas-utils/entities/spec";
10
- import { canMethodHaveBody as le } from "@scalar/oas-utils/helpers";
11
- import W from "./RequestTable.vue.js";
12
- import { useWorkspace as re } from "../../../store/store.js";
13
- import { useFileDialog as z } from "../../../hooks/useFileDialog.js";
14
- const ie = {
1
+ import { defineComponent as Z, computed as b, ref as I, watch as W, openBlock as f, createBlock as h, withCtx as d, createTextVNode as z, toDisplayString as F, createVNode as s, unref as u, createElementVNode as w, createCommentVNode as ee, createElementBlock as U, Fragment as ae, nextTick as te } from "vue";
2
+ import oe from "../../../components/CodeInput/CodeInput.vue.js";
3
+ import ne from "../../../components/DataTable/DataTable.vue.js";
4
+ import le from "../../../components/DataTable/DataTableHeader.vue.js";
5
+ import T from "../../../components/DataTable/DataTableRow.vue.js";
6
+ import re from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
+ import { useActiveEntities as ie } from "../../../store/active-entities.js";
8
+ import { ScalarListbox as A, ScalarButton as k, ScalarIcon as E } from "@scalar/components";
9
+ import { requestExampleParametersSchema as J } from "@scalar/oas-utils/entities/spec";
10
+ import { canMethodHaveBody as ue } from "@scalar/oas-utils/helpers";
11
+ import $ from "./RequestTable.vue.js";
12
+ import { useWorkspace as de } from "../../../store/store.js";
13
+ import { useFileDialog as H } from "../../../hooks/useFileDialog.js";
14
+ const se = {
15
15
  key: 0,
16
16
  class: "text-c-3 flex min-h-10 w-full items-center justify-center p-2 text-sm"
17
- }, de = {
17
+ }, ce = {
18
18
  key: 1,
19
19
  class: "flex items-center justify-center p-1.5 overflow-hidden"
20
- }, ue = { class: "text-c-2 text-xs w-full border rounded p-1 max-w-full overflow-hidden whitespace-nowrap" }, Re = /* @__PURE__ */ G({
20
+ }, me = { class: "text-c-2 text-xs w-full border rounded p-1 max-w-full overflow-hidden whitespace-nowrap" }, Ue = /* @__PURE__ */ Z({
21
21
  __name: "RequestBody",
22
22
  props: {
23
23
  title: {}
24
24
  },
25
- setup(se) {
26
- const { activeRequest: d, activeExample: a } = oe(), { requestExampleMutators: r } = re(), A = {
25
+ setup(ve) {
26
+ const { activeRequest: c, activeExample: o } = ie(), { requestExampleMutators: i } = de(), X = {
27
27
  json: "json",
28
28
  xml: "xml",
29
29
  yaml: "yaml",
30
30
  edn: "edn",
31
31
  other: "html"
32
- }, h = Object.entries({
32
+ }, x = Object.entries({
33
33
  multipartForm: "Multipart Form",
34
34
  formUrlEncoded: "Form URL Encoded",
35
35
  binaryFile: "Binary File",
@@ -39,81 +39,81 @@ const ie = {
39
39
  edn: "EDN",
40
40
  other: "Other",
41
41
  none: "None"
42
- }).map(([e, t]) => ({
42
+ }).map(([e, a]) => ({
43
43
  id: e,
44
- label: t
45
- })), B = w(() => {
46
- var e, t;
47
- return a.value ? a.value.body.activeBody === "formData" ? ((e = a.value.body.formData) == null ? void 0 : e.encoding) === "urlencoded" ? "formUrlEncoded" : "multipartForm" : a.value.body.activeBody === "binary" ? "binaryFile" : a.value.body.activeBody === "raw" && ((t = a.value.body.raw) != null && t.encoding) ? a.value.body.raw.encoding === "html" ? "other" : a.value.body.raw.encoding : "none" : "none";
48
- }), m = w({
49
- get: () => h.find(
50
- (e) => e.id === B.value
51
- ) ?? h[h.length - 1],
44
+ label: a
45
+ })), R = b(() => {
46
+ var e, a;
47
+ return o.value ? o.value.body.activeBody === "formData" ? ((e = o.value.body.formData) == null ? void 0 : e.encoding) === "urlencoded" ? "formUrlEncoded" : "multipartForm" : o.value.body.activeBody === "binary" ? "binaryFile" : o.value.body.activeBody === "raw" && ((a = o.value.body.raw) != null && a.encoding) ? o.value.body.raw.encoding === "html" ? "other" : o.value.body.raw.encoding : "none" : "none";
48
+ }), v = b({
49
+ get: () => x.find(
50
+ (e) => e.id === R.value
51
+ ) ?? x[x.length - 1],
52
52
  set: (e) => {
53
- e != null && e.id && C(e.id);
53
+ e != null && e.id && q(e.id);
54
54
  }
55
- }), g = K(null), O = w(() => {
56
- const e = m.value.id;
57
- return A[e] ?? "plaintext";
55
+ }), B = I(null), Y = b(() => {
56
+ const e = v.value.id;
57
+ return X[e] ?? "plaintext";
58
58
  });
59
- function _() {
59
+ function V() {
60
60
  console.log("deleteRow");
61
61
  }
62
- const U = (e, t, o) => {
63
- if (!d.value || !a.value) return;
64
- const l = v.value;
62
+ const C = (e, a, t) => {
63
+ if (!c.value || !o.value) return;
64
+ const l = p.value;
65
65
  if (l.length > e) {
66
66
  const n = [...l];
67
- n[e] = { ...n[e], [t]: o }, (n[e].key !== "" || n[e].value !== "") && (n[e].enabled = !0), n[e].key === "" && n[e].value === "" && n.splice(e, 1), r.edit(
68
- a.value.uid,
67
+ n[e] = { ...n[e], [a]: t }, (n[e].key !== "" || n[e].value !== "") && (n[e].enabled = !0), n[e].key === "" && n[e].value === "" && n.splice(e, 1), i.edit(
68
+ o.value.uid,
69
69
  "body.formData.value",
70
70
  n
71
71
  );
72
72
  } else {
73
- const n = [M.parse({ [t]: o })];
74
- r.edit(
75
- a.value.uid,
73
+ const n = [J.parse({ [a]: t })];
74
+ i.edit(
75
+ o.value.uid,
76
76
  "body.formData.value",
77
77
  n
78
- ), Z(() => {
78
+ ), te(() => {
79
79
  var y;
80
- if (!g.value) return;
81
- (y = g.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || y.focus();
80
+ if (!B.value) return;
81
+ (y = B.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || y.focus();
82
82
  });
83
83
  }
84
- e === l.length - 1 && E();
85
- }, v = w(
84
+ e === l.length - 1 && j();
85
+ }, p = b(
86
86
  () => {
87
- var e, t, o;
88
- return ((o = (t = (e = a.value) == null ? void 0 : e.body) == null ? void 0 : t.formData) == null ? void 0 : o.value) ?? [];
87
+ var e, a, t;
88
+ return ((t = (a = (e = o.value) == null ? void 0 : e.body) == null ? void 0 : a.formData) == null ? void 0 : t.value) ?? [];
89
89
  }
90
- ), T = () => v.value.length === 0 && E(), E = () => {
91
- if (!d.value || !a.value) return;
92
- const e = M.parse({
90
+ ), P = () => p.value.length === 0 && j(), j = () => {
91
+ if (!c.value || !o.value) return;
92
+ const e = J.parse({
93
93
  enabled: !1
94
- }), t = [...v.value, e];
95
- a.value.body.formData ? r.edit(
96
- a.value.uid,
94
+ }), a = [...p.value, e];
95
+ o.value.body.formData ? i.edit(
96
+ o.value.uid,
97
97
  "body.formData.value",
98
- t
99
- ) : r.edit(a.value.uid, "body.formData", {
100
- value: t,
98
+ a
99
+ ) : i.edit(o.value.uid, "body.formData", {
100
+ value: a,
101
101
  encoding: "form-data"
102
102
  });
103
- }, P = (e, t) => {
104
- if (!d.value || !a.value) return;
105
- const o = v.value;
106
- if (o.length > e) {
107
- const l = [...o];
108
- l[e].enabled = t, r.edit(
109
- a.value.uid,
103
+ }, N = (e, a) => {
104
+ if (!c.value || !o.value) return;
105
+ const t = p.value;
106
+ if (t.length > e) {
107
+ const l = [...t];
108
+ l[e].enabled = a, i.edit(
109
+ o.value.uid,
110
110
  "body.formData.value",
111
111
  l
112
112
  );
113
113
  }
114
- }, $ = (e) => {
115
- !d.value || !a.value || r.edit(a.value.uid, "body.raw.value", e);
116
- }, H = (e) => e === "multipartForm" ? {
114
+ }, O = (e) => {
115
+ !c.value || !o.value || i.edit(o.value.uid, "body.raw.value", e);
116
+ }, S = (e) => e === "multipartForm" ? {
117
117
  activeBody: "formData",
118
118
  encoding: "form-data",
119
119
  header: "multipart/form-data"
@@ -145,84 +145,84 @@ const ie = {
145
145
  activeBody: "raw",
146
146
  encoding: "html",
147
147
  header: "application/html"
148
- } : { activeBody: "raw", encoding: void 0, header: void 0 }, C = (e) => {
149
- var p, y;
150
- if (!a.value) return;
151
- const { activeBody: t, encoding: o, header: l } = H(e);
152
- if (r.edit(
153
- a.value.uid,
148
+ } : { activeBody: "raw", encoding: void 0, header: void 0 }, q = (e) => {
149
+ var m, y;
150
+ if (!o.value) return;
151
+ const { activeBody: a, encoding: t, header: l } = S(e);
152
+ if (i.edit(
153
+ o.value.uid,
154
154
  "body.activeBody",
155
- t
156
- ), o && t === "raw")
157
- r.edit(a.value.uid, "body.raw", {
158
- encoding: o,
159
- value: ((p = a.value.body.raw) == null ? void 0 : p.value) ?? ""
155
+ a
156
+ ), t && a === "raw")
157
+ i.edit(o.value.uid, "body.raw", {
158
+ encoding: t,
159
+ value: ((m = o.value.body.raw) == null ? void 0 : m.value) ?? ""
160
160
  });
161
- else if (o && t === "formData")
162
- r.edit(a.value.uid, "body.formData", {
163
- encoding: o,
164
- value: ((y = a.value.body.formData) == null ? void 0 : y.value) ?? []
161
+ else if (t && a === "formData")
162
+ i.edit(o.value.uid, "body.formData", {
163
+ encoding: t,
164
+ value: ((y = o.value.body.formData) == null ? void 0 : y.value) ?? []
165
165
  });
166
- else if (!o) {
167
- const { raw: N, ...Y } = a.value.body;
168
- r.edit(a.value.uid, "body", Y);
166
+ else if (!t) {
167
+ const { raw: D, ...Q } = o.value.body;
168
+ i.edit(o.value.uid, "body", Q);
169
169
  }
170
- const n = [...a.value.parameters.headers], i = n.findIndex(
171
- (N) => N.key.toLowerCase() === "content-type"
170
+ const n = [...o.value.parameters.headers], r = n.findIndex(
171
+ (D) => D.key.toLowerCase() === "content-type"
172
172
  );
173
- i >= 0 ? l ? n[i].value = l : n.splice(i, 1) : l && n.unshift({
173
+ r >= 0 ? l ? n[r].value = l : n.splice(r, 1) : l && n.unshift({
174
174
  key: "Content-Type",
175
175
  value: l,
176
176
  enabled: !0
177
- }), r.edit(
178
- a.value.uid,
177
+ }), i.edit(
178
+ o.value.uid,
179
179
  "parameters.headers",
180
180
  n
181
181
  );
182
- }, j = async (e) => {
183
- const { open: t } = z({
184
- onChange: async (o) => {
185
- const l = o == null ? void 0 : o[0];
186
- if (l && d.value && a.value) {
187
- const i = [...v.value];
188
- i[e] = {
189
- ...i[e],
182
+ }, L = async (e) => {
183
+ const { open: a } = H({
184
+ onChange: async (t) => {
185
+ const l = t == null ? void 0 : t[0];
186
+ if (l && c.value && o.value) {
187
+ const r = [...p.value];
188
+ r[e] = {
189
+ ...r[e],
190
190
  file: l
191
- }, r.edit(
192
- a.value.uid,
191
+ }, i.edit(
192
+ o.value.uid,
193
193
  "body.formData.value",
194
- i
194
+ r
195
195
  );
196
196
  }
197
197
  },
198
198
  multiple: !1,
199
199
  accept: "*/*"
200
200
  });
201
- t();
201
+ a();
202
202
  };
203
- function J() {
204
- !d.value || !a.value || r.edit(a.value.uid, "body.binary", void 0);
203
+ function G() {
204
+ !c.value || !o.value || i.edit(o.value.uid, "body.binary", void 0);
205
205
  }
206
- function V(e) {
207
- if (!d.value || !a.value) return;
208
- const o = [...v.value];
209
- o[e] = {
210
- ...o[e],
206
+ function M(e) {
207
+ if (!c.value || !o.value) return;
208
+ const t = [...p.value];
209
+ t[e] = {
210
+ ...t[e],
211
211
  file: void 0
212
- }, r.edit(
213
- a.value.uid,
212
+ }, i.edit(
213
+ o.value.uid,
214
214
  "body.formData.value",
215
- o
215
+ t
216
216
  );
217
217
  }
218
- function X() {
219
- const { open: e } = z({
220
- onChange: async (t) => {
221
- const o = t == null ? void 0 : t[0];
222
- o && d.value && a.value && r.edit(
223
- a.value.uid,
218
+ function K() {
219
+ const { open: e } = H({
220
+ onChange: async (a) => {
221
+ const t = a == null ? void 0 : a[0];
222
+ t && c.value && o.value && i.edit(
223
+ o.value.uid,
224
224
  "body.binary",
225
- o
225
+ t
226
226
  );
227
227
  },
228
228
  multiple: !1,
@@ -230,56 +230,110 @@ const ie = {
230
230
  });
231
231
  e();
232
232
  }
233
- return S(
234
- m,
233
+ W(
234
+ v,
235
235
  (e) => {
236
- ["multipartForm", "formUrlEncoded"].includes(e == null ? void 0 : e.id) && T();
236
+ ["multipartForm", "formUrlEncoded"].includes(e == null ? void 0 : e.id) && P();
237
237
  },
238
238
  { immediate: !0 }
239
- ), S(
239
+ ), W(
240
240
  () => {
241
241
  var e;
242
- return (e = a.value) == null ? void 0 : e.uid;
242
+ return (e = o.value) == null ? void 0 : e.uid;
243
243
  },
244
244
  () => {
245
245
  var e;
246
- (e = d.value) != null && e.method && le(d.value.method) && C(B.value), ["multipartForm", "formUrlEncoded"].includes(
247
- B.value
248
- ) && T();
246
+ (e = c.value) != null && e.method && ue(c.value.method) && q(R.value), ["multipartForm", "formUrlEncoded"].includes(
247
+ R.value
248
+ ) && P();
249
249
  },
250
250
  { immediate: !0 }
251
- ), (e, t) => (f(), b(te, null, {
252
- title: u(() => [
253
- q(D(e.title), 1)
251
+ );
252
+ const g = b(() => {
253
+ var n, r, m;
254
+ const e = v.value.id, { header: a } = S(e), t = ((r = (n = c.value) == null ? void 0 : n.requestBody) == null ? void 0 : r.content) || {}, l = a ? ((m = t[a]) == null ? void 0 : m.examples) || {} : {};
255
+ return Object.entries(l).map(([y, D]) => ({
256
+ id: y,
257
+ label: y,
258
+ value: D
259
+ }));
260
+ }), _ = b({
261
+ get: () => {
262
+ var n, r;
263
+ const e = ((r = (n = o.value) == null ? void 0 : n.body.raw) == null ? void 0 : r.value) ?? "{}", a = JSON.parse(e), [t] = Object.keys(a), l = a[t];
264
+ return g.value.find((m) => m.id === l) ?? g.value[0];
265
+ },
266
+ set: (e) => {
267
+ if (e != null && e.id) {
268
+ const a = g.value.find(
269
+ (t) => t.id === e.id
270
+ );
271
+ if (a) {
272
+ const t = a.value;
273
+ O(JSON.stringify(t.value, null, 2));
274
+ }
275
+ }
276
+ }
277
+ });
278
+ return (e, a) => (f(), h(re, null, {
279
+ title: d(() => [
280
+ z(F(e.title), 1)
254
281
  ]),
255
- default: u(() => [
256
- s(ee, { columns: [""] }, {
257
- default: u(() => [
258
- s(R, null, {
259
- default: u(() => [
260
- s(ae, { class: "relative col-span-full flex h-8 cursor-pointer items-center !p-0" }, {
261
- default: u(() => [
262
- s(c(ne), {
263
- modelValue: m.value,
264
- "onUpdate:modelValue": t[0] || (t[0] = (o) => m.value = o),
265
- class: "text-xxs",
266
- options: c(h),
282
+ default: d(() => [
283
+ s(ne, { columns: [""] }, {
284
+ default: d(() => [
285
+ s(T, null, {
286
+ default: d(() => [
287
+ s(le, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
288
+ default: d(() => [
289
+ s(u(A), {
290
+ modelValue: v.value,
291
+ "onUpdate:modelValue": a[0] || (a[0] = (t) => v.value = t),
292
+ options: u(x),
293
+ teleport: ""
294
+ }, {
295
+ default: d(() => [
296
+ s(u(k), {
297
+ class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
298
+ fullWidth: "",
299
+ variant: "ghost"
300
+ }, {
301
+ default: d(() => {
302
+ var t;
303
+ return [
304
+ w("span", null, F((t = v.value) == null ? void 0 : t.label), 1),
305
+ s(u(E), {
306
+ icon: "ChevronDown",
307
+ size: "md"
308
+ })
309
+ ];
310
+ }),
311
+ _: 1
312
+ })
313
+ ]),
314
+ _: 1
315
+ }, 8, ["modelValue", "options"]),
316
+ g.value.length > 0 ? (f(), h(u(A), {
317
+ key: 0,
318
+ modelValue: _.value,
319
+ "onUpdate:modelValue": a[1] || (a[1] = (t) => _.value = t),
320
+ options: g.value,
321
+ side: "left",
267
322
  teleport: ""
268
323
  }, {
269
- default: u(() => [
270
- s(c(k), {
271
- class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1",
324
+ default: d(() => [
325
+ s(u(k), {
326
+ class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
272
327
  fullWidth: "",
273
328
  variant: "ghost"
274
329
  }, {
275
- default: u(() => {
276
- var o;
330
+ default: d(() => {
331
+ var t;
277
332
  return [
278
- x("span", null, D((o = m.value) == null ? void 0 : o.label), 1),
279
- s(c(L), {
333
+ w("span", null, F((t = _.value) == null ? void 0 : t.label), 1),
334
+ s(u(E), {
280
335
  icon: "ChevronDown",
281
- size: "xs",
282
- thickness: "2.5"
336
+ size: "md"
283
337
  })
284
338
  ];
285
339
  }),
@@ -287,43 +341,43 @@ const ie = {
287
341
  })
288
342
  ]),
289
343
  _: 1
290
- }, 8, ["modelValue", "options"])
344
+ }, 8, ["modelValue", "options"])) : ee("", !0)
291
345
  ]),
292
346
  _: 1
293
347
  })
294
348
  ]),
295
349
  _: 1
296
350
  }),
297
- s(R, null, {
298
- default: u(() => {
299
- var o, l, n, i, p;
351
+ s(T, null, {
352
+ default: d(() => {
353
+ var t, l, n, r, m;
300
354
  return [
301
- m.value.id === "none" ? (f(), F("div", ie, t[1] || (t[1] = [
302
- x("span", null, "No Body", -1)
303
- ]))) : m.value.id === "binaryFile" ? (f(), F("div", de, [
304
- (o = c(a)) != null && o.body.binary ? (f(), F(Q, { key: 0 }, [
305
- x("span", ue, D(((l = c(a)) == null ? void 0 : l.body.binary).name), 1),
306
- s(c(k), {
355
+ v.value.id === "none" ? (f(), U("div", se, a[2] || (a[2] = [
356
+ w("span", null, "No Body", -1)
357
+ ]))) : v.value.id === "binaryFile" ? (f(), U("div", ce, [
358
+ (t = u(o)) != null && t.body.binary ? (f(), U(ae, { key: 0 }, [
359
+ w("span", me, F(((l = u(o)) == null ? void 0 : l.body.binary).name), 1),
360
+ s(u(k), {
307
361
  class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 ml-1 shadow-none",
308
362
  size: "sm",
309
363
  variant: "outlined",
310
- onClick: J
364
+ onClick: G
311
365
  }, {
312
- default: u(() => t[2] || (t[2] = [
313
- q(" Delete ")
366
+ default: d(() => a[3] || (a[3] = [
367
+ z(" Delete ")
314
368
  ])),
315
369
  _: 1
316
370
  })
317
- ], 64)) : (f(), b(c(k), {
371
+ ], 64)) : (f(), h(u(k), {
318
372
  key: 1,
319
373
  class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 shadow-none",
320
374
  size: "sm",
321
375
  variant: "outlined",
322
- onClick: X
376
+ onClick: K
323
377
  }, {
324
- default: u(() => [
325
- t[3] || (t[3] = x("span", null, "Upload File", -1)),
326
- s(c(L), {
378
+ default: d(() => [
379
+ a[4] || (a[4] = w("span", null, "Upload File", -1)),
380
+ s(u(E), {
327
381
  class: "ml-1",
328
382
  icon: "UploadSimple",
329
383
  size: "xs",
@@ -332,46 +386,46 @@ const ie = {
332
386
  ]),
333
387
  _: 1
334
388
  }))
335
- ])) : m.value.id == "multipartForm" ? (f(), b(W, {
389
+ ])) : v.value.id == "multipartForm" ? (f(), h($, {
336
390
  key: 2,
337
391
  ref_key: "tableWrapperRef",
338
- ref: g,
392
+ ref: B,
339
393
  class: "!m-0 rounded-t-none shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
340
394
  columns: ["32px", "", "", "61px"],
341
- items: v.value,
395
+ items: p.value,
342
396
  showUploadButton: "",
343
- onDeleteRow: _,
344
- onRemoveFile: V,
345
- onToggleRow: P,
346
- onUpdateRow: U,
347
- onUploadFile: j
348
- }, null, 8, ["items"])) : m.value.id == "formUrlEncoded" ? (f(), b(W, {
397
+ onDeleteRow: V,
398
+ onRemoveFile: M,
399
+ onToggleRow: N,
400
+ onUpdateRow: C,
401
+ onUploadFile: L
402
+ }, null, 8, ["items"])) : v.value.id == "formUrlEncoded" ? (f(), h($, {
349
403
  key: 3,
350
404
  ref_key: "tableWrapperRef",
351
- ref: g,
405
+ ref: B,
352
406
  class: "!m-0 rounded-t-none border-t-0 shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
353
407
  columns: ["32px", "", "", "61px"],
354
- items: v.value,
408
+ items: p.value,
355
409
  showUploadButton: "",
356
- onDeleteRow: _,
357
- onRemoveFile: V,
358
- onToggleRow: P,
359
- onUpdateRow: U,
360
- onUploadFile: j
361
- }, null, 8, ["items"])) : (f(), b(I, {
410
+ onDeleteRow: V,
411
+ onRemoveFile: M,
412
+ onToggleRow: N,
413
+ onUpdateRow: C,
414
+ onUploadFile: L
415
+ }, null, 8, ["items"])) : (f(), h(oe, {
362
416
  key: 4,
363
417
  content: "",
364
- language: O.value,
418
+ language: Y.value,
365
419
  lineNumbers: "",
366
420
  lint: "",
367
- modelValue: ((p = (i = (n = c(a)) == null ? void 0 : n.body) == null ? void 0 : i.raw) == null ? void 0 : p.value) ?? "",
368
- "onUpdate:modelValue": $
421
+ modelValue: ((m = (r = (n = u(o)) == null ? void 0 : n.body) == null ? void 0 : r.raw) == null ? void 0 : m.value) ?? "",
422
+ "onUpdate:modelValue": O
369
423
  }, null, 8, ["language", "modelValue"]))
370
424
  ];
371
425
  }),
372
426
  _: 1
373
427
  }),
374
- s(R)
428
+ s(T)
375
429
  ]),
376
430
  _: 1
377
431
  })
@@ -381,5 +435,5 @@ const ie = {
381
435
  }
382
436
  });
383
437
  export {
384
- Re as default
438
+ Ue as default
385
439
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"AAqaA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;;;;cAKqC,MAAM;aAAO,MAAM;;;;;;cAAnB,MAAM;aAAO,MAAM;;;;AAioB1D,wBAOG"}
1
+ {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"AA+ZA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;;;;cAKqC,MAAM;aAAO,MAAM;;;;;;cAAnB,MAAM;aAAO,MAAM;;;;AA+nB1D,wBAOG"}
@@ -1,7 +1,7 @@
1
- import o from "./RequestSidebar.vue2.js";
1
+ import e from "./RequestSidebar.vue2.js";
2
2
  /* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6a96336d"]]);
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ o(e, [["__scopeId", "data-v-360eb73e"]]);
5
5
  export {
6
6
  m as default
7
7
  };