summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/QueueService.ts
diff options
context:
space:
mode:
authorおさむのひと <46447427+samunohito@users.noreply.github.com>2024-11-19 10:41:39 +0900
committerGitHub <noreply@github.com>2024-11-19 10:41:39 +0900
commit7b9c884a5d550b126c627fac18064fc3a8ca177a (patch)
tree8d420f0c9c1adcb170ca39b7a88c327391d7e7f2 /packages/backend/src/core/QueueService.ts
parentリノートメニューに「リノートの詳細」を追加 (#14985) (diff)
downloadsharkey-7b9c884a5d550b126c627fac18064fc3a8ca177a.tar.gz
sharkey-7b9c884a5d550b126c627fac18064fc3a8ca177a.tar.bz2
sharkey-7b9c884a5d550b126c627fac18064fc3a8ca177a.zip
refactor(backend): SystemWebhookで送信されるペイロードの型を追加 (#14980)
Diffstat (limited to 'packages/backend/src/core/QueueService.ts')
-rw-r--r--packages/backend/src/core/QueueService.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/backend/src/core/QueueService.ts b/packages/backend/src/core/QueueService.ts
index 50f08da241..da76dd1284 100644
--- a/packages/backend/src/core/QueueService.ts
+++ b/packages/backend/src/core/QueueService.ts
@@ -7,13 +7,15 @@ import { randomUUID } from 'node:crypto';
import { Inject, Injectable } from '@nestjs/common';
import type { IActivity } from '@/core/activitypub/type.js';
import type { MiDriveFile } from '@/models/DriveFile.js';
-import type { MiWebhook, WebhookEventTypes, webhookEventTypes } from '@/models/Webhook.js';
+import type { MiWebhook, WebhookEventTypes } from '@/models/Webhook.js';
import type { MiSystemWebhook, SystemWebhookEventType } from '@/models/SystemWebhook.js';
import type { Config } from '@/config.js';
import { DI } from '@/di-symbols.js';
import { bindThis } from '@/decorators.js';
import type { Antenna } from '@/server/api/endpoints/i/import-antennas.js';
import { ApRequestCreator } from '@/core/activitypub/ApRequestService.js';
+import { type SystemWebhookPayload } from '@/core/SystemWebhookService.js';
+import { type UserWebhookPayload } from './UserWebhookService.js';
import type {
DbJobData,
DeliverJobData,
@@ -30,12 +32,11 @@ import type {
ObjectStorageQueue,
RelationshipQueue,
SystemQueue,
- UserWebhookDeliverQueue,
SystemWebhookDeliverQueue,
+ UserWebhookDeliverQueue,
} from './QueueModule.js';
import type httpSignature from '@peertube/http-signature';
import type * as Bull from 'bullmq';
-import { type UserWebhookPayload } from './UserWebhookService.js';
@Injectable()
export class QueueService {
@@ -501,10 +502,10 @@ export class QueueService {
* @see SystemWebhookDeliverProcessorService
*/
@bindThis
- public systemWebhookDeliver(
+ public systemWebhookDeliver<T extends SystemWebhookEventType>(
webhook: MiSystemWebhook,
- type: SystemWebhookEventType,
- content: unknown,
+ type: T,
+ content: SystemWebhookPayload<T>,
opts?: { attempts?: number },
) {
const data: SystemWebhookDeliverJobData = {