delivery-tracker
Advanced tools
Comparing version 0.8.5 to 0.9.0
@@ -8,3 +8,3 @@ #! /usr/bin/env node | ||
.arguments('<tracecode>') | ||
.option('-c, --courier <courier>', 'Courier Namespace', /^(KOREAPOST|ECARGO|FEDEX|PANTOS|RINCOS|AUSPOST|ROYALMAIL)$/i) | ||
.option('-c, --courier <courier>', 'Courier Namespace', /^(KOREAPOST|ECARGO|FEDEX|PANTOS|RINCOS|AUSPOST|ROYALMAIL|USPS)$/i) | ||
.action(function (tracecode) { | ||
@@ -11,0 +11,0 @@ if (!tracker.COURIER[program.courier]) { |
@@ -0,1 +1,4 @@ | ||
# 0.9.0 | ||
* added USPS. | ||
# 0.8.5 | ||
@@ -2,0 +5,0 @@ * fixed timeout pantos. |
@@ -58,3 +58,5 @@ 'use strict' | ||
if (['1023369', '1005928', '1122926', '2208358'].indexOf(carrCd) !== -1) { | ||
if (linkedAddr.indexOf('usps.com') !== -1) { | ||
externalCourier = tracker.COURIER.USPS | ||
} else if (['1023369', '1005928', '1122926', '2208358'].indexOf(carrCd) !== -1) { | ||
externalCourier = tracker.COURIER.KOREAPOST | ||
@@ -79,4 +81,3 @@ } else if (trkrSvcCd === 'E' && podNatnCd === 'KR') { | ||
if (refBlNo.length === 22) { | ||
// @TODO | ||
externalCourier = 'USPS' | ||
externalCourier = tracker.COURIER.USPS | ||
} else if (linkedAddr.indexOf('fedex.com') !== -1) { | ||
@@ -227,3 +228,3 @@ externalCourier = tracker.COURIER.FEDEX | ||
result.checkpoints.sort(function (a, b) { | ||
return (+new Date(b.time ? b.estimateTime : b.time)) - (+new Date(a.time ? a.estimateTime : a.time)) | ||
return (+new Date(b.courier.code === tracker.COURIER.PANTOS.CODE && b.time ? b.estimateTime : b.time)) - (+new Date(a.courier.code === tracker.COURIER.PANTOS.CODE && a.time ? a.estimateTime : a.time)) | ||
}) | ||
@@ -230,0 +231,0 @@ } else { |
@@ -36,2 +36,6 @@ 'use strict' | ||
NAME: 'Royal Mail' | ||
}, | ||
USPS: { | ||
CODE: 'usps', | ||
NAME: 'USPS' | ||
} | ||
@@ -38,0 +42,0 @@ } |
{ | ||
"name": "delivery-tracker", | ||
"version": "0.8.5", | ||
"version": "0.9.0", | ||
"author": { | ||
@@ -27,2 +27,3 @@ "name": "egg", | ||
"shipping", | ||
"shipment", | ||
"ems", | ||
@@ -34,3 +35,4 @@ "koreapost", | ||
"auspost", | ||
"australia post" | ||
"australia post", | ||
"usps" | ||
], | ||
@@ -37,0 +39,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37749
17
951