feat: implement create functionality for WapServers across server, sysadmin, and CLI layers

This commit is contained in:
2026-07-30 17:45:45 -03:00
parent 146770a55d
commit cb830fcf01
12 changed files with 167 additions and 16 deletions
+13
View File
@@ -3,6 +3,7 @@ import { getApiHost } from "../helpers/GetApiHost";
import axios from "axios";
import { getPayload } from "../helpers/GetPayload";
import {
CreateWapServerParams,
PaginateWapServerParams,
PaginateWapServerResults,
WapServerAuditResult,
@@ -45,6 +46,18 @@ export class WapService {
return response.data as WapServerAuditResult;
}
public async createWapServer(data: CreateWapServerParams): Promise<IWapServer> {
const nonce = await getSysAdminNonce();
const postData = { ...data, ...{ payload: getPayload(nonce) } };
const response = await axios.post(`${getApiHost()}/sysadmin/wapserver/create`, postData, {
headers: { "Content-Type": "application/json" },
timeout: 5000,
});
return response.data as IWapServer;
}
public async updateWapServer(data: UpdateWapServerParams): Promise<IWapServer> {
const nonce = await getSysAdminNonce();
const postData = { ...data, ...{ payload: getPayload(nonce) } };