universal-parcel-scraper 0.862.2-main.4627 → 0.862.3-main.4629
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/carriers/j-and-t-uk/statuses.json +1 -0
- package/dist/carriers/ups/status.js +6 -3
- package/dist/carriers/ups/statuses.json +1 -0
- package/dist/providers/shared/result.js +4 -2
- package/dist/providers/status.js +2 -0
- package/dist/server/openapi.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -163,7 +163,7 @@ the command line's `track --source ParcelsApp` does the same.
|
|
|
163
163
|
<!-- GENERATED:stages -->
|
|
164
164
|
<img src="docs/assets/stages.svg" alt="DHL: Die Sendung wurde in das Zustellfahrzeug geladen.; Mondial Relay: En cours de livraison; Correios Brazil: Objeto saiu para entrega ao destinatário; Correos Express: EN REPARTO; Yamato Transport: 配達中; La Poste / Colissimo: DISTOU. All are filed under out_for_delivery." width="760">
|
|
165
165
|
|
|
166
|
-
The carrier folders record 17,
|
|
166
|
+
The carrier folders record 17,897 such statuses, each filed under one stage.
|
|
167
167
|
<!-- /GENERATED:stages -->
|
|
168
168
|
|
|
169
169
|
Wording nobody recorded yet goes through a classifier that reads seven European languages.
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
{"wording": "The parcel arrives at the distribution center and is prepared for transport to the next destination", "stage": "in_transit", "language": "en", "confirmedBy": "live"},
|
|
6
6
|
{"wording": "The parcel is dispatched from the transit center to the next destination", "stage": "in_transit", "language": "en", "confirmedBy": "live"},
|
|
7
7
|
{"wording": "The parcel has been collected and is on its way", "stage": "out_for_delivery", "language": "en", "confirmedBy": "live", "note": "The courier's collection for the delivery round: the reply files it as a delivery scan (派件扫描) with the parcel out for delivery (派件中). The shared rules would read it as transit."},
|
|
8
|
+
{"wording": "The parcel has been successfully delivered to the recipient", "stage": "delivered", "language": "en", "confirmedBy": "live"},
|
|
8
9
|
{"wording": "The delivery address is incomplete or incorrect.", "stage": "failed_attempt", "language": "en", "confirmedBy": "live", "note": "The reply's problem scan (问题件扫描), hours after the parcel went out for delivery on the same day: the round's outcome."}
|
|
9
10
|
]
|
|
10
11
|
}
|
|
@@ -9,13 +9,15 @@ const IN_TRANSIT_TERMS = [
|
|
|
9
9
|
'departed', 'arrived', 'processing at ups facility',
|
|
10
10
|
];
|
|
11
11
|
const PENDING_TERMS = ['label created', 'manifest upload', 'shipment ready for ups'];
|
|
12
|
+
// A delivery still to come, as in "Your package will be delivered one business day later than expected."
|
|
13
|
+
const FUTURE_DELIVERY = /\b(?:will|to) be delivered\b/g;
|
|
12
14
|
/**
|
|
13
15
|
* Classify UPS status prose. `hasEvents` reports that the shipment already has
|
|
14
16
|
* a scan history, which is what makes unrecognized wording "moving" rather
|
|
15
17
|
* than "unknown"; without it an unmapped phrase stays `unknown` on purpose.
|
|
16
18
|
*/
|
|
17
19
|
export function upsStatus(text, hasEvents = false) {
|
|
18
|
-
const value = text.toLocaleLowerCase('en-US');
|
|
20
|
+
const value = text.toLocaleLowerCase('en-US').replace(FUTURE_DELIVERY, ' ');
|
|
19
21
|
if (EXCEPTION_TERMS.some((term) => value.includes(term)))
|
|
20
22
|
return 'exception';
|
|
21
23
|
if (DELIVERED_TERMS.some((term) => value.includes(term)))
|
|
@@ -70,9 +72,10 @@ const ACTIVITY_STAGES = new Map([
|
|
|
70
72
|
// A notice that the package is on its way, without a facility.
|
|
71
73
|
['DA', 'in_transit'],
|
|
72
74
|
// Delays and new delivery plans: a late flight, a possible delay, a new
|
|
73
|
-
// plan, a delivery a day early, a Saturday delivery requested, a day's delay for weather
|
|
75
|
+
// plan, a delivery a day early, a Saturday delivery requested, a day's delay for weather,
|
|
76
|
+
// and a delivery a business day later than expected.
|
|
74
77
|
['18', 'in_transit'], ['Q5', 'in_transit'], ['E3', 'in_transit'], ['2U', 'in_transit'], ['RF', 'in_transit'],
|
|
75
|
-
['DJ', 'in_transit'],
|
|
78
|
+
['DJ', 'in_transit'], ['8Y', 'in_transit'],
|
|
76
79
|
// Address corrections, redirects and receiver requests, including a
|
|
77
80
|
// delivery to an access point that is still pending or only confirmed, and
|
|
78
81
|
// one to the receiver's address instead of the access point.
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
{ "code": "2U", "language": "en", "stage": "in_transit", "confirmedBy": "live", "firstSeen": "2026-10-09", "note": "actCode: \"UPS will be in your area and will deliver your package a day early.\"" },
|
|
29
29
|
{ "code": "RF", "language": "en", "stage": "in_transit", "confirmedBy": "live", "firstSeen": "2026-10-30", "note": "actCode: \"Saturday Delivery has been requested. / Delivery will be rescheduled for Saturday.\" A new delivery plan; the parcel continues." },
|
|
30
30
|
{ "code": "DJ", "language": "en", "stage": "in_transit", "confirmedBy": "live", "firstSeen": "2026-10-30", "note": "actCode: \"Due to weather, your package is delayed by one business day.\" Seen between facility scans; the parcel continues." },
|
|
31
|
+
{ "code": "8Y", "language": "en", "stage": "in_transit", "confirmedBy": "live", "firstSeen": "2026-10-31", "note": "actCode: \"Your package will be delivered one business day later than expected.\" Seen right after a facility scan; the parcel continues." },
|
|
31
32
|
{ "code": "AL", "language": "en", "stage": "in_transit", "confirmedBy": "live", "firstSeen": "2026-10-07", "note": "actCode: UPS corrected the postal code and the parcel continues." },
|
|
32
33
|
{ "code": "HM", "language": "en", "stage": "in_transit", "confirmedBy": "live", "firstSeen": "2026-10-07", "note": "actCode: \"The package has been redirected and forwarded to the delivery center.\"" },
|
|
33
34
|
{ "code": "H6", "language": "en", "stage": "in_transit", "confirmedBy": "live", "firstSeen": "2026-10-07", "note": "actCode: a delivery change request, processed once the parcel is back at the facility." },
|
|
@@ -20,6 +20,7 @@ import { isPostiAbroadLabel } from '../../carriers/posti/identity.js';
|
|
|
20
20
|
import { anPostWordingStage } from '../../carriers/an-post/status.js';
|
|
21
21
|
import { CHRONOPOST_NOTIFICATION } from '../../carriers/chronopost/status.js';
|
|
22
22
|
import { chinaPostRelayedStage } from '../../carriers/china-post/status.js';
|
|
23
|
+
import { postaShqiptareScanStage } from '../../carriers/posta-shqiptare/status.js';
|
|
23
24
|
import { sunYouWording } from '../../carriers/sunyou/identity.js';
|
|
24
25
|
import { ESTIMATE as FLIGHT_ESTIMATE } from '../../carriers/tsjy/status.js';
|
|
25
26
|
import { FLIGHT_BOOKED as DHLINK_FLIGHT } from '../../carriers/dhlink/status.js';
|
|
@@ -602,11 +603,12 @@ function providerWordingStage(description) {
|
|
|
602
603
|
// the pickup point, and sorted again before it goes there.
|
|
603
604
|
if (/^pakken (?:din )?behandles for sending til (?:et )?hentested[.!]?$|^pakken sorteres pa nytt før den sendes til (?:et )?hentested[.!]?$/i.test(value))
|
|
604
605
|
return 'in_transit';
|
|
605
|
-
if (/^warehouse receipt[.!]?$|^(?:package |parcel )?received by (?:the )?warehouse[.!]?$|^received in warehouse[.!]?$|^(?:package|parcel) (?:bulk )?received(?: (?:and|&) scanned)? at (?:the )?warehouse[.!]?$|^we['’]ve got it[.!]?$|^received at evri[.!]?$|^received by our network[.!]?$|^acceptance, sent to [a-z ]+$|^china post has received the mail\b|^envio recogido en origen[.!]?$|^first parcel scan along poste italiane['’]s logistic network\b|已收寄|^仓库收货$|^rfid confirmed pick-?up$|^usps in possession of (?:the )?item\b/i.test(value))
|
|
606
|
+
if (/^warehouse receipt[.!]?$|^(?:package |parcel )?received by (?:the )?warehouse[.!]?$|^received in warehouse[.!]?$|^(?:package|parcel) (?:bulk )?received(?: (?:and|&) scanned)? at (?:the )?warehouse[.!]?$|^we['’]ve got it[.!]?$|^received at evri[.!]?$|^received by our network[.!]?$|^acceptance, sent to [a-z ]+$|^shipment received from (?:the )?sender[.!]?$|^china post has received the mail\b|^envio recogido en origen[.!]?$|^first parcel scan along poste italiane['’]s logistic network\b|已收寄|^仓库收货$|^rfid confirmed pick-?up$|^usps in possession of (?:the )?item\b/i.test(value))
|
|
606
607
|
return 'accepted';
|
|
607
608
|
if (/^goods leave the operation cent(?:er|re)[.!]?$|^the shipment has left (?:the )?origin country[.!]?$|^(?:delivery\. )?your order has been shipped from (?:\d\) )?[a-z ]{1,40} cent(?:er|re)[.!]?$|^nuevo reparto(?:\. concertacion entrega flexible)?[.!]?$|^new delivery, flexible delivery arrangement[.!]?$|^inventory in a warehouse[.!]?$|^hand over to airline[.!]?$|^in lavorazione[.!]?$|^uscita centro postale[.!]?$|^przesyłka w oddziale \w{2,20}[.!]?$|^(?:package |parcel )?(?:left|leaves?|shipped from) the warehouse[.!]?$|^we['’]re processing your parcel at our hub\b|^warehouse\. (?:inbound warehouse|delivery in last mile facilities|ready to hand over to last-mile supplier)[.!]?$|^hand over to last mile[.!]?$|^at destination country\/region[.!]?$|^(?:beladung|entladung)$|^entrance to the terminal from the driver$|^outbou?n?d from pickup terminal to the line ?h[ao]u?l$|^inbound from l?ine ?h[ao]u?l to (?:the )?terminal$|^[\w ]+ warehouse, .{1,80}? processing,? (?:order has been (?:in|out)bounded|assembling operation)$|^received in site[- ]|^exported[.!]?$|^(?:the )?plane has landed[.!]?$|^received by (?:the )?airline[.!]?$|^flight delay(?:ed)?[.!](?:$| the flight scheduled\b)|^wi\s*[–-]\s*intermediate warehouse\. (?:container received|package received at intermediate warehouse)[.!]?$|^delivery branch\. received at distribution branch[.!]?$|^receiving destination mail\. received by distributor[.!]?$|^container reception[.!]?$|(?:邮件|快件)(?:到达|离开)处理中心|航空公司接收|已交承运商运输|已完成分拣|^出口海关\/放行|^启运|^干线中转/i.test(value))
|
|
608
609
|
return 'in_transit';
|
|
609
|
-
|
|
610
|
+
// Posta Shqiptare's Albanian rows, its own and those it relays from the foreign post, as its own map reads them.
|
|
611
|
+
return chinaPostRelayedStage(value) ?? postaShqiptareScanStage(value);
|
|
610
612
|
}
|
|
611
613
|
export function eventStage(description) {
|
|
612
614
|
const classified = classifyEvent(description);
|
package/dist/providers/status.js
CHANGED
|
@@ -35,6 +35,8 @@ const NO_STEP = [
|
|
|
35
35
|
['in progress', 'A heading that names no step.'],
|
|
36
36
|
['sms alert for the addressee - consignment delivery date.', "Česká pošta's text message to the recipient, as aggregators relay it: not a scan."],
|
|
37
37
|
['email alert for the addressee - consignment delivery date.', "Česká pošta's email to the recipient, as aggregators relay it: not a scan."],
|
|
38
|
+
['we have not received the recipient’s phone number', "Posti's notification tool noting it has no phone number to notify the recipient by: not a scan."],
|
|
39
|
+
['we sent the recipient a letter about the item', "Posti's notification tool noting it wrote to the recipient: not a scan."],
|
|
38
40
|
['delivery cannot be changed', "PostNL's note, as ParcelsApp relays it, that the delivery can no longer be changed: not a scan."],
|
|
39
41
|
['pios notice', "PostNL's notice, as ParcelsApp relays it beside its receipt of the shipment, without its content: no step of its own."],
|
|
40
42
|
['update on your parcel', 'A heading that names no step.'],
|
package/dist/server/openapi.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "universal-parcel-scraper",
|
|
3
|
-
"version": "0.862.
|
|
3
|
+
"version": "0.862.3-main.4629",
|
|
4
4
|
"description": "Self-hosted parcel tracking: carrier detection, dedicated scrapers and optional universal providers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|