hotfix: repository DI symbol
This commit is contained in:
parent
1345d0e2bd
commit
f82a59d12c
@ -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,
|
||||
|
@ -514,6 +514,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']>(
|
||||
@ -525,6 +526,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']>(
|
||||
|
@ -433,6 +433,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'];
|
||||
@ -442,6 +443,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'];
|
||||
@ -8074,6 +8076,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': {
|
||||
@ -8125,6 +8128,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