redoc 2.0.0-rc.9 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +920 -10
- package/README.md +244 -187
- package/bundles/756674defce81e90acea.worker.js.LICENSE.txt +68 -0
- package/bundles/756674defce81e90acea.worker.js.map +1 -0
- package/bundles/redoc.browser.lib.js +1820 -0
- package/bundles/redoc.browser.lib.js.LICENSE.txt +6 -0
- package/bundles/redoc.browser.lib.js.map +1 -0
- package/bundles/redoc.lib.js +1744 -13438
- package/bundles/redoc.lib.js.LICENSE.txt +6 -0
- package/bundles/redoc.lib.js.map +1 -1
- package/bundles/redoc.standalone.js +1819 -122
- package/bundles/redoc.standalone.js.LICENSE.txt +95 -0
- package/bundles/redoc.standalone.js.map +1 -1
- package/package.json +131 -112
- package/typings/common-elements/CopyButtonWrapper.d.ts +4 -10
- package/typings/common-elements/Dropdown/Dropdown.d.ts +3 -0
- package/typings/common-elements/Dropdown/index.d.ts +2 -0
- package/typings/common-elements/Dropdown/styled.d.ts +8 -0
- package/typings/common-elements/Dropdown/types.d.ts +24 -0
- package/typings/common-elements/fields.d.ts +7 -2
- package/typings/common-elements/headers.d.ts +1 -1
- package/typings/common-elements/index.d.ts +1 -1
- package/typings/common-elements/linkify.d.ts +4 -8
- package/typings/common-elements/mixins.d.ts +1 -1
- package/typings/common-elements/panels.d.ts +4 -3
- package/typings/common-elements/samples.d.ts +3 -1
- package/typings/common-elements/schema.d.ts +3 -2
- package/typings/common-elements/shelfs.d.ts +2 -6
- package/typings/components/ApiInfo/styled.elements.d.ts +3 -1
- package/typings/components/ApiLogo/styled.elements.d.ts +1 -0
- package/typings/components/CallbackSamples/CallbackReqSamples.d.ts +11 -0
- package/typings/components/CallbackSamples/CallbackSamples.d.ts +13 -0
- package/typings/components/Callbacks/CallbackDetails.d.ts +8 -0
- package/typings/components/Callbacks/CallbackOperation.d.ts +8 -0
- package/typings/components/Callbacks/CallbackTitle.d.ts +10 -0
- package/typings/components/Callbacks/CallbacksList.d.ts +8 -0
- package/typings/components/Callbacks/index.d.ts +3 -0
- package/typings/components/Callbacks/styled.elements.d.ts +3 -0
- package/typings/components/ContentItems/ContentItems.d.ts +2 -2
- package/typings/components/DropdownOrLabel/DropdownOrLabel.d.ts +6 -3
- package/typings/components/Endpoint/Endpoint.d.ts +1 -0
- package/typings/components/Endpoint/styled.elements.d.ts +3 -2
- package/typings/components/ErrorBoundary.d.ts +2 -2
- package/typings/components/Fields/ArrayItemDetails.d.ts +5 -0
- package/typings/components/Fields/EnumValues.d.ts +8 -2
- package/typings/components/Fields/Examples.d.ts +5 -0
- package/typings/components/Fields/Field.d.ts +4 -2
- package/typings/components/Fields/FieldDetail.d.ts +1 -3
- package/typings/components/Fields/FieldDetails.d.ts +2 -3
- package/typings/components/Fields/Pattern.d.ts +5 -0
- package/typings/components/GenericChildrenSwitcher/GenericChildrenSwitcher.d.ts +22 -0
- package/typings/components/JsonViewer/JsonViewer.d.ts +2 -15
- package/typings/components/JsonViewer/style.d.ts +1 -1
- package/typings/components/Loading/Spinner.svg.d.ts +2 -1
- package/typings/components/Markdown/AdvancedMarkdown.d.ts +1 -0
- package/typings/components/Markdown/Markdown.d.ts +2 -1
- package/typings/components/Markdown/SanitizedMdBlock.d.ts +2 -0
- package/typings/components/Markdown/styled.elements.d.ts +1 -1
- package/typings/components/MediaTypeSwitch/MediaTypesSwitch.d.ts +3 -4
- package/typings/components/Operation/Operation.d.ts +4 -6
- package/typings/components/OptionsProvider.d.ts +2 -2
- package/typings/components/Parameters/Parameters.d.ts +7 -1
- package/typings/components/PayloadSamples/Example.d.ts +1 -0
- package/typings/components/PayloadSamples/ExampleValue.d.ts +1 -0
- package/typings/components/PayloadSamples/MediaTypeSamples.d.ts +11 -1
- package/typings/components/PayloadSamples/styled.elements.d.ts +6 -2
- package/typings/components/RedocStandalone.d.ts +2 -11
- package/typings/components/Responses/Response.d.ts +3 -5
- package/typings/components/Responses/ResponseTitle.d.ts +1 -3
- package/typings/components/Responses/ResponsesList.d.ts +1 -0
- package/typings/components/Responses/styled.elements.d.ts +6 -3
- package/typings/components/Schema/DiscriminatorDropdown.d.ts +2 -4
- package/typings/components/Schema/ObjectSchema.d.ts +2 -5
- package/typings/components/Schema/RecursiveSchema.d.ts +3 -0
- package/typings/components/Schema/Schema.d.ts +2 -1
- package/typings/components/SchemaDefinition/SchemaDefinition.d.ts +18 -0
- package/typings/components/SearchBox/SearchBox.d.ts +6 -4
- package/typings/components/SearchBox/styled.elements.d.ts +2 -1
- package/typings/components/SecurityRequirement/OAuthFlow.d.ts +9 -0
- package/typings/components/SecurityRequirement/RequiredScopesRow.d.ts +4 -0
- package/typings/components/SecurityRequirement/SecurityDetails.d.ts +8 -0
- package/typings/components/SecurityRequirement/SecurityHeader.d.ts +8 -0
- package/typings/components/SecurityRequirement/SecurityRequirement.d.ts +2 -10
- package/typings/components/SecurityRequirement/styled.elements.d.ts +17 -0
- package/typings/components/SecuritySchemes/SecuritySchemes.d.ts +7 -9
- package/typings/components/SeeMore/SeeMore.d.ts +7 -0
- package/typings/components/SelectOnClick/SelectOnClick.d.ts +1 -1
- package/typings/components/SideMenu/Logo.d.ts +2 -0
- package/typings/components/SideMenu/MenuItem.d.ts +7 -4
- package/typings/components/SideMenu/MenuItems.d.ts +1 -1
- package/typings/components/SideMenu/SideMenu.d.ts +3 -1
- package/typings/components/SideMenu/styled.elements.d.ts +12 -13
- package/typings/components/SourceCode/SourceCode.d.ts +3 -7
- package/typings/components/StickySidebar/ChevronSvg.d.ts +1 -0
- package/typings/components/StickySidebar/StickyResponsiveSidebar.d.ts +10 -3
- package/typings/components/StoreBuilder.d.ts +7 -18
- package/typings/components/index.d.ts +6 -0
- package/typings/index.d.ts +3 -1
- package/typings/services/AppStore.d.ts +4 -13
- package/typings/services/HistoryService.d.ts +1 -1
- package/typings/services/Labels.d.ts +1 -12
- package/typings/services/MarkdownRenderer.d.ts +7 -16
- package/typings/services/MenuBuilder.d.ts +16 -21
- package/typings/services/MenuStore.d.ts +10 -23
- package/typings/services/OpenAPIParser.d.ts +21 -23
- package/typings/services/RedocNormalizedOptions.d.ts +61 -6
- package/typings/services/ScrollService.d.ts +1 -1
- package/typings/services/SearchStore.d.ts +5 -3
- package/typings/services/SearchWorker.worker.d.ts +5 -9
- package/typings/services/SpecStore.d.ts +6 -4
- package/typings/services/index.d.ts +1 -0
- package/typings/services/models/ApiInfo.d.ts +6 -3
- package/typings/services/models/Callback.d.ts +11 -0
- package/typings/services/models/Example.d.ts +2 -2
- package/typings/services/models/Field.d.ts +12 -6
- package/typings/services/models/Group.model.d.ts +3 -4
- package/typings/services/models/MediaContent.d.ts +6 -7
- package/typings/services/models/MediaType.d.ts +4 -3
- package/typings/services/models/Operation.d.ts +29 -11
- package/typings/services/models/RequestBody.d.ts +12 -5
- package/typings/services/models/Response.d.ts +14 -4
- package/typings/services/models/Schema.d.ts +16 -7
- package/typings/services/models/SecurityRequirement.d.ts +3 -2
- package/typings/services/models/SecuritySchemes.d.ts +3 -2
- package/typings/services/models/Webhook.d.ts +9 -0
- package/typings/services/models/index.d.ts +1 -0
- package/typings/services/types.d.ts +107 -0
- package/typings/styled-components.d.ts +6 -9
- package/typings/styled-patch.d.ts +0 -10
- package/typings/theme.d.ts +32 -6
- package/typings/types/index.d.ts +0 -6
- package/typings/types/index.ts +3 -0
- package/typings/types/open-api.d.ts +251 -213
- package/typings/types/open-api.ts +297 -0
- package/typings/utils/dom.d.ts +1 -0
- package/typings/utils/helpers.d.ts +10 -5
- package/typings/utils/highlight.d.ts +6 -2
- package/typings/utils/index.d.ts +1 -0
- package/typings/utils/jsonToHtml.d.ts +1 -1
- package/typings/utils/openapi.d.ts +23 -14
- package/typings/utils/sort.d.ts +6 -0
- package/bundles/63bafba847dac11ff66b.worker.js.map +0 -1
- package/bundles/ad47ff28a70e23aac7c4.worker.js.map +0 -1
- package/typings/common-elements/dropdown.d.ts +0 -13
- package/typings/types/components.d.ts +0 -5
- /package/typings/components/Fields/{FieldContstraints.d.ts → FieldConstraints.d.ts} +0 -0
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { IMenuItem } from './
|
|
2
|
-
import { OperationModel } from './models';
|
|
1
|
+
import type { IMenuItem } from './types';
|
|
2
|
+
import type { OperationModel } from './models';
|
|
3
3
|
import Worker from './SearchWorker.worker';
|
|
4
4
|
export declare class SearchStore<T> {
|
|
5
5
|
searchWorker: Worker;
|
|
6
6
|
indexItems(groups: Array<IMenuItem | OperationModel>): void;
|
|
7
7
|
add(title: string, body: string, meta?: T): void;
|
|
8
|
-
|
|
8
|
+
dispose(): void;
|
|
9
|
+
search(q: string): Promise<import("./types").SearchResult<T>[]>;
|
|
9
10
|
toJS(): Promise<{
|
|
10
11
|
store: any[];
|
|
11
12
|
index: object;
|
|
12
13
|
}>;
|
|
13
14
|
load(state: any): void;
|
|
15
|
+
fromExternalJS(path?: string, exportName?: string): void;
|
|
14
16
|
}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
+
import type { SearchResult } from './types';
|
|
1
2
|
export default class Worker {
|
|
2
3
|
add: typeof add;
|
|
3
4
|
done: typeof done;
|
|
4
5
|
search: typeof search;
|
|
5
6
|
toJS: typeof toJS;
|
|
6
7
|
load: typeof load;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
title: string;
|
|
10
|
-
description: string;
|
|
11
|
-
id: string;
|
|
12
|
-
}
|
|
13
|
-
export interface SearchResult<T = string> {
|
|
14
|
-
meta: T;
|
|
15
|
-
score: number;
|
|
8
|
+
dispose: typeof dispose;
|
|
9
|
+
fromExternalJS: typeof fromExternalJS;
|
|
16
10
|
}
|
|
17
11
|
export declare function add<T>(title: string, description: string, meta?: T): void;
|
|
18
12
|
export declare function done(): Promise<void>;
|
|
@@ -20,5 +14,7 @@ export declare function toJS(): Promise<{
|
|
|
20
14
|
store: any[];
|
|
21
15
|
index: object;
|
|
22
16
|
}>;
|
|
17
|
+
export declare function fromExternalJS(path: string, exportName: string): Promise<void>;
|
|
23
18
|
export declare function load(state: any): Promise<void>;
|
|
19
|
+
export declare function dispose(): Promise<void>;
|
|
24
20
|
export declare function search<Meta = string>(q: string, limit?: number): Promise<Array<SearchResult<Meta>>>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { OpenAPIExternalDocumentation, OpenAPISpec } from '../types';
|
|
2
|
-
import { ContentItemModel } from './MenuBuilder';
|
|
1
|
+
import type { OpenAPIExternalDocumentation, OpenAPISpec } from '../types';
|
|
3
2
|
import { ApiInfoModel } from './models/ApiInfo';
|
|
3
|
+
import { WebhookModel } from './models/Webhook';
|
|
4
4
|
import { SecuritySchemesModel } from './models/SecuritySchemes';
|
|
5
5
|
import { OpenAPIParser } from './OpenAPIParser';
|
|
6
|
-
import { RedocNormalizedOptions } from './RedocNormalizedOptions';
|
|
6
|
+
import type { RedocNormalizedOptions } from './RedocNormalizedOptions';
|
|
7
|
+
import type { ContentItemModel } from './types';
|
|
7
8
|
/**
|
|
8
|
-
* Store that
|
|
9
|
+
* Store that contains all the specification related information in the form of tree
|
|
9
10
|
*/
|
|
10
11
|
export declare class SpecStore {
|
|
11
12
|
private options;
|
|
@@ -14,5 +15,6 @@ export declare class SpecStore {
|
|
|
14
15
|
externalDocs?: OpenAPIExternalDocumentation;
|
|
15
16
|
contentItems: ContentItemModel[];
|
|
16
17
|
securitySchemes: SecuritySchemesModel;
|
|
18
|
+
webhooks?: WebhookModel;
|
|
17
19
|
constructor(spec: OpenAPISpec, specUrl: string | undefined, options: RedocNormalizedOptions);
|
|
18
20
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { OpenAPIContact, OpenAPIInfo, OpenAPILicense } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
1
|
+
import type { OpenAPIContact, OpenAPIInfo, OpenAPILicense } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
+
import { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
3
4
|
export declare class ApiInfoModel implements OpenAPIInfo {
|
|
4
5
|
private parser;
|
|
6
|
+
private options;
|
|
5
7
|
title: string;
|
|
6
8
|
version: string;
|
|
7
9
|
description: string;
|
|
10
|
+
summary: string;
|
|
8
11
|
termsOfService?: string;
|
|
9
12
|
contact?: OpenAPIContact;
|
|
10
13
|
license?: OpenAPILicense;
|
|
11
14
|
downloadLink?: string;
|
|
12
15
|
downloadFileName?: string;
|
|
13
|
-
constructor(parser: OpenAPIParser);
|
|
16
|
+
constructor(parser: OpenAPIParser, options?: RedocNormalizedOptions);
|
|
14
17
|
private getDownloadLink;
|
|
15
18
|
private getDownloadFileName;
|
|
16
19
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OperationModel } from './Operation';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
+
import type { OpenAPICallback, Referenced } from '../../types';
|
|
4
|
+
import type { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
5
|
+
export declare class CallbackModel {
|
|
6
|
+
expanded: boolean;
|
|
7
|
+
name: string;
|
|
8
|
+
operations: OperationModel[];
|
|
9
|
+
constructor(parser: OpenAPIParser, name: string, infoOrRef: Referenced<OpenAPICallback>, pointer: string, options: RedocNormalizedOptions);
|
|
10
|
+
toggle(): void;
|
|
11
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenAPIEncoding, OpenAPIExample, Referenced } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
1
|
+
import type { OpenAPIEncoding, OpenAPIExample, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
export declare class ExampleModel {
|
|
4
4
|
mime: string;
|
|
5
5
|
value: any;
|
|
@@ -1,26 +1,32 @@
|
|
|
1
|
-
import { OpenAPIParameter, OpenAPIParameterLocation, OpenAPIParameterStyle, Referenced } from '../../types';
|
|
2
|
-
import { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
3
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
1
|
+
import type { OpenAPIParameter, OpenAPIParameterLocation, OpenAPIParameterStyle, Referenced } from '../../types';
|
|
2
|
+
import type { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
3
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
4
4
|
import { SchemaModel } from './Schema';
|
|
5
|
+
import { ExampleModel } from './Example';
|
|
5
6
|
/**
|
|
6
7
|
* Field or Parameter model ready to be used by components
|
|
7
8
|
*/
|
|
8
9
|
export declare class FieldModel {
|
|
9
|
-
expanded: boolean;
|
|
10
|
+
expanded: boolean | undefined;
|
|
10
11
|
schema: SchemaModel;
|
|
11
12
|
name: string;
|
|
12
13
|
required: boolean;
|
|
13
14
|
description: string;
|
|
14
15
|
example?: string;
|
|
16
|
+
examples?: Record<string, ExampleModel> | any[];
|
|
15
17
|
deprecated: boolean;
|
|
16
18
|
in?: OpenAPIParameterLocation;
|
|
17
19
|
kind: string;
|
|
18
|
-
extensions?:
|
|
20
|
+
extensions?: Record<string, any>;
|
|
19
21
|
explode: boolean;
|
|
20
22
|
style?: OpenAPIParameterStyle;
|
|
23
|
+
const?: any;
|
|
24
|
+
serializationMime?: string;
|
|
21
25
|
constructor(parser: OpenAPIParser, infoOrRef: Referenced<OpenAPIParameter> & {
|
|
22
26
|
name?: string;
|
|
23
27
|
kind?: string;
|
|
24
|
-
}, pointer: string, options: RedocNormalizedOptions);
|
|
28
|
+
}, pointer: string, options: RedocNormalizedOptions, refsStack?: string[]);
|
|
25
29
|
toggle(): void;
|
|
30
|
+
collapse(): void;
|
|
31
|
+
expand(): void;
|
|
26
32
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { OpenAPIExternalDocumentation, OpenAPITag } from '../../types';
|
|
2
|
-
import { MarkdownHeading } from '../
|
|
3
|
-
import { ContentItemModel } from '../MenuBuilder';
|
|
4
|
-
import { IMenuItem, MenuItemGroupType } from '../MenuStore';
|
|
1
|
+
import type { OpenAPIExternalDocumentation, OpenAPITag } from '../../types';
|
|
2
|
+
import type { ContentItemModel, IMenuItem, MarkdownHeading, MenuItemGroupType } from '../types';
|
|
5
3
|
/**
|
|
6
4
|
* Operations Group model ready to be used by components
|
|
7
5
|
*/
|
|
@@ -9,6 +7,7 @@ export declare class GroupModel implements IMenuItem {
|
|
|
9
7
|
id: string;
|
|
10
8
|
absoluteIdx?: number;
|
|
11
9
|
name: string;
|
|
10
|
+
sidebarLabel: string;
|
|
12
11
|
description?: string;
|
|
13
12
|
type: MenuItemGroupType;
|
|
14
13
|
items: ContentItemModel[];
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { OpenAPIMediaType } from '../../types';
|
|
1
|
+
import type { OpenAPIMediaType } from '../../types';
|
|
2
2
|
import { MediaTypeModel } from './MediaType';
|
|
3
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
4
|
-
import { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
3
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
4
|
+
import type { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
5
5
|
/**
|
|
6
6
|
* MediaContent model ready to be sued by React components
|
|
7
7
|
* Contains multiple MediaTypes and keeps track of the currently active one
|
|
8
8
|
*/
|
|
9
9
|
export declare class MediaContentModel {
|
|
10
|
-
parser: OpenAPIParser;
|
|
11
10
|
isRequestType: boolean;
|
|
12
11
|
mediaTypes: MediaTypeModel[];
|
|
13
12
|
activeMimeIdx: number;
|
|
14
13
|
/**
|
|
15
14
|
* @param isRequestType needed to know if skipe RO/RW fields in objects
|
|
16
15
|
*/
|
|
17
|
-
constructor(parser: OpenAPIParser, info:
|
|
16
|
+
constructor(parser: OpenAPIParser, info: Record<string, OpenAPIMediaType>, isRequestType: boolean, options: RedocNormalizedOptions);
|
|
18
17
|
/**
|
|
19
18
|
* Set active media type by index
|
|
20
19
|
* @param idx media type index
|
|
21
20
|
*/
|
|
22
21
|
activate(idx: number): void;
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
get active(): MediaTypeModel;
|
|
23
|
+
get hasSample(): boolean;
|
|
25
24
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OpenAPIMediaType } from '../../types';
|
|
2
|
-
import { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
1
|
+
import type { OpenAPIMediaType } from '../../types';
|
|
2
|
+
import type { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
3
3
|
import { SchemaModel } from './Schema';
|
|
4
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
4
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
5
5
|
import { ExampleModel } from './Example';
|
|
6
6
|
export declare class MediaTypeModel {
|
|
7
7
|
examples?: {
|
|
@@ -11,6 +11,7 @@ export declare class MediaTypeModel {
|
|
|
11
11
|
name: string;
|
|
12
12
|
isRequestType: boolean;
|
|
13
13
|
onlyRequiredInSamples: boolean;
|
|
14
|
+
generatedPayloadSamplesMaxDepth: number;
|
|
14
15
|
/**
|
|
15
16
|
* @param isRequestType needed to know if skipe RO/RW fields in objects
|
|
16
17
|
*/
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { IMenuItem } from '../MenuStore';
|
|
2
1
|
import { GroupModel } from './Group.model';
|
|
3
2
|
import { SecurityRequirementModel } from './SecurityRequirement';
|
|
4
|
-
import {
|
|
5
|
-
import { ContentItemModel, ExtendedOpenAPIOperation } from '../MenuBuilder';
|
|
6
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
7
|
-
import { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
3
|
+
import { CallbackModel } from './Callback';
|
|
8
4
|
import { FieldModel } from './Field';
|
|
9
5
|
import { RequestBodyModel } from './RequestBody';
|
|
10
6
|
import { ResponseModel } from './Response';
|
|
7
|
+
import type { OpenAPIExternalDocumentation, OpenAPIServer, OpenAPIXCodeSample } from '../../types';
|
|
8
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
9
|
+
import type { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
10
|
+
import type { MediaContentModel } from './MediaContent';
|
|
11
|
+
import type { ContentItemModel, ExtendedOpenAPIOperation, IMenuItem } from '../types';
|
|
12
|
+
export interface XPayloadSample {
|
|
13
|
+
lang: 'payload';
|
|
14
|
+
label: string;
|
|
15
|
+
requestBodyContent: MediaContentModel;
|
|
16
|
+
source: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function isPayloadSample(sample: XPayloadSample | OpenAPIXCodeSample): sample is XPayloadSample;
|
|
11
19
|
/**
|
|
12
20
|
* Operation model ready to be used by components
|
|
13
21
|
*/
|
|
@@ -18,6 +26,7 @@ export declare class OperationModel implements IMenuItem {
|
|
|
18
26
|
id: string;
|
|
19
27
|
absoluteIdx?: number;
|
|
20
28
|
name: string;
|
|
29
|
+
sidebarLabel: string;
|
|
21
30
|
description?: string;
|
|
22
31
|
type: "operation";
|
|
23
32
|
parent?: GroupModel;
|
|
@@ -29,14 +38,17 @@ export declare class OperationModel implements IMenuItem {
|
|
|
29
38
|
expanded: boolean;
|
|
30
39
|
pointer: string;
|
|
31
40
|
operationId?: string;
|
|
41
|
+
operationHash?: string;
|
|
32
42
|
httpVerb: string;
|
|
33
43
|
deprecated: boolean;
|
|
34
44
|
path: string;
|
|
35
45
|
servers: OpenAPIServer[];
|
|
36
46
|
security: SecurityRequirementModel[];
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
extensions: Record<string, any>;
|
|
48
|
+
isCallback: boolean;
|
|
49
|
+
isWebhook: boolean;
|
|
50
|
+
isEvent: boolean;
|
|
51
|
+
constructor(parser: OpenAPIParser, operationSpec: ExtendedOpenAPIOperation, parent: GroupModel | undefined, options: RedocNormalizedOptions, isCallback?: boolean);
|
|
40
52
|
/**
|
|
41
53
|
* set operation as active (used by side menu)
|
|
42
54
|
*/
|
|
@@ -45,9 +57,15 @@ export declare class OperationModel implements IMenuItem {
|
|
|
45
57
|
* set operation as inactive (used by side menu)
|
|
46
58
|
*/
|
|
47
59
|
deactivate(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Toggle expansion in middle panel (for callbacks, which are operations)
|
|
62
|
+
*/
|
|
63
|
+
toggle(): void;
|
|
48
64
|
expand(): void;
|
|
49
65
|
collapse(): void;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
66
|
+
get requestBody(): RequestBodyModel | undefined;
|
|
67
|
+
get codeSamples(): (OpenAPIXCodeSample | XPayloadSample)[];
|
|
68
|
+
get parameters(): FieldModel[];
|
|
69
|
+
get responses(): ResponseModel[];
|
|
70
|
+
get callbacks(): CallbackModel[];
|
|
53
71
|
}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import { OpenAPIRequestBody, Referenced } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
-
import { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
1
|
+
import type { OpenAPIRequestBody, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
+
import type { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
4
4
|
import { MediaContentModel } from './MediaContent';
|
|
5
|
+
type RequestBodyProps = {
|
|
6
|
+
parser: OpenAPIParser;
|
|
7
|
+
infoOrRef: Referenced<OpenAPIRequestBody>;
|
|
8
|
+
options: RedocNormalizedOptions;
|
|
9
|
+
isEvent: boolean;
|
|
10
|
+
};
|
|
5
11
|
export declare class RequestBodyModel {
|
|
6
12
|
description: string;
|
|
7
|
-
required
|
|
13
|
+
required?: boolean;
|
|
8
14
|
content?: MediaContentModel;
|
|
9
|
-
constructor(parser
|
|
15
|
+
constructor({ parser, infoOrRef, options, isEvent }: RequestBodyProps);
|
|
10
16
|
}
|
|
17
|
+
export {};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { OpenAPIResponse, Referenced } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
-
import { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
1
|
+
import type { OpenAPIResponse, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
+
import type { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
4
4
|
import { FieldModel } from './Field';
|
|
5
5
|
import { MediaContentModel } from './MediaContent';
|
|
6
|
+
type ResponseProps = {
|
|
7
|
+
parser: OpenAPIParser;
|
|
8
|
+
code: string;
|
|
9
|
+
defaultAsError: boolean;
|
|
10
|
+
infoOrRef: Referenced<OpenAPIResponse>;
|
|
11
|
+
options: RedocNormalizedOptions;
|
|
12
|
+
isEvent: boolean;
|
|
13
|
+
};
|
|
6
14
|
export declare class ResponseModel {
|
|
7
15
|
expanded: boolean;
|
|
8
16
|
content?: MediaContentModel;
|
|
@@ -11,6 +19,8 @@ export declare class ResponseModel {
|
|
|
11
19
|
description: string;
|
|
12
20
|
type: string;
|
|
13
21
|
headers: FieldModel[];
|
|
14
|
-
|
|
22
|
+
extensions: Record<string, any>;
|
|
23
|
+
constructor({ parser, code, defaultAsError, infoOrRef, options, isEvent: isRequest, }: ResponseProps);
|
|
15
24
|
toggle(): void;
|
|
16
25
|
}
|
|
26
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { OpenAPIExternalDocumentation, OpenAPISchema, Referenced } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
-
import { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
1
|
+
import type { OpenAPIExternalDocumentation, OpenAPISchema, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
+
import type { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
4
4
|
import { FieldModel } from './Field';
|
|
5
|
-
import { MergedOpenAPISchema } from '../';
|
|
5
|
+
import { MergedOpenAPISchema } from '../types';
|
|
6
6
|
export declare class SchemaModel {
|
|
7
7
|
private options;
|
|
8
|
+
private refsStack;
|
|
8
9
|
pointer: string;
|
|
9
|
-
type: string;
|
|
10
|
+
type: string | string[];
|
|
10
11
|
displayType: string;
|
|
11
12
|
typePrefix: string;
|
|
12
13
|
title: string;
|
|
@@ -20,6 +21,7 @@ export declare class SchemaModel {
|
|
|
20
21
|
deprecated: boolean;
|
|
21
22
|
pattern?: string;
|
|
22
23
|
example?: any;
|
|
24
|
+
examples?: any[];
|
|
23
25
|
enum: any[];
|
|
24
26
|
default?: any;
|
|
25
27
|
readOnly: boolean;
|
|
@@ -33,18 +35,25 @@ export declare class SchemaModel {
|
|
|
33
35
|
activeOneOf: number;
|
|
34
36
|
rawSchema: OpenAPISchema;
|
|
35
37
|
schema: MergedOpenAPISchema;
|
|
36
|
-
extensions?:
|
|
38
|
+
extensions?: Record<string, any>;
|
|
39
|
+
const: any;
|
|
40
|
+
contentEncoding?: string;
|
|
41
|
+
contentMediaType?: string;
|
|
42
|
+
minItems?: number;
|
|
43
|
+
maxItems?: number;
|
|
37
44
|
/**
|
|
38
45
|
* @param isChild if schema discriminator Child
|
|
39
46
|
* When true forces dereferencing in allOfs even if circular
|
|
40
47
|
*/
|
|
41
|
-
constructor(parser: OpenAPIParser, schemaOrRef: Referenced<OpenAPISchema>, pointer: string, options: RedocNormalizedOptions, isChild?: boolean);
|
|
48
|
+
constructor(parser: OpenAPIParser, schemaOrRef: Referenced<OpenAPISchema>, pointer: string, options: RedocNormalizedOptions, isChild?: boolean, refsStack?: string[]);
|
|
42
49
|
/**
|
|
43
50
|
* Set specified alternative schema as active
|
|
44
51
|
* @param idx oneOf index
|
|
45
52
|
*/
|
|
46
53
|
activateOneOf(idx: number): void;
|
|
54
|
+
hasType(type: string): boolean;
|
|
47
55
|
init(parser: OpenAPIParser, isChild: boolean): void;
|
|
48
56
|
private initOneOf;
|
|
49
57
|
private initDiscriminator;
|
|
58
|
+
private initConditionalOperators;
|
|
50
59
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { OpenAPISecurityRequirement, OpenAPISecurityScheme } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
1
|
+
import type { OpenAPISecurityRequirement, OpenAPISecurityScheme } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
export interface SecurityScheme extends OpenAPISecurityScheme {
|
|
4
4
|
id: string;
|
|
5
5
|
sectionId: string;
|
|
6
|
+
displayName: string;
|
|
6
7
|
scopes: string[];
|
|
7
8
|
}
|
|
8
9
|
export declare class SecurityRequirementModel {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { OpenAPISecurityScheme, Referenced } from '../../types';
|
|
2
|
-
import { OpenAPIParser } from '../OpenAPIParser';
|
|
1
|
+
import type { OpenAPISecurityScheme, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
export declare class SecuritySchemeModel {
|
|
4
4
|
id: string;
|
|
5
5
|
sectionId: string;
|
|
6
6
|
type: OpenAPISecurityScheme['type'];
|
|
7
7
|
description: string;
|
|
8
|
+
displayName: string;
|
|
8
9
|
apiKey?: {
|
|
9
10
|
name: string;
|
|
10
11
|
in: OpenAPISecurityScheme['in'];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OpenAPIPath, Referenced } from '../../types';
|
|
2
|
+
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
|
+
import { OperationModel } from './Operation';
|
|
4
|
+
import type { RedocNormalizedOptions } from '../RedocNormalizedOptions';
|
|
5
|
+
export declare class WebhookModel {
|
|
6
|
+
operations: OperationModel[];
|
|
7
|
+
constructor(parser: OpenAPIParser, options: RedocNormalizedOptions, infoOrRef?: Referenced<OpenAPIPath>);
|
|
8
|
+
initWebhooks(parser: OpenAPIParser, webhooks: OpenAPIPath, options: RedocNormalizedOptions): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { OpenAPIOperation, OpenAPIParameter, OpenAPISchema, OpenAPIServer, OpenAPITag, Referenced } from '../types';
|
|
3
|
+
import { AppStore } from './AppStore';
|
|
4
|
+
import { GroupModel } from './models';
|
|
5
|
+
import { OperationModel } from './models/Operation';
|
|
6
|
+
import { RedocRawOptions } from './RedocNormalizedOptions';
|
|
7
|
+
export interface StoreState {
|
|
8
|
+
menu: {
|
|
9
|
+
activeItemIdx: number;
|
|
10
|
+
};
|
|
11
|
+
spec: {
|
|
12
|
+
url?: string;
|
|
13
|
+
data: any;
|
|
14
|
+
};
|
|
15
|
+
searchIndex: any;
|
|
16
|
+
options: RedocRawOptions;
|
|
17
|
+
}
|
|
18
|
+
export interface LabelsConfig {
|
|
19
|
+
enum: string;
|
|
20
|
+
enumSingleValue: string;
|
|
21
|
+
enumArray: string;
|
|
22
|
+
default: string;
|
|
23
|
+
deprecated: string;
|
|
24
|
+
example: string;
|
|
25
|
+
examples: string;
|
|
26
|
+
recursive: string;
|
|
27
|
+
arrayOf: string;
|
|
28
|
+
webhook: string;
|
|
29
|
+
const: string;
|
|
30
|
+
noResultsFound: string;
|
|
31
|
+
download: string;
|
|
32
|
+
downloadSpecification: string;
|
|
33
|
+
responses: string;
|
|
34
|
+
callbackResponses: string;
|
|
35
|
+
requestSamples: string;
|
|
36
|
+
responseSamples: string;
|
|
37
|
+
}
|
|
38
|
+
export type LabelsConfigRaw = Partial<LabelsConfig>;
|
|
39
|
+
export interface MDXComponentMeta {
|
|
40
|
+
component: React.ComponentType;
|
|
41
|
+
propsSelector: (store?: AppStore) => any;
|
|
42
|
+
props?: object;
|
|
43
|
+
}
|
|
44
|
+
export interface MarkdownHeading {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
level: number;
|
|
48
|
+
items?: MarkdownHeading[];
|
|
49
|
+
description?: string;
|
|
50
|
+
}
|
|
51
|
+
export type ContentItemModel = GroupModel | OperationModel;
|
|
52
|
+
export type TagInfo = OpenAPITag & {
|
|
53
|
+
operations: ExtendedOpenAPIOperation[];
|
|
54
|
+
used?: boolean;
|
|
55
|
+
};
|
|
56
|
+
export type ExtendedOpenAPIOperation = {
|
|
57
|
+
pointer: string;
|
|
58
|
+
pathName: string;
|
|
59
|
+
httpVerb: string;
|
|
60
|
+
pathParameters: Array<Referenced<OpenAPIParameter>>;
|
|
61
|
+
pathServers: Array<OpenAPIServer> | undefined;
|
|
62
|
+
isWebhook: boolean;
|
|
63
|
+
} & OpenAPIOperation;
|
|
64
|
+
export type TagsInfoMap = Record<string, TagInfo>;
|
|
65
|
+
export interface TagGroup {
|
|
66
|
+
name: string;
|
|
67
|
+
tags: string[];
|
|
68
|
+
}
|
|
69
|
+
export type MenuItemGroupType = 'group' | 'tag' | 'section' | 'schema';
|
|
70
|
+
export type MenuItemType = MenuItemGroupType | 'operation';
|
|
71
|
+
export interface IMenuItem {
|
|
72
|
+
id: string;
|
|
73
|
+
absoluteIdx?: number;
|
|
74
|
+
name: string;
|
|
75
|
+
sidebarLabel: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
depth: number;
|
|
78
|
+
active: boolean;
|
|
79
|
+
expanded: boolean;
|
|
80
|
+
items: IMenuItem[];
|
|
81
|
+
parent?: IMenuItem;
|
|
82
|
+
deprecated?: boolean;
|
|
83
|
+
type: MenuItemType;
|
|
84
|
+
deactivate(): void;
|
|
85
|
+
activate(): void;
|
|
86
|
+
collapse(): void;
|
|
87
|
+
expand(): void;
|
|
88
|
+
}
|
|
89
|
+
export interface SearchDocument {
|
|
90
|
+
title: string;
|
|
91
|
+
description: string;
|
|
92
|
+
id: string;
|
|
93
|
+
}
|
|
94
|
+
export interface SearchResult<T = string> {
|
|
95
|
+
meta: T;
|
|
96
|
+
score: number;
|
|
97
|
+
}
|
|
98
|
+
export declare enum SideNavStyleEnum {
|
|
99
|
+
SummaryOnly = "summary-only",
|
|
100
|
+
PathOnly = "path-only",
|
|
101
|
+
IdOnly = "id-only"
|
|
102
|
+
}
|
|
103
|
+
export type MergedOpenAPISchema = OpenAPISchema & {
|
|
104
|
+
'x-refsStack'?: string[];
|
|
105
|
+
'x-parentRefs'?: string[];
|
|
106
|
+
'x-circular-ref'?: boolean;
|
|
107
|
+
};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import * as styledComponents from 'styled-components';
|
|
2
|
-
import { ResolvedThemeInterface } from './theme';
|
|
3
|
-
export { ResolvedThemeInterface };
|
|
4
|
-
declare const styled: styledComponents.
|
|
5
|
-
(strings: TemplateStringsArray | styledComponents.CSSKeyframes, ...interpolations: styledComponents.SimpleInterpolation[]): styledComponents.Keyframes;
|
|
6
|
-
(strings: string[] | TemplateStringsArray, ...interpolations: styledComponents.SimpleInterpolation[]): styledComponents.Keyframes;
|
|
7
|
-
}, ThemeProvider: import("react").ComponentClass<styledComponents.ThemeProviderProps<ResolvedThemeInterface, ResolvedThemeInterface>, any>;
|
|
2
|
+
import type { ResolvedThemeInterface } from './theme';
|
|
3
|
+
export type { ResolvedThemeInterface };
|
|
4
|
+
declare const styled: styledComponents.ThemedStyledInterface<ResolvedThemeInterface>, css: styledComponents.ThemedCssFunction<ResolvedThemeInterface>, createGlobalStyle: <P extends object = {}>(first: TemplateStringsArray | styledComponents.CSSObject | styledComponents.InterpolationFunction<styledComponents.ThemedStyledProps<P, ResolvedThemeInterface>>, ...interpolations: styledComponents.Interpolation<styledComponents.ThemedStyledProps<P, ResolvedThemeInterface>>[]) => styledComponents.GlobalStyleComponent<P, ResolvedThemeInterface>, keyframes: (strings: TemplateStringsArray | styledComponents.CSSKeyframes, ...interpolations: styledComponents.SimpleInterpolation[]) => styledComponents.Keyframes, ThemeProvider: styledComponents.BaseThemeProviderComponent<ResolvedThemeInterface, ResolvedThemeInterface>;
|
|
8
5
|
export declare const media: {
|
|
9
|
-
lessThan(breakpoint: any, print?: boolean
|
|
10
|
-
greaterThan(breakpoint: any): (...args: any[]) => styledComponents.FlattenInterpolation<styledComponents.
|
|
11
|
-
between(firstBreakpoint: any, secondBreakpoint: any): (...args: any[]) => styledComponents.FlattenInterpolation<styledComponents.
|
|
6
|
+
lessThan(breakpoint: any, print?: boolean, extra?: string): (...args: any[]) => styledComponents.FlattenInterpolation<styledComponents.ThemedStyledProps<object, ResolvedThemeInterface>>;
|
|
7
|
+
greaterThan(breakpoint: any): (...args: any[]) => styledComponents.FlattenInterpolation<styledComponents.ThemedStyledProps<object, ResolvedThemeInterface>>;
|
|
8
|
+
between(firstBreakpoint: any, secondBreakpoint: any): (...args: any[]) => styledComponents.FlattenInterpolation<styledComponents.ThemedStyledProps<object, ResolvedThemeInterface>>;
|
|
12
9
|
};
|
|
13
10
|
export { css, createGlobalStyle, keyframes, ThemeProvider };
|
|
14
11
|
export default styled;
|
|
@@ -2,16 +2,6 @@ import * as styledComponents from 'styled-components';
|
|
|
2
2
|
|
|
3
3
|
// FIXME
|
|
4
4
|
declare module 'styled-components' {
|
|
5
|
-
export interface ThemedStyledFunction<
|
|
6
|
-
C extends keyof JSX.IntrinsicElements | React.ComponentType<any>,
|
|
7
|
-
T extends object,
|
|
8
|
-
O extends object = {},
|
|
9
|
-
A extends keyof any = never
|
|
10
|
-
> extends ThemedStyledFunctionBase<C, T, O, A> {
|
|
11
|
-
withConfig(config: any): any;
|
|
12
|
-
// tslint:enable:unified-signatures
|
|
13
|
-
}
|
|
14
|
-
|
|
15
5
|
interface ThemedStyledComponentsModule<T> {
|
|
16
6
|
keyframes(
|
|
17
7
|
strings: TemplateStringsArray | string[],
|