summaryrefslogtreecommitdiff
path: root/packages/backend/src/models
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-02-16 21:42:35 +0000
committerHazelnoot <acomputerdog@gmail.com>2025-02-16 21:42:35 +0000
commit2d7918a9b74a1c049c2e520b0331ba6f161c1a16 (patch)
treec2e30ecca540b187eee0659afa249bad51b45fe3 /packages/backend/src/models
parentmerge: fill `myReaction` in more cases - may fix #944 (!907) (diff)
parentMerge branch 'develop' into merge/2024-02-03 (diff)
downloadsharkey-2d7918a9b74a1c049c2e520b0331ba6f161c1a16.tar.gz
sharkey-2d7918a9b74a1c049c2e520b0331ba6f161c1a16.tar.bz2
sharkey-2d7918a9b74a1c049c2e520b0331ba6f161c1a16.zip
merge: Merge upstream 2025.2.0 (!886)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/886 Approved-by: Marie <github@yuugi.dev> Approved-by: Amber Null <puppygirlhornyposting@gmail.com>
Diffstat (limited to 'packages/backend/src/models')
-rw-r--r--packages/backend/src/models/Page.ts2
-rw-r--r--packages/backend/src/models/json-schema/emoji.ts83
-rw-r--r--packages/backend/src/models/json-schema/meta.ts5
3 files changed, 90 insertions, 0 deletions
diff --git a/packages/backend/src/models/Page.ts b/packages/backend/src/models/Page.ts
index 1695bf570e..0b59e7a92c 100644
--- a/packages/backend/src/models/Page.ts
+++ b/packages/backend/src/models/Page.ts
@@ -118,3 +118,5 @@ export class MiPage {
}
}
}
+
+export const pageNameSchema = { type: 'string', pattern: /^[^\s:\/?#\[\]@!$&'()*+,;=\\%\x00-\x20]{1,256}$/.source } as const;
diff --git a/packages/backend/src/models/json-schema/emoji.ts b/packages/backend/src/models/json-schema/emoji.ts
index 62686ad5ae..3cd263fa37 100644
--- a/packages/backend/src/models/json-schema/emoji.ts
+++ b/packages/backend/src/models/json-schema/emoji.ts
@@ -104,3 +104,86 @@ export const packedEmojiDetailedSchema = {
},
},
} as const;
+
+export const packedEmojiDetailedAdminSchema = {
+ type: 'object',
+ properties: {
+ id: {
+ type: 'string',
+ format: 'id',
+ optional: false, nullable: false,
+ },
+ updatedAt: {
+ type: 'string',
+ format: 'date-time',
+ optional: false, nullable: true,
+ },
+ name: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ host: {
+ type: 'string',
+ optional: false, nullable: true,
+ description: 'The local host is represented with `null`.',
+ },
+ publicUrl: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ originalUrl: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ uri: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ type: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ aliases: {
+ type: 'array',
+ optional: false, nullable: false,
+ items: {
+ type: 'string',
+ format: 'id',
+ optional: false, nullable: false,
+ },
+ },
+ category: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ license: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ localOnly: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ isSensitive: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ roleIdsThatCanBeUsedThisEmojiAsReaction: {
+ type: 'array',
+ items: {
+ type: 'object',
+ properties: {
+ id: {
+ type: 'string',
+ format: 'misskey:id',
+ optional: false, nullable: false,
+ },
+ name: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ },
+ },
+ },
+ },
+} as const;
diff --git a/packages/backend/src/models/json-schema/meta.ts b/packages/backend/src/models/json-schema/meta.ts
index 29fdb4f6be..bf68208c37 100644
--- a/packages/backend/src/models/json-schema/meta.ts
+++ b/packages/backend/src/models/json-schema/meta.ts
@@ -321,6 +321,11 @@ export const packedMetaLiteSchema = {
type: 'number',
optional: false, nullable: false,
},
+ federation: {
+ type: 'string',
+ enum: ['all', 'specified', 'none'],
+ optional: false, nullable: false,
+ },
},
} as const;