universal-parcel-scraper 0.178.0-main.1306 → 0.181.0

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 (49) hide show
  1. package/README.md +3 -3
  2. package/data/catalog.json +56 -4
  3. package/data/coverage-summary.json +2 -2
  4. package/data/detection-golden.json +16 -0
  5. package/dist/browser/scraper.js +49 -6
  6. package/dist/carriers/5post/adapter.d.ts +22 -0
  7. package/dist/carriers/5post/adapter.js +75 -0
  8. package/dist/carriers/5post/carrier.json +44 -7
  9. package/dist/carriers/5post/numbers.json +22 -22
  10. package/dist/carriers/5post/parser.d.ts +23 -0
  11. package/dist/carriers/5post/parser.js +164 -0
  12. package/dist/carriers/5post/status.d.ts +9 -0
  13. package/dist/carriers/5post/status.js +100 -0
  14. package/dist/carriers/5post/statuses.json +63 -3
  15. package/dist/carriers/ems-vietnam/adapter.d.ts +17 -0
  16. package/dist/carriers/ems-vietnam/adapter.js +60 -0
  17. package/dist/carriers/ems-vietnam/carrier.json +65 -7
  18. package/dist/carriers/ems-vietnam/parser.d.ts +22 -0
  19. package/dist/carriers/ems-vietnam/parser.js +216 -0
  20. package/dist/carriers/ems-vietnam/status.d.ts +7 -0
  21. package/dist/carriers/ems-vietnam/status.js +55 -0
  22. package/dist/carriers/ems-vietnam/statuses.json +16 -0
  23. package/dist/carriers/israel-post/adapter.d.ts +14 -0
  24. package/dist/carriers/israel-post/adapter.js +57 -0
  25. package/dist/carriers/israel-post/carrier.json +40 -7
  26. package/dist/carriers/israel-post/parser.d.ts +6 -0
  27. package/dist/carriers/israel-post/parser.js +77 -0
  28. package/dist/carriers/israel-post/status.d.ts +4 -0
  29. package/dist/carriers/israel-post/status.js +15 -0
  30. package/dist/carriers/israel-post/statuses.json +37 -1
  31. package/dist/carriers/mayiyinfu/carrier.json +54 -0
  32. package/dist/carriers/mayiyinfu/numbers.json +17 -0
  33. package/dist/carriers/mayiyinfu/statuses.json +16 -0
  34. package/dist/carriers/pecom/adapter.d.ts +17 -0
  35. package/dist/carriers/pecom/adapter.js +60 -0
  36. package/dist/carriers/pecom/carrier.json +52 -7
  37. package/dist/carriers/pecom/parser.d.ts +13 -0
  38. package/dist/carriers/pecom/parser.js +214 -0
  39. package/dist/carriers/pecom/status.d.ts +7 -0
  40. package/dist/carriers/pecom/status.js +52 -0
  41. package/dist/carriers/pecom/statuses.json +9 -7
  42. package/dist/core/catalog/statusMaps.js +9 -4
  43. package/dist/data/catalog.json +56 -4
  44. package/dist/generated/catalog.d.ts +38 -5
  45. package/dist/generated/catalog.js +59 -5
  46. package/dist/generated/recognition.js +2 -0
  47. package/dist/generated/registry.js +13 -4
  48. package/dist/server/openapi.json +1 -1
  49. package/package.json +1 -1
package/README.md CHANGED
@@ -13,9 +13,9 @@ The engine behind [Peek](https://peektracker.com) ([GitHub](https://github.com/p
13
13
  [![License: Apache-2.0](https://img.shields.io/badge/core-Apache--2.0-blue.svg)](LICENSE)
14
14
 
15
15
  <!-- GENERATED:summary -->
16
- **3,500+ carriers** through **252 dedicated adapters** and **5 universal fallbacks**
16
+ **3,500+ carriers** through **256 dedicated adapters** and **5 universal fallbacks**
17
17
 
18
- <sub>493 catalog entries · 113 countries represented</sub>
18
+ <sub>494 catalog entries · 113 countries represented</sub>
19
19
  <!-- /GENERATED:summary -->
20
20
 
21
21
  [Try it](#try-it) · [Ways to run it](#ways-to-run-it) · [Benchmark](#benchmark) · [Carriers](carriers/) · [Add a carrier](CONTRIBUTING.md)
@@ -155,7 +155,7 @@ createTracker({ providers: ['ParcelsApp', 'Ship24', '17TRACK', 'Postal Ninja', '
155
155
  <!-- GENERATED:stages -->
156
156
  <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">
157
157
 
158
- The carrier folders record 9,488 such statuses, each filed under one stage.
158
+ The carrier folders record 9,582 such statuses, each filed under one stage.
159
159
  <!-- /GENERATED:stages -->
160
160
 
161
161
  Wording nobody recorded yet goes through a classifier that reads seven European languages.
package/data/catalog.json CHANGED
@@ -4927,7 +4927,7 @@
4927
4927
  "timezone": "Europe/Moscow",
4928
4928
  "tracking": {
4929
4929
  "mode": "automatic",
4930
- "adapter": "universal"
4930
+ "adapter": "5post"
4931
4931
  },
4932
4932
  "canaryUrl": "https://fivepost.ru/",
4933
4933
  "trackingUrlTemplate": "https://fivepost.ru/tracking?id={trackingNumber}",
@@ -9443,7 +9443,10 @@
9443
9443
  "timezone": "Asia/Ho_Chi_Minh",
9444
9444
  "tracking": {
9445
9445
  "mode": "automatic",
9446
- "adapter": "universal"
9446
+ "adapter": "ems-vietnam",
9447
+ "recognitionRank": 962,
9448
+ "recognitionPattern": "^E[A-Z]\\d{9}VN$",
9449
+ "localClocks": true
9447
9450
  },
9448
9451
  "canaryUrl": "https://www.ems.com.vn/tra-cuu/tra-cuu-buu-gui",
9449
9452
  "trackingUrlTemplate": "https://ems.com.vn/tra-cuu/tra-cuu-buu-gui?code={trackingNumber}",
@@ -11665,7 +11668,9 @@
11665
11668
  "timezone": "Asia/Jerusalem",
11666
11669
  "tracking": {
11667
11670
  "mode": "automatic",
11668
- "adapter": "universal"
11671
+ "adapter": "israel-post",
11672
+ "recognitionRank": 81,
11673
+ "localClocks": true
11669
11674
  },
11670
11675
  "canaryUrl": "https://israelpost.co.il/",
11671
11676
  "trackingUrlTemplate": "https://israelpost.co.il/%D7%9E%D7%A2%D7%A7%D7%91-%D7%9E%D7%A9%D7%9C%D7%95%D7%97%D7%99%D7%9D?OpenForm&itemcode={trackingNumber}",
@@ -11696,6 +11701,12 @@
11696
11701
  {
11697
11702
  "pattern": "^\\d{11}IL$",
11698
11703
  "confidence": "high"
11704
+ },
11705
+ {
11706
+ "pattern": "^[A-Z]{2}\\d{9}IL$",
11707
+ "confidence": "low",
11708
+ "checksum": "s10",
11709
+ "preferred": true
11699
11710
  }
11700
11711
  ]
11701
11712
  },
@@ -13417,6 +13428,46 @@
13417
13428
  ],
13418
13429
  "detectionRules": []
13419
13430
  },
13431
+ "mayiyinfu": {
13432
+ "displayName": "Mayi Yinfu",
13433
+ "color": "#000000",
13434
+ "aliases": [
13435
+ "Mayiyinfu",
13436
+ "MYYF",
13437
+ "蚂蚁银服",
13438
+ "螞蟻銀服",
13439
+ "广东蚂蚁银服国际物流有限公司",
13440
+ "Mayi Yinfu International Logistics"
13441
+ ],
13442
+ "countries": [
13443
+ "CN"
13444
+ ],
13445
+ "selectable": true,
13446
+ "timezone": "Asia/Shanghai",
13447
+ "tracking": {
13448
+ "mode": "automatic",
13449
+ "adapter": "universal"
13450
+ },
13451
+ "canaryUrl": "https://t.17track.net/",
13452
+ "linkRules": [
13453
+ {
13454
+ "domains": [
13455
+ "mayiyinfu.com.cn",
13456
+ "www.mayiyinfu.com.cn"
13457
+ ],
13458
+ "pathPattern": "^/trackIndex\\.htm$",
13459
+ "params": [
13460
+ "documentCode"
13461
+ ]
13462
+ }
13463
+ ],
13464
+ "detectionRules": [
13465
+ {
13466
+ "pattern": "^MY\\d{10}US$",
13467
+ "confidence": "high"
13468
+ }
13469
+ ]
13470
+ },
13420
13471
  "mds-collivery": {
13421
13472
  "displayName": "MDS Collivery",
13422
13473
  "color": "#00823d",
@@ -14837,7 +14888,8 @@
14837
14888
  "timezone": "Europe/Moscow",
14838
14889
  "tracking": {
14839
14890
  "mode": "automatic",
14840
- "adapter": "universal"
14891
+ "adapter": "pecom",
14892
+ "localClocks": true
14841
14893
  },
14842
14894
  "canaryUrl": "https://pecom.ru/services-are/order-status/",
14843
14895
  "trackingUrlTemplate": "https://pecom.ru/services-are/order-status/?code={trackingNumber}",
@@ -1,6 +1,6 @@
1
1
  {
2
- "catalog": 493,
3
- "activeAdapters": 252,
2
+ "catalog": 494,
3
+ "activeAdapters": 256,
4
4
  "countries": 113,
5
5
  "referenceCarriers": 100,
6
6
  "comparison": {
@@ -48428,6 +48428,7 @@
48428
48428
  "intl-post"
48429
48429
  ],
48430
48430
  "asked": [
48431
+ "israel-post",
48431
48432
  "chronopost"
48432
48433
  ]
48433
48434
  },
@@ -51236,6 +51237,7 @@
51236
51237
  "intl-post"
51237
51238
  ],
51238
51239
  "asked": [
51240
+ "israel-post",
51239
51241
  "chronopost"
51240
51242
  ]
51241
51243
  },
@@ -51288,6 +51290,7 @@
51288
51290
  "intl-post"
51289
51291
  ],
51290
51292
  "asked": [
51293
+ "israel-post",
51291
51294
  "chronopost"
51292
51295
  ]
51293
51296
  },
@@ -57580,6 +57583,7 @@
57580
57583
  "intl-post"
57581
57584
  ],
57582
57585
  "asked": [
57586
+ "israel-post",
57583
57587
  "chronopost"
57584
57588
  ]
57585
57589
  },
@@ -57591,6 +57595,7 @@
57591
57595
  "intl-post"
57592
57596
  ],
57593
57597
  "asked": [
57598
+ "israel-post",
57594
57599
  "chronopost"
57595
57600
  ]
57596
57601
  },
@@ -58670,6 +58675,14 @@
58670
58675
  "gdex"
58671
58676
  ]
58672
58677
  },
58678
+ {
58679
+ "input": "MY9900000001US",
58680
+ "carrier": "mayiyinfu",
58681
+ "confidence": "high",
58682
+ "candidates": [
58683
+ "mayiyinfu"
58684
+ ]
58685
+ },
58673
58686
  {
58674
58687
  "input": "MYCV060080099GB",
58675
58688
  "carrier": "unknown",
@@ -62835,6 +62848,7 @@
62835
62848
  "intl-post"
62836
62849
  ],
62837
62850
  "asked": [
62851
+ "israel-post",
62838
62852
  "chronopost"
62839
62853
  ]
62840
62854
  },
@@ -62954,6 +62968,7 @@
62954
62968
  "intl-post"
62955
62969
  ],
62956
62970
  "asked": [
62971
+ "israel-post",
62957
62972
  "chronopost"
62958
62973
  ]
62959
62974
  },
@@ -63064,6 +63079,7 @@
63064
63079
  "intl-post"
63065
63080
  ],
63066
63081
  "asked": [
63082
+ "israel-post",
63067
63083
  "chronopost"
63068
63084
  ]
63069
63085
  },
@@ -4068,7 +4068,7 @@ var Ae = {
4068
4068
  timezone: "Europe/Moscow",
4069
4069
  tracking: {
4070
4070
  mode: "automatic",
4071
- adapter: "universal"
4071
+ adapter: "5post"
4072
4072
  },
4073
4073
  canaryUrl: "https://fivepost.ru/",
4074
4074
  trackingUrlTemplate: "https://fivepost.ru/tracking?id={trackingNumber}",
@@ -7342,7 +7342,10 @@ var Ae = {
7342
7342
  timezone: "Asia/Ho_Chi_Minh",
7343
7343
  tracking: {
7344
7344
  mode: "automatic",
7345
- adapter: "universal"
7345
+ adapter: "ems-vietnam",
7346
+ recognitionRank: 962,
7347
+ recognitionPattern: "^E[A-Z]\\d{9}VN$",
7348
+ localClocks: !0
7346
7349
  },
7347
7350
  canaryUrl: "https://www.ems.com.vn/tra-cuu/tra-cuu-buu-gui",
7348
7351
  trackingUrlTemplate: "https://ems.com.vn/tra-cuu/tra-cuu-buu-gui?code={trackingNumber}",
@@ -9001,7 +9004,9 @@ var Ae = {
9001
9004
  timezone: "Asia/Jerusalem",
9002
9005
  tracking: {
9003
9006
  mode: "automatic",
9004
- adapter: "universal"
9007
+ adapter: "israel-post",
9008
+ recognitionRank: 81,
9009
+ localClocks: !0
9005
9010
  },
9006
9011
  canaryUrl: "https://israelpost.co.il/",
9007
9012
  trackingUrlTemplate: "https://israelpost.co.il/%D7%9E%D7%A2%D7%A7%D7%91-%D7%9E%D7%A9%D7%9C%D7%95%D7%97%D7%99%D7%9D?OpenForm&itemcode={trackingNumber}",
@@ -9018,6 +9023,11 @@ var Ae = {
9018
9023
  detectionRules: [{
9019
9024
  pattern: "^\\d{11}IL$",
9020
9025
  confidence: "high"
9026
+ }, {
9027
+ pattern: "^[A-Z]{2}\\d{9}IL$",
9028
+ confidence: "low",
9029
+ checksum: "s10",
9030
+ preferred: !0
9021
9031
  }]
9022
9032
  },
9023
9033
  "j-and-t-br": {
@@ -10278,6 +10288,35 @@ var Ae = {
10278
10288
  }],
10279
10289
  detectionRules: []
10280
10290
  },
10291
+ mayiyinfu: {
10292
+ displayName: "Mayi Yinfu",
10293
+ color: "#000000",
10294
+ aliases: [
10295
+ "Mayiyinfu",
10296
+ "MYYF",
10297
+ "蚂蚁银服",
10298
+ "螞蟻銀服",
10299
+ "广东蚂蚁银服国际物流有限公司",
10300
+ "Mayi Yinfu International Logistics"
10301
+ ],
10302
+ countries: ["CN"],
10303
+ selectable: !0,
10304
+ timezone: "Asia/Shanghai",
10305
+ tracking: {
10306
+ mode: "automatic",
10307
+ adapter: "universal"
10308
+ },
10309
+ canaryUrl: "https://t.17track.net/",
10310
+ linkRules: [{
10311
+ domains: ["mayiyinfu.com.cn", "www.mayiyinfu.com.cn"],
10312
+ pathPattern: "^/trackIndex\\.htm$",
10313
+ params: ["documentCode"]
10314
+ }],
10315
+ detectionRules: [{
10316
+ pattern: "^MY\\d{10}US$",
10317
+ confidence: "high"
10318
+ }]
10319
+ },
10281
10320
  "mds-collivery": {
10282
10321
  displayName: "MDS Collivery",
10283
10322
  color: "#00823d",
@@ -11334,7 +11373,8 @@ var Ae = {
11334
11373
  timezone: "Europe/Moscow",
11335
11374
  tracking: {
11336
11375
  mode: "automatic",
11337
- adapter: "universal"
11376
+ adapter: "pecom",
11377
+ localClocks: !0
11338
11378
  },
11339
11379
  canaryUrl: "https://pecom.ru/services-are/order-status/",
11340
11380
  trackingUrlTemplate: "https://pecom.ru/services-are/order-status/?code={trackingNumber}",
@@ -15118,7 +15158,7 @@ var Ae = {
15118
15158
  rawPattern: "^\\d{2}-[A-Z0-9]{6}(?:[A-Z0-9]|[A-Z0-9]{4})?-ZR$"
15119
15159
  }]
15120
15160
  }
15121
- }, je = /* @__PURE__ */ "swiss-post.swiss-post-cargo.quickpac.planzer.aliexpress.sunyou.hermes.spring-gds.postlogistics.dachser.dhl.dhl-ecommerce.ups.amazon-logistics.amazon-shipping.fedex.gls-ch.dpd.dpd-fr.mondial-relay.relais-colis.la-poste.chronopost.gls-fr.colis-prive.geodis.colisweb.c-chez-vous.heppner.ciblex.paack.asendia.shipup.india-post.hermes-de.gls-de.delivengo.intl-post.unknown.royal-mail.parcelforce.evri.inpost.an-post.bpost.austrian-post.postnord.posti.correos-express.seur.mrw.nacex.ctt.ctt-express.poste-italiane.brt.ecoscooting.tipsa.ukrposhta.usps.canada-post.purolator.canpar.ontrac.speedx.uniuni.landmark-global.old-dominion.spee-dee.gofo.estafeta.correios-br.correos-chile.yunexpress.four-px.blue-dart.delhivery.nz-post.singapore-post.japan-post.sf-express.sto.yunda.yto.zto.jd-logistics.yamato.korea-post.thailand-post.dtdc.australia-post.hongkong-post.pos-malaysia.ninja-van.china-post.packeta.poczta-polska.bring-posten.aramex.tnt.correos-spain.yanwen.the-courier-guy.j-and-t.ems.139express.17feia.2go.4-72.5post.99minutos.a-duie-pyle.aaa-cooper.abf-freight.acs-courier.aeropost.aex-paraguay.akash-ganga.aks-express.alem-tat.algerie-poste.allegro-one.ampm.andreani.anjun.anteraja.apc-overnight.apc-postal-logistics.aramex-au.aramex-nz.aras-kargo.arrow-xl.asyad-express.averitt.aymakan.azerpost.azul-cargo.bangladesh-post.barid-al-maghrib.belpost.best-express-vn.best-transport.better-trucks.bex-express.blue-express.blueex.border-express.bosta.box-now.buffalo-ex.bulgarian-posts.burd-delivery.cacesa.cargus.castores.cdek.cdl.celeritas.central-transport.ceska-posta.ceva-logistics.chazki.chilexpress.chit-chats.chunghwa-post.chunil.city-express-rs.citylink-express.citysprint.cj-logistics.cj-packet.cne.coordinadora.correo-argentino.correo-uruguayo.correos-de-mexico.courier-center.courier-it.couriersplease.cruz-del-sur.cse-russia.cycloon.cyprus-post.d-express.dai-post.danske-fragtmaend.dao.day-ross.daylight-transport.dayton-freight.dellin.deppon.deprisa.dhl-ecommerce-es.dhl-ecommerce-nl.dhl-ecommerce-pl.dhl-ecommerce-uk.dhl-express.dhl-freight.dhlink.direct-freight-express.dohrn-transfer.domex.dpd-de.dpd-ie.dpd-pl.dpd-uk.dropp.dsv.dx.dynalogic.early-bird.ecms-express.econt.ecourier.egypt-post.ekart.elta.emile.emirates-post.ems-vietnam.energia-tk.envia-colombia.envialia.epost-global.equick.estes.ethiopian-post.euroexpress-ba.europochta.evri-uk.express-one.fan-courier.fargo-courier.flash-express.flash-express-ph.followmont.forward-air.forza-delivery.foxpost.fukuyama.gati.gdex.gebrueder-weiss.geis.geniki-taxydromiki.geodis-pl.ghana-post.ghn.ghtk.gls-es.gls-it.go-express.gofo-fr.gofo-it.groupe-guilbault.gs-postbox.guatex.gzyl.hanjin.hapdong.haypost.hct-logistics.helthjem.hepsijet.hi-trans.hrvatska-posta.hunter-express.hywl.ics-courier.idexpress.ids-logistik.ilyang-logis.imile.instabox.intelcom.internet-express.interrapidisimo.israel-post.j-and-t-br.j-and-t-cargo.j-and-t-cn.j-and-t-mx.jadlog.jamaica-post.janio.jersey-post.jhgj.jitsu.jne.jordan-post.jrs-express.jrt.kazpost.kerry-tj.kex.kex-express-hk.kit-tk.kolay-gelsin.ktd.kuehne-nagel.kunyoung.la-poste-tunisienne.laar-courier.latvijas-pasts.lbc-express.leopards-courier.libanpost.lietuvos-pastas.line-clear.lion-parcel.logen.loggi.loomis-express.lotte-global.lso.m-and-p.madhur-courier.magyar-posta.mailamericas.mainfreight.maltapost.maritime-ontario.matkahuolto.mauritius-post.mds-collivery.meest.midland-transport.mng-kargo.mtscn.mylerz.naqel.nationex.ncs-courier.nepal-post.nhat-tin.nim-express.nipost.nippon-express.northline.nova-poshta.nz-couriers.oak-harbor.oca.olva-courier.omgo.omniva.orlen-paczka.osm-worldwide.overseas-express.ozon-logistics.pakistan-post.palletways.paperfly.paquetexpress.pargo.passport.pathao-courier.paxi.pbt.pecom.pelican-express.pfc-express.pilot-freight.pitt-ohio.polaris-transport.pos-indonesia.post-haste.post-luxembourg.posta-kenya.posta-moldovei.posta-north-macedonia.posta-romana.posta-shqiptare.posta-slovenije.posta-srbije.postaplus.postex.posturinn.ppl.professional-couriers.prompt-xpress.pronto-lanka.ptt.pullman-cargo.quantium-solutions.quiqup.raben.ram-hand-to-hand.redpack.redx.rl-carriers.roadie.roadrunner.rpx-indonesia.russian-post.saee.sagawa.saia.sameday.sapx-express.sat-ukraine.saudi-post.sbs-sokuhai.scg-express.seino.seko.sendex.sending.serpost.servientrega.seven-eleven-tw.sfc.shadowfax.shree-maruti.shree-nandan.sicepat.skroutz-last-mile.skynet-sa.skynet-worldwide.slgtrax.slovak-parcel-service.slovenska-posta.smsa-express.south-african-post-office.southeastern-freight-lines.speedaf.speedex.speedpak.speedy.spx-br.spx-id.spx-my.spx-ph.spx-th.spx-tw.spx-vn.sri-lanka-post.st-courier.stallion-express.starken.steadfast.sundarban-courier.surat-kargo.swiftx.t-cat.tanzania-posts.taxydema.tci-express.tcs-pakistan.tealca.team-global-express.tforce-freight.thhy.tiki.tirupati-courier.tnt-it.toptrans.total-express.trackon.tracx-logis.trans-o-flex.trendyol-express.tsjy.tst-cf-express.tufesa.ubi-smart-parcel.urbano.uzbekistan-post.vasp-expresso.venipak.via-cargo.viettel-post.vinted-go.vnpost.vrl-logistics.wahana.wanbexpress.ward-trucking.whistl.winit.xde-logistics.xdp.xpo-ltl.xpressbees.yalidine.yimidida.yurtici-kargo.zajil.zeleris.zheldor.zoom-ve.zr-express".split("."), Me = {
15161
+ }, je = /* @__PURE__ */ "swiss-post.swiss-post-cargo.quickpac.planzer.aliexpress.sunyou.hermes.spring-gds.postlogistics.dachser.dhl.dhl-ecommerce.ups.amazon-logistics.amazon-shipping.fedex.gls-ch.dpd.dpd-fr.mondial-relay.relais-colis.la-poste.chronopost.gls-fr.colis-prive.geodis.colisweb.c-chez-vous.heppner.ciblex.paack.asendia.shipup.india-post.hermes-de.gls-de.delivengo.intl-post.unknown.royal-mail.parcelforce.evri.inpost.an-post.bpost.austrian-post.postnord.posti.correos-express.seur.mrw.nacex.ctt.ctt-express.poste-italiane.brt.ecoscooting.tipsa.ukrposhta.usps.canada-post.purolator.canpar.ontrac.speedx.uniuni.landmark-global.old-dominion.spee-dee.gofo.estafeta.correios-br.correos-chile.yunexpress.four-px.blue-dart.delhivery.nz-post.singapore-post.japan-post.sf-express.sto.yunda.yto.zto.jd-logistics.yamato.korea-post.thailand-post.dtdc.australia-post.hongkong-post.pos-malaysia.ninja-van.china-post.packeta.poczta-polska.bring-posten.aramex.tnt.correos-spain.yanwen.the-courier-guy.j-and-t.ems.139express.17feia.2go.4-72.5post.99minutos.a-duie-pyle.aaa-cooper.abf-freight.acs-courier.aeropost.aex-paraguay.akash-ganga.aks-express.alem-tat.algerie-poste.allegro-one.ampm.andreani.anjun.anteraja.apc-overnight.apc-postal-logistics.aramex-au.aramex-nz.aras-kargo.arrow-xl.asyad-express.averitt.aymakan.azerpost.azul-cargo.bangladesh-post.barid-al-maghrib.belpost.best-express-vn.best-transport.better-trucks.bex-express.blue-express.blueex.border-express.bosta.box-now.buffalo-ex.bulgarian-posts.burd-delivery.cacesa.cargus.castores.cdek.cdl.celeritas.central-transport.ceska-posta.ceva-logistics.chazki.chilexpress.chit-chats.chunghwa-post.chunil.city-express-rs.citylink-express.citysprint.cj-logistics.cj-packet.cne.coordinadora.correo-argentino.correo-uruguayo.correos-de-mexico.courier-center.courier-it.couriersplease.cruz-del-sur.cse-russia.cycloon.cyprus-post.d-express.dai-post.danske-fragtmaend.dao.day-ross.daylight-transport.dayton-freight.dellin.deppon.deprisa.dhl-ecommerce-es.dhl-ecommerce-nl.dhl-ecommerce-pl.dhl-ecommerce-uk.dhl-express.dhl-freight.dhlink.direct-freight-express.dohrn-transfer.domex.dpd-de.dpd-ie.dpd-pl.dpd-uk.dropp.dsv.dx.dynalogic.early-bird.ecms-express.econt.ecourier.egypt-post.ekart.elta.emile.emirates-post.ems-vietnam.energia-tk.envia-colombia.envialia.epost-global.equick.estes.ethiopian-post.euroexpress-ba.europochta.evri-uk.express-one.fan-courier.fargo-courier.flash-express.flash-express-ph.followmont.forward-air.forza-delivery.foxpost.fukuyama.gati.gdex.gebrueder-weiss.geis.geniki-taxydromiki.geodis-pl.ghana-post.ghn.ghtk.gls-es.gls-it.go-express.gofo-fr.gofo-it.groupe-guilbault.gs-postbox.guatex.gzyl.hanjin.hapdong.haypost.hct-logistics.helthjem.hepsijet.hi-trans.hrvatska-posta.hunter-express.hywl.ics-courier.idexpress.ids-logistik.ilyang-logis.imile.instabox.intelcom.internet-express.interrapidisimo.israel-post.j-and-t-br.j-and-t-cargo.j-and-t-cn.j-and-t-mx.jadlog.jamaica-post.janio.jersey-post.jhgj.jitsu.jne.jordan-post.jrs-express.jrt.kazpost.kerry-tj.kex.kex-express-hk.kit-tk.kolay-gelsin.ktd.kuehne-nagel.kunyoung.la-poste-tunisienne.laar-courier.latvijas-pasts.lbc-express.leopards-courier.libanpost.lietuvos-pastas.line-clear.lion-parcel.logen.loggi.loomis-express.lotte-global.lso.m-and-p.madhur-courier.magyar-posta.mailamericas.mainfreight.maltapost.maritime-ontario.matkahuolto.mauritius-post.mayiyinfu.mds-collivery.meest.midland-transport.mng-kargo.mtscn.mylerz.naqel.nationex.ncs-courier.nepal-post.nhat-tin.nim-express.nipost.nippon-express.northline.nova-poshta.nz-couriers.oak-harbor.oca.olva-courier.omgo.omniva.orlen-paczka.osm-worldwide.overseas-express.ozon-logistics.pakistan-post.palletways.paperfly.paquetexpress.pargo.passport.pathao-courier.paxi.pbt.pecom.pelican-express.pfc-express.pilot-freight.pitt-ohio.polaris-transport.pos-indonesia.post-haste.post-luxembourg.posta-kenya.posta-moldovei.posta-north-macedonia.posta-romana.posta-shqiptare.posta-slovenije.posta-srbije.postaplus.postex.posturinn.ppl.professional-couriers.prompt-xpress.pronto-lanka.ptt.pullman-cargo.quantium-solutions.quiqup.raben.ram-hand-to-hand.redpack.redx.rl-carriers.roadie.roadrunner.rpx-indonesia.russian-post.saee.sagawa.saia.sameday.sapx-express.sat-ukraine.saudi-post.sbs-sokuhai.scg-express.seino.seko.sendex.sending.serpost.servientrega.seven-eleven-tw.sfc.shadowfax.shree-maruti.shree-nandan.sicepat.skroutz-last-mile.skynet-sa.skynet-worldwide.slgtrax.slovak-parcel-service.slovenska-posta.smsa-express.south-african-post-office.southeastern-freight-lines.speedaf.speedex.speedpak.speedy.spx-br.spx-id.spx-my.spx-ph.spx-th.spx-tw.spx-vn.sri-lanka-post.st-courier.stallion-express.starken.steadfast.sundarban-courier.surat-kargo.swiftx.t-cat.tanzania-posts.taxydema.tci-express.tcs-pakistan.tealca.team-global-express.tforce-freight.thhy.tiki.tirupati-courier.tnt-it.toptrans.total-express.trackon.tracx-logis.trans-o-flex.trendyol-express.tsjy.tst-cf-express.tufesa.ubi-smart-parcel.urbano.uzbekistan-post.vasp-expresso.venipak.via-cargo.viettel-post.vinted-go.vnpost.vrl-logistics.wahana.wanbexpress.ward-trucking.whistl.winit.xde-logistics.xdp.xpo-ltl.xpressbees.yalidine.yimidida.yurtici-kargo.zajil.zeleris.zheldor.zoom-ve.zr-express".split("."), Me = {
15122
15162
  "swiss-post": ["swiss-post-1", "swiss-post-2"],
15123
15163
  "swiss-post-cargo": ["swiss-post-cargo-sscc", "swiss-post-cargo-pl-reference"],
15124
15164
  quickpac: ["quickpac-1"],
@@ -15668,7 +15708,7 @@ var Ae = {
15668
15708
  ],
15669
15709
  "internet-express": [],
15670
15710
  interrapidisimo: [],
15671
- "israel-post": ["israel-post-1"],
15711
+ "israel-post": ["israel-post-1", "israel-post-s10"],
15672
15712
  "j-and-t-br": [],
15673
15713
  "j-and-t-cargo": ["j-and-t-cargo-1", "j-and-t-cargo-2"],
15674
15714
  "j-and-t-cn": ["j-and-t-cn-1"],
@@ -15715,6 +15755,7 @@ var Ae = {
15715
15755
  "maritime-ontario": [],
15716
15756
  matkahuolto: ["matkahuolto-1", "matkahuolto-2"],
15717
15757
  "mauritius-post": [],
15758
+ mayiyinfu: ["mayiyinfu-1"],
15718
15759
  "mds-collivery": [],
15719
15760
  meest: ["meest-1"],
15720
15761
  "midland-transport": [],
@@ -21024,6 +21065,7 @@ var nl = {
21024
21065
  ecoscooting: 655,
21025
21066
  elta: 150,
21026
21067
  emile: 480,
21068
+ "ems-vietnam": 962,
21027
21069
  envialia: 260,
21028
21070
  "epost-global": 65,
21029
21071
  estes: 20,
@@ -21051,6 +21093,7 @@ var nl = {
21051
21093
  hywl: 993,
21052
21094
  inpost: 820,
21053
21095
  interrapidisimo: 969,
21096
+ "israel-post": 81,
21054
21097
  "j-and-t": 530,
21055
21098
  "j-and-t-cargo": 910,
21056
21099
  jitsu: 85,
@@ -0,0 +1,22 @@
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
+ /** The guest tracking API of 5Post's app (ru.x5.omni). */
5
+ export declare const FIVE_POST_API = "https://api-omni.x5.ru/five-post-mobile-api/v3/mobile";
6
+ /** The orders the app lists under a number, one order's details, and that order's status history. */
7
+ export declare const fivePostUrls: (number: string, orderId?: string) => {
8
+ orders: string;
9
+ details: string;
10
+ history: string;
11
+ };
12
+ export declare class FivePostTracker {
13
+ #private;
14
+ private readonly options;
15
+ constructor(options?: {
16
+ fetcher?: typeof fetch;
17
+ recorder?: StepRecorder;
18
+ userAgent?: string;
19
+ });
20
+ fetch(raw: string, context?: TrackingContext): Promise<CarrierResult>;
21
+ }
22
+ export declare const adapter: AdapterFactory;
@@ -0,0 +1,75 @@
1
+ import { ChallengeError, IndeterminateError, SchemaError, 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 { FIVE_POST_MAX_BYTES, fivePostOrderId, normalizeFivePostNumber, parseFivePost, PROVIDER } from './parser.js';
7
+ /** The guest tracking API of 5Post's app (ru.x5.omni). */
8
+ export const FIVE_POST_API = 'https://api-omni.x5.ru/five-post-mobile-api/v3/mobile';
9
+ const REDIRECTS = [301, 302, 303, 307, 308];
10
+ // ServicePipe's bot check, which fronts X5's hosts.
11
+ const CHALLENGE = /servicepipe\.tech|js-challenge-loader|id_captcha_frame_div|get_cookie_spsn|<title>\s*(?:403 )?Forbidden/i;
12
+ /** The orders the app lists under a number, one order's details, and that order's status history. */
13
+ export const fivePostUrls = (number, orderId = '') => ({
14
+ orders: `${FIVE_POST_API}/order-tracking/${encodeURIComponent(number)}/orders`,
15
+ details: `${FIVE_POST_API}/order-tracking/${encodeURIComponent(number)}/orders/${encodeURIComponent(orderId)}`,
16
+ history: `${FIVE_POST_API}/orders/${encodeURIComponent(orderId)}/status-history`,
17
+ });
18
+ export class FivePostTracker {
19
+ options;
20
+ constructor(options = {}) {
21
+ this.options = options;
22
+ }
23
+ /** One GET; a 404 is returned for the caller to read, as it means different things on each route. */
24
+ async #get(url, signal, timeoutMs) {
25
+ const { response, bytes } = await fetchBounded(url, { signal, headers: {
26
+ Accept: 'application/json', 'User-Agent': userAgentOf(this.options.userAgent),
27
+ } }, { provider: PROVIDER, timeoutMs, maxBytes: FIVE_POST_MAX_BYTES, redirect: 'manual',
28
+ fetcher: this.options.fetcher, allowHttpStatuses: [...REDIRECTS, 404] });
29
+ if (REDIRECTS.includes(response.status))
30
+ throw new TransportError(PROVIDER, '5Post redirected its tracking API');
31
+ const text = decodeText(bytes);
32
+ try {
33
+ return { status: response.status, body: JSON.parse(text) };
34
+ }
35
+ catch (cause) {
36
+ if (CHALLENGE.test(text.slice(0, 64_000)))
37
+ throw new ChallengeError(PROVIDER, '5Post answered with its bot check', { cause });
38
+ if (response.status === 404)
39
+ return { status: 404, body: null };
40
+ throw new SchemaError(PROVIDER, '5Post returned a reply that is not JSON', { cause });
41
+ }
42
+ }
43
+ async fetch(raw, context = {}) {
44
+ const number = normalizeFivePostNumber(raw);
45
+ const read = async (signal, remainingMs) => {
46
+ const deadline = Date.now() + remainingMs;
47
+ const left = () => Math.max(1, Math.floor(deadline - Date.now()));
48
+ const list = await this.#get(fivePostUrls(number).orders, signal, left());
49
+ // The list route answers every number, an empty list for one it does not know.
50
+ if (list.status === 404)
51
+ throw new TransportError(PROVIDER, '5Post no longer serves its order list');
52
+ const orderId = fivePostOrderId(list.body, number);
53
+ const urls = fivePostUrls(number, orderId);
54
+ const [details, history] = await Promise.all([this.#get(urls.details, signal, left()), this.#get(urls.history, signal, left())]);
55
+ // The order was just listed, so losing it now is no answer either way.
56
+ if (details.status === 404 || history.status === 404)
57
+ throw new IndeterminateError(PROVIDER, '5Post did not return the order it listed');
58
+ return parseFivePost(details.body, history.body, orderId, number);
59
+ };
60
+ // A request that fails to reach 5Post, or hangs, gets one more try: the
61
+ // first gets half of the budget, so the retry fits in the rest.
62
+ return runSteps({ carrier: '5post', budgetMs: context.budgetMs ?? 15_000, signal: context.signal,
63
+ recorder: this.options.recorder ?? NOOP_RECORDER }, [
64
+ { id: 'direct', run: ({ signal, remainingMs }) => read(signal, firstAttemptMs(remainingMs)) },
65
+ networkRetryStep(({ signal, remainingMs }) => read(signal, remainingMs)),
66
+ ]);
67
+ }
68
+ }
69
+ export const adapter = (environment) => {
70
+ const tracker = new FivePostTracker({ fetcher: environment.fetcher, recorder: environment.recorder, userAgent: environment.userAgent });
71
+ return {
72
+ id: '5post', recordsSteps: true, steps: ['direct', 'retry'],
73
+ track: (input, context) => tracker.fetch(input.number, context),
74
+ };
75
+ };
@@ -18,18 +18,55 @@
18
18
  "timezone": "Europe/Moscow",
19
19
  "tracking": {
20
20
  "mode": "automatic",
21
- "adapter": "universal",
22
- "steps": []
21
+ "adapter": "5post",
22
+ "steps": [
23
+ "direct",
24
+ "retry"
25
+ ]
23
26
  },
24
- "capabilities": [],
27
+ "capabilities": [
28
+ "history",
29
+ "location",
30
+ "provider_code",
31
+ "delivered_at",
32
+ "pickup_point"
33
+ ],
25
34
  "portal": {
26
35
  "url": "https://fivepost.ru/tracking?id={trackingNumber}",
27
36
  "searchUrl": "https://fivepost.ru/",
28
37
  "canaryUrl": "https://fivepost.ru/",
29
- "shows": [],
30
- "scraped": [],
31
- "discarded": [],
32
- "unavailable": []
38
+ "shows": [
39
+ "status",
40
+ "history",
41
+ "location",
42
+ "pickup_point",
43
+ "pickup_deadline",
44
+ "eta",
45
+ "sender_name",
46
+ "payment_details",
47
+ "office_opening_hours",
48
+ "parcel_count"
49
+ ],
50
+ "scraped": [
51
+ "status",
52
+ "history",
53
+ "location",
54
+ "pickup_point",
55
+ "delivered_at"
56
+ ],
57
+ "discarded": [
58
+ "pickup_deadline",
59
+ "sender_name",
60
+ "payment_details",
61
+ "office_opening_hours",
62
+ "parcel_count"
63
+ ],
64
+ "unavailable": [
65
+ "recipient_name",
66
+ "weight",
67
+ "dimensions",
68
+ "proof_of_delivery"
69
+ ]
33
70
  },
34
71
  "links": [
35
72
  {