@solidxai/core 0.1.10-beta.22 → 0.1.10-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +9 -1
- 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/create-model-metadata.dto.d.ts +2 -2
- package/dist/dtos/create-model-metadata.dto.d.ts.map +1 -1
- package/dist/dtos/create-model-metadata.dto.js +6 -11
- package/dist/dtos/create-model-metadata.dto.js.map +1 -1
- 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/entities/legacy-common-with-id.entity.d.ts +2 -2
- package/dist/entities/legacy-common-with-id.entity.d.ts.map +1 -1
- package/dist/entities/legacy-common-with-id.entity.js +6 -6
- package/dist/entities/legacy-common-with-id.entity.js.map +1 -1
- package/dist/entities/legacy-common.entity.d.ts +1 -1
- package/dist/entities/legacy-common.entity.d.ts.map +1 -1
- package/dist/entities/legacy-common.entity.js +14 -14
- package/dist/entities/legacy-common.entity.js.map +1 -1
- package/dist/entities/model-metadata.entity.d.ts +2 -2
- package/dist/entities/model-metadata.entity.d.ts.map +1 -1
- package/dist/entities/model-metadata.entity.js +5 -8
- package/dist/entities/model-metadata.entity.js.map +1 -1
- package/dist/enums/legacy-table-type.enum.d.ts +6 -0
- package/dist/enums/legacy-table-type.enum.d.ts.map +1 -0
- package/dist/enums/legacy-table-type.enum.js +10 -0
- package/dist/enums/legacy-table-type.enum.js.map +1 -0
- package/dist/helpers/model-metadata-helper.service.d.ts +2 -1
- package/dist/helpers/model-metadata-helper.service.d.ts.map +1 -1
- package/dist/helpers/model-metadata-helper.service.js +4 -3
- package/dist/helpers/model-metadata-helper.service.js.map +1 -1
- 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 +22 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -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 +6209 -6690
- package/dist/seeders/system-fields-seeder.service.js +1 -1
- package/dist/seeders/system-fields-seeder.service.js.map +1 -1
- 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/mediaStorageProviders/file-s3-storage-provider.js +9 -9
- package/dist/services/mediaStorageProviders/file-s3-storage-provider.js.map +1 -1
- package/dist/services/model-metadata.service.d.ts +2 -2
- package/dist/services/model-metadata.service.d.ts.map +1 -1
- package/dist/services/model-metadata.service.js +3 -4
- package/dist/services/model-metadata.service.js.map +1 -1
- 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/dist/subscribers/model-metadata.subscriber.d.ts.map +1 -1
- package/dist/subscribers/model-metadata.subscriber.js +1 -3
- package/dist/subscribers/model-metadata.subscriber.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/create-model-metadata.dto.ts +5 -9
- 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/entities/legacy-common-with-id.entity.ts +2 -2
- package/src/entities/legacy-common.entity.ts +1 -1
- package/src/entities/model-metadata.entity.ts +3 -5
- package/src/enums/legacy-table-type.enum.ts +5 -0
- package/src/helpers/model-metadata-helper.service.ts +4 -3
- package/src/helpers/module-metadata-helper.service.ts +21 -6
- package/src/helpers/solid-registry.ts +15 -36
- package/src/index.ts +22 -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 +6210 -6691
- package/src/seeders/system-fields-seeder.service.ts +1 -1
- 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/mediaStorageProviders/file-s3-storage-provider.ts +11 -11
- package/src/services/model-metadata.service.ts +6 -8
- 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/src/subscribers/model-metadata.subscriber.ts +1 -3
- package/CURRENT_PROMPT +0 -6
- 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,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.DashboardQuestionSubscriber = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
-
const dashboard_question_entity_1 = require("../entities/dashboard-question.entity");
|
|
19
|
-
const dashboard_entity_1 = require("../entities/dashboard.entity");
|
|
20
|
-
const module_metadata_helper_service_1 = require("../helpers/module-metadata-helper.service");
|
|
21
|
-
const dashboard_service_1 = require("../services/dashboard.service");
|
|
22
|
-
const typeorm_2 = require("typeorm");
|
|
23
|
-
let DashboardQuestionSubscriber = class DashboardQuestionSubscriber {
|
|
24
|
-
constructor(dataSource, moduleMetadataHelperService, dashboardService) {
|
|
25
|
-
this.dataSource = dataSource;
|
|
26
|
-
this.moduleMetadataHelperService = moduleMetadataHelperService;
|
|
27
|
-
this.dashboardService = dashboardService;
|
|
28
|
-
this.logger = new common_1.Logger(this.constructor.name);
|
|
29
|
-
this.dataSource.subscribers.push(this);
|
|
30
|
-
}
|
|
31
|
-
listenTo() {
|
|
32
|
-
return dashboard_question_entity_1.DashboardQuestion;
|
|
33
|
-
}
|
|
34
|
-
async afterInsert(event) {
|
|
35
|
-
if (!event.entity) {
|
|
36
|
-
this.logger.debug('No question entity found in the QuestionSubscriber afterInsert method');
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
await this.saveDashboardToConfig(event.entity, event.queryRunner.manager);
|
|
40
|
-
}
|
|
41
|
-
async afterUpdate(event) {
|
|
42
|
-
if (!event.databaseEntity) {
|
|
43
|
-
this.logger.debug('No question entity found in the QuestionSubscriber afterUpdate method');
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
await this.saveDashboardToConfig(event.databaseEntity, event.queryRunner.manager);
|
|
47
|
-
}
|
|
48
|
-
async saveDashboardToConfig(question, entityManager) {
|
|
49
|
-
const dashboard = question.dashboard;
|
|
50
|
-
if (!dashboard) {
|
|
51
|
-
this.logger.debug(`Dashboard is undefined for question id ${question.id}`);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const populatedDashboard = await entityManager.findOne(dashboard_entity_1.Dashboard, {
|
|
55
|
-
where: { id: dashboard.id },
|
|
56
|
-
relations: ['module', 'dashboardVariables', 'questions', 'questions.questionSqlDatasetConfigs'],
|
|
57
|
-
});
|
|
58
|
-
if (!populatedDashboard) {
|
|
59
|
-
throw new Error(`Dashboard not found for question id ${populatedDashboard.id}`);
|
|
60
|
-
}
|
|
61
|
-
await this.dashboardService.saveDashboardToConfig(populatedDashboard);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
exports.DashboardQuestionSubscriber = DashboardQuestionSubscriber;
|
|
65
|
-
exports.DashboardQuestionSubscriber = DashboardQuestionSubscriber = __decorate([
|
|
66
|
-
(0, common_1.Injectable)(),
|
|
67
|
-
__param(0, (0, typeorm_1.InjectDataSource)()),
|
|
68
|
-
__metadata("design:paramtypes", [typeorm_2.DataSource,
|
|
69
|
-
module_metadata_helper_service_1.ModuleMetadataHelperService,
|
|
70
|
-
dashboard_service_1.DashboardService])
|
|
71
|
-
], DashboardQuestionSubscriber);
|
|
72
|
-
//# sourceMappingURL=dashboard-question.subscriber.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-question.subscriber.js","sourceRoot":"","sources":["../../src/subscribers/dashboard-question.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,6CAAmD;AACnD,qFAA2E;AAC3E,mEAA0D;AAC1D,8FAAyF;AACzF,qEAAkE;AAClE,qCAAyG;AAGlG,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAEpC,YAEI,UAAuC,EAC9B,2BAAwD,EACxD,gBAAkC;QAF1B,eAAU,GAAV,UAAU,CAAY;QAC9B,gCAA2B,GAA3B,2BAA2B,CAA6B;QACxD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAL9B,WAAM,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAOxD,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,QAAQ;QACJ,OAAO,6CAAiB,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAqC;QACnD,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uEAAuE,CAAC,CAAC;YAC3F,OAAO;QACX,CAAC;QACD,MAAM,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAqC;QACnD,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uEAAuE,CAAC,CAAC;YAC3F,OAAO;QACX,CAAC;QACD,MAAM,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACtF,CAAC;IAEO,KAAK,CAAC,qBAAqB,CAAC,QAA2B,EAAE,aAA4B;QACzF,MAAM,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;QAErC,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3E,OAAO;QACX,CAAC;QAGD,MAAM,kBAAkB,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,4BAAS,EAAE;YAC9D,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE;YAC3B,SAAS,EAAE,CAAC,QAAQ,EAAC,oBAAoB,EAAE,WAAW,EAAE,qCAAqC,CAAC;SACjG,CAAC,CAAC;QAEH,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,uCAAuC,kBAAkB,CAAC,EAAE,EAAE,CAAC,CAAC;QACpF,CAAC;QAGD,MAAM,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;IAC1E,CAAC;CACJ,CAAA;AApDY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,mBAAU,GAAE;IAIJ,WAAA,IAAA,0BAAgB,GAAE,CAAA;qCACU,oBAAU;QACD,4DAA2B;QACtC,oCAAgB;GANtC,2BAA2B,CAoDvC","sourcesContent":["import { Injectable, Logger } from \"@nestjs/common\";\nimport { InjectDataSource } from \"@nestjs/typeorm\";\nimport { DashboardQuestion } from \"src/entities/dashboard-question.entity\";\nimport { Dashboard } from \"src/entities/dashboard.entity\";\nimport { ModuleMetadataHelperService } from \"src/helpers/module-metadata-helper.service\";\nimport { DashboardService } from \"src/services/dashboard.service\";\nimport { DataSource, EntityManager, EntitySubscriberInterface, InsertEvent, UpdateEvent } from \"typeorm\";\n\n@Injectable()\nexport class DashboardQuestionSubscriber implements EntitySubscriberInterface<DashboardQuestion> {\n private readonly logger = new Logger(this.constructor.name);\n constructor(\n @InjectDataSource()\n private readonly dataSource: DataSource,\n readonly moduleMetadataHelperService: ModuleMetadataHelperService,\n readonly dashboardService: DashboardService,\n ) {\n this.dataSource.subscribers.push(this);\n }\n\n listenTo() {\n return DashboardQuestion;\n }\n\n async afterInsert(event: InsertEvent<DashboardQuestion>) {\n if (!event.entity) {\n this.logger.debug('No question entity found in the QuestionSubscriber afterInsert method');\n return;\n }\n await this.saveDashboardToConfig(event.entity, event.queryRunner.manager);\n }\n\n async afterUpdate(event: UpdateEvent<DashboardQuestion>) {\n if (!event.databaseEntity) {\n this.logger.debug('No question entity found in the QuestionSubscriber afterUpdate method');\n return;\n }\n await this.saveDashboardToConfig(event.databaseEntity, event.queryRunner.manager);\n }\n\n private async saveDashboardToConfig(question: DashboardQuestion, entityManager: EntityManager): Promise<void> {\n const dashboard = question.dashboard;\n // Get the dashboard from the question & call the saveDashboardToConfig method\n if (!dashboard) {\n this.logger.debug(`Dashboard is undefined for question id ${question.id}`);\n return;\n }\n\n // populate the dashboard with its variables\n const populatedDashboard = await entityManager.findOne(Dashboard, {\n where: { id: dashboard.id },\n relations: ['module','dashboardVariables', 'questions', 'questions.questionSqlDatasetConfigs'],\n });\n\n if (!populatedDashboard) {\n throw new Error(`Dashboard not found for question id ${populatedDashboard.id}`);\n }\n\n // Call the saveDashboardToConfig method from the DashboardService\n await this.dashboardService.saveDashboardToConfig(populatedDashboard);\n }\n}"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DashboardVariable } from "../entities/dashboard-variable.entity";
|
|
2
|
-
import { ModuleMetadataHelperService } from "../helpers/module-metadata-helper.service";
|
|
3
|
-
import { DashboardService } from "../services/dashboard.service";
|
|
4
|
-
import { EntitySubscriberInterface, DataSource, InsertEvent, UpdateEvent } from "typeorm";
|
|
5
|
-
export declare class DashboardVariableSubscriber implements EntitySubscriberInterface<DashboardVariable> {
|
|
6
|
-
private readonly dataSource;
|
|
7
|
-
readonly moduleMetadataHelperService: ModuleMetadataHelperService;
|
|
8
|
-
readonly dashboardService: DashboardService;
|
|
9
|
-
private readonly logger;
|
|
10
|
-
constructor(dataSource: DataSource, moduleMetadataHelperService: ModuleMetadataHelperService, dashboardService: DashboardService);
|
|
11
|
-
listenTo(): typeof DashboardVariable;
|
|
12
|
-
afterInsert(event: InsertEvent<DashboardVariable>): Promise<void>;
|
|
13
|
-
afterUpdate(event: UpdateEvent<DashboardVariable>): Promise<void>;
|
|
14
|
-
private saveDashboardToConfig;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=dashboard-variable.subscriber.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-variable.subscriber.d.ts","sourceRoot":"","sources":["../../src/subscribers/dashboard-variable.subscriber.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAEzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAiB,MAAM,SAAS,CAAC;AAEzG,qBACa,2BAA4B,YAAW,yBAAyB,CAAC,iBAAiB,CAAC;IAIxF,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,QAAQ,CAAC,2BAA2B,EAAE,2BAA2B;IACjE,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB;IAL/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;gBAGvC,UAAU,EAAE,UAAU,EAC9B,2BAA2B,EAAE,2BAA2B,EACxD,gBAAgB,EAAE,gBAAgB;IAK/C,QAAQ;IAIF,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC;IAQjD,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC;YAQzC,qBAAqB;CAqBtC"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.DashboardVariableSubscriber = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
-
const dashboard_variable_entity_1 = require("../entities/dashboard-variable.entity");
|
|
19
|
-
const dashboard_entity_1 = require("../entities/dashboard.entity");
|
|
20
|
-
const module_metadata_helper_service_1 = require("../helpers/module-metadata-helper.service");
|
|
21
|
-
const dashboard_service_1 = require("../services/dashboard.service");
|
|
22
|
-
const typeorm_2 = require("typeorm");
|
|
23
|
-
let DashboardVariableSubscriber = class DashboardVariableSubscriber {
|
|
24
|
-
constructor(dataSource, moduleMetadataHelperService, dashboardService) {
|
|
25
|
-
this.dataSource = dataSource;
|
|
26
|
-
this.moduleMetadataHelperService = moduleMetadataHelperService;
|
|
27
|
-
this.dashboardService = dashboardService;
|
|
28
|
-
this.logger = new common_1.Logger(this.constructor.name);
|
|
29
|
-
this.dataSource.subscribers.push(this);
|
|
30
|
-
}
|
|
31
|
-
listenTo() {
|
|
32
|
-
return dashboard_variable_entity_1.DashboardVariable;
|
|
33
|
-
}
|
|
34
|
-
async afterInsert(event) {
|
|
35
|
-
if (!event.entity) {
|
|
36
|
-
this.logger.debug('No dashboard variable entity found in the DashboardVariableSubscriber afterInsert method');
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
await this.saveDashboardToConfig(event.entity, event.queryRunner.manager);
|
|
40
|
-
}
|
|
41
|
-
async afterUpdate(event) {
|
|
42
|
-
if (!event.databaseEntity) {
|
|
43
|
-
this.logger.debug('No dashboard variable entity found in the DashboardVariableSubscriber afterUpdate method');
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
await this.saveDashboardToConfig(event.databaseEntity, event.queryRunner.manager);
|
|
47
|
-
}
|
|
48
|
-
async saveDashboardToConfig(dashboardVariable, entityManager) {
|
|
49
|
-
const dashboard = dashboardVariable.dashboard;
|
|
50
|
-
if (!dashboard) {
|
|
51
|
-
this.logger.debug(`Dashboard is undefined for dashboard variable id ${dashboardVariable.id}`);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const populatedDashboard = await entityManager.findOne(dashboard_entity_1.Dashboard, {
|
|
55
|
-
where: { id: dashboard.id },
|
|
56
|
-
relations: ['module', 'dashboardVariables', 'questions', 'questions.questionSqlDatasetConfigs'],
|
|
57
|
-
});
|
|
58
|
-
if (!populatedDashboard) {
|
|
59
|
-
throw new Error(`Dashboard not found for question id ${populatedDashboard.id}`);
|
|
60
|
-
}
|
|
61
|
-
await this.dashboardService.saveDashboardToConfig(populatedDashboard);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
exports.DashboardVariableSubscriber = DashboardVariableSubscriber;
|
|
65
|
-
exports.DashboardVariableSubscriber = DashboardVariableSubscriber = __decorate([
|
|
66
|
-
(0, common_1.Injectable)(),
|
|
67
|
-
__param(0, (0, typeorm_1.InjectDataSource)()),
|
|
68
|
-
__metadata("design:paramtypes", [typeorm_2.DataSource,
|
|
69
|
-
module_metadata_helper_service_1.ModuleMetadataHelperService,
|
|
70
|
-
dashboard_service_1.DashboardService])
|
|
71
|
-
], DashboardVariableSubscriber);
|
|
72
|
-
//# sourceMappingURL=dashboard-variable.subscriber.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-variable.subscriber.js","sourceRoot":"","sources":["../../src/subscribers/dashboard-variable.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,6CAAmD;AACnD,qFAA2E;AAC3E,mEAA0D;AAC1D,8FAAyF;AAEzF,qEAAkE;AAClE,qCAAyG;AAGlG,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAEpC,YAEI,UAAuC,EAC9B,2BAAwD,EACxD,gBAAkC;QAF1B,eAAU,GAAV,UAAU,CAAY;QAC9B,gCAA2B,GAA3B,2BAA2B,CAA6B;QACxD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAL9B,WAAM,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAOxD,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,QAAQ;QACJ,OAAO,6CAAiB,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAqC;QACnD,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0FAA0F,CAAC,CAAC;YAC9G,OAAO;QACX,CAAC;QACD,MAAM,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAqC;QACnD,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0FAA0F,CAAC,CAAC;YAC9G,OAAO;QACX,CAAC;QACD,MAAM,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACtF,CAAC;IAEO,KAAK,CAAC,qBAAqB,CAAC,iBAAoC,EAAE,aAA4B;QAClG,MAAM,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC;QAE9C,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oDAAoD,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9F,OAAO;QACX,CAAC;QAGD,MAAM,kBAAkB,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,4BAAS,EAAE;YAC9D,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE;YAC3B,SAAS,EAAE,CAAC,QAAQ,EAAC,oBAAoB,EAAE,WAAW,EAAE,qCAAqC,CAAC;SACjG,CAAC,CAAC;QAEH,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,uCAAuC,kBAAkB,CAAC,EAAE,EAAE,CAAC,CAAC;QACpF,CAAC;QAGD,MAAM,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;IAC1E,CAAC;CACJ,CAAA;AApDY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,mBAAU,GAAE;IAIJ,WAAA,IAAA,0BAAgB,GAAE,CAAA;qCACU,oBAAU;QACD,4DAA2B;QACtC,oCAAgB;GANtC,2BAA2B,CAoDvC","sourcesContent":["import { Injectable, Logger } from \"@nestjs/common\";\nimport { InjectDataSource } from \"@nestjs/typeorm\";\nimport { DashboardVariable } from \"src/entities/dashboard-variable.entity\";\nimport { Dashboard } from \"src/entities/dashboard.entity\";\nimport { ModuleMetadataHelperService } from \"src/helpers/module-metadata-helper.service\";\nimport { DashboardVariableService } from \"src/services/dashboard-variable.service\";\nimport { DashboardService } from \"src/services/dashboard.service\";\nimport { EntitySubscriberInterface, DataSource, InsertEvent, UpdateEvent, EntityManager } from \"typeorm\";\n\n@Injectable()\nexport class DashboardVariableSubscriber implements EntitySubscriberInterface<DashboardVariable> {\n private readonly logger = new Logger(this.constructor.name);\n constructor(\n @InjectDataSource()\n private readonly dataSource: DataSource,\n readonly moduleMetadataHelperService: ModuleMetadataHelperService,\n readonly dashboardService: DashboardService, // Assuming you have a DashboardService for custom queries\n ) {\n this.dataSource.subscribers.push(this);\n }\n\n listenTo() {\n return DashboardVariable;\n }\n\n async afterInsert(event: InsertEvent<DashboardVariable>) {\n if (!event.entity) {\n this.logger.debug('No dashboard variable entity found in the DashboardVariableSubscriber afterInsert method');\n return;\n }\n await this.saveDashboardToConfig(event.entity, event.queryRunner.manager);\n }\n\n async afterUpdate(event: UpdateEvent<DashboardVariable>) {\n if (!event.databaseEntity) {\n this.logger.debug('No dashboard variable entity found in the DashboardVariableSubscriber afterUpdate method');\n return;\n }\n await this.saveDashboardToConfig(event.databaseEntity, event.queryRunner.manager);\n }\n\n private async saveDashboardToConfig(dashboardVariable: DashboardVariable, entityManager: EntityManager): Promise<void> {\n const dashboard = dashboardVariable.dashboard;\n // Get the dashboard from the question & call the saveDashboardToConfig method\n if (!dashboard) {\n this.logger.debug(`Dashboard is undefined for dashboard variable id ${dashboardVariable.id}`);\n return;\n }\n\n // populate the dashboard with its variables\n const populatedDashboard = await entityManager.findOne(Dashboard, {\n where: { id: dashboard.id },\n relations: ['module','dashboardVariables', 'questions', 'questions.questionSqlDatasetConfigs'],\n });\n\n if (!populatedDashboard) {\n throw new Error(`Dashboard not found for question id ${populatedDashboard.id}`);\n }\n\n // Call the saveDashboardToConfig method from the DashboardService\n await this.dashboardService.saveDashboardToConfig(populatedDashboard);\n }\n}"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Dashboard } from '../entities/dashboard.entity';
|
|
2
|
-
import { ModuleMetadataHelperService } from "../helpers/module-metadata-helper.service";
|
|
3
|
-
import { DashboardService } from '../services/dashboard.service';
|
|
4
|
-
import { DataSource, EntitySubscriberInterface, InsertEvent, UpdateEvent } from "typeorm";
|
|
5
|
-
export declare class DashboardSubscriber implements EntitySubscriberInterface<Dashboard> {
|
|
6
|
-
private readonly dataSource;
|
|
7
|
-
readonly moduleMetadataHelperService: ModuleMetadataHelperService;
|
|
8
|
-
readonly dashboardService: DashboardService;
|
|
9
|
-
private readonly logger;
|
|
10
|
-
constructor(dataSource: DataSource, moduleMetadataHelperService: ModuleMetadataHelperService, dashboardService: DashboardService);
|
|
11
|
-
listenTo(): typeof Dashboard;
|
|
12
|
-
afterInsert(event: InsertEvent<Dashboard>): Promise<void>;
|
|
13
|
-
afterUpdate(event: UpdateEvent<Dashboard>): Promise<void>;
|
|
14
|
-
private saveDashboardToConfig;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=dashboard.subscriber.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.subscriber.d.ts","sourceRoot":"","sources":["../../src/subscribers/dashboard.subscriber.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAiB,yBAAyB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEzG,qBACa,mBAAoB,YAAW,yBAAyB,CAAC,SAAS,CAAC;IAIxE,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,QAAQ,CAAC,2BAA2B,EAAE,2BAA2B;IACjE,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB;IAL/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;gBAGvC,UAAU,EAAE,UAAU,EAC9B,2BAA2B,EAAE,2BAA2B,EACxD,gBAAgB,EAAE,gBAAgB;IAK/C,QAAQ;IAIF,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC;IAQzC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC;YASjC,qBAAqB;CAqBtC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.DashboardSubscriber = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
-
const dashboard_entity_1 = require("../entities/dashboard.entity");
|
|
19
|
-
const module_metadata_helper_service_1 = require("../helpers/module-metadata-helper.service");
|
|
20
|
-
const dashboard_service_1 = require("../services/dashboard.service");
|
|
21
|
-
const typeorm_2 = require("typeorm");
|
|
22
|
-
let DashboardSubscriber = class DashboardSubscriber {
|
|
23
|
-
constructor(dataSource, moduleMetadataHelperService, dashboardService) {
|
|
24
|
-
this.dataSource = dataSource;
|
|
25
|
-
this.moduleMetadataHelperService = moduleMetadataHelperService;
|
|
26
|
-
this.dashboardService = dashboardService;
|
|
27
|
-
this.logger = new common_1.Logger(this.constructor.name);
|
|
28
|
-
this.dataSource.subscribers.push(this);
|
|
29
|
-
}
|
|
30
|
-
listenTo() {
|
|
31
|
-
return dashboard_entity_1.Dashboard;
|
|
32
|
-
}
|
|
33
|
-
async afterInsert(event) {
|
|
34
|
-
if (!event.entity) {
|
|
35
|
-
this.logger.debug('No dashboard entity found in the DashboardSubscriber afterInsert method');
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
await this.saveDashboardToConfig(event.entity, event.queryRunner.manager);
|
|
39
|
-
}
|
|
40
|
-
async afterUpdate(event) {
|
|
41
|
-
if (!event.entity) {
|
|
42
|
-
this.logger.debug('No dashboard entity found in the DashboardSubscriber afterInsert method');
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
await this.saveDashboardToConfig(event.databaseEntity, event.queryRunner.manager);
|
|
46
|
-
}
|
|
47
|
-
async saveDashboardToConfig(dashboard, entityManager) {
|
|
48
|
-
if (!dashboard || !dashboard.id) {
|
|
49
|
-
this.logger.debug('Dashboard or dashboard id is undefined');
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
const populatedDashboard = await entityManager.findOne(dashboard_entity_1.Dashboard, {
|
|
53
|
-
where: { id: dashboard.id },
|
|
54
|
-
relations: ['module', 'dashboardVariables', 'questions', 'questions.questionSqlDatasetConfigs'],
|
|
55
|
-
});
|
|
56
|
-
if (!populatedDashboard) {
|
|
57
|
-
this.logger.error(`Dashboard not found for id ${dashboard.id}`);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
await this.dashboardService.saveDashboardToConfig(populatedDashboard);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
exports.DashboardSubscriber = DashboardSubscriber;
|
|
64
|
-
exports.DashboardSubscriber = DashboardSubscriber = __decorate([
|
|
65
|
-
(0, common_1.Injectable)(),
|
|
66
|
-
__param(0, (0, typeorm_1.InjectDataSource)()),
|
|
67
|
-
__metadata("design:paramtypes", [typeorm_2.DataSource,
|
|
68
|
-
module_metadata_helper_service_1.ModuleMetadataHelperService,
|
|
69
|
-
dashboard_service_1.DashboardService])
|
|
70
|
-
], DashboardSubscriber);
|
|
71
|
-
//# sourceMappingURL=dashboard.subscriber.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.subscriber.js","sourceRoot":"","sources":["../../src/subscribers/dashboard.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,6CAAmD;AACnD,mEAA0D;AAC1D,8FAAyF;AACzF,qEAAkE;AAClE,qCAAyG;AAGlG,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAE5B,YAEI,UAAuC,EAC9B,2BAAwD,EACxD,gBAAkC;QAF1B,eAAU,GAAV,UAAU,CAAY;QAC9B,gCAA2B,GAA3B,2BAA2B,CAA6B;QACxD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAL9B,WAAM,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAOxD,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,QAAQ;QACJ,OAAO,4BAAS,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAA6B;QAC3C,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;YAC7F,OAAO;QACX,CAAC;QACD,MAAM,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAA6B;QAC3C,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;YAC7F,OAAO;QACX,CAAC;QAED,MAAM,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACtF,CAAC;IAEO,KAAK,CAAC,qBAAqB,CAAC,SAAoB,EAAE,aAA4B;QAClF,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC;YAC9B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;YAC5D,OAAO;QACX,CAAC;QAGD,MAAM,kBAAkB,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,4BAAS,EAAE;YAC9D,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE;YAC3B,SAAS,EAAE,CAAC,QAAQ,EAAC,oBAAoB,EAAE,WAAW,EAAE,qCAAqC,CAAC;SACjG,CAAC,CAAC;QAEH,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC;YAChE,OAAO;QACX,CAAC;QAGD,MAAM,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;IAC1E,CAAC;CAEJ,CAAA;AArDY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAIJ,WAAA,IAAA,0BAAgB,GAAE,CAAA;qCACU,oBAAU;QACD,4DAA2B;QACtC,oCAAgB;GANtC,mBAAmB,CAqD/B","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport { InjectDataSource } from \"@nestjs/typeorm\";\nimport { Dashboard } from 'src/entities/dashboard.entity';\nimport { ModuleMetadataHelperService } from \"src/helpers/module-metadata-helper.service\";\nimport { DashboardService } from 'src/services/dashboard.service';\nimport { DataSource, EntityManager, EntitySubscriberInterface, InsertEvent, UpdateEvent } from \"typeorm\";\n\n@Injectable()\nexport class DashboardSubscriber implements EntitySubscriberInterface<Dashboard> {\n private readonly logger = new Logger(this.constructor.name);\n constructor(\n @InjectDataSource()\n private readonly dataSource: DataSource,\n readonly moduleMetadataHelperService: ModuleMetadataHelperService,\n readonly dashboardService: DashboardService, // Assuming you have a DashboardService for custom queries\n ) {\n this.dataSource.subscribers.push(this);\n }\n\n listenTo() {\n return Dashboard;\n }\n\n async afterInsert(event: InsertEvent<Dashboard>) {\n if (!event.entity) {\n this.logger.debug('No dashboard entity found in the DashboardSubscriber afterInsert method');\n return;\n }\n await this.saveDashboardToConfig(event.entity, event.queryRunner.manager);\n }\n\n async afterUpdate(event: UpdateEvent<Dashboard>) {\n if (!event.entity) {\n this.logger.debug('No dashboard entity found in the DashboardSubscriber afterInsert method');\n return;\n }\n\n await this.saveDashboardToConfig(event.databaseEntity, event.queryRunner.manager);\n }\n\n private async saveDashboardToConfig(dashboard: Dashboard, entityManager: EntityManager): Promise<void> {\n if (!dashboard || !dashboard.id) {\n this.logger.debug('Dashboard or dashboard id is undefined');\n return;\n }\n\n // Load the dashboard with module relation populated\n const populatedDashboard = await entityManager.findOne(Dashboard, {\n where: { id: dashboard.id },\n relations: ['module','dashboardVariables', 'questions', 'questions.questionSqlDatasetConfigs'],\n });\n\n if (!populatedDashboard) {\n this.logger.error(`Dashboard not found for id ${dashboard.id}`);\n return;\n }\n\n // Call the saveDashboardToConfig method from the DashboardService\n await this.dashboardService.saveDashboardToConfig(populatedDashboard);\n }\n\n}"]}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { Controller, Post, Body, Param, UploadedFiles, UseInterceptors, Put, Get, Query, Delete, Patch } from '@nestjs/common';
|
|
2
|
-
import { AnyFilesInterceptor } from "@nestjs/platform-express";
|
|
3
|
-
import { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';
|
|
4
|
-
import { CreateDashboardLayoutDto } from 'src/dtos/create-dashboard-layout.dto';
|
|
5
|
-
import { UpdateDashboardLayoutDto } from 'src/dtos/update-dashboard-layout.dto';
|
|
6
|
-
import { DashboardLayoutService } from 'src/services/dashboard-layout.service';
|
|
7
|
-
|
|
8
|
-
enum ShowSoftDeleted {
|
|
9
|
-
INCLUSIVE = "inclusive",
|
|
10
|
-
EXCLUSIVE = "exclusive",
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@ApiTags('Solid Core')
|
|
14
|
-
@Controller('dashboard-layout')
|
|
15
|
-
export class DashboardLayoutController {
|
|
16
|
-
constructor(private readonly service: DashboardLayoutService) { }
|
|
17
|
-
|
|
18
|
-
@ApiBearerAuth("jwt")
|
|
19
|
-
@Post()
|
|
20
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
21
|
-
create(@Body() createDto: CreateDashboardLayoutDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
22
|
-
return this.service.create(createDto, files);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@ApiBearerAuth("jwt")
|
|
26
|
-
@Post('/bulk')
|
|
27
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
28
|
-
insertMany(@Body() createDtos: CreateDashboardLayoutDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {
|
|
29
|
-
return this.service.insertMany(createDtos, filesArray);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@ApiBearerAuth("jwt")
|
|
33
|
-
@Post('/upsert-user-dashboard-layout')
|
|
34
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
35
|
-
upsertUserDashboardLayout(@Body() createDtos: CreateDashboardLayoutDto) {
|
|
36
|
-
return this.service.upsertUserDashboardLayout(createDtos);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
@ApiBearerAuth("jwt")
|
|
41
|
-
@Put(':id')
|
|
42
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
43
|
-
update(@Param('id') id: number, @Body() updateDto: UpdateDashboardLayoutDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
44
|
-
return this.service.update(id, updateDto, files);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@ApiBearerAuth("jwt")
|
|
48
|
-
@Patch(':id')
|
|
49
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
50
|
-
partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateDashboardLayoutDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
51
|
-
return this.service.update(id, updateDto, files, true);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@ApiBearerAuth("jwt")
|
|
55
|
-
@Post('/bulk-recover')
|
|
56
|
-
async recoverMany(@Body() ids: number[]) {
|
|
57
|
-
return this.service.recoverMany(ids);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@ApiBearerAuth("jwt")
|
|
61
|
-
@Get('/user-dashboard-layout/:dashboardId')
|
|
62
|
-
async getUserDashboardLayoutByDashboardId(@Param('dashboardId') dashboardId: number) {
|
|
63
|
-
return this.service.getUserDashboardLayoutByDashboardId(dashboardId);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@ApiBearerAuth("jwt")
|
|
67
|
-
@Get('/recover/:id')
|
|
68
|
-
async recover(@Param('id') id: number) {
|
|
69
|
-
return this.service.recover(id);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@ApiBearerAuth("jwt")
|
|
73
|
-
@ApiQuery({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted })
|
|
74
|
-
@ApiQuery({ name: 'limit', required: false, type: Number })
|
|
75
|
-
@ApiQuery({ name: 'offset', required: false, type: Number })
|
|
76
|
-
@ApiQuery({ name: 'fields', required: false, type: Array })
|
|
77
|
-
@ApiQuery({ name: 'sort', required: false, type: Array })
|
|
78
|
-
@ApiQuery({ name: 'groupBy', required: false, type: Array })
|
|
79
|
-
@ApiQuery({ name: 'populate', required: false, type: Array })
|
|
80
|
-
@ApiQuery({ name: 'populateMedia', required: false, type: Array })
|
|
81
|
-
@ApiQuery({ name: 'filters', required: false, type: Array })
|
|
82
|
-
@Get()
|
|
83
|
-
async findMany(@Query() query: any) {
|
|
84
|
-
return this.service.find(query);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
@ApiBearerAuth("jwt")
|
|
88
|
-
@Get(':id')
|
|
89
|
-
async findOne(@Param('id') id: string, @Query() query: any) {
|
|
90
|
-
return this.service.findOne(+id, query);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
@ApiBearerAuth("jwt")
|
|
94
|
-
@Delete('/bulk')
|
|
95
|
-
async deleteMany(@Body() ids: number[]) {
|
|
96
|
-
return this.service.deleteMany(ids);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
@ApiBearerAuth("jwt")
|
|
100
|
-
@Delete(':id')
|
|
101
|
-
async delete(@Param('id') id: number) {
|
|
102
|
-
return this.service.delete(id);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { Controller, Post, Body, Param, UploadedFiles, UseInterceptors, Put, Get, Query, Delete, Patch } from '@nestjs/common';
|
|
2
|
-
import { AnyFilesInterceptor } from "@nestjs/platform-express";
|
|
3
|
-
import { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';
|
|
4
|
-
import { DashboardQuestionSqlDatasetConfigService } from '../services/dashboard-question-sql-dataset-config.service';
|
|
5
|
-
import { CreateDashboardQuestionSqlDatasetConfigDto } from '../dtos/create-dashboard-question-sql-dataset-config.dto';
|
|
6
|
-
import { UpdateDashboardQuestionSqlDatasetConfigDto } from '../dtos/update-dashboard-question-sql-dataset-config.dto';
|
|
7
|
-
|
|
8
|
-
enum ShowSoftDeleted {
|
|
9
|
-
INCLUSIVE = "inclusive",
|
|
10
|
-
EXCLUSIVE = "exclusive",
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@ApiTags('Solid Core')
|
|
14
|
-
@Controller('dashboard-question-sql-dataset-config')
|
|
15
|
-
export class DashboardQuestionSqlDatasetConfigController {
|
|
16
|
-
constructor(private readonly service: DashboardQuestionSqlDatasetConfigService) {}
|
|
17
|
-
|
|
18
|
-
@ApiBearerAuth("jwt")
|
|
19
|
-
@Post()
|
|
20
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
21
|
-
create(@Body() createDto: CreateDashboardQuestionSqlDatasetConfigDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
22
|
-
return this.service.create(createDto, files);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@ApiBearerAuth("jwt")
|
|
26
|
-
@Post('/bulk')
|
|
27
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
28
|
-
insertMany(@Body() createDtos: CreateDashboardQuestionSqlDatasetConfigDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {
|
|
29
|
-
return this.service.insertMany(createDtos, filesArray);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
@ApiBearerAuth("jwt")
|
|
34
|
-
@Put(':id')
|
|
35
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
36
|
-
update(@Param('id') id: number, @Body() updateDto: UpdateDashboardQuestionSqlDatasetConfigDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
37
|
-
return this.service.update(id, updateDto, files);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@ApiBearerAuth("jwt")
|
|
41
|
-
@Patch(':id')
|
|
42
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
43
|
-
partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateDashboardQuestionSqlDatasetConfigDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
44
|
-
return this.service.update(id, updateDto, files, true);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@ApiBearerAuth("jwt")
|
|
48
|
-
@Post('/bulk-recover')
|
|
49
|
-
async recoverMany(@Body() ids: number[]) {
|
|
50
|
-
return this.service.recoverMany(ids);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@ApiBearerAuth("jwt")
|
|
54
|
-
@Get('/recover/:id')
|
|
55
|
-
async recover(@Param('id') id: number) {
|
|
56
|
-
return this.service.recover(id);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@ApiBearerAuth("jwt")
|
|
60
|
-
@ApiQuery({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted })
|
|
61
|
-
@ApiQuery({ name: 'limit', required: false, type: Number })
|
|
62
|
-
@ApiQuery({ name: 'offset', required: false, type: Number })
|
|
63
|
-
@ApiQuery({ name: 'fields', required: false, type: Array })
|
|
64
|
-
@ApiQuery({ name: 'sort', required: false, type: Array })
|
|
65
|
-
@ApiQuery({ name: 'groupBy', required: false, type: Array })
|
|
66
|
-
@ApiQuery({ name: 'populate', required: false, type: Array })
|
|
67
|
-
@ApiQuery({ name: 'populateMedia', required: false, type: Array })
|
|
68
|
-
@ApiQuery({ name: 'filters', required: false, type: Array })
|
|
69
|
-
@Get()
|
|
70
|
-
async findMany(@Query() query: any) {
|
|
71
|
-
return this.service.find(query);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@ApiBearerAuth("jwt")
|
|
75
|
-
@Get(':id')
|
|
76
|
-
async findOne(@Param('id') id: string, @Query() query: any) {
|
|
77
|
-
return this.service.findOne(+id, query);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@ApiBearerAuth("jwt")
|
|
81
|
-
@Delete('/bulk')
|
|
82
|
-
async deleteMany(@Body() ids: number[]) {
|
|
83
|
-
return this.service.deleteMany(ids);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@ApiBearerAuth("jwt")
|
|
87
|
-
@Delete(':id')
|
|
88
|
-
async delete(@Param('id') id: number) {
|
|
89
|
-
return this.service.delete(id);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { Controller, Post, Body, Param, UploadedFiles, UseInterceptors, Put, Get, Query, Delete, Patch } from '@nestjs/common';
|
|
2
|
-
import { AnyFilesInterceptor } from "@nestjs/platform-express";
|
|
3
|
-
import { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';
|
|
4
|
-
import { DashboardQuestionService } from '../services/dashboard-question.service';
|
|
5
|
-
import { CreateDashboardQuestionDto } from '../dtos/create-dashboard-question.dto';
|
|
6
|
-
import { UpdateDashboardQuestionDto } from '../dtos/update-dashboard-question.dto';
|
|
7
|
-
import { SqlExpression } from 'src/services/question-data-providers/chartjs-sql-data-provider.service';
|
|
8
|
-
|
|
9
|
-
enum ShowSoftDeleted {
|
|
10
|
-
INCLUSIVE = "inclusive",
|
|
11
|
-
EXCLUSIVE = "exclusive",
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@ApiTags('Solid Core')
|
|
15
|
-
@Controller('dashboard-question')
|
|
16
|
-
export class DashboardQuestionController {
|
|
17
|
-
constructor(private readonly service: DashboardQuestionService) { }
|
|
18
|
-
|
|
19
|
-
@ApiBearerAuth("jwt")
|
|
20
|
-
@Post()
|
|
21
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
22
|
-
create(@Body() createDto: CreateDashboardQuestionDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
23
|
-
return this.service.create(createDto, files);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@ApiBearerAuth("jwt")
|
|
27
|
-
@Post('/bulk')
|
|
28
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
29
|
-
insertMany(@Body() createDtos: CreateDashboardQuestionDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {
|
|
30
|
-
return this.service.insertMany(createDtos, filesArray);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
@ApiBearerAuth("jwt")
|
|
35
|
-
@Put(':id')
|
|
36
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
37
|
-
update(@Param('id') id: number, @Body() updateDto: UpdateDashboardQuestionDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
38
|
-
return this.service.update(id, updateDto, files);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@ApiBearerAuth("jwt")
|
|
42
|
-
@Patch(':id')
|
|
43
|
-
@UseInterceptors(AnyFilesInterceptor())
|
|
44
|
-
partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateDashboardQuestionDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
45
|
-
return this.service.update(id, updateDto, files, true);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@ApiBearerAuth("jwt")
|
|
49
|
-
@Post('/bulk-recover')
|
|
50
|
-
async recoverMany(@Body() ids: number[]) {
|
|
51
|
-
return this.service.recoverMany(ids);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@ApiBearerAuth("jwt")
|
|
55
|
-
@Get('/recover/:id')
|
|
56
|
-
async recover(@Param('id') id: number) {
|
|
57
|
-
return this.service.recover(id);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@ApiBearerAuth("jwt")
|
|
61
|
-
@ApiQuery({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted })
|
|
62
|
-
@ApiQuery({ name: 'limit', required: false, type: Number })
|
|
63
|
-
@ApiQuery({ name: 'offset', required: false, type: Number })
|
|
64
|
-
@ApiQuery({ name: 'fields', required: false, type: Array })
|
|
65
|
-
@ApiQuery({ name: 'sort', required: false, type: Array })
|
|
66
|
-
@ApiQuery({ name: 'groupBy', required: false, type: Array })
|
|
67
|
-
@ApiQuery({ name: 'populate', required: false, type: Array })
|
|
68
|
-
@ApiQuery({ name: 'populateMedia', required: false, type: Array })
|
|
69
|
-
@ApiQuery({ name: 'filters', required: false, type: Array })
|
|
70
|
-
@Get()
|
|
71
|
-
async findMany(@Query() query: any) {
|
|
72
|
-
return this.service.find(query);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@ApiBearerAuth("jwt")
|
|
76
|
-
@Get(':id/data')
|
|
77
|
-
async getData(
|
|
78
|
-
@Param('id') id: string,
|
|
79
|
-
@Query('filters') filters: SqlExpression[],
|
|
80
|
-
@Query('isPreview') isPreview?: string
|
|
81
|
-
) {
|
|
82
|
-
const previewMode = isPreview === 'true';
|
|
83
|
-
return this.service.getData(+id, filters, previewMode);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@ApiBearerAuth("jwt")
|
|
87
|
-
@Get(':id')
|
|
88
|
-
async findOne(@Param('id') id: string, @Query() query: any) {
|
|
89
|
-
return this.service.findOne(+id, query);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
@ApiBearerAuth("jwt")
|
|
93
|
-
@Delete('/bulk')
|
|
94
|
-
async deleteMany(@Body() ids: number[]) {
|
|
95
|
-
return this.service.deleteMany(ids);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
@ApiBearerAuth("jwt")
|
|
99
|
-
@Delete(':id')
|
|
100
|
-
async delete(@Param('id') id: number) {
|
|
101
|
-
return this.service.delete(id);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export const IS_DASHBOARD_VARIABLE_SELECTION_PROVIDER = 'IS_DASHBOARD_VARIABLE_SELECTION_PROVIDER';
|
|
2
|
-
|
|
3
|
-
export const DashboardVariableSelectionProvider = () => {
|
|
4
|
-
return (target: Function) => {
|
|
5
|
-
Reflect.defineMetadata(IS_DASHBOARD_VARIABLE_SELECTION_PROVIDER, true, target);
|
|
6
|
-
};
|
|
7
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
-
import { IsString } from 'class-validator';
|
|
3
|
-
import { IsNotEmpty, IsOptional, IsInt } from 'class-validator';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export class CreateDashboardLayoutDto {
|
|
7
|
-
@IsNotEmpty()
|
|
8
|
-
@IsString()
|
|
9
|
-
@ApiProperty()
|
|
10
|
-
layout: string;
|
|
11
|
-
|
|
12
|
-
@IsOptional()
|
|
13
|
-
@IsInt()
|
|
14
|
-
@ApiProperty({ description: "Related Dashboard Model" })
|
|
15
|
-
dashboardId: number;
|
|
16
|
-
|
|
17
|
-
@IsString()
|
|
18
|
-
@IsOptional()
|
|
19
|
-
@ApiProperty({ description: "Related Dashboard Model" })
|
|
20
|
-
dashboardUserKey: string;
|
|
21
|
-
|
|
22
|
-
@IsOptional()
|
|
23
|
-
@IsInt()
|
|
24
|
-
@ApiProperty()
|
|
25
|
-
userId: number;
|
|
26
|
-
|
|
27
|
-
@IsString()
|
|
28
|
-
@IsOptional()
|
|
29
|
-
@ApiProperty()
|
|
30
|
-
userUserKey: string;
|
|
31
|
-
}
|