@scalar/api-client 2.3.32 → 2.3.34

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 (105) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  3. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  4. package/dist/components/CodeInput/CodeInput.vue2.js +63 -61
  5. package/dist/components/DataTable/DataTable.vue.js +1 -1
  6. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  7. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +58 -48
  8. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -2
  9. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  10. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +34 -32
  11. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  12. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
  13. package/dist/hooks/useClientConfig.d.ts +3 -0
  14. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  15. package/dist/layouts/App/create-api-client-app.d.ts +64 -24
  16. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  17. package/dist/layouts/Modal/create-api-client-modal.d.ts +128 -48
  18. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  19. package/dist/layouts/Web/create-api-client-web.d.ts +64 -24
  20. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  21. package/dist/libs/create-client.d.ts +64 -24
  22. package/dist/libs/create-client.d.ts.map +1 -1
  23. package/dist/libs/index.js +32 -29
  24. package/dist/libs/local-storage.d.ts +8 -0
  25. package/dist/libs/local-storage.d.ts.map +1 -1
  26. package/dist/libs/local-storage.js +28 -24
  27. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  28. package/dist/libs/send-request/create-request-operation.js +8 -8
  29. package/dist/libs/send-request/create-request-operation.test.d.ts +2 -2
  30. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  31. package/dist/libs/send-request/decode-buffer.js +4 -4
  32. package/dist/libs/send-request/index.d.ts +1 -0
  33. package/dist/libs/send-request/index.d.ts.map +1 -1
  34. package/dist/libs/send-request/index.js +6 -4
  35. package/dist/store/active-entities.d.ts +2 -2
  36. package/dist/store/active-entities.d.ts.map +1 -1
  37. package/dist/store/request-example.d.ts +22 -22
  38. package/dist/store/request-example.d.ts.map +1 -1
  39. package/dist/store/security-schemes.d.ts +42 -2
  40. package/dist/store/security-schemes.d.ts.map +1 -1
  41. package/dist/store/store.d.ts +64 -24
  42. package/dist/store/store.d.ts.map +1 -1
  43. package/dist/style.css +1 -1
  44. package/dist/views/Collection/CollectionAuthentication.vue.d.ts.map +1 -1
  45. package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
  46. package/dist/views/Collection/CollectionAuthentication.vue2.js +32 -32
  47. package/dist/views/Collection/CollectionEnvironment.vue.d.ts.map +1 -1
  48. package/dist/views/Collection/CollectionEnvironment.vue.js +3 -2
  49. package/dist/views/Collection/CollectionEnvironment.vue2.js +233 -9
  50. package/dist/views/Collection/CollectionNavigation.vue.js +36 -36
  51. package/dist/views/Collection/CollectionServers.vue.d.ts.map +1 -1
  52. package/dist/views/Collection/CollectionServers.vue2.js +6 -6
  53. package/dist/views/Collection/components/EnvironmentForm.vue.d.ts +13 -0
  54. package/dist/views/Collection/components/EnvironmentForm.vue.d.ts.map +1 -0
  55. package/dist/views/Collection/components/EnvironmentForm.vue.js +7 -0
  56. package/dist/views/Collection/components/EnvironmentForm.vue2.js +274 -0
  57. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.d.ts.map +1 -1
  58. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +35 -34
  59. package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
  60. package/dist/views/Environment/EnvironmentModal.vue.js +32 -28
  61. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -0
  62. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  63. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +67 -65
  64. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
  65. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +94 -97
  66. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +1 -0
  67. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  68. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  69. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +116 -99
  70. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +1 -0
  71. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  72. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
  73. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +27 -25
  74. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +1 -0
  75. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
  76. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +2 -2
  77. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +114 -73
  78. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  79. package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
  80. package/dist/views/Request/RequestSection/RequestSection.vue2.js +15 -15
  81. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  82. package/dist/views/Request/RequestSection/RequestTable.vue.js +4 -4
  83. package/dist/views/Request/RequestSection/RequestTable.vue2.js +42 -40
  84. package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts +8 -0
  85. package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts.map +1 -0
  86. package/dist/views/Request/RequestSection/helpers/update-scheme.js +17 -0
  87. package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts +2 -0
  88. package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts.map +1 -0
  89. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  90. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  91. package/dist/views/Request/RequestSidebar.vue2.js +87 -84
  92. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
  93. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +21 -21
  94. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
  95. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +11 -11
  96. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  97. package/dist/views/Request/consts/index.js +7 -5
  98. package/dist/views/Request/consts/mediaTypes.d.ts +4 -0
  99. package/dist/views/Request/consts/mediaTypes.d.ts.map +1 -1
  100. package/dist/views/Request/consts/mediaTypes.js +21 -4
  101. package/dist/views/Request/consts/mediaTypes.test.d.ts +2 -0
  102. package/dist/views/Request/consts/mediaTypes.test.d.ts.map +1 -0
  103. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  104. package/dist/views/Request/libs/oauth2.js +53 -47
  105. package/package.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionAuthentication.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Collection/CollectionAuthentication.vue"],"names":[],"mappings":";AAgPA,wBAMG"}
1
+ {"version":3,"file":"CollectionAuthentication.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Collection/CollectionAuthentication.vue"],"names":[],"mappings":";AA2OA,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./CollectionAuthentication.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e76fc233"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cc87292e"]]);
5
5
  export {
6
6
  r as default
7
7
  };
@@ -1,60 +1,60 @@
1
- import { defineComponent as v, createElementBlock as h, openBlock as r, createElementVNode as o, createBlock as x, createCommentVNode as y, createVNode as S, unref as e, normalizeClass as b } from "vue";
1
+ import { defineComponent as f, createElementBlock as h, openBlock as a, createElementVNode as o, createBlock as y, createCommentVNode as S, createVNode as x, unref as e, normalizeClass as _ } from "vue";
2
2
  import { ScalarToggle as C } from "@scalar/components";
3
- import { useActiveEntities as _ } from "../../store/active-entities.js";
4
- import { useWorkspace as V } from "../../store/store.js";
5
- import g from "../Request/RequestSection/RequestAuth/RequestAuth.vue.js";
6
- const k = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, w = { class: "flex flex-col gap-4" }, A = { class: "bg-b-1 flex items-center justify-between gap-4 text-sm" }, W = /* @__PURE__ */ v({
3
+ import { useActiveEntities as V } from "../../store/active-entities.js";
4
+ import { useWorkspace as g } from "../../store/store.js";
5
+ import k from "../Request/RequestSection/RequestAuth/RequestAuth.vue.js";
6
+ const b = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, w = { class: "flex flex-col gap-4" }, A = { class: "flex flex-col gap-2" }, E = { class: "flex h-8 items-center justify-between" }, j = /* @__PURE__ */ f({
7
7
  __name: "CollectionAuthentication",
8
- setup(E) {
8
+ setup(U) {
9
9
  const {
10
10
  activeCollection: t,
11
11
  activeEnvVariables: u,
12
- activeEnvironment: m,
13
- activeServer: d,
14
- activeWorkspace: i
15
- } = _(), { collectionMutators: p } = V(), f = () => {
16
- var c;
17
- (c = t.value) != null && c.uid && p.edit(
12
+ activeEnvironment: d,
13
+ activeServer: m,
14
+ activeWorkspace: c
15
+ } = V(), { collectionMutators: p } = g(), v = () => {
16
+ var i;
17
+ (i = t.value) != null && i.uid && p.edit(
18
18
  t.value.uid,
19
19
  "useCollectionSecurity",
20
20
  !t.value.useCollectionSecurity
21
21
  );
22
22
  };
23
- return (c, l) => {
24
- var n, s, a;
25
- return r(), h("div", k, [
23
+ return (i, l) => {
24
+ var n, s, r;
25
+ return a(), h("div", b, [
26
26
  o("div", w, [
27
- l[1] || (l[1] = o("div", { class: "flex h-8 items-center" }, [
28
- o("h3", { class: "font-bold" }, "Authenticate with the API once")
29
- ], -1)),
30
27
  o("div", A, [
31
- l[0] || (l[0] = o("p", { class: "text-c-2 flex flex-1 text-balance" }, " Don’t want to set up the authentication for each request? Enable this option to set the authentication once for the whole collection. ", -1)),
32
- S(e(C), {
33
- class: "w-4",
34
- modelValue: ((n = e(t)) == null ? void 0 : n.useCollectionSecurity) ?? !1,
35
- "onUpdate:modelValue": f
36
- }, null, 8, ["modelValue"])
28
+ o("div", E, [
29
+ l[0] || (l[0] = o("h3", { class: "font-bold" }, "Authentication", -1)),
30
+ x(e(C), {
31
+ class: "w-4",
32
+ modelValue: ((n = e(t)) == null ? void 0 : n.useCollectionSecurity) ?? !1,
33
+ "onUpdate:modelValue": v
34
+ }, null, 8, ["modelValue"])
35
+ ]),
36
+ l[1] || (l[1] = o("p", { class: "pr-6 text-sm" }, " Added authentication will apply to all requests under this collection. You can override this by specifying another one in the request. ", -1))
37
37
  ]),
38
- e(t) && e(i) ? (r(), x(e(g), {
38
+ e(t) && e(c) ? (a(), y(e(k), {
39
39
  key: 0,
40
- class: b([
40
+ class: _([
41
41
  "scalar-collection-auth",
42
42
  !((s = e(t)) != null && s.useCollectionSecurity) && "pointer-events-none opacity-50 mix-blend-luminosity"
43
43
  ]),
44
44
  collection: e(t),
45
45
  envVariables: e(u),
46
- environment: e(m),
46
+ environment: e(d),
47
47
  layout: "client",
48
- selectedSecuritySchemeUids: ((a = e(t)) == null ? void 0 : a.selectedSecuritySchemeUids) ?? [],
49
- server: e(d),
48
+ selectedSecuritySchemeUids: ((r = e(t)) == null ? void 0 : r.selectedSecuritySchemeUids) ?? [],
49
+ server: e(m),
50
50
  title: "Authentication",
51
- workspace: e(i)
52
- }, null, 8, ["class", "collection", "envVariables", "environment", "selectedSecuritySchemeUids", "server", "workspace"])) : y("", !0)
51
+ workspace: e(c)
52
+ }, null, 8, ["class", "collection", "envVariables", "environment", "selectedSecuritySchemeUids", "server", "workspace"])) : S("", !0)
53
53
  ])
54
54
  ]);
55
55
  };
56
56
  }
57
57
  });
58
58
  export {
59
- W as default
59
+ j as default
60
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionEnvironment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Collection/CollectionEnvironment.vue"],"names":[],"mappings":";AA4EA,wBAMG"}
1
+ {"version":3,"file":"CollectionEnvironment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Collection/CollectionEnvironment.vue"],"names":[],"mappings":";AAi9BA,wBAMG"}
@@ -1,4 +1,5 @@
1
- import f from "./CollectionEnvironment.vue2.js";
1
+ import o from "./CollectionEnvironment.vue2.js";
2
+ /* empty css */
2
3
  export {
3
- f as default
4
+ o as default
4
5
  };
@@ -1,16 +1,240 @@
1
- import { defineComponent as e, createBlock as n, openBlock as o, withCtx as r, createTextVNode as i } from "vue";
2
- import m from "../../components/ViewLayout/ViewLayoutSection.vue.js";
3
- const s = /* @__PURE__ */ e({
1
+ import { defineComponent as J, ref as F, computed as L, createBlock as y, openBlock as C, withCtx as u, createElementVNode as r, createVNode as c, createElementBlock as U, createTextVNode as I, Fragment as G, renderList as H, unref as t, createCommentVNode as K, normalizeStyle as P, toDisplayString as Q } from "vue";
2
+ import { useModal as k, ScalarButton as w, ScalarIcon as X, ScalarModal as S } from "@scalar/components";
3
+ import { Draggable as Y } from "@scalar/draggable";
4
+ import { ScalarIconTrash as Z } from "@scalar/icons";
5
+ import ee from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
6
+ import te from "../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
7
+ import ne from "../../components/ViewLayout/ViewLayoutSection.vue.js";
8
+ import oe from "../Environment/EnvironmentColorModal.vue.js";
9
+ import le from "../Environment/EnvironmentModal.vue.js";
10
+ import se from "./components/EnvironmentForm.vue.js";
11
+ import { useActiveEntities as ae } from "../../store/active-entities.js";
12
+ import { useWorkspace as re } from "../../store/store.js";
13
+ const ie = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, ce = { class: "flex flex-col gap-4" }, de = { class: "rounded-lg border" }, ue = { class: "bg-b-2 flex cursor-grab items-center justify-between rounded-t-lg px-1 py-1 text-sm" }, ve = { class: "flex items-center" }, me = ["onClick"], fe = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, Me = /* @__PURE__ */ J({
4
14
  __name: "CollectionEnvironment",
5
- setup(_) {
6
- return (l, t) => (o(), n(m, null, {
7
- title: r(() => t[0] || (t[0] = [
8
- i("Environments")
9
- ])),
15
+ setup(pe) {
16
+ const { activeCollection: l, activeWorkspace: $, activeEnvVariables: D } = ae(), { collectionMutators: m } = re(), b = k(), h = k(), g = k(), E = k(), M = F(""), s = F(null), _ = F(void 0), V = L(() => {
17
+ var n;
18
+ return (n = l.value) != null && n["x-scalar-environments"] ? Object.entries(l.value["x-scalar-environments"]).map(
19
+ ([e, i]) => ({
20
+ uid: e,
21
+ name: e,
22
+ value: JSON.stringify(i.variables || {}),
23
+ color: i.color || "#FFFFFF"
24
+ })
25
+ ) : [];
26
+ }), N = () => {
27
+ var n;
28
+ !((n = l.value) != null && n.uid) || !s.value || (m.removeEnvironment(
29
+ s.value,
30
+ l.value.uid
31
+ ), h.hide());
32
+ }, j = (n) => {
33
+ s.value = n, h.show();
34
+ }, z = (n) => {
35
+ var e;
36
+ (e = l.value) != null && e.uid && (m.addEnvironment(
37
+ n.name,
38
+ {
39
+ variables: {},
40
+ color: n.color
41
+ },
42
+ l.value.uid
43
+ ), g.hide());
44
+ }, O = (n) => {
45
+ s.value = n.name, M.value = n.color || "#FFFFFF", b.show();
46
+ }, A = (n) => {
47
+ var i, o, a;
48
+ if (!((i = l.value) != null && i.uid) || !s.value)
49
+ return;
50
+ const e = {
51
+ ...l.value["x-scalar-environments"],
52
+ [s.value]: {
53
+ variables: ((a = (o = l.value["x-scalar-environments"]) == null ? void 0 : o[s.value]) == null ? void 0 : a.variables) || {},
54
+ color: n
55
+ }
56
+ };
57
+ m.edit(
58
+ l.value.uid,
59
+ "x-scalar-environments",
60
+ e
61
+ ), b.hide();
62
+ }, B = (n) => {
63
+ s.value = n, _.value = n, E.show();
64
+ }, W = () => {
65
+ s.value = null, _.value = void 0, E.hide();
66
+ }, R = (n) => {
67
+ var p;
68
+ if (!((p = l.value) != null && p.uid) || !s.value)
69
+ return;
70
+ const e = { ...l.value["x-scalar-environments"] };
71
+ if (!e[s.value])
72
+ return;
73
+ const o = {}, a = Object.entries(e), f = a.findIndex(
74
+ ([v]) => v === s.value
75
+ );
76
+ a.forEach(([v, x], d) => {
77
+ d === f ? o[n] = x : o[v] = x;
78
+ }), m.edit(
79
+ l.value.uid,
80
+ "x-scalar-environments",
81
+ o
82
+ ), s.value = null, _.value = void 0, E.hide();
83
+ }, T = (n, e) => {
84
+ var x;
85
+ if (!((x = l.value) != null && x.uid))
86
+ return;
87
+ const i = { ...l.value["x-scalar-environments"] }, o = {}, a = Object.entries(i), f = a.findIndex(([d]) => d === n.id), p = a.findIndex(([d]) => d === e.id);
88
+ if (f === -1 || p === -1)
89
+ return;
90
+ const v = a[f];
91
+ v && (a.splice(f, 1), a.splice(p, 0, v), a.forEach(([d, q]) => {
92
+ o[d] = q;
93
+ }), m.edit(
94
+ l.value.uid,
95
+ "x-scalar-environments",
96
+ o
97
+ ));
98
+ };
99
+ return (n, e) => (C(), y(ne, null, {
100
+ default: u(() => {
101
+ var i;
102
+ return [
103
+ r("div", ie, [
104
+ r("div", ce, [
105
+ e[5] || (e[5] = r("div", { class: "flex items-start justify-between gap-2" }, [
106
+ r("div", { class: "flex flex-col gap-2" }, [
107
+ r("div", { class: "flex h-8 items-center" }, [
108
+ r("h3", { class: "font-bold" }, "Environment Variables")
109
+ ]),
110
+ r("p", { class: "text-sm" }, [
111
+ I(" Set environment variables at your collection level. Use "),
112
+ r("code", { class: "font-code text-c-2" }, "{{ variable }}"),
113
+ I(" to add / search among the selected environment's variables in your request inputs. ")
114
+ ])
115
+ ])
116
+ ], -1)),
117
+ (C(!0), U(G, null, H(V.value, (o) => (C(), y(t(Y), {
118
+ key: o.name,
119
+ id: o.name,
120
+ isDraggable: !0,
121
+ isDroppable: !0,
122
+ parentIds: [],
123
+ onOnDragEnd: T
124
+ }, {
125
+ default: u(() => [
126
+ r("div", de, [
127
+ r("div", ue, [
128
+ r("div", ve, [
129
+ c(t(w), {
130
+ class: "hover:bg-b-3 flex h-6 w-6 p-1",
131
+ onClick: (a) => O(o),
132
+ variant: "ghost"
133
+ }, {
134
+ default: u(() => [
135
+ r("span", {
136
+ style: P({ backgroundColor: o.color || "#FFFFFF" }),
137
+ class: "h-2.5 w-2.5 rounded-full"
138
+ }, null, 4)
139
+ ]),
140
+ _: 2
141
+ }, 1032, ["onClick"]),
142
+ r("button", {
143
+ class: "hover:bg-b-3 rounded px-1 py-0.5 text-sm",
144
+ onClick: (a) => B(o.name)
145
+ }, Q(o.name), 9, me)
146
+ ]),
147
+ c(t(w), {
148
+ class: "hover:bg-b-3 hover:text-c-1 p-1.25 h-fit",
149
+ variant: "ghost",
150
+ onClick: (a) => j(o.name)
151
+ }, {
152
+ default: u(() => [
153
+ c(t(Z), { class: "size-3.5" })
154
+ ]),
155
+ _: 2
156
+ }, 1032, ["onClick"])
157
+ ]),
158
+ t(l) && t($) ? (C(), y(se, {
159
+ key: 0,
160
+ collection: t(l),
161
+ environment: o,
162
+ envVariables: t(D),
163
+ workspace: t($)
164
+ }, null, 8, ["collection", "environment", "envVariables", "workspace"])) : K("", !0)
165
+ ])
166
+ ]),
167
+ _: 2
168
+ }, 1032, ["id"]))), 128)),
169
+ r("div", fe, [
170
+ c(t(w), {
171
+ class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
172
+ size: "sm",
173
+ variant: "ghost",
174
+ onClick: e[0] || (e[0] = (o) => t(g).show())
175
+ }, {
176
+ default: u(() => [
177
+ c(t(X), {
178
+ class: "inline-flex",
179
+ icon: "Add",
180
+ size: "sm",
181
+ thickness: "1.5"
182
+ }),
183
+ e[4] || (e[4] = r("span", null, "Add Environment", -1))
184
+ ]),
185
+ _: 1
186
+ })
187
+ ])
188
+ ]),
189
+ c(t(S), {
190
+ size: "xxs",
191
+ state: t(h),
192
+ title: `Delete ${s.value || "Environment"}`
193
+ }, {
194
+ default: u(() => [
195
+ c(ee, {
196
+ variableName: "Environment",
197
+ warningMessage: "Are you sure you want to delete this environment? This action cannot be undone.",
198
+ onClose: e[1] || (e[1] = (o) => t(h).hide()),
199
+ onDelete: N
200
+ })
201
+ ]),
202
+ _: 1
203
+ }, 8, ["state", "title"]),
204
+ c(le, {
205
+ activeWorkspaceCollections: t(l) ? [t(l)] : [],
206
+ collectionId: (i = t(l)) == null ? void 0 : i.uid,
207
+ state: t(g),
208
+ onCancel: e[2] || (e[2] = (o) => t(g).hide()),
209
+ onSubmit: z
210
+ }, null, 8, ["activeWorkspaceCollections", "collectionId", "state"]),
211
+ c(oe, {
212
+ selectedColor: M.value,
213
+ state: t(b),
214
+ onCancel: e[3] || (e[3] = (o) => t(b).hide()),
215
+ onSubmit: A
216
+ }, null, 8, ["selectedColor", "state"]),
217
+ c(t(S), {
218
+ size: "xxs",
219
+ state: t(E),
220
+ title: `Edit ${s.value}`
221
+ }, {
222
+ default: u(() => [
223
+ c(te, {
224
+ name: _.value ?? "",
225
+ onClose: W,
226
+ onEdit: R
227
+ }, null, 8, ["name"])
228
+ ]),
229
+ _: 1
230
+ }, 8, ["state", "title"])
231
+ ])
232
+ ];
233
+ }),
10
234
  _: 1
11
235
  }));
12
236
  }
13
237
  });
14
238
  export {
15
- s as default
239
+ Me as default
16
240
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as b, computed as k, createElementBlock as a, openBlock as r, createVNode as x, createElementVNode as n, normalizeClass as c, createCommentVNode as _, unref as t, toDisplayString as h, Fragment as g, renderList as C, createBlock as N, withCtx as S } from "vue";
1
+ import { defineComponent as b, computed as k, createElementBlock as m, openBlock as r, createVNode as x, createElementVNode as l, normalizeClass as d, createCommentVNode as _, unref as o, toDisplayString as v, Fragment as g, renderList as C, createBlock as N, withCtx as S } from "vue";
2
2
  import { LibraryIcon as B } from "@scalar/icons/library";
3
- import { useRouter as z, RouterLink as E } from "vue-router";
4
- import { PathId as m } from "../../routes.js";
3
+ import { useRouter as E, RouterLink as z } from "vue-router";
4
+ import { PathId as s } from "../../routes.js";
5
5
  import I from "./CollectionInfoForm.vue.js";
6
6
  import { useActiveEntities as L } from "../../store/active-entities.js";
7
7
  const R = { class: "bg-b-1 sticky -top-[104px] z-10 mx-auto w-full" }, V = {
@@ -13,8 +13,8 @@ const R = { class: "bg-b-1 sticky -top-[104px] z-10 mx-auto w-full" }, V = {
13
13
  isSticky: { type: Boolean }
14
14
  },
15
15
  setup(F) {
16
- const { currentRoute: d } = z(), { activeCollection: o } = L(), v = k(() => {
17
- var e, s, i;
16
+ const { currentRoute: p } = E(), { activeCollection: e } = L(), h = k(() => {
17
+ var t, a, i, n;
18
18
  return [
19
19
  {
20
20
  displayName: "Overview",
@@ -22,7 +22,7 @@ const R = { class: "bg-b-1 sticky -top-[104px] z-10 mx-auto w-full" }, V = {
22
22
  to: {
23
23
  name: "collection.overview",
24
24
  params: {
25
- [m.Collection]: (e = o.value) == null ? void 0 : e.uid
25
+ [s.Collection]: (t = e.value) == null ? void 0 : t.uid
26
26
  }
27
27
  }
28
28
  },
@@ -32,7 +32,7 @@ const R = { class: "bg-b-1 sticky -top-[104px] z-10 mx-auto w-full" }, V = {
32
32
  to: {
33
33
  name: "collection.servers",
34
34
  params: {
35
- [m.Collection]: (s = o.value) == null ? void 0 : s.uid
35
+ [s.Collection]: (a = e.value) == null ? void 0 : a.uid
36
36
  }
37
37
  }
38
38
  },
@@ -42,20 +42,20 @@ const R = { class: "bg-b-1 sticky -top-[104px] z-10 mx-auto w-full" }, V = {
42
42
  to: {
43
43
  name: "collection.authentication",
44
44
  params: {
45
- [m.Collection]: (i = o.value) == null ? void 0 : i.uid
45
+ [s.Collection]: (i = e.value) == null ? void 0 : i.uid
46
+ }
47
+ }
48
+ },
49
+ {
50
+ displayName: "Environment",
51
+ // icon: 'Brackets',
52
+ to: {
53
+ name: "collection.environment",
54
+ params: {
55
+ [s.Collection]: (n = e.value) == null ? void 0 : n.uid
46
56
  }
47
57
  }
48
58
  },
49
- // {
50
- // displayName: 'Environments',
51
- // // icon: 'Brackets',
52
- // to: {
53
- // name: 'collection.environment',
54
- // params: {
55
- // [PathId.Collection]: activeCollection.value?.uid,
56
- // },
57
- // },
58
- // },
59
59
  // {
60
60
  // displayName: 'Cookies',
61
61
  // // icon: 'Cookie',
@@ -92,41 +92,41 @@ const R = { class: "bg-b-1 sticky -top-[104px] z-10 mx-auto w-full" }, V = {
92
92
  }
93
93
  ];
94
94
  });
95
- return (e, s) => {
96
- var i, p, u;
97
- return r(), a("div", R, [
95
+ return (t, a) => {
96
+ var i, n, u;
97
+ return r(), m("div", R, [
98
98
  x(I),
99
- n("div", {
100
- class: c([
99
+ l("div", {
100
+ class: d([
101
101
  "items-center text-sm font-medium",
102
- e.isSticky ? "h-fit border-b md:grid md:grid-cols-[1fr_720px_1fr] md:px-4" : "flex md:mx-auto md:max-w-[720px]"
102
+ t.isSticky ? "h-fit border-b md:grid md:grid-cols-[1fr_720px_1fr] md:px-4" : "flex md:mx-auto md:max-w-[720px]"
103
103
  ])
104
104
  }, [
105
- e.isSticky ? (r(), a("div", V, [
106
- x(t(B), {
105
+ t.isSticky ? (r(), m("div", V, [
106
+ x(o(B), {
107
107
  class: "text-c-2 hidden size-3.5 md:block",
108
- src: ((i = t(o)) == null ? void 0 : i["x-scalar-icon"]) || "interface-content-folder",
108
+ src: ((i = o(e)) == null ? void 0 : i["x-scalar-icon"]) || "interface-content-folder",
109
109
  "stroke-width": "2"
110
110
  }, null, 8, ["src"]),
111
- n("span", A, h((u = (p = t(o)) == null ? void 0 : p.info) == null ? void 0 : u.title), 1)
111
+ l("span", A, v((u = (n = o(e)) == null ? void 0 : n.info) == null ? void 0 : u.title), 1)
112
112
  ])) : _("", !0),
113
- n("div", {
114
- class: c(["flex w-full max-w-[720px] gap-2 pl-1.5 md:ml-1.5 md:pl-0", !e.isSticky && "border-b"])
113
+ l("div", {
114
+ class: d(["flex w-full max-w-[720px] gap-2 pl-1.5 md:ml-1.5 md:pl-0", !t.isSticky && "border-b"])
115
115
  }, [
116
- (r(!0), a(g, null, C(v.value, ({ to: l, displayName: y }, w) => (r(), N(t(E), {
116
+ (r(!0), m(g, null, C(h.value, ({ to: c, displayName: y }, w) => (r(), N(o(z), {
117
117
  key: w,
118
118
  class: "-ml-2 flex h-10 cursor-pointer items-center whitespace-nowrap px-2 text-center text-sm font-medium no-underline -outline-offset-1 has-[:focus-visible]:outline",
119
- to: l
119
+ to: c
120
120
  }, {
121
121
  default: S(() => {
122
122
  var f;
123
123
  return [
124
- n("span", {
125
- class: c([
124
+ l("span", {
125
+ class: d([
126
126
  "flex-center h-full w-full border-b",
127
- typeof l.name == "string" && typeof t(d).name == "string" && ((f = t(d).name) != null && f.startsWith(l.name)) ? "text-c-1 border-c-1" : "text-c-2 hover:text-c-1 border-transparent"
127
+ typeof c.name == "string" && typeof o(p).name == "string" && ((f = o(p).name) != null && f.startsWith(c.name)) ? "text-c-1 border-c-1" : "text-c-2 hover:text-c-1 border-transparent"
128
128
  ])
129
- }, h(y), 3)
129
+ }, v(y), 3)
130
130
  ];
131
131
  }),
132
132
  _: 2
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionServers.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Collection/CollectionServers.vue"],"names":[],"mappings":";AAmbA,wBAMG"}
1
+ {"version":3,"file":"CollectionServers.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Collection/CollectionServers.vue"],"names":[],"mappings":";AAobA,wBAMG"}
@@ -5,7 +5,7 @@ import V from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js"
5
5
  import { useActiveEntities as E } from "../../store/active-entities.js";
6
6
  import L from "./CollectionServerForm.vue.js";
7
7
  import { useWorkspace as P } from "../../store/store.js";
8
- const T = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, F = { class: "flex flex-col gap-4" }, O = { class: "bg-b-2 rounded-lg border" }, R = { class: "flex items-start justify-between rounded-t-lg py-1 pl-3 pr-1 text-sm" }, W = {
8
+ const T = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, F = { class: "flex flex-col gap-4" }, O = { class: "rounded-lg border" }, R = { class: "bg-b-2 flex items-start justify-between rounded-t-lg py-1 pl-3 pr-1 text-sm" }, W = {
9
9
  key: 1,
10
10
  class: "self-center"
11
11
  }, Y = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, te = /* @__PURE__ */ y({
@@ -21,17 +21,17 @@ const T = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, F = { cla
21
21
  );
22
22
  }), S = () => x.commandPalette.emit({
23
23
  commandName: "Add Server"
24
- }), b = () => {
24
+ }), g = () => {
25
25
  var t;
26
26
  !((t = l.value) != null && t.uid) || !a.value || (h.delete(a.value, l.value.uid), d.hide());
27
- }, g = (t) => {
27
+ }, b = (t) => {
28
28
  a.value = t, d.show();
29
29
  };
30
30
  return (t, s) => {
31
31
  var i;
32
32
  return o(), u("div", T, [
33
33
  c("div", F, [
34
- s[2] || (s[2] = A('<div class="flex items-start justify-between gap-2"><div class="flex flex-col"><div class="flex h-8 items-center"><h3 class="font-bold">Servers</h3></div><p class="text-sm"> Add different base URLs for your API. You can use <code class="font-code text-c-2">{variables}</code> for dynamic parts. </p></div></div>', 1)),
34
+ s[2] || (s[2] = A('<div class="flex items-start justify-between gap-2"><div class="flex flex-col gap-2"><div class="flex h-8 items-center"><h3 class="font-bold">Servers</h3></div><p class="text-sm"> Add different base URLs for your API. You can use <code class="font-code text-c-2">{variables}</code> for dynamic parts. </p></div></div>', 1)),
35
35
  (o(!0), u(M, null, N(_.value, (r, k) => (o(), u("div", {
36
36
  key: r.uid
37
37
  }, [
@@ -45,7 +45,7 @@ const T = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, F = { cla
45
45
  n(e(p), {
46
46
  class: "hover:bg-b-3 hover:text-c-1 p-1.25 h-fit",
47
47
  variant: "ghost",
48
- onClick: (G) => g(r.uid)
48
+ onClick: (G) => b(r.uid)
49
49
  }, {
50
50
  default: f(() => [
51
51
  n(e(U), { class: "size-3.5" })
@@ -90,7 +90,7 @@ const T = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, F = { cla
90
90
  variableName: "Server",
91
91
  warningMessage: "Are you sure you want to delete this server? This action cannot be undone.",
92
92
  onClose: s[0] || (s[0] = (r) => e(d).hide()),
93
- onDelete: b
93
+ onDelete: g
94
94
  })
95
95
  ]),
96
96
  _: 1
@@ -0,0 +1,13 @@
1
+ import type { Environment } from '@scalar/oas-utils/entities/environment';
2
+ import type { Collection } from '@scalar/oas-utils/entities/spec';
3
+ import type { Workspace } from '@scalar/oas-utils/entities/workspace';
4
+ import type { EnvVariable } from '../../../store/active-entities';
5
+ type __VLS_Props = {
6
+ collection: Collection;
7
+ environment: Environment;
8
+ workspace: Workspace;
9
+ envVariables: EnvVariable[];
10
+ };
11
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
12
+ export default _default;
13
+ //# sourceMappingURL=EnvironmentForm.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvironmentForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Collection/components/EnvironmentForm.vue"],"names":[],"mappings":"AAoZA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AASrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAI1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,SAAS,EAAE,SAAS,CAAA;IACpB,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAC;;AAshBF,wBAOG"}
@@ -0,0 +1,7 @@
1
+ import o from "./EnvironmentForm.vue2.js";
2
+ /* empty css */
3
+ import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-efc6e074"]]);
5
+ export {
6
+ f as default
7
+ };