@scalar/api-client 2.0.38 → 2.0.40

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 (86) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  3. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  4. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +84 -80
  5. package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
  6. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  7. package/dist/components/DataTable/DataTableInput.vue.js +2 -2
  8. package/dist/components/DataTable/DataTableInput.vue2.js +1 -1
  9. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  10. package/dist/components/DataTable/DataTableInputSelect.vue.js +1 -1
  11. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts +2 -0
  12. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
  13. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +18 -14
  14. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  15. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +5 -40
  16. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +48 -2
  17. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -0
  18. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  19. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  20. package/dist/components/Sidebar/SidebarListElement.vue2.js +24 -22
  21. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  22. package/dist/components/Sidebar/SidebarListElementActions.vue.js +26 -25
  23. package/dist/components/SubpageHeader.vue.d.ts.map +1 -1
  24. package/dist/components/SubpageHeader.vue.js +5 -29
  25. package/dist/components/SubpageHeader.vue2.js +31 -2
  26. package/dist/layouts/App/create-api-client-app.d.ts +20 -20
  27. package/dist/layouts/Modal/create-api-client-modal.d.ts +40 -40
  28. package/dist/libs/create-client.d.ts +20 -20
  29. package/dist/libs/sendRequest.d.ts.map +1 -1
  30. package/dist/libs/sendRequest.js +87 -70
  31. package/dist/store/workspace.d.ts +64 -64
  32. package/dist/store/workspace.d.ts.map +1 -1
  33. package/dist/store/workspace.js +129 -132
  34. package/dist/style.css +1 -1
  35. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  36. package/dist/views/Cookies/Cookies.vue2.js +46 -36
  37. package/dist/views/Environment/Environment.vue2.js +26 -26
  38. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  39. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +37 -34
  40. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  41. package/dist/views/Request/Request.vue.js +2 -2
  42. package/dist/views/Request/Request.vue2.js +196 -142
  43. package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
  44. package/dist/views/Request/RequestSection/RequestAuth.vue.js +5 -311
  45. package/dist/views/Request/RequestSection/RequestAuth.vue2.js +312 -2
  46. package/dist/views/Request/RequestSection/RequestSection.vue.js +19 -19
  47. package/dist/views/Request/RequestSidebarItem.vue.d.ts +4 -4
  48. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  49. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  50. package/dist/views/Request/RequestSidebarItem.vue2.js +108 -87
  51. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  52. package/dist/views/Request/RequestSidebarItemMenu.vue.js +5 -162
  53. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +166 -2
  54. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts +3 -17
  55. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
  56. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +89 -5
  57. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +2 -37
  58. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts +18 -0
  59. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -0
  60. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +34 -0
  61. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue2.js +4 -0
  62. package/dist/views/Request/ResponseSection/ResponseBodyInfo.vue.d.ts +12 -0
  63. package/dist/views/Request/ResponseSection/ResponseBodyInfo.vue.d.ts.map +1 -0
  64. package/dist/views/Request/ResponseSection/ResponseBodyInfo.vue.js +14 -0
  65. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts +23 -0
  66. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts.map +1 -0
  67. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +7 -0
  68. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +65 -0
  69. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts +19 -0
  70. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts.map +1 -0
  71. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +7 -0
  72. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +29 -0
  73. package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue.d.ts +20 -0
  74. package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue.d.ts.map +1 -0
  75. package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue.js +25 -0
  76. package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue2.js +4 -0
  77. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  78. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +61 -63
  79. package/dist/views/Request/consts/index.d.ts +2 -0
  80. package/dist/views/Request/consts/index.d.ts.map +1 -1
  81. package/dist/views/Request/consts/index.js +6 -3
  82. package/dist/views/Request/consts/mediaTypes.d.ts +16 -0
  83. package/dist/views/Request/consts/mediaTypes.d.ts.map +1 -0
  84. package/dist/views/Request/consts/mediaTypes.js +108 -0
  85. package/dist/views/Servers/Servers.vue2.js +17 -17
  86. package/package.json +8 -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 S, createElementBlock as A, Fragment as F, createVNode as i, unref as t, withCtx as l, 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 h, ScalarModal as N, ScalarTextField as Q } from "@scalar/components";
7
+ import { useRouter as X } from "vue-router";
8
+ const x = (o) => (j("data-v-b4adf477"), o = o(), G(), o), Y = /* @__PURE__ */ x(() => /* @__PURE__ */ d("span", null, "Add Example", -1)), Z = /* @__PURE__ */ x(() => /* @__PURE__ */ d("span", null, "Rename", -1)), ee = /* @__PURE__ */ x(() => /* @__PURE__ */ d("span", null, "Delete", -1)), te = { class: "flex gap-3" }, me = /* @__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: y,
21
+ requestExampleMutators: C
22
+ } = L(), { replace: b } = X(), U = () => J.emit({
23
+ commandName: "Add Example",
24
+ metaData: e.item.uid
25
+ }), D = () => {
26
+ "requestUid" in e.item ? (C.delete(e.item), g.value[R.Examples] === e.item.uid && b(`/workspace/${k.value}/request/default`)) : "summary" in e.item ? (y.delete(
27
+ e.item,
28
+ e.parentUids[e.parentUids.length - 1]
29
+ ), g.value[R.Request] === e.item.uid && b(`/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), q = 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(""), M = () => {
37
+ "summary" in e.item ? y.edit(e.item.uid, "summary", s.value) : "requestUid" in e.item ? C.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), m.hide();
38
+ }, m = I(), c = I(), z = () => {
39
+ s.value = q.value, m.show();
40
+ }, r = f(() => "requestUid" in e.item ? "Example" : "summary" in e.item ? "Request" : "spec" in e.item ? "Collection" : "Folder");
41
+ return (p, a) => (S(), A(F, null, [
42
+ i(t(O), { teleport: "#scalar-client" }, {
43
+ items: l(() => [
44
+ $.value ? (S(), P(t(v), {
45
+ key: 0,
46
+ class: "flex !gap-2",
47
+ onClick: U
48
+ }, {
49
+ default: l(() => [
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: l(() => [
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: a[1] || (a[1] = (n) => t(c).show())
78
+ }, {
79
+ default: l(() => [
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: l(() => [
92
+ i(t(h), {
93
+ class: "px-0.5 py-0 z-10 hover:bg-b-3 hidden group-hover:flex ui-open:flex absolute -translate-y-1/2 right-0 aspect-square inset-y-2/4 h-fit",
94
+ size: "sm",
95
+ variant: "ghost",
96
+ onClick: a[0] || (a[0] = (n) => {
97
+ (r.value === "Collection" || r.value === "Folder") && n.stopPropagation();
98
+ })
99
+ }, {
100
+ default: l(() => [
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 ${r.value}`
115
+ }, {
116
+ default: l(() => [
117
+ i(H, {
118
+ variableName: q.value,
119
+ warningMessage: "Warning: Deleting this will delete all items inside of this",
120
+ onClose: a[2] || (a[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(m),
128
+ title: `Rename ${r.value}`
129
+ }, {
130
+ default: l(() => [
131
+ i(t(Q), {
132
+ modelValue: s.value,
133
+ "onUpdate:modelValue": a[3] || (a[3] = (n) => s.value = n),
134
+ label: r.value,
135
+ labelShadowColor: "var(--scalar-background-1)",
136
+ onKeydown: K(W(M, ["prevent"]), ["enter"])
137
+ }, null, 8, ["modelValue", "label", "onKeydown"]),
138
+ d("div", te, [
139
+ i(t(h), {
140
+ class: "flex-1",
141
+ variant: "outlined",
142
+ onClick: a[4] || (a[4] = (n) => t(m).hide())
143
+ }, {
144
+ default: l(() => [
145
+ E(" Cancel ")
146
+ ]),
147
+ _: 1
148
+ }),
149
+ i(t(h), {
150
+ class: "flex-1",
151
+ type: "submit",
152
+ onClick: M
153
+ }, {
154
+ default: l(() => [
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
+ me as default
4
168
  };
@@ -1,4 +1,4 @@
1
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
1
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
2
  title: string;
3
3
  data: any;
4
4
  headers: {
@@ -6,9 +6,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
6
6
  value: string;
7
7
  required: boolean;
8
8
  }[];
9
- }>, {
10
- data: null;
11
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
9
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
12
10
  title: string;
13
11
  data: any;
14
12
  headers: {
@@ -16,20 +14,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
16
14
  value: string;
17
15
  required: boolean;
18
16
  }[];
19
- }>, {
20
- data: null;
21
- }>>>, {
22
- data: any;
23
- }, {}>;
17
+ }>>>, {}, {}>;
24
18
  export default _default;
25
- type __VLS_WithDefaults<P, D> = {
26
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
27
- default: D[K];
28
- }> : P[K];
29
- };
30
- type __VLS_Prettify<T> = {
31
- [K in keyof T]: T[K];
32
- } & {};
33
19
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
34
20
  type __VLS_TypePropsToOption<T> = {
35
21
  [K in keyof T]-?: {} extends Pick<T, K> ? {
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":";WAuEW,MAAM;UACP,GAAG;aACA;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE;;;;WAFtD,MAAM;UACP,GAAG;aACA;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE;;;;UADvD,GAAG;;AA0Fb,wBAMG;AAOH,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":";WA8GS,MAAM;UACP,GAAG;aACA;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE;;WAFtD,MAAM;UACP,GAAG;aACA;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE;;AAuL/D,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,7 +1,91 @@
1
- import o from "./ResponseBody.vue2.js";
2
- /* empty css */
3
- import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-223b333c"]]);
1
+ import { defineComponent as U, ref as x, computed as l, openBlock as r, createBlock as u, createSlots as L, withCtx as p, createTextVNode as w, toDisplayString as g, createElementBlock as V, createElementVNode as b, createCommentVNode as i, createVNode as j } from "vue";
2
+ import T from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
+ import C from "whatwg-mimetype";
4
+ import N from "./ResponseBodyDownload.vue.js";
5
+ import O from "./ResponseBodyInfo.vue.js";
6
+ import S from "./ResponseBodyPreview.vue.js";
7
+ import E from "./ResponseBodyRaw.vue.js";
8
+ import $ from "./ResponseBodyToggle.vue.js";
9
+ import { mediaTypes as I } from "../consts/mediaTypes.js";
10
+ const M = {
11
+ key: 0,
12
+ class: "mx-1 border-1/2 flex flex-col rounded bg-b-1"
13
+ }, P = { class: "flex justify-between items-center border-b-1/2 p-1.5" }, D = { class: "text-xxs leading-3 font-code" }, W = /* @__PURE__ */ U({
14
+ __name: "ResponseBody",
15
+ props: {
16
+ title: {},
17
+ data: {},
18
+ headers: {}
19
+ },
20
+ setup(h) {
21
+ const a = h, _ = (e) => e instanceof Blob, d = x(!0), m = l(
22
+ () => {
23
+ var e;
24
+ return !!((e = t.value) != null && e.raw && t.value.preview);
25
+ }
26
+ ), B = l(() => d.value || !m.value), R = l(() => !d.value || !m.value), o = l(() => {
27
+ var s;
28
+ const e = ((s = a.headers.find((c) => c.name.toLowerCase() === "content-type")) == null ? void 0 : s.value) ?? "";
29
+ return new C(e);
30
+ }), t = l(() => I[o.value.essence]), n = l(() => _(a.data) ? URL.createObjectURL(a.data) : typeof a.data == "string" ? URL.createObjectURL(
31
+ new Blob([a.data], { type: o.value.toString() })
32
+ ) : typeof a.data == "object" && Object.keys(a.data).length ? URL.createObjectURL(
33
+ new Blob([JSON.stringify(a.data)], {
34
+ type: o.value.toString()
35
+ })
36
+ ) : "");
37
+ return (e, s) => (r(), u(T, null, L({
38
+ title: p(() => [
39
+ w(g(e.title), 1)
40
+ ]),
41
+ default: p(() => {
42
+ var c, v, f, y;
43
+ return [
44
+ e.data ? (r(), V("div", M, [
45
+ b("div", P, [
46
+ b("span", D, g(o.value.essence), 1),
47
+ m.value ? (r(), u($, {
48
+ key: 0,
49
+ modelValue: d.value,
50
+ "onUpdate:modelValue": s[0] || (s[0] = (k) => d.value = k)
51
+ }, null, 8, ["modelValue"])) : i("", !0)
52
+ ]),
53
+ (c = t.value) != null && c.raw && R.value ? (r(), u(E, {
54
+ key: n.value,
55
+ data: e.data,
56
+ language: t.value.language
57
+ }, null, 8, ["data", "language"])) : i("", !0),
58
+ (v = t.value) != null && v.preview && B.value ? (r(), u(S, {
59
+ key: n.value,
60
+ alpha: t.value.alpha,
61
+ mode: t.value.preview,
62
+ src: n.value,
63
+ type: o.value.essence
64
+ }, null, 8, ["alpha", "mode", "src", "type"])) : i("", !0),
65
+ !((f = t.value) != null && f.raw) && !((y = t.value) != null && y.preview) ? (r(), u(O, { key: 2 }, {
66
+ default: p(() => [
67
+ w(" Binary file ")
68
+ ]),
69
+ _: 1
70
+ })) : i("", !0)
71
+ ])) : i("", !0)
72
+ ];
73
+ }),
74
+ _: 2
75
+ }, [
76
+ e.data && n.value ? {
77
+ name: "actions",
78
+ fn: p(() => [
79
+ j(N, {
80
+ href: n.value,
81
+ type: o.value.essence
82
+ }, null, 8, ["href", "type"])
83
+ ]),
84
+ key: "0"
85
+ } : void 0
86
+ ]), 1024));
87
+ }
88
+ });
5
89
  export {
6
- e as default
90
+ W as default
7
91
  };
@@ -1,39 +1,4 @@
1
- import { defineComponent as s, computed as u, ref as d, toRef as i, openBlock as f, createBlock as m, withCtx as o, createTextVNode as p, toDisplayString as _, createElementVNode as h } from "vue";
2
- import y from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
- import { useCodeMirror as g } from "@scalar/use-codemirror";
4
- const x = /* @__PURE__ */ s({
5
- __name: "ResponseBody",
6
- props: {
7
- title: {},
8
- data: { default: null },
9
- headers: {}
10
- },
11
- setup(a) {
12
- const r = a, l = u(() => {
13
- var t;
14
- const e = ((t = r.headers.find((c) => c.name.toLowerCase() === "content-type")) == null ? void 0 : t.value) ?? "";
15
- return e.includes("json") ? "json" : (e.includes("html"), "html");
16
- }), n = d(null);
17
- return g({
18
- codeMirrorRef: n,
19
- readOnly: !0,
20
- lineNumbers: !0,
21
- content: i(() => r.data),
22
- language: l
23
- }), (e, t) => (f(), m(y, null, {
24
- title: o(() => [
25
- p(_(e.title), 1)
26
- ]),
27
- default: o(() => [
28
- h("div", {
29
- ref_key: "codeMirrorRef",
30
- ref: n
31
- }, null, 512)
32
- ]),
33
- _: 1
34
- }));
35
- }
36
- });
1
+ import f from "./ResponseBody.vue.js";
37
2
  export {
38
- x as default
3
+ f as default
39
4
  };
@@ -0,0 +1,18 @@
1
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
+ href: string;
3
+ type?: string;
4
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
5
+ href: string;
6
+ type?: string;
7
+ }>>>, {}, {}>;
8
+ export default _default;
9
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+ type __VLS_TypePropsToOption<T> = {
11
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
12
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
+ } : {
14
+ type: import('vue').PropType<T[K]>;
15
+ required: true;
16
+ };
17
+ };
18
+ //# sourceMappingURL=ResponseBodyDownload.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseBodyDownload.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBodyDownload.vue"],"names":[],"mappings":";UAmCQ,MAAM;WACL,MAAM;;UADP,MAAM;WACL,MAAM;;AAqEf,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { defineComponent as s, computed as p, openBlock as d, createElementBlock as a, withModifiers as i, createVNode as l, unref as c, createElementVNode as m } from "vue";
2
+ import { ScalarIcon as f } from "@scalar/components";
3
+ import { mediaTypes as u } from "../consts/mediaTypes.js";
4
+ const x = ["download", "href"], h = /* @__PURE__ */ m("span", null, "Download", -1), k = /* @__PURE__ */ s({
5
+ __name: "ResponseBodyDownload",
6
+ props: {
7
+ href: {},
8
+ type: {}
9
+ },
10
+ setup(n) {
11
+ const t = n, r = p(
12
+ () => {
13
+ var e;
14
+ return ((e = u[t.type ?? ""]) == null ? void 0 : e.extension) ?? ".unknown";
15
+ }
16
+ );
17
+ return (e, o) => (d(), a("a", {
18
+ class: "flex gap-1 text-c-3 text-xxs no-underline items-center hover:bg-b-3 rounded py-0.5 px-1.5",
19
+ download: `response${r.value}`,
20
+ href: e.href,
21
+ onClick: o[0] || (o[0] = i(() => {
22
+ }, ["stop"]))
23
+ }, [
24
+ l(c(f), {
25
+ icon: "Download",
26
+ size: "xs"
27
+ }),
28
+ h
29
+ ], 8, x));
30
+ }
31
+ });
32
+ export {
33
+ k as default
34
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ResponseBodyDownload.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,12 @@
1
+ declare function __VLS_template(): {
2
+ default?(_: {}): any;
3
+ };
4
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
5
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
6
+ export default _default;
7
+ type __VLS_WithTemplateSlots<T, S> = T & {
8
+ new (): {
9
+ $slots: S;
10
+ };
11
+ };
12
+ //# sourceMappingURL=ResponseBodyInfo.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseBodyInfo.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBodyInfo.vue"],"names":[],"mappings":"AAcA,iBAAS,cAAc;qBAyBM,GAAG;EAa/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { openBlock as t, createElementBlock as o, createElementVNode as s, renderSlot as c } from "vue";
2
+ import n from "../../../_virtual/_plugin-vue_export-helper.js";
3
+ const r = {}, d = { class: "flex justify-center px-2 py-3" }, f = { class: "text-c-3 p-2 text-sm" };
4
+ function l(e, _) {
5
+ return t(), o("div", d, [
6
+ s("div", f, [
7
+ c(e.$slots, "default")
8
+ ])
9
+ ]);
10
+ }
11
+ const p = /* @__PURE__ */ n(r, [["render", l]]);
12
+ export {
13
+ p as default
14
+ };
@@ -0,0 +1,23 @@
1
+ import type { MediaPreview } from '../../../views/Request/consts/index.js';
2
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
3
+ src: string;
4
+ type: string;
5
+ mode?: MediaPreview;
6
+ alpha?: boolean;
7
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
8
+ src: string;
9
+ type: string;
10
+ mode?: MediaPreview;
11
+ alpha?: boolean;
12
+ }>>>, {}, {}>;
13
+ export default _default;
14
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
+ type __VLS_TypePropsToOption<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: import('vue').PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
23
+ //# sourceMappingURL=ResponseBodyPreview.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseBodyPreview.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBodyPreview.vue"],"names":[],"mappings":"AAuEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;;SAQnD,MAAM;UACL,MAAM;WACL,YAAY;YACX,OAAO;;SAHV,MAAM;UACL,MAAM;WACL,YAAY;YACX,OAAO;;AA8HjB,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import o from "./ResponseBodyPreview.vue2.js";
2
+ /* empty css */
3
+ import e from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-7fbe3767"]]);
5
+ export {
6
+ s as default
7
+ };
@@ -0,0 +1,65 @@
1
+ import { defineComponent as d, ref as i, watch as y, openBlock as s, createElementBlock as t, normalizeClass as n, createElementVNode as a, createBlock as m, withCtx as v, createTextVNode as f } from "vue";
2
+ import c from "./ResponseBodyInfo.vue.js";
3
+ const k = ["src"], w = ["src", "type"], B = ["src", "type"], E = ["data", "type"], $ = /* @__PURE__ */ d({
4
+ __name: "ResponseBodyPreview",
5
+ props: {
6
+ src: {},
7
+ type: {},
8
+ mode: {},
9
+ alpha: { type: Boolean }
10
+ },
11
+ setup(p) {
12
+ const u = p, r = i(!1);
13
+ return y(
14
+ () => u.src,
15
+ () => r.value = !1
16
+ ), (e, o) => !r.value && e.src ? (s(), t("div", {
17
+ key: 0,
18
+ class: n(["flex justify-center overflow-hidden rounded-b", { "p-2 bg-preview": e.alpha }])
19
+ }, [
20
+ e.mode === "image" ? (s(), t("img", {
21
+ key: 0,
22
+ class: n(["max-w-full", { rounded: e.alpha }]),
23
+ src: e.src,
24
+ onError: o[0] || (o[0] = (l) => r.value = !0)
25
+ }, null, 42, k)) : e.mode === "video" ? (s(), t("video", {
26
+ key: 1,
27
+ autoplay: "",
28
+ controls: "",
29
+ loop: "",
30
+ width: "100%",
31
+ onError: o[1] || (o[1] = (l) => r.value = !0)
32
+ }, [
33
+ a("source", {
34
+ src: e.src,
35
+ type: e.type
36
+ }, null, 8, w)
37
+ ], 32)) : e.mode === "audio" ? (s(), t("audio", {
38
+ key: 2,
39
+ class: "my-12",
40
+ controls: "",
41
+ loop: "",
42
+ onError: o[2] || (o[2] = (l) => r.value = !0)
43
+ }, [
44
+ a("source", {
45
+ src: e.src,
46
+ type: e.type
47
+ }, null, 8, B)
48
+ ], 32)) : (s(), t("object", {
49
+ key: 3,
50
+ class: "w-full aspect-[4/3]",
51
+ data: e.src,
52
+ type: e.type,
53
+ onError: o[3] || (o[3] = (l) => r.value = !0)
54
+ }, null, 40, E))
55
+ ], 2)) : (s(), m(c, { key: 1 }, {
56
+ default: v(() => [
57
+ f("Preview unavailable")
58
+ ]),
59
+ _: 1
60
+ }));
61
+ }
62
+ });
63
+ export {
64
+ $ as default
65
+ };
@@ -0,0 +1,19 @@
1
+ import { type CodeMirrorLanguage } from '@scalar/use-codemirror';
2
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
3
+ data: any;
4
+ language?: CodeMirrorLanguage;
5
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
6
+ data: any;
7
+ language?: CodeMirrorLanguage;
8
+ }>>>, {}, {}>;
9
+ export default _default;
10
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
11
+ type __VLS_TypePropsToOption<T> = {
12
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
13
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
14
+ } : {
15
+ type: import('vue').PropType<T[K]>;
16
+ required: true;
17
+ };
18
+ };
19
+ //# sourceMappingURL=ResponseBodyRaw.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseBodyRaw.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBodyRaw.vue"],"names":[],"mappings":"AAkDA,OAAO,EAAE,KAAK,kBAAkB,EAAiB,MAAM,wBAAwB,CAAA;;UAMvE,GAAG;eACE,kBAAkB;;UADvB,GAAG;eACE,kBAAkB;;AAoE/B,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import o from "./ResponseBodyRaw.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-121b444b"]]);
5
+ export {
6
+ a as default
7
+ };
@@ -0,0 +1,29 @@
1
+ import { defineComponent as a, ref as s, computed as u, toRaw as l, openBlock as i, createElementBlock as c } from "vue";
2
+ import { isJsonString as f } from "@scalar/oas-utils/helpers";
3
+ import { useCodeMirror as p } from "@scalar/use-codemirror";
4
+ const y = /* @__PURE__ */ a({
5
+ __name: "ResponseBodyRaw",
6
+ props: {
7
+ data: {},
8
+ language: {}
9
+ },
10
+ setup(o) {
11
+ const r = o, n = s(null), t = u(() => {
12
+ const e = r.data;
13
+ return e && f(e) ? JSON.stringify(JSON.parse(e), null, 2) : e && typeof l(e) == "object" ? JSON.stringify(e, null, 2) : e;
14
+ });
15
+ return p({
16
+ codeMirrorRef: n,
17
+ readOnly: !0,
18
+ lineNumbers: !0,
19
+ content: t,
20
+ language: r.language
21
+ }), (e, m) => (i(), c("div", {
22
+ ref_key: "codeMirrorRef",
23
+ ref: n
24
+ }, null, 512));
25
+ }
26
+ });
27
+ export {
28
+ y as default
29
+ };
@@ -0,0 +1,20 @@
1
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
+ modelValue: boolean;
3
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ "update:modelValue": (v: boolean) => void;
5
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
6
+ modelValue: boolean;
7
+ }>>> & {
8
+ "onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
9
+ }, {}, {}>;
10
+ export default _default;
11
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
+ type __VLS_TypePropsToOption<T> = {
13
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
14
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
+ } : {
16
+ type: import('vue').PropType<T[K]>;
17
+ required: true;
18
+ };
19
+ };
20
+ //# sourceMappingURL=ResponseBodyToggle.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseBodyToggle.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBodyToggle.vue"],"names":[],"mappings":";gBAgCc,OAAO;;;;gBAAP,OAAO;;;;AAyErB,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}