@scalar/api-reference 1.32.0 → 1.32.4
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 +83 -0
- package/README.md +1 -1
- package/dist/browser/standalone.js +15732 -15435
- 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 +163 -158
- package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/Card/CardHeader.vue.d.ts.map +1 -1
- package/dist/components/Card/CardHeader.vue.js +2 -2
- package/dist/components/Card/CardTab.vue.d.ts.map +1 -1
- package/dist/components/Card/CardTab.vue.js +3 -3
- package/dist/components/Card/CardTabHeader.vue.d.ts.map +1 -1
- package/dist/components/Card/CardTabHeader.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
- package/dist/components/Content/Lazy/Loading.vue.d.ts +1 -3
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +92 -91
- 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 +59 -56
- package/dist/components/Content/Schema/RenderString.vue.d.ts +6 -0
- package/dist/components/Content/Schema/RenderString.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/RenderString.vue.js +14 -0
- package/dist/components/Content/Schema/RenderString.vue2.js +4 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts +1 -1
- 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 +76 -75
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +58 -66
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts +19 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +125 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +2 -2
- 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 +96 -170
- package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts +18 -0
- package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +155 -160
- package/dist/components/Content/Schema/helpers/get-schema-type.d.ts +6 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.js +20 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +1 -1
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js +20 -46
- package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
- 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 +13 -13
- package/dist/features/Search/SearchButton.vue.d.ts +1 -0
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +36 -34
- package/dist/features/Search/SearchModal.vue.d.ts +1 -0
- package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchModal.vue.js +1 -1
- package/dist/features/Search/SearchModal.vue2.js +112 -112
- package/dist/features/Search/useSearchIndex.d.ts +4 -3
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +119 -82
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts +2 -2
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/api-client-modal/ApiClientModal.vue.js +47 -38
- package/dist/features/api-client-modal/useApiClient.d.ts +334 -334
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/base-url/BaseUrl.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +3 -3
- package/dist/features/example-responses/ExampleResponse.vue2.js +7 -7
- package/dist/features/example-responses/ExampleResponses.vue.d.ts +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
- package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue.js +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue2.js +23 -21
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +2 -2
- package/dist/features/sidebar/components/SidebarHttpBadge.vue2.js +5 -6
- package/dist/features/test-request-button/TestRequestButton.vue.js +2 -2
- package/dist/features/traverse-schema/helpers/traverse-tags.js +26 -26
- package/dist/features/traverse-schema/index.d.ts +1 -1
- package/dist/features/traverse-schema/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/libs/openapi.d.ts +15 -1
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +66 -47
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/stores/useHttpClientStore.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +2 -2
- package/package.json +18 -18
- package/dist/hooks/useOperation.d.ts +0 -16
- package/dist/hooks/useOperation.d.ts.map +0 -1
- package/dist/hooks/useOperation.js +0 -27
package/dist/libs/openapi.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare function formatProperty(key: string, obj: PropertyObject): string
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function extractRequestBody(operation: OpenAPIV3_1.OperationObject): string[] | boolean;
|
|
20
20
|
/**
|
|
21
|
-
* Returns all models from the specification, no matter if it
|
|
21
|
+
* Returns all models from the specification, no matter if it's OpenAPI 3.x.
|
|
22
22
|
*/
|
|
23
23
|
export declare function getModels(document?: OpenAPIV3_1.Document): Record<string, OpenAPIV3_1.SchemaObject>;
|
|
24
24
|
/**
|
|
@@ -50,5 +50,19 @@ export declare function getOperationStability(operation: OpenAPIV3_1.OperationOb
|
|
|
50
50
|
* Get Operation stability color
|
|
51
51
|
*/
|
|
52
52
|
export declare function getOperationStabilityColor(operation: OpenAPIV3_1.OperationObject): string;
|
|
53
|
+
export type ParameterMap = {
|
|
54
|
+
path: OpenAPIV3_1.ParameterObject[];
|
|
55
|
+
query: OpenAPIV3_1.ParameterObject[];
|
|
56
|
+
header: OpenAPIV3_1.ParameterObject[];
|
|
57
|
+
cookie: OpenAPIV3_1.ParameterObject[];
|
|
58
|
+
body: OpenAPIV3_1.ParameterObject[];
|
|
59
|
+
formData: OpenAPIV3_1.ParameterObject[];
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* This function creates a parameter map from an Operation Object, that's easier to consume.
|
|
63
|
+
*
|
|
64
|
+
* TODO: Isn't it easier to just stick to the OpenAPI structure, without transforming it?
|
|
65
|
+
*/
|
|
66
|
+
export declare function createParameterMap(operation: OpenAPIV3_1.OperationObject): ParameterMap;
|
|
53
67
|
export {};
|
|
54
68
|
//# 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;AAEjE,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,WAAW,CAAC,eAAe,GAAG,MAAM,EAAE,GAAG,OAAO,CAY7F;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,QAAQ,4CAsBxD;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,aAAc,WAAW,CAAC,QAAQ,YAUvD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,cAAe,WAAW,CAAC,QAAQ,YAU1D,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,OAAO,CAAC,QAAQ,CACvB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,WAAW,CAAC,eAAe,GAAG,OAAO,CAQrF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,WAAW,CAAC,eAAe,GAAG,gBAAgB,GAAG,SAAS,CAK1G;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,WAAW,CAAC,eAAe,GAAG,MAAM,CAYzF;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,WAAW,CAAC,eAAe,EAAE,CAAA;IACnC,KAAK,EAAE,WAAW,CAAC,eAAe,EAAE,CAAA;IACpC,MAAM,EAAE,WAAW,CAAC,eAAe,EAAE,CAAA;IACrC,MAAM,EAAE,WAAW,CAAC,eAAe,EAAE,CAAA;IACrC,IAAI,EAAE,WAAW,CAAC,eAAe,EAAE,CAAA;IACnC,QAAQ,EAAE,WAAW,CAAC,eAAe,EAAE,CAAA;CACxC,CAAA;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,WAAW,CAAC,eAAe,gBAqDxE"}
|
package/dist/libs/openapi.js
CHANGED
|
@@ -1,58 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { isDereferenced as h } from "@scalar/openapi-types/helpers";
|
|
2
|
+
import { XScalarStability as o } from "@scalar/types/legacy";
|
|
3
|
+
function d(t, i) {
|
|
4
|
+
var r;
|
|
5
|
+
let s = t;
|
|
6
|
+
const e = (r = i.required) == null ? void 0 : r.includes(t);
|
|
7
|
+
return s += e ? " REQUIRED " : " optional ", i.properties[t] && (s += i.properties[t].type, i.properties[t].description && (s += " " + i.properties[t].description)), s;
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
if (!
|
|
9
|
+
function a(t) {
|
|
10
|
+
var e;
|
|
11
|
+
const i = ["Body"], s = (e = t == null ? void 0 : t.schema) == null ? void 0 : e.properties;
|
|
12
|
+
return s && Object.keys(s).forEach((r) => {
|
|
13
|
+
if (!t.schema)
|
|
13
14
|
return;
|
|
14
|
-
|
|
15
|
-
const n =
|
|
16
|
-
n.type === "object" && !!n.properties && n.properties && Object.keys(n.properties).forEach((
|
|
17
|
-
var
|
|
18
|
-
|
|
15
|
+
i.push(d(r, t.schema));
|
|
16
|
+
const n = s[r];
|
|
17
|
+
n.type === "object" && !!n.properties && n.properties && Object.keys(n.properties).forEach((f) => {
|
|
18
|
+
var u, p;
|
|
19
|
+
i.push(`${f} ${(p = (u = n.properties) == null ? void 0 : u[f]) == null ? void 0 : p.type}`);
|
|
19
20
|
});
|
|
20
|
-
}),
|
|
21
|
+
}), i;
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
var
|
|
23
|
+
function D(t) {
|
|
24
|
+
var i, s;
|
|
24
25
|
try {
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
26
|
+
const e = (s = (i = t == null ? void 0 : t.requestBody) == null ? void 0 : i.content) == null ? void 0 : s["application/json"];
|
|
27
|
+
if (!e)
|
|
27
28
|
throw new Error("Body not found");
|
|
28
|
-
return
|
|
29
|
+
return a(e);
|
|
29
30
|
} catch {
|
|
30
31
|
return !1;
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
function O(
|
|
34
|
-
var
|
|
35
|
-
if (!
|
|
34
|
+
function O(t) {
|
|
35
|
+
var s, e;
|
|
36
|
+
if (!t)
|
|
36
37
|
return {};
|
|
37
|
-
const
|
|
38
|
+
const i = (
|
|
38
39
|
// OpenAPI 3.x
|
|
39
|
-
Object.keys(((
|
|
40
|
+
Object.keys(((s = t == null ? void 0 : t.components) == null ? void 0 : s.schemas) ?? {}).length ? (e = t == null ? void 0 : t.components) == null ? void 0 : e.schemas : (
|
|
40
41
|
// Fallback
|
|
41
42
|
{}
|
|
42
43
|
)
|
|
43
44
|
);
|
|
44
|
-
return Object.keys(
|
|
45
|
-
var n,
|
|
46
|
-
(((n = r
|
|
47
|
-
}),
|
|
45
|
+
return Object.keys(i ?? {}).forEach((r) => {
|
|
46
|
+
var n, c;
|
|
47
|
+
(((n = i[r]) == null ? void 0 : n["x-internal"]) === !0 || ((c = i[r]) == null ? void 0 : c["x-scalar-ignore"]) === !0) && delete i[r];
|
|
48
|
+
}), i;
|
|
48
49
|
}
|
|
49
|
-
function l(
|
|
50
|
-
for (const [
|
|
51
|
-
|
|
52
|
-
return
|
|
50
|
+
function l(t, i) {
|
|
51
|
+
for (const [s, e] of Object.entries(t))
|
|
52
|
+
e !== null && typeof e == "object" ? (i[s] ?? (i[s] = new e.__proto__.constructor()), l(e, i[s])) : typeof e < "u" && (i[s] = e);
|
|
53
|
+
return i;
|
|
53
54
|
}
|
|
54
|
-
function E(
|
|
55
|
-
return l(
|
|
55
|
+
function E(t) {
|
|
56
|
+
return l(t ?? {}, {
|
|
56
57
|
info: {
|
|
57
58
|
title: "",
|
|
58
59
|
description: "",
|
|
@@ -70,23 +71,41 @@ function E(e) {
|
|
|
70
71
|
tags: []
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
-
return
|
|
74
|
+
function q(t) {
|
|
75
|
+
return t.deprecated !== void 0 ? t.deprecated : !!(t["x-scalar-stability"] && t["x-scalar-stability"] === o.Deprecated);
|
|
75
76
|
}
|
|
76
|
-
function y(
|
|
77
|
-
return
|
|
77
|
+
function y(t) {
|
|
78
|
+
return t.deprecated ? o.Deprecated : t["x-scalar-stability"];
|
|
78
79
|
}
|
|
79
|
-
function S(
|
|
80
|
-
const
|
|
81
|
-
return
|
|
80
|
+
function S(t) {
|
|
81
|
+
const i = y(t);
|
|
82
|
+
return i === o.Deprecated ? "text-red" : i === o.Experimental ? "text-orange" : i === o.Stable ? "text-green" : "";
|
|
83
|
+
}
|
|
84
|
+
function v(t) {
|
|
85
|
+
const i = {
|
|
86
|
+
path: [],
|
|
87
|
+
query: [],
|
|
88
|
+
header: [],
|
|
89
|
+
cookie: [],
|
|
90
|
+
body: [],
|
|
91
|
+
formData: []
|
|
92
|
+
};
|
|
93
|
+
t.pathParameters && t.pathParameters.forEach((e) => {
|
|
94
|
+
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);
|
|
95
|
+
});
|
|
96
|
+
const s = t.parameters ?? [];
|
|
97
|
+
return s && s.forEach((e) => {
|
|
98
|
+
h(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));
|
|
99
|
+
}), i;
|
|
82
100
|
}
|
|
83
101
|
export {
|
|
84
102
|
E as createEmptySpecification,
|
|
103
|
+
v as createParameterMap,
|
|
85
104
|
l as deepMerge,
|
|
86
|
-
|
|
87
|
-
|
|
105
|
+
D as extractRequestBody,
|
|
106
|
+
d as formatProperty,
|
|
88
107
|
O as getModels,
|
|
89
108
|
y as getOperationStability,
|
|
90
109
|
S as getOperationStabilityColor,
|
|
91
|
-
|
|
110
|
+
q as isOperationDeprecated
|
|
92
111
|
};
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"html-api.d.ts","sourceRoot":"","sources":["../../../src/standalone/lib/html-api.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EAExB,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"}
|
|
@@ -19,9 +19,9 @@ function b(t, n) {
|
|
|
19
19
|
return n.value === !0 ? [] : t.flatMap((e) => {
|
|
20
20
|
var i;
|
|
21
21
|
return typeof n.value != "object" ? [] : Array.isArray(n.value) ? (e.clients = e.clients.filter(
|
|
22
|
-
// @ts-expect-error Typescript, chill. It
|
|
22
|
+
// @ts-expect-error Typescript, chill. It's all good. It has to be an array.
|
|
23
23
|
(s) => !n.value.includes(s.client)
|
|
24
|
-
), e.clients.length ? [e] : []) : n.value[e.key] === !0 ? [] : (Array.isArray(n.value[e.key]) && (e.clients = e.clients.filter((s) => !// @ts-expect-error We checked whether it
|
|
24
|
+
), e.clients.length ? [e] : []) : n.value[e.key] === !0 ? [] : (Array.isArray(n.value[e.key]) && (e.clients = e.clients.filter((s) => !// @ts-expect-error We checked whether it's an Array already.
|
|
25
25
|
n.value[e.key].includes(s.client))), (i = e == null ? void 0 : e.clients) != null && i.length ? [e] : []);
|
|
26
26
|
});
|
|
27
27
|
}
|