@solidxai/core 0.1.11-beta.2 → 0.1.11-beta.5

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 (145) hide show
  1. package/dist/commands/migrate-removed-fields.command.d.ts +19 -0
  2. package/dist/commands/migrate-removed-fields.command.d.ts.map +1 -0
  3. package/dist/commands/migrate-removed-fields.command.js +77 -0
  4. package/dist/commands/migrate-removed-fields.command.js.map +1 -0
  5. package/dist/controllers/datasource-introspection.controller.d.ts +38 -1
  6. package/dist/controllers/datasource-introspection.controller.d.ts.map +1 -1
  7. package/dist/controllers/datasource-introspection.controller.js +38 -0
  8. package/dist/controllers/datasource-introspection.controller.js.map +1 -1
  9. package/dist/dtos/datasource-introspection-mapping.dto.d.ts +5 -0
  10. package/dist/dtos/datasource-introspection-mapping.dto.d.ts.map +1 -1
  11. package/dist/dtos/datasource-introspection-mapping.dto.js +24 -2
  12. package/dist/dtos/datasource-introspection-mapping.dto.js.map +1 -1
  13. package/dist/entities/{legacy-common-with-id.entity.d.ts → legacy-common-with-generated-id.entity.d.ts} +2 -2
  14. package/dist/entities/legacy-common-with-generated-id.entity.d.ts.map +1 -0
  15. package/dist/entities/{legacy-common-with-id.entity.js → legacy-common-with-generated-id.entity.js} +4 -4
  16. package/dist/entities/legacy-common-with-generated-id.entity.js.map +1 -0
  17. package/dist/entities/{legacy-common.entity.d.ts → legacy-common.entity-with-existing-id.entity.d.ts} +1 -1
  18. package/dist/entities/legacy-common.entity-with-existing-id.entity.d.ts.map +1 -0
  19. package/dist/entities/{legacy-common.entity.js → legacy-common.entity-with-existing-id.entity.js} +1 -1
  20. package/dist/entities/legacy-common.entity-with-existing-id.entity.js.map +1 -0
  21. package/dist/helpers/command.service.d.ts +2 -0
  22. package/dist/helpers/command.service.d.ts.map +1 -1
  23. package/dist/helpers/command.service.js +6 -2
  24. package/dist/helpers/command.service.js.map +1 -1
  25. package/dist/helpers/model-metadata-helper.service.js +3 -3
  26. package/dist/helpers/model-metadata-helper.service.js.map +1 -1
  27. package/dist/helpers/nodemon-heartbeat.d.ts +5 -0
  28. package/dist/helpers/nodemon-heartbeat.d.ts.map +1 -0
  29. package/dist/helpers/nodemon-heartbeat.js +67 -0
  30. package/dist/helpers/nodemon-heartbeat.js.map +1 -0
  31. package/dist/index.d.ts +3 -2
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +3 -2
  34. package/dist/index.js.map +1 -1
  35. package/dist/interfaces/datasource-introspection-provider.interface.d.ts +1 -0
  36. package/dist/interfaces/datasource-introspection-provider.interface.d.ts.map +1 -1
  37. package/dist/interfaces/datasource-introspection-provider.interface.js.map +1 -1
  38. package/dist/seeders/module-metadata-seeder.service.d.ts +7 -1
  39. package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
  40. package/dist/seeders/module-metadata-seeder.service.js +101 -1
  41. package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
  42. package/dist/seeders/seed-data/solid-core-metadata.json +121 -34
  43. package/dist/services/api-key.service.d.ts.map +1 -1
  44. package/dist/services/api-key.service.js.map +1 -1
  45. package/dist/services/computed-fields/entity/concat-entity-computed-field-provider.service.d.ts +4 -0
  46. package/dist/services/computed-fields/entity/concat-entity-computed-field-provider.service.d.ts.map +1 -1
  47. package/dist/services/computed-fields/entity/concat-entity-computed-field-provider.service.js +18 -1
  48. package/dist/services/computed-fields/entity/concat-entity-computed-field-provider.service.js.map +1 -1
  49. package/dist/services/crud.service.d.ts +1 -0
  50. package/dist/services/crud.service.d.ts.map +1 -1
  51. package/dist/services/crud.service.js +27 -0
  52. package/dist/services/crud.service.js.map +1 -1
  53. package/dist/services/datasource-introspection/mssql-datasource-introspection-provider.service.d.ts.map +1 -1
  54. package/dist/services/datasource-introspection/mssql-datasource-introspection-provider.service.js +12 -0
  55. package/dist/services/datasource-introspection/mssql-datasource-introspection-provider.service.js.map +1 -1
  56. package/dist/services/datasource-introspection/mysql-datasource-introspection-provider.service.d.ts.map +1 -1
  57. package/dist/services/datasource-introspection/mysql-datasource-introspection-provider.service.js +2 -0
  58. package/dist/services/datasource-introspection/mysql-datasource-introspection-provider.service.js.map +1 -1
  59. package/dist/services/datasource-introspection/postgres-datasource-introspection-provider.service.d.ts.map +1 -1
  60. package/dist/services/datasource-introspection/postgres-datasource-introspection-provider.service.js +28 -15
  61. package/dist/services/datasource-introspection/postgres-datasource-introspection-provider.service.js.map +1 -1
  62. package/dist/services/datasource-introspection.service.d.ts +53 -2
  63. package/dist/services/datasource-introspection.service.d.ts.map +1 -1
  64. package/dist/services/datasource-introspection.service.js +559 -174
  65. package/dist/services/datasource-introspection.service.js.map +1 -1
  66. package/dist/services/import-transaction.service.d.ts.map +1 -1
  67. package/dist/services/import-transaction.service.js +3 -0
  68. package/dist/services/import-transaction.service.js.map +1 -1
  69. package/dist/services/mediaStorageProviders/file-s3-storage-provider.js +10 -10
  70. package/dist/services/mediaStorageProviders/file-s3-storage-provider.js.map +1 -1
  71. package/dist/services/model-metadata.service.d.ts +1 -0
  72. package/dist/services/model-metadata.service.d.ts.map +1 -1
  73. package/dist/services/model-metadata.service.js +28 -0
  74. package/dist/services/model-metadata.service.js.map +1 -1
  75. package/dist/services/module-metadata.service.d.ts.map +1 -1
  76. package/dist/services/module-metadata.service.js +27 -0
  77. package/dist/services/module-metadata.service.js.map +1 -1
  78. package/dist/services/removed-field-migration.service.d.ts +30 -0
  79. package/dist/services/removed-field-migration.service.d.ts.map +1 -0
  80. package/dist/services/removed-field-migration.service.js +319 -0
  81. package/dist/services/removed-field-migration.service.js.map +1 -0
  82. package/dist/solid-core.module.d.ts.map +1 -1
  83. package/dist/solid-core.module.js +4 -0
  84. package/dist/solid-core.module.js.map +1 -1
  85. package/dist/subscribers/audit.subscriber.d.ts +4 -1
  86. package/dist/subscribers/audit.subscriber.d.ts.map +1 -1
  87. package/dist/subscribers/audit.subscriber.js +54 -6
  88. package/dist/subscribers/audit.subscriber.js.map +1 -1
  89. package/dist-tests/api/authenticate.spec.js +119 -0
  90. package/dist-tests/api/authenticate.spec.js.map +1 -0
  91. package/dist-tests/api/crud-service.findOne.cityMaster.spec.js +97 -0
  92. package/dist-tests/api/crud-service.findOne.cityMaster.spec.js.map +1 -0
  93. package/dist-tests/api/ping.spec.js +21 -0
  94. package/dist-tests/api/ping.spec.js.map +1 -0
  95. package/dist-tests/helpers/auth.js +41 -0
  96. package/dist-tests/helpers/auth.js.map +1 -0
  97. package/dist-tests/helpers/env.js +11 -0
  98. package/dist-tests/helpers/env.js.map +1 -0
  99. package/docs/agent-hub-grooming.md +301 -0
  100. package/docs/dashboards/AGENTIC_DASHBOARD_IMPLEMENTATION_PLAN.md +438 -0
  101. package/docs/dashboards/dashboard-curl-smoke-tests.txt +146 -0
  102. package/docs/dashboards/delete-legacy-dashboard-metadata.sql +172 -0
  103. package/docs/datasource-introspection-ddl-analysis.md +326 -0
  104. package/docs/datasource-introspection-implementation-plan.md +306 -0
  105. package/docs/grouping-enhancements.md +89 -0
  106. package/docs/java-spring/README.md +3 -0
  107. package/docs/java-spring/solid-core-module-deep-dive-report.md +1317 -0
  108. package/docs/module-package-import-handoff.md +691 -0
  109. package/docs/seed-changes.md +65 -0
  110. package/docs/test-data-workflow.md +200 -0
  111. package/docs/type-declaration-import-issue.md +24 -0
  112. package/package.json +1 -1
  113. package/src/commands/migrate-removed-fields.command.ts +81 -0
  114. package/src/controllers/datasource-introspection.controller.ts +27 -1
  115. package/src/dtos/datasource-introspection-mapping.dto.ts +15 -0
  116. package/src/entities/{legacy-common-with-id.entity.ts → legacy-common-with-generated-id.entity.ts} +1 -1
  117. package/src/helpers/command.service.ts +10 -2
  118. package/src/helpers/model-metadata-helper.service.ts +1 -1
  119. package/src/helpers/nodemon-heartbeat.ts +59 -0
  120. package/src/index.ts +3 -2
  121. package/src/interfaces/datasource-introspection-provider.interface.ts +1 -0
  122. package/src/seeders/module-metadata-seeder.service.ts +118 -0
  123. package/src/seeders/seed-data/solid-core-metadata.json +121 -34
  124. package/src/services/api-key.service.ts +36 -36
  125. package/src/services/computed-fields/entity/concat-entity-computed-field-provider.service.ts +15 -1
  126. package/src/services/crud.service.ts +36 -11
  127. package/src/services/datasource-introspection/mssql-datasource-introspection-provider.service.ts +12 -0
  128. package/src/services/datasource-introspection/mysql-datasource-introspection-provider.service.ts +2 -0
  129. package/src/services/datasource-introspection/postgres-datasource-introspection-provider.service.ts +28 -15
  130. package/src/services/datasource-introspection.service.ts +653 -150
  131. package/src/services/import-transaction.service.ts +5 -0
  132. package/src/services/mediaStorageProviders/file-s3-storage-provider.ts +2 -2
  133. package/src/services/model-metadata.service.ts +45 -1
  134. package/src/services/module-metadata.service.ts +35 -0
  135. package/src/services/removed-field-migration.service.ts +334 -0
  136. package/src/solid-core.module.ts +4 -0
  137. package/src/subscribers/audit.subscriber.ts +70 -5
  138. package/.claude/settings.local.json +0 -15
  139. package/CLAUDE.md +0 -26
  140. package/dist/entities/legacy-common-with-id.entity.d.ts.map +0 -1
  141. package/dist/entities/legacy-common-with-id.entity.js.map +0 -1
  142. package/dist/entities/legacy-common.entity.d.ts.map +0 -1
  143. package/dist/entities/legacy-common.entity.js.map +0 -1
  144. package/src/services/1.js +0 -6
  145. /package/src/entities/{legacy-common.entity.ts → legacy-common.entity-with-existing-id.entity.ts} +0 -0
@@ -0,0 +1,19 @@
1
+ import { CommandRunner } from "nest-commander";
2
+ import { RemovedFieldMigrationService } from "../services/removed-field-migration.service";
3
+ import { ModelMetadataService } from "../services/model-metadata.service";
4
+ interface CommandOptions {
5
+ name: string;
6
+ dryRun?: boolean;
7
+ }
8
+ export declare class MigrateRemovedFieldsCommand extends CommandRunner {
9
+ private readonly removedFieldMigrationService;
10
+ private readonly modelMetadataService;
11
+ constructor(removedFieldMigrationService: RemovedFieldMigrationService, modelMetadataService: ModelMetadataService);
12
+ private readonly logger;
13
+ run(_passedParam: string[], options?: CommandOptions): Promise<void>;
14
+ parseName(val: string): string;
15
+ parseDryRun(val: string): boolean;
16
+ private validate;
17
+ }
18
+ export {};
19
+ //# sourceMappingURL=migrate-removed-fields.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-removed-fields.command.d.ts","sourceRoot":"","sources":["../../src/commands/migrate-removed-fields.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAE5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,UAAU,cAAc;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,qBAIa,2BAA4B,SAAQ,aAAa;IAEtD,OAAO,CAAC,QAAQ,CAAC,4BAA4B;IAC7C,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBADpB,4BAA4B,EAAE,4BAA4B,EAC1D,oBAAoB,EAAE,oBAAoB;IAM/D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgD;IAEjE,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAmC1E,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAQ9B,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAKjC,OAAO,CAAC,QAAQ;CAMnB"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var MigrateRemovedFieldsCommand_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.MigrateRemovedFieldsCommand = void 0;
14
+ const common_1 = require("@nestjs/common");
15
+ const nest_commander_1 = require("nest-commander");
16
+ const removed_field_migration_service_1 = require("../services/removed-field-migration.service");
17
+ const helper_1 = require("./helper");
18
+ const model_metadata_service_1 = require("../services/model-metadata.service");
19
+ let MigrateRemovedFieldsCommand = MigrateRemovedFieldsCommand_1 = class MigrateRemovedFieldsCommand extends nest_commander_1.CommandRunner {
20
+ constructor(removedFieldMigrationService, modelMetadataService) {
21
+ super();
22
+ this.removedFieldMigrationService = removedFieldMigrationService;
23
+ this.modelMetadataService = modelMetadataService;
24
+ this.logger = new common_1.Logger(MigrateRemovedFieldsCommand_1.name);
25
+ }
26
+ async run(_passedParam, options) {
27
+ const errors = this.validate(options);
28
+ if (errors.length) {
29
+ errors.forEach((error) => this.logger.error(error));
30
+ return;
31
+ }
32
+ const dryRun = options?.dryRun ?? true;
33
+ const result = await this.removedFieldMigrationService.migrateMarkedFields(options.name, dryRun);
34
+ result.operations.forEach((operation) => this.logger.log(operation));
35
+ }
36
+ parseName(val) {
37
+ return val;
38
+ }
39
+ parseDryRun(val) {
40
+ this.logger.debug(`Dry run : ${val}`);
41
+ return val === "false" ? false : true;
42
+ }
43
+ validate(options) {
44
+ if (!options?.name) {
45
+ return [new helper_1.CommandError("Model Name is required")];
46
+ }
47
+ return [];
48
+ }
49
+ };
50
+ exports.MigrateRemovedFieldsCommand = MigrateRemovedFieldsCommand;
51
+ __decorate([
52
+ (0, nest_commander_1.Option)({
53
+ flags: "-n, --name <model name>",
54
+ description: "Model name (singularName) from the ss_model_metadata table",
55
+ }),
56
+ __metadata("design:type", Function),
57
+ __metadata("design:paramtypes", [String]),
58
+ __metadata("design:returntype", String)
59
+ ], MigrateRemovedFieldsCommand.prototype, "parseName", null);
60
+ __decorate([
61
+ (0, nest_commander_1.Option)({
62
+ flags: "-d, --dryRun [dry run]",
63
+ description: "Dry run the command",
64
+ }),
65
+ __metadata("design:type", Function),
66
+ __metadata("design:paramtypes", [String]),
67
+ __metadata("design:returntype", Boolean)
68
+ ], MigrateRemovedFieldsCommand.prototype, "parseDryRun", null);
69
+ exports.MigrateRemovedFieldsCommand = MigrateRemovedFieldsCommand = MigrateRemovedFieldsCommand_1 = __decorate([
70
+ (0, nest_commander_1.Command)({
71
+ name: "migrate-removed-fields",
72
+ description: "Drops live database artifacts for fields marked for removal and cleans the related metadata.",
73
+ }),
74
+ __metadata("design:paramtypes", [removed_field_migration_service_1.RemovedFieldMigrationService,
75
+ model_metadata_service_1.ModelMetadataService])
76
+ ], MigrateRemovedFieldsCommand);
77
+ //# sourceMappingURL=migrate-removed-fields.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-removed-fields.command.js","sourceRoot":"","sources":["../../src/commands/migrate-removed-fields.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAwC;AACxC,mDAAgE;AAChE,iGAA4F;AAC5F,qCAAwC;AACxC,+EAA2E;AAWpE,IAAM,2BAA2B,mCAAjC,MAAM,2BAA4B,SAAQ,8BAAa;IAC1D,YACqB,4BAA0D,EAC1D,oBAA0C;QAG3D,KAAK,EAAE,CAAC;QAJS,iCAA4B,GAA5B,4BAA4B,CAA8B;QAC1D,yBAAoB,GAApB,oBAAoB,CAAsB;QAM9C,WAAM,GAAG,IAAI,eAAM,CAAC,6BAA2B,CAAC,IAAI,CAAC,CAAC;IAFvE,CAAC;IAID,KAAK,CAAC,GAAG,CAAC,YAAsB,EAAE,OAAwB;QACtD,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,CAAC,OAAO,CAAC,CAAC,KA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;QACpC,6CAAoB;GAHtD,2BAA2B,CAiEvC","sourcesContent":["import { Logger } from \"@nestjs/common\";\nimport { Command, CommandRunner, Option } from \"nest-commander\";\nimport { RemovedFieldMigrationService } from \"src/services/removed-field-migration.service\";\nimport { CommandError } from \"./helper\";\nimport { ModelMetadataService } from \"src/services/model-metadata.service\";\n\ninterface CommandOptions {\n name: string;\n dryRun?: boolean;\n}\n\n@Command({\n name: \"migrate-removed-fields\",\n description: \"Drops live database artifacts for fields marked for removal and cleans the related metadata.\",\n})\nexport class MigrateRemovedFieldsCommand extends CommandRunner {\n constructor(\n private readonly removedFieldMigrationService: RemovedFieldMigrationService,\n private readonly modelMetadataService: ModelMetadataService,\n\n ) {\n super();\n }\n\n private readonly logger = new Logger(MigrateRemovedFieldsCommand.name);\n\n async run(_passedParam: string[], options?: CommandOptions): Promise<void> {\n const errors = this.validate(options);\n if (errors.length) {\n errors.forEach((error) => this.logger.error(error));\n return;\n }\n\n const dryRun = options?.dryRun ?? true;\n\n // STEP 1: Capture fields BEFORE migration deletes metadata\n // const model = await this.modelMetadataService.findOneByUserKey(\n // options.name,\n // [\"module\", \"fields\"],\n // );\n\n // const fieldsForRemoval = model.fields.filter(\n // field => field.isMarkedForRemoval,\n // );\n\n // // STEP 2: Run remove-fields schematic first\n // if (!dryRun && fieldsForRemoval.length > 0) {\n // // await this.modelMetadataService.executeRemoveFieldsOnly(options.name,fieldsForRemoval.map(f => f.name),false,);\n // await this.modelMetadataService.executeRemoveFieldsWithModel(model, fieldsForRemoval.map(f => f.name),false,);\n // }\n\n // STEP 3: Then perform DB + metadata cleanup\n const result = await this.removedFieldMigrationService.migrateMarkedFields(options.name, dryRun,);\n\n result.operations.forEach((operation) => this.logger.log(operation));\n }\n\n @Option({\n flags: \"-n, --name <model name>\",\n description: \"Model name (singularName) from the ss_model_metadata table\",\n })\n parseName(val: string): string {\n return val;\n }\n\n @Option({\n flags: \"-d, --dryRun [dry run]\",\n description: \"Dry run the command\",\n })\n parseDryRun(val: string): boolean {\n this.logger.debug(`Dry run : ${val}`);\n return val === \"false\" ? false : true;\n }\n\n private validate(options: CommandOptions): CommandError[] {\n if (!options?.name) {\n return [new CommandError(\"Model Name is required\")];\n }\n return [];\n }\n}\n"]}
@@ -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;AACjG,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;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI5D"}
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,uGAAiG;AACjG,mGAA8F;AAIvF,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAC1C,YACqB,8BAA8D;QAA9D,mCAA8B,GAA9B,8BAA8B,CAAgC;IAC/E,CAAC;IAIL,YAAY,CACyB,QAAgB;QAEjD,OAAO,IAAI,CAAC,8BAA8B,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACtE,CAAC;IAID,SAAS,CAC4B,QAAgB,EAC5B,cAAsB;QAE3C,OAAO,IAAI,CAAC,8BAA8B,CAAC,SAAS,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACnF,CAAC;IAID,cAAc,CACuB,QAAgB,EAC5B,cAAsB,EAC3B,SAAiB,EAChB,MAAe;QAEhC,OAAO,IAAI,CAAC,8BAA8B,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC3G,CAAC;IAID,cAAc,C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;IAEnC,WAAA,IAAA,cAAK,EAAC,UAAU,EAAE,qBAAY,CAAC,CAAA;IAC/B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAa,wEAAiC;;qEAGxD;4CAjDQ,iCAAiC;IAF7C,IAAA,mBAAU,EAAC,0BAA0B,CAAC;IACtC,IAAA,iBAAO,EAAC,YAAY,CAAC;qCAGmC,iEAA8B;GAF1E,iCAAiC,CAkD7C","sourcesContent":["import { Body, Controller, Get, Param, ParseIntPipe, Post, Query } from \"@nestjs/common\";\nimport { ApiBearerAuth, ApiTags } from \"@nestjs/swagger\";\nimport { DatasourceIntrospectionMappingDto } 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"]}
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,mCAA8B,GAA9B,8BAA8B,CAAgC;IAC/E,CAAC;IAIL,YAAY,CACyB,QAAgB;QAEjD,OAAO,IAAI,CAAC,8BAA8B,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACtE,CAAC;IAID,SAAS,CAC4B,QAAgB,EAC5B,cAAsB;QAE3C,OAAO,IAAI,CAAC,8BAA8B,CAAC,SAAS,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACnF,CAAC;IAID,cAAc,CACuB,QAAgB,EAC5B,cAAsB,EAC3B,SAAiB,EAChB,MAAe;QAEhC,OAAO,IAAI,CAAC,8BAA8B,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC3G,CAAC;IAID,cAAc,CACuB,QAAgB,EACzC,UAA6C;QAErD,OAAO,IAAI,CAAC,8BAA8B,CAAC,cAAc,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACpF,CAAC;IAID,YAAY,CACyB,QAAgB,EACzC,UAA6C;QAErD,OAAO,IAAI,CAAC,8BAA8B,CAAC,YAAY,CAAC,QAAQ,EAAE,UAAU,CA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AY,CAAC,CAAA;IAC/B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAa,wEAAiC;;uEAGxD;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;;6CAAa,wEAAiC;;qEAGxD;AAID;IAFC,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,aAAI,EAAC,8CAA8C,CAAC;;IAEhD,WAAA,IAAA,cAAK,EAAC,UAAU,EAAE,qBAAY,CAAC,CAAA;IAC/B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAa,wEAAiC;;iFAGxD;AAID;IAFC,IAAA,uBAAa,EAAC,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"]}
@@ -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;
@@ -19,6 +20,7 @@ export declare class DatasourceIntrospectionMappingColumnDto {
19
20
  include: boolean;
20
21
  matched: boolean;
21
22
  isPrimaryKey: boolean;
23
+ fieldConfig?: Record<string, any>;
22
24
  }
23
25
  export declare class DatasourceIntrospectionMappingDto {
24
26
  mapped: boolean;
@@ -42,4 +44,7 @@ export declare class DatasourceIntrospectionMappingDto {
42
44
  columns: DatasourceIntrospectionMappingColumnDto[];
43
45
  reviewedModel?: Record<string, any>;
44
46
  }
47
+ export declare class DatasourceIntrospectionRunMigrationDto {
48
+ datasource: string;
49
+ }
45
50
  //# 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":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,qBAAa,uCAAuC;IAGhD,UAAU,EAAE,MAAM,CAAC;IAInB,SAAS,EAAE,MAA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BAAa,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 }, fieldConfig: { required: false, type: () => Object } };
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)(),
@@ -118,6 +123,12 @@ __decorate([
118
123
  (0, class_validator_1.IsBoolean)(),
119
124
  __metadata("design:type", Boolean)
120
125
  ], DatasourceIntrospectionMappingColumnDto.prototype, "isPrimaryKey", void 0);
126
+ __decorate([
127
+ (0, swagger_1.ApiProperty)({ required: false, type: "object", additionalProperties: true }),
128
+ (0, class_validator_1.IsOptional)(),
129
+ (0, class_validator_1.IsObject)(),
130
+ __metadata("design:type", Object)
131
+ ], DatasourceIntrospectionMappingColumnDto.prototype, "fieldConfig", void 0);
121
132
  class DatasourceIntrospectionMappingDto {
122
133
  static _OPENAPI_METADATA_FACTORY() {
123
134
  return { mapped: { required: true, type: () => Boolean }, modelId: { required: false, type: () => Number, nullable: true }, singularName: { required: true, type: () => String }, pluralName: { required: true, type: () => String }, displayName: { required: true, type: () => String }, description: { required: true, type: () => String }, tableName: { required: true, type: () => String }, schema: { required: false, type: () => String, nullable: true }, dataSource: { required: true, type: () => String }, dataSourceType: { required: true, type: () => String }, legacyTableType: { required: true, enum: require("../enums/legacy-table-type.enum").LegacyTableType }, baseClassName: { required: true, type: () => String }, userKeyField: { required: true, type: () => String }, enableAuditTracking: { required: true, type: () => Boolean }, enableSoftDelete: { required: true, type: () => Boolean }, draftPublishWorkflow: { required: true, type: () => Boolean }, internationalisation: { required: true, type: () => Boolean }, plannedMigrationTimestamp: { required: false, type: () => Number, nullable: true }, columns: { required: true, type: () => [require("./datasource-introspection-mapping.dto").DatasourceIntrospectionMappingColumnDto] }, reviewedModel: { required: false, type: () => Object } };
@@ -230,4 +241,15 @@ __decorate([
230
241
  (0, class_validator_1.IsObject)(),
231
242
  __metadata("design:type", Object)
232
243
  ], DatasourceIntrospectionMappingDto.prototype, "reviewedModel", void 0);
244
+ class DatasourceIntrospectionRunMigrationDto {
245
+ static _OPENAPI_METADATA_FACTORY() {
246
+ return { datasource: { required: true, type: () => String } };
247
+ }
248
+ }
249
+ exports.DatasourceIntrospectionRunMigrationDto = DatasourceIntrospectionRunMigrationDto;
250
+ __decorate([
251
+ (0, swagger_1.ApiProperty)(),
252
+ (0, class_validator_1.IsString)(),
253
+ __metadata("design:type", String)
254
+ ], DatasourceIntrospectionRunMigrationDto.prototype, "datasource", void 0);
233
255
  //# 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;;;;CA8EnD;AA9ED,0FA8EC;AA3EG;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;;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,q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AE;;uEACU;AAIrB;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,2BAAS,GAAE;;8EACiB;AAI7B;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,2BAAS,GAAE;;2EACc;AAI1B;IAFC,IAAA,qBAAW,GAAE;IACb,IAAA,2BAAS,GAAE;;+EACkB;AAI9B;IAFC,IAAA,qBAAW,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","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 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"]}
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;;;;CAuFnD;AAvFD,0FAuFC;AApFG;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;AA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estjs/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 @ApiProperty({ required: false, type: \"object\", additionalProperties: true })\n @IsOptional()\n @IsObject()\n fieldConfig?: Record<string, any>;\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"}
@@ -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 legacy_common_entity_1 = require("./legacy-common.entity");
17
- let LegacyCommonEntityWithGeneratedId = class LegacyCommonEntityWithGeneratedId extends legacy_common_entity_1.LegacyCommonEntityWithExistingId {
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: `${legacy_common_entity_1.LEGACY_TABLE_FIELDS_PREFIX}_id`, unique: true }),
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}"]}
@@ -10,4 +10,4 @@ export declare abstract class LegacyCommonEntityWithExistingId {
10
10
  createdBy: number | null;
11
11
  updatedBy: number | null;
12
12
  }
13
- //# sourceMappingURL=legacy-common.entity.d.ts.map
13
+ //# sourceMappingURL=legacy-common.entity-with-existing-id.entity.d.ts.map
@@ -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"}
@@ -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,I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AAM,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"]}
@@ -5,7 +5,9 @@ export type CommandWithArgs = {
5
5
  };
6
6
  export declare class CommandService {
7
7
  private readonly logger;
8
+ private readonly ansiEscapePattern;
8
9
  private escapeArgForWindows;
9
10
  executeCommandWithArgs(commandWithArgs: CommandWithArgs): Promise<string>;
11
+ private stripAnsi;
10
12
  }
11
13
  //# sourceMappingURL=command.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.service.d.ts","sourceRoot":"","sources":["../../src/helpers/command.service.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,qBACa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmC;IAM1D,OAAO,CAAC,mBAAmB;IAcrB,sBAAsB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;CA4ChF"}
1
+ {"version":3,"file":"command.service.d.ts","sourceRoot":"","sources":["../../src/helpers/command.service.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,qBACa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmC;IAC1D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAGwF;IAM1H,OAAO,CAAC,mBAAmB;IAcrB,sBAAsB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IA6C/E,OAAO,CAAC,SAAS;CAGlB"}
@@ -13,6 +13,7 @@ const child_process_1 = require("child_process");
13
13
  let CommandService = CommandService_1 = class CommandService {
14
14
  constructor() {
15
15
  this.logger = new common_1.Logger(CommandService_1.name);
16
+ this.ansiEscapePattern = /[\u001B\u009B][[\]()#;?]*(?:(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><~]|(?:][^\u0007]*(?:\u0007|\u001B\\)))/g;
16
17
  }
17
18
  escapeArgForWindows(arg) {
18
19
  if (/[{}\s"^&|<>]/.test(arg)) {
@@ -37,10 +38,10 @@ let CommandService = CommandService_1 = class CommandService {
37
38
  let stdout = '';
38
39
  let stderr = '';
39
40
  child.stdout.on('data', (data) => {
40
- stdout += data.toString();
41
+ stdout += this.stripAnsi(data.toString());
41
42
  });
42
43
  child.stderr.on('data', (data) => {
43
- stderr += data.toString();
44
+ stderr += this.stripAnsi(data.toString());
44
45
  });
45
46
  child.on('error', (error) => {
46
47
  this.logger.error(`Error executing command: ${command}`, error);
@@ -56,6 +57,9 @@ let CommandService = CommandService_1 = class CommandService {
56
57
  });
57
58
  });
58
59
  }
60
+ stripAnsi(value) {
61
+ return value.replace(this.ansiEscapePattern, '');
62
+ }
59
63
  };
60
64
  exports.CommandService = CommandService;
61
65
  exports.CommandService = CommandService = CommandService_1 = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"command.service.js","sourceRoot":"","sources":["../../src/helpers/command.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAoD;AACpD,iDAAsC;AAS/B,IAAM,cAAc,sBAApB,MAAM,cAAc;IAApB;QACY,WAAM,GAAG,IAAI,eAAM,CAAC,gBAAc,CAAC,IAAI,CAAC,CAAC;IAgE5D,CAAC;IA1DS,mBAAmB,CAAC,GAAW;QAGrC,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAE7B,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACzC,OAAO,IAAI,OAAO,GAAG,CAAC;QACxB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAKD,KAAK,CAAC,sBAAsB,CAAC,eAAgC;QAC3D,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;QAC1C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAErE,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC7C,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;YAG/C,MAAM,SAAS,GAAG,SAAS;gBACzB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;gBAChD,CAAC,CAAC,IAAI,CAAC;YAET,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,OAAO,EAAE,SAAS,EAAE;gBACtC,KAAK,EAAE,SAAS;gBAChB,KAAK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AA;AAjEY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;GACA,cAAc,CAiE1B","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport { spawn } from 'child_process';\n\nexport type CommandWithArgs = {\n command: string;\n args: string[];\n cwd?: string;\n};\n\n@Injectable()\nexport class CommandService {\n private readonly logger = new Logger(CommandService.name);\n\n /**\n * Escape an argument for Windows CMD shell\n * Wraps in double quotes and escapes internal double quotes\n */\n private escapeArgForWindows(arg: string): string {\n // If arg contains special characters, wrap in double quotes\n // and escape internal double quotes with backslash\n if (/[{}\\s\"^&|<>]/.test(arg)) {\n // Escape internal double quotes with backslash for CMD\n const escaped = arg.replace(/\"/g, '\\\\\"');\n return `\"${escaped}\"`;\n }\n return arg;\n }\n\n /**\n * Execute a command with arguments array (cross-platform compatible)\n */\n async executeCommandWithArgs(commandWithArgs: CommandWithArgs): Promise<string> {\n const { command, args } = commandWithArgs;\n this.logger.debug(`Executing command: ${command} ${args.join(' ')}`);\n\n return new Promise<string>((resolve, reject) => {\n const isWindows = process.platform === 'win32';\n\n // On Windows with shell: true, we need to escape args containing special characters\n const spawnArgs = isWindows\n ? args.map(arg => this.escapeArgForWindows(arg))\n : args;\n\n const child = spawn(command, spawnArgs, {\n shell: isWindows, // Use shell on Windows to handle .cmd files\n stdio: ['pipe', 'pipe', 'pipe'],\n cwd: commandWithArgs.cwd,\n });\n\n let stdout = '';\n let stderr = '';\n\n child.stdout.on('data', (data) => {\n stdout += data.toString();\n });\n\n child.stderr.on('data', (data) => {\n stderr += data.toString();\n });\n\n child.on('error', (error) => {\n this.logger.error(`Error executing command: ${command}`, error);\n reject(error);\n });\n\n child.on('close', (code) => {\n if (code !== 0) {\n this.logger.error(`Command failed with code ${code}: ${command}`, stderr);\n reject(new Error([stderr, stdout].filter(Boolean).join('\\n').trim() || `Command failed with exit code ${code}`));\n return;\n }\n resolve(stdout);\n });\n });\n }\n}\n"]}
1
+ {"version":3,"file":"command.service.js","sourceR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C,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;IACnD,CAAC;CACF,CAAA;AAzEY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;GACA,cAAc,CAyE1B","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport { spawn } from 'child_process';\n\nexport type CommandWithArgs = {\n command: string;\n args: string[];\n cwd?: string;\n};\n\n@Injectable()\nexport class CommandService {\n private readonly logger = new Logger(CommandService.name);\n private readonly ansiEscapePattern =\n // Covers standard ANSI CSI, OSC, and related terminal escape sequences.\n // eslint-disable-next-line no-control-regex\n /[\\u001B\\u009B][[\\]()#;?]*(?:(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><~]|(?:][^\\u0007]*(?:\\u0007|\\u001B\\\\)))/g;\n\n /**\n * Escape an argument for Windows CMD shell\n * Wraps in double quotes and escapes internal double quotes\n */\n private escapeArgForWindows(arg: string): string {\n // If arg contains special characters, wrap in double quotes\n // and escape internal double quotes with backslash\n if (/[{}\\s\"^&|<>]/.test(arg)) {\n // Escape internal double quotes with backslash for CMD\n const escaped = arg.replace(/\"/g, '\\\\\"');\n return `\"${escaped}\"`;\n }\n return arg;\n }\n\n /**\n * Execute a command with arguments array (cross-platform compatible)\n */\n async executeCommandWithArgs(commandWithArgs: CommandWithArgs): Promise<string> {\n const { command, args } = commandWithArgs;\n this.logger.debug(`Executing command: ${command} ${args.join(' ')}`);\n\n return new Promise<string>((resolve, reject) => {\n const isWindows = process.platform === 'win32';\n\n // On Windows with shell: true, we need to escape args containing special characters\n const spawnArgs = isWindows\n ? args.map(arg => this.escapeArgForWindows(arg))\n : args;\n\n const child = spawn(command, spawnArgs, {\n shell: isWindows, // Use shell on Windows to handle .cmd files\n stdio: ['pipe', 'pipe', 'pipe'],\n cwd: commandWithArgs.cwd,\n });\n\n let stdout = '';\n let stderr = '';\n\n child.stdout.on('data', (data) => {\n stdout += this.stripAnsi(data.toString());\n });\n\n child.stderr.on('data', (data) => {\n stderr += this.stripAnsi(data.toString());\n });\n\n child.on('error', (error) => {\n this.logger.error(`Error executing command: ${command}`, error);\n reject(error);\n });\n\n child.on('close', (code) => {\n if (code !== 0) {\n this.logger.error(`Command failed with code ${code}: ${command}`, stderr);\n reject(new Error([stderr, stdout].filter(Boolean).join('\\n').trim() || `Command failed with exit code ${code}`));\n return;\n }\n resolve(stdout);\n });\n });\n }\n\n private stripAnsi(value: string): string {\n return value.replace(this.ansiEscapePattern, '');\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 legacy_common_entity_1 = require("../entities/legacy-common.entity");
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'] = `${legacy_common_entity_1.LEGACY_TABLE_FIELDS_PREFIX}_${lodash_1._.snakeCase(field.name)}_id`;
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'] = `${legacy_common_entity_1.LEGACY_TABLE_FIELDS_PREFIX}_${lodash_1._.snakeCase(field.name)}`;
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;