configforge 1.0.0-beta.1 → 1.0.0-beta.10
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/README.md +574 -11
- package/dist/core/ConversionResult.d.ts +22 -0
- package/dist/core/ConversionResult.d.ts.map +1 -1
- package/dist/core/ConversionResult.js +44 -30
- package/dist/core/ConversionResult.js.map +1 -1
- package/dist/core/Converter.d.ts +40 -10
- package/dist/core/Converter.d.ts.map +1 -1
- package/dist/core/Converter.js +137 -29
- package/dist/core/Converter.js.map +1 -1
- package/dist/core/Mapper.d.ts +12 -0
- package/dist/core/Mapper.d.ts.map +1 -1
- package/dist/core/Mapper.js +155 -3
- package/dist/core/Mapper.js.map +1 -1
- package/dist/core/Pipeline.d.ts +42 -0
- package/dist/core/Pipeline.d.ts.map +1 -0
- package/dist/core/Pipeline.js +134 -0
- package/dist/core/Pipeline.js.map +1 -0
- package/dist/core/pipeline/PipelineBuilder.d.ts +67 -0
- package/dist/core/pipeline/PipelineBuilder.d.ts.map +1 -0
- package/dist/core/pipeline/PipelineBuilder.js +109 -0
- package/dist/core/pipeline/PipelineBuilder.js.map +1 -0
- package/dist/core/pipeline/PipelineSteps.d.ts +74 -0
- package/dist/core/pipeline/PipelineSteps.d.ts.map +1 -0
- package/dist/core/pipeline/PipelineSteps.js +298 -0
- package/dist/core/pipeline/PipelineSteps.js.map +1 -0
- package/dist/errors/ErrorCollector.d.ts +119 -0
- package/dist/errors/ErrorCollector.d.ts.map +1 -0
- package/dist/errors/ErrorCollector.js +197 -0
- package/dist/errors/ErrorCollector.js.map +1 -0
- package/dist/errors/ErrorContext.d.ts +168 -0
- package/dist/errors/ErrorContext.d.ts.map +1 -0
- package/dist/errors/ErrorContext.js +356 -0
- package/dist/errors/ErrorContext.js.map +1 -0
- package/dist/errors/ErrorRecovery.d.ts +91 -0
- package/dist/errors/ErrorRecovery.d.ts.map +1 -0
- package/dist/errors/ErrorRecovery.js +321 -0
- package/dist/errors/ErrorRecovery.js.map +1 -0
- package/dist/errors/ErrorReporter.d.ts +58 -0
- package/dist/errors/ErrorReporter.d.ts.map +1 -0
- package/dist/errors/ErrorReporter.js +262 -0
- package/dist/errors/ErrorReporter.js.map +1 -0
- package/dist/errors/ErrorTypes.d.ts +103 -0
- package/dist/errors/ErrorTypes.d.ts.map +1 -0
- package/dist/errors/ErrorTypes.js +125 -0
- package/dist/errors/ErrorTypes.js.map +1 -0
- package/dist/errors/SpecificErrors.d.ts +45 -0
- package/dist/errors/SpecificErrors.d.ts.map +1 -0
- package/dist/errors/SpecificErrors.js +124 -0
- package/dist/errors/SpecificErrors.js.map +1 -0
- package/dist/errors/SuggestionEngine.d.ts +63 -0
- package/dist/errors/SuggestionEngine.d.ts.map +1 -0
- package/dist/errors/SuggestionEngine.js +328 -0
- package/dist/errors/SuggestionEngine.js.map +1 -0
- package/dist/errors/index.d.ts +12 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +39 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +8 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/validators/ValidatorRegistry.d.ts +55 -0
- package/dist/validators/ValidatorRegistry.d.ts.map +1 -0
- package/dist/validators/ValidatorRegistry.js +140 -0
- package/dist/validators/ValidatorRegistry.js.map +1 -0
- package/dist/validators/built-in.d.ts +93 -0
- package/dist/validators/built-in.d.ts.map +1 -0
- package/dist/validators/built-in.js +290 -0
- package/dist/validators/built-in.js.map +1 -0
- package/dist/validators/index.d.ts +4 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/validators/index.js +24 -0
- package/dist/validators/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorRecoveryManager = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const ErrorTypes_1 = require("./ErrorTypes");
|
|
6
|
+
/**
|
|
7
|
+
* Error recovery manager
|
|
8
|
+
*/
|
|
9
|
+
class ErrorRecoveryManager {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.strategies = [];
|
|
12
|
+
this.recoveryHistory = [];
|
|
13
|
+
this.registerDefaultStrategies();
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Register a recovery strategy
|
|
17
|
+
*/
|
|
18
|
+
registerStrategy(strategy) {
|
|
19
|
+
this.strategies.push(strategy);
|
|
20
|
+
this.strategies.sort((a, b) => b.priority - a.priority);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Attempt to recover from an error
|
|
24
|
+
*/
|
|
25
|
+
async attemptRecovery(error, context) {
|
|
26
|
+
const strategy = this.findBestStrategy(error);
|
|
27
|
+
if (!strategy) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const startTime = Date.now();
|
|
31
|
+
try {
|
|
32
|
+
const result = await strategy.recover(error, context);
|
|
33
|
+
const duration = Date.now() - startTime;
|
|
34
|
+
const attempt = {
|
|
35
|
+
strategy: strategy.name,
|
|
36
|
+
error,
|
|
37
|
+
result,
|
|
38
|
+
timestamp: new Date(),
|
|
39
|
+
duration,
|
|
40
|
+
};
|
|
41
|
+
this.recoveryHistory.push(attempt);
|
|
42
|
+
return attempt;
|
|
43
|
+
}
|
|
44
|
+
catch (recoveryError) {
|
|
45
|
+
const duration = Date.now() - startTime;
|
|
46
|
+
const attempt = {
|
|
47
|
+
strategy: strategy.name,
|
|
48
|
+
error,
|
|
49
|
+
result: {
|
|
50
|
+
success: false,
|
|
51
|
+
message: `Recovery strategy failed: ${recoveryError instanceof Error ? recoveryError.message : 'Unknown error'}`,
|
|
52
|
+
},
|
|
53
|
+
timestamp: new Date(),
|
|
54
|
+
duration,
|
|
55
|
+
};
|
|
56
|
+
this.recoveryHistory.push(attempt);
|
|
57
|
+
return attempt;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Attempt to recover from multiple errors
|
|
62
|
+
*/
|
|
63
|
+
async attemptBatchRecovery(errors, context) {
|
|
64
|
+
const attempts = [];
|
|
65
|
+
for (const error of errors) {
|
|
66
|
+
const attempt = await this.attemptRecovery(error, context);
|
|
67
|
+
if (attempt) {
|
|
68
|
+
attempts.push(attempt);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return attempts;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Get recovery suggestions for an error
|
|
75
|
+
*/
|
|
76
|
+
getRecoverySuggestions(error) {
|
|
77
|
+
const suggestions = [];
|
|
78
|
+
// Check if error already has suggestions
|
|
79
|
+
if (error instanceof ErrorTypes_1.RecoverableError) {
|
|
80
|
+
suggestions.push(...error.suggestions);
|
|
81
|
+
}
|
|
82
|
+
// Generate suggestions based on error type
|
|
83
|
+
suggestions.push(...this.generateSuggestionsForError(error));
|
|
84
|
+
return suggestions;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get recovery history
|
|
88
|
+
*/
|
|
89
|
+
getRecoveryHistory() {
|
|
90
|
+
return [...this.recoveryHistory];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Clear recovery history
|
|
94
|
+
*/
|
|
95
|
+
clearHistory() {
|
|
96
|
+
this.recoveryHistory = [];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get recovery statistics
|
|
100
|
+
*/
|
|
101
|
+
getRecoveryStats() {
|
|
102
|
+
const totalAttempts = this.recoveryHistory.length;
|
|
103
|
+
const successfulRecoveries = this.recoveryHistory.filter(a => a.result.success).length;
|
|
104
|
+
const failedRecoveries = totalAttempts - successfulRecoveries;
|
|
105
|
+
const averageDuration = totalAttempts > 0
|
|
106
|
+
? this.recoveryHistory.reduce((sum, a) => sum + a.duration, 0) /
|
|
107
|
+
totalAttempts
|
|
108
|
+
: 0;
|
|
109
|
+
const strategiesUsed = {};
|
|
110
|
+
this.recoveryHistory.forEach(attempt => {
|
|
111
|
+
strategiesUsed[attempt.strategy] =
|
|
112
|
+
(strategiesUsed[attempt.strategy] || 0) + 1;
|
|
113
|
+
});
|
|
114
|
+
return {
|
|
115
|
+
totalAttempts,
|
|
116
|
+
successfulRecoveries,
|
|
117
|
+
failedRecoveries,
|
|
118
|
+
averageDuration,
|
|
119
|
+
strategiesUsed,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
findBestStrategy(error) {
|
|
123
|
+
return this.strategies.find(strategy => strategy.canRecover(error)) || null;
|
|
124
|
+
}
|
|
125
|
+
generateSuggestionsForError(error) {
|
|
126
|
+
const suggestions = [];
|
|
127
|
+
switch (error.code) {
|
|
128
|
+
case 'PARSE_ERROR':
|
|
129
|
+
suggestions.push({
|
|
130
|
+
action: 'Check file format',
|
|
131
|
+
description: 'Verify that the input file is valid JSON or YAML',
|
|
132
|
+
automated: false,
|
|
133
|
+
});
|
|
134
|
+
suggestions.push({
|
|
135
|
+
action: 'Use fallback parser',
|
|
136
|
+
description: 'Try parsing with a more lenient parser',
|
|
137
|
+
automated: true,
|
|
138
|
+
});
|
|
139
|
+
break;
|
|
140
|
+
case 'MAPPING_ERROR':
|
|
141
|
+
suggestions.push({
|
|
142
|
+
action: 'Check field paths',
|
|
143
|
+
description: 'Verify that source and target field paths are correct',
|
|
144
|
+
automated: false,
|
|
145
|
+
});
|
|
146
|
+
suggestions.push({
|
|
147
|
+
action: 'Use default values',
|
|
148
|
+
description: 'Apply default values for missing fields',
|
|
149
|
+
automated: true,
|
|
150
|
+
});
|
|
151
|
+
break;
|
|
152
|
+
case 'VALIDATION_ERROR':
|
|
153
|
+
suggestions.push({
|
|
154
|
+
action: 'Review validation rules',
|
|
155
|
+
description: 'Check if validation rules are appropriate for the data',
|
|
156
|
+
automated: false,
|
|
157
|
+
});
|
|
158
|
+
suggestions.push({
|
|
159
|
+
action: 'Skip validation',
|
|
160
|
+
description: 'Continue processing without validation',
|
|
161
|
+
automated: true,
|
|
162
|
+
});
|
|
163
|
+
break;
|
|
164
|
+
case 'TYPE_CONVERSION_ERROR':
|
|
165
|
+
suggestions.push({
|
|
166
|
+
action: 'Add type conversion',
|
|
167
|
+
description: 'Use a transform function to convert the value to the expected type',
|
|
168
|
+
automated: false,
|
|
169
|
+
});
|
|
170
|
+
suggestions.push({
|
|
171
|
+
action: 'Use string representation',
|
|
172
|
+
description: 'Convert value to string as fallback',
|
|
173
|
+
automated: true,
|
|
174
|
+
});
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
return suggestions;
|
|
178
|
+
}
|
|
179
|
+
registerDefaultStrategies() {
|
|
180
|
+
// Parse error recovery
|
|
181
|
+
this.registerStrategy({
|
|
182
|
+
name: 'ParseErrorRecovery',
|
|
183
|
+
priority: 100,
|
|
184
|
+
canRecover: error => error instanceof types_1.ParseError,
|
|
185
|
+
recover: async (_error, context) => {
|
|
186
|
+
// Try to parse as plain text or use fallback structure
|
|
187
|
+
try {
|
|
188
|
+
const fallbackData = context.options?.fallbackValues || {};
|
|
189
|
+
return {
|
|
190
|
+
success: true,
|
|
191
|
+
recoveredData: fallbackData,
|
|
192
|
+
message: 'Used fallback data structure',
|
|
193
|
+
suggestions: [
|
|
194
|
+
{
|
|
195
|
+
action: 'Validate input format',
|
|
196
|
+
description: 'Ensure input is valid JSON or YAML',
|
|
197
|
+
automated: false,
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
return {
|
|
204
|
+
success: false,
|
|
205
|
+
message: 'Could not recover from parse error',
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
// Mapping error recovery
|
|
211
|
+
this.registerStrategy({
|
|
212
|
+
name: 'MappingErrorRecovery',
|
|
213
|
+
priority: 90,
|
|
214
|
+
canRecover: error => error instanceof types_1.MappingError,
|
|
215
|
+
recover: async (error, context) => {
|
|
216
|
+
if (context.options?.skipOnError) {
|
|
217
|
+
return {
|
|
218
|
+
success: true,
|
|
219
|
+
recoveredData: context.targetData || {},
|
|
220
|
+
message: 'Skipped failed mapping',
|
|
221
|
+
suggestions: [
|
|
222
|
+
{
|
|
223
|
+
action: 'Check field path',
|
|
224
|
+
description: `Verify the field path: ${error.path}`,
|
|
225
|
+
automated: false,
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
success: false,
|
|
232
|
+
message: 'Cannot recover from mapping error without skip option',
|
|
233
|
+
};
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
// Validation error recovery
|
|
237
|
+
this.registerStrategy({
|
|
238
|
+
name: 'ValidationErrorRecovery',
|
|
239
|
+
priority: 80,
|
|
240
|
+
canRecover: error => error instanceof types_1.ValidationError,
|
|
241
|
+
recover: async (error, context) => {
|
|
242
|
+
if (context.options?.skipOnError) {
|
|
243
|
+
return {
|
|
244
|
+
success: true,
|
|
245
|
+
recoveredData: context.targetData,
|
|
246
|
+
message: 'Continued processing despite validation error',
|
|
247
|
+
suggestions: [
|
|
248
|
+
{
|
|
249
|
+
action: 'Review validation rule',
|
|
250
|
+
description: `Check validation rule for field: ${error.path}`,
|
|
251
|
+
automated: false,
|
|
252
|
+
},
|
|
253
|
+
],
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
success: false,
|
|
258
|
+
message: 'Cannot recover from validation error without skip option',
|
|
259
|
+
};
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
// Type conversion error recovery
|
|
263
|
+
this.registerStrategy({
|
|
264
|
+
name: 'TypeConversionRecovery',
|
|
265
|
+
priority: 70,
|
|
266
|
+
canRecover: error => error instanceof ErrorTypes_1.TypeConversionError,
|
|
267
|
+
recover: async (error, _context) => {
|
|
268
|
+
try {
|
|
269
|
+
// Try to convert to string as fallback
|
|
270
|
+
const value = error.context?.value;
|
|
271
|
+
const stringValue = value != null ? String(value) : '';
|
|
272
|
+
return {
|
|
273
|
+
success: true,
|
|
274
|
+
recoveredData: stringValue,
|
|
275
|
+
message: 'Converted value to string as fallback',
|
|
276
|
+
suggestions: [
|
|
277
|
+
{
|
|
278
|
+
action: 'Add type conversion transform',
|
|
279
|
+
description: 'Use a transform function to properly convert the value type',
|
|
280
|
+
automated: false,
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
catch {
|
|
286
|
+
return {
|
|
287
|
+
success: false,
|
|
288
|
+
message: 'Could not convert value to string',
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
// Hook error recovery
|
|
294
|
+
this.registerStrategy({
|
|
295
|
+
name: 'HookErrorRecovery',
|
|
296
|
+
priority: 60,
|
|
297
|
+
canRecover: error => error instanceof ErrorTypes_1.HookError,
|
|
298
|
+
recover: async (error, context) => {
|
|
299
|
+
// Continue with original data if hook fails
|
|
300
|
+
const hookError = error;
|
|
301
|
+
const data = hookError.hookType === 'before'
|
|
302
|
+
? context.sourceData
|
|
303
|
+
: context.targetData;
|
|
304
|
+
return {
|
|
305
|
+
success: true,
|
|
306
|
+
recoveredData: data,
|
|
307
|
+
message: `Skipped failed ${hookError.hookType} hook: ${hookError.hookName}`,
|
|
308
|
+
suggestions: [
|
|
309
|
+
{
|
|
310
|
+
action: 'Debug hook function',
|
|
311
|
+
description: `Check the implementation of ${hookError.hookName} hook`,
|
|
312
|
+
automated: false,
|
|
313
|
+
},
|
|
314
|
+
],
|
|
315
|
+
};
|
|
316
|
+
},
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
exports.ErrorRecoveryManager = ErrorRecoveryManager;
|
|
321
|
+
//# sourceMappingURL=ErrorRecovery.js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+1,58 @@
|
|
|
1
|
+
import { ConfigForgeError, Warning } from '../types';
|
|
2
|
+
import { ErrorCollector } from './ErrorCollector';
|
|
3
|
+
/**
|
|
4
|
+
* Formats and reports errors and warnings in various formats
|
|
5
|
+
*/
|
|
6
|
+
export declare class ErrorReporter {
|
|
7
|
+
private collector;
|
|
8
|
+
constructor(collector: ErrorCollector);
|
|
9
|
+
/**
|
|
10
|
+
* Generate a detailed text report
|
|
11
|
+
*/
|
|
12
|
+
generateTextReport(options?: {
|
|
13
|
+
includeContext?: boolean;
|
|
14
|
+
includeSuggestions?: boolean;
|
|
15
|
+
maxContextLines?: number;
|
|
16
|
+
}): string;
|
|
17
|
+
/**
|
|
18
|
+
* Generate a JSON report
|
|
19
|
+
*/
|
|
20
|
+
generateJSONReport(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Generate a compact summary report
|
|
23
|
+
*/
|
|
24
|
+
generateSummaryReport(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Generate a colored console report (with ANSI colors)
|
|
27
|
+
*/
|
|
28
|
+
generateColoredReport(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Print report to console
|
|
31
|
+
*/
|
|
32
|
+
printToConsole(colored?: boolean): void;
|
|
33
|
+
/**
|
|
34
|
+
* Get errors grouped by type
|
|
35
|
+
*/
|
|
36
|
+
getErrorsByType(): Record<string, ConfigForgeError[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Get warnings grouped by type
|
|
39
|
+
*/
|
|
40
|
+
getWarningsByType(): Record<string, Warning[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Check if there are any blocking errors (non-warnings)
|
|
43
|
+
*/
|
|
44
|
+
hasBlockingErrors(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Get the most common error type
|
|
47
|
+
*/
|
|
48
|
+
getMostCommonErrorType(): string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Format context object for display
|
|
51
|
+
*/
|
|
52
|
+
private formatContext;
|
|
53
|
+
/**
|
|
54
|
+
* Export report to file (returns content, actual file writing should be done by caller)
|
|
55
|
+
*/
|
|
56
|
+
exportReport(format?: 'text' | 'json' | 'summary'): string;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=ErrorReporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorReporter.d.ts","sourceRoot":"","sources":["../../src/errors/ErrorReporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,SAAS,CAAiB;gBAEtB,SAAS,EAAE,cAAc;IAIrC;;OAEG;IACH,kBAAkB,CAChB,OAAO,GAAE;QACP,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;KACrB,GACL,MAAM;IA8FT;;OAEG;IACH,kBAAkB,IAAI,MAAM;IAI5B;;OAEG;IACH,qBAAqB,IAAI,MAAM;IA2B/B;;OAEG;IACH,qBAAqB,IAAI,MAAM;IAuF/B;;OAEG;IACH,cAAc,CAAC,OAAO,GAAE,OAAc,GAAG,IAAI;IAO7C;;OAEG;IACH,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAcrD;;OAEG;IACH,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;IAc9C;;OAEG;IACH,iBAAiB,IAAI,OAAO;IAI5B;;OAEG;IACH,sBAAsB,IAAI,MAAM,GAAG,IAAI;IAWvC;;OAEG;IACH,OAAO,CAAC,aAAa;IAmBrB;;OAEG;IACH,YAAY,CAAC,MAAM,GAAE,MAAM,GAAG,MAAM,GAAG,SAAkB,GAAG,MAAM;CAWnE"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorReporter = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Formats and reports errors and warnings in various formats
|
|
6
|
+
*/
|
|
7
|
+
class ErrorReporter {
|
|
8
|
+
constructor(collector) {
|
|
9
|
+
this.collector = collector;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Generate a detailed text report
|
|
13
|
+
*/
|
|
14
|
+
generateTextReport(options = {}) {
|
|
15
|
+
const { includeContext = true, includeSuggestions = true, maxContextLines = 5, } = options;
|
|
16
|
+
const lines = [];
|
|
17
|
+
const errors = this.collector.getErrors();
|
|
18
|
+
const warnings = this.collector.getWarnings();
|
|
19
|
+
// Header
|
|
20
|
+
lines.push('ConfigForge Conversion Report');
|
|
21
|
+
lines.push('='.repeat(50));
|
|
22
|
+
lines.push('');
|
|
23
|
+
// Summary
|
|
24
|
+
const summary = this.collector.getSummary();
|
|
25
|
+
lines.push(`Summary: ${summary.errorCount} errors, ${summary.warningCount} warnings`);
|
|
26
|
+
if (summary.criticalErrorCount > 0) {
|
|
27
|
+
lines.push(`Critical errors: ${summary.criticalErrorCount}`);
|
|
28
|
+
}
|
|
29
|
+
lines.push('');
|
|
30
|
+
// Errors section
|
|
31
|
+
if (errors.length > 0) {
|
|
32
|
+
lines.push('ERRORS:');
|
|
33
|
+
lines.push('-'.repeat(20));
|
|
34
|
+
errors.forEach((error, index) => {
|
|
35
|
+
lines.push(`${index + 1}. [${error.code}] ${error.message}`);
|
|
36
|
+
if (error.path) {
|
|
37
|
+
lines.push(` Path: ${error.path}`);
|
|
38
|
+
}
|
|
39
|
+
if (includeSuggestions && error.suggestion) {
|
|
40
|
+
lines.push(` Suggestion: ${error.suggestion}`);
|
|
41
|
+
}
|
|
42
|
+
if (includeContext && error.context) {
|
|
43
|
+
lines.push(` Context: ${this.formatContext(error.context, maxContextLines)}`);
|
|
44
|
+
}
|
|
45
|
+
lines.push('');
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// Warnings section
|
|
49
|
+
if (warnings.length > 0) {
|
|
50
|
+
lines.push('WARNINGS:');
|
|
51
|
+
lines.push('-'.repeat(20));
|
|
52
|
+
warnings.forEach((warning, index) => {
|
|
53
|
+
lines.push(`${index + 1}. [${warning.type.toUpperCase()}] ${warning.message}`);
|
|
54
|
+
lines.push(` Field: ${warning.field}`);
|
|
55
|
+
if (includeSuggestions && warning.suggestion) {
|
|
56
|
+
lines.push(` Suggestion: ${warning.suggestion}`);
|
|
57
|
+
}
|
|
58
|
+
lines.push('');
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
// Error breakdown
|
|
62
|
+
if (Object.keys(summary.errorsByCode).length > 0) {
|
|
63
|
+
lines.push('Error Breakdown:');
|
|
64
|
+
Object.entries(summary.errorsByCode).forEach(([code, count]) => {
|
|
65
|
+
lines.push(` ${code}: ${count}`);
|
|
66
|
+
});
|
|
67
|
+
lines.push('');
|
|
68
|
+
}
|
|
69
|
+
// Warning breakdown
|
|
70
|
+
if (Object.keys(summary.warningsByType).length > 0) {
|
|
71
|
+
lines.push('Warning Breakdown:');
|
|
72
|
+
Object.entries(summary.warningsByType).forEach(([type, count]) => {
|
|
73
|
+
lines.push(` ${type}: ${count}`);
|
|
74
|
+
});
|
|
75
|
+
lines.push('');
|
|
76
|
+
}
|
|
77
|
+
return lines.join('\n');
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Generate a JSON report
|
|
81
|
+
*/
|
|
82
|
+
generateJSONReport() {
|
|
83
|
+
return JSON.stringify(this.collector.toJSON(), null, 2);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Generate a compact summary report
|
|
87
|
+
*/
|
|
88
|
+
generateSummaryReport() {
|
|
89
|
+
const summary = this.collector.getSummary();
|
|
90
|
+
const lines = [];
|
|
91
|
+
if (summary.errorCount === 0 && summary.warningCount === 0) {
|
|
92
|
+
return '✅ No errors or warnings found.';
|
|
93
|
+
}
|
|
94
|
+
if (summary.errorCount > 0) {
|
|
95
|
+
lines.push(`❌ ${summary.errorCount} error${summary.errorCount > 1 ? 's' : ''}`);
|
|
96
|
+
if (summary.criticalErrorCount > 0) {
|
|
97
|
+
lines.push(` (${summary.criticalErrorCount} critical)`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (summary.warningCount > 0) {
|
|
101
|
+
lines.push(`⚠️ ${summary.warningCount} warning${summary.warningCount > 1 ? 's' : ''}`);
|
|
102
|
+
}
|
|
103
|
+
return lines.join('\n');
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Generate a colored console report (with ANSI colors)
|
|
107
|
+
*/
|
|
108
|
+
generateColoredReport() {
|
|
109
|
+
const errors = this.collector.getErrors();
|
|
110
|
+
const warnings = this.collector.getWarnings();
|
|
111
|
+
const lines = [];
|
|
112
|
+
// ANSI color codes
|
|
113
|
+
const colors = {
|
|
114
|
+
red: '\x1b[31m',
|
|
115
|
+
yellow: '\x1b[33m',
|
|
116
|
+
green: '\x1b[32m',
|
|
117
|
+
blue: '\x1b[34m',
|
|
118
|
+
gray: '\x1b[90m',
|
|
119
|
+
reset: '\x1b[0m',
|
|
120
|
+
bold: '\x1b[1m',
|
|
121
|
+
};
|
|
122
|
+
// Header
|
|
123
|
+
lines.push(`${colors.bold}ConfigForge Conversion Report${colors.reset}`);
|
|
124
|
+
lines.push('='.repeat(50));
|
|
125
|
+
lines.push('');
|
|
126
|
+
// Summary with colors
|
|
127
|
+
const summary = this.collector.getSummary();
|
|
128
|
+
if (summary.errorCount === 0 && summary.warningCount === 0) {
|
|
129
|
+
lines.push(`${colors.green}✅ No errors or warnings found.${colors.reset}`);
|
|
130
|
+
return lines.join('\n');
|
|
131
|
+
}
|
|
132
|
+
let summaryLine = 'Summary: ';
|
|
133
|
+
if (summary.errorCount > 0) {
|
|
134
|
+
summaryLine += `${colors.red}${summary.errorCount} error${summary.errorCount > 1 ? 's' : ''}${colors.reset}`;
|
|
135
|
+
}
|
|
136
|
+
if (summary.warningCount > 0) {
|
|
137
|
+
if (summary.errorCount > 0)
|
|
138
|
+
summaryLine += ', ';
|
|
139
|
+
summaryLine += `${colors.yellow}${summary.warningCount} warning${summary.warningCount > 1 ? 's' : ''}${colors.reset}`;
|
|
140
|
+
}
|
|
141
|
+
lines.push(summaryLine);
|
|
142
|
+
lines.push('');
|
|
143
|
+
// Errors with colors
|
|
144
|
+
if (errors.length > 0) {
|
|
145
|
+
lines.push(`${colors.red}${colors.bold}ERRORS:${colors.reset}`);
|
|
146
|
+
lines.push(`${colors.red}-`.repeat(20) + colors.reset);
|
|
147
|
+
errors.forEach((error, index) => {
|
|
148
|
+
lines.push(`${colors.red}${index + 1}. [${error.code}] ${error.message}${colors.reset}`);
|
|
149
|
+
if (error.path) {
|
|
150
|
+
lines.push(`${colors.gray} Path: ${error.path}${colors.reset}`);
|
|
151
|
+
}
|
|
152
|
+
if (error.suggestion) {
|
|
153
|
+
lines.push(`${colors.blue} 💡 ${error.suggestion}${colors.reset}`);
|
|
154
|
+
}
|
|
155
|
+
lines.push('');
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
// Warnings with colors
|
|
159
|
+
if (warnings.length > 0) {
|
|
160
|
+
lines.push(`${colors.yellow}${colors.bold}WARNINGS:${colors.reset}`);
|
|
161
|
+
lines.push(`${colors.yellow}-`.repeat(20) + colors.reset);
|
|
162
|
+
warnings.forEach((warning, index) => {
|
|
163
|
+
lines.push(`${colors.yellow}${index + 1}. [${warning.type.toUpperCase()}] ${warning.message}${colors.reset}`);
|
|
164
|
+
lines.push(`${colors.gray} Field: ${warning.field}${colors.reset}`);
|
|
165
|
+
if (warning.suggestion) {
|
|
166
|
+
lines.push(`${colors.blue} 💡 ${warning.suggestion}${colors.reset}`);
|
|
167
|
+
}
|
|
168
|
+
lines.push('');
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
return lines.join('\n');
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Print report to console
|
|
175
|
+
*/
|
|
176
|
+
printToConsole(colored = true) {
|
|
177
|
+
const report = colored
|
|
178
|
+
? this.generateColoredReport()
|
|
179
|
+
: this.generateTextReport();
|
|
180
|
+
console.log(report);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Get errors grouped by type
|
|
184
|
+
*/
|
|
185
|
+
getErrorsByType() {
|
|
186
|
+
const errors = this.collector.getErrors();
|
|
187
|
+
const grouped = {};
|
|
188
|
+
errors.forEach(error => {
|
|
189
|
+
if (!grouped[error.code]) {
|
|
190
|
+
grouped[error.code] = [];
|
|
191
|
+
}
|
|
192
|
+
grouped[error.code].push(error);
|
|
193
|
+
});
|
|
194
|
+
return grouped;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Get warnings grouped by type
|
|
198
|
+
*/
|
|
199
|
+
getWarningsByType() {
|
|
200
|
+
const warnings = this.collector.getWarnings();
|
|
201
|
+
const grouped = {};
|
|
202
|
+
warnings.forEach(warning => {
|
|
203
|
+
if (!grouped[warning.type]) {
|
|
204
|
+
grouped[warning.type] = [];
|
|
205
|
+
}
|
|
206
|
+
grouped[warning.type].push(warning);
|
|
207
|
+
});
|
|
208
|
+
return grouped;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Check if there are any blocking errors (non-warnings)
|
|
212
|
+
*/
|
|
213
|
+
hasBlockingErrors() {
|
|
214
|
+
return this.collector.hasCriticalErrors();
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Get the most common error type
|
|
218
|
+
*/
|
|
219
|
+
getMostCommonErrorType() {
|
|
220
|
+
const summary = this.collector.getSummary();
|
|
221
|
+
const errorsByCode = summary.errorsByCode;
|
|
222
|
+
if (Object.keys(errorsByCode).length === 0) {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
return Object.entries(errorsByCode).sort(([, a], [, b]) => b - a)[0][0];
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Format context object for display
|
|
229
|
+
*/
|
|
230
|
+
formatContext(context, maxLines = 5) {
|
|
231
|
+
if (!context || typeof context !== 'object') {
|
|
232
|
+
return String(context);
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
const formatted = JSON.stringify(context, null, 2);
|
|
236
|
+
const lines = formatted.split('\n');
|
|
237
|
+
if (lines.length <= maxLines) {
|
|
238
|
+
return formatted;
|
|
239
|
+
}
|
|
240
|
+
return lines.slice(0, maxLines).join('\n') + '\n ... (truncated)';
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
return '[Complex object - cannot display]';
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Export report to file (returns content, actual file writing should be done by caller)
|
|
248
|
+
*/
|
|
249
|
+
exportReport(format = 'text') {
|
|
250
|
+
switch (format) {
|
|
251
|
+
case 'json':
|
|
252
|
+
return this.generateJSONReport();
|
|
253
|
+
case 'summary':
|
|
254
|
+
return this.generateSummaryReport();
|
|
255
|
+
case 'text':
|
|
256
|
+
default:
|
|
257
|
+
return this.generateTextReport();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
exports.ErrorReporter = ErrorReporter;
|
|
262
|
+
//# sourceMappingURL=ErrorReporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorReporter.js","sourceRoot":"","sources":["../../src/errors/ErrorReporter.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAa,aAAa;IAGxB,YAAY,SAAyB;QACnC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,kBAAkB,CAChB,UAII,EAAE;QAEN,MAAM,EACJ,cAAc,GAAG,IAAI,EACrB,kBAAkB,GAAG,IAAI,EACzB,eAAe,GAAG,CAAC,GACpB,GAAG,OAAO,CAAC;QAEZ,MAAM,KAAK,GAAa,EAAE,CA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