@redocly/openapi-core 1.0.0-beta.128 → 1.0.0-beta.130
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/lib/config/all.js +1 -0
- package/lib/config/config-resolvers.js +1 -1
- package/lib/config/config.d.ts +2 -1
- package/lib/config/config.js +1 -0
- package/lib/config/minimal.js +1 -0
- package/lib/config/recommended.js +1 -0
- package/lib/config/types.d.ts +12 -0
- package/lib/config/types.js +13 -0
- package/lib/rules/common/assertions/index.js +3 -4
- package/lib/rules/oas3/component-name-unique.d.ts +2 -0
- package/lib/rules/oas3/component-name-unique.js +124 -0
- package/lib/rules/oas3/index.js +2 -0
- package/lib/rules/utils.js +3 -1
- package/lib/types/config-external-schemas.d.ts +1619 -0
- package/lib/types/config-external-schemas.js +736 -0
- package/lib/types/redocly-yaml.js +6 -7
- package/package.json +1 -1
|
@@ -0,0 +1,736 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.themeConfigSchema = exports.mockServerConfigSchema = exports.i18nConfigSchema = exports.scorecardConfigSchema = exports.responseHeaderSchema = exports.devOnboardingConfigSchema = exports.seoConfigSchema = exports.redirectConfigSchema = exports.ssoConfigSchema = exports.rbacConfigSchema = void 0;
|
|
4
|
+
const config_1 = require("../config");
|
|
5
|
+
const oidcIssuerMetadataSchema = {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
end_session_endpoint: { type: 'string' },
|
|
9
|
+
token_endpoint: { type: 'string' },
|
|
10
|
+
authorization_endpoint: { type: 'string' },
|
|
11
|
+
},
|
|
12
|
+
required: ['token_endpoint', 'authorization_endpoint'],
|
|
13
|
+
additionalProperties: true,
|
|
14
|
+
};
|
|
15
|
+
const oidcProviderConfigSchema = {
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
type: { type: 'string', const: config_1.AuthProviderType.OIDC },
|
|
19
|
+
title: { type: 'string' },
|
|
20
|
+
configurationUrl: { type: 'string', minLength: 1 },
|
|
21
|
+
configuration: oidcIssuerMetadataSchema,
|
|
22
|
+
clientId: { type: 'string', minLength: 1 },
|
|
23
|
+
clientSecret: { type: 'string', minLength: 1 },
|
|
24
|
+
teamsClaimName: { type: 'string' },
|
|
25
|
+
defaultTeams: { type: 'array', items: { type: 'string' } },
|
|
26
|
+
scopes: { type: 'array', items: { type: 'string' } },
|
|
27
|
+
tokenExpirationTime: { type: 'number' },
|
|
28
|
+
authorizationRequestCustomParams: { type: 'object', additionalProperties: { type: 'string' } },
|
|
29
|
+
tokenRequestCustomParams: { type: 'object', additionalProperties: { type: 'string' } },
|
|
30
|
+
},
|
|
31
|
+
required: ['type', 'clientId', 'clientSecret'],
|
|
32
|
+
oneOf: [{ required: ['configurationUrl'] }, { required: ['configuration'] }],
|
|
33
|
+
additionalProperties: false,
|
|
34
|
+
};
|
|
35
|
+
const saml2ProviderConfigSchema = {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: {
|
|
38
|
+
type: { type: 'string', const: config_1.AuthProviderType.SAML2 },
|
|
39
|
+
title: { type: 'string' },
|
|
40
|
+
issuerId: { type: 'string' },
|
|
41
|
+
entityId: { type: 'string' },
|
|
42
|
+
ssoUrl: { type: 'string' },
|
|
43
|
+
x509PublicCert: { type: 'string' },
|
|
44
|
+
teamsAttributeName: { type: 'string', default: config_1.DEFAULT_TEAM_CLAIM_NAME },
|
|
45
|
+
teamsAttributeMap: { type: 'object', additionalProperties: { type: 'string' } },
|
|
46
|
+
defaultTeams: { type: 'array', items: { type: 'string' } },
|
|
47
|
+
},
|
|
48
|
+
additionalProperties: false,
|
|
49
|
+
required: ['type', 'issuerId', 'ssoUrl', 'x509PublicCert'],
|
|
50
|
+
};
|
|
51
|
+
const basicAuthProviderConfigSchema = {
|
|
52
|
+
type: 'object',
|
|
53
|
+
properties: {
|
|
54
|
+
type: { type: 'string', const: config_1.AuthProviderType.BASIC },
|
|
55
|
+
title: { type: 'string' },
|
|
56
|
+
credentials: {
|
|
57
|
+
type: 'array',
|
|
58
|
+
items: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
properties: {
|
|
61
|
+
username: { type: 'string' },
|
|
62
|
+
password: { type: 'string' },
|
|
63
|
+
passwordHash: { type: 'string' },
|
|
64
|
+
teams: { type: 'array', items: { type: 'string' } },
|
|
65
|
+
},
|
|
66
|
+
required: ['username'],
|
|
67
|
+
additionalProperties: false,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
required: ['type', 'credentials'],
|
|
72
|
+
additionalProperties: false,
|
|
73
|
+
};
|
|
74
|
+
const authProviderConfigSchema = {
|
|
75
|
+
oneOf: [oidcProviderConfigSchema, saml2ProviderConfigSchema, basicAuthProviderConfigSchema],
|
|
76
|
+
discriminator: { propertyName: 'type' },
|
|
77
|
+
};
|
|
78
|
+
const rbacScopeItemsSchema = { type: 'object', additionalProperties: { type: 'string' } };
|
|
79
|
+
exports.rbacConfigSchema = {
|
|
80
|
+
type: 'object',
|
|
81
|
+
properties: {
|
|
82
|
+
defaults: rbacScopeItemsSchema,
|
|
83
|
+
},
|
|
84
|
+
additionalProperties: rbacScopeItemsSchema,
|
|
85
|
+
};
|
|
86
|
+
exports.ssoConfigSchema = {
|
|
87
|
+
type: 'object',
|
|
88
|
+
additionalProperties: authProviderConfigSchema,
|
|
89
|
+
};
|
|
90
|
+
exports.redirectConfigSchema = {
|
|
91
|
+
type: 'object',
|
|
92
|
+
properties: {
|
|
93
|
+
to: { type: 'string' },
|
|
94
|
+
type: { type: 'number', default: 301 },
|
|
95
|
+
},
|
|
96
|
+
required: ['to'],
|
|
97
|
+
additionalProperties: false,
|
|
98
|
+
};
|
|
99
|
+
exports.seoConfigSchema = {
|
|
100
|
+
type: 'object',
|
|
101
|
+
properties: {
|
|
102
|
+
title: { type: 'string' },
|
|
103
|
+
description: { type: 'string' },
|
|
104
|
+
siteUrl: { type: 'string' },
|
|
105
|
+
image: { type: 'string' },
|
|
106
|
+
keywords: { type: 'array', items: { type: 'string' } },
|
|
107
|
+
lang: { type: 'string' },
|
|
108
|
+
jsonLd: { type: 'object' },
|
|
109
|
+
meta: {
|
|
110
|
+
type: 'array',
|
|
111
|
+
items: {
|
|
112
|
+
type: 'object',
|
|
113
|
+
properties: {
|
|
114
|
+
name: { type: 'string' },
|
|
115
|
+
content: { type: 'string' },
|
|
116
|
+
},
|
|
117
|
+
required: ['name', 'content'],
|
|
118
|
+
additionalProperties: false,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
additionalProperties: false,
|
|
123
|
+
};
|
|
124
|
+
const apigeeAdapterAuthOauth2Schema = {
|
|
125
|
+
type: 'object',
|
|
126
|
+
properties: {
|
|
127
|
+
type: { type: 'string', const: config_1.ApigeeDevOnboardingIntegrationAuthType.OAUTH2 },
|
|
128
|
+
tokenEndpoint: { type: 'string' },
|
|
129
|
+
clientId: { type: 'string' },
|
|
130
|
+
clientSecret: { type: 'string' },
|
|
131
|
+
},
|
|
132
|
+
additionalProperties: false,
|
|
133
|
+
required: ['type', 'tokenEndpoint', 'clientId', 'clientSecret'],
|
|
134
|
+
};
|
|
135
|
+
const apigeeAdapterAuthServiceAccountSchema = {
|
|
136
|
+
type: 'object',
|
|
137
|
+
properties: {
|
|
138
|
+
type: { type: 'string', const: config_1.ApigeeDevOnboardingIntegrationAuthType.SERVICE_ACCOUNT },
|
|
139
|
+
serviceAccountEmail: { type: 'string' },
|
|
140
|
+
serviceAccountPrivateKey: { type: 'string' },
|
|
141
|
+
},
|
|
142
|
+
additionalProperties: false,
|
|
143
|
+
required: ['type', 'serviceAccountEmail', 'serviceAccountPrivateKey'],
|
|
144
|
+
};
|
|
145
|
+
const apigeeXAdapterConfigSchema = {
|
|
146
|
+
type: 'object',
|
|
147
|
+
properties: {
|
|
148
|
+
type: { type: 'string', const: 'APIGEE_X' },
|
|
149
|
+
apiUrl: { type: 'string' },
|
|
150
|
+
stage: { type: 'string', default: 'non-production' },
|
|
151
|
+
organizationName: { type: 'string' },
|
|
152
|
+
ignoreApiProducts: { type: 'array', items: { type: 'string' } },
|
|
153
|
+
allowApiProductsOutsideCatalog: { type: 'boolean', default: false },
|
|
154
|
+
auth: {
|
|
155
|
+
type: 'object',
|
|
156
|
+
oneOf: [apigeeAdapterAuthOauth2Schema, apigeeAdapterAuthServiceAccountSchema],
|
|
157
|
+
discriminator: { propertyName: 'type' },
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
additionalProperties: false,
|
|
161
|
+
required: ['type', 'organizationName', 'auth'],
|
|
162
|
+
};
|
|
163
|
+
const apigeeEdgeAdapterConfigSchema = Object.assign(Object.assign({}, apigeeXAdapterConfigSchema), { properties: Object.assign(Object.assign({}, apigeeXAdapterConfigSchema.properties), { type: { type: 'string', const: 'APIGEE_EDGE' } }) });
|
|
164
|
+
const graviteeAdapterConfigSchema = {
|
|
165
|
+
type: 'object',
|
|
166
|
+
properties: {
|
|
167
|
+
type: { type: 'string', const: 'GRAVITEE' },
|
|
168
|
+
apiBaseUrl: { type: 'string' },
|
|
169
|
+
env: { type: 'string' },
|
|
170
|
+
allowApiProductsOutsideCatalog: { type: 'boolean', default: false },
|
|
171
|
+
stage: { type: 'string', default: 'non-production' },
|
|
172
|
+
auth: { type: 'object', properties: { static: { type: 'string' } } },
|
|
173
|
+
},
|
|
174
|
+
additionalProperties: false,
|
|
175
|
+
required: ['type', 'apiBaseUrl'],
|
|
176
|
+
};
|
|
177
|
+
const devOnboardingAdapterConfigSchema = {
|
|
178
|
+
type: 'object',
|
|
179
|
+
oneOf: [apigeeXAdapterConfigSchema, apigeeEdgeAdapterConfigSchema, graviteeAdapterConfigSchema],
|
|
180
|
+
discriminator: { propertyName: 'type' },
|
|
181
|
+
};
|
|
182
|
+
exports.devOnboardingConfigSchema = {
|
|
183
|
+
type: 'object',
|
|
184
|
+
required: ['adapters'],
|
|
185
|
+
additionalProperties: false,
|
|
186
|
+
properties: {
|
|
187
|
+
adapters: {
|
|
188
|
+
type: 'array',
|
|
189
|
+
items: devOnboardingAdapterConfigSchema,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
exports.responseHeaderSchema = {
|
|
194
|
+
type: 'object',
|
|
195
|
+
properties: {
|
|
196
|
+
name: { type: 'string' },
|
|
197
|
+
value: { type: 'string' },
|
|
198
|
+
},
|
|
199
|
+
additionalProperties: false,
|
|
200
|
+
required: ['name', 'value'],
|
|
201
|
+
};
|
|
202
|
+
exports.scorecardConfigSchema = {
|
|
203
|
+
type: 'object',
|
|
204
|
+
additionalProperties: true,
|
|
205
|
+
required: ['levels'],
|
|
206
|
+
properties: {
|
|
207
|
+
levels: {
|
|
208
|
+
type: 'array',
|
|
209
|
+
items: {
|
|
210
|
+
type: 'object',
|
|
211
|
+
required: ['name'],
|
|
212
|
+
properties: {
|
|
213
|
+
name: { type: 'string' },
|
|
214
|
+
extends: { type: 'array', items: { type: 'string' } },
|
|
215
|
+
rules: {
|
|
216
|
+
type: 'object',
|
|
217
|
+
additionalProperties: {
|
|
218
|
+
type: ['object', 'string'],
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
additionalProperties: false,
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
targets: {
|
|
226
|
+
type: 'array',
|
|
227
|
+
items: {
|
|
228
|
+
type: 'object',
|
|
229
|
+
required: ['where'],
|
|
230
|
+
properties: {
|
|
231
|
+
minimumLevel: { type: 'string' },
|
|
232
|
+
where: {
|
|
233
|
+
type: 'object',
|
|
234
|
+
required: ['metadata'],
|
|
235
|
+
properties: {
|
|
236
|
+
metadata: { type: 'object', additionalProperties: { type: 'string' } },
|
|
237
|
+
},
|
|
238
|
+
additionalProperties: false,
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
additionalProperties: false,
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
exports.i18nConfigSchema = {
|
|
247
|
+
type: 'object',
|
|
248
|
+
properties: {
|
|
249
|
+
defaultLocale: {
|
|
250
|
+
type: 'string',
|
|
251
|
+
},
|
|
252
|
+
locales: {
|
|
253
|
+
type: 'array',
|
|
254
|
+
items: {
|
|
255
|
+
type: 'object',
|
|
256
|
+
properties: {
|
|
257
|
+
code: {
|
|
258
|
+
type: 'string',
|
|
259
|
+
},
|
|
260
|
+
name: {
|
|
261
|
+
type: 'string',
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
required: ['code'],
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
required: ['defaultLocale', 'locales'],
|
|
269
|
+
};
|
|
270
|
+
exports.mockServerConfigSchema = {
|
|
271
|
+
type: 'object',
|
|
272
|
+
properties: {
|
|
273
|
+
off: { type: 'boolean', default: false },
|
|
274
|
+
position: { type: 'string', enum: ['first', 'last', 'replace', 'off'], default: 'first' },
|
|
275
|
+
strictExamples: { type: 'boolean', default: false },
|
|
276
|
+
errorIfForcedExampleNotFound: { type: 'boolean', default: false },
|
|
277
|
+
description: { type: 'string' },
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
const logoConfigSchema = {
|
|
281
|
+
type: 'object',
|
|
282
|
+
properties: {
|
|
283
|
+
image: { type: 'string' },
|
|
284
|
+
altText: { type: 'string' },
|
|
285
|
+
link: { type: 'string' },
|
|
286
|
+
favicon: { type: 'string' },
|
|
287
|
+
},
|
|
288
|
+
additionalProperties: false,
|
|
289
|
+
};
|
|
290
|
+
const adobeAnalyticsConfigSchema = {
|
|
291
|
+
type: 'object',
|
|
292
|
+
properties: {
|
|
293
|
+
includeInDevelopment: { type: 'boolean' },
|
|
294
|
+
scriptUrl: { type: 'string' },
|
|
295
|
+
pageViewEventName: { type: 'string' },
|
|
296
|
+
},
|
|
297
|
+
additionalProperties: false,
|
|
298
|
+
required: ['scriptUrl'],
|
|
299
|
+
};
|
|
300
|
+
const navItemSchema = {
|
|
301
|
+
type: 'object',
|
|
302
|
+
properties: {
|
|
303
|
+
page: { type: 'string' },
|
|
304
|
+
directory: { type: 'string' },
|
|
305
|
+
group: { type: 'string' },
|
|
306
|
+
label: { type: 'string' },
|
|
307
|
+
separator: { type: 'string' },
|
|
308
|
+
separatorLine: { type: 'boolean' },
|
|
309
|
+
version: { type: 'string' },
|
|
310
|
+
menuStyle: { type: 'string', enum: ['drilldown'] },
|
|
311
|
+
expanded: { type: 'string', const: 'always' },
|
|
312
|
+
selectFirstItemOnExpand: { type: 'boolean' },
|
|
313
|
+
flatten: { type: 'boolean' },
|
|
314
|
+
linkedSidebars: {
|
|
315
|
+
type: 'array',
|
|
316
|
+
items: { type: 'string' },
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
};
|
|
320
|
+
const navItemsSchema = {
|
|
321
|
+
type: 'array',
|
|
322
|
+
items: Object.assign(Object.assign({}, navItemSchema), { properties: Object.assign(Object.assign({}, navItemSchema.properties), { items: { type: 'array', items: navItemSchema } }) }),
|
|
323
|
+
};
|
|
324
|
+
const hideConfigSchema = {
|
|
325
|
+
type: 'object',
|
|
326
|
+
properties: {
|
|
327
|
+
hide: { type: 'boolean' },
|
|
328
|
+
},
|
|
329
|
+
additionalProperties: false,
|
|
330
|
+
};
|
|
331
|
+
const scriptConfigSchema = {
|
|
332
|
+
type: 'object',
|
|
333
|
+
properties: {
|
|
334
|
+
src: { type: 'string' },
|
|
335
|
+
async: { type: 'boolean' },
|
|
336
|
+
crossorigin: { type: 'string' },
|
|
337
|
+
defer: { type: 'boolean' },
|
|
338
|
+
fetchpriority: { type: 'string' },
|
|
339
|
+
integrity: { type: 'string' },
|
|
340
|
+
module: { type: 'boolean' },
|
|
341
|
+
nomodule: { type: 'boolean' },
|
|
342
|
+
nonce: { type: 'string' },
|
|
343
|
+
referrerpolicy: { type: 'string' },
|
|
344
|
+
type: { type: 'string' },
|
|
345
|
+
},
|
|
346
|
+
required: ['src'],
|
|
347
|
+
additionalProperties: true,
|
|
348
|
+
};
|
|
349
|
+
const linksConfigSchema = {
|
|
350
|
+
type: 'object',
|
|
351
|
+
properties: {
|
|
352
|
+
href: { type: 'string' },
|
|
353
|
+
as: { type: 'string' },
|
|
354
|
+
crossorigin: { type: 'string' },
|
|
355
|
+
fetchpriority: { type: 'string' },
|
|
356
|
+
hreflang: { type: 'string' },
|
|
357
|
+
imagesizes: { type: 'string' },
|
|
358
|
+
imagesrcset: { type: 'string' },
|
|
359
|
+
integrity: { type: 'string' },
|
|
360
|
+
media: { type: 'string' },
|
|
361
|
+
prefetch: { type: 'string' },
|
|
362
|
+
referrerpolicy: { type: 'string' },
|
|
363
|
+
rel: { type: 'string' },
|
|
364
|
+
sizes: { type: 'string' },
|
|
365
|
+
title: { type: 'string' },
|
|
366
|
+
type: { type: 'string' },
|
|
367
|
+
},
|
|
368
|
+
required: ['href'],
|
|
369
|
+
additionalProperties: true,
|
|
370
|
+
};
|
|
371
|
+
const suggestedPageSchema = {
|
|
372
|
+
type: 'object',
|
|
373
|
+
properties: {
|
|
374
|
+
page: { type: 'string' },
|
|
375
|
+
label: { type: 'string' },
|
|
376
|
+
labelTranslationKey: { type: 'string' },
|
|
377
|
+
},
|
|
378
|
+
required: ['page'],
|
|
379
|
+
};
|
|
380
|
+
const markdownConfigSchema = {
|
|
381
|
+
type: 'object',
|
|
382
|
+
properties: {
|
|
383
|
+
frontMatterKeysToResolve: {
|
|
384
|
+
type: 'array',
|
|
385
|
+
items: { type: 'string' },
|
|
386
|
+
default: ['image', 'links'],
|
|
387
|
+
},
|
|
388
|
+
lastUpdatedBlock: {
|
|
389
|
+
type: 'object',
|
|
390
|
+
properties: Object.assign({ format: {
|
|
391
|
+
type: 'string',
|
|
392
|
+
enum: ['timeago', 'iso', 'long', 'short'],
|
|
393
|
+
default: 'timeago',
|
|
394
|
+
}, locale: { type: 'string', default: 'en-US' } }, hideConfigSchema.properties),
|
|
395
|
+
additionalProperties: false,
|
|
396
|
+
default: {},
|
|
397
|
+
},
|
|
398
|
+
toc: {
|
|
399
|
+
type: 'object',
|
|
400
|
+
properties: Object.assign({ header: { type: 'string', default: 'On this page' }, depth: { type: 'number', default: 3 } }, hideConfigSchema.properties),
|
|
401
|
+
additionalProperties: false,
|
|
402
|
+
default: {},
|
|
403
|
+
},
|
|
404
|
+
editPage: {
|
|
405
|
+
type: 'object',
|
|
406
|
+
properties: Object.assign({ baseUrl: { type: 'string' }, icon: { type: 'string' }, text: { type: 'string', default: 'Edit this page' } }, hideConfigSchema.properties),
|
|
407
|
+
additionalProperties: false,
|
|
408
|
+
default: {},
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
additionalProperties: false,
|
|
412
|
+
default: {},
|
|
413
|
+
};
|
|
414
|
+
const amplitudeAnalyticsConfigSchema = {
|
|
415
|
+
type: 'object',
|
|
416
|
+
properties: {
|
|
417
|
+
includeInDevelopment: { type: 'boolean' },
|
|
418
|
+
apiKey: { type: 'string' },
|
|
419
|
+
head: { type: 'boolean' },
|
|
420
|
+
respectDNT: { type: 'boolean' },
|
|
421
|
+
exclude: { type: 'array', items: { type: 'string' } },
|
|
422
|
+
outboundClickEventName: { type: 'string' },
|
|
423
|
+
pageViewEventName: { type: 'string' },
|
|
424
|
+
amplitudeConfig: { type: 'object', additionalProperties: true },
|
|
425
|
+
},
|
|
426
|
+
additionalProperties: false,
|
|
427
|
+
required: ['apiKey'],
|
|
428
|
+
};
|
|
429
|
+
const fullstoryAnalyticsConfigSchema = {
|
|
430
|
+
type: 'object',
|
|
431
|
+
properties: {
|
|
432
|
+
includeInDevelopment: { type: 'boolean' },
|
|
433
|
+
orgId: { type: 'string' },
|
|
434
|
+
},
|
|
435
|
+
additionalProperties: false,
|
|
436
|
+
required: ['orgId'],
|
|
437
|
+
};
|
|
438
|
+
const heapAnalyticsConfigSchema = {
|
|
439
|
+
type: 'object',
|
|
440
|
+
properties: {
|
|
441
|
+
includeInDevelopment: { type: 'boolean' },
|
|
442
|
+
appId: { type: 'string' },
|
|
443
|
+
},
|
|
444
|
+
additionalProperties: false,
|
|
445
|
+
required: ['appId'],
|
|
446
|
+
};
|
|
447
|
+
const rudderstackAnalyticsConfigSchema = {
|
|
448
|
+
type: 'object',
|
|
449
|
+
properties: {
|
|
450
|
+
includeInDevelopment: { type: 'boolean' },
|
|
451
|
+
writeKey: { type: 'string', minLength: 10 },
|
|
452
|
+
trackPage: { type: 'boolean' },
|
|
453
|
+
dataPlaneUrl: { type: 'string' },
|
|
454
|
+
controlPlaneUrl: { type: 'string' },
|
|
455
|
+
sdkUrl: { type: 'string' },
|
|
456
|
+
loadOptions: { type: 'object', additionalProperties: true },
|
|
457
|
+
},
|
|
458
|
+
additionalProperties: false,
|
|
459
|
+
required: ['writeKey'],
|
|
460
|
+
};
|
|
461
|
+
const segmentAnalyticsConfigSchema = {
|
|
462
|
+
type: 'object',
|
|
463
|
+
properties: {
|
|
464
|
+
includeInDevelopment: { type: 'boolean' },
|
|
465
|
+
writeKey: { type: 'string', minLength: 10 },
|
|
466
|
+
trackPage: { type: 'boolean' },
|
|
467
|
+
includeTitleInPageCall: { type: 'boolean' },
|
|
468
|
+
host: { type: 'string' },
|
|
469
|
+
},
|
|
470
|
+
additionalProperties: false,
|
|
471
|
+
required: ['writeKey'],
|
|
472
|
+
};
|
|
473
|
+
const gtmAnalyticsConfigSchema = {
|
|
474
|
+
type: 'object',
|
|
475
|
+
properties: {
|
|
476
|
+
includeInDevelopment: { type: 'boolean' },
|
|
477
|
+
trackingId: { type: 'string' },
|
|
478
|
+
gtmAuth: { type: 'string' },
|
|
479
|
+
gtmPreview: { type: 'string' },
|
|
480
|
+
defaultDataLayer: {},
|
|
481
|
+
dataLayerName: { type: 'string' },
|
|
482
|
+
enableWebVitalsTracking: { type: 'boolean' },
|
|
483
|
+
selfHostedOrigin: { type: 'string' },
|
|
484
|
+
pageViewEventName: { type: 'string' },
|
|
485
|
+
},
|
|
486
|
+
additionalProperties: false,
|
|
487
|
+
required: ['trackingId'],
|
|
488
|
+
};
|
|
489
|
+
const googleAnalyticsConfigSchema = {
|
|
490
|
+
type: 'object',
|
|
491
|
+
properties: {
|
|
492
|
+
includeInDevelopment: { type: 'boolean' },
|
|
493
|
+
trackingId: { type: 'string' },
|
|
494
|
+
head: { type: 'boolean' },
|
|
495
|
+
respectDNT: { type: 'boolean' },
|
|
496
|
+
anonymize: { type: 'boolean' },
|
|
497
|
+
exclude: { type: 'array', items: { type: 'string' } },
|
|
498
|
+
optimizeId: { type: 'string' },
|
|
499
|
+
experimentId: { type: 'string' },
|
|
500
|
+
variationId: { type: 'string' },
|
|
501
|
+
enableWebVitalsTracking: { type: 'boolean' },
|
|
502
|
+
defer: { type: 'boolean' },
|
|
503
|
+
sampleRate: { type: 'number' },
|
|
504
|
+
name: { type: 'string' },
|
|
505
|
+
clientId: { type: 'string' },
|
|
506
|
+
siteSpeedSampleRate: { type: 'number' },
|
|
507
|
+
alwaysSendReferrer: { type: 'boolean' },
|
|
508
|
+
allowAnchor: { type: 'boolean' },
|
|
509
|
+
cookieName: { type: 'string' },
|
|
510
|
+
cookieFlags: { type: 'string' },
|
|
511
|
+
cookieDomain: { type: 'string' },
|
|
512
|
+
cookieExpires: { type: 'number' },
|
|
513
|
+
storeGac: { type: 'boolean' },
|
|
514
|
+
legacyCookieDomain: { type: 'string' },
|
|
515
|
+
legacyHistoryImport: { type: 'boolean' },
|
|
516
|
+
allowLinker: { type: 'boolean' },
|
|
517
|
+
storage: { type: 'string' },
|
|
518
|
+
allowAdFeatures: { type: 'boolean' },
|
|
519
|
+
dataSource: { type: 'string' },
|
|
520
|
+
queueTime: { type: 'number' },
|
|
521
|
+
forceSSL: { type: 'boolean' },
|
|
522
|
+
transport: { type: 'string' },
|
|
523
|
+
},
|
|
524
|
+
additionalProperties: false,
|
|
525
|
+
required: ['trackingId'],
|
|
526
|
+
};
|
|
527
|
+
exports.themeConfigSchema = {
|
|
528
|
+
type: 'object',
|
|
529
|
+
properties: {
|
|
530
|
+
imports: {
|
|
531
|
+
type: 'array',
|
|
532
|
+
items: { type: 'string' },
|
|
533
|
+
default: [],
|
|
534
|
+
},
|
|
535
|
+
logo: logoConfigSchema,
|
|
536
|
+
navbar: {
|
|
537
|
+
type: 'object',
|
|
538
|
+
properties: Object.assign({ items: navItemsSchema }, hideConfigSchema.properties),
|
|
539
|
+
additionalProperties: false,
|
|
540
|
+
},
|
|
541
|
+
footer: {
|
|
542
|
+
type: 'object',
|
|
543
|
+
properties: Object.assign({ items: navItemsSchema, copyrightText: { type: 'string' } }, hideConfigSchema.properties),
|
|
544
|
+
additionalProperties: false,
|
|
545
|
+
},
|
|
546
|
+
sidebar: hideConfigSchema,
|
|
547
|
+
scripts: {
|
|
548
|
+
type: 'object',
|
|
549
|
+
properties: {
|
|
550
|
+
head: { type: 'array', items: scriptConfigSchema },
|
|
551
|
+
body: { type: 'array', items: scriptConfigSchema },
|
|
552
|
+
},
|
|
553
|
+
additionalProperties: false,
|
|
554
|
+
},
|
|
555
|
+
links: { type: 'array', items: linksConfigSchema },
|
|
556
|
+
feedback: {
|
|
557
|
+
type: 'object',
|
|
558
|
+
properties: {
|
|
559
|
+
hide: {
|
|
560
|
+
type: 'boolean',
|
|
561
|
+
default: false,
|
|
562
|
+
},
|
|
563
|
+
type: {
|
|
564
|
+
type: 'string',
|
|
565
|
+
enum: ['rating', 'sentiment', 'comment', 'reasons'],
|
|
566
|
+
default: 'sentiment',
|
|
567
|
+
},
|
|
568
|
+
settings: Object.assign({ type: 'object', properties: {
|
|
569
|
+
label: { type: 'string' },
|
|
570
|
+
submitText: { type: 'string' },
|
|
571
|
+
max: { type: 'number' },
|
|
572
|
+
buttonText: { type: 'string' },
|
|
573
|
+
multi: { type: 'boolean' },
|
|
574
|
+
items: { type: 'array', items: { type: 'string' }, minItems: 1 },
|
|
575
|
+
reasons: {
|
|
576
|
+
type: 'object',
|
|
577
|
+
properties: {
|
|
578
|
+
enable: { type: 'boolean', default: true },
|
|
579
|
+
multi: { type: 'boolean' },
|
|
580
|
+
label: { type: 'string' },
|
|
581
|
+
items: { type: 'array', items: { type: 'string' } },
|
|
582
|
+
},
|
|
583
|
+
additionalProperties: false,
|
|
584
|
+
},
|
|
585
|
+
comment: {
|
|
586
|
+
type: 'object',
|
|
587
|
+
properties: {
|
|
588
|
+
enable: { type: 'boolean', default: true },
|
|
589
|
+
label: { type: 'string' },
|
|
590
|
+
likeLabel: { type: 'string' },
|
|
591
|
+
dislikeLabel: { type: 'string' },
|
|
592
|
+
},
|
|
593
|
+
additionalProperties: false,
|
|
594
|
+
},
|
|
595
|
+
}, additionalProperties: false }, hideConfigSchema.properties),
|
|
596
|
+
},
|
|
597
|
+
additionalProperties: false,
|
|
598
|
+
default: {},
|
|
599
|
+
},
|
|
600
|
+
search: {
|
|
601
|
+
type: 'object',
|
|
602
|
+
properties: Object.assign({ placement: {
|
|
603
|
+
type: 'string',
|
|
604
|
+
default: 'navbar',
|
|
605
|
+
}, shortcuts: {
|
|
606
|
+
type: 'array',
|
|
607
|
+
items: { type: 'string' },
|
|
608
|
+
default: ['/'],
|
|
609
|
+
}, suggestedPages: {
|
|
610
|
+
type: 'array',
|
|
611
|
+
items: suggestedPageSchema,
|
|
612
|
+
} }, hideConfigSchema.properties),
|
|
613
|
+
additionalProperties: false,
|
|
614
|
+
default: {},
|
|
615
|
+
},
|
|
616
|
+
colorMode: {
|
|
617
|
+
type: 'object',
|
|
618
|
+
properties: Object.assign({ ignoreDetection: { type: 'boolean' }, modes: {
|
|
619
|
+
type: 'array',
|
|
620
|
+
items: { type: 'string' },
|
|
621
|
+
default: ['light', 'dark'],
|
|
622
|
+
} }, hideConfigSchema.properties),
|
|
623
|
+
additionalProperties: false,
|
|
624
|
+
default: {},
|
|
625
|
+
},
|
|
626
|
+
navigation: {
|
|
627
|
+
type: 'object',
|
|
628
|
+
properties: {
|
|
629
|
+
nextButton: {
|
|
630
|
+
type: 'object',
|
|
631
|
+
properties: Object.assign({ text: { type: 'string', default: 'Next to {label}' } }, hideConfigSchema.properties),
|
|
632
|
+
additionalProperties: false,
|
|
633
|
+
default: {},
|
|
634
|
+
},
|
|
635
|
+
previousButton: {
|
|
636
|
+
type: 'object',
|
|
637
|
+
properties: Object.assign({ text: { type: 'string', default: 'Back to {label}' } }, hideConfigSchema.properties),
|
|
638
|
+
additionalProperties: false,
|
|
639
|
+
default: {},
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
additionalProperties: false,
|
|
643
|
+
default: {},
|
|
644
|
+
},
|
|
645
|
+
codeSnippet: {
|
|
646
|
+
type: 'object',
|
|
647
|
+
properties: {
|
|
648
|
+
controlsStyle: { type: 'string', default: 'icon' },
|
|
649
|
+
copy: {
|
|
650
|
+
type: 'object',
|
|
651
|
+
properties: Object.assign({}, hideConfigSchema.properties),
|
|
652
|
+
additionalProperties: false,
|
|
653
|
+
default: { hide: false },
|
|
654
|
+
},
|
|
655
|
+
report: {
|
|
656
|
+
type: 'object',
|
|
657
|
+
properties: Object.assign({}, hideConfigSchema.properties),
|
|
658
|
+
additionalProperties: false,
|
|
659
|
+
default: { hide: true },
|
|
660
|
+
},
|
|
661
|
+
expand: {
|
|
662
|
+
type: 'object',
|
|
663
|
+
properties: Object.assign({}, hideConfigSchema.properties),
|
|
664
|
+
additionalProperties: false,
|
|
665
|
+
default: { hide: false },
|
|
666
|
+
},
|
|
667
|
+
collapse: {
|
|
668
|
+
type: 'object',
|
|
669
|
+
properties: Object.assign({}, hideConfigSchema.properties),
|
|
670
|
+
additionalProperties: false,
|
|
671
|
+
default: { hide: false },
|
|
672
|
+
},
|
|
673
|
+
},
|
|
674
|
+
additionalProperties: false,
|
|
675
|
+
default: {},
|
|
676
|
+
},
|
|
677
|
+
markdown: markdownConfigSchema,
|
|
678
|
+
openapi: { type: 'object', additionalProperties: true },
|
|
679
|
+
graphql: { type: 'object', additionalProperties: true },
|
|
680
|
+
analytics: {
|
|
681
|
+
type: 'object',
|
|
682
|
+
properties: {
|
|
683
|
+
adobe: adobeAnalyticsConfigSchema,
|
|
684
|
+
amplitude: amplitudeAnalyticsConfigSchema,
|
|
685
|
+
fullstory: fullstoryAnalyticsConfigSchema,
|
|
686
|
+
heap: heapAnalyticsConfigSchema,
|
|
687
|
+
rudderstack: rudderstackAnalyticsConfigSchema,
|
|
688
|
+
segment: segmentAnalyticsConfigSchema,
|
|
689
|
+
gtm: gtmAnalyticsConfigSchema,
|
|
690
|
+
ga: googleAnalyticsConfigSchema,
|
|
691
|
+
},
|
|
692
|
+
},
|
|
693
|
+
userProfile: {
|
|
694
|
+
type: 'object',
|
|
695
|
+
properties: Object.assign({ loginLabel: { type: 'string', default: 'Login' }, logoutLabel: { type: 'string', default: 'Logout' }, menu: {
|
|
696
|
+
type: 'array',
|
|
697
|
+
items: {
|
|
698
|
+
type: 'object',
|
|
699
|
+
properties: {
|
|
700
|
+
label: { type: 'string' },
|
|
701
|
+
external: { type: 'boolean' },
|
|
702
|
+
link: { type: 'string' },
|
|
703
|
+
separatorLine: { type: 'boolean' },
|
|
704
|
+
},
|
|
705
|
+
additionalProperties: true,
|
|
706
|
+
},
|
|
707
|
+
default: [],
|
|
708
|
+
} }, hideConfigSchema.properties),
|
|
709
|
+
additionalProperties: false,
|
|
710
|
+
default: {},
|
|
711
|
+
},
|
|
712
|
+
breadcrumbs: {
|
|
713
|
+
type: 'object',
|
|
714
|
+
properties: {
|
|
715
|
+
hide: { type: 'boolean' },
|
|
716
|
+
prefixItems: {
|
|
717
|
+
type: 'array',
|
|
718
|
+
items: {
|
|
719
|
+
type: 'object',
|
|
720
|
+
properties: {
|
|
721
|
+
label: { type: 'string' },
|
|
722
|
+
labelTranslationKey: { type: 'string' },
|
|
723
|
+
page: { type: 'string' },
|
|
724
|
+
},
|
|
725
|
+
additionalProperties: false,
|
|
726
|
+
default: {},
|
|
727
|
+
},
|
|
728
|
+
},
|
|
729
|
+
},
|
|
730
|
+
additionalProperties: false,
|
|
731
|
+
default: {},
|
|
732
|
+
},
|
|
733
|
+
},
|
|
734
|
+
additionalProperties: true,
|
|
735
|
+
default: {},
|
|
736
|
+
};
|