redoc 2.3.0 → 2.4.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 +15 -0
- package/README.md +0 -2
- package/bundles/a6b6d6494d34d2b1b721.worker.js.LICENSE.txt +1 -1
- package/bundles/redoc.browser.lib.js +122 -118
- package/bundles/redoc.browser.lib.js.LICENSE.txt +1 -1
- package/bundles/redoc.browser.lib.js.map +1 -1
- package/bundles/redoc.lib.js +116 -112
- package/bundles/redoc.lib.js.LICENSE.txt +1 -1
- package/bundles/redoc.lib.js.map +1 -1
- package/bundles/redoc.standalone.js +94 -90
- package/bundles/redoc.standalone.js.LICENSE.txt +1 -1
- package/bundles/redoc.standalone.js.map +1 -1
- package/package.json +3 -3
- package/typings/components/ApiInfo/ApiInfo.d.ts +0 -1
- package/typings/components/Fields/EnumValues.d.ts +5 -2
- package/typings/components/Fields/Field.d.ts +4 -0
- package/typings/components/Schema/ObjectSchema.d.ts +2 -1
- package/typings/components/Schema/Schema.d.ts +1 -0
- package/typings/services/MenuBuilder.d.ts +4 -3
- package/typings/services/RedocNormalizedOptions.d.ts +22 -6
- package/typings/services/models/ApiInfo.d.ts +5 -1
- package/typings/services/models/MediaType.d.ts +1 -1
- package/typings/services/models/Schema.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redoc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "ReDoc",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -133,8 +133,8 @@
|
|
|
133
133
|
"peerDependencies": {
|
|
134
134
|
"core-js": "^3.1.4",
|
|
135
135
|
"mobx": "^6.0.4",
|
|
136
|
-
"react": "^16.8.4 || ^17.0.0 || ^18.0.0",
|
|
137
|
-
"react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0",
|
|
136
|
+
"react": "^16.8.4 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
137
|
+
"react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
138
138
|
"styled-components": "^4.1.1 || ^5.1.1 || ^6.0.5"
|
|
139
139
|
},
|
|
140
140
|
"dependencies": {
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface EnumValuesProps {
|
|
3
|
-
values
|
|
4
|
-
|
|
3
|
+
values?: string[] | {
|
|
4
|
+
[name: string]: string;
|
|
5
|
+
};
|
|
6
|
+
type: string | string[];
|
|
5
7
|
}
|
|
6
8
|
export interface EnumValuesState {
|
|
7
9
|
collapsed: boolean;
|
|
8
10
|
}
|
|
9
11
|
export declare class EnumValues extends React.PureComponent<EnumValuesProps, EnumValuesState> {
|
|
12
|
+
constructor(props: EnumValuesProps);
|
|
10
13
|
state: EnumValuesState;
|
|
11
14
|
static contextType: React.Context<import("../../services/RedocNormalizedOptions").RedocNormalizedOptions>;
|
|
12
15
|
private toggle;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { SchemaOptions } from '../Schema/Schema';
|
|
3
3
|
import type { FieldModel } from '../../services/models';
|
|
4
|
+
import { RedocNormalizedOptions } from '../../services/RedocNormalizedOptions';
|
|
4
5
|
export interface FieldProps extends SchemaOptions {
|
|
5
6
|
className?: string;
|
|
6
7
|
isLast?: boolean;
|
|
7
8
|
showExamples?: boolean;
|
|
8
9
|
field: FieldModel;
|
|
9
10
|
expandByDefault?: boolean;
|
|
11
|
+
fieldParentsName?: string[];
|
|
10
12
|
renderDiscriminatorSwitch?: (opts: FieldProps) => JSX.Element;
|
|
11
13
|
}
|
|
12
14
|
export declare class Field extends React.Component<FieldProps> {
|
|
15
|
+
static contextType: React.Context<RedocNormalizedOptions>;
|
|
16
|
+
context: RedocNormalizedOptions;
|
|
13
17
|
toggle: () => void;
|
|
14
18
|
handleKeyPress: (e: any) => void;
|
|
15
19
|
render(): React.JSX.Element;
|
|
@@ -6,5 +6,6 @@ export interface ObjectSchemaProps extends SchemaProps {
|
|
|
6
6
|
fieldName: string;
|
|
7
7
|
parentSchema: SchemaModel;
|
|
8
8
|
};
|
|
9
|
+
fieldParentsName?: string[];
|
|
9
10
|
}
|
|
10
|
-
export declare const ObjectSchema: ({ schema: { fields, title }, showTitle, discriminator, skipReadOnly, skipWriteOnly, level, }: ObjectSchemaProps) => React.JSX.Element;
|
|
11
|
+
export declare const ObjectSchema: ({ schema: { fields, title }, showTitle, discriminator, skipReadOnly, skipWriteOnly, level, fieldParentsName, }: ObjectSchemaProps) => React.JSX.Element;
|
|
@@ -8,6 +8,7 @@ export interface SchemaOptions {
|
|
|
8
8
|
}
|
|
9
9
|
export interface SchemaProps extends SchemaOptions {
|
|
10
10
|
schema: SchemaModel;
|
|
11
|
+
fieldParentsName?: string[];
|
|
11
12
|
}
|
|
12
13
|
export declare class Schema extends React.Component<Partial<SchemaProps>> {
|
|
13
14
|
render(): React.JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OpenAPITag } from '../types';
|
|
2
2
|
import { GroupModel, OperationModel } from './models';
|
|
3
3
|
import type { OpenAPIParser } from './OpenAPIParser';
|
|
4
4
|
import type { RedocNormalizedOptions } from './RedocNormalizedOptions';
|
|
@@ -40,10 +40,11 @@ export declare class MenuBuilder {
|
|
|
40
40
|
/**
|
|
41
41
|
* collects tags and maps each tag to list of operations belonging to this tag
|
|
42
42
|
*/
|
|
43
|
-
static getTagsWithOperations(parser: OpenAPIParser,
|
|
44
|
-
static getTagRelatedSchema({ parser, tag, parent, }: {
|
|
43
|
+
static getTagsWithOperations(parser: OpenAPIParser, explicitTags: OpenAPITag[]): TagsInfoMap;
|
|
44
|
+
static getTagRelatedSchema({ parser, tag, parent, schemaDefinitionsTagName, }: {
|
|
45
45
|
parser: OpenAPIParser;
|
|
46
46
|
tag: TagInfo;
|
|
47
47
|
parent: GroupModel;
|
|
48
|
+
schemaDefinitionsTagName?: string;
|
|
48
49
|
}): GroupModel[];
|
|
49
50
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { ResolvedThemeInterface, ThemeInterface } from '../theme';
|
|
2
2
|
import { SideNavStyleEnum } from './types';
|
|
3
3
|
import type { LabelsConfigRaw, MDXComponentMeta } from './types';
|
|
4
|
+
export type DownloadUrlsConfig = {
|
|
5
|
+
title?: string;
|
|
6
|
+
url: string;
|
|
7
|
+
}[];
|
|
4
8
|
export interface RedocRawOptions {
|
|
5
9
|
theme?: ThemeInterface;
|
|
6
10
|
scrollYOffset?: number | string | (() => number);
|
|
7
11
|
hideHostname?: boolean | string;
|
|
8
12
|
expandResponses?: string | 'all';
|
|
9
13
|
requiredPropsFirst?: boolean | string;
|
|
14
|
+
sortRequiredPropsFirst?: boolean | string;
|
|
10
15
|
sortPropsAlphabetically?: boolean | string;
|
|
11
16
|
sortEnumValuesAlphabetically?: boolean | string;
|
|
12
17
|
sortOperationsAlphabetically?: boolean | string;
|
|
@@ -14,10 +19,13 @@ export interface RedocRawOptions {
|
|
|
14
19
|
nativeScrollbars?: boolean | string;
|
|
15
20
|
pathInMiddlePanel?: boolean | string;
|
|
16
21
|
untrustedSpec?: boolean | string;
|
|
22
|
+
sanitize?: boolean | string;
|
|
17
23
|
hideLoading?: boolean | string;
|
|
18
24
|
hideDownloadButton?: boolean | string;
|
|
25
|
+
hideDownloadButtons?: boolean | string;
|
|
19
26
|
downloadFileName?: string;
|
|
20
27
|
downloadDefinitionUrl?: string;
|
|
28
|
+
downloadUrls?: DownloadUrlsConfig;
|
|
21
29
|
disableSearch?: boolean | string;
|
|
22
30
|
onlyRequiredInSamples?: boolean | string;
|
|
23
31
|
showExtensions?: boolean | string | string[];
|
|
@@ -26,11 +34,14 @@ export interface RedocRawOptions {
|
|
|
26
34
|
hideRequestPayloadSample?: boolean;
|
|
27
35
|
menuToggle?: boolean | string;
|
|
28
36
|
jsonSampleExpandLevel?: number | string | 'all';
|
|
37
|
+
jsonSamplesExpandLevel?: number | string | 'all';
|
|
29
38
|
hideSchemaTitles?: boolean | string;
|
|
30
39
|
simpleOneOfTypeLabel?: boolean | string;
|
|
31
40
|
payloadSampleIdx?: number;
|
|
32
41
|
expandSingleSchemaField?: boolean | string;
|
|
33
42
|
schemaExpansionLevel?: number | string | 'all';
|
|
43
|
+
schemasExpansionLevel?: number | string | 'all';
|
|
44
|
+
schemaDefinitionsTagName?: string;
|
|
34
45
|
showObjectSchemaExamples?: boolean | string;
|
|
35
46
|
showSecuritySchemeType?: boolean;
|
|
36
47
|
hideSecuritySection?: boolean;
|
|
@@ -43,10 +54,12 @@ export interface RedocRawOptions {
|
|
|
43
54
|
ignoreNamedSchemas?: string[] | string;
|
|
44
55
|
hideSchemaPattern?: boolean;
|
|
45
56
|
generatedPayloadSamplesMaxDepth?: number;
|
|
57
|
+
generatedSamplesMaxDepth?: number;
|
|
46
58
|
nonce?: string;
|
|
47
59
|
hideFab?: boolean;
|
|
48
60
|
minCharacterLengthToInitSearch?: number;
|
|
49
61
|
showWebhookVerb?: boolean;
|
|
62
|
+
hidePropertiesPrefix?: boolean;
|
|
50
63
|
}
|
|
51
64
|
export declare function argValueToBoolean(val?: string | boolean, defaultValue?: boolean): boolean;
|
|
52
65
|
export declare class RedocNormalizedOptions {
|
|
@@ -64,17 +77,18 @@ export declare class RedocNormalizedOptions {
|
|
|
64
77
|
expandResponses: {
|
|
65
78
|
[code: string]: boolean;
|
|
66
79
|
} | 'all';
|
|
67
|
-
|
|
80
|
+
sortRequiredPropsFirst: boolean;
|
|
68
81
|
sortPropsAlphabetically: boolean;
|
|
69
82
|
sortEnumValuesAlphabetically: boolean;
|
|
70
83
|
sortOperationsAlphabetically: boolean;
|
|
71
84
|
sortTagsAlphabetically: boolean;
|
|
72
85
|
nativeScrollbars: boolean;
|
|
73
86
|
pathInMiddlePanel: boolean;
|
|
74
|
-
|
|
75
|
-
|
|
87
|
+
sanitize: boolean;
|
|
88
|
+
hideDownloadButtons: boolean;
|
|
76
89
|
downloadFileName?: string;
|
|
77
90
|
downloadDefinitionUrl?: string;
|
|
91
|
+
downloadUrls?: DownloadUrlsConfig;
|
|
78
92
|
disableSearch: boolean;
|
|
79
93
|
onlyRequiredInSamples: boolean;
|
|
80
94
|
showExtensions: boolean | string[];
|
|
@@ -82,13 +96,14 @@ export declare class RedocNormalizedOptions {
|
|
|
82
96
|
hideSingleRequestSampleTab: boolean;
|
|
83
97
|
hideRequestPayloadSample: boolean;
|
|
84
98
|
menuToggle: boolean;
|
|
85
|
-
|
|
99
|
+
jsonSamplesExpandLevel: number;
|
|
86
100
|
enumSkipQuotes: boolean;
|
|
87
101
|
hideSchemaTitles: boolean;
|
|
88
102
|
simpleOneOfTypeLabel: boolean;
|
|
89
103
|
payloadSampleIdx: number;
|
|
90
104
|
expandSingleSchemaField: boolean;
|
|
91
|
-
|
|
105
|
+
schemasExpansionLevel: number;
|
|
106
|
+
schemaDefinitionsTagName?: string;
|
|
92
107
|
showObjectSchemaExamples: boolean;
|
|
93
108
|
showSecuritySchemeType?: boolean;
|
|
94
109
|
hideSecuritySection?: boolean;
|
|
@@ -98,10 +113,11 @@ export declare class RedocNormalizedOptions {
|
|
|
98
113
|
maxDisplayedEnumValues?: number;
|
|
99
114
|
ignoreNamedSchemas: Set<string>;
|
|
100
115
|
hideSchemaPattern: boolean;
|
|
101
|
-
|
|
116
|
+
generatedSamplesMaxDepth: number;
|
|
102
117
|
hideFab: boolean;
|
|
103
118
|
minCharacterLengthToInitSearch: number;
|
|
104
119
|
showWebhookVerb: boolean;
|
|
120
|
+
hidePropertiesPrefix?: boolean;
|
|
105
121
|
nonce?: string;
|
|
106
122
|
constructor(raw: RedocRawOptions, defaults?: RedocRawOptions);
|
|
107
123
|
}
|
|
@@ -11,9 +11,13 @@ export declare class ApiInfoModel implements OpenAPIInfo {
|
|
|
11
11
|
termsOfService?: string;
|
|
12
12
|
contact?: OpenAPIContact;
|
|
13
13
|
license?: OpenAPILicense;
|
|
14
|
-
|
|
14
|
+
downloadUrls: {
|
|
15
|
+
title?: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
}[];
|
|
15
18
|
downloadFileName?: string;
|
|
16
19
|
constructor(parser: OpenAPIParser, options?: RedocNormalizedOptions);
|
|
20
|
+
private getDownloadUrls;
|
|
17
21
|
private getDownloadLink;
|
|
18
22
|
private getDownloadFileName;
|
|
19
23
|
}
|
|
@@ -11,7 +11,7 @@ export declare class MediaTypeModel {
|
|
|
11
11
|
name: string;
|
|
12
12
|
isRequestType: boolean;
|
|
13
13
|
onlyRequiredInSamples: boolean;
|
|
14
|
-
|
|
14
|
+
generatedSamplesMaxDepth: number;
|
|
15
15
|
/**
|
|
16
16
|
* @param isRequestType needed to know if skipe RO/RW fields in objects
|
|
17
17
|
*/
|
|
@@ -36,6 +36,9 @@ export declare class SchemaModel {
|
|
|
36
36
|
rawSchema: OpenAPISchema;
|
|
37
37
|
schema: MergedOpenAPISchema;
|
|
38
38
|
extensions?: Record<string, any>;
|
|
39
|
+
'x-enumDescriptions': {
|
|
40
|
+
[name: string]: string;
|
|
41
|
+
};
|
|
39
42
|
const: any;
|
|
40
43
|
contentEncoding?: string;
|
|
41
44
|
contentMediaType?: string;
|