iceshrimp-legacy/packages/backend/src/server/api/endpoints/admin/relays/list.ts
syuilo d071d18dd7
refactor: Use ESM (#8358)
* wip

* wip

* fix

* clean up

* Update tsconfig.json

* Update activitypub.ts

* wip
2022-02-27 11:07:39 +09:00

52 lines
971 B
TypeScript

import define from '../../../define.js';
import { listRelay } from '@/services/relay.js';
export const meta = {
tags: ['admin'],
requireCredential: true,
requireModerator: true,
res: {
type: 'array',
optional: false, nullable: false,
items: {
type: 'object',
optional: false, nullable: false,
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
inbox: {
type: 'string',
optional: false, nullable: false,
format: 'url',
},
status: {
type: 'string',
optional: false, nullable: false,
default: 'requesting',
enum: [
'requesting',
'accepted',
'rejected',
],
},
},
},
},
} as const;
export const paramDef = {
type: 'object',
properties: {},
required: [],
} as const;
// eslint-disable-next-line import/no-default-export
export default define(meta, paramDef, async (ps, user) => {
return await listRelay();
});