fansunited-data-layer 0.14.3 → 0.14.4

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.
@@ -16,7 +16,7 @@ async function getBasketballLivescore(options, config) {
16
16
  odd_client: options?.oddClient ?? sportal365Sports?.oddClient,
17
17
  odd_type: options?.oddType,
18
18
  market_types: options?.marketTypes,
19
- language_code: options?.languageCode ?? sportal365Sports?.languageCode ?? "en"
19
+ translation_language: options?.languageCode ?? sportal365Sports?.languageCode ?? "en"
20
20
  },
21
21
  headers: {
22
22
  "Accept-Language": options?.languageCode ?? sportal365Sports?.languageCode ?? "en"
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/lib/api/sportal365-sports/basketball/games/index.ts"],"sourcesContent":["/**\n * Basketball games API functions\n */\n\nimport type { FUSportsMatch } from \"../../../../types/canonical\";\nimport type { DataLayerConfig } from \"../../../../config\";\nimport { getConfig } from \"../../../../config\";\nimport { basketballHttp } from \"../http\";\nimport type { RawBasketballGame, GetBasketballLivescoreOptions } from \"./types\";\nimport { transformBasketballGame } from \"./transformers/game\";\n\n/**\n * Get basketball livescore data\n *\n * Fetches live and recent basketball games from the Sportal365 Basketball API.\n * Returns data in canonical FUSportsMatch format.\n *\n * @param options - Optional filters and configuration\n * @param config - Optional data layer configuration\n * @returns Array of basketball matches in canonical format\n *\n * @example\n * ```typescript\n * // Get all live basketball games\n * const liveGames = await getBasketballLivescore({\n * statusTypes: ['LIVE']\n * });\n *\n * // Get games for a specific competition\n * const nbaGames = await getBasketballLivescore({\n * competitionList: 'nba',\n * statusTypes: ['LIVE', 'NOT_STARTED']\n * });\n * ```\n */\nexport async function getBasketballLivescore(\n options?: GetBasketballLivescoreOptions,\n config?: DataLayerConfig\n): Promise<FUSportsMatch[]> {\n const finalConfig = config || getConfig();\n const { sportal365Sports } = finalConfig;\n\n const raw = await basketballHttp.get<{ games: RawBasketballGame[] }>({\n path: `/games`,\n params: {\n offset: \"0\",\n limit: \"1000\",\n competition_list: options?.competitionList,\n status_type: options?.statusTypes,\n from_game_time: options?.fromGameTime,\n to_game_time: options?.toGameTime,\n odd_client: options?.oddClient ?? sportal365Sports?.oddClient,\n odd_type: options?.oddType,\n market_types: options?.marketTypes,\n language_code: options?.languageCode ?? sportal365Sports?.languageCode ?? \"en\",\n },\n headers: {\n \"Accept-Language\": options?.languageCode ?? sportal365Sports?.languageCode ?? \"en\",\n },\n next: options?.next,\n config: finalConfig,\n });\n\n return raw.games.map(transformBasketballGame);\n}\n"],"names":[],"mappings":";;;AAmCA,eAAsB,uBAClB,SACA,QACwB;AACxB,QAAM,cAAc,UAAU,UAAA;AAC9B,QAAM,EAAE,qBAAqB;AAE7B,QAAM,MAAM,MAAM,eAAe,IAAoC;AAAA,IACjE,MAAM;AAAA,IACN,QAAQ;AAAA,MACJ,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,kBAAkB,SAAS;AAAA,MAC3B,aAAa,SAAS;AAAA,MACtB,gBAAgB,SAAS;AAAA,MACzB,cAAc,SAAS;AAAA,MACvB,YAAY,SAAS,aAAa,kBAAkB;AAAA,MACpD,UAAU,SAAS;AAAA,MACnB,cAAc,SAAS;AAAA,MACvB,eAAe,SAAS,gBAAgB,kBAAkB,gBAAgB;AAAA,IAAA;AAAA,IAE9E,SAAS;AAAA,MACL,mBAAmB,SAAS,gBAAgB,kBAAkB,gBAAgB;AAAA,IAAA;AAAA,IAElF,MAAM,SAAS;AAAA,IACf,QAAQ;AAAA,EAAA,CACX;AAED,SAAO,IAAI,MAAM,IAAI,uBAAuB;AAChD;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/lib/api/sportal365-sports/basketball/games/index.ts"],"sourcesContent":["/**\n * Basketball games API functions\n */\n\nimport type { FUSportsMatch } from \"../../../../types/canonical\";\nimport type { DataLayerConfig } from \"../../../../config\";\nimport { getConfig } from \"../../../../config\";\nimport { basketballHttp } from \"../http\";\nimport type { RawBasketballGame, GetBasketballLivescoreOptions } from \"./types\";\nimport { transformBasketballGame } from \"./transformers/game\";\n\n/**\n * Get basketball livescore data\n *\n * Fetches live and recent basketball games from the Sportal365 Basketball API.\n * Returns data in canonical FUSportsMatch format.\n *\n * @param options - Optional filters and configuration\n * @param config - Optional data layer configuration\n * @returns Array of basketball matches in canonical format\n *\n * @example\n * ```typescript\n * // Get all live basketball games\n * const liveGames = await getBasketballLivescore({\n * statusTypes: ['LIVE']\n * });\n *\n * // Get games for a specific competition\n * const nbaGames = await getBasketballLivescore({\n * competitionList: 'nba',\n * statusTypes: ['LIVE', 'NOT_STARTED']\n * });\n * ```\n */\nexport async function getBasketballLivescore(\n options?: GetBasketballLivescoreOptions,\n config?: DataLayerConfig\n): Promise<FUSportsMatch[]> {\n const finalConfig = config || getConfig();\n const { sportal365Sports } = finalConfig;\n\n const raw = await basketballHttp.get<{ games: RawBasketballGame[] }>({\n path: `/games`,\n params: {\n offset: \"0\",\n limit: \"1000\",\n competition_list: options?.competitionList,\n status_type: options?.statusTypes,\n from_game_time: options?.fromGameTime,\n to_game_time: options?.toGameTime,\n odd_client: options?.oddClient ?? sportal365Sports?.oddClient,\n odd_type: options?.oddType,\n market_types: options?.marketTypes,\n translation_language: options?.languageCode ?? sportal365Sports?.languageCode ?? \"en\",\n },\n headers: {\n \"Accept-Language\": options?.languageCode ?? sportal365Sports?.languageCode ?? \"en\",\n },\n next: options?.next,\n config: finalConfig,\n });\n\n return raw.games.map(transformBasketballGame);\n}\n"],"names":[],"mappings":";;;AAmCA,eAAsB,uBAClB,SACA,QACwB;AACxB,QAAM,cAAc,UAAU,UAAA;AAC9B,QAAM,EAAE,qBAAqB;AAE7B,QAAM,MAAM,MAAM,eAAe,IAAoC;AAAA,IACjE,MAAM;AAAA,IACN,QAAQ;AAAA,MACJ,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,kBAAkB,SAAS;AAAA,MAC3B,aAAa,SAAS;AAAA,MACtB,gBAAgB,SAAS;AAAA,MACzB,cAAc,SAAS;AAAA,MACvB,YAAY,SAAS,aAAa,kBAAkB;AAAA,MACpD,UAAU,SAAS;AAAA,MACnB,cAAc,SAAS;AAAA,MACvB,sBAAsB,SAAS,gBAAgB,kBAAkB,gBAAgB;AAAA,IAAA;AAAA,IAErF,SAAS;AAAA,MACL,mBAAmB,SAAS,gBAAgB,kBAAkB,gBAAgB;AAAA,IAAA;AAAA,IAElF,MAAM,SAAS;AAAA,IACf,QAAQ;AAAA,EAAA,CACX;AAED,SAAO,IAAI,MAAM,IAAI,uBAAuB;AAChD;"}
@@ -18,7 +18,7 @@ async function getTennisLivescore(options, config) {
18
18
  odd_client: options?.oddClient ?? sportal365Sports?.oddClient,
19
19
  odd_type: options?.oddType,
20
20
  market_types: options?.marketTypes,
21
- language_code: options?.languageCode ?? sportal365Sports?.languageCode ?? "en"
21
+ translation_language: options?.languageCode ?? sportal365Sports?.languageCode ?? "en"
22
22
  },
23
23
  headers: {
24
24
  "Accept-Language": options?.languageCode ?? sportal365Sports?.languageCode ?? "en"
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/lib/api/sportal365-sports/tennis/matches/index.ts"],"sourcesContent":["/**\n * Tennis matches API functions\n */\n\nimport type { FUSportsMatch } from \"../../../../types/canonical\";\nimport type { DataLayerConfig } from \"../../../../config\";\nimport { getConfig } from \"../../../../config\";\nimport { tennisHttp } from \"../http\";\nimport type { RawTennisMatch, GetTennisLivescoreOptions } from \"./types\";\nimport { transformTennisMatch } from \"./transformers/match\";\n\n/**\n * Get tennis livescore data\n *\n * Fetches live and recent tennis matches from the Sportal365 Tennis API.\n * Returns data in canonical FUSportsMatch format.\n *\n * @param options - Optional filters and configuration\n * @param config - Optional data layer configuration\n * @returns Array of tennis matches in canonical format\n *\n * @example\n * ```typescript\n * // Get all live tennis matches\n * const liveMatches = await getTennisLivescore({\n * statusType: ['LIVE']\n * });\n *\n * // Get singles matches for a specific date\n * const matches = await getTennisLivescore({\n * date: '2024-01-15',\n * type: 'SINGLE',\n * gender: 'MALE'\n * });\n * ```\n */\nexport async function getTennisLivescore(\n options?: GetTennisLivescoreOptions,\n config?: DataLayerConfig\n): Promise<FUSportsMatch[]> {\n const finalConfig = config || getConfig();\n const { sportal365Sports } = finalConfig;\n\n const raw = await tennisHttp.get<{ matches: RawTennisMatch[] }>({\n path: `/matches/livescore`,\n params: {\n date: options?.date,\n utc_offset: options?.utcOffset?.toString(),\n offset: \"0\",\n limit: \"1000\",\n type: options?.type,\n gender: options?.gender,\n status_type: options?.statusType,\n competition_list: options?.competitionList,\n odd_client: options?.oddClient ?? sportal365Sports?.oddClient,\n odd_type: options?.oddType,\n market_types: options?.marketTypes,\n language_code: options?.languageCode ?? sportal365Sports?.languageCode ?? \"en\",\n },\n headers: {\n \"Accept-Language\": options?.languageCode ?? sportal365Sports?.languageCode ?? \"en\",\n },\n next: options?.next,\n config: finalConfig,\n });\n\n return raw.matches.map(transformTennisMatch);\n}\n"],"names":[],"mappings":";;;AAoCA,eAAsB,mBAClB,SACA,QACwB;AACxB,QAAM,cAAc,UAAU,UAAA;AAC9B,QAAM,EAAE,qBAAqB;AAE7B,QAAM,MAAM,MAAM,WAAW,IAAmC;AAAA,IAC5D,MAAM;AAAA,IACN,QAAQ;AAAA,MACJ,MAAM,SAAS;AAAA,MACf,YAAY,SAAS,WAAW,SAAA;AAAA,MAChC,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,MAAM,SAAS;AAAA,MACf,QAAQ,SAAS;AAAA,MACjB,aAAa,SAAS;AAAA,MACtB,kBAAkB,SAAS;AAAA,MAC3B,YAAY,SAAS,aAAa,kBAAkB;AAAA,MACpD,UAAU,SAAS;AAAA,MACnB,cAAc,SAAS;AAAA,MACvB,eAAe,SAAS,gBAAgB,kBAAkB,gBAAgB;AAAA,IAAA;AAAA,IAE9E,SAAS;AAAA,MACL,mBAAmB,SAAS,gBAAgB,kBAAkB,gBAAgB;AAAA,IAAA;AAAA,IAElF,MAAM,SAAS;AAAA,IACf,QAAQ;AAAA,EAAA,CACX;AAED,SAAO,IAAI,QAAQ,IAAI,oBAAoB;AAC/C;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/lib/api/sportal365-sports/tennis/matches/index.ts"],"sourcesContent":["/**\n * Tennis matches API functions\n */\n\nimport type { FUSportsMatch } from \"../../../../types/canonical\";\nimport type { DataLayerConfig } from \"../../../../config\";\nimport { getConfig } from \"../../../../config\";\nimport { tennisHttp } from \"../http\";\nimport type { RawTennisMatch, GetTennisLivescoreOptions } from \"./types\";\nimport { transformTennisMatch } from \"./transformers/match\";\n\n/**\n * Get tennis livescore data\n *\n * Fetches live and recent tennis matches from the Sportal365 Tennis API.\n * Returns data in canonical FUSportsMatch format.\n *\n * @param options - Optional filters and configuration\n * @param config - Optional data layer configuration\n * @returns Array of tennis matches in canonical format\n *\n * @example\n * ```typescript\n * // Get all live tennis matches\n * const liveMatches = await getTennisLivescore({\n * statusType: ['LIVE']\n * });\n *\n * // Get singles matches for a specific date\n * const matches = await getTennisLivescore({\n * date: '2024-01-15',\n * type: 'SINGLE',\n * gender: 'MALE'\n * });\n * ```\n */\nexport async function getTennisLivescore(\n options?: GetTennisLivescoreOptions,\n config?: DataLayerConfig\n): Promise<FUSportsMatch[]> {\n const finalConfig = config || getConfig();\n const { sportal365Sports } = finalConfig;\n\n const raw = await tennisHttp.get<{ matches: RawTennisMatch[] }>({\n path: `/matches/livescore`,\n params: {\n date: options?.date,\n utc_offset: options?.utcOffset?.toString(),\n offset: \"0\",\n limit: \"1000\",\n type: options?.type,\n gender: options?.gender,\n status_type: options?.statusType,\n competition_list: options?.competitionList,\n odd_client: options?.oddClient ?? sportal365Sports?.oddClient,\n odd_type: options?.oddType,\n market_types: options?.marketTypes,\n translation_language: options?.languageCode ?? sportal365Sports?.languageCode ?? \"en\",\n },\n headers: {\n \"Accept-Language\": options?.languageCode ?? sportal365Sports?.languageCode ?? \"en\",\n },\n next: options?.next,\n config: finalConfig,\n });\n\n return raw.matches.map(transformTennisMatch);\n}\n"],"names":[],"mappings":";;;AAoCA,eAAsB,mBAClB,SACA,QACwB;AACxB,QAAM,cAAc,UAAU,UAAA;AAC9B,QAAM,EAAE,qBAAqB;AAE7B,QAAM,MAAM,MAAM,WAAW,IAAmC;AAAA,IAC5D,MAAM;AAAA,IACN,QAAQ;AAAA,MACJ,MAAM,SAAS;AAAA,MACf,YAAY,SAAS,WAAW,SAAA;AAAA,MAChC,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,MAAM,SAAS;AAAA,MACf,QAAQ,SAAS;AAAA,MACjB,aAAa,SAAS;AAAA,MACtB,kBAAkB,SAAS;AAAA,MAC3B,YAAY,SAAS,aAAa,kBAAkB;AAAA,MACpD,UAAU,SAAS;AAAA,MACnB,cAAc,SAAS;AAAA,MACvB,sBAAsB,SAAS,gBAAgB,kBAAkB,gBAAgB;AAAA,IAAA;AAAA,IAErF,SAAS;AAAA,MACL,mBAAmB,SAAS,gBAAgB,kBAAkB,gBAAgB;AAAA,IAAA;AAAA,IAElF,MAAM,SAAS;AAAA,IACf,QAAQ;AAAA,EAAA,CACX;AAED,SAAO,IAAI,QAAQ,IAAI,oBAAoB;AAC/C;"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "A TypeScript library for fetching and transforming sports data from multiple API providers. Returns clean, canonical types that are provider-agnostic.",
5
5
  "homepage": "https://fansunited.com/",
6
6
  "private": false,
7
- "version": "0.14.3",
7
+ "version": "0.14.4",
8
8
  "type": "module",
9
9
  "sideEffects": false,
10
10
  "module": "./fansunited-data-layer.js",