fansunited-data-layer 0.8.7 → 0.10.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 (68) hide show
  1. package/api/fansunited/index.d.ts +2 -0
  2. package/api/fansunited/index.d.ts.map +1 -1
  3. package/api/fansunited/search/__tests__/index.test.d.ts +2 -0
  4. package/api/fansunited/search/__tests__/index.test.d.ts.map +1 -0
  5. package/api/fansunited/search/__tests__/transformer.test.d.ts +2 -0
  6. package/api/fansunited/search/__tests__/transformer.test.d.ts.map +1 -0
  7. package/api/fansunited/search/constants.d.ts +2 -0
  8. package/api/fansunited/search/constants.d.ts.map +1 -0
  9. package/api/fansunited/search/http.d.ts +5 -0
  10. package/api/fansunited/search/http.d.ts.map +1 -0
  11. package/api/fansunited/search/index.d.ts +50 -0
  12. package/api/fansunited/search/index.d.ts.map +1 -0
  13. package/api/fansunited/search/raw-types.d.ts +93 -0
  14. package/api/fansunited/search/raw-types.d.ts.map +1 -0
  15. package/api/fansunited/search/transformer.d.ts +66 -0
  16. package/api/fansunited/search/transformer.d.ts.map +1 -0
  17. package/api/fansunited/search/types.d.ts +136 -0
  18. package/api/fansunited/search/types.d.ts.map +1 -0
  19. package/api/sportal365-sports/constants.d.ts +2 -0
  20. package/api/sportal365-sports/constants.d.ts.map +1 -1
  21. package/api/sportal365-sports/index.d.ts +2 -0
  22. package/api/sportal365-sports/index.d.ts.map +1 -1
  23. package/api/sportal365-sports/standings/http.d.ts +8 -0
  24. package/api/sportal365-sports/standings/http.d.ts.map +1 -0
  25. package/api/sportal365-sports/standings/index.d.ts +48 -0
  26. package/api/sportal365-sports/standings/index.d.ts.map +1 -0
  27. package/api/sportal365-sports/standings/standing.transformer.d.ts +18 -0
  28. package/api/sportal365-sports/standings/standing.transformer.d.ts.map +1 -0
  29. package/api/sportal365-sports/standings/standing.types.d.ts +105 -0
  30. package/api/sportal365-sports/standings/standing.types.d.ts.map +1 -0
  31. package/cache/__tests__/cache-manager.test.d.ts +2 -0
  32. package/cache/__tests__/cache-manager.test.d.ts.map +1 -0
  33. package/cache/__tests__/cleanup.test.d.ts +2 -0
  34. package/cache/__tests__/cleanup.test.d.ts.map +1 -0
  35. package/cache/__tests__/memory-store.test.d.ts +2 -0
  36. package/cache/__tests__/memory-store.test.d.ts.map +1 -0
  37. package/cache/__tests__/sqlite-store.test.d.ts +2 -0
  38. package/cache/__tests__/sqlite-store.test.d.ts.map +1 -0
  39. package/cache/cache-manager.d.ts +42 -0
  40. package/cache/cache-manager.d.ts.map +1 -0
  41. package/cache/cleanup.d.ts +7 -0
  42. package/cache/cleanup.d.ts.map +1 -0
  43. package/cache/index.d.ts +13 -0
  44. package/cache/index.d.ts.map +1 -0
  45. package/cache/memory-store.d.ts +12 -0
  46. package/cache/memory-store.d.ts.map +1 -0
  47. package/cache/sqlite-store.d.ts +19 -0
  48. package/cache/sqlite-store.d.ts.map +1 -0
  49. package/cache/types.d.ts +15 -0
  50. package/cache/types.d.ts.map +1 -0
  51. package/client.cjs +1 -1
  52. package/client.js +2 -2
  53. package/config/types.d.ts +2 -0
  54. package/config/types.d.ts.map +1 -1
  55. package/fansunited-data-layer.cjs +1 -1
  56. package/fansunited-data-layer.js +2660 -1342
  57. package/index.d.ts +7 -5
  58. package/index.d.ts.map +1 -1
  59. package/matches-D5jlWsqr.cjs +1 -0
  60. package/{matches-BefXoB5p.js → matches-dKvggZia.js} +47 -46
  61. package/package.json +11 -3
  62. package/types/canonical/base.types.d.ts +28 -2
  63. package/types/canonical/base.types.d.ts.map +1 -1
  64. package/types/canonical/index.d.ts +2 -2
  65. package/types/canonical/index.d.ts.map +1 -1
  66. package/types/canonical/standing.types.d.ts +25 -0
  67. package/types/canonical/standing.types.d.ts.map +1 -1
  68. package/matches-CiVDiSIz.cjs +0 -1
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Standings API Raw Types
3
+ * Based on the Sportal365 Standings API (standing.api.sportal365.com)
4
+ *
5
+ * This is a separate API from the Football API. It uses a column-based format
6
+ * for stats and supports multi-stage / multi-group standings.
7
+ */
8
+ import type { RawFormMatch } from "../shared/types";
9
+ import type { NextCacheOptions } from "../http";
10
+ export interface RawStandingsApiResponse {
11
+ data: RawStandingsApiStageData[];
12
+ }
13
+ export interface RawStandingsApiStage {
14
+ id: string;
15
+ name: string;
16
+ entity_type: string;
17
+ short_name: string | null;
18
+ slug: string;
19
+ assets: unknown | null;
20
+ start_date: string | null;
21
+ }
22
+ export interface RawStandingsApiStageData {
23
+ stage: RawStandingsApiStage;
24
+ standings: RawStandingsApiGroupStandings[];
25
+ }
26
+ export interface RawStandingsApiGroup {
27
+ id: string;
28
+ name: string;
29
+ type: string;
30
+ entity_type: string;
31
+ short_name: string | null;
32
+ assets: unknown | null;
33
+ }
34
+ export interface RawStandingsApiGroupStandings {
35
+ group: RawStandingsApiGroup;
36
+ type: "FINISHED" | "LIVE";
37
+ filter: string;
38
+ ranking_type: string;
39
+ standing: RawStandingsApiEntry[];
40
+ }
41
+ export interface RawStandingsApiTeam {
42
+ id: string;
43
+ name: string;
44
+ type: string;
45
+ gender: string;
46
+ three_letter_code: string;
47
+ entity_type: string;
48
+ assets: unknown | null;
49
+ short_name: string | null;
50
+ slug: string;
51
+ }
52
+ export interface RawStandingsApiColumnType {
53
+ id: string;
54
+ name: string;
55
+ code: string;
56
+ entity_type: string;
57
+ short_name: string;
58
+ assets: unknown | null;
59
+ }
60
+ export interface RawStandingsApiColumn {
61
+ type: RawStandingsApiColumnType;
62
+ value: string;
63
+ }
64
+ export interface RawStandingsApiRule {
65
+ id: string;
66
+ name: string;
67
+ type: "TOP" | "TOP_PLAYOFF" | "TIER_TWO" | "TIER_TWO_PLAYOFF" | "RELEGATION" | "RELEGATION_PLAYOFF";
68
+ standing_api_rule_type: string;
69
+ entity_type: string;
70
+ assets: unknown | null;
71
+ }
72
+ export interface RawStandingsApiEntry {
73
+ team: RawStandingsApiTeam;
74
+ rules: RawStandingsApiRule[];
75
+ columns: RawStandingsApiColumn[];
76
+ /** Form matches - uses the shared RawFormMatch structure */
77
+ form: RawFormMatch[];
78
+ }
79
+ export type StandingsSport = "football" | "basketball" | "ice_hockey";
80
+ export type StandingsCoverageType = "LIVE" | "FINISHED" | "ALL";
81
+ export interface GetSportal365StandingsOptions {
82
+ /** Sport to fetch standings for */
83
+ sport: StandingsSport;
84
+ /** Season ID - cannot be used together with stageId */
85
+ seasonId?: string;
86
+ /** Stage ID - cannot be used together with seasonId */
87
+ stageId?: string;
88
+ /** Group ID to filter to a specific group */
89
+ groupId?: string;
90
+ /** Coverage type: LIVE (default), FINISHED, or ALL */
91
+ coverageType?: StandingsCoverageType;
92
+ /** Include form data in the response */
93
+ includeForm?: boolean;
94
+ /** Home/away filter, defaults to OVERALL */
95
+ homeAway?: string;
96
+ /** Row limit (default 100) */
97
+ rowLimit?: number;
98
+ /** Row offset (default 0) */
99
+ rowOffset?: number;
100
+ /** Language code for translations */
101
+ languageCode?: string;
102
+ /** Next.js cache options */
103
+ next?: NextCacheOptions;
104
+ }
105
+ //# sourceMappingURL=standing.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standing.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/sportal365-sports/standings/standing.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMhD,MAAM,WAAW,uBAAuB;IACpC,IAAI,EAAE,wBAAwB,EAAE,CAAC;CACpC;AAMD,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,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@
1
+ export {};
2
+ //# sourceMappingURL=cache-manager.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-manager.test.d.ts","sourceRoot":"","sources":["../../../src/lib/cache/__tests__/cache-manager.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cleanup.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.test.d.ts","sourceRoot":"","sources":["../../../src/lib/cache/__tests__/cleanup.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=memory-store.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-store.test.d.ts","sourceRoot":"","sources":["../../../src/lib/cache/__tests__/memory-store.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sqlite-store.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite-store.test.d.ts","sourceRoot":"","sources":["../../../src/lib/cache/__tests__/sqlite-store.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Cache Manager - Orchestrates L1 (memory) + optional L2 with SWR pattern
3
+ *
4
+ * L2 (SQLite) is never statically imported here — it's injected at runtime
5
+ * via initL2() so that browser bundles don't pull in better-sqlite3.
6
+ */
7
+ import type { CacheEntry, EntityCacheConfig, EntityType } from "./types";
8
+ /** Interface that L2 stores must satisfy */
9
+ export interface L2Store {
10
+ get isInitialized(): boolean;
11
+ get<T>(key: string): CacheEntry<T> | undefined;
12
+ set(key: string, entity: string, data: unknown): void;
13
+ setMany(entries: {
14
+ key: string;
15
+ entity: string;
16
+ data: unknown;
17
+ }[]): void;
18
+ cleanup(entity: string, maxTTLSeconds: number): number;
19
+ clear(): void;
20
+ }
21
+ /**
22
+ * Initialize L2 cache layer. Call on server startup.
23
+ * Client-side apps skip this — L2 is never loaded.
24
+ */
25
+ export declare function initL2(store: L2Store): void;
26
+ /** Get the L2 store (if initialized) */
27
+ export declare function getL2(): L2Store | null;
28
+ declare const ENTITY_TTL_CONFIG: Record<EntityType, EntityCacheConfig>;
29
+ /**
30
+ * Single-key cache-through with SWR (Stale-While-Revalidate)
31
+ */
32
+ export declare function cached<T>(key: string, entity: EntityType, fetcher: () => Promise<T>): Promise<T>;
33
+ /**
34
+ * Smart batch cache — only fetches uncached IDs from the API
35
+ */
36
+ export declare function cachedBatch<T>(ids: string[], entity: EntityType, batchFetcher: (missingIds: string[]) => Promise<Map<string, T>>, keyFn: (id: string) => string): Promise<Map<string, T>>;
37
+ /**
38
+ * Remove an entry from both cache layers
39
+ */
40
+ export declare function invalidate(key: string): void;
41
+ export { ENTITY_TTL_CONFIG };
42
+ //# sourceMappingURL=cache-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-manager.d.ts","sourceRoot":"","sources":["../../src/lib/cache/cache-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEzE,4CAA4C;AAC5C,MAAM,WAAW,OAAO;IACpB,IAAI,aAAa,IAAI,OAAO,CAAC;IAC7B,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAC/C,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACtD,OAAO,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,EAAE,GAAG,IAAI,CAAC;IACzE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IACvD,KAAK,IAAI,IAAI,CAAC;CACjB;AAKD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE3C;AAED,wCAAwC;AACxC,wBAAgB,KAAK,IAAI,OAAO,GAAG,IAAI,CAEtC;AAED,QAAA,MAAM,iBAAiB,EAAE,MAAM,CAAC,UAAU,EAAE,iBAAiB,CAQ5D,CAAC;AAwCF;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAoCtG;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,CAAC,EAC/B,GAAG,EAAE,MAAM,EAAE,EACb,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAC/D,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAC9B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CA6DzB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE5C;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Periodic L2 cache cleanup
3
+ */
4
+ export declare function runCleanup(): void;
5
+ export declare function startCleanupSchedule(intervalMs?: number): void;
6
+ export declare function stopCleanupSchedule(): void;
7
+ //# sourceMappingURL=cleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../../src/lib/cache/cleanup.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,wBAAgB,UAAU,IAAI,IAAI,CAWjC;AAED,wBAAgB,oBAAoB,CAAC,UAAU,SAAiB,GAAG,IAAI,CAGtE;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAK1C"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Cache layer - public API
3
+ *
4
+ * NOTE: sqlite-store.ts is NOT exported here to avoid pulling better-sqlite3
5
+ * into browser bundles. Server-side consumers should import it directly:
6
+ * import { initSqliteStore, sqliteStore } from './cache/sqlite-store';
7
+ */
8
+ export { memoryStore } from "./memory-store";
9
+ export { cached, cachedBatch, invalidate, initL2 } from "./cache-manager";
10
+ export type { L2Store } from "./cache-manager";
11
+ export { runCleanup, startCleanupSchedule, stopCleanupSchedule } from "./cleanup";
12
+ export type { CacheEntry, EntityCacheConfig, EntityType } from "./types";
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/cache/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC1E,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAClF,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * L1 Cache - LRU in-memory store
3
+ */
4
+ import type { CacheEntry } from "./types";
5
+ export declare const memoryStore: {
6
+ get<T>(key: string): CacheEntry<T> | undefined;
7
+ set<T>(key: string, data: T): void;
8
+ delete(key: string): void;
9
+ clear(): void;
10
+ readonly size: number;
11
+ };
12
+ //# sourceMappingURL=memory-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-store.d.ts","sourceRoot":"","sources":["../../src/lib/cache/memory-store.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAW1C,eAAO,MAAM,WAAW;QAChB,CAAC,OAAO,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS;QAI1C,CAAC,OAAO,MAAM,QAAQ,CAAC,GAAG,IAAI;gBAItB,MAAM,GAAG,IAAI;aAIhB,IAAI;mBAID,MAAM;CAGrB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * L2 Cache - SQLite on-disk store (server-only)
3
+ */
4
+ import type { CacheEntry } from "./types";
5
+ export declare function initSqliteStore(dbPath?: string): void;
6
+ export declare const sqliteStore: {
7
+ readonly isInitialized: boolean;
8
+ get<T>(key: string): CacheEntry<T> | undefined;
9
+ set(key: string, entity: string, data: unknown): void;
10
+ setMany(entries: {
11
+ key: string;
12
+ entity: string;
13
+ data: unknown;
14
+ }[]): void;
15
+ cleanup(entity: string, maxTTLSeconds: number): number;
16
+ clear(): void;
17
+ close(): void;
18
+ };
19
+ //# sourceMappingURL=sqlite-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite-store.d.ts","sourceRoot":"","sources":["../../src/lib/cache/sqlite-store.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAW1C,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CA4BrD;AAED,eAAO,MAAM,WAAW;4BACC,OAAO;QAIxB,CAAC,OAAO,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS;aAarC,MAAM,UAAU,MAAM,QAAQ,OAAO,GAAG,IAAI;qBASpC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,EAAE,GAAG,IAAI;oBAgBxD,MAAM,iBAAiB,MAAM,GAAG,MAAM;aAQ7C,IAAI;aAIJ,IAAI;CAMhB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Shared cache types
3
+ */
4
+ export interface CacheEntry<T> {
5
+ data: T;
6
+ storedAt: number;
7
+ }
8
+ export interface EntityCacheConfig {
9
+ /** Time in seconds before data is considered stale (triggers background refresh) */
10
+ staleTTL: number;
11
+ /** Time in seconds before data is completely expired and must be re-fetched */
12
+ maxTTL: number;
13
+ }
14
+ export type EntityType = "competitions" | "teams" | "athletes" | "venues" | "countries" | "coaches" | "search";
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/cache/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,UAAU,CAAC,CAAC;IACzB,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAC9B,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC"}
package/client.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),B=require("./matches-CiVDiSIz.cjs");var at={exports:{}},$e={};var ya;function Ss(){if(ya)return $e;ya=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(i,s,r){var n=null;if(r!==void 0&&(n=""+r),s.key!==void 0&&(n=""+s.key),"key"in s){r={};for(var o in s)o!=="key"&&(r[o]=s[o])}else r=s;return s=r.ref,{$$typeof:e,type:i,key:n,ref:s!==void 0?s:null,props:r}}return $e.Fragment=t,$e.jsx=a,$e.jsxs=a,$e}var Ue={};var wa;function Cs(){return wa||(wa=1,process.env.NODE_ENV!=="production"&&(function(){function e(w){if(w==null)return null;if(typeof w=="function")return w.$$typeof===P?null:w.displayName||w.name||null;if(typeof w=="string")return w;switch(w){case T:return"Fragment";case O:return"Profiler";case I:return"StrictMode";case g:return"Suspense";case f:return"SuspenseList";case M:return"Activity"}if(typeof w=="object")switch(typeof w.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),w.$$typeof){case v:return"Portal";case G:return w.displayName||"Context";case C:return(w._context.displayName||"Context")+".Consumer";case A:var R=w.render;return w=w.displayName,w||(w=R.displayName||R.name||"",w=w!==""?"ForwardRef("+w+")":"ForwardRef"),w;case y:return R=w.displayName||null,R!==null?R:e(w.type)||"Memo";case b:R=w._payload,w=w._init;try{return e(w(R))}catch{}}return null}function t(w){return""+w}function a(w){try{t(w);var R=!1}catch{R=!0}if(R){R=console;var F=R.error,N=typeof Symbol=="function"&&Symbol.toStringTag&&w[Symbol.toStringTag]||w.constructor.name||"Object";return F.call(R,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",N),t(w)}}function i(w){if(w===T)return"<>";if(typeof w=="object"&&w!==null&&w.$$typeof===b)return"<...>";try{var R=e(w);return R?"<"+R+">":"<...>"}catch{return"<...>"}}function s(){var w=D.A;return w===null?null:w.getOwner()}function r(){return Error("react-stack-top-frame")}function n(w){if(U.call(w,"key")){var R=Object.getOwnPropertyDescriptor(w,"key").get;if(R&&R.isReactWarning)return!1}return w.key!==void 0}function o(w,R){function F(){re||(re=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",R))}F.isReactWarning=!0,Object.defineProperty(w,"key",{get:F,configurable:!0})}function l(){var w=e(this.type);return ie[w]||(ie[w]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),w=this.props.ref,w!==void 0?w:null}function c(w,R,F,N,ne,Ie){var $=F.ref;return w={$$typeof:_,type:w,key:R,props:F,_owner:N},($!==void 0?$:null)!==null?Object.defineProperty(w,"ref",{enumerable:!1,get:l}):Object.defineProperty(w,"ref",{enumerable:!1,value:null}),w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(w,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(w,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.defineProperty(w,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ie}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w}function d(w,R,F,N,ne,Ie){var $=R.children;if($!==void 0)if(N)if(j($)){for(N=0;N<$.length;N++)p($[N]);Object.freeze&&Object.freeze($)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p($);if(U.call(R,"key")){$=e(w);var ee=Object.keys(R).filter(function(Ge){return Ge!=="key"});N=0<ee.length?"{key: someKey, "+ee.join(": ..., ")+": ...}":"{key: someKey}",Z[$+N]||(ee=0<ee.length?"{"+ee.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),B=require("./matches-D5jlWsqr.cjs");var at={exports:{}},$e={};var ya;function Ss(){if(ya)return $e;ya=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(i,s,r){var n=null;if(r!==void 0&&(n=""+r),s.key!==void 0&&(n=""+s.key),"key"in s){r={};for(var o in s)o!=="key"&&(r[o]=s[o])}else r=s;return s=r.ref,{$$typeof:e,type:i,key:n,ref:s!==void 0?s:null,props:r}}return $e.Fragment=t,$e.jsx=a,$e.jsxs=a,$e}var Ue={};var wa;function Cs(){return wa||(wa=1,process.env.NODE_ENV!=="production"&&(function(){function e(w){if(w==null)return null;if(typeof w=="function")return w.$$typeof===P?null:w.displayName||w.name||null;if(typeof w=="string")return w;switch(w){case T:return"Fragment";case O:return"Profiler";case I:return"StrictMode";case g:return"Suspense";case f:return"SuspenseList";case M:return"Activity"}if(typeof w=="object")switch(typeof w.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),w.$$typeof){case v:return"Portal";case G:return w.displayName||"Context";case C:return(w._context.displayName||"Context")+".Consumer";case A:var R=w.render;return w=w.displayName,w||(w=R.displayName||R.name||"",w=w!==""?"ForwardRef("+w+")":"ForwardRef"),w;case y:return R=w.displayName||null,R!==null?R:e(w.type)||"Memo";case b:R=w._payload,w=w._init;try{return e(w(R))}catch{}}return null}function t(w){return""+w}function a(w){try{t(w);var R=!1}catch{R=!0}if(R){R=console;var F=R.error,N=typeof Symbol=="function"&&Symbol.toStringTag&&w[Symbol.toStringTag]||w.constructor.name||"Object";return F.call(R,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",N),t(w)}}function i(w){if(w===T)return"<>";if(typeof w=="object"&&w!==null&&w.$$typeof===b)return"<...>";try{var R=e(w);return R?"<"+R+">":"<...>"}catch{return"<...>"}}function s(){var w=D.A;return w===null?null:w.getOwner()}function r(){return Error("react-stack-top-frame")}function n(w){if(U.call(w,"key")){var R=Object.getOwnPropertyDescriptor(w,"key").get;if(R&&R.isReactWarning)return!1}return w.key!==void 0}function o(w,R){function F(){re||(re=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",R))}F.isReactWarning=!0,Object.defineProperty(w,"key",{get:F,configurable:!0})}function l(){var w=e(this.type);return ie[w]||(ie[w]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),w=this.props.ref,w!==void 0?w:null}function c(w,R,F,N,ne,Ie){var $=F.ref;return w={$$typeof:_,type:w,key:R,props:F,_owner:N},($!==void 0?$:null)!==null?Object.defineProperty(w,"ref",{enumerable:!1,get:l}):Object.defineProperty(w,"ref",{enumerable:!1,value:null}),w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(w,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(w,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.defineProperty(w,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ie}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w}function d(w,R,F,N,ne,Ie){var $=R.children;if($!==void 0)if(N)if(j($)){for(N=0;N<$.length;N++)p($[N]);Object.freeze&&Object.freeze($)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p($);if(U.call(R,"key")){$=e(w);var ee=Object.keys(R).filter(function(Ge){return Ge!=="key"});N=0<ee.length?"{key: someKey, "+ee.join(": ..., ")+": ...}":"{key: someKey}",Z[$+N]||(ee=0<ee.length?"{"+ee.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
package/client.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import Ds, { createContext as Xe, useContext as Je, useMemo as P, useCallback as v, useState as U, useEffect as ue, useRef as Ls } from "react";
3
- import { u as xs, x as Ns, l as Gs, w as ga, y as fa, z as ya, n as wa, p as $s, s as Us, o as Bs, A as Hs, C as Vs, k as Ws } from "./matches-BefXoB5p.js";
4
- import { B as fh } from "./matches-BefXoB5p.js";
3
+ import { w as xs, z as Ns, n as Gs, y as ga, A as fa, B as ya, p as wa, r as $s, v as Us, q as Bs, C as Hs, E as Vs, m as Ws } from "./matches-dKvggZia.js";
4
+ import { D as fh } from "./matches-dKvggZia.js";
5
5
  var nt = { exports: {} }, Be = {};
6
6
  var _a;
7
7
  function zs() {
package/config/types.d.ts CHANGED
@@ -31,6 +31,8 @@ export interface DataLayerConfig {
31
31
  apiKey: string;
32
32
  /** Client ID for FansUnited services (required) */
33
33
  clientId: string;
34
+ /** Default language for search results (e.g., "EN", "BG"). Defaults to "EN" */
35
+ lang?: string;
34
36
  };
35
37
  }
36
38
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/config/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,sBAAsB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC1B,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC5B,kDAAkD;IAClD,qBAAqB,EAAE,kBAAkB,GAAG,qBAAqB,CAAC;IAElE,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;IAE1C,gCAAgC;IAChC,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;OAIG;IACH,UAAU,CAAC,EAAE;QACT,iDAAiD;QACjD,MAAM,EAAE,MAAM,CAAC;QACf,mDAAmD;QACnD,QAAQ,EAAE,MAAM,CAAC;KACpB,CAAC;CACL"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/config/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,sBAAsB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,YAAY,CAAC,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