@sudobility/sports_api_client 1.0.7 → 1.0.10

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 (244) hide show
  1. package/dist/baseball/hooks/baseball-context.js.map +1 -1
  2. package/dist/baseball/hooks/baseball-types.js.map +1 -1
  3. package/dist/baseball/hooks/index.js.map +1 -1
  4. package/dist/baseball/hooks/use-baseball-countries.js.map +1 -1
  5. package/dist/baseball/hooks/use-baseball-games.js.map +1 -1
  6. package/dist/baseball/hooks/use-baseball-leagues.js.map +1 -1
  7. package/dist/baseball/hooks/use-baseball-seasons.js.map +1 -1
  8. package/dist/baseball/hooks/use-baseball-standings.js.map +1 -1
  9. package/dist/baseball/hooks/use-baseball-teams.js.map +1 -1
  10. package/dist/baseball/hooks/use-baseball-timezone.js.map +1 -1
  11. package/dist/baseball/index.js.map +1 -1
  12. package/dist/baseball/network/api-baseball-client.js.map +1 -1
  13. package/dist/baseball/network/baseball-endpoints.js.map +1 -1
  14. package/dist/baseball/network/index.js.map +1 -1
  15. package/dist/baseball/store/api-baseball-store.js.map +1 -1
  16. package/dist/baseball/store/index.js.map +1 -1
  17. package/dist/baseball/types/baseball-common.js.map +1 -1
  18. package/dist/baseball/types/baseball-games.js.map +1 -1
  19. package/dist/baseball/types/baseball-leagues.js.map +1 -1
  20. package/dist/baseball/types/baseball-standings.js.map +1 -1
  21. package/dist/baseball/types/baseball-teams.js.map +1 -1
  22. package/dist/baseball/types/index.js.map +1 -1
  23. package/dist/basketball/hooks/basketball-context.js.map +1 -1
  24. package/dist/basketball/hooks/basketball-types.js.map +1 -1
  25. package/dist/basketball/hooks/index.js.map +1 -1
  26. package/dist/basketball/hooks/use-basketball-countries.js.map +1 -1
  27. package/dist/basketball/hooks/use-basketball-games.js.map +1 -1
  28. package/dist/basketball/hooks/use-basketball-leagues.js.map +1 -1
  29. package/dist/basketball/hooks/use-basketball-seasons.js.map +1 -1
  30. package/dist/basketball/hooks/use-basketball-standings.js.map +1 -1
  31. package/dist/basketball/hooks/use-basketball-teams.js.map +1 -1
  32. package/dist/basketball/hooks/use-basketball-timezone.js.map +1 -1
  33. package/dist/basketball/index.js.map +1 -1
  34. package/dist/basketball/network/api-basketball-client.js.map +1 -1
  35. package/dist/basketball/network/basketball-endpoints.js.map +1 -1
  36. package/dist/basketball/network/index.js.map +1 -1
  37. package/dist/basketball/store/api-basketball-store.js.map +1 -1
  38. package/dist/basketball/store/index.js.map +1 -1
  39. package/dist/basketball/types/basketball-common.js.map +1 -1
  40. package/dist/basketball/types/basketball-games.js.map +1 -1
  41. package/dist/basketball/types/basketball-leagues.js.map +1 -1
  42. package/dist/basketball/types/basketball-standings.js.map +1 -1
  43. package/dist/basketball/types/basketball-teams.js.map +1 -1
  44. package/dist/basketball/types/index.js.map +1 -1
  45. package/dist/common/base-types.js.map +1 -1
  46. package/dist/common/index.js.map +1 -1
  47. package/dist/football/hooks/football-context.js.map +1 -1
  48. package/dist/football/hooks/football-types.js.map +1 -1
  49. package/dist/football/hooks/index.js.map +1 -1
  50. package/dist/football/hooks/use-football-coaches.js.map +1 -1
  51. package/dist/football/hooks/use-football-countries.js.map +1 -1
  52. package/dist/football/hooks/use-football-fixtures.js.map +1 -1
  53. package/dist/football/hooks/use-football-injuries.js.map +1 -1
  54. package/dist/football/hooks/use-football-leagues.js.map +1 -1
  55. package/dist/football/hooks/use-football-players.js.map +1 -1
  56. package/dist/football/hooks/use-football-seasons.js.map +1 -1
  57. package/dist/football/hooks/use-football-sidelined.js.map +1 -1
  58. package/dist/football/hooks/use-football-standings.js.map +1 -1
  59. package/dist/football/hooks/use-football-teams.js.map +1 -1
  60. package/dist/football/hooks/use-football-timezone.js.map +1 -1
  61. package/dist/football/hooks/use-football-transfers.js.map +1 -1
  62. package/dist/football/hooks/use-football-trophies.js.map +1 -1
  63. package/dist/football/network/api-football-client.js.map +1 -1
  64. package/dist/football/network/football-endpoints.js.map +1 -1
  65. package/dist/football/network/index.js.map +1 -1
  66. package/dist/football/store/api-football-store.js.map +1 -1
  67. package/dist/football/store/index.js.map +1 -1
  68. package/dist/football/types/football-common.js.map +1 -1
  69. package/dist/football/types/football-countries.js.map +1 -1
  70. package/dist/football/types/football-fixtures.js.map +1 -1
  71. package/dist/football/types/football-leagues.js.map +1 -1
  72. package/dist/football/types/football-players.js.map +1 -1
  73. package/dist/football/types/football-standings.js.map +1 -1
  74. package/dist/football/types/football-statistics.js.map +1 -1
  75. package/dist/football/types/football-teams.js.map +1 -1
  76. package/dist/football/types/football-transfers.js.map +1 -1
  77. package/dist/football/types/index.js.map +1 -1
  78. package/dist/formula1/hooks/f1-context.js.map +1 -1
  79. package/dist/formula1/hooks/f1-types.js.map +1 -1
  80. package/dist/formula1/hooks/index.js.map +1 -1
  81. package/dist/formula1/hooks/use-f1-circuits.js.map +1 -1
  82. package/dist/formula1/hooks/use-f1-competitions.js.map +1 -1
  83. package/dist/formula1/hooks/use-f1-drivers.js.map +1 -1
  84. package/dist/formula1/hooks/use-f1-pitstops.js.map +1 -1
  85. package/dist/formula1/hooks/use-f1-races.js.map +1 -1
  86. package/dist/formula1/hooks/use-f1-rankings.js.map +1 -1
  87. package/dist/formula1/hooks/use-f1-seasons.js.map +1 -1
  88. package/dist/formula1/hooks/use-f1-teams.js.map +1 -1
  89. package/dist/formula1/hooks/use-f1-timezone.js.map +1 -1
  90. package/dist/formula1/index.js.map +1 -1
  91. package/dist/formula1/network/api-f1-client.js.map +1 -1
  92. package/dist/formula1/network/f1-endpoints.js.map +1 -1
  93. package/dist/formula1/network/index.js.map +1 -1
  94. package/dist/formula1/store/api-f1-store.js.map +1 -1
  95. package/dist/formula1/store/index.js.map +1 -1
  96. package/dist/formula1/types/f1-circuits.js.map +1 -1
  97. package/dist/formula1/types/f1-common.js.map +1 -1
  98. package/dist/formula1/types/f1-competitions.js.map +1 -1
  99. package/dist/formula1/types/f1-drivers.js.map +1 -1
  100. package/dist/formula1/types/f1-pitstops.js.map +1 -1
  101. package/dist/formula1/types/f1-races.js.map +1 -1
  102. package/dist/formula1/types/f1-rankings.js.map +1 -1
  103. package/dist/formula1/types/f1-teams.js.map +1 -1
  104. package/dist/formula1/types/index.js.map +1 -1
  105. package/dist/handball/hooks/handball-context.js.map +1 -1
  106. package/dist/handball/hooks/handball-types.js.map +1 -1
  107. package/dist/handball/hooks/index.js.map +1 -1
  108. package/dist/handball/hooks/use-handball-countries.js.map +1 -1
  109. package/dist/handball/hooks/use-handball-games.js.map +1 -1
  110. package/dist/handball/hooks/use-handball-h2h.js.map +1 -1
  111. package/dist/handball/hooks/use-handball-leagues.js.map +1 -1
  112. package/dist/handball/hooks/use-handball-odds.js.map +1 -1
  113. package/dist/handball/hooks/use-handball-seasons.js.map +1 -1
  114. package/dist/handball/hooks/use-handball-standings.js.map +1 -1
  115. package/dist/handball/hooks/use-handball-teams.js.map +1 -1
  116. package/dist/handball/hooks/use-handball-timezone.js.map +1 -1
  117. package/dist/handball/index.js.map +1 -1
  118. package/dist/handball/network/api-handball-client.js.map +1 -1
  119. package/dist/handball/network/handball-endpoints.js.map +1 -1
  120. package/dist/handball/network/index.js.map +1 -1
  121. package/dist/handball/store/api-handball-store.js.map +1 -1
  122. package/dist/handball/store/index.js.map +1 -1
  123. package/dist/handball/types/handball-common.js.map +1 -1
  124. package/dist/handball/types/handball-games.js.map +1 -1
  125. package/dist/handball/types/handball-leagues.js.map +1 -1
  126. package/dist/handball/types/handball-odds.js.map +1 -1
  127. package/dist/handball/types/handball-standings.js.map +1 -1
  128. package/dist/handball/types/handball-teams.js.map +1 -1
  129. package/dist/handball/types/index.js.map +1 -1
  130. package/dist/hockey/hooks/hockey-context.js.map +1 -1
  131. package/dist/hockey/hooks/hockey-types.js.map +1 -1
  132. package/dist/hockey/hooks/index.js.map +1 -1
  133. package/dist/hockey/hooks/use-hockey-countries.js.map +1 -1
  134. package/dist/hockey/hooks/use-hockey-games.js.map +1 -1
  135. package/dist/hockey/hooks/use-hockey-leagues.js.map +1 -1
  136. package/dist/hockey/hooks/use-hockey-seasons.js.map +1 -1
  137. package/dist/hockey/hooks/use-hockey-standings.js.map +1 -1
  138. package/dist/hockey/hooks/use-hockey-teams.js.map +1 -1
  139. package/dist/hockey/hooks/use-hockey-timezone.js.map +1 -1
  140. package/dist/hockey/index.js.map +1 -1
  141. package/dist/hockey/network/api-hockey-client.js.map +1 -1
  142. package/dist/hockey/network/hockey-endpoints.js.map +1 -1
  143. package/dist/hockey/network/index.js.map +1 -1
  144. package/dist/hockey/store/api-hockey-store.js.map +1 -1
  145. package/dist/hockey/store/index.js.map +1 -1
  146. package/dist/hockey/types/hockey-common.js.map +1 -1
  147. package/dist/hockey/types/hockey-games.js.map +1 -1
  148. package/dist/hockey/types/hockey-leagues.js.map +1 -1
  149. package/dist/hockey/types/hockey-standings.js.map +1 -1
  150. package/dist/hockey/types/hockey-teams.js.map +1 -1
  151. package/dist/hockey/types/index.js.map +1 -1
  152. package/dist/index.js.map +1 -1
  153. package/dist/mma/hooks/index.js.map +1 -1
  154. package/dist/mma/hooks/mma-context.js.map +1 -1
  155. package/dist/mma/hooks/mma-types.js.map +1 -1
  156. package/dist/mma/hooks/use-mma-categories.js.map +1 -1
  157. package/dist/mma/hooks/use-mma-countries.js.map +1 -1
  158. package/dist/mma/hooks/use-mma-fighters.js.map +1 -1
  159. package/dist/mma/hooks/use-mma-fights.js.map +1 -1
  160. package/dist/mma/hooks/use-mma-seasons.js.map +1 -1
  161. package/dist/mma/hooks/use-mma-timezone.js.map +1 -1
  162. package/dist/mma/index.js.map +1 -1
  163. package/dist/mma/network/api-mma-client.js.map +1 -1
  164. package/dist/mma/network/index.js.map +1 -1
  165. package/dist/mma/network/mma-endpoints.js.map +1 -1
  166. package/dist/mma/store/api-mma-store.js.map +1 -1
  167. package/dist/mma/store/index.js.map +1 -1
  168. package/dist/mma/types/index.js.map +1 -1
  169. package/dist/mma/types/mma-categories.js.map +1 -1
  170. package/dist/mma/types/mma-common.js.map +1 -1
  171. package/dist/mma/types/mma-fighters.js.map +1 -1
  172. package/dist/mma/types/mma-fights.js.map +1 -1
  173. package/dist/mma/types/mma-leagues.js.map +1 -1
  174. package/dist/nfl/hooks/index.js.map +1 -1
  175. package/dist/nfl/hooks/nfl-context.js.map +1 -1
  176. package/dist/nfl/hooks/nfl-types.js.map +1 -1
  177. package/dist/nfl/hooks/use-nfl-countries.js.map +1 -1
  178. package/dist/nfl/hooks/use-nfl-games.js.map +1 -1
  179. package/dist/nfl/hooks/use-nfl-leagues.js.map +1 -1
  180. package/dist/nfl/hooks/use-nfl-seasons.js.map +1 -1
  181. package/dist/nfl/hooks/use-nfl-standings.js.map +1 -1
  182. package/dist/nfl/hooks/use-nfl-teams.js.map +1 -1
  183. package/dist/nfl/hooks/use-nfl-timezone.js.map +1 -1
  184. package/dist/nfl/index.js.map +1 -1
  185. package/dist/nfl/network/api-nfl-client.js.map +1 -1
  186. package/dist/nfl/network/index.js.map +1 -1
  187. package/dist/nfl/network/nfl-endpoints.js.map +1 -1
  188. package/dist/nfl/store/api-nfl-store.js.map +1 -1
  189. package/dist/nfl/store/index.js.map +1 -1
  190. package/dist/nfl/types/index.js.map +1 -1
  191. package/dist/nfl/types/nfl-common.js.map +1 -1
  192. package/dist/nfl/types/nfl-games.js.map +1 -1
  193. package/dist/nfl/types/nfl-leagues.js.map +1 -1
  194. package/dist/nfl/types/nfl-standings.js.map +1 -1
  195. package/dist/nfl/types/nfl-teams.js.map +1 -1
  196. package/dist/rugby/hooks/index.js.map +1 -1
  197. package/dist/rugby/hooks/rugby-context.js.map +1 -1
  198. package/dist/rugby/hooks/rugby-types.js.map +1 -1
  199. package/dist/rugby/hooks/use-rugby-countries.js.map +1 -1
  200. package/dist/rugby/hooks/use-rugby-games.js.map +1 -1
  201. package/dist/rugby/hooks/use-rugby-leagues.js.map +1 -1
  202. package/dist/rugby/hooks/use-rugby-seasons.js.map +1 -1
  203. package/dist/rugby/hooks/use-rugby-standings.js.map +1 -1
  204. package/dist/rugby/hooks/use-rugby-teams.js.map +1 -1
  205. package/dist/rugby/hooks/use-rugby-timezone.js.map +1 -1
  206. package/dist/rugby/index.js.map +1 -1
  207. package/dist/rugby/network/api-rugby-client.js.map +1 -1
  208. package/dist/rugby/network/index.js.map +1 -1
  209. package/dist/rugby/network/rugby-endpoints.js.map +1 -1
  210. package/dist/rugby/store/api-rugby-store.js.map +1 -1
  211. package/dist/rugby/store/index.js.map +1 -1
  212. package/dist/rugby/types/index.js.map +1 -1
  213. package/dist/rugby/types/rugby-common.js.map +1 -1
  214. package/dist/rugby/types/rugby-games.js.map +1 -1
  215. package/dist/rugby/types/rugby-leagues.js.map +1 -1
  216. package/dist/rugby/types/rugby-standings.js.map +1 -1
  217. package/dist/rugby/types/rugby-teams.js.map +1 -1
  218. package/dist/utils/cache-utils.js.map +1 -1
  219. package/dist/utils/index.js.map +1 -1
  220. package/dist/utils/query-params.js.map +1 -1
  221. package/dist/volleyball/hooks/index.js.map +1 -1
  222. package/dist/volleyball/hooks/use-volleyball-countries.js.map +1 -1
  223. package/dist/volleyball/hooks/use-volleyball-games.js.map +1 -1
  224. package/dist/volleyball/hooks/use-volleyball-h2h.js.map +1 -1
  225. package/dist/volleyball/hooks/use-volleyball-leagues.js.map +1 -1
  226. package/dist/volleyball/hooks/use-volleyball-seasons.js.map +1 -1
  227. package/dist/volleyball/hooks/use-volleyball-standings.js.map +1 -1
  228. package/dist/volleyball/hooks/use-volleyball-teams.js.map +1 -1
  229. package/dist/volleyball/hooks/use-volleyball-timezone.js.map +1 -1
  230. package/dist/volleyball/hooks/volleyball-context.js.map +1 -1
  231. package/dist/volleyball/hooks/volleyball-types.js.map +1 -1
  232. package/dist/volleyball/index.js.map +1 -1
  233. package/dist/volleyball/network/api-volleyball-client.js.map +1 -1
  234. package/dist/volleyball/network/index.js.map +1 -1
  235. package/dist/volleyball/network/volleyball-endpoints.js.map +1 -1
  236. package/dist/volleyball/store/api-volleyball-store.js.map +1 -1
  237. package/dist/volleyball/store/index.js.map +1 -1
  238. package/dist/volleyball/types/index.js.map +1 -1
  239. package/dist/volleyball/types/volleyball-common.js.map +1 -1
  240. package/dist/volleyball/types/volleyball-games.js.map +1 -1
  241. package/dist/volleyball/types/volleyball-leagues.js.map +1 -1
  242. package/dist/volleyball/types/volleyball-standings.js.map +1 -1
  243. package/dist/volleyball/types/volleyball-teams.js.map +1 -1
  244. package/package.json +23 -29
@@ -1 +1 @@
1
- {"version":3,"file":"baseball-context.js","sourceRoot":"","sources":["../../../src/baseball/hooks/baseball-context.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EACZ,aAAa,EAEb,UAAU,EACV,OAAO,GACR,MAAM,OAAO,CAAC;AAGf,OAAO,EAGL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAclB,MAAM,kBAAkB,GAAG,aAAa,CAAiC,IAAI,CAAC,CAAC;AAoB/E,MAAM,UAAU,mBAAmB,CAAC,EAClC,MAAM,EACN,cAAc,EACd,QAAQ,GACiB;IAEzB,MAAM,QAAQ,GAAG,OAAO,CACtB,GAAG,EAAE,CAAC,sBAAsB,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC,EAClE,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAC5B,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;IAEF,OAAO,CACL,oBAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAC7C,QAAQ,CACmB,CAC/B,CAAC;AACJ,CAAC;AAQD,MAAM,UAAU,oBAAoB;IAClC,MAAM,OAAO,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,iEAAiE,CAClE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,CAAC;AAC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kBAAkB,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,iEAAiE,CAClE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,CAAC;AACxB,CAAC;AAQD,MAAM,UAAU,0BAA0B;IACxC,MAAM,OAAO,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC1B,CAAC;AAQD,MAAM,UAAU,mBAAmB;IACjC,MAAM,QAAQ,GAAG,0BAA0B,EAAE,CAAC;IAC9C,OAAO,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC","sourcesContent":["/**\n * @module hooks/baseball-context\n * @description React context for API-Baseball client and store\n */\n\nimport React, {\n createContext,\n type ReactNode,\n useContext,\n useMemo,\n} from \"react\";\nimport type { StorageService } from \"@sudobility/di\";\nimport type { ApiBaseballClient } from \"../network/api-baseball-client\";\nimport {\n type ApiBaseballState,\n type ApiBaseballStore,\n createApiBaseballStore,\n createStorageAdapter,\n} from \"../store\";\n\n/**\n * Context value containing the API client and store\n */\ninterface ApiBaseballContextValue {\n client: ApiBaseballClient;\n useStore: ApiBaseballStore;\n}\n\n/**\n * React context for API-Baseball client and store\n * @internal\n */\nconst ApiBaseballContext = createContext<ApiBaseballContextValue | null>(null);\n\n/**\n * Props for ApiBaseballProvider\n */\nexport interface ApiBaseballProviderProps {\n /** The ApiBaseballClient instance to provide */\n client: ApiBaseballClient;\n /** Storage service from DI for cross-platform persistence */\n storageService: StorageService;\n /** Child components */\n children: ReactNode;\n}\n\n/**\n * Provider component for API-Baseball hooks\n *\n * @param props - Provider props including client, storageService, and children\n * @returns Provider component\n */\nexport function ApiBaseballProvider({\n client,\n storageService,\n children,\n}: ApiBaseballProviderProps) {\n // Create store once with the provided storage service\n const useStore = useMemo(\n () => createApiBaseballStore(createStorageAdapter(storageService)),\n [storageService],\n );\n\n const contextValue = useMemo(\n () => ({ client, useStore }),\n [client, useStore],\n );\n\n return (\n <ApiBaseballContext.Provider value={contextValue}>\n {children}\n </ApiBaseballContext.Provider>\n );\n}\n\n/**\n * Hook to access the ApiBaseballClient from context\n *\n * @returns The ApiBaseballClient instance\n * @throws Error if used outside of ApiBaseballProvider\n */\nexport function useApiBaseballClient(): ApiBaseballClient {\n const context = useContext(ApiBaseballContext);\n if (!context) {\n throw new Error(\n \"useApiBaseballClient must be used within an ApiBaseballProvider\",\n );\n }\n return context.client;\n}\n\n/**\n * Hook to access the API-Baseball Zustand store from context\n *\n * @returns The Zustand store hook for API-Baseball state\n * @throws Error if used outside of ApiBaseballProvider\n */\nexport function useApiBaseballStoreContext(): ApiBaseballStore {\n const context = useContext(ApiBaseballContext);\n if (!context) {\n throw new Error(\n \"useApiBaseballStoreContext must be used within an ApiBaseballProvider\",\n );\n }\n return context.useStore;\n}\n\n/**\n * Hook to access API-Baseball store state\n *\n * @returns Full store state with getters, setters, and cached data\n * @throws Error if used outside of ApiBaseballProvider\n */\nexport function useApiBaseballStore(): ApiBaseballState {\n const useStore = useApiBaseballStoreContext();\n return useStore((state) => state);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"baseball-types.js","sourceRoot":"","sources":["../../../src/baseball/hooks/baseball-types.ts"],"names":[],"mappings":"AAkCA,MAAM,iBAAiB,GAAG,CAAC,cAAc,CAAU,CAAC;AAKpD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE,iBAAiB;IAGtB,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,iBAAiB,EAAE,UAAU,CAAU;IAC3D,SAAS,EAAE;QACT,GAAG,EAAE,CAAC,GAAG,iBAAiB,EAAE,WAAW,CAAU;QACjD,IAAI,EAAE,CAAC,MAAe,EAA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BAAiB,EAAE,MAAM,CAAU;KAC7D;IAGD,KAAK,EAAE;QACL,GAAG,EAAE,CAAC,GAAG,iBAAiB,EAAE,OAAO,CAAU;QAC7C,IAAI,EAAE,CAAC,MAAe,EAAE,EAAE,CACxB,CAAC,GAAG,iBAAiB,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE,CAAU;QACxD,UAAU,EAAE,CAAC,MAAc,EAAE,EAAE,CAC7B,CAAC,GAAG,iBAAiB,EAAE,WAAW,EAAE,MAAM,CAAU;QACtD,UAAU,EAAE,CAAC,MAAc,EAAE,EAAE,CAC7B,CAAC,GAAG,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,CAAU;KAC7D;IAGD,SAAS,EAAE;QACT,GAAG,EAAE,CAAC,GAAG,iBAAiB,EAAE,WAAW,CAAU;QACjD,IAAI,EAAE,CAAC,MAAc,EAAE,EAAE,CACvB,CAAC,GAAG,iBAAiB,EAAE,WAAW,EAAE,MAAM,CAAU;KACvD;CACO,CAAC","sourcesContent":["/**\n * @module hooks/baseball-types\n * @description Type definitions for API-Baseball hooks\n */\n\nimport type { UseQueryOptions } from \"@tanstack/react-query\";\nimport type { ApiBaseballResponse } from \"../types\";\n\n/**\n * Base options for all API-Baseball hooks\n */\nexport interface UseApiBaseballQueryOptions<TData, TParams = void> extends Omit<\n UseQueryOptions<ApiBaseballResponse<TData>, Error>,\n \"queryKey\" | \"queryFn\"\n> {\n /** Parameters for the API call */\n params?: TParams;\n}\n\n/**\n * Options for hooks with required parameters\n */\nexport interface UseApiBaseballQueryOptionsRequired<\n TData,\n TParams,\n> extends Omit<\n UseQueryOptions<ApiBaseballResponse<TData>, Error>,\n \"queryKey\" | \"queryFn\"\n> {\n /** Parameters for the API call (required) */\n params: TParams;\n}\n\n// Base key for all API-Baseball queries\nconst BASEBALL_BASE_KEY = [\"api-baseball\"] as const;\n\n/**\n * Query keys namespace for all API-Baseball queries\n */\nexport const apiBaseballKeys = {\n all: BASEBALL_BASE_KEY,\n\n // General\n timezone: () => [...BASEBALL_BASE_KEY, \"timezone\"] as const,\n countries: {\n all: [...BASEBALL_BASE_KEY, \"countries\"] as const,\n list: (params?: object) =>\n [...BASEBALL_BASE_KEY, \"countries\", params ?? {}] as const,\n },\n seasons: {\n all: [...BASEBALL_BASE_KEY, \"seasons\"] as const,\n list: (params?: object) =>\n [...BASEBALL_BASE_KEY, \"seasons\", params ?? {}] as const,\n },\n\n // Leagues\n leagues: {\n all: [...BASEBALL_BASE_KEY, \"leagues\"] as const,\n list: (params?: object) =>\n [...BASEBALL_BASE_KEY, \"leagues\", params ?? {}] as const,\n },\n\n // Teams\n teams: {\n all: [...BASEBALL_BASE_KEY, \"teams\"] as const,\n list: (params?: object) =>\n [...BASEBALL_BASE_KEY, \"teams\", params ?? {}] as const,\n statistics: (params: object) =>\n [...BASEBALL_BASE_KEY, \"team-statistics\", params] as const,\n },\n\n // Games\n games: {\n all: [...BASEBALL_BASE_KEY, \"games\"] as const,\n list: (params?: object) =>\n [...BASEBALL_BASE_KEY, \"games\", params ?? {}] as const,\n headToHead: (params: object) =>\n [...BASEBALL_BASE_KEY, \"games-h2h\", params] as const,\n statistics: (params: object) =>\n [...BASEBALL_BASE_KEY, \"game-statistics\", params] as const,\n },\n\n // Standings\n standings: {\n all: [...BASEBALL_BASE_KEY, \"standings\"] as const,\n list: (params: object) =>\n [...BASEBALL_BASE_KEY, \"standings\", params] as const,\n },\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/baseball/hooks/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,GAE3B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,eAAe,GAGhB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EACL,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/baseball/hooks/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,GAE3B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,eAAe,GAGhB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EACL,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/**\n * @module baseball/hooks\n * @description Hook exports for API-Baseball\n */\n\nexport {\n ApiBaseballProvider,\n useApiBaseballClient,\n useApiBaseballStore,\n useApiBaseballStoreContext,\n type ApiBaseballProviderProps,\n} from \"./baseball-context\";\n\nexport {\n apiBaseballKeys,\n type UseApiBaseballQueryOptions,\n type UseApiBaseballQueryOptionsRequired,\n} from \"./baseball-types\";\n\nexport { useBaseballTimezone } from \"./use-baseball-timezone\";\nexport { useBaseballCountries } from \"./use-baseball-countries\";\nexport { useBaseballSeasons } from \"./use-baseball-seasons\";\nexport { useBaseballLeagues } from \"./use-baseball-leagues\";\nexport {\n useBaseballTeams,\n useBaseballTeamStatistics,\n} from \"./use-baseball-teams\";\nexport {\n useBaseballGames,\n useBaseballGamesHeadToHead,\n} from \"./use-baseball-games\";\nexport { useBaseballStandings } from \"./use-baseball-standings\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-baseball-countries.js","sourceRoot":"","sources":["../../../src/baseball/hooks/use-baseball-countries.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EACL,eAAe,GAEhB,MAAM,kBAAkB,CAAC;AAS1B,MAAM,UAAU,oBAAoB,CAClC,OAGC;IAED,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC;IACtC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACpE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAE/B,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;QAChD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YACnD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,IAAI,CAAC,MAAM,IAAI,SAAS,EAAE,IAAI,EAAE,CAAC;gBAC/B,OAAO;oBACL,GAAG,EAAE,WAAW;oBAChB,UAAU,EAAE,EAA4B;oBACxC,MAAM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,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM;oBAC9B,QAAQ,EAAE,SAAS,CAAC,IAAI;iBACzB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-baseball-countries\n * @description React hook for countries endpoint\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useApiBaseballClient, useApiBaseballStore } from \"./baseball-context\";\nimport {\n apiBaseballKeys,\n type UseApiBaseballQueryOptions,\n} from \"./baseball-types\";\nimport type { BaseballCountriesParams, BaseballCountry } from \"../types\";\n\n/**\n * Hook to fetch available countries\n *\n * @param options - Query options including optional params\n * @returns Query result with country data\n */\nexport function useBaseballCountries(\n options?: UseApiBaseballQueryOptions<\n BaseballCountry,\n BaseballCountriesParams\n >,\n) {\n const client = useApiBaseballClient();\n const { countries, setCountries, cacheTTL } = useApiBaseballStore();\n const params = options?.params;\n\n return useQuery({\n queryKey: apiBaseballKeys.countries.list(params),\n queryFn: async () => {\n const response = await client.getCountries(params);\n if (!params) {\n setCountries(response.response);\n }\n return response;\n },\n initialData: () => {\n if (!params && countries?.data) {\n return {\n get: \"countries\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: countries.data.length,\n response: countries.data,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...options,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-baseball-games.js","sourceRoot":"","sources":["../../../src/baseball/hooks/use-baseball-games.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,eAAe,GAGhB,MAAM,kBAAkB,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,CAAC,UAAU,CAAC,MAAM,CAAC;QAClD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;YACzD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACtC,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAClC,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO;oBACL,GAAG,EAAE,WAAW;oBAChB,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,MAAM,CAAC,MAAM;oBACtB,QAAQ,EAAE,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,YAAY;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-baseball-games\n * @description React hooks for games endpoints\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useApiBaseballClient, useApiBaseballStore } from \"./baseball-context\";\nimport { generateCacheKey } from \"../../utils/cache-utils\";\nimport {\n apiBaseballKeys,\n type UseApiBaseballQueryOptions,\n type UseApiBaseballQueryOptionsRequired,\n} from \"./baseball-types\";\nimport type {\n BaseballGame,\n BaseballGamesParams,\n BaseballHeadToHeadParams,\n} from \"../types\";\n\n/**\n * Hook to fetch games\n *\n * @param options - Query options including optional params\n * @returns Query result with game data\n */\nexport function useBaseballGames(\n options?: UseApiBaseballQueryOptions<BaseballGame, BaseballGamesParams>,\n) {\n const client = useApiBaseballClient();\n const { getGames, setGames, cacheTTL } = useApiBaseballStore();\n const params = options?.params;\n const cacheKey = generateCacheKey(\n \"games\",\n params as unknown as Record<string, unknown>,\n );\n\n return useQuery({\n queryKey: apiBaseballKeys.games.list(params),\n queryFn: async () => {\n const response = await client.getGames(params);\n setGames(cacheKey, response.response);\n return response;\n },\n initialData: () => {\n const cached = getGames(cacheKey);\n if (cached) {\n return {\n get: \"games\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: cached.length,\n response: cached,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...options,\n });\n}\n\n/**\n * Hook to fetch head-to-head games between two teams\n *\n * @param options - Query options with required h2h param\n * @returns Query result with head-to-head game data\n */\nexport function useBaseballGamesHeadToHead(\n options: UseApiBaseballQueryOptionsRequired<\n BaseballGame,\n BaseballHeadToHeadParams\n >,\n) {\n const client = useApiBaseballClient();\n const { getGames, setGames, cacheTTL } = useApiBaseballStore();\n const { params, ...queryOptions } = options;\n const cacheKey = generateCacheKey(\n \"games-h2h\",\n params as unknown as Record<string, unknown>,\n );\n\n return useQuery({\n queryKey: apiBaseballKeys.games.headToHead(params),\n queryFn: async () => {\n const response = await client.getGamesHeadToHead(params);\n setGames(cacheKey, response.response);\n return response;\n },\n initialData: () => {\n const cached = getGames(cacheKey);\n if (cached) {\n return {\n get: \"games/h2h\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: cached.length,\n response: cached,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...queryOptions,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-baseball-leagues.js","sourceRoot":"","sources":["../../../src/baseball/hooks/use-baseball-leagues.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,eAAe,GAEhB,MAAM,kBAAkB,CAAC;AAS1B,MAAM,UAAU,kBAAkB,CAChC,OAGC;IAED,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC;IACtC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AU,kBAAkB,CAChC,OAGC;IAED,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC;IACtC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACnE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAC/B,MAAM,QAAQ,GAAG,gBAAgB,CAC/B,SAAS,EACT,MAA4C,CAC7C,CAAC;IAEF,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9C,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACjD,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACxC,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;YACpC,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO;oBACL,GAAG,EAAE,SAAS;oBACd,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,MAAM,CAAC,MAAM;oBACtB,QAAQ,EAAE,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-baseball-leagues\n * @description React hook for leagues endpoint\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useApiBaseballClient, useApiBaseballStore } from \"./baseball-context\";\nimport { generateCacheKey } from \"../../utils/cache-utils\";\nimport {\n apiBaseballKeys,\n type UseApiBaseballQueryOptions,\n} from \"./baseball-types\";\nimport type { BaseballLeagueResponse, BaseballLeaguesParams } from \"../types\";\n\n/**\n * Hook to fetch leagues\n *\n * @param options - Query options including optional params\n * @returns Query result with league data\n */\nexport function useBaseballLeagues(\n options?: UseApiBaseballQueryOptions<\n BaseballLeagueResponse,\n BaseballLeaguesParams\n >,\n) {\n const client = useApiBaseballClient();\n const { getLeagues, setLeagues, cacheTTL } = useApiBaseballStore();\n const params = options?.params;\n const cacheKey = generateCacheKey(\n \"leagues\",\n params as unknown as Record<string, unknown>,\n );\n\n return useQuery({\n queryKey: apiBaseballKeys.leagues.list(params),\n queryFn: async () => {\n const response = await client.getLeagues(params);\n setLeagues(cacheKey, response.response);\n return response;\n },\n initialData: () => {\n const cached = getLeagues(cacheKey);\n if (cached) {\n return {\n get: \"leagues\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: cached.length,\n response: cached,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...options,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-baseball-seasons.js","sourceRoot":"","sources":["../../../src/baseball/hooks/use-baseball-seasons.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EACL,eAAe,GAEhB,MAAM,kBAAkB,CAAC;AAS1B,MAAM,UAAU,kBAAkB,CAChC,OAAmE;IAEnE,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC;IACtC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAChE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAE/B,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9C,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC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CAAC;YACjD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAChC,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,IAAI,CAAC,MAAM,IAAI,OAAO,EAAE,IAAI,EAAE,CAAC;gBAC7B,OAAO;oBACL,GAAG,EAAE,SAAS;oBACd,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM;oBAC5B,QAAQ,EAAE,OAAO,CAAC,IAAI;iBACvB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-baseball-seasons\n * @description React hook for seasons endpoint\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useApiBaseballClient, useApiBaseballStore } from \"./baseball-context\";\nimport {\n apiBaseballKeys,\n type UseApiBaseballQueryOptions,\n} from \"./baseball-types\";\nimport type { BaseballSeasonsParams } from \"../types\";\n\n/**\n * Hook to fetch available seasons\n *\n * @param options - Query options including optional params\n * @returns Query result with season data\n */\nexport function useBaseballSeasons(\n options?: UseApiBaseballQueryOptions<number, BaseballSeasonsParams>,\n) {\n const client = useApiBaseballClient();\n const { seasons, setSeasons, cacheTTL } = useApiBaseballStore();\n const params = options?.params;\n\n return useQuery({\n queryKey: apiBaseballKeys.seasons.list(params),\n queryFn: async () => {\n const response = await client.getSeasons(params);\n if (!params) {\n setSeasons(response.response);\n }\n return response;\n },\n initialData: () => {\n if (!params && seasons?.data) {\n return {\n get: \"seasons\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: seasons.data.length,\n response: seasons.data,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...options,\n });\n}\n"]}
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tB,OAAO,EAAE,MAAM,CAAC,MAAM;oBACtB,QAAQ,EAAE,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,YAAY;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-baseball-standings\n * @description React hook for standings endpoint\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useApiBaseballClient, useApiBaseballStore } from \"./baseball-context\";\nimport { generateCacheKey } from \"../../utils/cache-utils\";\nimport {\n apiBaseballKeys,\n type UseApiBaseballQueryOptionsRequired,\n} from \"./baseball-types\";\nimport type { BaseballStanding, BaseballStandingsParams } from \"../types\";\n\n/**\n * Hook to fetch standings\n *\n * @param options - Query options with required params (league, season)\n * @returns Query result with standings data\n */\nexport function useBaseballStandings(\n options: UseApiBaseballQueryOptionsRequired<\n BaseballStanding,\n BaseballStandingsParams\n >,\n) {\n const client = useApiBaseballClient();\n const { getStandings, setStandings, cacheTTL } = useApiBaseballStore();\n const { params, ...queryOptions } = options;\n const cacheKey = generateCacheKey(\n \"standings\",\n params as unknown as Record<string, unknown>,\n );\n\n return useQuery({\n queryKey: apiBaseballKeys.standings.list(params),\n queryFn: async () => {\n const response = await client.getStandings(params);\n setStandings(cacheKey, response.response);\n return response;\n },\n initialData: () => {\n const cached = getStandings(cacheKey);\n if (cached) {\n return {\n get: \"standings\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: cached.length,\n response: cached,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...queryOptions,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-baseball-teams.js","sourceRoot":"","sources":["../../../src/baseball/hooks/use-baseball-teams.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC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xB,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC;IAC5C,MAAM,QAAQ,GAAG,gBAAgB,CAC/B,YAAY,EACZ,MAA4C,CAC7C,CAAC;IAEF,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;QAClD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;YACxD,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,MAAM,MAAM,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;YAC3C,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO;oBACL,GAAG,EAAE,kBAAkB;oBACvB,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,CAAC;oBACV,QAAQ,EAAE,CAAC,MAAM,CAAC;iBACnB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,YAAY;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-baseball-teams\n * @description React hooks for teams endpoints\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useApiBaseballClient, useApiBaseballStore } from \"./baseball-context\";\nimport { generateCacheKey } from \"../../utils/cache-utils\";\nimport {\n apiBaseballKeys,\n type UseApiBaseballQueryOptions,\n type UseApiBaseballQueryOptionsRequired,\n} from \"./baseball-types\";\nimport type {\n BaseballTeamResponse,\n BaseballTeamsParams,\n BaseballTeamStatistics,\n BaseballTeamStatisticsParams,\n} from \"../types\";\n\n/**\n * Hook to fetch teams\n *\n * @param options - Query options including optional params\n * @returns Query result with team data\n */\nexport function useBaseballTeams(\n options?: UseApiBaseballQueryOptions<\n BaseballTeamResponse,\n BaseballTeamsParams\n >,\n) {\n const client = useApiBaseballClient();\n const { getTeams, setTeams, cacheTTL } = useApiBaseballStore();\n const params = options?.params;\n const cacheKey = generateCacheKey(\n \"teams\",\n params as unknown as Record<string, unknown>,\n );\n\n return useQuery({\n queryKey: apiBaseballKeys.teams.list(params),\n queryFn: async () => {\n const response = await client.getTeams(params);\n setTeams(cacheKey, response.response);\n return response;\n },\n initialData: () => {\n const cached = getTeams(cacheKey);\n if (cached) {\n return {\n get: \"teams\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: cached.length,\n response: cached,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...options,\n });\n}\n\n/**\n * Hook to fetch team statistics\n *\n * @param options - Query options with required params (league, season, team)\n * @returns Query result with team statistics data\n */\nexport function useBaseballTeamStatistics(\n options: UseApiBaseballQueryOptionsRequired<\n BaseballTeamStatistics,\n BaseballTeamStatisticsParams\n >,\n) {\n const client = useApiBaseballClient();\n const { getTeamStatistics, setTeamStatistics, cacheTTL } =\n useApiBaseballStore();\n const { params, ...queryOptions } = options;\n const cacheKey = generateCacheKey(\n \"team-stats\",\n params as unknown as Record<string, unknown>,\n );\n\n return useQuery({\n queryKey: apiBaseballKeys.teams.statistics(params),\n queryFn: async () => {\n const response = await client.getTeamStatistics(params);\n if (response.response[0]) {\n setTeamStatistics(cacheKey, response.response[0]);\n }\n return response;\n },\n initialData: () => {\n const cached = getTeamStatistics(cacheKey);\n if (cached) {\n return {\n get: \"teams/statistics\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: 1,\n response: [cached],\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...queryOptions,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-baseball-timezone.js","sourceRoot":"","sources":["../../../src/baseball/hooks/use-baseball-timezone.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EACL,eAAe,GAEhB,MAAM,kBAAkB,CAAC;AAS1B,MAAM,UAAU,mBAAmB,CACjC,OAAsD;IAEtD,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC;IACtC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAEpE,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,eAAe,CAAC,QAAQ,EAAE;QACpC,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;YAC5C,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAChC,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,IAAI,SAAS,EAAE,IAAI,EAAE,CAAC;gBACpB,OAAO;oBACL,GAAG,EAAE,UAAU;oBACf,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM;oBAC9B,QAAQ,EAAE,SAAS,CAAC,IAAI;iBACzB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"use-baseball-timezone.js","sourceRoot":"","sources":["../../../src/baseball/hooks/use-baseball-timezone.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EACL,eAAe,GAEhB,MAAM,kBAAkB,CAAC;AAS1B,MAAM,UAAU,mBAAmB,CACjC,OAAsD;IAEtD,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC;IACtC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAEpE,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,eAAe,CAAC,QAAQ,EAAE;QACpC,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;YAC5C,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAChC,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,IAAI,SAAS,EAAE,IAAI,EAAE,CAAC;gBACpB,OAAO;oBACL,GAAG,EAAE,UAAU;oBACf,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM;oBAC9B,QAAQ,EAAE,SAAS,CAAC,IAAI;iBACzB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-baseball-timezone\n * @description React hook for timezone endpoint\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useApiBaseballClient, useApiBaseballStore } from \"./baseball-context\";\nimport {\n apiBaseballKeys,\n type UseApiBaseballQueryOptions,\n} from \"./baseball-types\";\nimport type { BaseballTimezone } from \"../types\";\n\n/**\n * Hook to fetch available timezones\n *\n * @param options - Query options\n * @returns Query result with timezone data\n */\nexport function useBaseballTimezone(\n options?: UseApiBaseballQueryOptions<BaseballTimezone>,\n) {\n const client = useApiBaseballClient();\n const { timezones, setTimezones, cacheTTL } = useApiBaseballStore();\n\n return useQuery({\n queryKey: apiBaseballKeys.timezone(),\n queryFn: async () => {\n const response = await client.getTimezone();\n setTimezones(response.response);\n return response;\n },\n initialData: () => {\n if (timezones?.data) {\n return {\n get: \"timezone\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: timezones.data.length,\n response: timezones.data,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...options,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/baseball/index.ts"],"names":[],"mappings":"AAmCA,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,sBAAsB,GAGvB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,0BAA0B,EAC1B,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,mBAAmB,GAIpB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/baseball/index.ts"],"names":[],"mappings":"AAmCA,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,sBAAsB,GAGvB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,0BAA0B,EAC1B,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,mBAAmB,GAIpB,MAAM,SAAS,CAAC","sourcesContent":["/**\n * @module baseball\n * @description API-Baseball client library exports\n *\n * Provides type-safe access to the API-Baseball API with React hooks,\n * Zustand caching, and React Query integration.\n */\n\n// Types\nexport type {\n ApiBaseballConfig,\n ApiBaseballResponse,\n BaseballCountriesParams,\n BaseballCountry,\n BaseballGame,\n BaseballGamesParams,\n BaseballGameStatus,\n BaseballHeadToHeadParams,\n BaseballLeague,\n BaseballLeagueResponse,\n BaseballLeaguesParams,\n BaseballScores,\n BaseballSeason,\n BaseballSeasonsParams,\n BaseballStanding,\n BaseballStandingsParams,\n BaseballTeam,\n BaseballTeamResponse,\n BaseballTeamsParams,\n BaseballTeamStatistics,\n BaseballTeamStatisticsParams,\n BaseballTimezone,\n} from \"./types\";\n\n// Network\nexport {\n ApiBaseballClient,\n createApiBaseballClient,\n BASEBALL_API_BASE_URL,\n BASEBALL_DEFAULT_HEADERS,\n BASEBALL_ENDPOINTS,\n BASEBALL_RAPIDAPI_HOST,\n} from \"./network\";\n\n// Store\nexport {\n createApiBaseballStore,\n type ApiBaseballState,\n type ApiBaseballStore,\n} from \"./store\";\n\n// Hooks\nexport {\n ApiBaseballProvider,\n apiBaseballKeys,\n useApiBaseballClient,\n useApiBaseballStore,\n useApiBaseballStoreContext,\n useBaseballCountries,\n useBaseballGames,\n useBaseballGamesHeadToHead,\n useBaseballLeagues,\n useBaseballSeasons,\n useBaseballStandings,\n useBaseballTeams,\n useBaseballTeamStatistics,\n useBaseballTimezone,\n type ApiBaseballProviderProps,\n type UseApiBaseballQueryOptions,\n type UseApiBaseballQueryOptionsRequired,\n} from \"./hooks\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"api-baseball-client.js","sourceRoot":"","sources":["../../../src/baseball/network/api-baseball-client.ts"],"names":[],"mappings":"AAuCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,qBAAqB,EACrB,wBAAwB,E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IACrB,OAAO,IAAI,iBAAiB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC,CAAC","sourcesContent":["/**\n * @module api-baseball-client\n * @description API-Baseball Client Library\n *\n * A TypeScript client for the API-Baseball API that provides type-safe\n * access to baseball data including leagues, teams, games, standings, and more.\n *\n * @example\n * ```typescript\n * import { ApiBaseballClient } from \"@sudobility/sports_api_client\";\n *\n * const client = new ApiBaseballClient(networkClient, {\n * apiKey: \"YOUR_API_KEY\",\n * });\n *\n * const leagues = await client.getLeagues({ country: \"USA\" });\n * ```\n */\n\nimport type { NetworkClient } from \"@sudobility/types\";\nimport type {\n ApiBaseballConfig,\n ApiBaseballResponse,\n BaseballCountriesParams,\n BaseballCountry,\n BaseballGame,\n BaseballGamesParams,\n BaseballHeadToHeadParams,\n BaseballLeagueResponse,\n BaseballLeaguesParams,\n BaseballSeasonsParams,\n BaseballStanding,\n BaseballStandingsParams,\n BaseballTeamResponse,\n BaseballTeamsParams,\n BaseballTeamStatistics,\n BaseballTeamStatisticsParams,\n BaseballTimezone,\n} from \"../types\";\nimport { buildQueryString } from \"../../utils/query-params\";\nimport {\n BASEBALL_API_BASE_URL,\n BASEBALL_DEFAULT_HEADERS,\n BASEBALL_ENDPOINTS,\n BASEBALL_RAPIDAPI_HOST,\n} from \"./baseball-endpoints\";\n\n/**\n * API-Baseball Client class\n *\n * Provides type-safe methods for all API-Baseball endpoints.\n */\nexport class ApiBaseballClient {\n private baseUrl: string;\n private networkClient: NetworkClient;\n private headers: Record<string, string>;\n\n /**\n * Create a new ApiBaseballClient instance\n *\n * @param networkClient - NetworkClient instance for making HTTP requests\n * @param config - API configuration including API key\n */\n constructor(networkClient: NetworkClient, config: ApiBaseballConfig) {\n this.networkClient = networkClient;\n this.baseUrl = config.baseUrl || BASEBALL_API_BASE_URL;\n\n // Set up authentication headers\n if (config.useRapidApi && config.rapidApiHost) {\n this.headers = {\n ...BASEBALL_DEFAULT_HEADERS,\n \"x-rapidapi-host\": config.rapidApiHost || BASEBALL_RAPIDAPI_HOST,\n \"x-rapidapi-key\": config.apiKey,\n };\n } else {\n this.headers = {\n ...BASEBALL_DEFAULT_HEADERS,\n \"x-apisports-key\": config.apiKey,\n };\n }\n }\n\n /**\n * Make a GET request to the API\n */\n private async request<T>(endpoint: string): Promise<ApiBaseballResponse<T>> {\n const url = `${this.baseUrl}${endpoint}`;\n\n const response = await this.networkClient.get<ApiBaseballResponse<T>>(url, {\n headers: this.headers,\n });\n\n if (response.data === undefined || response.data === null) {\n throw new Error(\"No data received from API-Baseball\");\n }\n\n // Check for API errors\n const data = response.data as ApiBaseballResponse<T>;\n if (data.errors && Object.keys(data.errors).length > 0) {\n const errorMsg = Array.isArray(data.errors)\n ? data.errors.join(\", \")\n : Object.values(data.errors).join(\", \");\n throw new Error(`API-Baseball error: ${errorMsg}`);\n }\n\n return data;\n }\n\n // ============================================================================\n // General Endpoints\n // ============================================================================\n\n /**\n * Get all available timezones\n */\n async getTimezone(): Promise<ApiBaseballResponse<BaseballTimezone>> {\n return this.request<BaseballTimezone>(BASEBALL_ENDPOINTS.TIMEZONE);\n }\n\n /**\n * Get all available countries\n */\n async getCountries(\n params?: BaseballCountriesParams,\n ): Promise<ApiBaseballResponse<BaseballCountry>> {\n const query = params ? buildQueryString(params) : \"\";\n return this.request<BaseballCountry>(\n `${BASEBALL_ENDPOINTS.COUNTRIES}${query}`,\n );\n }\n\n /**\n * Get all available seasons\n */\n async getSeasons(\n params?: BaseballSeasonsParams,\n ): Promise<ApiBaseballResponse<number>> {\n const query = params ? buildQueryString(params) : \"\";\n return this.request<number>(`${BASEBALL_ENDPOINTS.SEASONS}${query}`);\n }\n\n // ============================================================================\n // Leagues Endpoints\n // ============================================================================\n\n /**\n * Get leagues with optional filtering\n */\n async getLeagues(\n params?: BaseballLeaguesParams,\n ): Promise<ApiBaseballResponse<BaseballLeagueResponse>> {\n const query = params ? buildQueryString(params) : \"\";\n return this.request<BaseballLeagueResponse>(\n `${BASEBALL_ENDPOINTS.LEAGUES}${query}`,\n );\n }\n\n // ============================================================================\n // Teams Endpoints\n // ============================================================================\n\n /**\n * Get teams\n */\n async getTeams(\n params?: BaseballTeamsParams,\n ): Promise<ApiBaseballResponse<BaseballTeamResponse>> {\n const query = params ? buildQueryString(params) : \"\";\n return this.request<BaseballTeamResponse>(\n `${BASEBALL_ENDPOINTS.TEAMS}${query}`,\n );\n }\n\n /**\n * Get team statistics\n */\n async getTeamStatistics(\n params: BaseballTeamStatisticsParams,\n ): Promise<ApiBaseballResponse<BaseballTeamStatistics>> {\n const query = buildQueryString(params);\n return this.request<BaseballTeamStatistics>(\n `${BASEBALL_ENDPOINTS.TEAMS_STATISTICS}${query}`,\n );\n }\n\n // ============================================================================\n // Games Endpoints\n // ============================================================================\n\n /**\n * Get games with optional filtering\n */\n async getGames(\n params?: BaseballGamesParams,\n ): Promise<ApiBaseballResponse<BaseballGame>> {\n const query = params ? buildQueryString(params) : \"\";\n return this.request<BaseballGame>(`${BASEBALL_ENDPOINTS.GAMES}${query}`);\n }\n\n /**\n * Get head to head games between two teams\n */\n async getGamesHeadToHead(\n params: BaseballHeadToHeadParams,\n ): Promise<ApiBaseballResponse<BaseballGame>> {\n const query = buildQueryString(params);\n return this.request<BaseballGame>(\n `${BASEBALL_ENDPOINTS.GAMES_HEAD_TO_HEAD}${query}`,\n );\n }\n\n // ============================================================================\n // Standings Endpoints\n // ============================================================================\n\n /**\n * Get standings for a league/season\n */\n async getStandings(\n params: BaseballStandingsParams,\n ): Promise<ApiBaseballResponse<BaseballStanding>> {\n const query = buildQueryString(params);\n return this.request<BaseballStanding>(\n `${BASEBALL_ENDPOINTS.STANDINGS}${query}`,\n );\n }\n}\n\n/**\n * Factory function to create an ApiBaseballClient instance\n */\nexport const createApiBaseballClient = (\n networkClient: NetworkClient,\n config: ApiBaseballConfig,\n): ApiBaseballClient => {\n return new ApiBaseballClient(networkClient, config);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"baseball-endpoints.js","sourceRoot":"","sources":["../../../src/baseball/network/baseball-endpoints.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,qBAAqB,GAAG,mCAAmC,CAAC;AAKzE,MAAM,CAAC,MAAM,sBAAsB,GAAG,6BAA6B,CAAC;AAKpE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,cAAc,EAAE,kBAAkB;CACnC,CAAC;AAKF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAEhC,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,UAAU;IAGnB,OAAO,EAAE,UAAU;IAGnB,KAAK,EAAE,QAAQ;IACf,gBAAgB,EAAE,mBAAmB;IAGrC,KAAK,EAAE,QAAQ;IACf,kBAAkB,EAAE,YAAY;IAGhC,SAAS,EAAE,YAAY;CACf,CAAC"}
1
+ {"version":3,"file":"baseball-endpoints.js","sourceRoot":"","sources":["../../../src/baseball/network/baseball-endpoints.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,qBAAqB,GAAG,mCAAmC,CAAC;AAKzE,MAAM,CAAC,MAAM,sBAAsB,GAAG,6BAA6B,CAAC;AAKpE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,cAAc,EAAE,kBAAkB;CACnC,CAAC;AAKF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAEhC,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,UAAU;IAGnB,OAAO,EAAE,UAAU;IAGnB,KAAK,EAAE,QAAQ;IACf,gBAAgB,EAAE,mBAAmB;IAGrC,KAAK,EAAE,QAAQ;IACf,kBAAkB,EAAE,YAAY;IAGhC,SAAS,EAAE,YAAY;CACf,CAAC","sourcesContent":["/**\n * @module baseball/network/baseball-endpoints\n * @description API-Baseball endpoint definitions\n */\n\n/**\n * Base URL for API-Baseball\n */\nexport const BASEBALL_API_BASE_URL = \"https://v1.baseball.api-sports.io\";\n\n/**\n * RapidAPI host for API-Baseball\n */\nexport const BASEBALL_RAPIDAPI_HOST = \"api-baseball.p.rapidapi.com\";\n\n/**\n * Default headers for API-Baseball requests\n */\nexport const BASEBALL_DEFAULT_HEADERS = {\n \"Content-Type\": \"application/json\",\n};\n\n/**\n * API-Baseball endpoint paths\n */\nexport const BASEBALL_ENDPOINTS = {\n // General\n TIMEZONE: \"/timezone\",\n COUNTRIES: \"/countries\",\n SEASONS: \"/seasons\",\n\n // Leagues\n LEAGUES: \"/leagues\",\n\n // Teams\n TEAMS: \"/teams\",\n TEAMS_STATISTICS: \"/teams/statistics\",\n\n // Games\n GAMES: \"/games\",\n GAMES_HEAD_TO_HEAD: \"/games/h2h\",\n\n // Standings\n STANDINGS: \"/standings\",\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/baseball/network/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/baseball/network/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC","sourcesContent":["/**\n * @module baseball/network\n * @description Network exports for API-Baseball\n */\n\nexport {\n ApiBaseballClient,\n createApiBaseballClient,\n} from \"./api-baseball-client\";\n\nexport {\n BASEBALL_API_BASE_URL,\n BASEBALL_DEFAULT_HEADERS,\n BASEBALL_ENDPOINTS,\n BASEBALL_RAPIDAPI_HOST,\n} from \"./baseball-endpoints\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"api-baseball-store.js","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,EAAE;YAElD,IAAI,GAAG,YAAY,GAAG,EAAE,CAAC;gBACvB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YACnC,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC1C,CAAC;IACD,UAAU,EAAE,KAAK,EAAE,IAAY,EAAE,EAAE;QACjC,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACF,CAAC,CAAC;AAQH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAuB,EAAE,EAAE;IAChE,MAAM,cAAc,GAA8B;QAChD,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC;QACrC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACtB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACzB,CAAC;KACH,CAAC;IAEF,OAAO,MAAM,EAAoB,CAAC,OAAO,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC,CAAC;AAC/E,CAAC,CAAC","sourcesContent":["/**\n * @module api-baseball-store\n * @description Zustand store for API-Baseball data caching\n */\n\nimport { create, StateCreator } from \"zustand\";\nimport { persist, PersistOptions } from \"zustand/middleware\";\nimport type {\n BaseballCountry,\n BaseballGame,\n BaseballLeagueResponse,\n BaseballStanding,\n BaseballTeamResponse,\n BaseballTeamStatistics,\n} from \"../types\";\nimport {\n CachedData,\n isCacheValid as checkCacheValid,\n createCacheEntry,\n DEFAULT_CACHE_TTL,\n StorageAdapter,\n} from \"../../utils/cache-utils\";\n\n/**\n * API Baseball Store State interface\n */\nexport interface ApiBaseballState {\n // ============================================================================\n // Cached Data\n // ============================================================================\n\n /** Cached countries */\n countries: CachedData<BaseballCountry[]> | null;\n\n /** Cached timezones */\n timezones: CachedData<string[]> | null;\n\n /** Cached seasons */\n seasons: CachedData<number[]> | null;\n\n /** Cached leagues by key */\n leagues: Map<string, CachedData<BaseballLeagueResponse[]>>;\n\n /** Cached teams by key */\n teams: Map<string, CachedData<BaseballTeamResponse[]>>;\n\n /** Cached team statistics by key */\n teamStatistics: Map<string, CachedData<BaseballTeamStatistics>>;\n\n /** Cached games by key */\n games: Map<string, CachedData<BaseballGame[]>>;\n\n /** Cached standings by key */\n standings: Map<string, CachedData<BaseballStanding[]>>;\n\n // ============================================================================\n // Cache Settings\n // ============================================================================\n\n /** Global cache TTL in milliseconds */\n cacheTTL: number;\n\n // ============================================================================\n // Actions\n // ============================================================================\n\n // Setters for single-value caches\n setCountries: (data: BaseballCountry[]) => void;\n setTimezones: (data: string[]) => void;\n setSeasons: (data: number[]) => void;\n\n // Setters for keyed caches\n setLeagues: (key: string, data: BaseballLeagueResponse[]) => void;\n setTeams: (key: string, data: BaseballTeamResponse[]) => void;\n setTeamStatistics: (key: string, data: BaseballTeamStatistics) => void;\n setGames: (key: string, data: BaseballGame[]) => void;\n setStandings: (key: string, data: BaseballStanding[]) => void;\n\n // Getters for keyed caches (returns null if not found or expired)\n getLeagues: (key: string) => BaseballLeagueResponse[] | null;\n getTeams: (key: string) => BaseballTeamResponse[] | null;\n getTeamStatistics: (key: string) => BaseballTeamStatistics | null;\n getGames: (key: string) => BaseballGame[] | null;\n getStandings: (key: string) => BaseballStanding[] | null;\n\n // Cache utilities\n isCacheValid: (timestamp: number) => boolean;\n clearCache: () => void;\n setCacheTTL: (ttl: number) => void;\n}\n\n/**\n * Create the store state and actions\n */\nconst createStoreSlice: StateCreator<ApiBaseballState> = (set, get) => ({\n // Initial state\n countries: null,\n timezones: null,\n seasons: null,\n leagues: new Map(),\n teams: new Map(),\n teamStatistics: new Map(),\n games: new Map(),\n standings: new Map(),\n cacheTTL: DEFAULT_CACHE_TTL,\n\n // Single-value setters\n setCountries: (data) =>\n set({ countries: createCacheEntry(\"countries\", data) }),\n\n setTimezones: (data) =>\n set({ timezones: createCacheEntry(\"timezones\", data) }),\n\n setSeasons: (data) => set({ seasons: createCacheEntry(\"seasons\", data) }),\n\n // Keyed setters\n setLeagues: (key, data) =>\n set((state) => {\n const newLeagues = new Map(state.leagues);\n newLeagues.set(key, createCacheEntry(key, data));\n return { leagues: newLeagues };\n }),\n\n setTeams: (key, data) =>\n set((state) => {\n const newTeams = new Map(state.teams);\n newTeams.set(key, createCacheEntry(key, data));\n return { teams: newTeams };\n }),\n\n setTeamStatistics: (key, data) =>\n set((state) => {\n const newStats = new Map(state.teamStatistics);\n newStats.set(key, createCacheEntry(key, data));\n return { teamStatistics: newStats };\n }),\n\n setGames: (key, data) =>\n set((state) => {\n const newGames = new Map(state.games);\n newGames.set(key, createCacheEntry(key, data));\n return { games: newGames };\n }),\n\n setStandings: (key, data) =>\n set((state) => {\n const newStandings = new Map(state.standings);\n newStandings.set(key, createCacheEntry(key, data));\n return { standings: newStandings };\n }),\n\n // Keyed getters (return null if not found or expired)\n getLeagues: (key) => {\n const cached = get().leagues.get(key);\n if (!cached || !get().isCacheValid(cached.timestamp)) return null;\n return cached.data;\n },\n\n getTeams: (key) => {\n const cached = get().teams.get(key);\n if (!cached || !get().isCacheValid(cached.timestamp)) return null;\n return cached.data;\n },\n\n getTeamStatistics: (key) => {\n const cached = get().teamStatistics.get(key);\n if (!cached || !get().isCacheValid(cached.timestamp)) return null;\n return cached.data;\n },\n\n getGames: (key) => {\n const cached = get().games.get(key);\n if (!cached || !get().isCacheValid(cached.timestamp)) return null;\n return cached.data;\n },\n\n getStandings: (key) => {\n const cached = get().standings.get(key);\n if (!cached || !get().isCacheValid(cached.timestamp)) return null;\n return cached.data;\n },\n\n // Cache utilities\n isCacheValid: (timestamp) => checkCacheValid(timestamp, get().cacheTTL),\n\n clearCache: () =>\n set({\n countries: null,\n timezones: null,\n seasons: null,\n leagues: new Map(),\n teams: new Map(),\n teamStatistics: new Map(),\n games: new Map(),\n standings: new Map(),\n }),\n\n setCacheTTL: (ttl) => set({ cacheTTL: ttl }),\n});\n\n/**\n * Persist options type\n */\ntype ApiBaseballPersistOptions = PersistOptions<\n ApiBaseballState,\n Partial<ApiBaseballState>\n>;\n\n/**\n * Custom storage that handles Map serialization\n */\nconst createCustomStorage = (storage: StorageAdapter) => ({\n getItem: async (name: string) => {\n const value = await storage.getItem(name);\n if (!value) return null;\n\n try {\n const parsed = JSON.parse(value);\n\n // Restore Maps from arrays\n const mapFields = [\n \"leagues\",\n \"teams\",\n \"teamStatistics\",\n \"games\",\n \"standings\",\n ];\n\n for (const field of mapFields) {\n if (parsed.state && Array.isArray(parsed.state[field])) {\n parsed.state[field] = new Map(parsed.state[field]);\n }\n }\n\n return parsed;\n } catch {\n return null;\n }\n },\n setItem: async (name: string, value: unknown) => {\n const serialized = JSON.stringify(value, (_, val) => {\n // Convert Maps to arrays for JSON serialization\n if (val instanceof Map) {\n return Array.from(val.entries());\n }\n return val;\n });\n await storage.setItem(name, serialized);\n },\n removeItem: async (name: string) => {\n await storage.removeItem(name);\n },\n});\n\n/**\n * Create an API Baseball store with persistence\n *\n * @param storage - Storage adapter for persistence\n * @returns Zustand store hook with API Baseball state\n */\nexport const createApiBaseballStore = (storage: StorageAdapter) => {\n const persistOptions: ApiBaseballPersistOptions = {\n name: \"api-baseball-cache\",\n storage: createCustomStorage(storage),\n partialize: (state) => ({\n countries: state.countries,\n timezones: state.timezones,\n seasons: state.seasons,\n leagues: state.leagues,\n teams: state.teams,\n teamStatistics: state.teamStatistics,\n games: state.games,\n standings: state.standings,\n cacheTTL: state.cacheTTL,\n }),\n };\n\n return create<ApiBaseballState>()(persist(createStoreSlice, persistOptions));\n};\n\n/** Type for the store hook returned by createApiBaseballStore */\nexport type ApiBaseballStore = ReturnType<typeof createApiBaseballStore>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/baseball/store/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,sBAAsB,GAGvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,YAAY,GAGb,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/baseball/store/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,sBAAsB,GAGvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,YAAY,GAGb,MAAM,yBAAyB,CAAC","sourcesContent":["/**\n * Baseball Store Module Exports\n */\n\nexport {\n createApiBaseballStore,\n type ApiBaseballState,\n type ApiBaseballStore,\n} from \"./api-baseball-store\";\n\nexport {\n createCacheEntry,\n createStorageAdapter,\n DEFAULT_CACHE_TTL,\n generateCacheKey,\n getRemainingTTL,\n isCacheValid,\n type CachedData,\n type StorageAdapter,\n} from \"../../utils/cache-utils\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"baseball-common.js","sourceRoot":"","sources":["../../../src/baseball/types/baseball-common.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"baseball-common.js","sourceRoot":"","sources":["../../../src/baseball/types/baseball-common.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @module baseball/types/baseball-common\n * @description Common types for API-Baseball\n */\n\nimport type { BaseApiConfig, BaseApiResponse } from \"../../common/base-types\";\n\n/**\n * API-Baseball configuration\n */\nexport type ApiBaseballConfig = BaseApiConfig;\n\n/**\n * API-Baseball response wrapper\n */\nexport interface ApiBaseballResponse<T> extends BaseApiResponse<T> {\n get: string;\n parameters: Record<string, string>;\n errors: string[] | Record<string, string>;\n results: number;\n response: T[];\n}\n\n/**\n * Country information\n */\nexport interface BaseballCountry {\n id: number;\n name: string;\n code: string | null;\n flag: string | null;\n}\n\n/**\n * Parameters for countries endpoint\n */\nexport interface BaseballCountriesParams {\n id?: number;\n name?: string;\n code?: string;\n search?: string;\n}\n\n/**\n * Parameters for seasons endpoint\n */\nexport interface BaseballSeasonsParams {\n league?: number;\n}\n\n/**\n * Timezone type (string array from API)\n */\nexport type BaseballTimezone = string;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"baseball-games.js","sourceRoot":"","sources":["../../../src/baseball/types/baseball-games.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"baseball-games.js","sourceRoot":"","sources":["../../../src/baseball/types/baseball-games.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @module baseball/types/baseball-games\n * @description Game-related types for API-Baseball\n */\n\nimport type { BaseballCountry } from \"./baseball-common\";\nimport type { BaseballLeague } from \"./baseball-leagues\";\nimport type { BaseballTeam } from \"./baseball-teams\";\n\n/**\n * Game status\n */\nexport interface BaseballGameStatus {\n long: string;\n short: string;\n}\n\n/**\n * Baseball scores by innings\n */\nexport interface BaseballScores {\n home: {\n hits: number | null;\n errors: number | null;\n innings: Record<string, number | null>;\n total: number | null;\n };\n away: {\n hits: number | null;\n errors: number | null;\n innings: Record<string, number | null>;\n total: number | null;\n };\n}\n\n/**\n * Game information\n */\nexport interface BaseballGame {\n id: number;\n date: string;\n time: string;\n timestamp: number;\n timezone: string;\n week: string | null;\n status: BaseballGameStatus;\n country: BaseballCountry;\n league: BaseballLeague;\n teams: {\n home: BaseballTeam;\n away: BaseballTeam;\n };\n scores: BaseballScores;\n}\n\n/**\n * Parameters for games endpoint\n */\nexport interface BaseballGamesParams {\n id?: number;\n date?: string;\n league?: number;\n season?: number;\n team?: number;\n timezone?: string;\n h2h?: string;\n}\n\n/**\n * Parameters for head-to-head games\n */\nexport interface BaseballHeadToHeadParams {\n h2h: string;\n league?: number;\n season?: number;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"baseball-leagues.js","sourceRoot":"","sources":["../../../src/baseball/types/baseball-leagues.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"baseball-leagues.js","sourceRoot":"","sources":["../../../src/baseball/types/baseball-leagues.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @module baseball/types/baseball-leagues\n * @description League-related types for API-Baseball\n */\n\nimport type { BaseballCountry } from \"./baseball-common\";\n\n/**\n * League information\n */\nexport interface BaseballLeague {\n id: number;\n name: string;\n type: string;\n logo: string | null;\n}\n\n/**\n * Season information within a league\n */\nexport interface BaseballSeason {\n season: number;\n start: string;\n end: string;\n current: boolean;\n}\n\n/**\n * League response with country and seasons.\n * Note: Baseball API returns flat structure (not nested under `league`).\n */\nexport interface BaseballLeagueResponse {\n /** League ID */\n id: number;\n /** League name */\n name: string;\n /** League type */\n type: string;\n /** League logo URL */\n logo: string | null;\n /** Country information */\n country: BaseballCountry;\n /** Available seasons */\n seasons: BaseballSeason[];\n}\n\n/**\n * Parameters for leagues endpoint\n */\nexport interface BaseballLeaguesParams {\n /** Filter by league ID */\n id?: number;\n /** Filter by league name */\n name?: string;\n /**\n * Filter by country name (NOT country code).\n * Use full country name like \"Japan\", not \"JP\".\n * Get valid names from the /countries endpoint.\n */\n country?: string;\n /** Filter by country ID */\n country_id?: number;\n /** Filter by league type */\n type?: string;\n /** Filter by season (free tier: 2021-2023 only) */\n season?: number;\n /** Search by name (minimum 3 characters) */\n search?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"baseball-standings.js","sourceRoot":"","sources":["../../../src/baseball/types/baseball-standings.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"baseball-standings.js","sourceRoot":"","sources":["../../../src/baseball/types/baseball-standings.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @module baseball/types/baseball-standings\n * @description Standings types for API-Baseball\n */\n\nimport type { BaseballCountry } from \"./baseball-common\";\nimport type { BaseballLeague } from \"./baseball-leagues\";\nimport type { BaseballTeam } from \"./baseball-teams\";\n\n/**\n * Standing entry\n */\nexport interface BaseballStanding {\n position: number;\n stage: string;\n group: {\n name: string;\n };\n team: BaseballTeam;\n league: BaseballLeague;\n country: BaseballCountry;\n games: {\n played: number;\n win: {\n total: number;\n percentage: string;\n };\n lose: {\n total: number;\n percentage: string;\n };\n };\n points: {\n for: number;\n against: number;\n };\n form: string | null;\n description: string | null;\n}\n\n/**\n * Parameters for standings endpoint\n */\nexport interface BaseballStandingsParams {\n league: number;\n season: number;\n team?: number;\n group?: string;\n stage?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"baseball-teams.js","sourceRoot":"","sources":["../../../src/baseball/types/baseball-teams.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"baseball-teams.js","sourceRoot":"","sources":["../../../src/baseball/types/baseball-teams.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @module baseball/types/baseball-teams\n * @description Team-related types for API-Baseball\n */\n\nimport type { BaseballCountry } from \"./baseball-common\";\n\n/**\n * Team information\n */\nexport interface BaseballTeam {\n id: number;\n name: string;\n logo: string | null;\n national: boolean;\n}\n\n/**\n * Team response - flat structure from API\n * API returns: { id, name, logo, national, country: {...} }\n */\nexport interface BaseballTeamResponse {\n id: number;\n name: string;\n logo: string | null;\n national: boolean;\n country: BaseballCountry;\n}\n\n/**\n * Parameters for teams endpoint\n */\nexport interface BaseballTeamsParams {\n id?: number;\n name?: string;\n country?: string;\n country_id?: number;\n league?: number;\n season?: number;\n search?: string;\n}\n\n/**\n * Team statistics\n */\nexport interface BaseballTeamStatistics {\n league: {\n id: number;\n name: string;\n country: string;\n logo: string | null;\n flag: string | null;\n season: number;\n };\n team: BaseballTeam;\n games: {\n played: {\n home: number;\n away: number;\n all: number;\n };\n wins: {\n home: {\n total: number;\n percentage: string;\n };\n away: {\n total: number;\n percentage: string;\n };\n all: {\n total: number;\n percentage: string;\n };\n };\n loses: {\n home: {\n total: number;\n percentage: string;\n };\n away: {\n total: number;\n percentage: string;\n };\n all: {\n total: number;\n percentage: string;\n };\n };\n };\n points: {\n for: {\n total: {\n home: number;\n away: number;\n all: number;\n };\n average: {\n home: string;\n away: string;\n all: string;\n };\n };\n against: {\n total: {\n home: number;\n away: number;\n all: number;\n };\n average: {\n home: string;\n away: string;\n all: string;\n };\n };\n };\n}\n\n/**\n * Parameters for team statistics endpoint\n */\nexport interface BaseballTeamStatisticsParams {\n league: number;\n season: number;\n team: number;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/baseball/types/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/baseball/types/index.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @module baseball/types\n * @description Type exports for API-Baseball\n */\n\nexport type {\n ApiBaseballConfig,\n ApiBaseballResponse,\n BaseballCountriesParams,\n BaseballCountry,\n BaseballSeasonsParams,\n BaseballTimezone,\n} from \"./baseball-common\";\n\nexport type {\n BaseballLeague,\n BaseballLeagueResponse,\n BaseballLeaguesParams,\n BaseballSeason,\n} from \"./baseball-leagues\";\n\nexport type {\n BaseballTeam,\n BaseballTeamResponse,\n BaseballTeamsParams,\n BaseballTeamStatistics,\n BaseballTeamStatisticsParams,\n} from \"./baseball-teams\";\n\nexport type {\n BaseballGame,\n BaseballGamesParams,\n BaseballGameStatus,\n BaseballHeadToHeadParams,\n BaseballScores,\n} from \"./baseball-games\";\n\nexport type {\n BaseballStanding,\n BaseballStandingsParams,\n} from \"./baseball-standings\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"basketball-context.js","sourceRoot":"","sources":["../../../src/basketball/hooks/basketball-context.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAA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AAE,EAAE,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC"}
1
+ {"version":3,"file":"basketball-context.js","sourceRoot":"","sources":["../../../src/basketball/hooks/basketball-context.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,EACZ,aAAa,EAEb,UAAU,EACV,OAAO,GACR,MAAM,OAAO,CAAC;AAGf,OAAO,EAGL,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAclB,MAAM,oBAAoB,GAAG,aAAa,CACxC,IAAI,CACL,CAAC;AA2CF,MAAM,UAAU,qBAAqB,CAAC,EACpC,MAAM,EACN,cAAc,EACd,QAAQ,GACmB;IAE3B,MAAM,QAAQ,GAAG,OAAO,CACtB,GAAG,EAAE,CAAC,wBAAwB,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC,EACpE,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAC5B,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;IAEF,OAAO,CACL,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAC/C,QAAQ,CACqB,CACjC,CAAC;AACJ,CAAC;AAQD,MAAM,UAAU,sBAAsB;IACpC,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,CAAC;AACxB,CAAC;AAQD,MAAM,UAAU,4BAA4B;IAC1C,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,2EAA2E,CAC5E,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC1B,CAAC;AAWD,MAAM,UAAU,qBAAqB;IACnC,MAAM,QAAQ,GAAG,4BAA4B,EAAE,CAAC;IAChD,OAAO,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC","sourcesContent":["/**\n * @module hooks/basketball-context\n * @description React context for API-Basketball client and store\n *\n * Provides the ApiBasketballClient and store instances to all hooks via React context.\n * Must wrap your app with ApiBasketballProvider to use the hooks.\n *\n * @example\n * ```typescript\n * import { ApiBasketballProvider } from \"@sudobility/sports_api_client\";\n * import type { StorageService } from \"@sudobility/di\";\n *\n * const storageService = container.get<StorageService>(ServiceKeys.STORAGE);\n *\n * function App() {\n * return (\n * <QueryClientProvider client={queryClient}>\n * <ApiBasketballProvider client={apiClient} storageService={storageService}>\n * <YourApp />\n * </ApiBasketballProvider>\n * </QueryClientProvider>\n * );\n * }\n * ```\n */\n\nimport React, {\n createContext,\n type ReactNode,\n useContext,\n useMemo,\n} from \"react\";\nimport type { StorageService } from \"@sudobility/di\";\nimport type { ApiBasketballClient } from \"../network/api-basketball-client\";\nimport {\n type ApiBasketballState,\n type ApiBasketballStore,\n createApiBasketballStore,\n createStorageAdapter,\n} from \"../store\";\n\n/**\n * Context value containing the API client and store\n */\ninterface ApiBasketballContextValue {\n client: ApiBasketballClient;\n useStore: ApiBasketballStore;\n}\n\n/**\n * React context for API-Basketball client and store\n * @internal\n */\nconst ApiBasketballContext = createContext<ApiBasketballContextValue | null>(\n null,\n);\n\n/**\n * Props for ApiBasketballProvider\n */\nexport interface ApiBasketballProviderProps {\n /** The ApiBasketballClient instance to provide */\n client: ApiBasketballClient;\n /** Storage service from DI for cross-platform persistence */\n storageService: StorageService;\n /** Child components */\n children: ReactNode;\n}\n\n/**\n * Provider component for API-Basketball hooks\n *\n * Wrap your application with this provider to enable API-Basketball hooks.\n * You must also wrap with QueryClientProvider from @tanstack/react-query.\n *\n * @param props - Provider props including client, storageService, and children\n * @returns Provider component\n *\n * @example\n * ```typescript\n * import { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\n * import { ApiBasketballProvider, ApiBasketballClient } from \"@sudobility/sports_api_client\";\n *\n * const queryClient = new QueryClient();\n * const storageService = container.get<StorageService>(ServiceKeys.STORAGE);\n * const apiClient = new ApiBasketballClient(networkClient, { apiKey: \"YOUR_KEY\" });\n *\n * function App() {\n * return (\n * <QueryClientProvider client={queryClient}>\n * <ApiBasketballProvider client={apiClient} storageService={storageService}>\n * <YourApp />\n * </ApiBasketballProvider>\n * </QueryClientProvider>\n * );\n * }\n * ```\n */\nexport function ApiBasketballProvider({\n client,\n storageService,\n children,\n}: ApiBasketballProviderProps) {\n // Create store once with the provided storage service\n const useStore = useMemo(\n () => createApiBasketballStore(createStorageAdapter(storageService)),\n [storageService],\n );\n\n const contextValue = useMemo(\n () => ({ client, useStore }),\n [client, useStore],\n );\n\n return (\n <ApiBasketballContext.Provider value={contextValue}>\n {children}\n </ApiBasketballContext.Provider>\n );\n}\n\n/**\n * Hook to access the ApiBasketballClient from context\n *\n * @returns The ApiBasketballClient instance\n * @throws Error if used outside of ApiBasketballProvider\n */\nexport function useApiBasketballClient(): ApiBasketballClient {\n const context = useContext(ApiBasketballContext);\n if (!context) {\n throw new Error(\n \"useApiBasketballClient must be used within an ApiBasketballProvider\",\n );\n }\n return context.client;\n}\n\n/**\n * Hook to access the API-Basketball Zustand store from context\n *\n * @returns The Zustand store hook for API-Basketball state\n * @throws Error if used outside of ApiBasketballProvider\n */\nexport function useApiBasketballStoreContext(): ApiBasketballStore {\n const context = useContext(ApiBasketballContext);\n if (!context) {\n throw new Error(\n \"useApiBasketballStoreContext must be used within an ApiBasketballProvider\",\n );\n }\n return context.useStore;\n}\n\n/**\n * Hook to access API-Basketball store state\n *\n * Convenience hook that combines context access with store selection.\n * Returns the full state object with all methods and data.\n *\n * @returns Full store state with getters, setters, and cached data\n * @throws Error if used outside of ApiBasketballProvider\n */\nexport function useApiBasketballStore(): ApiBasketballState {\n const useStore = useApiBasketballStoreContext();\n return useStore((state) => state);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"basketball-types.js","sourceRoot":"","sources":["../../../src/basketball/hooks/basketball-types.ts"],"names":[],"mappings":"AAuCA,MAAM,mBAAmB,GAAG,CAAC,gBAAgB,CAAU,CAAC;AAqBxD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,GAAG,EAAE,mBAAmB;IAGxB,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,mBAAmB,EAAE,UAAU,CAAU;IAC7D,SAAS,EAAE;QACT,GAAG,EAAE,CAAC,GAAG,mBAAmB,EAAE,WAAW,CAAU;QACnD,IAAI,EAAE,CAAC,MAAe,EAAE,EAAE,CACxB,CAAC,GAAG,mBAAmB,EAAE,WAAW,EAAE,MAAM,IAAI,EAAE,CAAU;KAC/D;IACD,OAAO,EAAE;QACP,GAAG,EAAE,CAAC,GAAG,mBAAmB,EAAE,SAAS,CAAU;QACjD,IAAI,EAAE,CAAC,MAAe,EAAE,EAAE,CACxB,CAAC,GAAG,mBAAmB,EAAE,SAAS,EAAE,MAAM,IAAI,EAAE,CAAU;KAC7D;IAGD,OAAO,EAAE;QACP,GAAG,EAAE,CAAC,GAAG,mBAAmB,EAAE,SAAS,CAAU;QACjD,IAAI,EAAE,CAAC,MAAe,EAAE,EAAE,CACxB,CAAC,GAAG,mBAAmB,EAAE,SAAS,EAAE,MAAM,IAAI,EAAE,CAAU;KAC7D;IAGD,KAAK,EAAE;QACL,GAAG,EAAE,CAAC,GAAG,mBAAmB,EAAE,OAAO,CAAU;QAC/C,IAAI,EAAE,CAAC,MAAe,EAAE,EAAE,CACxB,CAAC,GAAG,mBAAmB,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE,CAAU;QAC1D,UAAU,EAAE,CAAC,MAAc,EAAE,EAAE,CAC7B,CAAC,GAAG,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,CAAU;K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,IAAI,EAAE,CAAU;KAC7D;IAGD,OAAO,EAAE;QACP,GAAG,EAAE,CAAC,GAAG,mBAAmB,EAAE,SAAS,CAAU;QACjD,IAAI,EAAE,CAAC,MAAe,EAAE,EAAE,CACxB,CAAC,GAAG,mBAAmB,EAAE,SAAS,EAAE,MAAM,IAAI,EAAE,CAAU;KAC7D;IAGD,KAAK,EAAE;QACL,GAAG,EAAE,CAAC,GAAG,mBAAmB,EAAE,OAAO,CAAU;QAC/C,IAAI,EAAE,CAAC,MAAe,EAAE,EAAE,CACxB,CAAC,GAAG,mBAAmB,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE,CAAU;QAC1D,UAAU,EAAE,CAAC,MAAc,EAAE,EAAE,CAC7B,CAAC,GAAG,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,CAAU;KAC/D;IAGD,KAAK,EAAE;QACL,GAAG,EAAE,CAAC,GAAG,mBAAmB,EAAE,OAAO,CAAU;QAC/C,IAAI,EAAE,CAAC,MAAe,EAAE,EAAE,CACxB,CAAC,GAAG,mBAAmB,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE,CAAU;QAC1D,UAAU,EAAE,CAAC,MAAc,EAAE,EAAE,CAC7B,CAAC,GAAG,mBAAmB,EAAE,WAAW,EAAE,MAAM,CAAU;QACxD,UAAU,EAAE,CAAC,MAAc,EAAE,EAAE,CAC7B,CAAC,GAAG,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,CAAU;KAC/D;IAGD,SAAS,EAAE;QACT,GAAG,EAAE,CAAC,GAAG,mBAAmB,EAAE,WAAW,CAAU;QACnD,IAAI,EAAE,CAAC,MAAc,EAAE,EAAE,CACvB,CAAC,GAAG,mBAAmB,EAAE,WAAW,EAAE,MAAM,CAAU;KACzD;CACO,CAAC","sourcesContent":["/**\n * @module hooks/basketball-types\n * @description Type definitions for API-Basketball hooks\n */\n\nimport type { UseQueryOptions } from \"@tanstack/react-query\";\nimport type { ApiBasketballResponse } from \"../types\";\n\n/**\n * Base options for all API-Basketball hooks\n *\n * Extends React Query's UseQueryOptions with common defaults.\n */\nexport interface UseApiBasketballQueryOptions<\n TData,\n TParams = void,\n> extends Omit<\n UseQueryOptions<ApiBasketballResponse<TData>, Error>,\n \"queryKey\" | \"queryFn\"\n> {\n /** Parameters for the API call */\n params?: TParams;\n}\n\n/**\n * Options for hooks with required parameters\n */\nexport interface UseApiBasketballQueryOptionsRequired<\n TData,\n TParams,\n> extends Omit<\n UseQueryOptions<ApiBasketballResponse<TData>, Error>,\n \"queryKey\" | \"queryFn\"\n> {\n /** Parameters for the API call (required) */\n params: TParams;\n}\n\n// Base key for all API-Basketball queries\nconst BASKETBALL_BASE_KEY = [\"api-basketball\"] as const;\n\n/**\n * Query keys namespace for all API-Basketball queries\n *\n * Use these keys for cache invalidation and prefetching.\n *\n * @example\n * ```typescript\n * import { queryClient } from \"./your-query-client\";\n * import { apiBasketballKeys } from \"@sudobility/sports_api_client\";\n *\n * // Invalidate all leagues queries\n * queryClient.invalidateQueries({ queryKey: apiBasketballKeys.leagues.all });\n *\n * // Invalidate specific games query\n * queryClient.invalidateQueries({\n * queryKey: apiBasketballKeys.games.list({ league: 12 }),\n * });\n * ```\n */\nexport const apiBasketballKeys = {\n all: BASKETBALL_BASE_KEY,\n\n // General\n timezone: () => [...BASKETBALL_BASE_KEY, \"timezone\"] as const,\n countries: {\n all: [...BASKETBALL_BASE_KEY, \"countries\"] as const,\n list: (params?: object) =>\n [...BASKETBALL_BASE_KEY, \"countries\", params ?? {}] as const,\n },\n seasons: {\n all: [...BASKETBALL_BASE_KEY, \"seasons\"] as const,\n list: (params?: object) =>\n [...BASKETBALL_BASE_KEY, \"seasons\", params ?? {}] as const,\n },\n\n // Leagues\n leagues: {\n all: [...BASKETBALL_BASE_KEY, \"leagues\"] as const,\n list: (params?: object) =>\n [...BASKETBALL_BASE_KEY, \"leagues\", params ?? {}] as const,\n },\n\n // Teams\n teams: {\n all: [...BASKETBALL_BASE_KEY, \"teams\"] as const,\n list: (params?: object) =>\n [...BASKETBALL_BASE_KEY, \"teams\", params ?? {}] as const,\n statistics: (params: object) =>\n [...BASKETBALL_BASE_KEY, \"team-statistics\", params] as const,\n },\n\n // Games\n games: {\n all: [...BASKETBALL_BASE_KEY, \"games\"] as const,\n list: (params?: object) =>\n [...BASKETBALL_BASE_KEY, \"games\", params ?? {}] as const,\n headToHead: (params: object) =>\n [...BASKETBALL_BASE_KEY, \"games-h2h\", params] as const,\n statistics: (params: object) =>\n [...BASKETBALL_BASE_KEY, \"game-statistics\", params] as const,\n },\n\n // Standings\n standings: {\n all: [...BASKETBALL_BASE_KEY, \"standings\"] as const,\n list: (params: object) =>\n [...BASKETBALL_BASE_KEY, \"standings\", params] as const,\n },\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/basketball/hooks/index.ts"],"names":[],"mappings":"AAqCA,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAOvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,OAAO,EACL,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,OAAO,EACL,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/basketball/hooks/index.ts"],"names":[],"mappings":"AAqCA,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAOvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,OAAO,EACL,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,OAAO,EACL,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["/**\n * @module basketball/hooks\n * @description React hooks for API-Basketball with React Query and Zustand caching\n *\n * All hooks integrate with React Query for data fetching and Zustand for\n * persistent caching. Cached data is automatically used as initial data\n * when available and valid.\n *\n * @example\n * ```typescript\n * import {\n * ApiBasketballProvider,\n * ApiBasketballClient,\n * useBasketballLeagues,\n * useBasketballGames,\n * useBasketballStandings,\n * apiBasketballKeys,\n * } from \"@sudobility/sports_api_client\";\n * import { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\n *\n * const queryClient = new QueryClient();\n * const storageService = container.get<StorageService>(ServiceKeys.STORAGE);\n * const apiClient = new ApiBasketballClient(networkClient, { apiKey: \"KEY\" });\n *\n * function App() {\n * return (\n * <QueryClientProvider client={queryClient}>\n * <ApiBasketballProvider client={apiClient} storageService={storageService}>\n * <YourApp />\n * </ApiBasketballProvider>\n * </QueryClientProvider>\n * );\n * }\n * ```\n */\n\n// Context and provider\nexport {\n ApiBasketballProvider,\n useApiBasketballClient,\n useApiBasketballStore,\n useApiBasketballStoreContext,\n} from \"./basketball-context\";\nexport type { ApiBasketballProviderProps } from \"./basketball-context\";\n\n// Types and keys\nexport { apiBasketballKeys } from \"./basketball-types\";\nexport type {\n UseApiBasketballQueryOptions,\n UseApiBasketballQueryOptionsRequired,\n} from \"./basketball-types\";\n\n// Countries hook\nexport { useBasketballCountries } from \"./use-basketball-countries\";\n\n// Games hooks\nexport {\n useBasketballGames,\n useBasketballGamesHeadToHead,\n} from \"./use-basketball-games\";\n\n// Leagues hook\nexport { useBasketballLeagues } from \"./use-basketball-leagues\";\n\n// Seasons hook\nexport { useBasketballSeasons } from \"./use-basketball-seasons\";\n\n// Standings hook\nexport { useBasketballStandings } from \"./use-basketball-standings\";\n\n// Teams hooks\nexport {\n useBasketballTeams,\n useBasketballTeamStatistics,\n} from \"./use-basketball-teams\";\n\n// Timezone hook\nexport { useBasketballTimezone } from \"./use-basketball-timezone\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-basketball-countries.js","sourceRoot":"","sources":["../../../src/basketball/hooks/use-basketball-countries.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAkB5B,MAAM,UAAU,sBAAsB,CACpC,OAGC;IAED,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACtE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAE/B,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;QAClD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YACnD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,IAAI,CAAC,MAAM,IAAI,SAAS,EAAE,IAAI,EAAE,CAAC;gBAC/B,OAAO;oBACL,GAAG,EAAE,WAAW;oBAChB,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM;oBAC9B,QAAQ,EAAE,SAAS,CAAC,IAAI;iBACzB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"use-basketball-countries.js","sourceRoot":"","sources":["../../../src/basketball/hooks/use-basketball-countries.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAkB5B,MAAM,UAAU,sBAAsB,CACpC,OAGC;IAED,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACtE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAE/B,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;QAClD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YACnD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,IAAI,CAAC,MAAM,IAAI,SAAS,EAAE,IAAI,EAAE,CAAC;gBAC/B,OAAO;oBACL,GAAG,EAAE,WAAW;oBAChB,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM;oBAC9B,QAAQ,EAAE,SAAS,CAAC,IAAI;iBACzB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-basketball-countries\n * @description React hook for countries endpoint\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport {\n useApiBasketballClient,\n useApiBasketballStore,\n} from \"./basketball-context\";\nimport {\n apiBasketballKeys,\n type UseApiBasketballQueryOptions,\n} from \"./basketball-types\";\nimport type { BasketballCountriesParams, BasketballCountry } from \"../types\";\n\n/**\n * Hook to fetch countries\n *\n * @param options - Query options including optional filter params\n * @returns Query result with country data\n *\n * @example\n * ```typescript\n * function CountryList() {\n * const { data, isLoading } = useBasketballCountries();\n * const countries = data?.response ?? [];\n * // ...\n * }\n * ```\n */\nexport function useBasketballCountries(\n options?: UseApiBasketballQueryOptions<\n BasketballCountry,\n BasketballCountriesParams\n >,\n) {\n const client = useApiBasketballClient();\n const { countries, setCountries, cacheTTL } = useApiBasketballStore();\n const params = options?.params;\n\n return useQuery({\n queryKey: apiBasketballKeys.countries.list(params),\n queryFn: async () => {\n const response = await client.getCountries(params);\n if (!params) {\n setCountries(response.response);\n }\n return response;\n },\n initialData: () => {\n if (!params && countries?.data) {\n return {\n get: \"countries\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: countries.data.length,\n response: countries.data,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...options,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-basketball-games.js","sourceRoot":"","sources":["../../../src/basketball/hooks/use-basketball-games.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,iBAAiB,GAGlB,MAAM,oBAAoB,CAAC;AAgC5B,MAAM,UAAU,kBAAkB,CAChC,OAA6E;IAE7E,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACjE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAC/B,MAAM,QAAQ,GAAG,gBAAgB,CAC/B,OAAO,EACP,MAA4C,CAC7C,CAAC;IAEF,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9C,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC/C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACtC,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAClC,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO;oBACL,GAAG,EAAE,OAAO;oBACZ,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,MAAM,CAAC,MAAM;oBACtB,QAAQ,EAAE,MAAM;iBACj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AAM,UAAU,4BAA4B,CAC1C,OAGC;IAED,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACjE,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC;IAC5C,MAAM,QAAQ,GAAG,gBAAgB,CAC/B,WAAW,EACX,MAA4C,CAC7C,CAAC;IAEF,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;QACpD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;YACzD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACtC,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAClC,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO;oBACL,GAAG,EAAE,WAAW;oBAChB,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,MAAM,CAAC,MAAM;oBACtB,QAAQ,EAAE,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,YAAY;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-basketball-games\n * @description React hooks for games endpoints\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport {\n useApiBasketballClient,\n useApiBasketballStore,\n} from \"./basketball-context\";\nimport { generateCacheKey } from \"../../utils/cache-utils\";\nimport {\n apiBasketballKeys,\n type UseApiBasketballQueryOptions,\n type UseApiBasketballQueryOptionsRequired,\n} from \"./basketball-types\";\nimport type {\n BasketballGame,\n BasketballGamesParams,\n BasketballHeadToHeadParams,\n} from \"../types\";\n\n/**\n * Hook to fetch games\n *\n * @param options - Query options including optional filter params\n * @returns Query result with game data\n *\n * @example\n * ```typescript\n * // Get games by date\n * function TodaysGames() {\n * const { data, isLoading } = useBasketballGames({\n * params: { date: \"2024-01-15\" },\n * });\n * // ...\n * }\n *\n * // Get games by league and season\n * function NBAGames() {\n * const { data } = useBasketballGames({\n * params: { league: 12, season: \"2023-2024\" },\n * });\n * // ...\n * }\n * ```\n */\nexport function useBasketballGames(\n options?: UseApiBasketballQueryOptions<BasketballGame, BasketballGamesParams>,\n) {\n const client = useApiBasketballClient();\n const { getGames, setGames, cacheTTL } = useApiBasketballStore();\n const params = options?.params;\n const cacheKey = generateCacheKey(\n \"games\",\n params as unknown as Record<string, unknown>,\n );\n\n return useQuery({\n queryKey: apiBasketballKeys.games.list(params),\n queryFn: async () => {\n const response = await client.getGames(params);\n setGames(cacheKey, response.response);\n return response;\n },\n initialData: () => {\n const cached = getGames(cacheKey);\n if (cached) {\n return {\n get: \"games\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: cached.length,\n response: cached,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...options,\n });\n}\n\n/**\n * Hook to fetch head to head games between two teams\n *\n * Requires h2h parameter (format: \"team1Id-team2Id\").\n *\n * @param options - Query options with required params\n * @returns Query result with head to head game data\n *\n * @example\n * ```typescript\n * function HeadToHead({ team1Id, team2Id }: Props) {\n * const { data, isLoading } = useBasketballGamesHeadToHead({\n * params: { h2h: `${team1Id}-${team2Id}` },\n * });\n * // ...\n * }\n * ```\n */\nexport function useBasketballGamesHeadToHead(\n options: UseApiBasketballQueryOptionsRequired<\n BasketballGame,\n BasketballHeadToHeadParams\n >,\n) {\n const client = useApiBasketballClient();\n const { getGames, setGames, cacheTTL } = useApiBasketballStore();\n const { params, ...queryOptions } = options;\n const cacheKey = generateCacheKey(\n \"games-h2h\",\n params as unknown as Record<string, unknown>,\n );\n\n return useQuery({\n queryKey: apiBasketballKeys.games.headToHead(params),\n queryFn: async () => {\n const response = await client.getGamesHeadToHead(params);\n setGames(cacheKey, response.response);\n return response;\n },\n initialData: () => {\n const cached = getGames(cacheKey);\n if (cached) {\n return {\n get: \"games/h2h\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: cached.length,\n response: cached,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...queryOptions,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-basketball-leagues.js","sourceRoot":"","sources":["../../../src/basketball/hooks/use-basketball-leagues.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAkC5B,MAAM,UAAU,oBAAoB,CAClC,OAGC;IAED,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACrE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAC/B,MAAM,QAAQ,GAAG,gBAAgB,CAC/B,SAAS,EACT,MAA4C,CAC7C,CAAC;IAEF,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAChD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACjD,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACxC,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;YACpC,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO;oBACL,GAAG,EAAE,SAAS;oBACd,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,MAAM,CAAC,MAAM;oBACtB,QAAQ,EAAE,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"use-basketball-leagues.js","sourceRoot":"","sources":["../../../src/basketball/hooks/use-basketball-leagues.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAkC5B,MAAM,UAAU,oBAAoB,CAClC,OAGC;IAED,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACrE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAC/B,MAAM,QAAQ,GAAG,gBAAgB,CAC/B,SAAS,EACT,MAA4C,CAC7C,CAAC;IAEF,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAChD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACjD,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACxC,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;YACpC,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO;oBACL,GAAG,EAAE,SAAS;oBACd,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,MAAM,CAAC,MAAM;oBACtB,QAAQ,EAAE,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-basketball-leagues\n * @description React hook for leagues endpoint\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport {\n useApiBasketballClient,\n useApiBasketballStore,\n} from \"./basketball-context\";\nimport { generateCacheKey } from \"../../utils/cache-utils\";\nimport {\n apiBasketballKeys,\n type UseApiBasketballQueryOptions,\n} from \"./basketball-types\";\nimport type {\n BasketballLeagueResponse,\n BasketballLeaguesParams,\n} from \"../types\";\n\n/**\n * Hook to fetch leagues\n *\n * @param options - Query options including optional filter params\n * @returns Query result with league data\n *\n * @example\n * ```typescript\n * // Get all leagues\n * function AllLeagues() {\n * const { data, isLoading } = useBasketballLeagues();\n * // ...\n * }\n *\n * // Get leagues by country\n * function USALeagues() {\n * const { data } = useBasketballLeagues({ params: { country: \"USA\" } });\n * // ...\n * }\n *\n * // Get specific league (NBA)\n * function NBALeague() {\n * const { data } = useBasketballLeagues({ params: { id: 12 } });\n * const league = data?.response[0];\n * // ...\n * }\n * ```\n */\nexport function useBasketballLeagues(\n options?: UseApiBasketballQueryOptions<\n BasketballLeagueResponse,\n BasketballLeaguesParams\n >,\n) {\n const client = useApiBasketballClient();\n const { getLeagues, setLeagues, cacheTTL } = useApiBasketballStore();\n const params = options?.params;\n const cacheKey = generateCacheKey(\n \"leagues\",\n params as unknown as Record<string, unknown>,\n );\n\n return useQuery({\n queryKey: apiBasketballKeys.leagues.list(params),\n queryFn: async () => {\n const response = await client.getLeagues(params);\n setLeagues(cacheKey, response.response);\n return response;\n },\n initialData: () => {\n const cached = getLeagues(cacheKey);\n if (cached) {\n return {\n get: \"leagues\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: cached.length,\n response: cached,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...options,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-basketball-seasons.js","sourceRoot":"","sources":["../../../src/basketball/hooks/use-basketball-seasons.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAkB5B,MAAM,UAAU,oBAAoB,CAClC,OAAuE;IAEvE,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAClE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAE/B,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAChD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACjD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAChC,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,IAAI,CAAC,MAAM,IAAI,OAAO,EAAE,IAAI,EAAE,CAAC;gBAC7B,OAAO;oBACL,GAAG,EAAE,SAAS;oBACd,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM;oBAC5B,QAAQ,EAAE,OAAO,CAAC,IAAI;iBACvB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"use-basketball-seasons.js","sourceRoot":"","sources":["../../../src/basketball/hooks/use-basketball-seasons.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAkB5B,MAAM,UAAU,oBAAoB,CAClC,OAAuE;IAEvE,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAClE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAE/B,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAChD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACjD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAChC,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,IAAI,CAAC,MAAM,IAAI,OAAO,EAAE,IAAI,EAAE,CAAC;gBAC7B,OAAO;oBACL,GAAG,EAAE,SAAS;oBACd,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM;oBAC5B,QAAQ,EAAE,OAAO,CAAC,IAAI;iBACvB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-basketball-seasons\n * @description React hook for seasons endpoint\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport {\n useApiBasketballClient,\n useApiBasketballStore,\n} from \"./basketball-context\";\nimport {\n apiBasketballKeys,\n type UseApiBasketballQueryOptions,\n} from \"./basketball-types\";\nimport type { BasketballSeasonsParams } from \"../types\";\n\n/**\n * Hook to fetch available seasons\n *\n * @param options - Query options including optional filter params\n * @returns Query result with season data (array of strings like \"2023-2024\")\n *\n * @example\n * ```typescript\n * function SeasonSelector() {\n * const { data, isLoading } = useBasketballSeasons();\n * const seasons = data?.response ?? [];\n * // ...\n * }\n * ```\n */\nexport function useBasketballSeasons(\n options?: UseApiBasketballQueryOptions<string, BasketballSeasonsParams>,\n) {\n const client = useApiBasketballClient();\n const { seasons, setSeasons, cacheTTL } = useApiBasketballStore();\n const params = options?.params;\n\n return useQuery({\n queryKey: apiBasketballKeys.seasons.list(params),\n queryFn: async () => {\n const response = await client.getSeasons(params);\n if (!params) {\n setSeasons(response.response);\n }\n return response;\n },\n initialData: () => {\n if (!params && seasons?.data) {\n return {\n get: \"seasons\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: seasons.data.length,\n response: seasons.data,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...options,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-basketball-standings.js","sourceRoot":"","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Q;QACnB,GAAG,YAAY;KAChB,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"use-basketball-standings.js","sourceRoot":"","sources":["../../../src/basketball/hooks/use-basketball-standings.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAmC5B,MAAM,UAAU,sBAAsB,CACpC,OAGC;IAED,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACzE,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC;IAC5C,MAAM,QAAQ,GAAG,gBAAgB,CAC/B,WAAW,EACX,MAA4C,CAC7C,CAAC;IAEF,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;QAClD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YACnD,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAC1C,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACtC,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO;oBACL,GAAG,EAAE,WAAW;oBAChB,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,MAAM,CAAC,MAAM;oBACtB,QAAQ,EAAE,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,YAAY;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-basketball-standings\n * @description React hook for standings endpoint\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport {\n useApiBasketballClient,\n useApiBasketballStore,\n} from \"./basketball-context\";\nimport { generateCacheKey } from \"../../utils/cache-utils\";\nimport {\n apiBasketballKeys,\n type UseApiBasketballQueryOptionsRequired,\n} from \"./basketball-types\";\nimport type { BasketballStanding, BasketballStandingsParams } from \"../types\";\n\n/**\n * Hook to fetch league standings\n *\n * Requires league and season parameters.\n *\n * @param options - Query options with required params\n * @returns Query result with standings data\n *\n * @example\n * ```typescript\n * function LeagueStandings({ leagueId, season }: Props) {\n * const { data, isLoading } = useBasketballStandings({\n * params: { league: leagueId, season },\n * });\n *\n * const standings = data?.response ?? [];\n *\n * return (\n * <Table>\n * {standings.map((standing) => (\n * <Row key={standing.team.id}>\n * <Cell>{standing.position}</Cell>\n * <Cell>{standing.team.name}</Cell>\n * <Cell>{standing.games.win}</Cell>\n * <Cell>{standing.games.lose}</Cell>\n * </Row>\n * ))}\n * </Table>\n * );\n * }\n * ```\n */\nexport function useBasketballStandings(\n options: UseApiBasketballQueryOptionsRequired<\n BasketballStanding,\n BasketballStandingsParams\n >,\n) {\n const client = useApiBasketballClient();\n const { getStandings, setStandings, cacheTTL } = useApiBasketballStore();\n const { params, ...queryOptions } = options;\n const cacheKey = generateCacheKey(\n \"standings\",\n params as unknown as Record<string, unknown>,\n );\n\n return useQuery({\n queryKey: apiBasketballKeys.standings.list(params),\n queryFn: async () => {\n const response = await client.getStandings(params);\n setStandings(cacheKey, response.response);\n return response;\n },\n initialData: () => {\n const cached = getStandings(cacheKey);\n if (cached) {\n return {\n get: \"standings\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: cached.length,\n response: cached,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...queryOptions,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-basketball-teams.js","sourceRoot":"","sources":["../../../src/basketball/hooks/use-basketball-teams.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,iBAAiB,GAGlB,MAAM,oBAAoB,CAAC;AAgC5B,MAAM,UAAU,kBAAkB,CAChC,OAGC;IAED,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACjE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAC/B,MAAM,QAAQ,GAAG,gBAAgB,CAC/B,OAAO,EACP,MAA4C,CAC7C,CAAC;IAEF,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9C,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC/C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACtC,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAClC,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO;oBACL,GAAG,EAAE,OAAO;oBACZ,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,MAAM,CAAC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,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-basketball-teams\n * @description React hooks for teams endpoints\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport {\n useApiBasketballClient,\n useApiBasketballStore,\n} from \"./basketball-context\";\nimport { generateCacheKey } from \"../../utils/cache-utils\";\nimport {\n apiBasketballKeys,\n type UseApiBasketballQueryOptions,\n type UseApiBasketballQueryOptionsRequired,\n} from \"./basketball-types\";\nimport type {\n BasketballTeamResponse,\n BasketballTeamsParams,\n BasketballTeamStatistics,\n BasketballTeamStatisticsParams,\n} from \"../types\";\n\n/**\n * Hook to fetch teams\n *\n * @param options - Query options including optional filter params\n * @returns Query result with team data\n *\n * @example\n * ```typescript\n * // Get teams by league and season\n * function NBATeams() {\n * const { data, isLoading } = useBasketballTeams({\n * params: { league: 12, season: \"2023-2024\" },\n * });\n * // ...\n * }\n *\n * // Get specific team\n * function Lakers() {\n * const { data } = useBasketballTeams({ params: { id: 1 } });\n * const team = data?.response[0];\n * // ...\n * }\n * ```\n */\nexport function useBasketballTeams(\n options?: UseApiBasketballQueryOptions<\n BasketballTeamResponse,\n BasketballTeamsParams\n >,\n) {\n const client = useApiBasketballClient();\n const { getTeams, setTeams, cacheTTL } = useApiBasketballStore();\n const params = options?.params;\n const cacheKey = generateCacheKey(\n \"teams\",\n params as unknown as Record<string, unknown>,\n );\n\n return useQuery({\n queryKey: apiBasketballKeys.teams.list(params),\n queryFn: async () => {\n const response = await client.getTeams(params);\n setTeams(cacheKey, response.response);\n return response;\n },\n initialData: () => {\n const cached = getTeams(cacheKey);\n if (cached) {\n return {\n get: \"teams\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: cached.length,\n response: cached,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...options,\n });\n}\n\n/**\n * Hook to fetch team statistics\n *\n * Requires team, league, and season parameters.\n *\n * @param options - Query options with required params\n * @returns Query result with team statistics data\n *\n * @example\n * ```typescript\n * function TeamStats({ teamId, leagueId, season }: Props) {\n * const { data, isLoading } = useBasketballTeamStatistics({\n * params: { team: teamId, league: leagueId, season },\n * });\n * // ...\n * }\n * ```\n */\nexport function useBasketballTeamStatistics(\n options: UseApiBasketballQueryOptionsRequired<\n BasketballTeamStatistics,\n BasketballTeamStatisticsParams\n >,\n) {\n const client = useApiBasketballClient();\n const { getTeamStatistics, setTeamStatistics, cacheTTL } =\n useApiBasketballStore();\n const { params, ...queryOptions } = options;\n const cacheKey = generateCacheKey(\n \"team-statistics\",\n params as unknown as Record<string, unknown>,\n );\n\n return useQuery({\n queryKey: apiBasketballKeys.teams.statistics(params),\n queryFn: async () => {\n const response = await client.getTeamStatistics(params);\n const stats = response.response[0];\n if (stats) {\n setTeamStatistics(cacheKey, stats);\n }\n return response;\n },\n initialData: () => {\n const cached = getTeamStatistics(cacheKey);\n if (cached) {\n return {\n get: \"statistics\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: 1,\n response: [cached],\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...queryOptions,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-basketball-timezone.js","sourceRoot":"","sources":["../../../src/basketball/hooks/use-basketball-timezone.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAkB5B,MAAM,UAAU,qBAAqB,CACnC,OAA0D;IAE1D,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAEtE,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,EAAE;QACtC,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;YAC5C,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAChC,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,IAAI,SAAS,EAAE,IAAI,EAAE,CAAC;gBACpB,OAAO;oBACL,GAAG,EAAE,UAAU;oBACf,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM;oBAC9B,QAAQ,EAAE,SAAS,CAAC,IAAI;iBACzB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"use-basketball-timezone.js","sourceRoot":"","sources":["../../../src/basketball/hooks/use-basketball-timezone.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAkB5B,MAAM,UAAU,qBAAqB,CACnC,OAA0D;IAE1D,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAEtE,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,EAAE;QACtC,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;YAC5C,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAChC,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,IAAI,SAAS,EAAE,IAAI,EAAE,CAAC;gBACpB,OAAO;oBACL,GAAG,EAAE,UAAU;oBACf,UAAU,EAAE,EAA4B;oBACxC,MAAM,EAAE,EAAc;oBACtB,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM;oBAC9B,QAAQ,EAAE,SAAS,CAAC,IAAI;iBACzB,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,QAAQ;QACnB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @module hooks/use-basketball-timezone\n * @description React hook for timezone endpoint\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport {\n useApiBasketballClient,\n useApiBasketballStore,\n} from \"./basketball-context\";\nimport {\n apiBasketballKeys,\n type UseApiBasketballQueryOptions,\n} from \"./basketball-types\";\nimport type { BasketballTimezone } from \"../types\";\n\n/**\n * Hook to fetch available timezones\n *\n * @param options - Query options\n * @returns Query result with timezone data\n *\n * @example\n * ```typescript\n * function TimezoneSelector() {\n * const { data, isLoading } = useBasketballTimezone();\n * const timezones = data?.response ?? [];\n * // ...\n * }\n * ```\n */\nexport function useBasketballTimezone(\n options?: UseApiBasketballQueryOptions<BasketballTimezone>,\n) {\n const client = useApiBasketballClient();\n const { timezones, setTimezones, cacheTTL } = useApiBasketballStore();\n\n return useQuery({\n queryKey: apiBasketballKeys.timezone(),\n queryFn: async () => {\n const response = await client.getTimezone();\n setTimezones(response.response);\n return response;\n },\n initialData: () => {\n if (timezones?.data) {\n return {\n get: \"timezone\",\n parameters: {} as Record<string, string>,\n errors: [] as string[],\n results: timezones.data.length,\n response: timezones.data,\n };\n }\n return undefined;\n },\n staleTime: cacheTTL,\n ...options,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/basketball/index.ts"],"names":[],"mappings":"AAmCA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,wBAAwB,GAGzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,EAC5B,sBAAsB,EACtB,kBAAkB,EAClB,4BAA4B,EAC5B,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,2BAA2B,EAC3B,qBAAqB,GAItB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/basketball/index.ts"],"names":[],"mappings":"AAmCA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,wBAAwB,GAGzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,EAC5B,sBAAsB,EACtB,kBAAkB,EAClB,4BAA4B,EAC5B,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,2BAA2B,EAC3B,qBAAqB,GAItB,MAAM,SAAS,CAAC","sourcesContent":["/**\n * @module basketball\n * @description API-Basketball client library exports\n *\n * Provides type-safe access to the API-Basketball API with React hooks,\n * Zustand caching, and React Query integration.\n */\n\n// Types\nexport type {\n ApiBasketballConfig,\n ApiBasketballResponse,\n BasketballCountriesParams,\n BasketballCountry,\n BasketballGame,\n BasketballGamesParams,\n BasketballGameStatus,\n BasketballHeadToHeadParams,\n BasketballLeague,\n BasketballLeagueResponse,\n BasketballLeaguesParams,\n BasketballScores,\n BasketballSeason,\n BasketballSeasonsParams,\n BasketballStanding,\n BasketballStandingsParams,\n BasketballTeam,\n BasketballTeamResponse,\n BasketballTeamsParams,\n BasketballTeamStatistics,\n BasketballTeamStatisticsParams,\n BasketballTimezone,\n} from \"./types\";\n\n// Network\nexport {\n ApiBasketballClient,\n BASKETBALL_API_BASE_URL,\n BASKETBALL_DEFAULT_HEADERS,\n BASKETBALL_ENDPOINTS,\n BASKETBALL_RAPIDAPI_HOST,\n createApiBasketballClient,\n} from \"./network\";\n\n// Store\nexport {\n createApiBasketballStore,\n type ApiBasketballState,\n type ApiBasketballStore,\n} from \"./store\";\n\n// Hooks\nexport {\n ApiBasketballProvider,\n apiBasketballKeys,\n useApiBasketballClient,\n useApiBasketballStore,\n useApiBasketballStoreContext,\n useBasketballCountries,\n useBasketballGames,\n useBasketballGamesHeadToHead,\n useBasketballLeagues,\n useBasketballSeasons,\n useBasketballStandings,\n useBasketballTeams,\n useBasketballTeamStatistics,\n useBasketballTimezone,\n type ApiBasketballProviderProps,\n type UseApiBasketballQueryOptions,\n type UseApiBasketballQueryOptionsRequired,\n} from \"./hooks\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"api-basketball-client.js","sourceRoot":"","sources":["../../../src/basketball/network/api-basketball-client.ts"],"names":[],"mappings":"AA0CA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAOhC,MAAM,OAAO,mBAAmB;IAW9B,YAAY,aAA4B,EAAE,MAA2B;QACnE,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,uBAAuB,CAAC;QAGzD,IAAI,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YAC9C,IAAI,CAAC,OAAO,GAAG;gBACb,GAAG,0BAA0B;gBAC7B,iBAAiB,EAAE,MAAM,CAAC,YAAY,IAAI,wBAAwB;gBAClE,gBAAgB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AAK,GAAG,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,OAAO,IAAI,CAAC,OAAO,CACjB,GAAG,oBAAoB,CAAC,KAAK,GAAG,KAAK,EAAE,CACxC,CAAC;IACJ,CAAC;IAKD,KAAK,CAAC,kBAAkB,CACtB,MAAkC;QAElC,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CACjB,GAAG,oBAAoB,CAAC,kBAAkB,GAAG,KAAK,EAAE,CACrD,CAAC;IACJ,CAAC;IASD,KAAK,CAAC,YAAY,CAChB,MAAiC;QAEjC,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CACjB,GAAG,oBAAoB,CAAC,SAAS,GAAG,KAAK,EAAE,CAC5C,CAAC;IACJ,CAAC;CACF;AAKD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,aAA4B,EAC5B,MAA2B,EACN,EAAE;IACvB,OAAO,IAAI,mBAAmB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACxD,CAAC,CAAC"}
1
+ {"version":3,"file":"api-basketball-client.js","sourceRoot":"","sources":["../../../src/basketball/network/api-basketball-client.ts"],"names":[],"mappings":"AA0CA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAOhC,MAAM,OAAO,mBAAmB;IAW9B,YAAY,aAA4B,EAAE,MAA2B;QACnE,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,uBAAuB,CAAC;QAGzD,IAAI,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,YAAY,EAA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,CACjB,GAAG,oBAAoB,CAAC,gBAAgB,GAAG,KAAK,EAAE,CACnD,CAAC;IACJ,CAAC;IASD,KAAK,CAAC,QAAQ,CACZ,MAA8B;QAE9B,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,OAAO,IAAI,CAAC,OAAO,CACjB,GAAG,oBAAoB,CAAC,KAAK,GAAG,KAAK,EAAE,CACxC,CAAC;IACJ,CAAC;IAKD,KAAK,CAAC,kBAAkB,CACtB,MAAkC;QAElC,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CACjB,GAAG,oBAAoB,CAAC,kBAAkB,GAAG,KAAK,EAAE,CACrD,CAAC;IACJ,CAAC;IASD,KAAK,CAAC,YAAY,CAChB,MAAiC;QAEjC,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CACjB,GAAG,oBAAoB,CAAC,SAAS,GAAG,KAAK,EAAE,CAC5C,CAAC;IACJ,CAAC;CACF;AAKD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,aAA4B,EAC5B,MAA2B,EACN,EAAE;IACvB,OAAO,IAAI,mBAAmB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACxD,CAAC,CAAC","sourcesContent":["/**\n * @module api-basketball-client\n * @description API-Basketball Client Library\n *\n * A TypeScript client for the API-Basketball API that provides type-safe\n * access to basketball data including leagues, teams, games, standings, and more.\n *\n * Uses dependency injection for network requests, making it compatible with\n * both React (web) and React Native applications.\n *\n * @example\n * ```typescript\n * import { ApiBasketballClient } from \"@sudobility/sports_api_client\";\n *\n * const client = new ApiBasketballClient(networkClient, {\n * apiKey: \"YOUR_API_KEY\",\n * });\n *\n * const leagues = await client.getLeagues({ country: \"USA\" });\n * ```\n */\n\nimport type { NetworkClient } from \"@sudobility/types\";\nimport type {\n ApiBasketballConfig,\n ApiBasketballResponse,\n BasketballCountriesParams,\n BasketballCountry,\n BasketballGame,\n BasketballGamesParams,\n BasketballHeadToHeadParams,\n BasketballLeagueResponse,\n BasketballLeaguesParams,\n BasketballSeasonsParams,\n BasketballStanding,\n BasketballStandingsParams,\n BasketballTeamResponse,\n BasketballTeamsParams,\n BasketballTeamStatistics,\n BasketballTeamStatisticsParams,\n BasketballTimezone,\n} from \"../types\";\nimport { buildQueryString } from \"../../utils/query-params\";\nimport {\n BASKETBALL_API_BASE_URL,\n BASKETBALL_DEFAULT_HEADERS,\n BASKETBALL_ENDPOINTS,\n BASKETBALL_RAPIDAPI_HOST,\n} from \"./basketball-endpoints\";\n\n/**\n * API-Basketball Client class\n *\n * Provides type-safe methods for all API-Basketball endpoints.\n */\nexport class ApiBasketballClient {\n private baseUrl: string;\n private networkClient: NetworkClient;\n private headers: Record<string, string>;\n\n /**\n * Create a new ApiBasketballClient instance\n *\n * @param networkClient - NetworkClient instance for making HTTP requests\n * @param config - API configuration including API key\n */\n constructor(networkClient: NetworkClient, config: ApiBasketballConfig) {\n this.networkClient = networkClient;\n this.baseUrl = config.baseUrl || BASKETBALL_API_BASE_URL;\n\n // Set up authentication headers\n if (config.useRapidApi && config.rapidApiHost) {\n this.headers = {\n ...BASKETBALL_DEFAULT_HEADERS,\n \"x-rapidapi-host\": config.rapidApiHost || BASKETBALL_RAPIDAPI_HOST,\n \"x-rapidapi-key\": config.apiKey,\n };\n } else {\n this.headers = {\n ...BASKETBALL_DEFAULT_HEADERS,\n \"x-apisports-key\": config.apiKey,\n };\n }\n }\n\n /**\n * Make a GET request to the API\n */\n private async request<T>(\n endpoint: string,\n ): Promise<ApiBasketballResponse<T>> {\n const url = `${this.baseUrl}${endpoint}`;\n\n const response = await this.networkClient.get<ApiBasketballResponse<T>>(\n url,\n {\n headers: this.headers,\n },\n );\n\n if (response.data === undefined || response.data === null) {\n throw new Error(\"No data received from API-Basketball\");\n }\n\n // Check for API errors\n const data = response.data as ApiBasketballResponse<T>;\n if (data.errors && Object.keys(data.errors).length > 0) {\n const errorMsg = Array.isArray(data.errors)\n ? data.errors.join(\", \")\n : Object.values(data.errors).join(\", \");\n throw new Error(`API-Basketball error: ${errorMsg}`);\n }\n\n return data;\n }\n\n // ============================================================================\n // General Endpoints\n // ============================================================================\n\n /**\n * Get all available timezones\n */\n async getTimezone(): Promise<ApiBasketballResponse<BasketballTimezone>> {\n return this.request<BasketballTimezone>(BASKETBALL_ENDPOINTS.TIMEZONE);\n }\n\n /**\n * Get all available countries\n */\n async getCountries(\n params?: BasketballCountriesParams,\n ): Promise<ApiBasketballResponse<BasketballCountry>> {\n const query = params ? buildQueryString(params) : \"\";\n return this.request<BasketballCountry>(\n `${BASKETBALL_ENDPOINTS.COUNTRIES}${query}`,\n );\n }\n\n /**\n * Get all available seasons\n */\n async getSeasons(\n params?: BasketballSeasonsParams,\n ): Promise<ApiBasketballResponse<string>> {\n const query = params ? buildQueryString(params) : \"\";\n return this.request<string>(`${BASKETBALL_ENDPOINTS.SEASONS}${query}`);\n }\n\n // ============================================================================\n // Leagues Endpoints\n // ============================================================================\n\n /**\n * Get leagues with optional filtering\n */\n async getLeagues(\n params?: BasketballLeaguesParams,\n ): Promise<ApiBasketballResponse<BasketballLeagueResponse>> {\n const query = params ? buildQueryString(params) : \"\";\n return this.request<BasketballLeagueResponse>(\n `${BASKETBALL_ENDPOINTS.LEAGUES}${query}`,\n );\n }\n\n // ============================================================================\n // Teams Endpoints\n // ============================================================================\n\n /**\n * Get teams\n */\n async getTeams(\n params?: BasketballTeamsParams,\n ): Promise<ApiBasketballResponse<BasketballTeamResponse>> {\n const query = params ? buildQueryString(params) : \"\";\n return this.request<BasketballTeamResponse>(\n `${BASKETBALL_ENDPOINTS.TEAMS}${query}`,\n );\n }\n\n /**\n * Get team statistics\n */\n async getTeamStatistics(\n params: BasketballTeamStatisticsParams,\n ): Promise<ApiBasketballResponse<BasketballTeamStatistics>> {\n const query = buildQueryString(params);\n return this.request<BasketballTeamStatistics>(\n `${BASKETBALL_ENDPOINTS.TEAMS_STATISTICS}${query}`,\n );\n }\n\n // ============================================================================\n // Games Endpoints\n // ============================================================================\n\n /**\n * Get games with optional filtering\n */\n async getGames(\n params?: BasketballGamesParams,\n ): Promise<ApiBasketballResponse<BasketballGame>> {\n const query = params ? buildQueryString(params) : \"\";\n return this.request<BasketballGame>(\n `${BASKETBALL_ENDPOINTS.GAMES}${query}`,\n );\n }\n\n /**\n * Get head to head games between two teams\n */\n async getGamesHeadToHead(\n params: BasketballHeadToHeadParams,\n ): Promise<ApiBasketballResponse<BasketballGame>> {\n const query = buildQueryString(params);\n return this.request<BasketballGame>(\n `${BASKETBALL_ENDPOINTS.GAMES_HEAD_TO_HEAD}${query}`,\n );\n }\n\n // ============================================================================\n // Standings Endpoints\n // ============================================================================\n\n /**\n * Get standings for a league/season\n */\n async getStandings(\n params: BasketballStandingsParams,\n ): Promise<ApiBasketballResponse<BasketballStanding>> {\n const query = buildQueryString(params);\n return this.request<BasketballStanding>(\n `${BASKETBALL_ENDPOINTS.STANDINGS}${query}`,\n );\n }\n}\n\n/**\n * Factory function to create an ApiBasketballClient instance\n */\nexport const createApiBasketballClient = (\n networkClient: NetworkClient,\n config: ApiBasketballConfig,\n): ApiBasketballClient => {\n return new ApiBasketballClient(networkClient, config);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"basketball-endpoints.js","sourceRoot":"","sources":["../../../src/basketball/network/basketball-endpoints.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,uBAAuB,GAAG,qCAAqC,CAAC;AAK7E,MAAM,CAAC,MAAM,wBAAwB,GAAG,+BAA+B,CAAC;AAKxE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAElC,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,UAAU;IAGnB,OAAO,EAAE,UAAU;IAGnB,KAAK,EAAE,QAAQ;IACf,gBAAgB,EAAE,aAAa;IAG/B,KAAK,EAAE,QAAQ;IACf,kBAAkB,EAAE,YAAY;IAGhC,SAAS,EAAE,YAAY;CACf,CAAC;AAKX,MAAM,CAAC,MAAM,0BAA0B,GAA2B;IAChE,cAAc,EAAE,kBAAkB;IAClC,MAAM,EAAE,kBAAkB;CAClB,CAAC"}
1
+ {"version":3,"file":"basketball-endpoints.js","sourceRoot":"","sources":["../../../src/basketball/network/basketball-endpoints.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,uBAAuB,GAAG,qCAAqC,CAAC;AAK7E,MAAM,CAAC,MAAM,wBAAwB,GAAG,+BAA+B,CAAC;AAKxE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAElC,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,UAAU;IAGnB,OAAO,EAAE,UAAU;IAGnB,KAAK,EAAE,QAAQ;IACf,gBAAgB,EAAE,aAAa;IAG/B,KAAK,EAAE,QAAQ;IACf,kBAAkB,EAAE,YAAY;IAGhC,SAAS,EAAE,YAAY;CACf,CAAC;AAKX,MAAM,CAAC,MAAM,0BAA0B,GAA2B;IAChE,cAAc,EAAE,kBAAkB;IAClC,MAAM,EAAE,kBAAkB;CAClB,CAAC","sourcesContent":["/**\n * API-Basketball endpoint constants\n */\n\n/**\n * Base URL for API-Basketball direct access\n */\nexport const BASKETBALL_API_BASE_URL = \"https://v1.basketball.api-sports.io\";\n\n/**\n * RapidAPI host for API-Basketball\n */\nexport const BASKETBALL_RAPIDAPI_HOST = \"api-basketball.p.rapidapi.com\";\n\n/**\n * API-Basketball endpoints\n */\nexport const BASKETBALL_ENDPOINTS = {\n // General\n TIMEZONE: \"/timezone\",\n COUNTRIES: \"/countries\",\n SEASONS: \"/seasons\",\n\n // Leagues\n LEAGUES: \"/leagues\",\n\n // Teams\n TEAMS: \"/teams\",\n TEAMS_STATISTICS: \"/statistics\",\n\n // Games\n GAMES: \"/games\",\n GAMES_HEAD_TO_HEAD: \"/games/h2h\",\n\n // Standings\n STANDINGS: \"/standings\",\n} as const;\n\n/**\n * Default headers for API-Basketball requests\n */\nexport const BASKETBALL_DEFAULT_HEADERS: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/basketball/network/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/basketball/network/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC","sourcesContent":["/**\n * Basketball Network Module Exports\n */\n\nexport {\n ApiBasketballClient,\n createApiBasketballClient,\n} from \"./api-basketball-client\";\nexport {\n BASKETBALL_API_BASE_URL,\n BASKETBALL_DEFAULT_HEADERS,\n BASKETBALL_ENDPOINTS,\n BASKETBALL_RAPIDAPI_HOST,\n} from \"./basketball-endpoints\";\n"]}