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

@ -10,7 +10,7 @@ import { LessThan } from 'typeorm';
export default function() {
async function tick() {
await AttestationChallenges.delete({
createdAt: LessThan(new Date(new Date().getTime() - 5 * 60 * 1000))
createdAt: LessThan(new Date(new Date().getTime() - 5 * 60 * 1000)),
});
}

View file

@ -35,13 +35,13 @@ export default function() {
activeSincePrevTick: activeDeliverJobs,
active: deliverJobCounts.active,
waiting: deliverJobCounts.waiting,
delayed: deliverJobCounts.delayed
delayed: deliverJobCounts.delayed,
},
inbox: {
activeSincePrevTick: activeInboxJobs,
active: inboxJobCounts.active,
waiting: inboxJobCounts.waiting,
delayed: inboxJobCounts.delayed
delayed: inboxJobCounts.delayed,
},
};

View file

@ -38,7 +38,7 @@ export default function() {
fs: {
r: round(Math.max(0, fsStats.rIO_sec)),
w: round(Math.max(0, fsStats.wIO_sec)),
}
},
};
ev.emit('serverStats', stats);
log.unshift(stats);

View file

@ -6,10 +6,10 @@ const index = {
analysis: {
analyzer: {
ngram: {
tokenizer: 'ngram'
}
}
}
tokenizer: 'ngram',
},
},
},
},
mappings: {
properties: {
@ -25,9 +25,9 @@ const index = {
userHost: {
type: 'keyword',
index: true,
}
}
}
},
},
},
};
// Init ElasticSearch connection
@ -35,9 +35,9 @@ const client = config.elasticsearch ? new elasticsearch.Client({
node: `${config.elasticsearch.ssl ? 'https://' : 'http://'}${config.elasticsearch.host}:${config.elasticsearch.port}`,
auth: (config.elasticsearch.user && config.elasticsearch.pass) ? {
username: config.elasticsearch.user,
password: config.elasticsearch.pass
password: config.elasticsearch.pass,
} : undefined,
pingTimeout: 30000
pingTimeout: 30000,
}) : null;
if (client) {
@ -47,7 +47,7 @@ if (client) {
if (!exist.body) {
client.indices.create({
index: config.elasticsearch.index || 'misskey_note',
body: index
body: index,
});
}
});

View file

@ -175,7 +175,7 @@ export const entities = [
Ad,
PasswordResetRequest,
UserPending,
...charts as any
...charts as any,
];
export function initDb(justBorrow = false, sync = false, forceRecreate = false) {
@ -205,12 +205,12 @@ export function initDb(justBorrow = false, sync = false, forceRecreate = false)
port: config.redis.port,
password: config.redis.pass,
prefix: `${config.redis.prefix}:query:`,
db: config.redis.db || 0
}
db: config.redis.db || 0,
},
} : false,
logging: log,
logger: log ? new MyCustomLogger() : undefined,
entities: entities
entities: entities,
});
}

View file

@ -8,7 +8,7 @@ export function createConnection() {
{
password: config.redis.pass,
prefix: config.redis.prefix,
db: config.redis.db || 0
db: config.redis.db || 0,
}
);
}

View file

@ -134,7 +134,7 @@ export default class Reversi {
color,
pos,
effects,
turn
turn,
});
this.calcTurn();
@ -211,7 +211,7 @@ export default class Reversi {
[ 0, +1], // 下
[ -1, +1], // 左下
[ -1, 0], // 左
[ -1, -1] // 左上
[ -1, -1], // 左上
];
const effectsInLine = ([dx, dy]: [number, number]): number[] => {

View file

@ -22,8 +22,8 @@ export const fourfour: Map = {
'----',
'-wb-',
'-bw-',
'----'
]
'----',
],
};
export const sixsix: Map = {
@ -35,8 +35,8 @@ export const sixsix: Map = {
'--wb--',
'--bw--',
'------',
'------'
]
'------',
],
};
export const roundedSixsix: Map = {
@ -49,8 +49,8 @@ export const roundedSixsix: Map = {
'--wb--',
'--bw--',
'------',
' ---- '
]
' ---- ',
],
};
export const roundedSixsix2: Map = {
@ -63,8 +63,8 @@ export const roundedSixsix2: Map = {
'--wb--',
'--bw--',
' ---- ',
' -- '
]
' -- ',
],
};
export const eighteight: Map = {
@ -78,8 +78,8 @@ export const eighteight: Map = {
'---bw---',
'--------',
'--------',
'--------'
]
'--------',
],
};
export const eighteightH1: Map = {
@ -93,8 +93,8 @@ export const eighteightH1: Map = {
'---bw---',
'--------',
'--------',
'--------'
]
'--------',
],
};
export const eighteightH2: Map = {
@ -108,8 +108,8 @@ export const eighteightH2: Map = {
'---bw---',
'--------',
'--------',
'-------b'
]
'-------b',
],
};
export const eighteightH3: Map = {
@ -123,8 +123,8 @@ export const eighteightH3: Map = {
'---bw---',
'--------',
'--------',
'-------b'
]
'-------b',
],
};
export const eighteightH4: Map = {
@ -138,8 +138,8 @@ export const eighteightH4: Map = {
'---bw---',
'--------',
'--------',
'b------b'
]
'b------b',
],
};
export const eighteightH28: Map = {
@ -153,8 +153,8 @@ export const eighteightH28: Map = {
'b--bw--b',
'b------b',
'b------b',
'bbbbbbbb'
]
'bbbbbbbb',
],
};
export const roundedEighteight: Map = {
@ -169,8 +169,8 @@ export const roundedEighteight: Map = {
'---bw---',
'--------',
'--------',
' ------ '
]
' ------ ',
],
};
export const roundedEighteight2: Map = {
@ -185,8 +185,8 @@ export const roundedEighteight2: Map = {
'---bw---',
'--------',
' ------ ',
' ---- '
]
' ---- ',
],
};
export const roundedEighteight3: Map = {
@ -201,8 +201,8 @@ export const roundedEighteight3: Map = {
'---bw---',
' ------ ',
' ---- ',
' -- '
]
' -- ',
],
};
export const eighteightWithNotch: Map = {
@ -217,8 +217,8 @@ export const eighteightWithNotch: Map = {
' --bw-- ',
'--------',
'--------',
'--- ---'
]
'--- ---',
],
};
export const eighteightWithSomeHoles: Map = {
@ -233,8 +233,8 @@ export const eighteightWithSomeHoles: Map = {
'---bw- -',
' -------',
'--- ----',
'--------'
]
'--------',
],
};
export const circle: Map = {
@ -249,8 +249,8 @@ export const circle: Map = {
'---bw---',
' ------ ',
' ------ ',
' -- '
]
' -- ',
],
};
export const smile: Map = {
@ -265,8 +265,8 @@ export const smile: Map = {
'-- bw --',
'--- ---',
'--------',
' ------ '
]
' ------ ',
],
};
export const window: Map = {
@ -281,8 +281,8 @@ export const window: Map = {
'---bw---',
'- -- -',
'- -- -',
'--------'
]
'--------',
],
};
export const reserved: Map = {
@ -297,8 +297,8 @@ export const reserved: Map = {
'---bw---',
'--------',
'--------',
'b------w'
]
'b------w',
],
};
export const x: Map = {
@ -313,8 +313,8 @@ export const x: Map = {
'---bw---',
'--b--w--',
'-b----w-',
'b------w'
]
'b------w',
],
};
export const parallel: Map = {
@ -329,8 +329,8 @@ export const parallel: Map = {
'---ww---',
'--------',
'--------',
'--------'
]
'--------',
],
};
export const lackOfBlack: Map = {
@ -344,8 +344,8 @@ export const lackOfBlack: Map = {
'---bw---',
'--------',
'--------',
'--------'
]
'--------',
],
};
export const squareParty: Map = {
@ -360,8 +360,8 @@ export const squareParty: Map = {
'-bbbwww-',
'-b-bw-w-',
'-bbbwww-',
'--------'
]
'--------',
],
};
export const minesweeper: Map = {
@ -376,8 +376,8 @@ export const minesweeper: Map = {
'-w-bw-b-',
'b-w--b-w',
'-b-bw-w-',
'w-w--b-b'
]
'w-w--b-b',
],
};
export const tenthtenth: Map = {
@ -393,8 +393,8 @@ export const tenthtenth: Map = {
'----------',
'----------',
'----------',
'----------'
]
'----------',
],
};
export const hole: Map = {
@ -411,8 +411,8 @@ export const hole: Map = {
'--wb--wb--',
'--bw--bw--',
'----------',
'----------'
]
'----------',
],
};
export const grid: Map = {
@ -429,8 +429,8 @@ export const grid: Map = {
'- - -- - -',
'----------',
'- - -- - -',
'----------'
]
'----------',
],
};
export const cross: Map = {
@ -447,8 +447,8 @@ export const cross: Map = {
'----------',
' ---- ',
' ---- ',
' ---- '
]
' ---- ',
],
};
export const charX: Map = {
@ -465,8 +465,8 @@ export const charX: Map = {
' -------- ',
'----------',
'---- ----',
'--- ---'
]
'--- ---',
],
};
export const charY: Map = {
@ -483,8 +483,8 @@ export const charY: Map = {
' ------ ',
' ------ ',
' ------ ',
' ------ '
]
' ------ ',
],
};
export const walls: Map = {
@ -501,8 +501,8 @@ export const walls: Map = {
'w--------w',
'w--------w',
'w--------w',
' bbbbbbbb '
]
' bbbbbbbb ',
],
};
export const cpu: Map = {
@ -519,8 +519,8 @@ export const cpu: Map = {
'w--------w',
' -------- ',
'w--------w',
' b b b b '
]
' b b b b ',
],
};
export const checker: Map = {
@ -537,8 +537,8 @@ export const checker: Map = {
'---bwbw---',
'----------',
'----------',
'----------'
]
'----------',
],
};
export const japaneseCurry: Map = {
@ -555,8 +555,8 @@ export const japaneseCurry: Map = {
'w-w-w-b-b-',
'-w-w-w-b-b',
'w-w-w-w-b-',
'-w-w-w-w-b'
]
'-w-w-w-w-b',
],
};
export const mosaic: Map = {
@ -574,7 +574,7 @@ export const mosaic: Map = {
' - - - - -',
'- - - - - ',
' - - - - -',
]
],
};
export const arena: Map = {
@ -591,8 +591,8 @@ export const arena: Map = {
' -------- ',
'- ------ -',
' - - - - ',
'- - -- - -'
]
'- - -- - -',
],
};
export const reactor: Map = {
@ -609,8 +609,8 @@ export const reactor: Map = {
'---w b---',
'- --bw-- -',
'w- - - -b',
'-b------w-'
]
'-b------w-',
],
};
export const sixeight: Map = {
@ -624,8 +624,8 @@ export const sixeight: Map = {
'--bw--',
'------',
'------',
'------'
]
'------',
],
};
export const spark: Map = {
@ -642,8 +642,8 @@ export const spark: Map = {
' -------- ',
' -------- ',
'----------',
' - - '
]
' - - ',
],
};
export const islands: Map = {
@ -660,8 +660,8 @@ export const islands: Map = {
' --------',
' --------',
' --------',
' --------'
]
' --------',
],
};
export const galaxy: Map = {
@ -680,8 +680,8 @@ export const galaxy: Map = {
'---w--bbb---',
' ---w------ ',
' ---www-- ',
' ------ '
]
' ------ ',
],
};
export const triangle: Map = {
@ -698,8 +698,8 @@ export const triangle: Map = {
' -------- ',
' -------- ',
'----------',
'----------'
]
'----------',
],
};
export const iphonex: Map = {
@ -718,8 +718,8 @@ export const iphonex: Map = {
'--------',
'--------',
'--------',
' ------ '
]
' ------ ',
],
};
export const dealWithIt: Map = {
@ -731,8 +731,8 @@ export const dealWithIt: Map = {
'--w-b-------',
' --b-w------',
' --w-b---- ',
' ------- '
]
' ------- ',
],
};
export const experiment: Map = {
@ -750,8 +750,8 @@ export const experiment: Map = {
'bbbbbb wwwwww',
'bbbbbb wwwwww',
'bbbbbb wwwwww',
'wwwwww bbbbbb'
]
'wwwwww bbbbbb',
],
};
export const bigBoard: Map = {
@ -773,8 +773,8 @@ export const bigBoard: Map = {
'----------------',
'----------------',
'----------------',
'----------------'
]
'----------------',
],
};
export const twoBoard: Map = {
@ -789,8 +789,8 @@ export const twoBoard: Map = {
'---bw--- ---bw---',
'-------- --------',
'-------- --------',
'-------- --------'
]
'-------- --------',
],
};
export const test1: Map = {
@ -800,8 +800,8 @@ export const test1: Map = {
'--------',
'---wb---',
'---bw---',
'--------'
]
'--------',
],
};
export const test2: Map = {
@ -812,8 +812,8 @@ export const test2: Map = {
'------',
'-b--w-',
'-w--b-',
'-w--b-'
]
'-w--b-',
],
};
export const test3: Map = {
@ -832,7 +832,7 @@ export const test3: Map = {
'-w-',
'---',
'b--',
]
],
};
export const test4: Map = {
@ -843,8 +843,8 @@ export const test4: Map = {
'-w--b-',
'------',
'-w--b-',
'-w--b-'
]
'-w--b-',
],
};
// 検証用: この盤面で藍(lv3)が黒で始めると何故か(?)A1に打ってしまう
@ -860,7 +860,7 @@ export const test6: Map = {
'wwbwbbbb',
'--wbbbbb',
'-wwwww--',
]
],
};
// 検証用: この盤面で藍(lv3)が黒で始めると何故か(?)G7に打ってしまう
@ -876,7 +876,7 @@ export const test7: Map = {
'-wwbbwwb',
'--wwww--',
'--wwww--',
]
],
};
// 検証用: この盤面で藍(lv5)が黒で始めると何故か(?)A1に打ってしまう
@ -892,5 +892,5 @@ export const test8: Map = {
'wwwwww--',
'--www---',
'--ww----',
]
],
};

View file

@ -144,7 +144,7 @@ export function toHtml(nodes: mfm.MfmNode[] | null, mentionedRemoteUsers: IMenti
a.href = `https://www.google.com/search?q=${node.props.query}`;
a.textContent = node.props.content;
return a;
}
},
};
appendChildren(nodes, doc.body);

View file

@ -10,7 +10,7 @@ export class Cache<T> {
public set(key: string | null, value: T): void {
this.cache.set(key, {
date: Date.now(),
value
value,
});
}

View file

@ -33,17 +33,17 @@ type CaptchaResponse = {
async function getCaptchaResponse(url: string, secret: string, response: string): Promise<CaptchaResponse> {
const params = new URLSearchParams({
secret,
response
response,
});
const res = await fetch(url, {
method: 'POST',
body: params,
headers: {
'User-Agent': config.userAgent
'User-Agent': config.userAgent,
},
timeout: 10 * 1000,
agent: getAgentByUrl
agent: getAgentByUrl,
}).catch(e => {
throw `${e.message || e}`;
});

View file

@ -24,7 +24,7 @@ export async function checkHitAntenna(antenna: Antenna, note: (Note | Packed<'No
if (antennaUserFollowing && !antennaUserFollowing.includes(note.userId)) return false;
} else if (antenna.src === 'list') {
const listUsers = (await UserListJoinings.find({
userListId: antenna.userListId!
userListId: antenna.userListId!,
})).map(x => x.userId);
if (!listUsers.includes(note.userId)) return false;
@ -32,7 +32,7 @@ export async function checkHitAntenna(antenna: Antenna, note: (Note | Packed<'No
const joining = await UserGroupJoinings.findOneOrFail(antenna.userGroupJoiningId!);
const groupUsers = (await UserGroupJoinings.find({
userGroupId: joining.userGroupId
userGroupId: joining.userGroupId,
})).map(x => x.userId);
if (!groupUsers.includes(note.userId)) return false;

View file

@ -22,7 +22,7 @@ export async function downloadUrl(url: string, path: string) {
const req = got.stream(url, {
headers: {
'User-Agent': config.userAgent
'User-Agent': config.userAgent,
},
timeout: {
lookup: timeout,

View file

@ -10,8 +10,8 @@ export async function fetchMeta(noCache = false): Promise<Meta> {
// 過去のバグでレコードが複数出来てしまっている可能性があるので新しいIDを優先する
const meta = await transactionalEntityManager.findOne(Meta, {
order: {
id: 'DESC'
}
id: 'DESC',
},
});
if (meta) {
@ -19,7 +19,7 @@ export async function fetchMeta(noCache = false): Promise<Meta> {
return meta;
} else {
const saved = await transactionalEntityManager.save(Meta, {
id: 'x'
id: 'x',
}) as Meta;
cache = saved;

View file

@ -12,9 +12,9 @@ export async function getJson(url: string, accept = 'application/json, */*', tim
method: 'GET',
headers: Object.assign({
'User-Agent': config.userAgent,
Accept: accept
Accept: accept,
}, headers || {}),
timeout
timeout,
});
return await res.json();
@ -26,9 +26,9 @@ export async function getHtml(url: string, accept = 'text/html, */*', timeout =
method: 'GET',
headers: Object.assign({
'User-Agent': config.userAgent,
Accept: accept
Accept: accept,
}, headers || {}),
timeout
timeout,
});
return await res.text();
@ -95,7 +95,7 @@ export const httpAgent = config.proxy
maxSockets,
maxFreeSockets: 256,
scheduling: 'lifo',
proxy: config.proxy
proxy: config.proxy,
})
: _http;
@ -109,7 +109,7 @@ export const httpsAgent = config.proxy
maxSockets,
maxFreeSockets: 256,
scheduling: 'lifo',
proxy: config.proxy
proxy: config.proxy,
})
: _https;

View file

@ -8,14 +8,14 @@ export async function genRsaKeyPair(modulusLength = 2048) {
modulusLength,
publicKeyEncoding: {
type: 'spki',
format: 'pem'
format: 'pem',
},
privateKeyEncoding: {
type: 'pkcs8',
format: 'pem',
cipher: undefined,
passphrase: undefined
}
passphrase: undefined,
},
});
}
@ -24,13 +24,13 @@ export async function genEcKeyPair(namedCurve: 'prime256v1' | 'secp384r1' | 'sec
namedCurve,
publicKeyEncoding: {
type: 'spki',
format: 'pem'
format: 'pem',
},
privateKeyEncoding: {
type: 'pkcs8',
format: 'pem',
cipher: undefined,
passphrase: undefined
}
passphrase: undefined,
},
});
}

View file

@ -26,12 +26,12 @@ export type FileInfo = {
const TYPE_OCTET_STREAM = {
mime: 'application/octet-stream',
ext: null
ext: null,
};
const TYPE_SVG = {
mime: 'image/svg+xml',
ext: 'svg'
ext: 'svg',
};
/**
@ -116,7 +116,7 @@ export async function detectType(path: string) {
return {
mime: type.mime,
ext: type.ext
ext: type.ext,
};
}

View file

@ -112,14 +112,14 @@ export function decodeReaction(str: string): DecodedReaction {
return {
reaction: `:${name}@${host || '.'}:`, // ローカル分は@以降を省略するのではなく.にする
name,
host
host,
};
}
return {
reaction: str,
name: undefined,
host: undefined
host: undefined,
};
}

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,
},
}
},
};

Some files were not shown because too many files have changed in this diff Show more