chore: sms service with configs
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { ConfigService } from "@nestjs/config";
|
||||
|
||||
export function SmsConfigs() {
|
||||
return {
|
||||
inject: [ConfigService],
|
||||
useFactory(configService: ConfigService) {
|
||||
return {
|
||||
URL: configService.getOrThrow<string>("URL"),
|
||||
API_KEY: configService.getOrThrow<string>("API_KEY"),
|
||||
SECRET_KEY: configService.getOrThrow<string>("SECRET_KEY"),
|
||||
SMS_PATTERN_OTP: configService.getOrThrow<string>("SMS_PATTERN_OTP"),
|
||||
SMS_SECRET_BODY: {
|
||||
UserApiKey: configService.getOrThrow<string>("API_KEY"),
|
||||
SecretKey: configService.getOrThrow<string>("SECRET_KEY"),
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export interface ISmsConfigs {
|
||||
URL: string;
|
||||
API_KEY: string;
|
||||
SECRET_KEY: string;
|
||||
SMS_PATTERN_OTP: string;
|
||||
SMS_SECRET_BODY: {
|
||||
UserApiKey: string;
|
||||
SecretKey: string;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user