UNPKG

@geoapify/route-planner-sdk

Version:

A TypeScript SDK for the Geoapify Route Planner API that simplifies route optimization requests, and helps visualize and edit resulting routes.

52 lines (51 loc) 2.28 kB
import { RoutePlannerResult } from "./models/entities/route-planner-result"; import { Job, Shipment } from "./models"; export declare class RoutePlannerResultEditor { private readonly result; constructor(result: RoutePlannerResult); /** * Assigns a job to an agent. Removes the job if it's currently assigned to another agent * @param agentId - The ID of the agent. * @param jobIds - The IDs of the jobs. * @returns {boolean} - Returns true if the job was successfully assigned. */ assignJobs(agentId: string, jobIds: string[]): Promise<boolean>; /** * Assigns a shipment to an agent. Removes the shipment if it's currently assigned to another agent * @param shipmentIds - The IDs of the shipments. * @param agentId - The ID of the agent. * @returns {boolean} - Returns true if the shipment was successfully assigned. */ assignShipments(agentId: string, shipmentIds: string[]): Promise<boolean>; /** * Removes a job from the plan. * @param jobIds - The IDs of the jobs to remove. * @returns {boolean} - Returns true if the job was successfully removed. */ removeJobs(jobIds: string[]): Promise<boolean>; /** * Removes a shipment from the plan. * @param shipmentIds - The IDs of the shipments to remove. * @returns {boolean} - Returns true if the shipment was successfully removed. */ removeShipments(shipmentIds: string[]): Promise<boolean>; /** * Adds new jobs to an agent's schedule. * @param jobs - An array of job objects to be added. * @param agentId - The ID of the agent. * @returns {boolean} - Returns true if jobs were successfully added. */ addNewJobs(agentId: string, jobs: Job[]): Promise<boolean>; /** * Adds new shipments to an agent's schedule. * @param shipments - An array of shipment objects to be added. * @param agentId - The ID of the agent. * @returns {boolean} - Returns true if shipments were successfully added. */ addNewShipments(agentId: string, shipments: Shipment[]): Promise<boolean>; /** * Returns the modified result. * @returns {RoutePlannerResult} - The modified result object. */ getModifiedResult(): RoutePlannerResult; }