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/.env +3 -1
- package/dist/core.module.js +3 -0
- package/dist/core.module.js.map +1 -1
- package/dist/module/meta/controller/entity.controller.js +1 -0
- package/dist/module/meta/controller/entity.controller.js.map +1 -1
- package/dist/module/notification/controller/otp.controller.d.ts +5 -1
- package/dist/module/notification/controller/otp.controller.js +8 -5
- package/dist/module/notification/controller/otp.controller.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/core.module.ts +3 -0
- package/src/module/meta/controller/entity.controller.ts +1 -0
- package/src/module/notification/controller/otp.controller.ts +6 -4
package/package.json
CHANGED
package/src/core.module.ts
CHANGED
|
@@ -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,
|
|
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
|
}
|