You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
840 B
TypeScript
36 lines
840 B
TypeScript
import { object, array, string, TypeOf, nativeEnum, union } from "../common/deps/zod.ts";
|
|
import { sig } from "../common/deps/yaypi.ts";
|
|
|
|
export const GetConfigurationResponseV1 = object({
|
|
hosts: array(string()),
|
|
services: array(object({
|
|
name: string(),
|
|
publicUrl: string().optional(),
|
|
})),
|
|
});
|
|
export type GetConfigurationResponseV1 = TypeOf<typeof GetConfigurationResponseV1>;
|
|
|
|
export enum StatusV1 {
|
|
Down = "down",
|
|
Up = "up",
|
|
}
|
|
export const StatusResponseV1 = union([
|
|
nativeEnum(StatusV1),
|
|
object({ error: string() }),
|
|
]);
|
|
export type StatusResponseV1 = TypeOf<typeof StatusResponseV1>;
|
|
|
|
export const api = {
|
|
v1: {
|
|
configuration: {
|
|
get: sig(undefined, GetConfigurationResponseV1),
|
|
},
|
|
host: {
|
|
getStatus: sig(string(), StatusResponseV1),
|
|
},
|
|
service: {
|
|
getStatus: sig(string(), StatusResponseV1),
|
|
},
|
|
},
|
|
};
|