universal-parcel-scraper 0.1306.3-main.8723 → 0.1306.5-main.8727
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/dist/browser/scraper.js
CHANGED
|
@@ -63811,7 +63811,7 @@ function xf(e) {
|
|
|
63811
63811
|
if (lf.test(t)) return /\b(?:if|unless|wenn|falls|si|qualora|caso)\b/.test(t) ? void 0 : /\b(?:yet|noch|encore|ancora|todavia|aun|ainda|jeszcze)\b/.test(t) ? uf.test(t) ? "registered" : new RegExp(nf).test(t) ? "ready_for_pickup" : void 0 : "exception";
|
|
63812
63812
|
if (/^picked up (?:at|from) (?:the )?destination airport$/.test(t) || /^(?:flight arrived, )?pallet (?:breakdown|deconsolidation) in progress\.?$/.test(t) || /^weighed at (?:the )?warehouse\.?$|^consolidation completed\.?$|^the warehouse changed the last mile vendor\b/.test(t) || /^(?:the |your )?parcel (?:has been |was )?sent to (?:the )?local [a-z][a-z&' ]{0,40} warehouse for delivery$/.test(t) || /^(?:the |your )?parcel (?:has been |was )?assigned to (?:a |the |your )?delivery driver$/.test(t)) return "in_transit";
|
|
63813
63813
|
if (/\bprise? en charge (?:de )?votre demande\b/.test(t)) return;
|
|
63814
|
-
if (/accepted|(?<!\b(?:be|being) )picked up|pick up was successful|^drop off$|pick ?up scan|prepared the package for return to ups or pickup by ups|handed (?:over )?to (?:dpd|gls)|despatched to couriers ?please\b|package received at dhl|item booked|consignment was mailed|posted at (?:a |the )?(?:postal point|post office)|pris en charge|prise en charge|collecte.*(?:reussi|effectue)|recupere.*boite aux lettres|depose.*point postal|remis a (?:dpd|gls)|envoi.*depose|abholung.*erfolgreich|^(?:die sendung wurde )?erfolgreich abgeholt$|eingeliefert|an (?:dpd|gls) ubergeben|paket.*(?:angenommen|ubernommen)|ritiro.*(?:riuscito|effettuato)|pres[oa] in carico|affidat[oa] a (?:dpd|gls)|depositat.*punto postale|spedizione.*impostata/.test(t) || /^到达收货点|^item received by royal mail$|\btaken over by one of our operators\b|\bwe've received your (?:parcel|package|item) at the parcel ?shop\b|^(?:(?:the |your )?(?:item|parcel|package|shipment) )?(?:was|has been) dropped off at (?:the |a )?parcel ?shop$|^(?![^,]*\b(?:recipient|consignee|receiver|customer|addressee|buyer|pick ?up point|parcel ?shop|locker|destination)\b)[a-z][\w&' -]{0,40} has received the goods(?:, [^,]{1,40}){0,2}\.?$|^the shipment has been deposited at a seur pickup point$|^(?:the |your )?collection (?:has been |was )?(?:carried out|completed)$|^已入库|^(?:(?:the |your )?(?:item|parcel|package|shipment) )?(?:has been |was )?put into storage$/.test(t) || /^(?:the )?(?:shipment|parcel|package|item) (?:has been|was) handed in (?:to|at) (?!.*\breturn)[^.;]{1,80}$/.test(t) || /^sender advised item dropped off at parcel locker$|^dropped off at postbox$/.test(t) || /^(?:the )?shipment has been taken over at the post (?:office|locker) point$/.test(t) || /^spedizione affidata a una fedex location\b/.test(t) || /^die sendung wurde vom absender (?:im|in der|in einem|in einer) (?:[\w-]+ )?(?:paketshop|parcelshop|filiale)\b(?!.*\bnicht\b).*\babgegeben$/.test(t) || /^(?:the |your )?(?:package|parcel|shipment) (?:was|has been) dropped off by the sender at (?:the |a )?(?:hermes )?(?:paketshop|parcel ?shop)\b/.test(t) || /^sending the (?:package|parcel) at the pick ?up point$|^handing over the (?:package|parcel) to the courier$/.test(t)) return "accepted";
|
|
63814
|
+
if (/accepted|(?<!\b(?:be|being) )picked up|pick up was successful|^drop off$|pick ?up scan|prepared the package for return to ups or pickup by ups|handed (?:over )?to (?:dpd|gls)|(?<!\b(?:be|being) )despatched to couriers ?please\b|package received at dhl|item booked|consignment was mailed|posted at (?:a |the )?(?:postal point|post office)|pris en charge|prise en charge|collecte.*(?:reussi|effectue)|recupere.*boite aux lettres|depose.*point postal|remis a (?:dpd|gls)|envoi.*depose|abholung.*erfolgreich|^(?:die sendung wurde )?erfolgreich abgeholt$|eingeliefert|an (?:dpd|gls) ubergeben|paket.*(?:angenommen|ubernommen)|ritiro.*(?:riuscito|effettuato)|pres[oa] in carico|affidat[oa] a (?:dpd|gls)|depositat.*punto postale|spedizione.*impostata/.test(t) || /^到达收货点|^item received by royal mail$|\btaken over by one of our operators\b|\bwe've received your (?:parcel|package|item) at the parcel ?shop\b|^(?:(?:the |your )?(?:item|parcel|package|shipment) )?(?:was|has been) dropped off at (?:the |a )?parcel ?shop$|^(?![^,]*\b(?:recipient|consignee|receiver|customer|addressee|buyer|pick ?up point|parcel ?shop|locker|destination)\b)[a-z][\w&' -]{0,40} has received the goods(?:, [^,]{1,40}){0,2}\.?$|^the shipment has been deposited at a seur pickup point$|^(?:the |your )?collection (?:has been |was )?(?:carried out|completed)$|^已入库|^(?:(?:the |your )?(?:item|parcel|package|shipment) )?(?:has been |was )?put into storage$/.test(t) || /^(?:the )?(?:shipment|parcel|package|item) (?:has been|was) handed in (?:to|at) (?!.*\breturn)[^.;]{1,80}$/.test(t) || /^sender advised item dropped off at parcel locker$|^dropped off at postbox$/.test(t) || /^(?:the )?shipment has been taken over at the post (?:office|locker) point$/.test(t) || /^spedizione affidata a una fedex location\b/.test(t) || /^die sendung wurde vom absender (?:im|in der|in einem|in einer) (?:[\w-]+ )?(?:paketshop|parcelshop|filiale)\b(?!.*\bnicht\b).*\babgegeben$/.test(t) || /^(?:the |your )?(?:package|parcel|shipment) (?:was|has been) dropped off by the sender at (?:the |a )?(?:hermes )?(?:paketshop|parcel ?shop)\b/.test(t) || /^sending the (?:package|parcel) at the pick ?up point$|^handing over the (?:package|parcel) to the courier$/.test(t)) return "accepted";
|
|
63815
63815
|
if (/^warehouse reading$/.test(t) || /^acceptance of the (?:package|parcel) at the delivery branch abroad$/.test(t)) return "in_transit";
|
|
63816
63816
|
if (/^acceptance of the (?:package|parcel) at the pick ?up point$/.test(t) || /^(?:(?:the )?item )?(?:arrival|arrived|receive item) at (?:the )?collection point (?:for pick ?up|waiting for (?:your |the )?collect(?:ion)?)\b/.test(t)) return "ready_for_pickup";
|
|
63817
63817
|
if (/^(?:inward|outward) mc (?:[a-z]+ )?acceptance$/.test(t)) return "in_transit";
|
|
@@ -87,14 +87,18 @@ export function parseDelhivery(payload, number) {
|
|
|
87
87
|
// milestone can have none), so the milestone becomes an event of its own.
|
|
88
88
|
const milestone = clean(state.label, 200);
|
|
89
89
|
const milestoneText = clean(state.date, 64);
|
|
90
|
-
|
|
90
|
+
const milestoneAt = milestone && milestoneText ? milestoneTime(milestoneText, updated) : null;
|
|
91
|
+
const status = milestone ? classifyDelhiveryStatus(milestone) : undefined;
|
|
92
|
+
// A missed delivery takes the index back from "Out for Delivery" to "On the Way". The milestone it
|
|
93
|
+
// leaves past the index keeps a date no later than the status: reached, unlike the rail's. A
|
|
94
|
+
// delivered one is never read so.
|
|
95
|
+
const left = index > reached && milestoneAt !== null && status?.stage !== 'delivered';
|
|
96
|
+
if ((index <= reached || left) && milestone && milestoneText
|
|
91
97
|
&& !scans.some(scan => isRecord(scan) && clean(scan.scanDateTime, 64))) {
|
|
92
|
-
const time = milestoneTime(milestoneText, updated);
|
|
93
|
-
const status = classifyDelhiveryStatus(milestone);
|
|
94
98
|
const classified = item.currentFlow === 'Reverse' && status?.stage === 'delivered' ? classifyDelhiveryStatus('RTO DELIVERED') : status;
|
|
95
|
-
if (classified?.stage === 'delivered' &&
|
|
96
|
-
deliveredAt =
|
|
97
|
-
events.push({ description: milestone, ...(
|
|
99
|
+
if (classified?.stage === 'delivered' && milestoneAt && (!deliveredAt || milestoneAt.timestamp > deliveredAt.timestamp))
|
|
100
|
+
deliveredAt = milestoneAt;
|
|
101
|
+
events.push({ description: milestone, ...(milestoneAt ? { time: milestoneAt.iso } : { provider_time_text: milestoneText }),
|
|
98
102
|
...(classified ? { stage: classified.stage } : {}), ...(item.currentFlow === 'Reverse' ? { provider_leg: 'return' } : {}) });
|
|
99
103
|
}
|
|
100
104
|
if (state.scans === undefined || state.scans === null)
|
|
@@ -1065,7 +1065,7 @@ export function trackingLanguageStage(description) {
|
|
|
1065
1065
|
// A pickup still to come ("will be picked up") is not one either.
|
|
1066
1066
|
// A sender's despatch to Couriers Please, as ParcelsApp relays it hours before Couriers Please's first facility scan, is
|
|
1067
1067
|
// its hand-over to that carrier, as one to DPD or GLS is.
|
|
1068
|
-
if (/accepted|(?<!\b(?:be|being) )picked up|pick up was successful|^drop off$|pick ?up scan|prepared the package for return to ups or pickup by ups|handed (?:over )?to (?:dpd|gls)|despatched to couriers ?please\b|package received at dhl|item booked|consignment was mailed|posted at (?:a |the )?(?:postal point|post office)|pris en charge|prise en charge|collecte.*(?:reussi|effectue)|recupere.*boite aux lettres|depose.*point postal|remis a (?:dpd|gls)|envoi.*depose|abholung.*erfolgreich|^(?:die sendung wurde )?erfolgreich abgeholt$|eingeliefert|an (?:dpd|gls) ubergeben|paket.*(?:angenommen|ubernommen)|ritiro.*(?:riuscito|effettuato)|pres[oa] in carico|affidat[oa] a (?:dpd|gls)|depositat.*punto postale|spedizione.*impostata/.test(text))
|
|
1068
|
+
if (/accepted|(?<!\b(?:be|being) )picked up|pick up was successful|^drop off$|pick ?up scan|prepared the package for return to ups or pickup by ups|handed (?:over )?to (?:dpd|gls)|(?<!\b(?:be|being) )despatched to couriers ?please\b|package received at dhl|item booked|consignment was mailed|posted at (?:a |the )?(?:postal point|post office)|pris en charge|prise en charge|collecte.*(?:reussi|effectue)|recupere.*boite aux lettres|depose.*point postal|remis a (?:dpd|gls)|envoi.*depose|abholung.*erfolgreich|^(?:die sendung wurde )?erfolgreich abgeholt$|eingeliefert|an (?:dpd|gls) ubergeben|paket.*(?:angenommen|ubernommen)|ritiro.*(?:riuscito|effettuato)|pres[oa] in carico|affidat[oa] a (?:dpd|gls)|depositat.*punto postale|spedizione.*impostata/.test(text))
|
|
1069
1069
|
return 'accepted';
|
|
1070
1070
|
// Taken in by the carrier: Royal Mail's "Item received by Royal Mail", a parcel shop's or a warehouse's
|
|
1071
1071
|
// receipt, a forwarder's ("<company> has received the goods, <town>, <country>."), the sender's drop-off at a
|
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.1306.
|
|
3
|
+
"version": "0.1306.5-main.8727",
|
|
4
4
|
"description": "Self-hosted parcel tracking: carrier detection, dedicated scrapers and optional universal providers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "PolyForm-Noncommercial-1.0.0",
|