@scalar/api-client 2.1.34 → 2.1.36

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 (114) hide show
  1. package/CHANGELOG.md +30 -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/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  5. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +105 -119
  6. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  8. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +14 -14
  9. package/dist/components/CommandPalette/WatchModeToggle.vue.d.ts +15 -0
  10. package/dist/components/CommandPalette/WatchModeToggle.vue.d.ts.map +1 -0
  11. package/dist/components/CommandPalette/WatchModeToggle.vue.js +39 -0
  12. package/dist/components/CommandPalette/WatchModeToggle.vue2.js +4 -0
  13. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  14. package/dist/components/ContextBar.vue.js +1 -1
  15. package/dist/components/ContextBar.vue2.js +6 -6
  16. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  17. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  18. package/dist/components/DataTable/DataTableInput.vue2.js +53 -40
  19. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +1 -1
  20. package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
  21. package/dist/components/ImportCollection/DropEventListener.vue.js +39 -33
  22. package/dist/components/ImportCollection/ImportCollectionListener.vue.d.ts.map +1 -1
  23. package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -20
  24. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts +2 -0
  25. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  26. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +159 -100
  27. package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +5 -0
  28. package/dist/components/ImportCollection/ImportNowButton.vue.d.ts +2 -0
  29. package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
  30. package/dist/components/ImportCollection/ImportNowButton.vue.js +35 -31
  31. package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts +7 -0
  32. package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -0
  33. package/dist/components/ImportCollection/IntegrationLogo.vue.js +46 -0
  34. package/dist/components/ImportCollection/IntegrationLogo.vue2.js +4 -0
  35. package/dist/components/ImportCollection/PrefetchError.vue.d.ts +8 -0
  36. package/dist/components/ImportCollection/PrefetchError.vue.d.ts.map +1 -0
  37. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts +2 -2
  38. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts.map +1 -1
  39. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.js +7 -7
  40. package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
  41. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +2 -2
  42. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +29 -12
  43. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
  44. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +34 -42
  45. package/dist/components/OpenApiClientButton.vue.d.ts +13 -0
  46. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -0
  47. package/dist/components/OpenApiClientButton.vue.js +7 -0
  48. package/dist/components/OpenApiClientButton.vue2.js +36 -0
  49. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  50. package/dist/components/SideNav/SideNav.vue.js +2 -2
  51. package/dist/components/SideNav/SideNav.vue2.js +8 -8
  52. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  53. package/dist/components/TopNav/TopNav.vue.js +2 -2
  54. package/dist/components/TopNav/TopNav.vue2.js +14 -14
  55. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
  56. package/dist/components/index.d.ts +1 -0
  57. package/dist/components/index.d.ts.map +1 -1
  58. package/dist/components/index.js +4 -2
  59. package/dist/layouts/App/MainLayout.vue.d.ts.map +1 -1
  60. package/dist/layouts/App/MainLayout.vue.js +4 -4
  61. package/dist/layouts/App/create-api-client-app.d.ts +58 -41
  62. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  63. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  64. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  65. package/dist/layouts/Modal/create-api-client-modal.d.ts +116 -82
  66. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  67. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  68. package/dist/layouts/Web/ApiClientWeb.vue.js +42 -38
  69. package/dist/layouts/Web/create-api-client-web.d.ts +58 -41
  70. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  71. package/dist/libs/create-client.d.ts +58 -41
  72. package/dist/libs/create-client.d.ts.map +1 -1
  73. package/dist/store/collections.d.ts +34 -24
  74. package/dist/store/collections.d.ts.map +1 -1
  75. package/dist/store/import-spec.d.ts +6 -4
  76. package/dist/store/import-spec.d.ts.map +1 -1
  77. package/dist/store/store.d.ts +116 -82
  78. package/dist/store/store.d.ts.map +1 -1
  79. package/dist/style.css +1 -1
  80. package/dist/views/Request/Request.vue2.js +30 -31
  81. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +21 -21
  82. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
  83. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +79 -71
  84. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  85. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  86. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +24 -24
  87. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
  88. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +8 -8
  89. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  90. package/dist/views/Request/RequestSection/RequestSection.vue.js +5 -124
  91. package/dist/views/Request/RequestSection/RequestSection.vue2.js +126 -0
  92. package/dist/views/Request/RequestSidebar.vue.js +3 -3
  93. package/dist/views/Request/RequestSidebar.vue2.js +29 -29
  94. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  95. package/dist/views/Request/RequestSidebarItem.vue2.js +76 -76
  96. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +2 -2
  97. package/dist/views/Request/RequestSidebarItemMenu.vue.js +3 -3
  98. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +47 -47
  99. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  100. package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
  101. package/dist/views/Request/RequestSubpageHeader.vue2.js +67 -42
  102. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  103. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  104. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +1 -1
  105. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  106. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +5 -99
  107. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +104 -2
  108. package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
  109. package/dist/views/Request/hooks/useOpenApiWatcher.js +24 -24
  110. package/dist/views/Request/types/sidebar-item.d.ts +1 -1
  111. package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
  112. package/package.json +8 -8
  113. package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
  114. package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -5
@@ -1,52 +1,77 @@
1
- import { defineComponent as i, openBlock as l, createElementBlock as n, createElementVNode as r, createVNode as m, createBlock as s, unref as d, createCommentVNode as a } from "vue";
2
- import p from "../../components/AddressBar/AddressBar.vue.js";
3
- import u from "../../components/EnvironmentSelector/EnvironmentSelector.vue.js";
4
- import f from "../../components/Sidebar/SidebarToggle.vue.js";
5
- import { ScalarIcon as c } from "@scalar/components";
6
- import b from "./components/WorkspaceDropdown.vue.js";
7
- const g = { class: "lg:min-h-header flex items-center w-full justify-center p-2 pt-1 lg:p-1 flex-wrap t-app__top-container border-b-1/2" }, y = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-0.5 lg:flex-1 w-6/12" }, k = { class: "flex flex-row items-center gap-1 lg:px-2.5 lg:mb-0 mb-0.5 lg:flex-1 justify-end w-6/12" }, $ = /* @__PURE__ */ i({
1
+ import { defineComponent as b, openBlock as l, createElementBlock as s, createElementVNode as d, createVNode as i, createBlock as a, unref as t, createCommentVNode as n } from "vue";
2
+ import c from "../../components/AddressBar/AddressBar.vue.js";
3
+ import k from "../../components/EnvironmentSelector/EnvironmentSelector.vue.js";
4
+ import y from "../../components/Sidebar/SidebarToggle.vue.js";
5
+ import { ScalarIcon as g } from "@scalar/components";
6
+ import h from "./components/WorkspaceDropdown.vue.js";
7
+ import C from "../../components/OpenApiClientButton.vue.js";
8
+ import { useWorkspace as v } from "../../store/store.js";
9
+ const w = { class: "lg:min-h-header flex items-center w-full justify-center p-2 pt-2 lg:pt-1 lg:p-1 flex-wrap t-app__top-container border-b-1/2" }, V = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 lg:mb-0 mb-2 lg:flex-1 w-6/12" }, x = { class: "flex flex-row items-center gap-1 lg:px-2.5 lg:mb-0 mb-2 lg:flex-1 justify-end w-6/12" }, z = /* @__PURE__ */ b({
8
10
  __name: "RequestSubpageHeader",
9
11
  props: {
10
12
  modelValue: { type: Boolean },
11
13
  isReadonly: { type: Boolean }
12
14
  },
13
15
  emits: ["update:modelValue", "hideModal", "importCurl"],
14
- setup(x) {
15
- return (o, e) => (l(), n("div", g, [
16
- r("div", y, [
17
- m(f, {
18
- class: "gitbook-hidden",
19
- modelValue: o.modelValue,
20
- "onUpdate:modelValue": e[0] || (e[0] = (t) => o.$emit("update:modelValue", t))
21
- }, null, 8, ["modelValue"]),
22
- o.isReadonly ? a("", !0) : (l(), s(d(b), { key: 0 })),
23
- e[3] || (e[3] = r("a", {
24
- class: "text-c-2 text-sm font-medium gitbook-show ml-.5 hover:text-c-1 border p-1 rounded hover:bg-b-3",
25
- href: "https://scalar.com/",
26
- target: "_blank"
27
- }, " Powered by Scalar.com ", -1))
28
- ]),
29
- m(p, {
30
- onImportCurl: e[1] || (e[1] = (t) => o.$emit("importCurl", t))
31
- }),
32
- r("div", k, [
33
- o.isReadonly ? a("", !0) : (l(), s(u, { key: 0 })),
34
- o.isReadonly ? (l(), n("button", {
35
- key: 1,
36
- class: "text-c-1 hover:bg-b-2 active:text-c-1 p-2 rounded -mr-1.5",
37
- type: "button",
38
- onClick: e[2] || (e[2] = (t) => o.$emit("hideModal"))
39
- }, [
40
- m(d(c), {
41
- icon: "Close",
42
- size: "md",
43
- thickness: "1.75"
44
- })
45
- ])) : a("", !0)
46
- ])
47
- ]));
16
+ setup($) {
17
+ const { activeCollection: m } = v();
18
+ return (e, o) => {
19
+ var p, u, f;
20
+ return l(), s("div", w, [
21
+ d("div", V, [
22
+ i(y, {
23
+ class: "gitbook-hidden",
24
+ modelValue: e.modelValue,
25
+ "onUpdate:modelValue": o[0] || (o[0] = (r) => e.$emit("update:modelValue", r))
26
+ }, null, 8, ["modelValue"]),
27
+ e.isReadonly ? n("", !0) : (l(), a(t(h), { key: 0 })),
28
+ o[4] || (o[4] = d("a", {
29
+ class: "text-c-2 text-sm font-medium gitbook-show ml-.5 hover:text-c-1 border p-1 rounded hover:bg-b-3",
30
+ href: "https://scalar.com/",
31
+ target: "_blank"
32
+ }, " Powered by Scalar.com ", -1))
33
+ ]),
34
+ i(c, {
35
+ onImportCurl: o[1] || (o[1] = (r) => e.$emit("importCurl", r))
36
+ }),
37
+ d("div", x, [
38
+ e.isReadonly ? n("", !0) : (l(), a(k, { key: 0 })),
39
+ e.isReadonly && ((p = t(m)) != null && p.documentUrl) ? (l(), a(t(C), {
40
+ key: 1,
41
+ buttonSource: "modal",
42
+ class: "gitbook-hidden !w-fit lg:-mr-1",
43
+ integration: (u = t(m)) == null ? void 0 : u.integration,
44
+ url: (f = t(m)) == null ? void 0 : f.documentUrl
45
+ }, null, 8, ["integration", "url"])) : n("", !0),
46
+ e.isReadonly ? (l(), s("button", {
47
+ key: 2,
48
+ class: "app-exit-button p-2 rounded-full fixed right-2 top-2 gitbook-hidden",
49
+ type: "button",
50
+ onClick: o[2] || (o[2] = (r) => e.$emit("hideModal"))
51
+ }, [
52
+ i(t(g), {
53
+ icon: "Close",
54
+ size: "lg",
55
+ thickness: "2"
56
+ })
57
+ ])) : n("", !0),
58
+ e.isReadonly ? (l(), s("button", {
59
+ key: 3,
60
+ class: "text-c-1 hover:bg-b-2 active:text-c-1 p-2 rounded -mr-1.5 gitbook-show",
61
+ type: "button",
62
+ onClick: o[3] || (o[3] = (r) => e.$emit("hideModal"))
63
+ }, [
64
+ i(t(g), {
65
+ icon: "Close",
66
+ size: "md",
67
+ thickness: "1.75"
68
+ })
69
+ ])) : n("", !0)
70
+ ])
71
+ ]);
72
+ };
48
73
  }
49
74
  });
50
75
  export {
51
- $ as default
76
+ z as default
52
77
  };
@@ -14,7 +14,7 @@ const v = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, V = { cl
14
14
  s.commandPalette.emit({ commandName: "Create Request" });
15
15
  }, c = (n) => {
16
16
  n != null && n.createNew && x.name === "request" && m();
17
- }, y = "2.1.34";
17
+ }, y = "2.1.36";
18
18
  return R(() => s.hotKeys.on(c)), g(() => s.hotKeys.off(c)), (n, e) => (a(), l("div", v, [
19
19
  t("div", V, [
20
20
  o(f).isReadOnly ? u("", !0) : (a(), l("div", B, [
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseMetaInformation.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseMetaInformation.vue"],"names":[],"mappings":"AA0EA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;;cAQrC,gBAAgB;;cAAhB,gBAAgB;;AAgIlD,wBAMG"}
1
+ {"version":3,"file":"ResponseMetaInformation.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseMetaInformation.vue"],"names":[],"mappings":"AA0EA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;;cAQrC,gBAAgB;;cAAhB,gBAAgB;;AA+HlD,wBAMG"}
@@ -4,7 +4,7 @@ import { httpStatusCodes as N } from "@scalar/oas-utils/helpers";
4
4
  import V from "pretty-bytes";
5
5
  import f from "pretty-ms";
6
6
  import { useWorkspace as w } from "../../../store/store.js";
7
- const E = { class: "flex gap-1.5 text-c-3 pl-1" }, M = { key: 0 }, q = { key: 0 }, x = { key: 1 }, b = /* @__PURE__ */ y({
7
+ const E = { class: "flex gap-1.5 text-c-1" }, M = { key: 0 }, q = { key: 0 }, x = { key: 1 }, b = /* @__PURE__ */ y({
8
8
  __name: "ResponseMetaInformation",
9
9
  props: {
10
10
  response: {}
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseSection.vue"],"names":[],"mappings":"AAwHA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;;cAU3D,gBAAgB,GAAG,SAAS;;cAA5B,gBAAgB,GAAG,SAAS;;AAgOxC,wBAMG"}
1
+ {"version":3,"file":"ResponseSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseSection.vue"],"names":[],"mappings":"AA4JA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;;cAU3D,gBAAgB,GAAG,SAAS;;cAA5B,gBAAgB,GAAG,SAAS;;AAmPxC,wBAMG"}
@@ -1,101 +1,7 @@
1
- import { defineComponent as A, computed as i, ref as C, openBlock as s, createBlock as r, withCtx as u, createElementVNode as d, createTextVNode as B, createCommentVNode as a, createVNode as f, createElementBlock as v, Fragment as _ } from "vue";
2
- import S from "../../../components/ContextBar.vue.js";
3
- import H from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
4
- import R from "./ResponseBody.vue.js";
5
- import V from "./ResponseEmpty.vue.js";
6
- import $ from "./ResponseLoadingOverlay.vue.js";
7
- import N from "./ResponseMetaInformation.vue.js";
8
- import g from "./ResponseBodyVirtual.vue.js";
9
- /* empty css */
10
- import E from "./ResponseCookies.vue.js";
11
- import I from "./ResponseHeaders.vue.js";
12
- const L = { class: "flex items-center flex-1" }, O = { class: "custom-scroll relative flex flex-1 flex-col px-2 xl:px-4 py-2.5" }, T = 2e5, X = /* @__PURE__ */ A({
13
- __name: "ResponseSection",
14
- props: {
15
- response: {}
16
- },
17
- setup(k) {
18
- const l = k, c = i(() => {
19
- var t;
20
- const e = (t = l.response) == null ? void 0 : t.headers;
21
- return e ? Object.keys(e).map((o) => ({
22
- name: o,
23
- value: e[o],
24
- required: !1
25
- })).filter(
26
- (o) => ![
27
- "rest-api-client-content-length",
28
- "X-API-Client-Content-Length"
29
- ].includes(o.name)
30
- ) : [];
31
- }), y = i(
32
- () => {
33
- var e;
34
- return ((e = l.response) == null ? void 0 : e.cookieHeaderKeys.flatMap((t) => {
35
- var p, m;
36
- const o = (m = (p = l.response) == null ? void 0 : p.headers) == null ? void 0 : m[t];
37
- return o ? {
38
- name: t,
39
- value: o,
40
- required: !1
41
- } : [];
42
- })) ?? [];
43
- }
44
- ), h = ["All", "Cookies", "Headers", "Body"], n = C("All"), x = i(
45
- () => {
46
- var e;
47
- return (((e = l.response) == null ? void 0 : e.size) ?? 0) > T;
48
- }
49
- );
50
- return (e, t) => (s(), r(H, null, {
51
- title: u(() => [
52
- d("div", L, [
53
- t[1] || (t[1] = B(" Response ")),
54
- e.response ? (s(), r(N, {
55
- key: 0,
56
- response: e.response
57
- }, null, 8, ["response"])) : a("", !0),
58
- f(S, {
59
- activeSection: n.value,
60
- sections: h,
61
- onSetActiveSection: t[0] || (t[0] = (o) => n.value = o)
62
- }, null, 8, ["activeSection"])
63
- ])
64
- ]),
65
- default: u(() => {
66
- var o;
67
- return [
68
- d("div", O, [
69
- e.response ? (s(), v(_, { key: 1 }, [
70
- n.value === "All" || n.value === "Cookies" ? (s(), r(E, {
71
- key: 0,
72
- cookies: y.value
73
- }, null, 8, ["cookies"])) : a("", !0),
74
- n.value === "All" || n.value === "Headers" ? (s(), r(I, {
75
- key: 1,
76
- headers: c.value
77
- }, null, 8, ["headers"])) : a("", !0),
78
- n.value === "All" || n.value === "Body" ? (s(), v(_, { key: 2 }, [
79
- x.value ? (s(), r(g, {
80
- key: 0,
81
- content: l.response.data
82
- }, null, 8, ["content"])) : (s(), r(R, {
83
- key: 1,
84
- active: !0,
85
- data: (o = l.response) == null ? void 0 : o.data,
86
- headers: c.value,
87
- title: "Body"
88
- }, null, 8, ["data", "headers"]))
89
- ], 64)) : a("", !0)
90
- ], 64)) : (s(), r(V, { key: 0 })),
91
- f($)
92
- ])
93
- ];
94
- }),
95
- _: 1
96
- }));
97
- }
98
- });
1
+ import o from "./ResponseSection.vue2.js";
2
+ /* empty css */
3
+ import e from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-f15e1ace"]]);
99
5
  export {
100
- X as default
6
+ s as default
101
7
  };
@@ -1,4 +1,106 @@
1
- import f from "./ResponseSection.vue.js";
1
+ import { defineComponent as A, computed as i, ref as x, openBlock as n, createBlock as r, withCtx as d, createElementVNode as p, normalizeClass as B, createCommentVNode as l, createVNode as f, createElementBlock as v, Fragment as k } from "vue";
2
+ import S from "../../../components/ContextBar.vue.js";
3
+ import g from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
4
+ import H from "./ResponseBody.vue.js";
5
+ import R from "./ResponseEmpty.vue.js";
6
+ import $ from "./ResponseLoadingOverlay.vue.js";
7
+ import V from "./ResponseMetaInformation.vue.js";
8
+ import E from "./ResponseBodyVirtual.vue.js";
9
+ /* empty css */
10
+ import I from "./ResponseCookies.vue.js";
11
+ import L from "./ResponseHeaders.vue.js";
12
+ const N = { class: "custom-scroll relative flex flex-1 flex-col px-2 xl:px-4 py-2.5" }, O = 2e5, U = /* @__PURE__ */ A({
13
+ __name: "ResponseSection",
14
+ props: {
15
+ response: {}
16
+ },
17
+ setup(y) {
18
+ const a = y, c = i(() => {
19
+ var o;
20
+ const e = (o = a.response) == null ? void 0 : o.headers;
21
+ return e ? Object.keys(e).map((s) => ({
22
+ name: s,
23
+ value: e[s],
24
+ required: !1
25
+ })).filter(
26
+ (s) => ![
27
+ "rest-api-client-content-length",
28
+ "X-API-Client-Content-Length"
29
+ ].includes(s.name)
30
+ ) : [];
31
+ }), _ = i(
32
+ () => {
33
+ var e;
34
+ return ((e = a.response) == null ? void 0 : e.cookieHeaderKeys.flatMap((o) => {
35
+ var m, u;
36
+ const s = (u = (m = a.response) == null ? void 0 : m.headers) == null ? void 0 : u[o];
37
+ return s ? {
38
+ name: o,
39
+ value: s,
40
+ required: !1
41
+ } : [];
42
+ })) ?? [];
43
+ }
44
+ ), h = ["All", "Cookies", "Headers", "Body"], t = x("All"), C = i(
45
+ () => {
46
+ var e;
47
+ return (((e = a.response) == null ? void 0 : e.size) ?? 0) > O;
48
+ }
49
+ );
50
+ return (e, o) => (n(), r(g, null, {
51
+ title: d(() => [
52
+ p("div", {
53
+ class: B(["flex items-center flex-1 h-8", {
54
+ "animate-response-heading": e.response
55
+ }])
56
+ }, [
57
+ o[1] || (o[1] = p("span", { class: "response-heading absolute pointer-events-none" }, "Response", -1)),
58
+ e.response ? (n(), r(V, {
59
+ key: 0,
60
+ class: "animate-response-children",
61
+ response: e.response
62
+ }, null, 8, ["response"])) : l("", !0),
63
+ f(S, {
64
+ activeSection: t.value,
65
+ sections: h,
66
+ onSetActiveSection: o[0] || (o[0] = (s) => t.value = s)
67
+ }, null, 8, ["activeSection"])
68
+ ], 2)
69
+ ]),
70
+ default: d(() => {
71
+ var s;
72
+ return [
73
+ p("div", N, [
74
+ e.response ? (n(), v(k, { key: 1 }, [
75
+ t.value === "All" || t.value === "Cookies" ? (n(), r(I, {
76
+ key: 0,
77
+ cookies: _.value
78
+ }, null, 8, ["cookies"])) : l("", !0),
79
+ t.value === "All" || t.value === "Headers" ? (n(), r(L, {
80
+ key: 1,
81
+ headers: c.value
82
+ }, null, 8, ["headers"])) : l("", !0),
83
+ t.value === "All" || t.value === "Body" ? (n(), v(k, { key: 2 }, [
84
+ C.value ? (n(), r(E, {
85
+ key: 0,
86
+ content: a.response.data
87
+ }, null, 8, ["content"])) : (n(), r(H, {
88
+ key: 1,
89
+ active: !0,
90
+ data: (s = a.response) == null ? void 0 : s.data,
91
+ headers: c.value,
92
+ title: "Body"
93
+ }, null, 8, ["data", "headers"]))
94
+ ], 64)) : l("", !0)
95
+ ], 64)) : (n(), r(R, { key: 0 })),
96
+ f($)
97
+ ])
98
+ ];
99
+ }),
100
+ _: 1
101
+ }));
102
+ }
103
+ });
2
104
  export {
3
- f as default
105
+ U as default
4
106
  };
@@ -159,7 +159,7 @@ const H = { class: "flex items-center text-sm w-[inherit]" }, J = { class: "font
159
159
  ]),
160
160
  default: n(() => [
161
161
  s(e(S), {
162
- class: "font-normal h-full justify-start line-clamp-1 py-1.5 px-1.5 text-c-3 hover:bg-b-2 w-fit",
162
+ class: "font-normal h-full justify-start line-clamp-1 py-1.5 px-1.5 text-c-1 hover:bg-b-2 w-fit",
163
163
  fullWidth: "",
164
164
  variant: "ghost"
165
165
  }, {
@@ -1,43 +1,43 @@
1
1
  import { specDictionary as u } from "../../../store/import-spec.js";
2
- import { combineRenameDiffs as y, mutateCollectionDiff as A, mutateSecuritySchemeDiff as R, mutateServerDiff as S, mutateTagDiff as D, mutateRequestDiff as E } from "../libs/live-sync.js";
3
- import { fetchSpecFromUrl as C, createHash as T } from "@scalar/oas-utils/helpers";
2
+ import { combineRenameDiffs as A, mutateCollectionDiff as R, mutateSecuritySchemeDiff as S, mutateServerDiff as d, mutateTagDiff as g, mutateRequestDiff as D } from "../libs/live-sync.js";
3
+ import { fetchSpecFromUrl as E, createHash as T } from "@scalar/oas-utils/helpers";
4
4
  import { parseSchema as l } from "@scalar/oas-utils/transforms";
5
- import { useToasts as d } from "@scalar/use-toasts";
6
- import { useTimeoutPoll as F } from "@vueuse/core";
7
- import I from "microdiff";
8
- import { watch as U } from "vue";
5
+ import { useToasts as M } from "@scalar/use-toasts";
6
+ import { useTimeoutPoll as I } from "@vueuse/core";
7
+ import U from "microdiff";
8
+ import { watch as C } from "vue";
9
9
  import { useWorkspace as L } from "../../../store/store.js";
10
10
  const N = 5 * 1e3, b = 60 * 1e3, V = () => {
11
- const { toast: h } = d(), c = L(), { activeCollection: t, activeWorkspace: g, collectionMutators: i } = c, o = (e) => h(
11
+ const { toast: f } = M(), c = L(), { activeCollection: t, activeWorkspace: v, collectionMutators: i } = c, o = (e) => f(
12
12
  `[useOpenApiWatcher] Changes to the ${e} were not applied`,
13
13
  "error"
14
- ), v = (e) => {
15
- e.path[0] === "info" || e.path[0] === "security" ? A(e, c) || o("collection") : e.path[0] === "components" && e.path[1] === "securitySchemes" ? R(e, c) || o("securitySchemes") : e.path[0] === "servers" ? S(e, c) || o("servers") : e.path[0] === "tags" ? D(e, c) || o("tags") : e.path[0] === "paths" && (E(e, c) || o("requests"));
16
- }, { pause: f, resume: p } = F(async () => {
14
+ ), O = (e) => {
15
+ e.path[0] === "info" || e.path[0] === "security" ? R(e, c) || o("collection") : e.path[0] === "components" && e.path[1] === "securitySchemes" ? S(e, c) || o("securitySchemes") : e.path[0] === "servers" ? d(e, c) || o("servers") : e.path[0] === "tags" ? g(e, c) || o("tags") : e.path[0] === "paths" && (D(e, c) || o("requests"));
16
+ }, { pause: h, resume: p } = I(async () => {
17
17
  var m;
18
18
  const e = (m = t.value) == null ? void 0 : m.documentUrl;
19
19
  if (!e) return;
20
20
  const s = u[e];
21
21
  try {
22
- const r = await C(
22
+ const r = await E(
23
23
  e,
24
- g.value.proxyUrl,
24
+ v.value.proxyUrl,
25
25
  !1
26
26
  ), n = T(r);
27
27
  if (i.edit(
28
28
  t.value.uid,
29
- "watchForChangesStatus",
29
+ "watchModeStatus",
30
30
  "WATCHING"
31
31
  ), s != null && s.hash)
32
32
  if (s.hash && s.hash !== n) {
33
- const { schema: a } = await l(r), O = I(s.schema, a), W = y(O);
33
+ const { schema: a } = await l(r), W = U(s.schema, a), w = A(W);
34
34
  try {
35
- W.forEach(v), u[e] = {
35
+ w.forEach(O), u[e] = {
36
36
  hash: n,
37
37
  schema: a
38
38
  };
39
- } catch (w) {
40
- console.error("[useOpenApiWatcher] Error:", w);
39
+ } catch (y) {
40
+ console.error("[useOpenApiWatcher] Error:", y);
41
41
  }
42
42
  } else console.log("[useOpenApiWatcher] No changes detected yet…");
43
43
  else {
@@ -48,11 +48,11 @@ const N = 5 * 1e3, b = 60 * 1e3, V = () => {
48
48
  });
49
49
  }
50
50
  } catch (r) {
51
- console.error("[useOpenApiWatcher] Error:", r), console.info("[useOpenApiWatcher] Pausing watcher for 60 seconds"), f(), i.edit(
51
+ console.error("[useOpenApiWatcher] Error:", r), console.info("[useOpenApiWatcher] Pausing watcher for 60 seconds"), h(), i.edit(
52
52
  t.value.uid,
53
- "watchForChangesStatus",
53
+ "watchModeStatus",
54
54
  "ERROR"
55
- ), h(
55
+ ), f(
56
56
  "[useOpenApiWatcher] Unable to fetch the spec file, paused the watcher for 60 seconds",
57
57
  "error"
58
58
  ), setTimeout(() => {
@@ -60,7 +60,7 @@ const N = 5 * 1e3, b = 60 * 1e3, V = () => {
60
60
  }, b);
61
61
  }
62
62
  }, N);
63
- U(
63
+ C(
64
64
  [
65
65
  () => {
66
66
  var e;
@@ -68,13 +68,13 @@ const N = 5 * 1e3, b = 60 * 1e3, V = () => {
68
68
  },
69
69
  () => {
70
70
  var e;
71
- return (e = t.value) == null ? void 0 : e.watchForChanges;
71
+ return (e = t.value) == null ? void 0 : e.watchMode;
72
72
  }
73
73
  ],
74
74
  ([e, s]) => {
75
- e && s ? (console.info(`[useOpenApiWatcher] Watching ${e} …`), p()) : t.value && (f(), i.edit(
75
+ e && s ? (console.info(`[useOpenApiWatcher] Watching ${e} …`), p()) : t.value && (h(), i.edit(
76
76
  t.value.uid,
77
- "watchForChangesStatus",
77
+ "watchModeStatus",
78
78
  "IDLE"
79
79
  ));
80
80
  },
@@ -11,7 +11,7 @@ export type SidebarItem = {
11
11
  edit: (name: string, icon?: string) => void;
12
12
  delete: () => void;
13
13
  documentUrl?: string;
14
- watchForChanges?: boolean;
14
+ watchMode?: boolean;
15
15
  };
16
16
  export type SidebarMenuItem = {
17
17
  /** The resource which we are opening the menu for */
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar-item.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/types/sidebar-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,cAAc,EACd,aAAa,EACb,GAAG,EACJ,MAAM,iCAAiC,CAAA;AAExC,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,UAAU,GAAG,GAAG,GAAG,OAAO,GAAG,cAAc,CAAA;IACnD,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3C,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,qDAAqD;IACrD,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,iBAAiB,CAAA;IAC7B,8CAA8C;IAC9C,IAAI,EAAE,OAAO,CAAA;CACd,CAAA"}
1
+ {"version":3,"file":"sidebar-item.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/types/sidebar-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,cAAc,EACd,aAAa,EACb,GAAG,EACJ,MAAM,iCAAiC,CAAA;AAExC,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,UAAU,GAAG,GAAG,GAAG,OAAO,GAAG,cAAc,CAAA;IACnD,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3C,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,qDAAqD;IACrD,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,iBAAiB,CAAA;IAC7B,8CAA8C;IAC9C,IAAI,EAAE,OAAO,CAAA;CACd,CAAA"}
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.1.34",
21
+ "version": "2.1.36",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -153,16 +153,16 @@
153
153
  "whatwg-mimetype": "^4.0.0",
154
154
  "yaml": "^2.4.5",
155
155
  "zod": "^3.23.8",
156
- "@scalar/components": "0.12.60",
157
- "@scalar/icons": "0.1.1",
156
+ "@scalar/components": "0.12.62",
158
157
  "@scalar/draggable": "0.1.6",
159
- "@scalar/openapi-parser": "0.8.8",
158
+ "@scalar/icons": "0.1.1",
159
+ "@scalar/oas-utils": "0.2.63",
160
160
  "@scalar/object-utils": "1.1.10",
161
- "@scalar/openapi-types": "0.1.4",
162
- "@scalar/themes": "0.9.42",
163
- "@scalar/oas-utils": "0.2.61",
161
+ "@scalar/openapi-parser": "0.8.8",
162
+ "@scalar/themes": "0.9.44",
164
163
  "@scalar/types": "0.0.17",
165
- "@scalar/use-codemirror": "0.11.27",
164
+ "@scalar/use-codemirror": "0.11.29",
165
+ "@scalar/openapi-types": "0.1.4",
166
166
  "@scalar/use-toasts": "0.7.7",
167
167
  "@scalar/use-tooltip": "1.0.3"
168
168
  },
@@ -1,4 +0,0 @@
1
- import f from "./ImportCollectionModal.vue.js";
2
- export {
3
- f as default
4
- };
@@ -1,5 +0,0 @@
1
- import o from "./RequestSection.vue.js";
2
- /* empty css */
3
- export {
4
- o as default
5
- };