@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.
Files changed (481) hide show
  1. package/CLAUDE.md +9 -1
  2. package/dist/commands/info.command.d.ts.map +1 -1
  3. package/dist/commands/info.command.js +0 -2
  4. package/dist/commands/info.command.js.map +1 -1
  5. package/dist/controllers/dashboard-user-layout.controller.d.ts +43 -0
  6. package/dist/controllers/dashboard-user-layout.controller.d.ts.map +1 -0
  7. package/dist/controllers/{dashboard-variable.controller.js → dashboard-user-layout.controller.js} +30 -30
  8. package/dist/controllers/dashboard-user-layout.controller.js.map +1 -0
  9. package/dist/controllers/dashboard.controller.d.ts +12 -42
  10. package/dist/controllers/dashboard.controller.d.ts.map +1 -1
  11. package/dist/controllers/dashboard.controller.js +71 -141
  12. package/dist/controllers/dashboard.controller.js.map +1 -1
  13. package/dist/decorators/dashboard-widget-data-provider.decorator.d.ts +3 -0
  14. package/dist/decorators/dashboard-widget-data-provider.decorator.d.ts.map +1 -0
  15. package/dist/decorators/dashboard-widget-data-provider.decorator.js +8 -0
  16. package/dist/decorators/dashboard-widget-data-provider.decorator.js.map +1 -0
  17. package/dist/dtos/create-dashboard-user-layout.dto.d.ts +10 -0
  18. package/dist/dtos/create-dashboard-user-layout.dto.d.ts.map +1 -0
  19. package/dist/dtos/create-dashboard-user-layout.dto.js +66 -0
  20. package/dist/dtos/create-dashboard-user-layout.dto.js.map +1 -0
  21. package/dist/dtos/create-model-metadata.dto.d.ts +2 -2
  22. package/dist/dtos/create-model-metadata.dto.d.ts.map +1 -1
  23. package/dist/dtos/create-model-metadata.dto.js +6 -11
  24. package/dist/dtos/create-model-metadata.dto.js.map +1 -1
  25. package/dist/dtos/dashboard-variable-options-query.dto.d.ts +7 -0
  26. package/dist/dtos/dashboard-variable-options-query.dto.d.ts.map +1 -0
  27. package/dist/dtos/dashboard-variable-options-query.dto.js +40 -0
  28. package/dist/dtos/dashboard-variable-options-query.dto.js.map +1 -0
  29. package/dist/dtos/dashboard-widget-data-request.dto.d.ts +12 -0
  30. package/dist/dtos/dashboard-widget-data-request.dto.d.ts.map +1 -0
  31. package/dist/dtos/dashboard-widget-data-request.dto.js +65 -0
  32. package/dist/dtos/dashboard-widget-data-request.dto.js.map +1 -0
  33. package/dist/dtos/update-dashboard-user-layout.dto.d.ts +11 -0
  34. package/dist/dtos/update-dashboard-user-layout.dto.d.ts.map +1 -0
  35. package/dist/dtos/{update-dashboard-layout.dto.js → update-dashboard-user-layout.dto.js} +34 -16
  36. package/dist/dtos/update-dashboard-user-layout.dto.js.map +1 -0
  37. package/dist/entities/dashboard-user-layout.entity.d.ts +11 -0
  38. package/dist/entities/dashboard-user-layout.entity.d.ts.map +1 -0
  39. package/dist/entities/dashboard-user-layout.entity.js +52 -0
  40. package/dist/entities/dashboard-user-layout.entity.js.map +1 -0
  41. package/dist/entities/legacy-common-with-id.entity.d.ts +2 -2
  42. package/dist/entities/legacy-common-with-id.entity.d.ts.map +1 -1
  43. package/dist/entities/legacy-common-with-id.entity.js +6 -6
  44. package/dist/entities/legacy-common-with-id.entity.js.map +1 -1
  45. package/dist/entities/legacy-common.entity.d.ts +1 -1
  46. package/dist/entities/legacy-common.entity.d.ts.map +1 -1
  47. package/dist/entities/legacy-common.entity.js +14 -14
  48. package/dist/entities/legacy-common.entity.js.map +1 -1
  49. package/dist/entities/model-metadata.entity.d.ts +2 -2
  50. package/dist/entities/model-metadata.entity.d.ts.map +1 -1
  51. package/dist/entities/model-metadata.entity.js +5 -8
  52. package/dist/entities/model-metadata.entity.js.map +1 -1
  53. package/dist/enums/legacy-table-type.enum.d.ts +6 -0
  54. package/dist/enums/legacy-table-type.enum.d.ts.map +1 -0
  55. package/dist/enums/legacy-table-type.enum.js +10 -0
  56. package/dist/enums/legacy-table-type.enum.js.map +1 -0
  57. package/dist/helpers/model-metadata-helper.service.d.ts +2 -1
  58. package/dist/helpers/model-metadata-helper.service.d.ts.map +1 -1
  59. package/dist/helpers/model-metadata-helper.service.js +4 -3
  60. package/dist/helpers/model-metadata-helper.service.js.map +1 -1
  61. package/dist/helpers/module-metadata-helper.service.d.ts.map +1 -1
  62. package/dist/helpers/module-metadata-helper.service.js +15 -4
  63. package/dist/helpers/module-metadata-helper.service.js.map +1 -1
  64. package/dist/helpers/solid-registry.d.ts +5 -9
  65. package/dist/helpers/solid-registry.d.ts.map +1 -1
  66. package/dist/helpers/solid-registry.js +13 -28
  67. package/dist/helpers/solid-registry.js.map +1 -1
  68. package/dist/index.d.ts +22 -5
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +22 -5
  71. package/dist/index.js.map +1 -1
  72. package/dist/interfaces.d.ts +24 -13
  73. package/dist/interfaces.d.ts.map +1 -1
  74. package/dist/interfaces.js.map +1 -1
  75. package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.d.ts +1 -3
  76. package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.d.ts.map +1 -1
  77. package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js +2 -25
  78. package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js.map +1 -1
  79. package/dist/{repository/dashboard-layout.repository.d.ts → repositories/dashboard-user-layout.repository.d.ts} +5 -5
  80. package/dist/repositories/dashboard-user-layout.repository.d.ts.map +1 -0
  81. package/dist/{repository/dashboard-question-sql-dataset-config.repository.js → repositories/dashboard-user-layout.repository.js} +15 -10
  82. package/dist/repositories/dashboard-user-layout.repository.js.map +1 -0
  83. package/dist/seeders/module-metadata-seeder.service.d.ts +1 -6
  84. package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
  85. package/dist/seeders/module-metadata-seeder.service.js +1 -60
  86. package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
  87. package/dist/seeders/seed-data/solid-core-metadata.json +6209 -6690
  88. package/dist/seeders/system-fields-seeder.service.js +1 -1
  89. package/dist/seeders/system-fields-seeder.service.js.map +1 -1
  90. package/dist/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.d.ts +13 -0
  91. package/dist/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.d.ts.map +1 -0
  92. package/dist/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.js +55 -0
  93. package/dist/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.js.map +1 -0
  94. package/dist/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.d.ts +13 -0
  95. package/dist/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.d.ts.map +1 -0
  96. package/dist/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.js +52 -0
  97. package/dist/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.js.map +1 -0
  98. package/dist/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.d.ts +13 -0
  99. package/dist/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.d.ts.map +1 -0
  100. package/dist/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.js +52 -0
  101. package/dist/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.js.map +1 -0
  102. package/dist/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.d.ts +10 -0
  103. package/dist/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.d.ts.map +1 -0
  104. package/dist/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.js +62 -0
  105. package/dist/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.js.map +1 -0
  106. package/dist/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.d.ts +10 -0
  107. package/dist/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.d.ts.map +1 -0
  108. package/dist/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.js +82 -0
  109. package/dist/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.js.map +1 -0
  110. package/dist/services/dashboard-providers/mq-dashboard-provider-utils.d.ts +17 -0
  111. package/dist/services/dashboard-providers/mq-dashboard-provider-utils.d.ts.map +1 -0
  112. package/dist/services/dashboard-providers/mq-dashboard-provider-utils.js +130 -0
  113. package/dist/services/dashboard-providers/mq-dashboard-provider-utils.js.map +1 -0
  114. package/dist/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.d.ts +37 -0
  115. package/dist/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.d.ts.map +1 -0
  116. package/dist/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.js +112 -0
  117. package/dist/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.js.map +1 -0
  118. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.d.ts +10 -0
  119. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.d.ts.map +1 -0
  120. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.js +57 -0
  121. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.js.map +1 -0
  122. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.d.ts +10 -0
  123. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.d.ts.map +1 -0
  124. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.js +57 -0
  125. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.js.map +1 -0
  126. package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.d.ts +10 -0
  127. package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.d.ts.map +1 -0
  128. package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.js +100 -0
  129. package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.js.map +1 -0
  130. package/dist/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.d.ts +10 -0
  131. package/dist/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.d.ts.map +1 -0
  132. package/dist/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.js +55 -0
  133. package/dist/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.js.map +1 -0
  134. package/dist/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.d.ts +13 -0
  135. package/dist/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.d.ts.map +1 -0
  136. package/dist/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.js +52 -0
  137. package/dist/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.js.map +1 -0
  138. package/dist/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.d.ts +15 -0
  139. package/dist/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.d.ts.map +1 -0
  140. package/dist/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.js +60 -0
  141. package/dist/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.js.map +1 -0
  142. package/dist/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.d.ts +13 -0
  143. package/dist/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.d.ts.map +1 -0
  144. package/dist/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.js +51 -0
  145. package/dist/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.js.map +1 -0
  146. package/dist/services/dashboard-runtime.service.d.ts +31 -0
  147. package/dist/services/dashboard-runtime.service.d.ts.map +1 -0
  148. package/dist/services/dashboard-runtime.service.js +408 -0
  149. package/dist/services/dashboard-runtime.service.js.map +1 -0
  150. package/dist/services/dashboard-user-layout.service.d.ts +12 -0
  151. package/dist/services/dashboard-user-layout.service.d.ts.map +1 -0
  152. package/dist/services/{dashboard-variable.service.js → dashboard-user-layout.service.js} +11 -12
  153. package/dist/services/dashboard-user-layout.service.js.map +1 -0
  154. package/dist/services/mediaStorageProviders/file-s3-storage-provider.js +9 -9
  155. package/dist/services/mediaStorageProviders/file-s3-storage-provider.js.map +1 -1
  156. package/dist/services/model-metadata.service.d.ts +2 -2
  157. package/dist/services/model-metadata.service.d.ts.map +1 -1
  158. package/dist/services/model-metadata.service.js +3 -4
  159. package/dist/services/model-metadata.service.js.map +1 -1
  160. package/dist/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.d.ts +11 -0
  161. package/dist/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.d.ts.map +1 -0
  162. package/dist/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.js +59 -0
  163. package/dist/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.js.map +1 -0
  164. package/dist/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.d.ts +11 -0
  165. package/dist/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.d.ts.map +1 -0
  166. package/dist/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.js +60 -0
  167. package/dist/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.js.map +1 -0
  168. package/dist/services/solid-introspect.service.d.ts +1 -2
  169. package/dist/services/solid-introspect.service.d.ts.map +1 -1
  170. package/dist/services/solid-introspect.service.js +12 -24
  171. package/dist/services/solid-introspect.service.js.map +1 -1
  172. package/dist/solid-core.module.d.ts.map +1 -1
  173. package/dist/solid-core.module.js +43 -66
  174. package/dist/solid-core.module.js.map +1 -1
  175. package/dist/subscribers/model-metadata.subscriber.d.ts.map +1 -1
  176. package/dist/subscribers/model-metadata.subscriber.js +1 -3
  177. package/dist/subscribers/model-metadata.subscriber.js.map +1 -1
  178. package/package.json +1 -1
  179. package/src/commands/info.command.ts +0 -2
  180. package/src/controllers/{dashboard-variable.controller.ts → dashboard-user-layout.controller.ts} +10 -10
  181. package/src/controllers/dashboard.controller.ts +70 -89
  182. package/src/decorators/dashboard-widget-data-provider.decorator.ts +6 -0
  183. package/src/dtos/create-dashboard-user-layout.dto.ts +41 -0
  184. package/src/dtos/create-model-metadata.dto.ts +5 -9
  185. package/src/dtos/dashboard-variable-options-query.dto.ts +20 -0
  186. package/src/dtos/dashboard-widget-data-request.dto.ts +34 -0
  187. package/src/dtos/update-dashboard-user-layout.dto.ts +45 -0
  188. package/src/entities/dashboard-user-layout.entity.ts +27 -0
  189. package/src/entities/legacy-common-with-id.entity.ts +2 -2
  190. package/src/entities/legacy-common.entity.ts +1 -1
  191. package/src/entities/model-metadata.entity.ts +3 -5
  192. package/src/enums/legacy-table-type.enum.ts +5 -0
  193. package/src/helpers/model-metadata-helper.service.ts +4 -3
  194. package/src/helpers/module-metadata-helper.service.ts +21 -6
  195. package/src/helpers/solid-registry.ts +15 -36
  196. package/src/index.ts +22 -5
  197. package/src/interfaces.ts +32 -19
  198. package/src/jobs/database/trigger-mcp-client-subscriber-database.service.ts +1 -34
  199. package/src/repositories/dashboard-user-layout.repository.ts +19 -0
  200. package/src/seeders/module-metadata-seeder.service.ts +0 -67
  201. package/src/seeders/seed-data/solid-core-metadata.json +6210 -6691
  202. package/src/seeders/system-fields-seeder.service.ts +1 -1
  203. package/src/services/dashboard-providers/README.md +603 -0
  204. package/src/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.ts +49 -0
  205. package/src/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.ts +45 -0
  206. package/src/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.ts +45 -0
  207. package/src/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.ts +58 -0
  208. package/src/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.ts +79 -0
  209. package/src/services/dashboard-providers/mq-dashboard-provider-utils.ts +165 -0
  210. package/src/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.ts +155 -0
  211. package/src/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.ts +51 -0
  212. package/src/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.ts +51 -0
  213. package/src/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.ts +95 -0
  214. package/src/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.ts +49 -0
  215. package/src/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.ts +45 -0
  216. package/src/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.ts +55 -0
  217. package/src/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.ts +44 -0
  218. package/src/services/dashboard-runtime.service.ts +488 -0
  219. package/src/services/dashboard-user-layout.service.ts +20 -0
  220. package/src/services/mediaStorageProviders/file-s3-storage-provider.ts +11 -11
  221. package/src/services/model-metadata.service.ts +6 -8
  222. package/src/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.ts +52 -0
  223. package/src/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.ts +51 -0
  224. package/src/services/solid-introspect.service.ts +19 -34
  225. package/src/solid-core.module.ts +43 -72
  226. package/src/subscribers/model-metadata.subscriber.ts +1 -3
  227. package/CURRENT_PROMPT +0 -6
  228. package/dist/controllers/dashboard-layout.controller.d.ts +0 -47
  229. package/dist/controllers/dashboard-layout.controller.d.ts.map +0 -1
  230. package/dist/controllers/dashboard-layout.controller.js +0 -204
  231. package/dist/controllers/dashboard-layout.controller.js.map +0 -1
  232. package/dist/controllers/dashboard-question-sql-dataset-config.controller.d.ts +0 -43
  233. package/dist/controllers/dashboard-question-sql-dataset-config.controller.d.ts.map +0 -1
  234. package/dist/controllers/dashboard-question-sql-dataset-config.controller.js +0 -179
  235. package/dist/controllers/dashboard-question-sql-dataset-config.controller.js.map +0 -1
  236. package/dist/controllers/dashboard-question.controller.d.ts +0 -45
  237. package/dist/controllers/dashboard-question.controller.d.ts.map +0 -1
  238. package/dist/controllers/dashboard-question.controller.js +0 -194
  239. package/dist/controllers/dashboard-question.controller.js.map +0 -1
  240. package/dist/controllers/dashboard-variable.controller.d.ts +0 -43
  241. package/dist/controllers/dashboard-variable.controller.d.ts.map +0 -1
  242. package/dist/controllers/dashboard-variable.controller.js.map +0 -1
  243. package/dist/decorators/dashboard-question-data-provider.decorator.d.ts +0 -3
  244. package/dist/decorators/dashboard-question-data-provider.decorator.d.ts.map +0 -1
  245. package/dist/decorators/dashboard-question-data-provider.decorator.js +0 -11
  246. package/dist/decorators/dashboard-question-data-provider.decorator.js.map +0 -1
  247. package/dist/decorators/dashboard-selection-provider.decorator.d.ts +0 -3
  248. package/dist/decorators/dashboard-selection-provider.decorator.d.ts.map +0 -1
  249. package/dist/decorators/dashboard-selection-provider.decorator.js +0 -11
  250. package/dist/decorators/dashboard-selection-provider.decorator.js.map +0 -1
  251. package/dist/dtos/create-dashboard-layout.dto.d.ts +0 -8
  252. package/dist/dtos/create-dashboard-layout.dto.d.ts.map +0 -1
  253. package/dist/dtos/create-dashboard-layout.dto.js +0 -53
  254. package/dist/dtos/create-dashboard-layout.dto.js.map +0 -1
  255. package/dist/dtos/create-dashboard-question-sql-dataset-config.dto.d.ts +0 -12
  256. package/dist/dtos/create-dashboard-question-sql-dataset-config.dto.d.ts.map +0 -1
  257. package/dist/dtos/create-dashboard-question-sql-dataset-config.dto.js +0 -77
  258. package/dist/dtos/create-dashboard-question-sql-dataset-config.dto.js.map +0 -1
  259. package/dist/dtos/create-dashboard-question.dto.d.ts +0 -17
  260. package/dist/dtos/create-dashboard-question.dto.d.ts.map +0 -1
  261. package/dist/dtos/create-dashboard-question.dto.js +0 -105
  262. package/dist/dtos/create-dashboard-question.dto.js.map +0 -1
  263. package/dist/dtos/create-dashboard-variable.dto.d.ts +0 -19
  264. package/dist/dtos/create-dashboard-variable.dto.d.ts.map +0 -1
  265. package/dist/dtos/create-dashboard-variable.dto.js +0 -103
  266. package/dist/dtos/create-dashboard-variable.dto.js.map +0 -1
  267. package/dist/dtos/create-dashboard.dto.d.ts +0 -17
  268. package/dist/dtos/create-dashboard.dto.d.ts.map +0 -1
  269. package/dist/dtos/create-dashboard.dto.js +0 -102
  270. package/dist/dtos/create-dashboard.dto.js.map +0 -1
  271. package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.d.ts +0 -8
  272. package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.d.ts.map +0 -1
  273. package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.js +0 -52
  274. package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.js.map +0 -1
  275. package/dist/dtos/update-dashboard-layout.dto.d.ts +0 -8
  276. package/dist/dtos/update-dashboard-layout.dto.d.ts.map +0 -1
  277. package/dist/dtos/update-dashboard-layout.dto.js.map +0 -1
  278. package/dist/dtos/update-dashboard-question-sql-dataset-config.dto.d.ts +0 -13
  279. package/dist/dtos/update-dashboard-question-sql-dataset-config.dto.d.ts.map +0 -1
  280. package/dist/dtos/update-dashboard-question-sql-dataset-config.dto.js +0 -86
  281. package/dist/dtos/update-dashboard-question-sql-dataset-config.dto.js.map +0 -1
  282. package/dist/dtos/update-dashboard-question.dto.d.ts +0 -18
  283. package/dist/dtos/update-dashboard-question.dto.d.ts.map +0 -1
  284. package/dist/dtos/update-dashboard-question.dto.js +0 -112
  285. package/dist/dtos/update-dashboard-question.dto.js.map +0 -1
  286. package/dist/dtos/update-dashboard-variable.dto.d.ts +0 -16
  287. package/dist/dtos/update-dashboard-variable.dto.d.ts.map +0 -1
  288. package/dist/dtos/update-dashboard-variable.dto.js +0 -101
  289. package/dist/dtos/update-dashboard-variable.dto.js.map +0 -1
  290. package/dist/dtos/update-dashboard.dto.d.ts +0 -18
  291. package/dist/dtos/update-dashboard.dto.d.ts.map +0 -1
  292. package/dist/dtos/update-dashboard.dto.js +0 -108
  293. package/dist/dtos/update-dashboard.dto.js.map +0 -1
  294. package/dist/entities/dashboard-layout.entity.d.ts +0 -9
  295. package/dist/entities/dashboard-layout.entity.d.ts.map +0 -1
  296. package/dist/entities/dashboard-layout.entity.js +0 -41
  297. package/dist/entities/dashboard-layout.entity.js.map +0 -1
  298. package/dist/entities/dashboard-question-sql-dataset-config.entity.d.ts +0 -14
  299. package/dist/entities/dashboard-question-sql-dataset-config.entity.d.ts.map +0 -1
  300. package/dist/entities/dashboard-question-sql-dataset-config.entity.js +0 -66
  301. package/dist/entities/dashboard-question-sql-dataset-config.entity.js.map +0 -1
  302. package/dist/entities/dashboard-question.entity.d.ts +0 -17
  303. package/dist/entities/dashboard-question.entity.d.ts.map +0 -1
  304. package/dist/entities/dashboard-question.entity.js +0 -77
  305. package/dist/entities/dashboard-question.entity.js.map +0 -1
  306. package/dist/entities/dashboard-variable.entity.d.ts +0 -16
  307. package/dist/entities/dashboard-variable.entity.d.ts.map +0 -1
  308. package/dist/entities/dashboard-variable.entity.js +0 -79
  309. package/dist/entities/dashboard-variable.entity.js.map +0 -1
  310. package/dist/entities/dashboard.entity.d.ts +0 -16
  311. package/dist/entities/dashboard.entity.d.ts.map +0 -1
  312. package/dist/entities/dashboard.entity.js +0 -64
  313. package/dist/entities/dashboard.entity.js.map +0 -1
  314. package/dist/mappers/dashboard-mapper.d.ts +0 -6
  315. package/dist/mappers/dashboard-mapper.d.ts.map +0 -1
  316. package/dist/mappers/dashboard-mapper.js +0 -62
  317. package/dist/mappers/dashboard-mapper.js.map +0 -1
  318. package/dist/repository/dashboard-layout.repository.d.ts.map +0 -1
  319. package/dist/repository/dashboard-layout.repository.js +0 -34
  320. package/dist/repository/dashboard-layout.repository.js.map +0 -1
  321. package/dist/repository/dashboard-question-sql-dataset-config.repository.d.ts +0 -12
  322. package/dist/repository/dashboard-question-sql-dataset-config.repository.d.ts.map +0 -1
  323. package/dist/repository/dashboard-question-sql-dataset-config.repository.js.map +0 -1
  324. package/dist/repository/dashboard-question.repository.d.ts +0 -12
  325. package/dist/repository/dashboard-question.repository.d.ts.map +0 -1
  326. package/dist/repository/dashboard-question.repository.js +0 -34
  327. package/dist/repository/dashboard-question.repository.js.map +0 -1
  328. package/dist/repository/dashboard-variable.repository.d.ts +0 -12
  329. package/dist/repository/dashboard-variable.repository.d.ts.map +0 -1
  330. package/dist/repository/dashboard-variable.repository.js +0 -34
  331. package/dist/repository/dashboard-variable.repository.js.map +0 -1
  332. package/dist/repository/dashboard.repository.d.ts +0 -13
  333. package/dist/repository/dashboard.repository.d.ts.map +0 -1
  334. package/dist/repository/dashboard.repository.js +0 -104
  335. package/dist/repository/dashboard.repository.js.map +0 -1
  336. package/dist/services/dashboard-layout.service.d.ts +0 -20
  337. package/dist/services/dashboard-layout.service.d.ts.map +0 -1
  338. package/dist/services/dashboard-layout.service.js +0 -120
  339. package/dist/services/dashboard-layout.service.js.map +0 -1
  340. package/dist/services/dashboard-question-sql-dataset-config.service.d.ts +0 -12
  341. package/dist/services/dashboard-question-sql-dataset-config.service.d.ts.map +0 -1
  342. package/dist/services/dashboard-question-sql-dataset-config.service.js +0 -38
  343. package/dist/services/dashboard-question-sql-dataset-config.service.js.map +0 -1
  344. package/dist/services/dashboard-question.service.d.ts +0 -23
  345. package/dist/services/dashboard-question.service.d.ts.map +0 -1
  346. package/dist/services/dashboard-question.service.js +0 -135
  347. package/dist/services/dashboard-question.service.js.map +0 -1
  348. package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.d.ts +0 -12
  349. package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.d.ts.map +0 -1
  350. package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.js +0 -55
  351. package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.js.map +0 -1
  352. package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.d.ts +0 -11
  353. package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.d.ts.map +0 -1
  354. package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.js +0 -45
  355. package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.js.map +0 -1
  356. package/dist/services/dashboard-variable.service.d.ts +0 -13
  357. package/dist/services/dashboard-variable.service.d.ts.map +0 -1
  358. package/dist/services/dashboard-variable.service.js.map +0 -1
  359. package/dist/services/dashboard.service.d.ts +0 -29
  360. package/dist/services/dashboard.service.d.ts.map +0 -1
  361. package/dist/services/dashboard.service.js +0 -171
  362. package/dist/services/dashboard.service.js.map +0 -1
  363. package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.d.ts +0 -12
  364. package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.d.ts.map +0 -1
  365. package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.js +0 -41
  366. package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.js.map +0 -1
  367. package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.d.ts +0 -12
  368. package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.d.ts.map +0 -1
  369. package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.js +0 -42
  370. package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.js.map +0 -1
  371. package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.d.ts +0 -25
  372. package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.d.ts.map +0 -1
  373. package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.js +0 -116
  374. package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.js.map +0 -1
  375. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.d.ts +0 -12
  376. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.d.ts.map +0 -1
  377. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.js +0 -37
  378. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.js.map +0 -1
  379. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.d.ts +0 -12
  380. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.d.ts.map +0 -1
  381. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.js +0 -38
  382. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.js.map +0 -1
  383. package/dist/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.d.ts +0 -12
  384. package/dist/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.d.ts.map +0 -1
  385. package/dist/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.js +0 -38
  386. package/dist/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.js.map +0 -1
  387. package/dist/services/question-data-providers/chartjs-sql-data-provider.service.d.ts +0 -34
  388. package/dist/services/question-data-providers/chartjs-sql-data-provider.service.d.ts.map +0 -1
  389. package/dist/services/question-data-providers/chartjs-sql-data-provider.service.js +0 -90
  390. package/dist/services/question-data-providers/chartjs-sql-data-provider.service.js.map +0 -1
  391. package/dist/services/question-data-providers/helpers.d.ts +0 -7
  392. package/dist/services/question-data-providers/helpers.d.ts.map +0 -1
  393. package/dist/services/question-data-providers/helpers.js +0 -25
  394. package/dist/services/question-data-providers/helpers.js.map +0 -1
  395. package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.d.ts +0 -14
  396. package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.d.ts.map +0 -1
  397. package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.js +0 -71
  398. package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.js.map +0 -1
  399. package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.d.ts +0 -16
  400. package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.d.ts.map +0 -1
  401. package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.js +0 -93
  402. package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.js.map +0 -1
  403. package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.d.ts +0 -11
  404. package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.d.ts.map +0 -1
  405. package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.js +0 -49
  406. package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.js.map +0 -1
  407. package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.d.ts +0 -11
  408. package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.d.ts.map +0 -1
  409. package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.js +0 -47
  410. package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.js.map +0 -1
  411. package/dist/services/sql-expression-resolver.service.d.ts +0 -12
  412. package/dist/services/sql-expression-resolver.service.d.ts.map +0 -1
  413. package/dist/services/sql-expression-resolver.service.js +0 -121
  414. package/dist/services/sql-expression-resolver.service.js.map +0 -1
  415. package/dist/subscribers/dashboard-question-sql-dataset-config.subscriber.d.ts +0 -16
  416. package/dist/subscribers/dashboard-question-sql-dataset-config.subscriber.d.ts.map +0 -1
  417. package/dist/subscribers/dashboard-question-sql-dataset-config.subscriber.js +0 -72
  418. package/dist/subscribers/dashboard-question-sql-dataset-config.subscriber.js.map +0 -1
  419. package/dist/subscribers/dashboard-question.subscriber.d.ts +0 -16
  420. package/dist/subscribers/dashboard-question.subscriber.d.ts.map +0 -1
  421. package/dist/subscribers/dashboard-question.subscriber.js +0 -72
  422. package/dist/subscribers/dashboard-question.subscriber.js.map +0 -1
  423. package/dist/subscribers/dashboard-variable.subscriber.d.ts +0 -16
  424. package/dist/subscribers/dashboard-variable.subscriber.d.ts.map +0 -1
  425. package/dist/subscribers/dashboard-variable.subscriber.js +0 -72
  426. package/dist/subscribers/dashboard-variable.subscriber.js.map +0 -1
  427. package/dist/subscribers/dashboard.subscriber.d.ts +0 -16
  428. package/dist/subscribers/dashboard.subscriber.d.ts.map +0 -1
  429. package/dist/subscribers/dashboard.subscriber.js +0 -71
  430. package/dist/subscribers/dashboard.subscriber.js.map +0 -1
  431. package/src/controllers/dashboard-layout.controller.ts +0 -106
  432. package/src/controllers/dashboard-question-sql-dataset-config.controller.ts +0 -93
  433. package/src/controllers/dashboard-question.controller.ts +0 -104
  434. package/src/decorators/dashboard-question-data-provider.decorator.ts +0 -7
  435. package/src/decorators/dashboard-selection-provider.decorator.ts +0 -7
  436. package/src/dtos/create-dashboard-layout.dto.ts +0 -31
  437. package/src/dtos/create-dashboard-question-sql-dataset-config.dto.ts +0 -42
  438. package/src/dtos/create-dashboard-question.dto.ts +0 -62
  439. package/src/dtos/create-dashboard-variable.dto.ts +0 -60
  440. package/src/dtos/create-dashboard.dto.ts +0 -61
  441. package/src/dtos/dashboard-variable-selection-dynamic-query.dto.ts +0 -29
  442. package/src/dtos/update-dashboard-layout.dto.ts +0 -30
  443. package/src/dtos/update-dashboard-question-sql-dataset-config.dto.ts +0 -49
  444. package/src/dtos/update-dashboard-question.dto.ts +0 -67
  445. package/src/dtos/update-dashboard-variable.dto.ts +0 -58
  446. package/src/dtos/update-dashboard.dto.ts +0 -65
  447. package/src/entities/dashboard-layout.entity.ts +0 -18
  448. package/src/entities/dashboard-question-sql-dataset-config.entity.ts +0 -37
  449. package/src/entities/dashboard-question.entity.ts +0 -46
  450. package/src/entities/dashboard-variable.entity.ts +0 -44
  451. package/src/entities/dashboard.entity.ts +0 -36
  452. package/src/mappers/dashboard-mapper.ts +0 -53
  453. package/src/repository/dashboard-layout.repository.ts +0 -17
  454. package/src/repository/dashboard-question-sql-dataset-config.repository.ts +0 -17
  455. package/src/repository/dashboard-question.repository.ts +0 -17
  456. package/src/repository/dashboard-variable.repository.ts +0 -17
  457. package/src/repository/dashboard.repository.ts +0 -101
  458. package/src/services/dashboard-layout.service.ts +0 -111
  459. package/src/services/dashboard-question-sql-dataset-config.service.ts +0 -25
  460. package/src/services/dashboard-question.service.ts +0 -150
  461. package/src/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.ts +0 -56
  462. package/src/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.ts +0 -37
  463. package/src/services/dashboard-variable.service.ts +0 -27
  464. package/src/services/dashboard.service.ts +0 -148
  465. package/src/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.ts +0 -43
  466. package/src/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.ts +0 -44
  467. package/src/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.ts +0 -114
  468. package/src/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.ts +0 -38
  469. package/src/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.ts +0 -40
  470. package/src/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.ts +0 -39
  471. package/src/services/question-data-providers/chartjs-sql-data-provider.service.ts +0 -121
  472. package/src/services/question-data-providers/helpers.ts +0 -30
  473. package/src/services/question-data-providers/prime-react-datatable-sql-data-provider.service.ts +0 -74
  474. package/src/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.ts +0 -115
  475. package/src/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.ts +0 -44
  476. package/src/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.ts +0 -41
  477. package/src/services/sql-expression-resolver.service.ts +0 -140
  478. package/src/subscribers/dashboard-question-sql-dataset-config.subscriber.ts +0 -61
  479. package/src/subscribers/dashboard-question.subscriber.ts +0 -62
  480. package/src/subscribers/dashboard-variable.subscriber.ts +0 -63
  481. package/src/subscribers/dashboard.subscriber.ts +0 -62
@@ -1,74 +0,0 @@
1
- import { Injectable } from "@nestjs/common";
2
- import { DashboardQuestionDataProvider } from "src/decorators/dashboard-question-data-provider.decorator";
3
- import { DashboardQuestion } from "src/entities/dashboard-question.entity";
4
- import { IDashboardQuestionDataProvider, QuestionSqlDataProviderContext } from "src/interfaces";
5
- import { EntityManager } from "typeorm";
6
- import { SqlExpressionResolverService } from "../sql-expression-resolver.service";
7
- import { Logger } from '@nestjs/common';
8
- import { SqlExpression } from "./chartjs-sql-data-provider.service";
9
- import { getKpi } from "./helpers";
10
-
11
- @DashboardQuestionDataProvider()
12
- @Injectable()
13
- export class PrimeReactDatatableSqlDataProvider implements IDashboardQuestionDataProvider<QuestionSqlDataProviderContext, any> {
14
- private readonly logger = new Logger(PrimeReactDatatableSqlDataProvider.name);
15
-
16
- constructor(private readonly entityManager: EntityManager, private readonly sqlExpressionResolver: SqlExpressionResolverService) { }
17
-
18
- help(): string {
19
- return "Provides data for dashboard questions using a SQL dataset configuration. Configure your SQL dataset in the admin panel, then reference it in your dashboard question to fetch data.";
20
- }
21
-
22
- name(): string {
23
- return "PrimeReactDatatableSqlDataProvider";
24
- }
25
-
26
- async getData(question: DashboardQuestion, context?: QuestionSqlDataProviderContext): Promise<any> {
27
- const expressions: SqlExpression[] = context?.expressions || [];
28
-
29
- // TODO: put some validation to check if the results of each SQL in each dataset returns the same number of rows
30
-
31
- // Check the expected response for prime react data tables to understand what is going on here...
32
-
33
- const kpi: string = await getKpi(question, expressions, this.entityManager, this.sqlExpressionResolver);
34
- // TODO: Load the set of labels by using a separate field on the question entity.
35
- const labelSql = question.labelSql;
36
- const labelResults = await this.entityManager.query(labelSql);
37
- const columns = [];
38
- for (let i = 0; i < labelResults.length; i++) {
39
- const labelResult = labelResults[i];
40
- columns.push({
41
- field: labelResult['field'],
42
- header: labelResult['header'],
43
- });
44
- }
45
-
46
- // Load the chart options as a JSON
47
- // const chartOptions = JSON.parse(question.barChartLabelOptions || '{}');
48
-
49
- const values = []
50
-
51
- // For meter group we can assume that we only have one sql dataset config.
52
- const questionSqlDatasetConfig = question.questionSqlDatasetConfigs[0];
53
-
54
- const sql = questionSqlDatasetConfig.sql;
55
- if (!sql) {
56
- throw new Error(`SQL dataset ${questionSqlDatasetConfig.datasetName} configuration does not contain a valid SQL query.`);
57
- }
58
-
59
- const sqlReplacementResult = this.sqlExpressionResolver.resolveSqlWithExpressions(sql, expressions || []);
60
- this.logger.debug(`Final Sql query for dataset [${questionSqlDatasetConfig.datasetName}] is query=[${sqlReplacementResult.rawSql}]`);
61
- this.logger.debug(`Final Sql query for dataset [${questionSqlDatasetConfig.datasetName}] is parameters=[${JSON.stringify(sqlReplacementResult.parameters)}]`);
62
- const results = await this.entityManager.query(sqlReplacementResult.rawSql, sqlReplacementResult.parameters);
63
-
64
- return {
65
- kpi,
66
- visualisedAs: question.visualisedAs,
67
- visualizationData: {
68
- columns,
69
- rows: results,
70
- }
71
- };
72
-
73
- }
74
- }
@@ -1,115 +0,0 @@
1
- import { Injectable } from "@nestjs/common";
2
- import { DashboardQuestionDataProvider } from "src/decorators/dashboard-question-data-provider.decorator";
3
- import { DashboardQuestion } from "src/entities/dashboard-question.entity";
4
- import { IDashboardQuestionDataProvider, QuestionSqlDataProviderContext } from "src/interfaces";
5
- import { EntityManager } from "typeorm";
6
- import { SqlExpressionResolverService } from "../sql-expression-resolver.service";
7
- import { Logger } from '@nestjs/common';
8
- import { SqlExpression } from "./chartjs-sql-data-provider.service";
9
- import { getKpi } from "./helpers";
10
-
11
- @DashboardQuestionDataProvider()
12
- @Injectable()
13
- export class PrimeReactMeterGroupSqlDataProvider implements IDashboardQuestionDataProvider<QuestionSqlDataProviderContext, any> {
14
- private readonly logger = new Logger(PrimeReactMeterGroupSqlDataProvider.name);
15
-
16
- constructor(private readonly entityManager: EntityManager, private readonly sqlExpressionResolver: SqlExpressionResolverService) { }
17
-
18
- help(): string {
19
- return "Provides data for dashboard questions using a SQL dataset configuration. Configure your SQL dataset in the admin panel, then reference it in your dashboard question to fetch data.";
20
- }
21
-
22
- name(): string {
23
- return "PrimeReactMeterGroupSqlDataProvider";
24
- }
25
-
26
- hslToHex(h: number, s: number, l: number): string {
27
- l /= 100;
28
- s /= 100;
29
-
30
- const k = (n: number) => (n + h / 30) % 12;
31
- const a = s * Math.min(l, 1 - l);
32
- const f = (n: number) =>
33
- Math.round(255 * (l - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)))));
34
-
35
- return `#${f(0).toString(16).padStart(2, '0')}${f(8).toString(16).padStart(2, '0')}${f(4)
36
- .toString(16)
37
- .padStart(2, '0')}`;
38
- }
39
-
40
- generateDistinctColors(count: number): string[] {
41
- const colors: string[] = [];
42
-
43
- const hueStep = 360 / count;
44
- const saturation = 65; // keep it vibrant
45
- const lightness = 55; // balanced for both light/dark themes
46
-
47
- for (let i = 0; i < count; i++) {
48
- const hue = Math.round(i * hueStep);
49
- colors.push(this.hslToHex(hue, saturation, lightness));
50
- }
51
-
52
- return colors;
53
- }
54
-
55
- async getData(question: DashboardQuestion, context?: QuestionSqlDataProviderContext): Promise<any> {
56
- const expressions: SqlExpression[] = context?.expressions || [];
57
-
58
- // TODO: put some validation to check if the results of each SQL in each dataset returns the same number of rows
59
-
60
- // This is what we have to return.
61
- // const values = [
62
- // { label: 'Apps', color: '#34d399', value: 16 },
63
- // { label: 'Messages', color: '#fbbf24', value: 8 },
64
- // { label: 'Media', color: '#60a5fa', value: 24 },
65
- // { label: 'System', color: '#c084fc', value: 10 }
66
- // ];
67
-
68
- // TODO: Load the set of labels by using a separate field on the question entity.
69
-
70
- const kpi: string = await getKpi(question, expressions, this.entityManager, this.sqlExpressionResolver);
71
-
72
- // Load the chart options as a JSON
73
- const chartOptions = JSON.parse(question.chartOptions || '{}');
74
-
75
- const values = []
76
-
77
- // For meter group we can assume that we only have one sql dataset config.
78
- const questionSqlDatasetConfig = question.questionSqlDatasetConfigs[0];
79
-
80
- const sql = questionSqlDatasetConfig.sql;
81
- if (!sql) {
82
- throw new Error(`SQL dataset ${questionSqlDatasetConfig.datasetName} configuration does not contain a valid SQL query.`);
83
- }
84
-
85
- const sqlReplacementResult = this.sqlExpressionResolver.resolveSqlWithExpressions(sql, expressions || []);
86
- this.logger.debug(`Final Sql query for dataset [${questionSqlDatasetConfig.datasetName}] is query=[${sqlReplacementResult.rawSql}]`);
87
- this.logger.debug(`Final Sql query for dataset [${questionSqlDatasetConfig.datasetName}] is parameters=[${JSON.stringify(sqlReplacementResult.parameters)}]`);
88
- const results = await this.entityManager.query(sqlReplacementResult.rawSql, sqlReplacementResult.parameters);
89
-
90
- const colors = this.generateDistinctColors(results.length);
91
-
92
- // Also for each data set we create the dataset object as is expected by ChartJs.
93
- for (let i = 0; i < results.length; i++) {
94
- const result = results[i];
95
-
96
- const colorFromChartOptions = chartOptions?.colors?.[result[questionSqlDatasetConfig.labelColumnName]];
97
- const color = typeof colorFromChartOptions === 'string' ? colorFromChartOptions : colors[i];
98
-
99
- values.push({
100
- label: result[questionSqlDatasetConfig.labelColumnName],
101
- color: color,
102
- value: result[questionSqlDatasetConfig.valueColumnName]
103
- })
104
- }
105
-
106
- return {
107
- kpi,
108
- visualizedAs: question.visualisedAs,
109
- visualizationData: {
110
- dataset: values
111
- },
112
- };
113
-
114
- }
115
- }
@@ -1,44 +0,0 @@
1
- import { Injectable } from "@nestjs/common";
2
- import { SelectionProvider } from "src/decorators/selection-provider.decorator";
3
- import { SolidRegistry } from "src/helpers/solid-registry";
4
- import { IDashboardQuestionDataProvider, IDashboardVariableSelectionProvider, ISelectionProvider, ISelectionProviderContext, ISelectionProviderValues } from "../../interfaces";
5
- import { SQL_DYNAMIC_PROVIDER_NAME } from "../dashboard.service";
6
- import { CHARTJS_SQL_DATA_PROVIDER_NAME, INBUILT_SQL_DATA_PROVIDERS, PRIME_REACT_DATATABLE_SQL_DATA_PROVIDER_NAME, PRIME_REACT_METER_GROUP_SQL_DATA_PROVIDER_NAME } from "../dashboard-question.service";
7
-
8
-
9
- @SelectionProvider()
10
- @Injectable()
11
- export class ListOfDashboardQuestionProvidersSelectionProvider implements ISelectionProvider<ISelectionProviderContext> {
12
-
13
- constructor(
14
- private readonly solidRegistry: SolidRegistry,
15
- ) {
16
- }
17
-
18
- help(): string {
19
- return "# Allows one to dynamically fetch all the dashboard providers that are registered in the system. ";
20
- }
21
-
22
- name(): string {
23
- return 'ListOfDashboardQuestionProvidersSelectionProvider';
24
- }
25
-
26
- async value(optionValue: string, ctxt: ISelectionProviderContext): Promise<ISelectionProviderValues | any> {
27
- const dashboardSelectionProvider: IDashboardQuestionDataProvider<any, any> | undefined = this.solidRegistry.getDashboardQuestionDataProviderInstance(optionValue);
28
- if (!dashboardSelectionProvider) {
29
- return null;
30
- }
31
-
32
- return { label: dashboardSelectionProvider.name(), value: dashboardSelectionProvider.name() };
33
- }
34
-
35
- async values(query: string, ctxt: ISelectionProviderContext): Promise<readonly ISelectionProviderValues[]> {
36
- const dashboardSelectionProviders = this.solidRegistry.getDashboardQuestionDataProviders()
37
- //Exclude the SQL dynamic provider from the list, (since although it is a dashboard selection provider, it is not a valid option for the user to select)
38
- return dashboardSelectionProviders
39
- .filter(provider => !INBUILT_SQL_DATA_PROVIDERS.includes(provider.name()))
40
- .map(i => {
41
- return { label: i.name, value: i.name };
42
- });
43
- }
44
- }
@@ -1,41 +0,0 @@
1
- import { Injectable } from "@nestjs/common";
2
- import { SelectionProvider } from "src/decorators/selection-provider.decorator";
3
- import { SolidRegistry } from "src/helpers/solid-registry";
4
- import { IDashboardVariableSelectionProvider, ISelectionProvider, ISelectionProviderContext, ISelectionProviderValues } from "../../interfaces";
5
- import { SQL_DYNAMIC_PROVIDER_NAME } from "../dashboard.service";
6
-
7
-
8
- @SelectionProvider()
9
- @Injectable()
10
- export class ListOfDashboardVariableProvidersSelectionProvider implements ISelectionProvider<ISelectionProviderContext> {
11
-
12
- constructor(
13
- private readonly solidRegistry: SolidRegistry,
14
- ) {
15
- }
16
-
17
- help(): string {
18
- return "# Allows one to dynamically fetch all the dashboard providers that are registered in the system. ";
19
- }
20
-
21
- name(): string {
22
- return 'ListOfDashboardVariableProvidersSelectionProvider';
23
- }
24
-
25
- async value(optionValue: string, ctxt: ISelectionProviderContext): Promise<ISelectionProviderValues | any> {
26
- const dashboardSelectionProvider: IDashboardVariableSelectionProvider<ISelectionProviderContext> | undefined = this.solidRegistry.getDashboardVariableSelectionProviderInstance(optionValue);
27
- if (!dashboardSelectionProvider) {
28
- return null;
29
- }
30
-
31
- return { label: dashboardSelectionProvider.name(), value: dashboardSelectionProvider.name() };
32
- }
33
-
34
- async values(query: string, ctxt: ISelectionProviderContext): Promise<readonly ISelectionProviderValues[]> {
35
- const dashboardSelectionProviders = this.solidRegistry.getDashboardVariableSelectionProviders()
36
- //Exclude the SQL dynamic provider from the list, (since although it is a dashboard selection provider, it is not a valid option for the user to select)
37
- return dashboardSelectionProviders.filter(i => (i.name !== SQL_DYNAMIC_PROVIDER_NAME)).map(i => {
38
- return { label: i.name, value: i.name };
39
- });
40
- }
41
- }
@@ -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
- }