universal-parcel-scraper 0.960.1-main.5207 → 0.960.2-main.5209

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/README.md CHANGED
@@ -163,7 +163,7 @@ the command line's `track --source ParcelsApp` does the same.
163
163
  <!-- GENERATED:stages -->
164
164
  <img src="docs/assets/stages.svg" alt="DHL: Die Sendung wurde in das Zustellfahrzeug geladen.; Mondial Relay: En cours de livraison; Correios Brazil: Objeto saiu para entrega ao destinatário; Correos Express: EN REPARTO; Yamato Transport: 配達中; La Poste / Colissimo: DISTOU. All are filed under out_for_delivery." width="760">
165
165
 
166
- The carrier folders record 18,767 such statuses, each filed under one stage.
166
+ The carrier folders record 18,770 such statuses, each filed under one stage.
167
167
  <!-- /GENERATED:stages -->
168
168
 
169
169
  Wording nobody recorded yet goes through a classifier that reads seven European languages.
@@ -19,10 +19,13 @@ const OFFSET = /^[+-]\d{2}:\d{2}$/;
19
19
  const HOME_ZONE = SEVENTEENFEIA_HOME_ZONE;
20
20
  /**
21
21
  * 17FEIA's steps at its warehouse in China before the flight, from its
22
- * receipt. The backend writes them on Beijing time; the offset they carry is
23
- * the destination line's, whatever the step's clock.
22
+ * receipt, and the domestic return that sends a parcel back from there. The
23
+ * backend writes them on Beijing time; the offset they carry is the
24
+ * destination line's, whatever the step's clock.
24
25
  */
25
- const WAREHOUSE_STEPS = new Set(['包裹在去设施路上', '仓库收货', '订单待客户确认', '订单已确认', '订单已出库', '出口报关中']);
26
+ const WAREHOUSE_STEPS = new Set(['包裹在去设施路上', '仓库收货', '订单待客户确认', '订单已确认', '订单已出库', '出口报关中', '国内退回']);
27
+ /** A line's system name where a place would go, as "DE-DHL-server" on a domestic return: no place. */
28
+ const SYSTEM_PLACE = /-server$/i;
26
29
  // States whose places keep different clocks, so a state does not settle a clock's zone.
27
30
  const SPLIT_STATES = new Set(['AK', 'AZ', 'FL', 'ID', 'IN', 'KS', 'KY', 'MI', 'ND', 'NE', 'NV', 'OR', 'SD', 'TN', 'TX']);
28
31
  const MAX_ROWS = 500;
@@ -108,7 +111,7 @@ function projectRow(row, readAt) {
108
111
  // A row dated after the read is not a scan yet.
109
112
  if (at > readAt)
110
113
  return null;
111
- const place = text(row, 'location', 200) || text(row, 'city', 200);
114
+ const place = [text(row, 'location', 200), text(row, 'city', 200)].find((part) => part && !SYSTEM_PLACE.test(part)) ?? '';
112
115
  // A relayed place often ends with its country already, as `Town, MA, US` or `FR`.
113
116
  const named = /^[A-Z]{2}$/.test(country) && place.split(/,\s*/).at(-1)?.toUpperCase() !== country;
114
117
  const location = [place, named ? country : ''].filter(Boolean).join(', ');
@@ -40,6 +40,8 @@ const LABELS = new Map([
40
40
  // Handed in at the partner's depot, before the partner's own first scan.
41
41
  ['已交仓,等待上网', 'in_transit'],
42
42
  ['成功签收', 'delivered'],
43
+ // The parcel goes back to the sender in China instead of leaving the country.
44
+ ['国内退回', 'returned'],
43
45
  ]);
44
46
  /** The label on rows relayed from the delivering partner: their wording is the partner's. */
45
47
  export const RELAYED_LABEL = '运输途中';
@@ -31,6 +31,7 @@
31
31
  {"code": "运输途中", "wording": "The international shipment has been processed in the parcel center of origin", "stage": "in_transit", "language": "en", "confirmedBy": "live", "note": "Relayed from DHL in Germany, with DHL's place, country and offset. The label marks every relayed row; the stage comes from the partner's wording."},
32
32
  {"code": "运输途中", "wording": "The international shipment has been processed in the export parcel center", "stage": "in_transit", "language": "en", "confirmedBy": "live", "note": "Relayed from DHL in Germany."},
33
33
  {"code": "运输途中", "wording": "The shipment will be transported to the destination country/destination area and, from there, handed over to the delivery organization.", "stage": "in_transit", "language": "en", "confirmedBy": "live", "note": "Relayed from DHL in Germany, for a parcel bound for France."},
34
- {"code": "成功签收", "stage": "delivered", "language": "zh", "confirmedBy": "bundle", "note": "The last box of the tracking page's progress rail."}
34
+ {"code": "成功签收", "stage": "delivered", "language": "zh", "confirmedBy": "bundle", "note": "The last box of the tracking page's progress rail."},
35
+ {"code": "国内退回", "wording": "包裹已做国内退回处理", "stage": "returned", "language": "zh", "confirmedBy": "live", "note": "A domestic return: after the warehouse confirmed the order, the parcel goes back to the sender in China instead of leaving the country."}
35
36
  ]
36
37
  }
@@ -15,6 +15,8 @@ const labels = {
15
15
  'UNKNOWN/INCOMPLETE CONSIGNEE': { status: 'exception', stage: 'failed_attempt' },
16
16
  // The courier found no one in and left a notice.
17
17
  'NOTICE OF ATTEMPTED DELIVERY': { status: 'exception', stage: 'failed_attempt' },
18
+ // The partner abroad found no one in on its round; the next round or a return follows.
19
+ 'ABSENT AFTER ATTEMPT.DELIVERY': { status: 'exception', stage: 'failed_attempt' },
18
20
  // A public demonstration holds the parcel up.
19
21
  TURMOIL: { status: 'exception', stage: 'exception' },
20
22
  'RETURNED TO SENDER': { status: 'exception', stage: 'returned' },
@@ -82,6 +82,13 @@
82
82
  "confirmedBy": "live",
83
83
  "note": "The courier found no one in and left a notice."
84
84
  },
85
+ {
86
+ "wording": "ABSENT AFTER ATTEMPT.DELIVERY",
87
+ "language": "en",
88
+ "stage": "failed_attempt",
89
+ "confirmedBy": "live",
90
+ "note": "The partner abroad that delivers the parcel found no one in on its round; another round or the return to the sender follows."
91
+ },
85
92
  {
86
93
  "wording": "TURMOIL",
87
94
  "language": "en",
@@ -306,6 +306,13 @@
306
306
  "confirmedBy": "live",
307
307
  "note": "A hub on the way to the delivering carrier, after customs released the parcel at the gateway airport."
308
308
  },
309
+ {
310
+ "wording": "Parcel arrived at branch",
311
+ "stage": "in_transit",
312
+ "language": "en",
313
+ "confirmedBy": "live",
314
+ "note": "The delivering carrier's local branch, after the hub: the parcel waits there for its round, not for collection."
315
+ },
309
316
  {
310
317
  "wording": "货物电子信息已经收到",
311
318
  "stage": "registered",
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Universal Parcel Scraper",
5
- "version": "0.960.1-main.5207"
5
+ "version": "0.960.2-main.5209"
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.960.1-main.5207",
3
+ "version": "0.960.2-main.5209",
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",