universal-parcel-scraper 0.841.2-main.4491 → 0.841.3-main.4493
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.
|
@@ -30,7 +30,8 @@ function eventTime(value) {
|
|
|
30
30
|
return { local_time: parsed.toISO({ suppressMilliseconds: true, includeOffset: false }) };
|
|
31
31
|
}
|
|
32
32
|
function isPlaceholderScan(raw) {
|
|
33
|
-
return isRecord(raw) && [
|
|
33
|
+
return isRecord(raw) && ['', '-'].includes(clean(raw.statusDescription, 8))
|
|
34
|
+
&& [raw.date, raw.location].every((value) => clean(value, 8) === '-');
|
|
34
35
|
}
|
|
35
36
|
export function parse(payload, trackingNumber) {
|
|
36
37
|
const number = normalizeSingaporePostNumber(trackingNumber);
|
|
@@ -40,7 +41,7 @@ export function parse(payload, trackingNumber) {
|
|
|
40
41
|
if (matches.length !== 1 || !isRecord(matches[0]))
|
|
41
42
|
throw new SchemaError('Singapore Post', 'Singapore Post returned a different or ambiguous shipment');
|
|
42
43
|
const item = matches[0];
|
|
43
|
-
// Speedpost answers a missing item with one row of dashes instead of no rows.
|
|
44
|
+
// Speedpost answers a missing item with one row of dashes, its status dashed or empty, instead of no rows.
|
|
44
45
|
if (item.trackingNumberFound === 'false' && Array.isArray(item.events) && item.events.length <= 1
|
|
45
46
|
&& item.events.every(isPlaceholderScan))
|
|
46
47
|
throw new NotFoundError('Singapore Post');
|
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.841.
|
|
3
|
+
"version": "0.841.3-main.4493",
|
|
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",
|