universal-parcel-scraper 0.1306.3-main.8723 → 0.1306.7-main.8731
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/data/catalog.json +2 -1
- package/dist/browser/scraper.js +3 -2
- package/dist/carriers/ciblex/parser.js +9 -6
- package/dist/carriers/delhivery/parser.js +10 -6
- package/dist/carriers/dpd-ro/adapter.d.ts +11 -1
- package/dist/carriers/dpd-ro/adapter.js +54 -9
- package/dist/carriers/dpd-ro/carrier.json +3 -1
- package/dist/carriers/dpd-ro/parser.js +6 -0
- package/dist/core/status/language.js +1 -1
- package/dist/data/catalog.json +2 -1
- package/dist/generated/catalog.js +2 -1
- package/dist/server/openapi.json +1 -1
- package/package.json +1 -1
package/data/catalog.json
CHANGED
|
@@ -22239,7 +22239,8 @@
|
|
|
22239
22239
|
"mode": "automatic",
|
|
22240
22240
|
"adapter": "dpd-ro",
|
|
22241
22241
|
"recognitionRank": 934,
|
|
22242
|
-
"recognitionServedCountriesOnly": true
|
|
22242
|
+
"recognitionServedCountriesOnly": true,
|
|
22243
|
+
"browser": true
|
|
22243
22244
|
},
|
|
22244
22245
|
"canaryUrl": "https://www.dpd.com/ro/ro/",
|
|
22245
22246
|
"trackingUrlTemplate": "https://tracking.dpd.ro/?shipmentNumber={trackingNumber}",
|
package/dist/browser/scraper.js
CHANGED
|
@@ -17174,7 +17174,8 @@ var t = {
|
|
|
17174
17174
|
mode: "automatic",
|
|
17175
17175
|
adapter: "dpd-ro",
|
|
17176
17176
|
recognitionRank: 934,
|
|
17177
|
-
recognitionServedCountriesOnly: !0
|
|
17177
|
+
recognitionServedCountriesOnly: !0,
|
|
17178
|
+
browser: !0
|
|
17178
17179
|
},
|
|
17179
17180
|
canaryUrl: "https://www.dpd.com/ro/ro/",
|
|
17180
17181
|
trackingUrlTemplate: "https://tracking.dpd.ro/?shipmentNumber={trackingNumber}",
|
|
@@ -63811,7 +63812,7 @@ function xf(e) {
|
|
|
63811
63812
|
if (lf.test(t)) return /\b(?:if|unless|wenn|falls|si|qualora|caso)\b/.test(t) ? void 0 : /\b(?:yet|noch|encore|ancora|todavia|aun|ainda|jeszcze)\b/.test(t) ? uf.test(t) ? "registered" : new RegExp(nf).test(t) ? "ready_for_pickup" : void 0 : "exception";
|
|
63812
63813
|
if (/^picked up (?:at|from) (?:the )?destination airport$/.test(t) || /^(?:flight arrived, )?pallet (?:breakdown|deconsolidation) in progress\.?$/.test(t) || /^weighed at (?:the )?warehouse\.?$|^consolidation completed\.?$|^the warehouse changed the last mile vendor\b/.test(t) || /^(?:the |your )?parcel (?:has been |was )?sent to (?:the )?local [a-z][a-z&' ]{0,40} warehouse for delivery$/.test(t) || /^(?:the |your )?parcel (?:has been |was )?assigned to (?:a |the |your )?delivery driver$/.test(t)) return "in_transit";
|
|
63813
63814
|
if (/\bprise? en charge (?:de )?votre demande\b/.test(t)) return;
|
|
63814
|
-
if (/accepted|(?<!\b(?:be|being) )picked up|pick up was successful|^drop off$|pick ?up scan|prepared the package for return to ups or pickup by ups|handed (?:over )?to (?:dpd|gls)|despatched to couriers ?please\b|package received at dhl|item booked|consignment was mailed|posted at (?:a |the )?(?:postal point|post office)|pris en charge|prise en charge|collecte.*(?:reussi|effectue)|recupere.*boite aux lettres|depose.*point postal|remis a (?:dpd|gls)|envoi.*depose|abholung.*erfolgreich|^(?:die sendung wurde )?erfolgreich abgeholt$|eingeliefert|an (?:dpd|gls) ubergeben|paket.*(?:angenommen|ubernommen)|ritiro.*(?:riuscito|effettuato)|pres[oa] in carico|affidat[oa] a (?:dpd|gls)|depositat.*punto postale|spedizione.*impostata/.test(t) || /^到达收货点|^item received by royal mail$|\btaken over by one of our operators\b|\bwe've received your (?:parcel|package|item) at the parcel ?shop\b|^(?:(?:the |your )?(?:item|parcel|package|shipment) )?(?:was|has been) dropped off at (?:the |a )?parcel ?shop$|^(?![^,]*\b(?:recipient|consignee|receiver|customer|addressee|buyer|pick ?up point|parcel ?shop|locker|destination)\b)[a-z][\w&' -]{0,40} has received the goods(?:, [^,]{1,40}){0,2}\.?$|^the shipment has been deposited at a seur pickup point$|^(?:the |your )?collection (?:has been |was )?(?:carried out|completed)$|^已入库|^(?:(?:the |your )?(?:item|parcel|package|shipment) )?(?:has been |was )?put into storage$/.test(t) || /^(?:the )?(?:shipment|parcel|package|item) (?:has been|was) handed in (?:to|at) (?!.*\breturn)[^.;]{1,80}$/.test(t) || /^sender advised item dropped off at parcel locker$|^dropped off at postbox$/.test(t) || /^(?:the )?shipment has been taken over at the post (?:office|locker) point$/.test(t) || /^spedizione affidata a una fedex location\b/.test(t) || /^die sendung wurde vom absender (?:im|in der|in einem|in einer) (?:[\w-]+ )?(?:paketshop|parcelshop|filiale)\b(?!.*\bnicht\b).*\babgegeben$/.test(t) || /^(?:the |your )?(?:package|parcel|shipment) (?:was|has been) dropped off by the sender at (?:the |a )?(?:hermes )?(?:paketshop|parcel ?shop)\b/.test(t) || /^sending the (?:package|parcel) at the pick ?up point$|^handing over the (?:package|parcel) to the courier$/.test(t)) return "accepted";
|
|
63815
|
+
if (/accepted|(?<!\b(?:be|being) )picked up|pick up was successful|^drop off$|pick ?up scan|prepared the package for return to ups or pickup by ups|handed (?:over )?to (?:dpd|gls)|(?<!\b(?:be|being) )despatched to couriers ?please\b|package received at dhl|item booked|consignment was mailed|posted at (?:a |the )?(?:postal point|post office)|pris en charge|prise en charge|collecte.*(?:reussi|effectue)|recupere.*boite aux lettres|depose.*point postal|remis a (?:dpd|gls)|envoi.*depose|abholung.*erfolgreich|^(?:die sendung wurde )?erfolgreich abgeholt$|eingeliefert|an (?:dpd|gls) ubergeben|paket.*(?:angenommen|ubernommen)|ritiro.*(?:riuscito|effettuato)|pres[oa] in carico|affidat[oa] a (?:dpd|gls)|depositat.*punto postale|spedizione.*impostata/.test(t) || /^到达收货点|^item received by royal mail$|\btaken over by one of our operators\b|\bwe've received your (?:parcel|package|item) at the parcel ?shop\b|^(?:(?:the |your )?(?:item|parcel|package|shipment) )?(?:was|has been) dropped off at (?:the |a )?parcel ?shop$|^(?![^,]*\b(?:recipient|consignee|receiver|customer|addressee|buyer|pick ?up point|parcel ?shop|locker|destination)\b)[a-z][\w&' -]{0,40} has received the goods(?:, [^,]{1,40}){0,2}\.?$|^the shipment has been deposited at a seur pickup point$|^(?:the |your )?collection (?:has been |was )?(?:carried out|completed)$|^已入库|^(?:(?:the |your )?(?:item|parcel|package|shipment) )?(?:has been |was )?put into storage$/.test(t) || /^(?:the )?(?:shipment|parcel|package|item) (?:has been|was) handed in (?:to|at) (?!.*\breturn)[^.;]{1,80}$/.test(t) || /^sender advised item dropped off at parcel locker$|^dropped off at postbox$/.test(t) || /^(?:the )?shipment has been taken over at the post (?:office|locker) point$/.test(t) || /^spedizione affidata a una fedex location\b/.test(t) || /^die sendung wurde vom absender (?:im|in der|in einem|in einer) (?:[\w-]+ )?(?:paketshop|parcelshop|filiale)\b(?!.*\bnicht\b).*\babgegeben$/.test(t) || /^(?:the |your )?(?:package|parcel|shipment) (?:was|has been) dropped off by the sender at (?:the |a )?(?:hermes )?(?:paketshop|parcel ?shop)\b/.test(t) || /^sending the (?:package|parcel) at the pick ?up point$|^handing over the (?:package|parcel) to the courier$/.test(t)) return "accepted";
|
|
63815
63816
|
if (/^warehouse reading$/.test(t) || /^acceptance of the (?:package|parcel) at the delivery branch abroad$/.test(t)) return "in_transit";
|
|
63816
63817
|
if (/^acceptance of the (?:package|parcel) at the pick ?up point$/.test(t) || /^(?:(?:the )?item )?(?:arrival|arrived|receive item) at (?:the )?collection point (?:for pick ?up|waiting for (?:your |the )?collect(?:ion)?)\b/.test(t)) return "ready_for_pickup";
|
|
63817
63818
|
if (/^(?:inward|outward) mc (?:[a-z]+ )?acceptance$/.test(t)) return "in_transit";
|
|
@@ -62,15 +62,18 @@ export function parseCiblexTrackingHtml(html, raw) {
|
|
|
62
62
|
const identity = /^SUIVI\s+COLIS\s*:\s*(\d{14}|\d{24})(?:\s*\([^()\r\n]{1,160}\))*$/i.exec(banners[0]);
|
|
63
63
|
if (!identity || identity[1] !== number)
|
|
64
64
|
throw new SchemaError('Ciblex', 'Ciblex returned a different shipment');
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
// The history is the bordered table under its four columns. A shipment's page can also frame its sender and
|
|
66
|
+
// recipient in a bordered table ("Expéditeur", "Destinataire"), which is not read.
|
|
67
|
+
const bordered = $('table[border="2"]').toArray();
|
|
68
|
+
const histories = bordered.filter(table => $(table).find('tr').first().children('td, th')
|
|
69
|
+
.map((_, node) => comparableText($(node).text())).get().join('|') === 'date|heure livraison|action|lieu');
|
|
70
|
+
if (histories.length > 1)
|
|
67
71
|
throw new SchemaError('Ciblex', 'Ciblex returned ambiguous tracking history');
|
|
68
|
-
|
|
72
|
+
if (!histories.length)
|
|
73
|
+
throw new SchemaError('Ciblex', bordered.length ? 'Ciblex tracking columns changed' : 'Ciblex returned no tracking table');
|
|
74
|
+
const rows = $(histories[0]).find('tr');
|
|
69
75
|
if (rows.length > 501)
|
|
70
76
|
throw new SchemaError('Ciblex', 'Ciblex returned excessive tracking history');
|
|
71
|
-
const header = rows.first().children('td, th').map((_, node) => comparableText($(node).text())).get();
|
|
72
|
-
if (header.join('|') !== 'date|heure livraison|action|lieu')
|
|
73
|
-
throw new SchemaError('Ciblex', 'Ciblex tracking columns changed');
|
|
74
77
|
// The page Ciblex shows for any number it has no scans for, a label not yet
|
|
75
78
|
// scanned or one it never issued: an answer about the number, not an outage.
|
|
76
79
|
if (rows.length === 1)
|
|
@@ -87,14 +87,18 @@ export function parseDelhivery(payload, number) {
|
|
|
87
87
|
// milestone can have none), so the milestone becomes an event of its own.
|
|
88
88
|
const milestone = clean(state.label, 200);
|
|
89
89
|
const milestoneText = clean(state.date, 64);
|
|
90
|
-
|
|
90
|
+
const milestoneAt = milestone && milestoneText ? milestoneTime(milestoneText, updated) : null;
|
|
91
|
+
const status = milestone ? classifyDelhiveryStatus(milestone) : undefined;
|
|
92
|
+
// A missed delivery takes the index back from "Out for Delivery" to "On the Way". The milestone it
|
|
93
|
+
// leaves past the index keeps a date no later than the status: reached, unlike the rail's. A
|
|
94
|
+
// delivered one is never read so.
|
|
95
|
+
const left = index > reached && milestoneAt !== null && status?.stage !== 'delivered';
|
|
96
|
+
if ((index <= reached || left) && milestone && milestoneText
|
|
91
97
|
&& !scans.some(scan => isRecord(scan) && clean(scan.scanDateTime, 64))) {
|
|
92
|
-
const time = milestoneTime(milestoneText, updated);
|
|
93
|
-
const status = classifyDelhiveryStatus(milestone);
|
|
94
98
|
const classified = item.currentFlow === 'Reverse' && status?.stage === 'delivered' ? classifyDelhiveryStatus('RTO DELIVERED') : status;
|
|
95
|
-
if (classified?.stage === 'delivered' &&
|
|
96
|
-
deliveredAt =
|
|
97
|
-
events.push({ description: milestone, ...(
|
|
99
|
+
if (classified?.stage === 'delivered' && milestoneAt && (!deliveredAt || milestoneAt.timestamp > deliveredAt.timestamp))
|
|
100
|
+
deliveredAt = milestoneAt;
|
|
101
|
+
events.push({ description: milestone, ...(milestoneAt ? { time: milestoneAt.iso } : { provider_time_text: milestoneText }),
|
|
98
102
|
...(classified ? { stage: classified.stage } : {}), ...(item.currentFlow === 'Reverse' ? { provider_leg: 'return' } : {}) });
|
|
99
103
|
}
|
|
100
104
|
if (state.scans === undefined || state.scans === null)
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { type AdapterFactory, type TrackingContext } from '../../core/adapter/index.js';
|
|
2
|
+
import type { CarrierResult } from '../../core/result/index.js';
|
|
2
3
|
import { type StepRecorder } from '../../core/telemetry/index.js';
|
|
4
|
+
import { type TrawlClient, type TrawlScrapeResponse } from '../../core/transport/trawl.js';
|
|
3
5
|
export declare const DPD_RO_ENDPOINT = "https://mydpd.dpd.ro/rest/public/track";
|
|
6
|
+
/** MyDPD's public tracker for the waybill, in English. */
|
|
7
|
+
export declare const dpdRoTrackingUrl: (raw: string) => string;
|
|
8
|
+
/** The request that page sends once its Turnstile check passes. */
|
|
9
|
+
export declare const dpdRoPageRequest: (raw: string) => string;
|
|
10
|
+
/** The tracker page's own reply for the whole waybill, read as the endpoint's. */
|
|
11
|
+
export declare function parseDpdRoPage(page: TrawlScrapeResponse, number: string): CarrierResult;
|
|
4
12
|
export declare class DpdRoTracker {
|
|
13
|
+
#private;
|
|
5
14
|
private readonly options;
|
|
6
15
|
constructor(options?: {
|
|
7
16
|
fetcher?: typeof fetch;
|
|
8
17
|
recorder?: StepRecorder;
|
|
9
18
|
userAgent?: string;
|
|
19
|
+
trawl?: TrawlClient | null;
|
|
10
20
|
});
|
|
11
|
-
fetch(raw: string, context?: TrackingContext): Promise<
|
|
21
|
+
fetch(raw: string, context?: TrackingContext): Promise<CarrierResult>;
|
|
12
22
|
}
|
|
13
23
|
export declare const adapter: AdapterFactory;
|
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
import { accepted, recognizeFromLookup } from '../../core/adapter/index.js';
|
|
2
|
+
import { BudgetExceededError, carrierErrorKind, ChallengeError, RateLimitedError, SchemaError, TransportError, UpstreamHttpError, } from '../../core/errors/index.js';
|
|
2
3
|
import { runSteps } from '../../core/runner/index.js';
|
|
3
4
|
import { NOOP_RECORDER } from '../../core/telemetry/index.js';
|
|
4
5
|
import { decodeText, fetchBounded, userAgentOf } from '../../core/transport/index.js';
|
|
6
|
+
import { retryAfterMs } from '../../core/transport/retryAfter.js';
|
|
7
|
+
import { TRAWL_TRANSPORT_ALLOWANCE_MS } from '../../core/transport/trawl.js';
|
|
5
8
|
import { DPD_RO_MAX_BYTES, normalizeDpdRoNumber, parseDpdRoReply, PROVIDER } from './parser.js';
|
|
6
9
|
// The endpoint MyDPD's public tracker reads a shipment from; the DPD app ships
|
|
7
|
-
// the same path.
|
|
8
|
-
// Turnstile check
|
|
10
|
+
// the same path. It answers only a request carrying the token of the page's
|
|
11
|
+
// Turnstile check. tracking.dpd.ro sits behind a Cloudflare challenge as well.
|
|
9
12
|
export const DPD_RO_ENDPOINT = 'https://mydpd.dpd.ro/rest/public/track';
|
|
13
|
+
/** MyDPD's public tracker for the waybill, in English. */
|
|
14
|
+
export const dpdRoTrackingUrl = (raw) => `https://mydpd.dpd.ro/pub/tracking/${normalizeDpdRoNumber(raw)}?language=en`;
|
|
15
|
+
/** The request that page sends once its Turnstile check passes. */
|
|
16
|
+
export const dpdRoPageRequest = (raw) => `${DPD_RO_ENDPOINT}?id=${normalizeDpdRoNumber(raw)}&language=en&mobile=N`;
|
|
17
|
+
/** The tracker page's own reply for the whole waybill, read as the endpoint's. */
|
|
18
|
+
export function parseDpdRoPage(page, number) {
|
|
19
|
+
if (![2, 3].includes(page.tier) || page.statusCode !== 200)
|
|
20
|
+
throw new TransportError(PROVIDER, 'The browser service did not load MyDPD\'s tracker');
|
|
21
|
+
const captures = page.capturedResponses.filter((capture) => capture.url === dpdRoPageRequest(number));
|
|
22
|
+
if (!captures.length)
|
|
23
|
+
throw new ChallengeError(PROVIDER, 'MyDPD\'s tracker sent no tracking request; its Turnstile check did not pass');
|
|
24
|
+
if (captures.length > 10)
|
|
25
|
+
throw new SchemaError(PROVIDER, 'DPD Romania returned too many tracking responses');
|
|
26
|
+
const capture = captures[captures.length - 1];
|
|
27
|
+
if (capture.status === 429)
|
|
28
|
+
throw new RateLimitedError(PROVIDER, retryAfterMs(capture.headers['retry-after'], { dates: false }));
|
|
29
|
+
if ([401, 403, 406].includes(capture.status))
|
|
30
|
+
throw new ChallengeError(PROVIDER, 'DPD Romania refused its Turnstile check', { status: capture.status });
|
|
31
|
+
if (capture.status !== 200 && capture.status !== 404)
|
|
32
|
+
throw new UpstreamHttpError(PROVIDER, capture.status);
|
|
33
|
+
if (capture.error || capture.truncated || capture.base64Encoded || capture.body === null) {
|
|
34
|
+
throw new TransportError(PROVIDER, 'DPD Romania returned an incomplete tracking response');
|
|
35
|
+
}
|
|
36
|
+
return parseDpdRoReply(capture.status, capture.body, number);
|
|
37
|
+
}
|
|
10
38
|
export class DpdRoTracker {
|
|
11
39
|
options;
|
|
12
40
|
constructor(options = {}) {
|
|
@@ -14,20 +42,37 @@ export class DpdRoTracker {
|
|
|
14
42
|
}
|
|
15
43
|
async fetch(raw, context = {}) {
|
|
16
44
|
const number = normalizeDpdRoNumber(raw);
|
|
17
|
-
|
|
45
|
+
const trawl = this.options.trawl ?? null;
|
|
46
|
+
return runSteps({ carrier: 'dpd-ro', budgetMs: context.budgetMs ?? (trawl ? 60_000 : 15_000), signal: context.signal,
|
|
18
47
|
recorder: this.options.recorder ?? NOOP_RECORDER }, [{ id: 'direct', run: async ({ signal, remainingMs }) => {
|
|
19
48
|
signal.throwIfAborted();
|
|
20
49
|
const { response, bytes } = await fetchBounded(`${DPD_RO_ENDPOINT}?${new URLSearchParams({ id: number, language: 'en' })}`, { signal,
|
|
21
50
|
headers: { Accept: 'application/json', 'User-Agent': userAgentOf(this.options.userAgent) } }, {
|
|
22
|
-
provider: PROVIDER, timeoutMs: Math.max(1, Math.floor(remainingMs)), maxBytes: DPD_RO_MAX_BYTES,
|
|
23
|
-
allowHttpStatuses: [404], fetcher: this.options.fetcher,
|
|
51
|
+
provider: PROVIDER, timeoutMs: Math.max(1, Math.floor(trawl ? Math.min(10_000, remainingMs) : remainingMs)), maxBytes: DPD_RO_MAX_BYTES,
|
|
52
|
+
allowHttpStatuses: [404, 406], fetcher: this.options.fetcher,
|
|
24
53
|
});
|
|
25
54
|
return parseDpdRoReply(response.status, decodeText(bytes), number);
|
|
26
|
-
} }]);
|
|
55
|
+
} }, { ...this.#page(number, trawl), recovers: (error) => carrierErrorKind(error) === 'challenge' }]);
|
|
56
|
+
}
|
|
57
|
+
#page(number, trawl) {
|
|
58
|
+
return { id: 'trawl', enabled: Boolean(trawl), run: async ({ signal, remainingMs }) => {
|
|
59
|
+
const timeoutMs = Math.floor(Math.min(45_000, remainingMs - TRAWL_TRANSPORT_ALLOWANCE_MS));
|
|
60
|
+
if (timeoutMs < 1)
|
|
61
|
+
throw new BudgetExceededError(PROVIDER, remainingMs);
|
|
62
|
+
// The page gets its own Turnstile token and asks for the waybill in its route; the token stays in the browser.
|
|
63
|
+
const page = await trawl.scrape({ url: dpdRoTrackingUrl(number), skipHttp: true, maxTier: 3, maxTimeout: timeoutMs,
|
|
64
|
+
captureResponses: [DPD_RO_ENDPOINT], settleTimeout: Math.min(timeoutMs, 20_000),
|
|
65
|
+
}, { provider: 'TRAWL while fetching DPD Romania', timeoutMs, signal, maxBytes: 6_000_000, requireSolved: false });
|
|
66
|
+
signal.throwIfAborted();
|
|
67
|
+
return parseDpdRoPage(page, number);
|
|
68
|
+
} };
|
|
27
69
|
}
|
|
28
70
|
}
|
|
29
71
|
export const adapter = environment => {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
72
|
+
const options = { fetcher: environment.fetcher, recorder: environment.recorder, userAgent: environment.userAgent };
|
|
73
|
+
const tracker = new DpdRoTracker({ ...options, trawl: environment.trawl });
|
|
74
|
+
// Recognition stays on HTTP.
|
|
75
|
+
const http = new DpdRoTracker(options);
|
|
76
|
+
return { id: 'dpd-ro', recordsSteps: true, steps: ['direct', 'trawl'], track: (input, context) => tracker.fetch(input.number, context),
|
|
77
|
+
recognize: (number, context) => recognizeFromLookup(() => http.fetch(number, context), () => accepted(() => normalizeDpdRoNumber(number))) };
|
|
33
78
|
};
|
|
@@ -37,6 +37,9 @@ export function parseDpdRoReply(status, body, rawNumber) {
|
|
|
37
37
|
throw new NotFoundError(PROVIDER);
|
|
38
38
|
throw new TransportError(PROVIDER, 'DPD Romania tracking endpoint is unavailable');
|
|
39
39
|
}
|
|
40
|
+
// A token the Turnstile check did not issue.
|
|
41
|
+
if (status === 406)
|
|
42
|
+
throw new ChallengeError(PROVIDER, 'DPD Romania refused its Turnstile check', { status });
|
|
40
43
|
let payload;
|
|
41
44
|
try {
|
|
42
45
|
payload = JSON.parse(body.replace(/^\uFEFF/, ''));
|
|
@@ -46,6 +49,9 @@ export function parseDpdRoReply(status, body, rawNumber) {
|
|
|
46
49
|
throw new ChallengeError(PROVIDER, 'DPD Romania answered with a browser challenge', { cause });
|
|
47
50
|
throw new SchemaError(PROVIDER, 'DPD Romania returned invalid tracking JSON', { cause });
|
|
48
51
|
}
|
|
52
|
+
// Without a Turnstile token the endpoint answers every waybill with an empty object.
|
|
53
|
+
if (isRecord(payload) && Object.keys(payload).length === 0)
|
|
54
|
+
throw new ChallengeError(PROVIDER, 'DPD Romania answers only its tracker page once its Turnstile check passes');
|
|
49
55
|
return parseDpdRo(payload, rawNumber);
|
|
50
56
|
}
|
|
51
57
|
/** The "Expected Delivery Date: DD.MM.YYYY" note on a scan, as an ISO day. Other notes are dropped. */
|
|
@@ -1065,7 +1065,7 @@ export function trackingLanguageStage(description) {
|
|
|
1065
1065
|
// A pickup still to come ("will be picked up") is not one either.
|
|
1066
1066
|
// A sender's despatch to Couriers Please, as ParcelsApp relays it hours before Couriers Please's first facility scan, is
|
|
1067
1067
|
// its hand-over to that carrier, as one to DPD or GLS is.
|
|
1068
|
-
if (/accepted|(?<!\b(?:be|being) )picked up|pick up was successful|^drop off$|pick ?up scan|prepared the package for return to ups or pickup by ups|handed (?:over )?to (?:dpd|gls)|despatched to couriers ?please\b|package received at dhl|item booked|consignment was mailed|posted at (?:a |the )?(?:postal point|post office)|pris en charge|prise en charge|collecte.*(?:reussi|effectue)|recupere.*boite aux lettres|depose.*point postal|remis a (?:dpd|gls)|envoi.*depose|abholung.*erfolgreich|^(?:die sendung wurde )?erfolgreich abgeholt$|eingeliefert|an (?:dpd|gls) ubergeben|paket.*(?:angenommen|ubernommen)|ritiro.*(?:riuscito|effettuato)|pres[oa] in carico|affidat[oa] a (?:dpd|gls)|depositat.*punto postale|spedizione.*impostata/.test(text))
|
|
1068
|
+
if (/accepted|(?<!\b(?:be|being) )picked up|pick up was successful|^drop off$|pick ?up scan|prepared the package for return to ups or pickup by ups|handed (?:over )?to (?:dpd|gls)|(?<!\b(?:be|being) )despatched to couriers ?please\b|package received at dhl|item booked|consignment was mailed|posted at (?:a |the )?(?:postal point|post office)|pris en charge|prise en charge|collecte.*(?:reussi|effectue)|recupere.*boite aux lettres|depose.*point postal|remis a (?:dpd|gls)|envoi.*depose|abholung.*erfolgreich|^(?:die sendung wurde )?erfolgreich abgeholt$|eingeliefert|an (?:dpd|gls) ubergeben|paket.*(?:angenommen|ubernommen)|ritiro.*(?:riuscito|effettuato)|pres[oa] in carico|affidat[oa] a (?:dpd|gls)|depositat.*punto postale|spedizione.*impostata/.test(text))
|
|
1069
1069
|
return 'accepted';
|
|
1070
1070
|
// Taken in by the carrier: Royal Mail's "Item received by Royal Mail", a parcel shop's or a warehouse's
|
|
1071
1071
|
// receipt, a forwarder's ("<company> has received the goods, <town>, <country>."), the sender's drop-off at a
|
package/dist/data/catalog.json
CHANGED
|
@@ -22239,7 +22239,8 @@
|
|
|
22239
22239
|
"mode": "automatic",
|
|
22240
22240
|
"adapter": "dpd-ro",
|
|
22241
22241
|
"recognitionRank": 934,
|
|
22242
|
-
"recognitionServedCountriesOnly": true
|
|
22242
|
+
"recognitionServedCountriesOnly": true,
|
|
22243
|
+
"browser": true
|
|
22243
22244
|
},
|
|
22244
22245
|
"canaryUrl": "https://www.dpd.com/ro/ro/",
|
|
22245
22246
|
"trackingUrlTemplate": "https://tracking.dpd.ro/?shipmentNumber={trackingNumber}",
|
|
@@ -22240,7 +22240,8 @@ export const CARRIER_CATALOG = {
|
|
|
22240
22240
|
"mode": "automatic",
|
|
22241
22241
|
"adapter": "dpd-ro",
|
|
22242
22242
|
"recognitionRank": 934,
|
|
22243
|
-
"recognitionServedCountriesOnly": true
|
|
22243
|
+
"recognitionServedCountriesOnly": true,
|
|
22244
|
+
"browser": true
|
|
22244
22245
|
},
|
|
22245
22246
|
"canaryUrl": "https://www.dpd.com/ro/ro/",
|
|
22246
22247
|
"trackingUrlTemplate": "https://tracking.dpd.ro/?shipmentNumber={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.1306.
|
|
3
|
+
"version": "0.1306.7-main.8731",
|
|
4
4
|
"description": "Self-hosted parcel tracking: carrier detection, dedicated scrapers and optional universal providers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "PolyForm-Noncommercial-1.0.0",
|