iceshrimp-legacy/packages/backend/src/server/api/endpoints/admin/relays/list.ts
ThatOneCalculator 6b00abf05c
refactor: 🎨 rome
2023-01-12 20:40:33 -08:00

53 lines
965 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();
});