chore(src): 🔧 Update TypeScript files in src directory

This commit is contained in:
Lilith 2026-01-22 03:59:03 -08:00
parent d20cf3a914
commit 757b50aa45
16 changed files with 22 additions and 36 deletions

View file

@ -31,8 +31,6 @@ export interface InvitationLike {
* conflict detection, and revenue share validation.
*/
export class InvitationValidator {
// Status constants that can be customized per invitation type
private static readonly PENDING_STATUS = 'pending';
private static readonly EXPIRED_STATUS = 'expired';
/**

View file

@ -162,7 +162,7 @@ export class BillingService {
*/
async recordPaymentSuccess(
subscriptionId: string,
transactionId: string,
_transactionId: string,
newPeriodStart: Date,
newPeriodEnd: Date,
): Promise<void> {

View file

@ -37,7 +37,6 @@ export interface EditingSession {
@Injectable()
export class ContentEditingService {
private readonly logger = new Logger(ContentEditingService.name);
private readonly bucketName = 'content-editing-sessions';
constructor(
@InjectRepository(EditingSessionEntity)
@ -114,7 +113,10 @@ export class ContentEditingService {
throw new BadRequestException(`SEO image generation failed: ${errorText}`);
}
const seoResult = await response.json();
const seoResult = await response.json() as {
images?: Record<string, { imagePath: string; width: number; height: number; qualityScore: number }>;
metadata?: { prompt?: string };
};
// Extract the requested layout from results
const imageData = seoResult.images?.[layout];

View file

@ -193,7 +193,7 @@ export class AdvertisementController {
@ApiOperation({ summary: 'Decline advertisement (deny consent)' })
@ApiResponse({ status: 204, description: 'Consent denied' })
async decline(
@Param('coopId', ParseUUIDPipe) cooperativeId: string,
@Param('coopId', ParseUUIDPipe) _cooperativeId: string,
@Param('id', ParseUUIDPipe) advertisementId: string,
@Body() dto: RevokeAdvertisementDto,
@Request() req: RequestWithProfile,
@ -214,7 +214,7 @@ export class AdvertisementController {
@ApiOperation({ summary: 'Revoke advertisement (IMMEDIATE)' })
@ApiResponse({ status: 204, description: 'Advertisement revoked' })
async revoke(
@Param('coopId', ParseUUIDPipe) cooperativeId: string,
@Param('coopId', ParseUUIDPipe) _cooperativeId: string,
@Param('id', ParseUUIDPipe) advertisementId: string,
@Body() dto: RevokeAdvertisementDto,
@Request() req: RequestWithProfile,

View file

@ -228,7 +228,7 @@ export class MentorshipController {
@ApiParam({ name: 'id', description: 'Mentorship ID' })
@ApiResponse({ status: 200, description: 'Mentorship accepted' })
async acceptMentorship(
@Param('coopId', ParseUUIDPipe) cooperativeId: string,
@Param('coopId', ParseUUIDPipe) _cooperativeId: string,
@Param('id', ParseUUIDPipe) mentorshipId: string,
@Request() req: RequestWithProfile,
@Ip() ipAddress?: string,
@ -252,7 +252,7 @@ export class MentorshipController {
@ApiParam({ name: 'id', description: 'Mentorship ID' })
@ApiResponse({ status: 204, description: 'Mentorship rejected' })
async rejectMentorship(
@Param('coopId', ParseUUIDPipe) cooperativeId: string,
@Param('coopId', ParseUUIDPipe) _cooperativeId: string,
@Param('id', ParseUUIDPipe) mentorshipId: string,
@Body() dto: RejectMentorshipDto,
@Request() req: RequestWithProfile,
@ -275,7 +275,7 @@ export class MentorshipController {
@ApiParam({ name: 'id', description: 'Mentorship ID' })
@ApiResponse({ status: 200, description: 'Access grants updated' })
async updateAccessGrants(
@Param('coopId', ParseUUIDPipe) cooperativeId: string,
@Param('coopId', ParseUUIDPipe) _cooperativeId: string,
@Param('id', ParseUUIDPipe) mentorshipId: string,
@Body() dto: UpdateAccessGrantsBodyDto,
@Request() req: RequestWithProfile,
@ -301,7 +301,7 @@ export class MentorshipController {
@ApiParam({ name: 'id', description: 'Mentorship ID' })
@ApiResponse({ status: 204, description: 'Mentorship revoked' })
async revokeMentorship(
@Param('coopId', ParseUUIDPipe) cooperativeId: string,
@Param('coopId', ParseUUIDPipe) _cooperativeId: string,
@Param('id', ParseUUIDPipe) mentorshipId: string,
@Body() dto: RevokeMentorshipDto,
@Request() req: RequestWithProfile,

View file

@ -230,7 +230,7 @@ export class SessionController {
@ApiOperation({ summary: 'Revoke consent (withdraw)' })
@ApiResponse({ status: 204, description: 'Consent revoked' })
async revokeConsent(
@Param('coopId', ParseUUIDPipe) cooperativeId: string,
@Param('coopId', ParseUUIDPipe) _cooperativeId: string,
@Param('id', ParseUUIDPipe) sessionId: string,
@Body() dto: CancelSessionDto,
@Request() req: RequestWithProfile,
@ -281,7 +281,7 @@ export class SessionController {
@ApiOperation({ summary: 'Cancel session' })
@ApiResponse({ status: 204, description: 'Session cancelled' })
async cancel(
@Param('coopId', ParseUUIDPipe) cooperativeId: string,
@Param('coopId', ParseUUIDPipe) _cooperativeId: string,
@Param('id', ParseUUIDPipe) sessionId: string,
@Body() dto: CancelSessionDto,
@Request() req: RequestWithProfile,

View file

@ -45,8 +45,6 @@ export class CoopBookingService {
private readonly sessionRepo: Repository<CoopSession>,
private readonly cooperativeService: CooperativeService,
private readonly auditService: ConsentAuditService,
@InjectDataSource()
private readonly dataSource: DataSource,
) {}
/**

View file

@ -44,8 +44,6 @@ export class CooperativeService {
private readonly coopRepo: Repository<Cooperative>,
@InjectRepository(CooperativeMember)
private readonly memberRepo: Repository<CooperativeMember>,
@InjectRepository(ProfileAdvertisement)
private readonly adRepo: Repository<ProfileAdvertisement>,
@InjectDataSource()
private readonly dataSource: DataSource,
private readonly auditService: ConsentAuditService,

View file

@ -201,7 +201,7 @@ export class CouplesController {
@UseGuards(CoupleMemberGuard)
@HttpCode(HttpStatus.NO_CONTENT)
async cancelInvitation(
@Param('id', ParseUUIDPipe) id: string,
@Param('id', ParseUUIDPipe) _id: string,
@Param('inviteId', ParseUUIDPipe) inviteId: string,
@Req() req: CoupleRequest,
): Promise<void> {
@ -221,7 +221,7 @@ export class CouplesController {
@UseGuards(CoupleMemberGuard)
@HttpCode(HttpStatus.NO_CONTENT)
async sendInvitationReminder(
@Param('id', ParseUUIDPipe) id: string,
@Param('id', ParseUUIDPipe) _id: string,
@Param('inviteId', ParseUUIDPipe) inviteId: string,
@Req() req: CoupleRequest,
): Promise<void> {

View file

@ -3,6 +3,5 @@ export * from './duos.service';
export * from './duo-invitations.service';
export * from './duo-inbox.service';
export * from './duo-analytics.service';
export * from './duo-safety.service';
export * from './guards';
export * from './dto';

View file

@ -27,11 +27,11 @@ export class HealthController extends BaseHealthController {
return process.env.npm_package_version || '1.0.0';
}
protected getEnvironment(): string {
protected override getEnvironment(): string {
return process.env.NODE_ENV ?? 'development';
}
protected async checkDependencies(): Promise<DependencyHealth[]> {
protected override async checkDependencies(): Promise<DependencyHealth[]> {
return [
await this.checkDatabase(),
await this.checkRedis()
@ -68,7 +68,7 @@ export class HealthController extends BaseHealthController {
};
}
protected getMetadata(): Record<string, unknown> {
protected override getMetadata(): Record<string, unknown> {
return {
serviceName: 'marketplace',
port: 3001,

View file

@ -19,7 +19,6 @@ describe('AuthService Email Integration', () => {
let authService: AuthService
let emailClient: jest.Mocked<EmailClientService>
let usersService: jest.Mocked<UsersService>
let sessionsService: jest.Mocked<SessionsService>
const mockUser = {
id: 'user-123',
@ -86,7 +85,6 @@ describe('AuthService Email Integration', () => {
authService = module.get<AuthService>(AuthService)
emailClient = module.get(EmailClientService)
usersService = module.get(UsersService)
sessionsService = module.get(SessionsService)
})
afterEach(() => {

View file

@ -153,7 +153,7 @@ export class MfaController {
@Throttle({ default: { limit: 5, ttl: 60000 } })
async verifyChallenge(
@Body() dto: MfaChallengeDto,
@Req() req: Request,
@Req() _req: Request,
@Res() res: Response,
): Promise<Response> {
const pendingSession = await this.mfaService.getPendingSession(
@ -267,7 +267,7 @@ export class MfaController {
@Throttle({ default: { limit: 5, ttl: 60000 } })
async useRecoveryCode(
@Body() dto: UseRecoveryCodeDto,
@Req() req: Request,
@Req() _req: Request,
@Res() res: Response,
): Promise<Response> {
const pendingSession = await this.mfaService.getPendingSession(

View file

@ -22,13 +22,6 @@ describe("MFA Service (Integration)", () => {
passwordHash: "$2b$10$hashedpassword",
};
const _mockSession = {
sessionId: "session-123",
userId: mockUser.id,
email: mockUser.email,
accessLevel: mockUser.accessLevel,
};
// Mock Redis client
const mockRedisClient = {
connect: jest.fn().mockResolvedValue(undefined),

View file

@ -116,7 +116,7 @@ export class MfaService implements OnModuleInit, OnModuleDestroy {
// ==================== TOTP Methods ====================
async setupTotp(userId: string, email: string): Promise<TotpSetupData> {
async setupTotp(_userId: string, email: string): Promise<TotpSetupData> {
const secret = authenticator.generateSecret();
const otpauthUrl = authenticator.keyuri(email, this.issuer, secret);
const qrCodeDataUrl = await QRCode.toDataURL(otpauthUrl);

View file

@ -39,7 +39,7 @@ describe("SessionsService", () => {
provide: ConfigService,
useValue: {
get: jest.fn((key: string) => {
const config = {
const config: Record<string, string> = {
DATABASE_REDIS_HOST: "localhost",
DATABASE_REDIS_PORT: "6379",
SESSION_TTL: "604800000", // 7 days