universal-parcel-scraper 0.1145.0-main.6521 → 0.1145.2-main.6528

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 CHANGED
@@ -164,7 +164,7 @@ the command line's `track --source ParcelsApp` does the same.
164
164
  <!-- GENERATED:stages -->
165
165
  <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">
166
166
 
167
- The carrier folders record 20,617 such statuses, each filed under one stage.
167
+ The carrier folders record 20,624 such statuses, each filed under one stage.
168
168
  <!-- /GENERATED:stages -->
169
169
 
170
170
  Wording nobody recorded yet goes through a classifier that reads seven European languages.
@@ -55547,13 +55547,15 @@ function _d(e) {
55547
55547
  if (/^manifested but not collected (?:e-?mail|sms)\b/.test(t)) return "registered";
55548
55548
  if (od.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) ? sd.test(t) ? "registered" : new RegExp(ed).test(t) ? "ready_for_pickup" : void 0 : "exception";
55549
55549
  if (/^picked up (?:at|from) (?:the )?destination airport$/.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";
55550
- 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)|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";
55551
- if (/^warehouse reading$/.test(t) || /^acceptance of the (?:package|parcel) at the delivery branch abroad$/.test(t)) return "in_transit";
55552
- 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";
55553
- if (/^(?:package|parcel) received (?:&|and) scanned at (?:the )?carrier's domestic warehouse$/.test(t) || /^(?:the )?goods (?:arrive|arrived|have arrived) at (?:the )?receiving point$/.test(t) || /(?<!\b(?:no|nao) )\badmitid[oa]s?\b|\badmision (?:en origen|pais de origen)\b/.test(t) || /^aceite(?:\.|$)|\b(?:envio|objeto|objecto|encomenda|remessa) foi aceite\b/.test(t)) return "accepted";
55554
- if (/\bcross ?dock(?:ed|ing)?\b|\bready for outbound\b|^(?:(?:item|parcel|package|shipment) )?inbound scan(?:ned|ning)?\b|\b(?:un)?bagg(?:ed|ing)\b|\bmaster (?:air ?way ?bill|awb)(?: (?:number|no))? (?:received|assigned|allocated)\b|\bhand ?over to (?:the |an )?(?:airline|air carrier)\b|^(?:(?:the |your )?(?:item|parcel|package|shipment) )?(?:has )?left (?:the|our) warehouse$|\b(?:flight|leg)\b[^.;]*\b(?:is taking off|took off|has taken off|has left|landed)\b|\bflight (?:take ?off|landing)\b|^(?:initial|final) landing$|\bcargo tally in the supervised warehouse\b|\bprepared for (?:the )?last[- ]mile hand ?over\b/.test(t) || /^(?:the )?noa (?:has been |was )?received$|^noa-notification of arrival\b/.test(t) || /^(?:the |your )?(?:parcel|package|shipment|item) is (?:now )?at (?:the |a )?distribution cent(?:er|re)$/.test(t) || /^l'envoi est dans le reseau de livraison local$/.test(t) || /^there (?:has|have) been (?:a |an )?(?:slight |short |small |unexpected )?delay (?:with|to|in) (?:your |the )?(?:delivery|parcel|package|shipment|order)\.?$/.test(t) || /\b(?:parcel|package|shipment|item) has been sent to (?!(?:the |your |a )?(?:recipient|customer|consignee|addressee|buyer|customs|sender|shipper|seller|merchant|origin|return\w*)\b)/.test(t) || /transit|\bline ?haul\b|en route|on (?:its|the) way|\bfacility\b|airport|\bleaving\b|\bdispatched\b|^delay(?:ed)?$|received by (?:the )?(?:local )?(?:delivery|logistics) company|\btransfer to (?:the |a |an )?(?:local |destination )?(?:acting |delivery |logistics |courier )?(?:company|agent|carrier|partner)\b|received by (?:postnl|uniuni)\b|notification.*sent to the recipient|delivery option requested|instruction de livraison recue|cambio (?:delle )?disposizioni di consegna|expedie (?:depuis|du|de)\b|acheminement|unterwegs|\bin viaggio\b|\bw drodze\b|\bonderweg\b|transport|trasport|arriv|depart|processed|processing completed|processing at (?:the )?(?:origin |destination )?branch\b|\breceipt of (?:the )?(?:package|parcel|shipment) at (?:the )?dpd branch\b|sorted|sorting|\btri\b|\btriee?s?\b|traitement|traite|sortier|bearbeitet|bearbeitung|elaborat|elaborazion|smistat|parcel cent(?:er|re)|delivery cent(?:er|re)|centre.*(?:colis|distribution)|paketzentrum|verteilzentrum|centro.*(?:pacchi|distribuzione)|depot|import scan|scan.*import|importscan|scansione.*import|delivery.*delayed|livraison.*(?:retard|report)|zustellung.*verzogert|consegna.*ritard|transferred|transfere|weitergeleitet|inoltrato|left.*(?:point|center)|quitte|verlassen|raggiunto|close bag|fermeture du sac|sack.*geschlossen|chiusura.*sacco|scanned into|scanned at (?:a |the )?checkpoint|dismantling the board|scanne dans|eingescannt|scansionat|\b(?:un)?loaded\b|^(?:item|parcel|shipment) distributed$|charg.*vehicule de transport|transportfahrzeug.*geladen|caric.*veicolo.*trasporto/.test(t) || /^enviad[oa]$|\bclasificad[oa]s?\b|\bclasificacion\b|\ben ruta\b|\ben camino\b|\bcargad[oa]s? (?:en (?:el )?|al )vehiculo\b|\bllegad[oa]s? (?:a|al|en)\b|\bllegada (?:a|al|en|de)\b|\bha llegado\b|\bllego (?:a|al)\b|\bsalida (?:de|del|desde)\b|\b(?:ha )?salido (?:de|del)\b|\bsalio (?:de|del)\b|\ben destino\b|\b(?:agencia|delegacion|plataforma|oficina|franquicia) (?:de )?destino\b|\b(?:unidad|centro|oficina|delegacion|base|agencia|plataforma) de reparto\b|\bcentro (?:de )?(?:clasificacion|distribucion|tratamiento|logistico|operaciones|operativo)\b|\blectura\b|\bleid[oa]s?\b|\brecepcionad[oa]s?\b|\bprocesad[oa]s?\b|\bexpedid[oa]s?\b|\btriagem\b|\btriad[oa]s?\b|\bem tratamento\b|\btratad[oa]s?\b|\bcentro (?:de )?(?:distribuicao|tratamento|triagem|operacional)\b|\bchegad[ao] (?:a|ao|no|na|em)\b|\bchegou (?:a|ao|no|na|em)\b|\bsaida (?:do|da|de|dos|das)\b|\bsaiu (?:do|da|de|dos|das)\b|\bem rota\b|\ba caminho\b|\bencaminhad[oa]s?\b|\b(?:em )?transferencia\b|\btransferid[oa]s?\b|\bprocessad[oa]s?\b|\brecebid[oa] (?:no|na|em) (?:centro|armazem|unidade|plataforma)\b|\brecibid[oa] en (?:el |la |nuestr[oa] )?(?:almacen|centro|delegacion|plataforma|hub|agencia)\b/.test(t)) return "in_transit";
55555
- if (/^(?:приинято|принято)$/.test(t)) return "accepted";
55556
- if (Nu.test(t)) return "in_transit";
55550
+ if (!/\bprise? en charge (?:de )?votre demande\b/.test(t)) {
55551
+ 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)|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";
55552
+ if (/^warehouse reading$/.test(t) || /^acceptance of the (?:package|parcel) at the delivery branch abroad$/.test(t)) return "in_transit";
55553
+ 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";
55554
+ if (/^(?:package|parcel) received (?:&|and) scanned at (?:the )?carrier's domestic warehouse$/.test(t) || /^(?:the )?goods (?:arrive|arrived|have arrived) at (?:the )?receiving point$/.test(t) || /(?<!\b(?:no|nao) )\badmitid[oa]s?\b|\badmision (?:en origen|pais de origen)\b/.test(t) || /^aceite(?:\.|$)|\b(?:envio|objeto|objecto|encomenda|remessa) foi aceite\b/.test(t)) return "accepted";
55555
+ if (/\bcross ?dock(?:ed|ing)?\b|\bready for outbound\b|^(?:(?:item|parcel|package|shipment) )?inbound scan(?:ned|ning)?\b|\b(?:un)?bagg(?:ed|ing)\b|\bmaster (?:air ?way ?bill|awb)(?: (?:number|no))? (?:received|assigned|allocated)\b|\bhand ?over to (?:the |an )?(?:airline|air carrier)\b|^(?:(?:the |your )?(?:item|parcel|package|shipment) )?(?:has )?left (?:the|our) warehouse$|\b(?:flight|leg)\b[^.;]*\b(?:is taking off|took off|has taken off|has left|landed)\b|\bflight (?:take ?off|landing)\b|^(?:initial|final) landing$|\bcargo tally in the supervised warehouse\b|\bprepared for (?:the )?last[- ]mile hand ?over\b/.test(t) || /^(?:the )?noa (?:has been |was )?received$|^noa-notification of arrival\b/.test(t) || /^(?:the |your )?(?:parcel|package|shipment|item) is (?:now )?at (?:the |a )?distribution cent(?:er|re)$/.test(t) || /^l'envoi est dans le reseau de livraison local$/.test(t) || /^there (?:has|have) been (?:a |an )?(?:slight |short |small |unexpected )?delay (?:with|to|in) (?:your |the )?(?:delivery|parcel|package|shipment|order)\.?$/.test(t) || /\b(?:parcel|package|shipment|item) has been sent to (?!(?:the |your |a )?(?:recipient|customer|consignee|addressee|buyer|customs|sender|shipper|seller|merchant|origin|return\w*)\b)/.test(t) || /transit|\bline ?haul\b|en route|on (?:its|the) way|\bfacility\b|airport|\bleaving\b|\bdispatched\b|^delay(?:ed)?$|received by (?:the )?(?:local )?(?:delivery|logistics) company|\btransfer to (?:the |a |an )?(?:local |destination )?(?:acting |delivery |logistics |courier )?(?:company|agent|carrier|partner)\b|received by (?:postnl|uniuni)\b|notification.*sent to the recipient|delivery option requested|instruction de livraison recue|cambio (?:delle )?disposizioni di consegna|expedie (?:depuis|du|de)\b|acheminement|unterwegs|\bin viaggio\b|\bw drodze\b|\bonderweg\b|transport|trasport|arriv|depart|processed|processing completed|processing at (?:the )?(?:origin |destination )?branch\b|\breceipt of (?:the )?(?:package|parcel|shipment) at (?:the )?dpd branch\b|sorted|sorting|\btri\b|\btriee?s?\b|traitement|traite|sortier|bearbeitet|bearbeitung|elaborat|elaborazion|smistat|parcel cent(?:er|re)|delivery cent(?:er|re)|centre.*(?:colis|distribution)|paketzentrum|verteilzentrum|centro.*(?:pacchi|distribuzione)|depot|import scan|scan.*import|importscan|scansione.*import|delivery.*delayed|livraison.*(?:retard|report)|zustellung.*verzogert|consegna.*ritard|transferred|transfere|weitergeleitet|inoltrato|left.*(?:point|center)|quitte|verlassen|raggiunto|close bag|fermeture du sac|sack.*geschlossen|chiusura.*sacco|scanned into|scanned at (?:a |the )?checkpoint|dismantling the board|scanne dans|eingescannt|scansionat|\b(?:un)?loaded\b|^(?:item|parcel|shipment) distributed$|charg.*vehicule de transport|transportfahrzeug.*geladen|caric.*veicolo.*trasporto/.test(t) || /^enviad[oa]$|\bclasificad[oa]s?\b|\bclasificacion\b|\ben ruta\b|\ben camino\b|\bcargad[oa]s? (?:en (?:el )?|al )vehiculo\b|\bllegad[oa]s? (?:a|al|en)\b|\bllegada (?:a|al|en|de)\b|\bha llegado\b|\bllego (?:a|al)\b|\bsalida (?:de|del|desde)\b|\b(?:ha )?salido (?:de|del)\b|\bsalio (?:de|del)\b|\ben destino\b|\b(?:agencia|delegacion|plataforma|oficina|franquicia) (?:de )?destino\b|\b(?:unidad|centro|oficina|delegacion|base|agencia|plataforma) de reparto\b|\bcentro (?:de )?(?:clasificacion|distribucion|tratamiento|logistico|operaciones|operativo)\b|\blectura\b|\bleid[oa]s?\b|\brecepcionad[oa]s?\b|\bprocesad[oa]s?\b|\bexpedid[oa]s?\b|\btriagem\b|\btriad[oa]s?\b|\bem tratamento\b|\btratad[oa]s?\b|\bcentro (?:de )?(?:distribuicao|tratamento|triagem|operacional)\b|\bchegad[ao] (?:a|ao|no|na|em)\b|\bchegou (?:a|ao|no|na|em)\b|\bsaida (?:do|da|de|dos|das)\b|\bsaiu (?:do|da|de|dos|das)\b|\bem rota\b|\ba caminho\b|\bencaminhad[oa]s?\b|\b(?:em )?transferencia\b|\btransferid[oa]s?\b|\bprocessad[oa]s?\b|\brecebid[oa] (?:no|na|em) (?:centro|armazem|unidade|plataforma)\b|\brecibid[oa] en (?:el |la |nuestr[oa] )?(?:almacen|centro|delegacion|plataforma|hub|agencia)\b/.test(t)) return "in_transit";
55556
+ if (/^(?:приинято|принято)$/.test(t)) return "accepted";
55557
+ if (Nu.test(t)) return "in_transit";
55558
+ }
55557
55559
  }
55558
55560
  function vd(e) {
55559
55561
  return e === "registered" || e === "pending" ? "pending" : e === "delivered" ? "delivered" : e === "out_for_delivery" || e === "ready_for_pickup" ? "out_for_delivery" : e === "returned" || e === "failed_attempt" || e === "exception" ? "exception" : "in_transit";
@@ -7,6 +7,8 @@ const codes = {
7
7
  'BDI/01': { status: 'delivered', stage: 'delivered' },
8
8
  'BDE/10': { status: 'exception', stage: 'failed_attempt' },
9
9
  'BDE/20': { status: 'exception', stage: 'failed_attempt' },
10
+ // The postman found no such address on the delivery run.
11
+ 'BDE/99': { status: 'exception', stage: 'failed_attempt' },
10
12
  'BDE/23': { status: 'exception', stage: 'returned' },
11
13
  'BDE/34': { status: 'exception', stage: 'exception' },
12
14
  'BDE/47': { status: 'exception', stage: 'exception' },
@@ -21,6 +23,8 @@ const codes = {
21
23
  'FC/82': { status: 'pending', stage: 'registered' },
22
24
  // A missorted item Correios has caught and will forward again.
23
25
  'FC/03': { status: 'in_transit', stage: 'in_transit' },
26
+ // A unit found the address wrong before any delivery run: an address problem, not an attempt.
27
+ 'FC/04': { status: 'exception', stage: 'exception' },
24
28
  'DO/01': { status: 'in_transit', stage: 'in_transit' },
25
29
  'RO/01': { status: 'in_transit', stage: 'in_transit' },
26
30
  'PAR/10': { status: 'in_transit', stage: 'in_transit' },
@@ -20,6 +20,8 @@
20
20
  { "code": "BDI/01", "wording": "Objeto entregue ao destinatário", "language": "pt", "stage": "delivered", "confirmedBy": "live" },
21
21
  { "code": "BDE/10", "wording": "Objeto não entregue - cliente mudou-se", "language": "pt", "stage": "failed_attempt", "confirmedBy": "live" },
22
22
  { "code": "BDE/20", "wording": "Objeto não entregue - carteiro não atendido", "language": "pt", "stage": "failed_attempt", "confirmedBy": "live" },
23
+ { "code": "BDE/99", "wording": "Objeto não entregue - Endereço inexistente", "language": "pt", "stage": "failed_attempt", "confirmedBy": "live", "note": "Listed after the item went out for delivery: the postman found no such address." },
24
+ { "code": "FC/04", "wording": "Objeto não entregue - endereço incorreto", "language": "pt", "stage": "exception", "confirmedBy": "live", "note": "Listed by a unit between transfers, before any delivery run: an address problem rather than an attempt; transfers can follow." },
23
25
  { "code": "BDE/23", "wording": "Objeto entregue ao remetente", "language": "pt", "stage": "returned", "confirmedBy": "live", "note": "Delivered back to the sender." },
24
26
  { "code": "BDI/40", "wording": "Importação não autorizada", "language": "pt", "stage": "exception", "confirmedBy": "live", "note": "Customs refused the import." },
25
27
  { "code": "BDR/83", "wording": "Prazo de regularização encerrado", "language": "pt", "stage": "exception", "confirmedBy": "live", "note": "The time to settle the import with customs ran out." },
@@ -3,8 +3,9 @@ import statuses from './statuses.json' with { type: 'json' };
3
3
  const WORDINGS = statusWordings(statuses.entries);
4
4
  // A flight row names the day it expects the flight as month-day: "预计10-22飞".
5
5
  const FLIGHT_DAY = /(预计)\d{1,2}-\d{1,2}(飞)$/u;
6
- // The depot hand-over row starts with a month-day: "10-31 已交仓 留意官网更新".
7
- const HANDED_OVER_DAY = /^\d{1,2}-\d{1,2}( 已交仓 留意官网更新)$/u;
6
+ // The depot hand-over row starts with a month-day: "10-31 已交仓 留意官网更新", or "11-17 已全部交仓 留意官网更新"
7
+ // once every parcel of the shipment is there.
8
+ const HANDED_OVER_DAY = /^\d{1,2}-\d{1,2}( 已(?:全部)?交仓 留意官网更新)$/u;
8
9
  // DHL's row from the destination country ends with the destination post's tracking link in brackets:
9
10
  // "… destination area. (Homepage / online shipment tracking: https://…)".
10
11
  const LINK = /\s*\([^()]*https?:\/\/[^()]*\)$/;
@@ -11,6 +11,7 @@
11
11
  {"wording": "一程已落地 二程预计…飞", "language": "zh", "english": "First flight landed, connecting flight booked", "stage": "in_transit", "confirmedBy": "source", "note": "The first leg has landed; the row names the day the second is expected to leave, which the key replaces with an ellipsis. As a universal provider relays it."},
12
12
  {"wording": "DHL已交仓 DPD未交仓", "language": "zh", "english": "Handed over to DHL; not yet to DPD", "stage": "in_transit", "confirmedBy": "live", "note": "After the collection from the airport, the destination's hand-over to the delivery carriers, listed for both: the parcels for DHL are at its depot, those for DPD not yet."},
13
13
  {"wording": "… 已交仓 留意官网更新", "language": "zh", "english": "Handed over to the delivery carrier's depot; watch its website for updates", "stage": "in_transit", "confirmedBy": "live", "firstSeen": "2026-10-31", "note": "After the hand-over to DHL, before DHL's first scan. The row starts with a month-day; the key replaces it with an ellipsis and the English leaves it out."},
14
+ {"wording": "… 已全部交仓 留意官网更新", "language": "zh", "english": "All handed over to the delivery carrier's depot; watch its website for updates", "stage": "in_transit", "confirmedBy": "live", "firstSeen": "2026-11-17", "note": "The hand-over row once the whole shipment is at the delivery carrier's depot. It starts with a month-day, read as in the row without 全部."},
14
15
  {"wording": "The international shipment has been processed in the parcel center of origin", "language": "en", "stage": "in_transit", "confirmedBy": "live", "note": "Relayed from DHL in Germany."},
15
16
  {"wording": "The international shipment has been processed in the export parcel center", "language": "en", "stage": "in_transit", "confirmedBy": "live", "firstSeen": "2026-10-31", "note": "Relayed from DHL in Germany."},
16
17
  {"wording": "Item forwarded to destination country", "language": "en", "stage": "in_transit", "confirmedBy": "live", "firstSeen": "2026-10-31", "note": "Relayed from DHL in Germany, after its export parcel center."},
@@ -14,7 +14,7 @@ import { cleanScalar, TRAWL_TRANSPORT_ALLOWANCE_MS, trawlBody } from '../../core
14
14
  import { isRecord } from '../../core/types.js';
15
15
  import { MondialRelayAppClient } from './app.js';
16
16
  import { inpostSpainTrackingUrl, isInpostSpainNumber, readInpostSpain } from './inpostSpain.js';
17
- import { classifyScan, classifyStatus, headlineStatus, milestoneNumberStatus, scanSite, scanWording } from './status.js';
17
+ import { classifyScan, classifyStatus, headlineStatus, isRequestReceipt, milestoneNumberStatus, scanSite, scanWording } from './status.js';
18
18
  // Protocol provenance (inspected 2026-08-30):
19
19
  // https://www.mondialrelay.fr/versioned-assets/2nMAiuVI9Rv9J3kZacblPYCfCABwzS-qZ3m7eFBQn4A/Scripts/vue/tracking/js/app.js
20
20
  // SHA-256: da73008ae548f51bfd27791969c6e53d809f080070cd2faa6779bb7850509f80
@@ -252,7 +252,8 @@ function parseEvents(expedition) {
252
252
  time: time.iso,
253
253
  location: scanSite(description),
254
254
  description,
255
- stage: classified.stage,
255
+ // The receipt of a request about the parcel moves nothing.
256
+ ...(isRequestReceipt(description) ? {} : { stage: classified.stage }),
256
257
  },
257
258
  classified,
258
259
  timestamp: time.timestamp,
@@ -312,7 +313,7 @@ function parseTrackingResponse(payload, credential) {
312
313
  const events = parsedEvents.map(({ event }) => event);
313
314
  const contextual = plainText(expedition.SuiviContextuel);
314
315
  const statusText = contextual || events[0]?.description || 'Tracking information received';
315
- const headline = headlineStatus(statusText, parsedEvents.map(({ classified }) => classified));
316
+ const headline = headlineStatus(statusText, parsedEvents.filter(({ event }) => event.stage).map(({ classified }) => classified));
316
317
  const current = headline.status !== 'unknown'
317
318
  ? headline
318
319
  : parsedEvents.find((event) => event.classified.status !== 'unknown')?.classified
@@ -6,7 +6,7 @@ import { CarrierError, ChallengeError, IndeterminateError, SchemaError, Transpor
6
6
  import { EXPLICIT_OFFSET_PATTERN } from '../../core/time/index.js';
7
7
  import { cleanScalar, decodeText, fetchBounded, userAgentOf } from '../../core/transport/index.js';
8
8
  import { isRecord } from '../../core/types.js';
9
- import { classifyScan, classifyStatus, headlineStatus, milestoneNumberStatus, scanSite, scanWording } from './status.js';
9
+ import { classifyScan, classifyStatus, headlineStatus, isRequestReceipt, milestoneNumberStatus, scanSite, scanWording } from './status.js';
10
10
  export const MONDIAL_RELAY_APP_API = 'https://mobile-app-bff.mondialrelay.app/api/';
11
11
  const TOKEN_URL = 'https://account.inpost-group.com/oauth2/token';
12
12
  const CLIENT_ID = 'mondialrelay-mobile';
@@ -136,13 +136,15 @@ export function parseMondialRelayApp(payload, uid) {
136
136
  continue;
137
137
  seen.add(identity);
138
138
  const classified = classifyScan(description, time.timestamp, outForDelivery);
139
- parsed.push({ event: { time: time.iso, location: scanSite(description), description, stage: classified.stage }, classified, timestamp: time.timestamp });
139
+ // The receipt of a request about the parcel moves nothing.
140
+ const stage = isRequestReceipt(description) ? {} : { stage: classified.stage };
141
+ parsed.push({ event: { time: time.iso, location: scanSite(description), description, ...stage }, classified, timestamp: time.timestamp });
140
142
  }
141
143
  }
142
144
  parsed.sort((left, right) => right.timestamp - left.timestamp);
143
145
  const events = parsed.slice(0, 100).map(({ event }) => event);
144
146
  const hint = cleanScalar(expedition.stepHint, 200);
145
- const hinted = headlineStatus(hint, parsed.map(({ classified }) => classified));
147
+ const hinted = headlineStatus(hint, parsed.filter(({ event }) => event.stage).map(({ classified }) => classified));
146
148
  const current = hinted.status !== 'unknown'
147
149
  ? hinted
148
150
  : parsed.find(({ classified }) => classified.status !== 'unknown')?.classified ?? milestoneStatus(steps);
@@ -22,6 +22,7 @@ export declare const MONDIAL_RELAY_WORDING: readonly {
22
22
  phrases: readonly string[];
23
23
  classified: ClassifiedStatus;
24
24
  }[];
25
+ export declare const isRequestReceipt: (description: string) => boolean;
25
26
  /** The status and stage a Mondial Relay label denotes. */
26
27
  export declare function classifyStatus(description: string): ClassifiedStatus;
27
28
  export declare const isMerchantDelivery: (description: string) => boolean;
@@ -99,9 +99,18 @@ export const MONDIAL_RELAY_WORDING = [
99
99
  classified: { status: 'in_transit', stage: 'in_transit' },
100
100
  },
101
101
  ];
102
+ /**
103
+ * Mondial Relay's receipt of a request about the parcel, listed among its scans: "Nous avons bien pris
104
+ * en charge de votre demande, une réponse vous sera apportée prochainement sur votre suivi/ici." It
105
+ * takes up the request, not the parcel, and moves nothing.
106
+ */
107
+ const REQUEST_RECEIPT = 'pris en charge de votre demande';
108
+ export const isRequestReceipt = (description) => comparableText(description).includes(REQUEST_RECEIPT);
102
109
  /** The status and stage a Mondial Relay label denotes. */
103
110
  export function classifyStatus(description) {
104
111
  const value = comparableText(description);
112
+ if (value.includes(REQUEST_RECEIPT))
113
+ return { status: 'unknown', stage: 'in_transit' };
105
114
  for (const rule of MONDIAL_RELAY_WORDING) {
106
115
  if (rule.phrases.some((phrase) => value.includes(phrase)))
107
116
  return rule.classified;
@@ -237,4 +246,6 @@ export const statusMap = {
237
246
  wording: LAST_LEG,
238
247
  note: 'Out for delivery when the out-for-delivery milestone is dated at it, as on a home delivery, else movement: the stored scan does not keep the milestone.',
239
248
  }],
249
+ gapNote: (code, wording) => (!code && isRequestReceipt(wording)
250
+ ? 'The receipt of a request about the parcel: it takes up the request, not the parcel, and moves nothing.' : undefined),
240
251
  };
@@ -12,6 +12,7 @@ const observed = {
12
12
  LL020: { group: 'ENTREGADO', wording: 'EL ENVÍO HA SIDO ENTREGADO A UN VECINO.', mapped: delivered },
13
13
  LC001: { group: 'EN REPARTO', wording: 'EL ENVÍO ESTÁ EN REPARTO.', mapped: { status: 'out_for_delivery', stage: 'out_for_delivery' } },
14
14
  LC003: { group: 'EN REPARTO', wording: 'EL ENVÍO ESTÁ EN REPARTO.', mapped: { status: 'out_for_delivery', stage: 'out_for_delivery' } },
15
+ LC006: { group: 'EN REPARTO', wording: 'EL ENVÍO ESTÁ EN REPARTO.', mapped: { status: 'out_for_delivery', stage: 'out_for_delivery' } },
15
16
  LC860: { group: 'EN REPARTO', wording: 'EL ENVÍO ESTÁ EN REPARTO INTERNACIONAL.', mapped: { status: 'out_for_delivery', stage: 'out_for_delivery' } },
16
17
  LI300: { group: 'EN DEMORA', wording: 'EL ENVÍO HA SUFRIDO UN RETRASO Y ES POSIBLE QUE SE DEMORE LA ENTREGA. DISCULPA LAS MOLESTIAS.', mapped: null },
17
18
  LI582: { group: 'EN DEMORA', wording: 'EL ENVÍO HA SUFRIDO UN RETRASO PROVOCANDO UNA POSIBLE DEMORA EN LA ENTREGA. DISCULPA LAS MOLESTIAS.', mapped: null },
@@ -260,6 +260,15 @@
260
260
  "firstSeen": "2026-10-22",
261
261
  "note": "Its group is the one a provider relayed with the scan."
262
262
  },
263
+ {
264
+ "code": "LC006",
265
+ "wording": "EL ENVÍO ESTÁ EN REPARTO.",
266
+ "language": "es",
267
+ "stage": "out_for_delivery",
268
+ "confirmedBy": "live",
269
+ "firstSeen": "2026-11-17",
270
+ "note": "Group EN REPARTO: LC001's and LC003's delivery round under another code."
271
+ },
263
272
  {
264
273
  "code": "LI521",
265
274
  "wording": "EL ENVÍO NO SE HA ENTREGADO PORQUE LA DIRECCIÓN DE ENTREGA ESTÁ INCOMPLETA O ERRÓNEA.",
@@ -1,5 +1,6 @@
1
- // The country's code a facility's name can open with, as in "CN,SAMPLE Sort Facility".
2
- const COUNTRY_PREFIX = /^[A-Z]{2},(?=\p{L})/u;
1
+ // The country's code a facility's name can open with, as in "CN,SAMPLE Sort Facility", or the
2
+ // empty one before a last mile's town, as in ",SAMPLE TOWN".
3
+ const COUNTRY_PREFIX = /^(?:[A-Z]{2})?,(?=\p{L})/u;
3
4
  // The town, state, country and postcode FedEx's rows open with, as Shouwu relays them:
4
5
  // "SAMPLE TOWN, CA, US, 00000, Arrived at FedEx location". The postcode has a digit.
5
6
  const RELAYED_PLACE = /^\p{L}[\p{L}\p{M} .'’-]{0,59}, [A-Z]{2}, [A-Z]{2}, (?:(?=[A-Z\d -]*\d)[A-Z\d][A-Z\d -]{1,8}[A-Z\d], )?(?=\p{L})/u;
@@ -236,6 +236,14 @@
236
236
  "confirmedBy": "live",
237
237
  "note": "China's export release before the flight; the parcel is not held in customs."
238
238
  },
239
+ {
240
+ "wording": "Import Released",
241
+ "stage": "in_transit",
242
+ "language": "en",
243
+ "confirmedBy": "live",
244
+ "firstSeen": "2026-11-17",
245
+ "note": "Customs in the destination released the import after \"Under Clearance\"; the parcel is no longer held."
246
+ },
239
247
  {
240
248
  "wording": "Flight Departed",
241
249
  "stage": "in_transit",
@@ -964,6 +972,22 @@
964
972
  "firstSeen": "2026-11-11",
965
973
  "note": "DPD's delivery round."
966
974
  },
975
+ {
976
+ "wording": "arrival city",
977
+ "stage": "in_transit",
978
+ "language": "en",
979
+ "confirmedBy": "live",
980
+ "firstSeen": "2026-11-17",
981
+ "note": "The delivering partner's arrival in a town after the import release, under the town's name."
982
+ },
983
+ {
984
+ "wording": "leave the city",
985
+ "stage": "in_transit",
986
+ "language": "en",
987
+ "confirmedBy": "live",
988
+ "firstSeen": "2026-11-17",
989
+ "note": "The delivering partner leaving a town on its way, between its arrivals."
990
+ },
967
991
  {
968
992
  "wording": "Unfortunately we have not been able to deliver your parcel. Consignee address not correct.",
969
993
  "stage": "failed_attempt",
@@ -934,6 +934,10 @@ export function trackingLanguageStage(description) {
934
934
  if (/^(?:the |your )?parcel (?:has been |was )?sent to (?:the )?local [a-z][a-z&' ]{0,40} warehouse for delivery$/.test(text)
935
935
  || /^(?:the |your )?parcel (?:has been |was )?assigned to (?:a |the |your )?delivery driver$/.test(text))
936
936
  return 'in_transit';
937
+ // A carrier's receipt of a request about the parcel takes up the request, not the parcel, and moves nothing:
938
+ // Mondial Relay's "Nous avons bien pris en charge de votre demande, une réponse vous sera apportée …".
939
+ if (/\bprise? en charge (?:de )?votre demande\b/.test(text))
940
+ return undefined;
937
941
  // A pickup still to come ("will be picked up") is not one either.
938
942
  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)|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))
939
943
  return 'accepted';
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Universal Parcel Scraper",
5
- "version": "0.1145.0-main.6521"
5
+ "version": "0.1145.2-main.6528"
6
6
  },
7
7
  "paths": {
8
8
  "/health": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-parcel-scraper",
3
- "version": "0.1145.0-main.6521",
3
+ "version": "0.1145.2-main.6528",
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",