universal-parcel-scraper 0.69.3-main.891 → 0.69.4-main.892
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 +4 -3
- package/dist/browser/scraper.js +4 -3
- package/dist/carriers/usps/adapter.js +6 -17
- package/dist/carriers/usps/carrier.json +4 -3
- package/dist/data/catalog.json +4 -3
- package/dist/generated/catalog.d.ts +3 -2
- package/dist/generated/catalog.js +4 -3
- package/dist/server/openapi.json +1 -1
- package/package.json +1 -1
package/data/catalog.json
CHANGED
|
@@ -2702,8 +2702,8 @@
|
|
|
2702
2702
|
"browserRecognitionRank": 65
|
|
2703
2703
|
},
|
|
2704
2704
|
"canaryUrl": "https://www.usps.com/",
|
|
2705
|
-
"trackingUrlTemplate": "https://tools.usps.com/
|
|
2706
|
-
"trackingSearchUrl": "https://tools.usps.com/
|
|
2705
|
+
"trackingUrlTemplate": "https://tools.usps.com/tracking/{trackingNumber}",
|
|
2706
|
+
"trackingSearchUrl": "https://tools.usps.com/tracking/",
|
|
2707
2707
|
"linkRules": [
|
|
2708
2708
|
{
|
|
2709
2709
|
"domains": [
|
|
@@ -2712,7 +2712,8 @@
|
|
|
2712
2712
|
],
|
|
2713
2713
|
"params": [
|
|
2714
2714
|
"tLabels"
|
|
2715
|
-
]
|
|
2715
|
+
],
|
|
2716
|
+
"path": "^/tracking/(\\d{20}|\\d{22}|\\d{26}|[A-Z]{2}\\d{9}[A-Z]{2})/?$"
|
|
2716
2717
|
}
|
|
2717
2718
|
],
|
|
2718
2719
|
"detectionRules": [
|
package/dist/browser/scraper.js
CHANGED
|
@@ -2290,11 +2290,12 @@ var ye = {
|
|
|
2290
2290
|
browserRecognitionRank: 65
|
|
2291
2291
|
},
|
|
2292
2292
|
canaryUrl: "https://www.usps.com/",
|
|
2293
|
-
trackingUrlTemplate: "https://tools.usps.com/
|
|
2294
|
-
trackingSearchUrl: "https://tools.usps.com/
|
|
2293
|
+
trackingUrlTemplate: "https://tools.usps.com/tracking/{trackingNumber}",
|
|
2294
|
+
trackingSearchUrl: "https://tools.usps.com/tracking/",
|
|
2295
2295
|
linkRules: [{
|
|
2296
2296
|
domains: ["tools.usps.com", "usps.com"],
|
|
2297
|
-
params: ["tLabels"]
|
|
2297
|
+
params: ["tLabels"],
|
|
2298
|
+
path: "^/tracking/(\\d{20}|\\d{22}|\\d{26}|[A-Z]{2}\\d{9}[A-Z]{2})/?$"
|
|
2298
2299
|
}],
|
|
2299
2300
|
detectionRules: [
|
|
2300
2301
|
{
|
|
@@ -12,21 +12,12 @@ import { uspsStage, uspsStatus } from './status.js';
|
|
|
12
12
|
/**
|
|
13
13
|
* USPS, through the server-rendered tracking page.
|
|
14
14
|
*
|
|
15
|
-
* The page
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* can vary by session. The lookup has a single
|
|
20
|
-
* step: the private browser service loads the page, and the rendered DOM is
|
|
21
|
-
* parsed. Nothing is ever replayed over plain HTTP.
|
|
22
|
-
*
|
|
23
|
-
* Markup provenance: the live page shell (`.track-bar-container`,
|
|
24
|
-
* `#trackingNum`, `.latest-update-banner-wrapper .banner-header`,
|
|
25
|
-
* `.current-tracking-status-wrapper`), inspected 2026-09-20. Positive lookups
|
|
26
|
-
* on 2026-09-22 use `.tb-step` timeline cards, including collapsed history.
|
|
27
|
-
* The older table-shaped fixture remains a parsing fallback.
|
|
15
|
+
* The `/tracking/{number}` page carries the verdict and collapsed history
|
|
16
|
+
* in its HTML. The legacy query route can return only the global header,
|
|
17
|
+
* so load the package path directly. The browser handles verification;
|
|
18
|
+
* nothing is replayed over plain HTTP.
|
|
28
19
|
*/
|
|
29
|
-
const TRACKING_BASE = 'https://tools.usps.com/
|
|
20
|
+
const TRACKING_BASE = 'https://tools.usps.com/tracking/';
|
|
30
21
|
const MAX_BYTES = 10_000_000;
|
|
31
22
|
const DEFAULT_TIMEOUT_MS = 90_000;
|
|
32
23
|
const MAX_EVENTS_TO_RETURN = 100;
|
|
@@ -47,9 +38,7 @@ export function normalizeUSPSNumber(raw) {
|
|
|
47
38
|
return value;
|
|
48
39
|
}
|
|
49
40
|
export function uspsTrackingUrl(trackingNumber) {
|
|
50
|
-
|
|
51
|
-
url.searchParams.set('tLabels', normalizeUSPSNumber(trackingNumber));
|
|
52
|
-
return url.toString();
|
|
41
|
+
return new URL(normalizeUSPSNumber(trackingNumber), TRACKING_BASE).toString();
|
|
53
42
|
}
|
|
54
43
|
const MONTHS = '(January|February|March|April|May|June|July|August|September|October|November|December)';
|
|
55
44
|
const DATE_PATTERN = new RegExp(`${MONTHS}\\s+\\d{1,2},?\\s+\\d{4}`, 'i');
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"eta"
|
|
31
31
|
],
|
|
32
32
|
"portal": {
|
|
33
|
-
"url": "https://tools.usps.com/
|
|
34
|
-
"searchUrl": "https://tools.usps.com/
|
|
33
|
+
"url": "https://tools.usps.com/tracking/{trackingNumber}",
|
|
34
|
+
"searchUrl": "https://tools.usps.com/tracking/",
|
|
35
35
|
"canaryUrl": "https://www.usps.com/",
|
|
36
36
|
"shows": [
|
|
37
37
|
"status",
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
],
|
|
61
61
|
"params": [
|
|
62
62
|
"tLabels"
|
|
63
|
-
]
|
|
63
|
+
],
|
|
64
|
+
"path": "^/tracking/(\\d{20}|\\d{22}|\\d{26}|[A-Z]{2}\\d{9}[A-Z]{2})/?$"
|
|
64
65
|
}
|
|
65
66
|
],
|
|
66
67
|
"detection": [
|
package/dist/data/catalog.json
CHANGED
|
@@ -2702,8 +2702,8 @@
|
|
|
2702
2702
|
"browserRecognitionRank": 65
|
|
2703
2703
|
},
|
|
2704
2704
|
"canaryUrl": "https://www.usps.com/",
|
|
2705
|
-
"trackingUrlTemplate": "https://tools.usps.com/
|
|
2706
|
-
"trackingSearchUrl": "https://tools.usps.com/
|
|
2705
|
+
"trackingUrlTemplate": "https://tools.usps.com/tracking/{trackingNumber}",
|
|
2706
|
+
"trackingSearchUrl": "https://tools.usps.com/tracking/",
|
|
2707
2707
|
"linkRules": [
|
|
2708
2708
|
{
|
|
2709
2709
|
"domains": [
|
|
@@ -2712,7 +2712,8 @@
|
|
|
2712
2712
|
],
|
|
2713
2713
|
"params": [
|
|
2714
2714
|
"tLabels"
|
|
2715
|
-
]
|
|
2715
|
+
],
|
|
2716
|
+
"path": "^/tracking/(\\d{20}|\\d{22}|\\d{26}|[A-Z]{2}\\d{9}[A-Z]{2})/?$"
|
|
2716
2717
|
}
|
|
2717
2718
|
],
|
|
2718
2719
|
"detectionRules": [
|
|
@@ -1830,11 +1830,12 @@ export declare const CARRIER_CATALOG: {
|
|
|
1830
1830
|
readonly browserRecognitionRank: 65;
|
|
1831
1831
|
};
|
|
1832
1832
|
readonly canaryUrl: "https://www.usps.com/";
|
|
1833
|
-
readonly trackingUrlTemplate: "https://tools.usps.com/
|
|
1834
|
-
readonly trackingSearchUrl: "https://tools.usps.com/
|
|
1833
|
+
readonly trackingUrlTemplate: "https://tools.usps.com/tracking/{trackingNumber}";
|
|
1834
|
+
readonly trackingSearchUrl: "https://tools.usps.com/tracking/";
|
|
1835
1835
|
readonly linkRules: readonly [{
|
|
1836
1836
|
readonly domains: readonly ["tools.usps.com", "usps.com"];
|
|
1837
1837
|
readonly params: readonly ["tLabels"];
|
|
1838
|
+
readonly path: "^/tracking/(\\d{20}|\\d{22}|\\d{26}|[A-Z]{2}\\d{9}[A-Z]{2})/?$";
|
|
1838
1839
|
}];
|
|
1839
1840
|
readonly detectionRules: readonly [{
|
|
1840
1841
|
readonly pattern: "^(?!9[23]61)(?:91\\d{2}9\\d{17}|92\\d{3}9\\d{16}|93\\d{3}[0-8]\\d{16}|9[45]\\d{20})$";
|
|
@@ -2703,8 +2703,8 @@ export const CARRIER_CATALOG = {
|
|
|
2703
2703
|
"browserRecognitionRank": 65
|
|
2704
2704
|
},
|
|
2705
2705
|
"canaryUrl": "https://www.usps.com/",
|
|
2706
|
-
"trackingUrlTemplate": "https://tools.usps.com/
|
|
2707
|
-
"trackingSearchUrl": "https://tools.usps.com/
|
|
2706
|
+
"trackingUrlTemplate": "https://tools.usps.com/tracking/{trackingNumber}",
|
|
2707
|
+
"trackingSearchUrl": "https://tools.usps.com/tracking/",
|
|
2708
2708
|
"linkRules": [
|
|
2709
2709
|
{
|
|
2710
2710
|
"domains": [
|
|
@@ -2713,7 +2713,8 @@ export const CARRIER_CATALOG = {
|
|
|
2713
2713
|
],
|
|
2714
2714
|
"params": [
|
|
2715
2715
|
"tLabels"
|
|
2716
|
-
]
|
|
2716
|
+
],
|
|
2717
|
+
"path": "^/tracking/(\\d{20}|\\d{22}|\\d{26}|[A-Z]{2}\\d{9}[A-Z]{2})/?$"
|
|
2717
2718
|
}
|
|
2718
2719
|
],
|
|
2719
2720
|
"detectionRules": [
|
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.69.
|
|
3
|
+
"version": "0.69.4-main.892",
|
|
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",
|