rez_core 1.0.11 → 1.0.13

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": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -5,6 +5,7 @@ import { UtilsModule } from './utils/utils.module';
5
5
  import { UserModule } from './module/user/user.module';
6
6
  import { EntityModule } from './module/meta/entity.module';
7
7
  import { ModuleModule } from './module/module/module.module';
8
+ import { NotificationModule } from './module/notification/notification.module';
8
9
 
9
10
  @Global()
10
11
  @Module({})
@@ -24,6 +25,7 @@ export class CoreModule {
24
25
  UtilsModule,
25
26
  UserModule,
26
27
  ModuleModule,
28
+ NotificationModule
27
29
  ],
28
30
  exports: [
29
31
  ConfigModule,
@@ -33,6 +35,7 @@ export class CoreModule {
33
35
  UtilsModule,
34
36
  UserModule,
35
37
  ModuleModule,
38
+ NotificationModule
36
39
  ],
37
40
  };
38
41
  }
@@ -139,6 +139,7 @@ export class EntityController {
139
139
 
140
140
  @HttpCode(HttpStatus.OK)
141
141
  @Post('download-excel/:entity_type')
142
+ @HttpCode(HttpStatus.OK)
142
143
  async downloadExcel(
143
144
  @Param('entity_type') entityType: string,
144
145
  @Query('list_entity_type') listEntityType: string,
@@ -3,14 +3,16 @@ import { OtpService } from '../service/otp.service';
3
3
 
4
4
  @Controller('api/otp')
5
5
  export class OtpController{
6
+ otpExpiry = process.env.otp_expiry || '2';
7
+ otpLength = process.env.otp_length || '6';
6
8
  constructor(private readonly otpService: OtpService) {
7
9
  }
8
10
 
9
11
  @Post('generate')
10
12
  @HttpCode(HttpStatus.OK)
11
- async generateOtp(@Query('identifier') identifier: string) {
12
- let otp = await this.otpService.generate(identifier, "email", 2, 4);
13
- return {'otp_id':otp.otp_id};
13
+ async generateOtp(@Query('identifier') identifier: string, @Query('service') service: string) {
14
+ let otp = await this.otpService.generate(identifier, service, parseInt(this.otpExpiry), parseInt(this.otpLength));
15
+ return {'otp_id':otp.otp_id, 'success': true};
14
16
  }
15
17
 
16
18
  @Post('verify')
@@ -20,6 +22,6 @@ export class OtpController{
20
22
  if (!verify) {
21
23
  throw new BadRequestException('Invalid OTP!');
22
24
  }
23
- return {'message': 'OTP verified successfully!'};
25
+ return {'message': 'OTP verified successfully!', 'success': true};
24
26
  }
25
27
  }