refactor(backend): User関連のスキーマ/型の指定を強くする (#12808)
* refactor(backend): User関連のスキーマ/型の指定を強くする * refactor(backend): `pack()`の引数にスキーマを指定するように * chore: fix ci * fix: 変更漏れ * fix ci --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
parent
8aea3603a6
commit
2db5b61616
64 changed files with 141 additions and 169 deletions
|
@ -2235,7 +2235,7 @@ type ModerationLog = {
|
|||
id: ID;
|
||||
createdAt: DateString;
|
||||
userId: User['id'];
|
||||
user: UserDetailed | null;
|
||||
user: UserDetailedNotMe | null;
|
||||
} & ({
|
||||
type: 'updateServerSettings';
|
||||
info: ModerationLogPayloads['updateServerSettings'];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* version: 2024.2.0-beta.7
|
||||
* generatedAt: 2024-01-30T11:53:29.839Z
|
||||
* version: 2024.2.0-beta.8
|
||||
* generatedAt: 2024-01-31T01:46:47.964Z
|
||||
*/
|
||||
|
||||
import type { SwitchCaseResponseType } from '../api.js';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* version: 2024.2.0-beta.7
|
||||
* generatedAt: 2024-01-30T11:53:29.837Z
|
||||
* version: 2024.2.0-beta.8
|
||||
* generatedAt: 2024-01-31T01:46:47.962Z
|
||||
*/
|
||||
|
||||
import type {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* version: 2024.2.0-beta.7
|
||||
* generatedAt: 2024-01-30T11:53:29.836Z
|
||||
* version: 2024.2.0-beta.8
|
||||
* generatedAt: 2024-01-31T01:46:47.961Z
|
||||
*/
|
||||
|
||||
import { operations } from './types.js';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* version: 2024.2.0-beta.7
|
||||
* generatedAt: 2024-01-30T11:53:29.835Z
|
||||
* version: 2024.2.0-beta.8
|
||||
* generatedAt: 2024-01-31T01:46:47.959Z
|
||||
*/
|
||||
|
||||
import { components } from './types.js';
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
/* eslint @typescript-eslint/no-explicit-any: 0 */
|
||||
|
||||
/*
|
||||
* version: 2024.2.0-beta.7
|
||||
* generatedAt: 2024-01-30T11:53:29.755Z
|
||||
* version: 2024.2.0-beta.8
|
||||
* generatedAt: 2024-01-31T01:46:47.878Z
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -3761,7 +3761,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
|
||||
|
@ -4164,8 +4164,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: {
|
||||
/**
|
||||
|
@ -4179,7 +4179,7 @@ export type components = {
|
|||
expiresAt: string | null;
|
||||
/** Format: id */
|
||||
muteeId: string;
|
||||
mutee: components['schemas']['UserDetailed'];
|
||||
mutee: components['schemas']['UserDetailedNotMe'];
|
||||
};
|
||||
RenoteMuting: {
|
||||
/**
|
||||
|
@ -4191,7 +4191,7 @@ export type components = {
|
|||
createdAt: string;
|
||||
/** Format: id */
|
||||
muteeId: string;
|
||||
mutee: components['schemas']['UserDetailed'];
|
||||
mutee: components['schemas']['UserDetailedNotMe'];
|
||||
};
|
||||
Blocking: {
|
||||
/**
|
||||
|
@ -4203,7 +4203,7 @@ export type components = {
|
|||
createdAt: string;
|
||||
/** Format: id */
|
||||
blockeeId: string;
|
||||
blockee: components['schemas']['UserDetailed'];
|
||||
blockee: components['schemas']['UserDetailedNotMe'];
|
||||
};
|
||||
Hashtag: {
|
||||
/** @example misskey */
|
||||
|
@ -4823,9 +4823,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;
|
||||
})[];
|
||||
};
|
||||
};
|
||||
|
@ -4880,7 +4880,7 @@ export type operations = {
|
|||
/** @description OK (with results) */
|
||||
200: {
|
||||
content: {
|
||||
'application/json': components['schemas']['User'];
|
||||
'application/json': components['schemas']['MeDetailed'];
|
||||
};
|
||||
};
|
||||
/** @description Client error */
|
||||
|
@ -4985,7 +4985,7 @@ export type operations = {
|
|||
/** @description OK (with results) */
|
||||
200: {
|
||||
content: {
|
||||
'application/json': components['schemas']['User'];
|
||||
'application/json': components['schemas']['UserDetailedNotMe'];
|
||||
};
|
||||
};
|
||||
/** @description Client error */
|
||||
|
@ -8133,7 +8133,7 @@ export type operations = {
|
|||
info: Record<string, never>;
|
||||
/** Format: id */
|
||||
userId: string;
|
||||
user: components['schemas']['UserDetailed'];
|
||||
user: components['schemas']['UserDetailedNotMe'];
|
||||
}[];
|
||||
};
|
||||
};
|
||||
|
@ -18291,7 +18291,7 @@ export type operations = {
|
|||
/** @description OK (with results) */
|
||||
200: {
|
||||
content: {
|
||||
'application/json': components['schemas']['UserDetailed'];
|
||||
'application/json': components['schemas']['MeDetailed'];
|
||||
};
|
||||
};
|
||||
/** @description Client error */
|
||||
|
@ -22951,7 +22951,7 @@ export type operations = {
|
|||
'application/json': {
|
||||
/** Format: misskey:id */
|
||||
id: string;
|
||||
user: components['schemas']['User'];
|
||||
user: components['schemas']['UserDetailed'];
|
||||
}[];
|
||||
};
|
||||
};
|
||||
|
@ -24746,7 +24746,7 @@ export type operations = {
|
|||
createdAt: string;
|
||||
/** Format: misskey:id */
|
||||
userId: string;
|
||||
user: components['schemas']['User'];
|
||||
user: components['schemas']['UserLite'];
|
||||
withReplies: boolean;
|
||||
}[];
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { ModerationLogPayloads } from './consts.js';
|
||||
import { Announcement, EmojiDetailed, MeDetailed, MeDetailedOnly, 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'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue