@ufcalendar/sdk 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/version.ts","../src/client.ts"],"sourcesContent":["export { FightAPI, FightAPIError, DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, MAX_RETRY_AFTER_SECONDS } from './client';\nexport type { FightAPIOptions, Query, QueryValue } from './client';\nexport { VERSION } from './version';\nexport type * from './types';\n/** The generated OpenAPI path map, for anything the hand-written types above\n * do not cover. Regenerated by `pnpm gen:types` from apps/api/openapi.json. */\nexport type { paths, operations } from './schema';\n","/** Kept in lockstep with package.json and the User-Agent by\n * `apps/api/src/surfaces.test.ts`. Bump all three together. */\nexport const VERSION = '0.10.0';\n","/**\n * Thin, dependency-free client for https://api.ufcalendar.com/v1.\n *\n * Every method returns the parsed `data` value of the JSON envelope\n * (`{\"data\": ..., \"meta\": ...}`); list endpoints are async generators that\n * follow cursor pagination for you. Errors throw `FightAPIError` carrying\n * the API's `code`, `message` and `requestId` — quote the request id when\n * you write to api@ufcalendar.com.\n *\n * Mirrors sdk/python/ufcalendar/client.py one method per endpoint, in\n * camelCase. The two clients are kept in lockstep by\n * `apps/api/src/surfaces.test.ts`.\n *\n * Odds are the UFCalendar consensus line: one anonymised line per corner\n * across the sportsbooks we track (`sources` = how many books backed each\n * point; book identities are never exposed). Information only, not betting\n * advice. Fighter `images` are Wikimedia\n * Commons / Creative Commons files — the `license` and `artist` fields you\n * receive must be displayed as a credit.\n */\nimport { VERSION } from './version';\nimport type {\n Article,\n FightPositions,\n FightStatLine,\n FightTimeline,\n FighterDiscipline,\n FighterPositions,\n OrgCoverage,\n Referee,\n RefereeFightRow,\n ArticleLocale,\n ArticleSummary,\n EventPickem,\n EventOdds,\n FightInclude,\n FightOdds,\n OddsHistoryPoint,\n Compare,\n Matchup,\n WhosNext,\n EventStorylines,\n YearStats,\n EventWatch,\n OrgDivision,\n LeaderboardRow,\n RecordBookSection,\n StatScope,\n RightsSeries,\n SplitDecisionRow,\n ChangeFeedEntry,\n ChangeKind,\n FightSearchMethod,\n FightSearchRow,\n BroadcastRight,\n CareerBout,\n CareerStats,\n Champion,\n EventInclude,\n EventListInclude,\n JudgeScorecardRow,\n PowerIndexMover,\n PowerIndexRow,\n PowerIndexView,\n Envelope,\n EventChange,\n EventDetail,\n EventSummary,\n Fight,\n Fighter,\n FighterInclude,\n FighterSummary,\n Judge,\n Meta,\n Org,\n Plans,\n PowerIndex,\n RankingsBoard,\n RateLimit,\n Scorecards,\n Usage,\n Venue,\n WebhookEndpoint,\n} from './types';\n\nexport const DEFAULT_BASE_URL = 'https://api.ufcalendar.com/v1';\nconst DEFAULT_TIMEOUT_MS = 30_000;\n/** Default number of times a GET that hit the per-minute limit is retried. */\nexport const DEFAULT_MAX_RETRIES = 3;\n/**\n * A 429 whose `Retry-After` is longer than this is not waited out: the\n * per-minute limit always resets within a minute, anything longer is the\n * monthly quota (or something we do not understand) and must surface.\n */\nexport const MAX_RETRY_AFTER_SECONDS = 60;\nconst RETRY_JITTER_MS = 500;\n\nexport interface FightAPIOptions {\n /** `ufcalendar_…` key from https://www.ufcalendar.com/account/api. Falls back\n * to `UFCALENDAR_API_KEY` / `UFCAL_API_KEY` in the environment. Only\n * `plans()` works without one. */\n apiKey?: string;\n /** Override for testing; defaults to the production `/v1`. */\n baseUrl?: string;\n /** Inject a fetch (a test double, an instrumented fetch, undici). */\n fetch?: typeof fetch;\n /** Per-request timeout. Default 30s. */\n timeoutMs?: number;\n /** Extra headers on every request. */\n headers?: Record<string, string>;\n /**\n * How many times a GET that hit the per-minute limit (429 `rate_limited`\n * with `Retry-After` ≤ 60 s) is retried after waiting `Retry-After` plus a\n * little jitter. Default 3; `0` disables. The monthly quota\n * (`quota_exceeded`) and non-GET requests always throw at once.\n */\n maxRetries?: number;\n /** Replace the wait between rate-limit retries (tests, custom schedulers). */\n sleep?: (ms: number) => Promise<void>;\n}\n\n/** An error response from the Fight API. */\nexport class FightAPIError extends Error {\n readonly status: number;\n readonly code: string;\n readonly requestId: string | null;\n\n constructor(status: number, code: string, message: string, requestId: string | null = null) {\n super(`${status} ${code}: ${message}${requestId ? ` (request_id=${requestId})` : ''}`);\n this.name = 'FightAPIError';\n this.status = status;\n this.code = code;\n this.requestId = requestId;\n }\n}\n\nexport type QueryValue = string | number | boolean | null | undefined;\nexport type Query = Record<string, QueryValue>;\n\ninterface PageOptions {\n /** Stop after this many rows (across pages). */\n limit?: number;\n}\n\n/**\n * A browser forbids setting User-Agent on fetch, so we only set ours\n * off-browser. The test is `document`, NOT `navigator`: Node 21+ ships a\n * global `navigator`, so a navigator check would silently drop the header\n * on every modern Node runtime — which is the one place it works.\n */\nfunction canSetUserAgent(): boolean {\n return typeof document === 'undefined' && typeof window === 'undefined';\n}\n\n/** `Retry-After` as seconds: delta-seconds or an HTTP date; null if absent/unparseable. */\nfunction retryAfterSeconds(value: string | null): number | null {\n if (value === null) return null;\n const v = value.trim();\n if (v === '') return null;\n let secs = Number(v);\n if (!Number.isFinite(secs)) {\n const when = Date.parse(v);\n if (!Number.isFinite(when)) return null;\n secs = (when - Date.now()) / 1000;\n }\n return Math.max(0, secs);\n}\n\n/**\n * Seconds to wait before retrying a 429, or null when it must not be retried.\n * Only the per-minute limit (`rate_limited`) is waited out. The monthly quota\n * (`quota_exceeded`) throws at once — near the end of a month its\n * `Retry-After` can be short, so the code is checked, not just the header.\n */\nfunction shortRateLimitWait(res: Response, code: string | undefined): number | null {\n if (code === 'quota_exceeded') return null;\n const secs = retryAfterSeconds(res.headers.get('Retry-After'));\n if (secs === null || secs > MAX_RETRY_AFTER_SECONDS) return null;\n return secs;\n}\n\nconst defaultSleep = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms));\n\nfunction envKey(): string | undefined {\n const env = (globalThis as { process?: { env?: Record<string, string | undefined> } }).process?.env;\n return env?.UFCALENDAR_API_KEY || env?.UFCAL_API_KEY;\n}\n\nexport class FightAPI {\n readonly baseUrl: string;\n readonly apiKey: string | undefined;\n /** Retries of a GET that hit the per-minute limit (see `FightAPIOptions.maxRetries`). */\n readonly maxRetries: number;\n\n /** `meta` of the most recent response (pagination cursor, generated_at …). */\n lastMeta: Meta | null = null;\n /** `X-RateLimit-*` of the most recent response. */\n lastRateLimit: RateLimit = { limit: null, remaining: null, reset: null };\n\n readonly #fetch: typeof fetch;\n readonly #timeoutMs: number;\n readonly #headers: Record<string, string>;\n readonly #sleep: (ms: number) => Promise<void>;\n\n constructor(apiKeyOrOptions?: string | FightAPIOptions, options: FightAPIOptions = {}) {\n const opts: FightAPIOptions =\n typeof apiKeyOrOptions === 'string'\n ? { ...options, apiKey: apiKeyOrOptions }\n : { ...options, ...(apiKeyOrOptions ?? {}) };\n this.apiKey = opts.apiKey ?? envKey();\n this.baseUrl = (opts.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, '');\n this.#fetch = opts.fetch ?? globalThis.fetch;\n this.#timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n this.#headers = opts.headers ?? {};\n this.#sleep = opts.sleep ?? defaultSleep;\n const maxRetries = opts.maxRetries ?? DEFAULT_MAX_RETRIES;\n if (!Number.isInteger(maxRetries) || maxRetries < 0) {\n throw new RangeError('maxRetries must be a non-negative integer');\n }\n this.maxRetries = maxRetries;\n if (!this.#fetch) {\n throw new Error('No global fetch available. Use Node 18+ or pass { fetch }.');\n }\n }\n\n /* ---------------------------------------------------------------- core */\n\n #url(path: string, params?: Query): string {\n const url = new URL(`${this.baseUrl}/${path.replace(/^\\/+/, '')}`);\n for (const [k, v] of Object.entries(params ?? {})) {\n if (v === undefined || v === null) continue;\n url.searchParams.set(k, String(v));\n }\n return url.toString();\n }\n\n async #request<T>(\n method: string,\n path: string,\n { params, body, open = false }: { params?: Query; body?: unknown; open?: boolean } = {},\n ): Promise<Envelope<T>> {\n if (!this.apiKey && !open) {\n throw new FightAPIError(\n 401,\n 'no_api_key',\n 'No API key. Pass new FightAPI(\"ufcalendar_...\") or set UFCALENDAR_API_KEY. ' +\n 'Keys (free plan: 100 requests/month, no card) live at https://www.ufcalendar.com/account/api',\n );\n }\n const headers: Record<string, string> = { Accept: 'application/json', ...this.#headers };\n if (this.apiKey) headers.Authorization = `Bearer ${this.apiKey}`;\n if (canSetUserAgent()) headers['User-Agent'] = `ufcalendar-typescript/${VERSION}`;\n if (body !== undefined) headers['Content-Type'] = 'application/json';\n\n const url = this.#url(path, params);\n let res: Response;\n let text: string;\n let parsed: unknown;\n for (let attempt = 0; ; attempt += 1) {\n try {\n res = await this.#fetch(url, {\n method,\n headers,\n body: body === undefined ? undefined : JSON.stringify(body),\n signal: AbortSignal.timeout(this.#timeoutMs),\n });\n } catch (e) {\n const err = e as { name?: string; message?: string };\n if (err?.name === 'TimeoutError') {\n throw new FightAPIError(0, 'timeout', `Request to ${path} timed out after ${this.#timeoutMs}ms`);\n }\n throw new FightAPIError(0, 'network_error', err?.message ?? String(e));\n }\n\n this.lastRateLimit = {\n limit: res.headers.get('X-RateLimit-Limit'),\n remaining: res.headers.get('X-RateLimit-Remaining'),\n reset: res.headers.get('X-RateLimit-Reset'),\n };\n\n if (res.status === 204) {\n this.lastMeta = null;\n return { data: undefined as T };\n }\n\n text = await res.text();\n parsed = undefined;\n try {\n parsed = text ? JSON.parse(text) : undefined;\n } catch {\n parsed = undefined;\n }\n\n // Wait out the per-minute limit on reads (a 429'd request is not\n // counted against the month). Writes are never replayed.\n if (res.status === 429 && method.toUpperCase() === 'GET' && attempt < this.maxRetries) {\n const code = (parsed as { error?: { code?: string } } | undefined)?.error?.code;\n const wait = shortRateLimitWait(res, code);\n if (wait !== null) {\n await this.#sleep(wait * 1000 + Math.random() * RETRY_JITTER_MS);\n continue;\n }\n }\n break;\n }\n\n if (!res.ok) {\n const err = (parsed as { error?: { code?: string; message?: string; request_id?: string } } | undefined)?.error;\n if (err) {\n throw new FightAPIError(\n res.status,\n String(err.code ?? 'error'),\n String(err.message ?? text.slice(0, 200)),\n err.request_id ?? res.headers.get('x-request-id'),\n );\n }\n throw new FightAPIError(res.status, 'http_error', text.slice(0, 200), res.headers.get('x-request-id'));\n }\n\n const env = (parsed ?? {}) as Envelope<T>;\n this.lastMeta = env.meta ?? null;\n return env;\n }\n\n /** Raw GET returning the `data` value. Escape hatch for new endpoints. */\n async get<T = unknown>(path: string, params?: Query): Promise<T> {\n return (await this.#request<T>('GET', path, { params })).data;\n }\n\n /** Raw GET returning the whole `{data, meta}` envelope. */\n async getWithMeta<T = unknown>(path: string, params?: Query): Promise<Envelope<T>> {\n return this.#request<T>('GET', path, { params });\n }\n\n async *#paginate<T>(path: string, params: Query, opts: PageOptions = {}): AsyncGenerator<T, void, void> {\n // Never fetch a bigger page than the caller wants rows: `limit: 3` used\n // to pull 100 rows and throw 97 away, burning the caller's quota on a\n // request they did not ask for (and, on a trial key, a noticeable slice\n // of the 100 they get).\n const pageSize = Math.min(100, opts.limit ?? 100);\n const query: Query = { limit: pageSize, ...params };\n let seen = 0;\n for (;;) {\n const env = await this.#request<T[]>('GET', path, { params: query });\n for (const row of env.data ?? []) {\n yield row;\n seen += 1;\n if (opts.limit !== undefined && seen >= opts.limit) return;\n }\n const cursor = env.meta?.pagination?.next_cursor;\n if (!cursor) return;\n query.cursor = cursor;\n }\n }\n\n /* --------------------------------------------------------------- plans */\n\n /**\n * Plans (Free first), quotas, the free-plan rule, the MCP endpoint and the doc\n * links. The only endpoint that answers without a credential.\n */\n async plans(): Promise<Plans> {\n return (await this.#request<Plans>('GET', 'plans', { open: true })).data;\n }\n\n /* ---------------------------------------------------------------- orgs */\n\n /** Launch orgs with capability flags (stats / rounds / rankings / broadcasts / predictions / scorecards / odds). */\n orgs(): Promise<Org[]> {\n return this.get<Org[]>('orgs');\n }\n\n org(slug: string): Promise<Org> {\n return this.get<Org>(`orgs/${encodeURIComponent(slug)}`);\n }\n\n /**\n * One weight class in one promotion: its rankings board (null where the\n * promotion publishes none), upcoming bouts at that weight, the latest\n * results and the roster by recency. `division` is a slug, e.g.\n * `lightweight` or `womens-strawweight`.\n */\n orgDivision(org: string, division: string): Promise<OrgDivision> {\n return this.get<OrgDivision>(`orgs/${encodeURIComponent(org)}/divisions/${encodeURIComponent(division)}`);\n }\n\n /* -------------------------------------------------------------- events */\n\n /**\n * Schedule + results. Bare call = the upcoming calendar, soonest first.\n * `status: 'completed'` (or `order: 'desc'`) browses the archive\n * newest-first; `status: 'upcoming'` = every card not yet over (announced,\n * scheduled or live). `from` / `to` are `YYYY-MM-DD`.\n */\n events(\n opts: {\n org?: string;\n status?: string;\n from?: string;\n to?: string;\n order?: 'asc' | 'desc';\n /** Only cards with (true) / without (false) a title bout. */\n isTitleCard?: boolean;\n /** Only PPV (true) / non-PPV (false) cards. */\n isPpv?: boolean;\n /** `headline` adds each card's main event. */\n include?: EventListInclude[];\n limit?: number;\n } = {},\n ): AsyncGenerator<EventSummary, void, void> {\n const { limit, isTitleCard, isPpv, include, ...params } = opts;\n return this.#paginate<EventSummary>('events', {\n ...params,\n is_title_card: isTitleCard,\n is_ppv: isPpv,\n include: include?.length ? include.join(',') : undefined,\n } as Query, { limit });\n }\n\n /**\n * One event with its full fight card, venue and broadcasts.\n * `include: ['eta']` adds an estimated start time to every bout;\n * `include: ['odds']` adds each bout's current consensus line (the closing line once settled) (null when\n * unpriced). Pass both as `['eta', 'odds']`.\n */\n event(idOrSlug: string | number, opts: { include?: EventInclude[] } = {}): Promise<EventDetail> {\n return this.get<EventDetail>(\n `events/${encodeURIComponent(String(idOrSlug))}`,\n opts.include?.length ? { include: opts.include.join(',') } : undefined,\n );\n }\n\n /**\n * Who airs one event, per country: the promotion's rights deals for the\n * event's series merged with the event's own listings. `country` (ISO-2)\n * narrows to that market plus worldwide.\n */\n eventWatch(idOrSlug: string | number, opts: { country?: string } = {}): Promise<EventWatch> {\n return this.get<EventWatch>(`events/${encodeURIComponent(String(idOrSlug))}/watch`, opts as Query);\n }\n\n /**\n * The talking points of one card as of its start: title fights and\n * eliminators, the closest bout (UFCalendar model, else Power Index — not\n * betting advice), rematches and trilogy deciders, streaks, debuts and\n * returns, ranked fighters, nations, tallest / longest reach, the fastest\n * career finish.\n */\n eventStorylines(idOrSlug: string | number): Promise<EventStorylines> {\n return this.get<EventStorylines>(`events/${encodeURIComponent(String(idOrSlug))}/storylines`);\n }\n\n /**\n * How the UFCalendar community is picking each bout on one card: picks per\n * corner, the total and `pct_a`, in card order. Crowd sentiment from our\n * own pick'em game, not a market and not a forecast.\n */\n eventPickem(idOrSlug: string | number): Promise<EventPickem> {\n return this.get<EventPickem>(`events/${encodeURIComponent(String(idOrSlug))}/pickem`);\n }\n\n /**\n * The UFCalendar consensus odds for every non-cancelled bout on one card, in\n * card order: `consensus`, `opening`, `closing` (settled bouts), `movement`\n * and `points`. Unpriced bouts stay on the list with nulls and `points: 0`;\n * `lastMeta.priced` / `lastMeta.unpriced` count both. Information only, not\n * betting advice.\n */\n eventOdds(idOrSlug: string | number): Promise<EventOdds> {\n return this.get<EventOdds>(`events/${encodeURIComponent(String(idOrSlug))}/odds`);\n }\n\n /** Card-change diff log (fight added/removed, opponent swapped, date moved, profile merged). */\n eventChanges(idOrSlug: string | number): Promise<EventChange[]> {\n return this.get<EventChange[]>(`events/${encodeURIComponent(String(idOrSlug))}/changes`);\n }\n\n /**\n * The card-change feed across every event, newest first (default: the last\n * 90 days) — the `card.changed` webhook's audit trail, for callers that\n * poll. `since` is `YYYY-MM-DD` or an ISO-8601 datetime.\n */\n changes(\n opts: { org?: string; since?: string; kind?: ChangeKind; limit?: number } = {},\n ): AsyncGenerator<ChangeFeedEntry, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<ChangeFeedEntry>('changes', params as Query, { limit });\n }\n\n /* -------------------------------------------------------------- fights */\n\n /** One bout with its result. `include: ['odds']` adds the current consensus line (the closing line once the bout is settled). */\n fight(fightId: number | string, opts: { include?: FightInclude[] } = {}): Promise<Fight> {\n return this.get<Fight>(\n `fights/${encodeURIComponent(String(fightId))}`,\n opts.include?.length ? { include: opts.include.join(',') } : undefined,\n );\n }\n\n /**\n * The UFCalendar consensus line for one bout: `consensus` (latest point; the closing line once settled),\n * `opening`, `closing` (the last point at or before the event start,\n * settled bouts only), `movement` (opening → consensus in implied-probability\n * points on corner a) and `sources` on every point (how many sportsbooks\n * backed it; book identities are never exposed). An unpriced bout resolves\n * with null blocks and `points: 0`. Information only, not betting advice.\n */\n fightOdds(fightId: number | string): Promise<FightOdds> {\n return this.get<FightOdds>(`fights/${encodeURIComponent(String(fightId))}/odds`);\n }\n\n /**\n * Every consensus point for one bout, oldest first (Pro plans and up; a\n * lower plan throws `FightAPIError` 403 `tier_required`). A point is stored\n * only when the consensus moves. `from` / `to` are inclusive `YYYY-MM-DD`.\n */\n fightOddsHistory(\n fightId: number | string,\n opts: { from?: string; to?: string; limit?: number } = {},\n ): AsyncGenerator<OddsHistoryPoint, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<OddsHistoryPoint>(\n `fights/${encodeURIComponent(String(fightId))}/odds/history`,\n params as Query,\n { limit },\n );\n }\n\n /**\n * Per-fight totals for both corners, each with `fantasy` — UFCalendar\n * fantasy points with a per-category breakdown and `complete`. The\n * data-quality flags ride in `lastMeta.quality` (`StatsQuality`).\n */\n fightStats(fightId: number | string): Promise<FightStatLine[]> {\n return this.get<FightStatLine[]>(`fights/${encodeURIComponent(String(fightId))}/stats`);\n }\n\n /** Round-by-round stat lines for both corners. */\n fightRounds(fightId: number | string): Promise<Record<string, unknown>[]> {\n return this.get<Record<string, unknown>[]>(`fights/${encodeURIComponent(String(fightId))}/rounds`);\n }\n\n /**\n * The judges' scorecards for a bout — the official commission record:\n * decision type, point deductions, and one card per judge with every\n * round, the totals and `winner_fighter_id`. Scores are oriented to\n * `fighter_a_id` / `fighter_b_id`, both repeated on the payload.\n *\n * Check `scores_known` on a card before charting totals: when it is false\n * the commission published only the outcome. Throws 404 for a bout that\n * did not go to the judges.\n */\n fightScorecards(fightId: number | string): Promise<Scorecards> {\n return this.get<Scorecards>(`fights/${encodeURIComponent(String(fightId))}/scorecards`);\n }\n\n /**\n * The official in-fight log of one settled UFC bout (Pro plans and up; a\n * lower plan throws `FightAPIError` 403 `tier_required`): every logged\n * action in order, the referee stoppages paired with their reason and\n * real length, and every confirmed foul of the bout.\n *\n * The log labels only two fouls, the eye poke and the low blow. Any other\n * foul (an illegal knee to a grounded opponent, an upkick, a headbutt, a\n * bite, a fence grab) reaches it as a `generic` stoppage naming nobody, so\n * a foul is reported only when a record confirms it (`foul_basis` /\n * `basis`): `log` (the labelled row), `deduction` (the athletic commission\n * took a point) or `result` (the bout ended on it: a disqualification or a\n * \"could not continue\"). On a stoppage, `is_foul` says whether a foul is\n * confirmed, `foul` what it was, `committed_by` who committed it (null\n * when no record names a fighter), `points_deducted` and `ended_bout`; a\n * `generic` stoppage with no record behind it has `is_foul: false`.\n * `incidents` lists every confirmed foul in fight order, including one\n * with no stoppage in the log; `fouls.a` / `fouls.b` count what each\n * corner committed (`eye_pokes`, `low_blows`, `other`, `total`,\n * `points_deducted`). A recorded foul is not a ruling on intent.\n *\n * Coverage: UFC bouts from June 2013, stoppage reasons\n * from 8 December 2018 (`lastMeta.has_stoppage_reasons`). A bout with no\n * log, or one not settled yet, resolves with empty lists and\n * `lastMeta.note`.\n */\n fightTimeline(fightId: number | string): Promise<FightTimeline> {\n return this.get<FightTimeline>(`fights/${encodeURIComponent(String(fightId))}/timeline`);\n }\n\n /**\n * Position stats of one settled UFC bout (Pro plans and up): where it was\n * fought (`time`, shared by both fighters), each fighter's `control` by\n * position, and strikes by position and target — `totals` for the whole\n * bout, `rounds` per round. `null` means not tracked for that bout; `0`\n * is a real zero. Tracked reliably from 2007.\n */\n fightPositions(fightId: number | string): Promise<FightPositions> {\n return this.get<FightPositions>(`fights/${encodeURIComponent(String(fightId))}/positions`);\n }\n\n /**\n * Completed bouts, filtered — newest first unless `order: 'oldest'`. At\n * least one narrowing filter is required (`titleOnly`, `method`,\n * `division`, `fighter`, `winner`, `from`, `to`, `mainEventsOnly`); the\n * server serves 25 rows a page and at most 10 pages.\n */\n findFights(\n opts: {\n org?: string;\n titleOnly?: boolean;\n method?: FightSearchMethod;\n /** Division slug (`lightweight`) or a name fragment. */\n division?: string;\n /** Fighter slug or id — bouts they were in. */\n fighter?: string | number;\n /** Fighter slug or id — bouts they won. */\n winner?: string | number;\n from?: string;\n to?: string;\n mainEventsOnly?: boolean;\n order?: 'newest' | 'oldest';\n limit?: number;\n } = {},\n ): AsyncGenerator<FightSearchRow, void, void> {\n const { limit, titleOnly, mainEventsOnly, fighter, winner, ...rest } = opts;\n return this.#paginate<FightSearchRow>('fights/search', {\n ...rest,\n title_only: titleOnly,\n main_events_only: mainEventsOnly,\n fighter: fighter === undefined ? undefined : String(fighter),\n winner: winner === undefined ? undefined : String(winner),\n } as Query, { limit });\n }\n\n /* -------------------------------------------------------------- judges */\n\n /**\n * Every official who has scored a launch-org bout, busiest first. Rates\n * mean little below ~10 fights; pass `minFights: 10`.\n */\n judges(\n opts: { q?: string; org?: string; minFights?: number; limit?: number } = {},\n ): AsyncGenerator<Judge, void, void> {\n const { limit, minFights, ...rest } = opts;\n return this.#paginate<Judge>('judges', { ...rest, min_fights: minFights } as Query, { limit });\n }\n\n judge(judgeId: number | string): Promise<Judge> {\n return this.get<Judge>(`judges/${encodeURIComponent(String(judgeId))}`);\n }\n\n /**\n * Split and majority decisions, newest first, with every judge's card and\n * the dissenting judges named. Commission records only.\n */\n splitDecisions(\n opts: { org?: string; from?: string; to?: string; limit?: number } = {},\n ): AsyncGenerator<SplitDecisionRow, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<SplitDecisionRow>('scorecards/splits', params as Query, { limit });\n }\n\n /**\n * Every card this judge has turned in, newest first, with `lone_dissent`,\n * `split` and the `colleagues`' totals on each row.\n */\n judgeScorecards(\n judgeId: number | string,\n opts: { limit?: number } = {},\n ): AsyncGenerator<JudgeScorecardRow, void, void> {\n return this.#paginate<JudgeScorecardRow>(\n `judges/${encodeURIComponent(String(judgeId))}/scorecards`,\n {},\n opts,\n );\n }\n\n /* ------------------------------------------------------------ referees */\n\n /**\n * Every referee who has worked a settled launch-org bout, busiest first:\n * bouts, promotions, finish rate, method mix and average fight time. The\n * id is a slug of the name; `q` is accent- and spacing-insensitive.\n */\n referees(opts: { q?: string; org?: string; limit?: number } = {}): AsyncGenerator<Referee, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<Referee>('referees', params as Query, { limit });\n }\n\n /** One referee's career aggregates, e.g. `referee('herb-dean')`. */\n referee(slug: string): Promise<Referee> {\n return this.get<Referee>(`referees/${encodeURIComponent(slug)}`);\n }\n\n /** Every settled bout one referee worked, newest first (the bout plus its `event`). */\n refereeFights(slug: string, opts: { limit?: number } = {}): AsyncGenerator<RefereeFightRow, void, void> {\n return this.#paginate<RefereeFightRow>(`referees/${encodeURIComponent(slug)}/fights`, {}, opts);\n }\n\n /* ------------------------------------------------------------ coverage */\n\n /**\n * What the database holds per launch org per year: events, settled bouts\n * and how many carry stats, round stats, commission scorecards and a\n * consensus odds line, with `totals` and `last_result_at`.\n */\n coverage(opts: { org?: string } = {}): Promise<OrgCoverage[]> {\n return this.get<OrgCoverage[]>('coverage', opts.org ? { org: opts.org } : undefined);\n }\n\n /* ------------------------------------------------------------ fighters */\n\n fighters(\n opts: { q?: string; org?: string; country?: string; limit?: number } = {},\n ): AsyncGenerator<FighterSummary, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<FighterSummary>('fighters', params as Query, { limit });\n }\n\n /**\n * Bio, records, career stats, Power Index, CC-licensed images, `next_fight`\n * and `last_fight`. `include: ['bonuses']` adds the UFC bonus ledger;\n * `include: ['credentials']` adds grappling and wrestling pedigree, gyms and\n * coaches (every row with `sources` and a `confidence` grade).\n */\n fighter(idOrSlug: string | number, opts: { include?: FighterInclude[] } = {}): Promise<Fighter> {\n return this.get<Fighter>(\n `fighters/${encodeURIComponent(String(idOrSlug))}`,\n opts.include?.length ? { include: opts.include.join(',') } : undefined,\n );\n }\n\n /** Complete multi-promotion career timeline. */\n fighterHistory(idOrSlug: string | number): Promise<CareerBout[]> {\n return this.get<CareerBout[]>(`fighters/${encodeURIComponent(String(idOrSlug))}/history`);\n }\n\n /** Raw career stat rows, one source-stamped row per scope (`pro-mma`, `ufc-only` …).\n * For the readable split use `fighter().records` / `fighter().stats`. */\n fighterStats(idOrSlug: string | number): Promise<CareerStats[]> {\n return this.get<CareerStats[]>(`fighters/${encodeURIComponent(String(idOrSlug))}/stats`);\n }\n\n /** Every ranking row the fighter ever held, newest first, across every board\n * (`board` is `official` / `meta`; `is_champion` when rank 0). The endpoint is\n * cursor-paginated since 2026-09-24 — this walks every page so the array is\n * complete (a long career is 900+ rows). */\n async fighterRankings(idOrSlug: string | number): Promise<Record<string, unknown>[]> {\n const out: Record<string, unknown>[] = [];\n for await (const row of this.#paginate<Record<string, unknown>>(\n `fighters/${encodeURIComponent(String(idOrSlug))}/rankings`, { limit: 500 } as Query)) out.push(row);\n return out;\n }\n\n fighterPowerIndex(idOrSlug: string | number): Promise<PowerIndex & Record<string, unknown>> {\n return this.get<PowerIndex & Record<string, unknown>>(\n `fighters/${encodeURIComponent(String(idOrSlug))}/power-index`,\n );\n }\n\n /**\n * The confirmed fouls in a fighter's UFC bouts since 8 December 2018 (Pro\n * plans and up), committed and drawn: eye pokes and low blows from the\n * official in-fight log, plus any other foul (an illegal knee to a\n * grounded opponent, an upkick, a headbutt, a bite, a fence grab)\n * confirmed by the athletic commission's point deduction or by the\n * official result. `committed` / `drawn` count `total`, `eye_pokes`,\n * `low_blows` and `other`; `points_deducted` is what the commission has\n * taken from this fighter; `incidents` lists every confirmed foul, most\n * recent first, with `reason` (the foul), `basis` (`log`, `deduction` or\n * `result`), `points_deducted` and `ended_bout`. A `generic` stoppage with\n * no record behind it is never counted. A recorded foul is not a ruling on\n * intent. Resolves `null` (with `lastMeta.note`) under 3 tracked bouts\n * with no recorded foul.\n */\n fighterDiscipline(idOrSlug: string | number): Promise<FighterDiscipline | null> {\n return this.get<FighterDiscipline | null>(`fighters/${encodeURIComponent(String(idOrSlug))}/discipline`);\n }\n\n /**\n * A fighter's career position profile (Pro plans and up): the share of\n * cage time at distance, in the clinch and on the ground, and control\n * seconds for and against by position. Resolves `null` (with\n * `lastMeta.note`) under 3 bouts with tracked positions.\n */\n fighterPositions(idOrSlug: string | number): Promise<FighterPositions | null> {\n return this.get<FighterPositions | null>(`fighters/${encodeURIComponent(String(idOrSlug))}/positions`);\n }\n\n /**\n * Two fighters side by side (slugs or ids): bios with age, career stats,\n * strike mix, win streaks, previous meetings, common opponents, the booked\n * bout between them, the UFCalendar model prediction for it (UFC; not\n * betting advice) and Power Index ratings.\n */\n compare(a: string | number, b: string | number): Promise<Compare> {\n return this.get<Compare>('compare', { a: String(a), b: String(b) });\n }\n\n /* ------------------------------------------------------------ rankings */\n\n /**\n * Official board, point-in-time. `date: 'YYYY-MM-DD'` returns the board\n * that was valid on that day (UFC history back to 2013; rank 0 = champion).\n */\n rankings(org = 'ufc', opts: { date?: string; board?: string } = {}): Promise<RankingsBoard> {\n return this.get<RankingsBoard>(`rankings/${encodeURIComponent(org)}`, opts as Query);\n }\n\n divisionRankings(org: string, division: string, opts: { date?: string } = {}): Promise<RankingsBoard> {\n return this.get<RankingsBoard>(\n `rankings/${encodeURIComponent(org)}/${encodeURIComponent(division)}`,\n opts as Query,\n );\n }\n\n /** Current champions across every launch org, or one `org` / `division`. */\n champions(opts: { org?: string; division?: string } = {}): Promise<Champion[]> {\n return this.get<Champion[]>('champions', opts);\n }\n\n /**\n * UFCalendar Power Index board. `view: 'movers'` = biggest risers over\n * `days` (default 365), `view: 'peaks'` = all-time peak ratings;\n * `division` narrows any view.\n */\n powerIndex(\n org = 'ufc',\n opts: { view?: PowerIndexView; division?: string; days?: number; limit?: number } = {},\n ): Promise<(PowerIndexRow | PowerIndexMover)[]> {\n return this.get<(PowerIndexRow | PowerIndexMover)[]>(`power-index/${encodeURIComponent(org)}`, {\n view: opts.view,\n division: opts.division,\n days: opts.days,\n limit: opts.limit,\n });\n }\n\n /* ---------------------------------------------------------- matchmaker */\n\n /**\n * UFCalendar's matchmaker: the fights worth making in one MMA promotion,\n * scored 0–100, across the roster or for one `division` (`lastMeta.divisions`\n * lists the valid ones). Not a list of bookings; computed without the\n * site's Fight DNA factor.\n */\n matchmaker(org = 'ufc', opts: { division?: string; limit?: number } = {}): Promise<Matchup[]> {\n return this.get<Matchup[]>(`matchmaker/${encodeURIComponent(org)}`, {\n division: opts.division,\n limit: opts.limit,\n });\n }\n\n /**\n * Who one fighter (slug or id) should fight next: the best-scored\n * opponents with the Power Index win probability for each, plus the bout\n * already booked (`booked_next`).\n */\n whosNext(fighter: string | number, opts: { limit?: number } = {}): Promise<WhosNext> {\n return this.get<WhosNext>(`matchmaker/next/${encodeURIComponent(String(fighter))}`, { limit: opts.limit });\n }\n\n /* --------------------------------------------------------------- stats */\n\n /**\n * One Record Book leaderboard for one promotion (`metric` e.g. `wins`,\n * `fastest_knockout`, `finish_rate`). Narrow with `division` (slug),\n * `country` (ISO-2) or `population: 'active'` — not `country` and\n * `active` together. `lastMeta.metric` names the unit and what\n * `value_secondary` means.\n */\n leaderboard(\n org: string,\n metric: string,\n opts: { division?: string; country?: string; population?: 'all' | 'active'; limit?: number } = {},\n ): Promise<LeaderboardRow[]> {\n return this.get<LeaderboardRow[]>('stats/leaders', { org, metric, ...opts } as Query);\n }\n\n /**\n * Every leaderboard's top rows (`top`, default 10, max 25) for one\n * promotion, grouped by category.\n */\n recordBook(\n org: string,\n opts: { division?: string; country?: string; population?: 'all' | 'active'; scope?: StatScope; top?: number } = {},\n ): Promise<RecordBookSection[]> {\n return this.get<RecordBookSection[]>('stats/record-book', { org, ...opts } as Query);\n }\n\n /**\n * One calendar year in numbers for one promotion, or every covered\n * promotion when `org` is omitted: events, title fights, finish methods,\n * divisions, fastest finishes, upsets, Power Index climbers, busiest\n * fighters, host countries and the most-used judges.\n */\n yearStats(year: number, opts: { org?: string } = {}): Promise<YearStats> {\n return this.get<YearStats>(`stats/years/${encodeURIComponent(String(year))}`, opts as Query);\n }\n\n /* ---------------------------------------------------------------- misc */\n\n /** Model win probabilities for upcoming UFC bouts; `event` narrows to one card. */\n predictionsUpcoming(opts: { event?: string | number } = {}): Promise<Record<string, unknown>[]> {\n return this.get<Record<string, unknown>[]>(\n 'predictions/upcoming',\n opts.event !== undefined ? { event: String(opts.event) } : undefined,\n );\n }\n\n /**\n * Who airs the promotion, per ISO-2 country — the org-wide deals, or a UFC\n * sub-series grid with `series: 'dwcs' | 'rtufc'`.\n */\n broadcastRights(org = 'ufc', opts: { country?: string; series?: RightsSeries } = {}): Promise<BroadcastRight[]> {\n return this.get<BroadcastRight[]>(`broadcast-rights/${encodeURIComponent(org)}`, opts as Query);\n }\n\n /**\n * Venues that hosted a covered promotion, alphabetical. `q` (2+ chars)\n * matches name or city; `country` is an ISO-2 code or an English name.\n */\n venues(opts: { q?: string; country?: string; limit?: number } = {}): AsyncGenerator<Venue, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<Venue>('venues', params as Query, { limit });\n }\n\n venue(venueId: number | string): Promise<Venue> {\n return this.get<Venue>(`venues/${encodeURIComponent(String(venueId))}`);\n }\n\n /** Every covered event at one venue, newest first (`order: 'asc'` reverses). */\n venueEvents(\n venueId: number | string,\n opts: { status?: string; from?: string; to?: string; order?: 'asc' | 'desc'; limit?: number } = {},\n ): AsyncGenerator<EventSummary, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<EventSummary>(`venues/${encodeURIComponent(String(venueId))}/events`, params as Query, { limit });\n }\n\n /** Typeahead across fighters and events. */\n search(q: string): Promise<Record<string, unknown>> {\n return this.get<Record<string, unknown>>('search', { q });\n }\n\n /**\n * UFCalendar's own editorial archive, newest first. `q` (2+ chars) matches\n * title, summary or a tag; `tag` is exact; `locale` is one of the 13 site\n * languages (English fallback).\n */\n articles(\n opts: { q?: string; tag?: string; locale?: ArticleLocale; limit?: number } = {},\n ): AsyncGenerator<ArticleSummary, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<ArticleSummary>('articles', params as Query, { limit });\n }\n\n /**\n * One article: full Markdown `body_md` (client widgets removed), author,\n * tags, `published_at`; `served_locale` names the language\n * delivered.\n */\n article(slug: string, opts: { locale?: ArticleLocale } = {}): Promise<Article> {\n return this.get<Article>(`articles/${encodeURIComponent(slug)}`, opts as Query);\n }\n\n /** Your key's month-to-date quota usage. */\n usage(): Promise<Usage> {\n return this.get<Usage>('usage');\n }\n\n /**\n * Subscribable ICS feed URL for calendar apps (authenticates via `?key=`).\n *\n * Throws without a key rather than returning `?key=`: that empty URL is\n * pasted into a calendar app, fails there hours later, and the failure\n * surfaces nowhere near this call.\n */\n calendarIcsUrl(org = 'ufc'): string {\n if (!this.apiKey) {\n throw new FightAPIError(\n 401,\n 'no_api_key',\n 'No API key. Pass new FightAPI(\"ufcalendar_...\") or set UFCALENDAR_API_KEY. ' +\n 'Keys (free plan: 100 requests/month, no card) live at https://www.ufcalendar.com/account/api',\n );\n }\n return `${this.baseUrl}/calendar/${encodeURIComponent(org)}.ics?key=${encodeURIComponent(this.apiKey)}`;\n }\n\n /* ------------------------------------------------------------ webhooks */\n\n webhookEndpoints(): Promise<WebhookEndpoint[]> {\n return this.get<WebhookEndpoint[]>('webhook-endpoints');\n }\n\n /**\n * Register a signed webhook (Pro and up). `events` ⊆ `event.announced`,\n * `fight.result`, `card.changed`, `event.completed`, `odds.moved` (the\n * consensus line on an upcoming bout moved 5+ implied-probability points or\n * the favourite flipped). The signing secret is returned ONCE, in this\n * response.\n */\n async createWebhookEndpoint(url: string, events?: string[]): Promise<WebhookEndpoint> {\n const body: Record<string, unknown> = { url };\n if (events?.length) body.events = events;\n return (await this.#request<WebhookEndpoint>('POST', 'webhook-endpoints', { body })).data;\n }\n\n async deleteWebhookEndpoint(endpointId: number | string): Promise<void> {\n await this.#request<unknown>('DELETE', `webhook-endpoints/${encodeURIComponent(String(endpointId))}`);\n }\n\n async rotateWebhookSecret(endpointId: number | string): Promise<WebhookEndpoint> {\n return (\n await this.#request<WebhookEndpoint>(\n 'POST',\n `webhook-endpoints/${encodeURIComponent(String(endpointId))}/rotate-secret`,\n )\n ).data;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,UAAU;;;ACmFhB,IAAM,mBAAmB;AAChC,IAAM,qBAAqB;AAEpB,IAAM,sBAAsB;AAM5B,IAAM,0BAA0B;AACvC,IAAM,kBAAkB;AA2BjB,IAAM,gBAAN,cAA4B,MAAM;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAgB,MAAc,SAAiB,YAA2B,MAAM;AAC1F,UAAM,GAAG,MAAM,IAAI,IAAI,KAAK,OAAO,GAAG,YAAY,gBAAgB,SAAS,MAAM,EAAE,EAAE;AACrF,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,OAAO;AACZ,SAAK,YAAY;AAAA,EACnB;AACF;AAgBA,SAAS,kBAA2B;AAClC,SAAO,OAAO,aAAa,eAAe,OAAO,WAAW;AAC9D;AAGA,SAAS,kBAAkB,OAAqC;AAC9D,MAAI,UAAU,KAAM,QAAO;AAC3B,QAAM,IAAI,MAAM,KAAK;AACrB,MAAI,MAAM,GAAI,QAAO;AACrB,MAAI,OAAO,OAAO,CAAC;AACnB,MAAI,CAAC,OAAO,SAAS,IAAI,GAAG;AAC1B,UAAM,OAAO,KAAK,MAAM,CAAC;AACzB,QAAI,CAAC,OAAO,SAAS,IAAI,EAAG,QAA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B,mBAAmB,OAAO,UAAU,CAAC,CAAC;AAAA,IAC7D,GACA;AAAA,EACJ;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/version.ts","../src/client.ts"],"sourcesContent":["export { FightAPI, FightAPIError, DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, MAX_RETRY_AFTER_SECONDS } from './client';\nexport type { FightAPIOptions, Query, QueryValue } from './client';\nexport { VERSION } from './version';\nexport type * from './types';\n/** The generated OpenAPI path map, for anything the hand-written types above\n * do not cover. Regenerated by `pnpm gen:types` from apps/api/openapi.json. */\nexport type { paths, operations } from './schema';\n","/** Kept in lockstep with package.json and the User-Agent by\n * `apps/api/src/surfaces.test.ts`. Bump all three together. */\nexport const VERSION = '0.10.1';\n","/**\n * Thin, dependency-free client for https://api.ufcalendar.com/v1.\n *\n * Every method returns the parsed `data` value of the JSON envelope\n * (`{\"data\": ..., \"meta\": ...}`); list endpoints are async generators that\n * follow cursor pagination for you. Errors throw `FightAPIError` carrying\n * the API's `code`, `message` and `requestId` — quote the request id when\n * you write to api@ufcalendar.com.\n *\n * Mirrors sdk/python/ufcalendar/client.py one method per endpoint, in\n * camelCase. The two clients are kept in lockstep by\n * `apps/api/src/surfaces.test.ts`.\n *\n * Odds are the UFCalendar consensus line: one anonymised line per corner\n * across the sportsbooks we track (`sources` = how many books backed each\n * point; book identities are never exposed). Information only, not betting\n * advice. Fighter `images` are Wikimedia\n * Commons / Creative Commons files — the `license` and `artist` fields you\n * receive must be displayed as a credit.\n */\nimport { VERSION } from './version';\nimport type {\n Article,\n FightPositions,\n FightStatLine,\n FightTimeline,\n FighterDiscipline,\n FighterPositions,\n OrgCoverage,\n Referee,\n RefereeFightRow,\n ArticleLocale,\n ArticleSummary,\n EventPickem,\n EventOdds,\n FightInclude,\n FightOdds,\n OddsHistoryPoint,\n Compare,\n Matchup,\n WhosNext,\n EventStorylines,\n YearStats,\n EventWatch,\n OrgDivision,\n LeaderboardRow,\n RecordBookSection,\n StatScope,\n RightsSeries,\n SplitDecisionRow,\n ChangeFeedEntry,\n ChangeKind,\n FightSearchMethod,\n FightSearchRow,\n BroadcastRight,\n CareerBout,\n CareerStats,\n Champion,\n EventInclude,\n EventListInclude,\n JudgeScorecardRow,\n PowerIndexMover,\n PowerIndexRow,\n PowerIndexView,\n Envelope,\n EventChange,\n EventDetail,\n EventSummary,\n Fight,\n Fighter,\n FighterInclude,\n FighterSummary,\n Judge,\n Meta,\n Org,\n Plans,\n PowerIndex,\n RankingsBoard,\n RateLimit,\n Scorecards,\n Usage,\n Venue,\n WebhookEndpoint,\n} from './types';\n\nexport const DEFAULT_BASE_URL = 'https://api.ufcalendar.com/v1';\nconst DEFAULT_TIMEOUT_MS = 30_000;\n/** Default number of times a GET that hit the per-minute limit is retried. */\nexport const DEFAULT_MAX_RETRIES = 3;\n/**\n * A 429 whose `Retry-After` is longer than this is not waited out: the\n * per-minute limit always resets within a minute, anything longer is the\n * monthly quota (or something we do not understand) and must surface.\n */\nexport const MAX_RETRY_AFTER_SECONDS = 60;\nconst RETRY_JITTER_MS = 500;\n\nexport interface FightAPIOptions {\n /** `ufcalendar_…` key from https://www.ufcalendar.com/account/api. Falls back\n * to `UFCALENDAR_API_KEY` / `UFCAL_API_KEY` in the environment. Only\n * `plans()` works without one. */\n apiKey?: string;\n /** Override for testing; defaults to the production `/v1`. */\n baseUrl?: string;\n /** Inject a fetch (a test double, an instrumented fetch, undici). */\n fetch?: typeof fetch;\n /** Per-request timeout. Default 30s. */\n timeoutMs?: number;\n /** Extra headers on every request. */\n headers?: Record<string, string>;\n /**\n * How many times a GET that hit the per-minute limit (429 `rate_limited`\n * with `Retry-After` ≤ 60 s) is retried after waiting `Retry-After` plus a\n * little jitter. Default 3; `0` disables. The monthly quota\n * (`quota_exceeded`) and non-GET requests always throw at once.\n */\n maxRetries?: number;\n /** Replace the wait between rate-limit retries (tests, custom schedulers). */\n sleep?: (ms: number) => Promise<void>;\n}\n\n/** An error response from the Fight API. */\nexport class FightAPIError extends Error {\n readonly status: number;\n readonly code: string;\n readonly requestId: string | null;\n\n constructor(status: number, code: string, message: string, requestId: string | null = null) {\n super(`${status} ${code}: ${message}${requestId ? ` (request_id=${requestId})` : ''}`);\n this.name = 'FightAPIError';\n this.status = status;\n this.code = code;\n this.requestId = requestId;\n }\n}\n\nexport type QueryValue = string | number | boolean | null | undefined;\nexport type Query = Record<string, QueryValue>;\n\ninterface PageOptions {\n /** Stop after this many rows (across pages). */\n limit?: number;\n}\n\n/**\n * A browser forbids setting User-Agent on fetch, so we only set ours\n * off-browser. The test is `document`, NOT `navigator`: Node 21+ ships a\n * global `navigator`, so a navigator check would silently drop the header\n * on every modern Node runtime — which is the one place it works.\n */\nfunction canSetUserAgent(): boolean {\n return typeof document === 'undefined' && typeof window === 'undefined';\n}\n\n/** `Retry-After` as seconds: delta-seconds or an HTTP date; null if absent/unparseable. */\nfunction retryAfterSeconds(value: string | null): number | null {\n if (value === null) return null;\n const v = value.trim();\n if (v === '') return null;\n let secs = Number(v);\n if (!Number.isFinite(secs)) {\n const when = Date.parse(v);\n if (!Number.isFinite(when)) return null;\n secs = (when - Date.now()) / 1000;\n }\n return Math.max(0, secs);\n}\n\n/**\n * Seconds to wait before retrying a 429, or null when it must not be retried.\n * Only the per-minute limit (`rate_limited`) is waited out. The monthly quota\n * (`quota_exceeded`) throws at once — near the end of a month its\n * `Retry-After` can be short, so the code is checked, not just the header.\n */\nfunction shortRateLimitWait(res: Response, code: string | undefined): number | null {\n if (code === 'quota_exceeded') return null;\n const secs = retryAfterSeconds(res.headers.get('Retry-After'));\n if (secs === null || secs > MAX_RETRY_AFTER_SECONDS) return null;\n return secs;\n}\n\nconst defaultSleep = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms));\n\nfunction envKey(): string | undefined {\n const env = (globalThis as { process?: { env?: Record<string, string | undefined> } }).process?.env;\n return env?.UFCALENDAR_API_KEY || env?.UFCAL_API_KEY;\n}\n\nexport class FightAPI {\n readonly baseUrl: string;\n readonly apiKey: string | undefined;\n /** Retries of a GET that hit the per-minute limit (see `FightAPIOptions.maxRetries`). */\n readonly maxRetries: number;\n\n /** `meta` of the most recent response (pagination cursor, generated_at …). */\n lastMeta: Meta | null = null;\n /** `X-RateLimit-*` of the most recent response. */\n lastRateLimit: RateLimit = { limit: null, remaining: null, reset: null };\n\n readonly #fetch: typeof fetch;\n readonly #timeoutMs: number;\n readonly #headers: Record<string, string>;\n readonly #sleep: (ms: number) => Promise<void>;\n\n constructor(apiKeyOrOptions?: string | FightAPIOptions, options: FightAPIOptions = {}) {\n const opts: FightAPIOptions =\n typeof apiKeyOrOptions === 'string'\n ? { ...options, apiKey: apiKeyOrOptions }\n : { ...options, ...(apiKeyOrOptions ?? {}) };\n this.apiKey = opts.apiKey ?? envKey();\n this.baseUrl = (opts.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, '');\n this.#fetch = opts.fetch ?? globalThis.fetch;\n this.#timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n this.#headers = opts.headers ?? {};\n this.#sleep = opts.sleep ?? defaultSleep;\n const maxRetries = opts.maxRetries ?? DEFAULT_MAX_RETRIES;\n if (!Number.isInteger(maxRetries) || maxRetries < 0) {\n throw new RangeError('maxRetries must be a non-negative integer');\n }\n this.maxRetries = maxRetries;\n if (!this.#fetch) {\n throw new Error('No global fetch available. Use Node 18+ or pass { fetch }.');\n }\n }\n\n /* ---------------------------------------------------------------- core */\n\n #url(path: string, params?: Query): string {\n const url = new URL(`${this.baseUrl}/${path.replace(/^\\/+/, '')}`);\n for (const [k, v] of Object.entries(params ?? {})) {\n if (v === undefined || v === null) continue;\n url.searchParams.set(k, String(v));\n }\n return url.toString();\n }\n\n async #request<T>(\n method: string,\n path: string,\n { params, body, open = false }: { params?: Query; body?: unknown; open?: boolean } = {},\n ): Promise<Envelope<T>> {\n if (!this.apiKey && !open) {\n throw new FightAPIError(\n 401,\n 'no_api_key',\n 'No API key. Pass new FightAPI(\"ufcalendar_...\") or set UFCALENDAR_API_KEY. ' +\n 'Keys (free plan: 100 requests/month, no card) live at https://www.ufcalendar.com/account/api',\n );\n }\n const headers: Record<string, string> = { Accept: 'application/json', ...this.#headers };\n if (this.apiKey) headers.Authorization = `Bearer ${this.apiKey}`;\n if (canSetUserAgent()) headers['User-Agent'] = `ufcalendar-typescript/${VERSION}`;\n if (body !== undefined) headers['Content-Type'] = 'application/json';\n\n const url = this.#url(path, params);\n let res: Response;\n let text: string;\n let parsed: unknown;\n for (let attempt = 0; ; attempt += 1) {\n try {\n res = await this.#fetch(url, {\n method,\n headers,\n body: body === undefined ? undefined : JSON.stringify(body),\n signal: AbortSignal.timeout(this.#timeoutMs),\n });\n } catch (e) {\n const err = e as { name?: string; message?: string };\n if (err?.name === 'TimeoutError') {\n throw new FightAPIError(0, 'timeout', `Request to ${path} timed out after ${this.#timeoutMs}ms`);\n }\n throw new FightAPIError(0, 'network_error', err?.message ?? String(e));\n }\n\n this.lastRateLimit = {\n limit: res.headers.get('X-RateLimit-Limit'),\n remaining: res.headers.get('X-RateLimit-Remaining'),\n reset: res.headers.get('X-RateLimit-Reset'),\n };\n\n if (res.status === 204) {\n this.lastMeta = null;\n return { data: undefined as T };\n }\n\n text = await res.text();\n parsed = undefined;\n try {\n parsed = text ? JSON.parse(text) : undefined;\n } catch {\n parsed = undefined;\n }\n\n // Wait out the per-minute limit on reads (a 429'd request is not\n // counted against the month). Writes are never replayed.\n if (res.status === 429 && method.toUpperCase() === 'GET' && attempt < this.maxRetries) {\n const code = (parsed as { error?: { code?: string } } | undefined)?.error?.code;\n const wait = shortRateLimitWait(res, code);\n if (wait !== null) {\n await this.#sleep(wait * 1000 + Math.random() * RETRY_JITTER_MS);\n continue;\n }\n }\n break;\n }\n\n if (!res.ok) {\n const err = (parsed as { error?: { code?: string; message?: string; request_id?: string } } | undefined)?.error;\n if (err) {\n throw new FightAPIError(\n res.status,\n String(err.code ?? 'error'),\n String(err.message ?? text.slice(0, 200)),\n err.request_id ?? res.headers.get('x-request-id'),\n );\n }\n throw new FightAPIError(res.status, 'http_error', text.slice(0, 200), res.headers.get('x-request-id'));\n }\n\n const env = (parsed ?? {}) as Envelope<T>;\n this.lastMeta = env.meta ?? null;\n return env;\n }\n\n /** Raw GET returning the `data` value. Escape hatch for new endpoints. */\n async get<T = unknown>(path: string, params?: Query): Promise<T> {\n return (await this.#request<T>('GET', path, { params })).data;\n }\n\n /** Raw GET returning the whole `{data, meta}` envelope. */\n async getWithMeta<T = unknown>(path: string, params?: Query): Promise<Envelope<T>> {\n return this.#request<T>('GET', path, { params });\n }\n\n async *#paginate<T>(path: string, params: Query, opts: PageOptions = {}): AsyncGenerator<T, void, void> {\n // Never fetch a bigger page than the caller wants rows: `limit: 3` used\n // to pull 100 rows and throw 97 away, burning the caller's quota on a\n // request they did not ask for (and, on a trial key, a noticeable slice\n // of the 100 they get).\n const pageSize = Math.min(100, opts.limit ?? 100);\n const query: Query = { limit: pageSize, ...params };\n let seen = 0;\n for (;;) {\n const env = await this.#request<T[]>('GET', path, { params: query });\n for (const row of env.data ?? []) {\n yield row;\n seen += 1;\n if (opts.limit !== undefined && seen >= opts.limit) return;\n }\n const cursor = env.meta?.pagination?.next_cursor;\n if (!cursor) return;\n query.cursor = cursor;\n }\n }\n\n /* --------------------------------------------------------------- plans */\n\n /**\n * Plans (Free first), quotas, the free-plan rule, the MCP endpoint and the doc\n * links. The only endpoint that answers without a credential.\n */\n async plans(): Promise<Plans> {\n return (await this.#request<Plans>('GET', 'plans', { open: true })).data;\n }\n\n /* ---------------------------------------------------------------- orgs */\n\n /** Launch orgs with capability flags (stats / rounds / rankings / broadcasts / predictions / scorecards / odds). */\n orgs(): Promise<Org[]> {\n return this.get<Org[]>('orgs');\n }\n\n org(slug: string): Promise<Org> {\n return this.get<Org>(`orgs/${encodeURIComponent(slug)}`);\n }\n\n /**\n * One weight class in one promotion: its rankings board (null where the\n * promotion publishes none), upcoming bouts at that weight, the latest\n * results and the roster by recency. `division` is a slug, e.g.\n * `lightweight` or `womens-strawweight`.\n */\n orgDivision(org: string, division: string): Promise<OrgDivision> {\n return this.get<OrgDivision>(`orgs/${encodeURIComponent(org)}/divisions/${encodeURIComponent(division)}`);\n }\n\n /* -------------------------------------------------------------- events */\n\n /**\n * Schedule + results. Bare call = the upcoming calendar, soonest first.\n * `status: 'completed'` (or `order: 'desc'`) browses the archive\n * newest-first; `status: 'upcoming'` = every card not yet over (announced,\n * scheduled or live). `from` / `to` are `YYYY-MM-DD`.\n */\n events(\n opts: {\n org?: string;\n status?: string;\n from?: string;\n to?: string;\n order?: 'asc' | 'desc';\n /** Only cards with (true) / without (false) a title bout. */\n isTitleCard?: boolean;\n /** Only PPV (true) / non-PPV (false) cards. */\n isPpv?: boolean;\n /** `headline` adds each card's main event. */\n include?: EventListInclude[];\n limit?: number;\n } = {},\n ): AsyncGenerator<EventSummary, void, void> {\n const { limit, isTitleCard, isPpv, include, ...params } = opts;\n return this.#paginate<EventSummary>('events', {\n ...params,\n is_title_card: isTitleCard,\n is_ppv: isPpv,\n include: include?.length ? include.join(',') : undefined,\n } as Query, { limit });\n }\n\n /**\n * One event with its full fight card, venue and broadcasts.\n * `include: ['eta']` adds an estimated start time to every bout;\n * `include: ['odds']` adds each bout's current consensus line (the closing line once settled) (null when\n * unpriced). Pass both as `['eta', 'odds']`.\n */\n event(idOrSlug: string | number, opts: { include?: EventInclude[] } = {}): Promise<EventDetail> {\n return this.get<EventDetail>(\n `events/${encodeURIComponent(String(idOrSlug))}`,\n opts.include?.length ? { include: opts.include.join(',') } : undefined,\n );\n }\n\n /**\n * Who airs one event, per country: the promotion's rights deals for the\n * event's series merged with the event's own listings. `country` (ISO-2)\n * narrows to that market plus worldwide.\n */\n eventWatch(idOrSlug: string | number, opts: { country?: string } = {}): Promise<EventWatch> {\n return this.get<EventWatch>(`events/${encodeURIComponent(String(idOrSlug))}/watch`, opts as Query);\n }\n\n /**\n * The talking points of one card as of its start: title fights and\n * eliminators, the closest bout (UFCalendar model, else Power Index — not\n * betting advice), rematches and trilogy deciders, streaks, debuts and\n * returns, ranked fighters, nations, tallest / longest reach, the fastest\n * career finish.\n */\n eventStorylines(idOrSlug: string | number): Promise<EventStorylines> {\n return this.get<EventStorylines>(`events/${encodeURIComponent(String(idOrSlug))}/storylines`);\n }\n\n /**\n * How the UFCalendar community is picking each bout on one card: picks per\n * corner, the total and `pct_a`, in card order. Crowd sentiment from our\n * own pick'em game, not a market and not a forecast.\n */\n eventPickem(idOrSlug: string | number): Promise<EventPickem> {\n return this.get<EventPickem>(`events/${encodeURIComponent(String(idOrSlug))}/pickem`);\n }\n\n /**\n * The UFCalendar consensus odds for every non-cancelled bout on one card, in\n * card order: `consensus`, `opening`, `closing` (settled bouts), `movement`\n * and `points`. Unpriced bouts stay on the list with nulls and `points: 0`;\n * `lastMeta.priced` / `lastMeta.unpriced` count both. Information only, not\n * betting advice.\n */\n eventOdds(idOrSlug: string | number): Promise<EventOdds> {\n return this.get<EventOdds>(`events/${encodeURIComponent(String(idOrSlug))}/odds`);\n }\n\n /** Card-change diff log (fight added/removed, opponent swapped, date moved, profile merged). */\n eventChanges(idOrSlug: string | number): Promise<EventChange[]> {\n return this.get<EventChange[]>(`events/${encodeURIComponent(String(idOrSlug))}/changes`);\n }\n\n /**\n * The card-change feed across every event, newest first (default: the last\n * 90 days) — the `card.changed` webhook's audit trail, for callers that\n * poll. `since` is `YYYY-MM-DD` or an ISO-8601 datetime.\n */\n changes(\n opts: { org?: string; since?: string; kind?: ChangeKind; limit?: number } = {},\n ): AsyncGenerator<ChangeFeedEntry, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<ChangeFeedEntry>('changes', params as Query, { limit });\n }\n\n /* -------------------------------------------------------------- fights */\n\n /** One bout with its result. `include: ['odds']` adds the current consensus line (the closing line once the bout is settled). */\n fight(fightId: number | string, opts: { include?: FightInclude[] } = {}): Promise<Fight> {\n return this.get<Fight>(\n `fights/${encodeURIComponent(String(fightId))}`,\n opts.include?.length ? { include: opts.include.join(',') } : undefined,\n );\n }\n\n /**\n * The UFCalendar consensus line for one bout: `consensus` (latest point; the closing line once settled),\n * `opening`, `closing` (the last point at or before the event start,\n * settled bouts only), `movement` (opening → consensus in implied-probability\n * points on corner a) and `sources` on every point (how many sportsbooks\n * backed it; book identities are never exposed). An unpriced bout resolves\n * with null blocks and `points: 0`. Information only, not betting advice.\n */\n fightOdds(fightId: number | string): Promise<FightOdds> {\n return this.get<FightOdds>(`fights/${encodeURIComponent(String(fightId))}/odds`);\n }\n\n /**\n * Every consensus point for one bout, oldest first (Pro plans and up; a\n * lower plan throws `FightAPIError` 403 `tier_required`). A point is stored\n * only when the consensus moves. `from` / `to` are inclusive `YYYY-MM-DD`.\n */\n fightOddsHistory(\n fightId: number | string,\n opts: { from?: string; to?: string; limit?: number } = {},\n ): AsyncGenerator<OddsHistoryPoint, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<OddsHistoryPoint>(\n `fights/${encodeURIComponent(String(fightId))}/odds/history`,\n params as Query,\n { limit },\n );\n }\n\n /**\n * Per-fight totals for both corners, each with `fantasy` — UFCalendar\n * fantasy points with a per-category breakdown and `complete`. The\n * data-quality flags ride in `lastMeta.quality` (`StatsQuality`).\n */\n fightStats(fightId: number | string): Promise<FightStatLine[]> {\n return this.get<FightStatLine[]>(`fights/${encodeURIComponent(String(fightId))}/stats`);\n }\n\n /** Round-by-round stat lines for both corners. */\n fightRounds(fightId: number | string): Promise<Record<string, unknown>[]> {\n return this.get<Record<string, unknown>[]>(`fights/${encodeURIComponent(String(fightId))}/rounds`);\n }\n\n /**\n * The judges' scorecards for a bout — the official commission record:\n * decision type, point deductions, and one card per judge with every\n * round, the totals and `winner_fighter_id`. Scores are oriented to\n * `fighter_a_id` / `fighter_b_id`, both repeated on the payload.\n *\n * Check `scores_known` on a card before charting totals: when it is false\n * the commission published only the outcome. Throws 404 for a bout that\n * did not go to the judges.\n */\n fightScorecards(fightId: number | string): Promise<Scorecards> {\n return this.get<Scorecards>(`fights/${encodeURIComponent(String(fightId))}/scorecards`);\n }\n\n /**\n * The official in-fight log of one settled UFC bout (Pro plans and up; a\n * lower plan throws `FightAPIError` 403 `tier_required`): every logged\n * action in order, the referee stoppages paired with their reason and\n * real length, and every confirmed foul of the bout.\n *\n * The log labels only two fouls, the eye poke and the low blow. Any other\n * foul (an illegal knee to a grounded opponent, an upkick, a headbutt, a\n * bite, a fence grab) reaches it as a `generic` stoppage naming nobody, so\n * a foul is reported only when a record confirms it (`foul_basis` /\n * `basis`): `log` (the labelled row), `deduction` (the athletic commission\n * took a point) or `result` (the bout ended on it: a disqualification or a\n * \"could not continue\"). On a stoppage, `is_foul` says whether a foul is\n * confirmed, `foul` what it was, `committed_by` who committed it (null\n * when no record names a fighter), `points_deducted` and `ended_bout`; a\n * `generic` stoppage with no record behind it has `is_foul: false`.\n * `incidents` lists every confirmed foul in fight order, including one\n * with no stoppage in the log; `fouls.a` / `fouls.b` count what each\n * corner committed (`eye_pokes`, `low_blows`, `other`, `total`,\n * `points_deducted`). A recorded foul is not a ruling on intent.\n *\n * Coverage: UFC bouts from June 2013, stoppage reasons\n * from 8 December 2018 (`lastMeta.has_stoppage_reasons`). A bout with no\n * log, or one not settled yet, resolves with empty lists and\n * `lastMeta.note`.\n */\n fightTimeline(fightId: number | string): Promise<FightTimeline> {\n return this.get<FightTimeline>(`fights/${encodeURIComponent(String(fightId))}/timeline`);\n }\n\n /**\n * Position stats of one settled UFC bout (Pro plans and up): where it was\n * fought (`time`, shared by both fighters), each fighter's `control` by\n * position, and strikes by position and target — `totals` for the whole\n * bout, `rounds` per round. `null` means not tracked for that bout; `0`\n * is a real zero. Tracked reliably from 2007.\n */\n fightPositions(fightId: number | string): Promise<FightPositions> {\n return this.get<FightPositions>(`fights/${encodeURIComponent(String(fightId))}/positions`);\n }\n\n /**\n * Completed bouts, filtered — newest first unless `order: 'oldest'`. At\n * least one narrowing filter is required (`titleOnly`, `method`,\n * `division`, `fighter`, `winner`, `from`, `to`, `mainEventsOnly`); the\n * server serves 25 rows a page and at most 10 pages.\n */\n findFights(\n opts: {\n org?: string;\n titleOnly?: boolean;\n method?: FightSearchMethod;\n /** Division slug (`lightweight`) or a name fragment. */\n division?: string;\n /** Fighter slug or id — bouts they were in. */\n fighter?: string | number;\n /** Fighter slug or id — bouts they won. */\n winner?: string | number;\n from?: string;\n to?: string;\n mainEventsOnly?: boolean;\n order?: 'newest' | 'oldest';\n limit?: number;\n } = {},\n ): AsyncGenerator<FightSearchRow, void, void> {\n const { limit, titleOnly, mainEventsOnly, fighter, winner, ...rest } = opts;\n return this.#paginate<FightSearchRow>('fights/search', {\n ...rest,\n title_only: titleOnly,\n main_events_only: mainEventsOnly,\n fighter: fighter === undefined ? undefined : String(fighter),\n winner: winner === undefined ? undefined : String(winner),\n } as Query, { limit });\n }\n\n /* -------------------------------------------------------------- judges */\n\n /**\n * Every official who has scored a launch-org bout, busiest first. Rates\n * mean little below ~10 fights; pass `minFights: 10`.\n */\n judges(\n opts: { q?: string; org?: string; minFights?: number; limit?: number } = {},\n ): AsyncGenerator<Judge, void, void> {\n const { limit, minFights, ...rest } = opts;\n return this.#paginate<Judge>('judges', { ...rest, min_fights: minFights } as Query, { limit });\n }\n\n judge(judgeId: number | string): Promise<Judge> {\n return this.get<Judge>(`judges/${encodeURIComponent(String(judgeId))}`);\n }\n\n /**\n * Split and majority decisions, newest first, with every judge's card and\n * the dissenting judges named. Commission records only.\n */\n splitDecisions(\n opts: { org?: string; from?: string; to?: string; limit?: number } = {},\n ): AsyncGenerator<SplitDecisionRow, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<SplitDecisionRow>('scorecards/splits', params as Query, { limit });\n }\n\n /**\n * Every card this judge has turned in, newest first, with `lone_dissent`,\n * `split` and the `colleagues`' totals on each row.\n */\n judgeScorecards(\n judgeId: number | string,\n opts: { limit?: number } = {},\n ): AsyncGenerator<JudgeScorecardRow, void, void> {\n return this.#paginate<JudgeScorecardRow>(\n `judges/${encodeURIComponent(String(judgeId))}/scorecards`,\n {},\n opts,\n );\n }\n\n /* ------------------------------------------------------------ referees */\n\n /**\n * Every referee who has worked a settled launch-org bout, busiest first:\n * bouts, promotions, finish rate, method mix and average fight time. The\n * id is a slug of the name; `q` is accent- and spacing-insensitive.\n */\n referees(opts: { q?: string; org?: string; limit?: number } = {}): AsyncGenerator<Referee, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<Referee>('referees', params as Query, { limit });\n }\n\n /** One referee's career aggregates, e.g. `referee('herb-dean')`. */\n referee(slug: string): Promise<Referee> {\n return this.get<Referee>(`referees/${encodeURIComponent(slug)}`);\n }\n\n /** Every settled bout one referee worked, newest first (the bout plus its `event`). */\n refereeFights(slug: string, opts: { limit?: number } = {}): AsyncGenerator<RefereeFightRow, void, void> {\n return this.#paginate<RefereeFightRow>(`referees/${encodeURIComponent(slug)}/fights`, {}, opts);\n }\n\n /* ------------------------------------------------------------ coverage */\n\n /**\n * What the database holds per launch org per year: events, settled bouts\n * and how many carry stats, round stats, commission scorecards and a\n * consensus odds line, with `totals` and `last_result_at`.\n */\n coverage(opts: { org?: string } = {}): Promise<OrgCoverage[]> {\n return this.get<OrgCoverage[]>('coverage', opts.org ? { org: opts.org } : undefined);\n }\n\n /* ------------------------------------------------------------ fighters */\n\n fighters(\n opts: { q?: string; org?: string; country?: string; limit?: number } = {},\n ): AsyncGenerator<FighterSummary, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<FighterSummary>('fighters', params as Query, { limit });\n }\n\n /**\n * Bio, records, career stats, Power Index, CC-licensed images, `next_fight`\n * and `last_fight`. `include: ['bonuses']` adds the UFC bonus ledger;\n * `include: ['credentials']` adds grappling and wrestling pedigree, gyms and\n * coaches (every row with `sources` and a `confidence` grade).\n */\n fighter(idOrSlug: string | number, opts: { include?: FighterInclude[] } = {}): Promise<Fighter> {\n return this.get<Fighter>(\n `fighters/${encodeURIComponent(String(idOrSlug))}`,\n opts.include?.length ? { include: opts.include.join(',') } : undefined,\n );\n }\n\n /** Complete multi-promotion career timeline. */\n fighterHistory(idOrSlug: string | number): Promise<CareerBout[]> {\n return this.get<CareerBout[]>(`fighters/${encodeURIComponent(String(idOrSlug))}/history`);\n }\n\n /** Raw career stat rows, one source-stamped row per scope (`pro-mma`, `ufc-only` …).\n * For the readable split use `fighter().records` / `fighter().stats`. */\n fighterStats(idOrSlug: string | number): Promise<CareerStats[]> {\n return this.get<CareerStats[]>(`fighters/${encodeURIComponent(String(idOrSlug))}/stats`);\n }\n\n /** Every ranking row the fighter ever held, newest first, across every board\n * (`board` is `official` / `meta`; `is_champion` when rank 0). The endpoint is\n * cursor-paginated since 2026-09-24 — this walks every page so the array is\n * complete (a long career is 900+ rows). */\n async fighterRankings(idOrSlug: string | number): Promise<Record<string, unknown>[]> {\n const out: Record<string, unknown>[] = [];\n for await (const row of this.#paginate<Record<string, unknown>>(\n `fighters/${encodeURIComponent(String(idOrSlug))}/rankings`, { limit: 500 } as Query)) out.push(row);\n return out;\n }\n\n fighterPowerIndex(idOrSlug: string | number): Promise<PowerIndex & Record<string, unknown>> {\n return this.get<PowerIndex & Record<string, unknown>>(\n `fighters/${encodeURIComponent(String(idOrSlug))}/power-index`,\n );\n }\n\n /**\n * The confirmed fouls in a fighter's UFC bouts since 8 December 2018 (Pro\n * plans and up), committed and drawn: eye pokes and low blows from the\n * official in-fight log, plus any other foul (an illegal knee to a\n * grounded opponent, an upkick, a headbutt, a bite, a fence grab)\n * confirmed by the athletic commission's point deduction or by the\n * official result. `committed` / `drawn` count `total`, `eye_pokes`,\n * `low_blows` and `other`; `points_deducted` is what the commission has\n * taken from this fighter; `incidents` lists every confirmed foul, most\n * recent first, with `reason` (the foul), `basis` (`log`, `deduction` or\n * `result`), `points_deducted` and `ended_bout`. A `generic` stoppage with\n * no record behind it is never counted. A recorded foul is not a ruling on\n * intent. Resolves `null` (with `lastMeta.note`) under 3 tracked bouts\n * with no recorded foul.\n */\n fighterDiscipline(idOrSlug: string | number): Promise<FighterDiscipline | null> {\n return this.get<FighterDiscipline | null>(`fighters/${encodeURIComponent(String(idOrSlug))}/discipline`);\n }\n\n /**\n * A fighter's career position profile (Pro plans and up): the share of\n * cage time at distance, in the clinch and on the ground, and control\n * seconds for and against by position. Resolves `null` (with\n * `lastMeta.note`) under 3 bouts with tracked positions.\n */\n fighterPositions(idOrSlug: string | number): Promise<FighterPositions | null> {\n return this.get<FighterPositions | null>(`fighters/${encodeURIComponent(String(idOrSlug))}/positions`);\n }\n\n /**\n * Two fighters side by side (slugs or ids): bios with age, career stats,\n * strike mix, win streaks, previous meetings, common opponents, the booked\n * bout between them, the UFCalendar model prediction for it (UFC; not\n * betting advice) and Power Index ratings.\n */\n compare(a: string | number, b: string | number): Promise<Compare> {\n return this.get<Compare>('compare', { a: String(a), b: String(b) });\n }\n\n /* ------------------------------------------------------------ rankings */\n\n /**\n * Official board, point-in-time. `date: 'YYYY-MM-DD'` returns the board\n * that was valid on that day (UFC history back to 2013; rank 0 = champion).\n */\n rankings(org = 'ufc', opts: { date?: string; board?: string } = {}): Promise<RankingsBoard> {\n return this.get<RankingsBoard>(`rankings/${encodeURIComponent(org)}`, opts as Query);\n }\n\n divisionRankings(org: string, division: string, opts: { date?: string } = {}): Promise<RankingsBoard> {\n return this.get<RankingsBoard>(\n `rankings/${encodeURIComponent(org)}/${encodeURIComponent(division)}`,\n opts as Query,\n );\n }\n\n /** Current champions across every launch org, or one `org` / `division`. */\n champions(opts: { org?: string; division?: string } = {}): Promise<Champion[]> {\n return this.get<Champion[]>('champions', opts);\n }\n\n /**\n * UFCalendar Power Index board. `view: 'movers'` = biggest risers over\n * `days` (default 365), `view: 'peaks'` = all-time peak ratings;\n * `division` narrows any view.\n */\n powerIndex(\n org = 'ufc',\n opts: { view?: PowerIndexView; division?: string; days?: number; limit?: number } = {},\n ): Promise<(PowerIndexRow | PowerIndexMover)[]> {\n return this.get<(PowerIndexRow | PowerIndexMover)[]>(`power-index/${encodeURIComponent(org)}`, {\n view: opts.view,\n division: opts.division,\n days: opts.days,\n limit: opts.limit,\n });\n }\n\n /* ---------------------------------------------------------- matchmaker */\n\n /**\n * UFCalendar's matchmaker: the fights worth making in one MMA promotion,\n * scored 0–100, across the roster or for one `division` (`lastMeta.divisions`\n * lists the valid ones). Not a list of bookings; computed without the\n * site's Fight DNA factor.\n */\n matchmaker(org = 'ufc', opts: { division?: string; limit?: number } = {}): Promise<Matchup[]> {\n return this.get<Matchup[]>(`matchmaker/${encodeURIComponent(org)}`, {\n division: opts.division,\n limit: opts.limit,\n });\n }\n\n /**\n * Who one fighter (slug or id) should fight next: the best-scored\n * opponents with the Power Index win probability for each, plus the bout\n * already booked (`booked_next`).\n */\n whosNext(fighter: string | number, opts: { limit?: number } = {}): Promise<WhosNext> {\n return this.get<WhosNext>(`matchmaker/next/${encodeURIComponent(String(fighter))}`, { limit: opts.limit });\n }\n\n /* --------------------------------------------------------------- stats */\n\n /**\n * One Record Book leaderboard for one promotion (`metric` e.g. `wins`,\n * `fastest_knockout`, `finish_rate`). Narrow with `division` (slug),\n * `country` (ISO-2) or `population: 'active'` — not `country` and\n * `active` together. `lastMeta.metric` names the unit and what\n * `value_secondary` means.\n */\n leaderboard(\n org: string,\n metric: string,\n opts: { division?: string; country?: string; population?: 'all' | 'active'; limit?: number } = {},\n ): Promise<LeaderboardRow[]> {\n return this.get<LeaderboardRow[]>('stats/leaders', { org, metric, ...opts } as Query);\n }\n\n /**\n * Every leaderboard's top rows (`top`, default 10, max 25) for one\n * promotion, grouped by category.\n */\n recordBook(\n org: string,\n opts: { division?: string; country?: string; population?: 'all' | 'active'; scope?: StatScope; top?: number } = {},\n ): Promise<RecordBookSection[]> {\n return this.get<RecordBookSection[]>('stats/record-book', { org, ...opts } as Query);\n }\n\n /**\n * One calendar year in numbers for one promotion, or every covered\n * promotion when `org` is omitted: events, title fights, finish methods,\n * divisions, fastest finishes, upsets, Power Index climbers, busiest\n * fighters, host countries and the most-used judges.\n */\n yearStats(year: number, opts: { org?: string } = {}): Promise<YearStats> {\n return this.get<YearStats>(`stats/years/${encodeURIComponent(String(year))}`, opts as Query);\n }\n\n /* ---------------------------------------------------------------- misc */\n\n /** Model win probabilities for upcoming UFC bouts; `event` narrows to one card. */\n predictionsUpcoming(opts: { event?: string | number } = {}): Promise<Record<string, unknown>[]> {\n return this.get<Record<string, unknown>[]>(\n 'predictions/upcoming',\n opts.event !== undefined ? { event: String(opts.event) } : undefined,\n );\n }\n\n /**\n * Who airs the promotion, per ISO-2 country — the org-wide deals, or a UFC\n * sub-series grid with `series: 'dwcs' | 'rtufc'`.\n */\n broadcastRights(org = 'ufc', opts: { country?: string; series?: RightsSeries } = {}): Promise<BroadcastRight[]> {\n return this.get<BroadcastRight[]>(`broadcast-rights/${encodeURIComponent(org)}`, opts as Query);\n }\n\n /**\n * Venues that hosted a covered promotion, alphabetical. `q` (2+ chars)\n * matches name or city; `country` is an ISO-2 code or an English name.\n */\n venues(opts: { q?: string; country?: string; limit?: number } = {}): AsyncGenerator<Venue, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<Venue>('venues', params as Query, { limit });\n }\n\n venue(venueId: number | string): Promise<Venue> {\n return this.get<Venue>(`venues/${encodeURIComponent(String(venueId))}`);\n }\n\n /** Every covered event at one venue, newest first (`order: 'asc'` reverses). */\n venueEvents(\n venueId: number | string,\n opts: { status?: string; from?: string; to?: string; order?: 'asc' | 'desc'; limit?: number } = {},\n ): AsyncGenerator<EventSummary, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<EventSummary>(`venues/${encodeURIComponent(String(venueId))}/events`, params as Query, { limit });\n }\n\n /** Typeahead across fighters and events. */\n search(q: string): Promise<Record<string, unknown>> {\n return this.get<Record<string, unknown>>('search', { q });\n }\n\n /**\n * UFCalendar's own editorial archive, newest first. `q` (2+ chars) matches\n * title, summary or a tag; `tag` is exact; `locale` is one of the 13 site\n * languages (English fallback).\n */\n articles(\n opts: { q?: string; tag?: string; locale?: ArticleLocale; limit?: number } = {},\n ): AsyncGenerator<ArticleSummary, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<ArticleSummary>('articles', params as Query, { limit });\n }\n\n /**\n * One article: full Markdown `body_md` (client widgets removed), author,\n * tags, `published_at`; `served_locale` names the language\n * delivered.\n */\n article(slug: string, opts: { locale?: ArticleLocale } = {}): Promise<Article> {\n return this.get<Article>(`articles/${encodeURIComponent(slug)}`, opts as Query);\n }\n\n /** Your key's month-to-date quota usage. */\n usage(): Promise<Usage> {\n return this.get<Usage>('usage');\n }\n\n /**\n * Subscribable ICS feed URL for calendar apps (authenticates via `?key=`).\n *\n * Throws without a key rather than returning `?key=`: that empty URL is\n * pasted into a calendar app, fails there hours later, and the failure\n * surfaces nowhere near this call.\n */\n calendarIcsUrl(org = 'ufc'): string {\n if (!this.apiKey) {\n throw new FightAPIError(\n 401,\n 'no_api_key',\n 'No API key. Pass new FightAPI(\"ufcalendar_...\") or set UFCALENDAR_API_KEY. ' +\n 'Keys (free plan: 100 requests/month, no card) live at https://www.ufcalendar.com/account/api',\n );\n }\n return `${this.baseUrl}/calendar/${encodeURIComponent(org)}.ics?key=${encodeURIComponent(this.apiKey)}`;\n }\n\n /* ------------------------------------------------------------ webhooks */\n\n webhookEndpoints(): Promise<WebhookEndpoint[]> {\n return this.get<WebhookEndpoint[]>('webhook-endpoints');\n }\n\n /**\n * Register a signed webhook (Pro and up). `events` ⊆ `event.announced`,\n * `fight.result`, `card.changed`, `event.completed`, `odds.moved` (the\n * consensus line on an upcoming bout moved 5+ implied-probability points or\n * the favourite flipped). The signing secret is returned ONCE, in this\n * response.\n */\n async createWebhookEndpoint(url: string, events?: string[]): Promise<WebhookEndpoint> {\n const body: Record<string, unknown> = { url };\n if (events?.length) body.events = events;\n return (await this.#request<WebhookEndpoint>('POST', 'webhook-endpoints', { body })).data;\n }\n\n async deleteWebhookEndpoint(endpointId: number | string): Promise<void> {\n await this.#request<unknown>('DELETE', `webhook-endpoints/${encodeURIComponent(String(endpointId))}`);\n }\n\n async rotateWebhookSecret(endpointId: number | string): Promise<WebhookEndpoint> {\n return (\n await this.#request<WebhookEndpoint>(\n 'POST',\n `webhook-endpoints/${encodeURIComponent(String(endpointId))}/rotate-secret`,\n )\n ).data;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,UAAU;;;ACmFhB,IAAM,mBAAmB;AAChC,IAAM,qBAAqB;AAEpB,IAAM,sBAAsB;AAM5B,IAAM,0BAA0B;AACvC,IAAM,kBAAkB;AA2BjB,IAAM,gBAAN,cAA4B,MAAM;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAgB,MAAc,SAAiB,YAA2B,MAAM;AAC1F,UAAM,GAAG,MAAM,IAAI,IAAI,KAAK,OAAO,GAAG,YAAY,gBAAgB,SAAS,MAAM,EAAE,EAAE;AACrF,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,OAAO;AACZ,SAAK,YAAY;AAAA,EACnB;AACF;AAgBA,SAAS,kBAA2B;AAClC,SAAO,OAAO,aAAa,eAAe,OAAO,WAAW;AAC9D;AAGA,SAAS,kBAAkB,OAAqC;AAC9D,MAAI,UAAU,KAAM,QAAO;AAC3B,QAAM,IAAI,MAAM,KAAK;AACrB,MAAI,MAAM,GAAI,QAAO;AACrB,MAAI,OAAO,OAAO,CAAC;AACnB,MAAI,CAAC,OAAO,SAAS,IAAI,GAAG;AAC1B,UAAM,OAAO,KAAK,MAAM,CAAC;AACzB,QAAI,CAAC,OAAO,SAAS,IAAI,EAAG,QAAO;AACnC,YAAQ,OAAO,KAAK,IAAI,KAAK;AAAA,EAC/B;AACA,SAAO,KAAK,IAAI,GAAG,IAAI;AACzB;AAQA,SAAS,mBAAmB,KAAe,MAAyC;AAClF,MAAI,SAAS,iBAAkB,QAAO;AACtC,QAAM,OAAO,kBAAkB,IAAI,QAAQ,IAAI,aAAa,CAAC;AAC7D,MAAI,SAAS,Q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AAA;AAAA;AAAA,EAOA,QAAQ,MAAc,OAAmC,CAAC,GAAqB;AAC7E,WAAO,KAAK,IAAa,YAAY,mBAAmB,IAAI,CAAC,IAAI,IAAa;AAAA,EAChF;AAAA;AAAA,EAGA,QAAwB;AACtB,WAAO,KAAK,IAAW,OAAO;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,eAAe,MAAM,OAAe;AAClC,QAAI,CAAC,KAAK,QAAQ;AAChB,YAAM,IAAI;AAAA,QACR;AAAA,QACA;AAAA,QACA;AAAA,MAEF;AAAA,IACF;AACA,WAAO,GAAG,KAAK,OAAO,aAAa,mBAAmB,GAAG,CAAC,YAAY,mBAAmB,KAAK,MAAM,CAAC;AAAA,EACvG;AAAA;AAAA,EAIA,mBAA+C;AAC7C,WAAO,KAAK,IAAuB,mBAAmB;AAAA,EACxD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,sBAAsB,KAAa,QAA6C;AACpF,UAAM,OAAgC,EAAE,IAAI;AAC5C,QAAI,QAAQ,OAAQ,MAAK,SAAS;AAClC,YAAQ,MAAM,KAAK,SAA0B,QAAQ,qBAAqB,EAAE,KAAK,CAAC,GAAG;AAAA,EACvF;AAAA,EAEA,MAAM,sBAAsB,YAA4C;AACtE,UAAM,KAAK,SAAkB,UAAU,qBAAqB,mBAAmB,OAAO,UAAU,CAAC,CAAC,EAAE;AAAA,EACtG;AAAA,EAEA,MAAM,oBAAoB,YAAuD;AAC/E,YACE,MAAM,KAAK;AAAA,MACT;AAAA,MACA,qBAAqB,mBAAmB,OAAO,UAAU,CAAC,CAAC;AAAA,IAC7D,GACA;AAAA,EACJ;AACF;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -2210,7 +2210,7 @@ declare class FightAPI {
|
|
|
2210
2210
|
|
|
2211
2211
|
/** Kept in lockstep with package.json and the User-Agent by
|
|
2212
2212
|
* `apps/api/src/surfaces.test.ts`. Bump all three together. */
|
|
2213
|
-
declare const VERSION = "0.10.
|
|
2213
|
+
declare const VERSION = "0.10.1";
|
|
2214
2214
|
|
|
2215
2215
|
/**
|
|
2216
2216
|
* This file was auto-generated by openapi-typescript.
|
|
@@ -3763,7 +3763,7 @@ interface paths {
|
|
|
3763
3763
|
};
|
|
3764
3764
|
/**
|
|
3765
3765
|
* Consensus odds for one card
|
|
3766
|
-
* @description The UFCalendar consensus line for every non-cancelled bout on one card, in card order: `fights[]`, each with `fight_id`, `status`, both corners (`fighter_a`, `fighter_b`: `id`, `slug`, `name`), `consensus` (the latest point; the closing line once the bout is settled), `opening` (the first point we recorded), `closing` (settled bouts only: the last point at or before the event start), `movement` (opening → consensus in implied-probability points on corner a, with the `direction` the market moved), `points` and `updated_at`. Every point is `a` / `b` (`american`, `decimal`, raw `implied_probability`), `favourite`, `fair_probability_a` (margin removed), `sources` (how many sportsbooks backed it) and `recorded_at`. A bout nobody has priced stays on the list with nulls and `points: 0`; `meta.priced` / `meta.unpriced` count both. `meta.checked_at` is when we last checked the market, whether or not the line moved. Consensus is the mean across the sportsbooks we track, refreshed every 30 minutes in the 48 hours before a card and every 2 hours otherwise; book identities are never exposed. Each bout also carries `props` — method of victory per corner, total rounds over/under per line and goes the distance (`FightProps`, or null), described on `/v1/fights/{id}/odds`. Information only, not betting advice. An unknown event 404s.
|
|
3766
|
+
* @description The UFCalendar consensus line for every non-cancelled bout on one card, in card order: `fights[]`, each with `fight_id`, `status`, both corners (`fighter_a`, `fighter_b`: `id`, `slug`, `name`), `consensus` (the latest point; the closing line once the bout is settled), `opening` (the first point we recorded; on a settled bout from the archive that stores only its closing point, the mean of each sportsbook's own opening price with `recorded_at: null`), `closing` (settled bouts only: the last point at or before the start of the bout's own card section, or the event start when that time is not known), `movement` (opening → consensus in implied-probability points on corner a, with the `direction` the market moved), `points` and `updated_at`. Every point is `a` / `b` (`american`, `decimal`, raw `implied_probability`), `favourite`, `fair_probability_a` (margin removed), `sources` (how many sportsbooks backed it) and `recorded_at`. A bout nobody has priced stays on the list with nulls and `points: 0`; `meta.priced` / `meta.unpriced` count both. `meta.checked_at` is when we last checked the market, whether or not the line moved. Consensus is the mean across the sportsbooks we track, refreshed every 30 minutes in the 48 hours before a card and every 2 hours otherwise; book identities are never exposed. Each bout also carries `props` — method of victory per corner, total rounds over/under per line and goes the distance (`FightProps`, or null), described on `/v1/fights/{id}/odds`. Information only, not betting advice. An unknown event 404s.
|
|
3767
3767
|
*/
|
|
3768
3768
|
get: {
|
|
3769
3769
|
parameters: {
|
|
@@ -5066,9 +5066,9 @@ interface paths {
|
|
|
5066
5066
|
};
|
|
5067
5067
|
/**
|
|
5068
5068
|
* Consensus odds for one bout
|
|
5069
|
-
* @description The UFCalendar consensus line for one bout: `consensus` (the latest point; the closing line once the bout is settled), `opening` (the first point we recorded), `closing` (settled bouts only, `completed` or `no_contest`: the last point at or before the event start; null until then), `movement` (opening → consensus: `delta_points_a` in implied-probability points on corner a, `direction` = the corner the market moved toward, `since`), `points` (stored points) and `updated_at` (when the line last moved). Every point is `a` / `b` (`american`, `decimal`, raw `implied_probability`), `favourite`, `fair_probability_a` (margin removed) and `sources` (how many sportsbooks backed it). Consensus is the mean across the sportsbooks we track, in decimal space; book identities are never exposed. `meta.checked_at` is when we last checked the market, whether or not the line moved; `meta.history` is the movement series (Pro+). A bout nobody priced answers 200 with nulls and `points: 0`; 404 is reserved for an unknown fight.
|
|
5069
|
+
* @description The UFCalendar consensus line for one bout: `consensus` (the latest point; the closing line once the bout is settled), `opening` (the first point we recorded; on a settled bout from the archive that stores only its closing point, the mean of each sportsbook's own opening price with `recorded_at: null`), `closing` (settled bouts only, `completed` or `no_contest`: the last point at or before the start of the bout's own card section (main card, prelims or early prelims), or the event start when that time is not known; null until then), `movement` (opening → consensus: `delta_points_a` in implied-probability points on corner a, `direction` = the corner the market moved toward, `since`), `points` (stored points) and `updated_at` (when the line last moved). Every point is `a` / `b` (`american`, `decimal`, raw `implied_probability`), `favourite`, `fair_probability_a` (margin removed) and `sources` (how many sportsbooks backed it). Consensus is the mean across the sportsbooks we track, in decimal space; book identities are never exposed. `meta.checked_at` is when we last checked the market, whether or not the line moved; `meta.history` is the movement series (Pro+). A bout nobody priced answers 200 with nulls and `points: 0`; 404 is reserved for an unknown fight.
|
|
5070
5070
|
*
|
|
5071
|
-
* `props` carries the prop markets (`FightProps`, or null when no sportsbooks price them): `method` (per corner `a` / `b`: `ko`, `sub`, `dec` — each `yes` / `no` prices, `fair_probability` = its share of all six outcomes when all six are priced, `sources`), `total_rounds` (over/under per rounds line, ascending) and `distance` (goes the distance yes / no). Same consensus rule as the moneyline (the sportsbook mean; prediction markets excluded, a book far from the rest dropped, two sportsbooks minimum); prices are recorded until the
|
|
5071
|
+
* `props` carries the prop markets (`FightProps`, or null when no sportsbooks price them): `method` (per corner `a` / `b`: `ko`, `sub`, `dec` — each `yes` / `no` prices, `fair_probability` = its share of all six outcomes when all six are priced, `sources`), `total_rounds` (over/under per rounds line, ascending) and `distance` (goes the distance yes / no). Same consensus rule as the moneyline (the sportsbook mean; prediction markets excluded, a book far from the rest dropped, two sportsbooks minimum); prices are recorded until the bout's own card section starts, so a settled bout carries its closing props (`closing: true`). Props for 2021-2025 were backfilled as one closing consensus per market, with `recorded_at` set to the event start: that time is approximate, not when the price was observed. Books post props in fight week. Information only, not betting advice.
|
|
5072
5072
|
*/
|
|
5073
5073
|
get: {
|
|
5074
5074
|
parameters: {
|
|
@@ -14900,9 +14900,9 @@ interface components {
|
|
|
14900
14900
|
sources: number;
|
|
14901
14901
|
/**
|
|
14902
14902
|
* Format: date-time
|
|
14903
|
-
* @description When this consensus point was recorded.
|
|
14903
|
+
* @description When this consensus point was recorded. Null only on an `opening` from the archive before point-by-point tracking, where the time the line opened was never recorded.
|
|
14904
14904
|
*/
|
|
14905
|
-
recorded_at: string;
|
|
14905
|
+
recorded_at: string | null;
|
|
14906
14906
|
};
|
|
14907
14907
|
OddsMovement: {
|
|
14908
14908
|
/** @description Implied-probability points on corner a, opening → consensus (2 places). Positive = the market moved toward a. */
|
|
@@ -14914,9 +14914,9 @@ interface components {
|
|
|
14914
14914
|
direction: "a" | "b" | null;
|
|
14915
14915
|
/**
|
|
14916
14916
|
* Format: date-time
|
|
14917
|
-
* @description When the opening point was recorded.
|
|
14917
|
+
* @description When the opening point was recorded; null when the opening comes from the archive and its time is unknown.
|
|
14918
14918
|
*/
|
|
14919
|
-
since: string;
|
|
14919
|
+
since: string | null;
|
|
14920
14920
|
};
|
|
14921
14921
|
/** @description One prop market's consensus price: the mean, in decimal space, across the sportsbooks we track, converted back to American. */
|
|
14922
14922
|
PropLine: {
|
|
@@ -14954,7 +14954,7 @@ interface components {
|
|
|
14954
14954
|
/** @description This corner wins by decision. */
|
|
14955
14955
|
dec: components["schemas"]["PropLine"] | null;
|
|
14956
14956
|
};
|
|
14957
|
-
/** @description Prop-market consensus for one bout. Prediction markets and exchanges are excluded and a book far from the rest is dropped; a market needs at least two sportsbooks. Prices are recorded until the event
|
|
14957
|
+
/** @description Prop-market consensus for one bout. Prediction markets and exchanges are excluded and a book far from the rest is dropped; a market needs at least two sportsbooks. Prices are recorded until the bout's own card section starts (the event start when that time is not known). Props for 2021-2025 were backfilled as one closing consensus per market (three sportsbooks minimum), stamped at the event start: treat that time as approximate. Information only, not betting advice. */
|
|
14958
14958
|
FightProps: {
|
|
14959
14959
|
/** @description Method of victory per corner (oriented to the bout's `fighter_a` / `fighter_b`). */
|
|
14960
14960
|
method: {
|
|
@@ -14965,7 +14965,7 @@ interface components {
|
|
|
14965
14965
|
total_rounds: components["schemas"]["PropTotalRounds"][];
|
|
14966
14966
|
/** @description The fight goes the distance (yes) or ends inside it (no). */
|
|
14967
14967
|
distance: components["schemas"]["PropLine"] | null;
|
|
14968
|
-
/** @description True once the bout is settled: every price is the last
|
|
14968
|
+
/** @description True once the bout is settled: every price is the closing price. On bouts recorded live (2026 onward) that is the last price before the bout's own card section started, with its real timestamp; on bouts from 2021-2025 it was backfilled, and `recorded_at` is the event start, not the moment the price was observed. */
|
|
14969
14969
|
closing: boolean;
|
|
14970
14970
|
/**
|
|
14971
14971
|
* Format: date-time
|
|
@@ -14997,9 +14997,9 @@ interface components {
|
|
|
14997
14997
|
} | null;
|
|
14998
14998
|
/** @description The current consensus line: the latest point while the bout is upcoming, the closing line once it is settled (a finished bout never reports a post-bell price). Null when the bout was never priced. */
|
|
14999
14999
|
consensus: components["schemas"]["OddsPair"] | null;
|
|
15000
|
-
/** @description The first consensus point we recorded. */
|
|
15000
|
+
/** @description The opening line. On a bout tracked point by point: the first consensus point we recorded. On a settled bout from the archive that stores only its closing point (`points: 1`): the mean of each sportsbook's own opening price, with `recorded_at: null` because that time was never recorded. */
|
|
15001
15001
|
opening: components["schemas"]["OddsPair"] | null;
|
|
15002
|
-
/** @description Settled bouts only (`completed` / `no_contest`): the last point at or before the event start. Null until then. */
|
|
15002
|
+
/** @description Settled bouts only (`completed` / `no_contest`): the last point at or before the start of the bout's own card section (main card, prelims or early prelims; the event start when that time is not known). Null until then. */
|
|
15003
15003
|
closing: components["schemas"]["OddsPair"] | null;
|
|
15004
15004
|
movement: components["schemas"]["OddsMovement"] | null;
|
|
15005
15005
|
/** @description Stored consensus points (0 = never priced). The full series is `/v1/fights/{id}/odds/history` (Pro+). */
|
|
@@ -15028,9 +15028,9 @@ interface components {
|
|
|
15028
15028
|
} | null;
|
|
15029
15029
|
/** @description The current consensus line: the latest point while the bout is upcoming, the closing line once it is settled (a finished bout never reports a post-bell price). Null when the bout was never priced. */
|
|
15030
15030
|
consensus: components["schemas"]["OddsPair"] | null;
|
|
15031
|
-
/** @description The first consensus point we recorded. */
|
|
15031
|
+
/** @description The opening line. On a bout tracked point by point: the first consensus point we recorded. On a settled bout from the archive that stores only its closing point (`points: 1`): the mean of each sportsbook's own opening price, with `recorded_at: null` because that time was never recorded. */
|
|
15032
15032
|
opening: components["schemas"]["OddsPair"] | null;
|
|
15033
|
-
/** @description Settled bouts only (`completed` / `no_contest`): the last point at or before the event start. Null until then. */
|
|
15033
|
+
/** @description Settled bouts only (`completed` / `no_contest`): the last point at or before the start of the bout's own card section (main card, prelims or early prelims; the event start when that time is not known). Null until then. */
|
|
15034
15034
|
closing: components["schemas"]["OddsPair"] | null;
|
|
15035
15035
|
movement: components["schemas"]["OddsMovement"] | null;
|
|
15036
15036
|
/** @description Stored consensus points (0 = never priced). The full series is `/v1/fights/{id}/odds/history` (Pro+). */
|
|
@@ -15065,9 +15065,9 @@ interface components {
|
|
|
15065
15065
|
sources: number;
|
|
15066
15066
|
/**
|
|
15067
15067
|
* Format: date-time
|
|
15068
|
-
* @description When this consensus point was recorded.
|
|
15068
|
+
* @description When this consensus point was recorded. Null only on an `opening` from the archive before point-by-point tracking, where the time the line opened was never recorded.
|
|
15069
15069
|
*/
|
|
15070
|
-
recorded_at: string;
|
|
15070
|
+
recorded_at: string | null;
|
|
15071
15071
|
};
|
|
15072
15072
|
/** @description A per-event change entry plus its event (`/v1/changes`). */
|
|
15073
15073
|
ChangeFeedEntry: {
|
package/dist/index.d.ts
CHANGED
|
@@ -2210,7 +2210,7 @@ declare class FightAPI {
|
|
|
2210
2210
|
|
|
2211
2211
|
/** Kept in lockstep with package.json and the User-Agent by
|
|
2212
2212
|
* `apps/api/src/surfaces.test.ts`. Bump all three together. */
|
|
2213
|
-
declare const VERSION = "0.10.
|
|
2213
|
+
declare const VERSION = "0.10.1";
|
|
2214
2214
|
|
|
2215
2215
|
/**
|
|
2216
2216
|
* This file was auto-generated by openapi-typescript.
|
|
@@ -3763,7 +3763,7 @@ interface paths {
|
|
|
3763
3763
|
};
|
|
3764
3764
|
/**
|
|
3765
3765
|
* Consensus odds for one card
|
|
3766
|
-
* @description The UFCalendar consensus line for every non-cancelled bout on one card, in card order: `fights[]`, each with `fight_id`, `status`, both corners (`fighter_a`, `fighter_b`: `id`, `slug`, `name`), `consensus` (the latest point; the closing line once the bout is settled), `opening` (the first point we recorded), `closing` (settled bouts only: the last point at or before the event start), `movement` (opening → consensus in implied-probability points on corner a, with the `direction` the market moved), `points` and `updated_at`. Every point is `a` / `b` (`american`, `decimal`, raw `implied_probability`), `favourite`, `fair_probability_a` (margin removed), `sources` (how many sportsbooks backed it) and `recorded_at`. A bout nobody has priced stays on the list with nulls and `points: 0`; `meta.priced` / `meta.unpriced` count both. `meta.checked_at` is when we last checked the market, whether or not the line moved. Consensus is the mean across the sportsbooks we track, refreshed every 30 minutes in the 48 hours before a card and every 2 hours otherwise; book identities are never exposed. Each bout also carries `props` — method of victory per corner, total rounds over/under per line and goes the distance (`FightProps`, or null), described on `/v1/fights/{id}/odds`. Information only, not betting advice. An unknown event 404s.
|
|
3766
|
+
* @description The UFCalendar consensus line for every non-cancelled bout on one card, in card order: `fights[]`, each with `fight_id`, `status`, both corners (`fighter_a`, `fighter_b`: `id`, `slug`, `name`), `consensus` (the latest point; the closing line once the bout is settled), `opening` (the first point we recorded; on a settled bout from the archive that stores only its closing point, the mean of each sportsbook's own opening price with `recorded_at: null`), `closing` (settled bouts only: the last point at or before the start of the bout's own card section, or the event start when that time is not known), `movement` (opening → consensus in implied-probability points on corner a, with the `direction` the market moved), `points` and `updated_at`. Every point is `a` / `b` (`american`, `decimal`, raw `implied_probability`), `favourite`, `fair_probability_a` (margin removed), `sources` (how many sportsbooks backed it) and `recorded_at`. A bout nobody has priced stays on the list with nulls and `points: 0`; `meta.priced` / `meta.unpriced` count both. `meta.checked_at` is when we last checked the market, whether or not the line moved. Consensus is the mean across the sportsbooks we track, refreshed every 30 minutes in the 48 hours before a card and every 2 hours otherwise; book identities are never exposed. Each bout also carries `props` — method of victory per corner, total rounds over/under per line and goes the distance (`FightProps`, or null), described on `/v1/fights/{id}/odds`. Information only, not betting advice. An unknown event 404s.
|
|
3767
3767
|
*/
|
|
3768
3768
|
get: {
|
|
3769
3769
|
parameters: {
|
|
@@ -5066,9 +5066,9 @@ interface paths {
|
|
|
5066
5066
|
};
|
|
5067
5067
|
/**
|
|
5068
5068
|
* Consensus odds for one bout
|
|
5069
|
-
* @description The UFCalendar consensus line for one bout: `consensus` (the latest point; the closing line once the bout is settled), `opening` (the first point we recorded), `closing` (settled bouts only, `completed` or `no_contest`: the last point at or before the event start; null until then), `movement` (opening → consensus: `delta_points_a` in implied-probability points on corner a, `direction` = the corner the market moved toward, `since`), `points` (stored points) and `updated_at` (when the line last moved). Every point is `a` / `b` (`american`, `decimal`, raw `implied_probability`), `favourite`, `fair_probability_a` (margin removed) and `sources` (how many sportsbooks backed it). Consensus is the mean across the sportsbooks we track, in decimal space; book identities are never exposed. `meta.checked_at` is when we last checked the market, whether or not the line moved; `meta.history` is the movement series (Pro+). A bout nobody priced answers 200 with nulls and `points: 0`; 404 is reserved for an unknown fight.
|
|
5069
|
+
* @description The UFCalendar consensus line for one bout: `consensus` (the latest point; the closing line once the bout is settled), `opening` (the first point we recorded; on a settled bout from the archive that stores only its closing point, the mean of each sportsbook's own opening price with `recorded_at: null`), `closing` (settled bouts only, `completed` or `no_contest`: the last point at or before the start of the bout's own card section (main card, prelims or early prelims), or the event start when that time is not known; null until then), `movement` (opening → consensus: `delta_points_a` in implied-probability points on corner a, `direction` = the corner the market moved toward, `since`), `points` (stored points) and `updated_at` (when the line last moved). Every point is `a` / `b` (`american`, `decimal`, raw `implied_probability`), `favourite`, `fair_probability_a` (margin removed) and `sources` (how many sportsbooks backed it). Consensus is the mean across the sportsbooks we track, in decimal space; book identities are never exposed. `meta.checked_at` is when we last checked the market, whether or not the line moved; `meta.history` is the movement series (Pro+). A bout nobody priced answers 200 with nulls and `points: 0`; 404 is reserved for an unknown fight.
|
|
5070
5070
|
*
|
|
5071
|
-
* `props` carries the prop markets (`FightProps`, or null when no sportsbooks price them): `method` (per corner `a` / `b`: `ko`, `sub`, `dec` — each `yes` / `no` prices, `fair_probability` = its share of all six outcomes when all six are priced, `sources`), `total_rounds` (over/under per rounds line, ascending) and `distance` (goes the distance yes / no). Same consensus rule as the moneyline (the sportsbook mean; prediction markets excluded, a book far from the rest dropped, two sportsbooks minimum); prices are recorded until the
|
|
5071
|
+
* `props` carries the prop markets (`FightProps`, or null when no sportsbooks price them): `method` (per corner `a` / `b`: `ko`, `sub`, `dec` — each `yes` / `no` prices, `fair_probability` = its share of all six outcomes when all six are priced, `sources`), `total_rounds` (over/under per rounds line, ascending) and `distance` (goes the distance yes / no). Same consensus rule as the moneyline (the sportsbook mean; prediction markets excluded, a book far from the rest dropped, two sportsbooks minimum); prices are recorded until the bout's own card section starts, so a settled bout carries its closing props (`closing: true`). Props for 2021-2025 were backfilled as one closing consensus per market, with `recorded_at` set to the event start: that time is approximate, not when the price was observed. Books post props in fight week. Information only, not betting advice.
|
|
5072
5072
|
*/
|
|
5073
5073
|
get: {
|
|
5074
5074
|
parameters: {
|
|
@@ -14900,9 +14900,9 @@ interface components {
|
|
|
14900
14900
|
sources: number;
|
|
14901
14901
|
/**
|
|
14902
14902
|
* Format: date-time
|
|
14903
|
-
* @description When this consensus point was recorded.
|
|
14903
|
+
* @description When this consensus point was recorded. Null only on an `opening` from the archive before point-by-point tracking, where the time the line opened was never recorded.
|
|
14904
14904
|
*/
|
|
14905
|
-
recorded_at: string;
|
|
14905
|
+
recorded_at: string | null;
|
|
14906
14906
|
};
|
|
14907
14907
|
OddsMovement: {
|
|
14908
14908
|
/** @description Implied-probability points on corner a, opening → consensus (2 places). Positive = the market moved toward a. */
|
|
@@ -14914,9 +14914,9 @@ interface components {
|
|
|
14914
14914
|
direction: "a" | "b" | null;
|
|
14915
14915
|
/**
|
|
14916
14916
|
* Format: date-time
|
|
14917
|
-
* @description When the opening point was recorded.
|
|
14917
|
+
* @description When the opening point was recorded; null when the opening comes from the archive and its time is unknown.
|
|
14918
14918
|
*/
|
|
14919
|
-
since: string;
|
|
14919
|
+
since: string | null;
|
|
14920
14920
|
};
|
|
14921
14921
|
/** @description One prop market's consensus price: the mean, in decimal space, across the sportsbooks we track, converted back to American. */
|
|
14922
14922
|
PropLine: {
|
|
@@ -14954,7 +14954,7 @@ interface components {
|
|
|
14954
14954
|
/** @description This corner wins by decision. */
|
|
14955
14955
|
dec: components["schemas"]["PropLine"] | null;
|
|
14956
14956
|
};
|
|
14957
|
-
/** @description Prop-market consensus for one bout. Prediction markets and exchanges are excluded and a book far from the rest is dropped; a market needs at least two sportsbooks. Prices are recorded until the event
|
|
14957
|
+
/** @description Prop-market consensus for one bout. Prediction markets and exchanges are excluded and a book far from the rest is dropped; a market needs at least two sportsbooks. Prices are recorded until the bout's own card section starts (the event start when that time is not known). Props for 2021-2025 were backfilled as one closing consensus per market (three sportsbooks minimum), stamped at the event start: treat that time as approximate. Information only, not betting advice. */
|
|
14958
14958
|
FightProps: {
|
|
14959
14959
|
/** @description Method of victory per corner (oriented to the bout's `fighter_a` / `fighter_b`). */
|
|
14960
14960
|
method: {
|
|
@@ -14965,7 +14965,7 @@ interface components {
|
|
|
14965
14965
|
total_rounds: components["schemas"]["PropTotalRounds"][];
|
|
14966
14966
|
/** @description The fight goes the distance (yes) or ends inside it (no). */
|
|
14967
14967
|
distance: components["schemas"]["PropLine"] | null;
|
|
14968
|
-
/** @description True once the bout is settled: every price is the last
|
|
14968
|
+
/** @description True once the bout is settled: every price is the closing price. On bouts recorded live (2026 onward) that is the last price before the bout's own card section started, with its real timestamp; on bouts from 2021-2025 it was backfilled, and `recorded_at` is the event start, not the moment the price was observed. */
|
|
14969
14969
|
closing: boolean;
|
|
14970
14970
|
/**
|
|
14971
14971
|
* Format: date-time
|
|
@@ -14997,9 +14997,9 @@ interface components {
|
|
|
14997
14997
|
} | null;
|
|
14998
14998
|
/** @description The current consensus line: the latest point while the bout is upcoming, the closing line once it is settled (a finished bout never reports a post-bell price). Null when the bout was never priced. */
|
|
14999
14999
|
consensus: components["schemas"]["OddsPair"] | null;
|
|
15000
|
-
/** @description The first consensus point we recorded. */
|
|
15000
|
+
/** @description The opening line. On a bout tracked point by point: the first consensus point we recorded. On a settled bout from the archive that stores only its closing point (`points: 1`): the mean of each sportsbook's own opening price, with `recorded_at: null` because that time was never recorded. */
|
|
15001
15001
|
opening: components["schemas"]["OddsPair"] | null;
|
|
15002
|
-
/** @description Settled bouts only (`completed` / `no_contest`): the last point at or before the event start. Null until then. */
|
|
15002
|
+
/** @description Settled bouts only (`completed` / `no_contest`): the last point at or before the start of the bout's own card section (main card, prelims or early prelims; the event start when that time is not known). Null until then. */
|
|
15003
15003
|
closing: components["schemas"]["OddsPair"] | null;
|
|
15004
15004
|
movement: components["schemas"]["OddsMovement"] | null;
|
|
15005
15005
|
/** @description Stored consensus points (0 = never priced). The full series is `/v1/fights/{id}/odds/history` (Pro+). */
|
|
@@ -15028,9 +15028,9 @@ interface components {
|
|
|
15028
15028
|
} | null;
|
|
15029
15029
|
/** @description The current consensus line: the latest point while the bout is upcoming, the closing line once it is settled (a finished bout never reports a post-bell price). Null when the bout was never priced. */
|
|
15030
15030
|
consensus: components["schemas"]["OddsPair"] | null;
|
|
15031
|
-
/** @description The first consensus point we recorded. */
|
|
15031
|
+
/** @description The opening line. On a bout tracked point by point: the first consensus point we recorded. On a settled bout from the archive that stores only its closing point (`points: 1`): the mean of each sportsbook's own opening price, with `recorded_at: null` because that time was never recorded. */
|
|
15032
15032
|
opening: components["schemas"]["OddsPair"] | null;
|
|
15033
|
-
/** @description Settled bouts only (`completed` / `no_contest`): the last point at or before the event start. Null until then. */
|
|
15033
|
+
/** @description Settled bouts only (`completed` / `no_contest`): the last point at or before the start of the bout's own card section (main card, prelims or early prelims; the event start when that time is not known). Null until then. */
|
|
15034
15034
|
closing: components["schemas"]["OddsPair"] | null;
|
|
15035
15035
|
movement: components["schemas"]["OddsMovement"] | null;
|
|
15036
15036
|
/** @description Stored consensus points (0 = never priced). The full series is `/v1/fights/{id}/odds/history` (Pro+). */
|
|
@@ -15065,9 +15065,9 @@ interface components {
|
|
|
15065
15065
|
sources: number;
|
|
15066
15066
|
/**
|
|
15067
15067
|
* Format: date-time
|
|
15068
|
-
* @description When this consensus point was recorded.
|
|
15068
|
+
* @description When this consensus point was recorded. Null only on an `opening` from the archive before point-by-point tracking, where the time the line opened was never recorded.
|
|
15069
15069
|
*/
|
|
15070
|
-
recorded_at: string;
|
|
15070
|
+
recorded_at: string | null;
|
|
15071
15071
|
};
|
|
15072
15072
|
/** @description A per-event change entry plus its event (`/v1/changes`). */
|
|
15073
15073
|
ChangeFeedEntry: {
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version.ts","../src/client.ts"],"sourcesContent":["/** Kept in lockstep with package.json and the User-Agent by\n * `apps/api/src/surfaces.test.ts`. Bump all three together. */\nexport const VERSION = '0.10.0';\n","/**\n * Thin, dependency-free client for https://api.ufcalendar.com/v1.\n *\n * Every method returns the parsed `data` value of the JSON envelope\n * (`{\"data\": ..., \"meta\": ...}`); list endpoints are async generators that\n * follow cursor pagination for you. Errors throw `FightAPIError` carrying\n * the API's `code`, `message` and `requestId` — quote the request id when\n * you write to api@ufcalendar.com.\n *\n * Mirrors sdk/python/ufcalendar/client.py one method per endpoint, in\n * camelCase. The two clients are kept in lockstep by\n * `apps/api/src/surfaces.test.ts`.\n *\n * Odds are the UFCalendar consensus line: one anonymised line per corner\n * across the sportsbooks we track (`sources` = how many books backed each\n * point; book identities are never exposed). Information only, not betting\n * advice. Fighter `images` are Wikimedia\n * Commons / Creative Commons files — the `license` and `artist` fields you\n * receive must be displayed as a credit.\n */\nimport { VERSION } from './version';\nimport type {\n Article,\n FightPositions,\n FightStatLine,\n FightTimeline,\n FighterDiscipline,\n FighterPositions,\n OrgCoverage,\n Referee,\n RefereeFightRow,\n ArticleLocale,\n ArticleSummary,\n EventPickem,\n EventOdds,\n FightInclude,\n FightOdds,\n OddsHistoryPoint,\n Compare,\n Matchup,\n WhosNext,\n EventStorylines,\n YearStats,\n EventWatch,\n OrgDivision,\n LeaderboardRow,\n RecordBookSection,\n StatScope,\n RightsSeries,\n SplitDecisionRow,\n ChangeFeedEntry,\n ChangeKind,\n FightSearchMethod,\n FightSearchRow,\n BroadcastRight,\n CareerBout,\n CareerStats,\n Champion,\n EventInclude,\n EventListInclude,\n JudgeScorecardRow,\n PowerIndexMover,\n PowerIndexRow,\n PowerIndexView,\n Envelope,\n EventChange,\n EventDetail,\n EventSummary,\n Fight,\n Fighter,\n FighterInclude,\n FighterSummary,\n Judge,\n Meta,\n Org,\n Plans,\n PowerIndex,\n RankingsBoard,\n RateLimit,\n Scorecards,\n Usage,\n Venue,\n WebhookEndpoint,\n} from './types';\n\nexport const DEFAULT_BASE_URL = 'https://api.ufcalendar.com/v1';\nconst DEFAULT_TIMEOUT_MS = 30_000;\n/** Default number of times a GET that hit the per-minute limit is retried. */\nexport const DEFAULT_MAX_RETRIES = 3;\n/**\n * A 429 whose `Retry-After` is longer than this is not waited out: the\n * per-minute limit always resets within a minute, anything longer is the\n * monthly quota (or something we do not understand) and must surface.\n */\nexport const MAX_RETRY_AFTER_SECONDS = 60;\nconst RETRY_JITTER_MS = 500;\n\nexport interface FightAPIOptions {\n /** `ufcalendar_…` key from https://www.ufcalendar.com/account/api. Falls back\n * to `UFCALENDAR_API_KEY` / `UFCAL_API_KEY` in the environment. Only\n * `plans()` works without one. */\n apiKey?: string;\n /** Override for testing; defaults to the production `/v1`. */\n baseUrl?: string;\n /** Inject a fetch (a test double, an instrumented fetch, undici). */\n fetch?: typeof fetch;\n /** Per-request timeout. Default 30s. */\n timeoutMs?: number;\n /** Extra headers on every request. */\n headers?: Record<string, string>;\n /**\n * How many times a GET that hit the per-minute limit (429 `rate_limited`\n * with `Retry-After` ≤ 60 s) is retried after waiting `Retry-After` plus a\n * little jitter. Default 3; `0` disables. The monthly quota\n * (`quota_exceeded`) and non-GET requests always throw at once.\n */\n maxRetries?: number;\n /** Replace the wait between rate-limit retries (tests, custom schedulers). */\n sleep?: (ms: number) => Promise<void>;\n}\n\n/** An error response from the Fight API. */\nexport class FightAPIError extends Error {\n readonly status: number;\n readonly code: string;\n readonly requestId: string | null;\n\n constructor(status: number, code: string, message: string, requestId: string | null = null) {\n super(`${status} ${code}: ${message}${requestId ? ` (request_id=${requestId})` : ''}`);\n this.name = 'FightAPIError';\n this.status = status;\n this.code = code;\n this.requestId = requestId;\n }\n}\n\nexport type QueryValue = string | number | boolean | null | undefined;\nexport type Query = Record<string, QueryValue>;\n\ninterface PageOptions {\n /** Stop after this many rows (across pages). */\n limit?: number;\n}\n\n/**\n * A browser forbids setting User-Agent on fetch, so we only set ours\n * off-browser. The test is `document`, NOT `navigator`: Node 21+ ships a\n * global `navigator`, so a navigator check would silently drop the header\n * on every modern Node runtime — which is the one place it works.\n */\nfunction canSetUserAgent(): boolean {\n return typeof document === 'undefined' && typeof window === 'undefined';\n}\n\n/** `Retry-After` as seconds: delta-seconds or an HTTP date; null if absent/unparseable. */\nfunction retryAfterSeconds(value: string | null): number | null {\n if (value === null) return null;\n const v = value.trim();\n if (v === '') return null;\n let secs = Number(v);\n if (!Number.isFinite(secs)) {\n const when = Date.parse(v);\n if (!Number.isFinite(when)) return null;\n secs = (when - Date.now()) / 1000;\n }\n return Math.max(0, secs);\n}\n\n/**\n * Seconds to wait before retrying a 429, or null when it must not be retried.\n * Only the per-minute limit (`rate_limited`) is waited out. The monthly quota\n * (`quota_exceeded`) throws at once — near the end of a month its\n * `Retry-After` can be short, so the code is checked, not just the header.\n */\nfunction shortRateLimitWait(res: Response, code: string | undefined): number | null {\n if (code === 'quota_exceeded') return null;\n const secs = retryAfterSeconds(res.headers.get('Retry-After'));\n if (secs === null || secs > MAX_RETRY_AFTER_SECONDS) return null;\n return secs;\n}\n\nconst defaultSleep = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms));\n\nfunction envKey(): string | undefined {\n const env = (globalThis as { process?: { env?: Record<string, string | undefined> } }).process?.env;\n return env?.UFCALENDAR_API_KEY || env?.UFCAL_API_KEY;\n}\n\nexport class FightAPI {\n readonly baseUrl: string;\n readonly apiKey: string | undefined;\n /** Retries of a GET that hit the per-minute limit (see `FightAPIOptions.maxRetries`). */\n readonly maxRetries: number;\n\n /** `meta` of the most recent response (pagination cursor, generated_at …). */\n lastMeta: Meta | null = null;\n /** `X-RateLimit-*` of the most recent response. */\n lastRateLimit: RateLimit = { limit: null, remaining: null, reset: null };\n\n readonly #fetch: typeof fetch;\n readonly #timeoutMs: number;\n readonly #headers: Record<string, string>;\n readonly #sleep: (ms: number) => Promise<void>;\n\n constructor(apiKeyOrOptions?: string | FightAPIOptions, options: FightAPIOptions = {}) {\n const opts: FightAPIOptions =\n typeof apiKeyOrOptions === 'string'\n ? { ...options, apiKey: apiKeyOrOptions }\n : { ...options, ...(apiKeyOrOptions ?? {}) };\n this.apiKey = opts.apiKey ?? envKey();\n this.baseUrl = (opts.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, '');\n this.#fetch = opts.fetch ?? globalThis.fetch;\n this.#timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n this.#headers = opts.headers ?? {};\n this.#sleep = opts.sleep ?? defaultSleep;\n const maxRetries = opts.maxRetries ?? DEFAULT_MAX_RETRIES;\n if (!Number.isInteger(maxRetries) || maxRetries < 0) {\n throw new RangeError('maxRetries must be a non-negative integer');\n }\n this.maxRetries = maxRetries;\n if (!this.#fetch) {\n throw new Error('No global fetch available. Use Node 18+ or pass { fetch }.');\n }\n }\n\n /* ---------------------------------------------------------------- core */\n\n #url(path: string, params?: Query): string {\n const url = new URL(`${this.baseUrl}/${path.replace(/^\\/+/, '')}`);\n for (const [k, v] of Object.entries(params ?? {})) {\n if (v === undefined || v === null) continue;\n url.searchParams.set(k, String(v));\n }\n return url.toString();\n }\n\n async #request<T>(\n method: string,\n path: string,\n { params, body, open = false }: { params?: Query; body?: unknown; open?: boolean } = {},\n ): Promise<Envelope<T>> {\n if (!this.apiKey && !open) {\n throw new FightAPIError(\n 401,\n 'no_api_key',\n 'No API key. Pass new FightAPI(\"ufcalendar_...\") or set UFCALENDAR_API_KEY. ' +\n 'Keys (free plan: 100 requests/month, no card) live at https://www.ufcalendar.com/account/api',\n );\n }\n const headers: Record<string, string> = { Accept: 'application/json', ...this.#headers };\n if (this.apiKey) headers.Authorization = `Bearer ${this.apiKey}`;\n if (canSetUserAgent()) headers['User-Agent'] = `ufcalendar-typescript/${VERSION}`;\n if (body !== undefined) headers['Content-Type'] = 'application/json';\n\n const url = this.#url(path, params);\n let res: Response;\n let text: string;\n let parsed: unknown;\n for (let attempt = 0; ; attempt += 1) {\n try {\n res = await this.#fetch(url, {\n method,\n headers,\n body: body === undefined ? undefined : JSON.stringify(body),\n signal: AbortSignal.timeout(this.#timeoutMs),\n });\n } catch (e) {\n const err = e as { name?: string; message?: string };\n if (err?.name === 'TimeoutError') {\n throw new FightAPIError(0, 'timeout', `Request to ${path} timed out after ${this.#timeoutMs}ms`);\n }\n throw new FightAPIError(0, 'network_error', err?.message ?? String(e));\n }\n\n this.lastRateLimit = {\n limit: res.headers.get('X-RateLimit-Limit'),\n remaining: res.headers.get('X-RateLimit-Remaining'),\n reset: res.headers.get('X-RateLimit-Reset'),\n };\n\n if (res.status === 204) {\n this.lastMeta = null;\n return { data: undefined as T };\n }\n\n text = await res.text();\n parsed = undefined;\n try {\n parsed = text ? JSON.parse(text) : undefined;\n } catch {\n parsed = undefined;\n }\n\n // Wait out the per-minute limit on reads (a 429'd request is not\n // counted against the month). Writes are never replayed.\n if (res.status === 429 && method.toUpperCase() === 'GET' && attempt < this.maxRetries) {\n const code = (parsed as { error?: { code?: string } } | undefined)?.error?.code;\n const wait = shortRateLimitWait(res, code);\n if (wait !== null) {\n await this.#sleep(wait * 1000 + Math.random() * RETRY_JITTER_MS);\n continue;\n }\n }\n break;\n }\n\n if (!res.ok) {\n const err = (parsed as { error?: { code?: string; message?: string; request_id?: string } } | undefined)?.error;\n if (err) {\n throw new FightAPIError(\n res.status,\n String(err.code ?? 'error'),\n String(err.message ?? text.slice(0, 200)),\n err.request_id ?? res.headers.get('x-request-id'),\n );\n }\n throw new FightAPIError(res.status, 'http_error', text.slice(0, 200), res.headers.get('x-request-id'));\n }\n\n const env = (parsed ?? {}) as Envelope<T>;\n this.lastMeta = env.meta ?? null;\n return env;\n }\n\n /** Raw GET returning the `data` value. Escape hatch for new endpoints. */\n async get<T = unknown>(path: string, params?: Query): Promise<T> {\n return (await this.#request<T>('GET', path, { params })).data;\n }\n\n /** Raw GET returning the whole `{data, meta}` envelope. */\n async getWithMeta<T = unknown>(path: string, params?: Query): Promise<Envelope<T>> {\n return this.#request<T>('GET', path, { params });\n }\n\n async *#paginate<T>(path: string, params: Query, opts: PageOptions = {}): AsyncGenerator<T, void, void> {\n // Never fetch a bigger page than the caller wants rows: `limit: 3` used\n // to pull 100 rows and throw 97 away, burning the caller's quota on a\n // request they did not ask for (and, on a trial key, a noticeable slice\n // of the 100 they get).\n const pageSize = Math.min(100, opts.limit ?? 100);\n const query: Query = { limit: pageSize, ...params };\n let seen = 0;\n for (;;) {\n const env = await this.#request<T[]>('GET', path, { params: query });\n for (const row of env.data ?? []) {\n yield row;\n seen += 1;\n if (opts.limit !== undefined && seen >= opts.limit) return;\n }\n const cursor = env.meta?.pagination?.next_cursor;\n if (!cursor) return;\n query.cursor = cursor;\n }\n }\n\n /* --------------------------------------------------------------- plans */\n\n /**\n * Plans (Free first), quotas, the free-plan rule, the MCP endpoint and the doc\n * links. The only endpoint that answers without a credential.\n */\n async plans(): Promise<Plans> {\n return (await this.#request<Plans>('GET', 'plans', { open: true })).data;\n }\n\n /* ---------------------------------------------------------------- orgs */\n\n /** Launch orgs with capability flags (stats / rounds / rankings / broadcasts / predictions / scorecards / odds). */\n orgs(): Promise<Org[]> {\n return this.get<Org[]>('orgs');\n }\n\n org(slug: string): Promise<Org> {\n return this.get<Org>(`orgs/${encodeURIComponent(slug)}`);\n }\n\n /**\n * One weight class in one promotion: its rankings board (null where the\n * promotion publishes none), upcoming bouts at that weight, the latest\n * results and the roster by recency. `division` is a slug, e.g.\n * `lightweight` or `womens-strawweight`.\n */\n orgDivision(org: string, division: string): Promise<OrgDivision> {\n return this.get<OrgDivision>(`orgs/${encodeURIComponent(org)}/divisions/${encodeURIComponent(division)}`);\n }\n\n /* -------------------------------------------------------------- events */\n\n /**\n * Schedule + results. Bare call = the upcoming calendar, soonest first.\n * `status: 'completed'` (or `order: 'desc'`) browses the archive\n * newest-first; `status: 'upcoming'` = every card not yet over (announced,\n * scheduled or live). `from` / `to` are `YYYY-MM-DD`.\n */\n events(\n opts: {\n org?: string;\n status?: string;\n from?: string;\n to?: string;\n order?: 'asc' | 'desc';\n /** Only cards with (true) / without (false) a title bout. */\n isTitleCard?: boolean;\n /** Only PPV (true) / non-PPV (false) cards. */\n isPpv?: boolean;\n /** `headline` adds each card's main event. */\n include?: EventListInclude[];\n limit?: number;\n } = {},\n ): AsyncGenerator<EventSummary, void, void> {\n const { limit, isTitleCard, isPpv, include, ...params } = opts;\n return this.#paginate<EventSummary>('events', {\n ...params,\n is_title_card: isTitleCard,\n is_ppv: isPpv,\n include: include?.length ? include.join(',') : undefined,\n } as Query, { limit });\n }\n\n /**\n * One event with its full fight card, venue and broadcasts.\n * `include: ['eta']` adds an estimated start time to every bout;\n * `include: ['odds']` adds each bout's current consensus line (the closing line once settled) (null when\n * unpriced). Pass both as `['eta', 'odds']`.\n */\n event(idOrSlug: string | number, opts: { include?: EventInclude[] } = {}): Promise<EventDetail> {\n return this.get<EventDetail>(\n `events/${encodeURIComponent(String(idOrSlug))}`,\n opts.include?.length ? { include: opts.include.join(',') } : undefined,\n );\n }\n\n /**\n * Who airs one event, per country: the promotion's rights deals for the\n * event's series merged with the event's own listings. `country` (ISO-2)\n * narrows to that market plus worldwide.\n */\n eventWatch(idOrSlug: string | number, opts: { country?: string } = {}): Promise<EventWatch> {\n return this.get<EventWatch>(`events/${encodeURIComponent(String(idOrSlug))}/watch`, opts as Query);\n }\n\n /**\n * The talking points of one card as of its start: title fights and\n * eliminators, the closest bout (UFCalendar model, else Power Index — not\n * betting advice), rematches and trilogy deciders, streaks, debuts and\n * returns, ranked fighters, nations, tallest / longest reach, the fastest\n * career finish.\n */\n eventStorylines(idOrSlug: string | number): Promise<EventStorylines> {\n return this.get<EventStorylines>(`events/${encodeURIComponent(String(idOrSlug))}/storylines`);\n }\n\n /**\n * How the UFCalendar community is picking each bout on one card: picks per\n * corner, the total and `pct_a`, in card order. Crowd sentiment from our\n * own pick'em game, not a market and not a forecast.\n */\n eventPickem(idOrSlug: string | number): Promise<EventPickem> {\n return this.get<EventPickem>(`events/${encodeURIComponent(String(idOrSlug))}/pickem`);\n }\n\n /**\n * The UFCalendar consensus odds for every non-cancelled bout on one card, in\n * card order: `consensus`, `opening`, `closing` (settled bouts), `movement`\n * and `points`. Unpriced bouts stay on the list with nulls and `points: 0`;\n * `lastMeta.priced` / `lastMeta.unpriced` count both. Information only, not\n * betting advice.\n */\n eventOdds(idOrSlug: string | number): Promise<EventOdds> {\n return this.get<EventOdds>(`events/${encodeURIComponent(String(idOrSlug))}/odds`);\n }\n\n /** Card-change diff log (fight added/removed, opponent swapped, date moved, profile merged). */\n eventChanges(idOrSlug: string | number): Promise<EventChange[]> {\n return this.get<EventChange[]>(`events/${encodeURIComponent(String(idOrSlug))}/changes`);\n }\n\n /**\n * The card-change feed across every event, newest first (default: the last\n * 90 days) — the `card.changed` webhook's audit trail, for callers that\n * poll. `since` is `YYYY-MM-DD` or an ISO-8601 datetime.\n */\n changes(\n opts: { org?: string; since?: string; kind?: ChangeKind; limit?: number } = {},\n ): AsyncGenerator<ChangeFeedEntry, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<ChangeFeedEntry>('changes', params as Query, { limit });\n }\n\n /* -------------------------------------------------------------- fights */\n\n /** One bout with its result. `include: ['odds']` adds the current consensus line (the closing line once the bout is settled). */\n fight(fightId: number | string, opts: { include?: FightInclude[] } = {}): Promise<Fight> {\n return this.get<Fight>(\n `fights/${encodeURIComponent(String(fightId))}`,\n opts.include?.length ? { include: opts.include.join(',') } : undefined,\n );\n }\n\n /**\n * The UFCalendar consensus line for one bout: `consensus` (latest point; the closing line once settled),\n * `opening`, `closing` (the last point at or before the event start,\n * settled bouts only), `movement` (opening → consensus in implied-probability\n * points on corner a) and `sources` on every point (how many sportsbooks\n * backed it; book identities are never exposed). An unpriced bout resolves\n * with null blocks and `points: 0`. Information only, not betting advice.\n */\n fightOdds(fightId: number | string): Promise<FightOdds> {\n return this.get<FightOdds>(`fights/${encodeURIComponent(String(fightId))}/odds`);\n }\n\n /**\n * Every consensus point for one bout, oldest first (Pro plans and up; a\n * lower plan throws `FightAPIError` 403 `tier_required`). A point is stored\n * only when the consensus moves. `from` / `to` are inclusive `YYYY-MM-DD`.\n */\n fightOddsHistory(\n fightId: number | string,\n opts: { from?: string; to?: string; limit?: number } = {},\n ): AsyncGenerator<OddsHistoryPoint, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<OddsHistoryPoint>(\n `fights/${encodeURIComponent(String(fightId))}/odds/history`,\n params as Query,\n { limit },\n );\n }\n\n /**\n * Per-fight totals for both corners, each with `fantasy` — UFCalendar\n * fantasy points with a per-category breakdown and `complete`. The\n * data-quality flags ride in `lastMeta.quality` (`StatsQuality`).\n */\n fightStats(fightId: number | string): Promise<FightStatLine[]> {\n return this.get<FightStatLine[]>(`fights/${encodeURIComponent(String(fightId))}/stats`);\n }\n\n /** Round-by-round stat lines for both corners. */\n fightRounds(fightId: number | string): Promise<Record<string, unknown>[]> {\n return this.get<Record<string, unknown>[]>(`fights/${encodeURIComponent(String(fightId))}/rounds`);\n }\n\n /**\n * The judges' scorecards for a bout — the official commission record:\n * decision type, point deductions, and one card per judge with every\n * round, the totals and `winner_fighter_id`. Scores are oriented to\n * `fighter_a_id` / `fighter_b_id`, both repeated on the payload.\n *\n * Check `scores_known` on a card before charting totals: when it is false\n * the commission published only the outcome. Throws 404 for a bout that\n * did not go to the judges.\n */\n fightScorecards(fightId: number | string): Promise<Scorecards> {\n return this.get<Scorecards>(`fights/${encodeURIComponent(String(fightId))}/scorecards`);\n }\n\n /**\n * The official in-fight log of one settled UFC bout (Pro plans and up; a\n * lower plan throws `FightAPIError` 403 `tier_required`): every logged\n * action in order, the referee stoppages paired with their reason and\n * real length, and every confirmed foul of the bout.\n *\n * The log labels only two fouls, the eye poke and the low blow. Any other\n * foul (an illegal knee to a grounded opponent, an upkick, a headbutt, a\n * bite, a fence grab) reaches it as a `generic` stoppage naming nobody, so\n * a foul is reported only when a record confirms it (`foul_basis` /\n * `basis`): `log` (the labelled row), `deduction` (the athletic commission\n * took a point) or `result` (the bout ended on it: a disqualification or a\n * \"could not continue\"). On a stoppage, `is_foul` says whether a foul is\n * confirmed, `foul` what it was, `committed_by` who committed it (null\n * when no record names a fighter), `points_deducted` and `ended_bout`; a\n * `generic` stoppage with no record behind it has `is_foul: false`.\n * `incidents` lists every confirmed foul in fight order, including one\n * with no stoppage in the log; `fouls.a` / `fouls.b` count what each\n * corner committed (`eye_pokes`, `low_blows`, `other`, `total`,\n * `points_deducted`). A recorded foul is not a ruling on intent.\n *\n * Coverage: UFC bouts from June 2013, stoppage reasons\n * from 8 December 2018 (`lastMeta.has_stoppage_reasons`). A bout with no\n * log, or one not settled yet, resolves with empty lists and\n * `lastMeta.note`.\n */\n fightTimeline(fightId: number | string): Promise<FightTimeline> {\n return this.get<FightTimeline>(`fights/${encodeURIComponent(String(fightId))}/timeline`);\n }\n\n /**\n * Position stats of one settled UFC bout (Pro plans and up): where it was\n * fought (`time`, shared by both fighters), each fighter's `control` by\n * position, and strikes by position and target — `totals` for the whole\n * bout, `rounds` per round. `null` means not tracked for that bout; `0`\n * is a real zero. Tracked reliably from 2007.\n */\n fightPositions(fightId: number | string): Promise<FightPositions> {\n return this.get<FightPositions>(`fights/${encodeURIComponent(String(fightId))}/positions`);\n }\n\n /**\n * Completed bouts, filtered — newest first unless `order: 'oldest'`. At\n * least one narrowing filter is required (`titleOnly`, `method`,\n * `division`, `fighter`, `winner`, `from`, `to`, `mainEventsOnly`); the\n * server serves 25 rows a page and at most 10 pages.\n */\n findFights(\n opts: {\n org?: string;\n titleOnly?: boolean;\n method?: FightSearchMethod;\n /** Division slug (`lightweight`) or a name fragment. */\n division?: string;\n /** Fighter slug or id — bouts they were in. */\n fighter?: string | number;\n /** Fighter slug or id — bouts they won. */\n winner?: string | number;\n from?: string;\n to?: string;\n mainEventsOnly?: boolean;\n order?: 'newest' | 'oldest';\n limit?: number;\n } = {},\n ): AsyncGenerator<FightSearchRow, void, void> {\n const { limit, titleOnly, mainEventsOnly, fighter, winner, ...rest } = opts;\n return this.#paginate<FightSearchRow>('fights/search', {\n ...rest,\n title_only: titleOnly,\n main_events_only: mainEventsOnly,\n fighter: fighter === undefined ? undefined : String(fighter),\n winner: winner === undefined ? undefined : String(winner),\n } as Query, { limit });\n }\n\n /* -------------------------------------------------------------- judges */\n\n /**\n * Every official who has scored a launch-org bout, busiest first. Rates\n * mean little below ~10 fights; pass `minFights: 10`.\n */\n judges(\n opts: { q?: string; org?: string; minFights?: number; limit?: number } = {},\n ): AsyncGenerator<Judge, void, void> {\n const { limit, minFights, ...rest } = opts;\n return this.#paginate<Judge>('judges', { ...rest, min_fights: minFights } as Query, { limit });\n }\n\n judge(judgeId: number | string): Promise<Judge> {\n return this.get<Judge>(`judges/${encodeURIComponent(String(judgeId))}`);\n }\n\n /**\n * Split and majority decisions, newest first, with every judge's card and\n * the dissenting judges named. Commission records only.\n */\n splitDecisions(\n opts: { org?: string; from?: string; to?: string; limit?: number } = {},\n ): AsyncGenerator<SplitDecisionRow, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<SplitDecisionRow>('scorecards/splits', params as Query, { limit });\n }\n\n /**\n * Every card this judge has turned in, newest first, with `lone_dissent`,\n * `split` and the `colleagues`' totals on each row.\n */\n judgeScorecards(\n judgeId: number | string,\n opts: { limit?: number } = {},\n ): AsyncGenerator<JudgeScorecardRow, void, void> {\n return this.#paginate<JudgeScorecardRow>(\n `judges/${encodeURIComponent(String(judgeId))}/scorecards`,\n {},\n opts,\n );\n }\n\n /* ------------------------------------------------------------ referees */\n\n /**\n * Every referee who has worked a settled launch-org bout, busiest first:\n * bouts, promotions, finish rate, method mix and average fight time. The\n * id is a slug of the name; `q` is accent- and spacing-insensitive.\n */\n referees(opts: { q?: string; org?: string; limit?: number } = {}): AsyncGenerator<Referee, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<Referee>('referees', params as Query, { limit });\n }\n\n /** One referee's career aggregates, e.g. `referee('herb-dean')`. */\n referee(slug: string): Promise<Referee> {\n return this.get<Referee>(`referees/${encodeURIComponent(slug)}`);\n }\n\n /** Every settled bout one referee worked, newest first (the bout plus its `event`). */\n refereeFights(slug: string, opts: { limit?: number } = {}): AsyncGenerator<RefereeFightRow, void, void> {\n return this.#paginate<RefereeFightRow>(`referees/${encodeURIComponent(slug)}/fights`, {}, opts);\n }\n\n /* ------------------------------------------------------------ coverage */\n\n /**\n * What the database holds per launch org per year: events, settled bouts\n * and how many carry stats, round stats, commission scorecards and a\n * consensus odds line, with `totals` and `last_result_at`.\n */\n coverage(opts: { org?: string } = {}): Promise<OrgCoverage[]> {\n return this.get<OrgCoverage[]>('coverage', opts.org ? { org: opts.org } : undefined);\n }\n\n /* ------------------------------------------------------------ fighters */\n\n fighters(\n opts: { q?: string; org?: string; country?: string; limit?: number } = {},\n ): AsyncGenerator<FighterSummary, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<FighterSummary>('fighters', params as Query, { limit });\n }\n\n /**\n * Bio, records, career stats, Power Index, CC-licensed images, `next_fight`\n * and `last_fight`. `include: ['bonuses']` adds the UFC bonus ledger;\n * `include: ['credentials']` adds grappling and wrestling pedigree, gyms and\n * coaches (every row with `sources` and a `confidence` grade).\n */\n fighter(idOrSlug: string | number, opts: { include?: FighterInclude[] } = {}): Promise<Fighter> {\n return this.get<Fighter>(\n `fighters/${encodeURIComponent(String(idOrSlug))}`,\n opts.include?.length ? { include: opts.include.join(',') } : undefined,\n );\n }\n\n /** Complete multi-promotion career timeline. */\n fighterHistory(idOrSlug: string | number): Promise<CareerBout[]> {\n return this.get<CareerBout[]>(`fighters/${encodeURIComponent(String(idOrSlug))}/history`);\n }\n\n /** Raw career stat rows, one source-stamped row per scope (`pro-mma`, `ufc-only` …).\n * For the readable split use `fighter().records` / `fighter().stats`. */\n fighterStats(idOrSlug: string | number): Promise<CareerStats[]> {\n return this.get<CareerStats[]>(`fighters/${encodeURIComponent(String(idOrSlug))}/stats`);\n }\n\n /** Every ranking row the fighter ever held, newest first, across every board\n * (`board` is `official` / `meta`; `is_champion` when rank 0). The endpoint is\n * cursor-paginated since 2026-09-24 — this walks every page so the array is\n * complete (a long career is 900+ rows). */\n async fighterRankings(idOrSlug: string | number): Promise<Record<string, unknown>[]> {\n const out: Record<string, unknown>[] = [];\n for await (const row of this.#paginate<Record<string, unknown>>(\n `fighters/${encodeURIComponent(String(idOrSlug))}/rankings`, { limit: 500 } as Query)) out.push(row);\n return out;\n }\n\n fighterPowerIndex(idOrSlug: string | number): Promise<PowerIndex & Record<string, unknown>> {\n return this.get<PowerIndex & Record<string, unknown>>(\n `fighters/${encodeURIComponent(String(idOrSlug))}/power-index`,\n );\n }\n\n /**\n * The confirmed fouls in a fighter's UFC bouts since 8 December 2018 (Pro\n * plans and up), committed and drawn: eye pokes and low blows from the\n * official in-fight log, plus any other foul (an illegal knee to a\n * grounded opponent, an upkick, a headbutt, a bite, a fence grab)\n * confirmed by the athletic commission's point deduction or by the\n * official result. `committed` / `drawn` count `total`, `eye_pokes`,\n * `low_blows` and `other`; `points_deducted` is what the commission has\n * taken from this fighter; `incidents` lists every confirmed foul, most\n * recent first, with `reason` (the foul), `basis` (`log`, `deduction` or\n * `result`), `points_deducted` and `ended_bout`. A `generic` stoppage with\n * no record behind it is never counted. A recorded foul is not a ruling on\n * intent. Resolves `null` (with `lastMeta.note`) under 3 tracked bouts\n * with no recorded foul.\n */\n fighterDiscipline(idOrSlug: string | number): Promise<FighterDiscipline | null> {\n return this.get<FighterDiscipline | null>(`fighters/${encodeURIComponent(String(idOrSlug))}/discipline`);\n }\n\n /**\n * A fighter's career position profile (Pro plans and up): the share of\n * cage time at distance, in the clinch and on the ground, and control\n * seconds for and against by position. Resolves `null` (with\n * `lastMeta.note`) under 3 bouts with tracked positions.\n */\n fighterPositions(idOrSlug: string | number): Promise<FighterPositions | null> {\n return this.get<FighterPositions | null>(`fighters/${encodeURIComponent(String(idOrSlug))}/positions`);\n }\n\n /**\n * Two fighters side by side (slugs or ids): bios with age, career stats,\n * strike mix, win streaks, previous meetings, common opponents, the booked\n * bout between them, the UFCalendar model prediction for it (UFC; not\n * betting advice) and Power Index ratings.\n */\n compare(a: string | number, b: string | number): Promise<Compare> {\n return this.get<Compare>('compare', { a: String(a), b: String(b) });\n }\n\n /* ------------------------------------------------------------ rankings */\n\n /**\n * Official board, point-in-time. `date: 'YYYY-MM-DD'` returns the board\n * that was valid on that day (UFC history back to 2013; rank 0 = champion).\n */\n rankings(org = 'ufc', opts: { date?: string; board?: string } = {}): Promise<RankingsBoard> {\n return this.get<RankingsBoard>(`rankings/${encodeURIComponent(org)}`, opts as Query);\n }\n\n divisionRankings(org: string, division: string, opts: { date?: string } = {}): Promise<RankingsBoard> {\n return this.get<RankingsBoard>(\n `rankings/${encodeURIComponent(org)}/${encodeURIComponent(division)}`,\n opts as Query,\n );\n }\n\n /** Current champions across every launch org, or one `org` / `division`. */\n champions(opts: { org?: string; division?: string } = {}): Promise<Champion[]> {\n return this.get<Champion[]>('champions', opts);\n }\n\n /**\n * UFCalendar Power Index board. `view: 'movers'` = biggest risers over\n * `days` (default 365), `view: 'peaks'` = all-time peak ratings;\n * `division` narrows any view.\n */\n powerIndex(\n org = 'ufc',\n opts: { view?: PowerIndexView; division?: string; days?: number; limit?: number } = {},\n ): Promise<(PowerIndexRow | PowerIndexMover)[]> {\n return this.get<(PowerIndexRow | PowerIndexMover)[]>(`power-index/${encodeURIComponent(org)}`, {\n view: opts.view,\n division: opts.division,\n days: opts.days,\n limit: opts.limit,\n });\n }\n\n /* ---------------------------------------------------------- matchmaker */\n\n /**\n * UFCalendar's matchmaker: the fights worth making in one MMA promotion,\n * scored 0–100, across the roster or for one `division` (`lastMeta.divisions`\n * lists the valid ones). Not a list of bookings; computed without the\n * site's Fight DNA factor.\n */\n matchmaker(org = 'ufc', opts: { division?: string; limit?: number } = {}): Promise<Matchup[]> {\n return this.get<Matchup[]>(`matchmaker/${encodeURIComponent(org)}`, {\n division: opts.division,\n limit: opts.limit,\n });\n }\n\n /**\n * Who one fighter (slug or id) should fight next: the best-scored\n * opponents with the Power Index win probability for each, plus the bout\n * already booked (`booked_next`).\n */\n whosNext(fighter: string | number, opts: { limit?: number } = {}): Promise<WhosNext> {\n return this.get<WhosNext>(`matchmaker/next/${encodeURIComponent(String(fighter))}`, { limit: opts.limit });\n }\n\n /* --------------------------------------------------------------- stats */\n\n /**\n * One Record Book leaderboard for one promotion (`metric` e.g. `wins`,\n * `fastest_knockout`, `finish_rate`). Narrow with `division` (slug),\n * `country` (ISO-2) or `population: 'active'` — not `country` and\n * `active` together. `lastMeta.metric` names the unit and what\n * `value_secondary` means.\n */\n leaderboard(\n org: string,\n metric: string,\n opts: { division?: string; country?: string; population?: 'all' | 'active'; limit?: number } = {},\n ): Promise<LeaderboardRow[]> {\n return this.get<LeaderboardRow[]>('stats/leaders', { org, metric, ...opts } as Query);\n }\n\n /**\n * Every leaderboard's top rows (`top`, default 10, max 25) for one\n * promotion, grouped by category.\n */\n recordBook(\n org: string,\n opts: { division?: string; country?: string; population?: 'all' | 'active'; scope?: StatScope; top?: number } = {},\n ): Promise<RecordBookSection[]> {\n return this.get<RecordBookSection[]>('stats/record-book', { org, ...opts } as Query);\n }\n\n /**\n * One calendar year in numbers for one promotion, or every covered\n * promotion when `org` is omitted: events, title fights, finish methods,\n * divisions, fastest finishes, upsets, Power Index climbers, busiest\n * fighters, host countries and the most-used judges.\n */\n yearStats(year: number, opts: { org?: string } = {}): Promise<YearStats> {\n return this.get<YearStats>(`stats/years/${encodeURIComponent(String(year))}`, opts as Query);\n }\n\n /* ---------------------------------------------------------------- misc */\n\n /** Model win probabilities for upcoming UFC bouts; `event` narrows to one card. */\n predictionsUpcoming(opts: { event?: string | number } = {}): Promise<Record<string, unknown>[]> {\n return this.get<Record<string, unknown>[]>(\n 'predictions/upcoming',\n opts.event !== undefined ? { event: String(opts.event) } : undefined,\n );\n }\n\n /**\n * Who airs the promotion, per ISO-2 country — the org-wide deals, or a UFC\n * sub-series grid with `series: 'dwcs' | 'rtufc'`.\n */\n broadcastRights(org = 'ufc', opts: { country?: string; series?: RightsSeries } = {}): Promise<BroadcastRight[]> {\n return this.get<BroadcastRight[]>(`broadcast-rights/${encodeURIComponent(org)}`, opts as Query);\n }\n\n /**\n * Venues that hosted a covered promotion, alphabetical. `q` (2+ chars)\n * matches name or city; `country` is an ISO-2 code or an English name.\n */\n venues(opts: { q?: string; country?: string; limit?: number } = {}): AsyncGenerator<Venue, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<Venue>('venues', params as Query, { limit });\n }\n\n venue(venueId: number | string): Promise<Venue> {\n return this.get<Venue>(`venues/${encodeURIComponent(String(venueId))}`);\n }\n\n /** Every covered event at one venue, newest first (`order: 'asc'` reverses). */\n venueEvents(\n venueId: number | string,\n opts: { status?: string; from?: string; to?: string; order?: 'asc' | 'desc'; limit?: number } = {},\n ): AsyncGenerator<EventSummary, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<EventSummary>(`venues/${encodeURIComponent(String(venueId))}/events`, params as Query, { limit });\n }\n\n /** Typeahead across fighters and events. */\n search(q: string): Promise<Record<string, unknown>> {\n return this.get<Record<string, unknown>>('search', { q });\n }\n\n /**\n * UFCalendar's own editorial archive, newest first. `q` (2+ chars) matches\n * title, summary or a tag; `tag` is exact; `locale` is one of the 13 site\n * languages (English fallback).\n */\n articles(\n opts: { q?: string; tag?: string; locale?: ArticleLocale; limit?: number } = {},\n ): AsyncGenerator<ArticleSummary, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<ArticleSummary>('articles', params as Query, { limit });\n }\n\n /**\n * One article: full Markdown `body_md` (client widgets removed), author,\n * tags, `published_at`; `served_locale` names the language\n * delivered.\n */\n article(slug: string, opts: { locale?: ArticleLocale } = {}): Promise<Article> {\n return this.get<Article>(`articles/${encodeURIComponent(slug)}`, opts as Query);\n }\n\n /** Your key's month-to-date quota usage. */\n usage(): Promise<Usage> {\n return this.get<Usage>('usage');\n }\n\n /**\n * Subscribable ICS feed URL for calendar apps (authenticates via `?key=`).\n *\n * Throws without a key rather than returning `?key=`: that empty URL is\n * pasted into a calendar app, fails there hours later, and the failure\n * surfaces nowhere near this call.\n */\n calendarIcsUrl(org = 'ufc'): string {\n if (!this.apiKey) {\n throw new FightAPIError(\n 401,\n 'no_api_key',\n 'No API key. Pass new FightAPI(\"ufcalendar_...\") or set UFCALENDAR_API_KEY. ' +\n 'Keys (free plan: 100 requests/month, no card) live at https://www.ufcalendar.com/account/api',\n );\n }\n return `${this.baseUrl}/calendar/${encodeURIComponent(org)}.ics?key=${encodeURIComponent(this.apiKey)}`;\n }\n\n /* ------------------------------------------------------------ webhooks */\n\n webhookEndpoints(): Promise<WebhookEndpoint[]> {\n return this.get<WebhookEndpoint[]>('webhook-endpoints');\n }\n\n /**\n * Register a signed webhook (Pro and up). `events` ⊆ `event.announced`,\n * `fight.result`, `card.changed`, `event.completed`, `odds.moved` (the\n * consensus line on an upcoming bout moved 5+ implied-probability points or\n * the favourite flipped). The signing secret is returned ONCE, in this\n * response.\n */\n async createWebhookEndpoint(url: string, events?: string[]): Promise<WebhookEndpoint> {\n const body: Record<string, unknown> = { url };\n if (events?.length) body.events = events;\n return (await this.#request<WebhookEndpoint>('POST', 'webhook-endpoints', { body })).data;\n }\n\n async deleteWebhookEndpoint(endpointId: number | string): Promise<void> {\n await this.#request<unknown>('DELETE', `webhook-endpoints/${encodeURIComponent(String(endpointId))}`);\n }\n\n async rotateWebhookSecret(endpointId: number | string): Promise<WebhookEndpoint> {\n return (\n await this.#request<WebhookEndpoint>(\n 'POST',\n `webhook-endpoints/${encodeURIComponent(String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,KAAK,IAAW,OAAO;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,eAAe,MAAM,OAAe;AAClC,QAAI,CAAC,KAAK,QAAQ;AAChB,YAAM,IAAI;AAAA,QACR;AAAA,QACA;AAAA,QACA;AAAA,MAEF;AAAA,IACF;AACA,WAAO,GAAG,KAAK,OAAO,aAAa,mBAAmB,GAAG,CAAC,YAAY,mBAAmB,KAAK,MAAM,CAAC;AAAA,EACvG;AAAA;AAAA,EAIA,mBAA+C;AAC7C,WAAO,KAAK,IAAuB,mBAAmB;AAAA,EACxD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,sBAAsB,KAAa,QAA6C;AACpF,UAAM,OAAgC,EAAE,IAAI;AAC5C,QAAI,QAAQ,OAAQ,MAAK,SAAS;AAClC,YAAQ,MAAM,KAAK,SAA0B,QAAQ,qBAAqB,EAAE,KAAK,CAAC,GAAG;AAAA,EACvF;AAAA,EAEA,MAAM,sBAAsB,YAA4C;AACtE,UAAM,KAAK,SAAkB,UAAU,qBAAqB,mBAAmB,OAAO,UAAU,CAAC,CAAC,EAAE;AAAA,EACtG;AAAA,EAEA,MAAM,oBAAoB,YAAuD;AAC/E,YACE,MAAM,KAAK;AAAA,MACT;AAAA,MACA,qBAAqB,mBAAmB,OAAO,UAAU,CAAC,CAAC;AAAA,IAC7D,GACA;AAAA,EACJ;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/version.ts","../src/client.ts"],"sourcesContent":["/** Kept in lockstep with package.json and the User-Agent by\n * `apps/api/src/surfaces.test.ts`. Bump all three together. */\nexport const VERSION = '0.10.1';\n","/**\n * Thin, dependency-free client for https://api.ufcalendar.com/v1.\n *\n * Every method returns the parsed `data` value of the JSON envelope\n * (`{\"data\": ..., \"meta\": ...}`); list endpoints are async generators that\n * follow cursor pagination for you. Errors throw `FightAPIError` carrying\n * the API's `code`, `message` and `requestId` — quote the request id when\n * you write to api@ufcalendar.com.\n *\n * Mirrors sdk/python/ufcalendar/client.py one method per endpoint, in\n * camelCase. The two clients are kept in lockstep by\n * `apps/api/src/surfaces.test.ts`.\n *\n * Odds are the UFCalendar consensus line: one anonymised line per corner\n * across the sportsbooks we track (`sources` = how many books backed each\n * point; book identities are never exposed). Information only, not betting\n * advice. Fighter `images` are Wikimedia\n * Commons / Creative Commons files — the `license` and `artist` fields you\n * receive must be displayed as a credit.\n */\nimport { VERSION } from './version';\nimport type {\n Article,\n FightPositions,\n FightStatLine,\n FightTimeline,\n FighterDiscipline,\n FighterPositions,\n OrgCoverage,\n Referee,\n RefereeFightRow,\n ArticleLocale,\n ArticleSummary,\n EventPickem,\n EventOdds,\n FightInclude,\n FightOdds,\n OddsHistoryPoint,\n Compare,\n Matchup,\n WhosNext,\n EventStorylines,\n YearStats,\n EventWatch,\n OrgDivision,\n LeaderboardRow,\n RecordBookSection,\n StatScope,\n RightsSeries,\n SplitDecisionRow,\n ChangeFeedEntry,\n ChangeKind,\n FightSearchMethod,\n FightSearchRow,\n BroadcastRight,\n CareerBout,\n CareerStats,\n Champion,\n EventInclude,\n EventListInclude,\n JudgeScorecardRow,\n PowerIndexMover,\n PowerIndexRow,\n PowerIndexView,\n Envelope,\n EventChange,\n EventDetail,\n EventSummary,\n Fight,\n Fighter,\n FighterInclude,\n FighterSummary,\n Judge,\n Meta,\n Org,\n Plans,\n PowerIndex,\n RankingsBoard,\n RateLimit,\n Scorecards,\n Usage,\n Venue,\n WebhookEndpoint,\n} from './types';\n\nexport const DEFAULT_BASE_URL = 'https://api.ufcalendar.com/v1';\nconst DEFAULT_TIMEOUT_MS = 30_000;\n/** Default number of times a GET that hit the per-minute limit is retried. */\nexport const DEFAULT_MAX_RETRIES = 3;\n/**\n * A 429 whose `Retry-After` is longer than this is not waited out: the\n * per-minute limit always resets within a minute, anything longer is the\n * monthly quota (or something we do not understand) and must surface.\n */\nexport const MAX_RETRY_AFTER_SECONDS = 60;\nconst RETRY_JITTER_MS = 500;\n\nexport interface FightAPIOptions {\n /** `ufcalendar_…` key from https://www.ufcalendar.com/account/api. Falls back\n * to `UFCALENDAR_API_KEY` / `UFCAL_API_KEY` in the environment. Only\n * `plans()` works without one. */\n apiKey?: string;\n /** Override for testing; defaults to the production `/v1`. */\n baseUrl?: string;\n /** Inject a fetch (a test double, an instrumented fetch, undici). */\n fetch?: typeof fetch;\n /** Per-request timeout. Default 30s. */\n timeoutMs?: number;\n /** Extra headers on every request. */\n headers?: Record<string, string>;\n /**\n * How many times a GET that hit the per-minute limit (429 `rate_limited`\n * with `Retry-After` ≤ 60 s) is retried after waiting `Retry-After` plus a\n * little jitter. Default 3; `0` disables. The monthly quota\n * (`quota_exceeded`) and non-GET requests always throw at once.\n */\n maxRetries?: number;\n /** Replace the wait between rate-limit retries (tests, custom schedulers). */\n sleep?: (ms: number) => Promise<void>;\n}\n\n/** An error response from the Fight API. */\nexport class FightAPIError extends Error {\n readonly status: number;\n readonly code: string;\n readonly requestId: string | null;\n\n constructor(status: number, code: string, message: string, requestId: string | null = null) {\n super(`${status} ${code}: ${message}${requestId ? ` (request_id=${requestId})` : ''}`);\n this.name = 'FightAPIError';\n this.status = status;\n this.code = code;\n this.requestId = requestId;\n }\n}\n\nexport type QueryValue = string | number | boolean | null | undefined;\nexport type Query = Record<string, QueryValue>;\n\ninterface PageOptions {\n /** Stop after this many rows (across pages). */\n limit?: number;\n}\n\n/**\n * A browser forbids setting User-Agent on fetch, so we only set ours\n * off-browser. The test is `document`, NOT `navigator`: Node 21+ ships a\n * global `navigator`, so a navigator check would silently drop the header\n * on every modern Node runtime — which is the one place it works.\n */\nfunction canSetUserAgent(): boolean {\n return typeof document === 'undefined' && typeof window === 'undefined';\n}\n\n/** `Retry-After` as seconds: delta-seconds or an HTTP date; null if absent/unparseable. */\nfunction retryAfterSeconds(value: string | null): number | null {\n if (value === null) return null;\n const v = value.trim();\n if (v === '') return null;\n let secs = Number(v);\n if (!Number.isFinite(secs)) {\n const when = Date.parse(v);\n if (!Number.isFinite(when)) return null;\n secs = (when - Date.now()) / 1000;\n }\n return Math.max(0, secs);\n}\n\n/**\n * Seconds to wait before retrying a 429, or null when it must not be retried.\n * Only the per-minute limit (`rate_limited`) is waited out. The monthly quota\n * (`quota_exceeded`) throws at once — near the end of a month its\n * `Retry-After` can be short, so the code is checked, not just the header.\n */\nfunction shortRateLimitWait(res: Response, code: string | undefined): number | null {\n if (code === 'quota_exceeded') return null;\n const secs = retryAfterSeconds(res.headers.get('Retry-After'));\n if (secs === null || secs > MAX_RETRY_AFTER_SECONDS) return null;\n return secs;\n}\n\nconst defaultSleep = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms));\n\nfunction envKey(): string | undefined {\n const env = (globalThis as { process?: { env?: Record<string, string | undefined> } }).process?.env;\n return env?.UFCALENDAR_API_KEY || env?.UFCAL_API_KEY;\n}\n\nexport class FightAPI {\n readonly baseUrl: string;\n readonly apiKey: string | undefined;\n /** Retries of a GET that hit the per-minute limit (see `FightAPIOptions.maxRetries`). */\n readonly maxRetries: number;\n\n /** `meta` of the most recent response (pagination cursor, generated_at …). */\n lastMeta: Meta | null = null;\n /** `X-RateLimit-*` of the most recent response. */\n lastRateLimit: RateLimit = { limit: null, remaining: null, reset: null };\n\n readonly #fetch: typeof fetch;\n readonly #timeoutMs: number;\n readonly #headers: Record<string, string>;\n readonly #sleep: (ms: number) => Promise<void>;\n\n constructor(apiKeyOrOptions?: string | FightAPIOptions, options: FightAPIOptions = {}) {\n const opts: FightAPIOptions =\n typeof apiKeyOrOptions === 'string'\n ? { ...options, apiKey: apiKeyOrOptions }\n : { ...options, ...(apiKeyOrOptions ?? {}) };\n this.apiKey = opts.apiKey ?? envKey();\n this.baseUrl = (opts.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, '');\n this.#fetch = opts.fetch ?? globalThis.fetch;\n this.#timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n this.#headers = opts.headers ?? {};\n this.#sleep = opts.sleep ?? defaultSleep;\n const maxRetries = opts.maxRetries ?? DEFAULT_MAX_RETRIES;\n if (!Number.isInteger(maxRetries) || maxRetries < 0) {\n throw new RangeError('maxRetries must be a non-negative integer');\n }\n this.maxRetries = maxRetries;\n if (!this.#fetch) {\n throw new Error('No global fetch available. Use Node 18+ or pass { fetch }.');\n }\n }\n\n /* ---------------------------------------------------------------- core */\n\n #url(path: string, params?: Query): string {\n const url = new URL(`${this.baseUrl}/${path.replace(/^\\/+/, '')}`);\n for (const [k, v] of Object.entries(params ?? {})) {\n if (v === undefined || v === null) continue;\n url.searchParams.set(k, String(v));\n }\n return url.toString();\n }\n\n async #request<T>(\n method: string,\n path: string,\n { params, body, open = false }: { params?: Query; body?: unknown; open?: boolean } = {},\n ): Promise<Envelope<T>> {\n if (!this.apiKey && !open) {\n throw new FightAPIError(\n 401,\n 'no_api_key',\n 'No API key. Pass new FightAPI(\"ufcalendar_...\") or set UFCALENDAR_API_KEY. ' +\n 'Keys (free plan: 100 requests/month, no card) live at https://www.ufcalendar.com/account/api',\n );\n }\n const headers: Record<string, string> = { Accept: 'application/json', ...this.#headers };\n if (this.apiKey) headers.Authorization = `Bearer ${this.apiKey}`;\n if (canSetUserAgent()) headers['User-Agent'] = `ufcalendar-typescript/${VERSION}`;\n if (body !== undefined) headers['Content-Type'] = 'application/json';\n\n const url = this.#url(path, params);\n let res: Response;\n let text: string;\n let parsed: unknown;\n for (let attempt = 0; ; attempt += 1) {\n try {\n res = await this.#fetch(url, {\n method,\n headers,\n body: body === undefined ? undefined : JSON.stringify(body),\n signal: AbortSignal.timeout(this.#timeoutMs),\n });\n } catch (e) {\n const err = e as { name?: string; message?: string };\n if (err?.name === 'TimeoutError') {\n throw new FightAPIError(0, 'timeout', `Request to ${path} timed out after ${this.#timeoutMs}ms`);\n }\n throw new FightAPIError(0, 'network_error', err?.message ?? String(e));\n }\n\n this.lastRateLimit = {\n limit: res.headers.get('X-RateLimit-Limit'),\n remaining: res.headers.get('X-RateLimit-Remaining'),\n reset: res.headers.get('X-RateLimit-Reset'),\n };\n\n if (res.status === 204) {\n this.lastMeta = null;\n return { data: undefined as T };\n }\n\n text = await res.text();\n parsed = undefined;\n try {\n parsed = text ? JSON.parse(text) : undefined;\n } catch {\n parsed = undefined;\n }\n\n // Wait out the per-minute limit on reads (a 429'd request is not\n // counted against the month). Writes are never replayed.\n if (res.status === 429 && method.toUpperCase() === 'GET' && attempt < this.maxRetries) {\n const code = (parsed as { error?: { code?: string } } | undefined)?.error?.code;\n const wait = shortRateLimitWait(res, code);\n if (wait !== null) {\n await this.#sleep(wait * 1000 + Math.random() * RETRY_JITTER_MS);\n continue;\n }\n }\n break;\n }\n\n if (!res.ok) {\n const err = (parsed as { error?: { code?: string; message?: string; request_id?: string } } | undefined)?.error;\n if (err) {\n throw new FightAPIError(\n res.status,\n String(err.code ?? 'error'),\n String(err.message ?? text.slice(0, 200)),\n err.request_id ?? res.headers.get('x-request-id'),\n );\n }\n throw new FightAPIError(res.status, 'http_error', text.slice(0, 200), res.headers.get('x-request-id'));\n }\n\n const env = (parsed ?? {}) as Envelope<T>;\n this.lastMeta = env.meta ?? null;\n return env;\n }\n\n /** Raw GET returning the `data` value. Escape hatch for new endpoints. */\n async get<T = unknown>(path: string, params?: Query): Promise<T> {\n return (await this.#request<T>('GET', path, { params })).data;\n }\n\n /** Raw GET returning the whole `{data, meta}` envelope. */\n async getWithMeta<T = unknown>(path: string, params?: Query): Promise<Envelope<T>> {\n return this.#request<T>('GET', path, { params });\n }\n\n async *#paginate<T>(path: string, params: Query, opts: PageOptions = {}): AsyncGenerator<T, void, void> {\n // Never fetch a bigger page than the caller wants rows: `limit: 3` used\n // to pull 100 rows and throw 97 away, burning the caller's quota on a\n // request they did not ask for (and, on a trial key, a noticeable slice\n // of the 100 they get).\n const pageSize = Math.min(100, opts.limit ?? 100);\n const query: Query = { limit: pageSize, ...params };\n let seen = 0;\n for (;;) {\n const env = await this.#request<T[]>('GET', path, { params: query });\n for (const row of env.data ?? []) {\n yield row;\n seen += 1;\n if (opts.limit !== undefined && seen >= opts.limit) return;\n }\n const cursor = env.meta?.pagination?.next_cursor;\n if (!cursor) return;\n query.cursor = cursor;\n }\n }\n\n /* --------------------------------------------------------------- plans */\n\n /**\n * Plans (Free first), quotas, the free-plan rule, the MCP endpoint and the doc\n * links. The only endpoint that answers without a credential.\n */\n async plans(): Promise<Plans> {\n return (await this.#request<Plans>('GET', 'plans', { open: true })).data;\n }\n\n /* ---------------------------------------------------------------- orgs */\n\n /** Launch orgs with capability flags (stats / rounds / rankings / broadcasts / predictions / scorecards / odds). */\n orgs(): Promise<Org[]> {\n return this.get<Org[]>('orgs');\n }\n\n org(slug: string): Promise<Org> {\n return this.get<Org>(`orgs/${encodeURIComponent(slug)}`);\n }\n\n /**\n * One weight class in one promotion: its rankings board (null where the\n * promotion publishes none), upcoming bouts at that weight, the latest\n * results and the roster by recency. `division` is a slug, e.g.\n * `lightweight` or `womens-strawweight`.\n */\n orgDivision(org: string, division: string): Promise<OrgDivision> {\n return this.get<OrgDivision>(`orgs/${encodeURIComponent(org)}/divisions/${encodeURIComponent(division)}`);\n }\n\n /* -------------------------------------------------------------- events */\n\n /**\n * Schedule + results. Bare call = the upcoming calendar, soonest first.\n * `status: 'completed'` (or `order: 'desc'`) browses the archive\n * newest-first; `status: 'upcoming'` = every card not yet over (announced,\n * scheduled or live). `from` / `to` are `YYYY-MM-DD`.\n */\n events(\n opts: {\n org?: string;\n status?: string;\n from?: string;\n to?: string;\n order?: 'asc' | 'desc';\n /** Only cards with (true) / without (false) a title bout. */\n isTitleCard?: boolean;\n /** Only PPV (true) / non-PPV (false) cards. */\n isPpv?: boolean;\n /** `headline` adds each card's main event. */\n include?: EventListInclude[];\n limit?: number;\n } = {},\n ): AsyncGenerator<EventSummary, void, void> {\n const { limit, isTitleCard, isPpv, include, ...params } = opts;\n return this.#paginate<EventSummary>('events', {\n ...params,\n is_title_card: isTitleCard,\n is_ppv: isPpv,\n include: include?.length ? include.join(',') : undefined,\n } as Query, { limit });\n }\n\n /**\n * One event with its full fight card, venue and broadcasts.\n * `include: ['eta']` adds an estimated start time to every bout;\n * `include: ['odds']` adds each bout's current consensus line (the closing line once settled) (null when\n * unpriced). Pass both as `['eta', 'odds']`.\n */\n event(idOrSlug: string | number, opts: { include?: EventInclude[] } = {}): Promise<EventDetail> {\n return this.get<EventDetail>(\n `events/${encodeURIComponent(String(idOrSlug))}`,\n opts.include?.length ? { include: opts.include.join(',') } : undefined,\n );\n }\n\n /**\n * Who airs one event, per country: the promotion's rights deals for the\n * event's series merged with the event's own listings. `country` (ISO-2)\n * narrows to that market plus worldwide.\n */\n eventWatch(idOrSlug: string | number, opts: { country?: string } = {}): Promise<EventWatch> {\n return this.get<EventWatch>(`events/${encodeURIComponent(String(idOrSlug))}/watch`, opts as Query);\n }\n\n /**\n * The talking points of one card as of its start: title fights and\n * eliminators, the closest bout (UFCalendar model, else Power Index — not\n * betting advice), rematches and trilogy deciders, streaks, debuts and\n * returns, ranked fighters, nations, tallest / longest reach, the fastest\n * career finish.\n */\n eventStorylines(idOrSlug: string | number): Promise<EventStorylines> {\n return this.get<EventStorylines>(`events/${encodeURIComponent(String(idOrSlug))}/storylines`);\n }\n\n /**\n * How the UFCalendar community is picking each bout on one card: picks per\n * corner, the total and `pct_a`, in card order. Crowd sentiment from our\n * own pick'em game, not a market and not a forecast.\n */\n eventPickem(idOrSlug: string | number): Promise<EventPickem> {\n return this.get<EventPickem>(`events/${encodeURIComponent(String(idOrSlug))}/pickem`);\n }\n\n /**\n * The UFCalendar consensus odds for every non-cancelled bout on one card, in\n * card order: `consensus`, `opening`, `closing` (settled bouts), `movement`\n * and `points`. Unpriced bouts stay on the list with nulls and `points: 0`;\n * `lastMeta.priced` / `lastMeta.unpriced` count both. Information only, not\n * betting advice.\n */\n eventOdds(idOrSlug: string | number): Promise<EventOdds> {\n return this.get<EventOdds>(`events/${encodeURIComponent(String(idOrSlug))}/odds`);\n }\n\n /** Card-change diff log (fight added/removed, opponent swapped, date moved, profile merged). */\n eventChanges(idOrSlug: string | number): Promise<EventChange[]> {\n return this.get<EventChange[]>(`events/${encodeURIComponent(String(idOrSlug))}/changes`);\n }\n\n /**\n * The card-change feed across every event, newest first (default: the last\n * 90 days) — the `card.changed` webhook's audit trail, for callers that\n * poll. `since` is `YYYY-MM-DD` or an ISO-8601 datetime.\n */\n changes(\n opts: { org?: string; since?: string; kind?: ChangeKind; limit?: number } = {},\n ): AsyncGenerator<ChangeFeedEntry, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<ChangeFeedEntry>('changes', params as Query, { limit });\n }\n\n /* -------------------------------------------------------------- fights */\n\n /** One bout with its result. `include: ['odds']` adds the current consensus line (the closing line once the bout is settled). */\n fight(fightId: number | string, opts: { include?: FightInclude[] } = {}): Promise<Fight> {\n return this.get<Fight>(\n `fights/${encodeURIComponent(String(fightId))}`,\n opts.include?.length ? { include: opts.include.join(',') } : undefined,\n );\n }\n\n /**\n * The UFCalendar consensus line for one bout: `consensus` (latest point; the closing line once settled),\n * `opening`, `closing` (the last point at or before the event start,\n * settled bouts only), `movement` (opening → consensus in implied-probability\n * points on corner a) and `sources` on every point (how many sportsbooks\n * backed it; book identities are never exposed). An unpriced bout resolves\n * with null blocks and `points: 0`. Information only, not betting advice.\n */\n fightOdds(fightId: number | string): Promise<FightOdds> {\n return this.get<FightOdds>(`fights/${encodeURIComponent(String(fightId))}/odds`);\n }\n\n /**\n * Every consensus point for one bout, oldest first (Pro plans and up; a\n * lower plan throws `FightAPIError` 403 `tier_required`). A point is stored\n * only when the consensus moves. `from` / `to` are inclusive `YYYY-MM-DD`.\n */\n fightOddsHistory(\n fightId: number | string,\n opts: { from?: string; to?: string; limit?: number } = {},\n ): AsyncGenerator<OddsHistoryPoint, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<OddsHistoryPoint>(\n `fights/${encodeURIComponent(String(fightId))}/odds/history`,\n params as Query,\n { limit },\n );\n }\n\n /**\n * Per-fight totals for both corners, each with `fantasy` — UFCalendar\n * fantasy points with a per-category breakdown and `complete`. The\n * data-quality flags ride in `lastMeta.quality` (`StatsQuality`).\n */\n fightStats(fightId: number | string): Promise<FightStatLine[]> {\n return this.get<FightStatLine[]>(`fights/${encodeURIComponent(String(fightId))}/stats`);\n }\n\n /** Round-by-round stat lines for both corners. */\n fightRounds(fightId: number | string): Promise<Record<string, unknown>[]> {\n return this.get<Record<string, unknown>[]>(`fights/${encodeURIComponent(String(fightId))}/rounds`);\n }\n\n /**\n * The judges' scorecards for a bout — the official commission record:\n * decision type, point deductions, and one card per judge with every\n * round, the totals and `winner_fighter_id`. Scores are oriented to\n * `fighter_a_id` / `fighter_b_id`, both repeated on the payload.\n *\n * Check `scores_known` on a card before charting totals: when it is false\n * the commission published only the outcome. Throws 404 for a bout that\n * did not go to the judges.\n */\n fightScorecards(fightId: number | string): Promise<Scorecards> {\n return this.get<Scorecards>(`fights/${encodeURIComponent(String(fightId))}/scorecards`);\n }\n\n /**\n * The official in-fight log of one settled UFC bout (Pro plans and up; a\n * lower plan throws `FightAPIError` 403 `tier_required`): every logged\n * action in order, the referee stoppages paired with their reason and\n * real length, and every confirmed foul of the bout.\n *\n * The log labels only two fouls, the eye poke and the low blow. Any other\n * foul (an illegal knee to a grounded opponent, an upkick, a headbutt, a\n * bite, a fence grab) reaches it as a `generic` stoppage naming nobody, so\n * a foul is reported only when a record confirms it (`foul_basis` /\n * `basis`): `log` (the labelled row), `deduction` (the athletic commission\n * took a point) or `result` (the bout ended on it: a disqualification or a\n * \"could not continue\"). On a stoppage, `is_foul` says whether a foul is\n * confirmed, `foul` what it was, `committed_by` who committed it (null\n * when no record names a fighter), `points_deducted` and `ended_bout`; a\n * `generic` stoppage with no record behind it has `is_foul: false`.\n * `incidents` lists every confirmed foul in fight order, including one\n * with no stoppage in the log; `fouls.a` / `fouls.b` count what each\n * corner committed (`eye_pokes`, `low_blows`, `other`, `total`,\n * `points_deducted`). A recorded foul is not a ruling on intent.\n *\n * Coverage: UFC bouts from June 2013, stoppage reasons\n * from 8 December 2018 (`lastMeta.has_stoppage_reasons`). A bout with no\n * log, or one not settled yet, resolves with empty lists and\n * `lastMeta.note`.\n */\n fightTimeline(fightId: number | string): Promise<FightTimeline> {\n return this.get<FightTimeline>(`fights/${encodeURIComponent(String(fightId))}/timeline`);\n }\n\n /**\n * Position stats of one settled UFC bout (Pro plans and up): where it was\n * fought (`time`, shared by both fighters), each fighter's `control` by\n * position, and strikes by position and target — `totals` for the whole\n * bout, `rounds` per round. `null` means not tracked for that bout; `0`\n * is a real zero. Tracked reliably from 2007.\n */\n fightPositions(fightId: number | string): Promise<FightPositions> {\n return this.get<FightPositions>(`fights/${encodeURIComponent(String(fightId))}/positions`);\n }\n\n /**\n * Completed bouts, filtered — newest first unless `order: 'oldest'`. At\n * least one narrowing filter is required (`titleOnly`, `method`,\n * `division`, `fighter`, `winner`, `from`, `to`, `mainEventsOnly`); the\n * server serves 25 rows a page and at most 10 pages.\n */\n findFights(\n opts: {\n org?: string;\n titleOnly?: boolean;\n method?: FightSearchMethod;\n /** Division slug (`lightweight`) or a name fragment. */\n division?: string;\n /** Fighter slug or id — bouts they were in. */\n fighter?: string | number;\n /** Fighter slug or id — bouts they won. */\n winner?: string | number;\n from?: string;\n to?: string;\n mainEventsOnly?: boolean;\n order?: 'newest' | 'oldest';\n limit?: number;\n } = {},\n ): AsyncGenerator<FightSearchRow, void, void> {\n const { limit, titleOnly, mainEventsOnly, fighter, winner, ...rest } = opts;\n return this.#paginate<FightSearchRow>('fights/search', {\n ...rest,\n title_only: titleOnly,\n main_events_only: mainEventsOnly,\n fighter: fighter === undefined ? undefined : String(fighter),\n winner: winner === undefined ? undefined : String(winner),\n } as Query, { limit });\n }\n\n /* -------------------------------------------------------------- judges */\n\n /**\n * Every official who has scored a launch-org bout, busiest first. Rates\n * mean little below ~10 fights; pass `minFights: 10`.\n */\n judges(\n opts: { q?: string; org?: string; minFights?: number; limit?: number } = {},\n ): AsyncGenerator<Judge, void, void> {\n const { limit, minFights, ...rest } = opts;\n return this.#paginate<Judge>('judges', { ...rest, min_fights: minFights } as Query, { limit });\n }\n\n judge(judgeId: number | string): Promise<Judge> {\n return this.get<Judge>(`judges/${encodeURIComponent(String(judgeId))}`);\n }\n\n /**\n * Split and majority decisions, newest first, with every judge's card and\n * the dissenting judges named. Commission records only.\n */\n splitDecisions(\n opts: { org?: string; from?: string; to?: string; limit?: number } = {},\n ): AsyncGenerator<SplitDecisionRow, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<SplitDecisionRow>('scorecards/splits', params as Query, { limit });\n }\n\n /**\n * Every card this judge has turned in, newest first, with `lone_dissent`,\n * `split` and the `colleagues`' totals on each row.\n */\n judgeScorecards(\n judgeId: number | string,\n opts: { limit?: number } = {},\n ): AsyncGenerator<JudgeScorecardRow, void, void> {\n return this.#paginate<JudgeScorecardRow>(\n `judges/${encodeURIComponent(String(judgeId))}/scorecards`,\n {},\n opts,\n );\n }\n\n /* ------------------------------------------------------------ referees */\n\n /**\n * Every referee who has worked a settled launch-org bout, busiest first:\n * bouts, promotions, finish rate, method mix and average fight time. The\n * id is a slug of the name; `q` is accent- and spacing-insensitive.\n */\n referees(opts: { q?: string; org?: string; limit?: number } = {}): AsyncGenerator<Referee, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<Referee>('referees', params as Query, { limit });\n }\n\n /** One referee's career aggregates, e.g. `referee('herb-dean')`. */\n referee(slug: string): Promise<Referee> {\n return this.get<Referee>(`referees/${encodeURIComponent(slug)}`);\n }\n\n /** Every settled bout one referee worked, newest first (the bout plus its `event`). */\n refereeFights(slug: string, opts: { limit?: number } = {}): AsyncGenerator<RefereeFightRow, void, void> {\n return this.#paginate<RefereeFightRow>(`referees/${encodeURIComponent(slug)}/fights`, {}, opts);\n }\n\n /* ------------------------------------------------------------ coverage */\n\n /**\n * What the database holds per launch org per year: events, settled bouts\n * and how many carry stats, round stats, commission scorecards and a\n * consensus odds line, with `totals` and `last_result_at`.\n */\n coverage(opts: { org?: string } = {}): Promise<OrgCoverage[]> {\n return this.get<OrgCoverage[]>('coverage', opts.org ? { org: opts.org } : undefined);\n }\n\n /* ------------------------------------------------------------ fighters */\n\n fighters(\n opts: { q?: string; org?: string; country?: string; limit?: number } = {},\n ): AsyncGenerator<FighterSummary, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<FighterSummary>('fighters', params as Query, { limit });\n }\n\n /**\n * Bio, records, career stats, Power Index, CC-licensed images, `next_fight`\n * and `last_fight`. `include: ['bonuses']` adds the UFC bonus ledger;\n * `include: ['credentials']` adds grappling and wrestling pedigree, gyms and\n * coaches (every row with `sources` and a `confidence` grade).\n */\n fighter(idOrSlug: string | number, opts: { include?: FighterInclude[] } = {}): Promise<Fighter> {\n return this.get<Fighter>(\n `fighters/${encodeURIComponent(String(idOrSlug))}`,\n opts.include?.length ? { include: opts.include.join(',') } : undefined,\n );\n }\n\n /** Complete multi-promotion career timeline. */\n fighterHistory(idOrSlug: string | number): Promise<CareerBout[]> {\n return this.get<CareerBout[]>(`fighters/${encodeURIComponent(String(idOrSlug))}/history`);\n }\n\n /** Raw career stat rows, one source-stamped row per scope (`pro-mma`, `ufc-only` …).\n * For the readable split use `fighter().records` / `fighter().stats`. */\n fighterStats(idOrSlug: string | number): Promise<CareerStats[]> {\n return this.get<CareerStats[]>(`fighters/${encodeURIComponent(String(idOrSlug))}/stats`);\n }\n\n /** Every ranking row the fighter ever held, newest first, across every board\n * (`board` is `official` / `meta`; `is_champion` when rank 0). The endpoint is\n * cursor-paginated since 2026-09-24 — this walks every page so the array is\n * complete (a long career is 900+ rows). */\n async fighterRankings(idOrSlug: string | number): Promise<Record<string, unknown>[]> {\n const out: Record<string, unknown>[] = [];\n for await (const row of this.#paginate<Record<string, unknown>>(\n `fighters/${encodeURIComponent(String(idOrSlug))}/rankings`, { limit: 500 } as Query)) out.push(row);\n return out;\n }\n\n fighterPowerIndex(idOrSlug: string | number): Promise<PowerIndex & Record<string, unknown>> {\n return this.get<PowerIndex & Record<string, unknown>>(\n `fighters/${encodeURIComponent(String(idOrSlug))}/power-index`,\n );\n }\n\n /**\n * The confirmed fouls in a fighter's UFC bouts since 8 December 2018 (Pro\n * plans and up), committed and drawn: eye pokes and low blows from the\n * official in-fight log, plus any other foul (an illegal knee to a\n * grounded opponent, an upkick, a headbutt, a bite, a fence grab)\n * confirmed by the athletic commission's point deduction or by the\n * official result. `committed` / `drawn` count `total`, `eye_pokes`,\n * `low_blows` and `other`; `points_deducted` is what the commission has\n * taken from this fighter; `incidents` lists every confirmed foul, most\n * recent first, with `reason` (the foul), `basis` (`log`, `deduction` or\n * `result`), `points_deducted` and `ended_bout`. A `generic` stoppage with\n * no record behind it is never counted. A recorded foul is not a ruling on\n * intent. Resolves `null` (with `lastMeta.note`) under 3 tracked bouts\n * with no recorded foul.\n */\n fighterDiscipline(idOrSlug: string | number): Promise<FighterDiscipline | null> {\n return this.get<FighterDiscipline | null>(`fighters/${encodeURIComponent(String(idOrSlug))}/discipline`);\n }\n\n /**\n * A fighter's career position profile (Pro plans and up): the share of\n * cage time at distance, in the clinch and on the ground, and control\n * seconds for and against by position. Resolves `null` (with\n * `lastMeta.note`) under 3 bouts with tracked positions.\n */\n fighterPositions(idOrSlug: string | number): Promise<FighterPositions | null> {\n return this.get<FighterPositions | null>(`fighters/${encodeURIComponent(String(idOrSlug))}/positions`);\n }\n\n /**\n * Two fighters side by side (slugs or ids): bios with age, career stats,\n * strike mix, win streaks, previous meetings, common opponents, the booked\n * bout between them, the UFCalendar model prediction for it (UFC; not\n * betting advice) and Power Index ratings.\n */\n compare(a: string | number, b: string | number): Promise<Compare> {\n return this.get<Compare>('compare', { a: String(a), b: String(b) });\n }\n\n /* ------------------------------------------------------------ rankings */\n\n /**\n * Official board, point-in-time. `date: 'YYYY-MM-DD'` returns the board\n * that was valid on that day (UFC history back to 2013; rank 0 = champion).\n */\n rankings(org = 'ufc', opts: { date?: string; board?: string } = {}): Promise<RankingsBoard> {\n return this.get<RankingsBoard>(`rankings/${encodeURIComponent(org)}`, opts as Query);\n }\n\n divisionRankings(org: string, division: string, opts: { date?: string } = {}): Promise<RankingsBoard> {\n return this.get<RankingsBoard>(\n `rankings/${encodeURIComponent(org)}/${encodeURIComponent(division)}`,\n opts as Query,\n );\n }\n\n /** Current champions across every launch org, or one `org` / `division`. */\n champions(opts: { org?: string; division?: string } = {}): Promise<Champion[]> {\n return this.get<Champion[]>('champions', opts);\n }\n\n /**\n * UFCalendar Power Index board. `view: 'movers'` = biggest risers over\n * `days` (default 365), `view: 'peaks'` = all-time peak ratings;\n * `division` narrows any view.\n */\n powerIndex(\n org = 'ufc',\n opts: { view?: PowerIndexView; division?: string; days?: number; limit?: number } = {},\n ): Promise<(PowerIndexRow | PowerIndexMover)[]> {\n return this.get<(PowerIndexRow | PowerIndexMover)[]>(`power-index/${encodeURIComponent(org)}`, {\n view: opts.view,\n division: opts.division,\n days: opts.days,\n limit: opts.limit,\n });\n }\n\n /* ---------------------------------------------------------- matchmaker */\n\n /**\n * UFCalendar's matchmaker: the fights worth making in one MMA promotion,\n * scored 0–100, across the roster or for one `division` (`lastMeta.divisions`\n * lists the valid ones). Not a list of bookings; computed without the\n * site's Fight DNA factor.\n */\n matchmaker(org = 'ufc', opts: { division?: string; limit?: number } = {}): Promise<Matchup[]> {\n return this.get<Matchup[]>(`matchmaker/${encodeURIComponent(org)}`, {\n division: opts.division,\n limit: opts.limit,\n });\n }\n\n /**\n * Who one fighter (slug or id) should fight next: the best-scored\n * opponents with the Power Index win probability for each, plus the bout\n * already booked (`booked_next`).\n */\n whosNext(fighter: string | number, opts: { limit?: number } = {}): Promise<WhosNext> {\n return this.get<WhosNext>(`matchmaker/next/${encodeURIComponent(String(fighter))}`, { limit: opts.limit });\n }\n\n /* --------------------------------------------------------------- stats */\n\n /**\n * One Record Book leaderboard for one promotion (`metric` e.g. `wins`,\n * `fastest_knockout`, `finish_rate`). Narrow with `division` (slug),\n * `country` (ISO-2) or `population: 'active'` — not `country` and\n * `active` together. `lastMeta.metric` names the unit and what\n * `value_secondary` means.\n */\n leaderboard(\n org: string,\n metric: string,\n opts: { division?: string; country?: string; population?: 'all' | 'active'; limit?: number } = {},\n ): Promise<LeaderboardRow[]> {\n return this.get<LeaderboardRow[]>('stats/leaders', { org, metric, ...opts } as Query);\n }\n\n /**\n * Every leaderboard's top rows (`top`, default 10, max 25) for one\n * promotion, grouped by category.\n */\n recordBook(\n org: string,\n opts: { division?: string; country?: string; population?: 'all' | 'active'; scope?: StatScope; top?: number } = {},\n ): Promise<RecordBookSection[]> {\n return this.get<RecordBookSection[]>('stats/record-book', { org, ...opts } as Query);\n }\n\n /**\n * One calendar year in numbers for one promotion, or every covered\n * promotion when `org` is omitted: events, title fights, finish methods,\n * divisions, fastest finishes, upsets, Power Index climbers, busiest\n * fighters, host countries and the most-used judges.\n */\n yearStats(year: number, opts: { org?: string } = {}): Promise<YearStats> {\n return this.get<YearStats>(`stats/years/${encodeURIComponent(String(year))}`, opts as Query);\n }\n\n /* ---------------------------------------------------------------- misc */\n\n /** Model win probabilities for upcoming UFC bouts; `event` narrows to one card. */\n predictionsUpcoming(opts: { event?: string | number } = {}): Promise<Record<string, unknown>[]> {\n return this.get<Record<string, unknown>[]>(\n 'predictions/upcoming',\n opts.event !== undefined ? { event: String(opts.event) } : undefined,\n );\n }\n\n /**\n * Who airs the promotion, per ISO-2 country — the org-wide deals, or a UFC\n * sub-series grid with `series: 'dwcs' | 'rtufc'`.\n */\n broadcastRights(org = 'ufc', opts: { country?: string; series?: RightsSeries } = {}): Promise<BroadcastRight[]> {\n return this.get<BroadcastRight[]>(`broadcast-rights/${encodeURIComponent(org)}`, opts as Query);\n }\n\n /**\n * Venues that hosted a covered promotion, alphabetical. `q` (2+ chars)\n * matches name or city; `country` is an ISO-2 code or an English name.\n */\n venues(opts: { q?: string; country?: string; limit?: number } = {}): AsyncGenerator<Venue, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<Venue>('venues', params as Query, { limit });\n }\n\n venue(venueId: number | string): Promise<Venue> {\n return this.get<Venue>(`venues/${encodeURIComponent(String(venueId))}`);\n }\n\n /** Every covered event at one venue, newest first (`order: 'asc'` reverses). */\n venueEvents(\n venueId: number | string,\n opts: { status?: string; from?: string; to?: string; order?: 'asc' | 'desc'; limit?: number } = {},\n ): AsyncGenerator<EventSummary, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<EventSummary>(`venues/${encodeURIComponent(String(venueId))}/events`, params as Query, { limit });\n }\n\n /** Typeahead across fighters and events. */\n search(q: string): Promise<Record<string, unknown>> {\n return this.get<Record<string, unknown>>('search', { q });\n }\n\n /**\n * UFCalendar's own editorial archive, newest first. `q` (2+ chars) matches\n * title, summary or a tag; `tag` is exact; `locale` is one of the 13 site\n * languages (English fallback).\n */\n articles(\n opts: { q?: string; tag?: string; locale?: ArticleLocale; limit?: number } = {},\n ): AsyncGenerator<ArticleSummary, void, void> {\n const { limit, ...params } = opts;\n return this.#paginate<ArticleSummary>('articles', params as Query, { limit });\n }\n\n /**\n * One article: full Markdown `body_md` (client widgets removed), author,\n * tags, `published_at`; `served_locale` names the language\n * delivered.\n */\n article(slug: string, opts: { locale?: ArticleLocale } = {}): Promise<Article> {\n return this.get<Article>(`articles/${encodeURIComponent(slug)}`, opts as Query);\n }\n\n /** Your key's month-to-date quota usage. */\n usage(): Promise<Usage> {\n return this.get<Usage>('usage');\n }\n\n /**\n * Subscribable ICS feed URL for calendar apps (authenticates via `?key=`).\n *\n * Throws without a key rather than returning `?key=`: that empty URL is\n * pasted into a calendar app, fails there hours later, and the failure\n * surfaces nowhere near this call.\n */\n calendarIcsUrl(org = 'ufc'): string {\n if (!this.apiKey) {\n throw new FightAPIError(\n 401,\n 'no_api_key',\n 'No API key. Pass new FightAPI(\"ufcalendar_...\") or set UFCALENDAR_API_KEY. ' +\n 'Keys (free plan: 100 requests/month, no card) live at https://www.ufcalendar.com/account/api',\n );\n }\n return `${this.baseUrl}/calendar/${encodeURIComponent(org)}.ics?key=${encodeURIComponent(this.apiKey)}`;\n }\n\n /* ------------------------------------------------------------ webhooks */\n\n webhookEndpoints(): Promise<WebhookEndpoint[]> {\n return this.get<WebhookEndpoint[]>('webhook-endpoints');\n }\n\n /**\n * Register a signed webhook (Pro and up). `events` ⊆ `event.announced`,\n * `fight.result`, `card.changed`, `event.completed`, `odds.moved` (the\n * consensus line on an upcoming bout moved 5+ implied-probability points or\n * the favourite flipped). The signing secret is returned ONCE, in this\n * response.\n */\n async createWebhookEndpoint(url: string, events?: string[]): Promise<WebhookEndpoint> {\n const body: Record<string, unknown> = { url };\n if (events?.length) body.events = events;\n return (await this.#request<WebhookEndpoint>('POST', 'webhook-endpoints', { body })).data;\n }\n\n async deleteWebhookEndpoint(endpointId: number | string): Promise<void> {\n await this.#request<unknown>('DELETE', `webhook-endpoints/${encodeURIComponent(String(endpointId))}`);\n }\n\n async rotateWebhookSecret(endpointId: number | string): Promise<WebhookEndpoint> {\n return (\n await this.#request<WebhookEndpoint>(\n 'POST',\n `webhook-endpoints/${encodeURIComponent(String(endpointId))}/rotate-secret`,\n )\n ).data;\n }\n}\n"],"mappings":";AAEO,IAAM,UAAU;;;ACmFhB,IAAM,mBAAmB;AAChC,IAAM,qBAAqB;AAEpB,IAAM,sBAAsB;AAM5B,IAAM,0BAA0B;AACvC,IAAM,kBAAkB;AA2BjB,IAAM,gBAAN,cAA4B,MAAM;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAgB,MAAc,SAAiB,YAA2B,MAAM;AAC1F,UAAM,GAAG,MAAM,IAAI,IAAI,KAAK,OAAO,GAAG,YAAY,gBAAgB,SAAS,MAAM,EAAE,EAAE;AACrF,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,OAAO;AACZ,SAAK,YAAY;AAAA,EACnB;AACF;AAgBA,SAAS,kBAA2B;AAClC,SAAO,OAAO,aAAa,eAAe,OAAO,WAAW;AAC9D;AAGA,SAAS,kBAAkB,OAAqC;AA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EAAE,KAAK,CAAC,GAAG;AAAA,EACvF;AAAA,EAEA,MAAM,sBAAsB,YAA4C;AACtE,UAAM,KAAK,SAAkB,UAAU,qBAAqB,mBAAmB,OAAO,UAAU,CAAC,CAAC,EAAE;AAAA,EACtG;AAAA,EAEA,MAAM,oBAAoB,YAAuD;AAC/E,YACE,MAAM,KAAK;AAAA,MACT;AAAA,MACA,qBAAqB,mBAAmB,OAAO,UAAU,CAAC,CAAC;AAAA,IAC7D,GACA;AAAA,EACJ;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ufcalendar/sdk",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "MMA Fight Data API client for TypeScript — UFC, PFL, OKTAGON, BKFC, RIZIN events, fight stats, results, rankings history, judges' scorecards and consensus odds.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|