@scalar/api-reference 1.33.0 → 1.34.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.
- package/CHANGELOG.md +29 -0
- package/dist/browser/standalone.js +13260 -13196
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Anchor/WithBreadcrumb.vue.d.ts +24 -0
- package/dist/components/Anchor/WithBreadcrumb.vue.d.ts.map +1 -0
- package/dist/components/Anchor/WithBreadcrumb.vue.js +4 -0
- package/dist/components/Anchor/WithBreadcrumb.vue2.js +46 -0
- package/dist/components/Anchor/index.d.ts +1 -0
- package/dist/components/Anchor/index.d.ts.map +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 +184 -201
- package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue2.js +1 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js +34 -32
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +33 -29
- package/dist/components/Content/Operations/get-current-index.d.ts +4 -0
- package/dist/components/Content/Operations/get-current-index.d.ts.map +1 -0
- package/dist/components/Content/Operations/get-current-index.js +16 -0
- package/dist/components/Content/Schema/Schema.preview.d.ts +28 -0
- package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +2 -0
- 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 +164 -157
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +1 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +58 -53
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +1 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +52 -40
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +100 -87
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +3 -3
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +4 -1
- package/dist/components/Lazy/Lazy.vue.d.ts +1 -0
- package/dist/components/Lazy/Lazy.vue.d.ts.map +1 -1
- package/dist/components/Lazy/Lazy.vue2.js +12 -11
- package/dist/components/Lazy/lazyBus.d.ts +5 -3
- package/dist/components/Lazy/lazyBus.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.js +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts +4 -4
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +1 -0
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +49 -43
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +1 -0
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.js +4 -3
- package/dist/features/Operation/components/ParameterHeaders.vue.d.ts +1 -0
- 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/ParameterHeaders.vue2.js +28 -26
- package/dist/features/Operation/components/ParameterList.vue.d.ts +1 -0
- 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/ParameterList.vue2.js +17 -15
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +1 -0
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue2.js +17 -16
- package/dist/features/Operation/components/RequestBody.vue.d.ts +2 -2
- 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 +47 -39
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +1 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +3 -3
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +12 -11
- package/dist/features/Operation/components/callbacks/Callback.vue3.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +63 -61
- package/dist/features/Search/{SearchButton.vue.d.ts → components/SearchButton.vue.d.ts} +0 -2
- package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -0
- package/dist/features/Search/components/SearchButton.vue.js +65 -0
- package/dist/features/Search/{SearchModal.vue.d.ts → components/SearchModal.vue.d.ts} +0 -2
- package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -0
- package/dist/features/Search/components/SearchModal.vue.js +7 -0
- package/dist/features/Search/components/SearchModal.vue2.js +199 -0
- package/dist/features/Search/helpers/create-fuse-instance.d.ts +9 -0
- package/dist/features/Search/helpers/create-fuse-instance.d.ts.map +1 -0
- package/dist/features/Search/helpers/create-fuse-instance.js +46 -0
- package/dist/features/Search/helpers/create-search-index.d.ts +7 -0
- package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -0
- package/dist/features/Search/helpers/create-search-index.js +109 -0
- package/dist/features/Search/hooks/useSearchIndex.d.ts +14 -0
- package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -0
- package/dist/features/Search/hooks/useSearchIndex.js +46 -0
- package/dist/features/Search/index.d.ts +2 -2
- package/dist/features/Search/index.d.ts.map +1 -1
- package/dist/features/Search/types.d.ts +15 -0
- package/dist/features/Search/types.d.ts.map +1 -0
- package/dist/features/api-client-modal/useApiClient.d.ts +14 -14
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +3 -1
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -1
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -1
- package/dist/features/traverse-schema/helpers/traverse-schemas.js +18 -18
- package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +1 -1
- package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +1 -1
- package/dist/features/traverse-schema/types.d.ts +10 -6
- package/dist/features/traverse-schema/types.d.ts.map +1 -1
- package/dist/helpers/test-utils.d.ts +9 -0
- package/dist/helpers/test-utils.d.ts.map +1 -1
- package/dist/hooks/useNavState.d.ts +4 -1
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -19
- package/dist/libs/openapi.d.ts +11 -8
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +34 -55
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +120 -111
- package/dist/v2/helpers/get-document-name.d.ts +13 -0
- package/dist/v2/helpers/get-document-name.d.ts.map +1 -0
- package/dist/v2/helpers/get-document-name.js +15 -0
- package/dist/v2/helpers/normalize-content.d.ts +3 -0
- package/dist/v2/helpers/normalize-content.d.ts.map +1 -0
- package/dist/v2/helpers/normalize-content.js +8 -0
- package/package.json +14 -8
- package/dist/features/Search/SearchButton.vue.d.ts.map +0 -1
- package/dist/features/Search/SearchButton.vue.js +0 -66
- package/dist/features/Search/SearchModal.vue.d.ts.map +0 -1
- package/dist/features/Search/SearchModal.vue.js +0 -7
- package/dist/features/Search/SearchModal.vue2.js +0 -207
- package/dist/features/Search/useSearchIndex.d.ts +0 -32
- package/dist/features/Search/useSearchIndex.d.ts.map +0 -1
- package/dist/features/Search/useSearchIndex.js +0 -170
- package/dist/helpers/parse.d.ts +0 -10
- package/dist/helpers/parse.d.ts.map +0 -1
- package/dist/helpers/parse.js +0 -81
- /package/dist/features/Search/{SearchButton.vue2.js → components/SearchButton.vue2.js} +0 -0
- /package/dist/features/Search/{SearchModal.vue3.js → components/SearchModal.vue3.js} +0 -0
package/dist/libs/openapi.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { OpenAPI, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
+
import type { ParameterObject } from '@scalar/workspace-store/schemas/v3.1/strict/parameter';
|
|
3
|
+
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/path-operations';
|
|
4
|
+
import type { Dereference } from '@scalar/workspace-store/schemas/v3.1/type-guard';
|
|
2
5
|
type PropertyObject = {
|
|
3
6
|
required?: string[];
|
|
4
7
|
properties: {
|
|
@@ -15,7 +18,7 @@ export declare function formatProperty(key: string, obj: PropertyObject): string
|
|
|
15
18
|
/**
|
|
16
19
|
* Extracts the request body from an operation.
|
|
17
20
|
*/
|
|
18
|
-
export declare function extractRequestBody(operation:
|
|
21
|
+
export declare function extractRequestBody(operation: Dereference<OperationObject>): string[] | boolean;
|
|
19
22
|
/**
|
|
20
23
|
* Returns all models from the specification, no matter if it's OpenAPI 3.x.
|
|
21
24
|
*/
|
|
@@ -38,18 +41,18 @@ export declare function deepMerge(source: Record<any, any>, target: Record<any,
|
|
|
38
41
|
*/
|
|
39
42
|
export declare function createEmptySpecification(partialSpecification?: Partial<OpenAPI.Document>): OpenAPI.Document;
|
|
40
43
|
export type ParameterMap = {
|
|
41
|
-
path:
|
|
42
|
-
query:
|
|
43
|
-
header:
|
|
44
|
-
cookie:
|
|
45
|
-
body:
|
|
46
|
-
formData:
|
|
44
|
+
path: ParameterObject[];
|
|
45
|
+
query: ParameterObject[];
|
|
46
|
+
header: ParameterObject[];
|
|
47
|
+
cookie: ParameterObject[];
|
|
48
|
+
body: ParameterObject[];
|
|
49
|
+
formData: ParameterObject[];
|
|
47
50
|
};
|
|
48
51
|
/**
|
|
49
52
|
* This function creates a parameter map from an Operation Object, that's easier to consume.
|
|
50
53
|
*
|
|
51
54
|
* TODO: Isn't it easier to just stick to the OpenAPI structure, without transforming it?
|
|
52
55
|
*/
|
|
53
|
-
export declare function createParameterMap(operation:
|
|
56
|
+
export declare function createParameterMap(operation: Dereference<OperationObject>): ParameterMap;
|
|
54
57
|
export {};
|
|
55
58
|
//# sourceMappingURL=openapi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/libs/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/libs/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAA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AAA;IACzB,IAAI,EAAE,eAAe,EAAE,CAAA;IACvB,QAAQ,EAAE,eAAe,EAAE,CAAA;CAC5B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,WAAW,CAAC,eAAe,CAAC,gBA2DzE"}
|
package/dist/libs/openapi.js
CHANGED
|
@@ -1,58 +1,42 @@
|
|
|
1
1
|
import { isDereferenced as p } from "@scalar/openapi-types/helpers";
|
|
2
|
-
function
|
|
3
|
-
var
|
|
4
|
-
let o =
|
|
5
|
-
const e = (
|
|
6
|
-
return o += e ? " REQUIRED " : " optional ",
|
|
2
|
+
function d(t, i) {
|
|
3
|
+
var s;
|
|
4
|
+
let o = t;
|
|
5
|
+
const e = (s = i.required) == null ? void 0 : s.includes(t);
|
|
6
|
+
return o += e ? " REQUIRED " : " optional ", i.properties[t] && (o += i.properties[t].type, i.properties[t].description && (o += " " + i.properties[t].description)), o;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function h(t) {
|
|
9
9
|
var e;
|
|
10
|
-
const
|
|
11
|
-
return o && Object.keys(o).forEach((
|
|
12
|
-
if (!
|
|
10
|
+
const i = ["Body"], o = (e = t == null ? void 0 : t.schema) == null ? void 0 : e.properties;
|
|
11
|
+
return o && Object.keys(o).forEach((s) => {
|
|
12
|
+
if (!t.schema)
|
|
13
13
|
return;
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
14
|
+
i.push(d(s, t.schema));
|
|
15
|
+
const r = o[s];
|
|
16
|
+
r.type === "object" && !!r.properties && r.properties && Object.keys(r.properties).forEach((n) => {
|
|
17
|
+
var c, f;
|
|
18
|
+
i.push(`${n} ${(f = (c = r.properties) == null ? void 0 : c[n]) == null ? void 0 : f.type}`);
|
|
19
19
|
});
|
|
20
|
-
}),
|
|
20
|
+
}), i;
|
|
21
21
|
}
|
|
22
|
-
function q(
|
|
23
|
-
var
|
|
22
|
+
function q(t) {
|
|
23
|
+
var i, o;
|
|
24
24
|
try {
|
|
25
|
-
const e = (o = (
|
|
25
|
+
const e = (o = (i = t == null ? void 0 : t.requestBody) == null ? void 0 : i.content) == null ? void 0 : o["application/json"];
|
|
26
26
|
if (!e)
|
|
27
27
|
throw new Error("Body not found");
|
|
28
|
-
return
|
|
28
|
+
return h(e);
|
|
29
29
|
} catch {
|
|
30
30
|
return !1;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const s = (
|
|
38
|
-
// OpenAPI 3.x
|
|
39
|
-
Object.keys(((o = i == null ? void 0 : i.components) == null ? void 0 : o.schemas) ?? {}).length ? (e = i == null ? void 0 : i.components) == null ? void 0 : e.schemas : (
|
|
40
|
-
// Fallback
|
|
41
|
-
{}
|
|
42
|
-
)
|
|
43
|
-
);
|
|
44
|
-
return Object.keys(s ?? {}).forEach((n) => {
|
|
45
|
-
var t, r;
|
|
46
|
-
(((t = s[n]) == null ? void 0 : t["x-internal"]) === !0 || ((r = s[n]) == null ? void 0 : r["x-scalar-ignore"]) === !0) && delete s[n];
|
|
47
|
-
}), s;
|
|
33
|
+
function u(t, i) {
|
|
34
|
+
for (const [o, e] of Object.entries(t))
|
|
35
|
+
e !== null && typeof e == "object" ? (i[o] ?? (i[o] = new e.__proto__.constructor()), u(e, i[o])) : typeof e < "u" && (i[o] = e);
|
|
36
|
+
return i;
|
|
48
37
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
e !== null && typeof e == "object" ? (s[o] ?? (s[o] = new e.__proto__.constructor()), h(e, s[o])) : typeof e < "u" && (s[o] = e);
|
|
52
|
-
return s;
|
|
53
|
-
}
|
|
54
|
-
function O(i) {
|
|
55
|
-
return h(i ?? {}, {
|
|
38
|
+
function E(t) {
|
|
39
|
+
return u(t ?? {}, {
|
|
56
40
|
info: {
|
|
57
41
|
title: "",
|
|
58
42
|
description: "",
|
|
@@ -70,28 +54,23 @@ function O(i) {
|
|
|
70
54
|
tags: []
|
|
71
55
|
});
|
|
72
56
|
}
|
|
73
|
-
function
|
|
74
|
-
const
|
|
57
|
+
function O(t) {
|
|
58
|
+
const i = {
|
|
75
59
|
path: [],
|
|
76
60
|
query: [],
|
|
77
61
|
header: [],
|
|
78
62
|
cookie: [],
|
|
79
63
|
body: [],
|
|
80
64
|
formData: []
|
|
81
|
-
};
|
|
82
|
-
i.pathParameters && i.pathParameters.forEach((e) => {
|
|
83
|
-
e.in === "path" ? s.path.push(e) : e.in === "query" ? s.query.push(e) : e.in === "header" ? s.header.push(e) : e.in === "cookie" ? s.cookie.push(e) : e.in === "body" ? s.body.push(e) : e.in === "formData" && s.formData.push(e);
|
|
84
|
-
});
|
|
85
|
-
const o = i.parameters ?? [];
|
|
65
|
+
}, o = t.parameters ?? [];
|
|
86
66
|
return o && o.forEach((e) => {
|
|
87
|
-
p(e) && (e.in === "path" ?
|
|
88
|
-
}),
|
|
67
|
+
p(e) && (typeof e == "object" && e !== null && "$ref" in e || (e.in === "path" ? i.path.push(e) : e.in === "query" ? i.query.push(e) : e.in === "header" ? i.header.push(e) : e.in === "cookie" ? i.cookie.push(e) : e.in === "body" ? i.body.push(e) : e.in === "formData" && i.formData.push(e)));
|
|
68
|
+
}), i;
|
|
89
69
|
}
|
|
90
70
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
71
|
+
E as createEmptySpecification,
|
|
72
|
+
O as createParameterMap,
|
|
73
|
+
u as deepMerge,
|
|
94
74
|
q as extractRequestBody,
|
|
95
|
-
|
|
96
|
-
E as getModels
|
|
75
|
+
d as formatProperty
|
|
97
76
|
};
|