From 1350bc56d69a1f9cfd38b664d46e307dfa3c2ae0 Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Sun, 8 Oct 2023 15:32:52 +0545 Subject: [PATCH] chores: rearrange keys for config --- src/lib/aws/aws.interface.ts | 14 +++++++------- src/lib/config/config.interface.ts | 16 ++++++++-------- .../fire-base.module.definition.ts | 4 ++-- src/lib/firebase-admin/firebase.service.ts | 6 +++--- src/lib/http.module.ts | 4 ++-- src/lib/mailer/mailer.options.ts | 2 +- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/lib/aws/aws.interface.ts b/src/lib/aws/aws.interface.ts index 36a258e3..7f4dfdc9 100644 --- a/src/lib/aws/aws.interface.ts +++ b/src/lib/aws/aws.interface.ts @@ -1,12 +1,12 @@ import type { ObjectCannedACL } from "@aws-sdk/client-s3"; export interface AwsS3 { - path: string - pathWithFilename: string - filename: string - completedUrl: string baseUrl: string + completedUrl: string + filename: string mime: string + path: string + pathWithFilename: string } export interface AwsS3MultiPart extends AwsS3 { @@ -14,14 +14,14 @@ export interface AwsS3MultiPart extends AwsS3 { } export interface AwsS3PutItemOptions { - path: string acl?: ObjectCannedACL + path: string } export interface AwsModuleOptions { accessKeyId: string + baseUrl: string + bucket: string secretAccessKey: string region: string - bucket: string - baseUrl: string } diff --git a/src/lib/config/config.interface.ts b/src/lib/config/config.interface.ts index 2d522fda..4bc49bd6 100644 --- a/src/lib/config/config.interface.ts +++ b/src/lib/config/config.interface.ts @@ -16,17 +16,17 @@ import type { } from "./configs"; export interface Config { - throttle: ConfigType - redis: ConfigType - database: ConfigType app: ConfigType - rabbitmq: ConfigType - jwt: ConfigType - twilio: ConfigType cloudinary: ConfigType - mail: ConfigType - stripe: ConfigType + database: ConfigType facebookOauth: ConfigType googleOauth: ConfigType + jwt: ConfigType + redis: ConfigType + mail: ConfigType + rabbitmq: ConfigType + stripe: ConfigType sentry: ConfigType + throttle: ConfigType + twilio: ConfigType } diff --git a/src/lib/firebase-admin/fire-base.module.definition.ts b/src/lib/firebase-admin/fire-base.module.definition.ts index f0dab921..b907a382 100644 --- a/src/lib/firebase-admin/fire-base.module.definition.ts +++ b/src/lib/firebase-admin/fire-base.module.definition.ts @@ -1,8 +1,8 @@ import { ConfigurableModuleBuilder } from "@nestjs/common"; export interface FirebaseModuleOptions { - FIREBASE_CREDENTIAL_PATH: string - FIREBASE_DATABASE_URL: string + credentialPath: string + databaseUrl: string } export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } diff --git a/src/lib/firebase-admin/firebase.service.ts b/src/lib/firebase-admin/firebase.service.ts index 28396d71..b0cdeab9 100644 --- a/src/lib/firebase-admin/firebase.service.ts +++ b/src/lib/firebase-admin/firebase.service.ts @@ -14,11 +14,11 @@ export class NestFirebaseService implements NestFirebase { private _firebaseConnection: admin.app.App; constructor( - @Inject(MODULE_OPTIONS_TOKEN) private _NestFirebaseOptions: FirebaseModuleOptions, + @Inject(MODULE_OPTIONS_TOKEN) private _NestFirebaseOptions: FirebaseModuleOptions, ) {} getFirebaseAdmin(): admin.app.App { - const filePath = path.resolve(".", this._NestFirebaseOptions.FIREBASE_CREDENTIAL_PATH); + const filePath = path.resolve(".", this._NestFirebaseOptions.credentialPath); if (!existsSync(filePath)) throw new Error(`Unknown file ${filePath}`); @@ -27,7 +27,7 @@ export class NestFirebaseService implements NestFirebase { try { this._firebaseConnection = admin.initializeApp({ credential: admin.credential.cert(filePath), - databaseURL: this._NestFirebaseOptions.FIREBASE_DATABASE_URL, + databaseURL: this._NestFirebaseOptions.databaseUrl, }); } catch { diff --git a/src/lib/http.module.ts b/src/lib/http.module.ts index 7af525e4..da402744 100644 --- a/src/lib/http.module.ts +++ b/src/lib/http.module.ts @@ -4,14 +4,14 @@ import { Module } from "@nestjs/common"; @Module({ imports: [ HttpModule.register({ - timeout: 5000, + timeout: 9000, maxRedirects: 5, withCredentials: false, headers: { "Accept": "application/json", "Content-Type": "application/json", "user-agent": - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36", + "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36", }, }), ], diff --git a/src/lib/mailer/mailer.options.ts b/src/lib/mailer/mailer.options.ts index e04c792c..0f19bab9 100644 --- a/src/lib/mailer/mailer.options.ts +++ b/src/lib/mailer/mailer.options.ts @@ -8,12 +8,12 @@ export interface MailModuleOptions { password?: string username?: string previewEmail: boolean + retryAttempts?: number server: Server sesKey?: string sesAccessKey?: string sesRegion?: string templateDir: string - retryAttempts?: number templateEngine: | { adapter: TemplateEngine.ETA