@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,103 +1,135 @@
1
- import { defineComponent as A, computed as w, ref as p, watch as h, nextTick as N, openBlock as n, createElementBlock as i, withDirectives as T, withKeys as j, vModelText as I, createBlock as k, unref as a, withCtx as d, Fragment as y, renderList as E, createElementVNode as c, normalizeClass as K, createVNode as o, createTextVNode as R, toDisplayString as C, createCommentVNode as $ } from "vue";
2
- import { ScalarDropdown as F, ScalarDropdownItem as g, ScalarIcon as f, ScalarDropdownDivider as L, ScalarButton as M } from "@scalar/components";
3
- const U = { class: "w-full" }, W = { class: "text-c-1" }, q = { class: "flex items-center justify-center h-4 w-4" }, O = /* @__PURE__ */ A({
1
+ import { defineComponent as O, computed as m, ref as y, watch as S, nextTick as E, openBlock as u, createElementBlock as f, createBlock as v, unref as a, withCtx as n, createVNode as s, createElementVNode as d, toDisplayString as w, withDirectives as K, withKeys as M, vModelText as R, Fragment as C, renderList as U, normalizeClass as W, createTextVNode as $, createCommentVNode as _ } from "vue";
2
+ import { ScalarComboboxMultiselect as F, ScalarButton as b, ScalarIcon as h, ScalarDropdown as L, ScalarDropdownItem as D, ScalarDropdownDivider as q } from "@scalar/components";
3
+ const G = { class: "pr-4 w-full has-[:focus-visible]:outline has-[:focus-visible]:rounded-[4px] -outline-offset-1" }, H = { class: "text-c-1 whitespace-nowrap" }, J = { class: "text-c-1" }, P = { class: "flex items-center justify-center h-4 w-4" }, Z = /* @__PURE__ */ O({
4
4
  __name: "DataTableInputSelect",
5
5
  props: {
6
6
  modelValue: {},
7
7
  value: {},
8
8
  default: {},
9
- canAddCustomValue: { type: Boolean, default: !0 }
9
+ canAddCustomValue: { type: Boolean, default: !0 },
10
+ type: {}
10
11
  },
11
12
  emits: ["update:modelValue"],
12
- setup(S, { emit: _ }) {
13
- const s = S, m = _, D = w(() => s.value ?? []), r = p(!1), u = p(""), v = p(null);
14
- h(u, (e) => {
15
- m("update:modelValue", e);
13
+ setup(B, { emit: j }) {
14
+ const r = B, c = j, p = m(() => r.value ?? []), i = y(!1), o = y(""), x = y(null);
15
+ S(o, (e) => {
16
+ c("update:modelValue", e);
16
17
  });
17
- const V = (e) => {
18
- m("update:modelValue", e), r.value = !1;
19
- }, B = () => {
20
- u.value.trim() && (V(u.value), u.value = "");
21
- }, b = () => {
22
- u.value.trim() || (m("update:modelValue", ""), r.value = !1);
23
- }, z = (e) => s.modelValue.toString() === e;
24
- h(r, (e) => {
25
- e && N(() => {
18
+ const k = (e) => {
19
+ c("update:modelValue", e), i.value = !1;
20
+ }, z = () => {
21
+ o.value.trim() && (k(o.value), o.value = "");
22
+ }, A = () => {
23
+ o.value.trim() || (c("update:modelValue", ""), i.value = !1);
24
+ }, N = (e) => r.modelValue.toString() === e;
25
+ S(i, (e) => {
26
+ e && E(() => {
26
27
  var t;
27
- (t = v.value) == null || t.focus();
28
+ (t = x.value) == null || t.focus();
28
29
  });
29
30
  });
30
- const x = w(() => s.modelValue !== void 0 ? s.modelValue : s.default);
31
- return (e, t) => (n(), i("div", U, [
32
- r.value ? T((n(), i("input", {
31
+ const g = m(() => r.modelValue !== void 0 ? r.modelValue : r.default), V = m(() => {
32
+ const e = new Set(r.modelValue.toString().split(", "));
33
+ return p.value.filter((t) => e.has(t)).map((t) => ({ id: t, label: t, value: t }));
34
+ }), T = m(
35
+ () => p.value.map((e) => ({ id: e, label: e, value: e }))
36
+ ), I = (e) => {
37
+ const t = e.map((l) => l.value);
38
+ c("update:modelValue", t.join(", "));
39
+ };
40
+ return (e, t) => (u(), f("div", G, [
41
+ e.type === "array" ? (u(), v(a(F), {
33
42
  key: 0,
43
+ modelValue: V.value,
44
+ options: T.value,
45
+ "onUpdate:modelValue": I
46
+ }, {
47
+ default: n(() => [
48
+ s(a(b), {
49
+ class: "gap-1.5 font-normal h-full justify-start px-2 py-1.5 custom-scroll pr-6 outline-none",
50
+ fullWidth: "",
51
+ variant: "ghost"
52
+ }, {
53
+ default: n(() => [
54
+ d("span", H, w(V.value.length > 0 ? V.value.map((l) => l.label).join(", ") : "Select a value"), 1),
55
+ s(a(h), {
56
+ icon: "ChevronDown",
57
+ size: "md"
58
+ })
59
+ ]),
60
+ _: 1
61
+ })
62
+ ]),
63
+ _: 1
64
+ }, 8, ["modelValue", "options"])) : i.value ? K((u(), f("input", {
65
+ key: 1,
34
66
  ref_key: "inputRef",
35
- ref: v,
36
- "onUpdate:modelValue": t[0] || (t[0] = (l) => u.value = l),
67
+ ref: x,
68
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => o.value = l),
37
69
  class: "border-none text-c-1 min-w-0 w-full px-2 py-1.5 outline-none",
38
70
  placeholder: "Value",
39
71
  type: "text",
40
- onBlur: b,
41
- onKeyup: j(B, ["enter"])
72
+ onBlur: A,
73
+ onKeyup: M(z, ["enter"])
42
74
  }, null, 544)), [
43
- [I, u.value]
44
- ]) : (n(), k(a(F), {
45
- key: 1,
75
+ [R, o.value]
76
+ ]) : (u(), v(a(L), {
77
+ key: 2,
46
78
  resize: "",
47
- value: x.value
79
+ value: g.value
48
80
  }, {
49
- items: d(() => [
50
- (n(!0), i(y, null, E(D.value, (l) => (n(), k(a(g), {
81
+ items: n(() => [
82
+ (u(!0), f(C, null, U(p.value, (l) => (u(), v(a(D), {
51
83
  key: l,
52
84
  class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden",
53
85
  value: l,
54
- onClick: (G) => V(l)
86
+ onClick: (Q) => k(l)
55
87
  }, {
56
- default: d(() => [
57
- c("div", {
58
- class: K([
88
+ default: n(() => [
89
+ d("div", {
90
+ class: W([
59
91
  "flex items-center justify-center rounded-full p-[3px] w-4 h-4",
60
- z(l) ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
92
+ N(l) ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
61
93
  ])
62
94
  }, [
63
- o(a(f), {
95
+ s(a(h), {
64
96
  class: "size-2.5",
65
97
  icon: "Checkmark",
66
98
  thickness: "3.5"
67
99
  })
68
100
  ], 2),
69
- R(" " + C(l), 1)
101
+ $(" " + w(l), 1)
70
102
  ]),
71
103
  _: 2
72
104
  }, 1032, ["value", "onClick"]))), 128)),
73
- e.canAddCustomValue ? (n(), i(y, { key: 0 }, [
74
- o(a(L)),
75
- o(a(g), {
105
+ e.canAddCustomValue ? (u(), f(C, { key: 0 }, [
106
+ p.value.length ? (u(), v(a(q), { key: 0 })) : _("", !0),
107
+ s(a(D), {
76
108
  class: "flex items-center gap-1.5",
77
- onClick: t[1] || (t[1] = (l) => r.value = !0)
109
+ onClick: t[1] || (t[1] = (l) => i.value = !0)
78
110
  }, {
79
- default: d(() => [
80
- c("div", q, [
81
- o(a(f), {
111
+ default: n(() => [
112
+ d("div", P, [
113
+ s(a(h), {
82
114
  icon: "Add",
83
115
  size: "sm"
84
116
  })
85
117
  ]),
86
- t[2] || (t[2] = c("span", null, "Add value", -1))
118
+ t[2] || (t[2] = d("span", null, "Add value", -1))
87
119
  ]),
88
120
  _: 1
89
121
  })
90
- ], 64)) : $("", !0)
122
+ ], 64)) : _("", !0)
91
123
  ]),
92
- default: d(() => [
93
- o(a(M), {
94
- class: "gap-1.5 font-normal h-full justify-start px-2 py-1.5",
124
+ default: n(() => [
125
+ s(a(b), {
126
+ class: "gap-1.5 font-normal h-full justify-start px-2 py-1.5 outline-none",
95
127
  fullWidth: "",
96
128
  variant: "ghost"
97
129
  }, {
98
- default: d(() => [
99
- c("span", W, C(x.value || "Select a value"), 1),
100
- o(a(f), {
130
+ default: n(() => [
131
+ d("span", J, w(g.value || "Select a value"), 1),
132
+ s(a(h), {
101
133
  icon: "ChevronDown",
102
134
  size: "md"
103
135
  })
@@ -111,5 +143,5 @@ const U = { class: "w-full" }, W = { class: "text-c-1" }, q = { class: "flex ite
111
143
  }
112
144
  });
113
145
  export {
114
- O as default
146
+ Z as default
115
147
  };
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/EnvironmentSelector/EnvironmentSelector.vue"],"names":[],"mappings":";AAgdA,wBAMG"}
1
+ {"version":3,"file":"EnvironmentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/EnvironmentSelector/EnvironmentSelector.vue"],"names":[],"mappings":";AAodA,wBAMG"}
@@ -1,13 +1,14 @@
1
1
  import { defineComponent as I, computed as f, watch as B, onMounted as D, openBlock as c, createElementBlock as x, createVNode as s, unref as n, withCtx as l, Fragment as j, renderList as M, createBlock as h, withModifiers as w, createTextVNode as E, toDisplayString as k, createElementVNode as u, normalizeClass as V, createCommentVNode as z } from "vue";
2
- import { useActiveEntities as W } from "../../store/active-entities.js";
3
- import { ScalarDropdown as L, ScalarDropdownItem as v, ScalarListboxCheckbox as O, ScalarIcon as g, ScalarDropdownDivider as R, ScalarButton as $ } from "@scalar/components";
4
- import { useRouter as A } from "vue-router";
5
- import { useWorkspace as F } from "../../store/store.js";
6
- const T = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap" }, q = { class: "flex items-center justify-center h-4 w-4" }, U = /* @__PURE__ */ I({
2
+ import { useActiveEntities as L } from "../../store/active-entities.js";
3
+ import { ScalarDropdown as W, ScalarDropdownItem as m, ScalarListboxCheckbox as $, ScalarIcon as g, ScalarDropdownDivider as A, ScalarButton as F } from "@scalar/components";
4
+ import { useRouter as O } from "vue-router";
5
+ import { useWorkspace as R } from "../../store/store.js";
6
+ import { useLayout as T } from "../../hooks/useLayout.js";
7
+ const q = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap" }, G = { class: "flex items-center justify-center h-4 w-4" }, Y = /* @__PURE__ */ I({
7
8
  __name: "EnvironmentSelector",
8
- setup(G) {
9
- const { activeCollection: a, activeWorkspace: i, activeEnvironment: m } = W(), { isReadOnly: _, collectionMutators: b } = F(), C = A(), d = (e) => {
10
- a.value && i.value && (b.edit(
9
+ setup(H) {
10
+ const { activeCollection: a, activeWorkspace: i, activeEnvironment: v } = L(), { collectionMutators: _ } = R(), { layout: b } = T(), C = O(), d = (e) => {
11
+ a.value && i.value && (_.edit(
11
12
  a.value.uid,
12
13
  "x-scalar-active-environment",
13
14
  e
@@ -21,7 +22,7 @@ const T = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap"
21
22
  }
22
23
  });
23
24
  }, y = f(() => {
24
- const { value: e } = m, { value: t } = a;
25
+ const { value: e } = v, { value: t } = a;
25
26
  return (e == null ? void 0 : e.uid) || (t == null ? void 0 : t["x-scalar-active-environment"]) || "No Environment";
26
27
  }), N = f(() => {
27
28
  const { value: e } = a, t = e == null ? void 0 : e["x-scalar-environments"];
@@ -40,9 +41,9 @@ const T = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap"
40
41
  ), D(() => {
41
42
  a.value && p(a.value);
42
43
  }), (e, t) => (c(), x("div", null, [
43
- s(n(L), { placement: "bottom-end" }, {
44
+ s(n(W), { placement: "bottom-end" }, {
44
45
  items: l(() => [
45
- (c(!0), x(j, null, M(N.value, (o) => (c(), h(n(v), {
46
+ (c(!0), x(j, null, M(N.value, (o) => (c(), h(n(m), {
46
47
  key: o.uid,
47
48
  class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden",
48
49
  onClick: w((r) => d(o.uid), ["stop"])
@@ -50,7 +51,7 @@ const T = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap"
50
51
  default: l(() => {
51
52
  var r;
52
53
  return [
53
- s(n(O), {
54
+ s(n($), {
54
55
  selected: ((r = n(a)) == null ? void 0 : r["x-scalar-active-environment"]) === o.uid
55
56
  }, null, 8, ["selected"]),
56
57
  E(" " + k(o.name), 1)
@@ -58,7 +59,7 @@ const T = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap"
58
59
  }),
59
60
  _: 2
60
61
  }, 1032, ["onClick"]))), 128)),
61
- s(n(v), {
62
+ s(n(m), {
62
63
  class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden",
63
64
  onClick: t[0] || (t[0] = w((o) => d(""), ["stop"]))
64
65
  }, {
@@ -68,7 +69,7 @@ const T = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap"
68
69
  u("div", {
69
70
  class: V([
70
71
  "flex items-center justify-center rounded-full p-[3px] w-4 h-4",
71
- ((o = n(m)) == null ? void 0 : o.uid) === "" && ((r = n(a)) == null ? void 0 : r["x-scalar-active-environment"]) === "" ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
72
+ ((o = n(v)) == null ? void 0 : o.uid) === "" && ((r = n(a)) == null ? void 0 : r["x-scalar-active-environment"]) === "" ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
72
73
  ])
73
74
  }, [
74
75
  s(n(g), {
@@ -82,14 +83,14 @@ const T = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap"
82
83
  }),
83
84
  _: 1
84
85
  }),
85
- s(n(R)),
86
- n(_) ? z("", !0) : (c(), h(n(v), {
86
+ s(n(A)),
87
+ n(b) !== "modal" ? (c(), h(n(m), {
87
88
  key: 0,
88
89
  class: "flex items-center gap-1.5",
89
90
  onClick: S
90
91
  }, {
91
92
  default: l(() => [
92
- u("div", q, [
93
+ u("div", G, [
93
94
  s(n(g), {
94
95
  icon: "Brackets",
95
96
  size: "sm"
@@ -98,16 +99,16 @@ const T = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap"
98
99
  t[2] || (t[2] = u("span", { class: "leading-none" }, "Manage Environments", -1))
99
100
  ]),
100
101
  _: 1
101
- }))
102
+ })) : z("", !0)
102
103
  ]),
103
104
  default: l(() => [
104
- s(n($), {
105
+ s(n(F), {
105
106
  class: "font-normal h-auto justify-start py-1.5 px-1.5 pl-2 text-c-1 hover:bg-b-2 w-fit",
106
107
  fullWidth: "",
107
108
  variant: "ghost"
108
109
  }, {
109
110
  default: l(() => [
110
- u("h2", T, k(y.value), 1)
111
+ u("h2", q, k(y.value), 1)
111
112
  ]),
112
113
  _: 1
113
114
  })
@@ -118,5 +119,5 @@ const T = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap"
118
119
  }
119
120
  });
120
121
  export {
121
- U as default
122
+ Y as default
122
123
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Form.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Form.vue"],"names":[],"mappings":"AAiDA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC9D,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAC5C,CAAC;AAQF,iBAAS,cAAc;WAwGT,OAAO,IAA6B;;uBARvB,GAAG;;;;EAa7B;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0SAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"Form.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Form.vue"],"names":[],"mappings":"AAqDA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,EAAE,MAAM,CAAA;KACpB,EAAE,CAAA;IACH,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAC5C,CAAC;AAQF,iBAAS,cAAc;WAwGT,OAAO,IAA6B;;uBARvB,GAAG;;;;EAa7B;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0SAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -11,8 +11,8 @@ const C = { key: 0 }, N = { class: "custom-scroll flex flex-1 flex-col gap-1.5"
11
11
  data: {},
12
12
  onUpdate: { type: Function }
13
13
  },
14
- setup(S) {
15
- return (e, U) => (t(), a(g, null, {
14
+ setup(U) {
15
+ return (e, w) => (t(), a(g, null, {
16
16
  title: l(() => [
17
17
  e.title ? (t(), n("span", C, s(e.title), 1)) : p(e.$slots, "title", { key: 1 })
18
18
  ]),
@@ -29,7 +29,7 @@ const C = { key: 0 }, N = { class: "custom-scroll flex flex-1 flex-col gap-1.5"
29
29
  }, {
30
30
  default: l(() => [
31
31
  _(h, {
32
- modelValue: String(e.data[o.key] ?? ""),
32
+ modelValue: e.data[o.key],
33
33
  placeholder: o.placeholder,
34
34
  "onUpdate:modelValue": (d) => e.onUpdate(o.key, d)
35
35
  }, {
@@ -0,0 +1,14 @@
1
+ import type { ServerVariableValues, ServerVariables } from '../../components/Server/types';
2
+ type __VLS_Props = {
3
+ variables?: ServerVariables;
4
+ values?: ServerVariableValues;
5
+ /** The ID of the input controlled by the variables form */
6
+ controls?: string;
7
+ };
8
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
+ "update:variable": (name: string, value: string) => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ "onUpdate:variable"?: ((name: string, value: string) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ export default _default;
14
+ //# sourceMappingURL=ServerVariablesForm.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerVariablesForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Server/ServerVariablesForm.vue"],"names":[],"mappings":"AA+DA,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EAChB,MAAM,2BAA2B,CAAA;AAIlC,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC;;;;;;AA0IF,wBAOG"}
@@ -0,0 +1,47 @@
1
+ import { defineComponent as h, openBlock as o, createElementBlock as m, Fragment as k, renderList as y, createElementVNode as C, toDisplayString as V, createBlock as v, createCommentVNode as _ } from "vue";
2
+ import S from "./ServerVariablesSelect.vue.js";
3
+ import B from "./ServerVariablesTextbox.vue.js";
4
+ const j = { class: "flex items-center pl-3 py-1.5 after:content-[':'] mr-1.5 group-has-[input]/label:mr-0" }, O = /* @__PURE__ */ h({
5
+ __name: "ServerVariablesForm",
6
+ props: {
7
+ variables: {},
8
+ values: {},
9
+ controls: {}
10
+ },
11
+ emits: ["update:variable"],
12
+ setup(f, { emit: g }) {
13
+ const n = f, d = g;
14
+ function s(e, l) {
15
+ d("update:variable", e, l);
16
+ }
17
+ const i = (e) => {
18
+ var l, r, t;
19
+ return (((l = n.values) == null ? void 0 : l[e]) ?? ((t = (r = n.variables) == null ? void 0 : r[e]) == null ? void 0 : t.default) ?? "").toString();
20
+ };
21
+ return (e, l) => e.variables && Object.keys(e.variables ?? {}).length ? (o(!0), m(k, { key: 0 }, y(Object.keys(e.variables), (r) => {
22
+ var t, u, c, p, b;
23
+ return o(), m("label", {
24
+ key: r,
25
+ class: "group/label flex w-full"
26
+ }, [
27
+ C("span", j, V(r), 1),
28
+ (c = (u = (t = e.variables) == null ? void 0 : t[r]) == null ? void 0 : u.enum) != null && c.length ? (o(), v(S, {
29
+ key: 0,
30
+ controls: e.controls,
31
+ enum: ((b = (p = e.variables[r]) == null ? void 0 : p.enum) == null ? void 0 : b.map((a) => String(a))) ?? [],
32
+ label: r,
33
+ value: i(r),
34
+ onChange: (a) => s(r, a)
35
+ }, null, 8, ["controls", "enum", "label", "value", "onChange"])) : (o(), v(B, {
36
+ key: 1,
37
+ controls: e.controls,
38
+ value: i(r),
39
+ onChange: (a) => s(r, a)
40
+ }, null, 8, ["controls", "value", "onChange"]))
41
+ ]);
42
+ }), 128)) : _("", !0);
43
+ }
44
+ });
45
+ export {
46
+ O as default
47
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ServerVariablesForm.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,12 @@
1
+ type __VLS_Props = {
2
+ enum: string[];
3
+ value: string;
4
+ controls?: string;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
+ change: (v: string) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onChange?: ((v: string) => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ export default _default;
12
+ //# sourceMappingURL=ServerVariablesSelect.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerVariablesSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Server/ServerVariablesSelect.vue"],"names":[],"mappings":"AA+DA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC;;;;;;AA6GF,wBAQG"}
@@ -0,0 +1,54 @@
1
+ import { defineComponent as v, computed as s, openBlock as r, createBlock as f, unref as a, withCtx as c, createVNode as i, createElementVNode as S, normalizeClass as V, createElementBlock as h, createCommentVNode as g, createTextVNode as C, toDisplayString as k } from "vue";
2
+ import { ScalarListbox as y, ScalarButton as B, ScalarIcon as N } from "@scalar/components";
3
+ const _ = {
4
+ key: 0,
5
+ class: "sr-only"
6
+ }, x = /* @__PURE__ */ v({
7
+ __name: "ServerVariablesSelect",
8
+ props: {
9
+ enum: {},
10
+ value: {},
11
+ controls: {}
12
+ },
13
+ emits: ["change"],
14
+ setup(u, { emit: m }) {
15
+ const o = u, d = m, t = s(
16
+ () => o.enum.map((e) => ({ id: e, label: e }))
17
+ ), l = s({
18
+ get: () => t.value.find((e) => e.id === o.value),
19
+ set: (e) => d("change", (e == null ? void 0 : e.id) ?? "")
20
+ });
21
+ return (e, n) => (r(), f(a(y), {
22
+ modelValue: l.value,
23
+ "onUpdate:modelValue": n[0] || (n[0] = (p) => l.value = p),
24
+ options: t.value
25
+ }, {
26
+ default: c(() => [
27
+ i(a(B), {
28
+ "aria-controls": e.controls,
29
+ class: "h-8 p-0 py-1.5 w-full font-normal",
30
+ variant: "ghost"
31
+ }, {
32
+ default: c(() => [
33
+ S("span", {
34
+ class: V({ "text-c-1": e.value })
35
+ }, [
36
+ e.value ? (r(), h("span", _, " Selected: ")) : g("", !0),
37
+ C(" " + k(e.value || "Select value"), 1)
38
+ ], 2),
39
+ i(a(N), {
40
+ class: "ml-1",
41
+ icon: "ChevronDown",
42
+ size: "sm"
43
+ })
44
+ ]),
45
+ _: 1
46
+ }, 8, ["aria-controls"])
47
+ ]),
48
+ _: 1
49
+ }, 8, ["modelValue", "options"]));
50
+ }
51
+ });
52
+ export {
53
+ x as default
54
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ServerVariablesSelect.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,11 @@
1
+ type __VLS_Props = {
2
+ value: string;
3
+ controls?: string;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
+ change: (v: string) => any;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ onChange?: ((v: string) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLInputElement>;
10
+ export default _default;
11
+ //# sourceMappingURL=ServerVariablesTextbox.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerVariablesTextbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Server/ServerVariablesTextbox.vue"],"names":[],"mappings":"AAiCA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC;;;;;;AAuEF,wBAQG"}
@@ -0,0 +1,29 @@
1
+ import { defineComponent as c, computed as p, withDirectives as u, openBlock as i, createElementBlock as m, vModelText as d } from "vue";
2
+ const f = ["aria-controls"], x = /* @__PURE__ */ c({
3
+ __name: "ServerVariablesTextbox",
4
+ props: {
5
+ value: {},
6
+ controls: {}
7
+ },
8
+ emits: ["change"],
9
+ setup(l, { emit: n }) {
10
+ const a = l, r = n, t = p({
11
+ get: () => a.value,
12
+ set: (e) => r("change", e)
13
+ });
14
+ return (e, o) => u((i(), m("input", {
15
+ "onUpdate:modelValue": o[0] || (o[0] = (s) => t.value = s),
16
+ "aria-controls": e.controls,
17
+ autocomplete: "off",
18
+ class: "px-1.5 text-c-1 border-transparent -outline-offset-1 w-full",
19
+ placeholder: "value",
20
+ spellcheck: "false",
21
+ type: "text"
22
+ }, null, 8, f)), [
23
+ [d, t.value]
24
+ ]);
25
+ }
26
+ });
27
+ export {
28
+ x as default
29
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ServerVariablesTextbox.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,9 @@
1
+ import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ export type ServerVariables = {
3
+ [variable: string]: ServerVariable;
4
+ };
5
+ export type ServerVariableValues = {
6
+ [variable: string]: string;
7
+ };
8
+ export type ServerVariable = OpenAPIV3.ServerVariableObject | OpenAPIV3_1.ServerVariableObject;
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Server/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnE,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,cAAc,GACtB,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB,CAAA"}