@scalar/api-reference 1.28.33 → 1.28.34
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 +28 -0
- package/dist/browser/standalone.js +6779 -6794
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
- package/dist/components/Anchor/Anchor.vue.js +2 -2
- package/dist/components/Anchor/Anchor.vue2.js +24 -22
- package/dist/components/ApiReferenceLayout.vue.d.ts +2 -2
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +50 -50
- 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 +5 -5
- package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.d.ts +1 -1
- package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +2 -2
- package/dist/components/Content/Content.vue2.js +31 -32
- package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue2.js +21 -21
- package/dist/components/Content/Lazy/Loading.vue.js +22 -22
- 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 +17 -17
- 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/Models/ModelsAccordion.vue2.js +14 -14
- package/dist/components/Content/Schema/Schema.preview.d.ts +98 -15
- package/dist/components/Content/Schema/Schema.preview.d.ts.map +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 +2 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +99 -5
- package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +2 -165
- 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 +27 -26
- 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/helpers/merge-all-of-schemas.d.ts +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +50 -40
- package/dist/components/Content/Tag/OperationsListItem.vue.js +1 -1
- package/dist/components/Content/Tag/OperationsListItem.vue2.js +1 -1
- package/dist/components/Content/Tag/TagAccordion.vue.js +2 -2
- package/dist/components/Content/Tag/TagAccordion.vue2.js +10 -10
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +8 -8
- package/dist/components/Content/Tag/TagSection.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagSection.vue.js +2 -2
- package/dist/components/Content/Tag/TagSection.vue2.js +8 -8
- package/dist/components/GettingStarted.vue.d.ts +2 -2
- package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ModernLayout.vue.js +2 -2
- package/dist/components/Layouts/ModernLayout.vue2.js +4 -4
- package/dist/components/MobileHeader.vue.js +3 -3
- package/dist/components/Section/CompactSection.vue.js +2 -2
- package/dist/components/Section/CompactSection.vue2.js +4 -4
- package/dist/components/Section/Section.vue.d.ts.map +1 -1
- package/dist/components/Section/Section.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
- package/dist/components/ShowMoreButton.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue.d.ts +1 -1
- 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 +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarElement.vue2.js +6 -6
- package/dist/components/SingleApiReference.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +3 -3
- package/dist/features/ApiClientModal/index.d.ts +1 -1
- package/dist/features/ApiClientModal/index.d.ts.map +1 -1
- package/dist/features/ApiClientModal/useApiClient.d.ts +42 -42
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- 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 +17 -17
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +12 -12
- package/dist/features/Operation/Webhooks.vue.d.ts.map +1 -1
- package/dist/features/Operation/Webhooks.vue.js +2 -2
- package/dist/features/Operation/Webhooks.vue2.js +13 -13
- 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 +18 -18
- 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 +38 -32
- package/dist/features/Operation/hooks/useResponses.d.ts +1 -0
- package/dist/features/Operation/hooks/useResponses.d.ts.map +1 -1
- package/dist/features/Operation/hooks/useResponses.js +13 -12
- 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 +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +1 -1
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/features/Search/SearchButton.vue2.js +1 -1
- package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchModal.vue.js +2 -2
- package/dist/features/Search/SearchModal.vue2.js +1 -1
- package/dist/features/Search/useSearchIndex.d.ts +1 -1
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +20 -21
- package/dist/helpers/{isMacOs.d.ts → is-mac-os.d.ts} +1 -1
- package/dist/helpers/is-mac-os.d.ts.map +1 -0
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +1 -1
- package/dist/helpers/{scrollToId.d.ts → scroll-to-id.d.ts} +1 -1
- package/dist/helpers/scroll-to-id.d.ts.map +1 -0
- package/dist/helpers/sleep.d.ts +0 -2
- package/dist/helpers/sleep.d.ts.map +1 -1
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +28 -28
- package/dist/hooks/useReactiveSpec.js +1 -1
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +45 -49
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -28
- package/dist/legacy/fixtures/index.d.ts +1 -1
- package/dist/legacy/fixtures/index.d.ts.map +1 -1
- package/dist/legacy/helpers/index.d.ts +1 -1
- package/dist/legacy/helpers/index.d.ts.map +1 -1
- package/dist/libs/download.d.ts +9 -0
- package/dist/libs/download.d.ts.map +1 -0
- package/dist/libs/download.js +19 -0
- package/dist/{helpers/getLowestHeadingLevel.d.ts → libs/markdown.d.ts} +5 -1
- package/dist/libs/markdown.d.ts.map +1 -0
- package/dist/libs/markdown.js +18 -0
- package/dist/libs/openapi.d.ts +56 -0
- package/dist/libs/openapi.d.ts.map +1 -0
- package/dist/libs/openapi.js +102 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -45
- package/dist/types.d.ts.map +1 -1
- package/package.json +16 -21
- package/dist/esm.js +0 -34
- package/dist/helpers/createEmptySpecification.d.ts +0 -8
- package/dist/helpers/createEmptySpecification.d.ts.map +0 -1
- package/dist/helpers/createEmptySpecification.js +0 -27
- package/dist/helpers/deepMerge.d.ts +0 -5
- package/dist/helpers/deepMerge.d.ts.map +0 -1
- package/dist/helpers/deepMerge.js +0 -8
- package/dist/helpers/generateParameters.d.ts +0 -6
- package/dist/helpers/generateParameters.d.ts.map +0 -1
- package/dist/helpers/get-request.d.ts +0 -59
- package/dist/helpers/get-request.d.ts.map +0 -1
- package/dist/helpers/getHeadingsFromMarkdown.d.ts +0 -6
- package/dist/helpers/getHeadingsFromMarkdown.d.ts.map +0 -1
- package/dist/helpers/getHeadingsFromMarkdown.js +0 -13
- package/dist/helpers/getLowestHeadingLevel.d.ts.map +0 -1
- package/dist/helpers/getLowestHeadingLevel.js +0 -7
- package/dist/helpers/getModels.d.ts +0 -7
- package/dist/helpers/getModels.d.ts.map +0 -1
- package/dist/helpers/getModels.js +0 -22
- package/dist/helpers/getVariableNames.d.ts +0 -5
- package/dist/helpers/getVariableNames.d.ts.map +0 -1
- package/dist/helpers/hasModels.d.ts +0 -3
- package/dist/helpers/hasModels.d.ts.map +0 -1
- package/dist/helpers/hasModels.js +0 -5
- package/dist/helpers/hasSecuritySchemes.d.ts +0 -3
- package/dist/helpers/hasSecuritySchemes.d.ts.map +0 -1
- package/dist/helpers/hasWebhooks.d.ts +0 -3
- package/dist/helpers/hasWebhooks.d.ts.map +0 -1
- package/dist/helpers/hasWebhooks.js +0 -4
- package/dist/helpers/index.d.ts +0 -17
- package/dist/helpers/index.d.ts.map +0 -1
- package/dist/helpers/isMacOs.d.ts.map +0 -1
- package/dist/helpers/mapFromObject.d.ts +0 -8
- package/dist/helpers/mapFromObject.d.ts.map +0 -1
- package/dist/helpers/mergeAllObjects.d.ts +0 -5
- package/dist/helpers/mergeAllObjects.d.ts.map +0 -1
- package/dist/helpers/scrollToId.d.ts.map +0 -1
- package/dist/helpers/specDownloads.d.ts +0 -7
- package/dist/helpers/specDownloads.d.ts.map +0 -1
- package/dist/helpers/specDownloads.js +0 -19
- package/dist/helpers/specHelpers.d.ts +0 -16
- package/dist/helpers/specHelpers.d.ts.map +0 -1
- package/dist/helpers/specHelpers.js +0 -36
- package/dist/helpers/waitFor.d.ts +0 -5
- package/dist/helpers/waitFor.d.ts.map +0 -1
- package/dist/hooks/index.d.ts +0 -5
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/legacy/helpers/encodeStringAsBase64.d.ts +0 -5
- package/dist/legacy/helpers/encodeStringAsBase64.d.ts.map +0 -1
- package/dist/legacy/index.d.ts +0 -5
- package/dist/legacy/index.d.ts.map +0 -1
- package/dist/legacy/types.d.ts +0 -94
- package/dist/legacy/types.d.ts.map +0 -1
- package/dist/libs/operation.d.ts +0 -15
- package/dist/libs/operation.d.ts.map +0 -1
- package/dist/libs/operation.js +0 -16
- package/dist/stores/index.d.ts +0 -2
- package/dist/stores/index.d.ts.map +0 -1
- /package/dist/helpers/{isMacOs.js → is-mac-os.js} +0 -0
- /package/dist/helpers/{scrollToId.js → scroll-to-id.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { validRequestMethods, type RequestMethod, requestMethodColors, requestMethodAbbreviations, } from './httpRequestMethods.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/legacy/fixtures/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/legacy/fixtures/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAClB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { normalizeRequestMethod } from './normalizeRequestMethod.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/legacy/helpers/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/legacy/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const downloadEventBus: import("@vueuse/core").UseEventBusReturn<{
|
|
2
|
+
id: string;
|
|
3
|
+
filename?: string;
|
|
4
|
+
}, any>;
|
|
5
|
+
/**
|
|
6
|
+
* Trigger the download of the OpenAPI document
|
|
7
|
+
*/
|
|
8
|
+
export declare function downloadDocument(content: string, filename?: string): void;
|
|
9
|
+
//# sourceMappingURL=download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/libs/download.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB;QADgB,MAAM;eAAa,MAAM;OACN,CAAA;AAEhE;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,QAkClE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isJsonString as d } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { useEventBus as m } from "@vueuse/core";
|
|
3
|
+
const r = Symbol("download"), p = m(r);
|
|
4
|
+
function b(e, n) {
|
|
5
|
+
const t = d(e), c = t ? new Blob([e], { type: "application/json" }) : new Blob([e], { type: "application/x-yaml" }), s = URL.createObjectURL(c), a = t ? ".json" : ".yaml", l = "openapi" + a, i = n ? n + a : l, o = document.createElement("a");
|
|
6
|
+
o.href = s, o.download = i, o.dispatchEvent(
|
|
7
|
+
new MouseEvent("click", {
|
|
8
|
+
bubbles: !0,
|
|
9
|
+
cancelable: !0,
|
|
10
|
+
view: window
|
|
11
|
+
})
|
|
12
|
+
), setTimeout(() => {
|
|
13
|
+
window.URL.revokeObjectURL(s), o.remove();
|
|
14
|
+
}, 100);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
b as downloadDocument,
|
|
18
|
+
p as downloadEventBus
|
|
19
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { Heading } from '@scalar/types/legacy';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts all headings from a Markdown string.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getHeadingsFromMarkdown(input: string): Heading[];
|
|
2
6
|
export type HeadingLevels = 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
7
|
/**
|
|
4
8
|
* Returns the lowest heading level from a list of headings.
|
|
@@ -6,4 +10,4 @@ export type HeadingLevels = 1 | 2 | 3 | 4 | 5 | 6;
|
|
|
6
10
|
* If there are h1, h2, h3 … h1 is the lowest heading level.
|
|
7
11
|
*/
|
|
8
12
|
export declare const getLowestHeadingLevel: (headings: Heading[]) => HeadingLevels;
|
|
9
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/libs/markdown.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAWnD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAMhE;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEjD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,aAAc,OAAO,EAAE,KAAG,aAQ3D,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getHeadings as r } from "@scalar/code-highlight/markdown";
|
|
2
|
+
import o from "github-slugger";
|
|
3
|
+
const s = (n, e) => n.map((t) => ({
|
|
4
|
+
...t,
|
|
5
|
+
slug: e.slug(t.value)
|
|
6
|
+
}));
|
|
7
|
+
function i(n) {
|
|
8
|
+
const e = new o(), t = r(n);
|
|
9
|
+
return s(t, e);
|
|
10
|
+
}
|
|
11
|
+
const l = (n) => {
|
|
12
|
+
const e = Math.min(...n.map((t) => t.depth));
|
|
13
|
+
return e >= 1 && e <= 6 ? e : 1;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
i as getHeadingsFromMarkdown,
|
|
17
|
+
l as getLowestHeadingLevel
|
|
18
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Operation } from '@scalar/oas-utils/entities/spec';
|
|
2
|
+
import type { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
3
|
+
import type { Spec, TransformedOperation } from '@scalar/types/legacy';
|
|
4
|
+
import { XScalarStability } from '@scalar/types/legacy';
|
|
5
|
+
type PropertyObject = {
|
|
6
|
+
required?: string[];
|
|
7
|
+
properties: {
|
|
8
|
+
[key: string]: {
|
|
9
|
+
type: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Formats a property object into a string.
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatProperty(key: string, obj: PropertyObject): string;
|
|
18
|
+
/**
|
|
19
|
+
* Extracts the request body from an operation.
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractRequestBody(operation: TransformedOperation): string[] | boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Returns all models from the specification, no matter if it’s Swagger 2.0 or OpenAPI 3.x.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getModels(spec?: Spec): Record<string, OpenAPIV3_1.SchemaObject> | OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.SchemaObject>;
|
|
26
|
+
/**
|
|
27
|
+
* Checks if the OpenAPI document has schemas.
|
|
28
|
+
*/
|
|
29
|
+
export declare const hasModels: (content?: Spec) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Checks if the OpenAPI document has webhooks.
|
|
32
|
+
*/
|
|
33
|
+
export declare const hasWebhooks: (content?: Spec) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Deep merge for objects
|
|
36
|
+
*/
|
|
37
|
+
export declare function deepMerge(source: Record<any, any>, target: Record<any, any>): Record<any, any>;
|
|
38
|
+
/**
|
|
39
|
+
* Creates an empty specification object.
|
|
40
|
+
* The returning object has the same structure as a valid OpenAPI specification, but everything is empty.
|
|
41
|
+
*/
|
|
42
|
+
export declare function createEmptySpecification(partialSpecification?: Partial<OpenAPI.Document>): Spec;
|
|
43
|
+
/**
|
|
44
|
+
* Returns if an operation is considered deprecated.
|
|
45
|
+
*/
|
|
46
|
+
export declare function isOperationDeprecated(operation: Pick<Operation, 'deprecated' | 'x-scalar-stability'>): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Get operation stability.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getOperationStability(operation: Pick<Operation, 'deprecated' | 'x-scalar-stability'>): XScalarStability | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Get Operation stability color
|
|
53
|
+
*/
|
|
54
|
+
export declare function getOperationStabilityColor(operation: Pick<Operation, 'deprecated' | 'x-scalar-stability'>): string;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=openapi.d.ts.map
|
|
@@ -0,0 +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,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACvF,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,mHAyBpC;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,GAqBjF,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"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { XScalarStability as o } from "@scalar/types/legacy";
|
|
2
|
+
function l(e, t) {
|
|
3
|
+
var n;
|
|
4
|
+
let r = e;
|
|
5
|
+
const i = (n = t.required) == null ? void 0 : n.includes(e);
|
|
6
|
+
return r += i ? " REQUIRED " : " optional ", t.properties[e] && (r += t.properties[e].type, t.properties[e].description && (r += " " + t.properties[e].description)), r;
|
|
7
|
+
}
|
|
8
|
+
function d(e) {
|
|
9
|
+
var i;
|
|
10
|
+
const t = ["Body"], r = (i = e == null ? void 0 : e.schema) == null ? void 0 : i.properties;
|
|
11
|
+
return r && Object.keys(r).forEach((n) => {
|
|
12
|
+
if (!e.schema)
|
|
13
|
+
return;
|
|
14
|
+
t.push(l(n, e.schema));
|
|
15
|
+
const s = r[n];
|
|
16
|
+
s.type === "object" && !!s.properties && s.properties && Object.keys(s.properties).forEach((u) => {
|
|
17
|
+
var f, c;
|
|
18
|
+
t.push(`${u} ${(c = (f = s.properties) == null ? void 0 : f[u]) == null ? void 0 : c.type}`);
|
|
19
|
+
});
|
|
20
|
+
}), t;
|
|
21
|
+
}
|
|
22
|
+
function O(e) {
|
|
23
|
+
var t, r, i;
|
|
24
|
+
try {
|
|
25
|
+
const n = (i = (r = (t = e == null ? void 0 : e.information) == null ? void 0 : t.requestBody) == null ? void 0 : r.content) == null ? void 0 : i["application/json"];
|
|
26
|
+
if (!n)
|
|
27
|
+
throw new Error("Body not found");
|
|
28
|
+
return d(n);
|
|
29
|
+
} catch {
|
|
30
|
+
return !1;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function p(e) {
|
|
34
|
+
var r, i;
|
|
35
|
+
if (!e)
|
|
36
|
+
return {};
|
|
37
|
+
const t = (
|
|
38
|
+
// OpenAPI 3.x
|
|
39
|
+
Object.keys(((r = e == null ? void 0 : e.components) == null ? void 0 : r.schemas) ?? {}).length ? (i = e == null ? void 0 : e.components) == null ? void 0 : i.schemas : (
|
|
40
|
+
// Swagger 2.0
|
|
41
|
+
Object.keys((e == null ? void 0 : e.definitions) ?? {}).length ? e == null ? void 0 : e.definitions : (
|
|
42
|
+
// Fallback
|
|
43
|
+
{}
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
return Object.keys(t ?? {}).forEach((n) => {
|
|
48
|
+
var s;
|
|
49
|
+
((s = t[n]) == null ? void 0 : s["x-internal"]) === !0 && delete t[n];
|
|
50
|
+
}), t;
|
|
51
|
+
}
|
|
52
|
+
const b = (e) => e ? !!Object.keys(p(e) ?? {}).length : !1, x = (e) => e ? !!Object.keys((e == null ? void 0 : e.webhooks) ?? {}).length : !1;
|
|
53
|
+
function a(e, t) {
|
|
54
|
+
for (const [r, i] of Object.entries(e))
|
|
55
|
+
i !== null && typeof i == "object" ? (t[r] ?? (t[r] = new i.__proto__.constructor()), a(i, t[r])) : typeof i < "u" && (t[r] = i);
|
|
56
|
+
return t;
|
|
57
|
+
}
|
|
58
|
+
function E(e) {
|
|
59
|
+
return a(e ?? {}, {
|
|
60
|
+
info: {
|
|
61
|
+
title: "",
|
|
62
|
+
description: "",
|
|
63
|
+
termsOfService: "",
|
|
64
|
+
version: "",
|
|
65
|
+
license: {
|
|
66
|
+
name: "",
|
|
67
|
+
url: ""
|
|
68
|
+
},
|
|
69
|
+
contact: {
|
|
70
|
+
email: ""
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
externalDocs: {
|
|
74
|
+
description: "",
|
|
75
|
+
url: ""
|
|
76
|
+
},
|
|
77
|
+
servers: [],
|
|
78
|
+
tags: []
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function S(e) {
|
|
82
|
+
return e.deprecated !== void 0 ? e.deprecated : !!(e["x-scalar-stability"] && e["x-scalar-stability"] === o.Deprecated);
|
|
83
|
+
}
|
|
84
|
+
function h(e) {
|
|
85
|
+
return e.deprecated ? o.Deprecated : e["x-scalar-stability"];
|
|
86
|
+
}
|
|
87
|
+
function g(e) {
|
|
88
|
+
const t = h(e);
|
|
89
|
+
return t === o.Deprecated ? "text-red" : t === o.Experimental ? "text-orange" : t === o.Stable ? "text-green" : "";
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
E as createEmptySpecification,
|
|
93
|
+
a as deepMerge,
|
|
94
|
+
O as extractRequestBody,
|
|
95
|
+
l as formatProperty,
|
|
96
|
+
p as getModels,
|
|
97
|
+
h as getOperationStability,
|
|
98
|
+
g as getOperationStabilityColor,
|
|
99
|
+
b as hasModels,
|
|
100
|
+
x as hasWebhooks,
|
|
101
|
+
S as isOperationDeprecated
|
|
102
|
+
};
|