iceshrimp-legacy/packages/backend/src/server/api/endpoints/admin/relays/list.ts
ThatOneCalculator 7c2dabd047
no more eslint
2023-01-12 20:54:33 -08:00

53 lines
913 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;
export default define(meta, paramDef, async (ps, user) => {
return await listRelay();
});