@redocly/openapi-core 1.10.2 → 1.10.4

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/lib/bundle.d.ts +1 -1
  3. package/lib/bundle.js +2 -2
  4. package/lib/config/config.d.ts +6 -0
  5. package/lib/config/config.js +19 -1
  6. package/lib/config/load.js +2 -2
  7. package/lib/config/types.d.ts +0 -10
  8. package/lib/config/types.js +0 -13
  9. package/lib/decorators/common/registry-dependencies.js +2 -2
  10. package/lib/env.js +3 -1
  11. package/lib/index.d.ts +2 -3
  12. package/lib/index.js +2 -17
  13. package/lib/oas-types.d.ts +1 -1
  14. package/lib/redocly/index.d.ts +2 -1
  15. package/lib/redocly/index.js +24 -14
  16. package/lib/redocly/registry-api.d.ts +2 -2
  17. package/lib/redocly/registry-api.js +9 -9
  18. package/lib/types/redocly-yaml.js +3 -3
  19. package/lib/utils.d.ts +0 -2
  20. package/lib/utils.js +1 -7
  21. package/package.json +3 -4
  22. package/src/__tests__/lint.test.ts +2 -30
  23. package/src/bundle.ts +1 -1
  24. package/src/config/config.ts +23 -1
  25. package/src/config/load.ts +1 -2
  26. package/src/config/types.ts +0 -13
  27. package/src/decorators/common/registry-dependencies.ts +1 -1
  28. package/src/env.ts +3 -1
  29. package/src/index.ts +2 -11
  30. package/src/redocly/__tests__/redocly-client.test.ts +3 -5
  31. package/src/redocly/index.ts +24 -14
  32. package/src/redocly/registry-api.ts +31 -25
  33. package/src/types/redocly-yaml.ts +2 -2
  34. package/src/utils.ts +1 -7
  35. package/tsconfig.tsbuildinfo +1 -1
  36. package/lib/redocly/domains.d.ts +0 -14
  37. package/lib/redocly/domains.js +0 -41
  38. package/lib/types/portal-config-schema.d.ts +0 -5299
  39. package/lib/types/portal-config-schema.js +0 -338
  40. package/lib/types/theme-config.d.ts +0 -2541
  41. package/lib/types/theme-config.js +0 -637
  42. package/src/redocly/__tests__/domains.test.ts +0 -52
  43. package/src/redocly/domains.ts +0 -48
  44. package/src/types/portal-config-schema.ts +0 -416
  45. package/src/types/theme-config.ts +0 -781
@@ -1,338 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rootRedoclyConfigSchema = void 0;
4
- const config_1 = require("../config");
5
- const theme_config_1 = require("./theme-config");
6
- const oidcIssuerMetadataSchema = {
7
- type: 'object',
8
- properties: {
9
- end_session_endpoint: { type: 'string' },
10
- token_endpoint: { type: 'string' },
11
- authorization_endpoint: { type: 'string' },
12
- jwks_uri: { type: 'string' },
13
- },
14
- required: ['token_endpoint', 'authorization_endpoint'],
15
- additionalProperties: true,
16
- };
17
- const oidcProviderConfigSchema = {
18
- type: 'object',
19
- properties: {
20
- type: { type: 'string', const: config_1.AuthProviderType.OIDC },
21
- title: { type: 'string' },
22
- pkce: { type: 'boolean', default: false },
23
- configurationUrl: { type: 'string', minLength: 1 },
24
- configuration: oidcIssuerMetadataSchema,
25
- clientId: { type: 'string', minLength: 1 },
26
- clientSecret: { type: 'string', minLength: 0 },
27
- teamsClaimName: { type: 'string' },
28
- teamsClaimMap: { type: 'object', additionalProperties: { type: 'string' } },
29
- defaultTeams: { type: 'array', items: { type: 'string' } },
30
- scopes: { type: 'array', items: { type: 'string' } },
31
- tokenExpirationTime: { type: 'number' },
32
- authorizationRequestCustomParams: { type: 'object', additionalProperties: { type: 'string' } },
33
- tokenRequestCustomParams: { type: 'object', additionalProperties: { type: 'string' } },
34
- audience: { type: 'array', items: { type: 'string' } },
35
- },
36
- required: ['type', 'clientId'],
37
- oneOf: [{ required: ['configurationUrl'] }, { required: ['configuration'] }],
38
- additionalProperties: false,
39
- };
40
- const saml2ProviderConfigSchema = {
41
- type: 'object',
42
- properties: {
43
- type: { type: 'string', const: config_1.AuthProviderType.SAML2 },
44
- title: { type: 'string' },
45
- issuerId: { type: 'string' },
46
- entityId: { type: 'string' },
47
- ssoUrl: { type: 'string' },
48
- x509PublicCert: { type: 'string' },
49
- teamsAttributeName: { type: 'string', default: config_1.DEFAULT_TEAM_CLAIM_NAME },
50
- teamsAttributeMap: { type: 'object', additionalProperties: { type: 'string' } },
51
- defaultTeams: { type: 'array', items: { type: 'string' } },
52
- },
53
- additionalProperties: false,
54
- required: ['type', 'issuerId', 'ssoUrl', 'x509PublicCert'],
55
- };
56
- const basicAuthProviderConfigSchema = {
57
- type: 'object',
58
- properties: {
59
- type: { type: 'string', const: config_1.AuthProviderType.BASIC },
60
- title: { type: 'string' },
61
- credentials: {
62
- type: 'array',
63
- items: {
64
- type: 'object',
65
- properties: {
66
- username: { type: 'string' },
67
- password: { type: 'string' },
68
- passwordHash: { type: 'string' },
69
- teams: { type: 'array', items: { type: 'string' } },
70
- },
71
- required: ['username'],
72
- additionalProperties: false,
73
- },
74
- },
75
- },
76
- required: ['type', 'credentials'],
77
- additionalProperties: false,
78
- };
79
- const authProviderConfigSchema = {
80
- oneOf: [oidcProviderConfigSchema, saml2ProviderConfigSchema, basicAuthProviderConfigSchema],
81
- discriminator: { propertyName: 'type' },
82
- };
83
- const ssoOnPremConfigSchema = {
84
- type: 'object',
85
- additionalProperties: authProviderConfigSchema,
86
- };
87
- const ssoConfigSchema = {
88
- oneOf: [
89
- {
90
- type: 'array',
91
- items: {
92
- type: 'string',
93
- enum: ['REDOCLY', 'CORPORATE', 'GUEST'],
94
- },
95
- uniqueItems: true,
96
- },
97
- {
98
- type: 'string',
99
- enum: ['REDOCLY', 'CORPORATE', 'GUEST'],
100
- },
101
- ],
102
- };
103
- const redirectConfigSchema = {
104
- type: 'object',
105
- properties: {
106
- to: { type: 'string' },
107
- type: { type: 'number', default: 301 },
108
- },
109
- additionalProperties: false,
110
- };
111
- const redirectsConfigSchema = {
112
- type: 'object',
113
- additionalProperties: redirectConfigSchema,
114
- default: {},
115
- };
116
- const apiConfigSchema = {
117
- type: 'object',
118
- properties: {
119
- root: { type: 'string' },
120
- output: { type: 'string', pattern: '(.ya?ml|.json)$' },
121
- rbac: { type: 'object', additionalProperties: true },
122
- theme: {
123
- type: 'object',
124
- properties: {
125
- openapi: theme_config_1.themeConfigSchema.properties.openapi,
126
- graphql: theme_config_1.themeConfigSchema.properties.graphql,
127
- },
128
- additionalProperties: false,
129
- },
130
- title: { type: 'string' },
131
- metadata: { type: 'object', additionalProperties: true },
132
- rules: { type: 'object', additionalProperties: true },
133
- decorators: { type: 'object', additionalProperties: true },
134
- },
135
- required: ['root'],
136
- };
137
- const metadataConfigSchema = {
138
- type: 'object',
139
- additionalProperties: true,
140
- };
141
- const seoConfigSchema = {
142
- type: 'object',
143
- properties: {
144
- title: { type: 'string' },
145
- description: { type: 'string' },
146
- siteUrl: { type: 'string' },
147
- image: { type: 'string' },
148
- keywords: {
149
- oneOf: [{ type: 'array', items: { type: 'string' } }, { type: 'string' }],
150
- },
151
- lang: { type: 'string' },
152
- jsonLd: { type: 'object' },
153
- meta: {
154
- type: 'array',
155
- items: {
156
- type: 'object',
157
- properties: {
158
- name: { type: 'string' },
159
- content: { type: 'string' },
160
- },
161
- required: ['name', 'content'],
162
- additionalProperties: false,
163
- },
164
- },
165
- },
166
- additionalProperties: false,
167
- };
168
- const rbacScopeItemsSchema = { type: 'object', additionalProperties: { type: 'string' } };
169
- const rbacConfigSchema = {
170
- type: 'object',
171
- properties: {
172
- cms: rbacScopeItemsSchema,
173
- content: {
174
- type: 'object',
175
- properties: {
176
- '**': rbacScopeItemsSchema,
177
- },
178
- additionalProperties: rbacScopeItemsSchema,
179
- },
180
- },
181
- additionalProperties: rbacScopeItemsSchema,
182
- };
183
- const graviteeAdapterConfigSchema = {
184
- type: 'object',
185
- properties: {
186
- type: { type: 'string', const: 'GRAVITEE' },
187
- apiBaseUrl: { type: 'string' },
188
- env: { type: 'string' },
189
- allowApiProductsOutsideCatalog: { type: 'boolean', default: false },
190
- stage: { type: 'string', default: 'non-production' },
191
- auth: { type: 'object', properties: { static: { type: 'string' } } },
192
- },
193
- additionalProperties: false,
194
- required: ['type', 'apiBaseUrl'],
195
- };
196
- const apigeeAdapterAuthOauth2Schema = {
197
- type: 'object',
198
- properties: {
199
- type: { type: 'string', const: config_1.ApigeeDevOnboardingIntegrationAuthType.OAUTH2 },
200
- tokenEndpoint: { type: 'string' },
201
- clientId: { type: 'string' },
202
- clientSecret: { type: 'string' },
203
- },
204
- additionalProperties: false,
205
- required: ['type', 'tokenEndpoint', 'clientId', 'clientSecret'],
206
- };
207
- const apigeeAdapterAuthServiceAccountSchema = {
208
- type: 'object',
209
- properties: {
210
- type: { type: 'string', const: config_1.ApigeeDevOnboardingIntegrationAuthType.SERVICE_ACCOUNT },
211
- serviceAccountEmail: { type: 'string' },
212
- serviceAccountPrivateKey: { type: 'string' },
213
- },
214
- additionalProperties: false,
215
- required: ['type', 'serviceAccountEmail', 'serviceAccountPrivateKey'],
216
- };
217
- const apigeeXAdapterConfigSchema = {
218
- type: 'object',
219
- properties: {
220
- type: { type: 'string', const: 'APIGEE_X' },
221
- apiUrl: { type: 'string' },
222
- stage: { type: 'string', default: 'non-production' },
223
- organizationName: { type: 'string' },
224
- ignoreApiProducts: { type: 'array', items: { type: 'string' } },
225
- allowApiProductsOutsideCatalog: { type: 'boolean', default: false },
226
- auth: {
227
- type: 'object',
228
- oneOf: [apigeeAdapterAuthOauth2Schema, apigeeAdapterAuthServiceAccountSchema],
229
- discriminator: { propertyName: 'type' },
230
- },
231
- },
232
- additionalProperties: false,
233
- required: ['type', 'organizationName', 'auth'],
234
- };
235
- const apigeeEdgeAdapterConfigSchema = Object.assign(Object.assign({}, apigeeXAdapterConfigSchema), { properties: Object.assign(Object.assign({}, apigeeXAdapterConfigSchema.properties), { type: { type: 'string', const: 'APIGEE_EDGE' } }) });
236
- const devOnboardingAdapterConfigSchema = {
237
- type: 'object',
238
- oneOf: [apigeeXAdapterConfigSchema, apigeeEdgeAdapterConfigSchema, graviteeAdapterConfigSchema],
239
- discriminator: { propertyName: 'type' },
240
- };
241
- const devOnboardingConfigSchema = {
242
- type: 'object',
243
- required: ['adapters'],
244
- additionalProperties: false,
245
- properties: {
246
- adapters: {
247
- type: 'array',
248
- items: devOnboardingAdapterConfigSchema,
249
- },
250
- },
251
- };
252
- const i18ConfigSchema = {
253
- type: 'object',
254
- properties: {
255
- defaultLocale: {
256
- type: 'string',
257
- },
258
- locales: {
259
- type: 'array',
260
- items: {
261
- type: 'object',
262
- properties: {
263
- code: {
264
- type: 'string',
265
- },
266
- name: {
267
- type: 'string',
268
- },
269
- },
270
- required: ['code'],
271
- },
272
- },
273
- },
274
- additionalProperties: false,
275
- required: ['defaultLocale'],
276
- };
277
- const responseHeaderSchema = {
278
- type: 'object',
279
- properties: {
280
- name: { type: 'string' },
281
- value: { type: 'string' },
282
- },
283
- additionalProperties: false,
284
- required: ['name', 'value'],
285
- };
286
- const redoclyConfigSchema = {
287
- type: 'object',
288
- properties: {
289
- licenseKey: { type: 'string' },
290
- redirects: redirectsConfigSchema,
291
- seo: seoConfigSchema,
292
- rbac: rbacConfigSchema,
293
- responseHeaders: {
294
- type: 'object',
295
- additionalProperties: {
296
- type: 'array',
297
- items: responseHeaderSchema,
298
- },
299
- },
300
- mockServer: {
301
- type: 'object',
302
- properties: {
303
- off: { type: 'boolean', default: false },
304
- position: { type: 'string', enum: ['first', 'last', 'replace', 'off'], default: 'first' },
305
- strictExamples: { type: 'boolean', default: false },
306
- errorIfForcedExampleNotFound: { type: 'boolean', default: false },
307
- description: { type: 'string' },
308
- },
309
- },
310
- apis: {
311
- type: 'object',
312
- additionalProperties: apiConfigSchema,
313
- },
314
- ssoOnPrem: ssoOnPremConfigSchema,
315
- sso: ssoConfigSchema,
316
- residency: { type: 'string' },
317
- developerOnboarding: devOnboardingConfigSchema,
318
- i18n: i18ConfigSchema,
319
- metadata: metadataConfigSchema,
320
- ignore: {
321
- type: 'array',
322
- items: {
323
- type: 'string',
324
- },
325
- },
326
- theme: theme_config_1.themeConfigSchema,
327
- },
328
- default: { redirects: {} },
329
- additionalProperties: true,
330
- };
331
- const environmentSchema = Object.assign(Object.assign({}, redoclyConfigSchema), { additionalProperties: false });
332
- exports.rootRedoclyConfigSchema = Object.assign(Object.assign({}, redoclyConfigSchema), { properties: Object.assign(Object.assign({ plugins: {
333
- type: 'array',
334
- items: { type: 'string' },
335
- } }, redoclyConfigSchema.properties), { env: {
336
- type: 'object',
337
- additionalProperties: environmentSchema, // TODO: if we want full validation we need to override apis, theme and the root
338
- } }), default: {}, additionalProperties: false });