@solidstarters/solid-core 1.2.137 → 1.2.139

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 (61) hide show
  1. package/dist/dtos/create-dashboard-question.dto.d.ts.map +1 -1
  2. package/dist/dtos/create-dashboard-question.dto.js.map +1 -1
  3. package/dist/dtos/create-dashboard.dto.d.ts +2 -0
  4. package/dist/dtos/create-dashboard.dto.d.ts.map +1 -1
  5. package/dist/dtos/create-dashboard.dto.js +13 -1
  6. package/dist/dtos/create-dashboard.dto.js.map +1 -1
  7. package/dist/dtos/update-dashboard-question.dto.d.ts.map +1 -1
  8. package/dist/dtos/update-dashboard-question.dto.js.map +1 -1
  9. package/dist/dtos/update-dashboard.dto.d.ts +2 -0
  10. package/dist/dtos/update-dashboard.dto.d.ts.map +1 -1
  11. package/dist/dtos/update-dashboard.dto.js +13 -1
  12. package/dist/dtos/update-dashboard.dto.js.map +1 -1
  13. package/dist/entities/dashboard-question.entity.d.ts.map +1 -1
  14. package/dist/entities/dashboard-question.entity.js.map +1 -1
  15. package/dist/entities/dashboard.entity.d.ts +2 -0
  16. package/dist/entities/dashboard.entity.d.ts.map +1 -1
  17. package/dist/entities/dashboard.entity.js +9 -1
  18. package/dist/entities/dashboard.entity.js.map +1 -1
  19. package/dist/helpers/field-crud-managers/ManyToOneRelationFieldCrudManager.d.ts +1 -1
  20. package/dist/helpers/field-crud-managers/ManyToOneRelationFieldCrudManager.d.ts.map +1 -1
  21. package/dist/helpers/field-crud-managers/ManyToOneRelationFieldCrudManager.js +4 -4
  22. package/dist/helpers/field-crud-managers/ManyToOneRelationFieldCrudManager.js.map +1 -1
  23. package/dist/helpers/module.helper.d.ts.map +1 -1
  24. package/dist/helpers/module.helper.js +9 -2
  25. package/dist/helpers/module.helper.js.map +1 -1
  26. package/dist/seeders/seed-data/solid-core-metadata.json +45 -0
  27. package/dist/services/crud.service.d.ts +1 -0
  28. package/dist/services/crud.service.d.ts.map +1 -1
  29. package/dist/services/crud.service.js +12 -4
  30. package/dist/services/crud.service.js.map +1 -1
  31. package/dist/services/dashboard.service.d.ts.map +1 -1
  32. package/dist/services/dashboard.service.js +7 -2
  33. package/dist/services/dashboard.service.js.map +1 -1
  34. package/dist/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.d.ts +4 -1
  35. package/dist/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.d.ts.map +1 -1
  36. package/dist/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.js +4 -2
  37. package/dist/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.js.map +1 -1
  38. package/dist/services/sql-expression-resolver.service.d.ts +3 -0
  39. package/dist/services/sql-expression-resolver.service.d.ts.map +1 -1
  40. package/dist/services/sql-expression-resolver.service.js +18 -3
  41. package/dist/services/sql-expression-resolver.service.js.map +1 -1
  42. package/dist/subscribers/dashboard.subscriber.d.ts +1 -0
  43. package/dist/subscribers/dashboard.subscriber.d.ts.map +1 -1
  44. package/dist/subscribers/dashboard.subscriber.js +17 -2
  45. package/dist/subscribers/dashboard.subscriber.js.map +1 -1
  46. package/dist/tsconfig.tsbuildinfo +1 -1
  47. package/package.json +1 -1
  48. package/src/dtos/create-dashboard-question.dto.ts +4 -5
  49. package/src/dtos/create-dashboard.dto.ts +8 -0
  50. package/src/dtos/update-dashboard-question.dto.ts +4 -5
  51. package/src/dtos/update-dashboard.dto.ts +8 -0
  52. package/src/entities/dashboard-question.entity.ts +2 -3
  53. package/src/entities/dashboard.entity.ts +4 -0
  54. package/src/helpers/field-crud-managers/ManyToOneRelationFieldCrudManager.ts +6 -5
  55. package/src/helpers/module.helper.ts +33 -20
  56. package/src/seeders/seed-data/solid-core-metadata.json +45 -0
  57. package/src/services/crud.service.ts +14 -4
  58. package/src/services/dashboard.service.ts +7 -2
  59. package/src/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.ts +5 -2
  60. package/src/services/sql-expression-resolver.service.ts +16 -2
  61. package/src/subscribers/dashboard.subscriber.ts +24 -5
@@ -1 +1 @@
1
- {"version":3,"file":"create-dashboard-question.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-dashboard-question.dto.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0CAA0C,EAAE,MAAM,2DAA2D,CAAC;AAEvH,qBAAa,0BAA0B;IAInC,IAAI,EAAE,MAAM,CAAC;IAIb,UAAU,EAAE,MAAM,CAAC;IAInB,YAAY,EAAE,MAAM,CAAC;IAIrB,YAAY,EAAE,MAAM,CAAC;IAIrB,WAAW,EAAE,MAAM,CAAC;IAIpB,gBAAgB,EAAE,MAAM,CAAC;IAMzB,yBAAyB,EAAE,0CAA0C,EAAE,CAAC;IAIxE,4BAA4B,EAAE,MAAM,EAAE,CAAC;IAIvC,gCAAgC,EAAE,MAAM,CAAC;IAIzC,YAAY,EAAE,GAAG,CAAC;IAIlB,QAAQ,EAAE,MAAM,CAAC;IAIjB,MAAM,EAAE,MAAM,CAAC;IAKnB,cAAc,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"create-dashboard-question.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-dashboard-question.dto.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0CAA0C,EAAE,MAAM,2DAA2D,CAAC;AAEvH,qBAAa,0BAA0B;IAInC,IAAI,EAAE,MAAM,CAAC;IAIb,UAAU,EAAE,MAAM,CAAC;IAInB,YAAY,EAAE,MAAM,CAAC;IAIrB,YAAY,EAAE,MAAM,CAAC;IAIrB,WAAW,EAAE,MAAM,CAAC;IAIpB,gBAAgB,EAAE,MAAM,CAAC;IAMzB,yBAAyB,EAAE,0CAA0C,EAAE,CAAC;IAIxE,4BAA4B,EAAE,MAAM,EAAE,CAAC;IAIvC,gCAAgC,EAAE,MAAM,CAAC;IAIzC,YAAY,EAAE,GAAG,CAAC;IAIlB,QAAQ,EAAE,MAAM,CAAC;IAIjB,MAAM,EAAE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AAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;;gFACnC;AAIvC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;;oFACjC;AAIzC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;IACR,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4FAA4F,EAAE,CAAC;;gEACzG;AAIlB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kEAAkE,EAAE,CAAC;;4DAChF;AAIjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,+DAA+D,EAAE,CAAC;;0DAC/E;AAKnB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;kEACS","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { IsString } from 'class-validator';\nimport { IsNotEmpty, IsOptional, IsJSON, IsInt, ValidateNested, IsArray } from 'class-validator';\nimport { Type } from 'class-transformer';\nimport { UpdateDashboardQuestionSqlDatasetConfigDto } from 'src/dtos/update-dashboard-question-sql-dataset-config.dto';\n\nexport class CreateDashboardQuestionDto {\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n name: string;\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n sourceType: string;\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n visualisedAs: string;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is only applicable when sourceType is set to provider. It allows the user to select any pre-existing Dashboard Question Data provider implementation used to fetch a dynamic dropdown of values to choose from when this question is presented to the user.\" })\n providerName: string;\n @IsOptional()\n @IsInt()\n @ApiProperty({ description: \"Related Dashboard Model\" })\n dashboardId: number;\n @IsString()\n @IsOptional()\n @ApiProperty({ description: \"Related Dashboard Model\" })\n dashboardUserKey: string;\n @IsOptional()\n @ApiProperty({ description: \"Related Question SQL Dataset Config Model\" })\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => UpdateDashboardQuestionSqlDatasetConfigDto)\n questionSqlDatasetConfigs: UpdateDashboardQuestionSqlDatasetConfigDto[];\n @IsOptional()\n @IsArray()\n @ApiProperty({ description: \"Related Question SQL Dataset Config Model\" })\n questionSqlDatasetConfigsIds: number[];\n @IsString()\n @IsOptional()\n @ApiProperty({ description: \"Related Question SQL Dataset Config Model\" })\n questionSqlDatasetConfigsCommand: string;\n @IsOptional()\n @IsJSON()\n @ApiProperty({ description: \"This is a JSON object representing each labels display and color options for the bar chart\" })\n chartOptions: any;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is the SQL query to fetch the label values for the question\" })\n labelSql: string;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is the SQL query to fetch the KPI value for the question\" })\n kpiSql: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nsequenceNumber: number;\n}"]}
1
+ {"version":3,"file":"create-dashboard-question.dto.js","sourceRoot":"","sources":["../../src/dtos/create-dashboard-question.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA2C;AAC3C,qDAAiG;AACjG,yDAAyC;AACzC,yHAAuH;AAEvH,MAAa,0BAA0B;;;;CAuDtC;AAvDD,gEAuDC;AAnDG;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;wDACD;AAIb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;8DACK;AAInB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,G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V,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,+DAA+D,EAAE,CAAC;;0DAC/E;AAIf;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;kEACS","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { IsString } from 'class-validator';\nimport { IsNotEmpty, IsOptional, IsJSON, IsInt, ValidateNested, IsArray } from 'class-validator';\nimport { Type } from 'class-transformer';\nimport { UpdateDashboardQuestionSqlDatasetConfigDto } from 'src/dtos/update-dashboard-question-sql-dataset-config.dto';\n\nexport class CreateDashboardQuestionDto {\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n name: string;\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n sourceType: string;\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n visualisedAs: string;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is only applicable when sourceType is set to provider. It allows the user to select any pre-existing Dashboard Question Data provider implementation used to fetch a dynamic dropdown of values to choose from when this question is presented to the user.\" })\n providerName: string;\n @IsOptional()\n @IsInt()\n @ApiProperty({ description: \"Related Dashboard Model\" })\n dashboardId: number;\n @IsString()\n @IsOptional()\n @ApiProperty({ description: \"Related Dashboard Model\" })\n dashboardUserKey: string;\n @IsOptional()\n @ApiProperty({ description: \"Related Question SQL Dataset Config Model\" })\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => UpdateDashboardQuestionSqlDatasetConfigDto)\n questionSqlDatasetConfigs: UpdateDashboardQuestionSqlDatasetConfigDto[];\n @IsOptional()\n @IsArray()\n @ApiProperty({ description: \"Related Question SQL Dataset Config Model\" })\n questionSqlDatasetConfigsIds: number[];\n @IsString()\n @IsOptional()\n @ApiProperty({ description: \"Related Question SQL Dataset Config Model\" })\n questionSqlDatasetConfigsCommand: string;\n @IsOptional()\n @IsJSON()\n @ApiProperty({ description: \"This is a JSON object representing each labels display and color options for the bar chart\" })\n chartOptions: any;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is the SQL query to fetch the label values for the question\" })\n labelSql: string;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is the SQL query to fetch the KPI value for the question\" })\n kpiSql: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n sequenceNumber: number;\n}"]}
@@ -11,5 +11,7 @@ export declare class CreateDashboardDto {
11
11
  questionsCommand: string;
12
12
  moduleId: number;
13
13
  moduleUserKey: string;
14
+ displayName: string;
15
+ description: string;
14
16
  }
15
17
  //# sourceMappingURL=create-dashboard.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-dashboard.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-dashboard.dto.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAEpF,qBAAa,kBAAkB;IAI3B,IAAI,EAAE,MAAM,CAAC;IAIb,UAAU,EAAE,GAAG,CAAC;IAMhB,kBAAkB,EAAE,0BAA0B,EAAE,CAAC;IAIjD,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAIhC,yBAAyB,EAAE,MAAM,CAAC;IAMlC,SAAS,EAAE,0BAA0B,EAAE,CAAC;IAIxC,YAAY,EAAE,MAAM,EAAE,CAAC;IAIvB,gBAAgB,EAAE,MAAM,CAAC;IAIzB,QAAQ,EAAE,MAAM,CAAC;IAIjB,aAAa,EAAE,MAAM,CAAC;CACzB"}
1
+ {"version":3,"file":"create-dashboard.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-dashboard.dto.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAEpF,qBAAa,kBAAkB;IAI3B,IAAI,EAAE,MAAM,CAAC;IAIb,UAAU,EAAE,GAAG,CAAC;IAMhB,kBAAkB,EAAE,0BAA0B,EAAE,CAAC;IAIjD,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAIhC,yBAAyB,EAAE,MAAM,CAAC;IAMlC,SAAS,EAAE,0BAA0B,EAAE,CAAC;IAIxC,YAAY,EAAE,MAAM,EAAE,CAAC;IAIvB,gBAAgB,EAAE,MAAM,CAAC;IAIzB,QAAQ,EAAE,MAAM,CAAC;IAIjB,aAAa,EAAE,MAAM,CAAC;IAItB,WAAW,EAAE,MAAM,CAAC;IAIpB,WAAW,EAAE,MAAM,CAAC;CACvB"}
@@ -19,7 +19,7 @@ const update_dashboard_variable_dto_1 = require("./update-dashboard-variable.dto
19
19
  const update_dashboard_question_dto_1 = require("./update-dashboard-question.dto");
20
20
  class CreateDashboardDto {
21
21
  static _OPENAPI_METADATA_FACTORY() {
22
- return { name: { required: true, type: () => String }, layoutJson: { required: true, type: () => Object }, dashboardVariables: { required: true, type: () => [require("./update-dashboard-variable.dto").UpdateDashboardVariableDto] }, dashboardVariablesIds: { required: true, type: () => [Number] }, dashboardVariablesCommand: { required: true, type: () => String }, questions: { required: true, type: () => [require("./update-dashboard-question.dto").UpdateDashboardQuestionDto] }, questionsIds: { required: true, type: () => [Number] }, questionsCommand: { required: true, type: () => String }, moduleId: { required: true, type: () => Number }, moduleUserKey: { required: true, type: () => String } };
22
+ return { name: { required: true, type: () => String }, layoutJson: { required: true, type: () => Object }, dashboardVariables: { required: true, type: () => [require("./update-dashboard-variable.dto").UpdateDashboardVariableDto] }, dashboardVariablesIds: { required: true, type: () => [Number] }, dashboardVariablesCommand: { required: true, type: () => String }, questions: { required: true, type: () => [require("./update-dashboard-question.dto").UpdateDashboardQuestionDto] }, questionsIds: { required: true, type: () => [Number] }, questionsCommand: { required: true, type: () => String }, moduleId: { required: true, type: () => Number }, moduleUserKey: { required: true, type: () => String }, displayName: { required: true, type: () => String }, description: { required: true, type: () => String } };
23
23
  }
24
24
  }
25
25
  exports.CreateDashboardDto = CreateDashboardDto;
@@ -87,4 +87,16 @@ __decorate([
87
87
  (0, swagger_1.ApiProperty)(),
88
88
  __metadata("design:type", String)
89
89
  ], CreateDashboardDto.prototype, "moduleUserKey", void 0);
90
+ __decorate([
91
+ (0, class_validator_2.IsOptional)(),
92
+ (0, class_validator_1.IsString)(),
93
+ (0, swagger_1.ApiProperty)(),
94
+ __metadata("design:type", String)
95
+ ], CreateDashboardDto.prototype, "displayName", void 0);
96
+ __decorate([
97
+ (0, class_validator_2.IsOptional)(),
98
+ (0, class_validator_1.IsString)(),
99
+ (0, swagger_1.ApiProperty)({ description: "This is a description of the dashboard configuration, providing context and details about the dashboard." }),
100
+ __metadata("design:type", String)
101
+ ], CreateDashboardDto.prototype, "description", void 0);
90
102
  //# sourceMappingURL=create-dashboard.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-dashboard.dto.js","sourceRoot":"","sources":["../../src/dtos/create-dashboard.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA2C;AAC3C,qDAAiG;AACjG,yDAAyC;AACzC,mFAAoF;AACpF,mFAAoF;AAEpF,MAAa,kBAAkB;;;;CA6C9B;AA7CD,gDA6CC;AAzCG;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;gDACD;AAIb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;sDACE;AAMhB;IALC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;IACb,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,0DAA0B,CAAC;;8DACU;AAIjD;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,qBAAW,GAAE;;iEACkB;AAIhC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;qEACoB;AAMlC;IALC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;IACb,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,0DAA0B,CAAC;;qDACC;AAIxC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,qBAAW,GAAE;;wDACS;AAIvB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACW;AAIzB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;oDACG;AAIjB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;yDACQ","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { IsString } from 'class-validator';\nimport { IsNotEmpty, ValidateNested, IsArray, IsOptional, IsJSON, IsInt } from 'class-validator';\nimport { Type } from 'class-transformer';\nimport { UpdateDashboardVariableDto } from 'src/dtos/update-dashboard-variable.dto';\nimport { UpdateDashboardQuestionDto } from 'src/dtos/update-dashboard-question.dto';\n\nexport class CreateDashboardDto {\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n name: string;\n @IsNotEmpty()\n @IsJSON()\n @ApiProperty()\n layoutJson: any;\n @IsOptional()\n @ApiProperty()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => UpdateDashboardVariableDto)\n dashboardVariables: UpdateDashboardVariableDto[];\n @IsOptional()\n @IsArray()\n @ApiProperty()\n dashboardVariablesIds: number[];\n @IsString()\n @IsOptional()\n @ApiProperty()\n dashboardVariablesCommand: string;\n @IsOptional()\n @ApiProperty()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => UpdateDashboardQuestionDto)\n questions: UpdateDashboardQuestionDto[];\n @IsOptional()\n @IsArray()\n @ApiProperty()\n questionsIds: number[];\n @IsString()\n @IsOptional()\n @ApiProperty()\n questionsCommand: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n moduleId: number;\n @IsString()\n @IsOptional()\n @ApiProperty()\n moduleUserKey: string;\n}"]}
1
+ {"version":3,"file":"create-dashboard.dto.js","sourceRoot":"","sources":["../../src/dtos/create-dashboard.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA2C;AAC3C,qDAAiG;AACjG,yDAAyC;AACzC,mFAAoF;AACpF,mFAAoF;AAEpF,MAAa,kBAAkB;;;;CAqD9B;AArDD,gDAqDC;AAjDG;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;gDACD;AAIb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;sDACE;AAMhB;IALC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;IACb,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,0DAA0B,CAAC;;8DACU;AAIjD;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,qBAAW,GAAE;;iEACkB;AAIhC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;qEACoB;AAMlC;IALC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;IACb,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,0DAA0B,CAAC;;qDACC;AAIxC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,qBAAW,GAAE;;wDACS;AAIvB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACW;AAIzB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;oDACG;AAIjB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;yDACQ;AAItB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;uDACM;AAIpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,0GAA0G,EAAE,CAAC;;uDACrH","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { IsString } from 'class-validator';\nimport { IsNotEmpty, ValidateNested, IsArray, IsOptional, IsJSON, IsInt } from 'class-validator';\nimport { Type } from 'class-transformer';\nimport { UpdateDashboardVariableDto } from 'src/dtos/update-dashboard-variable.dto';\nimport { UpdateDashboardQuestionDto } from 'src/dtos/update-dashboard-question.dto';\n\nexport class CreateDashboardDto {\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n name: string;\n @IsNotEmpty()\n @IsJSON()\n @ApiProperty()\n layoutJson: any;\n @IsOptional()\n @ApiProperty()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => UpdateDashboardVariableDto)\n dashboardVariables: UpdateDashboardVariableDto[];\n @IsOptional()\n @IsArray()\n @ApiProperty()\n dashboardVariablesIds: number[];\n @IsString()\n @IsOptional()\n @ApiProperty()\n dashboardVariablesCommand: string;\n @IsOptional()\n @ApiProperty()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => UpdateDashboardQuestionDto)\n questions: UpdateDashboardQuestionDto[];\n @IsOptional()\n @IsArray()\n @ApiProperty()\n questionsIds: number[];\n @IsString()\n @IsOptional()\n @ApiProperty()\n questionsCommand: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n moduleId: number;\n @IsString()\n @IsOptional()\n @ApiProperty()\n moduleUserKey: string;\n @IsOptional()\n @IsString()\n @ApiProperty()\n displayName: string;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is a description of the dashboard configuration, providing context and details about the dashboard.\" })\n description: string;\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"update-dashboard-question.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/update-dashboard-question.dto.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0CAA0C,EAAE,MAAM,2DAA2D,CAAC;AAEvH,qBAAa,0BAA0B;IAGnC,EAAE,EAAE,MAAM,CAAC;IAKX,IAAI,EAAE,MAAM,CAAC;IAKb,UAAU,EAAE,MAAM,CAAC;IAKnB,YAAY,EAAE,MAAM,CAAC;IAIrB,YAAY,EAAE,MAAM,CAAC;IAIrB,WAAW,EAAE,MAAM,CAAC;IAIpB,gBAAgB,EAAE,MAAM,CAAC;IAMzB,yBAAyB,EAAE,0CAA0C,EAAE,CAAC;IAIxE,4BAA4B,EAAE,MAAM,EAAE,CAAC;IAIvC,gCAAgC,EAAE,MAAM,CAAC;IAIzC,YAAY,EAAE,GAAG,CAAC;IAIlB,QAAQ,EAAE,MAAM,CAAC;IAIjB,MAAM,EAAE,MAAM,CAAC;IAKnB,cAAc,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"update-dashboard-question.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/update-dashboard-question.dto.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0CAA0C,EAAE,MAAM,2DAA2D,CAAC;AAEvH,qBAAa,0BAA0B;IAGnC,EAAE,EAAE,MAAM,CAAC;IAKX,IAAI,EAAE,MAAM,CAAC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ty, IsJSON, ValidateNested, IsArray } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\nimport { Type } from 'class-transformer';\nimport { UpdateDashboardQuestionSqlDatasetConfigDto } from 'src/dtos/update-dashboard-question-sql-dataset-config.dto';\n\nexport class UpdateDashboardQuestionDto {\n @IsOptional()\n @IsInt()\n id: number;\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty()\n name: string;\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty()\n sourceType: string;\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty()\n visualisedAs: string;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is only applicable when sourceType is set to provider. It allows the user to select any pre-existing Dashboard Question Data provider implementation used to fetch a dynamic dropdown of values to choose from when this question is presented to the user.\" })\n providerName: string;\n @IsOptional()\n @IsInt()\n @ApiProperty({ description: \"Related Dashboard Model\" })\n dashboardId: number;\n @IsString()\n @IsOptional()\n @ApiProperty({ description: \"Related Dashboard Model\" })\n dashboardUserKey: string;\n @IsOptional()\n @ApiProperty({ description: \"Related Question SQL Dataset Config Model\" })\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => UpdateDashboardQuestionSqlDatasetConfigDto)\n questionSqlDatasetConfigs: UpdateDashboardQuestionSqlDatasetConfigDto[];\n @IsOptional()\n @IsArray()\n @ApiProperty({ description: \"Related Question SQL Dataset Config Model\" })\n questionSqlDatasetConfigsIds: number[];\n @IsString()\n @IsOptional()\n @ApiProperty({ description: \"Related Question SQL Dataset Config Model\" })\n questionSqlDatasetConfigsCommand: string;\n @IsOptional()\n @IsJSON()\n @ApiProperty({ description: \"This is a JSON object representing each labels display and color options for the bar chart\" })\n chartOptions: any;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is the SQL query to fetch the label values for the question\" })\n labelSql: string;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is the SQL query to fetch the KPI value for the question\" })\n kpiSql: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nsequenceNumber: number;\n}"]}
1
+ {"version":3,"file":"update-dashboard-question.dto.js","sourceRoot":"","sources":["../../src/dtos/update-dashboard-question.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAA0G;AAC1G,6CAA8C;AAC9C,yDAAyC;AACzC,yHAAuH;AAEvH,MAAa,0BAA0B;;;;CA6DtC;AA7DD,gEA6DC;AA1DG;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;;sDACG;AAKX;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;wDACD;AAKb;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;8DACK;AAKnB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;gEACO;AAIrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kQAAkQ,EAAE,CAAC;;gEAC5Q;AAIrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;+DACpC;AAIpB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;oEAC/B;AAMzB;IALC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;IACzE,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,6FAA0C,CAAC;;6EACiB;AAIxE;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;;gFACnC;AAIvC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;;oFACjC;AAIzC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;IACR,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4FAA4F,EAAE,CAAC;;gEACzG;AAIlB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kEAAkE,EAAE,CAAC;;4DAChF;AAIjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,+DAA+D,EAAE,CAAC;;0DAC/E;AAIf;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;kEACS","sourcesContent":["import { IsInt,IsOptional, IsString, IsNotEmpty, IsJSON, ValidateNested, IsArray } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\nimport { Type } from 'class-transformer';\nimport { UpdateDashboardQuestionSqlDatasetConfigDto } from 'src/dtos/update-dashboard-question-sql-dataset-config.dto';\n\nexport class UpdateDashboardQuestionDto {\n @IsOptional()\n @IsInt()\n id: number;\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty()\n name: string;\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty()\n sourceType: string;\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty()\n visualisedAs: string;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is only applicable when sourceType is set to provider. It allows the user to select any pre-existing Dashboard Question Data provider implementation used to fetch a dynamic dropdown of values to choose from when this question is presented to the user.\" })\n providerName: string;\n @IsOptional()\n @IsInt()\n @ApiProperty({ description: \"Related Dashboard Model\" })\n dashboardId: number;\n @IsString()\n @IsOptional()\n @ApiProperty({ description: \"Related Dashboard Model\" })\n dashboardUserKey: string;\n @IsOptional()\n @ApiProperty({ description: \"Related Question SQL Dataset Config Model\" })\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => UpdateDashboardQuestionSqlDatasetConfigDto)\n questionSqlDatasetConfigs: UpdateDashboardQuestionSqlDatasetConfigDto[];\n @IsOptional()\n @IsArray()\n @ApiProperty({ description: \"Related Question SQL Dataset Config Model\" })\n questionSqlDatasetConfigsIds: number[];\n @IsString()\n @IsOptional()\n @ApiProperty({ description: \"Related Question SQL Dataset Config Model\" })\n questionSqlDatasetConfigsCommand: string;\n @IsOptional()\n @IsJSON()\n @ApiProperty({ description: \"This is a JSON object representing each labels display and color options for the bar chart\" })\n chartOptions: any;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is the SQL query to fetch the label values for the question\" })\n labelSql: string;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is the SQL query to fetch the KPI value for the question\" })\n kpiSql: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n sequenceNumber: number;\n}"]}
@@ -12,5 +12,7 @@ export declare class UpdateDashboardDto {
12
12
  questionsCommand: string;
13
13
  moduleId: number;
14
14
  moduleUserKey: string;
15
+ displayName: string;
16
+ description: string;
15
17
  }
16
18
  //# sourceMappingURL=update-dashboard.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-dashboard.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/update-dashboard.dto.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAEpF,qBAAa,kBAAkB;IAG3B,EAAE,EAAE,MAAM,CAAC;IAKX,IAAI,EAAE,MAAM,CAAC;IAKb,UAAU,EAAE,GAAG,CAAC;IAMhB,kBAAkB,EAAE,0BAA0B,EAAE,CAAC;IAIjD,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAIhC,yBAAyB,EAAE,MAAM,CAAC;IAMlC,SAAS,EAAE,0BAA0B,EAAE,CAAC;IAIxC,YAAY,EAAE,MAAM,EAAE,CAAC;IAIvB,gBAAgB,EAAE,MAAM,CAAC;IAIzB,QAAQ,EAAE,MAAM,CAAC;IAIjB,aAAa,EAAE,MAAM,CAAC;CACzB"}
1
+ {"version":3,"file":"update-dashboard.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/update-dashboard.dto.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAEpF,qBAAa,kBAAkB;IAG3B,EAAE,EAAE,MAAM,CAAC;IAKX,IAAI,EAAE,MAAM,CAAC;IAKb,UAAU,EAAE,GAAG,CAAC;IAMhB,kBAAkB,EAAE,0BAA0B,EAAE,CAAC;IAIjD,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAIhC,yBAAyB,EAAE,MAAM,CAAC;IAMlC,SAAS,EAAE,0BAA0B,EAAE,CAAC;IAIxC,YAAY,EAAE,MAAM,EAAE,CAAC;IAIvB,gBAAgB,EAAE,MAAM,CAAC;IAIzB,QAAQ,EAAE,MAAM,CAAC;IAIjB,aAAa,EAAE,MAAM,CAAC;IAItB,WAAW,EAAE,MAAM,CAAC;IAIpB,WAAW,EAAE,MAAM,CAAC;CACvB"}
@@ -18,7 +18,7 @@ const update_dashboard_variable_dto_1 = require("./update-dashboard-variable.dto
18
18
  const update_dashboard_question_dto_1 = require("./update-dashboard-question.dto");
19
19
  class UpdateDashboardDto {
20
20
  static _OPENAPI_METADATA_FACTORY() {
21
- return { id: { required: true, type: () => Number }, name: { required: true, type: () => String }, layoutJson: { required: true, type: () => Object }, dashboardVariables: { required: true, type: () => [require("./update-dashboard-variable.dto").UpdateDashboardVariableDto] }, dashboardVariablesIds: { required: true, type: () => [Number] }, dashboardVariablesCommand: { required: true, type: () => String }, questions: { required: true, type: () => [require("./update-dashboard-question.dto").UpdateDashboardQuestionDto] }, questionsIds: { required: true, type: () => [Number] }, questionsCommand: { required: true, type: () => String }, moduleId: { required: true, type: () => Number }, moduleUserKey: { required: true, type: () => String } };
21
+ return { id: { required: true, type: () => Number }, name: { required: true, type: () => String }, layoutJson: { required: true, type: () => Object }, dashboardVariables: { required: true, type: () => [require("./update-dashboard-variable.dto").UpdateDashboardVariableDto] }, dashboardVariablesIds: { required: true, type: () => [Number] }, dashboardVariablesCommand: { required: true, type: () => String }, questions: { required: true, type: () => [require("./update-dashboard-question.dto").UpdateDashboardQuestionDto] }, questionsIds: { required: true, type: () => [Number] }, questionsCommand: { required: true, type: () => String }, moduleId: { required: true, type: () => Number }, moduleUserKey: { required: true, type: () => String }, displayName: { required: true, type: () => String }, description: { required: true, type: () => String } };
22
22
  }
23
23
  }
24
24
  exports.UpdateDashboardDto = UpdateDashboardDto;
@@ -93,4 +93,16 @@ __decorate([
93
93
  (0, swagger_1.ApiProperty)(),
94
94
  __metadata("design:type", String)
95
95
  ], UpdateDashboardDto.prototype, "moduleUserKey", void 0);
96
+ __decorate([
97
+ (0, class_validator_1.IsOptional)(),
98
+ (0, class_validator_1.IsString)(),
99
+ (0, swagger_1.ApiProperty)(),
100
+ __metadata("design:type", String)
101
+ ], UpdateDashboardDto.prototype, "displayName", void 0);
102
+ __decorate([
103
+ (0, class_validator_1.IsOptional)(),
104
+ (0, class_validator_1.IsString)(),
105
+ (0, swagger_1.ApiProperty)({ description: "This is a description of the dashboard configuration, providing context and details about the dashboard." }),
106
+ __metadata("design:type", String)
107
+ ], UpdateDashboardDto.prototype, "description", void 0);
96
108
  //# sourceMappingURL=update-dashboard.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-dashboard.dto.js","sourceRoot":"","sources":["../../src/dtos/update-dashboard.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAA0G;AAC1G,6CAA8C;AAC9C,yDAAyC;AACzC,mFAAoF;AACpF,mFAAoF;AAEpF,MAAa,kBAAkB;;;;CAkD9B;AAlDD,gDAkDC;AA/CG;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;;8CACG;AAKX;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;gDACD;AAKb;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;sDACE;AAMhB;IALC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;IACb,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,0DAA0B,CAAC;;8DACU;AAIjD;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,qBAAW,GAAE;;iEACkB;AAIhC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;qEACoB;AAMlC;IALC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;IACb,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,0DAA0B,CAAC;;qDACC;AAIxC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,qBAAW,GAAE;;wDACS;AAIvB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACW;AAIzB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;oDACG;AAIjB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;yDACQ","sourcesContent":["import { IsInt,IsOptional, IsString, IsNotEmpty, ValidateNested, IsArray, IsJSON } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\nimport { Type } from 'class-transformer';\nimport { UpdateDashboardVariableDto } from 'src/dtos/update-dashboard-variable.dto';\nimport { UpdateDashboardQuestionDto } from 'src/dtos/update-dashboard-question.dto';\n\nexport class UpdateDashboardDto {\n @IsOptional()\n @IsInt()\n id: number;\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty()\n name: string;\n @IsNotEmpty()\n @IsOptional()\n @IsJSON()\n @ApiProperty()\n layoutJson: any;\n @IsOptional()\n @ApiProperty()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => UpdateDashboardVariableDto)\n dashboardVariables: UpdateDashboardVariableDto[];\n @IsOptional()\n @IsArray()\n @ApiProperty()\n dashboardVariablesIds: number[];\n @IsString()\n @IsOptional()\n @ApiProperty()\n dashboardVariablesCommand: string;\n @IsOptional()\n @ApiProperty()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => UpdateDashboardQuestionDto)\n questions: UpdateDashboardQuestionDto[];\n @IsOptional()\n @IsArray()\n @ApiProperty()\n questionsIds: number[];\n @IsString()\n @IsOptional()\n @ApiProperty()\n questionsCommand: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n moduleId: number;\n @IsString()\n @IsOptional()\n @ApiProperty()\n moduleUserKey: string;\n}"]}
1
+ {"version":3,"file":"update-dashboard.dto.js","sourceRoot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,qBAAW,GAAE;;4DACW;AAIzB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;oDACG;AAIjB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;yDACQ;AAItB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;uDACM;AAIpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,0GAA0G,EAAE,CAAC;;uDACrH","sourcesContent":["import { IsInt,IsOptional, IsString, IsNotEmpty, ValidateNested, IsArray, IsJSON } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\nimport { Type } from 'class-transformer';\nimport { UpdateDashboardVariableDto } from 'src/dtos/update-dashboard-variable.dto';\nimport { UpdateDashboardQuestionDto } from 'src/dtos/update-dashboard-question.dto';\n\nexport class UpdateDashboardDto {\n @IsOptional()\n @IsInt()\n id: number;\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty()\n name: string;\n @IsNotEmpty()\n @IsOptional()\n @IsJSON()\n @ApiProperty()\n layoutJson: any;\n @IsOptional()\n @ApiProperty()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => UpdateDashboardVariableDto)\n dashboardVariables: UpdateDashboardVariableDto[];\n @IsOptional()\n @IsArray()\n @ApiProperty()\n dashboardVariablesIds: number[];\n @IsString()\n @IsOptional()\n @ApiProperty()\n dashboardVariablesCommand: string;\n @IsOptional()\n @ApiProperty()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => UpdateDashboardQuestionDto)\n questions: UpdateDashboardQuestionDto[];\n @IsOptional()\n @IsArray()\n @ApiProperty()\n questionsIds: number[];\n @IsString()\n @IsOptional()\n @ApiProperty()\n questionsCommand: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n moduleId: number;\n @IsString()\n @IsOptional()\n @ApiProperty()\n moduleUserKey: string;\n @IsOptional()\n @IsString()\n @ApiProperty()\n displayName: string;\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"This is a description of the dashboard configuration, providing context and details about the dashboard.\" })\n description: string;\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-question.entity.d.ts","sourceRoot":"","sources":["../../src/entities/dashboard-question.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,2DAA2D,CAAA;AAE7G,qBACa,iBAAkB,SAAQ,YAAY;IAG/C,IAAI,EAAE,MAAM,CAAC;IAGb,UAAU,EAAE,MAAM,CAAC;IAGnB,YAAY,EAAE,MAAM,CAAC;IAErB,YAAY,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAE,SAAS,CAAC;IAErB,yBAAyB,EAAE,iCAAiC,EAAE,CAAC;IAE/D,YAAY,EAAE,GAAG,CAAC;IAElB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IAGnB,cAAc,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"dashboard-question.entity.d.ts","sourceRoot":"","sources":["../../src/entities/dashboard-question.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,2DAA2D,CAAA;AAE7G,qBACa,iBAAkB,SAAQ,YAAY;IAG/C,IAAI,EAAE,MAAM,CAAC;IAGb,UAAU,EAAE,MAAM,CAAC;IAGnB,YAAY,EAAE,MAAM,CAAC;IAErB,YAAY,EAAE,MAAM,CAAC;IAGrB,SAAS,E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E,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACxB;AAElB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACxB;AAEjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAC1B;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACrB;4BAzBV,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,uBAAuB,CAAC;GACnB,iBAAiB,CA0B7B","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity'\nimport { Entity, Column, Index, JoinColumn, ManyToOne, OneToMany } from 'typeorm';\nimport { Dashboard } from 'src/entities/dashboard.entity';\nimport { DashboardQuestionSqlDatasetConfig } from 'src/entities/dashboard-question-sql-dataset-config.entity'\n\n@Entity(\"ss_dashboard_question\")\nexport class DashboardQuestion extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n name: string;\n @Index()\n @Column({})\n sourceType: string;\n @Index()\n @Column({})\n visualisedAs: string;\n @Column({ type: \"varchar\", nullable: true })\n providerName: string;\n @ManyToOne(() => Dashboard, { onDelete: \"CASCADE\", nullable: true })\n @JoinColumn()\n dashboard: Dashboard;\n @OneToMany(() => DashboardQuestionSqlDatasetConfig, dashboardQuestionSqlDatasetConfig => dashboardQuestionSqlDatasetConfig.question, { cascade: true })\n questionSqlDatasetConfigs: DashboardQuestionSqlDatasetConfig[];\n @Column({ type: \"jsonb\", nullable: true })\n chartOptions: any;\n @Column({ type: \"text\", nullable: true })\n labelSql: string;\n @Column({ type: \"text\", nullable: true })\n kpiSql: string;\n\n@Column({ type: \"integer\", nullable: true })\nsequenceNumber: number;\n}"]}
1
+ {"version":3,"file":"dashboard-question.entity.js","sourceRoot":"","sources":["../../src/entities/dashboard-question.entity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AC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACrB;4BAxBd,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,uBAAuB,CAAC;GACnB,iBAAiB,CAyB7B","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity'\nimport { Entity, Column, Index, JoinColumn, ManyToOne, OneToMany } from 'typeorm';\nimport { Dashboard } from 'src/entities/dashboard.entity';\nimport { DashboardQuestionSqlDatasetConfig } from 'src/entities/dashboard-question-sql-dataset-config.entity'\n\n@Entity(\"ss_dashboard_question\")\nexport class DashboardQuestion extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n name: string;\n @Index()\n @Column({})\n sourceType: string;\n @Index()\n @Column({})\n visualisedAs: string;\n @Column({ type: \"varchar\", nullable: true })\n providerName: string;\n @ManyToOne(() => Dashboard, { onDelete: \"CASCADE\", nullable: true })\n @JoinColumn()\n dashboard: Dashboard;\n @OneToMany(() => DashboardQuestionSqlDatasetConfig, dashboardQuestionSqlDatasetConfig => dashboardQuestionSqlDatasetConfig.question, { cascade: true })\n questionSqlDatasetConfigs: DashboardQuestionSqlDatasetConfig[];\n @Column({ type: \"jsonb\", nullable: true })\n chartOptions: any;\n @Column({ type: \"text\", nullable: true })\n labelSql: string;\n @Column({ type: \"text\", nullable: true })\n kpiSql: string;\n @Column({ type: \"integer\", nullable: true })\n sequenceNumber: number;\n}"]}
@@ -8,5 +8,7 @@ export declare class Dashboard extends CommonEntity {
8
8
  dashboardVariables: DashboardVariable[];
9
9
  questions: DashboardQuestion[];
10
10
  module: ModuleMetadata;
11
+ displayName: string;
12
+ description: string;
11
13
  }
12
14
  //# sourceMappingURL=dashboard.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.entity.d.ts","sourceRoot":"","sources":["../../src/entities/dashboard.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AAEpE,qBACa,SAAU,SAAQ,YAAY;IAGvC,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,GAAG,CAAC;IAEhB,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IAExC,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAG/B,MAAM,EAAE,cAAc,CAAC;CAC1B"}
1
+ {"version":3,"file":"dashboard.entity.d.ts","sourceRoot":"","sources":["../../src/entities/dashboard.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AAEpE,qBACa,SAAU,SAAQ,YAAY;IAGvC,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,GAAG,CAAC;IAEhB,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IAExC,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAG/B,MAAM,EAAE,cAAc,CAAC;IAEvB,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;CACvB"}
@@ -18,7 +18,7 @@ const dashboard_question_entity_1 = require("./dashboard-question.entity");
18
18
  const module_metadata_entity_1 = require("./module-metadata.entity");
19
19
  let Dashboard = class Dashboard extends common_entity_1.CommonEntity {
20
20
  static _OPENAPI_METADATA_FACTORY() {
21
- return { name: { required: true, type: () => String }, layoutJson: { required: true, type: () => Object }, dashboardVariables: { required: true, type: () => [require("./dashboard-variable.entity").DashboardVariable] }, questions: { required: true, type: () => [require("./dashboard-question.entity").DashboardQuestion] }, module: { required: true, type: () => require("./module-metadata.entity").ModuleMetadata } };
21
+ return { name: { required: true, type: () => String }, layoutJson: { required: true, type: () => Object }, dashboardVariables: { required: true, type: () => [require("./dashboard-variable.entity").DashboardVariable] }, questions: { required: true, type: () => [require("./dashboard-question.entity").DashboardQuestion] }, module: { required: true, type: () => require("./module-metadata.entity").ModuleMetadata }, displayName: { required: true, type: () => String }, description: { required: true, type: () => String } };
22
22
  }
23
23
  };
24
24
  exports.Dashboard = Dashboard;
@@ -44,6 +44,14 @@ __decorate([
44
44
  (0, typeorm_1.JoinColumn)(),
45
45
  __metadata("design:type", module_metadata_entity_1.ModuleMetadata)
46
46
  ], Dashboard.prototype, "module", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ type: "varchar", nullable: true }),
49
+ __metadata("design:type", String)
50
+ ], Dashboard.prototype, "displayName", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ type: "text", nullable: true }),
53
+ __metadata("design:type", String)
54
+ ], Dashboard.prototype, "description", void 0);
47
55
  exports.Dashboard = Dashboard = __decorate([
48
56
  (0, typeorm_1.Entity)("ss_dashboard")
49
57
  ], Dashboard);
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.entity.js","sourceRoot":"","sources":["../../src/entities/dashboard.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAyD;AACzD,qCAAkF;AAClF,2EAA2E;AAC3E,2EAA2E;AAC3E,qEAAoE;AAG7D,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,4BAAY;;;;CAa1C,CAAA;AAbY,8BAAS;AAGlB;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;uCACf;AAEb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACT;AAEhB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAAiB,EAAE,iBAAiB,CAAC,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qDAChE;AAExC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAAiB,EAAE,iBAAiB,CAAC,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;4CACzE;AAG/B;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACzE,IAAA,oBAAU,GAAE;8BACL,uCAAc;yCAAC;oBAZd,SAAS;IADrB,IAAA,gBAAM,EAAC,cAAc,CAAC;GACV,SAAS,CAarB","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity'\nimport { Entity, Column, Index, OneToMany, JoinColumn, ManyToOne } from 'typeorm';\nimport { DashboardVariable } from 'src/entities/dashboard-variable.entity';\nimport { DashboardQuestion } from 'src/entities/dashboard-question.entity';\nimport { ModuleMetadata } from 'src/entities/module-metadata.entity'\n\n@Entity(\"ss_dashboard\")\nexport class Dashboard extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n name: string;\n @Column({ type: \"text\" })\n layoutJson: any;\n @OneToMany(() => DashboardVariable, dashboardVariable => dashboardVariable.dashboard, { cascade: true })\n dashboardVariables: DashboardVariable[];\n @OneToMany(() => DashboardQuestion, dashboardQuestion => dashboardQuestion.dashboard, { cascade: true })\n questions: DashboardQuestion[];\n @ManyToOne(() => ModuleMetadata, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n module: ModuleMetadata;\n}"]}
1
+ {"version":3,"file":"dashboard.entity.js","sourceRoot":"","sources":["../../src/entities/dashboard.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAyD;AACzD,qCAAkF;AAClF,2EAA2E;AAC3E,2EAA2E;AAC3E,qEAAoE;AAG7D,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,4BAAY;;;;CAiB1C,CAAA;AAjBY,8BAAS;AAGlB;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;uCACf;AAEb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACT;AAEhB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAAiB,EAAE,iBAAiB,CAAC,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qDAChE;AAExC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAAiB,EAAE,iBAAiB,CAAC,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;4CACzE;AAG/B;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACzE,IAAA,oBAAU,GAAE;8BACL,uCAAc;yCAAC;AAEvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACxB;AAEpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACrB;oBAhBX,SAAS;IADrB,IAAA,gBAAM,EAAC,cAAc,CAAC;GACV,SAAS,CAiBrB","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity'\nimport { Entity, Column, Index, OneToMany, JoinColumn, ManyToOne } from 'typeorm';\nimport { DashboardVariable } from 'src/entities/dashboard-variable.entity';\nimport { DashboardQuestion } from 'src/entities/dashboard-question.entity';\nimport { ModuleMetadata } from 'src/entities/module-metadata.entity'\n\n@Entity(\"ss_dashboard\")\nexport class Dashboard extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n name: string;\n @Column({ type: \"text\" })\n layoutJson: any;\n @OneToMany(() => DashboardVariable, dashboardVariable => dashboardVariable.dashboard, { cascade: true })\n dashboardVariables: DashboardVariable[];\n @OneToMany(() => DashboardQuestion, dashboardQuestion => dashboardQuestion.dashboard, { cascade: true })\n questions: DashboardQuestion[];\n @ManyToOne(() => ModuleMetadata, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n module: ModuleMetadata;\n @Column({ type: \"varchar\", nullable: true })\n displayName: string;\n @Column({ type: \"text\", nullable: true })\n description: string;\n}"]}
@@ -4,9 +4,9 @@ export interface ManyToOneRelationFieldOptions {
4
4
  required: boolean | undefined | null;
5
5
  relationCoModelSingularName: string | undefined | null;
6
6
  fieldName: string | undefined | null;
7
- modelUserKeyFieldName: string | undefined | null;
8
7
  modelSingularName: string | undefined | null;
9
8
  entityManager: EntityManager;
9
+ relationCoModelUserKeyFieldName: string | undefined | null;
10
10
  }
11
11
  export declare class ManyToOneRelationFieldCrudManager implements FieldCrudManager {
12
12
  private readonly options;
@@ -1 +1 @@
1
- {"version":3,"file":"ManyToOneRelationFieldCrudManager.d.ts","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/ManyToOneRelationFieldCrudManager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,6BAA6B;IAE1C,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IACrC,2BAA2B,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACvD,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;I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FpC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,gBAAgB,CAAS;gBACJ,OAAO,EAAE,6BAA6B;IAKnE,QAAQ,CAAC,GAAG,EAAE,GAAG;IAMjB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,wBAAwB;IAMhC,OAAO,CAAC,6BAA6B;IAS/B,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IA0BhD,OAAO,CAAC,yBAAyB;IAKjC,OAAO,CAAC,sBAAsB;CAMjC"}
@@ -34,8 +34,8 @@ class ManyToOneRelationFieldCrudManager {
34
34
  applyUserKeyFormatValidations(fieldUserKey) {
35
35
  const errors = [];
36
36
  !(0, class_validator_1.isString)(fieldUserKey) ? errors.push({ field: this.options.fieldName, error: 'Field is not a string' }) : "no errors";
37
- if ((0, class_validator_1.isEmpty)(this.options.modelUserKeyFieldName)) {
38
- errors.push({ field: this.options.fieldName, error: `UserKey field name is not defined in the model ${this.options.modelSingularName}` });
37
+ if ((0, class_validator_1.isEmpty)(this.options.relationCoModelUserKeyFieldName)) {
38
+ errors.push({ field: this.options.fieldName, error: `UserKey field name is not defined in the model ${this.options.relationCoModelSingularName}` });
39
39
  }
40
40
  return errors;
41
41
  }
@@ -52,9 +52,9 @@ class ManyToOneRelationFieldCrudManager {
52
52
  }
53
53
  }
54
54
  else {
55
- dto[this.options.fieldName] = await this.options.entityManager.getRepository(entityTarget).findOneBy({ [this.options.modelUserKeyFieldName]: fieldUserKeyValue });
55
+ dto[this.options.fieldName] = await this.options.entityManager.getRepository(entityTarget).findOneBy({ [this.options.relationCoModelUserKeyFieldName]: fieldUserKeyValue });
56
56
  if (this.options.required && (0, class_validator_1.isEmpty)(dto[this.options.fieldName])) {
57
- throw new Error(`ManyToOneRelationFieldCrudManager: Record with userKey: ${this.options.modelUserKeyFieldName}: ${fieldUserKeyValue} not found in ${this.options.relationCoModelSingularName}`);
57
+ throw new Error(`ManyToOneRelationFieldCrudManager: Record with userKey: ${this.options.relationCoModelUserKeyFieldName}: ${fieldUserKeyValue} not found in ${this.options.relationCoModelSingularName}`);
58
58
  }
59
59
  }
60
60
  return dto;
@@ -1 +1 @@
1
- {"version":3,"file":"ManyToOneRelationFieldCrudManager.js","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/ManyToOneRelationFieldCrudManager.ts"],"names":[],"mappings":";;;AAAA,oEAAkE;AAClE,qDAAgE;AAEhE,sEAA+D;AAc/D,MAAa,iCAAiC;IAG1C,YAA6B,OAAsC;QAAtC,YAAO,GAAP,OAAO,CAA+B;QAE/D,IAAI,CAAC,WAAW,GAAG,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC;QAC5C,IAAI,CAAC,gBAAgB,GAAG,GAAG,OAAO,CAAC,SAAS,SAAS,CAAC;IAC1D,CAAC;IACD,QAAQ,CAAC,GAAQ;QACb,MAAM,OAAO,GAAW,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9C,MAAM,YAAY,GAAW,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACxD,CAAC;IAEO,gBAAgB,CAAC,OAAY,EAAE,YAAoB;QACvD,MAAM,MAAM,GAAsB,EAAE,CAAC;QACrC,IAAI,CAAC,yBAAyB,EAAE,IAAI,IAAA,yBAAO,EAAC,OAAO,CAAC,IAAI,IAAA,yBAAO,EAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,6BAA6B,IAAI,CAAC,WAAW,OAAO,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAClQ,IAAI,IAAA,4BAAU,EAAC,OAAO,CAAC,E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ChE,MAAM,IAAI,KAAK,CAAC,2DAA2D,IAAI,CAAC,OAAO,CAAC,qBAAqB,KAAK,iBAAiB,iBAAiB,IAAI,CAAC,OAAO,CAAC,2BAA2B,EAAE,CAAC,CAAC;YACpM,CAAC;QACL,CAAC;QAGD,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,yBAAyB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACjC,CAAC;IAGO,sBAAsB,CAAC,iBAAyB;QACpD,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,eAAe,CAAC;QAC9E,MAAM,qBAAqB,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,iBAAiB,CAAC,CAAC;QACxF,OAAO,qBAAqB,CAAC,MAAM,CAAC;IACxC,CAAC;CAEJ;AA9ED,8EA8EC","sourcesContent":["import { classify } from \"@angular-devkit/core/src/utils/strings\";\nimport { isEmpty, isNotEmpty, isString } from \"class-validator\";\nimport { FieldCrudManager, ValidationError } from \"src/interfaces\";\nimport { IsParsableInt } from \"src/validators/is-parsable-int\";\nimport { EntityManager } from \"typeorm\";\n\nexport interface ManyToOneRelationFieldOptions {\n // Add options for relation field\n required: boolean | undefined | null;\n relationCoModelSingularName: string | undefined | null;\n fieldName: string | undefined | null;\n modelUserKeyFieldName: string | undefined | null;\n modelSingularName: string | undefined | null;\n entityManager: EntityManager;\n}\n\n// This implementation is meant to be used for many-to-one relation field\nexport class ManyToOneRelationFieldCrudManager implements FieldCrudManager {\n private idFieldName: string;\n private userKeyFieldName: string;\n constructor(private readonly options: ManyToOneRelationFieldOptions) {\n // this.options = options;\n this.idFieldName = `${options.fieldName}Id`;\n this.userKeyFieldName = `${options.fieldName}UserKey`;\n }\n validate(dto: any) {\n const fieldId: number = dto[this.idFieldName];\n const fieldUserKey: string = dto[this.userKeyFieldName];\n return this.applyValidations(fieldId, fieldUserKey);\n }\n\n private applyValidations(fieldId: any, fieldUserKey: string): ValidationError[] {\n const errors: ValidationError[] = [];\n this.isApplyRequiredValidation() && isEmpty(fieldId) && isEmpty(fieldUserKey) ? errors.push({ field: this.options.fieldName, error: `Field: ${this.options.fieldName} is required. Either pass ${this.idFieldName} or ${this.userKeyFieldName}.` }) : \"no errors\";\n if (isNotEmpty(fieldId)) {\n errors.push(...this.applyIdFormatValidations(fieldId));\n }\n if (isNotEmpty(fieldUserKey)) {\n errors.push(...this.applyUserKeyFormatValidations(fieldUserKey));\n }\n return errors;\n }\n\n private applyIdFormatValidations(fieldId: any): ValidationError[] { //FIXME fieldId is any because it can be string or number. Keeping it any for compatibility with isParsableInt. \n const errors: ValidationError[] = [];\n !IsParsableInt(fieldId) ? errors.push({ field: this.options.fieldName, error: 'Field is not a integer' }) : \"no errors\";\n return errors;\n }\n\n private applyUserKeyFormatValidations(fieldUserKey: string): ValidationError[] {\n const errors: ValidationError[] = [];\n !isString(fieldUserKey) ? errors.push({ field: this.options.fieldName, error: 'Field is not a string' }) : \"no errors\";\n if (isEmpty(this.options.modelUserKeyFieldName)) {\n errors.push({ field: this.options.fieldName, error: `UserKey field name is not defined in the model ${this.options.modelSingularName}` });\n }\n return errors;\n }\n\n async transformForCreate(dto: any): Promise<any> {\n const fieldId: number = dto[this.idFieldName];\n const fieldUserKeyValue: string = dto[this.userKeyFieldName];\n\n // Avoid transforming if both fieldId and fieldUserKey is empty\n if ((isEmpty(fieldId)) && isEmpty(fieldUserKeyValue)) return dto;\n\n // // Load the related entity from the database, using the repository of the related entity\n const entityTarget = this.getRelatedEntityTarget(classify(this.options.relationCoModelSingularName));\n if (isNotEmpty(fieldId)) {\n dto[this.options.fieldName] = await this.options.entityManager.getRepository(entityTarget).findOneBy({ id: fieldId });\n if (this.options.required && isEmpty(dto[this.options.fieldName])) {\n throw new Error(`ManyToOneRelationFieldCrudManager: Record with id: ${fieldId} not found in ${this.options.relationCoModelSingularName}`);\n }\n }\n else {\n dto[this.options.fieldName] = await this.options.entityManager.getRepository(entityTarget).findOneBy({ [this.options.modelUserKeyFieldName]: fieldUserKeyValue });\n if (this.options.required && isEmpty(dto[this.options.fieldName])) {\n throw new Error(`ManyToOneRelationFieldCrudManager: Record with userKey: ${this.options.modelUserKeyFieldName}: ${fieldUserKeyValue} not found in ${this.options.relationCoModelSingularName}`);\n }\n }\n\n\n return dto;\n }\n\n private isApplyRequiredValidation(): boolean {\n return this.options.required;\n }\n\n // Returns the entity target class from the entity name\n private getRelatedEntityTarget(relatedEntityName: string): any {\n const entityMetadatas = this.options.entityManager.connection.entityMetadatas;\n const relatedEntityMetadata = entityMetadatas.find(em => em.name === relatedEntityName);\n return relatedEntityMetadata.target;\n }\n\n}"]}
1
+ {"version":3,"file":"ManyToOneRelationFieldCrudManager.js","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/ManyToOneRelationFieldCrudManager.ts"],"names":[],"mappings":";;;AAAA,oEAAkE;AAClE,qDAAgE;AAEhE,sEAA+D;AAe/D,MAAa,iCAAiC;IAG1C,YAA6B,OAAsC;QAAtC,YAAO,GAAP,OAAO,CAA+B;QAE/D,IAAI,CAAC,WAAW,GAAG,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC;QAC5C,IAAI,CAAC,gBAAgB,GAAG,GAAG,OAAO,CAAC,SAAS,SAAS,CAAC;IAC1D,CAAC;IACD,QAAQ,CAAC,GAAQ;QACb,MAAM,OAAO,GAAW,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9C,MAAM,YAAY,GAAW,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACxD,CAAC;IAEO,gBAAgB,CAAC,OAAY,EAAE,YAAoB;QACvD,MAAM,MAAM,GAAsB,EAAE,CAAC;QACrC,IAAI,CAAC,yBAAyB,EAAE,IAAI,IAAA,yBAAO,EAAC,OAAO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AAO,CAAC,SAAS,CAAC,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,+BAA+B,CAAC,EAAE,iBAAiB,EAAE,CAAC,CAAC;YAC5K,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAA,yBAAO,EAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;gBAChE,MAAM,IAAI,KAAK,CAAC,2DAA2D,IAAI,CAAC,OAAO,CAAC,+BAA+B,KAAK,iBAAiB,iBAAiB,IAAI,CAAC,OAAO,CAAC,2BAA2B,EAAE,CAAC,CAAC;YAC9M,CAAC;QACL,CAAC;QAGD,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,yBAAyB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACjC,CAAC;IAGO,sBAAsB,CAAC,iBAAyB;QACpD,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,eAAe,CAAC;QAC9E,MAAM,qBAAqB,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,iBAAiB,CAAC,CAAC;QACxF,OAAO,qBAAqB,CAAC,MAAM,CAAC;IACxC,CAAC;CAEJ;AA9ED,8EA8EC","sourcesContent":["import { classify } from \"@angular-devkit/core/src/utils/strings\";\nimport { isEmpty, isNotEmpty, isString } from \"class-validator\";\nimport { FieldCrudManager, ValidationError } from \"src/interfaces\";\nimport { IsParsableInt } from \"src/validators/is-parsable-int\";\nimport { EntityManager } from \"typeorm\";\n\nexport interface ManyToOneRelationFieldOptions {\n // Add options for relation field\n required: boolean | undefined | null;\n relationCoModelSingularName: string | undefined | null;\n fieldName: string | undefined | null;\n // modelUserKeyFieldName: string | undefined | null;\n modelSingularName: string | undefined | null;\n entityManager: EntityManager;\n relationCoModelUserKeyFieldName: string | undefined | null; \n}\n\n// This implementation is meant to be used for many-to-one relation field\nexport class ManyToOneRelationFieldCrudManager implements FieldCrudManager {\n private idFieldName: string;\n private userKeyFieldName: string;\n constructor(private readonly options: ManyToOneRelationFieldOptions) {\n // this.options = options;\n this.idFieldName = `${options.fieldName}Id`;\n this.userKeyFieldName = `${options.fieldName}UserKey`;\n }\n validate(dto: any) {\n const fieldId: number = dto[this.idFieldName];\n const fieldUserKey: string = dto[this.userKeyFieldName];\n return this.applyValidations(fieldId, fieldUserKey);\n }\n\n private applyValidations(fieldId: any, fieldUserKey: string): ValidationError[] {\n const errors: ValidationError[] = [];\n this.isApplyRequiredValidation() && isEmpty(fieldId) && isEmpty(fieldUserKey) ? errors.push({ field: this.options.fieldName, error: `Field: ${this.options.fieldName} is required. Either pass ${this.idFieldName} or ${this.userKeyFieldName}.` }) : \"no errors\";\n if (isNotEmpty(fieldId)) {\n errors.push(...this.applyIdFormatValidations(fieldId));\n }\n if (isNotEmpty(fieldUserKey)) {\n errors.push(...this.applyUserKeyFormatValidations(fieldUserKey));\n }\n return errors;\n }\n\n private applyIdFormatValidations(fieldId: any): ValidationError[] { //FIXME fieldId is any because it can be string or number. Keeping it any for compatibility with isParsableInt. \n const errors: ValidationError[] = [];\n !IsParsableInt(fieldId) ? errors.push({ field: this.options.fieldName, error: 'Field is not a integer' }) : \"no errors\";\n return errors;\n }\n\n private applyUserKeyFormatValidations(fieldUserKey: string): ValidationError[] {\n const errors: ValidationError[] = [];\n !isString(fieldUserKey) ? errors.push({ field: this.options.fieldName, error: 'Field is not a string' }) : \"no errors\";\n if (isEmpty(this.options.relationCoModelUserKeyFieldName)) {\n errors.push({ field: this.options.fieldName, error: `UserKey field name is not defined in the model ${this.options.relationCoModelSingularName}` });\n }\n return errors;\n }\n\n async transformForCreate(dto: any): Promise<any> {\n const fieldId: number = dto[this.idFieldName];\n const fieldUserKeyValue: string = dto[this.userKeyFieldName];\n\n // Avoid transforming if both fieldId and fieldUserKey is empty\n if ((isEmpty(fieldId)) && isEmpty(fieldUserKeyValue)) return dto;\n\n // // Load the related entity from the database, using the repository of the related entity\n const entityTarget = this.getRelatedEntityTarget(classify(this.options.relationCoModelSingularName));\n if (isNotEmpty(fieldId)) {\n dto[this.options.fieldName] = await this.options.entityManager.getRepository(entityTarget).findOneBy({ id: fieldId });\n if (this.options.required && isEmpty(dto[this.options.fieldName])) {\n throw new Error(`ManyToOneRelationFieldCrudManager: Record with id: ${fieldId} not found in ${this.options.relationCoModelSingularName}`);\n }\n }\n else {\n dto[this.options.fieldName] = await this.options.entityManager.getRepository(entityTarget).findOneBy({ [this.options.relationCoModelUserKeyFieldName]: fieldUserKeyValue });\n if (this.options.required && isEmpty(dto[this.options.fieldName])) {\n throw new Error(`ManyToOneRelationFieldCrudManager: Record with userKey: ${this.options.relationCoModelUserKeyFieldName}: ${fieldUserKeyValue} not found in ${this.options.relationCoModelSingularName}`);\n }\n }\n\n\n return dto;\n }\n\n private isApplyRequiredValidation(): boolean {\n return this.options.required;\n }\n\n // Returns the entity target class from the entity name\n private getRelatedEntityTarget(relatedEntityName: string): any {\n const entityMetadatas = this.options.entityManager.connection.entityMetadatas;\n const relatedEntityMetadata = entityMetadatas.find(em => em.name === relatedEntityName);\n return relatedEntityMetadata.target;\n }\n\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"module.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/module.helper.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,QAAO,MAAM,EAe5C,CAAA;AAED,eAAO,MAAM,kBAAkB,QAAO,MAAM,EAG3C,CAAA"}
1
+ {"version":3,"file":"module.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/module.helper.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,QAAO,MAAM,EA4B9C,CAAA;AAED,eAAO,MAAM,kBAAkB,QAAO,MAAM,EAG3C,CAAA"}
@@ -43,8 +43,15 @@ const getDynamicModuleNames = () => {
43
43
  const allExcludedModules = [...new Set([...coreModuleNames, ...dynamicModulesToExclude])];
44
44
  const directories = fs.readdirSync(srcPath, { withFileTypes: true });
45
45
  const enabledModules = directories
46
- .filter(d => d.isDirectory() && !allExcludedModules.includes(d.name))
47
- .map(d => d.name);
46
+ .filter(dirent => {
47
+ const isValidDirectory = dirent.isDirectory() && !allExcludedModules.includes(dirent.name);
48
+ if (!isValidDirectory)
49
+ return false;
50
+ const fullPath = path.join(srcPath, dirent.name);
51
+ const files = fs.readdirSync(fullPath);
52
+ return files.length > 0;
53
+ })
54
+ .map(dirent => dirent.name);
48
55
  console.log(`Enabled dynamic modules:`, enabledModules);
49
56
  return enabledModules;
50
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"module.helper.js","sourceRoot":"","sources":["../../src/helpers/module.helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAGtB,MAAM,qBAAqB,GAAG,GAAa,EAAE;IAChD,MAAM,uBAAuB,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAG/F,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;IAChD,MAAM,eAAe,GAAG,IAAA,0BAAkB,GAAE,CAAC;IAC7C,MAAM,kBAAkB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,eAAe,EAAE,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAE1F,MAAM,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IACrE,MAAM,cAAc,GAAG,WAAW;SAC/B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SACpE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAEpB,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,cAAc,CAAC,CAAC;IACxD,OAAO,cAAc,CAAC;AACxB,CAAC,CAAA;AAfU,QAAA,qBAAqB,yBAe/B;AAEM,MAAM,kBAAkB,GAAG,GAAa,EAAE;IAE/C,OAAO,CAAC,YAAY,CAAC,CAAC;AACxB,CAAC,CAAA;AAHY,QAAA,kBAAkB,sBAG9B","sourcesContent":["import * as fs from 'fs'; // Use the Promise-based version of fs for async/await\nimport * as path from 'path'; // To handle file paths\n\n\nexport const getDynamicModuleNames = (): string[] => {\n const dynamicModulesToExclude = process.env.SOLID_DYNAMIC_MODULES_TO_EXCLUDE?.split(',') || [];\n \n // Adjust if 'src' is in a different location\n const srcPath = path.join(process.cwd(), 'src');\n const coreModuleNames = getCoreModuleNames();\n const allExcludedModules = [...new Set([...coreModuleNames, ...dynamicModulesToExclude])];\n \n const directories = fs.readdirSync(srcPath, { withFileTypes: true });\n const enabledModules = directories\n .filter(d => d.isDirectory() && !allExcludedModules.includes(d.name))\n .map(d => d.name);\n \n console.log(`Enabled dynamic modules:`, enabledModules);\n return enabledModules;\n }\n \n export const getCoreModuleNames = (): string[] => {\n // return ['iam', 'common', 'queues', 'app-builder'];\n return ['solid-core'];\n }"]}
1
+ {"version":3,"file":"module.helper.js","sourceRoot":"","sources":["../../src/helpers/module.helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAGtB,MAAM,qBAAqB,GAAG,GAAa,EAAE;IAClD,MAAM,uBAAuB,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IA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le file paths\n\n\nexport const getDynamicModuleNames = (): string[] => {\n const dynamicModulesToExclude = process.env.SOLID_DYNAMIC_MODULES_TO_EXCLUDE?.split(',') || [];\n\n // Adjust if 'src' is in a different location\n const srcPath = path.join(process.cwd(), 'src');\n const coreModuleNames = getCoreModuleNames();\n const allExcludedModules = [...new Set([...coreModuleNames, ...dynamicModulesToExclude])];\n\n const directories = fs.readdirSync(srcPath, { withFileTypes: true });\n // const enabledModules = directories\n // .filter(d => d.isDirectory() && !allExcludedModules.includes(d.name))\n // .map(d => d.name);\n\n const enabledModules = directories\n .filter(dirent => {\n const isValidDirectory = dirent.isDirectory() && !allExcludedModules.includes(dirent.name);\n\n if (!isValidDirectory) return false;\n\n const fullPath = path.join(srcPath, dirent.name);\n const files = fs.readdirSync(fullPath);\n // skip if empty directory\n return files.length > 0;\n })\n .map(dirent => dirent.name);\n\n console.log(`Enabled dynamic modules:`, enabledModules);\n return enabledModules;\n}\n\nexport const getCoreModuleNames = (): string[] => {\n // return ['iam', 'common', 'queues', 'app-builder'];\n return ['solid-core'];\n}"]}
@@ -4308,6 +4308,33 @@
4308
4308
  "isSystem": true,
4309
4309
  "isUserKey": true
4310
4310
  },
4311
+ {
4312
+ "name": "displayName",
4313
+ "displayName": "Display Name",
4314
+ "type": "shortText",
4315
+ "ormType": "varchar",
4316
+ "length": 256,
4317
+ "required": false,
4318
+ "unique": false,
4319
+ "index": false,
4320
+ "private": false,
4321
+ "encrypt": false,
4322
+ "isSystem": true,
4323
+ "isUserKey": false
4324
+ },
4325
+ {
4326
+ "name": "description",
4327
+ "displayName": "Description",
4328
+ "type": "longText",
4329
+ "ormType": "text",
4330
+ "required": false,
4331
+ "unique": false,
4332
+ "index": false,
4333
+ "private": false,
4334
+ "encrypt": false,
4335
+ "isSystem": true,
4336
+ "description": "This is a description of the dashboard configuration, providing context and details about the dashboard."
4337
+ },
4311
4338
  {
4312
4339
  "name": "layoutJson",
4313
4340
  "displayName": "Layout Json",
@@ -11075,6 +11102,12 @@
11075
11102
  "name": "name"
11076
11103
  }
11077
11104
  },
11105
+ {
11106
+ "type": "field",
11107
+ "attrs": {
11108
+ "name": "displayName"
11109
+ }
11110
+ },
11078
11111
  {
11079
11112
  "type": "field",
11080
11113
  "attrs": {
@@ -11138,6 +11171,18 @@
11138
11171
  "name": "name"
11139
11172
  }
11140
11173
  },
11174
+ {
11175
+ "type": "field",
11176
+ "attrs": {
11177
+ "name": "displayName"
11178
+ }
11179
+ },
11180
+ {
11181
+ "type": "field",
11182
+ "attrs": {
11183
+ "name": "description"
11184
+ }
11185
+ },
11141
11186
  {
11142
11187
  "type": "field",
11143
11188
  "attrs": {
@@ -70,5 +70,6 @@ export declare class CRUDService<T> {
70
70
  recoveredIds: number[];
71
71
  }>;
72
72
  getFieldMetadataRecursively(pathParts: string[], fields: FieldMetadata[]): any;
73
+ getUserKeyFieldNameForModel(modelSingularName: string): Promise<string>;
73
74
  }
74
75
  //# sourceMappingURL=crud.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crud.service.d.ts","sourceRoot":"","sources":["../../src/services/crud.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAc,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAyD,MAAM,SAAS,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAsBlE,OAAO,EAAoB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,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AAC,GAAG,EAAE,MAAM,EAAE,EAAE,mBAAmB,GAAE,GAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IA4CtE,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,mBAAmB,GAAE,GAAQ;;;;IAwCjD,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,mBAAmB,GAAE,GAAQ;;;;IAmDxD,2BAA2B,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE;IAiCxE,2BAA2B,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAOhF"}
@@ -84,7 +84,7 @@ class CRUDService {
84
84
  });
85
85
  }
86
86
  async validateAndTransformDto(field, dto, files, hasMediaFields, isPartialUpdate = false, isUpdate = false) {
87
- const fieldManager = this.fieldCrudManager(field, this.entityManager, isPartialUpdate, isUpdate);
87
+ const fieldManager = await this.fieldCrudManager(field, this.entityManager, isPartialUpdate, isUpdate);
88
88
  const validationErrors = fieldManager.validate(dto, files);
89
89
  const errors = (validationErrors instanceof Promise) ? await validationErrors : validationErrors;
90
90
  if (errors.length > 0) {
@@ -189,7 +189,7 @@ class CRUDService {
189
189
  return this.repo.remove(entity);
190
190
  }
191
191
  }
192
- fieldCrudManager(fieldMetadata, entityManager, isPartialUpdate = false, isUpdate = false) {
192
+ async fieldCrudManager(fieldMetadata, entityManager, isPartialUpdate = false, isUpdate = false) {
193
193
  const commonOptions = { required: fieldMetadata.required && !isPartialUpdate, fieldName: fieldMetadata.name, isUpdate };
194
194
  switch (fieldMetadata.type) {
195
195
  case create_field_metadata_dto_1.SolidFieldType.shortText: {
@@ -244,11 +244,12 @@ class CRUDService {
244
244
  }
245
245
  case create_field_metadata_dto_1.SolidFieldType.relation: {
246
246
  if (fieldMetadata.relationType === create_field_metadata_dto_1.RelationType.manyToOne) {
247
+ const relationCoModelUserKeyFieldName = await this.getUserKeyFieldNameForModel(fieldMetadata.relationCoModelSingularName);
247
248
  const manyToOneOptions = {
248
249
  ...commonOptions,
249
250
  relationCoModelSingularName: fieldMetadata.relationCoModelSingularName,
250
- modelUserKeyFieldName: fieldMetadata.model.userKeyField?.name,
251
251
  modelSingularName: fieldMetadata.model.singularName,
252
+ relationCoModelUserKeyFieldName: relationCoModelUserKeyFieldName,
252
253
  entityManager,
253
254
  };
254
255
  return new ManyToOneRelationFieldCrudManager_1.ManyToOneRelationFieldCrudManager(manyToOneOptions);
@@ -517,7 +518,7 @@ class CRUDService {
517
518
  const files = [];
518
519
  let hasMediaFields = false;
519
520
  for (const field of model.fields) {
520
- const fieldManager = this.fieldCrudManager(field, this.entityManager);
521
+ const fieldManager = await this.fieldCrudManager(field, this.entityManager);
521
522
  const validationErrors = await fieldManager.validate(createDto, files);
522
523
  if (validationErrors.length > 0) {
523
524
  throw new common_1.BadRequestException(`Validation errors in ${field.name} are invalid: ${validationErrors.map(e => e.error).join(', ')}`);
@@ -658,6 +659,13 @@ class CRUDService {
658
659
  }
659
660
  return this.getFieldMetadataRecursively(remainingParts, relationCoModel.fields);
660
661
  }
662
+ async getUserKeyFieldNameForModel(modelSingularName) {
663
+ const model = await this.modelMetadataService.findOneBySingularName(modelSingularName, ['userKeyField']);
664
+ if (!model) {
665
+ throw new common_1.BadRequestException(`Model ${modelSingularName} not found`);
666
+ }
667
+ return model.userKeyField?.name || '';
668
+ }
661
669
  }
662
670
  exports.CRUDService = CRUDService;
663
671
  //# sourceMappingURL=crud.service.js.map