@scalar/api-reference 1.30.0 → 1.31.1
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.
- package/CHANGELOG.md +50 -0
- package/dist/browser/standalone.js +6690 -6569
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +164 -181
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +56 -51
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +1 -1
- package/dist/components/Content/Content.vue2.js +5 -5
- package/dist/components/Content/Introduction/Introduction.vue.d.ts +2 -2
- package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
- package/dist/components/Content/Introduction/Introduction.vue2.js +57 -63
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +46 -46
- package/dist/components/Content/Models/Models.vue.d.ts +2 -2
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +2 -2
- package/dist/components/Content/Models/Models.vue2.js +9 -7
- package/dist/components/Content/Models/ModelsAccordion.vue.d.ts +2 -2
- package/dist/components/Content/Models/ModelsAccordion.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModelsAccordion.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.preview.d.ts +294 -84
- package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +21 -4
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.vue2.js +158 -131
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +57 -53
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +2 -3
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +29 -29
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +12 -3
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +133 -103
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +3 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +133 -126
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +2 -2
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.d.ts +2 -2
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/DocumentSelector/DocumentSelector.vue.js +3 -3
- package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ClassicLayout.vue.js +19 -17
- package/dist/components/Layouts/Layouts.vue.js +11 -9
- package/dist/components/Layouts/ModernLayout.vue2.js +22 -20
- package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionAccordion.vue.js +2 -2
- package/dist/components/Section/SectionAccordion.vue2.js +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.js +2 -2
- package/dist/components/Section/SectionContainerAccordion.vue2.js +4 -4
- package/dist/components/Section/SectionHeader.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionHeader.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +56 -56
- package/dist/components/SingleApiReference.vue.d.ts.map +1 -1
- package/dist/components/SingleApiReference.vue.js +27 -33
- package/dist/esm.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts +2 -2
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +49 -50
- package/dist/features/ApiClientModal/useApiClient.d.ts +196 -196
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts +11 -0
- package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts.map +1 -0
- package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +38 -0
- package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +21 -0
- package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -0
- package/dist/features/DocumentSource/hooks/useDocumentSource.js +94 -0
- package/dist/features/DocumentSource/index.d.ts +2 -0
- package/dist/features/DocumentSource/index.d.ts.map +1 -0
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.js +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue2.js +18 -17
- package/dist/features/DownloadLink/index.d.ts +1 -0
- package/dist/features/DownloadLink/index.d.ts.map +1 -1
- package/dist/features/DownloadLink/openapi-version-symbol.d.ts +2 -0
- package/dist/features/DownloadLink/openapi-version-symbol.d.ts.map +1 -0
- package/dist/features/DownloadLink/openapi-version-symbol.js +4 -0
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +2 -0
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +178 -127
- package/dist/features/Operation/Operation.vue.d.ts +2 -2
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +29 -23
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +7 -3
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +28 -24
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +2 -2
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterHeaders.vue.d.ts +2 -2
- package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterHeaders.vue.js +2 -2
- package/dist/features/Operation/components/ParameterList.vue.d.ts +2 -2
- package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterList.vue.js +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
- package/dist/features/Operation/components/ParameterListItem.vue2.js +6 -6
- package/dist/features/Operation/components/RequestBody.vue.d.ts +7 -3
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +2 -2
- package/dist/features/Operation/components/RequestBody.vue2.js +41 -36
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +7 -3
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +84 -79
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +5 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +66 -57
- package/dist/features/Operation/types/schemas.d.ts +2 -2
- package/dist/features/Operation/types/schemas.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/helpers/local-storage.d.ts +8 -0
- package/dist/helpers/local-storage.d.ts.map +1 -0
- package/dist/helpers/local-storage.js +6 -0
- package/dist/helpers/measure.d.ts +21 -0
- package/dist/helpers/measure.d.ts.map +1 -0
- package/dist/helpers/measure.js +7 -0
- package/dist/helpers/parse.d.ts +3 -5
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +64 -86
- package/dist/helpers/scroll-to-id.d.ts.map +1 -1
- package/dist/helpers/scroll-to-id.js +18 -4
- package/dist/hooks/useDiscriminator.d.ts +53 -0
- package/dist/hooks/useDiscriminator.d.ts.map +1 -0
- package/dist/hooks/useDiscriminator.js +149 -0
- package/dist/hooks/useOperationDiscriminator.d.ts +8 -0
- package/dist/hooks/useOperationDiscriminator.d.ts.map +1 -0
- package/dist/hooks/useOperationDiscriminator.js +57 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -35
- package/dist/libs/openapi.d.ts +3 -3
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +35 -42
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/standalone/lib/html-api.js +15 -15
- package/dist/stores/useHttpClientStore.d.ts.map +1 -1
- package/dist/stores/useHttpClientStore.js +19 -18
- package/dist/style.css +1 -1
- package/dist/types.d.ts +27 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +15 -16
- package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts +0 -12
- package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts.map +0 -1
- package/dist/components/Content/Schema/helpers/schema-discriminator.js +0 -45
- package/dist/hooks/useReactiveSpec.d.ts +0 -448
- package/dist/hooks/useReactiveSpec.d.ts.map +0 -1
- package/dist/hooks/useReactiveSpec.js +0 -59
package/dist/libs/openapi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Operation } from '@scalar/oas-utils/entities/spec';
|
|
2
|
-
import type { OpenAPI,
|
|
2
|
+
import type { OpenAPI, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
3
3
|
import type { Spec, TransformedOperation } from '@scalar/types/legacy';
|
|
4
4
|
import { XScalarStability } from '@scalar/types/legacy';
|
|
5
5
|
type PropertyObject = {
|
|
@@ -20,9 +20,9 @@ export declare function formatProperty(key: string, obj: PropertyObject): string
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function extractRequestBody(operation: TransformedOperation): string[] | boolean;
|
|
22
22
|
/**
|
|
23
|
-
* Returns all models from the specification, no matter if it’s
|
|
23
|
+
* Returns all models from the specification, no matter if it’s OpenAPI 3.x.
|
|
24
24
|
*/
|
|
25
|
-
export declare function getModels(spec?: Spec): Record<string, OpenAPIV3_1.SchemaObject
|
|
25
|
+
export declare function getModels(spec?: Spec): Record<string, OpenAPIV3_1.SchemaObject>;
|
|
26
26
|
/**
|
|
27
27
|
* Checks if the OpenAPI document has schemas.
|
|
28
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/libs/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/libs/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAIvD,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,UAAU,EAAE;QACV,CAAC,GAAG,EAAE,MAAM,GAAG;YACb,IAAI,EAAE,MAAM,CAAA;YACZ,WAAW,CAAC,EAAE,MAAM,CAAA;SACrB,CAAA;KACF,CAAA;CACF,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,MAAM,CAcvE;AA8BD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,oBAAoB,GAAG,MAAM,EAAE,GAAG,OAAO,CAYtF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,4CAsBpC;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,aAAc,IAAI,YAUvC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,aAAc,IAAI,YAUzC,CAAA;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,oBAW3E;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAiBjF,IAAI,CACX;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,YAAY,GAAG,oBAAoB,CAAC,GAAG,OAAO,CAQ9G;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,YAAY,GAAG,oBAAoB,CAAC,GAC9D,gBAAgB,GAAG,SAAS,CAK9B;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,YAAY,GAAG,oBAAoB,CAAC,GAAG,MAAM,CAYlH"}
|
package/dist/libs/openapi.js
CHANGED
|
@@ -1,59 +1,56 @@
|
|
|
1
1
|
import { XScalarStability as o } from "@scalar/types/legacy";
|
|
2
|
-
function l(e,
|
|
2
|
+
function l(e, r) {
|
|
3
3
|
var n;
|
|
4
|
-
let
|
|
5
|
-
const i = (n =
|
|
6
|
-
return
|
|
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;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function p(e) {
|
|
9
9
|
var i;
|
|
10
|
-
const
|
|
11
|
-
return
|
|
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) => {
|
|
12
12
|
if (!e.schema)
|
|
13
13
|
return;
|
|
14
|
-
|
|
15
|
-
const s =
|
|
16
|
-
s.type === "object" && !!s.properties && s.properties && Object.keys(s.properties).forEach((
|
|
17
|
-
var
|
|
18
|
-
|
|
14
|
+
r.push(l(n, e.schema));
|
|
15
|
+
const s = t[n];
|
|
16
|
+
s.type === "object" && !!s.properties && s.properties && Object.keys(s.properties).forEach((c) => {
|
|
17
|
+
var u, f;
|
|
18
|
+
r.push(`${c} ${(f = (u = s.properties) == null ? void 0 : u[c]) == null ? void 0 : f.type}`);
|
|
19
19
|
});
|
|
20
|
-
}),
|
|
20
|
+
}), r;
|
|
21
21
|
}
|
|
22
22
|
function O(e) {
|
|
23
|
-
var
|
|
23
|
+
var r, t, i;
|
|
24
24
|
try {
|
|
25
|
-
const n = (i = (
|
|
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"];
|
|
26
26
|
if (!n)
|
|
27
27
|
throw new Error("Body not found");
|
|
28
|
-
return
|
|
28
|
+
return p(n);
|
|
29
29
|
} catch {
|
|
30
30
|
return !1;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
var
|
|
33
|
+
function d(e) {
|
|
34
|
+
var t, i;
|
|
35
35
|
if (!e)
|
|
36
36
|
return {};
|
|
37
|
-
const
|
|
37
|
+
const r = (
|
|
38
38
|
// OpenAPI 3.x
|
|
39
|
-
Object.keys(((
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
// Fallback
|
|
43
|
-
{}
|
|
44
|
-
)
|
|
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 : (
|
|
40
|
+
// Fallback
|
|
41
|
+
{}
|
|
45
42
|
)
|
|
46
43
|
);
|
|
47
|
-
return Object.keys(
|
|
44
|
+
return Object.keys(r ?? {}).forEach((n) => {
|
|
48
45
|
var s;
|
|
49
|
-
((s =
|
|
50
|
-
}),
|
|
46
|
+
((s = r[n]) == null ? void 0 : s["x-internal"]) === !0 && delete r[n];
|
|
47
|
+
}), r;
|
|
51
48
|
}
|
|
52
|
-
const b = (e) => e ? !!Object.keys(
|
|
53
|
-
function a(e,
|
|
54
|
-
for (const [
|
|
55
|
-
i !== null && typeof i == "object" ? (t
|
|
56
|
-
return
|
|
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;
|
|
57
54
|
}
|
|
58
55
|
function E(e) {
|
|
59
56
|
return a(e ?? {}, {
|
|
@@ -70,10 +67,6 @@ function E(e) {
|
|
|
70
67
|
email: ""
|
|
71
68
|
}
|
|
72
69
|
},
|
|
73
|
-
externalDocs: {
|
|
74
|
-
description: "",
|
|
75
|
-
url: ""
|
|
76
|
-
},
|
|
77
70
|
servers: [],
|
|
78
71
|
tags: []
|
|
79
72
|
});
|
|
@@ -84,18 +77,18 @@ function S(e) {
|
|
|
84
77
|
function h(e) {
|
|
85
78
|
return e.deprecated ? o.Deprecated : e["x-scalar-stability"];
|
|
86
79
|
}
|
|
87
|
-
function
|
|
88
|
-
const
|
|
89
|
-
return
|
|
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" : "";
|
|
90
83
|
}
|
|
91
84
|
export {
|
|
92
85
|
E as createEmptySpecification,
|
|
93
86
|
a as deepMerge,
|
|
94
87
|
O as extractRequestBody,
|
|
95
88
|
l as formatProperty,
|
|
96
|
-
|
|
89
|
+
d as getModels,
|
|
97
90
|
h as getOperationStability,
|
|
98
|
-
|
|
91
|
+
v as getOperationStabilityColor,
|
|
99
92
|
b as hasModels,
|
|
100
93
|
x as hasWebhooks,
|
|
101
94
|
S as isOperationDeprecated
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-api.d.ts","sourceRoot":"","sources":["../../../src/standalone/lib/html-api.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,yBAAyB,EAE9B,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAA;AAQpC;;GAEG;AACH,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,QAAQ,GAAG,yBAAyB,CA+G3F;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,yBAAyB,QAiBzF;AAID,eAAO,MAAM,eAAe,QAAS,QAAQ,YAAY,OAAO,GAAG,IAAI,mBAatE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"html-api.d.ts","sourceRoot":"","sources":["../../../src/standalone/lib/html-api.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,yBAAyB,EAE9B,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAA;AAQpC;;GAEG;AACH,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,QAAQ,GAAG,yBAAyB,CA+G3F;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,yBAAyB,QAiBzF;AAID,eAAO,MAAM,eAAe,QAAS,QAAQ,YAAY,OAAO,GAAG,IAAI,mBAatE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAwHhC,CAAA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { createHead as
|
|
2
|
-
import { reactive as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
1
|
+
import { createHead as c } from "@unhead/vue";
|
|
2
|
+
import { reactive as f, createApp as d, h as i } from "vue";
|
|
3
|
+
import u from "../../components/ApiReference.vue.js";
|
|
4
|
+
const g = (a, s) => {
|
|
5
|
+
const r = "scalar-refs", t = f({
|
|
6
6
|
// Either the configuration will be the second arugment or it MUST be the first (configuration only)
|
|
7
|
-
configuration: s ??
|
|
7
|
+
configuration: s ?? a ?? {}
|
|
8
8
|
});
|
|
9
|
-
let
|
|
10
|
-
if (
|
|
11
|
-
const e = typeof
|
|
12
|
-
e ?
|
|
9
|
+
let n = d(() => i(u, t));
|
|
10
|
+
if (n.use(c()), n.config.idPrefix = r, s) {
|
|
11
|
+
const e = typeof a == "string" ? document.querySelector(a) : a;
|
|
12
|
+
e ? n.mount(e) : console.error("Could not find a mount point for API References:", a);
|
|
13
13
|
}
|
|
14
14
|
document.addEventListener(
|
|
15
15
|
"scalar:reload-references",
|
|
@@ -18,13 +18,13 @@ const y = (n, s) => {
|
|
|
18
18
|
"scalar:reload-references event has been deprecated, please use the scalarInstance.app.mount method instead."
|
|
19
19
|
), !t.configuration)
|
|
20
20
|
return;
|
|
21
|
-
const e = typeof
|
|
22
|
-
e && (e && !document.body.contains(e) && document.body.appendChild(e),
|
|
21
|
+
const e = typeof a == "string" ? document.querySelector(a) : a;
|
|
22
|
+
e && (e && !document.body.contains(e) && document.body.appendChild(e), n.unmount(), n = d(() => i(u, t)), n.use(c()), n.config.idPrefix = r, n.mount(e));
|
|
23
23
|
},
|
|
24
24
|
!1
|
|
25
25
|
);
|
|
26
26
|
const o = () => {
|
|
27
|
-
delete t.configuration,
|
|
27
|
+
delete t.configuration, n.unmount();
|
|
28
28
|
};
|
|
29
29
|
return document.addEventListener(
|
|
30
30
|
"scalar:destroy-references",
|
|
@@ -41,7 +41,7 @@ const y = (n, s) => {
|
|
|
41
41
|
},
|
|
42
42
|
!1
|
|
43
43
|
), {
|
|
44
|
-
app:
|
|
44
|
+
app: n,
|
|
45
45
|
getConfiguration: () => t.configuration ?? {},
|
|
46
46
|
updateConfiguration: (e) => {
|
|
47
47
|
t.configuration = e;
|
|
@@ -50,5 +50,5 @@ const y = (n, s) => {
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
export {
|
|
53
|
-
|
|
53
|
+
g as createApiReference
|
|
54
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHttpClientStore.d.ts","sourceRoot":"","sources":["../../src/stores/useHttpClientStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHttpClientStore.d.ts","sourceRoot":"","sources":["../../src/stores/useHttpClientStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,KAAK,GAAG,EAAqC,MAAM,KAAK,CAAA;AASjE;;;GAGG;AACH,iBAAS,cAAc,CAAC,MAAM,EAAE,eAAe,UAE9C;AAED;;;GAGG;AACH,iBAAS,cAAc,CAAC,MAAM,EAAE,eAAe,UAM9C;AAYD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,aAAa,CAAC,GAAG,MAAM,EAAE,CAoD5F;AASD,+BAA+B;AAC/B,MAAM,MAAM,eAAe,GAAG;IAAE,SAAS,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAA;AAMxE,iBAAS,oBAAoB,CAAC,UAAU,CAAC,EAAE,eAAe,QAOzD;AAiCD,iBAAS,UAAU,SAElB;AAeD,kEAAkE;AAClE,eAAO,MAAM,kBAAkB;;4BAhEY,QAAQ;4BAAa,MAAM;;;8BAqDrC,OAAO,CAAC,eAAe,CAAC;;qBAiBP,GAAG,CAAC,aAAa,CAAC;4BACxC,aAAa;;;;;;CAaxC,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { REFERENCE_LS_KEYS as E } from "../helpers/local-storage.js";
|
|
1
2
|
import { objectMerge as p } from "@scalar/oas-utils/helpers";
|
|
2
|
-
import { snippetz as
|
|
3
|
-
import { computed as o, readonly as a, ref as
|
|
3
|
+
import { snippetz as m } from "@scalar/snippetz";
|
|
4
|
+
import { computed as o, readonly as a, ref as C, reactive as k } from "vue";
|
|
4
5
|
const y = {
|
|
5
6
|
targetKey: "shell",
|
|
6
7
|
clientKey: "curl"
|
|
7
|
-
}, { clients: A } =
|
|
8
|
-
function
|
|
8
|
+
}, { clients: A } = m();
|
|
9
|
+
function d(t) {
|
|
9
10
|
var n;
|
|
10
11
|
return ((n = r.value.find((e) => e.key === t.targetKey)) == null ? void 0 : n.title) ?? t.targetKey;
|
|
11
12
|
}
|
|
@@ -13,8 +14,8 @@ function K(t) {
|
|
|
13
14
|
var n, e;
|
|
14
15
|
return ((e = (n = r.value.find((i) => i.key === t.targetKey)) == null ? void 0 : n.clients.find((i) => i.client === t.clientKey)) == null ? void 0 : e.title) ?? t.clientKey;
|
|
15
16
|
}
|
|
16
|
-
const H = o(() =>
|
|
17
|
-
function
|
|
17
|
+
const H = o(() => d(l)), S = o(() => K(l));
|
|
18
|
+
function L(t, n) {
|
|
18
19
|
return n.value === !0 ? [] : t.flatMap((e) => {
|
|
19
20
|
var i;
|
|
20
21
|
return typeof n.value != "object" ? [] : Array.isArray(n.value) ? (e.clients = e.clients.filter(
|
|
@@ -24,8 +25,8 @@ function h(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(() =>
|
|
28
|
-
function
|
|
28
|
+
const r = o(() => L(A(), c)), c = C({}), f = C();
|
|
29
|
+
function b(t) {
|
|
29
30
|
t !== void 0 && (f.value = t, T(u()));
|
|
30
31
|
}
|
|
31
32
|
const u = () => {
|
|
@@ -40,30 +41,30 @@ function v(t) {
|
|
|
40
41
|
(n) => n.key === t.targetKey && n.clients.find((e) => e.client === t.clientKey)
|
|
41
42
|
);
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function _() {
|
|
44
45
|
p(l, u());
|
|
45
46
|
}
|
|
46
|
-
const l =
|
|
47
|
+
const l = k(u()), T = (t) => {
|
|
47
48
|
Object.assign(l, {
|
|
48
49
|
...l,
|
|
49
50
|
...t
|
|
50
|
-
});
|
|
51
|
-
},
|
|
51
|
+
}), localStorage.setItem(E.SELECTED_CLIENT, JSON.stringify(l));
|
|
52
|
+
}, D = () => ({
|
|
52
53
|
httpClient: a(l),
|
|
53
|
-
resetState:
|
|
54
|
+
resetState: _,
|
|
54
55
|
setHttpClient: T,
|
|
55
|
-
setDefaultHttpClient:
|
|
56
|
+
setDefaultHttpClient: b,
|
|
56
57
|
excludedClients: a(c),
|
|
57
58
|
setExcludedClients: (t) => {
|
|
58
59
|
c.value = t, p(l, u());
|
|
59
60
|
},
|
|
60
61
|
availableTargets: r,
|
|
61
62
|
getClientTitle: K,
|
|
62
|
-
getTargetTitle:
|
|
63
|
+
getTargetTitle: d,
|
|
63
64
|
httpTargetTitle: H,
|
|
64
|
-
httpClientTitle:
|
|
65
|
+
httpClientTitle: S
|
|
65
66
|
});
|
|
66
67
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
L as filterHiddenClients,
|
|
69
|
+
D as useHttpClientStore
|
|
69
70
|
};
|