chore: add new fetaure

This commit is contained in:
mahyargdz
2025-07-20 14:48:02 +03:30
parent 6dd996b30d
commit b2dd55b166
19 changed files with 654 additions and 193 deletions
+57 -1
View File
@@ -214,10 +214,19 @@ export class EmailController {
return this.emailService.moveMessageToJunk(userId, Number(params.messageId));
}
@Patch("messages/:messageId/not-junk")
@ApiOperation({ summary: "Move a message from junk back to inbox (not spam)" })
@ApiResponse({ status: 200, description: "Message moved from junk to inbox successfully" })
@ApiResponse({ status: 404, description: "Message not found in junk" })
@ApiResponse({ status: 403, description: "Not authorized to move message" })
moveMessageToInboxFromJunk(@UserDec("wildduckUserId") userId: string, @Param() params: MessageParamDto) {
return this.emailService.moveMessageToInboxFromJunk(userId, Number(params.messageId));
}
@Post("messages/bulk-action")
@ApiOperation({
summary: "Perform bulk actions on multiple messages",
description: "Apply actions (seen, delete, archive, unarchive, favorite, unfavorite, junk, trash, restore) to multiple messages at once",
description: "Apply actions (seen, delete, archive, unarchive, favorite, unfavorite, junk, notjunk, trash, restore) to multiple messages at once",
})
@ApiResponse({ status: 200, description: "Bulk action completed successfully" })
@ApiResponse({ status: 206, description: "Bulk action partially completed" })
@@ -226,4 +235,51 @@ export class EmailController {
performBulkAction(@UserDec("wildduckUserId") userId: string, @Body() bulkActionDto: BulkActionDto) {
return this.emailService.performBulkAction(userId, bulkActionDto);
}
// // Domain Access Management Endpoints
// @Get("spam/domains/allowed")
// @ApiOperation({ summary: "List domains in allowlist (never marked as spam)" })
// @ApiResponse({ status: 200, description: "List of allowed domains" })
// listAllowedDomains(@UserDec("id") userId: string, @Query() query: ListDomainAccessQueryDto) {
// return this.emailSpamService.listAllowedDomains(userId, query);
// }
// @Get("spam/domains/blocked")
// @ApiOperation({ summary: "List domains in blocklist (always marked as spam)" })
// @ApiResponse({ status: 200, description: "List of blocked domains" })
// listBlockedDomains(@UserDec("id") userId: string, @Query() query: ListDomainAccessQueryDto) {
// return this.emailSpamService.listBlockedDomains(userId, query);
// }
// @Post("spam/domains/allowed")
// @ApiOperation({ summary: "Add domain to allowlist" })
// @ApiResponse({ status: 201, description: "Domain added to allowlist successfully" })
// @ApiResponse({ status: 400, description: "Invalid domain data" })
// addDomainToAllowlist(@UserDec("id") userId: string, @Body() createDomainDto: CreateDomainAccessDto) {
// return this.emailSpamService.addDomainToAllowlist(createDomainDto.domain, createDomainDto.description, userId);
// }
// @Post("spam/domains/blocked")
// @ApiOperation({ summary: "Add domain to blocklist" })
// @ApiResponse({ status: 201, description: "Domain added to blocklist successfully" })
// @ApiResponse({ status: 400, description: "Invalid domain data" })
// addDomainToBlocklist(@UserDec("id") userId: string, @Body() createDomainDto: CreateDomainAccessDto) {
// return this.emailSpamService.addDomainToBlocklist(createDomainDto.domain, createDomainDto.description, userId);
// }
// @Delete("spam/domains/allowed/:domain")
// @ApiOperation({ summary: "Remove domain from allowlist" })
// @ApiResponse({ status: 200, description: "Domain removed from allowlist successfully" })
// @ApiResponse({ status: 404, description: "Domain not found in allowlist" })
// removeDomainFromAllowlist(@UserDec("id") userId: string, @Param("domain") domain: string) {
// return this.emailSpamService.removeDomainFromAllowlist(domain, userId);
// }
// @Delete("spam/domains/blocked/:domain")
// @ApiOperation({ summary: "Remove domain from blocklist" })
// @ApiResponse({ status: 200, description: "Domain removed from blocklist successfully" })
// @ApiResponse({ status: 404, description: "Domain not found in blocklist" })
// removeDomainFromBlocklist(@UserDec("id") userId: string, @Param("domain") domain: string) {
// return this.emailSpamService.removeDomainFromBlocklist(domain, userId);
// }
}