UNPKG

@experts_hub/shared

Version:

Shared DTOs, interfaces, and utilities for experts hub applications

1,434 lines (1,380 loc) 595 kB
var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __decorateClass = (decorators, target, key, kind) => { var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result; if (kind && result) __defProp(target, key, result); return result; }; // src/modules/authentication/pattern/pattern.ts var AUTHENTICATION_PATTERN = { handleValidateToken: "handle.validate.token", handleLogin: "handle.login", handleLoginViaOtp: "handle.login.via.otp", handleRefreshToken: "handle.refresh.token", handleLogout: "handle.logout", handleLogoutAll: "handle.logout.all", fetchSessions: "fetch.sessions", revokeSession: "revoke.session", handleForgotPassword: "handle.forgot.password", handleResetPassword: "handle.reset.password", handleAdminResetPassword: "handle.admin.reset.password", handleValidateResetPasswordToken: "handle.validate.reset.password.token", handleVerifyPermission: "handle.verify.permission", handleValidateEmail: "handle.validate.email", handleValidateEmailForLogin: "handle.validate.email.for.login", handleValidateMobile: "handle.validate.mobile", handleAdminLogin: "handle.admin.login", handleSetPassword: "handle.set.password", signUpWithLinkedIn: "signup.with.linkedin", loginWithLinkedIn: "login.with.linkedin", signUpWithGoogle: "signup.with.google", loginWithGoogle: "login.with.google", validateOnboardingToken: "validate.onboarding.token", loginUsingUuid: "login.using.uuid", handleUserResetPasswordByAdmin: "handle.user.reset.password.by.admin" }; // src/modules/authentication/dto/login.dto.ts import { IsEnum, IsNotEmpty, IsOptional } from "class-validator"; var ScopeEnum = /* @__PURE__ */ ((ScopeEnum5) => { ScopeEnum5["ADMIN"] = "ADMIN"; ScopeEnum5["SUB_ADMIN"] = "SUB_ADMIN"; ScopeEnum5["CLIENT"] = "CLIENT"; ScopeEnum5["FREELANCER"] = "FREELANCER"; return ScopeEnum5; })(ScopeEnum || {}); var LoginDto = class { }; __decorateClass([ IsNotEmpty({ message: "Please enter email." }) ], LoginDto.prototype, "email", 2); __decorateClass([ IsNotEmpty({ message: "Please enter password." }) ], LoginDto.prototype, "password", 2); __decorateClass([ IsEnum(ScopeEnum, { message: `Scope must be one of: ${Object.values(ScopeEnum).join(", ")}` }) ], LoginDto.prototype, "scope", 2); __decorateClass([ IsOptional() ], LoginDto.prototype, "ip", 2); // src/modules/authentication/dto/login-via-otp.dto.ts import { IsEnum as IsEnum2, IsNotEmpty as IsNotEmpty2, IsOptional as IsOptional2 } from "class-validator"; var LoginViaOtpScopeEnum = /* @__PURE__ */ ((LoginViaOtpScopeEnum2) => { LoginViaOtpScopeEnum2["ADMIN"] = "ADMIN"; LoginViaOtpScopeEnum2["SUB_ADMIN"] = "SUB_ADMIN"; LoginViaOtpScopeEnum2["CLIENT"] = "CLIENT"; LoginViaOtpScopeEnum2["FREELANCER"] = "FREELANCER"; return LoginViaOtpScopeEnum2; })(LoginViaOtpScopeEnum || {}); var LoginViaOtpDto = class { }; __decorateClass([ IsNotEmpty2({ message: "Please enter email." }) ], LoginViaOtpDto.prototype, "email", 2); __decorateClass([ IsNotEmpty2({ message: "Please enter otp." }) ], LoginViaOtpDto.prototype, "otp", 2); __decorateClass([ IsEnum2(LoginViaOtpScopeEnum, { message: `Scope must be one of: ${Object.values(LoginViaOtpScopeEnum).join(", ")}` }) ], LoginViaOtpDto.prototype, "scope", 2); __decorateClass([ IsOptional2() ], LoginViaOtpDto.prototype, "ip", 2); // src/modules/authentication/dto/refresh.dto.ts import { IsNotEmpty as IsNotEmpty3 } from "class-validator"; var RefreshDto = class { }; __decorateClass([ IsNotEmpty3({ message: "Please provide refresh token." }) ], RefreshDto.prototype, "refreshToken", 2); // src/modules/authentication/dto/logout.dto.ts import { IsNotEmpty as IsNotEmpty4 } from "class-validator"; var LogoutDto = class { }; __decorateClass([ IsNotEmpty4({ message: "Please provide refresh token." }) ], LogoutDto.prototype, "refreshToken", 2); // src/modules/authentication/dto/forgot-password.dto.ts import { IsEmail, IsEnum as IsEnum3, IsNotEmpty as IsNotEmpty5 } from "class-validator"; var ScopeEnum2 = /* @__PURE__ */ ((ScopeEnum5) => { ScopeEnum5["ADMIN"] = "ADMIN"; ScopeEnum5["CLIENT"] = "CLIENT"; ScopeEnum5["FREELANCER"] = "FREELANCER"; return ScopeEnum5; })(ScopeEnum2 || {}); var ForgotPasswordDto = class { }; __decorateClass([ IsNotEmpty5({ message: "Please enter email." }), IsEmail({}, { message: "Please enter a valid email." }) ], ForgotPasswordDto.prototype, "email", 2); __decorateClass([ IsEnum3(ScopeEnum2, { message: `Scope must be one of: ${Object.values(ScopeEnum2).join(", ")}` }) ], ForgotPasswordDto.prototype, "scope", 2); // src/modules/authentication/dto/reset-password.dto.ts import { IsEnum as IsEnum4, IsNotEmpty as IsNotEmpty6, Matches, MaxLength, MinLength } from "class-validator"; var ScopeEnum3 = /* @__PURE__ */ ((ScopeEnum5) => { ScopeEnum5["ADMIN"] = "ADMIN"; ScopeEnum5["CLIENT"] = "CLIENT"; ScopeEnum5["FREELANCER"] = "FREELANCER"; return ScopeEnum5; })(ScopeEnum3 || {}); var ResetPasswordDto = class { }; __decorateClass([ IsNotEmpty6({ message: "Please enter token." }) ], ResetPasswordDto.prototype, "token", 2); __decorateClass([ IsNotEmpty6({ message: "Please enter password." }), MinLength(6), MaxLength(32), Matches(/^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*?&])/, { message: "Password must include letters, numbers and symbols." }) ], ResetPasswordDto.prototype, "password", 2); __decorateClass([ IsEnum4(ScopeEnum3, { message: `Scope must be one of: ${Object.values(ScopeEnum3).join(", ")}` }) ], ResetPasswordDto.prototype, "scope", 2); // src/modules/authentication/dto/set-password.dto.ts import { IsNotEmpty as IsNotEmpty7, Matches as Matches2, MaxLength as MaxLength2, MinLength as MinLength2 } from "class-validator"; var SetPasswordDto = class { }; __decorateClass([ IsNotEmpty7({ message: "Please enter token." }) ], SetPasswordDto.prototype, "token", 2); __decorateClass([ IsNotEmpty7({ message: "Please enter password." }), MinLength2(6), MaxLength2(32), Matches2(/^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*?&])/, { message: "Password must include letters, numbers and symbols." }) ], SetPasswordDto.prototype, "password", 2); // src/modules/authentication/dto/reset-password-token-validation.dto.ts import { IsEnum as IsEnum6, IsNotEmpty as IsNotEmpty8 } from "class-validator"; var ScopeEnum4 = /* @__PURE__ */ ((ScopeEnum5) => { ScopeEnum5["ADMIN"] = "ADMIN"; ScopeEnum5["CLIENT"] = "CLIENT"; ScopeEnum5["FREELANCER"] = "FREELANCER"; return ScopeEnum5; })(ScopeEnum4 || {}); var ResetPasswordTokenValidationDto = class { }; __decorateClass([ IsNotEmpty8({ message: "Please enter token." }) ], ResetPasswordTokenValidationDto.prototype, "token", 2); __decorateClass([ IsEnum6(ScopeEnum4, { message: `Scope must be one of: ${Object.values(ScopeEnum4).join(", ")}` }) ], ResetPasswordTokenValidationDto.prototype, "scope", 2); // src/modules/authentication/dto/validate-email.dto.ts import { IsNotEmpty as IsNotEmpty9, IsEmail as IsEmail2, IsOptional as IsOptional3, IsEnum as IsEnum7 } from "class-validator"; var ScopeEmailEnumDto = /* @__PURE__ */ ((ScopeEmailEnumDto2) => { ScopeEmailEnumDto2["ADMIN"] = "ADMIN"; ScopeEmailEnumDto2["SUB_ADMIN"] = "SUB_ADMIN"; ScopeEmailEnumDto2["CLIENT"] = "CLIENT"; ScopeEmailEnumDto2["FREELANCER"] = "FREELANCER"; return ScopeEmailEnumDto2; })(ScopeEmailEnumDto || {}); var ValidateEmailDto = class { }; __decorateClass([ IsNotEmpty9({ message: "Email is required" }), IsEmail2({}, { message: "Email must be valid" }) ], ValidateEmailDto.prototype, "email", 2); __decorateClass([ IsOptional3(), IsEnum7(ScopeEmailEnumDto, { message: `Scope must be one of: ${Object.values(ScopeEmailEnumDto).join(", ")}` }) ], ValidateEmailDto.prototype, "scope", 2); // src/modules/authentication/dto/validate-email-for-login.dto.ts import { IsNotEmpty as IsNotEmpty10, IsEmail as IsEmail3, IsEnum as IsEnum8 } from "class-validator"; var ScopeEmailForLoginEnumDto = /* @__PURE__ */ ((ScopeEmailForLoginEnumDto2) => { ScopeEmailForLoginEnumDto2["ADMIN"] = "ADMIN"; ScopeEmailForLoginEnumDto2["SUB_ADMIN"] = "SUB_ADMIN"; ScopeEmailForLoginEnumDto2["CLIENT"] = "CLIENT"; ScopeEmailForLoginEnumDto2["FREELANCER"] = "FREELANCER"; return ScopeEmailForLoginEnumDto2; })(ScopeEmailForLoginEnumDto || {}); var ValidateEmailForLoginDto = class { }; __decorateClass([ IsNotEmpty10({ message: "Email is required" }), IsEmail3({}, { message: "Email must be valid" }) ], ValidateEmailForLoginDto.prototype, "email", 2); __decorateClass([ IsNotEmpty10({ message: "Scope is required" }), IsEnum8(ScopeEmailForLoginEnumDto, { message: `Scope must be one of: ${Object.values(ScopeEmailForLoginEnumDto).join(", ")}` }) ], ValidateEmailForLoginDto.prototype, "scope", 2); // src/modules/authentication/dto/validate-mobile.dto.ts import { IsNotEmpty as IsNotEmpty11, IsString } from "class-validator"; var ValidateMobileDto = class { }; __decorateClass([ IsNotEmpty11({ message: "Mobile code is required" }), IsString({ message: "Mobile code must be a string" }) ], ValidateMobileDto.prototype, "mobileCode", 2); __decorateClass([ IsNotEmpty11({ message: "Mobile number is required" }), IsString({ message: "Mobile number must be a string" }) ], ValidateMobileDto.prototype, "mobile", 2); // src/modules/authentication/dto/social-auth.dto.ts import { IsOptional as IsOptional4, IsString as IsString2, IsObject } from "class-validator"; var SocialAuthDto = class { }; __decorateClass([ IsOptional4(), IsString2() ], SocialAuthDto.prototype, "accessToken", 2); __decorateClass([ IsOptional4(), IsString2() ], SocialAuthDto.prototype, "refreshToken", 2); __decorateClass([ IsOptional4(), IsObject() ], SocialAuthDto.prototype, "profile", 2); __decorateClass([ IsOptional4(), IsString2() ], SocialAuthDto.prototype, "provider", 2); __decorateClass([ IsOptional4(), IsString2() ], SocialAuthDto.prototype, "providerId", 2); // src/modules/authentication/dto/login-using-uuid.dto.ts import { IsNotEmpty as IsNotEmpty12, IsString as IsString3 } from "class-validator"; var LoginUsingUuidDTO = class { }; __decorateClass([ IsNotEmpty12({ message: "Uuid is required" }), IsString3({ message: "uuid must be a string." }) ], LoginUsingUuidDTO.prototype, "uuid", 2); // src/modules/authentication/dto/reset-password-by-admin.dto.ts import { IsNotEmpty as IsNotEmpty13, IsString as IsString4, IsUUID, MinLength as MinLength3 } from "class-validator"; var ResetUserPasswordByAdminDto = class { }; __decorateClass([ IsNotEmpty13({ message: "User UUID is required." }), IsUUID("4", { message: "User UUID must be a valid UUID." }) ], ResetUserPasswordByAdminDto.prototype, "uuid", 2); __decorateClass([ IsNotEmpty13({ message: "Password is required." }), IsString4({ message: "Password must be a string." }), MinLength3(6, { message: "Password must be at least 6 characters long." }) ], ResetUserPasswordByAdminDto.prototype, "password", 2); // src/modules/otp/pattern/pattern.ts var OTP_PATTERN = { handleSendGuestOtp: "handle.send.guest.otp", handleSendOtp: "handle.send.otp", handleSendOtpForLogin: "handle.send.otp.for.login", handleVerifyGuestOtp: "handle.verify.guest.otp", handleVerifyOtp: "handle.verify.otp" }; // src/modules/otp/dto/send-guest-otp.dto.ts import { IsEnum as IsEnum9, IsNotEmpty as IsNotEmpty14, IsOptional as IsOptional5, IsString as IsString5 } from "class-validator"; var SendGuestOtpPurposeEnum = /* @__PURE__ */ ((SendGuestOtpPurposeEnum2) => { SendGuestOtpPurposeEnum2["SIGN_UP"] = "SIGN_UP"; SendGuestOtpPurposeEnum2["LOGIN"] = "LOGIN"; return SendGuestOtpPurposeEnum2; })(SendGuestOtpPurposeEnum || {}); var SendGuestOtpScopeEnum = /* @__PURE__ */ ((SendGuestOtpScopeEnum2) => { SendGuestOtpScopeEnum2["CLIENT"] = "CLIENT"; SendGuestOtpScopeEnum2["FREELANCER"] = "FREELANCER"; return SendGuestOtpScopeEnum2; })(SendGuestOtpScopeEnum || {}); var SendGuestOtpDto = class { }; __decorateClass([ IsNotEmpty14({ message: "Please enter full name." }), IsString5({ message: "Please enter valid full name." }) ], SendGuestOtpDto.prototype, "fullName", 2); __decorateClass([ IsNotEmpty14({ message: "Please enter target." }), IsString5({ message: "Please enter valid target." }) ], SendGuestOtpDto.prototype, "target", 2); __decorateClass([ IsOptional5(), IsString5({ message: "Please enter valid fallback target." }) ], SendGuestOtpDto.prototype, "fallbackTarget", 2); __decorateClass([ IsNotEmpty14({ message: "Please enter OTP purpose." }), IsEnum9(SendGuestOtpPurposeEnum, { message: "Purpose must be a valid OTP purpose" }) ], SendGuestOtpDto.prototype, "purpose", 2); __decorateClass([ IsNotEmpty14({ message: "Please enter scope." }), IsEnum9(SendGuestOtpScopeEnum, { message: "scope must be a valid" }) ], SendGuestOtpDto.prototype, "scope", 2); // src/modules/otp/dto/send-login-otp.dto.ts import { IsEnum as IsEnum10, IsNotEmpty as IsNotEmpty15, IsString as IsString6 } from "class-validator"; var SendLoginOtpPurposeEnum = /* @__PURE__ */ ((SendLoginOtpPurposeEnum2) => { SendLoginOtpPurposeEnum2["LOGIN"] = "LOGIN"; return SendLoginOtpPurposeEnum2; })(SendLoginOtpPurposeEnum || {}); var SendLoginOtpScopeEnum = /* @__PURE__ */ ((SendLoginOtpScopeEnum2) => { SendLoginOtpScopeEnum2["CLIENT"] = "CLIENT"; SendLoginOtpScopeEnum2["FREELANCER"] = "FREELANCER"; return SendLoginOtpScopeEnum2; })(SendLoginOtpScopeEnum || {}); var SendLoginOtpDto = class { }; __decorateClass([ IsNotEmpty15({ message: "Please enter target." }), IsString6({ message: "Please enter valid target." }) ], SendLoginOtpDto.prototype, "target", 2); __decorateClass([ IsNotEmpty15({ message: "Please enter OTP purpose." }), IsEnum10(SendLoginOtpPurposeEnum, { message: "Purpose must be a valid OTP purpose" }) ], SendLoginOtpDto.prototype, "purpose", 2); __decorateClass([ IsNotEmpty15({ message: "Please enter scope." }), IsEnum10(SendLoginOtpScopeEnum, { message: "scope must be a valid" }) ], SendLoginOtpDto.prototype, "scope", 2); // src/modules/otp/dto/verify-guest-otp.dto.ts import { IsEnum as IsEnum11, IsNotEmpty as IsNotEmpty16, IsString as IsString7, Length } from "class-validator"; var VerifyGuestOtpPurposeEnum = /* @__PURE__ */ ((VerifyGuestOtpPurposeEnum2) => { VerifyGuestOtpPurposeEnum2["SIGN_UP"] = "SIGN_UP"; VerifyGuestOtpPurposeEnum2["LOGIN"] = "LOGIN"; return VerifyGuestOtpPurposeEnum2; })(VerifyGuestOtpPurposeEnum || {}); var VerifyGuestOtpDto = class { }; __decorateClass([ IsNotEmpty16({ message: "Please enter target." }), IsString7({ message: "Please enter valid target." }) ], VerifyGuestOtpDto.prototype, "target", 2); __decorateClass([ IsNotEmpty16({ message: "Please enter otp." }), IsString7({ message: "Please enter valid otp." }), Length(4, 6, { message: "OTP must be between 4 and 6 characters" }) ], VerifyGuestOtpDto.prototype, "otp", 2); __decorateClass([ IsNotEmpty16({ message: "Please enter OTP purpose." }), IsEnum11(VerifyGuestOtpPurposeEnum, { message: "Purpose must be a valid OTP purpose" }) ], VerifyGuestOtpDto.prototype, "purpose", 2); // src/modules/otp/dto/send-otp.dto.ts import { IsNotEmpty as IsNotEmpty17, IsString as IsString8, IsOptional as IsOptional7, IsUUID as IsUUID2 } from "class-validator"; var SendOtpDto = class { }; __decorateClass([ IsUUID2("4", { message: "User ID must be a valid UUID." }), IsNotEmpty17({ message: "User ID is required." }) ], SendOtpDto.prototype, "userId", 2); __decorateClass([ IsOptional7(), IsString8({ message: "Purpose must be a string." }) ], SendOtpDto.prototype, "purpose", 2); // src/modules/otp/dto/verify-otp.dto.ts import { IsNotEmpty as IsNotEmpty18, IsString as IsString9, IsOptional as IsOptional8, IsUUID as IsUUID3 } from "class-validator"; var VerifyOtpDto = class { }; __decorateClass([ IsUUID3("4", { message: "User ID must be a valid UUID." }), IsNotEmpty18({ message: "User ID is required." }) ], VerifyOtpDto.prototype, "userId", 2); __decorateClass([ IsNotEmpty18({ message: "OTP code is required." }), IsString9({ message: "OTP code must be a string." }) ], VerifyOtpDto.prototype, "otp", 2); __decorateClass([ IsOptional8(), IsString9({ message: "Purpose must be a string." }) ], VerifyOtpDto.prototype, "purpose", 2); // src/modules/onboarding/pattern/pattern.ts var ONBOARDING_PATTERN = { handleFreelancerAccountCreation: "handle.freelancer.account.creation", handleFreelancerResumeUpload: "handle.freelancer.resume.upload", handleFreelancerDeveloperPreference: "handle.freelancer.developer.preference", handleFreelancerProfileQuestion: "handle.freelancer.profile.question", handleFreelancerWorkShowcase: "handle.freelancer.work.showcase", verifyOnboardingToken: "verify.onboarding.token", handleClientAccountCreation: "handle.client.account.creation", handleClientProfileQuestion: "handle.client.profile.question", changeFreelancerPassword: "change.freelancer.password", handleFetchClientProfileQuestion: "handle.fetch.client.profile.question", verifyClientOnboardingToken: "verify.client.onboarding.token", handleFetchFreelancerResume: "handle.fetch.freelancer.resume", handleFreelancerResumeParsing: "handle.freelancer.resume.parsing", initiateFreelancerMcqAssessment: "initiate.freelancer.mcq.assessment", handleFetchAiAssessmentLink: "handle.fetch.ai.assessment.link", skipFreelancerAiAssessment: "skip.freelancer.ai.assessment", initiateFreelancerAiAssessment: "initiate.freelancer.ai.assessment", captureAiAssessmentStatus: "capture.ai.assessment.status", handleFetchFreelancerProfileQuestion: "handle.fetch.freelancer.profile.question", handleFetchFreelancerDetails: "handle.fetch.freelancer.details" }; // src/modules/onboarding/dto/freelancer-create-account.dto.ts import { IsNotEmpty as IsNotEmpty19, IsEmail as IsEmail4, Matches as Matches3, IsString as IsString10, IsOptional as IsOptional9 } from "class-validator"; // src/decorators/match.decorator.ts import { registerDecorator, ValidatorConstraint } from "class-validator"; function Match(property, validationOptions) { return function(object, propertyName) { registerDecorator({ name: "Match", target: object.constructor, propertyName, options: validationOptions, constraints: [property], validator: { validate(value, args) { const [relatedPropertyName] = args.constraints; const relatedValue = args.object[relatedPropertyName]; return value === relatedValue; }, defaultMessage(args) { const [relatedPropertyName] = args.constraints; return `${propertyName} must match ${relatedPropertyName}`; } } }); }; } var IfscOrOtherFieldsConstraint = class { validate(value, args) { const [relatedFields] = args.constraints; const dto = args.object; if (!value) { return relatedFields.some((field) => !!dto[field]); } return true; } defaultMessage(args) { const [relatedFields] = args.constraints; const fieldNames = relatedFields.join(", "); return `IFSC Code is required .`; } }; IfscOrOtherFieldsConstraint = __decorateClass([ ValidatorConstraint({ async: false }) ], IfscOrOtherFieldsConstraint); // src/decorators/is-valid-mobile-number.decorator.ts import { ValidatorConstraint as ValidatorConstraint2, registerDecorator as registerDecorator2 } from "class-validator"; import { parsePhoneNumberFromString } from "libphonenumber-js"; var IsValidMobileNumberConstraint = class { validate(mobile, args) { const object = args.object; const mobileCode = object.mobileCode; if (!mobileCode || !mobile) return false; try { const phoneNumber = parsePhoneNumberFromString(mobileCode + mobile); return phoneNumber?.isValid() ?? false; } catch { return false; } } defaultMessage(args) { return "Please enter a valid mobile number for the selected country code."; } }; IsValidMobileNumberConstraint = __decorateClass([ ValidatorConstraint2({ name: "isValidMobileNumber", async: false }) ], IsValidMobileNumberConstraint); function IsValidMobileNumber(validationOptions) { return function(object, propertyName) { registerDecorator2({ name: "isValidMobileNumber", target: object.constructor, propertyName, options: validationOptions, validator: IsValidMobileNumberConstraint }); }; } // src/decorators/is-business-email.decorator.ts import { registerDecorator as registerDecorator3, ValidatorConstraint as ValidatorConstraint3 } from "class-validator"; var IsBusinessEmailConstraint = class { constructor() { this.blockedDomains = [ "aol.com", "att.net", "comcast.net", "facebook.com", "gmail.com", "gmx.com", "gmx.net", "gmx.de", "googlemail.com", "google.com", "hotmail.com", "hotmail.co.uk", "icloud.com", "live.com", "live.in", "live.co.uk", "mail.com", "msn.com", "outlook.com", "protonmail.com", "protonmail.ch", "proton.me", "tutanota.com", "tutanota.de", "tutanota.org", "tuta.io", "yahoo.com", "yahoo.co.uk", "yahoo.co.in", "yahoo.co.jp", "yahoo.co.kr", "yahoo.co.id", "yahoo.com.sg", "yahoo.com.ph", "zoho.com", "yandex.com", "mail.ru", "fastmail.fm", "hushmail.com", "qq.com", "163.com", "126.com", "rediffmail.com", "naver.com", "daum.net", "seznam.cz", "web.de", "libero.it", "mailfence.com", "yopmail.com" ]; } validate(value) { if (typeof value !== "string") return false; const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; if (!emailRegex.test(value)) return false; const domain = value.split("@")[1].toLowerCase(); return !this.blockedDomains.includes(domain); } defaultMessage(args) { return "Please enter a valid business email address. Personal email domains are not allowed."; } }; IsBusinessEmailConstraint = __decorateClass([ ValidatorConstraint3({ async: false }) ], IsBusinessEmailConstraint); function IsBusinessEmail(validationOptions) { return function(object, propertyName) { registerDecorator3({ target: object.constructor, propertyName, options: validationOptions, constraints: [], validator: IsBusinessEmailConstraint }); }; } // src/modules/onboarding/dto/freelancer-create-account.dto.ts var FreelancerCreateAccountDto = class { }; __decorateClass([ IsNotEmpty19({ message: "Please enter full name." }), IsString10({ message: "Please enter valid full name." }) ], FreelancerCreateAccountDto.prototype, "fullName", 2); __decorateClass([ IsNotEmpty19({ message: "Please enter email." }), IsEmail4() ], FreelancerCreateAccountDto.prototype, "email", 2); __decorateClass([ IsNotEmpty19({ message: "Please enter mobile code." }), Matches3(/^\+\d{1,4}$/, { message: "Please enter a valid country mobile code (e.g., +91, +1, +44)." }) ], FreelancerCreateAccountDto.prototype, "mobileCode", 2); __decorateClass([ IsNotEmpty19({ message: "Please enter mobile number." }), IsValidMobileNumber({ message: "Mobile number is not valid for the selected country code." }) ], FreelancerCreateAccountDto.prototype, "mobile", 2); __decorateClass([ IsNotEmpty19({ message: "Please enter country iso code." }) ], FreelancerCreateAccountDto.prototype, "countryISOCode", 2); __decorateClass([ IsOptional9() ], FreelancerCreateAccountDto.prototype, "onBoardedBy", 2); __decorateClass([ IsOptional9() ], FreelancerCreateAccountDto.prototype, "ip", 2); __decorateClass([ IsOptional9() ], FreelancerCreateAccountDto.prototype, "referralCode", 2); // src/modules/onboarding/dto/freelancer-upload-resume.dto.ts import { IsUUID as IsUUID4, IsNotEmpty as IsNotEmpty20 } from "class-validator"; var FreelancerUploadResumeDto = class { }; __decorateClass([ IsNotEmpty20({ message: "Please enter uuid." }), IsUUID4() ], FreelancerUploadResumeDto.prototype, "uuid", 2); // src/modules/onboarding/dto/freelancer-parse-resume.dto.ts import { IsUUID as IsUUID5, IsNotEmpty as IsNotEmpty21 } from "class-validator"; var FreelancerParseResumeDto = class { }; __decorateClass([ IsNotEmpty21({ message: "Please enter uuid." }), IsUUID5() ], FreelancerParseResumeDto.prototype, "uuid", 2); // src/modules/onboarding/dto/freelancer-initiate-mcq-assessment.dto.ts import { IsUUID as IsUUID6, IsNotEmpty as IsNotEmpty22 } from "class-validator"; var FreelancerInitiateMcqAssessmentDto = class { }; __decorateClass([ IsNotEmpty22({ message: "Please enter uuid." }), IsUUID6() ], FreelancerInitiateMcqAssessmentDto.prototype, "uuid", 2); // src/modules/onboarding/dto/freelancer-skip-ai-assessment.dto.ts import { IsUUID as IsUUID7, IsNotEmpty as IsNotEmpty23 } from "class-validator"; var FreelancerSkipAiAssessmentDto = class { }; __decorateClass([ IsNotEmpty23({ message: "Please enter uuid." }), IsUUID7() ], FreelancerSkipAiAssessmentDto.prototype, "uuid", 2); // src/modules/onboarding/dto/freelancer-initiate-ai-assessment.dto.ts import { IsUUID as IsUUID8, IsNotEmpty as IsNotEmpty24 } from "class-validator"; var FreelancerInitiateAiAssessmentDto = class { }; __decorateClass([ IsNotEmpty24({ message: "Please enter uuid." }), IsUUID8() ], FreelancerInitiateAiAssessmentDto.prototype, "uuid", 2); // src/modules/onboarding/dto/freelancer-capture-ai-assessment-status.dto.ts import { IsUUID as IsUUID9, IsNotEmpty as IsNotEmpty25, IsOptional as IsOptional10 } from "class-validator"; var FreelancerCaptureAiAssessmentStatusDto = class { }; __decorateClass([ IsNotEmpty25({ message: "Please enter uuid." }), IsUUID9() ], FreelancerCaptureAiAssessmentStatusDto.prototype, "uuid", 2); __decorateClass([ IsNotEmpty25({ message: "Please enter assessment id." }) ], FreelancerCaptureAiAssessmentStatusDto.prototype, "assessmentId", 2); __decorateClass([ IsNotEmpty25({ message: "Please enter assessment status." }) ], FreelancerCaptureAiAssessmentStatusDto.prototype, "assessmentStatus", 2); __decorateClass([ IsOptional10() ], FreelancerCaptureAiAssessmentStatusDto.prototype, "iframeEventData", 2); // src/modules/onboarding/dto/freelancer-development-preference.dto.ts import { IsUUID as IsUUID10, IsNotEmpty as IsNotEmpty26, IsBoolean } from "class-validator"; var FreelancerDevelopmentPreferenceDto = class { }; __decorateClass([ IsNotEmpty26({ message: "Please enter uuid." }), IsUUID10() ], FreelancerDevelopmentPreferenceDto.prototype, "uuid", 2); __decorateClass([ IsNotEmpty26({ message: "Please select development flag." }), IsBoolean() ], FreelancerDevelopmentPreferenceDto.prototype, "developer", 2); // src/modules/onboarding/dto/freelancer-profile-question.dto.ts import { IsUUID as IsUUID11, IsString as IsString11, IsNotEmpty as IsNotEmpty27, IsOptional as IsOptional11, IsUrl, IsEnum as IsEnum12 } from "class-validator"; var ModeOfWorkEnum = /* @__PURE__ */ ((ModeOfWorkEnum4) => { ModeOfWorkEnum4["ONSITE"] = "ONSITE"; ModeOfWorkEnum4["REMOTE"] = "REMOTE"; ModeOfWorkEnum4["HYBRID"] = "HYBRID"; ModeOfWorkEnum4["BOTH"] = "BOTH"; return ModeOfWorkEnum4; })(ModeOfWorkEnum || {}); var NatureOfWorkEnum = /* @__PURE__ */ ((NatureOfWorkEnum4) => { NatureOfWorkEnum4["FREELANCE"] = "FREELANCE"; return NatureOfWorkEnum4; })(NatureOfWorkEnum || {}); var FreelancerProfileQuestionDto = class { }; __decorateClass([ IsNotEmpty27({ message: "Please enter uuid." }), IsUUID11() ], FreelancerProfileQuestionDto.prototype, "uuid", 2); __decorateClass([ IsNotEmpty27({ message: "Please enter mode of work." }), IsEnum12(ModeOfWorkEnum, { message: `Mode of work must be one of: ${Object.values(ModeOfWorkEnum).join( ", " )}` }) ], FreelancerProfileQuestionDto.prototype, "modeOfWork", 2); __decorateClass([ IsNotEmpty27({ message: "Please enter nature of work." }), IsEnum12(NatureOfWorkEnum, { message: `Nature of work must be one of: ${Object.values(NatureOfWorkEnum).join( ", " )}` }) ], FreelancerProfileQuestionDto.prototype, "natureOfWork", 2); __decorateClass([ IsNotEmpty27({ message: "Please enter number of hours." }) ], FreelancerProfileQuestionDto.prototype, "numberOfHours", 2); __decorateClass([ IsNotEmpty27({ message: "Please enter is immediate joiner." }) ], FreelancerProfileQuestionDto.prototype, "isImmediateJoiner", 2); __decorateClass([ IsOptional11() ], FreelancerProfileQuestionDto.prototype, "availabilityToJoin", 2); __decorateClass([ IsNotEmpty27({ message: "Please enter currency." }) ], FreelancerProfileQuestionDto.prototype, "currency", 2); __decorateClass([ IsNotEmpty27({ message: "Please enter expected hourly compensation." }) ], FreelancerProfileQuestionDto.prototype, "expectedHourlyCompensation", 2); __decorateClass([ IsNotEmpty27({ message: "Please enter likedin profile url." }), IsString11(), IsUrl( { require_protocol: false }, { message: "linkedinProfileLink must be a valid URL with protocol (e.g. https://)" } ) ], FreelancerProfileQuestionDto.prototype, "linkedinProfileLink", 2); __decorateClass([ IsOptional11(), IsUrl( { require_protocol: false }, { message: "kaggleProfileLink must be a valid URL with protocol (e.g. https://)" } ) ], FreelancerProfileQuestionDto.prototype, "kaggleProfileLink", 2); __decorateClass([ IsOptional11(), IsUrl( { require_protocol: false }, { message: "githubProfileLink must be a valid URL with protocol (e.g. https://)" } ) ], FreelancerProfileQuestionDto.prototype, "githubProfileLink", 2); __decorateClass([ IsOptional11(), IsUrl( { require_protocol: false }, { message: "stackOverflowProfileLink must be a valid URL with protocol (e.g. https://)" } ) ], FreelancerProfileQuestionDto.prototype, "stackOverflowProfileLink", 2); __decorateClass([ IsOptional11(), IsUrl( { require_protocol: false }, { message: "portfolioLink must be a valid URL with protocol (e.g. https://)" } ) ], FreelancerProfileQuestionDto.prototype, "portfolioLink", 2); // src/modules/onboarding/dto/freelancer-work-showcase.dto.ts import { IsNotEmpty as IsNotEmpty28, IsOptional as IsOptional12, IsUrl as IsUrl2, IsString as IsString12, IsUUID as IsUUID12 } from "class-validator"; var FreelancerWorkShowcaseDto = class { }; __decorateClass([ IsNotEmpty28({ message: "Please enter uuid." }), IsUUID12() ], FreelancerWorkShowcaseDto.prototype, "uuid", 2); __decorateClass([ IsNotEmpty28({ message: "Please enter likedin profile url." }), IsString12(), IsUrl2( { require_protocol: false }, { message: "linkedinProfileLink must be a valid URL with protocol (e.g. https://)" } ) ], FreelancerWorkShowcaseDto.prototype, "linkedinProfileLink", 2); __decorateClass([ IsOptional12(), IsUrl2( { require_protocol: false }, { message: "kaggleProfileLink must be a valid URL with protocol (e.g. https://)" } ) ], FreelancerWorkShowcaseDto.prototype, "kaggleProfileLink", 2); __decorateClass([ IsOptional12(), IsUrl2( { require_protocol: false }, { message: "githubProfileLink must be a valid URL with protocol (e.g. https://)" } ) ], FreelancerWorkShowcaseDto.prototype, "githubProfileLink", 2); __decorateClass([ IsOptional12(), IsUrl2( { require_protocol: false }, { message: "stackOverflowProfileLink must be a valid URL with protocol (e.g. https://)" } ) ], FreelancerWorkShowcaseDto.prototype, "stackOverflowProfileLink", 2); __decorateClass([ IsOptional12(), IsUrl2( { require_protocol: false }, { message: "portfolioLink must be a valid URL with protocol (e.g. https://)" } ) ], FreelancerWorkShowcaseDto.prototype, "portfolioLink", 2); // src/modules/onboarding/dto/client-profile-question.dto.ts import { IsUUID as IsUUID13, IsString as IsString13, IsNotEmpty as IsNotEmpty29, IsIn, ValidateIf, IsOptional as IsOptional13 } from "class-validator"; var ClientProfileQuestionDto = class { }; __decorateClass([ IsNotEmpty29({ message: "Please enter uuid." }), IsUUID13() ], ClientProfileQuestionDto.prototype, "uuid", 2); __decorateClass([ IsNotEmpty29({ message: "Please enter question slug." }), IsString13(), IsIn([ "skills", "requiredFreelancer", "kindOfHiring", "modeOfHire", "foundUsOn" ]) ], ClientProfileQuestionDto.prototype, "question_slug", 2); __decorateClass([ IsNotEmpty29({ message: "Please enter answer." }) ], ClientProfileQuestionDto.prototype, "answer", 2); __decorateClass([ IsOptional13() ], ClientProfileQuestionDto.prototype, "numberOfHours", 2); __decorateClass([ ValidateIf((o) => o.questionSlug === "foundUsOn" && o.answer === "OTHER"), IsNotEmpty29({ message: "Please enter foundUsOnDetail if answer is OTHER." }), IsString13() ], ClientProfileQuestionDto.prototype, "foundUsOnDetail", 2); // src/modules/onboarding/dto/client-create-account.dto.ts import { IsNotEmpty as IsNotEmpty30, IsEmail as IsEmail5, IsString as IsString14, IsOptional as IsOptional14 } from "class-validator"; var ClientCreateAccountDto = class { }; __decorateClass([ IsNotEmpty30({ message: "Please enter full name." }), IsString14({ message: "Please enter valid full name." }) ], ClientCreateAccountDto.prototype, "fullName", 2); __decorateClass([ IsNotEmpty30({ message: "Please enter email." }), IsEmail5(), IsBusinessEmail() ], ClientCreateAccountDto.prototype, "email", 2); __decorateClass([ IsNotEmpty30({ message: "Please enter company name." }), IsString14({ message: "Please enter valid company name." }) ], ClientCreateAccountDto.prototype, "companyName", 2); __decorateClass([ IsOptional14() ], ClientCreateAccountDto.prototype, "onBoardedBy", 2); __decorateClass([ IsOptional14() ], ClientCreateAccountDto.prototype, "referralCode", 2); // src/modules/onboarding/dto/verify-onboarding-token.dto.ts import { IsNotEmpty as IsNotEmpty31, IsUUID as IsUUID14 } from "class-validator"; var VerifyOnboardingTokenDto = class { }; __decorateClass([ IsUUID14("4", { message: "UUID must be a valid UUID." }), IsNotEmpty31({ message: "UUID is required." }) ], VerifyOnboardingTokenDto.prototype, "uuid", 2); // src/modules/maintenance/pattern/pattern.ts var MAINTENANCE_PATTERN = { truncateData: "truncate.data" }; // src/modules/resume-parser/pattern/pattern.ts var RESUME_PARSER_PATTERN = { handleResumeParsing: "handle.resume.parsing", handleResumeParsingByUrl: "handle.resume.parsing.by.url", handleResumeDataProcessing: "handle.resume.data.processing", handleCheckResumeEligibility: "handle.check.resume.eligibility" }; // src/modules/user/subadmin/pattern/pattern.ts var SUBADMIN_PATTERN = { fetchSubAdmins: "fetch.subadmins", exportUsersForGetStream: "export.users.for.get.stream", handleDailyExport: "handle.daily.export", fetchDeletedSubAdmins: "fetch.deleted.subadmins", fetchSubAdminDropdown: "fetch.subadmin.dropdown", findSubAdminById: "fetch.subadmin.by.id", createSubAdmin: "create.subadmin", updateSubAdminAccountStatus: "update.subadmin.account.status", updateSubAdmin: "update.subadmin", deleteSubAdmin: "delete.subadmin", fetchSubAdminCount: "fetch.sub.admin.count" }; // src/modules/user/subadmin/dto/create-subadmin.dto.ts import { IsNotEmpty as IsNotEmpty32, IsEnum as IsEnum13 } from "class-validator"; var AccountType = /* @__PURE__ */ ((AccountType4) => { AccountType4["ADMIN"] = "ADMIN"; AccountType4["SUB_ADMIN"] = "SUB_ADMIN"; return AccountType4; })(AccountType || {}); var CreateSubAdminDto = class { }; __decorateClass([ IsNotEmpty32({ message: "Please enter username." }) ], CreateSubAdminDto.prototype, "userName", 2); __decorateClass([ IsNotEmpty32({ message: "Please enter first name." }) ], CreateSubAdminDto.prototype, "firstName", 2); __decorateClass([ IsNotEmpty32({ message: "Please enter last name." }) ], CreateSubAdminDto.prototype, "lastName", 2); __decorateClass([ IsNotEmpty32({ message: "Please enter account type." }), IsEnum13(AccountType, { message: `Account type must be one of: ${Object.values(AccountType).join(", ")}` }) ], CreateSubAdminDto.prototype, "accountType", 2); __decorateClass([ IsNotEmpty32({ message: "Please enter email." }) ], CreateSubAdminDto.prototype, "email", 2); __decorateClass([ IsNotEmpty32({ message: "Please enter mobile Code." }) ], CreateSubAdminDto.prototype, "mobileCode", 2); __decorateClass([ IsNotEmpty32({ message: "Please enter mobile number." }) ], CreateSubAdminDto.prototype, "mobile", 2); __decorateClass([ IsNotEmpty32({ message: "Please enter the password." }) ], CreateSubAdminDto.prototype, "password", 2); __decorateClass([ IsNotEmpty32({ message: "Please Select Roles." }) ], CreateSubAdminDto.prototype, "roleIds", 2); // src/modules/user/subadmin/dto/update-subadmin-account-status.dto.ts import { IsEnum as IsEnum14 } from "class-validator"; // src/entities/user.entity.ts import { Entity as Entity81, Column as Column82, OneToMany as OneToMany27, OneToOne as OneToOne13, Index as Index71, ManyToOne as ManyToOne76, JoinColumn as JoinColumn77 } from "typeorm"; // src/entities/base.entity.ts import { CreateDateColumn, PrimaryGeneratedColumn, UpdateDateColumn, Column, DeleteDateColumn, Generated } from "typeorm"; var BaseEntity = class { }; __decorateClass([ PrimaryGeneratedColumn("increment", { type: "integer" }) ], BaseEntity.prototype, "id", 2); __decorateClass([ Column({ type: "uuid" }), Generated("uuid") ], BaseEntity.prototype, "uuid", 2); __decorateClass([ CreateDateColumn({ name: "created_at", type: "timestamp with time zone" }) ], BaseEntity.prototype, "createdAt", 2); __decorateClass([ Column({ name: "created_by", type: "integer", nullable: true }) ], BaseEntity.prototype, "createdBy", 2); __decorateClass([ UpdateDateColumn({ name: "updated_at", type: "timestamp with time zone" }) ], BaseEntity.prototype, "updatedAt", 2); __decorateClass([ Column({ name: "updated_by", type: "integer", nullable: true }) ], BaseEntity.prototype, "updatedBy", 2); __decorateClass([ Column({ name: "is_deleted", type: "boolean", default: false }) ], BaseEntity.prototype, "isDeleted", 2); __decorateClass([ Column({ name: "deleted_by", type: "integer", nullable: true }) ], BaseEntity.prototype, "deletedBy", 2); __decorateClass([ DeleteDateColumn({ name: "deleted_at", type: "timestamp with time zone", nullable: true }) ], BaseEntity.prototype, "deletedAt", 2); // src/entities/refresh-token.entity.ts import { Entity, PrimaryGeneratedColumn as PrimaryGeneratedColumn2, Column as Column2, ManyToOne, JoinColumn, CreateDateColumn as CreateDateColumn2, UpdateDateColumn as UpdateDateColumn2 } from "typeorm"; var RefreshToken = class { }; __decorateClass([ PrimaryGeneratedColumn2("uuid") ], RefreshToken.prototype, "id", 2); __decorateClass([ Column2({ name: "user_id", type: "integer" }) ], RefreshToken.prototype, "userId", 2); __decorateClass([ Column2({ name: "token_id", type: "varchar" }) ], RefreshToken.prototype, "tokenId", 2); __decorateClass([ Column2({ name: "device_info", type: "json", nullable: true }) ], RefreshToken.prototype, "deviceInfo", 2); __decorateClass([ Column2({ name: "is_revoked", type: "boolean", default: false }) ], RefreshToken.prototype, "isRevoked", 2); __decorateClass([ Column2({ name: "expires_at", type: "timestamp with time zone" }) ], RefreshToken.prototype, "expiresAt", 2); __decorateClass([ CreateDateColumn2({ name: "created_at", type: "timestamp with time zone" }) ], RefreshToken.prototype, "createdAt", 2); __decorateClass([ UpdateDateColumn2({ name: "updated_at", type: "timestamp with time zone" }) ], RefreshToken.prototype, "updatedAt", 2); __decorateClass([ ManyToOne(() => User, (user) => user.refreshTokens), JoinColumn({ name: "user_id" }) ], RefreshToken.prototype, "user", 2); RefreshToken = __decorateClass([ Entity("refresh_tokens") ], RefreshToken); // src/entities/senseloaf-log.entity.ts import { Entity as Entity2, PrimaryGeneratedColumn as PrimaryGeneratedColumn3, Column as Column3, CreateDateColumn as CreateDateColumn3, ManyToOne as ManyToOne2, JoinColumn as JoinColumn2 } from "typeorm"; var SenseloafLog = class { }; __decorateClass([ PrimaryGeneratedColumn3("increment", { type: "integer" }) ], SenseloafLog.prototype, "id", 2); __decorateClass([ Column3({ name: "user_id", type: "integer", nullable: true }) ], SenseloafLog.prototype, "userId", 2); __decorateClass([ Column3({ name: "type", type: "varchar", nullable: true }) ], SenseloafLog.prototype, "type", 2); __decorateClass([ Column3({ name: "end_point", type: "varchar" }) ], SenseloafLog.prototype, "endpoint", 2); __decorateClass([ Column3({ name: "success", type: "boolean" }) ], SenseloafLog.prototype, "success", 2); __decorateClass([ Column3({ name: "request", type: "jsonb", nullable: true }) ], SenseloafLog.prototype, "request", 2); __decorateClass([ Column3({ name: "response", type: "jsonb", nullable: true }) ], SenseloafLog.prototype, "response", 2); __decorateClass([ Column3({ name: "error_message", type: "text", nullable: true }) ], SenseloafLog.prototype, "errorMessage", 2); __decorateClass([ Column3({ name: "scope", type: "varchar", nullable: true }) ], SenseloafLog.prototype, "scope", 2); __decorateClass([ CreateDateColumn3({ name: "created_at", type: "timestamp with time zone" }) ], SenseloafLog.prototype, "createdAt", 2); __decorateClass([ ManyToOne2(() => User, (user) => user.senseloafLogs), JoinColumn2({ name: "user_id" }) ], SenseloafLog.prototype, "user", 2); SenseloafLog = __decorateClass([ Entity2("senseloaf_logs") ], SenseloafLog); // src/entities/otp.entity.ts import { Entity as Entity3, PrimaryGeneratedColumn as PrimaryGeneratedColumn4, Column as Column4, CreateDateColumn as CreateDateColumn4, ManyToOne as ManyToOne3, JoinColumn as JoinColumn3, Index } from "typeorm"; var Otp = class { }; __decorateClass([ PrimaryGeneratedColumn4("increment", { type: "integer" }) ], Otp.prototype, "id", 2); // individual index to find OTPs by user __decorateClass([ Column4({ name: "user_id", type: "integer", nullable: true }), Index() ], Otp.prototype, "userId", 2); __decorateClass([ Column4({ name: "otp", type: "varchar", length: 4 }), Index() ], Otp.prototype, "otp", 2); __decorateClass([ Column4({ name: "otp_purpose", type: "varchar", length: 50 }) ], Otp.prototype, "otpPurpose", 2); __decorateClass([ Column4({ name: "target", type: "varchar", nullable: true }), Index() ], Otp.prototype, "target", 2); __decorateClass([ Column4({ name: "fallback_target", type: "varchar", nullable: true }), Index() ], Otp.prototype, "fallbackTarget", 2); // support expiration checks __decorateClass([ Column4({ name: "expire_at", type: "timestamp" }), Index() ], Otp.prototype, "expiresAt", 2); __decorateClass([ Column4({ name: "is_used", type: "boolean", default: false }), Index() ], Otp.prototype, "isUsed", 2); __decorateClass([ Column4({ name: "is_verified", type: "boolean", default: false }), Index() ], Otp.prototype, "isVerified", 2); __decorateClass([ Column4({ name: "resend_count", type: "int", default: 0 }) ], Otp.prototype, "resendCount", 2); __decorateClass([ CreateDateColumn4({ name: "created_at", type: "timestamp with time zone" }) ], Otp.prototype, "createdAt", 2); __decorateClass([ ManyToOne3(() => User, (user) => user.otps), JoinColumn3({ name: "user_id" }) ], Otp.prototype, "user", 2); Otp = __decorateClass([ Entity3("otps"), Index(["userId", "otp", "otpPurpose", "isUsed"]) ], Otp); // src/entities/freelancer-profile.entity.ts import { Entity as Entity8, Column as Column9, Index as Index4, ManyToOne as ManyToOne7, JoinColumn as JoinColumn7 } from "typeorm"; // src/entities/country.entity.ts import { Entity as Entity7, Column as Column8, OneToMany as OneToMany3 } from "typeorm"; // src/entities/state.entity.ts import { Entity as Entity6, Column as Column7, ManyToOne as ManyToOne6, JoinColumn as JoinColumn6, OneToMany as OneToMany2 } from "typeorm"; // src/entities/city.entity.ts import { Entity as Entity5, Column as Column6, ManyToOne as ManyToOne5, JoinColumn as JoinColumn5, Index as Index3, OneToMany } from "typeorm"; // src/entities/company-profile.entity.ts import { Entity as Entity4, Column as Column5, ManyToOne as ManyToOne4, JoinColumn as JoinColumn4, Index as Index2 } from "typeorm"; var KindOfHire = /* @__PURE__ */ ((KindOfHire2) => { KindOfHire2["FULLTIME"] = "FULLTIME"; KindOfHire2["PARTTIME"] = "PARTTIME"; KindOfHire2["BOTH"] = "BOTH"; KindOfHire2["HOURLY"] = "HOURLY"; KindOfHire2["FREELANCE"] = "FREELANCE"; KindOfHire2["FTE"] = "FTE"; return KindOfHire2; })(KindOfHire || {}); var ModeOfHire = /* @__PURE__ */ ((ModeOfHire2) => { ModeOfHire2["ONSITE"] = "ONSITE"; ModeOfHire2["REMOTE"] = "REMOTE"; ModeOfHire2["HYBRID"] = "HYBRID"; ModeOfHire2["BOTH"] = "BOTH"; return ModeOfHire2; })(ModeOfHire || {}); var FromUsOn = /* @__PURE__ */ ((FromUsOn2) => { FromUsOn2["LINKEDIN"] = "LINKEDIN"; FromUsOn2["GOOGLE"] = "GOOGLE"; FromUsOn2["REFERRAL"] = "REFERRAL"; FromUsOn2["OTHER"] = "OTHER"; return FromUsOn2; })(FromUsOn || {}); var CompanyOnboardingStepEnum = /* @__PURE__ */ ((CompanyOnboardingStepEnum2) => { CompanyOnboardingStepEnum2["SIGN_UP"] = "SIGN_UP"; CompanyOnboardingStepEnum2["PROFILE_COMPLETION"] = "PROFILE_COMPLETION"; return CompanyOnboardingStepEnum2; })(CompanyOnboardingStepEnum || {}); var HiringCommissionTypeEnum = /* @__PURE__ */ ((HiringCommissionTypeEnum2) => { HiringCommissionTypeEnum2["PERCENTAGE"] = "PERCENTAGE"; HiringCommissionTypeEnum2["AMOUNT"] = "AMOUNT"; return HiringCommissionTypeEnum2; })(HiringCommissionTypeEnum || {}); var CompanyProfile = class extends BaseEntity { }; // individual index to find company profile by user __decorateClass([ Column5({ name: "user_id", type: "integer", nullable: true }), Index2() ], CompanyProfile.prototype, "userId", 2); __decorateClass([ ManyToOne4(() => User, (user) => user.companyProfile), JoinColumn4({ name: "user_id" }) ], CompanyProfile.prototype, "user", 2); __decorateClass([ Column5({ name: "company_name", type: "varchar", nullable: true }) ], CompanyProfile.prototype, "companyName", 2); __decorateClass([ Column5({ name: "bio", type: "varchar", nullable: true }) ], CompanyProfile.prototype, "bio", 2); __decorateClass([ Column5({ name: "website", type: "varchar", nullable: true }) ], CompanyProfile.prototype, "webSite", 2); __decorateClass([ Column5({ name: "about_company", type: "varchar", nullable: true }) ], CompanyProfile.prototype, "aboutCompany", 2); __decorateClass([ Column5({ name: "is_service_aggrement_signed", type: "boolean", default: false }) ], CompanyProfile.prototype, "isServiceAgreementSigned", 2); __decorateClass([ Column5({ name: "skip_service_agreement", type: "boolean", default: false }) ], CompanyProfile.prototype, "skipServiceAgreement", 2); __decorateClass([ Column5({ name: "is_job_posting_restricted", type: "boolean", default: false }) ], CompanyProfile.prototype, "isJobPostingRestricted", 2); __decorateClass([ Column5({ name: "original_document_url", type: "varchar", nullable: true }) ], CompanyProfile.prototype, "originalDocumentUrl", 2); __decorateClass([ Column5({ name: "service_agreement_url", type: "varchar", nullable: true }) ], CompanyProfile.prototype, "serviceAgreementUrl", 2); __decorateClass([ Column5({ name: "service_agreement_signed_on", type: "timestamp with time zone", nullable: true }) ], CompanyProfile.prototype, "serviceAggrementSignedOn", 2); __decorateClass([ Column5({ name: "country_id", type: "integer", nullable: true }) ], CompanyProfile.prototype, "countryId", 2); __decorateClass([ ManyToOne4(() => Country, (country) => country.freelancerProfile), JoinColumn4({ name: "country_id" }) ], CompanyProfile.prototype, "country", 2); __decorateClass([ Column5({ name: "state_id", type: "integer", nullable: true }) ], CompanyProfile.prototype, "stateId", 2); __decorateClass([ ManyToOne4(() => State, (state) => state.freelancerProfile), JoinColumn4({ name: "state_id" }) ], CompanyProfile.prototype, "state", 2); __decorateClass([ Column5({ name: "city_id", type: "integer", nullable: true }) ], CompanyProfile.prototype, "cityId", 2); __decorateClass([ ManyToOne4(() => City, (city) => city.freelancerProfile), JoinColumn4({ name: "city_id" }) ], CompanyProfile.prototype, "city", 2); __decorateClass([ Column5({ name: "company_address", type: "varchar", nullable: true }) ], CompanyProfile.prototype, "companyAddress", 2); __decorateClass([ Column5({ name: "address_line", type: "varchar", nullable: true }) ], CompanyProfile.prototype, "addressLine", 2); __decorateClass([ Column5({ name: "postal_code", type: "varchar", nullable: true }) ], CompanyProfile.prototype, "postalCode", 2); __decorateClass([ Column5({ name: "phone_number", type: "varchar", nullable: true }) ], CompanyProfile.prototype, "phoneNumber", 2); __decorateClass([ Column5("text", { name: "skills", array: true, nullable: true }) ], CompanyProfile.prototype, "skills", 2); __decorateClass([ Column5({ name: "required_freelancer", type: "varchar", nullable: true }) ], CompanyProfile.prototype, "requiredFreelancer", 2); __decorateClass([ Column5({ name: "kind_of_hirin