rez_core 2.2.260 → 2.2.261

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": "2.2.260",
3
+ "version": "2.2.261",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
package/src/app.module.ts CHANGED
@@ -19,7 +19,6 @@ import { DashboardModule } from './module/dashboard/dashboard.module';
19
19
  import { IntegrationModule } from './module/integration/integration.module';
20
20
  import { ScheduleModule } from '@nestjs/schedule';
21
21
  import { AuthModule } from './module/auth/auth.module';
22
- import { WorkflowAutomationModule } from './module/workflow-automation/workflow-automation.module';
23
22
 
24
23
  @Module({
25
24
  imports: [
@@ -0,0 +1,14 @@
1
+ import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
2
+ import { Column, Entity } from 'typeorm';
3
+
4
+ @Entity({ name: 'cr_integration_telephone_mapper' })
5
+ export class IntegrationSource extends BaseEntity {
6
+ @Column({ name: 'did', type: 'varchar', length: 100 })
7
+ did: string;
8
+
9
+ @Column({ name: 'campaign_name', type: 'varchar', length: 100 })
10
+ campaign_name: string;
11
+
12
+ @Column({ name: 'mapped_entity_type', type: 'varchar', length: 20 })
13
+ mapped_entity_type: string;
14
+ }
@@ -3,7 +3,7 @@ import { Column, Entity } from 'typeorm';
3
3
 
4
4
  @Entity({ name: 'cr_integration_master' })
5
5
  export class IntegrationSource extends BaseEntity {
6
- @Column({ name: 'logo', type: 'varchar', length: 100 })
6
+ @Column({ name: 'logo', type: 'varchar', length: 500 })
7
7
  logo: string;
8
8
 
9
9
  @Column({ name: 'base_url', type: 'varchar', length: 100 })
@@ -11,4 +11,7 @@ export class IntegrationSource extends BaseEntity {
11
11
 
12
12
  @Column({ name: 'integration_type', type: 'varchar', length: 20 })
13
13
  integration_type: string;
14
+
15
+ @Column({ name: 'description', type: 'varchar', length: 20 })
16
+ description: string;
14
17
  }
@@ -6,10 +6,14 @@ import {
6
6
  } from 'src/constant/global.constant';
7
7
  import { DataSource } from 'typeorm';
8
8
  import { UserData } from 'src/module/user/entity/user.entity';
9
+ import { MediaDataService } from './media-data.service';
9
10
 
10
11
  @Injectable()
11
12
  export class EntityDynamicService {
12
- constructor(private readonly dataSource: DataSource) {}
13
+ constructor(
14
+ private readonly dataSource: DataSource,
15
+ private readonly mediaDataService: MediaDataService,
16
+ ) {}
13
17
 
14
18
  // -----------------------------
15
19
  async createEntity(
@@ -60,17 +64,40 @@ export class EntityDynamicService {
60
64
  }
61
65
 
62
66
  const bypassColumn = [
63
- { attribute_key: 'created_date', db_datatype: 'datetime' },
64
- { attribute_key: 'created_by', db_datatype: 'int' },
65
- { attribute_key: 'organization_id', db_datatype: 'datetime' },
66
- { attribute_key: 'enterprise_id', db_datatype: 'int' },
67
- { attribute_key: 'organization_id', db_datatype: 'int' },
68
- { attribute_key: 'level_type', db_datatype: 'int' },
69
- { attribute_key: 'level_id', db_datatype: 'varchar' },
70
- { attribute_key: 'level_id', db_datatype: 'int' },
71
- { attribute_key: 'status', db_datatype: 'varchar' },
72
- { attribute_key: 'entity_type', db_datatype: 'varchar' },
73
- { attribute_key: 'code', db_datatype: 'varchar' },
67
+ {
68
+ attribute_key: 'created_date',
69
+ db_datatype: 'datetime',
70
+ element_type: 'date',
71
+ },
72
+ {
73
+ attribute_key: 'created_by',
74
+ db_datatype: 'int',
75
+ element_type: 'number',
76
+ },
77
+ {
78
+ attribute_key: 'organization_id',
79
+ db_datatype: 'datetime',
80
+ element_type: 'date',
81
+ },
82
+ {
83
+ attribute_key: 'enterprise_id',
84
+ db_datatype: 'int',
85
+ element_type: 'number',
86
+ },
87
+ { attribute_key: 'level_type', db_datatype: 'int', element_type: 'text' },
88
+ {
89
+ attribute_key: 'level_id',
90
+ db_datatype: 'varchar',
91
+ element_type: 'text',
92
+ },
93
+ { attribute_key: 'level_id', db_datatype: 'int', element_type: 'number' },
94
+ { attribute_key: 'status', db_datatype: 'varchar', element_type: 'text' },
95
+ {
96
+ attribute_key: 'entity_type',
97
+ db_datatype: 'varchar',
98
+ element_type: 'text',
99
+ },
100
+ { attribute_key: 'code', db_datatype: 'varchar', element_type: 'text' },
74
101
  ];
75
102
 
76
103
  validAttributes.push(...bypassColumn);
@@ -400,17 +427,49 @@ export class EntityDynamicService {
400
427
  }
401
428
 
402
429
  const bypassColumn = [
403
- { attribute_key: 'created_date', db_datatype: 'datetime' },
404
- { attribute_key: 'created_by', db_datatype: 'int' },
405
- { attribute_key: 'modified_date', db_datatype: 'datetime' },
406
- { attribute_key: 'modified_by', db_datatype: 'int' },
407
- { attribute_key: 'organization_id', db_datatype: 'int' },
408
- { attribute_key: 'enterprise_id', db_datatype: 'int' },
409
- { attribute_key: 'level_type', db_datatype: 'varchar' },
410
- { attribute_key: 'level_id', db_datatype: 'int' },
411
- { attribute_key: 'status', db_datatype: 'varchar' },
412
- { attribute_key: 'entity_type', db_datatype: 'varchar' },
413
- { attribute_key: 'code', db_datatype: 'varchar' },
430
+ {
431
+ attribute_key: 'created_date',
432
+ db_datatype: 'datetime',
433
+ element_type: 'date',
434
+ },
435
+ {
436
+ attribute_key: 'created_by',
437
+ db_datatype: 'int',
438
+ element_type: 'number',
439
+ },
440
+ {
441
+ attribute_key: 'modified_date',
442
+ db_datatype: 'datetime',
443
+ element_type: 'date',
444
+ },
445
+ {
446
+ attribute_key: 'modified_by',
447
+ db_datatype: 'int',
448
+ element_type: 'number',
449
+ },
450
+ {
451
+ attribute_key: 'organization_id',
452
+ db_datatype: 'int',
453
+ element_type: 'number',
454
+ },
455
+ {
456
+ attribute_key: 'enterprise_id',
457
+ db_datatype: 'int',
458
+ element_type: 'number',
459
+ },
460
+ {
461
+ attribute_key: 'level_type',
462
+ db_datatype: 'varchar',
463
+ element_type: 'text',
464
+ },
465
+ { attribute_key: 'level_id', db_datatype: 'int', element_type: 'number' },
466
+ { attribute_key: 'status', db_datatype: 'varchar', element_type: 'text' },
467
+ {
468
+ attribute_key: 'entity_type',
469
+ db_datatype: 'varchar',
470
+ element_type: 'text',
471
+ },
472
+ { attribute_key: 'code', db_datatype: 'varchar', element_type: 'text' },
414
473
  ];
415
474
 
416
475
  validAttributes.push(...bypassColumn);
@@ -464,6 +523,26 @@ export class EntityDynamicService {
464
523
  row[attr.attribute_key] !== undefined
465
524
  ) {
466
525
  row[attr.attribute_key] = row[attr.attribute_key] == 1 ? true : false;
526
+ } else if (
527
+ attr.element_type == 'upload' &&
528
+ row[attr.attribute_key] !== undefined
529
+ ) {
530
+ // fetch media data
531
+ console.log(
532
+ 'Fetching media for',
533
+ attr.attribute_key,
534
+ row[attr.attribute_key],
535
+ );
536
+
537
+ row[attr.attribute_key] =
538
+ row[attr.attribute_key] != null
539
+ ? await this.mediaDataService.getMediaDownloadUrl(
540
+ Number(row[attr.attribute_key]),
541
+ loggedInUser,
542
+ )
543
+ : null;
544
+
545
+ console.log('Fetched media:', row[attr.attribute_key]);
467
546
  }
468
547
  }
469
548
 
@@ -490,10 +569,12 @@ export class EntityDynamicService {
490
569
  private async getAttributeCodes(
491
570
  entityType: string,
492
571
  organizationId: string,
493
- ): Promise<{ attribute_key: string; db_datatype: string }[]> {
572
+ ): Promise<
573
+ { attribute_key: string; db_datatype: string; element_type: string }[]
574
+ > {
494
575
  const result = await this.dataSource.query(
495
- `SELECT attribute_key, db_datatype
496
- FROM cr_attribute_master
576
+ `SELECT attribute_key, db_datatype, element_type
577
+ FROM cr_attribute_master
497
578
  WHERE mapped_entity_type = ? AND organization_id = ?`,
498
579
  [entityType, organizationId],
499
580
  );
@@ -507,6 +588,7 @@ export class EntityDynamicService {
507
588
  return result.map((row: any) => ({
508
589
  attribute_key: row.attribute_key,
509
590
  db_datatype: row.db_datatype,
591
+ element_type: row.element_type,
510
592
  }));
511
593
  }
512
594
 
@@ -16,7 +16,6 @@ import { Request, Response } from 'express';
16
16
  import { UserSessionService } from '../service/user-session.service';
17
17
  import { ConfigService } from '@nestjs/config';
18
18
  import { IntegrationService } from '../../integration/service/integration.service';
19
- import { UAParser } from 'ua-parser-js';
20
19
 
21
20
  @Controller('auth')
22
21
  export class LoginController {
@@ -86,13 +85,12 @@ export class LoginController {
86
85
  const actualState = state.replace('gmail_config:', '');
87
86
 
88
87
  // Forward to communication service for Gmail config handling using already exchanged tokens
89
- const result =
90
- await this.integrationService.handleGmailTokensCallback(
91
- email,
92
- googleAccessToken,
93
- googleRefreshToken,
94
- actualState,
95
- );
88
+ const result = await this.integrationService.handleGmailTokensCallback(
89
+ email,
90
+ googleAccessToken,
91
+ googleRefreshToken,
92
+ actualState,
93
+ );
96
94
 
97
95
  return res.send(
98
96
  `<html><body><script>
@@ -1,9 +1,9 @@
1
- #DB_HOST: '13.234.25.234'
2
- PROFILE: 'dev'
1
+ DB_HOST: '13.234.25.234'
2
+ # PROFILE: 'dev'
3
3
  DB_HOST: 'localhost'
4
4
  DB_PORT: '3306'
5
5
  DB_USER: 'root'
6
- DB_PASS: 'root'
6
+ DB_PASS: 'Rezolut@123'
7
7
  DB_NAME: 'package_core'
8
8
  MASTER_KEY: '0QZ2eRJv5oVILYnyBlC+FbSGVQiWKReh'
9
9
  MASTER_IV: 'heuUQf5uPVtkotrFAOKUVw=='