diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2024-09-26 14:15:03 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-26 14:15:03 +0900 |
| commit | d8a2eeb7ed44a4e25426ca9b7c6c85b8c62d3106 (patch) | |
| tree | 188c69f292567d61a83ef7f1c19fac654586d1d3 /packages/backend/src/models | |
| parent | enhance(frontend): 絵文字ピッカーをドロワー表示するか自由... (diff) | |
| download | sharkey-d8a2eeb7ed44a4e25426ca9b7c6c85b8c62d3106.tar.gz sharkey-d8a2eeb7ed44a4e25426ca9b7c6c85b8c62d3106.tar.bz2 sharkey-d8a2eeb7ed44a4e25426ca9b7c6c85b8c62d3106.zip | |
feat: エクスポート完了時に通知を発行するように (#14484)
* feat: エクスポート完了時に通知を発行するように
* Update Changelog
* entitity -> entity
* fix: ペイロードを含むように
* fix icon
* exportableEntities -> userExportableEntities
Diffstat (limited to 'packages/backend/src/models')
| -rw-r--r-- | packages/backend/src/models/Notification.ts | 8 | ||||
| -rw-r--r-- | packages/backend/src/models/json-schema/notification.ts | 22 |
2 files changed, 29 insertions, 1 deletions
diff --git a/packages/backend/src/models/Notification.ts b/packages/backend/src/models/Notification.ts index 87d8c16cb3..2c5b75f577 100644 --- a/packages/backend/src/models/Notification.ts +++ b/packages/backend/src/models/Notification.ts @@ -7,6 +7,8 @@ import { MiUser } from './User.js'; import { MiNote } from './Note.js'; import { MiAccessToken } from './AccessToken.js'; import { MiRole } from './Role.js'; +import { MiDriveFile } from './DriveFile.js'; +import { userExportableEntities } from '@/types.js'; export type MiNotification = { type: 'note'; @@ -78,6 +80,12 @@ export type MiNotification = { createdAt: string; achievement: string; } | { + type: 'exportCompleted'; + id: string; + createdAt: string; + exportedEntity: typeof userExportableEntities[number]; + fileId: MiDriveFile['id']; +} | { type: 'app'; id: string; createdAt: string; diff --git a/packages/backend/src/models/json-schema/notification.ts b/packages/backend/src/models/json-schema/notification.ts index b05ec8b762..bbec2e397f 100644 --- a/packages/backend/src/models/json-schema/notification.ts +++ b/packages/backend/src/models/json-schema/notification.ts @@ -4,7 +4,7 @@ */ import { ACHIEVEMENT_TYPES } from '@/core/AchievementService.js'; -import { notificationTypes } from '@/types.js'; +import { notificationTypes, userExportableEntities } from '@/types.js'; const baseSchema = { type: 'object', @@ -305,6 +305,26 @@ export const packedNotificationSchema = { type: { type: 'string', optional: false, nullable: false, + enum: ['exportCompleted'], + }, + exportedEntity: { + type: 'string', + optional: false, nullable: false, + enum: userExportableEntities, + }, + fileId: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + }, + }, { + type: 'object', + properties: { + ...baseSchema.properties, + type: { + type: 'string', + optional: false, nullable: false, enum: ['app'], }, body: { |