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:
おさむのひと 2024-06-08 15:34:19 +09:00 committed by GitHub
parent e0cf5b2402
commit 61fae45390
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
79 changed files with 6527 additions and 369 deletions

View file

@ -6,6 +6,11 @@
import { EventEmitter } from 'eventemitter3';
// Warning: (ae-forgotten-export) The symbol "components" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type AbuseReportNotificationRecipient = components['schemas']['AbuseReportNotificationRecipient'];
// @public (undocumented)
export type Acct = {
username: string;
@ -21,13 +26,38 @@ declare namespace acct {
}
export { acct }
// Warning: (ae-forgotten-export) The symbol "components" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type Ad = components['schemas']['Ad'];
// Warning: (ae-forgotten-export) The symbol "operations" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type AdminAbuseReportNotificationRecipientCreateRequest = operations['admin___abuse-report___notification-recipient___create']['requestBody']['content']['application/json'];
// @public (undocumented)
type AdminAbuseReportNotificationRecipientCreateResponse = operations['admin___abuse-report___notification-recipient___create']['responses']['200']['content']['application/json'];
// @public (undocumented)
type AdminAbuseReportNotificationRecipientDeleteRequest = operations['admin___abuse-report___notification-recipient___delete']['requestBody']['content']['application/json'];
// @public (undocumented)
type AdminAbuseReportNotificationRecipientListRequest = operations['admin___abuse-report___notification-recipient___list']['requestBody']['content']['application/json'];
// @public (undocumented)
type AdminAbuseReportNotificationRecipientListResponse = operations['admin___abuse-report___notification-recipient___list']['responses']['200']['content']['application/json'];
// @public (undocumented)
type AdminAbuseReportNotificationRecipientShowRequest = operations['admin___abuse-report___notification-recipient___show']['requestBody']['content']['application/json'];
// @public (undocumented)
type AdminAbuseReportNotificationRecipientShowResponse = operations['admin___abuse-report___notification-recipient___show']['responses']['200']['content']['application/json'];
// @public (undocumented)
type AdminAbuseReportNotificationRecipientUpdateRequest = operations['admin___abuse-report___notification-recipient___update']['requestBody']['content']['application/json'];
// @public (undocumented)
type AdminAbuseReportNotificationRecipientUpdateResponse = operations['admin___abuse-report___notification-recipient___update']['responses']['200']['content']['application/json'];
// @public (undocumented)
type AdminAbuseUserReportsRequest = operations['admin___abuse-user-reports']['requestBody']['content']['application/json'];
@ -307,6 +337,33 @@ type AdminShowUsersResponse = operations['admin___show-users']['responses']['200
// @public (undocumented)
type AdminSuspendUserRequest = operations['admin___suspend-user']['requestBody']['content']['application/json'];
// @public (undocumented)
type AdminSystemWebhookCreateRequest = operations['admin___system-webhook___create']['requestBody']['content']['application/json'];
// @public (undocumented)
type AdminSystemWebhookCreateResponse = operations['admin___system-webhook___create']['responses']['200']['content']['application/json'];
// @public (undocumented)
type AdminSystemWebhookDeleteRequest = operations['admin___system-webhook___delete']['requestBody']['content']['application/json'];
// @public (undocumented)
type AdminSystemWebhookListRequest = operations['admin___system-webhook___list']['requestBody']['content']['application/json'];
// @public (undocumented)
type AdminSystemWebhookListResponse = operations['admin___system-webhook___list']['responses']['200']['content']['application/json'];
// @public (undocumented)
type AdminSystemWebhookShowRequest = operations['admin___system-webhook___show']['requestBody']['content']['application/json'];
// @public (undocumented)
type AdminSystemWebhookShowResponse = operations['admin___system-webhook___show']['responses']['200']['content']['application/json'];
// @public (undocumented)
type AdminSystemWebhookUpdateRequest = operations['admin___system-webhook___update']['requestBody']['content']['application/json'];
// @public (undocumented)
type AdminSystemWebhookUpdateResponse = operations['admin___system-webhook___update']['responses']['200']['content']['application/json'];
// @public (undocumented)
type AdminUnsetUserAvatarRequest = operations['admin___unset-user-avatar']['requestBody']['content']['application/json'];
@ -1133,6 +1190,15 @@ declare namespace entities {
AdminMetaResponse,
AdminAbuseUserReportsRequest,
AdminAbuseUserReportsResponse,
AdminAbuseReportNotificationRecipientListRequest,
AdminAbuseReportNotificationRecipientListResponse,
AdminAbuseReportNotificationRecipientShowRequest,
AdminAbuseReportNotificationRecipientShowResponse,
AdminAbuseReportNotificationRecipientCreateRequest,
AdminAbuseReportNotificationRecipientCreateResponse,
AdminAbuseReportNotificationRecipientUpdateRequest,
AdminAbuseReportNotificationRecipientUpdateResponse,
AdminAbuseReportNotificationRecipientDeleteRequest,
AdminAccountsCreateRequest,
AdminAccountsCreateResponse,
AdminAccountsDeleteRequest,
@ -1228,6 +1294,15 @@ declare namespace entities {
AdminRolesUpdateDefaultPoliciesRequest,
AdminRolesUsersRequest,
AdminRolesUsersResponse,
AdminSystemWebhookCreateRequest,
AdminSystemWebhookCreateResponse,
AdminSystemWebhookDeleteRequest,
AdminSystemWebhookListRequest,
AdminSystemWebhookListResponse,
AdminSystemWebhookShowRequest,
AdminSystemWebhookShowResponse,
AdminSystemWebhookUpdateRequest,
AdminSystemWebhookUpdateResponse,
AnnouncementsRequest,
AnnouncementsResponse,
AnnouncementsShowRequest,
@ -1733,7 +1808,9 @@ declare namespace entities {
ReversiGameDetailed,
MetaLite,
MetaDetailedOnly,
MetaDetailed
MetaDetailed,
SystemWebhook,
AbuseReportNotificationRecipient
}
}
export { entities }
@ -2380,8 +2457,23 @@ type ModerationLog = {
type: 'unsetUserAvatar';
info: ModerationLogPayloads['unsetUserAvatar'];
} | {
type: 'unsetUserBanner';
info: ModerationLogPayloads['unsetUserBanner'];
type: 'createSystemWebhook';
info: ModerationLogPayloads['createSystemWebhook'];
} | {
type: 'updateSystemWebhook';
info: ModerationLogPayloads['updateSystemWebhook'];
} | {
type: 'deleteSystemWebhook';
info: ModerationLogPayloads['deleteSystemWebhook'];
} | {
type: 'createAbuseReportNotificationRecipient';
info: ModerationLogPayloads['createAbuseReportNotificationRecipient'];
} | {
type: 'updateAbuseReportNotificationRecipient';
info: ModerationLogPayloads['updateAbuseReportNotificationRecipient'];
} | {
type: 'deleteAbuseReportNotificationRecipient';
info: ModerationLogPayloads['deleteAbuseReportNotificationRecipient'];
});
// @public (undocumented)
@ -2921,6 +3013,9 @@ type SwUpdateRegistrationRequest = operations['sw___update-registration']['reque
// @public (undocumented)
type SwUpdateRegistrationResponse = operations['sw___update-registration']['responses']['200']['content']['application/json'];
// @public (undocumented)
type SystemWebhook = components['schemas']['SystemWebhook'];
// @public (undocumented)
type TestRequest = operations['test']['requestBody']['content']['application/json'];