2023-02-16 23:09:41 +09:00
|
|
|
import { Injectable } from '@nestjs/common';
|
2022-09-18 03:27:08 +09:00
|
|
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
2022-12-04 10:16:03 +09:00
|
|
|
import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js';
|
2022-09-24 07:15:16 +09:00
|
|
|
import { GetterService } from '@/server/api/GetterService.js';
|
2019-01-26 17:53:35 +09:00
|
|
|
|
|
|
|
export const meta = {
|
2021-04-23 12:05:15 +09:00
|
|
|
tags: ['federation'],
|
2019-02-23 11:20:58 +09:00
|
|
|
|
2022-01-18 22:27:10 +09:00
|
|
|
requireCredential: true,
|
2022-02-19 14:05:32 +09:00
|
|
|
} as const;
|
2019-01-26 17:53:35 +09:00
|
|
|
|
2022-02-20 13:15:40 +09:00
|
|
|
export const paramDef = {
|
2022-02-19 14:05:32 +09:00
|
|
|
type: 'object',
|
|
|
|
properties: {
|
|
|
|
userId: { type: 'string', format: 'misskey:id' },
|
2021-12-09 23:58:30 +09:00
|
|
|
},
|
2022-02-19 14:05:32 +09:00
|
|
|
required: ['userId'],
|
2022-01-18 22:27:10 +09:00
|
|
|
} as const;
|
2019-01-26 17:53:35 +09:00
|
|
|
|
2022-01-03 02:12:50 +09:00
|
|
|
// eslint-disable-next-line import/no-default-export
|
2022-09-18 03:27:08 +09:00
|
|
|
@Injectable()
|
|
|
|
export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|
|
|
constructor(
|
|
|
|
private getterService: GetterService,
|
|
|
|
private apPersonService: ApPersonService,
|
|
|
|
) {
|
|
|
|
super(meta, paramDef, async (ps) => {
|
|
|
|
const user = await this.getterService.getRemoteUser(ps.userId);
|
|
|
|
await this.apPersonService.updatePerson(user.uri!);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|