universal-parcel-scraper 0.69.4-main.892 → 0.69.6-main.895

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 CHANGED
@@ -1775,6 +1775,19 @@
1775
1775
  "matchParcelNumber"
1776
1776
  ]
1777
1777
  },
1778
+ {
1779
+ "domains": [
1780
+ "gls-group.eu",
1781
+ "gls-group.com"
1782
+ ],
1783
+ "pathPattern": "^/GROUP/",
1784
+ "params": [
1785
+ "match",
1786
+ "parcelNumber",
1787
+ "matchParcelNumber"
1788
+ ],
1789
+ "detectFromNumber": true
1790
+ },
1778
1791
  {
1779
1792
  "domains": [
1780
1793
  "gls-pakete.de"
@@ -1533,18 +1533,31 @@ var ye = {
1533
1533
  canaryUrl: "https://gls-group.eu/EU/en/parcel-tracking",
1534
1534
  trackingUrlTemplate: "https://gls-group.eu/EU/en/parcel-tracking?match={trackingNumber}",
1535
1535
  trackingSearchUrl: "https://gls-group.eu/EU/en/parcel-tracking",
1536
- linkRules: [{
1537
- domains: ["gls-group.eu", "gls-group.com"],
1538
- pathPattern: "^/(?:DE|EU)/",
1539
- params: [
1540
- "match",
1541
- "parcelNumber",
1542
- "matchParcelNumber"
1543
- ]
1544
- }, {
1545
- domains: ["gls-pakete.de"],
1546
- params: ["match", "trackingNumber"]
1547
- }],
1536
+ linkRules: [
1537
+ {
1538
+ domains: ["gls-group.eu", "gls-group.com"],
1539
+ pathPattern: "^/(?:DE|EU)/",
1540
+ params: [
1541
+ "match",
1542
+ "parcelNumber",
1543
+ "matchParcelNumber"
1544
+ ]
1545
+ },
1546
+ {
1547
+ domains: ["gls-group.eu", "gls-group.com"],
1548
+ pathPattern: "^/GROUP/",
1549
+ params: [
1550
+ "match",
1551
+ "parcelNumber",
1552
+ "matchParcelNumber"
1553
+ ],
1554
+ detectFromNumber: !0
1555
+ },
1556
+ {
1557
+ domains: ["gls-pakete.de"],
1558
+ params: ["match", "trackingNumber"]
1559
+ }
1560
+ ],
1548
1561
  detectionRules: [
1549
1562
  {
1550
1563
  pattern: "^(?:(?=[A-Z0-9]{8}$)(?=.*[A-Z])(?=.*\\d)[A-Z0-9]{8}|\\d{11})$",
@@ -100,6 +100,19 @@
100
100
  "matchParcelNumber"
101
101
  ]
102
102
  },
103
+ {
104
+ "domains": [
105
+ "gls-group.eu",
106
+ "gls-group.com"
107
+ ],
108
+ "pathPattern": "^/GROUP/",
109
+ "params": [
110
+ "match",
111
+ "parcelNumber",
112
+ "matchParcelNumber"
113
+ ],
114
+ "detectFromNumber": true
115
+ },
103
116
  {
104
117
  "domains": [
105
118
  "gls-pakete.de"
@@ -138,6 +138,11 @@ export function parseUSPSTrackingHtml(page, trackingNumber) {
138
138
  const $ = load(page);
139
139
  $('script, style, noscript').remove();
140
140
  if ($('.track-bar-container').length === 0) {
141
+ // A completed USPS header without the tracking application is not a
142
+ // missing shipment. A second browser read can recover this partial page.
143
+ if ($('.Widgets_Container #g-navigation').length && /^USPS Tracking/.test($('title').text())) {
144
+ throw new ChallengeError('USPS', 'USPS returned an incomplete tracking page', { reason: 'incomplete_page' });
145
+ }
141
146
  throw new ChallengeError('USPS', 'USPS challenged the browser tracking session');
142
147
  }
143
148
  const echoed = clean($('#trackingNum').first().text()).toLocaleUpperCase('en-US');
@@ -225,6 +230,8 @@ export class USPSTracker {
225
230
  recorder: this.#recorder,
226
231
  }, [
227
232
  { id: 'trawl', run: ({ remainingMs, signal }) => this.#trawlResult(trawl, number, Math.max(1, Math.floor(Math.min(this.timeoutMs, remainingMs))), signal) },
233
+ { id: 'trawl', recovers: error => error instanceof ChallengeError && error.reason === 'incomplete_page',
234
+ run: ({ remainingMs, signal }) => this.#trawlResult(trawl, number, Math.max(1, Math.floor(Math.min(this.timeoutMs, remainingMs))), signal) },
228
235
  ]);
229
236
  // A typed routing barcode opens with the recipient's ZIP code. The package
230
237
  // identifier after it is the number USPS tracks, so consumers can keep that.
@@ -1775,6 +1775,19 @@
1775
1775
  "matchParcelNumber"
1776
1776
  ]
1777
1777
  },
1778
+ {
1779
+ "domains": [
1780
+ "gls-group.eu",
1781
+ "gls-group.com"
1782
+ ],
1783
+ "pathPattern": "^/GROUP/",
1784
+ "params": [
1785
+ "match",
1786
+ "parcelNumber",
1787
+ "matchParcelNumber"
1788
+ ],
1789
+ "detectFromNumber": true
1790
+ },
1778
1791
  {
1779
1792
  "domains": [
1780
1793
  "gls-pakete.de"
@@ -1152,6 +1152,11 @@ export declare const CARRIER_CATALOG: {
1152
1152
  readonly domains: readonly ["gls-group.eu", "gls-group.com"];
1153
1153
  readonly pathPattern: "^/(?:DE|EU)/";
1154
1154
  readonly params: readonly ["match", "parcelNumber", "matchParcelNumber"];
1155
+ }, {
1156
+ readonly domains: readonly ["gls-group.eu", "gls-group.com"];
1157
+ readonly pathPattern: "^/GROUP/";
1158
+ readonly params: readonly ["match", "parcelNumber", "matchParcelNumber"];
1159
+ readonly detectFromNumber: true;
1155
1160
  }, {
1156
1161
  readonly domains: readonly ["gls-pakete.de"];
1157
1162
  readonly params: readonly ["match", "trackingNumber"];
@@ -1776,6 +1776,19 @@ export const CARRIER_CATALOG = {
1776
1776
  "matchParcelNumber"
1777
1777
  ]
1778
1778
  },
1779
+ {
1780
+ "domains": [
1781
+ "gls-group.eu",
1782
+ "gls-group.com"
1783
+ ],
1784
+ "pathPattern": "^/GROUP/",
1785
+ "params": [
1786
+ "match",
1787
+ "parcelNumber",
1788
+ "matchParcelNumber"
1789
+ ],
1790
+ "detectFromNumber": true
1791
+ },
1779
1792
  {
1780
1793
  "domains": [
1781
1794
  "gls-pakete.de"
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Universal Parcel Scraper",
5
- "version": "0.69.4"
5
+ "version": "0.69.6"
6
6
  },
7
7
  "paths": {
8
8
  "/health": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-parcel-scraper",
3
- "version": "0.69.4-main.892",
3
+ "version": "0.69.6-main.895",
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",