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
@@ -6,5 +6,7 @@
6
6
  */
7
7
  export { getFansUnitedFootballCompetitions, getFansUnitedFootballCompetition, getFansUnitedFootballTeam, getFansUnitedFootballTeams, getFansUnitedFootballPlayer, getFansUnitedFootballPlayers, getFansUnitedFootballMatch, getFansUnitedFootballMatches, getFansUnitedFootballSearch, } from "./football";
8
8
  export type { GetFootballCompetitionsOptions, GetFootballCompetitionOptions, GetFootballTeamOptions, GetFootballTeamsOptions, GetFootballPlayerOptions, GetFootballPlayersOptions, GetFootballMatchOptions, GetFootballMatchesOptions, GetFootballSearchOptions, SearchEntityType, FansUnitedFootballSearchResult, } from "./football";
9
+ export { getFansUnitedSearchEntities, getFansUnitedEntityById, getFansUnitedEntitiesByIds, getFansUnitedCompetitions, getFansUnitedTeamsByCountry, getFansUnitedTeamsByCompetition, getFansUnitedCountries, getFansUnitedVenues, } from "./search";
10
+ export type { SearchMode, EntityContentType, EntitySearchOptions, GetEntityByIdOptions, GetEntitiesByIdsOptions, GetCompetitionsOptions, GetTeamsByCountryOptions, GetTeamsByCompetitionOptions, GetCountriesOptions, GetVenuesOptions, RawSearchEntity, SearchEntityResult, SearchEntitySummary, EntitySearchResponse, PaginationMeta, PaginatedResult, } from "./search";
9
11
  export type { NextCacheOptions } from "./http";
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/api/fansunited/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACH,iCAAiC,EACjC,gCAAgC,EAChC,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,GAC9B,MAAM,YAAY,CAAC;AAEpB,YAAY,EACR,8BAA8B,EAC9B,6BAA6B,EAC7B,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,gBAAgB,EAChB,8BAA8B,GACjC,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/api/fansunited/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACH,iCAAiC,EACjC,gCAAgC,EAChC,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,GAC9B,MAAM,YAAY,CAAC;AAEpB,YAAY,EACR,8BAA8B,EAC9B,6BAA6B,EAC7B,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,gBAAgB,EAChB,8BAA8B,GACjC,MAAM,YAAY,CAAC;AAGpB,OAAO,EACH,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,mBAAmB,GACtB,MAAM,UAAU,CAAC;AAElB,YAAY,EACR,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,eAAe,GAClB,MAAM,UAAU,CAAC;AAGlB,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/fansunited/search/__tests__/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=transformer.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformer.test.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/fansunited/search/__tests__/transformer.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare const FANSUNITED_SEARCH_DOMAIN = "https://search.fansunitedapi.com";
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/fansunited/search/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,qCAAqC,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * HTTP client for the Fans United Search API
3
+ */
4
+ export declare const searchHttp: import("../http").FansUnitedHttpClient;
5
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/fansunited/search/http.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,eAAO,MAAM,UAAU,wCAA6C,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Fans United Search API - Public functions with caching
3
+ */
4
+ import type { EntitySearchOptions, GetEntityByIdOptions, GetEntitiesByIdsOptions, GetCompetitionsOptions, GetTeamsByCountryOptions, GetTeamsByCompetitionOptions, GetCountriesOptions, GetVenuesOptions, PaginatedResult, SearchEntityResult, SearchEntitySummary } from "./types";
5
+ import type { FUSportsCompetitionSummary, FUSportsTeamSummary, FUSportsCountrySummary, FUSportsVenueSummary } from "../../../types/canonical/base.types";
6
+ /**
7
+ * Search entities across all content types.
8
+ * Returns transformed canonical types.
9
+ */
10
+ export declare function getFansUnitedSearchEntities(options?: EntitySearchOptions, config?: {
11
+ next?: EntitySearchOptions["next"];
12
+ }): Promise<PaginatedResult<SearchEntitySummary>>;
13
+ /**
14
+ * Get a single entity by ID.
15
+ * Returns transformed canonical type.
16
+ */
17
+ export declare function getFansUnitedEntityById(id: string, options?: GetEntityByIdOptions): Promise<SearchEntityResult>;
18
+ /**
19
+ * Get multiple entities by IDs — smart batch caching.
20
+ * Only fetches uncached IDs from the API.
21
+ * Returns transformed canonical types.
22
+ */
23
+ export declare function getFansUnitedEntitiesByIds(ids: string[], options?: GetEntitiesByIdsOptions): Promise<SearchEntityResult[]>;
24
+ /**
25
+ * Get competitions with optional filtering.
26
+ * Returns transformed FUSportsCompetition objects.
27
+ */
28
+ export declare function getFansUnitedCompetitions(options?: GetCompetitionsOptions): Promise<PaginatedResult<FUSportsCompetitionSummary>>;
29
+ /**
30
+ * Get teams filtered by country.
31
+ * Returns transformed FUSportsTeamCompetitor objects.
32
+ */
33
+ export declare function getFansUnitedTeamsByCountry(countryId: string, options?: GetTeamsByCountryOptions): Promise<PaginatedResult<FUSportsTeamSummary>>;
34
+ /**
35
+ * Get teams filtered by competition.
36
+ * Returns transformed FUSportsTeamCompetitor objects.
37
+ */
38
+ export declare function getFansUnitedTeamsByCompetition(competitionId: string, options?: GetTeamsByCompetitionOptions): Promise<PaginatedResult<FUSportsTeamSummary>>;
39
+ /**
40
+ * Get countries with optional filtering.
41
+ * Returns transformed FUSportsCountry objects.
42
+ */
43
+ export declare function getFansUnitedCountries(options?: GetCountriesOptions): Promise<PaginatedResult<FUSportsCountrySummary>>;
44
+ /**
45
+ * Get venues with optional filtering.
46
+ * Returns transformed FUSportsVenue objects.
47
+ */
48
+ export declare function getFansUnitedVenues(options?: GetVenuesOptions): Promise<PaginatedResult<FUSportsVenueSummary>>;
49
+ export type { SearchMode, EntityContentType, EntitySearchOptions, GetEntityByIdOptions, GetEntitiesByIdsOptions, GetCompetitionsOptions, GetTeamsByCountryOptions, GetTeamsByCompetitionOptions, GetCountriesOptions, GetVenuesOptions, RawSearchEntity, EntitySearchResponse, PaginationMeta, PaginatedResult, SearchEntityResult, SearchEntitySummary, } from "./types";
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/fansunited/search/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH,OAAO,KA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AAO,GAAE,mBAAwB,GAClC,OAAO,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC,CA0BlD;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACrC,OAAO,GAAE,gBAAqB,GAC/B,OAAO,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC,CA2BhD;AAGD,YAAY,EACR,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,mBAAmB,GACtB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Raw API response types for the Fans United Search API.
3
+ * These represent the exact shape returned by the API before transformation.
4
+ */
5
+ export interface RawTranslation {
6
+ language: string;
7
+ name: string;
8
+ short_name?: string | null;
9
+ }
10
+ export interface RawAsset {
11
+ key: string;
12
+ value: string;
13
+ }
14
+ export interface RawRelated {
15
+ relationship: string;
16
+ related_id: string;
17
+ }
18
+ export interface RawProviderRef {
19
+ provider: string;
20
+ id: string;
21
+ }
22
+ export interface RawBranding {
23
+ primary_color?: string | null;
24
+ secondary_color?: string | null;
25
+ text_color?: string | null;
26
+ background_color?: string | null;
27
+ background_gradient_from_color?: string | null;
28
+ background_gradient_to_color?: string | null;
29
+ background_image?: string | null;
30
+ }
31
+ export interface RawTeamBranding {
32
+ primary_color?: string | null;
33
+ secondary_color?: string | null;
34
+ tertiary_color?: string | null;
35
+ text_color?: string | null;
36
+ background_color?: string | null;
37
+ background_gradient_from_color?: string | null;
38
+ background_gradient_to_color?: string | null;
39
+ background_image?: string | null;
40
+ }
41
+ export interface RawSearchEntityBase {
42
+ id: string;
43
+ sport: string;
44
+ name: string;
45
+ short_name?: string | null;
46
+ gender?: string;
47
+ translations: RawTranslation[];
48
+ assets: RawAsset[];
49
+ related: RawRelated[];
50
+ provider_ref: RawProviderRef[];
51
+ }
52
+ export interface RawCompetition extends RawSearchEntityBase {
53
+ content_type: "COMPETITION";
54
+ format?: string;
55
+ branding?: RawBranding;
56
+ }
57
+ export interface RawTeam extends RawSearchEntityBase {
58
+ type?: string;
59
+ full_name?: string | null;
60
+ three_letter_code?: string | null;
61
+ nickname?: string | null;
62
+ country_id?: string | null;
63
+ metadata?: {
64
+ branding?: RawTeamBranding;
65
+ };
66
+ additional_information?: unknown[];
67
+ }
68
+ export interface RawAthlete extends RawSearchEntityBase {
69
+ type?: string;
70
+ position?: string | null;
71
+ birth_date?: string | null;
72
+ shirt_number?: number | null;
73
+ country_id?: string | null;
74
+ metadata?: {
75
+ branding?: RawTeamBranding;
76
+ };
77
+ }
78
+ export interface RawCountry extends RawSearchEntityBase {
79
+ country_code?: string | null;
80
+ alias?: string | null;
81
+ }
82
+ export interface RawVenue extends RawSearchEntityBase {
83
+ capacity?: number | null;
84
+ latitude?: number | null;
85
+ longitude?: number | null;
86
+ country_id?: string | null;
87
+ }
88
+ export interface RawCoach extends RawSearchEntityBase {
89
+ type?: string;
90
+ birth_date?: string | null;
91
+ country_id?: string | null;
92
+ }
93
+ //# sourceMappingURL=raw-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw-types.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/fansunited/search/raw-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,QAAQ;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc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C1B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,QAAS,SAAQ,mBAAmB;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Raw → Canonical transformer for Search API entities.
3
+ *
4
+ * Resolves translations to a target language (with EN fallback),
5
+ * maps raw snake_case fields to canonical camelCase types,
6
+ * and hydrates related entries (country + related) one level deep from cache.
7
+ */
8
+ import type { FUSportsCompetition, FUSportsTeamCompetitor, FUSportsPlayerCompetitor, FUSportsCountry, FUSportsVenue, FUSportsCoach, FUSportsRelated, FUBranding, FUSportsCompetitionSummary, FUSportsTeamSummary, FUSportsPlayerSummary, FUSportsCountrySummary, FUSportsVenueSummary, FUSportsCoachSummary } from "../../../types/canonical/base.types";
9
+ import type { SearchEntityResult, SearchEntitySummary } from "./types";
10
+ import type { RawTranslation, RawAsset, RawRelated, RawProviderRef, RawBranding, RawTeamBranding, RawSearchEntityBase, RawCompetition, RawTeam, RawAthlete, RawCountry, RawVenue, RawCoach } from "./raw-types";
11
+ /**
12
+ * Resolve name/shortName in target language.
13
+ * Fallback order: target lang → EN → raw name.
14
+ */
15
+ export declare function resolveTranslation(translations: RawTranslation[], lang: string, fallbackName: string, fallbackShortName?: string | null): {
16
+ name: string;
17
+ shortName?: string;
18
+ };
19
+ /**
20
+ * Map [{key: "LOGO", value: "url"}] → { logo: "url" }
21
+ */
22
+ export declare function resolveAssets(assets: RawAsset[]): Record<string, string>;
23
+ /**
24
+ * Map raw branding snake_case → canonical FUBranding camelCase.
25
+ */
26
+ export declare function resolveBranding(raw: RawBranding | RawTeamBranding | undefined | null): FUBranding | undefined;
27
+ /** Map raw provider_ref → canonical providerRef */
28
+ export declare function resolveProviderRef(refs: RawProviderRef[]): {
29
+ provider: string;
30
+ id: string;
31
+ }[];
32
+ /** Extract related IDs by relationship type */
33
+ export declare function getRelatedIds(related: RawRelated[], relationship: string): string[];
34
+ /**
35
+ * Resolve a country from cache (one level deep).
36
+ * Returns FUSportsCountry with name in target lang if cached, or { id } if not.
37
+ */
38
+ export declare function resolveCountry(countryId: string | null | undefined, related: RawRelated[], lang: string): FUSportsCountry | undefined;
39
+ export declare function transformCountrySummary(raw: RawCountry, lang: string): FUSportsCountrySummary;
40
+ export declare function transformCompetitionSummary(raw: RawCompetition, lang: string): FUSportsCompetitionSummary;
41
+ export declare function transformTeamSummary(raw: RawTeam, lang: string): FUSportsTeamSummary;
42
+ export declare function transformAthleteSummary(raw: RawAthlete, lang: string): FUSportsPlayerSummary;
43
+ export declare function transformVenueSummary(raw: RawVenue, lang: string): FUSportsVenueSummary;
44
+ export declare function transformCoachSummary(raw: RawCoach, lang: string): FUSportsCoachSummary;
45
+ /**
46
+ * Resolve all related entries from cache, grouped by relationship type.
47
+ * Returns undefined if there are no related entries.
48
+ */
49
+ export declare function resolveRelated(related: RawRelated[], lang: string): FUSportsRelated | undefined;
50
+ export declare function transformCompetition(raw: RawCompetition, lang: string): FUSportsCompetition;
51
+ export declare function transformTeam(raw: RawTeam, lang: string): FUSportsTeamCompetitor;
52
+ export declare function transformAthlete(raw: RawAthlete, lang: string): FUSportsPlayerCompetitor;
53
+ export declare function transformCountry(raw: RawCountry, lang: string): FUSportsCountry;
54
+ export declare function transformVenue(raw: RawVenue, lang: string): FUSportsVenue;
55
+ export declare function transformCoach(raw: RawCoach, lang: string): FUSportsCoach;
56
+ /**
57
+ * Determine entity type from raw data and call the appropriate transformer.
58
+ * The raw API uses `content_type` for competitions and `type` / general context for others.
59
+ */
60
+ export declare function transformEntity(raw: RawSearchEntityBase & Record<string, unknown>, lang: string): SearchEntityResult;
61
+ /**
62
+ * Summary dispatcher — like transformEntity but calls summary transforms.
63
+ * Returns lightweight types without `related` or `providerRef`.
64
+ */
65
+ export declare function transformEntitySummary(raw: RawSearchEntityBase & Record<string, unknown>, lang: string): SearchEntitySummary;
66
+ //# sourceMappingURL=transformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformer.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/fansunited/search/transformer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACR,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,EACf,aAAa,EACb,aAAa,EACb,eAAe,EACf,UAAU,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACvB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,KAAK,EACR,cAAc,EACd,QAAQ,EACR,UAAU,EACV,cAAc,EACd,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,EACR,QAAQ,EACX,MAAM,aAAa,CAAC;AAMrB;;;GAGG;AACH,wBAAgB,kBAAkB,CAC9B,YAAY,EAAE,cAAc,EAAE,EAC9B,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAClC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CA0BtC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,GAAG,eAAe,GAAG,SAAS,GAAG,IAAI,GAAG,UAAU,GAAG,SAAS,CAa7G;AAED,mDAAmD;AACnD,wBAAgB,kBAAkB,CAAC,IAAI,EAA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sB,CAsBhF;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAyBxF;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,CAO/E;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAwBzE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAczE;AAMD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAiCpH;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,mBAAmB,CA8B5H"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Types for the Fans United Search API
3
+ */
4
+ import type { NextCacheOptions } from "../http";
5
+ import type { DataLayerConfig } from "../../../config";
6
+ import type { FUSportsCompetition, FUSportsTeamCompetitor, FUSportsPlayerCompetitor, FUSportsCountry, FUSportsVenue, FUSportsCoach, FUSportsCompetitionSummary, FUSportsTeamSummary, FUSportsPlayerSummary, FUSportsCountrySummary, FUSportsVenueSummary, FUSportsCoachSummary } from "../../../types/canonical/base.types";
7
+ export type SearchMode = "CASE_INSENSITIVE" | "CASE_SENSITIVE" | "FULL_MATCH";
8
+ export type EntityContentType = "venue" | "athlete" | "team" | "competition" | "country" | "coach";
9
+ export interface PaginationMeta {
10
+ current_page: number;
11
+ items_per_page: number;
12
+ total_items: number;
13
+ number_of_pages: number;
14
+ }
15
+ /**
16
+ * Summary union — returned by list/search functions.
17
+ * No `related` or `providerRef` fields, only lightweight data for rendering lists.
18
+ */
19
+ export type SearchEntitySummary = (FUSportsCompetitionSummary & {
20
+ entityType: "competition";
21
+ }) | (FUSportsTeamSummary & {
22
+ entityType: "team";
23
+ }) | (FUSportsPlayerSummary & {
24
+ entityType: "athlete";
25
+ }) | (FUSportsCountrySummary & {
26
+ entityType: "country";
27
+ }) | (FUSportsVenueSummary & {
28
+ entityType: "venue";
29
+ }) | (FUSportsCoachSummary & {
30
+ entityType: "coach";
31
+ });
32
+ /**
33
+ * Full union — returned by getById/getByIds functions.
34
+ * Includes `related` (hydrated one level deep) and `providerRef`.
35
+ */
36
+ export type SearchEntityResult = (FUSportsCompetition & {
37
+ entityType: "competition";
38
+ }) | (FUSportsTeamCompetitor & {
39
+ entityType: "team";
40
+ }) | (FUSportsPlayerCompetitor & {
41
+ entityType: "athlete";
42
+ }) | (FUSportsCountry & {
43
+ entityType: "country";
44
+ }) | (FUSportsVenue & {
45
+ entityType: "venue";
46
+ }) | (FUSportsCoach & {
47
+ entityType: "coach";
48
+ });
49
+ /**
50
+ * Raw entity as stored in cache (before transformation).
51
+ * Kept loose so we cache exactly what the API returns.
52
+ */
53
+ export interface RawSearchEntity {
54
+ id: string;
55
+ [key: string]: unknown;
56
+ }
57
+ export interface EntitySearchResponse {
58
+ data: RawSearchEntity[];
59
+ meta: {
60
+ pagination: PaginationMeta;
61
+ };
62
+ }
63
+ export interface PaginatedResult<T> {
64
+ data: T[];
65
+ pagination: PaginationMeta;
66
+ }
67
+ export interface EntitySearchOptions {
68
+ query?: string;
69
+ contentType?: EntityContentType;
70
+ ids?: string[];
71
+ limit?: number;
72
+ page?: number;
73
+ mode?: SearchMode;
74
+ sport?: string;
75
+ relationship?: string;
76
+ value?: string;
77
+ lang?: string;
78
+ next?: NextCacheOptions;
79
+ config?: DataLayerConfig;
80
+ }
81
+ export interface GetEntityByIdOptions {
82
+ lang?: string;
83
+ next?: NextCacheOptions;
84
+ config?: DataLayerConfig;
85
+ }
86
+ export interface GetEntitiesByIdsOptions {
87
+ lang?: string;
88
+ next?: NextCacheOptions;
89
+ config?: DataLayerConfig;
90
+ }
91
+ export interface GetCompetitionsOptions {
92
+ query?: string;
93
+ limit?: number;
94
+ page?: number;
95
+ sport?: string;
96
+ lang?: string;
97
+ next?: NextCacheOptions;
98
+ config?: DataLayerConfig;
99
+ }
100
+ export interface GetTeamsByCountryOptions {
101
+ query?: string;
102
+ limit?: number;
103
+ page?: number;
104
+ sport?: string;
105
+ lang?: string;
106
+ next?: NextCacheOptions;
107
+ config?: DataLayerConfig;
108
+ }
109
+ export interface GetTeamsByCompetitionOptions {
110
+ query?: string;
111
+ limit?: number;
112
+ page?: number;
113
+ sport?: string;
114
+ lang?: string;
115
+ next?: NextCacheOptions;
116
+ config?: DataLayerConfig;
117
+ }
118
+ export interface GetCountriesOptions {
119
+ query?: string;
120
+ limit?: number;
121
+ page?: number;
122
+ sport?: string;
123
+ lang?: string;
124
+ next?: NextCacheOptions;
125
+ config?: DataLayerConfig;
126
+ }
127
+ export interface GetVenuesOptions {
128
+ query?: string;
129
+ limit?: number;
130
+ page?: number;
131
+ sport?: string;
132
+ lang?: string;
133
+ next?: NextCacheOptions;
134
+ config?: DataLayerConfig;
135
+ }
136
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/fansunited/search/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EACR,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,EACf,aAAa,EACb,aAAa,EACb,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACvB,MAAM,qCAAqC,CAAC;AAE7C,MAAM,M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gB,CAAC;IACxB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC5B"}
@@ -13,4 +13,6 @@ export declare const SPORTAL365_TENNIS_DOMAIN = "https://tennis.api.sportal365.c
13
13
  export declare const SPORTAL365_STATISTICS_DOMAIN = "https://sports-statistics.api.sportal365.com";
14
14
  /** Sports Search API domain */
15
15
  export declare const SPORTAL365_SPORTS_SEARCH_DOMAIN = "https://sports-search.api.sportal365.com";
16
+ /** Standings API domain */
17
+ export declare const SPORTAL365_STANDINGS_DOMAIN = "https://standing.api.sportal365.com";
16
18
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/api/sportal365-sports/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0BAA0B;AAC1B,eAAO,MAAM,0BAA0B,wCAAwC,CAAC;AAEhF,4BAA4B;AAC5B,eAAO,MAAM,4BAA4B,0CAA0C,CAAC;AAEpF,wBAAwB;AACxB,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAE5E,4BAA4B;AAC5B,eAAO,MAAM,4BAA4B,iDAAiD,CAAC;AAE3F,+BAA+B;AAC/B,eAAO,MAAM,+BAA+B,6CAA6C,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/api/sportal365-sports/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0BAA0B;AAC1B,eAAO,MAAM,0BAA0B,wCAAwC,CAAC;AAEhF,4BAA4B;AAC5B,eAAO,MAAM,4BAA4B,0CAA0C,CAAC;AAEpF,wBAAwB;AACxB,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAE5E,4BAA4B;AAC5B,eAAO,MAAM,4BAA4B,iDAAiD,CAAC;AAE3F,+BAA+B;AAC/B,eAAO,MAAM,+BAA+B,6CAA6C,CAAC;AAE1F,2BAA2B;AAC3B,eAAO,MAAM,2BAA2B,wCAAwC,CAAC"}
@@ -12,6 +12,8 @@ export type { GetFootballMatchOptions, GetFootballMatchEventsOptions, GetFootbal
12
12
  export type { GetSportsSearchOptions, SportType, SportsSearchEntityType } from "./search";
13
13
  export type { GetBasketballLivescoreOptions, BasketballMatchStatusType } from "./basketball";
14
14
  export type { GetTennisLivescoreOptions, TennisMatchStatusType, TennisMatchType, TennisGender } from "./tennis";
15
+ export { getSportal365Standings } from "./standings";
16
+ export type { GetSportal365StandingsOptions, StandingsSport, StandingsCoverageType } from "./standings";
15
17
  export { getTeamSeasonStatistics } from "./statistics";
16
18
  export type { GetTeamSeasonStatisticsOptions } from "./statistics";
17
19
  export type { NextCacheOptions } from "./http";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/api/sportal365-sports/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACH,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,iCAAiC,EACjC,cAAc,GACjB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAGtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,YAAY,EACR,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,iCAAiC,EACjC,iCAAiC,EACjC,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,2BAA2B,EAC3B,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,wCAAwC,EACxC,wBAAwB,EACxB,gBAAgB,EAChB,6BAA6B,EAC7B,OAAO,EACP,SAAS,EACT,SAAS,EACT,UAAU,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C7B,OAAO,EACP,SAAS,EACT,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,eAAe,GAClB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,sBAAsB,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAG1F,YAAY,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAG7F,YAAY,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGhH,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EAAE,6BAA6B,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGxG,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,YAAY,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAGnE,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Standings API HTTP client
3
+ */
4
+ /**
5
+ * HTTP client configured for the Sportal365 Standings API
6
+ */
7
+ export declare const standingsHttp: import("../http").Sportal365HttpClient;
8
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/sportal365-sports/standings/http.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,eAAO,MAAM,aAAa,wCAAgD,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Sportal365 Standings API
3
+ *
4
+ * Fetches standings data from the dedicated Standings API (standing.api.sportal365.com)
5
+ * and transforms to canonical FUSports types.
6
+ *
7
+ * Unlike the Football API standings endpoint, this supports:
8
+ * - Multiple sports (football, basketball, ice_hockey)
9
+ * - Multi-stage competitions (e.g., Bulgarian league with regular season + playoffs)
10
+ * - Multi-group competitions (e.g., World Cup with Group A, B, C, etc.)
11
+ * - Column-based stats format
12
+ */
13
+ import type { FUSportsStandingsTable } from "../../../types/canonical";
14
+ import { type DataLayerConfig } from "../../../config";
15
+ import type { GetSportal365StandingsOptions } from "./standing.types";
16
+ export type { RawStandingsApiResponse, RawStandingsApiStageData, RawStandingsApiStage, RawStandingsApiGroupStandings, RawStandingsApiGroup, RawStandingsApiEntry, RawStandingsApiTeam, RawStandingsApiColumn, RawStandingsApiColumnType, RawStandingsApiRule, GetSportal365StandingsOptions, StandingsSport, StandingsCoverageType, } from "./standing.types";
17
+ /**
18
+ * Get standings from the Sportal365 Standings API.
19
+ *
20
+ * Returns an array of standings tables, one per stage/group/coverageType combination.
21
+ * For a simple league (e.g., Premier League), this will typically return 1-2 tables
22
+ * (LIVE and/or FINISHED for the single Overall group).
23
+ * For complex competitions (e.g., World Cup), it may return many tables
24
+ * (one per group per coverage type).
25
+ *
26
+ * @param options - Options including sport, seasonId/stageId, coverageType, etc.
27
+ * @param config - Optional data layer config (uses singleton if not provided)
28
+ * @returns Array of FUSportsStandingsTable objects
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * // Get all standings for a Premier League season
33
+ * const tables = await getSportal365Standings({
34
+ * sport: 'football',
35
+ * seasonId: 'bfa3f13b-5ab1-476c-9ca4-26ce707e8733',
36
+ * coverageType: 'ALL',
37
+ * includeForm: true,
38
+ * });
39
+ *
40
+ * // Filter to just LIVE standings
41
+ * const liveTables = tables.filter(t => t.coverageType === 'LIVE');
42
+ *
43
+ * // Group by stage for multi-stage competitions
44
+ * const byStage = Map.groupBy(tables, t => t.stage.id);
45
+ * ```
46
+ */
47
+ export declare function getSportal365Standings(options: GetSportal365StandingsOptions, config?: DataLayerConfig): Promise<FUSportsStandingsTable[]>;
48
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/sportal365-sports/standings/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,KAAK,EAA2B,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAI/F,YAAY,EACR,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,EAC7B,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,6BAA6B,EAC7B,cAAc,EACd,qBAAqB,GACxB,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,sBAAsB,CACxC,OAAO,EAAE,6BAA6B,EACtC,MAAM,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAwBnC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Standings API Transformer
3
+ * Converts raw Standings API response to canonical FUSports types.
4
+ *
5
+ * Key differences from Football API transformer:
6
+ * - Stats come from key-value columns instead of direct properties
7
+ * - Rules use `standing_api_rule_type` for canonical key mapping
8
+ * - Supports multi-stage / multi-group structures (e.g., World Cup groups, Bulgarian league stages)
9
+ * - Form data uses shared RawFormMatch structure
10
+ */
11
+ import type { FUSportsStandingsTable } from "../../../types/canonical";
12
+ import type { RawStandingsApiResponse } from "./standing.types";
13
+ /**
14
+ * Transform a full Standings API response to an array of FUSportsStandingsTable.
15
+ * Each table represents one stage + group + coverage type combination.
16
+ */
17
+ export declare function transformStandingsApiResponse(raw: RawStandingsApiResponse): FUSportsStandingsTable[];
18
+ //# sourceMappingURL=standing.transformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standing.transformer.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/sportal365-sports/standings/standing.transformer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAKR,sBAAsB,EACzB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAIR,uBAAuB,EAE1B,MAAM,kBAAkB,CAAC;AAiP1B;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,uBAAuB,GAAG,sBAAsB,EAAE,CAIpG"}