summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2021-09-09 20:23:31 +0900
committerGitHub <noreply@github.com>2021-09-09 20:23:31 +0900
commit935d6473edf259efa3b9c2c167a80cb960b07ad6 (patch)
treee6555e444bc0a06baf1113328974de78721f9f6a
parentGitHub ActionsでDocker Hubへのpushを行うように (#7782) (diff)
downloadsharkey-935d6473edf259efa3b9c2c167a80cb960b07ad6.tar.gz
sharkey-935d6473edf259efa3b9c2c167a80cb960b07ad6.tar.bz2
sharkey-935d6473edf259efa3b9c2c167a80cb960b07ad6.zip
chore: APIドキュメントの修正 (#7771)
* packedNotificationSchemaを更新 * read:gallery, write:gallery, read:gallery-likes, write:gallery-likesに翻訳を追加 * fix * add header, choice, invitation
-rw-r--r--locales/ja-JP.yml4
-rw-r--r--src/misc/api-permissions.ts1
-rw-r--r--src/models/repositories/notification.ts40
3 files changed, 42 insertions, 3 deletions
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index e22f50668f..b9623ef0d0 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -1150,6 +1150,10 @@ _permissions:
"write:user-groups": "ユーザーグループを操作する"
"read:channels": "チャンネルを見る"
"write:channels": "チャンネルを操作する"
+ "read:gallery": "ギャラリーを見る"
+ "write:gallery": "ギャラリーを操作する"
+ "read:gallery-likes": "ギャラリーのいいねを見る"
+ "write:gallery-likes": "ギャラリーのいいねを操作する"
_auth:
shareAccess: "「{name}」がアカウントにアクセスすることを許可しますか?"
diff --git a/src/misc/api-permissions.ts b/src/misc/api-permissions.ts
index eb20c3d289..160cdf9fd6 100644
--- a/src/misc/api-permissions.ts
+++ b/src/misc/api-permissions.ts
@@ -32,3 +32,4 @@ export const kinds = [
'read:gallery-likes',
'write:gallery-likes',
];
+// IF YOU ADD KINDS(PERMISSIONS), YOU MUST ADD TRANSLATIONS (under _permissions).
diff --git a/src/models/repositories/notification.ts b/src/models/repositories/notification.ts
index 55af96b6d7..ed9de7ef4c 100644
--- a/src/models/repositories/notification.ts
+++ b/src/models/repositories/notification.ts
@@ -7,6 +7,7 @@ import { Note } from '@/models/entities/note';
import { NoteReaction } from '@/models/entities/note-reaction';
import { User } from '@/models/entities/user';
import { aggregateNoteEmojis, prefetchEmojis } from '@/misc/populate-emojis';
+import { notificationTypes } from '@/types';
export type PackedNotification = SchemaType<typeof packedNotificationSchema>;
@@ -124,19 +125,52 @@ export const packedNotificationSchema = {
optional: false as const, nullable: false as const,
format: 'date-time',
},
+ isRead: {
+ type: 'boolean' as const,
+ optional: false as const, nullable: false as const,
+ },
type: {
type: 'string' as const,
optional: false as const, nullable: false as const,
- enum: ['follow', 'followRequestAccepted', 'receiveFollowRequest', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote'],
+ enum: [...notificationTypes],
+ },
+ user: {
+ type: 'object' as const,
+ ref: 'User',
+ optional: true as const, nullable: true as const,
},
userId: {
type: 'string' as const,
optional: true as const, nullable: true as const,
format: 'id',
},
- user: {
+ note: {
type: 'object' as const,
- ref: 'User',
+ ref: 'Note',
+ optional: true as const, nullable: true as const,
+ },
+ reaction: {
+ type: 'string' as const,
+ optional: true as const, nullable: true as const,
+ },
+ choice: {
+ type: 'number' as const,
+ optional: true as const, nullable: true as const,
+ },
+ invitation: {
+ type: 'object' as const,
+ optional: true as const, nullable: true as const,
+ },
+ body: {
+ type: 'string' as const,
+ optional: true as const, nullable: true as const,
+ },
+ header: {
+ type: 'string' as const,
+ optional: true as const, nullable: true as const,
+ },
+ icon: {
+ type: 'string' as const,
optional: true as const, nullable: true as const,
},
}