@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,22 +1,23 @@
1
- import { defineComponent as b, useId as O, computed as S, createBlock as p, openBlock as m, unref as e, withCtx as a, createVNode as r, createCommentVNode as y, createElementVNode as t, normalizeClass as d, createTextVNode as f, toDisplayString as u } from "vue";
2
- import { ScalarMarkdown as C, ScalarErrorBoundary as c } from "@scalar/components";
3
- import k from "../../../components/OperationPath.vue.js";
1
+ import { defineComponent as y, useId as O, computed as S, createBlock as t, openBlock as n, unref as o, withCtx as r, createVNode as a, createCommentVNode as c, createElementVNode as i, normalizeClass as f, createTextVNode as u, toDisplayString as h } from "vue";
2
+ import { ScalarMarkdown as k, ScalarErrorBoundary as l } from "@scalar/components";
3
+ import C from "../../../components/OperationPath.vue.js";
4
4
  import { useConfig as B } from "../../../hooks/useConfig.js";
5
- import { getOperationStability as h, getOperationStabilityColor as _, isOperationDeprecated as E } from "../../../libs/openapi.js";
6
- import N from "../components/OperationParameters.vue.js";
5
+ import { getOperationStability as b, getOperationStabilityColor as w, isOperationDeprecated as E } from "../../../libs/openapi.js";
6
+ import N from "../components/callbacks/Callbacks.vue.js";
7
+ import T from "../components/OperationParameters.vue.js";
7
8
  import V from "../components/OperationResponses.vue.js";
8
- import w from "../../../components/Section/Section.vue.js";
9
- import I from "../../../components/Section/SectionContent.vue.js";
9
+ import I from "../../../components/Section/Section.vue.js";
10
+ import P from "../../../components/Section/SectionContent.vue.js";
10
11
  import R from "../../../components/Badge/Badge.vue.js";
11
- import T from "../../../components/Section/SectionHeader.vue.js";
12
- import q from "../../../components/Anchor/Anchor.vue.js";
13
- import D from "../../../components/Section/SectionHeaderTag.vue.js";
14
- import H from "../../../components/Section/SectionColumns.vue.js";
12
+ import _ from "../../../components/Section/SectionHeader.vue.js";
13
+ import $ from "../../../components/Anchor/Anchor.vue.js";
14
+ import q from "../../../components/Section/SectionHeaderTag.vue.js";
15
+ import A from "../../../components/Section/SectionColumns.vue.js";
15
16
  import g from "../../../components/Section/SectionColumn.vue.js";
16
- import L from "../../ExampleRequest/ExampleRequest.vue.js";
17
- import M from "../../TestRequestButton/TestRequestButton.vue.js";
18
- import $ from "../../ExampleResponses/ExampleResponses.vue.js";
19
- const z = { class: "operation-details" }, A = { class: "examples" }, ie = /* @__PURE__ */ b({
17
+ import D from "../../ExampleRequest/ExampleRequest.vue.js";
18
+ import H from "../../TestRequestButton/TestRequestButton.vue.js";
19
+ import L from "../../ExampleResponses/ExampleResponses.vue.js";
20
+ const M = { class: "operation-details" }, z = { class: "examples" }, se = /* @__PURE__ */ y({
20
21
  __name: "ModernLayout",
21
22
  props: {
22
23
  id: {},
@@ -26,43 +27,43 @@ const z = { class: "operation-details" }, A = { class: "examples" }, ie = /* @__
26
27
  transformedOperation: {},
27
28
  schemas: {}
28
29
  },
29
- setup(n) {
30
- const i = O(), v = B(), l = S(() => n.operation.summary || n.operation.path);
31
- return (o, P) => (m(), p(e(w), {
32
- id: o.id,
33
- "aria-labelledby": e(i),
34
- label: l.value,
30
+ setup(s) {
31
+ const p = O(), v = B(), m = S(() => s.operation.summary || s.operation.path);
32
+ return (e, j) => (n(), t(o(I), {
33
+ id: e.id,
34
+ "aria-labelledby": o(p),
35
+ label: m.value,
35
36
  tabindex: "-1"
36
37
  }, {
37
- default: a(() => [
38
- r(e(I), {
39
- loading: e(v).isLoading
38
+ default: r(() => [
39
+ a(o(P), {
40
+ loading: o(v).isLoading
40
41
  }, {
41
- default: a(() => [
42
- e(h)(o.operation) ? (m(), p(e(R), {
42
+ default: r(() => [
43
+ o(b)(e.operation) ? (n(), t(o(R), {
43
44
  key: 0,
44
- class: d(e(_)(o.operation))
45
+ class: f(o(w)(e.operation))
45
46
  }, {
46
- default: a(() => [
47
- f(u(e(h)(o.operation)), 1)
47
+ default: r(() => [
48
+ u(h(o(b)(e.operation)), 1)
48
49
  ]),
49
50
  _: 1
50
- }, 8, ["class"])) : y("", !0),
51
- t("div", {
52
- class: d(e(E)(o.operation) ? "deprecated" : "")
51
+ }, 8, ["class"])) : c("", !0),
52
+ i("div", {
53
+ class: f(o(E)(e.operation) ? "deprecated" : "")
53
54
  }, [
54
- r(e(T), null, {
55
- default: a(() => [
56
- r(e(q), {
57
- id: o.id ?? ""
55
+ a(o(_), null, {
56
+ default: r(() => [
57
+ a(o($), {
58
+ id: e.id ?? ""
58
59
  }, {
59
- default: a(() => [
60
- r(e(D), {
61
- id: e(i),
60
+ default: r(() => [
61
+ a(o(q), {
62
+ id: o(p),
62
63
  level: 3
63
64
  }, {
64
- default: a(() => [
65
- f(u(l.value), 1)
65
+ default: r(() => [
66
+ u(h(m.value), 1)
66
67
  ]),
67
68
  _: 1
68
69
  }, 8, ["id"])
@@ -73,61 +74,75 @@ const z = { class: "operation-details" }, A = { class: "examples" }, ie = /* @__
73
74
  _: 1
74
75
  })
75
76
  ], 2),
76
- r(e(H), null, {
77
- default: a(() => [
78
- r(e(g), null, {
79
- default: a(() => [
80
- t("div", z, [
81
- r(e(C), {
82
- value: o.operation.description,
83
- withImages: ""
84
- }, null, 8, ["value"]),
85
- r(N, {
86
- operation: o.operation,
87
- schemas: o.schemas
77
+ a(o(A), null, {
78
+ default: r(() => [
79
+ a(o(g), null, {
80
+ default: r(() => [
81
+ i("div", M, [
82
+ a(o(k), {
83
+ value: e.operation.description,
84
+ withImages: "",
85
+ withAnchors: "",
86
+ transformType: "heading",
87
+ anchorPrefix: e.id
88
+ }, null, 8, ["value", "anchorPrefix"]),
89
+ a(T, {
90
+ operation: e.operation,
91
+ schemas: e.schemas
88
92
  }, null, 8, ["operation", "schemas"]),
89
- r(V, {
90
- operation: o.transformedOperation,
91
- schemas: o.schemas
92
- }, null, 8, ["operation", "schemas"])
93
+ a(V, {
94
+ operation: e.transformedOperation,
95
+ schemas: e.schemas
96
+ }, null, 8, ["operation", "schemas"]),
97
+ a(o(l), null, {
98
+ default: r(() => [
99
+ e.operation.callbacks ? (n(), t(N, {
100
+ key: 0,
101
+ callbacks: e.operation.callbacks,
102
+ collection: e.collection,
103
+ schemas: e.schemas
104
+ }, null, 8, ["callbacks", "collection", "schemas"])) : c("", !0)
105
+ ]),
106
+ _: 1
107
+ })
93
108
  ])
94
109
  ]),
95
110
  _: 1
96
111
  }),
97
- r(e(g), null, {
98
- default: a(() => [
99
- t("div", A, [
100
- r(e(c), null, {
101
- default: a(() => [
102
- r(e(L), {
103
- collection: o.collection,
112
+ a(o(g), null, {
113
+ default: r(() => [
114
+ i("div", z, [
115
+ a(o(l), null, {
116
+ default: r(() => [
117
+ a(o(D), {
118
+ collection: e.collection,
104
119
  fallback: "",
105
- operation: o.operation,
106
- server: o.server,
107
- transformedOperation: o.transformedOperation
120
+ operation: e.operation,
121
+ server: e.server,
122
+ transformedOperation: e.transformedOperation
108
123
  }, {
109
- header: a(() => {
110
- var s;
124
+ header: r(() => {
125
+ var d;
111
126
  return [
112
- r(k, {
127
+ a(C, {
113
128
  class: "example-path",
114
- deprecated: (s = o.transformedOperation.information) == null ? void 0 : s.deprecated,
115
- path: o.transformedOperation.path
129
+ deprecated: (d = e.transformedOperation.information) == null ? void 0 : d.deprecated,
130
+ path: e.transformedOperation.path
116
131
  }, null, 8, ["deprecated", "path"])
117
132
  ];
118
133
  }),
119
- footer: a(() => [
120
- r(e(M), { operation: o.operation }, null, 8, ["operation"])
134
+ footer: r(() => [
135
+ a(o(H), { operation: e.operation }, null, 8, ["operation"])
121
136
  ]),
122
137
  _: 1
123
138
  }, 8, ["collection", "operation", "server", "transformedOperation"])
124
139
  ]),
125
140
  _: 1
126
141
  }),
127
- r(e(c), null, {
128
- default: a(() => [
129
- r(e($), {
130
- responses: o.operation.responses,
142
+ a(o(l), null, {
143
+ default: r(() => [
144
+ a(o(L), {
145
+ responses: e.operation.responses,
131
146
  style: { "margin-top": "12px" }
132
147
  }, null, 8, ["responses"])
133
148
  ]),
@@ -149,5 +164,5 @@ const z = { class: "operation-details" }, A = { class: "examples" }, ie = /* @__
149
164
  }
150
165
  });
151
166
  export {
152
- ie as default
167
+ se as default
153
168
  };
@@ -0,0 +1,3 @@
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ export type Schemas = Record<string, OpenAPIV3_1.SchemaObject> | unknown;
3
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/types/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,OAAO,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SearchButton.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d21ab44f"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ec9c0928"]]);
5
5
  export {
6
- m as default
6
+ e as default
7
7
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * localStorage keys for all reference resources
3
+ * to ensure we do not have any conflicts
4
+ */
5
+ export declare const REFERENCE_LS_KEYS: {
6
+ readonly SELECTED_CLIENT: "scalar-reference-selected-client";
7
+ };
8
+ //# sourceMappingURL=local-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../../src/helpers/local-storage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;CAEpB,CAAA"}
@@ -0,0 +1,6 @@
1
+ const e = {
2
+ SELECTED_CLIENT: "scalar-reference-selected-client"
3
+ };
4
+ export {
5
+ e as REFERENCE_LS_KEYS
6
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Measures the execution time of a function and logs it.
3
+ * Works with both async and sync functions.
4
+ * Returns the result of the measured function.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * // Async function
9
+ * const result = await measure('api-call', async () => {
10
+ * return await fetchData()
11
+ * })
12
+ *
13
+ * // Sync function
14
+ * const result = measure('computation', () => {
15
+ * return heavyComputation()
16
+ * })
17
+ * ```
18
+ */
19
+ export declare function measure<T>(name: string, fn: () => Promise<T>): Promise<T>;
20
+ export declare function measure<T>(name: string, fn: () => T): T;
21
+ //# sourceMappingURL=measure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../../src/helpers/measure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;AAC1E,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ function c(n, o) {
2
+ const r = performance.now(), t = o(), e = performance.now(), s = Math.round(e - r);
3
+ return console.info(`${n}: ${s} ms`), t;
4
+ }
5
+ export {
6
+ c as measure
7
+ };
@@ -1,11 +1,9 @@
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
1
2
  import type { Spec } from '@scalar/types/legacy';
2
- import type { UnknownObject } from '@scalar/types/utils';
3
3
  /**
4
- * Parse the given specification and return a super custom transformed specification.
4
+ * Parse the given dereferencedDocument and return a super custom transformed dereferencedDocument.
5
5
  *
6
6
  * @deprecated Try to use a store instead.
7
7
  */
8
- export declare const parse: (specification: UnknownObject | string | undefined, { proxyUrl, }?: {
9
- proxyUrl?: string;
10
- }) => Promise<Spec>;
8
+ export declare const parse: (dereferencedDocument: OpenAPIV3_1.Document) => Promise<Spec>;
11
9
  //# sourceMappingURL=parse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAMxD;;;;GAIG;AACH,eAAO,MAAM,KAAK,kBACD,aAAa,GAAG,MAAM,GAAG,SAAS,kBAG9C;IACD,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,KACA,OAAO,CAAC,IAAI,CAgDd,CAAA"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAOhD;;;;GAIG;AACH,eAAO,MAAM,KAAK,yBAA0B,WAAW,CAAC,QAAQ,KAAG,OAAO,CAAC,IAAI,CAmB9E,CAAA"}
@@ -1,119 +1,97 @@
1
- import { redirectToProxy as R, shouldIgnoreEntity as u } from "@scalar/oas-utils/helpers";
2
- import { load as M, dereference as q } from "@scalar/openapi-parser";
3
- import { fetchUrls as D } from "@scalar/openapi-parser/plugins/fetch-urls";
4
- import { createEmptySpecification as O } from "../libs/openapi.js";
5
- import { normalizeRequestMethod as j } from "../legacy/helpers/normalizeRequestMethod.js";
6
- import { validRequestMethods as C } from "../legacy/fixtures/httpRequestMethods.js";
7
- const G = (m, {
8
- proxyUrl: e
9
- } = {}) => new Promise(async (n, b) => {
10
- var h;
1
+ import { shouldIgnoreEntity as u } from "@scalar/oas-utils/helpers";
2
+ import { createEmptySpecification as w } from "../libs/openapi.js";
3
+ import { normalizeRequestMethod as R } from "../legacy/helpers/normalizeRequestMethod.js";
4
+ import { validRequestMethods as q } from "../legacy/fixtures/httpRequestMethods.js";
5
+ const C = (c) => new Promise(async (t, p) => {
11
6
  try {
12
- if (!m)
13
- return n(I(O()));
14
- const f = performance.now(), { filesystem: s } = await M(m, {
15
- plugins: [
16
- D({
17
- fetch: (o) => fetch(e ? R(e, o) : o)
18
- })
19
- ]
20
- }), { schema: a, errors: r } = await q(s), t = performance.now();
21
- return console.log(`dereference: ${Math.round(t - f)} ms`), r != null && r.length && console.warn(
22
- `Please open an issue on https://github.com/scalar/scalar
23
- `,
24
- `Scalar OpenAPI Parser Warning:
25
- `,
26
- r
27
- ), a === void 0 ? (b(((h = r == null ? void 0 : r[0]) == null ? void 0 : h.message) ?? "Failed to parse the OpenAPI file."), n(I(O()))) : n(I(a));
28
- } catch (f) {
29
- console.error("[@scalar/api-reference]", "Failed to parse the OpenAPI document. It might be invalid?"), console.error(f), b(f);
7
+ return t(b(c || w()));
8
+ } catch (l) {
9
+ console.error("[@scalar/api-reference]", "Failed to parse the OpenAPI document. It might be invalid?"), console.error(l), p(l);
30
10
  }
31
- return n(I(O()));
32
- }), I = (m) => {
33
- var h, f;
34
- let e = {};
35
- m && typeof m == "object" ? e = structuredClone(m) : e = O(), e.tags || (e.tags = []), e.paths || (e.paths = {}), e.components || (e.components = {}), e.webhooks || (e.webhooks = {}), e.servers || (e.servers = []), e.security || (e.security = []), e.externalDocs || (e.externalDocs = {});
36
- const n = {};
37
- return Object.keys(e.webhooks ?? {}).forEach((s) => {
38
- var a;
39
- Object.keys(((a = e.webhooks) == null ? void 0 : a[s]) ?? {}).forEach((r) => {
40
- var o, l, g, y;
41
- const t = (o = e.webhooks) == null ? void 0 : o[s][r];
42
- if (!(!t || u(t))) {
43
- if (Array.isArray(t.tags)) {
44
- const i = (l = t.tags) == null ? void 0 : l.map(
45
- (c) => {
46
- var w;
47
- return (w = e.tags) == null ? void 0 : w.find((p) => p.name === c);
11
+ return t(b(w()));
12
+ }), b = (c) => {
13
+ var E, O;
14
+ let t = {};
15
+ c && typeof c == "object" ? t = c : t = w(), t.tags || (t.tags = []), t.paths || (t.paths = {}), t.components || (t.components = {}), t.webhooks || (t.webhooks = {}), t.servers || (t.servers = []), t.security || (t.security = []);
16
+ const p = {};
17
+ return Object.keys(t.webhooks ?? {}).forEach((s) => {
18
+ var d;
19
+ Object.keys(((d = t.webhooks) == null ? void 0 : d[s]) ?? {}).forEach((r) => {
20
+ var n, m, h, g;
21
+ const e = (n = t.webhooks) == null ? void 0 : n[s][r];
22
+ if (!(!e || u(e))) {
23
+ if (Array.isArray(e.tags)) {
24
+ const o = (m = e.tags) == null ? void 0 : m.map(
25
+ (a) => {
26
+ var y;
27
+ return (y = t.tags) == null ? void 0 : y.find((i) => i.name === a);
48
28
  }
49
29
  );
50
- if (t.tags = i == null ? void 0 : i.filter((c) => !u(c)), i != null && i.some((c) => u(c)))
30
+ if (e.tags = o == null ? void 0 : o.filter((a) => !u(a)), o != null && o.some((a) => u(a)))
51
31
  return;
52
32
  }
53
- n[s] === void 0 && (n[s] = {}), n[s][r] = {
33
+ p[s] === void 0 && (p[s] = {}), p[s][r] = {
54
34
  // Transformed data
55
- httpVerb: j(r),
35
+ httpVerb: R(r),
56
36
  path: s,
57
- operationId: (t == null ? void 0 : t.operationId) || s,
58
- name: (t == null ? void 0 : t.summary) || s || "",
59
- description: (t == null ? void 0 : t.description) || "",
60
- pathParameters: (y = (g = e.paths) == null ? void 0 : g[s]) == null ? void 0 : y.parameters,
37
+ operationId: (e == null ? void 0 : e.operationId) || s,
38
+ name: (e == null ? void 0 : e.summary) || s || "",
39
+ description: (e == null ? void 0 : e.description) || "",
40
+ pathParameters: (g = (h = t.paths) == null ? void 0 : h[s]) == null ? void 0 : g.parameters,
61
41
  // Original webhook
62
42
  information: {
63
- ...t
43
+ ...e
64
44
  }
65
45
  };
66
46
  }
67
47
  });
68
- }), Object.keys(((h = e.components) == null ? void 0 : h.schemas) ?? {}).forEach((s) => {
69
- var a, r, t, o;
70
- u((r = (a = e.components) == null ? void 0 : a.schemas) == null ? void 0 : r[s]) && ((o = (t = e.components) == null ? void 0 : t.schemas) == null || delete o[s]);
71
- }), Object.keys(e.paths).forEach((s) => {
72
- Object.keys(e.paths[s]).filter(
73
- (r) => C.includes(r.toUpperCase())
48
+ }), Object.keys(((E = t.components) == null ? void 0 : E.schemas) ?? {}).forEach((s) => {
49
+ var d, r, e, n;
50
+ u((r = (d = t.components) == null ? void 0 : d.schemas) == null ? void 0 : r[s]) && ((n = (e = t.components) == null ? void 0 : e.schemas) == null || delete n[s]);
51
+ }), Object.keys(t.paths).forEach((s) => {
52
+ Object.keys(t.paths[s]).filter(
53
+ (r) => q.includes(r.toUpperCase())
74
54
  ).forEach((r) => {
75
- var l, g, y, i, c, w;
76
- const t = e.paths[s][r];
77
- if (t === void 0 || u(t))
55
+ var m, h, g, o, a, y;
56
+ const e = t.paths[s][r];
57
+ if (e === void 0 || u(e))
78
58
  return;
79
- const o = {
80
- httpVerb: j(r),
59
+ const n = {
60
+ httpVerb: R(r),
81
61
  path: s,
82
- operationId: t.operationId || s,
83
- name: t.summary || s || "",
84
- description: t.description || "",
62
+ operationId: e.operationId || s,
63
+ name: e.summary || s || "",
64
+ description: e.description || "",
85
65
  information: {
86
- ...t
66
+ ...e
87
67
  },
88
- pathParameters: (g = (l = e.paths) == null ? void 0 : l[s]) == null ? void 0 : g.parameters
68
+ pathParameters: (h = (m = t.paths) == null ? void 0 : m[s]) == null ? void 0 : h.parameters
89
69
  };
90
- if (!t.tags || t.tags.length === 0) {
91
- (y = e.tags) != null && y.find((d) => d.name === "default") || (i = e.tags) == null || i.push({
70
+ if (!e.tags || e.tags.length === 0) {
71
+ (g = t.tags) != null && g.find((f) => f.name === "default") || (o = t.tags) == null || o.push({
92
72
  name: "default",
93
73
  description: "",
94
74
  operations: []
95
75
  });
96
- const p = (c = e.tags) == null ? void 0 : c.findIndex(
97
- (d) => d.name === "default"
98
- );
99
- p >= 0 && ((w = e.tags[p]) == null || w.operations.push(o));
76
+ const i = (a = t.tags) == null ? void 0 : a.findIndex((f) => f.name === "default");
77
+ i >= 0 && ((y = t.tags[i]) == null || y.operations.push(n));
100
78
  } else
101
- t.tags.forEach((p) => {
102
- var E, P, k;
103
- const d = (E = e.tags) == null ? void 0 : E.findIndex((A) => A.name === p);
104
- d === -1 && ((P = e.tags) == null || P.push({
105
- name: p,
79
+ e.tags.forEach((i) => {
80
+ var k, x, j;
81
+ const f = (k = t.tags) == null ? void 0 : k.findIndex((P) => P.name === i);
82
+ f === -1 && ((x = t.tags) == null || x.push({
83
+ name: i,
106
84
  description: ""
107
85
  }));
108
- const x = d !== -1 ? d : e.tags.length - 1;
109
- typeof ((k = e.tags[x]) == null ? void 0 : k.operations) > "u" && (e.tags[x].operations = []), e.tags[x].operations.push(o);
86
+ const I = f !== -1 ? f : t.tags.length - 1;
87
+ typeof ((j = t.tags[I]) == null ? void 0 : j.operations) > "u" && (t.tags[I].operations = []), t.tags[I].operations.push(n);
110
88
  });
111
89
  });
112
- }), e.tags = (f = e.tags) == null ? void 0 : f.filter((s) => !u(s)), {
113
- ...e,
114
- webhooks: n
90
+ }), t.tags = (O = t.tags) == null ? void 0 : O.filter((s) => !u(s)), {
91
+ ...t,
92
+ webhooks: p
115
93
  };
116
94
  };
117
95
  export {
118
- G as parse
96
+ C as parse
119
97
  };
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-to-id.d.ts","sourceRoot":"","sources":["../../src/helpers/scroll-to-id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,UAAU,OAAc,MAAM,UAAU,OAAO,kBAS3D,CAAA"}
1
+ {"version":3,"file":"scroll-to-id.d.ts","sourceRoot":"","sources":["../../src/helpers/scroll-to-id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,UAAU,OAAc,MAAM,UAAU,OAAO,kBAkC3D,CAAA"}
@@ -1,7 +1,21 @@
1
- const c = async (e, t) => {
2
- const o = document.getElementById(e);
3
- o && (o.scrollIntoView(), t && o.focus());
1
+ const l = async (t, r) => {
2
+ const n = (e) => {
3
+ e.scrollIntoView(), r && e.focus();
4
+ }, o = document.getElementById(t);
5
+ if (o) {
6
+ n(o);
7
+ return;
8
+ }
9
+ const s = Date.now() + 1e3, c = () => {
10
+ const e = document.getElementById(t);
11
+ if (e) {
12
+ n(e);
13
+ return;
14
+ }
15
+ Date.now() < s && requestAnimationFrame(c);
16
+ };
17
+ requestAnimationFrame(c);
4
18
  };
5
19
  export {
6
- c as scrollToId
20
+ l as scrollToId
7
21
  };
package/dist/index.d.ts CHANGED
@@ -4,7 +4,6 @@ export { default as ApiReferenceLayout } from './components/ApiReferenceLayout.v
4
4
  export { default as ModernLayout } from './components/Layouts/ModernLayout.vue.js';
5
5
  export { SearchButton, SearchModal } from './features/Search';
6
6
  export { default as GettingStarted } from './components/GettingStarted.vue.js';
7
- export { useReactiveSpec } from './hooks/useReactiveSpec.js';
8
7
  export { createApiReference } from './standalone/lib/html-api.js';
9
8
  export { Sidebar } from './components/Sidebar';
10
9
  export { Card, CardHeader, CardContent, CardFooter, CardTabHeader, CardTab } from './components/Card';
@@ -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,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,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAG9C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAChE,YAAY,EACV,yBAAyB,EACzB,cAAc,GACf,MAAM,SAAS,CAAA"}
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,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,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAG9C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAChE,YAAY,EACV,yBAAyB,EACzB,cAAc,GACf,MAAM,SAAS,CAAA"}