rawsql-ts 0.19.0 → 0.21.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/README.md +12 -13
- package/dist/esm/index.d.ts +1 -11
- package/dist/esm/index.js +1 -11
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +5 -41
- package/dist/esm/index.min.js.map +4 -4
- package/dist/esm/transformers/DynamicQueryBuilder.d.ts +4 -27
- package/dist/esm/transformers/DynamicQueryBuilder.js +10 -27
- package/dist/esm/transformers/DynamicQueryBuilder.js.map +1 -1
- package/dist/esm/transformers/SSSQLFilterBuilder.d.ts +48 -1
- package/dist/esm/transformers/SSSQLFilterBuilder.js +578 -31
- package/dist/esm/transformers/SSSQLFilterBuilder.js.map +1 -1
- package/dist/esm/utils/SchemaManager.d.ts +3 -19
- package/dist/esm/utils/SchemaManager.js +2 -62
- package/dist/esm/utils/SchemaManager.js.map +1 -1
- package/dist/index.js +2 -18
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +5 -41
- package/dist/index.min.js.map +4 -4
- package/dist/src/index.d.ts +1 -11
- package/dist/src/transformers/DynamicQueryBuilder.d.ts +4 -27
- package/dist/src/transformers/SSSQLFilterBuilder.d.ts +48 -1
- package/dist/src/utils/SchemaManager.d.ts +3 -19
- package/dist/transformers/DynamicQueryBuilder.js +10 -27
- package/dist/transformers/DynamicQueryBuilder.js.map +1 -1
- package/dist/transformers/SSSQLFilterBuilder.js +576 -29
- package/dist/transformers/SSSQLFilterBuilder.js.map +1 -1
- package/dist/tsconfig.browser.tsbuildinfo +1 -1
- package/dist/utils/SchemaManager.js +2 -63
- package/dist/utils/SchemaManager.js.map +1 -1
- package/package.json +10 -2
- package/dist/esm/transformers/EnhancedJsonMapping.d.ts +0 -194
- package/dist/esm/transformers/EnhancedJsonMapping.js +0 -217
- package/dist/esm/transformers/EnhancedJsonMapping.js.map +0 -1
- package/dist/esm/transformers/JsonMappingConverter.d.ts +0 -200
- package/dist/esm/transformers/JsonMappingConverter.js +0 -388
- package/dist/esm/transformers/JsonMappingConverter.js.map +0 -1
- package/dist/esm/transformers/JsonMappingUnifier.d.ts +0 -100
- package/dist/esm/transformers/JsonMappingUnifier.js +0 -207
- package/dist/esm/transformers/JsonMappingUnifier.js.map +0 -1
- package/dist/esm/transformers/ModelDrivenJsonMapping.d.ts +0 -62
- package/dist/esm/transformers/ModelDrivenJsonMapping.js +0 -115
- package/dist/esm/transformers/ModelDrivenJsonMapping.js.map +0 -1
- package/dist/esm/transformers/PostgresArrayEntityCteBuilder.d.ts +0 -138
- package/dist/esm/transformers/PostgresArrayEntityCteBuilder.js +0 -454
- package/dist/esm/transformers/PostgresArrayEntityCteBuilder.js.map +0 -1
- package/dist/esm/transformers/PostgresJsonQueryBuilder.d.ts +0 -88
- package/dist/esm/transformers/PostgresJsonQueryBuilder.js +0 -241
- package/dist/esm/transformers/PostgresJsonQueryBuilder.js.map +0 -1
- package/dist/esm/transformers/PostgresObjectEntityCteBuilder.d.ts +0 -165
- package/dist/esm/transformers/PostgresObjectEntityCteBuilder.js +0 -343
- package/dist/esm/transformers/PostgresObjectEntityCteBuilder.js.map +0 -1
- package/dist/esm/transformers/TypeTransformationPostProcessor.d.ts +0 -108
- package/dist/esm/transformers/TypeTransformationPostProcessor.js +0 -354
- package/dist/esm/transformers/TypeTransformationPostProcessor.js.map +0 -1
- package/dist/esm/utils/JsonSchemaValidator.d.ts +0 -81
- package/dist/esm/utils/JsonSchemaValidator.js +0 -211
- package/dist/esm/utils/JsonSchemaValidator.js.map +0 -1
- package/dist/src/transformers/EnhancedJsonMapping.d.ts +0 -194
- package/dist/src/transformers/JsonMappingConverter.d.ts +0 -200
- package/dist/src/transformers/JsonMappingUnifier.d.ts +0 -100
- package/dist/src/transformers/ModelDrivenJsonMapping.d.ts +0 -62
- package/dist/src/transformers/PostgresArrayEntityCteBuilder.d.ts +0 -138
- package/dist/src/transformers/PostgresJsonQueryBuilder.d.ts +0 -88
- package/dist/src/transformers/PostgresObjectEntityCteBuilder.d.ts +0 -165
- package/dist/src/transformers/TypeTransformationPostProcessor.d.ts +0 -108
- package/dist/src/utils/JsonSchemaValidator.d.ts +0 -81
- package/dist/transformers/EnhancedJsonMapping.js +0 -223
- package/dist/transformers/EnhancedJsonMapping.js.map +0 -1
- package/dist/transformers/JsonMappingConverter.js +0 -392
- package/dist/transformers/JsonMappingConverter.js.map +0 -1
- package/dist/transformers/JsonMappingUnifier.js +0 -216
- package/dist/transformers/JsonMappingUnifier.js.map +0 -1
- package/dist/transformers/ModelDrivenJsonMapping.js +0 -122
- package/dist/transformers/ModelDrivenJsonMapping.js.map +0 -1
- package/dist/transformers/PostgresArrayEntityCteBuilder.js +0 -458
- package/dist/transformers/PostgresArrayEntityCteBuilder.js.map +0 -1
- package/dist/transformers/PostgresJsonQueryBuilder.js +0 -245
- package/dist/transformers/PostgresJsonQueryBuilder.js.map +0 -1
- package/dist/transformers/PostgresObjectEntityCteBuilder.js +0 -347
- package/dist/transformers/PostgresObjectEntityCteBuilder.js.map +0 -1
- package/dist/transformers/TypeTransformationPostProcessor.js +0 -363
- package/dist/transformers/TypeTransformationPostProcessor.js.map +0 -1
- package/dist/utils/JsonSchemaValidator.js +0 -215
- package/dist/utils/JsonSchemaValidator.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Central schema management utility for rawsql-ts.
|
|
4
|
-
* Converts user-defined table definitions into resolvers
|
|
4
|
+
* Converts user-defined table definitions into resolvers consumed by collectors and builders.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```typescript
|
|
@@ -25,11 +25,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
exports.SchemaManager = void 0;
|
|
26
26
|
exports.createSchemaManager = createSchemaManager;
|
|
27
27
|
exports.createTableColumnResolver = createTableColumnResolver;
|
|
28
|
-
exports.createJsonMappingFromSchema = createJsonMappingFromSchema;
|
|
29
28
|
// === Schema Manager Class ===
|
|
30
29
|
/**
|
|
31
30
|
* Central schema management utility for rawsql-ts
|
|
32
|
-
* Converts user-defined schemas to
|
|
31
|
+
* Converts user-defined schemas to resolvers consumed by schema-aware utilities
|
|
33
32
|
*/
|
|
34
33
|
class SchemaManager {
|
|
35
34
|
constructor(schemas) {
|
|
@@ -84,56 +83,6 @@ class SchemaManager {
|
|
|
84
83
|
createTableColumnResolver() {
|
|
85
84
|
return (tableName) => this.getTableColumns(tableName);
|
|
86
85
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Generate JSON mapping configuration for PostgresJsonQueryBuilder
|
|
89
|
-
* @param rootTableName Root table for the JSON structure
|
|
90
|
-
* @returns JSON mapping configuration
|
|
91
|
-
*/
|
|
92
|
-
createJsonMapping(rootTableName) {
|
|
93
|
-
var _a;
|
|
94
|
-
const rootTable = this.schemas[rootTableName];
|
|
95
|
-
if (!rootTable) {
|
|
96
|
-
throw new Error(`Table '${rootTableName}' not found in schema registry`);
|
|
97
|
-
}
|
|
98
|
-
// Build root entity columns mapping
|
|
99
|
-
const rootColumns = {};
|
|
100
|
-
Object.entries(rootTable.columns).forEach(([columnName, column]) => {
|
|
101
|
-
rootColumns[columnName] = column.jsonAlias || column.name;
|
|
102
|
-
});
|
|
103
|
-
// Build nested entities from relationships
|
|
104
|
-
const nestedEntities = [];
|
|
105
|
-
(_a = rootTable.relationships) === null || _a === void 0 ? void 0 : _a.forEach(rel => {
|
|
106
|
-
const relatedTable = this.schemas[rel.table];
|
|
107
|
-
if (!relatedTable) {
|
|
108
|
-
throw new Error(`Related table '${rel.table}' not found in schema registry`);
|
|
109
|
-
}
|
|
110
|
-
// Build columns mapping for related table
|
|
111
|
-
const relatedColumns = {};
|
|
112
|
-
Object.entries(relatedTable.columns).forEach(([columnName, column]) => {
|
|
113
|
-
relatedColumns[columnName] = column.jsonAlias || column.name;
|
|
114
|
-
});
|
|
115
|
-
// Determine relationship type for JSON builder
|
|
116
|
-
const relationshipType = rel.type;
|
|
117
|
-
nestedEntities.push({
|
|
118
|
-
id: rel.propertyName,
|
|
119
|
-
name: relatedTable.displayName || rel.table,
|
|
120
|
-
parentId: rootTableName,
|
|
121
|
-
propertyName: rel.propertyName,
|
|
122
|
-
relationshipType: relationshipType,
|
|
123
|
-
columns: relatedColumns
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
return {
|
|
127
|
-
rootName: rootTableName,
|
|
128
|
-
rootEntity: {
|
|
129
|
-
id: rootTableName,
|
|
130
|
-
name: rootTable.displayName || rootTableName,
|
|
131
|
-
columns: rootColumns
|
|
132
|
-
},
|
|
133
|
-
nestedEntities,
|
|
134
|
-
resultFormat: "single"
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
86
|
/**
|
|
138
87
|
* Get all table names in the schema
|
|
139
88
|
* @returns Array of table names
|
|
@@ -204,14 +153,4 @@ function createTableColumnResolver(schemas) {
|
|
|
204
153
|
const manager = new SchemaManager(schemas);
|
|
205
154
|
return manager.createTableColumnResolver();
|
|
206
155
|
}
|
|
207
|
-
/**
|
|
208
|
-
* Create JSON mapping from schema definitions
|
|
209
|
-
* @param schemas Schema registry object
|
|
210
|
-
* @param rootTableName Root table name
|
|
211
|
-
* @returns JSON mapping for PostgresJsonQueryBuilder
|
|
212
|
-
*/
|
|
213
|
-
function createJsonMappingFromSchema(schemas, rootTableName) {
|
|
214
|
-
const manager = new SchemaManager(schemas);
|
|
215
|
-
return manager.createJsonMapping(rootTableName);
|
|
216
|
-
}
|
|
217
156
|
//# sourceMappingURL=SchemaManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaManager.js","sourceRoot":"","sources":["../../src/utils/SchemaManager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;
|
|
1
|
+
{"version":3,"file":"SchemaManager.js","sourceRoot":"","sources":["../../src/utils/SchemaManager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;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I,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACtC,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,CAAC;QAEtB,MAAM,WAAW,GAAiF,EAAE,CAAC;QAErG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,EAAE;YAC3D,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;gBACpB,WAAW,CAAC,IAAI,CAAC;oBACb,MAAM,EAAE,UAAU;oBAClB,eAAe,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK;oBACxC,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,MAAM;iBAC7C,CAAC,CAAC;YACP,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC;IACvB,CAAC;CACJ;AAtHD,sCAsHC;AAED,gCAAgC;AAEhC;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,OAAuB;IACvD,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,SAAgB,yBAAyB,CAAC,OAAuB;IAC7D,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO,OAAO,CAAC,yBAAyB,EAAE,CAAC;AAC/C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rawsql-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "High-performance SQL parser and AST analyzer written in TypeScript. Provides fast parsing and advanced transformation capabilities.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
+
"@appland/sql-parser": "^1.5.1",
|
|
30
|
+
"@guanmingchiu/sqlparser-ts": "^0.61.1",
|
|
29
31
|
"@types/benchmark": "^2.1.5",
|
|
30
32
|
"@types/node": "^22.13.10",
|
|
31
33
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
@@ -38,9 +40,13 @@
|
|
|
38
40
|
"eslint-plugin-filenames": "^1.3.2",
|
|
39
41
|
"eslint-plugin-prettier": "^5.2.3",
|
|
40
42
|
"microtime": "^3.1.1",
|
|
43
|
+
"mitata": "^1.0.34",
|
|
41
44
|
"node-sql-parser": "^5.4.0",
|
|
45
|
+
"pgsql-ast-parser": "^12.0.2",
|
|
42
46
|
"sql-formatter": "^15.5.2",
|
|
47
|
+
"sqlite-parser": "^1.0.1",
|
|
43
48
|
"sql-parser-cst": "^0.33.1",
|
|
49
|
+
"sqlite3-parser": "^0.7.1",
|
|
44
50
|
"ts-node": "^10.9.2",
|
|
45
51
|
"typescript": "^5.8.2",
|
|
46
52
|
"vitest": "^4.0.15"
|
|
@@ -60,6 +66,8 @@
|
|
|
60
66
|
"clean": "tsc --build --clean && node -e \"const fs = require('fs'); if (fs.existsSync('dist')) fs.rmSync('dist', {recursive: true, force: true});\"",
|
|
61
67
|
"lint": "eslint . --ext .ts,.tsx --fix",
|
|
62
68
|
"postbuild": "node ../../scripts/sync-rawsql-dist.js",
|
|
63
|
-
"benchmark": "ts-node ../../benchmarks/parse-benchmark.ts"
|
|
69
|
+
"benchmark": "ts-node ../../benchmarks/parse-benchmark.ts",
|
|
70
|
+
"benchmark:sqlite3-parser": "ts-node ../../benchmarks/sqlite3-parser-benchmark.ts",
|
|
71
|
+
"benchmark:sqlite3-parser:bun": "bun ../../benchmarks/sqlite3-parser-bun-benchmark.ts"
|
|
64
72
|
}
|
|
65
73
|
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enhanced JSON mapping structure that extends the base JsonMapping interface
|
|
3
|
-
* with additional metadata and type safety features.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Supported column types for enhanced mapping.
|
|
7
|
-
*/
|
|
8
|
-
export type ColumnType = 'string' | 'number' | 'boolean' | 'date' | 'auto';
|
|
9
|
-
/**
|
|
10
|
-
* Enhanced column configuration that supports both simple and complex mappings.
|
|
11
|
-
*/
|
|
12
|
-
export interface ColumnConfig {
|
|
13
|
-
/** Source column name */
|
|
14
|
-
column: string;
|
|
15
|
-
/** Type enforcement for this column */
|
|
16
|
-
type?: ColumnType;
|
|
17
|
-
/** Whether this field is nullable */
|
|
18
|
-
nullable?: boolean;
|
|
19
|
-
/** Custom transformation function */
|
|
20
|
-
transform?: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Column mapping can be either a simple string or enhanced configuration.
|
|
24
|
-
*/
|
|
25
|
-
export type ColumnMapping = string | ColumnConfig;
|
|
26
|
-
/**
|
|
27
|
-
* Enhanced entity definition with additional metadata.
|
|
28
|
-
*/
|
|
29
|
-
export interface EnhancedEntity {
|
|
30
|
-
id: string;
|
|
31
|
-
name: string;
|
|
32
|
-
columns: Record<string, ColumnMapping>;
|
|
33
|
-
/** Entity description for documentation */
|
|
34
|
-
description?: string;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Enhanced nested entity with relationship metadata.
|
|
38
|
-
*/
|
|
39
|
-
export interface EnhancedNestedEntity extends EnhancedEntity {
|
|
40
|
-
parentId: string;
|
|
41
|
-
propertyName: string;
|
|
42
|
-
relationshipType: 'object' | 'array';
|
|
43
|
-
/** Join condition for complex relationships */
|
|
44
|
-
joinCondition?: string;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Type protection configuration.
|
|
48
|
-
*/
|
|
49
|
-
export interface TypeProtectionConfig {
|
|
50
|
-
/** Columns that should be treated as strings */
|
|
51
|
-
protectedStringFields: string[];
|
|
52
|
-
/** Columns that should be parsed as dates */
|
|
53
|
-
dateFields?: string[];
|
|
54
|
-
/** Columns that should be parsed as numbers */
|
|
55
|
-
numberFields?: string[];
|
|
56
|
-
/** Custom type transformations */
|
|
57
|
-
customTransforms?: Record<string, string>;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Enhanced JSON mapping with type safety and metadata support.
|
|
61
|
-
*/
|
|
62
|
-
export interface EnhancedJsonMapping {
|
|
63
|
-
/** Root entity name */
|
|
64
|
-
rootName: string;
|
|
65
|
-
/** Root entity definition */
|
|
66
|
-
rootEntity: EnhancedEntity;
|
|
67
|
-
/** Nested entities */
|
|
68
|
-
nestedEntities: EnhancedNestedEntity[];
|
|
69
|
-
/** Result format */
|
|
70
|
-
resultFormat?: 'array' | 'single';
|
|
71
|
-
/** Empty result fallback */
|
|
72
|
-
emptyResult?: string;
|
|
73
|
-
/** Type information */
|
|
74
|
-
typeInfo?: {
|
|
75
|
-
interface: string;
|
|
76
|
-
importPath: string;
|
|
77
|
-
generics?: string[];
|
|
78
|
-
};
|
|
79
|
-
/** Type protection configuration */
|
|
80
|
-
typeProtection?: TypeProtectionConfig;
|
|
81
|
-
/** Mapping metadata */
|
|
82
|
-
metadata?: {
|
|
83
|
-
version: string;
|
|
84
|
-
description?: string;
|
|
85
|
-
author?: string;
|
|
86
|
-
createdAt?: string;
|
|
87
|
-
updatedAt?: string;
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Legacy JSON mapping interface (from PostgresJsonQueryBuilder).
|
|
92
|
-
*/
|
|
93
|
-
export interface LegacyJsonMapping {
|
|
94
|
-
rootName: string;
|
|
95
|
-
rootEntity: {
|
|
96
|
-
id: string;
|
|
97
|
-
name: string;
|
|
98
|
-
columns: {
|
|
99
|
-
[jsonKey: string]: string;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
nestedEntities: Array<{
|
|
103
|
-
id: string;
|
|
104
|
-
name: string;
|
|
105
|
-
parentId: string;
|
|
106
|
-
propertyName: string;
|
|
107
|
-
relationshipType?: "object" | "array";
|
|
108
|
-
columns: {
|
|
109
|
-
[jsonKey: string]: string;
|
|
110
|
-
};
|
|
111
|
-
}>;
|
|
112
|
-
resultFormat?: "array" | "single";
|
|
113
|
-
emptyResult?: string;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Converts enhanced column configurations to simple string mappings for legacy compatibility.
|
|
117
|
-
*
|
|
118
|
-
* This function transforms complex column configurations (with type info, nullable flags, etc.)
|
|
119
|
-
* into simple string mappings that can be used with PostgresJsonQueryBuilder.
|
|
120
|
-
*
|
|
121
|
-
* **Supported Input Formats:**
|
|
122
|
-
* - Simple strings: `"user_name"` → `"user_name"`
|
|
123
|
-
* - Column config: `{ column: "u.name", type: "string" }` → `"u.name"`
|
|
124
|
-
* - From config: `{ from: "user_name", nullable: true }` → `"user_name"`
|
|
125
|
-
*
|
|
126
|
-
* @param columns - Record of field names to column configurations
|
|
127
|
-
* @returns Record of field names to column source strings
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* ```typescript
|
|
131
|
-
* const enhanced = {
|
|
132
|
-
* id: { column: "u.user_id", type: "number" },
|
|
133
|
-
* name: { from: "user_name", type: "string" },
|
|
134
|
-
* email: "email_address"
|
|
135
|
-
* };
|
|
136
|
-
*
|
|
137
|
-
* const legacy = convertColumnsToLegacy(enhanced);
|
|
138
|
-
* // Result: { id: "u.user_id", name: "user_name", email: "email_address" }
|
|
139
|
-
* ```
|
|
140
|
-
*/
|
|
141
|
-
export declare function convertColumnsToLegacy(columns: Record<string, any>): Record<string, string>;
|
|
142
|
-
/**
|
|
143
|
-
* Converts any unified JSON mapping format to legacy JsonMapping format.
|
|
144
|
-
*
|
|
145
|
-
* This universal converter handles Enhanced, Unified, and Legacy formats, providing
|
|
146
|
-
* a single interface for converting complex mapping configurations to the simple
|
|
147
|
-
* format expected by PostgresJsonQueryBuilder.
|
|
148
|
-
*
|
|
149
|
-
* **Supported Input Formats:**
|
|
150
|
-
* - **Enhanced**: With metadata, type protection, and advanced column configs
|
|
151
|
-
* - **Unified**: Standard format with rootName and rootEntity
|
|
152
|
-
* - **Legacy**: Already compatible format (returned as-is)
|
|
153
|
-
*
|
|
154
|
-
* **Features:**
|
|
155
|
-
* - Automatic format detection
|
|
156
|
-
* - Column configuration simplification
|
|
157
|
-
* - Nested entity handling
|
|
158
|
-
* - Type protection extraction
|
|
159
|
-
*
|
|
160
|
-
* @param input - JSON mapping in any supported format
|
|
161
|
-
* @returns Legacy JsonMapping compatible with PostgresJsonQueryBuilder
|
|
162
|
-
*
|
|
163
|
-
* @throws {Error} When input is null, undefined, or malformed
|
|
164
|
-
*
|
|
165
|
-
* @example
|
|
166
|
-
* ```typescript
|
|
167
|
-
* // Enhanced format input
|
|
168
|
-
* const enhanced = {
|
|
169
|
-
* rootName: "User",
|
|
170
|
-
* rootEntity: {
|
|
171
|
-
* columns: {
|
|
172
|
-
* id: { column: "u.user_id", type: "number" },
|
|
173
|
-
* name: { column: "u.user_name", type: "string" }
|
|
174
|
-
* }
|
|
175
|
-
* },
|
|
176
|
-
* metadata: { version: "2.0" }
|
|
177
|
-
* };
|
|
178
|
-
*
|
|
179
|
-
* const legacy = convertToLegacyJsonMapping(enhanced);
|
|
180
|
-
* // Result: Compatible with PostgresJsonQueryBuilder
|
|
181
|
-
* ```
|
|
182
|
-
*
|
|
183
|
-
* @see {@link convertColumnsToLegacy} For column-specific conversion
|
|
184
|
-
* @see {@link extractTypeProtection} For type safety features
|
|
185
|
-
*/
|
|
186
|
-
export declare function convertToLegacyJsonMapping(input: any): LegacyJsonMapping;
|
|
187
|
-
/**
|
|
188
|
-
* Converts enhanced mapping to legacy format for backward compatibility.
|
|
189
|
-
*/
|
|
190
|
-
export declare function toLegacyMapping(enhanced: EnhancedJsonMapping): LegacyJsonMapping;
|
|
191
|
-
/**
|
|
192
|
-
* Extracts type protection configuration from enhanced mapping.
|
|
193
|
-
*/
|
|
194
|
-
export declare function extractTypeProtection(enhanced: EnhancedJsonMapping): TypeProtectionConfig;
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enhanced JSON mapping structure that extends the base JsonMapping interface
|
|
3
|
-
* with additional metadata and type safety features.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Converts enhanced column configurations to simple string mappings for legacy compatibility.
|
|
7
|
-
*
|
|
8
|
-
* This function transforms complex column configurations (with type info, nullable flags, etc.)
|
|
9
|
-
* into simple string mappings that can be used with PostgresJsonQueryBuilder.
|
|
10
|
-
*
|
|
11
|
-
* **Supported Input Formats:**
|
|
12
|
-
* - Simple strings: `"user_name"` → `"user_name"`
|
|
13
|
-
* - Column config: `{ column: "u.name", type: "string" }` → `"u.name"`
|
|
14
|
-
* - From config: `{ from: "user_name", nullable: true }` → `"user_name"`
|
|
15
|
-
*
|
|
16
|
-
* @param columns - Record of field names to column configurations
|
|
17
|
-
* @returns Record of field names to column source strings
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* const enhanced = {
|
|
22
|
-
* id: { column: "u.user_id", type: "number" },
|
|
23
|
-
* name: { from: "user_name", type: "string" },
|
|
24
|
-
* email: "email_address"
|
|
25
|
-
* };
|
|
26
|
-
*
|
|
27
|
-
* const legacy = convertColumnsToLegacy(enhanced);
|
|
28
|
-
* // Result: { id: "u.user_id", name: "user_name", email: "email_address" }
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export function convertColumnsToLegacy(columns) {
|
|
32
|
-
const result = {};
|
|
33
|
-
for (const [key, config] of Object.entries(columns)) {
|
|
34
|
-
if (typeof config === 'string') {
|
|
35
|
-
result[key] = config;
|
|
36
|
-
}
|
|
37
|
-
else if (config && typeof config === 'object') {
|
|
38
|
-
if ('column' in config) {
|
|
39
|
-
result[key] = config.column;
|
|
40
|
-
}
|
|
41
|
-
else if ('from' in config) {
|
|
42
|
-
result[key] = config.from;
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
result[key] = key; // fallback
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
result[key] = key; // fallback
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return result;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Converts any unified JSON mapping format to legacy JsonMapping format.
|
|
56
|
-
*
|
|
57
|
-
* This universal converter handles Enhanced, Unified, and Legacy formats, providing
|
|
58
|
-
* a single interface for converting complex mapping configurations to the simple
|
|
59
|
-
* format expected by PostgresJsonQueryBuilder.
|
|
60
|
-
*
|
|
61
|
-
* **Supported Input Formats:**
|
|
62
|
-
* - **Enhanced**: With metadata, type protection, and advanced column configs
|
|
63
|
-
* - **Unified**: Standard format with rootName and rootEntity
|
|
64
|
-
* - **Legacy**: Already compatible format (returned as-is)
|
|
65
|
-
*
|
|
66
|
-
* **Features:**
|
|
67
|
-
* - Automatic format detection
|
|
68
|
-
* - Column configuration simplification
|
|
69
|
-
* - Nested entity handling
|
|
70
|
-
* - Type protection extraction
|
|
71
|
-
*
|
|
72
|
-
* @param input - JSON mapping in any supported format
|
|
73
|
-
* @returns Legacy JsonMapping compatible with PostgresJsonQueryBuilder
|
|
74
|
-
*
|
|
75
|
-
* @throws {Error} When input is null, undefined, or malformed
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```typescript
|
|
79
|
-
* // Enhanced format input
|
|
80
|
-
* const enhanced = {
|
|
81
|
-
* rootName: "User",
|
|
82
|
-
* rootEntity: {
|
|
83
|
-
* columns: {
|
|
84
|
-
* id: { column: "u.user_id", type: "number" },
|
|
85
|
-
* name: { column: "u.user_name", type: "string" }
|
|
86
|
-
* }
|
|
87
|
-
* },
|
|
88
|
-
* metadata: { version: "2.0" }
|
|
89
|
-
* };
|
|
90
|
-
*
|
|
91
|
-
* const legacy = convertToLegacyJsonMapping(enhanced);
|
|
92
|
-
* // Result: Compatible with PostgresJsonQueryBuilder
|
|
93
|
-
* ```
|
|
94
|
-
*
|
|
95
|
-
* @see {@link convertColumnsToLegacy} For column-specific conversion
|
|
96
|
-
* @see {@link extractTypeProtection} For type safety features
|
|
97
|
-
*/
|
|
98
|
-
export function convertToLegacyJsonMapping(input) {
|
|
99
|
-
if (!input) {
|
|
100
|
-
throw new Error('Input mapping is required');
|
|
101
|
-
}
|
|
102
|
-
// If it's already in legacy format, return as-is
|
|
103
|
-
if (input.rootName && input.rootEntity &&
|
|
104
|
-
typeof input.rootEntity.columns === 'object' &&
|
|
105
|
-
!input.typeInfo && !input.typeProtection && !input.metadata) {
|
|
106
|
-
// Check if columns are already in string format
|
|
107
|
-
const allColumnsAreStrings = Object.values(input.rootEntity.columns).every(col => typeof col === 'string');
|
|
108
|
-
if (allColumnsAreStrings) {
|
|
109
|
-
return input;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
// Enhanced format conversion
|
|
113
|
-
if (input.rootName && input.rootEntity) {
|
|
114
|
-
return {
|
|
115
|
-
rootName: input.rootName,
|
|
116
|
-
rootEntity: {
|
|
117
|
-
id: input.rootEntity.id || 'root',
|
|
118
|
-
name: input.rootEntity.name || input.rootName,
|
|
119
|
-
columns: convertColumnsToLegacy(input.rootEntity.columns || {})
|
|
120
|
-
},
|
|
121
|
-
nestedEntities: (input.nestedEntities || []).map((entity) => ({
|
|
122
|
-
id: entity.id,
|
|
123
|
-
name: entity.name,
|
|
124
|
-
parentId: entity.parentId,
|
|
125
|
-
propertyName: entity.propertyName,
|
|
126
|
-
relationshipType: entity.relationshipType,
|
|
127
|
-
columns: convertColumnsToLegacy(entity.columns || {})
|
|
128
|
-
})),
|
|
129
|
-
resultFormat: input.resultFormat,
|
|
130
|
-
emptyResult: input.emptyResult
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
throw new Error('Unsupported mapping format');
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Converts enhanced mapping to legacy format for backward compatibility.
|
|
137
|
-
*/
|
|
138
|
-
export function toLegacyMapping(enhanced) {
|
|
139
|
-
return {
|
|
140
|
-
rootName: enhanced.rootName,
|
|
141
|
-
rootEntity: {
|
|
142
|
-
id: enhanced.rootEntity.id,
|
|
143
|
-
name: enhanced.rootEntity.name,
|
|
144
|
-
columns: convertColumnsToLegacy(enhanced.rootEntity.columns)
|
|
145
|
-
},
|
|
146
|
-
nestedEntities: enhanced.nestedEntities.map(entity => ({
|
|
147
|
-
id: entity.id,
|
|
148
|
-
name: entity.name,
|
|
149
|
-
parentId: entity.parentId,
|
|
150
|
-
propertyName: entity.propertyName,
|
|
151
|
-
relationshipType: entity.relationshipType,
|
|
152
|
-
columns: convertColumnsToLegacy(entity.columns)
|
|
153
|
-
})),
|
|
154
|
-
resultFormat: enhanced.resultFormat,
|
|
155
|
-
emptyResult: enhanced.emptyResult
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Extracts type protection configuration from enhanced mapping.
|
|
160
|
-
*/
|
|
161
|
-
export function extractTypeProtection(enhanced) {
|
|
162
|
-
const protectedStringFields = [];
|
|
163
|
-
const dateFields = [];
|
|
164
|
-
const numberFields = [];
|
|
165
|
-
// Use existing type protection if available
|
|
166
|
-
if (enhanced.typeProtection) {
|
|
167
|
-
return {
|
|
168
|
-
protectedStringFields: enhanced.typeProtection.protectedStringFields || [],
|
|
169
|
-
dateFields: enhanced.typeProtection.dateFields,
|
|
170
|
-
numberFields: enhanced.typeProtection.numberFields,
|
|
171
|
-
customTransforms: enhanced.typeProtection.customTransforms
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
// Process root entity
|
|
175
|
-
for (const [key, config] of Object.entries(enhanced.rootEntity.columns)) {
|
|
176
|
-
if (typeof config === 'object' && config.type) {
|
|
177
|
-
const columnName = config.column;
|
|
178
|
-
switch (config.type) {
|
|
179
|
-
case 'string':
|
|
180
|
-
protectedStringFields.push(columnName);
|
|
181
|
-
break;
|
|
182
|
-
case 'date':
|
|
183
|
-
dateFields.push(columnName);
|
|
184
|
-
break;
|
|
185
|
-
case 'number':
|
|
186
|
-
numberFields.push(columnName);
|
|
187
|
-
break;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
// Process nested entities
|
|
192
|
-
for (const entity of enhanced.nestedEntities) {
|
|
193
|
-
for (const [key, config] of Object.entries(entity.columns)) {
|
|
194
|
-
if (typeof config === 'object' && config.type) {
|
|
195
|
-
const columnName = config.column;
|
|
196
|
-
switch (config.type) {
|
|
197
|
-
case 'string':
|
|
198
|
-
protectedStringFields.push(columnName);
|
|
199
|
-
break;
|
|
200
|
-
case 'date':
|
|
201
|
-
dateFields.push(columnName);
|
|
202
|
-
break;
|
|
203
|
-
case 'number':
|
|
204
|
-
numberFields.push(columnName);
|
|
205
|
-
break;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
return {
|
|
211
|
-
protectedStringFields,
|
|
212
|
-
dateFields: dateFields.length > 0 ? dateFields : undefined,
|
|
213
|
-
numberFields: numberFields.length > 0 ? numberFields : undefined,
|
|
214
|
-
customTransforms: undefined
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
//# sourceMappingURL=EnhancedJsonMapping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnhancedJsonMapping.js","sourceRoot":"","sources":["../../../src/transformers/EnhancedJsonMapping.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoHH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAA4B;IAC/D,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAClD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;QACzB,CAAC;aAAM,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,Q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