universal-parcel-scraper 0.976.1-main.5285 → 0.976.2-main.5286

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.
@@ -45597,7 +45597,7 @@ function cu(e) {
45597
45597
  if (/^acceptance of the (?:package|parcel) at the delivery branch abroad$/.test(t)) return "in_transit";
45598
45598
  if (/^acceptance of the (?:package|parcel) at the pick ?up point$/.test(t)) return "ready_for_pickup";
45599
45599
  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";
45600
- 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|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 |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) || /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|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 )?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";
45600
+ 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|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) || /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|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 )?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";
45601
45601
  if (/^(?:приинято|принято)$/.test(t)) return "accepted";
45602
45602
  if (zl.test(t)) return "in_transit";
45603
45603
  }
@@ -33,6 +33,7 @@ const CODES = new Map([
33
33
  ['15', 'accepted'],
34
34
  // The driver could not collect the shipment from the sender.
35
35
  ['14', 'exception'],
36
+ // A terminal's receipt from a driver: after the collection, or after a round that brought it back undelivered.
36
37
  ['20', 'in_transit'],
37
38
  ['30', 'in_transit'],
38
39
  ['40', 'in_transit'],
@@ -4,7 +4,7 @@
4
4
  {"code": "10", "wording": "Received from the sender", "language": "en", "stage": "accepted", "confirmedBy": "live"},
5
5
  {"code": "15", "wording": "Collected (SMS)", "language": "en", "stage": "accepted", "confirmedBy": "portal", "note": "The collection from the sender, confirmed by text message."},
6
6
  {"code": "14", "wording": "Failed collection (SMS)", "language": "en", "stage": "exception", "confirmedBy": "portal", "note": "The driver could not collect the shipment from the sender."},
7
- {"code": "20", "wording": "Inbound Scan From Driver to Terminal", "language": "en", "stage": "in_transit", "confirmedBy": "live", "note": "The collecting terminal received the shipment from the driver."},
7
+ {"code": "20", "wording": "Inbound Scan From Driver to Terminal", "language": "en", "stage": "in_transit", "confirmedBy": "live", "note": "A terminal received the shipment from a driver: the collecting one after the collection, or the delivery terminal after a round that brought it back undelivered. Without an attempt code (65, 68) the round made no attempt: the shipment waits for another round."},
8
8
  {"code": "30", "wording": "Outbound Scan from (Collection) Terminal to Line-haul", "language": "en", "stage": "in_transit", "confirmedBy": "live"},
9
9
  {"code": "40", "wording": "Inbound Scan from Line-haul to (Delivery) Terminal", "language": "en", "stage": "in_transit", "confirmedBy": "live"},
10
10
  {"code": "50", "wording": "Outbound for Delivery", "language": "en", "stage": "out_for_delivery", "confirmedBy": "portal"},
@@ -1,6 +1,11 @@
1
- // MySpeedPost changes a scan's wording while its instant and event_type stay the same.
1
+ // MySpeedPost rewords a scan, and can restate it under another event_type, at the same
2
+ // second and office: "Item bagged" (ItemBagged) as "Bag Closed" (BagOpened), "Item
3
+ // Dispatched" as "Bag Dispatched". A reply never holds two scans at one second and office,
4
+ // so the scan at that second and office, the only one both ways, is the stored one.
2
5
  // Scans abroad were read on India's clock until October 2026 and now show the
3
6
  // destination's offset, unless a reply lacks what places them abroad.
4
7
  export const sameInstantIdentityPolicy = {
5
- sourceCarrierId: 'india-post', storedSources: ['india-post'], requireProviderCode: true, relabelledFrom: 'Asia/Kolkata',
8
+ sourceCarrierId: 'india-post', storedSources: ['india-post'], requireProviderCode: false, matchEachScan: true,
9
+ matches: (incoming, stored) => incoming.location.trim() === stored.location.trim(),
10
+ relabelledFrom: 'Asia/Kolkata',
6
11
  };
@@ -716,6 +716,10 @@ export function trackingLanguageStage(description) {
716
716
  // the parcel on.
717
717
  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|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(text))
718
718
  return 'in_transit';
719
+ // The airline's notice of arrival (NOA) reaching the destination agent, after the landing and
720
+ // before clearance, as Shouwu, JRT and the ground handlers word it.
721
+ if (/^(?:the )?noa (?:has been |was )?received$|^noa-notification of arrival\b/.test(text))
722
+ return 'in_transit';
719
723
  // A linehaul is the trunk haul between hubs, whatever was handed over.
720
724
  // A parcel at a distribution centre, the whole scan, as Lietuvos paštas words it. Other scans naming
721
725
  // such a centre, a courier's origin scan or a retailer's order sent to its store, say less.
@@ -22,6 +22,7 @@ import { countryName, militaryPostOffice } from '../../places/trackingLocation.j
22
22
  import { hasSeveralClocks, keepsZone, mainZone } from '../../places/zones.js';
23
23
  import { captureFailure, capturedBodies, loadCapture } from '../shared/capture.js';
24
24
  import { CAINIAO_CHINA_LEG, CAINIAO_CHINA_ZONE } from '../../carriers/aliexpress/clock.js';
25
+ import { chinaPostEnglish, chinaPostLabelPlace } from '../../carriers/china-post/status.js';
25
26
  import { correosOriginZone } from '../../carriers/correos-spain/clock.js';
26
27
  import { cttSiteZone, portugalZone } from '../../carriers/ctt/clock.js';
27
28
  import { DHLINK_RECORD_ZONE, usClockCopy } from '../../carriers/dhlink/clock.js';
@@ -1762,6 +1763,17 @@ function parseHistory(payload, trackingNumber, timezone = null, readAt = Date.no
1762
1763
  const location = scan?.location ?? reportedPlace(raw.location);
1763
1764
  if (location && !/^Type de livraison\s*:/i.test(location))
1764
1765
  parsed.location = location;
1766
+ // China Post words its labels in Chinese only, also those it gives the destination post's scans:
1767
+ // they show in English where it is known, staged as the Chinese was, with the place left to the
1768
+ // location, or taken from the label's 【】 where none is given, as 17TRACK's copies of them are.
1769
+ const english = !scan && typeof name === 'string' && carrierIdFromName(name) === 'china-post'
1770
+ && /\p{Script=Han}/u.test(parsed.description ?? '') ? chinaPostEnglish(parsed.description) : undefined;
1771
+ if (english) {
1772
+ const named = parsed.location ? '' : reportedPlace(chinaPostLabelPlace(parsed.description) ?? '');
1773
+ parsed.description = english;
1774
+ if (named)
1775
+ parsed.location = named;
1776
+ }
1765
1777
  events.push(parsed);
1766
1778
  carried.push({ event: parsed, carrier: nameKey(name) });
1767
1779
  scanCarriers.add(name);
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Universal Parcel Scraper",
5
- "version": "0.976.1-main.5285"
5
+ "version": "0.976.2-main.5286"
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.976.1-main.5285",
3
+ "version": "0.976.2-main.5286",
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",