@heuristical/trackit
Version:
This module allows you to connect to many shipping carriers like UPS and FedEx and download tracking data for your packages in a common schema
39 lines (38 loc) • 1.29 kB
TypeScript
import { Builder, Parser } from 'xml2js';
import { ShipperClient, STATUS_TYPES } from './shipper';
declare class UpsClient extends ShipperClient {
private STATUS_MAP;
get licenseNumber(): string;
get userId(): string;
get password(): string;
parser: Parser;
builder: Builder;
/**
* Instantiates a Ups Client
* @param options licenseNumber, userId, password are required
*/
constructor(options: any);
generateRequest(trk: any, reference: any): string;
validateResponse(response: any, cb: any): void;
getEta(shipment: any): Date;
getService(shipment: any): string;
getWeight(shipment: any): any;
presentTimestamp(dateString?: any, timeString?: any): Date;
presentAddress(rawAddress: any): string;
presentStatus(status: any): STATUS_TYPES.UNKNOWN | STATUS_TYPES.UNKNOWN | STATUS_TYPES.SHIPPING | STATUS_TYPES | STATUS_TYPES.DELAYED;
getDestination(shipment: any): string;
getActivitiesAndStatus(shipment: any): {
activities: any[];
status: any;
};
requestOptions({ trackingNumber, reference, test }: {
trackingNumber: any;
reference: any;
test: any;
}): {
method: string;
uri: string;
body: string;
};
}
export { UpsClient };