refactor: WebhookDeliverJobDataのcontentフィールドの型を具体的に (#15310)
* WebhookDeliverJobDataのcontentフィールドの型を具体的に * typeフィールドの型も変更
This commit is contained in:
parent
06c8512a2d
commit
2ec20c7a31
@ -6,9 +6,12 @@
|
|||||||
import type { Antenna } from '@/server/api/endpoints/i/import-antennas.js';
|
import type { Antenna } from '@/server/api/endpoints/i/import-antennas.js';
|
||||||
import type { MiDriveFile } from '@/models/DriveFile.js';
|
import type { MiDriveFile } from '@/models/DriveFile.js';
|
||||||
import type { MiNote } from '@/models/Note.js';
|
import type { MiNote } from '@/models/Note.js';
|
||||||
|
import type { SystemWebhookEventType } from '@/models/SystemWebhook.js';
|
||||||
import type { MiUser } from '@/models/User.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 { 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';
|
import type httpSignature from '@peertube/http-signature';
|
||||||
|
|
||||||
export type DeliverJobData = {
|
export type DeliverJobData = {
|
||||||
@ -106,9 +109,9 @@ export type EndedPollNotificationJobData = {
|
|||||||
noteId: MiNote['id'];
|
noteId: MiNote['id'];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SystemWebhookDeliverJobData = {
|
export type SystemWebhookDeliverJobData<T extends SystemWebhookEventType = SystemWebhookEventType> = {
|
||||||
type: string;
|
type: T;
|
||||||
content: unknown;
|
content: SystemWebhookPayload<T>;
|
||||||
webhookId: MiWebhook['id'];
|
webhookId: MiWebhook['id'];
|
||||||
to: string;
|
to: string;
|
||||||
secret: string;
|
secret: string;
|
||||||
@ -116,9 +119,9 @@ export type SystemWebhookDeliverJobData = {
|
|||||||
eventId: string;
|
eventId: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type UserWebhookDeliverJobData = {
|
export type UserWebhookDeliverJobData<T extends WebhookEventTypes = WebhookEventTypes> = {
|
||||||
type: string;
|
type: T;
|
||||||
content: unknown;
|
content: UserWebhookPayload<T>;
|
||||||
webhookId: MiWebhook['id'];
|
webhookId: MiWebhook['id'];
|
||||||
userId: MiUser['id'];
|
userId: MiUser['id'];
|
||||||
to: string;
|
to: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user