universal-parcel-scraper 0.773.1-main.4133 → 0.773.2-main.4136
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.
|
@@ -24,7 +24,9 @@ export function parseDhlPolandHistory(payload, waybill) {
|
|
|
24
24
|
const day = date && calendarDay(Number(date[3]), Number(date[2]), Number(date[1]));
|
|
25
25
|
if (!day || !/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(row.time))
|
|
26
26
|
throw new SchemaError(PROVIDER, 'DHL Poland returned an invalid scan clock');
|
|
27
|
-
const description = clean(row.description, 500).replace(/\s*(?:The (?:shipment|parcel) (?:was )?received by|Przesyłka odebrana przez)\b[\s\S]*$/i, '').trim()
|
|
27
|
+
const description = clean(row.description, 500).replace(/\s*(?:The (?:shipment|parcel) (?:was )?received by|Przesyłka odebrana przez)\b[\s\S]*$/i, '').trim()
|
|
28
|
+
// A terminal the page leaves unnamed has an empty slot.
|
|
29
|
+
.replace(/^(The shipment has reached DHL terminal) in \./i, '$1.');
|
|
28
30
|
if (!description)
|
|
29
31
|
throw new SchemaError(PROVIDER, 'DHL Poland returned an empty scan');
|
|
30
32
|
const stage = dhlPolandScanStage(description);
|
|
@@ -40,7 +40,7 @@ const SCAN_STAGES = [
|
|
|
40
40
|
[/^(?:The shipment is handled in Sorting Center|Przesyłka jest obsługiwana w Centrum Sortowania)\.?$/i, 'in_transit'],
|
|
41
41
|
[/^(?:The shipment has reached DHL terminal\.|Przesyłka dotarła do oddziału nadawczego DHL Parcel\.)$/i, 'accepted'],
|
|
42
42
|
// A terminal that gives the planned delivery day is reached on the way, with the sorting centre's scan.
|
|
43
|
-
[/^The shipment has reached DHL terminal in [^.]{0,80}
|
|
43
|
+
[/^The shipment has reached DHL terminal(?: in [^.]{0,80})?\. Planned date of delivery to: \d{2}-\d{2}-\d{4}\.$/i, 'in_transit'],
|
|
44
44
|
// A parcel sent abroad: its first terminal, named without a delivery day, then the way out.
|
|
45
45
|
[/^The shipment has reached DHL terminal in [^.]{0,80}\.$/i, 'accepted'],
|
|
46
46
|
[/^The shipment left the origin country\.?$/i, 'in_transit'],
|
|
@@ -24,7 +24,7 @@ export function yanwenTrackingUrl(raw) {
|
|
|
24
24
|
}
|
|
25
25
|
// Partner scans can carry the delivery postcode: a Canadian one before the
|
|
26
26
|
// town, a US ZIP after the state. A location keeps its town and region only,
|
|
27
|
-
// and a partner's "Not Available" is none.
|
|
27
|
+
// and a partner's "Not Available" or bare "AA", a code no country holds, is none.
|
|
28
28
|
const POSTCODE = /^(?:[A-Z]\d[A-Z] ?\d[A-Z]\d|\d{5}(?:-\d{4})?)$/i;
|
|
29
29
|
// GOFO's European delivery scans say whether a PIN was used and give a door
|
|
30
30
|
// number; neither belongs in the wording.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { matchesDroppedLocation, matchesLocationEnrichment } from '../../core/catalog/locationIdentity.js';
|
|
2
2
|
/** Whether a relayed scan's place is a partner's placeholder ("Not Available"), which names no place. */
|
|
3
3
|
export function isYanwenPlaceholder(location) {
|
|
4
|
-
return /^not available$/i.test(location.replace(/\s+/g, ' ').trim());
|
|
4
|
+
return /^(?:not available|AA)$/i.test(location.replace(/\s+/g, ' ').trim());
|
|
5
5
|
}
|
|
6
6
|
// A relayed scan stored without a place can take it from the UTC copy the
|
|
7
7
|
// adapter now drops, and one stored with a placeholder as its place loses it.
|
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.773.
|
|
3
|
+
"version": "0.773.2-main.4136",
|
|
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",
|