@redocly/cli 2.28.0 → 2.29.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/commands/bundle.d.ts.map +1 -1
- package/lib/commands/bundle.js +3 -3
- package/lib/commands/bundle.js.map +1 -1
- package/lib/commands/join/index.js +2 -2
- package/lib/commands/join/index.js.map +1 -1
- package/lib/commands/score/collect-metrics.d.ts +17 -0
- package/lib/commands/score/collect-metrics.d.ts.map +1 -0
- package/lib/commands/score/collect-metrics.js +195 -0
- package/lib/commands/score/collect-metrics.js.map +1 -0
- package/lib/commands/score/collectors/dependency-graph.d.ts +9 -0
- package/lib/commands/score/collectors/dependency-graph.d.ts.map +1 -0
- package/lib/commands/score/collectors/dependency-graph.js +61 -0
- package/lib/commands/score/collectors/dependency-graph.js.map +1 -0
- package/lib/commands/score/collectors/document-metrics.d.ts +69 -0
- package/lib/commands/score/collectors/document-metrics.d.ts.map +1 -0
- package/lib/commands/score/collectors/document-metrics.js +343 -0
- package/lib/commands/score/collectors/document-metrics.js.map +1 -0
- package/lib/commands/score/constants.d.ts +4 -0
- package/lib/commands/score/constants.d.ts.map +1 -0
- package/lib/commands/score/constants.js +47 -0
- package/lib/commands/score/constants.js.map +1 -0
- package/lib/commands/score/formatters/json.d.ts +3 -0
- package/lib/commands/score/formatters/json.d.ts.map +1 -0
- package/lib/commands/score/formatters/json.js +20 -0
- package/lib/commands/score/formatters/json.js.map +1 -0
- package/lib/commands/score/formatters/stylish.d.ts +4 -0
- package/lib/commands/score/formatters/stylish.d.ts.map +1 -0
- package/lib/commands/score/formatters/stylish.js +235 -0
- package/lib/commands/score/formatters/stylish.js.map +1 -0
- package/lib/commands/score/hotspots.d.ts +3 -0
- package/lib/commands/score/hotspots.d.ts.map +1 -0
- package/lib/commands/score/hotspots.js +70 -0
- package/lib/commands/score/hotspots.js.map +1 -0
- package/lib/commands/score/index.d.ts +11 -0
- package/lib/commands/score/index.d.ts.map +1 -0
- package/lib/commands/score/index.js +69 -0
- package/lib/commands/score/index.js.map +1 -0
- package/lib/commands/score/scoring.d.ts +14 -0
- package/lib/commands/score/scoring.d.ts.map +1 -0
- package/lib/commands/score/scoring.js +136 -0
- package/lib/commands/score/scoring.js.map +1 -0
- package/lib/commands/score/types.d.ts +119 -0
- package/lib/commands/score/types.d.ts.map +1 -0
- package/lib/commands/score/types.js +2 -0
- package/lib/commands/score/types.js.map +1 -0
- package/lib/commands/score/utils.d.ts +2 -0
- package/lib/commands/score/utils.d.ts.map +1 -0
- package/lib/commands/score/utils.js +8 -0
- package/lib/commands/score/utils.js.map +1 -0
- package/lib/index.js +28 -0
- package/lib/index.js.map +1 -1
- package/lib/reunite/api/api-client.js +2 -2
- package/lib/reunite/api/api-client.js.map +1 -1
- package/lib/utils/constants.d.ts +1 -0
- package/lib/utils/constants.d.ts.map +1 -1
- package/lib/utils/constants.js +1 -0
- package/lib/utils/constants.js.map +1 -1
- package/lib/utils/miscellaneous.d.ts +2 -2
- package/lib/utils/miscellaneous.d.ts.map +1 -1
- package/lib/utils/miscellaneous.js +62 -44
- package/lib/utils/miscellaneous.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { isNotEmptyObject, isPlainObject, } from '@redocly/openapi-core';
|
|
2
|
+
import { AMBIGUOUS_PARAM_NAMES } from '../constants.js';
|
|
3
|
+
import { effectivePolymorphismFromCounts } from '../scoring.js';
|
|
4
|
+
/** When two media types have the same property count, pick the triple with stronger doc + constraint signal. */
|
|
5
|
+
function propertyMetricsBundleScore(totalSchemaProperties, schemaPropertiesWithDescription, constraintCount) {
|
|
6
|
+
const p = Math.max(1, totalSchemaProperties);
|
|
7
|
+
return schemaPropertiesWithDescription / p + constraintCount / p;
|
|
8
|
+
}
|
|
9
|
+
function shouldReplacePropertyMetrics(current, stats) {
|
|
10
|
+
if (stats.totalSchemaProperties > current.totalSchemaProperties)
|
|
11
|
+
return true;
|
|
12
|
+
if (stats.totalSchemaProperties < current.totalSchemaProperties)
|
|
13
|
+
return false;
|
|
14
|
+
return (propertyMetricsBundleScore(stats.totalSchemaProperties, stats.schemaPropertiesWithDescription, stats.constraintCount) >
|
|
15
|
+
propertyMetricsBundleScore(current.totalSchemaProperties, current.schemaPropertiesWithDescription, current.constraintCount));
|
|
16
|
+
}
|
|
17
|
+
const CONSTRAINT_KEYS = [
|
|
18
|
+
'enum',
|
|
19
|
+
'const',
|
|
20
|
+
'format',
|
|
21
|
+
'pattern',
|
|
22
|
+
'minimum',
|
|
23
|
+
'maximum',
|
|
24
|
+
'minLength',
|
|
25
|
+
'maxLength',
|
|
26
|
+
'minItems',
|
|
27
|
+
'maxItems',
|
|
28
|
+
'minProperties',
|
|
29
|
+
'maxProperties',
|
|
30
|
+
'multipleOf',
|
|
31
|
+
'exclusiveMinimum',
|
|
32
|
+
'exclusiveMaximum',
|
|
33
|
+
'uniqueItems',
|
|
34
|
+
];
|
|
35
|
+
export function createSchemaWalkState() {
|
|
36
|
+
return {
|
|
37
|
+
depth: -1, // starts at -1 because the root Schema.enter increments to 0
|
|
38
|
+
maxDepth: 0,
|
|
39
|
+
polymorphismCount: 0,
|
|
40
|
+
anyOfCount: 0,
|
|
41
|
+
hasDiscriminator: false,
|
|
42
|
+
totalSchemaProperties: 0,
|
|
43
|
+
schemaPropertiesWithDescription: 0,
|
|
44
|
+
constraintCount: 0,
|
|
45
|
+
hasPropertyExamples: false,
|
|
46
|
+
writableTopLevelFields: 0,
|
|
47
|
+
refsUsed: [],
|
|
48
|
+
debugEntries: null,
|
|
49
|
+
pendingRef: null,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export function resetSchemaWalkState(s) {
|
|
53
|
+
Object.assign(s, createSchemaWalkState());
|
|
54
|
+
}
|
|
55
|
+
export function createSchemaMetricVisitor(state) {
|
|
56
|
+
return {
|
|
57
|
+
ref: {
|
|
58
|
+
enter(ref) {
|
|
59
|
+
if (typeof ref?.$ref === 'string') {
|
|
60
|
+
state.refsUsed.push(ref.$ref);
|
|
61
|
+
state.pendingRef = ref.$ref;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
Schema: {
|
|
66
|
+
enter(schema, ctx) {
|
|
67
|
+
state.depth++;
|
|
68
|
+
state.maxDepth = Math.max(state.maxDepth, state.depth);
|
|
69
|
+
let localConstraints = 0;
|
|
70
|
+
for (const key of CONSTRAINT_KEYS) {
|
|
71
|
+
if (schema[key] !== undefined) {
|
|
72
|
+
state.constraintCount++;
|
|
73
|
+
localConstraints++;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (schema.discriminator?.propertyName)
|
|
77
|
+
state.hasDiscriminator = true;
|
|
78
|
+
const localPoly = {};
|
|
79
|
+
for (const keyword of ['oneOf', 'anyOf', 'allOf']) {
|
|
80
|
+
const list = schema[keyword];
|
|
81
|
+
if (!Array.isArray(list))
|
|
82
|
+
continue;
|
|
83
|
+
state.polymorphismCount += list.length;
|
|
84
|
+
if (keyword === 'anyOf')
|
|
85
|
+
state.anyOfCount += list.length;
|
|
86
|
+
localPoly[keyword] = list.length;
|
|
87
|
+
}
|
|
88
|
+
const localPropertyNames = [];
|
|
89
|
+
if (isPlainObject(schema.properties)) {
|
|
90
|
+
const props = Object.entries(schema.properties);
|
|
91
|
+
state.totalSchemaProperties += props.length;
|
|
92
|
+
for (const [name, prop] of props) {
|
|
93
|
+
localPropertyNames.push(name);
|
|
94
|
+
const res = prop && '$ref' in prop && prop.$ref ? (ctx.resolve(prop)?.node ?? prop) : prop;
|
|
95
|
+
if (res?.description)
|
|
96
|
+
state.schemaPropertiesWithDescription++;
|
|
97
|
+
if (res?.example !== undefined || res?.examples)
|
|
98
|
+
state.hasPropertyExamples = true;
|
|
99
|
+
if (!res?.readOnly)
|
|
100
|
+
state.writableTopLevelFields++;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (state.debugEntries !== null) {
|
|
104
|
+
state.debugEntries.push({
|
|
105
|
+
ref: state.pendingRef,
|
|
106
|
+
depth: state.depth,
|
|
107
|
+
propertyNames: localPropertyNames,
|
|
108
|
+
polymorphism: Object.keys(localPoly).length > 0 ? localPoly : {},
|
|
109
|
+
constraintCount: localConstraints,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
state.pendingRef = null;
|
|
113
|
+
},
|
|
114
|
+
leave() {
|
|
115
|
+
state.depth--;
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export function createScoreAccumulator(walkSchema, anyOfPenaltyMultiplier, debugOperationId) {
|
|
121
|
+
return {
|
|
122
|
+
operations: new Map(),
|
|
123
|
+
currentPath: '',
|
|
124
|
+
pathLevelParams: [],
|
|
125
|
+
current: null,
|
|
126
|
+
walkSchema,
|
|
127
|
+
anyOfPenaltyMultiplier,
|
|
128
|
+
debugOperationId,
|
|
129
|
+
debugLogs: [],
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function createOperationContext(path, method, operation) {
|
|
133
|
+
return {
|
|
134
|
+
path,
|
|
135
|
+
method,
|
|
136
|
+
operationId: operation.operationId,
|
|
137
|
+
operationDescriptionPresent: !!operation.description,
|
|
138
|
+
parameterCount: 0,
|
|
139
|
+
requiredParameterCount: 0,
|
|
140
|
+
paramsWithDescription: 0,
|
|
141
|
+
ambiguousIdentifierCount: 0,
|
|
142
|
+
maxRequestSchemaDepth: 0,
|
|
143
|
+
maxResponseSchemaDepth: 0,
|
|
144
|
+
totalSchemaProperties: 0,
|
|
145
|
+
schemaPropertiesWithDescription: 0,
|
|
146
|
+
constraintCount: 0,
|
|
147
|
+
polymorphismCount: 0,
|
|
148
|
+
anyOfCount: 0,
|
|
149
|
+
hasDiscriminator: false,
|
|
150
|
+
topLevelWritableFieldCount: 0,
|
|
151
|
+
requestBodyPresent: false,
|
|
152
|
+
requestExamplePresent: false,
|
|
153
|
+
responseExamplePresent: false,
|
|
154
|
+
structuredErrorResponseCount: 0,
|
|
155
|
+
totalErrorResponses: 0,
|
|
156
|
+
inRequestBody: false,
|
|
157
|
+
inResponse: false,
|
|
158
|
+
currentResponseCode: '',
|
|
159
|
+
errorStructuredCounted: false,
|
|
160
|
+
maxEffectivePolymorphism: -1,
|
|
161
|
+
refsUsed: new Set(),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function buildOperationMetrics(ctx) {
|
|
165
|
+
const { inRequestBody: _1, inResponse: _2, currentResponseCode: _3, errorStructuredCounted: _4, maxEffectivePolymorphism: _5, ...metrics } = ctx;
|
|
166
|
+
return metrics;
|
|
167
|
+
}
|
|
168
|
+
export function createScoreVisitor(accumulator) {
|
|
169
|
+
return {
|
|
170
|
+
RequestBody: {
|
|
171
|
+
enter() {
|
|
172
|
+
if (!accumulator.current)
|
|
173
|
+
return;
|
|
174
|
+
accumulator.current.requestBodyPresent = true;
|
|
175
|
+
accumulator.current.inRequestBody = true;
|
|
176
|
+
},
|
|
177
|
+
leave() {
|
|
178
|
+
if (accumulator.current)
|
|
179
|
+
accumulator.current.inRequestBody = false;
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
Response: {
|
|
183
|
+
enter(response, ctx) {
|
|
184
|
+
const current = accumulator.current;
|
|
185
|
+
if (!current)
|
|
186
|
+
return;
|
|
187
|
+
const code = String(ctx.key);
|
|
188
|
+
current.inResponse = true;
|
|
189
|
+
current.currentResponseCode = code;
|
|
190
|
+
current.errorStructuredCounted = false;
|
|
191
|
+
if (isErrorCode(code)) {
|
|
192
|
+
current.totalErrorResponses++;
|
|
193
|
+
if (!response.content && response.description) {
|
|
194
|
+
current.structuredErrorResponseCount++;
|
|
195
|
+
current.errorStructuredCounted = true;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
leave() {
|
|
200
|
+
if (accumulator.current)
|
|
201
|
+
accumulator.current.inResponse = false;
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
MediaType: {
|
|
205
|
+
enter(mediaType) {
|
|
206
|
+
const current = accumulator.current;
|
|
207
|
+
if (!current)
|
|
208
|
+
return;
|
|
209
|
+
if (hasExample(mediaType)) {
|
|
210
|
+
if (current.inRequestBody)
|
|
211
|
+
current.requestExamplePresent = true;
|
|
212
|
+
if (current.inResponse)
|
|
213
|
+
current.responseExamplePresent = true;
|
|
214
|
+
}
|
|
215
|
+
if (current.inResponse &&
|
|
216
|
+
isErrorCode(current.currentResponseCode) &&
|
|
217
|
+
!current.errorStructuredCounted) {
|
|
218
|
+
current.structuredErrorResponseCount++;
|
|
219
|
+
current.errorStructuredCounted = true;
|
|
220
|
+
}
|
|
221
|
+
if (mediaType.schema) {
|
|
222
|
+
const isDebugTarget = !!accumulator.debugOperationId &&
|
|
223
|
+
(current.operationId === accumulator.debugOperationId ||
|
|
224
|
+
`${current.method.toUpperCase()} ${current.path}` === accumulator.debugOperationId);
|
|
225
|
+
const stats = accumulator.walkSchema(mediaType.schema, isDebugTarget);
|
|
226
|
+
if (shouldReplacePropertyMetrics(current, stats)) {
|
|
227
|
+
current.totalSchemaProperties = stats.totalSchemaProperties;
|
|
228
|
+
current.schemaPropertiesWithDescription = stats.schemaPropertiesWithDescription;
|
|
229
|
+
current.constraintCount = stats.constraintCount;
|
|
230
|
+
}
|
|
231
|
+
const effective = effectivePolymorphismFromCounts(stats.polymorphismCount, stats.anyOfCount, accumulator.anyOfPenaltyMultiplier);
|
|
232
|
+
if (effective > current.maxEffectivePolymorphism) {
|
|
233
|
+
current.maxEffectivePolymorphism = effective;
|
|
234
|
+
current.polymorphismCount = stats.polymorphismCount;
|
|
235
|
+
current.anyOfCount = stats.anyOfCount;
|
|
236
|
+
}
|
|
237
|
+
if (stats.hasDiscriminator)
|
|
238
|
+
current.hasDiscriminator = true;
|
|
239
|
+
for (const ref of stats.refsUsed)
|
|
240
|
+
current.refsUsed.add(ref);
|
|
241
|
+
if (stats.hasPropertyExamples) {
|
|
242
|
+
if (current.inRequestBody)
|
|
243
|
+
current.requestExamplePresent = true;
|
|
244
|
+
if (current.inResponse)
|
|
245
|
+
current.responseExamplePresent = true;
|
|
246
|
+
}
|
|
247
|
+
if (current.inRequestBody) {
|
|
248
|
+
current.maxRequestSchemaDepth = Math.max(current.maxRequestSchemaDepth, stats.maxDepth);
|
|
249
|
+
current.topLevelWritableFieldCount = Math.max(current.topLevelWritableFieldCount, stats.writableTopLevelFields);
|
|
250
|
+
}
|
|
251
|
+
if (current.inResponse) {
|
|
252
|
+
current.maxResponseSchemaDepth = Math.max(current.maxResponseSchemaDepth, stats.maxDepth);
|
|
253
|
+
}
|
|
254
|
+
if (isDebugTarget && stats.debugEntries) {
|
|
255
|
+
const context = current.inRequestBody
|
|
256
|
+
? 'REQUEST BODY'
|
|
257
|
+
: `RESPONSE ${current.currentResponseCode}`;
|
|
258
|
+
accumulator.debugLogs.push({
|
|
259
|
+
context,
|
|
260
|
+
entries: stats.debugEntries,
|
|
261
|
+
totalProperties: stats.totalSchemaProperties,
|
|
262
|
+
totalPolymorphism: stats.polymorphismCount,
|
|
263
|
+
totalConstraints: stats.constraintCount,
|
|
264
|
+
maxDepth: stats.maxDepth,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
Paths: {
|
|
271
|
+
PathItem: {
|
|
272
|
+
enter(pathItem, ctx) {
|
|
273
|
+
accumulator.currentPath = String(ctx.key);
|
|
274
|
+
accumulator.pathLevelParams = pathItem.parameters ?? [];
|
|
275
|
+
},
|
|
276
|
+
Operation: {
|
|
277
|
+
enter(operation, ctx) {
|
|
278
|
+
const method = String(ctx.key);
|
|
279
|
+
const current = createOperationContext(accumulator.currentPath, method, operation);
|
|
280
|
+
accumulator.current = current;
|
|
281
|
+
const merged = mergeParameters(accumulator.pathLevelParams, operation.parameters ?? [], ctx.resolve);
|
|
282
|
+
for (const param of merged.values()) {
|
|
283
|
+
current.parameterCount++;
|
|
284
|
+
if (param.required)
|
|
285
|
+
current.requiredParameterCount++;
|
|
286
|
+
if (param.description)
|
|
287
|
+
current.paramsWithDescription++;
|
|
288
|
+
if (isAmbiguousParam(param))
|
|
289
|
+
current.ambiguousIdentifierCount++;
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
leave(operation) {
|
|
293
|
+
const current = accumulator.current;
|
|
294
|
+
if (!current)
|
|
295
|
+
return;
|
|
296
|
+
const opKey = operation.operationId ?? `${current.method.toUpperCase()} ${current.path}`;
|
|
297
|
+
accumulator.operations.set(opKey, buildOperationMetrics(current));
|
|
298
|
+
accumulator.current = null;
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
export function getDocumentMetrics(accumulator) {
|
|
306
|
+
return { operationCount: accumulator.operations.size, operations: accumulator.operations };
|
|
307
|
+
}
|
|
308
|
+
function resolveParam(raw, resolve) {
|
|
309
|
+
return resolve(raw).node;
|
|
310
|
+
}
|
|
311
|
+
function mergeParameters(pathLevel, opLevel, resolve) {
|
|
312
|
+
const merged = new Map();
|
|
313
|
+
for (const raw of pathLevel) {
|
|
314
|
+
const p = resolveParam(raw, resolve);
|
|
315
|
+
if (p?.name && p.in)
|
|
316
|
+
merged.set(`${p.in}:${p.name}`, p);
|
|
317
|
+
}
|
|
318
|
+
for (const raw of opLevel) {
|
|
319
|
+
const p = resolveParam(raw, resolve);
|
|
320
|
+
if (p?.name && p.in)
|
|
321
|
+
merged.set(`${p.in}:${p.name}`, p);
|
|
322
|
+
}
|
|
323
|
+
return merged;
|
|
324
|
+
}
|
|
325
|
+
function hasExample(mediaType) {
|
|
326
|
+
return mediaType.example !== undefined || isNotEmptyObject(mediaType.examples);
|
|
327
|
+
}
|
|
328
|
+
function isAmbiguousParam(param) {
|
|
329
|
+
if (param.description)
|
|
330
|
+
return false;
|
|
331
|
+
const name = (param.name ?? '').toLowerCase();
|
|
332
|
+
return AMBIGUOUS_PARAM_NAMES.has(name);
|
|
333
|
+
}
|
|
334
|
+
function isErrorCode(code) {
|
|
335
|
+
if (code === 'default')
|
|
336
|
+
return true;
|
|
337
|
+
// OpenAPI 3.1: status ranges 4XX / 5XX (see https://spec.openapis.org/oas/v3.1.0#patterned-fields)
|
|
338
|
+
if (/^4xx$/i.test(code) || /^5xx$/i.test(code))
|
|
339
|
+
return true;
|
|
340
|
+
const num = parseInt(code, 10);
|
|
341
|
+
return num >= 400 && num < 600;
|
|
342
|
+
}
|
|
343
|
+
//# sourceMappingURL=document-metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-metrics.js","sourceRoot":"","sources":["../../../../src/commands/score/collectors/document-metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,aAAa,GAUd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAahE,gHAAgH;AAChH,SAAS,0BAA0B,CACjC,qBAA6B,EAC7B,+BAAuC,EACvC,eAAuB;IAEvB,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC;IAC7C,OAAO,+BAA+B,GAAG,CAAC,GAAG,eAAe,GAAG,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,4BAA4B,CACnC,OAAgC,EAChC,KAAkB;IAElB,IAAI,KAAK,CAAC,qBAAqB,GAAG,OAAO,CAAC,qBAAqB;QAAE,OAAO,IAAI,CAAC;IAC7E,IAAI,KAAK,CAAC,qBAAqB,GAAG,OAAO,CAAC,qBAAqB;QAAE,OAAO,KAAK,CAAC;IAC9E,OAAO,CACL,0BAA0B,CACxB,KAAK,CAAC,qBAAqB,EAC3B,KAAK,CAAC,+BAA+B,EACrC,KAAK,CAAC,eAAe,CACtB;QACD,0BAA0B,CACxB,OAAO,CAAC,qBAAqB,EAC7B,OAAO,CAAC,+B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
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const DEFAULT_SCORING_CONSTANTS = {
|
|
2
|
+
thresholds: {
|
|
3
|
+
maxParamsGood: 5,
|
|
4
|
+
maxDepthGood: 4,
|
|
5
|
+
maxPolymorphismGood: 2,
|
|
6
|
+
maxDependencyDepthGood: 3,
|
|
7
|
+
maxAmbiguousGood: 0,
|
|
8
|
+
maxOperationsForDiscoverability: 1000,
|
|
9
|
+
},
|
|
10
|
+
weights: {
|
|
11
|
+
parameterSimplicity: 0.1,
|
|
12
|
+
schemaSimplicity: 0.1,
|
|
13
|
+
documentationQuality: 0.18,
|
|
14
|
+
constraintClarity: 0.12,
|
|
15
|
+
exampleCoverage: 0.18,
|
|
16
|
+
errorClarity: 0.12,
|
|
17
|
+
dependencyClarity: 0.1,
|
|
18
|
+
identifierClarity: 0.05,
|
|
19
|
+
polymorphismClarity: 0.05,
|
|
20
|
+
anyOfPenaltyMultiplier: 2.0,
|
|
21
|
+
discoverabilityWeight: 0.1,
|
|
22
|
+
},
|
|
23
|
+
hotspotLimit: 10,
|
|
24
|
+
};
|
|
25
|
+
export const AMBIGUOUS_PARAM_NAMES = new Set([
|
|
26
|
+
'id',
|
|
27
|
+
'name',
|
|
28
|
+
'type',
|
|
29
|
+
'value',
|
|
30
|
+
'data',
|
|
31
|
+
'key',
|
|
32
|
+
'status',
|
|
33
|
+
'state',
|
|
34
|
+
'code',
|
|
35
|
+
'result',
|
|
36
|
+
'item',
|
|
37
|
+
'object',
|
|
38
|
+
'resource',
|
|
39
|
+
'entity',
|
|
40
|
+
'input',
|
|
41
|
+
'output',
|
|
42
|
+
'payload',
|
|
43
|
+
'body',
|
|
44
|
+
'content',
|
|
45
|
+
'info',
|
|
46
|
+
]);
|
|
47
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/commands/score/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,yBAAyB,GAAqB;IACzD,UAAU,EAAE;QACV,aAAa,EAAE,CAAC;QAChB,YAAY,EAAE,CAAC;QACf,mBAAmB,EAAE,CAAC;QACtB,sBAAsB,EAAE,CAAC;QACzB,gBAAgB,EAAE,CAAC;QACnB,+BAA+B,EAAE,IAAI;KACtC;IACD,OAAO,EAAE;QACP,mBAAmB,EAAE,GAAG;QACxB,gBAAgB,EAAE,GAAG;QACrB,oBAAoB,EAAE,IAAI;QAC1B,iBAAiB,EAAE,IAAI;QACvB,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,IAAI;QAClB,iBAAiB,EAAE,GAAG;QACtB,iBAAiB,EAAE,IAAI;QACvB,mBAAmB,EAAE,IAAI;QACzB,sBAAsB,EAAE,GAAG;QAC3B,qBAAqB,EAAE,GAAG;KAC3B;IACD,YAAY,EAAE,EAAE;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IAC3C,IAAI;IACJ,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,QAAQ;IACR,OAAO;IACP,MAAM;IACN,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,SAAS;IACT,MAAM;IACN,SAAS;IACT,MAAM;CACP,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/commands/score/formatters/json.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAoBxD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { logger } from '@redocly/openapi-core';
|
|
2
|
+
export function printScoreJson(result) {
|
|
3
|
+
const output = {
|
|
4
|
+
agentReadiness: result.agentReadiness,
|
|
5
|
+
discoverability: Math.round(result.discoverability * 100),
|
|
6
|
+
subscores: result.subscores,
|
|
7
|
+
rawMetrics: {
|
|
8
|
+
operationCount: result.rawMetrics.operationCount,
|
|
9
|
+
operations: Object.fromEntries(Array.from(result.rawMetrics.operations.entries()).map(([key, m]) => {
|
|
10
|
+
const { refsUsed: _, ...rest } = m;
|
|
11
|
+
return [key, rest];
|
|
12
|
+
})),
|
|
13
|
+
},
|
|
14
|
+
operationScores: Object.fromEntries(result.operationScores),
|
|
15
|
+
dependencyDepths: Object.fromEntries(result.dependencyDepths),
|
|
16
|
+
hotspots: result.hotspots,
|
|
17
|
+
};
|
|
18
|
+
logger.output(JSON.stringify(output, null, 2));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/commands/score/formatters/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI/C,MAAM,UAAU,cAAc,CAAC,MAAmB;IAChD,MAAM,MAAM,GAAG;QACb,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,GAAG,GAAG,CAAC;QACzD,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,UAAU,EAAE;YACV,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,cAAc;YAChD,UAAU,EAAE,MAAM,CAAC,WAAW,CAC5B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;gBAClE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,CAAC;gBACnC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YACrB,CAAC,CAAC,CACH;SACF;QACD,eAAe,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,eAAe,CAAC;QAC3D,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,gBAAgB,CAAC;QAC7D,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B,CAAC;IAEF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DebugMediaTypeLog, ScoreResult } from '../types.js';
|
|
2
|
+
export declare function printScoreStylish(result: ScoreResult, operationDetails?: boolean): void;
|
|
3
|
+
export declare function printDebugOperation(operationId: string, logs: DebugMediaTypeLog[]): void;
|
|
4
|
+
//# sourceMappingURL=stylish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stylish.d.ts","sourceRoot":"","sources":["../../../../src/commands/score/formatters/stylish.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGlE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,gBAAgB,UAAQ,GAAG,IAAI,CAMrF;AAqJD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,IAAI,CA0FxF"}
|