universal-parcel-scraper 0.1196.4-main.7021 → 0.1197.2-main.7034
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 +1 -1
- package/data/catalog.json +4 -4
- package/data/detection-golden.json +45 -2
- package/dist/browser/scraper.js +5 -5
- package/dist/carriers/ctt-express/carrier.json +5 -5
- package/dist/carriers/ctt-express/numbers.json +9 -2
- package/dist/carriers/gls-it/status.js +12 -1
- package/dist/carriers/gls-it/statuses.json +56 -0
- package/dist/carriers/jrt/status.js +6 -3
- package/dist/carriers/jrt/statuses.json +8 -0
- package/dist/carriers/speedaf/carrier.json +1 -1
- package/dist/carriers/speedaf/numbers.json +15 -0
- package/dist/carriers/spx-br/parser.js +3 -2
- package/dist/carriers/spx-br/status.d.ts +2 -2
- package/dist/carriers/spx-br/status.js +12 -5
- package/dist/carriers/spx-br/statuses.json +10 -2
- package/dist/carriers/tipsa/numbers.json +19 -0
- package/dist/data/catalog.json +4 -4
- package/dist/generated/catalog.js +5 -5
- package/dist/providers/shared/hints.js +4 -1
- package/dist/server/openapi.json +1 -1
- package/package.json +1 -1
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 21,
|
|
167
|
+
The carrier folders record 21,285 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.
|
package/data/catalog.json
CHANGED
|
@@ -3079,12 +3079,12 @@
|
|
|
3079
3079
|
],
|
|
3080
3080
|
"detectionRules": [
|
|
3081
3081
|
{
|
|
3082
|
-
"pattern": "^
|
|
3083
|
-
"confidence": "
|
|
3082
|
+
"pattern": "^00\\d{4}00(?:0002|0207|0301|0421|0506|0604|0720|0721|0722|0818|0829|0868|0899|0908|0912|1000|1055|1060|1094|1095|1103|1124|1129|1130|1132|1214|1306|1315|1415|1423|1514|1522|1534|1605|1721|1820|1834|1903|2002|2005|2101|2209|2315|2411|2412|2530|2611|2712|2903|3008|3010|3029|3102|3115|3202|3326|3405|3501|3510|3513|3515|3516|3631|3633|3708|3802|3808|3911|4000|4005|4024|4030|4034|4037|4047|4050|4053|4101|4202|4304|4332|4407|4521|4522|4638|4653|4700|4707|4815|4907|5004|6001|6002|6003|6005|6008|6009|6010|6011|6012|6013|6017|6021|6022|6023|6024|6025|6026|6027|6030|6031|6032|6033|6034|7932|7933|8053|8280|8290|8291|9000|9141|9168)\\d{10}$",
|
|
3083
|
+
"confidence": "high"
|
|
3084
3084
|
},
|
|
3085
3085
|
{
|
|
3086
3086
|
"pattern": "^00\\d{4}00\\d{14}$",
|
|
3087
|
-
"confidence": "
|
|
3087
|
+
"confidence": "low"
|
|
3088
3088
|
},
|
|
3089
3089
|
{
|
|
3090
3090
|
"pattern": "^00\\d{4}00\\d{14}001$",
|
|
@@ -53755,7 +53755,7 @@
|
|
|
53755
53755
|
],
|
|
53756
53756
|
"detectionRules": [
|
|
53757
53757
|
{
|
|
53758
|
-
"pattern": "^(?:AE|EG|GH|IE|KE|KZ|MA|MU|MV|NG|PK|RE|RW|SA|TR|UG|ZA|ZM)\\d{12}T?$",
|
|
53758
|
+
"pattern": "^(?:AE|CV|EG|GH|IE|KE|KZ|MA|MU|MV|NG|PK|RE|RW|SA|TR|UG|ZA|ZM)\\d{12}T?$",
|
|
53759
53759
|
"confidence": "low"
|
|
53760
53760
|
},
|
|
53761
53761
|
{
|
|
@@ -1645,9 +1645,21 @@
|
|
|
1645
1645
|
},
|
|
1646
1646
|
{
|
|
1647
1647
|
"input": "0030180030183005437999",
|
|
1648
|
-
"carrier": "
|
|
1649
|
-
"confidence": "
|
|
1648
|
+
"carrier": "unknown",
|
|
1649
|
+
"confidence": "low",
|
|
1650
1650
|
"candidates": [
|
|
1651
|
+
"tipsa",
|
|
1652
|
+
"austrian-post",
|
|
1653
|
+
"ctt-express",
|
|
1654
|
+
"usps",
|
|
1655
|
+
"estafeta"
|
|
1656
|
+
],
|
|
1657
|
+
"preferred": [
|
|
1658
|
+
"tipsa"
|
|
1659
|
+
],
|
|
1660
|
+
"asked": [
|
|
1661
|
+
"tipsa",
|
|
1662
|
+
"austrian-post",
|
|
1651
1663
|
"ctt-express"
|
|
1652
1664
|
]
|
|
1653
1665
|
},
|
|
@@ -4103,6 +4115,26 @@
|
|
|
4103
4115
|
"nz-post"
|
|
4104
4116
|
]
|
|
4105
4117
|
},
|
|
4118
|
+
{
|
|
4119
|
+
"input": "0087650087651234567890",
|
|
4120
|
+
"carrier": "unknown",
|
|
4121
|
+
"confidence": "low",
|
|
4122
|
+
"candidates": [
|
|
4123
|
+
"tipsa",
|
|
4124
|
+
"austrian-post",
|
|
4125
|
+
"ctt-express",
|
|
4126
|
+
"usps",
|
|
4127
|
+
"estafeta"
|
|
4128
|
+
],
|
|
4129
|
+
"preferred": [
|
|
4130
|
+
"tipsa"
|
|
4131
|
+
],
|
|
4132
|
+
"asked": [
|
|
4133
|
+
"tipsa",
|
|
4134
|
+
"austrian-post",
|
|
4135
|
+
"ctt-express"
|
|
4136
|
+
]
|
|
4137
|
+
},
|
|
4106
4138
|
{
|
|
4107
4139
|
"input": "008999093988120260720",
|
|
4108
4140
|
"carrier": "unknown",
|
|
@@ -84332,6 +84364,17 @@
|
|
|
84332
84364
|
"la-poste"
|
|
84333
84365
|
]
|
|
84334
84366
|
},
|
|
84367
|
+
{
|
|
84368
|
+
"input": "CV123456789012",
|
|
84369
|
+
"carrier": "unknown",
|
|
84370
|
+
"confidence": "low",
|
|
84371
|
+
"candidates": [
|
|
84372
|
+
"speedaf"
|
|
84373
|
+
],
|
|
84374
|
+
"asked": [
|
|
84375
|
+
"speedaf"
|
|
84376
|
+
]
|
|
84377
|
+
},
|
|
84335
84378
|
{
|
|
84336
84379
|
"input": "CV176951644IN",
|
|
84337
84380
|
"carrier": "india-post",
|
package/dist/browser/scraper.js
CHANGED
|
@@ -2455,12 +2455,12 @@ var t = {
|
|
|
2455
2455
|
}],
|
|
2456
2456
|
detectionRules: [
|
|
2457
2457
|
{
|
|
2458
|
-
pattern: "^
|
|
2459
|
-
confidence: "
|
|
2458
|
+
pattern: "^00\\d{4}00(?:0002|0207|0301|0421|0506|0604|0720|0721|0722|0818|0829|0868|0899|0908|0912|1000|1055|1060|1094|1095|1103|1124|1129|1130|1132|1214|1306|1315|1415|1423|1514|1522|1534|1605|1721|1820|1834|1903|2002|2005|2101|2209|2315|2411|2412|2530|2611|2712|2903|3008|3010|3029|3102|3115|3202|3326|3405|3501|3510|3513|3515|3516|3631|3633|3708|3802|3808|3911|4000|4005|4024|4030|4034|4037|4047|4050|4053|4101|4202|4304|4332|4407|4521|4522|4638|4653|4700|4707|4815|4907|5004|6001|6002|6003|6005|6008|6009|6010|6011|6012|6013|6017|6021|6022|6023|6024|6025|6026|6027|6030|6031|6032|6033|6034|7932|7933|8053|8280|8290|8291|9000|9141|9168)\\d{10}$",
|
|
2459
|
+
confidence: "high"
|
|
2460
2460
|
},
|
|
2461
2461
|
{
|
|
2462
2462
|
pattern: "^00\\d{4}00\\d{14}$",
|
|
2463
|
-
confidence: "
|
|
2463
|
+
confidence: "low"
|
|
2464
2464
|
},
|
|
2465
2465
|
{
|
|
2466
2466
|
pattern: "^00\\d{4}00\\d{14}001$",
|
|
@@ -40800,7 +40800,7 @@ var t = {
|
|
|
40800
40800
|
params: ["tradeNo"]
|
|
40801
40801
|
}],
|
|
40802
40802
|
detectionRules: [{
|
|
40803
|
-
pattern: "^(?:AE|EG|GH|IE|KE|KZ|MA|MU|MV|NG|PK|RE|RW|SA|TR|UG|ZA|ZM)\\d{12}T?$",
|
|
40803
|
+
pattern: "^(?:AE|CV|EG|GH|IE|KE|KZ|MA|MU|MV|NG|PK|RE|RW|SA|TR|UG|ZA|ZM)\\d{12}T?$",
|
|
40804
40804
|
confidence: "low"
|
|
40805
40805
|
}, {
|
|
40806
40806
|
pattern: "^(?:AE|EG|GH|KE|KZ|MA|MU|MV|NG|PK|RE|RW|SA|TR|UG|ZA|ZM)\\d{9}[ER]$",
|
|
@@ -49459,8 +49459,8 @@ var t = {
|
|
|
49459
49459
|
nacex: ["nacex-1"],
|
|
49460
49460
|
ctt: ["ctt-1"],
|
|
49461
49461
|
"ctt-express": [
|
|
49462
|
-
"ctt-express-3",
|
|
49463
49462
|
"ctt-express-1",
|
|
49463
|
+
"ctt-express-3",
|
|
49464
49464
|
"ctt-express-2"
|
|
49465
49465
|
],
|
|
49466
49466
|
"poste-italiane": [
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
],
|
|
68
68
|
"detection": [
|
|
69
69
|
{
|
|
70
|
-
"id": "ctt-express-
|
|
71
|
-
"pattern": "^
|
|
72
|
-
"confidence": "
|
|
70
|
+
"id": "ctt-express-1",
|
|
71
|
+
"pattern": "^00\\d{4}00(?:0002|0207|0301|0421|0506|0604|0720|0721|0722|0818|0829|0868|0899|0908|0912|1000|1055|1060|1094|1095|1103|1124|1129|1130|1132|1214|1306|1315|1415|1423|1514|1522|1534|1605|1721|1820|1834|1903|2002|2005|2101|2209|2315|2411|2412|2530|2611|2712|2903|3008|3010|3029|3102|3115|3202|3326|3405|3501|3510|3513|3515|3516|3631|3633|3708|3802|3808|3911|4000|4005|4024|4030|4034|4037|4047|4050|4053|4101|4202|4304|4332|4407|4521|4522|4638|4653|4700|4707|4815|4907|5004|6001|6002|6003|6005|6008|6009|6010|6011|6012|6013|6017|6021|6022|6023|6024|6025|6026|6027|6030|6031|6032|6033|6034|7932|7933|8053|8280|8290|8291|9000|9141|9168)\\d{10}$",
|
|
72
|
+
"confidence": "high"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
|
-
"id": "ctt-express-
|
|
75
|
+
"id": "ctt-express-3",
|
|
76
76
|
"pattern": "^00\\d{4}00\\d{14}$",
|
|
77
|
-
"confidence": "
|
|
77
|
+
"confidence": "low"
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
"id": "ctt-express-2",
|
|
@@ -218,8 +218,15 @@
|
|
|
218
218
|
"reportedRole": "reported_shipment"
|
|
219
219
|
},
|
|
220
220
|
"expect": {
|
|
221
|
-
"carrier": "
|
|
222
|
-
"confidence": "
|
|
221
|
+
"carrier": "unknown",
|
|
222
|
+
"confidence": "low",
|
|
223
|
+
"candidates": [
|
|
224
|
+
"tipsa",
|
|
225
|
+
"austrian-post",
|
|
226
|
+
"ctt-express",
|
|
227
|
+
"usps",
|
|
228
|
+
"estafeta"
|
|
229
|
+
]
|
|
223
230
|
},
|
|
224
231
|
"note": "Called an order number by the poster; CTT Express's tracker returns its history."
|
|
225
232
|
},
|
|
@@ -21,6 +21,15 @@ export const GLS_ITALY_SCANS = {
|
|
|
21
21
|
'Parcel not delivered as the consignee was absent, please book redelivery within 3 working days as per instructions provided by email or sms.': 'failed_attempt',
|
|
22
22
|
// Held at the depot until the recipient answers the redelivery link.
|
|
23
23
|
'Not in delivery. Awaiting instructions by link included in received email or sms': 'exception',
|
|
24
|
+
// A shipment sent on to another GLS country gets that country's GLS group sentences. Its
|
|
25
|
+
// receipt from GLS Italy is a handover to GLS after the shipment has left the sending depot,
|
|
26
|
+
// so it is no acceptance: GLS Italy's own first movement is the sending depot's dispatch.
|
|
27
|
+
'The parcel was handed over to GLS.': 'in_transit',
|
|
28
|
+
'The parcel data was entered into the GLS IT system; the parcel was not yet handed over to GLS.': 'registered',
|
|
29
|
+
'Forwarded abroad': 'in_transit',
|
|
30
|
+
'The parcel has left the parcel center.': 'in_transit',
|
|
31
|
+
'The parcel has reached the parcel center.': 'in_transit',
|
|
32
|
+
'The parcel is expected to be delivered during the day.': 'out_for_delivery',
|
|
24
33
|
};
|
|
25
34
|
/**
|
|
26
35
|
* The Italian sentences the English locale sometimes answers with instead, and
|
|
@@ -69,9 +78,11 @@ export function glsItalyBookedDay(sentence) {
|
|
|
69
78
|
const day = new Date(Date.UTC(year, month - 1, date));
|
|
70
79
|
return day.getUTCMonth() === month - 1 && day.getUTCDate() === date ? `${year}-${match[2]}-${match[1]}` : undefined;
|
|
71
80
|
}
|
|
81
|
+
// The receiving depot serves the recipient's area only every few days, so the shipment waits there.
|
|
82
|
+
const AREA_SERVED = /^area served in \d{1,3} hours, we will deliver within the next [a-z]+ business days\.?$/;
|
|
72
83
|
/** The stage the map gives a sentence, by `normalizeStatusWording` form. */
|
|
73
84
|
function mappedStage(wording) {
|
|
74
|
-
return SCANS.get(wording) ?? (BOOKED.test(paddedDate(wording)) ? 'in_transit' : undefined);
|
|
85
|
+
return SCANS.get(wording) ?? (BOOKED.test(paddedDate(wording)) || AREA_SERVED.test(wording) ? 'in_transit' : undefined);
|
|
75
86
|
}
|
|
76
87
|
/** The stage a scan's sentence gives it: the map first, then the shared wording rules. */
|
|
77
88
|
export function glsItalyScanStage(sentence) {
|
|
@@ -89,6 +89,62 @@
|
|
|
89
89
|
"firstSeen": "2026-10-11",
|
|
90
90
|
"note": "Held at the depot after a failed attempt until the recipient books a redelivery through the link."
|
|
91
91
|
},
|
|
92
|
+
{
|
|
93
|
+
"wording": "The parcel was handed over to GLS.",
|
|
94
|
+
"language": "en",
|
|
95
|
+
"stage": "in_transit",
|
|
96
|
+
"confirmedBy": "live",
|
|
97
|
+
"firstSeen": "2026-11-19",
|
|
98
|
+
"note": "On a shipment sent on to another GLS country, that country's receipt of it from GLS Italy, after the sending depot's dispatch. It is no acceptance."
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"wording": "The parcel data was entered into the GLS IT system; the parcel was not yet handed over to GLS.",
|
|
102
|
+
"language": "en",
|
|
103
|
+
"stage": "registered",
|
|
104
|
+
"confirmedBy": "live",
|
|
105
|
+
"firstSeen": "2026-11-19",
|
|
106
|
+
"note": "The next GLS country's pre-advice of a shipment GLS Italy sends on. Written after the dispatch, it reads as in transit."
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"wording": "Forwarded abroad",
|
|
110
|
+
"language": "en",
|
|
111
|
+
"stage": "in_transit",
|
|
112
|
+
"confirmedBy": "live",
|
|
113
|
+
"firstSeen": "2026-11-19",
|
|
114
|
+
"note": "GLS Italy sent the shipment on to another GLS country."
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"wording": "The parcel has left the parcel center.",
|
|
118
|
+
"language": "en",
|
|
119
|
+
"stage": "in_transit",
|
|
120
|
+
"confirmedBy": "live",
|
|
121
|
+
"firstSeen": "2026-11-19",
|
|
122
|
+
"note": "A depot of the next GLS country dispatched the shipment."
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"wording": "The parcel has reached the parcel center.",
|
|
126
|
+
"language": "en",
|
|
127
|
+
"stage": "in_transit",
|
|
128
|
+
"confirmedBy": "live",
|
|
129
|
+
"firstSeen": "2026-11-19",
|
|
130
|
+
"note": "A depot of the next GLS country received the shipment."
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"wording": "The parcel is expected to be delivered during the day.",
|
|
134
|
+
"language": "en",
|
|
135
|
+
"stage": "out_for_delivery",
|
|
136
|
+
"confirmedBy": "live",
|
|
137
|
+
"firstSeen": "2026-11-19",
|
|
138
|
+
"note": "The next GLS country's morning scan of the delivery round."
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"wording": "Area served in <n> hours, we will deliver within the next two business days.",
|
|
142
|
+
"language": "en",
|
|
143
|
+
"stage": "in_transit",
|
|
144
|
+
"confirmedBy": "live",
|
|
145
|
+
"firstSeen": "2026-11-19",
|
|
146
|
+
"note": "The receiving depot serves the recipient's area only every so many hours, so the shipment waits there for the next round."
|
|
147
|
+
},
|
|
92
148
|
{
|
|
93
149
|
"wording": "La spedizione e' stata creata dal mittente, attendiamo che ci venga affidata per l'invio a destinazione.",
|
|
94
150
|
"language": "it",
|
|
@@ -32,6 +32,8 @@ const LOADED_FLIGHT = /^(预计配载航班)\d{1,2}月\d{1,2}日[,,] ?(expecte
|
|
|
32
32
|
const EXPECTED_FLIGHT = /^(expected flight on )[a-z]{3,9}\.? ?\d{1,2}(?:st|nd|rd|th)$/;
|
|
33
33
|
// On the line into Canada the hand-over to the delivering courier names it: "Your package has been handed over to the courier Example".
|
|
34
34
|
const HANDED_TO_COURIER = /^(your package has been handed over to the courier )\S.*$/;
|
|
35
|
+
// DHL's record of the recipient's choice of another address names it: "The recipient has selected a new one-time delivery address: …".
|
|
36
|
+
const NEW_ADDRESS = /^(the recipient has selected a new one-time delivery address: )\S.*$/;
|
|
35
37
|
// On the line into Mexico the booked flight is in Spanish, naming the destination and the day:
|
|
36
38
|
// "Se espera que el vuelo salga hacia México el 3 de noviembre". The flight then names the destination.
|
|
37
39
|
const SPANISH_FLIGHT = /^(se espera que el vuelo salga hacia )[^\d…]{1,40}?( el )\d{1,2} de [a-z]+$/;
|
|
@@ -59,7 +61,7 @@ export const jrtScanKey = (wording) => jtMexicoKey(wording).replace(FLIGHT_DAY,
|
|
|
59
61
|
.replace(CLEARED_FLIGHT_DAY, '$1…$2…').replace(TAKE_OFF_DAY, '$1…')
|
|
60
62
|
.replace(FLIGHT_DATES, '$1…$2…').replace(LANDING_DATE, '$1…$2').replace(BOOKED_FLIGHT, '…$1').replace(ESTIMATED_DAY, '$1…')
|
|
61
63
|
.replace(PORT_FLIGHT_DAY, '货物到达口岸,预计…号航班起飞').replace(EXPECTED_FLIGHT_DAY, '$1…$2')
|
|
62
|
-
.replace(SCHEDULED_FLIGHT, '$1…$2…').replace(LOADED_FLIGHT, '$1…月…日,$2…').replace(EXPECTED_FLIGHT, '$1…').replace(HANDED_TO_COURIER, '$1…').replace(SPANISH_FLIGHT, '$1…$2…').replace(FLIGHT_EN_ROUTE, '$1…')
|
|
64
|
+
.replace(SCHEDULED_FLIGHT, '$1…$2…').replace(LOADED_FLIGHT, '$1…月…日,$2…').replace(EXPECTED_FLIGHT, '$1…').replace(HANDED_TO_COURIER, '$1…').replace(NEW_ADDRESS, '$1…').replace(SPANISH_FLIGHT, '$1…$2…').replace(FLIGHT_EN_ROUTE, '$1…')
|
|
63
65
|
.replace(TRANSPORTED_TO, '$1…').replace(DELAYED_FLIGHT, '$1…$2…');
|
|
64
66
|
/**
|
|
65
67
|
* The stage JRT's map gives a row, by its whole `normalizeStatusWording` wording:
|
|
@@ -82,8 +84,9 @@ const UPS_ROWS = new Set(['发件人已创建标签,但是 UPS 尚未收到包
|
|
|
82
84
|
/** Whether a row is one UPS wrote, by its wording or its place in the United States: it is on UPS's wall clock. */
|
|
83
85
|
export const isJrtUpsRow = (wording, place) => UPS_ROWS.has(normalizeStatusWording(wording)) || /(?:^|,)\s*US$/.test(place.trim());
|
|
84
86
|
// DHL's English sentences, as the tracker copies them on the line into Europe: "The shipment has arrived at the parcel center.",
|
|
85
|
-
// the recipient's preferred location for its delivery,
|
|
86
|
-
|
|
87
|
+
// the recipient's preferred location for its delivery, a round that found no one, or no such recipient, at the address,
|
|
88
|
+
// and the recipient's choice of another address.
|
|
89
|
+
const DHL_SENTENCE = /^the (?:international )?shipment\b|^the instruction data for this shipment\b|^a preferred location was designated as a reception option for this shipment\b|^the recipient (?:was not present|could not be found|has selected)\b/i;
|
|
87
90
|
// DHL's rows from Germany, before the parcel leaves for the destination country: the sender's data, the transport to
|
|
88
91
|
// DHL, the parcel centre of origin, the export parcel centre and the transport abroad.
|
|
89
92
|
const DHL_GERMAN_ROW = /^the instruction data\b|\b(?:in transit to dhl|of origin|export parcel center|transported to the destination country)\b/i;
|
|
@@ -1192,6 +1192,14 @@
|
|
|
1192
1192
|
"firstSeen": "2026-11-11",
|
|
1193
1193
|
"note": "Copied from DHL: the recipient's preferred place for the delivery, recorded while the parcel is still on its way to DHL. It moves nothing."
|
|
1194
1194
|
},
|
|
1195
|
+
{
|
|
1196
|
+
"wording": "The recipient has selected a new one-time delivery address: …",
|
|
1197
|
+
"language": "en",
|
|
1198
|
+
"stage": "pending",
|
|
1199
|
+
"confirmedBy": "live",
|
|
1200
|
+
"firstSeen": "2026-11-19",
|
|
1201
|
+
"note": "Copied from DHL at the destination, on its clock there: the recipient's choice of another address for this delivery, which the sentence names. It moves nothing."
|
|
1202
|
+
},
|
|
1195
1203
|
{
|
|
1196
1204
|
"wording": "分拣包裹已出库",
|
|
1197
1205
|
"language": "zh",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"detection": [
|
|
115
115
|
{
|
|
116
116
|
"id": "speedaf-12",
|
|
117
|
-
"pattern": "^(?:AE|EG|GH|IE|KE|KZ|MA|MU|MV|NG|PK|RE|RW|SA|TR|UG|ZA|ZM)\\d{12}T?$",
|
|
117
|
+
"pattern": "^(?:AE|CV|EG|GH|IE|KE|KZ|MA|MU|MV|NG|PK|RE|RW|SA|TR|UG|ZA|ZM)\\d{12}T?$",
|
|
118
118
|
"confidence": "low"
|
|
119
119
|
},
|
|
120
120
|
{
|
|
@@ -753,6 +753,21 @@
|
|
|
753
753
|
]
|
|
754
754
|
},
|
|
755
755
|
"note": "Made-up number in the shape of an Irish one: IE and twelve digits, the layout Speedaf gives its parcels for other countries. Speedaf's site lists a customer service in Ireland; no public page shows an Irish number. Its serial sits far beyond the range in use."
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"number": "CV123456789012",
|
|
759
|
+
"role": "shipment",
|
|
760
|
+
"evidence": "synthetic",
|
|
761
|
+
"derivedFrom": "donated_real",
|
|
762
|
+
"shapeConfirmed": "2026-11-19",
|
|
763
|
+
"expect": {
|
|
764
|
+
"carrier": "unknown",
|
|
765
|
+
"confidence": "low",
|
|
766
|
+
"candidates": [
|
|
767
|
+
"speedaf"
|
|
768
|
+
]
|
|
769
|
+
},
|
|
770
|
+
"note": "Made-up number in the shape of a Cape Verdean one: CV and twelve digits. Speedaf's tracker answers a number in this layout with Cabo Verde as its destination; no public page shows one."
|
|
756
771
|
}
|
|
757
772
|
]
|
|
758
773
|
}
|
|
@@ -268,8 +268,9 @@ function projectFleetRow(row) {
|
|
|
268
268
|
const line = worded;
|
|
269
269
|
// The hub leaves the wording, so it reads the same from hub to hub, and is the place of
|
|
270
270
|
// the hub taking the parcel in. A pickup or a delivery names the hub that made it, not
|
|
271
|
-
// where it happened.
|
|
272
|
-
|
|
271
|
+
// where it happened. A delivery round keeps its hub, which tells it from the bare
|
|
272
|
+
// "Delivering" of the order's creation, as stored rows are read again.
|
|
273
|
+
const hub = /^delivering$/i.test(code) ? null : HUB.exec(line);
|
|
273
274
|
// A line haul's unloading keeps its verb, at the hub it names; the transfer and trip ids
|
|
274
275
|
// leave, as does the transfer id of a line haul leaving for a hub.
|
|
275
276
|
const haul = LINE_HAUL.exec(line);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ClassifiedWording, type Stage } from '../../core/status/index.js';
|
|
2
2
|
import type { CarrierStatusMap } from '../../core/status/statusMap.js';
|
|
3
|
-
/** The stage SPX's order code or fleet status gives a scan. */
|
|
4
|
-
export declare function spxBrMappedStage(code: string): Stage | undefined;
|
|
3
|
+
/** The stage SPX's order code or fleet status gives a scan with this wording. */
|
|
4
|
+
export declare function spxBrMappedStage(code: string, wording: string): Stage | undefined;
|
|
5
5
|
/** A scan's stage: its code, else the shared wording rules, else nothing. */
|
|
6
6
|
export declare function spxBrStage(code: string, wording: string): ClassifiedWording | null;
|
|
7
7
|
export declare const statusMap: CarrierStatusMap;
|
|
@@ -58,25 +58,32 @@ const FLEET = new Map([
|
|
|
58
58
|
// A courier takes the parcel from the last-mile hub to a service point and hands it over ("Pacote entrege"):
|
|
59
59
|
// the page's milestones stay at sorting, before the courier's delivery and the delivery.
|
|
60
60
|
['Transporting_to_sp', 'in_transit'], ['Transported_to_sp', 'in_transit'],
|
|
61
|
-
|
|
61
|
+
// A delivery round, F600. Its line opens with the hub that sends the courier out; see `ROUND`.
|
|
62
|
+
['Delivering', 'out_for_delivery'],
|
|
62
63
|
['Delivered', 'delivered'], // F980.
|
|
63
64
|
['3PL_Delivered', 'delivered'], // Delivered by the partner carrier SPX handed the parcel to after its sorting centre.
|
|
64
65
|
['Start_Confiscation', 'exception'], // The parcel entered confiscation: it is held, not delivered.
|
|
65
66
|
].map(([status, stage]) => [status.toUpperCase(), stage]));
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
// The fleet feed also sends "Delivering" with no hub, the day the order is created: the order handed
|
|
68
|
+
// to SPX's delivery chain, which a hub's round or the delivery follows hours or days later. Only a
|
|
69
|
+
// line that names its hub, "[OF Hub_…] Seu pacote está sendo entregue pelo entregador", is the round.
|
|
70
|
+
const ROUND = /^\[[^\]]+\]/;
|
|
71
|
+
/** The stage SPX's order code or fleet status gives a scan with this wording. */
|
|
72
|
+
export function spxBrMappedStage(code, wording) {
|
|
68
73
|
const key = code.toUpperCase();
|
|
74
|
+
if (key === 'DELIVERING' && !ROUND.test(wording.trim()))
|
|
75
|
+
return 'in_transit';
|
|
69
76
|
return CODES.get(key) ?? FLEET.get(key);
|
|
70
77
|
}
|
|
71
78
|
/** A scan's stage: its code, else the shared wording rules, else nothing. */
|
|
72
79
|
export function spxBrStage(code, wording) {
|
|
73
|
-
const mapped = spxBrMappedStage(code);
|
|
80
|
+
const mapped = spxBrMappedStage(code, wording);
|
|
74
81
|
if (mapped)
|
|
75
82
|
return { stage: mapped, source: 'carrier_map' };
|
|
76
83
|
const worded = classifyWording(wording, 'in_transit');
|
|
77
84
|
return worded.source === 'none' ? null : worded;
|
|
78
85
|
}
|
|
79
86
|
export const statusMap = {
|
|
80
|
-
stage: (code) => (code ? spxBrMappedStage(code) : undefined),
|
|
87
|
+
stage: (code, wording) => (code ? spxBrMappedStage(code, wording) : undefined),
|
|
81
88
|
gaps: [],
|
|
82
89
|
};
|
|
@@ -578,11 +578,19 @@
|
|
|
578
578
|
},
|
|
579
579
|
{
|
|
580
580
|
"code": "Delivering",
|
|
581
|
-
"wording": "Seu pacote está sendo entregue pelo entregador",
|
|
581
|
+
"wording": "[…] Seu pacote está sendo entregue pelo entregador",
|
|
582
582
|
"language": "pt",
|
|
583
583
|
"stage": "out_for_delivery",
|
|
584
584
|
"confirmedBy": "live",
|
|
585
|
-
"note": "Fleet feed: paired with F600."
|
|
585
|
+
"note": "Fleet feed: paired with F600. The round opens with the hub that sends the courier out, which stays in the wording."
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"code": "Delivering",
|
|
589
|
+
"wording": "Seu pacote está sendo entregue pelo entregador",
|
|
590
|
+
"language": "pt",
|
|
591
|
+
"stage": "in_transit",
|
|
592
|
+
"confirmedBy": "live",
|
|
593
|
+
"note": "Fleet feed: the same line with no hub, sent the day the order is created. The order is handed to SPX's delivery chain; a hub's round or the delivery comes hours or days later."
|
|
586
594
|
},
|
|
587
595
|
{
|
|
588
596
|
"code": "Delivered",
|
|
@@ -236,6 +236,25 @@
|
|
|
236
236
|
]
|
|
237
237
|
},
|
|
238
238
|
"note": "Publicly reported shipment number; the attribution was not independently verified. The source attributes it to TIPSA, which stays one candidate among several."
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"number": "0087650087651234567890",
|
|
242
|
+
"role": "shipment",
|
|
243
|
+
"evidence": "synthetic",
|
|
244
|
+
"derivedFrom": "donated_real",
|
|
245
|
+
"shapeConfirmed": "2026-11-19",
|
|
246
|
+
"expect": {
|
|
247
|
+
"carrier": "unknown",
|
|
248
|
+
"confidence": "low",
|
|
249
|
+
"candidates": [
|
|
250
|
+
"tipsa",
|
|
251
|
+
"austrian-post",
|
|
252
|
+
"ctt-express",
|
|
253
|
+
"usps",
|
|
254
|
+
"estafeta"
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
"note": "Made-up reference in the shape of a TIPSA one from the province of Barcelona: agency 008765 twice and a ten-digit counter. Its origin agency is not in CTT Express's published list, so both carriers are offered."
|
|
239
258
|
}
|
|
240
259
|
]
|
|
241
260
|
}
|
package/dist/data/catalog.json
CHANGED
|
@@ -3079,12 +3079,12 @@
|
|
|
3079
3079
|
],
|
|
3080
3080
|
"detectionRules": [
|
|
3081
3081
|
{
|
|
3082
|
-
"pattern": "^
|
|
3083
|
-
"confidence": "
|
|
3082
|
+
"pattern": "^00\\d{4}00(?:0002|0207|0301|0421|0506|0604|0720|0721|0722|0818|0829|0868|0899|0908|0912|1000|1055|1060|1094|1095|1103|1124|1129|1130|1132|1214|1306|1315|1415|1423|1514|1522|1534|1605|1721|1820|1834|1903|2002|2005|2101|2209|2315|2411|2412|2530|2611|2712|2903|3008|3010|3029|3102|3115|3202|3326|3405|3501|3510|3513|3515|3516|3631|3633|3708|3802|3808|3911|4000|4005|4024|4030|4034|4037|4047|4050|4053|4101|4202|4304|4332|4407|4521|4522|4638|4653|4700|4707|4815|4907|5004|6001|6002|6003|6005|6008|6009|6010|6011|6012|6013|6017|6021|6022|6023|6024|6025|6026|6027|6030|6031|6032|6033|6034|7932|7933|8053|8280|8290|8291|9000|9141|9168)\\d{10}$",
|
|
3083
|
+
"confidence": "high"
|
|
3084
3084
|
},
|
|
3085
3085
|
{
|
|
3086
3086
|
"pattern": "^00\\d{4}00\\d{14}$",
|
|
3087
|
-
"confidence": "
|
|
3087
|
+
"confidence": "low"
|
|
3088
3088
|
},
|
|
3089
3089
|
{
|
|
3090
3090
|
"pattern": "^00\\d{4}00\\d{14}001$",
|
|
@@ -53755,7 +53755,7 @@
|
|
|
53755
53755
|
],
|
|
53756
53756
|
"detectionRules": [
|
|
53757
53757
|
{
|
|
53758
|
-
"pattern": "^(?:AE|EG|GH|IE|KE|KZ|MA|MU|MV|NG|PK|RE|RW|SA|TR|UG|ZA|ZM)\\d{12}T?$",
|
|
53758
|
+
"pattern": "^(?:AE|CV|EG|GH|IE|KE|KZ|MA|MU|MV|NG|PK|RE|RW|SA|TR|UG|ZA|ZM)\\d{12}T?$",
|
|
53759
53759
|
"confidence": "low"
|
|
53760
53760
|
},
|
|
53761
53761
|
{
|
|
@@ -3080,12 +3080,12 @@ export const CARRIER_CATALOG = {
|
|
|
3080
3080
|
],
|
|
3081
3081
|
"detectionRules": [
|
|
3082
3082
|
{
|
|
3083
|
-
"pattern": "^
|
|
3084
|
-
"confidence": "
|
|
3083
|
+
"pattern": "^00\\d{4}00(?:0002|0207|0301|0421|0506|0604|0720|0721|0722|0818|0829|0868|0899|0908|0912|1000|1055|1060|1094|1095|1103|1124|1129|1130|1132|1214|1306|1315|1415|1423|1514|1522|1534|1605|1721|1820|1834|1903|2002|2005|2101|2209|2315|2411|2412|2530|2611|2712|2903|3008|3010|3029|3102|3115|3202|3326|3405|3501|3510|3513|3515|3516|3631|3633|3708|3802|3808|3911|4000|4005|4024|4030|4034|4037|4047|4050|4053|4101|4202|4304|4332|4407|4521|4522|4638|4653|4700|4707|4815|4907|5004|6001|6002|6003|6005|6008|6009|6010|6011|6012|6013|6017|6021|6022|6023|6024|6025|6026|6027|6030|6031|6032|6033|6034|7932|7933|8053|8280|8290|8291|9000|9141|9168)\\d{10}$",
|
|
3084
|
+
"confidence": "high"
|
|
3085
3085
|
},
|
|
3086
3086
|
{
|
|
3087
3087
|
"pattern": "^00\\d{4}00\\d{14}$",
|
|
3088
|
-
"confidence": "
|
|
3088
|
+
"confidence": "low"
|
|
3089
3089
|
},
|
|
3090
3090
|
{
|
|
3091
3091
|
"pattern": "^00\\d{4}00\\d{14}001$",
|
|
@@ -53756,7 +53756,7 @@ export const CARRIER_CATALOG = {
|
|
|
53756
53756
|
],
|
|
53757
53757
|
"detectionRules": [
|
|
53758
53758
|
{
|
|
53759
|
-
"pattern": "^(?:AE|EG|GH|IE|KE|KZ|MA|MU|MV|NG|PK|RE|RW|SA|TR|UG|ZA|ZM)\\d{12}T?$",
|
|
53759
|
+
"pattern": "^(?:AE|CV|EG|GH|IE|KE|KZ|MA|MU|MV|NG|PK|RE|RW|SA|TR|UG|ZA|ZM)\\d{12}T?$",
|
|
53760
53760
|
"confidence": "low"
|
|
53761
53761
|
},
|
|
53762
53762
|
{
|
|
@@ -66970,7 +66970,7 @@ export const DETECTION_RULE_IDS = {
|
|
|
66970
66970
|
"mrw": ["mrw-1", "mrw-2"],
|
|
66971
66971
|
"nacex": ["nacex-1"],
|
|
66972
66972
|
"ctt": ["ctt-1"],
|
|
66973
|
-
"ctt-express": ["ctt-express-
|
|
66973
|
+
"ctt-express": ["ctt-express-1", "ctt-express-3", "ctt-express-2"],
|
|
66974
66974
|
"poste-italiane": ["poste-italiane-1", "poste-italiane-2", "poste-italiane-plate", "poste-italiane-3", "poste-italiane-posta1", "poste-italiane-4", "poste-italiane-delivery-web", "poste-italiane-delivery-europe", "poste-italiane-international-express", "poste-italiane-own", "poste-italiane-s10", "poste-italiane-deliverybox", "poste-italiane-sda-domestic", "poste-italiane-promopacco", "poste-italiane-d", "poste-italiane-gf", "poste-italiane-registered"],
|
|
66975
66975
|
"brt": ["brt-1", "brt-shipment-number", "brt-parcel-id", "brt-customer-parcel-id"],
|
|
66976
66976
|
"ecoscooting": ["ecoscooting-postcode-label", "ecoscooting-postcode", "ecoscooting-1", "ecoscooting-2", "ecoscooting-without-cn", "ecoscooting-shein-package"],
|
|
@@ -87,6 +87,9 @@ const ADAPTER_NUMBERS = {
|
|
|
87
87
|
const NAME_SISTERS = {
|
|
88
88
|
'fan-courier': ['fan-courier-international'],
|
|
89
89
|
};
|
|
90
|
+
// A carrier's name: letters with their marks (Thai, Lao and Indic scripts write vowels as marks), digits and
|
|
91
|
+
// the punctuation names carry (GO! Express, Kuehne+Nagel, WE|DO, time:matters, A/S, «…», (…)), but no address.
|
|
92
|
+
const CARRIER_NAME = /^(?!.*:\/\/)[\p{L}\p{M}\p{N} .,&'’‘()()«»+!:/|@·・–—-]+$/u;
|
|
90
93
|
/**
|
|
91
94
|
* Names are hints only. A direct adapter must confirm the shipment before
|
|
92
95
|
* adoption. The looked-up number resolves a bare brand name, and rules out a
|
|
@@ -103,7 +106,7 @@ const NAME_SISTERS = {
|
|
|
103
106
|
*/
|
|
104
107
|
export function universalCarrierHints(raw, trackingNumber) {
|
|
105
108
|
const names = [...new Set(raw.filter((value) => typeof value === 'string'
|
|
106
|
-
&& value.length <= 80 &&
|
|
109
|
+
&& value.length <= 80 && CARRIER_NAME.test(value)).map((value) => value.trim()))].filter(Boolean).slice(0, 10);
|
|
107
110
|
const refused = new Set(trackingNumber ? [...checksumFailures(trackingNumber)
|
|
108
111
|
.filter(({ rule }) => ADAPTER_CHECKED_RULES.has(rule) || NAME_CHECKED_RULES.has(rule)).map(({ carrier }) => carrier),
|
|
109
112
|
...Object.keys(ADAPTER_NUMBERS).filter((carrier) => !ADAPTER_NUMBERS[carrier](trackingNumber))] : []);
|
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.
|
|
3
|
+
"version": "0.1197.2-main.7034",
|
|
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",
|