@scalar/api-client 2.2.49 → 2.2.50

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