@scalar/api-client 2.2.48 → 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 (217) hide show
  1. package/CHANGELOG.md +41 -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/ResponseBodyVirtual.vue.js +7 -7
  186. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts +4 -1
  187. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  188. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  189. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +41 -39
  190. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +1 -0
  191. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  192. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  193. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +56 -52
  194. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  195. package/dist/views/Request/components/WorkspaceDropdown.vue.js +68 -68
  196. package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -1
  197. package/dist/views/Request/handle-drag.d.ts +1 -1
  198. package/dist/views/Request/handle-drag.d.ts.map +1 -1
  199. package/dist/views/Request/handle-drag.js +38 -55
  200. package/dist/views/Request/libs/auth.d.ts +2 -2
  201. package/dist/views/Request/libs/auth.d.ts.map +1 -1
  202. package/dist/views/Request/libs/auth.js +28 -29
  203. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  204. package/dist/views/Request/libs/oauth2.js +42 -65
  205. package/dist/views/Request/libs/request.d.ts +5 -0
  206. package/dist/views/Request/libs/request.d.ts.map +1 -1
  207. package/dist/views/Request/libs/request.js +37 -2
  208. package/dist/views/Request/libs/watch-mode.d.ts.map +1 -1
  209. package/dist/views/Request/libs/watch-mode.js +10 -34
  210. package/dist/views/Servers/ServerForm.vue.d.ts +1 -8
  211. package/dist/views/Servers/ServerForm.vue.d.ts.map +1 -1
  212. package/dist/views/Servers/ServerForm.vue.js +21 -22
  213. package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
  214. package/dist/views/Servers/Servers.vue2.js +73 -81
  215. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
  216. package/dist/views/Settings/SettingsGeneral.vue.js +118 -134
  217. package/package.json +14 -14
@@ -1,92 +1,85 @@
1
- import { defineComponent as k, computed as E, watch as P, openBlock as f, createBlock as v, withCtx as y, createTextVNode as _, toDisplayString as b, createCommentVNode as q } from "vue";
2
- import w from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
- import { useActiveEntities as V } from "../../../store/active-entities.js";
4
- import M from "./RequestTable.vue.js";
5
- import { REGEX as U } from "@scalar/oas-utils/helpers";
6
- import { useWorkspace as N } from "../../../store/store.js";
7
- const O = /* @__PURE__ */ k({
1
+ import { defineComponent as x, computed as $, watch as b, openBlock as d, createBlock as h, withCtx as f, createTextVNode as K, toDisplayString as R, createCommentVNode as V } from "vue";
2
+ import C from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
+ import P from "./RequestTable.vue.js";
4
+ import { REGEX as q } from "@scalar/oas-utils/helpers";
5
+ import { useWorkspace as E } from "../../../store/store.js";
6
+ const A = /* @__PURE__ */ x({
8
7
  __name: "RequestPathParams",
9
8
  props: {
9
+ example: {},
10
+ operation: {},
11
+ paramKey: {},
10
12
  title: {},
11
- paramKey: {}
13
+ environment: {},
14
+ envVariables: {},
15
+ workspace: {}
12
16
  },
13
- setup(g) {
14
- const p = g, { activeRequest: o, activeExample: n } = V(), { requestMutators: d, requestExampleMutators: h } = N(), i = E(() => {
15
- const e = n.value;
16
- return e ? e.parameters[p.paramKey].map((a) => ({
17
- ...a,
18
- enum: a.enum
19
- })) : [];
20
- }), x = (e, a, r) => {
21
- var c, t;
22
- if (!o.value || !n.value) return;
23
- const u = n.value.parameters[p.paramKey], s = (c = u[e]) == null ? void 0 : c.key;
24
- if (s) {
25
- if (a === "key") {
26
- if ((t = u[e]) != null && t.required)
17
+ setup(t) {
18
+ const { requestMutators: p, requestExampleMutators: u } = E(), s = $(
19
+ () => t.example.parameters[t.paramKey].map((e) => ({
20
+ ...e,
21
+ enum: e.enum
22
+ }))
23
+ ), y = (e, o, n) => {
24
+ var m, a;
25
+ const i = t.example.parameters[t.paramKey], r = (m = i[e]) == null ? void 0 : m.key;
26
+ if (r) {
27
+ if (o === "key") {
28
+ if ((a = i[e]) != null && a.required)
27
29
  return;
28
- if (r) {
29
- const l = encodeURIComponent(s), m = encodeURIComponent(r), C = new RegExp(`(?<=/):${l}(?=[/?#]|$)`, "g"), K = o.value.path.replace(
30
- C,
31
- `:${m}`
32
- );
33
- d.edit(o.value.uid, "path", K);
30
+ if (n) {
31
+ const c = encodeURIComponent(r), l = encodeURIComponent(n), v = new RegExp(`(?<=/):${c}(?=[/?#]|$)`, "g"), w = t.operation.path.replace(v, `:${l}`);
32
+ p.edit(t.operation.uid, "path", w);
34
33
  } else {
35
- u.splice(e, 1);
36
- const l = new RegExp(`/:${encodeURIComponent(s)}(?=[/?#]|$)`, "g"), m = o.value.path.replace(l, "");
37
- d.edit(o.value.uid, "path", m);
34
+ i.splice(e, 1);
35
+ const c = new RegExp(`/:${encodeURIComponent(r)}(?=[/?#]|$)`, "g"), l = t.operation.path.replace(c, "");
36
+ p.edit(t.operation.uid, "path", l);
38
37
  }
39
38
  }
40
- h.edit(
41
- n.value.uid,
42
- `parameters.${p.paramKey}.${e}.${a}`,
43
- r
39
+ u.edit(
40
+ t.example.uid,
41
+ `parameters.${t.paramKey}.${e}.${o}`,
42
+ n
44
43
  );
45
44
  }
46
- }, R = (e) => {
47
- var c;
48
- if (!n.value) return;
49
- const a = ((c = e.match(U.PATH)) == null ? void 0 : c.map((t) => t.slice(1, -1))) || [], r = n.value.parameters[p.paramKey], u = new Map(r.map((t) => [t.key, t])), s = a.map(
50
- (t) => u.get(t) || { key: t, value: "", enabled: !0 }
45
+ }, g = (e) => {
46
+ var m;
47
+ const o = ((m = e.match(q.PATH)) == null ? void 0 : m.map((a) => a.slice(1, -1))) || [], n = t.example.parameters[t.paramKey], i = new Map(n.map((a) => [a.key, a])), r = o.map(
48
+ (a) => i.get(a) || { key: a, value: "", enabled: !0 }
51
49
  );
52
- r.forEach((t) => {
53
- !a.includes(t.key) && (t.value || t.required) && s.push(t);
54
- }), r.splice(0, r.length, ...s), h.edit(
55
- n.value.uid,
56
- `parameters.${p.paramKey}`,
57
- r
58
- );
59
- }, $ = (e) => {
60
- e && R(e);
50
+ n.forEach((a) => {
51
+ !o.includes(a.key) && (a.value || a.required) && r.push(a);
52
+ }), n.splice(0, n.length, ...r), u.edit(t.example.uid, `parameters.${t.paramKey}`, n);
53
+ }, k = (e) => {
54
+ e && g(e);
61
55
  };
62
- return P(
63
- () => {
64
- var e;
65
- return (e = o.value) == null ? void 0 : e.path;
66
- },
56
+ return b(
57
+ () => t.operation.path,
67
58
  (e) => {
68
- e && $(e);
59
+ e && k(e);
69
60
  }
70
- ), (e, a) => (f(), v(w, {
71
- itemCount: i.value.length
61
+ ), (e, o) => (d(), h(C, {
62
+ itemCount: s.value.length
72
63
  }, {
73
- title: y(() => [
74
- _(b(e.title), 1)
64
+ title: f(() => [
65
+ K(R(e.title), 1)
75
66
  ]),
76
- default: y(() => [
77
- i.value.length ? (f(), v(M, {
67
+ default: f(() => [
68
+ s.value.length ? (d(), h(P, {
78
69
  key: 0,
79
70
  class: "flex-1",
80
71
  columns: ["32px", "", ""],
81
- hasCheckboxDisabled: "",
82
- items: i.value,
83
- onUpdateRow: x
84
- }, null, 8, ["items"])) : q("", !0)
72
+ envVariables: e.envVariables,
73
+ environment: e.environment,
74
+ items: s.value,
75
+ workspace: e.workspace,
76
+ onUpdateRow: y
77
+ }, null, 8, ["envVariables", "environment", "items", "workspace"])) : V("", !0)
85
78
  ]),
86
79
  _: 1
87
80
  }, 8, ["itemCount"]));
88
81
  }
89
82
  });
90
83
  export {
91
- O as default
84
+ A as default
92
85
  };
@@ -1,6 +1,17 @@
1
+ import type { EnvVariable } from '../../../store/active-entities';
2
+ import type { Workspace } from '@scalar/oas-utils/entities';
3
+ import type { Environment } from '@scalar/oas-utils/entities/environment';
1
4
  import type { SelectedSecuritySchemeUids } from '@scalar/oas-utils/entities/shared';
5
+ import type { Collection, Operation, RequestExample, Server } from '@scalar/oas-utils/entities/spec';
2
6
  type __VLS_Props = {
7
+ collection: Collection;
8
+ environment: Environment;
9
+ envVariables: EnvVariable[];
10
+ example: RequestExample;
11
+ operation: Operation;
3
12
  selectedSecuritySchemeUids: SelectedSecuritySchemeUids;
13
+ server: Server | undefined;
14
+ workspace: Workspace;
4
15
  };
5
16
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLElement>;
6
17
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAoOA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AASnF,KAAK,WAAW,GAAG;IACjB,0BAA0B,EAAE,0BAA0B,CAAA;CACvD,CAAC;;AAkUF,wBAOG"}
1
+ {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA4QA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAK1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AASxC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AA4TF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestSection.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-776ad261"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5ab558f8"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -1,39 +1,38 @@
1
- import { defineComponent as N, computed as y, ref as D, watch as U, openBlock as m, createBlock as b, unref as t, withCtx as h, createElementVNode as k, createElementBlock as S, createCommentVNode as w, toDisplayString as O, createVNode as i, withDirectives as u, vShow as n } from "vue";
2
- import Q from "../../../components/ContextBar.vue.js";
3
- import W from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
4
- import { matchesDomain as $ } from "../../../libs/send-request/set-request-cookies.js";
5
- import { useActiveEntities as L } from "../../../store/active-entities.js";
6
- import M from "./RequestBody.vue.js";
7
- import _ from "./RequestParams.vue.js";
8
- import P from "./RequestPathParams.vue.js";
9
- import { ScalarErrorBoundary as j } from "@scalar/components";
10
- import { canMethodHaveBody as A, isDefined as z } from "@scalar/oas-utils/helpers";
11
- import I from "./RequestAuth/RequestAuth.vue.js";
12
- import F from "./RequestCodeExample.vue.js";
13
- import { useWorkspace as G } from "../../../store/store.js";
14
- import { useLayout as J } from "../../../hooks/useLayout.js";
15
- const T = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none group" }, X = {
1
+ import { defineComponent as B, computed as p, ref as C, watch as R, openBlock as s, createBlock as y, withCtx as u, createElementVNode as v, unref as l, createElementBlock as c, createCommentVNode as h, toDisplayString as E, createVNode as n, withDirectives as t, vShow as i } from "vue";
2
+ import H from "../../../components/ContextBar.vue.js";
3
+ import K from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
4
+ import { matchesDomain as N } from "../../../libs/send-request/set-request-cookies.js";
5
+ import D from "./RequestBody.vue.js";
6
+ import d from "./RequestParams.vue.js";
7
+ import U from "./RequestPathParams.vue.js";
8
+ import { ScalarErrorBoundary as Q } from "@scalar/components";
9
+ import { canMethodHaveBody as f, isDefined as $ } from "@scalar/oas-utils/helpers";
10
+ import L from "./RequestAuth/RequestAuth.vue.js";
11
+ import M from "./RequestCodeExample.vue.js";
12
+ import { useWorkspace as O } from "../../../store/store.js";
13
+ import { useLayout as P } from "../../../hooks/useLayout.js";
14
+ const W = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none group" }, j = {
16
15
  key: 0,
17
16
  class: "absolute w-full h-full top-0 left-0 pointer-events-auto opacity-0 cursor-text",
18
17
  for: "requestname"
19
- }, Y = ["value"], Z = {
18
+ }, z = ["value"], I = {
20
19
  key: 2,
21
20
  class: "flex items-center text-c-1 h-8"
22
- }, ee = { class: "request-section-content custom-scroll flex flex-1 flex-col relative" }, ye = /* @__PURE__ */ N({
21
+ }, F = { class: "request-section-content custom-scroll flex flex-1 flex-col relative" }, le = /* @__PURE__ */ B({
23
22
  __name: "RequestSection",
24
23
  props: {
25
- selectedSecuritySchemeUids: {}
24
+ collection: {},
25
+ environment: {},
26
+ envVariables: {},
27
+ example: {},
28
+ operation: {},
29
+ selectedSecuritySchemeUids: {},
30
+ server: {},
31
+ workspace: {}
26
32
  },
27
- setup(te) {
28
- const {
29
- activeRequest: a,
30
- activeCollection: x,
31
- activeExample: g,
32
- activeWorkspace: f,
33
- activeServer: d
34
- } = L(), { requestMutators: C, cookies: E, securitySchemes: V } = G(), { layout: p } = J(), R = y(() => {
35
- var e, r;
36
- const l = /* @__PURE__ */ new Set([
33
+ setup(r) {
34
+ const { requestMutators: w, cookies: b, securitySchemes: V } = O(), { layout: m } = P(), S = p(() => {
35
+ const e = /* @__PURE__ */ new Set([
37
36
  "All",
38
37
  "Query",
39
38
  "Auth",
@@ -42,139 +41,161 @@ const T = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
42
41
  "Headers",
43
42
  "Body"
44
43
  ]);
45
- return (e = g.value) != null && e.parameters.path.length || l.delete("Variables"), A(((r = a.value) == null ? void 0 : r.method) ?? "get") || l.delete("Body"), q.value && l.delete("Auth"), [...l];
46
- }), q = y(
44
+ return r.example.parameters.path.length || e.delete("Variables"), f(r.operation.method ?? "get") || e.delete("Body"), k.value && e.delete("Auth"), [...e];
45
+ }), k = p(
47
46
  () => {
48
- var l, e;
49
- return p === "modal" && ((e = (l = a.value) == null ? void 0 : l.security) == null ? void 0 : e.length) === 0;
47
+ var e;
48
+ return m === "modal" && ((e = r.operation.security) == null ? void 0 : e.length) === 0;
50
49
  }
51
- ), o = D("All");
52
- U(a, (l) => {
53
- o.value === "Body" && l && !A(l.method) && (o.value = "All");
54
- });
55
- const H = (l) => {
56
- if (!a.value) return;
57
- const e = l.target;
58
- C.edit(a.value.uid, "summary", e.value);
59
- }, K = y(
60
- () => {
61
- var l;
62
- return (((l = f.value) == null ? void 0 : l.cookies) ?? []).map((e) => E[e]).filter(z).filter((e) => e.name).filter(
63
- (e) => {
64
- var r, s;
65
- return $(
66
- ((r = d == null ? void 0 : d.value) == null ? void 0 : r.url) || ((s = a.value) == null ? void 0 : s.path),
67
- e.domain
68
- );
69
- }
70
- ).map((e) => ({
71
- key: e.name,
72
- value: e.value,
73
- route: {
74
- name: "cookies",
75
- params: {
76
- cookies: e.uid
77
- }
78
- },
79
- enabled: !0
80
- }));
50
+ ), o = C("All");
51
+ R(
52
+ () => r.operation,
53
+ (e) => {
54
+ o.value === "Body" && e && !f(e.method) && (o.value = "All");
81
55
  }
82
56
  );
83
- return (l, e) => {
84
- var r;
85
- return m(), b(W, {
86
- "aria-label": `Request: ${(r = t(a)) == null ? void 0 : r.summary}`
87
- }, {
88
- title: h(() => {
89
- var s, c;
90
- return [
91
- k("div", T, [
92
- t(p) !== "modal" ? (m(), S("label", X)) : w("", !0),
93
- t(p) !== "modal" ? (m(), S("input", {
94
- key: 1,
95
- id: "requestname",
96
- class: "text-c-1 rounded pointer-events-auto relative w-full pl-1.25 -ml-0.5 md:-ml-1.25 h-8 group-hover-input has-[:focus-visible]:outline z-10",
97
- placeholder: "Request Name",
98
- value: (s = t(a)) == null ? void 0 : s.summary,
99
- onInput: H
100
- }, null, 40, Y)) : (m(), S("span", Z, O((c = t(a)) == null ? void 0 : c.summary), 1))
57
+ const A = (e) => {
58
+ const a = e.target;
59
+ w.edit(r.operation.uid, "summary", a.value);
60
+ }, g = p(
61
+ () => (r.workspace.cookies ?? []).map((e) => b[e]).filter($).filter((e) => e.name).filter(
62
+ (e) => {
63
+ var a;
64
+ return N(((a = r.server) == null ? void 0 : a.url) || r.operation.path, e.domain);
65
+ }
66
+ ).map((e) => ({
67
+ key: e.name,
68
+ value: e.value,
69
+ route: {
70
+ name: "cookies",
71
+ params: {
72
+ cookies: e.uid
73
+ }
74
+ },
75
+ enabled: !0
76
+ }))
77
+ );
78
+ return (e, a) => (s(), y(K, {
79
+ "aria-label": `Request: ${e.operation.summary}`
80
+ }, {
81
+ title: u(() => [
82
+ v("div", W, [
83
+ l(m) !== "modal" ? (s(), c("label", j)) : h("", !0),
84
+ l(m) !== "modal" ? (s(), c("input", {
85
+ key: 1,
86
+ id: "requestname",
87
+ class: "text-c-1 rounded pointer-events-auto relative w-full pl-1.25 -ml-0.5 md:-ml-1.25 h-8 group-hover-input has-[:focus-visible]:outline z-10",
88
+ placeholder: "Request Name",
89
+ value: e.operation.summary,
90
+ onInput: A
91
+ }, null, 40, z)) : (s(), c("span", I, E(e.operation.summary), 1))
92
+ ]),
93
+ n(H, {
94
+ activeSection: o.value,
95
+ sections: S.value,
96
+ onSetActiveSection: a[0] || (a[0] = (q) => o.value = q)
97
+ }, null, 8, ["activeSection", "sections"])
98
+ ]),
99
+ default: u(() => [
100
+ v("div", F, [
101
+ e.collection && e.workspace && (l(m) !== "modal" || Object.keys(l(V) ?? {}).length) ? t((s(), y(L, {
102
+ key: 0,
103
+ collection: e.collection,
104
+ envVariables: e.envVariables,
105
+ environment: e.environment,
106
+ layout: "client",
107
+ operation: e.operation,
108
+ selectedSecuritySchemeUids: e.selectedSecuritySchemeUids,
109
+ server: e.server,
110
+ title: "Authentication",
111
+ workspace: e.workspace
112
+ }, null, 8, ["collection", "envVariables", "environment", "operation", "selectedSecuritySchemeUids", "server", "workspace"])), [
113
+ [
114
+ i,
115
+ !k.value && (o.value === "All" || o.value === "Auth")
116
+ ]
117
+ ]) : h("", !0),
118
+ t(n(U, {
119
+ envVariables: e.envVariables,
120
+ environment: e.environment,
121
+ example: e.example,
122
+ operation: e.operation,
123
+ paramKey: "path",
124
+ title: "Variables",
125
+ workspace: e.workspace
126
+ }, null, 8, ["envVariables", "environment", "example", "operation", "workspace"]), [
127
+ [
128
+ i,
129
+ (o.value === "All" || o.value === "Variables") && e.example.parameters.path.length
130
+ ]
131
+ ]),
132
+ t(n(d, {
133
+ envVariables: e.envVariables,
134
+ environment: e.environment,
135
+ example: e.example,
136
+ operation: e.operation,
137
+ paramKey: "cookies",
138
+ readOnlyEntries: g.value,
139
+ title: "Cookies",
140
+ workspace: e.workspace,
141
+ workspaceParamKey: "cookies"
142
+ }, null, 8, ["envVariables", "environment", "example", "operation", "readOnlyEntries", "workspace"]), [
143
+ [i, o.value === "All" || o.value === "Cookies"]
144
+ ]),
145
+ t(n(d, {
146
+ envVariables: e.envVariables,
147
+ environment: e.environment,
148
+ example: e.example,
149
+ operation: e.operation,
150
+ paramKey: "headers",
151
+ title: "Headers",
152
+ workspace: e.workspace
153
+ }, null, 8, ["envVariables", "environment", "example", "operation", "workspace"]), [
154
+ [i, o.value === "All" || o.value === "Headers"]
155
+ ]),
156
+ t(n(d, {
157
+ envVariables: e.envVariables,
158
+ environment: e.environment,
159
+ example: e.example,
160
+ operation: e.operation,
161
+ paramKey: "query",
162
+ title: "Query Parameters",
163
+ workspace: e.workspace
164
+ }, null, 8, ["envVariables", "environment", "example", "operation", "workspace"]), [
165
+ [i, o.value === "All" || o.value === "Query"]
166
+ ]),
167
+ t(n(D, {
168
+ envVariables: e.envVariables,
169
+ environment: e.environment,
170
+ example: e.example,
171
+ operation: e.operation,
172
+ title: "Body",
173
+ workspace: e.workspace
174
+ }, null, 8, ["envVariables", "environment", "example", "operation", "workspace"]), [
175
+ [
176
+ i,
177
+ e.operation.method && (o.value === "All" || o.value === "Body") && l(f)(e.operation.method)
178
+ ]
179
+ ]),
180
+ a[1] || (a[1] = v("div", { class: "flex flex-grow" }, null, -1)),
181
+ n(l(Q), null, {
182
+ default: u(() => [
183
+ n(M, {
184
+ collection: e.collection,
185
+ example: e.example,
186
+ operation: e.operation,
187
+ server: e.server,
188
+ workspace: e.workspace
189
+ }, null, 8, ["collection", "example", "operation", "server", "workspace"])
101
190
  ]),
102
- i(Q, {
103
- activeSection: o.value,
104
- sections: R.value,
105
- onSetActiveSection: e[0] || (e[0] = (v) => o.value = v)
106
- }, null, 8, ["activeSection", "sections"])
107
- ];
108
- }),
109
- default: h(() => {
110
- var s, c, v, B;
111
- return [
112
- k("div", ee, [
113
- t(x) && t(f) && (t(p) !== "modal" || Object.keys(t(V) ?? {}).length) ? u((m(), b(I, {
114
- key: 0,
115
- collection: t(x),
116
- layout: "client",
117
- operation: t(a),
118
- selectedSecuritySchemeUids: l.selectedSecuritySchemeUids,
119
- server: t(d),
120
- title: "Authentication",
121
- workspace: t(f)
122
- }, null, 8, ["collection", "operation", "selectedSecuritySchemeUids", "server", "workspace"])), [
123
- [
124
- n,
125
- !q.value && (o.value === "All" || o.value === "Auth")
126
- ]
127
- ]) : w("", !0),
128
- u(i(P, {
129
- paramKey: "path",
130
- title: "Variables"
131
- }, null, 512), [
132
- [
133
- n,
134
- (o.value === "All" || o.value === "Variables") && ((v = (c = (s = t(g)) == null ? void 0 : s.parameters) == null ? void 0 : c.path) == null ? void 0 : v.length)
135
- ]
136
- ]),
137
- u(i(_, {
138
- paramKey: "cookies",
139
- readOnlyEntries: K.value,
140
- title: "Cookies",
141
- workspaceParamKey: "cookies"
142
- }, null, 8, ["readOnlyEntries"]), [
143
- [n, o.value === "All" || o.value === "Cookies"]
144
- ]),
145
- u(i(_, {
146
- paramKey: "headers",
147
- title: "Headers"
148
- }, null, 512), [
149
- [n, o.value === "All" || o.value === "Headers"]
150
- ]),
151
- u(i(_, {
152
- paramKey: "query",
153
- title: "Query Parameters"
154
- }, null, 512), [
155
- [n, o.value === "All" || o.value === "Query"]
156
- ]),
157
- u(i(M, { title: "Body" }, null, 512), [
158
- [
159
- n,
160
- ((B = t(a)) == null ? void 0 : B.method) && (o.value === "All" || o.value === "Body") && t(A)(t(a).method)
161
- ]
162
- ]),
163
- e[1] || (e[1] = k("div", { class: "flex flex-grow" }, null, -1)),
164
- i(t(j), null, {
165
- default: h(() => [
166
- i(F)
167
- ]),
168
- _: 1
169
- })
170
- ])
171
- ];
172
- }),
173
- _: 1
174
- }, 8, ["aria-label"]);
175
- };
191
+ _: 1
192
+ })
193
+ ])
194
+ ]),
195
+ _: 1
196
+ }, 8, ["aria-label"]));
176
197
  }
177
198
  });
178
199
  export {
179
- ye as default
200
+ le as default
180
201
  };
@@ -1,5 +1,8 @@
1
+ import type { Environment } from '@scalar/oas-utils/entities/environment';
1
2
  import type { RequestExampleParameter } from '@scalar/oas-utils/entities/spec';
3
+ import type { Workspace } from '@scalar/oas-utils/entities/workspace';
2
4
  import type { RouteLocationRaw } from 'vue-router';
5
+ import type { EnvVariable } from '../../../store/active-entities';
3
6
  type __VLS_Props = {
4
7
  items?: (RequestExampleParameter & {
5
8
  route?: RouteLocationRaw;
@@ -9,6 +12,9 @@ type __VLS_Props = {
9
12
  showUploadButton?: boolean;
10
13
  isGlobal?: boolean;
11
14
  isReadOnly?: boolean;
15
+ environment: Environment;
16
+ envVariables: EnvVariable[];
17
+ workspace: Workspace;
12
18
  };
13
19
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
20
  updateRow: (idx: number, field: "key" | "value", value: string) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AAwPA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAOlD,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,CAAC,uBAAuB,GAAG;QAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC,EAAE,CAAA;IAClE,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;;;;;;;;;;;;;;;;;;;;yBAJsB,OAAO;sBACV,OAAO;cACf,OAAO;gBACL,OAAO;;AAkfxB,wBASG"}
1
+ {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AA8OA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAOlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAO1D,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,CAAC,uBAAuB,GAAG;QAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC,EAAE,CAAA;IAClE,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;;;;;;;;;;;;;;;;;;;yBAPsB,OAAO;sBACV,OAAO;cACf,OAAO;gBACL,OAAO;;AAqexB,wBASG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestTable.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b1f85772"]]);
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ccef6266"]]);
5
5
  export {
6
- f as default
6
+ c as default
7
7
  };