universal-parcel-scraper 0.1283.0-main.8564 → 0.1285.2-main.8580

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.
Files changed (88) hide show
  1. package/README.md +3 -3
  2. package/data/carrier.schema.json +4 -0
  3. package/data/catalog.json +169 -3
  4. package/data/coverage-summary.json +2 -2
  5. package/data/detection-golden.json +547 -0
  6. package/dist/browser/scraper.js +1599 -1438
  7. package/dist/carriers/benniao-express/adapter.d.ts +21 -0
  8. package/dist/carriers/benniao-express/adapter.js +52 -0
  9. package/dist/carriers/benniao-express/carrier.json +79 -0
  10. package/dist/carriers/benniao-express/numbers.json +119 -0
  11. package/dist/carriers/benniao-express/parser.d.ts +15 -0
  12. package/dist/carriers/benniao-express/parser.js +109 -0
  13. package/dist/carriers/benniao-express/status.d.ts +4 -0
  14. package/dist/carriers/benniao-express/status.js +9 -0
  15. package/dist/carriers/benniao-express/statuses.json +61 -0
  16. package/dist/carriers/correos-spain/status.js +4 -2
  17. package/dist/carriers/correos-spain/statuses.json +1 -0
  18. package/dist/carriers/disu-logistics/adapter.d.ts +14 -0
  19. package/dist/carriers/disu-logistics/adapter.js +43 -0
  20. package/dist/carriers/disu-logistics/carrier.json +76 -0
  21. package/dist/carriers/disu-logistics/numbers.json +208 -0
  22. package/dist/carriers/disu-logistics/parser.d.ts +14 -0
  23. package/dist/carriers/disu-logistics/parser.js +109 -0
  24. package/dist/carriers/disu-logistics/status.d.ts +4 -0
  25. package/dist/carriers/disu-logistics/status.js +9 -0
  26. package/dist/carriers/disu-logistics/statuses.json +77 -0
  27. package/dist/carriers/dpd-fr/status.js +2 -0
  28. package/dist/carriers/dpd-fr/statuses.json +8 -0
  29. package/dist/carriers/ecoscooting/carrier.json +2 -1
  30. package/dist/carriers/feibao-logistics/adapter.d.ts +14 -0
  31. package/dist/carriers/feibao-logistics/adapter.js +43 -0
  32. package/dist/carriers/feibao-logistics/carrier.json +74 -0
  33. package/dist/carriers/feibao-logistics/numbers.json +173 -0
  34. package/dist/carriers/feibao-logistics/parser.d.ts +15 -0
  35. package/dist/carriers/feibao-logistics/parser.js +118 -0
  36. package/dist/carriers/feibao-logistics/status.d.ts +4 -0
  37. package/dist/carriers/feibao-logistics/status.js +9 -0
  38. package/dist/carriers/feibao-logistics/statuses.json +45 -0
  39. package/dist/carriers/huaqi-express/adapter.d.ts +14 -0
  40. package/dist/carriers/huaqi-express/adapter.js +41 -0
  41. package/dist/carriers/huaqi-express/carrier.json +72 -0
  42. package/dist/carriers/huaqi-express/numbers.json +39 -0
  43. package/dist/carriers/huaqi-express/parser.d.ts +14 -0
  44. package/dist/carriers/huaqi-express/parser.js +106 -0
  45. package/dist/carriers/huaqi-express/status.d.ts +4 -0
  46. package/dist/carriers/huaqi-express/status.js +9 -0
  47. package/dist/carriers/huaqi-express/statuses.json +77 -0
  48. package/dist/carriers/lindao-express/adapter.d.ts +14 -0
  49. package/dist/carriers/lindao-express/adapter.js +42 -0
  50. package/dist/carriers/lindao-express/carrier.json +68 -0
  51. package/dist/carriers/lindao-express/numbers.json +120 -0
  52. package/dist/carriers/lindao-express/parser.d.ts +13 -0
  53. package/dist/carriers/lindao-express/parser.js +80 -0
  54. package/dist/carriers/lindao-express/status.d.ts +4 -0
  55. package/dist/carriers/lindao-express/status.js +9 -0
  56. package/dist/carriers/lindao-express/statuses.json +101 -0
  57. package/dist/carriers/ontrac/carrier.json +1 -1
  58. package/dist/carriers/ontrac/numbers.json +15 -0
  59. package/dist/carriers/paack/carrier.json +2 -1
  60. package/dist/carriers/riyu-logistics/adapter.d.ts +14 -0
  61. package/dist/carriers/riyu-logistics/adapter.js +42 -0
  62. package/dist/carriers/riyu-logistics/carrier.json +70 -0
  63. package/dist/carriers/riyu-logistics/numbers.json +71 -0
  64. package/dist/carriers/riyu-logistics/parser.d.ts +19 -0
  65. package/dist/carriers/riyu-logistics/parser.js +90 -0
  66. package/dist/carriers/riyu-logistics/status.d.ts +4 -0
  67. package/dist/carriers/riyu-logistics/status.js +9 -0
  68. package/dist/carriers/riyu-logistics/statuses.json +69 -0
  69. package/dist/carriers/wanjia-logistics/adapter.d.ts +14 -0
  70. package/dist/carriers/wanjia-logistics/adapter.js +41 -0
  71. package/dist/carriers/wanjia-logistics/carrier.json +77 -0
  72. package/dist/carriers/wanjia-logistics/numbers.json +114 -0
  73. package/dist/carriers/wanjia-logistics/parser.d.ts +15 -0
  74. package/dist/carriers/wanjia-logistics/parser.js +145 -0
  75. package/dist/carriers/wanjia-logistics/status.d.ts +4 -0
  76. package/dist/carriers/wanjia-logistics/status.js +9 -0
  77. package/dist/carriers/wanjia-logistics/statuses.json +77 -0
  78. package/dist/core/catalog/recognition.js +9 -0
  79. package/dist/core/catalog/statusMaps.js +14 -7
  80. package/dist/core/catalog/types.d.ts +5 -0
  81. package/dist/core/detection/index.d.ts +1 -0
  82. package/dist/core/detection/index.js +1 -0
  83. package/dist/data/catalog.json +169 -3
  84. package/dist/generated/catalog.d.ts +1 -1
  85. package/dist/generated/catalog.js +183 -3
  86. package/dist/generated/registry.js +21 -0
  87. package/dist/server/openapi.json +1 -1
  88. package/package.json +1 -1
@@ -0,0 +1,208 @@
1
+ {
2
+ "carrier": "disu-logistics",
3
+ "records": [
4
+ {
5
+ "number": "516058158759",
6
+ "role": "shipment",
7
+ "evidence": "public_shipment_report",
8
+ "source": {
9
+ "url": "https://www.kuaidi.com/all/dexp.html",
10
+ "date": "2026-11-22",
11
+ "dateKind": "capture",
12
+ "access": "full_page"
13
+ },
14
+ "context": {
15
+ "assessment": "confirmed"
16
+ },
17
+ "expect": {
18
+ "carrier": "unknown",
19
+ "confidence": "low",
20
+ "candidates": [
21
+ "mondial-relay",
22
+ "colis-prive",
23
+ "mrw",
24
+ "poste-italiane",
25
+ "brt",
26
+ "sf-express",
27
+ "sto",
28
+ "zto",
29
+ "j-and-t",
30
+ "lbc-express",
31
+ "metropolitan-warehouse",
32
+ "paquetexpress",
33
+ "sending"
34
+ ]
35
+ },
36
+ "note": "A waybill kuaidi.com's D速 page lists. Disu's tracker answers it with a parcel taken in, through the Tianjin and Zhengzhou hubs and on its way from Xi'an."
37
+ },
38
+ {
39
+ "number": "516058647321",
40
+ "role": "shipment",
41
+ "evidence": "public_shipment_report",
42
+ "source": {
43
+ "url": "https://www.kuaidi.com/all/dexp.html",
44
+ "date": "2026-11-22",
45
+ "dateKind": "capture",
46
+ "access": "full_page"
47
+ },
48
+ "context": {
49
+ "assessment": "confirmed"
50
+ },
51
+ "expect": {
52
+ "carrier": "unknown",
53
+ "confidence": "low",
54
+ "candidates": [
55
+ "mondial-relay",
56
+ "colis-prive",
57
+ "mrw",
58
+ "brt",
59
+ "sf-express",
60
+ "sto",
61
+ "zto",
62
+ "j-and-t",
63
+ "lbc-express",
64
+ "metropolitan-warehouse",
65
+ "paquetexpress",
66
+ "sending"
67
+ ]
68
+ },
69
+ "note": "A waybill kuaidi.com's D速 page lists. Disu's tracker answers it with a parcel taken in and sorted through Tianjin, Zhengzhou and Xi'an."
70
+ },
71
+ {
72
+ "number": "516057854686",
73
+ "role": "shipment",
74
+ "evidence": "public_shipment_report",
75
+ "source": {
76
+ "url": "https://www.kuaidi.com/all/dexp.html",
77
+ "date": "2026-11-22",
78
+ "dateKind": "capture",
79
+ "access": "full_page"
80
+ },
81
+ "context": {
82
+ "assessment": "confirmed"
83
+ },
84
+ "expect": {
85
+ "carrier": "unknown",
86
+ "confidence": "low",
87
+ "candidates": [
88
+ "mondial-relay",
89
+ "colis-prive",
90
+ "mrw",
91
+ "brt",
92
+ "japan-post",
93
+ "sf-express",
94
+ "sto",
95
+ "zto",
96
+ "yamato",
97
+ "j-and-t",
98
+ "lbc-express",
99
+ "metropolitan-warehouse",
100
+ "paquetexpress",
101
+ "sagawa",
102
+ "sending"
103
+ ]
104
+ },
105
+ "note": "A waybill kuaidi.com's D速 page lists. Disu's tracker answers it with a parcel taken in for a Shandong account, through Jining, Zhongshan and Zhanjiang, left at a pickup station in Maoming and collected."
106
+ },
107
+ {
108
+ "number": "516057968162",
109
+ "role": "shipment",
110
+ "evidence": "public_shipment_report",
111
+ "source": {
112
+ "url": "https://www.kuaidi.com/all/dexp.html",
113
+ "date": "2026-11-22",
114
+ "dateKind": "capture",
115
+ "access": "full_page"
116
+ },
117
+ "context": {
118
+ "assessment": "confirmed"
119
+ },
120
+ "expect": {
121
+ "carrier": "unknown",
122
+ "confidence": "low",
123
+ "candidates": [
124
+ "mondial-relay",
125
+ "colis-prive",
126
+ "mrw",
127
+ "brt",
128
+ "sf-express",
129
+ "sto",
130
+ "zto",
131
+ "j-and-t",
132
+ "lbc-express",
133
+ "metropolitan-warehouse",
134
+ "paquetexpress",
135
+ "sending"
136
+ ]
137
+ },
138
+ "note": "A waybill kuaidi.com's D速 page lists. Disu's tracker answers it with a parcel through Jiaxing, Zhengzhou and Hebi, left at a pickup point in Xinxiang and collected."
139
+ },
140
+ {
141
+ "number": "516050955481",
142
+ "role": "shipment",
143
+ "evidence": "public_shipment_report",
144
+ "source": {
145
+ "url": "https://www.kuaidi.com/all/dexp.html",
146
+ "date": "2026-11-22",
147
+ "dateKind": "capture",
148
+ "access": "full_page"
149
+ },
150
+ "context": {
151
+ "assessment": "confirmed"
152
+ },
153
+ "expect": {
154
+ "carrier": "unknown",
155
+ "confidence": "low",
156
+ "candidates": [
157
+ "mondial-relay",
158
+ "colis-prive",
159
+ "mrw",
160
+ "brt",
161
+ "sf-express",
162
+ "sto",
163
+ "zto",
164
+ "j-and-t",
165
+ "lbc-express",
166
+ "metropolitan-warehouse",
167
+ "paquetexpress",
168
+ "sending"
169
+ ]
170
+ },
171
+ "note": "A waybill kuaidi.com's D速 page lists. Disu's tracker answers it with a parcel through Jiaxing, Tianjin and Shenyang, left with a gatekeeper and delivered."
172
+ },
173
+ {
174
+ "number": "516050936706",
175
+ "role": "shipment",
176
+ "evidence": "public_shipment_report",
177
+ "source": {
178
+ "url": "https://www.kuaidi.com/all/dexp.html",
179
+ "date": "2026-11-22",
180
+ "dateKind": "capture",
181
+ "access": "full_page"
182
+ },
183
+ "context": {
184
+ "assessment": "confirmed"
185
+ },
186
+ "expect": {
187
+ "carrier": "unknown",
188
+ "confidence": "low",
189
+ "candidates": [
190
+ "mondial-relay",
191
+ "colis-prive",
192
+ "mrw",
193
+ "brt",
194
+ "sf-express",
195
+ "sto",
196
+ "zto",
197
+ "j-and-t",
198
+ "lbc-express",
199
+ "metropolitan-warehouse",
200
+ "paquetexpress",
201
+ "saia",
202
+ "sending"
203
+ ]
204
+ },
205
+ "note": "A waybill kuaidi.com's D速 page lists. Disu's tracker answers it with a parcel through Guangzhou and Dongguan, redelivered at the recipient's request and delivered in Shenzhen."
206
+ }
207
+ ]
208
+ }
@@ -0,0 +1,14 @@
1
+ import type { CarrierResult } from '../../core/result/index.js';
2
+ export declare const PROVIDER = "Disu Logistics";
3
+ /** The site's home page, whose tracking box calls the endpoint below; the site answers over HTTP only. */
4
+ export declare const DISU_PAGE = "http://www.d-exp.cn/";
5
+ export declare const DISU_ENDPOINT = "http://www.d-exp.cn/Home/TraceinfoQuery";
6
+ /** The shapes the site's own script accepts: twelve digits, 6 and fourteen digits, or DS and fifteen digits. */
7
+ export declare function normalizeDisuNumber(raw: string): string;
8
+ export declare function disuLookupUrl(number: string): string;
9
+ /**
10
+ * The tracker's reply for one waybill: a heading naming it, then its scans newest first on China
11
+ * wall clocks. The heading must name the whole waybill asked; an unknown waybill comes back with the
12
+ * heading and no scans.
13
+ */
14
+ export declare function parseDisu(html: string, raw: string): CarrierResult;
@@ -0,0 +1,109 @@
1
+ import { normalizeTrackingNumber } from '../../core/detection/index.js';
2
+ import { ChallengeError, InvalidInputError, NotFoundError, SchemaError } from '../../core/errors/index.js';
3
+ import { languageStageStatus } from '../../core/status/index.js';
4
+ import { calendarDay } from '../../core/time/index.js';
5
+ import { textFromHtml } from '../../core/transport/text.js';
6
+ import { disuStage } from './status.js';
7
+ export const PROVIDER = 'Disu Logistics';
8
+ /** The site's home page, whose tracking box calls the endpoint below; the site answers over HTTP only. */
9
+ export const DISU_PAGE = 'http://www.d-exp.cn/';
10
+ export const DISU_ENDPOINT = 'http://www.d-exp.cn/Home/TraceinfoQuery';
11
+ const CHALLENGE = /_cf_chl_opt|cf-turnstile|<title>\s*Just a moment|acw_sc__v2|aliyun_waf|_____tmd_____|waf\.tencent|<title>\s*(?:滑动验证|验证码|安全验证|访问受限|访问被拒绝)/i;
12
+ const ROW = /<li(?: class='first')?><i class='node-icon'><\/i><span class='time'>(\d{4})\/(\d{1,2})\/(\d{1,2}) (\d{1,2}):([0-5]\d):([0-5]\d)<\/span><span class='txt'>([^<]{0,800})<\/span><\/li>/g;
13
+ /** The shapes the site's own script accepts: twelve digits, 6 and fourteen digits, or DS and fifteen digits. */
14
+ export function normalizeDisuNumber(raw) {
15
+ const number = typeof raw === 'string' && raw.length <= 64 ? normalizeTrackingNumber(raw) : '';
16
+ if (!/^(?:\d{12}|6\d{14}|DS\d{15})$/.test(number))
17
+ throw new InvalidInputError(PROVIDER, 'Disu waybills are twelve digits, 6 and fourteen digits, or DS and fifteen digits');
18
+ return number;
19
+ }
20
+ export function disuLookupUrl(number) {
21
+ return `${DISU_ENDPOINT}?${new URLSearchParams({ billcode: number })}`;
22
+ }
23
+ /** The scans the rows stand for, matched in this order on the wording without its brackets. */
24
+ const CODES = [
25
+ [/送达签收|已签收/, '签收'],
26
+ [/暂存/, '暂存'],
27
+ [/再次派送/, '再次派送'],
28
+ [/正在为您派送/, '派送'],
29
+ [/准备分配快递员/, '到达站点'],
30
+ [/^预计.{0,20}到达/, '预计到达'],
31
+ [/已出.{0,4}(?:正在|即将)发往/, '发出'],
32
+ [/开始分拣/, '分拣'],
33
+ [/揽收完成|收货$/, '揽收'],
34
+ ];
35
+ /**
36
+ * A row's wording without its leading place, the customer service notices, the courier, the
37
+ * signatory and the phone numbers. A pickup point and the delivering partner's waybill stay.
38
+ */
39
+ function wording(text) {
40
+ return text
41
+ .replace(/^【[^】]{1,40}】/, '')
42
+ .replace(/[【((]如有问题请拨打速递官方客服[^】))]{0,40}[】))]/g, '')
43
+ .replace(/[,,]?\s*物流问题无需找商家或平台[^。]{0,40}。?/g, '')
44
+ .replace(/【[,,]】有取件码问题[^【]{0,40}请联系快递员【[^】]{0,60}】/g, '')
45
+ .replace(/[,,]?\s*如有疑问(?:您可以)?(?:请)?联系(?:快递员)?(?:【[^】]{0,60}】|\d{7,})/g, '')
46
+ .replace(/快递员【[^】]{0,60}】/g, '快递员')
47
+ .replace(/[,,]由[^,,]{1,10}签收/g, '')
48
+ .replace(/[,,]\s*请您通过该单号查件并签收/g, '')
49
+ .replace(/1[3-9]\d{9}|956160/g, '')
50
+ .replace(/\s+/g, ' ')
51
+ .replace(/[\s,,。.]+$/, '')
52
+ .trim();
53
+ }
54
+ /** A row's leading place, as 深圳市, or the city of 广东省-茂名市. */
55
+ function place(text) {
56
+ const bracket = /^【([^】]{1,40})】/.exec(text)?.[1];
57
+ return bracket?.replace(/^[一-鿿]{2,8}(?:省|自治区)-/, '');
58
+ }
59
+ /**
60
+ * The tracker's reply for one waybill: a heading naming it, then its scans newest first on China
61
+ * wall clocks. The heading must name the whole waybill asked; an unknown waybill comes back with the
62
+ * heading and no scans.
63
+ */
64
+ export function parseDisu(html, raw) {
65
+ const number = normalizeDisuNumber(raw);
66
+ if (typeof html !== 'string' || !html)
67
+ throw new SchemaError(PROVIDER, 'Disu returned an empty reply');
68
+ if (CHALLENGE.test(html.slice(0, 64_000)))
69
+ throw new ChallengeError(PROVIDER, 'Disu answered with a browser check');
70
+ const headings = [...html.matchAll(/<p class='sear_num'>运单号:【([^】<]{1,40})】<\/p>/g)].map(match => match[1].trim().toUpperCase());
71
+ if (!headings.length)
72
+ throw new SchemaError(PROVIDER, 'Disu returned a reply without its tracking results');
73
+ if (headings.length !== 1 || headings[0] !== number)
74
+ throw new SchemaError(PROVIDER, 'Disu returned another waybill');
75
+ const rows = [...html.matchAll(ROW)];
76
+ if (rows.length > 500 || rows.length !== (html.match(/<li[ >]/g)?.length ?? 0))
77
+ throw new SchemaError(PROVIDER, 'Disu returned an invalid scan row');
78
+ if (!rows.length)
79
+ throw new NotFoundError(PROVIDER);
80
+ const events = [], seen = new Set();
81
+ let delivery;
82
+ for (const [, year, month, day, hour, minute, second, body] of rows) {
83
+ const date = calendarDay(+year, +month, +day);
84
+ if (!date || +hour > 23)
85
+ throw new SchemaError(PROVIDER, 'Disu returned an invalid scan time');
86
+ const text = textFromHtml(body, 800), description = wording(text);
87
+ if (!description)
88
+ continue;
89
+ delivery ??= /代派单号[::]\s*(\d{8,20})/.exec(description)?.[1];
90
+ const bare = description.replace(/【[^】]*】/g, ''), type = CODES.find(([pattern]) => pattern.test(bare))?.[1];
91
+ const stage = type ? disuStage(type) : undefined, location = place(text);
92
+ const event = { local_time: `${date}T${hour.padStart(2, '0')}:${minute}:${second}`, description,
93
+ ...(type ? { provider_code: type } : {}), ...(location ? { location } : {}), ...(stage ? { stage, stage_source: 'carrier_map' } : {}) };
94
+ const key = JSON.stringify(event);
95
+ if (!seen.has(key)) {
96
+ seen.add(key);
97
+ events.push(event);
98
+ }
99
+ }
100
+ if (!events.length)
101
+ throw new NotFoundError(PROVIDER);
102
+ // The reply lists rows newest first; rows on the same clock keep its order.
103
+ events.sort((a, b) => b.local_time.localeCompare(a.local_time));
104
+ const newest = events[0];
105
+ const stage = newest.stage;
106
+ return { status: stage ? languageStageStatus(stage) : 'unknown', ...(stage ? { current_stage: stage, current_stage_source: 'carrier_map' } : {}),
107
+ last_status_text: newest.location ? `${newest.description} · ${newest.location}` : newest.description,
108
+ last_update: null, last_update_local: newest.local_time, ...(delivery ? { delivery_tracking_number: delivery } : {}), events: events.slice(0, 200) };
109
+ }
@@ -0,0 +1,4 @@
1
+ import type { Stage } from '../../core/status/index.js';
2
+ import type { CarrierStatusMap } from '../../core/status/statusMap.js';
3
+ export declare function disuStage(code: string): Stage | undefined;
4
+ export declare const statusMap: CarrierStatusMap;
@@ -0,0 +1,9 @@
1
+ import statuses from './statuses.json' with { type: 'json' };
2
+ const ENTRIES = statuses.entries;
3
+ /** The stages of the scans Disu's rows are built around, as recorded in `statuses.json`. */
4
+ const CODES = new Map(ENTRIES.filter(entry => entry.code && entry.stage)
5
+ .map(entry => [entry.code, entry.stage]));
6
+ export function disuStage(code) {
7
+ return CODES.get(code);
8
+ }
9
+ export const statusMap = { stage: code => (code ? CODES.get(code) : undefined), gaps: [] };
@@ -0,0 +1,77 @@
1
+ {
2
+ "carrier": "disu-logistics",
3
+ "entries": [
4
+ {
5
+ "code": "揽收",
6
+ "wording": "您的包裹已揽收完成 or 您的包裹在【…】收货",
7
+ "stage": "accepted",
8
+ "language": "zh",
9
+ "confirmedBy": "live",
10
+ "note": "Taken in at the origin."
11
+ },
12
+ {
13
+ "code": "分拣",
14
+ "wording": "您的包裹在【…】开始分拣",
15
+ "stage": "in_transit",
16
+ "language": "zh",
17
+ "confirmedBy": "live",
18
+ "note": "Sorted at a hub."
19
+ },
20
+ {
21
+ "code": "发出",
22
+ "wording": "您的包裹已出【…】,正在发往【…】 or 即将发往下一节点",
23
+ "stage": "in_transit",
24
+ "language": "zh",
25
+ "confirmedBy": "live",
26
+ "note": "Left a hub or station for the next one."
27
+ },
28
+ {
29
+ "code": "预计到达",
30
+ "wording": "预计…到达【…】,两地距离…",
31
+ "stage": "in_transit",
32
+ "language": "zh",
33
+ "confirmedBy": "live",
34
+ "note": "A transfer centre's estimate for the next hub."
35
+ },
36
+ {
37
+ "code": "到达站点",
38
+ "wording": "您的包裹已经进入【…】准备分配快递员",
39
+ "stage": "in_transit",
40
+ "language": "zh",
41
+ "confirmedBy": "live",
42
+ "note": "Arrived at the delivering station."
43
+ },
44
+ {
45
+ "code": "派送",
46
+ "wording": "快递员【…】正在为您派送",
47
+ "stage": "out_for_delivery",
48
+ "language": "zh",
49
+ "confirmedBy": "live",
50
+ "note": "Out with a courier; the adapter leaves the courier's name and phones out."
51
+ },
52
+ {
53
+ "code": "再次派送",
54
+ "wording": "包裹将在收件人要求的时间内再次派送,请耐心等待",
55
+ "stage": "failed_attempt",
56
+ "language": "zh",
57
+ "confirmedBy": "live",
58
+ "note": "Not delivered on this round; delivery is tried again at the time the recipient asked."
59
+ },
60
+ {
61
+ "code": "暂存",
62
+ "wording": "您的快件已暂存至 … or 快件已由…暂存,可凭取件码到站取件",
63
+ "stage": "ready_for_pickup",
64
+ "language": "zh",
65
+ "confirmedBy": "live",
66
+ "note": "Left at a pickup point or a gatekeeper for collection; the row may name the delivering partner's waybill."
67
+ },
68
+ {
69
+ "code": "签收",
70
+ "wording": "您的包裹已送达签收… or 已签收,签收人凭取件码签收",
71
+ "stage": "delivered",
72
+ "language": "zh",
73
+ "confirmedBy": "live",
74
+ "note": "Delivered or collected; the adapter leaves the signatory and the courier out."
75
+ }
76
+ ]
77
+ }
@@ -78,6 +78,8 @@ export function classifyStatus(description) {
78
78
  // "Votre livraison n'a pas pu être réalisée ce jour, elle est reprogrammée au prochain jour ouvré", hours after
79
79
  // the round's scan: the round did not deliver.
80
80
  'n a pas pu etre realisee',
81
+ // "Nous n'avons pas pu livrer votre colis", just before that row: the same round that did not deliver.
82
+ 'pas pu livrer',
81
83
  // "Le destinataire était absent lors du passage de notre livreur, nous avons déposé votre colis en point Pickup":
82
84
  // the round did not deliver, and the Pickup point's own row follows.
83
85
  'etait absent lors du passage',
@@ -441,6 +441,14 @@
441
441
  "firstSeen": "2026-11-17",
442
442
  "note": "\"Votre livraison n'a pas pu être réalisée ce jour, elle est reprogrammée au prochain jour ouvré\", hours after the round's scan: the round did not deliver. The result status becomes exception."
443
443
  },
444
+ {
445
+ "wording": "pas pu livrer",
446
+ "language": "fr",
447
+ "stage": "failed_attempt",
448
+ "confirmedBy": "live",
449
+ "firstSeen": "2026-11-22",
450
+ "note": "\"Nous n'avons pas pu livrer votre colis\", just before \"Votre livraison n'a pas pu être réalisée ce jour…\": the round did not deliver. Substring match on the accent-free wording; the result status becomes exception."
451
+ },
444
452
  {
445
453
  "wording": "de la nécessité de reprogrammer sa livraison",
446
454
  "language": "fr",
@@ -100,7 +100,8 @@
100
100
  {
101
101
  "id": "ecoscooting-shein-package",
102
102
  "pattern": "^[CE]2\\d(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\\d|3[01])\\d{8}$",
103
- "confidence": "low"
103
+ "confidence": "low",
104
+ "servedCountriesOnly": true
104
105
  }
105
106
  ]
106
107
  }
@@ -0,0 +1,14 @@
1
+ import type { AdapterFactory, 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
+ export { parseFeibao } from './parser.js';
5
+ export declare class FeibaoTracker {
6
+ private readonly options;
7
+ constructor(options?: {
8
+ fetcher?: typeof fetch;
9
+ recorder?: StepRecorder;
10
+ userAgent?: string;
11
+ });
12
+ fetch(raw: string, context?: TrackingContext): Promise<CarrierResult>;
13
+ }
14
+ export declare const adapter: AdapterFactory;
@@ -0,0 +1,43 @@
1
+ import { ChallengeError, TransportError } from '../../core/errors/index.js';
2
+ import { runSteps } from '../../core/runner/index.js';
3
+ import { firstAttemptMs, networkRetryStep } from '../../core/runner/networkRetry.js';
4
+ import { NOOP_RECORDER } from '../../core/telemetry/index.js';
5
+ import { decodeText, fetchBounded, userAgentOf } from '../../core/transport/index.js';
6
+ import { FEIBAO_ENDPOINT, FEIBAO_PAGE, feibaoJson, normalizeFeibaoNumber, parseFeibao, PROVIDER } from './parser.js';
7
+ export { parseFeibao } from './parser.js';
8
+ const REDIRECTS = [301, 302, 303, 307, 308];
9
+ export class FeibaoTracker {
10
+ options;
11
+ constructor(options = {}) {
12
+ this.options = options;
13
+ }
14
+ fetch(raw, context = {}) {
15
+ context.signal?.throwIfAborted();
16
+ const number = normalizeFeibaoNumber(raw);
17
+ const read = async (signal, timeoutMs) => {
18
+ // The page's request while its captcha is switched off: an empty code and the waybill, with no
19
+ // session or account.
20
+ const referer = `${FEIBAO_PAGE}?${new URLSearchParams({ funcid: '14', companyid: '1', code: '', word: number })}`;
21
+ const { response, bytes } = await fetchBounded(FEIBAO_ENDPOINT, { method: 'POST', signal, body: new URLSearchParams({ code: '', word: number }).toString(),
22
+ headers: { Accept: '*/*', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Requested-With': 'XMLHttpRequest',
23
+ Origin: 'http://www.fb56.com', Referer: referer, 'User-Agent': userAgentOf(this.options.userAgent) } }, { provider: PROVIDER, fetcher: this.options.fetcher, maxBytes: 1_000_000, timeoutMs: Math.max(1, Math.floor(timeoutMs)),
24
+ redirect: 'manual', allowHttpStatuses: [...REDIRECTS, 401, 403, 404, 410] });
25
+ if ([401, 403].includes(response.status))
26
+ throw new ChallengeError(PROVIDER, 'Feibao refused its guest request');
27
+ // An unknown waybill is HTTP 200 too; anything else is a moved route.
28
+ if (response.status !== 200)
29
+ throw new TransportError(PROVIDER, 'Feibao tracking endpoint moved', { status: response.status });
30
+ return parseFeibao(feibaoJson(decodeText(bytes)), number);
31
+ };
32
+ // A request that fails to reach the server, or hangs, gets one more try in the rest of the budget.
33
+ return runSteps({ carrier: 'feibao-logistics', budgetMs: context.budgetMs ?? 15_000, signal: context.signal,
34
+ recorder: this.options.recorder ?? NOOP_RECORDER }, [
35
+ { id: 'direct', run: ({ signal, remainingMs }) => read(signal, firstAttemptMs(remainingMs)) },
36
+ networkRetryStep(({ signal, remainingMs }) => read(signal, remainingMs)),
37
+ ]);
38
+ }
39
+ }
40
+ export const adapter = environment => {
41
+ const tracker = new FeibaoTracker({ fetcher: environment.fetcher, recorder: environment.recorder, userAgent: environment.userAgent });
42
+ return { id: 'feibao-logistics', recordsSteps: true, steps: ['direct', 'retry'], track: (input, context) => tracker.fetch(input.number, context) };
43
+ };
@@ -0,0 +1,74 @@
1
+ {
2
+ "id": "feibao-logistics",
3
+ "displayName": "Feibao Logistics",
4
+ "aliases": [
5
+ "飞豹快运",
6
+ "中铁飞豹快运",
7
+ "飞豹物流",
8
+ "飞豹物流集团",
9
+ "飞豹智行供应链"
10
+ ],
11
+ "region": {
12
+ "countries": [
13
+ "CN"
14
+ ]
15
+ },
16
+ "brand": {
17
+ "color": "#1d4f91"
18
+ },
19
+ "selectable": true,
20
+ "timezone": "Asia/Shanghai",
21
+ "tracking": {
22
+ "mode": "automatic",
23
+ "adapter": "feibao-logistics",
24
+ "steps": [
25
+ "direct",
26
+ "retry"
27
+ ]
28
+ },
29
+ "capabilities": [
30
+ "history",
31
+ "location",
32
+ "provider_code"
33
+ ],
34
+ "portal": {
35
+ "canaryUrl": "https://t.17track.net/",
36
+ "shows": [
37
+ "status",
38
+ "history",
39
+ "location",
40
+ "driver_name",
41
+ "driver_phone",
42
+ "signatory",
43
+ "sender_name",
44
+ "recipient_name",
45
+ "recipient_address"
46
+ ],
47
+ "scraped": [
48
+ "status",
49
+ "history",
50
+ "location",
51
+ "provider_code",
52
+ "offset_timestamps"
53
+ ],
54
+ "discarded": [
55
+ "driver_name",
56
+ "driver_phone",
57
+ "signatory",
58
+ "sender_name",
59
+ "recipient_name",
60
+ "recipient_address"
61
+ ],
62
+ "unavailable": [
63
+ "weight",
64
+ "service_name",
65
+ "eta",
66
+ "pieces",
67
+ "origin",
68
+ "destination",
69
+ "proof_of_delivery"
70
+ ]
71
+ },
72
+ "links": [],
73
+ "detection": []
74
+ }