mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-11 13:18:11 +09:00
hotfix: repository DI symbol
This commit is contained in:
parent
b856af2cde
commit
c8b35a5c40
@ -17,6 +17,7 @@ export const meta = {
|
||||
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
secure: true,
|
||||
kind: 'write:admin:federation',
|
||||
|
||||
errors: {
|
||||
@ -41,6 +42,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
constructor(
|
||||
@Inject(DI.instancesRepository)
|
||||
private instancesRepository: InstancesRepository,
|
||||
|
||||
@Inject(DI.followingsRepository)
|
||||
private followingsRepository: FollowingsRepository,
|
||||
|
||||
private utilityService: UtilityService,
|
||||
|
@ -5,16 +5,27 @@
|
||||
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import type { FollowingsRepository, UsersRepository } from '@/models/_.js';
|
||||
import type { FollowingsRepository, InstancesRepository, UsersRepository } from '@/models/_.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { QueueService } from '@/core/QueueService.js';
|
||||
import { ApiError } from '@/server/api/error.js';
|
||||
import { UtilityService } from '@/core/UtilityService.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
secure: true,
|
||||
kind: 'write:admin:federation',
|
||||
|
||||
errors: {
|
||||
instanceNotFound: {
|
||||
message: 'Instance with that hostname is not found.',
|
||||
code: 'INSTANCE_NOT_FOUND',
|
||||
id: '82791415-ae4b-4e82-bffe-e3dbc4322a0a',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
@ -34,9 +45,19 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
@Inject(DI.notesRepository)
|
||||
private followingsRepository: FollowingsRepository,
|
||||
|
||||
@Inject(DI.instancesRepository)
|
||||
private instancesRepository: InstancesRepository,
|
||||
|
||||
private queueService: QueueService,
|
||||
private utilityService: UtilityService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
const instance = await this.instancesRepository.findOneBy({ host: this.utilityService.toPuny(ps.host) });
|
||||
|
||||
if (instance == null) {
|
||||
throw new ApiError(meta.errors.instanceNotFound);
|
||||
}
|
||||
|
||||
const followings = await this.followingsRepository.findBy({
|
||||
followerHost: ps.host,
|
||||
});
|
||||
|
@ -23,9 +23,8 @@ export const paramDef = {
|
||||
required: ['userId'],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
@Injectable()
|
||||
export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
|
||||
constructor(
|
||||
@Inject(DI.usersRepository)
|
||||
private usersRepository: UsersRepository,
|
||||
|
@ -503,6 +503,7 @@ declare module '../api.js' {
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:federation*
|
||||
*/
|
||||
request<E extends 'admin/federation/refresh-remote-instance-metadata', P extends Endpoints[E]['req']>(
|
||||
@ -514,6 +515,7 @@ declare module '../api.js' {
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:federation*
|
||||
*/
|
||||
request<E extends 'admin/federation/remove-all-following', P extends Endpoints[E]['req']>(
|
||||
|
@ -424,6 +424,7 @@ export type paths = {
|
||||
* admin/federation/refresh-remote-instance-metadata
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:federation*
|
||||
*/
|
||||
post: operations['admin___federation___refresh-remote-instance-metadata'];
|
||||
@ -433,6 +434,7 @@ export type paths = {
|
||||
* admin/federation/remove-all-following
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:federation*
|
||||
*/
|
||||
post: operations['admin___federation___remove-all-following'];
|
||||
@ -8001,6 +8003,7 @@ export type operations = {
|
||||
* admin/federation/refresh-remote-instance-metadata
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:federation*
|
||||
*/
|
||||
'admin___federation___refresh-remote-instance-metadata': {
|
||||
@ -8052,6 +8055,7 @@ export type operations = {
|
||||
* admin/federation/remove-all-following
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:federation*
|
||||
*/
|
||||
'admin___federation___remove-all-following': {
|
||||
|
Loading…
Reference in New Issue
Block a user