diff options
| author | Take-John <takejohn@takejohn.jp> | 2025-01-19 21:08:29 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-19 12:08:29 +0000 |
| commit | dc48c49f9550e8e3aed87b97c55ecc641f8a401c (patch) | |
| tree | 736ae6ec98f9c3a9418af39f8c9e3d2db45817c0 /packages/backend/src | |
| parent | fix(frontend): アンケート(投票)でリモートの絵文字が正しく... (diff) | |
| download | sharkey-dc48c49f9550e8e3aed87b97c55ecc641f8a401c.tar.gz sharkey-dc48c49f9550e8e3aed87b97c55ecc641f8a401c.tar.bz2 sharkey-dc48c49f9550e8e3aed87b97c55ecc641f8a401c.zip | |
refactor: WebhookDeliverJobDataのcontentフィールドの型を具体的に (#15310)
* WebhookDeliverJobDataのcontentフィールドの型を具体的に
* typeフィールドの型も変更
Diffstat (limited to 'packages/backend/src')
| -rw-r--r-- | packages/backend/src/queue/types.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/packages/backend/src/queue/types.ts b/packages/backend/src/queue/types.ts index a4077a0547..5db919a149 100644 --- a/packages/backend/src/queue/types.ts +++ b/packages/backend/src/queue/types.ts @@ -6,9 +6,12 @@ import type { Antenna } from '@/server/api/endpoints/i/import-antennas.js'; import type { MiDriveFile } from '@/models/DriveFile.js'; import type { MiNote } from '@/models/Note.js'; +import type { SystemWebhookEventType } from '@/models/SystemWebhook.js'; import type { MiUser } from '@/models/User.js'; -import type { MiWebhook } from '@/models/Webhook.js'; +import type { MiWebhook, WebhookEventTypes } from '@/models/Webhook.js'; import type { IActivity } from '@/core/activitypub/type.js'; +import type { SystemWebhookPayload } from '@/core/SystemWebhookService.js'; +import type { UserWebhookPayload } from '@/core/UserWebhookService.js'; import type httpSignature from '@peertube/http-signature'; export type DeliverJobData = { @@ -106,9 +109,9 @@ export type EndedPollNotificationJobData = { noteId: MiNote['id']; }; -export type SystemWebhookDeliverJobData = { - type: string; - content: unknown; +export type SystemWebhookDeliverJobData<T extends SystemWebhookEventType = SystemWebhookEventType> = { + type: T; + content: SystemWebhookPayload<T>; webhookId: MiWebhook['id']; to: string; secret: string; @@ -116,9 +119,9 @@ export type SystemWebhookDeliverJobData = { eventId: string; }; -export type UserWebhookDeliverJobData = { - type: string; - content: unknown; +export type UserWebhookDeliverJobData<T extends WebhookEventTypes = WebhookEventTypes> = { + type: T; + content: UserWebhookPayload<T>; webhookId: MiWebhook['id']; userId: MiUser['id']; to: string; |