summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/SystemWebhookService.ts
diff options
context:
space:
mode:
authormisskey-release-bot[bot] <157398866+misskey-release-bot[bot]@users.noreply.github.com>2024-09-29 11:42:24 +0000
committerGitHub <noreply@github.com>2024-09-29 11:42:24 +0000
commit5fc8b3bc5018a2cb553f114a570cc33ef6831163 (patch)
tree40edc874ae384548fd13e55fff6e317d1ef84fbb /packages/backend/src/core/SystemWebhookService.ts
parentMerge pull request #14391 from misskey-dev/develop (diff)
parentRelease: 2024.9.0 (diff)
downloadsharkey-5fc8b3bc5018a2cb553f114a570cc33ef6831163.tar.gz
sharkey-5fc8b3bc5018a2cb553f114a570cc33ef6831163.tar.bz2
sharkey-5fc8b3bc5018a2cb553f114a570cc33ef6831163.zip
Merge pull request #14580 from misskey-dev/develop
Release: 2024.9.0
Diffstat (limited to 'packages/backend/src/core/SystemWebhookService.ts')
-rw-r--r--packages/backend/src/core/SystemWebhookService.ts13
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/backend/src/core/SystemWebhookService.ts b/packages/backend/src/core/SystemWebhookService.ts
index bc6851f788..bb7c6b8c0e 100644
--- a/packages/backend/src/core/SystemWebhookService.ts
+++ b/packages/backend/src/core/SystemWebhookService.ts
@@ -54,7 +54,7 @@ export class SystemWebhookService implements OnApplicationShutdown {
* SystemWebhook の一覧を取得する.
*/
@bindThis
- public async fetchSystemWebhooks(params?: {
+ public fetchSystemWebhooks(params?: {
ids?: MiSystemWebhook['id'][];
isActive?: MiSystemWebhook['isActive'];
on?: MiSystemWebhook['on'];
@@ -165,19 +165,24 @@ export class SystemWebhookService implements OnApplicationShutdown {
/**
* SystemWebhook をWebhook配送キューに追加する
* @see QueueService.systemWebhookDeliver
+ * // TODO: contentの型を厳格化する
*/
@bindThis
- public async enqueueSystemWebhook(webhook: MiSystemWebhook | MiSystemWebhook['id'], type: SystemWebhookEventType, content: unknown) {
+ public async enqueueSystemWebhook<T extends SystemWebhookEventType>(
+ webhook: MiSystemWebhook | MiSystemWebhook['id'],
+ type: T,
+ content: unknown,
+ ) {
const webhookEntity = typeof webhook === 'string'
? (await this.fetchActiveSystemWebhooks()).find(a => a.id === webhook)
: webhook;
if (!webhookEntity || !webhookEntity.isActive) {
- this.logger.info(`Webhook is not active or not found : ${webhook}`);
+ this.logger.info(`SystemWebhook is not active or not found : ${webhook}`);
return;
}
if (!webhookEntity.on.includes(type)) {
- this.logger.info(`Webhook ${webhookEntity.id} is not listening to ${type}`);
+ this.logger.info(`SystemWebhook ${webhookEntity.id} is not listening to ${type}`);
return;
}