@solidxai/core 0.1.10-beta.0 → 0.1.10-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/run-tests.command.d.ts +2 -0
- package/dist/commands/run-tests.command.d.ts.map +1 -1
- package/dist/commands/run-tests.command.js +49 -17
- package/dist/commands/run-tests.command.js.map +1 -1
- package/dist/controllers/action-metadata.controller.js +1 -1
- package/dist/controllers/action-metadata.controller.js.map +1 -1
- package/dist/controllers/facebook-authentication.controller.js +1 -1
- package/dist/controllers/facebook-authentication.controller.js.map +1 -1
- package/dist/controllers/google-authentication.controller.js +1 -1
- package/dist/controllers/google-authentication.controller.js.map +1 -1
- package/dist/controllers/menu-item-metadata.controller.js +1 -1
- package/dist/controllers/menu-item-metadata.controller.js.map +1 -1
- package/dist/controllers/microsoft-authentication.controller.js +1 -1
- package/dist/controllers/microsoft-authentication.controller.js.map +1 -1
- package/dist/controllers/mq-message-queue.controller.js +1 -1
- package/dist/controllers/mq-message-queue.controller.js.map +1 -1
- package/dist/controllers/mq-message.controller.js +1 -1
- package/dist/controllers/mq-message.controller.js.map +1 -1
- package/dist/controllers/user.controller.d.ts.map +1 -1
- package/dist/controllers/user.controller.js.map +1 -1
- package/dist/controllers/view-metadata.controller.js +1 -1
- package/dist/controllers/view-metadata.controller.js.map +1 -1
- package/dist/dtos/update-user.dto.d.ts +1 -0
- package/dist/dtos/update-user.dto.d.ts.map +1 -1
- package/dist/dtos/update-user.dto.js +7 -1
- package/dist/dtos/update-user.dto.js.map +1 -1
- package/dist/entities/chatter-message-details.entity.d.ts.map +1 -1
- package/dist/entities/chatter-message-details.entity.js +0 -1
- package/dist/entities/chatter-message-details.entity.js.map +1 -1
- package/dist/entities/user.entity.js +1 -0
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/helpers/bootstrap.helper.d.ts.map +1 -1
- package/dist/helpers/bootstrap.helper.js +2 -0
- package/dist/helpers/bootstrap.helper.js.map +1 -1
- package/dist/helpers/field-crud-managers/BigIntFieldCrudManager.js.map +1 -1
- package/dist/helpers/field-crud-managers/SelectionDynamicFieldCrudManager.js.map +1 -1
- package/dist/helpers/module-metadata-helper.service.js.map +1 -1
- package/dist/jobs/database/chatter-queue-subscriber-database.service.d.ts.map +1 -1
- package/dist/jobs/database/chatter-queue-subscriber-database.service.js +3 -3
- package/dist/jobs/database/chatter-queue-subscriber-database.service.js.map +1 -1
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js.map +1 -1
- package/dist/jobs/rabbitmq/chatter-queue-subscriber.service.d.ts.map +1 -1
- package/dist/jobs/rabbitmq/chatter-queue-subscriber.service.js +3 -3
- package/dist/jobs/rabbitmq/chatter-queue-subscriber.service.js.map +1 -1
- package/dist/jobs/redis/chatter-queue-subscriber-redis.service.d.ts.map +1 -1
- package/dist/jobs/redis/chatter-queue-subscriber-redis.service.js +3 -3
- package/dist/jobs/redis/chatter-queue-subscriber-redis.service.js.map +1 -1
- package/dist/repository/security-rule.repository.js.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/module-test-data.service.d.ts +7 -0
- package/dist/seeders/module-test-data.service.d.ts.map +1 -1
- package/dist/seeders/module-test-data.service.js +94 -18
- package/dist/seeders/module-test-data.service.js.map +1 -1
- package/dist/seeders/permission-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +34 -2
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +5 -5
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/chatter-message.service.d.ts +6 -3
- package/dist/services/chatter-message.service.d.ts.map +1 -1
- package/dist/services/chatter-message.service.js +23 -35
- package/dist/services/chatter-message.service.js.map +1 -1
- package/dist/services/crud.service.js.map +1 -1
- package/dist/services/csv.service.js.map +1 -1
- package/dist/services/dashboard.service.js.map +1 -1
- package/dist/services/database/database-bootstrap.service.js.map +1 -1
- package/dist/services/excel.service.js.map +1 -1
- package/dist/services/export-transaction.service.js.map +1 -1
- package/dist/services/field-metadata.service.js +2 -2
- package/dist/services/field-metadata.service.js.map +1 -1
- package/dist/services/fixtures.service.js.map +1 -1
- package/dist/services/import-transaction.service.js.map +1 -1
- package/dist/services/list-of-values.service.js.map +1 -1
- package/dist/services/model-metadata.service.d.ts.map +1 -1
- package/dist/services/model-metadata.service.js +3 -13
- package/dist/services/model-metadata.service.js.map +1 -1
- package/dist/services/module-metadata.service.js.map +1 -1
- package/dist/services/queues/database-publisher.service.js +3 -3
- package/dist/services/queues/database-publisher.service.js.map +1 -1
- package/dist/services/queues/database-subscriber.service.js +3 -3
- package/dist/services/queues/database-subscriber.service.js.map +1 -1
- package/dist/services/queues/rabbitmq-publisher.service.js +3 -3
- package/dist/services/queues/rabbitmq-publisher.service.js.map +1 -1
- package/dist/services/queues/rabbitmq-subscriber.service.js +4 -4
- package/dist/services/queues/rabbitmq-subscriber.service.js.map +1 -1
- package/dist/services/queues/redis-publisher.service.d.ts.map +1 -1
- package/dist/services/queues/redis-publisher.service.js +4 -1
- package/dist/services/queues/redis-publisher.service.js.map +1 -1
- package/dist/services/queues/redis-subscriber.service.d.ts.map +1 -1
- package/dist/services/queues/redis-subscriber.service.js +4 -1
- package/dist/services/queues/redis-subscriber.service.js.map +1 -1
- package/dist/services/role-metadata.service.js.map +1 -1
- package/dist/services/scheduled-jobs/scheduler.service.js.map +1 -1
- package/dist/services/settings/default-settings-provider.service.d.ts +58 -8
- package/dist/services/settings/default-settings-provider.service.d.ts.map +1 -1
- package/dist/services/settings/default-settings-provider.service.js +21 -4
- package/dist/services/settings/default-settings-provider.service.js.map +1 -1
- package/dist/services/sms/TwilioSMSService.js.map +1 -1
- package/dist/services/solid-introspect.service.js.map +1 -1
- package/dist/services/user-activity-history.service.js.map +1 -1
- package/dist/services/view-metadata.service.d.ts.map +1 -1
- package/dist/services/view-metadata.service.js +17 -2
- package/dist/services/view-metadata.service.js.map +1 -1
- package/dist/solid-core.module.d.ts +1 -0
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +1 -0
- package/dist/solid-core.module.js.map +1 -1
- package/dist/subscribers/computed-entity-field.subscriber.js.map +1 -1
- package/dist/subscribers/security-rule.subscriber.d.ts.map +1 -1
- package/dist/subscribers/security-rule.subscriber.js.map +1 -1
- package/dist/subscribers/view-metadata.subscriber.js.map +1 -1
- package/dist/testing/core/testing-engine.js.map +1 -1
- package/dist/testing/reporter/console-reporter.d.ts +10 -0
- package/dist/testing/reporter/console-reporter.d.ts.map +1 -1
- package/dist/testing/reporter/console-reporter.js +21 -0
- package/dist/testing/reporter/console-reporter.js.map +1 -1
- package/dist/testing/reporter/reporter.types.d.ts +7 -0
- package/dist/testing/reporter/reporter.types.d.ts.map +1 -1
- package/dist/testing/reporter/reporter.types.js.map +1 -1
- package/dist/testing/reporter/webhook-reporter.d.ts +54 -0
- package/dist/testing/reporter/webhook-reporter.d.ts.map +1 -0
- package/dist/testing/reporter/webhook-reporter.js +74 -0
- package/dist/testing/reporter/webhook-reporter.js.map +1 -0
- package/dist/testing/runner/run-from-metadata.d.ts.map +1 -1
- package/dist/testing/runner/run-from-metadata.js +20 -1
- package/dist/testing/runner/run-from-metadata.js.map +1 -1
- package/package.json +5 -1
- package/src/commands/run-tests.command.ts +45 -17
- package/src/controllers/action-metadata.controller.ts +1 -1
- package/src/controllers/facebook-authentication.controller.ts +1 -1
- package/src/controllers/google-authentication.controller.ts +1 -1
- package/src/controllers/menu-item-metadata.controller.ts +1 -1
- package/src/controllers/microsoft-authentication.controller.ts +1 -1
- package/src/controllers/mq-message-queue.controller.ts +1 -1
- package/src/controllers/mq-message.controller.ts +1 -1
- package/src/controllers/user.controller.ts +16 -16
- package/src/controllers/view-metadata.controller.ts +1 -1
- package/src/dtos/update-user.dto.ts +4 -0
- package/src/entities/chatter-message-details.entity.ts +1 -2
- package/src/entities/user.entity.ts +1 -1
- package/src/helpers/bootstrap.helper.ts +3 -0
- package/src/helpers/field-crud-managers/BigIntFieldCrudManager.ts +1 -1
- package/src/helpers/field-crud-managers/SelectionDynamicFieldCrudManager.ts +1 -1
- package/src/helpers/module-metadata-helper.service.ts +1 -1
- package/src/jobs/database/chatter-queue-subscriber-database.service.ts +4 -2
- package/src/jobs/database/trigger-mcp-client-subscriber-database.service.ts +1 -1
- package/src/jobs/rabbitmq/chatter-queue-subscriber.service.ts +4 -2
- package/src/jobs/redis/chatter-queue-subscriber-redis.service.ts +10 -3
- package/src/repository/security-rule.repository.ts +1 -1
- package/src/seeders/module-metadata-seeder.service.ts +4 -4
- package/src/seeders/module-test-data.service.ts +107 -15
- package/src/seeders/permission-metadata-seeder.service.ts +1 -1
- package/src/seeders/seed-data/solid-core-metadata.json +34 -2
- package/src/services/authentication.service.ts +19 -31
- package/src/services/chatter-message.service.ts +28 -38
- package/src/services/crud.service.ts +3 -3
- package/src/services/csv.service.ts +1 -1
- package/src/services/dashboard.service.ts +1 -1
- package/src/services/database/database-bootstrap.service.ts +1 -1
- package/src/services/excel.service.ts +1 -1
- package/src/services/export-transaction.service.ts +2 -2
- package/src/services/field-metadata.service.ts +3 -3
- package/src/services/fixtures.service.ts +2 -2
- package/src/services/import-transaction.service.ts +2 -2
- package/src/services/list-of-values.service.ts +1 -1
- package/src/services/model-metadata.service.ts +22 -21
- package/src/services/module-metadata.service.ts +7 -7
- package/src/services/queues/database-publisher.service.ts +4 -4
- package/src/services/queues/database-subscriber.service.ts +7 -7
- package/src/services/queues/rabbitmq-publisher.service.ts +7 -7
- package/src/services/queues/rabbitmq-subscriber.service.ts +13 -13
- package/src/services/queues/redis-publisher.service.ts +7 -4
- package/src/services/queues/redis-subscriber.service.ts +9 -6
- package/src/services/role-metadata.service.ts +1 -1
- package/src/services/scheduled-jobs/scheduler.service.ts +5 -5
- package/src/services/settings/default-settings-provider.service.ts +21 -4
- package/src/services/sms/TwilioSMSService.ts +2 -2
- package/src/services/solid-introspect.service.ts +2 -2
- package/src/services/user-activity-history.service.ts +1 -1
- package/src/services/view-metadata.service.ts +25 -8
- package/src/solid-core.module.ts +1 -0
- package/src/subscribers/computed-entity-field.subscriber.ts +1 -1
- package/src/subscribers/security-rule.subscriber.ts +8 -8
- package/src/subscribers/view-metadata.subscriber.ts +1 -1
- package/src/testing/core/testing-engine.ts +2 -2
- package/src/testing/reporter/console-reporter.ts +27 -0
- package/src/testing/reporter/reporter.types.ts +7 -0
- package/src/testing/reporter/webhook-reporter.ts +116 -0
- package/src/testing/runner/run-from-metadata.ts +19 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-metadata.service.js","sourceRoot":"","sources":["../../src/services/view-metadata.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA6F;AAC7F,uCAAyC;AACzC,6CAAsD;AACtD,iDAAwD;AACxD,qCAAwC;AAExC,4DAAoD;AACpD,6DAAoD;AACpD,4FAAuF;AACvF,8DAA2D;AAC3D,uFAAmF;AACnF,qFAAiF;AAIjF,uEAAkE;AAClE,6EAAuE;AACvE,yEAAoE;AACpE,6EAAuE;AAIhE,IAAM,mBAAmB,2BAAzB,MAAM,mBAAoB,SAAQ,0BAAyB;IAChE,YACW,qBAA4C,EAC5C,uBAAgD,EAChD,iBAAyC,EACzC,uBAAgD,EAEzD,aAAqC,EAE5B,IAA4B,EAMrC,iBAA2D,EAC1C,0BAAsD,EAC9D,SAAoB;QAE7B,KAAK,CAAC,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QAjB3D,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,sBAAiB,GAAjB,iBAAiB,CAAwB;QACzC,4BAAuB,GAAvB,uBAAuB,CAAyB;QAEhD,kBAAa,GAAb,aAAa,CAAe;QAE5B,SAAI,GAAJ,IAAI,CAAwB;QAMpB,sBAAiB,GAAjB,iBAAiB,CAAyB;QAC1C,+BAA0B,GAA1B,0BAA0B,CA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CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,kBAAyC;QAEhE,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAG/E,IAAI,iBAAiB,EAAE,CAAC;QACxB,CAAC;aAEI,CAAC;YACJ,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CAIF,CAAA;AA/aY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAOR,WAAA,IAAA,6BAAmB,GAAE,CAAA;IAQrB,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,mDAAuB,CAAC,CAAC,CAAA;qCAZlB,+CAAqB;QACnB,oDAAuB;QAC7B,iDAAsB;QAChB,oDAAuB;QAEjC,uBAAa;QAEtB,iDAAsB;QAMD,mDAAuB;QACd,0DAA0B;QACnD,gBAAS;GAjBpB,mBAAmB,CA+a/B","sourcesContent":["import { BadRequestException, forwardRef, Inject, Injectable, Logger } from '@nestjs/common';\nimport { ModuleRef } from \"@nestjs/core\";\nimport { InjectEntityManager } from '@nestjs/typeorm';\nimport { CRUDService } from 'src/services/crud.service';\nimport { EntityManager } from 'typeorm';\n\nimport { classify } from '../helpers/string.helper';\nimport { Locale } from 'src/entities/locale.entity';\nimport { ModelMetadataHelperService } from 'src/helpers/model-metadata-helper.service';\nimport { SolidRegistry } from 'src/helpers/solid-registry';\nimport { ModelMetadataRepository } from 'src/repository/model-metadata.repository';\nimport { ViewMetadataRepository } from 'src/repository/view-metadata.repository';\nimport { UpdateViewMetadataDto } from '../dtos/update-view-metadata.dto';\nimport { FieldMetadata } from '../entities/field-metadata.entity';\nimport { ViewMetadata } from '../entities/view-metadata.entity';\nimport { ActionMetadataService } from './action-metadata.service';\nimport { MenuItemMetadataService } from './menu-item-metadata.service';\nimport { SolidIntrospectService } from './solid-introspect.service';\nimport { UserViewMetadataService } from './user-view-metadata.service';\nimport { MenuItemMetadata } from 'src/entities/menu-item-metadata.entity';\n\n@Injectable()\nexport class ViewMetadataService extends CRUDService<ViewMetadata> {\n constructor(\n readonly actionMetadataService: ActionMetadataService,\n readonly menuItemMetadataService: MenuItemMetadataService,\n readonly introspectService: SolidIntrospectService,\n readonly userViewMetadataService: UserViewMetadataService,\n @InjectEntityManager()\n readonly entityManager: EntityManager,\n // @InjectRepository(ViewMetadata, 'default')\n readonly repo: ViewMetadataRepository,\n // @InjectRepository(FieldMetadata)\n // private readonly fieldMetadataRepo: Repository<FieldMetadata>,\n // @InjectRepository(ModelMetadata)\n // private readonly modelMetadataRepo: Repository<ModelMetadata>,\n @Inject(forwardRef(() => ModelMetadataRepository))\n private readonly modelMetadataRepo: ModelMetadataRepository,\n private readonly modelMetadataHelperService: ModelMetadataHelperService,\n readonly moduleRef: ModuleRef\n ) {\n super(entityManager, repo, 'viewMetadata', 'solid-core', moduleRef);\n }\n\n private readonly logger = new Logger(ViewMetadataService.name);\n\n //for locales \n private async getEntityRecordsInAllLocales(\n modelName: string,\n id: string,\n defaultEntityLocaleIdFromQuery?: string\n ): Promise<{ records: any[], defaultEntityLocaleId: string | null }> {\n const solidRegistry = await this.moduleRef.get(SolidRegistry, { strict: false });\n // const currentEntityTarget = solidRegistry.getEntityTarget(this.entityManager, classify(modelName));\n const currentEntityRepository = this.entityManager.getRepository(classify(modelName));\n\n // Case 1: Creating a new record with no defaultEntityLocaleId to clone\n if (id === 'new' && !defaultEntityLocaleIdFromQuery) {\n this.logger.debug(`Creating new record without cloning from any defaultEntityLocaleId.`);\n return { records: [], defaultEntityLocaleId: null };\n }\n\n // Case 2: Creating a new record and cloning from an existing defaultEntityLocaleId\n if (id === 'new' && defaultEntityLocaleIdFromQuery) {\n this.logger.debug(`Creating new record by cloning translations from defaultEntityLocaleId: ${defaultEntityLocaleIdFromQuery}`);\n\n const records = await currentEntityRepository.find({\n where: [\n { defaultEntityLocaleId: defaultEntityLocaleIdFromQuery },\n { id: defaultEntityLocaleIdFromQuery }\n ]\n });\n\n this.logger.debug(`Found ${records.length} cloned records for new entity.`);\n return { records, defaultEntityLocaleId: defaultEntityLocaleIdFromQuery };\n }\n\n // Case 3: Editing an existing entity\n const entityRecord = await currentEntityRepository.findOne({ where: { id } });\n\n if (!entityRecord) {\n this.logger.warn(`No entity found for id ${id}`);\n return { records: [], defaultEntityLocaleId: null };\n }\n\n const defaultLocale = await this.entityManager.getRepository(Locale).findOne({ where: { isDefault: true } });\n\n let defaultEntityLocaleId: string;\n if (entityRecord.localeName === defaultLocale?.locale) {\n defaultEntityLocaleId = entityRecord.id;\n this.logger.debug(`Editing default locale record with id ${defaultEntityLocaleId}`);\n } else {\n defaultEntityLocaleId = entityRecord.defaultEntityLocaleId;\n this.logger.debug(`Editing non-default locale record. DefaultEntityLocaleId: ${defaultEntityLocaleId}`);\n }\n\n const records = await currentEntityRepository.find({\n where: [\n { defaultEntityLocaleId: defaultEntityLocaleId },\n { id: defaultEntityLocaleId }\n ]\n });\n\n this.logger.debug(`Found ${records.length} records in all locales for existing entity.`);\n\n return { records, defaultEntityLocaleId };\n }\n\n // START: Custom Service Methods\n async getLayout(query, activeUser) {\n let { modelName, moduleName, viewType, id, populate, menuItemId, menuItemName, actionId, actionName } = query;\n\n // 1. Fetch the action based on actionId.\n const solidRequestContext = {\n activeUser: activeUser\n }\n const actionQuery = {\n populate: [\"view\"]\n }\n let action = null;\n if (actionId) {\n action = await this.actionMetadataService.findOne(actionId, actionQuery, solidRequestContext);\n }\n\n // 2. Fetch the menu based on menuItemId.\n const menuItemQuery = {\n populate: ['action', 'action.model', 'module']\n }\n let menuItem: MenuItemMetadata = null;\n if (menuItemId) {\n menuItem = await this.menuItemMetadataService.findOne(menuItemId, menuItemQuery, solidRequestContext);\n }\n\n let viewModes = [];\n const menuItemModelId = menuItem?.action?.model?.id;\n const menuItemModuleId = menuItem?.module?.id;\n if (menuItemModelId && menuItemModuleId) {\n const actionQb = await this.actionMetadataService.repo.createSecurityRuleAwareQueryBuilder('action');\n const actionsForViewModes = await actionQb\n .leftJoinAndSelect('action.model', 'model')\n .leftJoinAndSelect('action.module', 'module')\n .leftJoinAndSelect('action.view', 'view')\n .where('model.id = :modelId', { modelId: menuItemModelId })\n .andWhere('module.id = :moduleId', { moduleId: menuItemModuleId })\n .andWhere('view.type IN (:...viewTypes)', { viewTypes: ['card', 'list', 'kanban', 'tree'] })\n .getMany();\n\n viewModes = actionsForViewModes.map(actionItem => ({\n type: actionItem.view?.type ?? '',\n menuItemId: menuItem.id,\n menuItemName: menuItem.displayName,\n actionId: actionItem.id ?? '',\n actionName: actionItem.displayName ?? '',\n }));\n }\n\n const viewId = action?.view?.id\n // 3. Fetch the view based on module, model & view name.\n const entity = await this.repo.findOne({\n where: {\n model: { singularName: modelName },\n module: { name: moduleName },\n ...(actionId && viewId ? { id: action.view.id } : { type: viewType })\n },\n relations: {\n model: {\n userKeyField: true,\n },\n module: true,\n }\n });\n\n if (!entity) {\n throw new BadRequestException(`Unable to identify view for module: ${moduleName}, model: ${modelName} and viewType: ${viewType}`);\n }\n if (!activeUser?.sub) {\n throw new BadRequestException(`Unable to identify user for module: ${moduleName}, model: ${modelName} and viewType: ${viewType}`);\n }\n\n // 4. add action and menuItem to Entity which is our solid View\n if (actionId) {\n delete action.view;\n entity['action'] = action\n }\n if (menuItemId) {\n entity['menu'] = menuItem\n }\n\n // 5. See if we have a user specific layout for this view.\n const userLayout = await this.userViewMetadataService.repo.findOne({\n where: {\n user: { id: activeUser?.sub },\n viewMetadata: { id: entity.id },\n },\n });\n // Based on where we found the layout we are converting it from string to json.\n if (userLayout) {\n entity.layout = JSON.parse(userLayout.layout);\n } else {\n entity.layout = JSON.parse(entity.layout);\n }\n\n // 6. We are resolving the create & edit actions if specified in the layout.\n if (entity?.layout?.attrs?.createAction) {\n const actionName: string = entity.layout.attrs.createAction;\n entity.layout.attrs.createAction = await this.actionMetadataService.findOneByUserKey(actionName)\n }\n if (entity?.layout?.attrs?.editAction) {\n const actionName: string = entity.layout.attrs.editAction;\n entity.layout.attrs.editAction = await this.actionMetadataService.findOneByUserKey(actionName)\n }\n\n // 7. For form views we need to fetch the workflow field metadata if specified.\n let workflowFieldName = null;\n let workflowField = null;\n if (viewType === 'form') {\n workflowFieldName = entity.layout?.attrs?.workflowField;\n }\n\n // 8. Create an easy to use map of field metadata, rather than sending an array of fields it becomes easier to use in the frontend.\n const fields = await this.modelMetadataHelperService.loadFieldHierarchy(modelName);\n const fieldsMap = new Map<string, FieldMetadata>();\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i];\n\n // We need to identify the workflowField metadata if specified. \n if (workflowFieldName && field.name === workflowFieldName) {\n workflowField = field;\n }\n\n // For fields of type relation & relationType many-to-one\n // We fetch metadata regarding the relationCoModelSingularName\n if (field.type === 'relation') {\n const relationModel = await this.modelMetadataRepo.find({\n where: {\n singularName: field.relationCoModelSingularName\n },\n relations: {\n userKeyField: true\n }\n });\n\n if (relationModel) {\n field['relationModel'] = relationModel[0];\n }\n }\n if (!fieldsMap.has(field.name)) {\n fieldsMap.set(field.name, field);\n }\n }\n\n // 9. Use the resolved workflowField to populate workflow specific metadata.\n // Check if we were able to resolve an actual workflowField.\n let solidFormViewWorkflowData = [];\n if (viewType === 'form' && workflowField) {\n // check for type of workflow field. \n // for workflowFields of type selectionStatic we simply return the key/values from field metadata AS-IS\n if (workflowField.type === 'selectionStatic') {\n solidFormViewWorkflowData = workflowField.selectionStaticValues.map(item => {\n const [value, label] = item.split(\":\");\n return { label, value };\n });\n }\n // for workflowFields of type relation.many-to-one we need to query the co-model, and return data in key/value format.\n if (workflowField.type === 'relation' && workflowField.relationType === 'many-to-one') {\n const comodelCrudService = this.introspectService.getCRUDService(workflowField.relationCoModelSingularName);\n const data = await comodelCrudService.find({ limit: 100, offset: 0, });\n const records = data.records ?? [];\n const workflowFieldMetadata = fieldsMap.get(workflowFieldName);\n const workflowFielUserkey = workflowFieldMetadata['relationModel']['userKeyField']['name'];\n\n // iterate over the comodel records extracting the label & value. \n solidFormViewWorkflowData = records.map(item => ({ 'label': item[workflowFielUserkey], 'value': item['id'] }))\n }\n }\n\n // 10. If this model supports internationalisation, we need to load the locales applicable with the id of an actual record for each locale if present.\n // This is the shape of locales that will be returned \n /**\n * [\n * {locale: 'en', displayName: 'English', isDefault: 'yes', defaultEntityLocaleId: '', entityId: '1'}, \n * {locale: 'en-IN', displayName: 'English (India)', isDefault: 'no', defaultEntityLocaleId: '1', entityId: '2'}, \n * {locale: 'en-SG', displayName: 'English (Singapore)', isDefault: 'no', defaultEntityLocaleId: '', entityId: '3'}, \n * {locale: 'fr', displayName: 'French', isDefault: 'no', defaultEntityLocaleId: '', entityId: ''}\n * ]\n */\n\n const applicableLocales: any = []\n // if (entity.model.internationalisation) {\n // const allLocales = await this.entityManager.getRepository(Locale).find({});\n\n // if (id === 'new') {\n // allLocales.forEach(locale => {\n // applicableLocales.push({\n // locale: locale.locale,\n // displayName: locale.displayName,\n // isDefault: locale.isDefault ? 'yes' : 'no',\n // defaultEntityLocaleId: null,\n // entityId: null\n // });\n // });\n // }\n // else {\n // const defaultLocale = allLocales.find(locale => locale.isDefault);\n // this.logger.debug(`Default locale is: ${defaultLocale.locale}`);\n\n // // Get hold of the repository for the current model\n // const solidRegistry = await this.moduleRef.get(SolidRegistry, { strict: false });\n // const currentEntityTarget = solidRegistry.getEntityTarget(this.entityManager, classify(modelName));\n // const currentEntityRepository = this.entityManager.getRepository(currentEntityTarget);\n\n // // We are in edit mode, the id that is being edited could be a record tagged with the default locale or it could be tagged with a non-default locale.\n // const entityRecord = await currentEntityRepository.findOne({\n // where: {\n // id: id,\n // }\n // });\n // if(entityRecord){\n // // Resolve the default entity locale id....\n // let defaultEntityLocaleId = null;\n // if (entityRecord.localeName === defaultLocale.locale) {\n // defaultEntityLocaleId = entityRecord.id;\n // this.logger.debug(`You are editing a record tagged with the default locale: ${entityRecord.localeName}.`);\n // }\n // else {\n // defaultEntityLocaleId = entityRecord.defaultEntityLocaleId;\n // this.logger.debug(`You are editing a record tagged with the non-default locale: ${entityRecord.localeName}. `);\n // }\n // this.logger.debug(`Identified default Entity Locale Id: ${defaultEntityLocaleId}`);\n\n // // Now we query for all records in the same model matching the defaultEntityLocaleId\n // // Get all records mathcing the defaultEntityLocaleId or where the id is same as the defaultEntityLocaleId\n // const entityRecordsInAllLocales = await currentEntityRepository.find({\n // where: [\n // { defaultEntityLocaleId: defaultEntityLocaleId },\n // { id: defaultEntityLocaleId }\n // ],\n // });\n // this.logger.debug(`Found ${entityRecordsInAllLocales.length} records in all locales for the defaultEntityLocaleId: ${defaultEntityLocaleId}`);\n\n // // Loop over all locales and populate the applicableLocales array\n // for (const locale of allLocales) {\n // // Find the record in the entityRecordsInAllLocales that matches the current locale\n // const matchingRecord = entityRecordsInAllLocales.find(record => record.localeName === locale.locale);\n\n // applicableLocales.push({\n // locale: locale.locale,\n // displayName: locale.displayName,\n // isDefault: locale.isDefault ? 'yes' : 'no',\n // defaultEntityLocaleId: defaultEntityLocaleId,\n // entityId: (matchingRecord ? matchingRecord.id : null)\n // });\n // }\n // }else{\n // this.logger.warn(`No record found for id: ${id} in model: ${modelName}. Cannot determine applicable locales.`);\n // }\n // }\n // }\n if (entity.model.internationalisation) {\n const defaultEntityLocaleIdFromQuery = query?.defaultEntityLocaleId;\n const { records: entityRecordsInAllLocales, defaultEntityLocaleId } =\n await this.getEntityRecordsInAllLocales(modelName, id, defaultEntityLocaleIdFromQuery);\n const allLocales = await this.entityManager.getRepository(Locale).find({});\n for (const locale of allLocales) {\n const matchingRecord = entityRecordsInAllLocales.find(record => record.localeName === locale.locale);\n applicableLocales.push({\n locale: locale.locale,\n displayName: locale.displayName,\n isDefault: locale.isDefault ? 'yes' : 'no',\n defaultEntityLocaleId: defaultEntityLocaleId,\n entityId: matchingRecord ? matchingRecord.id : null\n });\n }\n }\n\n const r = {\n 'solidView': entity,\n 'solidFieldsMetadata': Object.fromEntries(fieldsMap),\n 'solidFormViewWorkflowData': solidFormViewWorkflowData,\n 'applicableLocales': applicableLocales,\n 'viewModes': viewModes\n }\n\n return r;\n }\n\n private async loadFieldHierarchy(modelName: any) {\n const model = await this.modelMetadataRepo.findOne({\n where: {\n singularName: modelName,\n },\n relations: {\n fields: true,\n parentModel: {\n fields: true,\n }\n }\n });\n const fields = [];\n if (model) {\n // Add the fields of the current model\n fields.push(...model.fields);\n\n // Add the fields of the parent model\n if (model.parentModel) {\n fields.push(...model.parentModel.fields);\n }\n }\n return fields;\n }\n\n async findOneByUserKey(name: string, relations = {}) {\n const entity = await this.repo.findOne({\n where: {\n name: name,\n },\n relations: relations,\n });\n return entity;\n }\n\n async upsert(updateSolidViewDto: UpdateViewMetadataDto) {\n // First check if module already exists using name\n const existingSolidView = await this.findOneByUserKey(updateSolidViewDto.name);\n\n // if found\n if (existingSolidView) {\n const updatedSolidViewDto = { ...existingSolidView, ...updateSolidViewDto };\n return this.repo.save(updatedSolidViewDto);\n }\n // if not found - create new \n else {\n const viewData = this.repo.create(updateSolidViewDto);\n return this.repo.save(viewData);\n }\n }\n\n async createIfNotPresent(updateSolidViewDto: UpdateViewMetadataDto) {\n // First check if module already exists using name\n const existingSolidView = await this.findOneByUserKey(updateSolidViewDto.name);\n\n // if found\n if (existingSolidView) {\n }\n // if not found - create new \n else {\n const viewData = this.repo.create(updateSolidViewDto);\n return this.repo.save(viewData);\n }\n }\n\n // END: Custom Service Methods\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"view-metadata.service.js","sourceRoot":"","sources":["../../src/services/view-metadata.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA6F;AAC7F,uCAAyC;AACzC,6CAAsD;AACtD,iDAAwD;AACxD,qCAAwC;AAExC,4DAAoD;AACpD,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AE,GAAG,kBAAkB,EAAE,CAAC;YAC5E,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC7C,CAAC;aAEI,CAAC;YACJ,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,kBAAyC;QAEhE,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAG/E,IAAI,iBAAiB,EAAE,CAAC;QACxB,CAAC;aAEI,CAAC;YACJ,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CAIF,CAAA;AAhcY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAOR,WAAA,IAAA,6BAAmB,GAAE,CAAA;IAQrB,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,mDAAuB,CAAC,CAAC,CAAA;qCAZlB,+CAAqB;QACnB,oDAAuB;QAC7B,iDAAsB;QAChB,oDAAuB;QAEjC,uBAAa;QAEtB,iDAAsB;QAMD,mDAAuB;QACd,0DAA0B;QACnD,gBAAS;GAjBpB,mBAAmB,CAgc/B","sourcesContent":["import { BadRequestException, forwardRef, Inject, Injectable, Logger } from '@nestjs/common';\nimport { ModuleRef } from \"@nestjs/core\";\nimport { InjectEntityManager } from '@nestjs/typeorm';\nimport { CRUDService } from 'src/services/crud.service';\nimport { EntityManager } from 'typeorm';\n\nimport { classify } from '../helpers/string.helper';\nimport { Locale } from 'src/entities/locale.entity';\nimport { ModelMetadataHelperService } from 'src/helpers/model-metadata-helper.service';\nimport { SolidRegistry } from 'src/helpers/solid-registry';\nimport { ModelMetadataRepository } from 'src/repository/model-metadata.repository';\nimport { ViewMetadataRepository } from 'src/repository/view-metadata.repository';\nimport { UpdateViewMetadataDto } from '../dtos/update-view-metadata.dto';\nimport { FieldMetadata } from '../entities/field-metadata.entity';\nimport { ViewMetadata } from '../entities/view-metadata.entity';\nimport { ActionMetadataService } from './action-metadata.service';\nimport { MenuItemMetadataService } from './menu-item-metadata.service';\nimport { SolidIntrospectService } from './solid-introspect.service';\nimport { UserViewMetadataService } from './user-view-metadata.service';\nimport { MenuItemMetadata } from 'src/entities/menu-item-metadata.entity';\n\n@Injectable()\nexport class ViewMetadataService extends CRUDService<ViewMetadata> {\n constructor(\n readonly actionMetadataService: ActionMetadataService,\n readonly menuItemMetadataService: MenuItemMetadataService,\n readonly introspectService: SolidIntrospectService,\n readonly userViewMetadataService: UserViewMetadataService,\n @InjectEntityManager()\n readonly entityManager: EntityManager,\n // @InjectRepository(ViewMetadata, 'default')\n readonly repo: ViewMetadataRepository,\n // @InjectRepository(FieldMetadata)\n // private readonly fieldMetadataRepo: Repository<FieldMetadata>,\n // @InjectRepository(ModelMetadata)\n // private readonly modelMetadataRepo: Repository<ModelMetadata>,\n @Inject(forwardRef(() => ModelMetadataRepository))\n private readonly modelMetadataRepo: ModelMetadataRepository,\n private readonly modelMetadataHelperService: ModelMetadataHelperService,\n readonly moduleRef: ModuleRef\n ) {\n super(entityManager, repo, 'viewMetadata', 'solid-core', moduleRef);\n }\n\n private readonly logger = new Logger(ViewMetadataService.name);\n\n //for locales \n private async getEntityRecordsInAllLocales(\n modelName: string,\n id: string,\n defaultEntityLocaleIdFromQuery?: string\n ): Promise<{ records: any[], defaultEntityLocaleId: string | null }> {\n const solidRegistry = await this.moduleRef.get(SolidRegistry, { strict: false });\n // const currentEntityTarget = solidRegistry.getEntityTarget(this.entityManager, classify(modelName));\n const currentEntityRepository = this.entityManager.getRepository(classify(modelName));\n\n // Case 1: Creating a new record with no defaultEntityLocaleId to clone\n if (id === 'new' && !defaultEntityLocaleIdFromQuery) {\n this.logger.debug(`Creating new record without cloning from any defaultEntityLocaleId.`);\n return { records: [], defaultEntityLocaleId: null };\n }\n\n // Case 2: Creating a new record and cloning from an existing defaultEntityLocaleId\n if (id === 'new' && defaultEntityLocaleIdFromQuery) {\n this.logger.debug(`Creating new record by cloning translations from defaultEntityLocaleId: ${defaultEntityLocaleIdFromQuery}`);\n\n const records = await currentEntityRepository.find({\n where: [\n { defaultEntityLocaleId: defaultEntityLocaleIdFromQuery },\n { id: defaultEntityLocaleIdFromQuery }\n ]\n });\n\n this.logger.debug(`Found ${records.length} cloned records for new entity.`);\n return { records, defaultEntityLocaleId: defaultEntityLocaleIdFromQuery };\n }\n\n // Case 3: Editing an existing entity\n const entityRecord = await currentEntityRepository.findOne({ where: { id } });\n\n if (!entityRecord) {\n this.logger.warn(`No entity found for id ${id}`);\n return { records: [], defaultEntityLocaleId: null };\n }\n\n const defaultLocale = await this.entityManager.getRepository(Locale).findOne({ where: { isDefault: true } });\n\n let defaultEntityLocaleId: string;\n if (entityRecord.localeName === defaultLocale?.locale) {\n defaultEntityLocaleId = entityRecord.id;\n this.logger.debug(`Editing default locale record with id ${defaultEntityLocaleId}`);\n } else {\n defaultEntityLocaleId = entityRecord.defaultEntityLocaleId;\n this.logger.debug(`Editing non-default locale record. DefaultEntityLocaleId: ${defaultEntityLocaleId}`);\n }\n\n const records = await currentEntityRepository.find({\n where: [\n { defaultEntityLocaleId: defaultEntityLocaleId },\n { id: defaultEntityLocaleId }\n ]\n });\n\n this.logger.debug(`Found ${records.length} records in all locales for existing entity.`);\n\n return { records, defaultEntityLocaleId };\n }\n\n // START: Custom Service Methods\n async getLayout(query, activeUser) {\n let { modelName, moduleName, viewType, id, populate, menuItemId, menuItemName, actionId, actionName } = query;\n\n // 1. Fetch the action based on actionId.\n const solidRequestContext = {\n activeUser: activeUser\n }\n const actionQuery = {\n populate: [\"view\"]\n }\n let action = null;\n if (actionId) {\n action = await this.actionMetadataService.findOne(actionId, actionQuery, solidRequestContext);\n }\n\n // 2. Fetch the menu based on menuItemId.\n const menuItemQuery = {\n populate: ['action', 'action.model', 'module']\n }\n let menuItem: MenuItemMetadata = null;\n if (menuItemId) {\n menuItem = await this.menuItemMetadataService.findOne(menuItemId, menuItemQuery, solidRequestContext);\n }\n\n let viewModes = [];\n const menuItemModelId = menuItem?.action?.model?.id;\n const menuItemModuleId = menuItem?.module?.id;\n const collectionViewTypes = ['card', 'list', 'kanban', 'tree'];\n if (menuItemModelId && menuItemModuleId) {\n const actionQb = await this.actionMetadataService.repo.createSecurityRuleAwareQueryBuilder('action');\n const actionsForViewModes = await actionQb\n .leftJoinAndSelect('action.model', 'model')\n .leftJoinAndSelect('action.module', 'module')\n .leftJoinAndSelect('action.view', 'view')\n .where('model.id = :modelId', { modelId: menuItemModelId })\n .andWhere('module.id = :moduleId', { moduleId: menuItemModuleId })\n .andWhere('view.type IN (:...viewTypes)', { viewTypes: collectionViewTypes })\n .getMany();\n\n const canonicalActionsByViewType = new Map();\n for (const actionItem of actionsForViewModes) {\n const resolvedViewType = actionItem.view?.type;\n if (!resolvedViewType || canonicalActionsByViewType.has(resolvedViewType)) {\n continue;\n }\n canonicalActionsByViewType.set(resolvedViewType, actionItem);\n }\n\n if (action?.view?.type && collectionViewTypes.includes(action.view.type) && action?.id) {\n canonicalActionsByViewType.set(action.view.type, action);\n }\n\n viewModes = collectionViewTypes\n .map((resolvedViewType) => canonicalActionsByViewType.get(resolvedViewType))\n .filter(Boolean)\n .map(actionItem => ({\n type: actionItem.view?.type ?? '',\n menuItemId: menuItem.id,\n menuItemName: menuItem.displayName,\n actionId: actionItem.id ?? '',\n actionName: actionItem.displayName ?? '',\n }));\n }\n\n const viewId = action?.view?.id\n // 3. Fetch the view based on module, model & view name.\n const entity = await this.repo.findOne({\n where: {\n model: { singularName: modelName },\n module: { name: moduleName },\n ...(actionId && viewId ? { id: action.view.id } : { type: viewType })\n },\n relations: {\n model: {\n userKeyField: true,\n },\n module: true,\n }\n });\n\n if (!entity) {\n throw new BadRequestException(`Unable to identify view for module: ${moduleName}, model: ${modelName} and viewType: ${viewType}`);\n }\n if (!activeUser?.sub) {\n throw new BadRequestException(`Unable to identify user for module: ${moduleName}, model: ${modelName} and viewType: ${viewType}`);\n }\n\n // 4. add action and menuItem to Entity which is our solid View\n if (actionId) {\n delete action.view;\n entity['action'] = action\n }\n if (menuItemId) {\n entity['menu'] = menuItem\n }\n\n // 5. See if we have a user specific layout for this view.\n const userLayout = await this.userViewMetadataService.repo.findOne({\n where: {\n user: { id: activeUser?.sub },\n viewMetadata: { id: entity.id },\n },\n });\n // Based on where we found the layout we are converting it from string to json.\n if (userLayout) {\n entity.layout = JSON.parse(userLayout.layout);\n } else {\n entity.layout = JSON.parse(entity.layout);\n }\n\n // 6. We are resolving the create & edit actions if specified in the layout.\n if (entity?.layout?.attrs?.createAction) {\n const actionName: string = entity.layout.attrs.createAction;\n entity.layout.attrs.createAction = await this.actionMetadataService.findOneByUserKey(actionName)\n }\n if (entity?.layout?.attrs?.editAction) {\n const actionName: string = entity.layout.attrs.editAction;\n entity.layout.attrs.editAction = await this.actionMetadataService.findOneByUserKey(actionName)\n }\n\n // 7. For form views we need to fetch the workflow field metadata if specified.\n let workflowFieldName = null;\n let workflowField = null;\n if (viewType === 'form') {\n workflowFieldName = entity.layout?.attrs?.workflowField;\n }\n\n // 8. Create an easy to use map of field metadata, rather than sending an array of fields it becomes easier to use in the frontend.\n const fields = await this.modelMetadataHelperService.loadFieldHierarchy(modelName);\n const fieldsMap = new Map<string, FieldMetadata>();\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i];\n\n // We need to identify the workflowField metadata if specified. \n if (workflowFieldName && field.name === workflowFieldName) {\n workflowField = field;\n }\n\n // For fields of type relation & relationType many-to-one\n // We fetch metadata regarding the relationCoModelSingularName\n if (field.type === 'relation') {\n const relationModel = await this.modelMetadataRepo.find({\n where: {\n singularName: field.relationCoModelSingularName\n },\n relations: {\n userKeyField: true\n }\n });\n\n if (relationModel) {\n field['relationModel'] = relationModel[0];\n }\n }\n if (!fieldsMap.has(field.name)) {\n fieldsMap.set(field.name, field);\n }\n }\n\n // 9. Use the resolved workflowField to populate workflow specific metadata.\n // Check if we were able to resolve an actual workflowField.\n let solidFormViewWorkflowData = [];\n if (viewType === 'form' && workflowField) {\n // check for type of workflow field. \n // for workflowFields of type selectionStatic we simply return the key/values from field metadata AS-IS\n if (workflowField.type === 'selectionStatic') {\n solidFormViewWorkflowData = workflowField.selectionStaticValues.map(item => {\n const [value, label] = item.split(\":\");\n return { label, value };\n });\n }\n // for workflowFields of type relation.many-to-one we need to query the co-model, and return data in key/value format.\n if (workflowField.type === 'relation' && workflowField.relationType === 'many-to-one') {\n const comodelCrudService = this.introspectService.getCRUDService(workflowField.relationCoModelSingularName);\n const data = await comodelCrudService.find({ limit: 100, offset: 0, });\n const records = data.records ?? [];\n const workflowFieldMetadata = fieldsMap.get(workflowFieldName);\n const workflowFielUserkey = workflowFieldMetadata['relationModel']['userKeyField']['name'];\n\n // iterate over the comodel records extracting the label & value. \n solidFormViewWorkflowData = records.map(item => ({ 'label': item[workflowFielUserkey], 'value': item['id'] }))\n }\n }\n\n // 10. If this model supports internationalisation, we need to load the locales applicable with the id of an actual record for each locale if present.\n // This is the shape of locales that will be returned \n /**\n * [\n * {locale: 'en', displayName: 'English', isDefault: 'yes', defaultEntityLocaleId: '', entityId: '1'}, \n * {locale: 'en-IN', displayName: 'English (India)', isDefault: 'no', defaultEntityLocaleId: '1', entityId: '2'}, \n * {locale: 'en-SG', displayName: 'English (Singapore)', isDefault: 'no', defaultEntityLocaleId: '', entityId: '3'}, \n * {locale: 'fr', displayName: 'French', isDefault: 'no', defaultEntityLocaleId: '', entityId: ''}\n * ]\n */\n\n const applicableLocales: any = []\n // if (entity.model.internationalisation) {\n // const allLocales = await this.entityManager.getRepository(Locale).find({});\n\n // if (id === 'new') {\n // allLocales.forEach(locale => {\n // applicableLocales.push({\n // locale: locale.locale,\n // displayName: locale.displayName,\n // isDefault: locale.isDefault ? 'yes' : 'no',\n // defaultEntityLocaleId: null,\n // entityId: null\n // });\n // });\n // }\n // else {\n // const defaultLocale = allLocales.find(locale => locale.isDefault);\n // this.logger.debug(`Default locale is: ${defaultLocale.locale}`);\n\n // // Get hold of the repository for the current model\n // const solidRegistry = await this.moduleRef.get(SolidRegistry, { strict: false });\n // const currentEntityTarget = solidRegistry.getEntityTarget(this.entityManager, classify(modelName));\n // const currentEntityRepository = this.entityManager.getRepository(currentEntityTarget);\n\n // // We are in edit mode, the id that is being edited could be a record tagged with the default locale or it could be tagged with a non-default locale.\n // const entityRecord = await currentEntityRepository.findOne({\n // where: {\n // id: id,\n // }\n // });\n // if(entityRecord){\n // // Resolve the default entity locale id....\n // let defaultEntityLocaleId = null;\n // if (entityRecord.localeName === defaultLocale.locale) {\n // defaultEntityLocaleId = entityRecord.id;\n // this.logger.debug(`You are editing a record tagged with the default locale: ${entityRecord.localeName}.`);\n // }\n // else {\n // defaultEntityLocaleId = entityRecord.defaultEntityLocaleId;\n // this.logger.debug(`You are editing a record tagged with the non-default locale: ${entityRecord.localeName}. `);\n // }\n // this.logger.debug(`Identified default Entity Locale Id: ${defaultEntityLocaleId}`);\n\n // // Now we query for all records in the same model matching the defaultEntityLocaleId\n // // Get all records mathcing the defaultEntityLocaleId or where the id is same as the defaultEntityLocaleId\n // const entityRecordsInAllLocales = await currentEntityRepository.find({\n // where: [\n // { defaultEntityLocaleId: defaultEntityLocaleId },\n // { id: defaultEntityLocaleId }\n // ],\n // });\n // this.logger.debug(`Found ${entityRecordsInAllLocales.length} records in all locales for the defaultEntityLocaleId: ${defaultEntityLocaleId}`);\n\n // // Loop over all locales and populate the applicableLocales array\n // for (const locale of allLocales) {\n // // Find the record in the entityRecordsInAllLocales that matches the current locale\n // const matchingRecord = entityRecordsInAllLocales.find(record => record.localeName === locale.locale);\n\n // applicableLocales.push({\n // locale: locale.locale,\n // displayName: locale.displayName,\n // isDefault: locale.isDefault ? 'yes' : 'no',\n // defaultEntityLocaleId: defaultEntityLocaleId,\n // entityId: (matchingRecord ? matchingRecord.id : null)\n // });\n // }\n // }else{\n // this.logger.warn(`No record found for id: ${id} in model: ${modelName}. Cannot determine applicable locales.`);\n // }\n // }\n // }\n if (entity.model.internationalisation) {\n const defaultEntityLocaleIdFromQuery = query?.defaultEntityLocaleId;\n const { records: entityRecordsInAllLocales, defaultEntityLocaleId } =\n await this.getEntityRecordsInAllLocales(modelName, id, defaultEntityLocaleIdFromQuery);\n const allLocales = await this.entityManager.getRepository(Locale).find({});\n for (const locale of allLocales) {\n const matchingRecord = entityRecordsInAllLocales.find(record => record.localeName === locale.locale);\n applicableLocales.push({\n locale: locale.locale,\n displayName: locale.displayName,\n isDefault: locale.isDefault ? 'yes' : 'no',\n defaultEntityLocaleId: defaultEntityLocaleId,\n entityId: matchingRecord ? matchingRecord.id : null\n });\n }\n }\n\n const r = {\n 'solidView': entity,\n 'solidFieldsMetadata': Object.fromEntries(fieldsMap),\n 'solidFormViewWorkflowData': solidFormViewWorkflowData,\n 'applicableLocales': applicableLocales,\n 'viewModes': viewModes\n }\n\n return r;\n }\n\n private async loadFieldHierarchy(modelName: any) {\n const model = await this.modelMetadataRepo.findOne({\n where: {\n singularName: modelName,\n },\n relations: {\n fields: true,\n parentModel: {\n fields: true,\n }\n }\n });\n const fields = [];\n if (model) {\n // Add the fields of the current model\n fields.push(...model.fields);\n\n // Add the fields of the parent model\n if (model.parentModel) {\n fields.push(...model.parentModel.fields);\n }\n }\n return fields;\n }\n\n async findOneByUserKey(name: string, relations = {}) {\n const entity = await this.repo.findOne({\n where: {\n name: name,\n },\n relations: relations,\n });\n return entity;\n }\n\n async upsert(updateSolidViewDto: UpdateViewMetadataDto) {\n // First check if module already exists using name\n const existingSolidView = await this.findOneByUserKey(updateSolidViewDto.name);\n\n // if found\n if (existingSolidView) {\n const updatedSolidViewDto = { ...existingSolidView, ...updateSolidViewDto };\n return this.repo.save(updatedSolidViewDto);\n }\n // if not found - create new \n else {\n const viewData = this.repo.create(updateSolidViewDto);\n return this.repo.save(viewData);\n }\n }\n\n async createIfNotPresent(updateSolidViewDto: UpdateViewMetadataDto) {\n // First check if module already exists using name\n const existingSolidView = await this.findOneByUserKey(updateSolidViewDto.name);\n\n // if found\n if (existingSolidView) {\n }\n // if not found - create new \n else {\n const viewData = this.repo.create(updateSolidViewDto);\n return this.repo.save(viewData);\n }\n }\n\n // END: Custom Service Methods\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solid-core.module.d.ts","sourceRoot":"","sources":["../src/solid-core.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,kBAAkB,EAAU,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAyYhF,qBA6ea,eAAgB,YAAW,UAAU;IAChD,SAAS,CAAC,QAAQ,EAAE,kBAAkB;CAQvC"}
|
|
1
|
+
{"version":3,"file":"solid-core.module.d.ts","sourceRoot":"","sources":["../src/solid-core.module.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,CAAC;AAChB,OAAO,EAAU,kBAAkB,EAAU,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAyYhF,qBA6ea,eAAgB,YAAW,UAAU;IAChD,SAAS,CAAC,QAAQ,EAAE,kBAAkB;CAQvC"}
|
|
@@ -40,6 +40,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
40
40
|
})();
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
exports.SolidCoreModule = void 0;
|
|
43
|
+
require("multer");
|
|
43
44
|
const common_1 = require("@nestjs/common");
|
|
44
45
|
const express = __importStar(require("express"));
|
|
45
46
|
const config_1 = require("@nestjs/config");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solid-core.module.js","sourceRoot":"","sources":["../src/solid-core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mB;YACnB,4BAAY;YACZ,6CAAoB;YACpB,sBAAe;YACf,oBAAa;YACb,yBAAkB;YAClB,6BAAsB;YACtB,2BAAoB;YACpB,gCAAyB;YACzB,kBAAU;YACV,qDAAwB;YACxB,4CAAmB;YACnB,0BAAW;YACX,kCAAe;YACf,wBAAU;YACV,4BAAY;YACZ,6EAAmC;YACnC,0DAA0B;YAC1B,6CAAoB;YACpB,+CAAqB;YACrB,gDAAqB;YACrB,qCAAgB;YAChB,iCAAe;YACf,iCAAe;YACf,2CAAoB;YACpB,+BAAY;YACZ,wBAAU;YACV,8BAAa;YACb,4CAAgB;YAChB,2CAAmB;YACnB,6CAAoB;YACpB,+CAAqB;YACrB,wCAAoB;YACpB,iDAAsB;YACtB,yCAAkB;YAClB,qCAAgB;YAChB,iDAAsB;YACtB,8BAAa;YACb,kCAAe;YACf,iCAAc;YACd,mCAAgB;YAChB,uBAAa;YACb,0DAA0B;YAC1B,4CAAoB;YACpB,6DAAwB;YACxB,0BAAW;YACX,gCAAc;SACf;KACF,CAAC;GACW,eAAe,CAS3B","sourcesContent":["import { Global, MiddlewareConsumer, Module, NestModule } from '@nestjs/common';\nimport * as express from 'express';\nimport { ConfigModule, ConfigService } from '@nestjs/config';\nimport {\n APP_FILTER,\n APP_GUARD,\n APP_INTERCEPTOR,\n DiscoveryService,\n MetadataScanner,\n Reflector,\n} from '@nestjs/core';\nimport { MulterModule } from '@nestjs/platform-express';\nimport { TypeOrmModule } from '@nestjs/typeorm';\nimport { RemoveFieldsCommand } from './commands/remove-fields.command';\nimport { FieldMetadataController } from './controllers/field-metadata.controller';\nimport { MediaStorageProviderMetadataController } from './controllers/media-storage-provider-metadata.controller';\nimport { ModelMetadataController } from './controllers/model-metadata.controller';\nimport { ModuleMetadataController } from './controllers/module-metadata.controller';\nimport { TestController } from './controllers/test.controller';\nimport { FieldMetadata } from './entities/field-metadata.entity';\nimport { ListOfValues } from './entities/list-of-values.entity';\nimport { MediaStorageProviderMetadata } from './entities/media-storage-provider-metadata.entity';\nimport { Media } from './entities/media.entity';\nimport { ModelMetadata } from './entities/model-metadata.entity';\nimport { ModuleMetadata } from './entities/module-metadata.entity';\nimport { CommandService } from './helpers/command.service';\nimport { SchematicService } from './helpers/schematic.service';\nimport { ListOfValuesSelectionProvider } from './services/selection-providers/list-of-values-selection-providers.service';\nimport { PseudoForeignKeySelectionProvider } from './services/selection-providers/pseudo-foreign-key-selection-provider.service';\nimport { ModuleMetadataSeederService } from './seeders/module-metadata-seeder.service';\nimport { ModuleTestDataService } from './seeders/module-test-data.service';\nimport { CrudHelperService } from './services/crud-helper.service';\nimport { FieldMetadataService } from './services/field-metadata.service';\nimport { ListOfValuesService } from './services/list-of-values.service';\n// import { MediaStorageProviderMetadataSeederService } from './services/media-storage-provider-metadata-seeder.service';\nimport { MediaStorageProviderMetadataService } from './services/media-storage-provider-metadata.service';\nimport { MediaService } from './services/media.service';\nimport { ModelMetadataService } from './services/model-metadata.service';\nimport { ModuleMetadataService } from './services/module-metadata.service';\nimport { SolidIntrospectService } from './services/solid-introspect.service';\n// import { ListOfComputedFieldProvider } from './providers/list-of-computed-field-provider.service';\nimport { ServeStaticModule } from '@nestjs/serve-static';\nimport { join } from 'path';\nimport { RefreshModelCommand } from './commands/refresh-model.command';\nimport { MediaController } from './controllers/media.controller';\n\nimport { RefreshModuleCommand } from './commands/refresh-module.command';\nimport { ModelMetadataSubscriber } from './subscribers/model-metadata.subscriber';\n\nimport { ViewMetadataController } from './controllers/view-metadata.controller';\nimport { ViewMetadata } from './entities/view-metadata.entity';\nimport { ViewMetadataService } from './services/view-metadata.service';\n\nimport { ActionMetadataController } from './controllers/action-metadata.controller';\nimport { ActionMetadata } from './entities/action-metadata.entity';\nimport { ActionMetadataService } from './services/action-metadata.service';\n\nimport { FacebookAuthenticationController } from './controllers/facebook-authentication.controller';\nimport { MicrosoftAuthenticationController } from './controllers/microsoft-authentication.controller';\nimport { FacebookOAuthStrategy } from './passport-strategies/facebook-oauth.strategy';\nimport { MicrosoftOAuthStrategy } from './passport-strategies/microsoft-oauth.strategy';\n\nimport { HttpModule } from '@nestjs/axios';\nimport { JwtModule } from '@nestjs/jwt';\nimport { SeedCommand } from './commands/seed.command';\nimport { TestDataCommand } from './commands/test-data.command';\nimport { TestRunCommand } from './commands/run-tests.command';\nimport { TestCommand } from './commands/test.command';\nimport { AuthenticationController } from './controllers/authentication.controller';\nimport { EmailTemplateController } from './controllers/email-template.controller';\nimport { GoogleAuthenticationController } from './controllers/google-authentication.controller';\nimport { MenuItemMetadataController } from './controllers/menu-item-metadata.controller';\nimport { MqMessageQueueController } from './controllers/mq-message-queue.controller';\nimport { MqMessageController } from './controllers/mq-message.controller';\nimport { OTPAuthenticationController } from './controllers/otp-authentication.controller';\nimport { ServiceController } from './controllers/service.controller';\nimport { SmsTemplateController } from './controllers/sms-template.controller';\nimport { TestQueueController } from './controllers/test-queue.controller';\nimport { EmailAttachment } from './entities/email-attachment.entity';\nimport { EmailTemplate } from './entities/email-template.entity';\nimport { MenuItemMetadata } from './entities/menu-item-metadata.entity';\nimport { MqMessageQueue } from './entities/mq-message-queue.entity';\nimport { MqMessage } from './entities/mq-message.entity';\nimport { SmsTemplate } from './entities/sms-template.entity';\nimport { AccessTokenGuard } from './guards/access-token.guard';\nimport { ApiKeyGuard } from './guards/api-key.guard';\nimport { AuthenticationGuard } from './guards/authentication.guard';\nimport { PermissionsGuard } from './guards/permissions.guard';\nimport { SolidRegistry } from './helpers/solid-registry';\nimport { LoggingInterceptor } from './interceptors/logging.interceptor';\nimport { ApiEmailQueuePublisher } from './jobs/rabbitmq/api-email-publisher.service';\nimport { ApiEmailQueueSubscriber } from './jobs/rabbitmq/api-email-subscriber.service';\nimport { TestQueuePublisherDatabase } from './jobs/database/test-queue-publisher-database.service';\nimport { TestQueueSubscriberDatabase } from './jobs/database/test-queue-subscriber-database.service';\nimport { TestQueuePublisherRedis } from './jobs/redis/test-queue-publisher-redis.service';\nimport { TestQueueSubscriberRedis } from './jobs/redis/test-queue-subscriber-redis.service';\nimport { Msg91WhatsappQueuePublisher } from './jobs/rabbitmq/msg91-whatsapp-publisher.service';\nimport { Msg91WhatsappQueueSubscriber } from './jobs/rabbitmq/msg91-whatsapp-subscriber.service';\nimport { Msg91OTPQueuePublisher } from './jobs/rabbitmq/msg91-otp-publisher.service';\nimport { Msg91OTPQueueSubscriber } from './jobs/rabbitmq/msg91-otp-subscriber.service';\nimport { Msg91SmsQueuePublisher } from './jobs/rabbitmq/msg91-sms-publisher.service';\nimport { Msg91SmsQueueSubscriber } from './jobs/rabbitmq/msg91-sms-subscriber.service';\nimport { SmtpEmailQueuePublisherRabbitmq } from './jobs/rabbitmq/smtp-email-publisher.service';\nimport { SmtpEmailQueueSubscriberRabbitmq } from './jobs/rabbitmq/smtp-email-subscriber.service';\nimport { TestQueuePublisher } from './jobs/rabbitmq/test-queue-publisher.service';\nimport { TestQueueSubscriber } from './jobs/rabbitmq/test-queue-subscriber.service';\nimport { ChatterQueuePublisherRabbitmq } from './jobs/rabbitmq/chatter-queue-publisher.service';\nimport { ChatterQueueSubscriberRabbitmq } from './jobs/rabbitmq/chatter-queue-subscriber.service';\nimport { ChatterQueuePublisherDatabase } from './jobs/database/chatter-queue-publisher-database.service';\nimport { ChatterQueueSubscriberDatabase } from './jobs/database/chatter-queue-subscriber-database.service';\nimport { ApiEmailQueuePublisherRedis } from './jobs/redis/api-email-publisher-redis.service';\nimport { ApiEmailQueueSubscriberRedis } from './jobs/redis/api-email-subscriber-redis.service';\nimport { ChatterQueuePublisherRedis } from './jobs/redis/chatter-queue-publisher-redis.service';\nimport { ChatterQueueSubscriberRedis } from './jobs/redis/chatter-queue-subscriber-redis.service';\nimport { ComputedFieldEvaluationPublisherRedis } from './jobs/redis/computed-field-evaluation-publisher-redis.service';\nimport { ComputedFieldEvaluationSubscriberRedis } from './jobs/redis/computed-field-evaluation-subscriber-redis.service';\nimport { GenerateCodePublisherRedis } from './jobs/redis/generate-code-publisher-redis.service';\nimport { GenerateCodeSubscriberRedis } from './jobs/redis/generate-code-subscriber-redis.service';\nimport { Msg91OTPQueuePublisherRedis } from './jobs/redis/msg91-otp-publisher-redis.service';\nimport { Msg91OTPQueueSubscriberRedis } from './jobs/redis/msg91-otp-subscriber-redis.service';\nimport { Msg91SmsQueuePublisherRedis } from './jobs/redis/msg91-sms-publisher-redis.service';\nimport { Msg91SmsQueueSubscriberRedis } from './jobs/redis/msg91-sms-subscriber-redis.service';\nimport { Msg91WhatsappQueuePublisherRedis } from './jobs/redis/msg91-whatsapp-publisher-redis.service';\nimport { Msg91WhatsappQueueSubscriberRedis } from './jobs/redis/msg91-whatsapp-subscriber-redis.service';\nimport { SmtpEmailQueuePublisherRedis } from './jobs/redis/smtp-email-publisher-redis.service';\nimport { SmtpEmailQueueSubscriberRedis } from './jobs/redis/smtp-email-subscriber-redis.service';\nimport { Three60WhatsappQueuePublisherRedis } from './jobs/redis/three60-whatsapp-publisher-redis.service';\nimport { Three60WhatsappQueueSubscriberRedis } from './jobs/redis/three60-whatsapp-subscriber-redis.service';\nimport { TriggerMcpClientPublisherRedis } from './jobs/redis/trigger-mcp-client-publisher-redis.service';\nimport { TriggerMcpClientSubscriberRedis } from './jobs/redis/trigger-mcp-client-subscriber-redis.service';\nimport { TwilioSmsQueuePublisherRedis } from './jobs/redis/twilio-sms-publisher-redis.service';\nimport { TwilioSmsQueueSubscriberRedis } from './jobs/redis/twilio-sms-subscriber-redis.service';\nimport { UserRegistrationListener } from './listeners/user-registration.listener';\nimport { GoogleOauthStrategy } from './passport-strategies/google-oauth.strategy';\nimport { ApiKeyService } from './services/api-key.service';\nimport { AuthenticationService } from './services/authentication.service';\nimport { BcryptService } from './services/bcrypt.service';\nimport { UuidExternalIdEntityComputedFieldProvider } from './services/computed-fields/entity/uuid-externalid-entity-computed-field-provider.service';\nimport { UuidExternalIdComputedFieldProvider } from './services/computed-fields/uuid-external-id-computed-field-provider.service';\nimport { EmailTemplateService } from './services/email-template.service';\nimport {\n DiskFileService,\n S3FileService,\n FileServiceFactory,\n DiskStoragePathBuilder,\n S3StoragePathBuilder,\n StoragePathBuilderFactory,\n} from './services/file';\nimport { HashingService } from './services/hashing.service';\nimport { ElasticEmailService } from './services/mail/elastic-email.service';\nimport { SMTPEMailService } from './services/mail/smtp-email.service';\nimport { MenuItemMetadataService } from './services/menu-item-metadata.service';\nimport { MqMessageQueueService } from './services/mq-message-queue.service';\nimport { MqMessageService } from './services/mq-message.service';\nimport { PdfService } from './services/pdf.service';\nimport { RefreshTokenIdsStorageService } from './services/refresh-token-ids-storage.service';\nimport { SsoCodeStorageService } from './services/sso-code-storage.service';\nimport { ListOfModelsSelectionProvider } from './services/selection-providers/list-of-models-selection-provider.service';\nimport { TinyUrlService } from './services/short-url/tiny-url.service';\nimport { SmsTemplateService } from './services/sms-template.service';\nimport { Msg91OTPService } from './services/sms/Msg91OTPService';\nimport { Msg91SMSService } from './services/sms/Msg91SMSService';\n// import { UserService } from './services/user.service';\nimport { Msg91WhatsappService } from './services/whatsapp/Msg91WhatsappService';\nimport { SoftDeleteAwareEventSubscriber } from './subscribers/soft-delete-aware-event.subscriber';\n\nimport { PermissionMetadataController } from './controllers/permission-metadata.controller';\nimport { PermissionMetadata } from './entities/permission-metadata.entity';\nimport { PermissionMetadataService } from './services/permission-metadata.service';\n\nimport { ScheduleModule } from '@nestjs/schedule';\nimport { ClsModule } from 'nestjs-cls';\nimport { AiInteractionController } from './controllers/ai-interaction.controller';\nimport { ChatterMessageDetailsController } from './controllers/chatter-message-details.controller';\nimport { ChatterMessageController } from './controllers/chatter-message.controller';\nimport { DashboardQuestionSqlDatasetConfigController } from './controllers/dashboard-question-sql-dataset-config.controller';\nimport { DashboardQuestionController } from './controllers/dashboard-question.controller';\nimport { DashboardVariableController } from './controllers/dashboard-variable.controller';\nimport { DashboardLayoutController } from './controllers/dashboard-layout.controller';\n\nimport { DashboardController } from './controllers/dashboard.controller';\nimport { ExportTemplateController } from './controllers/export-template.controller';\nimport { ExportTransactionController } from './controllers/export-transaction.controller';\nimport { ImportTransactionErrorLogController } from './controllers/import-transaction-error-log.controller';\nimport { ImportTransactionController } from './controllers/import-transaction.controller';\nimport { ListOfValuesController } from './controllers/list-of-values.controller';\nimport { LocaleController } from './controllers/locale.controller';\nimport { RoleMetadataController } from './controllers/role-metadata.controller';\nimport { SavedFiltersController } from './controllers/saved-filters.controller';\nimport { ScheduledJobController } from './controllers/scheduled-job.controller';\nimport { AgentSessionController } from './controllers/agent-session.controller';\nimport { AgentEventController } from './controllers/agent-event.controller';\nimport { SecurityRuleController } from './controllers/security-rule.controller';\nimport { SettingController } from './controllers/setting.controller';\nimport { InfoController } from './controllers/info.controller';\nimport { InfoService } from './services/info.service';\nimport { UserActivityHistoryController } from './controllers/user-activity-history.controller';\nimport { UserViewMetadataController } from './controllers/user-view-metadata.controller';\nimport { UserController } from './controllers/user.controller';\nimport { AiInteraction } from './entities/ai-interaction.entity';\nimport { ChatterMessageDetails } from './entities/chatter-message-details.entity';\nimport { ChatterMessage } from './entities/chatter-message.entity';\nimport { DashboardQuestionSqlDatasetConfig } from './entities/dashboard-question-sql-dataset-config.entity';\nimport { DashboardQuestion } from './entities/dashboard-question.entity';\nimport { DashboardVariable } from './entities/dashboard-variable.entity';\nimport { DashboardLayout } from './entities/dashboard-layout.entity';\n\nimport { Dashboard } from './entities/dashboard.entity';\nimport { ExportTemplate } from './entities/export-template.entity';\nimport { ExportTransaction } from './entities/export-transaction.entity';\nimport { ImportTransactionErrorLog } from './entities/import-transaction-error-log.entity';\nimport { ImportTransaction } from './entities/import-transaction.entity';\nimport { Locale } from './entities/locale.entity';\nimport { RoleMetadata } from './entities/role-metadata.entity';\nimport { SavedFilters } from './entities/saved-filters.entity';\nimport { ScheduledJob } from './entities/scheduled-job.entity';\nimport { AgentSession } from './entities/agent-session.entity';\nimport { AgentEvent } from './entities/agent-event.entity';\nimport { SecurityRule } from './entities/security-rule.entity';\nimport { Setting } from './entities/setting.entity';\nimport { UserActivityHistory } from './entities/user-activity-history.entity';\nimport { UserViewMetadata } from './entities/user-view-metadata.entity';\nimport { UserApiKey } from './entities/user-api-key.entity';\nimport { User } from './entities/user.entity';\nimport { HttpExceptionFilter } from './filters/http-exception.filter';\nimport { ModelMetadataHelperService } from './helpers/model-metadata-helper.service';\nimport { ModuleMetadataHelperService } from './helpers/module-metadata-helper.service';\nimport { ApiEmailQueuePublisherDatabase } from './jobs/database/api-email-publisher-database.service';\nimport { ApiEmailQueueSubscriberDatabase } from './jobs/database/api-email-subscriber-database.service';\nimport { ComputedFieldEvaluationPublisherDatabase } from './jobs/database/computed-field-evaluation-publisher-database.service';\nimport { ComputedFieldEvaluationSubscriberDatabase } from './jobs/database/computed-field-evaluation-subscriber-database.service';\nimport { GenerateCodePublisherDatabase } from './jobs/database/generate-code-publisher-database.service';\nimport { GenerateCodeSubscriberDatabase } from './jobs/database/generate-code-subscriber-database.service';\nimport { OTPQueuePublisherDatabase } from './jobs/database/otp-publisher-database.service';\nimport { OTPQueueSubscriberDatabase } from './jobs/database/otp-subscriber-database.service';\nimport { Msg91SmsQueuePublisherDatabase } from './jobs/database/msg91-sms-publisher-database.service';\nimport { Msg91SmsQueueSubscriberDatabase } from './jobs/database/msg91-sms-subscriber-database.service';\nimport { SmtpEmailQueuePublisherDatabase } from './jobs/database/smtp-email-publisher-database.service';\nimport { SmtpEmailQueueSubscriberDatabase } from './jobs/database/smtp-email-subscriber-database.service';\n\nimport { TwilioSmsQueuePublisherDatabase } from './jobs/database/twilio-sms-publisher-database.service';\nimport { TwilioSmsQueueSubscriberDatabase } from './jobs/database/twilio-sms-subscriber-database.service';\n\n// import { ThrottlerModule } from '@nestjs/throttler';\nimport { IngestCommand } from './commands/ingest.command';\nimport { MailFactory } from './factories/mail.factory';\nimport { ErrorMapperService } from './helpers/error-mapper.service';\nimport { SolidCoreErrorCodesProvider } from './helpers/solid-core-error-codes-provider.service';\nimport { ComputedFieldEvaluationPublisherRabbitmq } from './jobs/rabbitmq/computed-field-evaluation-publisher.service';\nimport { ComputedFieldEvaluationSubscriberRabbitmq } from './jobs/rabbitmq/computed-field-evaluation-subscriber.service';\nimport { Msg91WhatsappQueuePublisherDatabase } from './jobs/database/msg91-whatsapp-publisher-database.service';\nimport { Msg91WhatsappQueueSubscriberDatabase } from './jobs/database/msg91-whatsapp-subscriber-database.service';\nimport { Three60WhatsappQueuePublisherDatabase } from './jobs/database/three60-whatsapp-publisher-database.service';\nimport { Three60WhatsappQueueSubscriberDatabase } from './jobs/database/three60-whatsapp-subscriber-database.service';\nimport { TriggerMcpClientPublisherDatabase } from './jobs/database/trigger-mcp-client-publisher-database.service';\nimport { TriggerMcpClientSubscriberDatabase } from './jobs/database/trigger-mcp-client-subscriber-database.service';\nimport { GenerateCodePublisherRabbitmq } from './jobs/rabbitmq/generate-code-publisher.service';\nimport { GenerateCodeSubscriberRabbitmq } from './jobs/rabbitmq/generate-code-subscriber.service';\nimport { Three60WhatsappQueuePublisher } from './jobs/rabbitmq/three60-whatsapp-publisher.service';\nimport { Three60WhatsappQueueSubscriber } from './jobs/rabbitmq/three60-whatsapp-subscriber.service';\nimport { TriggerMcpClientPublisherRabbitmq } from './jobs/rabbitmq/trigger-mcp-client-publisher.service';\nimport { TriggerMcpClientSubscriberRabbitmq } from './jobs/rabbitmq/trigger-mcp-client-subscriber.service';\nimport { TwilioSmsQueuePublisherRabbitmq } from './jobs/rabbitmq/twilio-sms-publisher.service';\nimport { TwilioSmsQueueSubscriberRabbitmq } from './jobs/rabbitmq/twilio-sms-subscriber.service';\nimport { DashboardMapper } from './mappers/dashboard-mapper';\nimport { ListOfValuesMapper } from './mappers/list-of-values-mapper';\nimport { ActionMetadataRepository } from './repository/action-metadata.repository';\nimport { AiInteractionRepository } from './repository/ai-interaction.repository';\nimport { ChatterMessageDetailsRepository } from './repository/chatter-message-details.repository';\nimport { ChatterMessageRepository } from './repository/chatter-message.repository';\nimport { DashboardQuestionSqlDatasetConfigRepository } from './repository/dashboard-question-sql-dataset-config.repository';\nimport { DashboardQuestionRepository } from './repository/dashboard-question.repository';\nimport { DashboardVariableRepository } from './repository/dashboard-variable.repository';\nimport { DashboardRepository } from './repository/dashboard.repository';\nimport { DashboardLayoutRepository } from './repository/dashboard-layout.repository';\n\nimport { EmailTemplateRepository } from './repository/email-template.repository';\nimport { ExportTemplateRepository } from './repository/export-template.repository';\nimport { ExportTransactionRepository } from './repository/export-transaction.repository';\nimport { FieldMetadataRepository } from './repository/field-metadata.repository';\nimport { ImportTransactionErrorLogRepository } from './repository/import-transaction-error-log.repository';\nimport { ImportTransactionRepository } from './repository/import-transaction.repository';\nimport { ListOfValuesRepository } from './repository/list-of-values.repository';\nimport { LocaleRepository } from './repository/locale.repository';\nimport { MediaRepository } from './repository/media.repository';\nimport { MenuItemMetadataRepository } from './repository/menu-item-metadata.repository';\nimport { ModelMetadataRepository } from './repository/model-metadata.repository';\nimport { ModuleMetadataRepository } from './repository/module-metadata.repository';\nimport { MqMessageQueueRepository } from './repository/mq-message-queue.repository';\nimport { MqMessageRepository } from './repository/mq-message.repository';\nimport { PermissionMetadataRepository } from './repository/permission-metadata.repository';\nimport { RoleMetadataRepository } from './repository/role-metadata.repository';\nimport { SavedFiltersRepository } from './repository/saved-filters.repository';\nimport { ScheduledJobRepository } from './repository/scheduled-job.repository';\nimport { AgentSessionRepository } from './repository/agent-session.repository';\nimport { AgentEventRepository } from './repository/agent-event.repository';\nimport { SecurityRuleRepository } from './repository/security-rule.repository';\nimport { SettingRepository } from './repository/setting.repository';\nimport { SmsTemplateRepository } from './repository/sms-template.repository';\nimport { UserActivityHistoryRepository } from './repository/user-activity-history.repository';\nimport { UserViewMetadataRepository } from './repository/user-view-metadata.repository';\nimport { UserApiKeyRepository } from './repository/user-api-key.repository';\nimport { UserRepository } from './repository/user.repository';\nimport { ViewMetadataRepository } from './repository/view-metadata.repository';\nimport { PermissionMetadataSeederService } from './seeders/permission-metadata-seeder.service';\nimport { SystemFieldsSeederService } from './seeders/system-fields-seeder.service';\nimport { AiInteractionService } from './services/ai-interaction.service';\nimport { ChatterMessageDetailsService } from './services/chatter-message-details.service';\nimport { ChatterMessageService } from './services/chatter-message.service';\nimport { ConcatComputedFieldProvider } from './services/computed-fields/concat-computed-field-provider.service';\nimport { AlphaNumExternalIdComputationProvider } from './services/computed-fields/entity/alpha-num-external-id-computed-field-provider';\nimport { ConcatEntityComputedFieldProvider } from './services/computed-fields/entity/concat-entity-computed-field-provider.service';\nimport { NoopsEntityComputedFieldProviderService } from './services/computed-fields/entity/noops-entity-computed-field-provider.service';\nimport { CRUDService } from './services/crud.service';\nimport { CsvService } from './services/csv.service';\nimport { DashboardQuestionSqlDatasetConfigService } from './services/dashboard-question-sql-dataset-config.service';\nimport { DashboardQuestionService } from './services/dashboard-question.service';\nimport { DashboardVariableSQLDynamicProvider } from './services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service';\nimport { DasbhoardVariableTestDynamicProvider } from './services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service';\nimport { DashboardVariableService } from './services/dashboard-variable.service';\nimport { DashboardService } from './services/dashboard.service';\nimport { DashboardLayoutService } from './services/dashboard-layout.service';\n\nimport { ExcelService } from './services/excel.service';\nimport { ExportTemplateService } from './services/export-template.service';\nimport { ExportTransactionService } from './services/export-transaction.service';\nimport { IngestMetadataService } from './services/genai/ingest-metadata.service';\nimport { McpHandlerFactory } from './services/genai/mcp-handlers/mcp-handler-factory.service';\nimport { R2RHelperService } from './services/genai/r2r-helper.service';\nimport { ImportTransactionErrorLogService } from './services/import-transaction-error-log.service';\nimport { ImportTransactionService } from './services/import-transaction.service';\nimport { LocaleService } from './services/locale.service';\nimport { FileS3StorageProvider } from './services/mediaStorageProviders/file-s3-storage-provider';\nimport { FileStorageProvider } from './services/mediaStorageProviders/file-storage-provider';\nimport { PollerService } from './services/poller.service';\nimport { ChartJsSqlDataProvider } from './services/question-data-providers/chartjs-sql-data-provider.service';\nimport { PrimeReactDatatableSqlDataProvider } from './services/question-data-providers/prime-react-datatable-sql-data-provider.service';\nimport { PrimeReactMeterGroupSqlDataProvider } from './services/question-data-providers/prime-react-meter-group-sql-data-provider.service';\nimport { PublisherFactory } from './services/queues/publisher-factory.service';\nimport { RequestContextService } from './services/request-context.service';\nimport { RoleMetadataService } from './services/role-metadata.service';\nimport { SavedFiltersService } from './services/saved-filters.service';\nimport { ScheduledJobService } from './services/scheduled-job.service';\nimport { AgentSessionService } from './services/agent-session.service';\nimport { AgentEventService } from './services/agent-event.service';\nimport { SchedulerServiceImpl } from './services/scheduled-jobs/scheduler.service';\nimport { SecurityRuleService } from './services/security-rule.service';\nimport { ListOfDashboardQuestionProvidersSelectionProvider } from './services/selection-providers/list-of-dashboard-question-providers-selection-provider.service';\nimport { ListOfDashboardVariableProvidersSelectionProvider } from './services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service';\nimport { ListOfScheduledJobsSelectionProvider } from './services/selection-providers/list-of-scheduled-jobs-selection-provider.service';\nimport { LocaleListSelectionProvider } from './services/selection-providers/locale-list-selection-provider.service';\nimport { SettingService } from './services/setting.service';\nimport { TwilioSMSService } from './services/sms/TwilioSMSService';\nimport { SolidTsMorphService } from './services/solid-ts-morph.service';\nimport { SqlExpressionResolverService } from './services/sql-expression-resolver.service';\nimport { TextractService } from './services/textract.service';\nimport { UserActivityHistoryService } from './services/user-activity-history.service';\nimport { UserViewMetadataService } from './services/user-view-metadata.service';\nimport { UserService } from './services/user.service';\nimport { Three60WhatsappService } from './services/whatsapp/Three60WhatsappService';\nimport { AuditSubscriber } from './subscribers/audit.subscriber';\nimport { ComputedEntityFieldSubscriber } from './subscribers/computed-entity-field.subscriber';\nimport { CreatedByUpdatedBySubscriber } from './subscribers/created-by-updated-by.subscriber';\nimport { DashboardQuestionSqlDatasetConfigSubscriber } from './subscribers/dashboard-question-sql-dataset-config.subscriber';\nimport { DashboardQuestionSubscriber } from './subscribers/dashboard-question.subscriber';\nimport { DashboardVariableSubscriber } from './subscribers/dashboard-variable.subscriber';\nimport { DashboardSubscriber } from './subscribers/dashboard.subscriber';\nimport { ListOfValuesSubscriber } from './subscribers/list-of-values.subscriber';\nimport { ScheduledJobSubscriber } from './subscribers/scheduled-job.subscriber';\nimport { SecurityRuleSubscriber } from './subscribers/security-rule.subscriber';\nimport { ViewMetadataSubsciber } from './subscribers/view-metadata.subscriber';\nimport { MediaStorageProviderMetadataRepository } from './repository/media-storage-provider-metadata.repository';\nimport { McpCommand } from './commands/mcp.command';\nimport { FixturesService } from './services/fixtures.service';\nimport { FixturesSetupCommand } from './commands/fixtures/fixtures-setup.command';\nimport { FixturesTearDownCommand } from './commands/fixtures/fixtures-tear-down.command';\nimport { DatabaseBootstrapService } from './services/database/database-bootstrap.service';\nimport { SequenceNumComputedFieldProvider } from './services/computed-fields/entity/sequence-num-computed-field-provider';\nimport { ModelSequence } from './entities/model-sequence.entity';\nimport { ModelSequenceService } from './services/model-sequence.service';\nimport { ModelSequenceController } from './controllers/model-sequence.controller';\nimport { ModelSequenceRepository } from './repository/model-sequence.repository';\nimport { CacheModule } from '@nestjs/cache-manager';\nimport { CacheManagerOptions } from './config/cache.options';\nimport { SolidCoreDefaultSettingsProvider } from './services/settings/default-settings-provider.service';\nimport { SmsFactory } from './factories/sms.factory';\nimport { WhatsAppFactory } from './factories/whatsapp.factory';\nimport { ImageEncodingService } from './helpers/image-encoding.helper';\nimport { SolidMicroserviceAdapter } from './helpers/solid-microservice-adapter.service';\nimport { InfoCommand } from './commands/info.command';\nimport { ListOfRolesSelectionProvider } from './services/selection-providers/list-of-roles-selectionproviders.service';\nimport { Entity } from 'typeorm';\n\n@Global()\n@Module({\n imports: [\n TypeOrmModule.forFeature([\n ActionMetadata,\n AiInteraction,\n ChatterMessage,\n ChatterMessageDetails,\n Dashboard,\n DashboardQuestion,\n DashboardQuestionSqlDatasetConfig,\n DashboardVariable,\n DashboardLayout,\n EmailAttachment,\n EmailTemplate,\n ExportTemplate,\n ExportTransaction,\n FieldMetadata,\n ImportTransaction,\n ImportTransactionErrorLog,\n ListOfValues,\n Locale,\n Media,\n MediaStorageProviderMetadata,\n MenuItemMetadata,\n ModelMetadata,\n ModuleMetadata,\n MqMessage,\n MqMessageQueue,\n PermissionMetadata,\n RoleMetadata,\n SavedFilters,\n ScheduledJob,\n AgentSession,\n AgentEvent,\n SecurityRule,\n Setting,\n SmsTemplate,\n User,\n UserApiKey,\n UserActivityHistory,\n UserViewMetadata,\n ViewMetadata,\n ModelSequence,\n ]),\n\n CacheModule.registerAsync(CacheManagerOptions),\n ScheduleModule.forRoot(),\n ServeStaticModule.forRoot({\n rootPath: join(process.cwd(), 'media-files-storage'),\n serveRoot: '/media-files-storage',\n serveStaticOptions: {\n setHeaders: (res /*, path, stat*/) => {\n // Allow use of these files from a different origin (e.g., :3000 UI)\n // Use 'same-site' if both origins are on the same site (localhost:* counts as same-site)\n res.setHeader('Cross-Origin-Resource-Policy', 'cross-origin'); // or 'same-site'\n\n // If you need to load into <canvas> without tainting or fetch images via XHR,\n // you can also expose CORS here (not needed for simple <img>):\n // res.setHeader('Access-Control-Allow-Origin', 'http://localhost:3000');\n },\n },\n }),\n MulterModule.registerAsync({\n imports: [ConfigModule],\n useFactory: async (configService: ConfigService) => ({\n dest: process.env.AB_MEDIA_UPLOAD_DIR ?? 'media-uploads',\n }),\n inject: [ConfigService],\n }),\n HttpModule,\n ConfigModule,\n ClsModule,\n JwtModule.register({\n global: true,\n }),\n ],\n controllers: [\n ActionMetadataController,\n AiInteractionController,\n AuthenticationController,\n ChatterMessageController,\n ChatterMessageDetailsController,\n DashboardController,\n DashboardQuestionController,\n DashboardQuestionSqlDatasetConfigController,\n DashboardVariableController,\n DashboardLayoutController,\n EmailTemplateController,\n ExportTemplateController,\n ExportTransactionController,\n FieldMetadataController,\n GoogleAuthenticationController,\n FacebookAuthenticationController,\n MicrosoftAuthenticationController,\n ImportTransactionController,\n ImportTransactionErrorLogController,\n ListOfValuesController,\n LocaleController,\n MediaController,\n MediaStorageProviderMetadataController,\n MenuItemMetadataController,\n ModelMetadataController,\n ModuleMetadataController,\n MqMessageController,\n MqMessageQueueController,\n OTPAuthenticationController,\n PermissionMetadataController,\n RoleMetadataController,\n SavedFiltersController,\n ScheduledJobController,\n AgentSessionController,\n AgentEventController,\n SecurityRuleController,\n ServiceController,\n SettingController,\n InfoController,\n SmsTemplateController,\n TestController,\n TestQueueController,\n UserActivityHistoryController,\n UserController,\n UserViewMetadataController,\n ViewMetadataController,\n ModelSequenceController,\n ],\n providers: [\n {\n provide: APP_INTERCEPTOR,\n useClass: LoggingInterceptor,\n },\n {\n provide: HashingService,\n useClass: BcryptService,\n },\n {\n provide: APP_GUARD,\n useClass: AuthenticationGuard,\n },\n {\n provide: APP_GUARD,\n useClass: PermissionsGuard,\n },\n {\n provide: APP_FILTER,\n useClass: HttpExceptionFilter,\n },\n ModuleMetadataService,\n ModuleMetadataHelperService,\n ModelMetadataService,\n ModelMetadataHelperService,\n FieldMetadataService,\n RemoveFieldsCommand,\n RefreshModelCommand,\n RefreshModuleCommand,\n InfoCommand,\n InfoService,\n SolidIntrospectService,\n DiscoveryService,\n R2RHelperService,\n CrudHelperService,\n CRUDService,\n Reflector,\n MetadataScanner,\n CommandService,\n SchematicService,\n MediaStorageProviderMetadataService,\n MediaService,\n // MediaStorageProviderMetadataSeederService,\n ModuleMetadataSeederService,\n ModuleTestDataService,\n ListOfValuesService,\n ListOfValuesSelectionProvider,\n PseudoForeignKeySelectionProvider,\n ModelMetadataSubscriber,\n ViewMetadataService,\n ActionMetadataService,\n MenuItemMetadataService,\n DiscoveryService,\n Reflector,\n MetadataScanner,\n DiskFileService,\n S3FileService,\n FileServiceFactory,\n DiskStoragePathBuilder,\n S3StoragePathBuilder,\n StoragePathBuilderFactory,\n TextractService,\n SolidRegistry,\n SeedCommand,\n TestCommand,\n TestDataCommand,\n TestRunCommand,\n McpCommand,\n IngestCommand,\n IngestMetadataService,\n SMTPEMailService,\n ElasticEmailService,\n Msg91SMSService,\n Msg91OTPService,\n Msg91WhatsappService,\n TwilioSMSService,\n SmsTemplateService,\n EmailTemplateService,\n PublisherFactory,\n PollerService,\n ErrorMapperService,\n SolidCoreErrorCodesProvider,\n\n TriggerMcpClientPublisherDatabase,\n TriggerMcpClientSubscriberDatabase,\n TriggerMcpClientPublisherRabbitmq,\n TriggerMcpClientSubscriberRabbitmq,\n\n SmtpEmailQueuePublisherRabbitmq,\n SmtpEmailQueueSubscriberRabbitmq,\n SmtpEmailQueuePublisherDatabase,\n SmtpEmailQueueSubscriberDatabase,\n ApiEmailQueuePublisher,\n ApiEmailQueueSubscriber,\n ApiEmailQueuePublisherDatabase,\n ApiEmailQueueSubscriberDatabase,\n Msg91SmsQueuePublisher,\n Msg91SmsQueueSubscriber,\n Msg91SmsQueuePublisherDatabase,\n Msg91SmsQueueSubscriberDatabase,\n TwilioSmsQueuePublisherDatabase,\n TwilioSmsQueueSubscriberDatabase,\n TwilioSmsQueuePublisherRabbitmq,\n TwilioSmsQueueSubscriberRabbitmq,\n Msg91OTPQueuePublisher,\n Msg91OTPQueueSubscriber,\n OTPQueuePublisherDatabase,\n OTPQueueSubscriberDatabase,\n Msg91WhatsappQueuePublisher,\n Msg91WhatsappQueueSubscriber,\n Msg91WhatsappQueuePublisherDatabase,\n Msg91WhatsappQueueSubscriberDatabase,\n Three60WhatsappQueuePublisher,\n Three60WhatsappQueueSubscriber,\n Three60WhatsappQueuePublisherDatabase,\n Three60WhatsappQueueSubscriberDatabase,\n Three60WhatsappService,\n MqMessageService,\n MqMessageQueueService,\n TinyUrlService,\n PdfService,\n UuidExternalIdComputedFieldProvider,\n UuidExternalIdEntityComputedFieldProvider,\n ListOfModelsSelectionProvider,\n ListOfScheduledJobsSelectionProvider,\n LocaleListSelectionProvider,\n SoftDeleteAwareEventSubscriber,\n AccessTokenGuard,\n ApiKeyGuard,\n ApiKeyService,\n AuthenticationService,\n GoogleAuthenticationController,\n RefreshTokenIdsStorageService,\n SsoCodeStorageService,\n GoogleOauthStrategy,\n FacebookOAuthStrategy,\n MicrosoftOAuthStrategy,\n UserRegistrationListener,\n TestQueuePublisher,\n TestQueueSubscriber,\n\n ChatterQueuePublisherRabbitmq,\n ChatterQueueSubscriberRabbitmq,\n ChatterQueuePublisherDatabase,\n ChatterQueueSubscriberDatabase,\n\n TestQueuePublisherDatabase,\n TestQueueSubscriberDatabase,\n TestQueuePublisherRedis,\n TestQueueSubscriberRedis,\n ApiEmailQueuePublisherRedis,\n ApiEmailQueueSubscriberRedis,\n ChatterQueuePublisherRedis,\n ChatterQueueSubscriberRedis,\n ComputedFieldEvaluationPublisherRedis,\n ComputedFieldEvaluationSubscriberRedis,\n GenerateCodePublisherRedis,\n GenerateCodeSubscriberRedis,\n Msg91OTPQueuePublisherRedis,\n Msg91OTPQueueSubscriberRedis,\n Msg91SmsQueuePublisherRedis,\n Msg91SmsQueueSubscriberRedis,\n Msg91WhatsappQueuePublisherRedis,\n Msg91WhatsappQueueSubscriberRedis,\n SmtpEmailQueuePublisherRedis,\n SmtpEmailQueueSubscriberRedis,\n Three60WhatsappQueuePublisherRedis,\n Three60WhatsappQueueSubscriberRedis,\n TriggerMcpClientPublisherRedis,\n TriggerMcpClientSubscriberRedis,\n TwilioSmsQueuePublisherRedis,\n TwilioSmsQueueSubscriberRedis,\n GenerateCodePublisherDatabase,\n GenerateCodeSubscriberDatabase,\n GenerateCodePublisherRabbitmq,\n GenerateCodeSubscriberRabbitmq,\n Msg91OTPQueuePublisher,\n MqMessageQueueService,\n MqMessageService,\n ScheduledJobService,\n SchedulerServiceImpl,\n PermissionMetadataService,\n RoleMetadataService,\n PermissionMetadataSeederService,\n UserService,\n UserApiKeyRepository,\n UserRepository,\n SettingService,\n ConcatComputedFieldProvider,\n FileStorageProvider,\n FileS3StorageProvider,\n MediaRepository,\n ViewMetadataSubsciber,\n SavedFiltersService,\n UserViewMetadataService,\n SecurityRuleService,\n SecurityRuleRepository,\n SecurityRuleSubscriber,\n RequestContextService,\n SavedFiltersService,\n ChatterMessageService,\n ChatterMessageDetailsService,\n LocaleService,\n AuditSubscriber,\n ExportTemplateService,\n ExportTransactionService,\n ExcelService,\n CsvService,\n ImportTransactionService,\n ImportTransactionErrorLogService,\n CreatedByUpdatedBySubscriber,\n SystemFieldsSeederService,\n FieldMetadataRepository,\n ComputedEntityFieldSubscriber,\n ComputedFieldEvaluationPublisherDatabase,\n ComputedFieldEvaluationSubscriberDatabase,\n ComputedFieldEvaluationPublisherRabbitmq,\n ComputedFieldEvaluationSubscriberRabbitmq,\n ConcatEntityComputedFieldProvider,\n UserActivityHistoryService,\n DashboardService,\n DashboardVariableService,\n DashboardLayoutService,\n DashboardQuestionService,\n DashboardVariableSQLDynamicProvider,\n DasbhoardVariableTestDynamicProvider,\n ListOfDashboardVariableProvidersSelectionProvider,\n ListOfDashboardQuestionProvidersSelectionProvider,\n DashboardQuestionSqlDatasetConfigService,\n ChartJsSqlDataProvider,\n PrimeReactMeterGroupSqlDataProvider,\n PrimeReactDatatableSqlDataProvider,\n SqlExpressionResolverService,\n AiInteractionService,\n DashboardMapper,\n DashboardRepository,\n DashboardSubscriber,\n DashboardVariableSubscriber,\n DashboardQuestionSubscriber,\n DashboardQuestionSqlDatasetConfigSubscriber,\n NoopsEntityComputedFieldProviderService,\n\n McpHandlerFactory,\n // SolidCreateDashboardWithWidgetsMcpHandler,\n // SolidCreateDashboardQuestionMcpHandler,\n // SolidCreateDashboardQuestionSqlDatasetConfigMcpHandler,\n // SolidCreateDashboardWidgetMcpHandler,\n // SolidAddVariableToDashboardMcpHandler,\n // SolidAddQuestionToDashboardMcpHandler,\n\n SolidTsMorphService,\n\n ViewMetadataRepository,\n ScheduledJobRepository,\n AgentSessionRepository,\n AgentEventRepository,\n AgentSessionService,\n AgentEventService,\n ScheduledJobSubscriber,\n AlphaNumExternalIdComputationProvider,\n ListOfValuesSubscriber,\n ListOfValuesMapper,\n MailFactory,\n WhatsAppFactory,\n SmsFactory,\n ChatterMessageRepository,\n ChatterMessageDetailsRepository,\n AiInteractionRepository,\n DashboardQuestionSqlDatasetConfigRepository,\n DashboardQuestionRepository,\n DashboardVariableRepository,\n DashboardLayoutRepository,\n EmailTemplateRepository,\n ExportTemplateRepository,\n ExportTransactionRepository,\n ImportTransactionErrorLogRepository,\n ImportTransactionRepository,\n ListOfValuesRepository,\n LocaleRepository,\n MenuItemMetadataRepository,\n MqMessageQueueRepository,\n MqMessageRepository,\n PermissionMetadataRepository,\n RoleMetadataRepository,\n SavedFiltersRepository,\n SettingRepository,\n SmsTemplateRepository,\n UserActivityHistoryRepository,\n UserViewMetadataRepository,\n ModelMetadataRepository,\n ModuleMetadataRepository,\n ActionMetadataRepository,\n MediaStorageProviderMetadataRepository,\n FixturesService,\n FixturesSetupCommand,\n FixturesTearDownCommand,\n DatabaseBootstrapService,\n SequenceNumComputedFieldProvider,\n ModelSequenceService,\n ModelSequenceRepository,\n SolidCoreDefaultSettingsProvider,\n ImageEncodingService,\n SolidMicroserviceAdapter,\n ListOfRolesSelectionProvider,\n ],\n exports: [\n AiInteractionService,\n AuthenticationService,\n ChatterMessageDetailsRepository,\n ChatterMessageDetailsService,\n ChatterMessageRepository,\n ChatterMessageService,\n ConfigModule,\n CrudHelperService,\n CRUDService,\n CsvService,\n DiscoveryService,\n EmailTemplateService,\n ElasticEmailService,\n ExcelService,\n FieldMetadataService,\n DiskFileService,\n S3FileService,\n FileServiceFactory,\n DiskStoragePathBuilder,\n S3StoragePathBuilder,\n StoragePathBuilderFactory,\n HttpModule,\n ImportTransactionService,\n ListOfValuesService,\n MailFactory,\n WhatsAppFactory,\n SmsFactory,\n MediaService,\n MediaStorageProviderMetadataService,\n ModelMetadataHelperService,\n ModelMetadataService,\n ModuleMetadataService,\n MqMessageQueueService,\n MqMessageService,\n Msg91OTPService,\n Msg91SMSService,\n Msg91WhatsappService,\n MulterModule,\n PdfService,\n PollerService,\n PublisherFactory,\n RefreshModelCommand,\n RefreshModuleCommand,\n RequestContextService,\n SchedulerServiceImpl,\n SecurityRuleRepository,\n SmsTemplateService,\n SMTPEMailService,\n SolidIntrospectService,\n SolidRegistry,\n TextractService,\n TinyUrlService,\n TwilioSMSService,\n TypeOrmModule,\n UserActivityHistoryService,\n ImageEncodingService,\n SolidMicroserviceAdapter,\n UserService,\n SettingService,\n ],\n})\nexport class SolidCoreModule implements NestModule {\n configure(consumer: MiddlewareConsumer) {\n consumer\n .apply(\n express.json({ limit: '10mb' }),\n express.urlencoded({ limit: '10mb', extended: true }),\n )\n .forRoutes('*');\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"solid-core.module.js","sourceRoot":"","sources":["../src/solid-core.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAgB;AAChB,2CAAgF;AAChF,iDAAmC;AACnC,2CAA6D;AAC7D,uCAOsB;AACtB,+DAAwD;AACxD,6CAAgD;AAChD,4EAAuE;AACvE,uFAAkF;AAClF,yHAAkH;AAClH,uFAAkF;AAClF,yFAAoF;AACpF,mEAA+D;AAC/D,4EAAiE;AACjE,4EAAgE;AAChE,8GAAiG;AACjG,0DAAgD;AAChD,4EAAiE;AACjE,8EAAmE;AACnE,+DAA2D;AAC3D,mEAA+D;AAC/D,0IAA0H;AAC1H,gJAAiI;AACjI,6FAAuF;AACvF,iFAA2E;AAC3E,wEAAmE;AACnE,8EAAyE;AACzE,8EAAwE;AAExE,gHAAyG;AACzG,4DAAwD;AACxD,8EAAyE;AACzE,gFAA2E;AAC3E,kFAA6E;AAE7E,uDAAyD;AACzD,+BAA4B;AAC5B,4EAAuE;AACvE,qEAAiE;AAEjE,8EAAyE;AACzE,uFAAkF;AAElF,qFAAgF;AAChF,0EAA+D;AAC/D,4EAAuE;AAEvE,yFAAoF;AACpF,8EAAmE;AACnE,gFAA2E;AAE3E,yGAAoG;AACpG,2GAAsG;AACtG,2FAAsF;AACtF,6FAAwF;AAExF,yCAA2C;AAC3C,qCAAwC;AACxC,0DAAsD;AACtD,oEAA+D;AAC/D,oEAA8D;AAC9D,0DAAsD;AACtD,uF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kCAAe;YACf,6CAAoB;YACpB,oDAAuB;YACvB,qDAAwB;YACxB,uEAAgC;YAChC,6CAAoB;YACpB,mDAAuB;YACvB,oEAAgC;YAChC,4CAAoB;YACpB,6DAAwB;YACxB,uEAA4B;SAC7B;QACD,OAAO,EAAE;YACP,6CAAoB;YACpB,8CAAqB;YACrB,oEAA+B;YAC/B,8DAA4B;YAC5B,qDAAwB;YACxB,+CAAqB;YACrB,qBAAY;YACZ,uCAAiB;YACjB,0BAAW;YACX,wBAAU;YACV,uBAAgB;YAChB,6CAAoB;YACpB,2CAAmB;YACnB,4BAAY;YACZ,6CAAoB;YACpB,sBAAe;YACf,oBAAa;YACb,yBAAkB;YAClB,6BAAsB;YACtB,2BAAoB;YACpB,gCAAyB;YACzB,kBAAU;YACV,qDAAwB;YACxB,4CAAmB;YACnB,0BAAW;YACX,kCAAe;YACf,wBAAU;YACV,4BAAY;YACZ,6EAAmC;YACnC,0DAA0B;YAC1B,6CAAoB;YACpB,+CAAqB;YACrB,gDAAqB;YACrB,qCAAgB;YAChB,iCAAe;YACf,iCAAe;YACf,2CAAoB;YACpB,+BAAY;YACZ,wBAAU;YACV,8BAAa;YACb,4CAAgB;YAChB,2CAAmB;YACnB,6CAAoB;YACpB,+CAAqB;YACrB,wCAAoB;YACpB,iDAAsB;YACtB,yCAAkB;YAClB,qCAAgB;YAChB,iDAAsB;YACtB,8BAAa;YACb,kCAAe;YACf,iCAAc;YACd,mCAAgB;YAChB,uBAAa;YACb,0DAA0B;YAC1B,4CAAoB;YACpB,6DAAwB;YACxB,0BAAW;YACX,gCAAc;SACf;KACF,CAAC;GACW,eAAe,CAS3B","sourcesContent":["import 'multer';\nimport { Global, MiddlewareConsumer, Module, NestModule } from '@nestjs/common';\nimport * as express from 'express';\nimport { ConfigModule, ConfigService } from '@nestjs/config';\nimport {\n APP_FILTER,\n APP_GUARD,\n APP_INTERCEPTOR,\n DiscoveryService,\n MetadataScanner,\n Reflector,\n} from '@nestjs/core';\nimport { MulterModule } from '@nestjs/platform-express';\nimport { TypeOrmModule } from '@nestjs/typeorm';\nimport { RemoveFieldsCommand } from './commands/remove-fields.command';\nimport { FieldMetadataController } from './controllers/field-metadata.controller';\nimport { MediaStorageProviderMetadataController } from './controllers/media-storage-provider-metadata.controller';\nimport { ModelMetadataController } from './controllers/model-metadata.controller';\nimport { ModuleMetadataController } from './controllers/module-metadata.controller';\nimport { TestController } from './controllers/test.controller';\nimport { FieldMetadata } from './entities/field-metadata.entity';\nimport { ListOfValues } from './entities/list-of-values.entity';\nimport { MediaStorageProviderMetadata } from './entities/media-storage-provider-metadata.entity';\nimport { Media } from './entities/media.entity';\nimport { ModelMetadata } from './entities/model-metadata.entity';\nimport { ModuleMetadata } from './entities/module-metadata.entity';\nimport { CommandService } from './helpers/command.service';\nimport { SchematicService } from './helpers/schematic.service';\nimport { ListOfValuesSelectionProvider } from './services/selection-providers/list-of-values-selection-providers.service';\nimport { PseudoForeignKeySelectionProvider } from './services/selection-providers/pseudo-foreign-key-selection-provider.service';\nimport { ModuleMetadataSeederService } from './seeders/module-metadata-seeder.service';\nimport { ModuleTestDataService } from './seeders/module-test-data.service';\nimport { CrudHelperService } from './services/crud-helper.service';\nimport { FieldMetadataService } from './services/field-metadata.service';\nimport { ListOfValuesService } from './services/list-of-values.service';\n// import { MediaStorageProviderMetadataSeederService } from './services/media-storage-provider-metadata-seeder.service';\nimport { MediaStorageProviderMetadataService } from './services/media-storage-provider-metadata.service';\nimport { MediaService } from './services/media.service';\nimport { ModelMetadataService } from './services/model-metadata.service';\nimport { ModuleMetadataService } from './services/module-metadata.service';\nimport { SolidIntrospectService } from './services/solid-introspect.service';\n// import { ListOfComputedFieldProvider } from './providers/list-of-computed-field-provider.service';\nimport { ServeStaticModule } from '@nestjs/serve-static';\nimport { join } from 'path';\nimport { RefreshModelCommand } from './commands/refresh-model.command';\nimport { MediaController } from './controllers/media.controller';\n\nimport { RefreshModuleCommand } from './commands/refresh-module.command';\nimport { ModelMetadataSubscriber } from './subscribers/model-metadata.subscriber';\n\nimport { ViewMetadataController } from './controllers/view-metadata.controller';\nimport { ViewMetadata } from './entities/view-metadata.entity';\nimport { ViewMetadataService } from './services/view-metadata.service';\n\nimport { ActionMetadataController } from './controllers/action-metadata.controller';\nimport { ActionMetadata } from './entities/action-metadata.entity';\nimport { ActionMetadataService } from './services/action-metadata.service';\n\nimport { FacebookAuthenticationController } from './controllers/facebook-authentication.controller';\nimport { MicrosoftAuthenticationController } from './controllers/microsoft-authentication.controller';\nimport { FacebookOAuthStrategy } from './passport-strategies/facebook-oauth.strategy';\nimport { MicrosoftOAuthStrategy } from './passport-strategies/microsoft-oauth.strategy';\n\nimport { HttpModule } from '@nestjs/axios';\nimport { JwtModule } from '@nestjs/jwt';\nimport { SeedCommand } from './commands/seed.command';\nimport { TestDataCommand } from './commands/test-data.command';\nimport { TestRunCommand } from './commands/run-tests.command';\nimport { TestCommand } from './commands/test.command';\nimport { AuthenticationController } from './controllers/authentication.controller';\nimport { EmailTemplateController } from './controllers/email-template.controller';\nimport { GoogleAuthenticationController } from './controllers/google-authentication.controller';\nimport { MenuItemMetadataController } from './controllers/menu-item-metadata.controller';\nimport { MqMessageQueueController } from './controllers/mq-message-queue.controller';\nimport { MqMessageController } from './controllers/mq-message.controller';\nimport { OTPAuthenticationController } from './controllers/otp-authentication.controller';\nimport { ServiceController } from './controllers/service.controller';\nimport { SmsTemplateController } from './controllers/sms-template.controller';\nimport { TestQueueController } from './controllers/test-queue.controller';\nimport { EmailAttachment } from './entities/email-attachment.entity';\nimport { EmailTemplate } from './entities/email-template.entity';\nimport { MenuItemMetadata } from './entities/menu-item-metadata.entity';\nimport { MqMessageQueue } from './entities/mq-message-queue.entity';\nimport { MqMessage } from './entities/mq-message.entity';\nimport { SmsTemplate } from './entities/sms-template.entity';\nimport { AccessTokenGuard } from './guards/access-token.guard';\nimport { ApiKeyGuard } from './guards/api-key.guard';\nimport { AuthenticationGuard } from './guards/authentication.guard';\nimport { PermissionsGuard } from './guards/permissions.guard';\nimport { SolidRegistry } from './helpers/solid-registry';\nimport { LoggingInterceptor } from './interceptors/logging.interceptor';\nimport { ApiEmailQueuePublisher } from './jobs/rabbitmq/api-email-publisher.service';\nimport { ApiEmailQueueSubscriber } from './jobs/rabbitmq/api-email-subscriber.service';\nimport { TestQueuePublisherDatabase } from './jobs/database/test-queue-publisher-database.service';\nimport { TestQueueSubscriberDatabase } from './jobs/database/test-queue-subscriber-database.service';\nimport { TestQueuePublisherRedis } from './jobs/redis/test-queue-publisher-redis.service';\nimport { TestQueueSubscriberRedis } from './jobs/redis/test-queue-subscriber-redis.service';\nimport { Msg91WhatsappQueuePublisher } from './jobs/rabbitmq/msg91-whatsapp-publisher.service';\nimport { Msg91WhatsappQueueSubscriber } from './jobs/rabbitmq/msg91-whatsapp-subscriber.service';\nimport { Msg91OTPQueuePublisher } from './jobs/rabbitmq/msg91-otp-publisher.service';\nimport { Msg91OTPQueueSubscriber } from './jobs/rabbitmq/msg91-otp-subscriber.service';\nimport { Msg91SmsQueuePublisher } from './jobs/rabbitmq/msg91-sms-publisher.service';\nimport { Msg91SmsQueueSubscriber } from './jobs/rabbitmq/msg91-sms-subscriber.service';\nimport { SmtpEmailQueuePublisherRabbitmq } from './jobs/rabbitmq/smtp-email-publisher.service';\nimport { SmtpEmailQueueSubscriberRabbitmq } from './jobs/rabbitmq/smtp-email-subscriber.service';\nimport { TestQueuePublisher } from './jobs/rabbitmq/test-queue-publisher.service';\nimport { TestQueueSubscriber } from './jobs/rabbitmq/test-queue-subscriber.service';\nimport { ChatterQueuePublisherRabbitmq } from './jobs/rabbitmq/chatter-queue-publisher.service';\nimport { ChatterQueueSubscriberRabbitmq } from './jobs/rabbitmq/chatter-queue-subscriber.service';\nimport { ChatterQueuePublisherDatabase } from './jobs/database/chatter-queue-publisher-database.service';\nimport { ChatterQueueSubscriberDatabase } from './jobs/database/chatter-queue-subscriber-database.service';\nimport { ApiEmailQueuePublisherRedis } from './jobs/redis/api-email-publisher-redis.service';\nimport { ApiEmailQueueSubscriberRedis } from './jobs/redis/api-email-subscriber-redis.service';\nimport { ChatterQueuePublisherRedis } from './jobs/redis/chatter-queue-publisher-redis.service';\nimport { ChatterQueueSubscriberRedis } from './jobs/redis/chatter-queue-subscriber-redis.service';\nimport { ComputedFieldEvaluationPublisherRedis } from './jobs/redis/computed-field-evaluation-publisher-redis.service';\nimport { ComputedFieldEvaluationSubscriberRedis } from './jobs/redis/computed-field-evaluation-subscriber-redis.service';\nimport { GenerateCodePublisherRedis } from './jobs/redis/generate-code-publisher-redis.service';\nimport { GenerateCodeSubscriberRedis } from './jobs/redis/generate-code-subscriber-redis.service';\nimport { Msg91OTPQueuePublisherRedis } from './jobs/redis/msg91-otp-publisher-redis.service';\nimport { Msg91OTPQueueSubscriberRedis } from './jobs/redis/msg91-otp-subscriber-redis.service';\nimport { Msg91SmsQueuePublisherRedis } from './jobs/redis/msg91-sms-publisher-redis.service';\nimport { Msg91SmsQueueSubscriberRedis } from './jobs/redis/msg91-sms-subscriber-redis.service';\nimport { Msg91WhatsappQueuePublisherRedis } from './jobs/redis/msg91-whatsapp-publisher-redis.service';\nimport { Msg91WhatsappQueueSubscriberRedis } from './jobs/redis/msg91-whatsapp-subscriber-redis.service';\nimport { SmtpEmailQueuePublisherRedis } from './jobs/redis/smtp-email-publisher-redis.service';\nimport { SmtpEmailQueueSubscriberRedis } from './jobs/redis/smtp-email-subscriber-redis.service';\nimport { Three60WhatsappQueuePublisherRedis } from './jobs/redis/three60-whatsapp-publisher-redis.service';\nimport { Three60WhatsappQueueSubscriberRedis } from './jobs/redis/three60-whatsapp-subscriber-redis.service';\nimport { TriggerMcpClientPublisherRedis } from './jobs/redis/trigger-mcp-client-publisher-redis.service';\nimport { TriggerMcpClientSubscriberRedis } from './jobs/redis/trigger-mcp-client-subscriber-redis.service';\nimport { TwilioSmsQueuePublisherRedis } from './jobs/redis/twilio-sms-publisher-redis.service';\nimport { TwilioSmsQueueSubscriberRedis } from './jobs/redis/twilio-sms-subscriber-redis.service';\nimport { UserRegistrationListener } from './listeners/user-registration.listener';\nimport { GoogleOauthStrategy } from './passport-strategies/google-oauth.strategy';\nimport { ApiKeyService } from './services/api-key.service';\nimport { AuthenticationService } from './services/authentication.service';\nimport { BcryptService } from './services/bcrypt.service';\nimport { UuidExternalIdEntityComputedFieldProvider } from './services/computed-fields/entity/uuid-externalid-entity-computed-field-provider.service';\nimport { UuidExternalIdComputedFieldProvider } from './services/computed-fields/uuid-external-id-computed-field-provider.service';\nimport { EmailTemplateService } from './services/email-template.service';\nimport {\n DiskFileService,\n S3FileService,\n FileServiceFactory,\n DiskStoragePathBuilder,\n S3StoragePathBuilder,\n StoragePathBuilderFactory,\n} from './services/file';\nimport { HashingService } from './services/hashing.service';\nimport { ElasticEmailService } from './services/mail/elastic-email.service';\nimport { SMTPEMailService } from './services/mail/smtp-email.service';\nimport { MenuItemMetadataService } from './services/menu-item-metadata.service';\nimport { MqMessageQueueService } from './services/mq-message-queue.service';\nimport { MqMessageService } from './services/mq-message.service';\nimport { PdfService } from './services/pdf.service';\nimport { RefreshTokenIdsStorageService } from './services/refresh-token-ids-storage.service';\nimport { SsoCodeStorageService } from './services/sso-code-storage.service';\nimport { ListOfModelsSelectionProvider } from './services/selection-providers/list-of-models-selection-provider.service';\nimport { TinyUrlService } from './services/short-url/tiny-url.service';\nimport { SmsTemplateService } from './services/sms-template.service';\nimport { Msg91OTPService } from './services/sms/Msg91OTPService';\nimport { Msg91SMSService } from './services/sms/Msg91SMSService';\n// import { UserService } from './services/user.service';\nimport { Msg91WhatsappService } from './services/whatsapp/Msg91WhatsappService';\nimport { SoftDeleteAwareEventSubscriber } from './subscribers/soft-delete-aware-event.subscriber';\n\nimport { PermissionMetadataController } from './controllers/permission-metadata.controller';\nimport { PermissionMetadata } from './entities/permission-metadata.entity';\nimport { PermissionMetadataService } from './services/permission-metadata.service';\n\nimport { ScheduleModule } from '@nestjs/schedule';\nimport { ClsModule } from 'nestjs-cls';\nimport { AiInteractionController } from './controllers/ai-interaction.controller';\nimport { ChatterMessageDetailsController } from './controllers/chatter-message-details.controller';\nimport { ChatterMessageController } from './controllers/chatter-message.controller';\nimport { DashboardQuestionSqlDatasetConfigController } from './controllers/dashboard-question-sql-dataset-config.controller';\nimport { DashboardQuestionController } from './controllers/dashboard-question.controller';\nimport { DashboardVariableController } from './controllers/dashboard-variable.controller';\nimport { DashboardLayoutController } from './controllers/dashboard-layout.controller';\n\nimport { DashboardController } from './controllers/dashboard.controller';\nimport { ExportTemplateController } from './controllers/export-template.controller';\nimport { ExportTransactionController } from './controllers/export-transaction.controller';\nimport { ImportTransactionErrorLogController } from './controllers/import-transaction-error-log.controller';\nimport { ImportTransactionController } from './controllers/import-transaction.controller';\nimport { ListOfValuesController } from './controllers/list-of-values.controller';\nimport { LocaleController } from './controllers/locale.controller';\nimport { RoleMetadataController } from './controllers/role-metadata.controller';\nimport { SavedFiltersController } from './controllers/saved-filters.controller';\nimport { ScheduledJobController } from './controllers/scheduled-job.controller';\nimport { AgentSessionController } from './controllers/agent-session.controller';\nimport { AgentEventController } from './controllers/agent-event.controller';\nimport { SecurityRuleController } from './controllers/security-rule.controller';\nimport { SettingController } from './controllers/setting.controller';\nimport { InfoController } from './controllers/info.controller';\nimport { InfoService } from './services/info.service';\nimport { UserActivityHistoryController } from './controllers/user-activity-history.controller';\nimport { UserViewMetadataController } from './controllers/user-view-metadata.controller';\nimport { UserController } from './controllers/user.controller';\nimport { AiInteraction } from './entities/ai-interaction.entity';\nimport { ChatterMessageDetails } from './entities/chatter-message-details.entity';\nimport { ChatterMessage } from './entities/chatter-message.entity';\nimport { DashboardQuestionSqlDatasetConfig } from './entities/dashboard-question-sql-dataset-config.entity';\nimport { DashboardQuestion } from './entities/dashboard-question.entity';\nimport { DashboardVariable } from './entities/dashboard-variable.entity';\nimport { DashboardLayout } from './entities/dashboard-layout.entity';\n\nimport { Dashboard } from './entities/dashboard.entity';\nimport { ExportTemplate } from './entities/export-template.entity';\nimport { ExportTransaction } from './entities/export-transaction.entity';\nimport { ImportTransactionErrorLog } from './entities/import-transaction-error-log.entity';\nimport { ImportTransaction } from './entities/import-transaction.entity';\nimport { Locale } from './entities/locale.entity';\nimport { RoleMetadata } from './entities/role-metadata.entity';\nimport { SavedFilters } from './entities/saved-filters.entity';\nimport { ScheduledJob } from './entities/scheduled-job.entity';\nimport { AgentSession } from './entities/agent-session.entity';\nimport { AgentEvent } from './entities/agent-event.entity';\nimport { SecurityRule } from './entities/security-rule.entity';\nimport { Setting } from './entities/setting.entity';\nimport { UserActivityHistory } from './entities/user-activity-history.entity';\nimport { UserViewMetadata } from './entities/user-view-metadata.entity';\nimport { UserApiKey } from './entities/user-api-key.entity';\nimport { User } from './entities/user.entity';\nimport { HttpExceptionFilter } from './filters/http-exception.filter';\nimport { ModelMetadataHelperService } from './helpers/model-metadata-helper.service';\nimport { ModuleMetadataHelperService } from './helpers/module-metadata-helper.service';\nimport { ApiEmailQueuePublisherDatabase } from './jobs/database/api-email-publisher-database.service';\nimport { ApiEmailQueueSubscriberDatabase } from './jobs/database/api-email-subscriber-database.service';\nimport { ComputedFieldEvaluationPublisherDatabase } from './jobs/database/computed-field-evaluation-publisher-database.service';\nimport { ComputedFieldEvaluationSubscriberDatabase } from './jobs/database/computed-field-evaluation-subscriber-database.service';\nimport { GenerateCodePublisherDatabase } from './jobs/database/generate-code-publisher-database.service';\nimport { GenerateCodeSubscriberDatabase } from './jobs/database/generate-code-subscriber-database.service';\nimport { OTPQueuePublisherDatabase } from './jobs/database/otp-publisher-database.service';\nimport { OTPQueueSubscriberDatabase } from './jobs/database/otp-subscriber-database.service';\nimport { Msg91SmsQueuePublisherDatabase } from './jobs/database/msg91-sms-publisher-database.service';\nimport { Msg91SmsQueueSubscriberDatabase } from './jobs/database/msg91-sms-subscriber-database.service';\nimport { SmtpEmailQueuePublisherDatabase } from './jobs/database/smtp-email-publisher-database.service';\nimport { SmtpEmailQueueSubscriberDatabase } from './jobs/database/smtp-email-subscriber-database.service';\n\nimport { TwilioSmsQueuePublisherDatabase } from './jobs/database/twilio-sms-publisher-database.service';\nimport { TwilioSmsQueueSubscriberDatabase } from './jobs/database/twilio-sms-subscriber-database.service';\n\n// import { ThrottlerModule } from '@nestjs/throttler';\nimport { IngestCommand } from './commands/ingest.command';\nimport { MailFactory } from './factories/mail.factory';\nimport { ErrorMapperService } from './helpers/error-mapper.service';\nimport { SolidCoreErrorCodesProvider } from './helpers/solid-core-error-codes-provider.service';\nimport { ComputedFieldEvaluationPublisherRabbitmq } from './jobs/rabbitmq/computed-field-evaluation-publisher.service';\nimport { ComputedFieldEvaluationSubscriberRabbitmq } from './jobs/rabbitmq/computed-field-evaluation-subscriber.service';\nimport { Msg91WhatsappQueuePublisherDatabase } from './jobs/database/msg91-whatsapp-publisher-database.service';\nimport { Msg91WhatsappQueueSubscriberDatabase } from './jobs/database/msg91-whatsapp-subscriber-database.service';\nimport { Three60WhatsappQueuePublisherDatabase } from './jobs/database/three60-whatsapp-publisher-database.service';\nimport { Three60WhatsappQueueSubscriberDatabase } from './jobs/database/three60-whatsapp-subscriber-database.service';\nimport { TriggerMcpClientPublisherDatabase } from './jobs/database/trigger-mcp-client-publisher-database.service';\nimport { TriggerMcpClientSubscriberDatabase } from './jobs/database/trigger-mcp-client-subscriber-database.service';\nimport { GenerateCodePublisherRabbitmq } from './jobs/rabbitmq/generate-code-publisher.service';\nimport { GenerateCodeSubscriberRabbitmq } from './jobs/rabbitmq/generate-code-subscriber.service';\nimport { Three60WhatsappQueuePublisher } from './jobs/rabbitmq/three60-whatsapp-publisher.service';\nimport { Three60WhatsappQueueSubscriber } from './jobs/rabbitmq/three60-whatsapp-subscriber.service';\nimport { TriggerMcpClientPublisherRabbitmq } from './jobs/rabbitmq/trigger-mcp-client-publisher.service';\nimport { TriggerMcpClientSubscriberRabbitmq } from './jobs/rabbitmq/trigger-mcp-client-subscriber.service';\nimport { TwilioSmsQueuePublisherRabbitmq } from './jobs/rabbitmq/twilio-sms-publisher.service';\nimport { TwilioSmsQueueSubscriberRabbitmq } from './jobs/rabbitmq/twilio-sms-subscriber.service';\nimport { DashboardMapper } from './mappers/dashboard-mapper';\nimport { ListOfValuesMapper } from './mappers/list-of-values-mapper';\nimport { ActionMetadataRepository } from './repository/action-metadata.repository';\nimport { AiInteractionRepository } from './repository/ai-interaction.repository';\nimport { ChatterMessageDetailsRepository } from './repository/chatter-message-details.repository';\nimport { ChatterMessageRepository } from './repository/chatter-message.repository';\nimport { DashboardQuestionSqlDatasetConfigRepository } from './repository/dashboard-question-sql-dataset-config.repository';\nimport { DashboardQuestionRepository } from './repository/dashboard-question.repository';\nimport { DashboardVariableRepository } from './repository/dashboard-variable.repository';\nimport { DashboardRepository } from './repository/dashboard.repository';\nimport { DashboardLayoutRepository } from './repository/dashboard-layout.repository';\n\nimport { EmailTemplateRepository } from './repository/email-template.repository';\nimport { ExportTemplateRepository } from './repository/export-template.repository';\nimport { ExportTransactionRepository } from './repository/export-transaction.repository';\nimport { FieldMetadataRepository } from './repository/field-metadata.repository';\nimport { ImportTransactionErrorLogRepository } from './repository/import-transaction-error-log.repository';\nimport { ImportTransactionRepository } from './repository/import-transaction.repository';\nimport { ListOfValuesRepository } from './repository/list-of-values.repository';\nimport { LocaleRepository } from './repository/locale.repository';\nimport { MediaRepository } from './repository/media.repository';\nimport { MenuItemMetadataRepository } from './repository/menu-item-metadata.repository';\nimport { ModelMetadataRepository } from './repository/model-metadata.repository';\nimport { ModuleMetadataRepository } from './repository/module-metadata.repository';\nimport { MqMessageQueueRepository } from './repository/mq-message-queue.repository';\nimport { MqMessageRepository } from './repository/mq-message.repository';\nimport { PermissionMetadataRepository } from './repository/permission-metadata.repository';\nimport { RoleMetadataRepository } from './repository/role-metadata.repository';\nimport { SavedFiltersRepository } from './repository/saved-filters.repository';\nimport { ScheduledJobRepository } from './repository/scheduled-job.repository';\nimport { AgentSessionRepository } from './repository/agent-session.repository';\nimport { AgentEventRepository } from './repository/agent-event.repository';\nimport { SecurityRuleRepository } from './repository/security-rule.repository';\nimport { SettingRepository } from './repository/setting.repository';\nimport { SmsTemplateRepository } from './repository/sms-template.repository';\nimport { UserActivityHistoryRepository } from './repository/user-activity-history.repository';\nimport { UserViewMetadataRepository } from './repository/user-view-metadata.repository';\nimport { UserApiKeyRepository } from './repository/user-api-key.repository';\nimport { UserRepository } from './repository/user.repository';\nimport { ViewMetadataRepository } from './repository/view-metadata.repository';\nimport { PermissionMetadataSeederService } from './seeders/permission-metadata-seeder.service';\nimport { SystemFieldsSeederService } from './seeders/system-fields-seeder.service';\nimport { AiInteractionService } from './services/ai-interaction.service';\nimport { ChatterMessageDetailsService } from './services/chatter-message-details.service';\nimport { ChatterMessageService } from './services/chatter-message.service';\nimport { ConcatComputedFieldProvider } from './services/computed-fields/concat-computed-field-provider.service';\nimport { AlphaNumExternalIdComputationProvider } from './services/computed-fields/entity/alpha-num-external-id-computed-field-provider';\nimport { ConcatEntityComputedFieldProvider } from './services/computed-fields/entity/concat-entity-computed-field-provider.service';\nimport { NoopsEntityComputedFieldProviderService } from './services/computed-fields/entity/noops-entity-computed-field-provider.service';\nimport { CRUDService } from './services/crud.service';\nimport { CsvService } from './services/csv.service';\nimport { DashboardQuestionSqlDatasetConfigService } from './services/dashboard-question-sql-dataset-config.service';\nimport { DashboardQuestionService } from './services/dashboard-question.service';\nimport { DashboardVariableSQLDynamicProvider } from './services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service';\nimport { DasbhoardVariableTestDynamicProvider } from './services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service';\nimport { DashboardVariableService } from './services/dashboard-variable.service';\nimport { DashboardService } from './services/dashboard.service';\nimport { DashboardLayoutService } from './services/dashboard-layout.service';\n\nimport { ExcelService } from './services/excel.service';\nimport { ExportTemplateService } from './services/export-template.service';\nimport { ExportTransactionService } from './services/export-transaction.service';\nimport { IngestMetadataService } from './services/genai/ingest-metadata.service';\nimport { McpHandlerFactory } from './services/genai/mcp-handlers/mcp-handler-factory.service';\nimport { R2RHelperService } from './services/genai/r2r-helper.service';\nimport { ImportTransactionErrorLogService } from './services/import-transaction-error-log.service';\nimport { ImportTransactionService } from './services/import-transaction.service';\nimport { LocaleService } from './services/locale.service';\nimport { FileS3StorageProvider } from './services/mediaStorageProviders/file-s3-storage-provider';\nimport { FileStorageProvider } from './services/mediaStorageProviders/file-storage-provider';\nimport { PollerService } from './services/poller.service';\nimport { ChartJsSqlDataProvider } from './services/question-data-providers/chartjs-sql-data-provider.service';\nimport { PrimeReactDatatableSqlDataProvider } from './services/question-data-providers/prime-react-datatable-sql-data-provider.service';\nimport { PrimeReactMeterGroupSqlDataProvider } from './services/question-data-providers/prime-react-meter-group-sql-data-provider.service';\nimport { PublisherFactory } from './services/queues/publisher-factory.service';\nimport { RequestContextService } from './services/request-context.service';\nimport { RoleMetadataService } from './services/role-metadata.service';\nimport { SavedFiltersService } from './services/saved-filters.service';\nimport { ScheduledJobService } from './services/scheduled-job.service';\nimport { AgentSessionService } from './services/agent-session.service';\nimport { AgentEventService } from './services/agent-event.service';\nimport { SchedulerServiceImpl } from './services/scheduled-jobs/scheduler.service';\nimport { SecurityRuleService } from './services/security-rule.service';\nimport { ListOfDashboardQuestionProvidersSelectionProvider } from './services/selection-providers/list-of-dashboard-question-providers-selection-provider.service';\nimport { ListOfDashboardVariableProvidersSelectionProvider } from './services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service';\nimport { ListOfScheduledJobsSelectionProvider } from './services/selection-providers/list-of-scheduled-jobs-selection-provider.service';\nimport { LocaleListSelectionProvider } from './services/selection-providers/locale-list-selection-provider.service';\nimport { SettingService } from './services/setting.service';\nimport { TwilioSMSService } from './services/sms/TwilioSMSService';\nimport { SolidTsMorphService } from './services/solid-ts-morph.service';\nimport { SqlExpressionResolverService } from './services/sql-expression-resolver.service';\nimport { TextractService } from './services/textract.service';\nimport { UserActivityHistoryService } from './services/user-activity-history.service';\nimport { UserViewMetadataService } from './services/user-view-metadata.service';\nimport { UserService } from './services/user.service';\nimport { Three60WhatsappService } from './services/whatsapp/Three60WhatsappService';\nimport { AuditSubscriber } from './subscribers/audit.subscriber';\nimport { ComputedEntityFieldSubscriber } from './subscribers/computed-entity-field.subscriber';\nimport { CreatedByUpdatedBySubscriber } from './subscribers/created-by-updated-by.subscriber';\nimport { DashboardQuestionSqlDatasetConfigSubscriber } from './subscribers/dashboard-question-sql-dataset-config.subscriber';\nimport { DashboardQuestionSubscriber } from './subscribers/dashboard-question.subscriber';\nimport { DashboardVariableSubscriber } from './subscribers/dashboard-variable.subscriber';\nimport { DashboardSubscriber } from './subscribers/dashboard.subscriber';\nimport { ListOfValuesSubscriber } from './subscribers/list-of-values.subscriber';\nimport { ScheduledJobSubscriber } from './subscribers/scheduled-job.subscriber';\nimport { SecurityRuleSubscriber } from './subscribers/security-rule.subscriber';\nimport { ViewMetadataSubsciber } from './subscribers/view-metadata.subscriber';\nimport { MediaStorageProviderMetadataRepository } from './repository/media-storage-provider-metadata.repository';\nimport { McpCommand } from './commands/mcp.command';\nimport { FixturesService } from './services/fixtures.service';\nimport { FixturesSetupCommand } from './commands/fixtures/fixtures-setup.command';\nimport { FixturesTearDownCommand } from './commands/fixtures/fixtures-tear-down.command';\nimport { DatabaseBootstrapService } from './services/database/database-bootstrap.service';\nimport { SequenceNumComputedFieldProvider } from './services/computed-fields/entity/sequence-num-computed-field-provider';\nimport { ModelSequence } from './entities/model-sequence.entity';\nimport { ModelSequenceService } from './services/model-sequence.service';\nimport { ModelSequenceController } from './controllers/model-sequence.controller';\nimport { ModelSequenceRepository } from './repository/model-sequence.repository';\nimport { CacheModule } from '@nestjs/cache-manager';\nimport { CacheManagerOptions } from './config/cache.options';\nimport { SolidCoreDefaultSettingsProvider } from './services/settings/default-settings-provider.service';\nimport { SmsFactory } from './factories/sms.factory';\nimport { WhatsAppFactory } from './factories/whatsapp.factory';\nimport { ImageEncodingService } from './helpers/image-encoding.helper';\nimport { SolidMicroserviceAdapter } from './helpers/solid-microservice-adapter.service';\nimport { InfoCommand } from './commands/info.command';\nimport { ListOfRolesSelectionProvider } from './services/selection-providers/list-of-roles-selectionproviders.service';\nimport { Entity } from 'typeorm';\n\n@Global()\n@Module({\n imports: [\n TypeOrmModule.forFeature([\n ActionMetadata,\n AiInteraction,\n ChatterMessage,\n ChatterMessageDetails,\n Dashboard,\n DashboardQuestion,\n DashboardQuestionSqlDatasetConfig,\n DashboardVariable,\n DashboardLayout,\n EmailAttachment,\n EmailTemplate,\n ExportTemplate,\n ExportTransaction,\n FieldMetadata,\n ImportTransaction,\n ImportTransactionErrorLog,\n ListOfValues,\n Locale,\n Media,\n MediaStorageProviderMetadata,\n MenuItemMetadata,\n ModelMetadata,\n ModuleMetadata,\n MqMessage,\n MqMessageQueue,\n PermissionMetadata,\n RoleMetadata,\n SavedFilters,\n ScheduledJob,\n AgentSession,\n AgentEvent,\n SecurityRule,\n Setting,\n SmsTemplate,\n User,\n UserApiKey,\n UserActivityHistory,\n UserViewMetadata,\n ViewMetadata,\n ModelSequence,\n ]),\n\n CacheModule.registerAsync(CacheManagerOptions),\n ScheduleModule.forRoot(),\n ServeStaticModule.forRoot({\n rootPath: join(process.cwd(), 'media-files-storage'),\n serveRoot: '/media-files-storage',\n serveStaticOptions: {\n setHeaders: (res /*, path, stat*/) => {\n // Allow use of these files from a different origin (e.g., :3000 UI)\n // Use 'same-site' if both origins are on the same site (localhost:* counts as same-site)\n res.setHeader('Cross-Origin-Resource-Policy', 'cross-origin'); // or 'same-site'\n\n // If you need to load into <canvas> without tainting or fetch images via XHR,\n // you can also expose CORS here (not needed for simple <img>):\n // res.setHeader('Access-Control-Allow-Origin', 'http://localhost:3000');\n },\n },\n }),\n MulterModule.registerAsync({\n imports: [ConfigModule],\n useFactory: async (configService: ConfigService) => ({\n dest: process.env.AB_MEDIA_UPLOAD_DIR ?? 'media-uploads',\n }),\n inject: [ConfigService],\n }),\n HttpModule,\n ConfigModule,\n ClsModule,\n JwtModule.register({\n global: true,\n }),\n ],\n controllers: [\n ActionMetadataController,\n AiInteractionController,\n AuthenticationController,\n ChatterMessageController,\n ChatterMessageDetailsController,\n DashboardController,\n DashboardQuestionController,\n DashboardQuestionSqlDatasetConfigController,\n DashboardVariableController,\n DashboardLayoutController,\n EmailTemplateController,\n ExportTemplateController,\n ExportTransactionController,\n FieldMetadataController,\n GoogleAuthenticationController,\n FacebookAuthenticationController,\n MicrosoftAuthenticationController,\n ImportTransactionController,\n ImportTransactionErrorLogController,\n ListOfValuesController,\n LocaleController,\n MediaController,\n MediaStorageProviderMetadataController,\n MenuItemMetadataController,\n ModelMetadataController,\n ModuleMetadataController,\n MqMessageController,\n MqMessageQueueController,\n OTPAuthenticationController,\n PermissionMetadataController,\n RoleMetadataController,\n SavedFiltersController,\n ScheduledJobController,\n AgentSessionController,\n AgentEventController,\n SecurityRuleController,\n ServiceController,\n SettingController,\n InfoController,\n SmsTemplateController,\n TestController,\n TestQueueController,\n UserActivityHistoryController,\n UserController,\n UserViewMetadataController,\n ViewMetadataController,\n ModelSequenceController,\n ],\n providers: [\n {\n provide: APP_INTERCEPTOR,\n useClass: LoggingInterceptor,\n },\n {\n provide: HashingService,\n useClass: BcryptService,\n },\n {\n provide: APP_GUARD,\n useClass: AuthenticationGuard,\n },\n {\n provide: APP_GUARD,\n useClass: PermissionsGuard,\n },\n {\n provide: APP_FILTER,\n useClass: HttpExceptionFilter,\n },\n ModuleMetadataService,\n ModuleMetadataHelperService,\n ModelMetadataService,\n ModelMetadataHelperService,\n FieldMetadataService,\n RemoveFieldsCommand,\n RefreshModelCommand,\n RefreshModuleCommand,\n InfoCommand,\n InfoService,\n SolidIntrospectService,\n DiscoveryService,\n R2RHelperService,\n CrudHelperService,\n CRUDService,\n Reflector,\n MetadataScanner,\n CommandService,\n SchematicService,\n MediaStorageProviderMetadataService,\n MediaService,\n // MediaStorageProviderMetadataSeederService,\n ModuleMetadataSeederService,\n ModuleTestDataService,\n ListOfValuesService,\n ListOfValuesSelectionProvider,\n PseudoForeignKeySelectionProvider,\n ModelMetadataSubscriber,\n ViewMetadataService,\n ActionMetadataService,\n MenuItemMetadataService,\n DiscoveryService,\n Reflector,\n MetadataScanner,\n DiskFileService,\n S3FileService,\n FileServiceFactory,\n DiskStoragePathBuilder,\n S3StoragePathBuilder,\n StoragePathBuilderFactory,\n TextractService,\n SolidRegistry,\n SeedCommand,\n TestCommand,\n TestDataCommand,\n TestRunCommand,\n McpCommand,\n IngestCommand,\n IngestMetadataService,\n SMTPEMailService,\n ElasticEmailService,\n Msg91SMSService,\n Msg91OTPService,\n Msg91WhatsappService,\n TwilioSMSService,\n SmsTemplateService,\n EmailTemplateService,\n PublisherFactory,\n PollerService,\n ErrorMapperService,\n SolidCoreErrorCodesProvider,\n\n TriggerMcpClientPublisherDatabase,\n TriggerMcpClientSubscriberDatabase,\n TriggerMcpClientPublisherRabbitmq,\n TriggerMcpClientSubscriberRabbitmq,\n\n SmtpEmailQueuePublisherRabbitmq,\n SmtpEmailQueueSubscriberRabbitmq,\n SmtpEmailQueuePublisherDatabase,\n SmtpEmailQueueSubscriberDatabase,\n ApiEmailQueuePublisher,\n ApiEmailQueueSubscriber,\n ApiEmailQueuePublisherDatabase,\n ApiEmailQueueSubscriberDatabase,\n Msg91SmsQueuePublisher,\n Msg91SmsQueueSubscriber,\n Msg91SmsQueuePublisherDatabase,\n Msg91SmsQueueSubscriberDatabase,\n TwilioSmsQueuePublisherDatabase,\n TwilioSmsQueueSubscriberDatabase,\n TwilioSmsQueuePublisherRabbitmq,\n TwilioSmsQueueSubscriberRabbitmq,\n Msg91OTPQueuePublisher,\n Msg91OTPQueueSubscriber,\n OTPQueuePublisherDatabase,\n OTPQueueSubscriberDatabase,\n Msg91WhatsappQueuePublisher,\n Msg91WhatsappQueueSubscriber,\n Msg91WhatsappQueuePublisherDatabase,\n Msg91WhatsappQueueSubscriberDatabase,\n Three60WhatsappQueuePublisher,\n Three60WhatsappQueueSubscriber,\n Three60WhatsappQueuePublisherDatabase,\n Three60WhatsappQueueSubscriberDatabase,\n Three60WhatsappService,\n MqMessageService,\n MqMessageQueueService,\n TinyUrlService,\n PdfService,\n UuidExternalIdComputedFieldProvider,\n UuidExternalIdEntityComputedFieldProvider,\n ListOfModelsSelectionProvider,\n ListOfScheduledJobsSelectionProvider,\n LocaleListSelectionProvider,\n SoftDeleteAwareEventSubscriber,\n AccessTokenGuard,\n ApiKeyGuard,\n ApiKeyService,\n AuthenticationService,\n GoogleAuthenticationController,\n RefreshTokenIdsStorageService,\n SsoCodeStorageService,\n GoogleOauthStrategy,\n FacebookOAuthStrategy,\n MicrosoftOAuthStrategy,\n UserRegistrationListener,\n TestQueuePublisher,\n TestQueueSubscriber,\n\n ChatterQueuePublisherRabbitmq,\n ChatterQueueSubscriberRabbitmq,\n ChatterQueuePublisherDatabase,\n ChatterQueueSubscriberDatabase,\n\n TestQueuePublisherDatabase,\n TestQueueSubscriberDatabase,\n TestQueuePublisherRedis,\n TestQueueSubscriberRedis,\n ApiEmailQueuePublisherRedis,\n ApiEmailQueueSubscriberRedis,\n ChatterQueuePublisherRedis,\n ChatterQueueSubscriberRedis,\n ComputedFieldEvaluationPublisherRedis,\n ComputedFieldEvaluationSubscriberRedis,\n GenerateCodePublisherRedis,\n GenerateCodeSubscriberRedis,\n Msg91OTPQueuePublisherRedis,\n Msg91OTPQueueSubscriberRedis,\n Msg91SmsQueuePublisherRedis,\n Msg91SmsQueueSubscriberRedis,\n Msg91WhatsappQueuePublisherRedis,\n Msg91WhatsappQueueSubscriberRedis,\n SmtpEmailQueuePublisherRedis,\n SmtpEmailQueueSubscriberRedis,\n Three60WhatsappQueuePublisherRedis,\n Three60WhatsappQueueSubscriberRedis,\n TriggerMcpClientPublisherRedis,\n TriggerMcpClientSubscriberRedis,\n TwilioSmsQueuePublisherRedis,\n TwilioSmsQueueSubscriberRedis,\n GenerateCodePublisherDatabase,\n GenerateCodeSubscriberDatabase,\n GenerateCodePublisherRabbitmq,\n GenerateCodeSubscriberRabbitmq,\n Msg91OTPQueuePublisher,\n MqMessageQueueService,\n MqMessageService,\n ScheduledJobService,\n SchedulerServiceImpl,\n PermissionMetadataService,\n RoleMetadataService,\n PermissionMetadataSeederService,\n UserService,\n UserApiKeyRepository,\n UserRepository,\n SettingService,\n ConcatComputedFieldProvider,\n FileStorageProvider,\n FileS3StorageProvider,\n MediaRepository,\n ViewMetadataSubsciber,\n SavedFiltersService,\n UserViewMetadataService,\n SecurityRuleService,\n SecurityRuleRepository,\n SecurityRuleSubscriber,\n RequestContextService,\n SavedFiltersService,\n ChatterMessageService,\n ChatterMessageDetailsService,\n LocaleService,\n AuditSubscriber,\n ExportTemplateService,\n ExportTransactionService,\n ExcelService,\n CsvService,\n ImportTransactionService,\n ImportTransactionErrorLogService,\n CreatedByUpdatedBySubscriber,\n SystemFieldsSeederService,\n FieldMetadataRepository,\n ComputedEntityFieldSubscriber,\n ComputedFieldEvaluationPublisherDatabase,\n ComputedFieldEvaluationSubscriberDatabase,\n ComputedFieldEvaluationPublisherRabbitmq,\n ComputedFieldEvaluationSubscriberRabbitmq,\n ConcatEntityComputedFieldProvider,\n UserActivityHistoryService,\n DashboardService,\n DashboardVariableService,\n DashboardLayoutService,\n DashboardQuestionService,\n DashboardVariableSQLDynamicProvider,\n DasbhoardVariableTestDynamicProvider,\n ListOfDashboardVariableProvidersSelectionProvider,\n ListOfDashboardQuestionProvidersSelectionProvider,\n DashboardQuestionSqlDatasetConfigService,\n ChartJsSqlDataProvider,\n PrimeReactMeterGroupSqlDataProvider,\n PrimeReactDatatableSqlDataProvider,\n SqlExpressionResolverService,\n AiInteractionService,\n DashboardMapper,\n DashboardRepository,\n DashboardSubscriber,\n DashboardVariableSubscriber,\n DashboardQuestionSubscriber,\n DashboardQuestionSqlDatasetConfigSubscriber,\n NoopsEntityComputedFieldProviderService,\n\n McpHandlerFactory,\n // SolidCreateDashboardWithWidgetsMcpHandler,\n // SolidCreateDashboardQuestionMcpHandler,\n // SolidCreateDashboardQuestionSqlDatasetConfigMcpHandler,\n // SolidCreateDashboardWidgetMcpHandler,\n // SolidAddVariableToDashboardMcpHandler,\n // SolidAddQuestionToDashboardMcpHandler,\n\n SolidTsMorphService,\n\n ViewMetadataRepository,\n ScheduledJobRepository,\n AgentSessionRepository,\n AgentEventRepository,\n AgentSessionService,\n AgentEventService,\n ScheduledJobSubscriber,\n AlphaNumExternalIdComputationProvider,\n ListOfValuesSubscriber,\n ListOfValuesMapper,\n MailFactory,\n WhatsAppFactory,\n SmsFactory,\n ChatterMessageRepository,\n ChatterMessageDetailsRepository,\n AiInteractionRepository,\n DashboardQuestionSqlDatasetConfigRepository,\n DashboardQuestionRepository,\n DashboardVariableRepository,\n DashboardLayoutRepository,\n EmailTemplateRepository,\n ExportTemplateRepository,\n ExportTransactionRepository,\n ImportTransactionErrorLogRepository,\n ImportTransactionRepository,\n ListOfValuesRepository,\n LocaleRepository,\n MenuItemMetadataRepository,\n MqMessageQueueRepository,\n MqMessageRepository,\n PermissionMetadataRepository,\n RoleMetadataRepository,\n SavedFiltersRepository,\n SettingRepository,\n SmsTemplateRepository,\n UserActivityHistoryRepository,\n UserViewMetadataRepository,\n ModelMetadataRepository,\n ModuleMetadataRepository,\n ActionMetadataRepository,\n MediaStorageProviderMetadataRepository,\n FixturesService,\n FixturesSetupCommand,\n FixturesTearDownCommand,\n DatabaseBootstrapService,\n SequenceNumComputedFieldProvider,\n ModelSequenceService,\n ModelSequenceRepository,\n SolidCoreDefaultSettingsProvider,\n ImageEncodingService,\n SolidMicroserviceAdapter,\n ListOfRolesSelectionProvider,\n ],\n exports: [\n AiInteractionService,\n AuthenticationService,\n ChatterMessageDetailsRepository,\n ChatterMessageDetailsService,\n ChatterMessageRepository,\n ChatterMessageService,\n ConfigModule,\n CrudHelperService,\n CRUDService,\n CsvService,\n DiscoveryService,\n EmailTemplateService,\n ElasticEmailService,\n ExcelService,\n FieldMetadataService,\n DiskFileService,\n S3FileService,\n FileServiceFactory,\n DiskStoragePathBuilder,\n S3StoragePathBuilder,\n StoragePathBuilderFactory,\n HttpModule,\n ImportTransactionService,\n ListOfValuesService,\n MailFactory,\n WhatsAppFactory,\n SmsFactory,\n MediaService,\n MediaStorageProviderMetadataService,\n ModelMetadataHelperService,\n ModelMetadataService,\n ModuleMetadataService,\n MqMessageQueueService,\n MqMessageService,\n Msg91OTPService,\n Msg91SMSService,\n Msg91WhatsappService,\n MulterModule,\n PdfService,\n PollerService,\n PublisherFactory,\n RefreshModelCommand,\n RefreshModuleCommand,\n RequestContextService,\n SchedulerServiceImpl,\n SecurityRuleRepository,\n SmsTemplateService,\n SMTPEMailService,\n SolidIntrospectService,\n SolidRegistry,\n TextractService,\n TinyUrlService,\n TwilioSMSService,\n TypeOrmModule,\n UserActivityHistoryService,\n ImageEncodingService,\n SolidMicroserviceAdapter,\n UserService,\n SettingService,\n ],\n})\nexport class SolidCoreModule implements NestModule {\n configure(consumer: MiddlewareConsumer) {\n consumer\n .apply(\n express.json({ limit: '10mb' }),\n express.urlencoded({ limit: '10mb', extended: true }),\n )\n .forRoutes('*');\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computed-entity-field.subscriber.js","sourceRoot":"","sources":["../../src/subscribers/computed-entity-field.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mCAAmC;AAEnC,2CAA6G;AAE7G,iFAAmF;AACnF,8DAAuG;AAEvG,4FAAiF;AAU1E,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IAGtC,YAGqB,aAA4B,EAE7C,gBAAmF;QAFlE,kBAAa,GAAb,aAAa,CAAe;QAE5B,qBAAgB,GAAhB,gBAAgB,CAAkD;QAPtE,WAAM,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAW5D,CAAC;IAED,gBAAgB,CAAC,UAAsB;QACnC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IA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;QACD,IAAI,kBAAkB,IAAI,KAAK,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;YACxD,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QACnF,CAAC;QACD,IAAI,KAAK,CAAC,MAAM;YAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC7C,IAAI,gBAAgB,IAAI,KAAK,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;YACpD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;QAC/C,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CAEJ,CAAA;AArLY,sEAA6B;wCAA7B,6BAA6B;IAFzC,IAAA,mBAAU,EAAC,EAAE,KAAK,EAAE,cAAK,CAAC,SAAS,EAAE,CAAC;IAS9B,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,4CAAgB,CAAC,CAAC,CAAA;qCADX,8BAAa;QAEV,4CAAgB;GAR9C,6BAA6B,CAqLzC","sourcesContent":["import { camelCase } from 'lodash';\nimport { Delete } from \"@aws-sdk/client-s3\";\nimport { forwardRef, Inject, Injectable, InternalServerErrorException, Logger, Scope } from \"@nestjs/common\";\nimport { model } from \"mongoose\";\nimport { ComputedFieldTriggerOperation } from \"src/dtos/create-field-metadata.dto\";\nimport { ComputedFieldMetadata, SolidRegistry, TypeOrmEventContext } from \"src/helpers/solid-registry\";\nimport { IEntityPreComputeFieldProvider } from \"src/interfaces\";\nimport { PublisherFactory } from \"src/services/queues/publisher-factory.service\";\nimport { DataSource, EntitySubscriberInterface, InsertEvent, RemoveEvent, UpdateEvent } from \"typeorm\";\n\n// Create an interface i.e ComputedFieldEvaluationPayload which has same fields as the ComputedFieldMetadata and an additional field for the database entity\nexport interface ComputedFieldEvaluationPayload extends ComputedFieldMetadata {\n databaseEntity: any;\n}\n\n@Injectable({ scope: Scope.TRANSIENT })\n// @EventSubscriber()\nexport class ComputedEntityFieldSubscriber implements EntitySubscriberInterface {\n private readonly logger = new Logger(this.constructor.name);\n private dataSource: DataSource;\n constructor(\n // @InjectDataSource()\n // private readonly dataSource: DataSource,\n private readonly solidRegistry: SolidRegistry,\n @Inject(forwardRef(() => PublisherFactory))\n private readonly publisherFactory: PublisherFactory<ComputedFieldEvaluationPayload>\n // private readonly computedFieldPublisher: ComputedFieldEvaluationPublisherDatabase,\n ) {\n // this.dataSource.subscribers.push(this);\n }\n\n bindToDataSource(dataSource: DataSource) {\n this.dataSource = dataSource;\n this.dataSource.subscribers.push(this);\n }\n\n async beforeInsert(event: InsertEvent<any>): Promise<any> {\n const modelName = camelCase(event.metadata?.name ?? event.entity?.constructor?.name ?? '');\n const eventContext = this.sanitizeEventContext(event, 'beforeInsert');\n await this.handleComputedFieldEvaluation(event.entity, ComputedFieldTriggerOperation.beforeInsert, modelName, eventContext);\n }\n\n async beforeUpdate(event: UpdateEvent<any>): Promise<any> {\n const modelName = camelCase(event.metadata?.name ?? event.entity?.constructor?.name ?? '');\n const eventContext = this.sanitizeEventContext(event, 'beforeUpdate');\n // await this.handleComputedFieldEvaluation(event.databaseEntity, ComputedFieldTriggerOperation.beforeUpdate, modelName, eventContext);\n await this.handleComputedFieldEvaluation(event.entity, ComputedFieldTriggerOperation.beforeUpdate, modelName, eventContext);\n }\n\n afterInsert(event: InsertEvent<any>) {\n const modelName = camelCase(event.metadata?.name ?? event.entity?.constructor?.name ?? '');\n const eventContext = this.sanitizeEventContext(event, 'afterInsert');\n this.handleComputedFieldEvaluationJob(event.entity, ComputedFieldTriggerOperation.afterInsert, modelName, eventContext);\n }\n\n afterUpdate(event: UpdateEvent<any>) {\n const modelName = camelCase(event.metadata?.name ?? event.entity?.constructor?.name ?? event.databaseEntity?.constructor?.name ?? '');\n const eventContext = this.sanitizeEventContext(event, 'afterUpdate');\n // this.handleComputedFieldEvaluationJob(event.databaseEntity, ComputedFieldTriggerOperation.afterUpdate, modelName, eventContext);\n this.handleComputedFieldEvaluationJob(event.entity, ComputedFieldTriggerOperation.afterUpdate, modelName, eventContext);\n }\n\n afterRemove(event: RemoveEvent<any>) {\n const modelName = camelCase(event.metadata?.name ?? event.entity?.constructor?.name ?? event.databaseEntity?.constructor?.name ?? '');\n const eventContext = this.sanitizeEventContext(event, 'afterRemove');\n this.handleComputedFieldEvaluationJob(event.databaseEntity, ComputedFieldTriggerOperation.afterRemove, modelName, eventContext);\n }\n\n //FIXME: Need to add support for beforeRemove, beforeSoftRemove, afterSoftRemove, beforeRecover, afterRecover\n\n private async handleComputedFieldEvaluation(entity: any, currentOperation: ComputedFieldTriggerOperation, modelName: string, eventContext?: TypeOrmEventContext): Promise<void> {\n if (!entity) {\n return;\n }\n const computedFieldsTobeEvaluated = this.getComputedFieldsForEvaluation(\n this.solidRegistry.getComputedFieldMetadata(),\n currentOperation,\n modelName\n );\n //TODO: We can add a feature i.e dependsOn, where we can check if the computed field depends on other computed fields and evaluate them first\n for (const computedField of computedFieldsTobeEvaluated) {\n await this.evaluateComputedField(this.attachContext(computedField, eventContext), entity, currentOperation);\n }\n }\n\n private handleComputedFieldEvaluationJob(entity: any, currentOperation: ComputedFieldTriggerOperation, modelName: string, eventContext?: TypeOrmEventContext) {\n if (!entity) {\n return;\n }\n const computedFieldsTobeEvaluated = this.getComputedFieldsForEvaluation(\n this.solidRegistry.getComputedFieldMetadata(),\n currentOperation,\n modelName\n );\n //TODO: We can add a feature i.e dependsOn, where we can check if the computed field depends on other computed fields and evaluate them first\n for (const computedField of computedFieldsTobeEvaluated) {\n this.enqueueComputedFieldEvaluationJob(this.attachContext(computedField, eventContext), entity, eventContext);\n }\n }\n\n // Based on the current model name and current operation, identify all the computed providers that need to be evaluated\n // Pass the database entity and the context to the provider of type IEntityComputedFieldProvider\n private getComputedFieldsForEvaluation(computedFieldMetadata: ComputedFieldMetadata[] = [], currentOperation: ComputedFieldTriggerOperation, currentModelName: string) {\n return computedFieldMetadata.filter(\n (computedField) => computedField.computedFieldTriggerConfig.some(\n (trigger) => trigger.operations.includes(currentOperation) &&\n trigger.modelName === currentModelName\n )\n );\n }\n\n private async evaluateComputedField(computedFieldMetadata: ComputedFieldMetadata<any>, entity: any, currentOperation: ComputedFieldTriggerOperation) {\n // Skip pre-compute on insert when the payload already supplies the target field value.\n if (this.shouldSkipPreComputeOnInsert(computedFieldMetadata, entity, currentOperation)) {\n return;\n }\n const computedValue = await this.preComputeValue(computedFieldMetadata, entity);\n if (computedValue) {\n entity[computedFieldMetadata.fieldName] = computedValue; //TODO: This line here is just for backward compatibility, once the pre compute interface is change to return void, we will get rid of it.\n }\n }\n\n private shouldSkipPreComputeOnInsert(computedFieldMetadata: ComputedFieldMetadata<any>, entity: any, currentOperation: ComputedFieldTriggerOperation): boolean {\n if (currentOperation !== ComputedFieldTriggerOperation.beforeInsert) {\n return false;\n }\n if (!entity) {\n return false;\n }\n const fieldName = computedFieldMetadata.fieldName;\n if (!fieldName) {\n return false;\n }\n const hasValue = Object.prototype.hasOwnProperty.call(entity, fieldName) && entity[fieldName] !== undefined && entity[fieldName] !== null;\n return hasValue;\n }\n\n private async preComputeValue(computedFieldMetadata: ComputedFieldMetadata<any>, entity: any) {\n try {\n const provider = this.solidRegistry.getComputedFieldProvider(computedFieldMetadata.computedFieldValueProviderName);\n // Get the instance of the provider and assert it is of type IEntityComputedFieldProvider\n const providerInstance = provider.instance as IEntityPreComputeFieldProvider<any, any, any>; // IEntityComputedFieldProvider\n const computedValue = await providerInstance.preComputeValue(entity, computedFieldMetadata); //FIXME There should some way to check/assert if the provider actually has a postComputeAndSaveValue\n return computedValue; //TODO: This line here is just for backward compatibility, once the pre compute interface is change to return void, we will get rid of it.\n } catch (error) {\n throw new InternalServerErrorException(`Error evaluating computed field ${computedFieldMetadata.fieldName} for model ${computedFieldMetadata.modelName} for triggered entity ${entity.constructor.name}: ${error.message}`);\n }\n }\n\n private enqueueComputedFieldEvaluationJob(computedField: ComputedFieldMetadata<any>, databaseEntity: any, eventContext?: any) {\n const payload = {\n ...computedField,\n databaseEntity,\n // eventContext,\n };\n this.publisherFactory.publish({ payload }, 'ComputedFieldEvaluationPublisher')\n // this.computedFieldPublisher.publish({\n // payload\n // });\n }\n\n private attachContext<T extends ComputedFieldMetadata<any>>(computedField: T, eventContext?: any): T {\n if (!eventContext) return computedField;\n return {\n ...computedField,\n computedFieldValueProviderCtxt: {\n ...(computedField.computedFieldValueProviderCtxt || {}),\n },\n eventContext,\n };\n }\n\n private sanitizeEventContext(event: InsertEvent<any> | UpdateEvent<any> | RemoveEvent<any>, eventType: string): TypeOrmEventContext {\n if (!event) return undefined;\n const base: TypeOrmEventContext = {\n metadataName: event.metadata?.name,\n eventType: eventType,\n };\n if (\"entityId\" in event && event.entityId) {\n base.entityId = event.entityId;\n } else if (event.entity && (event.entity as any).id != null) {\n base.entityId = (event.entity as any).id;\n } else if (\"databaseEntity\" in event && (event.databaseEntity as any)?.id != null) {\n base.entityId = (event.databaseEntity as any).id;\n }\n if (\"updatedColumns\" in event && event.updatedColumns) {\n base.updatedColumns = event.updatedColumns.map((c: any) => c.propertyName);\n }\n if (\"updatedRelations\" in event && event.updatedRelations) {\n base.updatedRelations = event.updatedRelations.map((r: any) => r.propertyName);\n }\n if (event.entity) base.entity = event.entity;\n if (\"databaseEntity\" in event && event.databaseEntity) {\n base.databaseEntity = event.databaseEntity;\n }\n return base;\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"computed-entity-field.subscriber.js","sourceRoot":"","sources":["../../src/subscribers/computed-entity-field.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mCAAmC;AAEnC,2CAA6G;AAE7G,iFAAmF;AACnF,8DAAuG;AAEvG,4FAAiF;AAU1E,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IAGtC,YAGqB,aAA4B,EAE7C,gBAAmF;QAFlE,kBAAa,GAAb,aAAa,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Q,GAAI,KAAK,CAAC,cAAsB,CAAC,EAAE,CAAC;QACrD,CAAC;QACD,IAAI,gBAAgB,IAAI,KAAK,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;YACpD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QAC/E,CAAC;QACD,IAAI,kBAAkB,IAAI,KAAK,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;YACxD,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QACnF,CAAC;QACD,IAAI,KAAK,CAAC,MAAM;YAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC7C,IAAI,gBAAgB,IAAI,KAAK,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;YACpD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;QAC/C,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CAEJ,CAAA;AArLY,sEAA6B;wCAA7B,6BAA6B;IAFzC,IAAA,mBAAU,EAAC,EAAE,KAAK,EAAE,cAAK,CAAC,SAAS,EAAE,CAAC;IAS9B,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,4CAAgB,CAAC,CAAC,CAAA;qCADX,8BAAa;QAEV,4CAAgB;GAR9C,6BAA6B,CAqLzC","sourcesContent":["import { camelCase } from 'lodash';\nimport { Delete } from \"@aws-sdk/client-s3\";\nimport { forwardRef, Inject, Injectable, InternalServerErrorException, Logger, Scope } from \"@nestjs/common\";\nimport { model } from \"mongoose\";\nimport { ComputedFieldTriggerOperation } from \"src/dtos/create-field-metadata.dto\";\nimport { ComputedFieldMetadata, SolidRegistry, TypeOrmEventContext } from \"src/helpers/solid-registry\";\nimport { IEntityPreComputeFieldProvider } from \"src/interfaces\";\nimport { PublisherFactory } from \"src/services/queues/publisher-factory.service\";\nimport { DataSource, EntitySubscriberInterface, InsertEvent, RemoveEvent, UpdateEvent } from \"typeorm\";\n\n// Create an interface i.e ComputedFieldEvaluationPayload which has same fields as the ComputedFieldMetadata and an additional field for the database entity\nexport interface ComputedFieldEvaluationPayload extends ComputedFieldMetadata {\n databaseEntity: any;\n}\n\n@Injectable({ scope: Scope.TRANSIENT })\n// @EventSubscriber()\nexport class ComputedEntityFieldSubscriber implements EntitySubscriberInterface {\n private readonly logger = new Logger(this.constructor.name);\n private dataSource: DataSource;\n constructor(\n // @InjectDataSource()\n // private readonly dataSource: DataSource,\n private readonly solidRegistry: SolidRegistry,\n @Inject(forwardRef(() => PublisherFactory))\n private readonly publisherFactory: PublisherFactory<ComputedFieldEvaluationPayload>\n // private readonly computedFieldPublisher: ComputedFieldEvaluationPublisherDatabase,\n ) {\n // this.dataSource.subscribers.push(this);\n }\n\n bindToDataSource(dataSource: DataSource) {\n this.dataSource = dataSource;\n this.dataSource.subscribers.push(this);\n }\n\n async beforeInsert(event: InsertEvent<any>): Promise<any> {\n const modelName = camelCase(event.metadata?.name ?? event.entity?.constructor?.name ?? '');\n const eventContext = this.sanitizeEventContext(event, 'beforeInsert');\n await this.handleComputedFieldEvaluation(event.entity, ComputedFieldTriggerOperation.beforeInsert, modelName, eventContext);\n }\n\n async beforeUpdate(event: UpdateEvent<any>): Promise<any> {\n const modelName = camelCase(event.metadata?.name ?? event.entity?.constructor?.name ?? '');\n const eventContext = this.sanitizeEventContext(event, 'beforeUpdate');\n // await this.handleComputedFieldEvaluation(event.databaseEntity, ComputedFieldTriggerOperation.beforeUpdate, modelName, eventContext);\n await this.handleComputedFieldEvaluation(event.entity, ComputedFieldTriggerOperation.beforeUpdate, modelName, eventContext);\n }\n\n afterInsert(event: InsertEvent<any>) {\n const modelName = camelCase(event.metadata?.name ?? event.entity?.constructor?.name ?? '');\n const eventContext = this.sanitizeEventContext(event, 'afterInsert');\n this.handleComputedFieldEvaluationJob(event.entity, ComputedFieldTriggerOperation.afterInsert, modelName, eventContext);\n }\n\n afterUpdate(event: UpdateEvent<any>) {\n const modelName = camelCase(event.metadata?.name ?? event.entity?.constructor?.name ?? event.databaseEntity?.constructor?.name ?? '');\n const eventContext = this.sanitizeEventContext(event, 'afterUpdate');\n // this.handleComputedFieldEvaluationJob(event.databaseEntity, ComputedFieldTriggerOperation.afterUpdate, modelName, eventContext);\n this.handleComputedFieldEvaluationJob(event.entity, ComputedFieldTriggerOperation.afterUpdate, modelName, eventContext);\n }\n\n afterRemove(event: RemoveEvent<any>) {\n const modelName = camelCase(event.metadata?.name ?? event.entity?.constructor?.name ?? event.databaseEntity?.constructor?.name ?? '');\n const eventContext = this.sanitizeEventContext(event, 'afterRemove');\n this.handleComputedFieldEvaluationJob(event.databaseEntity, ComputedFieldTriggerOperation.afterRemove, modelName, eventContext);\n }\n\n //FIXME: Need to add support for beforeRemove, beforeSoftRemove, afterSoftRemove, beforeRecover, afterRecover\n\n private async handleComputedFieldEvaluation(entity: any, currentOperation: ComputedFieldTriggerOperation, modelName: string, eventContext?: TypeOrmEventContext): Promise<void> {\n if (!entity) {\n return;\n }\n const computedFieldsTobeEvaluated = this.getComputedFieldsForEvaluation(\n this.solidRegistry.getComputedFieldMetadata(),\n currentOperation,\n modelName\n );\n //TODO: We can add a feature i.e dependsOn, where we can check if the computed field depends on other computed fields and evaluate them first\n for (const computedField of computedFieldsTobeEvaluated) {\n await this.evaluateComputedField(this.attachContext(computedField, eventContext), entity, currentOperation);\n }\n }\n\n private handleComputedFieldEvaluationJob(entity: any, currentOperation: ComputedFieldTriggerOperation, modelName: string, eventContext?: TypeOrmEventContext) {\n if (!entity) {\n return;\n }\n const computedFieldsTobeEvaluated = this.getComputedFieldsForEvaluation(\n this.solidRegistry.getComputedFieldMetadata(),\n currentOperation,\n modelName\n );\n //TODO: We can add a feature i.e dependsOn, where we can check if the computed field depends on other computed fields and evaluate them first\n for (const computedField of computedFieldsTobeEvaluated) {\n this.enqueueComputedFieldEvaluationJob(this.attachContext(computedField, eventContext), entity, eventContext);\n }\n }\n\n // Based on the current model name and current operation, identify all the computed providers that need to be evaluated\n // Pass the database entity and the context to the provider of type IEntityComputedFieldProvider\n private getComputedFieldsForEvaluation(computedFieldMetadata: ComputedFieldMetadata[] = [], currentOperation: ComputedFieldTriggerOperation, currentModelName: string) {\n return computedFieldMetadata.filter(\n (computedField) => computedField.computedFieldTriggerConfig.some(\n (trigger) => trigger.operations.includes(currentOperation) &&\n trigger.modelName === currentModelName\n )\n );\n }\n\n private async evaluateComputedField(computedFieldMetadata: ComputedFieldMetadata<any>, entity: any, currentOperation: ComputedFieldTriggerOperation) {\n // Skip pre-compute on insert when the payload already supplies the target field value.\n if (this.shouldSkipPreComputeOnInsert(computedFieldMetadata, entity, currentOperation)) {\n return;\n }\n const computedValue = await this.preComputeValue(computedFieldMetadata, entity);\n if (computedValue) {\n entity[computedFieldMetadata.fieldName] = computedValue; //TODO: This line here is just for backward compatibility, once the pre compute interface is change to return void, we will get rid of it.\n }\n }\n\n private shouldSkipPreComputeOnInsert(computedFieldMetadata: ComputedFieldMetadata<any>, entity: any, currentOperation: ComputedFieldTriggerOperation): boolean {\n if (currentOperation !== ComputedFieldTriggerOperation.beforeInsert) {\n return false;\n }\n if (!entity) {\n return false;\n }\n const fieldName = computedFieldMetadata.fieldName;\n if (!fieldName) {\n return false;\n }\n const hasValue = Object.prototype.hasOwnProperty.call(entity, fieldName) && entity[fieldName] !== undefined && entity[fieldName] !== null;\n return hasValue;\n }\n\n private async preComputeValue(computedFieldMetadata: ComputedFieldMetadata<any>, entity: any) {\n try {\n const provider = this.solidRegistry.getComputedFieldProvider(computedFieldMetadata.computedFieldValueProviderName);\n // Get the instance of the provider and assert it is of type IEntityComputedFieldProvider\n const providerInstance = provider.instance as IEntityPreComputeFieldProvider<any, any, any>; // IEntityComputedFieldProvider\n const computedValue = await providerInstance.preComputeValue(entity, computedFieldMetadata); //FIXME There should some way to check/assert if the provider actually has a postComputeAndSaveValue\n return computedValue; //TODO: This line here is just for backward compatibility, once the pre compute interface is change to return void, we will get rid of it.\n } catch (error: any) {\n throw new InternalServerErrorException(`Error evaluating computed field ${computedFieldMetadata.fieldName} for model ${computedFieldMetadata.modelName} for triggered entity ${entity.constructor.name}: ${error.message}`);\n }\n }\n\n private enqueueComputedFieldEvaluationJob(computedField: ComputedFieldMetadata<any>, databaseEntity: any, eventContext?: any) {\n const payload = {\n ...computedField,\n databaseEntity,\n // eventContext,\n };\n this.publisherFactory.publish({ payload }, 'ComputedFieldEvaluationPublisher')\n // this.computedFieldPublisher.publish({\n // payload\n // });\n }\n\n private attachContext<T extends ComputedFieldMetadata<any>>(computedField: T, eventContext?: any): T {\n if (!eventContext) return computedField;\n return {\n ...computedField,\n computedFieldValueProviderCtxt: {\n ...(computedField.computedFieldValueProviderCtxt || {}),\n },\n eventContext,\n };\n }\n\n private sanitizeEventContext(event: InsertEvent<any> | UpdateEvent<any> | RemoveEvent<any>, eventType: string): TypeOrmEventContext {\n if (!event) return undefined;\n const base: TypeOrmEventContext = {\n metadataName: event.metadata?.name,\n eventType: eventType,\n };\n if (\"entityId\" in event && event.entityId) {\n base.entityId = event.entityId;\n } else if (event.entity && (event.entity as any).id != null) {\n base.entityId = (event.entity as any).id;\n } else if (\"databaseEntity\" in event && (event.databaseEntity as any)?.id != null) {\n base.entityId = (event.databaseEntity as any).id;\n }\n if (\"updatedColumns\" in event && event.updatedColumns) {\n base.updatedColumns = event.updatedColumns.map((c: any) => c.propertyName);\n }\n if (\"updatedRelations\" in event && event.updatedRelations) {\n base.updatedRelations = event.updatedRelations.map((r: any) => r.propertyName);\n }\n if (event.entity) base.entity = event.entity;\n if (\"databaseEntity\" in event && event.databaseEntity) {\n base.databaseEntity = event.databaseEntity;\n }\n return base;\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-rule.subscriber.d.ts","sourceRoot":"","sources":["../../src/subscribers/security-rule.subscriber.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1F,qBACa,sBAAuB,YAAW,yBAAyB,CAAC,YAAY,CAAC;IAI9E,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,QAAQ,CAAC,2BAA2B,EAAE,2BAA2B;IACjE,QAAQ,CAAC,gBAAgB,EAAE,sBAAsB;IALrD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAG7C,UAAU,EAAE,UAAU,EAC9B,2BAA2B,EAAE,2BAA2B,EACxD,gBAAgB,EAAE,sBAAsB;IAKrD,QAAQ;IAIF,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC;IAI5C,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC;IAI5C,iBAAiB,CAAC,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"security-rule.subscriber.d.ts","sourceRoot":"","sources":["../../src/subscribers/security-rule.subscriber.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1F,qBACa,sBAAuB,YAAW,yBAAyB,CAAC,YAAY,CAAC;IAI9E,OAAO,CAA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