From 93a45a57798eeceacec2c75cc45946305ac483a9 Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Mon, 28 Oct 2024 19:52:08 -0500 Subject: [PATCH] =?UTF-8?q?fixup!=20fix(backend):=20Webhook=20Test?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E6=80=A7+=E3=83=AA=E3=82=A2=E3=82=AF?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3hook=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lint + update misskey-js definitions --- packages/backend/src/core/ReactionService.ts | 3 +-- packages/misskey-js/etc/misskey-js.api.md | 16 ++++++++++++ packages/misskey-js/src/autogen/models.ts | 4 +++ packages/misskey-js/src/autogen/types.ts | 26 ++++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/ReactionService.ts b/packages/backend/src/core/ReactionService.ts index 0292f7bbb9..936f26a0b5 100644 --- a/packages/backend/src/core/ReactionService.ts +++ b/packages/backend/src/core/ReactionService.ts @@ -266,7 +266,6 @@ export class ReactionService { reaction: reaction, }, user.id); - this.webhookService.getActiveWebhooks().then(async webhooks => { webhooks = webhooks.filter(x => x.userId === note.userId && x.on.includes('reaction')); if (webhooks.length === 0) return; @@ -286,7 +285,7 @@ export class ReactionService { for (const webhook of webhooks) { this.queueService.userWebhookDeliver(webhook, 'reaction', payload); } - }) + }); } //#region 配信 diff --git a/packages/misskey-js/etc/misskey-js.api.md b/packages/misskey-js/etc/misskey-js.api.md index 061b533b72..8ac48678ed 100644 --- a/packages/misskey-js/etc/misskey-js.api.md +++ b/packages/misskey-js/etc/misskey-js.api.md @@ -1810,6 +1810,10 @@ declare namespace entities { MeDetailed, UserDetailed, User, + UserWebhookBody, + UserWebhookNoteBody, + UserWebhookUserBody, + UserWebhookReactionBody, UserList, Ad, Announcement, @@ -3402,6 +3406,18 @@ type UsersShowResponse = operations['users___show']['responses']['200']['content // @public (undocumented) type UsersUpdateMemoRequest = operations['users___update-memo']['requestBody']['content']['application/json']; +// @public (undocumented) +type UserWebhookBody = components['schemas']['UserWebhookBody']; + +// @public (undocumented) +type UserWebhookNoteBody = components['schemas']['UserWebhookNoteBody']; + +// @public (undocumented) +type UserWebhookReactionBody = components['schemas']['UserWebhookReactionBody']; + +// @public (undocumented) +type UserWebhookUserBody = components['schemas']['UserWebhookUserBody']; + // Warnings were encountered during analysis: // // src/entities.ts:50:2 - (ae-forgotten-export) The symbol "ModerationLogPayloads" needs to be exported by the entry point index.d.ts diff --git a/packages/misskey-js/src/autogen/models.ts b/packages/misskey-js/src/autogen/models.ts index 04574849d4..8b1711015c 100644 --- a/packages/misskey-js/src/autogen/models.ts +++ b/packages/misskey-js/src/autogen/models.ts @@ -7,6 +7,10 @@ export type UserDetailedNotMe = components['schemas']['UserDetailedNotMe']; export type MeDetailed = components['schemas']['MeDetailed']; export type UserDetailed = components['schemas']['UserDetailed']; export type User = components['schemas']['User']; +export type UserWebhookBody = components['schemas']['UserWebhookBody']; +export type UserWebhookNoteBody = components['schemas']['UserWebhookNoteBody']; +export type UserWebhookUserBody = components['schemas']['UserWebhookUserBody']; +export type UserWebhookReactionBody = components['schemas']['UserWebhookReactionBody']; export type UserList = components['schemas']['UserList']; export type Ad = components['schemas']['Ad']; export type Announcement = components['schemas']['Announcement']; diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index a5333d4f93..3554593110 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -4013,6 +4013,32 @@ export type components = { MeDetailed: components['schemas']['UserLite'] & components['schemas']['UserDetailedNotMeOnly'] & components['schemas']['MeDetailedOnly']; UserDetailed: components['schemas']['UserDetailedNotMe'] | components['schemas']['MeDetailed']; User: components['schemas']['UserLite'] | components['schemas']['UserDetailed']; + UserWebhookBody: OneOf<[{ + note: components['schemas']['Note']; + }, { + user: components['schemas']['UserDetailedNotMe']; + }, { + note: components['schemas']['Note']; + reaction: { + id: string; + user: components['schemas']['UserLite']; + reaction: string; + }; + }]>; + UserWebhookNoteBody: { + note: components['schemas']['Note']; + }; + UserWebhookUserBody: { + user: components['schemas']['UserDetailedNotMe']; + }; + UserWebhookReactionBody: { + note: components['schemas']['Note']; + reaction: { + id: string; + user: components['schemas']['UserLite']; + reaction: string; + }; + }; UserList: { /** * Format: id