Remnawave_Node/libs/contract/models/node-system.schema.ts
kastov 9cd01fce62
Some checks failed
Build & Push Docker Image / Send TG message (push) Has been cancelled
Build & Push Docker Image / Build linux/amd64 (push) Has been cancelled
Build & Push Docker Image / Build linux/arm64 (push) Has been cancelled
Deploy lib / Send Telegram message (push) Has been cancelled
Deploy lib / build (push) Has been cancelled
Build & Push Docker Image / Merge & push manifest (push) Has been cancelled
Build & Push Docker Image / Send TG message-1 (push) Has been cancelled
Build & Push Docker Image / notify-on-error (push) Has been cancelled
Deploy lib / Send Telegram message-1 (push) Has been cancelled
Deploy lib / notify-on-error (push) Has been cancelled
chore: upgrade zod
2026-07-04 17:38:39 +03:00

41 lines
1.1 KiB
TypeScript

import { z } from 'zod';
export const NetworkInterfaceSchema = z.object({
interface: z.string(),
rxBytesPerSec: z.number(),
txBytesPerSec: z.number(),
rxTotal: z.number(),
txTotal: z.number(),
});
export const NodeSystemInfoSchema = z.object({
arch: z.string(),
cpus: z.int(),
cpuModel: z.string(),
memoryTotal: z.number(),
hostname: z.string(),
platform: z.string(),
release: z.string(),
type: z.string(),
version: z.string(),
networkInterfaces: z.array(z.string()),
});
export const NodeSystemStatsSchema = z.object({
memoryFree: z.number(),
memoryUsed: z.number(),
uptime: z.number(),
loadAvg: z.array(z.number()),
interface: z.nullable(NetworkInterfaceSchema),
});
export type TNodeSystemStats = z.infer<typeof NodeSystemStatsSchema>;
export const NodeSystemSchema = z.object({
info: NodeSystemInfoSchema,
stats: NodeSystemStatsSchema,
});
export type TNetworkInterface = z.infer<typeof NetworkInterfaceSchema>;
export type TNodeSystemInfo = z.infer<typeof NodeSystemInfoSchema>;
export type TNodeSystem = z.infer<typeof NodeSystemSchema>;