@scalar/api-reference 1.31.3 → 1.31.6

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 (166) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/browser/standalone.js +15752 -15637
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.js +6 -6
  5. package/dist/components/ApiReferenceLayout.vue.d.ts +6 -3
  6. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  7. package/dist/components/ApiReferenceLayout.vue.js +4 -2
  8. package/dist/components/ApiReferenceLayout.vue2.js +230 -153
  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 +81 -101
  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.js +13 -21
  24. package/dist/components/Content/Tag/OperationsList.vue.d.ts.map +1 -1
  25. package/dist/components/Content/Tag/OperationsList.vue.js +1 -1
  26. package/dist/components/Content/Tag/OperationsList.vue2.js +10 -9
  27. package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
  28. package/dist/components/Content/Tag/OperationsListItem.vue.js +1 -1
  29. package/dist/components/Content/Tag/OperationsListItem.vue2.js +29 -28
  30. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  31. package/dist/components/Content/Tag/TagList.vue.js +35 -34
  32. package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts.map +1 -1
  33. package/dist/components/DocumentSelector/DocumentSelector.vue.js +21 -28
  34. package/dist/components/GettingStarted.vue.d.ts.map +1 -1
  35. package/dist/components/GettingStarted.vue.js +3 -3
  36. package/dist/components/GettingStarted.vue2.js +23 -23
  37. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +1 -20
  38. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  39. package/dist/components/HttpMethod/HttpMethod.vue.js +12 -13
  40. package/dist/components/Section/CompactSection.vue.js +2 -2
  41. package/dist/components/Section/CompactSection.vue2.js +6 -6
  42. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  43. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  44. package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
  45. package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
  46. package/dist/components/Sidebar/SidebarElement.vue2.js +5 -5
  47. package/dist/esm.d.ts.map +1 -1
  48. package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +1 -1
  49. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +1 -1
  50. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -1
  51. package/dist/features/DocumentSource/hooks/useDocumentSource.js +11 -11
  52. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
  53. package/dist/features/DownloadLink/DownloadLink.vue.js +2 -2
  54. package/dist/features/DownloadLink/DownloadLink.vue2.js +21 -21
  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/Search/SearchButton.vue.d.ts.map +1 -1
  59. package/dist/features/Search/SearchButton.vue.js +2 -2
  60. package/dist/features/Search/SearchButton.vue2.js +16 -16
  61. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  62. package/dist/features/Search/SearchModal.vue.js +2 -2
  63. package/dist/features/Search/SearchModal.vue2.js +1 -1
  64. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  65. package/dist/features/Search/useSearchIndex.js +29 -28
  66. package/dist/features/sidebar/helpers/create-sidebar.d.ts +26 -0
  67. package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +1 -0
  68. package/dist/features/sidebar/hooks/useSidebar.d.ts +23 -0
  69. package/dist/features/sidebar/hooks/useSidebar.d.ts.map +1 -0
  70. package/dist/features/sidebar/index.d.ts +2 -0
  71. package/dist/features/sidebar/index.d.ts.map +1 -0
  72. package/dist/features/traverse-schema/helpers/get-tag.d.ts +4 -0
  73. package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +1 -0
  74. package/dist/features/traverse-schema/helpers/operation-id-params.d.ts +8 -0
  75. package/dist/features/traverse-schema/helpers/operation-id-params.d.ts.map +1 -0
  76. package/dist/features/traverse-schema/helpers/operation-id-params.js +8 -0
  77. package/dist/features/traverse-schema/helpers/traverse-description.d.ts +9 -0
  78. package/dist/features/traverse-schema/helpers/traverse-description.d.ts.map +1 -0
  79. package/dist/features/traverse-schema/helpers/traverse-document.d.ts +16 -0
  80. package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +1 -0
  81. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +11 -0
  82. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -0
  83. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +6 -0
  84. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -0
  85. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +9 -0
  86. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +1 -0
  87. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +6 -0
  88. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +1 -0
  89. package/dist/features/traverse-schema/index.d.ts +4 -0
  90. package/dist/features/traverse-schema/index.d.ts.map +1 -0
  91. package/dist/features/traverse-schema/types.d.ts +51 -0
  92. package/dist/features/traverse-schema/types.d.ts.map +1 -0
  93. package/dist/helpers/parse.d.ts.map +1 -1
  94. package/dist/helpers/parse.js +16 -16
  95. package/dist/hooks/useNavState.d.ts +9 -4
  96. package/dist/hooks/useNavState.d.ts.map +1 -1
  97. package/dist/hooks/useNavState.js +31 -29
  98. package/dist/hooks/useSidebar.d.ts.map +1 -1
  99. package/dist/hooks/useSidebar.js +69 -68
  100. package/dist/index.d.ts +0 -3
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/index.js +37 -44
  103. package/dist/legacy/fixtures/httpRequestMethods.js +2 -6
  104. package/dist/libs/openapi.js +32 -32
  105. package/dist/stores/useHttpClientStore.js +9 -8
  106. package/dist/style.css +1 -1
  107. package/dist/types.d.ts +0 -1
  108. package/dist/types.d.ts.map +1 -1
  109. package/dist/v2/ApiReferenceWorkspace.vue.d.ts +40 -0
  110. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -0
  111. package/dist/v2/ApiReferenceWorkspace.vue.js +65 -0
  112. package/dist/v2/ApiReferenceWorkspace.vue3.js +5 -0
  113. package/dist/v2/events/definitions.d.ts +35 -0
  114. package/dist/v2/events/definitions.d.ts.map +1 -0
  115. package/dist/v2/events/index.d.ts +3 -0
  116. package/dist/v2/events/index.d.ts.map +1 -0
  117. package/dist/v2/events/listeners.d.ts +8 -0
  118. package/dist/v2/events/listeners.d.ts.map +1 -0
  119. package/dist/v2/events/listeners.js +15 -0
  120. package/dist/v2/styles.d.ts +2 -0
  121. package/dist/v2/styles.d.ts.map +1 -0
  122. package/package.json +13 -11
  123. package/dist/components/HttpMethod/constants.d.ts +0 -9
  124. package/dist/components/HttpMethod/constants.d.ts.map +0 -1
  125. package/dist/components/HttpMethod/constants.js +0 -36
  126. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts +0 -4
  127. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts.map +0 -1
  128. package/dist/components/HttpMethod/utils/isRequestMethod.js +0 -7
  129. package/dist/components/Layouts/ClassicLayout.vue.d.ts +0 -23
  130. package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +0 -1
  131. package/dist/components/Layouts/ClassicLayout.vue.js +0 -67
  132. package/dist/components/Layouts/ClassicLayout.vue2.js +0 -4
  133. package/dist/components/Layouts/Layouts.vue.d.ts +0 -26
  134. package/dist/components/Layouts/Layouts.vue.d.ts.map +0 -1
  135. package/dist/components/Layouts/Layouts.vue.js +0 -35
  136. package/dist/components/Layouts/Layouts.vue2.js +0 -4
  137. package/dist/components/Layouts/ModernLayout.vue.d.ts +0 -23
  138. package/dist/components/Layouts/ModernLayout.vue.d.ts.map +0 -1
  139. package/dist/components/Layouts/ModernLayout.vue.js +0 -8
  140. package/dist/components/Layouts/ModernLayout.vue2.js +0 -102
  141. package/dist/components/Layouts/index.d.ts +0 -2
  142. package/dist/components/Layouts/index.d.ts.map +0 -1
  143. package/dist/components/SingleApiReference.vue.d.ts +0 -29
  144. package/dist/components/SingleApiReference.vue.d.ts.map +0 -1
  145. package/dist/components/SingleApiReference.vue.js +0 -57
  146. package/dist/components/SingleApiReference.vue3.js +0 -5
  147. package/dist/helpers/freeze-element.d.ts +0 -11
  148. package/dist/helpers/freeze-element.d.ts.map +0 -1
  149. package/dist/helpers/freeze-element.js +0 -20
  150. package/dist/helpers/is-mac-os.d.ts +0 -5
  151. package/dist/helpers/is-mac-os.d.ts.map +0 -1
  152. package/dist/helpers/is-mac-os.js +0 -4
  153. package/dist/helpers/measure.d.ts +0 -21
  154. package/dist/helpers/measure.d.ts.map +0 -1
  155. package/dist/helpers/measure.js +0 -7
  156. package/dist/helpers/scroll-to-id.d.ts +0 -7
  157. package/dist/helpers/scroll-to-id.d.ts.map +0 -1
  158. package/dist/helpers/scroll-to-id.js +0 -21
  159. package/dist/helpers/sleep.d.ts +0 -6
  160. package/dist/helpers/sleep.d.ts.map +0 -1
  161. package/dist/helpers/sleep.js +0 -4
  162. package/dist/legacy/helpers/index.d.ts +0 -2
  163. package/dist/legacy/helpers/index.d.ts.map +0 -1
  164. package/dist/legacy/helpers/normalizeRequestMethod.d.ts +0 -6
  165. package/dist/legacy/helpers/normalizeRequestMethod.d.ts.map +0 -1
  166. 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,28 +1,28 @@
1
1
  import { XScalarStability as o } from "@scalar/types/legacy";
2
- function l(e, r) {
2
+ function l(e, t) {
3
3
  var n;
4
- let t = e;
5
- const i = (n = r.required) == null ? void 0 : n.includes(e);
6
- return t += i ? " REQUIRED " : " optional ", r.properties[e] && (t += r.properties[e].type, r.properties[e].description && (t += " " + r.properties[e].description)), t;
4
+ let r = e;
5
+ const i = (n = t.required) == null ? void 0 : n.includes(e);
6
+ return r += i ? " REQUIRED " : " optional ", t.properties[e] && (r += t.properties[e].type, t.properties[e].description && (r += " " + t.properties[e].description)), r;
7
7
  }
8
8
  function p(e) {
9
9
  var i;
10
- const r = ["Body"], t = (i = e == null ? void 0 : e.schema) == null ? void 0 : i.properties;
11
- return t && Object.keys(t).forEach((n) => {
10
+ const t = ["Body"], r = (i = e == null ? void 0 : e.schema) == null ? void 0 : i.properties;
11
+ return r && Object.keys(r).forEach((n) => {
12
12
  if (!e.schema)
13
13
  return;
14
- r.push(l(n, e.schema));
15
- const s = t[n];
14
+ t.push(l(n, e.schema));
15
+ const s = r[n];
16
16
  s.type === "object" && !!s.properties && s.properties && Object.keys(s.properties).forEach((c) => {
17
17
  var u, f;
18
- r.push(`${c} ${(f = (u = s.properties) == null ? void 0 : u[c]) == null ? void 0 : f.type}`);
18
+ t.push(`${c} ${(f = (u = s.properties) == null ? void 0 : u[c]) == null ? void 0 : f.type}`);
19
19
  });
20
- }), r;
20
+ }), t;
21
21
  }
22
22
  function O(e) {
23
- var r, t, i;
23
+ var t, r, i;
24
24
  try {
25
- const n = (i = (t = (r = e == null ? void 0 : e.information) == null ? void 0 : r.requestBody) == null ? void 0 : t.content) == null ? void 0 : i["application/json"];
25
+ const n = (i = (r = (t = e == null ? void 0 : e.information) == null ? void 0 : t.requestBody) == null ? void 0 : r.content) == null ? void 0 : i["application/json"];
26
26
  if (!n)
27
27
  throw new Error("Body not found");
28
28
  return p(n);
@@ -31,28 +31,28 @@ function O(e) {
31
31
  }
32
32
  }
33
33
  function d(e) {
34
- var t, i;
34
+ var r, i;
35
35
  if (!e)
36
36
  return {};
37
- const r = (
37
+ const t = (
38
38
  // OpenAPI 3.x
39
- Object.keys(((t = e == null ? void 0 : e.components) == null ? void 0 : t.schemas) ?? {}).length ? (i = e == null ? void 0 : e.components) == null ? void 0 : i.schemas : (
39
+ Object.keys(((r = e == null ? void 0 : e.components) == null ? void 0 : r.schemas) ?? {}).length ? (i = e == null ? void 0 : e.components) == null ? void 0 : i.schemas : (
40
40
  // Fallback
41
41
  {}
42
42
  )
43
43
  );
44
- return Object.keys(r ?? {}).forEach((n) => {
44
+ return Object.keys(t ?? {}).forEach((n) => {
45
45
  var s;
46
- ((s = r[n]) == null ? void 0 : s["x-internal"]) === !0 && delete r[n];
47
- }), r;
46
+ ((s = t[n]) == null ? void 0 : s["x-internal"]) === !0 && delete t[n];
47
+ }), t;
48
48
  }
49
49
  const b = (e) => e ? !!Object.keys(d(e) ?? {}).length : !1, x = (e) => e ? !!Object.keys((e == null ? void 0 : e.webhooks) ?? {}).length : !1;
50
- function a(e, r) {
51
- for (const [t, i] of Object.entries(e))
52
- i !== null && typeof i == "object" ? (r[t] ?? (r[t] = new i.__proto__.constructor()), a(i, r[t])) : typeof i < "u" && (r[t] = i);
53
- return r;
50
+ function a(e, t) {
51
+ for (const [r, i] of Object.entries(e))
52
+ i !== null && typeof i == "object" ? (t[r] ??= new i.__proto__.constructor(), a(i, t[r])) : typeof i < "u" && (t[r] = i);
53
+ return t;
54
54
  }
55
- function E(e) {
55
+ function g(e) {
56
56
  return a(e ?? {}, {
57
57
  info: {
58
58
  title: "",
@@ -71,25 +71,25 @@ function E(e) {
71
71
  tags: []
72
72
  });
73
73
  }
74
- function S(e) {
74
+ function E(e) {
75
75
  return e.deprecated !== void 0 ? e.deprecated : !!(e["x-scalar-stability"] && e["x-scalar-stability"] === o.Deprecated);
76
76
  }
77
- function h(e) {
77
+ function y(e) {
78
78
  return e.deprecated ? o.Deprecated : e["x-scalar-stability"];
79
79
  }
80
- function v(e) {
81
- const r = h(e);
82
- return r === o.Deprecated ? "text-red" : r === o.Experimental ? "text-orange" : r === o.Stable ? "text-green" : "";
80
+ function S(e) {
81
+ const t = y(e);
82
+ return t === o.Deprecated ? "text-red" : t === o.Experimental ? "text-orange" : t === o.Stable ? "text-green" : "";
83
83
  }
84
84
  export {
85
- E as createEmptySpecification,
85
+ g as createEmptySpecification,
86
86
  a as deepMerge,
87
87
  O as extractRequestBody,
88
88
  l as formatProperty,
89
89
  d as getModels,
90
- h as getOperationStability,
91
- v as getOperationStabilityColor,
90
+ y as getOperationStability,
91
+ S as getOperationStabilityColor,
92
92
  b as hasModels,
93
93
  x as hasWebhooks,
94
- S as isOperationDeprecated
94
+ E as isOperationDeprecated
95
95
  };
@@ -1,6 +1,7 @@
1
- import { objectMerge as C, safeLocalStorage as E, REFERENCE_LS_KEYS as m } from "@scalar/oas-utils/helpers";
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";
2
3
  import { snippetz as k } from "@scalar/snippetz";
3
- import { computed as o, readonly as a, ref as p, reactive as A } from "vue";
4
+ import { computed as o, readonly as a, ref as C, reactive as A } from "vue";
4
5
  const y = {
5
6
  targetKey: "shell",
6
7
  clientKey: "curl"
@@ -24,7 +25,7 @@ function b(t, n) {
24
25
  n.value[e.key].includes(s.client))), (i = e == null ? void 0 : e.clients) != null && i.length ? [e] : []);
25
26
  });
26
27
  }
27
- const r = o(() => b(H(), c)), c = p({}), f = p();
28
+ const r = o(() => b(H(), c)), c = C({}), f = C();
28
29
  function _(t) {
29
30
  t !== void 0 && (f.value = t, T(u()));
30
31
  }
@@ -41,21 +42,21 @@ function v(t) {
41
42
  );
42
43
  }
43
44
  function h() {
44
- C(l, u());
45
+ p(l, u());
45
46
  }
46
47
  const l = A(u()), T = (t) => {
47
48
  Object.assign(l, {
48
49
  ...l,
49
50
  ...t
50
- }), E.setItem(m.SELECTED_CLIENT, JSON.stringify(l));
51
- }, D = () => ({
51
+ }), E().setItem(m.SELECTED_CLIENT, JSON.stringify(l));
52
+ }, R = () => ({
52
53
  httpClient: a(l),
53
54
  resetState: h,
54
55
  setHttpClient: T,
55
56
  setDefaultHttpClient: _,
56
57
  excludedClients: a(c),
57
58
  setExcludedClients: (t) => {
58
- c.value = t, C(l, u());
59
+ c.value = t, p(l, u());
59
60
  },
60
61
  availableTargets: r,
61
62
  getClientTitle: K,
@@ -65,5 +66,5 @@ const l = A(u()), T = (t) => {
65
66
  });
66
67
  export {
67
68
  b as filterHiddenClients,
68
- D as useHttpClientStore
69
+ R as useHttpClientStore
69
70
  };