rez_core 4.0.10 → 4.0.12
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/controller/auth.controller.d.ts +0 -3
- package/dist/module/auth/controller/auth.controller.js +0 -26
- package/dist/module/auth/controller/auth.controller.js.map +1 -1
- package/dist/module/auth/services/auth.service.js +3 -3
- package/dist/module/auth/services/auth.service.js.map +1 -1
- package/dist/module/listmaster/entity/list-master-items.entity.js +2 -0
- package/dist/module/listmaster/entity/list-master-items.entity.js.map +1 -1
- package/dist/module/listmaster/entity/list-master.entity.js +1 -0
- package/dist/module/listmaster/entity/list-master.entity.js.map +1 -1
- package/dist/module/meta/entity/attribute-master.entity.js +3 -1
- package/dist/module/meta/entity/attribute-master.entity.js.map +1 -1
- package/dist/module/meta/entity/entity-master.entity.js +1 -0
- package/dist/module/meta/entity/entity-master.entity.js.map +1 -1
- package/dist/module/user/entity/user-session.entity.d.ts +4 -0
- package/dist/module/user/entity/user-session.entity.js +16 -0
- package/dist/module/user/entity/user-session.entity.js.map +1 -1
- package/dist/module/user/entity/user.entity.d.ts +0 -4
- package/dist/module/user/entity/user.entity.js +0 -16
- package/dist/module/user/entity/user.entity.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/auth/controller/auth.controller.ts +15 -15
- package/src/module/auth/services/auth.service.ts +4 -4
- package/src/module/listmaster/entity/list-master-items.entity.ts +3 -1
- package/src/module/listmaster/entity/list-master.entity.ts +2 -1
- package/src/module/meta/entity/attribute-master.entity.ts +3 -1
- package/src/module/meta/entity/entity-master.entity.ts +2 -1
- package/src/module/user/entity/user-session.entity.ts +12 -0
- package/src/module/user/entity/user.entity.ts +0 -12
package/package.json
CHANGED
|
@@ -7,22 +7,22 @@ import { UAParser } from 'ua-parser-js';
|
|
|
7
7
|
export class AuthController {
|
|
8
8
|
constructor(private readonly authService: AuthService) {}
|
|
9
9
|
|
|
10
|
-
@Post('fcmtoken')
|
|
11
|
-
@UseGuards(JwtAuthGuard)
|
|
12
|
-
async getDashboard(@Req() req: any, @Body('fcmtoken') fcmtoken: string) {
|
|
13
|
-
|
|
10
|
+
// @Post('fcmtoken')
|
|
11
|
+
// @UseGuards(JwtAuthGuard)
|
|
12
|
+
// async getDashboard(@Req() req: any, @Body('fcmtoken') fcmtoken: string) {
|
|
13
|
+
// const loggedInUser = req.user.userData;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
// const ip =
|
|
16
|
+
// (req.headers['x-forwarded-for'] as string)?.split(',')[0].trim() ||
|
|
17
|
+
// req.socket.remoteAddress ||
|
|
18
|
+
// req.ip ||
|
|
19
|
+
// '';
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
// const userAgent = req.headers['user-agent'] || '';
|
|
22
|
+
// const parser = new UAParser(userAgent);
|
|
23
|
+
// const browser = parser.getBrowser().name || 'Unknown';
|
|
24
|
+
// const os = parser.getOS().name || 'Unknown';
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
}
|
|
26
|
+
// return this.authService.fcmtoken(fcmtoken, loggedInUser, ip, browser, os);
|
|
27
|
+
// }
|
|
28
28
|
}
|
|
@@ -35,14 +35,14 @@ export class AuthService {
|
|
|
35
35
|
browser: string,
|
|
36
36
|
os: string,
|
|
37
37
|
) {
|
|
38
|
-
const { id: userId,
|
|
38
|
+
const { id: userId, sessionToken } = loggedInUser;
|
|
39
39
|
|
|
40
40
|
// Update the sso_user table
|
|
41
41
|
await this.dataSource.query(
|
|
42
|
-
`UPDATE
|
|
42
|
+
`UPDATE sso_user_session
|
|
43
43
|
SET fcm_token = ?, ip = ?, browser = ?, os = ?
|
|
44
|
-
WHERE
|
|
45
|
-
[fcmtoken, ip, browser, os,
|
|
44
|
+
WHERE session_key = ? AND user_id = ? `,
|
|
45
|
+
[fcmtoken, ip, browser, os, sessionToken, userId],
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
return { message: 'FCM token updated successfully' };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
1
|
+
import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
2
|
import { BaseEntity } from '../../meta/entity/base-entity.entity';
|
|
3
3
|
import { ENTITYTYPE_LISTMASTERITEMS } from '../../../constant/global.constant';
|
|
4
4
|
|
|
5
5
|
@Entity({ name: 'frm_list_master_items' })
|
|
6
|
+
@Index('idx_list_master_items_listtype_value_org', ['listtype', 'value', 'organization_id'])
|
|
7
|
+
@Index('idx_list_master_items_listtype_org', ['listtype', 'organization_id'])
|
|
6
8
|
export class ListMasterItems extends BaseEntity {
|
|
7
9
|
constructor() {
|
|
8
10
|
super();
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
1
|
+
import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
2
|
import { BaseEntity } from '../../meta/entity/base-entity.entity';
|
|
3
3
|
import { ENTITYTYPE_LISTMASTER } from '../../../constant/global.constant';
|
|
4
4
|
|
|
5
5
|
@Entity({ name: 'frm_list_master' })
|
|
6
|
+
@Index('idx_list_master_type_org', ['type', 'organization_id'])
|
|
6
7
|
export class ListMasterData extends BaseEntity {
|
|
7
8
|
constructor() {
|
|
8
9
|
super();
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { BaseEntity } from './base-entity.entity';
|
|
2
|
-
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { Column, Entity, Index } from 'typeorm';
|
|
3
3
|
|
|
4
4
|
@Entity({ name: 'frm_entity_attribute' })
|
|
5
|
+
@Index('idx_attribute_master_key_org_entity', ['attribute_key', 'organization_id', 'mapped_entity_type'])
|
|
6
|
+
@Index('idx_attribute_master_org_entity', ['organization_id', 'mapped_entity_type'])
|
|
5
7
|
export class AttributeMaster extends BaseEntity {
|
|
6
8
|
@Column({ name: 'mapped_entity_type', type: 'varchar', nullable: true })
|
|
7
9
|
mapped_entity_type: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BaseEntity } from './base-entity.entity';
|
|
2
2
|
import { ENTITYTYPE_ENTITYMASTER } from '../../../constant/global.constant';
|
|
3
|
-
import { Column, Entity } from 'typeorm';
|
|
3
|
+
import { Column, Entity, Index } from 'typeorm';
|
|
4
4
|
|
|
5
5
|
@Entity({ name: 'frm_entity_master' })
|
|
6
|
+
@Index('idx_entity_master_mapped_type_org', ['mapped_entity_type', 'organization_id'])
|
|
6
7
|
export class EntityMaster extends BaseEntity {
|
|
7
8
|
constructor() {
|
|
8
9
|
super();
|
|
@@ -58,4 +58,16 @@ export class UserSession {
|
|
|
58
58
|
nullable: true,
|
|
59
59
|
})
|
|
60
60
|
expiry_date: Date;
|
|
61
|
+
|
|
62
|
+
@Column({ type: 'varchar', nullable: true })
|
|
63
|
+
fcm_token: string;
|
|
64
|
+
|
|
65
|
+
@Column({ type: 'varchar', nullable: true })
|
|
66
|
+
browser: string;
|
|
67
|
+
|
|
68
|
+
@Column({ type: 'varchar', nullable: true })
|
|
69
|
+
ip: string;
|
|
70
|
+
|
|
71
|
+
@Column({ type: 'varchar', nullable: true })
|
|
72
|
+
os: string;
|
|
61
73
|
}
|
|
@@ -54,18 +54,6 @@ export class UserData extends BaseEntity {
|
|
|
54
54
|
@Column({ nullable: true })
|
|
55
55
|
date: Date;
|
|
56
56
|
|
|
57
|
-
@Column({ type: 'varchar', nullable: true })
|
|
58
|
-
fcm_token: string;
|
|
59
|
-
|
|
60
|
-
@Column({ type: 'varchar', nullable: true })
|
|
61
|
-
browser: string;
|
|
62
|
-
|
|
63
|
-
@Column({ type: 'varchar', nullable: true })
|
|
64
|
-
ip: string;
|
|
65
|
-
|
|
66
|
-
@Column({ type: 'varchar', nullable: true })
|
|
67
|
-
os: string;
|
|
68
|
-
|
|
69
57
|
@Column({ type: 'varchar', nullable: true })
|
|
70
58
|
profile_image: string;
|
|
71
59
|
}
|