rez_core 4.0.9 → 4.0.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "4.0.9",
3
+ "version": "4.0.11",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -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
- const loggedInUser = req.user.userData;
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
- const ip =
16
- (req.headers['x-forwarded-for'] as string)?.split(',')[0].trim() ||
17
- req.socket.remoteAddress ||
18
- req.ip ||
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
- 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';
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
- return this.authService.fcmtoken(fcmtoken, loggedInUser, ip, browser, os);
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, organization_id } = loggedInUser;
38
+ const { id: userId, sessionToken } = loggedInUser;
39
39
 
40
40
  // Update the sso_user table
41
41
  await this.dataSource.query(
42
- `UPDATE sso_user
42
+ `UPDATE sso_user_session
43
43
  SET fcm_token = ?, ip = ?, browser = ?, os = ?
44
- WHERE id = ? AND organization_id = ?`,
45
- [fcmtoken, ip, browser, os, userId, organization_id],
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' };
@@ -229,8 +229,8 @@ export class ResolverService {
229
229
  else if (attr.data_source_type === 'master') {
230
230
  const [item] = await this.dataSource.query(
231
231
  `SELECT id FROM frm_list_master_items
232
- WHERE ${attr.data_source_attribute} = ? AND organization_id = ?`,
233
- [displayValue, loggedInUser.organization_id],
232
+ WHERE ${attr.data_source_attribute} = ? AND organization_id = ? AND listtype = ?`,
233
+ [displayValue, loggedInUser.organization_id, attr.datasource_list],
234
234
  );
235
235
  return item?.id ?? displayValue;
236
236
  }
@@ -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
  }
@@ -1,5 +0,0 @@
1
- {
2
- "recommendations": [
3
- "dbaeumer.vscode-eslint"
4
- ]
5
- }