From 5de8930058c28be983ea38b04acec528e7c79577 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 Mar 2023 14:22:37 +0900 Subject: refactor: rename schema to json-schema --- packages/backend/src/models/json-schema/antenna.ts | 84 ++++ packages/backend/src/models/json-schema/app.ts | 33 ++ .../backend/src/models/json-schema/blocking.ts | 26 ++ packages/backend/src/models/json-schema/channel.ts | 51 +++ packages/backend/src/models/json-schema/clip.ts | 38 ++ .../backend/src/models/json-schema/drive-file.ts | 107 +++++ .../backend/src/models/json-schema/drive-folder.ts | 39 ++ packages/backend/src/models/json-schema/emoji.ts | 63 +++ .../src/models/json-schema/federation-instance.ts | 97 +++++ packages/backend/src/models/json-schema/flash.ts | 51 +++ .../backend/src/models/json-schema/following.ts | 36 ++ .../backend/src/models/json-schema/gallery-post.ts | 69 ++++ packages/backend/src/models/json-schema/hashtag.ts | 34 ++ packages/backend/src/models/json-schema/muting.ts | 31 ++ .../src/models/json-schema/note-favorite.ts | 26 ++ .../src/models/json-schema/note-reaction.ts | 25 ++ packages/backend/src/models/json-schema/note.ts | 174 ++++++++ .../backend/src/models/json-schema/notification.ts | 66 ++++ packages/backend/src/models/json-schema/page.ts | 51 +++ packages/backend/src/models/json-schema/queue.ts | 25 ++ .../src/models/json-schema/renote-muting.ts | 26 ++ .../backend/src/models/json-schema/user-list.ts | 29 ++ packages/backend/src/models/json-schema/user.ts | 439 +++++++++++++++++++++ packages/backend/src/models/schema/antenna.ts | 84 ---- packages/backend/src/models/schema/app.ts | 33 -- packages/backend/src/models/schema/blocking.ts | 26 -- packages/backend/src/models/schema/channel.ts | 51 --- packages/backend/src/models/schema/clip.ts | 38 -- packages/backend/src/models/schema/drive-file.ts | 107 ----- packages/backend/src/models/schema/drive-folder.ts | 39 -- packages/backend/src/models/schema/emoji.ts | 63 --- .../src/models/schema/federation-instance.ts | 97 ----- packages/backend/src/models/schema/flash.ts | 51 --- packages/backend/src/models/schema/following.ts | 36 -- packages/backend/src/models/schema/gallery-post.ts | 69 ---- packages/backend/src/models/schema/hashtag.ts | 34 -- packages/backend/src/models/schema/muting.ts | 31 -- .../backend/src/models/schema/note-favorite.ts | 26 -- .../backend/src/models/schema/note-reaction.ts | 25 -- packages/backend/src/models/schema/note.ts | 174 -------- packages/backend/src/models/schema/notification.ts | 66 ---- packages/backend/src/models/schema/page.ts | 51 --- packages/backend/src/models/schema/queue.ts | 25 -- .../backend/src/models/schema/renote-muting.ts | 26 -- packages/backend/src/models/schema/user-list.ts | 29 -- packages/backend/src/models/schema/user.ts | 439 --------------------- 46 files changed, 1620 insertions(+), 1620 deletions(-) create mode 100644 packages/backend/src/models/json-schema/antenna.ts create mode 100644 packages/backend/src/models/json-schema/app.ts create mode 100644 packages/backend/src/models/json-schema/blocking.ts create mode 100644 packages/backend/src/models/json-schema/channel.ts create mode 100644 packages/backend/src/models/json-schema/clip.ts create mode 100644 packages/backend/src/models/json-schema/drive-file.ts create mode 100644 packages/backend/src/models/json-schema/drive-folder.ts create mode 100644 packages/backend/src/models/json-schema/emoji.ts create mode 100644 packages/backend/src/models/json-schema/federation-instance.ts create mode 100644 packages/backend/src/models/json-schema/flash.ts create mode 100644 packages/backend/src/models/json-schema/following.ts create mode 100644 packages/backend/src/models/json-schema/gallery-post.ts create mode 100644 packages/backend/src/models/json-schema/hashtag.ts create mode 100644 packages/backend/src/models/json-schema/muting.ts create mode 100644 packages/backend/src/models/json-schema/note-favorite.ts create mode 100644 packages/backend/src/models/json-schema/note-reaction.ts create mode 100644 packages/backend/src/models/json-schema/note.ts create mode 100644 packages/backend/src/models/json-schema/notification.ts create mode 100644 packages/backend/src/models/json-schema/page.ts create mode 100644 packages/backend/src/models/json-schema/queue.ts create mode 100644 packages/backend/src/models/json-schema/renote-muting.ts create mode 100644 packages/backend/src/models/json-schema/user-list.ts create mode 100644 packages/backend/src/models/json-schema/user.ts delete mode 100644 packages/backend/src/models/schema/antenna.ts delete mode 100644 packages/backend/src/models/schema/app.ts delete mode 100644 packages/backend/src/models/schema/blocking.ts delete mode 100644 packages/backend/src/models/schema/channel.ts delete mode 100644 packages/backend/src/models/schema/clip.ts delete mode 100644 packages/backend/src/models/schema/drive-file.ts delete mode 100644 packages/backend/src/models/schema/drive-folder.ts delete mode 100644 packages/backend/src/models/schema/emoji.ts delete mode 100644 packages/backend/src/models/schema/federation-instance.ts delete mode 100644 packages/backend/src/models/schema/flash.ts delete mode 100644 packages/backend/src/models/schema/following.ts delete mode 100644 packages/backend/src/models/schema/gallery-post.ts delete mode 100644 packages/backend/src/models/schema/hashtag.ts delete mode 100644 packages/backend/src/models/schema/muting.ts delete mode 100644 packages/backend/src/models/schema/note-favorite.ts delete mode 100644 packages/backend/src/models/schema/note-reaction.ts delete mode 100644 packages/backend/src/models/schema/note.ts delete mode 100644 packages/backend/src/models/schema/notification.ts delete mode 100644 packages/backend/src/models/schema/page.ts delete mode 100644 packages/backend/src/models/schema/queue.ts delete mode 100644 packages/backend/src/models/schema/renote-muting.ts delete mode 100644 packages/backend/src/models/schema/user-list.ts delete mode 100644 packages/backend/src/models/schema/user.ts (limited to 'packages/backend/src/models') diff --git a/packages/backend/src/models/json-schema/antenna.ts b/packages/backend/src/models/json-schema/antenna.ts new file mode 100644 index 0000000000..f0994e48f7 --- /dev/null +++ b/packages/backend/src/models/json-schema/antenna.ts @@ -0,0 +1,84 @@ +export const packedAntennaSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + name: { + type: 'string', + optional: false, nullable: false, + }, + keywords: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + }, + }, + }, + excludeKeywords: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + }, + }, + }, + src: { + type: 'string', + optional: false, nullable: false, + enum: ['home', 'all', 'users', 'list'], + }, + userListId: { + type: 'string', + optional: false, nullable: true, + format: 'id', + }, + users: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + }, + }, + caseSensitive: { + type: 'boolean', + optional: false, nullable: false, + default: false, + }, + notify: { + type: 'boolean', + optional: false, nullable: false, + }, + withReplies: { + type: 'boolean', + optional: false, nullable: false, + default: false, + }, + withFile: { + type: 'boolean', + optional: false, nullable: false, + }, + hasUnreadNote: { + type: 'boolean', + optional: false, nullable: false, + default: false, + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/app.ts b/packages/backend/src/models/json-schema/app.ts new file mode 100644 index 0000000000..c80dc81c33 --- /dev/null +++ b/packages/backend/src/models/json-schema/app.ts @@ -0,0 +1,33 @@ +export const packedAppSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + }, + name: { + type: 'string', + optional: false, nullable: false, + }, + callbackUrl: { + type: 'string', + optional: false, nullable: true, + }, + permission: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + }, + }, + secret: { + type: 'string', + optional: true, nullable: false, + }, + isAuthorized: { + type: 'boolean', + optional: true, nullable: false, + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/blocking.ts b/packages/backend/src/models/json-schema/blocking.ts new file mode 100644 index 0000000000..5532322420 --- /dev/null +++ b/packages/backend/src/models/json-schema/blocking.ts @@ -0,0 +1,26 @@ +export const packedBlockingSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + blockeeId: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + blockee: { + type: 'object', + optional: false, nullable: false, + ref: 'UserDetailed', + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/channel.ts b/packages/backend/src/models/json-schema/channel.ts new file mode 100644 index 0000000000..7f4f2a48b8 --- /dev/null +++ b/packages/backend/src/models/json-schema/channel.ts @@ -0,0 +1,51 @@ +export const packedChannelSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + lastNotedAt: { + type: 'string', + optional: false, nullable: true, + format: 'date-time', + }, + name: { + type: 'string', + optional: false, nullable: false, + }, + description: { + type: 'string', + nullable: true, optional: false, + }, + bannerUrl: { + type: 'string', + format: 'url', + nullable: true, optional: false, + }, + notesCount: { + type: 'number', + nullable: false, optional: false, + }, + usersCount: { + type: 'number', + nullable: false, optional: false, + }, + isFollowing: { + type: 'boolean', + optional: true, nullable: false, + }, + userId: { + type: 'string', + nullable: true, optional: false, + format: 'id', + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/clip.ts b/packages/backend/src/models/json-schema/clip.ts new file mode 100644 index 0000000000..f0ee2ce0c4 --- /dev/null +++ b/packages/backend/src/models/json-schema/clip.ts @@ -0,0 +1,38 @@ +export const packedClipSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + userId: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + user: { + type: 'object', + ref: 'UserLite', + optional: false, nullable: false, + }, + name: { + type: 'string', + optional: false, nullable: false, + }, + description: { + type: 'string', + optional: false, nullable: true, + }, + isPublic: { + type: 'boolean', + optional: false, nullable: false, + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/drive-file.ts b/packages/backend/src/models/json-schema/drive-file.ts new file mode 100644 index 0000000000..4359076612 --- /dev/null +++ b/packages/backend/src/models/json-schema/drive-file.ts @@ -0,0 +1,107 @@ +export const packedDriveFileSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + name: { + type: 'string', + optional: false, nullable: false, + example: 'lenna.jpg', + }, + type: { + type: 'string', + optional: false, nullable: false, + example: 'image/jpeg', + }, + md5: { + type: 'string', + optional: false, nullable: false, + format: 'md5', + example: '15eca7fba0480996e2245f5185bf39f2', + }, + size: { + type: 'number', + optional: false, nullable: false, + example: 51469, + }, + isSensitive: { + type: 'boolean', + optional: false, nullable: false, + }, + blurhash: { + type: 'string', + optional: false, nullable: true, + }, + properties: { + type: 'object', + optional: false, nullable: false, + properties: { + width: { + type: 'number', + optional: true, nullable: false, + example: 1280, + }, + height: { + type: 'number', + optional: true, nullable: false, + example: 720, + }, + orientation: { + type: 'number', + optional: true, nullable: false, + example: 8, + }, + avgColor: { + type: 'string', + optional: true, nullable: false, + example: 'rgb(40,65,87)', + }, + }, + }, + url: { + type: 'string', + optional: false, nullable: true, + format: 'url', + }, + thumbnailUrl: { + type: 'string', + optional: false, nullable: true, + format: 'url', + }, + comment: { + type: 'string', + optional: false, nullable: true, + }, + folderId: { + type: 'string', + optional: false, nullable: true, + format: 'id', + example: 'xxxxxxxxxx', + }, + folder: { + type: 'object', + optional: true, nullable: true, + ref: 'DriveFolder', + }, + userId: { + type: 'string', + optional: false, nullable: true, + format: 'id', + example: 'xxxxxxxxxx', + }, + user: { + type: 'object', + optional: true, nullable: true, + ref: 'UserLite', + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/drive-folder.ts b/packages/backend/src/models/json-schema/drive-folder.ts new file mode 100644 index 0000000000..88cb8ab4a2 --- /dev/null +++ b/packages/backend/src/models/json-schema/drive-folder.ts @@ -0,0 +1,39 @@ +export const packedDriveFolderSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + name: { + type: 'string', + optional: false, nullable: false, + }, + foldersCount: { + type: 'number', + optional: true, nullable: false, + }, + filesCount: { + type: 'number', + optional: true, nullable: false, + }, + parentId: { + type: 'string', + optional: false, nullable: true, + format: 'id', + example: 'xxxxxxxxxx', + }, + parent: { + type: 'object', + optional: true, nullable: true, + ref: 'DriveFolder', + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/emoji.ts b/packages/backend/src/models/json-schema/emoji.ts new file mode 100644 index 0000000000..c00c3dac1d --- /dev/null +++ b/packages/backend/src/models/json-schema/emoji.ts @@ -0,0 +1,63 @@ +export const packedEmojiSimpleSchema = { + type: 'object', + properties: { + aliases: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + }, + name: { + type: 'string', + optional: false, nullable: false, + }, + category: { + type: 'string', + optional: false, nullable: true, + }, + url: { + type: 'string', + optional: false, nullable: false, + }, + }, +} as const; + +export const packedEmojiDetailedSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + aliases: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + }, + name: { + type: 'string', + optional: false, nullable: false, + }, + category: { + type: 'string', + optional: false, nullable: true, + }, + host: { + type: 'string', + optional: false, nullable: true, + description: 'The local host is represented with `null`.', + }, + url: { + type: 'string', + optional: false, nullable: false, + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/federation-instance.ts b/packages/backend/src/models/json-schema/federation-instance.ts new file mode 100644 index 0000000000..42d93dfac9 --- /dev/null +++ b/packages/backend/src/models/json-schema/federation-instance.ts @@ -0,0 +1,97 @@ +export const packedFederationInstanceSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + firstRetrievedAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + host: { + type: 'string', + optional: false, nullable: false, + example: 'misskey.example.com', + }, + usersCount: { + type: 'number', + optional: false, nullable: false, + }, + notesCount: { + type: 'number', + optional: false, nullable: false, + }, + followingCount: { + type: 'number', + optional: false, nullable: false, + }, + followersCount: { + type: 'number', + optional: false, nullable: false, + }, + isNotResponding: { + type: 'boolean', + optional: false, nullable: false, + }, + isSuspended: { + type: 'boolean', + optional: false, nullable: false, + }, + isBlocked: { + type: 'boolean', + optional: false, nullable: false, + }, + softwareName: { + type: 'string', + optional: false, nullable: true, + example: 'misskey', + }, + softwareVersion: { + type: 'string', + optional: false, nullable: true, + }, + openRegistrations: { + type: 'boolean', + optional: false, nullable: true, + example: true, + }, + name: { + type: 'string', + optional: false, nullable: true, + }, + description: { + type: 'string', + optional: false, nullable: true, + }, + maintainerName: { + type: 'string', + optional: false, nullable: true, + }, + maintainerEmail: { + type: 'string', + optional: false, nullable: true, + }, + iconUrl: { + type: 'string', + optional: false, nullable: true, + format: 'url', + }, + faviconUrl: { + type: 'string', + optional: false, nullable: true, + format: 'url', + }, + themeColor: { + type: 'string', + optional: false, nullable: true, + }, + infoUpdatedAt: { + type: 'string', + optional: false, nullable: true, + format: 'date-time', + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/flash.ts b/packages/backend/src/models/json-schema/flash.ts new file mode 100644 index 0000000000..8471a138ec --- /dev/null +++ b/packages/backend/src/models/json-schema/flash.ts @@ -0,0 +1,51 @@ +export const packedFlashSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + updatedAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + title: { + type: 'string', + optional: false, nullable: false, + }, + summary: { + type: 'string', + optional: false, nullable: false, + }, + script: { + type: 'string', + optional: false, nullable: false, + }, + userId: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + user: { + type: 'object', + ref: 'UserLite', + optional: false, nullable: false, + }, + likedCount: { + type: 'number', + optional: false, nullable: true, + }, + isLiked: { + type: 'boolean', + optional: true, nullable: false, + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/following.ts b/packages/backend/src/models/json-schema/following.ts new file mode 100644 index 0000000000..2bcffbfc4d --- /dev/null +++ b/packages/backend/src/models/json-schema/following.ts @@ -0,0 +1,36 @@ +export const packedFollowingSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + followeeId: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + followee: { + type: 'object', + optional: true, nullable: false, + ref: 'UserDetailed', + }, + followerId: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + follower: { + type: 'object', + optional: true, nullable: false, + ref: 'UserDetailed', + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/gallery-post.ts b/packages/backend/src/models/json-schema/gallery-post.ts new file mode 100644 index 0000000000..fc503d4a64 --- /dev/null +++ b/packages/backend/src/models/json-schema/gallery-post.ts @@ -0,0 +1,69 @@ +export const packedGalleryPostSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + updatedAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + title: { + type: 'string', + optional: false, nullable: false, + }, + description: { + type: 'string', + optional: false, nullable: true, + }, + userId: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + user: { + type: 'object', + ref: 'UserLite', + optional: false, nullable: false, + }, + 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, + }, + }, + isSensitive: { + type: 'boolean', + optional: false, nullable: false, + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/hashtag.ts b/packages/backend/src/models/json-schema/hashtag.ts new file mode 100644 index 0000000000..98f8827640 --- /dev/null +++ b/packages/backend/src/models/json-schema/hashtag.ts @@ -0,0 +1,34 @@ +export const packedHashtagSchema = { + type: 'object', + properties: { + tag: { + type: 'string', + optional: false, nullable: false, + example: 'misskey', + }, + mentionedUsersCount: { + type: 'number', + optional: false, nullable: false, + }, + mentionedLocalUsersCount: { + type: 'number', + optional: false, nullable: false, + }, + mentionedRemoteUsersCount: { + type: 'number', + optional: false, nullable: false, + }, + attachedUsersCount: { + type: 'number', + optional: false, nullable: false, + }, + attachedLocalUsersCount: { + type: 'number', + optional: false, nullable: false, + }, + attachedRemoteUsersCount: { + type: 'number', + optional: false, nullable: false, + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/muting.ts b/packages/backend/src/models/json-schema/muting.ts new file mode 100644 index 0000000000..3ab99e17e7 --- /dev/null +++ b/packages/backend/src/models/json-schema/muting.ts @@ -0,0 +1,31 @@ +export const packedMutingSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + expiresAt: { + type: 'string', + optional: false, nullable: true, + format: 'date-time', + }, + muteeId: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + mutee: { + type: 'object', + optional: false, nullable: false, + ref: 'UserDetailed', + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/note-favorite.ts b/packages/backend/src/models/json-schema/note-favorite.ts new file mode 100644 index 0000000000..d133f7367d --- /dev/null +++ b/packages/backend/src/models/json-schema/note-favorite.ts @@ -0,0 +1,26 @@ +export const packedNoteFavoriteSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + note: { + type: 'object', + optional: false, nullable: false, + ref: 'Note', + }, + noteId: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/note-reaction.ts b/packages/backend/src/models/json-schema/note-reaction.ts new file mode 100644 index 0000000000..0d8fc5449b --- /dev/null +++ b/packages/backend/src/models/json-schema/note-reaction.ts @@ -0,0 +1,25 @@ +export const packedNoteReactionSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + user: { + type: 'object', + optional: false, nullable: false, + ref: 'UserLite', + }, + type: { + type: 'string', + optional: false, nullable: false, + }, + }, +} as const; 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; diff --git a/packages/backend/src/models/json-schema/notification.ts b/packages/backend/src/models/json-schema/notification.ts new file mode 100644 index 0000000000..d3f2405cdd --- /dev/null +++ b/packages/backend/src/models/json-schema/notification.ts @@ -0,0 +1,66 @@ +import { notificationTypes } from '@/types.js'; + +export const packedNotificationSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + isRead: { + type: 'boolean', + optional: false, nullable: false, + }, + type: { + type: 'string', + optional: false, nullable: false, + enum: [...notificationTypes], + }, + user: { + type: 'object', + ref: 'UserLite', + optional: true, nullable: true, + }, + userId: { + type: 'string', + optional: true, nullable: true, + format: 'id', + }, + note: { + type: 'object', + ref: 'Note', + optional: true, nullable: true, + }, + reaction: { + type: 'string', + optional: true, nullable: true, + }, + choice: { + type: 'number', + optional: true, nullable: true, + }, + invitation: { + type: 'object', + optional: true, nullable: true, + }, + body: { + type: 'string', + optional: true, nullable: true, + }, + header: { + type: 'string', + optional: true, nullable: true, + }, + icon: { + type: 'string', + optional: true, nullable: true, + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/page.ts b/packages/backend/src/models/json-schema/page.ts new file mode 100644 index 0000000000..55ba3ce7f7 --- /dev/null +++ b/packages/backend/src/models/json-schema/page.ts @@ -0,0 +1,51 @@ +export const packedPageSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + updatedAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + title: { + type: 'string', + optional: false, nullable: false, + }, + name: { + type: 'string', + optional: false, nullable: false, + }, + summary: { + type: 'string', + optional: false, nullable: true, + }, + content: { + type: 'array', + optional: false, nullable: false, + }, + variables: { + type: 'array', + optional: false, nullable: false, + }, + userId: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + user: { + type: 'object', + ref: 'UserLite', + optional: false, nullable: false, + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/queue.ts b/packages/backend/src/models/json-schema/queue.ts new file mode 100644 index 0000000000..7ceeda26af --- /dev/null +++ b/packages/backend/src/models/json-schema/queue.ts @@ -0,0 +1,25 @@ +export const packedQueueCountSchema = { + type: 'object', + properties: { + waiting: { + type: 'number', + optional: false, nullable: false, + }, + active: { + type: 'number', + optional: false, nullable: false, + }, + completed: { + type: 'number', + optional: false, nullable: false, + }, + failed: { + type: 'number', + optional: false, nullable: false, + }, + delayed: { + type: 'number', + optional: false, nullable: false, + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/renote-muting.ts b/packages/backend/src/models/json-schema/renote-muting.ts new file mode 100644 index 0000000000..69ed8510da --- /dev/null +++ b/packages/backend/src/models/json-schema/renote-muting.ts @@ -0,0 +1,26 @@ +export const packedRenoteMutingSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + muteeId: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + mutee: { + type: 'object', + optional: false, nullable: false, + ref: 'UserDetailed', + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/user-list.ts b/packages/backend/src/models/json-schema/user-list.ts new file mode 100644 index 0000000000..3ba5dc4a8a --- /dev/null +++ b/packages/backend/src/models/json-schema/user-list.ts @@ -0,0 +1,29 @@ +export const packedUserListSchema = { + type: 'object', + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string', + optional: false, nullable: false, + format: 'date-time', + }, + name: { + type: 'string', + optional: false, nullable: false, + }, + userIds: { + type: 'array', + nullable: false, optional: true, + items: { + type: 'string', + nullable: false, optional: false, + format: 'id', + }, + }, + }, +} as const; diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts new file mode 100644 index 0000000000..8c61ee1f5f --- /dev/null +++ b/packages/backend/src/models/json-schema/user.ts @@ -0,0 +1,439 @@ +export const packedUserLiteSchema = { + type: 'object', + properties: { + id: { + type: 'string', + nullable: false, optional: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + name: { + type: 'string', + nullable: true, optional: false, + example: '藍', + }, + username: { + type: 'string', + nullable: false, optional: false, + example: 'ai', + }, + host: { + type: 'string', + nullable: true, optional: false, + example: 'misskey.example.com', + description: 'The local host is represented with `null`.', + }, + avatarUrl: { + type: 'string', + format: 'url', + nullable: true, optional: false, + }, + avatarBlurhash: { + type: 'any', + nullable: true, optional: false, + }, + isAdmin: { + type: 'boolean', + nullable: false, optional: true, + default: false, + }, + isModerator: { + type: 'boolean', + nullable: false, optional: true, + default: false, + }, + isBot: { + type: 'boolean', + nullable: false, optional: true, + }, + isCat: { + type: 'boolean', + nullable: false, optional: true, + }, + onlineStatus: { + type: 'string', + format: 'url', + nullable: true, optional: false, + enum: ['unknown', 'online', 'active', 'offline'], + }, + }, +} as const; + +export const packedUserDetailedNotMeOnlySchema = { + type: 'object', + properties: { + url: { + type: 'string', + format: 'url', + nullable: true, optional: false, + }, + uri: { + type: 'string', + format: 'uri', + nullable: true, optional: false, + }, + createdAt: { + type: 'string', + nullable: false, optional: false, + format: 'date-time', + }, + updatedAt: { + type: 'string', + nullable: true, optional: false, + format: 'date-time', + }, + lastFetchedAt: { + type: 'string', + nullable: true, optional: false, + format: 'date-time', + }, + bannerUrl: { + type: 'string', + format: 'url', + nullable: true, optional: false, + }, + bannerBlurhash: { + type: 'any', + nullable: true, optional: false, + }, + isLocked: { + type: 'boolean', + nullable: false, optional: false, + }, + isSilenced: { + type: 'boolean', + nullable: false, optional: false, + }, + isSuspended: { + type: 'boolean', + nullable: false, optional: false, + example: false, + }, + description: { + type: 'string', + nullable: true, optional: false, + example: 'Hi masters, I am Ai!', + }, + location: { + type: 'string', + nullable: true, optional: false, + }, + birthday: { + type: 'string', + nullable: true, optional: false, + example: '2018-03-12', + }, + lang: { + type: 'string', + nullable: true, optional: false, + example: 'ja-JP', + }, + fields: { + type: 'array', + nullable: false, optional: false, + items: { + type: 'object', + nullable: false, optional: false, + properties: { + name: { + type: 'string', + nullable: false, optional: false, + }, + value: { + type: 'string', + nullable: false, optional: false, + }, + }, + maxLength: 4, + }, + }, + followersCount: { + type: 'number', + nullable: false, optional: false, + }, + followingCount: { + type: 'number', + nullable: false, optional: false, + }, + notesCount: { + type: 'number', + nullable: false, optional: false, + }, + pinnedNoteIds: { + type: 'array', + nullable: false, optional: false, + items: { + type: 'string', + nullable: false, optional: false, + format: 'id', + }, + }, + pinnedNotes: { + type: 'array', + nullable: false, optional: false, + items: { + type: 'object', + nullable: false, optional: false, + ref: 'Note', + }, + }, + pinnedPageId: { + type: 'string', + nullable: true, optional: false, + }, + pinnedPage: { + type: 'object', + nullable: true, optional: false, + ref: 'Page', + }, + publicReactions: { + type: 'boolean', + nullable: false, optional: false, + }, + twoFactorEnabled: { + type: 'boolean', + nullable: false, optional: false, + default: false, + }, + usePasswordLessLogin: { + type: 'boolean', + nullable: false, optional: false, + default: false, + }, + securityKeys: { + type: 'boolean', + nullable: false, optional: false, + default: false, + }, + //#region relations + isFollowing: { + type: 'boolean', + nullable: false, optional: true, + }, + isFollowed: { + type: 'boolean', + nullable: false, optional: true, + }, + hasPendingFollowRequestFromYou: { + type: 'boolean', + nullable: false, optional: true, + }, + hasPendingFollowRequestToYou: { + type: 'boolean', + nullable: false, optional: true, + }, + isBlocking: { + type: 'boolean', + nullable: false, optional: true, + }, + isBlocked: { + type: 'boolean', + nullable: false, optional: true, + }, + isMuted: { + type: 'boolean', + nullable: false, optional: true, + }, + isRenoteMuted: { + type: 'boolean', + nullable: false, optional: true, + }, + //#endregion + }, +} as const; + +export const packedMeDetailedOnlySchema = { + type: 'object', + properties: { + avatarId: { + type: 'string', + nullable: true, optional: false, + format: 'id', + }, + bannerId: { + type: 'string', + nullable: true, optional: false, + format: 'id', + }, + injectFeaturedNote: { + type: 'boolean', + nullable: true, optional: false, + }, + receiveAnnouncementEmail: { + type: 'boolean', + nullable: true, optional: false, + }, + alwaysMarkNsfw: { + type: 'boolean', + nullable: true, optional: false, + }, + autoSensitive: { + type: 'boolean', + nullable: true, optional: false, + }, + carefulBot: { + type: 'boolean', + nullable: true, optional: false, + }, + autoAcceptFollowed: { + type: 'boolean', + nullable: true, optional: false, + }, + noCrawle: { + type: 'boolean', + nullable: true, optional: false, + }, + isExplorable: { + type: 'boolean', + nullable: false, optional: false, + }, + isDeleted: { + type: 'boolean', + nullable: false, optional: false, + }, + hideOnlineStatus: { + type: 'boolean', + nullable: false, optional: false, + }, + hasUnreadSpecifiedNotes: { + type: 'boolean', + nullable: false, optional: false, + }, + hasUnreadMentions: { + type: 'boolean', + nullable: false, optional: false, + }, + hasUnreadAnnouncement: { + type: 'boolean', + nullable: false, optional: false, + }, + hasUnreadAntenna: { + type: 'boolean', + nullable: false, optional: false, + }, + hasUnreadChannel: { + type: 'boolean', + nullable: false, optional: false, + }, + hasUnreadNotification: { + type: 'boolean', + nullable: false, optional: false, + }, + hasPendingReceivedFollowRequest: { + type: 'boolean', + nullable: false, optional: false, + }, + mutedWords: { + type: 'array', + nullable: false, optional: false, + items: { + type: 'array', + nullable: false, optional: false, + items: { + type: 'string', + nullable: false, optional: false, + }, + }, + }, + mutedInstances: { + type: 'array', + nullable: true, optional: false, + items: { + type: 'string', + nullable: false, optional: false, + }, + }, + mutingNotificationTypes: { + type: 'array', + nullable: true, optional: false, + items: { + type: 'string', + nullable: false, optional: false, + }, + }, + emailNotificationTypes: { + type: 'array', + nullable: true, optional: false, + items: { + type: 'string', + nullable: false, optional: false, + }, + }, + //#region secrets + email: { + type: 'string', + nullable: true, optional: true, + }, + emailVerified: { + type: 'boolean', + nullable: true, optional: true, + }, + securityKeysList: { + type: 'array', + nullable: false, optional: true, + items: { + type: 'object', + nullable: false, optional: false, + }, + }, + //#endregion + }, +} as const; + +export const packedUserDetailedNotMeSchema = { + type: 'object', + allOf: [ + { + type: 'object', + ref: 'UserLite', + }, + { + type: 'object', + ref: 'UserDetailedNotMeOnly', + }, + ], +} as const; + +export const packedMeDetailedSchema = { + type: 'object', + allOf: [ + { + type: 'object', + ref: 'UserLite', + }, + { + type: 'object', + ref: 'UserDetailedNotMeOnly', + }, + { + type: 'object', + ref: 'MeDetailedOnly', + }, + ], +} as const; + +export const packedUserDetailedSchema = { + oneOf: [ + { + type: 'object', + ref: 'UserDetailedNotMe', + }, + { + type: 'object', + ref: 'MeDetailed', + }, + ], +} as const; + +export const packedUserSchema = { + oneOf: [ + { + type: 'object', + ref: 'UserLite', + }, + { + type: 'object', + ref: 'UserDetailed', + }, + ], +} as const; diff --git a/packages/backend/src/models/schema/antenna.ts b/packages/backend/src/models/schema/antenna.ts deleted file mode 100644 index f0994e48f7..0000000000 --- a/packages/backend/src/models/schema/antenna.ts +++ /dev/null @@ -1,84 +0,0 @@ -export const packedAntennaSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - name: { - type: 'string', - optional: false, nullable: false, - }, - keywords: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - optional: false, nullable: false, - }, - }, - }, - excludeKeywords: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - optional: false, nullable: false, - }, - }, - }, - src: { - type: 'string', - optional: false, nullable: false, - enum: ['home', 'all', 'users', 'list'], - }, - userListId: { - type: 'string', - optional: false, nullable: true, - format: 'id', - }, - users: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - optional: false, nullable: false, - }, - }, - caseSensitive: { - type: 'boolean', - optional: false, nullable: false, - default: false, - }, - notify: { - type: 'boolean', - optional: false, nullable: false, - }, - withReplies: { - type: 'boolean', - optional: false, nullable: false, - default: false, - }, - withFile: { - type: 'boolean', - optional: false, nullable: false, - }, - hasUnreadNote: { - type: 'boolean', - optional: false, nullable: false, - default: false, - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/app.ts b/packages/backend/src/models/schema/app.ts deleted file mode 100644 index c80dc81c33..0000000000 --- a/packages/backend/src/models/schema/app.ts +++ /dev/null @@ -1,33 +0,0 @@ -export const packedAppSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - }, - name: { - type: 'string', - optional: false, nullable: false, - }, - callbackUrl: { - type: 'string', - optional: false, nullable: true, - }, - permission: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - optional: false, nullable: false, - }, - }, - secret: { - type: 'string', - optional: true, nullable: false, - }, - isAuthorized: { - type: 'boolean', - optional: true, nullable: false, - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/blocking.ts b/packages/backend/src/models/schema/blocking.ts deleted file mode 100644 index 5532322420..0000000000 --- a/packages/backend/src/models/schema/blocking.ts +++ /dev/null @@ -1,26 +0,0 @@ -export const packedBlockingSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - blockeeId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - blockee: { - type: 'object', - optional: false, nullable: false, - ref: 'UserDetailed', - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/channel.ts b/packages/backend/src/models/schema/channel.ts deleted file mode 100644 index 7f4f2a48b8..0000000000 --- a/packages/backend/src/models/schema/channel.ts +++ /dev/null @@ -1,51 +0,0 @@ -export const packedChannelSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - lastNotedAt: { - type: 'string', - optional: false, nullable: true, - format: 'date-time', - }, - name: { - type: 'string', - optional: false, nullable: false, - }, - description: { - type: 'string', - nullable: true, optional: false, - }, - bannerUrl: { - type: 'string', - format: 'url', - nullable: true, optional: false, - }, - notesCount: { - type: 'number', - nullable: false, optional: false, - }, - usersCount: { - type: 'number', - nullable: false, optional: false, - }, - isFollowing: { - type: 'boolean', - optional: true, nullable: false, - }, - userId: { - type: 'string', - nullable: true, optional: false, - format: 'id', - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/clip.ts b/packages/backend/src/models/schema/clip.ts deleted file mode 100644 index f0ee2ce0c4..0000000000 --- a/packages/backend/src/models/schema/clip.ts +++ /dev/null @@ -1,38 +0,0 @@ -export const packedClipSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - name: { - type: 'string', - optional: false, nullable: false, - }, - description: { - type: 'string', - optional: false, nullable: true, - }, - isPublic: { - type: 'boolean', - optional: false, nullable: false, - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/drive-file.ts b/packages/backend/src/models/schema/drive-file.ts deleted file mode 100644 index 4359076612..0000000000 --- a/packages/backend/src/models/schema/drive-file.ts +++ /dev/null @@ -1,107 +0,0 @@ -export const packedDriveFileSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - name: { - type: 'string', - optional: false, nullable: false, - example: 'lenna.jpg', - }, - type: { - type: 'string', - optional: false, nullable: false, - example: 'image/jpeg', - }, - md5: { - type: 'string', - optional: false, nullable: false, - format: 'md5', - example: '15eca7fba0480996e2245f5185bf39f2', - }, - size: { - type: 'number', - optional: false, nullable: false, - example: 51469, - }, - isSensitive: { - type: 'boolean', - optional: false, nullable: false, - }, - blurhash: { - type: 'string', - optional: false, nullable: true, - }, - properties: { - type: 'object', - optional: false, nullable: false, - properties: { - width: { - type: 'number', - optional: true, nullable: false, - example: 1280, - }, - height: { - type: 'number', - optional: true, nullable: false, - example: 720, - }, - orientation: { - type: 'number', - optional: true, nullable: false, - example: 8, - }, - avgColor: { - type: 'string', - optional: true, nullable: false, - example: 'rgb(40,65,87)', - }, - }, - }, - url: { - type: 'string', - optional: false, nullable: true, - format: 'url', - }, - thumbnailUrl: { - type: 'string', - optional: false, nullable: true, - format: 'url', - }, - comment: { - type: 'string', - optional: false, nullable: true, - }, - folderId: { - type: 'string', - optional: false, nullable: true, - format: 'id', - example: 'xxxxxxxxxx', - }, - folder: { - type: 'object', - optional: true, nullable: true, - ref: 'DriveFolder', - }, - userId: { - type: 'string', - optional: false, nullable: true, - format: 'id', - example: 'xxxxxxxxxx', - }, - user: { - type: 'object', - optional: true, nullable: true, - ref: 'UserLite', - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/drive-folder.ts b/packages/backend/src/models/schema/drive-folder.ts deleted file mode 100644 index 88cb8ab4a2..0000000000 --- a/packages/backend/src/models/schema/drive-folder.ts +++ /dev/null @@ -1,39 +0,0 @@ -export const packedDriveFolderSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - name: { - type: 'string', - optional: false, nullable: false, - }, - foldersCount: { - type: 'number', - optional: true, nullable: false, - }, - filesCount: { - type: 'number', - optional: true, nullable: false, - }, - parentId: { - type: 'string', - optional: false, nullable: true, - format: 'id', - example: 'xxxxxxxxxx', - }, - parent: { - type: 'object', - optional: true, nullable: true, - ref: 'DriveFolder', - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/emoji.ts b/packages/backend/src/models/schema/emoji.ts deleted file mode 100644 index c00c3dac1d..0000000000 --- a/packages/backend/src/models/schema/emoji.ts +++ /dev/null @@ -1,63 +0,0 @@ -export const packedEmojiSimpleSchema = { - type: 'object', - properties: { - aliases: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - }, - name: { - type: 'string', - optional: false, nullable: false, - }, - category: { - type: 'string', - optional: false, nullable: true, - }, - url: { - type: 'string', - optional: false, nullable: false, - }, - }, -} as const; - -export const packedEmojiDetailedSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - aliases: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - }, - name: { - type: 'string', - optional: false, nullable: false, - }, - category: { - type: 'string', - optional: false, nullable: true, - }, - host: { - type: 'string', - optional: false, nullable: true, - description: 'The local host is represented with `null`.', - }, - url: { - type: 'string', - optional: false, nullable: false, - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/federation-instance.ts b/packages/backend/src/models/schema/federation-instance.ts deleted file mode 100644 index 42d93dfac9..0000000000 --- a/packages/backend/src/models/schema/federation-instance.ts +++ /dev/null @@ -1,97 +0,0 @@ -export const packedFederationInstanceSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - firstRetrievedAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - host: { - type: 'string', - optional: false, nullable: false, - example: 'misskey.example.com', - }, - usersCount: { - type: 'number', - optional: false, nullable: false, - }, - notesCount: { - type: 'number', - optional: false, nullable: false, - }, - followingCount: { - type: 'number', - optional: false, nullable: false, - }, - followersCount: { - type: 'number', - optional: false, nullable: false, - }, - isNotResponding: { - type: 'boolean', - optional: false, nullable: false, - }, - isSuspended: { - type: 'boolean', - optional: false, nullable: false, - }, - isBlocked: { - type: 'boolean', - optional: false, nullable: false, - }, - softwareName: { - type: 'string', - optional: false, nullable: true, - example: 'misskey', - }, - softwareVersion: { - type: 'string', - optional: false, nullable: true, - }, - openRegistrations: { - type: 'boolean', - optional: false, nullable: true, - example: true, - }, - name: { - type: 'string', - optional: false, nullable: true, - }, - description: { - type: 'string', - optional: false, nullable: true, - }, - maintainerName: { - type: 'string', - optional: false, nullable: true, - }, - maintainerEmail: { - type: 'string', - optional: false, nullable: true, - }, - iconUrl: { - type: 'string', - optional: false, nullable: true, - format: 'url', - }, - faviconUrl: { - type: 'string', - optional: false, nullable: true, - format: 'url', - }, - themeColor: { - type: 'string', - optional: false, nullable: true, - }, - infoUpdatedAt: { - type: 'string', - optional: false, nullable: true, - format: 'date-time', - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/flash.ts b/packages/backend/src/models/schema/flash.ts deleted file mode 100644 index 8471a138ec..0000000000 --- a/packages/backend/src/models/schema/flash.ts +++ /dev/null @@ -1,51 +0,0 @@ -export const packedFlashSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - updatedAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - title: { - type: 'string', - optional: false, nullable: false, - }, - summary: { - type: 'string', - optional: false, nullable: false, - }, - script: { - type: 'string', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - likedCount: { - type: 'number', - optional: false, nullable: true, - }, - isLiked: { - type: 'boolean', - optional: true, nullable: false, - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/following.ts b/packages/backend/src/models/schema/following.ts deleted file mode 100644 index 2bcffbfc4d..0000000000 --- a/packages/backend/src/models/schema/following.ts +++ /dev/null @@ -1,36 +0,0 @@ -export const packedFollowingSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - followeeId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - followee: { - type: 'object', - optional: true, nullable: false, - ref: 'UserDetailed', - }, - followerId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - follower: { - type: 'object', - optional: true, nullable: false, - ref: 'UserDetailed', - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/gallery-post.ts b/packages/backend/src/models/schema/gallery-post.ts deleted file mode 100644 index fc503d4a64..0000000000 --- a/packages/backend/src/models/schema/gallery-post.ts +++ /dev/null @@ -1,69 +0,0 @@ -export const packedGalleryPostSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - updatedAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - title: { - type: 'string', - optional: false, nullable: false, - }, - description: { - type: 'string', - optional: false, nullable: true, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - 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, - }, - }, - isSensitive: { - type: 'boolean', - optional: false, nullable: false, - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/hashtag.ts b/packages/backend/src/models/schema/hashtag.ts deleted file mode 100644 index 98f8827640..0000000000 --- a/packages/backend/src/models/schema/hashtag.ts +++ /dev/null @@ -1,34 +0,0 @@ -export const packedHashtagSchema = { - type: 'object', - properties: { - tag: { - type: 'string', - optional: false, nullable: false, - example: 'misskey', - }, - mentionedUsersCount: { - type: 'number', - optional: false, nullable: false, - }, - mentionedLocalUsersCount: { - type: 'number', - optional: false, nullable: false, - }, - mentionedRemoteUsersCount: { - type: 'number', - optional: false, nullable: false, - }, - attachedUsersCount: { - type: 'number', - optional: false, nullable: false, - }, - attachedLocalUsersCount: { - type: 'number', - optional: false, nullable: false, - }, - attachedRemoteUsersCount: { - type: 'number', - optional: false, nullable: false, - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/muting.ts b/packages/backend/src/models/schema/muting.ts deleted file mode 100644 index 3ab99e17e7..0000000000 --- a/packages/backend/src/models/schema/muting.ts +++ /dev/null @@ -1,31 +0,0 @@ -export const packedMutingSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - expiresAt: { - type: 'string', - optional: false, nullable: true, - format: 'date-time', - }, - muteeId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - mutee: { - type: 'object', - optional: false, nullable: false, - ref: 'UserDetailed', - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/note-favorite.ts b/packages/backend/src/models/schema/note-favorite.ts deleted file mode 100644 index d133f7367d..0000000000 --- a/packages/backend/src/models/schema/note-favorite.ts +++ /dev/null @@ -1,26 +0,0 @@ -export const packedNoteFavoriteSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - note: { - type: 'object', - optional: false, nullable: false, - ref: 'Note', - }, - noteId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/note-reaction.ts b/packages/backend/src/models/schema/note-reaction.ts deleted file mode 100644 index 0d8fc5449b..0000000000 --- a/packages/backend/src/models/schema/note-reaction.ts +++ /dev/null @@ -1,25 +0,0 @@ -export const packedNoteReactionSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - user: { - type: 'object', - optional: false, nullable: false, - ref: 'UserLite', - }, - type: { - type: 'string', - optional: false, nullable: false, - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/note.ts b/packages/backend/src/models/schema/note.ts deleted file mode 100644 index 58ef425dcd..0000000000 --- a/packages/backend/src/models/schema/note.ts +++ /dev/null @@ -1,174 +0,0 @@ -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; diff --git a/packages/backend/src/models/schema/notification.ts b/packages/backend/src/models/schema/notification.ts deleted file mode 100644 index d3f2405cdd..0000000000 --- a/packages/backend/src/models/schema/notification.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { notificationTypes } from '@/types.js'; - -export const packedNotificationSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - isRead: { - type: 'boolean', - optional: false, nullable: false, - }, - type: { - type: 'string', - optional: false, nullable: false, - enum: [...notificationTypes], - }, - user: { - type: 'object', - ref: 'UserLite', - optional: true, nullable: true, - }, - userId: { - type: 'string', - optional: true, nullable: true, - format: 'id', - }, - note: { - type: 'object', - ref: 'Note', - optional: true, nullable: true, - }, - reaction: { - type: 'string', - optional: true, nullable: true, - }, - choice: { - type: 'number', - optional: true, nullable: true, - }, - invitation: { - type: 'object', - optional: true, nullable: true, - }, - body: { - type: 'string', - optional: true, nullable: true, - }, - header: { - type: 'string', - optional: true, nullable: true, - }, - icon: { - type: 'string', - optional: true, nullable: true, - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/page.ts b/packages/backend/src/models/schema/page.ts deleted file mode 100644 index 55ba3ce7f7..0000000000 --- a/packages/backend/src/models/schema/page.ts +++ /dev/null @@ -1,51 +0,0 @@ -export const packedPageSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - updatedAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - title: { - type: 'string', - optional: false, nullable: false, - }, - name: { - type: 'string', - optional: false, nullable: false, - }, - summary: { - type: 'string', - optional: false, nullable: true, - }, - content: { - type: 'array', - optional: false, nullable: false, - }, - variables: { - type: 'array', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/queue.ts b/packages/backend/src/models/schema/queue.ts deleted file mode 100644 index 7ceeda26af..0000000000 --- a/packages/backend/src/models/schema/queue.ts +++ /dev/null @@ -1,25 +0,0 @@ -export const packedQueueCountSchema = { - type: 'object', - properties: { - waiting: { - type: 'number', - optional: false, nullable: false, - }, - active: { - type: 'number', - optional: false, nullable: false, - }, - completed: { - type: 'number', - optional: false, nullable: false, - }, - failed: { - type: 'number', - optional: false, nullable: false, - }, - delayed: { - type: 'number', - optional: false, nullable: false, - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/renote-muting.ts b/packages/backend/src/models/schema/renote-muting.ts deleted file mode 100644 index 69ed8510da..0000000000 --- a/packages/backend/src/models/schema/renote-muting.ts +++ /dev/null @@ -1,26 +0,0 @@ -export const packedRenoteMutingSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - muteeId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - mutee: { - type: 'object', - optional: false, nullable: false, - ref: 'UserDetailed', - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/user-list.ts b/packages/backend/src/models/schema/user-list.ts deleted file mode 100644 index 3ba5dc4a8a..0000000000 --- a/packages/backend/src/models/schema/user-list.ts +++ /dev/null @@ -1,29 +0,0 @@ -export const packedUserListSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - name: { - type: 'string', - optional: false, nullable: false, - }, - userIds: { - type: 'array', - nullable: false, optional: true, - items: { - type: 'string', - nullable: false, optional: false, - format: 'id', - }, - }, - }, -} as const; diff --git a/packages/backend/src/models/schema/user.ts b/packages/backend/src/models/schema/user.ts deleted file mode 100644 index 8c61ee1f5f..0000000000 --- a/packages/backend/src/models/schema/user.ts +++ /dev/null @@ -1,439 +0,0 @@ -export const packedUserLiteSchema = { - type: 'object', - properties: { - id: { - type: 'string', - nullable: false, optional: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - name: { - type: 'string', - nullable: true, optional: false, - example: '藍', - }, - username: { - type: 'string', - nullable: false, optional: false, - example: 'ai', - }, - host: { - type: 'string', - nullable: true, optional: false, - example: 'misskey.example.com', - description: 'The local host is represented with `null`.', - }, - avatarUrl: { - type: 'string', - format: 'url', - nullable: true, optional: false, - }, - avatarBlurhash: { - type: 'any', - nullable: true, optional: false, - }, - isAdmin: { - type: 'boolean', - nullable: false, optional: true, - default: false, - }, - isModerator: { - type: 'boolean', - nullable: false, optional: true, - default: false, - }, - isBot: { - type: 'boolean', - nullable: false, optional: true, - }, - isCat: { - type: 'boolean', - nullable: false, optional: true, - }, - onlineStatus: { - type: 'string', - format: 'url', - nullable: true, optional: false, - enum: ['unknown', 'online', 'active', 'offline'], - }, - }, -} as const; - -export const packedUserDetailedNotMeOnlySchema = { - type: 'object', - properties: { - url: { - type: 'string', - format: 'url', - nullable: true, optional: false, - }, - uri: { - type: 'string', - format: 'uri', - nullable: true, optional: false, - }, - createdAt: { - type: 'string', - nullable: false, optional: false, - format: 'date-time', - }, - updatedAt: { - type: 'string', - nullable: true, optional: false, - format: 'date-time', - }, - lastFetchedAt: { - type: 'string', - nullable: true, optional: false, - format: 'date-time', - }, - bannerUrl: { - type: 'string', - format: 'url', - nullable: true, optional: false, - }, - bannerBlurhash: { - type: 'any', - nullable: true, optional: false, - }, - isLocked: { - type: 'boolean', - nullable: false, optional: false, - }, - isSilenced: { - type: 'boolean', - nullable: false, optional: false, - }, - isSuspended: { - type: 'boolean', - nullable: false, optional: false, - example: false, - }, - description: { - type: 'string', - nullable: true, optional: false, - example: 'Hi masters, I am Ai!', - }, - location: { - type: 'string', - nullable: true, optional: false, - }, - birthday: { - type: 'string', - nullable: true, optional: false, - example: '2018-03-12', - }, - lang: { - type: 'string', - nullable: true, optional: false, - example: 'ja-JP', - }, - fields: { - type: 'array', - nullable: false, optional: false, - items: { - type: 'object', - nullable: false, optional: false, - properties: { - name: { - type: 'string', - nullable: false, optional: false, - }, - value: { - type: 'string', - nullable: false, optional: false, - }, - }, - maxLength: 4, - }, - }, - followersCount: { - type: 'number', - nullable: false, optional: false, - }, - followingCount: { - type: 'number', - nullable: false, optional: false, - }, - notesCount: { - type: 'number', - nullable: false, optional: false, - }, - pinnedNoteIds: { - type: 'array', - nullable: false, optional: false, - items: { - type: 'string', - nullable: false, optional: false, - format: 'id', - }, - }, - pinnedNotes: { - type: 'array', - nullable: false, optional: false, - items: { - type: 'object', - nullable: false, optional: false, - ref: 'Note', - }, - }, - pinnedPageId: { - type: 'string', - nullable: true, optional: false, - }, - pinnedPage: { - type: 'object', - nullable: true, optional: false, - ref: 'Page', - }, - publicReactions: { - type: 'boolean', - nullable: false, optional: false, - }, - twoFactorEnabled: { - type: 'boolean', - nullable: false, optional: false, - default: false, - }, - usePasswordLessLogin: { - type: 'boolean', - nullable: false, optional: false, - default: false, - }, - securityKeys: { - type: 'boolean', - nullable: false, optional: false, - default: false, - }, - //#region relations - isFollowing: { - type: 'boolean', - nullable: false, optional: true, - }, - isFollowed: { - type: 'boolean', - nullable: false, optional: true, - }, - hasPendingFollowRequestFromYou: { - type: 'boolean', - nullable: false, optional: true, - }, - hasPendingFollowRequestToYou: { - type: 'boolean', - nullable: false, optional: true, - }, - isBlocking: { - type: 'boolean', - nullable: false, optional: true, - }, - isBlocked: { - type: 'boolean', - nullable: false, optional: true, - }, - isMuted: { - type: 'boolean', - nullable: false, optional: true, - }, - isRenoteMuted: { - type: 'boolean', - nullable: false, optional: true, - }, - //#endregion - }, -} as const; - -export const packedMeDetailedOnlySchema = { - type: 'object', - properties: { - avatarId: { - type: 'string', - nullable: true, optional: false, - format: 'id', - }, - bannerId: { - type: 'string', - nullable: true, optional: false, - format: 'id', - }, - injectFeaturedNote: { - type: 'boolean', - nullable: true, optional: false, - }, - receiveAnnouncementEmail: { - type: 'boolean', - nullable: true, optional: false, - }, - alwaysMarkNsfw: { - type: 'boolean', - nullable: true, optional: false, - }, - autoSensitive: { - type: 'boolean', - nullable: true, optional: false, - }, - carefulBot: { - type: 'boolean', - nullable: true, optional: false, - }, - autoAcceptFollowed: { - type: 'boolean', - nullable: true, optional: false, - }, - noCrawle: { - type: 'boolean', - nullable: true, optional: false, - }, - isExplorable: { - type: 'boolean', - nullable: false, optional: false, - }, - isDeleted: { - type: 'boolean', - nullable: false, optional: false, - }, - hideOnlineStatus: { - type: 'boolean', - nullable: false, optional: false, - }, - hasUnreadSpecifiedNotes: { - type: 'boolean', - nullable: false, optional: false, - }, - hasUnreadMentions: { - type: 'boolean', - nullable: false, optional: false, - }, - hasUnreadAnnouncement: { - type: 'boolean', - nullable: false, optional: false, - }, - hasUnreadAntenna: { - type: 'boolean', - nullable: false, optional: false, - }, - hasUnreadChannel: { - type: 'boolean', - nullable: false, optional: false, - }, - hasUnreadNotification: { - type: 'boolean', - nullable: false, optional: false, - }, - hasPendingReceivedFollowRequest: { - type: 'boolean', - nullable: false, optional: false, - }, - mutedWords: { - type: 'array', - nullable: false, optional: false, - items: { - type: 'array', - nullable: false, optional: false, - items: { - type: 'string', - nullable: false, optional: false, - }, - }, - }, - mutedInstances: { - type: 'array', - nullable: true, optional: false, - items: { - type: 'string', - nullable: false, optional: false, - }, - }, - mutingNotificationTypes: { - type: 'array', - nullable: true, optional: false, - items: { - type: 'string', - nullable: false, optional: false, - }, - }, - emailNotificationTypes: { - type: 'array', - nullable: true, optional: false, - items: { - type: 'string', - nullable: false, optional: false, - }, - }, - //#region secrets - email: { - type: 'string', - nullable: true, optional: true, - }, - emailVerified: { - type: 'boolean', - nullable: true, optional: true, - }, - securityKeysList: { - type: 'array', - nullable: false, optional: true, - items: { - type: 'object', - nullable: false, optional: false, - }, - }, - //#endregion - }, -} as const; - -export const packedUserDetailedNotMeSchema = { - type: 'object', - allOf: [ - { - type: 'object', - ref: 'UserLite', - }, - { - type: 'object', - ref: 'UserDetailedNotMeOnly', - }, - ], -} as const; - -export const packedMeDetailedSchema = { - type: 'object', - allOf: [ - { - type: 'object', - ref: 'UserLite', - }, - { - type: 'object', - ref: 'UserDetailedNotMeOnly', - }, - { - type: 'object', - ref: 'MeDetailedOnly', - }, - ], -} as const; - -export const packedUserDetailedSchema = { - oneOf: [ - { - type: 'object', - ref: 'UserDetailedNotMe', - }, - { - type: 'object', - ref: 'MeDetailed', - }, - ], -} as const; - -export const packedUserSchema = { - oneOf: [ - { - type: 'object', - ref: 'UserLite', - }, - { - type: 'object', - ref: 'UserDetailed', - }, - ], -} as const; -- cgit v1.2.3-freya