This commit is contained in:
syuilo
2021-12-09 23:58:30 +09:00
parent 0abe2dfee0
commit c69b72e199
573 changed files with 3318 additions and 3318 deletions

View File

@ -9,7 +9,7 @@ export class AbuseUserReport {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the AbuseUserReport.'
comment: 'The created date of the AbuseUserReport.',
})
public createdAt: Date;
@ -18,7 +18,7 @@ export class AbuseUserReport {
public targetUserId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public targetUser: User | null;
@ -28,26 +28,26 @@ export class AbuseUserReport {
public reporterId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public reporter: User | null;
@Column({
...id(),
nullable: true
nullable: true,
})
public assigneeId: User['id'] | null;
@ManyToOne(type => User, {
onDelete: 'SET NULL'
onDelete: 'SET NULL',
})
@JoinColumn()
public assignee: User | null;
@Index()
@Column('boolean', {
default: false
default: false,
})
public resolved: boolean;
@ -60,14 +60,14 @@ export class AbuseUserReport {
@Index()
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public targetUserHost: string | null;
@Index()
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public reporterHost: string | null;
//#endregion

View File

@ -9,7 +9,7 @@ export class AccessToken {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the AccessToken.'
comment: 'The created date of the AccessToken.',
})
public createdAt: Date;
@ -21,7 +21,7 @@ export class AccessToken {
@Index()
@Column('varchar', {
length: 128
length: 128,
})
public token: string;
@ -29,13 +29,13 @@ export class AccessToken {
@Column('varchar', {
length: 128,
nullable: true,
default: null
default: null,
})
public session: string | null;
@Index()
@Column('varchar', {
length: 128
length: 128,
})
public hash: string;
@ -44,7 +44,7 @@ export class AccessToken {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -52,12 +52,12 @@ export class AccessToken {
@Column({
...id(),
nullable: true,
default: null
default: null,
})
public appId: App['id'] | null;
@ManyToOne(type => App, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public app: App | null;
@ -65,32 +65,32 @@ export class AccessToken {
@Column('varchar', {
length: 128,
nullable: true,
default: null
default: null,
})
public name: string | null;
@Column('varchar', {
length: 512,
nullable: true,
default: null
default: null,
})
public description: string | null;
@Column('varchar', {
length: 512,
nullable: true,
default: null
default: null,
})
public iconUrl: string | null;
@Column('varchar', {
length: 64, array: true,
default: '{}'
default: '{}',
})
public permission: string[];
@Column('boolean', {
default: false
default: false,
})
public fetched: boolean;
}

View File

@ -8,44 +8,44 @@ export class Ad {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the Ad.'
comment: 'The created date of the Ad.',
})
public createdAt: Date;
@Index()
@Column('timestamp with time zone', {
comment: 'The expired date of the Ad.'
comment: 'The expired date of the Ad.',
})
public expiresAt: Date;
@Column('varchar', {
length: 32, nullable: false
length: 32, nullable: false,
})
public place: string;
// 今は使われていないが将来的に活用される可能性はある
@Column('varchar', {
length: 32, nullable: false
length: 32, nullable: false,
})
public priority: string;
@Column('integer', {
default: 1, nullable: false
default: 1, nullable: false,
})
public ratio: number;
@Column('varchar', {
length: 1024, nullable: false
length: 1024, nullable: false,
})
public url: string;
@Column('varchar', {
length: 1024, nullable: false
length: 1024, nullable: false,
})
public imageUrl: string;
@Column('varchar', {
length: 8192, nullable: false
length: 8192, nullable: false,
})
public memo: string;

View File

@ -10,7 +10,7 @@ export class AnnouncementRead {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the AnnouncementRead.'
comment: 'The created date of the AnnouncementRead.',
})
public createdAt: Date;
@ -19,7 +19,7 @@ export class AnnouncementRead {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -29,7 +29,7 @@ export class AnnouncementRead {
public announcementId: Announcement['id'];
@ManyToOne(type => Announcement, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public announcement: Announcement | null;

View File

@ -8,28 +8,28 @@ export class Announcement {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the Announcement.'
comment: 'The created date of the Announcement.',
})
public createdAt: Date;
@Column('timestamp with time zone', {
comment: 'The updated date of the Announcement.',
nullable: true
nullable: true,
})
public updatedAt: Date | null;
@Column('varchar', {
length: 8192, nullable: false
length: 8192, nullable: false,
})
public text: string;
@Column('varchar', {
length: 256, nullable: false
length: 256, nullable: false,
})
public title: string;
@Column('varchar', {
length: 1024, nullable: true
length: 1024, nullable: true,
})
public imageUrl: string | null;

View File

@ -12,12 +12,12 @@ export class AntennaNote {
@Index()
@Column({
...id(),
comment: 'The note ID.'
comment: 'The note ID.',
})
public noteId: Note['id'];
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;
@ -25,19 +25,19 @@ export class AntennaNote {
@Index()
@Column({
...id(),
comment: 'The antenna ID.'
comment: 'The antenna ID.',
})
public antennaId: Antenna['id'];
@ManyToOne(type => Antenna, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public antenna: Antenna | null;
@Index()
@Column('boolean', {
default: false
default: false,
})
public read: boolean;
}

View File

@ -10,26 +10,26 @@ export class Antenna {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the Antenna.'
comment: 'The created date of the Antenna.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The owner ID.'
comment: 'The owner ID.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@Column('varchar', {
length: 128,
comment: 'The name of the Antenna.'
comment: 'The name of the Antenna.',
})
public name: string;
@ -38,51 +38,51 @@ export class Antenna {
@Column({
...id(),
nullable: true
nullable: true,
})
public userListId: UserList['id'] | null;
@ManyToOne(type => UserList, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public userList: UserList | null;
@Column({
...id(),
nullable: true
nullable: true,
})
public userGroupJoiningId: UserGroupJoining['id'] | null;
@ManyToOne(type => UserGroupJoining, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public userGroupJoining: UserGroupJoining | null;
@Column('varchar', {
length: 1024, array: true,
default: '{}'
default: '{}',
})
public users: string[];
@Column('jsonb', {
default: []
default: [],
})
public keywords: string[][];
@Column('jsonb', {
default: []
default: [],
})
public excludeKeywords: string[][];
@Column('boolean', {
default: false
default: false,
})
public caseSensitive: boolean;
@Column('boolean', {
default: false
default: false,
})
public withReplies: boolean;

View File

@ -9,7 +9,7 @@ export class App {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the App.'
comment: 'The created date of the App.',
})
public createdAt: Date;
@ -17,7 +17,7 @@ export class App {
@Column({
...id(),
nullable: true,
comment: 'The owner ID.'
comment: 'The owner ID.',
})
public userId: User['id'] | null;
@ -30,31 +30,31 @@ export class App {
@Index()
@Column('varchar', {
length: 64,
comment: 'The secret key of the App.'
comment: 'The secret key of the App.',
})
public secret: string;
@Column('varchar', {
length: 128,
comment: 'The name of the App.'
comment: 'The name of the App.',
})
public name: string;
@Column('varchar', {
length: 512,
comment: 'The description of the App.'
comment: 'The description of the App.',
})
public description: string;
@Column('varchar', {
length: 64, array: true,
comment: 'The permission of the App.'
comment: 'The permission of the App.',
})
public permission: string[];
@Column('varchar', {
length: 512, nullable: true,
comment: 'The callbackUrl of the App.'
comment: 'The callbackUrl of the App.',
})
public callbackUrl: string | null;
}

View File

@ -12,7 +12,7 @@ export class AttestationChallenge {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -20,19 +20,19 @@ export class AttestationChallenge {
@Index()
@Column('varchar', {
length: 64,
comment: 'Hex-encoded sha256 hash of the challenge.'
comment: 'Hex-encoded sha256 hash of the challenge.',
})
public challenge: string;
@Column('timestamp with time zone', {
comment: 'The date challenge was created for expiry purposes.'
comment: 'The date challenge was created for expiry purposes.',
})
public createdAt: Date;
@Column('boolean', {
comment:
'Indicates that the challenge is only for registration purposes if true to prevent the challenge for being used as authentication.',
default: false
default: false,
})
public registrationChallenge: boolean;

View File

@ -9,25 +9,25 @@ export class AuthSession {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the AuthSession.'
comment: 'The created date of the AuthSession.',
})
public createdAt: Date;
@Index()
@Column('varchar', {
length: 128
length: 128,
})
public token: string;
@Column({
...id(),
nullable: true
nullable: true,
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE',
nullable: true
nullable: true,
})
@JoinColumn()
public user: User | null;
@ -36,7 +36,7 @@ export class AuthSession {
public appId: App['id'];
@ManyToOne(type => App, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public app: App | null;

View File

@ -10,19 +10,19 @@ export class Blocking {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the Blocking.'
comment: 'The created date of the Blocking.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The blockee user ID.'
comment: 'The blockee user ID.',
})
public blockeeId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public blockee: User | null;
@ -30,12 +30,12 @@ export class Blocking {
@Index()
@Column({
...id(),
comment: 'The blocker user ID.'
comment: 'The blocker user ID.',
})
public blockerId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public blocker: User | null;

View File

@ -11,19 +11,19 @@ export class ChannelFollowing {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the ChannelFollowing.'
comment: 'The created date of the ChannelFollowing.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The followee channel ID.'
comment: 'The followee channel ID.',
})
public followeeId: Channel['id'];
@ManyToOne(type => Channel, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public followee: Channel | null;
@ -31,12 +31,12 @@ export class ChannelFollowing {
@Index()
@Column({
...id(),
comment: 'The follower user ID.'
comment: 'The follower user ID.',
})
public followerId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public follower: User | null;

View File

@ -10,7 +10,7 @@ export class ChannelNotePining {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the ChannelNotePining.'
comment: 'The created date of the ChannelNotePining.',
})
public createdAt: Date;
@ -19,7 +19,7 @@ export class ChannelNotePining {
public channelId: Channel['id'];
@ManyToOne(type => Channel, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public channel: Channel | null;
@ -28,7 +28,7 @@ export class ChannelNotePining {
public noteId: Note['id'];
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;

View File

@ -10,13 +10,13 @@ export class Channel {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the Channel.'
comment: 'The created date of the Channel.',
})
public createdAt: Date;
@Index()
@Column('timestamp with time zone', {
nullable: true
nullable: true,
})
public lastNotedAt: Date | null;
@ -24,37 +24,37 @@ export class Channel {
@Column({
...id(),
nullable: true,
comment: 'The owner ID.'
comment: 'The owner ID.',
})
public userId: User['id'] | null;
@ManyToOne(type => User, {
onDelete: 'SET NULL'
onDelete: 'SET NULL',
})
@JoinColumn()
public user: User | null;
@Column('varchar', {
length: 128,
comment: 'The name of the Channel.'
comment: 'The name of the Channel.',
})
public name: string;
@Column('varchar', {
length: 2048, nullable: true,
comment: 'The description of the Channel.'
comment: 'The description of the Channel.',
})
public description: string | null;
@Column({
...id(),
nullable: true,
comment: 'The ID of banner Channel.'
comment: 'The ID of banner Channel.',
})
public bannerId: DriveFile['id'] | null;
@ManyToOne(type => DriveFile, {
onDelete: 'SET NULL'
onDelete: 'SET NULL',
})
@JoinColumn()
public banner: DriveFile | null;
@ -62,14 +62,14 @@ export class Channel {
@Index()
@Column('integer', {
default: 0,
comment: 'The count of notes.'
comment: 'The count of notes.',
})
public notesCount: number;
@Index()
@Column('integer', {
default: 0,
comment: 'The count of users.'
comment: 'The count of users.',
})
public usersCount: number;
}

View File

@ -12,12 +12,12 @@ export class ClipNote {
@Index()
@Column({
...id(),
comment: 'The note ID.'
comment: 'The note ID.',
})
public noteId: Note['id'];
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;
@ -25,12 +25,12 @@ export class ClipNote {
@Index()
@Column({
...id(),
comment: 'The clip ID.'
comment: 'The clip ID.',
})
public clipId: Clip['id'];
@ManyToOne(type => Clip, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public clip: Clip | null;

View File

@ -8,37 +8,37 @@ export class Clip {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the Clip.'
comment: 'The created date of the Clip.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The owner ID.'
comment: 'The owner ID.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@Column('varchar', {
length: 128,
comment: 'The name of the Clip.'
comment: 'The name of the Clip.',
})
public name: string;
@Column('boolean', {
default: false
default: false,
})
public isPublic: boolean;
@Column('varchar', {
length: 2048, nullable: true, default: null,
comment: 'The description of the Clip.'
comment: 'The description of the Clip.',
})
public description: string | null;
}

View File

@ -11,7 +11,7 @@ export class DriveFile {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the DriveFile.'
comment: 'The created date of the DriveFile.',
})
public createdAt: Date;
@ -19,12 +19,12 @@ export class DriveFile {
@Column({
...id(),
nullable: true,
comment: 'The owner ID.'
comment: 'The owner ID.',
})
public userId: User['id'] | null;
@ManyToOne(type => User, {
onDelete: 'SET NULL'
onDelete: 'SET NULL',
})
@JoinColumn()
public user: User | null;
@ -32,50 +32,50 @@ export class DriveFile {
@Index()
@Column('varchar', {
length: 128, nullable: true,
comment: 'The host of owner. It will be null if the user in local.'
comment: 'The host of owner. It will be null if the user in local.',
})
public userHost: string | null;
@Index()
@Column('varchar', {
length: 32,
comment: 'The MD5 hash of the DriveFile.'
comment: 'The MD5 hash of the DriveFile.',
})
public md5: string;
@Column('varchar', {
length: 256,
comment: 'The file name of the DriveFile.'
comment: 'The file name of the DriveFile.',
})
public name: string;
@Index()
@Column('varchar', {
length: 128,
comment: 'The content type (MIME) of the DriveFile.'
comment: 'The content type (MIME) of the DriveFile.',
})
public type: string;
@Column('integer', {
comment: 'The file size (bytes) of the DriveFile.'
comment: 'The file size (bytes) of the DriveFile.',
})
public size: number;
@Column('varchar', {
length: 512, nullable: true,
comment: 'The comment of the DriveFile.'
comment: 'The comment of the DriveFile.',
})
public comment: string | null;
@Column('varchar', {
length: 128, nullable: true,
comment: 'The BlurHash string.'
comment: 'The BlurHash string.',
})
public blurhash: string | null;
@Column('jsonb', {
default: {},
comment: 'The any properties of the DriveFile. For example, it includes image width/height.'
comment: 'The any properties of the DriveFile. For example, it includes image width/height.',
})
public properties: { width?: number; height?: number; orientation?: number; avgColor?: string };
@ -85,19 +85,19 @@ export class DriveFile {
@Column('varchar', {
length: 512,
comment: 'The URL of the DriveFile.'
comment: 'The URL of the DriveFile.',
})
public url: string;
@Column('varchar', {
length: 512, nullable: true,
comment: 'The URL of the thumbnail of the DriveFile.'
comment: 'The URL of the thumbnail of the DriveFile.',
})
public thumbnailUrl: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: 'The URL of the webpublic of the DriveFile.'
comment: 'The URL of the webpublic of the DriveFile.',
})
public webpublicUrl: string | null;
@ -122,7 +122,7 @@ export class DriveFile {
@Index()
@Column('varchar', {
length: 512, nullable: true,
comment: 'The URI of the DriveFile. it will be null when the DriveFile is local.'
comment: 'The URI of the DriveFile. it will be null when the DriveFile is local.',
})
public uri: string | null;
@ -135,12 +135,12 @@ export class DriveFile {
@Column({
...id(),
nullable: true,
comment: 'The parent folder ID. If null, it means the DriveFile is located in root.'
comment: 'The parent folder ID. If null, it means the DriveFile is located in root.',
})
public folderId: DriveFolder['id'] | null;
@ManyToOne(type => DriveFolder, {
onDelete: 'SET NULL'
onDelete: 'SET NULL',
})
@JoinColumn()
public folder: DriveFolder | null;
@ -148,7 +148,7 @@ export class DriveFile {
@Index()
@Column('boolean', {
default: false,
comment: 'Whether the DriveFile is NSFW.'
comment: 'Whether the DriveFile is NSFW.',
})
public isSensitive: boolean;
@ -158,7 +158,7 @@ export class DriveFile {
@Index()
@Column('boolean', {
default: false,
comment: 'Whether the DriveFile is direct link to remote server.'
comment: 'Whether the DriveFile is direct link to remote server.',
})
public isLink: boolean;
}

View File

@ -9,13 +9,13 @@ export class DriveFolder {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the DriveFolder.'
comment: 'The created date of the DriveFolder.',
})
public createdAt: Date;
@Column('varchar', {
length: 128,
comment: 'The name of the DriveFolder.'
comment: 'The name of the DriveFolder.',
})
public name: string;
@ -23,12 +23,12 @@ export class DriveFolder {
@Column({
...id(),
nullable: true,
comment: 'The owner ID.'
comment: 'The owner ID.',
})
public userId: User['id'] | null;
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -37,12 +37,12 @@ export class DriveFolder {
@Column({
...id(),
nullable: true,
comment: 'The parent folder ID. If null, it means the DriveFolder is located in root.'
comment: 'The parent folder ID. If null, it means the DriveFolder is located in root.',
})
public parentId: DriveFolder['id'] | null;
@ManyToOne(type => DriveFolder, {
onDelete: 'SET NULL'
onDelete: 'SET NULL',
})
@JoinColumn()
public parent: DriveFolder | null;

View File

@ -8,24 +8,24 @@ export class Emoji {
public id: string;
@Column('timestamp with time zone', {
nullable: true
nullable: true,
})
public updatedAt: Date | null;
@Index()
@Column('varchar', {
length: 128
length: 128,
})
public name: string;
@Index()
@Column('varchar', {
length: 128, nullable: true
length: 128, nullable: true,
})
public host: string | null;
@Column('varchar', {
length: 128, nullable: true
length: 128, nullable: true,
})
public category: string | null;
@ -35,17 +35,17 @@ export class Emoji {
public url: string;
@Column('varchar', {
length: 512, nullable: true
length: 512, nullable: true,
})
public uri: string | null;
@Column('varchar', {
length: 64, nullable: true
length: 64, nullable: true,
})
public type: string | null;
@Column('varchar', {
array: true, length: 128, default: '{}'
array: true, length: 128, default: '{}',
})
public aliases: string[];
}

View File

@ -9,19 +9,19 @@ export class FollowRequest {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the FollowRequest.'
comment: 'The created date of the FollowRequest.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The followee user ID.'
comment: 'The followee user ID.',
})
public followeeId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public followee: User | null;
@ -29,56 +29,56 @@ export class FollowRequest {
@Index()
@Column({
...id(),
comment: 'The follower user ID.'
comment: 'The follower user ID.',
})
public followerId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public follower: User | null;
@Column('varchar', {
length: 128, nullable: true,
comment: 'id of Follow Activity.'
comment: 'id of Follow Activity.',
})
public requestId: string | null;
//#region Denormalized fields
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public followerHost: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public followerInbox: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public followerSharedInbox: string | null;
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public followeeHost: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public followeeInbox: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public followeeSharedInbox: string | null;
//#endregion

View File

@ -10,19 +10,19 @@ export class Following {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the Following.'
comment: 'The created date of the Following.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The followee user ID.'
comment: 'The followee user ID.',
})
public followeeId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public followee: User | null;
@ -30,12 +30,12 @@ export class Following {
@Index()
@Column({
...id(),
comment: 'The follower user ID.'
comment: 'The follower user ID.',
})
public followerId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public follower: User | null;
@ -43,37 +43,37 @@ export class Following {
//#region Denormalized fields
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public followerHost: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public followerInbox: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public followerSharedInbox: string | null;
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public followeeHost: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public followeeInbox: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public followeeSharedInbox: string | null;
//#endregion

View File

@ -17,7 +17,7 @@ export class GalleryLike {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -26,7 +26,7 @@ export class GalleryLike {
public postId: GalleryPost['id'];
@ManyToOne(type => GalleryPost, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public post: GalleryPost | null;

View File

@ -10,13 +10,13 @@ export class GalleryPost {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the GalleryPost.'
comment: 'The created date of the GalleryPost.',
})
public createdAt: Date;
@Index()
@Column('timestamp with time zone', {
comment: 'The updated date of the GalleryPost.'
comment: 'The updated date of the GalleryPost.',
})
public updatedAt: Date;
@ -26,19 +26,19 @@ export class GalleryPost {
public title: string;
@Column('varchar', {
length: 2048, nullable: true
length: 2048, nullable: true,
})
public description: string | null;
@Index()
@Column({
...id(),
comment: 'The ID of author.'
comment: 'The ID of author.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -46,26 +46,26 @@ export class GalleryPost {
@Index()
@Column({
...id(),
array: true, default: '{}'
array: true, default: '{}',
})
public fileIds: DriveFile['id'][];
@Index()
@Column('boolean', {
default: false,
comment: 'Whether the post is sensitive.'
comment: 'Whether the post is sensitive.',
})
public isSensitive: boolean;
@Index()
@Column('integer', {
default: 0
default: 0,
})
public likedCount: number;
@Index()
@Column('varchar', {
length: 128, array: true, default: '{}'
length: 128, array: true, default: '{}',
})
public tags: string[];

View File

@ -9,13 +9,13 @@ export class ReversiGame {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the ReversiGame.'
comment: 'The created date of the ReversiGame.',
})
public createdAt: Date;
@Column('timestamp with time zone', {
nullable: true,
comment: 'The started date of the ReversiGame.'
comment: 'The started date of the ReversiGame.',
})
public startedAt: Date | null;
@ -23,7 +23,7 @@ export class ReversiGame {
public user1Id: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user1: User | null;
@ -32,7 +32,7 @@ export class ReversiGame {
public user2Id: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user2: User | null;
@ -69,13 +69,13 @@ export class ReversiGame {
@Column({
...id(),
nullable: true
nullable: true,
})
public winnerId: User['id'] | null;
@Column({
...id(),
nullable: true
nullable: true,
})
public surrendered: User['id'] | null;
@ -94,7 +94,7 @@ export class ReversiGame {
public map: string[];
@Column('varchar', {
length: 32
length: 32,
})
public bw: string;
@ -127,7 +127,7 @@ export class ReversiGame {
* ログのposを文字列としてすべて連結したもののCRC32値
*/
@Column('varchar', {
length: 32, nullable: true
length: 32, nullable: true,
})
public crc32: string | null;
}

View File

@ -9,7 +9,7 @@ export class ReversiMatching {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the ReversiMatching.'
comment: 'The created date of the ReversiMatching.',
})
public createdAt: Date;
@ -18,7 +18,7 @@ export class ReversiMatching {
public parentId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public parent: User | null;
@ -28,7 +28,7 @@ export class ReversiMatching {
public childId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public child: User | null;

View File

@ -9,7 +9,7 @@ export class Hashtag {
@Index({ unique: true })
@Column('varchar', {
length: 128
length: 128,
})
public name: string;
@ -21,7 +21,7 @@ export class Hashtag {
@Index()
@Column('integer', {
default: 0
default: 0,
})
public mentionedUsersCount: number;
@ -33,7 +33,7 @@ export class Hashtag {
@Index()
@Column('integer', {
default: 0
default: 0,
})
public mentionedLocalUsersCount: number;
@ -45,7 +45,7 @@ export class Hashtag {
@Index()
@Column('integer', {
default: 0
default: 0,
})
public mentionedRemoteUsersCount: number;
@ -57,7 +57,7 @@ export class Hashtag {
@Index()
@Column('integer', {
default: 0
default: 0,
})
public attachedUsersCount: number;
@ -69,7 +69,7 @@ export class Hashtag {
@Index()
@Column('integer', {
default: 0
default: 0,
})
public attachedLocalUsersCount: number;
@ -81,7 +81,7 @@ export class Hashtag {
@Index()
@Column('integer', {
default: 0
default: 0,
})
public attachedRemoteUsersCount: number;
}

View File

@ -11,7 +11,7 @@ export class Instance {
*/
@Index()
@Column('timestamp with time zone', {
comment: 'The caught date of the Instance.'
comment: 'The caught date of the Instance.',
})
public caughtAt: Date;
@ -21,7 +21,7 @@ export class Instance {
@Index({ unique: true })
@Column('varchar', {
length: 128,
comment: 'The host of the Instance.'
comment: 'The host of the Instance.',
})
public host: string;
@ -30,7 +30,7 @@ export class Instance {
*/
@Column('integer', {
default: 0,
comment: 'The count of the users of the Instance.'
comment: 'The count of the users of the Instance.',
})
public usersCount: number;
@ -39,7 +39,7 @@ export class Instance {
*/
@Column('integer', {
default: 0,
comment: 'The count of the notes of the Instance.'
comment: 'The count of the notes of the Instance.',
})
public notesCount: number;
@ -109,7 +109,7 @@ export class Instance {
* このインスタンスと不通かどうか
*/
@Column('boolean', {
default: false
default: false,
})
public isNotResponding: boolean;
@ -118,13 +118,13 @@ export class Instance {
*/
@Index()
@Column('boolean', {
default: false
default: false,
})
public isSuspended: boolean;
@Column('varchar', {
length: 64, nullable: true, default: null,
comment: 'The software of the Instance.'
comment: 'The software of the Instance.',
})
public softwareName: string | null;

View File

@ -11,19 +11,19 @@ export class MessagingMessage {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the MessagingMessage.'
comment: 'The created date of the MessagingMessage.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The sender user ID.'
comment: 'The sender user ID.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -31,12 +31,12 @@ export class MessagingMessage {
@Index()
@Column({
...id(), nullable: true,
comment: 'The recipient user ID.'
comment: 'The recipient user ID.',
})
public recipientId: User['id'] | null;
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public recipient: User | null;
@ -44,18 +44,18 @@ export class MessagingMessage {
@Index()
@Column({
...id(), nullable: true,
comment: 'The recipient group ID.'
comment: 'The recipient group ID.',
})
public groupId: UserGroup['id'] | null;
@ManyToOne(type => UserGroup, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public group: UserGroup | null;
@Column('varchar', {
length: 4096, nullable: true
length: 4096, nullable: true,
})
public text: string | null;
@ -71,7 +71,7 @@ export class MessagingMessage {
@Column({
...id(),
array: true, default: '{}'
array: true, default: '{}',
})
public reads: User['id'][];
@ -82,7 +82,7 @@ export class MessagingMessage {
public fileId: DriveFile['id'] | null;
@ManyToOne(type => DriveFile, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public file: DriveFile | null;

View File

@ -7,17 +7,17 @@ import { Clip } from './clip';
export class Meta {
@PrimaryColumn({
type: 'varchar',
length: 32
length: 32,
})
public id: string;
@Column('varchar', {
length: 128, nullable: true
length: 128, nullable: true,
})
public name: string | null;
@Column('varchar', {
length: 1024, nullable: true
length: 1024, nullable: true,
})
public description: string | null;
@ -25,7 +25,7 @@ export class Meta {
* メンテナの名前
*/
@Column('varchar', {
length: 128, nullable: true
length: 128, nullable: true,
})
public maintainerName: string | null;
@ -33,7 +33,7 @@ export class Meta {
* メンテナの連絡先
*/
@Column('varchar', {
length: 128, nullable: true
length: 128, nullable: true,
})
public maintainerEmail: string | null;
@ -58,27 +58,27 @@ export class Meta {
public useStarForReactionFallback: boolean;
@Column('varchar', {
length: 64, array: true, default: '{}'
length: 64, array: true, default: '{}',
})
public langs: string[];
@Column('varchar', {
length: 256, array: true, default: '{}'
length: 256, array: true, default: '{}',
})
public pinnedUsers: string[];
@Column('varchar', {
length: 256, array: true, default: '{}'
length: 256, array: true, default: '{}',
})
public hiddenTags: string[];
@Column('varchar', {
length: 256, array: true, default: '{}'
length: 256, array: true, default: '{}',
})
public blockedHosts: string[];
@Column('varchar', {
length: 512, array: true, default: '{"/featured", "/channels", "/explore", "/pages", "/about-misskey"}'
length: 512, array: true, default: '{"/featured", "/channels", "/explore", "/pages", "/about-misskey"}',
})
public pinnedPages: string[];
@ -91,38 +91,38 @@ export class Meta {
@Column('varchar', {
length: 512,
nullable: true,
default: '/assets/ai.png'
default: '/assets/ai.png',
})
public mascotImageUrl: string | null;
@Column('varchar', {
length: 512,
nullable: true
nullable: true,
})
public bannerUrl: string | null;
@Column('varchar', {
length: 512,
nullable: true
nullable: true,
})
public backgroundImageUrl: string | null;
@Column('varchar', {
length: 512,
nullable: true
nullable: true,
})
public logoImageUrl: string | null;
@Column('varchar', {
length: 512,
nullable: true,
default: 'https://xn--931a.moe/aiart/yubitun.png'
default: 'https://xn--931a.moe/aiart/yubitun.png',
})
public errorImageUrl: string | null;
@Column('varchar', {
length: 512,
nullable: true
nullable: true,
})
public iconUrl: string | null;
@ -143,7 +143,7 @@ export class Meta {
public proxyAccountId: User['id'] | null;
@ManyToOne(type => User, {
onDelete: 'SET NULL'
onDelete: 'SET NULL',
})
@JoinColumn()
public proxyAccount: User | null;
@ -160,13 +160,13 @@ export class Meta {
@Column('varchar', {
length: 64,
nullable: true
nullable: true,
})
public hcaptchaSiteKey: string | null;
@Column('varchar', {
length: 64,
nullable: true
nullable: true,
})
public hcaptchaSecretKey: string | null;
@ -177,37 +177,37 @@ export class Meta {
@Column('varchar', {
length: 64,
nullable: true
nullable: true,
})
public recaptchaSiteKey: string | null;
@Column('varchar', {
length: 64,
nullable: true
nullable: true,
})
public recaptchaSecretKey: string | null;
@Column('integer', {
default: 1024,
comment: 'Drive capacity of a local user (MB)'
comment: 'Drive capacity of a local user (MB)',
})
public localDriveCapacityMb: number;
@Column('integer', {
default: 32,
comment: 'Drive capacity of a remote user (MB)'
comment: 'Drive capacity of a remote user (MB)',
})
public remoteDriveCapacityMb: number;
@Column('integer', {
default: 500,
comment: 'Max allowed note text length in characters'
comment: 'Max allowed note text length in characters',
})
public maxNoteTextLength: number;
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public summalyProxy: string | null;
@ -218,7 +218,7 @@ export class Meta {
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public email: string | null;
@ -229,24 +229,24 @@ export class Meta {
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public smtpHost: string | null;
@Column('integer', {
nullable: true
nullable: true,
})
public smtpPort: number | null;
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public smtpUser: string | null;
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public smtpPass: string | null;
@ -257,13 +257,13 @@ export class Meta {
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public swPublicKey: string | null;
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public swPrivateKey: string | null;
@ -274,13 +274,13 @@ export class Meta {
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public twitterConsumerKey: string | null;
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public twitterConsumerSecret: string | null;
@ -291,13 +291,13 @@ export class Meta {
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public githubClientId: string | null;
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public githubClientSecret: string | null;
@ -308,19 +308,19 @@ export class Meta {
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public discordClientId: string | null;
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public discordClientSecret: string | null;
@Column('varchar', {
length: 128,
nullable: true
nullable: true,
})
public deeplAuthKey: string | null;
@ -331,21 +331,21 @@ export class Meta {
@Column('varchar', {
length: 512,
nullable: true
nullable: true,
})
public ToSUrl: string | null;
@Column('varchar', {
length: 512,
default: 'https://github.com/misskey-dev/misskey',
nullable: false
nullable: false,
})
public repositoryUrl: string;
@Column('varchar', {
length: 512,
default: 'https://github.com/misskey-dev/misskey/issues/new',
nullable: true
nullable: true,
})
public feedbackUrl: string | null;
@ -356,48 +356,48 @@ export class Meta {
@Column('varchar', {
length: 512,
nullable: true
nullable: true,
})
public objectStorageBucket: string | null;
@Column('varchar', {
length: 512,
nullable: true
nullable: true,
})
public objectStoragePrefix: string | null;
@Column('varchar', {
length: 512,
nullable: true
nullable: true,
})
public objectStorageBaseUrl: string | null;
@Column('varchar', {
length: 512,
nullable: true
nullable: true,
})
public objectStorageEndpoint: string | null;
@Column('varchar', {
length: 512,
nullable: true
nullable: true,
})
public objectStorageRegion: string | null;
@Column('varchar', {
length: 512,
nullable: true
nullable: true,
})
public objectStorageAccessKey: string | null;
@Column('varchar', {
length: 512,
nullable: true
nullable: true,
})
public objectStorageSecretKey: string | null;
@Column('integer', {
nullable: true
nullable: true,
})
public objectStoragePort: number | null;

View File

@ -8,7 +8,7 @@ export class ModerationLog {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the ModerationLog.'
comment: 'The created date of the ModerationLog.',
})
public createdAt: Date;
@ -17,7 +17,7 @@ export class ModerationLog {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;

View File

@ -13,12 +13,12 @@ export class MutedNote {
@Index()
@Column({
...id(),
comment: 'The note ID.'
comment: 'The note ID.',
})
public noteId: Note['id'];
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;
@ -26,12 +26,12 @@ export class MutedNote {
@Index()
@Column({
...id(),
comment: 'The user ID.'
comment: 'The user ID.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -42,7 +42,7 @@ export class MutedNote {
@Index()
@Column('enum', {
enum: mutedNoteReasons,
comment: 'The reason of the MutedNote.'
comment: 'The reason of the MutedNote.',
})
public reason: typeof mutedNoteReasons[number];
}

View File

@ -10,19 +10,19 @@ export class Muting {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the Muting.'
comment: 'The created date of the Muting.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The mutee user ID.'
comment: 'The mutee user ID.',
})
public muteeId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public mutee: User | null;
@ -30,12 +30,12 @@ export class Muting {
@Index()
@Column({
...id(),
comment: 'The muter user ID.'
comment: 'The muter user ID.',
})
public muterId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public muter: User | null;

View File

@ -10,7 +10,7 @@ export class NoteFavorite {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the NoteFavorite.'
comment: 'The created date of the NoteFavorite.',
})
public createdAt: Date;
@ -19,7 +19,7 @@ export class NoteFavorite {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -28,7 +28,7 @@ export class NoteFavorite {
public noteId: Note['id'];
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;

View File

@ -11,7 +11,7 @@ export class NoteReaction {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the NoteReaction.'
comment: 'The created date of the NoteReaction.',
})
public createdAt: Date;
@ -20,7 +20,7 @@ export class NoteReaction {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user?: User | null;
@ -30,7 +30,7 @@ export class NoteReaction {
public noteId: Note['id'];
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note?: Note | null;
@ -38,7 +38,7 @@ export class NoteReaction {
// TODO: 対象noteのuserIdを非正規化したい(「受け取ったリアクション一覧」のようなものを(JOIN無しで)実装したいため)
@Column('varchar', {
length: 260
length: 260,
})
public reaction: string;
}

View File

@ -20,7 +20,7 @@ export class NoteThreadMuting {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;

View File

@ -15,7 +15,7 @@ export class NoteUnread {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -25,7 +25,7 @@ export class NoteUnread {
public noteId: Note['id'];
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;
@ -48,7 +48,7 @@ export class NoteUnread {
@Index()
@Column({
...id(),
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public noteUserId: User['id'];
@ -56,7 +56,7 @@ export class NoteUnread {
@Column({
...id(),
nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public noteChannelId: Channel['id'] | null;
//#endregion

View File

@ -11,19 +11,19 @@ export class NoteWatching {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the NoteWatching.'
comment: 'The created date of the NoteWatching.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The watcher ID.'
comment: 'The watcher ID.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -31,12 +31,12 @@ export class NoteWatching {
@Index()
@Column({
...id(),
comment: 'The target Note ID.'
comment: 'The target Note ID.',
})
public noteId: Note['id'];
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;
@ -45,7 +45,7 @@ export class NoteWatching {
@Index()
@Column({
...id(),
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public noteUserId: Note['userId'];
//#endregion

View File

@ -15,7 +15,7 @@ export class Note {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the Note.'
comment: 'The created date of the Note.',
})
public createdAt: Date;
@ -23,12 +23,12 @@ export class Note {
@Column({
...id(),
nullable: true,
comment: 'The ID of reply target.'
comment: 'The ID of reply target.',
})
public replyId: Note['id'] | null;
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public reply: Note | null;
@ -37,67 +37,67 @@ export class Note {
@Column({
...id(),
nullable: true,
comment: 'The ID of renote target.'
comment: 'The ID of renote target.',
})
public renoteId: Note['id'] | null;
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public renote: Note | null;
@Index()
@Column('varchar', {
length: 256, nullable: true
length: 256, nullable: true,
})
public threadId: string | null;
@Column('varchar', {
length: 8192, nullable: true
length: 8192, nullable: true,
})
public text: string | null;
@Column('varchar', {
length: 256, nullable: true
length: 256, nullable: true,
})
public name: string | null;
@Column('varchar', {
length: 512, nullable: true
length: 512, nullable: true,
})
public cw: string | null;
@Index()
@Column({
...id(),
comment: 'The ID of author.'
comment: 'The ID of author.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@Column('boolean', {
default: false
default: false,
})
public localOnly: boolean;
@Column('smallint', {
default: 0
default: 0,
})
public renoteCount: number;
@Column('smallint', {
default: 0
default: 0,
})
public repliesCount: number;
@Column('jsonb', {
default: {}
default: {},
})
public reactions: Record<string, number>;
@ -113,66 +113,66 @@ export class Note {
@Index({ unique: true })
@Column('varchar', {
length: 512, nullable: true,
comment: 'The URI of a note. it will be null when the note is local.'
comment: 'The URI of a note. it will be null when the note is local.',
})
public uri: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: 'The human readable url of a note. it will be null when the note is local.'
comment: 'The human readable url of a note. it will be null when the note is local.',
})
public url: string | null;
@Column('integer', {
default: 0, select: false
default: 0, select: false,
})
public score: number;
@Index()
@Column({
...id(),
array: true, default: '{}'
array: true, default: '{}',
})
public fileIds: DriveFile['id'][];
@Index()
@Column('varchar', {
length: 256, array: true, default: '{}'
length: 256, array: true, default: '{}',
})
public attachedFileTypes: string[];
@Index()
@Column({
...id(),
array: true, default: '{}'
array: true, default: '{}',
})
public visibleUserIds: User['id'][];
@Index()
@Column({
...id(),
array: true, default: '{}'
array: true, default: '{}',
})
public mentions: User['id'][];
@Column('text', {
default: '[]'
default: '[]',
})
public mentionedRemoteUsers: string;
@Column('varchar', {
length: 128, array: true, default: '{}'
length: 128, array: true, default: '{}',
})
public emojis: string[];
@Index()
@Column('varchar', {
length: 128, array: true, default: '{}'
length: 128, array: true, default: '{}',
})
public tags: string[];
@Column('boolean', {
default: false
default: false,
})
public hasPoll: boolean;
@ -180,12 +180,12 @@ export class Note {
@Column({
...id(),
nullable: true, default: null,
comment: 'The ID of source channel.'
comment: 'The ID of source channel.',
})
public channelId: Channel['id'] | null;
@ManyToOne(type => Channel, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public channel: Channel | null;
@ -194,33 +194,33 @@ export class Note {
@Index()
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public userHost: string | null;
@Column({
...id(),
nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public replyUserId: User['id'] | null;
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public replyUserHost: string | null;
@Column({
...id(),
nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public renoteUserId: User['id'] | null;
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public renoteUserHost: string | null;
//#endregion

View File

@ -14,7 +14,7 @@ export class Notification {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the Notification.'
comment: 'The created date of the Notification.',
})
public createdAt: Date;
@ -24,12 +24,12 @@ export class Notification {
@Index()
@Column({
...id(),
comment: 'The ID of recipient user of the Notification.'
comment: 'The ID of recipient user of the Notification.',
})
public notifieeId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public notifiee: User | null;
@ -41,12 +41,12 @@ export class Notification {
@Column({
...id(),
nullable: true,
comment: 'The ID of sender user of the Notification.'
comment: 'The ID of sender user of the Notification.',
})
public notifierId: User['id'] | null;
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public notifier: User | null;
@ -68,7 +68,7 @@ export class Notification {
@Index()
@Column('enum', {
enum: notificationTypes,
comment: 'The type of the Notification.'
comment: 'The type of the Notification.',
})
public type: typeof notificationTypes[number];
@ -78,53 +78,53 @@ export class Notification {
@Index()
@Column('boolean', {
default: false,
comment: 'Whether the Notification is read.'
comment: 'Whether the Notification is read.',
})
public isRead: boolean;
@Column({
...id(),
nullable: true
nullable: true,
})
public noteId: Note['id'] | null;
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;
@Column({
...id(),
nullable: true
nullable: true,
})
public followRequestId: FollowRequest['id'] | null;
@ManyToOne(type => FollowRequest, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public followRequest: FollowRequest | null;
@Column({
...id(),
nullable: true
nullable: true,
})
public userGroupInvitationId: UserGroupInvitation['id'] | null;
@ManyToOne(type => UserGroupInvitation, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public userGroupInvitation: UserGroupInvitation | null;
@Column('varchar', {
length: 128, nullable: true
length: 128, nullable: true,
})
public reaction: string | null;
@Column('integer', {
nullable: true
nullable: true,
})
public choice: number | null;
@ -132,7 +132,7 @@ export class Notification {
* アプリ通知のbody
*/
@Column('varchar', {
length: 2048, nullable: true
length: 2048, nullable: true,
})
public customBody: string | null;
@ -141,7 +141,7 @@ export class Notification {
* (省略時はアプリ名で表示されることを期待)
*/
@Column('varchar', {
length: 256, nullable: true
length: 256, nullable: true,
})
public customHeader: string | null;
@ -150,7 +150,7 @@ export class Notification {
* (省略時はアプリアイコンで表示されることを期待)
*/
@Column('varchar', {
length: 1024, nullable: true
length: 1024, nullable: true,
})
public customIcon: string | null;
@ -160,12 +160,12 @@ export class Notification {
@Index()
@Column({
...id(),
nullable: true
nullable: true,
})
public appAccessTokenId: AccessToken['id'] | null;
@ManyToOne(type => AccessToken, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public appAccessToken: AccessToken | null;

View File

@ -17,7 +17,7 @@ export class PageLike {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -26,7 +26,7 @@ export class PageLike {
public pageId: Page['id'];
@ManyToOne(type => Page, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public page: Page | null;

View File

@ -11,13 +11,13 @@ export class Page {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the Page.'
comment: 'The created date of the Page.',
})
public createdAt: Date;
@Index()
@Column('timestamp with time zone', {
comment: 'The updated date of the Page.'
comment: 'The updated date of the Page.',
})
public updatedAt: Date;
@ -33,7 +33,7 @@ export class Page {
public name: string;
@Column('varchar', {
length: 256, nullable: true
length: 256, nullable: true,
})
public summary: string | null;
@ -41,7 +41,7 @@ export class Page {
public alignCenter: boolean;
@Column('boolean', {
default: false
default: false,
})
public hideTitleWhenPinned: boolean;
@ -53,12 +53,12 @@ export class Page {
@Index()
@Column({
...id(),
comment: 'The ID of author.'
comment: 'The ID of author.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -70,24 +70,24 @@ export class Page {
public eyeCatchingImageId: DriveFile['id'] | null;
@ManyToOne(type => DriveFile, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public eyeCatchingImage: DriveFile | null;
@Column('jsonb', {
default: []
default: [],
})
public content: Record<string, any>[];
@Column('jsonb', {
default: []
default: [],
})
public variables: Record<string, any>[];
@Column('varchar', {
length: 16384,
default: ''
default: '',
})
public script: string;
@ -102,12 +102,12 @@ export class Page {
@Index()
@Column({
...id(),
array: true, default: '{}'
array: true, default: '{}',
})
public visibleUserIds: User['id'][];
@Column('integer', {
default: 0
default: 0,
})
public likedCount: number;

View File

@ -23,7 +23,7 @@ export class PasswordResetRequest {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;

View File

@ -11,7 +11,7 @@ export class PollVote {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the PollVote.'
comment: 'The created date of the PollVote.',
})
public createdAt: Date;
@ -20,7 +20,7 @@ export class PollVote {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -30,7 +30,7 @@ export class PollVote {
public noteId: Note['id'];
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;

View File

@ -10,13 +10,13 @@ export class Poll {
public noteId: Note['id'];
@OneToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;
@Column('timestamp with time zone', {
nullable: true
nullable: true,
})
public expiresAt: Date | null;
@ -24,7 +24,7 @@ export class Poll {
public multiple: boolean;
@Column('varchar', {
length: 128, array: true, default: '{}'
length: 128, array: true, default: '{}',
})
public choices: string[];
@ -36,21 +36,21 @@ export class Poll {
//#region Denormalized fields
@Column('enum', {
enum: noteVisibilities,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public noteVisibility: typeof noteVisibilities[number];
@Index()
@Column({
...id(),
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public userId: User['id'];
@Index()
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public userHost: string | null;
//#endregion

View File

@ -9,7 +9,7 @@ export class PromoNote {
public noteId: Note['id'];
@OneToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;
@ -21,7 +21,7 @@ export class PromoNote {
@Index()
@Column({
...id(),
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public userId: User['id'];
//#endregion

View File

@ -10,7 +10,7 @@ export class PromoRead {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the PromoRead.'
comment: 'The created date of the PromoRead.',
})
public createdAt: Date;
@ -19,7 +19,7 @@ export class PromoRead {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -28,7 +28,7 @@ export class PromoRead {
public noteId: Note['id'];
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;

View File

@ -9,50 +9,50 @@ export class RegistryItem {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the RegistryItem.'
comment: 'The created date of the RegistryItem.',
})
public createdAt: Date;
@Column('timestamp with time zone', {
comment: 'The updated date of the RegistryItem.'
comment: 'The updated date of the RegistryItem.',
})
public updatedAt: Date;
@Index()
@Column({
...id(),
comment: 'The owner ID.'
comment: 'The owner ID.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@Column('varchar', {
length: 1024,
comment: 'The key of the RegistryItem.'
comment: 'The key of the RegistryItem.',
})
public key: string;
@Column('jsonb', {
default: {}, nullable: true,
comment: 'The value of the RegistryItem.'
comment: 'The value of the RegistryItem.',
})
public value: any | null;
@Index()
@Column('varchar', {
length: 1024, array: true, default: '{}'
length: 1024, array: true, default: '{}',
})
public scope: string[];
// サードパーティアプリに開放するときのためのカラム
@Index()
@Column('varchar', {
length: 512, nullable: true
length: 512, nullable: true,
})
public domain: string | null;
}

View File

@ -8,7 +8,7 @@ export class Signin {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the Signin.'
comment: 'The created date of the Signin.',
})
public createdAt: Date;
@ -17,7 +17,7 @@ export class Signin {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;

View File

@ -15,7 +15,7 @@ export class SwSubscription {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;

View File

@ -10,19 +10,19 @@ export class UserGroupInvitation {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the UserGroupInvitation.'
comment: 'The created date of the UserGroupInvitation.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The user ID.'
comment: 'The user ID.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -30,12 +30,12 @@ export class UserGroupInvitation {
@Index()
@Column({
...id(),
comment: 'The group ID.'
comment: 'The group ID.',
})
public userGroupId: UserGroup['id'];
@ManyToOne(type => UserGroup, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public userGroup: UserGroup | null;

View File

@ -10,19 +10,19 @@ export class UserGroupJoining {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the UserGroupJoining.'
comment: 'The created date of the UserGroupJoining.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The user ID.'
comment: 'The user ID.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -30,12 +30,12 @@ export class UserGroupJoining {
@Index()
@Column({
...id(),
comment: 'The group ID.'
comment: 'The group ID.',
})
public userGroupId: UserGroup['id'];
@ManyToOne(type => UserGroup, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public userGroup: UserGroup | null;

View File

@ -9,7 +9,7 @@ export class UserGroup {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the UserGroup.'
comment: 'The created date of the UserGroup.',
})
public createdAt: Date;
@ -21,12 +21,12 @@ export class UserGroup {
@Index()
@Column({
...id(),
comment: 'The ID of owner.'
comment: 'The ID of owner.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;

View File

@ -8,7 +8,7 @@ export class UserKeypair {
public userId: User['id'];
@OneToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;

View File

@ -10,19 +10,19 @@ export class UserListJoining {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the UserListJoining.'
comment: 'The created date of the UserListJoining.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The user ID.'
comment: 'The user ID.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -30,12 +30,12 @@ export class UserListJoining {
@Index()
@Column({
...id(),
comment: 'The list ID.'
comment: 'The list ID.',
})
public userListId: UserList['id'];
@ManyToOne(type => UserList, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public userList: UserList | null;

View File

@ -8,26 +8,26 @@ export class UserList {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the UserList.'
comment: 'The created date of the UserList.',
})
public createdAt: Date;
@Index()
@Column({
...id(),
comment: 'The owner ID.'
comment: 'The owner ID.',
})
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@Column('varchar', {
length: 128,
comment: 'The name of the UserList.'
comment: 'The name of the UserList.',
})
public name: string;
}

View File

@ -10,7 +10,7 @@ export class UserNotePining {
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the UserNotePinings.'
comment: 'The created date of the UserNotePinings.',
})
public createdAt: Date;
@ -19,7 +19,7 @@ export class UserNotePining {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -28,7 +28,7 @@ export class UserNotePining {
public noteId: Note['id'];
@ManyToOne(type => Note, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;

View File

@ -12,26 +12,26 @@ export class UserProfile {
public userId: User['id'];
@OneToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@Column('varchar', {
length: 128, nullable: true,
comment: 'The location of the User.'
comment: 'The location of the User.',
})
public location: string | null;
@Column('char', {
length: 10, nullable: true,
comment: 'The birthday (YYYY-MM-DD) of the User.'
comment: 'The birthday (YYYY-MM-DD) of the User.',
})
public birthday: string | null;
@Column('varchar', {
length: 2048, nullable: true,
comment: 'The description (bio) of the User.'
comment: 'The description (bio) of the User.',
})
public description: string | null;
@ -50,13 +50,13 @@ export class UserProfile {
@Column('varchar', {
length: 512, nullable: true,
comment: 'Remote URL of the user.'
comment: 'Remote URL of the user.',
})
public url: string | null;
@Column('varchar', {
length: 128, nullable: true,
comment: 'The email address of the User.'
comment: 'The email address of the User.',
})
public email: string | null;
@ -71,7 +71,7 @@ export class UserProfile {
public emailVerified: boolean;
@Column('jsonb', {
default: ['follow', 'receiveFollowRequest', 'groupInvited']
default: ['follow', 'receiveFollowRequest', 'groupInvited'],
})
public emailNotificationTypes: string[];
@ -113,20 +113,20 @@ export class UserProfile {
@Column('varchar', {
length: 128, nullable: true,
comment: 'The password hash of the User. It will be null if the origin of the user is local.'
comment: 'The password hash of the User. It will be null if the origin of the user is local.',
})
public password: string | null;
// TODO: そのうち消す
@Column('jsonb', {
default: {},
comment: 'The client-specific data of the User.'
comment: 'The client-specific data of the User.',
})
public clientData: Record<string, any>;
@Column('jsonb', {
default: {},
comment: 'The room data of the User.'
comment: 'The room data of the User.',
})
public room: Record<string, any>;
@ -137,7 +137,7 @@ export class UserProfile {
@Column('boolean', {
default: false,
comment: 'Whether reject index by crawler.'
comment: 'Whether reject index by crawler.',
})
public noCrawle: boolean;
@ -163,18 +163,18 @@ export class UserProfile {
@Column({
...id(),
nullable: true
nullable: true,
})
public pinnedPageId: Page['id'] | null;
@OneToOne(type => Page, {
onDelete: 'SET NULL'
onDelete: 'SET NULL',
})
@JoinColumn()
public pinnedPage: Page | null;
@Column('jsonb', {
default: {}
default: {},
})
public integrations: Record<string, any>;
@ -185,12 +185,12 @@ export class UserProfile {
public enableWordMute: boolean;
@Column('jsonb', {
default: []
default: [],
})
public mutedWords: string[][];
@Column('jsonb', {
default: []
default: [],
})
public mutedInstances: string[];
@ -205,7 +205,7 @@ export class UserProfile {
@Index()
@Column('varchar', {
length: 128, nullable: true,
comment: '[Denormalized]'
comment: '[Denormalized]',
})
public userHost: string | null;
//#endregion

View File

@ -8,7 +8,7 @@ export class UserPublickey {
public userId: User['id'];
@OneToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;

View File

@ -5,7 +5,7 @@ import { id } from '../id';
@Entity()
export class UserSecurityKey {
@PrimaryColumn('varchar', {
comment: 'Variable-length id given to navigator.credentials.get()'
comment: 'Variable-length id given to navigator.credentials.get()',
})
public id: string;
@ -14,7 +14,7 @@ export class UserSecurityKey {
public userId: User['id'];
@ManyToOne(type => User, {
onDelete: 'CASCADE'
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@ -22,19 +22,19 @@ export class UserSecurityKey {
@Index()
@Column('varchar', {
comment:
'Variable-length public key used to verify attestations (hex-encoded).'
'Variable-length public key used to verify attestations (hex-encoded).',
})
public publicKey: string;
@Column('timestamp with time zone', {
comment:
'The date of the last time the UserSecurityKey was successfully validated.'
'The date of the last time the UserSecurityKey was successfully validated.',
})
public lastUsed: Date;
@Column('varchar', {
comment: 'User-defined name for this key',
length: 30
length: 30,
})
public name: string;

View File

@ -10,25 +10,25 @@ export class User {
@Index()
@Column('timestamp with time zone', {
comment: 'The created date of the User.'
comment: 'The created date of the User.',
})
public createdAt: Date;
@Index()
@Column('timestamp with time zone', {
nullable: true,
comment: 'The updated date of the User.'
comment: 'The updated date of the User.',
})
public updatedAt: Date | null;
@Column('timestamp with time zone', {
nullable: true
nullable: true,
})
public lastFetchedAt: Date | null;
@Index()
@Column('timestamp with time zone', {
nullable: true
nullable: true,
})
public lastActiveDate: Date | null;
@ -39,50 +39,50 @@ export class User {
@Column('varchar', {
length: 128,
comment: 'The username of the User.'
comment: 'The username of the User.',
})
public username: string;
@Index()
@Column('varchar', {
length: 128, select: false,
comment: 'The username (lowercased) of the User.'
comment: 'The username (lowercased) of the User.',
})
public usernameLower: string;
@Column('varchar', {
length: 128, nullable: true,
comment: 'The name of the User.'
comment: 'The name of the User.',
})
public name: string | null;
@Column('integer', {
default: 0,
comment: 'The count of followers.'
comment: 'The count of followers.',
})
public followersCount: number;
@Column('integer', {
default: 0,
comment: 'The count of following.'
comment: 'The count of following.',
})
public followingCount: number;
@Column('integer', {
default: 0,
comment: 'The count of notes.'
comment: 'The count of notes.',
})
public notesCount: number;
@Column({
...id(),
nullable: true,
comment: 'The ID of avatar DriveFile.'
comment: 'The ID of avatar DriveFile.',
})
public avatarId: DriveFile['id'] | null;
@OneToOne(type => DriveFile, {
onDelete: 'SET NULL'
onDelete: 'SET NULL',
})
@JoinColumn()
public avatar: DriveFile | null;
@ -90,19 +90,19 @@ export class User {
@Column({
...id(),
nullable: true,
comment: 'The ID of banner DriveFile.'
comment: 'The ID of banner DriveFile.',
})
public bannerId: DriveFile['id'] | null;
@OneToOne(type => DriveFile, {
onDelete: 'SET NULL'
onDelete: 'SET NULL',
})
@JoinColumn()
public banner: DriveFile | null;
@Index()
@Column('varchar', {
length: 128, array: true, default: '{}'
length: 128, array: true, default: '{}',
})
public tags: string[];
@ -128,107 +128,107 @@ export class User {
@Column('boolean', {
default: false,
comment: 'Whether the User is suspended.'
comment: 'Whether the User is suspended.',
})
public isSuspended: boolean;
@Column('boolean', {
default: false,
comment: 'Whether the User is silenced.'
comment: 'Whether the User is silenced.',
})
public isSilenced: boolean;
@Column('boolean', {
default: false,
comment: 'Whether the User is locked.'
comment: 'Whether the User is locked.',
})
public isLocked: boolean;
@Column('boolean', {
default: false,
comment: 'Whether the User is a bot.'
comment: 'Whether the User is a bot.',
})
public isBot: boolean;
@Column('boolean', {
default: false,
comment: 'Whether the User is a cat.'
comment: 'Whether the User is a cat.',
})
public isCat: boolean;
@Column('boolean', {
default: false,
comment: 'Whether the User is the admin.'
comment: 'Whether the User is the admin.',
})
public isAdmin: boolean;
@Column('boolean', {
default: false,
comment: 'Whether the User is a moderator.'
comment: 'Whether the User is a moderator.',
})
public isModerator: boolean;
@Index()
@Column('boolean', {
default: true,
comment: 'Whether the User is explorable.'
comment: 'Whether the User is explorable.',
})
public isExplorable: boolean;
// アカウントが削除されたかどうかのフラグだが、完全に削除される際は物理削除なので実質削除されるまでの「削除が進行しているかどうか」のフラグ
@Column('boolean', {
default: false,
comment: 'Whether the User is deleted.'
comment: 'Whether the User is deleted.',
})
public isDeleted: boolean;
@Column('varchar', {
length: 128, array: true, default: '{}'
length: 128, array: true, default: '{}',
})
public emojis: string[];
@Index()
@Column('varchar', {
length: 128, nullable: true,
comment: 'The host of the User. It will be null if the origin of the user is local.'
comment: 'The host of the User. It will be null if the origin of the user is local.',
})
public host: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: 'The inbox URL of the User. It will be null if the origin of the user is local.'
comment: 'The inbox URL of the User. It will be null if the origin of the user is local.',
})
public inbox: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: 'The sharedInbox URL of the User. It will be null if the origin of the user is local.'
comment: 'The sharedInbox URL of the User. It will be null if the origin of the user is local.',
})
public sharedInbox: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: 'The featured URL of the User. It will be null if the origin of the user is local.'
comment: 'The featured URL of the User. It will be null if the origin of the user is local.',
})
public featured: string | null;
@Index()
@Column('varchar', {
length: 512, nullable: true,
comment: 'The URI of the User. It will be null if the origin of the user is local.'
comment: 'The URI of the User. It will be null if the origin of the user is local.',
})
public uri: string | null;
@Column('varchar', {
length: 512, nullable: true,
comment: 'The URI of the user Follower Collection. It will be null if the origin of the user is local.'
comment: 'The URI of the user Follower Collection. It will be null if the origin of the user is local.',
})
public followersUri: string | null;
@Index({ unique: true })
@Column('char', {
length: 16, nullable: true, unique: true,
comment: 'The native access token of the User. It will be null if the origin of the user is local.'
comment: 'The native access token of the User. It will be null if the origin of the user is local.',
})
public token: string | null;

View File

@ -1,4 +1,4 @@
export const id = () => ({
type: 'varchar' as const,
length: 32
length: 32,
});

View File

@ -19,13 +19,13 @@ export class AbuseUserReportRepository extends Repository<AbuseUserReport> {
targetUserId: report.targetUserId,
assigneeId: report.assigneeId,
reporter: Users.pack(report.reporter || report.reporterId, null, {
detail: true
detail: true,
}),
targetUser: Users.pack(report.targetUser || report.targetUserId, null, {
detail: true
detail: true,
}),
assignee: report.assigneeId ? Users.pack(report.assignee || report.assigneeId, null, {
detail: true
detail: true,
}) : null,
});
}

View File

@ -27,7 +27,7 @@ export class AntennaRepository extends Repository<Antenna> {
notify: antenna.notify,
withReplies: antenna.withReplies,
withFile: antenna.withFile,
hasUnreadNote
hasUnreadNote,
};
}
}
@ -39,16 +39,16 @@ export const packedAntennaSchema = {
id: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id'
format: 'id',
},
createdAt: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'date-time'
format: 'date-time',
},
name: {
type: 'string' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
keywords: {
type: 'array' as const,
@ -58,9 +58,9 @@ export const packedAntennaSchema = {
optional: false as const, nullable: false as const,
items: {
type: 'string' as const,
optional: false as const, nullable: false as const
}
}
optional: false as const, nullable: false as const,
},
},
},
excludeKeywords: {
type: 'array' as const,
@ -70,55 +70,55 @@ export const packedAntennaSchema = {
optional: false as const, nullable: false as const,
items: {
type: 'string' as const,
optional: false as const, nullable: false as const
}
}
optional: false as const, nullable: false as const,
},
},
},
src: {
type: 'string' as const,
optional: false as const, nullable: false as const,
enum: ['home', 'all', 'users', 'list', 'group']
enum: ['home', 'all', 'users', 'list', 'group'],
},
userListId: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'id'
format: 'id',
},
userGroupId: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'id'
format: 'id',
},
users: {
type: 'array' as const,
optional: false as const, nullable: false as const,
items: {
type: 'string' as const,
optional: false as const, nullable: false as const
}
optional: false as const, nullable: false as const,
},
},
caseSensitive: {
type: 'boolean' as const,
optional: false as const, nullable: false as const,
default: false
default: false,
},
notify: {
type: 'boolean' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
withReplies: {
type: 'boolean' as const,
optional: false as const, nullable: false as const,
default: false
default: false,
},
withFile: {
type: 'boolean' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
hasUnreadNote: {
type: 'boolean' as const,
optional: false as const, nullable: false as const,
default: false
}
default: false,
},
},
};

View File

@ -18,7 +18,7 @@ export class AppRepository extends Repository<App> {
const opts = Object.assign({
detail: false,
includeSecret: false,
includeProfileImageIds: false
includeProfileImageIds: false,
}, options);
const app = typeof src === 'object' ? src : await this.findOneOrFail(src);
@ -33,8 +33,8 @@ export class AppRepository extends Repository<App> {
isAuthorized: await AccessTokens.count({
appId: app.id,
userId: me,
}).then(count => count > 0)
} : {})
}).then(count => count > 0),
} : {}),
};
}
}
@ -45,31 +45,31 @@ export const packedAppSchema = {
properties: {
id: {
type: 'string' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
name: {
type: 'string' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
callbackUrl: {
type: 'string' as const,
optional: false as const, nullable: true as const
optional: false as const, nullable: true as const,
},
permission: {
type: 'array' as const,
optional: false as const, nullable: false as const,
items: {
type: 'string' as const,
optional: false as const, nullable: false as const
}
optional: false as const, nullable: false as const,
},
},
secret: {
type: 'string' as const,
optional: true as const, nullable: false as const
optional: true as const, nullable: false as const,
},
isAuthorized: {
type: 'boolean' as const,
optional: true as const, nullable: false as const
}
}
optional: true as const, nullable: false as const,
},
},
};

View File

@ -15,7 +15,7 @@ export class AuthSessionRepository extends Repository<AuthSession> {
return await awaitAll({
id: session.id,
app: Apps.pack(session.appId, me),
token: session.token
token: session.token,
});
}
}

View File

@ -18,8 +18,8 @@ export class BlockingRepository extends Repository<Blocking> {
createdAt: blocking.createdAt.toISOString(),
blockeeId: blocking.blockeeId,
blockee: Users.pack(blocking.blockeeId, me, {
detail: true
})
detail: true,
}),
});
}
@ -56,5 +56,5 @@ export const packedBlockingSchema = {
optional: false as const, nullable: false as const,
ref: 'User' as const,
},
}
},
};

View File

@ -36,7 +36,7 @@ export class ChannelRepository extends Repository<Channel> {
...(me ? {
isFollowing: following != null,
hasUnreadNote,
} : {})
} : {}),
};
}
}

View File

@ -46,7 +46,7 @@ export class DriveFileRepository extends Repository<DriveFile> {
if (file.uri != null && file.userHost != null && config.mediaProxy != null) {
return appendQuery(config.mediaProxy, query({
url: file.uri,
thumbnail: thumbnail ? '1' : undefined
thumbnail: thumbnail ? '1' : undefined,
}));
}
@ -118,7 +118,7 @@ export class DriveFileRepository extends Repository<DriveFile> {
): Promise<Packed<'DriveFile'> | null> {
const opts = Object.assign({
detail: false,
self: false
self: false,
}, options);
const file = typeof src === 'object' ? src : await this.findOne(src);
@ -141,10 +141,10 @@ export class DriveFileRepository extends Repository<DriveFile> {
comment: file.comment,
folderId: file.folderId,
folder: opts.detail && file.folderId ? DriveFolders.pack(file.folderId, {
detail: true
detail: true,
}) : null,
userId: opts.withUser ? file.userId : null,
user: (opts.withUser && file.userId) ? Users.pack(file.userId) : null
user: (opts.withUser && file.userId) ? Users.pack(file.userId) : null,
});
}
@ -175,23 +175,23 @@ export const packedDriveFileSchema = {
name: {
type: 'string' as const,
optional: false as const, nullable: false as const,
example: 'lenna.jpg'
example: 'lenna.jpg',
},
type: {
type: 'string' as const,
optional: false as const, nullable: false as const,
example: 'image/jpeg'
example: 'image/jpeg',
},
md5: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'md5',
example: '15eca7fba0480996e2245f5185bf39f2'
example: '15eca7fba0480996e2245f5185bf39f2',
},
size: {
type: 'number' as const,
optional: false as const, nullable: false as const,
example: 51469
example: 51469,
},
isSensitive: {
type: 'boolean' as const,
@ -199,7 +199,7 @@ export const packedDriveFileSchema = {
},
blurhash: {
type: 'string' as const,
optional: false as const, nullable: true as const
optional: false as const, nullable: true as const,
},
properties: {
type: 'object' as const,
@ -208,24 +208,24 @@ export const packedDriveFileSchema = {
width: {
type: 'number' as const,
optional: true as const, nullable: false as const,
example: 1280
example: 1280,
},
height: {
type: 'number' as const,
optional: true as const, nullable: false as const,
example: 720
example: 720,
},
orientation: {
type: 'number' as const,
optional: true as const, nullable: false as const,
example: 8
example: 8,
},
avgColor: {
type: 'string' as const,
optional: true as const, nullable: false as const,
example: 'rgb(40,65,87)'
}
}
example: 'rgb(40,65,87)',
},
},
},
url: {
type: 'string' as const,
@ -239,7 +239,7 @@ export const packedDriveFileSchema = {
},
comment: {
type: 'string' as const,
optional: false as const, nullable: true as const
optional: false as const, nullable: true as const,
},
folderId: {
type: 'string' as const,
@ -262,6 +262,6 @@ export const packedDriveFileSchema = {
type: 'object' as const,
optional: true as const, nullable: true as const,
ref: 'User' as const,
}
},
},
};

View File

@ -20,7 +20,7 @@ export class DriveFolderRepository extends Repository<DriveFolder> {
}
): Promise<Packed<'DriveFolder'>> {
const opts = Object.assign({
detail: false
detail: false,
}, options);
const folder = typeof src === 'object' ? src : await this.findOneOrFail(src);
@ -33,18 +33,18 @@ export class DriveFolderRepository extends Repository<DriveFolder> {
...(opts.detail ? {
foldersCount: DriveFolders.count({
parentId: folder.id
parentId: folder.id,
}),
filesCount: DriveFiles.count({
folderId: folder.id
folderId: folder.id,
}),
...(folder.parentId ? {
parent: this.pack(folder.parentId, {
detail: true
})
} : {})
} : {})
detail: true,
}),
} : {}),
} : {}),
});
}
}

View File

@ -61,5 +61,5 @@ export const packedEmojiSchema = {
type: 'string' as const,
optional: false as const, nullable: false as const,
},
}
},
};

View File

@ -7,100 +7,100 @@ export const packedFederationInstanceSchema = {
id: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id'
format: 'id',
},
caughtAt: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'date-time'
format: 'date-time',
},
host: {
type: 'string' as const,
optional: false as const, nullable: false as const,
example: 'misskey.example.com'
example: 'misskey.example.com',
},
usersCount: {
type: 'number' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
notesCount: {
type: 'number' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
followingCount: {
type: 'number' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
followersCount: {
type: 'number' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
driveUsage: {
type: 'number' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
driveFiles: {
type: 'number' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
latestRequestSentAt: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'date-time'
format: 'date-time',
},
lastCommunicatedAt: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'date-time'
format: 'date-time',
},
isNotResponding: {
type: 'boolean' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
isSuspended: {
type: 'boolean' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
softwareName: {
type: 'string' as const,
optional: false as const, nullable: true as const,
example: 'misskey'
example: 'misskey',
},
softwareVersion: {
type: 'string' as const,
optional: false as const, nullable: true as const,
example: config.version
example: config.version,
},
openRegistrations: {
type: 'boolean' as const,
optional: false as const, nullable: true as const,
example: true
example: true,
},
name: {
type: 'string' as const,
optional: false as const, nullable: true as const
optional: false as const, nullable: true as const,
},
description: {
type: 'string' as const,
optional: false as const, nullable: true as const
optional: false as const, nullable: true as const,
},
maintainerName: {
type: 'string' as const,
optional: false as const, nullable: true as const
optional: false as const, nullable: true as const,
},
maintainerEmail: {
type: 'string' as const,
optional: false as const, nullable: true as const
optional: false as const, nullable: true as const,
},
iconUrl: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'url'
format: 'url',
},
infoUpdatedAt: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'date-time'
}
}
format: 'date-time',
},
},
};

View File

@ -65,10 +65,10 @@ export class FollowingRepository extends Repository<Following> {
followeeId: following.followeeId,
followerId: following.followerId,
followee: opts.populateFollowee ? Users.pack(following.followee || following.followeeId, me, {
detail: true
detail: true,
}) : undefined,
follower: opts.populateFollower ? Users.pack(following.follower || following.followerId, me, {
detail: true
detail: true,
}) : undefined,
});
}
@ -120,5 +120,5 @@ export const packedFollowingSchema = {
optional: true as const, nullable: false as const,
ref: 'User' as const,
},
}
},
};

View File

@ -83,8 +83,8 @@ export const packedGalleryPostSchema = {
items: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id'
}
format: 'id',
},
},
files: {
type: 'array' as const,
@ -93,7 +93,7 @@ export const packedGalleryPostSchema = {
type: 'object' as const,
optional: false as const, nullable: false as const,
ref: 'DriveFile' as const,
}
},
},
tags: {
type: 'array' as const,
@ -101,11 +101,11 @@ export const packedGalleryPostSchema = {
items: {
type: 'string' as const,
optional: false as const, nullable: false as const,
}
},
},
isSensitive: {
type: 'boolean' as const,
optional: false as const, nullable: false as const,
},
}
},
};

View File

@ -14,7 +14,7 @@ export class ReversiGameRepository extends Repository<ReversiGame> {
}
): Promise<Packed<'ReversiGame'>> {
const opts = Object.assign({
detail: true
detail: true,
}, options);
const game = typeof src === 'object' ? src : await this.findOneOrFail(src);
@ -45,10 +45,10 @@ export class ReversiGameRepository extends Repository<ReversiGame> {
logs: game.logs.map(log => ({
at: log.at.toISOString(),
color: log.color,
pos: log.pos
pos: log.pos,
})),
map: game.map,
} : {})
} : {}),
};
}
}
@ -176,8 +176,8 @@ export const packedReversiGameSchema = {
type: 'number' as const,
optional: false as const, nullable: false as const,
},
}
}
},
},
},
map: {
type: 'array' as const,
@ -185,7 +185,7 @@ export const packedReversiGameSchema = {
items: {
type: 'string' as const,
optional: false as const, nullable: false as const,
}
}
}
},
},
},
};

View File

@ -18,12 +18,12 @@ export class ReversiMatchingRepository extends Repository<ReversiMatching> {
createdAt: matching.createdAt.toISOString(),
parentId: matching.parentId,
parent: Users.pack(matching.parentId, me, {
detail: true
detail: true,
}),
childId: matching.childId,
child: Users.pack(matching.childId, me, {
detail: true
})
detail: true,
}),
});
}
}
@ -65,5 +65,5 @@ export const packedReversiMatchingSchema = {
optional: false as const, nullable: false as const,
ref: 'User' as const,
},
}
},
};

View File

@ -58,5 +58,5 @@ export const packedHashtagSchema = {
type: 'number' as const,
optional: false as const, nullable: false as const,
},
}
},
};

View File

@ -112,8 +112,8 @@ export const packedMessagingMessageSchema = {
items: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id'
}
format: 'id',
},
},
},
};

View File

@ -17,7 +17,7 @@ export class ModerationLogRepository extends Repository<ModerationLog> {
info: log.info,
userId: log.userId,
user: Users.pack(log.user || log.userId, null, {
detail: true
detail: true,
}),
});
}

View File

@ -18,8 +18,8 @@ export class MutingRepository extends Repository<Muting> {
createdAt: muting.createdAt.toISOString(),
muteeId: muting.muteeId,
mutee: Users.pack(muting.muteeId, me, {
detail: true
})
detail: true,
}),
});
}
@ -56,5 +56,5 @@ export const packedMutingSchema = {
optional: false as const, nullable: false as const,
ref: 'User' as const,
},
}
},
};

View File

@ -27,7 +27,7 @@ export class NoteReactionRepository extends Repository<NoteReaction> {
type: convertLegacyReaction(reaction.reaction),
...(opts.withNote ? {
note: await Notes.pack(reaction.noteId, me),
} : {})
} : {}),
};
}
}

View File

@ -51,7 +51,7 @@ export class NoteRepository extends Repository<Note> {
// フォロワーかどうか
const following = await Followings.findOne({
followeeId: note.userId,
followerId: meId
followerId: meId,
});
if (following == null) {
@ -103,7 +103,7 @@ export class NoteRepository extends Repository<Note> {
// フォロワーかどうか
const following = await Followings.findOne({
followeeId: packedNote.userId,
followerId: meId
followerId: meId,
});
if (following == null) {
@ -138,7 +138,7 @@ export class NoteRepository extends Repository<Note> {
): Promise<Packed<'Note'>> {
const opts = Object.assign({
detail: true,
skipHide: false
skipHide: false,
}, options);
const meId = me ? me.id : null;
@ -150,13 +150,13 @@ export class NoteRepository extends Repository<Note> {
const choices = poll.choices.map(c => ({
text: c,
votes: poll.votes[poll.choices.indexOf(c)],
isVoted: false
isVoted: false,
}));
if (poll.multiple) {
const votes = await PollVotes.find({
userId: meId!,
noteId: note.id
noteId: note.id,
});
const myChoices = votes.map(v => v.choice);
@ -166,7 +166,7 @@ export class NoteRepository extends Repository<Note> {
} else {
const vote = await PollVotes.findOne({
userId: meId!,
noteId: note.id
noteId: note.id,
});
if (vote) {
@ -177,7 +177,7 @@ export class NoteRepository extends Repository<Note> {
return {
multiple: poll.multiple,
expiresAt: poll.expiresAt,
choices
choices,
};
}
@ -251,20 +251,20 @@ export class NoteRepository extends Repository<Note> {
...(opts.detail ? {
reply: note.replyId ? this.pack(note.reply || note.replyId, me, {
detail: false,
_hint_: options?._hint_
_hint_: options?._hint_,
}) : undefined,
renote: note.renoteId ? this.pack(note.renote || note.renoteId, me, {
detail: true,
_hint_: options?._hint_
_hint_: options?._hint_,
}) : undefined,
poll: note.hasPoll ? populatePoll() : undefined,
...(meId ? {
myReaction: populateMyReaction()
} : {})
} : {})
myReaction: populateMyReaction(),
} : {}),
} : {}),
});
if (packed.user.isCat && packed.text) {
@ -315,8 +315,8 @@ export class NoteRepository extends Repository<Note> {
return await Promise.all(notes.map(n => this.pack(n, me, {
...options,
_hint_: {
myReactions: myReactionsMap
}
myReactions: myReactionsMap,
},
})));
}
}
@ -390,8 +390,8 @@ export const packedNoteSchema = {
items: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id'
}
format: 'id',
},
},
visibleUserIds: {
type: 'array' as const,
@ -399,8 +399,8 @@ export const packedNoteSchema = {
items: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id'
}
format: 'id',
},
},
fileIds: {
type: 'array' as const,
@ -408,8 +408,8 @@ export const packedNoteSchema = {
items: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id'
}
format: 'id',
},
},
files: {
type: 'array' as const,
@ -418,7 +418,7 @@ export const packedNoteSchema = {
type: 'object' as const,
optional: false as const, nullable: false as const,
ref: 'DriveFile' as const,
}
},
},
tags: {
type: 'array' as const,
@ -426,7 +426,7 @@ export const packedNoteSchema = {
items: {
type: 'string' as const,
optional: false as const, nullable: false as const,
}
},
},
poll: {
type: 'object' as const,

View File

@ -32,40 +32,40 @@ export class NotificationRepository extends Repository<Notification> {
...(notification.type === 'mention' ? {
note: Notes.pack(notification.note || notification.noteId!, { id: notification.notifieeId }, {
detail: true,
_hint_: options._hintForEachNotes_
_hint_: options._hintForEachNotes_,
}),
} : {}),
...(notification.type === 'reply' ? {
note: Notes.pack(notification.note || notification.noteId!, { id: notification.notifieeId }, {
detail: true,
_hint_: options._hintForEachNotes_
_hint_: options._hintForEachNotes_,
}),
} : {}),
...(notification.type === 'renote' ? {
note: Notes.pack(notification.note || notification.noteId!, { id: notification.notifieeId }, {
detail: true,
_hint_: options._hintForEachNotes_
_hint_: options._hintForEachNotes_,
}),
} : {}),
...(notification.type === 'quote' ? {
note: Notes.pack(notification.note || notification.noteId!, { id: notification.notifieeId }, {
detail: true,
_hint_: options._hintForEachNotes_
_hint_: options._hintForEachNotes_,
}),
} : {}),
...(notification.type === 'reaction' ? {
note: Notes.pack(notification.note || notification.noteId!, { id: notification.notifieeId }, {
detail: true,
_hint_: options._hintForEachNotes_
_hint_: options._hintForEachNotes_,
}),
reaction: notification.reaction
reaction: notification.reaction,
} : {}),
...(notification.type === 'pollVote' ? {
note: Notes.pack(notification.note || notification.noteId!, { id: notification.notifieeId }, {
detail: true,
_hint_: options._hintForEachNotes_
_hint_: options._hintForEachNotes_,
}),
choice: notification.choice
choice: notification.choice,
} : {}),
...(notification.type === 'groupInvited' ? {
invitation: UserGroupInvitations.pack(notification.userGroupInvitationId!),
@ -102,8 +102,8 @@ export class NotificationRepository extends Repository<Notification> {
return await Promise.all(notifications.map(x => this.pack(x, {
_hintForEachNotes_: {
myReactions: myReactionsMap
}
myReactions: myReactionsMap,
},
})));
}
}
@ -171,5 +171,5 @@ export const packedNotificationSchema = {
type: 'string' as const,
optional: true as const, nullable: true as const,
},
}
},
};

View File

@ -21,7 +21,7 @@ export class PageRepository extends Repository<Page> {
if (x.type === 'image') {
attachedFiles.push(DriveFiles.findOne({
id: x.fileId,
userId: page.userId
userId: page.userId,
}));
}
if (x.children) {
@ -53,7 +53,7 @@ export class PageRepository extends Repository<Page> {
migrate(page.content);
if (migrated) {
this.update(page.id, {
content: page.content
content: page.content,
});
}
@ -138,5 +138,5 @@ export const packedPageSchema = {
ref: 'User' as const,
optional: false as const, nullable: false as const,
},
}
},
};

View File

@ -4,27 +4,27 @@ export const packedQueueCountSchema = {
properties: {
waiting: {
type: 'number' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
active: {
type: 'number' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
completed: {
type: 'number' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
failed: {
type: 'number' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
delayed: {
type: 'number' as const,
optional: false as const, nullable: false as const
optional: false as const, nullable: false as const,
},
paused: {
type: 'number' as const,
optional: false as const, nullable: false as const
}
}
optional: false as const, nullable: false as const,
},
},
};

View File

@ -11,7 +11,7 @@ export class UserGroupRepository extends Repository<UserGroup> {
const userGroup = typeof src === 'object' ? src : await this.findOneOrFail(src);
const users = await UserGroupJoinings.find({
userGroupId: userGroup.id
userGroupId: userGroup.id,
});
return {
@ -19,7 +19,7 @@ export class UserGroupRepository extends Repository<UserGroup> {
createdAt: userGroup.createdAt.toISOString(),
name: userGroup.name,
ownerId: userGroup.userId,
userIds: users.map(x => x.userId)
userIds: users.map(x => x.userId),
};
}
}
@ -55,7 +55,7 @@ export const packedUserGroupSchema = {
type: 'string' as const,
nullable: false as const, optional: false as const,
format: 'id',
}
},
},
},
};

View File

@ -11,14 +11,14 @@ export class UserListRepository extends Repository<UserList> {
const userList = typeof src === 'object' ? src : await this.findOneOrFail(src);
const users = await UserListJoinings.find({
userListId: userList.id
userListId: userList.id,
});
return {
id: userList.id,
createdAt: userList.createdAt.toISOString(),
name: userList.name,
userIds: users.map(x => x.userId)
userIds: users.map(x => x.userId),
};
}
}
@ -49,7 +49,7 @@ export const packedUserListSchema = {
type: 'string' as const,
nullable: false as const, optional: false as const,
format: 'id',
}
},
},
},
};

View File

@ -15,32 +15,32 @@ export class UserRepository extends Repository<User> {
const [following1, following2, followReq1, followReq2, toBlocking, fromBlocked, mute] = await Promise.all([
Followings.findOne({
followerId: me,
followeeId: target
followeeId: target,
}),
Followings.findOne({
followerId: target,
followeeId: me
followeeId: me,
}),
FollowRequests.findOne({
followerId: me,
followeeId: target
followeeId: target,
}),
FollowRequests.findOne({
followerId: target,
followeeId: me
followeeId: me,
}),
Blockings.findOne({
blockerId: me,
blockeeId: target
blockeeId: target,
}),
Blockings.findOne({
blockerId: target,
blockeeId: me
blockeeId: me,
}),
Mutings.findOne({
muterId: me,
muteeId: target
})
muteeId: target,
}),
]);
return {
@ -51,13 +51,13 @@ export class UserRepository extends Repository<User> {
isFollowed: following2 != null,
isBlocking: toBlocking != null,
isBlocked: fromBlocked != null,
isMuted: mute != null
isMuted: mute != null,
};
}
public async getHasUnreadMessagingMessage(userId: User['id']): Promise<boolean> {
const mute = await Mutings.find({
muterId: userId
muterId: userId,
});
const joinings = await UserGroupJoinings.find({ userId: userId });
@ -76,9 +76,9 @@ export class UserRepository extends Repository<User> {
isRead: false,
...(mute.length > 0 ? { userId: Not(In(mute.map(x => x.muteeId))) } : {}),
},
take: 1
take: 1,
}).then(count => count > 0),
groupQs
groupQs,
]);
return withUser || withGroups.some(x => x);
@ -86,11 +86,11 @@ export class UserRepository extends Repository<User> {
public async getHasUnreadAnnouncement(userId: User['id']): Promise<boolean> {
const reads = await AnnouncementReads.find({
userId: userId
userId: userId,
});
const count = await Announcements.count(reads.length > 0 ? {
id: Not(In(reads.map(read => read.announcementId)))
id: Not(In(reads.map(read => read.announcementId))),
} : {});
return count > 0;
@ -101,7 +101,7 @@ export class UserRepository extends Repository<User> {
const unread = myAntennas.length > 0 ? await AntennaNotes.findOne({
antennaId: In(myAntennas.map(x => x.id)),
read: false
read: false,
}) : null;
return unread != null;
@ -120,7 +120,7 @@ export class UserRepository extends Repository<User> {
public async getHasUnreadNotification(userId: User['id']): Promise<boolean> {
const mute = await Mutings.find({
muterId: userId
muterId: userId,
});
const mutedUserIds = mute.map(m => m.muteeId);
@ -128,9 +128,9 @@ export class UserRepository extends Repository<User> {
where: {
notifieeId: userId,
...(mutedUserIds.length > 0 ? { notifierId: Not(In(mutedUserIds)) } : {}),
isRead: false
isRead: false,
},
take: 1
take: 1,
});
return count > 0;
@ -138,7 +138,7 @@ export class UserRepository extends Repository<User> {
public async getHasPendingReceivedFollowRequest(userId: User['id']): Promise<boolean> {
const count = await FollowRequests.count({
followeeId: userId
followeeId: userId,
});
return count > 0;
@ -173,7 +173,7 @@ export class UserRepository extends Repository<User> {
): Promise<Packed<'User'>> {
const opts = Object.assign({
detail: false,
includeSecrets: false
includeSecrets: false,
}, options);
const user = typeof src === 'object' ? src : await this.findOneOrFail(src);
@ -245,7 +245,7 @@ export class UserRepository extends Repository<User> {
notesCount: user.notesCount,
pinnedNoteIds: pins.map(pin => pin.noteId),
pinnedNotes: Notes.packMany(pins.map(pin => pin.note!), me, {
detail: true
detail: true,
}),
pinnedPageId: profile!.pinnedPageId,
pinnedPage: profile!.pinnedPageId ? Pages.pack(profile!.pinnedPageId, me) : null,
@ -255,7 +255,7 @@ export class UserRepository extends Repository<User> {
usePasswordLessLogin: profile!.usePasswordLessLogin,
securityKeys: profile!.twoFactorEnabled
? UserSecurityKeys.count({
userId: user.id
userId: user.id,
}).then(result => result >= 1)
: false,
} : {}),
@ -274,11 +274,11 @@ export class UserRepository extends Repository<User> {
hideOnlineStatus: user.hideOnlineStatus,
hasUnreadSpecifiedNotes: NoteUnreads.count({
where: { userId: user.id, isSpecified: true },
take: 1
take: 1,
}).then(count => count > 0),
hasUnreadMentions: NoteUnreads.count({
where: { userId: user.id, isMentioned: true },
take: 1
take: 1,
}).then(count => count > 0),
hasUnreadAnnouncement: this.getHasUnreadAnnouncement(user.id),
hasUnreadAntenna: this.getHasUnreadAntenna(user.id),
@ -299,11 +299,11 @@ export class UserRepository extends Repository<User> {
securityKeysList: profile!.twoFactorEnabled
? UserSecurityKeys.find({
where: {
userId: user.id
userId: user.id,
},
select: ['id', 'name', 'lastUsed']
select: ['id', 'name', 'lastUsed'],
})
: []
: [],
} : {}),
...(relation ? {
@ -314,7 +314,7 @@ export class UserRepository extends Repository<User> {
isBlocking: relation.isBlocking,
isBlocked: relation.isBlocked,
isMuted: relation.isMuted,
} : {})
} : {}),
};
return await awaitAll(packed);
@ -366,17 +366,17 @@ export const packedUserSchema = {
name: {
type: 'string' as const,
nullable: true as const, optional: false as const,
example: '藍'
example: '藍',
},
username: {
type: 'string' as const,
nullable: false as const, optional: false as const,
example: 'ai'
example: 'ai',
},
host: {
type: 'string' as const,
nullable: true as const, optional: false as const,
example: 'misskey.example.com'
example: 'misskey.example.com',
},
avatarUrl: {
type: 'string' as const,
@ -390,17 +390,17 @@ export const packedUserSchema = {
avatarColor: {
type: 'any' as const,
nullable: true as const, optional: false as const,
default: null
default: null,
},
isAdmin: {
type: 'boolean' as const,
nullable: false as const, optional: true as const,
default: false
default: false,
},
isModerator: {
type: 'boolean' as const,
nullable: false as const, optional: true as const,
default: false
default: false,
},
isBot: {
type: 'boolean' as const,
@ -419,15 +419,15 @@ export const packedUserSchema = {
properties: {
name: {
type: 'string' as const,
nullable: false as const, optional: false as const
nullable: false as const, optional: false as const,
},
url: {
type: 'string' as const,
nullable: false as const, optional: false as const,
format: 'url'
format: 'url',
},
}
}
},
},
},
url: {
type: 'string' as const,
@ -456,7 +456,7 @@ export const packedUserSchema = {
bannerColor: {
type: 'any' as const,
nullable: true as const, optional: true as const,
default: null
default: null,
},
isLocked: {
type: 'boolean' as const,
@ -465,12 +465,12 @@ export const packedUserSchema = {
isSuspended: {
type: 'boolean' as const,
nullable: false as const, optional: true as const,
example: false
example: false,
},
description: {
type: 'string' as const,
nullable: true as const, optional: true as const,
example: 'Hi masters, I am Ai!'
example: 'Hi masters, I am Ai!',
},
location: {
type: 'string' as const,
@ -479,7 +479,7 @@ export const packedUserSchema = {
birthday: {
type: 'string' as const,
nullable: true as const, optional: true as const,
example: '2018-03-12'
example: '2018-03-12',
},
fields: {
type: 'array' as const,
@ -490,15 +490,15 @@ export const packedUserSchema = {
properties: {
name: {
type: 'string' as const,
nullable: false as const, optional: false as const
nullable: false as const, optional: false as const,
},
value: {
type: 'string' as const,
nullable: false as const, optional: false as const
}
nullable: false as const, optional: false as const,
},
},
maxLength: 4
}
maxLength: 4,
},
},
followersCount: {
type: 'number' as const,
@ -519,7 +519,7 @@ export const packedUserSchema = {
type: 'string' as const,
nullable: false as const, optional: false as const,
format: 'id',
}
},
},
pinnedNotes: {
type: 'array' as const,
@ -528,11 +528,11 @@ export const packedUserSchema = {
type: 'object' as const,
nullable: false as const, optional: false as const,
ref: 'Note' as const,
}
},
},
pinnedPageId: {
type: 'string' as const,
nullable: true as const, optional: true as const
nullable: true as const, optional: true as const,
},
pinnedPage: {
type: 'object' as const,
@ -542,47 +542,47 @@ export const packedUserSchema = {
twoFactorEnabled: {
type: 'boolean' as const,
nullable: false as const, optional: true as const,
default: false
default: false,
},
usePasswordLessLogin: {
type: 'boolean' as const,
nullable: false as const, optional: true as const,
default: false
default: false,
},
securityKeys: {
type: 'boolean' as const,
nullable: false as const, optional: true as const,
default: false
default: false,
},
avatarId: {
type: 'string' as const,
nullable: true as const, optional: true as const,
format: 'id'
format: 'id',
},
bannerId: {
type: 'string' as const,
nullable: true as const, optional: true as const,
format: 'id'
format: 'id',
},
autoWatch: {
type: 'boolean' as const,
nullable: false as const, optional: true as const
nullable: false as const, optional: true as const,
},
injectFeaturedNote: {
type: 'boolean' as const,
nullable: false as const, optional: true as const
nullable: false as const, optional: true as const,
},
alwaysMarkNsfw: {
type: 'boolean' as const,
nullable: false as const, optional: true as const
nullable: false as const, optional: true as const,
},
carefulBot: {
type: 'boolean' as const,
nullable: false as const, optional: true as const
nullable: false as const, optional: true as const,
},
autoAcceptFollowed: {
type: 'boolean' as const,
nullable: false as const, optional: true as const
nullable: false as const, optional: true as const,
},
hasUnreadSpecifiedNotes: {
type: 'boolean' as const,
@ -618,47 +618,47 @@ export const packedUserSchema = {
},
integrations: {
type: 'object' as const,
nullable: false as const, optional: true as const
nullable: false as const, optional: true as const,
},
mutedWords: {
type: 'array' as const,
nullable: false as const, optional: true as const
nullable: false as const, optional: true as const,
},
mutedInstances: {
type: 'array' as const,
nullable: false as const, optional: true as const
nullable: false as const, optional: true as const,
},
mutingNotificationTypes: {
type: 'array' as const,
nullable: false as const, optional: true as const
nullable: false as const, optional: true as const,
},
isFollowing: {
type: 'boolean' as const,
optional: true as const, nullable: false as const
optional: true as const, nullable: false as const,
},
hasPendingFollowRequestFromYou: {
type: 'boolean' as const,
optional: true as const, nullable: false as const
optional: true as const, nullable: false as const,
},
hasPendingFollowRequestToYou: {
type: 'boolean' as const,
optional: true as const, nullable: false as const
optional: true as const, nullable: false as const,
},
isFollowed: {
type: 'boolean' as const,
optional: true as const, nullable: false as const
optional: true as const, nullable: false as const,
},
isBlocking: {
type: 'boolean' as const,
optional: true as const, nullable: false as const
optional: true as const, nullable: false as const,
},
isBlocked: {
type: 'boolean' as const,
optional: true as const, nullable: false as const
optional: true as const, nullable: false as const,
},
isMuted: {
type: 'boolean' as const,
optional: true as const, nullable: false as const
}
optional: true as const, nullable: false as const,
},
},
};