Skip to content

Commit

Permalink
chores: rearrange keys for config
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiin committed Oct 8, 2023
1 parent f3fcc28 commit 1350bc5
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
14 changes: 7 additions & 7 deletions src/lib/aws/aws.interface.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
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 {
uploadId: string
}

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
}
16 changes: 8 additions & 8 deletions src/lib/config/config.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ import type {
} from "./configs";

export interface Config {
throttle: ConfigType<typeof throttle>
redis: ConfigType<typeof redis>
database: ConfigType<typeof database>
app: ConfigType<typeof app>
rabbitmq: ConfigType<typeof rabbitmq>
jwt: ConfigType<typeof jwt>
twilio: ConfigType<typeof twilio>
cloudinary: ConfigType<typeof cloudinary>
mail: ConfigType<typeof mail>
stripe: ConfigType<typeof stripe>
database: ConfigType<typeof database>
facebookOauth: ConfigType<typeof facebookOauth>
googleOauth: ConfigType<typeof googleOauth>
jwt: ConfigType<typeof jwt>
redis: ConfigType<typeof redis>
mail: ConfigType<typeof mail>
rabbitmq: ConfigType<typeof rabbitmq>
stripe: ConfigType<typeof stripe>
sentry: ConfigType<typeof sentry>
throttle: ConfigType<typeof throttle>
twilio: ConfigType<typeof twilio>
}
4 changes: 2 additions & 2 deletions src/lib/firebase-admin/fire-base.module.definition.ts
Original file line number Diff line number Diff line change
@@ -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 }
Expand Down
6 changes: 3 additions & 3 deletions src/lib/firebase-admin/firebase.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/http.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
}),
],
Expand Down
2 changes: 1 addition & 1 deletion src/lib/mailer/mailer.options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1350bc5

Please sign in to comment.