rez_core 2.2.158 → 2.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/module/auth/strategies/google.strategy.js +6 -1
- package/dist/module/auth/strategies/google.strategy.js.map +1 -1
- package/dist/module/auth/strategies/jwt.strategy.js +1 -1
- package/dist/module/auth/strategies/jwt.strategy.js.map +1 -1
- package/dist/module/communication/communication.module.js +13 -2
- package/dist/module/communication/communication.module.js.map +1 -1
- package/dist/module/communication/controller/communication.controller.js.map +1 -1
- package/dist/module/communication/dto/create-config.dto.js +11 -1
- package/dist/module/communication/dto/create-config.dto.js.map +1 -1
- package/dist/module/communication/entity/communication-config.entity.js.map +1 -1
- package/dist/module/communication/entity/communication-hub.entity.js +11 -1
- package/dist/module/communication/entity/communication-hub.entity.js.map +1 -1
- package/dist/module/communication/examples/usage.example.js +9 -9
- package/dist/module/communication/examples/usage.example.js.map +1 -1
- package/dist/module/communication/factories/communication.factory.js +4 -4
- package/dist/module/communication/factories/communication.factory.js.map +1 -1
- package/dist/module/communication/factories/email.factory.js +1 -1
- package/dist/module/communication/factories/email.factory.js.map +1 -1
- package/dist/module/communication/factories/sms.factory.js +1 -1
- package/dist/module/communication/factories/sms.factory.js.map +1 -1
- package/dist/module/communication/factories/telephone.factory.js +2 -4
- package/dist/module/communication/factories/telephone.factory.js.map +1 -1
- package/dist/module/communication/factories/whatsapp.factory.js +2 -4
- package/dist/module/communication/factories/whatsapp.factory.js.map +1 -1
- package/dist/module/communication/service/communication-queue.service.d.ts +40 -0
- package/dist/module/communication/service/communication-queue.service.js +147 -0
- package/dist/module/communication/service/communication-queue.service.js.map +1 -0
- package/dist/module/communication/service/communication.service.d.ts +34 -2
- package/dist/module/communication/service/communication.service.js +117 -24
- package/dist/module/communication/service/communication.service.js.map +1 -1
- package/dist/module/communication/service/oauth.service.js +25 -20
- package/dist/module/communication/service/oauth.service.js.map +1 -1
- package/dist/module/communication/strategies/email/gmail-api.strategy.js +16 -7
- package/dist/module/communication/strategies/email/gmail-api.strategy.js.map +1 -1
- package/dist/module/communication/strategies/gmail-smtp.strategy.js +2 -3
- package/dist/module/communication/strategies/gmail-smtp.strategy.js.map +1 -1
- package/dist/module/communication/strategies/gmail.strategy.js.map +1 -1
- package/dist/module/communication/strategies/knowlarity.strategy.js +20 -14
- package/dist/module/communication/strategies/knowlarity.strategy.js.map +1 -1
- package/dist/module/communication/strategies/outlook-smtp.strategy.js +2 -3
- package/dist/module/communication/strategies/outlook-smtp.strategy.js.map +1 -1
- package/dist/module/communication/strategies/outlook.strategy.js +1 -1
- package/dist/module/communication/strategies/outlook.strategy.js.map +1 -1
- package/dist/module/communication/strategies/sms.strategy.js +1 -3
- package/dist/module/communication/strategies/sms.strategy.js.map +1 -1
- package/dist/module/communication/strategies/whatsapp.strategy.js +1 -2
- package/dist/module/communication/strategies/whatsapp.strategy.js.map +1 -1
- package/dist/module/dashboard/dashboard.module.js +1 -1
- package/dist/module/dashboard/repository/dashboard.repository.js.map +1 -1
- package/dist/module/dashboard/service/dashboard.service.js +3 -3
- package/dist/module/dashboard/service/dashboard.service.js.map +1 -1
- package/dist/module/enterprise/repository/organization.repository.js.map +1 -1
- package/dist/module/filter/entity/saved-filter-master.entity.d.ts +1 -1
- package/dist/module/filter/service/filter.service.js +3 -3
- package/dist/module/filter/service/filter.service.js.map +1 -1
- package/dist/module/filter/service/saved-filter.service.js.map +1 -1
- package/dist/module/layout/controller/layout.controller.js +1 -1
- package/dist/module/layout/controller/layout.controller.js.map +1 -1
- package/dist/module/layout/repository/header-section.repository.js.map +1 -1
- package/dist/module/layout/service/header-section.service.js +2 -2
- package/dist/module/layout/service/header-section.service.js.map +1 -1
- package/dist/module/layout_preference/repository/layout_preference.repository.js +1 -1
- package/dist/module/layout_preference/service/layout_preference.service.js +1 -1
- package/dist/module/layout_preference/service/layout_preference.service.js.map +1 -1
- package/dist/module/listmaster/controller/list-master.controller.js +1 -1
- package/dist/module/listmaster/controller/list-master.controller.js.map +1 -1
- package/dist/module/listmaster/repository/list-master.repository.js.map +1 -1
- package/dist/module/listmaster/service/list-master.service.js +2 -2
- package/dist/module/listmaster/service/list-master.service.js.map +1 -1
- package/dist/module/master/controller/master.controller.js +2 -2
- package/dist/module/master/controller/master.controller.js.map +1 -1
- package/dist/module/master/service/master.service.js +1 -1
- package/dist/module/master/service/master.service.js.map +1 -1
- package/dist/module/meta/controller/attribute-master.controller.js +3 -3
- package/dist/module/meta/controller/attribute-master.controller.js.map +1 -1
- package/dist/module/meta/controller/entity-dynamic.controller.js +1 -1
- package/dist/module/meta/controller/entity-dynamic.controller.js.map +1 -1
- package/dist/module/meta/controller/entity.controller.js +2 -2
- package/dist/module/meta/controller/entity.controller.js.map +1 -1
- package/dist/module/meta/controller/media.controller.js +1 -1
- package/dist/module/meta/controller/media.controller.js.map +1 -1
- package/dist/module/meta/controller/meta.controller.js +1 -1
- package/dist/module/meta/controller/meta.controller.js.map +1 -1
- package/dist/module/meta/dto/entity-table.dto.js.map +1 -1
- package/dist/module/meta/entity/entity-master.entity.d.ts +1 -0
- package/dist/module/meta/entity/entity-master.entity.js +4 -0
- package/dist/module/meta/entity/entity-master.entity.js.map +1 -1
- package/dist/module/meta/entity/entity-table.entity.js.map +1 -1
- package/dist/module/meta/service/entity-dynamic.service.js +1 -1
- package/dist/module/meta/service/entity-dynamic.service.js.map +1 -1
- package/dist/module/meta/service/entity-list.service.js +11 -11
- package/dist/module/meta/service/entity-list.service.js.map +1 -1
- package/dist/module/meta/service/entity-service-impl.service.js +2 -2
- package/dist/module/meta/service/entity-service-impl.service.js.map +1 -1
- package/dist/module/meta/service/entity-table-column.service.js +3 -3
- package/dist/module/meta/service/entity-table-column.service.js.map +1 -1
- package/dist/module/meta/service/entity-table.service.js +2 -2
- package/dist/module/meta/service/entity-table.service.js.map +1 -1
- package/dist/module/meta/service/media-data.service.js +3 -3
- package/dist/module/meta/service/media-data.service.js.map +1 -1
- package/dist/module/meta/service/update-form-json.service.d.ts +3 -3
- package/dist/module/meta/service/update-form-json.service.js +1 -1
- package/dist/module/meta/service/update-form-json.service.js.map +1 -1
- package/dist/module/module/controller/menu.controller.js.map +1 -1
- package/dist/module/module/controller/module-access.controller.js +1 -1
- package/dist/module/module/controller/module-access.controller.js.map +1 -1
- package/dist/module/module/entity/module-access.entity.js.map +1 -1
- package/dist/module/module/entity/module.entity.js.map +1 -1
- package/dist/module/module/service/module-access.service.d.ts +1 -1
- package/dist/module/module/service/module-access.service.js +1 -1
- package/dist/module/module/service/module-access.service.js.map +1 -1
- package/dist/module/notification/controller/otp.controller.js +3 -3
- package/dist/module/notification/controller/otp.controller.js.map +1 -1
- package/dist/module/notification/service/email.service.js +2 -2
- package/dist/module/notification/service/email.service.js.map +1 -1
- package/dist/module/notification/service/otp.service.js +1 -1
- package/dist/module/notification/service/otp.service.js.map +1 -1
- package/dist/module/user/controller/login.controller.js +4 -2
- package/dist/module/user/controller/login.controller.js.map +1 -1
- package/dist/module/user/service/login.service.js +3 -3
- package/dist/module/user/service/login.service.js.map +1 -1
- package/dist/module/user/service/role.service.js +1 -1
- package/dist/module/user/service/role.service.js.map +1 -1
- package/dist/module/user/service/user.service.js +5 -5
- package/dist/module/user/service/user.service.js.map +1 -1
- package/dist/module/workflow/controller/workflow-meta.controller.js +1 -1
- package/dist/module/workflow/controller/workflow-meta.controller.js.map +1 -1
- package/dist/module/workflow/service/action.service.js +3 -3
- package/dist/module/workflow/service/action.service.js.map +1 -1
- package/dist/module/workflow/service/stage-group.service.js +1 -1
- package/dist/module/workflow/service/stage-group.service.js.map +1 -1
- package/dist/module/workflow/service/workflow-meta.service.js +5 -5
- package/dist/module/workflow/service/workflow-meta.service.js.map +1 -1
- package/dist/resources/properties.module.js +2 -2
- package/dist/resources/properties.module.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/service/base64util.service.js.map +1 -1
- package/dist/utils/service/clockIDGenUtil.service.js.map +1 -1
- package/dist/utils/service/dateUtil.service.js +1 -1
- package/dist/utils/service/dateUtil.service.js.map +1 -1
- package/dist/utils/service/encryptUtil.service.js +4 -4
- package/dist/utils/service/encryptUtil.service.js.map +1 -1
- package/dist/utils/service/excel-helper.service.js +4 -1
- package/dist/utils/service/excel-helper.service.js.map +1 -1
- package/dist/utils/service/json-util.service.js.map +1 -1
- package/dist/utils/service/loggingUtil.service.js +3 -3
- package/dist/utils/service/loggingUtil.service.js.map +1 -1
- package/package.json +1 -1
- package/src/decorators/roles.decorator.ts +1 -1
- package/src/module/auth/strategies/google.strategy.ts +6 -1
- package/src/module/auth/strategies/jwt.strategy.ts +1 -1
- package/src/module/communication/communication.module.ts +13 -2
- package/src/module/communication/controller/communication.controller.ts +21 -18
- package/src/module/communication/dto/create-config.dto.ts +32 -13
- package/src/module/communication/entity/communication-config.entity.ts +15 -9
- package/src/module/communication/entity/communication-hub.entity.ts +29 -3
- package/src/module/communication/examples/usage.example.ts +18 -17
- package/src/module/communication/factories/communication.factory.ts +36 -18
- package/src/module/communication/factories/email.factory.ts +8 -5
- package/src/module/communication/factories/sms.factory.ts +8 -5
- package/src/module/communication/factories/telephone.factory.ts +9 -8
- package/src/module/communication/factories/whatsapp.factory.ts +9 -8
- package/src/module/communication/service/communication-queue.service.ts +214 -0
- package/src/module/communication/service/communication.service.ts +340 -101
- package/src/module/communication/service/oauth.service.ts +67 -46
- package/src/module/communication/strategies/email/gmail-api.strategy.ts +44 -24
- package/src/module/communication/strategies/gmail-smtp.strategy.ts +15 -11
- package/src/module/communication/strategies/gmail.strategy.ts +15 -7
- package/src/module/communication/strategies/knowlarity.strategy.ts +67 -33
- package/src/module/communication/strategies/outlook-smtp.strategy.ts +15 -11
- package/src/module/communication/strategies/outlook.strategy.ts +12 -5
- package/src/module/communication/strategies/sms.strategy.ts +13 -10
- package/src/module/communication/strategies/whatsapp.strategy.ts +13 -9
- package/src/module/dashboard/dashboard.module.ts +1 -1
- package/src/module/dashboard/repository/dashboard.repository.ts +4 -2
- package/src/module/dashboard/service/dashboard.service.ts +16 -12
- package/src/module/enterprise/repository/organization.repository.ts +3 -1
- package/src/module/enterprise/service/enterprise.service.ts +2 -2
- package/src/module/filter/entity/saved-filter-master.entity.ts +3 -3
- package/src/module/filter/service/filter.service.ts +3 -3
- package/src/module/filter/service/saved-filter.service.ts +1 -1
- package/src/module/layout/controller/layout.controller.ts +1 -1
- package/src/module/layout/repository/header-section.repository.ts +2 -2
- package/src/module/layout/service/header-section.service.ts +2 -3
- package/src/module/layout_preference/repository/layout_preference.repository.ts +2 -2
- package/src/module/layout_preference/service/layout_preference.service.ts +1 -1
- package/src/module/listmaster/controller/list-master.controller.ts +1 -1
- package/src/module/listmaster/repository/list-master.repository.ts +2 -2
- package/src/module/listmaster/service/list-master.service.ts +2 -2
- package/src/module/master/controller/master.controller.ts +2 -2
- package/src/module/master/service/master.service.ts +1 -1
- package/src/module/meta/controller/attribute-master.controller.ts +3 -3
- package/src/module/meta/controller/entity-dynamic.controller.ts +1 -1
- package/src/module/meta/controller/entity.controller.ts +2 -2
- package/src/module/meta/controller/media.controller.ts +1 -1
- package/src/module/meta/controller/meta.controller.ts +1 -1
- package/src/module/meta/dto/entity-tab.dto.ts +4 -4
- package/src/module/meta/dto/entity-table.dto.ts +5 -6
- package/src/module/meta/entity/entity-master.entity.ts +3 -0
- package/src/module/meta/entity/entity-table.entity.ts +1 -2
- package/src/module/meta/service/entity-dynamic.service.ts +1 -1
- package/src/module/meta/service/entity-list.service.ts +18 -14
- package/src/module/meta/service/entity-service-impl.service.ts +2 -2
- package/src/module/meta/service/entity-table-column.service.ts +3 -3
- package/src/module/meta/service/entity-table.service.ts +2 -2
- package/src/module/meta/service/entity.service.ts +1 -1
- package/src/module/meta/service/media-data.service.ts +3 -3
- package/src/module/meta/service/update-form-json.service.ts +17 -26
- package/src/module/module/controller/menu.controller.ts +0 -1
- package/src/module/module/controller/module-access.controller.ts +2 -3
- package/src/module/module/entity/menu.entity.ts +1 -1
- package/src/module/module/entity/module-access.entity.ts +6 -6
- package/src/module/module/entity/module-action.entity.ts +2 -2
- package/src/module/module/entity/module.entity.ts +0 -1
- package/src/module/module/service/module-access.service.ts +7 -8
- package/src/module/notification/controller/otp.controller.ts +10 -4
- package/src/module/notification/repository/otp.repository.ts +1 -1
- package/src/module/notification/service/email.service.ts +2 -2
- package/src/module/notification/service/otp.service.ts +8 -3
- package/src/module/third-party-module/third-party.module.ts +1 -1
- package/src/module/user/controller/login.controller.ts +27 -12
- package/src/module/user/service/login.service.ts +27 -27
- package/src/module/user/service/role.service.ts +1 -1
- package/src/module/user/service/user.service.ts +5 -5
- package/src/module/workflow/controller/workflow-meta.controller.ts +1 -1
- package/src/module/workflow/service/action.service.ts +3 -3
- package/src/module/workflow/service/stage-group.service.ts +1 -1
- package/src/module/workflow/service/workflow-meta.service.ts +5 -5
- package/src/resources/properties.module.ts +10 -10
- package/src/utils/dto/excel-data.dto.ts +2 -2
- package/src/utils/dto/excelsheet-data.dto.ts +3 -3
- package/src/utils/service/base64util.service.ts +16 -17
- package/src/utils/service/clockIDGenUtil.service.ts +15 -13
- package/src/utils/service/dateUtil.service.ts +6 -6
- package/src/utils/service/encryptUtil.service.ts +4 -4
- package/src/utils/service/excel-helper.service.ts +4 -1
- package/src/utils/service/file-util.service.ts +2 -2
- package/src/utils/service/json-util.service.ts +19 -19
- package/src/utils/service/loggingUtil.service.ts +4 -4
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
2
|
import { Client } from '@microsoft/microsoft-graph-client';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
CommunicationStrategy,
|
|
5
|
+
CommunicationResult,
|
|
6
|
+
} from './communication.strategy';
|
|
4
7
|
|
|
5
8
|
@Injectable()
|
|
6
9
|
export class OutlookStrategy implements CommunicationStrategy {
|
|
7
|
-
async sendMessage(
|
|
10
|
+
async sendMessage(
|
|
11
|
+
to: string,
|
|
12
|
+
message: string,
|
|
13
|
+
config: any,
|
|
14
|
+
): Promise<CommunicationResult> {
|
|
8
15
|
try {
|
|
9
16
|
const { accessToken } = config;
|
|
10
|
-
|
|
17
|
+
|
|
11
18
|
const graphClient = Client.init({
|
|
12
19
|
authProvider: {
|
|
13
20
|
getAccessToken: async () => accessToken,
|
|
@@ -52,6 +59,6 @@ export class OutlookStrategy implements CommunicationStrategy {
|
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
validateConfig(config: any): boolean {
|
|
55
|
-
return !!
|
|
62
|
+
return !!config.accessToken;
|
|
56
63
|
}
|
|
57
|
-
}
|
|
64
|
+
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
2
|
import { Twilio } from 'twilio';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
CommunicationStrategy,
|
|
5
|
+
CommunicationResult,
|
|
6
|
+
} from './communication.strategy';
|
|
4
7
|
|
|
5
8
|
@Injectable()
|
|
6
9
|
export class SmsStrategy implements CommunicationStrategy {
|
|
7
|
-
async sendMessage(
|
|
10
|
+
async sendMessage(
|
|
11
|
+
to: string,
|
|
12
|
+
message: string,
|
|
13
|
+
config: any,
|
|
14
|
+
): Promise<CommunicationResult> {
|
|
8
15
|
try {
|
|
9
16
|
const { accountSid, authToken, fromNumber } = config;
|
|
10
|
-
|
|
17
|
+
|
|
11
18
|
const client = new Twilio(accountSid, authToken);
|
|
12
|
-
|
|
19
|
+
|
|
13
20
|
const result = await client.messages.create({
|
|
14
21
|
body: message,
|
|
15
22
|
from: fromNumber,
|
|
@@ -35,10 +42,6 @@ export class SmsStrategy implements CommunicationStrategy {
|
|
|
35
42
|
}
|
|
36
43
|
|
|
37
44
|
validateConfig(config: any): boolean {
|
|
38
|
-
return !!(
|
|
39
|
-
config.accountSid &&
|
|
40
|
-
config.authToken &&
|
|
41
|
-
config.fromNumber
|
|
42
|
-
);
|
|
45
|
+
return !!(config.accountSid && config.authToken && config.fromNumber);
|
|
43
46
|
}
|
|
44
|
-
}
|
|
47
|
+
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
2
|
import axios from 'axios';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
CommunicationStrategy,
|
|
5
|
+
CommunicationResult,
|
|
6
|
+
} from './communication.strategy';
|
|
4
7
|
|
|
5
8
|
@Injectable()
|
|
6
9
|
export class WhatsAppStrategy implements CommunicationStrategy {
|
|
7
|
-
async sendMessage(
|
|
10
|
+
async sendMessage(
|
|
11
|
+
to: string,
|
|
12
|
+
message: string,
|
|
13
|
+
config: any,
|
|
14
|
+
): Promise<CommunicationResult> {
|
|
8
15
|
try {
|
|
9
16
|
const { accessToken, phoneNumberId, apiVersion = 'v17.0' } = config;
|
|
10
|
-
|
|
17
|
+
|
|
11
18
|
const url = `https://graph.facebook.com/${apiVersion}/${phoneNumberId}/messages`;
|
|
12
|
-
|
|
19
|
+
|
|
13
20
|
const payload = {
|
|
14
21
|
messaging_product: 'whatsapp',
|
|
15
22
|
to: to,
|
|
@@ -45,9 +52,6 @@ export class WhatsAppStrategy implements CommunicationStrategy {
|
|
|
45
52
|
}
|
|
46
53
|
|
|
47
54
|
validateConfig(config: any): boolean {
|
|
48
|
-
return !!(
|
|
49
|
-
config.accessToken &&
|
|
50
|
-
config.phoneNumberId
|
|
51
|
-
);
|
|
55
|
+
return !!(config.accessToken && config.phoneNumberId);
|
|
52
56
|
}
|
|
53
|
-
}
|
|
57
|
+
}
|
|
@@ -12,7 +12,7 @@ import { ModuleModule } from '../module/module.module';
|
|
|
12
12
|
imports: [
|
|
13
13
|
EntityModule,
|
|
14
14
|
TypeOrmModule.forFeature([WidgetMaster, DashboardPageData]),
|
|
15
|
-
ModuleModule
|
|
15
|
+
ModuleModule,
|
|
16
16
|
],
|
|
17
17
|
controllers: [DashboardController],
|
|
18
18
|
providers: [DashboardService, DashboardRepository],
|
|
@@ -7,8 +7,10 @@ import { WidgetMaster } from '../entity/widget_master.entity';
|
|
|
7
7
|
export class DashboardRepository {
|
|
8
8
|
constructor(private readonly dataSource: DataSource) {}
|
|
9
9
|
|
|
10
|
-
async getPages(mapped_entity_type:string, loggedInUser:any){
|
|
11
|
-
return await this.dataSource.query(
|
|
10
|
+
async getPages(mapped_entity_type: string, loggedInUser: any) {
|
|
11
|
+
return await this.dataSource.query(
|
|
12
|
+
`SELECT * FROM cr_dashboard_page_data WHERE mapped_entity_type='${mapped_entity_type}' AND applicable_type='${loggedInUser.level_type}' AND applicable_id='${loggedInUser.level_id}' AND organization_id='${loggedInUser.organization_id}' `,
|
|
13
|
+
);
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
async getDashboardPageData(
|
|
@@ -4,13 +4,17 @@ import { ModuleAccessService } from 'src/module/module/service/module-access.ser
|
|
|
4
4
|
|
|
5
5
|
@Injectable()
|
|
6
6
|
export class DashboardService {
|
|
7
|
-
constructor(
|
|
8
|
-
private readonly
|
|
7
|
+
constructor(
|
|
8
|
+
private readonly dashboardRepo: DashboardRepository,
|
|
9
|
+
private readonly moduleAccessService: ModuleAccessService,
|
|
9
10
|
) {}
|
|
10
11
|
|
|
11
12
|
async getPages(mapped_entity_type: string, loggedInUser: any) {
|
|
12
|
-
const pages = await this.dashboardRepo.getPages(
|
|
13
|
-
|
|
13
|
+
const pages = await this.dashboardRepo.getPages(
|
|
14
|
+
mapped_entity_type,
|
|
15
|
+
loggedInUser,
|
|
16
|
+
);
|
|
17
|
+
|
|
14
18
|
const access = await this.moduleAccessService.getUserPermissions({
|
|
15
19
|
userId: loggedInUser.id,
|
|
16
20
|
appcode: loggedInUser.appcode,
|
|
@@ -18,20 +22,20 @@ export class DashboardService {
|
|
|
18
22
|
level_id: loggedInUser.level_id,
|
|
19
23
|
organization_id: loggedInUser.organization_id,
|
|
20
24
|
});
|
|
21
|
-
|
|
25
|
+
|
|
22
26
|
// Build a set of accessible codes
|
|
23
27
|
const allowedCodes = new Set(
|
|
24
28
|
access
|
|
25
|
-
.filter(a => a.action === 'VIEW' && a.access === 1)
|
|
26
|
-
.map(a => a.code)
|
|
29
|
+
.filter((a) => a.action === 'VIEW' && a.access === 1)
|
|
30
|
+
.map((a) => a.code),
|
|
27
31
|
);
|
|
28
|
-
|
|
32
|
+
|
|
29
33
|
// Filter pages based on access
|
|
30
|
-
const filteredPages = pages.filter(page => allowedCodes.has(page.code));
|
|
31
|
-
|
|
32
|
-
return filteredPages
|
|
34
|
+
const filteredPages = pages.filter((page) => allowedCodes.has(page.code));
|
|
35
|
+
|
|
36
|
+
return filteredPages;
|
|
33
37
|
}
|
|
34
|
-
|
|
38
|
+
|
|
35
39
|
async getDashboardPage(pageId: number, loggedInUser: any) {
|
|
36
40
|
const organizationId = loggedInUser.organization_id;
|
|
37
41
|
// 1. Get page data
|
|
@@ -16,7 +16,9 @@ export class OrganizationRepository {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
async findOrganizationBySubdomain(
|
|
19
|
+
async findOrganizationBySubdomain(
|
|
20
|
+
subdomain: string,
|
|
21
|
+
): Promise<OrganizationData | null> {
|
|
20
22
|
return await this.organizationRepository.findOne({
|
|
21
23
|
where: { subdomain },
|
|
22
24
|
});
|
|
@@ -10,7 +10,7 @@ export class EnterpriseService {
|
|
|
10
10
|
return await this.enterpriseRepository.save(enterpriseData);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
async update(enterpriseData: EnterpriseData): Promise<EnterpriseData|null> {
|
|
13
|
+
async update(enterpriseData: EnterpriseData): Promise<EnterpriseData | null> {
|
|
14
14
|
return await this.enterpriseRepository.update(enterpriseData);
|
|
15
15
|
}
|
|
16
|
-
}
|
|
16
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ENTITYTYPE_SAVEDFILTERMASTER } from
|
|
2
|
-
import { BaseEntity } from
|
|
3
|
-
import { Column, Entity } from
|
|
1
|
+
import { ENTITYTYPE_SAVEDFILTERMASTER } from 'src/constant/global.constant';
|
|
2
|
+
import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
3
|
+
import { Column, Entity } from 'typeorm';
|
|
4
4
|
|
|
5
5
|
@Entity({ name: 'cr_saved_filter_master' })
|
|
6
6
|
export class SavedFilterMaster extends BaseEntity {
|
|
@@ -205,7 +205,7 @@ export class FilterService {
|
|
|
205
205
|
// Extract layout preference
|
|
206
206
|
const layout = layoutPreference?.[0]?.mapped_json?.quick_tab || {};
|
|
207
207
|
|
|
208
|
-
|
|
208
|
+
const showList = layout?.show_list?.map((val) => val.toLowerCase()) || [];
|
|
209
209
|
|
|
210
210
|
let allTabs;
|
|
211
211
|
if (layout.attribute) {
|
|
@@ -368,9 +368,9 @@ export class FilterService {
|
|
|
368
368
|
|
|
369
369
|
if (layoutPreference && layoutPreference[0]?.mapped_json?.sorting) {
|
|
370
370
|
if (Array.isArray(layoutPreference[0]?.mapped_json?.sorting?.tabs)) {
|
|
371
|
-
|
|
371
|
+
const preferenceTabArray =
|
|
372
372
|
layoutPreference[0]?.mapped_json?.sorting?.tabs;
|
|
373
|
-
|
|
373
|
+
const tabFilter = preferenceTabArray.find(
|
|
374
374
|
(tabData) => tabData.tab_name === tabs?.value,
|
|
375
375
|
);
|
|
376
376
|
|
|
@@ -44,7 +44,7 @@ export class SavedFilterService extends EntityServiceImpl {
|
|
|
44
44
|
await this.savedFilterRepo.updateCode(savedMaster.id, code);
|
|
45
45
|
|
|
46
46
|
// Save filter details using generated code
|
|
47
|
-
const details =
|
|
47
|
+
const details = entityData.filterDetails ?? [];
|
|
48
48
|
if (details.length) {
|
|
49
49
|
const prepared = details.map((detail: any) => {
|
|
50
50
|
// If detail.filter_value is an array, join it with comma
|
|
@@ -29,7 +29,7 @@ export class LayoutController {
|
|
|
29
29
|
// userId,
|
|
30
30
|
// );
|
|
31
31
|
if (userData) {
|
|
32
|
-
|
|
32
|
+
const response = await this.headerSectionService.findByOrganizationId(
|
|
33
33
|
userData.organization_id,
|
|
34
34
|
);
|
|
35
35
|
return res.json({
|
|
@@ -10,9 +10,8 @@ export class HeaderSectionService {
|
|
|
10
10
|
) {}
|
|
11
11
|
|
|
12
12
|
async findByOrganizationId(organizationId: number) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
let response = {};
|
|
13
|
+
const headerSections = await this.headerSectionRepository.getHeaders();
|
|
14
|
+
const response = {};
|
|
16
15
|
|
|
17
16
|
await Promise.all(
|
|
18
17
|
headerSections.map(async (headerSection) => {
|
|
@@ -15,7 +15,7 @@ export class LayoutPreferenceRepository {
|
|
|
15
15
|
mapped_level_id: string,
|
|
16
16
|
mapped_level_type: string,
|
|
17
17
|
userId: number,
|
|
18
|
-
type: string
|
|
18
|
+
type: string,
|
|
19
19
|
): Promise<LayoutPreference | null> {
|
|
20
20
|
return this.layoutPreferenceRepo.findOne({
|
|
21
21
|
where: {
|
|
@@ -23,7 +23,7 @@ export class LayoutPreferenceRepository {
|
|
|
23
23
|
mapped_entity_type: mapped_entity_type,
|
|
24
24
|
mapped_level_id: mapped_level_id,
|
|
25
25
|
mapped_level_type: mapped_level_type,
|
|
26
|
-
type: type
|
|
26
|
+
type: type,
|
|
27
27
|
},
|
|
28
28
|
});
|
|
29
29
|
}
|
|
@@ -118,7 +118,7 @@ export class LayoutPreferenceService extends EntityServiceImpl {
|
|
|
118
118
|
rawData.map((row) => [row.column_value, Number(row.count)]),
|
|
119
119
|
);
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
const entries = Object.entries(result);
|
|
122
122
|
|
|
123
123
|
switch (sort_by) {
|
|
124
124
|
case 'asc':
|
|
@@ -122,7 +122,7 @@ export class ListMasterController {
|
|
|
122
122
|
@Body() item: any,
|
|
123
123
|
@Req() req: Request & { user: any },
|
|
124
124
|
) {
|
|
125
|
-
|
|
125
|
+
const loggedInUser = req.user.userData;
|
|
126
126
|
|
|
127
127
|
return await this.listMasterItemService.upsertListMasterItem(
|
|
128
128
|
type,
|
|
@@ -28,8 +28,8 @@ export class ListMasterRepository {
|
|
|
28
28
|
const qb = this.repo
|
|
29
29
|
.createQueryBuilder('item')
|
|
30
30
|
.where('item.source = :source', { source: 'master' })
|
|
31
|
-
.andWhere('item.organization_id = :organizationId', { organizationId })
|
|
32
|
-
|
|
31
|
+
.andWhere('item.organization_id = :organizationId', { organizationId });
|
|
32
|
+
// .andWhere('item.is_factory = :isFactory', { isFactory: false });
|
|
33
33
|
|
|
34
34
|
if (search?.trim()) {
|
|
35
35
|
qb.andWhere(
|
|
@@ -114,7 +114,7 @@ export class ListMasterService {
|
|
|
114
114
|
sourceList,
|
|
115
115
|
loggedInUser,
|
|
116
116
|
);
|
|
117
|
-
const tableName = entityMaster.
|
|
117
|
+
const tableName = entityMaster.data_source;
|
|
118
118
|
|
|
119
119
|
const applyCommonFilters = (qb: any, status?: number) => {
|
|
120
120
|
if (status) {
|
|
@@ -225,7 +225,7 @@ export class ListMasterService {
|
|
|
225
225
|
customSourceId: number,
|
|
226
226
|
params?: Record<string, string>,
|
|
227
227
|
) {
|
|
228
|
-
|
|
228
|
+
const apiRegistry = await this.apiRegistryService.findById(customSourceId);
|
|
229
229
|
if (!apiRegistry) return [];
|
|
230
230
|
|
|
231
231
|
const url = `${apiRegistry.base_url}${apiRegistry.endpoint.replace(/{{(.*?)}}/g, (_, key) => params?.[key.trim()] || '')}`;
|
|
@@ -41,7 +41,7 @@ export class MasterController {
|
|
|
41
41
|
@UploadedFile() file: Express.Multer.File,
|
|
42
42
|
@Req() req: Request & { user: any },
|
|
43
43
|
) {
|
|
44
|
-
|
|
44
|
+
const loggedInUser = req.user.userData;
|
|
45
45
|
if (!file) {
|
|
46
46
|
throw new BadRequestException('File is required');
|
|
47
47
|
}
|
|
@@ -57,7 +57,7 @@ export class MasterController {
|
|
|
57
57
|
@Body('duplicateHandling')
|
|
58
58
|
duplicateHandling: 'skip_duplicates' | 'overwrite_items',
|
|
59
59
|
) {
|
|
60
|
-
|
|
60
|
+
const loggedInUser = req.user.userData;
|
|
61
61
|
// let loggedInUser = await this.entityService.getEntityData(ENTITYTYPE_USER, requestedUser.userId);
|
|
62
62
|
|
|
63
63
|
if (!file) {
|
|
@@ -183,7 +183,7 @@ export class MasterService {
|
|
|
183
183
|
|
|
184
184
|
for (const attribute of attributes) {
|
|
185
185
|
if (attribute.data_source_type === 'entity') {
|
|
186
|
-
|
|
186
|
+
const entityMaster = await this.entityMasterService.getEntityData(
|
|
187
187
|
attribute.datasource_list,
|
|
188
188
|
loggedInUser,
|
|
189
189
|
);
|
|
@@ -23,7 +23,7 @@ export class AttributeMasterController {
|
|
|
23
23
|
@Body() attributeData: any,
|
|
24
24
|
@Req() req: Request & { user: any },
|
|
25
25
|
) {
|
|
26
|
-
|
|
26
|
+
const loggedInUser = req.user.userData;
|
|
27
27
|
return await this.attributeMasterService.createAttribute(
|
|
28
28
|
attributeData,
|
|
29
29
|
loggedInUser,
|
|
@@ -36,7 +36,7 @@ export class AttributeMasterController {
|
|
|
36
36
|
@Param('id') id: number,
|
|
37
37
|
@Req() req: Request & { user: any },
|
|
38
38
|
) {
|
|
39
|
-
|
|
39
|
+
const loggedInUser = req.user.userData;
|
|
40
40
|
return await this.attributeMasterService.updateAttribute(
|
|
41
41
|
attributeData,
|
|
42
42
|
id,
|
|
@@ -57,7 +57,7 @@ export class AttributeMasterController {
|
|
|
57
57
|
@Param('entityType') entityType: string,
|
|
58
58
|
@Req() req: Request & { user: any },
|
|
59
59
|
) {
|
|
60
|
-
|
|
60
|
+
const loggedInUser = req.user.userData;
|
|
61
61
|
return await this.attributeMasterService.getAttributesDropdownList(
|
|
62
62
|
entityType,
|
|
63
63
|
loggedInUser,
|
|
@@ -102,7 +102,7 @@ export class EntityDynamicController {
|
|
|
102
102
|
@Req() req: Request & { user: any },
|
|
103
103
|
@Query('appcode') appcode?: string,
|
|
104
104
|
) {
|
|
105
|
-
|
|
105
|
+
const loggedInUser = req.user.userData;
|
|
106
106
|
return await this.entityDynamicService.getEntitiesDropdownList(
|
|
107
107
|
loggedInUser,
|
|
108
108
|
appcode,
|
|
@@ -139,8 +139,8 @@ export class EntityController {
|
|
|
139
139
|
@Query('entity_type') entityType: string,
|
|
140
140
|
@Req() req: Request & { user: any },
|
|
141
141
|
) {
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
const loggedInUser = req.user.userData;
|
|
143
|
+
const appcode = req.user.userData.appcode;
|
|
144
144
|
|
|
145
145
|
if (!entityType) {
|
|
146
146
|
throw new BadRequestException(
|
|
@@ -33,7 +33,7 @@ export class MediaController {
|
|
|
33
33
|
) {
|
|
34
34
|
const loggedInUser = req.user.userData;
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
const result = await this.mediaDataService.generateMediaUploadDetails(
|
|
37
37
|
body.file_name,
|
|
38
38
|
body.attribute_key,
|
|
39
39
|
loggedInUser,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class EntityTab{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
export class EntityTab {
|
|
2
|
+
tab_value: string;
|
|
3
|
+
tab_value_count: number;
|
|
4
|
+
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { EntityTable } from '../entity/entity-table.entity';
|
|
2
2
|
import { EntityTableColumn } from '../entity/entity-table-column.entity';
|
|
3
3
|
|
|
4
|
-
export class EntityTableDto extends EntityTable{
|
|
4
|
+
export class EntityTableDto extends EntityTable {
|
|
5
5
|
column_list: EntityTableColumn[];
|
|
6
|
-
operation_list:{};
|
|
7
|
-
default_filter:{} | null;
|
|
8
|
-
saved_filter:{ label: string; value: number }[]
|
|
9
|
-
|
|
10
|
-
}
|
|
6
|
+
operation_list: {};
|
|
7
|
+
default_filter: {} | null;
|
|
8
|
+
saved_filter: { label: string; value: number }[] | null;
|
|
9
|
+
}
|
|
@@ -9,7 +9,6 @@ export class EntityTable extends BaseEntity {
|
|
|
9
9
|
this.entity_type = ENTITYTYPE_ENTITYTABLE;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
13
12
|
@Column({ name: 'mapped_entity_type', nullable: true })
|
|
14
13
|
mapped_entity_type: string;
|
|
15
14
|
|
|
@@ -46,6 +45,6 @@ export class EntityTable extends BaseEntity {
|
|
|
46
45
|
@Column({ name: 'is_proc', nullable: true })
|
|
47
46
|
is_proc: number;
|
|
48
47
|
|
|
49
|
-
@Column({ name: 'display_type', nullable: true})
|
|
48
|
+
@Column({ name: 'display_type', nullable: true })
|
|
50
49
|
display_type: string;
|
|
51
50
|
}
|
|
@@ -506,7 +506,7 @@ export class EntityDynamicService {
|
|
|
506
506
|
const organizationId = loggedInUser.organization_id;
|
|
507
507
|
|
|
508
508
|
let query = `SELECT name as label,mapped_entity_type as value FROM cr_entity_master WHERE organization_id = ?`;
|
|
509
|
-
|
|
509
|
+
const params = [organizationId];
|
|
510
510
|
|
|
511
511
|
if (appcode) {
|
|
512
512
|
query += ` AND appcode = ?`;
|
|
@@ -27,16 +27,17 @@ export class EntityListService {
|
|
|
27
27
|
tabValue?: string,
|
|
28
28
|
appcode?: string,
|
|
29
29
|
): Promise<EntityListData> {
|
|
30
|
-
|
|
30
|
+
const entityListData = new EntityListData();
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
const entityTable =
|
|
33
|
+
await this.entityTableService.findByEntityTypeAndListType(
|
|
34
|
+
entityType,
|
|
35
|
+
listType,
|
|
36
|
+
);
|
|
36
37
|
|
|
37
38
|
if (entityTable) {
|
|
38
39
|
if (1 != entityTable.is_proc) {
|
|
39
|
-
|
|
40
|
+
const totalCount = await this.getTotalCount(
|
|
40
41
|
entityTable,
|
|
41
42
|
filters,
|
|
42
43
|
appcode,
|
|
@@ -76,7 +77,7 @@ export class EntityListService {
|
|
|
76
77
|
// }
|
|
77
78
|
|
|
78
79
|
let query = this.getQuery(entityTable.data_source, null);
|
|
79
|
-
|
|
80
|
+
const whereClause = await this.getWhereClause(entityTable, filters);
|
|
80
81
|
if (whereClause.query) {
|
|
81
82
|
query += whereClause.query;
|
|
82
83
|
}
|
|
@@ -95,22 +96,25 @@ export class EntityListService {
|
|
|
95
96
|
appcode?: string,
|
|
96
97
|
) {
|
|
97
98
|
let query = this.getQuery(entityTable.data_source, entityTable.tab_column);
|
|
98
|
-
|
|
99
|
+
const whereClause = await this.getWhereClause(entityTable, filters);
|
|
99
100
|
if (whereClause.query) {
|
|
100
101
|
query += whereClause.query;
|
|
101
102
|
}
|
|
102
103
|
query += ' GROUP BY ' + entityTable.tab_column;
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
const tabs = await this.entityManager.query(
|
|
106
|
+
query,
|
|
107
|
+
whereClause.argumentList,
|
|
108
|
+
);
|
|
105
109
|
|
|
106
110
|
let all = 0;
|
|
107
111
|
for (const i in tabs) {
|
|
108
|
-
|
|
112
|
+
const tab = tabs[i] as EntityTab;
|
|
109
113
|
tab.tab_value = String(tab.tab_value).toUpperCase(); // Capitalize tab_value
|
|
110
114
|
all += parseInt(String(tab.tab_value_count));
|
|
111
115
|
}
|
|
112
116
|
|
|
113
|
-
|
|
117
|
+
const entityTab = new EntityTab();
|
|
114
118
|
entityTab.tab_value = 'ALL';
|
|
115
119
|
entityTab.tab_value_count = all;
|
|
116
120
|
tabs.push(entityTab);
|
|
@@ -143,7 +147,7 @@ export class EntityListService {
|
|
|
143
147
|
|
|
144
148
|
if (filterCriteria && Object.keys(filterCriteria).length > 0) {
|
|
145
149
|
for (const [columnName, value] of Object.entries(filterCriteria)) {
|
|
146
|
-
|
|
150
|
+
const column = columnName.endsWith('__from')
|
|
147
151
|
? columnName.replace('__from', '')
|
|
148
152
|
: columnName;
|
|
149
153
|
|
|
@@ -185,7 +189,7 @@ export class EntityListService {
|
|
|
185
189
|
parentType: string | null,
|
|
186
190
|
parentId: number | null,
|
|
187
191
|
) {
|
|
188
|
-
|
|
192
|
+
const query = `SELECT COUNT(1) seq_no
|
|
189
193
|
FROM ${tableName} WHERE 1=1 `;
|
|
190
194
|
const argsObjectList: any[] = [];
|
|
191
195
|
// if (parentId) {
|
|
@@ -194,7 +198,7 @@ export class EntityListService {
|
|
|
194
198
|
// argsObjectList.push(parentType);
|
|
195
199
|
// }
|
|
196
200
|
|
|
197
|
-
|
|
201
|
+
const result = await this.entityManager.query(query, argsObjectList);
|
|
198
202
|
|
|
199
203
|
return result ? result[0].seq_no : 0;
|
|
200
204
|
}
|
|
@@ -449,7 +449,7 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
|
|
|
449
449
|
if (ENTITYTYPE_ENTITYMASTER === entityType) {
|
|
450
450
|
tableName = 'cr_entity_master';
|
|
451
451
|
} else {
|
|
452
|
-
|
|
452
|
+
const entityMaster = await this.entityMasterService.getEntityData(
|
|
453
453
|
entityType,
|
|
454
454
|
loggedInUser,
|
|
455
455
|
);
|
|
@@ -492,7 +492,7 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
|
|
|
492
492
|
`Repository service not found for entityType: ${entityType}`,
|
|
493
493
|
);
|
|
494
494
|
}
|
|
495
|
-
|
|
495
|
+
const data = await repoService.findOne({ where: { id: entityId } });
|
|
496
496
|
return this.resolverService.getResolvedData(loggedInUser, data, entityType);
|
|
497
497
|
}
|
|
498
498
|
}
|
|
@@ -8,13 +8,13 @@ export class EntityTableColumnService {
|
|
|
8
8
|
) {}
|
|
9
9
|
|
|
10
10
|
async getAttributeJson(parentId: number, parentType: string) {
|
|
11
|
-
|
|
11
|
+
const entityTableColumns =
|
|
12
12
|
await this.entityTableColumnRepository.findByParentIdAndParentType(
|
|
13
13
|
parentId,
|
|
14
14
|
parentType,
|
|
15
15
|
true,
|
|
16
16
|
);
|
|
17
|
-
|
|
17
|
+
const attributeJson = {};
|
|
18
18
|
entityTableColumns.forEach((value) => {
|
|
19
19
|
attributeJson[value.attribute_key] = value.data_type;
|
|
20
20
|
});
|
|
@@ -27,7 +27,7 @@ export class EntityTableColumnService {
|
|
|
27
27
|
organization_id,
|
|
28
28
|
isVisible?: boolean,
|
|
29
29
|
) {
|
|
30
|
-
|
|
30
|
+
const entityTableColumns =
|
|
31
31
|
await this.entityTableColumnRepository.findByParentIdAndParentType(
|
|
32
32
|
parentId,
|
|
33
33
|
parentType,
|