@scalar/api-reference 1.28.32 → 1.28.34

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 (209) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/browser/standalone.js +7541 -7368
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
  5. package/dist/components/Anchor/Anchor.vue.js +2 -2
  6. package/dist/components/Anchor/Anchor.vue2.js +24 -22
  7. package/dist/components/ApiReferenceLayout.vue.d.ts +2 -2
  8. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  9. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  10. package/dist/components/ApiReferenceLayout.vue2.js +50 -50
  11. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  12. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
  13. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +5 -5
  14. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
  15. package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +2 -2
  16. package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.d.ts +1 -1
  17. package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.d.ts.map +1 -1
  18. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  19. package/dist/components/Content/Content.vue.js +2 -2
  20. package/dist/components/Content/Content.vue2.js +56 -56
  21. package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
  22. package/dist/components/Content/Introduction/Introduction.vue2.js +21 -21
  23. package/dist/components/Content/Lazy/Loading.vue.js +22 -22
  24. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  25. package/dist/components/Content/Models/Models.vue.js +2 -2
  26. package/dist/components/Content/Models/Models.vue2.js +17 -17
  27. package/dist/components/Content/Models/ModelsAccordion.vue.d.ts.map +1 -1
  28. package/dist/components/Content/Models/ModelsAccordion.vue.js +2 -2
  29. package/dist/components/Content/Models/ModelsAccordion.vue2.js +14 -14
  30. package/dist/components/Content/Schema/Schema.preview.d.ts +98 -15
  31. package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
  32. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  33. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  34. package/dist/components/Content/Schema/Schema.vue2.js +2 -1
  35. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
  36. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +99 -5
  37. package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +2 -165
  38. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  39. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  40. package/dist/components/Content/Schema/SchemaProperty.vue2.js +27 -26
  41. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  42. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  43. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +142 -138
  44. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +1 -1
  45. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
  46. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +50 -40
  47. package/dist/components/Content/Tag/OperationsListItem.vue.js +1 -1
  48. package/dist/components/Content/Tag/OperationsListItem.vue2.js +1 -1
  49. package/dist/components/Content/Tag/TagAccordion.vue.js +2 -2
  50. package/dist/components/Content/Tag/TagAccordion.vue2.js +10 -10
  51. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  52. package/dist/components/Content/Tag/TagList.vue.js +8 -8
  53. package/dist/components/Content/Tag/TagSection.vue.d.ts.map +1 -1
  54. package/dist/components/Content/Tag/TagSection.vue.js +2 -2
  55. package/dist/components/Content/Tag/TagSection.vue2.js +8 -8
  56. package/dist/components/GettingStarted.vue.d.ts +2 -2
  57. package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
  58. package/dist/components/Layouts/ModernLayout.vue.js +2 -2
  59. package/dist/components/Layouts/ModernLayout.vue2.js +4 -4
  60. package/dist/components/MobileHeader.vue.js +3 -3
  61. package/dist/components/Section/CompactSection.vue.js +2 -2
  62. package/dist/components/Section/CompactSection.vue2.js +4 -4
  63. package/dist/components/Section/Section.vue.d.ts.map +1 -1
  64. package/dist/components/Section/Section.vue.js +1 -1
  65. package/dist/components/Section/SectionHeader.vue.js +2 -2
  66. package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
  67. package/dist/components/ShowMoreButton.vue.js +2 -2
  68. package/dist/components/Sidebar/Sidebar.vue.d.ts +1 -1
  69. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  70. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  71. package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
  72. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  73. package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
  74. package/dist/components/Sidebar/SidebarElement.vue2.js +6 -6
  75. package/dist/components/SingleApiReference.vue.d.ts.map +1 -1
  76. package/dist/components/SpecificationExtension/SpecificationExtension.vue.d.ts.map +1 -1
  77. package/dist/components/SpecificationExtension/SpecificationExtension.vue.js +30 -21
  78. package/dist/features/ApiClientModal/ApiClientModal.vue.js +3 -3
  79. package/dist/features/ApiClientModal/index.d.ts +1 -1
  80. package/dist/features/ApiClientModal/index.d.ts.map +1 -1
  81. package/dist/features/ApiClientModal/useApiClient.d.ts +170 -90
  82. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  83. package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
  84. package/dist/features/BaseUrl/BaseUrl.vue.js +33 -28
  85. package/dist/features/DownloadLink/DownloadLink.vue.d.ts +1 -1
  86. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
  87. package/dist/features/DownloadLink/DownloadLink.vue.js +1 -1
  88. package/dist/features/DownloadLink/DownloadLink.vue2.js +17 -17
  89. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  90. package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
  91. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +12 -12
  92. package/dist/features/Operation/Webhooks.vue.d.ts.map +1 -1
  93. package/dist/features/Operation/Webhooks.vue.js +2 -2
  94. package/dist/features/Operation/Webhooks.vue2.js +13 -13
  95. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  96. package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
  97. package/dist/features/Operation/components/ParameterListItem.vue2.js +18 -18
  98. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  99. package/dist/features/Operation/components/RequestBody.vue.js +2 -2
  100. package/dist/features/Operation/components/RequestBody.vue2.js +38 -32
  101. package/dist/features/Operation/hooks/useResponses.d.ts +1 -0
  102. package/dist/features/Operation/hooks/useResponses.d.ts.map +1 -1
  103. package/dist/features/Operation/hooks/useResponses.js +13 -12
  104. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  105. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  106. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +1 -1
  107. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  108. package/dist/features/Operation/layouts/ModernLayout.vue2.js +1 -1
  109. package/dist/features/Search/SearchButton.vue.js +2 -2
  110. package/dist/features/Search/SearchButton.vue2.js +1 -1
  111. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  112. package/dist/features/Search/SearchModal.vue.js +2 -2
  113. package/dist/features/Search/SearchModal.vue2.js +1 -1
  114. package/dist/features/Search/useSearchIndex.d.ts +1 -1
  115. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  116. package/dist/features/Search/useSearchIndex.js +20 -21
  117. package/dist/helpers/{isMacOs.d.ts → is-mac-os.d.ts} +1 -1
  118. package/dist/helpers/is-mac-os.d.ts.map +1 -0
  119. package/dist/helpers/parse.d.ts.map +1 -1
  120. package/dist/helpers/parse.js +1 -1
  121. package/dist/helpers/{scrollToId.d.ts → scroll-to-id.d.ts} +1 -1
  122. package/dist/helpers/scroll-to-id.d.ts.map +1 -0
  123. package/dist/helpers/sleep.d.ts +0 -2
  124. package/dist/helpers/sleep.d.ts.map +1 -1
  125. package/dist/hooks/useNavState.d.ts.map +1 -1
  126. package/dist/hooks/useNavState.js +28 -28
  127. package/dist/hooks/useReactiveSpec.js +1 -1
  128. package/dist/hooks/useSidebar.d.ts.map +1 -1
  129. package/dist/hooks/useSidebar.js +45 -49
  130. package/dist/index.d.ts +2 -3
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +26 -28
  133. package/dist/legacy/fixtures/index.d.ts +1 -1
  134. package/dist/legacy/fixtures/index.d.ts.map +1 -1
  135. package/dist/legacy/helpers/index.d.ts +1 -1
  136. package/dist/legacy/helpers/index.d.ts.map +1 -1
  137. package/dist/libs/download.d.ts +9 -0
  138. package/dist/libs/download.d.ts.map +1 -0
  139. package/dist/libs/download.js +19 -0
  140. package/dist/{helpers/getLowestHeadingLevel.d.ts → libs/markdown.d.ts} +5 -1
  141. package/dist/libs/markdown.d.ts.map +1 -0
  142. package/dist/libs/markdown.js +18 -0
  143. package/dist/libs/openapi.d.ts +56 -0
  144. package/dist/libs/openapi.d.ts.map +1 -0
  145. package/dist/libs/openapi.js +102 -0
  146. package/dist/style.css +1 -1
  147. package/dist/types.d.ts +1 -45
  148. package/dist/types.d.ts.map +1 -1
  149. package/package.json +21 -21
  150. package/dist/esm.js +0 -34
  151. package/dist/helpers/createEmptySpecification.d.ts +0 -8
  152. package/dist/helpers/createEmptySpecification.d.ts.map +0 -1
  153. package/dist/helpers/createEmptySpecification.js +0 -27
  154. package/dist/helpers/deepMerge.d.ts +0 -5
  155. package/dist/helpers/deepMerge.d.ts.map +0 -1
  156. package/dist/helpers/deepMerge.js +0 -8
  157. package/dist/helpers/generateParameters.d.ts +0 -6
  158. package/dist/helpers/generateParameters.d.ts.map +0 -1
  159. package/dist/helpers/get-request.d.ts +0 -59
  160. package/dist/helpers/get-request.d.ts.map +0 -1
  161. package/dist/helpers/getHeadingsFromMarkdown.d.ts +0 -6
  162. package/dist/helpers/getHeadingsFromMarkdown.d.ts.map +0 -1
  163. package/dist/helpers/getHeadingsFromMarkdown.js +0 -13
  164. package/dist/helpers/getLowestHeadingLevel.d.ts.map +0 -1
  165. package/dist/helpers/getLowestHeadingLevel.js +0 -7
  166. package/dist/helpers/getModels.d.ts +0 -7
  167. package/dist/helpers/getModels.d.ts.map +0 -1
  168. package/dist/helpers/getModels.js +0 -22
  169. package/dist/helpers/getVariableNames.d.ts +0 -5
  170. package/dist/helpers/getVariableNames.d.ts.map +0 -1
  171. package/dist/helpers/hasModels.d.ts +0 -3
  172. package/dist/helpers/hasModels.d.ts.map +0 -1
  173. package/dist/helpers/hasModels.js +0 -5
  174. package/dist/helpers/hasSecuritySchemes.d.ts +0 -3
  175. package/dist/helpers/hasSecuritySchemes.d.ts.map +0 -1
  176. package/dist/helpers/hasWebhooks.d.ts +0 -3
  177. package/dist/helpers/hasWebhooks.d.ts.map +0 -1
  178. package/dist/helpers/hasWebhooks.js +0 -4
  179. package/dist/helpers/index.d.ts +0 -17
  180. package/dist/helpers/index.d.ts.map +0 -1
  181. package/dist/helpers/isMacOs.d.ts.map +0 -1
  182. package/dist/helpers/mapFromObject.d.ts +0 -8
  183. package/dist/helpers/mapFromObject.d.ts.map +0 -1
  184. package/dist/helpers/mergeAllObjects.d.ts +0 -5
  185. package/dist/helpers/mergeAllObjects.d.ts.map +0 -1
  186. package/dist/helpers/scrollToId.d.ts.map +0 -1
  187. package/dist/helpers/specDownloads.d.ts +0 -7
  188. package/dist/helpers/specDownloads.d.ts.map +0 -1
  189. package/dist/helpers/specDownloads.js +0 -19
  190. package/dist/helpers/specHelpers.d.ts +0 -16
  191. package/dist/helpers/specHelpers.d.ts.map +0 -1
  192. package/dist/helpers/specHelpers.js +0 -36
  193. package/dist/helpers/waitFor.d.ts +0 -5
  194. package/dist/helpers/waitFor.d.ts.map +0 -1
  195. package/dist/hooks/index.d.ts +0 -5
  196. package/dist/hooks/index.d.ts.map +0 -1
  197. package/dist/legacy/helpers/encodeStringAsBase64.d.ts +0 -5
  198. package/dist/legacy/helpers/encodeStringAsBase64.d.ts.map +0 -1
  199. package/dist/legacy/index.d.ts +0 -5
  200. package/dist/legacy/index.d.ts.map +0 -1
  201. package/dist/legacy/types.d.ts +0 -94
  202. package/dist/legacy/types.d.ts.map +0 -1
  203. package/dist/libs/operation.d.ts +0 -15
  204. package/dist/libs/operation.d.ts.map +0 -1
  205. package/dist/libs/operation.js +0 -16
  206. package/dist/stores/index.d.ts +0 -2
  207. package/dist/stores/index.d.ts.map +0 -1
  208. /package/dist/helpers/{isMacOs.js → is-mac-os.js} +0 -0
  209. /package/dist/helpers/{scrollToId.js → scroll-to-id.js} +0 -0
@@ -1,60 +1,60 @@
1
1
  import { useConfig as b } from "./useConfig.js";
2
- import { combineUrlAndPath as R } from "@scalar/oas-utils/helpers";
2
+ import { combineUrlAndPath as d } from "@scalar/oas-utils/helpers";
3
3
  import { slug as i } from "github-slugger";
4
4
  import { inject as y, ref as l } from "vue";
5
- const U = Symbol(), P = l(!1), k = l(""), x = l(""), T = (d) => {
6
- const { isIntersectionEnabled: f, hash: o, hashPrefix: r } = y(U, {
7
- isIntersectionEnabled: P,
5
+ const P = Symbol(), U = l(!1), k = l(""), x = l(""), T = (f) => {
6
+ const { isIntersectionEnabled: p, hash: r, hashPrefix: u } = y(P, {
7
+ isIntersectionEnabled: U,
8
8
  hash: k,
9
9
  hashPrefix: x
10
- }), t = d ?? b(), c = (e) => {
10
+ }), t = f ?? b(), g = (e) => {
11
11
  var n;
12
12
  if (!t.value.pathRouting)
13
13
  return "";
14
14
  const a = new RegExp("^" + ((n = t.value.pathRouting) == null ? void 0 : n.basePath) + "/?");
15
15
  return decodeURIComponent(e.replace(a, ""));
16
- }, p = (e = o.value) => {
16
+ }, v = (e = r.value) => {
17
17
  var h;
18
- const a = (h = e.match(/(tag\/[^/]+)/)) == null ? void 0 : h[0], n = e.startsWith("model") ? "models" : "", u = e.startsWith("webhook") ? "webhooks" : "";
19
- return a || n || u;
20
- }, g = () => t.value.pathRouting ? c(window.location.pathname) : (
18
+ const a = (h = e.match(/(tag\/[^/]+)/)) == null ? void 0 : h[0], n = e.startsWith("model") ? "models" : "", o = e.startsWith("webhook") ? "webhooks" : "";
19
+ return a || n || o;
20
+ }, c = () => t.value.pathRouting ? g(window.location.pathname) : (
21
21
  // Must remove the prefix from the hash as the internal hash value should be pure
22
- decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(r.value.length)
23
- ), m = () => o.value = g(), v = (e, a = window.location.href) => {
22
+ decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(u.value.length)
23
+ ), m = () => r.value = c(), I = (e, a = window.location.href) => {
24
24
  const n = new URL(a);
25
- t.value.pathRouting ? n.pathname = R(t.value.pathRouting.basePath, e) : n.hash = r.value + e, o.value = e, window.history.replaceState({}, "", n);
26
- }, I = (e, a = window.location.href, n = window.location.search) => {
27
- const u = new URL(a);
28
- return u.hash = r.value + e, u.search = n, u.toString();
29
- }, w = (e = o.value) => `${r.value}${e}`, S = (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "", $ = (e) => e != null && e.name ? typeof t.value.generateModelSlug == "function" ? `model/${t.value.generateModelSlug(e)}` : `model/${i(e.name)}` : "models", s = (e) => typeof t.value.generateTagSlug == "function" ? `tag/${t.value.generateTagSlug(e)}` : `tag/${i(e.name)}`;
25
+ t.value.pathRouting ? n.pathname = d(t.value.pathRouting.basePath, e) : n.hash = u.value + e, r.value = e, window.history.replaceState({}, "", n);
26
+ }, w = (e, a = window.location.href, n = window.location.search) => {
27
+ const o = new URL(a);
28
+ return t.value.pathRouting ? o.pathname = d(t.value.pathRouting.basePath, e) : o.hash = u.value + e, o.search = n, o.toString();
29
+ }, S = (e = r.value) => `${u.value}${e}`, $ = (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "", R = (e) => e != null && e.name ? typeof t.value.generateModelSlug == "function" ? `model/${t.value.generateModelSlug(e)}` : `model/${i(e.name)}` : "models", s = (e) => typeof t.value.generateTagSlug == "function" ? `tag/${t.value.generateTagSlug(e)}` : `tag/${i(e.name)}`;
30
30
  return {
31
- hash: o,
31
+ hash: r,
32
32
  /** Sets the prefix for the hash */
33
33
  setHashPrefix: (e) => {
34
- r.value = e;
34
+ u.value = e;
35
35
  },
36
36
  /**
37
37
  * Gets the full hash with the prefix
38
38
  * @param hashTarget The hash to target with the return
39
39
  * @returns The full hash
40
40
  */
41
- getFullHash: w,
41
+ getFullHash: S,
42
42
  /**
43
43
  * Gets the hashed url with the prefix
44
44
  * @param replacementHash The hash to replace the current hash with
45
45
  * @param url The url to get the hashed url from
46
46
  * @returns The hashed url
47
47
  */
48
- getHashedUrl: I,
48
+ getHashedUrl: w,
49
49
  /**
50
50
  * Replaces the URL state with the new url and hash
51
51
  * Replacement is used so that hash changes don't trigger the url hash watcher and cause a scroll
52
52
  */
53
- replaceUrlState: v,
54
- getReferenceId: g,
53
+ replaceUrlState: I,
54
+ getReferenceId: c,
55
55
  getWebhookId: (e) => e != null && e.name ? typeof t.value.generateWebhookSlug == "function" ? `webhook/${t.value.generateWebhookSlug(e)}` : `webhook/${e.method}/${i(e.name)}` : "webhooks",
56
- getModelId: $,
57
- getHeadingId: S,
56
+ getModelId: R,
57
+ getHeadingId: $,
58
58
  getOperationId: (e, a) => {
59
59
  var n;
60
60
  return typeof t.value.generateOperationSlug == "function" ? `${s(a)}/${t.value.generateOperationSlug({
@@ -64,14 +64,14 @@ const U = Symbol(), P = l(!1), k = l(""), x = l(""), T = (d) => {
64
64
  summary: (n = e.information) == null ? void 0 : n.summary
65
65
  })}` : `${s(a)}/${e.httpVerb}${e.path}`;
66
66
  },
67
- getPathRoutingId: c,
68
- getSectionId: p,
67
+ getPathRoutingId: g,
68
+ getSectionId: v,
69
69
  getTagId: s,
70
- isIntersectionEnabled: f,
70
+ isIntersectionEnabled: p,
71
71
  updateHash: m
72
72
  };
73
73
  };
74
74
  export {
75
- U as NAV_STATE_SYMBOL,
75
+ P as NAV_STATE_SYMBOL,
76
76
  T as useNavState
77
77
  };
@@ -1,7 +1,7 @@
1
1
  import { fetchDocument as l, prettyPrintJson as d } from "@scalar/oas-utils/helpers";
2
2
  import { ref as s, watch as u, toValue as f } from "vue";
3
3
  import { parse as h } from "../helpers/parse.js";
4
- import { createEmptySpecification as m } from "../helpers/createEmptySpecification.js";
4
+ import { createEmptySpecification as m } from "../libs/openapi.js";
5
5
  const v = async ({ url: a, content: e }, r) => {
6
6
  if (a) {
7
7
  const i = performance.now();
@@ -1 +1 @@
1
- {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAa3E,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,yBAAyB,iBAAiB,CAAA;AAcvD,uDAAuD;AACvD,iBAA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jB,IAAI,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,yBAAyB,iBAAiB,CAAA;AAcvD,uDAAuD;AACvD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QA0ChC;AAMD,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAIpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,iBAAS,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,QAE3D;AAkOD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC,CAAA;IACnD,gBAAgB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,oBAAoB,EAAE,CAAC,EAAE,oBAAoB,KAAK,MAAM,CAAC,CAAA;CACvG,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,gBAAiB,MAAM,UAAU,OAAO,SAiBrE,CAAA;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,YAAY;;;;;;;;;;;;;qCAtBrB,MAAM,UAAU,OAAO;EA8FrE"}
@@ -1,15 +1,11 @@
1
- import { isOperationDeprecated as F } from "../libs/operation.js";
2
- import { ssrState as Y } from "@scalar/oas-utils/helpers";
3
- import { reactive as z, ref as w, watch as U, computed as P } from "vue";
4
- import { lazyBus as Z } from "../components/Content/Lazy/lazyBus.js";
5
- import { useNavState as $ } from "./useNavState.js";
6
- import { getHeadingsFromMarkdown as ee } from "../helpers/getHeadingsFromMarkdown.js";
7
- import { getLowestHeadingLevel as q } from "../helpers/getLowestHeadingLevel.js";
8
- import { scrollToId as _ } from "../helpers/scrollToId.js";
9
- import { hasModels as te } from "../helpers/hasModels.js";
10
- import { getModels as N } from "../helpers/getModels.js";
11
- import { hasWebhooks as se } from "../helpers/hasWebhooks.js";
12
- const re = "introduction", O = w(null), c = w(void 0), g = z({});
1
+ import { lazyBus as Y } from "../components/Content/Lazy/lazyBus.js";
2
+ import { scrollToId as F } from "../helpers/scroll-to-id.js";
3
+ import { useNavState as Z } from "./useNavState.js";
4
+ import { getHeadingsFromMarkdown as $, getLowestHeadingLevel as z } from "../libs/markdown.js";
5
+ import { isOperationDeprecated as U, hasModels as ee, getModels as _, hasWebhooks as te } from "../libs/openapi.js";
6
+ import { ssrState as se } from "@scalar/oas-utils/helpers";
7
+ import { reactive as P, ref as w, watch as N, computed as q } from "vue";
8
+ const re = "introduction", O = w(null), c = w(void 0), g = P({});
13
9
  function R(t) {
14
10
  var p, s, l;
15
11
  g.tagsSorter === "alpha" ? t.tags = (p = t.tags) == null ? void 0 : p.sort((r, n) => r.name.localeCompare(n.name)) : typeof g.tagsSorter == "function" && (t.tags = (s = t.tags) == null ? void 0 : s.sort(g.tagsSorter));
@@ -23,7 +19,7 @@ function R(t) {
23
19
  r.operations = (n = r.operations) == null ? void 0 : n.sort(d);
24
20
  })), c.value = t;
25
21
  }
26
- const J = w(!1), K = w(!1), y = z(Y["useSidebarContent-collapsedSidebarItems"] ?? {});
22
+ const J = w(!1), K = w(!1), y = P(se["useSidebarContent-collapsedSidebarItems"] ?? {});
27
23
  function oe(t) {
28
24
  y[t] = !y[t];
29
25
  }
@@ -32,14 +28,14 @@ function I(t, a) {
32
28
  }
33
29
  const x = w([]);
34
30
  function ae(t) {
35
- const a = ee(t), i = q(a);
31
+ const a = $(t), i = z(a);
36
32
  return a.filter((d) => (
37
33
  // highest level, eg. # Introduction
38
34
  d.depth === i || // second highest level, eg. ## Authentication
39
35
  d.depth === i + 1
40
36
  ));
41
37
  }
42
- const Q = P(() => {
38
+ const Q = q(() => {
43
39
  var M, C, E, B, D, L, j, G, V, W;
44
40
  if (!O.value)
45
41
  return { entries: [], titles: {} };
@@ -47,7 +43,7 @@ const Q = P(() => {
47
43
  let r = null;
48
44
  x.value.forEach((e) => {
49
45
  var o;
50
- e.depth === q(x.value) ? (r = {
46
+ e.depth === z(x.value) ? (r = {
51
47
  id: t(e),
52
48
  title: e.value,
53
49
  show: !0,
@@ -70,13 +66,13 @@ const Q = P(() => {
70
66
  show: !0,
71
67
  children: (o = e.operations) == null ? void 0 : o.map((u) => {
72
68
  var v, b;
73
- const h = i(u, e), f = u.name ?? u.path;
74
- return s[h] = f, {
75
- id: h,
76
- title: f,
69
+ const f = i(u, e), h = u.name ?? u.path;
70
+ return s[f] = h, {
71
+ id: f,
72
+ title: h,
77
73
  httpVerb: u.httpVerb,
78
74
  // TODO: Workaround until we’re using the store directly
79
- deprecated: u.information ? F({
75
+ deprecated: u.information ? U({
80
76
  deprecated: (v = u.information) == null ? void 0 : v.deprecated,
81
77
  "x-scalar-stability": (b = u.information) == null ? void 0 : b["x-scalar-stability"]
82
78
  }) : !1,
@@ -87,52 +83,52 @@ const Q = P(() => {
87
83
  })
88
84
  };
89
85
  }) : (L = n == null ? void 0 : n.operations) == null ? void 0 : L.map((e) => {
90
- var h, f;
86
+ var f, h;
91
87
  const o = i(e, n), u = e.name ?? e.path;
92
88
  return s[o] = u, {
93
89
  id: o,
94
90
  title: u,
95
91
  httpVerb: e.httpVerb,
96
92
  // TODO: Workaround until we’re using the store directly
97
- deprecated: e.information ? F({
98
- deprecated: (h = e.information) == null ? void 0 : h.deprecated,
99
- "x-scalar-stability": (f = e.information) == null ? void 0 : f["x-scalar-stability"]
93
+ deprecated: e.information ? U({
94
+ deprecated: (f = e.information) == null ? void 0 : f.deprecated,
95
+ "x-scalar-stability": (h = e.information) == null ? void 0 : h["x-scalar-stability"]
100
96
  }) : !1,
101
97
  show: !0,
102
98
  select: () => {
103
99
  }
104
100
  };
105
101
  });
106
- let S = te(c.value) && !J.value ? [
102
+ let S = ee(c.value) && !J.value ? [
107
103
  {
108
104
  id: a(),
109
105
  title: "Models",
110
106
  show: !0,
111
- children: Object.keys(N(c.value) ?? {}).map((e) => {
107
+ children: Object.keys(_(c.value) ?? {}).map((e) => {
112
108
  var u;
113
109
  const o = a({ name: e });
114
110
  return s[o] = e, {
115
111
  id: o,
116
- title: ((u = N(c.value)) == null ? void 0 : u[e]).title ?? e,
112
+ title: ((u = _(c.value)) == null ? void 0 : u[e]).title ?? e,
117
113
  show: !0
118
114
  };
119
115
  })
120
116
  }
121
- ] : [], k = se(c.value) ? [
117
+ ] : [], k = te(c.value) ? [
122
118
  {
123
119
  id: p(),
124
120
  title: "Webhooks",
125
121
  show: !0,
126
122
  children: Object.keys(((j = c.value) == null ? void 0 : j.webhooks) ?? {}).flatMap((e) => {
127
- var u, h;
123
+ var u, f;
128
124
  const o = p({ name: e });
129
- return s[o] = e, Object.keys(((h = (u = c.value) == null ? void 0 : u.webhooks) == null ? void 0 : h[e]) ?? {}).map(
130
- (f) => {
125
+ return s[o] = e, Object.keys(((f = (u = c.value) == null ? void 0 : u.webhooks) == null ? void 0 : f[e]) ?? {}).map(
126
+ (h) => {
131
127
  var v, b, A;
132
128
  return {
133
- id: p({ name: e, method: f }),
134
- title: (A = (b = (v = c.value) == null ? void 0 : v.webhooks) == null ? void 0 : b[e][f]) == null ? void 0 : A.name,
135
- httpVerb: f,
129
+ id: p({ name: e, method: h }),
130
+ title: (A = (b = (v = c.value) == null ? void 0 : v.webhooks) == null ? void 0 : b[e][h]) == null ? void 0 : A.name,
131
+ httpVerb: h,
136
132
  show: !0
137
133
  };
138
134
  }
@@ -141,15 +137,15 @@ const Q = P(() => {
141
137
  }
142
138
  ] : [];
143
139
  const X = (G = c.value) != null && G["x-tagGroups"] ? (W = (V = c.value) == null ? void 0 : V["x-tagGroups"]) == null ? void 0 : W.map((e) => {
144
- var h;
140
+ var f;
145
141
  const o = [];
146
- return (h = e.tags) == null || h.map((f) => {
147
- if (f === "models" && S.length > 0)
142
+ return (f = e.tags) == null || f.map((h) => {
143
+ if (h === "models" && S.length > 0)
148
144
  o.push(S[0]), S = [];
149
- else if (f === "webhooks" && k.length > 0)
145
+ else if (h === "webhooks" && k.length > 0)
150
146
  o.push(k[0]), k = [];
151
147
  else {
152
- const v = m == null ? void 0 : m.find((b) => b.title === f);
148
+ const v = m == null ? void 0 : m.find((b) => b.title === h);
153
149
  v && o.push(v);
154
150
  }
155
151
  }), {
@@ -171,7 +167,7 @@ const Q = P(() => {
171
167
  entries: H,
172
168
  titles: s
173
169
  };
174
- }), ie = w(!1), le = P(() => {
170
+ }), ie = w(!1), le = q(() => {
175
171
  var t, a, i;
176
172
  return ((i = (t = Q.value) == null ? void 0 : t.titles) == null ? void 0 : i[((a = O.value) == null ? void 0 : a.hash) ?? ""]) ?? "";
177
173
  }), ne = (t, a) => {
@@ -179,20 +175,20 @@ const Q = P(() => {
179
175
  const i = (d = O.value) == null ? void 0 : d.getSectionId(t);
180
176
  if (i && i !== t)
181
177
  if (y[i])
182
- _(t, a);
178
+ F(t, a);
183
179
  else {
184
- const p = Z.on((s) => {
185
- s.id === t && (_(t, a), p());
180
+ const p = Y.on((s) => {
181
+ s.id === t && (F(t, a), p());
186
182
  });
187
183
  I(i, !0);
188
184
  }
189
185
  };
190
- function we(t) {
186
+ function ve(t) {
191
187
  Object.assign(g, t);
192
- const a = $();
188
+ const a = Z();
193
189
  O.value = a;
194
190
  const { hash: i, getSectionId: d, getTagId: p } = a;
195
- return t != null && t.parsedSpec && (R(t.parsedSpec), U(
191
+ return t != null && t.parsedSpec && (R(t.parsedSpec), N(
196
192
  () => {
197
193
  var s, l;
198
194
  return (l = (s = c.value) == null ? void 0 : s.tags) == null ? void 0 : l.length;
@@ -207,7 +203,7 @@ function we(t) {
207
203
  r && I(p(r), !0);
208
204
  }
209
205
  }
210
- ), U(
206
+ ), N(
211
207
  () => {
212
208
  var s, l;
213
209
  return (l = (s = c.value) == null ? void 0 : s.info) == null ? void 0 : l.description;
@@ -247,5 +243,5 @@ function we(t) {
247
243
  export {
248
244
  re as DEFAULT_INTRODUCTION_SLUG,
249
245
  ne as scrollToOperation,
250
- we as useSidebar
246
+ ve as useSidebar
251
247
  };
package/dist/index.d.ts CHANGED
@@ -9,10 +9,9 @@ export { Sidebar } from './components/Sidebar';
9
9
  export { Card, CardHeader, CardContent, CardFooter, CardTabHeader, CardTab } from './components/Card';
10
10
  export { Layouts } from './components/Layouts';
11
11
  export { parse } from './helpers/parse.js';
12
- export { createEmptySpecification } from './helpers/createEmptySpecification.js';
12
+ export { createEmptySpecification } from './libs/openapi.js';
13
13
  export { useNavState } from './hooks/useNavState.js';
14
14
  export { useSidebar } from './hooks/useSidebar.js';
15
15
  export { useHttpClientStore } from './stores/useHttpClientStore.js';
16
- export type { ApiReferenceConfiguration, ReferenceProps, ReferenceConfiguration, } from './types';
17
- export { createScalarReferences } from './esm.js';
16
+ export type { ApiReferenceConfiguration, ReferenceProps, } from './types';
18
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE7D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EAAE,OAAO,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