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,70 @@
1
+ {
2
+ "id": "riyu-logistics",
3
+ "displayName": "Riyu Logistics",
4
+ "aliases": [
5
+ "日昱物流",
6
+ "日昱物流有限公司"
7
+ ],
8
+ "region": {
9
+ "countries": [
10
+ "CN"
11
+ ]
12
+ },
13
+ "brand": {
14
+ "color": "#e60012"
15
+ },
16
+ "selectable": true,
17
+ "timezone": "Asia/Shanghai",
18
+ "tracking": {
19
+ "mode": "automatic",
20
+ "adapter": "riyu-logistics",
21
+ "steps": [
22
+ "direct",
23
+ "retry"
24
+ ],
25
+ "localClocks": true
26
+ },
27
+ "capabilities": [
28
+ "history",
29
+ "location",
30
+ "provider_code"
31
+ ],
32
+ "portal": {
33
+ "searchUrl": "https://www.rywl.cn/cargoTracking.html",
34
+ "canaryUrl": "https://www.rywl.cn/",
35
+ "shows": [
36
+ "status",
37
+ "history",
38
+ "location",
39
+ "branch_phone",
40
+ "sender_name",
41
+ "recipient_name",
42
+ "recipient_address"
43
+ ],
44
+ "scraped": [
45
+ "status",
46
+ "history",
47
+ "location",
48
+ "provider_code"
49
+ ],
50
+ "discarded": [
51
+ "branch_phone",
52
+ "sender_name",
53
+ "recipient_name",
54
+ "recipient_address"
55
+ ],
56
+ "unavailable": [
57
+ "weight",
58
+ "service_name",
59
+ "eta",
60
+ "pieces",
61
+ "origin",
62
+ "destination",
63
+ "offset_timestamps",
64
+ "proof_of_delivery",
65
+ "signatory"
66
+ ]
67
+ },
68
+ "links": [],
69
+ "detection": []
70
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "carrier": "riyu-logistics",
3
+ "records": [
4
+ {
5
+ "number": "G0480119226",
6
+ "role": "shipment",
7
+ "evidence": "public_shipment_report",
8
+ "source": {
9
+ "url": "https://www.kuaidi.com/all/riyuwuliu.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
+ "gls-it"
22
+ ]
23
+ },
24
+ "note": "A waybill kuaidi.com's Riyu page lists. Riyu's tracker answers it with freight collected in Panyu, carried through Guangzhou and Wuhan and signed for in Huangpi."
25
+ },
26
+ {
27
+ "number": "G1170005421",
28
+ "role": "shipment",
29
+ "evidence": "public_shipment_report",
30
+ "source": {
31
+ "url": "https://www.kuaidi.com/all/riyuwuliu.html",
32
+ "date": "2026-11-22",
33
+ "dateKind": "capture",
34
+ "access": "full_page"
35
+ },
36
+ "context": {
37
+ "assessment": "confirmed"
38
+ },
39
+ "expect": {
40
+ "carrier": "unknown",
41
+ "confidence": "low",
42
+ "candidates": [
43
+ "gls-it"
44
+ ]
45
+ },
46
+ "note": "A waybill kuaidi.com's Riyu page lists. Riyu's tracker answers it with freight collected in Foshan, carried through Guangzhou and collected from Changshu's pickup desk."
47
+ },
48
+ {
49
+ "number": "G1260043114",
50
+ "role": "shipment",
51
+ "evidence": "public_shipment_report",
52
+ "source": {
53
+ "url": "https://www.kuaidi.com/all/riyuwuliu.html",
54
+ "date": "2026-11-22",
55
+ "dateKind": "capture",
56
+ "access": "full_page"
57
+ },
58
+ "context": {
59
+ "assessment": "confirmed"
60
+ },
61
+ "expect": {
62
+ "carrier": "unknown",
63
+ "confidence": "low",
64
+ "candidates": [
65
+ "gls-it"
66
+ ]
67
+ },
68
+ "note": "A waybill kuaidi.com's Riyu page lists. Riyu's tracker answers it with freight collected in Panyu, carried through Guangzhou and Shanghai and signed for in Minhang, with a dispatch row dated after the delivery."
69
+ }
70
+ ]
71
+ }
@@ -0,0 +1,19 @@
1
+ import type { CarrierResult } from '../../core/result/index.js';
2
+ export declare const PROVIDER = "Riyu Logistics";
3
+ export declare const RIYU_ORIGIN = "https://www.rywl.cn";
4
+ /** The site's 货物追踪 page for a waybill, whose script asks the endpoint below. */
5
+ export declare const riyuPage: (number: string) => string;
6
+ export declare const RIYU_ENDPOINT = "https://www.rywl.cn/ssm/order/orderTrack";
7
+ /** The waybills on kuaidi.com's Riyu page are a letter and ten digits, the eleven characters the site's search box takes. */
8
+ export declare function normalizeRiyuNumber(raw: string): string;
9
+ export declare function riyuLookupUrl(number: string): string;
10
+ /** The endpoint's JSON, or the failure a page in its place stands for. */
11
+ export declare function riyuJson(text: string): unknown;
12
+ /**
13
+ * The route the endpoint gives for one waybill: one row per step, each with its three-digit
14
+ * state code, its wording as 已到达:<site> and its China wall clock, ordered by state with the
15
+ * latest first. Every row must be the whole waybill asked. The site after the wording's colon is
16
+ * the location; the row's phone numbers and the operator field, which holds stray dates and
17
+ * places, are left out.
18
+ */
19
+ export declare function parseRiyu(body: unknown, raw: string): CarrierResult;
@@ -0,0 +1,90 @@
1
+ import { ChallengeError, IndeterminateError, InvalidInputError, NotFoundError, RateLimitedError, SchemaError } from '../../core/errors/index.js';
2
+ import { normalizeTrackingNumber } from '../../core/detection/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 { riyuStage } from './status.js';
7
+ export const PROVIDER = 'Riyu Logistics';
8
+ export const RIYU_ORIGIN = 'https://www.rywl.cn';
9
+ /** The site's 货物追踪 page for a waybill, whose script asks the endpoint below. */
10
+ export const riyuPage = (number) => `${RIYU_ORIGIN}/cargoMap-${encodeURIComponent(number)}`;
11
+ export const RIYU_ENDPOINT = `${RIYU_ORIGIN}/ssm/order/orderTrack`;
12
+ const CHALLENGE = /_cf_chl_opt|cf-turnstile|<title>\s*Just a moment|acw_sc__v2|aliyun_waf|_____tmd_____|waf\.tencent|<title>\s*(?:滑动验证|验证码|安全验证|访问受限|访问被拒绝)/i;
13
+ /** The waybills on kuaidi.com's Riyu page are a letter and ten digits, the eleven characters the site's search box takes. */
14
+ export function normalizeRiyuNumber(raw) {
15
+ const number = typeof raw === 'string' && raw.length <= 64 ? normalizeTrackingNumber(raw) : '';
16
+ if (!/^[A-Z]\d{10}$/.test(number))
17
+ throw new InvalidInputError(PROVIDER, 'Riyu waybills are a letter and ten digits');
18
+ return number;
19
+ }
20
+ export function riyuLookupUrl(number) {
21
+ return `${RIYU_ENDPOINT}?${new URLSearchParams({ omsNo: number })}`;
22
+ }
23
+ /** The endpoint's JSON, or the failure a page in its place stands for. */
24
+ export function riyuJson(text) {
25
+ try {
26
+ return JSON.parse(text.replace(/^\uFEFF/, ''));
27
+ }
28
+ catch {
29
+ if (CHALLENGE.test(text.slice(0, 64_000)))
30
+ throw new ChallengeError(PROVIDER, 'Riyu answered with a browser check');
31
+ throw new SchemaError(PROVIDER, 'Riyu returned an invalid reply');
32
+ }
33
+ }
34
+ const text = (value, max = 200) => (typeof value === 'string' ? textFromHtml(value, max) : '');
35
+ /**
36
+ * The route the endpoint gives for one waybill: one row per step, each with its three-digit
37
+ * state code, its wording as 已到达:<site> and its China wall clock, ordered by state with the
38
+ * latest first. Every row must be the whole waybill asked. The site after the wording's colon is
39
+ * the location; the row's phone numbers and the operator field, which holds stray dates and
40
+ * places, are left out.
41
+ */
42
+ export function parseRiyu(body, raw) {
43
+ const number = normalizeRiyuNumber(raw);
44
+ if (!body || typeof body !== 'object' || Array.isArray(body))
45
+ throw new SchemaError(PROVIDER, 'Riyu returned an invalid reply');
46
+ const { success, message, data } = body;
47
+ if (success !== true) {
48
+ if (/频繁|太快|过多/.test(text(message, 120)))
49
+ throw new RateLimitedError(PROVIDER);
50
+ throw new IndeterminateError(PROVIDER, 'Riyu did not complete the lookup');
51
+ }
52
+ const list = data && typeof data === 'object' ? data.orderTrackList : undefined;
53
+ if (!Array.isArray(list) || list.length > 500)
54
+ throw new SchemaError(PROVIDER, 'Riyu returned an invalid route');
55
+ if (!list.length)
56
+ throw new NotFoundError(PROVIDER);
57
+ const events = [], seen = new Set();
58
+ for (const row of list) {
59
+ if (!row || typeof row !== 'object')
60
+ throw new SchemaError(PROVIDER, 'Riyu returned an invalid route row');
61
+ const { omsNo, state, desc, oprTime } = row;
62
+ if (omsNo !== number)
63
+ throw new SchemaError(PROVIDER, 'Riyu returned another waybill');
64
+ if (typeof state !== 'string' || !/^\d{3}$/.test(state))
65
+ throw new SchemaError(PROVIDER, 'Riyu returned an invalid state');
66
+ const clock = typeof oprTime === 'string' ? /^(\d{4})-(\d{2})-(\d{2}) ((?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d)$/.exec(oprTime) : null;
67
+ const date = clock && calendarDay(+clock[1], +clock[2], +clock[3]);
68
+ if (!clock || !date)
69
+ throw new SchemaError(PROVIDER, 'Riyu returned an invalid scan time');
70
+ const description = text(desc, 200).replace(/1[3-9]\d{9}/g, '').trim();
71
+ if (!description)
72
+ continue;
73
+ const location = /[::]\s*(.{1,40})$/.exec(description)?.[1]?.trim();
74
+ const stage = riyuStage(state);
75
+ const event = { local_time: `${date}T${clock[4]}`, description, provider_code: state,
76
+ ...(location ? { location } : {}), ...(stage ? { stage, stage_source: 'carrier_map' } : {}) };
77
+ const key = JSON.stringify(event);
78
+ if (!seen.has(key)) {
79
+ seen.add(key);
80
+ events.push(event);
81
+ }
82
+ }
83
+ if (!events.length)
84
+ throw new NotFoundError(PROVIDER);
85
+ // The rows keep the endpoint's order, by state: a step's clock is sometimes written after the delivery's.
86
+ const newest = events.find(event => event.stage === 'delivered') ?? events[0];
87
+ const stage = newest.stage;
88
+ return { status: stage ? languageStageStatus(stage) : 'unknown', ...(stage ? { current_stage: stage, current_stage_source: 'carrier_map' } : {}),
89
+ last_status_text: newest.description, last_update: null, last_update_local: newest.local_time, events: events.slice(0, 200) };
90
+ }
@@ -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 riyuStage(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 state codes of Riyu's route rows, 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 riyuStage(code) {
7
+ return CODES.get(code);
8
+ }
9
+ export const statusMap = { stage: code => (code ? CODES.get(code) : undefined), gaps: [] };
@@ -0,0 +1,69 @@
1
+ {
2
+ "carrier": "riyu-logistics",
3
+ "entries": [
4
+ {
5
+ "code": "010",
6
+ "wording": "您的货物已揽收:<网点>",
7
+ "stage": "accepted",
8
+ "language": "zh",
9
+ "confirmedBy": "live",
10
+ "note": "Collected by the origin branch."
11
+ },
12
+ {
13
+ "code": "020",
14
+ "wording": "已发出:<网点>",
15
+ "stage": "in_transit",
16
+ "language": "zh",
17
+ "confirmedBy": "live",
18
+ "note": "Left the origin branch."
19
+ },
20
+ {
21
+ "code": "030",
22
+ "wording": "已到达:<出港组>",
23
+ "stage": "in_transit",
24
+ "language": "zh",
25
+ "confirmedBy": "live",
26
+ "note": "Reached the outbound hub."
27
+ },
28
+ {
29
+ "code": "040",
30
+ "wording": "已发出:<出港组>",
31
+ "stage": "in_transit",
32
+ "language": "zh",
33
+ "confirmedBy": "live",
34
+ "note": "Left the outbound hub."
35
+ },
36
+ {
37
+ "code": "050",
38
+ "wording": "已到达:<进港仓 / 理货管理部 / 进港自提组>",
39
+ "stage": "in_transit",
40
+ "language": "zh",
41
+ "confirmedBy": "live",
42
+ "note": "Reached the destination hub or warehouse."
43
+ },
44
+ {
45
+ "code": "070",
46
+ "wording": "已发出:<理货管理部 / 营业部>",
47
+ "stage": "in_transit",
48
+ "language": "zh",
49
+ "confirmedBy": "live",
50
+ "note": "Left the destination hub for the delivering branch."
51
+ },
52
+ {
53
+ "code": "080",
54
+ "wording": "已到达:<营业部>",
55
+ "stage": "in_transit",
56
+ "language": "zh",
57
+ "confirmedBy": "live",
58
+ "note": "Reached the delivering branch."
59
+ },
60
+ {
61
+ "code": "150",
62
+ "wording": "已签收:<营业部 / 自提组>",
63
+ "stage": "delivered",
64
+ "language": "zh",
65
+ "confirmedBy": "live",
66
+ "note": "Signed for, at the door or collected from the branch."
67
+ }
68
+ ]
69
+ }
@@ -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 { parseWanjia } from './parser.js';
5
+ export declare class WanjiaTracker {
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,41 @@
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 { normalizeWanjiaNumber, parseWanjia, PROVIDER, WANJIA_PAGE, wanjiaLookupUrl } from './parser.js';
7
+ export { parseWanjia } from './parser.js';
8
+ const REDIRECTS = [301, 302, 303, 307, 308];
9
+ export class WanjiaTracker {
10
+ options;
11
+ constructor(options = {}) {
12
+ this.options = options;
13
+ }
14
+ fetch(raw, context = {}) {
15
+ context.signal?.throwIfAborted();
16
+ const number = normalizeWanjiaNumber(raw);
17
+ const read = async (signal, timeoutMs) => {
18
+ // The waybill alone, as the tracking page frames it, with no session, captcha or account.
19
+ const { response, bytes } = await fetchBounded(wanjiaLookupUrl(number), { method: 'GET', signal, headers: {
20
+ Accept: 'text/html,application/xhtml+xml', Referer: WANJIA_PAGE, 'User-Agent': userAgentOf(this.options.userAgent),
21
+ } }, { provider: PROVIDER, fetcher: this.options.fetcher, maxBytes: 1_000_000, timeoutMs: Math.max(1, Math.floor(timeoutMs)),
22
+ redirect: 'manual', allowHttpStatuses: [...REDIRECTS, 401, 403, 404, 410] });
23
+ if ([401, 403].includes(response.status))
24
+ throw new ChallengeError(PROVIDER, 'Wanjia refused its guest request');
25
+ // An unknown waybill is HTTP 200 too; anything else is a moved route.
26
+ if (response.status !== 200)
27
+ throw new TransportError(PROVIDER, 'Wanjia tracking endpoint moved', { status: response.status });
28
+ return parseWanjia(decodeText(bytes), number);
29
+ };
30
+ // A request that fails to reach the server, or hangs, gets one more try in the rest of the budget.
31
+ return runSteps({ carrier: 'wanjia-logistics', budgetMs: context.budgetMs ?? 15_000, signal: context.signal,
32
+ recorder: this.options.recorder ?? NOOP_RECORDER }, [
33
+ { id: 'direct', run: ({ signal, remainingMs }) => read(signal, firstAttemptMs(remainingMs)) },
34
+ networkRetryStep(({ signal, remainingMs }) => read(signal, remainingMs)),
35
+ ]);
36
+ }
37
+ }
38
+ export const adapter = environment => {
39
+ const tracker = new WanjiaTracker({ fetcher: environment.fetcher, recorder: environment.recorder, userAgent: environment.userAgent });
40
+ return { id: 'wanjia-logistics', recordsSteps: true, steps: ['direct', 'retry'], track: (input, context) => tracker.fetch(input.number, context) };
41
+ };
@@ -0,0 +1,77 @@
1
+ {
2
+ "id": "wanjia-logistics",
3
+ "displayName": "Wanjia Logistics",
4
+ "aliases": [
5
+ "万家物流",
6
+ "Manco Logistics",
7
+ "万家物流(上海)有限公司"
8
+ ],
9
+ "region": {
10
+ "countries": [
11
+ "CN"
12
+ ]
13
+ },
14
+ "brand": {
15
+ "color": "#d7261e"
16
+ },
17
+ "selectable": true,
18
+ "timezone": "Asia/Shanghai",
19
+ "tracking": {
20
+ "mode": "automatic",
21
+ "adapter": "wanjia-logistics",
22
+ "steps": [
23
+ "direct",
24
+ "retry"
25
+ ],
26
+ "localClocks": true
27
+ },
28
+ "capabilities": [
29
+ "history",
30
+ "location",
31
+ "provider_code"
32
+ ],
33
+ "portal": {
34
+ "canaryUrl": "https://t.17track.net/",
35
+ "shows": [
36
+ "status",
37
+ "history",
38
+ "location",
39
+ "driver_name",
40
+ "driver_phone",
41
+ "pickup_code",
42
+ "pickup_point",
43
+ "pickup_point_address",
44
+ "partner_tracking_number"
45
+ ],
46
+ "scraped": [
47
+ "status",
48
+ "history",
49
+ "location",
50
+ "provider_code",
51
+ "pickup_point",
52
+ "pickup_point_address",
53
+ "partner_tracking_number"
54
+ ],
55
+ "discarded": [
56
+ "driver_name",
57
+ "driver_phone",
58
+ "pickup_code"
59
+ ],
60
+ "unavailable": [
61
+ "weight",
62
+ "service_name",
63
+ "eta",
64
+ "pieces",
65
+ "origin",
66
+ "destination",
67
+ "offset_timestamps",
68
+ "proof_of_delivery",
69
+ "signatory",
70
+ "sender_name",
71
+ "recipient_name",
72
+ "recipient_address"
73
+ ]
74
+ },
75
+ "links": [],
76
+ "detection": []
77
+ }
@@ -0,0 +1,114 @@
1
+ {
2
+ "carrier": "wanjia-logistics",
3
+ "records": [
4
+ {
5
+ "number": "37100001554334",
6
+ "role": "shipment",
7
+ "evidence": "public_shipment_report",
8
+ "source": {
9
+ "url": "https://www.kuaidi.com/all/wanjiawuliu.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
+ "dpd",
22
+ "chronopost",
23
+ "ciblex",
24
+ "seur",
25
+ "brt",
26
+ "delhivery",
27
+ "dhl-ecommerce-uk",
28
+ "dpd-be",
29
+ "dpd-de",
30
+ "dpd-hu",
31
+ "dpd-nl",
32
+ "dpd-pt",
33
+ "dpd-uk",
34
+ "gls-nl",
35
+ "jadlog"
36
+ ]
37
+ },
38
+ "note": "A waybill kuaidi.com's Wanjia page lists. Wanjia's tracker answers it with a parcel collected in Shishi, carried through Quanzhou and Tianjin, handed to YTO for the last leg and collected from a pickup point in Ninghe."
39
+ },
40
+ {
41
+ "number": "37300000040744",
42
+ "role": "shipment",
43
+ "evidence": "public_shipment_report",
44
+ "source": {
45
+ "url": "https://www.kuaidi.com/all/wanjiawuliu.html",
46
+ "date": "2026-11-22",
47
+ "dateKind": "capture",
48
+ "access": "full_page"
49
+ },
50
+ "context": {
51
+ "assessment": "confirmed"
52
+ },
53
+ "expect": {
54
+ "carrier": "unknown",
55
+ "confidence": "low",
56
+ "candidates": [
57
+ "dpd",
58
+ "mondial-relay",
59
+ "chronopost",
60
+ "ciblex",
61
+ "seur",
62
+ "brt",
63
+ "delhivery",
64
+ "dhl-ecommerce-uk",
65
+ "dpd-be",
66
+ "dpd-de",
67
+ "dpd-hu",
68
+ "dpd-nl",
69
+ "dpd-pt",
70
+ "dpd-uk",
71
+ "gls-nl",
72
+ "jadlog"
73
+ ]
74
+ },
75
+ "note": "A waybill kuaidi.com's Wanjia page lists. Wanjia's tracker answers it with a parcel collected in Zengcheng, sorted in Guangzhou and Fuzhou and left in a locker store in Xiamen."
76
+ },
77
+ {
78
+ "number": "37100001328551",
79
+ "role": "shipment",
80
+ "evidence": "public_shipment_report",
81
+ "source": {
82
+ "url": "https://www.kuaidi.com/all/wanjiawuliu.html",
83
+ "date": "2026-11-22",
84
+ "dateKind": "capture",
85
+ "access": "full_page"
86
+ },
87
+ "context": {
88
+ "assessment": "confirmed"
89
+ },
90
+ "expect": {
91
+ "carrier": "unknown",
92
+ "confidence": "low",
93
+ "candidates": [
94
+ "dpd",
95
+ "chronopost",
96
+ "ciblex",
97
+ "seur",
98
+ "brt",
99
+ "delhivery",
100
+ "dhl-ecommerce-uk",
101
+ "dpd-be",
102
+ "dpd-de",
103
+ "dpd-hu",
104
+ "dpd-nl",
105
+ "dpd-pt",
106
+ "dpd-uk",
107
+ "gls-nl",
108
+ "jadlog"
109
+ ]
110
+ },
111
+ "note": "A waybill kuaidi.com's Wanjia page lists. Wanjia's tracker answers it with a parcel collected in Tianmen, carried through Wuhan and Xi'an to a transfer warehouse in Xianyang that relabels it for the onward network."
112
+ }
113
+ ]
114
+ }
@@ -0,0 +1,15 @@
1
+ import type { CarrierResult } from '../../core/result/index.js';
2
+ export declare const PROVIDER = "Wanjia Logistics";
3
+ /** The site's 货物追踪 page, whose script frames the page below for the waybill typed in. */
4
+ export declare const WANJIA_PAGE = "http://www.manco-logistics.com/h-col-122.html";
5
+ export declare const WANJIA_ENDPOINT = "http://cn.manco-logistics.com:8606/WangJTaoBaoInterface/wjwl/query.do";
6
+ /** The waybills on kuaidi.com's Wanjia page are fourteen digits. */
7
+ export declare function normalizeWanjiaNumber(raw: string): string;
8
+ export declare function wanjiaLookupUrl(number: string): string;
9
+ /**
10
+ * The tracking page for one waybill: a heading naming it, then its scans newest first on China
11
+ * wall clocks. The heading must be the whole waybill asked; a page saying it found nothing is a
12
+ * waybill Wanjia does not know. Wanjia hands its parcels to national networks, whose scans fill
13
+ * the history; a row opens with the region it happened in, which is its location.
14
+ */
15
+ export declare function parseWanjia(html: string, raw: string): CarrierResult;