Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #81 from sunznx/feature/add_tracking_numbers
Browse files Browse the repository at this point in the history
add more tracking fields
  • Loading branch information
Bossa573 authored May 7, 2022
2 parents 8d9f2d5 + 9f5e6dd commit 9c27541
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 75 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "aftership",
"description": "node.js SDK for AfterShip API",
"version": "7.0.3",
"version": "7.0.4",
"homepage": "https://github.com/aftership/aftership-sdk-nodejs",
"author": {
"name": "AfterShip",
Expand Down
178 changes: 104 additions & 74 deletions src/model/tracking/tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,55 +11,25 @@ export interface Tracking {
* Hash describes the tracking information.
*/
tracking?: {
/**
* Date and time of the tracking created.
*/
created_at?: string;

/**
* Date and time of the tracking last updated.
*/
updated_at?: string;

/**
* A unique identifier generated by AfterShip for the tracking.
*/
id?: string;

/**
* The postal code of receiver's address. Required by some couriers, such asdeutsch-post
*/
tracking_postal_code?: string;

/**
* Shipping date inYYYYMMDDformat. Required by some couriers, such asdeutsch-post
*/
tracking_ship_date?: string;

/**
* Account number of the shipper for a specific courier. Required by some couriers, such asdynamic-logistics
*/
tracking_account_number?: string;

/**
* Origin Country of the shipment for a specific courier. Required by some couriers, such asdhl
*/
tracking_origin_country?: string;

/**
* Destination Country of the shipment for a specific courier. Required by some couriers, such aspostnl-3s
* Date and time of the tracking created.
*/
tracking_destination_country?: string;
created_at?: string;

/**
* Located state of the shipment for a specific courier. Required by some couriers, such asstar-track-courier
* Date and time of the tracking last updated.
*/
tracking_state?: string;
updated_at?: string;

/**
* Key of the shipment for a specific courier. Required by some couriers, such assic-teliway
* Date and time the tracking was last updated
*/
tracking_key?: string;
last_updated_at?: string;

/**
* Tracking number.
Expand Down Expand Up @@ -108,6 +78,11 @@ export interface Tracking {
*/
destination_country_iso3?: string;

/**
* Shipping address that the shipment is shipping to.
*/
destination_raw_location?: string;

/**
* Destination country of the tracking detected from the courier.
* ISO Alpha-3 (three letters). Value will be null if the courier doesn't provide the destination country.
Expand All @@ -131,6 +106,11 @@ export interface Tracking {
*/
ios?: string | [string];

/**
* Text field for the note.
*/
note?: string;

/**
* Text field for order ID
*/
Expand All @@ -141,11 +121,6 @@ export interface Tracking {
*/
order_id_path?: string;

/**
* Text field for order number
*/
order_number?: string;

/**
* Date and time of the order created
*/
Expand All @@ -156,37 +131,11 @@ export interface Tracking {
*/
origin_country_iso3?: string;

/**
* The token to generate the direct tracking link:
* https://yourusername.aftership.com/unique_token or https://www.aftership.com/unique_token
*/
unique_token?: string;

/**
* Number of packages under the tracking (if any).
*/
shipment_package_count?: number;

/**
* Shipment type provided by carrier (if any).
*/
shipment_type?: string;

/**
* Shipment weight provied by carrier (if any)
*/
shipment_weight?: number;

/**
* Weight unit provied by carrier, either in kg or lb (if any)
*/
shipment_weight_unit?: string;

/**
* Date and time the tracking was last updated
*/
last_updated_at?: string;

/**
* Date and time the tracking was picked up
*/
Expand All @@ -198,14 +147,19 @@ export interface Tracking {
shipment_delivery_date?: string;

/**
* Phone number(s) subscribed to receive sms notifications. Comma separated for multiple values
* Shipment type provided by carrier (if any).
*/
subscribed_smses?: [string];
shipment_type?: string;

/**
* Email address(es) subscribed to receive email notifications. Comma separated for multiple values
* Shipment weight provied by carrier (if any)
*/
subscribed_emails?: [string];
shipment_weight?: number;

/**
* Weight unit provied by carrier, either in kg or lb (if any)
*/
shipment_weight_unit?: string;

/**
* Signed by information for delivered shipment (if any).
Expand Down Expand Up @@ -263,6 +217,27 @@ export interface Tracking {
*/
language?: string | null;

/**
* The token to generate the direct tracking link:
* https://yourusername.aftership.com/unique_token or https://www.aftership.com/unique_token
*/
unique_token?: string;

/**
* Array of Hash describes the checkpoint information.
*/
checkpoints?: [Checkpoint];

/**
* Phone number(s) subscribed to receive sms notifications. Comma separated for multiple values
*/
subscribed_smses?: [string];

/**
* Email address(es) subscribed to receive email notifications. Comma separated for multiple values
*/
subscribed_emails?: [string];

/**
* Whether or not the shipment is returned to sender.
* Value istruewhen any of its checkpoints has subtagException_010(returning to sender)
Expand Down Expand Up @@ -299,16 +274,71 @@ export interface Tracking {
* date and time of the first attempt by the carrier to deliver the package to the addressee
* Available format:YYYY-MM-DDTHH:MM:SS, or YYYY-MM-DDTHH:MM:SS+TIMEZONE
*/
first_attempted_at?: string | null;
first_attempted_at?: string;

/**
* Array of Hash describes the checkpoint information.
* Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier.
*/
checkpoints?: [Checkpoint];
courier_redirect_link?: string;

/**
* Account number of the shipper for a specific courier. Required by some couriers, such asdynamic-logistics
*/
tracking_account_number?: string;

/**
* Origin Country of the shipment for a specific courier. Required by some couriers, such asdhl
*/
tracking_origin_country?: string;

/**
* Destination Country of the shipment for a specific courier. Required by some couriers, such aspostnl-3s
*/
tracking_destination_country?: string;

/**
* Key of the shipment for a specific courier. Required by some couriers, such assic-teliway
*/
tracking_key?: string;

/**
* The postal code of receiver's address. Required by some couriers, such asdeutsch-post
*/
tracking_postal_code?: string;

/**
* Shipping date inYYYYMMDDformat. Required by some couriers, such asdeutsch-post
*/
tracking_ship_date?: string;

/**
* Located state of the shipment for a specific courier. Required by some couriers, such asstar-track-courier
*/
tracking_state?: string;

/**
* Whether the tracking is delivered on time or not.
*/
on_time_status?: string;

/**
* The difference days of the on time.
*/
on_time_difference?: number;

/**
* The tags of the order.
*/
order_tags?: [string];

/**
* Estimated delivery time of the shipment provided by AfterShip, indicate when the shipment should arrive.
*/
aftership_estimated_delivery_date?: EstimatedDeliveryDate;

/**
* Text field for order number
*/
order_number?: string;
};
}

0 comments on commit 9c27541

Please sign in to comment.