fifa-wc26 0.1.0 → 0.1.1

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 (2) hide show
  1. package/dist/cli.js +13 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -505,8 +505,16 @@ var EspnProvider = class {
505
505
  }));
506
506
  }
507
507
  async team(code) {
508
- const data = await httpJson(`${BASE}/teams`);
509
- const teams = data.sports?.[0]?.leagues?.[0]?.teams ?? [];
508
+ let teams = [];
509
+ try {
510
+ const data = await httpJson(`${BASE}/teams`);
511
+ teams = data.sports?.[0]?.leagues?.[0]?.teams ?? [];
512
+ } catch (e) {
513
+ if (e instanceof WC26Error && e.code === "NOT_FOUND") {
514
+ throw new WC26Error("PROVIDER_UNREACHABLE", `espn teams endpoint unavailable for fifa.worldcup`);
515
+ }
516
+ throw e;
517
+ }
510
518
  const match = teams.find((t2) => (t2.team.abbreviation ?? "").toUpperCase() === code.toUpperCase());
511
519
  if (!match) throw new WC26Error("NOT_FOUND", `team ${code} not found`);
512
520
  const t = match.team;
@@ -603,10 +611,11 @@ var TheSportsDbProvider = class {
603
611
  return out;
604
612
  }
605
613
  async liveMatches() {
614
+ const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
606
615
  const data = await httpJson(
607
- `${base(this.apiKey)}/livescore.php?l=Soccer`
616
+ `${base(this.apiKey)}/eventsday.php?d=${today}&l=${LEAGUE_ID}`
608
617
  ).catch(() => ({ events: [] }));
609
- return (data.events ?? []).filter((e) => e.idLeague === LEAGUE_ID || (e.strEvent ?? "").includes("World Cup")).map((e) => ({ ...fixtureFromTSDB(e), minute: 0, events: [] }));
618
+ return (data.events ?? []).map(fixtureFromTSDB).filter((f) => f.status === "live").map((f) => ({ ...f, minute: 0, events: [] }));
610
619
  }
611
620
  async match(id) {
612
621
  const data = await httpJson(`${base(this.apiKey)}/lookupevent.php?id=${id}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fifa-wc26",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "FIFA World Cup 2026 CLI: fixtures, live scores, group standings, ASCII bracket, team lookup. Keyless providers, smart cache, terminal-friendly output.",
5
5
  "type": "module",
6
6
  "bin": {