universal-parcel-scraper 0.91.0-main.981 → 0.91.1-main.983
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/detection-golden.json +6 -0
- package/dist/carriers/allegro-one/adapter.d.ts +1 -1
- package/dist/carriers/allegro-one/adapter.js +3 -2
- package/dist/carriers/allegro-one/numbers.json +19 -0
- package/dist/carriers/allegro-one/parser.d.ts +1 -1
- package/dist/carriers/allegro-one/parser.js +6 -4
- package/dist/carriers/allegro-one/status.js +1 -0
- package/dist/carriers/allegro-one/statuses.json +1 -0
- package/dist/server/openapi.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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 4,
|
|
158
|
+
The carrier folders record 4,084 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.
|
|
@@ -24879,6 +24879,12 @@
|
|
|
24879
24879
|
"asendia"
|
|
24880
24880
|
]
|
|
24881
24881
|
},
|
|
24882
|
+
{
|
|
24883
|
+
"input": "ALE000021875620",
|
|
24884
|
+
"carrier": "unknown",
|
|
24885
|
+
"confidence": "none",
|
|
24886
|
+
"candidates": []
|
|
24887
|
+
},
|
|
24882
24888
|
{
|
|
24883
24889
|
"input": "AM363452-4",
|
|
24884
24890
|
"carrier": "unknown",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AdapterFactory, type TrackingContext } from '../../core/adapter/index.js';
|
|
2
2
|
import type { CarrierResult } from '../../core/result/index.js';
|
|
3
3
|
import { type StepRecorder } from '../../core/telemetry/index.js';
|
|
4
|
-
export declare const ALLEGRO_ONE_ENDPOINT = "https://edge.allegro.pl/
|
|
4
|
+
export declare const ALLEGRO_ONE_ENDPOINT = "https://edge.allegro.pl/ad/tracking";
|
|
5
5
|
export declare function allegroOneTrackingUrl(raw: string): string;
|
|
6
6
|
export declare class AllegroOneTracker {
|
|
7
7
|
private readonly options;
|
|
@@ -5,8 +5,9 @@ import { firstAttemptMs, networkRetryStep } from '../../core/runner/networkRetry
|
|
|
5
5
|
import { NOOP_RECORDER } from '../../core/telemetry/index.js';
|
|
6
6
|
import { decodeText, fetchBounded, userAgentOf } from '../../core/transport/index.js';
|
|
7
7
|
import { ALLEGRO_ONE_MAX_BYTES, normalizeAllegroOneNumber, parseAllegroOne, PROVIDER } from './parser.js';
|
|
8
|
-
// The service Allegro
|
|
9
|
-
|
|
8
|
+
// The service the Allegro Delivery tracking page asks through its edge gateway.
|
|
9
|
+
// `/one/tracking`, which the older Allegro One page asked, leaves out sorting-centre scans.
|
|
10
|
+
export const ALLEGRO_ONE_ENDPOINT = 'https://edge.allegro.pl/ad/tracking';
|
|
10
11
|
// The gateway answers only the media type Allegro's own pages ask for.
|
|
11
12
|
const MEDIA_TYPE = 'application/vnd.allegro.internal.v1+json';
|
|
12
13
|
const REDIRECTS = [301, 302, 303, 307, 308];
|
|
@@ -190,6 +190,25 @@
|
|
|
190
190
|
"confidence": "high"
|
|
191
191
|
},
|
|
192
192
|
"note": "A buyer on Allegro's community forum gives it as the parcel number of an Allegro Delivery parcel for an ORLEN Paczka locker."
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"number": "ALE000021875620",
|
|
196
|
+
"role": "shipment",
|
|
197
|
+
"evidence": "public_shipment_report",
|
|
198
|
+
"source": {
|
|
199
|
+
"url": "https://spolecznosc.allegro.pl/t5/allegro-one-dla-kupuj%C4%85cych/jak-sprawdzi%C4%87-numer-ups-dla-przesy%C5%82ek-allegro-one/m-p/441116",
|
|
200
|
+
"date": "2022-07-25",
|
|
201
|
+
"dateKind": "comment",
|
|
202
|
+
"access": "full_page"
|
|
203
|
+
},
|
|
204
|
+
"context": {
|
|
205
|
+
"assessment": "confirmed"
|
|
206
|
+
},
|
|
207
|
+
"expect": {
|
|
208
|
+
"carrier": "unknown",
|
|
209
|
+
"confidence": "none"
|
|
210
|
+
},
|
|
211
|
+
"note": "A buyer on Allegro's community forum gives it as an Allegro One parcel and asks for its UPS number. Allegro One's tracker returns its history; no rule claims the older ALE form."
|
|
193
212
|
}
|
|
194
213
|
]
|
|
195
214
|
}
|
|
@@ -4,7 +4,7 @@ export declare const ALLEGRO_ONE_MAX_BYTES: number;
|
|
|
4
4
|
/** An Allegro One number; anything else is a number Allegro One does not issue. */
|
|
5
5
|
export declare function normalizeAllegroOneNumber(raw: string): string;
|
|
6
6
|
/**
|
|
7
|
-
* The reply of `GET /
|
|
7
|
+
* The reply of `GET /ad/tracking?packageNo={number}` on Allegro's edge
|
|
8
8
|
* gateway: `{ "status": [...] }`, each scan a UTC instant and a wording. It
|
|
9
9
|
* does not echo the number: the scans are those of the number in the request.
|
|
10
10
|
* An empty or null list is what the tracker shows as "not found". Every A0
|
|
@@ -39,7 +39,7 @@ function projectScan(row, index) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
|
-
* The reply of `GET /
|
|
42
|
+
* The reply of `GET /ad/tracking?packageNo={number}` on Allegro's edge
|
|
43
43
|
* gateway: `{ "status": [...] }`, each scan a UTC instant and a wording. It
|
|
44
44
|
* does not echo the number: the scans are those of the number in the request.
|
|
45
45
|
* An empty or null list is what the tracker shows as "not found". Every A0
|
|
@@ -70,9 +70,11 @@ export function parseAllegroOne(payload, raw) {
|
|
|
70
70
|
seen.add(key);
|
|
71
71
|
scans.push(scan);
|
|
72
72
|
});
|
|
73
|
-
// The reply lists scans newest first and
|
|
74
|
-
//
|
|
75
|
-
|
|
73
|
+
// The reply lists an older parcel's scans newest first and a newer one's
|
|
74
|
+
// oldest first; the tracker shows them newest first. Instants order them,
|
|
75
|
+
// and equal ones keep the order in which the reply logged them.
|
|
76
|
+
const oldestFirst = scans.length > 1 && scans[0].at < scans.at(-1).at;
|
|
77
|
+
scans.sort((left, right) => right.at - left.at || (oldestFirst ? right.index - left.index : left.index - right.index));
|
|
76
78
|
const newest = scans[0].event;
|
|
77
79
|
const current = newest.stage
|
|
78
80
|
? { stage: newest.stage, source: 'carrier_map' }
|
|
@@ -17,6 +17,7 @@ export const ALLEGRO_ONE_SCANS = {
|
|
|
17
17
|
'Courier has transferred the parcel to the warehouse': 'in_transit',
|
|
18
18
|
'Parcel has been dispatched to its destination point': 'in_transit',
|
|
19
19
|
'Parcel has been accepted at the sorting center': 'in_transit',
|
|
20
|
+
'Dispatched from sorting center': 'in_transit',
|
|
20
21
|
'Parcel has been accepted at the branch': 'in_transit',
|
|
21
22
|
'Parcel has been redirected to a different point': 'in_transit',
|
|
22
23
|
// Notices while the parcel is on its way; neither stops it.
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
{"wording": "Courier has transferred the parcel to the warehouse", "language": "en", "stage": "in_transit", "confirmedBy": "live"},
|
|
11
11
|
{"wording": "Parcel has been dispatched to its destination point", "language": "en", "stage": "in_transit", "confirmedBy": "live", "note": "The parcel left for the locker, point or branch serving the recipient."},
|
|
12
12
|
{"wording": "Parcel has been accepted at the sorting center", "language": "en", "stage": "in_transit", "confirmedBy": "live"},
|
|
13
|
+
{"wording": "Dispatched from sorting center", "language": "en", "stage": "in_transit", "confirmedBy": "live", "note": "Listed by /ad/tracking; /one/tracking leaves it out."},
|
|
13
14
|
{"wording": "Parcel has been accepted at the branch", "language": "en", "stage": "in_transit", "confirmedBy": "live"},
|
|
14
15
|
{"wording": "Parcel has been redirected to a different point", "language": "en", "stage": "in_transit", "confirmedBy": "live", "note": "Follows the recipient's choice of another point."},
|
|
15
16
|
{"wording": "Parcel may be delivered with delay", "language": "en", "stage": "in_transit", "confirmedBy": "live", "note": "A notice; the parcel keeps moving."},
|
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.91.
|
|
3
|
+
"version": "0.91.1-main.983",
|
|
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",
|