@solidstarters/solid-core 1.2.137 → 1.2.138

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 (51) 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/module.helper.d.ts.map +1 -1
  20. package/dist/helpers/module.helper.js +9 -2
  21. package/dist/helpers/module.helper.js.map +1 -1
  22. package/dist/seeders/seed-data/solid-core-metadata.json +45 -0
  23. package/dist/services/dashboard.service.d.ts.map +1 -1
  24. package/dist/services/dashboard.service.js +7 -2
  25. package/dist/services/dashboard.service.js.map +1 -1
  26. package/dist/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.d.ts +4 -1
  27. package/dist/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.d.ts.map +1 -1
  28. package/dist/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.js +4 -2
  29. package/dist/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.js.map +1 -1
  30. package/dist/services/sql-expression-resolver.service.d.ts +3 -0
  31. package/dist/services/sql-expression-resolver.service.d.ts.map +1 -1
  32. package/dist/services/sql-expression-resolver.service.js +18 -3
  33. package/dist/services/sql-expression-resolver.service.js.map +1 -1
  34. package/dist/subscribers/dashboard.subscriber.d.ts +1 -0
  35. package/dist/subscribers/dashboard.subscriber.d.ts.map +1 -1
  36. package/dist/subscribers/dashboard.subscriber.js +17 -2
  37. package/dist/subscribers/dashboard.subscriber.js.map +1 -1
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +1 -1
  40. package/src/dtos/create-dashboard-question.dto.ts +4 -5
  41. package/src/dtos/create-dashboard.dto.ts +8 -0
  42. package/src/dtos/update-dashboard-question.dto.ts +4 -5
  43. package/src/dtos/update-dashboard.dto.ts +8 -0
  44. package/src/entities/dashboard-question.entity.ts +2 -3
  45. package/src/entities/dashboard.entity.ts +4 -0
  46. package/src/helpers/module.helper.ts +33 -20
  47. package/src/seeders/seed-data/solid-core-metadata.json +45 -0
  48. package/src/services/dashboard.service.ts +7 -2
  49. package/src/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.ts +5 -2
  50. package/src/services/sql-expression-resolver.service.ts +16 -2
  51. package/src/subscribers/dashboard.subscriber.ts +24 -3
@@ -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,MAAM,CAAC;IAIf,cAAc,EAAE,MAAM,CAAC;CAC1B"}
@@ -1 +1 @@
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;;;;CAwDtC;AAxDD,gEAwDC;AApDG;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;wDACD;AAIb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA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A,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,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 { 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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,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;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;IAIf,cAAc,EAAE,MAAM,CAAC;CAC1B"}
@@ -1 +1 @@
1
-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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;AAKnB;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\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,GA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W,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":"","sources":["../../src/dtos/update-dashboard.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAA0G;AAC1G,6CAA8C;AAC9C,yDAAyC;AACzC,mFAAoF;AACpF,mFAAoF;AAEpF,MAAa,kBAAkB;;;;CA0D9B;AA1DD,gDA0DC;AAvDG;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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ent":["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,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;IAEf,cAAc,EAAE,MAAM,CAAC;CAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-question.entity.js","sourceRoot":"","sources":["../../src/entities/dashboard-question.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAyD;AACzD,qCAAkF;AAClF,yDAA0D;AAC1D,iHAA6G;AAGtG,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,4BAAY;;;;CA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ourcesContent":["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.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAyD;AACzD,qCAAkF;AAClF,yDAA0D;AAC1D,iHAA6G;AAGtG,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,4BAAY;;;;CAyBlD,CAAA;AAzBY,8CAAiB;AAG1B;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;+CACf;AAGb;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,CAAC;;qDACQ;AAGnB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,CAAC;;uDACU;AAErB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACvB;AAGrB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,4BAAS,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACnE,IAAA,oBAAU,GAAE;8BACF,4BAAS;oDAAC;AAErB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gFAAiC,EAAE,iCAAiC,CAAC,EAAE,CAAC,iCAAiC,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;oEACxF;AAE/D;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,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;AAEf;IADC,IAAA,gBAAM,EAAC,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}"]}
@@ -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;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;IAKrE,MAAM,cAAc,GAAG,WAAW;SAC/B,MAAM,CAAC,MAAM,CAAC,EAAE;QACf,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE3F,IAAI,CAAC,gBAAgB;YAAE,OAAO,KAAK,CAAC;QAEpC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QACjD,MAAM,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAEvC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1B,CAAC,CAAC;SACD,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAE9B,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,cAAc,CAAC,CAAC;IACxD,OAAO,cAAc,CAAC;AACxB,CAAC,CAAA;AA5BY,QAAA,qBAAqB,yBA4BjC;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 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": {
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.service.d.ts","sourceRoot":"","sources":["../../src/services/dashboard.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAA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AAC,SAAS,CAAC;IAGxD,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB;IACnD,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB;IACrD,QAAQ,CAAC,aAAa,EAAE,aAAa;IACrC,QAAQ,CAAC,WAAW,EAAE,WAAW;IACjC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB;IAC3C,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB;IAE7C,QAAQ,CAAC,aAAa,EAAE,aAAa;IACrC,QAAQ,CAAC,IAAI,EAAE,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS;IAC7B,QAAQ,CAAC,aAAa,EAAE,aAAa;IACrC,QAAQ,CAAC,2BAA2B,EAAE,2BAA2B;IACjE,QAAQ,CAAC,eAAe,EAAE,eAAe;IAd3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;gBAEjD,oBAAoB,EAAE,oBAAoB,EAC1C,qBAAqB,EAAE,qBAAqB,EAC5C,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,iBAAiB,EAEpC,aAAa,EAAE,aAAa,EAC5B,IAAI,EAAE,mBAAmB,EACzB,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,2BAA2B,EAAE,2BAA2B,EACxD,eAAe,EAAE,eAAe;IAKrC,yBAAyB,CAAC,KAAK,EAAE,yCAAyC;IAkBhF,OAAO,CAAC,yBAAyB;YAoBnB,qBAAqB;IAY7B,qBAAqB,CAAC,MAAM,EAAE,SAAS;YAuB/B,oBAAoB;YAWpB,aAAa;CAqB5B"}
@@ -144,10 +144,15 @@ let DashboardService = class DashboardService extends crud_service_1.CRUDService
144
144
  return { filePath, metaData };
145
145
  }
146
146
  async writeToConfig(metaData, dashboard, filePath) {
147
- if (metaData.dashboards) {
147
+ if (metaData.dashboards && Array.isArray(metaData.dashboards)) {
148
148
  const dashboardIndex = metaData.dashboards?.findIndex((dashboardFromFile) => dashboardFromFile.name === dashboard.name);
149
149
  const dto = await this.dashboardMapper.toDto(dashboard);
150
- metaData.dashboards[dashboardIndex] = dto;
150
+ if (dashboardIndex !== -1) {
151
+ metaData.dashboards[dashboardIndex] = dto;
152
+ }
153
+ else {
154
+ metaData.dashboards.push(dto);
155
+ }
151
156
  }
152
157
  else {
153
158
  const dashboards = [];
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.service.js","sourceRoot":"","sources":["../../src/services/dashboard.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAuE;AACvE,uCAA2D;AAC3D,6CAAsD;AACtD,qCAAwC;AAExC,2CAA+C;AAC/C,+DAAqE;AACrE,iDAAwD;AACxD,iDAAwD;AACxD,qEAA2E;AAC3E,uEAA6E;AAG7E,gDAAkC;AAClC,yFAAoF;AAEpF,qFAA2E;AAC3E,8FAAyF;AACzF,8DAA2D;AAC3D,kEAA+D;AAC/D,6EAA0E;AAI7D,QAAA,yBAAyB,GAAG,qCAAqC,CAAC;AAExE,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,0BAAsB;IAE1D,YACW,oBAA0C,EAC1C,qBAA4C,EAC5C,aAA4B,EAC5B,WAAwB,EACxB,gBAAkC,EAClC,iBAAoC,EAE7C,aAAqC,EAC5B,IAAyB,EACzB,SAAoB,EACpB,aAA4B,EAC5B,2BAAwD,EACxD,eAAgC;QAEzC,KAAK,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QAdtK,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,kBAAa,GAAb,aAAa,CAAe;QAC5B,gBAAW,GAAX,WAAW,CA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c,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACzD,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC/C,CAAC;CACF,CAAA;AAxHY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAUR,WAAA,IAAA,6BAAmB,GAAE,CAAA;qCANS,6CAAoB;QACnB,+CAAqB;QAC7B,sBAAa;QACf,0BAAW;QACN,uBAAgB;QACf,uCAAiB;QAErB,uBAAa;QACtB,0CAAmB;QACd,gBAAS;QACL,8BAAa;QACC,4DAA2B;QACvC,kCAAe;GAfhC,gBAAgB,CAwH5B","sourcesContent":["import { Injectable, Logger, NotFoundException } from '@nestjs/common';\nimport { DiscoveryService, ModuleRef } from \"@nestjs/core\";\nimport { InjectEntityManager } from '@nestjs/typeorm';\nimport { EntityManager } from 'typeorm';\n\nimport { ConfigService } from '@nestjs/config';\nimport { CrudHelperService } from 'src/services/crud-helper.service';\nimport { CRUDService } from 'src/services/crud.service';\nimport { FileService } from 'src/services/file.service';\nimport { ModelMetadataService } from 'src/services/model-metadata.service';\nimport { ModuleMetadataService } from 'src/services/module-metadata.service';\n\n\nimport * as fs from 'fs/promises'; // Use the Promise-based version of fs for async/await\nimport { SelectionDynamicSourceType } from 'src/dtos/create-dashboard-variable.dto';\nimport { DashboardVariableSelectionDynamicQueryDto } from 'src/dtos/dashboard-variable-selection-dynamic-query.dto';\nimport { DashboardVariable } from 'src/entities/dashboard-variable.entity';\nimport { ModuleMetadataHelperService } from 'src/helpers/module-metadata-helper.service';\nimport { SolidRegistry } from 'src/helpers/solid-registry';\nimport { DashboardMapper } from 'src/mappers/dashboard-mapper';\nimport { DashboardRepository } from 'src/repository/dashboard.repository';\nimport { Dashboard } from '../entities/dashboard.entity';\n\n\nexport const SQL_DYNAMIC_PROVIDER_NAME = 'DashboardVariableSQLDynamicProvider';\n@Injectable()\nexport class DashboardService extends CRUDService<Dashboard> {\n private readonly logger = new Logger(this.constructor.name);\n constructor(\n readonly modelMetadataService: ModelMetadataService,\n readonly moduleMetadataService: ModuleMetadataService,\n readonly configService: ConfigService,\n readonly fileService: FileService,\n readonly discoveryService: DiscoveryService,\n readonly crudHelperService: CrudHelperService,\n @InjectEntityManager()\n readonly entityManager: EntityManager,\n readonly repo: DashboardRepository, // Assuming you have a DashboardRepository for custom queries\n readonly moduleRef: ModuleRef,\n readonly solidRegistry: SolidRegistry, // Assuming solidRegistry is injected for selection providers\n readonly moduleMetadataHelperService: ModuleMetadataHelperService,\n readonly dashboardMapper: DashboardMapper,\n ) {\n super(modelMetadataService, moduleMetadataService, configService, fileService, discoveryService, crudHelperService, entityManager, repo, 'dashboard', 'solid-core', moduleRef);\n }\n\n async getSelectionDynamicValues(query: DashboardVariableSelectionDynamicQueryDto) {\n // Get the dashboard variable repo\n const dashboardVariable = await this.loadDashboardVariable(query.variableId);\n\n // Get the providerName and context for the dashboard variable\n const [providerName, context] = this.getProviderNameAndContext(dashboardVariable, query);\n\n // Get hold of the provider instance from the SolidRegistry\n const selectionProviderInstance = this.solidRegistry.getDashboardVariableSelectionProviderInstance(providerName);\n if (!selectionProviderInstance) {\n throw new NotFoundException(`Field incorrectly configured. No provider with name ${providerName} registered in backend.`);\n }\n\n // 4. Call the provider's getSelectionDynamicValues method\n return selectionProviderInstance.values(query.query, context);\n }\n\n\n private getProviderNameAndContext(dashboardVariable: DashboardVariable, query: DashboardVariableSelectionDynamicQueryDto): [string, any] {\n const sourceType = dashboardVariable.selectionDynamicSourceType;\n\n // Get the appropriate provide name based on the source type\n let providerName: string;\n const context = { limit: query.limit, offset: query.offset };\n switch (sourceType) {\n case SelectionDynamicSourceType.SQL:\n providerName = SQL_DYNAMIC_PROVIDER_NAME;\n context['sql'] = dashboardVariable.selectionDynamicSQL;\n break;\n case SelectionDynamicSourceType.PROVIDER:\n providerName = dashboardVariable.selectionDynamicProviderName;\n break;\n default:\n throw new Error(`Unsupported selection dynamic source type: ${sourceType}`);\n }\n return [providerName, context];\n }\n\n private async loadDashboardVariable(variableId: number) {\n const dashboardVariableRepo = this.entityManager.getRepository(DashboardVariable);\n\n // Load the dashboard record using the field\n const dashboardVariable = await dashboardVariableRepo.findOne({\n where: {\n id: variableId,\n },\n });\n return dashboardVariable;\n }\n\n async saveDashboardToConfig(entity: Dashboard) {\n if (!entity) {\n this.logger.debug('No entity found in the DashboardSubscriber saveDashboardToConfig method');\n return;\n }\n\n // Validate dashboard details\n const dashboard = entity as Dashboard;\n const moduleMetadata = entity.module;\n if (!moduleMetadata) {\n throw new Error(`Module metadata not found for dashboard id ${entity.id}`);\n }\n\n // Get config file details\n const { filePath, metaData } = await this.getConfigFileDetails(moduleMetadata.name);\n if (!filePath || !metaData) {\n throw new Error(`Configuration details not found for module: ${moduleMetadata.name}`);\n }\n\n // Write the dashboard to the config file\n await this.writeToConfig(metaData, dashboard, filePath);\n }\n\n private async getConfigFileDetails(moduleName: string): Promise<{ filePath: string; metaData: any }> {\n const filePath = await this.moduleMetadataHelperService.getModuleMetadataFilePath(moduleName);\n try {\n await fs.access(filePath);\n } catch (error) {\n throw new Error(`Configuration file not found for module: ${moduleName}`);\n }\n const metaData = await this.moduleMetadataHelperService.getModuleMetadataConfiguration(filePath);\n return { filePath, metaData };\n }\n\n private async writeToConfig(metaData: any, dashboard: Dashboard, filePath: string) {\n if (metaData.dashboards) {\n const dashboardIndex = metaData.dashboards?.findIndex((dashboardFromFile: { name: string; }) => dashboardFromFile.name === dashboard.name);\n const dto = await this.dashboardMapper.toDto(dashboard);\n metaData.dashboards[dashboardIndex] = dto;\n }\n else {\n const dashboards = [];\n const dto = await this.dashboardMapper.toDto(dashboard);\n dashboards.push(dto);\n metaData.dashboards = dashboards;\n }\n // Write the updated object back to the file\n const updatedContent = JSON.stringify(metaData, null, 2);\n await fs.writeFile(filePath, updatedContent);\n }\n}"]}
1
+ {"version":3,"file":"dashboard.service.js","sourceRoot":"","sources":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SAAS,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC/C,CAAC;CACF,CAAA;AA7HY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAUR,WAAA,IAAA,6BAAmB,GAAE,CAAA;qCANS,6CAAoB;QACnB,+CAAqB;QAC7B,sBAAa;QACf,0BAAW;QACN,uBAAgB;QACf,uCAAiB;QAErB,uBAAa;QACtB,0CAAmB;QACd,gBAAS;QACL,8BAAa;QACC,4DAA2B;QACvC,kCAAe;GAfhC,gBAAgB,CA6H5B","sourcesContent":["import { Injectable, Logger, NotFoundException } from '@nestjs/common';\nimport { DiscoveryService, ModuleRef } from \"@nestjs/core\";\nimport { InjectEntityManager } from '@nestjs/typeorm';\nimport { EntityManager } from 'typeorm';\n\nimport { ConfigService } from '@nestjs/config';\nimport { CrudHelperService } from 'src/services/crud-helper.service';\nimport { CRUDService } from 'src/services/crud.service';\nimport { FileService } from 'src/services/file.service';\nimport { ModelMetadataService } from 'src/services/model-metadata.service';\nimport { ModuleMetadataService } from 'src/services/module-metadata.service';\n\n\nimport * as fs from 'fs/promises'; // Use the Promise-based version of fs for async/await\nimport { SelectionDynamicSourceType } from 'src/dtos/create-dashboard-variable.dto';\nimport { DashboardVariableSelectionDynamicQueryDto } from 'src/dtos/dashboard-variable-selection-dynamic-query.dto';\nimport { DashboardVariable } from 'src/entities/dashboard-variable.entity';\nimport { ModuleMetadataHelperService } from 'src/helpers/module-metadata-helper.service';\nimport { SolidRegistry } from 'src/helpers/solid-registry';\nimport { DashboardMapper } from 'src/mappers/dashboard-mapper';\nimport { DashboardRepository } from 'src/repository/dashboard.repository';\nimport { Dashboard } from '../entities/dashboard.entity';\n\n\nexport const SQL_DYNAMIC_PROVIDER_NAME = 'DashboardVariableSQLDynamicProvider';\n@Injectable()\nexport class DashboardService extends CRUDService<Dashboard> {\n private readonly logger = new Logger(this.constructor.name);\n constructor(\n readonly modelMetadataService: ModelMetadataService,\n readonly moduleMetadataService: ModuleMetadataService,\n readonly configService: ConfigService,\n readonly fileService: FileService,\n readonly discoveryService: DiscoveryService,\n readonly crudHelperService: CrudHelperService,\n @InjectEntityManager()\n readonly entityManager: EntityManager,\n readonly repo: DashboardRepository, // Assuming you have a DashboardRepository for custom queries\n readonly moduleRef: ModuleRef,\n readonly solidRegistry: SolidRegistry, // Assuming solidRegistry is injected for selection providers\n readonly moduleMetadataHelperService: ModuleMetadataHelperService,\n readonly dashboardMapper: DashboardMapper,\n ) {\n super(modelMetadataService, moduleMetadataService, configService, fileService, discoveryService, crudHelperService, entityManager, repo, 'dashboard', 'solid-core', moduleRef);\n }\n\n async getSelectionDynamicValues(query: DashboardVariableSelectionDynamicQueryDto) {\n // Get the dashboard variable repo\n const dashboardVariable = await this.loadDashboardVariable(query.variableId);\n\n // Get the providerName and context for the dashboard variable\n const [providerName, context] = this.getProviderNameAndContext(dashboardVariable, query);\n\n // Get hold of the provider instance from the SolidRegistry\n const selectionProviderInstance = this.solidRegistry.getDashboardVariableSelectionProviderInstance(providerName);\n if (!selectionProviderInstance) {\n throw new NotFoundException(`Field incorrectly configured. No provider with name ${providerName} registered in backend.`);\n }\n\n // 4. Call the provider's getSelectionDynamicValues method\n return selectionProviderInstance.values(query.query, context);\n }\n\n\n private getProviderNameAndContext(dashboardVariable: DashboardVariable, query: DashboardVariableSelectionDynamicQueryDto): [string, any] {\n const sourceType = dashboardVariable.selectionDynamicSourceType;\n\n // Get the appropriate provide name based on the source type\n let providerName: string;\n const context = { limit: query.limit, offset: query.offset };\n switch (sourceType) {\n case SelectionDynamicSourceType.SQL:\n providerName = SQL_DYNAMIC_PROVIDER_NAME;\n context['sql'] = dashboardVariable.selectionDynamicSQL;\n break;\n case SelectionDynamicSourceType.PROVIDER:\n providerName = dashboardVariable.selectionDynamicProviderName;\n break;\n default:\n throw new Error(`Unsupported selection dynamic source type: ${sourceType}`);\n }\n return [providerName, context];\n }\n\n private async loadDashboardVariable(variableId: number) {\n const dashboardVariableRepo = this.entityManager.getRepository(DashboardVariable);\n\n // Load the dashboard record using the field\n const dashboardVariable = await dashboardVariableRepo.findOne({\n where: {\n id: variableId,\n },\n });\n return dashboardVariable;\n }\n\n async saveDashboardToConfig(entity: Dashboard) {\n if (!entity) {\n this.logger.debug('No entity found in the DashboardSubscriber saveDashboardToConfig method');\n return;\n }\n\n // Validate dashboard details\n const dashboard = entity as Dashboard;\n const moduleMetadata = entity.module;\n if (!moduleMetadata) {\n throw new Error(`Module metadata not found for dashboard id ${entity.id}`);\n }\n\n // Get config file details\n const { filePath, metaData } = await this.getConfigFileDetails(moduleMetadata.name);\n if (!filePath || !metaData) {\n throw new Error(`Configuration details not found for module: ${moduleMetadata.name}`);\n }\n\n // Write the dashboard to the config file\n await this.writeToConfig(metaData, dashboard, filePath);\n }\n\n private async getConfigFileDetails(moduleName: string): Promise<{ filePath: string; metaData: any }> {\n const filePath = await this.moduleMetadataHelperService.getModuleMetadataFilePath(moduleName);\n try {\n await fs.access(filePath);\n } catch (error) {\n throw new Error(`Configuration file not found for module: ${moduleName}`);\n }\n const metaData = await this.moduleMetadataHelperService.getModuleMetadataConfiguration(filePath);\n return { filePath, metaData };\n }\n\n private async writeToConfig(metaData: any, dashboard: Dashboard, filePath: string) {\n if (metaData.dashboards && Array.isArray(metaData.dashboards)) {\n const dashboardIndex = metaData.dashboards?.findIndex((dashboardFromFile: { name: string; }) => dashboardFromFile.name === dashboard.name);\n const dto = await this.dashboardMapper.toDto(dashboard);\n if (dashboardIndex !== -1) {\n metaData.dashboards[dashboardIndex] = dto;\n }\n else {\n metaData.dashboards.push(dto);\n }\n }\n else {\n const dashboards = [];\n const dto = await this.dashboardMapper.toDto(dashboard);\n dashboards.push(dto);\n metaData.dashboards = dashboards;\n }\n // Write the updated object back to the file\n const updatedContent = JSON.stringify(metaData, null, 2);\n await fs.writeFile(filePath, updatedContent);\n }\n}"]}
@@ -6,6 +6,9 @@ export declare class SolidCreateModuleMcpToolResponseHandler implements IMcpTool
6
6
  private readonly moduleMetadataService;
7
7
  private readonly solidRegistry;
8
8
  constructor(moduleMetadataService: ModuleMetadataService, solidRegistry: SolidRegistry);
9
- apply(aiInteraction: AiInteraction): Promise<{}>;
9
+ apply(aiInteraction: AiInteraction): Promise<{
10
+ seedingRequired: boolean;
11
+ serverRebooting: boolean;
12
+ }>;
10
13
  }
11
14
  //# sourceMappingURL=solid-create-module-mcp-tool-response-handler.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"solid-create-module-mcp-tool-response-handler.service.d.ts","sourceRoot":"","sources":["../../../src/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,qBACa,uCAAwC,YAAW,uBAAuB;IAG/E,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa;gBADb,qBAAqB,EAAE,qBAAqB,EAC5C,aAAa,EAAE,aAAa;IAK3C,KAAK,CAAC,aAAa,EAAE,aAAa;CAkC3C"}
1
+ {"version":3,"file":"solid-create-module-mcp-tool-response-handler.service.d.ts","sourceRoot":"","sources":["../../../src/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,qBACa,uCAAwC,YAAW,uBAAuB;IAG/E,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa;gBADb,qBAAqB,EAAE,qBAAqB,EAC5C,aAAa,EAAE,aAAa;IAK3C,KAAK,CAAC,aAAa,EAAE,aAAa;;;;CAqC3C"}
@@ -32,9 +32,11 @@ let SolidCreateModuleMcpToolResponseHandler = class SolidCreateModuleMcpToolResp
32
32
  menuSequenceNumber: 1
33
33
  };
34
34
  const moduleObj = await this.moduleMetadataService.create(createDto);
35
- const seeder = this.solidRegistry.getSeeders().filter((seeder) => seeder.name === 'ModuleMetadataSeederService').map((seeder) => seeder.instance).pop();
36
35
  await this.moduleMetadataService.generateCode({ moduleId: moduleObj.id });
37
- return {};
36
+ return {
37
+ seedingRequired: true,
38
+ serverRebooting: true,
39
+ };
38
40
  }
39
41
  };
40
42
  exports.SolidCreateModuleMcpToolResponseHandler = SolidCreateModuleMcpToolResponseHandler;
@@ -1 +1 @@
1
- {"version":3,"file":"solid-create-module-mcp-tool-response-handler.service.js","sourceRoot":"","sources":["../../../src/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAG5C,wEAAmE;AAEnE,iEAA2D;AAGpD,IAAM,uCAAuC,GAA7C,MAAM,uCAAuC;IAEhD,YACqB,qBAA4C,EAC5C,aAA4B;QAD5B,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,kBAAa,GAAb,aAAa,CAAe;IAGjD,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,aAA4B;QACpC,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAErD,MAAM,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;QAIpD,MAAM,SAAS,GAA4B;YACvC,iBAAiB,EAAE,SAAS;YAC5B,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC;YAC1C,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC;YAC1C,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,EAAE;YACf,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;YAC5B,kBAAkB,EAAE,CAAC;SACxB,CAAA;QAGD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAErE,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,6BAA6B,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;QAGxJ,MAAM,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC;QAO1E,OAAO,EAAE,CAAA;IACb,CAAC;CAEJ,CAAA;AA3CY,0FAAuC;kDAAvC,uCAAuC;IADnD,IAAA,mBAAU,GAAE;qCAImC,+CAAqB;QAC7B,8BAAa;GAJxC,uCAAuC,CA2CnD","sourcesContent":["import { Injectable } from \"@nestjs/common\";\nimport { IMcpToolResponseHandler } from \"../../interfaces\";\nimport { AiInteraction } from \"src/entities/ai-interaction.entity\";\nimport { ModuleMetadataService } from \"../module-metadata.service\";\nimport { CreateModuleMetadataDto } from \"src/dtos/create-module-metadata.dto\";\nimport { SolidRegistry } from \"src/helpers/solid-registry\";\n\n@Injectable()\nexport class SolidCreateModuleMcpToolResponseHandler implements IMcpToolResponseHandler {\n\n constructor(\n private readonly moduleMetadataService: ModuleMetadataService,\n private readonly solidRegistry: SolidRegistry,\n\n ) {\n }\n\n async apply(aiInteraction: AiInteraction) {\n const aiResponse = JSON.parse(aiInteraction.message);\n\n const moduleMetadata = aiResponse['moduleMetadata'];\n\n // TODO: Validate if another module with same name exists, if it does then raise an error...\n\n const createDto: CreateModuleMetadataDto = {\n defaultDataSource: 'default',\n description: moduleMetadata['description'],\n displayName: moduleMetadata['displayName'],\n isSystem: false,\n menuIconUrl: '',\n models: [],\n name: moduleMetadata['name'],\n menuSequenceNumber: 1\n }\n\n // This creates the module-metadata.json file....\n const moduleObj = await this.moduleMetadataService.create(createDto);\n\n const seeder = this.solidRegistry.getSeeders().filter((seeder) => seeder.name === 'ModuleMetadataSeederService').map((seeder) => seeder.instance).pop();\n\n // Now we need to run solid seed & then solid refresh-model --name <module-name>\n await this.moduleMetadataService.generateCode({ moduleId: moduleObj.id });\n\n // solid seed ... this has to be run after reboot from the UI...\n // await new Promise(resolve => setTimeout(resolve, 1000));\n // await seeder.seed();\n\n // TODO: decide on some shape to return hre...\n return {}\n }\n\n}"]}
1
+ {"version":3,"file":"solid-create-module-mcp-tool-response-handler.service.js","sourceRoot":"","sources":["../../../src/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAG5C,wEAAmE;AAEnE,iEAA2D;AAGpD,IAAM,uCAAuC,GAA7C,MAAM,uCAAuC;IAEhD,YACqB,qBAA4C,EAC5C,aAA4B;QAD5B,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,kBAAa,GAAb,aAAa,CAAe;IAGjD,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,aAA4B;QACpC,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAErD,MAAM,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;QAIpD,MAAM,SAAS,GAA4B;YACvC,iBAAiB,EAAE,SAAS;YAC5B,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC;YAC1C,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC;YAC1C,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,EAAE;YACf,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;YAC5B,kBAAkB,EAAE,CAAC;SACxB,CAAA;QAGD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAKrE,MAAM,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC;QAO1E,OAAO;YACH,eAAe,EAAE,IAAI;YACrB,eAAe,EAAE,IAAI;SACxB,CAAA;IACL,CAAC;CAEJ,CAAA;AA9CY,0FAAuC;kDAAvC,uCAAuC;IADnD,IAAA,mBAAU,GAAE;qCAImC,+CAAqB;QAC7B,8BAAa;GAJxC,uCAAuC,CA8CnD","sourcesContent":["import { Injectable } from \"@nestjs/common\";\nimport { IMcpToolResponseHandler } from \"../../interfaces\";\nimport { AiInteraction } from \"src/entities/ai-interaction.entity\";\nimport { ModuleMetadataService } from \"../module-metadata.service\";\nimport { CreateModuleMetadataDto } from \"src/dtos/create-module-metadata.dto\";\nimport { SolidRegistry } from \"src/helpers/solid-registry\";\n\n@Injectable()\nexport class SolidCreateModuleMcpToolResponseHandler implements IMcpToolResponseHandler {\n\n constructor(\n private readonly moduleMetadataService: ModuleMetadataService,\n private readonly solidRegistry: SolidRegistry,\n\n ) {\n }\n\n async apply(aiInteraction: AiInteraction) {\n const aiResponse = JSON.parse(aiInteraction.message);\n\n const moduleMetadata = aiResponse['moduleMetadata'];\n\n // TODO: Validate if another module with same name exists, if it does then raise an error...\n\n const createDto: CreateModuleMetadataDto = {\n defaultDataSource: 'default',\n description: moduleMetadata['description'],\n displayName: moduleMetadata['displayName'],\n isSystem: false,\n menuIconUrl: '',\n models: [],\n name: moduleMetadata['name'],\n menuSequenceNumber: 1\n }\n\n // This creates the module-metadata.json file....\n const moduleObj = await this.moduleMetadataService.create(createDto);\n\n // const seeder = this.solidRegistry.getSeeders().filter((seeder) => seeder.name === 'ModuleMetadataSeederService').map((seeder) => seeder.instance).pop();\n\n // Now we need to run solid seed & then solid refresh-model --name <module-name>\n await this.moduleMetadataService.generateCode({ moduleId: moduleObj.id });\n\n // solid seed ... this has to be run after reboot from the UI...\n // await new Promise(resolve => setTimeout(resolve, 1000));\n // await seeder.seed();\n\n // TODO: decide on some shape to return hre...\n return {\n seedingRequired: true,\n serverRebooting: true,\n }\n }\n\n}"]}
@@ -1,9 +1,12 @@
1
1
  import { SqlExpression } from "./question-data-providers/chartjs-sql-data-provider.service";
2
+ import { RequestContextService } from "./request-context.service";
2
3
  export interface SqlReplacementResult {
3
4
  rawSql: string;
4
5
  parameters: any[];
5
6
  }
6
7
  export declare class SqlExpressionResolverService {
8
+ private readonly requestContextService;
9
+ constructor(requestContextService: RequestContextService);
7
10
  resolveSqlWithExpressions(sql: string, expressions: SqlExpression[]): SqlReplacementResult;
8
11
  }
9
12
  //# sourceMappingURL=sql-expression-resolver.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sql-expression-resolver.service.d.ts","sourceRoot":"","sources":["../../src/services/sql-expression-resolver.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAyB,MAAM,6DAA6D,CAAC;AAEnH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,GAAG,EAAE,CAAC;CACnB;AAED,qBACa,4BAA4B;IACvC,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,oBAAoB;CAkH3F"}
1
+ {"version":3,"file":"sql-expression-resolver.service.d.ts","sourceRoot":"","sources":["../../src/services/sql-expression-resolver.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAyB,MAAM,6DAA6D,CAAC;AACnH,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,GAAG,EAAE,CAAC;CACnB;AAED,qBACa,4BAA4B;IAC3B,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAArB,qBAAqB,EAAE,qBAAqB;IACzE,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,oBAAoB;CA8H3F"}
@@ -5,20 +5,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
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
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
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
+ };
8
11
  Object.defineProperty(exports, "__esModule", { value: true });
9
12
  exports.SqlExpressionResolverService = void 0;
10
13
  const common_1 = require("@nestjs/common");
11
14
  const chartjs_sql_data_provider_service_1 = require("./question-data-providers/chartjs-sql-data-provider.service");
15
+ const request_context_service_1 = require("./request-context.service");
12
16
  let SqlExpressionResolverService = class SqlExpressionResolverService {
17
+ constructor(requestContextService) {
18
+ this.requestContextService = requestContextService;
19
+ }
13
20
  resolveSqlWithExpressions(sql, expressions) {
14
21
  const variableToColumnMap = {};
15
22
  const variablePattern = /{{\s*(\w+)\s*\[\s*([\w.]+)\s*\]\s*}}/g;
23
+ let paramIndex = 1;
24
+ const parameters = [];
25
+ if (sql.includes('{{$activeUserId}}')) {
26
+ const activeUser = this.requestContextService.getActiveUser();
27
+ if (activeUser && activeUser.sub) {
28
+ sql = sql.replace(/\{\{\$activeUserId\}\}/g, `$${paramIndex++}`);
29
+ parameters.push(activeUser.sub);
30
+ }
31
+ }
16
32
  let simplifiedSql = sql.replace(variablePattern, (_, variableName, columnName) => {
17
33
  variableToColumnMap[variableName] = columnName;
18
34
  return `{{${variableName}}}`;
19
35
  });
20
- let paramIndex = 1;
21
- const parameters = [];
22
36
  for (const expr of expressions) {
23
37
  const column = variableToColumnMap[expr.variableName];
24
38
  if (!column)
@@ -100,6 +114,7 @@ let SqlExpressionResolverService = class SqlExpressionResolverService {
100
114
  };
101
115
  exports.SqlExpressionResolverService = SqlExpressionResolverService;
102
116
  exports.SqlExpressionResolverService = SqlExpressionResolverService = __decorate([
103
- (0, common_1.Injectable)()
117
+ (0, common_1.Injectable)(),
118
+ __metadata("design:paramtypes", [request_context_service_1.RequestContextService])
104
119
  ], SqlExpressionResolverService);
105
120
  //# sourceMappingURL=sql-expression-resolver.service.js.map