UNPKG

@geoapify/route-planner-sdk

Version:

TypeScript SDK for the Geoapify Route Planner API. Supports route optimization, delivery planning, and timeline visualization in browser and Node.js

29 lines (28 loc) 668 B
import { RouteAction } from "./route-action"; import { AgentSolution } from "./agent-solution"; import { Job } from "../input/job"; export class JobSolution { constructor(raw) { if (raw) { this.raw = raw; } else { throw new Error("JobSolutionData is undefined"); } } getRaw() { return this.raw; } getAgentId() { return this.raw.agentId; } getActions() { return this.raw.actions.map((action) => new RouteAction(action)); } getAgent() { return new AgentSolution(this.raw.agent); } getJob() { return new Job(this.raw.job); } }