@solidxai/core 0.1.11-beta.1 → 0.1.11-beta.4
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/.claude/settings.local.json +16 -0
- package/CLAUDE.md +26 -0
- package/dist/controllers/datasource-introspection.controller.d.ts +38 -1
- package/dist/controllers/datasource-introspection.controller.d.ts.map +1 -1
- package/dist/controllers/datasource-introspection.controller.js +38 -0
- package/dist/controllers/datasource-introspection.controller.js.map +1 -1
- package/dist/controllers/service.controller.d.ts +1 -0
- package/dist/controllers/service.controller.d.ts.map +1 -1
- package/dist/controllers/service.controller.js +2 -2
- package/dist/controllers/service.controller.js.map +1 -1
- package/dist/dtos/datasource-introspection-mapping.dto.d.ts +4 -0
- package/dist/dtos/datasource-introspection-mapping.dto.d.ts.map +1 -1
- package/dist/dtos/datasource-introspection-mapping.dto.js +18 -2
- package/dist/dtos/datasource-introspection-mapping.dto.js.map +1 -1
- package/dist/entities/{legacy-common-with-id.entity.d.ts → legacy-common-with-generated-id.entity.d.ts} +2 -2
- package/dist/entities/legacy-common-with-generated-id.entity.d.ts.map +1 -0
- package/dist/entities/{legacy-common-with-id.entity.js → legacy-common-with-generated-id.entity.js} +4 -4
- package/dist/entities/legacy-common-with-generated-id.entity.js.map +1 -0
- package/dist/entities/{legacy-common.entity.d.ts → legacy-common.entity-with-existing-id.entity.d.ts} +1 -1
- package/dist/entities/legacy-common.entity-with-existing-id.entity.d.ts.map +1 -0
- package/dist/entities/{legacy-common.entity.js → legacy-common.entity-with-existing-id.entity.js} +1 -1
- package/dist/entities/legacy-common.entity-with-existing-id.entity.js.map +1 -0
- package/dist/helpers/field-crud-managers/IntFieldCrudManager.d.ts.map +1 -1
- package/dist/helpers/field-crud-managers/IntFieldCrudManager.js +4 -1
- package/dist/helpers/field-crud-managers/IntFieldCrudManager.js.map +1 -1
- package/dist/helpers/model-metadata-helper.service.js +3 -3
- package/dist/helpers/model-metadata-helper.service.js.map +1 -1
- package/dist/helpers/solid-registry.d.ts +2 -1
- package/dist/helpers/solid-registry.d.ts.map +1 -1
- package/dist/helpers/solid-registry.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces/datasource-introspection-provider.interface.d.ts +1 -0
- package/dist/interfaces/datasource-introspection-provider.interface.d.ts.map +1 -1
- package/dist/interfaces/datasource-introspection-provider.interface.js.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.d.ts +5 -1
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +61 -3
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +19 -3
- package/dist/services/computed-fields/entity/alpha-num-external-id-computed-field-provider.d.ts.map +1 -1
- package/dist/services/computed-fields/entity/alpha-num-external-id-computed-field-provider.js +6 -5
- package/dist/services/computed-fields/entity/alpha-num-external-id-computed-field-provider.js.map +1 -1
- package/dist/services/datasource-introspection/mssql-datasource-introspection-provider.service.d.ts.map +1 -1
- package/dist/services/datasource-introspection/mssql-datasource-introspection-provider.service.js +12 -0
- package/dist/services/datasource-introspection/mssql-datasource-introspection-provider.service.js.map +1 -1
- package/dist/services/datasource-introspection/mysql-datasource-introspection-provider.service.d.ts.map +1 -1
- package/dist/services/datasource-introspection/mysql-datasource-introspection-provider.service.js +2 -0
- package/dist/services/datasource-introspection/mysql-datasource-introspection-provider.service.js.map +1 -1
- package/dist/services/datasource-introspection/postgres-datasource-introspection-provider.service.d.ts.map +1 -1
- package/dist/services/datasource-introspection/postgres-datasource-introspection-provider.service.js +28 -15
- package/dist/services/datasource-introspection/postgres-datasource-introspection-provider.service.js.map +1 -1
- package/dist/services/datasource-introspection.service.d.ts +52 -2
- package/dist/services/datasource-introspection.service.d.ts.map +1 -1
- package/dist/services/datasource-introspection.service.js +534 -160
- package/dist/services/datasource-introspection.service.js.map +1 -1
- package/dist/services/locale.service.d.ts +14 -0
- package/dist/services/locale.service.d.ts.map +1 -1
- package/dist/services/locale.service.js +83 -0
- package/dist/services/locale.service.js.map +1 -1
- package/dist/services/mediaStorageProviders/file-s3-storage-provider.js +10 -10
- package/dist/services/mediaStorageProviders/file-s3-storage-provider.js.map +1 -1
- package/dist/services/role-metadata.service.d.ts +1 -0
- package/dist/services/role-metadata.service.d.ts.map +1 -1
- package/dist/services/role-metadata.service.js +23 -2
- package/dist/services/role-metadata.service.js.map +1 -1
- package/dist/services/view-metadata.service.d.ts.map +1 -1
- package/dist/services/view-metadata.service.js +4 -7
- package/dist/services/view-metadata.service.js.map +1 -1
- package/dist/subscribers/audit.subscriber.d.ts +2 -0
- package/dist/subscribers/audit.subscriber.d.ts.map +1 -1
- package/dist/subscribers/audit.subscriber.js +25 -6
- package/dist/subscribers/audit.subscriber.js.map +1 -1
- package/dist/subscribers/computed-entity-field.subscriber.d.ts.map +1 -1
- package/dist/subscribers/computed-entity-field.subscriber.js +1 -0
- package/dist/subscribers/computed-entity-field.subscriber.js.map +1 -1
- package/dist/subscribers/created-by-updated-by.subscriber.d.ts.map +1 -1
- package/dist/subscribers/created-by-updated-by.subscriber.js.map +1 -1
- package/dist/subscribers/field-metadata.subscriber.d.ts.map +1 -1
- package/dist/subscribers/field-metadata.subscriber.js.map +1 -1
- package/package.json +1 -1
- package/src/controllers/datasource-introspection.controller.ts +27 -1
- package/src/controllers/service.controller.ts +3 -2
- package/src/dtos/datasource-introspection-mapping.dto.ts +10 -0
- package/src/entities/{legacy-common-with-id.entity.ts → legacy-common-with-generated-id.entity.ts} +1 -1
- package/src/helpers/field-crud-managers/IntFieldCrudManager.ts +4 -1
- package/src/helpers/model-metadata-helper.service.ts +1 -1
- package/src/helpers/solid-registry.ts +7 -1
- package/src/index.ts +2 -2
- package/src/interfaces/datasource-introspection-provider.interface.ts +1 -0
- package/src/seeders/module-metadata-seeder.service.ts +72 -2
- package/src/seeders/seed-data/solid-core-metadata.json +19 -3
- package/src/services/1.js +6 -0
- package/src/services/computed-fields/entity/alpha-num-external-id-computed-field-provider.ts +10 -5
- package/src/services/datasource-introspection/mssql-datasource-introspection-provider.service.ts +12 -0
- package/src/services/datasource-introspection/mysql-datasource-introspection-provider.service.ts +2 -0
- package/src/services/datasource-introspection/postgres-datasource-introspection-provider.service.ts +28 -15
- package/src/services/datasource-introspection.service.ts +626 -136
- package/src/services/locale.service.ts +111 -3
- package/src/services/mediaStorageProviders/file-s3-storage-provider.ts +2 -2
- package/src/services/role-metadata.service.ts +26 -2
- package/src/services/view-metadata.service.ts +4 -8
- package/src/subscribers/audit.subscriber.ts +34 -14
- package/src/subscribers/computed-entity-field.subscriber.ts +1 -0
- package/src/subscribers/created-by-updated-by.subscriber.ts +3 -0
- package/src/subscribers/field-metadata.subscriber.ts +3 -0
- package/dist/entities/legacy-common-with-id.entity.d.ts.map +0 -1
- package/dist/entities/legacy-common-with-id.entity.js.map +0 -1
- package/dist/entities/legacy-common.entity.d.ts.map +0 -1
- package/dist/entities/legacy-common.entity.js.map +0 -1
- package/dist-tests/api/authenticate.spec.js +0 -119
- package/dist-tests/api/authenticate.spec.js.map +0 -1
- package/dist-tests/api/crud-service.findOne.cityMaster.spec.js +0 -97
- package/dist-tests/api/crud-service.findOne.cityMaster.spec.js.map +0 -1
- package/dist-tests/api/ping.spec.js +0 -21
- package/dist-tests/api/ping.spec.js.map +0 -1
- package/dist-tests/helpers/auth.js +0 -41
- package/dist-tests/helpers/auth.js.map +0 -1
- package/dist-tests/helpers/env.js +0 -11
- package/dist-tests/helpers/env.js.map +0 -1
- package/docs/agent-hub-grooming.md +0 -301
- package/docs/dashboards/AGENTIC_DASHBOARD_IMPLEMENTATION_PLAN.md +0 -438
- package/docs/dashboards/dashboard-curl-smoke-tests.txt +0 -146
- package/docs/dashboards/delete-legacy-dashboard-metadata.sql +0 -172
- package/docs/datasource-introspection-ddl-analysis.md +0 -326
- package/docs/datasource-introspection-implementation-plan.md +0 -306
- package/docs/grouping-enhancements.md +0 -89
- package/docs/java-spring/README.md +0 -3
- package/docs/java-spring/solid-core-module-deep-dive-report.md +0 -1317
- package/docs/module-package-import-handoff.md +0 -691
- package/docs/seed-changes.md +0 -65
- package/docs/test-data-workflow.md +0 -200
- package/docs/type-declaration-import-issue.md +0 -24
- /package/src/entities/{legacy-common.entity.ts → legacy-common.entity-with-existing-id.entity.ts} +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(node -e:*)",
|
|
5
|
+
"WebFetch(domain:docs.solidxai.com)",
|
|
6
|
+
"WebFetch(domain:github.com)",
|
|
7
|
+
"Read(//Users/oswald/projects/Solid_Starters/solidctl/**)",
|
|
8
|
+
"Read(//Users/oswald/projects/Solid_Starters/**)",
|
|
9
|
+
"Bash(find /Users/oswald/projects/Solid_Starters/solid-core-module -type d -name migration* -o -name *database*)",
|
|
10
|
+
"Bash(node verify-imports.js)"
|
|
11
|
+
],
|
|
12
|
+
"additionalDirectories": [
|
|
13
|
+
"/Users/oswald/projects/Solid_Starters/solidctl"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# This is the SolidX API project.
|
|
2
|
+
This is included as a dependency in consuming projects.
|
|
3
|
+
|
|
4
|
+
# SolidX UI
|
|
5
|
+
# The corresponding UI project is at the below path:
|
|
6
|
+
/Users/oswald/projects/Solid_Starters/solid-core-ui
|
|
7
|
+
|
|
8
|
+
# SolidX Docs
|
|
9
|
+
# The documentation project is at the below path:
|
|
10
|
+
/Users/oswald/projects/solidxai-docs
|
|
11
|
+
|
|
12
|
+
# SolidX Agent
|
|
13
|
+
# The agent project which has the skills for helping users configure, build and use SolidX is at the below path:
|
|
14
|
+
/Users/oswald/projects/Solid_Starters/agent
|
|
15
|
+
|
|
16
|
+
# SolidX Control Plane Commands
|
|
17
|
+
# The control plane commands for managing SolidX instances are in the below path:
|
|
18
|
+
/Users/oswald/projects/Solid_Starters/solidctl
|
|
19
|
+
|
|
20
|
+
# Testing reference project
|
|
21
|
+
# This is the reference library management project that is used for testing and development of SolidX features. It is located at the below path:
|
|
22
|
+
/Users/oswald/projects/Solid_Starters/solid-library-management
|
|
23
|
+
|
|
24
|
+
# Code Builder project
|
|
25
|
+
# This is the project that contains the code builder which generates code based on user input and templates. It is located at the below path:
|
|
26
|
+
/Users/oswald/projects/Solid_Starters/solid-code-builder
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatasourceIntrospectionMappingDto } from "../dtos/datasource-introspection-mapping.dto";
|
|
1
|
+
import { DatasourceIntrospectionMappingDto, DatasourceIntrospectionRunMigrationDto } from "../dtos/datasource-introspection-mapping.dto";
|
|
2
2
|
import { DatasourceIntrospectionService } from "../services/datasource-introspection.service";
|
|
3
3
|
export declare class DatasourceIntrospectionController {
|
|
4
4
|
private readonly datasourceIntrospectionService;
|
|
@@ -137,6 +137,7 @@ export declare class DatasourceIntrospectionController {
|
|
|
137
137
|
columns: {
|
|
138
138
|
columnName: string;
|
|
139
139
|
fieldName: string;
|
|
140
|
+
displayName: string;
|
|
140
141
|
dataType: string;
|
|
141
142
|
solidFieldType: string;
|
|
142
143
|
ormType: string;
|
|
@@ -147,6 +148,7 @@ export declare class DatasourceIntrospectionController {
|
|
|
147
148
|
numericScale: number | null;
|
|
148
149
|
ordinalPosition: number | null;
|
|
149
150
|
isAutoGenerated: boolean;
|
|
151
|
+
isPrimaryKey: boolean;
|
|
150
152
|
handledBySuperclass: boolean;
|
|
151
153
|
superclassFieldName: string | null;
|
|
152
154
|
}[];
|
|
@@ -211,6 +213,18 @@ export declare class DatasourceIntrospectionController {
|
|
|
211
213
|
filePath: string;
|
|
212
214
|
model: Record<string, any>;
|
|
213
215
|
};
|
|
216
|
+
summary: {
|
|
217
|
+
includedColumnNames: string[];
|
|
218
|
+
removedColumnNames: string[];
|
|
219
|
+
missingSystemColumns: string[];
|
|
220
|
+
generatedSystemColumnCount: number;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
}>;
|
|
224
|
+
createMigrationArtifacts(moduleId: number, mappingDto: DatasourceIntrospectionMappingDto): Promise<{
|
|
225
|
+
data: {
|
|
226
|
+
modelId: number;
|
|
227
|
+
operation: "create" | "update";
|
|
214
228
|
migration: {
|
|
215
229
|
written: boolean;
|
|
216
230
|
willGenerate: boolean;
|
|
@@ -222,6 +236,13 @@ export declare class DatasourceIntrospectionController {
|
|
|
222
236
|
note: string;
|
|
223
237
|
missingSystemColumns: string[];
|
|
224
238
|
};
|
|
239
|
+
datasourceFile: {
|
|
240
|
+
filePath: string;
|
|
241
|
+
created: boolean;
|
|
242
|
+
updated: boolean;
|
|
243
|
+
entityRegistered: boolean;
|
|
244
|
+
migrationGlobRegistered: boolean;
|
|
245
|
+
};
|
|
225
246
|
summary: {
|
|
226
247
|
includedColumnNames: string[];
|
|
227
248
|
removedColumnNames: string[];
|
|
@@ -230,5 +251,21 @@ export declare class DatasourceIntrospectionController {
|
|
|
230
251
|
};
|
|
231
252
|
};
|
|
232
253
|
}>;
|
|
254
|
+
generateCode(moduleId: number): Promise<{
|
|
255
|
+
data: {
|
|
256
|
+
moduleId: number;
|
|
257
|
+
output: string;
|
|
258
|
+
message: string;
|
|
259
|
+
};
|
|
260
|
+
}>;
|
|
261
|
+
runMigration(moduleId: number, payload: DatasourceIntrospectionRunMigrationDto): Promise<{
|
|
262
|
+
data: {
|
|
263
|
+
moduleId: number;
|
|
264
|
+
datasource: string;
|
|
265
|
+
output: string;
|
|
266
|
+
command: string;
|
|
267
|
+
message: string;
|
|
268
|
+
};
|
|
269
|
+
}>;
|
|
233
270
|
}
|
|
234
271
|
//# sourceMappingURL=datasource-introspection.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource-introspection.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/datasource-introspection.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"datasource-introspection.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/datasource-introspection.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,sCAAsC,EAAE,MAAM,8CAA8C,CAAC;AACzI,OAAO,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AAE9F,qBAEa,iCAAiC;IAEtC,OAAO,CAAC,QAAQ,CAAC,8BAA8B;gBAA9B,8BAA8B,EAAE,8BAA8B;IAKnF,YAAY,CACyB,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;IAOrD,SAAS,CAC4B,QAAQ,EAAE,MAAM,EAC5B,cAAc,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAO/C,cAAc,CACuB,QAAQ,EAAE,MAAM,EAC5B,cAAc,EAAE,MAAM,EAC3B,SAAS,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAOpC,cAAc,CACuB,QAAQ,EAAE,MAAM,EACzC,UAAU,EAAE,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;IAOzD,YAAY,CACyB,QAAQ,EAAE,MAAM,EACzC,UAAU,EAAE,iCAAiC;;;;;;;;;;;;;;;;IAOzD,wBAAwB,CACa,QAAQ,EAAE,MAAM,EACzC,UAAU,EAAE,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAOzD,YAAY,CACyB,QAAQ,EAAE,MAAM;;;;;;;IAOrD,YAAY,CACyB,QAAQ,EAAE,MAAM,EACzC,OAAO,EAAE,sCAAsC;;;;;;;;;CAI9D"}
|
|
@@ -37,6 +37,15 @@ let DatasourceIntrospectionController = class DatasourceIntrospectionController
|
|
|
37
37
|
applyMapping(moduleId, mappingDto) {
|
|
38
38
|
return this.datasourceIntrospectionService.applyMapping(moduleId, mappingDto);
|
|
39
39
|
}
|
|
40
|
+
createMigrationArtifacts(moduleId, mappingDto) {
|
|
41
|
+
return this.datasourceIntrospectionService.createMigrationArtifacts(moduleId, mappingDto);
|
|
42
|
+
}
|
|
43
|
+
generateCode(moduleId) {
|
|
44
|
+
return this.datasourceIntrospectionService.generateCode(moduleId);
|
|
45
|
+
}
|
|
46
|
+
runMigration(moduleId, payload) {
|
|
47
|
+
return this.datasourceIntrospectionService.runMigration(moduleId, payload.datasource);
|
|
48
|
+
}
|
|
40
49
|
};
|
|
41
50
|
exports.DatasourceIntrospectionController = DatasourceIntrospectionController;
|
|
42
51
|
__decorate([
|
|
@@ -90,6 +99,35 @@ __decorate([
|
|
|
90
99
|
__metadata("design:paramtypes", [Number, datasource_introspection_mapping_dto_1.DatasourceIntrospectionMappingDto]),
|
|
91
100
|
__metadata("design:returntype", void 0)
|
|
92
101
|
], DatasourceIntrospectionController.prototype, "applyMapping", null);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
104
|
+
(0, common_1.Post)("modules/:moduleId/create-migration-artifacts"),
|
|
105
|
+
openapi.ApiResponse({ status: 201 }),
|
|
106
|
+
__param(0, (0, common_1.Param)("moduleId", common_1.ParseIntPipe)),
|
|
107
|
+
__param(1, (0, common_1.Body)()),
|
|
108
|
+
__metadata("design:type", Function),
|
|
109
|
+
__metadata("design:paramtypes", [Number, datasource_introspection_mapping_dto_1.DatasourceIntrospectionMappingDto]),
|
|
110
|
+
__metadata("design:returntype", void 0)
|
|
111
|
+
], DatasourceIntrospectionController.prototype, "createMigrationArtifacts", null);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
114
|
+
(0, common_1.Post)("modules/:moduleId/generate-code"),
|
|
115
|
+
openapi.ApiResponse({ status: 201 }),
|
|
116
|
+
__param(0, (0, common_1.Param)("moduleId", common_1.ParseIntPipe)),
|
|
117
|
+
__metadata("design:type", Function),
|
|
118
|
+
__metadata("design:paramtypes", [Number]),
|
|
119
|
+
__metadata("design:returntype", void 0)
|
|
120
|
+
], DatasourceIntrospectionController.prototype, "generateCode", null);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
123
|
+
(0, common_1.Post)("modules/:moduleId/run-migration"),
|
|
124
|
+
openapi.ApiResponse({ status: 201 }),
|
|
125
|
+
__param(0, (0, common_1.Param)("moduleId", common_1.ParseIntPipe)),
|
|
126
|
+
__param(1, (0, common_1.Body)()),
|
|
127
|
+
__metadata("design:type", Function),
|
|
128
|
+
__metadata("design:paramtypes", [Number, datasource_introspection_mapping_dto_1.DatasourceIntrospectionRunMigrationDto]),
|
|
129
|
+
__metadata("design:returntype", void 0)
|
|
130
|
+
], DatasourceIntrospectionController.prototype, "runMigration", null);
|
|
93
131
|
exports.DatasourceIntrospectionController = DatasourceIntrospectionController = __decorate([
|
|
94
132
|
(0, common_1.Controller)("datasource-introspection"),
|
|
95
133
|
(0, swagger_1.ApiTags)("Solid Core"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource-introspection.controller.js","sourceRoot":"","sources":["../../src/controllers/datasource-introspection.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyF;AACzF,6CAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"datasource-introspection.controller.js","sourceRoot":"","sources":["../../src/controllers/datasource-introspection.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyF;AACzF,6CAAyD;AACzD,uGAAyI;AACzI,mGAA8F;AAIvF,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAC1C,YACqB,8BAA8D;QAA9D,mCAA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C,KAAK,CAAC;IACpB,IAAA,aAAI,EAAC,iCAAiC,CAAC;;IAEnC,WAAA,IAAA,cAAK,EAAC,UAAU,EAAE,qBAAY,CAAC,CAAA;;;;qEAGnC;AAID;IAFC,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,aAAI,EAAC,iCAAiC,CAAC;;IAEnC,WAAA,IAAA,cAAK,EAAC,UAAU,EAAE,qBAAY,CAAC,CAAA;IAC/B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAU,6EAAsC;;qEAG1D;4CA3EQ,iCAAiC;IAF7C,IAAA,mBAAU,EAAC,0BAA0B,CAAC;IACtC,IAAA,iBAAO,EAAC,YAAY,CAAC;qCAGmC,iEAA8B;GAF1E,iCAAiC,CA4E7C","sourcesContent":["import { Body, Controller, Get, Param, ParseIntPipe, Post, Query } from \"@nestjs/common\";\nimport { ApiBearerAuth, ApiTags } from \"@nestjs/swagger\";\nimport { DatasourceIntrospectionMappingDto, DatasourceIntrospectionRunMigrationDto } from \"../dtos/datasource-introspection-mapping.dto\";\nimport { DatasourceIntrospectionService } from \"../services/datasource-introspection.service\";\n\n@Controller(\"datasource-introspection\")\n@ApiTags(\"Solid Core\")\nexport class DatasourceIntrospectionController {\n constructor(\n private readonly datasourceIntrospectionService: DatasourceIntrospectionService,\n ) { }\n\n @ApiBearerAuth(\"jwt\")\n @Get(\"modules/:moduleId/bootstrap\")\n getBootstrap(\n @Param(\"moduleId\", ParseIntPipe) moduleId: number,\n ) {\n return this.datasourceIntrospectionService.getBootstrap(moduleId);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(\"modules/:moduleId/tables\")\n getTables(\n @Param(\"moduleId\", ParseIntPipe) moduleId: number,\n @Query(\"datasource\") datasourceName: string,\n ) {\n return this.datasourceIntrospectionService.getTables(moduleId, datasourceName);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(\"modules/:moduleId/table-detail\")\n getTableDetail(\n @Param(\"moduleId\", ParseIntPipe) moduleId: number,\n @Query(\"datasource\") datasourceName: string,\n @Query(\"table\") tableName: string,\n @Query(\"schema\") schema?: string,\n ) {\n return this.datasourceIntrospectionService.getTableDetail(moduleId, datasourceName, tableName, schema);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post(\"modules/:moduleId/mapping-preview\")\n previewMapping(\n @Param(\"moduleId\", ParseIntPipe) moduleId: number,\n @Body() mappingDto: DatasourceIntrospectionMappingDto,\n ) {\n return this.datasourceIntrospectionService.previewMapping(moduleId, mappingDto);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post(\"modules/:moduleId/apply-mapping\")\n applyMapping(\n @Param(\"moduleId\", ParseIntPipe) moduleId: number,\n @Body() mappingDto: DatasourceIntrospectionMappingDto,\n ) {\n return this.datasourceIntrospectionService.applyMapping(moduleId, mappingDto);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post(\"modules/:moduleId/create-migration-artifacts\")\n createMigrationArtifacts(\n @Param(\"moduleId\", ParseIntPipe) moduleId: number,\n @Body() mappingDto: DatasourceIntrospectionMappingDto,\n ) {\n return this.datasourceIntrospectionService.createMigrationArtifacts(moduleId, mappingDto);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post(\"modules/:moduleId/generate-code\")\n generateCode(\n @Param(\"moduleId\", ParseIntPipe) moduleId: number,\n ) {\n return this.datasourceIntrospectionService.generateCode(moduleId);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post(\"modules/:moduleId/run-migration\")\n runMigration(\n @Param(\"moduleId\", ParseIntPipe) moduleId: number,\n @Body() payload: DatasourceIntrospectionRunMigrationDto,\n ) {\n return this.datasourceIntrospectionService.runMigration(moduleId, payload.datasource);\n }\n}\n"]}
|
|
@@ -4,6 +4,7 @@ import { SolidRegistry } from '../helpers/solid-registry';
|
|
|
4
4
|
export interface PostProcessCodeGenConfig {
|
|
5
5
|
runModuleMetadataSeeder?: boolean;
|
|
6
6
|
runSolidIngestion?: boolean;
|
|
7
|
+
modulesToSeed?: string[];
|
|
7
8
|
}
|
|
8
9
|
export declare class ServiceController {
|
|
9
10
|
private readonly solidRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/service.controller.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,WAAW,wBAAwB;IACrC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"service.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/service.controller.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,WAAW,wBAAwB;IACrC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AACD,qBAIa,iBAAiB;IAItB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW;IALhC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsC;gBAGxC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,kBAAkB;IAKpD,QAAQ;;;IA+DF,QAAQ,CAAS,QAAQ,EAAE,GAAG;;;IAkB9B,yBAAyB,CAAS,MAAM,EAAE,wBAAwB;CAmD3E"}
|
|
@@ -43,7 +43,7 @@ let ServiceController = ServiceController_1 = class ServiceController {
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
this.logger.log(`Running the seed() method for seeder :${seeder.constructor.name}`);
|
|
46
|
-
await seeder.seed();
|
|
46
|
+
await seeder.seed({ modulesToSeed: seedData?.modulesToSeed });
|
|
47
47
|
return { message: `seed data for ${seederName}` };
|
|
48
48
|
}
|
|
49
49
|
async postProcessCodeGeneration(config) {
|
|
@@ -60,7 +60,7 @@ let ServiceController = ServiceController_1 = class ServiceController {
|
|
|
60
60
|
this.logger.error(`Seeder service ModuleMetadataSeederService not found. Does your service have a seed() method?`);
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
63
|
-
await seeder.seed();
|
|
63
|
+
await seeder.seed({ modulesToSeed: config.modulesToSeed });
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.controller.js","sourceRoot":"","sources":["../../src/controllers/service.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAqE;AACrE,6CAAyD;AAEzD,qEAAyD;AACzD,0EAAsE;AAEtE,uEAAmE;AACnE,8DAA0D;
|
|
1
|
+
{"version":3,"file":"service.controller.js","sourceRoot":"","sources":["../../src/controllers/service.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAqE;AACrE,6CAAyD;AAEzD,qEAAyD;AACzD,0EAAsE;AAEtE,uEAAmE;AACnE,8DAA0D;AAWnD,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAG1B,YACqB,aAA4B,EAC5B,gBAAkC,EAClC,WAA+B;QAF/B,kBAAa,GAAb,aAAa,CAAe;QAC5B,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,gBAAW,GAAX,WAAW,CAAoB;QALnC,WAAM,GAAG,IAAI,eAAM,CAAC,mBAAiB,CAAC,IAAI,CAAC,CAAC;IAMzD,CAAC;IAIL,QAAQ;QACJ,OAAO,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K,6BAA6B,CAAC;iBACjE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC;iBAChC,GAAG,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,+FAA+F,CAAC,CAAC;YACvH,CAAC;iBAAM,CAAC;gBACJ,MAAM,MAAM,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;YAC/D,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qFAAqF,CAAC,CAAC;QAC7G,CAAC;QAGD,IAAI,MAAM,CAAC,iBAAiB,EAAE,CAAC;YAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,6EAA6E,CAAC,CAAC;QAKrG,CAAC;IACL,CAAC;CAqBJ,CAAA;AA/IY,8CAAiB;AAW1B;IAFC,IAAA,yBAAM,GAAE;IACR,IAAA,YAAG,EAAC,MAAM,CAAC;;;;;iDAGX;AA6DK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,aAAI,EAAC,MAAM,CAAC;;IACG,WAAA,IAAA,aAAI,GAAE,CAAA;;;;iDAcrB;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,aAAI,EAAC,8BAA8B,CAAC;;IACJ,WAAA,IAAA,aAAI,GAAE,CAAA;;;;kEA8BtC;4BA1HQ,iBAAiB;IAJ7B,IAAA,mBAAU,EAAC,EAAE,CAAC;IACd,IAAA,iBAAO,EAAC,YAAY,CAAC;qCAOkB,8BAAa;QACV,qCAAgB;QACrB,yCAAkB;GAN3C,iBAAiB,CA+I7B","sourcesContent":["import { Body, Controller, Get, Logger, Post } from '@nestjs/common';\nimport { ApiBearerAuth, ApiTags } from '@nestjs/swagger';\nimport { ActiveUser } from 'src/decorators/active-user.decorator';\nimport { Public } from 'src/decorators/public.decorator';\nimport { ErrorMapperService } from 'src/helpers/error-mapper.service';\nimport { ActiveUserData } from 'src/interfaces/active-user-data.interface';\nimport { MqMessageService } from 'src/services/mq-message.service';\nimport { SolidRegistry } from '../helpers/solid-registry';\n\nexport interface PostProcessCodeGenConfig {\n runModuleMetadataSeeder?: boolean; // If true, regenerate module metadata\n runSolidIngestion?: boolean; // If true, run solid ingestion command\n modulesToSeed?: string[]; // If provided, only seed these specific modules\n}\n@Controller('')\n@ApiTags(\"Solid Core\")\n// @UseGuards(ThrottlerGuard)\n// @SkipThrottle({ short: true, login: true, burst: true, sustained: true }) // Skip all\nexport class ServiceController {\n private readonly logger = new Logger(ServiceController.name);\n\n constructor(\n private readonly solidRegistry: SolidRegistry,\n private readonly mqMessageService: MqMessageService,\n private readonly errorMapper: ErrorMapperService,\n ) { }\n\n @Public()\n @Get('ping')\n pingPong() {\n return { pong: 'v1.0.2' };\n }\n\n // @ApiBearerAuth(\"jwt\")\n // @Get('mcp/ping')\n // async mcpPingPong(@ActiveUser() activeUser: ActiveUserData) {\n // // TODO: do a MCP client invocation, wait for response and return.\n // // If failure then decide shape to return.\n\n // const threadId = `pingPongTxn-${activeUser.sub}`;\n // const dto = { prompt: \"Can you do 1 + 1\", moduleName: \"solidCoreModule\" }\n // const { queueMessageId, aiInteractionId } = await this.aiInteractionService.triggerMcpClientJob(\n // dto,\n // activeUser.sub,\n // true,\n // threadId\n // );\n\n // this.logger.debug(`mcp ping pong job triggered: queueMessageId=${queueMessageId}, aiInteractionId=${aiInteractionId}`);\n\n // // Wait up to 2 minutes, start at 500ms poll, back off to max 2s, throw if failed:\n // const result = await this.mqMessageService.waitForTerminalStatus(queueMessageId, {\n // timeoutMs: 2 * 60 * 1000,\n // intervalMs: 500,\n // maxIntervalMs: 2000,\n // throwOnFailure: false,\n // });\n\n // this.logger.debug(`mcp ping pong job finished with stage=${result.stage}`)\n\n // this.logger.debug(`mcp ping pong trying to find genai (child) interaction for aiInteraction for id=${aiInteractionId}`)\n\n // // @ts-ignore\n // const genAiInteractions = await this.aiInteractionService.find({\n // filters: {\n // parentInteraction: {\n // id: {\n // $eq: aiInteractionId\n // }\n // }\n // }\n // });\n\n // const genAiInteraction = genAiInteractions['records'][0];\n // this.logger.debug(genAiInteraction.message);\n\n // this.logger.debug(`identified gen-ai interaction with id=${genAiInteraction.id}`);\n // this.logger.debug(`proceeding with applying the gen-ai interaction`)\n\n // return {\n // mcpPong: 'v1.0.2',\n // genAiInteraction: {\n // status: genAiInteraction.status,\n // errorCode: genAiInteraction.status === 'failed' ? this.errorMapper.mapMessage(genAiInteraction.errorMessage, genAiInteraction.metadata) : '',\n // errorMessage: genAiInteraction.errorMessage,\n // }\n // };\n // }\n\n // @SkipThrottle({ short: false, login: true, burst: true, sustained: true }) //Enable the short throttle only\n @ApiBearerAuth(\"jwt\")\n @Post('seed')\n async seedData(@Body() seedData: any) {\n const seederName = seedData?.seeder ?? 'ModuleMetadataSeederService';\n const seeder = this.solidRegistry\n .getSeeders()\n .filter((seeder) => seeder.name === seederName)\n .map((seeder) => seeder.instance)\n .pop();\n if (!seeder) {\n this.logger.error(`Seeder service ${seederName} not found. Does your service have a seed() method?`);\n return;\n }\n this.logger.log(`Running the seed() method for seeder :${seeder.constructor.name}`);\n await seeder.seed({ modulesToSeed: seedData?.modulesToSeed });\n return { message: `seed data for ${seederName}` };\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('code-generation/post-process')\n async postProcessCodeGeneration(@Body() config: PostProcessCodeGenConfig) {\n // Set defaults if not provided\n config.runModuleMetadataSeeder = config.runModuleMetadataSeeder ?? true;\n config.runSolidIngestion = config.runSolidIngestion ?? true;\n\n // Run the Module Metadata Seeder Service\n if (config.runModuleMetadataSeeder) {\n this.logger.debug(`Running the Module Metadata Seeder Service as part of post-process code generation`);\n const seeder = this.solidRegistry\n .getSeeders()\n .filter((seeder) => seeder.name === 'ModuleMetadataSeederService')\n .map((seeder) => seeder.instance)\n .pop();\n if (!seeder) {\n this.logger.error(`Seeder service ModuleMetadataSeederService not found. Does your service have a seed() method?`);\n } else {\n await seeder.seed({ modulesToSeed: config.modulesToSeed });\n }\n } else {\n this.logger.debug(`Skipping the Module Metadata Seeder Service as part of post-process code generation`);\n }\n\n // Run the Solid ingestion command\n if (config.runSolidIngestion) {\n this.logger.debug(`Running the Solid ingestion command as part of post-process code generation`);\n\n // TODO: disabled this till we figure out a way to make this stable...\n // This keeps failing for a variety of reasons... \n // await this.ingestMetadataService.ingest();\n }\n }\n\n\n // @Public()\n // @Get('play')\n // play() {\n // return this.solidRegistry.getControllers();\n // }\n\n // //This method identifies a provider as a seeder if it has a seed method i.e duck typing\n // private isSeeder(provider: InstanceWrapper) {\n // const { instance } = provider;\n // if (!instance) return false;\n\n // const seedMethod = this.metadataScanner\n // .getAllMethodNames(Object.getPrototypeOf(instance))\n // .find((methodName) => methodName === 'seed');\n // if (!seedMethod) return false;\n // return true;\n // }\n\n}\n"]}
|
|
@@ -3,6 +3,7 @@ import { LegacyTableType } from "../enums/legacy-table-type.enum";
|
|
|
3
3
|
export declare class DatasourceIntrospectionMappingColumnDto {
|
|
4
4
|
columnName: string;
|
|
5
5
|
fieldName: string;
|
|
6
|
+
displayName: string;
|
|
6
7
|
dataType: string;
|
|
7
8
|
solidFieldType: SolidFieldType;
|
|
8
9
|
ormType: OrmType;
|
|
@@ -42,4 +43,7 @@ export declare class DatasourceIntrospectionMappingDto {
|
|
|
42
43
|
columns: DatasourceIntrospectionMappingColumnDto[];
|
|
43
44
|
reviewedModel?: Record<string, any>;
|
|
44
45
|
}
|
|
46
|
+
export declare class DatasourceIntrospectionRunMigrationDto {
|
|
47
|
+
datasource: string;
|
|
48
|
+
}
|
|
45
49
|
//# sourceMappingURL=datasource-introspection-mapping.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource-introspection-mapping.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/datasource-introspection-mapping.dto.ts"],"names":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C,EAAE,MAAM,GAAG,IAAI,CAAC;IAIxB,OAAO,EAAE,OAAO,CAAC;IAIjB,OAAO,EAAE,OAAO,CAAC;IAIjB,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,qBAAa,iCAAiC;IAG1C,MAAM,EAAE,OAAO,CAAC;IAKhB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAIxB,YAAY,EAAE,MAAM,CAAC;IAIrB,UAAU,EAAE,MAAM,CAAC;IAInB,WAAW,EAAE,MAAM,CAAC;IAIpB,WAAW,EAAE,MAAM,CAAC;IAIpB,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAIvB,UAAU,EAAE,MAAM,CAAC;IAInB,cAAc,EAAE,MAAM,CAAC;IAIvB,eAAe,EAAE,eAAe,CAAC;IAIjC,aAAa,EAAE,MAAM,CAAC;IAItB,YAAY,EAAE,MAAM,CAAC;IAIrB,mBAAmB,EAAE,OAAO,CAAC;IAI7B,gBAAgB,EAAE,OAAO,CAAC;IAI1B,oBAAoB,EAAE,OAAO,CAAC;IAI9B,oBAAoB,EAAE,OAAO,CAAC;IAK9B,yBAAyB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAM1C,OAAO,EAAE,uCAAuC,EAAE,CAAC;IAKnD,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACvC;AAED,qBAAa,sCAAsC;IAG/C,UAAU,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.DatasourceIntrospectionMappingDto = exports.DatasourceIntrospectionMappingColumnDto = void 0;
|
|
12
|
+
exports.DatasourceIntrospectionRunMigrationDto = exports.DatasourceIntrospectionMappingDto = exports.DatasourceIntrospectionMappingColumnDto = void 0;
|
|
13
13
|
const openapi = require("@nestjs/swagger");
|
|
14
14
|
const swagger_1 = require("@nestjs/swagger");
|
|
15
15
|
const class_transformer_1 = require("class-transformer");
|
|
@@ -18,7 +18,7 @@ const create_field_metadata_dto_1 = require("./create-field-metadata.dto");
|
|
|
18
18
|
const legacy_table_type_enum_1 = require("../enums/legacy-table-type.enum");
|
|
19
19
|
class DatasourceIntrospectionMappingColumnDto {
|
|
20
20
|
static _OPENAPI_METADATA_FACTORY() {
|
|
21
|
-
return { columnName: { required: true, type: () => String }, fieldName: { required: true, type: () => String }, dataType: { required: true, type: () => String }, solidFieldType: { required: true, enum: require("./create-field-metadata.dto").SolidFieldType }, ormType: { required: true, type: () => Object }, nullable: { required: true, type: () => Boolean }, defaultValue: { required: false, type: () => String, nullable: true }, characterMaximumLength: { required: false, type: () => Number, nullable: true }, numericPrecision: { required: false, type: () => Number, nullable: true }, numericScale: { required: false, type: () => Number, nullable: true }, ordinalPosition: { required: false, type: () => Number, nullable: true }, isAutoGenerated: { required: true, type: () => Boolean }, handledBySuperclass: { required: true, type: () => Boolean }, superclassFieldName: { required: false, type: () => String, nullable: true }, fieldId: { required: false, type: () => Number, nullable: true }, include: { required: true, type: () => Boolean }, matched: { required: true, type: () => Boolean }, isPrimaryKey: { required: true, type: () => Boolean } };
|
|
21
|
+
return { columnName: { required: true, type: () => String }, fieldName: { required: true, type: () => String }, displayName: { required: true, type: () => String }, dataType: { required: true, type: () => String }, solidFieldType: { required: true, enum: require("./create-field-metadata.dto").SolidFieldType }, ormType: { required: true, type: () => Object }, nullable: { required: true, type: () => Boolean }, defaultValue: { required: false, type: () => String, nullable: true }, characterMaximumLength: { required: false, type: () => Number, nullable: true }, numericPrecision: { required: false, type: () => Number, nullable: true }, numericScale: { required: false, type: () => Number, nullable: true }, ordinalPosition: { required: false, type: () => Number, nullable: true }, isAutoGenerated: { required: true, type: () => Boolean }, handledBySuperclass: { required: true, type: () => Boolean }, superclassFieldName: { required: false, type: () => String, nullable: true }, fieldId: { required: false, type: () => Number, nullable: true }, include: { required: true, type: () => Boolean }, matched: { required: true, type: () => Boolean }, isPrimaryKey: { required: true, type: () => Boolean } };
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
exports.DatasourceIntrospectionMappingColumnDto = DatasourceIntrospectionMappingColumnDto;
|
|
@@ -32,6 +32,11 @@ __decorate([
|
|
|
32
32
|
(0, class_validator_1.IsString)(),
|
|
33
33
|
__metadata("design:type", String)
|
|
34
34
|
], DatasourceIntrospectionMappingColumnDto.prototype, "fieldName", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, swagger_1.ApiProperty)(),
|
|
37
|
+
(0, class_validator_1.IsString)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], DatasourceIntrospectionMappingColumnDto.prototype, "displayName", void 0);
|
|
35
40
|
__decorate([
|
|
36
41
|
(0, swagger_1.ApiProperty)(),
|
|
37
42
|
(0, class_validator_1.IsString)(),
|
|
@@ -230,4 +235,15 @@ __decorate([
|
|
|
230
235
|
(0, class_validator_1.IsObject)(),
|
|
231
236
|
__metadata("design:type", Object)
|
|
232
237
|
], DatasourceIntrospectionMappingDto.prototype, "reviewedModel", void 0);
|
|
238
|
+
class DatasourceIntrospectionRunMigrationDto {
|
|
239
|
+
static _OPENAPI_METADATA_FACTORY() {
|
|
240
|
+
return { datasource: { required: true, type: () => String } };
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
exports.DatasourceIntrospectionRunMigrationDto = DatasourceIntrospectionRunMigrationDto;
|
|
244
|
+
__decorate([
|
|
245
|
+
(0, swagger_1.ApiProperty)(),
|
|
246
|
+
(0, class_validator_1.IsString)(),
|
|
247
|
+
__metadata("design:type", String)
|
|
248
|
+
], DatasourceIntrospectionRunMigrationDto.prototype, "datasource", void 0);
|
|
233
249
|
//# sourceMappingURL=datasource-introspection-mapping.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource-introspection-mapping.dto.js","sourceRoot":"","sources":["../../src/dtos/datasource-introspection-mapping.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,yDAAyC;AACzC,qDASyB;AACzB,2EAAsE;AACtE,4EAAmE;AAEnE,MAAa,uCAAuC;;;;
|
|
1
|
+
{"version":3,"file":"datasource-introspection-mapping.dto.js","sourceRoot":"","sources":["../../src/dtos/datasource-introspection-mapping.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,yDAAyC;AACzC,qDASyB;AACzB,2EAAsE;AACtE,4EAAmE;AAEnE,MAAa,uCAAuC;;;;CAkFnD;AAlFD,0FAkFC;AA/EG;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;2EACQ;AAInB;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;0EACO;AAIlB;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;4EACS;AAIpB;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;yEACM;AAIjB;IAFC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,0CAAc,EAAE,CAAC;IACrC,IAAA,wBAAM,EAAC,0CAAc,CAAC;;+EACQ;AAI/B;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;wEACM;AAIjB;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,2BAAS,GAAE;;yEACM;AAIlB;IAFC,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAChD,IAAA,4BAAU,GAAE;;6EACgB;AAK7B;IAHC,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAChD,IAAA,4BAAU,GAA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AAW,GAAE;IACb,IAAA,2BAAS,GAAE;;+EACkB;AAK9B;IAHC,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAChD,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;;oFACkC;AAM1C;IAJC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,uCAAuC,CAAC,EAAE,CAAC;IACtE,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,uCAAuC,CAAC;;kEACD;AAKnD;IAHC,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAChD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wEACyB;AAGxC,MAAa,sCAAsC;;;;CAIlD;AAJD,wFAIC;AADG;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;0EACQ","sourcesContent":["import { ApiProperty } from \"@nestjs/swagger\";\nimport { Type } from \"class-transformer\";\nimport {\n IsArray,\n IsBoolean,\n IsEnum,\n IsInt,\n IsObject,\n IsOptional,\n IsString,\n ValidateNested,\n} from \"class-validator\";\nimport { OrmType, SolidFieldType } from \"./create-field-metadata.dto\";\nimport { LegacyTableType } from \"src/enums/legacy-table-type.enum\";\n\nexport class DatasourceIntrospectionMappingColumnDto {\n @ApiProperty()\n @IsString()\n columnName: string;\n\n @ApiProperty()\n @IsString()\n fieldName: string;\n\n @ApiProperty()\n @IsString()\n displayName: string;\n\n @ApiProperty()\n @IsString()\n dataType: string;\n\n @ApiProperty({ enum: SolidFieldType })\n @IsEnum(SolidFieldType)\n solidFieldType: SolidFieldType;\n\n @ApiProperty()\n @IsString()\n ormType: OrmType;\n\n @ApiProperty()\n @IsBoolean()\n nullable: boolean;\n\n @ApiProperty({ required: false, nullable: true })\n @IsOptional()\n defaultValue?: string | null;\n\n @ApiProperty({ required: false, nullable: true })\n @IsOptional()\n @IsInt()\n characterMaximumLength?: number | null;\n\n @ApiProperty({ required: false, nullable: true })\n @IsOptional()\n @IsInt()\n numericPrecision?: number | null;\n\n @ApiProperty({ required: false, nullable: true })\n @IsOptional()\n @IsInt()\n numericScale?: number | null;\n\n @ApiProperty({ required: false, nullable: true })\n @IsOptional()\n @IsInt()\n ordinalPosition?: number | null;\n\n @ApiProperty()\n @IsBoolean()\n isAutoGenerated: boolean;\n\n @ApiProperty()\n @IsBoolean()\n handledBySuperclass: boolean;\n\n @ApiProperty({ required: false, nullable: true })\n @IsOptional()\n @IsString()\n superclassFieldName?: string | null;\n\n @ApiProperty({ required: false, nullable: true })\n @IsOptional()\n @IsInt()\n fieldId?: number | null;\n\n @ApiProperty()\n @IsBoolean()\n include: boolean;\n\n @ApiProperty()\n @IsBoolean()\n matched: boolean;\n\n @ApiProperty()\n @IsBoolean()\n isPrimaryKey: boolean;\n}\n\nexport class DatasourceIntrospectionMappingDto {\n @ApiProperty()\n @IsBoolean()\n mapped: boolean;\n\n @ApiProperty({ required: false, nullable: true })\n @IsOptional()\n @IsInt()\n modelId?: number | null;\n\n @ApiProperty()\n @IsString()\n singularName: string;\n\n @ApiProperty()\n @IsString()\n pluralName: string;\n\n @ApiProperty()\n @IsString()\n displayName: string;\n\n @ApiProperty()\n @IsString()\n description: string;\n\n @ApiProperty()\n @IsString()\n tableName: string;\n\n @ApiProperty({ required: false, nullable: true })\n @IsOptional()\n @IsString()\n schema?: string | null;\n\n @ApiProperty()\n @IsString()\n dataSource: string;\n\n @ApiProperty()\n @IsString()\n dataSourceType: string;\n\n @ApiProperty({ enum: LegacyTableType })\n @IsEnum(LegacyTableType)\n legacyTableType: LegacyTableType;\n\n @ApiProperty()\n @IsString()\n baseClassName: string;\n\n @ApiProperty()\n @IsString()\n userKeyField: string;\n\n @ApiProperty()\n @IsBoolean()\n enableAuditTracking: boolean;\n\n @ApiProperty()\n @IsBoolean()\n enableSoftDelete: boolean;\n\n @ApiProperty()\n @IsBoolean()\n draftPublishWorkflow: boolean;\n\n @ApiProperty()\n @IsBoolean()\n internationalisation: boolean;\n\n @ApiProperty({ required: false, nullable: true })\n @IsOptional()\n @IsInt()\n plannedMigrationTimestamp?: number | null;\n\n @ApiProperty({ type: () => [DatasourceIntrospectionMappingColumnDto] })\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => DatasourceIntrospectionMappingColumnDto)\n columns: DatasourceIntrospectionMappingColumnDto[];\n\n @ApiProperty({ required: false, type: \"object\" })\n @IsOptional()\n @IsObject()\n reviewedModel?: Record<string, any>;\n}\n\nexport class DatasourceIntrospectionRunMigrationDto {\n @ApiProperty()\n @IsString()\n datasource: string;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LegacyCommonEntityWithExistingId } from "./legacy-common.entity";
|
|
1
|
+
import { LegacyCommonEntityWithExistingId } from "./legacy-common.entity-with-existing-id.entity";
|
|
2
2
|
export declare abstract class LegacyCommonEntityWithGeneratedId extends LegacyCommonEntityWithExistingId {
|
|
3
3
|
id: number;
|
|
4
4
|
}
|
|
5
|
-
//# sourceMappingURL=legacy-common-with-id.entity.d.ts.map
|
|
5
|
+
//# sourceMappingURL=legacy-common-with-generated-id.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-common-with-generated-id.entity.d.ts","sourceRoot":"","sources":["../../src/entities/legacy-common-with-generated-id.entity.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,gCAAgC,EAAE,MAAM,gDAAgD,CAAC;AAE9H,8BACsB,iCAAkC,SAAQ,gCAAgC;IAI5F,EAAE,EAAE,MAAM,CAAA;CACb"}
|
package/dist/entities/{legacy-common-with-id.entity.js → legacy-common-with-generated-id.entity.js}
RENAMED
|
@@ -13,8 +13,8 @@ exports.LegacyCommonEntityWithGeneratedId = void 0;
|
|
|
13
13
|
const openapi = require("@nestjs/swagger");
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
|
-
const
|
|
17
|
-
let LegacyCommonEntityWithGeneratedId = class LegacyCommonEntityWithGeneratedId extends
|
|
16
|
+
const legacy_common_entity_with_existing_id_entity_1 = require("./legacy-common.entity-with-existing-id.entity");
|
|
17
|
+
let LegacyCommonEntityWithGeneratedId = class LegacyCommonEntityWithGeneratedId extends legacy_common_entity_with_existing_id_entity_1.LegacyCommonEntityWithExistingId {
|
|
18
18
|
static _OPENAPI_METADATA_FACTORY() {
|
|
19
19
|
return { id: { required: true, type: () => Number } };
|
|
20
20
|
}
|
|
@@ -22,11 +22,11 @@ let LegacyCommonEntityWithGeneratedId = class LegacyCommonEntityWithGeneratedId
|
|
|
22
22
|
exports.LegacyCommonEntityWithGeneratedId = LegacyCommonEntityWithGeneratedId;
|
|
23
23
|
__decorate([
|
|
24
24
|
(0, class_transformer_1.Expose)(),
|
|
25
|
-
(0, typeorm_1.Column)({ type: 'integer', name: `${
|
|
25
|
+
(0, typeorm_1.Column)({ type: 'integer', name: `${legacy_common_entity_with_existing_id_entity_1.LEGACY_TABLE_FIELDS_PREFIX}_id`, unique: true }),
|
|
26
26
|
(0, typeorm_1.Generated)("increment"),
|
|
27
27
|
__metadata("design:type", Number)
|
|
28
28
|
], LegacyCommonEntityWithGeneratedId.prototype, "id", void 0);
|
|
29
29
|
exports.LegacyCommonEntityWithGeneratedId = LegacyCommonEntityWithGeneratedId = __decorate([
|
|
30
30
|
(0, class_transformer_1.Exclude)()
|
|
31
31
|
], LegacyCommonEntityWithGeneratedId);
|
|
32
|
-
//# sourceMappingURL=legacy-common-with-id.entity.js.map
|
|
32
|
+
//# sourceMappingURL=legacy-common-with-generated-id.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-common-with-generated-id.entity.js","sourceRoot":"","sources":["../../src/entities/legacy-common-with-generated-id.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAoD;AACpD,qCAA4C;AAC5C,iHAA8H;AAGvH,IAAe,iCAAiC,GAAhD,MAAe,iCAAkC,SAAQ,+EAAgC;;;;CAK/F,CAAA;AALqB,8EAAiC;AAInD;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,yEAA0B,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACnF,IAAA,mBAAS,EAAC,WAAW,CAAC;;6DACb;4CAJQ,iCAAiC;IADtD,IAAA,2BAAO,GAAE;GACY,iCAAiC,CAKtD","sourcesContent":["import { Exclude, Expose } from \"class-transformer\";\nimport { Column, Generated } from \"typeorm\";\nimport { LEGACY_TABLE_FIELDS_PREFIX, LegacyCommonEntityWithExistingId } from \"./legacy-common.entity-with-existing-id.entity\";\n\n@Exclude()\nexport abstract class LegacyCommonEntityWithGeneratedId extends LegacyCommonEntityWithExistingId {\n @Expose()\n @Column({ type: 'integer', name: `${LEGACY_TABLE_FIELDS_PREFIX}_id`, unique: true })\n @Generated(\"increment\")\n id: number\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-common.entity-with-existing-id.entity.d.ts","sourceRoot":"","sources":["../../src/entities/legacy-common.entity-with-existing-id.entity.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,8BACsB,gCAAgC;IAOlD,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAGvB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAIvB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAGvB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAI9B,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IAIzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAI1B,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IAgBrC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAIzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
|
package/dist/entities/{legacy-common.entity.js → legacy-common.entity-with-existing-id.entity.js}
RENAMED
|
@@ -66,4 +66,4 @@ __decorate([
|
|
|
66
66
|
exports.LegacyCommonEntityWithExistingId = LegacyCommonEntityWithExistingId = __decorate([
|
|
67
67
|
(0, class_transformer_1.Exclude)()
|
|
68
68
|
], LegacyCommonEntityWithExistingId);
|
|
69
|
-
//# sourceMappingURL=legacy-common.entity.js.map
|
|
69
|
+
//# sourceMappingURL=legacy-common.entity-with-existing-id.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-common.entity-with-existing-id.entity.js","sourceRoot":"","sources":["../../src/entities/legacy-common.entity-with-existing-id.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAoD;AACpD,qGAAgG;AAChG,qCAA8F;AAEjF,QAAA,0BAA0B,GAAG,IAAI,CAAC;AAGxC,IAAe,gCAAgC,GAA/C,MAAe,gCAAgC;;;;CAkDrD,CAAA;AAlDqB,4EAAgC;AAOlD;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,aAAa,EAAE,WAAW,EAAE,sDAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACnH,IAAI;mEAAQ;AAGvB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,aAAa,EAAE,WAAW,EAAE,sDAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACnH,IAAI;mEAAQ;AAIvB;IAFC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,aAAa,EAAE,WAAW,EAAE,sDAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7H,IAAA,eAAK,GAAE;8BACG,IAAI;mEAAQ;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,kBAAkB,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wEAC5E;AAI9B;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sDAAwB,EAAE,CAAC;8BACxH,IAAI;qEAAQ;AAIzB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,kCAA0B,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oEACpF;AAI1B;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,kCAA0B,2BAA2B,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+EAClF;AAgBrC;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mEACvD;AAIzB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mEACvD;2CAjDP,gCAAgC;IADrD,IAAA,2BAAO,GAAE;GACY,gCAAgC,CAkDrD","sourcesContent":["import { Exclude, Expose } from \"class-transformer\";\nimport { LocalDateTimeTransformer } from \"src/transformers/typeorm/local-date-time-transformer\";\nimport { Column, CreateDateColumn, DeleteDateColumn, Index, UpdateDateColumn } from \"typeorm\";\n\nexport const LEGACY_TABLE_FIELDS_PREFIX = 'ss';\n\n@Exclude()\nexport abstract class LegacyCommonEntityWithExistingId {\n // @Expose()\n // @Column({ type: 'integer', name: `${LEGACY_TABLE_FIELDS_PREFIX}_id`, unique: true })\n // @Generated(\"increment\")\n // id: number\n\n @CreateDateColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_created_at`, transformer: LocalDateTimeTransformer, nullable: true })\n createdAt: Date | null;\n\n @UpdateDateColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_updated_at`, transformer: LocalDateTimeTransformer, nullable: true })\n updatedAt: Date | null;\n\n @DeleteDateColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_deleted_at`, transformer: LocalDateTimeTransformer, nullable: true })\n @Index()\n deletedAt: Date | null;\n\n @Column({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_deleted_tracker`, default: \"not-deleted\", nullable: true })\n deletedTracker: string | null;\n\n @Expose()\n @Column({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_published_at`, default: null, nullable: true, transformer: LocalDateTimeTransformer })\n publishedAt: Date | null;\n\n @Expose()\n @Column({ type: \"varchar\", name: `${LEGACY_TABLE_FIELDS_PREFIX}_locale_name`, default: null, nullable: true })\n localeName: string | null;\n\n @Expose()\n @Column({ type: \"int\", name: `${LEGACY_TABLE_FIELDS_PREFIX}_default_entity_locale_id`, default: null, nullable: true })\n defaultEntityLocaleId: number | null;\n\n // @Expose()\n // @Type( () => require('./user.entity').User?.default ?? require('./user.entity').User )\n // @ManyToOne(() => require('./user.entity').User?.default ?? require('./user.entity').User, { nullable: true })\n // @JoinColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_created_by_id` })\n // createdBy: User;\n\n // @Expose()\n // @Type( () => require('./user.entity').User?.default ?? require('./user.entity').User )\n // @ManyToOne(() => require('./user.entity').User?.default ?? require('./user.entity').User, { nullable: true })\n // @JoinColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_updated_by_id` })\n // updatedBy: User; \n\n @Expose()\n @Column({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_created_by_id`, nullable: true })\n createdBy: number | null;\n\n @Expose()\n @Column({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_updated_by_id`, nullable: true })\n updatedBy: number | null;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntFieldCrudManager.d.ts","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/IntFieldCrudManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC5B,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,mBAAoB,YAAW,gBAAgB;IAE5C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,eAAe;IAGrD,QAAQ,CAAC,SAAS,EAAE,GAAG,GAAG,eAAe,EAAE;
|
|
1
|
+
{"version":3,"file":"IntFieldCrudManager.d.ts","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/IntFieldCrudManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC5B,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,mBAAoB,YAAW,gBAAgB;IAE5C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,eAAe;IAGrD,QAAQ,CAAC,SAAS,EAAE,GAAG,GAAG,eAAe,EAAE;IAQ3C,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,sBAAsB;IAQ9B,kBAAkB,CAAC,SAAS,EAAE,GAAG,GAAG,GAAG;IAKvC,OAAO,CAAC,oBAAoB;IAG5B,OAAO,CAAC,oBAAoB;IAG5B,OAAO,CAAC,yBAAyB;CAGpC"}
|
|
@@ -8,7 +8,10 @@ class IntFieldCrudManager {
|
|
|
8
8
|
}
|
|
9
9
|
validate(createDto) {
|
|
10
10
|
const fieldValue = createDto[this.options.fieldName];
|
|
11
|
-
|
|
11
|
+
if (typeof fieldValue === 'string' && /^\d+$/.test(fieldValue.trim())) {
|
|
12
|
+
createDto[this.options.fieldName] = Number.parseInt(fieldValue, 10);
|
|
13
|
+
}
|
|
14
|
+
return this.applyValidations(createDto[this.options.fieldName]);
|
|
12
15
|
}
|
|
13
16
|
applyValidations(fieldValue) {
|
|
14
17
|
const errors = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntFieldCrudManager.js","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/IntFieldCrudManager.ts"],"names":[],"mappings":";;;AAAA,qDAAuE;AAUvE,MAAa,mBAAmB;IAE5B,YAA6B,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;IACrD,CAAC;IAED,QAAQ,CAAC,SAAc;QACnB,MAAM,UAAU,GAAQ,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"IntFieldCrudManager.js","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/IntFieldCrudManager.ts"],"names":[],"mappings":";;;AAAA,qDAAuE;AAUvE,MAAa,mBAAmB;IAE5B,YAA6B,OAAwB;Q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AqB,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAChH,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,IAAA,qBAAG,EAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,6CAA6C,EAAE,CAAC,CAAA,CAAC,CAAC,WAAW,CAAC;QACxL,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,IAAA,qBAAG,EAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAE,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,8CAA8C,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAC3L,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,kBAAkB,CAAC,SAAc;QAC7B,OAAO,SAAS,CAAC;IACrB,CAAC;IAGO,oBAAoB;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;IAChC,CAAC;IACO,oBAAoB;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;IAChC,CAAC;IACO,yBAAyB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACjC,CAAC;CACJ;AA5CD,kDA4CC","sourcesContent":["import { isEmpty, isInt, isNotEmpty, max, min } from \"class-validator\";\nimport { FieldCrudManager, ValidationError } from \"src/interfaces\";\n\nexport interface IntFieldOptions {\n min: number | undefined | null;\n max: number | undefined | null;\n required: boolean | undefined | null;\n fieldName: string;\n}\n\nexport class IntFieldCrudManager implements FieldCrudManager {\n\n constructor(private readonly options: IntFieldOptions) {\n }\n\n validate(createDto: any): ValidationError[] {\n const fieldValue: any = createDto[this.options.fieldName];\n if (typeof fieldValue === 'string' && /^\\d+$/.test(fieldValue.trim())) {\n createDto[this.options.fieldName] = Number.parseInt(fieldValue, 10);\n }\n return this.applyValidations(createDto[this.options.fieldName]);\n }\n\n private applyValidations(fieldValue: any): ValidationError[] {\n const errors: ValidationError[] = [];\n this.isApplyRequiredValidation() && isEmpty(fieldValue) ? errors.push({ field: this.options.fieldName, error: `Field: ${this.options.fieldName} is required` }) : \"no errors\";\n if (isNotEmpty(fieldValue)) {\n errors.push(...this.applyFormatValidations(fieldValue));\n }\n return errors;\n }\n\n private applyFormatValidations(fieldValue: any): ValidationError[] {\n const errors: ValidationError[] = [];\n !isInt(fieldValue) ? errors.push({ field: this.options.fieldName, error: 'Field is not an int' }) : \"no errors\";\n (this.isApplyMinValidation() && !min(fieldValue, this.options.min)) ? errors.push({ field: this.options.fieldName, error: 'Field value is lesser than minimum required' }): \"no errors\"; \n (this.isApplyMaxValidation() && !max(fieldValue, this.options.max)) ? errors.push({ field: this.options.fieldName, error: 'Field value is greater than maximum required' }) : \"no errors\";\n return errors;\n }\n\n transformForCreate(createDto: any): any {\n return createDto;\n }\n\n // Validation to be applied\n private isApplyMinValidation(): boolean {\n return this.options.min > 0;\n }\n private isApplyMaxValidation(): boolean {\n return this.options.max > 0;\n }\n private isApplyRequiredValidation(): boolean {\n return this.options.required;\n }\n}\n"]}
|
|
@@ -16,7 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.ModelMetadataHelperService = void 0;
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
|
18
18
|
const lodash_1 = require("lodash");
|
|
19
|
-
const
|
|
19
|
+
const legacy_common_entity_with_existing_id_entity_1 = require("../entities/legacy-common.entity-with-existing-id.entity");
|
|
20
20
|
const legacy_table_type_enum_1 = require("../enums/legacy-table-type.enum");
|
|
21
21
|
const model_metadata_repository_1 = require("../repository/model-metadata.repository");
|
|
22
22
|
const solid_registry_1 = require("./solid-registry");
|
|
@@ -125,10 +125,10 @@ let ModelMetadataHelperService = ModelMetadataHelperService_1 = class ModelMetad
|
|
|
125
125
|
}
|
|
126
126
|
systemFieldsMetadata.forEach(field => {
|
|
127
127
|
if (field.name === 'createdBy' || field.name === 'updatedBy') {
|
|
128
|
-
field['columnName'] = `${
|
|
128
|
+
field['columnName'] = `${legacy_common_entity_with_existing_id_entity_1.LEGACY_TABLE_FIELDS_PREFIX}_${lodash_1._.snakeCase(field.name)}_id`;
|
|
129
129
|
}
|
|
130
130
|
else {
|
|
131
|
-
field['columnName'] = `${
|
|
131
|
+
field['columnName'] = `${legacy_common_entity_with_existing_id_entity_1.LEGACY_TABLE_FIELDS_PREFIX}_${lodash_1._.snakeCase(field.name)}`;
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
134
|
return systemFieldsMetadata;
|