@scalar/api-client 2.1.31 → 2.1.33

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 (54) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +3 -3
  5. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  6. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  7. package/dist/components/CodeInput/CodeInput.vue2.js +104 -92
  8. package/dist/components/CodeInput/codeVariableWidget.js +3 -3
  9. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  11. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +110 -95
  12. package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
  13. package/dist/components/DataTable/DataTableCell.vue.js +5 -5
  14. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  15. package/dist/components/SideNav/SideNav.vue.js +1 -1
  16. package/dist/components/SideNav/SideNav.vue2.js +22 -22
  17. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  18. package/dist/components/ViewLayout/ViewLayout.vue.js +4 -4
  19. package/dist/constants.d.ts +1 -1
  20. package/dist/constants.js +1 -1
  21. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  22. package/dist/layouts/App/ApiClientApp.vue.js +37 -42
  23. package/dist/layouts/App/MainLayout.vue.d.ts +12 -0
  24. package/dist/layouts/App/MainLayout.vue.d.ts.map +1 -0
  25. package/dist/layouts/App/MainLayout.vue.js +18 -0
  26. package/dist/layouts/App/MainLayout.vue2.js +4 -0
  27. package/dist/layouts/App/create-api-client-app.d.ts +6 -5
  28. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  29. package/dist/layouts/Modal/create-api-client-modal.d.ts +12 -10
  30. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  31. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  32. package/dist/layouts/Web/ApiClientWeb.vue.js +26 -31
  33. package/dist/layouts/Web/create-api-client-web.d.ts +6 -5
  34. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  35. package/dist/libs/create-client.d.ts +6 -5
  36. package/dist/libs/create-client.d.ts.map +1 -1
  37. package/dist/libs/create-client.js +21 -18
  38. package/dist/store/store.d.ts +28 -13
  39. package/dist/store/store.d.ts.map +1 -1
  40. package/dist/store/store.js +112 -108
  41. package/dist/store/workspace.d.ts +4 -4
  42. package/dist/style.css +1 -1
  43. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +4 -1
  44. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  45. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +61 -48
  46. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  47. package/dist/views/Request/RequestSection/RequestBody.vue.js +5 -384
  48. package/dist/views/Request/RequestSection/RequestBody.vue2.js +384 -2
  49. package/dist/views/Request/RequestSection/RequestSection.vue.js +15 -15
  50. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
  51. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  52. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
  53. package/dist/views/Settings/SettingsGeneral.vue.js +90 -65
  54. package/package.json +6 -6
@@ -1,12 +1,18 @@
1
- import { defineComponent as _, openBlock as o, createElementBlock as x, createElementVNode as e, createStaticVNode as C, createVNode as c, unref as t, normalizeClass as i, withCtx as d, createBlock as u, createCommentVNode as p, createTextVNode as b, Fragment as S, renderList as j, toDisplayString as z, normalizeStyle as m } from "vue";
2
- import { ScalarButton as g, ScalarIcon as k } from "@scalar/components";
3
- import { themeLabels as B } from "@scalar/themes";
4
- import N from "./SettingsGeneralMode.vue.js";
5
- import { useWorkspace as V } from "../../store/store.js";
6
- const P = { class: "bg-b-1 w-full h-full overflow-auto" }, T = { class: "flex flex-col px-5 py-5 max-w-[720px] ml-auto mr-auto w-full" }, W = { class: "gap-2 mt-4 mb-8 flex flex-col" }, $ = { class: "flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1" }, U = { class: "flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1" }, E = { class: "flex flex-col gap-2" }, G = { class: "grid grid-cols-2 gap-2" }, L = { class: "flex items-center gap-2" }, O = { class: "flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1" }, R = { class: "flex items-center gap-1" }, K = /* @__PURE__ */ _({
1
+ import { defineComponent as S, openBlock as o, createElementBlock as y, createElementVNode as t, createStaticVNode as j, createVNode as d, unref as e, normalizeClass as u, withCtx as p, createBlock as n, createCommentVNode as c, createTextVNode as b, toDisplayString as v, Fragment as z, renderList as B, normalizeStyle as g } from "vue";
2
+ import { ScalarButton as m, ScalarIcon as k } from "@scalar/components";
3
+ import { themeLabels as N } from "@scalar/themes";
4
+ import P from "./SettingsGeneralMode.vue.js";
5
+ import { useWorkspace as U } from "../../store/store.js";
6
+ const V = { class: "bg-b-1 w-full h-full overflow-auto" }, $ = { class: "flex flex-col px-5 py-5 max-w-[720px] ml-auto mr-auto w-full" }, T = { class: "gap-2 mt-4 mb-8 flex flex-col" }, W = { class: "flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1" }, E = { class: "flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1" }, G = { class: "flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1" }, L = { class: "flex flex-col gap-2" }, O = { class: "grid grid-cols-2 gap-2" }, R = { class: "flex items-center gap-2" }, q = { class: "flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1" }, D = { class: "flex items-center gap-1" }, X = /* @__PURE__ */ S({
7
7
  __name: "SettingsGeneral",
8
- setup(q) {
9
- const { activeWorkspace: a, workspaceMutators: y, proxyUrl: l, setProxyUrl: h } = V(), v = [
8
+ setup(F) {
9
+ const {
10
+ activeWorkspace: i,
11
+ workspaceMutators: w,
12
+ proxyUrl: l,
13
+ setProxyUrl: x,
14
+ defaultProxyUrl: a
15
+ } = U(), _ = [
10
16
  "default",
11
17
  "alternate",
12
18
  "moon",
@@ -17,7 +23,7 @@ const P = { class: "bg-b-1 w-full h-full overflow-auto" }, T = { class: "flex fl
17
23
  "kepler",
18
24
  "mars",
19
25
  "deepSpace"
20
- ], f = (n) => ({
26
+ ], h = (f) => ({
21
27
  default: { light: "#fff", dark: "#0f0f0f", accent: "#0099ff" },
22
28
  alternate: { light: "#f9f9f9", dark: "#131313", accent: "#e7e7e7" },
23
29
  moon: { light: "#ccc9b3", dark: "#313332", accent: "#645b0f" },
@@ -29,102 +35,121 @@ const P = { class: "bg-b-1 w-full h-full overflow-auto" }, T = { class: "flex fl
29
35
  mars: { light: "#f2efe8", dark: "#321116", accent: "#c75549" },
30
36
  deepSpace: { light: "#f4f4f5", dark: "#09090b", accent: "#8ab4f8" },
31
37
  none: { light: "#ffffff", dark: "#000000", accent: "#3b82f6" }
32
- })[n] || { light: "#ffffff", dark: "#000000", accent: "#3b82f6" }, w = (n) => {
33
- y.edit(a.value.uid, "themeId", n);
38
+ })[f] || { light: "#ffffff", dark: "#000000", accent: "#3b82f6" }, C = (f) => {
39
+ w.edit(i.value.uid, "themeId", f);
34
40
  };
35
- return (n, r) => (o(), x("div", P, [
36
- e("div", T, [
37
- e("div", null, [
38
- e("div", null, [
39
- r[4] || (r[4] = C('<h2 class="font-bold text-xl mb-5 mt-10">Settings</h2><h3 class="font-bold mb-1">CORS Proxy</h3><p class="text-c-2 mb-2 leading-[21px]"> Browsers block cross-origin requests for security. We provide a public proxy to <a class="hover:text-c-1 underline-offset-2" href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing" target="_blank">bypass CORS issues</a>. Check the <a class="hover:text-c-1 underline-offset-2" href="https://github.com/scalar/scalar/tree/main/examples/proxy-server" target="_blank">source code on GitHub</a>. </p>', 3)),
40
- e("div", W, [
41
- c(t(g), {
42
- class: i(["w-full shadow-none text-c-1 justify-start pl-2 gap-2 bg-b-2 border-1/2", { "bg-b-1 text-c-1": t(l) }]),
43
- variant: t(l) ? "primary" : "secondary",
44
- onClick: r[0] || (r[0] = (s) => t(h)("https://proxy.scalar.com"))
41
+ return (f, r) => (o(), y("div", V, [
42
+ t("div", $, [
43
+ t("div", null, [
44
+ t("div", null, [
45
+ r[5] || (r[5] = j('<h2 class="font-bold text-xl mb-5 mt-10">Settings</h2><h3 class="font-bold mb-1">CORS Proxy</h3><p class="text-c-2 mb-2 leading-[21px]"> Browsers block cross-origin requests for security. We provide a public proxy to <a class="hover:text-c-1 underline-offset-2" href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing" target="_blank">bypass CORS issues</a>. Check the <a class="hover:text-c-1 underline-offset-2" href="https://github.com/scalar/scalar/tree/main/examples/proxy-server" target="_blank">source code on GitHub</a>. </p>', 3)),
46
+ t("div", T, [
47
+ d(e(m), {
48
+ class: u(["w-full shadow-none text-c-1 justify-start pl-2 gap-2 bg-b-2 border-1/2", { "bg-b-1 text-c-1": e(l) }]),
49
+ variant: e(l) ? "primary" : "secondary",
50
+ onClick: r[0] || (r[0] = (s) => e(x)("https://proxy.scalar.com"))
45
51
  }, {
46
- default: d(() => [
47
- e("div", $, [
48
- t(l) ? (o(), u(t(k), {
52
+ default: p(() => [
53
+ t("div", W, [
54
+ e(l) === "https://proxy.scalar.com" ? (o(), n(e(k), {
49
55
  key: 0,
50
56
  icon: "Checkmark",
51
57
  size: "xs",
52
58
  thickness: "3.5"
53
- })) : p("", !0)
59
+ })) : c("", !0)
54
60
  ]),
55
- r[2] || (r[2] = b(" Use proxy.scalar.com (default) "))
61
+ r[3] || (r[3] = b(" Use proxy.scalar.com (default) "))
56
62
  ]),
57
63
  _: 1
58
64
  }, 8, ["class", "variant"]),
59
- c(t(g), {
60
- class: i(["w-full shadow-none text-c-1 justify-start pl-2 gap-2 bg-b-2 border-1/2", { "bg-b-1 text-c-1": !t(l) }]),
61
- variant: t(l) ? "secondary" : "primary",
62
- onClick: r[1] || (r[1] = (s) => t(h)(""))
65
+ e(a) && e(a) !== "https://proxy.scalar.com" ? (o(), n(e(m), {
66
+ key: 0,
67
+ class: "w-full shadow-none text-c-1 justify-start pl-2 gap-2 bg-b-1 border-1/2",
68
+ variant: "primary",
69
+ onClick: r[1] || (r[1] = (s) => e(x)(e(a)))
63
70
  }, {
64
- default: d(() => [
65
- e("div", U, [
66
- t(l) ? p("", !0) : (o(), u(t(k), {
71
+ default: p(() => [
72
+ t("div", E, [
73
+ e(l) === e(a) ? (o(), n(e(k), {
74
+ key: 0,
75
+ icon: "Checkmark",
76
+ size: "xs",
77
+ thickness: "3.5"
78
+ })) : c("", !0)
79
+ ]),
80
+ b(" Use custom proxy (" + v(e(a)) + ") ", 1)
81
+ ]),
82
+ _: 1
83
+ })) : c("", !0),
84
+ d(e(m), {
85
+ class: u(["w-full shadow-none text-c-1 justify-start pl-2 gap-2 bg-b-2 border-1/2", { "bg-b-1 text-c-1": !e(l) }]),
86
+ variant: e(l) ? "secondary" : "primary",
87
+ onClick: r[2] || (r[2] = (s) => e(x)(""))
88
+ }, {
89
+ default: p(() => [
90
+ t("div", G, [
91
+ e(l) ? c("", !0) : (o(), n(e(k), {
67
92
  key: 0,
68
93
  icon: "Checkmark",
69
94
  size: "xs",
70
95
  thickness: "3.5"
71
96
  }))
72
97
  ]),
73
- r[3] || (r[3] = b(" Skip the proxy "))
98
+ r[4] || (r[4] = b(" Skip the proxy "))
74
99
  ]),
75
100
  _: 1
76
101
  }, 8, ["class", "variant"])
77
102
  ])
78
103
  ]),
79
- e("div", null, [
80
- r[5] || (r[5] = e("h3", { class: "font-bold mb-1" }, "Theme", -1)),
81
- r[6] || (r[6] = e("p", { class: "text-c-2 mb-4 leading-[21px]" }, " We’ve got a whole rainbow of themes for you to play with: ", -1)),
82
- e("div", E, [
83
- e("div", G, [
84
- (o(), x(S, null, j(v, (s) => c(t(g), {
104
+ t("div", null, [
105
+ r[6] || (r[6] = t("h3", { class: "font-bold mb-1" }, "Theme", -1)),
106
+ r[7] || (r[7] = t("p", { class: "text-c-2 mb-4 leading-[21px]" }, " We’ve got a whole rainbow of themes for you to play with: ", -1)),
107
+ t("div", L, [
108
+ t("div", O, [
109
+ (o(), y(z, null, B(_, (s) => d(e(m), {
85
110
  key: s,
86
- class: i(["px-2", [
111
+ class: u(["px-2", [
87
112
  "flex items-center justify-between gap-2 text-c-1 border-1/2",
88
- t(a).themeId === s ? "bg-b-1" : "bg-b-2"
113
+ e(i).themeId === s ? "bg-b-1" : "bg-b-2"
89
114
  ]]),
90
115
  variant: "ghost",
91
- onClick: (D) => w(s)
116
+ onClick: (H) => C(s)
92
117
  }, {
93
- default: d(() => [
94
- e("div", L, [
95
- e("div", {
96
- class: i(["flex items-center justify-center w-5 h-5 rounded-full border-2 border-c-3", {
97
- "bg-primary": t(a).themeId === s
118
+ default: p(() => [
119
+ t("div", R, [
120
+ t("div", {
121
+ class: u(["flex items-center justify-center w-5 h-5 rounded-full border-2 border-c-3", {
122
+ "bg-primary": e(i).themeId === s
98
123
  }])
99
124
  }, [
100
- e("div", O, [
101
- t(a).themeId === s ? (o(), u(t(k), {
125
+ t("div", q, [
126
+ e(i).themeId === s ? (o(), n(e(k), {
102
127
  key: 0,
103
128
  icon: "Checkmark",
104
129
  size: "xs",
105
130
  thickness: "3.5"
106
- })) : p("", !0)
131
+ })) : c("", !0)
107
132
  ])
108
133
  ], 2),
109
- b(" " + z(t(B)[s]), 1)
134
+ b(" " + v(e(N)[s]), 1)
110
135
  ]),
111
- e("div", R, [
112
- e("span", {
136
+ t("div", D, [
137
+ t("span", {
113
138
  class: "inline-block w-5 h-5 rounded-full border-c-3 -mr-3",
114
- style: m({
115
- backgroundColor: f(s).light
139
+ style: g({
140
+ backgroundColor: h(s).light
116
141
  })
117
142
  }, null, 4),
118
- e("span", {
143
+ t("span", {
119
144
  class: "inline-block w-5 h-5 rounded-full border-c-3 -mr-3",
120
- style: m({
121
- backgroundColor: f(s).dark
145
+ style: g({
146
+ backgroundColor: h(s).dark
122
147
  })
123
148
  }, null, 4),
124
- e("span", {
149
+ t("span", {
125
150
  class: "inline-block w-5 h-5 rounded-full border-c-3",
126
- style: m({
127
- backgroundColor: f(s).accent
151
+ style: g({
152
+ backgroundColor: h(s).accent
128
153
  })
129
154
  }, null, 4)
130
155
  ])
@@ -134,8 +159,8 @@ const P = { class: "bg-b-1 w-full h-full overflow-auto" }, T = { class: "flex fl
134
159
  ])
135
160
  ])
136
161
  ]),
137
- e("div", null, [
138
- c(N)
162
+ t("div", null, [
163
+ d(P)
139
164
  ])
140
165
  ])
141
166
  ])
@@ -143,5 +168,5 @@ const P = { class: "bg-b-1 w-full h-full overflow-auto" }, T = { class: "flex fl
143
168
  }
144
169
  });
145
170
  export {
146
- K as default
171
+ X as default
147
172
  };
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.1.31",
21
+ "version": "2.1.33",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -153,17 +153,17 @@
153
153
  "whatwg-mimetype": "^4.0.0",
154
154
  "yaml": "^2.4.5",
155
155
  "zod": "^3.23.8",
156
- "@scalar/components": "0.12.58",
156
+ "@scalar/components": "0.12.59",
157
+ "@scalar/draggable": "0.1.6",
157
158
  "@scalar/icons": "0.1.1",
158
- "@scalar/oas-utils": "0.2.60",
159
159
  "@scalar/object-utils": "1.1.10",
160
- "@scalar/draggable": "0.1.6",
160
+ "@scalar/oas-utils": "0.2.60",
161
161
  "@scalar/openapi-parser": "0.8.7",
162
162
  "@scalar/openapi-types": "0.1.4",
163
- "@scalar/themes": "0.9.41",
164
- "@scalar/use-codemirror": "0.11.25",
165
163
  "@scalar/types": "0.0.17",
164
+ "@scalar/themes": "0.9.41",
166
165
  "@scalar/use-toasts": "0.7.7",
166
+ "@scalar/use-codemirror": "0.11.26",
167
167
  "@scalar/use-tooltip": "1.0.3"
168
168
  },
169
169
  "devDependencies": {