UNPKG

@tak-ps/node-tak

Version:

Lightweight JavaScript library for communicating with TAK Server

27 lines 772 B
import Commands from '../commands.js'; import { Type } from '@sinclair/typebox'; export const LocateGenerateInput = Type.Object({ latitude: Type.Number(), longitude: Type.Number(), name: Type.String(), remarks: Type.String() }); export default class LocateCommands extends Commands { schema = {}; async cli() { throw new Error('Unsupported Subcommand'); } async generate(query) { const url = new URL(`/locate/api`, this.api.url); let q; for (q in query) { if (query[q] !== undefined) { url.searchParams.append(q, String(query[q])); } } return await this.api.fetch(url, { method: 'POST' }); } } //# sourceMappingURL=locate.js.map