@solidstarters/solid-core 1.2.157 → 1.2.159
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/config/cache.options.js +2 -7
- package/dist/config/cache.options.js.map +1 -1
- package/dist/constants/error-messages.js +1 -1
- package/dist/constants/error-messages.js.map +1 -1
- package/dist/controllers/authentication.controller.d.ts +0 -2
- package/dist/controllers/authentication.controller.d.ts.map +1 -1
- package/dist/controllers/authentication.controller.js +5 -5
- package/dist/controllers/authentication.controller.js.map +1 -1
- package/dist/factories/whatsapp.factory.d.ts.map +1 -1
- package/dist/factories/whatsapp.factory.js +1 -1
- package/dist/factories/whatsapp.factory.js.map +1 -1
- package/dist/helpers/environment.helper.d.ts +2 -0
- package/dist/helpers/environment.helper.d.ts.map +1 -1
- package/dist/helpers/environment.helper.js +7 -0
- package/dist/helpers/environment.helper.js.map +1 -1
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +13 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/model-metadata-helper.service.d.ts +5 -1
- package/dist/helpers/model-metadata-helper.service.d.ts.map +1 -1
- package/dist/helpers/model-metadata-helper.service.js +32 -2
- package/dist/helpers/model-metadata-helper.service.js.map +1 -1
- package/dist/helpers/string.helper.d.ts +2 -0
- package/dist/helpers/string.helper.d.ts.map +1 -0
- package/dist/helpers/string.helper.js +10 -0
- package/dist/helpers/string.helper.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/repository/security-rule.repository.d.ts.map +1 -1
- package/dist/repository/security-rule.repository.js +16 -9
- package/dist/repository/security-rule.repository.js.map +1 -1
- package/dist/repository/user.repository.d.ts +12 -0
- package/dist/repository/user.repository.d.ts.map +1 -0
- package/dist/repository/user.repository.js +34 -0
- package/dist/repository/user.repository.js.map +1 -0
- package/dist/seeders/module-metadata-seeder.service.d.ts +12 -12
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +33 -13
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +40 -6
- package/dist/services/authentication.service.d.ts +0 -2
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +15 -14
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/chatter-message.service.d.ts +8 -2
- package/dist/services/chatter-message.service.d.ts.map +1 -1
- package/dist/services/chatter-message.service.js +155 -30
- package/dist/services/chatter-message.service.js.map +1 -1
- package/dist/services/crud-helper.service.d.ts +7 -3
- package/dist/services/crud-helper.service.d.ts.map +1 -1
- package/dist/services/crud-helper.service.js +17 -5
- package/dist/services/crud-helper.service.js.map +1 -1
- package/dist/services/list-of-values.service.js.map +1 -1
- package/dist/services/user.service.d.ts +3 -2
- package/dist/services/user.service.d.ts.map +1 -1
- package/dist/services/user.service.js +2 -2
- package/dist/services/user.service.js.map +1 -1
- package/dist/services/view-metadata.service.d.ts +3 -1
- package/dist/services/view-metadata.service.d.ts.map +1 -1
- package/dist/services/view-metadata.service.js +5 -2
- package/dist/services/view-metadata.service.js.map +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +16 -7
- package/dist/solid-core.module.js.map +1 -1
- package/dist/subscribers/audit.subscriber.d.ts +3 -1
- package/dist/subscribers/audit.subscriber.d.ts.map +1 -1
- package/dist/subscribers/audit.subscriber.js +10 -5
- package/dist/subscribers/audit.subscriber.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/src/config/cache.options.ts +1 -6
- package/src/constants/error-messages.ts +1 -1
- package/src/controllers/authentication.controller.ts +5 -5
- package/src/factories/whatsapp.factory.ts +2 -1
- package/src/helpers/environment.helper.ts +9 -0
- package/src/helpers/index.ts +9 -0
- package/src/helpers/model-metadata-helper.service.ts +30 -2
- package/src/helpers/string.helper.ts +4 -0
- package/src/index.ts +1 -0
- package/src/repository/security-rule.repository.ts +25 -12
- package/src/repository/user.repository.ts +17 -0
- package/src/seeders/module-metadata-seeder.service.ts +36 -15
- package/src/seeders/seed-data/solid-core-metadata.json +40 -6
- package/src/services/authentication.service.ts +20 -14
- package/src/services/chatter-message.service.ts +185 -35
- package/src/services/crud-helper.service.ts +24 -6
- package/src/services/list-of-values.service.ts +1 -1
- package/src/services/user.service.ts +3 -2
- package/src/services/view-metadata.service.ts +3 -1
- package/src/solid-core.module.ts +13 -3
- package/src/subscribers/audit.subscriber.ts +9 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-metadata-seeder.service.js","sourceRoot":"","sources":["../../src/seeders/module-metadata-seeder.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,uCAAyB;AACzB,2CAA6B;AAE7B,sFAA4D;AAG5D,iFAA4E;AAE5E,+EAA0E;AAC1E,iHAA0G;AAC1G,+EAA0E;AAC1E,2DAAwD;AACxD,+EAA4E;AAC5E,+HAAuH;AAEvH,+EAA2E;AAC3E,2EAAuE;AAEvE,6EAAwE;AACxE,iFAA4E;AAC5E,uFAAiF;AACjF,6CAAmD;AACnD,uFAA4E;AAC5E,qCAAqC;AACrC,8DAA0D;AAC1D,6EAAwE;AACxE,4DAAqF;AACrF,oGAAqE;AACrE,qDAAkD;AAClD,4EAAoD;AAEpD,iEAA8D;AAC9D,+DAAsD;AAEtD,qFAAiF;AACjF,+EAA0E;AAE1E,iFAA2E;AAE3E,6EAA0E;AAE1E,qFAAiF;AAI1E,IAAM,2BAA2B,mCAAjC,MAAM,2BAA2B;IAGpC,YACqB,qBAA4C,EAC5C,oBAA0C,EAC1C,oBAA0C,EAC1C,mCAAwE,EACxE,WAAgC,EAChC,WAAwB,EACxB,qBAA4C,EAC5C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AA;IACrB,YAAA,IAAA,eAAM,EAAC,uBAAY,CAAC,GAAG,CAAC,CAAA;IAGxB,YAAA,IAAA,0BAAgB,EAAC,wBAAO,EAAE,SAAS,CAAC,CAAA;qCAvBG,+CAAqB;QACtB,6CAAoB;QACpB,6CAAoB;QACL,6EAAmC;QAC3D,2CAAmB;QACnB,0BAAW;QACD,8CAAqB;QACxB,+CAAqB;QACnB,oDAAuB;QAC3B,2CAAmB;QACF,0FAAyC;QACtD,6CAAoB;QACtB,yCAAkB;QACjB,4CAAmB;QAExB,oBAAU;QACX,8BAAa,0BAMZ,gCAAc;QAExB,oBAAU;QACN,iDAAsB;QACb,wDAAyB;QACrC,0CAAmB;QACV,iDAAsB;GAhClD,2BAA2B,CAojBvC","sourcesContent":["import { Inject, Injectable, Logger } from '@nestjs/common';\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nimport appBuilderConfig from '../config/app-builder.config';\nimport { ConfigType } from '@nestjs/config';\nimport { CreateModuleMetadataDto } from '../dtos/create-module-metadata.dto';\nimport { ModuleMetadataService } from '../services/module-metadata.service';\nimport { CreateModelMetadataDto } from '../dtos/create-model-metadata.dto';\nimport { ModelMetadataService } from '../services/model-metadata.service';\nimport { MediaStorageProviderMetadataService } from '../services/media-storage-provider-metadata.service';\nimport { FieldMetadataService } from '../services/field-metadata.service';\nimport { UserService } from 'src/services/user.service';\nimport { AuthenticationService } from 'src/services/authentication.service';\nimport { MediaStorageProviderMetadataSeederService } from '../services/media-storage-provider-metadata-seeder.service';\nimport { CreateEmailTemplateDto } from 'src/dtos/create-email-template.dto';\nimport { EmailTemplateService } from 'src/services/email-template.service';\nimport { SmsTemplateService } from 'src/services/sms-template.service';\nimport { CreateSmsTemplateDto } from 'src/dtos/create-sms-template.dto';\nimport { ViewMetadataService } from '../services/view-metadata.service';\nimport { ActionMetadataService } from '../services/action-metadata.service';\nimport { MenuItemMetadataService } from '../services/menu-item-metadata.service';\nimport { InjectRepository } from '@nestjs/typeorm';\nimport { PermissionMetadata } from '../entities/permission-metadata.entity';\nimport { Repository } from 'typeorm';\nimport { SolidRegistry } from '../helpers/solid-registry';\nimport { RoleMetadataService } from '../services/role-metadata.service';\nimport { getCoreModuleNames, getDynamicModuleNames } from '../helpers/module.helper';\nimport solidCoreMetadata from './seed-data/solid-core-metadata.json';\nimport { iamConfig } from 'src/config/iam.config';\nimport commonConfig from 'src/config/common.config';\nimport { CreateSettingDto } from 'src/dtos/create-setting.dto';\nimport { SettingService } from 'src/services/setting.service';\nimport { Setting } from 'src/entities/setting.entity';\nimport { CreateSecurityRuleDto } from 'src/dtos/create-security-rule.dto';\nimport { SecurityRuleRepository } from 'src/repository/security-rule.repository';\nimport { ListOfValuesService } from 'src/services/list-of-values.service';\nimport { CreateListOfValuesDto } from 'src/dtos/create-list-of-values.dto';\nimport { SystemFieldsSeederService } from './system-fields-seeder.service';\nimport { CreateDashboardDto } from 'src/dtos/create-dashboard.dto';\nimport { DashboardRepository } from 'src/repository/dashboard.repository';\n// import { CreateScheduledJobDto } from 'src/dtos/create-scheduled-job.dto';\nimport { ScheduledJobRepository } from 'src/repository/scheduled-job.repository';\nimport { CreateScheduledJobDto } from 'src/dtos/create-scheduled-job.dto';\n\n@Injectable()\nexport class ModuleMetadataSeederService {\n private readonly logger = new Logger(ModuleMetadataSeederService.name);\n\n constructor(\n private readonly moduleMetadataService: ModuleMetadataService,\n private readonly modelMetadataService: ModelMetadataService,\n private readonly fieldMetadataService: FieldMetadataService,\n private readonly mediaStorageProviderMetadataService: MediaStorageProviderMetadataService,\n private readonly roleService: RoleMetadataService,\n private readonly userService: UserService,\n private readonly authenticationService: AuthenticationService,\n private readonly solidActionService: ActionMetadataService,\n private readonly solidMenuItemService: MenuItemMetadataService,\n private readonly solidViewService: ViewMetadataService,\n private readonly mediaStorageProviderSeederService: MediaStorageProviderMetadataSeederService,\n private readonly emailTemplateService: EmailTemplateService,\n private readonly smsTemplateService: SmsTemplateService,\n private readonly listOfValuesService: ListOfValuesService,\n @InjectRepository(PermissionMetadata)\n private readonly permissionRepo: Repository<PermissionMetadata>,\n private readonly solidRegistry: SolidRegistry,\n @Inject(appBuilderConfig.KEY)\n private readonly appBuilderConfiguration: ConfigType<typeof appBuilderConfig>,\n @Inject(iamConfig.KEY) private readonly iamConfiguration: ConfigType<typeof iamConfig>,\n @Inject(commonConfig.KEY)\n private readonly commonConfiguration: ConfigType<typeof commonConfig>,\n private readonly seetingService: SettingService,\n @InjectRepository(Setting, 'default')\n readonly settingsRepo: Repository<Setting>,\n readonly securityRuleRepo: SecurityRuleRepository,\n readonly systemFieldsSeederService: SystemFieldsSeederService,\n readonly dashboardRepo: DashboardRepository,\n readonly scheduledJobRepository: ScheduledJobRepository,\n ) { }\n\n async seed() {\n\n const typedSolidCoreMetadata: any = structuredClone(solidCoreMetadata);\n\n // Run the permissions seeder. \n // await this.permissionsSeederService.seed();\n this.logger.log(`Seeding permissions`);\n await this.seedPermissions();\n\n // TODO: move this also the main loop processing. Generate the media storage providers required by default\n this.logger.log(`Seeding media storage providers`);\n await this.mediaStorageProviderSeederService.seed();\n\n // Seed any missing system fields metadata for all models.\n this.logger.log(`Seeding system fields metadata`);\n await this.systemFieldsSeederService.seed();\n\n // Read the module metadata from a file specified in the .env \n // Add the core json file as the first entry in the above array.\n // Please note the sequence of core files is important below...\n const coreModules = getCoreModuleNames();\n const seedDataFiles = [\n // 'src/common/seeders/seed-data/common-metadata.json',\n // 'src/iam/seeders/seed-data/iam-metadata.json',\n // 'src/app-builder/seeders/seed-data/app-builder-metadata.json',\n // 'src/queues/seeders/seed-data/queues-metadata.json',\n // ...coreModules.map(module => `src/${module}/seeders/seed-data/${module}-metadata.json`),\n typedSolidCoreMetadata\n ];\n this.logger.debug(`getting dynamics modules`);\n const enabledModules = getDynamicModuleNames();\n this.logger.log(`Seeding metadata`);\n\n for (let i = 0; i < enabledModules.length; i++) {\n const enabledModule = enabledModules[i];\n const enabledModuleSeedFile = `module-metadata/${enabledModule}/${enabledModule}-metadata.json`\n const fullPath = path.join(process.cwd(), enabledModuleSeedFile);\n if (fs.existsSync(fullPath)) {\n const overallMetadata: any = JSON.parse(fs.readFileSync(fullPath, 'utf-8').toString());\n\n seedDataFiles.push(overallMetadata)\n }\n }\n\n this.logger.debug(`Seed data files are: ${seedDataFiles}`);\n let usersDetail;\n for (let i = 0; i < seedDataFiles.length; i++) {\n\n // Module, model & field handling.\n const overallMetadata = seedDataFiles[i];\n // const fullPath = path.join(process.cwd(), seedDataFile);\n\n // For each module metadata seed file provided, read contents, parse & convert to a variable. \n // this.logger.log(`[Start] module seed data: ${fullPath}`);\n\n // const overallMetadata: any = JSON.parse(fs.readFileSync(fullPath, 'utf-8').toString());\n\n // Process module metadata first. \n const moduleMetadata: CreateModuleMetadataDto = overallMetadata.moduleMetadata;\n this.logger.log(`[Start] Processing module metadata for ${moduleMetadata.name}`)\n await this.seedModuleModelFields(moduleMetadata);\n this.logger.log(`[End] Processing module metadata for ${moduleMetadata.name}`)\n\n // Media Storage provider templates\n this.logger.log(`[Start] Processing Media Storage Provider for ${moduleMetadata.name}`);\n const mediaStorageProviders = overallMetadata.mediaStorageProviders;\n await this.seedMediaStorageProviders(mediaStorageProviders);\n this.logger.log(`[End] Processing Media Storage Provider for ${moduleMetadata.name}`);\n\n // Custom role handling\n this.logger.log(`[End] Processing roles for ${moduleMetadata.name}`)\n const roles = overallMetadata.roles;\n\n // Every role configuration in the seeder json can optionally have a permissions attribute. \n // While creating roles we are only passing the role name to be used. \n await this.roleService.createRolesIfNotExists(roles.map(role => { return { name: role.name } }));\n\n // After roles are created, we iterate over all roles and attach permissions (if specified in the seeder json) to the respective role.\n for (let roleI = 0; roleI < roles.length; roleI++) {\n const role = roles[roleI];\n if (role.permissions) {\n await this.roleService.addPermissionsToRole(role.name, role.permissions)\n }\n }\n this.logger.log(`[End] Processing roles for ${moduleMetadata.name}`)\n\n // Custom user handling\n this.logger.log(`[Start] Processing users for ${moduleMetadata.name}`);\n const users = overallMetadata.users;\n usersDetail = users;\n await this.seedUsers(users);\n this.logger.log(`[End] Processing users for ${moduleMetadata.name}`)\n\n // Application Module View handling \n this.logger.log(`[Start] Processing views for ${moduleMetadata.name}`);\n const views = overallMetadata.views;\n await this.seedViews(views);\n this.logger.log(`[End] Processing views for ${moduleMetadata.name}`)\n\n // Application Module Action handling\n this.logger.log(`[Start] Processing actions for ${moduleMetadata.name}`);\n const actions = overallMetadata.actions;\n await this.seedActions(actions);\n this.logger.log(`[End] Processing actions for ${moduleMetadata.name}`)\n\n // Application Module Menu handling \n this.logger.log(`[Start] Processing menus for ${moduleMetadata.name}`);\n const menus = overallMetadata.menus;\n await this.seedMenus(menus);\n this.logger.log(`[End] Processing menus for ${moduleMetadata.name}`)\n\n // Email templates \n this.logger.log(`[Start] Processing email templates for ${moduleMetadata.name}`);\n const emailTemplates: CreateEmailTemplateDto[] = overallMetadata.emailTemplates;\n await this.seedEmailTemplates(emailTemplates, moduleMetadata);\n this.logger.log(`[End] Processing email templates for ${moduleMetadata.name}`);\n\n // Sms templates\n this.logger.log(`[Start] Processing sms templates for ${moduleMetadata.name}`);\n const smsTemplates: CreateSmsTemplateDto[] = overallMetadata.smsTemplates;\n await this.seedSmsTemplates(smsTemplates, moduleMetadata);\n this.logger.log(`[End] Processing sms templates for ${moduleMetadata.name}`);\n\n // Settings\n this.logger.log(`[Start] Processing settings for ${moduleMetadata.name}`);\n await this.seetingService.seedDefaultSettings();\n this.logger.log(`[End] Processing settings for ${moduleMetadata.name}`);\n\n // Security rules\n this.logger.log(`[Start] Processing security rules for ${moduleMetadata.name}`);\n const securityRules: CreateSecurityRuleDto[] = overallMetadata.securityRules;\n await this.seedSecurityRules(securityRules);\n this.logger.log(`[End] Processing security rules for ${moduleMetadata.name}`);\n\n // List Of Values\n this.logger.log(`[Start] Processing List Of Values for ${moduleMetadata.name}`);\n const listOfValues: CreateListOfValuesDto[] = overallMetadata.listOfValues;\n await this.seedListOfValues(listOfValues);\n this.logger.log(`[End] Processing List Of Values for ${moduleMetadata.name}`);\n\n // Dashboards\n this.logger.log(`[Start] Processing dashboards for ${moduleMetadata.name}`);\n const dashboards: CreateDashboardDto[] = overallMetadata.dashboards;\n await this.seedDashboards(dashboards);\n this.logger.log(`[End] Processing dashboards for ${moduleMetadata.name}`);\n\n // Scheduled Jobs\n this.logger.debug(`[Start] Processing scheduled jobs for ${moduleMetadata.name}`);\n const scheduledJobs: CreateScheduledJobDto[] = overallMetadata.scheduledJobs;\n if (scheduledJobs?.length > 0) {\n await this.seedScheduledJobs(scheduledJobs);\n }\n this.logger.debug(`[End] Processing scheduled jobs for ${moduleMetadata.name}`);\n\n this.logger.debug(`[End] module seed data: ${overallMetadata}`);\n }\n\n // Post seed data file processing. \n\n // 1. Give all permissions to the Admin role.\n this.logger.log(`About to add all permissions to the Admin role`);\n await this.roleService.addAllPermissionsToRole(\"Admin\");\n // 2. Give wrapSettings permissions to the Public role.\n const internalRolePermission = [\n 'UserController.findMany',\n 'UserController.checkIfPermissionExists',\n 'UserController.findOne',\n 'MenuItemMetadataController.findMany',\n 'MenuItemMetadataController.findUserMenus',\n 'MenuItemMetadataController.findOne',\n 'ViewMetadataController.getLayout',\n 'ViewMetadataController.findMany',\n 'ViewMetadataController.findOne',\n 'AuthenticationController.changePassword',\n 'FieldMetadataController.getSelectionDynamicValues',\n 'FieldMetadataController.getSelectionDynamicValue',\n 'FieldMetadataController.findFieldDefaultMetaData',\n 'SavedFiltersController.delete',\n 'SavedFiltersController.deleteMany',\n 'SavedFiltersController.findOne',\n 'SavedFiltersController.findMany',\n 'SavedFiltersController.recover',\n 'SavedFiltersController.recoverMany',\n 'SavedFiltersController.partialUpdate',\n 'SavedFiltersController.update',\n 'SavedFiltersController.insertMany',\n 'SavedFiltersController.create',\n 'AuthenticationController.logout'\n ]\n await this.roleService.addPermissionToRole('Internal User', internalRolePermission);\n await this.roleService.addPermissionToRole('Public', ['SettingController.wrapSettings', 'AuthenticationController.logout']);\n this.logger.log(`All Seeders finished`);\n this.logger.log(`Newly created username is: ${usersDetail?.length > 0 ? usersDetail[0]?.username : ''} and password is ${usersDetail?.length > 0 ? usersDetail[0]?.password : ''}`);\n }\n\n\n async seedPermissions() {\n\n const controllers = this.solidRegistry.getControllers();\n\n // Loop over the countries and create them.\n for (let id = 0; id < controllers.length; id++) {\n try {\n const controller = controllers[id];\n this.logger.log(`Resolving controller: ${controller.name}`);\n\n const methods = controller.methods;\n for (let mId = 0; mId < methods.length; mId++) {\n\n const methodName = methods[mId];\n const permissionName = `${controller.name}.${methodName}`;\n\n const existingPermission = await this.permissionRepo.findOne({\n where: {\n name: permissionName\n }\n });\n\n if (existingPermission) {\n this.logger.log(`Permission ${permissionName} already exists.`);\n }\n else {\n this.logger.log(`Permission ${permissionName} does not exist, creating new.`);\n\n const newPermission = this.permissionRepo.create({\n name: permissionName\n });\n await this.permissionRepo.save(newPermission);\n\n }\n }\n\n } catch (error) {\n this.logger.error(error);\n }\n }\n }\n\n async seedMediaStorageProviders(mediaStorageProviders: any) {\n for (let i = 0; i < mediaStorageProviders.length; i++) {\n const mediaStorageProivder = mediaStorageProviders[i];\n await this.mediaStorageProviderMetadataService.upsert(mediaStorageProivder);\n }\n }\n\n async seedEmailTemplates(emailTemplates: CreateEmailTemplateDto[], moduleMetadata: CreateModuleMetadataDto) {\n if (!emailTemplates) {\n return;\n }\n\n for (let i = 0; i < emailTemplates.length; i++) {\n const emailTemplate = emailTemplates[i];\n this.logger.log(`Found ${emailTemplate.name} email template`);\n\n // We need to load the actual template contents. \n if (moduleMetadata.name === 'solid-core') {\n const modulePath = path.dirname(require.resolve('@solidstarters/solid-core'));\n const seedDataPath = path.join(modulePath, '../src/seeders/seed-data/email-templates');\n const filePath = path.join(seedDataPath, emailTemplate.body);\n this.logger.log(`Seeding email template from solid-core at path: ${filePath}`);\n if (fs.existsSync(filePath)) {\n emailTemplate.body = fs.readFileSync(filePath, 'utf-8').toString();\n }\n }\n else {\n // Check if file exists\n const emailTemplateHandlebar = `module-metadata/${moduleMetadata.name}/email-templates/${emailTemplate.body}`\n const fullPath = path.join(process.cwd(), emailTemplateHandlebar);\n this.logger.log(`Seeding custom email template from consuming model at path: ${fullPath}`);\n if (fs.existsSync(fullPath)) {\n emailTemplate.body = fs.readFileSync(fullPath, 'utf-8').toString();\n }\n }\n\n // Save to DB.\n await this.emailTemplateService.removeByName(emailTemplate.name);\n await this.emailTemplateService.create(emailTemplate);\n }\n\n }\n\n async seedSmsTemplates(smsTemplates: CreateSmsTemplateDto[], moduleMetadata: CreateModuleMetadataDto) {\n if (!smsTemplates) {\n return;\n }\n\n for (let i = 0; i < smsTemplates.length; i++) {\n const smsTemplate = smsTemplates[i];\n this.logger.log(`Found ${smsTemplate.name} sms template`);\n\n // We need to load the actual template contents. \n if (moduleMetadata.name === 'solid-core') {\n const modulePath = path.dirname(require.resolve('@solidstarters/solid-core'));\n const seedDataPath = path.join(modulePath, '../src/seeders/seed-data/sms-templates');\n const filePath = path.join(seedDataPath, smsTemplate.body);\n this.logger.log(`Seeding sms template from solid-core at path: ${filePath}`);\n if (fs.existsSync(filePath)) {\n smsTemplate.body = fs.readFileSync(filePath, 'utf-8').toString();\n }\n }\n else {\n // Check if file exists\n const emailTemplateHandlebar = `module-metadata/${moduleMetadata.name}/sms-templates/${smsTemplate.body}`\n const fullPath = path.join(process.cwd(), emailTemplateHandlebar);\n this.logger.log(`Seeding custom sms template from consuming model at path: ${fullPath}`);\n if (fs.existsSync(fullPath)) {\n smsTemplate.body = fs.readFileSync(fullPath, 'utf-8').toString();\n }\n }\n\n\n // Save to DB.\n await this.smsTemplateService.removeByName(smsTemplate.name);\n await this.smsTemplateService.create(smsTemplate);\n }\n }\n\n async seedMenus(menus: any) {\n if (!menus) {\n return;\n }\n\n for (let j = 0; j < menus.length; j++) {\n const menuData = menus[j];\n\n const adminRole = await this.roleService.findRoleByName('Admin');\n\n const specifiedRoles = menuData['roles'];\n\n // If the developer has specified roles, then resolve them, making sure that admin role is also given.\n const specifiedRoleObjects = [adminRole];\n if (specifiedRoles) {\n for (let i = 0; i < specifiedRoles.length; i++) {\n const specifiedRole = specifiedRoles[i];\n const specifiedRoleObject = await this.roleService.findRoleByName(specifiedRole);\n if (!specifiedRoleObject) {\n throw new Error(`Invalid role: (${specifiedRole}) specified against menu with display name ${menuData.displayName}.`);\n }\n specifiedRoleObjects.push(specifiedRoleObject);\n }\n }\n\n menuData['roles'] = specifiedRoleObjects;\n menuData['action'] = await this.solidActionService.findOneByUserKey(menuData.actionUserKey);\n menuData['module'] = await this.moduleMetadataService.findOneByUserKey(menuData.moduleUserKey);\n\n if (menuData.parentMenuItemUserKey) {\n menuData['parentMenuItem'] = await this.solidMenuItemService.findOneByUserKey(menuData.parentMenuItemUserKey);\n } else {\n menuData['parentMenuItem'] = null\n }\n await this.solidMenuItemService.upsert(menuData);\n }\n }\n\n async seedActions(actions: any) {\n if (!actions) {\n return;\n }\n\n for (let j = 0; j < actions.length; j++) {\n const actionData = actions[j];\n actionData['module'] = await this.moduleMetadataService.findOneByUserKey(actionData.moduleUserKey);\n if (actionData.type === 'solid') {\n actionData['model'] = await this.modelMetadataService.findOneByUserKey(actionData.modelUserKey);\n actionData['view'] = await this.solidViewService.findOneByUserKey(actionData.viewUserKey);\n }\n else {\n if (actionData.modelUserKey) {\n actionData['model'] = await this.modelMetadataService.findOneByUserKey(actionData.modelUserKey);\n }\n }\n await this.solidActionService.upsert(actionData);\n }\n }\n\n async seedViews(views: any) {\n if (!views) {\n return;\n }\n\n for (let j = 0; j < views.length; j++) {\n const viewData = views[j];\n\n // preety format the layout & context. \n viewData['layout'] = JSON.stringify(viewData['layout'], null, 2);\n // viewData['context'] = JSON.stringify(viewData['context'], null, 2);\n\n viewData['module'] = await this.moduleMetadataService.findOneByUserKey(viewData.moduleUserKey);\n viewData['model'] = await this.modelMetadataService.findOneByUserKey(viewData.modelUserKey);\n // await this.solidViewService.upsert(viewData);\n // First check if module already exists using name\n\n // Changed the below to upsert as now we are saving modifications to the view json to file system also.\n // await this.solidViewService.createIfNotPresent(viewData);\n await this.solidViewService.upsert(viewData);\n }\n }\n\n async seedUsers(users) {\n if (!users) {\n return;\n }\n\n for (let l = 0; l < users.length; l++) {\n const user = users[l];\n let exisitingUser = await this.userService.findOneByUsername(user.username);\n if (!exisitingUser) {\n exisitingUser = await this.authenticationService.signUp(user);\n\n this.logger.log(`Newly created user is ${user}`);\n }\n // now add Roles to user.\n // for (let m = 0; m < roles.length; m++) {\n // const role = roles[m];\n // await this.userService.addRoleToUser(user.email, role.name);\n // }\n }\n }\n\n async seedModuleModelFields(moduleMetadata: CreateModuleMetadataDto) {\n\n // First we create the module. \n // await this.moduleMetadataService.removeByName(moduleMetadata.name);\n // const module = await this.moduleMetadataService.create(moduleMetadata);\n const module = await this.moduleMetadataService.upsert(moduleMetadata);\n\n // Next create all the models. \n const modelsMetadata: CreateModelMetadataDto[] = moduleMetadata.models;\n for (let j = 0; j < modelsMetadata.length; j++) {\n const modelMetadata = modelsMetadata[j];\n\n // Before creating the model, we need to make sure we are linking it to the newly created module.\n // modelMetdata['moduleId'] = module.id;\n modelMetadata['module'] = module;\n\n // Please note that all the fields will also get created as we have setup the relation in model.entity.ts as cascade=true\n // await this.modelMetadataService.removeBySingularName(modelMetdata.singularName);\n // await this.modelMetadataService.modelSeeder(modelMetdata);\n\n // upsert the model information.\n // const fieldsMetadata = modelMetdata.fields;\n // delete modelMetdata['fields'];\n const { fields: fieldsMetadata, ...modelMetaDataWithoutFields } = modelMetadata;\n\n // Load and set the parent model if it exists.\n if (modelMetadata.isChild && modelMetadata.parentModelUserKey) {\n const parentModel = await this.modelMetadataService.findOneByUserKey(modelMetadata.parentModelUserKey);\n modelMetaDataWithoutFields['parentModel'] = parentModel;\n }\n\n await this.modelMetadataService.upsert(modelMetaDataWithoutFields);\n const model = await this.modelMetadataService.findOneBySingularName(modelMetadata.singularName)\n\n // iterate over all fields and upsert. \n let userKeyField = null;\n const userKeyFieldName = modelMetadata.userKeyFieldUserKey;\n for (let k = 0; k < fieldsMetadata.length; k++) {\n const fieldMetadata = fieldsMetadata[k];\n\n // TODO: resolve model & mediaStorageProvider. \n fieldMetadata['model'] = model;\n if (fieldMetadata.mediaStorageProviderUserKey) {\n fieldMetadata['mediaStorageProvider'] = await this.mediaStorageProviderMetadataService.findOneByUserKey(fieldMetadata.mediaStorageProviderUserKey);\n }\n // console.log(fieldMetadata.displayName);\n\n const affectedField = await this.fieldMetadataService.upsert(fieldMetadata);\n if (fieldMetadata.name === userKeyFieldName) {\n const { model, ...fieldData } = affectedField;\n userKeyField = fieldData;\n }\n }\n\n // Now that we have created fields & model update the model to stamp the userKeyField. \n if (userKeyField) {\n modelMetaDataWithoutFields['userKeyField'] = userKeyField;\n await this.modelMetadataService.upsert(modelMetaDataWithoutFields);\n }\n }\n }\n\n async seedSettings(createDto: CreateSettingDto) {\n const settingsArray: any[] = await this.settingsRepo.find();\n if (!settingsArray || settingsArray.length === 0) {\n this.seetingService.create(createDto);\n }\n }\n\n async seedSecurityRules(rulesDto: CreateSecurityRuleDto[]) {\n if (!rulesDto || rulesDto.length === 0) {\n this.logger.debug(`No security rules found to seed`);\n return;\n }\n for (const dto of rulesDto) {\n await this.securityRuleRepo.upsertWithDto({ ...dto, securityRuleConfig: JSON.stringify(dto.securityRuleConfig) });\n }\n }\n\n async seedListOfValues(listOfValuesDto: CreateListOfValuesDto[]) {\n if (!listOfValuesDto || listOfValuesDto.length === 0) {\n this.logger.debug(`No List Of Values found to seed`);\n return;\n }\n for (let j = 0; j < listOfValuesDto.length; j++) {\n await this.listOfValuesService.upsert(listOfValuesDto[j]);\n }\n }\n\n async seedDashboards(dashboardDtos: CreateDashboardDto[]) {\n if (!dashboardDtos || dashboardDtos.length === 0) {\n this.logger.debug(`No dashboards found to seed`);\n return;\n }\n for (const dto of dashboardDtos) {\n await this.dashboardRepo.upsertWithDto(dto);\n }\n }\n\n async seedScheduledJobs(createScheduledJobDto: CreateScheduledJobDto[]) {\n if (!createScheduledJobDto || createScheduledJobDto.length === 0) {\n this.logger.debug(`No scheduled jobs found to seed`);\n return;\n }\n for (const dto of createScheduledJobDto) {\n await this.scheduledJobRepository.upsertWithDto(dto);\n }\n }\n\n}"]}
|
|
1
|
+
{"version":3,"file":"module-metadata-seeder.service.js","sourceRoot":"","sources":["../../src/seeders/module-metadata-seeder.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,uCAAyB;AACzB,2CAA6B;AAE7B,sFAA4D;AAG5D,iFAA4E;AAE5E,+EAA0E;AAC1E,iHAA0G;AAC1G,+EAA0E;AAC1E,2DAAwD;AACxD,+EAA4E;AAC5E,+HAAuH;AAEvH,+EAA2E;AAC3E,2EAAuE;AAEvE,6EAAwE;AACxE,iFAA4E;AAC5E,uFAAiF;AACjF,6CAAmD;AACnD,uFAA4E;AAC5E,qCAAqC;AACrC,8DAA0D;AAC1D,6EAAwE;AACxE,4DAAqF;AACrF,oGAAqE;AACrE,qDAAkD;AAClD,4EAAoD;AAEpD,iEAA8D;AAC9D,+DAAsD;AAEtD,qFAAiF;AACjF,+EAA0E;AAE1E,iFAA2E;AAE3E,6EAA0E;AAE1E,qFAAiF;AAEjF,wCAAyC;AAGlC,IAAM,2BAA2B,mCAAjC,MAAM,2BAA2B;IAGpC,YACqB,qBAA4C,EAC5C,oBAA0C,EAC1C,oBAA0C,EAC1C,mCAAwE,EACxE,WAAgC,EAChC,WAAwB,EACxB,qBAA4C,EAC5C,kBAAyC,EACzC,oBAA6C,EAC7C,gBAAqC,EACrC,iCAA4E,EAC5E,oBAA0C,EAC1C,kBAAsC,EACtC,mBAAwC,EAEzD,cAA+D,EAC9C,aAA4B,EAE7C,uBAA6E,EACtD,gBAA+D,EAEtF,mBAAqE,EACpD,cAA8B,EAE/C,YAA0C,EACjC,gBAAwC,EACxC,yBAAoD,EACpD,aAAkC,EAClC,sBAA8C;QA5BtC,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,yB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s/common';\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nimport appBuilderConfig from '../config/app-builder.config';\nimport { ConfigType } from '@nestjs/config';\nimport { CreateModuleMetadataDto } from '../dtos/create-module-metadata.dto';\nimport { ModuleMetadataService } from '../services/module-metadata.service';\nimport { CreateModelMetadataDto } from '../dtos/create-model-metadata.dto';\nimport { ModelMetadataService } from '../services/model-metadata.service';\nimport { MediaStorageProviderMetadataService } from '../services/media-storage-provider-metadata.service';\nimport { FieldMetadataService } from '../services/field-metadata.service';\nimport { UserService } from 'src/services/user.service';\nimport { AuthenticationService } from 'src/services/authentication.service';\nimport { MediaStorageProviderMetadataSeederService } from '../services/media-storage-provider-metadata-seeder.service';\nimport { CreateEmailTemplateDto } from 'src/dtos/create-email-template.dto';\nimport { EmailTemplateService } from 'src/services/email-template.service';\nimport { SmsTemplateService } from 'src/services/sms-template.service';\nimport { CreateSmsTemplateDto } from 'src/dtos/create-sms-template.dto';\nimport { ViewMetadataService } from '../services/view-metadata.service';\nimport { ActionMetadataService } from '../services/action-metadata.service';\nimport { MenuItemMetadataService } from '../services/menu-item-metadata.service';\nimport { InjectRepository } from '@nestjs/typeorm';\nimport { PermissionMetadata } from '../entities/permission-metadata.entity';\nimport { Repository } from 'typeorm';\nimport { SolidRegistry } from '../helpers/solid-registry';\nimport { RoleMetadataService } from '../services/role-metadata.service';\nimport { getCoreModuleNames, getDynamicModuleNames } from '../helpers/module.helper';\nimport solidCoreMetadata from './seed-data/solid-core-metadata.json';\nimport { iamConfig } from 'src/config/iam.config';\nimport commonConfig from 'src/config/common.config';\nimport { CreateSettingDto } from 'src/dtos/create-setting.dto';\nimport { SettingService } from 'src/services/setting.service';\nimport { Setting } from 'src/entities/setting.entity';\nimport { CreateSecurityRuleDto } from 'src/dtos/create-security-rule.dto';\nimport { SecurityRuleRepository } from 'src/repository/security-rule.repository';\nimport { ListOfValuesService } from 'src/services/list-of-values.service';\nimport { CreateListOfValuesDto } from 'src/dtos/create-list-of-values.dto';\nimport { SystemFieldsSeederService } from './system-fields-seeder.service';\nimport { CreateDashboardDto } from 'src/dtos/create-dashboard.dto';\nimport { DashboardRepository } from 'src/repository/dashboard.repository';\n// import { CreateScheduledJobDto } from 'src/dtos/create-scheduled-job.dto';\nimport { ScheduledJobRepository } from 'src/repository/scheduled-job.repository';\nimport { CreateScheduledJobDto } from 'src/dtos/create-scheduled-job.dto'\nimport { deepFreeze } from 'src/helpers';\n\n@Injectable()\nexport class ModuleMetadataSeederService {\n private readonly logger = new Logger(ModuleMetadataSeederService.name);\n\n constructor(\n private readonly moduleMetadataService: ModuleMetadataService,\n private readonly modelMetadataService: ModelMetadataService,\n private readonly fieldMetadataService: FieldMetadataService,\n private readonly mediaStorageProviderMetadataService: MediaStorageProviderMetadataService,\n private readonly roleService: RoleMetadataService,\n private readonly userService: UserService,\n private readonly authenticationService: AuthenticationService,\n private readonly solidActionService: ActionMetadataService,\n private readonly solidMenuItemService: MenuItemMetadataService,\n private readonly solidViewService: ViewMetadataService,\n private readonly mediaStorageProviderSeederService: MediaStorageProviderMetadataSeederService,\n private readonly emailTemplateService: EmailTemplateService,\n private readonly smsTemplateService: SmsTemplateService,\n private readonly listOfValuesService: ListOfValuesService,\n @InjectRepository(PermissionMetadata)\n private readonly permissionRepo: Repository<PermissionMetadata>,\n private readonly solidRegistry: SolidRegistry,\n @Inject(appBuilderConfig.KEY)\n private readonly appBuilderConfiguration: ConfigType<typeof appBuilderConfig>,\n @Inject(iamConfig.KEY) private readonly iamConfiguration: ConfigType<typeof iamConfig>,\n @Inject(commonConfig.KEY)\n private readonly commonConfiguration: ConfigType<typeof commonConfig>,\n private readonly seetingService: SettingService,\n @InjectRepository(Setting, 'default')\n readonly settingsRepo: Repository<Setting>,\n readonly securityRuleRepo: SecurityRuleRepository,\n readonly systemFieldsSeederService: SystemFieldsSeederService,\n readonly dashboardRepo: DashboardRepository,\n readonly scheduledJobRepository: ScheduledJobRepository,\n ) { }\n\n async seed() {\n\n const typedSolidCoreMetadata: any = structuredClone(solidCoreMetadata);\n\n // Run the permissions seeder. \n // await this.permissionsSeederService.seed();\n this.logger.log(`Seeding permissions`);\n await this.seedPermissions();\n\n // TODO: move this also the main loop processing. Generate the media storage providers required by default\n this.logger.log(`Seeding media storage providers`);\n await this.mediaStorageProviderSeederService.seed();\n\n // Seed any missing system fields metadata for all models.\n this.logger.log(`Seeding system fields metadata`);\n await this.systemFieldsSeederService.seed();\n\n // Read the module metadata from a file specified in the .env \n // Add the core json file as the first entry in the above array.\n // Please note the sequence of core files is important below...\n const coreModules = getCoreModuleNames();\n const seedDataFiles = [\n // 'src/common/seeders/seed-data/common-metadata.json',\n // 'src/iam/seeders/seed-data/iam-metadata.json',\n // 'src/app-builder/seeders/seed-data/app-builder-metadata.json',\n // 'src/queues/seeders/seed-data/queues-metadata.json',\n // ...coreModules.map(module => `src/${module}/seeders/seed-data/${module}-metadata.json`),\n typedSolidCoreMetadata\n ];\n this.logger.debug(`getting dynamics modules`);\n const enabledModules = getDynamicModuleNames();\n this.logger.log(`Seeding metadata`);\n\n for (let i = 0; i < enabledModules.length; i++) {\n const enabledModule = enabledModules[i];\n const enabledModuleSeedFile = `module-metadata/${enabledModule}/${enabledModule}-metadata.json`\n const fullPath = path.join(process.cwd(), enabledModuleSeedFile);\n if (fs.existsSync(fullPath)) {\n const overallMetadata: any = JSON.parse(fs.readFileSync(fullPath, 'utf-8').toString());\n\n seedDataFiles.push(overallMetadata)\n }\n }\n\n this.logger.debug(`Seed data files are: ${seedDataFiles}`);\n let usersDetail;\n for (let i = 0; i < seedDataFiles.length; i++) {\n\n // Module, model & field handling.\n const overallMetadata = deepFreeze(seedDataFiles[i]);\n\n // const fullPath = path.join(process.cwd(), seedDataFile);\n\n // For each module metadata seed file provided, read contents, parse & convert to a variable. \n // this.logger.log(`[Start] module seed data: ${fullPath}`);\n\n // const overallMetadata: any = JSON.parse(fs.readFileSync(fullPath, 'utf-8').toString());\n\n // Process module metadata first. \n const moduleMetadata: CreateModuleMetadataDto = overallMetadata.moduleMetadata;\n this.logger.log(`[Start] Processing module metadata for ${moduleMetadata.name}`)\n await this.seedModuleModelFields(moduleMetadata);\n this.logger.log(`[End] Processing module metadata for ${moduleMetadata.name}`)\n\n // Media Storage provider templates\n this.logger.log(`[Start] Processing Media Storage Provider for ${moduleMetadata.name}`);\n const mediaStorageProviders = overallMetadata.mediaStorageProviders;\n await this.seedMediaStorageProviders(mediaStorageProviders);\n this.logger.log(`[End] Processing Media Storage Provider for ${moduleMetadata.name}`);\n\n // Custom role handling\n this.logger.log(`[End] Processing roles for ${moduleMetadata.name}`)\n const roles = overallMetadata.roles;\n\n // Every role configuration in the seeder json can optionally have a permissions attribute. \n // While creating roles we are only passing the role name to be used. \n await this.roleService.createRolesIfNotExists(roles.map(role => { return { name: role.name } }));\n\n // After roles are created, we iterate over all roles and attach permissions (if specified in the seeder json) to the respective role.\n for (let roleI = 0; roleI < roles.length; roleI++) {\n const role = roles[roleI];\n if (role.permissions) {\n await this.roleService.addPermissionsToRole(role.name, role.permissions)\n }\n }\n this.logger.log(`[End] Processing roles for ${moduleMetadata.name}`)\n\n // Custom user handling\n this.logger.log(`[Start] Processing users for ${moduleMetadata.name}`);\n const users = overallMetadata.users;\n usersDetail = users;\n await this.seedUsers(users);\n this.logger.log(`[End] Processing users for ${moduleMetadata.name}`)\n\n // Application Module View handling \n this.logger.log(`[Start] Processing views for ${moduleMetadata.name}`);\n const views = overallMetadata.views;\n await this.seedViews(views);\n this.logger.log(`[End] Processing views for ${moduleMetadata.name}`)\n\n // Application Module Action handling\n this.logger.log(`[Start] Processing actions for ${moduleMetadata.name}`);\n const actions = overallMetadata.actions;\n await this.seedActions(actions);\n this.logger.log(`[End] Processing actions for ${moduleMetadata.name}`)\n\n // Application Module Menu handling \n this.logger.log(`[Start] Processing menus for ${moduleMetadata.name}`);\n const menus = overallMetadata.menus;\n await this.seedMenus(menus);\n this.logger.log(`[End] Processing menus for ${moduleMetadata.name}`)\n\n // Email templates \n this.logger.log(`[Start] Processing email templates for ${moduleMetadata.name}`);\n const emailTemplates: CreateEmailTemplateDto[] = overallMetadata.emailTemplates;\n await this.seedEmailTemplates(emailTemplates, moduleMetadata);\n this.logger.log(`[End] Processing email templates for ${moduleMetadata.name}`);\n\n // Sms templates\n this.logger.log(`[Start] Processing sms templates for ${moduleMetadata.name}`);\n const smsTemplates: CreateSmsTemplateDto[] = overallMetadata.smsTemplates;\n await this.seedSmsTemplates(smsTemplates, moduleMetadata);\n this.logger.log(`[End] Processing sms templates for ${moduleMetadata.name}`);\n\n // Settings\n this.logger.log(`[Start] Processing settings for ${moduleMetadata.name}`);\n await this.seetingService.seedDefaultSettings();\n this.logger.log(`[End] Processing settings for ${moduleMetadata.name}`);\n\n // Security rules\n this.logger.log(`[Start] Processing security rules for ${moduleMetadata.name}`);\n const securityRules: CreateSecurityRuleDto[] = overallMetadata.securityRules;\n await this.seedSecurityRules(securityRules);\n this.logger.log(`[End] Processing security rules for ${moduleMetadata.name}`);\n\n // List Of Values\n this.logger.log(`[Start] Processing List Of Values for ${moduleMetadata.name}`);\n const listOfValues: CreateListOfValuesDto[] = overallMetadata.listOfValues;\n await this.seedListOfValues(listOfValues);\n this.logger.log(`[End] Processing List Of Values for ${moduleMetadata.name}`);\n\n // Dashboards\n this.logger.log(`[Start] Processing dashboards for ${moduleMetadata.name}`);\n const dashboards: CreateDashboardDto[] = overallMetadata.dashboards;\n await this.seedDashboards(dashboards);\n this.logger.log(`[End] Processing dashboards for ${moduleMetadata.name}`);\n\n // Scheduled Jobs\n this.logger.debug(`[Start] Processing scheduled jobs for ${moduleMetadata.name}`);\n const scheduledJobs: CreateScheduledJobDto[] = overallMetadata.scheduledJobs;\n if (scheduledJobs?.length > 0) {\n await this.seedScheduledJobs(scheduledJobs);\n }\n this.logger.debug(`[End] Processing scheduled jobs for ${moduleMetadata.name}`);\n\n this.logger.debug(`[End] module seed data: ${overallMetadata}`);\n }\n\n // Post seed data file processing. \n\n // 1. Give all permissions to the Admin role.\n this.logger.log(`About to add all permissions to the Admin role`);\n await this.roleService.addAllPermissionsToRole(\"Admin\");\n // 2. Give wrapSettings permissions to the Public role.\n const internalRolePermission = [\n 'UserController.findMany',\n 'UserController.checkIfPermissionExists',\n 'UserController.findOne',\n 'MenuItemMetadataController.findMany',\n 'MenuItemMetadataController.findUserMenus',\n 'MenuItemMetadataController.findOne',\n 'ViewMetadataController.getLayout',\n 'ViewMetadataController.findMany',\n 'ViewMetadataController.findOne',\n 'AuthenticationController.changePassword',\n 'FieldMetadataController.getSelectionDynamicValues',\n 'FieldMetadataController.getSelectionDynamicValue',\n 'FieldMetadataController.findFieldDefaultMetaData',\n 'SavedFiltersController.delete',\n 'SavedFiltersController.deleteMany',\n 'SavedFiltersController.findOne',\n 'SavedFiltersController.findMany',\n 'SavedFiltersController.recover',\n 'SavedFiltersController.recoverMany',\n 'SavedFiltersController.partialUpdate',\n 'SavedFiltersController.update',\n 'SavedFiltersController.insertMany',\n 'SavedFiltersController.create',\n 'AuthenticationController.logout'\n ]\n await this.roleService.addPermissionToRole('Internal User', internalRolePermission);\n await this.roleService.addPermissionToRole('Public', ['SettingController.wrapSettings', 'AuthenticationController.logout']);\n this.logger.log(`All Seeders finished`);\n this.logger.log(`Newly created username is: ${usersDetail?.length > 0 ? usersDetail[0]?.username : ''} and password is ${usersDetail?.length > 0 ? usersDetail[0]?.password : ''}`);\n }\n\n\n async seedPermissions() {\n\n const controllers = this.solidRegistry.getControllers();\n\n // Loop over the countries and create them.\n for (let id = 0; id < controllers.length; id++) {\n try {\n const controller = controllers[id];\n this.logger.log(`Resolving controller: ${controller.name}`);\n\n const methods = controller.methods;\n for (let mId = 0; mId < methods.length; mId++) {\n\n const methodName = methods[mId];\n const permissionName = `${controller.name}.${methodName}`;\n\n const existingPermission = await this.permissionRepo.findOne({\n where: {\n name: permissionName\n }\n });\n\n if (existingPermission) {\n this.logger.log(`Permission ${permissionName} already exists.`);\n }\n else {\n this.logger.log(`Permission ${permissionName} does not exist, creating new.`);\n\n const newPermission = this.permissionRepo.create({\n name: permissionName\n });\n await this.permissionRepo.save(newPermission);\n\n }\n }\n\n } catch (error) {\n this.logger.error(error);\n }\n }\n }\n\n async seedMediaStorageProviders(_mediaStorageProviders: any) {\n const mediaStorageProviders = structuredClone(_mediaStorageProviders);\n if (!mediaStorageProviders) {\n return;\n }\n for (let i = 0; i < mediaStorageProviders.length; i++) {\n const mediaStorageProivder = mediaStorageProviders[i];\n await this.mediaStorageProviderMetadataService.upsert(mediaStorageProivder);\n }\n }\n\n async seedEmailTemplates(_emailTemplates: CreateEmailTemplateDto[], _moduleMetadata: CreateModuleMetadataDto) {\n const emailTemplates = structuredClone(_emailTemplates);\n const moduleMetadata = structuredClone(_moduleMetadata);\n if (!emailTemplates) {\n return;\n }\n\n for (let i = 0; i < emailTemplates.length; i++) {\n const emailTemplate = emailTemplates[i];\n this.logger.log(`Found ${emailTemplate.name} email template`);\n\n // We need to load the actual template contents. \n if (moduleMetadata.name === 'solid-core') {\n const modulePath = path.dirname(require.resolve('@solidstarters/solid-core'));\n const seedDataPath = path.join(modulePath, '../src/seeders/seed-data/email-templates');\n const filePath = path.join(seedDataPath, emailTemplate.body);\n this.logger.log(`Seeding email template from solid-core at path: ${filePath}`);\n if (fs.existsSync(filePath)) {\n emailTemplate.body = fs.readFileSync(filePath, 'utf-8').toString();\n }\n }\n else {\n // Check if file exists\n const emailTemplateHandlebar = `module-metadata/${moduleMetadata.name}/email-templates/${emailTemplate.body}`\n const fullPath = path.join(process.cwd(), emailTemplateHandlebar);\n this.logger.log(`Seeding custom email template from consuming model at path: ${fullPath}`);\n if (fs.existsSync(fullPath)) {\n emailTemplate.body = fs.readFileSync(fullPath, 'utf-8').toString();\n }\n }\n\n // Save to DB.\n await this.emailTemplateService.removeByName(emailTemplate.name);\n await this.emailTemplateService.create(emailTemplate);\n }\n\n }\n\n async seedSmsTemplates(_smsTemplates: CreateSmsTemplateDto[], _moduleMetadata: CreateModuleMetadataDto) {\n const smsTemplates = structuredClone(_smsTemplates);\n const moduleMetadata = structuredClone(_moduleMetadata);\n if (!smsTemplates) {\n return;\n }\n\n for (let i = 0; i < smsTemplates.length; i++) {\n const smsTemplate = smsTemplates[i];\n this.logger.log(`Found ${smsTemplate.name} sms template`);\n\n // We need to load the actual template contents. \n if (moduleMetadata.name === 'solid-core') {\n const modulePath = path.dirname(require.resolve('@solidstarters/solid-core'));\n const seedDataPath = path.join(modulePath, '../src/seeders/seed-data/sms-templates');\n const filePath = path.join(seedDataPath, smsTemplate.body);\n this.logger.log(`Seeding sms template from solid-core at path: ${filePath}`);\n if (fs.existsSync(filePath)) {\n smsTemplate.body = fs.readFileSync(filePath, 'utf-8').toString();\n }\n }\n else {\n // Check if file exists\n const emailTemplateHandlebar = `module-metadata/${moduleMetadata.name}/sms-templates/${smsTemplate.body}`\n const fullPath = path.join(process.cwd(), emailTemplateHandlebar);\n this.logger.log(`Seeding custom sms template from consuming model at path: ${fullPath}`);\n if (fs.existsSync(fullPath)) {\n smsTemplate.body = fs.readFileSync(fullPath, 'utf-8').toString();\n }\n }\n\n\n // Save to DB.\n await this.smsTemplateService.removeByName(smsTemplate.name);\n await this.smsTemplateService.create(smsTemplate);\n }\n }\n\n async seedMenus(menus: any) {\n // const menus = structuredClone(_menus);\n if (!menus) {\n return;\n }\n\n for (let j = 0; j < menus.length; j++) {\n const menuData = menus[j];\n\n const adminRole = await this.roleService.findRoleByName('Admin');\n\n const specifiedRoles = menuData['roles'];\n\n // If the developer has specified roles, then resolve them, making sure that admin role is also given.\n const specifiedRoleObjects = [adminRole];\n if (specifiedRoles) {\n for (let i = 0; i < specifiedRoles.length; i++) {\n const specifiedRole = specifiedRoles[i];\n const specifiedRoleObject = await this.roleService.findRoleByName(specifiedRole);\n if (!specifiedRoleObject) {\n throw new Error(`Invalid role: (${specifiedRole}) specified against menu with display name ${menuData.displayName}.`);\n }\n specifiedRoleObjects.push(specifiedRoleObject);\n }\n }\n\n menuData['roles'] = specifiedRoleObjects;\n menuData['action'] = await this.solidActionService.findOneByUserKey(menuData.actionUserKey);\n menuData['module'] = await this.moduleMetadataService.findOneByUserKey(menuData.moduleUserKey);\n\n if (menuData.parentMenuItemUserKey) {\n menuData['parentMenuItem'] = await this.solidMenuItemService.findOneByUserKey(menuData.parentMenuItemUserKey);\n } else {\n menuData['parentMenuItem'] = null\n }\n await this.solidMenuItemService.upsert(menuData);\n }\n }\n\n async seedActions(_actions: any) {\n const actions = structuredClone(_actions);\n if (!actions) {\n return;\n }\n\n for (let j = 0; j < actions.length; j++) {\n const actionData = actions[j];\n actionData['module'] = await this.moduleMetadataService.findOneByUserKey(actionData.moduleUserKey);\n if (actionData.type === 'solid') {\n actionData['model'] = await this.modelMetadataService.findOneByUserKey(actionData.modelUserKey);\n actionData['view'] = await this.solidViewService.findOneByUserKey(actionData.viewUserKey);\n }\n else {\n if (actionData.modelUserKey) {\n actionData['model'] = await this.modelMetadataService.findOneByUserKey(actionData.modelUserKey);\n }\n }\n await this.solidActionService.upsert(actionData);\n }\n }\n\n async seedViews(_views: any) {\n const views = structuredClone(_views);\n if (!views) {\n return;\n }\n\n for (let j = 0; j < views.length; j++) {\n const viewData = views[j];\n\n // preety format the layout & context. \n viewData['layout'] = JSON.stringify(viewData['layout'], null, 2);\n // viewData['context'] = JSON.stringify(viewData['context'], null, 2);\n\n viewData['module'] = await this.moduleMetadataService.findOneByUserKey(viewData.moduleUserKey);\n viewData['model'] = await this.modelMetadataService.findOneByUserKey(viewData.modelUserKey);\n // await this.solidViewService.upsert(viewData);\n // First check if module already exists using name\n\n // Changed the below to upsert as now we are saving modifications to the view json to file system also.\n // await this.solidViewService.createIfNotPresent(viewData);\n await this.solidViewService.upsert(viewData);\n }\n }\n\n async seedUsers(_users) {\n const users = structuredClone(_users);\n if (!users) {\n return;\n }\n\n for (let l = 0; l < users.length; l++) {\n const user = users[l];\n let exisitingUser = await this.userService.findOneByUsername(user.username);\n if (!exisitingUser) {\n exisitingUser = await this.authenticationService.signUp(user);\n\n this.logger.log(`Newly created user is ${user}`);\n }\n // now add Roles to user.\n // for (let m = 0; m < roles.length; m++) {\n // const role = roles[m];\n // await this.userService.addRoleToUser(user.email, role.name);\n // }\n }\n }\n\n async seedModuleModelFields(_moduleMetadata: CreateModuleMetadataDto) {\n const moduleMetadata = structuredClone(_moduleMetadata);\n // First we create the module. \n // await this.moduleMetadataService.removeByName(moduleMetadata.name);\n // const module = await this.moduleMetadataService.create(moduleMetadata);\n const module = await this.moduleMetadataService.upsert(moduleMetadata);\n\n // Next create all the models. \n const modelsMetadata: CreateModelMetadataDto[] = moduleMetadata.models;\n for (let j = 0; j < modelsMetadata.length; j++) {\n const modelMetadata = modelsMetadata[j];\n\n // Before creating the model, we need to make sure we are linking it to the newly created module.\n // modelMetdata['moduleId'] = module.id;\n modelMetadata['module'] = module;\n\n // Please note that all the fields will also get created as we have setup the relation in model.entity.ts as cascade=true\n // await this.modelMetadataService.removeBySingularName(modelMetdata.singularName);\n // await this.modelMetadataService.modelSeeder(modelMetdata);\n\n // upsert the model information.\n // const fieldsMetadata = modelMetdata.fields;\n // delete modelMetdata['fields'];\n const { fields: fieldsMetadata, ...modelMetaDataWithoutFields } = modelMetadata;\n\n // Load and set the parent model if it exists.\n if (modelMetadata.isChild && modelMetadata.parentModelUserKey) {\n const parentModel = await this.modelMetadataService.findOneByUserKey(modelMetadata.parentModelUserKey);\n modelMetaDataWithoutFields['parentModel'] = parentModel;\n }\n\n await this.modelMetadataService.upsert(modelMetaDataWithoutFields);\n const model = await this.modelMetadataService.findOneBySingularName(modelMetadata.singularName)\n\n // iterate over all fields and upsert. \n let userKeyField = null;\n const userKeyFieldName = modelMetadata.userKeyFieldUserKey;\n for (let k = 0; k < fieldsMetadata.length; k++) {\n const fieldMetadata = fieldsMetadata[k];\n\n // TODO: resolve model & mediaStorageProvider. \n fieldMetadata['model'] = model;\n if (fieldMetadata.mediaStorageProviderUserKey) {\n fieldMetadata['mediaStorageProvider'] = await this.mediaStorageProviderMetadataService.findOneByUserKey(fieldMetadata.mediaStorageProviderUserKey);\n }\n // console.log(fieldMetadata.displayName);\n\n const affectedField = await this.fieldMetadataService.upsert(fieldMetadata);\n if (fieldMetadata.name === userKeyFieldName) {\n const { model, ...fieldData } = affectedField;\n userKeyField = fieldData;\n }\n }\n\n // Now that we have created fields & model update the model to stamp the userKeyField. \n if (userKeyField) {\n modelMetaDataWithoutFields['userKeyField'] = userKeyField;\n await this.modelMetadataService.upsert(modelMetaDataWithoutFields);\n }\n }\n }\n\n async seedSettings(_createDto: CreateSettingDto) {\n const createDto = structuredClone(_createDto);\n const settingsArray: any[] = await this.settingsRepo.find();\n if (!settingsArray || settingsArray.length === 0) {\n this.seetingService.create(createDto);\n }\n }\n\n async seedSecurityRules(_rulesDto: CreateSecurityRuleDto[]) {\n const rulesDto = structuredClone(_rulesDto);\n if (!rulesDto || rulesDto.length === 0) {\n this.logger.debug(`No security rules found to seed`);\n return;\n }\n for (const dto of rulesDto) {\n await this.securityRuleRepo.upsertWithDto({ ...dto, securityRuleConfig: JSON.stringify(dto.securityRuleConfig) });\n }\n }\n\n async seedListOfValues(_listOfValuesDto: CreateListOfValuesDto[]) {\n const listOfValuesDto = structuredClone(_listOfValuesDto);\n if (!listOfValuesDto || listOfValuesDto.length === 0) {\n this.logger.debug(`No List Of Values found to seed`);\n return;\n }\n for (let j = 0; j < listOfValuesDto.length; j++) {\n const listOfValueDto = listOfValuesDto[j];\n listOfValueDto['module'] = await this.moduleMetadataService.findOneByUserKey(listOfValueDto.moduleUserKey);\n await this.listOfValuesService.upsert(listOfValuesDto[j]);\n }\n }\n\n async seedDashboards(_dashboardDtos: CreateDashboardDto[]) {\n const dashboardDtos = structuredClone(_dashboardDtos);\n if (!dashboardDtos || dashboardDtos.length === 0) {\n this.logger.debug(`No dashboards found to seed`);\n return;\n }\n for (const dto of dashboardDtos) {\n await this.dashboardRepo.upsertWithDto(dto);\n }\n }\n\n async seedScheduledJobs(_createScheduledJobDto: CreateScheduledJobDto[]) {\n const createScheduledJobDto = structuredClone(_createScheduledJobDto);\n if (!createScheduledJobDto || createScheduledJobDto.length === 0) {\n this.logger.debug(`No scheduled jobs found to seed`);\n return;\n }\n for (const dto of createScheduledJobDto) {\n await this.scheduledJobRepository.upsertWithDto(dto);\n }\n }\n\n}"]}
|
|
@@ -1697,6 +1697,7 @@
|
|
|
1697
1697
|
"dataSourceType": "postgres",
|
|
1698
1698
|
"userKeyFieldUserKey": "username",
|
|
1699
1699
|
"isSystem": true,
|
|
1700
|
+
"enableAuditTracking": true,
|
|
1700
1701
|
"fields": [
|
|
1701
1702
|
{
|
|
1702
1703
|
"name": "fullName",
|
|
@@ -1709,7 +1710,8 @@
|
|
|
1709
1710
|
"index": false,
|
|
1710
1711
|
"private": false,
|
|
1711
1712
|
"encrypt": false,
|
|
1712
|
-
"isSystem": true
|
|
1713
|
+
"isSystem": true,
|
|
1714
|
+
"enableAuditTracking": true
|
|
1713
1715
|
},
|
|
1714
1716
|
{
|
|
1715
1717
|
"name": "username",
|
|
@@ -1722,7 +1724,8 @@
|
|
|
1722
1724
|
"index": true,
|
|
1723
1725
|
"private": false,
|
|
1724
1726
|
"encrypt": false,
|
|
1725
|
-
"isSystem": true
|
|
1727
|
+
"isSystem": true,
|
|
1728
|
+
"enableAuditTracking": true
|
|
1726
1729
|
},
|
|
1727
1730
|
{
|
|
1728
1731
|
"name": "email",
|
|
@@ -1735,7 +1738,8 @@
|
|
|
1735
1738
|
"index": true,
|
|
1736
1739
|
"private": false,
|
|
1737
1740
|
"encrypt": false,
|
|
1738
|
-
"isSystem": true
|
|
1741
|
+
"isSystem": true,
|
|
1742
|
+
"enableAuditTracking": true
|
|
1739
1743
|
},
|
|
1740
1744
|
{
|
|
1741
1745
|
"name": "mobile",
|
|
@@ -1748,7 +1752,8 @@
|
|
|
1748
1752
|
"index": true,
|
|
1749
1753
|
"private": false,
|
|
1750
1754
|
"encrypt": false,
|
|
1751
|
-
"isSystem": true
|
|
1755
|
+
"isSystem": true,
|
|
1756
|
+
"enableAuditTracking": true
|
|
1752
1757
|
},
|
|
1753
1758
|
{
|
|
1754
1759
|
"name": "password",
|
|
@@ -1884,7 +1889,8 @@
|
|
|
1884
1889
|
"relationCascade": "cascade",
|
|
1885
1890
|
"relationModelModuleName": "solid-core",
|
|
1886
1891
|
"isSystem": true,
|
|
1887
|
-
"isRelationManyToManyOwner": true
|
|
1892
|
+
"isRelationManyToManyOwner": true,
|
|
1893
|
+
"enableAuditTracking": true
|
|
1888
1894
|
},
|
|
1889
1895
|
{
|
|
1890
1896
|
"name": "forgotPasswordConfirmedAt",
|
|
@@ -12256,5 +12262,33 @@
|
|
|
12256
12262
|
],
|
|
12257
12263
|
"checksums": [],
|
|
12258
12264
|
"listOfValues": [],
|
|
12259
|
-
"scheduledJobs": []
|
|
12265
|
+
"scheduledJobs": [],
|
|
12266
|
+
"securityRules": [
|
|
12267
|
+
{
|
|
12268
|
+
"name": "model:User-role:Internal User",
|
|
12269
|
+
"description": "Show User record for the current user only",
|
|
12270
|
+
"roleUserKey": "Internal User",
|
|
12271
|
+
"modelMetadataUserKey": "user",
|
|
12272
|
+
"securityRuleConfig": {
|
|
12273
|
+
"filters": {
|
|
12274
|
+
"id": {
|
|
12275
|
+
"$eq": "$activeUserId"
|
|
12276
|
+
}
|
|
12277
|
+
}
|
|
12278
|
+
}
|
|
12279
|
+
},
|
|
12280
|
+
{
|
|
12281
|
+
"name": "model:User-role:Admin",
|
|
12282
|
+
"description": "Show All User records",
|
|
12283
|
+
"roleUserKey": "Admin",
|
|
12284
|
+
"modelMetadataUserKey": "user",
|
|
12285
|
+
"securityRuleConfig": {
|
|
12286
|
+
"filters": {
|
|
12287
|
+
"id": {
|
|
12288
|
+
"$ne": "0"
|
|
12289
|
+
}
|
|
12290
|
+
}
|
|
12291
|
+
}
|
|
12292
|
+
}
|
|
12293
|
+
]
|
|
12260
12294
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentication.service.d.ts","sourceRoot":"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C,MAAM,EAAE,MAAM;IAS3B,EAAE,CAAC,UAAU,EAAE,cAAc;;;;;;;;;;;CAyBtC"}
|
|
@@ -97,14 +97,14 @@ let AuthenticationService = AuthenticationService_1 = class AuthenticationServic
|
|
|
97
97
|
async validateUser(signInDto) {
|
|
98
98
|
const user = await this.resolveUser(signInDto.username, signInDto.email);
|
|
99
99
|
if (!user) {
|
|
100
|
-
throw new common_1.UnauthorizedException(error_messages_1.ERROR_MESSAGES.
|
|
100
|
+
throw new common_1.UnauthorizedException(error_messages_1.ERROR_MESSAGES.INVALID_CREDENTIALS);
|
|
101
101
|
}
|
|
102
102
|
if (!user.active) {
|
|
103
103
|
throw new common_1.UnauthorizedException(error_messages_1.ERROR_MESSAGES.USER_NOT_ACTIVE);
|
|
104
104
|
}
|
|
105
105
|
const isEqual = await this.hashingService.compare(signInDto.password, user.password);
|
|
106
106
|
if (!isEqual) {
|
|
107
|
-
throw new common_1.UnauthorizedException(error_messages_1.ERROR_MESSAGES.
|
|
107
|
+
throw new common_1.UnauthorizedException(error_messages_1.ERROR_MESSAGES.INVALID_CREDENTIALS);
|
|
108
108
|
}
|
|
109
109
|
return user;
|
|
110
110
|
}
|
|
@@ -600,20 +600,23 @@ let AuthenticationService = AuthenticationService_1 = class AuthenticationServic
|
|
|
600
600
|
}
|
|
601
601
|
async initiateForgotPassword(initiateForgotPasswordDto) {
|
|
602
602
|
const user = await this.resolveUser(initiateForgotPasswordDto.username, initiateForgotPasswordDto.email);
|
|
603
|
+
let isValidUser = true;
|
|
603
604
|
if (!user) {
|
|
604
|
-
|
|
605
|
+
isValidUser = false;
|
|
605
606
|
}
|
|
606
607
|
if (!user.active) {
|
|
607
|
-
|
|
608
|
+
isValidUser = false;
|
|
608
609
|
}
|
|
609
610
|
if (user.lastLoginProvider !== 'local') {
|
|
610
|
-
|
|
611
|
+
isValidUser = false;
|
|
612
|
+
}
|
|
613
|
+
if (isValidUser) {
|
|
614
|
+
const { token, expiresAt } = this.generateForgotPasswordToken();
|
|
615
|
+
user.verificationTokenOnForgotPassword = token;
|
|
616
|
+
user.verificationTokenOnForgotPasswordExpiresAt = expiresAt;
|
|
617
|
+
await this.userRepository.save(user);
|
|
618
|
+
this.notifyUserOnForgotPassword(user);
|
|
611
619
|
}
|
|
612
|
-
const { token, expiresAt } = this.generateForgotPasswordToken();
|
|
613
|
-
user.verificationTokenOnForgotPassword = token;
|
|
614
|
-
user.verificationTokenOnForgotPasswordExpiresAt = expiresAt;
|
|
615
|
-
await this.userRepository.save(user);
|
|
616
|
-
this.notifyUserOnForgotPassword(user);
|
|
617
620
|
return {
|
|
618
621
|
status: 'success',
|
|
619
622
|
message: success_messages_1.SUCCESS_MESSAGES.FORGOT_PASSWORD_TOKEN_SENT,
|
|
@@ -622,8 +625,6 @@ let AuthenticationService = AuthenticationService_1 = class AuthenticationServic
|
|
|
622
625
|
data: {
|
|
623
626
|
user: {
|
|
624
627
|
email: user.email,
|
|
625
|
-
mobile: user.mobile,
|
|
626
|
-
username: user.username,
|
|
627
628
|
},
|
|
628
629
|
}
|
|
629
630
|
};
|
|
@@ -656,9 +657,9 @@ let AuthenticationService = AuthenticationService_1 = class AuthenticationServic
|
|
|
656
657
|
return this.dataSource.transaction(async (m) => {
|
|
657
658
|
const user = await this.resolveUserByVerificationToken(confirmForgotPasswordDto.verificationToken);
|
|
658
659
|
if (!user)
|
|
659
|
-
throw new common_1.
|
|
660
|
+
throw new common_1.UnauthorizedException(error_messages_1.ERROR_MESSAGES.INVALID_CREDENTIALS);
|
|
660
661
|
if (user.lastLoginProvider !== 'local')
|
|
661
|
-
throw new common_1.
|
|
662
|
+
throw new common_1.UnauthorizedException(error_messages_1.ERROR_MESSAGES.INVALID_CREDENTIALS);
|
|
662
663
|
if (!user.active)
|
|
663
664
|
throw new common_1.UnauthorizedException(error_messages_1.ERROR_MESSAGES.INVALID_CREDENTIALS);
|
|
664
665
|
const { affected } = await m
|