;
+type PropertiesToUnion = p['properties'] extends NonNullable ? keyof p['properties'] : never;
+
type TypeStringef = 'null' | 'boolean' | 'integer' | 'number' | 'string' | 'array' | 'object' | 'any';
type StringDefToType =
T extends 'null' ? null :
diff --git a/packages/backend/src/models/Announcement.ts b/packages/backend/src/models/Announcement.ts
index ddca1e4b69..7094ac385e 100644
--- a/packages/backend/src/models/Announcement.ts
+++ b/packages/backend/src/models/Announcement.ts
@@ -38,7 +38,7 @@ export class MiAnnouncement {
length: 256, nullable: false,
default: 'info',
})
- public icon: string;
+ public icon: 'info' | 'warning' | 'error' | 'success';
// normal ... お知らせページ掲載
// banner ... お知らせページ掲載 + バナー表示
@@ -47,7 +47,7 @@ export class MiAnnouncement {
length: 256, nullable: false,
default: 'normal',
})
- public display: string;
+ public display: 'normal' | 'banner' | 'dialog';
@Column('boolean', {
default: false,
diff --git a/packages/backend/src/models/json-schema/announcement.ts b/packages/backend/src/models/json-schema/announcement.ts
index ca3fba9772..abb040a75d 100644
--- a/packages/backend/src/models/json-schema/announcement.ts
+++ b/packages/backend/src/models/json-schema/announcement.ts
@@ -37,10 +37,12 @@ export const packedAnnouncementSchema = {
icon: {
type: 'string',
optional: false, nullable: false,
+ enum: ['info', 'warning', 'error', 'success'],
},
display: {
type: 'string',
optional: false, nullable: false,
+ enum: ['dialog', 'normal', 'banner'],
},
needConfirmationToRead: {
type: 'boolean',
diff --git a/packages/backend/src/models/json-schema/blocking.ts b/packages/backend/src/models/json-schema/blocking.ts
index d5dd0a9683..5367b8db75 100644
--- a/packages/backend/src/models/json-schema/blocking.ts
+++ b/packages/backend/src/models/json-schema/blocking.ts
@@ -25,7 +25,7 @@ export const packedBlockingSchema = {
blockee: {
type: 'object',
optional: false, nullable: false,
- ref: 'UserDetailed',
+ ref: 'UserDetailedNotMe',
},
},
} as const;
diff --git a/packages/backend/src/models/json-schema/following.ts b/packages/backend/src/models/json-schema/following.ts
index 7a5b0e5460..1e569885f7 100644
--- a/packages/backend/src/models/json-schema/following.ts
+++ b/packages/backend/src/models/json-schema/following.ts
@@ -30,12 +30,12 @@ export const packedFollowingSchema = {
followee: {
type: 'object',
optional: true, nullable: false,
- ref: 'UserDetailed',
+ ref: 'UserDetailedNotMe',
},
follower: {
type: 'object',
optional: true, nullable: false,
- ref: 'UserDetailed',
+ ref: 'UserDetailedNotMe',
},
},
} as const;
diff --git a/packages/backend/src/models/json-schema/muting.ts b/packages/backend/src/models/json-schema/muting.ts
index 886aabbff5..d38b6e2754 100644
--- a/packages/backend/src/models/json-schema/muting.ts
+++ b/packages/backend/src/models/json-schema/muting.ts
@@ -30,7 +30,7 @@ export const packedMutingSchema = {
mutee: {
type: 'object',
optional: false, nullable: false,
- ref: 'UserDetailed',
+ ref: 'UserDetailedNotMe',
},
},
} as const;
diff --git a/packages/backend/src/models/json-schema/note.ts b/packages/backend/src/models/json-schema/note.ts
index 665c1bb578..72d79e1e1a 100644
--- a/packages/backend/src/models/json-schema/note.ts
+++ b/packages/backend/src/models/json-schema/note.ts
@@ -91,6 +91,7 @@ export const packedNoteSchema = {
visibility: {
type: 'string',
optional: false, nullable: false,
+ enum: ['public', 'home', 'followers', 'specified'],
},
mentions: {
type: 'array',
@@ -139,6 +140,48 @@ export const packedNoteSchema = {
poll: {
type: 'object',
optional: true, nullable: true,
+ properties: {
+ expiresAt: {
+ type: 'string',
+ optional: true, nullable: true,
+ format: 'date-time',
+ },
+ multiple: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ choices: {
+ type: 'array',
+ optional: false, nullable: false,
+ items: {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ isVoted: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ text: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ votes: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ },
+ },
+ },
+ },
+ },
+ emojis: {
+ type: 'object',
+ optional: true, nullable: false,
+ additionalProperties: {
+ anyOf: [{
+ type: 'string',
+ }],
+ },
},
event: {
type: 'object',
@@ -188,9 +231,23 @@ export const packedNoteSchema = {
type: 'string',
optional: false, nullable: true,
},
+ reactionEmojis: {
+ type: 'object',
+ optional: false, nullable: false,
+ additionalProperties: {
+ anyOf: [{
+ type: 'string',
+ }],
+ },
+ },
reactions: {
type: 'object',
optional: false, nullable: false,
+ additionalProperties: {
+ anyOf: [{
+ type: 'number',
+ }],
+ },
},
renoteCount: {
type: 'number',
@@ -222,7 +279,7 @@ export const packedNoteSchema = {
},
myReaction: {
- type: 'object',
+ type: 'string',
optional: true, nullable: true,
},
},
diff --git a/packages/backend/src/models/json-schema/notification.ts b/packages/backend/src/models/json-schema/notification.ts
index b8faea4903..e20ac9de6c 100644
--- a/packages/backend/src/models/json-schema/notification.ts
+++ b/packages/backend/src/models/json-schema/notification.ts
@@ -5,7 +5,7 @@
import { notificationTypes } from '@/types.js';
-export const packedNotificationSchema = {
+const baseSchema = {
type: 'object',
properties: {
id: {
@@ -23,68 +23,368 @@ export const packedNotificationSchema = {
optional: false, nullable: false,
enum: [...notificationTypes, 'reaction:grouped', 'renote:grouped'],
},
- user: {
- type: 'object',
- ref: 'UserLite',
- optional: true, nullable: true,
- },
- userId: {
- type: 'string',
- optional: true, nullable: true,
- format: 'id',
- },
- note: {
- type: 'object',
- ref: 'Note',
- optional: true, nullable: true,
- },
- reaction: {
- type: 'string',
- optional: true, nullable: true,
- },
- achievement: {
- type: 'string',
- optional: true, nullable: false,
- },
- body: {
- type: 'string',
- optional: true, nullable: true,
- },
- header: {
- type: 'string',
- optional: true, nullable: true,
- },
- icon: {
- type: 'string',
- optional: true, nullable: true,
- },
- reactions: {
- type: 'array',
- optional: true, nullable: true,
- items: {
- type: 'object',
- properties: {
- user: {
- type: 'object',
- ref: 'UserLite',
- optional: false, nullable: false,
- },
- reaction: {
- type: 'string',
- optional: false, nullable: false,
- },
- },
- required: ['user', 'reaction'],
+ },
+} as const;
+
+export const packedNotificationSchema = {
+ type: 'object',
+ oneOf: [{
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['note'],
},
- },
- users: {
- type: 'array',
- optional: true, nullable: true,
- items: {
+ user: {
type: 'object',
ref: 'UserLite',
optional: false, nullable: false,
},
+ userId: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ note: {
+ type: 'object',
+ ref: 'Note',
+ optional: false, nullable: false,
+ },
},
- },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['mention'],
+ },
+ user: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ userId: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ note: {
+ type: 'object',
+ ref: 'Note',
+ optional: false, nullable: false,
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['reply'],
+ },
+ user: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ userId: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ note: {
+ type: 'object',
+ ref: 'Note',
+ optional: false, nullable: false,
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['renote'],
+ },
+ user: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ userId: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ note: {
+ type: 'object',
+ ref: 'Note',
+ optional: false, nullable: false,
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['quote'],
+ },
+ user: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ userId: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ note: {
+ type: 'object',
+ ref: 'Note',
+ optional: false, nullable: false,
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['reaction'],
+ },
+ user: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ userId: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ note: {
+ type: 'object',
+ ref: 'Note',
+ optional: false, nullable: false,
+ },
+ reaction: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['pollEnded'],
+ },
+ user: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ userId: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ note: {
+ type: 'object',
+ ref: 'Note',
+ optional: false, nullable: false,
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['follow'],
+ },
+ user: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ userId: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['receiveFollowRequest'],
+ },
+ user: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ userId: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['followRequestAccepted'],
+ },
+ user: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ userId: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['roleAssigned'],
+ },
+ role: {
+ type: 'object',
+ ref: 'Role',
+ optional: false, nullable: false,
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['achievementEarned'],
+ },
+ achievement: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['app'],
+ },
+ body: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ header: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ icon: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['reaction:grouped'],
+ },
+ note: {
+ type: 'object',
+ ref: 'Note',
+ optional: false, nullable: false,
+ },
+ reactions: {
+ type: 'array',
+ optional: false, nullable: false,
+ items: {
+ type: 'object',
+ properties: {
+ user: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ reaction: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ },
+ required: ['user', 'reaction'],
+ },
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['renote:grouped'],
+ },
+ note: {
+ type: 'object',
+ ref: 'Note',
+ optional: false, nullable: false,
+ },
+ users: {
+ type: 'array',
+ optional: false, nullable: false,
+ items: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ },
+ },
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['test'],
+ },
+ },
+ }],
} as const;
diff --git a/packages/backend/src/models/json-schema/page.ts b/packages/backend/src/models/json-schema/page.ts
index 525af42928..b6fc3fc108 100644
--- a/packages/backend/src/models/json-schema/page.ts
+++ b/packages/backend/src/models/json-schema/page.ts
@@ -3,6 +3,107 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
+const blockBaseSchema = {
+ type: 'object',
+ properties: {
+ id: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ },
+} as const;
+
+const textBlockSchema = {
+ type: 'object',
+ properties: {
+ ...blockBaseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['text'],
+ },
+ text: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ },
+} as const;
+
+const sectionBlockSchema = {
+ type: 'object',
+ properties: {
+ ...blockBaseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['section'],
+ },
+ title: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ children: {
+ type: 'array',
+ optional: false, nullable: false,
+ items: {
+ type: 'object',
+ optional: false, nullable: false,
+ ref: 'PageBlock',
+ },
+ },
+ },
+} as const;
+
+const imageBlockSchema = {
+ type: 'object',
+ properties: {
+ ...blockBaseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['image'],
+ },
+ fileId: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ },
+} as const;
+
+const noteBlockSchema = {
+ type: 'object',
+ properties: {
+ ...blockBaseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['note'],
+ },
+ detailed: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ note: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ },
+} as const;
+
+export const packedPageBlockSchema = {
+ type: 'object',
+ oneOf: [
+ textBlockSchema,
+ sectionBlockSchema,
+ imageBlockSchema,
+ noteBlockSchema,
+ ],
+} as const;
+
export const packedPageSchema = {
type: 'object',
properties: {
@@ -38,6 +139,7 @@ export const packedPageSchema = {
items: {
type: 'object',
optional: false, nullable: false,
+ ref: 'PageBlock',
},
},
variables: {
diff --git a/packages/backend/src/models/json-schema/renote-muting.ts b/packages/backend/src/models/json-schema/renote-muting.ts
index e54ccfda15..058f49d8b8 100644
--- a/packages/backend/src/models/json-schema/renote-muting.ts
+++ b/packages/backend/src/models/json-schema/renote-muting.ts
@@ -25,7 +25,7 @@ export const packedRenoteMutingSchema = {
mutee: {
type: 'object',
optional: false, nullable: false,
- ref: 'UserDetailed',
+ ref: 'UserDetailedNotMe',
},
},
} as const;
diff --git a/packages/backend/src/models/json-schema/role.ts b/packages/backend/src/models/json-schema/role.ts
index b0c6804bb8..55348d4f3d 100644
--- a/packages/backend/src/models/json-schema/role.ts
+++ b/packages/backend/src/models/json-schema/role.ts
@@ -1,26 +1,103 @@
-const rolePolicyValue = {
+export const packedRolePoliciesSchema = {
type: 'object',
+ optional: false, nullable: false,
properties: {
- value: {
- oneOf: [
- {
- type: 'integer',
- optional: false, nullable: false,
- },
- {
- type: 'boolean',
- optional: false, nullable: false,
- },
- ],
+ gtlAvailable: {
+ type: 'boolean',
+ optional: false, nullable: false,
},
- priority: {
+ ltlAvailable: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ canPublicNote: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ canInvite: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ inviteLimit: {
type: 'integer',
optional: false, nullable: false,
},
- useDefault: {
+ inviteLimitCycle: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ inviteExpirationTime: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ canManageCustomEmojis: {
type: 'boolean',
optional: false, nullable: false,
},
+ canManageAvatarDecorations: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ canSearchNotes: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ canUseTranslator: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ canHideAds: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ driveCapacityMb: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ alwaysMarkNsfw: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ pinLimit: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ antennaLimit: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ wordMuteLimit: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ webhookLimit: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ clipLimit: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ noteEachClipsLimit: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ userListLimit: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ userEachUserListsLimit: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ rateLimitFactor: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ avatarDecorationLimit: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
},
} as const;
@@ -121,31 +198,28 @@ export const packedRoleSchema = {
policies: {
type: 'object',
optional: false, nullable: false,
- properties: {
- pinLimit: rolePolicyValue,
- canInvite: rolePolicyValue,
- clipLimit: rolePolicyValue,
- canHideAds: rolePolicyValue,
- inviteLimit: rolePolicyValue,
- antennaLimit: rolePolicyValue,
- gtlAvailable: rolePolicyValue,
- ltlAvailable: rolePolicyValue,
- webhookLimit: rolePolicyValue,
- canPublicNote: rolePolicyValue,
- userListLimit: rolePolicyValue,
- wordMuteLimit: rolePolicyValue,
- alwaysMarkNsfw: rolePolicyValue,
- canSearchNotes: rolePolicyValue,
- driveCapacityMb: rolePolicyValue,
- rateLimitFactor: rolePolicyValue,
- inviteLimitCycle: rolePolicyValue,
- noteEachClipsLimit: rolePolicyValue,
- inviteExpirationTime: rolePolicyValue,
- canManageCustomEmojis: rolePolicyValue,
- userEachUserListsLimit: rolePolicyValue,
- canManageAvatarDecorations: rolePolicyValue,
- canUseTranslator: rolePolicyValue,
- avatarDecorationLimit: rolePolicyValue,
+ additionalProperties: {
+ anyOf: [{
+ type: 'object',
+ properties: {
+ value: {
+ oneOf: [
+ {
+ type: 'integer',
+ },
+ {
+ type: 'boolean',
+ },
+ ],
+ },
+ priority: {
+ type: 'integer',
+ },
+ useDefault: {
+ type: 'boolean',
+ },
+ },
+ }],
},
},
usersCount: {
diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts
index b712d3448e..6cd3b7504c 100644
--- a/packages/backend/src/models/json-schema/user.ts
+++ b/packages/backend/src/models/json-schema/user.ts
@@ -603,104 +603,7 @@ export const packedMeDetailedOnlySchema = {
policies: {
type: 'object',
nullable: false, optional: false,
- properties: {
- gtlAvailable: {
- type: 'boolean',
- nullable: false, optional: false,
- },
- ltlAvailable: {
- type: 'boolean',
- nullable: false, optional: false,
- },
- canPublicNote: {
- type: 'boolean',
- nullable: false, optional: false,
- },
- canInvite: {
- type: 'boolean',
- nullable: false, optional: false,
- },
- inviteLimit: {
- type: 'number',
- nullable: false, optional: false,
- },
- inviteLimitCycle: {
- type: 'number',
- nullable: false, optional: false,
- },
- inviteExpirationTime: {
- type: 'number',
- nullable: false, optional: false,
- },
- canManageCustomEmojis: {
- type: 'boolean',
- nullable: false, optional: false,
- },
- canManageAvatarDecorations: {
- type: 'boolean',
- nullable: false, optional: false,
- },
- canSearchNotes: {
- type: 'boolean',
- nullable: false, optional: false,
- },
- canUseTranslator: {
- type: 'boolean',
- nullable: false, optional: false,
- },
- canHideAds: {
- type: 'boolean',
- nullable: false, optional: false,
- },
- driveCapacityMb: {
- type: 'number',
- nullable: false, optional: false,
- },
- alwaysMarkNsfw: {
- type: 'boolean',
- nullable: false, optional: false,
- },
- pinLimit: {
- type: 'number',
- nullable: false, optional: false,
- },
- antennaLimit: {
- type: 'number',
- nullable: false, optional: false,
- },
- wordMuteLimit: {
- type: 'number',
- nullable: false, optional: false,
- },
- webhookLimit: {
- type: 'number',
- nullable: false, optional: false,
- },
- clipLimit: {
- type: 'number',
- nullable: false, optional: false,
- },
- noteEachClipsLimit: {
- type: 'number',
- nullable: false, optional: false,
- },
- userListLimit: {
- type: 'number',
- nullable: false, optional: false,
- },
- userEachUserListsLimit: {
- type: 'number',
- nullable: false, optional: false,
- },
- rateLimitFactor: {
- type: 'number',
- nullable: false, optional: false,
- },
- avatarDecorationLimit: {
- type: 'number',
- nullable: false, optional: false,
- },
- },
+ ref: 'RolePolicies',
},
//#region secrets
email: {
@@ -795,13 +698,5 @@ export const packedUserSchema = {
type: 'object',
ref: 'UserDetailed',
},
- {
- type: 'object',
- ref: 'UserDetailedNotMe',
- },
- {
- type: 'object',
- ref: 'MeDetailed',
- },
],
} as const;
diff --git a/packages/backend/src/queue/QueueProcessorService.ts b/packages/backend/src/queue/QueueProcessorService.ts
index 49920a8403..59355a6518 100644
--- a/packages/backend/src/queue/QueueProcessorService.ts
+++ b/packages/backend/src/queue/QueueProcessorService.ts
@@ -290,9 +290,9 @@ export class QueueProcessorService implements OnApplicationShutdown {
}, {
...baseQueueOptions(this.config, QUEUE.RELATIONSHIP, this.redisForJobQueue),
autorun: false,
- concurrency: this.config.relashionshipJobConcurrency ?? 16,
+ concurrency: this.config.relationshipJobConcurrency ?? 16,
limiter: {
- max: this.config.relashionshipJobPerSec ?? 64,
+ max: this.config.relationshipJobPerSec ?? 64,
duration: 1000,
},
});
diff --git a/packages/backend/src/server/ServerService.ts b/packages/backend/src/server/ServerService.ts
index 278145b4ab..208a3f9855 100644
--- a/packages/backend/src/server/ServerService.ts
+++ b/packages/backend/src/server/ServerService.ts
@@ -204,7 +204,7 @@ export class ServerService implements OnApplicationShutdown {
});
this.globalEventService.publishMainStream(profile.userId, 'meUpdated', await this.userEntityService.pack(profile.userId, { id: profile.userId }, {
- detail: true,
+ schema: 'MeDetailed',
includeSecrets: true,
}));
diff --git a/packages/backend/src/server/api/ApiServerService.ts b/packages/backend/src/server/api/ApiServerService.ts
index 5b7a6f9838..22042e7233 100644
--- a/packages/backend/src/server/api/ApiServerService.ts
+++ b/packages/backend/src/server/api/ApiServerService.ts
@@ -157,7 +157,7 @@ export class ApiServerService {
return {
ok: true,
token: token.token,
- user: await this.userEntityService.pack(token.userId, null, { detail: true }),
+ user: await this.userEntityService.pack(token.userId, null, { schema: 'UserDetailedNotMe' }),
};
} else {
return {
diff --git a/packages/backend/src/server/api/SignupApiService.ts b/packages/backend/src/server/api/SignupApiService.ts
index 865890591b..5df0dc57ca 100644
--- a/packages/backend/src/server/api/SignupApiService.ts
+++ b/packages/backend/src/server/api/SignupApiService.ts
@@ -213,7 +213,7 @@ export class SignupApiService {
});
const res = await this.userEntityService.pack(account, account, {
- detail: true,
+ schema: 'MeDetailed',
includeSecrets: true,
});
diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts
index fa8b14a81a..f4f3588b0f 100644
--- a/packages/backend/src/server/api/endpoints.ts
+++ b/packages/backend/src/server/api/endpoints.ts
@@ -4,8 +4,7 @@
*/
import { permissions } from 'cherrypick-js';
-import type { Schema } from '@/misc/json-schema.js';
-import { RolePolicies } from '@/core/RoleService.js';
+import type { KeyOf, Schema } from '@/misc/json-schema.js';
import * as ep___admin_meta from './endpoints/admin/meta.js';
import * as ep___admin_abuseReportResolver_create from './endpoints/admin/abuse-report-resolver/create.js';
@@ -838,7 +837,7 @@ interface IEndpointMetaBase {
*/
readonly requireAdmin?: boolean;
- readonly requireRolePolicy?: keyof RolePolicies;
+ readonly requireRolePolicy?: KeyOf<'RolePolicies'>;
/**
* 引っ越し済みのユーザーによるリクエストを禁止するか
diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts b/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts
index f07972c331..cd91574cd2 100644
--- a/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts
+++ b/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts
@@ -62,17 +62,17 @@ export const meta = {
reporter: {
type: 'object',
nullable: false, optional: false,
- ref: 'User',
+ ref: 'UserDetailedNotMe',
},
targetUser: {
type: 'object',
nullable: false, optional: false,
- ref: 'User',
+ ref: 'UserDetailedNotMe',
},
assignee: {
type: 'object',
nullable: true, optional: true,
- ref: 'User',
+ ref: 'UserDetailedNotMe',
},
},
},
diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts
index 569baad0f3..7afb2f7d2f 100644
--- a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts
+++ b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts
@@ -11,6 +11,7 @@ import { SignupService } from '@/core/SignupService.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { localUsernameSchema, passwordSchema } from '@/models/User.js';
import { DI } from '@/di-symbols.js';
+import { Packed } from '@/misc/json-schema.js';
export const meta = {
tags: ['admin'],
@@ -18,7 +19,7 @@ export const meta = {
res: {
type: 'object',
optional: false, nullable: false,
- ref: 'User',
+ ref: 'MeDetailed',
properties: {
token: {
type: 'string',
@@ -60,11 +61,11 @@ export default class extends Endpoint { // eslint-
});
const res = await this.userEntityService.pack(account, account, {
- detail: true,
+ schema: 'MeDetailed',
includeSecrets: true,
- });
+ }) as Packed<'MeDetailed'> & { token: string };
- (res as any).token = secret;
+ res.token = secret;
return res;
});
diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/find-by-email.ts b/packages/backend/src/server/api/endpoints/admin/accounts/find-by-email.ts
index 70bf985709..02619e7558 100644
--- a/packages/backend/src/server/api/endpoints/admin/accounts/find-by-email.ts
+++ b/packages/backend/src/server/api/endpoints/admin/accounts/find-by-email.ts
@@ -27,7 +27,7 @@ export const meta = {
res: {
type: 'object',
optional: false, nullable: false,
- ref: 'User',
+ ref: 'UserDetailedNotMe',
},
} as const;
@@ -58,7 +58,7 @@ export default class extends Endpoint { // eslint-
}
const res = await this.userEntityService.pack(profile.user!, null, {
- detail: true,
+ schema: 'UserDetailedNotMe',
});
return res;
diff --git a/packages/backend/src/server/api/endpoints/admin/roles/users.ts b/packages/backend/src/server/api/endpoints/admin/roles/users.ts
index 7de98434ff..94066210e2 100644
--- a/packages/backend/src/server/api/endpoints/admin/roles/users.ts
+++ b/packages/backend/src/server/api/endpoints/admin/roles/users.ts
@@ -92,7 +92,7 @@ export default class extends Endpoint { // eslint-
return await Promise.all(assigns.map(async assign => ({
id: assign.id,
createdAt: this.idService.parse(assign.id).date.toISOString(),
- user: await this.userEntityService.pack(assign.user!, me, { detail: true }),
+ user: await this.userEntityService.pack(assign.user!, me, { schema: 'UserDetailed' }),
expiresAt: assign.expiresAt?.toISOString() ?? null,
})));
});
diff --git a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts
index d70ddd021a..8537764132 100644
--- a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts
+++ b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts
@@ -50,7 +50,7 @@ export const meta = {
user: {
type: 'object',
optional: false, nullable: false,
- ref: 'UserDetailed',
+ ref: 'UserDetailedNotMe',
},
},
},
diff --git a/packages/backend/src/server/api/endpoints/admin/show-users.ts b/packages/backend/src/server/api/endpoints/admin/show-users.ts
index ca705ca307..b92d6fa390 100644
--- a/packages/backend/src/server/api/endpoints/admin/show-users.ts
+++ b/packages/backend/src/server/api/endpoints/admin/show-users.ts
@@ -114,7 +114,7 @@ export default class extends Endpoint { // eslint-
const users = await query.getMany();
- return await this.userEntityService.packMany(users, me, { detail: true });
+ return await this.userEntityService.packMany(users, me, { schema: 'UserDetailed' });
});
}
}
diff --git a/packages/backend/src/server/api/endpoints/ap/show.ts b/packages/backend/src/server/api/endpoints/ap/show.ts
index 43737bcb26..42ff500e7a 100644
--- a/packages/backend/src/server/api/endpoints/ap/show.ts
+++ b/packages/backend/src/server/api/endpoints/ap/show.ts
@@ -148,7 +148,7 @@ export default class extends Endpoint { // eslint-
if (user != null) {
return {
type: 'User',
- object: await this.userEntityService.pack(user, me, { detail: true }),
+ object: await this.userEntityService.pack(user, me, { schema: 'UserDetailedNotMe' }),
};
} else if (note != null) {
try {
diff --git a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts
index 28470362c9..3fd4587e36 100644
--- a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts
+++ b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts
@@ -112,7 +112,7 @@ export default class extends Endpoint { // eslint-
return {
accessToken: accessToken.token,
user: await this.userEntityService.pack(session.userId, null, {
- detail: true,
+ schema: 'UserDetailedNotMe',
}),
};
});
diff --git a/packages/backend/src/server/api/endpoints/blocking/create.ts b/packages/backend/src/server/api/endpoints/blocking/create.ts
index 099b9cb8d7..c18d5f0300 100644
--- a/packages/backend/src/server/api/endpoints/blocking/create.ts
+++ b/packages/backend/src/server/api/endpoints/blocking/create.ts
@@ -102,7 +102,7 @@ export default class extends Endpoint { // eslint-
await this.userBlockingService.block(blocker, blockee);
return await this.userEntityService.pack(blockee.id, blocker, {
- detail: true,
+ schema: 'UserDetailedNotMe',
});
});
}
diff --git a/packages/backend/src/server/api/endpoints/blocking/delete.ts b/packages/backend/src/server/api/endpoints/blocking/delete.ts
index 6eb43891aa..624cbef7d2 100644
--- a/packages/backend/src/server/api/endpoints/blocking/delete.ts
+++ b/packages/backend/src/server/api/endpoints/blocking/delete.ts
@@ -103,7 +103,7 @@ export default class extends Endpoint { // eslint-
await this.userBlockingService.unblock(blocker, blockee);
return await this.userEntityService.pack(blockee.id, blocker, {
- detail: true,
+ schema: 'UserDetailedNotMe',
});
});
}
diff --git a/packages/backend/src/server/api/endpoints/bubble-game/ranking.ts b/packages/backend/src/server/api/endpoints/bubble-game/ranking.ts
index 0a543549be..c02a3909fb 100644
--- a/packages/backend/src/server/api/endpoints/bubble-game/ranking.ts
+++ b/packages/backend/src/server/api/endpoints/bubble-game/ranking.ts
@@ -61,7 +61,7 @@ export default class extends Endpoint { // eslint-
relations: ['user'],
});
- const users = await this.userEntityService.packMany(records.map(r => r.user!), null, { detail: false });
+ const users = await this.userEntityService.packMany(records.map(r => r.user!), null);
return records.map(r => ({
id: r.id,
diff --git a/packages/backend/src/server/api/endpoints/federation/users.ts b/packages/backend/src/server/api/endpoints/federation/users.ts
index c25b9b1521..c83a136a6d 100644
--- a/packages/backend/src/server/api/endpoints/federation/users.ts
+++ b/packages/backend/src/server/api/endpoints/federation/users.ts
@@ -54,7 +54,7 @@ export default class extends Endpoint { // eslint-
.limit(ps.limit)
.getMany();
- return await this.userEntityService.packMany(users, me, { detail: true });
+ return await this.userEntityService.packMany(users, me, { schema: 'UserDetailedNotMe' });
});
}
}
diff --git a/packages/backend/src/server/api/endpoints/hashtags/users.ts b/packages/backend/src/server/api/endpoints/hashtags/users.ts
index 4ceff9840c..337fddd94c 100644
--- a/packages/backend/src/server/api/endpoints/hashtags/users.ts
+++ b/packages/backend/src/server/api/endpoints/hashtags/users.ts
@@ -76,7 +76,7 @@ export default class extends Endpoint { // eslint-
const users = await query.limit(ps.limit).getMany();
- return await this.userEntityService.packMany(users, me, { detail: true });
+ return await this.userEntityService.packMany(users, me, { schema: 'UserDetailed' });
});
}
}
diff --git a/packages/backend/src/server/api/endpoints/i.ts b/packages/backend/src/server/api/endpoints/i.ts
index 8876d1c382..7ea73ed435 100644
--- a/packages/backend/src/server/api/endpoints/i.ts
+++ b/packages/backend/src/server/api/endpoints/i.ts
@@ -71,8 +71,8 @@ export default class extends Endpoint { // eslint-
userProfile.loggedInDates = [...userProfile.loggedInDates, today];
}
- return await this.userEntityService.pack(userProfile.user!, userProfile.user!, {
- detail: true,
+ return await this.userEntityService.pack(userProfile.user!, userProfile.user!, {
+ schema: 'MeDetailed',
includeSecrets: isSecure,
userProfile,
});
diff --git a/packages/backend/src/server/api/endpoints/i/2fa/done.ts b/packages/backend/src/server/api/endpoints/i/2fa/done.ts
index 543a2c93ce..5f59125309 100644
--- a/packages/backend/src/server/api/endpoints/i/2fa/done.ts
+++ b/packages/backend/src/server/api/endpoints/i/2fa/done.ts
@@ -64,7 +64,7 @@ export default class extends Endpoint { // eslint-
// Publish meUpdated event
this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, {
- detail: true,
+ schema: 'MeDetailed',
includeSecrets: true,
}));
diff --git a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts
index e6a6a9de71..cebb37c645 100644
--- a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts
+++ b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts
@@ -111,7 +111,7 @@ export default class extends Endpoint {
// Publish meUpdated event
this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, {
- detail: true,
+ schema: 'MeDetailed',
includeSecrets: true,
}));
diff --git a/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts b/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts
index 2ff51fcc1c..13b693f66c 100644
--- a/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts
+++ b/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts
@@ -74,7 +74,7 @@ export default class extends Endpoint { // eslint-
// Publish meUpdated event
this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, {
- detail: true,
+ schema: 'MeDetailed',
includeSecrets: true,
}));
});
diff --git a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts
index caf62f169f..4951f1f32a 100644
--- a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts
+++ b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts
@@ -97,7 +97,7 @@ export default class extends Endpoint { // eslint-
// Publish meUpdated event
this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, {
- detail: true,
+ schema: 'MeDetailed',
includeSecrets: true,
}));
diff --git a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts
index 032c316de1..a90f0a8763 100644
--- a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts
+++ b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts
@@ -76,7 +76,7 @@ export default class extends Endpoint { // eslint-
// Publish meUpdated event
this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, {
- detail: true,
+ schema: 'MeDetailed',
includeSecrets: true,
}));
});
diff --git a/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts
index c8625d0405..735c6e7ecb 100644
--- a/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts
+++ b/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts
@@ -69,7 +69,7 @@ export default class extends Endpoint { // eslint-
// Publish meUpdated event
this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, {
- detail: true,
+ schema: 'MeDetailed',
includeSecrets: true,
}));
diff --git a/packages/backend/src/server/api/endpoints/i/pin.ts b/packages/backend/src/server/api/endpoints/i/pin.ts
index 3ea954187f..5227213f6c 100644
--- a/packages/backend/src/server/api/endpoints/i/pin.ts
+++ b/packages/backend/src/server/api/endpoints/i/pin.ts
@@ -66,8 +66,8 @@ export default class extends Endpoint { // eslint-
throw err;
});
- return await this.userEntityService.pack(me.id, me, {
- detail: true,
+ return await this.userEntityService.pack(me.id, me, {
+ schema: 'MeDetailed',
});
});
}
diff --git a/packages/backend/src/server/api/endpoints/i/unpin.ts b/packages/backend/src/server/api/endpoints/i/unpin.ts
index 8e02cd2c74..923b03cec1 100644
--- a/packages/backend/src/server/api/endpoints/i/unpin.ts
+++ b/packages/backend/src/server/api/endpoints/i/unpin.ts
@@ -51,8 +51,8 @@ export default class extends Endpoint { // eslint-
throw err;
});
- return await this.userEntityService.pack(me.id, me, {
- detail: true,
+ return await this.userEntityService.pack(me.id, me, {
+ schema: 'MeDetailed',
});
});
}
diff --git a/packages/backend/src/server/api/endpoints/i/update-email.ts b/packages/backend/src/server/api/endpoints/i/update-email.ts
index d342a2fa96..62dffd4215 100644
--- a/packages/backend/src/server/api/endpoints/i/update-email.ts
+++ b/packages/backend/src/server/api/endpoints/i/update-email.ts
@@ -43,7 +43,7 @@ export const meta = {
res: {
type: 'object',
- ref: 'UserDetailed',
+ ref: 'MeDetailed',
},
} as const;
@@ -106,7 +106,7 @@ export default class extends Endpoint { // eslint-
});
const iObj = await this.userEntityService.pack(me.id, me, {
- detail: true,
+ schema: 'MeDetailed',
includeSecrets: true,
});
diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts
index 08c119201d..c742a459a5 100644
--- a/packages/backend/src/server/api/endpoints/i/update.ts
+++ b/packages/backend/src/server/api/endpoints/i/update.ts
@@ -450,8 +450,8 @@ export default class extends Endpoint { // eslint-
verifiedLinks: [],
});
- const iObj = await this.userEntityService.pack(user.id, user, {
- detail: true,
+ const iObj = await this.userEntityService.pack(user.id, user, {
+ schema: 'MeDetailed',
includeSecrets: isSecure,
});
diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts
index 1fe4a5c44b..5d2303a022 100644
--- a/packages/backend/src/server/api/endpoints/meta.ts
+++ b/packages/backend/src/server/api/endpoints/meta.ts
@@ -307,6 +307,11 @@ export const meta = {
type: 'string',
optional: false, nullable: true,
},
+ policies: {
+ type: 'object',
+ optional: false, nullable: false,
+ ref: 'RolePolicies',
+ },
},
},
} as const;
diff --git a/packages/backend/src/server/api/endpoints/page-push.ts b/packages/backend/src/server/api/endpoints/page-push.ts
index 8493ccb65b..e7d3e051a1 100644
--- a/packages/backend/src/server/api/endpoints/page-push.ts
+++ b/packages/backend/src/server/api/endpoints/page-push.ts
@@ -55,7 +55,7 @@ export default class extends Endpoint { // eslint-
var: ps.var,
userId: me.id,
user: await this.userEntityService.pack(me.id, { id: page.userId }, {
- detail: true,
+ schema: 'UserDetailed',
}),
});
});
diff --git a/packages/backend/src/server/api/endpoints/pinned-users.ts b/packages/backend/src/server/api/endpoints/pinned-users.ts
index bb47575c35..6e387f9802 100644
--- a/packages/backend/src/server/api/endpoints/pinned-users.ts
+++ b/packages/backend/src/server/api/endpoints/pinned-users.ts
@@ -52,7 +52,7 @@ export default class extends Endpoint { // eslint-
host: acct.host ?? IsNull(),
})));
- return await this.userEntityService.packMany(users.filter(x => x !== null) as MiUser[], me, { detail: true });
+ return await this.userEntityService.packMany(users.filter(x => x !== null) as MiUser[], me, { schema: 'UserDetailed' });
});
}
}
diff --git a/packages/backend/src/server/api/endpoints/retention.ts b/packages/backend/src/server/api/endpoints/retention.ts
index 372f0e478b..0d0c87a42e 100644
--- a/packages/backend/src/server/api/endpoints/retention.ts
+++ b/packages/backend/src/server/api/endpoints/retention.ts
@@ -14,6 +14,32 @@ export const meta = {
requireCredential: false,
res: {
+ type: 'array',
+ items: {
+ type: 'object',
+ properties: {
+ createdAt: {
+ type: 'string',
+ format: 'date-time',
+ },
+ users: {
+ type: 'number',
+ },
+ data: {
+ type: 'object',
+ additionalProperties: {
+ anyOf: [{
+ type: 'number',
+ }],
+ },
+ },
+ },
+ required: [
+ 'createdAt',
+ 'users',
+ 'data',
+ ],
+ },
},
allowGet: true,
diff --git a/packages/backend/src/server/api/endpoints/roles/users.ts b/packages/backend/src/server/api/endpoints/roles/users.ts
index 1d18bd6757..c9e1ab800c 100644
--- a/packages/backend/src/server/api/endpoints/roles/users.ts
+++ b/packages/backend/src/server/api/endpoints/roles/users.ts
@@ -37,7 +37,7 @@ export const meta = {
},
user: {
type: 'object',
- ref: 'User',
+ ref: 'UserDetailed',
},
},
required: ['id', 'user'],
@@ -94,7 +94,7 @@ export default class extends Endpoint { // eslint-
return await Promise.all(assigns.map(async assign => ({
id: assign.id,
- user: await this.userEntityService.pack(assign.user!, me, { detail: true }),
+ user: await this.userEntityService.pack(assign.user!, me, { schema: 'UserDetailed' }),
})));
});
}
diff --git a/packages/backend/src/server/api/endpoints/users.ts b/packages/backend/src/server/api/endpoints/users.ts
index ff710c6350..672694c196 100644
--- a/packages/backend/src/server/api/endpoints/users.ts
+++ b/packages/backend/src/server/api/endpoints/users.ts
@@ -89,7 +89,7 @@ export default class extends Endpoint { // eslint-
const users = await query.getMany();
- return await this.userEntityService.packMany(users, me, { detail: true });
+ return await this.userEntityService.packMany(users, me, { schema: 'UserDetailed' });
});
}
}
diff --git a/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts b/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts
index e446475a2f..69e19fb063 100644
--- a/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts
+++ b/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts
@@ -122,7 +122,7 @@ export default class extends Endpoint { // eslint-
// Make replies object (includes weights)
const repliesObj = await Promise.all(topRepliedUsers.map(async (user) => ({
- user: await this.userEntityService.pack(user, me, { detail: true }),
+ user: await this.userEntityService.pack(user, me, { schema: 'UserDetailed' }),
weight: repliedUsers[user] / peak,
})));
diff --git a/packages/backend/src/server/api/endpoints/users/lists/get-memberships.ts b/packages/backend/src/server/api/endpoints/users/lists/get-memberships.ts
index dfec7ed6e7..a2b7b826d2 100644
--- a/packages/backend/src/server/api/endpoints/users/lists/get-memberships.ts
+++ b/packages/backend/src/server/api/endpoints/users/lists/get-memberships.ts
@@ -46,7 +46,7 @@ export const meta = {
},
user: {
type: 'object',
- ref: 'User',
+ ref: 'UserLite',
},
withReplies: {
type: 'boolean',
diff --git a/packages/backend/src/server/api/endpoints/users/recommendation.ts b/packages/backend/src/server/api/endpoints/users/recommendation.ts
index f05fd14200..cc94ec6938 100644
--- a/packages/backend/src/server/api/endpoints/users/recommendation.ts
+++ b/packages/backend/src/server/api/endpoints/users/recommendation.ts
@@ -76,7 +76,7 @@ export default class extends Endpoint { // eslint-
const users = await query.limit(ps.limit).offset(ps.offset).getMany();
- return await this.userEntityService.packMany(users, me, { detail: true });
+ return await this.userEntityService.packMany(users, me, { schema: 'UserDetailed' });
});
}
}
diff --git a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts
index 1874b6d78d..d7f03c394f 100644
--- a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts
+++ b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts
@@ -131,7 +131,7 @@ export default class extends Endpoint { // eslint-
.getMany();
}
- return await this.userEntityService.packMany(users, me, { detail: !!ps.detail });
+ return await this.userEntityService.packMany(users, me, { schema: ps.detail ? 'UserDetailed' : 'UserLite' });
});
}
}
diff --git a/packages/backend/src/server/api/endpoints/users/search.ts b/packages/backend/src/server/api/endpoints/users/search.ts
index d597270e3a..86402076ac 100644
--- a/packages/backend/src/server/api/endpoints/users/search.ts
+++ b/packages/backend/src/server/api/endpoints/users/search.ts
@@ -141,7 +141,7 @@ export default class extends Endpoint { // eslint-
}
}
- return await this.userEntityService.packMany(users, me, { detail: ps.detail });
+ return await this.userEntityService.packMany(users, me, { schema: ps.detail ? 'UserDetailed' : 'UserLite' });
});
}
}
diff --git a/packages/backend/src/server/api/endpoints/users/show.ts b/packages/backend/src/server/api/endpoints/users/show.ts
index f3b5dea4a6..b82c714cd4 100644
--- a/packages/backend/src/server/api/endpoints/users/show.ts
+++ b/packages/backend/src/server/api/endpoints/users/show.ts
@@ -116,7 +116,7 @@ export default class extends Endpoint { // eslint-
}
return await Promise.all(_users.map(u => this.userEntityService.pack(u, me, {
- detail: true,
+ schema: 'UserDetailed',
})));
} else {
// Lookup user
@@ -146,7 +146,7 @@ export default class extends Endpoint { // eslint-
}
return await this.userEntityService.pack(user, me, {
- detail: true,
+ schema: 'UserDetailed',
});
}
});
diff --git a/packages/cherrypick-js/etc/cherrypick-js.api.md b/packages/cherrypick-js/etc/cherrypick-js.api.md
index e15677e6d0..9bc9977bfa 100644
--- a/packages/cherrypick-js/etc/cherrypick-js.api.md
+++ b/packages/cherrypick-js/etc/cherrypick-js.api.md
@@ -547,10 +547,10 @@ export type Channels = {
mention: (payload: Note) => void;
reply: (payload: Note) => void;
renote: (payload: Note) => void;
- follow: (payload: User) => void;
- followed: (payload: User) => void;
- unfollow: (payload: User) => void;
- meUpdated: (payload: MeDetailed) => void;
+ follow: (payload: UserDetailedNotMe) => void;
+ followed: (payload: UserDetailed | UserLite) => void;
+ unfollow: (payload: UserDetailed) => void;
+ meUpdated: (payload: UserDetailed) => void;
pageEvent: (payload: PageEvent) => void;
urlUploadFinished: (payload: {
marker: string;
@@ -649,6 +649,7 @@ export type Channels = {
params: {
listId: string;
withFiles?: boolean;
+ withRenotes?: boolean;
withCats?: boolean;
};
events: {
@@ -700,7 +701,7 @@ export type Channels = {
fileUpdated: (payload: DriveFile) => void;
folderCreated: (payload: DriveFolder) => void;
folderDeleted: (payload: DriveFolder['id']) => void;
- folderUpdated: (payload: DriveFile) => void;
+ folderUpdated: (payload: DriveFolder) => void;
};
receives: null;
};
@@ -742,6 +743,46 @@ export type Channels = {
};
receives: null;
};
+ reversiGame: {
+ params: {
+ gameId: string;
+ };
+ events: {
+ started: (payload: {
+ game: ReversiGameDetailed;
+ }) => void;
+ ended: (payload: {
+ winnerId: User['id'] | null;
+ game: ReversiGameDetailed;
+ }) => void;
+ canceled: (payload: {
+ userId: User['id'];
+ }) => void;
+ changeReadyStates: (payload: {
+ user1: boolean;
+ user2: boolean;
+ }) => void;
+ updateSettings: (payload: {
+ userId: User['id'];
+ key: string;
+ value: any;
+ }) => void;
+ log: (payload: Record) => void;
+ };
+ receives: {
+ putStone: {
+ pos: number;
+ id: string;
+ };
+ ready: boolean;
+ cancel: null | Record;
+ updateSettings: {
+ key: string;
+ value: any;
+ };
+ claimTimeIsUp: null | Record;
+ };
+ };
};
// @public (undocumented)
@@ -1758,6 +1799,7 @@ declare namespace entities {
Hashtag,
InviteCode,
Page,
+ PageBlock,
Channel,
QueueCount,
Antenna,
@@ -1770,6 +1812,7 @@ declare namespace entities {
Signin,
RoleLite,
Role,
+ RolePolicies,
ReversiGameLite,
ReversiGameDetailed
}
@@ -2329,7 +2372,7 @@ type ModerationLog = {
id: ID;
createdAt: DateString;
userId: User['id'];
- user: UserDetailed | null;
+ user: UserDetailedNotMe | null;
} & ({
type: 'updateServerSettings';
info: ModerationLogPayloads['updateServerSettings'];
@@ -2656,6 +2699,9 @@ export const notificationTypes: readonly ["note", "follow", "mention", "reply",
// @public (undocumented)
type Page = components['schemas']['Page'];
+// @public (undocumented)
+type PageBlock = components['schemas']['PageBlock'];
+
// @public (undocumented)
type PageEvent = {
pageId: Page['id'];
@@ -2804,6 +2850,9 @@ type Role = components['schemas']['Role'];
// @public (undocumented)
type RoleLite = components['schemas']['RoleLite'];
+// @public (undocumented)
+type RolePolicies = components['schemas']['RolePolicies'];
+
// @public (undocumented)
type RolesListResponse = operations['roles/list']['responses']['200']['content']['application/json'];
diff --git a/packages/cherrypick-js/package.json b/packages/cherrypick-js/package.json
index 3687449591..f8c3a84cce 100644
--- a/packages/cherrypick-js/package.json
+++ b/packages/cherrypick-js/package.json
@@ -2,7 +2,7 @@
"type": "module",
"name": "cherrypick-js",
"version": "4.7.0-beta.1",
- "basedMisskeyVersion": "2024.2.0-beta.3",
+ "basedMisskeyVersion": "2024.2.0-beta.7",
"description": "CherryPick SDK for JavaScript",
"types": "./built/dts/index.d.ts",
"exports": {
@@ -20,7 +20,7 @@
"ts": "npm run ts-esm && npm run ts-dts",
"ts-esm": "tsc --outDir built/esm",
"ts-dts": "tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true",
- "watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run build\"",
+ "watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run ts\"",
"tsd": "tsd",
"api": "pnpm api-extractor run --local --verbose",
"api-prod": "pnpm api-extractor run --verbose",
@@ -40,7 +40,7 @@
"@misskey-dev/eslint-plugin": "1.0.0",
"@swc/jest": "0.2.31",
"@types/jest": "29.5.11",
- "@types/node": "20.11.5",
+ "@types/node": "20.11.10",
"@typescript-eslint/eslint-plugin": "6.18.1",
"@typescript-eslint/parser": "6.18.1",
"eslint": "8.56.0",
diff --git a/packages/cherrypick-js/src/autogen/apiClientJSDoc.ts b/packages/cherrypick-js/src/autogen/apiClientJSDoc.ts
index 43fb850783..7b99a16935 100644
--- a/packages/cherrypick-js/src/autogen/apiClientJSDoc.ts
+++ b/packages/cherrypick-js/src/autogen/apiClientJSDoc.ts
@@ -1,7 +1,7 @@
/*
* version: 4.7.0-beta.1
- * basedMisskeyVersion: 2024.2.0-beta.7
- * generatedAt: 2024-01-25T07:07:45.745Z
+ * basedMisskeyVersion: 2024.2.0-beta.8
+ * generatedAt: 2024-01-31T08:08:55.554Z
*/
import type { SwitchCaseResponseType } from '../api.js';
diff --git a/packages/cherrypick-js/src/autogen/endpoint.ts b/packages/cherrypick-js/src/autogen/endpoint.ts
index 5f1999ecd1..5279102185 100644
--- a/packages/cherrypick-js/src/autogen/endpoint.ts
+++ b/packages/cherrypick-js/src/autogen/endpoint.ts
@@ -1,7 +1,7 @@
/*
* version: 4.7.0-beta.1
- * basedMisskeyVersion: 2024.2.0-beta.7
- * generatedAt: 2024-01-25T07:07:45.742Z
+ * basedMisskeyVersion: 2024.2.0-beta.8
+ * generatedAt: 2024-01-31T08:08:55.552Z
*/
import type {
diff --git a/packages/cherrypick-js/src/autogen/entities.ts b/packages/cherrypick-js/src/autogen/entities.ts
index ce0c2c5ac4..7dff4f187a 100644
--- a/packages/cherrypick-js/src/autogen/entities.ts
+++ b/packages/cherrypick-js/src/autogen/entities.ts
@@ -1,7 +1,7 @@
/*
* version: 4.7.0-beta.1
- * basedMisskeyVersion: 2024.2.0-beta.7
- * generatedAt: 2024-01-25T07:07:45.740Z
+ * basedMisskeyVersion: 2024.2.0-beta.8
+ * generatedAt: 2024-01-31T08:08:55.551Z
*/
import { operations } from './types.js';
diff --git a/packages/cherrypick-js/src/autogen/models.ts b/packages/cherrypick-js/src/autogen/models.ts
index f57d26e24d..82941ecec4 100644
--- a/packages/cherrypick-js/src/autogen/models.ts
+++ b/packages/cherrypick-js/src/autogen/models.ts
@@ -1,7 +1,7 @@
/*
* version: 4.7.0-beta.1
- * basedMisskeyVersion: 2024.2.0-beta.7
- * generatedAt: 2024-01-25T07:07:45.738Z
+ * basedMisskeyVersion: 2024.2.0-beta.8
+ * generatedAt: 2024-01-31T08:08:55.546Z
*/
import { components } from './types.js';
@@ -32,6 +32,7 @@ export type Blocking = components['schemas']['Blocking'];
export type Hashtag = components['schemas']['Hashtag'];
export type InviteCode = components['schemas']['InviteCode'];
export type Page = components['schemas']['Page'];
+export type PageBlock = components['schemas']['PageBlock'];
export type Channel = components['schemas']['Channel'];
export type QueueCount = components['schemas']['QueueCount'];
export type Antenna = components['schemas']['Antenna'];
@@ -44,5 +45,6 @@ export type Flash = components['schemas']['Flash'];
export type Signin = components['schemas']['Signin'];
export type RoleLite = components['schemas']['RoleLite'];
export type Role = components['schemas']['Role'];
+export type RolePolicies = components['schemas']['RolePolicies'];
export type ReversiGameLite = components['schemas']['ReversiGameLite'];
export type ReversiGameDetailed = components['schemas']['ReversiGameDetailed'];
diff --git a/packages/cherrypick-js/src/autogen/types.ts b/packages/cherrypick-js/src/autogen/types.ts
index ee39245881..9b4e2ccd7f 100644
--- a/packages/cherrypick-js/src/autogen/types.ts
+++ b/packages/cherrypick-js/src/autogen/types.ts
@@ -3,8 +3,8 @@
/*
* version: 4.7.0-beta.1
- * basedMisskeyVersion: 2024.2.0-beta.7
- * generatedAt: 2024-01-25T07:07:45.651Z
+ * basedMisskeyVersion: 2024.2.0-beta.8
+ * generatedAt: 2024-01-31T08:08:55.464Z
*/
/**
@@ -4032,32 +4032,7 @@ export type components = {
unlockedAt: number;
}[];
loggedInDays: number;
- policies: {
- gtlAvailable: boolean;
- ltlAvailable: boolean;
- canPublicNote: boolean;
- canInvite: boolean;
- inviteLimit: number;
- inviteLimitCycle: number;
- inviteExpirationTime: number;
- canManageCustomEmojis: boolean;
- canManageAvatarDecorations: boolean;
- canSearchNotes: boolean;
- canUseTranslator: boolean;
- canHideAds: boolean;
- driveCapacityMb: number;
- alwaysMarkNsfw: boolean;
- pinLimit: number;
- antennaLimit: number;
- wordMuteLimit: number;
- webhookLimit: number;
- clipLimit: number;
- noteEachClipsLimit: number;
- userListLimit: number;
- userEachUserListsLimit: number;
- rateLimitFactor: number;
- avatarDecorationLimit: number;
- };
+ policies: components['schemas']['RolePolicies'];
email?: string | null;
emailVerified?: boolean | null;
securityKeysList?: {
@@ -4074,7 +4049,7 @@ export type components = {
UserDetailedNotMe: components['schemas']['UserLite'] & components['schemas']['UserDetailedNotMeOnly'];
MeDetailed: components['schemas']['UserLite'] & components['schemas']['UserDetailedNotMeOnly'] & components['schemas']['MeDetailedOnly'];
UserDetailed: components['schemas']['UserDetailedNotMe'] | components['schemas']['MeDetailed'];
- User: components['schemas']['UserLite'] | components['schemas']['UserDetailed'] | components['schemas']['UserDetailedNotMe'] | components['schemas']['MeDetailed'];
+ User: components['schemas']['UserLite'] | components['schemas']['UserDetailed'];
UserList: {
/**
* Format: id
@@ -4131,8 +4106,10 @@ export type components = {
text: string;
title: string;
imageUrl: string | null;
- icon: string;
- display: string;
+ /** @enum {string} */
+ icon: 'info' | 'warning' | 'error' | 'success';
+ /** @enum {string} */
+ display: 'dialog' | 'normal' | 'banner';
needConfirmationToRead: boolean;
silence: boolean;
forYou: boolean;
@@ -4203,13 +4180,26 @@ export type components = {
renote?: components['schemas']['Note'] | null;
disableRightClick?: boolean;
isHidden?: boolean;
- visibility: string;
+ /** @enum {string} */
+ visibility: 'public' | 'home' | 'followers' | 'specified';
mentions?: string[];
visibleUserIds?: string[];
fileIds?: string[];
files?: components['schemas']['DriveFile'][];
tags?: string[];
- poll?: Record | null;
+ poll?: ({
+ /** Format: date-time */
+ expiresAt?: string | null;
+ multiple: boolean;
+ choices: {
+ isVoted: boolean;
+ text: string;
+ votes: number;
+ }[];
+ }) | null;
+ emojis?: {
+ [key: string]: string;
+ };
event?: Record | null;
/**
* Format: id
@@ -4226,14 +4216,19 @@ export type components = {
}) | null;
localOnly?: boolean;
reactionAcceptance: string | null;
- reactions: Record;
+ reactionEmojis: {
+ [key: string]: string;
+ };
+ reactions: {
+ [key: string]: number;
+ };
renoteCount: number;
repliesCount: number;
uri?: string;
url?: string;
reactionAndUserPairCache?: string[];
clippedCount?: number;
- myReaction?: Record | null;
+ myReaction?: string | null;
};
NoteReaction: {
/**
@@ -4264,21 +4259,162 @@ export type components = {
/** Format: date-time */
createdAt: string;
/** @enum {string} */
- type: 'note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'groupInvited' | 'achievementEarned' | 'app' | 'test' | 'reaction:grouped' | 'renote:grouped';
- user?: components['schemas']['UserLite'] | null;
+ type: 'note';
+ user: components['schemas']['UserLite'];
/** Format: id */
- userId?: string | null;
- note?: components['schemas']['Note'] | null;
- reaction?: string | null;
- achievement?: string;
- body?: string | null;
- header?: string | null;
- icon?: string | null;
- reactions?: {
+ userId: string;
+ note: components['schemas']['Note'];
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'mention';
+ user: components['schemas']['UserLite'];
+ /** Format: id */
+ userId: string;
+ note: components['schemas']['Note'];
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'reply';
+ user: components['schemas']['UserLite'];
+ /** Format: id */
+ userId: string;
+ note: components['schemas']['Note'];
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'renote';
+ user: components['schemas']['UserLite'];
+ /** Format: id */
+ userId: string;
+ note: components['schemas']['Note'];
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'quote';
+ user: components['schemas']['UserLite'];
+ /** Format: id */
+ userId: string;
+ note: components['schemas']['Note'];
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'reaction';
+ user: components['schemas']['UserLite'];
+ /** Format: id */
+ userId: string;
+ note: components['schemas']['Note'];
+ reaction: string;
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'pollEnded';
+ user: components['schemas']['UserLite'];
+ /** Format: id */
+ userId: string;
+ note: components['schemas']['Note'];
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'follow';
+ user: components['schemas']['UserLite'];
+ /** Format: id */
+ userId: string;
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'receiveFollowRequest';
+ user: components['schemas']['UserLite'];
+ /** Format: id */
+ userId: string;
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'followRequestAccepted';
+ user: components['schemas']['UserLite'];
+ /** Format: id */
+ userId: string;
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'roleAssigned';
+ role: components['schemas']['Role'];
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'achievementEarned';
+ achievement: string;
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'app';
+ body: string;
+ header: string;
+ icon: string;
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'reaction:grouped';
+ note: components['schemas']['Note'];
+ reactions: {
user: components['schemas']['UserLite'];
reaction: string;
- }[] | null;
- users?: components['schemas']['UserLite'][] | null;
+ }[];
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'renote:grouped';
+ note: components['schemas']['Note'];
+ users: components['schemas']['UserLite'][];
+ } | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'test';
};
DriveFile: {
/**
@@ -4359,8 +4495,8 @@ export type components = {
followeeId: string;
/** Format: id */
followerId: string;
- followee?: components['schemas']['UserDetailed'];
- follower?: components['schemas']['UserDetailed'];
+ followee?: components['schemas']['UserDetailedNotMe'];
+ follower?: components['schemas']['UserDetailedNotMe'];
};
Muting: {
/**
@@ -4374,7 +4510,7 @@ export type components = {
expiresAt: string | null;
/** Format: id */
muteeId: string;
- mutee: components['schemas']['UserDetailed'];
+ mutee: components['schemas']['UserDetailedNotMe'];
};
RenoteMuting: {
/**
@@ -4386,7 +4522,7 @@ export type components = {
createdAt: string;
/** Format: id */
muteeId: string;
- mutee: components['schemas']['UserDetailed'];
+ mutee: components['schemas']['UserDetailedNotMe'];
};
Blocking: {
/**
@@ -4398,7 +4534,7 @@ export type components = {
createdAt: string;
/** Format: id */
blockeeId: string;
- blockee: components['schemas']['UserDetailed'];
+ blockee: components['schemas']['UserDetailedNotMe'];
};
Hashtag: {
/** @example cherrypick */
@@ -4441,7 +4577,7 @@ export type components = {
/** Format: id */
userId: string;
user: components['schemas']['UserLite'];
- content: Record[];
+ content: components['schemas']['PageBlock'][];
variables: Record[];
title: string;
name: string;
@@ -4456,6 +4592,29 @@ export type components = {
likedCount: number;
isLiked?: boolean;
};
+ PageBlock: OneOf<[{
+ id: string;
+ /** @enum {string} */
+ type: 'text';
+ text: string;
+ }, {
+ id: string;
+ /** @enum {string} */
+ type: 'section';
+ title: string;
+ children: components['schemas']['PageBlock'][];
+ }, {
+ id: string;
+ /** @enum {string} */
+ type: 'image';
+ fileId: string | null;
+ }, {
+ id: string;
+ /** @enum {string} */
+ type: 'note';
+ detailed: boolean;
+ note: string | null;
+ }]>;
Channel: {
/**
* Format: id
@@ -4677,129 +4836,40 @@ export type components = {
/** @example false */
canEditMembersByModerator: boolean;
policies: {
- pinLimit: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- canInvite: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- clipLimit: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- canHideAds: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- inviteLimit: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- antennaLimit: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- gtlAvailable: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- ltlAvailable: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- webhookLimit: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- canPublicNote: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- userListLimit: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- wordMuteLimit: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- alwaysMarkNsfw: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- canSearchNotes: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- driveCapacityMb: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- rateLimitFactor: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- inviteLimitCycle: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- noteEachClipsLimit: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- inviteExpirationTime: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- canManageCustomEmojis: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- userEachUserListsLimit: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- canManageAvatarDecorations: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- canUseTranslator: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
- };
- avatarDecorationLimit: {
- value: number | boolean;
- priority: number;
- useDefault: boolean;
+ [key: string]: {
+ value?: number | boolean;
+ priority?: number;
+ useDefault?: boolean;
};
};
usersCount: number;
});
+ RolePolicies: {
+ gtlAvailable: boolean;
+ ltlAvailable: boolean;
+ canPublicNote: boolean;
+ canInvite: boolean;
+ inviteLimit: number;
+ inviteLimitCycle: number;
+ inviteExpirationTime: number;
+ canManageCustomEmojis: boolean;
+ canManageAvatarDecorations: boolean;
+ canSearchNotes: boolean;
+ canUseTranslator: boolean;
+ canHideAds: boolean;
+ driveCapacityMb: number;
+ alwaysMarkNsfw: boolean;
+ pinLimit: number;
+ antennaLimit: number;
+ wordMuteLimit: number;
+ webhookLimit: number;
+ clipLimit: number;
+ noteEachClipsLimit: number;
+ userListLimit: number;
+ userEachUserListsLimit: number;
+ rateLimitFactor: number;
+ avatarDecorationLimit: number;
+ };
ReversiGameLite: {
/** Format: id */
id: string;
@@ -5347,9 +5417,9 @@ export type operations = {
targetUserId: string;
/** Format: id */
assigneeId: string | null;
- reporter: components['schemas']['User'];
- targetUser: components['schemas']['User'];
- assignee?: components['schemas']['User'] | null;
+ reporter: components['schemas']['UserDetailedNotMe'];
+ targetUser: components['schemas']['UserDetailedNotMe'];
+ assignee?: components['schemas']['UserDetailedNotMe'] | null;
})[];
};
};
@@ -5404,7 +5474,7 @@ export type operations = {
/** @description OK (with results) */
200: {
content: {
- 'application/json': components['schemas']['User'];
+ 'application/json': components['schemas']['MeDetailed'];
};
};
/** @description Client error */
@@ -5509,7 +5579,7 @@ export type operations = {
/** @description OK (with results) */
200: {
content: {
- 'application/json': components['schemas']['User'];
+ 'application/json': components['schemas']['UserDetailedNotMe'];
};
};
/** @description Client error */
@@ -8818,7 +8888,7 @@ export type operations = {
info: Record;
/** Format: id */
userId: string;
- user: components['schemas']['UserDetailed'];
+ user: components['schemas']['UserDetailedNotMe'];
}[];
};
};
@@ -11813,14 +11883,18 @@ export type operations = {
200: {
content: {
'application/json': {
- 'local.incCount': number[];
- 'local.incSize': number[];
- 'local.decCount': number[];
- 'local.decSize': number[];
- 'remote.incCount': number[];
- 'remote.incSize': number[];
- 'remote.decCount': number[];
- 'remote.decSize': number[];
+ local: {
+ incCount: number[];
+ incSize: number[];
+ decCount: number[];
+ decSize: number[];
+ };
+ remote: {
+ incCount: number[];
+ incSize: number[];
+ decCount: number[];
+ decSize: number[];
+ };
};
};
};
@@ -11948,30 +12022,44 @@ export type operations = {
200: {
content: {
'application/json': {
- 'requests.failed': number[];
- 'requests.succeeded': number[];
- 'requests.received': number[];
- 'notes.total': number[];
- 'notes.inc': number[];
- 'notes.dec': number[];
- 'notes.diffs.normal': number[];
- 'notes.diffs.reply': number[];
- 'notes.diffs.renote': number[];
- 'notes.diffs.withFile': number[];
- 'users.total': number[];
- 'users.inc': number[];
- 'users.dec': number[];
- 'following.total': number[];
- 'following.inc': number[];
- 'following.dec': number[];
- 'followers.total': number[];
- 'followers.inc': number[];
- 'followers.dec': number[];
- 'drive.totalFiles': number[];
- 'drive.incFiles': number[];
- 'drive.decFiles': number[];
- 'drive.incUsage': number[];
- 'drive.decUsage': number[];
+ requests: {
+ failed: number[];
+ succeeded: number[];
+ received: number[];
+ };
+ notes: {
+ total: number[];
+ inc: number[];
+ dec: number[];
+ diffs: {
+ normal: number[];
+ reply: number[];
+ renote: number[];
+ withFile: number[];
+ };
+ };
+ users: {
+ total: number[];
+ inc: number[];
+ dec: number[];
+ };
+ following: {
+ total: number[];
+ inc: number[];
+ dec: number[];
+ };
+ followers: {
+ total: number[];
+ inc: number[];
+ dec: number[];
+ };
+ drive: {
+ totalFiles: number[];
+ incFiles: number[];
+ decFiles: number[];
+ incUsage: number[];
+ decUsage: number[];
+ };
};
};
};
@@ -12031,20 +12119,28 @@ export type operations = {
200: {
content: {
'application/json': {
- 'local.total': number[];
- 'local.inc': number[];
- 'local.dec': number[];
- 'local.diffs.normal': number[];
- 'local.diffs.reply': number[];
- 'local.diffs.renote': number[];
- 'local.diffs.withFile': number[];
- 'remote.total': number[];
- 'remote.inc': number[];
- 'remote.dec': number[];
- 'remote.diffs.normal': number[];
- 'remote.diffs.reply': number[];
- 'remote.diffs.renote': number[];
- 'remote.diffs.withFile': number[];
+ local: {
+ total: number[];
+ inc: number[];
+ dec: number[];
+ diffs: {
+ normal: number[];
+ reply: number[];
+ renote: number[];
+ withFile: number[];
+ };
+ };
+ remote: {
+ total: number[];
+ inc: number[];
+ dec: number[];
+ diffs: {
+ normal: number[];
+ reply: number[];
+ renote: number[];
+ withFile: number[];
+ };
+ };
};
};
};
@@ -12173,18 +12269,30 @@ export type operations = {
200: {
content: {
'application/json': {
- 'local.followings.total': number[];
- 'local.followings.inc': number[];
- 'local.followings.dec': number[];
- 'local.followers.total': number[];
- 'local.followers.inc': number[];
- 'local.followers.dec': number[];
- 'remote.followings.total': number[];
- 'remote.followings.inc': number[];
- 'remote.followings.dec': number[];
- 'remote.followers.total': number[];
- 'remote.followers.inc': number[];
- 'remote.followers.dec': number[];
+ local: {
+ followings: {
+ total: number[];
+ inc: number[];
+ dec: number[];
+ };
+ followers: {
+ total: number[];
+ inc: number[];
+ dec: number[];
+ };
+ };
+ remote: {
+ followings: {
+ total: number[];
+ inc: number[];
+ dec: number[];
+ };
+ followers: {
+ total: number[];
+ inc: number[];
+ dec: number[];
+ };
+ };
};
};
};
@@ -12249,10 +12357,12 @@ export type operations = {
total: number[];
inc: number[];
dec: number[];
- 'diffs.normal': number[];
- 'diffs.reply': number[];
- 'diffs.renote': number[];
- 'diffs.withFile': number[];
+ diffs: {
+ normal: number[];
+ reply: number[];
+ renote: number[];
+ withFile: number[];
+ };
};
};
};
@@ -12314,10 +12424,14 @@ export type operations = {
200: {
content: {
'application/json': {
- 'upv.user': number[];
- 'pv.user': number[];
- 'upv.visitor': number[];
- 'pv.visitor': number[];
+ upv: {
+ user: number[];
+ visitor: number[];
+ };
+ pv: {
+ user: number[];
+ visitor: number[];
+ };
};
};
};
@@ -12379,8 +12493,12 @@ export type operations = {
200: {
content: {
'application/json': {
- 'local.count': number[];
- 'remote.count': number[];
+ local: {
+ count: number[];
+ };
+ remote: {
+ count: number[];
+ };
};
};
};
@@ -12440,12 +12558,16 @@ export type operations = {
200: {
content: {
'application/json': {
- 'local.total': number[];
- 'local.inc': number[];
- 'local.dec': number[];
- 'remote.total': number[];
- 'remote.inc': number[];
- 'remote.dec': number[];
+ local: {
+ total: number[];
+ inc: number[];
+ dec: number[];
+ };
+ remote: {
+ total: number[];
+ inc: number[];
+ dec: number[];
+ };
};
};
};
@@ -18996,7 +19118,7 @@ export type operations = {
/** @description OK (with results) */
200: {
content: {
- 'application/json': components['schemas']['UserDetailed'];
+ 'application/json': components['schemas']['MeDetailed'];
};
};
/** @description Client error */
@@ -20174,6 +20296,7 @@ export type operations = {
privacyPolicyUrl: string | null;
serverRules: string[];
themeColor: string | null;
+ policies: components['schemas']['RolePolicies'];
};
};
};
@@ -24252,7 +24375,7 @@ export type operations = {
'application/json': {
/** Format: misskey:id */
id: string;
- user: components['schemas']['User'];
+ user: components['schemas']['UserDetailed'];
}[];
};
};
@@ -26679,7 +26802,7 @@ export type operations = {
createdAt: string;
/** Format: misskey:id */
userId: string;
- user: components['schemas']['User'];
+ user: components['schemas']['UserLite'];
withReplies: boolean;
}[];
};
@@ -27711,7 +27834,14 @@ export type operations = {
/** @description OK (with results) */
200: {
content: {
- 'application/json': unknown;
+ 'application/json': {
+ /** Format: date-time */
+ createdAt: string;
+ users: number;
+ data: {
+ [key: string]: number;
+ };
+ }[];
};
};
/** @description Client error */
diff --git a/packages/cherrypick-js/src/entities.ts b/packages/cherrypick-js/src/entities.ts
index 5c2e00cfdc..772d2bbfa1 100644
--- a/packages/cherrypick-js/src/entities.ts
+++ b/packages/cherrypick-js/src/entities.ts
@@ -1,5 +1,5 @@
import { ModerationLogPayloads } from './consts.js';
-import { Announcement, EmojiDetailed, MeDetailed, Page, User, UserDetailed } from './autogen/models.js';
+import { Announcement, EmojiDetailed, MeDetailed, Page, User, UserDetailedNotMe } from './autogen/models.js';
export * from './autogen/entities.js';
export * from './autogen/models.js';
@@ -19,7 +19,7 @@ export type ModerationLog = {
id: ID;
createdAt: DateString;
userId: User['id'];
- user: UserDetailed | null;
+ user: UserDetailedNotMe | null;
} & ({
type: 'updateServerSettings';
info: ModerationLogPayloads['updateServerSettings'];
diff --git a/packages/cherrypick-js/src/streaming.types.ts b/packages/cherrypick-js/src/streaming.types.ts
index 5ff84b4ceb..a1e4108b28 100644
--- a/packages/cherrypick-js/src/streaming.types.ts
+++ b/packages/cherrypick-js/src/streaming.types.ts
@@ -2,12 +2,14 @@ import {
Antenna,
DriveFile,
DriveFolder,
- MeDetailed,
Note,
Notification,
Signin,
User,
UserGroup,
+ UserDetailed,
+ UserDetailedNotMe,
+ UserLite,
} from './autogen/models.js';
import {
AnnouncementCreated,
@@ -19,6 +21,7 @@ import {
QueueStatsLog,
ServerStats,
ServerStatsLog,
+ ReversiGameDetailed,
} from './entities.js';
export type Channels = {
@@ -29,10 +32,10 @@ export type Channels = {
mention: (payload: Note) => void;
reply: (payload: Note) => void;
renote: (payload: Note) => void;
- follow: (payload: User) => void; // 自分が他人をフォローしたとき
- followed: (payload: User) => void; // 他人が自分をフォローしたとき
- unfollow: (payload: User) => void; // 自分が他人をフォロー解除したとき
- meUpdated: (payload: MeDetailed) => void;
+ follow: (payload: UserDetailedNotMe) => void; // 自分が他人をフォローしたとき
+ followed: (payload: UserDetailed | UserLite) => void; // 他人が自分をフォローしたとき
+ unfollow: (payload: UserDetailed) => void; // 自分が他人をフォロー解除したとき
+ meUpdated: (payload: UserDetailed) => void;
pageEvent: (payload: PageEvent) => void;
urlUploadFinished: (payload: { marker: string; file: DriveFile; }) => void;
readAllNotifications: () => void;
@@ -128,6 +131,7 @@ export type Channels = {
params: {
listId: string;
withFiles?: boolean;
+ withRenotes?: boolean;
withCats?: boolean;
};
events: {
@@ -179,7 +183,7 @@ export type Channels = {
fileUpdated: (payload: DriveFile) => void;
folderCreated: (payload: DriveFolder) => void;
folderDeleted: (payload: DriveFolder['id']) => void;
- folderUpdated: (payload: DriveFile) => void;
+ folderUpdated: (payload: DriveFolder) => void;
};
receives: null;
};
@@ -220,6 +224,32 @@ export type Channels = {
}
};
receives: null;
+ };
+ reversiGame: {
+ params: {
+ gameId: string;
+ };
+ events: {
+ started: (payload: { game: ReversiGameDetailed; }) => void;
+ ended: (payload: { winnerId: User['id'] | null; game: ReversiGameDetailed; }) => void;
+ canceled: (payload: { userId: User['id']; }) => void;
+ changeReadyStates: (payload: { user1: boolean; user2: boolean; }) => void;
+ updateSettings: (payload: { userId: User['id']; key: string; value: any; }) => void;
+ log: (payload: Record) => void;
+ };
+ receives: {
+ putStone: {
+ pos: number;
+ id: string;
+ };
+ ready: boolean;
+ cancel: null | Record;
+ updateSettings: {
+ key: string;
+ value: any;
+ };
+ claimTimeIsUp: null | Record;
+ }
}
};
diff --git a/packages/frontend/@types/global.d.ts b/packages/frontend/@types/global.d.ts
index 937faade36..6e7e4f8701 100644
--- a/packages/frontend/@types/global.d.ts
+++ b/packages/frontend/@types/global.d.ts
@@ -17,3 +17,8 @@ declare const _DATA_TRANSFER_DECK_COLUMN_: string;
// for dev-mode
declare const _LANGS_FULL_: string[][];
+
+// TagCanvas
+interface Window {
+ TagCanvas: any;
+}
diff --git a/packages/frontend/package.json b/packages/frontend/package.json
index 4d9f76b55b..56160ca2a8 100644
--- a/packages/frontend/package.json
+++ b/packages/frontend/package.json
@@ -21,15 +21,15 @@
"@fontsource/jetbrains-mono": "^5.0.12",
"@github/webauthn-json": "2.1.1",
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
- "@misskey-dev/browser-image-resizer": "2.2.1-misskey.10",
+ "@misskey-dev/browser-image-resizer": "2024.1.0",
"@rollup/plugin-json": "6.1.0",
"@rollup/plugin-replace": "5.0.5",
"@rollup/pluginutils": "5.1.0",
"@syuilo/aiscript": "0.17.0",
"@tabler/icons-webfont": "2.44.0",
"@twemoji/parser": "15.0.0",
- "@vitejs/plugin-vue": "5.0.2",
- "@vue/compiler-sfc": "3.4.3",
+ "@vitejs/plugin-vue": "5.0.3",
+ "@vue/compiler-sfc": "3.4.15",
"autosize": "6.0.1",
"aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.0.6",
"astring": "1.8.6",
@@ -43,7 +43,7 @@
"chartjs-plugin-zoom": "2.0.1",
"cherrypick-js": "workspace:*",
"cherrypick-mfm-js": "0.24.0-cherrypick.4",
- "chromatic": "10.3.1",
+ "chromatic": "10.6.1",
"compare-versions": "6.1.0",
"cropperjs": "2.0.0-beta.4",
"date-fns": "2.30.0",
@@ -69,7 +69,7 @@
"strict-event-emitter-types": "2.0.0",
"temml": "0.10.20",
"textarea-caret": "3.1.0",
- "three": "0.160.0",
+ "three": "0.160.1",
"throttle-debounce": "5.0.0",
"tinycolor2": "1.6.0",
"tinyld": "^1.3.4",
@@ -84,8 +84,8 @@
"vuedraggable": "next"
},
"devDependencies": {
- "@misskey-dev/eslint-plugin": "^1.0.0",
- "@misskey-dev/summaly": "^5.0.3",
+ "@misskey-dev/eslint-plugin": "1.0.0",
+ "@misskey-dev/summaly": "5.0.3",
"@storybook/addon-actions": "7.6.10",
"@storybook/addon-essentials": "7.6.10",
"@storybook/addon-interactions": "7.6.10",
@@ -110,13 +110,13 @@
"@types/estree": "1.0.5",
"@types/matter-js": "0.19.6",
"@types/micromatch": "4.0.6",
- "@types/node": "20.11.5",
+ "@types/node": "20.11.10",
"@types/prismjs": "^1.26.0",
"@types/punycode": "2.1.3",
"@types/sanitize-html": "2.9.5",
"@types/throttle-debounce": "5.0.2",
"@types/tinycolor2": "1.4.6",
- "@types/uuid": "9.0.7",
+ "@types/uuid": "9.0.8",
"@types/ws": "8.5.10",
"@typescript-eslint/eslint-plugin": "6.18.1",
"@typescript-eslint/parser": "6.18.1",
@@ -145,7 +145,7 @@
"vite-plugin-turbosnap": "1.0.3",
"vitest": "0.34.6",
"vitest-fetch-mock": "0.2.2",
- "vue-eslint-parser": "9.4.0",
+ "vue-eslint-parser": "9.4.2",
"vue-tsc": "1.8.27"
}
}
diff --git a/packages/frontend/src/boot/common.ts b/packages/frontend/src/boot/common.ts
index 4f9f5b2b10..cef55ba0c8 100644
--- a/packages/frontend/src/boot/common.ts
+++ b/packages/frontend/src/boot/common.ts
@@ -22,7 +22,7 @@ import { getAccountFromId } from '@/scripts/get-account-from-id.js';
import { deckStore } from '@/ui/deck/deck-store.js';
import { miLocalStorage } from '@/local-storage.js';
import { fetchCustomEmojis } from '@/custom-emojis.js';
-import { setupRouter } from '@/global/router/definition.js';
+import { setupRouter } from '@/router/definition.js';
import { popup } from '@/os.js';
export async function common(createVue: () => App) {
diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts
index 1016965891..08fe5c7678 100644
--- a/packages/frontend/src/boot/main-boot.ts
+++ b/packages/frontend/src/boot/main-boot.ts
@@ -19,7 +19,7 @@ import { claimAchievement, claimedAchievements } from '@/scripts/achievements.js
import { initializeSw } from '@/scripts/initialize-sw.js';
import { deckStore } from '@/ui/deck/deck-store.js';
import { emojiPicker } from '@/scripts/emoji-picker.js';
-import { mainRouter } from '@/global/router/main.js';
+import { mainRouter } from '@/router/main.js';
import { userName } from '@/filters/user.js';
import { vibrate } from '@/scripts/vibrate.js';
diff --git a/packages/frontend/src/components/MkAbuseReportWindow.vue b/packages/frontend/src/components/MkAbuseReportWindow.vue
index c463c1c9eb..886d613771 100644
--- a/packages/frontend/src/components/MkAbuseReportWindow.vue
+++ b/packages/frontend/src/components/MkAbuseReportWindow.vue
@@ -39,7 +39,7 @@ import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
const props = defineProps<{
- user: Misskey.entities.User;
+ user: Misskey.entities.UserDetailed;
initialComment?: string;
}>();
diff --git a/packages/frontend/src/components/MkAchievements.vue b/packages/frontend/src/components/MkAchievements.vue
index 930ee55c8a..ada4419787 100644
--- a/packages/frontend/src/components/MkAchievements.vue
+++ b/packages/frontend/src/components/MkAchievements.vue
@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
-
{{ c.text }}
-
+
{{ c.text }}
+
{{ c.text }}
{{ button.text }}
@@ -20,19 +20,19 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ c.label }}
{{ c.caption }}
-
+
{{ c.label }}
{{ c.caption }}
-
+
{{ c.label }}
{{ c.caption }}
-
+
{{ c.label }}
{{ c.caption }}
-
+
{{ c.label }}
{{ c.caption }}
@@ -42,8 +42,8 @@ SPDX-License-Identifier: AGPL-3.0-only
@@ -52,7 +52,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
@@ -68,7 +68,7 @@ import MkInput from '@/components/MkInput.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import MkTextarea from '@/components/MkTextarea.vue';
import MkSelect from '@/components/MkSelect.vue';
-import { AsUiComponent } from '@/scripts/aiscript/ui.js';
+import { AsUiComponent, AsUiRoot, AsUiPostFormButton } from '@/scripts/aiscript/ui.js';
import MkFolder from '@/components/MkFolder.vue';
import MkPostForm from '@/components/MkPostForm.vue';
@@ -85,20 +85,32 @@ const props = withDefaults(defineProps<{
const c = props.component;
function g(id) {
- return props.components.find(x => x.value.id === id).value;
+ const v = props.components.find(x => x.value.id === id)?.value;
+ if (v) return v;
+
+ return {
+ id: 'dummy',
+ type: 'root',
+ children: [],
+ } as AsUiRoot;
}
-const valueForSwitch = ref(c.default ?? false);
+const valueForSwitch = ref('default' in c && typeof c.default === 'boolean' ? c.default : false);
function onSwitchUpdate(v) {
valueForSwitch.value = v;
- if (c.onChange) c.onChange(v);
+ if ('onChange' in c && c.onChange) {
+ c.onChange(v as never);
+ }
}
function openPostForm() {
+ const form = (c as AsUiPostFormButton).form;
+ if (!form) return;
+
os.post({
- initialText: c.form.text,
- initialCw: c.form.cw,
+ initialText: form.text,
+ initialCw: form.cw,
instant: true,
});
}
diff --git a/packages/frontend/src/components/MkButton.vue b/packages/frontend/src/components/MkButton.vue
index 42316c2ff4..f7c6459ede 100644
--- a/packages/frontend/src/components/MkButton.vue
+++ b/packages/frontend/src/components/MkButton.vue
@@ -22,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
diff --git a/packages/frontend/src/components/MkCaptcha.vue b/packages/frontend/src/components/MkCaptcha.vue
index f056a0d219..3a3c0efc5a 100644
--- a/packages/frontend/src/components/MkCaptcha.vue
+++ b/packages/frontend/src/components/MkCaptcha.vue
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
{{ i18n.ts.waiting }}
+
Loading
@@ -17,7 +17,6 @@ SPDX-License-Identifier: AGPL-3.0-only
diff --git a/packages/frontend/src/components/MkContextMenu.vue b/packages/frontend/src/components/MkContextMenu.vue
index e877d87021..bd4d6953c3 100644
--- a/packages/frontend/src/components/MkContextMenu.vue
+++ b/packages/frontend/src/components/MkContextMenu.vue
@@ -44,8 +44,8 @@ onMounted(() => {
let left = props.ev.pageX + 1; // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1
let top = props.ev.pageY + 1; // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1
- const width = rootEl.value.offsetWidth;
- const height = rootEl.value.offsetHeight;
+ const width = rootEl.value!.offsetWidth;
+ const height = rootEl.value!.offsetHeight;
if (left + width - window.scrollX >= (window.innerWidth - SCROLLBAR_THICKNESS)) {
left = (window.innerWidth - SCROLLBAR_THICKNESS) - width + window.scrollX;
@@ -63,8 +63,10 @@ onMounted(() => {
left = 0;
}
- rootEl.value.style.top = `${top}px`;
- rootEl.value.style.left = `${left}px`;
+ if (rootEl.value) {
+ rootEl.value.style.top = `${top}px`;
+ rootEl.value.style.left = `${left}px`;
+ }
document.body.addEventListener('mousedown', onMousedown);
});
diff --git a/packages/frontend/src/components/MkCwButton.vue b/packages/frontend/src/components/MkCwButton.vue
index bd74d40793..7b911b8182 100644
--- a/packages/frontend/src/components/MkCwButton.vue
+++ b/packages/frontend/src/components/MkCwButton.vue
@@ -10,6 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
diff --git a/packages/frontend/src/components/MkDialog.vue b/packages/frontend/src/components/MkDialog.vue
index 079496d76e..812703229c 100644
--- a/packages/frontend/src/components/MkDialog.vue
+++ b/packages/frontend/src/components/MkDialog.vue
@@ -31,8 +31,8 @@ SPDX-License-Identifier: AGPL-3.0-only
-
-
+
+
@@ -127,7 +127,7 @@ const selectedValue = ref(props.select?.default ?? null);
const okButtonDisabledReason = computed(() => {
if (props.input) {
if (props.input.minLength) {
- if ((inputValue.value || inputValue.value === '') && (inputValue.value as string).length < props.input.minLength) {
+ if (inputValue.value == null || (inputValue.value as string).length < props.input.minLength) {
return 'charactersBelow';
}
}
diff --git a/packages/frontend/src/components/MkDrive.file.vue b/packages/frontend/src/components/MkDrive.file.vue
index da8583cefa..28ae95d45f 100644
--- a/packages/frontend/src/components/MkDrive.file.vue
+++ b/packages/frontend/src/components/MkDrive.file.vue
@@ -47,7 +47,7 @@ import { i18n } from '@/i18n.js';
import { $i } from '@/account.js';
import { getDriveFileMenu } from '@/scripts/get-drive-file-menu.js';
import { deviceKind } from '@/scripts/device-kind.js';
-import { useRouter } from '@/global/router/supplier.js';
+import { useRouter } from '@/router/supplier.js';
const router = useRouter();
diff --git a/packages/frontend/src/components/MkDrive.folder.vue b/packages/frontend/src/components/MkDrive.folder.vue
index 5eb1fe7a6a..6dd446e5c2 100644
--- a/packages/frontend/src/components/MkDrive.folder.vue
+++ b/packages/frontend/src/components/MkDrive.folder.vue
@@ -205,7 +205,7 @@ function onDragend() {
}
function go() {
- emit('move', props.folder.id);
+ emit('move', props.folder);
}
function rename() {
diff --git a/packages/frontend/src/components/MkDrive.vue b/packages/frontend/src/components/MkDrive.vue
index 799cc3abde..3d3a61583c 100644
--- a/packages/frontend/src/components/MkDrive.vue
+++ b/packages/frontend/src/components/MkDrive.vue
@@ -98,6 +98,7 @@ SPDX-License-Identifier: AGPL-3.0-only
import { nextTick, onActivated, onBeforeUnmount, onMounted, ref, shallowRef, watch } from 'vue';
import * as Misskey from 'cherrypick-js';
import MkButton from './MkButton.vue';
+import type { MenuItem } from '@/types/menu.js';
import XNavFolder from '@/components/MkDrive.navFolder.vue';
import XFolder from '@/components/MkDrive.folder.vue';
import XFile from '@/components/MkDrive.file.vue';
@@ -427,7 +428,7 @@ function chooseFolder(folderToChoose: Misskey.entities.DriveFolder) {
}
}
-function move(target?: Misskey.entities.DriveFolder) {
+function move(target?: Misskey.entities.DriveFolder | Misskey.entities.DriveFolder['id' | 'parentId']) {
if (!target) {
goRoot();
return;
@@ -613,7 +614,7 @@ function fetchMoreFiles() {
}
function getMenu() {
- return [{
+ const menu: MenuItem[] = [{
type: 'switch',
text: i18n.ts.keepOriginalUploading,
ref: keepOriginal,
@@ -634,7 +635,7 @@ function getMenu() {
}, folder.value ? {
text: i18n.ts.renameFolder,
icon: 'ti ti-forms',
- action: () => { renameFolder(folder.value); },
+ action: () => { if (folder.value) renameFolder(folder.value); },
} : undefined, folder.value ? {
text: i18n.ts.deleteFolder,
icon: 'ti ti-trash',
@@ -644,6 +645,8 @@ function getMenu() {
icon: 'ti ti-folder-plus',
action: () => { createFolder(); },
}];
+
+ return menu;
}
function showMenu(ev: MouseEvent) {
diff --git a/packages/frontend/src/components/MkEmojiPicker.section.vue b/packages/frontend/src/components/MkEmojiPicker.section.vue
index 27fe0873ac..3616e93966 100644
--- a/packages/frontend/src/components/MkEmojiPicker.section.vue
+++ b/packages/frontend/src/components/MkEmojiPicker.section.vue
@@ -27,7 +27,7 @@ SPDX-License-Identifier: AGPL-3.0-only
- (:{{ customEmojiTree.length }} :{{ emojis.length }})
+ (: {{ customEmojiTree?.length }} : {{ emojis.length }})
import { ref, computed, Ref } from 'vue';
-import { i18n } from '../i18n.js';
import { CustomEmojiFolderTree, getEmojiName } from '@/scripts/emojilist.js';
+import { i18n } from '@/i18n.js';
import { customEmojis } from '@/custom-emojis.js';
import MkEmojiPickerSection from '@/components/MkEmojiPicker.section.vue';
@@ -87,7 +87,7 @@ function computeButtonTitle(ev: MouseEvent): void {
elm.title = getEmojiName(emoji) ?? emoji;
}
-function nestedChosen(emoji: any, ev?: MouseEvent) {
+function nestedChosen(emoji: any, ev: MouseEvent) {
emit('chosen', emoji, ev);
}
diff --git a/packages/frontend/src/components/MkEmojiPicker.vue b/packages/frontend/src/components/MkEmojiPicker.vue
index 5772cb8b9f..5100839a67 100644
--- a/packages/frontend/src/components/MkEmojiPicker.vue
+++ b/packages/frontend/src/components/MkEmojiPicker.vue
@@ -37,7 +37,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+