summaryrefslogtreecommitdiff
path: root/packages/backend/src/models
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2024-03-01 21:17:01 +0900
committerGitHub <noreply@github.com>2024-03-01 21:17:01 +0900
commit7e706ea6693781fb8973800bb3d0c91b5ab91cdf (patch)
tree8abd91edd288284cf3cc47949e749f881cfaff8e /packages/backend/src/models
parentMerge pull request #13045 from misskey-dev/develop (diff)
parentNew translations ja-jp.yml (Chinese Traditional) (#13480) (diff)
downloadsharkey-7e706ea6693781fb8973800bb3d0c91b5ab91cdf.tar.gz
sharkey-7e706ea6693781fb8973800bb3d0c91b5ab91cdf.tar.bz2
sharkey-7e706ea6693781fb8973800bb3d0c91b5ab91cdf.zip
Merge pull request #13447 from misskey-dev/develop
Release: 2024.3.0
Diffstat (limited to 'packages/backend/src/models')
-rw-r--r--packages/backend/src/models/Instance.ts5
-rw-r--r--packages/backend/src/models/Meta.ts2
-rw-r--r--packages/backend/src/models/Role.ts6
-rw-r--r--packages/backend/src/models/UserProfile.ts2
-rw-r--r--packages/backend/src/models/json-schema/federation-instance.ts4
-rw-r--r--packages/backend/src/models/json-schema/meta.ts328
-rw-r--r--packages/backend/src/models/json-schema/role.ts27
-rw-r--r--packages/backend/src/models/json-schema/user.ts5
8 files changed, 378 insertions, 1 deletions
diff --git a/packages/backend/src/models/Instance.ts b/packages/backend/src/models/Instance.ts
index 0632ef525b..9863c9d75d 100644
--- a/packages/backend/src/models/Instance.ts
+++ b/packages/backend/src/models/Instance.ts
@@ -144,4 +144,9 @@ export class MiInstance {
nullable: true,
})
public infoUpdatedAt: Date | null;
+
+ @Column('varchar', {
+ length: 16384, default: '',
+ })
+ public moderationNote: string;
}
diff --git a/packages/backend/src/models/Meta.ts b/packages/backend/src/models/Meta.ts
index 6ed0ec6ce5..66f19ce197 100644
--- a/packages/backend/src/models/Meta.ts
+++ b/packages/backend/src/models/Meta.ts
@@ -253,6 +253,8 @@ export class MiMeta {
})
public turnstileSecretKey: string | null;
+ // chaptcha系を追加した際にはnodeinfoのレスポンスに追加するのを忘れないようにすること
+
@Column('enum', {
enum: ['none', 'all', 'local', 'remote'],
default: 'none',
diff --git a/packages/backend/src/models/Role.ts b/packages/backend/src/models/Role.ts
index fa05ea8637..058abe3118 100644
--- a/packages/backend/src/models/Role.ts
+++ b/packages/backend/src/models/Role.ts
@@ -29,6 +29,11 @@ type CondFormulaValueIsRemote = {
type: 'isRemote';
};
+type CondFormulaValueRoleAssignedTo = {
+ type: 'roleAssignedTo';
+ roleId: string;
+};
+
type CondFormulaValueCreatedLessThan = {
type: 'createdLessThan';
sec: number;
@@ -75,6 +80,7 @@ export type RoleCondFormulaValue = { id: string } & (
CondFormulaValueNot |
CondFormulaValueIsLocal |
CondFormulaValueIsRemote |
+ CondFormulaValueRoleAssignedTo |
CondFormulaValueCreatedLessThan |
CondFormulaValueCreatedMoreThan |
CondFormulaValueFollowersLessThanOrEq |
diff --git a/packages/backend/src/models/UserProfile.ts b/packages/backend/src/models/UserProfile.ts
index 1ca2f55850..7dbe0b3717 100644
--- a/packages/backend/src/models/UserProfile.ts
+++ b/packages/backend/src/models/UserProfile.ts
@@ -250,6 +250,8 @@ export class MiUserProfile {
} | {
type: 'mutualFollow';
} | {
+ type: 'followingOrFollower';
+ } | {
type: 'list';
userListId: MiUserList['id'];
};
diff --git a/packages/backend/src/models/json-schema/federation-instance.ts b/packages/backend/src/models/json-schema/federation-instance.ts
index 087a0e6967..42d98fe523 100644
--- a/packages/backend/src/models/json-schema/federation-instance.ts
+++ b/packages/backend/src/models/json-schema/federation-instance.ts
@@ -107,5 +107,9 @@ export const packedFederationInstanceSchema = {
optional: false, nullable: true,
format: 'date-time',
},
+ moderationNote: {
+ type: 'string',
+ optional: true, nullable: true,
+ },
},
} as const;
diff --git a/packages/backend/src/models/json-schema/meta.ts b/packages/backend/src/models/json-schema/meta.ts
new file mode 100644
index 0000000000..17789f3b46
--- /dev/null
+++ b/packages/backend/src/models/json-schema/meta.ts
@@ -0,0 +1,328 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and misskey-project
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+export const packedMetaLiteSchema = {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ maintainerName: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ maintainerEmail: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ version: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ providesTarball: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ name: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ shortName: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ uri: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'url',
+ example: 'https://misskey.example.com',
+ },
+ description: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ langs: {
+ type: 'array',
+ optional: false, nullable: false,
+ items: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ },
+ tosUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ repositoryUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ default: 'https://github.com/misskey-dev/misskey',
+ },
+ feedbackUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ default: 'https://github.com/misskey-dev/misskey/issues/new',
+ },
+ defaultDarkTheme: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ defaultLightTheme: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ disableRegistration: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ emailRequiredForSignup: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ enableHcaptcha: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ hcaptchaSiteKey: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ enableMcaptcha: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ mcaptchaSiteKey: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ mcaptchaInstanceUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ enableRecaptcha: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ recaptchaSiteKey: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ enableTurnstile: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ turnstileSiteKey: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ swPublickey: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ mascotImageUrl: {
+ type: 'string',
+ optional: false, nullable: false,
+ default: '/assets/ai.png',
+ },
+ bannerUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ serverErrorImageUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ infoImageUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ notFoundImageUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ iconUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ maxNoteTextLength: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ ads: {
+ type: 'array',
+ optional: false, nullable: false,
+ items: {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ id: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ example: 'xxxxxxxxxx',
+ },
+ url: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'url',
+ },
+ place: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ ratio: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ imageUrl: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'url',
+ },
+ dayOfWeek: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ },
+ },
+ },
+ notesPerOneAd: {
+ type: 'number',
+ optional: false, nullable: false,
+ default: 0,
+ },
+ enableEmail: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ enableServiceWorker: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ translatorAvailable: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ mediaProxy: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ backgroundImageUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ impressumUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ logoImageUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ privacyPolicyUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ serverRules: {
+ type: 'array',
+ optional: false, nullable: false,
+ items: {
+ type: 'string',
+ },
+ },
+ themeColor: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ policies: {
+ type: 'object',
+ optional: false, nullable: false,
+ ref: 'RolePolicies',
+ },
+ },
+} as const;
+
+export const packedMetaDetailedOnlySchema = {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ features: {
+ type: 'object',
+ optional: true, nullable: false,
+ properties: {
+ registration: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ emailRequiredForSignup: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ localTimeline: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ globalTimeline: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ hcaptcha: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ turnstile: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ recaptcha: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ objectStorage: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ serviceWorker: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ miauth: {
+ type: 'boolean',
+ optional: true, nullable: false,
+ default: true,
+ },
+ },
+ },
+ proxyAccountName: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ requireSetup: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ example: false,
+ },
+ cacheRemoteFiles: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ cacheRemoteSensitiveFiles: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ },
+} as const;
+
+export const packedMetaDetailedSchema = {
+ type: 'object',
+ allOf: [
+ {
+ type: 'object',
+ ref: 'MetaLite',
+ },
+ {
+ type: 'object',
+ ref: 'MetaDetailedOnly',
+ },
+ ],
+} as const;
diff --git a/packages/backend/src/models/json-schema/role.ts b/packages/backend/src/models/json-schema/role.ts
index ef6b279bee..c770250503 100644
--- a/packages/backend/src/models/json-schema/role.ts
+++ b/packages/backend/src/models/json-schema/role.ts
@@ -57,6 +57,26 @@ export const packedRoleCondFormulaValueIsLocalOrRemoteSchema = {
},
} as const;
+export const packedRoleCondFormulaValueAssignedRoleSchema = {
+ type: 'object',
+ properties: {
+ id: {
+ type: 'string', optional: false,
+ },
+ type: {
+ type: 'string',
+ nullable: false, optional: false,
+ enum: ['roleAssignedTo'],
+ },
+ roleId: {
+ type: 'string',
+ nullable: false, optional: false,
+ format: 'id',
+ example: 'xxxxxxxxxx',
+ },
+ },
+} as const;
+
export const packedRoleCondFormulaValueCreatedSchema = {
type: 'object',
properties: {
@@ -116,6 +136,9 @@ export const packedRoleCondFormulaValueSchema = {
ref: 'RoleCondFormulaValueIsLocalOrRemote',
},
{
+ ref: 'RoleCondFormulaValueAssignedRole',
+ },
+ {
ref: 'RoleCondFormulaValueCreated',
},
{
@@ -140,6 +163,10 @@ export const packedRolePoliciesSchema = {
type: 'boolean',
optional: false, nullable: false,
},
+ mentionLimit: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
canInvite: {
type: 'boolean',
optional: false, nullable: false,
diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts
index c7f86635da..947a9317d7 100644
--- a/packages/backend/src/models/json-schema/user.ts
+++ b/packages/backend/src/models/json-schema/user.ts
@@ -13,7 +13,7 @@ export const notificationRecieveConfig = {
type: {
type: 'string',
nullable: false,
- enum: ['all', 'following', 'follower', 'mutualFollow', 'never'],
+ enum: ['all', 'following', 'follower', 'mutualFollow', 'followingOrFollower', 'never'],
},
},
required: ['type'],
@@ -148,6 +148,9 @@ export const packedUserLiteSchema = {
emojis: {
type: 'object',
nullable: false, optional: false,
+ additionalProperties: {
+ type: 'string',
+ },
},
onlineStatus: {
type: 'string',