From 6fd80d8a412afcb8410f6ee3e5b20909bc83c725 Mon Sep 17 00:00:00 2001 From: aniebietafia Date: Sat, 1 Feb 2025 11:08:59 +0100 Subject: [PATCH] settings: updated nest-cli json to copy ejs files. --- brints-estate-api/nest-cli.json | 12 ++++++++---- brints-estate-api/package.json | 4 ++-- brints-estate-api/src/auth/auth.module.ts | 4 ++-- .../src/auth/http/auth.register.endpoint.http | 4 ++-- .../src/auth/providers/create-user.provider.ts | 8 ++++---- .../{socials => social-auth}/dto/google-token.dto.ts | 0 .../google-authentication.controller.ts | 0 .../providers/google-authentication.service.ts | 0 .../src/users/http/delete-user-profile.endpoint.http | 2 ++ 9 files changed, 20 insertions(+), 14 deletions(-) rename brints-estate-api/src/auth/{socials => social-auth}/dto/google-token.dto.ts (100%) rename brints-estate-api/src/auth/{socials => social-auth}/google-authentication.controller.ts (100%) rename brints-estate-api/src/auth/{socials => social-auth}/providers/google-authentication.service.ts (100%) create mode 100644 brints-estate-api/src/users/http/delete-user-profile.endpoint.http diff --git a/brints-estate-api/nest-cli.json b/brints-estate-api/nest-cli.json index a2d9969..54a0978 100644 --- a/brints-estate-api/nest-cli.json +++ b/brints-estate-api/nest-cli.json @@ -6,10 +6,14 @@ "deleteOutDir": true, "assets": [ { - "include": "./services/email-service/mailgun-service/templates", - "outDir": "dist/", - "watchAssets": true + "include": "./messaging/email/mailgun-service/templates/**/*.ejs", + "outDir": "dist/src/messaging/email/mailgun-service/templates" + }, + { + "include": "./messaging/email/aws-service/templates/**/*.ejs", + "outDir": "dist/src/messaging/email/aws-service/templates" } - ] + ], + "watchAssets": true } } diff --git a/brints-estate-api/package.json b/brints-estate-api/package.json index 38acc01..e211db8 100644 --- a/brints-estate-api/package.json +++ b/brints-estate-api/package.json @@ -6,12 +6,12 @@ "private": true, "license": "MIT", "scripts": { - "build": "nest build && sleep 2 && cp -r src/messaging/email/mailgun-service/templates dist/src/messaging/email/mailgun-service/templates", + "build": "nest build", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "start": "NODE_ENV=production nest start", "start:dev": "NODE_ENV=development nest start --watch", "start:debug": "NODE_ENV=development nest start --debug --watch", - "start:prod": "NODE_ENV=production node dist/main", + "start:prod": "NODE_ENV=production node dist/src/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "jest", "test:verbose": "jest --verbose", diff --git a/brints-estate-api/src/auth/auth.module.ts b/brints-estate-api/src/auth/auth.module.ts index 70b8577..a4bc437 100644 --- a/brints-estate-api/src/auth/auth.module.ts +++ b/brints-estate-api/src/auth/auth.module.ts @@ -28,8 +28,8 @@ import { SendOtpProvider } from 'src/messaging/email/mailgun-service/providers/s import { SendPasswordResetTokenProvider } from 'src/messaging/email/mailgun-service/providers/send-password-reset-token.provider'; import { SendResetPasswordConfirmationProvider } from 'src/messaging/email/mailgun-service/providers/send-reset-password-confirmation.provider'; import { SendPasswordChangedEmailProvider } from 'src/messaging/email/mailgun-service/providers/send-password-changed-email.provider'; -import { GoogleAuthenticationController } from './socials/google-authentication.controller'; -import { GoogleAuthenticationService } from './socials/providers/google-authentication.service'; +import { GoogleAuthenticationController } from './social-auth/google-authentication.controller'; +import { GoogleAuthenticationService } from './social-auth/providers/google-authentication.service'; @Module({ controllers: [AuthController, GoogleAuthenticationController], diff --git a/brints-estate-api/src/auth/http/auth.register.endpoint.http b/brints-estate-api/src/auth/http/auth.register.endpoint.http index a532484..8cfa7ce 100644 --- a/brints-estate-api/src/auth/http/auth.register.endpoint.http +++ b/brints-estate-api/src/auth/http/auth.register.endpoint.http @@ -2,7 +2,7 @@ POST http://localhost:3001/api/auth/register Content-Type: multipart/form-data; boundary=WebKitFormBoundary --WebKitFormBoundary -Content-Disposition: form-data; name="file"; filename="image04.jpg" +Content-Disposition: form-data; name="file"; filename="image01.jpg" Content-Type: image/jpg < ./assets/image01.jpg @@ -17,7 +17,7 @@ afia --WebKitFormBoundary Content-Disposition: form-data; name="email" -aniebietafia@gmail.com +aniebietafia87@gmail.com --WebKitFormBoundary Content-Disposition: form-data; name="password" diff --git a/brints-estate-api/src/auth/providers/create-user.provider.ts b/brints-estate-api/src/auth/providers/create-user.provider.ts index dea67b4..b83e4c7 100644 --- a/brints-estate-api/src/auth/providers/create-user.provider.ts +++ b/brints-estate-api/src/auth/providers/create-user.provider.ts @@ -178,14 +178,14 @@ export class CreateUserProvider { user.user_auth = userAuth; user.login_attempts = loginAttempts; + await this.mailgunService.sendVerificationTokenEmail(user, userAuth); + await this.awsSmsService.sendOTPSms(user, userAuth); + await this.mailgunService.sendOTP(user, userAuth); + await this.userAuthRepository.save(userAuth); await this.loginAttemptsRepository.save(loginAttempts); await this.userRepository.save(user); - await this.awsSmsService.sendOTPSms(user, userAuth); - await this.mailgunService.sendVerificationTokenEmail(user, userAuth); - await this.mailgunService.sendOTP(user, userAuth); - return user; } } diff --git a/brints-estate-api/src/auth/socials/dto/google-token.dto.ts b/brints-estate-api/src/auth/social-auth/dto/google-token.dto.ts similarity index 100% rename from brints-estate-api/src/auth/socials/dto/google-token.dto.ts rename to brints-estate-api/src/auth/social-auth/dto/google-token.dto.ts diff --git a/brints-estate-api/src/auth/socials/google-authentication.controller.ts b/brints-estate-api/src/auth/social-auth/google-authentication.controller.ts similarity index 100% rename from brints-estate-api/src/auth/socials/google-authentication.controller.ts rename to brints-estate-api/src/auth/social-auth/google-authentication.controller.ts diff --git a/brints-estate-api/src/auth/socials/providers/google-authentication.service.ts b/brints-estate-api/src/auth/social-auth/providers/google-authentication.service.ts similarity index 100% rename from brints-estate-api/src/auth/socials/providers/google-authentication.service.ts rename to brints-estate-api/src/auth/social-auth/providers/google-authentication.service.ts diff --git a/brints-estate-api/src/users/http/delete-user-profile.endpoint.http b/brints-estate-api/src/users/http/delete-user-profile.endpoint.http new file mode 100644 index 0000000..f1dc639 --- /dev/null +++ b/brints-estate-api/src/users/http/delete-user-profile.endpoint.http @@ -0,0 +1,2 @@ +DELETE http://localhost:3000/api/user/5f9b3b3b7f3b3b3b3b3b3b3b +Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI3MDI4NGI1YS1jMjc1LTRiNGMtYmZiNC04ZTNhOTU2NjVlYmEiLCJmaXJzdF9uYW1lIjoiQW5pZWJpZXQiLCJsYXN0X25hbWUiOiJBZmlhIiwiZW1haWwiOiJhbmllYmlldGFmaWFAZ21haWwuY29tIiwicGhvbmVfbnVtYmVyIjoiKzIzNDgwNDI3NDU2NDciLCJyb2xlIjoic3VwZXJfYWRtaW4iLCJ2ZXJpZmllZCI6dHJ1ZSwiaWF0IjoxNzI2NzkwMzQwLCJleHAiOjE3MjY3OTM5NDAsImF1ZCI6ImxvY2FsaG9zdDozMDAxIiwiaXNzIjoibG9jYWxob3N0OjMwMDEifQ.Lb-QLpC8xXjxqN00QKTLmYkZnqAfjc0RLR5QtB2XSZw \ No newline at end of file