@scalar/api-reference 1.34.1 → 1.34.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 +99 -0
- package/README.md +1 -1
- package/dist/browser/standalone.js +13121 -12730
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Badge/Badge.vue.d.ts +4 -1
- package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
- package/dist/components/Badge/Badge.vue.js +5 -11
- package/dist/components/Badge/Badge.vue2.js +22 -2
- package/dist/components/Badge/Badge.vue3.js +4 -0
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +30 -31
- package/dist/components/Content/Models/ModernLayout.vue.d.ts +2 -0
- package/dist/components/Content/Models/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModernLayout.vue.js +2 -2
- package/dist/components/Content/Models/ModernLayout.vue2.js +39 -37
- package/dist/components/Content/Operations/TraversedEntry.vue.js +12 -12
- package/dist/components/Content/Tags/TagSection.vue.js +6 -6
- package/dist/components/GettingStarted.vue.js +3 -3
- package/dist/components/GettingStarted.vue2.js +21 -21
- package/dist/components/MobileHeader.vue.d.ts.map +1 -1
- package/dist/components/MobileHeader.vue.js +3 -3
- package/dist/components/Section/CompactSection.vue.d.ts +2 -0
- package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
- package/dist/components/Section/CompactSection.vue.js +1 -1
- package/dist/components/Section/CompactSection.vue2.js +30 -29
- package/dist/features/Operation/Operation.vue.d.ts +2 -1
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +53 -52
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +1 -2
- 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.vue3.js +2 -2
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js +16 -16
- package/dist/features/Operation/helpers/combine-params.d.ts +5 -0
- package/dist/features/Operation/helpers/combine-params.d.ts.map +1 -0
- package/dist/features/Operation/helpers/combine-params.js +13 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +3 -4
- 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 +59 -50
- package/dist/features/Operation/layouts/ClassicLayout.vue3.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +3 -4
- 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 +94 -78
- package/dist/features/Search/helpers/create-fuse-instance.d.ts.map +1 -1
- package/dist/features/Search/helpers/create-fuse-instance.js +0 -3
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/api-client-modal/ApiClientModal.vue.js +51 -48
- package/dist/features/api-client-modal/useApiClient.d.ts +100 -100
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/document-source/hooks/useDocumentFetcher.d.ts.map +1 -1
- package/dist/features/document-source/hooks/useDocumentFetcher.js +16 -18
- package/dist/features/document-source/hooks/useDocumentSource.d.ts.map +1 -1
- package/dist/features/document-source/hooks/useDocumentSource.js +30 -33
- package/dist/features/example-responses/ExampleResponse.vue.d.ts +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +2 -2
- package/dist/features/example-responses/ExampleResponse.vue2.js +15 -13
- package/dist/features/example-responses/ExampleResponses.vue.d.ts +2 -3
- 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/example-responses/ExampleResponses.vue2.js +73 -69
- package/dist/features/example-responses/helpers/get-resolved-ref-deep.d.ts +26 -0
- package/dist/features/example-responses/helpers/get-resolved-ref-deep.d.ts.map +1 -0
- package/dist/features/example-responses/helpers/get-resolved-ref-deep.js +29 -0
- 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 +6 -6
- package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +1 -1
- package/dist/features/sidebar/helpers/create-sidebar.js +13 -14
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +1 -2
- 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-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 +11 -12
- package/dist/features/traverse-schema/types.d.ts.map +1 -1
- package/dist/features/x-badges/XBadges.vue.d.ts +8 -0
- package/dist/features/x-badges/XBadges.vue.d.ts.map +1 -0
- package/dist/features/x-badges/XBadges.vue.js +26 -0
- package/dist/features/x-badges/XBadges.vue2.js +4 -0
- package/dist/features/x-badges/index.d.ts +2 -0
- package/dist/features/x-badges/index.d.ts.map +1 -0
- package/dist/helpers/test-utils.d.ts +1 -1
- package/dist/helpers/test-utils.d.ts.map +1 -1
- package/dist/hooks/useNavState.d.ts +1 -2
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/libs/openapi.d.ts +4 -14
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +55 -36
- package/dist/style.css +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +64 -64
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +1 -2
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.js +2 -2
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue2.js +97 -100
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.d.ts +1 -2
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.js +17 -20
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts.map +1 -1
- package/dist/v2/helpers/map-configuration.d.ts +66 -0
- package/dist/v2/helpers/map-configuration.d.ts.map +1 -0
- package/dist/v2/helpers/map-configuration.js +53 -0
- package/dist/vitest.setup.d.ts +2 -0
- package/dist/vitest.setup.d.ts.map +1 -0
- package/package.json +24 -20
package/dist/libs/openapi.d.ts
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
import type { OpenAPI, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
2
|
import type { ParameterObject } from '@scalar/workspace-store/schemas/v3.1/strict/parameter';
|
|
3
3
|
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/path-operations';
|
|
4
|
-
import type {
|
|
5
|
-
type PropertyObject = {
|
|
6
|
-
required?: string[];
|
|
7
|
-
properties: {
|
|
8
|
-
[key: string]: {
|
|
9
|
-
type: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
4
|
+
import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema';
|
|
14
5
|
/**
|
|
15
6
|
* Formats a property object into a string.
|
|
16
7
|
*/
|
|
17
|
-
export declare function formatProperty(key: string, obj:
|
|
8
|
+
export declare function formatProperty(key: string, obj: SchemaObject): string;
|
|
18
9
|
/**
|
|
19
10
|
* Extracts the request body from an operation.
|
|
20
11
|
*/
|
|
21
|
-
export declare function extractRequestBody(operation:
|
|
12
|
+
export declare function extractRequestBody(operation: OperationObject): string[] | boolean;
|
|
22
13
|
/**
|
|
23
14
|
* Returns all models from the specification, no matter if it's OpenAPI 3.x.
|
|
24
15
|
*/
|
|
@@ -53,6 +44,5 @@ export type ParameterMap = {
|
|
|
53
44
|
*
|
|
54
45
|
* TODO: Isn't it easier to just stick to the OpenAPI structure, without transforming it?
|
|
55
46
|
*/
|
|
56
|
-
export declare function createParameterMap(operation:
|
|
57
|
-
export {};
|
|
47
|
+
export declare function createParameterMap(operation: OperationObject): ParameterMap;
|
|
58
48
|
//# 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;AAGjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6DAA6D,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,CAAA;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAA;AAGlG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AAEtF;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,MAAM,CAerE;AA+BD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,eAAe,GAAG,MAAM,EAAE,GAAG,OAAO,CAYjF;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,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,eAAe,EAAE,CAAA;IACvB,KAAK,EAAE,eAAe,EAAE,CAAA;IACxB,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,IAAI,EAAE,eAAe,EAAE,CAAA;IACvB,QAAQ,EAAE,eAAe,EAAE,CAAA;CAC5B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,eAAe,gBA2D5D"}
|
package/dist/libs/openapi.js
CHANGED
|
@@ -1,42 +1,60 @@
|
|
|
1
|
-
import { isDereferenced as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { isDereferenced as h } from "@scalar/openapi-types/helpers";
|
|
2
|
+
import { getResolvedRef as c } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
+
function d(i, s) {
|
|
4
|
+
var r, n;
|
|
5
|
+
let o = i;
|
|
6
|
+
const e = (r = s.required) == null ? void 0 : r.includes(i);
|
|
7
|
+
o += e ? " REQUIRED " : " optional ";
|
|
8
|
+
const t = c((n = s.properties) == null ? void 0 : n[i]);
|
|
9
|
+
return t && (o += t.type, t.description && (o += " " + t.description)), o;
|
|
7
10
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (!t.schema)
|
|
11
|
+
function y(i) {
|
|
12
|
+
const s = ["Body"], o = c(i == null ? void 0 : i.schema), e = o == null ? void 0 : o.properties;
|
|
13
|
+
return e && Object.keys(e).forEach((t) => {
|
|
14
|
+
if (!i.schema)
|
|
13
15
|
return;
|
|
14
|
-
|
|
15
|
-
const r =
|
|
16
|
-
r.type === "object" && !!r.properties && r.properties && Object.keys(r.properties).forEach((
|
|
17
|
-
var
|
|
18
|
-
|
|
16
|
+
s.push(d(t, o));
|
|
17
|
+
const r = c(e[t]);
|
|
18
|
+
r.type === "object" && !!r.properties && r.properties && Object.keys(r.properties).forEach((f) => {
|
|
19
|
+
var p, u;
|
|
20
|
+
s.push(`${f} ${(u = c((p = r.properties) == null ? void 0 : p[f])) == null ? void 0 : u.type}`);
|
|
19
21
|
});
|
|
20
|
-
}),
|
|
22
|
+
}), s;
|
|
21
23
|
}
|
|
22
|
-
function q(
|
|
23
|
-
var
|
|
24
|
+
function q(i) {
|
|
25
|
+
var s, o;
|
|
24
26
|
try {
|
|
25
|
-
const e = (o = (
|
|
27
|
+
const e = (o = (s = c(i == null ? void 0 : i.requestBody)) == null ? void 0 : s.content) == null ? void 0 : o["application/json"];
|
|
26
28
|
if (!e)
|
|
27
29
|
throw new Error("Body not found");
|
|
28
|
-
return
|
|
30
|
+
return y(e);
|
|
29
31
|
} catch {
|
|
30
32
|
return !1;
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
function a(i) {
|
|
36
|
+
var o, e;
|
|
37
|
+
if (!i)
|
|
38
|
+
return {};
|
|
39
|
+
const s = (
|
|
40
|
+
// OpenAPI 3.x
|
|
41
|
+
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 : (
|
|
42
|
+
// Fallback
|
|
43
|
+
{}
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
return Object.keys(s ?? {}).forEach((t) => {
|
|
47
|
+
var r, n;
|
|
48
|
+
(((r = s[t]) == null ? void 0 : r["x-internal"]) === !0 || ((n = s[t]) == null ? void 0 : n["x-scalar-ignore"]) === !0) && delete s[t];
|
|
49
|
+
}), s;
|
|
37
50
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
51
|
+
function l(i, s) {
|
|
52
|
+
for (const [o, e] of Object.entries(i))
|
|
53
|
+
e !== null && typeof e == "object" ? (s[o] ?? (s[o] = new e.__proto__.constructor()), l(e, s[o])) : typeof e < "u" && (s[o] = e);
|
|
54
|
+
return s;
|
|
55
|
+
}
|
|
56
|
+
function b(i) {
|
|
57
|
+
return l(i ?? {}, {
|
|
40
58
|
info: {
|
|
41
59
|
title: "",
|
|
42
60
|
description: "",
|
|
@@ -54,23 +72,24 @@ function E(t) {
|
|
|
54
72
|
tags: []
|
|
55
73
|
});
|
|
56
74
|
}
|
|
57
|
-
function
|
|
58
|
-
const
|
|
75
|
+
function v(i) {
|
|
76
|
+
const s = {
|
|
59
77
|
path: [],
|
|
60
78
|
query: [],
|
|
61
79
|
header: [],
|
|
62
80
|
cookie: [],
|
|
63
81
|
body: [],
|
|
64
82
|
formData: []
|
|
65
|
-
}, o =
|
|
83
|
+
}, o = i.parameters ?? [];
|
|
66
84
|
return o && o.forEach((e) => {
|
|
67
|
-
|
|
68
|
-
}),
|
|
85
|
+
h(e) && (typeof e == "object" && e !== null && "$ref" in e || (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)));
|
|
86
|
+
}), s;
|
|
69
87
|
}
|
|
70
88
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
89
|
+
b as createEmptySpecification,
|
|
90
|
+
v as createParameterMap,
|
|
91
|
+
l as deepMerge,
|
|
74
92
|
q as extractRequestBody,
|
|
75
|
-
d as formatProperty
|
|
93
|
+
d as formatProperty,
|
|
94
|
+
a as getModels
|
|
76
95
|
};
|