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
|
|
@ -64,7 +64,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
// Publish meUpdated event
|
||||
this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, {
|
||||
detail: true,
|
||||
schema: 'MeDetailed',
|
||||
includeSecrets: true,
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
|
||||
// Publish meUpdated event
|
||||
this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, {
|
||||
detail: true,
|
||||
schema: 'MeDetailed',
|
||||
includeSecrets: true,
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
// Publish meUpdated event
|
||||
this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, {
|
||||
detail: true,
|
||||
schema: 'MeDetailed',
|
||||
includeSecrets: true,
|
||||
}));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
// Publish meUpdated event
|
||||
this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, {
|
||||
detail: true,
|
||||
schema: 'MeDetailed',
|
||||
includeSecrets: true,
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
// Publish meUpdated event
|
||||
this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, {
|
||||
detail: true,
|
||||
schema: 'MeDetailed',
|
||||
includeSecrets: true,
|
||||
}));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
// Publish meUpdated event
|
||||
this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, {
|
||||
detail: true,
|
||||
schema: 'MeDetailed',
|
||||
includeSecrets: true,
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
throw err;
|
||||
});
|
||||
|
||||
return await this.userEntityService.pack<true, true>(me.id, me, {
|
||||
detail: true,
|
||||
return await this.userEntityService.pack(me.id, me, {
|
||||
schema: 'MeDetailed',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
throw err;
|
||||
});
|
||||
|
||||
return await this.userEntityService.pack<true, true>(me.id, me, {
|
||||
detail: true,
|
||||
return await this.userEntityService.pack(me.id, me, {
|
||||
schema: 'MeDetailed',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<typeof meta, typeof paramDef> { // eslint-
|
|||
});
|
||||
|
||||
const iObj = await this.userEntityService.pack(me.id, me, {
|
||||
detail: true,
|
||||
schema: 'MeDetailed',
|
||||
includeSecrets: true,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -446,8 +446,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
verifiedLinks: [],
|
||||
});
|
||||
|
||||
const iObj = await this.userEntityService.pack<true, true>(user.id, user, {
|
||||
detail: true,
|
||||
const iObj = await this.userEntityService.pack(user.id, user, {
|
||||
schema: 'MeDetailed',
|
||||
includeSecrets: isSecure,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue