@scalar/api-client 2.0.37 → 2.0.39

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 (60) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  3. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +15 -12
  4. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  5. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +47 -47
  6. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +11 -8
  8. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  9. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +23 -20
  10. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
  11. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +7 -4
  12. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  13. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  14. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +84 -80
  15. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  16. package/dist/components/DataTable/DataTableInput.vue.js +2 -2
  17. package/dist/components/DataTable/DataTableInput.vue2.js +1 -1
  18. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  19. package/dist/components/DataTable/DataTableInputSelect.vue.js +1 -1
  20. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts +2 -0
  21. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
  22. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +19 -15
  23. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  24. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +5 -40
  25. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +48 -2
  26. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -0
  27. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  28. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  29. package/dist/components/Sidebar/SidebarListElement.vue2.js +24 -22
  30. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  31. package/dist/components/Sidebar/SidebarListElementActions.vue.js +26 -25
  32. package/dist/components/SubpageHeader.vue.d.ts.map +1 -1
  33. package/dist/components/SubpageHeader.vue.js +5 -29
  34. package/dist/components/SubpageHeader.vue2.js +31 -2
  35. package/dist/layouts/App/create-api-client-app.d.ts +5 -5
  36. package/dist/layouts/Modal/create-api-client-modal.d.ts +10 -10
  37. package/dist/libs/create-client.d.ts +6 -5
  38. package/dist/libs/create-client.d.ts.map +1 -1
  39. package/dist/store/workspace.d.ts +12 -12
  40. package/dist/store/workspace.d.ts.map +1 -1
  41. package/dist/store/workspace.js +185 -181
  42. package/dist/style.css +1 -1
  43. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  44. package/dist/views/Cookies/Cookies.vue2.js +46 -36
  45. package/dist/views/Environment/Environment.vue2.js +26 -26
  46. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  47. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +37 -34
  48. package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
  49. package/dist/views/Request/RequestSection/RequestAuth.vue.js +5 -311
  50. package/dist/views/Request/RequestSection/RequestAuth.vue2.js +312 -2
  51. package/dist/views/Request/RequestSection/RequestSection.vue.js +19 -19
  52. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  53. package/dist/views/Request/RequestSidebarItem.vue.js +3 -3
  54. package/dist/views/Request/RequestSidebarItem.vue2.js +122 -103
  55. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +8 -2
  56. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  57. package/dist/views/Request/RequestSidebarItemMenu.vue.js +5 -152
  58. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +166 -2
  59. package/dist/views/Servers/Servers.vue2.js +17 -17
  60. package/package.json +6 -6
@@ -1,4 +1,168 @@
1
- import f from "./RequestSidebarItemMenu.vue.js";
1
+ import { defineComponent as V, computed as f, ref as B, openBlock as q, createElementBlock as A, Fragment as F, createVNode as i, unref as t, withCtx as a, createBlock as P, createCommentVNode as T, withKeys as K, withModifiers as W, createElementVNode as d, createTextVNode as E, pushScopeId as j, popScopeId as G } from "vue";
2
+ import H from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
3
+ import { commandPaletteBus as J } from "../../libs/eventBusses/command-palette.js";
4
+ import { PathId as R } from "../../router.js";
5
+ import { useWorkspace as L } from "../../store/workspace.js";
6
+ import { useModal as I, ScalarDropdown as O, ScalarDropdownItem as v, ScalarIcon as u, ScalarButton as x, ScalarModal as N, ScalarTextField as Q } from "@scalar/components";
7
+ import { useRouter as X } from "vue-router";
8
+ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(() => /* @__PURE__ */ d("span", null, "Add Example", -1)), Z = /* @__PURE__ */ h(() => /* @__PURE__ */ d("span", null, "Rename", -1)), ee = /* @__PURE__ */ h(() => /* @__PURE__ */ d("span", null, "Delete", -1)), te = { class: "flex gap-3" }, re = /* @__PURE__ */ V({
9
+ __name: "RequestSidebarItemMenu",
10
+ props: {
11
+ parentUids: {},
12
+ item: {}
13
+ },
14
+ setup(o) {
15
+ const e = o, {
16
+ activeWorkspace: k,
17
+ activeRouterParams: g,
18
+ collectionMutators: _,
19
+ folderMutators: w,
20
+ requestMutators: C,
21
+ requestExampleMutators: b
22
+ } = L(), { replace: y } = X(), U = () => J.emit({
23
+ commandName: "Add Example",
24
+ metaData: e.item.uid
25
+ }), D = () => {
26
+ "requestUid" in e.item ? (b.delete(e.item), g.value[R.Examples] === e.item.uid && y(`/workspace/${k.value}/request/default`)) : "summary" in e.item ? (C.delete(
27
+ e.item,
28
+ e.parentUids[e.parentUids.length - 1]
29
+ ), g.value[R.Request] === e.item.uid && y(`/workspace/${k.value.uid}/request/default`)) : "spec" in e.item ? _.delete(e.item) : "name" in e.item && w.delete(
30
+ e.item,
31
+ e.parentUids[e.parentUids.length - 1]
32
+ );
33
+ }, $ = f(() => "summary" in e.item), M = f(() => {
34
+ var p;
35
+ return "summary" in e.item ? e.item.summary || "" : "name" in e.item ? e.item.name || "" : "spec" in e.item && ((p = e.item.spec.info) == null ? void 0 : p.title) || "";
36
+ }), s = B(""), S = () => {
37
+ "summary" in e.item ? C.edit(e.item.uid, "summary", s.value) : "requestUid" in e.item ? b.edit(e.item.uid, "name", s.value) : "spec" in e.item ? _.edit(e.item.uid, "spec.info.title", s.value) : w.edit(e.item.uid, "name", s.value), r.hide();
38
+ }, r = I(), c = I(), z = () => {
39
+ s.value = M.value, r.show();
40
+ }, m = f(() => "requestUid" in e.item ? "Example" : "summary" in e.item ? "Request" : "spec" in e.item ? "Collection" : "Folder");
41
+ return (p, l) => (q(), A(F, null, [
42
+ i(t(O), { teleport: "#scalar-client" }, {
43
+ items: a(() => [
44
+ $.value ? (q(), P(t(v), {
45
+ key: 0,
46
+ class: "flex !gap-2",
47
+ onClick: U
48
+ }, {
49
+ default: a(() => [
50
+ i(t(u), {
51
+ class: "inline-flex",
52
+ icon: "Add",
53
+ size: "sm",
54
+ thickness: "1.5"
55
+ }),
56
+ Y
57
+ ]),
58
+ _: 1
59
+ })) : T("", !0),
60
+ i(t(v), {
61
+ class: "flex !gap-2",
62
+ onClick: z
63
+ }, {
64
+ default: a(() => [
65
+ i(t(u), {
66
+ class: "inline-flex",
67
+ icon: "Edit",
68
+ size: "sm",
69
+ thickness: "1.5"
70
+ }),
71
+ Z
72
+ ]),
73
+ _: 1
74
+ }),
75
+ i(t(v), {
76
+ class: "flex !gap-2",
77
+ onClick: l[1] || (l[1] = (n) => t(c).show())
78
+ }, {
79
+ default: a(() => [
80
+ i(t(u), {
81
+ class: "inline-flex",
82
+ icon: "Trash",
83
+ size: "sm",
84
+ thickness: "1.5"
85
+ }),
86
+ ee
87
+ ]),
88
+ _: 1
89
+ })
90
+ ]),
91
+ default: a(() => [
92
+ i(t(x), {
93
+ class: "px-1 py-0 z-10 hover:bg-b-3 hidden group-hover:flex ui-open:flex absolute h-[20px] ellipsis-position",
94
+ size: "sm",
95
+ variant: "ghost",
96
+ onClick: l[0] || (l[0] = (n) => {
97
+ (m.value === "Collection" || m.value === "Folder") && n.stopPropagation();
98
+ })
99
+ }, {
100
+ default: a(() => [
101
+ i(t(u), {
102
+ icon: "Ellipses",
103
+ size: "sm"
104
+ })
105
+ ]),
106
+ _: 1
107
+ })
108
+ ]),
109
+ _: 1
110
+ }),
111
+ i(t(N), {
112
+ size: "sm",
113
+ state: t(c),
114
+ title: `Delete ${m.value}`
115
+ }, {
116
+ default: a(() => [
117
+ i(H, {
118
+ variableName: M.value,
119
+ warningMessage: "Warning: Deleting this will delete all items inside of this",
120
+ onClose: l[2] || (l[2] = (n) => t(c).hide()),
121
+ onDelete: D
122
+ }, null, 8, ["variableName"])
123
+ ]),
124
+ _: 1
125
+ }, 8, ["state", "title"]),
126
+ i(t(N), {
127
+ state: t(r),
128
+ title: `Rename ${m.value}`
129
+ }, {
130
+ default: a(() => [
131
+ i(t(Q), {
132
+ modelValue: s.value,
133
+ "onUpdate:modelValue": l[3] || (l[3] = (n) => s.value = n),
134
+ label: m.value,
135
+ labelShadowColor: "var(--scalar-background-1)",
136
+ onKeydown: K(W(S, ["prevent"]), ["enter"])
137
+ }, null, 8, ["modelValue", "label", "onKeydown"]),
138
+ d("div", te, [
139
+ i(t(x), {
140
+ class: "flex-1",
141
+ variant: "outlined",
142
+ onClick: l[4] || (l[4] = (n) => t(r).hide())
143
+ }, {
144
+ default: a(() => [
145
+ E(" Cancel ")
146
+ ]),
147
+ _: 1
148
+ }),
149
+ i(t(x), {
150
+ class: "flex-1",
151
+ type: "submit",
152
+ onClick: S
153
+ }, {
154
+ default: a(() => [
155
+ E(" Save ")
156
+ ]),
157
+ _: 1
158
+ })
159
+ ])
160
+ ]),
161
+ _: 1
162
+ }, 8, ["state", "title"])
163
+ ], 64));
164
+ }
165
+ });
2
166
  export {
3
- f as default
167
+ re as default
4
168
  };
@@ -1,36 +1,36 @@
1
- import { defineComponent as _, openBlock as l, createBlock as s, withCtx as e, createVNode as r, unref as n, createElementVNode as d, createElementBlock as p, Fragment as v, renderList as x, createTextVNode as S } from "vue";
2
- import h from "../../components/Sidebar/SidebarButton.vue.js";
3
- import k from "../../components/Sidebar/SidebarList.vue.js";
4
- import b from "../../components/Sidebar/SidebarListElement.vue.js";
1
+ import { defineComponent as d, openBlock as l, createBlock as s, withCtx as e, createVNode as r, unref as n, createElementVNode as p, createElementBlock as _, Fragment as v, renderList as S, createTextVNode as x } from "vue";
2
+ import b from "../../components/Sidebar/SidebarButton.vue.js";
3
+ import h from "../../components/Sidebar/SidebarList.vue.js";
4
+ import k from "../../components/Sidebar/SidebarListElement.vue.js";
5
5
  import L from "../../components/SubpageHeader.vue.js";
6
6
  import V from "../../components/ViewLayout/ViewLayout.vue.js";
7
- import $ from "../../components/ViewLayout/ViewLayoutContent.vue.js";
8
- import { useWorkspace as w } from "../../store/workspace.js";
9
- import { createServer as C } from "@scalar/oas-utils/entities/workspace/server";
7
+ import w from "../../components/ViewLayout/ViewLayoutContent.vue.js";
8
+ import { useWorkspace as C } from "../../store/workspace.js";
9
+ import { createServer as $ } from "@scalar/oas-utils/entities/workspace/server";
10
10
  import { useRouter as y } from "vue-router";
11
11
  import B from "./ServerForm.vue.js";
12
12
  import E from "../../components/Sidebar/Sidebar.vue.js";
13
13
  /* empty css */
14
- const N = { class: "flex-1" }, K = /* @__PURE__ */ _({
14
+ const N = { class: "flex-1" }, K = /* @__PURE__ */ d({
15
15
  __name: "Servers",
16
16
  setup(g) {
17
- const { activeCollection: t, servers: m, serverMutators: c } = w(), { push: u } = y(), f = () => {
17
+ const { activeCollection: t, servers: m, serverMutators: c } = C(), { push: u } = y(), f = () => {
18
18
  if (!t.value) return;
19
- const o = C({ url: "http://localhost" });
19
+ const o = $({ url: "http://localhost" });
20
20
  c.add(o, t.value.uid), u(`/servers/${o.uid}`);
21
21
  };
22
- return (o, A) => (l(), s(L, null, {
22
+ return (o, H) => (l(), s(L, null, {
23
23
  default: e(() => [
24
24
  r(V, null, {
25
25
  default: e(() => [
26
26
  r(n(E), { title: "Servers" }, {
27
27
  content: e(() => [
28
- d("div", N, [
29
- r(k, null, {
28
+ p("div", N, [
29
+ r(h, null, {
30
30
  default: e(() => {
31
31
  var i;
32
32
  return [
33
- (l(!0), p(v, null, x((i = n(t)) == null ? void 0 : i.spec.serverUids, (a) => (l(), s(b, {
33
+ (l(!0), _(v, null, S((i = n(t)) == null ? void 0 : i.spec.serverUids, (a) => (l(), s(k, {
34
34
  key: a,
35
35
  class: "text-xs",
36
36
  variable: { name: n(m)[a].url, uid: a }
@@ -42,16 +42,16 @@ const N = { class: "flex-1" }, K = /* @__PURE__ */ _({
42
42
  ])
43
43
  ]),
44
44
  button: e(() => [
45
- r(h, { click: f }, {
45
+ r(b, { click: f }, {
46
46
  title: e(() => [
47
- S("Add Server")
47
+ x("Add Server")
48
48
  ]),
49
49
  _: 1
50
50
  })
51
51
  ]),
52
52
  _: 1
53
53
  }),
54
- r($, { class: "flex-1" }, {
54
+ r(w, { class: "flex-1" }, {
55
55
  default: e(() => [
56
56
  r(B)
57
57
  ]),
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.0.37",
21
+ "version": "2.0.39",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -126,14 +126,14 @@
126
126
  "vue": "^3.4.29",
127
127
  "vue-router": "^4.3.0",
128
128
  "zod": "^3.22.4",
129
- "@scalar/components": "0.12.23",
130
- "@scalar/oas-utils": "0.2.19",
131
129
  "@scalar/draggable": "0.1.3",
132
- "@scalar/themes": "0.9.16",
130
+ "@scalar/components": "0.12.25",
131
+ "@scalar/oas-utils": "0.2.21",
133
132
  "@scalar/object-utils": "1.1.5",
133
+ "@scalar/themes": "0.9.18",
134
+ "@scalar/use-codemirror": "0.11.8",
134
135
  "@scalar/use-toasts": "0.7.4",
135
- "@scalar/use-tooltip": "1.0.2",
136
- "@scalar/use-codemirror": "0.11.8"
136
+ "@scalar/use-tooltip": "1.0.2"
137
137
  },
138
138
  "devDependencies": {
139
139
  "@types/content-type": "^1.1.8",