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.
Files changed (77) hide show
  1. package/README.md +574 -11
  2. package/dist/core/ConversionResult.d.ts +22 -0
  3. package/dist/core/ConversionResult.d.ts.map +1 -1
  4. package/dist/core/ConversionResult.js +44 -30
  5. package/dist/core/ConversionResult.js.map +1 -1
  6. package/dist/core/Converter.d.ts +40 -10
  7. package/dist/core/Converter.d.ts.map +1 -1
  8. package/dist/core/Converter.js +137 -29
  9. package/dist/core/Converter.js.map +1 -1
  10. package/dist/core/Mapper.d.ts +12 -0
  11. package/dist/core/Mapper.d.ts.map +1 -1
  12. package/dist/core/Mapper.js +155 -3
  13. package/dist/core/Mapper.js.map +1 -1
  14. package/dist/core/Pipeline.d.ts +42 -0
  15. package/dist/core/Pipeline.d.ts.map +1 -0
  16. package/dist/core/Pipeline.js +134 -0
  17. package/dist/core/Pipeline.js.map +1 -0
  18. package/dist/core/pipeline/PipelineBuilder.d.ts +67 -0
  19. package/dist/core/pipeline/PipelineBuilder.d.ts.map +1 -0
  20. package/dist/core/pipeline/PipelineBuilder.js +109 -0
  21. package/dist/core/pipeline/PipelineBuilder.js.map +1 -0
  22. package/dist/core/pipeline/PipelineSteps.d.ts +74 -0
  23. package/dist/core/pipeline/PipelineSteps.d.ts.map +1 -0
  24. package/dist/core/pipeline/PipelineSteps.js +298 -0
  25. package/dist/core/pipeline/PipelineSteps.js.map +1 -0
  26. package/dist/errors/ErrorCollector.d.ts +119 -0
  27. package/dist/errors/ErrorCollector.d.ts.map +1 -0
  28. package/dist/errors/ErrorCollector.js +197 -0
  29. package/dist/errors/ErrorCollector.js.map +1 -0
  30. package/dist/errors/ErrorContext.d.ts +168 -0
  31. package/dist/errors/ErrorContext.d.ts.map +1 -0
  32. package/dist/errors/ErrorContext.js +356 -0
  33. package/dist/errors/ErrorContext.js.map +1 -0
  34. package/dist/errors/ErrorRecovery.d.ts +91 -0
  35. package/dist/errors/ErrorRecovery.d.ts.map +1 -0
  36. package/dist/errors/ErrorRecovery.js +321 -0
  37. package/dist/errors/ErrorRecovery.js.map +1 -0
  38. package/dist/errors/ErrorReporter.d.ts +58 -0
  39. package/dist/errors/ErrorReporter.d.ts.map +1 -0
  40. package/dist/errors/ErrorReporter.js +262 -0
  41. package/dist/errors/ErrorReporter.js.map +1 -0
  42. package/dist/errors/ErrorTypes.d.ts +103 -0
  43. package/dist/errors/ErrorTypes.d.ts.map +1 -0
  44. package/dist/errors/ErrorTypes.js +125 -0
  45. package/dist/errors/ErrorTypes.js.map +1 -0
  46. package/dist/errors/SpecificErrors.d.ts +45 -0
  47. package/dist/errors/SpecificErrors.d.ts.map +1 -0
  48. package/dist/errors/SpecificErrors.js +124 -0
  49. package/dist/errors/SpecificErrors.js.map +1 -0
  50. package/dist/errors/SuggestionEngine.d.ts +63 -0
  51. package/dist/errors/SuggestionEngine.d.ts.map +1 -0
  52. package/dist/errors/SuggestionEngine.js +328 -0
  53. package/dist/errors/SuggestionEngine.js.map +1 -0
  54. package/dist/errors/index.d.ts +12 -0
  55. package/dist/errors/index.d.ts.map +1 -0
  56. package/dist/errors/index.js +39 -0
  57. package/dist/errors/index.js.map +1 -0
  58. package/dist/index.d.ts +3 -0
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +7 -2
  61. package/dist/index.js.map +1 -1
  62. package/dist/types/index.d.ts +8 -1
  63. package/dist/types/index.d.ts.map +1 -1
  64. package/dist/types/index.js.map +1 -1
  65. package/dist/validators/ValidatorRegistry.d.ts +55 -0
  66. package/dist/validators/ValidatorRegistry.d.ts.map +1 -0
  67. package/dist/validators/ValidatorRegistry.js +140 -0
  68. package/dist/validators/ValidatorRegistry.js.map +1 -0
  69. package/dist/validators/built-in.d.ts +93 -0
  70. package/dist/validators/built-in.d.ts.map +1 -0
  71. package/dist/validators/built-in.js +290 -0
  72. package/dist/validators/built-in.js.map +1 -0
  73. package/dist/validators/index.d.ts +4 -0
  74. package/dist/validators/index.d.ts.map +1 -0
  75. package/dist/validators/index.js +24 -0
  76. package/dist/validators/index.js.map +1 -0
  77. package/package.json +1 -1
@@ -0,0 +1,103 @@
1
+ import { ConfigForgeError } from '../types';
2
+ /**
3
+ * File system related errors
4
+ */
5
+ export declare class FileSystemError extends ConfigForgeError {
6
+ readonly code = "FILE_SYSTEM_ERROR";
7
+ }
8
+ /**
9
+ * Network related errors for remote file access
10
+ */
11
+ export declare class NetworkError extends ConfigForgeError {
12
+ readonly code = "NETWORK_ERROR";
13
+ }
14
+ /**
15
+ * Type conversion errors
16
+ */
17
+ export declare class TypeConversionError extends ConfigForgeError {
18
+ readonly code = "TYPE_CONVERSION_ERROR";
19
+ }
20
+ /**
21
+ * Circular reference errors
22
+ */
23
+ export declare class CircularReferenceError extends ConfigForgeError {
24
+ readonly code = "CIRCULAR_REFERENCE_ERROR";
25
+ }
26
+ /**
27
+ * Memory limit errors
28
+ */
29
+ export declare class MemoryLimitError extends ConfigForgeError {
30
+ readonly code = "MEMORY_LIMIT_ERROR";
31
+ }
32
+ /**
33
+ * Hook execution errors
34
+ */
35
+ export declare class HookError extends ConfigForgeError {
36
+ readonly hookName: string;
37
+ readonly hookType: 'before' | 'after';
38
+ readonly code = "HOOK_ERROR";
39
+ constructor(message: string, hookName: string, hookType: 'before' | 'after', options?: {
40
+ path?: string;
41
+ context?: Record<string, any>;
42
+ });
43
+ }
44
+ /**
45
+ * Pipeline step errors
46
+ */
47
+ export declare class PipelineStepError extends ConfigForgeError {
48
+ readonly stepName: string;
49
+ readonly stepIndex: number;
50
+ readonly code = "PIPELINE_STEP_ERROR";
51
+ constructor(message: string, stepName: string, stepIndex: number, options?: {
52
+ path?: string;
53
+ context?: Record<string, any>;
54
+ });
55
+ }
56
+ /**
57
+ * Aggregated error for multiple errors
58
+ */
59
+ export declare class AggregateError extends ConfigForgeError {
60
+ readonly errors: ConfigForgeError[];
61
+ readonly code = "AGGREGATE_ERROR";
62
+ constructor(message: string, errors: ConfigForgeError[], options?: {
63
+ path?: string;
64
+ context?: Record<string, any>;
65
+ });
66
+ /**
67
+ * Get errors by code
68
+ */
69
+ getErrorsByCode(code: string): ConfigForgeError[];
70
+ /**
71
+ * Check if contains specific error type
72
+ */
73
+ hasErrorType(errorType: new (...args: any[]) => ConfigForgeError): boolean;
74
+ }
75
+ /**
76
+ * Recovery suggestion for errors
77
+ */
78
+ export interface ErrorRecoverySuggestion {
79
+ action: string;
80
+ description: string;
81
+ code?: string;
82
+ automated?: boolean;
83
+ }
84
+ /**
85
+ * Enhanced error with recovery suggestions
86
+ */
87
+ export declare class RecoverableError extends ConfigForgeError {
88
+ readonly suggestions: ErrorRecoverySuggestion[];
89
+ readonly code = "RECOVERABLE_ERROR";
90
+ constructor(message: string, suggestions: ErrorRecoverySuggestion[], options?: {
91
+ path?: string;
92
+ context?: Record<string, any>;
93
+ });
94
+ /**
95
+ * Get automated recovery suggestions
96
+ */
97
+ getAutomatedSuggestions(): ErrorRecoverySuggestion[];
98
+ /**
99
+ * Get manual recovery suggestions
100
+ */
101
+ getManualSuggestions(): ErrorRecoverySuggestion[];
102
+ }
103
+ //# sourceMappingURL=ErrorTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorTypes.d.ts","sourceRoot":"","sources":["../../src/errors/ErrorTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;GAEG;AACH,qBAAa,eAAgB,SAAQ,gBAAgB;IACnD,QAAQ,CAAC,IAAI,uBAAuB;CACrC;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,gBAAgB;IAChD,QAAQ,CAAC,IAAI,mBAAmB;CACjC;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,gBAAgB;IACvD,QAAQ,CAAC,IAAI,2BAA2B;CACzC;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,gBAAgB;IAC1D,QAAQ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AAY,CAAC,SAAS,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,gBAAgB,GAAG,OAAO;CAG3E;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,gBAAgB;aAKlC,WAAW,EAAE,uBAAuB,EAAE;IAJxD,QAAQ,CAAC,IAAI,uBAAuB;gBAGlC,OAAO,EAAE,MAAM,EACC,WAAW,EAAE,uBAAuB,EAAE,EACtD,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC/B;IAKH;;OAEG;IACH,uBAAuB,IAAI,uBAAuB,EAAE;IAIpD;;OAEG;IACH,oBAAoB,IAAI,uBAAuB,EAAE;CAGlD"}
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RecoverableError = exports.AggregateError = exports.PipelineStepError = exports.HookError = exports.MemoryLimitError = exports.CircularReferenceError = exports.TypeConversionError = exports.NetworkError = exports.FileSystemError = void 0;
4
+ const types_1 = require("../types");
5
+ /**
6
+ * File system related errors
7
+ */
8
+ class FileSystemError extends types_1.ConfigForgeError {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.code = 'FILE_SYSTEM_ERROR';
12
+ }
13
+ }
14
+ exports.FileSystemError = FileSystemError;
15
+ /**
16
+ * Network related errors for remote file access
17
+ */
18
+ class NetworkError extends types_1.ConfigForgeError {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.code = 'NETWORK_ERROR';
22
+ }
23
+ }
24
+ exports.NetworkError = NetworkError;
25
+ /**
26
+ * Type conversion errors
27
+ */
28
+ class TypeConversionError extends types_1.ConfigForgeError {
29
+ constructor() {
30
+ super(...arguments);
31
+ this.code = 'TYPE_CONVERSION_ERROR';
32
+ }
33
+ }
34
+ exports.TypeConversionError = TypeConversionError;
35
+ /**
36
+ * Circular reference errors
37
+ */
38
+ class CircularReferenceError extends types_1.ConfigForgeError {
39
+ constructor() {
40
+ super(...arguments);
41
+ this.code = 'CIRCULAR_REFERENCE_ERROR';
42
+ }
43
+ }
44
+ exports.CircularReferenceError = CircularReferenceError;
45
+ /**
46
+ * Memory limit errors
47
+ */
48
+ class MemoryLimitError extends types_1.ConfigForgeError {
49
+ constructor() {
50
+ super(...arguments);
51
+ this.code = 'MEMORY_LIMIT_ERROR';
52
+ }
53
+ }
54
+ exports.MemoryLimitError = MemoryLimitError;
55
+ /**
56
+ * Hook execution errors
57
+ */
58
+ class HookError extends types_1.ConfigForgeError {
59
+ constructor(message, hookName, hookType, options) {
60
+ super(message, options);
61
+ this.hookName = hookName;
62
+ this.hookType = hookType;
63
+ this.code = 'HOOK_ERROR';
64
+ }
65
+ }
66
+ exports.HookError = HookError;
67
+ /**
68
+ * Pipeline step errors
69
+ */
70
+ class PipelineStepError extends types_1.ConfigForgeError {
71
+ constructor(message, stepName, stepIndex, options) {
72
+ super(message, options);
73
+ this.stepName = stepName;
74
+ this.stepIndex = stepIndex;
75
+ this.code = 'PIPELINE_STEP_ERROR';
76
+ }
77
+ }
78
+ exports.PipelineStepError = PipelineStepError;
79
+ /**
80
+ * Aggregated error for multiple errors
81
+ */
82
+ class AggregateError extends types_1.ConfigForgeError {
83
+ constructor(message, errors, options) {
84
+ super(message, options);
85
+ this.errors = errors;
86
+ this.code = 'AGGREGATE_ERROR';
87
+ }
88
+ /**
89
+ * Get errors by code
90
+ */
91
+ getErrorsByCode(code) {
92
+ return this.errors.filter(error => error.code === code);
93
+ }
94
+ /**
95
+ * Check if contains specific error type
96
+ */
97
+ hasErrorType(errorType) {
98
+ return this.errors.some(error => error instanceof errorType);
99
+ }
100
+ }
101
+ exports.AggregateError = AggregateError;
102
+ /**
103
+ * Enhanced error with recovery suggestions
104
+ */
105
+ class RecoverableError extends types_1.ConfigForgeError {
106
+ constructor(message, suggestions, options) {
107
+ super(message, options);
108
+ this.suggestions = suggestions;
109
+ this.code = 'RECOVERABLE_ERROR';
110
+ }
111
+ /**
112
+ * Get automated recovery suggestions
113
+ */
114
+ getAutomatedSuggestions() {
115
+ return this.suggestions.filter(s => s.automated);
116
+ }
117
+ /**
118
+ * Get manual recovery suggestions
119
+ */
120
+ getManualSuggestions() {
121
+ return this.suggestions.filter(s => !s.automated);
122
+ }
123
+ }
124
+ exports.RecoverableError = RecoverableError;
125
+ //# sourceMappingURL=ErrorTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorTypes.js","sourceRoot":"","sources":["../../src/errors/ErrorTypes.ts"],"names":[],"mappings":";;;AAAA,oCAA4C;AAE5C;;GAEG;AACH,MAAa,eAAgB,SAAQ,wBAAgB;IAArD;;QACW,SAAI,GAAG,mBAAmB,CAAC;IACtC,CAAC;CAAA;AAFD,0CAEC;AAED;;GAEG;AACH,MAAa,YAAa,SAAQ,wBAAgB;IAAlD;;QACW,SAAI,GAAG,eAAe,CAAC;IAClC,CAAC;CAAA;AAFD,oCAEC;AAED;;GAEG;AACH,MAAa,mBAAoB,SAAQ,wBAAgB;IAAzD;;QACW,SAAI,GAAG,uBAAuB,CAAC;IAC1C,CAAC;CAAA;AAFD,kDAEC;AAED;;GAEG;AACH,MAAa,sBAAuB,SAAQ,wBAAgB;IAA5D;;QACW,SAAI,GAAG,0BAA0B,CAAC;IAC7C,CAAC;CAAA;AAFD,wDAEC;AAED;;GAEG;AACH,MAAa,gBAAiB,SAAQ,wBAAgB;IAAtD;;QACW,SAAI,GAAG,oBAAoB,CAAC;IACvC,CAAC;CAAA;AAFD,4CAEC;AAED;;GAEG;AACH,MAAa,SAAU,SAAQ,wBAAgB;IAG7C,YACE,OAAe,EACC,QAAgB,EAChB,QAA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AAC;IAED;;OAEG;IACH,uBAAuB;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,oBAAoB;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF;AA3BD,4CA2BC"}
@@ -0,0 +1,45 @@
1
+ import { ConfigForgeError } from '../types';
2
+ /**
3
+ * Specific error types for different ConfigForge scenarios
4
+ */
5
+ export declare class SchemaError extends ConfigForgeError {
6
+ code: string;
7
+ constructor(message: string, schemaName?: string);
8
+ }
9
+ export declare class PathError extends ConfigForgeError {
10
+ code: string;
11
+ constructor(message: string, path: string, availablePaths?: string[]);
12
+ }
13
+ export declare class ConversionError extends ConfigForgeError {
14
+ code: string;
15
+ constructor(message: string, fromType: string, toType: string, value?: any);
16
+ }
17
+ export declare class FileError extends ConfigForgeError {
18
+ code: string;
19
+ constructor(message: string, filePath: string, operation: 'read' | 'write' | 'parse');
20
+ }
21
+ export declare class ConfigurationError extends ConfigForgeError {
22
+ code: string;
23
+ constructor(message: string, configKey?: string, validValues?: string[]);
24
+ }
25
+ export declare class DependencyError extends ConfigForgeError {
26
+ code: string;
27
+ constructor(message: string, dependency: string, requiredBy?: string);
28
+ }
29
+ export declare class TimeoutError extends ConfigForgeError {
30
+ code: string;
31
+ constructor(message: string, operation: string, timeoutMs: number);
32
+ }
33
+ export declare class ConcurrencyError extends ConfigForgeError {
34
+ code: string;
35
+ constructor(message: string, operation: string, maxConcurrency?: number);
36
+ }
37
+ export declare class SecurityError extends ConfigForgeError {
38
+ code: string;
39
+ constructor(message: string, securityCheck: string, limit?: number);
40
+ }
41
+ export declare class CompatibilityError extends ConfigForgeError {
42
+ code: string;
43
+ constructor(message: string, feature: string, requiredVersion?: string);
44
+ }
45
+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iB,SAAQ,gBAAgB;IACpD,IAAI,SAAuB;gBAEf,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM;CAQxE;AAED,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,IAAI,SAAoB;gBAEZ,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;CAQnE;AAED,qBAAa,kBAAmB,SAAQ,gBAAgB;IACtD,IAAI,SAAyB;gBAEjB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM;CAQvE"}
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompatibilityError = exports.SecurityError = exports.ConcurrencyError = exports.TimeoutError = exports.DependencyError = exports.ConfigurationError = exports.FileError = exports.ConversionError = exports.PathError = exports.SchemaError = void 0;
4
+ const types_1 = require("../types");
5
+ /**
6
+ * Specific error types for different ConfigForge scenarios
7
+ */
8
+ class SchemaError extends types_1.ConfigForgeError {
9
+ constructor(message, schemaName) {
10
+ super(message, {
11
+ context: { schemaName },
12
+ suggestion: 'Check schema definition and ensure all required fields are present',
13
+ });
14
+ this.code = 'SCHEMA_ERROR';
15
+ }
16
+ }
17
+ exports.SchemaError = SchemaError;
18
+ class PathError extends types_1.ConfigForgeError {
19
+ constructor(message, path, availablePaths) {
20
+ super(message, {
21
+ path,
22
+ context: { availablePaths },
23
+ suggestion: availablePaths?.length
24
+ ? `Available paths: ${availablePaths.slice(0, 5).join(', ')}${availablePaths.length > 5 ? '...' : ''}`
25
+ : 'Check the path syntax and ensure the field exists in the source data',
26
+ });
27
+ this.code = 'PATH_ERROR';
28
+ }
29
+ }
30
+ exports.PathError = PathError;
31
+ class ConversionError extends types_1.ConfigForgeError {
32
+ constructor(message, fromType, toType, value) {
33
+ super(message, {
34
+ context: { fromType, toType, value },
35
+ suggestion: `Cannot convert ${fromType} to ${toType}. Consider using a transform function.`,
36
+ });
37
+ this.code = 'CONVERSION_ERROR';
38
+ }
39
+ }
40
+ exports.ConversionError = ConversionError;
41
+ class FileError extends types_1.ConfigForgeError {
42
+ constructor(message, filePath, operation) {
43
+ super(message, {
44
+ path: filePath,
45
+ context: { operation },
46
+ suggestion: operation === 'read'
47
+ ? 'Check if the file exists and you have read permissions'
48
+ : operation === 'write'
49
+ ? 'Check if the directory exists and you have write permissions'
50
+ : 'Check if the file format is supported and the content is valid',
51
+ });
52
+ this.code = 'FILE_ERROR';
53
+ }
54
+ }
55
+ exports.FileError = FileError;
56
+ class ConfigurationError extends types_1.ConfigForgeError {
57
+ constructor(message, configKey, validValues) {
58
+ super(message, {
59
+ context: { configKey, validValues },
60
+ suggestion: validValues?.length
61
+ ? `Valid values for ${configKey}: ${validValues.join(', ')}`
62
+ : 'Check the configuration documentation for valid options',
63
+ });
64
+ this.code = 'CONFIGURATION_ERROR';
65
+ }
66
+ }
67
+ exports.ConfigurationError = ConfigurationError;
68
+ class DependencyError extends types_1.ConfigForgeError {
69
+ constructor(message, dependency, requiredBy) {
70
+ super(message, {
71
+ context: { dependency, requiredBy },
72
+ suggestion: `Install the required dependency: npm install ${dependency}`,
73
+ });
74
+ this.code = 'DEPENDENCY_ERROR';
75
+ }
76
+ }
77
+ exports.DependencyError = DependencyError;
78
+ class TimeoutError extends types_1.ConfigForgeError {
79
+ constructor(message, operation, timeoutMs) {
80
+ super(message, {
81
+ context: { operation, timeoutMs },
82
+ suggestion: `Operation '${operation}' timed out after ${timeoutMs}ms. Consider increasing the timeout or simplifying the operation.`,
83
+ });
84
+ this.code = 'TIMEOUT_ERROR';
85
+ }
86
+ }
87
+ exports.TimeoutError = TimeoutError;
88
+ class ConcurrencyError extends types_1.ConfigForgeError {
89
+ constructor(message, operation, maxConcurrency) {
90
+ super(message, {
91
+ context: { operation, maxConcurrency },
92
+ suggestion: maxConcurrency
93
+ ? `Reduce concurrency level (current max: ${maxConcurrency}) or process items sequentially`
94
+ : 'Consider processing items sequentially to avoid concurrency issues',
95
+ });
96
+ this.code = 'CONCURRENCY_ERROR';
97
+ }
98
+ }
99
+ exports.ConcurrencyError = ConcurrencyError;
100
+ class SecurityError extends types_1.ConfigForgeError {
101
+ constructor(message, securityCheck, limit) {
102
+ super(message, {
103
+ context: { securityCheck, limit },
104
+ suggestion: limit
105
+ ? `Security limit exceeded: ${securityCheck} (limit: ${limit}). Reduce the input size or adjust security settings.`
106
+ : `Security check failed: ${securityCheck}. Review the input data for potential security issues.`,
107
+ });
108
+ this.code = 'SECURITY_ERROR';
109
+ }
110
+ }
111
+ exports.SecurityError = SecurityError;
112
+ class CompatibilityError extends types_1.ConfigForgeError {
113
+ constructor(message, feature, requiredVersion) {
114
+ super(message, {
115
+ context: { feature, requiredVersion },
116
+ suggestion: requiredVersion
117
+ ? `Feature '${feature}' requires version ${requiredVersion} or higher`
118
+ : `Feature '${feature}' is not compatible with the current configuration`,
119
+ });
120
+ this.code = 'COMPATIBILITY_ERROR';
121
+ }
122
+ }
123
+ exports.CompatibilityError = CompatibilityError;
124
+ //# sourceMappingURL=SpecificErrors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpecificErrors.js","sourceRoot":"","sources":["../../src/errors/SpecificErrors.ts"],"names":[],"mappings":";;;AAAA,oCAA4C;AAE5C;;GAEG;AAEH,MAAa,WAAY,SAAQ,wBAAgB;IAG/C,YAAY,OAAe,EAAE,UAAmB;QAC9C,KAAK,CAAC,OAAO,EAAE;YACb,OAAO,EAAE,EAAE,UAAU,EAAE;YACvB,UAAU,EACR,oEAAoE;SACvE,CAAC,CAAC;QAPL,SAAI,GAAG,cAAc,CAAC;IAQtB,CAAC;CACF;AAVD,kCAUC;AAED,MAAa,SAAU,SAAQ,wBAAgB;IAG7C,YAAY,OAAe,EAAE,IAAY,EAAE,cAAyB;QAClE,KAAK,CAAC,OAAO,EAAE;YACb,IAAI;YACJ,OAAO,EAAE,EAAE,cAAc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EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;YACjC,UAAU,EAAE,KAAK;gBACf,CAAC,CAAC,4BAA4B,aAAa,YAAY,KAAK,uDAAuD;gBACnH,CAAC,CAAC,0BAA0B,aAAa,wDAAwD;SACpG,CAAC,CAAC;QARL,SAAI,GAAG,gBAAgB,CAAC;IASxB,CAAC;CACF;AAXD,sCAWC;AAED,MAAa,kBAAmB,SAAQ,wBAAgB;IAGtD,YAAY,OAAe,EAAE,OAAe,EAAE,eAAwB;QACpE,KAAK,CAAC,OAAO,EAAE;YACb,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;YACrC,UAAU,EAAE,eAAe;gBACzB,CAAC,CAAC,YAAY,OAAO,sBAAsB,eAAe,YAAY;gBACtE,CAAC,CAAC,YAAY,OAAO,oDAAoD;SAC5E,CAAC,CAAC;QARL,SAAI,GAAG,qBAAqB,CAAC;IAS7B,CAAC;CACF;AAXD,gDAWC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Suggestion engine for providing helpful error messages and corrections
3
+ */
4
+ export declare class SuggestionEngine {
5
+ private static readonly SIMILARITY_THRESHOLD;
6
+ private static readonly MAX_SUGGESTIONS;
7
+ /**
8
+ * Calculate Levenshtein distance between two strings
9
+ */
10
+ private static levenshteinDistance;
11
+ /**
12
+ * Calculate similarity score between two strings (0-1, where 1 is identical)
13
+ */
14
+ private static calculateSimilarity;
15
+ /**
16
+ * Find similar strings from a list of candidates
17
+ */
18
+ static findSimilar(target: string, candidates: string[], threshold?: number): Array<{
19
+ value: string;
20
+ similarity: number;
21
+ }>;
22
+ /**
23
+ * Suggest field names for mapping errors
24
+ */
25
+ static suggestFieldNames(invalidField: string, availableFields: string[]): string[];
26
+ /**
27
+ * Suggest property paths for nested object access
28
+ */
29
+ static suggestPropertyPaths(invalidPath: string, availablePaths: string[]): string[];
30
+ /**
31
+ * Suggest configuration values
32
+ */
33
+ static suggestConfigValues(invalidValue: string, validValues: string[]): string[];
34
+ /**
35
+ * Generate helpful error message for missing fields
36
+ */
37
+ static generateMissingFieldMessage(missingField: string, availableFields: string[]): string;
38
+ /**
39
+ * Generate helpful error message for invalid paths
40
+ */
41
+ static generateInvalidPathMessage(invalidPath: string, availablePaths: string[]): string;
42
+ /**
43
+ * Generate helpful error message for invalid configuration
44
+ */
45
+ static generateInvalidConfigMessage(configKey: string, invalidValue: string, validValues: string[]): string;
46
+ /**
47
+ * Generate suggestions for transform function errors
48
+ */
49
+ static suggestTransformFix(error: Error, inputValue: any, expectedType?: string): string;
50
+ /**
51
+ * Generate suggestions for validation errors
52
+ */
53
+ static suggestValidationFix(fieldPath: string, value: any, validationRule: string): string;
54
+ /**
55
+ * Extract all possible paths from an object for suggestions
56
+ */
57
+ static extractPaths(obj: any, prefix?: string): string[];
58
+ /**
59
+ * Extract field names from an object (top-level and nested)
60
+ */
61
+ static extractFieldNames(obj: any, includeNested?: boolean): string[];
62
+ }
63
+ //# sourceMappingURL=SuggestionEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SuggestionEngine.d.ts","sourceRoot":"","sources":["../../src/errors/SuggestionEngine.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAO;IACnD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAK;IAE5C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IA4BlC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAsBlC;;OAEG;IACH,MAAM,CAAC,WAAW,CAChB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAAE,EACpB,SAAS,GAAE,MAA8C,GACxD,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAwB/C;;OAEG;IACH,MAAM,CAAC,iBAAiB,CACtB,YAAY,EAAE,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