f
buildCommand(): string[]
command: string,
options?: { attributes?: Record<string, string | number | boolean>; queries?: Record<string, string | number | boolean>; }
Builds a command sentence from structured data
f
commandToWords(cmd: Command): string[]
Builds a command sentence from a Command object
T
Command = { command: string; attributes?: Record<string, string | number | boolean>; queries?: Record<string, string | number | boolean>; }
MikroTik API command structure
-
attributes: Record<string, string | number | boolean>
Optional attributes (e.g., {".id": "ether1", "disabled": "yes"})
-
command: string
The command path (e.g., "/interface/print", "/login")
-
queries: Record<string, string | number | boolean>
Optional query parameters for filtering results
Usage
import * as mod from "protocol/command.ts";