@redocly/config 0.47.0 → 0.48.1
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/index.d.ts +9 -9
- package/lib/index.js +1 -41
- package/lib/package.json +3 -0
- package/lib/root-config-schema.d.ts +16 -1
- package/lib/types/api-functions-types.d.ts +2 -2
- package/lib/types/asyncapi-types.d.ts +1 -1
- package/lib/types/catalog-entity-types.d.ts +2 -2
- package/lib/types/config-types.d.ts +10 -10
- package/lib/types/graphql-types.d.ts +1 -1
- package/lib/types/index.d.ts +4 -4
- package/lib/types/portal-shared-types.d.ts +4 -4
- package/lib/types/redoc-types.d.ts +1 -1
- package/lib-esm/index.d.ts +9 -9
- package/lib-esm/index.js +1 -10
- package/lib-esm/root-config-schema.d.ts +16 -1
- package/lib-esm/types/api-functions-types.d.ts +2 -2
- package/lib-esm/types/asyncapi-types.d.ts +1 -1
- package/lib-esm/types/catalog-entity-types.d.ts +2 -2
- package/lib-esm/types/config-types.d.ts +10 -10
- package/lib-esm/types/graphql-types.d.ts +1 -1
- package/lib-esm/types/index.d.ts +4 -4
- package/lib-esm/types/portal-shared-types.d.ts +4 -4
- package/lib-esm/types/redoc-types.d.ts +1 -1
- package/package.json +19 -4
- package/lib/asyncapi-config-schema.js +0 -53
- package/lib/common.js +0 -103
- package/lib/constants/config.js +0 -17
- package/lib/constants/entities.js +0 -58
- package/lib/constants/enum.js +0 -6
- package/lib/constants/shared.js +0 -22
- package/lib/default-theme-config-schema.js +0 -57
- package/lib/entities-catalog-config-schema.js +0 -186
- package/lib/entities-catalog-entity-file-schema.js +0 -283
- package/lib/ex-theme-config-schemas.js +0 -687
- package/lib/feedback-config-schema.js +0 -88
- package/lib/graphql-config-schema.js +0 -157
- package/lib/product-override-schema.js +0 -44
- package/lib/redoc-config-schema.js +0 -120
- package/lib/reference-docs-config-schema.js +0 -518
- package/lib/remove-property-recursively.js +0 -28
- package/lib/reunite-config-schema.js +0 -103
- package/lib/root-config-schema.js +0 -587
- package/lib/scorecards-config-schema.js +0 -242
- package/lib/types/api-functions-types.js +0 -3
- package/lib/types/asyncapi-types.js +0 -3
- package/lib/types/catalog-entity-types.js +0 -3
- package/lib/types/code-walkthrough-types.js +0 -3
- package/lib/types/config-types.js +0 -3
- package/lib/types/graphql-types.js +0 -3
- package/lib/types/index.js +0 -21
- package/lib/types/portal-shared-types.js +0 -18
- package/lib/types/redoc-types.js +0 -3
- package/lib-esm/asyncapi-config-schema.js +0 -50
- package/lib-esm/common.js +0 -100
- package/lib-esm/constants/config.js +0 -14
- package/lib-esm/constants/entities.js +0 -55
- package/lib-esm/constants/enum.js +0 -2
- package/lib-esm/constants/shared.js +0 -19
- package/lib-esm/default-theme-config-schema.js +0 -54
- package/lib-esm/entities-catalog-config-schema.js +0 -183
- package/lib-esm/entities-catalog-entity-file-schema.js +0 -280
- package/lib-esm/ex-theme-config-schemas.js +0 -684
- package/lib-esm/feedback-config-schema.js +0 -85
- package/lib-esm/graphql-config-schema.js +0 -154
- package/lib-esm/product-override-schema.js +0 -41
- package/lib-esm/redoc-config-schema.js +0 -117
- package/lib-esm/reference-docs-config-schema.js +0 -515
- package/lib-esm/remove-property-recursively.js +0 -25
- package/lib-esm/reunite-config-schema.js +0 -100
- package/lib-esm/root-config-schema.js +0 -584
- package/lib-esm/scorecards-config-schema.js +0 -239
- package/lib-esm/types/api-functions-types.js +0 -2
- package/lib-esm/types/asyncapi-types.js +0 -2
- package/lib-esm/types/catalog-entity-types.js +0 -2
- package/lib-esm/types/code-walkthrough-types.js +0 -2
- package/lib-esm/types/config-types.js +0 -2
- package/lib-esm/types/graphql-types.js +0 -2
- package/lib-esm/types/index.js +0 -5
- package/lib-esm/types/portal-shared-types.js +0 -2
- package/lib-esm/types/redoc-types.js +0 -2
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import { configGovernanceSchema } from './common';
|
|
2
|
-
const comparisonOperatorSchema = {
|
|
3
|
-
type: 'string',
|
|
4
|
-
enum: [
|
|
5
|
-
'eq',
|
|
6
|
-
'in',
|
|
7
|
-
'gt',
|
|
8
|
-
'gte',
|
|
9
|
-
'lt',
|
|
10
|
-
'lte',
|
|
11
|
-
'contains',
|
|
12
|
-
'startsWith',
|
|
13
|
-
'endsWith',
|
|
14
|
-
'exists',
|
|
15
|
-
'isEmpty',
|
|
16
|
-
'between',
|
|
17
|
-
'matches',
|
|
18
|
-
'some',
|
|
19
|
-
'every',
|
|
20
|
-
'none',
|
|
21
|
-
],
|
|
22
|
-
};
|
|
23
|
-
const logicalOperatorSchema = {
|
|
24
|
-
type: 'string',
|
|
25
|
-
enum: ['and', 'or'],
|
|
26
|
-
};
|
|
27
|
-
// Base condition schema with field, operator, value, modifier, and match properties
|
|
28
|
-
const conditionSchema = {
|
|
29
|
-
type: 'object',
|
|
30
|
-
properties: {
|
|
31
|
-
field: { type: 'string' },
|
|
32
|
-
operator: comparisonOperatorSchema,
|
|
33
|
-
value: {
|
|
34
|
-
oneOf: [{ type: 'boolean' }, { type: 'string' }, { type: 'number' }],
|
|
35
|
-
},
|
|
36
|
-
modifier: { type: 'string', enum: ['not'] },
|
|
37
|
-
match: {
|
|
38
|
-
type: 'array',
|
|
39
|
-
items: {
|
|
40
|
-
type: 'object',
|
|
41
|
-
properties: {
|
|
42
|
-
field: { type: 'string' },
|
|
43
|
-
operator: comparisonOperatorSchema,
|
|
44
|
-
value: {
|
|
45
|
-
oneOf: [{ type: 'boolean' }, { type: 'string' }, { type: 'number' }],
|
|
46
|
-
},
|
|
47
|
-
modifier: { type: 'string', enum: ['not'] },
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
// Schema for a logical operator with conditions (used for nesting)
|
|
54
|
-
const logicalOperatorConditionSchema = {
|
|
55
|
-
type: 'object',
|
|
56
|
-
properties: {
|
|
57
|
-
operator: logicalOperatorSchema,
|
|
58
|
-
conditions: {
|
|
59
|
-
type: 'array',
|
|
60
|
-
items: conditionSchema, // At the deepest level, only simple conditions
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
required: ['operator', 'conditions'],
|
|
64
|
-
additionalProperties: false,
|
|
65
|
-
};
|
|
66
|
-
// Conditions schema allowing nested conditions with up to 2 levels of recursion
|
|
67
|
-
const conditionsSchema = {
|
|
68
|
-
type: 'array',
|
|
69
|
-
items: {
|
|
70
|
-
oneOf: [
|
|
71
|
-
conditionSchema,
|
|
72
|
-
{
|
|
73
|
-
type: 'object',
|
|
74
|
-
properties: {
|
|
75
|
-
operator: logicalOperatorSchema,
|
|
76
|
-
conditions: {
|
|
77
|
-
type: 'array',
|
|
78
|
-
items: {
|
|
79
|
-
oneOf: [conditionSchema, logicalOperatorConditionSchema],
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
required: ['operator', 'conditions'],
|
|
84
|
-
additionalProperties: false,
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
const entityRuleAssertionSchema = {
|
|
90
|
-
type: 'object',
|
|
91
|
-
properties: {
|
|
92
|
-
defined: { type: 'boolean' },
|
|
93
|
-
nonEmpty: { type: 'boolean' },
|
|
94
|
-
eq: {},
|
|
95
|
-
gt: { type: 'number' },
|
|
96
|
-
gte: { type: 'number' },
|
|
97
|
-
lt: { type: 'number' },
|
|
98
|
-
lte: { type: 'number' },
|
|
99
|
-
const: {},
|
|
100
|
-
},
|
|
101
|
-
additionalProperties: false,
|
|
102
|
-
};
|
|
103
|
-
const entityRuleWhereSchema = {
|
|
104
|
-
type: 'array',
|
|
105
|
-
items: {
|
|
106
|
-
type: 'object',
|
|
107
|
-
properties: {
|
|
108
|
-
subject: {
|
|
109
|
-
type: 'object',
|
|
110
|
-
properties: {
|
|
111
|
-
type: {
|
|
112
|
-
type: 'string',
|
|
113
|
-
enum: ['Entity', 'EntityMetadata', 'EntityRelations', 'EntityRelation'],
|
|
114
|
-
},
|
|
115
|
-
property: { type: 'string' },
|
|
116
|
-
},
|
|
117
|
-
required: ['type', 'property'],
|
|
118
|
-
additionalProperties: false,
|
|
119
|
-
},
|
|
120
|
-
assertions: entityRuleAssertionSchema,
|
|
121
|
-
},
|
|
122
|
-
required: ['subject', 'assertions'],
|
|
123
|
-
additionalProperties: false,
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
const entityRuleSchema = {
|
|
127
|
-
type: 'object',
|
|
128
|
-
properties: {
|
|
129
|
-
title: { type: 'string' },
|
|
130
|
-
subject: {
|
|
131
|
-
type: 'object',
|
|
132
|
-
properties: {
|
|
133
|
-
type: {
|
|
134
|
-
type: 'string',
|
|
135
|
-
enum: ['Entity', 'EntityMetadata', 'EntityRelations', 'EntityRelation'],
|
|
136
|
-
},
|
|
137
|
-
property: { type: 'string' },
|
|
138
|
-
},
|
|
139
|
-
required: ['type', 'property'],
|
|
140
|
-
additionalProperties: false,
|
|
141
|
-
},
|
|
142
|
-
severity: {
|
|
143
|
-
type: 'string',
|
|
144
|
-
enum: ['error', 'warn', 'off'],
|
|
145
|
-
},
|
|
146
|
-
message: { type: 'string' },
|
|
147
|
-
assertions: entityRuleAssertionSchema,
|
|
148
|
-
where: entityRuleWhereSchema,
|
|
149
|
-
weight: { type: 'number', default: 1 },
|
|
150
|
-
},
|
|
151
|
-
required: ['subject', 'assertions'],
|
|
152
|
-
additionalProperties: false,
|
|
153
|
-
};
|
|
154
|
-
// Supports both OpenAPI/AsyncAPI rules (backward compatibility) and entity rules
|
|
155
|
-
const levelRulesSchema = {
|
|
156
|
-
type: 'object',
|
|
157
|
-
additionalProperties: {
|
|
158
|
-
oneOf: [
|
|
159
|
-
{ type: 'string' },
|
|
160
|
-
{
|
|
161
|
-
type: 'object',
|
|
162
|
-
properties: {
|
|
163
|
-
severity: {
|
|
164
|
-
type: 'string',
|
|
165
|
-
enum: ['error', 'warn', 'off'],
|
|
166
|
-
},
|
|
167
|
-
weight: { type: 'number', default: 1 },
|
|
168
|
-
},
|
|
169
|
-
additionalProperties: true,
|
|
170
|
-
},
|
|
171
|
-
entityRuleSchema,
|
|
172
|
-
],
|
|
173
|
-
},
|
|
174
|
-
};
|
|
175
|
-
const levelSchema = {
|
|
176
|
-
type: 'object',
|
|
177
|
-
properties: {
|
|
178
|
-
name: { type: 'string' },
|
|
179
|
-
extends: configGovernanceSchema.extends,
|
|
180
|
-
rules: levelRulesSchema,
|
|
181
|
-
},
|
|
182
|
-
required: ['name'],
|
|
183
|
-
additionalProperties: false,
|
|
184
|
-
};
|
|
185
|
-
const triggerEventSchema = {
|
|
186
|
-
type: 'object',
|
|
187
|
-
properties: {
|
|
188
|
-
event: {
|
|
189
|
-
type: 'string',
|
|
190
|
-
enum: ['runtime', 'manual'],
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
required: ['event'],
|
|
194
|
-
additionalProperties: false,
|
|
195
|
-
};
|
|
196
|
-
const triggerSchema = {
|
|
197
|
-
oneOf: [
|
|
198
|
-
triggerEventSchema,
|
|
199
|
-
{
|
|
200
|
-
type: 'array',
|
|
201
|
-
items: triggerEventSchema,
|
|
202
|
-
},
|
|
203
|
-
],
|
|
204
|
-
};
|
|
205
|
-
export const scorecardSchema = {
|
|
206
|
-
type: 'object',
|
|
207
|
-
properties: {
|
|
208
|
-
name: { type: 'string' },
|
|
209
|
-
key: { type: 'string' },
|
|
210
|
-
description: { type: 'string' },
|
|
211
|
-
entities: {
|
|
212
|
-
oneOf: [
|
|
213
|
-
conditionsSchema,
|
|
214
|
-
{
|
|
215
|
-
type: 'object',
|
|
216
|
-
properties: {
|
|
217
|
-
operator: logicalOperatorSchema,
|
|
218
|
-
conditions: conditionsSchema,
|
|
219
|
-
},
|
|
220
|
-
required: ['operator', 'conditions'],
|
|
221
|
-
additionalProperties: false,
|
|
222
|
-
},
|
|
223
|
-
],
|
|
224
|
-
},
|
|
225
|
-
levels: {
|
|
226
|
-
type: 'array',
|
|
227
|
-
items: levelSchema,
|
|
228
|
-
minItems: 1,
|
|
229
|
-
},
|
|
230
|
-
trigger: triggerSchema,
|
|
231
|
-
},
|
|
232
|
-
required: ['name', 'key', 'entities', 'levels'],
|
|
233
|
-
additionalProperties: false,
|
|
234
|
-
};
|
|
235
|
-
export const scorecardsConfigSchema = {
|
|
236
|
-
type: 'array',
|
|
237
|
-
items: scorecardSchema,
|
|
238
|
-
};
|
|
239
|
-
//# sourceMappingURL=scorecards-config-schema.js.map
|
package/lib-esm/types/index.js
DELETED