feat: 通報を受けた際にメールまたはWebhookで通知を送出出来るようにする (#13758)
* feat: 通報を受けた際にメールまたはWebhookで通知を送出出来るようにする * モデログに対応&エンドポイントを単一オブジェクトでのサポートに変更(API経由で大量に作るシチュエーションもないと思うので) * fix spdx * fix migration * fix migration * fix models * add e2e webhook * tweak * fix modlog * fix bugs * add tests and fix bugs * add tests and fix bugs * add tests * fix path * regenerate locale * 混入除去 * 混入除去 * add abuseReportResolved * fix pnpm-lock.yaml * add abuseReportResolved test * fix bugs * fix ui * add tests * fix CHANGELOG.md * add tests * add RoleService.getModeratorIds tests * WebhookServiceをUserとSystemに分割 * fix CHANGELOG.md * fix test * insertOneを使う用に * fix * regenerate locales * revert version * separate webhook job queue * fix * 🎨 * Update QueueProcessorService.ts --------- Co-authored-by: osamu <46447427+sam-osamu@users.noreply.github.com> Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
		| @@ -5,6 +5,13 @@ | ||||
|  | ||||
| import { Module } from '@nestjs/common'; | ||||
| import { FanoutTimelineEndpointService } from '@/core/FanoutTimelineEndpointService.js'; | ||||
| import { AbuseReportService } from '@/core/AbuseReportService.js'; | ||||
| import { SystemWebhookEntityService } from '@/core/entities/SystemWebhookEntityService.js'; | ||||
| import { | ||||
| 	AbuseReportNotificationRecipientEntityService, | ||||
| } from '@/core/entities/AbuseReportNotificationRecipientEntityService.js'; | ||||
| import { AbuseReportNotificationService } from '@/core/AbuseReportNotificationService.js'; | ||||
| import { SystemWebhookService } from '@/core/SystemWebhookService.js'; | ||||
| import { AccountMoveService } from './AccountMoveService.js'; | ||||
| import { AccountUpdateService } from './AccountUpdateService.js'; | ||||
| import { AiService } from './AiService.js'; | ||||
| @@ -56,7 +63,7 @@ import { UserMutingService } from './UserMutingService.js'; | ||||
| import { UserSuspendService } from './UserSuspendService.js'; | ||||
| import { UserAuthService } from './UserAuthService.js'; | ||||
| import { VideoProcessingService } from './VideoProcessingService.js'; | ||||
| import { WebhookService } from './WebhookService.js'; | ||||
| import { UserWebhookService } from './UserWebhookService.js'; | ||||
| import { ProxyAccountService } from './ProxyAccountService.js'; | ||||
| import { UtilityService } from './UtilityService.js'; | ||||
| import { FileInfoService } from './FileInfoService.js'; | ||||
| @@ -144,6 +151,8 @@ import type { Provider } from '@nestjs/common'; | ||||
|  | ||||
| //#region 文字列ベースでのinjection用(循環参照対応のため) | ||||
| const $LoggerService: Provider = { provide: 'LoggerService', useExisting: LoggerService }; | ||||
| const $AbuseReportService: Provider = { provide: 'AbuseReportService', useExisting: AbuseReportService }; | ||||
| const $AbuseReportNotificationService: Provider = { provide: 'AbuseReportNotificationService', useExisting: AbuseReportNotificationService }; | ||||
| const $AccountMoveService: Provider = { provide: 'AccountMoveService', useExisting: AccountMoveService }; | ||||
| const $AccountUpdateService: Provider = { provide: 'AccountUpdateService', useExisting: AccountUpdateService }; | ||||
| const $AiService: Provider = { provide: 'AiService', useExisting: AiService }; | ||||
| @@ -196,7 +205,8 @@ const $UserMutingService: Provider = { provide: 'UserMutingService', useExisting | ||||
| const $UserSuspendService: Provider = { provide: 'UserSuspendService', useExisting: UserSuspendService }; | ||||
| const $UserAuthService: Provider = { provide: 'UserAuthService', useExisting: UserAuthService }; | ||||
| const $VideoProcessingService: Provider = { provide: 'VideoProcessingService', useExisting: VideoProcessingService }; | ||||
| const $WebhookService: Provider = { provide: 'WebhookService', useExisting: WebhookService }; | ||||
| const $UserWebhookService: Provider = { provide: 'UserWebhookService', useExisting: UserWebhookService }; | ||||
| const $SystemWebhookService: Provider = { provide: 'SystemWebhookService', useExisting: SystemWebhookService }; | ||||
| const $UtilityService: Provider = { provide: 'UtilityService', useExisting: UtilityService }; | ||||
| const $FileInfoService: Provider = { provide: 'FileInfoService', useExisting: FileInfoService }; | ||||
| const $SearchService: Provider = { provide: 'SearchService', useExisting: SearchService }; | ||||
| @@ -225,6 +235,7 @@ const $ChartManagementService: Provider = { provide: 'ChartManagementService', u | ||||
|  | ||||
| const $AbuseUserReportEntityService: Provider = { provide: 'AbuseUserReportEntityService', useExisting: AbuseUserReportEntityService }; | ||||
| const $AnnouncementEntityService: Provider = { provide: 'AnnouncementEntityService', useExisting: AnnouncementEntityService }; | ||||
| const $AbuseReportNotificationRecipientEntityService: Provider = { provide: 'AbuseReportNotificationRecipientEntityService', useExisting: AbuseReportNotificationRecipientEntityService }; | ||||
| const $AntennaEntityService: Provider = { provide: 'AntennaEntityService', useExisting: AntennaEntityService }; | ||||
| const $AppEntityService: Provider = { provide: 'AppEntityService', useExisting: AppEntityService }; | ||||
| const $AuthSessionEntityService: Provider = { provide: 'AuthSessionEntityService', useExisting: AuthSessionEntityService }; | ||||
| @@ -258,6 +269,7 @@ const $FlashLikeEntityService: Provider = { provide: 'FlashLikeEntityService', u | ||||
| const $RoleEntityService: Provider = { provide: 'RoleEntityService', useExisting: RoleEntityService }; | ||||
| const $ReversiGameEntityService: Provider = { provide: 'ReversiGameEntityService', useExisting: ReversiGameEntityService }; | ||||
| const $MetaEntityService: Provider = { provide: 'MetaEntityService', useExisting: MetaEntityService }; | ||||
| const $SystemWebhookEntityService: Provider = { provide: 'SystemWebhookEntityService', useExisting: SystemWebhookEntityService }; | ||||
|  | ||||
| const $ApAudienceService: Provider = { provide: 'ApAudienceService', useExisting: ApAudienceService }; | ||||
| const $ApDbResolverService: Provider = { provide: 'ApDbResolverService', useExisting: ApDbResolverService }; | ||||
| @@ -285,6 +297,8 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
| 	], | ||||
| 	providers: [ | ||||
| 		LoggerService, | ||||
| 		AbuseReportService, | ||||
| 		AbuseReportNotificationService, | ||||
| 		AccountMoveService, | ||||
| 		AccountUpdateService, | ||||
| 		AiService, | ||||
| @@ -337,7 +351,8 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
| 		UserSuspendService, | ||||
| 		UserAuthService, | ||||
| 		VideoProcessingService, | ||||
| 		WebhookService, | ||||
| 		UserWebhookService, | ||||
| 		SystemWebhookService, | ||||
| 		UtilityService, | ||||
| 		FileInfoService, | ||||
| 		SearchService, | ||||
| @@ -366,6 +381,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
|  | ||||
| 		AbuseUserReportEntityService, | ||||
| 		AnnouncementEntityService, | ||||
| 		AbuseReportNotificationRecipientEntityService, | ||||
| 		AntennaEntityService, | ||||
| 		AppEntityService, | ||||
| 		AuthSessionEntityService, | ||||
| @@ -399,6 +415,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
| 		RoleEntityService, | ||||
| 		ReversiGameEntityService, | ||||
| 		MetaEntityService, | ||||
| 		SystemWebhookEntityService, | ||||
|  | ||||
| 		ApAudienceService, | ||||
| 		ApDbResolverService, | ||||
| @@ -422,6 +439,8 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
|  | ||||
| 		//#region 文字列ベースでのinjection用(循環参照対応のため) | ||||
| 		$LoggerService, | ||||
| 		$AbuseReportService, | ||||
| 		$AbuseReportNotificationService, | ||||
| 		$AccountMoveService, | ||||
| 		$AccountUpdateService, | ||||
| 		$AiService, | ||||
| @@ -474,7 +493,8 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
| 		$UserSuspendService, | ||||
| 		$UserAuthService, | ||||
| 		$VideoProcessingService, | ||||
| 		$WebhookService, | ||||
| 		$UserWebhookService, | ||||
| 		$SystemWebhookService, | ||||
| 		$UtilityService, | ||||
| 		$FileInfoService, | ||||
| 		$SearchService, | ||||
| @@ -503,6 +523,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
|  | ||||
| 		$AbuseUserReportEntityService, | ||||
| 		$AnnouncementEntityService, | ||||
| 		$AbuseReportNotificationRecipientEntityService, | ||||
| 		$AntennaEntityService, | ||||
| 		$AppEntityService, | ||||
| 		$AuthSessionEntityService, | ||||
| @@ -536,6 +557,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
| 		$RoleEntityService, | ||||
| 		$ReversiGameEntityService, | ||||
| 		$MetaEntityService, | ||||
| 		$SystemWebhookEntityService, | ||||
|  | ||||
| 		$ApAudienceService, | ||||
| 		$ApDbResolverService, | ||||
| @@ -560,6 +582,8 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
| 	exports: [ | ||||
| 		QueueModule, | ||||
| 		LoggerService, | ||||
| 		AbuseReportService, | ||||
| 		AbuseReportNotificationService, | ||||
| 		AccountMoveService, | ||||
| 		AccountUpdateService, | ||||
| 		AiService, | ||||
| @@ -612,7 +636,8 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
| 		UserSuspendService, | ||||
| 		UserAuthService, | ||||
| 		VideoProcessingService, | ||||
| 		WebhookService, | ||||
| 		UserWebhookService, | ||||
| 		SystemWebhookService, | ||||
| 		UtilityService, | ||||
| 		FileInfoService, | ||||
| 		SearchService, | ||||
| @@ -640,6 +665,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
|  | ||||
| 		AbuseUserReportEntityService, | ||||
| 		AnnouncementEntityService, | ||||
| 		AbuseReportNotificationRecipientEntityService, | ||||
| 		AntennaEntityService, | ||||
| 		AppEntityService, | ||||
| 		AuthSessionEntityService, | ||||
| @@ -673,6 +699,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
| 		RoleEntityService, | ||||
| 		ReversiGameEntityService, | ||||
| 		MetaEntityService, | ||||
| 		SystemWebhookEntityService, | ||||
|  | ||||
| 		ApAudienceService, | ||||
| 		ApDbResolverService, | ||||
| @@ -696,6 +723,8 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
|  | ||||
| 		//#region 文字列ベースでのinjection用(循環参照対応のため) | ||||
| 		$LoggerService, | ||||
| 		$AbuseReportService, | ||||
| 		$AbuseReportNotificationService, | ||||
| 		$AccountMoveService, | ||||
| 		$AccountUpdateService, | ||||
| 		$AiService, | ||||
| @@ -748,7 +777,8 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
| 		$UserSuspendService, | ||||
| 		$UserAuthService, | ||||
| 		$VideoProcessingService, | ||||
| 		$WebhookService, | ||||
| 		$UserWebhookService, | ||||
| 		$SystemWebhookService, | ||||
| 		$UtilityService, | ||||
| 		$FileInfoService, | ||||
| 		$SearchService, | ||||
| @@ -776,6 +806,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
|  | ||||
| 		$AbuseUserReportEntityService, | ||||
| 		$AnnouncementEntityService, | ||||
| 		$AbuseReportNotificationRecipientEntityService, | ||||
| 		$AntennaEntityService, | ||||
| 		$AppEntityService, | ||||
| 		$AuthSessionEntityService, | ||||
| @@ -809,6 +840,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting | ||||
| 		$RoleEntityService, | ||||
| 		$ReversiGameEntityService, | ||||
| 		$MetaEntityService, | ||||
| 		$SystemWebhookEntityService, | ||||
|  | ||||
| 		$ApAudienceService, | ||||
| 		$ApDbResolverService, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 おさむのひと
					おさむのひと