feat: 凍結されたユーザーのコンテンツを見えないようにする (MisskeyIO#134)

ついでにEntityServiceの型定義、meのoptionalをやめる
This commit is contained in:
まっちゃとーにゅ
2023-08-08 20:13:05 +09:00
committed by GitHub
parent 3b73874196
commit 7f0acd3ea4
70 changed files with 742 additions and 325 deletions

View File

@@ -0,0 +1,58 @@
export const packedAbuseUserReportSchema = {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
comment: {
type: 'string',
optional: false, nullable: false,
},
resolved: {
type: 'boolean',
optional: false, nullable: false,
},
reporterId: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
reporter: {
type: 'object',
ref: 'UserDetailed',
optional: false, nullable: false,
},
targetUserId: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
targetUser: {
type: 'object',
ref: 'UserDetailed',
optional: false, nullable: false,
},
assigneeId: {
type: 'string',
optional: false, nullable: true,
format: 'id',
},
assignee: {
type: 'object',
ref: 'UserDetailed',
optional: true, nullable: true,
},
forwarded: {
type: 'boolean',
optional: false, nullable: false,
},
},
} as const;

View File

@@ -49,3 +49,20 @@ export const packedFlashSchema = {
},
},
} as const;
export const packedFlashLikeSchema = {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
flash: {
type: 'object',
ref: 'Flash',
optional: false, nullable: false,
},
},
} as const;

View File

@@ -34,3 +34,25 @@ export const packedFollowingSchema = {
},
},
} as const;
export const packedFollowRequestSchema = {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
follower: {
type: 'object',
optional: false, nullable: false,
ref: 'UserLite',
},
followee: {
type: 'object',
optional: false, nullable: false,
ref: 'UserLite',
},
},
} as const;

View File

@@ -67,3 +67,20 @@ export const packedGalleryPostSchema = {
},
},
} as const;
export const packedGalleryLikeSchema = {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
post: {
type: 'object',
ref: 'GalleryPost',
optional: false, nullable: false,
},
},
} as const;

View File

@@ -0,0 +1,41 @@
export const packedModerationLogSchema = {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
type: {
type: 'string',
optional: false, nullable: false,
},
info: {
type: 'object',
optional: false, nullable: false,
patternProperties: {
'^': {
type: 'object',
nullable: false, optional: false,
},
},
},
userId: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
user: {
type: 'object',
ref: 'UserDetailed',
optional: false, nullable: false,
},
},
} as const;

View File

@@ -49,3 +49,20 @@ export const packedPageSchema = {
},
},
} as const;
export const packedPageLikeSchema = {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
page: {
type: 'object',
ref: 'Page',
optional: false, nullable: false,
},
},
} as const;

View File

@@ -0,0 +1,103 @@
export const packedRoleSchema = {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
updatedAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
name: {
type: 'string',
optional: false, nullable: false,
},
description: {
type: 'string',
optional: false, nullable: false,
},
color: {
type: 'string',
optional: false, nullable: true,
},
iconUrl: {
type: 'string',
format: 'url',
optional: false, nullable: true,
},
target: {
type: 'string',
optional: false, nullable: false,
enum: ['manual', 'conditional'],
},
condFormula: {
type: 'object',
optional: false, nullable: false,
},
isPublic: {
type: 'boolean',
optional: false, nullable: false,
},
isAdministrator: {
type: 'boolean',
optional: false, nullable: false,
},
isModerator: {
type: 'boolean',
optional: false, nullable: false,
},
isExplorable: {
type: 'boolean',
optional: false, nullable: false,
},
asBadge: {
type: 'boolean',
optional: false, nullable: false,
},
canEditMembersByModerator: {
type: 'boolean',
optional: false, nullable: false,
},
displayOrder: {
type: 'number',
optional: false, nullable: false,
},
policies: {
type: 'object',
optional: false, nullable: false,
patternProperties: {
'^': {
type: 'object',
nullable: false, optional: false,
properties: {
useDefault: {
type: 'boolean',
nullable: false, optional: false,
},
priority: {
type: 'number',
nullable: false, optional: false,
},
value: {
type: 'object',
nullable: false, optional: false,
},
},
},
},
},
usersCount: {
type: 'number',
optional: false, nullable: false,
},
},
} as const;