chore: add najva push notif service
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
// export const AUTH_THROTTLE = "AUTH_THROTTLE";
|
||||
export const AI_CONFIG = "AI_CONFIG";
|
||||
export const MIKRO_ORM_QUERY_LOGGER = "MIKRO_ORM_QUERY_LOGGER";
|
||||
export const NAJVA_CONFIG = "NAJVA_CONFIG";
|
||||
export const AUTH_THROTTLE_TTL = 1 * 60 * 1000;
|
||||
export const AUTH_THROTTLE_LIMIT = 5;
|
||||
export const AUTH__REFRESH_THROTTLE_TTL = 10 * 60 * 1000;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { ValueProvider } from "@nestjs/common";
|
||||
import { Logger } from "@nestjs/common";
|
||||
|
||||
import { MIKRO_ORM_QUERY_LOGGER } from "../constants";
|
||||
|
||||
export const mikroOrmQueryLoggerProvider: ValueProvider = {
|
||||
provide: MIKRO_ORM_QUERY_LOGGER, //
|
||||
useValue: new Logger("mikro-orm"),
|
||||
};
|
||||
@@ -1,9 +0,0 @@
|
||||
import { ValueProvider } from "@nestjs/common";
|
||||
import { Logger } from "@nestjs/common";
|
||||
|
||||
export const MIKRO_ORM_QUERY_LOGGER = "MikroOrmQueryLogger";
|
||||
|
||||
export const MikroOrmQueryLogger: ValueProvider = {
|
||||
provide: MIKRO_ORM_QUERY_LOGGER,
|
||||
useValue: new Logger("mikro-orm"),
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
import { FactoryProvider } from "@nestjs/common";
|
||||
import { ConfigService } from "@nestjs/config";
|
||||
|
||||
import { NAJVA_CONFIG } from "../constants";
|
||||
|
||||
export interface NajvaConfigType {
|
||||
apiUrl: string;
|
||||
apiKey: string;
|
||||
websiteId: number;
|
||||
ttl: number;
|
||||
}
|
||||
|
||||
export const najvaConfigProvider: FactoryProvider<NajvaConfigType> = {
|
||||
provide: NAJVA_CONFIG,
|
||||
useFactory: (configService: ConfigService) => {
|
||||
return {
|
||||
apiUrl: configService.getOrThrow("NAJVA_API_URL"),
|
||||
apiKey: configService.getOrThrow("NAJVA_API_KEY"),
|
||||
websiteId: configService.getOrThrow("NAJVA_WEBSITE_ID"),
|
||||
ttl: configService.getOrThrow("PUSH_TTL"),
|
||||
};
|
||||
},
|
||||
inject: [ConfigService],
|
||||
};
|
||||
Reference in New Issue
Block a user