mirror of
https://github.com/hotomoe/hotomoe
synced 2025-01-19 16:22:51 +09:00
hotfix: repository DI symbol
This commit is contained in:
parent
b856af2cde
commit
c8b35a5c40
@ -17,6 +17,7 @@ export const meta = {
|
|||||||
|
|
||||||
requireCredential: true,
|
requireCredential: true,
|
||||||
requireAdmin: true,
|
requireAdmin: true,
|
||||||
|
secure: true,
|
||||||
kind: 'write:admin:federation',
|
kind: 'write:admin:federation',
|
||||||
|
|
||||||
errors: {
|
errors: {
|
||||||
@ -41,6 +42,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
constructor(
|
constructor(
|
||||||
@Inject(DI.instancesRepository)
|
@Inject(DI.instancesRepository)
|
||||||
private instancesRepository: InstancesRepository,
|
private instancesRepository: InstancesRepository,
|
||||||
|
|
||||||
|
@Inject(DI.followingsRepository)
|
||||||
private followingsRepository: FollowingsRepository,
|
private followingsRepository: FollowingsRepository,
|
||||||
|
|
||||||
private utilityService: UtilityService,
|
private utilityService: UtilityService,
|
||||||
|
@ -5,16 +5,27 @@
|
|||||||
|
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
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 { DI } from '@/di-symbols.js';
|
||||||
import { QueueService } from '@/core/QueueService.js';
|
import { QueueService } from '@/core/QueueService.js';
|
||||||
|
import { ApiError } from '@/server/api/error.js';
|
||||||
|
import { UtilityService } from '@/core/UtilityService.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ['admin'],
|
tags: ['admin'],
|
||||||
|
|
||||||
requireCredential: true,
|
requireCredential: true,
|
||||||
requireAdmin: true,
|
requireAdmin: true,
|
||||||
|
secure: true,
|
||||||
kind: 'write:admin:federation',
|
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;
|
} as const;
|
||||||
|
|
||||||
export const paramDef = {
|
export const paramDef = {
|
||||||
@ -34,9 +45,19 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
@Inject(DI.notesRepository)
|
@Inject(DI.notesRepository)
|
||||||
private followingsRepository: FollowingsRepository,
|
private followingsRepository: FollowingsRepository,
|
||||||
|
|
||||||
|
@Inject(DI.instancesRepository)
|
||||||
|
private instancesRepository: InstancesRepository,
|
||||||
|
|
||||||
private queueService: QueueService,
|
private queueService: QueueService,
|
||||||
|
private utilityService: UtilityService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
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({
|
const followings = await this.followingsRepository.findBy({
|
||||||
followerHost: ps.host,
|
followerHost: ps.host,
|
||||||
});
|
});
|
||||||
|
@ -23,9 +23,8 @@ export const paramDef = {
|
|||||||
required: ['userId'],
|
required: ['userId'],
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-default-export
|
|
||||||
@Injectable()
|
@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(
|
constructor(
|
||||||
@Inject(DI.usersRepository)
|
@Inject(DI.usersRepository)
|
||||||
private usersRepository: UsersRepository,
|
private usersRepository: UsersRepository,
|
||||||
|
@ -503,6 +503,7 @@ declare module '../api.js' {
|
|||||||
/**
|
/**
|
||||||
* No description provided.
|
* 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*
|
* **Credential required**: *Yes* / **Permission**: *write:admin:federation*
|
||||||
*/
|
*/
|
||||||
request<E extends 'admin/federation/refresh-remote-instance-metadata', P extends Endpoints[E]['req']>(
|
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.
|
* 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*
|
* **Credential required**: *Yes* / **Permission**: *write:admin:federation*
|
||||||
*/
|
*/
|
||||||
request<E extends 'admin/federation/remove-all-following', P extends Endpoints[E]['req']>(
|
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
|
* admin/federation/refresh-remote-instance-metadata
|
||||||
* @description No description provided.
|
* @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*
|
* **Credential required**: *Yes* / **Permission**: *write:admin:federation*
|
||||||
*/
|
*/
|
||||||
post: operations['admin___federation___refresh-remote-instance-metadata'];
|
post: operations['admin___federation___refresh-remote-instance-metadata'];
|
||||||
@ -433,6 +434,7 @@ export type paths = {
|
|||||||
* admin/federation/remove-all-following
|
* admin/federation/remove-all-following
|
||||||
* @description No description provided.
|
* @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*
|
* **Credential required**: *Yes* / **Permission**: *write:admin:federation*
|
||||||
*/
|
*/
|
||||||
post: operations['admin___federation___remove-all-following'];
|
post: operations['admin___federation___remove-all-following'];
|
||||||
@ -8001,6 +8003,7 @@ export type operations = {
|
|||||||
* admin/federation/refresh-remote-instance-metadata
|
* admin/federation/refresh-remote-instance-metadata
|
||||||
* @description No description provided.
|
* @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*
|
* **Credential required**: *Yes* / **Permission**: *write:admin:federation*
|
||||||
*/
|
*/
|
||||||
'admin___federation___refresh-remote-instance-metadata': {
|
'admin___federation___refresh-remote-instance-metadata': {
|
||||||
@ -8052,6 +8055,7 @@ export type operations = {
|
|||||||
* admin/federation/remove-all-following
|
* admin/federation/remove-all-following
|
||||||
* @description No description provided.
|
* @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*
|
* **Credential required**: *Yes* / **Permission**: *write:admin:federation*
|
||||||
*/
|
*/
|
||||||
'admin___federation___remove-all-following': {
|
'admin___federation___remove-all-following': {
|
||||||
|
Loading…
Reference in New Issue
Block a user