mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-17 07:37:15 +00:00
docs(api): align OpenAPI with runtime contracts (#6409)
Document the cookie-authenticated WebSocket upgrade and its emitted envelopes without exporting pseudo-paths. Align REST response schemas, paged-client filters, and subscription HEAD operations with their runtime implementations, then regenerate frontend and docs artifacts.
This commit is contained in:
@@ -300,6 +300,55 @@ export const EXAMPLES: Record<string, unknown> = {
|
||||
"flowOverride": "",
|
||||
"inboundId": 0
|
||||
},
|
||||
"ClientPageResponse": {
|
||||
"filtered": 47,
|
||||
"groups": [
|
||||
"staff",
|
||||
"trial"
|
||||
],
|
||||
"items": [
|
||||
{
|
||||
"comment": "Primary device",
|
||||
"createdAt": 1735000000000,
|
||||
"email": "alice@example.com",
|
||||
"enable": true,
|
||||
"expiryTime": 1735689600000,
|
||||
"group": "staff",
|
||||
"inboundIds": [
|
||||
3,
|
||||
5
|
||||
],
|
||||
"limitHwid": 0,
|
||||
"limitIp": 0,
|
||||
"reset": 0,
|
||||
"resetDay": 0,
|
||||
"resetMax": 0,
|
||||
"subId": "abcd1234",
|
||||
"totalGB": 53687091200,
|
||||
"traffic": null,
|
||||
"updatedAt": 1735100000000
|
||||
}
|
||||
],
|
||||
"page": 1,
|
||||
"pageSize": 25,
|
||||
"summary": {
|
||||
"active": 1850,
|
||||
"deactive": [
|
||||
"bob@example.com"
|
||||
],
|
||||
"deactiveCount": 150,
|
||||
"depleted": [],
|
||||
"depletedCount": 0,
|
||||
"expiring": [],
|
||||
"expiringCount": 0,
|
||||
"online": [
|
||||
"alice@example.com"
|
||||
],
|
||||
"onlineCount": 1,
|
||||
"total": 2000
|
||||
},
|
||||
"total": 2000
|
||||
},
|
||||
"ClientRecord": {
|
||||
"adTag": "",
|
||||
"allowedIPs": "",
|
||||
@@ -337,6 +386,27 @@ export const EXAMPLES: Record<string, unknown> = {
|
||||
"ClientReverse": {
|
||||
"tag": ""
|
||||
},
|
||||
"ClientSlim": {
|
||||
"comment": "Primary device",
|
||||
"createdAt": 1735000000000,
|
||||
"email": "alice@example.com",
|
||||
"enable": true,
|
||||
"expiryTime": 1735689600000,
|
||||
"group": "staff",
|
||||
"inboundIds": [
|
||||
3,
|
||||
5
|
||||
],
|
||||
"limitHwid": 0,
|
||||
"limitIp": 0,
|
||||
"reset": 0,
|
||||
"resetDay": 0,
|
||||
"resetMax": 0,
|
||||
"subId": "abcd1234",
|
||||
"totalGB": 53687091200,
|
||||
"traffic": null,
|
||||
"updatedAt": 1735100000000
|
||||
},
|
||||
"ClientTraffic": {
|
||||
"down": 2097152,
|
||||
"email": "user1",
|
||||
@@ -355,6 +425,22 @@ export const EXAMPLES: Record<string, unknown> = {
|
||||
"up": 1048576,
|
||||
"uuid": "e18c9a96-71bf-48d4-933f-8b9a46d4290c"
|
||||
},
|
||||
"ClientsSummary": {
|
||||
"active": 1850,
|
||||
"deactive": [
|
||||
"bob@example.com"
|
||||
],
|
||||
"deactiveCount": 150,
|
||||
"depleted": [],
|
||||
"depletedCount": 0,
|
||||
"expiring": [],
|
||||
"expiringCount": 0,
|
||||
"online": [
|
||||
"alice@example.com"
|
||||
],
|
||||
"onlineCount": 1,
|
||||
"total": 2000
|
||||
},
|
||||
"FallbackParentInfo": {
|
||||
"masterId": 0,
|
||||
"path": ""
|
||||
@@ -586,11 +672,38 @@ export const EXAMPLES: Record<string, unknown> = {
|
||||
"wgMtu": 0,
|
||||
"wgPublicKey": ""
|
||||
},
|
||||
"InboundTrafficSummary": {
|
||||
"down": 2097152,
|
||||
"enable": true,
|
||||
"id": 1,
|
||||
"total": 10737418240,
|
||||
"up": 1048576
|
||||
},
|
||||
"LogEntry": {
|
||||
"DateTime": "2025-01-01T12:00:00Z",
|
||||
"Email": "alice@example.com",
|
||||
"Event": 0,
|
||||
"FromAddress": "192.0.2.10:54321",
|
||||
"Inbound": "inbound-443",
|
||||
"Outbound": "direct",
|
||||
"ToAddress": "example.com:443"
|
||||
},
|
||||
"MLDSA65Response": {
|
||||
"seed": "mldsa65-seed",
|
||||
"verify": "mldsa65-verify"
|
||||
},
|
||||
"MLKEM768Response": {
|
||||
"client": "mlkem768-client",
|
||||
"seed": "mlkem768-seed"
|
||||
},
|
||||
"Msg": {
|
||||
"msg": "",
|
||||
"obj": null,
|
||||
"success": false
|
||||
},
|
||||
"NewUUIDResponse": {
|
||||
"uuid": "550e8400-e29b-41d4-a716-446655440000"
|
||||
},
|
||||
"Node": {
|
||||
"activeCount": 23,
|
||||
"address": "node1.example.com",
|
||||
@@ -819,6 +932,13 @@ export const EXAMPLES: Record<string, unknown> = {
|
||||
"strategy": "random",
|
||||
"updatedAt": 1710000000000
|
||||
},
|
||||
"Traffic": {
|
||||
"Down": 2097152,
|
||||
"IsInbound": true,
|
||||
"IsOutbound": false,
|
||||
"Tag": "inbound-443",
|
||||
"Up": 1048576
|
||||
},
|
||||
"User": {
|
||||
"id": 0,
|
||||
"password": "",
|
||||
|
||||
@@ -1245,6 +1245,56 @@ export const SCHEMAS: Record<string, unknown> = {
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ClientPageResponse": {
|
||||
"description": "ClientPageResponse is the shape returned by ListPaged. `Total` is the\nrow count in the DB; `Filtered` is the count after Search/Filter/Protocol\nwere applied, before pagination. The page contains at most PageSize items.\nSummary is computed across the full DB row set so dashboard counters\non the clients page stay stable as the user paginates/filters.",
|
||||
"properties": {
|
||||
"filtered": {
|
||||
"example": 47,
|
||||
"type": "integer"
|
||||
},
|
||||
"groups": {
|
||||
"example": [
|
||||
"staff",
|
||||
"trial"
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"items": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ClientSlim"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"page": {
|
||||
"example": 1,
|
||||
"type": "integer"
|
||||
},
|
||||
"pageSize": {
|
||||
"example": 25,
|
||||
"type": "integer"
|
||||
},
|
||||
"summary": {
|
||||
"$ref": "#/components/schemas/ClientsSummary"
|
||||
},
|
||||
"total": {
|
||||
"example": 2000,
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filtered",
|
||||
"groups",
|
||||
"items",
|
||||
"page",
|
||||
"pageSize",
|
||||
"summary",
|
||||
"total"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ClientRecord": {
|
||||
"properties": {
|
||||
"adTag": {
|
||||
@@ -1394,6 +1444,105 @@ export const SCHEMAS: Record<string, unknown> = {
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ClientSlim": {
|
||||
"description": "ClientSlim is the row-shape used by the clients page. It drops fields the\ntable never reads (UUID, password, auth, flow, security, reverse, tgId)\nso the list payload stays compact even when the panel manages thousands\nof clients. Modals that need the full record still call /get/:email.",
|
||||
"properties": {
|
||||
"comment": {
|
||||
"example": "Primary device",
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"example": 1735000000000,
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"email": {
|
||||
"example": "alice@example.com",
|
||||
"type": "string"
|
||||
},
|
||||
"enable": {
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"expiryTime": {
|
||||
"example": 1735689600000,
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"group": {
|
||||
"example": "staff",
|
||||
"type": "string"
|
||||
},
|
||||
"inboundIds": {
|
||||
"example": [
|
||||
3,
|
||||
5
|
||||
],
|
||||
"items": {
|
||||
"type": "integer"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"limitHwid": {
|
||||
"example": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"limitIp": {
|
||||
"example": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"reset": {
|
||||
"example": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"resetDay": {
|
||||
"example": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"resetMax": {
|
||||
"example": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"subId": {
|
||||
"example": "abcd1234",
|
||||
"type": "string"
|
||||
},
|
||||
"totalGB": {
|
||||
"example": 53687091200,
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"traffic": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ClientTraffic"
|
||||
}
|
||||
],
|
||||
"nullable": true
|
||||
},
|
||||
"updatedAt": {
|
||||
"example": 1735100000000,
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"createdAt",
|
||||
"email",
|
||||
"enable",
|
||||
"expiryTime",
|
||||
"inboundIds",
|
||||
"limitHwid",
|
||||
"limitIp",
|
||||
"reset",
|
||||
"resetDay",
|
||||
"resetMax",
|
||||
"subId",
|
||||
"totalGB",
|
||||
"updatedAt"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ClientTraffic": {
|
||||
"description": "ClientTraffic represents traffic statistics and limits for a specific client.\nIt tracks upload/download usage, expiry times, and online status for inbound clients.",
|
||||
"properties": {
|
||||
@@ -1491,6 +1640,80 @@ export const SCHEMAS: Record<string, unknown> = {
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ClientsSummary": {
|
||||
"description": "ClientsSummary collects per-bucket counts plus the matching email lists so\nthe clients page can render the dashboard stat cards and their hover\npopovers without shipping the full client array. The counters are exact;\nthe lists stop at clientSummaryEmailCap entries and only back the popovers.",
|
||||
"properties": {
|
||||
"active": {
|
||||
"example": 1850,
|
||||
"type": "integer"
|
||||
},
|
||||
"deactive": {
|
||||
"example": [
|
||||
"bob@example.com"
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"deactiveCount": {
|
||||
"example": 150,
|
||||
"type": "integer"
|
||||
},
|
||||
"depleted": {
|
||||
"example": [],
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"depletedCount": {
|
||||
"example": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"expiring": {
|
||||
"example": [],
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"expiringCount": {
|
||||
"example": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"online": {
|
||||
"example": [
|
||||
"alice@example.com"
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"onlineCount": {
|
||||
"example": 1,
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"example": 2000,
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"active",
|
||||
"deactive",
|
||||
"deactiveCount",
|
||||
"depleted",
|
||||
"depletedCount",
|
||||
"expiring",
|
||||
"expiringCount",
|
||||
"online",
|
||||
"onlineCount",
|
||||
"total"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"FallbackParentInfo": {
|
||||
"description": "FallbackParentInfo carries everything the frontend needs to rewrite a\nchild inbound's client link: where to connect (the master's address\nand port) and which path matched on the master's fallbacks array.\nThe frontend already has the master inbound in its dbInbounds list,\nso we only ship identifiers + the match path here.",
|
||||
"properties": {
|
||||
@@ -2337,6 +2560,118 @@ export const SCHEMAS: Record<string, unknown> = {
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"InboundTrafficSummary": {
|
||||
"properties": {
|
||||
"down": {
|
||||
"example": 2097152,
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"enable": {
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"example": 1,
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"example": 10737418240,
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"up": {
|
||||
"example": 1048576,
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"down",
|
||||
"enable",
|
||||
"id",
|
||||
"total",
|
||||
"up"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"LogEntry": {
|
||||
"properties": {
|
||||
"DateTime": {
|
||||
"example": "2025-01-01T12:00:00Z",
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
},
|
||||
"Email": {
|
||||
"example": "alice@example.com",
|
||||
"type": "string"
|
||||
},
|
||||
"Event": {
|
||||
"example": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"FromAddress": {
|
||||
"example": "192.0.2.10:54321",
|
||||
"type": "string"
|
||||
},
|
||||
"Inbound": {
|
||||
"example": "inbound-443",
|
||||
"type": "string"
|
||||
},
|
||||
"Outbound": {
|
||||
"example": "direct",
|
||||
"type": "string"
|
||||
},
|
||||
"ToAddress": {
|
||||
"example": "example.com:443",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"DateTime",
|
||||
"Email",
|
||||
"Event",
|
||||
"FromAddress",
|
||||
"Inbound",
|
||||
"Outbound",
|
||||
"ToAddress"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"MLDSA65Response": {
|
||||
"properties": {
|
||||
"seed": {
|
||||
"example": "mldsa65-seed",
|
||||
"type": "string"
|
||||
},
|
||||
"verify": {
|
||||
"example": "mldsa65-verify",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"seed",
|
||||
"verify"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"MLKEM768Response": {
|
||||
"properties": {
|
||||
"client": {
|
||||
"example": "mlkem768-client",
|
||||
"type": "string"
|
||||
},
|
||||
"seed": {
|
||||
"example": "mlkem768-seed",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"client",
|
||||
"seed"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"Msg": {
|
||||
"properties": {
|
||||
"msg": {
|
||||
@@ -2354,6 +2689,18 @@ export const SCHEMAS: Record<string, unknown> = {
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"NewUUIDResponse": {
|
||||
"properties": {
|
||||
"uuid": {
|
||||
"example": "550e8400-e29b-41d4-a716-446655440000",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"uuid"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"Node": {
|
||||
"description": "Node represents a remote 3x-ui panel registered with the central panel.\nThe central panel polls each node's existing /panel/api/server/status\nendpoint over HTTP using the per-node ApiToken to populate the runtime\nstatus fields below.",
|
||||
"properties": {
|
||||
@@ -3409,6 +3756,41 @@ export const SCHEMAS: Record<string, unknown> = {
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"Traffic": {
|
||||
"description": "Traffic represents network traffic statistics for Xray connections.\nIt tracks upload and download bytes for inbound or outbound traffic.",
|
||||
"properties": {
|
||||
"Down": {
|
||||
"example": 2097152,
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"IsInbound": {
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"IsOutbound": {
|
||||
"example": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"Tag": {
|
||||
"example": "inbound-443",
|
||||
"type": "string"
|
||||
},
|
||||
"Up": {
|
||||
"example": 1048576,
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"Down",
|
||||
"IsInbound",
|
||||
"IsOutbound",
|
||||
"Tag",
|
||||
"Up"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"User": {
|
||||
"description": "User represents a user account in the 3x-ui panel.",
|
||||
"properties": {
|
||||
|
||||
@@ -298,6 +298,16 @@ export interface ClientInbound {
|
||||
inboundId: number;
|
||||
}
|
||||
|
||||
export interface ClientPageResponse {
|
||||
filtered: number;
|
||||
groups: string[];
|
||||
items: ClientSlim[];
|
||||
page: number;
|
||||
pageSize: number;
|
||||
summary: ClientsSummary;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface ClientRecord {
|
||||
adTag: string;
|
||||
allowedIPs: string;
|
||||
@@ -337,6 +347,25 @@ export interface ClientReverse {
|
||||
tag: string;
|
||||
}
|
||||
|
||||
export interface ClientSlim {
|
||||
comment?: string;
|
||||
createdAt: number;
|
||||
email: string;
|
||||
enable: boolean;
|
||||
expiryTime: number;
|
||||
group?: string;
|
||||
inboundIds: number[];
|
||||
limitHwid: number;
|
||||
limitIp: number;
|
||||
reset: number;
|
||||
resetDay: number;
|
||||
resetMax: number;
|
||||
subId: string;
|
||||
totalGB: number;
|
||||
traffic?: ClientTraffic | null;
|
||||
updatedAt: number;
|
||||
}
|
||||
|
||||
export interface ClientTraffic {
|
||||
down: number;
|
||||
email: string;
|
||||
@@ -356,6 +385,19 @@ export interface ClientTraffic {
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
export interface ClientsSummary {
|
||||
active: number;
|
||||
deactive: string[];
|
||||
deactiveCount: number;
|
||||
depleted: string[];
|
||||
depletedCount: number;
|
||||
expiring: string[];
|
||||
expiringCount: number;
|
||||
online: string[];
|
||||
onlineCount: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface FallbackParentInfo {
|
||||
masterId: number;
|
||||
path?: string;
|
||||
@@ -541,12 +583,44 @@ export interface InboundOption {
|
||||
wgPublicKey?: string;
|
||||
}
|
||||
|
||||
export interface InboundTrafficSummary {
|
||||
down: number;
|
||||
enable: boolean;
|
||||
id: number;
|
||||
total: number;
|
||||
up: number;
|
||||
}
|
||||
|
||||
export interface LogEntry {
|
||||
DateTime: string;
|
||||
Email: string;
|
||||
Event: number;
|
||||
FromAddress: string;
|
||||
Inbound: string;
|
||||
Outbound: string;
|
||||
ToAddress: string;
|
||||
}
|
||||
|
||||
export interface MLDSA65Response {
|
||||
seed: string;
|
||||
verify: string;
|
||||
}
|
||||
|
||||
export interface MLKEM768Response {
|
||||
client: string;
|
||||
seed: string;
|
||||
}
|
||||
|
||||
export interface Msg {
|
||||
msg: string;
|
||||
obj: unknown;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
export interface NewUUIDResponse {
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
export interface Node {
|
||||
activeCount: number;
|
||||
address: string;
|
||||
@@ -775,6 +849,14 @@ export interface SubBalancer {
|
||||
updatedAt: number;
|
||||
}
|
||||
|
||||
export interface Traffic {
|
||||
Down: number;
|
||||
IsInbound: boolean;
|
||||
IsOutbound: boolean;
|
||||
Tag: string;
|
||||
Up: number;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
id: number;
|
||||
password: string;
|
||||
|
||||
@@ -321,6 +321,17 @@ export const ClientInboundSchema = z.object({
|
||||
});
|
||||
export type ClientInbound = z.infer<typeof ClientInboundSchema>;
|
||||
|
||||
export const ClientPageResponseSchema = z.object({
|
||||
filtered: z.number().int(),
|
||||
groups: z.array(z.string()),
|
||||
items: z.array(z.lazy(() => ClientSlimSchema)),
|
||||
page: z.number().int(),
|
||||
pageSize: z.number().int(),
|
||||
summary: z.lazy(() => ClientsSummarySchema),
|
||||
total: z.number().int(),
|
||||
});
|
||||
export type ClientPageResponse = z.infer<typeof ClientPageResponseSchema>;
|
||||
|
||||
export const ClientRecordSchema = z.object({
|
||||
adTag: z.string(),
|
||||
allowedIPs: z.string(),
|
||||
@@ -362,6 +373,26 @@ export const ClientReverseSchema = z.object({
|
||||
});
|
||||
export type ClientReverse = z.infer<typeof ClientReverseSchema>;
|
||||
|
||||
export const ClientSlimSchema = z.object({
|
||||
comment: z.string().optional(),
|
||||
createdAt: z.number().int(),
|
||||
email: z.string(),
|
||||
enable: z.boolean(),
|
||||
expiryTime: z.number().int(),
|
||||
group: z.string().optional(),
|
||||
inboundIds: z.array(z.number().int()),
|
||||
limitHwid: z.number().int(),
|
||||
limitIp: z.number().int(),
|
||||
reset: z.number().int(),
|
||||
resetDay: z.number().int(),
|
||||
resetMax: z.number().int(),
|
||||
subId: z.string(),
|
||||
totalGB: z.number().int(),
|
||||
traffic: z.lazy(() => ClientTrafficSchema).nullable().optional(),
|
||||
updatedAt: z.number().int(),
|
||||
});
|
||||
export type ClientSlim = z.infer<typeof ClientSlimSchema>;
|
||||
|
||||
export const ClientTrafficSchema = z.object({
|
||||
down: z.number().int(),
|
||||
email: z.string(),
|
||||
@@ -382,6 +413,20 @@ export const ClientTrafficSchema = z.object({
|
||||
});
|
||||
export type ClientTraffic = z.infer<typeof ClientTrafficSchema>;
|
||||
|
||||
export const ClientsSummarySchema = z.object({
|
||||
active: z.number().int(),
|
||||
deactive: z.array(z.string()),
|
||||
deactiveCount: z.number().int(),
|
||||
depleted: z.array(z.string()),
|
||||
depletedCount: z.number().int(),
|
||||
expiring: z.array(z.string()),
|
||||
expiringCount: z.number().int(),
|
||||
online: z.array(z.string()),
|
||||
onlineCount: z.number().int(),
|
||||
total: z.number().int(),
|
||||
});
|
||||
export type ClientsSummary = z.infer<typeof ClientsSummarySchema>;
|
||||
|
||||
export const FallbackParentInfoSchema = z.object({
|
||||
masterId: z.number().int(),
|
||||
path: z.string().optional(),
|
||||
@@ -581,6 +626,38 @@ export const InboundOptionSchema = z.object({
|
||||
});
|
||||
export type InboundOption = z.infer<typeof InboundOptionSchema>;
|
||||
|
||||
export const InboundTrafficSummarySchema = z.object({
|
||||
down: z.number().int(),
|
||||
enable: z.boolean(),
|
||||
id: z.number().int(),
|
||||
total: z.number().int(),
|
||||
up: z.number().int(),
|
||||
});
|
||||
export type InboundTrafficSummary = z.infer<typeof InboundTrafficSummarySchema>;
|
||||
|
||||
export const LogEntrySchema = z.object({
|
||||
DateTime: z.string(),
|
||||
Email: z.string(),
|
||||
Event: z.number().int(),
|
||||
FromAddress: z.string(),
|
||||
Inbound: z.string(),
|
||||
Outbound: z.string(),
|
||||
ToAddress: z.string(),
|
||||
});
|
||||
export type LogEntry = z.infer<typeof LogEntrySchema>;
|
||||
|
||||
export const MLDSA65ResponseSchema = z.object({
|
||||
seed: z.string(),
|
||||
verify: z.string(),
|
||||
});
|
||||
export type MLDSA65Response = z.infer<typeof MLDSA65ResponseSchema>;
|
||||
|
||||
export const MLKEM768ResponseSchema = z.object({
|
||||
client: z.string(),
|
||||
seed: z.string(),
|
||||
});
|
||||
export type MLKEM768Response = z.infer<typeof MLKEM768ResponseSchema>;
|
||||
|
||||
export const MsgSchema = z.object({
|
||||
msg: z.string(),
|
||||
obj: z.unknown(),
|
||||
@@ -588,6 +665,11 @@ export const MsgSchema = z.object({
|
||||
});
|
||||
export type Msg = z.infer<typeof MsgSchema>;
|
||||
|
||||
export const NewUUIDResponseSchema = z.object({
|
||||
uuid: z.string(),
|
||||
});
|
||||
export type NewUUIDResponse = z.infer<typeof NewUUIDResponseSchema>;
|
||||
|
||||
export const NodeSchema = z.object({
|
||||
activeCount: z.number().int(),
|
||||
address: z.string(),
|
||||
@@ -827,6 +909,15 @@ export const SubBalancerSchema = z.object({
|
||||
});
|
||||
export type SubBalancer = z.infer<typeof SubBalancerSchema>;
|
||||
|
||||
export const TrafficSchema = z.object({
|
||||
Down: z.number().int(),
|
||||
IsInbound: z.boolean(),
|
||||
IsOutbound: z.boolean(),
|
||||
Tag: z.string(),
|
||||
Up: z.number().int(),
|
||||
});
|
||||
export type Traffic = z.infer<typeof TrafficSchema>;
|
||||
|
||||
export const UserSchema = z.object({
|
||||
id: z.number().int(),
|
||||
password: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user