rawsql-ts 0.20.0 → 0.21.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.
Files changed (89) hide show
  1. package/README.md +12 -13
  2. package/dist/esm/index.d.ts +1 -11
  3. package/dist/esm/index.js +1 -11
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/esm/index.min.js +3 -39
  6. package/dist/esm/index.min.js.map +3 -3
  7. package/dist/esm/transformers/DynamicQueryBuilder.d.ts +4 -27
  8. package/dist/esm/transformers/DynamicQueryBuilder.js +10 -27
  9. package/dist/esm/transformers/DynamicQueryBuilder.js.map +1 -1
  10. package/dist/esm/transformers/PruneOptionalConditionBranches.d.ts +19 -0
  11. package/dist/esm/transformers/PruneOptionalConditionBranches.js +220 -0
  12. package/dist/esm/transformers/PruneOptionalConditionBranches.js.map +1 -1
  13. package/dist/esm/transformers/SSSQLFilterBuilder.js +2 -1
  14. package/dist/esm/transformers/SSSQLFilterBuilder.js.map +1 -1
  15. package/dist/esm/utils/SchemaManager.d.ts +3 -19
  16. package/dist/esm/utils/SchemaManager.js +2 -62
  17. package/dist/esm/utils/SchemaManager.js.map +1 -1
  18. package/dist/index.js +2 -18
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.min.js +3 -39
  21. package/dist/index.min.js.map +3 -3
  22. package/dist/src/index.d.ts +1 -11
  23. package/dist/src/transformers/DynamicQueryBuilder.d.ts +4 -27
  24. package/dist/src/transformers/PruneOptionalConditionBranches.d.ts +19 -0
  25. package/dist/src/utils/SchemaManager.d.ts +3 -19
  26. package/dist/transformers/DynamicQueryBuilder.js +10 -27
  27. package/dist/transformers/DynamicQueryBuilder.js.map +1 -1
  28. package/dist/transformers/PruneOptionalConditionBranches.js +222 -1
  29. package/dist/transformers/PruneOptionalConditionBranches.js.map +1 -1
  30. package/dist/transformers/SSSQLFilterBuilder.js +2 -1
  31. package/dist/transformers/SSSQLFilterBuilder.js.map +1 -1
  32. package/dist/tsconfig.browser.tsbuildinfo +1 -1
  33. package/dist/utils/SchemaManager.js +2 -63
  34. package/dist/utils/SchemaManager.js.map +1 -1
  35. package/package.json +10 -2
  36. package/dist/esm/transformers/EnhancedJsonMapping.d.ts +0 -194
  37. package/dist/esm/transformers/EnhancedJsonMapping.js +0 -217
  38. package/dist/esm/transformers/EnhancedJsonMapping.js.map +0 -1
  39. package/dist/esm/transformers/JsonMappingConverter.d.ts +0 -200
  40. package/dist/esm/transformers/JsonMappingConverter.js +0 -388
  41. package/dist/esm/transformers/JsonMappingConverter.js.map +0 -1
  42. package/dist/esm/transformers/JsonMappingUnifier.d.ts +0 -100
  43. package/dist/esm/transformers/JsonMappingUnifier.js +0 -207
  44. package/dist/esm/transformers/JsonMappingUnifier.js.map +0 -1
  45. package/dist/esm/transformers/ModelDrivenJsonMapping.d.ts +0 -62
  46. package/dist/esm/transformers/ModelDrivenJsonMapping.js +0 -115
  47. package/dist/esm/transformers/ModelDrivenJsonMapping.js.map +0 -1
  48. package/dist/esm/transformers/PostgresArrayEntityCteBuilder.d.ts +0 -138
  49. package/dist/esm/transformers/PostgresArrayEntityCteBuilder.js +0 -454
  50. package/dist/esm/transformers/PostgresArrayEntityCteBuilder.js.map +0 -1
  51. package/dist/esm/transformers/PostgresJsonQueryBuilder.d.ts +0 -88
  52. package/dist/esm/transformers/PostgresJsonQueryBuilder.js +0 -241
  53. package/dist/esm/transformers/PostgresJsonQueryBuilder.js.map +0 -1
  54. package/dist/esm/transformers/PostgresObjectEntityCteBuilder.d.ts +0 -165
  55. package/dist/esm/transformers/PostgresObjectEntityCteBuilder.js +0 -343
  56. package/dist/esm/transformers/PostgresObjectEntityCteBuilder.js.map +0 -1
  57. package/dist/esm/transformers/TypeTransformationPostProcessor.d.ts +0 -108
  58. package/dist/esm/transformers/TypeTransformationPostProcessor.js +0 -354
  59. package/dist/esm/transformers/TypeTransformationPostProcessor.js.map +0 -1
  60. package/dist/esm/utils/JsonSchemaValidator.d.ts +0 -81
  61. package/dist/esm/utils/JsonSchemaValidator.js +0 -211
  62. package/dist/esm/utils/JsonSchemaValidator.js.map +0 -1
  63. package/dist/src/transformers/EnhancedJsonMapping.d.ts +0 -194
  64. package/dist/src/transformers/JsonMappingConverter.d.ts +0 -200
  65. package/dist/src/transformers/JsonMappingUnifier.d.ts +0 -100
  66. package/dist/src/transformers/ModelDrivenJsonMapping.d.ts +0 -62
  67. package/dist/src/transformers/PostgresArrayEntityCteBuilder.d.ts +0 -138
  68. package/dist/src/transformers/PostgresJsonQueryBuilder.d.ts +0 -88
  69. package/dist/src/transformers/PostgresObjectEntityCteBuilder.d.ts +0 -165
  70. package/dist/src/transformers/TypeTransformationPostProcessor.d.ts +0 -108
  71. package/dist/src/utils/JsonSchemaValidator.d.ts +0 -81
  72. package/dist/transformers/EnhancedJsonMapping.js +0 -223
  73. package/dist/transformers/EnhancedJsonMapping.js.map +0 -1
  74. package/dist/transformers/JsonMappingConverter.js +0 -392
  75. package/dist/transformers/JsonMappingConverter.js.map +0 -1
  76. package/dist/transformers/JsonMappingUnifier.js +0 -216
  77. package/dist/transformers/JsonMappingUnifier.js.map +0 -1
  78. package/dist/transformers/ModelDrivenJsonMapping.js +0 -122
  79. package/dist/transformers/ModelDrivenJsonMapping.js.map +0 -1
  80. package/dist/transformers/PostgresArrayEntityCteBuilder.js +0 -458
  81. package/dist/transformers/PostgresArrayEntityCteBuilder.js.map +0 -1
  82. package/dist/transformers/PostgresJsonQueryBuilder.js +0 -245
  83. package/dist/transformers/PostgresJsonQueryBuilder.js.map +0 -1
  84. package/dist/transformers/PostgresObjectEntityCteBuilder.js +0 -347
  85. package/dist/transformers/PostgresObjectEntityCteBuilder.js.map +0 -1
  86. package/dist/transformers/TypeTransformationPostProcessor.js +0 -363
  87. package/dist/transformers/TypeTransformationPostProcessor.js.map +0 -1
  88. package/dist/utils/JsonSchemaValidator.js +0 -215
  89. package/dist/utils/JsonSchemaValidator.js.map +0 -1
@@ -1,363 +0,0 @@
1
- "use strict";
2
- /**
3
- * Post-processor for transforming database values to appropriate TypeScript types
4
- * after JSON serialization from PostgreSQL
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.TypeTransformers = exports.TypeTransformationPostProcessor = void 0;
8
- exports.transformDatabaseResult = transformDatabaseResult;
9
- /**
10
- * Applies type transformations to JSON results from PostgreSQL
11
- */
12
- class TypeTransformationPostProcessor {
13
- constructor(config = {}) {
14
- this.config = {
15
- enableValueBasedDetection: true,
16
- strictDateDetection: false,
17
- ...config
18
- };
19
- }
20
- /**
21
- * Transform a single result object
22
- * @param result The result object from PostgreSQL JSON query
23
- * @returns Transformed result with proper TypeScript types
24
- */
25
- transformResult(result) {
26
- if (result === null || result === undefined) {
27
- return result;
28
- }
29
- if (Array.isArray(result)) {
30
- return result.map(item => this.transformSingleObject(item));
31
- }
32
- return this.transformSingleObject(result);
33
- }
34
- /**
35
- * Transform a single object recursively
36
- */
37
- transformSingleObject(obj) {
38
- var _a;
39
- if (obj === null || obj === undefined || typeof obj !== 'object') {
40
- return obj;
41
- }
42
- if (Array.isArray(obj)) {
43
- return obj.map(item => this.transformSingleObject(item));
44
- }
45
- const transformed = {};
46
- for (const [key, value] of Object.entries(obj)) {
47
- if (value === null || value === undefined) {
48
- transformed[key] = value;
49
- continue;
50
- } // Check for column-specific transformation first (takes precedence)
51
- const columnTransform = (_a = this.config.columnTransformations) === null || _a === void 0 ? void 0 : _a[key];
52
- if (columnTransform) {
53
- transformed[key] = this.applyTransformation(value, columnTransform);
54
- continue;
55
- }
56
- // Only apply value-based detection if enabled and no column mapping exists
57
- if (this.config.enableValueBasedDetection) {
58
- const detectedTransform = this.detectValueBasedTransformation(value);
59
- if (detectedTransform) {
60
- transformed[key] = this.applyTransformation(value, detectedTransform);
61
- continue;
62
- }
63
- }
64
- // Apply global transformations based on SQL type (if available)
65
- const globalTransform = this.config.globalTransformations &&
66
- this.getGlobalTransformationForValue(value);
67
- if (globalTransform) {
68
- transformed[key] = this.applyTransformation(value, globalTransform);
69
- continue;
70
- }
71
- // Recursively transform nested objects
72
- if (typeof value === 'object' && !Array.isArray(value)) {
73
- transformed[key] = this.transformSingleObject(value);
74
- continue;
75
- }
76
- if (Array.isArray(value)) {
77
- transformed[key] = value.map(item => typeof item === 'object' ? this.transformSingleObject(item) : item);
78
- continue;
79
- }
80
- // No transformation needed
81
- transformed[key] = value;
82
- }
83
- return transformed;
84
- }
85
- /**
86
- * Detect value type and create appropriate transformation based on value characteristics
87
- * This is the core value-based detection logic
88
- */
89
- detectValueBasedTransformation(value) {
90
- // Date string detection
91
- if (typeof value === 'string' && this.isDateString(value)) {
92
- return {
93
- sourceType: 'TIMESTAMP',
94
- targetType: 'Date',
95
- handleNull: true,
96
- validator: (v) => typeof v === 'string' && !isNaN(Date.parse(v))
97
- };
98
- }
99
- // BigInt detection (number > MAX_SAFE_INTEGER)
100
- if (typeof value === 'number' && !Number.isSafeInteger(value)) {
101
- return {
102
- sourceType: 'BIGINT',
103
- targetType: 'bigint',
104
- handleNull: true,
105
- validator: (v) => {
106
- try {
107
- if (typeof v === 'string' || typeof v === 'number' || typeof v === 'bigint' || typeof v === 'boolean') {
108
- BigInt(v);
109
- return true;
110
- }
111
- return false;
112
- }
113
- catch {
114
- return false;
115
- }
116
- }
117
- };
118
- }
119
- // Large string number detection (potential BIGINT)
120
- if (typeof value === 'string' && /^\d{16,}$/.test(value)) {
121
- return {
122
- sourceType: 'BIGINT',
123
- targetType: 'bigint',
124
- handleNull: true,
125
- validator: (v) => {
126
- try {
127
- if (typeof v === 'string' || typeof v === 'number' || typeof v === 'bigint' || typeof v === 'boolean') {
128
- BigInt(v);
129
- return true;
130
- }
131
- return false;
132
- }
133
- catch {
134
- return false;
135
- }
136
- }
137
- };
138
- }
139
- return null;
140
- }
141
- /**
142
- * Get global transformation for a specific value (if any match)
143
- * This is separate from value-based detection and relies on configured global rules
144
- */
145
- getGlobalTransformationForValue(value) {
146
- if (!this.config.globalTransformations) {
147
- return null;
148
- }
149
- // This could be extended to match values against configured global rules
150
- // For now, it's a placeholder for future SQL-type-based global transformations
151
- return null;
152
- }
153
- /**
154
- * @deprecated Use detectValueBasedTransformation instead
155
- * Detect value type and get appropriate global transformation
156
- */
157
- detectAndGetGlobalTransformation(value) {
158
- return this.detectValueBasedTransformation(value);
159
- }
160
- /**
161
- * Check if string is a valid date string
162
- * Supports both strict (ISO 8601 with T separator) and loose detection
163
- */
164
- isDateString(value) {
165
- if (this.config.strictDateDetection) {
166
- // Strict: Only ISO 8601 with T separator (safer for user input)
167
- const strictIsoPattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?(?:Z|[+-]\d{2}:\d{2})?$/;
168
- if (!strictIsoPattern.test(value)) {
169
- return false;
170
- }
171
- }
172
- else {
173
- // Loose: ISO 8601 date pattern (includes date-only strings)
174
- const isoDatePattern = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d{3})?(?:Z|[+-]\d{2}:\d{2})?)?$/;
175
- if (!isoDatePattern.test(value)) {
176
- return false;
177
- }
178
- }
179
- const date = new Date(value);
180
- return !isNaN(date.getTime());
181
- }
182
- /**
183
- * Apply a specific transformation to a value
184
- */
185
- applyTransformation(value, transformation) {
186
- var _a;
187
- // Handle null values
188
- if (value === null || value === undefined) {
189
- return transformation.handleNull !== false ? value : null;
190
- }
191
- // Validate value if validator is provided
192
- if (transformation.validator && !transformation.validator(value)) {
193
- console.warn(`TypeTransformationPostProcessor: Value validation failed for ${value}`);
194
- return value;
195
- }
196
- try {
197
- switch (transformation.targetType) {
198
- case 'Date':
199
- return new Date(value);
200
- case 'bigint':
201
- // Handle both string and number inputs for BIGINT
202
- // For scientific notation numbers, convert to integer first
203
- if (typeof value === 'number') {
204
- // Convert scientific notation to integer string
205
- const integerValue = Math.trunc(value);
206
- return BigInt(integerValue.toString());
207
- }
208
- return BigInt(value);
209
- case 'string':
210
- return value.toString();
211
- case 'number':
212
- return typeof value === 'string' ? parseFloat(value) : Number(value);
213
- case 'object':
214
- return typeof value === 'string' ? JSON.parse(value) : value;
215
- case 'custom':
216
- if (transformation.customTransformer &&
217
- ((_a = this.config.customTransformers) === null || _a === void 0 ? void 0 : _a[transformation.customTransformer])) {
218
- return this.config.customTransformers[transformation.customTransformer](value);
219
- }
220
- break;
221
- default:
222
- return value;
223
- }
224
- }
225
- catch (error) {
226
- console.warn(`TypeTransformationPostProcessor: Transformation failed for ${value}:`, error);
227
- return value;
228
- }
229
- return value;
230
- }
231
- /**
232
- * Create a default configuration for common PostgreSQL types
233
- * Enables value-based detection with loose date detection by default
234
- */
235
- static createDefaultConfig() {
236
- return {
237
- enableValueBasedDetection: true,
238
- strictDateDetection: false,
239
- globalTransformations: {
240
- 'DATE': {
241
- sourceType: 'DATE',
242
- targetType: 'Date',
243
- handleNull: true,
244
- validator: (value) => typeof value === 'string' && !isNaN(Date.parse(value))
245
- },
246
- 'TIMESTAMP': {
247
- sourceType: 'TIMESTAMP',
248
- targetType: 'Date',
249
- handleNull: true,
250
- validator: (value) => typeof value === 'string' && !isNaN(Date.parse(value))
251
- },
252
- 'BIGINT': {
253
- sourceType: 'BIGINT',
254
- targetType: 'bigint',
255
- handleNull: true,
256
- validator: (value) => {
257
- try {
258
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint' || typeof value === 'boolean') {
259
- BigInt(value);
260
- return true;
261
- }
262
- return false;
263
- }
264
- catch {
265
- return false;
266
- }
267
- }
268
- }
269
- }
270
- };
271
- }
272
- /**
273
- * Create a safe configuration for handling user input
274
- * Disables value-based detection and uses strict date detection
275
- */
276
- static createSafeConfig(columnMappings) {
277
- return {
278
- enableValueBasedDetection: false,
279
- strictDateDetection: true,
280
- columnTransformations: columnMappings || {},
281
- globalTransformations: {
282
- 'DATE': {
283
- sourceType: 'DATE',
284
- targetType: 'Date',
285
- handleNull: true,
286
- validator: (value) => typeof value === 'string' && !isNaN(Date.parse(value))
287
- },
288
- 'TIMESTAMP': {
289
- sourceType: 'TIMESTAMP',
290
- targetType: 'Date',
291
- handleNull: true,
292
- validator: (value) => typeof value === 'string' && !isNaN(Date.parse(value))
293
- },
294
- 'BIGINT': {
295
- sourceType: 'BIGINT',
296
- targetType: 'bigint',
297
- handleNull: true,
298
- validator: (value) => {
299
- try {
300
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint' || typeof value === 'boolean') {
301
- BigInt(value);
302
- return true;
303
- }
304
- return false;
305
- }
306
- catch {
307
- return false;
308
- }
309
- }
310
- }
311
- }
312
- };
313
- }
314
- }
315
- exports.TypeTransformationPostProcessor = TypeTransformationPostProcessor;
316
- /**
317
- * Convenience function to create and apply transformations
318
- */
319
- function transformDatabaseResult(result, config) {
320
- const processor = new TypeTransformationPostProcessor(config || TypeTransformationPostProcessor.createDefaultConfig());
321
- return processor.transformResult(result);
322
- }
323
- /**
324
- * Type-safe transformation helpers
325
- */
326
- exports.TypeTransformers = {
327
- /**
328
- * Transform date string to Date object
329
- */
330
- toDate: (value) => {
331
- if (value === null || value === undefined)
332
- return null;
333
- const date = new Date(value);
334
- return isNaN(date.getTime()) ? null : date;
335
- },
336
- /**
337
- * Transform numeric string to BigInt
338
- */
339
- toBigInt: (value) => {
340
- if (value === null || value === undefined)
341
- return null;
342
- try {
343
- return BigInt(value);
344
- }
345
- catch {
346
- return null;
347
- }
348
- },
349
- /**
350
- * Transform JSON string to object
351
- */
352
- toObject: (value) => {
353
- if (value === null || value === undefined)
354
- return null;
355
- try {
356
- return JSON.parse(value);
357
- }
358
- catch {
359
- return null;
360
- }
361
- }
362
- };
363
- //# sourceMappingURL=TypeTransformationPostProcessor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypeTransformationPostProcessor.js","sourceRoot":"","sources":["../../src/transformers/TypeTransformationPostProcessor.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAkXH,0DAQC;AAxVD;;GAEG;AACH,MAAa,+BAA+B;IACE,YAAY,SAAmC,EAAE;QACvF,IAAI,CAAC,MAAM,GAAG;Y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SAAS;YAAE,OAAO,IAAI,CAAC;QACvD,IAAI,CAAC;YACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;IAED;;OAEG;IACH,QAAQ,EAAE,CAAc,KAAoB,EAAY,EAAE;QACtD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QACvD,IAAI,CAAC;YACD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAM,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;CACJ,CAAC"}
@@ -1,215 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JsonSchemaValidator = void 0;
4
- class JsonSchemaValidator {
5
- /**
6
- * Validates JsonMapping structure against an expected type structure.
7
- * Checks if the JsonMapping covers all required properties and relationships.
8
- *
9
- * @param jsonMapping The JsonMapping configuration to validate
10
- * @param expectedStructure The expected type structure to validate against
11
- * @returns ValidationResult containing validation status and detailed errors
12
- */
13
- static validate(jsonMapping, expectedStructure) {
14
- const extractedStructure = this.extractStructureFromJsonMapping(jsonMapping);
15
- return this.compareStructures(extractedStructure, expectedStructure);
16
- }
17
- /**
18
- * Validates JsonMapping structure and throws an error if validation fails.
19
- * Convenience method for strict validation scenarios.
20
- *
21
- * @param jsonMapping The JsonMapping configuration to validate
22
- * @param expectedStructure The expected type structure to validate against
23
- * @throws Error if validation fails with detailed error messages
24
- */
25
- static validateStrict(jsonMapping, expectedStructure) {
26
- const result = this.validate(jsonMapping, expectedStructure);
27
- if (!result.isValid) {
28
- const errorMessage = [
29
- 'JsonMapping validation failed:',
30
- ...result.errors
31
- ].join('\n');
32
- throw new Error(errorMessage);
33
- }
34
- }
35
- /**
36
- * Extracts structure information from JsonMapping configuration.
37
- * Analyzes rootEntity and nestedEntities to build complete structure map.
38
- *
39
- * @param jsonMapping The JsonMapping to analyze
40
- * @returns ExtractedStructure representing the mapping structure
41
- */
42
- static extractStructureFromJsonMapping(jsonMapping) {
43
- const structure = {};
44
- // Extract root entity properties
45
- if (jsonMapping.rootEntity && jsonMapping.rootEntity.columns) {
46
- Object.keys(jsonMapping.rootEntity.columns).forEach(propertyName => {
47
- structure[propertyName] = 'primitive';
48
- });
49
- }
50
- // Extract nested entities
51
- if (jsonMapping.nestedEntities) {
52
- // Process direct children of root entity first
53
- jsonMapping.nestedEntities
54
- .filter((entity) => entity.parentId === jsonMapping.rootEntity.id)
55
- .forEach((entity) => {
56
- if (entity.propertyName && entity.columns) {
57
- if (entity.relationshipType === 'object') {
58
- // Single object relationship
59
- structure[entity.propertyName] = this.extractNestedEntityStructure(entity, jsonMapping);
60
- }
61
- else if (entity.relationshipType === 'array') {
62
- // Array relationship
63
- structure[entity.propertyName] = [this.extractNestedEntityStructure(entity, jsonMapping)];
64
- }
65
- }
66
- });
67
- }
68
- return structure;
69
- } /**
70
- * Extracts structure from a nested entity, including its children.
71
- */
72
- static extractNestedEntityStructure(entity, jsonMapping) {
73
- const entityStructure = {};
74
- // Add entity's own columns
75
- if (entity.columns) {
76
- Object.keys(entity.columns).forEach(propName => {
77
- entityStructure[propName] = 'primitive';
78
- });
79
- }
80
- // Add nested children of this entity
81
- if (jsonMapping.nestedEntities) {
82
- jsonMapping.nestedEntities
83
- .filter((childEntity) => childEntity.parentId === entity.id)
84
- .forEach((childEntity) => {
85
- if (childEntity.propertyName && childEntity.columns) {
86
- if (childEntity.relationshipType === 'object') {
87
- entityStructure[childEntity.propertyName] = this.extractNestedEntityStructure(childEntity, jsonMapping);
88
- }
89
- else if (childEntity.relationshipType === 'array') {
90
- entityStructure[childEntity.propertyName] = [this.extractNestedEntityStructure(childEntity, jsonMapping)];
91
- }
92
- }
93
- });
94
- }
95
- return entityStructure;
96
- } /**
97
- * Compares extracted structure with expected structure with proper type guards.
98
- */
99
- static compareStructures(extracted, expected, path = '') {
100
- const errors = [];
101
- const missingProperties = [];
102
- const extraProperties = [];
103
- // Handle primitive comparison
104
- if (extracted === 'primitive' && expected === 'primitive') {
105
- return { isValid: true, errors: [], missingProperties: [], extraProperties: [] };
106
- }
107
- // Handle array types
108
- if (Array.isArray(expected) && Array.isArray(extracted)) {
109
- if (expected.length > 0 && extracted.length > 0) {
110
- const nestedResult = this.compareStructures(extracted[0], expected[0], `${path}[]`);
111
- errors.push(...nestedResult.errors);
112
- missingProperties.push(...nestedResult.missingProperties);
113
- extraProperties.push(...nestedResult.extraProperties);
114
- }
115
- return { isValid: errors.length === 0, errors, missingProperties, extraProperties };
116
- } // Both should be objects for property comparison
117
- if (typeof extracted !== 'object' || typeof expected !== 'object' ||
118
- Array.isArray(extracted) || Array.isArray(expected) ||
119
- extracted === null || expected === null) {
120
- return { isValid: true, errors: [], missingProperties: [], extraProperties: [] };
121
- }
122
- // Now we know both are object types, safe to access properties
123
- const extractedObj = extracted;
124
- const expectedObj = expected;
125
- // Check for missing properties in extracted structure
126
- Object.keys(expectedObj).forEach(key => {
127
- const currentPath = path ? `${path}.${key}` : key;
128
- if (!(key in extractedObj)) {
129
- missingProperties.push(currentPath);
130
- errors.push(`Missing property: ${currentPath}`);
131
- return;
132
- }
133
- const extractedValue = extractedObj[key];
134
- const expectedValue = expectedObj[key];
135
- // Recursively compare nested structures
136
- const nestedResult = this.compareStructures(extractedValue, expectedValue, currentPath);
137
- errors.push(...nestedResult.errors);
138
- missingProperties.push(...nestedResult.missingProperties);
139
- extraProperties.push(...nestedResult.extraProperties);
140
- });
141
- // Check for extra properties in extracted structure
142
- Object.keys(extractedObj).forEach(key => {
143
- const currentPath = path ? `${path}.${key}` : key;
144
- if (!(key in expectedObj)) {
145
- extraProperties.push(currentPath);
146
- // Note: Extra properties are not considered errors in this implementation
147
- // as JsonMapping might include additional metadata
148
- }
149
- });
150
- return {
151
- isValid: errors.length === 0,
152
- errors,
153
- missingProperties,
154
- extraProperties
155
- };
156
- }
157
- /**
158
- * Validates JsonMapping structure against a sample object that implements the expected type.
159
- * This method extracts structure from the sample object and compares it with JsonMapping.
160
- *
161
- * @param jsonMapping The JsonMapping configuration to validate
162
- * @param sampleObject A sample object that implements the expected interface/type
163
- * @returns ValidationResult containing validation status and detailed errors
164
- */
165
- static validateAgainstSample(jsonMapping, sampleObject) {
166
- const expectedStructure = this.extractStructureFromSample(sampleObject);
167
- return this.validate(jsonMapping, expectedStructure);
168
- }
169
- /**
170
- * Validates JsonMapping structure against a sample object and throws an error if validation fails.
171
- * Convenience method for strict validation scenarios with sample objects.
172
- *
173
- * @param jsonMapping The JsonMapping configuration to validate
174
- * @param sampleObject A sample object that implements the expected interface/type
175
- * @throws Error if validation fails with detailed error messages
176
- */
177
- static validateAgainstSampleStrict(jsonMapping, sampleObject) {
178
- const result = this.validateAgainstSample(jsonMapping, sampleObject);
179
- if (!result.isValid) {
180
- const errorMessage = [
181
- 'JsonMapping validation against sample object failed:',
182
- ...result.errors
183
- ].join('\n');
184
- throw new Error(errorMessage);
185
- }
186
- } /**
187
- * Extracts structure information from a sample object.
188
- * Recursively analyzes the object properties to build a structure map.
189
- *
190
- * @param sampleObject The sample object to analyze
191
- * @returns ExpectedTypeStructure representing the object structure
192
- */
193
- static extractStructureFromSample(sampleObject) {
194
- if (sampleObject === null || sampleObject === undefined) {
195
- return 'primitive';
196
- }
197
- if (Array.isArray(sampleObject)) {
198
- if (sampleObject.length === 0) {
199
- return [];
200
- }
201
- return [this.extractStructureFromSample(sampleObject[0])];
202
- }
203
- if (typeof sampleObject === 'object') {
204
- const structure = {};
205
- Object.keys(sampleObject).forEach(key => {
206
- structure[key] = this.extractStructureFromSample(sampleObject[key]);
207
- });
208
- return structure;
209
- }
210
- // Primitive types (string, number, boolean, etc.)
211
- return 'primitive';
212
- }
213
- }
214
- exports.JsonSchemaValidator = JsonSchemaValidator;
215
- //# sourceMappingURL=JsonSchemaValidator.js.map
@@ -1 +0,0 @@
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