@redocly/config 0.5.0 → 0.6.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 +7 -1
- package/lib/.tsbuildinfo +1 -1
- package/lib/default-theme-config-schema.d.ts +305 -13
- package/lib/default-theme-config-schema.js +12 -7
- package/lib/default-theme-config-schema.js.map +1 -1
- package/lib/portal-shared-types.d.ts +19 -7
- package/lib/redoc-config-schema.d.ts +298 -0
- package/lib/redoc-config-schema.js +185 -0
- package/lib/redoc-config-schema.js.map +1 -0
- package/lib/redoc-types.d.ts +84 -0
- package/lib/redoc-types.js +3 -0
- package/lib/redoc-types.js.map +1 -0
- package/lib/remove-property-recursively.d.ts +5 -0
- package/lib/remove-property-recursively.js +26 -0
- package/lib/remove-property-recursively.js.map +1 -0
- package/lib/root-config-schema.d.ts +3413 -1845
- package/lib/root-config-schema.js +8 -1
- package/lib/root-config-schema.js.map +1 -1
- package/lib/types.d.ts +2 -0
- package/lib-esm/.tsbuildinfo +1 -1
- package/lib-esm/default-theme-config-schema.d.ts +305 -13
- package/lib-esm/default-theme-config-schema.js +12 -7
- package/lib-esm/default-theme-config-schema.js.map +1 -1
- package/lib-esm/portal-shared-types.d.ts +19 -7
- package/lib-esm/redoc-config-schema.d.ts +298 -0
- package/lib-esm/redoc-config-schema.js +182 -0
- package/lib-esm/redoc-config-schema.js.map +1 -0
- package/lib-esm/redoc-types.d.ts +84 -0
- package/lib-esm/redoc-types.js +2 -0
- package/lib-esm/redoc-types.js.map +1 -0
- package/lib-esm/remove-property-recursively.d.ts +5 -0
- package/lib-esm/remove-property-recursively.js +22 -0
- package/lib-esm/remove-property-recursively.js.map +1 -0
- package/lib-esm/root-config-schema.d.ts +3413 -1845
- package/lib-esm/root-config-schema.js +8 -1
- package/lib-esm/root-config-schema.js.map +1 -1
- package/lib-esm/types.d.ts +2 -0
- package/package.json +4 -4
- package/src/default-theme-config-schema.ts +13 -8
- package/src/portal-shared-types.ts +22 -11
- package/src/redoc-config-schema.ts +183 -0
- package/src/redoc-types.ts +80 -0
- package/src/remove-property-recursively.ts +39 -0
- package/src/root-config-schema.ts +10 -1
- package/src/types.ts +2 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.redocConfigSchema = void 0;
|
|
4
|
+
const codeSamplesConfigSchema = {
|
|
5
|
+
type: 'object',
|
|
6
|
+
properties: {
|
|
7
|
+
languages: {
|
|
8
|
+
type: 'array',
|
|
9
|
+
items: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lang: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
enum: [
|
|
15
|
+
'curl',
|
|
16
|
+
'JavaScript',
|
|
17
|
+
'Node.js',
|
|
18
|
+
'Python',
|
|
19
|
+
'Java8+Apache',
|
|
20
|
+
'Java',
|
|
21
|
+
'C#',
|
|
22
|
+
'C#+Newtonsoft',
|
|
23
|
+
'PHP',
|
|
24
|
+
'Go',
|
|
25
|
+
'Ruby',
|
|
26
|
+
'R',
|
|
27
|
+
'Payload',
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
label: { type: 'string' },
|
|
31
|
+
options: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
indent: { type: 'string' },
|
|
35
|
+
withImports: { type: 'boolean' },
|
|
36
|
+
withComments: { type: 'boolean' },
|
|
37
|
+
binary: { type: 'boolean' },
|
|
38
|
+
credentials: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
enum: ['omit', 'same-origin', 'include'],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
additionalProperties: false,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
required: ['lang'],
|
|
47
|
+
additionalProperties: false,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
skipOptionalParameters: { type: 'boolean' },
|
|
51
|
+
withOAuth2Call: { type: 'boolean' },
|
|
52
|
+
},
|
|
53
|
+
required: ['languages'],
|
|
54
|
+
additionalProperties: false,
|
|
55
|
+
};
|
|
56
|
+
const downloadUrlsSchema = {
|
|
57
|
+
type: 'array',
|
|
58
|
+
items: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
properties: {
|
|
61
|
+
title: { type: 'string' },
|
|
62
|
+
url: { type: 'string' },
|
|
63
|
+
},
|
|
64
|
+
required: ['url'],
|
|
65
|
+
additionalProperties: false,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
exports.redocConfigSchema = {
|
|
69
|
+
type: 'object',
|
|
70
|
+
properties: {
|
|
71
|
+
licenseKey: { type: 'string' },
|
|
72
|
+
hideLoading: { type: 'boolean' },
|
|
73
|
+
disableRouter: { type: 'boolean' },
|
|
74
|
+
hideSidebar: { type: 'boolean' },
|
|
75
|
+
feedback: {
|
|
76
|
+
type: 'object',
|
|
77
|
+
properties: {
|
|
78
|
+
hide: {
|
|
79
|
+
type: 'boolean',
|
|
80
|
+
default: false,
|
|
81
|
+
},
|
|
82
|
+
type: {
|
|
83
|
+
type: 'string',
|
|
84
|
+
enum: ['rating', 'sentiment', 'comment', 'reasons', 'mood', 'scale'],
|
|
85
|
+
default: 'sentiment',
|
|
86
|
+
},
|
|
87
|
+
settings: {
|
|
88
|
+
type: 'object',
|
|
89
|
+
properties: {
|
|
90
|
+
label: { type: 'string' },
|
|
91
|
+
submitText: { type: 'string' },
|
|
92
|
+
buttonText: { type: 'string' },
|
|
93
|
+
component: {
|
|
94
|
+
type: 'string',
|
|
95
|
+
enum: ['radio', 'checkbox'],
|
|
96
|
+
default: 'checkbox',
|
|
97
|
+
},
|
|
98
|
+
items: { type: 'array', items: { type: 'string' }, minItems: 1 },
|
|
99
|
+
leftScaleLabel: { type: 'string' },
|
|
100
|
+
rightScaleLabel: { type: 'string' },
|
|
101
|
+
reasons: {
|
|
102
|
+
type: 'object',
|
|
103
|
+
properties: {
|
|
104
|
+
hide: {
|
|
105
|
+
type: 'boolean',
|
|
106
|
+
default: false,
|
|
107
|
+
},
|
|
108
|
+
component: {
|
|
109
|
+
type: 'string',
|
|
110
|
+
enum: ['radio', 'checkbox'],
|
|
111
|
+
default: 'checkbox',
|
|
112
|
+
},
|
|
113
|
+
label: { type: 'string' },
|
|
114
|
+
items: { type: 'array', items: { type: 'string' } },
|
|
115
|
+
},
|
|
116
|
+
additionalProperties: false,
|
|
117
|
+
},
|
|
118
|
+
comment: {
|
|
119
|
+
type: 'object',
|
|
120
|
+
properties: {
|
|
121
|
+
hide: {
|
|
122
|
+
type: 'boolean',
|
|
123
|
+
default: false,
|
|
124
|
+
},
|
|
125
|
+
label: { type: 'string' },
|
|
126
|
+
likeLabel: { type: 'string' },
|
|
127
|
+
dislikeLabel: { type: 'string' },
|
|
128
|
+
satisfiedLabel: { type: 'string' },
|
|
129
|
+
neutralLabel: { type: 'string' },
|
|
130
|
+
dissatisfiedLabel: { type: 'string' },
|
|
131
|
+
},
|
|
132
|
+
additionalProperties: false,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
additionalProperties: false,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
additionalProperties: false,
|
|
139
|
+
default: null,
|
|
140
|
+
nullable: true,
|
|
141
|
+
},
|
|
142
|
+
hideReplay: { type: 'boolean' },
|
|
143
|
+
oAuth2RedirectURI: { type: 'string', nullable: true },
|
|
144
|
+
corsProxyUrl: { type: 'string' },
|
|
145
|
+
sortRequiredPropsFirst: { type: 'boolean' },
|
|
146
|
+
sanitize: { type: 'boolean' },
|
|
147
|
+
hideDownloadButtons: { type: 'boolean' },
|
|
148
|
+
downloadUrls: downloadUrlsSchema,
|
|
149
|
+
onlyRequiredInSamples: { type: 'boolean' },
|
|
150
|
+
generatedSamplesMaxDepth: { oneOf: [{ type: 'number' }, { type: 'string' }] },
|
|
151
|
+
showExtensions: {
|
|
152
|
+
oneOf: [
|
|
153
|
+
{ type: 'boolean' },
|
|
154
|
+
{ type: 'string' },
|
|
155
|
+
{ type: 'array', items: { type: 'string' } },
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
hideSchemaTitles: { type: 'boolean' },
|
|
159
|
+
jsonSamplesExpandLevel: { oneOf: [{ type: 'number' }, { type: 'string' }] },
|
|
160
|
+
schemasExpansionLevel: { oneOf: [{ type: 'number' }, { type: 'string' }] },
|
|
161
|
+
mockServer: {
|
|
162
|
+
type: 'object',
|
|
163
|
+
properties: {
|
|
164
|
+
url: { type: 'string' },
|
|
165
|
+
position: { enum: ['first', 'last', 'replace', 'off'] },
|
|
166
|
+
description: { type: 'string' },
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
maxDisplayedEnumValues: { type: 'number' },
|
|
170
|
+
schemaDefinitionsTagName: { type: 'string' },
|
|
171
|
+
layout: { type: 'string', enum: ['stacked', 'three-panel'] },
|
|
172
|
+
hideInfoMetadata: { type: 'boolean' },
|
|
173
|
+
events: { type: 'object' },
|
|
174
|
+
skipBundle: { type: 'boolean' },
|
|
175
|
+
routingBasePath: { type: 'string' },
|
|
176
|
+
codeSamples: codeSamplesConfigSchema,
|
|
177
|
+
ignoreNamedSchemas: {
|
|
178
|
+
oneOf: [{ type: 'array', items: { type: 'string' } }, { type: 'string' }],
|
|
179
|
+
},
|
|
180
|
+
hidePropertiesPrefix: { type: 'boolean' },
|
|
181
|
+
excludeFromSearch: { type: 'boolean' },
|
|
182
|
+
},
|
|
183
|
+
additionalProperties: false,
|
|
184
|
+
};
|
|
185
|
+
//# sourceMappingURL=redoc-config-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redoc-config-schema.js","sourceRoot":"","sources":["../src/redoc-config-schema.ts"],"names":[],"mappings":";;;AAAA,MAAM,uBAAuB,GAAG;IAC9B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IA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AI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,EAAE;QAC5D,gBAAgB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QACrC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC/B,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACnC,WAAW,EAAE,uBAAuB;QACpC,kBAAkB,EAAE;YAClB,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;SAC1E;QACD,oBAAoB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QACzC,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KACvC;IACD,oBAAoB,EAAE,KAAK;CACnB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ReactElement, ComponentType } from 'react';
|
|
2
|
+
import type { FromSchema } from 'json-schema-to-ts';
|
|
3
|
+
import type { Schema, ConfigFunction } from '@markdoc/markdoc/dist/src/types';
|
|
4
|
+
import type { redocConfigSchema } from './redoc-config-schema';
|
|
5
|
+
export type RedocConfigTypes = FromSchema<typeof redocConfigSchema> & {
|
|
6
|
+
markdocOptions?: {
|
|
7
|
+
tags: Record<string, Schema>;
|
|
8
|
+
nodes: Record<string, Schema>;
|
|
9
|
+
components: Record<string, ComponentType>;
|
|
10
|
+
variables?: Record<string, any>;
|
|
11
|
+
partials?: Record<string, any>;
|
|
12
|
+
functions?: Record<string, ConfigFunction>;
|
|
13
|
+
};
|
|
14
|
+
onDeepLinkClick?: ((link: string) => void) | undefined | null;
|
|
15
|
+
unstable_hooks?: HooksConfig;
|
|
16
|
+
requestInterceptor?: ((req: Request, operation: OperationModel) => void) | undefined | null;
|
|
17
|
+
unstable_externalCodeSamples?: Unstable_ExternalCodeSample[];
|
|
18
|
+
scrollYOffset?: number | string | (() => number);
|
|
19
|
+
};
|
|
20
|
+
type HooksConfig = {
|
|
21
|
+
AfterApiTitle?: HookConfig<{
|
|
22
|
+
info: OpenAPIInfo;
|
|
23
|
+
}>;
|
|
24
|
+
BeforeOperation?: HookConfig<{
|
|
25
|
+
operation: OperationModel;
|
|
26
|
+
}>;
|
|
27
|
+
BeforeOperationSummary?: HookConfig<{
|
|
28
|
+
operation: OperationModel;
|
|
29
|
+
}>;
|
|
30
|
+
AfterOperationSummary?: HookConfig<{
|
|
31
|
+
operation: OperationModel;
|
|
32
|
+
}>;
|
|
33
|
+
AfterOperation?: HookConfig<{
|
|
34
|
+
operation: OperationModel;
|
|
35
|
+
}>;
|
|
36
|
+
onInit?: (args: {
|
|
37
|
+
store: Record<string, any>;
|
|
38
|
+
}) => void;
|
|
39
|
+
replaceSecurityLink?: (args: {
|
|
40
|
+
securityRequirementId: string;
|
|
41
|
+
}) => string;
|
|
42
|
+
sanitize?: (raw: string) => string;
|
|
43
|
+
MiddlePanelFooter?: HookConfig<undefined>;
|
|
44
|
+
MiddlePanelHeader?: HookConfig<undefined>;
|
|
45
|
+
};
|
|
46
|
+
type OpenAPIInfo = {
|
|
47
|
+
title: string;
|
|
48
|
+
version: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
summary?: string;
|
|
51
|
+
termsOfService?: string;
|
|
52
|
+
contact?: Record<string, any>;
|
|
53
|
+
license?: Record<string, any>;
|
|
54
|
+
'x-logo'?: Record<string, any>;
|
|
55
|
+
'x-metadata'?: Record<string, any>;
|
|
56
|
+
'x-seo'?: Record<string, any>;
|
|
57
|
+
};
|
|
58
|
+
type HookResult = ReactElement | {
|
|
59
|
+
html: string;
|
|
60
|
+
} | null;
|
|
61
|
+
type HookConfig<T> = (props: T) => HookResult;
|
|
62
|
+
type Unstable_ExternalCodeSample = {
|
|
63
|
+
get: (source: ExternalSource) => string;
|
|
64
|
+
lang: string;
|
|
65
|
+
label?: string;
|
|
66
|
+
};
|
|
67
|
+
type ExternalSource = {
|
|
68
|
+
sample: Unstable_ExternalCodeSample;
|
|
69
|
+
operation: OperationModel;
|
|
70
|
+
exampleName?: string;
|
|
71
|
+
pathParams?: any;
|
|
72
|
+
properties?: any;
|
|
73
|
+
};
|
|
74
|
+
type OperationModel = {
|
|
75
|
+
id: string;
|
|
76
|
+
name: string;
|
|
77
|
+
description?: string | Record<string, any>;
|
|
78
|
+
href: string;
|
|
79
|
+
pointer: string;
|
|
80
|
+
httpVerb: string;
|
|
81
|
+
deprecated: boolean;
|
|
82
|
+
path: string;
|
|
83
|
+
};
|
|
84
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redoc-types.js","sourceRoot":"","sources":["../src/redoc-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type Removed<T, Drop> = T extends Record<string, any> ? T extends ArrayLike<any> ? Array<Removed<T[number], Drop>> : {
|
|
2
|
+
[K in Exclude<keyof T, Drop>]: Removed<T[K], Drop>;
|
|
3
|
+
} : T;
|
|
4
|
+
export declare function removePropertyRecursively<TObject extends object, TProp extends string>(object: TObject, propToRemove: TProp): Removed<TObject, TProp>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removePropertyRecursively = void 0;
|
|
4
|
+
function removePropertyRecursively(object, propToRemove) {
|
|
5
|
+
return Object.fromEntries(Object.entries(object)
|
|
6
|
+
.map(([key, value]) => {
|
|
7
|
+
if (key === propToRemove) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
if (typeof value !== 'object' || !value) {
|
|
11
|
+
return [key, value];
|
|
12
|
+
}
|
|
13
|
+
if (Array.isArray(value)) {
|
|
14
|
+
return [
|
|
15
|
+
key,
|
|
16
|
+
value.map((arrayItem) => typeof arrayItem === 'object'
|
|
17
|
+
? removePropertyRecursively(arrayItem, propToRemove)
|
|
18
|
+
: arrayItem),
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
return [key, removePropertyRecursively(value, propToRemove)];
|
|
22
|
+
})
|
|
23
|
+
.filter(Boolean));
|
|
24
|
+
}
|
|
25
|
+
exports.removePropertyRecursively = removePropertyRecursively;
|
|
26
|
+
//# sourceMappingURL=remove-property-recursively.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-property-recursively.js","sourceRoot":"","sources":["../src/remove-property-recursively.ts"],"names":[],"mappings":";;;AAQA,SAAgB,yBAAyB,CACvC,MAAe,EACf,YAAmB;IAEnB,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SACnB,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,IAAI,GAAG,KAAK,YAAY,EAAE;YACxB,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,EAAE;YACvC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SACrB;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACxB,OAAO;gBACL,GAAG;gBACH,KAAK,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CACtB,OAAO,SAAS,KAAK,QAAQ;oBAC3B,CAAC,CAAC,yBAAyB,CAAC,SAAS,EAAE,YAAY,CAAC;oBACpD,CAAC,CAAC,SAAS,CACd;aACF,CAAC;SACH;QAED,OAAO,CAAC,GAAG,EAAE,yBAAyB,CAAC,KAAgC,EAAE,YAAY,CAAC,CAAC,CAAC;IAC1F,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAwB,CACf,CAAC;AAC/B,CAAC;AA9BD,8DA8BC"}
|