universal-parcel-scraper 0.684.2-main.3245 → 0.686.0-main.3253
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 +2 -2
- package/data/catalog.json +8 -1
- package/data/coverage-summary.json +1 -1
- package/data/detection-golden.json +13 -0
- package/dist/browser/scraper.js +25 -10
- package/dist/carriers/asendia/adapter.d.ts +5 -7
- package/dist/carriers/asendia/adapter.js +10 -66
- package/dist/carriers/asendia/status.d.ts +3 -11
- package/dist/carriers/asendia/status.js +0 -39
- package/dist/carriers/asendia/statuses.json +0 -168
- package/dist/carriers/correos-cuba/adapter.d.ts +20 -0
- package/dist/carriers/correos-cuba/adapter.js +93 -0
- package/dist/carriers/correos-cuba/carrier.json +38 -7
- package/dist/carriers/correos-cuba/parser.d.ts +24 -0
- package/dist/carriers/correos-cuba/parser.js +129 -0
- package/dist/carriers/correos-cuba/status.d.ts +8 -0
- package/dist/carriers/correos-cuba/status.js +41 -0
- package/dist/carriers/correos-cuba/statuses.json +8 -6
- package/dist/carriers/mondial-relay/adapter.d.ts +6 -1
- package/dist/carriers/mondial-relay/adapter.js +10 -0
- package/dist/carriers/mondial-relay/app.js +3 -0
- package/dist/carriers/mondial-relay/carrier.json +9 -0
- package/dist/carriers/mondial-relay/numbers.json +16 -0
- package/dist/core/catalog/statusMaps.js +2 -1
- package/dist/data/catalog.json +8 -1
- package/dist/generated/catalog.d.ts +7 -1
- package/dist/generated/catalog.js +9 -2
- package/dist/generated/recognition.js +1 -0
- package/dist/generated/registry.js +3 -1
- package/dist/server/openapi.json +1 -1
- package/package.json +1 -1
- package/dist/carriers/asendia/uk.d.ts +0 -20
- package/dist/carriers/asendia/uk.js +0 -222
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ The engine behind [Peek](https://peektracker.com) ([GitHub](https://github.com/p
|
|
|
13
13
|
[](LICENSE)
|
|
14
14
|
|
|
15
15
|
<!-- GENERATED:summary -->
|
|
16
|
-
**3,500+ carriers** through **
|
|
16
|
+
**3,500+ carriers** through **617 dedicated adapters** and **5 universal fallbacks**
|
|
17
17
|
|
|
18
18
|
<sub>792 catalog entries · 135 countries represented</sub>
|
|
19
19
|
<!-- /GENERATED:summary -->
|
|
@@ -155,7 +155,7 @@ createTracker({ providers: ['ParcelsApp', 'Ship24', '17TRACK', 'Postal Ninja', '
|
|
|
155
155
|
<!-- GENERATED:stages -->
|
|
156
156
|
<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">
|
|
157
157
|
|
|
158
|
-
The carrier folders record 16,
|
|
158
|
+
The carrier folders record 16,560 such statuses, each filed under one stage.
|
|
159
159
|
<!-- /GENERATED:stages -->
|
|
160
160
|
|
|
161
161
|
Wording nobody recorded yet goes through a classifier that reads seven European languages.
|
package/data/catalog.json
CHANGED
|
@@ -1153,6 +1153,8 @@
|
|
|
1153
1153
|
"autoComplete": "postal-code"
|
|
1154
1154
|
}
|
|
1155
1155
|
],
|
|
1156
|
+
"recognitionRank": 894,
|
|
1157
|
+
"recognitionPattern": "^FV\\d{8}$",
|
|
1156
1158
|
"browser": true
|
|
1157
1159
|
},
|
|
1158
1160
|
"canaryUrl": "https://www.mondialrelay.fr/suivi-de-colis/",
|
|
@@ -1180,6 +1182,10 @@
|
|
|
1180
1182
|
{
|
|
1181
1183
|
"pattern": "^(?:\\d{8}|\\d{10}|\\d{12})$",
|
|
1182
1184
|
"confidence": "low"
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
"pattern": "^FV\\d{8}$",
|
|
1188
|
+
"confidence": "low"
|
|
1183
1189
|
}
|
|
1184
1190
|
]
|
|
1185
1191
|
},
|
|
@@ -9928,7 +9934,8 @@
|
|
|
9928
9934
|
"timezone": "America/Havana",
|
|
9929
9935
|
"tracking": {
|
|
9930
9936
|
"mode": "automatic",
|
|
9931
|
-
"adapter": "
|
|
9937
|
+
"adapter": "correos-cuba",
|
|
9938
|
+
"localClocks": true
|
|
9932
9939
|
},
|
|
9933
9940
|
"canaryUrl": "https://www.correos.cu/rastreador-de-envios/",
|
|
9934
9941
|
"trackingSearchUrl": "https://www.correos.cu/rastreador-de-envios/",
|
|
@@ -73983,6 +73983,19 @@
|
|
|
73983
73983
|
"fleetoptics"
|
|
73984
73984
|
]
|
|
73985
73985
|
},
|
|
73986
|
+
{
|
|
73987
|
+
"input": "FV00000001",
|
|
73988
|
+
"carrier": "unknown",
|
|
73989
|
+
"confidence": "low",
|
|
73990
|
+
"candidates": [
|
|
73991
|
+
"mondial-relay",
|
|
73992
|
+
"tnt-it"
|
|
73993
|
+
],
|
|
73994
|
+
"asked": [
|
|
73995
|
+
"mondial-relay",
|
|
73996
|
+
"tnt-it"
|
|
73997
|
+
]
|
|
73998
|
+
},
|
|
73986
73999
|
{
|
|
73987
74000
|
"input": "FVGL9999999999",
|
|
73988
74001
|
"carrier": "unknown",
|
package/dist/browser/scraper.js
CHANGED
|
@@ -1210,6 +1210,8 @@ var Ze = {
|
|
|
1210
1210
|
inputMode: "text",
|
|
1211
1211
|
autoComplete: "postal-code"
|
|
1212
1212
|
}],
|
|
1213
|
+
recognitionRank: 894,
|
|
1214
|
+
recognitionPattern: "^FV\\d{8}$",
|
|
1213
1215
|
browser: !0
|
|
1214
1216
|
},
|
|
1215
1217
|
canaryUrl: "https://www.mondialrelay.fr/suivi-de-colis/",
|
|
@@ -1224,14 +1226,21 @@ var Ze = {
|
|
|
1224
1226
|
"trackingNumber"
|
|
1225
1227
|
]
|
|
1226
1228
|
}],
|
|
1227
|
-
detectionRules: [
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1229
|
+
detectionRules: [
|
|
1230
|
+
{
|
|
1231
|
+
pattern: "^[0-9]{26}$",
|
|
1232
|
+
confidence: "high",
|
|
1233
|
+
checksum: "mondial-relay"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
pattern: "^(?:\\d{8}|\\d{10}|\\d{12})$",
|
|
1237
|
+
confidence: "low"
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
pattern: "^FV\\d{8}$",
|
|
1241
|
+
confidence: "low"
|
|
1242
|
+
}
|
|
1243
|
+
]
|
|
1235
1244
|
},
|
|
1236
1245
|
"relais-colis": {
|
|
1237
1246
|
displayName: "Relais Colis",
|
|
@@ -7872,7 +7881,8 @@ var Ze = {
|
|
|
7872
7881
|
timezone: "America/Havana",
|
|
7873
7882
|
tracking: {
|
|
7874
7883
|
mode: "automatic",
|
|
7875
|
-
adapter: "
|
|
7884
|
+
adapter: "correos-cuba",
|
|
7885
|
+
localClocks: !0
|
|
7876
7886
|
},
|
|
7877
7887
|
canaryUrl: "https://www.correos.cu/rastreador-de-envios/",
|
|
7878
7888
|
trackingSearchUrl: "https://www.correos.cu/rastreador-de-envios/",
|
|
@@ -24455,7 +24465,11 @@ var Ze = {
|
|
|
24455
24465
|
"dpd-fr-3",
|
|
24456
24466
|
"dpd-fr-2"
|
|
24457
24467
|
],
|
|
24458
|
-
"mondial-relay": [
|
|
24468
|
+
"mondial-relay": [
|
|
24469
|
+
"mondial-relay-1",
|
|
24470
|
+
"mondial-relay-2",
|
|
24471
|
+
"mondial-relay-3"
|
|
24472
|
+
],
|
|
24459
24473
|
"relais-colis": [
|
|
24460
24474
|
"relais-colis-1",
|
|
24461
24475
|
"relais-colis-2",
|
|
@@ -31345,6 +31359,7 @@ var Ul = {
|
|
|
31345
31359
|
"metropolitan-warehouse": 8,
|
|
31346
31360
|
"micro-express": 697,
|
|
31347
31361
|
"mng-kargo": 360,
|
|
31362
|
+
"mondial-relay": 894,
|
|
31348
31363
|
"mongol-infinity-post": 681,
|
|
31349
31364
|
"morning-global": 682,
|
|
31350
31365
|
mtscn: 986,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Asendia tracking through Asendia USA's A1 platform
|
|
2
|
+
* Asendia tracking through Asendia USA's A1 platform.
|
|
3
3
|
*
|
|
4
4
|
* Protocol provenance (inspected 2026-09-22):
|
|
5
5
|
* - The official public page https://a1.asendiausa.com/tracking/ (the same
|
|
@@ -24,12 +24,10 @@
|
|
|
24
24
|
* backend/src/sources/implementations/asendia.ts) and deingithub/beanstalk
|
|
25
25
|
* (beanstalk/parcel.py).
|
|
26
26
|
*
|
|
27
|
-
* Coverage: A1 answers for parcels on Asendia USA's platform.
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* other subsidiaries, uses an optional browser recovery step (browser.ts).
|
|
32
|
-
* Without that service, a number neither HTTP tracker knows is a
|
|
27
|
+
* Coverage: A1 answers for parcels on Asendia USA's platform. Asendia's
|
|
28
|
+
* global portal track.asendia.com, which serves the other subsidiaries and
|
|
29
|
+
* replaced Asendia UK's own tracker, uses an optional browser recovery step
|
|
30
|
+
* (browser.ts). Without that service, a number A1 does not know is a
|
|
33
31
|
* not-found for this adapter only; routing then tries the universal providers
|
|
34
32
|
* in the same check.
|
|
35
33
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Asendia tracking through Asendia USA's A1 platform
|
|
2
|
+
* Asendia tracking through Asendia USA's A1 platform.
|
|
3
3
|
*
|
|
4
4
|
* Protocol provenance (inspected 2026-09-22):
|
|
5
5
|
* - The official public page https://a1.asendiausa.com/tracking/ (the same
|
|
@@ -24,12 +24,10 @@
|
|
|
24
24
|
* backend/src/sources/implementations/asendia.ts) and deingithub/beanstalk
|
|
25
25
|
* (beanstalk/parcel.py).
|
|
26
26
|
*
|
|
27
|
-
* Coverage: A1 answers for parcels on Asendia USA's platform.
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* other subsidiaries, uses an optional browser recovery step (browser.ts).
|
|
32
|
-
* Without that service, a number neither HTTP tracker knows is a
|
|
27
|
+
* Coverage: A1 answers for parcels on Asendia USA's platform. Asendia's
|
|
28
|
+
* global portal track.asendia.com, which serves the other subsidiaries and
|
|
29
|
+
* replaced Asendia UK's own tracker, uses an optional browser recovery step
|
|
30
|
+
* (browser.ts). Without that service, a number A1 does not know is a
|
|
33
31
|
* not-found for this adapter only; routing then tries the universal providers
|
|
34
32
|
* in the same check.
|
|
35
33
|
*
|
|
@@ -38,7 +36,7 @@
|
|
|
38
36
|
* read, and nothing else from the summary is copied except the destination
|
|
39
37
|
* country, weight and the declared last-mile reference.
|
|
40
38
|
*/
|
|
41
|
-
import { accepted,
|
|
39
|
+
import { accepted, recognizeFromLookup } from '../../core/adapter/index.js';
|
|
42
40
|
import { carrierIdFromPartner } from '../../core/catalog/hints.js';
|
|
43
41
|
import { BudgetExceededError, ChallengeError, IndeterminateError, InvalidInputError, NotFoundError, SchemaError, UpstreamHttpError, UpstreamNetworkError } from '../../core/errors/index.js';
|
|
44
42
|
import { languageStageStatus, wordingStage } from '../../core/status/index.js';
|
|
@@ -47,7 +45,6 @@ import { clean, cleanScalar, decodeText, fetchBounded, parseJsonBytes, userAgent
|
|
|
47
45
|
import { isRecord } from '../../core/types.js';
|
|
48
46
|
import { daiPostScanZone } from '../dai-post/clock.js';
|
|
49
47
|
import { classifyAsendiaA1Event, comparableText } from './status.js';
|
|
50
|
-
import { AsendiaUkTracker } from './uk.js';
|
|
51
48
|
import { asendiaBrowser } from './browser.js';
|
|
52
49
|
import { recoverableByDefault, runSteps } from '../../core/runner/index.js';
|
|
53
50
|
const PROVIDER = 'Asendia';
|
|
@@ -458,73 +455,20 @@ export class AsendiaA1Tracker {
|
|
|
458
455
|
return remaining;
|
|
459
456
|
}
|
|
460
457
|
}
|
|
461
|
-
/** The part of a lookup's budget kept for Asendia UK's tracker, at most a third. */
|
|
462
|
-
const UK_RESERVE_MS = 8_000;
|
|
463
|
-
/** Whether a result shows the parcel past its registration. */
|
|
464
|
-
function progressed(result) {
|
|
465
|
-
return result.status !== 'pending' && result.status !== 'unknown';
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* A1 first, then Asendia UK. A1 can hold a UK parcel's registration alone
|
|
469
|
-
* while Asendia UK's tracker shows its progress, so a parcel A1 has not seen
|
|
470
|
-
* past registration is also looked up there, and the UK history is returned
|
|
471
|
-
* when it has progressed further. A not-found means both said so: any other
|
|
472
|
-
* A1 failure is reported instead when the UK tracker does not know the number
|
|
473
|
-
* either, and the first failure is the one reported when both fail.
|
|
474
|
-
*/
|
|
475
|
-
async function trackEverywhere(a1, uk, rawTrackingNumber, context = {}) {
|
|
476
|
-
const trackingNumber = normalizeAsendiaA1TrackingNumber(rawTrackingNumber);
|
|
477
|
-
const budget = lookupBudget(context, DEFAULT_BUDGET_MS, PROVIDER);
|
|
478
|
-
const reserve = Math.min(UK_RESERVE_MS, Math.floor(budget.remainingMs() / 3));
|
|
479
|
-
let failure = null;
|
|
480
|
-
let registered = null;
|
|
481
|
-
try {
|
|
482
|
-
const result = await a1.fetch(trackingNumber, { signal: budget.signal, budgetMs: Math.max(1, budget.remainingMs() - reserve) });
|
|
483
|
-
if (progressed(result))
|
|
484
|
-
return result;
|
|
485
|
-
registered = result;
|
|
486
|
-
}
|
|
487
|
-
catch (error) {
|
|
488
|
-
if (context.signal?.aborted || !(error instanceof Error))
|
|
489
|
-
throw error;
|
|
490
|
-
if (!(error instanceof NotFoundError))
|
|
491
|
-
failure = error;
|
|
492
|
-
}
|
|
493
|
-
if (budget.signal.aborted) {
|
|
494
|
-
if (registered)
|
|
495
|
-
return registered;
|
|
496
|
-
throw failure ?? new BudgetExceededError(PROVIDER, budget.budgetMs);
|
|
497
|
-
}
|
|
498
|
-
try {
|
|
499
|
-
const result = await uk.fetch(trackingNumber, { signal: budget.signal, budgetMs: budget.remainingMs() });
|
|
500
|
-
return registered && !progressed(result) ? registered : result;
|
|
501
|
-
}
|
|
502
|
-
catch (error) {
|
|
503
|
-
if (context.signal?.aborted)
|
|
504
|
-
throw error;
|
|
505
|
-
// A1's answer stands whatever the UK tracker says.
|
|
506
|
-
if (registered)
|
|
507
|
-
return registered;
|
|
508
|
-
if (error instanceof NotFoundError)
|
|
509
|
-
throw failure ?? new NotFoundError(PROVIDER);
|
|
510
|
-
throw failure ?? error;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
458
|
export const adapter = (environment) => {
|
|
514
459
|
const a1 = new AsendiaA1Tracker({ fetcher: environment.fetcher, userAgent: environment.userAgent });
|
|
515
|
-
const uk = new AsendiaUkTracker({ fetcher: environment.fetcher, userAgent: environment.userAgent });
|
|
516
460
|
return {
|
|
517
461
|
id: 'asendia',
|
|
518
462
|
recordsSteps: true,
|
|
519
463
|
steps: ['direct', 'trawl'],
|
|
520
|
-
// A1
|
|
521
|
-
recognize: (number, context) => recognizeFromLookup(() =>
|
|
464
|
+
// A1 only: recognition never opens the global portal's browser.
|
|
465
|
+
recognize: (number, context) => recognizeFromLookup(() => a1.fetch(number, context), () => accepted(() => normalizeAsendiaA1TrackingNumber(number))),
|
|
522
466
|
track: (input, context) => {
|
|
523
467
|
const number = normalizeAsendiaA1TrackingNumber(input.number);
|
|
524
468
|
const browserEligible = !!environment.trawl && /^[A-Z0-9]{8,40}$/.test(number) && /\d/.test(number);
|
|
525
469
|
return runSteps({ carrier: 'asendia', signal: context?.signal,
|
|
526
470
|
budgetMs: context?.budgetMs ?? (browserEligible ? 65_000 : DEFAULT_BUDGET_MS), recorder: environment.recorder }, [
|
|
527
|
-
{ id: 'direct', run: ({ signal, remainingMs }) =>
|
|
471
|
+
{ id: 'direct', run: ({ signal, remainingMs }) => a1.fetch(number, { signal, budgetMs: Math.min(DEFAULT_BUDGET_MS, browserEligible ? Math.max(1, Math.floor(remainingMs * 0.4)) : remainingMs) }) },
|
|
528
472
|
{ id: 'trawl', enabled: browserEligible,
|
|
529
473
|
recovers: error => error instanceof NotFoundError || recoverableByDefault(error),
|
|
530
474
|
run: async ({ signal, remainingMs, previousError }) => {
|
|
@@ -532,7 +476,7 @@ export const adapter = (environment) => {
|
|
|
532
476
|
return await asendiaBrowser(environment.trawl, number, signal, remainingMs, input.postcode?.trim() || null);
|
|
533
477
|
}
|
|
534
478
|
catch (error) {
|
|
535
|
-
// The global portal cannot erase a failure from
|
|
479
|
+
// The global portal cannot erase a failure from A1.
|
|
536
480
|
if (error instanceof NotFoundError && !(previousError instanceof NotFoundError))
|
|
537
481
|
throw previousError;
|
|
538
482
|
throw error;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Asendia event vocabularies → product stage.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* platform through `classifyAsendiaA1Event`
|
|
6
|
-
*
|
|
7
|
-
* probe.
|
|
4
|
+
* Two sources, two maps. The registered adapter reads Asendia USA's A1
|
|
5
|
+
* platform through `classifyAsendiaA1Event`; `classifyAsendiaStatus` serves
|
|
6
|
+
* the global-portal probe.
|
|
8
7
|
*
|
|
9
8
|
* A1: Asendia's own scans carry numeric codes (`1`, `2`, `2.1`, …) and are
|
|
10
9
|
* mapped by code. Last-mile partners' scans arrive through the same list with
|
|
@@ -13,9 +12,6 @@
|
|
|
13
12
|
* no event stage, leaving it to the sync's shared wording rules and the
|
|
14
13
|
* unmapped-wording review.
|
|
15
14
|
*
|
|
16
|
-
* Asendia UK: one fixed English vocabulary for Asendia's own scans and the
|
|
17
|
-
* last-mile partner's, mapped by exact wording.
|
|
18
|
-
*
|
|
19
15
|
* Global portal: Asendia's branded portal harmonizes the wording of every partner post into
|
|
20
16
|
* one English vocabulary (`harmonizedEvent`), which is what this map keys on;
|
|
21
17
|
* the numeric `harmonizedCode` is retained as the event's `provider_code` but
|
|
@@ -43,7 +39,3 @@ export declare function classifyAsendiaStatus(description: string): ClassifiedAs
|
|
|
43
39
|
* "10" or "B1" for unrelated scans.
|
|
44
40
|
*/
|
|
45
41
|
export declare function classifyAsendiaA1Event(source: string, code: string, description: string): ClassifiedAsendiaStatus | null;
|
|
46
|
-
/** The explicit mapping for one Asendia UK event, or null when the map does not know its wording. */
|
|
47
|
-
export declare function classifyAsendiaUkEvent(description: string): ClassifiedAsendiaStatus | null;
|
|
48
|
-
/** Whether an Asendia UK event is a notice rather than a scan. */
|
|
49
|
-
export declare function isAsendiaUkNotice(description: string): boolean;
|
|
@@ -158,42 +158,3 @@ export function classifyAsendiaA1Event(source, code, description) {
|
|
|
158
158
|
const wording = comparableText(description);
|
|
159
159
|
return Object.hasOwn(PARTNER_WORDING, wording) ? PARTNER_WORDING[wording] : null;
|
|
160
160
|
}
|
|
161
|
-
/** Asendia UK tracker wording seen live or in archived captures, compared with `comparableText`. */
|
|
162
|
-
const UK_WORDING = {
|
|
163
|
-
'manifest received': REGISTERED,
|
|
164
|
-
// Asendia's own hub sort: the parcel's first physical scan.
|
|
165
|
-
'processed down packet line': ACCEPTED,
|
|
166
|
-
// Both follow the hub sort, so the parcel is already with Asendia.
|
|
167
|
-
'not yet received by carrier': IN_TRANSIT,
|
|
168
|
-
'awaiting despatch': IN_TRANSIT,
|
|
169
|
-
'scanned to container': IN_TRANSIT,
|
|
170
|
-
// The last-mile partner's pre-advice, recorded after the parcel left the hub.
|
|
171
|
-
'elec advice recd by carrier': IN_TRANSIT,
|
|
172
|
-
'arrived at import gateway': IN_TRANSIT,
|
|
173
|
-
'awaiting customs clearance': CUSTOMS,
|
|
174
|
-
'customs clearance in progress': CUSTOMS,
|
|
175
|
-
'held by customs or governing body': CUSTOMS,
|
|
176
|
-
'customs cleared': IN_TRANSIT,
|
|
177
|
-
'handover by broker to delivery partner': IN_TRANSIT,
|
|
178
|
-
'received by carrier': IN_TRANSIT,
|
|
179
|
-
'received at carrier facility': IN_TRANSIT,
|
|
180
|
-
'sub contractor received': IN_TRANSIT,
|
|
181
|
-
// Seen between the partner's own receipt scans, not as a first pickup.
|
|
182
|
-
'collection made': IN_TRANSIT,
|
|
183
|
-
'internal hub scan': IN_TRANSIT,
|
|
184
|
-
'in transit': IN_TRANSIT,
|
|
185
|
-
'arrival at delivery depot': IN_TRANSIT,
|
|
186
|
-
'out for delivery': OUT_FOR_DELIVERY,
|
|
187
|
-
delivered: DELIVERED,
|
|
188
|
-
};
|
|
189
|
-
/** Notices the tracker interleaves with scans, even before the hub sort: they never set the current stage. */
|
|
190
|
-
const UK_NOTICES = new Set(['information', 'carrier delays']);
|
|
191
|
-
/** The explicit mapping for one Asendia UK event, or null when the map does not know its wording. */
|
|
192
|
-
export function classifyAsendiaUkEvent(description) {
|
|
193
|
-
const wording = comparableText(description);
|
|
194
|
-
return Object.hasOwn(UK_WORDING, wording) ? UK_WORDING[wording] : null;
|
|
195
|
-
}
|
|
196
|
-
/** Whether an Asendia UK event is a notice rather than a scan. */
|
|
197
|
-
export function isAsendiaUkNotice(description) {
|
|
198
|
-
return UK_NOTICES.has(comparableText(description));
|
|
199
|
-
}
|
|
@@ -928,174 +928,6 @@
|
|
|
928
928
|
"confirmedBy": "live",
|
|
929
929
|
"firstSeen": "2026-10-10",
|
|
930
930
|
"note": "A1 partner scan wording (DAI FP05, Australia), matched exactly; the shared rules read the delivery to come as no scan."
|
|
931
|
-
},
|
|
932
|
-
{
|
|
933
|
-
"wording": "Manifest received",
|
|
934
|
-
"language": "en",
|
|
935
|
-
"stage": "registered",
|
|
936
|
-
"confirmedBy": "live",
|
|
937
|
-
"firstSeen": "2026-10-13",
|
|
938
|
-
"note": "Asendia UK tracker."
|
|
939
|
-
},
|
|
940
|
-
{
|
|
941
|
-
"wording": "Processed down packet line",
|
|
942
|
-
"language": "en",
|
|
943
|
-
"stage": "accepted",
|
|
944
|
-
"confirmedBy": "portal",
|
|
945
|
-
"firstSeen": "2026-10-13",
|
|
946
|
-
"note": "Asendia UK tracker. Sorting at Asendia's hub, the first physical scan."
|
|
947
|
-
},
|
|
948
|
-
{
|
|
949
|
-
"wording": "Not yet received by carrier",
|
|
950
|
-
"language": "en",
|
|
951
|
-
"stage": "in_transit",
|
|
952
|
-
"confirmedBy": "portal",
|
|
953
|
-
"firstSeen": "2026-10-13",
|
|
954
|
-
"note": "Asendia UK tracker. Follows the hub sort; the parcel is with Asendia."
|
|
955
|
-
},
|
|
956
|
-
{
|
|
957
|
-
"wording": "Awaiting Despatch",
|
|
958
|
-
"language": "en",
|
|
959
|
-
"stage": "in_transit",
|
|
960
|
-
"confirmedBy": "portal",
|
|
961
|
-
"firstSeen": "2026-10-13",
|
|
962
|
-
"note": "Asendia UK tracker. Follows the hub sort; the parcel is with Asendia."
|
|
963
|
-
},
|
|
964
|
-
{
|
|
965
|
-
"wording": "Scanned to container",
|
|
966
|
-
"language": "en",
|
|
967
|
-
"stage": "in_transit",
|
|
968
|
-
"confirmedBy": "portal",
|
|
969
|
-
"firstSeen": "2026-10-13",
|
|
970
|
-
"note": "Asendia UK tracker. Also written \"Scanned to Container\"."
|
|
971
|
-
},
|
|
972
|
-
{
|
|
973
|
-
"wording": "Elec Advice recd by carrier",
|
|
974
|
-
"language": "en",
|
|
975
|
-
"stage": "in_transit",
|
|
976
|
-
"confirmedBy": "portal",
|
|
977
|
-
"firstSeen": "2026-10-13",
|
|
978
|
-
"note": "Asendia UK tracker. The last-mile partner's pre-advice, recorded after the parcel left the hub."
|
|
979
|
-
},
|
|
980
|
-
{
|
|
981
|
-
"wording": "Arrived at Import Gateway",
|
|
982
|
-
"language": "en",
|
|
983
|
-
"stage": "in_transit",
|
|
984
|
-
"confirmedBy": "portal",
|
|
985
|
-
"firstSeen": "2026-10-13",
|
|
986
|
-
"note": "Asendia UK tracker."
|
|
987
|
-
},
|
|
988
|
-
{
|
|
989
|
-
"wording": "Awaiting Customs Clearance",
|
|
990
|
-
"language": "en",
|
|
991
|
-
"stage": "customs",
|
|
992
|
-
"confirmedBy": "portal",
|
|
993
|
-
"firstSeen": "2026-10-13",
|
|
994
|
-
"note": "Asendia UK tracker."
|
|
995
|
-
},
|
|
996
|
-
{
|
|
997
|
-
"wording": "Customs Clearance in Progress",
|
|
998
|
-
"language": "en",
|
|
999
|
-
"stage": "customs",
|
|
1000
|
-
"confirmedBy": "portal",
|
|
1001
|
-
"firstSeen": "2026-10-13",
|
|
1002
|
-
"note": "Asendia UK tracker."
|
|
1003
|
-
},
|
|
1004
|
-
{
|
|
1005
|
-
"wording": "Held by customs or governing body",
|
|
1006
|
-
"language": "en",
|
|
1007
|
-
"stage": "customs",
|
|
1008
|
-
"confirmedBy": "portal",
|
|
1009
|
-
"firstSeen": "2026-10-13",
|
|
1010
|
-
"note": "Asendia UK tracker."
|
|
1011
|
-
},
|
|
1012
|
-
{
|
|
1013
|
-
"wording": "Customs cleared",
|
|
1014
|
-
"language": "en",
|
|
1015
|
-
"stage": "in_transit",
|
|
1016
|
-
"confirmedBy": "portal",
|
|
1017
|
-
"firstSeen": "2026-10-13",
|
|
1018
|
-
"note": "Asendia UK tracker."
|
|
1019
|
-
},
|
|
1020
|
-
{
|
|
1021
|
-
"wording": "Handover by Broker to Delivery Partner",
|
|
1022
|
-
"language": "en",
|
|
1023
|
-
"stage": "in_transit",
|
|
1024
|
-
"confirmedBy": "portal",
|
|
1025
|
-
"firstSeen": "2026-10-13",
|
|
1026
|
-
"note": "Asendia UK tracker."
|
|
1027
|
-
},
|
|
1028
|
-
{
|
|
1029
|
-
"wording": "Received by carrier",
|
|
1030
|
-
"language": "en",
|
|
1031
|
-
"stage": "in_transit",
|
|
1032
|
-
"confirmedBy": "portal",
|
|
1033
|
-
"firstSeen": "2026-10-13",
|
|
1034
|
-
"note": "Asendia UK tracker."
|
|
1035
|
-
},
|
|
1036
|
-
{
|
|
1037
|
-
"wording": "Received at carrier facility",
|
|
1038
|
-
"language": "en",
|
|
1039
|
-
"stage": "in_transit",
|
|
1040
|
-
"confirmedBy": "portal",
|
|
1041
|
-
"firstSeen": "2026-10-13",
|
|
1042
|
-
"note": "Asendia UK tracker."
|
|
1043
|
-
},
|
|
1044
|
-
{
|
|
1045
|
-
"wording": "Sub-contractor received",
|
|
1046
|
-
"language": "en",
|
|
1047
|
-
"stage": "in_transit",
|
|
1048
|
-
"confirmedBy": "portal",
|
|
1049
|
-
"firstSeen": "2026-10-13",
|
|
1050
|
-
"note": "Asendia UK tracker."
|
|
1051
|
-
},
|
|
1052
|
-
{
|
|
1053
|
-
"wording": "Collection made",
|
|
1054
|
-
"language": "en",
|
|
1055
|
-
"stage": "in_transit",
|
|
1056
|
-
"confirmedBy": "portal",
|
|
1057
|
-
"firstSeen": "2026-10-13",
|
|
1058
|
-
"note": "Asendia UK tracker. Seen between the partner's own receipt scans, not as a first pickup."
|
|
1059
|
-
},
|
|
1060
|
-
{
|
|
1061
|
-
"wording": "Internal Hub Scan",
|
|
1062
|
-
"language": "en",
|
|
1063
|
-
"stage": "in_transit",
|
|
1064
|
-
"confirmedBy": "portal",
|
|
1065
|
-
"firstSeen": "2026-10-13",
|
|
1066
|
-
"note": "Asendia UK tracker."
|
|
1067
|
-
},
|
|
1068
|
-
{
|
|
1069
|
-
"wording": "In transit",
|
|
1070
|
-
"language": "en",
|
|
1071
|
-
"stage": "in_transit",
|
|
1072
|
-
"confirmedBy": "portal",
|
|
1073
|
-
"firstSeen": "2026-10-13",
|
|
1074
|
-
"note": "Asendia UK tracker."
|
|
1075
|
-
},
|
|
1076
|
-
{
|
|
1077
|
-
"wording": "Arrival At Delivery Depot",
|
|
1078
|
-
"language": "en",
|
|
1079
|
-
"stage": "in_transit",
|
|
1080
|
-
"confirmedBy": "portal",
|
|
1081
|
-
"firstSeen": "2026-10-13",
|
|
1082
|
-
"note": "Asendia UK tracker."
|
|
1083
|
-
},
|
|
1084
|
-
{
|
|
1085
|
-
"wording": "Out for delivery",
|
|
1086
|
-
"language": "en",
|
|
1087
|
-
"stage": "out_for_delivery",
|
|
1088
|
-
"confirmedBy": "portal",
|
|
1089
|
-
"firstSeen": "2026-10-13",
|
|
1090
|
-
"note": "Asendia UK tracker."
|
|
1091
|
-
},
|
|
1092
|
-
{
|
|
1093
|
-
"wording": "Delivered",
|
|
1094
|
-
"language": "en",
|
|
1095
|
-
"stage": "delivered",
|
|
1096
|
-
"confirmedBy": "portal",
|
|
1097
|
-
"firstSeen": "2026-10-13",
|
|
1098
|
-
"note": "Asendia UK tracker."
|
|
1099
931
|
}
|
|
1100
932
|
]
|
|
1101
933
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type AdapterFactory, type TrackingContext } from '../../core/adapter/index.js';
|
|
2
|
+
import type { CarrierResult } from '../../core/result/index.js';
|
|
3
|
+
import { type StepRecorder } from '../../core/telemetry/index.js';
|
|
4
|
+
/** The tracker page, which gives every visitor the token its lookups carry. */
|
|
5
|
+
export declare const CORREOS_CUBA_PAGE = "https://www.correos.cu/rastreador-de-envios/";
|
|
6
|
+
/** The lookup the page's script posts the code, the year and the token to. */
|
|
7
|
+
export declare const CORREOS_CUBA_LOOKUP = "https://www.correos.cu/wp-json/correos-api/enviosweb/";
|
|
8
|
+
export declare class CorreosCubaTracker {
|
|
9
|
+
private readonly options;
|
|
10
|
+
private token;
|
|
11
|
+
constructor(options?: {
|
|
12
|
+
fetcher?: typeof fetch;
|
|
13
|
+
recorder?: StepRecorder;
|
|
14
|
+
userAgent?: string;
|
|
15
|
+
now?: () => number;
|
|
16
|
+
});
|
|
17
|
+
private pageToken;
|
|
18
|
+
fetch(raw: string, context?: TrackingContext): Promise<CarrierResult>;
|
|
19
|
+
}
|
|
20
|
+
export declare const adapter: AdapterFactory;
|