summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/json-schema/note.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-03-10 14:22:37 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-03-10 14:22:37 +0900
commit5de8930058c28be983ea38b04acec528e7c79577 (patch)
tree741487a20234ba1c5200d9a2a442e4503a38483e /packages/backend/src/models/json-schema/note.ts
parent:art: (diff)
downloadmisskey-5de8930058c28be983ea38b04acec528e7c79577.tar.gz
misskey-5de8930058c28be983ea38b04acec528e7c79577.tar.bz2
misskey-5de8930058c28be983ea38b04acec528e7c79577.zip
refactor: rename schema to json-schema
Diffstat (limited to 'packages/backend/src/models/json-schema/note.ts')
-rw-r--r--packages/backend/src/models/json-schema/note.ts174
1 files changed, 174 insertions, 0 deletions
diff --git a/packages/backend/src/models/json-schema/note.ts b/packages/backend/src/models/json-schema/note.ts
new file mode 100644
index 0000000000..58ef425dcd
--- /dev/null
+++ b/packages/backend/src/models/json-schema/note.ts
@@ -0,0 +1,174 @@
+export const packedNoteSchema = {
+ type: 'object',
+ properties: {
+ id: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ example: 'xxxxxxxxxx',
+ },
+ createdAt: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'date-time',
+ },
+ deletedAt: {
+ type: 'string',
+ optional: true, nullable: true,
+ format: 'date-time',
+ },
+ text: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ cw: {
+ type: 'string',
+ optional: true, nullable: true,
+ },
+ userId: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ user: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ replyId: {
+ type: 'string',
+ optional: true, nullable: true,
+ format: 'id',
+ example: 'xxxxxxxxxx',
+ },
+ renoteId: {
+ type: 'string',
+ optional: true, nullable: true,
+ format: 'id',
+ example: 'xxxxxxxxxx',
+ },
+ reply: {
+ type: 'object',
+ optional: true, nullable: true,
+ ref: 'Note',
+ },
+ renote: {
+ type: 'object',
+ optional: true, nullable: true,
+ ref: 'Note',
+ },
+ isHidden: {
+ type: 'boolean',
+ optional: true, nullable: false,
+ },
+ visibility: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ mentions: {
+ type: 'array',
+ optional: true, nullable: false,
+ items: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ },
+ visibleUserIds: {
+ type: 'array',
+ optional: true, nullable: false,
+ items: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ },
+ fileIds: {
+ type: 'array',
+ optional: true, nullable: false,
+ items: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ },
+ files: {
+ type: 'array',
+ optional: true, nullable: false,
+ items: {
+ type: 'object',
+ optional: false, nullable: false,
+ ref: 'DriveFile',
+ },
+ },
+ tags: {
+ type: 'array',
+ optional: true, nullable: false,
+ items: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ },
+ poll: {
+ type: 'object',
+ optional: true, nullable: true,
+ },
+ channelId: {
+ type: 'string',
+ optional: true, nullable: true,
+ format: 'id',
+ example: 'xxxxxxxxxx',
+ },
+ channel: {
+ type: 'object',
+ optional: true, nullable: true,
+ items: {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ id: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ name: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ },
+ },
+ },
+ localOnly: {
+ type: 'boolean',
+ optional: true, nullable: false,
+ },
+ reactionAcceptance: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ reactions: {
+ type: 'object',
+ optional: false, nullable: false,
+ },
+ renoteCount: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ repliesCount: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ uri: {
+ type: 'string',
+ optional: true, nullable: false,
+ },
+ url: {
+ type: 'string',
+ optional: true, nullable: false,
+ },
+
+ myReaction: {
+ type: 'object',
+ optional: true, nullable: true,
+ },
+ },
+} as const;