@scalar/api-client 2.2.8 → 2.2.10

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 (142) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  3. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  4. package/dist/components/CodeInput/CodeInput.vue2.js +65 -65
  5. package/dist/components/CodeInput/codeVariableWidget.d.ts +6 -4
  6. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  7. package/dist/components/CodeInput/codeVariableWidget.js +72 -68
  8. package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
  9. package/dist/components/DataTable/DataTable.vue.js +20 -15
  10. package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
  11. package/dist/components/DataTable/DataTableCell.vue.js +16 -11
  12. package/dist/components/DataTable/DataTableHeader.vue.d.ts.map +1 -1
  13. package/dist/components/DataTable/DataTableHeader.vue.js +11 -12
  14. package/dist/components/DataTable/DataTableInput.vue.d.ts +2 -1
  15. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  16. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  17. package/dist/components/DataTable/DataTableInput.vue2.js +9 -9
  18. package/dist/components/DataTable/index.js +14 -14
  19. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  20. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +87 -67
  21. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  22. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +2 -2
  23. package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
  24. package/dist/components/Sidebar/SidebarList.vue.js +4 -4
  25. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +8 -4
  26. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  27. package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
  28. package/dist/components/Sidebar/SidebarListElement.vue2.js +52 -32
  29. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts +3 -0
  30. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  31. package/dist/components/Sidebar/SidebarListElementActions.vue.js +43 -31
  32. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  33. package/dist/components/TopNav/TopNav.vue.js +32 -31
  34. package/dist/layouts/App/create-api-client-app.d.ts +49 -42
  35. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  36. package/dist/layouts/Modal/create-api-client-modal.d.ts +103 -89
  37. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  38. package/dist/layouts/Modal/create-api-client-modal.js +31 -19
  39. package/dist/layouts/Web/create-api-client-web.d.ts +49 -42
  40. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  41. package/dist/libs/create-client.d.ts +50 -44
  42. package/dist/libs/create-client.d.ts.map +1 -1
  43. package/dist/libs/env-helpers.d.ts +9 -0
  44. package/dist/libs/env-helpers.d.ts.map +1 -0
  45. package/dist/libs/env-helpers.js +4 -0
  46. package/dist/libs/environment-parser.d.ts +3 -4
  47. package/dist/libs/environment-parser.d.ts.map +1 -1
  48. package/dist/libs/environment-parser.js +5 -4
  49. package/dist/libs/index.d.ts +1 -0
  50. package/dist/libs/index.d.ts.map +1 -1
  51. package/dist/libs/index.js +24 -22
  52. package/dist/libs/send-request/send-request.d.ts +5 -2
  53. package/dist/libs/send-request/send-request.d.ts.map +1 -1
  54. package/dist/libs/send-request/send-request.js +106 -104
  55. package/dist/routes.d.ts +11 -0
  56. package/dist/routes.d.ts.map +1 -1
  57. package/dist/routes.js +13 -7
  58. package/dist/store/active-entities.d.ts +18 -11
  59. package/dist/store/active-entities.d.ts.map +1 -1
  60. package/dist/store/active-entities.js +108 -69
  61. package/dist/store/collections.d.ts +17 -15
  62. package/dist/store/collections.d.ts.map +1 -1
  63. package/dist/store/collections.js +62 -41
  64. package/dist/store/environment.d.ts +4 -4
  65. package/dist/store/import-spec.d.ts +2 -2
  66. package/dist/store/import-spec.d.ts.map +1 -1
  67. package/dist/store/index.d.ts +1 -0
  68. package/dist/store/index.d.ts.map +1 -1
  69. package/dist/store/index.js +7 -3
  70. package/dist/store/requests.d.ts +4 -4
  71. package/dist/store/router-params.d.ts +1 -1
  72. package/dist/store/router-params.d.ts.map +1 -1
  73. package/dist/store/router-params.js +7 -7
  74. package/dist/store/store.d.ts +49 -42
  75. package/dist/store/store.d.ts.map +1 -1
  76. package/dist/store/store.js +76 -72
  77. package/dist/store/workspace.d.ts +12 -12
  78. package/dist/store/workspace.d.ts.map +1 -1
  79. package/dist/style.css +1 -1
  80. package/dist/types/index.d.ts +2 -0
  81. package/dist/types/index.d.ts.map +1 -0
  82. package/dist/types/index.js +1 -0
  83. package/dist/types/vue.d.ts +10 -0
  84. package/dist/types/vue.d.ts.map +1 -0
  85. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  86. package/dist/views/Cookies/Cookies.vue2.js +75 -70
  87. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  88. package/dist/views/Environment/Environment.vue2.js +308 -152
  89. package/dist/views/Environment/EnvironmentColorModal.vue.d.ts.map +1 -1
  90. package/dist/views/Environment/EnvironmentColorModal.vue.js +20 -18
  91. package/dist/views/Environment/EnvironmentColors.vue.d.ts +4 -1
  92. package/dist/views/Environment/EnvironmentColors.vue.d.ts.map +1 -1
  93. package/dist/views/Environment/EnvironmentColors.vue.js +83 -58
  94. package/dist/views/Environment/EnvironmentModal.vue.d.ts +7 -0
  95. package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
  96. package/dist/views/Environment/EnvironmentModal.vue.js +119 -37
  97. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +4 -5
  98. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  99. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +73 -63
  100. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  101. package/dist/views/Request/Request.vue.js +2 -2
  102. package/dist/views/Request/Request.vue2.js +60 -61
  103. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -0
  104. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  105. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +185 -187
  106. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts +1 -0
  107. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
  108. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +27 -24
  109. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  110. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  111. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +35 -187
  112. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +7 -0
  113. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -0
  114. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +7 -0
  115. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +207 -0
  116. package/dist/views/Request/RequestSection/{RequestAuthDataTableInput.vue.d.ts → RequestAuth/RequestAuthDataTableInput.vue.d.ts} +2 -2
  117. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts.map +1 -0
  118. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.js +43 -0
  119. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts +1 -0
  120. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
  121. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +5 -134
  122. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +176 -2
  123. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +2 -0
  124. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -0
  125. package/dist/views/Request/RequestSection/RequestAuth/index.js +4 -0
  126. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  127. package/dist/views/Request/RequestSidebar.vue.js +2 -2
  128. package/dist/views/Request/RequestSidebar.vue2.js +129 -109
  129. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  130. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  131. package/dist/views/Request/RequestSidebarItem.vue2.js +82 -87
  132. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  133. package/dist/views/Request/components/WorkspaceDropdown.vue.js +2 -2
  134. package/dist/views/Request/libs/auth.d.ts.map +1 -1
  135. package/dist/views/Request/libs/auth.js +3 -3
  136. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  137. package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
  138. package/dist/views/Servers/Servers.vue2.js +9 -8
  139. package/package.json +21 -11
  140. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +0 -1
  141. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.js +0 -46
  142. /package/dist/views/Request/RequestSection/{RequestAuthDataTableInput.vue2.js → RequestAuth/RequestAuthDataTableInput.vue2.js} +0 -0
@@ -1,16 +1,14 @@
1
- import { defineComponent as h, ref as v, computed as x, watch as w, openBlock as n, createElementBlock as c, normalizeClass as E, Fragment as b, renderList as z, createElementVNode as s, normalizeStyle as m, createBlock as g, unref as p, createCommentVNode as a, withDirectives as B, vModelText as $, createVNode as F, nextTick as I } from "vue";
2
- import { ScalarIcon as f } from "@scalar/components";
3
- const D = ["onClick"], V = {
4
- key: 1,
5
- class: "!py-0 flex flex-1 gap-2 items-center rounded"
6
- }, j = ["placeholder"], T = /* @__PURE__ */ h({
1
+ import { defineComponent as F, ref as v, computed as I, watch as S, openBlock as t, createElementBlock as d, Fragment as w, normalizeClass as s, normalizeStyle as f, createBlock as h, unref as m, createCommentVNode as c, renderList as j, createElementVNode as n, withDirectives as D, vModelText as V, createVNode as $, nextTick as N } from "vue";
2
+ import { ScalarIcon as p } from "@scalar/components";
3
+ const R = ["onClick"], T = ["placeholder"], U = /* @__PURE__ */ F({
7
4
  __name: "EnvironmentColors",
8
5
  props: {
9
- activeColor: {}
6
+ activeColor: {},
7
+ selector: { type: Boolean, default: !1 }
10
8
  },
11
9
  emits: ["select"],
12
- setup(y) {
13
- const u = y, t = v(!1), o = v(""), i = v(null), d = [
10
+ setup(x, { emit: E }) {
11
+ const e = x, z = E, o = v(""), C = v(null), a = v(!1), u = v(!1), k = [
14
12
  { color: "#8E8E8E" },
15
13
  { color: "#EF0006" },
16
14
  { color: "#EDBE20" },
@@ -19,75 +17,102 @@ const D = ["onClick"], V = {
19
17
  { color: "#0082D0" },
20
18
  { color: "#5203D1" },
21
19
  { color: "#FFC0CB" }
22
- ], C = x(() => u.activeColor && !d.some((e) => e.color === u.activeColor) || o.value ? `background-color: ${u.activeColor || o.value};` : "background: linear-gradient(to right, rgb(235, 87, 87), rgb(242, 201, 76), rgb(76, 183, 130), rgb(78, 167, 252), rgb(250, 96, 122));"), k = () => {
23
- t.value = !t.value, I(() => {
24
- i.value && i.value.focus();
20
+ ], b = I(() => e.activeColor && !k.some((l) => l.color === e.activeColor) || o.value ? `background-color: ${e.activeColor || o.value};` : "background: linear-gradient(to right, rgb(235, 87, 87), rgb(242, 201, 76), rgb(76, 183, 130), rgb(78, 167, 252), rgb(250, 96, 122));"), y = () => {
21
+ a.value = !a.value, e.selector && (u.value = !1), N(() => {
22
+ C.value && C.value.focus();
25
23
  });
26
24
  };
27
- return w(o, (e) => {
28
- e && !e.startsWith("#") && (o.value = `#${e}`), t.value = !0;
29
- }), (e, r) => (n(), c("div", {
30
- class: E(["flex flex-row gap-1.5 items-center justify-between space-x-1 min-h-10 min-w-[296px] py-1", t.value ? "pl-2 pr-1.5" : "px-2"])
31
- }, [
32
- t.value ? a("", !0) : (n(), c(b, { key: 0 }, [
33
- (n(), c(b, null, z(d, (l) => s("div", {
34
- key: l.color,
35
- class: "flex h-5 w-5 cursor-pointer items-center justify-center rounded-full",
36
- style: m({ backgroundColor: l.color }),
37
- onClick: (N) => e.$emit("select", l.color)
25
+ S(o, (l) => {
26
+ l && !l.startsWith("#") && (o.value = `#${l}`), a.value = !0;
27
+ });
28
+ const B = () => {
29
+ e.selector && (u.value = !u.value);
30
+ }, g = (l) => {
31
+ z("select", l), e.selector && (u.value = !1);
32
+ };
33
+ return (l, i) => (t(), d("div", null, [
34
+ a.value ? c("", !0) : (t(), d(w, { key: 0 }, [
35
+ e.selector && !u.value ? (t(), d("div", {
36
+ key: 0,
37
+ class: s(["flex cursor-pointer items-center justify-center rounded-full", e.selector ? "h-4 w-4" : "h-5 w-5"]),
38
+ style: f({ backgroundColor: l.activeColor }),
39
+ onClick: B
38
40
  }, [
39
- e.activeColor === l.color && !o.value ? (n(), g(p(f), {
41
+ l.activeColor ? (t(), h(m(p), {
40
42
  key: 0,
41
- class: "text-c-btn",
43
+ class: s(["text-c-btn", e.selector && "p-0.5"]),
42
44
  icon: "Checkmark",
43
45
  size: "xs"
44
- })) : a("", !0)
45
- ], 12, D)), 64)),
46
- r[2] || (r[2] = s("hr", { class: "w-0.5 h-5 border-ghost border-l" }, null, -1)),
47
- s("label", {
48
- class: "cursor-pointer flex flex-row justify-center h-5 w-5 gap-2 items-center rounded-full z-10",
49
- style: m(C.value),
50
- onClick: k
46
+ }, null, 8, ["class"])) : c("", !0)
47
+ ], 6)) : c("", !0),
48
+ u.value || !e.selector ? (t(), d("div", {
49
+ key: 1,
50
+ class: s(["color-selector flex flex-row gap-1.5 items-center justify-between space-x-1", e.selector ? "h-4" : "min-h-10 min-w-[296px]"])
51
51
  }, [
52
- !t.value && (e.activeColor === o.value || e.activeColor && !d.some((l) => l.color === e.activeColor)) ? (n(), g(p(f), {
53
- key: 0,
54
- class: "text-c-btn",
55
- icon: "Checkmark",
56
- size: "xs"
57
- })) : a("", !0)
58
- ], 4)
52
+ (t(), d(w, null, j(k, (r) => n("div", {
53
+ key: r.color,
54
+ class: s(["flex cursor-pointer items-center justify-center rounded-full", e.selector ? "h-4 w-4" : "h-5 w-5"]),
55
+ style: f({ backgroundColor: r.color }),
56
+ onClick: (L) => g(r.color)
57
+ }, [
58
+ l.activeColor === r.color && !o.value ? (t(), h(m(p), {
59
+ key: 0,
60
+ class: s(["text-c-btn", e.selector && "p-0.5"]),
61
+ icon: "Checkmark",
62
+ size: "xs"
63
+ }, null, 8, ["class"])) : c("", !0)
64
+ ], 14, R)), 64)),
65
+ i[2] || (i[2] = n("hr", { class: "w-0.5 h-5 border-ghost border-l" }, null, -1)),
66
+ n("label", {
67
+ class: s(["cursor-pointer flex flex-row justify-center gap-2 items-center rounded-full z-10", e.selector ? "h-4 w-4" : "h-5 w-5"]),
68
+ style: f(b.value),
69
+ onClick: y
70
+ }, [
71
+ !a.value && (l.activeColor === o.value || l.activeColor && !k.some((r) => r.color === l.activeColor)) ? (t(), h(m(p), {
72
+ key: 0,
73
+ class: "text-c-btn",
74
+ icon: "Checkmark",
75
+ size: "xs"
76
+ })) : c("", !0)
77
+ ], 6)
78
+ ], 2)) : c("", !0)
59
79
  ], 64)),
60
- t.value ? (n(), c("div", V, [
61
- r[3] || (r[3] = s("span", { class: "absolute border border-dashed h-5 w-5 rounded-full" }, null, -1)),
62
- s("span", {
63
- class: "h-5 w-5 rounded-full z-[1]",
64
- style: m(C.value)
65
- }, null, 4),
66
- B(s("input", {
80
+ a.value ? (t(), d("div", {
81
+ key: 1,
82
+ class: s(["color-selector flex flex-1 gap-2 items-center rounded", e.selector ? "h-4" : "min-h-10"])
83
+ }, [
84
+ n("span", {
85
+ class: s(["absolute border border-dashed rounded-full", e.selector ? "h-4 w-4" : "h-5 w-5"])
86
+ }, null, 2),
87
+ n("span", {
88
+ class: s(["rounded-full z-[1]", e.selector ? "h-4 w-4" : "h-5 w-5"]),
89
+ style: f(b.value)
90
+ }, null, 6),
91
+ D(n("input", {
67
92
  ref_key: "customColorInputRef",
68
- ref: i,
69
- "onUpdate:modelValue": r[0] || (r[0] = (l) => o.value = l),
93
+ ref: C,
94
+ "onUpdate:modelValue": i[0] || (i[0] = (r) => o.value = r),
70
95
  class: "border-transparent flex-1 outline-none w-full text-sm",
71
- placeholder: e.activeColor || "#000000",
96
+ placeholder: l.activeColor || "#000000",
72
97
  type: "text",
73
- onInput: r[1] || (r[1] = (l) => e.$emit("select", o.value))
74
- }, null, 40, j), [
75
- [$, o.value]
98
+ onInput: i[1] || (i[1] = (r) => g(o.value))
99
+ }, null, 40, T), [
100
+ [V, o.value]
76
101
  ]),
77
- s("button", {
102
+ n("button", {
78
103
  class: "text-c-3 hover:bg-b-2 p-1.5 rounded-lg",
79
104
  type: "button",
80
- onClick: k
105
+ onClick: y
81
106
  }, [
82
- F(p(f), {
107
+ $(m(p), {
83
108
  icon: "Checkmark",
84
109
  size: "xs"
85
110
  })
86
111
  ])
87
- ])) : a("", !0)
88
- ], 2));
112
+ ], 2)) : c("", !0)
113
+ ]));
89
114
  }
90
115
  });
91
116
  export {
92
- T as default
117
+ U as default
93
118
  };
@@ -1,17 +1,24 @@
1
1
  import { type ModalState } from '@scalar/components';
2
+ import type { Collection } from '@scalar/oas-utils/entities/spec';
2
3
  type __VLS_Props = {
3
4
  state: ModalState;
5
+ activeWorkspaceCollections: Collection[];
6
+ collectionId?: string;
4
7
  };
5
8
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
9
  submit: (environment: {
7
10
  name: string;
8
11
  color: string;
12
+ type: string;
13
+ collectionId?: string;
9
14
  }) => any;
10
15
  cancel: () => any;
11
16
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
17
  onSubmit?: ((environment: {
13
18
  name: string;
14
19
  color: string;
20
+ type: string;
21
+ collectionId?: string;
15
22
  }) => any) | undefined;
16
23
  onCancel?: (() => any) | undefined;
17
24
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentModal.vue"],"names":[],"mappings":"AAkEA,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,oBAAoB,CAAA;AAO3B,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;CAClB,CAAC;;;cAKuC,MAAM;eAAS,MAAM;;;;;cAArB,MAAM;eAAS,MAAM;;;;AAoK9D,wBAQG"}
1
+ {"version":3,"file":"EnvironmentModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentModal.vue"],"names":[],"mappings":"AA8JA,OAAO,EACL,KAAK,UAAU,EAMhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAQjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,0BAA0B,EAAE,UAAU,EAAE,CAAA;IACxC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;;cAQU,MAAM;eACL,MAAM;cACP,MAAM;uBACG,MAAM;;;;;cAHf,MAAM;eACL,MAAM;cACP,MAAM;uBACG,MAAM;;;;AAmS3B,wBAQG"}
@@ -1,52 +1,134 @@
1
- import { defineComponent as p, ref as m, watch as v, openBlock as f, createBlock as E, unref as s, withCtx as x, createElementVNode as C, createVNode as a } from "vue";
2
- import S from "../../components/Sidebar/Actions/SidebarListElementForm.vue.js";
3
- import { ScalarModal as V, ScalarTextField as b } from "@scalar/components";
4
- import _ from "./EnvironmentColors.vue.js";
5
- const w = { class: "flex flex-col gap-3" }, F = /* @__PURE__ */ p({
1
+ import { defineComponent as _, ref as u, computed as h, watch as w, openBlock as m, createBlock as v, unref as i, withCtx as a, createVNode as s, createElementVNode as p, normalizeClass as I, toDisplayString as N, createTextVNode as T } from "vue";
2
+ import $ from "../../components/CommandPalette/CommandActionForm.vue.js";
3
+ import z from "../../components/CommandPalette/CommandActionInput.vue.js";
4
+ import { ScalarModal as B, ScalarListbox as D, ScalarButton as C, ScalarIcon as U } from "@scalar/components";
5
+ import { useToasts as W } from "@scalar/use-toasts";
6
+ import j from "./EnvironmentColors.vue.js";
7
+ import { useWorkspace as M } from "../../store/store.js";
8
+ const P = { class: "flex gap-2 items-start" }, K = /* @__PURE__ */ _({
6
9
  __name: "EnvironmentModal",
7
10
  props: {
8
- state: {}
11
+ state: {},
12
+ activeWorkspaceCollections: {},
13
+ collectionId: {}
9
14
  },
10
15
  emits: ["cancel", "submit"],
11
- setup(i, { emit: u }) {
12
- const c = i, r = u, o = m(""), l = m("#8E8E8E"), d = (t) => {
13
- l.value = t;
16
+ setup(x, { emit: g }) {
17
+ const n = x, f = g, { events: E } = M(), r = u(""), c = u("#8E8E8E"), d = h(() => [
18
+ ...n.activeWorkspaceCollections.filter((t) => {
19
+ var e;
20
+ return ((e = t.info) == null ? void 0 : e.title) !== "Drafts";
21
+ }).map((t) => {
22
+ var e;
23
+ return {
24
+ id: t.uid,
25
+ label: ((e = t.info) == null ? void 0 : e.title) ?? "Untitled Collection"
26
+ };
27
+ })
28
+ ]), l = u(
29
+ d.value.find((t) => t.id === n.collectionId)
30
+ ), { toast: S } = W(), V = (t) => {
31
+ c.value = t;
14
32
  };
15
- return v(
16
- () => c.state.open,
33
+ w(
34
+ () => n.state.open,
17
35
  (t) => {
18
- t && (o.value = "", l.value = "#8E8E8E");
36
+ t && (r.value = "", c.value = "#8E8E8E", n.collectionId ? l.value = d.value.find(
37
+ (e) => e.id === n.collectionId
38
+ ) : l.value = void 0);
19
39
  }
20
- ), (t, e) => (f(), E(s(V), {
21
- size: "xxs",
22
- state: t.state,
23
- title: "Add Environment"
40
+ );
41
+ const k = () => {
42
+ var t, e, o, b;
43
+ if (!((t = l.value) != null && t.id)) {
44
+ S("Please select a collection before adding an environment.", "error");
45
+ return;
46
+ }
47
+ f("submit", {
48
+ name: r.value,
49
+ color: c.value,
50
+ type: ((e = l.value) == null ? void 0 : e.id) === "global" ? "global" : "collection",
51
+ collectionId: ((o = l.value) == null ? void 0 : o.id) !== "global" ? (b = l.value) == null ? void 0 : b.id : void 0
52
+ });
53
+ }, y = () => {
54
+ n.state.hide(), E.commandPalette.emit({ commandName: "Create Collection" });
55
+ };
56
+ return (t, e) => (m(), v(i(B), {
57
+ bodyClass: "!border-t-0 !rounded-t-lg",
58
+ size: "xs",
59
+ state: t.state
24
60
  }, {
25
- default: x(() => [
26
- C("div", w, [
27
- a(s(b), {
28
- modelValue: o.value,
29
- "onUpdate:modelValue": e[0] || (e[0] = (n) => o.value = n),
30
- placeholder: "Environment name"
31
- }, null, 8, ["modelValue"]),
32
- a(_, {
33
- activeColor: l.value,
34
- class: "p-3 w-full",
35
- onSelect: d
36
- }, null, 8, ["activeColor"]),
37
- a(S, {
38
- onCancel: e[1] || (e[1] = (n) => r("cancel")),
39
- onSubmit: e[2] || (e[2] = (n) => r("submit", {
40
- name: o.value,
41
- color: l.value
42
- }))
43
- })
44
- ])
61
+ default: a(() => [
62
+ s($, {
63
+ disabled: !l.value,
64
+ onCancel: e[2] || (e[2] = (o) => f("cancel")),
65
+ onSubmit: k
66
+ }, {
67
+ options: a(() => [
68
+ s(i(D), {
69
+ modelValue: l.value,
70
+ "onUpdate:modelValue": e[1] || (e[1] = (o) => l.value = o),
71
+ options: d.value,
72
+ placeholder: "Select Type"
73
+ }, {
74
+ default: a(() => [
75
+ d.value.length > 0 ? (m(), v(i(C), {
76
+ key: 0,
77
+ class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2 w-fit",
78
+ variant: "outlined"
79
+ }, {
80
+ default: a(() => [
81
+ p("span", {
82
+ class: I(l.value ? "text-c-1" : "text-c-3")
83
+ }, N(l.value ? l.value.label : "Select Collection"), 3),
84
+ s(i(U), {
85
+ class: "text-c-3",
86
+ icon: "ChevronDown",
87
+ size: "xs"
88
+ })
89
+ ]),
90
+ _: 1
91
+ })) : (m(), v(i(C), {
92
+ key: 1,
93
+ class: "justify-between p-2 max-h-8 gap-1 text-xs hover:bg-b-2",
94
+ variant: "outlined",
95
+ onClick: y
96
+ }, {
97
+ default: a(() => e[3] || (e[3] = [
98
+ p("span", { class: "text-c-1" }, "Create Collection", -1)
99
+ ])),
100
+ _: 1
101
+ }))
102
+ ]),
103
+ _: 1
104
+ }, 8, ["modelValue", "options"])
105
+ ]),
106
+ submit: a(() => e[4] || (e[4] = [
107
+ T("Add Environment")
108
+ ])),
109
+ default: a(() => [
110
+ p("div", P, [
111
+ s(j, {
112
+ activeColor: c.value,
113
+ class: "peer",
114
+ selector: "",
115
+ onSelect: V
116
+ }, null, 8, ["activeColor"]),
117
+ s(z, {
118
+ modelValue: r.value,
119
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => r.value = o),
120
+ class: "!p-0 peer-has-[.color-selector]:hidden -mt-[.5px]",
121
+ placeholder: "Environment name"
122
+ }, null, 8, ["modelValue"])
123
+ ])
124
+ ]),
125
+ _: 1
126
+ }, 8, ["disabled"])
45
127
  ]),
46
128
  _: 1
47
129
  }, 8, ["state"]));
48
130
  }
49
131
  });
50
132
  export {
51
- F as default
133
+ K as default
52
134
  };
@@ -1,10 +1,9 @@
1
- import type { ActiveEntitiesStore } from '../../store/active-entities.js';
2
- import type { Router } from 'vue-router';
1
+ import { type EnvVariables } from '../../libs/env-helpers.js';
2
+ import type { Environment } from '@scalar/oas-utils/entities/environment';
3
3
  type __VLS_Props = {
4
4
  query: string;
5
- activeEnvironment: ActiveEntitiesStore['activeEnvironment'];
6
- activeEnvVariables: ActiveEntitiesStore['activeEnvVariables'];
7
- router: Router;
5
+ environment: Environment;
6
+ envVariables: EnvVariables;
8
7
  dropdownPosition?: {
9
8
  left: number;
10
9
  top: number;
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentVariableDropdown.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentVariableDropdown.vue"],"names":[],"mappings":"AAgLA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAKlE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAIxC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,EAAE,mBAAmB,CAAC,mBAAmB,CAAC,CAAA;IAC3D,kBAAkB,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAA;IAC7D,MAAM,EAAE,MAAM,CAAA;IAEd,gBAAgB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CACjD,CAAC;;gCAkEiC,IAAI,GAAG,MAAM;;;;;;;AAuOhD,wBAQG"}
1
+ {"version":3,"file":"EnvironmentVariableDropdown.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentVariableDropdown.vue"],"names":[],"mappings":"AA6KA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,oBAAoB,CAAA;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAQzE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,YAAY,CAAA;IAE1B,gBAAgB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CACjD,CAAC;;gCAwDiC,IAAI,GAAG,MAAM;;;;;;;AAqPhD,wBAQG"}
@@ -1,116 +1,126 @@
1
- import { defineComponent as I, ref as d, computed as m, onMounted as P, openBlock as s, createBlock as h, unref as p, withCtx as w, createElementVNode as a, normalizeStyle as y, createElementBlock as f, Fragment as R, renderList as T, normalizeClass as j, createTextVNode as b, toDisplayString as x, createVNode as q, createCommentVNode as D } from "vue";
2
- import { ScalarTeleport as F, ScalarButton as K, ScalarIcon as O } from "@scalar/components";
3
- import { onClickOutside as L } from "@vueuse/core";
4
- import M from "fuse.js";
5
- import { parseEnvVariables as k } from "../../libs/environment-parser.js";
6
- const Q = { key: 0 }, $ = ["onClick"], G = { class: "flex items-center gap-1.5 whitespace-nowrap" }, H = { class: "w-20 overflow-hidden text-ellipsis text-right whitespace-nowrap" }, oe = /* @__PURE__ */ I({
1
+ import { defineComponent as R, ref as m, computed as h, onMounted as I, openBlock as r, createBlock as v, unref as l, withCtx as x, createElementVNode as c, normalizeStyle as y, createElementBlock as u, Fragment as P, renderList as T, normalizeClass as j, createTextVNode as b, toDisplayString as k, createVNode as q, createCommentVNode as g } from "vue";
2
+ import { getEnvColor as D } from "../../libs/env-helpers.js";
3
+ import { ScalarTeleport as F, ScalarIcon as V, ScalarButton as K } from "@scalar/components";
4
+ import { onClickOutside as O } from "@vueuse/core";
5
+ import G from "fuse.js";
6
+ import { useRouter as L } from "vue-router";
7
+ import { parseEnvVariables as _ } from "../../libs/environment-parser.js";
8
+ const M = {
9
+ key: 0,
10
+ class: "flex flex-col gap-px"
11
+ }, Q = ["onClick"], $ = { class: "flex items-center gap-1.5 whitespace-nowrap" }, H = { class: "w-20 overflow-hidden text-ellipsis text-right whitespace-nowrap" }, ne = /* @__PURE__ */ R({
7
12
  __name: "EnvironmentVariableDropdown",
8
13
  props: {
9
14
  query: {},
10
- activeEnvironment: {},
11
- activeEnvVariables: {},
12
- router: {},
15
+ environment: {},
16
+ envVariables: {},
13
17
  dropdownPosition: {}
14
18
  },
15
19
  emits: ["select"],
16
- setup(g, { expose: V, emit: E }) {
17
- const r = g, _ = E, c = d(!0), u = d(null), n = d(0), C = () => {
18
- const e = z.value.params.workspace;
19
- S({
20
+ setup(C, { expose: S, emit: E }) {
21
+ const s = C, z = E, d = m(!0), p = m(null), n = m(0), f = L(), A = () => {
22
+ if (!f) return;
23
+ const { currentRoute: t, push: o } = f, e = t.value.params.workspace;
24
+ o({
20
25
  name: "environment.default",
21
26
  params: {
22
27
  workspace: e
23
28
  }
24
- }), c.value = !1;
25
- }, { push: S, currentRoute: z } = r.router, A = new M(k(r.activeEnvVariables.value), {
29
+ }), d.value = !1;
30
+ }, B = new G(_(s.envVariables), {
26
31
  keys: ["key", "value"]
27
- }), i = m(() => {
28
- const e = r.query;
29
- if (!e)
30
- return k(r.activeEnvVariables.value).slice(-4).filter(({ key: t, value: l }) => t !== "" || l !== "");
31
- const o = A.search(e, { limit: 10 });
32
- return o.length > 0 ? o.map((t) => t.item).filter(({ key: t, value: l }) => t !== "" || l !== "") : [];
33
- }), v = (e) => {
34
- _("select", e);
35
- }, B = (e) => e.value ? e.value.color : "#8E8E8E";
36
- V({
37
- handleArrowKey: (e) => {
38
- const o = e === "up" ? -1 : 1, t = i.value.length;
39
- t !== 0 && (n.value = (n.value + o + t) % t);
32
+ }), i = h(() => {
33
+ const t = s.query;
34
+ if (!t)
35
+ return _(s.envVariables).slice(-4).filter(({ key: e, value: a }) => e !== "" || a !== "");
36
+ const o = B.search(t, { limit: 10 });
37
+ return o.length > 0 ? o.map((e) => e.item).filter(({ key: e, value: a }) => e !== "" || a !== "") : [];
38
+ }), w = (t) => {
39
+ z("select", t);
40
+ };
41
+ S({
42
+ handleArrowKey: (t) => {
43
+ const o = t === "up" ? -1 : 1, e = i.value.length;
44
+ e !== 0 && (n.value = (n.value + o + e) % e);
40
45
  },
41
46
  handleSelect: () => {
42
47
  if (n.value >= 0) {
43
- const e = i.value[n.value];
44
- e && v(e.key);
48
+ const t = i.value[n.value];
49
+ t && w(t.key);
45
50
  }
46
51
  }
47
- }), P(() => {
52
+ }), I(() => {
48
53
  n.value = 0;
49
54
  });
50
- const N = m(() => {
51
- var e, o;
55
+ const N = h(() => {
56
+ var t, o;
52
57
  return {
53
- left: (((e = r.dropdownPosition) == null ? void 0 : e.left) ?? 0) + "px",
58
+ left: (((t = s.dropdownPosition) == null ? void 0 : t.left) ?? 0) + "px",
54
59
  // Add a 5px offset from the editor
55
- top: (((o = r.dropdownPosition) == null ? void 0 : o.top) ?? 0) + 5 + "px"
60
+ top: (((o = s.dropdownPosition) == null ? void 0 : o.top) ?? 0) + 5 + "px"
56
61
  };
57
62
  });
58
- return L(
59
- u,
63
+ return O(
64
+ p,
60
65
  () => {
61
- c.value = !1;
66
+ d.value = !1;
62
67
  },
63
- { ignore: [u] }
64
- ), (e, o) => c.value ? (s(), h(p(F), {
68
+ { ignore: [p] }
69
+ ), (t, o) => d.value ? (r(), v(l(F), {
65
70
  key: 0,
66
71
  class: "scalar-client"
67
72
  }, {
68
- default: w(() => [
69
- a("div", {
73
+ default: x(() => [
74
+ c("div", {
70
75
  ref_key: "dropdownRef",
71
- ref: u,
76
+ ref: p,
72
77
  class: "fixed left-0 top-0 flex flex-col p-0.75 max-h-[60svh] w-56 rounded border custom-scroll",
73
78
  style: y(N.value)
74
79
  }, [
75
- i.value.length ? (s(), f("ul", Q, [
76
- (s(!0), f(R, null, T(i.value, (t, l) => (s(), f("li", {
77
- key: t.key,
78
- class: j(["h-8 font-code text-xxs hover:bg-b-2 flex cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150", { "bg-b-2": l === n.value }]),
79
- onClick: (W) => v(t.key)
80
+ i.value.length ? (r(), u("ul", M, [
81
+ (r(!0), u(P, null, T(i.value, (e, a) => (r(), u("li", {
82
+ key: e.key,
83
+ class: j(["h-8 font-code text-xxs hover:bg-b-2 flex cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150", { "bg-b-2": a === n.value }]),
84
+ onClick: (W) => w(e.key)
80
85
  }, [
81
- a("div", G, [
82
- a("span", {
86
+ c("div", $, [
87
+ e.source === "collection" ? (r(), u("span", {
88
+ key: 0,
83
89
  class: "h-2.5 w-2.5 min-w-2.5 rounded-full",
84
90
  style: y({
85
- backgroundColor: B(e.activeEnvironment)
91
+ backgroundColor: l(D)(t.environment)
86
92
  })
87
- }, null, 4),
88
- b(" " + x(t.key), 1)
93
+ }, null, 4)) : (r(), v(l(V), {
94
+ key: 1,
95
+ class: "w-2.5",
96
+ icon: "Globe"
97
+ })),
98
+ b(" " + k(e.key), 1)
89
99
  ]),
90
- a("span", H, x(t.value), 1)
91
- ], 10, $))), 128))
92
- ])) : (s(), h(p(K), {
100
+ c("span", H, k(e.value), 1)
101
+ ], 10, Q))), 128))
102
+ ])) : l(f) ? (r(), v(l(K), {
93
103
  key: 1,
94
104
  class: "font-code text-xxs hover:bg-b-2 flex h-8 w-full justify-start gap-2 px-1.5 transition-colors duration-150",
95
105
  variant: "secondary",
96
- onClick: C
106
+ onClick: A
97
107
  }, {
98
- default: w(() => [
99
- q(p(O), {
108
+ default: x(() => [
109
+ q(l(V), {
100
110
  icon: "Add",
101
111
  size: "sm"
102
112
  }),
103
113
  o[0] || (o[0] = b(" Add Variable "))
104
114
  ]),
105
115
  _: 1
106
- })),
107
- o[1] || (o[1] = a("div", { class: "absolute inset-0 -z-1 rounded bg-b-1 shadow-lg brightness-lifted" }, null, -1))
116
+ })) : g("", !0),
117
+ o[1] || (o[1] = c("div", { class: "absolute inset-0 -z-1 rounded bg-b-1 shadow-lg brightness-lifted" }, null, -1))
108
118
  ], 4)
109
119
  ]),
110
120
  _: 1
111
- })) : D("", !0);
121
+ })) : g("", !0);
112
122
  }
113
123
  });
114
124
  export {
115
- oe as default
125
+ ne as default
116
126
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cAmQ8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA0XjD,wBAMG"}
1
+ {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cAuQ8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA8XjD,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Request.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5f5d9e27"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c563efae"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };