Files
node-intellicenter/src/messages/request.ts
Parnic 617c8df511 Add support for tests
I was trying to make a websocket test, but the "ws" library doesn't appear to be easily mocked and I prefer to use it over the built-in WebSocket. So we'll see what I can do in the future.
2025-01-08 21:04:50 -06:00

24 lines
515 B
TypeScript

import { v4 as uuidv4 } from "uuid";
import { ICParam } from "./param.js";
export class ICRequestObj {
public objnam = "";
public keys: string[] = [];
public params?: ICParam;
}
export class ICRequest {
public condition?: string;
public objectList?: ICRequestObj[];
public queryName?: string;
public arguments?: string[] | string;
public command = "";
public messageID = "";
}
export function GetRequest(): ICRequest {
const req = new ICRequest();
req.messageID = uuidv4();
return req;
}