@scalar/api-client 2.2.21 → 2.2.23

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