universal-parcel-scraper 0.293.0-main.1746 → 0.294.0-main.1752
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 +24 -4
- package/data/coverage-summary.json +1 -1
- package/data/detection-golden.json +76 -40
- package/dist/browser/scraper.js +21 -5
- package/dist/carriers/dpd-at/adapter.d.ts +24 -0
- package/dist/carriers/dpd-at/adapter.js +82 -0
- package/dist/carriers/dpd-at/carrier.json +49 -7
- package/dist/carriers/dpd-at/numbers.json +35 -2
- package/dist/carriers/dpd-at/parser.d.ts +18 -0
- package/dist/carriers/dpd-at/parser.js +176 -0
- package/dist/carriers/dpd-at/status.d.ts +7 -0
- package/dist/carriers/dpd-at/status.js +37 -0
- package/dist/carriers/dpd-at/statuses.json +9 -0
- package/dist/carriers/jordan-post/adapter.d.ts +14 -0
- package/dist/carriers/jordan-post/adapter.js +73 -0
- package/dist/carriers/jordan-post/carrier.json +64 -9
- package/dist/carriers/jordan-post/numbers.json +19 -0
- package/dist/carriers/jordan-post/parser.d.ts +32 -0
- package/dist/carriers/jordan-post/parser.js +253 -0
- package/dist/carriers/jordan-post/status.d.ts +11 -0
- package/dist/carriers/jordan-post/status.js +51 -0
- package/dist/carriers/jordan-post/statuses.json +13 -3
- package/dist/core/catalog/hints.js +5 -5
- package/dist/core/catalog/statusMaps.js +4 -2
- package/dist/data/catalog.json +24 -4
- package/dist/generated/catalog.d.ts +17 -4
- package/dist/generated/catalog.js +25 -5
- package/dist/generated/recognition.js +2 -0
- package/dist/generated/registry.js +6 -2
- package/dist/providers/shared/result.js +3 -0
- 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 **336 dedicated adapters** and **5 universal fallbacks**
|
|
17
17
|
|
|
18
18
|
<sub>635 catalog entries · 129 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 12,
|
|
158
|
+
The carrier folders record 12,191 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
|
@@ -10033,7 +10033,9 @@
|
|
|
10033
10033
|
"timezone": "Europe/Vienna",
|
|
10034
10034
|
"tracking": {
|
|
10035
10035
|
"mode": "automatic",
|
|
10036
|
-
"adapter": "
|
|
10036
|
+
"adapter": "dpd-at",
|
|
10037
|
+
"recognitionRank": 878,
|
|
10038
|
+
"localClocks": true
|
|
10037
10039
|
},
|
|
10038
10040
|
"canaryUrl": "https://www.mydpd.at/",
|
|
10039
10041
|
"trackingUrlTemplate": "https://www.mydpd.at/?f=parcel.load&p={trackingNumber}",
|
|
@@ -15068,12 +15070,23 @@
|
|
|
15068
15070
|
"timezone": "Asia/Amman",
|
|
15069
15071
|
"tracking": {
|
|
15070
15072
|
"mode": "automatic",
|
|
15071
|
-
"adapter": "
|
|
15073
|
+
"adapter": "jordan-post",
|
|
15074
|
+
"recognitionRank": 881,
|
|
15075
|
+
"localClocks": true
|
|
15072
15076
|
},
|
|
15073
15077
|
"canaryUrl": "https://212.35.69.84/NewWebTrack/WebTrack_Submit.aspx",
|
|
15074
|
-
"trackingUrlTemplate": "https://212.35.69.
|
|
15078
|
+
"trackingUrlTemplate": "https://212.35.69.85/webtracking/IPSWeb_item_events.aspx?itemid={trackingNumber}&Submit=Submit",
|
|
15075
15079
|
"trackingSearchUrl": "https://212.35.69.84/NewWebTrack/WebTrack_Submit.aspx",
|
|
15076
15080
|
"linkRules": [
|
|
15081
|
+
{
|
|
15082
|
+
"domains": [
|
|
15083
|
+
"212.35.69.85"
|
|
15084
|
+
],
|
|
15085
|
+
"pathPattern": "^/webtracking/IPSWeb_item_events\\.aspx$",
|
|
15086
|
+
"params": [
|
|
15087
|
+
"itemid"
|
|
15088
|
+
]
|
|
15089
|
+
},
|
|
15077
15090
|
{
|
|
15078
15091
|
"domains": [
|
|
15079
15092
|
"212.35.69.84"
|
|
@@ -15084,7 +15097,14 @@
|
|
|
15084
15097
|
]
|
|
15085
15098
|
}
|
|
15086
15099
|
],
|
|
15087
|
-
"detectionRules": [
|
|
15100
|
+
"detectionRules": [
|
|
15101
|
+
{
|
|
15102
|
+
"pattern": "^[A-Z]{2}\\d{9}JO$",
|
|
15103
|
+
"confidence": "low",
|
|
15104
|
+
"checksum": "s10",
|
|
15105
|
+
"preferred": true
|
|
15106
|
+
}
|
|
15107
|
+
]
|
|
15088
15108
|
},
|
|
15089
15109
|
"jrs-express": {
|
|
15090
15110
|
"displayName": "JRS Express",
|
|
@@ -4327,6 +4327,32 @@
|
|
|
4327
4327
|
"j-and-t"
|
|
4328
4328
|
]
|
|
4329
4329
|
},
|
|
4330
|
+
{
|
|
4331
|
+
"input": "01955023696290",
|
|
4332
|
+
"carrier": "unknown",
|
|
4333
|
+
"confidence": "low",
|
|
4334
|
+
"candidates": [
|
|
4335
|
+
"dpd",
|
|
4336
|
+
"dpd-fr",
|
|
4337
|
+
"relais-colis",
|
|
4338
|
+
"ciblex",
|
|
4339
|
+
"seur",
|
|
4340
|
+
"brt",
|
|
4341
|
+
"delhivery",
|
|
4342
|
+
"dhl-ecommerce-uk",
|
|
4343
|
+
"dpd-be",
|
|
4344
|
+
"dpd-de",
|
|
4345
|
+
"dpd-nl",
|
|
4346
|
+
"dpd-uk"
|
|
4347
|
+
],
|
|
4348
|
+
"asked": [
|
|
4349
|
+
"dpd-be",
|
|
4350
|
+
"dpd",
|
|
4351
|
+
"dpd-nl",
|
|
4352
|
+
"dpd-de",
|
|
4353
|
+
"seur"
|
|
4354
|
+
]
|
|
4355
|
+
},
|
|
4330
4356
|
{
|
|
4331
4357
|
"input": "01975035168241",
|
|
4332
4358
|
"carrier": "unknown",
|
|
@@ -6982,11 +7008,11 @@
|
|
|
6982
7008
|
"dpd-at"
|
|
6983
7009
|
],
|
|
6984
7010
|
"asked": [
|
|
6985
|
-
"
|
|
6986
|
-
"
|
|
6987
|
-
"
|
|
6988
|
-
"
|
|
6989
|
-
"
|
|
7011
|
+
"dpd-at",
|
|
7012
|
+
"dpd-be",
|
|
7013
|
+
"dpd",
|
|
7014
|
+
"dpd-nl",
|
|
7015
|
+
"dpd-de"
|
|
6990
7016
|
]
|
|
6991
7017
|
},
|
|
6992
7018
|
{
|
|
@@ -7012,11 +7038,11 @@
|
|
|
7012
7038
|
"dpd-at"
|
|
7013
7039
|
],
|
|
7014
7040
|
"asked": [
|
|
7015
|
-
"
|
|
7016
|
-
"
|
|
7017
|
-
"
|
|
7018
|
-
"
|
|
7019
|
-
"
|
|
7041
|
+
"dpd-at",
|
|
7042
|
+
"dpd-be",
|
|
7043
|
+
"dpd",
|
|
7044
|
+
"dpd-nl",
|
|
7045
|
+
"dpd-de"
|
|
7020
7046
|
]
|
|
7021
7047
|
},
|
|
7022
7048
|
{
|
|
@@ -7042,11 +7068,11 @@
|
|
|
7042
7068
|
"dpd-at"
|
|
7043
7069
|
],
|
|
7044
7070
|
"asked": [
|
|
7045
|
-
"
|
|
7046
|
-
"
|
|
7047
|
-
"
|
|
7048
|
-
"
|
|
7049
|
-
"
|
|
7071
|
+
"dpd-at",
|
|
7072
|
+
"dpd-be",
|
|
7073
|
+
"dpd",
|
|
7074
|
+
"dpd-nl",
|
|
7075
|
+
"dpd-de"
|
|
7050
7076
|
]
|
|
7051
7077
|
},
|
|
7052
7078
|
{
|
|
@@ -7072,11 +7098,11 @@
|
|
|
7072
7098
|
"dpd-at"
|
|
7073
7099
|
],
|
|
7074
7100
|
"asked": [
|
|
7075
|
-
"
|
|
7076
|
-
"
|
|
7077
|
-
"
|
|
7078
|
-
"
|
|
7079
|
-
"
|
|
7101
|
+
"dpd-at",
|
|
7102
|
+
"dpd-be",
|
|
7103
|
+
"dpd",
|
|
7104
|
+
"dpd-nl",
|
|
7105
|
+
"dpd-de"
|
|
7080
7106
|
]
|
|
7081
7107
|
},
|
|
7082
7108
|
{
|
|
@@ -7102,11 +7128,11 @@
|
|
|
7102
7128
|
"dpd-at"
|
|
7103
7129
|
],
|
|
7104
7130
|
"asked": [
|
|
7105
|
-
"
|
|
7106
|
-
"
|
|
7107
|
-
"
|
|
7108
|
-
"
|
|
7109
|
-
"
|
|
7131
|
+
"dpd-at",
|
|
7132
|
+
"dpd-be",
|
|
7133
|
+
"dpd",
|
|
7134
|
+
"dpd-nl",
|
|
7135
|
+
"dpd-de"
|
|
7110
7136
|
]
|
|
7111
7137
|
},
|
|
7112
7138
|
{
|
|
@@ -7188,11 +7214,11 @@
|
|
|
7188
7214
|
"dpd-at"
|
|
7189
7215
|
],
|
|
7190
7216
|
"asked": [
|
|
7191
|
-
"
|
|
7192
|
-
"
|
|
7193
|
-
"
|
|
7194
|
-
"
|
|
7195
|
-
"
|
|
7217
|
+
"dpd-at",
|
|
7218
|
+
"dpd-be",
|
|
7219
|
+
"dpd",
|
|
7220
|
+
"dpd-nl",
|
|
7221
|
+
"dpd-de"
|
|
7196
7222
|
]
|
|
7197
7223
|
},
|
|
7198
7224
|
{
|
|
@@ -7218,11 +7244,11 @@
|
|
|
7218
7244
|
"dpd-at"
|
|
7219
7245
|
],
|
|
7220
7246
|
"asked": [
|
|
7221
|
-
"
|
|
7222
|
-
"
|
|
7223
|
-
"
|
|
7224
|
-
"
|
|
7225
|
-
"
|
|
7247
|
+
"dpd-at",
|
|
7248
|
+
"dpd-be",
|
|
7249
|
+
"dpd",
|
|
7250
|
+
"dpd-nl",
|
|
7251
|
+
"dpd-de"
|
|
7226
7252
|
]
|
|
7227
7253
|
},
|
|
7228
7254
|
{
|
|
@@ -7248,11 +7274,11 @@
|
|
|
7248
7274
|
"dpd-at"
|
|
7249
7275
|
],
|
|
7250
7276
|
"asked": [
|
|
7251
|
-
"
|
|
7252
|
-
"
|
|
7253
|
-
"
|
|
7254
|
-
"
|
|
7255
|
-
"
|
|
7277
|
+
"dpd-at",
|
|
7278
|
+
"dpd-be",
|
|
7279
|
+
"dpd",
|
|
7280
|
+
"dpd-nl",
|
|
7281
|
+
"dpd-de"
|
|
7256
7282
|
]
|
|
7257
7283
|
},
|
|
7258
7284
|
{
|
|
@@ -74295,6 +74321,14 @@
|
|
|
74295
74321
|
"chronopost"
|
|
74296
74322
|
]
|
|
74297
74323
|
},
|
|
74324
|
+
{
|
|
74325
|
+
"input": "RL851146956IE",
|
|
74326
|
+
"carrier": "an-post",
|
|
74327
|
+
"confidence": "high",
|
|
74328
|
+
"candidates": [
|
|
74329
|
+
"an-post"
|
|
74330
|
+
]
|
|
74331
|
+
},
|
|
74298
74332
|
{
|
|
74299
74333
|
"input": "RL904818378CH",
|
|
74300
74334
|
"carrier": "swiss-post",
|
|
@@ -75164,6 +75198,7 @@
|
|
|
75164
75198
|
"intl-post"
|
|
75165
75199
|
],
|
|
75166
75200
|
"asked": [
|
|
75201
|
+
"jordan-post",
|
|
75167
75202
|
"chronopost"
|
|
75168
75203
|
]
|
|
75169
75204
|
},
|
|
@@ -75477,6 +75512,7 @@
|
|
|
75477
75512
|
"intl-post"
|
|
75478
75513
|
],
|
|
75479
75514
|
"asked": [
|
|
75515
|
+
"jordan-post",
|
|
75480
75516
|
"chronopost"
|
|
75481
75517
|
]
|
|
75482
75518
|
},
|
package/dist/browser/scraper.js
CHANGED
|
@@ -7851,7 +7851,9 @@ var Me = {
|
|
|
7851
7851
|
timezone: "Europe/Vienna",
|
|
7852
7852
|
tracking: {
|
|
7853
7853
|
mode: "automatic",
|
|
7854
|
-
adapter: "
|
|
7854
|
+
adapter: "dpd-at",
|
|
7855
|
+
recognitionRank: 878,
|
|
7856
|
+
localClocks: !0
|
|
7855
7857
|
},
|
|
7856
7858
|
canaryUrl: "https://www.mydpd.at/",
|
|
7857
7859
|
trackingUrlTemplate: "https://www.mydpd.at/?f=parcel.load&p={trackingNumber}",
|
|
@@ -11543,17 +11545,28 @@ var Me = {
|
|
|
11543
11545
|
timezone: "Asia/Amman",
|
|
11544
11546
|
tracking: {
|
|
11545
11547
|
mode: "automatic",
|
|
11546
|
-
adapter: "
|
|
11548
|
+
adapter: "jordan-post",
|
|
11549
|
+
recognitionRank: 881,
|
|
11550
|
+
localClocks: !0
|
|
11547
11551
|
},
|
|
11548
11552
|
canaryUrl: "https://212.35.69.84/NewWebTrack/WebTrack_Submit.aspx",
|
|
11549
|
-
trackingUrlTemplate: "https://212.35.69.
|
|
11553
|
+
trackingUrlTemplate: "https://212.35.69.85/webtracking/IPSWeb_item_events.aspx?itemid={trackingNumber}&Submit=Submit",
|
|
11550
11554
|
trackingSearchUrl: "https://212.35.69.84/NewWebTrack/WebTrack_Submit.aspx",
|
|
11551
11555
|
linkRules: [{
|
|
11556
|
+
domains: ["212.35.69.85"],
|
|
11557
|
+
pathPattern: "^/webtracking/IPSWeb_item_events\\.aspx$",
|
|
11558
|
+
params: ["itemid"]
|
|
11559
|
+
}, {
|
|
11552
11560
|
domains: ["212.35.69.84"],
|
|
11553
11561
|
pathPattern: "^/JordanWebTrack/Result\\.aspx$",
|
|
11554
11562
|
params: ["itemid"]
|
|
11555
11563
|
}],
|
|
11556
|
-
detectionRules: [
|
|
11564
|
+
detectionRules: [{
|
|
11565
|
+
pattern: "^[A-Z]{2}\\d{9}JO$",
|
|
11566
|
+
confidence: "low",
|
|
11567
|
+
checksum: "s10",
|
|
11568
|
+
preferred: !0
|
|
11569
|
+
}]
|
|
11557
11570
|
},
|
|
11558
11571
|
"jrs-express": {
|
|
11559
11572
|
displayName: "JRS Express",
|
|
@@ -19854,7 +19867,7 @@ var Me = {
|
|
|
19854
19867
|
jhgj: ["jhgj-1"],
|
|
19855
19868
|
jitsu: [],
|
|
19856
19869
|
jne: ["jne-1"],
|
|
19857
|
-
"jordan-post": [],
|
|
19870
|
+
"jordan-post": ["jordan-post-s10"],
|
|
19858
19871
|
"jrs-express": [],
|
|
19859
19872
|
jrt: ["jrt-1"],
|
|
19860
19873
|
"js-express": ["js-express-1"],
|
|
@@ -25039,6 +25052,7 @@ var Mc = /* @__PURE__ */ new Map([
|
|
|
25039
25052
|
["FI", "posti"],
|
|
25040
25053
|
["FR", "la-poste"],
|
|
25041
25054
|
["GB", "royal-mail"],
|
|
25055
|
+
["JO", "jordan-post"],
|
|
25042
25056
|
["JP", "japan-post"],
|
|
25043
25057
|
["MA", "barid-al-maghrib"],
|
|
25044
25058
|
["MK", "posta-north-macedonia"],
|
|
@@ -25324,6 +25338,7 @@ var ul = {
|
|
|
25324
25338
|
"dhl-freight": 437,
|
|
25325
25339
|
dhlink: 995,
|
|
25326
25340
|
dpd: 980,
|
|
25341
|
+
"dpd-at": 878,
|
|
25327
25342
|
"dpd-be": 983,
|
|
25328
25343
|
"dpd-de": 970,
|
|
25329
25344
|
"dpd-ie": 960,
|
|
@@ -25387,6 +25402,7 @@ var ul = {
|
|
|
25387
25402
|
"j-and-t-cargo": 910,
|
|
25388
25403
|
jhgj: 907,
|
|
25389
25404
|
jitsu: 85,
|
|
25405
|
+
"jordan-post": 881,
|
|
25390
25406
|
"js-express": 916,
|
|
25391
25407
|
kazpost: 931,
|
|
25392
25408
|
kex: 959,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type AdapterFactory, type Recognition, 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
|
+
import { type DpdAtReading } from './parser.js';
|
|
5
|
+
/** The lookup myDPD's page makes for the number typed in. */
|
|
6
|
+
export declare const DPD_AT_SEARCH = "https://www.mydpd.at/jws.php/parcel/search";
|
|
7
|
+
export declare class DpdAtTracker {
|
|
8
|
+
private readonly options;
|
|
9
|
+
constructor(options?: {
|
|
10
|
+
fetcher?: typeof fetch;
|
|
11
|
+
recorder?: StepRecorder;
|
|
12
|
+
userAgent?: string;
|
|
13
|
+
});
|
|
14
|
+
read(raw: string, context?: TrackingContext): Promise<DpdAtReading>;
|
|
15
|
+
fetch(raw: string, context?: TrackingContext): Promise<CarrierResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Whether myDPD knows the parcel and its newest scan is in Austria. DPD
|
|
18
|
+
* Austria is the preferred carrier for its depots' numbers, so a parcel that
|
|
19
|
+
* has since moved to another country is left to that country's network,
|
|
20
|
+
* and a newest scan without a country is inconclusive.
|
|
21
|
+
*/
|
|
22
|
+
recognize(raw: string, context?: TrackingContext): Promise<Recognition>;
|
|
23
|
+
}
|
|
24
|
+
export declare const adapter: AdapterFactory;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { accepted, recognizeFromLookup } from '../../core/adapter/index.js';
|
|
2
|
+
import { ChallengeError, IndeterminateError, NotFoundError, SchemaError, TransportError } from '../../core/errors/index.js';
|
|
3
|
+
import { runSteps } from '../../core/runner/index.js';
|
|
4
|
+
import { NOOP_RECORDER } from '../../core/telemetry/index.js';
|
|
5
|
+
import { decodeText, fetchBounded, userAgentOf } from '../../core/transport/index.js';
|
|
6
|
+
import { DPD_AT_MAX_BYTES, dpdAtNumber, PROVIDER, readDpdAt } from './parser.js';
|
|
7
|
+
/** The lookup myDPD's page makes for the number typed in. */
|
|
8
|
+
export const DPD_AT_SEARCH = 'https://www.mydpd.at/jws.php/parcel/search';
|
|
9
|
+
const REDIRECTS = [301, 302, 303, 307, 308];
|
|
10
|
+
// Radware's bot manager answers with its own page in place of the reply, or
|
|
11
|
+
// sends the browser to its captcha on perfdrive.com.
|
|
12
|
+
const CHALLENGE = /<title>\s*Radware (?:Captcha )?Page\s*<\/title>|Verifying your browser|perfdrive\.com|shieldsquare/i;
|
|
13
|
+
function json(body) {
|
|
14
|
+
try {
|
|
15
|
+
return JSON.parse(body);
|
|
16
|
+
}
|
|
17
|
+
catch (cause) {
|
|
18
|
+
if (CHALLENGE.test(body.slice(0, 64_000)))
|
|
19
|
+
throw new ChallengeError(PROVIDER, 'myDPD answered with a browser check', { cause });
|
|
20
|
+
throw new SchemaError(PROVIDER, 'myDPD returned a reply that is not JSON', { cause });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export class DpdAtTracker {
|
|
24
|
+
options;
|
|
25
|
+
constructor(options = {}) {
|
|
26
|
+
this.options = options;
|
|
27
|
+
}
|
|
28
|
+
async read(raw, context = {}) {
|
|
29
|
+
const number = dpdAtNumber(raw);
|
|
30
|
+
const search = async (signal, timeoutMs) => {
|
|
31
|
+
const { response, bytes } = await fetchBounded(DPD_AT_SEARCH, { method: 'POST', signal, headers: {
|
|
32
|
+
Accept: 'application/json', 'Content-Type': 'application/json; charset=utf-8', 'User-Agent': userAgentOf(this.options.userAgent),
|
|
33
|
+
}, body: JSON.stringify(number) }, { provider: PROVIDER, timeoutMs: Math.max(1, Math.floor(timeoutMs)),
|
|
34
|
+
maxBytes: DPD_AT_MAX_BYTES, redirect: 'manual', fetcher: this.options.fetcher, allowHttpStatuses: REDIRECTS });
|
|
35
|
+
if (REDIRECTS.includes(response.status)) {
|
|
36
|
+
if (CHALLENGE.test(response.headers.get('location') ?? ''))
|
|
37
|
+
throw new ChallengeError(PROVIDER, 'myDPD sent the lookup to a captcha');
|
|
38
|
+
throw new TransportError(PROVIDER, 'myDPD redirected its tracking lookup');
|
|
39
|
+
}
|
|
40
|
+
return readDpdAt(json(decodeText(bytes)), number);
|
|
41
|
+
};
|
|
42
|
+
return runSteps({ carrier: 'dpd-at', budgetMs: context.budgetMs ?? 15_000, signal: context.signal,
|
|
43
|
+
recorder: this.options.recorder ?? NOOP_RECORDER }, [
|
|
44
|
+
{ id: 'direct', run: ({ signal, remainingMs }) => search(signal, remainingMs) },
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
async fetch(raw, context = {}) {
|
|
48
|
+
return (await this.read(raw, context)).result;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Whether myDPD knows the parcel and its newest scan is in Austria. DPD
|
|
52
|
+
* Austria is the preferred carrier for its depots' numbers, so a parcel that
|
|
53
|
+
* has since moved to another country is left to that country's network,
|
|
54
|
+
* and a newest scan without a country is inconclusive.
|
|
55
|
+
*/
|
|
56
|
+
async recognize(raw, context = {}) {
|
|
57
|
+
if (!accepted(() => dpdAtNumber(raw)))
|
|
58
|
+
return { known: false };
|
|
59
|
+
let reading;
|
|
60
|
+
try {
|
|
61
|
+
reading = await this.read(raw, context);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
if (error instanceof NotFoundError)
|
|
65
|
+
return { known: false };
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
if (!reading.country)
|
|
69
|
+
throw new IndeterminateError(PROVIDER, 'myDPD named no country for the newest scan');
|
|
70
|
+
if (reading.country !== 'AT')
|
|
71
|
+
return { known: false };
|
|
72
|
+
return recognizeFromLookup(() => Promise.resolve(reading.result));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export const adapter = (environment) => {
|
|
76
|
+
const tracker = new DpdAtTracker({ fetcher: environment.fetcher, recorder: environment.recorder, userAgent: environment.userAgent });
|
|
77
|
+
return {
|
|
78
|
+
id: 'dpd-at', recordsSteps: true, steps: ['direct'],
|
|
79
|
+
track: (input, context) => tracker.fetch(input.number, context),
|
|
80
|
+
recognize: (number, context) => tracker.recognize(number, context),
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -17,18 +17,60 @@
|
|
|
17
17
|
"timezone": "Europe/Vienna",
|
|
18
18
|
"tracking": {
|
|
19
19
|
"mode": "automatic",
|
|
20
|
-
"adapter": "
|
|
21
|
-
"steps": [
|
|
20
|
+
"adapter": "dpd-at",
|
|
21
|
+
"steps": [
|
|
22
|
+
"direct"
|
|
23
|
+
],
|
|
24
|
+
"recognition": {
|
|
25
|
+
"rank": 878
|
|
26
|
+
},
|
|
27
|
+
"localClocks": true
|
|
22
28
|
},
|
|
23
|
-
"capabilities": [
|
|
29
|
+
"capabilities": [
|
|
30
|
+
"history",
|
|
31
|
+
"location",
|
|
32
|
+
"provider_code",
|
|
33
|
+
"delivered_at"
|
|
34
|
+
],
|
|
24
35
|
"portal": {
|
|
25
36
|
"url": "https://www.mydpd.at/?f=parcel.load&p={trackingNumber}",
|
|
26
37
|
"searchUrl": "https://www.mydpd.at/",
|
|
27
38
|
"canaryUrl": "https://www.mydpd.at/",
|
|
28
|
-
"shows": [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
"shows": [
|
|
40
|
+
"status",
|
|
41
|
+
"history",
|
|
42
|
+
"location",
|
|
43
|
+
"delivered_at",
|
|
44
|
+
"sender_name",
|
|
45
|
+
"recipient_name",
|
|
46
|
+
"recipient_address",
|
|
47
|
+
"eta_window",
|
|
48
|
+
"pickup_point",
|
|
49
|
+
"signatory",
|
|
50
|
+
"delivery_instructions",
|
|
51
|
+
"delivery_options"
|
|
52
|
+
],
|
|
53
|
+
"scraped": [
|
|
54
|
+
"status",
|
|
55
|
+
"history",
|
|
56
|
+
"location",
|
|
57
|
+
"provider_code",
|
|
58
|
+
"delivered_at"
|
|
59
|
+
],
|
|
60
|
+
"discarded": [
|
|
61
|
+
"sender_name",
|
|
62
|
+
"recipient_name",
|
|
63
|
+
"recipient_address",
|
|
64
|
+
"eta_window",
|
|
65
|
+
"pickup_point",
|
|
66
|
+
"signatory",
|
|
67
|
+
"delivery_instructions",
|
|
68
|
+
"delivery_options"
|
|
69
|
+
],
|
|
70
|
+
"unavailable": [
|
|
71
|
+
"weight",
|
|
72
|
+
"offset_timestamps"
|
|
73
|
+
]
|
|
32
74
|
},
|
|
33
75
|
"links": [
|
|
34
76
|
{
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
"access": "indexed_excerpt"
|
|
183
183
|
},
|
|
184
184
|
"context": {
|
|
185
|
-
"assessment": "
|
|
185
|
+
"assessment": "confirmed"
|
|
186
186
|
},
|
|
187
187
|
"expect": {
|
|
188
188
|
"carrier": "unknown",
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
"dpd-uk"
|
|
204
204
|
]
|
|
205
205
|
},
|
|
206
|
-
"note": "Archived lookup on DPD Austria's myDPD tracker;
|
|
206
|
+
"note": "Archived lookup on DPD Austria's myDPD tracker; myDPD's lookup knows it, from DPD Austria's Leopoldsdorf depot to a delivery from its Obertrum depot."
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
209
|
"number": "06245146806199",
|
|
@@ -272,6 +272,39 @@
|
|
|
272
272
|
]
|
|
273
273
|
},
|
|
274
274
|
"note": "Archived lookup on DPD Austria's myDPD tracker, under the Sulz depot code; the capture was not opened and the history was not visible."
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"number": "01955023696290",
|
|
278
|
+
"role": "shipment",
|
|
279
|
+
"evidence": "public_shipment_report",
|
|
280
|
+
"source": {
|
|
281
|
+
"url": "https://web.archive.org/web/20260923101655/https://www.mydpd.at/meine-pakete?ipn=01955023696290",
|
|
282
|
+
"date": "2026-09-23",
|
|
283
|
+
"dateKind": "capture",
|
|
284
|
+
"access": "indexed_excerpt"
|
|
285
|
+
},
|
|
286
|
+
"context": {
|
|
287
|
+
"assessment": "confirmed"
|
|
288
|
+
},
|
|
289
|
+
"expect": {
|
|
290
|
+
"carrier": "unknown",
|
|
291
|
+
"confidence": "low",
|
|
292
|
+
"candidates": [
|
|
293
|
+
"dpd",
|
|
294
|
+
"dpd-fr",
|
|
295
|
+
"relais-colis",
|
|
296
|
+
"ciblex",
|
|
297
|
+
"seur",
|
|
298
|
+
"brt",
|
|
299
|
+
"delhivery",
|
|
300
|
+
"dhl-ecommerce-uk",
|
|
301
|
+
"dpd-be",
|
|
302
|
+
"dpd-de",
|
|
303
|
+
"dpd-nl",
|
|
304
|
+
"dpd-uk"
|
|
305
|
+
]
|
|
306
|
+
},
|
|
307
|
+
"note": "Archived lookup on DPD Austria's myDPD tracker, under a German depot's code; myDPD's lookup knows it, from German depots to a Pickup station of DPD Austria's Leobendorf depot."
|
|
275
308
|
}
|
|
276
309
|
]
|
|
277
310
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CarrierResult } from '../../core/result/index.js';
|
|
2
|
+
export declare const PROVIDER = "DPD Austria";
|
|
3
|
+
export declare const DPD_AT_MAX_BYTES: number;
|
|
4
|
+
/** The fourteen-digit parcel number myDPD takes, with or without DPD's check character; anything else is not one it issues. */
|
|
5
|
+
export declare function dpdAtNumber(raw: string): string;
|
|
6
|
+
/** What a myDPD reply says about the requested parcel, and the country of its newest scan when the reply shows it. */
|
|
7
|
+
export interface DpdAtReading {
|
|
8
|
+
result: CarrierResult;
|
|
9
|
+
country: string | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The reply of myDPD's `parcel/search` for one number. It answers
|
|
13
|
+
* `{"state":"failure"}` for a number it does not know, which the page reports
|
|
14
|
+
* as not found, unless the reply carries a message for the page to show. A
|
|
15
|
+
* parcel must name the number asked.
|
|
16
|
+
*/
|
|
17
|
+
export declare function readDpdAt(payload: unknown, raw: string): DpdAtReading;
|
|
18
|
+
export declare function parseDpdAt(payload: unknown, raw: string): CarrierResult;
|