mirror of
https://github.com/remnawave/node.git
synced 2026-10-22 10:51:39 +00:00
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { z } from 'zod';
|
|
|
|
import { REST_API } from '../../api';
|
|
import { NodeMetadataSchema, NodeSystemSchema } from '../../models';
|
|
|
|
export namespace StartXrayCommand {
|
|
export const url = REST_API.XRAY.START;
|
|
export const RequestSchema = z.object({
|
|
internals: z.object({
|
|
metadata: NodeMetadataSchema.optional(),
|
|
integrations: z.record(z.string(), z.unknown()).optional(),
|
|
forceRestart: z.boolean().default(false),
|
|
hashes: z.object({
|
|
emptyConfig: z.string(),
|
|
inbounds: z.array(
|
|
z.object({
|
|
usersCount: z.number(),
|
|
hash: z.string(),
|
|
tag: z.string(),
|
|
}),
|
|
),
|
|
}),
|
|
}),
|
|
xrayConfig: z.record(z.string(), z.unknown()),
|
|
});
|
|
|
|
export type Request = z.infer<typeof RequestSchema>;
|
|
|
|
export const ResponseSchema = z.object({
|
|
response: z.object({
|
|
isStarted: z.boolean(),
|
|
version: z.string().nullable(),
|
|
error: z.string().nullable(),
|
|
nodeInformation: z.object({
|
|
version: z.string().nullable(),
|
|
}),
|
|
system: NodeSystemSchema,
|
|
}),
|
|
});
|
|
|
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
}
|