@scalar/api-client 2.2.22 → 2.2.24

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 (127) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +69 -70
  5. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  6. package/dist/components/AddressBar/AddressBarServer.vue.js +69 -61
  7. package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
  8. package/dist/components/AddressBar/AddressBarServerItem.vue.js +17 -16
  9. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  10. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  11. package/dist/components/CodeInput/CodeInput.vue2.js +46 -46
  12. package/dist/components/CodeInput/codeVariableWidget.d.ts +4 -4
  13. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  14. package/dist/components/CodeInput/codeVariableWidget.js +42 -38
  15. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +25 -24
  16. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
  17. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  18. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +64 -55
  19. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  20. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +110 -106
  21. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +2 -2
  22. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
  23. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  24. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +38 -37
  25. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  26. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +52 -49
  27. package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
  28. package/dist/components/ImportCollection/DropEventListener.vue.js +46 -43
  29. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +40 -39
  30. package/dist/components/ImportCollection/ImportNowButton.vue.js +44 -42
  31. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +76 -69
  32. package/dist/components/ScalarAsciiArt.vue.js +1 -1
  33. package/dist/components/ScalarAsciiArt.vue2.js +22 -19
  34. package/dist/components/Search/useSearch.d.ts.map +1 -1
  35. package/dist/components/Search/useSearch.js +57 -49
  36. package/dist/components/SideNav/SideNavRouterLink.vue.d.ts.map +1 -1
  37. package/dist/components/SideNav/SideNavRouterLink.vue.js +22 -19
  38. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  39. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  40. package/dist/components/Sidebar/SidebarListElement.vue2.js +38 -36
  41. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  42. package/dist/components/TopNav/TopNav.vue.js +71 -64
  43. package/dist/layouts/App/ApiClientApp.vue.js +4 -1
  44. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  45. package/dist/layouts/Modal/ApiClientModal.vue2.js +22 -19
  46. package/dist/layouts/Web/ApiClientWeb.vue.js +4 -1
  47. package/dist/libs/create-client.d.ts +10 -10
  48. package/dist/libs/create-client.d.ts.map +1 -1
  49. package/dist/libs/create-client.js +42 -36
  50. package/dist/libs/extractAttachmentFilename.d.ts +3 -0
  51. package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
  52. package/dist/libs/extractAttachmentFilename.js +7 -7
  53. package/dist/libs/importers/curl.d.ts.map +1 -1
  54. package/dist/libs/importers/curl.js +18 -18
  55. package/dist/libs/normalize-headers.d.ts.map +1 -1
  56. package/dist/libs/normalize-headers.js +2 -2
  57. package/dist/libs/parse-curl.js +39 -36
  58. package/dist/store/active-entities.d.ts +4 -4
  59. package/dist/store/active-entities.d.ts.map +1 -1
  60. package/dist/store/active-entities.js +88 -86
  61. package/dist/store/collections.d.ts.map +1 -1
  62. package/dist/store/collections.js +29 -29
  63. package/dist/store/request-example.d.ts.map +1 -1
  64. package/dist/store/request-example.js +27 -23
  65. package/dist/store/requests.d.ts.map +1 -1
  66. package/dist/store/requests.js +94 -77
  67. package/dist/store/security-schemes.d.ts.map +1 -1
  68. package/dist/store/security-schemes.js +27 -27
  69. package/dist/store/servers.d.ts.map +1 -1
  70. package/dist/store/servers.js +18 -18
  71. package/dist/store/tags.d.ts.map +1 -1
  72. package/dist/store/tags.js +35 -33
  73. package/dist/style.css +1 -1
  74. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  75. package/dist/views/Cookies/CookieForm.vue.js +14 -9
  76. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  77. package/dist/views/Cookies/Cookies.vue2.js +39 -37
  78. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  79. package/dist/views/Environment/Environment.vue2.js +94 -89
  80. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  81. package/dist/views/Request/Request.vue.js +1 -1
  82. package/dist/views/Request/Request.vue2.js +118 -116
  83. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  84. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +28 -25
  85. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  86. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  87. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +38 -37
  88. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  89. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
  90. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +76 -73
  91. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
  92. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +80 -80
  93. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  94. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  95. package/dist/views/Request/RequestSection/RequestBody.vue2.js +192 -178
  96. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  97. package/dist/views/Request/RequestSection/RequestParams.vue.js +80 -73
  98. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  99. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +50 -48
  100. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  101. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  102. package/dist/views/Request/RequestSidebar.vue2.js +149 -144
  103. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  104. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  105. package/dist/views/Request/RequestSidebarItem.vue2.js +168 -150
  106. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  107. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  108. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +80 -80
  109. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  110. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  111. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
  112. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  113. package/dist/views/Request/components/WorkspaceDropdown.vue.js +166 -156
  114. package/dist/views/Request/handle-drag.d.ts.map +1 -1
  115. package/dist/views/Request/handle-drag.js +37 -31
  116. package/dist/views/Request/hooks/useOpenApiWatcher.js +27 -27
  117. package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
  118. package/dist/views/Request/libs/live-sync.js +147 -130
  119. package/dist/views/Request/types/sidebar-item.d.ts +4 -1
  120. package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
  121. package/dist/views/Servers/ServerForm.vue.js +38 -35
  122. package/dist/views/Servers/Servers.vue2.js +38 -35
  123. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  124. package/dist/views/Settings/Settings.vue2.js +15 -15
  125. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
  126. package/dist/views/Settings/SettingsGeneral.vue.js +206 -174
  127. package/package.json +8 -8
@@ -1,208 +1,218 @@
1
- import { defineComponent as A, computed as L, ref as W, openBlock as p, createElementBlock as D, createElementVNode as l, createVNode as s, unref as e, withCtx as n, Fragment as O, renderList as I, createBlock as h, withModifiers as i, toDisplayString as z } from "vue";
2
- import U from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
3
- import V from "../../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
4
- import { useActiveEntities as q } from "../../../store/active-entities.js";
5
- import { useModal as C, ScalarDropdown as S, ScalarDropdownItem as m, ScalarListboxCheckbox as F, ScalarIcon as u, ScalarTooltip as P, ScalarButton as $, ScalarDropdownDivider as Y, ScalarModal as E } from "@scalar/components";
6
- import { useRouter as G } from "vue-router";
7
- import { useWorkspace as H } from "../../../store/store.js";
8
- const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font-bold m-0 flex gap-1.5 items-center" }, Q = { class: "line-clamp-1 text-left" }, X = { class: "text-ellipsis overflow-hidden" }, Z = { class: "flex items-center justify-center h-4 w-4" }, ie = /* @__PURE__ */ A({
1
+ import { defineComponent as L, computed as O, ref as D, openBlock as p, createElementBlock as z, createElementVNode as a, createVNode as s, unref as t, withCtx as o, Fragment as I, renderList as U, createBlock as g, withModifiers as c, toDisplayString as C } from "vue";
2
+ import V from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
3
+ import q from "../../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
4
+ import { useActiveEntities as F } from "../../../store/active-entities.js";
5
+ import { useModal as S, ScalarDropdown as $, ScalarDropdownItem as u, ScalarListboxCheckbox as P, ScalarIcon as m, ScalarTooltip as Y, ScalarButton as E, ScalarDropdownDivider as G, ScalarModal as N } from "@scalar/components";
6
+ import { useRouter as H } from "vue-router";
7
+ import { useWorkspace as J } from "../../../store/store.js";
8
+ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font-bold m-0 flex gap-1.5 items-center" }, X = { class: "line-clamp-1 text-left" }, Z = { class: "text-ellipsis overflow-hidden" }, ee = { class: "flex items-center justify-center h-4 w-4" }, ce = /* @__PURE__ */ L({
9
9
  __name: "WorkspaceDropdown",
10
- setup(ee) {
11
- const { activeWorkspace: f } = q(), { workspaces: c, workspaceMutators: g, events: N } = H(), { push: b } = G(), T = (o) => {
12
- o !== f.value.uid && b({
10
+ setup(te) {
11
+ const { activeWorkspace: f } = F(), { workspaces: d, workspaceMutators: b, events: T } = J(), { push: _ } = H(), j = (n) => {
12
+ var e;
13
+ n !== ((e = f.value) == null ? void 0 : e.uid) && _({
13
14
  name: "workspace",
14
15
  params: {
15
- workspace: o
16
+ workspace: n
16
17
  }
17
18
  });
18
- }, _ = L(() => Object.keys(c).length === 1), j = () => N.commandPalette.emit({ commandName: "Create Workspace" }), v = W(""), r = W(""), w = C(), k = C(), y = (o) => {
19
- v.value = c[o].name, r.value = o, w.show();
20
- }, B = (o) => {
21
- o.trim() && (g.edit(r.value, "name", o.trim()), w.hide());
22
- }, M = (o) => {
23
- v.value = c[o].name, r.value = o, k.show();
24
- }, R = async () => {
25
- if (!_.value) {
26
- const o = f.value.uid === r.value, t = { ...c };
27
- if (delete t[r.value], g.delete(r.value), o) {
28
- const d = Object.keys(t)[0];
29
- await b({
19
+ }, y = O(() => Object.keys(d).length === 1), B = () => T.commandPalette.emit({ commandName: "Create Workspace" }), v = D(""), i = D(""), w = S(), k = S(), M = (n) => {
20
+ const e = d[n];
21
+ e && (v.value = e.name, i.value = n, w.show());
22
+ }, R = (n) => {
23
+ n.trim() && (b.edit(i.value, "name", n.trim()), w.hide());
24
+ }, W = (n) => {
25
+ const e = d[n];
26
+ e && (v.value = e.name, i.value = n, k.show());
27
+ }, A = async () => {
28
+ var n;
29
+ if (!y.value) {
30
+ const e = ((n = f.value) == null ? void 0 : n.uid) === i.value, l = { ...d };
31
+ if (delete l[i.value], b.delete(i.value), e) {
32
+ const r = Object.keys(l)[0];
33
+ await _({
30
34
  name: "workspace",
31
35
  params: {
32
- workspace: d
36
+ workspace: r
33
37
  }
34
38
  });
35
39
  }
36
40
  }
37
41
  k.hide();
38
42
  };
39
- return (o, t) => (p(), D("div", null, [
40
- l("div", J, [
41
- s(e(S), null, {
42
- items: n(() => [
43
- (p(!0), D(O, null, I(e(c), (d, a) => (p(), h(e(m), {
44
- key: a,
43
+ return (n, e) => (p(), z("div", null, [
44
+ a("div", K, [
45
+ s(t($), null, {
46
+ items: o(() => [
47
+ (p(!0), z(I, null, U(t(d), (l, r) => (p(), g(t(u), {
48
+ key: r,
45
49
  class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
46
- onClick: i((x) => T(a), ["stop"])
50
+ onClick: c((x) => j(r), ["stop"])
47
51
  }, {
48
- default: n(() => [
49
- s(e(F), {
50
- selected: e(f).uid === a
51
- }, null, 8, ["selected"]),
52
- l("span", X, z(d.name), 1),
53
- s(e(S), {
54
- placement: "right-start",
55
- teleport: ""
56
- }, {
57
- items: n(() => [
58
- s(e(m), {
59
- class: "flex gap-2",
60
- onMousedown: (x) => y(a),
61
- onTouchend: i((x) => y(a), ["prevent"])
62
- }, {
63
- default: n(() => [
64
- s(e(u), {
65
- class: "inline-flex",
66
- icon: "Edit",
67
- size: "md",
68
- thickness: "1.5"
69
- }),
70
- t[4] || (t[4] = l("span", null, "Rename", -1))
71
- ]),
72
- _: 2
73
- }, 1032, ["onMousedown", "onTouchend"]),
74
- _.value ? (p(), h(e(P), {
75
- key: 0,
76
- class: "z-overlay",
77
- side: "bottom"
78
- }, {
79
- trigger: n(() => [
80
- s(e(m), {
81
- class: "flex gap-2 w-full",
82
- disabled: "",
83
- onMousedown: t[0] || (t[0] = i(() => {
84
- }, ["prevent"])),
85
- onTouchend: t[1] || (t[1] = i(() => {
86
- }, ["prevent"]))
87
- }, {
88
- default: n(() => [
89
- s(e(u), {
90
- class: "inline-flex",
91
- icon: "Delete",
92
- size: "md",
93
- thickness: "1.5"
94
- }),
95
- t[5] || (t[5] = l("span", null, "Delete", -1))
96
- ]),
97
- _: 1
98
- })
99
- ]),
100
- content: n(() => t[6] || (t[6] = [
101
- l("div", { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 z-context p-2 text-xxs leading-5 z-10 text-c-1" }, [
102
- l("div", { class: "flex items-center text-c-2" }, [
103
- l("span", null, "Only workspace cannot be deleted.")
104
- ])
105
- ], -1)
106
- ])),
107
- _: 1
108
- })) : (p(), h(e(m), {
109
- key: 1,
110
- class: "flex !gap-2",
111
- onMousedown: i((x) => M(a), ["prevent"]),
112
- onTouchend: i((x) => M(a), ["prevent"])
113
- }, {
114
- default: n(() => [
115
- s(e(u), {
116
- class: "inline-flex",
117
- icon: "Delete",
118
- size: "sm",
119
- thickness: "1.5"
120
- }),
121
- t[7] || (t[7] = l("span", null, "Delete", -1))
122
- ]),
123
- _: 2
124
- }, 1032, ["onMousedown", "onTouchend"]))
125
- ]),
126
- default: n(() => [
127
- s(e($), {
128
- class: "px-0.5 py-0 hover:bg-b-3 group-hover/item:flex aspect-square ml-auto -mr-1 h-fit",
129
- size: "sm",
130
- type: "button",
131
- variant: "ghost"
132
- }, {
133
- default: n(() => [
134
- s(e(u), {
135
- icon: "Ellipses",
136
- size: "sm"
137
- })
138
- ]),
139
- _: 1
140
- })
141
- ]),
142
- _: 2
143
- }, 1024)
144
- ]),
52
+ default: o(() => {
53
+ var x;
54
+ return [
55
+ s(t(P), {
56
+ selected: ((x = t(f)) == null ? void 0 : x.uid) === r
57
+ }, null, 8, ["selected"]),
58
+ a("span", Z, C(l.name), 1),
59
+ s(t($), {
60
+ placement: "right-start",
61
+ teleport: ""
62
+ }, {
63
+ items: o(() => [
64
+ s(t(u), {
65
+ class: "flex gap-2",
66
+ onMousedown: (h) => M(r),
67
+ onTouchend: c((h) => M(r), ["prevent"])
68
+ }, {
69
+ default: o(() => [
70
+ s(t(m), {
71
+ class: "inline-flex",
72
+ icon: "Edit",
73
+ size: "md",
74
+ thickness: "1.5"
75
+ }),
76
+ e[4] || (e[4] = a("span", null, "Rename", -1))
77
+ ]),
78
+ _: 2
79
+ }, 1032, ["onMousedown", "onTouchend"]),
80
+ y.value ? (p(), g(t(Y), {
81
+ key: 0,
82
+ class: "z-overlay",
83
+ side: "bottom"
84
+ }, {
85
+ trigger: o(() => [
86
+ s(t(u), {
87
+ class: "flex gap-2 w-full",
88
+ disabled: "",
89
+ onMousedown: e[0] || (e[0] = c(() => {
90
+ }, ["prevent"])),
91
+ onTouchend: e[1] || (e[1] = c(() => {
92
+ }, ["prevent"]))
93
+ }, {
94
+ default: o(() => [
95
+ s(t(m), {
96
+ class: "inline-flex",
97
+ icon: "Delete",
98
+ size: "md",
99
+ thickness: "1.5"
100
+ }),
101
+ e[5] || (e[5] = a("span", null, "Delete", -1))
102
+ ]),
103
+ _: 1
104
+ })
105
+ ]),
106
+ content: o(() => e[6] || (e[6] = [
107
+ a("div", { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 z-context p-2 text-xxs leading-5 z-10 text-c-1" }, [
108
+ a("div", { class: "flex items-center text-c-2" }, [
109
+ a("span", null, "Only workspace cannot be deleted.")
110
+ ])
111
+ ], -1)
112
+ ])),
113
+ _: 1
114
+ })) : (p(), g(t(u), {
115
+ key: 1,
116
+ class: "flex !gap-2",
117
+ onMousedown: c((h) => W(r), ["prevent"]),
118
+ onTouchend: c((h) => W(r), ["prevent"])
119
+ }, {
120
+ default: o(() => [
121
+ s(t(m), {
122
+ class: "inline-flex",
123
+ icon: "Delete",
124
+ size: "sm",
125
+ thickness: "1.5"
126
+ }),
127
+ e[7] || (e[7] = a("span", null, "Delete", -1))
128
+ ]),
129
+ _: 2
130
+ }, 1032, ["onMousedown", "onTouchend"]))
131
+ ]),
132
+ default: o(() => [
133
+ s(t(E), {
134
+ class: "px-0.5 py-0 hover:bg-b-3 group-hover/item:flex aspect-square ml-auto -mr-1 h-fit",
135
+ size: "sm",
136
+ type: "button",
137
+ variant: "ghost"
138
+ }, {
139
+ default: o(() => [
140
+ s(t(m), {
141
+ icon: "Ellipses",
142
+ size: "sm"
143
+ })
144
+ ]),
145
+ _: 1
146
+ })
147
+ ]),
148
+ _: 2
149
+ }, 1024)
150
+ ];
151
+ }),
145
152
  _: 2
146
153
  }, 1032, ["onClick"]))), 128)),
147
- s(e(Y)),
148
- s(e(m), {
154
+ s(t(G)),
155
+ s(t(u), {
149
156
  class: "flex items-center gap-1.5",
150
- onClick: j
157
+ onClick: B
151
158
  }, {
152
- default: n(() => [
153
- l("div", Z, [
154
- s(e(u), {
159
+ default: o(() => [
160
+ a("div", ee, [
161
+ s(t(m), {
155
162
  icon: "Add",
156
163
  size: "sm"
157
164
  })
158
165
  ]),
159
- t[8] || (t[8] = l("span", null, "Create Workspace", -1))
166
+ e[8] || (e[8] = a("span", null, "Create Workspace", -1))
160
167
  ]),
161
168
  _: 1
162
169
  })
163
170
  ]),
164
- default: n(() => [
165
- s(e($), {
171
+ default: o(() => [
172
+ s(t(E), {
166
173
  class: "font-normal h-full justify-start line-clamp-1 py-1.5 px-1.5 text-c-1 hover:bg-b-2 w-fit",
167
174
  fullWidth: "",
168
175
  variant: "ghost"
169
176
  }, {
170
- default: n(() => [
171
- l("div", K, [
172
- l("h2", Q, z(e(f).name), 1)
173
- ])
174
- ]),
177
+ default: o(() => {
178
+ var l;
179
+ return [
180
+ a("div", Q, [
181
+ a("h2", X, C((l = t(f)) == null ? void 0 : l.name), 1)
182
+ ])
183
+ ];
184
+ }),
175
185
  _: 1
176
186
  })
177
187
  ]),
178
188
  _: 1
179
189
  })
180
190
  ]),
181
- s(e(E), {
191
+ s(t(N), {
182
192
  size: "xxs",
183
- state: e(k),
193
+ state: t(k),
184
194
  title: "Delete workspace"
185
195
  }, {
186
- default: n(() => [
187
- s(U, {
196
+ default: o(() => [
197
+ s(V, {
188
198
  variableName: v.value,
189
199
  warningMessage: "This cannot be undone. You’re about to delete the workspace and everything inside it.",
190
- onClose: t[2] || (t[2] = (d) => e(k).hide()),
191
- onDelete: R
200
+ onClose: e[2] || (e[2] = (l) => t(k).hide()),
201
+ onDelete: A
192
202
  }, null, 8, ["variableName"])
193
203
  ]),
194
204
  _: 1
195
205
  }, 8, ["state"]),
196
- s(e(E), {
206
+ s(t(N), {
197
207
  size: "xxs",
198
- state: e(w),
208
+ state: t(w),
199
209
  title: "Rename Workspace"
200
210
  }, {
201
- default: n(() => [
202
- s(V, {
211
+ default: o(() => [
212
+ s(q, {
203
213
  name: v.value,
204
- onClose: t[3] || (t[3] = (d) => e(w).hide()),
205
- onEdit: B
214
+ onClose: e[3] || (e[3] = (l) => t(w).hide()),
215
+ onEdit: R
206
216
  }, null, 8, ["name"])
207
217
  ]),
208
218
  _: 1
@@ -211,5 +221,5 @@ const J = { class: "flex items-center text-sm w-[inherit]" }, K = { class: "font
211
221
  }
212
222
  });
213
223
  export {
214
- ie as default
224
+ ce as default
215
225
  };
@@ -1 +1 @@
1
- {"version":3,"file":"handle-drag.d.ts","sourceRoot":"","sources":["../../../src/views/Request/handle-drag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAElE,0BAA0B;AAC1B,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,EACvD,EACE,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,IAAI,EACJ,WAAW,EACX,iBAAiB,GAClB,EAAE,cAAc;kCASoB,YAAY,eAAe,WAAW;gCAmE3D,YAAY,eACb,WAAW;EAoB3B"}
1
+ {"version":3,"file":"handle-drag.d.ts","sourceRoot":"","sources":["../../../src/views/Request/handle-drag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAElE,0BAA0B;AAC1B,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,EACvD,EACE,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,IAAI,EACJ,WAAW,EACX,iBAAiB,GAClB,EAAE,cAAc;kCASoB,YAAY,eAAe,WAAW;gCAwE3D,YAAY,eACb,WAAW;EAoB3B"}
@@ -1,54 +1,60 @@
1
- function I(s, {
1
+ function E(s, {
2
2
  collections: r,
3
- collectionMutators: o,
4
- isReadOnly: D,
3
+ collectionMutators: x,
4
+ isReadOnly: I,
5
5
  tags: l,
6
- tagMutators: p,
7
- workspaceMutators: x
6
+ tagMutators: U,
7
+ workspaceMutators: a
8
8
  }) {
9
- function U(n, f) {
10
- r[n] ? o.edit(n, "children", f) : l[n] && p.edit(n, "children", f);
9
+ function D(i, f) {
10
+ r[i] ? x.edit(i, "children", f) : l[i] && U.edit(i, "children", f);
11
11
  }
12
- function v(n, f) {
13
- if (!n || !f) return;
14
- const { id: d, parentId: i } = n, { id: t, parentId: u, offset: a } = f;
15
- if (i ? r[i] ? o.edit(
16
- i,
12
+ function P(i, f) {
13
+ var p, v, C, b;
14
+ if (!i || !f) return;
15
+ const { id: d, parentId: n } = i, { id: t, parentId: u, offset: c } = f;
16
+ if (n ? r[n] ? x.edit(
17
+ n,
17
18
  "children",
18
- r[i].children.filter(
19
+ r[n].children.filter(
19
20
  (e) => e !== d
20
21
  )
21
- ) : l[i] && p.edit(
22
- i,
22
+ ) : l[n] && U.edit(
23
+ n,
23
24
  "children",
24
- l[i].children.filter((e) => e !== d)
25
- ) : x.edit(
26
- s.value.uid,
25
+ l[n].children.filter((e) => e !== d)
26
+ ) : a.edit(
27
+ ((p = s.value) == null ? void 0 : p.uid) ?? "",
27
28
  "collections",
28
- s.value.collections.filter((e) => e !== d)
29
- ), a === 2) {
29
+ ((v = s.value) == null ? void 0 : v.collections.filter(
30
+ (e) => e !== d
31
+ )) ?? []
32
+ ), c === 2) {
30
33
  const e = r[t] || l[t];
31
- U(t, [...e.children, d]);
34
+ D(t, [
35
+ ...(e == null ? void 0 : e.children) ?? [],
36
+ d
37
+ ]);
32
38
  } else if (u) {
33
- const h = [...(r[u] || l[u]).children], c = h.findIndex((C) => t === C) ?? 0;
34
- h.splice(c + a, 0, d), U(u, h);
39
+ const e = r[u] || l[u], h = [...(e == null ? void 0 : e.children) ?? []], o = h.findIndex((w) => t === w) ?? 0;
40
+ h.splice(o + c, 0, d), D(u, h);
35
41
  } else {
36
- const e = [...s.value.collections], h = e.findIndex((c) => t === c) ?? 0;
37
- e.splice(h + a, 0, d), x.edit(
38
- s.value.uid,
42
+ const e = [...((C = s.value) == null ? void 0 : C.collections) ?? []], h = e.findIndex((o) => t === o) ?? 0;
43
+ e.splice(h + c, 0, d), a.edit(
44
+ ((b = s.value) == null ? void 0 : b.uid) ?? "",
39
45
  "collections",
40
46
  e
41
47
  );
42
48
  }
43
49
  }
44
50
  return {
45
- handleDragEnd: v,
46
- isDroppable: (n, f) => {
47
- var d, i;
48
- return !(D || !r[n.id] && f.offset !== 2 || r[n.id] && ((i = (d = r[f.id]) == null ? void 0 : d.info) == null ? void 0 : i.title) === "Drafts");
51
+ handleDragEnd: P,
52
+ isDroppable: (i, f) => {
53
+ var d, n;
54
+ return !(I || !r[i.id] && f.offset !== 2 || r[i.id] && ((n = (d = r[f.id]) == null ? void 0 : d.info) == null ? void 0 : n.title) === "Drafts");
49
55
  }
50
56
  };
51
57
  }
52
58
  export {
53
- I as dragHandlerFactory
59
+ E as dragHandlerFactory
54
60
  };
@@ -1,48 +1,48 @@
1
- import { useActiveEntities as E } from "../../../store/active-entities.js";
1
+ import { useActiveEntities as R } from "../../../store/active-entities.js";
2
2
  import { specDictionary as f } from "../../../store/import-spec.js";
3
- import { combineRenameDiffs as R, mutateCollectionDiff as S, mutateSecuritySchemeDiff as d, mutateServerDiff as g, mutateTagDiff as D, mutateRequestDiff as T } from "../libs/live-sync.js";
4
- import { fetchSpecFromUrl as M, createHash as I } from "@scalar/oas-utils/helpers";
5
- import { parseSchema as v } from "@scalar/oas-utils/transforms";
6
- import { useToasts as U } from "@scalar/use-toasts";
7
- import { useTimeoutPoll as C } from "@vueuse/core";
8
- import L from "microdiff";
9
- import { watch as N } from "vue";
10
- import { useWorkspace as b } from "../../../store/store.js";
11
- const P = 5 * 1e3, k = 60 * 1e3, B = () => {
12
- const { toast: h } = U(), c = E(), o = b(), { activeCollection: t, activeWorkspace: O } = c, { collectionMutators: n } = o, r = (e) => h(
3
+ import { combineRenameDiffs as S, mutateCollectionDiff as d, mutateSecuritySchemeDiff as g, mutateServerDiff as D, mutateTagDiff as T, mutateRequestDiff as M } from "../libs/live-sync.js";
4
+ import { fetchSpecFromUrl as I, createHash as U } from "@scalar/oas-utils/helpers";
5
+ import { parseSchema as O } from "@scalar/oas-utils/transforms";
6
+ import { useToasts as C } from "@scalar/use-toasts";
7
+ import { useTimeoutPoll as L } from "@vueuse/core";
8
+ import N from "microdiff";
9
+ import { watch as b } from "vue";
10
+ import { useWorkspace as P } from "../../../store/store.js";
11
+ const k = 5 * 1e3, q = 60 * 1e3, J = () => {
12
+ const { toast: h } = C(), c = R(), o = P(), { activeCollection: t, activeWorkspace: W } = c, { collectionMutators: n } = o, r = (e) => h(
13
13
  `[useOpenApiWatcher] Changes to the ${e} were not applied`,
14
14
  "error"
15
- ), W = (e) => {
16
- e.path[0] === "info" || e.path[0] === "security" ? S(e, c, o) || r("collection") : e.path[0] === "components" && e.path[1] === "securitySchemes" ? d(e, c, o) || r("securitySchemes") : e.path[0] === "servers" ? g(e, c, o) || r("servers") : e.path[0] === "tags" ? D(e, c, o) || r("tags") : e.path[0] === "paths" && (T(e, c, o) || r("requests"));
17
- }, { pause: p, resume: m } = C(async () => {
18
- var l;
15
+ ), w = (e) => {
16
+ e.path[0] === "info" || e.path[0] === "security" ? d(e, c, o) || r("collection") : e.path[0] === "components" && e.path[1] === "securitySchemes" ? g(e, c, o) || r("securitySchemes") : e.path[0] === "servers" ? D(e, c, o) || r("servers") : e.path[0] === "tags" ? T(e, c, o) || r("tags") : e.path[0] === "paths" && (M(e, c, o) || r("requests"));
17
+ }, { pause: p, resume: m } = L(async () => {
18
+ var l, v;
19
19
  const e = (l = t.value) == null ? void 0 : l.documentUrl;
20
20
  if (!e) return;
21
21
  const s = f[e];
22
22
  try {
23
- const a = await M(
23
+ const a = await I(
24
24
  e,
25
- O.value.proxyUrl,
25
+ (v = W.value) == null ? void 0 : v.proxyUrl,
26
26
  !1
27
- ), u = I(a);
27
+ ), u = U(a);
28
28
  if (n.edit(
29
29
  t.value.uid,
30
30
  "watchModeStatus",
31
31
  "WATCHING"
32
32
  ), s != null && s.hash)
33
33
  if (s.hash && s.hash !== u) {
34
- const { schema: i } = await v(a), w = L(s.schema, i), A = R(w);
34
+ const { schema: i } = await O(a), A = N(s.schema, i), y = S(A);
35
35
  try {
36
- A.forEach(W), f[e] = {
36
+ y.forEach(w), f[e] = {
37
37
  hash: u,
38
38
  schema: i
39
39
  };
40
- } catch (y) {
41
- console.error("[useOpenApiWatcher] Error:", y);
40
+ } catch (E) {
41
+ console.error("[useOpenApiWatcher] Error:", E);
42
42
  }
43
43
  } else console.log("[useOpenApiWatcher] No changes detected yet…");
44
44
  else {
45
- const { schema: i } = await v(a);
45
+ const { schema: i } = await O(a);
46
46
  i && (f[e] = {
47
47
  hash: u,
48
48
  schema: i
@@ -58,10 +58,10 @@ const P = 5 * 1e3, k = 60 * 1e3, B = () => {
58
58
  "error"
59
59
  ), setTimeout(() => {
60
60
  console.info("[useOpenApiWatcher] Resuming watcher"), m();
61
- }, k);
61
+ }, q);
62
62
  }
63
- }, P);
64
- N(
63
+ }, k);
64
+ b(
65
65
  [
66
66
  () => {
67
67
  var e;
@@ -83,5 +83,5 @@ const P = 5 * 1e3, k = 60 * 1e3, B = () => {
83
83
  );
84
84
  };
85
85
  export {
86
- B as useOpenApiWatcher
86
+ J as useOpenApiWatcher
87
87
  };
@@ -1 +1 @@
1
- {"version":3,"file":"live-sync.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/live-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAelE,OAAO,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EAEf,MAAM,6BAA6B,CAAA;AAEpC,OAAkB,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAK,MAAM,KAAK,CAAA;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,SACvB,UAAU,EAAE,eACN,MAAM,EAAE,KACnB,UAAU,EAqFZ,CAAA;AAED,kEAAkE;AAClE,eAAO,MAAM,YAAY,GAAI,CAAC,OACvB,MAAM,EAAE,aACF,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,aACjB,CAAC,QAAQ,EAAE,CAAC,KAAK,OAAO,KAClC,CAAC,GAAG,IAMN,CAAA;AASD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WACpB,SAAS,QACX,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KACxB,SAAS,GAAG,IAqDd,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,UACjB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,QAC/B,UAAU,KACf;IACD,0DAA0D;IAC1D,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;IACb,mGAAmG;IACnG,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;IACrB,2DAA2D;IAC3D,KAAK,EAAE,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;CACzC,GAAG,IAwBH,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,SACzB,UAAU,wBACM,mBAAmB,0BACjB,cAAc,KACrC,OA0CF,CAAA;AAwBD;;GAEG;AACH,eAAO,MAAM,iBAAiB,SACtB,UAAU,wBACM,mBAAmB,SAClC,cAAc,KACpB,OAwIF,CAAA;AAED,mGAAmG;AACnG,eAAO,MAAM,gBAAgB,SACrB,UAAU,wBACM,mBAAmB,+BACZ,cAAc,KAC1C,OAoCF,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,aAAa,SAClB,UAAU,wBACM,mBAAmB,yBAClB,cAAc,KACpC,OA+BF,CAAA;AAED,sCAAsC;AACtC,eAAO,MAAM,iBAAiB,WACpB,SAAS,OACZ,MAAM,SACJ,MAAM,KACZ,SAAS,GAAG,IAmBd,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,SAC7B,UAAU,wBACM,mBAAmB,+CACI,cAAc,KAC1D,OA0CF,CAAA"}
1
+ {"version":3,"file":"live-sync.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/live-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAelE,OAAO,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EAEf,MAAM,6BAA6B,CAAA;AAEpC,OAAkB,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAK,MAAM,KAAK,CAAA;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,SACvB,UAAU,EAAE,eACN,MAAM,EAAE,KACnB,UAAU,EA8FZ,CAAA;AAED,kEAAkE;AAClE,eAAO,MAAM,YAAY,GAAI,CAAC,OACvB,MAAM,EAAE,aACF,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,aACjB,CAAC,QAAQ,EAAE,CAAC,KAAK,OAAO,KAClC,CAAC,GAAG,IAMN,CAAA;AASD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WACpB,SAAS,QACX,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KACxB,SAAS,GAAG,IAqDd,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,UACjB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,QAC/B,UAAU,KACf;IACD,0DAA0D;IAC1D,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;IACb,mGAAmG;IACnG,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;IACrB,2DAA2D;IAC3D,KAAK,EAAE,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;CACzC,GAAG,IAwBH,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,SACzB,UAAU,wBACM,mBAAmB,0BACjB,cAAc,KACrC,OA0CF,CAAA;AAwBD;;GAEG;AACH,eAAO,MAAM,iBAAiB,SACtB,UAAU,wBACM,mBAAmB,SAClC,cAAc,KACpB,OA2IF,CAAA;AAED,mGAAmG;AACnG,eAAO,MAAM,gBAAgB,SACrB,UAAU,wBACM,mBAAmB,+BACZ,cAAc,KAC1C,OAsCF,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,aAAa,SAClB,UAAU,wBACM,mBAAmB,yBAClB,cAAc,KACpC,OAmCF,CAAA;AAED,sCAAsC;AACtC,eAAO,MAAM,iBAAiB,WACpB,SAAS,OACZ,MAAM,SACJ,MAAM,KACZ,SAAS,GAAG,IAmBd,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,SAC7B,UAAU,wBACM,mBAAmB,+CACI,cAAc,KAC1D,OA8CF,CAAA"}