@scalar/api-reference 1.29.3 → 1.31.0

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 (159) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +13 -114
  3. package/dist/browser/standalone.js +6525 -6416
  4. package/dist/browser/webpack-stats.json +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  6. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  7. package/dist/components/ApiReferenceLayout.vue2.js +164 -181
  8. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  9. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  10. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +56 -51
  11. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  12. package/dist/components/Content/Content.vue.js +1 -1
  13. package/dist/components/Content/Content.vue2.js +5 -5
  14. package/dist/components/Content/Introduction/Introduction.vue.d.ts +2 -2
  15. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  16. package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
  17. package/dist/components/Content/Introduction/Introduction.vue2.js +57 -63
  18. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  19. package/dist/components/Content/Lazy/Loading.vue.js +46 -46
  20. package/dist/components/Content/Models/Models.vue.d.ts +2 -2
  21. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  22. package/dist/components/Content/Models/Models.vue.js +2 -2
  23. package/dist/components/Content/Models/Models.vue2.js +7 -6
  24. package/dist/components/Content/Models/ModelsAccordion.vue.d.ts +2 -2
  25. package/dist/components/Content/Models/ModelsAccordion.vue.d.ts.map +1 -1
  26. package/dist/components/Content/Models/ModelsAccordion.vue.js +2 -2
  27. package/dist/components/Content/Schema/Schema.preview.d.ts +98 -56
  28. package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
  29. package/dist/components/Content/Schema/Schema.vue.d.ts +6 -3
  30. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  31. package/dist/components/Content/Schema/Schema.vue.js +1 -1
  32. package/dist/components/Content/Schema/Schema.vue2.js +140 -97
  33. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +2 -2
  34. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  35. package/dist/components/Content/Schema/SchemaComposition.vue.js +57 -53
  36. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +13 -0
  37. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -0
  38. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +49 -0
  39. package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +4 -0
  40. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +2 -2
  41. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
  42. package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
  43. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -2
  44. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  45. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  46. package/dist/components/Content/Schema/SchemaProperty.vue2.js +40 -38
  47. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +3 -2
  48. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  49. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
  50. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +147 -143
  51. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +2 -2
  52. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
  53. package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts +9 -1
  54. package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts.map +1 -1
  55. package/dist/components/Content/Schema/helpers/schema-discriminator.js +45 -0
  56. package/dist/components/Content/Tag/TagList.vue.d.ts +2 -2
  57. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  58. package/dist/components/DocumentSelector/DocumentSelector.vue.js +3 -3
  59. package/dist/components/Layouts/ClassicLayout.vue.js +10 -8
  60. package/dist/components/Layouts/Layouts.vue.js +11 -9
  61. package/dist/components/Layouts/ModernLayout.vue2.js +22 -20
  62. package/dist/components/Section/SectionHeader.vue.d.ts.map +1 -1
  63. package/dist/components/Section/SectionHeader.vue.js +2 -2
  64. package/dist/components/Section/SectionHeaderTag.vue.d.ts.map +1 -1
  65. package/dist/components/Section/SectionHeaderTag.vue.js +2 -2
  66. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  67. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  68. package/dist/components/Sidebar/Sidebar.vue2.js +56 -56
  69. package/dist/components/SingleApiReference.vue.d.ts.map +1 -1
  70. package/dist/components/SingleApiReference.vue.js +27 -33
  71. package/dist/esm.d.ts.map +1 -1
  72. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts +2 -2
  73. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  74. package/dist/features/ApiClientModal/ApiClientModal.vue.js +49 -50
  75. package/dist/features/ApiClientModal/useApiClient.d.ts +224 -204
  76. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  77. package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts +11 -0
  78. package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts.map +1 -0
  79. package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +38 -0
  80. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +21 -0
  81. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -0
  82. package/dist/features/DocumentSource/hooks/useDocumentSource.js +94 -0
  83. package/dist/features/DocumentSource/index.d.ts +2 -0
  84. package/dist/features/DocumentSource/index.d.ts.map +1 -0
  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 +18 -17
  89. package/dist/features/DownloadLink/index.d.ts +1 -0
  90. package/dist/features/DownloadLink/index.d.ts.map +1 -1
  91. package/dist/features/DownloadLink/openapi-version-symbol.d.ts +2 -0
  92. package/dist/features/DownloadLink/openapi-version-symbol.d.ts.map +1 -0
  93. package/dist/features/DownloadLink/openapi-version-symbol.js +4 -0
  94. package/dist/features/Operation/Operation.vue.d.ts +2 -2
  95. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  96. package/dist/features/Operation/components/OperationParameters.vue.d.ts +2 -2
  97. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  98. package/dist/features/Operation/components/OperationResponses.vue.d.ts +2 -2
  99. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  100. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts +2 -2
  101. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -1
  102. package/dist/features/Operation/components/ParameterHeaders.vue.js +2 -2
  103. package/dist/features/Operation/components/ParameterList.vue.d.ts +2 -2
  104. package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
  105. package/dist/features/Operation/components/ParameterList.vue.js +2 -2
  106. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +2 -2
  107. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  108. package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
  109. package/dist/features/Operation/components/ParameterListItem.vue2.js +6 -6
  110. package/dist/features/Operation/components/RequestBody.vue.d.ts +2 -2
  111. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  112. package/dist/features/Operation/components/RequestBody.vue.js +2 -2
  113. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +14 -0
  114. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -0
  115. package/dist/features/Operation/components/callbacks/Callback.vue.js +7 -0
  116. package/dist/features/Operation/components/callbacks/Callback.vue2.js +62 -0
  117. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +10 -0
  118. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -0
  119. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +30 -0
  120. package/dist/features/Operation/components/callbacks/Callbacks.vue2.js +4 -0
  121. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +2 -2
  122. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  123. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  124. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +55 -55
  125. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +2 -2
  126. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  127. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  128. package/dist/features/Operation/layouts/ModernLayout.vue2.js +94 -79
  129. package/dist/features/Operation/types/schemas.d.ts +3 -0
  130. package/dist/features/Operation/types/schemas.d.ts.map +1 -0
  131. package/dist/features/Search/SearchButton.vue.js +2 -2
  132. package/dist/helpers/local-storage.d.ts +8 -0
  133. package/dist/helpers/local-storage.d.ts.map +1 -0
  134. package/dist/helpers/local-storage.js +6 -0
  135. package/dist/helpers/measure.d.ts +21 -0
  136. package/dist/helpers/measure.d.ts.map +1 -0
  137. package/dist/helpers/measure.js +7 -0
  138. package/dist/helpers/parse.d.ts +3 -5
  139. package/dist/helpers/parse.d.ts.map +1 -1
  140. package/dist/helpers/parse.js +64 -86
  141. package/dist/helpers/scroll-to-id.d.ts.map +1 -1
  142. package/dist/helpers/scroll-to-id.js +18 -4
  143. package/dist/index.d.ts +0 -1
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.js +33 -35
  146. package/dist/libs/openapi.d.ts +3 -3
  147. package/dist/libs/openapi.d.ts.map +1 -1
  148. package/dist/libs/openapi.js +35 -42
  149. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  150. package/dist/standalone/lib/html-api.js +15 -15
  151. package/dist/stores/useHttpClientStore.d.ts.map +1 -1
  152. package/dist/stores/useHttpClientStore.js +19 -18
  153. package/dist/style.css +1 -1
  154. package/dist/types.d.ts +27 -3
  155. package/dist/types.d.ts.map +1 -1
  156. package/package.json +15 -16
  157. package/dist/hooks/useReactiveSpec.d.ts +0 -448
  158. package/dist/hooks/useReactiveSpec.d.ts.map +0 -1
  159. package/dist/hooks/useReactiveSpec.js +0 -59
@@ -1,73 +1,72 @@
1
- import { defineComponent as h, ref as S, onMounted as E, watch as b, onBeforeUnmount as x, createElementBlock as M, openBlock as g } from "vue";
2
- import { useActiveEntities as k, useWorkspace as A } from "@scalar/api-client/store";
3
- import { mutateSecuritySchemeDiff as C } from "@scalar/api-client/views/Request/libs";
4
- import { getServersFromOpenApiDocument as U } from "@scalar/oas-utils/transforms";
5
- import { watchDebounced as B } from "@vueuse/core";
6
- import D from "microdiff";
1
+ import { defineComponent as d, ref as h, onMounted as S, watch as E, onBeforeUnmount as b, createElementBlock as x, openBlock as D } from "vue";
2
+ import { useActiveEntities as M, useWorkspace as g } from "@scalar/api-client/store";
3
+ import { mutateSecuritySchemeDiff as k } from "@scalar/api-client/views/Request/libs";
4
+ import { getServersFromOpenApiDocument as A } from "@scalar/oas-utils/transforms";
5
+ import { watchDebounced as U } from "@vueuse/core";
6
+ import B from "microdiff";
7
7
  import { useNavState as _ } from "../../hooks/useNavState.js";
8
8
  import { useApiClient as y } from "./useApiClient.js";
9
- import { useExampleStore as I } from "../../legacy/stores/useExampleStore.js";
10
- const G = /* @__PURE__ */ h({
9
+ import { useExampleStore as C } from "../../legacy/stores/useExampleStore.js";
10
+ const q = /* @__PURE__ */ d({
11
11
  __name: "ApiClientModal",
12
12
  props: {
13
13
  configuration: {},
14
- parsedSpec: {}
14
+ dereferencedDocument: {}
15
15
  },
16
- setup(i) {
17
- const c = S(null), { client: o, init: v } = y(), { selectedExampleKey: d, operationId: l } = I(), s = k(), r = A(), { isIntersectionEnabled: m } = _();
18
- return E(() => {
19
- c.value && v({
16
+ setup(a) {
17
+ const c = h(null), { client: i, init: p } = y(), { selectedExampleKey: v, operationId: l } = C(), u = M(), r = g(), { isIntersectionEnabled: m } = _();
18
+ return S(() => {
19
+ c.value && p({
20
20
  el: c.value,
21
- configuration: i.configuration,
21
+ configuration: a.configuration,
22
22
  store: r
23
23
  });
24
- }), B(
25
- () => i.configuration,
26
- (e, a) => {
27
- var f;
28
- if (!a || !s.activeCollection.value)
24
+ }), U(
25
+ () => a.configuration,
26
+ (t, o) => {
27
+ if (!o || !u.activeCollection.value)
29
28
  return;
30
- const n = s.activeCollection.value, p = D(a, e);
31
- if (p.some(
32
- (t) => t.path[0] === "url" || t.path[0] === "content" || t.path[1] === "url" || t.path[1] === "content"
33
- ))
34
- (f = o.value) == null || f.updateConfig(e);
35
- else if (p.forEach((t) => {
36
- t.path[0] === "authentication" && C(t, s, r);
37
- }), e.servers || a.servers) {
38
- n.servers.forEach((u) => {
39
- r.serverMutators.delete(u, n.uid);
40
- });
41
- const t = U(
42
- e.servers ?? i.parsedSpec.servers,
43
- {
44
- baseServerURL: e.baseServerURL
45
- }
46
- );
47
- t.forEach((u) => {
48
- r.serverMutators.add(u, n.uid);
49
- }), t.length && r.collectionMutators.edit(
50
- n.uid,
51
- "selectedServerUid",
52
- t[t.length - 1].uid
53
- );
29
+ const n = u.activeCollection.value, f = B(o, t);
30
+ if (!f.some(
31
+ (e) => e.path[0] === "url" || e.path[0] === "content" || e.path[1] === "url" || e.path[1] === "content"
32
+ )) {
33
+ if (f.forEach((e) => {
34
+ e.path[0] === "authentication" && k(e, u, r);
35
+ }), t.servers || o.servers) {
36
+ n.servers.forEach((s) => {
37
+ r.serverMutators.delete(s, n.uid);
38
+ });
39
+ const e = A(
40
+ t.servers ?? a.dereferencedDocument.servers,
41
+ {
42
+ baseServerURL: t.baseServerURL
43
+ }
44
+ );
45
+ e.forEach((s) => {
46
+ r.serverMutators.add(s, n.uid);
47
+ }), e.length && r.collectionMutators.edit(
48
+ n.uid,
49
+ "selectedServerUid",
50
+ e[e.length - 1].uid
51
+ );
52
+ }
54
53
  }
55
54
  m.value = !1, setTimeout(() => {
56
55
  m.value = !0;
57
56
  }, 1e3);
58
57
  },
59
58
  { deep: !0, debounce: 300 }
60
- ), b(d, (e) => {
61
- o.value && e && l.value && o.value.updateExample(e, l.value);
62
- }), x(() => {
63
- var e;
64
- return (e = o.value) == null ? void 0 : e.app.unmount();
65
- }), (e, a) => (g(), M("div", {
59
+ ), E(v, (t) => {
60
+ i.value && t && l.value && i.value.updateExample(t, l.value);
61
+ }), b(() => {
62
+ var t;
63
+ return (t = i.value) == null ? void 0 : t.app.unmount();
64
+ }), (t, o) => (D(), x("div", {
66
65
  ref_key: "el",
67
66
  ref: c
68
67
  }, null, 512));
69
68
  }
70
69
  });
71
70
  export {
72
- G as default
71
+ q as default
73
72
  };