universal-parcel-scraper 0.495.1 → 0.500.0-main.2384
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 +30 -10
- package/data/coverage-summary.json +1 -1
- package/data/detection-golden.json +24 -36
- package/dist/browser/scraper.js +29 -10
- package/dist/carriers/ait-worldwide/adapter.d.ts +16 -0
- package/dist/carriers/ait-worldwide/adapter.js +49 -0
- package/dist/carriers/ait-worldwide/carrier.json +53 -7
- package/dist/carriers/ait-worldwide/numbers.json +5 -84
- package/dist/carriers/ait-worldwide/parser.d.ts +18 -0
- package/dist/carriers/ait-worldwide/parser.js +284 -0
- package/dist/carriers/ait-worldwide/status.d.ts +8 -0
- package/dist/carriers/ait-worldwide/status.js +62 -0
- package/dist/carriers/ait-worldwide/statuses.json +15 -2
- package/dist/carriers/chukou1/adapter.d.ts +26 -0
- package/dist/carriers/chukou1/adapter.js +110 -0
- package/dist/carriers/chukou1/carrier.json +61 -11
- package/dist/carriers/chukou1/numbers.json +19 -0
- package/dist/carriers/chukou1/parser.d.ts +14 -0
- package/dist/carriers/chukou1/parser.js +230 -0
- package/dist/carriers/chukou1/status.d.ts +10 -0
- package/dist/carriers/chukou1/status.js +72 -0
- package/dist/carriers/chukou1/statuses.json +46 -5
- package/dist/carriers/eparcel-kr/adapter.d.ts +21 -0
- package/dist/carriers/eparcel-kr/adapter.js +60 -0
- package/dist/carriers/eparcel-kr/carrier.json +54 -8
- package/dist/carriers/eparcel-kr/parser.d.ts +16 -0
- package/dist/carriers/eparcel-kr/parser.js +226 -0
- package/dist/carriers/eparcel-kr/status.d.ts +7 -0
- package/dist/carriers/eparcel-kr/status.js +34 -0
- package/dist/carriers/eparcel-kr/statuses.json +6 -3
- package/dist/carriers/hovership/adapter.d.ts +17 -0
- package/dist/carriers/hovership/adapter.js +53 -0
- package/dist/carriers/hovership/carrier.json +57 -7
- package/dist/carriers/hovership/parser.d.ts +19 -0
- package/dist/carriers/hovership/parser.js +196 -0
- package/dist/carriers/hovership/status.d.ts +9 -0
- package/dist/carriers/hovership/status.js +44 -0
- package/dist/carriers/hovership/statuses.json +9 -7
- package/dist/carriers/mrl-global/adapter.d.ts +17 -0
- package/dist/carriers/mrl-global/adapter.js +48 -0
- package/dist/carriers/mrl-global/carrier.json +37 -7
- package/dist/carriers/mrl-global/parser.d.ts +17 -0
- package/dist/carriers/mrl-global/parser.js +179 -0
- package/dist/carriers/mrl-global/status.d.ts +8 -0
- package/dist/carriers/mrl-global/status.js +41 -0
- package/dist/core/catalog/statusMaps.js +12 -6
- package/dist/data/catalog.json +30 -10
- package/dist/generated/catalog.d.ts +24 -9
- package/dist/generated/catalog.js +30 -10
- package/dist/generated/recognition.js +4 -0
- package/dist/generated/registry.js +15 -5
- package/dist/server/openapi.json +1 -1
- package/package.json +1 -1
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 **544 dedicated adapters** and **5 universal fallbacks**
|
|
17
17
|
|
|
18
18
|
<sub>772 catalog entries · 134 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 15,
|
|
158
|
+
The carrier folders record 15,470 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
|
@@ -5828,7 +5828,9 @@
|
|
|
5828
5828
|
"timezone": "America/Chicago",
|
|
5829
5829
|
"tracking": {
|
|
5830
5830
|
"mode": "automatic",
|
|
5831
|
-
"adapter": "
|
|
5831
|
+
"adapter": "ait-worldwide",
|
|
5832
|
+
"recognitionRank": 625,
|
|
5833
|
+
"localClocks": true
|
|
5832
5834
|
},
|
|
5833
5835
|
"canaryUrl": "https://fastrak.aitworldwide.com/",
|
|
5834
5836
|
"trackingUrlTemplate": "https://fastrak.aitworldwide.com/?trackingnumber={trackingNumber}",
|
|
@@ -8837,12 +8839,24 @@
|
|
|
8837
8839
|
"timezone": "Asia/Shanghai",
|
|
8838
8840
|
"tracking": {
|
|
8839
8841
|
"mode": "automatic",
|
|
8840
|
-
"adapter": "
|
|
8842
|
+
"adapter": "chukou1",
|
|
8843
|
+
"recognitionRank": 688,
|
|
8844
|
+
"localClocks": true
|
|
8841
8845
|
},
|
|
8842
|
-
"canaryUrl": "https://
|
|
8843
|
-
"trackingUrlTemplate": "https://
|
|
8844
|
-
"trackingSearchUrl": "https://
|
|
8846
|
+
"canaryUrl": "https://ec.chukou1.com/",
|
|
8847
|
+
"trackingUrlTemplate": "https://ec.chukou1.com/track?track_number={trackingNumber}",
|
|
8848
|
+
"trackingSearchUrl": "https://ec.chukou1.com/",
|
|
8845
8849
|
"linkRules": [
|
|
8850
|
+
{
|
|
8851
|
+
"domains": [
|
|
8852
|
+
"ec.chukou1.com"
|
|
8853
|
+
],
|
|
8854
|
+
"pathPattern": "^/track/?$",
|
|
8855
|
+
"params": [
|
|
8856
|
+
"track_number"
|
|
8857
|
+
],
|
|
8858
|
+
"ownNumbersOnly": true
|
|
8859
|
+
},
|
|
8846
8860
|
{
|
|
8847
8861
|
"domains": [
|
|
8848
8862
|
"www.chukou1.com",
|
|
@@ -8851,7 +8865,8 @@
|
|
|
8851
8865
|
"pathPattern": "^/LogistictsTrack\\.aspx$",
|
|
8852
8866
|
"params": [
|
|
8853
8867
|
"trackNo"
|
|
8854
|
-
]
|
|
8868
|
+
],
|
|
8869
|
+
"ownNumbersOnly": true
|
|
8855
8870
|
}
|
|
8856
8871
|
],
|
|
8857
8872
|
"detectionRules": [
|
|
@@ -12680,9 +12695,11 @@
|
|
|
12680
12695
|
"timezone": "Asia/Seoul",
|
|
12681
12696
|
"tracking": {
|
|
12682
12697
|
"mode": "automatic",
|
|
12683
|
-
"adapter": "
|
|
12698
|
+
"adapter": "eparcel-kr",
|
|
12699
|
+
"recognitionRank": 624,
|
|
12700
|
+
"localClocks": true
|
|
12684
12701
|
},
|
|
12685
|
-
"canaryUrl": "https://www.eparcel.kr/Track/
|
|
12702
|
+
"canaryUrl": "https://www.eparcel.kr/Track/Result",
|
|
12686
12703
|
"trackingUrlTemplate": "https://www.eparcel.kr/Track/Result?mode=0&ids={trackingNumber}&lang=en-US",
|
|
12687
12704
|
"trackingSearchUrl": "https://www.eparcel.kr/Track/Search",
|
|
12688
12705
|
"linkRules": [
|
|
@@ -16054,7 +16071,9 @@
|
|
|
16054
16071
|
"timezone": "America/Los_Angeles",
|
|
16055
16072
|
"tracking": {
|
|
16056
16073
|
"mode": "automatic",
|
|
16057
|
-
"adapter": "
|
|
16074
|
+
"adapter": "hovership",
|
|
16075
|
+
"recognitionRank": 687,
|
|
16076
|
+
"localClocks": true
|
|
16058
16077
|
},
|
|
16059
16078
|
"canaryUrl": "https://www.hovership.com/track/",
|
|
16060
16079
|
"trackingUrlTemplate": "https://www.hovership.com/track/{trackingNumber}/",
|
|
@@ -20320,7 +20339,8 @@
|
|
|
20320
20339
|
"timezone": "Australia/Sydney",
|
|
20321
20340
|
"tracking": {
|
|
20322
20341
|
"mode": "automatic",
|
|
20323
|
-
"adapter": "
|
|
20342
|
+
"adapter": "mrl-global",
|
|
20343
|
+
"localClocks": true
|
|
20324
20344
|
},
|
|
20325
20345
|
"canaryUrl": "https://www.mrlglobal.com/tracking/",
|
|
20326
20346
|
"trackingUrlTemplate": "https://www.mrlglobal.com/tracking/?connoteno={trackingNumber}",
|
|
@@ -9428,6 +9428,12 @@
|
|
|
9428
9428
|
"dhl-ecommerce-pl"
|
|
9429
9429
|
]
|
|
9430
9430
|
},
|
|
9431
|
+
{
|
|
9432
|
+
"input": "100000001",
|
|
9433
|
+
"carrier": "unknown",
|
|
9434
|
+
"confidence": "none",
|
|
9435
|
+
"candidates": []
|
|
9436
|
+
},
|
|
9431
9437
|
{
|
|
9432
9438
|
"input": "1000000157123",
|
|
9433
9439
|
"carrier": "unknown",
|
|
@@ -16354,12 +16360,6 @@
|
|
|
16354
16360
|
"dhl-ecommerce-pl"
|
|
16355
16361
|
]
|
|
16356
16362
|
},
|
|
16357
|
-
{
|
|
16358
|
-
"input": "150063800",
|
|
16359
|
-
"carrier": "unknown",
|
|
16360
|
-
"confidence": "none",
|
|
16361
|
-
"candidates": []
|
|
16362
|
-
},
|
|
16363
16363
|
{
|
|
16364
16364
|
"input": "1500663051773",
|
|
16365
16365
|
"carrier": "unknown",
|
|
@@ -24324,26 +24324,6 @@
|
|
|
24324
24324
|
"dhl-ecommerce-pl"
|
|
24325
24325
|
]
|
|
24326
24326
|
},
|
|
24327
|
-
{
|
|
24328
|
-
"input": "21471814",
|
|
24329
|
-
"carrier": "unknown",
|
|
24330
|
-
"confidence": "low",
|
|
24331
|
-
"candidates": [
|
|
24332
|
-
"mondial-relay",
|
|
24333
|
-
"colisweb",
|
|
24334
|
-
"heppner"
|
|
24335
|
-
]
|
|
24336
|
-
},
|
|
24337
|
-
{
|
|
24338
|
-
"input": "21491416",
|
|
24339
|
-
"carrier": "unknown",
|
|
24340
|
-
"confidence": "low",
|
|
24341
|
-
"candidates": [
|
|
24342
|
-
"mondial-relay",
|
|
24343
|
-
"colisweb",
|
|
24344
|
-
"heppner"
|
|
24345
|
-
]
|
|
24346
|
-
},
|
|
24347
24327
|
{
|
|
24348
24328
|
"input": "215003428140",
|
|
24349
24329
|
"carrier": "unknown",
|
|
@@ -24368,16 +24348,6 @@
|
|
|
24368
24348
|
"zto"
|
|
24369
24349
|
]
|
|
24370
24350
|
},
|
|
24371
|
-
{
|
|
24372
|
-
"input": "21500455",
|
|
24373
|
-
"carrier": "unknown",
|
|
24374
|
-
"confidence": "low",
|
|
24375
|
-
"candidates": [
|
|
24376
|
-
"mondial-relay",
|
|
24377
|
-
"colisweb",
|
|
24378
|
-
"heppner"
|
|
24379
|
-
]
|
|
24380
|
-
},
|
|
24381
24351
|
{
|
|
24382
24352
|
"input": "2150252125",
|
|
24383
24353
|
"carrier": "unknown",
|
|
@@ -67692,6 +67662,9 @@
|
|
|
67692
67662
|
"confidence": "low",
|
|
67693
67663
|
"candidates": [
|
|
67694
67664
|
"chukou1"
|
|
67665
|
+
],
|
|
67666
|
+
"asked": [
|
|
67667
|
+
"chukou1"
|
|
67695
67668
|
]
|
|
67696
67669
|
},
|
|
67697
67670
|
{
|
|
@@ -67881,6 +67854,9 @@
|
|
|
67881
67854
|
"confidence": "low",
|
|
67882
67855
|
"candidates": [
|
|
67883
67856
|
"chukou1"
|
|
67857
|
+
],
|
|
67858
|
+
"asked": [
|
|
67859
|
+
"chukou1"
|
|
67884
67860
|
]
|
|
67885
67861
|
},
|
|
67886
67862
|
{
|
|
@@ -68154,6 +68130,9 @@
|
|
|
68154
68130
|
"confidence": "low",
|
|
68155
68131
|
"candidates": [
|
|
68156
68132
|
"chukou1"
|
|
68133
|
+
],
|
|
68134
|
+
"asked": [
|
|
68135
|
+
"chukou1"
|
|
68157
68136
|
]
|
|
68158
68137
|
},
|
|
68159
68138
|
{
|
|
@@ -79885,6 +79864,9 @@
|
|
|
79885
79864
|
"confidence": "low",
|
|
79886
79865
|
"candidates": [
|
|
79887
79866
|
"chukou1"
|
|
79867
|
+
],
|
|
79868
|
+
"asked": [
|
|
79869
|
+
"chukou1"
|
|
79888
79870
|
]
|
|
79889
79871
|
},
|
|
79890
79872
|
{
|
|
@@ -87210,6 +87192,12 @@
|
|
|
87210
87192
|
"indah-logistik"
|
|
87211
87193
|
]
|
|
87212
87194
|
},
|
|
87195
|
+
{
|
|
87196
|
+
"input": "SUF2403231LW1003974",
|
|
87197
|
+
"carrier": "unknown",
|
|
87198
|
+
"confidence": "none",
|
|
87199
|
+
"candidates": []
|
|
87200
|
+
},
|
|
87213
87201
|
{
|
|
87214
87202
|
"input": "SV0002203111",
|
|
87215
87203
|
"carrier": "unknown",
|
package/dist/browser/scraper.js
CHANGED
|
@@ -4846,7 +4846,9 @@ var Ue = {
|
|
|
4846
4846
|
timezone: "America/Chicago",
|
|
4847
4847
|
tracking: {
|
|
4848
4848
|
mode: "automatic",
|
|
4849
|
-
adapter: "
|
|
4849
|
+
adapter: "ait-worldwide",
|
|
4850
|
+
recognitionRank: 625,
|
|
4851
|
+
localClocks: !0
|
|
4850
4852
|
},
|
|
4851
4853
|
canaryUrl: "https://fastrak.aitworldwide.com/",
|
|
4852
4854
|
trackingUrlTemplate: "https://fastrak.aitworldwide.com/?trackingnumber={trackingNumber}",
|
|
@@ -7018,15 +7020,23 @@ var Ue = {
|
|
|
7018
7020
|
timezone: "Asia/Shanghai",
|
|
7019
7021
|
tracking: {
|
|
7020
7022
|
mode: "automatic",
|
|
7021
|
-
adapter: "
|
|
7023
|
+
adapter: "chukou1",
|
|
7024
|
+
recognitionRank: 688,
|
|
7025
|
+
localClocks: !0
|
|
7022
7026
|
},
|
|
7023
|
-
canaryUrl: "https://
|
|
7024
|
-
trackingUrlTemplate: "https://
|
|
7025
|
-
trackingSearchUrl: "https://
|
|
7027
|
+
canaryUrl: "https://ec.chukou1.com/",
|
|
7028
|
+
trackingUrlTemplate: "https://ec.chukou1.com/track?track_number={trackingNumber}",
|
|
7029
|
+
trackingSearchUrl: "https://ec.chukou1.com/",
|
|
7026
7030
|
linkRules: [{
|
|
7031
|
+
domains: ["ec.chukou1.com"],
|
|
7032
|
+
pathPattern: "^/track/?$",
|
|
7033
|
+
params: ["track_number"],
|
|
7034
|
+
ownNumbersOnly: !0
|
|
7035
|
+
}, {
|
|
7027
7036
|
domains: ["www.chukou1.com", "chukou1.com"],
|
|
7028
7037
|
pathPattern: "^/LogistictsTrack\\.aspx$",
|
|
7029
|
-
params: ["trackNo"]
|
|
7038
|
+
params: ["trackNo"],
|
|
7039
|
+
ownNumbersOnly: !0
|
|
7030
7040
|
}],
|
|
7031
7041
|
detectionRules: [{
|
|
7032
7042
|
pattern: "^[A-Z]{3}\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])[A-Z][A-Z0-9]{2,3}\\d{6,7}$",
|
|
@@ -9873,9 +9883,11 @@ var Ue = {
|
|
|
9873
9883
|
timezone: "Asia/Seoul",
|
|
9874
9884
|
tracking: {
|
|
9875
9885
|
mode: "automatic",
|
|
9876
|
-
adapter: "
|
|
9886
|
+
adapter: "eparcel-kr",
|
|
9887
|
+
recognitionRank: 624,
|
|
9888
|
+
localClocks: !0
|
|
9877
9889
|
},
|
|
9878
|
-
canaryUrl: "https://www.eparcel.kr/Track/
|
|
9890
|
+
canaryUrl: "https://www.eparcel.kr/Track/Result",
|
|
9879
9891
|
trackingUrlTemplate: "https://www.eparcel.kr/Track/Result?mode=0&ids={trackingNumber}&lang=en-US",
|
|
9880
9892
|
trackingSearchUrl: "https://www.eparcel.kr/Track/Search",
|
|
9881
9893
|
linkRules: [{
|
|
@@ -12333,7 +12345,9 @@ var Ue = {
|
|
|
12333
12345
|
timezone: "America/Los_Angeles",
|
|
12334
12346
|
tracking: {
|
|
12335
12347
|
mode: "automatic",
|
|
12336
|
-
adapter: "
|
|
12348
|
+
adapter: "hovership",
|
|
12349
|
+
recognitionRank: 687,
|
|
12350
|
+
localClocks: !0
|
|
12337
12351
|
},
|
|
12338
12352
|
canaryUrl: "https://www.hovership.com/track/",
|
|
12339
12353
|
trackingUrlTemplate: "https://www.hovership.com/track/{trackingNumber}/",
|
|
@@ -15484,7 +15498,8 @@ var Ue = {
|
|
|
15484
15498
|
timezone: "Australia/Sydney",
|
|
15485
15499
|
tracking: {
|
|
15486
15500
|
mode: "automatic",
|
|
15487
|
-
adapter: "
|
|
15501
|
+
adapter: "mrl-global",
|
|
15502
|
+
localClocks: !0
|
|
15488
15503
|
},
|
|
15489
15504
|
canaryUrl: "https://www.mrlglobal.com/tracking/",
|
|
15490
15505
|
trackingUrlTemplate: "https://www.mrlglobal.com/tracking/?connoteno={trackingNumber}",
|
|
@@ -29509,6 +29524,7 @@ var Tl = {
|
|
|
29509
29524
|
"abf-freight": 10,
|
|
29510
29525
|
"acs-courier": 310,
|
|
29511
29526
|
"airpak-express": 776,
|
|
29527
|
+
"ait-worldwide": 625,
|
|
29512
29528
|
ajex: 812,
|
|
29513
29529
|
"algerie-poste": 897,
|
|
29514
29530
|
aliexpress: 580,
|
|
@@ -29562,6 +29578,7 @@ var Tl = {
|
|
|
29562
29578
|
"chit-chats": 115,
|
|
29563
29579
|
chronodiali: 781,
|
|
29564
29580
|
chronopost: 890,
|
|
29581
|
+
chukou1: 688,
|
|
29565
29582
|
chunil: 621,
|
|
29566
29583
|
ciblex: 640,
|
|
29567
29584
|
"city-express-rs": 817,
|
|
@@ -29630,6 +29647,7 @@ var Tl = {
|
|
|
29630
29647
|
"energia-tk": 927,
|
|
29631
29648
|
"envia-colombia": 912,
|
|
29632
29649
|
envialia: 260,
|
|
29650
|
+
"eparcel-kr": 624,
|
|
29633
29651
|
"epost-global": 65,
|
|
29634
29652
|
equick: 853,
|
|
29635
29653
|
estes: 20,
|
|
@@ -29686,6 +29704,7 @@ var Tl = {
|
|
|
29686
29704
|
"hermes-at": 876,
|
|
29687
29705
|
"hermes-de": 840,
|
|
29688
29706
|
"houng-ah-loun": 637,
|
|
29707
|
+
hovership: 687,
|
|
29689
29708
|
"hr-parcel": 887,
|
|
29690
29709
|
"hrvatska-posta": 160,
|
|
29691
29710
|
hywl: 993,
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export { FASTRAK } from './parser.js';
|
|
5
|
+
/** FasTrak's address for one whole bill number, as AIT's tracking box opens it. */
|
|
6
|
+
export declare function aitLookupUrl(number: string): string;
|
|
7
|
+
export declare class AitTracker {
|
|
8
|
+
private readonly options;
|
|
9
|
+
constructor(options?: {
|
|
10
|
+
fetcher?: typeof fetch;
|
|
11
|
+
recorder?: StepRecorder;
|
|
12
|
+
userAgent?: string;
|
|
13
|
+
});
|
|
14
|
+
fetch(raw: string, context?: TrackingContext): Promise<CarrierResult>;
|
|
15
|
+
}
|
|
16
|
+
export declare const adapter: AdapterFactory;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { accepted, recognizeFromLookup } from '../../core/adapter/index.js';
|
|
2
|
+
import { TransportError } from '../../core/errors/index.js';
|
|
3
|
+
import { runSteps } from '../../core/runner/index.js';
|
|
4
|
+
import { firstAttemptMs, networkRetryStep } from '../../core/runner/networkRetry.js';
|
|
5
|
+
import { NOOP_RECORDER } from '../../core/telemetry/index.js';
|
|
6
|
+
import { decodeText, fetchBounded, userAgentOf } from '../../core/transport/index.js';
|
|
7
|
+
import { AIT_MAX_BYTES, FASTRAK, normalizeAitNumber, parseAit, PROVIDER } from './parser.js';
|
|
8
|
+
export { FASTRAK } from './parser.js';
|
|
9
|
+
const REDIRECTS = [301, 302, 303, 307, 308];
|
|
10
|
+
const GONE = [404, 410];
|
|
11
|
+
/** FasTrak's address for one whole bill number, as AIT's tracking box opens it. */
|
|
12
|
+
export function aitLookupUrl(number) {
|
|
13
|
+
return `${FASTRAK}?${new URLSearchParams({ trackingnumber: normalizeAitNumber(number) })}`;
|
|
14
|
+
}
|
|
15
|
+
export class AitTracker {
|
|
16
|
+
options;
|
|
17
|
+
constructor(options = {}) {
|
|
18
|
+
this.options = options;
|
|
19
|
+
}
|
|
20
|
+
async fetch(raw, context = {}) {
|
|
21
|
+
const number = normalizeAitNumber(raw);
|
|
22
|
+
const read = async (signal, timeoutMs) => {
|
|
23
|
+
const { response, bytes } = await fetchBounded(aitLookupUrl(number), { method: 'GET', signal, headers: {
|
|
24
|
+
Accept: 'text/html', 'User-Agent': userAgentOf(this.options.userAgent),
|
|
25
|
+
} }, { provider: PROVIDER, timeoutMs: Math.max(1, Math.floor(timeoutMs)), maxBytes: AIT_MAX_BYTES, redirect: 'manual',
|
|
26
|
+
fetcher: this.options.fetcher, allowHttpStatuses: [...REDIRECTS, ...GONE] });
|
|
27
|
+
if (REDIRECTS.includes(response.status))
|
|
28
|
+
throw new TransportError(PROVIDER, 'FasTrak redirected its tracking page');
|
|
29
|
+
if (GONE.includes(response.status))
|
|
30
|
+
throw new TransportError(PROVIDER, 'FasTrak tracking page is unavailable');
|
|
31
|
+
return parseAit(decodeText(bytes), number);
|
|
32
|
+
};
|
|
33
|
+
// A request that fails to reach FasTrak, or hangs, gets one more try: the
|
|
34
|
+
// first gets half of the budget, so the retry fits in the rest.
|
|
35
|
+
return runSteps({ carrier: 'ait-worldwide', budgetMs: context.budgetMs ?? 15_000, signal: context.signal,
|
|
36
|
+
recorder: this.options.recorder ?? NOOP_RECORDER }, [
|
|
37
|
+
{ id: 'direct', run: ({ signal, remainingMs }) => read(signal, firstAttemptMs(remainingMs)) },
|
|
38
|
+
networkRetryStep(({ signal, remainingMs }) => read(signal, remainingMs)),
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export const adapter = (environment) => {
|
|
43
|
+
const tracker = new AitTracker({ fetcher: environment.fetcher, recorder: environment.recorder, userAgent: environment.userAgent });
|
|
44
|
+
return {
|
|
45
|
+
id: 'ait-worldwide', recordsSteps: true, steps: ['direct', 'retry'],
|
|
46
|
+
track: (input, context) => tracker.fetch(input.number, context),
|
|
47
|
+
recognize: (number, context) => recognizeFromLookup(() => tracker.fetch(number, context), () => accepted(() => normalizeAitNumber(number))),
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -17,18 +17,64 @@
|
|
|
17
17
|
"timezone": "America/Chicago",
|
|
18
18
|
"tracking": {
|
|
19
19
|
"mode": "automatic",
|
|
20
|
-
"adapter": "
|
|
21
|
-
"steps": [
|
|
20
|
+
"adapter": "ait-worldwide",
|
|
21
|
+
"steps": [
|
|
22
|
+
"direct",
|
|
23
|
+
"retry"
|
|
24
|
+
],
|
|
25
|
+
"recognition": {
|
|
26
|
+
"rank": 625
|
|
27
|
+
},
|
|
28
|
+
"localClocks": true
|
|
22
29
|
},
|
|
23
|
-
"capabilities": [
|
|
30
|
+
"capabilities": [
|
|
31
|
+
"history",
|
|
32
|
+
"provider_code",
|
|
33
|
+
"eta"
|
|
34
|
+
],
|
|
24
35
|
"portal": {
|
|
25
36
|
"url": "https://fastrak.aitworldwide.com/?trackingnumber={trackingNumber}",
|
|
26
37
|
"searchUrl": "https://fastrak.aitworldwide.com/",
|
|
27
38
|
"canaryUrl": "https://fastrak.aitworldwide.com/",
|
|
28
|
-
"shows": [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
"shows": [
|
|
40
|
+
"status",
|
|
41
|
+
"progress_rail",
|
|
42
|
+
"history",
|
|
43
|
+
"provider_code",
|
|
44
|
+
"eta",
|
|
45
|
+
"eta_window",
|
|
46
|
+
"delivered_at",
|
|
47
|
+
"destination",
|
|
48
|
+
"signatory",
|
|
49
|
+
"event_details",
|
|
50
|
+
"office_contact_details",
|
|
51
|
+
"delivery_options"
|
|
52
|
+
],
|
|
53
|
+
"scraped": [
|
|
54
|
+
"status",
|
|
55
|
+
"progress_rail",
|
|
56
|
+
"history",
|
|
57
|
+
"provider_code",
|
|
58
|
+
"eta"
|
|
59
|
+
],
|
|
60
|
+
"discarded": [
|
|
61
|
+
"eta_window",
|
|
62
|
+
"delivered_at",
|
|
63
|
+
"destination",
|
|
64
|
+
"signatory",
|
|
65
|
+
"event_details",
|
|
66
|
+
"office_contact_details",
|
|
67
|
+
"delivery_options"
|
|
68
|
+
],
|
|
69
|
+
"unavailable": [
|
|
70
|
+
"offset_timestamps",
|
|
71
|
+
"location",
|
|
72
|
+
"weight",
|
|
73
|
+
"service_name",
|
|
74
|
+
"sender_name",
|
|
75
|
+
"recipient_name",
|
|
76
|
+
"recipient_address"
|
|
77
|
+
]
|
|
32
78
|
},
|
|
33
79
|
"links": [
|
|
34
80
|
{
|
|
@@ -2,95 +2,16 @@
|
|
|
2
2
|
"carrier": "ait-worldwide",
|
|
3
3
|
"records": [
|
|
4
4
|
{
|
|
5
|
-
"number": "
|
|
5
|
+
"number": "100000001",
|
|
6
6
|
"role": "shipment",
|
|
7
|
-
"evidence": "
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"date": "2022-03-30",
|
|
11
|
-
"dateKind": "capture",
|
|
12
|
-
"access": "full_page"
|
|
13
|
-
},
|
|
14
|
-
"context": {
|
|
15
|
-
"assessment": "confirmed"
|
|
16
|
-
},
|
|
17
|
-
"expect": {
|
|
18
|
-
"carrier": "unknown",
|
|
19
|
-
"confidence": "low",
|
|
20
|
-
"candidates": [
|
|
21
|
-
"mondial-relay",
|
|
22
|
-
"colisweb",
|
|
23
|
-
"heppner"
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
"note": "An opened archived lookup on AIT's FasTrak tracker shows this shipment delivered to a Honolulu address."
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"number": "21491416",
|
|
30
|
-
"role": "shipment",
|
|
31
|
-
"evidence": "public_shipment_report",
|
|
32
|
-
"source": {
|
|
33
|
-
"url": "https://web.archive.org/web/20221206175827/https://fastrak.aitworldwide.com/?TrackingNumber=21491416",
|
|
34
|
-
"date": "2022-12-06",
|
|
35
|
-
"dateKind": "capture",
|
|
36
|
-
"access": "full_page"
|
|
37
|
-
},
|
|
38
|
-
"context": {
|
|
39
|
-
"assessment": "confirmed"
|
|
40
|
-
},
|
|
41
|
-
"expect": {
|
|
42
|
-
"carrier": "unknown",
|
|
43
|
-
"confidence": "low",
|
|
44
|
-
"candidates": [
|
|
45
|
-
"mondial-relay",
|
|
46
|
-
"colisweb",
|
|
47
|
-
"heppner"
|
|
48
|
-
]
|
|
49
|
-
},
|
|
50
|
-
"note": "An opened archived lookup on AIT's FasTrak tracker shows this shipment delivered with its delivery time."
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"number": "21500455",
|
|
54
|
-
"role": "shipment",
|
|
55
|
-
"evidence": "public_shipment_report",
|
|
56
|
-
"source": {
|
|
57
|
-
"url": "https://web.archive.org/web/20220331032913/https://fastrak.aitworldwide.com/?TrackingNumber=21500455",
|
|
58
|
-
"date": "2022-03-31",
|
|
59
|
-
"dateKind": "capture",
|
|
60
|
-
"access": "full_page"
|
|
61
|
-
},
|
|
62
|
-
"context": {
|
|
63
|
-
"assessment": "confirmed"
|
|
64
|
-
},
|
|
65
|
-
"expect": {
|
|
66
|
-
"carrier": "unknown",
|
|
67
|
-
"confidence": "low",
|
|
68
|
-
"candidates": [
|
|
69
|
-
"mondial-relay",
|
|
70
|
-
"colisweb",
|
|
71
|
-
"heppner"
|
|
72
|
-
]
|
|
73
|
-
},
|
|
74
|
-
"note": "An opened archived lookup on AIT's FasTrak tracker shows this shipment delivered with its delivery time."
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"number": "150063800",
|
|
78
|
-
"role": "shipment",
|
|
79
|
-
"evidence": "public_shipment_report",
|
|
80
|
-
"source": {
|
|
81
|
-
"url": "https://web.archive.org/web/20240406182633/https://fastrak.aitworldwide.com/?TrackingNumber=150063800",
|
|
82
|
-
"date": "2024-04-06",
|
|
83
|
-
"dateKind": "capture",
|
|
84
|
-
"access": "full_page"
|
|
85
|
-
},
|
|
86
|
-
"context": {
|
|
87
|
-
"assessment": "confirmed"
|
|
88
|
-
},
|
|
7
|
+
"evidence": "synthetic",
|
|
8
|
+
"derivedFrom": "invented",
|
|
9
|
+
"shapeConfirmed": "2026-10-19",
|
|
89
10
|
"expect": {
|
|
90
11
|
"carrier": "unknown",
|
|
91
12
|
"confidence": "none"
|
|
92
13
|
},
|
|
93
|
-
"note": "
|
|
14
|
+
"note": "Invented placeholder for a nine-digit bill of the current FasTrak tracker; the public samples' tracker names their signers."
|
|
94
15
|
},
|
|
95
16
|
{
|
|
96
17
|
"number": "11301624",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CarrierResult } from '../../core/result/index.js';
|
|
2
|
+
export declare const PROVIDER = "AIT Worldwide Logistics";
|
|
3
|
+
/** FasTrak, which renders the shipments it finds for the number in its address on the server. */
|
|
4
|
+
export declare const FASTRAK = "https://fastrak.aitworldwide.com/";
|
|
5
|
+
export declare const AIT_MAX_BYTES = 1000000;
|
|
6
|
+
/** An AIT bill number, as typed; anything else is not one FasTrak looks up. */
|
|
7
|
+
export declare function normalizeAitNumber(raw: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* FasTrak's page `fastrak.aitworldwide.com/?trackingnumber={number}`. It
|
|
10
|
+
* lists each shipment whose bill number or shipper's reference matches, each
|
|
11
|
+
* with its bill number, the town it is delivered to, its progress, its
|
|
12
|
+
* delivery panel and its history newest first, as data in the history grid's
|
|
13
|
+
* settings. A number it does not know is a warning naming it. Only a shipment
|
|
14
|
+
* whose bill number is the number asked is read; the town, the signer, the
|
|
15
|
+
* office's phone number, the rows' explanations and the delivery scheduling
|
|
16
|
+
* are not.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseAit(html: string, raw: string): CarrierResult;
|