redoc 2.5.2 → 3.0.0-rc.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/LICENSE +2 -2
- package/README.md +22 -14
- package/bundle/redoc.d.ts +683 -0
- package/bundle/redoc.js +2224 -0
- package/bundle/redoc.standalone.js +2264 -0
- package/package.json +115 -180
- package/CHANGELOG.md +0 -2354
- package/bundles/cfb294d7f6536ffa8d42.worker.js.LICENSE.txt +0 -68
- package/bundles/cfb294d7f6536ffa8d42.worker.js.map +0 -1
- package/bundles/redoc.browser.lib.js +0 -1832
- package/bundles/redoc.browser.lib.js.LICENSE.txt +0 -6
- package/bundles/redoc.browser.lib.js.map +0 -1
- package/bundles/redoc.lib.js +0 -1832
- package/bundles/redoc.lib.js.LICENSE.txt +0 -6
- package/bundles/redoc.lib.js.map +0 -1
- package/bundles/redoc.standalone.js +0 -1832
- package/bundles/redoc.standalone.js.LICENSE.txt +0 -102
- package/bundles/redoc.standalone.js.map +0 -1
- package/typings/common-elements/CopyButtonWrapper.d.ts +0 -10
- package/typings/common-elements/Dropdown/Dropdown.d.ts +0 -3
- package/typings/common-elements/Dropdown/index.d.ts +0 -2
- package/typings/common-elements/Dropdown/styled.d.ts +0 -7
- package/typings/common-elements/Dropdown/types.d.ts +0 -23
- package/typings/common-elements/PrismDiv.d.ts +0 -1
- package/typings/common-elements/Tooltip.d.ts +0 -8
- package/typings/common-elements/fields-layout.d.ts +0 -14
- package/typings/common-elements/fields.d.ts +0 -20
- package/typings/common-elements/headers.d.ts +0 -6
- package/typings/common-elements/index.d.ts +0 -11
- package/typings/common-elements/linkify.d.ts +0 -10
- package/typings/common-elements/mixins.d.ts +0 -1
- package/typings/common-elements/panels.d.ts +0 -11
- package/typings/common-elements/perfect-scrollbar.d.ts +0 -19
- package/typings/common-elements/samples.d.ts +0 -5
- package/typings/common-elements/schema.d.ts +0 -8
- package/typings/common-elements/shelfs.d.ts +0 -13
- package/typings/common-elements/tabs.d.ts +0 -3
- package/typings/components/ApiInfo/ApiInfo.d.ts +0 -8
- package/typings/components/ApiInfo/index.d.ts +0 -1
- package/typings/components/ApiInfo/styled.elements.d.ts +0 -8
- package/typings/components/ApiLogo/ApiLogo.d.ts +0 -7
- package/typings/components/ApiLogo/styled.elements.d.ts +0 -4
- package/typings/components/CallbackSamples/CallbackReqSamples.d.ts +0 -11
- package/typings/components/CallbackSamples/CallbackSamples.d.ts +0 -13
- package/typings/components/Callbacks/CallbackDetails.d.ts +0 -8
- package/typings/components/Callbacks/CallbackOperation.d.ts +0 -8
- package/typings/components/Callbacks/CallbackTitle.d.ts +0 -10
- package/typings/components/Callbacks/CallbacksList.d.ts +0 -8
- package/typings/components/Callbacks/index.d.ts +0 -3
- package/typings/components/Callbacks/styled.elements.d.ts +0 -2
- package/typings/components/ContentItems/ContentItems.d.ts +0 -22
- package/typings/components/DropdownOrLabel/DropdownOrLabel.d.ts +0 -10
- package/typings/components/Endpoint/Endpoint.d.ts +0 -16
- package/typings/components/Endpoint/styled.elements.d.ts +0 -17
- package/typings/components/ErrorBoundary.d.ts +0 -8
- package/typings/components/ExternalDocumentation/ExternalDocumentation.d.ts +0 -8
- package/typings/components/Fields/ArrayItemDetails.d.ts +0 -5
- package/typings/components/Fields/EnumValues.d.ts +0 -17
- package/typings/components/Fields/Examples.d.ts +0 -5
- package/typings/components/Fields/Extensions.d.ts +0 -9
- package/typings/components/Fields/Field.d.ts +0 -20
- package/typings/components/Fields/FieldConstraints.d.ts +0 -7
- package/typings/components/Fields/FieldDetail.d.ts +0 -7
- package/typings/components/Fields/FieldDetails.d.ts +0 -4
- package/typings/components/Fields/Pattern.d.ts +0 -5
- package/typings/components/GenericChildrenSwitcher/GenericChildrenSwitcher.d.ts +0 -22
- package/typings/components/JsonViewer/JsonViewer.d.ts +0 -6
- package/typings/components/JsonViewer/index.d.ts +0 -1
- package/typings/components/JsonViewer/style.d.ts +0 -1
- package/typings/components/Loading/Loading.d.ts +0 -7
- package/typings/components/Loading/Spinner.svg.d.ts +0 -5
- package/typings/components/Markdown/AdvancedMarkdown.d.ts +0 -11
- package/typings/components/Markdown/Markdown.d.ts +0 -17
- package/typings/components/Markdown/SanitizedMdBlock.d.ts +0 -7
- package/typings/components/Markdown/styled.elements.d.ts +0 -7
- package/typings/components/MediaTypeSwitch/MediaTypesSwitch.d.ts +0 -17
- package/typings/components/Operation/Operation.d.ts +0 -5
- package/typings/components/OptionsProvider.d.ts +0 -5
- package/typings/components/Parameters/Parameters.d.ts +0 -16
- package/typings/components/Parameters/ParametersGroup.d.ts +0 -9
- package/typings/components/PayloadSamples/Example.d.ts +0 -8
- package/typings/components/PayloadSamples/ExampleValue.d.ts +0 -6
- package/typings/components/PayloadSamples/MediaTypeSamples.d.ts +0 -18
- package/typings/components/PayloadSamples/PayloadSamples.d.ts +0 -9
- package/typings/components/PayloadSamples/exernalExampleHook.d.ts +0 -2
- package/typings/components/PayloadSamples/styled.elements.d.ts +0 -7
- package/typings/components/Redoc/Redoc.d.ts +0 -14
- package/typings/components/Redoc/styled.elements.d.ts +0 -3
- package/typings/components/RedocStandalone.d.ts +0 -9
- package/typings/components/RequestSamples/RequestSamples.d.ts +0 -11
- package/typings/components/ResponseSamples/ResponseSamples.d.ts +0 -9
- package/typings/components/Responses/Response.d.ts +0 -6
- package/typings/components/Responses/ResponseDetails.d.ts +0 -8
- package/typings/components/Responses/ResponseHeaders.d.ts +0 -8
- package/typings/components/Responses/ResponseTitle.d.ts +0 -11
- package/typings/components/Responses/ResponsesList.d.ts +0 -9
- package/typings/components/Responses/styled.elements.d.ts +0 -6
- package/typings/components/Schema/ArraySchema.d.ts +0 -5
- package/typings/components/Schema/DiscriminatorDropdown.d.ts +0 -11
- package/typings/components/Schema/ObjectSchema.d.ts +0 -11
- package/typings/components/Schema/OneOfSchema.d.ts +0 -15
- package/typings/components/Schema/RecursiveSchema.d.ts +0 -3
- package/typings/components/Schema/Schema.d.ts +0 -15
- package/typings/components/Schema/index.d.ts +0 -5
- package/typings/components/SchemaDefinition/SchemaDefinition.d.ts +0 -18
- package/typings/components/SearchBox/SearchBox.d.ts +0 -32
- package/typings/components/SearchBox/styled.elements.d.ts +0 -12
- package/typings/components/SecurityRequirement/OAuthFlow.d.ts +0 -9
- package/typings/components/SecurityRequirement/RequiredScopesRow.d.ts +0 -3
- package/typings/components/SecurityRequirement/SecurityDetails.d.ts +0 -8
- package/typings/components/SecurityRequirement/SecurityHeader.d.ts +0 -8
- package/typings/components/SecurityRequirement/SecurityRequirement.d.ts +0 -6
- package/typings/components/SecurityRequirement/styled.elements.d.ts +0 -17
- package/typings/components/SecuritySchemes/SecuritySchemes.d.ts +0 -14
- package/typings/components/SeeMore/SeeMore.d.ts +0 -7
- package/typings/components/SelectOnClick/SelectOnClick.d.ts +0 -6
- package/typings/components/SideMenu/Logo.d.ts +0 -1
- package/typings/components/SideMenu/MenuItem.d.ts +0 -22
- package/typings/components/SideMenu/MenuItems.d.ts +0 -13
- package/typings/components/SideMenu/SideMenu.d.ts +0 -15
- package/typings/components/SideMenu/index.d.ts +0 -4
- package/typings/components/SideMenu/styled.elements.d.ts +0 -30
- package/typings/components/SourceCode/SourceCode.d.ts +0 -7
- package/typings/components/StickySidebar/ChevronSvg.d.ts +0 -4
- package/typings/components/StickySidebar/StickyResponsiveSidebar.d.ts +0 -23
- package/typings/components/StoreBuilder.d.ts +0 -26
- package/typings/components/index.d.ts +0 -34
- package/typings/index.d.ts +0 -8
- package/typings/services/AppStore.d.ts +0 -33
- package/typings/services/ClipboardService.d.ts +0 -8
- package/typings/services/HistoryService.d.ts +0 -12
- package/typings/services/Labels.d.ts +0 -3
- package/typings/services/MarkdownRenderer.d.ts +0 -26
- package/typings/services/MarkerService.d.ts +0 -11
- package/typings/services/MenuBuilder.d.ts +0 -50
- package/typings/services/MenuStore.d.ts +0 -89
- package/typings/services/OpenAPIParser.d.ts +0 -50
- package/typings/services/RedocNormalizedOptions.d.ts +0 -123
- package/typings/services/ScrollService.d.ts +0 -17
- package/typings/services/SearchStore.d.ts +0 -16
- package/typings/services/SearchWorker.worker.d.ts +0 -20
- package/typings/services/SpecStore.d.ts +0 -20
- package/typings/services/index.d.ts +0 -14
- package/typings/services/models/ApiInfo.d.ts +0 -23
- package/typings/services/models/Callback.d.ts +0 -11
- package/typings/services/models/Example.d.ts +0 -13
- package/typings/services/models/Field.d.ts +0 -32
- package/typings/services/models/Group.model.d.ts +0 -25
- package/typings/services/models/MediaContent.d.ts +0 -24
- package/typings/services/models/MediaType.d.ts +0 -20
- package/typings/services/models/Operation.d.ts +0 -72
- package/typings/services/models/RequestBody.d.ts +0 -17
- package/typings/services/models/Response.d.ts +0 -26
- package/typings/services/models/Schema.d.ts +0 -62
- package/typings/services/models/SecurityRequirement.d.ts +0 -12
- package/typings/services/models/SecuritySchemes.d.ts +0 -26
- package/typings/services/models/Webhook.d.ts +0 -9
- package/typings/services/models/index.d.ts +0 -13
- package/typings/services/types.d.ts +0 -106
- package/typings/styled-components.d.ts +0 -12
- package/typings/styled-patch.d.ts +0 -22
- package/typings/theme.d.ts +0 -163
- package/typings/types/index.d.ts +0 -2
- package/typings/types/index.ts +0 -3
- package/typings/types/open-api.d.ts +0 -314
- package/typings/types/open-api.ts +0 -304
- package/typings/utils/JsonPointer.d.ts +0 -51
- package/typings/utils/debug.d.ts +0 -2
- package/typings/utils/decorators.d.ts +0 -1
- package/typings/utils/dom.d.ts +0 -9
- package/typings/utils/helpers.d.ts +0 -43
- package/typings/utils/highlight.d.ts +0 -34
- package/typings/utils/index.d.ts +0 -10
- package/typings/utils/jsonToHtml.d.ts +0 -1
- package/typings/utils/loadAndBundleSpec.d.ts +0 -3
- package/typings/utils/memoize.d.ts +0 -1
- package/typings/utils/openapi.d.ts +0 -43
- package/typings/utils/sort.d.ts +0 -6
|
@@ -0,0 +1,683 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { ConfigFunction } from '@markdoc/markdoc/dist/src/types';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import type { LayoutVariant } from '@redocly/config';
|
|
5
|
+
import type { PropsWithChildren } from 'react';
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
import type { RedocConfig } from '@redocly/config';
|
|
8
|
+
import type { Schema } from '@markdoc/markdoc/dist/src/types';
|
|
9
|
+
import { ServerStyleSheet } from 'styled-components';
|
|
10
|
+
|
|
11
|
+
declare interface CodeSamplesConfig {
|
|
12
|
+
languages: {
|
|
13
|
+
lang: 'Payload' | string;
|
|
14
|
+
label?: string;
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export declare function convertSwagger2OpenAPI(spec: GenericObject): Promise<OpenAPIDefinition>;
|
|
19
|
+
|
|
20
|
+
declare type DownloadUrlsConfig = {
|
|
21
|
+
title?: string;
|
|
22
|
+
url: string;
|
|
23
|
+
}[];
|
|
24
|
+
|
|
25
|
+
declare interface McpPrompt {
|
|
26
|
+
name: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
description: string;
|
|
29
|
+
arguments: McpPromptArgument[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare interface McpPromptArgument {
|
|
33
|
+
name: string;
|
|
34
|
+
description: string;
|
|
35
|
+
required: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare interface McpResource {
|
|
39
|
+
name: string;
|
|
40
|
+
title?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
uri: string;
|
|
43
|
+
mimeType: string;
|
|
44
|
+
security?: OpenAPISecurityRequirement[];
|
|
45
|
+
tags?: string[];
|
|
46
|
+
'x-badges'?: OpenAPIXBadges[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare interface McpTool {
|
|
50
|
+
name: string;
|
|
51
|
+
title?: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
inputSchema: OpenAPISchema;
|
|
54
|
+
outputSchema?: OpenAPISchema;
|
|
55
|
+
security?: OpenAPISecurityRequirement[];
|
|
56
|
+
tags?: string[];
|
|
57
|
+
'x-badges'?: OpenAPIXBadges[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare type MergedOpenAPISchema = OpenAPISchema & {
|
|
61
|
+
'x-refsStack'?: string[];
|
|
62
|
+
'x-parentRefs'?: string[];
|
|
63
|
+
'x-circular-ref'?: boolean;
|
|
64
|
+
'x-complex'?: boolean;
|
|
65
|
+
absolutePointer?: string;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
declare interface OpenAPICallback {
|
|
69
|
+
[name: string]: OpenAPIPath;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare interface OpenAPIComponents {
|
|
73
|
+
schemas?: {
|
|
74
|
+
[name: string]: Referenced<OpenAPISchema>;
|
|
75
|
+
};
|
|
76
|
+
responses?: {
|
|
77
|
+
[name: string]: Referenced<OpenAPIResponse>;
|
|
78
|
+
};
|
|
79
|
+
parameters?: {
|
|
80
|
+
[name: string]: Referenced<OpenAPIParameter>;
|
|
81
|
+
};
|
|
82
|
+
examples?: {
|
|
83
|
+
[name: string]: Referenced<OpenAPIExample>;
|
|
84
|
+
};
|
|
85
|
+
requestBodies?: {
|
|
86
|
+
[name: string]: Referenced<OpenAPIRequestBody>;
|
|
87
|
+
};
|
|
88
|
+
headers?: {
|
|
89
|
+
[name: string]: Referenced<OpenAPIHeader>;
|
|
90
|
+
};
|
|
91
|
+
securitySchemes?: {
|
|
92
|
+
[name: string]: Referenced<OpenAPISecurityScheme>;
|
|
93
|
+
};
|
|
94
|
+
links?: {
|
|
95
|
+
[name: string]: Referenced<OpenAPILink>;
|
|
96
|
+
};
|
|
97
|
+
callbacks?: {
|
|
98
|
+
[name: string]: Referenced<OpenAPICallback>;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare interface OpenAPIContact {
|
|
103
|
+
name?: string;
|
|
104
|
+
url?: string;
|
|
105
|
+
email?: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare interface OpenAPIDefinition {
|
|
109
|
+
openapi: string;
|
|
110
|
+
info: OpenAPIInfo;
|
|
111
|
+
servers?: OpenAPIServer[];
|
|
112
|
+
paths: OpenAPIPaths;
|
|
113
|
+
components?: OpenAPIComponents;
|
|
114
|
+
security?: OpenAPISecurityRequirement[];
|
|
115
|
+
tags?: OpenAPITag[];
|
|
116
|
+
externalDocs?: OpenAPIExternalDocumentation;
|
|
117
|
+
webhooks?: OpenAPIPaths;
|
|
118
|
+
'x-mcp'?: OpenAPIMcp;
|
|
119
|
+
'x-webhooks'?: OpenAPIPaths;
|
|
120
|
+
'x-tagGroups'?: Array<{
|
|
121
|
+
name: string;
|
|
122
|
+
tags: Array<string>;
|
|
123
|
+
}>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
declare interface OpenAPIDiscriminator {
|
|
127
|
+
propertyName: string;
|
|
128
|
+
mapping?: {
|
|
129
|
+
[name: string]: string;
|
|
130
|
+
};
|
|
131
|
+
'x-explicitMappingOnly'?: boolean;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
declare interface OpenAPIEncoding {
|
|
135
|
+
contentType: string;
|
|
136
|
+
headers?: {
|
|
137
|
+
[name: string]: Referenced<OpenAPIHeader>;
|
|
138
|
+
};
|
|
139
|
+
style: OpenAPIParameterStyle;
|
|
140
|
+
explode: boolean;
|
|
141
|
+
allowReserved: boolean;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
declare interface OpenAPIExample extends ParsedDescriptionWithSummary {
|
|
145
|
+
value: any;
|
|
146
|
+
summary?: string;
|
|
147
|
+
description?: string;
|
|
148
|
+
externalValue?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
declare interface OpenAPIExternalDocumentation extends ParsedDescription {
|
|
152
|
+
description?: string;
|
|
153
|
+
url: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
declare type OpenAPIHeader = Omit<OpenAPIParameter, 'in' | 'name'>;
|
|
157
|
+
|
|
158
|
+
declare interface OpenAPIInfo extends ParsedDescriptionWithSummary {
|
|
159
|
+
title: string;
|
|
160
|
+
version: string;
|
|
161
|
+
description?: string;
|
|
162
|
+
summary?: string;
|
|
163
|
+
termsOfService?: string;
|
|
164
|
+
contact?: OpenAPIContact;
|
|
165
|
+
license?: OpenAPILicense;
|
|
166
|
+
externalDocs?: OpenAPIExternalDocumentation;
|
|
167
|
+
'x-logo'?: XLogo;
|
|
168
|
+
'x-metadata'?: XMetadata;
|
|
169
|
+
'x-seo'?: XSEO;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
declare interface OpenAPILicense {
|
|
173
|
+
name: string;
|
|
174
|
+
url?: string;
|
|
175
|
+
identifier?: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare interface OpenAPILink {
|
|
179
|
+
$ref?: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
declare interface OpenAPIMcp {
|
|
183
|
+
protocolVersion: string;
|
|
184
|
+
capabilities: {
|
|
185
|
+
[key: string]: boolean | {
|
|
186
|
+
listChanged?: boolean;
|
|
187
|
+
subscribe?: boolean;
|
|
188
|
+
[key: string]: unknown;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
servers: OpenAPIServer[];
|
|
192
|
+
tools: McpTool[];
|
|
193
|
+
resources: McpResource[];
|
|
194
|
+
prompts: McpPrompt[];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
declare interface OpenAPIMediaType {
|
|
198
|
+
schema?: Referenced<OpenAPISchema>;
|
|
199
|
+
example?: any;
|
|
200
|
+
examples?: {
|
|
201
|
+
[name: string]: Referenced<OpenAPIExample>;
|
|
202
|
+
};
|
|
203
|
+
encoding?: {
|
|
204
|
+
[field: string]: OpenAPIEncoding;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
declare interface OpenAPIOperation extends ParsedDescriptionWithSummary {
|
|
209
|
+
tags?: string[];
|
|
210
|
+
summary?: string;
|
|
211
|
+
description?: string;
|
|
212
|
+
externalDocs?: OpenAPIExternalDocumentation;
|
|
213
|
+
operationId?: string;
|
|
214
|
+
parameters?: Array<Referenced<OpenAPIParameter>>;
|
|
215
|
+
requestBody?: Referenced<OpenAPIRequestBody>;
|
|
216
|
+
responses: OpenAPIResponses;
|
|
217
|
+
callbacks?: {
|
|
218
|
+
[name: string]: Referenced<OpenAPICallback>;
|
|
219
|
+
};
|
|
220
|
+
deprecated?: boolean;
|
|
221
|
+
security?: OpenAPISecurityRequirement[];
|
|
222
|
+
servers?: OpenAPIServer[];
|
|
223
|
+
'x-codeSamples'?: OpenAPIXCodeSample[];
|
|
224
|
+
'x-badges'?: OpenAPIXBadges[];
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
declare interface OpenAPIParameter extends ParsedDescription {
|
|
228
|
+
name: string;
|
|
229
|
+
in?: OpenAPIParameterLocation;
|
|
230
|
+
description?: string;
|
|
231
|
+
required?: boolean;
|
|
232
|
+
deprecated?: boolean;
|
|
233
|
+
allowEmptyValue?: boolean;
|
|
234
|
+
style?: OpenAPIParameterStyle;
|
|
235
|
+
explode?: boolean;
|
|
236
|
+
allowReserved?: boolean;
|
|
237
|
+
schema?: Referenced<OpenAPISchema>;
|
|
238
|
+
example?: any;
|
|
239
|
+
examples?: {
|
|
240
|
+
[media: string]: Referenced<OpenAPIExample>;
|
|
241
|
+
};
|
|
242
|
+
content?: {
|
|
243
|
+
[media: string]: OpenAPIMediaType;
|
|
244
|
+
};
|
|
245
|
+
encoding?: Record<string, OpenAPIEncoding>;
|
|
246
|
+
const?: any;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
declare type OpenAPIParameterLocation = 'query' | 'header' | 'path' | 'cookie';
|
|
250
|
+
|
|
251
|
+
declare type OpenAPIParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject';
|
|
252
|
+
|
|
253
|
+
declare class OpenAPIParser {
|
|
254
|
+
private options;
|
|
255
|
+
definitionUrl?: string;
|
|
256
|
+
definition: OpenAPIDefinition;
|
|
257
|
+
private readonly allowMergeRefs;
|
|
258
|
+
constructor(definition: OpenAPIDefinition, definitionUrl?: string, options?: Options & {
|
|
259
|
+
versionId?: string;
|
|
260
|
+
});
|
|
261
|
+
validate(spec: GenericObject): void;
|
|
262
|
+
/**
|
|
263
|
+
* get spec part by JsonPointer ($ref)
|
|
264
|
+
*/
|
|
265
|
+
byRef: <T>(ref: string) => T | undefined;
|
|
266
|
+
/**
|
|
267
|
+
* checks if the object is OpenAPI reference (contains $ref property)
|
|
268
|
+
*/
|
|
269
|
+
isRef<T>(obj: OpenAPIRef | T): obj is OpenAPIRef;
|
|
270
|
+
/**
|
|
271
|
+
* Resolve given reference object or return as is if it is not a reference
|
|
272
|
+
* @param obj object to dereference
|
|
273
|
+
* @param baseRefsStack
|
|
274
|
+
* @param mergeAsAllOf
|
|
275
|
+
*/
|
|
276
|
+
deref<T>(obj: OpenAPIRef | T, baseRefsStack?: string[], mergeAsAllOf?: boolean, level?: number): {
|
|
277
|
+
resolved: T;
|
|
278
|
+
refsStack: string[];
|
|
279
|
+
};
|
|
280
|
+
mergeRefs<T>(ref: OpenAPIRef, resolved: T, mergeAsAllOf: boolean): T;
|
|
281
|
+
/**
|
|
282
|
+
* Merge allOf constraints.
|
|
283
|
+
* @param schema schema with allOF
|
|
284
|
+
* @param $ref pointer of the schema
|
|
285
|
+
* @param refsStack
|
|
286
|
+
* @param absolutePointer
|
|
287
|
+
*/
|
|
288
|
+
mergeAllOf(schema: MergedOpenAPISchema, $ref: string | undefined, refsStack: string[], absolutePointer?: string, level?: number): MergedOpenAPISchema;
|
|
289
|
+
/**
|
|
290
|
+
* Find all derived definitions among #/components/schemas from any of $refs
|
|
291
|
+
* returns map of definition pointer to definition name
|
|
292
|
+
* @param $refs array of references to find derived from
|
|
293
|
+
*/
|
|
294
|
+
findDerived($refs: string[]): Record<string, string[] | string>;
|
|
295
|
+
private hoistOneOfs;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
declare interface OpenAPIPath extends Partial<OpenAPIRef>, ParsedDescriptionWithSummary {
|
|
299
|
+
summary?: string;
|
|
300
|
+
description?: string;
|
|
301
|
+
get?: OpenAPIOperation;
|
|
302
|
+
put?: OpenAPIOperation;
|
|
303
|
+
post?: OpenAPIOperation;
|
|
304
|
+
delete?: OpenAPIOperation;
|
|
305
|
+
options?: OpenAPIOperation;
|
|
306
|
+
head?: OpenAPIOperation;
|
|
307
|
+
patch?: OpenAPIOperation;
|
|
308
|
+
trace?: OpenAPIOperation;
|
|
309
|
+
servers?: OpenAPIServer[];
|
|
310
|
+
parameters?: Array<Referenced<OpenAPIParameter>>;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
declare interface OpenAPIPaths {
|
|
314
|
+
[path: string]: OpenAPIPath;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
declare interface OpenAPIRef extends ParsedDescriptionWithSummary {
|
|
318
|
+
$ref: string;
|
|
319
|
+
'x-refsStack'?: string[];
|
|
320
|
+
summary?: string;
|
|
321
|
+
description?: string;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
declare interface OpenAPIRequestBody extends ParsedDescription {
|
|
325
|
+
$ref?: string;
|
|
326
|
+
description?: string;
|
|
327
|
+
required?: boolean;
|
|
328
|
+
content?: {
|
|
329
|
+
[mime: string]: OpenAPIMediaType;
|
|
330
|
+
};
|
|
331
|
+
'x-examples'?: {
|
|
332
|
+
[mime: string]: {
|
|
333
|
+
[name: string]: Referenced<OpenAPIExample>;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
'x-example'?: {
|
|
337
|
+
[mime: string]: any;
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
declare interface OpenAPIResponse extends ParsedDescription {
|
|
342
|
+
description?: string;
|
|
343
|
+
headers?: {
|
|
344
|
+
[name: string]: Referenced<OpenAPIHeader>;
|
|
345
|
+
};
|
|
346
|
+
content?: {
|
|
347
|
+
[mime: string]: OpenAPIMediaType;
|
|
348
|
+
};
|
|
349
|
+
links?: {
|
|
350
|
+
[name: string]: Referenced<OpenAPILink>;
|
|
351
|
+
};
|
|
352
|
+
$ref?: string;
|
|
353
|
+
'x-examples'?: {
|
|
354
|
+
[mime: string]: {
|
|
355
|
+
[name: string]: Referenced<OpenAPIExample>;
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
'x-example'?: {
|
|
359
|
+
[mime: string]: any;
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
declare interface OpenAPIResponses {
|
|
364
|
+
[code: string]: OpenAPIResponse;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
declare interface OpenAPISchema extends ParsedDescription {
|
|
368
|
+
$ref?: string;
|
|
369
|
+
type?: string | string[];
|
|
370
|
+
properties?: {
|
|
371
|
+
[name: string]: OpenAPISchema;
|
|
372
|
+
};
|
|
373
|
+
patternProperties?: {
|
|
374
|
+
[name: string]: OpenAPISchema;
|
|
375
|
+
};
|
|
376
|
+
additionalProperties?: boolean | OpenAPISchema;
|
|
377
|
+
unevaluatedProperties?: boolean | OpenAPISchema;
|
|
378
|
+
description?: string;
|
|
379
|
+
default?: any;
|
|
380
|
+
items?: OpenAPISchema | OpenAPISchema[] | boolean;
|
|
381
|
+
required?: string[];
|
|
382
|
+
readOnly?: boolean;
|
|
383
|
+
writeOnly?: boolean;
|
|
384
|
+
deprecated?: boolean;
|
|
385
|
+
format?: string;
|
|
386
|
+
externalDocs?: OpenAPIExternalDocumentation;
|
|
387
|
+
discriminator?: OpenAPIDiscriminator;
|
|
388
|
+
nullable?: boolean;
|
|
389
|
+
oneOf?: OpenAPISchema[];
|
|
390
|
+
anyOf?: OpenAPISchema[];
|
|
391
|
+
allOf?: OpenAPISchema[];
|
|
392
|
+
not?: OpenAPISchema;
|
|
393
|
+
title?: string;
|
|
394
|
+
multipleOf?: number;
|
|
395
|
+
maximum?: number;
|
|
396
|
+
exclusiveMaximum?: boolean | number;
|
|
397
|
+
minimum?: number;
|
|
398
|
+
exclusiveMinimum?: boolean | number;
|
|
399
|
+
maxLength?: number;
|
|
400
|
+
minLength?: number;
|
|
401
|
+
pattern?: string;
|
|
402
|
+
maxItems?: number;
|
|
403
|
+
minItems?: number;
|
|
404
|
+
uniqueItems?: boolean;
|
|
405
|
+
maxProperties?: number;
|
|
406
|
+
minProperties?: number;
|
|
407
|
+
enum?: any[];
|
|
408
|
+
example?: any;
|
|
409
|
+
examples?: any[];
|
|
410
|
+
const?: string;
|
|
411
|
+
contentEncoding?: string;
|
|
412
|
+
contentMediaType?: string;
|
|
413
|
+
if?: OpenAPISchema;
|
|
414
|
+
else?: OpenAPISchema;
|
|
415
|
+
then?: OpenAPISchema;
|
|
416
|
+
prefixItems?: OpenAPISchema[];
|
|
417
|
+
additionalItems?: OpenAPISchema | boolean;
|
|
418
|
+
xml?: XMLObject;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
declare interface OpenAPISecurityRequirement {
|
|
422
|
+
[name: string]: string[];
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
declare interface OpenAPISecurityScheme extends ParsedDescription {
|
|
426
|
+
type: 'apiKey' | 'http' | 'oauth2' | 'openIdConnect';
|
|
427
|
+
description?: string;
|
|
428
|
+
name?: string;
|
|
429
|
+
in?: 'query' | 'header' | 'cookie';
|
|
430
|
+
scheme?: string;
|
|
431
|
+
bearerFormat: string;
|
|
432
|
+
'x-defaultClientId'?: string;
|
|
433
|
+
deprecated?: boolean;
|
|
434
|
+
oauth2MetadataUrl?: string;
|
|
435
|
+
flows: {
|
|
436
|
+
implicit?: {
|
|
437
|
+
refreshUrl?: string;
|
|
438
|
+
scopes: Record<string, string>;
|
|
439
|
+
authorizationUrl: string;
|
|
440
|
+
'x-defaultClientId'?: string;
|
|
441
|
+
};
|
|
442
|
+
deviceAuthorization?: {
|
|
443
|
+
deviceAuthorizationUrl: string;
|
|
444
|
+
scopes: Record<string, string>;
|
|
445
|
+
tokenUrl: string;
|
|
446
|
+
refreshUrl?: string;
|
|
447
|
+
'x-defaultClientId'?: string;
|
|
448
|
+
};
|
|
449
|
+
password?: {
|
|
450
|
+
refreshUrl?: string;
|
|
451
|
+
scopes: Record<string, string>;
|
|
452
|
+
tokenUrl: string;
|
|
453
|
+
'x-defaultClientId'?: string;
|
|
454
|
+
};
|
|
455
|
+
clientCredentials?: {
|
|
456
|
+
refreshUrl?: string;
|
|
457
|
+
scopes: Record<string, string>;
|
|
458
|
+
tokenUrl: string;
|
|
459
|
+
'x-defaultClientId'?: string;
|
|
460
|
+
};
|
|
461
|
+
authorizationCode?: {
|
|
462
|
+
refreshUrl?: string;
|
|
463
|
+
scopes: Record<string, string>;
|
|
464
|
+
authorizationUrl: string;
|
|
465
|
+
tokenUrl: string;
|
|
466
|
+
'x-defaultClientId'?: string;
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
openIdConnectUrl?: string;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
declare interface OpenAPIServer extends ParsedDescription {
|
|
473
|
+
url: string;
|
|
474
|
+
description?: string;
|
|
475
|
+
name?: string;
|
|
476
|
+
variables?: OpenAPIServerVariables;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
declare interface OpenAPIServerVariable extends ParsedDescription {
|
|
480
|
+
enum?: string[];
|
|
481
|
+
default: string;
|
|
482
|
+
description?: string;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
declare interface OpenAPIServerVariables {
|
|
486
|
+
[name: string]: OpenAPIServerVariable;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
declare interface OpenAPITag extends ParsedDescription {
|
|
490
|
+
name: string;
|
|
491
|
+
description?: string;
|
|
492
|
+
externalDocs?: OpenAPIExternalDocumentation;
|
|
493
|
+
'x-displayName'?: string;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
declare interface OpenAPIXBadges {
|
|
497
|
+
name: string;
|
|
498
|
+
color?: string;
|
|
499
|
+
position?: 'before' | 'after';
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
declare interface OpenAPIXCodeSample extends Sample {
|
|
503
|
+
source: string;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
declare type OperationStore = {
|
|
507
|
+
activeExampleName?: string;
|
|
508
|
+
activeOneOf: {
|
|
509
|
+
[pointer: string]: number;
|
|
510
|
+
};
|
|
511
|
+
activeSecuritySchemeIds?: string[];
|
|
512
|
+
requestValues: {
|
|
513
|
+
[field: string]: any;
|
|
514
|
+
};
|
|
515
|
+
request: {
|
|
516
|
+
expandedAll?: boolean;
|
|
517
|
+
};
|
|
518
|
+
response: {
|
|
519
|
+
expandedAll?: boolean;
|
|
520
|
+
};
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
declare interface Options {
|
|
524
|
+
scrollYOffset: () => number;
|
|
525
|
+
sortRequiredPropsFirst: boolean;
|
|
526
|
+
sanitize: boolean;
|
|
527
|
+
hideDownloadButtons: boolean | null;
|
|
528
|
+
hideSidebar: boolean;
|
|
529
|
+
downloadUrls?: DownloadUrlsConfig;
|
|
530
|
+
onlyRequiredInSamples: boolean;
|
|
531
|
+
generatedSamplesMaxDepth: number;
|
|
532
|
+
showExtensions: string[] | boolean;
|
|
533
|
+
hideSchemaTitles: boolean;
|
|
534
|
+
jsonSamplesExpandLevel: number;
|
|
535
|
+
schemasExpansionLevel: number | undefined;
|
|
536
|
+
maxDisplayedEnumValues: number;
|
|
537
|
+
ignoreNamedSchemas: Set<string>;
|
|
538
|
+
schemaDefinitionsTagName?: string;
|
|
539
|
+
layout: LayoutVariant;
|
|
540
|
+
skipBundle: boolean;
|
|
541
|
+
routingBasePath: string;
|
|
542
|
+
codeSamples: CodeSamplesConfig;
|
|
543
|
+
hidePropertiesPrefix: boolean;
|
|
544
|
+
markdocOptions?: {
|
|
545
|
+
tags: Record<string, Schema>;
|
|
546
|
+
nodes: Record<string, Schema>;
|
|
547
|
+
components: Record<string, ComponentType>;
|
|
548
|
+
variables?: Record<string, any>;
|
|
549
|
+
partials?: Record<string, any>;
|
|
550
|
+
functions?: Record<string, ConfigFunction>;
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
declare interface ParsedDescription {
|
|
555
|
+
'x-parsed-md-description'?: GenericObject;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
declare interface ParsedDescriptionWithSummary extends ParsedDescription {
|
|
559
|
+
'x-parsed-md-summary'?: GenericObject;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export declare function Redoc({ onLoaded, children, store, withCommonStyles, disableTelemetry: disableTelemetryProps, router: routerProps, typeOfUsage, }: PropsWithChildren<Partial<RedoclyOpenAPIDocsProps>>): JSX.Element;
|
|
563
|
+
|
|
564
|
+
declare interface RedoclyOpenAPIDocsProps extends RoutingProps, StoreProps {
|
|
565
|
+
onLoaded?: () => void;
|
|
566
|
+
store?: StoreProviderProps;
|
|
567
|
+
withCommonStyles?: boolean;
|
|
568
|
+
disableTelemetry?: boolean;
|
|
569
|
+
typeOfUsage?: 'html' | 'cli' | 'react' | 'docker';
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
export declare function RedocStandalone({ definition, definitionUrl, disableTelemetry, options, activeItemId, activeSampleLanguage, activeDeepLink, router, typeOfUsage, }: RedocStandaloneProps): ReactElement;
|
|
573
|
+
|
|
574
|
+
export declare interface RedocStandaloneProps {
|
|
575
|
+
definition?: Record<string, any>;
|
|
576
|
+
definitionUrl?: string;
|
|
577
|
+
disableTelemetry?: boolean;
|
|
578
|
+
options?: RedocConfig;
|
|
579
|
+
activeItemId?: string;
|
|
580
|
+
activeSampleLanguage?: string;
|
|
581
|
+
activeDeepLink?: string;
|
|
582
|
+
router?: 'hash' | 'history';
|
|
583
|
+
typeOfUsage?: 'html' | 'cli' | 'react' | 'docker';
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
declare type Referenced<T> = T | OpenAPIRef;
|
|
587
|
+
|
|
588
|
+
declare type RouterType = 'history' | 'memory' | 'hash';
|
|
589
|
+
|
|
590
|
+
declare interface RoutingProps {
|
|
591
|
+
/**
|
|
592
|
+
* Only applies when using `history`-based routing. (See the `router` prop.) Specifies the base path under which
|
|
593
|
+
* all API component controlled pages are located. The host must route any location under this path to the API component.
|
|
594
|
+
*/
|
|
595
|
+
basePath?: string;
|
|
596
|
+
/**
|
|
597
|
+
* Only applies when using `static`-based routing. (See the `router` prop.) Specifies the current static path
|
|
598
|
+
* that is being rendered by the StaticRouter, which allows us to properly render the currently active route
|
|
599
|
+
* on the server and already render the content instead of sending an empty page to the client.
|
|
600
|
+
*/
|
|
601
|
+
staticRouterPath?: string;
|
|
602
|
+
/**
|
|
603
|
+
* Which routing solution to use when the user navigates using the table of contents.
|
|
604
|
+
* Only applies when using the *sidebar* layout.
|
|
605
|
+
*
|
|
606
|
+
* - **`history`** - The table of contents pushes entries onto the navigation stack, e.g. `location.pushState`.
|
|
607
|
+
* This requires that the host routes any location under `basePath` (see `basePath` prop) to the API component.
|
|
608
|
+
* - **`hash`** - Navigation happens using hash-fragments (`/some/page#these-fragments-here`).
|
|
609
|
+
* This still allows the user to link to individual pages without requiring the more complex routing setup `history` needs.
|
|
610
|
+
* - **`memory`** - Internal navigation does not change the host `location` at all.
|
|
611
|
+
* This works in every scenario, but it lacks the important feature of being able to link to individual pages.
|
|
612
|
+
* - **`static`** - Renders a single static page for the provided `staticRouterPath`.
|
|
613
|
+
* This can be used when the page is being rendered on the server (either SSR or SSG) to pre-generate the
|
|
614
|
+
* markup of the page, which can be rehydrated on the client. This can reduce the amount of time spent rendering
|
|
615
|
+
* the page on the client.
|
|
616
|
+
*
|
|
617
|
+
* @default "history"
|
|
618
|
+
*/
|
|
619
|
+
router?: RouterType;
|
|
620
|
+
/**
|
|
621
|
+
* Either uses the app's own or the parent router ex. (Portal).
|
|
622
|
+
*
|
|
623
|
+
* @default false
|
|
624
|
+
*/
|
|
625
|
+
disableRouter?: boolean;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
declare interface Sample {
|
|
629
|
+
lang: string;
|
|
630
|
+
label?: string;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export { ServerStyleSheet }
|
|
634
|
+
|
|
635
|
+
declare interface StoreProps {
|
|
636
|
+
options: Options;
|
|
637
|
+
layout: LayoutVariant;
|
|
638
|
+
collapsedSidebar: boolean;
|
|
639
|
+
parser: OpenAPIParser;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
declare interface StoreProviderProps {
|
|
643
|
+
options?: RedocConfig;
|
|
644
|
+
definition: OpenAPIDefinition;
|
|
645
|
+
definitionUrl?: string;
|
|
646
|
+
router?: 'hash' | 'history' | 'memory';
|
|
647
|
+
disableTelemetry?: boolean;
|
|
648
|
+
typeOfUsage?: 'html' | 'cli' | 'react' | 'docker';
|
|
649
|
+
withState?: {
|
|
650
|
+
activeMimeName?: string;
|
|
651
|
+
layout?: LayoutVariant;
|
|
652
|
+
operation?: {
|
|
653
|
+
pointer: string;
|
|
654
|
+
state: Partial<OperationStore>;
|
|
655
|
+
};
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
declare interface XLogo {
|
|
660
|
+
url?: string;
|
|
661
|
+
backgroundColor?: string;
|
|
662
|
+
altText?: string;
|
|
663
|
+
href?: string;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
declare interface XMetadata {
|
|
667
|
+
apiId?: string;
|
|
668
|
+
[key: string]: unknown;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
declare interface XMLObject {
|
|
672
|
+
name?: string;
|
|
673
|
+
namespace?: string;
|
|
674
|
+
prefix?: string;
|
|
675
|
+
attribute?: boolean;
|
|
676
|
+
wrapped?: boolean;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
declare interface XSEO {
|
|
680
|
+
title?: string;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
export { }
|