@solidxai/core 0.1.10-beta.22 → 0.1.10-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/info.command.d.ts.map +1 -1
- package/dist/commands/info.command.js +0 -2
- package/dist/commands/info.command.js.map +1 -1
- package/dist/controllers/dashboard-user-layout.controller.d.ts +43 -0
- package/dist/controllers/dashboard-user-layout.controller.d.ts.map +1 -0
- package/dist/controllers/{dashboard-variable.controller.js → dashboard-user-layout.controller.js} +30 -30
- package/dist/controllers/dashboard-user-layout.controller.js.map +1 -0
- package/dist/controllers/dashboard.controller.d.ts +12 -42
- package/dist/controllers/dashboard.controller.d.ts.map +1 -1
- package/dist/controllers/dashboard.controller.js +71 -141
- package/dist/controllers/dashboard.controller.js.map +1 -1
- package/dist/decorators/dashboard-widget-data-provider.decorator.d.ts +3 -0
- package/dist/decorators/dashboard-widget-data-provider.decorator.d.ts.map +1 -0
- package/dist/decorators/dashboard-widget-data-provider.decorator.js +8 -0
- package/dist/decorators/dashboard-widget-data-provider.decorator.js.map +1 -0
- package/dist/dtos/create-dashboard-user-layout.dto.d.ts +10 -0
- package/dist/dtos/create-dashboard-user-layout.dto.d.ts.map +1 -0
- package/dist/dtos/create-dashboard-user-layout.dto.js +66 -0
- package/dist/dtos/create-dashboard-user-layout.dto.js.map +1 -0
- package/dist/dtos/dashboard-variable-options-query.dto.d.ts +7 -0
- package/dist/dtos/dashboard-variable-options-query.dto.d.ts.map +1 -0
- package/dist/dtos/dashboard-variable-options-query.dto.js +40 -0
- package/dist/dtos/dashboard-variable-options-query.dto.js.map +1 -0
- package/dist/dtos/dashboard-widget-data-request.dto.d.ts +12 -0
- package/dist/dtos/dashboard-widget-data-request.dto.d.ts.map +1 -0
- package/dist/dtos/dashboard-widget-data-request.dto.js +65 -0
- package/dist/dtos/dashboard-widget-data-request.dto.js.map +1 -0
- package/dist/dtos/update-dashboard-user-layout.dto.d.ts +11 -0
- package/dist/dtos/update-dashboard-user-layout.dto.d.ts.map +1 -0
- package/dist/dtos/{update-dashboard-layout.dto.js → update-dashboard-user-layout.dto.js} +34 -16
- package/dist/dtos/update-dashboard-user-layout.dto.js.map +1 -0
- package/dist/entities/dashboard-user-layout.entity.d.ts +11 -0
- package/dist/entities/dashboard-user-layout.entity.d.ts.map +1 -0
- package/dist/entities/dashboard-user-layout.entity.js +52 -0
- package/dist/entities/dashboard-user-layout.entity.js.map +1 -0
- package/dist/helpers/module-metadata-helper.service.d.ts.map +1 -1
- package/dist/helpers/module-metadata-helper.service.js +15 -4
- package/dist/helpers/module-metadata-helper.service.js.map +1 -1
- package/dist/helpers/solid-registry.d.ts +5 -9
- package/dist/helpers/solid-registry.d.ts.map +1 -1
- package/dist/helpers/solid-registry.js +13 -28
- package/dist/helpers/solid-registry.js.map +1 -1
- package/dist/index.d.ts +21 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -5
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +24 -13
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.d.ts +1 -3
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.d.ts.map +1 -1
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js +2 -25
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js.map +1 -1
- package/dist/{repository/dashboard-layout.repository.d.ts → repositories/dashboard-user-layout.repository.d.ts} +5 -5
- package/dist/repositories/dashboard-user-layout.repository.d.ts.map +1 -0
- package/dist/{repository/dashboard-question-sql-dataset-config.repository.js → repositories/dashboard-user-layout.repository.js} +15 -10
- package/dist/repositories/dashboard-user-layout.repository.js.map +1 -0
- package/dist/seeders/module-metadata-seeder.service.d.ts +1 -6
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +1 -60
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +6203 -6690
- package/dist/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.d.ts +13 -0
- package/dist/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.js +55 -0
- package/dist/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.d.ts +13 -0
- package/dist/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.js +52 -0
- package/dist/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.d.ts +13 -0
- package/dist/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.js +52 -0
- package/dist/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.d.ts +10 -0
- package/dist/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.js +62 -0
- package/dist/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.d.ts +10 -0
- package/dist/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.js +82 -0
- package/dist/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-provider-utils.d.ts +17 -0
- package/dist/services/dashboard-providers/mq-dashboard-provider-utils.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-provider-utils.js +130 -0
- package/dist/services/dashboard-providers/mq-dashboard-provider-utils.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.d.ts +37 -0
- package/dist/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.js +112 -0
- package/dist/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.d.ts +10 -0
- package/dist/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.js +57 -0
- package/dist/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.d.ts +10 -0
- package/dist/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.js +57 -0
- package/dist/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.d.ts +10 -0
- package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.js +100 -0
- package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.d.ts +10 -0
- package/dist/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.js +55 -0
- package/dist/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.d.ts +13 -0
- package/dist/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.js +52 -0
- package/dist/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.d.ts +15 -0
- package/dist/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.js +60 -0
- package/dist/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.js.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.d.ts +13 -0
- package/dist/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.js +51 -0
- package/dist/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.js.map +1 -0
- package/dist/services/dashboard-runtime.service.d.ts +31 -0
- package/dist/services/dashboard-runtime.service.d.ts.map +1 -0
- package/dist/services/dashboard-runtime.service.js +408 -0
- package/dist/services/dashboard-runtime.service.js.map +1 -0
- package/dist/services/dashboard-user-layout.service.d.ts +12 -0
- package/dist/services/dashboard-user-layout.service.d.ts.map +1 -0
- package/dist/services/{dashboard-variable.service.js → dashboard-user-layout.service.js} +11 -12
- package/dist/services/dashboard-user-layout.service.js.map +1 -0
- package/dist/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.d.ts +11 -0
- package/dist/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.d.ts.map +1 -0
- package/dist/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.js +59 -0
- package/dist/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.js.map +1 -0
- package/dist/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.d.ts +11 -0
- package/dist/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.d.ts.map +1 -0
- package/dist/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.js +60 -0
- package/dist/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.js.map +1 -0
- package/dist/services/solid-introspect.service.d.ts +1 -2
- package/dist/services/solid-introspect.service.d.ts.map +1 -1
- package/dist/services/solid-introspect.service.js +12 -24
- package/dist/services/solid-introspect.service.js.map +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +43 -66
- package/dist/solid-core.module.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/info.command.ts +0 -2
- package/src/controllers/{dashboard-variable.controller.ts → dashboard-user-layout.controller.ts} +10 -10
- package/src/controllers/dashboard.controller.ts +70 -89
- package/src/decorators/dashboard-widget-data-provider.decorator.ts +6 -0
- package/src/dtos/create-dashboard-user-layout.dto.ts +41 -0
- package/src/dtos/dashboard-variable-options-query.dto.ts +20 -0
- package/src/dtos/dashboard-widget-data-request.dto.ts +34 -0
- package/src/dtos/update-dashboard-user-layout.dto.ts +45 -0
- package/src/entities/dashboard-user-layout.entity.ts +27 -0
- package/src/helpers/module-metadata-helper.service.ts +21 -6
- package/src/helpers/solid-registry.ts +15 -36
- package/src/index.ts +21 -5
- package/src/interfaces.ts +32 -19
- package/src/jobs/database/trigger-mcp-client-subscriber-database.service.ts +1 -34
- package/src/repositories/dashboard-user-layout.repository.ts +19 -0
- package/src/seeders/module-metadata-seeder.service.ts +0 -67
- package/src/seeders/seed-data/solid-core-metadata.json +6204 -6691
- package/src/services/dashboard-providers/README.md +603 -0
- package/src/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.ts +49 -0
- package/src/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.ts +45 -0
- package/src/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.ts +45 -0
- package/src/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.ts +58 -0
- package/src/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.ts +79 -0
- package/src/services/dashboard-providers/mq-dashboard-provider-utils.ts +165 -0
- package/src/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.ts +155 -0
- package/src/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.ts +51 -0
- package/src/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.ts +51 -0
- package/src/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.ts +95 -0
- package/src/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.ts +49 -0
- package/src/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.ts +45 -0
- package/src/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.ts +55 -0
- package/src/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.ts +44 -0
- package/src/services/dashboard-runtime.service.ts +488 -0
- package/src/services/dashboard-user-layout.service.ts +20 -0
- package/src/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.ts +52 -0
- package/src/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.ts +51 -0
- package/src/services/solid-introspect.service.ts +19 -34
- package/src/solid-core.module.ts +43 -72
- package/dist/controllers/dashboard-layout.controller.d.ts +0 -47
- package/dist/controllers/dashboard-layout.controller.d.ts.map +0 -1
- package/dist/controllers/dashboard-layout.controller.js +0 -204
- package/dist/controllers/dashboard-layout.controller.js.map +0 -1
- package/dist/controllers/dashboard-question-sql-dataset-config.controller.d.ts +0 -43
- package/dist/controllers/dashboard-question-sql-dataset-config.controller.d.ts.map +0 -1
- package/dist/controllers/dashboard-question-sql-dataset-config.controller.js +0 -179
- package/dist/controllers/dashboard-question-sql-dataset-config.controller.js.map +0 -1
- package/dist/controllers/dashboard-question.controller.d.ts +0 -45
- package/dist/controllers/dashboard-question.controller.d.ts.map +0 -1
- package/dist/controllers/dashboard-question.controller.js +0 -194
- package/dist/controllers/dashboard-question.controller.js.map +0 -1
- package/dist/controllers/dashboard-variable.controller.d.ts +0 -43
- package/dist/controllers/dashboard-variable.controller.d.ts.map +0 -1
- package/dist/controllers/dashboard-variable.controller.js.map +0 -1
- package/dist/decorators/dashboard-question-data-provider.decorator.d.ts +0 -3
- package/dist/decorators/dashboard-question-data-provider.decorator.d.ts.map +0 -1
- package/dist/decorators/dashboard-question-data-provider.decorator.js +0 -11
- package/dist/decorators/dashboard-question-data-provider.decorator.js.map +0 -1
- package/dist/decorators/dashboard-selection-provider.decorator.d.ts +0 -3
- package/dist/decorators/dashboard-selection-provider.decorator.d.ts.map +0 -1
- package/dist/decorators/dashboard-selection-provider.decorator.js +0 -11
- package/dist/decorators/dashboard-selection-provider.decorator.js.map +0 -1
- package/dist/dtos/create-dashboard-layout.dto.d.ts +0 -8
- package/dist/dtos/create-dashboard-layout.dto.d.ts.map +0 -1
- package/dist/dtos/create-dashboard-layout.dto.js +0 -53
- package/dist/dtos/create-dashboard-layout.dto.js.map +0 -1
- package/dist/dtos/create-dashboard-question-sql-dataset-config.dto.d.ts +0 -12
- package/dist/dtos/create-dashboard-question-sql-dataset-config.dto.d.ts.map +0 -1
- package/dist/dtos/create-dashboard-question-sql-dataset-config.dto.js +0 -77
- package/dist/dtos/create-dashboard-question-sql-dataset-config.dto.js.map +0 -1
- package/dist/dtos/create-dashboard-question.dto.d.ts +0 -17
- package/dist/dtos/create-dashboard-question.dto.d.ts.map +0 -1
- package/dist/dtos/create-dashboard-question.dto.js +0 -105
- package/dist/dtos/create-dashboard-question.dto.js.map +0 -1
- package/dist/dtos/create-dashboard-variable.dto.d.ts +0 -19
- package/dist/dtos/create-dashboard-variable.dto.d.ts.map +0 -1
- package/dist/dtos/create-dashboard-variable.dto.js +0 -103
- package/dist/dtos/create-dashboard-variable.dto.js.map +0 -1
- package/dist/dtos/create-dashboard.dto.d.ts +0 -17
- package/dist/dtos/create-dashboard.dto.d.ts.map +0 -1
- package/dist/dtos/create-dashboard.dto.js +0 -102
- package/dist/dtos/create-dashboard.dto.js.map +0 -1
- package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.d.ts +0 -8
- package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.d.ts.map +0 -1
- package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.js +0 -52
- package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.js.map +0 -1
- package/dist/dtos/update-dashboard-layout.dto.d.ts +0 -8
- package/dist/dtos/update-dashboard-layout.dto.d.ts.map +0 -1
- package/dist/dtos/update-dashboard-layout.dto.js.map +0 -1
- package/dist/dtos/update-dashboard-question-sql-dataset-config.dto.d.ts +0 -13
- package/dist/dtos/update-dashboard-question-sql-dataset-config.dto.d.ts.map +0 -1
- package/dist/dtos/update-dashboard-question-sql-dataset-config.dto.js +0 -86
- package/dist/dtos/update-dashboard-question-sql-dataset-config.dto.js.map +0 -1
- package/dist/dtos/update-dashboard-question.dto.d.ts +0 -18
- package/dist/dtos/update-dashboard-question.dto.d.ts.map +0 -1
- package/dist/dtos/update-dashboard-question.dto.js +0 -112
- package/dist/dtos/update-dashboard-question.dto.js.map +0 -1
- package/dist/dtos/update-dashboard-variable.dto.d.ts +0 -16
- package/dist/dtos/update-dashboard-variable.dto.d.ts.map +0 -1
- package/dist/dtos/update-dashboard-variable.dto.js +0 -101
- package/dist/dtos/update-dashboard-variable.dto.js.map +0 -1
- package/dist/dtos/update-dashboard.dto.d.ts +0 -18
- package/dist/dtos/update-dashboard.dto.d.ts.map +0 -1
- package/dist/dtos/update-dashboard.dto.js +0 -108
- package/dist/dtos/update-dashboard.dto.js.map +0 -1
- package/dist/entities/dashboard-layout.entity.d.ts +0 -9
- package/dist/entities/dashboard-layout.entity.d.ts.map +0 -1
- package/dist/entities/dashboard-layout.entity.js +0 -41
- package/dist/entities/dashboard-layout.entity.js.map +0 -1
- package/dist/entities/dashboard-question-sql-dataset-config.entity.d.ts +0 -14
- package/dist/entities/dashboard-question-sql-dataset-config.entity.d.ts.map +0 -1
- package/dist/entities/dashboard-question-sql-dataset-config.entity.js +0 -66
- package/dist/entities/dashboard-question-sql-dataset-config.entity.js.map +0 -1
- package/dist/entities/dashboard-question.entity.d.ts +0 -17
- package/dist/entities/dashboard-question.entity.d.ts.map +0 -1
- package/dist/entities/dashboard-question.entity.js +0 -77
- package/dist/entities/dashboard-question.entity.js.map +0 -1
- package/dist/entities/dashboard-variable.entity.d.ts +0 -16
- package/dist/entities/dashboard-variable.entity.d.ts.map +0 -1
- package/dist/entities/dashboard-variable.entity.js +0 -79
- package/dist/entities/dashboard-variable.entity.js.map +0 -1
- package/dist/entities/dashboard.entity.d.ts +0 -16
- package/dist/entities/dashboard.entity.d.ts.map +0 -1
- package/dist/entities/dashboard.entity.js +0 -64
- package/dist/entities/dashboard.entity.js.map +0 -1
- package/dist/mappers/dashboard-mapper.d.ts +0 -6
- package/dist/mappers/dashboard-mapper.d.ts.map +0 -1
- package/dist/mappers/dashboard-mapper.js +0 -62
- package/dist/mappers/dashboard-mapper.js.map +0 -1
- package/dist/repository/dashboard-layout.repository.d.ts.map +0 -1
- package/dist/repository/dashboard-layout.repository.js +0 -34
- package/dist/repository/dashboard-layout.repository.js.map +0 -1
- package/dist/repository/dashboard-question-sql-dataset-config.repository.d.ts +0 -12
- package/dist/repository/dashboard-question-sql-dataset-config.repository.d.ts.map +0 -1
- package/dist/repository/dashboard-question-sql-dataset-config.repository.js.map +0 -1
- package/dist/repository/dashboard-question.repository.d.ts +0 -12
- package/dist/repository/dashboard-question.repository.d.ts.map +0 -1
- package/dist/repository/dashboard-question.repository.js +0 -34
- package/dist/repository/dashboard-question.repository.js.map +0 -1
- package/dist/repository/dashboard-variable.repository.d.ts +0 -12
- package/dist/repository/dashboard-variable.repository.d.ts.map +0 -1
- package/dist/repository/dashboard-variable.repository.js +0 -34
- package/dist/repository/dashboard-variable.repository.js.map +0 -1
- package/dist/repository/dashboard.repository.d.ts +0 -13
- package/dist/repository/dashboard.repository.d.ts.map +0 -1
- package/dist/repository/dashboard.repository.js +0 -104
- package/dist/repository/dashboard.repository.js.map +0 -1
- package/dist/services/dashboard-layout.service.d.ts +0 -20
- package/dist/services/dashboard-layout.service.d.ts.map +0 -1
- package/dist/services/dashboard-layout.service.js +0 -120
- package/dist/services/dashboard-layout.service.js.map +0 -1
- package/dist/services/dashboard-question-sql-dataset-config.service.d.ts +0 -12
- package/dist/services/dashboard-question-sql-dataset-config.service.d.ts.map +0 -1
- package/dist/services/dashboard-question-sql-dataset-config.service.js +0 -38
- package/dist/services/dashboard-question-sql-dataset-config.service.js.map +0 -1
- package/dist/services/dashboard-question.service.d.ts +0 -23
- package/dist/services/dashboard-question.service.d.ts.map +0 -1
- package/dist/services/dashboard-question.service.js +0 -135
- package/dist/services/dashboard-question.service.js.map +0 -1
- package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.d.ts +0 -12
- package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.d.ts.map +0 -1
- package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.js +0 -55
- package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.js.map +0 -1
- package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.d.ts +0 -11
- package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.d.ts.map +0 -1
- package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.js +0 -45
- package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.js.map +0 -1
- package/dist/services/dashboard-variable.service.d.ts +0 -13
- package/dist/services/dashboard-variable.service.d.ts.map +0 -1
- package/dist/services/dashboard-variable.service.js.map +0 -1
- package/dist/services/dashboard.service.d.ts +0 -29
- package/dist/services/dashboard.service.d.ts.map +0 -1
- package/dist/services/dashboard.service.js +0 -171
- package/dist/services/dashboard.service.js.map +0 -1
- package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.d.ts +0 -12
- package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.d.ts.map +0 -1
- package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.js +0 -41
- package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.js.map +0 -1
- package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.d.ts +0 -12
- package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.d.ts.map +0 -1
- package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.js +0 -42
- package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.js.map +0 -1
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.d.ts +0 -25
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.d.ts.map +0 -1
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.js +0 -116
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.js.map +0 -1
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.d.ts +0 -12
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.d.ts.map +0 -1
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.js +0 -37
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.js.map +0 -1
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.d.ts +0 -12
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.d.ts.map +0 -1
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.js +0 -38
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.js.map +0 -1
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.d.ts +0 -12
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.d.ts.map +0 -1
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.js +0 -38
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.js.map +0 -1
- package/dist/services/question-data-providers/chartjs-sql-data-provider.service.d.ts +0 -34
- package/dist/services/question-data-providers/chartjs-sql-data-provider.service.d.ts.map +0 -1
- package/dist/services/question-data-providers/chartjs-sql-data-provider.service.js +0 -90
- package/dist/services/question-data-providers/chartjs-sql-data-provider.service.js.map +0 -1
- package/dist/services/question-data-providers/helpers.d.ts +0 -7
- package/dist/services/question-data-providers/helpers.d.ts.map +0 -1
- package/dist/services/question-data-providers/helpers.js +0 -25
- package/dist/services/question-data-providers/helpers.js.map +0 -1
- package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.d.ts +0 -14
- package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.d.ts.map +0 -1
- package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.js +0 -71
- package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.js.map +0 -1
- package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.d.ts +0 -16
- package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.d.ts.map +0 -1
- package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.js +0 -93
- package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.js.map +0 -1
- package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.d.ts +0 -11
- package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.d.ts.map +0 -1
- package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.js +0 -49
- package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.js.map +0 -1
- package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.d.ts +0 -11
- package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.d.ts.map +0 -1
- package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.js +0 -47
- package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.js.map +0 -1
- package/dist/services/sql-expression-resolver.service.d.ts +0 -12
- package/dist/services/sql-expression-resolver.service.d.ts.map +0 -1
- package/dist/services/sql-expression-resolver.service.js +0 -121
- package/dist/services/sql-expression-resolver.service.js.map +0 -1
- package/dist/subscribers/dashboard-question-sql-dataset-config.subscriber.d.ts +0 -16
- package/dist/subscribers/dashboard-question-sql-dataset-config.subscriber.d.ts.map +0 -1
- package/dist/subscribers/dashboard-question-sql-dataset-config.subscriber.js +0 -72
- package/dist/subscribers/dashboard-question-sql-dataset-config.subscriber.js.map +0 -1
- package/dist/subscribers/dashboard-question.subscriber.d.ts +0 -16
- package/dist/subscribers/dashboard-question.subscriber.d.ts.map +0 -1
- package/dist/subscribers/dashboard-question.subscriber.js +0 -72
- package/dist/subscribers/dashboard-question.subscriber.js.map +0 -1
- package/dist/subscribers/dashboard-variable.subscriber.d.ts +0 -16
- package/dist/subscribers/dashboard-variable.subscriber.d.ts.map +0 -1
- package/dist/subscribers/dashboard-variable.subscriber.js +0 -72
- package/dist/subscribers/dashboard-variable.subscriber.js.map +0 -1
- package/dist/subscribers/dashboard.subscriber.d.ts +0 -16
- package/dist/subscribers/dashboard.subscriber.d.ts.map +0 -1
- package/dist/subscribers/dashboard.subscriber.js +0 -71
- package/dist/subscribers/dashboard.subscriber.js.map +0 -1
- package/src/controllers/dashboard-layout.controller.ts +0 -106
- package/src/controllers/dashboard-question-sql-dataset-config.controller.ts +0 -93
- package/src/controllers/dashboard-question.controller.ts +0 -104
- package/src/decorators/dashboard-question-data-provider.decorator.ts +0 -7
- package/src/decorators/dashboard-selection-provider.decorator.ts +0 -7
- package/src/dtos/create-dashboard-layout.dto.ts +0 -31
- package/src/dtos/create-dashboard-question-sql-dataset-config.dto.ts +0 -42
- package/src/dtos/create-dashboard-question.dto.ts +0 -62
- package/src/dtos/create-dashboard-variable.dto.ts +0 -60
- package/src/dtos/create-dashboard.dto.ts +0 -61
- package/src/dtos/dashboard-variable-selection-dynamic-query.dto.ts +0 -29
- package/src/dtos/update-dashboard-layout.dto.ts +0 -30
- package/src/dtos/update-dashboard-question-sql-dataset-config.dto.ts +0 -49
- package/src/dtos/update-dashboard-question.dto.ts +0 -67
- package/src/dtos/update-dashboard-variable.dto.ts +0 -58
- package/src/dtos/update-dashboard.dto.ts +0 -65
- package/src/entities/dashboard-layout.entity.ts +0 -18
- package/src/entities/dashboard-question-sql-dataset-config.entity.ts +0 -37
- package/src/entities/dashboard-question.entity.ts +0 -46
- package/src/entities/dashboard-variable.entity.ts +0 -44
- package/src/entities/dashboard.entity.ts +0 -36
- package/src/mappers/dashboard-mapper.ts +0 -53
- package/src/repository/dashboard-layout.repository.ts +0 -17
- package/src/repository/dashboard-question-sql-dataset-config.repository.ts +0 -17
- package/src/repository/dashboard-question.repository.ts +0 -17
- package/src/repository/dashboard-variable.repository.ts +0 -17
- package/src/repository/dashboard.repository.ts +0 -101
- package/src/services/dashboard-layout.service.ts +0 -111
- package/src/services/dashboard-question-sql-dataset-config.service.ts +0 -25
- package/src/services/dashboard-question.service.ts +0 -150
- package/src/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.ts +0 -56
- package/src/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.ts +0 -37
- package/src/services/dashboard-variable.service.ts +0 -27
- package/src/services/dashboard.service.ts +0 -148
- package/src/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.ts +0 -43
- package/src/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.ts +0 -44
- package/src/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.ts +0 -114
- package/src/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.ts +0 -38
- package/src/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.ts +0 -40
- package/src/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.ts +0 -39
- package/src/services/question-data-providers/chartjs-sql-data-provider.service.ts +0 -121
- package/src/services/question-data-providers/helpers.ts +0 -30
- package/src/services/question-data-providers/prime-react-datatable-sql-data-provider.service.ts +0 -74
- package/src/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.ts +0 -115
- package/src/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.ts +0 -44
- package/src/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.ts +0 -41
- package/src/services/sql-expression-resolver.service.ts +0 -140
- package/src/subscribers/dashboard-question-sql-dataset-config.subscriber.ts +0 -61
- package/src/subscribers/dashboard-question.subscriber.ts +0 -62
- package/src/subscribers/dashboard-variable.subscriber.ts +0 -63
- package/src/subscribers/dashboard.subscriber.ts +0 -62
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { Injectable } from "@nestjs/common";
|
|
2
|
-
import { SqlExpression, SqlExpressionOperator } from "./question-data-providers/chartjs-sql-data-provider.service";
|
|
3
|
-
import { RequestContextService } from "./request-context.service";
|
|
4
|
-
import { ERROR_MESSAGES } from "src/constants/error-messages";
|
|
5
|
-
|
|
6
|
-
export interface SqlReplacementResult {
|
|
7
|
-
rawSql: string;
|
|
8
|
-
parameters: any[]; // Positional parameters
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@Injectable()
|
|
12
|
-
export class SqlExpressionResolverService {
|
|
13
|
-
constructor(private readonly requestContextService: RequestContextService) { }
|
|
14
|
-
resolveSqlWithExpressions(sql: string, expressions: SqlExpression[]): SqlReplacementResult {
|
|
15
|
-
const variableToColumnMap: Record<string, string> = {};
|
|
16
|
-
const variablePattern = /{{\s*(\w+)\s*\[\s*([\w.]+)\s*\]\s*}}/g;
|
|
17
|
-
|
|
18
|
-
let paramIndex = 1;
|
|
19
|
-
const parameters: any[] = [];
|
|
20
|
-
|
|
21
|
-
// Handle sql expression tokens like {{$activeUserId}} in the SQL string
|
|
22
|
-
if (sql.includes('{{$activeUserId}}')) {
|
|
23
|
-
const activeUser = this.requestContextService.getActiveUser();
|
|
24
|
-
if (activeUser && activeUser.sub) {
|
|
25
|
-
// Replace custom placeholder with parameter placeholder ($1)
|
|
26
|
-
sql = sql.replace(/\{\{\$activeUserId\}\}/g, `$${paramIndex++}`);
|
|
27
|
-
// Add the active user ID to parameters
|
|
28
|
-
parameters.push(activeUser.sub);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// --- Pass 1: extract variable -> column mappings ---
|
|
33
|
-
let simplifiedSql = sql.replace(variablePattern, (_, variableName, columnName) => {
|
|
34
|
-
variableToColumnMap[variableName] = columnName;
|
|
35
|
-
return `{{${variableName}}}`;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// --- Pass 2: Replace each variable with positional fragment ---
|
|
39
|
-
|
|
40
|
-
for (const expr of expressions) {
|
|
41
|
-
const column = variableToColumnMap[expr.variableName];
|
|
42
|
-
if (!column) continue;
|
|
43
|
-
|
|
44
|
-
let sqlFragment = '';
|
|
45
|
-
const placeholder = `{{${expr.variableName}}}`;
|
|
46
|
-
|
|
47
|
-
switch (expr.operator) {
|
|
48
|
-
case SqlExpressionOperator.EQUALS:
|
|
49
|
-
sqlFragment = `${column} = $${paramIndex++}`;
|
|
50
|
-
parameters.push(expr.value[0]);
|
|
51
|
-
break;
|
|
52
|
-
|
|
53
|
-
case SqlExpressionOperator.NOT_EQUALS:
|
|
54
|
-
sqlFragment = `${column} != $${paramIndex++}`;
|
|
55
|
-
parameters.push(expr.value[0]);
|
|
56
|
-
break;
|
|
57
|
-
|
|
58
|
-
case SqlExpressionOperator.CONTAINS:
|
|
59
|
-
sqlFragment = `${column} LIKE $${paramIndex++}`;
|
|
60
|
-
parameters.push(`%${expr.value[0]}%`);
|
|
61
|
-
break;
|
|
62
|
-
|
|
63
|
-
case SqlExpressionOperator.NOT_CONTAINS:
|
|
64
|
-
sqlFragment = `${column} NOT LIKE $${paramIndex++}`;
|
|
65
|
-
parameters.push(`%${expr.value[0]}%`);
|
|
66
|
-
break;
|
|
67
|
-
|
|
68
|
-
case SqlExpressionOperator.STARTS_WITH:
|
|
69
|
-
sqlFragment = `${column} LIKE $${paramIndex++}`;
|
|
70
|
-
parameters.push(`${expr.value[0]}%`);
|
|
71
|
-
break;
|
|
72
|
-
|
|
73
|
-
case SqlExpressionOperator.ENDS_WITH:
|
|
74
|
-
sqlFragment = `${column} LIKE $${paramIndex++}`;
|
|
75
|
-
parameters.push(`%${expr.value[0]}`);
|
|
76
|
-
break;
|
|
77
|
-
|
|
78
|
-
case SqlExpressionOperator.IN:
|
|
79
|
-
const inParams = expr.value.map(val => {
|
|
80
|
-
parameters.push(val);
|
|
81
|
-
return `$${paramIndex++}`;
|
|
82
|
-
});
|
|
83
|
-
sqlFragment = `${column} IN (${inParams.join(", ")})`;
|
|
84
|
-
break;
|
|
85
|
-
|
|
86
|
-
case SqlExpressionOperator.NOT_IN:
|
|
87
|
-
const notInParams = expr.value.map(val => {
|
|
88
|
-
parameters.push(val);
|
|
89
|
-
return `$${paramIndex++}`;
|
|
90
|
-
});
|
|
91
|
-
sqlFragment = `${column} NOT IN (${notInParams.join(", ")})`;
|
|
92
|
-
break;
|
|
93
|
-
|
|
94
|
-
case SqlExpressionOperator.BETWEEN:
|
|
95
|
-
sqlFragment = `${column} BETWEEN $${paramIndex} AND $${paramIndex + 1}`;
|
|
96
|
-
parameters.push(expr.value[0], expr.value[1]);
|
|
97
|
-
paramIndex += 2;
|
|
98
|
-
break;
|
|
99
|
-
|
|
100
|
-
case SqlExpressionOperator.LT:
|
|
101
|
-
sqlFragment = `${column} < $${paramIndex++}`;
|
|
102
|
-
parameters.push(expr.value[0]);
|
|
103
|
-
break;
|
|
104
|
-
|
|
105
|
-
case SqlExpressionOperator.LTE:
|
|
106
|
-
sqlFragment = `${column} <= $${paramIndex++}`;
|
|
107
|
-
parameters.push(expr.value[0]);
|
|
108
|
-
break;
|
|
109
|
-
|
|
110
|
-
case SqlExpressionOperator.GT:
|
|
111
|
-
sqlFragment = `${column} > $${paramIndex++}`;
|
|
112
|
-
parameters.push(expr.value[0]);
|
|
113
|
-
break;
|
|
114
|
-
|
|
115
|
-
case SqlExpressionOperator.GTE:
|
|
116
|
-
sqlFragment = `${column} >= $${paramIndex++}`;
|
|
117
|
-
parameters.push(expr.value[0]);
|
|
118
|
-
break;
|
|
119
|
-
|
|
120
|
-
default:
|
|
121
|
-
throw new Error(ERROR_MESSAGES.UNSUPPORTED_SQL_OPERATOR(expr.operator));
|
|
122
|
-
}
|
|
123
|
-
simplifiedSql = simplifiedSql.replace(placeholder, sqlFragment);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// --- Final cleanup: remove any remaining placeholders ---
|
|
127
|
-
simplifiedSql = simplifiedSql.replace(/{{\s*\w+\s*}}/g, '');
|
|
128
|
-
|
|
129
|
-
// Remove dangling where clause if no expressions were applied
|
|
130
|
-
simplifiedSql = simplifiedSql.replace(/\bwhere\b\s*$/i, '').trim();
|
|
131
|
-
|
|
132
|
-
// Need to handle scenarios of complex expression i.e with and / or clauses. probably need to have this logic in the sql expression object itself
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return {
|
|
136
|
-
rawSql: simplifiedSql,
|
|
137
|
-
parameters
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Injectable, Logger } from "@nestjs/common";
|
|
2
|
-
import { InjectDataSource } from "@nestjs/typeorm";
|
|
3
|
-
import { DashboardQuestionSqlDatasetConfig } from "src/entities/dashboard-question-sql-dataset-config.entity";
|
|
4
|
-
import { DashboardQuestion } from "src/entities/dashboard-question.entity";
|
|
5
|
-
import { ModuleMetadataHelperService } from "src/helpers/module-metadata-helper.service";
|
|
6
|
-
import { DashboardService } from "src/services/dashboard.service";
|
|
7
|
-
import { DataSource, EntityManager, EntitySubscriberInterface, InsertEvent, UpdateEvent } from "typeorm";
|
|
8
|
-
|
|
9
|
-
@Injectable()
|
|
10
|
-
export class DashboardQuestionSqlDatasetConfigSubscriber implements EntitySubscriberInterface<DashboardQuestionSqlDatasetConfig> {
|
|
11
|
-
private readonly logger = new Logger(this.constructor.name);
|
|
12
|
-
constructor(
|
|
13
|
-
@InjectDataSource()
|
|
14
|
-
private readonly dataSource: DataSource,
|
|
15
|
-
readonly moduleMetadataHelperService: ModuleMetadataHelperService,
|
|
16
|
-
readonly dashboardService: DashboardService, // Assuming you have a DashboardService for custom queries
|
|
17
|
-
) {
|
|
18
|
-
this.dataSource.subscribers.push(this);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
listenTo() {
|
|
22
|
-
return DashboardQuestionSqlDatasetConfig;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async afterInsert(event: InsertEvent<DashboardQuestionSqlDatasetConfig>) {
|
|
26
|
-
const question = event.entity.question;
|
|
27
|
-
if (!question) {
|
|
28
|
-
this.logger.debug('No question found in the QuestionSqlDatasetConfigSubscriber afterInsert method');
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
await this.saveQuestionToConfig(question, event.queryRunner.manager);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async afterUpdate(event: UpdateEvent<DashboardQuestionSqlDatasetConfig>) {
|
|
35
|
-
const question = event.databaseEntity.question;
|
|
36
|
-
if (!question) {
|
|
37
|
-
this.logger.debug('No question found in the QuestionSqlDatasetConfigSubscriber afterUpdate method');
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
await this.saveQuestionToConfig(question, event.queryRunner.manager);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
private async saveQuestionToConfig(question: DashboardQuestion, entityManager: EntityManager): Promise<void> {
|
|
44
|
-
// Populate the dashboard for the question
|
|
45
|
-
const populatedQuestion = await entityManager.findOne(DashboardQuestion, {
|
|
46
|
-
where: {
|
|
47
|
-
id: question.id,
|
|
48
|
-
},
|
|
49
|
-
relations: ['dashboard', 'dashboard.module', 'dashboard.dashboardVariables', 'dashboard.questions', 'dashboard.questions.questionSqlDatasetConfigs'],
|
|
50
|
-
});
|
|
51
|
-
const dashboard = populatedQuestion?.dashboard;
|
|
52
|
-
|
|
53
|
-
if (!dashboard) {
|
|
54
|
-
throw new Error(`Dashboard not found for question id ${question.id}`);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Call the saveDashboardToConfig method from the DashboardService
|
|
58
|
-
await this.dashboardService.saveDashboardToConfig(dashboard);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Injectable, Logger } from "@nestjs/common";
|
|
2
|
-
import { InjectDataSource } from "@nestjs/typeorm";
|
|
3
|
-
import { DashboardQuestion } from "src/entities/dashboard-question.entity";
|
|
4
|
-
import { Dashboard } from "src/entities/dashboard.entity";
|
|
5
|
-
import { ModuleMetadataHelperService } from "src/helpers/module-metadata-helper.service";
|
|
6
|
-
import { DashboardService } from "src/services/dashboard.service";
|
|
7
|
-
import { DataSource, EntityManager, EntitySubscriberInterface, InsertEvent, UpdateEvent } from "typeorm";
|
|
8
|
-
|
|
9
|
-
@Injectable()
|
|
10
|
-
export class DashboardQuestionSubscriber implements EntitySubscriberInterface<DashboardQuestion> {
|
|
11
|
-
private readonly logger = new Logger(this.constructor.name);
|
|
12
|
-
constructor(
|
|
13
|
-
@InjectDataSource()
|
|
14
|
-
private readonly dataSource: DataSource,
|
|
15
|
-
readonly moduleMetadataHelperService: ModuleMetadataHelperService,
|
|
16
|
-
readonly dashboardService: DashboardService,
|
|
17
|
-
) {
|
|
18
|
-
this.dataSource.subscribers.push(this);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
listenTo() {
|
|
22
|
-
return DashboardQuestion;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async afterInsert(event: InsertEvent<DashboardQuestion>) {
|
|
26
|
-
if (!event.entity) {
|
|
27
|
-
this.logger.debug('No question entity found in the QuestionSubscriber afterInsert method');
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
await this.saveDashboardToConfig(event.entity, event.queryRunner.manager);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async afterUpdate(event: UpdateEvent<DashboardQuestion>) {
|
|
34
|
-
if (!event.databaseEntity) {
|
|
35
|
-
this.logger.debug('No question entity found in the QuestionSubscriber afterUpdate method');
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
await this.saveDashboardToConfig(event.databaseEntity, event.queryRunner.manager);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
private async saveDashboardToConfig(question: DashboardQuestion, entityManager: EntityManager): Promise<void> {
|
|
42
|
-
const dashboard = question.dashboard;
|
|
43
|
-
// Get the dashboard from the question & call the saveDashboardToConfig method
|
|
44
|
-
if (!dashboard) {
|
|
45
|
-
this.logger.debug(`Dashboard is undefined for question id ${question.id}`);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// populate the dashboard with its variables
|
|
50
|
-
const populatedDashboard = await entityManager.findOne(Dashboard, {
|
|
51
|
-
where: { id: dashboard.id },
|
|
52
|
-
relations: ['module','dashboardVariables', 'questions', 'questions.questionSqlDatasetConfigs'],
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
if (!populatedDashboard) {
|
|
56
|
-
throw new Error(`Dashboard not found for question id ${populatedDashboard.id}`);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Call the saveDashboardToConfig method from the DashboardService
|
|
60
|
-
await this.dashboardService.saveDashboardToConfig(populatedDashboard);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Injectable, Logger } from "@nestjs/common";
|
|
2
|
-
import { InjectDataSource } from "@nestjs/typeorm";
|
|
3
|
-
import { DashboardVariable } from "src/entities/dashboard-variable.entity";
|
|
4
|
-
import { Dashboard } from "src/entities/dashboard.entity";
|
|
5
|
-
import { ModuleMetadataHelperService } from "src/helpers/module-metadata-helper.service";
|
|
6
|
-
import { DashboardVariableService } from "src/services/dashboard-variable.service";
|
|
7
|
-
import { DashboardService } from "src/services/dashboard.service";
|
|
8
|
-
import { EntitySubscriberInterface, DataSource, InsertEvent, UpdateEvent, EntityManager } from "typeorm";
|
|
9
|
-
|
|
10
|
-
@Injectable()
|
|
11
|
-
export class DashboardVariableSubscriber implements EntitySubscriberInterface<DashboardVariable> {
|
|
12
|
-
private readonly logger = new Logger(this.constructor.name);
|
|
13
|
-
constructor(
|
|
14
|
-
@InjectDataSource()
|
|
15
|
-
private readonly dataSource: DataSource,
|
|
16
|
-
readonly moduleMetadataHelperService: ModuleMetadataHelperService,
|
|
17
|
-
readonly dashboardService: DashboardService, // Assuming you have a DashboardService for custom queries
|
|
18
|
-
) {
|
|
19
|
-
this.dataSource.subscribers.push(this);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
listenTo() {
|
|
23
|
-
return DashboardVariable;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async afterInsert(event: InsertEvent<DashboardVariable>) {
|
|
27
|
-
if (!event.entity) {
|
|
28
|
-
this.logger.debug('No dashboard variable entity found in the DashboardVariableSubscriber afterInsert method');
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
await this.saveDashboardToConfig(event.entity, event.queryRunner.manager);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async afterUpdate(event: UpdateEvent<DashboardVariable>) {
|
|
35
|
-
if (!event.databaseEntity) {
|
|
36
|
-
this.logger.debug('No dashboard variable entity found in the DashboardVariableSubscriber afterUpdate method');
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
await this.saveDashboardToConfig(event.databaseEntity, event.queryRunner.manager);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
private async saveDashboardToConfig(dashboardVariable: DashboardVariable, entityManager: EntityManager): Promise<void> {
|
|
43
|
-
const dashboard = dashboardVariable.dashboard;
|
|
44
|
-
// Get the dashboard from the question & call the saveDashboardToConfig method
|
|
45
|
-
if (!dashboard) {
|
|
46
|
-
this.logger.debug(`Dashboard is undefined for dashboard variable id ${dashboardVariable.id}`);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// populate the dashboard with its variables
|
|
51
|
-
const populatedDashboard = await entityManager.findOne(Dashboard, {
|
|
52
|
-
where: { id: dashboard.id },
|
|
53
|
-
relations: ['module','dashboardVariables', 'questions', 'questions.questionSqlDatasetConfigs'],
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
if (!populatedDashboard) {
|
|
57
|
-
throw new Error(`Dashboard not found for question id ${populatedDashboard.id}`);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Call the saveDashboardToConfig method from the DashboardService
|
|
61
|
-
await this.dashboardService.saveDashboardToConfig(populatedDashboard);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Injectable, Logger } from '@nestjs/common';
|
|
2
|
-
import { InjectDataSource } from "@nestjs/typeorm";
|
|
3
|
-
import { Dashboard } from 'src/entities/dashboard.entity';
|
|
4
|
-
import { ModuleMetadataHelperService } from "src/helpers/module-metadata-helper.service";
|
|
5
|
-
import { DashboardService } from 'src/services/dashboard.service';
|
|
6
|
-
import { DataSource, EntityManager, EntitySubscriberInterface, InsertEvent, UpdateEvent } from "typeorm";
|
|
7
|
-
|
|
8
|
-
@Injectable()
|
|
9
|
-
export class DashboardSubscriber implements EntitySubscriberInterface<Dashboard> {
|
|
10
|
-
private readonly logger = new Logger(this.constructor.name);
|
|
11
|
-
constructor(
|
|
12
|
-
@InjectDataSource()
|
|
13
|
-
private readonly dataSource: DataSource,
|
|
14
|
-
readonly moduleMetadataHelperService: ModuleMetadataHelperService,
|
|
15
|
-
readonly dashboardService: DashboardService, // Assuming you have a DashboardService for custom queries
|
|
16
|
-
) {
|
|
17
|
-
this.dataSource.subscribers.push(this);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
listenTo() {
|
|
21
|
-
return Dashboard;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
async afterInsert(event: InsertEvent<Dashboard>) {
|
|
25
|
-
if (!event.entity) {
|
|
26
|
-
this.logger.debug('No dashboard entity found in the DashboardSubscriber afterInsert method');
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
await this.saveDashboardToConfig(event.entity, event.queryRunner.manager);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async afterUpdate(event: UpdateEvent<Dashboard>) {
|
|
33
|
-
if (!event.entity) {
|
|
34
|
-
this.logger.debug('No dashboard entity found in the DashboardSubscriber afterInsert method');
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
await this.saveDashboardToConfig(event.databaseEntity, event.queryRunner.manager);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
private async saveDashboardToConfig(dashboard: Dashboard, entityManager: EntityManager): Promise<void> {
|
|
42
|
-
if (!dashboard || !dashboard.id) {
|
|
43
|
-
this.logger.debug('Dashboard or dashboard id is undefined');
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Load the dashboard with module relation populated
|
|
48
|
-
const populatedDashboard = await entityManager.findOne(Dashboard, {
|
|
49
|
-
where: { id: dashboard.id },
|
|
50
|
-
relations: ['module','dashboardVariables', 'questions', 'questions.questionSqlDatasetConfigs'],
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
if (!populatedDashboard) {
|
|
54
|
-
this.logger.error(`Dashboard not found for id ${dashboard.id}`);
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Call the saveDashboardToConfig method from the DashboardService
|
|
59
|
-
await this.dashboardService.saveDashboardToConfig(populatedDashboard);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
}
|