Skip to content

Commit

Permalink
refactor: WebhookDeliverJobDataのcontentフィールドの型を具体的に (misskey-dev#15310)
Browse files Browse the repository at this point in the history
* WebhookDeliverJobDataのcontentフィールドの型を具体的に

* typeフィールドの型も変更
  • Loading branch information
takejohn authored Jan 19, 2025
1 parent 078b7d6 commit dc48c49
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/backend/src/queue/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -106,19 +109,19 @@ 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;
createdAt: number;
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;
Expand Down

0 comments on commit dc48c49

Please sign in to comment.