summaryrefslogtreecommitdiff
path: root/packages/backend/src/models
diff options
context:
space:
mode:
authormisskey-release-bot[bot] <157398866+misskey-release-bot[bot]@users.noreply.github.com>2025-08-31 08:42:43 +0000
committerGitHub <noreply@github.com>2025-08-31 08:42:43 +0000
commitec21336d45e6e3bb26a0225fc0aa57ac98d5be4b (patch)
tree2c7aef5ba1626009377faf96941a57411dd619e5 /packages/backend/src/models
parentMerge pull request #16244 from misskey-dev/develop (diff)
parentRelease: 2025.8.0 (diff)
downloadmisskey-ec21336d45e6e3bb26a0225fc0aa57ac98d5be4b.tar.gz
misskey-ec21336d45e6e3bb26a0225fc0aa57ac98d5be4b.tar.bz2
misskey-ec21336d45e6e3bb26a0225fc0aa57ac98d5be4b.zip
Merge pull request #16335 from misskey-dev/develop
Release: 2025.8.0
Diffstat (limited to 'packages/backend/src/models')
-rw-r--r--packages/backend/src/models/Meta.ts22
-rw-r--r--packages/backend/src/models/Note.ts11
-rw-r--r--packages/backend/src/models/Page.ts2
-rw-r--r--packages/backend/src/models/json-schema/meta.ts4
-rw-r--r--packages/backend/src/models/json-schema/note-reaction.ts31
-rw-r--r--packages/backend/src/models/json-schema/role.ts4
-rw-r--r--packages/backend/src/models/json-schema/user-webhook.ts55
-rw-r--r--packages/backend/src/models/json-schema/user.ts8
8 files changed, 128 insertions, 9 deletions
diff --git a/packages/backend/src/models/Meta.ts b/packages/backend/src/models/Meta.ts
index 85c10ab666..f8021a7a84 100644
--- a/packages/backend/src/models/Meta.ts
+++ b/packages/backend/src/models/Meta.ts
@@ -654,7 +654,7 @@ export class MiMeta {
@Column('varchar', {
length: 128,
- default: 'all',
+ default: 'none',
})
public federation: 'all' | 'specified' | 'none';
@@ -701,6 +701,26 @@ export class MiMeta {
default: true,
})
public allowExternalApRedirect: boolean;
+
+ @Column('boolean', {
+ default: false,
+ })
+ public enableRemoteNotesCleaning: boolean;
+
+ @Column('integer', {
+ default: 60, // minutes
+ })
+ public remoteNotesCleaningMaxProcessingDurationInMinutes: number;
+
+ @Column('integer', {
+ default: 90, // days
+ })
+ public remoteNotesCleaningExpiryDaysForEachNotes: number;
+
+ @Column('jsonb', {
+ default: { },
+ })
+ public clientOptions: Record<string, any>;
}
export type SoftwareSuspension = {
diff --git a/packages/backend/src/models/Note.ts b/packages/backend/src/models/Note.ts
index 9822ec94e4..26d5c1d535 100644
--- a/packages/backend/src/models/Note.ts
+++ b/packages/backend/src/models/Note.ts
@@ -36,7 +36,7 @@ export class MiNote {
public replyId: MiNote['id'] | null;
@ManyToOne(type => MiNote, {
- onDelete: 'CASCADE',
+ createForeignKeyConstraints: false,
})
@JoinColumn()
public reply: MiNote | null;
@@ -50,7 +50,7 @@ export class MiNote {
public renoteId: MiNote['id'] | null;
@ManyToOne(type => MiNote, {
- onDelete: 'CASCADE',
+ createForeignKeyConstraints: false,
})
@JoinColumn()
public renote: MiNote | null;
@@ -114,6 +114,13 @@ export class MiNote {
})
public clippedCount: number;
+ // The number of note page blocks referencing this note.
+ // This column is used by Remote Note Cleaning and manually updated rather than automatically with triggers.
+ @Column('smallint', {
+ default: 0,
+ })
+ public pageCount: number;
+
@Column('jsonb', {
default: {},
})
diff --git a/packages/backend/src/models/Page.ts b/packages/backend/src/models/Page.ts
index 0b59e7a92c..d112a66c04 100644
--- a/packages/backend/src/models/Page.ts
+++ b/packages/backend/src/models/Page.ts
@@ -69,7 +69,7 @@ export class MiPage {
public eyeCatchingImageId: MiDriveFile['id'] | null;
@ManyToOne(type => MiDriveFile, {
- onDelete: 'CASCADE',
+ onDelete: 'SET NULL',
})
@JoinColumn()
public eyeCatchingImage: MiDriveFile | null;
diff --git a/packages/backend/src/models/json-schema/meta.ts b/packages/backend/src/models/json-schema/meta.ts
index 2cd7620af0..357ff26041 100644
--- a/packages/backend/src/models/json-schema/meta.ts
+++ b/packages/backend/src/models/json-schema/meta.ts
@@ -71,6 +71,10 @@ export const packedMetaLiteSchema = {
type: 'string',
optional: false, nullable: true,
},
+ clientOptions: {
+ type: 'object',
+ optional: false, nullable: false,
+ },
disableRegistration: {
type: 'boolean',
optional: false, nullable: false,
diff --git a/packages/backend/src/models/json-schema/note-reaction.ts b/packages/backend/src/models/json-schema/note-reaction.ts
index 95658ace1f..04c9f34232 100644
--- a/packages/backend/src/models/json-schema/note-reaction.ts
+++ b/packages/backend/src/models/json-schema/note-reaction.ts
@@ -10,7 +10,6 @@ export const packedNoteReactionSchema = {
type: 'string',
optional: false, nullable: false,
format: 'id',
- example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string',
@@ -28,3 +27,33 @@ export const packedNoteReactionSchema = {
},
},
} as const;
+
+export const packedNoteReactionWithNoteSchema = {
+ type: 'object',
+ properties: {
+ id: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ createdAt: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'date-time',
+ },
+ user: {
+ type: 'object',
+ optional: false, nullable: false,
+ ref: 'UserLite',
+ },
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ note: {
+ type: 'object',
+ optional: false, nullable: false,
+ ref: 'Note',
+ },
+ },
+} as const;
diff --git a/packages/backend/src/models/json-schema/role.ts b/packages/backend/src/models/json-schema/role.ts
index c9cdbd5d89..0b9234cb81 100644
--- a/packages/backend/src/models/json-schema/role.ts
+++ b/packages/backend/src/models/json-schema/role.ts
@@ -212,6 +212,10 @@ export const packedRolePoliciesSchema = {
type: 'boolean',
optional: false, nullable: false,
},
+ canSearchUsers: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
canUseTranslator: {
type: 'boolean',
optional: false, nullable: false,
diff --git a/packages/backend/src/models/json-schema/user-webhook.ts b/packages/backend/src/models/json-schema/user-webhook.ts
new file mode 100644
index 0000000000..8ea0991716
--- /dev/null
+++ b/packages/backend/src/models/json-schema/user-webhook.ts
@@ -0,0 +1,55 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and misskey-project
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+import { webhookEventTypes } from '@/models/Webhook.js';
+
+export const packedUserWebhookSchema = {
+ type: 'object',
+ properties: {
+ id: {
+ type: 'string',
+ format: 'id',
+ optional: false, nullable: false,
+ },
+ userId: {
+ type: 'string',
+ format: 'id',
+ optional: false, nullable: false,
+ },
+ name: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ on: {
+ type: 'array',
+ items: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: webhookEventTypes,
+ },
+ },
+ url: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ secret: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ active: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ latestSentAt: {
+ type: 'string',
+ format: 'date-time',
+ optional: false, nullable: true,
+ },
+ latestStatus: {
+ type: 'integer',
+ optional: false, nullable: true,
+ },
+ },
+} as const;
diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts
index 2b5f706ff9..c507d8d5c6 100644
--- a/packages/backend/src/models/json-schema/user.ts
+++ b/packages/backend/src/models/json-schema/user.ts
@@ -65,7 +65,7 @@ export const packedUserLiteSchema = {
avatarUrl: {
type: 'string',
format: 'url',
- nullable: true, optional: false,
+ nullable: false, optional: false,
},
avatarBlurhash: {
type: 'string',
@@ -465,11 +465,11 @@ export const packedMeDetailedOnlySchema = {
},
isModerator: {
type: 'boolean',
- nullable: true, optional: false,
+ nullable: false, optional: false,
},
isAdmin: {
type: 'boolean',
- nullable: true, optional: false,
+ nullable: false, optional: false,
},
injectFeaturedNote: {
type: 'boolean',
@@ -591,7 +591,7 @@ export const packedMeDetailedOnlySchema = {
},
mutedInstances: {
type: 'array',
- nullable: true, optional: false,
+ nullable: false, optional: false,
items: {
type: 'string',
nullable: false, optional: false,