@solidstarters/solid-core 1.2.133 → 1.2.135

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 (278) hide show
  1. package/dist/controllers/ai-interaction.controller.d.ts +45 -0
  2. package/dist/controllers/ai-interaction.controller.d.ts.map +1 -0
  3. package/dist/controllers/ai-interaction.controller.js +192 -0
  4. package/dist/controllers/ai-interaction.controller.js.map +1 -0
  5. package/dist/controllers/dashboard-variable.controller.d.ts +43 -0
  6. package/dist/controllers/dashboard-variable.controller.d.ts.map +1 -0
  7. package/dist/controllers/dashboard-variable.controller.js +179 -0
  8. package/dist/controllers/dashboard-variable.controller.js.map +1 -0
  9. package/dist/controllers/dashboard.controller.d.ts +45 -0
  10. package/dist/controllers/dashboard.controller.d.ts.map +1 -0
  11. package/dist/controllers/dashboard.controller.js +192 -0
  12. package/dist/controllers/dashboard.controller.js.map +1 -0
  13. package/dist/controllers/question-sql-dataset-config.controller.d.ts +43 -0
  14. package/dist/controllers/question-sql-dataset-config.controller.d.ts.map +1 -0
  15. package/dist/controllers/question-sql-dataset-config.controller.js +179 -0
  16. package/dist/controllers/question-sql-dataset-config.controller.js.map +1 -0
  17. package/dist/controllers/question.controller.d.ts +45 -0
  18. package/dist/controllers/question.controller.d.ts.map +1 -0
  19. package/dist/controllers/question.controller.js +194 -0
  20. package/dist/controllers/question.controller.js.map +1 -0
  21. package/dist/controllers/test.controller.d.ts.map +1 -1
  22. package/dist/controllers/test.controller.js.map +1 -1
  23. package/dist/decorators/dashboard-question-data-provider.decorator.d.ts +3 -0
  24. package/dist/decorators/dashboard-question-data-provider.decorator.d.ts.map +1 -0
  25. package/dist/decorators/dashboard-question-data-provider.decorator.js +11 -0
  26. package/dist/decorators/dashboard-question-data-provider.decorator.js.map +1 -0
  27. package/dist/decorators/dashboard-selection-provider.decorator.d.ts +3 -0
  28. package/dist/decorators/dashboard-selection-provider.decorator.d.ts.map +1 -0
  29. package/dist/decorators/dashboard-selection-provider.decorator.js +11 -0
  30. package/dist/decorators/dashboard-selection-provider.decorator.js.map +1 -0
  31. package/dist/dtos/create-ai-interaction.dto.d.ts +14 -0
  32. package/dist/dtos/create-ai-interaction.dto.d.ts.map +1 -0
  33. package/dist/dtos/create-ai-interaction.dto.js +90 -0
  34. package/dist/dtos/create-ai-interaction.dto.js.map +1 -0
  35. package/dist/dtos/create-dashboard-variable.dto.d.ts +18 -0
  36. package/dist/dtos/create-dashboard-variable.dto.d.ts.map +1 -0
  37. package/dist/dtos/create-dashboard-variable.dto.js +97 -0
  38. package/dist/dtos/create-dashboard-variable.dto.js.map +1 -0
  39. package/dist/dtos/create-dashboard.dto.d.ts +15 -0
  40. package/dist/dtos/create-dashboard.dto.d.ts.map +1 -0
  41. package/dist/dtos/create-dashboard.dto.js +90 -0
  42. package/dist/dtos/create-dashboard.dto.js.map +1 -0
  43. package/dist/dtos/create-question-sql-dataset-config.dto.d.ts +12 -0
  44. package/dist/dtos/create-question-sql-dataset-config.dto.d.ts.map +1 -0
  45. package/dist/dtos/create-question-sql-dataset-config.dto.js +77 -0
  46. package/dist/dtos/create-question-sql-dataset-config.dto.js.map +1 -0
  47. package/dist/dtos/create-question.dto.d.ts +16 -0
  48. package/dist/dtos/create-question.dto.d.ts.map +1 -0
  49. package/dist/dtos/create-question.dto.js +99 -0
  50. package/dist/dtos/create-question.dto.js.map +1 -0
  51. package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.d.ts +8 -0
  52. package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.d.ts.map +1 -0
  53. package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.js +52 -0
  54. package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.js.map +1 -0
  55. package/dist/dtos/invoke-ai-prompt.dto.d.ts +4 -0
  56. package/dist/dtos/invoke-ai-prompt.dto.d.ts.map +1 -0
  57. package/dist/dtos/invoke-ai-prompt.dto.js +25 -0
  58. package/dist/dtos/invoke-ai-prompt.dto.js.map +1 -0
  59. package/dist/dtos/update-ai-interaction.dto.d.ts +15 -0
  60. package/dist/dtos/update-ai-interaction.dto.d.ts.map +1 -0
  61. package/dist/dtos/update-ai-interaction.dto.js +96 -0
  62. package/dist/dtos/update-ai-interaction.dto.js.map +1 -0
  63. package/dist/dtos/update-dashboard-variable.dto.d.ts +15 -0
  64. package/dist/dtos/update-dashboard-variable.dto.d.ts.map +1 -0
  65. package/dist/dtos/update-dashboard-variable.dto.js +95 -0
  66. package/dist/dtos/update-dashboard-variable.dto.js.map +1 -0
  67. package/dist/dtos/update-dashboard.dto.d.ts +16 -0
  68. package/dist/dtos/update-dashboard.dto.d.ts.map +1 -0
  69. package/dist/dtos/update-dashboard.dto.js +96 -0
  70. package/dist/dtos/update-dashboard.dto.js.map +1 -0
  71. package/dist/dtos/update-question-sql-dataset-config.dto.d.ts +13 -0
  72. package/dist/dtos/update-question-sql-dataset-config.dto.d.ts.map +1 -0
  73. package/dist/dtos/update-question-sql-dataset-config.dto.js +86 -0
  74. package/dist/dtos/update-question-sql-dataset-config.dto.js.map +1 -0
  75. package/dist/dtos/update-question.dto.d.ts +17 -0
  76. package/dist/dtos/update-question.dto.d.ts.map +1 -0
  77. package/dist/dtos/update-question.dto.js +106 -0
  78. package/dist/dtos/update-question.dto.js.map +1 -0
  79. package/dist/entities/ai-interaction.entity.d.ts +15 -0
  80. package/dist/entities/ai-interaction.entity.d.ts.map +1 -0
  81. package/dist/entities/ai-interaction.entity.js +70 -0
  82. package/dist/entities/ai-interaction.entity.js.map +1 -0
  83. package/dist/entities/dashboard-variable.entity.d.ts +15 -0
  84. package/dist/entities/dashboard-variable.entity.d.ts.map +1 -0
  85. package/dist/entities/dashboard-variable.entity.js +73 -0
  86. package/dist/entities/dashboard-variable.entity.js.map +1 -0
  87. package/dist/entities/dashboard.entity.d.ts +12 -0
  88. package/dist/entities/dashboard.entity.d.ts.map +1 -0
  89. package/dist/entities/dashboard.entity.js +50 -0
  90. package/dist/entities/dashboard.entity.js.map +1 -0
  91. package/dist/entities/question-sql-dataset-config.entity.d.ts +13 -0
  92. package/dist/entities/question-sql-dataset-config.entity.d.ts.map +1 -0
  93. package/dist/entities/question-sql-dataset-config.entity.js +60 -0
  94. package/dist/entities/question-sql-dataset-config.entity.js.map +1 -0
  95. package/dist/entities/question.entity.d.ts +15 -0
  96. package/dist/entities/question.entity.d.ts.map +1 -0
  97. package/dist/entities/question.entity.js +67 -0
  98. package/dist/entities/question.entity.js.map +1 -0
  99. package/dist/helpers/field-crud-managers/SelectionDynamicFieldCrudManager.d.ts +1 -0
  100. package/dist/helpers/field-crud-managers/SelectionDynamicFieldCrudManager.d.ts.map +1 -1
  101. package/dist/helpers/field-crud-managers/SelectionDynamicFieldCrudManager.js +32 -7
  102. package/dist/helpers/field-crud-managers/SelectionDynamicFieldCrudManager.js.map +1 -1
  103. package/dist/helpers/field-crud-managers/SelectionStaticFieldCrudManager.d.ts +1 -0
  104. package/dist/helpers/field-crud-managers/SelectionStaticFieldCrudManager.d.ts.map +1 -1
  105. package/dist/helpers/field-crud-managers/SelectionStaticFieldCrudManager.js +32 -7
  106. package/dist/helpers/field-crud-managers/SelectionStaticFieldCrudManager.js.map +1 -1
  107. package/dist/helpers/solid-registry.d.ts +9 -1
  108. package/dist/helpers/solid-registry.d.ts.map +1 -1
  109. package/dist/helpers/solid-registry.js +32 -0
  110. package/dist/helpers/solid-registry.js.map +1 -1
  111. package/dist/index.d.ts +5 -0
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +5 -0
  114. package/dist/index.js.map +1 -1
  115. package/dist/interfaces.d.ts +12 -1
  116. package/dist/interfaces.d.ts.map +1 -1
  117. package/dist/interfaces.js.map +1 -1
  118. package/dist/mappers/dashboard-mapper.d.ts +6 -0
  119. package/dist/mappers/dashboard-mapper.d.ts.map +1 -0
  120. package/dist/mappers/dashboard-mapper.js +60 -0
  121. package/dist/mappers/dashboard-mapper.js.map +1 -0
  122. package/dist/repository/dashboard.repository.d.ts +11 -0
  123. package/dist/repository/dashboard.repository.d.ts.map +1 -0
  124. package/dist/repository/dashboard.repository.js +93 -0
  125. package/dist/repository/dashboard.repository.js.map +1 -0
  126. package/dist/seeders/module-metadata-seeder.service.d.ts +5 -1
  127. package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
  128. package/dist/seeders/module-metadata-seeder.service.js +18 -2
  129. package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
  130. package/dist/seeders/seed-data/solid-core-metadata.json +4222 -2418
  131. package/dist/services/ai-interaction.service.d.ts +23 -0
  132. package/dist/services/ai-interaction.service.d.ts.map +1 -0
  133. package/dist/services/ai-interaction.service.js +147 -0
  134. package/dist/services/ai-interaction.service.js.map +1 -0
  135. package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.d.ts +12 -0
  136. package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.d.ts.map +1 -0
  137. package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.js +55 -0
  138. package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.js.map +1 -0
  139. package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.d.ts +11 -0
  140. package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.d.ts.map +1 -0
  141. package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.js +45 -0
  142. package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.js.map +1 -0
  143. package/dist/services/dashboard-variable.service.d.ts +23 -0
  144. package/dist/services/dashboard-variable.service.d.ts.map +1 -0
  145. package/dist/services/dashboard-variable.service.js +57 -0
  146. package/dist/services/dashboard-variable.service.js.map +1 -0
  147. package/dist/services/dashboard.service.d.ts +38 -0
  148. package/dist/services/dashboard.service.d.ts.map +1 -0
  149. package/dist/services/dashboard.service.js +179 -0
  150. package/dist/services/dashboard.service.js.map +1 -0
  151. package/dist/services/import-transaction.service.d.ts.map +1 -1
  152. package/dist/services/import-transaction.service.js +2 -1
  153. package/dist/services/import-transaction.service.js.map +1 -1
  154. package/dist/services/menu-item-metadata.service.d.ts.map +1 -1
  155. package/dist/services/menu-item-metadata.service.js +1 -1
  156. package/dist/services/menu-item-metadata.service.js.map +1 -1
  157. package/dist/services/question-data-providers/chartjs-sql-data-provider.service.d.ts +36 -0
  158. package/dist/services/question-data-providers/chartjs-sql-data-provider.service.d.ts.map +1 -0
  159. package/dist/services/question-data-providers/chartjs-sql-data-provider.service.js +85 -0
  160. package/dist/services/question-data-providers/chartjs-sql-data-provider.service.js.map +1 -0
  161. package/dist/services/question-data-providers/helpers.d.ts +4 -0
  162. package/dist/services/question-data-providers/helpers.d.ts.map +1 -0
  163. package/dist/services/question-data-providers/helpers.js +10 -0
  164. package/dist/services/question-data-providers/helpers.js.map +1 -0
  165. package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.d.ts +17 -0
  166. package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.d.ts.map +1 -0
  167. package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.js +64 -0
  168. package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.js.map +1 -0
  169. package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.d.ts +19 -0
  170. package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.d.ts.map +1 -0
  171. package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.js +84 -0
  172. package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.js.map +1 -0
  173. package/dist/services/question-sql-dataset-config.service.d.ts +22 -0
  174. package/dist/services/question-sql-dataset-config.service.d.ts.map +1 -0
  175. package/dist/services/question-sql-dataset-config.service.js +56 -0
  176. package/dist/services/question-sql-dataset-config.service.js.map +1 -0
  177. package/dist/services/question.service.d.ts +29 -0
  178. package/dist/services/question.service.d.ts.map +1 -0
  179. package/dist/services/question.service.js +117 -0
  180. package/dist/services/question.service.js.map +1 -0
  181. package/dist/services/scheduled-jobs/scheduler.service.d.ts.map +1 -1
  182. package/dist/services/scheduled-jobs/scheduler.service.js +22 -11
  183. package/dist/services/scheduled-jobs/scheduler.service.js.map +1 -1
  184. package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.d.ts +11 -0
  185. package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.d.ts.map +1 -0
  186. package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.js +46 -0
  187. package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.js.map +1 -0
  188. package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.d.ts +11 -0
  189. package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.d.ts.map +1 -0
  190. package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.js +47 -0
  191. package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.js.map +1 -0
  192. package/dist/services/solid-introspect.service.d.ts +2 -0
  193. package/dist/services/solid-introspect.service.d.ts.map +1 -1
  194. package/dist/services/solid-introspect.service.js +28 -0
  195. package/dist/services/solid-introspect.service.js.map +1 -1
  196. package/dist/services/sql-expression-resolver.service.d.ts +9 -0
  197. package/dist/services/sql-expression-resolver.service.d.ts.map +1 -0
  198. package/dist/services/sql-expression-resolver.service.js +105 -0
  199. package/dist/services/sql-expression-resolver.service.js.map +1 -0
  200. package/dist/solid-core.module.d.ts.map +1 -1
  201. package/dist/solid-core.module.js +61 -0
  202. package/dist/solid-core.module.js.map +1 -1
  203. package/dist/subscribers/dashboard-variable.subscriber.d.ts +16 -0
  204. package/dist/subscribers/dashboard-variable.subscriber.d.ts.map +1 -0
  205. package/dist/subscribers/dashboard-variable.subscriber.js +72 -0
  206. package/dist/subscribers/dashboard-variable.subscriber.js.map +1 -0
  207. package/dist/subscribers/dashboard.subscriber.d.ts +15 -0
  208. package/dist/subscribers/dashboard.subscriber.d.ts.map +1 -0
  209. package/dist/subscribers/dashboard.subscriber.js +56 -0
  210. package/dist/subscribers/dashboard.subscriber.js.map +1 -0
  211. package/dist/subscribers/question-sql-dataset-config.subscriber.d.ts +16 -0
  212. package/dist/subscribers/question-sql-dataset-config.subscriber.d.ts.map +1 -0
  213. package/dist/subscribers/question-sql-dataset-config.subscriber.js +72 -0
  214. package/dist/subscribers/question-sql-dataset-config.subscriber.js.map +1 -0
  215. package/dist/subscribers/question.subscriber.d.ts +16 -0
  216. package/dist/subscribers/question.subscriber.d.ts.map +1 -0
  217. package/dist/subscribers/question.subscriber.js +72 -0
  218. package/dist/subscribers/question.subscriber.js.map +1 -0
  219. package/dist/tsconfig.tsbuildinfo +1 -1
  220. package/package.json +1 -1
  221. package/src/controllers/ai-interaction.controller.ts +98 -0
  222. package/src/controllers/dashboard-variable.controller.ts +93 -0
  223. package/src/controllers/dashboard.controller.ts +99 -0
  224. package/src/controllers/question-sql-dataset-config.controller.ts +93 -0
  225. package/src/controllers/question.controller.ts +104 -0
  226. package/src/controllers/test.controller.ts +1 -2
  227. package/src/decorators/dashboard-question-data-provider.decorator.ts +7 -0
  228. package/src/decorators/dashboard-selection-provider.decorator.ts +7 -0
  229. package/src/dtos/create-ai-interaction.dto.ts +60 -0
  230. package/src/dtos/create-dashboard-variable.dto.ts +56 -0
  231. package/src/dtos/create-dashboard.dto.ts +53 -0
  232. package/src/dtos/create-question-sql-dataset-config.dto.ts +42 -0
  233. package/src/dtos/create-question.dto.ts +58 -0
  234. package/src/dtos/dashboard-variable-selection-dynamic-query.dto.ts +29 -0
  235. package/src/dtos/invoke-ai-prompt.dto.ts +6 -0
  236. package/src/dtos/update-ai-interaction.dto.ts +65 -0
  237. package/src/dtos/update-dashboard-variable.dto.ts +54 -0
  238. package/src/dtos/update-dashboard.dto.ts +57 -0
  239. package/src/dtos/update-question-sql-dataset-config.dto.ts +49 -0
  240. package/src/dtos/update-question.dto.ts +63 -0
  241. package/src/entities/ai-interaction.entity.ts +39 -0
  242. package/src/entities/dashboard-variable.entity.ts +30 -0
  243. package/src/entities/dashboard.entity.ts +21 -0
  244. package/src/entities/question-sql-dataset-config.entity.ts +25 -0
  245. package/src/entities/question.entity.ts +30 -0
  246. package/src/helpers/field-crud-managers/SelectionDynamicFieldCrudManager.ts +44 -18
  247. package/src/helpers/field-crud-managers/SelectionStaticFieldCrudManager.ts +43 -15
  248. package/src/helpers/solid-registry.ts +44 -2
  249. package/src/index.ts +5 -0
  250. package/src/interfaces.ts +41 -29
  251. package/src/mappers/dashboard-mapper.ts +52 -0
  252. package/src/repository/dashboard.repository.ts +100 -0
  253. package/src/seeders/module-metadata-seeder.service.ts +21 -1
  254. package/src/seeders/seed-data/solid-core-metadata.json +4225 -2421
  255. package/src/services/1. Create a context menu option i.py +12 -0
  256. package/src/services/ai-interaction.service.ts +127 -0
  257. package/src/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.ts +56 -0
  258. package/src/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.ts +37 -0
  259. package/src/services/dashboard-variable.service.ts +36 -0
  260. package/src/services/dashboard.service.ts +147 -0
  261. package/src/services/import-transaction.service.ts +2 -1
  262. package/src/services/menu-item-metadata.service.ts +2 -1
  263. package/src/services/question-data-providers/chartjs-sql-data-provider.service.ts +121 -0
  264. package/src/services/question-data-providers/helpers.ts +11 -0
  265. package/src/services/question-data-providers/prime-react-datatable-sql-data-provider.service.ts +72 -0
  266. package/src/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.ts +110 -0
  267. package/src/services/question-sql-dataset-config.service.ts +34 -0
  268. package/src/services/question.service.ts +115 -0
  269. package/src/services/scheduled-jobs/scheduler.service.ts +32 -64
  270. package/src/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.ts +41 -0
  271. package/src/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.ts +41 -0
  272. package/src/services/solid-introspect.service.ts +42 -0
  273. package/src/services/sql-expression-resolver.service.ts +125 -0
  274. package/src/solid-core.module.ts +61 -1
  275. package/src/subscribers/dashboard-variable.subscriber.ts +63 -0
  276. package/src/subscribers/dashboard.subscriber.ts +43 -0
  277. package/src/subscribers/question-sql-dataset-config.subscriber.ts +63 -0
  278. package/src/subscribers/question.subscriber.ts +65 -0
@@ -213,7 +213,37 @@ import { ComputedEntityFieldSubscriber } from './subscribers/computed-entity-fie
213
213
  import { CreatedByUpdatedBySubscriber } from './subscribers/created-by-updated-by.subscriber';
214
214
  import { SecurityRuleSubscriber } from './subscribers/security-rule.subscriber';
215
215
  import { ViewMetadataSubsciber } from './subscribers/view-metadata.subscriber';
216
+ import { Dashboard } from './entities/dashboard.entity';
217
+ import { DashboardService } from './services/dashboard.service';
218
+ import { DashboardController } from './controllers/dashboard.controller';
219
+ import { DashboardVariable } from './entities/dashboard-variable.entity';
220
+ import { DashboardVariableService } from './services/dashboard-variable.service';
221
+ import { DashboardVariableController } from './controllers/dashboard-variable.controller';
222
+ import { Question } from './entities/question.entity';
223
+ import { QuestionService } from './services/question.service';
224
+ import { QuestionController } from './controllers/question.controller';
216
225
  import { HttpExceptionFilter } from './filters/http-exception.filter';
226
+ import { DashboardVariableSQLDynamicProvider } from './services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service';
227
+ import { DasbhoardVariableTestDynamicProvider } from './services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service';
228
+ import { ListOfDashboardVariableProvidersSelectionProvider } from './services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service';
229
+ import { ListOfDashboardQuestionProvidersSelectionProvider } from './services/selection-providers/list-of-dashboard-question-providers-selection-provider.service';
230
+ import { QuestionSqlDatasetConfig } from './entities/question-sql-dataset-config.entity';
231
+ import { QuestionSqlDatasetConfigService } from './services/question-sql-dataset-config.service';
232
+ import { QuestionSqlDatasetConfigController } from './controllers/question-sql-dataset-config.controller';
233
+ import { ChartJsSqlDataProvider } from './services/question-data-providers/chartjs-sql-data-provider.service';
234
+ import { SqlExpressionResolverService } from './services/sql-expression-resolver.service';
235
+ import { PrimeReactMeterGroupSqlDataProvider } from './services/question-data-providers/prime-react-meter-group-sql-data-provider.service';
236
+ import { PrimeReactDatatableSqlDataProvider } from './services/question-data-providers/prime-react-datatable-sql-data-provider.service';
237
+ import { AiInteraction } from './entities/ai-interaction.entity';
238
+ import { AiInteractionService } from './services/ai-interaction.service';
239
+ import { AiInteractionController } from './controllers/ai-interaction.controller';
240
+ import { DashboardMapper } from './mappers/dashboard-mapper';
241
+ import { DashboardRepository } from './repository/dashboard.repository';
242
+ import { DashboardSubscriber } from './subscribers/dashboard.subscriber';
243
+ import { DashboardVariableSubscriber } from './subscribers/dashboard-variable.subscriber';
244
+ import { QuestionSubscriber } from './subscribers/question.subscriber';
245
+ import { QuestionSqlDatasetConfigSubscriber } from './subscribers/question-sql-dataset-config.subscriber';
246
+ import { ScheduleModule } from '@nestjs/schedule';
217
247
 
218
248
 
219
249
  @Global()
@@ -252,12 +282,14 @@ import { HttpExceptionFilter } from './filters/http-exception.filter';
252
282
  ImportTransaction,
253
283
  ImportTransactionErrorLog,
254
284
  UserActivityHistory,
285
+ AiInteraction,
255
286
  ]),
256
287
  ConfigModule.forFeature(appBuilderConfig),
257
288
  ConfigModule.forFeature(commonConfig),
258
289
  ConfigModule.forFeature(iamConfig),
259
290
  ConfigModule.forFeature(jwtConfig),
260
291
  JwtModule.registerAsync(jwtConfig.asProvider()),
292
+ ScheduleModule.forRoot(),
261
293
  ServeStaticModule.forRoot({
262
294
  rootPath: join(process.cwd(), 'media-files-storage'),
263
295
  serveRoot: '/media-files-storage',
@@ -272,6 +304,11 @@ import { HttpExceptionFilter } from './filters/http-exception.filter';
272
304
  HttpModule,
273
305
  ConfigModule,
274
306
  ClsModule,
307
+ TypeOrmModule.forFeature([Dashboard]),
308
+ TypeOrmModule.forFeature([DashboardVariable]),
309
+ TypeOrmModule.forFeature([Question]),
310
+ TypeOrmModule.forFeature([QuestionSqlDatasetConfig]),
311
+ TypeOrmModule.forFeature([AiInteraction]),
275
312
  ],
276
313
  controllers: [
277
314
  ModuleMetadataController,
@@ -310,6 +347,11 @@ import { HttpExceptionFilter } from './filters/http-exception.filter';
310
347
  ImportTransactionController,
311
348
  ImportTransactionErrorLogController,
312
349
  UserActivityHistoryController,
350
+ DashboardController,
351
+ DashboardVariableController,
352
+ QuestionController,
353
+ QuestionSqlDatasetConfigController,
354
+ AiInteractionController,
313
355
  ],
314
356
  providers: [
315
357
  {
@@ -454,7 +496,25 @@ import { HttpExceptionFilter } from './filters/http-exception.filter';
454
496
  ComputedFieldEvaluationSubscriber,
455
497
  ConcatEntityComputedFieldProvider,
456
498
  UserActivityHistoryService,
457
-
499
+ DashboardService,
500
+ DashboardVariableService,
501
+ QuestionService,
502
+ DashboardVariableSQLDynamicProvider,
503
+ DasbhoardVariableTestDynamicProvider,
504
+ ListOfDashboardVariableProvidersSelectionProvider,
505
+ ListOfDashboardQuestionProvidersSelectionProvider,
506
+ QuestionSqlDatasetConfigService,
507
+ ChartJsSqlDataProvider,
508
+ PrimeReactMeterGroupSqlDataProvider,
509
+ PrimeReactDatatableSqlDataProvider,
510
+ SqlExpressionResolverService,
511
+ AiInteractionService,
512
+ DashboardMapper,
513
+ DashboardRepository,
514
+ DashboardSubscriber,
515
+ DashboardVariableSubscriber,
516
+ QuestionSubscriber,
517
+ QuestionSqlDatasetConfigSubscriber,
458
518
  ],
459
519
  exports: [
460
520
  ModuleMetadataService,
@@ -0,0 +1,63 @@
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
+ }
@@ -0,0 +1,43 @@
1
+ import { Injectable, Logger } from '@nestjs/common';
2
+ import { InjectDataSource } from "@nestjs/typeorm";
3
+ import * as fs from 'fs/promises'; // Use the Promise-based version of fs for async/await
4
+ import { Dashboard } from 'src/entities/dashboard.entity';
5
+ import { ModuleMetadataHelperService } from "src/helpers/module-metadata-helper.service";
6
+ import { DashboardMapper } from 'src/mappers/dashboard-mapper';
7
+ import { DashboardService } from 'src/services/dashboard.service';
8
+ import { DataSource, EntitySubscriberInterface, InsertEvent, UpdateEvent } from "typeorm";
9
+
10
+ @Injectable()
11
+ export class DashboardSubscriber implements EntitySubscriberInterface<Dashboard> {
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 Dashboard;
24
+ }
25
+
26
+ async afterInsert(event: InsertEvent<Dashboard>) {
27
+ if (!event.entity) {
28
+ this.logger.debug('No dashboard entity found in the DashboardSubscriber afterInsert method');
29
+ return;
30
+ }
31
+ await this.dashboardService.saveDashboardToConfig(event.entity);
32
+ }
33
+
34
+ async afterUpdate(event: UpdateEvent<Dashboard>) {
35
+ if (!event.entity) {
36
+ this.logger.debug('No dashboard entity found in the DashboardSubscriber afterInsert method');
37
+ return;
38
+ }
39
+
40
+ await this.dashboardService.saveDashboardToConfig(event.databaseEntity);
41
+ }
42
+
43
+ }
@@ -0,0 +1,63 @@
1
+ import { Injectable, Logger } from "@nestjs/common";
2
+ import { InjectDataSource } from "@nestjs/typeorm";
3
+ import { Dashboard } from "src/entities/dashboard.entity";
4
+ import { QuestionSqlDatasetConfig } from "src/entities/question-sql-dataset-config.entity";
5
+ import { Question } from "src/entities/question.entity";
6
+ import { ModuleMetadataHelperService } from "src/helpers/module-metadata-helper.service";
7
+ import { DashboardService } from "src/services/dashboard.service";
8
+ import { QuestionService } from "src/services/question.service";
9
+ import { DataSource, EntityManager, EntitySubscriberInterface, InsertEvent, UpdateEvent } from "typeorm";
10
+
11
+ @Injectable()
12
+ export class QuestionSqlDatasetConfigSubscriber implements EntitySubscriberInterface<QuestionSqlDatasetConfig> {
13
+ private readonly logger = new Logger(this.constructor.name);
14
+ constructor(
15
+ @InjectDataSource()
16
+ private readonly dataSource: DataSource,
17
+ readonly moduleMetadataHelperService: ModuleMetadataHelperService,
18
+ readonly dashboardService: DashboardService, // Assuming you have a DashboardService for custom queries
19
+ ) {
20
+ this.dataSource.subscribers.push(this);
21
+ }
22
+
23
+ listenTo() {
24
+ return QuestionSqlDatasetConfig;
25
+ }
26
+
27
+ async afterInsert(event: InsertEvent<QuestionSqlDatasetConfig>) {
28
+ const question = event.entity.question;
29
+ if (!question) {
30
+ this.logger.debug('No question found in the QuestionSqlDatasetConfigSubscriber afterInsert method');
31
+ return;
32
+ }
33
+ await this.saveQuestionToConfig(question, event.queryRunner.manager);
34
+ }
35
+
36
+ async afterUpdate(event: UpdateEvent<QuestionSqlDatasetConfig>) {
37
+ const question = event.databaseEntity.question;
38
+ if (!question) {
39
+ this.logger.debug('No question found in the QuestionSqlDatasetConfigSubscriber afterUpdate method');
40
+ return;
41
+ }
42
+ await this.saveQuestionToConfig(question, event.queryRunner.manager);
43
+ }
44
+
45
+ private async saveQuestionToConfig(question: Question, entityManager: EntityManager): Promise<void> {
46
+ // Populate the dashboard for the question
47
+ const populatedQuestion = await entityManager.findOne(Question, {
48
+ where: {
49
+ id: question.id,
50
+ },
51
+ relations: ['dashboard', 'dashboard.module', 'dashboard.dashboardVariables', 'dashboard.questions', 'dashboard.questions.questionSqlDatasetConfigs'],
52
+ });
53
+ const dashboard = populatedQuestion?.dashboard;
54
+
55
+ if (!dashboard) {
56
+ throw new Error(`Dashboard not found for question id ${question.id}`);
57
+ }
58
+
59
+ // Call the saveDashboardToConfig method from the DashboardService
60
+ await this.dashboardService.saveDashboardToConfig(dashboard);
61
+ }
62
+
63
+ }
@@ -0,0 +1,65 @@
1
+ import { Injectable, Logger } from "@nestjs/common";
2
+ import { InjectDataSource } from "@nestjs/typeorm";
3
+ import e from "express";
4
+ import { DashboardVariable } from "src/entities/dashboard-variable.entity";
5
+ import { Dashboard } from "src/entities/dashboard.entity";
6
+ import { Question } from "src/entities/question.entity";
7
+ import { ModuleMetadataHelperService } from "src/helpers/module-metadata-helper.service";
8
+ import { DashboardService } from "src/services/dashboard.service";
9
+ import { QuestionService } from "src/services/question.service";
10
+ import { EntitySubscriberInterface, DataSource, InsertEvent, UpdateEvent, EntityManager } from "typeorm";
11
+
12
+ @Injectable()
13
+ export class QuestionSubscriber implements EntitySubscriberInterface<Question> {
14
+ private readonly logger = new Logger(this.constructor.name);
15
+ constructor(
16
+ @InjectDataSource()
17
+ private readonly dataSource: DataSource,
18
+ readonly moduleMetadataHelperService: ModuleMetadataHelperService,
19
+ readonly dashboardService: DashboardService,
20
+ ) {
21
+ this.dataSource.subscribers.push(this);
22
+ }
23
+
24
+ listenTo() {
25
+ return Question;
26
+ }
27
+
28
+ async afterInsert(event: InsertEvent<Question>) {
29
+ if (!event.entity) {
30
+ this.logger.debug('No question entity found in the QuestionSubscriber afterInsert method');
31
+ return;
32
+ }
33
+ await this.saveDashboardToConfig(event.entity, event.queryRunner.manager);
34
+ }
35
+
36
+ async afterUpdate(event: UpdateEvent<Question>) {
37
+ if (!event.databaseEntity) {
38
+ this.logger.debug('No question entity found in the QuestionSubscriber afterUpdate method');
39
+ return;
40
+ }
41
+ await this.saveDashboardToConfig(event.databaseEntity, event.queryRunner.manager);
42
+ }
43
+
44
+ private async saveDashboardToConfig(question: Question, entityManager: EntityManager): Promise<void> {
45
+ const dashboard = question.dashboard;
46
+ // Get the dashboard from the question & call the saveDashboardToConfig method
47
+ if (!dashboard) {
48
+ this.logger.debug(`Dashboard is undefined for question id ${question.id}`);
49
+ return;
50
+ }
51
+
52
+ // populate the dashboard with its variables
53
+ const populatedDashboard = await entityManager.findOne(Dashboard, {
54
+ where: { id: dashboard.id },
55
+ relations: ['module','dashboardVariables', 'questions', 'questions.questionSqlDatasetConfigs'],
56
+ });
57
+
58
+ if (!populatedDashboard) {
59
+ throw new Error(`Dashboard not found for question id ${populatedDashboard.id}`);
60
+ }
61
+
62
+ // Call the saveDashboardToConfig method from the DashboardService
63
+ await this.dashboardService.saveDashboardToConfig(populatedDashboard);
64
+ }
65
+ }