@scalar/api-client 2.2.35 → 2.2.38

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 (164) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +1 -1
  4. package/dist/components/AddressBar/AddressBar.vue2.js +107 -116
  5. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts +2 -1
  6. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  7. package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
  8. package/dist/components/AddressBar/AddressBarHistory.vue2.js +96 -76
  9. package/dist/components/AddressBar/AddressBarServer.vue.d.ts +5 -1
  10. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  11. package/dist/components/AddressBar/AddressBarServer.vue.js +92 -86
  12. package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts +7 -10
  13. package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
  14. package/dist/components/AddressBar/AddressBarServerItem.vue.js +5 -52
  15. package/dist/components/AddressBar/AddressBarServerItem.vue2.js +75 -2
  16. package/dist/components/CodeInput/CodeInput.vue.d.ts +5 -0
  17. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  18. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  19. package/dist/components/CodeInput/CodeInput.vue2.js +126 -112
  20. package/dist/components/CodeInput/codeVariableWidget.d.ts +1 -4
  21. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  22. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +1 -0
  23. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
  24. package/dist/components/CommandPalette/CommandActionInput.vue.js +21 -18
  25. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  26. package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
  27. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +2 -2
  28. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  29. package/dist/components/DataTable/DataTableInput.vue.js +2 -2
  30. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts +1 -0
  31. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  32. package/dist/components/DataTable/DataTableInputSelect.vue.js +86 -54
  33. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  34. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +22 -21
  35. package/dist/components/Form/Form.vue.d.ts.map +1 -1
  36. package/dist/components/Form/Form.vue.js +3 -3
  37. package/dist/components/Server/ServerVariablesForm.vue.d.ts +14 -0
  38. package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -0
  39. package/dist/components/Server/ServerVariablesForm.vue.js +47 -0
  40. package/dist/components/Server/ServerVariablesForm.vue2.js +4 -0
  41. package/dist/components/Server/ServerVariablesSelect.vue.d.ts +12 -0
  42. package/dist/components/Server/ServerVariablesSelect.vue.d.ts.map +1 -0
  43. package/dist/components/Server/ServerVariablesSelect.vue.js +54 -0
  44. package/dist/components/Server/ServerVariablesSelect.vue2.js +4 -0
  45. package/dist/components/Server/ServerVariablesTextbox.vue.d.ts +11 -0
  46. package/dist/components/Server/ServerVariablesTextbox.vue.d.ts.map +1 -0
  47. package/dist/components/Server/ServerVariablesTextbox.vue.js +29 -0
  48. package/dist/components/Server/ServerVariablesTextbox.vue2.js +4 -0
  49. package/dist/components/Server/types.d.ts +9 -0
  50. package/dist/components/Server/types.d.ts.map +1 -0
  51. package/dist/components/SideNav/SideHelp.vue.js +16 -16
  52. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  53. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  54. package/dist/components/Sidebar/Sidebar.vue2.js +11 -10
  55. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  56. package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
  57. package/dist/components/Sidebar/SidebarListElement.vue2.js +10 -9
  58. package/dist/components/TopNav/TopNav.vue.js +27 -27
  59. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts +1 -1
  60. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  61. package/dist/layouts/App/create-api-client-app.d.ts +99 -84
  62. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  63. package/dist/layouts/Modal/create-api-client-modal.d.ts +198 -168
  64. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  65. package/dist/layouts/Web/create-api-client-web.d.ts +99 -84
  66. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  67. package/dist/libs/create-client.d.ts +110 -90
  68. package/dist/libs/create-client.d.ts.map +1 -1
  69. package/dist/libs/create-client.js +86 -81
  70. package/dist/libs/find-request.d.ts.map +1 -1
  71. package/dist/libs/importers/curl.js +4 -4
  72. package/dist/libs/index.js +18 -19
  73. package/dist/libs/send-request/index.js +3 -4
  74. package/dist/libs/send-request/send-request.d.ts +0 -14
  75. package/dist/libs/send-request/send-request.d.ts.map +1 -1
  76. package/dist/libs/send-request/send-request.js +120 -142
  77. package/dist/libs/send-request/set-request-cookies.d.ts +27 -0
  78. package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -0
  79. package/dist/libs/send-request/set-request-cookies.js +54 -0
  80. package/dist/store/active-entities.d.ts +13 -4
  81. package/dist/store/active-entities.d.ts.map +1 -1
  82. package/dist/store/active-entities.js +15 -12
  83. package/dist/store/collections.d.ts.map +1 -1
  84. package/dist/store/cookies.d.ts +4 -58
  85. package/dist/store/cookies.d.ts.map +1 -1
  86. package/dist/store/cookies.js +5 -17
  87. package/dist/store/import-spec.d.ts.map +1 -1
  88. package/dist/store/request-example.d.ts +52 -2
  89. package/dist/store/request-example.d.ts.map +1 -1
  90. package/dist/store/requests.d.ts +2 -2
  91. package/dist/store/requests.d.ts.map +1 -1
  92. package/dist/store/servers.d.ts +40 -20
  93. package/dist/store/servers.d.ts.map +1 -1
  94. package/dist/store/store.d.ts +99 -86
  95. package/dist/store/store.d.ts.map +1 -1
  96. package/dist/store/store.js +51 -53
  97. package/dist/style.css +1 -1
  98. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  99. package/dist/views/Cookies/CookieForm.vue.js +24 -37
  100. package/dist/views/Cookies/CookieModal.vue.d.ts +21 -0
  101. package/dist/views/Cookies/CookieModal.vue.d.ts.map +1 -0
  102. package/dist/views/Cookies/CookieModal.vue.js +7 -0
  103. package/dist/views/Cookies/CookieModal.vue2.js +88 -0
  104. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  105. package/dist/views/Cookies/Cookies.vue2.js +98 -119
  106. package/dist/views/Environment/Environment.vue2.js +1 -1
  107. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  108. package/dist/views/Request/Request.vue.js +2 -2
  109. package/dist/views/Request/Request.vue2.js +88 -89
  110. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  111. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  112. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +87 -88
  113. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +2 -1
  114. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  115. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +3 -3
  116. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +16 -17
  117. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
  118. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +1 -1
  119. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  120. package/dist/views/Request/RequestSection/RequestBody.vue2.js +34 -34
  121. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +7 -0
  122. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  123. package/dist/views/Request/RequestSection/RequestParams.vue.js +79 -66
  124. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  125. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +57 -74
  126. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  127. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  128. package/dist/views/Request/RequestSection/RequestSection.vue2.js +91 -64
  129. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +9 -2
  130. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  131. package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
  132. package/dist/views/Request/RequestSection/RequestTable.vue2.js +168 -129
  133. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  134. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +5 -64
  135. package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +46 -2
  136. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  137. package/dist/views/Request/RequestSidebar.vue.js +2 -2
  138. package/dist/views/Request/RequestSidebar.vue2.js +143 -143
  139. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  140. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  141. package/dist/views/Request/RequestSidebarItem.vue2.js +71 -71
  142. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  143. package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
  144. package/dist/views/Request/RequestSubpageHeader.vue2.js +37 -37
  145. package/dist/views/Request/ResponseSection/ResponseCookies.vue.js +19 -17
  146. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  147. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
  148. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +27 -27
  149. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +31 -31
  150. package/dist/views/Request/handle-drag.d.ts +1 -1
  151. package/dist/views/Request/handle-drag.d.ts.map +1 -1
  152. package/dist/views/Request/handle-drag.js +27 -26
  153. package/dist/views/Request/hooks/useOpenApiWatcher.js +1 -1
  154. package/dist/views/Request/libs/request.d.ts +12 -0
  155. package/dist/views/Request/libs/request.d.ts.map +1 -0
  156. package/dist/views/Request/libs/request.js +4 -0
  157. package/dist/views/Request/libs/{live-sync.d.ts → watch-mode.d.ts} +1 -1
  158. package/dist/views/Request/libs/watch-mode.d.ts.map +1 -0
  159. package/dist/views/Request/libs/{live-sync.js → watch-mode.js} +6 -6
  160. package/dist/views/Servers/Servers.vue2.js +29 -29
  161. package/package.json +10 -12
  162. package/dist/views/Cookies/CookieRaw.vue.js +0 -28
  163. package/dist/views/Cookies/CookieRaw.vue2.js +0 -4
  164. package/dist/views/Request/libs/live-sync.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CookieForm.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Cookies/CookieForm.vue"],"names":[],"mappings":";AA0LA,wBAMG"}
1
+ {"version":3,"file":"CookieForm.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Cookies/CookieForm.vue"],"names":[],"mappings":";AAmJA,wBAMG"}
@@ -1,52 +1,39 @@
1
- import { defineComponent as c, computed as p, openBlock as d, createBlock as m, withCtx as k, createElementVNode as t } from "vue";
2
- import v from "../../components/Form/Form.vue.js";
1
+ import { defineComponent as c, computed as m, openBlock as r, createBlock as p, withCtx as d, createElementVNode as u } from "vue";
2
+ import k from "../../components/Form/Form.vue.js";
3
3
  import { useActiveEntities as f } from "../../store/active-entities.js";
4
- import { useWorkspace as b } from "../../store/store.js";
5
- const h = { class: "flex items-center pointer-events-none" }, y = ["value"], F = /* @__PURE__ */ c({
4
+ import { useWorkspace as _ } from "../../store/store.js";
5
+ const b = /* @__PURE__ */ c({
6
6
  __name: "CookieForm",
7
- setup(_) {
8
- const { activeCookieId: o } = f(), { cookies: n, cookieMutators: i } = b(), s = [
9
- { label: "Key", key: "key", placeholder: "Username" },
10
- { label: "Value", key: "value", placeholder: "123" },
11
- { label: "Domain", key: "domain", placeholder: "scalar.com" },
12
- { label: "Path", key: "path", placeholder: "/" },
13
- { label: "Expires", key: "expires", placeholder: "Tomorrow" },
14
- { label: "Secure", key: "secure", placeholder: "True/False" },
15
- { label: "HttpOnly", key: "httpOnly", placeholder: "True/False" }
16
- ], l = p(
17
- () => n[o.value] || {
18
- value: "",
7
+ setup(v) {
8
+ const { activeCookieId: o } = f(), { cookies: a, cookieMutators: i } = _(), s = [
9
+ { label: "Name", key: "name", placeholder: "session_id" },
10
+ { label: "Value", key: "value", placeholder: "my-cookie-session-id" },
11
+ { label: "Domain", key: "domain", placeholder: "example.com" }
12
+ // TODO: We don’t check the path (yet), so we don’t need to show it.
13
+ // { label: 'Path', key: 'path', placeholder: '/' },
14
+ ], l = m(
15
+ () => a[o.value] || {
19
16
  uid: "",
20
17
  name: "",
21
- sameSite: "Lax"
18
+ value: "",
19
+ domain: "",
20
+ path: ""
22
21
  }
23
- ), a = (r, e) => {
24
- o.value && i.edit(o.value, r, e);
22
+ ), n = (t, e) => {
23
+ o.value && i.edit(o.value, t, e);
25
24
  };
26
- return (r, e) => (d(), m(v, {
25
+ return (t, e) => (r(), p(k, {
27
26
  data: l.value,
28
- onUpdate: a,
27
+ onUpdate: n,
29
28
  options: s
30
29
  }, {
31
- title: k(() => [
32
- t("div", h, [
33
- e[1] || (e[1] = t("label", {
34
- class: "absolute border-b w-full h-full top-0 left-0 pointer-events-auto opacity-0 cursor-text",
35
- for: "cookiename"
36
- }, null, -1)),
37
- t("input", {
38
- id: "cookiename",
39
- class: "md:pl-1 outline-none border-0 text-c-2 rounded pointer-events-auto relative w-full",
40
- placeholder: "Cookie Name",
41
- value: l.value.name,
42
- onInput: e[0] || (e[0] = (u) => a("name", u.target.value))
43
- }, null, 40, y)
44
- ])
45
- ]),
30
+ title: d(() => e[0] || (e[0] = [
31
+ u("span", { class: "text-c-2" }, "Edit Cookie", -1)
32
+ ])),
46
33
  _: 1
47
34
  }, 8, ["data"]));
48
35
  }
49
36
  });
50
37
  export {
51
- F as default
38
+ b as default
52
39
  };
@@ -0,0 +1,21 @@
1
+ import { type ModalState } from '@scalar/components';
2
+ type __VLS_Props = {
3
+ state: ModalState;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
+ submit: (cookieData: {
7
+ name: string;
8
+ value: string;
9
+ domain: string;
10
+ }) => any;
11
+ cancel: () => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onSubmit?: ((cookieData: {
14
+ name: string;
15
+ value: string;
16
+ domain: string;
17
+ }) => any) | undefined;
18
+ onCancel?: (() => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ export default _default;
21
+ //# sourceMappingURL=CookieModal.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CookieModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Cookies/CookieModal.vue"],"names":[],"mappings":"AAgHA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,oBAAoB,CAAA;AAMjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;CAClB,CAAC;;;cAQU,MAAM;eACL,MAAM;gBACL,MAAM;;;;;cAFR,MAAM;eACL,MAAM;gBACL,MAAM;;;;AA2LpB,wBAQG"}
@@ -0,0 +1,7 @@
1
+ import o from "./CookieModal.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9de80227"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,88 @@
1
+ import { defineComponent as V, ref as c, watch as x, openBlock as b, createBlock as k, unref as C, withCtx as m, createVNode as l, createTextVNode as t, createElementVNode as i } from "vue";
2
+ import g from "../../components/CommandPalette/CommandActionForm.vue.js";
3
+ import n from "../../components/CommandPalette/CommandActionInput.vue.js";
4
+ import { ScalarModal as N } from "@scalar/components";
5
+ import { useToasts as S } from "@scalar/use-toasts";
6
+ const U = { class: "flex gap-2 h-8 items-start text-sm" }, $ = { class: "flex gap-2 h-8 items-start text-sm" }, w = { class: "flex gap-2 h-8 items-start text-sm" }, _ = /* @__PURE__ */ V({
7
+ __name: "CookieModal",
8
+ props: {
9
+ state: {}
10
+ },
11
+ emits: ["cancel", "submit"],
12
+ setup(r, { emit: p }) {
13
+ const u = r, d = p, a = c({
14
+ name: "",
15
+ value: "",
16
+ domain: ""
17
+ }), { toast: f } = S(), v = () => {
18
+ if (!a.value.name || !a.value.value || !a.value.domain) {
19
+ f("Please fill in all fields before adding a cookie.", "error");
20
+ return;
21
+ }
22
+ d("submit", a.value), u.state.hide();
23
+ };
24
+ return x(
25
+ () => u.state.open,
26
+ (s) => {
27
+ s && (a.value = {
28
+ name: "",
29
+ value: "",
30
+ domain: ""
31
+ });
32
+ }
33
+ ), (s, e) => (b(), k(C(N), {
34
+ size: "xs",
35
+ state: s.state,
36
+ title: "Add Cookie"
37
+ }, {
38
+ default: m(() => [
39
+ l(g, {
40
+ disabled: !a.value.name || !a.value.value || !a.value.domain,
41
+ onCancel: e[3] || (e[3] = (o) => d("cancel")),
42
+ onSubmit: v
43
+ }, {
44
+ submit: m(() => e[7] || (e[7] = [
45
+ t("Add Cookie")
46
+ ])),
47
+ default: m(() => [
48
+ i("div", U, [
49
+ e[4] || (e[4] = t(" Name: ")),
50
+ l(n, {
51
+ modelValue: a.value.name,
52
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => a.value.name = o),
53
+ autofocus: "",
54
+ class: "!p-0",
55
+ placeholder: "session_id"
56
+ }, null, 8, ["modelValue"])
57
+ ]),
58
+ i("div", $, [
59
+ e[5] || (e[5] = t(" Value: ")),
60
+ l(n, {
61
+ modelValue: a.value.value,
62
+ "onUpdate:modelValue": e[1] || (e[1] = (o) => a.value.value = o),
63
+ autofocus: "",
64
+ class: "!p-0",
65
+ placeholder: "my-cookie-session-id"
66
+ }, null, 8, ["modelValue"])
67
+ ]),
68
+ i("div", w, [
69
+ e[6] || (e[6] = t(" Domain: ")),
70
+ l(n, {
71
+ modelValue: a.value.domain,
72
+ "onUpdate:modelValue": e[2] || (e[2] = (o) => a.value.domain = o),
73
+ autofocus: "",
74
+ class: "!p-0",
75
+ placeholder: "example.com"
76
+ }, null, 8, ["modelValue"])
77
+ ])
78
+ ]),
79
+ _: 1
80
+ }, 8, ["disabled"])
81
+ ]),
82
+ _: 1
83
+ }, 8, ["state"]));
84
+ }
85
+ });
86
+ export {
87
+ _ as default
88
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"Cookies.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Cookies/Cookies.vue"],"names":[],"mappings":";AA6jBA,wBAMG"}
1
+ {"version":3,"file":"Cookies.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Cookies/Cookies.vue"],"names":[],"mappings":";AAigBA,wBAMG"}
@@ -1,122 +1,97 @@
1
- import { defineComponent as D, computed as K, onMounted as R, onBeforeUnmount as F, openBlock as l, createBlock as $, withCtx as a, createVNode as s, unref as n, createElementVNode as c, createElementBlock as d, Fragment as k, renderList as _, normalizeClass as j, toDisplayString as N, withDirectives as O, createTextVNode as z, withModifiers as A, vShow as E } from "vue";
2
- import H from "../../components/Sidebar/SidebarButton.vue.js";
3
- import I from "../../components/Sidebar/SidebarList.vue.js";
4
- import P from "../../components/Sidebar/SidebarListElement.vue.js";
5
- import T from "../../components/ViewLayout/ViewLayout.vue.js";
6
- import U from "../../components/ViewLayout/ViewLayoutContent.vue.js";
7
- import { ScalarIcon as L } from "@scalar/components";
8
- import { cookieSchema as W } from "@scalar/oas-utils/entities/cookie";
9
- import { useRouter as q, useRoute as G } from "vue-router";
10
- import J from "./CookieForm.vue.js";
11
- import Q from "./CookieRaw.vue.js";
12
- import { useWorkspace as X } from "../../store/store.js";
13
- import Y from "../../components/Sidebar/Sidebar.vue.js";
14
- import { useSidebar as Z } from "../../hooks/useSidebar.js";
15
- const ee = { class: "flex-1" }, te = ["onClick"], oe = { class: "before:bg-border before:pointer-events-none before:z-1 before:absolute before:left-3 before:top-0 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 relative" }, re = ["onClick"], se = { class: "before:bg-border before:pointer-events-none before:z-1 before:absolute before:left-[calc(1.75rem_-1px)] before:top-0 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 relative" }, ve = /* @__PURE__ */ D({
1
+ import { defineComponent as B, onMounted as E, onBeforeUnmount as K, computed as b, openBlock as l, createBlock as p, withCtx as a, createVNode as u, unref as d, createElementVNode as y, createElementBlock as w, Fragment as $, renderList as j, withModifiers as A, createTextVNode as O, createCommentVNode as H } from "vue";
2
+ import R from "../../components/Sidebar/SidebarButton.vue.js";
3
+ import W from "../../components/Sidebar/SidebarList.vue.js";
4
+ import D from "../../components/Sidebar/SidebarListElement.vue.js";
5
+ import F from "../../components/ViewLayout/ViewLayout.vue.js";
6
+ import I from "../../components/ViewLayout/ViewLayoutContent.vue.js";
7
+ import { useModal as T } from "@scalar/components";
8
+ import { cookieSchema as U } from "@scalar/oas-utils/entities/cookie";
9
+ import { useRouter as q, useRoute as z } from "vue-router";
10
+ import G from "./CookieForm.vue.js";
11
+ import J from "./CookieModal.vue.js";
12
+ import { useActiveEntities as P } from "../../store/active-entities.js";
13
+ import { useWorkspace as Q } from "../../store/store.js";
14
+ import X from "../../components/Sidebar/Sidebar.vue.js";
15
+ const Y = { class: "flex-1" }, Z = { class: "mb-[.5px] last:mb-0 relative" }, ke = /* @__PURE__ */ B({
16
16
  __name: "Cookies",
17
- setup(le) {
18
- const { cookies: b, cookieMutators: x, events: v } = X(), { collapsedSidebarFolders: u, toggleSidebarFolder: g } = Z(), p = q(), M = G(), y = () => {
19
- const e = Object.keys(b).length, t = W.parse({
20
- name: `Cookie ${e}`,
21
- value: "",
22
- domain: "example.com",
23
- path: "/",
24
- secure: !1,
25
- httpOnly: !1,
26
- sameSite: "None"
17
+ setup(ee) {
18
+ const { cookies: c, cookieMutators: k, events: v, workspaceMutators: h } = Q(), { activeWorkspace: n, activeCookieId: x } = P(), r = q(), g = z(), f = T(), M = (t) => {
19
+ var o, i;
20
+ const e = U.parse({
21
+ name: t.name,
22
+ value: t.value,
23
+ domain: t.domain,
24
+ path: "/"
27
25
  });
28
- x.add(t), p.push(t.uid);
29
- }, V = (e) => {
30
- var o;
31
- x.delete(e);
32
- const t = Object.values(b).filter(
33
- (r) => r.uid !== e
26
+ k.add(e), h.edit(((o = n.value) == null ? void 0 : o.uid) ?? "", "cookies", [
27
+ ...((i = n.value) == null ? void 0 : i.cookies) ?? [],
28
+ e.uid
29
+ ]), r.push({
30
+ name: "cookies",
31
+ params: {
32
+ cookies: e.uid
33
+ }
34
+ });
35
+ }, N = (t) => {
36
+ var o, i, m;
37
+ k.delete(t), h.edit(((o = n.value) == null ? void 0 : o.uid) ?? "", "cookies", [
38
+ ...(((i = n.value) == null ? void 0 : i.cookies) ?? []).filter((s) => s !== t)
39
+ ]);
40
+ const e = Object.values(c).filter(
41
+ (s) => s.uid !== t
34
42
  );
35
- if (t.length > 1) {
36
- const r = t[t.length - 1];
37
- r && p.push(r.uid);
38
- } else t.length === 1 && ((o = t[0]) == null ? void 0 : o.uid) === "default" && p.push("default");
39
- }, h = K(() => {
40
- const e = {};
41
- return Object.values(b).forEach((t) => {
42
- const o = t.domain ?? "", r = t.path ?? "";
43
- e[o] || (e[o] = {}), e[o][r] || (e[o][r] = []), e[o][r].push(t);
44
- }), e;
45
- }), C = (e) => u[e], w = (e) => {
46
- e != null && e.createNew && M.name === "cookies" && y();
47
- }, B = (e, t) => {
48
- const o = `/workspace/default/cookies/${t}`;
49
- e.metaKey ? window.open(o, "_blank") : p.push({ path: o });
43
+ if (e.length > 1) {
44
+ const s = e[e.length - 1];
45
+ s && r.push(s.uid);
46
+ } else e.length === 1 && ((m = e[0]) == null ? void 0 : m.uid) === "default" && r.push("default");
47
+ }, C = () => {
48
+ f.show();
49
+ }, _ = (t) => {
50
+ t != null && t.createNew && g.name === "cookies" && C();
51
+ }, V = (t, e) => {
52
+ var i;
53
+ const o = {
54
+ name: "cookies",
55
+ params: {
56
+ workspace: ((i = n.value) == null ? void 0 : i.uid) ?? "default",
57
+ cookies: e
58
+ }
59
+ };
60
+ if (t.metaKey) {
61
+ const m = r.resolve(o).href;
62
+ window.open(m, "_blank");
63
+ return;
64
+ }
65
+ r.push(o);
50
66
  };
51
- return R(() => {
52
- const e = Object.keys(h.value), t = Object.entries(h.value).flatMap(
53
- ([o, r]) => Object.keys(r).map((m) => o + m)
54
- );
55
- e.forEach((o) => {
56
- u[o] = !0;
57
- }), t.forEach((o) => {
58
- u[o] = !0;
59
- }), v.hotKeys.on(w);
60
- }), F(() => v.hotKeys.off(w)), (e, t) => (l(), $(T, null, {
67
+ E(() => v.hotKeys.on(_)), K(() => v.hotKeys.off(_));
68
+ const L = b(
69
+ () => c[x.value]
70
+ ), S = b(
71
+ () => Object.keys(c).length > 0 && L.value
72
+ );
73
+ return (t, e) => (l(), p(F, null, {
61
74
  default: a(() => [
62
- s(n(Y), { title: "Cookies" }, {
75
+ u(d(X), { title: "Cookies" }, {
63
76
  content: a(() => [
64
- c("div", ee, [
65
- s(I, null, {
77
+ y("div", Y, [
78
+ u(W, null, {
66
79
  default: a(() => [
67
- (l(!0), d(k, null, _(h.value, (o, r) => (l(), d("div", {
68
- key: r,
80
+ (l(!0), w($, null, j(Object.values(d(c)), (o) => (l(), w("li", {
81
+ key: o.uid,
69
82
  class: "flex flex-col gap-1/2"
70
83
  }, [
71
- c("button", {
72
- class: "hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded text-left text-sm p-1.5 focus-visible:z-10 hover:bg-sidebar-active-b indent-padding-left",
73
- type: "button",
74
- onClick: (m) => n(g)(r)
75
- }, [
76
- s(n(L), {
77
- class: j(["h-5 -ml-px text-c-3 w-4", {
78
- "rotate-90": n(u)[r]
79
- }]),
80
- icon: "ChevronRight",
81
- size: "md"
82
- }, null, 8, ["class"]),
83
- c("span", null, N(r), 1)
84
- ], 8, te),
85
- O(c("div", oe, [
86
- (l(!0), d(k, null, _(o, (m, f) => (l(), d("div", {
87
- key: f,
88
- class: "flex flex-col gap-1/2"
89
- }, [
90
- c("button", {
91
- class: "flex gap-1.5 items-center pl-5 pr-2 py-1.5 text-left text-sm w-full break-words rounded hover:bg-b-2",
92
- type: "button",
93
- onClick: (i) => n(g)(r + f)
94
- }, [
95
- s(n(L), {
96
- class: j(["-ml-px text-c-3", {
97
- "rotate-90": n(u)[r + f]
98
- }]),
99
- icon: "ChevronRight",
100
- size: "md"
101
- }, null, 8, ["class"]),
102
- z(" " + N(f), 1)
103
- ], 8, re),
104
- O(c("div", se, [
105
- (l(!0), d(k, null, _(m, (i) => (l(), $(P, {
106
- key: i.uid,
107
- class: "cookie text-xs",
108
- type: "cookies",
109
- variable: { name: i.name, uid: i.uid },
110
- warningMessage: "Are you sure you want to delete this cookie?",
111
- onClick: A((S) => B(S, i.uid), ["prevent"]),
112
- onDelete: (S) => V(i.uid)
113
- }, null, 8, ["variable", "onClick", "onDelete"]))), 128))
114
- ], 512), [
115
- [E, C(r + f)]
116
- ])
117
- ]))), 128))
118
- ], 512), [
119
- [E, C(r)]
84
+ y("div", Z, [
85
+ (l(), p(D, {
86
+ key: o.uid,
87
+ class: "text-xs",
88
+ isDeletable: "",
89
+ type: "cookies",
90
+ variable: { name: o.name, uid: o.uid },
91
+ warningMessage: "Are you sure you want to delete this cookie?",
92
+ onClick: A((i) => V(i, o.uid), ["prevent"]),
93
+ onDelete: (i) => N(o.uid)
94
+ }, null, 8, ["variable", "onClick", "onDelete"]))
120
95
  ])
121
96
  ]))), 128))
122
97
  ]),
@@ -125,30 +100,34 @@ const ee = { class: "flex-1" }, te = ["onClick"], oe = { class: "before:bg-borde
125
100
  ])
126
101
  ]),
127
102
  button: a(() => [
128
- s(H, {
129
- click: y,
103
+ u(R, {
104
+ click: C,
130
105
  hotkey: "N"
131
106
  }, {
132
- title: a(() => t[0] || (t[0] = [
133
- z("Add Cookie")
107
+ title: a(() => e[1] || (e[1] = [
108
+ O("Add Cookie")
134
109
  ])),
135
110
  _: 1
136
111
  })
137
112
  ]),
138
113
  _: 1
139
114
  }),
140
- s(U, { class: "flex-1" }, {
115
+ u(I, { class: "flex-1" }, {
141
116
  default: a(() => [
142
- s(J),
143
- s(Q)
117
+ S.value ? (l(), p(G, { key: 0 })) : H("", !0)
144
118
  ]),
145
119
  _: 1
146
- })
120
+ }),
121
+ u(J, {
122
+ state: d(f),
123
+ onCancel: e[0] || (e[0] = (o) => d(f).hide()),
124
+ onSubmit: M
125
+ }, null, 8, ["state"])
147
126
  ]),
148
127
  _: 1
149
128
  }));
150
129
  }
151
130
  });
152
131
  export {
153
- ve as default
132
+ ke as default
154
133
  };
@@ -213,7 +213,7 @@ const Re = { class: "flex-1" }, je = ["onClick"], De = { class: "flex h-5 items-
213
213
  })),
214
214
  (v(!0), M(U, null, z(s(i), (n) => {
215
215
  var t;
216
- return v(), M("div", {
216
+ return v(), M("li", {
217
217
  key: n.uid,
218
218
  class: "flex flex-col gap-0.25"
219
219
  }, [
@@ -1 +1 @@
1
- {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cA+S8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA2ajD,wBAMG"}
1
+ {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cA8S8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA0ajD,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Request.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-90ff0226"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-bdc3d973"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };