feat: implement full CRUD and administrative management endpoints for WAP servers in the sysadmin API

This commit is contained in:
2026-07-28 22:45:26 -03:00
parent 0eb2e91e15
commit 3d8911c093
11 changed files with 2144 additions and 10 deletions
+70
View File
@@ -6,6 +6,7 @@ export type FindWapServerParams = {
description?: string;
countBots?: number;
maxBots?: number;
port?: number;
active?: boolean;
countBotsFrom?: number;
countBotsTo?: number;
@@ -19,9 +20,19 @@ export interface IWapServer {
ipv6: string;
countBots: number;
maxBots: number;
port: number;
active: boolean;
}
export type UpdateWapServerParams = {
serverId: string;
name?: string;
ipv4?: string;
port?: number;
maxBots?: number;
active?: boolean;
};
export type PaginateWapServerParams = FindWapServerParams & {
page: number;
limit: number;
@@ -36,3 +47,62 @@ export type PaginateWapServerResults = {
export type SysAdminGetWapServerParams = PaginateWapServerParams & {
payload: IPayload;
};
export type WapServerByIdParams = {
serverId: string;
};
export type WapServerDeleteResult = {
serverId: string;
deleted: true;
};
export type WapServerOrganizationActionParams = WapServerByIdParams & {
organizationId: string;
};
export type WapServerQrResult = WapServerOrganizationActionParams & {
qr: string;
};
export type WapServerDetachResult = WapServerOrganizationActionParams & {
botDeleted: boolean;
botAlreadyMissing: boolean;
before: number;
after: number;
};
export type WapAssignedOrganization = {
id: string;
name?: string;
};
export type WapContainerDto = {
id?: string;
name?: string;
organizationId?: string;
image?: string;
state?: string;
status?: string;
ports?: unknown[];
created?: number;
};
export type WapServerAuditResult = {
serverId: string;
assignedOrganizations: WapAssignedOrganization[];
detectedBots: WapContainerDto[];
validBots: WapContainerDto[];
ghostBots: WapContainerDto[];
missingBots: WapAssignedOrganization[];
expectedCountBots: number;
storedCountBots: number;
runtimeCountBots: number;
countMismatch: boolean;
};
export type WapServerRecalculateCountResult = {
serverId: string;
before: number;
after: number;
};