fix(lint): enforce consistent-type-imports and fix import ordering across codebase
Auto-fix 862 lint errors: convert value imports used only as types to `import type`, fix import group ordering in seed.ts and du-an-api.ts, remove unused imports in auth controller, and clean up stale eslint-disable comments referencing non-existent rules. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { UserEntity } from '../../domain/entities/user.entity';
|
||||
import { type IUserRepository } from '../../domain/repositories/user.repository';
|
||||
import { type HashedPassword } from '../../domain/value-objects/hashed-password.vo';
|
||||
import { Email } from '../../domain/value-objects/email.vo';
|
||||
import { type HashedPassword } from '../../domain/value-objects/hashed-password.vo';
|
||||
import { Phone } from '../../domain/value-objects/phone.vo';
|
||||
import { UpdateProfileCommand } from '../commands/update-profile/update-profile.command';
|
||||
import { UpdateProfileHandler } from '../commands/update-profile/update-profile.handler';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { UserEntity } from '../../domain/entities/user.entity';
|
||||
import { type IUserRepository } from '../../domain/repositories/user.repository';
|
||||
import { type HashedPassword } from '../../domain/value-objects/hashed-password.vo';
|
||||
import { Email } from '../../domain/value-objects/email.vo';
|
||||
import { type HashedPassword } from '../../domain/value-objects/hashed-password.vo';
|
||||
import { Phone } from '../../domain/value-objects/phone.vo';
|
||||
import { VerifyEmailChangeCommand } from '../commands/verify-email-change/verify-email-change.command';
|
||||
import { VerifyEmailChangeHandler } from '../commands/verify-email-change/verify-email-change.handler';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { LoggerService, PrismaService, DomainException, NotFoundException, ValidationException } from '@modules/shared';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { type LoggerService, type PrismaService, DomainException, NotFoundException, ValidationException } from '@modules/shared';
|
||||
import { CancelUserDeletionCommand } from './cancel-user-deletion.command';
|
||||
|
||||
@CommandHandler(CancelUserDeletionCommand)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, LoggerService, UnauthorizedException, ValidationException } from '@modules/shared';
|
||||
import { USER_REPOSITORY, IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { MfaService } from '../../../infrastructure/services/mfa.service';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, type LoggerService, UnauthorizedException, ValidationException } from '@modules/shared';
|
||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { type MfaService } from '../../../infrastructure/services/mfa.service';
|
||||
import { DisableMfaCommand } from './disable-mfa.command';
|
||||
|
||||
@CommandHandler(DisableMfaCommand)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { LoggerService, PrismaService, DomainException, NotFoundException } from '@modules/shared';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { type LoggerService, type PrismaService, DomainException, NotFoundException } from '@modules/shared';
|
||||
import { ExportUserDataCommand } from './export-user-data.command';
|
||||
|
||||
export interface UserDataExport {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { LoggerService, PrismaService, DomainException, NotFoundException } from '@modules/shared';
|
||||
import { type LoggerService, type PrismaService, DomainException, NotFoundException } from '@modules/shared';
|
||||
import { ForceDeleteUserCommand } from './force-delete-user.command';
|
||||
|
||||
@CommandHandler(ForceDeleteUserCommand)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { createId } from '@paralleldrive/cuid2';
|
||||
import { LoggerService, DomainException } from '@modules/shared';
|
||||
import { type LoggerService, DomainException } from '@modules/shared';
|
||||
import {
|
||||
MFA_CHALLENGE_REPOSITORY,
|
||||
IMfaChallengeRepository,
|
||||
type IMfaChallengeRepository,
|
||||
} from '../../../domain/repositories/mfa-challenge.repository';
|
||||
import { TokenService, TokenPair } from '../../../infrastructure/services/token.service';
|
||||
import { type TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
||||
import { LoginUserCommand } from './login-user.command';
|
||||
|
||||
const MFA_CHALLENGE_TTL_MINUTES = 5;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, CommandBus, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { LoggerService, PrismaService, DomainException } from '@modules/shared';
|
||||
import { CommandHandler, type CommandBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { type LoggerService, type PrismaService, DomainException } from '@modules/shared';
|
||||
import { ForceDeleteUserCommand } from '../force-delete-user/force-delete-user.command';
|
||||
import { ProcessScheduledDeletionsCommand } from './process-scheduled-deletions.command';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { LoggerService, DomainException, UnauthorizedException } from '@modules/shared';
|
||||
import { USER_REPOSITORY, IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { TokenService, TokenPair } from '../../../infrastructure/services/token.service';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { type LoggerService, DomainException, UnauthorizedException } from '@modules/shared';
|
||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { type TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
||||
import { RefreshTokenCommand } from './refresh-token.command';
|
||||
|
||||
@CommandHandler(RefreshTokenCommand)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { createId } from '@paralleldrive/cuid2';
|
||||
import { ConflictException, DomainException, LoggerService, ValidationException } from '@modules/shared';
|
||||
import { ConflictException, DomainException, type LoggerService, ValidationException } from '@modules/shared';
|
||||
import { UserEntity } from '../../../domain/entities/user.entity';
|
||||
import { USER_REPOSITORY, IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { Email } from '../../../domain/value-objects/email.vo';
|
||||
import { HashedPassword } from '../../../domain/value-objects/hashed-password.vo';
|
||||
import { Phone } from '../../../domain/value-objects/phone.vo';
|
||||
import { TokenService, TokenPair } from '../../../infrastructure/services/token.service';
|
||||
import { type TokenService, type TokenPair } from '../../../infrastructure/services/token.service';
|
||||
import { RegisterUserCommand } from './register-user.command';
|
||||
|
||||
@CommandHandler(RegisterUserCommand)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { LoggerService, PrismaService, DomainException, NotFoundException, ValidationException } from '@modules/shared';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { type LoggerService, type PrismaService, DomainException, NotFoundException, ValidationException } from '@modules/shared';
|
||||
import { RequestUserDeletionCommand } from './request-user-deletion.command';
|
||||
|
||||
const DELETION_GRACE_PERIOD_DAYS = 30;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, LoggerService, ValidationException } from '@modules/shared';
|
||||
import { USER_REPOSITORY, IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { MfaService, MfaSetupResult } from '../../../infrastructure/services/mfa.service';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, type LoggerService, ValidationException } from '@modules/shared';
|
||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { type MfaService, type MfaSetupResult } from '../../../infrastructure/services/mfa.service';
|
||||
import { SetupMfaCommand } from './setup-mfa.command';
|
||||
|
||||
export interface SetupMfaResultDto {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import {
|
||||
CachePrefix,
|
||||
CacheService,
|
||||
ConflictException,
|
||||
DomainException,
|
||||
LoggerService,
|
||||
type LoggerService,
|
||||
NotFoundException,
|
||||
RedisService,
|
||||
type RedisService,
|
||||
ValidationException,
|
||||
} from '@modules/shared';
|
||||
import { type IUserRepository, USER_REPOSITORY } from '../../../domain/repositories/user.repository';
|
||||
import { Email } from '../../../domain/value-objects/email.vo';
|
||||
import { IUserRepository, USER_REPOSITORY } from '../../../domain/repositories/user.repository';
|
||||
import { EMAIL_CHANGE_OTP_PREFIX } from '../update-profile/update-profile.handler';
|
||||
import { VerifyEmailChangeCommand } from './verify-email-change.command';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, LoggerService, NotFoundException, CacheService, CachePrefix } from '@modules/shared';
|
||||
import { USER_REPOSITORY, IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, type LoggerService, NotFoundException, CacheService, CachePrefix } from '@modules/shared';
|
||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { VerifyKycCommand } from './verify-kyc.command';
|
||||
|
||||
@CommandHandler(VerifyKycCommand)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, LoggerService, ValidationException } from '@modules/shared';
|
||||
import { USER_REPOSITORY, IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { MfaService } from '../../../infrastructure/services/mfa.service';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, type LoggerService, ValidationException } from '@modules/shared';
|
||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { type MfaService } from '../../../infrastructure/services/mfa.service';
|
||||
import { VerifyMfaSetupCommand } from './verify-mfa-setup.command';
|
||||
|
||||
export interface VerifyMfaSetupResultDto {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable, InternalServerErrorException } from '@nestjs/common';
|
||||
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||
import { PrismaService, DomainException, LoggerService } from '@modules/shared';
|
||||
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||
import { type PrismaService, DomainException, type LoggerService } from '@modules/shared';
|
||||
import { GetAgentByUserIdQuery } from './get-agent-by-user-id.query';
|
||||
|
||||
export interface AgentDto {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, LoggerService, ValidationException } from '@modules/shared';
|
||||
import { USER_REPOSITORY, IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, type LoggerService, ValidationException } from '@modules/shared';
|
||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { GetMfaStatusQuery } from './get-mfa-status.query';
|
||||
|
||||
export interface MfaStatusDto {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, LoggerService, NotFoundException, CacheService, CachePrefix, CacheTTL } from '@modules/shared';
|
||||
import { USER_REPOSITORY, IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, type LoggerService, NotFoundException, CacheService, CachePrefix, CacheTTL } from '@modules/shared';
|
||||
import { USER_REPOSITORY, type IUserRepository } from '../../../domain/repositories/user.repository';
|
||||
import { GetProfileQuery } from './get-profile.query';
|
||||
|
||||
export interface UserProfileDto {
|
||||
|
||||
@@ -11,13 +11,13 @@ import { CancelUserDeletionHandler } from './application/commands/cancel-user-de
|
||||
import { DisableMfaHandler } from './application/commands/disable-mfa/disable-mfa.handler';
|
||||
import { ExportUserDataHandler } from './application/commands/export-user-data/export-user-data.handler';
|
||||
import { ForceDeleteUserHandler } from './application/commands/force-delete-user/force-delete-user.handler';
|
||||
import { GenerateKycUploadUrlsHandler } from './application/commands/generate-kyc-upload-urls/generate-kyc-upload-urls.handler';
|
||||
import { LoginUserHandler } from './application/commands/login-user/login-user.handler';
|
||||
import { ProcessScheduledDeletionsHandler } from './application/commands/process-scheduled-deletions/process-scheduled-deletions.handler';
|
||||
import { RefreshTokenHandler } from './application/commands/refresh-token/refresh-token.handler';
|
||||
import { RegisterUserHandler } from './application/commands/register-user/register-user.handler';
|
||||
import { RequestUserDeletionHandler } from './application/commands/request-user-deletion/request-user-deletion.handler';
|
||||
import { SetupMfaHandler } from './application/commands/setup-mfa/setup-mfa.handler';
|
||||
import { GenerateKycUploadUrlsHandler } from './application/commands/generate-kyc-upload-urls/generate-kyc-upload-urls.handler';
|
||||
import { SubmitKycHandler } from './application/commands/submit-kyc/submit-kyc.handler';
|
||||
import { UpdateProfileHandler } from './application/commands/update-profile/update-profile.handler';
|
||||
import { UseBackupCodeHandler } from './application/commands/use-backup-code/use-backup-code.handler';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { UserRole, type KYCStatus } from '@prisma/client';
|
||||
import { type UserRole, type KYCStatus } from '@prisma/client';
|
||||
import { AggregateRoot } from '@modules/shared';
|
||||
import { UserDeactivatedEvent } from '../events/user-deactivated.event';
|
||||
import { UserKycUpdatedEvent } from '../events/user-kyc-updated.event';
|
||||
import { UserRegisteredEvent } from '../events/user-registered.event';
|
||||
import { Email } from '../value-objects/email.vo';
|
||||
import { HashedPassword } from '../value-objects/hashed-password.vo';
|
||||
import { Phone } from '../value-objects/phone.vo';
|
||||
import { type Email } from '../value-objects/email.vo';
|
||||
import { type HashedPassword } from '../value-objects/hashed-password.vo';
|
||||
import { type Phone } from '../value-objects/phone.vo';
|
||||
|
||||
export interface UserProps {
|
||||
email: Email | null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
|
||||
export class AgentVerifiedEvent implements DomainEvent {
|
||||
readonly eventName = 'agent.verified';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
|
||||
export class EmailChangeRequestedEvent implements DomainEvent {
|
||||
readonly eventName = 'user.email_change_requested';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
|
||||
export class UserDeactivatedEvent implements DomainEvent {
|
||||
readonly eventName = 'user.deactivated';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { type KYCStatus } from '@prisma/client';
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
|
||||
export class UserKycUpdatedEvent implements DomainEvent {
|
||||
readonly eventName = 'user.kyc_updated';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { UserRole } from '@prisma/client';
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
import { type UserRole } from '@prisma/client';
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
|
||||
export class UserRegisteredEvent implements DomainEvent {
|
||||
readonly eventName = 'user.registered';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { UserEntity } from '../entities/user.entity';
|
||||
import { type UserEntity } from '../entities/user.entity';
|
||||
|
||||
export const USER_REPOSITORY = Symbol('USER_REPOSITORY');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '@modules/shared';
|
||||
import { type PrismaService } from '@modules/shared';
|
||||
import {
|
||||
IMfaChallengeRepository,
|
||||
type IMfaChallengeRepository,
|
||||
type MfaChallengeRecord,
|
||||
} from '../../domain/repositories/mfa-challenge.repository';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '@modules/shared';
|
||||
import { type PrismaService } from '@modules/shared';
|
||||
import {
|
||||
IRefreshTokenRepository,
|
||||
type IRefreshTokenRepository,
|
||||
type RefreshTokenRecord,
|
||||
} from '../../domain/repositories/refresh-token.repository';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Prisma, User as PrismaUser } from '@prisma/client';
|
||||
import { PrismaService } from '@modules/shared';
|
||||
import { UserEntity, UserProps } from '../../domain/entities/user.entity';
|
||||
import { IUserRepository } from '../../domain/repositories/user.repository';
|
||||
import { type Prisma, type User as PrismaUser } from '@prisma/client';
|
||||
import { type PrismaService } from '@modules/shared';
|
||||
import { UserEntity, type UserProps } from '../../domain/entities/user.entity';
|
||||
import { type IUserRepository } from '../../domain/repositories/user.repository';
|
||||
import { Email } from '../../domain/value-objects/email.vo';
|
||||
import { HashedPassword } from '../../domain/value-objects/hashed-password.vo';
|
||||
import { Phone } from '../../domain/value-objects/phone.vo';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { randomBytes, createHash } from 'crypto';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { JwtService } from '@nestjs/jwt';
|
||||
import { type JwtService } from '@nestjs/jwt';
|
||||
import {
|
||||
REFRESH_TOKEN_REPOSITORY,
|
||||
IRefreshTokenRepository,
|
||||
type IRefreshTokenRepository,
|
||||
} from '../../domain/repositories/refresh-token.repository';
|
||||
|
||||
export interface JwtPayload {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PassportStrategy } from '@nestjs/passport';
|
||||
import { Strategy, Profile, VerifyCallback } from 'passport-google-oauth20';
|
||||
import { OAuthService, type OAuthUserProfile } from '../services/oauth.service';
|
||||
import { Strategy, type Profile, type VerifyCallback } from 'passport-google-oauth20';
|
||||
import { type OAuthService, type OAuthUserProfile } from '../services/oauth.service';
|
||||
|
||||
@Injectable()
|
||||
export class GoogleOAuthStrategy extends PassportStrategy(Strategy, 'google') {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PassportStrategy } from '@nestjs/passport';
|
||||
import { Request } from 'express';
|
||||
import { type Request } from 'express';
|
||||
import { ExtractJwt, Strategy } from 'passport-jwt';
|
||||
import { JwtPayload } from '../services/token.service';
|
||||
import { type JwtPayload } from '../services/token.service';
|
||||
|
||||
function extractJwtFromCookieOrHeader(req: Request): string | null {
|
||||
const cookieToken = req.cookies?.['access_token'] as string | undefined;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Inject, Injectable, Logger } from '@nestjs/common';
|
||||
import { PassportStrategy } from '@nestjs/passport';
|
||||
import { Strategy } from 'passport-local';
|
||||
import { DomainException, normalizeVietnamPhone, UnauthorizedException } from '@modules/shared';
|
||||
import { USER_REPOSITORY, IUserRepository } from '../../domain/repositories/user.repository';
|
||||
import { USER_REPOSITORY, type IUserRepository } from '../../domain/repositories/user.repository';
|
||||
|
||||
export interface LocalStrategyResult {
|
||||
id: string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { LoggerService } from '@modules/shared';
|
||||
import { OAuthService, type OAuthUserProfile } from '../services/oauth.service';
|
||||
import { TokenPair } from '../services/token.service';
|
||||
import { type LoggerService } from '@modules/shared';
|
||||
import { type OAuthService, type OAuthUserProfile } from '../services/oauth.service';
|
||||
import { type TokenPair } from '../services/token.service';
|
||||
|
||||
/**
|
||||
* Zalo OAuth2 integration.
|
||||
|
||||
@@ -8,10 +8,10 @@ import {
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
|
||||
import { Throttle } from '@nestjs/throttler';
|
||||
import { Request, Response } from 'express';
|
||||
import { type Request, type Response } from 'express';
|
||||
import { UnauthorizedException } from '@modules/shared';
|
||||
import { TokenPair } from '../../infrastructure/services/token.service';
|
||||
import { ZaloOAuthStrategy } from '../../infrastructure/strategies/zalo-oauth.strategy';
|
||||
import { type TokenPair } from '../../infrastructure/services/token.service';
|
||||
import { type ZaloOAuthStrategy } from '../../infrastructure/strategies/zalo-oauth.strategy';
|
||||
import { GoogleOAuthGuard } from '../guards/google-oauth.guard';
|
||||
|
||||
const IS_PRODUCTION = process.env['NODE_ENV'] === 'production';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
|
||||
import { JwtPayload } from '../../infrastructure/services/token.service';
|
||||
import { createParamDecorator, type ExecutionContext } from '@nestjs/common';
|
||||
import { type JwtPayload } from '../../infrastructure/services/token.service';
|
||||
|
||||
export const CurrentUser = createParamDecorator(
|
||||
(_data: unknown, ctx: ExecutionContext): JwtPayload => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SetMetadata } from '@nestjs/common';
|
||||
import { UserRole } from '@prisma/client';
|
||||
import { type UserRole } from '@prisma/client';
|
||||
|
||||
export const ROLES_KEY = 'roles';
|
||||
export const Roles = (...roles: UserRole[]) => SetMetadata(ROLES_KEY, roles);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ExecutionContext, HttpException, Injectable, Logger } from '@nestjs/common';
|
||||
import { type ExecutionContext, HttpException, Injectable, Logger } from '@nestjs/common';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import { UnauthorizedException } from '@modules/shared';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common';
|
||||
import { Reflector } from '@nestjs/core';
|
||||
import { UserRole } from '@prisma/client';
|
||||
import { LoggerService } from '@modules/shared';
|
||||
import { Injectable, type CanActivate, type ExecutionContext } from '@nestjs/common';
|
||||
import { type Reflector } from '@nestjs/core';
|
||||
import { type UserRole } from '@prisma/client';
|
||||
import { type LoggerService } from '@modules/shared';
|
||||
import { ROLES_KEY } from '../decorators/roles.decorator';
|
||||
|
||||
@Injectable()
|
||||
|
||||
Reference in New Issue
Block a user