@scalar/api-reference 1.31.2 → 1.31.4

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 (140) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dist/browser/standalone.js +9428 -9384
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  6. package/dist/components/ApiReferenceLayout.vue2.js +72 -73
  7. package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
  8. package/dist/components/Badge/Badge.vue.js +1 -1
  9. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  10. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +1 -1
  11. package/dist/components/Content/Introduction/Description.vue.d.ts.map +1 -1
  12. package/dist/components/Content/Introduction/Description.vue.js +2 -2
  13. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Lazy/Loading.vue.js +1 -1
  15. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  16. package/dist/components/Content/Schema/SchemaComposition.vue.js +77 -113
  17. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  19. package/dist/components/Content/Schema/SchemaProperty.vue2.js +114 -105
  20. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +35 -35
  21. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
  22. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.js +17 -15
  23. package/dist/components/Content/Schema/helpers/schema-name.d.ts +16 -0
  24. package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -0
  25. package/dist/components/Content/Schema/helpers/schema-name.js +32 -0
  26. package/dist/components/Content/Tag/OperationsList.vue.d.ts.map +1 -1
  27. package/dist/components/Content/Tag/OperationsList.vue.js +1 -1
  28. package/dist/components/Content/Tag/OperationsList.vue2.js +10 -9
  29. package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
  30. package/dist/components/Content/Tag/OperationsListItem.vue.js +1 -1
  31. package/dist/components/Content/Tag/OperationsListItem.vue2.js +29 -28
  32. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  33. package/dist/components/Content/Tag/TagList.vue.js +35 -34
  34. package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts.map +1 -1
  35. package/dist/components/DocumentSelector/DocumentSelector.vue.js +21 -28
  36. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +1 -20
  37. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  38. package/dist/components/HttpMethod/HttpMethod.vue.js +12 -13
  39. package/dist/components/Section/CompactSection.vue.js +2 -2
  40. package/dist/components/Section/CompactSection.vue2.js +6 -6
  41. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  42. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  43. package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
  44. package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
  45. package/dist/components/Sidebar/SidebarElement.vue2.js +5 -5
  46. package/dist/esm.d.ts.map +1 -1
  47. package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +1 -1
  48. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +1 -1
  49. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -1
  50. package/dist/features/DocumentSource/hooks/useDocumentSource.js +11 -11
  51. package/dist/features/DownloadLink/DownloadLink.vue.d.ts +1 -1
  52. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
  53. package/dist/features/DownloadLink/DownloadLink.vue.js +1 -1
  54. package/dist/features/DownloadLink/DownloadLink.vue2.js +45 -28
  55. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  56. package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
  57. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +1 -1
  58. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -1
  59. package/dist/features/Operation/components/ParameterHeaders.vue.js +2 -2
  60. package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
  61. package/dist/features/Search/SearchButton.vue.js +2 -2
  62. package/dist/features/Search/SearchButton.vue2.js +16 -16
  63. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  64. package/dist/features/Search/SearchModal.vue.js +2 -2
  65. package/dist/features/Search/SearchModal.vue2.js +1 -1
  66. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  67. package/dist/features/Search/useSearchIndex.js +29 -28
  68. package/dist/features/sidebar/helpers/create-sidebar.d.ts +26 -0
  69. package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +1 -0
  70. package/dist/features/sidebar/hooks/useSidebar.d.ts +23 -0
  71. package/dist/features/sidebar/hooks/useSidebar.d.ts.map +1 -0
  72. package/dist/features/sidebar/index.d.ts +2 -0
  73. package/dist/features/sidebar/index.d.ts.map +1 -0
  74. package/dist/features/traverse-schema/helpers/get-tag.d.ts +4 -0
  75. package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +1 -0
  76. package/dist/features/traverse-schema/helpers/operation-id-params.d.ts +8 -0
  77. package/dist/features/traverse-schema/helpers/operation-id-params.d.ts.map +1 -0
  78. package/dist/features/traverse-schema/helpers/operation-id-params.js +8 -0
  79. package/dist/features/traverse-schema/helpers/traverse-description.d.ts +9 -0
  80. package/dist/features/traverse-schema/helpers/traverse-description.d.ts.map +1 -0
  81. package/dist/features/traverse-schema/helpers/traverse-document.d.ts +16 -0
  82. package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +1 -0
  83. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +11 -0
  84. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -0
  85. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +6 -0
  86. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -0
  87. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +9 -0
  88. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +1 -0
  89. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +6 -0
  90. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +1 -0
  91. package/dist/features/traverse-schema/index.d.ts +4 -0
  92. package/dist/features/traverse-schema/index.d.ts.map +1 -0
  93. package/dist/features/traverse-schema/types.d.ts +51 -0
  94. package/dist/features/traverse-schema/types.d.ts.map +1 -0
  95. package/dist/helpers/parse.d.ts.map +1 -1
  96. package/dist/helpers/parse.js +16 -16
  97. package/dist/hooks/useNavState.d.ts +9 -4
  98. package/dist/hooks/useNavState.d.ts.map +1 -1
  99. package/dist/hooks/useNavState.js +31 -29
  100. package/dist/hooks/useSidebar.d.ts.map +1 -1
  101. package/dist/hooks/useSidebar.js +69 -68
  102. package/dist/index.js +1 -1
  103. package/dist/legacy/fixtures/httpRequestMethods.js +2 -6
  104. package/dist/libs/download.d.ts +2 -1
  105. package/dist/libs/download.d.ts.map +1 -1
  106. package/dist/libs/download.js +23 -11
  107. package/dist/stores/useHttpClientStore.js +18 -18
  108. package/dist/style.css +1 -1
  109. package/dist/types.d.ts +0 -1
  110. package/dist/types.d.ts.map +1 -1
  111. package/package.json +12 -11
  112. package/dist/components/HttpMethod/constants.d.ts +0 -9
  113. package/dist/components/HttpMethod/constants.d.ts.map +0 -1
  114. package/dist/components/HttpMethod/constants.js +0 -36
  115. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts +0 -4
  116. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts.map +0 -1
  117. package/dist/components/HttpMethod/utils/isRequestMethod.js +0 -7
  118. package/dist/helpers/freeze-element.d.ts +0 -11
  119. package/dist/helpers/freeze-element.d.ts.map +0 -1
  120. package/dist/helpers/freeze-element.js +0 -20
  121. package/dist/helpers/is-mac-os.d.ts +0 -5
  122. package/dist/helpers/is-mac-os.d.ts.map +0 -1
  123. package/dist/helpers/is-mac-os.js +0 -4
  124. package/dist/helpers/local-storage.d.ts +0 -8
  125. package/dist/helpers/local-storage.d.ts.map +0 -1
  126. package/dist/helpers/local-storage.js +0 -6
  127. package/dist/helpers/measure.d.ts +0 -21
  128. package/dist/helpers/measure.d.ts.map +0 -1
  129. package/dist/helpers/measure.js +0 -7
  130. package/dist/helpers/scroll-to-id.d.ts +0 -7
  131. package/dist/helpers/scroll-to-id.d.ts.map +0 -1
  132. package/dist/helpers/scroll-to-id.js +0 -21
  133. package/dist/helpers/sleep.d.ts +0 -6
  134. package/dist/helpers/sleep.d.ts.map +0 -1
  135. package/dist/helpers/sleep.js +0 -4
  136. package/dist/legacy/helpers/index.d.ts +0 -2
  137. package/dist/legacy/helpers/index.d.ts.map +0 -1
  138. package/dist/legacy/helpers/normalizeRequestMethod.d.ts +0 -6
  139. package/dist/legacy/helpers/normalizeRequestMethod.d.ts.map +0 -1
  140. package/dist/legacy/helpers/normalizeRequestMethod.js +0 -10
@@ -1,4 +1,4 @@
1
- const t = [
1
+ const T = [
2
2
  "GET",
3
3
  "POST",
4
4
  "PUT",
@@ -9,10 +9,6 @@ const t = [
9
9
  "CONNECT",
10
10
  "TRACE"
11
11
  ];
12
- function T(e) {
13
- return t.includes(e);
14
- }
15
12
  export {
16
- T as isRequestMethod,
17
- t as validRequestMethods
13
+ T as validRequestMethods
18
14
  };
@@ -1,9 +1,10 @@
1
1
  export declare const downloadEventBus: import("@vueuse/core").UseEventBusReturn<{
2
2
  id: string;
3
3
  filename?: string;
4
+ format?: "json" | "yaml";
4
5
  }, any>;
5
6
  /**
6
7
  * Trigger the download of the OpenAPI document
7
8
  */
8
- export declare function downloadDocument(content: string, filename?: string): void;
9
+ export declare function downloadDocument(content: string, filename?: string, format?: 'json' | 'yaml'): void;
9
10
  //# sourceMappingURL=download.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/libs/download.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB;QADgB,MAAM;eAAa,MAAM;OACN,CAAA;AAEhE;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,QAkClE"}
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/libs/download.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB;QADgB,MAAM;eAAa,MAAM;aAAW,MAAM,GAAG,MAAM;OAChC,CAAA;AAsChE;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,QAsB5F"}
@@ -1,19 +1,31 @@
1
- import { isJsonString as d } from "@scalar/oas-utils/helpers";
2
- import { useEventBus as m } from "@vueuse/core";
3
- const r = Symbol("download"), p = m(r);
4
- function b(e, n) {
5
- const t = d(e), c = t ? new Blob([e], { type: "application/json" }) : new Blob([e], { type: "application/x-yaml" }), s = URL.createObjectURL(c), a = t ? ".json" : ".yaml", l = "openapi" + a, i = n ? n + a : l, o = document.createElement("a");
6
- o.href = s, o.download = i, o.dispatchEvent(
7
- new MouseEvent("click", {
1
+ import { isDefined as b, isJsonString as r } from "@scalar/oas-utils/helpers";
2
+ import { useEventBus as p } from "@vueuse/core";
3
+ import { toJson as w, normalize as a, toYaml as f } from "@scalar/openapi-parser";
4
+ const v = Symbol("download"), L = p(v);
5
+ function E(e, n) {
6
+ return n && !r(e) ? w(a(e)) : !n && r(e) ? f(a(e)) : e;
7
+ }
8
+ function y() {
9
+ try {
10
+ return new MouseEvent("click", {
8
11
  bubbles: !0,
9
12
  cancelable: !0,
10
13
  view: window
11
- })
12
- ), setTimeout(() => {
14
+ });
15
+ } catch {
16
+ return new MouseEvent("click", {
17
+ bubbles: !0,
18
+ cancelable: !0
19
+ });
20
+ }
21
+ }
22
+ function R(e, n, c) {
23
+ const t = c === "json" || !b(c) && r(e), l = E(e, t), i = t ? ".json" : ".yaml", u = t ? "application/json" : "application/x-yaml", m = n ? n + i : "openapi" + i, d = new Blob([l], { type: u }), s = URL.createObjectURL(d), o = document.createElement("a");
24
+ o.href = s, o.download = m, o.dispatchEvent(y()), setTimeout(() => {
13
25
  window.URL.revokeObjectURL(s), o.remove();
14
26
  }, 100);
15
27
  }
16
28
  export {
17
- b as downloadDocument,
18
- p as downloadEventBus
29
+ R as downloadDocument,
30
+ L as downloadEventBus
19
31
  };
@@ -1,11 +1,11 @@
1
- import { REFERENCE_LS_KEYS as E } from "../helpers/local-storage.js";
2
- import { objectMerge as p } from "@scalar/oas-utils/helpers";
3
- import { snippetz as m } from "@scalar/snippetz";
4
- import { computed as o, readonly as a, ref as C, reactive as k } from "vue";
1
+ import { safeLocalStorage as E, REFERENCE_LS_KEYS as m } from "@scalar/helpers/object/local-storage";
2
+ import { objectReplace as p } from "@scalar/helpers/object/object-replace";
3
+ import { snippetz as k } from "@scalar/snippetz";
4
+ import { computed as o, readonly as a, ref as C, reactive as A } from "vue";
5
5
  const y = {
6
6
  targetKey: "shell",
7
7
  clientKey: "curl"
8
- }, { clients: A } = m();
8
+ }, { clients: H } = k();
9
9
  function d(t) {
10
10
  var n;
11
11
  return ((n = r.value.find((e) => e.key === t.targetKey)) == null ? void 0 : n.title) ?? t.targetKey;
@@ -14,8 +14,8 @@ function K(t) {
14
14
  var n, e;
15
15
  return ((e = (n = r.value.find((i) => i.key === t.targetKey)) == null ? void 0 : n.clients.find((i) => i.client === t.clientKey)) == null ? void 0 : e.title) ?? t.clientKey;
16
16
  }
17
- const H = o(() => d(l)), S = o(() => K(l));
18
- function L(t, n) {
17
+ const L = o(() => d(l)), S = o(() => K(l));
18
+ function b(t, n) {
19
19
  return n.value === !0 ? [] : t.flatMap((e) => {
20
20
  var i;
21
21
  return typeof n.value != "object" ? [] : Array.isArray(n.value) ? (e.clients = e.clients.filter(
@@ -25,8 +25,8 @@ function L(t, n) {
25
25
  n.value[e.key].includes(s.client))), (i = e == null ? void 0 : e.clients) != null && i.length ? [e] : []);
26
26
  });
27
27
  }
28
- const r = o(() => L(A(), c)), c = C({}), f = C();
29
- function b(t) {
28
+ const r = o(() => b(H(), c)), c = C({}), f = C();
29
+ function _(t) {
30
30
  t !== void 0 && (f.value = t, T(u()));
31
31
  }
32
32
  const u = () => {
@@ -41,19 +41,19 @@ function v(t) {
41
41
  (n) => n.key === t.targetKey && n.clients.find((e) => e.client === t.clientKey)
42
42
  );
43
43
  }
44
- function _() {
44
+ function h() {
45
45
  p(l, u());
46
46
  }
47
- const l = k(u()), T = (t) => {
47
+ const l = A(u()), T = (t) => {
48
48
  Object.assign(l, {
49
49
  ...l,
50
50
  ...t
51
- }), localStorage.setItem(E.SELECTED_CLIENT, JSON.stringify(l));
52
- }, D = () => ({
51
+ }), E().setItem(m.SELECTED_CLIENT, JSON.stringify(l));
52
+ }, R = () => ({
53
53
  httpClient: a(l),
54
- resetState: _,
54
+ resetState: h,
55
55
  setHttpClient: T,
56
- setDefaultHttpClient: b,
56
+ setDefaultHttpClient: _,
57
57
  excludedClients: a(c),
58
58
  setExcludedClients: (t) => {
59
59
  c.value = t, p(l, u());
@@ -61,10 +61,10 @@ const l = k(u()), T = (t) => {
61
61
  availableTargets: r,
62
62
  getClientTitle: K,
63
63
  getTargetTitle: d,
64
- httpTargetTitle: H,
64
+ httpTargetTitle: L,
65
65
  httpClientTitle: S
66
66
  });
67
67
  export {
68
- L as filterHiddenClients,
69
- D as useHttpClientStore
68
+ b as filterHiddenClients,
69
+ R as useHttpClientStore
70
70
  };