@redocly/config 0.6.2 → 0.7.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.
@@ -52,31 +52,8 @@ export const saml2ProviderConfigSchema = {
52
52
  additionalProperties: false,
53
53
  required: ['type', 'issuerId', 'ssoUrl', 'x509PublicCert'],
54
54
  };
55
- export const basicAuthProviderConfigSchema = {
56
- type: 'object',
57
- properties: {
58
- type: { type: 'string', const: AuthProviderType.BASIC },
59
- title: { type: 'string' },
60
- credentials: {
61
- type: 'array',
62
- items: {
63
- type: 'object',
64
- properties: {
65
- username: { type: 'string' },
66
- password: { type: 'string' },
67
- passwordHash: { type: 'string' },
68
- teams: { type: 'array', items: { type: 'string' } },
69
- },
70
- required: ['username'],
71
- additionalProperties: false,
72
- },
73
- },
74
- },
75
- required: ['type', 'credentials'],
76
- additionalProperties: false,
77
- };
78
55
  export const authProviderConfigSchema = {
79
- oneOf: [oidcProviderConfigSchema, saml2ProviderConfigSchema, basicAuthProviderConfigSchema],
56
+ oneOf: [oidcProviderConfigSchema, saml2ProviderConfigSchema],
80
57
  discriminator: { propertyName: 'type' },
81
58
  };
82
59
  export const ssoOnPremConfigSchema = {
@@ -1,12 +1,14 @@
1
1
  import type { FromSchema } from 'json-schema-to-ts';
2
- import type { amplitudeAnalyticsConfigSchema, catalogFilterSchema, catalogSchema, googleAnalyticsConfigSchema, gtmAnalyticsConfigSchema, markdownConfigSchema, productConfigSchema, productGoogleAnalyticsConfigSchema, rudderstackAnalyticsConfigSchema, scorecardConfigSchema, segmentAnalyticsConfigSchema, themeConfigSchema } from './default-theme-config-schema';
3
- import type { apiConfigSchema, apigeeAdapterAuthOauth2Schema, apigeeAdapterAuthServiceAccountSchema, apigeeEdgeAdapterConfigSchema, apigeeXAdapterConfigSchema, authProviderConfigSchema, basicAuthProviderConfigSchema, devOnboardingAdapterConfigSchema, graviteeAdapterConfigSchema, i18ConfigSchema, oidcIssuerMetadataSchema, oidcProviderConfigSchema, rbacConfigSchema, rbacScopeItemsSchema, redirectConfigSchema, redirectsConfigSchema, rootRedoclyConfigSchema, saml2ProviderConfigSchema, seoConfigSchema, ssoOnPremConfigSchema } from './root-config-schema';
2
+ import type { amplitudeAnalyticsConfigSchema, catalogFilterSchema, catalogSchema, googleAnalyticsConfigSchema, gtmAnalyticsConfigSchema, markdownConfigSchema, productConfigSchema, productGoogleAnalyticsConfigSchema, rudderstackAnalyticsConfigSchema, scorecardConfigSchema, segmentAnalyticsConfigSchema, closedThemeConfigSchema as themeConfigSchema } from './default-theme-config-schema';
3
+ import type { apiConfigSchema, apigeeAdapterAuthOauth2Schema, apigeeAdapterAuthServiceAccountSchema, apigeeEdgeAdapterConfigSchema, apigeeXAdapterConfigSchema, authProviderConfigSchema, devOnboardingAdapterConfigSchema, graviteeAdapterConfigSchema, i18ConfigSchema, oidcIssuerMetadataSchema, oidcProviderConfigSchema, rbacConfigSchema, rbacScopeItemsSchema, redirectConfigSchema, redirectsConfigSchema, rootRedoclyConfigSchema, saml2ProviderConfigSchema, seoConfigSchema, ssoOnPremConfigSchema } from './root-config-schema';
4
4
  import type { RedocConfigTypes } from './redoc-types';
5
5
  import type { GraphQLConfigTypes } from './graphql-types';
6
6
  /**
7
7
  * Theme
8
8
  */
9
- export type ThemeConfig = FromSchema<typeof themeConfigSchema>;
9
+ export type ThemeConfig = Omit<FromSchema<typeof themeConfigSchema>, 'openapi'> & {
10
+ openapi?: RedocConfigTypes;
11
+ };
10
12
  export type RedocConfig = RedocConfigTypes;
11
13
  export type GraphQLConfig = GraphQLConfigTypes;
12
14
  export type ProductConfig = FromSchema<typeof productConfigSchema>;
@@ -23,13 +25,13 @@ export type ScorecardConfig = FromSchema<typeof scorecardConfigSchema>;
23
25
  /**
24
26
  * Root
25
27
  */
26
- export type RedoclyConfig<T = ThemeConfig> = FromSchema<typeof rootRedoclyConfigSchema> & {
28
+ export type RedoclyConfig<T = ThemeConfig> = Omit<FromSchema<typeof rootRedoclyConfigSchema>, 'theme' | 'apis'> & {
27
29
  theme?: T;
30
+ apis?: Record<string, ApiConfig>;
28
31
  };
29
32
  export type RedirectConfig = FromSchema<typeof redirectConfigSchema>;
30
33
  export type RedirectsConfig = FromSchema<typeof redirectsConfigSchema>;
31
34
  export type AuthProviderConfig = FromSchema<typeof authProviderConfigSchema>;
32
- export type BasicAuthProviderConfig = FromSchema<typeof basicAuthProviderConfigSchema>;
33
35
  export type OidcProviderConfig = FromSchema<typeof oidcProviderConfigSchema>;
34
36
  export type Saml2ProviderConfig = FromSchema<typeof saml2ProviderConfigSchema>;
35
37
  export type SeoConfig = FromSchema<typeof seoConfigSchema>;
@@ -43,4 +45,11 @@ export type ApigeeAdapterAuthOauth2 = FromSchema<typeof apigeeAdapterAuthOauth2S
43
45
  export type ApigeeAdapterAuthServiceAccount = FromSchema<typeof apigeeAdapterAuthServiceAccountSchema>;
44
46
  export type SsoConfig = FromSchema<typeof ssoOnPremConfigSchema>;
45
47
  export type I18nConfig = FromSchema<typeof i18ConfigSchema>;
46
- export type ApiConfig = FromSchema<typeof apiConfigSchema>;
48
+ type BasicApiConfig = FromSchema<typeof apiConfigSchema>;
49
+ export type ApiConfig = BasicApiConfig & {
50
+ theme?: {
51
+ openapi?: RedocConfig;
52
+ graphql?: GraphQLConfig;
53
+ };
54
+ };
55
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/config",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "license": "MIT",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",