rez_core 5.0.230 → 5.0.232

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": "5.0.230",
3
+ "version": "5.0.232",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -1486,6 +1486,7 @@ export class IntegrationService {
1486
1486
  'https://www.googleapis.com/auth/gmail.send',
1487
1487
  'https://www.googleapis.com/auth/gmail.readonly',
1488
1488
  'https://www.googleapis.com/auth/userinfo.email',
1489
+ 'https://www.googleapis.com/auth/userinfo.profile',
1489
1490
  'https://www.googleapis.com/auth/calendar',
1490
1491
  ];
1491
1492
 
@@ -1613,6 +1614,7 @@ export class IntegrationService {
1613
1614
  accessToken: string,
1614
1615
  refreshToken: string,
1615
1616
  state: string,
1617
+ name?: { displayName?: string; givenName?: string; familyName?: string },
1616
1618
  ): Promise<GmailSSOResult> {
1617
1619
  try {
1618
1620
  const oauthState = this.gmailOAuthStates.get(state);
@@ -1640,9 +1642,17 @@ export class IntegrationService {
1640
1642
  'gmail',
1641
1643
  );
1642
1644
 
1645
+ const displayName =
1646
+ name?.displayName ||
1647
+ (name?.givenName && name?.familyName
1648
+ ? `${name?.givenName} ${name?.familyName}`
1649
+ : undefined) ||
1650
+ email;
1651
+
1643
1652
  // Pure SSO configuration - no client credentials stored per user
1644
1653
  const gmailConfig = {
1645
1654
  email: email,
1655
+ fromName: displayName,
1646
1656
  accessToken: accessToken,
1647
1657
  refreshToken: refreshToken,
1648
1658
  authMethod: 'GOOGLE_SSO',
@@ -19,6 +19,8 @@ export class OAuthService {
19
19
  private readonly gmailScopes = [
20
20
  'https://www.googleapis.com/auth/gmail.send',
21
21
  'https://www.googleapis.com/auth/gmail.readonly',
22
+ 'https://www.googleapis.com/auth/userinfo.profile',
23
+ 'https://www.googleapis.com/auth/userinfo.email',
22
24
  ];
23
25
 
24
26
  generateGmailAuthUrl(state: string): string {
@@ -17,8 +17,7 @@ export class EntityDynamicService {
17
17
  private readonly entityMasterRepo: EntityMasterRepository,
18
18
  private readonly reflectionHelper: ReflectionHelper,
19
19
  private readonly configService: ConfigService,
20
- ) {
21
- }
20
+ ) {}
22
21
 
23
22
  schema = this.configService.get('DB_SCHEMA');
24
23
 
@@ -77,7 +76,11 @@ export class EntityDynamicService {
77
76
  // -------------------------------------------------------
78
77
  // AUTO-CODE GENERATION (POSTGRES SAFE)
79
78
  // -------------------------------------------------------
80
- const entityMaster = await this.entityMasterRepo.getEntityByMappedEntityType(entityType, loggedInUser.enterprise_id);
79
+ const entityMaster =
80
+ await this.entityMasterRepo.getEntityByMappedEntityType(
81
+ entityType,
82
+ loggedInUser.enterprise_id,
83
+ );
81
84
 
82
85
  if (!entityData.code && entityData.entity_type && entityMaster) {
83
86
  // Extract integer suffix
@@ -146,7 +149,6 @@ export class EntityDynamicService {
146
149
  const colList = columns.map((c) => `"${c}"`).join(', ');
147
150
  const placeholderList = placeholders.join(', ');
148
151
 
149
-
150
152
  const sql = `
151
153
  INSERT INTO ${this.schema}.${tableName} (${colList})
152
154
  VALUES (${placeholderList}) RETURNING id
@@ -550,7 +552,7 @@ export class EntityDynamicService {
550
552
  .map((attr) => `${attr.attribute_key}`)
551
553
  .join(', ');
552
554
  const selectQuery = `SELECT ${columns}
553
- FROM ${dataSource}
555
+ FROM ${this.schema}.${dataSource}
554
556
  WHERE id = $1`;
555
557
 
556
558
  const result = await this.entityManager.query(selectQuery, [id]);
@@ -572,9 +574,9 @@ export class EntityDynamicService {
572
574
  row[attr.attribute_key] =
573
575
  row[attr.attribute_key] != null
574
576
  ? await this.mediaDataService.getMediaDownloadUrl(
575
- Number(row[attr.attribute_key]),
576
- loggedInUser,
577
- )
577
+ Number(row[attr.attribute_key]),
578
+ loggedInUser,
579
+ )
578
580
  : null;
579
581
  }
580
582
  }
@@ -591,7 +593,11 @@ export class EntityDynamicService {
591
593
  ): Promise<any> {
592
594
  const enterprise_id = loggedInUser.enterprise_id;
593
595
 
594
- const entityMaster = await this.entityMasterRepo.getEntityByMappedEntityType(entityType, enterprise_id);
596
+ const entityMaster =
597
+ await this.entityMasterRepo.getEntityByMappedEntityType(
598
+ entityType,
599
+ enterprise_id,
600
+ );
595
601
  if (!entityMaster) return null;
596
602
 
597
603
  const validAttributes = await this.getAttributeCodes(
@@ -601,7 +607,7 @@ export class EntityDynamicService {
601
607
 
602
608
  // const entityRepo = this.reflectionHelper.getRepoService(entityMaster?.entity_data_class);
603
609
 
604
- const columns = validAttributes.map(attr => `t.${attr.attribute_key}`);
610
+ const columns = validAttributes.map((attr) => `t.${attr.attribute_key}`);
605
611
 
606
612
  // const result = await entityRepo.find({
607
613
  // where: {
@@ -632,9 +638,9 @@ export class EntityDynamicService {
632
638
  row[attr.attribute_key] =
633
639
  row[attr.attribute_key] != null
634
640
  ? await this.mediaDataService.getMediaDownloadUrl(
635
- Number(row[attr.attribute_key]),
636
- loggedInUser,
637
- )
641
+ Number(row[attr.attribute_key]),
642
+ loggedInUser,
643
+ )
638
644
  : null;
639
645
  }
640
646
  }
@@ -732,14 +738,19 @@ export class EntityDynamicService {
732
738
  loggedInUser: any,
733
739
  appcode?: string,
734
740
  ): Promise<any> {
735
-
736
- const entityMasters = await this.entityMasterRepo.findByEnterpriseIdAndAppCode(loggedInUser.enterprise_id, appcode);
741
+ const entityMasters =
742
+ await this.entityMasterRepo.findByEnterpriseIdAndAppCode(
743
+ loggedInUser.enterprise_id,
744
+ appcode,
745
+ );
737
746
 
738
747
  let dropdown = [] as any;
739
- entityMasters.map(entityMaster => dropdown.push({
740
- label: entityMaster.name,
741
- value: entityMaster.mapped_entity_type,
742
- }));
748
+ entityMasters.map((entityMaster) =>
749
+ dropdown.push({
750
+ label: entityMaster.name,
751
+ value: entityMaster.mapped_entity_type,
752
+ }),
753
+ );
743
754
 
744
755
  return dropdown;
745
756
  }
@@ -160,7 +160,7 @@ export class ResolverService {
160
160
  const statusItem = options.find(
161
161
  (opt) => opt.value == uploadData.review_status,
162
162
  );
163
- uploadData.review_status_label =
163
+ uploadData.review_status =
164
164
  statusItem?.label || uploadData.review_status;
165
165
  }
166
166
 
@@ -91,6 +91,7 @@ export class LoginController {
91
91
  googleAccessToken,
92
92
  googleRefreshToken,
93
93
  actualState,
94
+ name,
94
95
  );
95
96
 
96
97
  return res.send(