@solidstarters/solid-core 1.2.134 → 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.
- package/dist/controllers/ai-interaction.controller.d.ts +45 -0
- package/dist/controllers/ai-interaction.controller.d.ts.map +1 -0
- package/dist/controllers/ai-interaction.controller.js +192 -0
- package/dist/controllers/ai-interaction.controller.js.map +1 -0
- package/dist/controllers/dashboard-variable.controller.d.ts +43 -0
- package/dist/controllers/dashboard-variable.controller.d.ts.map +1 -0
- package/dist/controllers/dashboard-variable.controller.js +179 -0
- package/dist/controllers/dashboard-variable.controller.js.map +1 -0
- package/dist/controllers/dashboard.controller.d.ts +45 -0
- package/dist/controllers/dashboard.controller.d.ts.map +1 -0
- package/dist/controllers/dashboard.controller.js +192 -0
- package/dist/controllers/dashboard.controller.js.map +1 -0
- package/dist/controllers/question-sql-dataset-config.controller.d.ts +43 -0
- package/dist/controllers/question-sql-dataset-config.controller.d.ts.map +1 -0
- package/dist/controllers/question-sql-dataset-config.controller.js +179 -0
- package/dist/controllers/question-sql-dataset-config.controller.js.map +1 -0
- package/dist/controllers/question.controller.d.ts +45 -0
- package/dist/controllers/question.controller.d.ts.map +1 -0
- package/dist/controllers/question.controller.js +194 -0
- package/dist/controllers/question.controller.js.map +1 -0
- package/dist/controllers/test.controller.d.ts.map +1 -1
- package/dist/controllers/test.controller.js.map +1 -1
- package/dist/decorators/dashboard-question-data-provider.decorator.d.ts +3 -0
- package/dist/decorators/dashboard-question-data-provider.decorator.d.ts.map +1 -0
- package/dist/decorators/dashboard-question-data-provider.decorator.js +11 -0
- package/dist/decorators/dashboard-question-data-provider.decorator.js.map +1 -0
- package/dist/decorators/dashboard-selection-provider.decorator.d.ts +3 -0
- package/dist/decorators/dashboard-selection-provider.decorator.d.ts.map +1 -0
- package/dist/decorators/dashboard-selection-provider.decorator.js +11 -0
- package/dist/decorators/dashboard-selection-provider.decorator.js.map +1 -0
- package/dist/dtos/create-ai-interaction.dto.d.ts +14 -0
- package/dist/dtos/create-ai-interaction.dto.d.ts.map +1 -0
- package/dist/dtos/create-ai-interaction.dto.js +90 -0
- package/dist/dtos/create-ai-interaction.dto.js.map +1 -0
- package/dist/dtos/create-dashboard-variable.dto.d.ts +18 -0
- package/dist/dtos/create-dashboard-variable.dto.d.ts.map +1 -0
- package/dist/dtos/create-dashboard-variable.dto.js +97 -0
- package/dist/dtos/create-dashboard-variable.dto.js.map +1 -0
- package/dist/dtos/create-dashboard.dto.d.ts +15 -0
- package/dist/dtos/create-dashboard.dto.d.ts.map +1 -0
- package/dist/dtos/create-dashboard.dto.js +90 -0
- package/dist/dtos/create-dashboard.dto.js.map +1 -0
- package/dist/dtos/create-question-sql-dataset-config.dto.d.ts +12 -0
- package/dist/dtos/create-question-sql-dataset-config.dto.d.ts.map +1 -0
- package/dist/dtos/create-question-sql-dataset-config.dto.js +77 -0
- package/dist/dtos/create-question-sql-dataset-config.dto.js.map +1 -0
- package/dist/dtos/create-question.dto.d.ts +16 -0
- package/dist/dtos/create-question.dto.d.ts.map +1 -0
- package/dist/dtos/create-question.dto.js +99 -0
- package/dist/dtos/create-question.dto.js.map +1 -0
- package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.d.ts +8 -0
- package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.d.ts.map +1 -0
- package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.js +52 -0
- package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.js.map +1 -0
- package/dist/dtos/invoke-ai-prompt.dto.d.ts +4 -0
- package/dist/dtos/invoke-ai-prompt.dto.d.ts.map +1 -0
- package/dist/dtos/invoke-ai-prompt.dto.js +25 -0
- package/dist/dtos/invoke-ai-prompt.dto.js.map +1 -0
- package/dist/dtos/update-ai-interaction.dto.d.ts +15 -0
- package/dist/dtos/update-ai-interaction.dto.d.ts.map +1 -0
- package/dist/dtos/update-ai-interaction.dto.js +96 -0
- package/dist/dtos/update-ai-interaction.dto.js.map +1 -0
- package/dist/dtos/update-dashboard-variable.dto.d.ts +15 -0
- package/dist/dtos/update-dashboard-variable.dto.d.ts.map +1 -0
- package/dist/dtos/update-dashboard-variable.dto.js +95 -0
- package/dist/dtos/update-dashboard-variable.dto.js.map +1 -0
- package/dist/dtos/update-dashboard.dto.d.ts +16 -0
- package/dist/dtos/update-dashboard.dto.d.ts.map +1 -0
- package/dist/dtos/update-dashboard.dto.js +96 -0
- package/dist/dtos/update-dashboard.dto.js.map +1 -0
- package/dist/dtos/update-question-sql-dataset-config.dto.d.ts +13 -0
- package/dist/dtos/update-question-sql-dataset-config.dto.d.ts.map +1 -0
- package/dist/dtos/update-question-sql-dataset-config.dto.js +86 -0
- package/dist/dtos/update-question-sql-dataset-config.dto.js.map +1 -0
- package/dist/dtos/update-question.dto.d.ts +17 -0
- package/dist/dtos/update-question.dto.d.ts.map +1 -0
- package/dist/dtos/update-question.dto.js +106 -0
- package/dist/dtos/update-question.dto.js.map +1 -0
- package/dist/entities/ai-interaction.entity.d.ts +15 -0
- package/dist/entities/ai-interaction.entity.d.ts.map +1 -0
- package/dist/entities/ai-interaction.entity.js +70 -0
- package/dist/entities/ai-interaction.entity.js.map +1 -0
- package/dist/entities/dashboard-variable.entity.d.ts +15 -0
- package/dist/entities/dashboard-variable.entity.d.ts.map +1 -0
- package/dist/entities/dashboard-variable.entity.js +73 -0
- package/dist/entities/dashboard-variable.entity.js.map +1 -0
- package/dist/entities/dashboard.entity.d.ts +12 -0
- package/dist/entities/dashboard.entity.d.ts.map +1 -0
- package/dist/entities/dashboard.entity.js +50 -0
- package/dist/entities/dashboard.entity.js.map +1 -0
- package/dist/entities/question-sql-dataset-config.entity.d.ts +13 -0
- package/dist/entities/question-sql-dataset-config.entity.d.ts.map +1 -0
- package/dist/entities/question-sql-dataset-config.entity.js +60 -0
- package/dist/entities/question-sql-dataset-config.entity.js.map +1 -0
- package/dist/entities/question.entity.d.ts +15 -0
- package/dist/entities/question.entity.d.ts.map +1 -0
- package/dist/entities/question.entity.js +67 -0
- package/dist/entities/question.entity.js.map +1 -0
- package/dist/helpers/solid-registry.d.ts +9 -1
- package/dist/helpers/solid-registry.d.ts.map +1 -1
- package/dist/helpers/solid-registry.js +32 -0
- package/dist/helpers/solid-registry.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +12 -1
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/mappers/dashboard-mapper.d.ts +6 -0
- package/dist/mappers/dashboard-mapper.d.ts.map +1 -0
- package/dist/mappers/dashboard-mapper.js +60 -0
- package/dist/mappers/dashboard-mapper.js.map +1 -0
- package/dist/repository/dashboard.repository.d.ts +11 -0
- package/dist/repository/dashboard.repository.d.ts.map +1 -0
- package/dist/repository/dashboard.repository.js +93 -0
- package/dist/repository/dashboard.repository.js.map +1 -0
- package/dist/seeders/module-metadata-seeder.service.d.ts +5 -1
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +18 -2
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +4222 -2418
- package/dist/services/ai-interaction.service.d.ts +23 -0
- package/dist/services/ai-interaction.service.d.ts.map +1 -0
- package/dist/services/ai-interaction.service.js +147 -0
- package/dist/services/ai-interaction.service.js.map +1 -0
- package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.d.ts +12 -0
- package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.js +55 -0
- package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.js.map +1 -0
- package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.d.ts +11 -0
- package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.d.ts.map +1 -0
- package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.js +45 -0
- package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.js.map +1 -0
- package/dist/services/dashboard-variable.service.d.ts +23 -0
- package/dist/services/dashboard-variable.service.d.ts.map +1 -0
- package/dist/services/dashboard-variable.service.js +57 -0
- package/dist/services/dashboard-variable.service.js.map +1 -0
- package/dist/services/dashboard.service.d.ts +38 -0
- package/dist/services/dashboard.service.d.ts.map +1 -0
- package/dist/services/dashboard.service.js +179 -0
- package/dist/services/dashboard.service.js.map +1 -0
- package/dist/services/menu-item-metadata.service.d.ts.map +1 -1
- package/dist/services/menu-item-metadata.service.js +1 -1
- package/dist/services/menu-item-metadata.service.js.map +1 -1
- package/dist/services/question-data-providers/chartjs-sql-data-provider.service.d.ts +36 -0
- package/dist/services/question-data-providers/chartjs-sql-data-provider.service.d.ts.map +1 -0
- package/dist/services/question-data-providers/chartjs-sql-data-provider.service.js +85 -0
- package/dist/services/question-data-providers/chartjs-sql-data-provider.service.js.map +1 -0
- package/dist/services/question-data-providers/helpers.d.ts +4 -0
- package/dist/services/question-data-providers/helpers.d.ts.map +1 -0
- package/dist/services/question-data-providers/helpers.js +10 -0
- package/dist/services/question-data-providers/helpers.js.map +1 -0
- package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.d.ts +17 -0
- package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.d.ts.map +1 -0
- package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.js +64 -0
- package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.js.map +1 -0
- package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.d.ts +19 -0
- package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.d.ts.map +1 -0
- package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.js +84 -0
- package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.js.map +1 -0
- package/dist/services/question-sql-dataset-config.service.d.ts +22 -0
- package/dist/services/question-sql-dataset-config.service.d.ts.map +1 -0
- package/dist/services/question-sql-dataset-config.service.js +56 -0
- package/dist/services/question-sql-dataset-config.service.js.map +1 -0
- package/dist/services/question.service.d.ts +29 -0
- package/dist/services/question.service.d.ts.map +1 -0
- package/dist/services/question.service.js +117 -0
- package/dist/services/question.service.js.map +1 -0
- package/dist/services/scheduled-jobs/scheduler.service.d.ts.map +1 -1
- package/dist/services/scheduled-jobs/scheduler.service.js +22 -11
- package/dist/services/scheduled-jobs/scheduler.service.js.map +1 -1
- package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.d.ts +11 -0
- package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.d.ts.map +1 -0
- package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.js +46 -0
- package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.js.map +1 -0
- package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.d.ts +11 -0
- package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.d.ts.map +1 -0
- package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.js +47 -0
- package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.js.map +1 -0
- package/dist/services/solid-introspect.service.d.ts +2 -0
- package/dist/services/solid-introspect.service.d.ts.map +1 -1
- package/dist/services/solid-introspect.service.js +28 -0
- package/dist/services/solid-introspect.service.js.map +1 -1
- package/dist/services/sql-expression-resolver.service.d.ts +9 -0
- package/dist/services/sql-expression-resolver.service.d.ts.map +1 -0
- package/dist/services/sql-expression-resolver.service.js +105 -0
- package/dist/services/sql-expression-resolver.service.js.map +1 -0
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +61 -0
- package/dist/solid-core.module.js.map +1 -1
- package/dist/subscribers/dashboard-variable.subscriber.d.ts +16 -0
- package/dist/subscribers/dashboard-variable.subscriber.d.ts.map +1 -0
- package/dist/subscribers/dashboard-variable.subscriber.js +72 -0
- package/dist/subscribers/dashboard-variable.subscriber.js.map +1 -0
- package/dist/subscribers/dashboard.subscriber.d.ts +15 -0
- package/dist/subscribers/dashboard.subscriber.d.ts.map +1 -0
- package/dist/subscribers/dashboard.subscriber.js +56 -0
- package/dist/subscribers/dashboard.subscriber.js.map +1 -0
- package/dist/subscribers/question-sql-dataset-config.subscriber.d.ts +16 -0
- package/dist/subscribers/question-sql-dataset-config.subscriber.d.ts.map +1 -0
- package/dist/subscribers/question-sql-dataset-config.subscriber.js +72 -0
- package/dist/subscribers/question-sql-dataset-config.subscriber.js.map +1 -0
- package/dist/subscribers/question.subscriber.d.ts +16 -0
- package/dist/subscribers/question.subscriber.d.ts.map +1 -0
- package/dist/subscribers/question.subscriber.js +72 -0
- package/dist/subscribers/question.subscriber.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/controllers/ai-interaction.controller.ts +98 -0
- package/src/controllers/dashboard-variable.controller.ts +93 -0
- package/src/controllers/dashboard.controller.ts +99 -0
- package/src/controllers/question-sql-dataset-config.controller.ts +93 -0
- package/src/controllers/question.controller.ts +104 -0
- package/src/controllers/test.controller.ts +1 -2
- package/src/decorators/dashboard-question-data-provider.decorator.ts +7 -0
- package/src/decorators/dashboard-selection-provider.decorator.ts +7 -0
- package/src/dtos/create-ai-interaction.dto.ts +60 -0
- package/src/dtos/create-dashboard-variable.dto.ts +56 -0
- package/src/dtos/create-dashboard.dto.ts +53 -0
- package/src/dtos/create-question-sql-dataset-config.dto.ts +42 -0
- package/src/dtos/create-question.dto.ts +58 -0
- package/src/dtos/dashboard-variable-selection-dynamic-query.dto.ts +29 -0
- package/src/dtos/invoke-ai-prompt.dto.ts +6 -0
- package/src/dtos/update-ai-interaction.dto.ts +65 -0
- package/src/dtos/update-dashboard-variable.dto.ts +54 -0
- package/src/dtos/update-dashboard.dto.ts +57 -0
- package/src/dtos/update-question-sql-dataset-config.dto.ts +49 -0
- package/src/dtos/update-question.dto.ts +63 -0
- package/src/entities/ai-interaction.entity.ts +39 -0
- package/src/entities/dashboard-variable.entity.ts +30 -0
- package/src/entities/dashboard.entity.ts +21 -0
- package/src/entities/question-sql-dataset-config.entity.ts +25 -0
- package/src/entities/question.entity.ts +30 -0
- package/src/helpers/solid-registry.ts +44 -2
- package/src/index.ts +5 -0
- package/src/interfaces.ts +41 -29
- package/src/mappers/dashboard-mapper.ts +52 -0
- package/src/repository/dashboard.repository.ts +100 -0
- package/src/seeders/module-metadata-seeder.service.ts +21 -1
- package/src/seeders/seed-data/solid-core-metadata.json +4225 -2421
- package/src/services/1. Create a context menu option i.py +12 -0
- package/src/services/ai-interaction.service.ts +127 -0
- package/src/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.ts +56 -0
- package/src/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.ts +37 -0
- package/src/services/dashboard-variable.service.ts +36 -0
- package/src/services/dashboard.service.ts +147 -0
- package/src/services/menu-item-metadata.service.ts +2 -1
- package/src/services/question-data-providers/chartjs-sql-data-provider.service.ts +121 -0
- package/src/services/question-data-providers/helpers.ts +11 -0
- package/src/services/question-data-providers/prime-react-datatable-sql-data-provider.service.ts +72 -0
- package/src/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.ts +110 -0
- package/src/services/question-sql-dataset-config.service.ts +34 -0
- package/src/services/question.service.ts +115 -0
- package/src/services/scheduled-jobs/scheduler.service.ts +32 -64
- package/src/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.ts +41 -0
- package/src/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.ts +41 -0
- package/src/services/solid-introspect.service.ts +42 -0
- package/src/services/sql-expression-resolver.service.ts +125 -0
- package/src/solid-core.module.ts +61 -1
- package/src/subscribers/dashboard-variable.subscriber.ts +63 -0
- package/src/subscribers/dashboard.subscriber.ts +43 -0
- package/src/subscribers/question-sql-dataset-config.subscriber.ts +63 -0
- package/src/subscribers/question.subscriber.ts +65 -0
package/src/solid-core.module.ts
CHANGED
|
@@ -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
|
+
}
|