@redocly/config 0.40.0 → 0.41.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/lib/default-theme-config-schema.d.ts +537 -7
- package/lib/default-theme-config-schema.js +2 -1
- package/lib/ex-theme-config-schemas.d.ts +0 -11
- package/lib/ex-theme-config-schemas.js +1 -9
- package/lib/root-config-schema.d.ts +2645 -136
- package/lib/root-config-schema.js +24 -2
- package/lib/scorecards-config-schema.d.ts +1079 -0
- package/lib/scorecards-config-schema.js +240 -0
- package/lib/types/api-functions-types.d.ts +2 -2
- package/lib/types/config-types.d.ts +5 -2
- package/lib/types/portal-shared-types.d.ts +1 -1
- package/lib-esm/default-theme-config-schema.d.ts +537 -7
- package/lib-esm/default-theme-config-schema.js +2 -1
- package/lib-esm/ex-theme-config-schemas.d.ts +0 -11
- package/lib-esm/ex-theme-config-schemas.js +0 -8
- package/lib-esm/root-config-schema.d.ts +2645 -136
- package/lib-esm/root-config-schema.js +24 -2
- package/lib-esm/scorecards-config-schema.d.ts +1079 -0
- package/lib-esm/scorecards-config-schema.js +237 -0
- package/lib-esm/types/api-functions-types.d.ts +2 -2
- package/lib-esm/types/config-types.d.ts +5 -2
- package/lib-esm/types/portal-shared-types.d.ts +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
const operatorSchema = {
|
|
2
|
+
type: 'string',
|
|
3
|
+
enum: [
|
|
4
|
+
'eq',
|
|
5
|
+
'in',
|
|
6
|
+
'gt',
|
|
7
|
+
'gte',
|
|
8
|
+
'lt',
|
|
9
|
+
'lte',
|
|
10
|
+
'contains',
|
|
11
|
+
'startsWith',
|
|
12
|
+
'endsWith',
|
|
13
|
+
'exists',
|
|
14
|
+
'isEmpty',
|
|
15
|
+
'between',
|
|
16
|
+
'matches',
|
|
17
|
+
'some',
|
|
18
|
+
'every',
|
|
19
|
+
'none',
|
|
20
|
+
'and',
|
|
21
|
+
'or',
|
|
22
|
+
'not',
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
// Base condition schema with field, operator, value, and match properties
|
|
26
|
+
const conditionSchema = {
|
|
27
|
+
type: 'object',
|
|
28
|
+
properties: {
|
|
29
|
+
field: { type: 'string' },
|
|
30
|
+
operator: operatorSchema,
|
|
31
|
+
value: {
|
|
32
|
+
oneOf: [{ type: 'boolean' }, { type: 'string' }, { type: 'number' }],
|
|
33
|
+
},
|
|
34
|
+
match: {
|
|
35
|
+
type: 'array',
|
|
36
|
+
items: {
|
|
37
|
+
type: 'object',
|
|
38
|
+
properties: {
|
|
39
|
+
field: { type: 'string' },
|
|
40
|
+
operator: operatorSchema,
|
|
41
|
+
value: {
|
|
42
|
+
oneOf: [{ type: 'boolean' }, { type: 'string' }, { type: 'number' }],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
// Schema for a logical operator with conditions (used for nesting)
|
|
50
|
+
const logicalOperatorConditionSchema = {
|
|
51
|
+
type: 'object',
|
|
52
|
+
properties: {
|
|
53
|
+
operator: operatorSchema,
|
|
54
|
+
conditions: {
|
|
55
|
+
type: 'array',
|
|
56
|
+
items: conditionSchema, // At the deepest level, only simple conditions
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
required: ['operator', 'conditions'],
|
|
60
|
+
additionalProperties: false,
|
|
61
|
+
};
|
|
62
|
+
// Conditions schema allowing nested conditions with up to 2 levels of recursion
|
|
63
|
+
const conditionsSchema = {
|
|
64
|
+
type: 'array',
|
|
65
|
+
items: {
|
|
66
|
+
oneOf: [
|
|
67
|
+
conditionSchema,
|
|
68
|
+
{
|
|
69
|
+
type: 'object',
|
|
70
|
+
properties: {
|
|
71
|
+
operator: operatorSchema,
|
|
72
|
+
conditions: {
|
|
73
|
+
type: 'array',
|
|
74
|
+
items: {
|
|
75
|
+
oneOf: [conditionSchema, logicalOperatorConditionSchema],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
required: ['operator', 'conditions'],
|
|
80
|
+
additionalProperties: false,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
const entityRuleAssertionSchema = {
|
|
86
|
+
type: 'object',
|
|
87
|
+
properties: {
|
|
88
|
+
defined: { type: 'boolean' },
|
|
89
|
+
nonEmpty: { type: 'boolean' },
|
|
90
|
+
eq: {},
|
|
91
|
+
gt: { type: 'number' },
|
|
92
|
+
gte: { type: 'number' },
|
|
93
|
+
lt: { type: 'number' },
|
|
94
|
+
lte: { type: 'number' },
|
|
95
|
+
const: {},
|
|
96
|
+
},
|
|
97
|
+
additionalProperties: false,
|
|
98
|
+
};
|
|
99
|
+
const entityRuleWhereSchema = {
|
|
100
|
+
type: 'array',
|
|
101
|
+
items: {
|
|
102
|
+
type: 'object',
|
|
103
|
+
properties: {
|
|
104
|
+
subject: {
|
|
105
|
+
type: 'object',
|
|
106
|
+
properties: {
|
|
107
|
+
type: {
|
|
108
|
+
type: 'string',
|
|
109
|
+
enum: ['Entity', 'EntityMetadata', 'EntityRelations', 'EntityRelation'],
|
|
110
|
+
},
|
|
111
|
+
property: { type: 'string' },
|
|
112
|
+
},
|
|
113
|
+
required: ['type', 'property'],
|
|
114
|
+
additionalProperties: false,
|
|
115
|
+
},
|
|
116
|
+
assertions: entityRuleAssertionSchema,
|
|
117
|
+
},
|
|
118
|
+
required: ['subject', 'assertions'],
|
|
119
|
+
additionalProperties: false,
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
const entityRuleSchema = {
|
|
123
|
+
type: 'object',
|
|
124
|
+
properties: {
|
|
125
|
+
title: { type: 'string' },
|
|
126
|
+
subject: {
|
|
127
|
+
type: 'object',
|
|
128
|
+
properties: {
|
|
129
|
+
type: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
enum: ['Entity', 'EntityMetadata', 'EntityRelations', 'EntityRelation'],
|
|
132
|
+
},
|
|
133
|
+
property: { type: 'string' },
|
|
134
|
+
},
|
|
135
|
+
required: ['type', 'property'],
|
|
136
|
+
additionalProperties: false,
|
|
137
|
+
},
|
|
138
|
+
severity: {
|
|
139
|
+
type: 'string',
|
|
140
|
+
enum: ['error', 'warn', 'off'],
|
|
141
|
+
},
|
|
142
|
+
message: { type: 'string' },
|
|
143
|
+
assertions: entityRuleAssertionSchema,
|
|
144
|
+
where: entityRuleWhereSchema,
|
|
145
|
+
weight: { type: 'number', default: 1 },
|
|
146
|
+
},
|
|
147
|
+
required: ['subject', 'assertions'],
|
|
148
|
+
additionalProperties: false,
|
|
149
|
+
};
|
|
150
|
+
// Supports both OpenAPI/AsyncAPI rules (backward compatibility) and entity rules
|
|
151
|
+
const levelRulesSchema = {
|
|
152
|
+
type: 'object',
|
|
153
|
+
additionalProperties: {
|
|
154
|
+
oneOf: [
|
|
155
|
+
{ type: 'string' },
|
|
156
|
+
{
|
|
157
|
+
type: 'object',
|
|
158
|
+
properties: {
|
|
159
|
+
severity: {
|
|
160
|
+
type: 'string',
|
|
161
|
+
enum: ['error', 'warn', 'off'],
|
|
162
|
+
},
|
|
163
|
+
weight: { type: 'number', default: 1 },
|
|
164
|
+
},
|
|
165
|
+
additionalProperties: true,
|
|
166
|
+
},
|
|
167
|
+
entityRuleSchema,
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
const levelSchema = {
|
|
172
|
+
type: 'object',
|
|
173
|
+
properties: {
|
|
174
|
+
name: { type: 'string' },
|
|
175
|
+
extends: {
|
|
176
|
+
type: 'array',
|
|
177
|
+
items: { type: 'string' },
|
|
178
|
+
},
|
|
179
|
+
rules: levelRulesSchema,
|
|
180
|
+
},
|
|
181
|
+
required: ['name'],
|
|
182
|
+
additionalProperties: false,
|
|
183
|
+
};
|
|
184
|
+
const triggerEventSchema = {
|
|
185
|
+
type: 'object',
|
|
186
|
+
properties: {
|
|
187
|
+
event: {
|
|
188
|
+
type: 'string',
|
|
189
|
+
enum: ['runtime', 'manual'],
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
required: ['event'],
|
|
193
|
+
additionalProperties: false,
|
|
194
|
+
};
|
|
195
|
+
const triggerSchema = {
|
|
196
|
+
oneOf: [
|
|
197
|
+
triggerEventSchema,
|
|
198
|
+
{
|
|
199
|
+
type: 'array',
|
|
200
|
+
items: triggerEventSchema,
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
};
|
|
204
|
+
export const scorecardSchema = {
|
|
205
|
+
type: 'object',
|
|
206
|
+
properties: {
|
|
207
|
+
name: { type: 'string' },
|
|
208
|
+
description: { type: 'string' },
|
|
209
|
+
entities: {
|
|
210
|
+
oneOf: [
|
|
211
|
+
conditionsSchema,
|
|
212
|
+
{
|
|
213
|
+
type: 'object',
|
|
214
|
+
properties: {
|
|
215
|
+
operator: operatorSchema,
|
|
216
|
+
conditions: conditionsSchema,
|
|
217
|
+
},
|
|
218
|
+
required: ['operator', 'conditions'],
|
|
219
|
+
additionalProperties: false,
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
levels: {
|
|
224
|
+
type: 'array',
|
|
225
|
+
items: levelSchema,
|
|
226
|
+
minItems: 1,
|
|
227
|
+
},
|
|
228
|
+
trigger: triggerSchema,
|
|
229
|
+
},
|
|
230
|
+
required: ['name', 'entities', 'levels'],
|
|
231
|
+
additionalProperties: false,
|
|
232
|
+
};
|
|
233
|
+
export const scorecardsConfigSchema = {
|
|
234
|
+
type: 'array',
|
|
235
|
+
items: scorecardSchema,
|
|
236
|
+
};
|
|
237
|
+
//# sourceMappingURL=scorecards-config-schema.js.map
|
|
@@ -30,7 +30,7 @@ export type ApiFunctionsContext = {
|
|
|
30
30
|
params: Record<string, string | string[]>;
|
|
31
31
|
query: Record<string, string | string[]>;
|
|
32
32
|
cookies: Record<string, string>;
|
|
33
|
-
|
|
33
|
+
getKv: () => Promise<KvService>;
|
|
34
34
|
/**
|
|
35
35
|
* @deprecated `telemetry` is deprecated.
|
|
36
36
|
*/
|
|
@@ -102,4 +102,4 @@ export interface CookieOptions {
|
|
|
102
102
|
signed?: boolean;
|
|
103
103
|
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
104
104
|
}
|
|
105
|
-
export type ServerPropsContext = Omit<ApiFunctionsContext, '
|
|
105
|
+
export type ServerPropsContext = Omit<ApiFunctionsContext, 'getKv'>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { FromSchema } from 'json-schema-to-ts';
|
|
2
2
|
import type { themeConfigSchema } from '../default-theme-config-schema';
|
|
3
3
|
import type { productConfigOverrideSchema } from '../product-override-schema';
|
|
4
|
-
import type { apiConfigSchema, apigeeAdapterAuthOauth2Schema, apigeeAdapterAuthServiceAccountSchema, apigeeEdgeAdapterConfigSchema, apigeeXAdapterConfigSchema, authProviderConfigSchema, devOnboardingAdapterConfigSchema, graviteeAdapterConfigSchema, l10nConfigSchema, oidcIssuerMetadataSchema, oidcProviderConfigSchema, rbacConfigSchema, rbacScopeItemsSchema, redirectConfigSchema, redirectsConfigSchema, rootRedoclyConfigSchema, saml2ProviderConfigSchema, seoConfigSchema, ssoDirectConfigSchema } from '../root-config-schema';
|
|
4
|
+
import type { apiConfigSchema, apigeeAdapterAuthOauth2Schema, apigeeAdapterAuthServiceAccountSchema, apigeeEdgeAdapterConfigSchema, apigeeXAdapterConfigSchema, authProviderConfigSchema, devOnboardingAdapterConfigSchema, graviteeAdapterConfigSchema, l10nConfigSchema, oidcIssuerMetadataSchema, oidcProviderConfigSchema, rbacConfigSchema, rbacScopeItemsSchema, redirectConfigSchema, redirectsConfigSchema, rootRedoclyConfigSchema, bannerConfigSchema, bannersConfigSchema, saml2ProviderConfigSchema, seoConfigSchema, ssoDirectConfigSchema } from '../root-config-schema';
|
|
5
5
|
import type { RedocConfigTypes } from './redoc-types';
|
|
6
6
|
import type { GraphQLConfigTypes } from './graphql-types';
|
|
7
|
-
import type { productConfigSchema, productGoogleAnalyticsConfigSchema, markdownConfigSchema, amplitudeAnalyticsConfigSchema, rudderstackAnalyticsConfigSchema, segmentAnalyticsConfigSchema, gtmAnalyticsConfigSchema, googleAnalyticsConfigSchema, scorecardConfigSchema,
|
|
7
|
+
import type { productConfigSchema, productGoogleAnalyticsConfigSchema, markdownConfigSchema, amplitudeAnalyticsConfigSchema, rudderstackAnalyticsConfigSchema, segmentAnalyticsConfigSchema, gtmAnalyticsConfigSchema, googleAnalyticsConfigSchema, scorecardConfigSchema, catalogFilterSchema, catalogSchema, searchFacetsConfigSchema } from '../ex-theme-config-schemas';
|
|
8
|
+
import type { scorecardsConfigSchema } from '../scorecards-config-schema';
|
|
8
9
|
import type { reuniteConfigSchema } from '../reunite-config-schema';
|
|
9
10
|
import type { optionalEmailSettings, reasonsSettings } from '../feedback-config-schema';
|
|
10
11
|
/**
|
|
@@ -38,6 +39,8 @@ export type RedoclyConfig = Omit<FromSchema<typeof rootRedoclyConfigSchema>, 'th
|
|
|
38
39
|
};
|
|
39
40
|
export type RedirectConfig = FromSchema<typeof redirectConfigSchema>;
|
|
40
41
|
export type RedirectsConfig = FromSchema<typeof redirectsConfigSchema>;
|
|
42
|
+
export type BannerConfig = FromSchema<typeof bannerConfigSchema>;
|
|
43
|
+
export type BannersConfig = FromSchema<typeof bannersConfigSchema>;
|
|
41
44
|
export type AuthProviderConfig = FromSchema<typeof authProviderConfigSchema>;
|
|
42
45
|
export type OidcProviderConfig = FromSchema<typeof oidcProviderConfigSchema>;
|
|
43
46
|
export type Saml2ProviderConfig = FromSchema<typeof saml2ProviderConfigSchema>;
|
|
@@ -3,7 +3,7 @@ import type { LayoutVariant, REDOCLY_ROUTE_RBAC, REDOCLY_TEAMS_RBAC } from '../c
|
|
|
3
3
|
import type { ProductConfig, ProductGoogleAnalyticsConfig, RbacScopeItems, RedoclyConfig, SeoConfig } from './config-types';
|
|
4
4
|
import type { CatalogEntityConfig } from './catalog-entity-types';
|
|
5
5
|
export * from './code-walkthrough-types';
|
|
6
|
-
export type UiAccessibleConfig = Pick<RedoclyConfig, 'logo' | 'navbar' | 'products' | 'footer' | 'sidebar' | 'scripts' | 'links' | 'feedback' | 'search' | 'aiAssistant' | 'colorMode' | 'navigation' | 'codeSnippet' | 'markdown' | 'openapi' | 'graphql' | 'analytics' | 'userMenu' | 'versionPicker' | 'breadcrumbs' | 'catalog' | 'scorecard' | 'scorecards' | 'scorecardClassic' | 'entitiesCatalog' | 'mcp'> & {
|
|
6
|
+
export type UiAccessibleConfig = Pick<RedoclyConfig, 'logo' | 'navbar' | 'products' | 'footer' | 'sidebar' | 'scripts' | 'links' | 'feedback' | 'search' | 'aiAssistant' | 'colorMode' | 'navigation' | 'codeSnippet' | 'markdown' | 'openapi' | 'graphql' | 'analytics' | 'userMenu' | 'versionPicker' | 'breadcrumbs' | 'catalog' | 'scorecard' | 'scorecards' | 'scorecardClassic' | 'entitiesCatalog' | 'mcp' | 'banner'> & {
|
|
7
7
|
auth?: {
|
|
8
8
|
idpsInfo?: {
|
|
9
9
|
idpId: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib-esm/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@markdoc/markdoc": "0.5.2",
|
|
10
10
|
"@types/node": "22.18.13",
|
|
11
|
-
"@types/react": "^19.
|
|
11
|
+
"@types/react": "^19.2.7",
|
|
12
12
|
"react-router-dom": "^6.21.1",
|
|
13
13
|
"rimraf": "5.0.7",
|
|
14
14
|
"typescript": "5.9.3"
|