diff --git a/.config/example.yml b/.config/example.yml index 7d8ba32be..ba53bde43 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -82,23 +82,28 @@ redis: # user: # pass: +# ┌───────────────────────────┐ +#───┘ Meilisearch configuration └───────────────────────────────────── +#meilisearch: +# host: meilisearch +# port: 7700 +# ssl: false +# apiKey: + # ┌───────────────┐ #───┘ ID generation └─────────────────────────────────────────── -# You can select the ID generation method. -# You don't usually need to change this setting, but you can -# change it according to your preferences. +# No need to uncomment in most cases, but you may want to change +# these settings if you plan to run a large and/or distributed server. -# Available methods: -# aid ... Short, Millisecond accuracy -# meid ... Similar to ObjectID, Millisecond accuracy -# ulid ... Millisecond accuracy -# objectid ... This is left for backward compatibility +# cuid: +# # Min 16, Max 24 +# length: 16 +# +# # Set this to a unique string across workers (e.g., machine's hostname) +# # if your workers are running in multiple hosts. +# fingerprint: my-fingerprint -# ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE -# ID SETTINGS AFTER THAT! - -id: 'aid' # ┌─────────────────────┐ #───┘ Other configuration └───────────────────────────────────── diff --git a/README.md b/README.md index a72a171bb..5b3eb98fd 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,8 @@ If you have access to a server that supports one of the sources below, I recomme - [FFmpeg](https://ffmpeg.org/) for video transcoding - Full text search (one of the following) - - 🦔 [Sonic](https://crates.io/crates/sonic-server) (recommended) + - 🦔 [Sonic](https://crates.io/crates/sonic-server) + - [MeiliSearch](https://www.meilisearch.com/) - [ElasticSearch](https://www.elastic.co/elasticsearch/) ### 🏗️ Build dependencies @@ -148,7 +149,11 @@ psql postgres -c "create database calckey with encoding = 'UTF8';" In Calckey's directory, fill out the `db` section of `.config/default.yml` with the correct information, where the `db` key is `calckey`. -## 🦔 Set up search +## 🔎 Set up search + +### 🦔 Sonic + +Sonic is better suited for self hosters with smaller deployments. It's easier to use, uses almost no resources, and takes barely any any disk space. Follow sonic's [installation guide](https://github.com/valeriansaliou/sonic#installation) @@ -157,6 +162,17 @@ Follow sonic's [installation guide](https://github.com/valeriansaliou/sonic#inst In Calckey's directory, fill out the `sonic` section of `.config/default.yml` with the correct information. +### Meilisearch + +Meilisearch is better suited for larger deployments. It's faster but uses far more resources and disk space. + +Follow Meilisearch's [quick start guide](https://www.meilisearch.com/docs/learn/getting_started/quick_start) + +In Calckey's directory, fill out the `meilisearch` section of `.config/default.yml` with the correct information. + +### ElasticSearch + +Please don't use ElasticSearch unless you already have an ElasticSearch setup and want to continue using it for Calckey. ElasticSearch is slow, heavy, and offers very few benefits over Sonic/Meilisearch. ## 💅 Customize diff --git a/docker-compose.yml b/docker-compose.yml index 5de14d0c8..bf4e4fb8d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: depends_on: - db - redis - - sonic + - meilisearch ports: - "3000:3000" networks: @@ -40,17 +40,33 @@ services: volumes: - ./db:/var/lib/postgresql/data - sonic: - restart: unless-stopped - image: docker.io/valeriansaliou/sonic:v1.4.0 - networks: - - calcnet - volumes: - - ./sonic:/var/lib/sonic/store - - ./sonic/config.cfg:/etc/sonic.cfg +### Only one of the below should be used. +### Meilisearch is better overall, but resource-intensive. Sonic is a very light full text search engine. + +# meilisearch: +# container_name: meilisearch +# image: getmeili/meilisearch:v1.1.1 +# environment: +# - MEILI_ENV=${MEILI_ENV:-development} +# ports: +# - "7700:7700" +# networks: +# - calcnet +# volumes: +# - ./meili_data:/meili_data +# restart: unless-stopped + +# sonic: +# restart: unless-stopped +# image: docker.io/valeriansaliou/sonic:v1.4.0 +# networks: +# - calcnet +# volumes: +# - ./sonic:/var/lib/sonic/store +# - ./sonic/config.cfg:/etc/sonic.cfg networks: calcnet: - # web: - # external: - # name: web + # web: + # external: + # name: web diff --git a/locales/en-US.yml b/locales/en-US.yml index 98d4d7703..437a9cd35 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -5,6 +5,7 @@ introMisskey: "Welcome! Calckey is an open source, decentralized social media pl \ that's free forever! \U0001F680" monthAndDay: "{month}/{day}" search: "Search" +searchPlaceholder: "Search Calckey" notifications: "Notifications" username: "Username" password: "Password" @@ -1529,30 +1530,35 @@ _weekday: friday: "Friday" saturday: "Saturday" _widgets: - memo: "Sticky notes" + memo: "Sticky Notes" notifications: "Notifications" timeline: "Timeline" calendar: "Calendar" trends: "Trending" clock: "Clock" - rss: "RSS reader" - rssTicker: "RSS-Ticker" + rss: "RSS Reader" + rssTicker: "RSS Ticker" activity: "Activity" photos: "Photos" - digitalClock: "Digital clock" - unixClock: "UNIX clock" + digitalClock: "Digital Clock" + unixClock: "UNIX Clock" federation: "Federation" - instanceCloud: "Server cloud" - postForm: "Posting form" + instanceCloud: "Server Cloud" + postForm: "Posting Form" slideshow: "Slideshow" button: "Button" - onlineUsers: "Online users" + onlineUsers: "Online Users" jobQueue: "Job Queue" - serverMetric: "Server metrics" - aiscript: "AiScript console" - userList: "User list" + serverMetric: "Server Metrics" + aiscript: "AiScript Console" + userList: "User List" + serverInfo: "Server Info" _userList: chooseList: "Select a list" + meiliStatus: "Server Status" + meiliSize: "Index size" + meiliIndexCount: "Indexed posts" + _cw: hide: "Hide" show: "Show content" diff --git a/package.json b/package.json index 2899adf7e..b793290eb 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "calckey", - "version": "14.0.0-dev26", + "version": "14.0.0-dev31", "codename": "aqua", "repository": { "type": "git", "url": "https://codeberg.org/calckey/calckey.git" }, - "packageManager": "pnpm@8.5.1", + "packageManager": "pnpm@8.6.0", "private": true, "scripts": { "rebuild": "pnpm run clean && pnpm -r run build && pnpm run gulp", diff --git a/packages/backend/jsconfig.json b/packages/backend/jsconfig.json index 1230aadd1..f3f4f9c77 100644 --- a/packages/backend/jsconfig.json +++ b/packages/backend/jsconfig.json @@ -4,10 +4,5 @@ "module": "commonjs", "allowSyntheticDefaultImports": true }, - "exclude": [ - "node_modules", - "jspm_packages", - "tmp", - "temp" - ] + "exclude": ["node_modules", "jspm_packages", "tmp", "temp"] } diff --git a/packages/backend/native-utils/__test__/index.spec.mjs b/packages/backend/native-utils/__test__/index.spec.mjs index 0d41e012d..1788dbb06 100644 --- a/packages/backend/native-utils/__test__/index.spec.mjs +++ b/packages/backend/native-utils/__test__/index.spec.mjs @@ -1,7 +1,15 @@ import test from "ava"; -import { sum } from "../index.js"; +import { convertId, IdConvertType } from "../built/index.js"; -test("sum from native", (t) => { - t.is(sum(1, 2), 3); +test("convert to mastodon id", (t) => { + t.is(convertId("9gf61ehcxv", IdConvertType.MastodonId), "960365976481219"); + t.is( + convertId("9fbr9z0wbrjqyd3u", IdConvertType.MastodonId), + "3954607381600562394", + ); + t.is( + convertId("9fbs680oyviiqrol9md73p8g", IdConvertType.MastodonId), + "3494513243013053824", + ); }); diff --git a/packages/backend/package.json b/packages/backend/package.json index 96edb7f02..bffa42c49 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -32,6 +32,7 @@ "@koa/cors": "3.4.3", "@koa/multer": "3.0.0", "@koa/router": "9.0.1", + "@paralleldrive/cuid2": "2.2.0", "@peertube/http-signature": "1.7.0", "@redocly/openapi-core": "1.0.0-beta.120", "@sinonjs/fake-timers": "9.1.2", @@ -85,6 +86,7 @@ "koa-send": "5.0.1", "koa-slow": "2.1.0", "koa-views": "7.0.2", + "meilisearch": "0.32.4", "mfm-js": "0.23.3", "mime-types": "2.1.35", "multer": "1.4.4-lts.1", diff --git a/packages/backend/src/config/types.ts b/packages/backend/src/config/types.ts index 01a98f9f0..54332c993 100644 --- a/packages/backend/src/config/types.ts +++ b/packages/backend/src/config/types.ts @@ -39,6 +39,12 @@ export type Source = { collection?: string; bucket?: string; }; + meilisearch: { + host: string; + port: number; + apiKey?: string; + ssl: boolean; + }; proxy?: string; proxySmtp?: string; @@ -54,7 +60,10 @@ export type Source = { onlyQueueProcessor?: boolean; - id: string; + cuid?: { + length?: number; + fingerprint?: string; + }; outgoingAddressFamily?: "ipv4" | "ipv6" | "dual"; diff --git a/packages/backend/src/daemons/server-stats.ts b/packages/backend/src/daemons/server-stats.ts index b0bf1288f..c936d619a 100644 --- a/packages/backend/src/daemons/server-stats.ts +++ b/packages/backend/src/daemons/server-stats.ts @@ -1,6 +1,7 @@ import si from "systeminformation"; import Xev from "xev"; import * as osUtils from "os-utils"; +import meilisearch from "../db/meilisearch.js"; const ev = new Xev(); @@ -24,6 +25,7 @@ export default function () { const memStats = await mem(); const netStats = await net(); const fsStats = await fs(); + const meilisearchStats = await meilisearchStatus(); const stats = { cpu: roundCpu(cpu), @@ -39,6 +41,7 @@ export default function () { r: round(Math.max(0, fsStats.rIO_sec ?? 0)), w: round(Math.max(0, fsStats.wIO_sec ?? 0)), }, + meilisearch: meilisearchStats, }; ev.emit("serverStats", stats); log.unshift(stats); @@ -77,3 +80,16 @@ async function fs() { const data = await si.disksIO().catch(() => ({ rIO_sec: 0, wIO_sec: 0 })); return data || { rIO_sec: 0, wIO_sec: 0 }; } + +// MEILI STAT +async function meilisearchStatus() { + if (meilisearch) { + return meilisearch.serverStats(); + } else { + return { + health: "unconfigured", + size: 0, + indexed_count: 0, + }; + } +} diff --git a/packages/backend/src/db/meilisearch.ts b/packages/backend/src/db/meilisearch.ts new file mode 100644 index 000000000..e50f72662 --- /dev/null +++ b/packages/backend/src/db/meilisearch.ts @@ -0,0 +1,292 @@ +import { Health, MeiliSearch, Stats } from "meilisearch"; +import { dbLogger } from "./logger.js"; + +import config from "@/config/index.js"; +import { Note } from "@/models/entities/note.js"; +import * as url from "url"; +import { ILocalUser, User } from "@/models/entities/user.js"; +import { Followings, Users } from "@/models/index.js"; + +const logger = dbLogger.createSubLogger("meilisearch", "gray", false); + +const hasConfig = + config.meilisearch && + (config.meilisearch.host || + config.meilisearch.port || + config.meilisearch.apiKey); + +if (hasConfig) { + const host = hasConfig ? config.meilisearch.host ?? "localhost" : ""; + const port = hasConfig ? config.meilisearch.port ?? 7700 : 0; + const auth = hasConfig ? config.meilisearch.apiKey ?? "" : ""; + const ssl = hasConfig ? config.meilisearch.ssl ?? false : false; + + logger.info("Connecting to MeiliSearch"); + + const client: MeiliSearch = new MeiliSearch({ + host: `${ssl ? "https" : "http"}://${host}:${port}`, + apiKey: auth, + }); + + const posts = client.index("posts"); + + posts + .updateSearchableAttributes(["text"]) + .catch((e) => + logger.error(`Setting searchable attr failed, searches won't work: ${e}`), + ); + + posts + .updateFilterableAttributes([ + "userName", + "userHost", + "mediaAttachment", + "createdAt", + "userId", + ]) + .catch((e) => + logger.error( + `Setting filterable attr failed, advanced searches won't work: ${e}`, + ), + ); + + posts + .updateSortableAttributes(["createdAt"]) + .catch((e) => + logger.error( + `Setting sortable attr failed, placeholder searches won't sort properly: ${e}`, + ), + ); + + logger.info("Connected to MeiliSearch"); +} + +export type MeilisearchNote = { + id: string; + text: string; + userId: string; + userHost: string; + userName: string; + channelId: string; + mediaAttachment: string; + createdAt: number; +}; + +export default hasConfig + ? { + search: async ( + query: string, + limit: number, + offset: number, + userCtx: ILocalUser | null, + ) => { + /// Advanced search syntax + /// from:user => filter by user + optional domain + /// has:image/video/audio/text/file => filter by attachment types + /// domain:domain.com => filter by domain + /// before:Date => show posts made before Date + /// after: Date => show posts made after Date + /// "text" => get posts with exact text between quotes + /// filter:following => show results only from users you follow + /// filter:followers => show results only from followers + + let constructedFilters: string[] = []; + + let splitSearch = query.split(" "); + + // Detect search operators and remove them from the actual query + let filteredSearchTerms = ( + await Promise.all( + splitSearch.map(async (term) => { + if (term.startsWith("has:")) { + let fileType = term.slice(4); + constructedFilters.push(`mediaAttachment = "${fileType}"`); + return null; + } else if (term.startsWith("from:")) { + let user = term.slice(5); + constructedFilters.push(`userName = ${user}`); + return null; + } else if (term.startsWith("domain:")) { + let domain = term.slice(7); + constructedFilters.push(`userHost = ${domain}`); + return null; + } else if (term.startsWith("after:")) { + let timestamp = term.slice(6); + // Try to parse the timestamp as JavaScript Date + let date = Date.parse(timestamp); + if (isNaN(date)) return null; + constructedFilters.push(`createdAt > ${date / 1000}`); + return null; + } else if (term.startsWith("before:")) { + let timestamp = term.slice(7); + // Try to parse the timestamp as JavaScript Date + let date = Date.parse(timestamp); + if (isNaN(date)) return null; + constructedFilters.push(`createdAt < ${date / 1000}`); + return null; + } else if (term.startsWith("filter:following")) { + // Check if we got a context user + if (userCtx) { + // Fetch user follows from DB + let followedUsers = await Followings.find({ + where: { + followerId: userCtx.id, + }, + select: { + followeeId: true, + }, + }); + let followIDs = followedUsers.map((user) => user.followeeId); + + if (followIDs.length === 0) return null; + + constructedFilters.push(`userId IN [${followIDs.join(",")}]`); + } else { + logger.warn( + "search filtered to follows called without user context", + ); + } + + return null; + } else if (term.startsWith("filter:followers")) { + // Check if we got a context user + if (userCtx) { + // Fetch users follows from DB + let followedUsers = await Followings.find({ + where: { + followeeId: userCtx.id, + }, + select: { + followerId: true, + }, + }); + let followIDs = followedUsers.map((user) => user.followerId); + + if (followIDs.length === 0) return null; + + constructedFilters.push(`userId IN [${followIDs.join(",")}]`); + } else { + logger.warn( + "search filtered to followers called without user context", + ); + } + + return null; + } + + return term; + }), + ) + ).filter((term) => term !== null); + + let sortRules = []; + + // An empty search term with defined filters means we have a placeholder search => https://www.meilisearch.com/docs/reference/api/search#placeholder-search + // These have to be ordered manually, otherwise the *oldest* posts are returned first, which we don't want + if (filteredSearchTerms.length === 0 && constructedFilters.length > 0) { + sortRules.push("createdAt:desc"); + } + + logger.info(`Searching for ${filteredSearchTerms.join(" ")}`); + logger.info(`Limit: ${limit}`); + logger.info(`Offset: ${offset}`); + logger.info(`Filters: ${constructedFilters}`); + logger.info(`Ordering: ${sortRules}`); + + return posts.search(filteredSearchTerms.join(" "), { + limit: limit, + offset: offset, + filter: constructedFilters, + sort: sortRules, + }); + }, + ingestNote: async (ingestNotes: Note | Note[]) => { + if (ingestNotes instanceof Note) { + ingestNotes = [ingestNotes]; + } + + let indexingBatch: MeilisearchNote[] = []; + + for (let note of ingestNotes) { + if (note.user === undefined) { + note.user = await Users.findOne({ + where: { + id: note.userId, + }, + }); + } + + let attachmentType = ""; + if (note.attachedFileTypes.length > 0) { + attachmentType = note.attachedFileTypes[0].split("/")[0]; + switch (attachmentType) { + case "image": + case "video": + case "audio": + case "text": + break; + default: + attachmentType = "file"; + break; + } + } + + indexingBatch.push({ + id: note.id.toString(), + text: note.text ? note.text : "", + userId: note.userId, + userHost: + note.userHost !== "" + ? note.userHost + : url.parse(config.host).host, + channelId: note.channelId ? note.channelId : "", + mediaAttachment: attachmentType, + userName: note.user?.username ?? "UNKNOWN", + createdAt: note.createdAt.getTime() / 1000, // division by 1000 is necessary because Node returns in ms-accuracy + }); + } + + return posts + .addDocuments(indexingBatch, { + primaryKey: "id", + }) + .then(() => + console.log(`sent ${indexingBatch.length} posts for indexing`), + ); + }, + serverStats: async () => { + let health: Health = await client.health(); + let stats: Stats = await client.getStats(); + + return { + health: health.status, + size: stats.databaseSize, + indexed_count: stats.indexes["posts"].numberOfDocuments, + }; + }, + deleteNotes: async (note: Note | Note[] | string | string[]) => { + if (note instanceof Note) { + note = [note]; + } + if (typeof note === "string") { + note = [note]; + } + + let deletionBatch = note.map((n) => { + if(n instanceof Note) { + return n.id; + } + + if(n.length > 0) return n; + + logger.error(`Failed to delete note from Meilisearch, invalid post ID: ${JSON.stringify(n)}`) + + throw new Error(`Invalid note ID passed to meilisearch deleteNote: ${JSON.stringify(n)}`) + }).filter((el) => el !== null); + + await posts.deleteDocuments(deletionBatch as string[]).then(() => { + logger.info(`submitted ${deletionBatch.length} large batch for deletion`) + }); + }, + } + : null; diff --git a/packages/backend/src/misc/gen-id.ts b/packages/backend/src/misc/gen-id.ts index b7cc0965a..fb92dd808 100644 --- a/packages/backend/src/misc/gen-id.ts +++ b/packages/backend/src/misc/gen-id.ts @@ -1,27 +1,27 @@ -import { ulid } from "ulid"; -import { genAid } from "./id/aid.js"; -import { genMeid } from "./id/meid.js"; -import { genMeidg } from "./id/meidg.js"; -import { genObjectId } from "./id/object-id.js"; +import { init, createId } from "@paralleldrive/cuid2"; import config from "@/config/index.js"; -const metohd = config.id.toLowerCase(); +const TIME2000 = 946684800000; +const TIMESTAMP_LENGTH = 8; +const length = + Math.min(Math.max(config.cuid?.length ?? 16, 16), 24) - TIMESTAMP_LENGTH; +const fingerprint = `${config.cuid?.fingerprint ?? ""}${createId()}`; + +const genCuid2 = init({ length, fingerprint }); + +/** + * The generated ID results in the form of `[8 chars timestamp] + [cuid2]`. + * The minimum and maximum lengths are 16 and 24, respectively. + * With the length of 16, namely 8 for cuid2, roughly 1427399 IDs are needed + * in the same millisecond to reach 50% chance of collision. + * + * Ref: https://github.com/paralleldrive/cuid2#parameterized-length + */ export function genId(date?: Date): string { - if (!date || date > new Date()) date = new Date(); + const now = (date ?? new Date()).getTime(); + const time = Math.max(now - TIME2000, 0); + const timestamp = time.toString(36).padStart(TIMESTAMP_LENGTH, "0"); - switch (metohd) { - case "aid": - return genAid(date); - case "meid": - return genMeid(date); - case "meidg": - return genMeidg(date); - case "ulid": - return ulid(date.getTime()); - case "objectid": - return genObjectId(date); - default: - throw new Error("unrecognized id generation method"); - } + return `${timestamp}${genCuid2()}`; } diff --git a/packages/backend/src/models/entities/abuse-user-report.ts b/packages/backend/src/models/entities/abuse-user-report.ts index 655fdd3ca..be183548d 100644 --- a/packages/backend/src/models/entities/abuse-user-report.ts +++ b/packages/backend/src/models/entities/abuse-user-report.ts @@ -15,8 +15,8 @@ export class AbuseUserReport { public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the AbuseUserReport.', + @Column("timestamp with time zone", { + comment: "The created date of the AbuseUserReport.", }) public createdAt: Date; @@ -24,8 +24,8 @@ export class AbuseUserReport { @Column(id()) public targetUserId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public targetUser: User | null; @@ -34,8 +34,8 @@ export class AbuseUserReport { @Column(id()) public reporterId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public reporter: User | null; @@ -46,40 +46,42 @@ export class AbuseUserReport { }) public assigneeId: User["id"] | null; - @ManyToOne(type => User, { - onDelete: 'SET NULL', + @ManyToOne((type) => User, { + onDelete: "SET NULL", }) @JoinColumn() public assignee: User | null; @Index() - @Column('boolean', { + @Column("boolean", { default: false, }) public resolved: boolean; - @Column('boolean', { - default: false + @Column("boolean", { + default: false, }) public forwarded: boolean; - @Column('varchar', { + @Column("varchar", { length: 2048, }) public comment: string; //#region Denormalized fields @Index() - @Column('varchar', { - length: 128, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 128, + nullable: true, + comment: "[Denormalized]", }) public targetUserHost: string | null; @Index() - @Column('varchar', { - length: 128, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 128, + nullable: true, + comment: "[Denormalized]", }) public reporterHost: string | null; //#endregion diff --git a/packages/backend/src/models/entities/access-token.ts b/packages/backend/src/models/entities/access-token.ts index 83d7bbda8..8b950b171 100644 --- a/packages/backend/src/models/entities/access-token.ts +++ b/packages/backend/src/models/entities/access-token.ts @@ -15,31 +15,31 @@ export class AccessToken { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the AccessToken.', + @Column("timestamp with time zone", { + comment: "The created date of the AccessToken.", }) public createdAt: Date; - @Column('timestamp with time zone', { + @Column("timestamp with time zone", { nullable: true, }) public lastUsedAt: Date | null; @Index() - @Column('varchar', { + @Column("varchar", { length: 128, }) public token: string; @Index() - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public session: string | null; @Index() - @Column('varchar', { + @Column("varchar", { length: 128, }) public hash: string; @@ -48,8 +48,8 @@ export class AccessToken { @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -60,37 +60,38 @@ export class AccessToken { }) public appId: App["id"] | null; - @ManyToOne(type => App, { - onDelete: 'CASCADE', + @ManyToOne((type) => App, { + onDelete: "CASCADE", }) @JoinColumn() public app: App | null; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public name: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public description: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public iconUrl: string | null; - @Column('varchar', { - length: 64, array: true, - default: '{}', + @Column("varchar", { + length: 64, + array: true, + default: "{}", }) public permission: string[]; - @Column('boolean', { + @Column("boolean", { default: false, }) public fetched: boolean; diff --git a/packages/backend/src/models/entities/ad.ts b/packages/backend/src/models/entities/ad.ts index fa4297365..80d54ddd5 100644 --- a/packages/backend/src/models/entities/ad.ts +++ b/packages/backend/src/models/entities/ad.ts @@ -7,45 +7,51 @@ export class Ad { public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the Ad.', + @Column("timestamp with time zone", { + comment: "The created date of the Ad.", }) public createdAt: Date; @Index() - @Column('timestamp with time zone', { - comment: 'The expired date of the Ad.', + @Column("timestamp with time zone", { + comment: "The expired date of the Ad.", }) public expiresAt: Date; - @Column('varchar', { - length: 32, nullable: false, + @Column("varchar", { + length: 32, + nullable: false, }) public place: string; // 今は使われていないが将来的に活用される可能性はある - @Column('varchar', { - length: 32, nullable: false, + @Column("varchar", { + length: 32, + nullable: false, }) public priority: string; - @Column('integer', { - default: 1, nullable: false, + @Column("integer", { + default: 1, + nullable: false, }) public ratio: number; - @Column('varchar', { - length: 1024, nullable: false, + @Column("varchar", { + length: 1024, + nullable: false, }) public url: string; - @Column('varchar', { - length: 1024, nullable: false, + @Column("varchar", { + length: 1024, + nullable: false, }) public imageUrl: string; - @Column('varchar', { - length: 8192, nullable: false, + @Column("varchar", { + length: 8192, + nullable: false, }) public memo: string; diff --git a/packages/backend/src/models/entities/announcement-read.ts b/packages/backend/src/models/entities/announcement-read.ts index 87d0f0e9e..79af9e48e 100644 --- a/packages/backend/src/models/entities/announcement-read.ts +++ b/packages/backend/src/models/entities/announcement-read.ts @@ -11,13 +11,13 @@ import { Announcement } from "./announcement.js"; import { id } from "../id.js"; @Entity() -@Index(['userId', 'announcementId'], { unique: true }) +@Index(["userId", "announcementId"], { unique: true }) export class AnnouncementRead { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the AnnouncementRead.', + @Column("timestamp with time zone", { + comment: "The created date of the AnnouncementRead.", }) public createdAt: Date; @@ -25,8 +25,8 @@ export class AnnouncementRead { @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -35,8 +35,8 @@ export class AnnouncementRead { @Column(id()) public announcementId: Announcement["id"]; - @ManyToOne(type => Announcement, { - onDelete: 'CASCADE', + @ManyToOne((type) => Announcement, { + onDelete: "CASCADE", }) @JoinColumn() public announcement: Announcement | null; diff --git a/packages/backend/src/models/entities/announcement.ts b/packages/backend/src/models/entities/announcement.ts index 9d45af014..1939604b9 100644 --- a/packages/backend/src/models/entities/announcement.ts +++ b/packages/backend/src/models/entities/announcement.ts @@ -7,29 +7,32 @@ export class Announcement { public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the Announcement.', + @Column("timestamp with time zone", { + comment: "The created date of the Announcement.", }) public createdAt: Date; - @Column('timestamp with time zone', { - comment: 'The updated date of the Announcement.', + @Column("timestamp with time zone", { + comment: "The updated date of the Announcement.", nullable: true, }) public updatedAt: Date | null; - @Column('varchar', { - length: 8192, nullable: false, + @Column("varchar", { + length: 8192, + nullable: false, }) public text: string; - @Column('varchar', { - length: 256, nullable: false, + @Column("varchar", { + length: 256, + nullable: false, }) public title: string; - @Column('varchar', { - length: 1024, nullable: true, + @Column("varchar", { + length: 1024, + nullable: true, }) public imageUrl: string | null; diff --git a/packages/backend/src/models/entities/antenna-note.ts b/packages/backend/src/models/entities/antenna-note.ts index c47c796bb..fe982c19e 100644 --- a/packages/backend/src/models/entities/antenna-note.ts +++ b/packages/backend/src/models/entities/antenna-note.ts @@ -11,7 +11,7 @@ import { Antenna } from "./antenna.js"; import { id } from "../id.js"; @Entity() -@Index(['noteId', 'antennaId'], { unique: true }) +@Index(["noteId", "antennaId"], { unique: true }) export class AntennaNote { @PrimaryColumn(id()) public id: string; @@ -19,12 +19,12 @@ export class AntennaNote { @Index() @Column({ ...id(), - comment: 'The note ID.', + comment: "The note ID.", }) public noteId: Note["id"]; - @ManyToOne(type => Note, { - onDelete: 'CASCADE', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; @@ -32,18 +32,18 @@ export class AntennaNote { @Index() @Column({ ...id(), - comment: 'The antenna ID.', + comment: "The antenna ID.", }) public antennaId: Antenna["id"]; - @ManyToOne(type => Antenna, { - onDelete: 'CASCADE', + @ManyToOne((type) => Antenna, { + onDelete: "CASCADE", }) @JoinColumn() public antenna: Antenna | null; @Index() - @Column('boolean', { + @Column("boolean", { default: false, }) public read: boolean; diff --git a/packages/backend/src/models/entities/antenna.ts b/packages/backend/src/models/entities/antenna.ts index c653b2a05..633dcc1d2 100644 --- a/packages/backend/src/models/entities/antenna.ts +++ b/packages/backend/src/models/entities/antenna.ts @@ -16,31 +16,33 @@ export class Antenna { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the Antenna.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; - @Column('varchar', { + @Column("varchar", { length: 128, - comment: 'The name of the Antenna.', + comment: "The name of the Antenna.", }) public name: string; - @Column('enum', { enum: ['home', 'all', 'users', 'list', 'group', 'instances'] }) + @Column("enum", { + enum: ["home", "all", "users", "list", "group", "instances"], + }) public src: "home" | "all" | "users" | "list" | "group" | "instances"; @Column({ @@ -49,8 +51,8 @@ export class Antenna { }) public userListId: UserList["id"] | null; - @ManyToOne(type => UserList, { - onDelete: 'CASCADE', + @ManyToOne((type) => UserList, { + onDelete: "CASCADE", }) @JoinColumn() public userList: UserList | null; @@ -61,51 +63,53 @@ export class Antenna { }) public userGroupJoiningId: UserGroupJoining["id"] | null; - @ManyToOne(type => UserGroupJoining, { - onDelete: 'CASCADE', + @ManyToOne((type) => UserGroupJoining, { + onDelete: "CASCADE", }) @JoinColumn() public userGroupJoining: UserGroupJoining | null; - @Column('varchar', { - length: 1024, array: true, - default: '{}', + @Column("varchar", { + length: 1024, + array: true, + default: "{}", }) public users: string[]; - @Column('jsonb', { + @Column("jsonb", { default: [], }) public instances: string[]; - @Column('jsonb', { + @Column("jsonb", { default: [], }) public keywords: string[][]; - @Column('jsonb', { + @Column("jsonb", { default: [], }) public excludeKeywords: string[][]; - @Column('boolean', { + @Column("boolean", { default: false, }) public caseSensitive: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public withReplies: boolean; - @Column('boolean') + @Column("boolean") public withFile: boolean; - @Column('varchar', { - length: 2048, nullable: true, + @Column("varchar", { + length: 2048, + nullable: true, }) public expression: string | null; - @Column('boolean') + @Column("boolean") public notify: boolean; } diff --git a/packages/backend/src/models/entities/app.ts b/packages/backend/src/models/entities/app.ts index bb33eede4..a41e35aa9 100644 --- a/packages/backend/src/models/entities/app.ts +++ b/packages/backend/src/models/entities/app.ts @@ -8,8 +8,8 @@ export class App { public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the App.', + @Column("timestamp with time zone", { + comment: "The created date of the App.", }) public createdAt: Date; @@ -17,44 +17,46 @@ export class App { @Column({ ...id(), nullable: true, - comment: 'The owner ID.', + comment: "The owner ID.", }) public userId: User["id"] | null; - @ManyToOne(type => User, { - onDelete: 'SET NULL', + @ManyToOne((type) => User, { + onDelete: "SET NULL", nullable: true, }) public user: User | null; @Index() - @Column('varchar', { + @Column("varchar", { length: 64, - comment: 'The secret key of the App.', + comment: "The secret key of the App.", }) public secret: string; - @Column('varchar', { + @Column("varchar", { length: 128, - comment: 'The name of the App.', + comment: "The name of the App.", }) public name: string; - @Column('varchar', { + @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.', + @Column("varchar", { + length: 64, + array: true, + comment: "The permission of the App.", }) public permission: string[]; - @Column('varchar', { - length: 512, nullable: true, - comment: 'The callbackUrl of the App.', + @Column("varchar", { + length: 512, + nullable: true, + comment: "The callbackUrl of the App.", }) public callbackUrl: string | null; } diff --git a/packages/backend/src/models/entities/attestation-challenge.ts b/packages/backend/src/models/entities/attestation-challenge.ts index 7a87d42be..6a3a9c8ed 100644 --- a/packages/backend/src/models/entities/attestation-challenge.ts +++ b/packages/backend/src/models/entities/attestation-challenge.ts @@ -18,27 +18,27 @@ export class AttestationChallenge { @PrimaryColumn(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @Index() - @Column('varchar', { + @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.', + @Column("timestamp with time zone", { + comment: "The date challenge was created for expiry purposes.", }) public createdAt: Date; - @Column('boolean', { + @Column("boolean", { comment: - 'Indicates that the challenge is only for registration purposes if true to prevent the challenge for being used as authentication.', + "Indicates that the challenge is only for registration purposes if true to prevent the challenge for being used as authentication.", default: false, }) public registrationChallenge: boolean; diff --git a/packages/backend/src/models/entities/auth-session.ts b/packages/backend/src/models/entities/auth-session.ts index b762f8462..b31dca56c 100644 --- a/packages/backend/src/models/entities/auth-session.ts +++ b/packages/backend/src/models/entities/auth-session.ts @@ -15,13 +15,13 @@ export class AuthSession { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the AuthSession.', + @Column("timestamp with time zone", { + comment: "The created date of the AuthSession.", }) public createdAt: Date; @Index() - @Column('varchar', { + @Column("varchar", { length: 128, }) public token: string; @@ -32,8 +32,8 @@ export class AuthSession { }) public userId: User["id"] | null; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", nullable: true, }) @JoinColumn() @@ -42,8 +42,8 @@ export class AuthSession { @Column(id()) public appId: App["id"]; - @ManyToOne(type => App, { - onDelete: 'CASCADE', + @ManyToOne((type) => App, { + onDelete: "CASCADE", }) @JoinColumn() public app: App | null; diff --git a/packages/backend/src/models/entities/blocking.ts b/packages/backend/src/models/entities/blocking.ts index 3a44a4d65..55f677a98 100644 --- a/packages/backend/src/models/entities/blocking.ts +++ b/packages/backend/src/models/entities/blocking.ts @@ -10,26 +10,26 @@ import { User } from "./user.js"; import { id } from "../id.js"; @Entity() -@Index(['blockerId', 'blockeeId'], { unique: true }) +@Index(["blockerId", "blockeeId"], { unique: true }) export class Blocking { @PrimaryColumn(id()) public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the Blocking.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public blockee: User | null; @@ -37,12 +37,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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public blocker: User | null; diff --git a/packages/backend/src/models/entities/channel-following.ts b/packages/backend/src/models/entities/channel-following.ts index 04ec193e1..ee329fa50 100644 --- a/packages/backend/src/models/entities/channel-following.ts +++ b/packages/backend/src/models/entities/channel-following.ts @@ -11,26 +11,26 @@ import { id } from "../id.js"; import { Channel } from "./channel.js"; @Entity() -@Index(['followerId', 'followeeId'], { unique: true }) +@Index(["followerId", "followeeId"], { unique: true }) export class ChannelFollowing { @PrimaryColumn(id()) public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the ChannelFollowing.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => Channel, { + onDelete: "CASCADE", }) @JoinColumn() public followee: Channel | null; @@ -38,12 +38,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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public follower: User | null; diff --git a/packages/backend/src/models/entities/channel-note-pining.ts b/packages/backend/src/models/entities/channel-note-pining.ts index bd13f4ca3..67d1d48cc 100644 --- a/packages/backend/src/models/entities/channel-note-pining.ts +++ b/packages/backend/src/models/entities/channel-note-pining.ts @@ -11,13 +11,13 @@ import { Channel } from "./channel.js"; import { id } from "../id.js"; @Entity() -@Index(['channelId', 'noteId'], { unique: true }) +@Index(["channelId", "noteId"], { unique: true }) export class ChannelNotePining { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the ChannelNotePining.', + @Column("timestamp with time zone", { + comment: "The created date of the ChannelNotePining.", }) public createdAt: Date; @@ -25,8 +25,8 @@ export class ChannelNotePining { @Column(id()) public channelId: Channel["id"]; - @ManyToOne(type => Channel, { - onDelete: 'CASCADE', + @ManyToOne((type) => Channel, { + onDelete: "CASCADE", }) @JoinColumn() public channel: Channel | null; @@ -34,8 +34,8 @@ export class ChannelNotePining { @Column(id()) public noteId: Note["id"]; - @ManyToOne(type => Note, { - onDelete: 'CASCADE', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; diff --git a/packages/backend/src/models/entities/channel.ts b/packages/backend/src/models/entities/channel.ts index 7f9851dbf..ea22fed50 100644 --- a/packages/backend/src/models/entities/channel.ts +++ b/packages/backend/src/models/entities/channel.ts @@ -16,13 +16,13 @@ export class Channel { public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the Channel.', + @Column("timestamp with time zone", { + comment: "The created date of the Channel.", }) public createdAt: Date; @Index() - @Column('timestamp with time zone', { + @Column("timestamp with time zone", { nullable: true, }) public lastNotedAt: Date | null; @@ -31,52 +31,53 @@ 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', + @ManyToOne((type) => User, { + onDelete: "SET NULL", }) @JoinColumn() public user: User | null; - @Column('varchar', { + @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.', + @Column("varchar", { + length: 2048, + nullable: true, + 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', + @ManyToOne((type) => DriveFile, { + onDelete: "SET NULL", }) @JoinColumn() public banner: DriveFile | null; @Index() - @Column('integer', { + @Column("integer", { default: 0, - comment: 'The count of notes.', + comment: "The count of notes.", }) public notesCount: number; @Index() - @Column('integer', { + @Column("integer", { default: 0, - comment: 'The count of users.', + comment: "The count of users.", }) public usersCount: number; } diff --git a/packages/backend/src/models/entities/clip-note.ts b/packages/backend/src/models/entities/clip-note.ts index bc51daaf4..1697474a8 100644 --- a/packages/backend/src/models/entities/clip-note.ts +++ b/packages/backend/src/models/entities/clip-note.ts @@ -11,7 +11,7 @@ import { Clip } from "./clip.js"; import { id } from "../id.js"; @Entity() -@Index(['noteId', 'clipId'], { unique: true }) +@Index(["noteId", "clipId"], { unique: true }) export class ClipNote { @PrimaryColumn(id()) public id: string; @@ -19,12 +19,12 @@ export class ClipNote { @Index() @Column({ ...id(), - comment: 'The note ID.', + comment: "The note ID.", }) public noteId: Note["id"]; - @ManyToOne(type => Note, { - onDelete: 'CASCADE', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; @@ -32,12 +32,12 @@ export class ClipNote { @Index() @Column({ ...id(), - comment: 'The clip ID.', + comment: "The clip ID.", }) public clipId: Clip["id"]; - @ManyToOne(type => Clip, { - onDelete: 'CASCADE', + @ManyToOne((type) => Clip, { + onDelete: "CASCADE", }) @JoinColumn() public clip: Clip | null; diff --git a/packages/backend/src/models/entities/clip.ts b/packages/backend/src/models/entities/clip.ts index 10591cbee..9554703a4 100644 --- a/packages/backend/src/models/entities/clip.ts +++ b/packages/backend/src/models/entities/clip.ts @@ -14,38 +14,39 @@ export class Clip { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the Clip.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; - @Column('varchar', { + @Column("varchar", { length: 128, - comment: 'The name of the Clip.', + comment: "The name of the Clip.", }) public name: string; - @Column('boolean', { + @Column("boolean", { default: false, }) public isPublic: boolean; - @Column('varchar', { - length: 2048, nullable: true, - comment: 'The description of the Clip.', + @Column("varchar", { + length: 2048, + nullable: true, + comment: "The description of the Clip.", }) public description: string | null; } diff --git a/packages/backend/src/models/entities/drive-file.ts b/packages/backend/src/models/entities/drive-file.ts index 32e19bc6e..d8b54fa19 100644 --- a/packages/backend/src/models/entities/drive-file.ts +++ b/packages/backend/src/models/entities/drive-file.ts @@ -12,14 +12,14 @@ import { DriveFolder } from "./drive-folder.js"; import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; @Entity() -@Index(['userId', 'folderId', 'id']) +@Index(["userId", "folderId", "id"]) export class DriveFile { @PrimaryColumn(id()) public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the DriveFile.', + @Column("timestamp with time zone", { + comment: "The created date of the DriveFile.", }) public createdAt: Date; @@ -27,64 +27,67 @@ 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', + @ManyToOne((type) => User, { + onDelete: "SET NULL", }) @JoinColumn() public user: User | null; @Index() - @Column('varchar', { - length: 128, nullable: true, - comment: 'The host of owner. It will be null if the user in local.', + @Column("varchar", { + length: 128, + nullable: true, + comment: "The host of owner. It will be null if the user in local.", }) public userHost: string | null; @Index() - @Column('varchar', { + @Column("varchar", { length: 32, - comment: 'The MD5 hash of the DriveFile.', + comment: "The MD5 hash of the DriveFile.", }) public md5: string; - @Column('varchar', { + @Column("varchar", { length: 256, - comment: 'The file name of the DriveFile.', + comment: "The file name of the DriveFile.", }) public name: string; @Index() - @Column('varchar', { + @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.', + @Column("integer", { + comment: "The file size (bytes) of the DriveFile.", }) public size: number; - @Column('varchar', { + @Column("varchar", { length: DB_MAX_IMAGE_COMMENT_LENGTH, 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.', + @Column("varchar", { + length: 128, + nullable: true, + comment: "The BlurHash string.", }) public blurhash: string | null; - @Column('jsonb', { + @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; @@ -93,59 +96,68 @@ export class DriveFile { avgColor?: string; }; - @Column('boolean') + @Column("boolean") public storedInternal: boolean; - @Column('varchar', { + @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.', + @Column("varchar", { + length: 512, + nullable: true, + 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.', + @Column("varchar", { + length: 512, + nullable: true, + comment: "The URL of the webpublic of the DriveFile.", }) public webpublicUrl: string | null; - @Column('varchar', { - length: 128, nullable: true, + @Column("varchar", { + length: 128, + nullable: true, }) public webpublicType: string | null; @Index({ unique: true }) - @Column('varchar', { - length: 256, nullable: true, + @Column("varchar", { + length: 256, + nullable: true, }) public accessKey: string | null; @Index({ unique: true }) - @Column('varchar', { - length: 256, nullable: true, + @Column("varchar", { + length: 256, + nullable: true, }) public thumbnailAccessKey: string | null; @Index({ unique: true }) - @Column('varchar', { - length: 256, nullable: true, + @Column("varchar", { + length: 256, + nullable: true, }) public webpublicAccessKey: string | null; @Index() - @Column('varchar', { - length: 512, nullable: true, - comment: 'The URI of the DriveFile. it will be null when the DriveFile is local.', + @Column("varchar", { + length: 512, + nullable: true, + comment: + "The URI of the DriveFile. it will be null when the DriveFile is local.", }) public uri: string | null; - @Column('varchar', { - length: 512, nullable: true, + @Column("varchar", { + length: 512, + nullable: true, }) public src: string | null; @@ -153,32 +165,33 @@ 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', + @ManyToOne((type) => DriveFolder, { + onDelete: "SET NULL", }) @JoinColumn() public folder: DriveFolder | null; @Index() - @Column('boolean', { + @Column("boolean", { default: false, - comment: 'Whether the DriveFile is NSFW.', + comment: "Whether the DriveFile is NSFW.", }) public isSensitive: boolean; @Index() - @Column('boolean', { + @Column("boolean", { default: false, - comment: 'Whether the DriveFile is NSFW. (predict)', + comment: "Whether the DriveFile is NSFW. (predict)", }) public maybeSensitive: boolean; @Index() - @Column('boolean', { + @Column("boolean", { default: false, }) public maybePorn: boolean; @@ -187,20 +200,21 @@ export class DriveFile { * 外部の(信頼されていない)URLへの直リンクか否か */ @Index() - @Column('boolean', { + @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; - @Column('jsonb', { + @Column("jsonb", { default: {}, nullable: true, }) public requestHeaders: Record | null; - @Column('varchar', { - length: 128, nullable: true, + @Column("varchar", { + length: 128, + nullable: true, }) public requestIp: string | null; } diff --git a/packages/backend/src/models/entities/drive-folder.ts b/packages/backend/src/models/entities/drive-folder.ts index 77031ce4e..0bb2c7a3d 100644 --- a/packages/backend/src/models/entities/drive-folder.ts +++ b/packages/backend/src/models/entities/drive-folder.ts @@ -15,14 +15,14 @@ export class DriveFolder { public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the DriveFolder.', + @Column("timestamp with time zone", { + comment: "The created date of the DriveFolder.", }) public createdAt: Date; - @Column('varchar', { + @Column("varchar", { length: 128, - comment: 'The name of the DriveFolder.', + comment: "The name of the DriveFolder.", }) public name: string; @@ -30,12 +30,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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -44,12 +44,13 @@ 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', + @ManyToOne((type) => DriveFolder, { + onDelete: "SET NULL", }) @JoinColumn() public parent: DriveFolder | null; diff --git a/packages/backend/src/models/entities/emoji.ts b/packages/backend/src/models/entities/emoji.ts index 773265d91..727ba2f10 100644 --- a/packages/backend/src/models/entities/emoji.ts +++ b/packages/backend/src/models/entities/emoji.ts @@ -2,73 +2,82 @@ import { PrimaryColumn, Entity, Index, Column } from "typeorm"; import { id } from "../id.js"; @Entity() -@Index(['name', 'host'], { unique: true }) +@Index(["name", "host"], { unique: true }) export class Emoji { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { + @Column("timestamp with time zone", { nullable: true, }) public updatedAt: Date | null; @Index() - @Column('varchar', { + @Column("varchar", { length: 128, }) public name: string; @Index() - @Column('varchar', { - length: 128, nullable: true, + @Column("varchar", { + length: 128, + nullable: true, }) public host: string | null; - @Column('varchar', { - length: 128, nullable: true, + @Column("varchar", { + length: 128, + nullable: true, }) public category: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, }) public originalUrl: string; - @Column('varchar', { + @Column("varchar", { length: 512, - default: '', + default: "", }) public publicUrl: string; - @Column('varchar', { - length: 512, nullable: true, + @Column("varchar", { + length: 512, + nullable: true, }) public uri: string | null; // publicUrlの方のtypeが入る // (mime) - @Column('varchar', { - length: 64, nullable: true, + @Column("varchar", { + length: 64, + nullable: true, }) public type: string | null; - @Column('varchar', { - array: true, length: 128, default: '{}', + @Column("varchar", { + array: true, + length: 128, + default: "{}", }) public aliases: string[]; - @Column('varchar', { - length: 1024, nullable: true, + @Column("varchar", { + length: 1024, + nullable: true, }) public license: string | null; - @Column('integer', { - nullable: true, comment: 'Image width', + @Column("integer", { + nullable: true, + comment: "Image width", }) public width: number | null; - @Column('integer', { - nullable: true, comment: "Image height", + @Column("integer", { + nullable: true, + comment: "Image height", }) public height: number | null; } diff --git a/packages/backend/src/models/entities/follow-request.ts b/packages/backend/src/models/entities/follow-request.ts index 658fed5a5..281eab917 100644 --- a/packages/backend/src/models/entities/follow-request.ts +++ b/packages/backend/src/models/entities/follow-request.ts @@ -10,25 +10,25 @@ import { User } from "./user.js"; import { id } from "../id.js"; @Entity() -@Index(['followerId', 'followeeId'], { unique: true }) +@Index(["followerId", "followeeId"], { unique: true }) export class FollowRequest { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the FollowRequest.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public followee: User | null; @@ -36,56 +36,63 @@ 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public follower: User | null; - @Column('varchar', { - length: 128, nullable: true, - comment: 'id of Follow Activity.', + @Column("varchar", { + length: 128, + nullable: true, + comment: "id of Follow Activity.", }) public requestId: string | null; //#region Denormalized fields - @Column('varchar', { - length: 128, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 128, + nullable: true, + comment: "[Denormalized]", }) public followerHost: string | null; - @Column('varchar', { - length: 512, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 512, + nullable: true, + comment: "[Denormalized]", }) public followerInbox: string | null; - @Column('varchar', { - length: 512, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 512, + nullable: true, + comment: "[Denormalized]", }) public followerSharedInbox: string | null; - @Column('varchar', { - length: 128, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 128, + nullable: true, + comment: "[Denormalized]", }) public followeeHost: string | null; - @Column('varchar', { - length: 512, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 512, + nullable: true, + comment: "[Denormalized]", }) public followeeInbox: string | null; - @Column('varchar', { - length: 512, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 512, + nullable: true, + comment: "[Denormalized]", }) public followeeSharedInbox: string | null; //#endregion diff --git a/packages/backend/src/models/entities/following.ts b/packages/backend/src/models/entities/following.ts index 11f633fcd..fafcf8885 100644 --- a/packages/backend/src/models/entities/following.ts +++ b/packages/backend/src/models/entities/following.ts @@ -10,26 +10,26 @@ import { User } from "./user.js"; import { id } from "../id.js"; @Entity() -@Index(['followerId', 'followeeId'], { unique: true }) +@Index(["followerId", "followeeId"], { unique: true }) export class Following { @PrimaryColumn(id()) public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the Following.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public followee: User | null; @@ -37,52 +37,58 @@ 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public follower: User | null; //#region Denormalized fields @Index() - @Column('varchar', { - length: 128, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 128, + nullable: true, + comment: "[Denormalized]", }) public followerHost: string | null; - @Column('varchar', { - length: 512, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 512, + nullable: true, + comment: "[Denormalized]", }) public followerInbox: string | null; - @Column('varchar', { - length: 512, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 512, + nullable: true, + comment: "[Denormalized]", }) public followerSharedInbox: string | null; @Index() - @Column('varchar', { - length: 128, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 128, + nullable: true, + comment: "[Denormalized]", }) public followeeHost: string | null; - @Column('varchar', { - length: 512, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 512, + nullable: true, + comment: "[Denormalized]", }) public followeeInbox: string | null; - @Column('varchar', { - length: 512, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 512, + nullable: true, + comment: "[Denormalized]", }) public followeeSharedInbox: string | null; //#endregion diff --git a/packages/backend/src/models/entities/gallery-like.ts b/packages/backend/src/models/entities/gallery-like.ts index e74e3c3ce..259feb8bb 100644 --- a/packages/backend/src/models/entities/gallery-like.ts +++ b/packages/backend/src/models/entities/gallery-like.ts @@ -11,20 +11,20 @@ import { id } from "../id.js"; import { GalleryPost } from "./gallery-post.js"; @Entity() -@Index(['userId', 'postId'], { unique: true }) +@Index(["userId", "postId"], { unique: true }) export class GalleryLike { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone') + @Column("timestamp with time zone") public createdAt: Date; @Index() @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -32,8 +32,8 @@ export class GalleryLike { @Column(id()) public postId: GalleryPost["id"]; - @ManyToOne(type => GalleryPost, { - onDelete: 'CASCADE', + @ManyToOne((type) => GalleryPost, { + onDelete: "CASCADE", }) @JoinColumn() public post: GalleryPost | null; diff --git a/packages/backend/src/models/entities/gallery-post.ts b/packages/backend/src/models/entities/gallery-post.ts index a79bb8835..938348659 100644 --- a/packages/backend/src/models/entities/gallery-post.ts +++ b/packages/backend/src/models/entities/gallery-post.ts @@ -16,36 +16,37 @@ export class GalleryPost { public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the GalleryPost.', + @Column("timestamp with time zone", { + comment: "The created date of the GalleryPost.", }) public createdAt: Date; @Index() - @Column('timestamp with time zone', { - comment: 'The updated date of the GalleryPost.', + @Column("timestamp with time zone", { + comment: "The updated date of the GalleryPost.", }) public updatedAt: Date; - @Column('varchar', { + @Column("varchar", { length: 256, }) public title: string; - @Column('varchar', { - length: 2048, nullable: true, + @Column("varchar", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -53,26 +54,29 @@ export class GalleryPost { @Index() @Column({ ...id(), - array: true, default: '{}', + array: true, + default: "{}", }) public fileIds: DriveFile["id"][]; @Index() - @Column('boolean', { + @Column("boolean", { default: false, - comment: 'Whether the post is sensitive.', + comment: "Whether the post is sensitive.", }) public isSensitive: boolean; @Index() - @Column('integer', { + @Column("integer", { default: 0, }) public likedCount: number; @Index() - @Column('varchar', { - length: 128, array: true, default: '{}', + @Column("varchar", { + length: 128, + array: true, + default: "{}", }) public tags: string[]; diff --git a/packages/backend/src/models/entities/hashtag.ts b/packages/backend/src/models/entities/hashtag.ts index 06fa004be..7b3df1cc2 100644 --- a/packages/backend/src/models/entities/hashtag.ts +++ b/packages/backend/src/models/entities/hashtag.ts @@ -8,7 +8,7 @@ export class Hashtag { public id: string; @Index({ unique: true }) - @Column('varchar', { + @Column("varchar", { length: 128, }) public name: string; @@ -20,7 +20,7 @@ export class Hashtag { public mentionedUserIds: User["id"][]; @Index() - @Column('integer', { + @Column("integer", { default: 0, }) public mentionedUsersCount: number; @@ -32,7 +32,7 @@ export class Hashtag { public mentionedLocalUserIds: User["id"][]; @Index() - @Column('integer', { + @Column("integer", { default: 0, }) public mentionedLocalUsersCount: number; @@ -44,7 +44,7 @@ export class Hashtag { public mentionedRemoteUserIds: User["id"][]; @Index() - @Column('integer', { + @Column("integer", { default: 0, }) public mentionedRemoteUsersCount: number; @@ -56,7 +56,7 @@ export class Hashtag { public attachedUserIds: User["id"][]; @Index() - @Column('integer', { + @Column("integer", { default: 0, }) public attachedUsersCount: number; @@ -68,7 +68,7 @@ export class Hashtag { public attachedLocalUserIds: User["id"][]; @Index() - @Column('integer', { + @Column("integer", { default: 0, }) public attachedLocalUsersCount: number; @@ -80,7 +80,7 @@ export class Hashtag { public attachedRemoteUserIds: User["id"][]; @Index() - @Column('integer', { + @Column("integer", { default: 0, }) public attachedRemoteUsersCount: number; diff --git a/packages/backend/src/models/entities/instance.ts b/packages/backend/src/models/entities/instance.ts index 2b118455d..7e0b08583 100644 --- a/packages/backend/src/models/entities/instance.ts +++ b/packages/backend/src/models/entities/instance.ts @@ -10,8 +10,8 @@ export class Instance { * このインスタンスを捕捉した日時 */ @Index() - @Column('timestamp with time zone', { - comment: 'The caught date of the Instance.', + @Column("timestamp with time zone", { + comment: "The caught date of the Instance.", }) public caughtAt: Date; @@ -19,34 +19,34 @@ export class Instance { * ホスト */ @Index({ unique: true }) - @Column('varchar', { + @Column("varchar", { length: 128, - comment: 'The host of the Instance.', + comment: "The host of the Instance.", }) public host: string; /** * インスタンスのユーザー数 */ - @Column('integer', { + @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; /** * インスタンスの投稿数 */ - @Column('integer', { + @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; /** * このインスタンスのユーザーからフォローされている、自インスタンスのユーザーの数 */ - @Column('integer', { + @Column("integer", { default: 0, }) public followingCount: number; @@ -54,7 +54,7 @@ export class Instance { /** * このインスタンスのユーザーをフォローしている、自インスタンスのユーザーの数 */ - @Column('integer', { + @Column("integer", { default: 0, }) public followersCount: number; @@ -62,7 +62,7 @@ export class Instance { /** * 直近のリクエスト送信日時 */ - @Column('timestamp with time zone', { + @Column("timestamp with time zone", { nullable: true, }) public latestRequestSentAt: Date | null; @@ -70,7 +70,7 @@ export class Instance { /** * 直近のリクエスト送信時のHTTPステータスコード */ - @Column('integer', { + @Column("integer", { nullable: true, }) public latestStatus: number | null; @@ -78,7 +78,7 @@ export class Instance { /** * 直近のリクエスト受信日時 */ - @Column('timestamp with time zone', { + @Column("timestamp with time zone", { nullable: true, }) public latestRequestReceivedAt: Date | null; @@ -86,13 +86,13 @@ export class Instance { /** * このインスタンスと最後にやり取りした日時 */ - @Column('timestamp with time zone') + @Column("timestamp with time zone") public lastCommunicatedAt: Date; /** * このインスタンスと不通かどうか */ - @Column('boolean', { + @Column("boolean", { default: false, }) public isNotResponding: boolean; @@ -101,63 +101,72 @@ export class Instance { * このインスタンスへの配信を停止するか */ @Index() - @Column('boolean', { + @Column("boolean", { default: false, }) public isSuspended: boolean; - @Column('varchar', { - length: 64, nullable: true, - comment: 'The software of the Instance.', + @Column("varchar", { + length: 64, + nullable: true, + comment: "The software of the Instance.", }) public softwareName: string | null; - @Column('varchar', { - length: 64, nullable: true, + @Column("varchar", { + length: 64, + nullable: true, }) public softwareVersion: string | null; - @Column('boolean', { + @Column("boolean", { nullable: true, }) public openRegistrations: boolean | null; - @Column('varchar', { - length: 256, nullable: true, + @Column("varchar", { + length: 256, + nullable: true, }) public name: string | null; - @Column('varchar', { - length: 4096, nullable: true, + @Column("varchar", { + length: 4096, + nullable: true, }) public description: string | null; - @Column('varchar', { - length: 128, nullable: true, + @Column("varchar", { + length: 128, + nullable: true, }) public maintainerName: string | null; - @Column('varchar', { - length: 256, nullable: true, + @Column("varchar", { + length: 256, + nullable: true, }) public maintainerEmail: string | null; - @Column('varchar', { - length: 256, nullable: true, + @Column("varchar", { + length: 256, + nullable: true, }) public iconUrl: string | null; - @Column('varchar', { - length: 256, nullable: true, + @Column("varchar", { + length: 256, + nullable: true, }) public faviconUrl: string | null; - @Column('varchar', { - length: 64, nullable: true, + @Column("varchar", { + length: 64, + nullable: true, }) public themeColor: string | null; - @Column('timestamp with time zone', { + @Column("timestamp with time zone", { nullable: true, }) public infoUpdatedAt: Date | null; diff --git a/packages/backend/src/models/entities/messaging-message.ts b/packages/backend/src/models/entities/messaging-message.ts index 9cf197fa3..d1da00eae 100644 --- a/packages/backend/src/models/entities/messaging-message.ts +++ b/packages/backend/src/models/entities/messaging-message.ts @@ -17,68 +17,73 @@ export class MessagingMessage { public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the MessagingMessage.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @Index() @Column({ - ...id(), nullable: true, - comment: 'The recipient user ID.', + ...id(), + nullable: true, + comment: "The recipient user ID.", }) public recipientId: User["id"] | null; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public recipient: User | null; @Index() @Column({ - ...id(), nullable: true, - comment: 'The recipient group ID.', + ...id(), + nullable: true, + comment: "The recipient group ID.", }) public groupId: UserGroup["id"] | null; - @ManyToOne(type => UserGroup, { - onDelete: 'CASCADE', + @ManyToOne((type) => UserGroup, { + onDelete: "CASCADE", }) @JoinColumn() public group: UserGroup | null; - @Column('varchar', { - length: 4096, nullable: true, + @Column("varchar", { + length: 4096, + nullable: true, }) public text: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public isRead: boolean; - @Column('varchar', { - length: 512, nullable: true, + @Column("varchar", { + length: 512, + nullable: true, }) public uri: string | null; @Column({ ...id(), - array: true, default: '{}', + array: true, + default: "{}", }) public reads: User["id"][]; @@ -88,8 +93,8 @@ export class MessagingMessage { }) public fileId: DriveFile["id"] | null; - @ManyToOne(type => DriveFile, { - onDelete: 'CASCADE', + @ManyToOne((type) => DriveFile, { + onDelete: "CASCADE", }) @JoinColumn() public file: DriveFile | null; diff --git a/packages/backend/src/models/entities/meta.ts b/packages/backend/src/models/entities/meta.ts index 3a3c50d4a..433ad0db5 100644 --- a/packages/backend/src/models/entities/meta.ts +++ b/packages/backend/src/models/entities/meta.ts @@ -6,119 +6,144 @@ import type { Clip } from "./clip.js"; @Entity() export class Meta { @PrimaryColumn({ - type: 'varchar', + type: "varchar", length: 32, }) public id: string; - @Column('varchar', { - length: 128, nullable: true, + @Column("varchar", { + length: 128, + nullable: true, }) public name: string | null; - @Column('varchar', { - length: 1024, nullable: true, + @Column("varchar", { + length: 1024, + nullable: true, }) public description: string | null; /** * メンテナの名前 */ - @Column('varchar', { - length: 128, nullable: true, + @Column("varchar", { + length: 128, + nullable: true, }) public maintainerName: string | null; /** * メンテナの連絡先 */ - @Column('varchar', { - length: 128, nullable: true, + @Column("varchar", { + length: 128, + nullable: true, }) public maintainerEmail: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public disableRegistration: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public disableLocalTimeline: boolean; - @Column('boolean', { + @Column("boolean", { default: true, }) public disableRecommendedTimeline: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public disableGlobalTimeline: boolean; - @Column('varchar', { - length: 256, default: '⭐', + @Column("varchar", { + length: 256, + default: "⭐", }) public defaultReaction: string; - @Column('varchar', { - length: 64, array: true, default: '{}', + @Column("varchar", { + length: 64, + array: true, + default: "{}", }) public langs: string[]; - @Column('varchar', { - length: 256, array: true, default: '{}', + @Column("varchar", { + length: 256, + array: true, + default: "{}", }) public pinnedUsers: string[]; - @Column('varchar', { - length: 256, array: true, default: '{}', + @Column("varchar", { + length: 256, + array: true, + default: "{}", }) public recommendedInstances: string[]; - @Column('varchar', { - length: 256, array: true, default: '{}', + @Column("varchar", { + length: 256, + array: true, + default: "{}", }) public customMOTD: string[]; - @Column('varchar', { - length: 256, array: true, default: '{}', + @Column("varchar", { + length: 256, + array: true, + default: "{}", }) public customSplashIcons: string[]; - @Column('varchar', { - length: 256, array: true, default: '{}', + @Column("varchar", { + length: 256, + array: true, + default: "{}", }) public hiddenTags: string[]; - @Column('varchar', { - length: 256, array: true, default: '{}', + @Column("varchar", { + length: 256, + array: true, + default: "{}", }) public blockedHosts: string[]; - @Column('varchar', { - length: 256, array: true, default: '{}', + @Column("varchar", { + length: 256, + array: true, + default: "{}", }) public silencedHosts: string[]; - @Column('boolean', { + @Column("boolean", { default: false, }) public secureMode: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public privateMode: boolean; - @Column('varchar', { - length: 256, array: true, default: '{}', + @Column("varchar", { + length: 256, + array: true, + default: "{}", }) public allowedHosts: string[]; - @Column('varchar', { - length: 512, array: true, default: '{/featured,/channels,/explore,/pages,/about-calckey}', + @Column("varchar", { + length: 512, + array: true, + default: "{/featured,/channels,/explore,/pages,/about-calckey}", }) public pinnedPages: string[]; @@ -128,51 +153,51 @@ export class Meta { }) public pinnedClipId: Clip["id"] | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public themeColor: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, - default: '/assets/ai.png', + default: "/assets/ai.png", }) public mascotImageUrl: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public bannerUrl: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public backgroundImageUrl: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public logoImageUrl: string | null; - @Column('varchar', { + @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', { + @Column("varchar", { length: 512, nullable: true, }) public iconUrl: string | null; - @Column('boolean', { + @Column("boolean", { default: true, }) public cacheRemoteFiles: boolean; @@ -183,60 +208,60 @@ export class Meta { }) public proxyAccountId: User["id"] | null; - @ManyToOne(type => User, { - onDelete: 'SET NULL', + @ManyToOne((type) => User, { + onDelete: "SET NULL", }) @JoinColumn() public proxyAccount: User | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public emailRequiredForSignup: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public enableHcaptcha: boolean; - @Column('varchar', { + @Column("varchar", { length: 64, nullable: true, }) public hcaptchaSiteKey: string | null; - @Column('varchar', { + @Column("varchar", { length: 64, nullable: true, }) public hcaptchaSecretKey: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public enableRecaptcha: boolean; - @Column('varchar', { + @Column("varchar", { length: 64, nullable: true, }) public recaptchaSiteKey: string | null; - @Column('varchar', { + @Column("varchar", { length: 64, nullable: true, }) public recaptchaSecretKey: string | null; - @Column('enum', { - enum: ['none', 'all', 'local', 'remote'], - default: 'none', + @Column("enum", { + enum: ["none", "all", "local", "remote"], + default: "none", }) public sensitiveMediaDetection: "none" | "all" | "local" | "remote"; - @Column('enum', { - enum: ['medium', 'low', 'high', 'veryLow', 'veryHigh'], - default: 'medium', + @Column("enum", { + enum: ["medium", "low", "high", "veryLow", "veryHigh"], + default: "medium", }) public sensitiveMediaDetectionSensitivity: | "medium" @@ -245,279 +270,279 @@ export class Meta { | "veryLow" | "veryHigh"; - @Column('boolean', { + @Column("boolean", { default: false, }) public setSensitiveFlagAutomatically: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public enableSensitiveMediaDetectionForVideos: boolean; - @Column('integer', { + @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', { + @Column("integer", { default: 32, - comment: 'Drive capacity of a remote user (MB)', + comment: "Drive capacity of a remote user (MB)", }) public remoteDriveCapacityMb: number; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public summalyProxy: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public enableEmail: boolean; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public email: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public smtpSecure: boolean; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public smtpHost: string | null; - @Column('integer', { + @Column("integer", { nullable: true, }) public smtpPort: number | null; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public smtpUser: string | null; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public smtpPass: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public enableServiceWorker: boolean; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public swPublicKey: string | null; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public swPrivateKey: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public enableTwitterIntegration: boolean; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public twitterConsumerKey: string | null; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public twitterConsumerSecret: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public enableGithubIntegration: boolean; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public githubClientId: string | null; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public githubClientSecret: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public enableDiscordIntegration: boolean; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public discordClientId: string | null; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public discordClientSecret: string | null; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public deeplAuthKey: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public deeplIsPro: boolean; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public libreTranslateApiUrl: string | null; - @Column('varchar', { + @Column("varchar", { length: 128, nullable: true, }) public libreTranslateApiKey: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public ToSUrl: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, - default: 'https://codeberg.org/calckey/calckey', + default: "https://codeberg.org/calckey/calckey", nullable: false, }) public repositoryUrl: string; - @Column('varchar', { + @Column("varchar", { length: 512, - default: 'https://codeberg.org/calckey/calckey/issues/new', + default: "https://codeberg.org/calckey/calckey/issues/new", nullable: true, }) public feedbackUrl: string | null; - @Column('varchar', { + @Column("varchar", { length: 8192, nullable: true, }) public defaultLightTheme: string | null; - @Column('varchar', { + @Column("varchar", { length: 8192, nullable: true, }) public defaultDarkTheme: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public useObjectStorage: boolean; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public objectStorageBucket: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public objectStoragePrefix: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public objectStorageBaseUrl: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public objectStorageEndpoint: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public objectStorageRegion: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public objectStorageAccessKey: string | null; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, }) public objectStorageSecretKey: string | null; - @Column('integer', { + @Column("integer", { nullable: true, }) public objectStoragePort: number | null; - @Column('boolean', { + @Column("boolean", { default: true, }) public objectStorageUseSSL: boolean; - @Column('boolean', { + @Column("boolean", { default: true, }) public objectStorageUseProxy: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public objectStorageSetPublicRead: boolean; - @Column('boolean', { + @Column("boolean", { default: true, }) public objectStorageS3ForcePathStyle: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public enableIpLogging: boolean; - @Column('boolean', { + @Column("boolean", { default: true, }) public enableActiveEmailValidation: boolean; - @Column('jsonb', { + @Column("jsonb", { default: {}, }) public experimentalFeatures: Record; diff --git a/packages/backend/src/models/entities/moderation-log.ts b/packages/backend/src/models/entities/moderation-log.ts index cc745e0d2..26bf1cdfa 100644 --- a/packages/backend/src/models/entities/moderation-log.ts +++ b/packages/backend/src/models/entities/moderation-log.ts @@ -14,8 +14,8 @@ export class ModerationLog { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the ModerationLog.', + @Column("timestamp with time zone", { + comment: "The created date of the ModerationLog.", }) public createdAt: Date; @@ -23,17 +23,17 @@ export class ModerationLog { @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; - @Column('varchar', { + @Column("varchar", { length: 128, }) public type: string; - @Column('jsonb') + @Column("jsonb") public info: Record; } diff --git a/packages/backend/src/models/entities/muted-note.ts b/packages/backend/src/models/entities/muted-note.ts index 11a6ae95d..0ee245aea 100644 --- a/packages/backend/src/models/entities/muted-note.ts +++ b/packages/backend/src/models/entities/muted-note.ts @@ -12,7 +12,7 @@ import { id } from "../id.js"; import { mutedNoteReasons } from "../../types.js"; @Entity() -@Index(['noteId', 'userId'], { unique: true }) +@Index(["noteId", "userId"], { unique: true }) export class MutedNote { @PrimaryColumn(id()) public id: string; @@ -20,12 +20,12 @@ export class MutedNote { @Index() @Column({ ...id(), - comment: 'The note ID.', + comment: "The note ID.", }) public noteId: Note["id"]; - @ManyToOne(type => Note, { - onDelete: 'CASCADE', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; @@ -33,12 +33,12 @@ export class MutedNote { @Index() @Column({ ...id(), - comment: 'The user ID.', + comment: "The user ID.", }) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -47,9 +47,9 @@ export class MutedNote { * ミュートされた理由。 */ @Index() - @Column('enum', { + @Column("enum", { enum: mutedNoteReasons, - comment: 'The reason of the MutedNote.', + comment: "The reason of the MutedNote.", }) public reason: typeof mutedNoteReasons[number]; } diff --git a/packages/backend/src/models/entities/muting.ts b/packages/backend/src/models/entities/muting.ts index 561bcfb95..603619b46 100644 --- a/packages/backend/src/models/entities/muting.ts +++ b/packages/backend/src/models/entities/muting.ts @@ -10,19 +10,19 @@ import { User } from "./user.js"; import { id } from "../id.js"; @Entity() -@Index(['muterId', 'muteeId'], { unique: true }) +@Index(["muterId", "muteeId"], { unique: true }) export class Muting { @PrimaryColumn(id()) public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the Muting.', + @Column("timestamp with time zone", { + comment: "The created date of the Muting.", }) public createdAt: Date; @Index() - @Column('timestamp with time zone', { + @Column("timestamp with time zone", { nullable: true, }) public expiresAt: Date | null; @@ -30,12 +30,12 @@ export class Muting { @Index() @Column({ ...id(), - comment: 'The mutee user ID.', + comment: "The mutee user ID.", }) public muteeId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public mutee: User | null; @@ -43,12 +43,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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public muter: User | null; diff --git a/packages/backend/src/models/entities/note-edit.ts b/packages/backend/src/models/entities/note-edit.ts index a65375efb..8761e2b15 100644 --- a/packages/backend/src/models/entities/note-edit.ts +++ b/packages/backend/src/models/entities/note-edit.ts @@ -18,34 +18,36 @@ export class NoteEdit { @Index() @Column({ ...id(), - comment: 'The ID of note.', + comment: "The ID of note.", }) public noteId: Note["id"]; - @ManyToOne(type => Note, { - onDelete: 'CASCADE', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; - @Column('text', { + @Column("text", { nullable: true, }) public text: string | null; - @Column('varchar', { - length: 512, nullable: true, + @Column("varchar", { + length: 512, + nullable: true, }) public cw: string | null; @Column({ ...id(), - array: true, default: '{}', + array: true, + default: "{}", }) public fileIds: DriveFile["id"][]; - @Column('timestamp with time zone', { - comment: 'The updated date of the Note.', + @Column("timestamp with time zone", { + comment: "The updated date of the Note.", }) public updatedAt: Date; } diff --git a/packages/backend/src/models/entities/note-favorite.ts b/packages/backend/src/models/entities/note-favorite.ts index ab12d8b1b..19641ecf4 100644 --- a/packages/backend/src/models/entities/note-favorite.ts +++ b/packages/backend/src/models/entities/note-favorite.ts @@ -11,13 +11,13 @@ import { User } from "./user.js"; import { id } from "../id.js"; @Entity() -@Index(['userId', 'noteId'], { unique: true }) +@Index(["userId", "noteId"], { unique: true }) export class NoteFavorite { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the NoteFavorite.', + @Column("timestamp with time zone", { + comment: "The created date of the NoteFavorite.", }) public createdAt: Date; @@ -25,8 +25,8 @@ export class NoteFavorite { @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -34,8 +34,8 @@ export class NoteFavorite { @Column(id()) public noteId: Note["id"]; - @ManyToOne(type => Note, { - onDelete: 'CASCADE', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; diff --git a/packages/backend/src/models/entities/note-reaction.ts b/packages/backend/src/models/entities/note-reaction.ts index 0e51c33b1..5e2a8d3e8 100644 --- a/packages/backend/src/models/entities/note-reaction.ts +++ b/packages/backend/src/models/entities/note-reaction.ts @@ -11,14 +11,14 @@ import { Note } from "./note.js"; import { id } from "../id.js"; @Entity() -@Index(['userId', 'noteId'], { unique: true }) +@Index(["userId", "noteId"], { unique: true }) export class NoteReaction { @PrimaryColumn(id()) public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the NoteReaction.', + @Column("timestamp with time zone", { + comment: "The created date of the NoteReaction.", }) public createdAt: Date; @@ -26,8 +26,8 @@ export class NoteReaction { @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user?: User | null; @@ -36,15 +36,15 @@ export class NoteReaction { @Column(id()) public noteId: Note["id"]; - @ManyToOne(type => Note, { - onDelete: 'CASCADE', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note?: Note | null; // TODO: 対象noteのuserIdを非正規化したい(「受け取ったリアクション一覧」のようなものを(JOIN無しで)実装したいため) - @Column('varchar', { + @Column("varchar", { length: 260, }) public reaction: string; diff --git a/packages/backend/src/models/entities/note-thread-muting.ts b/packages/backend/src/models/entities/note-thread-muting.ts index 2985b195f..704b32850 100644 --- a/packages/backend/src/models/entities/note-thread-muting.ts +++ b/packages/backend/src/models/entities/note-thread-muting.ts @@ -11,13 +11,12 @@ import { Note } from "./note.js"; import { id } from "../id.js"; @Entity() -@Index(['userId', 'threadId'], { unique: true }) +@Index(["userId", "threadId"], { unique: true }) export class NoteThreadMuting { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - }) + @Column("timestamp with time zone", {}) public createdAt: Date; @Index() @@ -26,14 +25,14 @@ export class NoteThreadMuting { }) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @Index() - @Column('varchar', { + @Column("varchar", { length: 256, }) public threadId: string; diff --git a/packages/backend/src/models/entities/note-unread.ts b/packages/backend/src/models/entities/note-unread.ts index d5bba7221..95695cbc8 100644 --- a/packages/backend/src/models/entities/note-unread.ts +++ b/packages/backend/src/models/entities/note-unread.ts @@ -12,7 +12,7 @@ import { id } from "../id.js"; import type { Channel } from "./channel.js"; @Entity() -@Index(['userId', 'noteId'], { unique: true }) +@Index(["userId", "noteId"], { unique: true }) export class NoteUnread { @PrimaryColumn(id()) public id: string; @@ -21,8 +21,8 @@ export class NoteUnread { @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -31,8 +31,8 @@ export class NoteUnread { @Column(id()) public noteId: Note["id"]; - @ManyToOne(type => Note, { - onDelete: 'CASCADE', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; @@ -41,21 +41,21 @@ export class NoteUnread { * メンションか否か */ @Index() - @Column('boolean') + @Column("boolean") public isMentioned: boolean; /** * ダイレクト投稿か否か */ @Index() - @Column('boolean') + @Column("boolean") public isSpecified: boolean; //#region Denormalized fields @Index() @Column({ ...id(), - comment: '[Denormalized]', + comment: "[Denormalized]", }) public noteUserId: User["id"]; @@ -63,7 +63,7 @@ export class NoteUnread { @Column({ ...id(), nullable: true, - comment: '[Denormalized]', + comment: "[Denormalized]", }) public noteChannelId: Channel["id"] | null; //#endregion diff --git a/packages/backend/src/models/entities/note-watching.ts b/packages/backend/src/models/entities/note-watching.ts index 7ac3e8e29..724b084af 100644 --- a/packages/backend/src/models/entities/note-watching.ts +++ b/packages/backend/src/models/entities/note-watching.ts @@ -11,26 +11,26 @@ import { Note } from "./note.js"; import { id } from "../id.js"; @Entity() -@Index(['userId', 'noteId'], { unique: true }) +@Index(["userId", "noteId"], { unique: true }) export class NoteWatching { @PrimaryColumn(id()) public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the NoteWatching.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -38,12 +38,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', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; @@ -52,7 +52,7 @@ export class NoteWatching { @Index() @Column({ ...id(), - comment: '[Denormalized]', + comment: "[Denormalized]", }) public noteUserId: Note["userId"]; //#endregion diff --git a/packages/backend/src/models/entities/note.ts b/packages/backend/src/models/entities/note.ts index f4e76c1db..edcfdb635 100644 --- a/packages/backend/src/models/entities/note.ts +++ b/packages/backend/src/models/entities/note.ts @@ -13,16 +13,16 @@ import { noteVisibilities } from "../../types.js"; import { Channel } from "./channel.js"; @Entity() -@Index('IDX_NOTE_TAGS', { synchronize: false }) -@Index('IDX_NOTE_MENTIONS', { synchronize: false }) -@Index('IDX_NOTE_VISIBLE_USER_IDS', { synchronize: false }) +@Index("IDX_NOTE_TAGS", { synchronize: false }) +@Index("IDX_NOTE_MENTIONS", { synchronize: false }) +@Index("IDX_NOTE_VISIBLE_USER_IDS", { synchronize: false }) export class Note { @PrimaryColumn(id()) public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the Note.', + @Column("timestamp with time zone", { + comment: "The created date of the Note.", }) public createdAt: Date; @@ -30,12 +30,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', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public reply: Note | null; @@ -44,66 +44,69 @@ 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', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public renote: Note | null; @Index() - @Column('varchar', { - length: 256, nullable: true, + @Column("varchar", { + length: 256, + nullable: true, }) public threadId: string | null; - @Column('text', { + @Column("text", { nullable: true, }) public text: string | null; - @Column('varchar', { - length: 256, nullable: true, + @Column("varchar", { + length: 256, + nullable: true, }) public name: string | null; - @Column('varchar', { - length: 512, nullable: true, + @Column("varchar", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public localOnly: boolean; - @Column('smallint', { + @Column("smallint", { default: 0, }) public renoteCount: number; - @Column('smallint', { + @Column("smallint", { default: 0, }) public repliesCount: number; - @Column('jsonb', { + @Column("jsonb", { default: {}, }) public reactions: Record; @@ -115,71 +118,84 @@ export class Note { * followers ... フォロワーのみ * specified ... visibleUserIds で指定したユーザーのみ */ - @Column('enum', { enum: noteVisibilities }) + @Column("enum", { enum: noteVisibilities }) public visibility: typeof noteVisibilities[number]; @Index({ unique: true }) - @Column('varchar', { - length: 512, nullable: true, - comment: 'The URI of a note. it will be null when the note is local.', + @Column("varchar", { + length: 512, + nullable: true, + 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.', + @Column("varchar", { + length: 512, + nullable: true, + 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, + @Column("integer", { + 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: '{}', + @Column("varchar", { + 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: '[]', + @Column("text", { + default: "[]", }) public mentionedRemoteUsers: string; - @Column('varchar', { - length: 128, array: true, default: '{}', + @Column("varchar", { + length: 128, + array: true, + default: "{}", }) public emojis: string[]; @Index() - @Column('varchar', { - length: 128, array: true, default: '{}', + @Column("varchar", { + length: 128, + array: true, + default: "{}", }) public tags: string[]; - @Column('boolean', { + @Column("boolean", { default: false, }) public hasPoll: boolean; @@ -188,53 +204,56 @@ export class Note { @Column({ ...id(), nullable: true, - comment: 'The ID of source channel.', + comment: "The ID of source channel.", }) public channelId: Channel["id"] | null; - @ManyToOne(type => Channel, { - onDelete: 'CASCADE', + @ManyToOne((type) => Channel, { + onDelete: "CASCADE", }) @JoinColumn() public channel: Channel | null; //#region Denormalized fields @Index() - @Column('varchar', { - length: 128, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 128, + nullable: true, + 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]', + @Column("varchar", { + length: 128, + nullable: true, + 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]', + @Column("varchar", { + length: 128, + nullable: true, + comment: "[Denormalized]", }) public renoteUserHost: string | null; - @Column('timestamp with time zone', { + @Column("timestamp with time zone", { nullable: true, - comment: 'The updated date of the Note.', + comment: "The updated date of the Note.", }) public updatedAt: Date; //#endregion diff --git a/packages/backend/src/models/entities/notification.ts b/packages/backend/src/models/entities/notification.ts index 2c55e988f..da23f7d3e 100644 --- a/packages/backend/src/models/entities/notification.ts +++ b/packages/backend/src/models/entities/notification.ts @@ -20,8 +20,8 @@ export class Notification { public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the Notification.', + @Column("timestamp with time zone", { + comment: "The created date of the Notification.", }) public createdAt: Date; @@ -31,12 +31,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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public notifiee: User | null; @@ -48,12 +48,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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public notifier: User | null; @@ -74,9 +74,9 @@ export class Notification { * app - App notifications. */ @Index() - @Column('enum', { + @Column("enum", { enum: notificationTypes, - comment: 'The type of the Notification.', + comment: "The type of the Notification.", }) public type: typeof notificationTypes[number]; @@ -84,9 +84,9 @@ export class Notification { * Whether the notification was read. */ @Index() - @Column('boolean', { + @Column("boolean", { default: false, - comment: 'Whether the notification was read.', + comment: "Whether the notification was read.", }) public isRead: boolean; @@ -96,8 +96,8 @@ export class Notification { }) public noteId: Note["id"] | null; - @ManyToOne(type => Note, { - onDelete: 'CASCADE', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; @@ -108,8 +108,8 @@ export class Notification { }) public followRequestId: FollowRequest["id"] | null; - @ManyToOne(type => FollowRequest, { - onDelete: 'CASCADE', + @ManyToOne((type) => FollowRequest, { + onDelete: "CASCADE", }) @JoinColumn() public followRequest: FollowRequest | null; @@ -120,18 +120,19 @@ export class Notification { }) public userGroupInvitationId: UserGroupInvitation["id"] | null; - @ManyToOne(type => UserGroupInvitation, { - onDelete: 'CASCADE', + @ManyToOne((type) => UserGroupInvitation, { + onDelete: "CASCADE", }) @JoinColumn() public userGroupInvitation: UserGroupInvitation | null; - @Column('varchar', { - length: 128, nullable: true, + @Column("varchar", { + length: 128, + nullable: true, }) public reaction: string | null; - @Column('integer', { + @Column("integer", { nullable: true, }) public choice: number | null; @@ -139,8 +140,9 @@ export class Notification { /** * App notification body */ - @Column('varchar', { - length: 2048, nullable: true, + @Column("varchar", { + length: 2048, + nullable: true, }) public customBody: string | null; @@ -148,8 +150,9 @@ export class Notification { * App notification header * (If omitted, it is expected to be displayed with the app name) */ - @Column('varchar', { - length: 256, nullable: true, + @Column("varchar", { + length: 256, + nullable: true, }) public customHeader: string | null; @@ -157,8 +160,9 @@ export class Notification { * App notification icon (URL) * (If omitted, it is expected to be displayed as an app icon) */ - @Column('varchar', { - length: 1024, nullable: true, + @Column("varchar", { + length: 1024, + nullable: true, }) public customIcon: string | null; @@ -172,8 +176,8 @@ export class Notification { }) public appAccessTokenId: AccessToken["id"] | null; - @ManyToOne(type => AccessToken, { - onDelete: 'CASCADE', + @ManyToOne((type) => AccessToken, { + onDelete: "CASCADE", }) @JoinColumn() public appAccessToken: AccessToken | null; diff --git a/packages/backend/src/models/entities/page-like.ts b/packages/backend/src/models/entities/page-like.ts index 75f4dc49b..6304e0b24 100644 --- a/packages/backend/src/models/entities/page-like.ts +++ b/packages/backend/src/models/entities/page-like.ts @@ -11,20 +11,20 @@ import { id } from "../id.js"; import { Page } from "./page.js"; @Entity() -@Index(['userId', 'pageId'], { unique: true }) +@Index(["userId", "pageId"], { unique: true }) export class PageLike { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone') + @Column("timestamp with time zone") public createdAt: Date; @Index() @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -32,8 +32,8 @@ export class PageLike { @Column(id()) public pageId: Page["id"]; - @ManyToOne(type => Page, { - onDelete: 'CASCADE', + @ManyToOne((type) => Page, { + onDelete: "CASCADE", }) @JoinColumn() public page: Page | null; diff --git a/packages/backend/src/models/entities/page.ts b/packages/backend/src/models/entities/page.ts index 5fe9f5208..d0733c8ce 100644 --- a/packages/backend/src/models/entities/page.ts +++ b/packages/backend/src/models/entities/page.ts @@ -11,51 +11,52 @@ import { id } from "../id.js"; import { DriveFile } from "./drive-file.js"; @Entity() -@Index(['userId', 'name'], { unique: true }) +@Index(["userId", "name"], { unique: true }) export class Page { @PrimaryColumn(id()) public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the Page.', + @Column("timestamp with time zone", { + comment: "The created date of the Page.", }) public createdAt: Date; @Index() - @Column('timestamp with time zone', { - comment: 'The updated date of the Page.', + @Column("timestamp with time zone", { + comment: "The updated date of the Page.", }) public updatedAt: Date; - @Column('varchar', { + @Column("varchar", { length: 256, }) public title: string; @Index() - @Column('varchar', { + @Column("varchar", { length: 256, }) public name: string; - @Column('varchar', { - length: 256, nullable: true, + @Column("varchar", { + length: 256, + nullable: true, }) public summary: string | null; - @Column('boolean') + @Column("boolean") public alignCenter: boolean; - @Column('boolean') + @Column("boolean") public isPublic: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public hideTitleWhenPinned: boolean; - @Column('varchar', { + @Column("varchar", { length: 32, }) public font: string; @@ -63,12 +64,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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -79,25 +80,25 @@ export class Page { }) public eyeCatchingImageId: DriveFile["id"] | null; - @ManyToOne(type => DriveFile, { - onDelete: 'CASCADE', + @ManyToOne((type) => DriveFile, { + onDelete: "CASCADE", }) @JoinColumn() public eyeCatchingImage: DriveFile | null; - @Column('jsonb', { + @Column("jsonb", { default: [], }) public content: Record[]; - @Column('jsonb', { + @Column("jsonb", { default: [], }) public variables: Record[]; - @Column('varchar', { + @Column("varchar", { length: 16384, - default: '', + default: "", }) public script: string; @@ -106,17 +107,18 @@ export class Page { * followers ... フォロワーのみ * specified ... visibleUserIds で指定したユーザーのみ */ - @Column('enum', { enum: ['public', 'followers', 'specified'] }) + @Column("enum", { enum: ["public", "followers", "specified"] }) public visibility: "public" | "followers" | "specified"; @Index() @Column({ ...id(), - array: true, default: '{}', + array: true, + default: "{}", }) public visibleUserIds: User["id"][]; - @Column('integer', { + @Column("integer", { default: 0, }) public likedCount: number; diff --git a/packages/backend/src/models/entities/password-reset-request.ts b/packages/backend/src/models/entities/password-reset-request.ts index 4c681d4f7..ab0bccbbe 100644 --- a/packages/backend/src/models/entities/password-reset-request.ts +++ b/packages/backend/src/models/entities/password-reset-request.ts @@ -14,11 +14,11 @@ export class PasswordResetRequest { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone') + @Column("timestamp with time zone") public createdAt: Date; @Index({ unique: true }) - @Column('varchar', { + @Column("varchar", { length: 256, }) public token: string; @@ -29,8 +29,8 @@ export class PasswordResetRequest { }) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; diff --git a/packages/backend/src/models/entities/poll-vote.ts b/packages/backend/src/models/entities/poll-vote.ts index 0649951cf..d59a720c3 100644 --- a/packages/backend/src/models/entities/poll-vote.ts +++ b/packages/backend/src/models/entities/poll-vote.ts @@ -11,14 +11,14 @@ import { Note } from "./note.js"; import { id } from "../id.js"; @Entity() -@Index(['userId', 'noteId', 'choice'], { unique: true }) +@Index(["userId", "noteId", "choice"], { unique: true }) export class PollVote { @PrimaryColumn(id()) public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the PollVote.', + @Column("timestamp with time zone", { + comment: "The created date of the PollVote.", }) public createdAt: Date; @@ -26,8 +26,8 @@ export class PollVote { @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -36,12 +36,12 @@ export class PollVote { @Column(id()) public noteId: Note["id"]; - @ManyToOne(type => Note, { - onDelete: 'CASCADE', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; - @Column('integer') + @Column("integer") public choice: number; } diff --git a/packages/backend/src/models/entities/poll.ts b/packages/backend/src/models/entities/poll.ts index 28a70b3c7..405cca222 100644 --- a/packages/backend/src/models/entities/poll.ts +++ b/packages/backend/src/models/entities/poll.ts @@ -16,48 +16,51 @@ export class Poll { @PrimaryColumn(id()) public noteId: Note["id"]; - @OneToOne(type => Note, { - onDelete: 'CASCADE', + @OneToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; - @Column('timestamp with time zone', { + @Column("timestamp with time zone", { nullable: true, }) public expiresAt: Date | null; - @Column('boolean') + @Column("boolean") public multiple: boolean; - @Column('varchar', { - length: 256, array: true, default: '{}', + @Column("varchar", { + length: 256, + array: true, + default: "{}", }) public choices: string[]; - @Column('integer', { + @Column("integer", { array: true, }) public votes: number[]; //#region Denormalized fields - @Column('enum', { + @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]', + @Column("varchar", { + length: 128, + nullable: true, + comment: "[Denormalized]", }) public userHost: string | null; //#endregion diff --git a/packages/backend/src/models/entities/promo-note.ts b/packages/backend/src/models/entities/promo-note.ts index 4daacd246..caa64927e 100644 --- a/packages/backend/src/models/entities/promo-note.ts +++ b/packages/backend/src/models/entities/promo-note.ts @@ -15,20 +15,20 @@ export class PromoNote { @PrimaryColumn(id()) public noteId: Note["id"]; - @OneToOne(type => Note, { - onDelete: 'CASCADE', + @OneToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; - @Column('timestamp with time zone') + @Column("timestamp with time zone") public expiresAt: Date; //#region Denormalized fields @Index() @Column({ ...id(), - comment: '[Denormalized]', + comment: "[Denormalized]", }) public userId: User["id"]; //#endregion diff --git a/packages/backend/src/models/entities/promo-read.ts b/packages/backend/src/models/entities/promo-read.ts index 5938bfde9..b31877dc3 100644 --- a/packages/backend/src/models/entities/promo-read.ts +++ b/packages/backend/src/models/entities/promo-read.ts @@ -11,13 +11,13 @@ import { User } from "./user.js"; import { id } from "../id.js"; @Entity() -@Index(['userId', 'noteId'], { unique: true }) +@Index(["userId", "noteId"], { unique: true }) export class PromoRead { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the PromoRead.', + @Column("timestamp with time zone", { + comment: "The created date of the PromoRead.", }) public createdAt: Date; @@ -25,8 +25,8 @@ export class PromoRead { @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -34,8 +34,8 @@ export class PromoRead { @Column(id()) public noteId: Note["id"]; - @ManyToOne(type => Note, { - onDelete: 'CASCADE', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; diff --git a/packages/backend/src/models/entities/registration-tickets.ts b/packages/backend/src/models/entities/registration-tickets.ts index af785fbc0..549f05d07 100644 --- a/packages/backend/src/models/entities/registration-tickets.ts +++ b/packages/backend/src/models/entities/registration-tickets.ts @@ -6,11 +6,11 @@ export class RegistrationTicket { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone') + @Column("timestamp with time zone") public createdAt: Date; @Index({ unique: true }) - @Column('varchar', { + @Column("varchar", { length: 64, }) public code: string; diff --git a/packages/backend/src/models/entities/registry-item.ts b/packages/backend/src/models/entities/registry-item.ts index 655573883..d044222e6 100644 --- a/packages/backend/src/models/entities/registry-item.ts +++ b/packages/backend/src/models/entities/registry-item.ts @@ -15,51 +15,55 @@ export class RegistryItem { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the RegistryItem.', + @Column("timestamp with time zone", { + comment: "The created date of the RegistryItem.", }) public createdAt: Date; - @Column('timestamp with time zone', { - comment: 'The updated date of the RegistryItem.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; - @Column('varchar', { + @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.', + @Column("jsonb", { + default: {}, + nullable: true, + comment: "The value of the RegistryItem.", }) public value: any | null; @Index() - @Column('varchar', { - length: 1024, array: true, default: '{}', + @Column("varchar", { + length: 1024, + array: true, + default: "{}", }) public scope: string[]; // サードパーティアプリに開放するときのためのカラム @Index() - @Column('varchar', { - length: 512, nullable: true, + @Column("varchar", { + length: 512, + nullable: true, }) public domain: string | null; } diff --git a/packages/backend/src/models/entities/relay.ts b/packages/backend/src/models/entities/relay.ts index 82c0779ff..c7509dcf4 100644 --- a/packages/backend/src/models/entities/relay.ts +++ b/packages/backend/src/models/entities/relay.ts @@ -7,13 +7,14 @@ export class Relay { public id: string; @Index({ unique: true }) - @Column('varchar', { - length: 512, nullable: false, + @Column("varchar", { + length: 512, + nullable: false, }) public inbox: string; - @Column('enum', { - enum: ['requesting', 'accepted', 'rejected'], + @Column("enum", { + enum: ["requesting", "accepted", "rejected"], }) public status: "requesting" | "accepted" | "rejected"; } diff --git a/packages/backend/src/models/entities/renote-muting.ts b/packages/backend/src/models/entities/renote-muting.ts index 64ec7f583..e8856492f 100644 --- a/packages/backend/src/models/entities/renote-muting.ts +++ b/packages/backend/src/models/entities/renote-muting.ts @@ -28,7 +28,7 @@ export class RenoteMuting { }) public muteeId: User["id"]; - @ManyToOne(type => User, { + @ManyToOne((type) => User, { onDelete: "CASCADE", }) @JoinColumn() @@ -41,7 +41,7 @@ export class RenoteMuting { }) public muterId: User["id"]; - @ManyToOne(type => User, { + @ManyToOne((type) => User, { onDelete: "CASCADE", }) @JoinColumn() diff --git a/packages/backend/src/models/entities/signin.ts b/packages/backend/src/models/entities/signin.ts index 785991823..517e71c8f 100644 --- a/packages/backend/src/models/entities/signin.ts +++ b/packages/backend/src/models/entities/signin.ts @@ -14,8 +14,8 @@ export class Signin { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the Signin.', + @Column("timestamp with time zone", { + comment: "The created date of the Signin.", }) public createdAt: Date; @@ -23,20 +23,20 @@ export class Signin { @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; - @Column('varchar', { + @Column("varchar", { length: 128, }) public ip: string; - @Column('jsonb') + @Column("jsonb") public headers: Record; - @Column('boolean') + @Column("boolean") public success: boolean; } diff --git a/packages/backend/src/models/entities/sw-subscription.ts b/packages/backend/src/models/entities/sw-subscription.ts index 8f18688ea..f7823fbaa 100644 --- a/packages/backend/src/models/entities/sw-subscription.ts +++ b/packages/backend/src/models/entities/sw-subscription.ts @@ -14,35 +14,35 @@ export class SwSubscription { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone') + @Column("timestamp with time zone") public createdAt: Date; @Index() @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; - @Column('varchar', { + @Column("varchar", { length: 512, }) public endpoint: string; - @Column('varchar', { + @Column("varchar", { length: 256, }) public auth: string; - @Column('varchar', { + @Column("varchar", { length: 128, }) public publickey: string; - @Column('boolean', { + @Column("boolean", { default: false, }) public sendReadMessage: boolean; diff --git a/packages/backend/src/models/entities/used-username.ts b/packages/backend/src/models/entities/used-username.ts index a069205a5..d00a25991 100644 --- a/packages/backend/src/models/entities/used-username.ts +++ b/packages/backend/src/models/entities/used-username.ts @@ -2,12 +2,12 @@ import { PrimaryColumn, Entity, Column } from "typeorm"; @Entity() export class UsedUsername { - @PrimaryColumn('varchar', { + @PrimaryColumn("varchar", { length: 128, }) public username: string; - @Column('timestamp with time zone') + @Column("timestamp with time zone") public createdAt: Date; constructor(data: Partial) { diff --git a/packages/backend/src/models/entities/user-group-invitation.ts b/packages/backend/src/models/entities/user-group-invitation.ts index 8037b30e1..fa2655ab6 100644 --- a/packages/backend/src/models/entities/user-group-invitation.ts +++ b/packages/backend/src/models/entities/user-group-invitation.ts @@ -11,25 +11,25 @@ import { UserGroup } from "./user-group.js"; import { id } from "../id.js"; @Entity() -@Index(['userId', 'userGroupId'], { unique: true }) +@Index(["userId", "userGroupId"], { unique: true }) export class UserGroupInvitation { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the UserGroupInvitation.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -37,12 +37,12 @@ export class UserGroupInvitation { @Index() @Column({ ...id(), - comment: 'The group ID.', + comment: "The group ID.", }) public userGroupId: UserGroup["id"]; - @ManyToOne(type => UserGroup, { - onDelete: 'CASCADE', + @ManyToOne((type) => UserGroup, { + onDelete: "CASCADE", }) @JoinColumn() public userGroup: UserGroup | null; diff --git a/packages/backend/src/models/entities/user-group-joining.ts b/packages/backend/src/models/entities/user-group-joining.ts index 6d503b274..78f820d0e 100644 --- a/packages/backend/src/models/entities/user-group-joining.ts +++ b/packages/backend/src/models/entities/user-group-joining.ts @@ -11,25 +11,25 @@ import { UserGroup } from "./user-group.js"; import { id } from "../id.js"; @Entity() -@Index(['userId', 'userGroupId'], { unique: true }) +@Index(["userId", "userGroupId"], { unique: true }) export class UserGroupJoining { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the UserGroupJoining.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -37,12 +37,12 @@ export class UserGroupJoining { @Index() @Column({ ...id(), - comment: 'The group ID.', + comment: "The group ID.", }) public userGroupId: UserGroup["id"]; - @ManyToOne(type => UserGroup, { - onDelete: 'CASCADE', + @ManyToOne((type) => UserGroup, { + onDelete: "CASCADE", }) @JoinColumn() public userGroup: UserGroup | null; diff --git a/packages/backend/src/models/entities/user-group.ts b/packages/backend/src/models/entities/user-group.ts index 38e5af334..23876ec8b 100644 --- a/packages/backend/src/models/entities/user-group.ts +++ b/packages/backend/src/models/entities/user-group.ts @@ -15,12 +15,12 @@ export class UserGroup { public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the UserGroup.', + @Column("timestamp with time zone", { + comment: "The created date of the UserGroup.", }) public createdAt: Date; - @Column('varchar', { + @Column("varchar", { length: 256, }) public name: string; @@ -28,17 +28,17 @@ 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public isPrivate: boolean; diff --git a/packages/backend/src/models/entities/user-ip.ts b/packages/backend/src/models/entities/user-ip.ts index 6b88d5221..c30e56b66 100644 --- a/packages/backend/src/models/entities/user-ip.ts +++ b/packages/backend/src/models/entities/user-ip.ts @@ -12,20 +12,19 @@ import { Note } from "./note.js"; import type { User } from "./user.js"; @Entity() -@Index(['userId', 'ip'], { unique: true }) +@Index(["userId", "ip"], { unique: true }) export class UserIp { @PrimaryGeneratedColumn() public id: string; - @Column('timestamp with time zone', { - }) + @Column("timestamp with time zone", {}) public createdAt: Date; @Index() @Column(id()) public userId: User["id"]; - @Column('varchar', { + @Column("varchar", { length: 128, }) public ip: string; diff --git a/packages/backend/src/models/entities/user-keypair.ts b/packages/backend/src/models/entities/user-keypair.ts index 212e742b9..f98384f53 100644 --- a/packages/backend/src/models/entities/user-keypair.ts +++ b/packages/backend/src/models/entities/user-keypair.ts @@ -7,18 +7,18 @@ export class UserKeypair { @PrimaryColumn(id()) public userId: User["id"]; - @OneToOne(type => User, { - onDelete: 'CASCADE', + @OneToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; - @Column('varchar', { + @Column("varchar", { length: 4096, }) public publicKey: string; - @Column('varchar', { + @Column("varchar", { length: 4096, }) public privateKey: string; diff --git a/packages/backend/src/models/entities/user-list-joining.ts b/packages/backend/src/models/entities/user-list-joining.ts index e52fa7b39..4caa71ad3 100644 --- a/packages/backend/src/models/entities/user-list-joining.ts +++ b/packages/backend/src/models/entities/user-list-joining.ts @@ -11,25 +11,25 @@ import { UserList } from "./user-list.js"; import { id } from "../id.js"; @Entity() -@Index(['userId', 'userListId'], { unique: true }) +@Index(["userId", "userListId"], { unique: true }) export class UserListJoining { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the UserListJoining.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -37,12 +37,12 @@ export class UserListJoining { @Index() @Column({ ...id(), - comment: 'The list ID.', + comment: "The list ID.", }) public userListId: UserList["id"]; - @ManyToOne(type => UserList, { - onDelete: 'CASCADE', + @ManyToOne((type) => UserList, { + onDelete: "CASCADE", }) @JoinColumn() public userList: UserList | null; diff --git a/packages/backend/src/models/entities/user-list.ts b/packages/backend/src/models/entities/user-list.ts index 7c4345230..3c95d44d6 100644 --- a/packages/backend/src/models/entities/user-list.ts +++ b/packages/backend/src/models/entities/user-list.ts @@ -14,27 +14,27 @@ export class UserList { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the UserList.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; - @Column('varchar', { + @Column("varchar", { length: 128, - comment: 'The name of the UserList.', + comment: "The name of the UserList.", }) public name: string; } diff --git a/packages/backend/src/models/entities/user-note-pining.ts b/packages/backend/src/models/entities/user-note-pining.ts index dc6d61f7e..c30fe1e02 100644 --- a/packages/backend/src/models/entities/user-note-pining.ts +++ b/packages/backend/src/models/entities/user-note-pining.ts @@ -11,13 +11,13 @@ import { User } from "./user.js"; import { id } from "../id.js"; @Entity() -@Index(['userId', 'noteId'], { unique: true }) +@Index(["userId", "noteId"], { unique: true }) export class UserNotePining { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the UserNotePinings.', + @Column("timestamp with time zone", { + comment: "The created date of the UserNotePinings.", }) public createdAt: Date; @@ -25,8 +25,8 @@ export class UserNotePining { @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @@ -34,8 +34,8 @@ export class UserNotePining { @Column(id()) public noteId: Note["id"]; - @ManyToOne(type => Note, { - onDelete: 'CASCADE', + @ManyToOne((type) => Note, { + onDelete: "CASCADE", }) @JoinColumn() public note: Note | null; diff --git a/packages/backend/src/models/entities/user-pending.ts b/packages/backend/src/models/entities/user-pending.ts index cac85d1c0..18ae5ad99 100644 --- a/packages/backend/src/models/entities/user-pending.ts +++ b/packages/backend/src/models/entities/user-pending.ts @@ -6,26 +6,26 @@ export class UserPending { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone') + @Column("timestamp with time zone") public createdAt: Date; @Index({ unique: true }) - @Column('varchar', { + @Column("varchar", { length: 128, }) public code: string; - @Column('varchar', { + @Column("varchar", { length: 128, }) public username: string; - @Column('varchar', { + @Column("varchar", { length: 128, }) public email: string; - @Column('varchar', { + @Column("varchar", { length: 128, }) public password: string; diff --git a/packages/backend/src/models/entities/user-profile.ts b/packages/backend/src/models/entities/user-profile.ts index a5eca6f48..119eecdc7 100644 --- a/packages/backend/src/models/entities/user-profile.ts +++ b/packages/backend/src/models/entities/user-profile.ts @@ -18,31 +18,34 @@ export class UserProfile { @PrimaryColumn(id()) public userId: User["id"]; - @OneToOne(type => User, { - onDelete: 'CASCADE', + @OneToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; - @Column('varchar', { - length: 128, nullable: true, - comment: 'The location of the User.', + @Column("varchar", { + length: 128, + nullable: true, + 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.', + @Column("char", { + length: 10, + nullable: true, + 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.', + @Column("varchar", { + length: 2048, + nullable: true, + comment: "The description (bio) of the User.", }) public description: string | null; - @Column('jsonb', { + @Column("jsonb", { default: [], }) public fields: { @@ -50,136 +53,145 @@ export class UserProfile { value: string; }[]; - @Column('varchar', { - length: 32, nullable: true, + @Column("varchar", { + length: 32, + nullable: true, }) public lang: string | null; - @Column('varchar', { - length: 512, nullable: true, - comment: 'Remote URL of the user.', + @Column("varchar", { + length: 512, + nullable: true, + comment: "Remote URL of the user.", }) public url: string | null; - @Column('varchar', { - length: 128, nullable: true, - comment: 'The email address of the User.', + @Column("varchar", { + length: 128, + nullable: true, + comment: "The email address of the User.", }) public email: string | null; - @Column('varchar', { - length: 128, nullable: true, + @Column("varchar", { + length: 128, + nullable: true, }) public emailVerifyCode: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public emailVerified: boolean; - @Column('jsonb', { - default: ['follow', 'receiveFollowRequest', 'groupInvited'], + @Column("jsonb", { + default: ["follow", "receiveFollowRequest", "groupInvited"], }) public emailNotificationTypes: string[]; - @Column('boolean', { + @Column("boolean", { default: false, }) public publicReactions: boolean; - @Column('enum', { + @Column("enum", { enum: ffVisibility, - default: 'public', + default: "public", }) public ffVisibility: typeof ffVisibility[number]; - @Column('varchar', { - length: 128, nullable: true, + @Column("varchar", { + length: 128, + nullable: true, }) public twoFactorTempSecret: string | null; - @Column('varchar', { - length: 128, nullable: true, + @Column("varchar", { + length: 128, + nullable: true, }) public twoFactorSecret: string | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public twoFactorEnabled: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public securityKeysAvailable: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public usePasswordLessLogin: boolean; - @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.', + @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.", }) public password: string | null; - @Column('varchar', { - length: 8192, default: '', + @Column("varchar", { + length: 8192, + default: "", }) public moderationNote: string | null; // TODO: そのうち消す - @Column('jsonb', { + @Column("jsonb", { default: {}, - comment: 'The client-specific data of the User.', + comment: "The client-specific data of the User.", }) public clientData: Record; // TODO: そのうち消す - @Column('jsonb', { + @Column("jsonb", { default: {}, - comment: 'The room data of the User.', + comment: "The room data of the User.", }) public room: Record; - @Column('boolean', { + @Column("boolean", { default: false, }) public autoAcceptFollowed: boolean; - @Column('boolean', { + @Column("boolean", { default: false, - comment: 'Whether reject index by crawler.', + comment: "Whether reject index by crawler.", }) public noCrawle: boolean; - @Column('boolean', { + @Column("boolean", { default: true, }) public preventAiLearning: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public alwaysMarkNsfw: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public autoSensitive: boolean; - @Column('boolean', { + @Column("boolean", { default: false, }) public carefulBot: boolean; - @Column('boolean', { + @Column("boolean", { default: true, }) public injectFeaturedNote: boolean; - @Column('boolean', { + @Column("boolean", { default: true, }) public receiveAnnouncementEmail: boolean; @@ -190,35 +202,36 @@ export class UserProfile { }) public pinnedPageId: Page["id"] | null; - @OneToOne(type => Page, { - onDelete: 'SET NULL', + @OneToOne((type) => Page, { + onDelete: "SET NULL", }) @JoinColumn() public pinnedPage: Page | null; - @Column('jsonb', { + @Column("jsonb", { default: {}, }) public integrations: Record; @Index() - @Column('boolean', { - default: false, select: false, + @Column("boolean", { + default: false, + select: false, }) public enableWordMute: boolean; - @Column('jsonb', { + @Column("jsonb", { default: [], }) public mutedWords: string[][]; - @Column('jsonb', { + @Column("jsonb", { default: [], - comment: 'List of instances muted by the user.', + comment: "List of instances muted by the user.", }) public mutedInstances: string[]; - @Column('enum', { + @Column("enum", { enum: notificationTypes, array: true, default: [], @@ -227,9 +240,10 @@ export class UserProfile { //#region Denormalized fields @Index() - @Column('varchar', { - length: 128, nullable: true, - comment: '[Denormalized]', + @Column("varchar", { + length: 128, + nullable: true, + comment: "[Denormalized]", }) public userHost: string | null; //#endregion diff --git a/packages/backend/src/models/entities/user-publickey.ts b/packages/backend/src/models/entities/user-publickey.ts index d1a9239d1..83a86b8a3 100644 --- a/packages/backend/src/models/entities/user-publickey.ts +++ b/packages/backend/src/models/entities/user-publickey.ts @@ -14,19 +14,19 @@ export class UserPublickey { @PrimaryColumn(id()) public userId: User["id"]; - @OneToOne(type => User, { - onDelete: 'CASCADE', + @OneToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @Index({ unique: true }) - @Column('varchar', { + @Column("varchar", { length: 256, }) public keyId: string; - @Column('varchar', { + @Column("varchar", { length: 4096, }) public keyPem: string; diff --git a/packages/backend/src/models/entities/user-security-key.ts b/packages/backend/src/models/entities/user-security-key.ts index 3b9d925d9..511cab4ae 100644 --- a/packages/backend/src/models/entities/user-security-key.ts +++ b/packages/backend/src/models/entities/user-security-key.ts @@ -11,8 +11,8 @@ import { id } from "../id.js"; @Entity() export class UserSecurityKey { - @PrimaryColumn('varchar', { - comment: 'Variable-length id given to navigator.credentials.get()', + @PrimaryColumn("varchar", { + comment: "Variable-length id given to navigator.credentials.get()", }) public id: string; @@ -20,27 +20,27 @@ export class UserSecurityKey { @Column(id()) public userId: User["id"]; - @ManyToOne(type => User, { - onDelete: 'CASCADE', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; @Index() - @Column('varchar', { + @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', { + @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', + @Column("varchar", { + comment: "User-defined name for this key", length: 30, }) public name: string; diff --git a/packages/backend/src/models/entities/user.ts b/packages/backend/src/models/entities/user.ts index c23f4f28d..53dc7e60b 100644 --- a/packages/backend/src/models/entities/user.ts +++ b/packages/backend/src/models/entities/user.ts @@ -10,99 +10,101 @@ import { id } from "../id.js"; import { DriveFile } from "./drive-file.js"; @Entity() -@Index(['usernameLower', 'host'], { unique: true }) +@Index(["usernameLower", "host"], { unique: true }) export class User { @PrimaryColumn(id()) public id: string; @Index() - @Column('timestamp with time zone', { - comment: 'The created date of the User.', + @Column("timestamp with time zone", { + comment: "The created date of the User.", }) public createdAt: Date; @Index() - @Column('timestamp with time zone', { + @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', { + @Column("timestamp with time zone", { nullable: true, }) public lastFetchedAt: Date | null; @Index() - @Column('timestamp with time zone', { + @Column("timestamp with time zone", { nullable: true, }) public lastActiveDate: Date | null; - @Column('boolean', { + @Column("boolean", { default: false, }) public hideOnlineStatus: boolean; - @Column('varchar', { + @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.', + @Column("varchar", { + length: 128, + select: false, + comment: "The username (lowercased) of the User.", }) public usernameLower: string; - @Column('varchar', { - length: 128, nullable: true, - comment: 'The name of the User.', + @Column("varchar", { + length: 128, + nullable: true, + comment: "The name of the User.", }) public name: string | null; - @Column('integer', { + @Column("integer", { default: 0, - comment: 'The count of followers.', + comment: "The count of followers.", }) public followersCount: number; - @Column('integer', { + @Column("integer", { default: 0, - comment: 'The count of following.', + comment: "The count of following.", }) public followingCount: number; - @Column('varchar', { + @Column("varchar", { length: 512, nullable: true, - comment: 'The URI of the new account of the User', + comment: "The URI of the new account of the User", }) public movedToUri: string | null; - @Column('simple-array', { + @Column("simple-array", { nullable: true, - comment: 'URIs the user is known as too', + comment: "URIs the user is known as too", }) public alsoKnownAs: string[] | null; - @Column('integer', { + @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', + @OneToOne((type) => DriveFile, { + onDelete: "SET NULL", }) @JoinColumn() public avatar: DriveFile | null; @@ -110,143 +112,162 @@ 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', + @OneToOne((type) => DriveFile, { + onDelete: "SET NULL", }) @JoinColumn() public banner: DriveFile | null; @Index() - @Column('varchar', { - length: 128, array: true, default: '{}', + @Column("varchar", { + length: 128, + array: true, + default: "{}", }) public tags: string[]; - @Column('boolean', { + @Column("boolean", { default: false, - comment: 'Whether the User is suspended.', + comment: "Whether the User is suspended.", }) public isSuspended: boolean; - @Column('boolean', { + @Column("boolean", { default: false, - comment: 'Whether the User is silenced.', + comment: "Whether the User is silenced.", }) public isSilenced: boolean; - @Column('boolean', { + @Column("boolean", { default: false, - comment: 'Whether the User is locked.', + comment: "Whether the User is locked.", }) public isLocked: boolean; - @Column('boolean', { + @Column("boolean", { default: false, - comment: 'Whether the User is a bot.', + comment: "Whether the User is a bot.", }) public isBot: boolean; - @Column('boolean', { + @Column("boolean", { default: false, - comment: 'Whether the User is a cat.', + comment: "Whether the User is a cat.", }) public isCat: boolean; - @Column('boolean', { + @Column("boolean", { default: true, - comment: 'Whether to speak as a cat if isCat.', + comment: "Whether to speak as a cat if isCat.", }) public speakAsCat: boolean; - @Column('boolean', { + @Column("boolean", { default: false, - comment: 'Whether the User is the admin.', + comment: "Whether the User is the admin.", }) public isAdmin: boolean; - @Column('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', { + @Column("boolean", { default: true, - comment: 'Whether the User is explorable.', + comment: "Whether the User is explorable.", }) public isExplorable: boolean; // アカウントが削除されたかどうかのフラグだが、完全に削除される際は物理削除なので実質削除されるまでの「削除が進行しているかどうか」のフラグ - @Column('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: '{}', + @Column("varchar", { + 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.', + @Column("varchar", { + length: 128, + nullable: true, + 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.', + @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.", }) 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.', + @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.", }) 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.', + @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.", }) 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.', + @Column("varchar", { + length: 512, + nullable: true, + 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.', + @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.", }) public followersUri: string | null; - @Column('boolean', { + @Column("boolean", { default: false, - comment: 'Whether to show users replying to other users in the timeline.', + comment: "Whether to show users replying to other users in the timeline.", }) public showTimelineReplies: boolean; @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.', + @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.", }) public token: string | null; - @Column('integer', { + @Column("integer", { nullable: true, - comment: 'Overrides user drive capacity limit', + comment: "Overrides user drive capacity limit", }) public driveCapacityOverrideMb: number | null; diff --git a/packages/backend/src/models/entities/webhook.ts b/packages/backend/src/models/entities/webhook.ts index 5db51c3a3..47fd79966 100644 --- a/packages/backend/src/models/entities/webhook.ts +++ b/packages/backend/src/models/entities/webhook.ts @@ -25,48 +25,50 @@ export class Webhook { @PrimaryColumn(id()) public id: string; - @Column('timestamp with time zone', { - comment: 'The created date of the Antenna.', + @Column("timestamp with time zone", { + 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', + @ManyToOne((type) => User, { + onDelete: "CASCADE", }) @JoinColumn() public user: User | null; - @Column('varchar', { + @Column("varchar", { length: 128, - comment: 'The name of the Antenna.', + comment: "The name of the Antenna.", }) public name: string; @Index() - @Column('varchar', { - length: 128, array: true, default: '{}', + @Column("varchar", { + length: 128, + array: true, + default: "{}", }) public on: typeof webhookEventTypes[number][]; - @Column('varchar', { + @Column("varchar", { length: 1024, }) public url: string; - @Column('varchar', { + @Column("varchar", { length: 1024, }) public secret: string; @Index() - @Column('boolean', { + @Column("boolean", { default: true, }) public active: boolean; @@ -74,7 +76,7 @@ export class Webhook { /** * 直近のリクエスト送信日時 */ - @Column('timestamp with time zone', { + @Column("timestamp with time zone", { nullable: true, }) public latestSentAt: Date | null; @@ -82,7 +84,7 @@ export class Webhook { /** * 直近のリクエスト送信時のHTTPステータスコード */ - @Column('integer', { + @Column("integer", { nullable: true, }) public latestStatus: number | null; diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index 5e0b83792..1ca9b3289 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -257,17 +257,22 @@ export const UserRepository = db.getRepository(User).extend({ async getHasUnreadAntenna(userId: User["id"]): Promise { try { - const myAntennas = (await getAntennas()).filter((a) => a.userId === userId); + const myAntennas = (await getAntennas()).filter( + (a) => a.userId === userId, + ); - const unread = - myAntennas.length > 0 - ? await AntennaNotes.findOneBy({ - antennaId: In(myAntennas.map((x) => x.id)), - read: false, - }) - : null; + const unread = + myAntennas.length > 0 + ? await AntennaNotes.findOneBy({ + antennaId: In(myAntennas.map((x) => x.id)), + read: false, + }) + : null; - return unread != null; } catch(e) { return false; } + return unread != null; + } catch (e) { + return false; + } }, async getHasUnreadChannel(userId: User["id"]): Promise { diff --git a/packages/backend/src/queue/processors/background/index-all-notes.ts b/packages/backend/src/queue/processors/background/index-all-notes.ts index 03219199d..10c332aa3 100644 --- a/packages/backend/src/queue/processors/background/index-all-notes.ts +++ b/packages/backend/src/queue/processors/background/index-all-notes.ts @@ -5,6 +5,7 @@ import { Notes } from "@/models/index.js"; import { MoreThan } from "typeorm"; import { index } from "@/services/note/create.js"; import { Note } from "@/models/entities/note.js"; +import meilisearch from "../../../db/meilisearch.js"; const logger = queueLogger.createSubLogger("index-all-notes"); @@ -38,6 +39,7 @@ export default async function indexAllNotes( order: { id: 1, }, + relations: ["user"], }); } catch (e) { logger.error(`Failed to query notes ${e}`); @@ -58,7 +60,12 @@ export default async function indexAllNotes( for (let i = 0; i < notes.length; i += batch) { const chunk = notes.slice(i, i + batch); - await Promise.all(chunk.map((note) => index(note))); + + if (meilisearch) { + await meilisearch.ingestNote(chunk); + } + + await Promise.all(chunk.map((note) => index(note, true))); indexedCount += chunk.length; const pct = (indexedCount / total) * 100; diff --git a/packages/backend/src/queue/processors/db/delete-account.ts b/packages/backend/src/queue/processors/db/delete-account.ts index 764b83db2..a356ca7ab 100644 --- a/packages/backend/src/queue/processors/db/delete-account.ts +++ b/packages/backend/src/queue/processors/db/delete-account.ts @@ -7,6 +7,7 @@ import type { DriveFile } from "@/models/entities/drive-file.js"; import { MoreThan } from "typeorm"; import { deleteFileSync } from "@/services/drive/delete-file.js"; import { sendEmail } from "@/services/send-email.js"; +import meilisearch from "@/db/meilisearch.js"; const logger = queueLogger.createSubLogger("delete-account"); @@ -43,6 +44,9 @@ export async function deleteAccount( cursor = notes[notes.length - 1].id; await Notes.delete(notes.map((note) => note.id)); + if (meilisearch) { + await meilisearch.deleteNotes(notes); + } } logger.succ("All of notes deleted"); diff --git a/packages/backend/src/server/api/endpoints/notes/search.ts b/packages/backend/src/server/api/endpoints/notes/search.ts index 93392acdd..d0c2f8d77 100644 --- a/packages/backend/src/server/api/endpoints/notes/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/search.ts @@ -4,6 +4,7 @@ import { Note } from "@/models/entities/note.js"; import config from "@/config/index.js"; import es from "../../../../db/elasticsearch.js"; import sonic from "../../../../db/sonic.js"; +import meilisearch, { MeilisearchNote } from "../../../../db/meilisearch.js"; import define from "../../define.js"; import { makePaginationQuery } from "../../common/make-pagination-query.js"; import { generateVisibilityQuery } from "../../common/generate-visibility-query.js"; @@ -62,7 +63,7 @@ export const paramDef = { } as const; export default define(meta, paramDef, async (ps, me) => { - if (es == null && sonic == null) { + if (es == null && sonic == null && meilisearch == null) { const query = makePaginationQuery( Notes.createQueryBuilder("note"), ps.sinceId, @@ -170,6 +171,70 @@ export default define(meta, paramDef, async (ps, me) => { found.length = ps.limit; } + return found; + } else if (meilisearch) { + let start = 0; + const chunkSize = 100; + + // Use meilisearch to fetch and step through all search results that could match the requirements + const ids = []; + while (true) { + const results = await meilisearch.search(ps.query, chunkSize, start, me); + + start += chunkSize; + + if (results.hits.length === 0) { + break; + } + + const res = results.hits + .filter((key: MeilisearchNote) => { + if (ps.userId && key.userId !== ps.userId) { + return false; + } + if (ps.channelId && key.channelId !== ps.channelId) { + return false; + } + if (ps.sinceId && key.id <= ps.sinceId) { + return false; + } + if (ps.untilId && key.id >= ps.untilId) { + return false; + } + return true; + }) + .map((key) => key.id); + + ids.push(...res); + } + + // Sort all the results by note id DESC (newest first) + ids.sort((a, b) => b - a); + + // Fetch the notes from the database until we have enough to satisfy the limit + start = 0; + const found = []; + while (found.length < ps.limit && start < ids.length) { + const chunk = ids.slice(start, start + chunkSize); + const notes: Note[] = await Notes.find({ + where: { + id: In(chunk), + }, + order: { + id: "DESC", + }, + }); + + // The notes are checked for visibility and muted/blocked users when packed + found.push(...(await Notes.packMany(notes, me))); + start += chunkSize; + } + + // If we have more results than the limit, trim them + if (found.length > ps.limit) { + found.length = ps.limit; + } + return found; } else { const userQuery = diff --git a/packages/backend/src/server/api/endpoints/server-info.ts b/packages/backend/src/server/api/endpoints/server-info.ts index 1ce27e262..cc9aa91b2 100644 --- a/packages/backend/src/server/api/endpoints/server-info.ts +++ b/packages/backend/src/server/api/endpoints/server-info.ts @@ -1,6 +1,7 @@ import * as os from "node:os"; import si from "systeminformation"; import define from "../define.js"; +import meilisearch from "../../../db/meilisearch.js"; export const meta = { requireCredential: false, @@ -18,6 +19,7 @@ export const paramDef = { export default define(meta, paramDef, async () => { const memStats = await si.mem(); const fsStats = await si.fsSize(); + const meilisearchStats = await meilisearchStatus(); return { machine: os.hostname(), @@ -34,3 +36,15 @@ export default define(meta, paramDef, async () => { }, }; }); + +async function meilisearchStatus() { + if (meilisearch) { + return meilisearch.serverStats(); + } else { + return { + health: "unconfigured", + size: 0, + indexed_count: 0, + }; + } +} diff --git a/packages/backend/src/server/web/manifest.json b/packages/backend/src/server/web/manifest.json index 1e662fb20..647a5d437 100644 --- a/packages/backend/src/server/web/manifest.json +++ b/packages/backend/src/server/web/manifest.json @@ -41,7 +41,7 @@ "url": "url" } }, - "screenshots" : [ + "screenshots": [ { "src": "/static-assets/screenshots/1.webp", "sizes": "1195x579", @@ -57,7 +57,7 @@ "label": "Posts" } ], - "shortcuts" : [ + "shortcuts": [ { "name": "Notifications", "short_name": "Notifs", @@ -68,7 +68,5 @@ "url": "/my/messaging" } ], - "categories": [ - "social" - ] + "categories": ["social"] } diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index 66c5b8508..bd54db7e2 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -67,6 +67,7 @@ import type { UserProfile } from "@/models/entities/user-profile.js"; import { db } from "@/db/postgre.js"; import { getActiveWebhooks } from "@/misc/webhook-cache.js"; import { shouldSilenceInstance } from "@/misc/should-block-instance.js"; +import meilisearch from "../../db/meilisearch.js"; const mutedWordsCache = new Cache< { userId: UserProfile["userId"]; mutedWords: UserProfile["mutedWords"] }[] @@ -748,7 +749,7 @@ async function insertNote( } } -export async function index(note: Note): Promise { +export async function index(note: Note, reindexing: boolean): Promise { if (!note.text) return; if (config.elasticsearch && es) { @@ -776,6 +777,10 @@ export async function index(note: Note): Promise { note.text, ); } + + if (meilisearch && !reindexing) { + await meilisearch.ingestNote(note); + } } async function notifyToWatchersOfRenotee( diff --git a/packages/backend/src/services/note/delete.ts b/packages/backend/src/services/note/delete.ts index 392578e2f..285a08075 100644 --- a/packages/backend/src/services/note/delete.ts +++ b/packages/backend/src/services/note/delete.ts @@ -21,6 +21,7 @@ import { import { countSameRenotes } from "@/misc/count-same-renotes.js"; import { registerOrFetchInstanceDoc } from "../register-or-fetch-instance-doc.js"; import { deliverToRelays } from "../relay.js"; +import meilisearch from "@/db/meilisearch.js"; /** * 投稿を削除します。 @@ -119,6 +120,10 @@ export default async function ( id: note.id, userId: user.id, }); + + if(meilisearch) { + await meilisearch.deleteNotes(note.id); + } } async function findCascadingNotes(note: Note) { diff --git a/packages/calckey-js/package.json b/packages/calckey-js/package.json index 598dd1cdb..6f724fc21 100644 --- a/packages/calckey-js/package.json +++ b/packages/calckey-js/package.json @@ -34,9 +34,7 @@ "tsd": "^0.19.1", "typescript": "4.5.4" }, - "files": [ - "built" - ], + "files": ["built"], "dependencies": { "autobind-decorator": "^2.4.0", "eventemitter3": "^4.0.7", diff --git a/packages/calckey-js/tsconfig.json b/packages/calckey-js/tsconfig.json index a03a24262..642bcc45b 100644 --- a/packages/calckey-js/tsconfig.json +++ b/packages/calckey-js/tsconfig.json @@ -15,11 +15,6 @@ "noImplicitReturns": true, "esModuleInterop": true }, - "include": [ - "src/**/*" - ], - "exclude": [ - "node_modules", - "test/**/*" - ] + "include": ["src/**/*"], + "exclude": ["node_modules", "test/**/*"] } diff --git a/packages/client/package.json b/packages/client/package.json index 1af31dd09..ccddda6b9 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -79,7 +79,7 @@ "typescript": "4.9.4", "uuid": "9.0.0", "vanilla-tilt": "1.8.0", - "vite": "^4.1.1", + "vite": "4.3.9", "vite-plugin-compression": "^0.5.1", "vue": "3.2.45", "vue-isyourpasswordsafe": "^2.0.0", diff --git a/packages/client/src/components/MkMediaImage.vue b/packages/client/src/components/MkMediaImage.vue index 74f45c69c..9097a4771 100644 --- a/packages/client/src/components/MkMediaImage.vue +++ b/packages/client/src/components/MkMediaImage.vue @@ -91,7 +91,7 @@ watch( align-items: center; padding: 30px; box-sizing: border-box; - background: rgba(0,0,0,0.5); + background: rgba(0, 0, 0, 0.5); > .wrapper { display: table-cell; diff --git a/packages/client/src/components/MkMediaList.vue b/packages/client/src/components/MkMediaList.vue index 901aceeff..c01ccd5d8 100644 --- a/packages/client/src/components/MkMediaList.vue +++ b/packages/client/src/components/MkMediaList.vue @@ -11,10 +11,7 @@ :data-count="previewableCount < 5 ? previewableCount : null" :class="{ dmWidth: inDm }" > -
+
@@ -56,6 +61,7 @@ import XNet from "./net.vue"; import XCpu from "./cpu.vue"; import XMemory from "./mem.vue"; import XDisk from "./disk.vue"; +import XMeili from "./meilisearch.vue"; import MkContainer from "@/components/MkContainer.vue"; import { GetFormResultType } from "@/scripts/form"; import * as os from "@/os"; @@ -102,7 +108,7 @@ os.api("server-info", {}).then((res) => { }); const toggleView = () => { - if (widgetProps.view === 4) { + if (widgetProps.view === 5) { widgetProps.view = 0; } else { widgetProps.view++; diff --git a/packages/client/src/widgets/server-metric/meilisearch.vue b/packages/client/src/widgets/server-metric/meilisearch.vue new file mode 100644 index 000000000..a4a899200 --- /dev/null +++ b/packages/client/src/widgets/server-metric/meilisearch.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/packages/sw/package.json b/packages/sw/package.json index 112005ba7..0d0ac52df 100644 --- a/packages/sw/package.json +++ b/packages/sw/package.json @@ -6,9 +6,7 @@ "watch": "pnpm swc src -d built -D -w", "lint": "pnpm rome check \"src/**/*.ts\"" }, - "dependencies": { - - }, + "dependencies": {}, "devDependencies": { "@swc/cli": "^0.1.62", "@swc/core": "^1.3.50", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 493e9fc06..4c9b78673 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,8 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false overrides: chokidar: ^3.3.1 @@ -24,7 +28,7 @@ importers: version: 7.2.0 focus-trap-vue: specifier: ^4.0.1 - version: 4.0.1(focus-trap@7.2.0)(vue@3.2.45) + version: 4.0.1(focus-trap@7.2.0)(vue@3.3.4) js-yaml: specifier: 4.1.0 version: 4.1.0 @@ -104,6 +108,9 @@ importers: '@koa/router': specifier: 9.0.1 version: 9.0.1 + '@paralleldrive/cuid2': + specifier: 2.2.0 + version: 2.2.0 '@peertube/http-signature': specifier: 1.7.0 version: 1.7.0 @@ -263,6 +270,9 @@ importers: koa-views: specifier: 7.0.2 version: 7.0.2(@types/koa@2.13.5)(ejs@3.1.8)(pug@3.0.2) + meilisearch: + specifier: 0.32.4 + version: 0.32.4 mfm-js: specifier: 0.23.3 version: 0.23.3 @@ -715,7 +725,7 @@ importers: version: 8.3.4 '@vitejs/plugin-vue': specifier: 4.0.0 - version: 4.0.0(vite@4.1.1)(vue@3.2.45) + version: 4.0.0(vite@4.3.9)(vue@3.2.45) '@vue/compiler-sfc': specifier: 3.2.45 version: 3.2.45 @@ -876,11 +886,11 @@ importers: specifier: 1.8.0 version: 1.8.0 vite: - specifier: ^4.1.1 - version: 4.1.1(sass@1.57.1) + specifier: 4.3.9 + version: 4.3.9(sass@1.57.1) vite-plugin-compression: specifier: ^0.5.1 - version: 0.5.1(vite@4.1.1) + version: 0.5.1(vite@4.3.9) vue: specifier: 3.2.45 version: 3.2.45 @@ -1077,6 +1087,11 @@ packages: resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} engines: {node: '>=6.9.0'} + /@babel/helper-string-parser@7.21.5: + resolution: {integrity: sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==} + engines: {node: '>=6.9.0'} + dev: false + /@babel/helper-validator-identifier@7.19.1: resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} engines: {node: '>=6.9.0'} @@ -1120,6 +1135,14 @@ packages: '@babel/types': 7.21.4 dev: true + /@babel/parser@7.22.3: + resolution: {integrity: sha512-vrukxyW/ep8UD1UDzOYpTKQ6abgjFoeG6L+4ar9+c5TN9QnlqiOi6QK7LSR5ewm/ERyGkT/Ai6VboNrxhbr9Uw==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.22.3 + dev: false + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.21.4): resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: @@ -1306,6 +1329,15 @@ packages: to-fast-properties: 2.0.0 dev: true + /@babel/types@7.22.3: + resolution: {integrity: sha512-P3na3xIQHTKY4L0YOG7pM8M8uoUIB910WQaSiiMCZUC2Cy8XFEQONGABFnHWBa2gpGKODTAJcNhi5Zk0sLRrzg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.21.5 + '@babel/helper-validator-identifier': 7.19.1 + to-fast-properties: 2.0.0 + dev: false + /@bcoe/v8-coverage@0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true @@ -1596,8 +1628,8 @@ packages: - supports-color dev: false - /@esbuild/android-arm64@0.16.17: - resolution: {integrity: sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==} + /@esbuild/android-arm64@0.17.19: + resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1605,8 +1637,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.16.17: - resolution: {integrity: sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==} + /@esbuild/android-arm@0.17.19: + resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -1614,8 +1646,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.16.17: - resolution: {integrity: sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==} + /@esbuild/android-x64@0.17.19: + resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -1623,8 +1655,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.16.17: - resolution: {integrity: sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==} + /@esbuild/darwin-arm64@0.17.19: + resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -1632,8 +1664,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.16.17: - resolution: {integrity: sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==} + /@esbuild/darwin-x64@0.17.19: + resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -1641,8 +1673,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.16.17: - resolution: {integrity: sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==} + /@esbuild/freebsd-arm64@0.17.19: + resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -1650,8 +1682,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.16.17: - resolution: {integrity: sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==} + /@esbuild/freebsd-x64@0.17.19: + resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -1659,8 +1691,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.16.17: - resolution: {integrity: sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==} + /@esbuild/linux-arm64@0.17.19: + resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -1668,8 +1700,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.16.17: - resolution: {integrity: sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==} + /@esbuild/linux-arm@0.17.19: + resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -1677,8 +1709,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.16.17: - resolution: {integrity: sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==} + /@esbuild/linux-ia32@0.17.19: + resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -1686,8 +1718,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.16.17: - resolution: {integrity: sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==} + /@esbuild/linux-loong64@0.17.19: + resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -1695,8 +1727,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.16.17: - resolution: {integrity: sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==} + /@esbuild/linux-mips64el@0.17.19: + resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -1704,8 +1736,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.16.17: - resolution: {integrity: sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==} + /@esbuild/linux-ppc64@0.17.19: + resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -1713,8 +1745,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.16.17: - resolution: {integrity: sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==} + /@esbuild/linux-riscv64@0.17.19: + resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -1722,8 +1754,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.16.17: - resolution: {integrity: sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==} + /@esbuild/linux-s390x@0.17.19: + resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -1731,8 +1763,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.16.17: - resolution: {integrity: sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==} + /@esbuild/linux-x64@0.17.19: + resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -1740,8 +1772,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.16.17: - resolution: {integrity: sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==} + /@esbuild/netbsd-x64@0.17.19: + resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -1749,8 +1781,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.16.17: - resolution: {integrity: sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==} + /@esbuild/openbsd-x64@0.17.19: + resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -1758,8 +1790,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.16.17: - resolution: {integrity: sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==} + /@esbuild/sunos-x64@0.17.19: + resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -1767,8 +1799,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.16.17: - resolution: {integrity: sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==} + /@esbuild/win32-arm64@0.17.19: + resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -1776,8 +1808,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.16.17: - resolution: {integrity: sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==} + /@esbuild/win32-ia32@0.17.19: + resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -1785,8 +1817,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.16.17: - resolution: {integrity: sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==} + /@esbuild/win32-x64@0.17.19: + resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -2088,6 +2120,10 @@ packages: /@jridgewell/sourcemap-codec@1.4.14: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + /@jridgewell/sourcemap-codec@1.4.15: + resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + dev: false + /@jridgewell/trace-mapping@0.3.17: resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} dependencies: @@ -2140,7 +2176,7 @@ packages: detect-libc: 2.0.1 https-proxy-agent: 5.0.1 make-dir: 3.1.0 - node-fetch: 2.6.8 + node-fetch: 2.6.11 nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 @@ -2158,7 +2194,7 @@ packages: detect-libc: 2.0.1 https-proxy-agent: 5.0.1 make-dir: 3.1.0 - node-fetch: 2.6.8 + node-fetch: 2.6.11 nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 @@ -2277,6 +2313,10 @@ packages: hasBin: true dev: false + /@noble/hashes@1.3.0: + resolution: {integrity: sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==} + dev: false + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -2330,6 +2370,12 @@ packages: through: 2.3.4 dev: false + /@paralleldrive/cuid2@2.2.0: + resolution: {integrity: sha512-CVQDpPIUHrUGGLdrMGz1NmqZvqmsB2j2rCIQEu1EvxWjlFh4fhvEGmgR409cY20/67/WlJsggenq0no3p3kYsw==} + dependencies: + '@noble/hashes': 1.3.0 + dev: false + /@peertube/http-signature@1.7.0: resolution: {integrity: sha512-aGQIwo6/sWtyyqhVK4e1MtxYz4N1X8CNt6SOtCc+Wnczs5S5ONaLHDDR8LYaGn0MgOwvGgXyuZ5sJIfd7iyoUw==} engines: {node: '>=0.10'} @@ -2819,7 +2865,7 @@ packages: '@types/webgl-ext': 0.0.30 '@webgpu/types': 0.1.16 long: 4.0.0 - node-fetch: 2.6.8 + node-fetch: 2.6.11 seedrandom: 3.0.5 transitivePeerDependencies: - encoding @@ -2835,7 +2881,7 @@ packages: '@types/webgl-ext': 0.0.30 '@webgpu/types': 0.1.21 long: 4.0.0 - node-fetch: 2.6.8 + node-fetch: 2.6.11 seedrandom: 3.0.5 transitivePeerDependencies: - encoding @@ -2849,7 +2895,7 @@ packages: dependencies: '@tensorflow/tfjs-core': 3.21.0 '@types/node-fetch': 2.6.2 - node-fetch: 2.6.8 + node-fetch: 2.6.11 seedrandom: 3.0.5 string_decoder: 1.3.0 transitivePeerDependencies: @@ -2864,7 +2910,7 @@ packages: dependencies: '@tensorflow/tfjs-core': 4.2.0 '@types/node-fetch': 2.6.2 - node-fetch: 2.6.8 + node-fetch: 2.6.11 seedrandom: 3.0.5 string_decoder: 1.3.0 transitivePeerDependencies: @@ -3788,14 +3834,14 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /@vitejs/plugin-vue@4.0.0(vite@4.1.1)(vue@3.2.45): + /@vitejs/plugin-vue@4.0.0(vite@4.3.9)(vue@3.2.45): resolution: {integrity: sha512-e0X4jErIxAB5oLtDqbHvHpJe/uWNkdpYV83AOG2xo2tEVSzCzewgJMtREZM30wXnM5ls90hxiOtAuVU6H5JgbA==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.1.1(sass@1.57.1) + vite: 4.3.9(sass@1.57.1) vue: 3.2.45 dev: true @@ -3806,18 +3852,36 @@ packages: '@vue/shared': 3.2.45 estree-walker: 2.0.2 source-map: 0.6.1 + dev: true + + /@vue/compiler-core@3.3.4: + resolution: {integrity: sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==} + dependencies: + '@babel/parser': 7.22.3 + '@vue/shared': 3.3.4 + estree-walker: 2.0.2 + source-map-js: 1.0.2 + dev: false /@vue/compiler-dom@3.2.45: resolution: {integrity: sha512-tyYeUEuKqqZO137WrZkpwfPCdiiIeXYCcJ8L4gWz9vqaxzIQRccTSwSWZ/Axx5YR2z+LvpUbmPNXxuBU45lyRw==} dependencies: '@vue/compiler-core': 3.2.45 '@vue/shared': 3.2.45 + dev: true + + /@vue/compiler-dom@3.3.4: + resolution: {integrity: sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==} + dependencies: + '@vue/compiler-core': 3.3.4 + '@vue/shared': 3.3.4 + dev: false /@vue/compiler-sfc@2.7.14: resolution: {integrity: sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA==} dependencies: '@babel/parser': 7.20.7 - postcss: 8.4.21 + postcss: 8.4.24 source-map: 0.6.1 dev: true @@ -3834,12 +3898,36 @@ packages: magic-string: 0.25.9 postcss: 8.4.21 source-map: 0.6.1 + dev: true + + /@vue/compiler-sfc@3.3.4: + resolution: {integrity: sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==} + dependencies: + '@babel/parser': 7.22.3 + '@vue/compiler-core': 3.3.4 + '@vue/compiler-dom': 3.3.4 + '@vue/compiler-ssr': 3.3.4 + '@vue/reactivity-transform': 3.3.4 + '@vue/shared': 3.3.4 + estree-walker: 2.0.2 + magic-string: 0.30.0 + postcss: 8.4.24 + source-map-js: 1.0.2 + dev: false /@vue/compiler-ssr@3.2.45: resolution: {integrity: sha512-6BRaggEGqhWht3lt24CrIbQSRD5O07MTmd+LjAn5fJj568+R9eUD2F7wMQJjX859seSlrYog7sUtrZSd7feqrQ==} dependencies: '@vue/compiler-dom': 3.2.45 '@vue/shared': 3.2.45 + dev: true + + /@vue/compiler-ssr@3.3.4: + resolution: {integrity: sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==} + dependencies: + '@vue/compiler-dom': 3.3.4 + '@vue/shared': 3.3.4 + dev: false /@vue/reactivity-transform@3.2.45: resolution: {integrity: sha512-BHVmzYAvM7vcU5WmuYqXpwaBHjsS8T63jlKGWVtHxAHIoMIlmaMyurUSEs1Zcg46M4AYT5MtB1U274/2aNzjJQ==} @@ -3849,17 +3937,43 @@ packages: '@vue/shared': 3.2.45 estree-walker: 2.0.2 magic-string: 0.25.9 + dev: true + + /@vue/reactivity-transform@3.3.4: + resolution: {integrity: sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==} + dependencies: + '@babel/parser': 7.22.3 + '@vue/compiler-core': 3.3.4 + '@vue/shared': 3.3.4 + estree-walker: 2.0.2 + magic-string: 0.30.0 + dev: false /@vue/reactivity@3.2.45: resolution: {integrity: sha512-PRvhCcQcyEVohW0P8iQ7HDcIOXRjZfAsOds3N99X/Dzewy8TVhTCT4uXpAHfoKjVTJRA0O0K+6QNkDIZAxNi3A==} dependencies: '@vue/shared': 3.2.45 + dev: true + + /@vue/reactivity@3.3.4: + resolution: {integrity: sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==} + dependencies: + '@vue/shared': 3.3.4 + dev: false /@vue/runtime-core@3.2.45: resolution: {integrity: sha512-gzJiTA3f74cgARptqzYswmoQx0fIA+gGYBfokYVhF8YSXjWTUA2SngRzZRku2HbGbjzB6LBYSbKGIaK8IW+s0A==} dependencies: '@vue/reactivity': 3.2.45 '@vue/shared': 3.2.45 + dev: true + + /@vue/runtime-core@3.3.4: + resolution: {integrity: sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==} + dependencies: + '@vue/reactivity': 3.3.4 + '@vue/shared': 3.3.4 + dev: false /@vue/runtime-dom@3.2.45: resolution: {integrity: sha512-cy88YpfP5Ue2bDBbj75Cb4bIEZUMM/mAkDMfqDTpUYVgTf/kuQ2VQ8LebuZ8k6EudgH8pYhsGWHlY0lcxlvTwA==} @@ -3867,6 +3981,15 @@ packages: '@vue/runtime-core': 3.2.45 '@vue/shared': 3.2.45 csstype: 2.6.21 + dev: true + + /@vue/runtime-dom@3.3.4: + resolution: {integrity: sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==} + dependencies: + '@vue/runtime-core': 3.3.4 + '@vue/shared': 3.3.4 + csstype: 3.1.2 + dev: false /@vue/server-renderer@3.2.45(vue@3.2.45): resolution: {integrity: sha512-ebiMq7q24WBU1D6uhPK//2OTR1iRIyxjF5iVq/1a5I1SDMDyDu4Ts6fJaMnjrvD3MqnaiFkKQj+LKAgz5WIK3g==} @@ -3876,9 +3999,25 @@ packages: '@vue/compiler-ssr': 3.2.45 '@vue/shared': 3.2.45 vue: 3.2.45 + dev: true + + /@vue/server-renderer@3.3.4(vue@3.3.4): + resolution: {integrity: sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==} + peerDependencies: + vue: 3.3.4 + dependencies: + '@vue/compiler-ssr': 3.3.4 + '@vue/shared': 3.3.4 + vue: 3.3.4 + dev: false /@vue/shared@3.2.45: resolution: {integrity: sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==} + dev: true + + /@vue/shared@3.3.4: + resolution: {integrity: sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==} + dev: false /@webassemblyjs/ast@1.11.1: resolution: {integrity: sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==} @@ -5880,8 +6019,8 @@ packages: requiresBuild: true dev: false - /core-js@3.30.1: - resolution: {integrity: sha512-ZNS5nbiSwDTq4hFosEDqm65izl2CWmLz0hARJMyNQBgkUZMIF51cQiMvIQKA6hvuaeWxQDP3hEedM1JZIgTldQ==} + /core-js@3.30.2: + resolution: {integrity: sha512-uBJiDmwqsbJCWHAwjrx3cvjbMXP7xD72Dmsn5LOJpiRmE3WbBbN5rCqQ2Qh6Ek6/eOrjlWngEynBWo4VxerQhg==} requiresBuild: true dev: true @@ -5938,6 +6077,14 @@ packages: - encoding dev: true + /cross-fetch@3.1.6: + resolution: {integrity: sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==} + dependencies: + node-fetch: 2.6.11 + transitivePeerDependencies: + - encoding + dev: false + /cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: @@ -6040,11 +6187,16 @@ packages: /csstype@2.6.21: resolution: {integrity: sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==} + dev: true /csstype@3.1.1: resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==} dev: true + /csstype@3.1.2: + resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} + dev: false + /custom-event-polyfill@1.0.7: resolution: {integrity: sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==} dev: true @@ -6656,34 +6808,34 @@ packages: es6-symbol: 3.1.3 dev: true - /esbuild@0.16.17: - resolution: {integrity: sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==} + /esbuild@0.17.19: + resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.16.17 - '@esbuild/android-arm64': 0.16.17 - '@esbuild/android-x64': 0.16.17 - '@esbuild/darwin-arm64': 0.16.17 - '@esbuild/darwin-x64': 0.16.17 - '@esbuild/freebsd-arm64': 0.16.17 - '@esbuild/freebsd-x64': 0.16.17 - '@esbuild/linux-arm': 0.16.17 - '@esbuild/linux-arm64': 0.16.17 - '@esbuild/linux-ia32': 0.16.17 - '@esbuild/linux-loong64': 0.16.17 - '@esbuild/linux-mips64el': 0.16.17 - '@esbuild/linux-ppc64': 0.16.17 - '@esbuild/linux-riscv64': 0.16.17 - '@esbuild/linux-s390x': 0.16.17 - '@esbuild/linux-x64': 0.16.17 - '@esbuild/netbsd-x64': 0.16.17 - '@esbuild/openbsd-x64': 0.16.17 - '@esbuild/sunos-x64': 0.16.17 - '@esbuild/win32-arm64': 0.16.17 - '@esbuild/win32-ia32': 0.16.17 - '@esbuild/win32-x64': 0.16.17 + '@esbuild/android-arm': 0.17.19 + '@esbuild/android-arm64': 0.17.19 + '@esbuild/android-x64': 0.17.19 + '@esbuild/darwin-arm64': 0.17.19 + '@esbuild/darwin-x64': 0.17.19 + '@esbuild/freebsd-arm64': 0.17.19 + '@esbuild/freebsd-x64': 0.17.19 + '@esbuild/linux-arm': 0.17.19 + '@esbuild/linux-arm64': 0.17.19 + '@esbuild/linux-ia32': 0.17.19 + '@esbuild/linux-loong64': 0.17.19 + '@esbuild/linux-mips64el': 0.17.19 + '@esbuild/linux-ppc64': 0.17.19 + '@esbuild/linux-riscv64': 0.17.19 + '@esbuild/linux-s390x': 0.17.19 + '@esbuild/linux-x64': 0.17.19 + '@esbuild/netbsd-x64': 0.17.19 + '@esbuild/openbsd-x64': 0.17.19 + '@esbuild/sunos-x64': 0.17.19 + '@esbuild/win32-arm64': 0.17.19 + '@esbuild/win32-ia32': 0.17.19 + '@esbuild/win32-x64': 0.17.19 dev: true /escalade@3.1.1: @@ -7397,14 +7549,14 @@ packages: readable-stream: 2.3.7 dev: true - /focus-trap-vue@4.0.1(focus-trap@7.2.0)(vue@3.2.45): + /focus-trap-vue@4.0.1(focus-trap@7.2.0)(vue@3.3.4): resolution: {integrity: sha512-2iqOeoSvgq7Um6aL+255a/wXPskj6waLq2oKCa4gOnMORPo15JX7wN6J5bl1SMhMlTlkHXGSrQ9uJPJLPZDl5w==} peerDependencies: focus-trap: ^7.0.0 vue: ^3.0.0 dependencies: focus-trap: 7.2.0 - vue: 3.2.45 + vue: 3.3.4 dev: false /focus-trap@7.2.0: @@ -9643,7 +9795,7 @@ packages: /jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: - graceful-fs: 4.2.11 + graceful-fs: 4.2.10 /jsonfile@5.0.0: resolution: {integrity: sha512-NQRZ5CRo74MhMMC3/3r5g2k4fjodJ/wh8MxjFbCViWKFjxrnudWSY5vomh+23ZaXzAS7J3fBZIR2dV6WbmfM0w==} @@ -9657,7 +9809,7 @@ packages: dependencies: universalify: 2.0.0 optionalDependencies: - graceful-fs: 4.2.11 + graceful-fs: 4.2.10 dev: true /jsonld@6.0.0: @@ -10283,6 +10435,14 @@ packages: resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==} dependencies: sourcemap-codec: 1.4.8 + dev: true + + /magic-string@0.30.0: + resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/sourcemap-codec': 1.4.15 + dev: false /mailcheck@1.1.1: resolution: {integrity: sha512-3WjL8+ZDouZwKlyJBMp/4LeziLFXgleOdsYu87piGcMLqhBzCsy2QFdbtAwv757TFC/rtqd738fgJw1tFQCSgA==} @@ -10386,6 +10546,14 @@ packages: engines: {node: '>= 0.6'} dev: false + /meilisearch@0.32.4: + resolution: {integrity: sha512-QvPtQ6F2TaqAT9fw072/MDjSCMpQifdtUBFeIk3M5jSnFpeSiv1iwfJWNfP6ByaCgR/s++K1Cqtf9vjcZe7prg==} + dependencies: + cross-fetch: 3.1.6 + transitivePeerDependencies: + - encoding + dev: false + /meow@9.0.0: resolution: {integrity: sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==} engines: {node: '>=10'} @@ -10743,8 +10911,8 @@ packages: hasBin: true dev: true - /nanoid@3.3.4: - resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} + /nanoid@3.3.6: + resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -10854,6 +11022,18 @@ packages: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} + /node-fetch@2.6.11: + resolution: {integrity: sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: false + /node-fetch@2.6.7: resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} engines: {node: 4.x || >=6.0.0} @@ -11865,7 +12045,15 @@ packages: resolution: {integrity: sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.4 + nanoid: 3.3.6 + picocolors: 1.0.0 + source-map-js: 1.0.2 + + /postcss@8.4.24: + resolution: {integrity: sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.6 picocolors: 1.0.0 source-map-js: 1.0.2 @@ -12758,8 +12946,8 @@ packages: rangestr: 0.0.1 seedrandom: 2.4.2 - /rollup@3.12.1: - resolution: {integrity: sha512-t9elERrz2i4UU9z7AwISj3CQcXP39cWxgRWLdf4Tm6aKm1eYrqHIgjzXBgb67GNY1sZckTFFi0oMozh3/S++Ig==} + /rollup@3.23.0: + resolution: {integrity: sha512-h31UlwEi7FHihLe1zbk+3Q7z1k/84rb9BSwmBSr/XjOCEaBJ2YyedQDuM0t/kfOS0IxM+vk1/zI9XxYj9V+NJQ==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: @@ -13193,6 +13381,7 @@ packages: /sourcemap-codec@1.4.8: resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} deprecated: Please use @jridgewell/sourcemap-codec instead + dev: true /sparkles@1.0.1: resolution: {integrity: sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==} @@ -14596,7 +14785,7 @@ packages: replace-ext: 1.0.1 dev: true - /vite-plugin-compression@0.5.1(vite@4.1.1): + /vite-plugin-compression@0.5.1(vite@4.3.9): resolution: {integrity: sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==} peerDependencies: vite: '>=2.0.0' @@ -14604,13 +14793,13 @@ packages: chalk: 4.1.2 debug: 4.3.4(supports-color@8.1.1) fs-extra: 10.1.0 - vite: 4.1.1(sass@1.57.1) + vite: 4.3.9(sass@1.57.1) transitivePeerDependencies: - supports-color dev: true - /vite@4.1.1(sass@1.57.1): - resolution: {integrity: sha512-LM9WWea8vsxhr782r9ntg+bhSFS06FJgCvvB0+8hf8UWtvaiDagKYWXndjfX6kGl74keHJUcpzrQliDXZlF5yg==} + /vite@4.3.9(sass@1.57.1): + resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -14634,10 +14823,9 @@ packages: terser: optional: true dependencies: - esbuild: 0.16.17 - postcss: 8.4.21 - resolve: 1.22.1 - rollup: 3.12.1 + esbuild: 0.17.19 + postcss: 8.4.24 + rollup: 3.23.0 sass: 1.57.1 optionalDependencies: fsevents: 2.3.2 @@ -14684,6 +14872,17 @@ packages: '@vue/runtime-dom': 3.2.45 '@vue/server-renderer': 3.2.45(vue@3.2.45) '@vue/shared': 3.2.45 + dev: true + + /vue@3.3.4: + resolution: {integrity: sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==} + dependencies: + '@vue/compiler-dom': 3.3.4 + '@vue/compiler-sfc': 3.3.4 + '@vue/runtime-dom': 3.3.4 + '@vue/server-renderer': 3.3.4(vue@3.3.4) + '@vue/shared': 3.3.4 + dev: false /vuedraggable@4.1.0(vue@3.2.45): resolution: {integrity: sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==} @@ -15309,7 +15508,7 @@ packages: name: plyr version: 3.7.0 dependencies: - core-js: 3.30.1 + core-js: 3.30.2 custom-event-polyfill: 1.0.7 loadjs: 4.2.0 rangetouch: 2.0.1 diff --git a/rome.json b/rome.json index 6b74808ed..7a51b60e6 100644 --- a/rome.json +++ b/rome.json @@ -5,5 +5,18 @@ "rules": { "recommended": true } - } -} \ No newline at end of file + }, + "formatter": { + "ignore": [ + "packages/calckey-js/api-extractor.json", + "packages/*/tsconfig.json", + "packages/*/package-lock.json", + "packages/backend/src/server/web/manifest.ts", + "packages/backend/built/", + "packages/backend/nsfw-model/", + "packages/client/src/emojilist.json", + "*.md", + "*/.yml" + ] + } +}