@ufcalendar/sdk 0.8.1 → 0.8.2

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/README.md CHANGED
@@ -62,7 +62,7 @@ List endpoints are **async generators** that follow `meta.pagination.next_cursor
62
62
  | `eventWatch(slug, { country })` | `GET /v1/events/{slug}/watch` — how to watch one event, per country: the rights deals for its series merged with the event's own listings |
63
63
  | `changes({ org, since, kind, limit })` | `GET /v1/changes` — the card-change feed across every event, newest first (paginated; default last 90 days) |
64
64
  | `fight(id, { include: ['odds'] })` / `fightStats(id)` / `fightRounds(id)` | `GET /v1/fights/{id}` / `…/stats` / `…/rounds` |
65
- | `fightOdds(id)` / `eventOdds(slug)` | `GET /v1/fights/{id}/odds` / `GET /v1/events/{slug}/odds` — the UFCalendar consensus line: current, opening, closing (settled bouts), movement and `sources` (how many sportsbooks backed each point). Information only, not betting advice |
65
+ | `fightOdds(id)` / `eventOdds(slug)` | `GET /v1/fights/{id}/odds` / `GET /v1/events/{slug}/odds` — the UFCalendar consensus line: current, opening, closing (settled bouts), movement and `sources` (how many sportsbooks backed each point), plus `props` (method of victory per corner, total rounds over/under, goes the distance). Information only, not betting advice |
66
66
  | `fightOddsHistory(id, { from, to })` | `GET /v1/fights/{id}/odds/history` — every consensus point, oldest first (async generator; Pro plans and up) |
67
67
  | `findFights({ org, titleOnly, method, division, fighter, winner, from, to, mainEventsOnly, order, limit })` | `GET /v1/fights/search` — completed bouts, filtered, newest first (at least one narrowing filter; 25 a page, 10 pages deep) |
68
68
  | `fightScorecards(id)` | `GET /v1/fights/{id}/scorecards` — judges, rounds, totals, deductions |
package/dist/index.cjs CHANGED
@@ -28,7 +28,7 @@ __export(index_exports, {
28
28
  module.exports = __toCommonJS(index_exports);
29
29
 
30
30
  // src/version.ts
31
- var VERSION = "0.8.1";
31
+ var VERSION = "0.8.2";
32
32
 
33
33
  // src/client.ts
34
34
  var DEFAULT_BASE_URL = "https://api.ufcalendar.com/v1";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/version.ts","../src/client.ts"],"sourcesContent":["export { FightAPI, FightAPIError, DEFAULT_BASE_URL } 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.8.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 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\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\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\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\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\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 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 (and the free 1-day trial) 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 let res: Response;\n try {\n res = await this.#fetch(this.#url(path, params), {\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 const text = await res.text();\n let parsed: unknown = undefined;\n try {\n parsed = text ? JSON.parse(text) : undefined;\n } catch {\n parsed = undefined;\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, quotas, the free 1-day trial 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 /** Per-fight totals for both corners. */\n fightStats(fightId: number | string): Promise<Record<string, unknown>[]> {\n return this.get<Record<string, unknown>[]>(`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 * 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 /* ------------------------------------------------------------ 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 * 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 (and the free 1-day trial) 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;;;ACEO,IAAM,UAAU;;;AC2EhB,IAAM,mBAAmB;AAChC,IAAM,qBAAqB;AAkBpB,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;AAEA,SAAS,SAA6B;AACpC,QAAM,MAAO,WAA0E,SAAS;AAChG,SAAO,KAAK,sBAAsB,KAAK;AACzC;AAEO,IAAM,WAAN,MAAe;AAAA,EACX;AAAA,EAC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,MAAM,KAAK;AAAA,MACT;AAAA,MACA,qBAAqB,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 } 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.8.2';\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 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\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\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\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\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\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 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 (and the free 1-day trial) 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 let res: Response;\n try {\n res = await this.#fetch(this.#url(path, params), {\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 const text = await res.text();\n let parsed: unknown = undefined;\n try {\n parsed = text ? JSON.parse(text) : undefined;\n } catch {\n parsed = undefined;\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, quotas, the free 1-day trial 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 /** Per-fight totals for both corners. */\n fightStats(fightId: number | string): Promise<Record<string, unknown>[]> {\n return this.get<Record<string, unknown>[]>(`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 * 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 /* ------------------------------------------------------------ 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 * 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 (and the free 1-day trial) 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;;;ACEO,IAAM,UAAU;;;AC2EhB,IAAM,mBAAmB;AAChC,IAAM,qBAAqB;AAkBpB,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;AAEA,SAAS,SAA6B;AACpC,QAAM,MA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qB,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
@@ -227,6 +227,46 @@ interface OddsBlock {
227
227
  /** When the line last moved. */
228
228
  updated_at: string | null;
229
229
  }
230
+ /** One prop market's consensus price. */
231
+ interface PropLine {
232
+ yes: OddsLine;
233
+ /** Null when fewer than two sportsbooks quote the "no" side. */
234
+ no: OddsLine | null;
235
+ /** "Yes" with the margin removed (method of victory: its share of all six outcomes), 4 places; null when unavailable. */
236
+ fair_probability: number | null;
237
+ /** How many sportsbooks backed this price. */
238
+ sources: number;
239
+ recorded_at: string;
240
+ }
241
+ /** Over/under on one rounds line. */
242
+ interface PropTotalRounds {
243
+ line: number;
244
+ over: OddsLine;
245
+ under: OddsLine | null;
246
+ fair_probability_over: number | null;
247
+ sources: number;
248
+ recorded_at: string;
249
+ }
250
+ /** Method of victory for one corner. */
251
+ interface PropMethodCorner {
252
+ ko: PropLine | null;
253
+ sub: PropLine | null;
254
+ dec: PropLine | null;
255
+ }
256
+ /** Prop-market consensus for one bout (information only, not betting advice). */
257
+ interface FightProps {
258
+ method: {
259
+ a: PropMethodCorner;
260
+ b: PropMethodCorner;
261
+ };
262
+ /** Ascending by line; the one with the most `sources` is the main line. */
263
+ total_rounds: PropTotalRounds[];
264
+ /** Goes the distance (yes) or ends inside it (no). */
265
+ distance: PropLine | null;
266
+ /** True once settled: every price is the last before the event start. */
267
+ closing: boolean;
268
+ updated_at: string | null;
269
+ }
230
270
  /** `GET /v1/fights/{id}/odds`. */
231
271
  interface FightOdds extends OddsBlock {
232
272
  fight_id: number;
@@ -242,6 +282,8 @@ interface FightOdds extends OddsBlock {
242
282
  slug: string;
243
283
  name: string;
244
284
  } | null;
285
+ /** Prop markets; null when no sportsbooks price them. */
286
+ props: FightProps | null;
245
287
  }
246
288
  /** One bout of `GET /v1/events/{id}/odds`. */
247
289
  interface EventOddsRow extends OddsBlock {
@@ -257,6 +299,8 @@ interface EventOddsRow extends OddsBlock {
257
299
  slug: string;
258
300
  name: string;
259
301
  } | null;
302
+ /** Prop markets; null when no sportsbooks price them. */
303
+ props: FightProps | null;
260
304
  }
261
305
  /** `GET /v1/events/{id}/odds` — card order, non-cancelled bouts, unpriced included. */
262
306
  interface EventOdds {
@@ -1694,7 +1738,7 @@ declare class FightAPI {
1694
1738
 
1695
1739
  /** Kept in lockstep with package.json and the User-Agent by
1696
1740
  * `apps/api/src/surfaces.test.ts`. Bump all three together. */
1697
- declare const VERSION = "0.8.1";
1741
+ declare const VERSION = "0.8.2";
1698
1742
 
1699
1743
  /**
1700
1744
  * This file was auto-generated by openapi-typescript.
@@ -3229,7 +3273,7 @@ interface paths {
3229
3273
  };
3230
3274
  /**
3231
3275
  * Consensus odds for one card
3232
- * @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. Information only, not betting advice. An unknown event 404s.
3276
+ * @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.
3233
3277
  */
3234
3278
  get: {
3235
3279
  parameters: {
@@ -3340,7 +3384,8 @@ interface paths {
3340
3384
  * "since": "2025-11-15T23:00:00.000Z"
3341
3385
  * },
3342
3386
  * "points": 1,
3343
- * "updated_at": "2025-11-15T23:00:00.000Z"
3387
+ * "updated_at": "2025-11-15T23:00:00.000Z",
3388
+ * "props": null
3344
3389
  * }
3345
3390
  * ]
3346
3391
  * },
@@ -4422,7 +4467,9 @@ interface paths {
4422
4467
  };
4423
4468
  /**
4424
4469
  * Consensus odds for one bout
4425
- * @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. Information only, not betting advice.
4470
+ * @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.
4471
+ *
4472
+ * `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 event starts, so a settled bout carries its closing props (`closing: true`). Books post props in fight week. Information only, not betting advice.
4426
4473
  */
4427
4474
  get: {
4428
4475
  parameters: {
@@ -4529,7 +4576,136 @@ interface paths {
4529
4576
  * "since": "2026-08-18T22:50:43.418Z"
4530
4577
  * },
4531
4578
  * "points": 57,
4532
- * "updated_at": "2026-08-29T10:50:34.350Z"
4579
+ * "updated_at": "2026-08-29T10:50:34.350Z",
4580
+ * "props": {
4581
+ * "method": {
4582
+ * "a": {
4583
+ * "ko": {
4584
+ * "yes": {
4585
+ * "american": 411,
4586
+ * "decimal": 5.11,
4587
+ * "implied_probability": 0.1957
4588
+ * },
4589
+ * "no": null,
4590
+ * "fair_probability": 0.1649,
4591
+ * "sources": 12,
4592
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4593
+ * },
4594
+ * "sub": {
4595
+ * "yes": {
4596
+ * "american": 1322,
4597
+ * "decimal": 14.22,
4598
+ * "implied_probability": 0.0703
4599
+ * },
4600
+ * "no": null,
4601
+ * "fair_probability": 0.0593,
4602
+ * "sources": 12,
4603
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4604
+ * },
4605
+ * "dec": {
4606
+ * "yes": {
4607
+ * "american": 290,
4608
+ * "decimal": 3.9,
4609
+ * "implied_probability": 0.2564
4610
+ * },
4611
+ * "no": {
4612
+ * "american": -425,
4613
+ * "decimal": 1.235,
4614
+ * "implied_probability": 0.8095
4615
+ * },
4616
+ * "fair_probability": 0.216,
4617
+ * "sources": 11,
4618
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4619
+ * }
4620
+ * },
4621
+ * "b": {
4622
+ * "ko": {
4623
+ * "yes": {
4624
+ * "american": 462,
4625
+ * "decimal": 5.62,
4626
+ * "implied_probability": 0.1779
4627
+ * },
4628
+ * "no": null,
4629
+ * "fair_probability": 0.1499,
4630
+ * "sources": 12,
4631
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4632
+ * },
4633
+ * "sub": {
4634
+ * "yes": {
4635
+ * "american": 1078,
4636
+ * "decimal": 11.78,
4637
+ * "implied_probability": 0.0849
4638
+ * },
4639
+ * "no": null,
4640
+ * "fair_probability": 0.0715,
4641
+ * "sources": 12,
4642
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4643
+ * },
4644
+ * "dec": {
4645
+ * "yes": {
4646
+ * "american": 149,
4647
+ * "decimal": 2.49,
4648
+ * "implied_probability": 0.4016
4649
+ * },
4650
+ * "no": null,
4651
+ * "fair_probability": 0.3384,
4652
+ * "sources": 11,
4653
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4654
+ * }
4655
+ * }
4656
+ * },
4657
+ * "total_rounds": [
4658
+ * {
4659
+ * "line": 1.5,
4660
+ * "over": {
4661
+ * "american": -386,
4662
+ * "decimal": 1.259,
4663
+ * "implied_probability": 0.7942
4664
+ * },
4665
+ * "under": {
4666
+ * "american": 258,
4667
+ * "decimal": 3.58,
4668
+ * "implied_probability": 0.2793
4669
+ * },
4670
+ * "fair_probability_over": 0.7398,
4671
+ * "sources": 4,
4672
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4673
+ * },
4674
+ * {
4675
+ * "line": 2.5,
4676
+ * "over": {
4677
+ * "american": -193,
4678
+ * "decimal": 1.518,
4679
+ * "implied_probability": 0.6587
4680
+ * },
4681
+ * "under": {
4682
+ * "american": 153,
4683
+ * "decimal": 2.53,
4684
+ * "implied_probability": 0.3953
4685
+ * },
4686
+ * "fair_probability_over": 0.625,
4687
+ * "sources": 17,
4688
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4689
+ * }
4690
+ * ],
4691
+ * "distance": {
4692
+ * "yes": {
4693
+ * "american": -160,
4694
+ * "decimal": 1.625,
4695
+ * "implied_probability": 0.6154
4696
+ * },
4697
+ * "no": {
4698
+ * "american": 123,
4699
+ * "decimal": 2.23,
4700
+ * "implied_probability": 0.4484
4701
+ * },
4702
+ * "fair_probability": 0.5785,
4703
+ * "sources": 11,
4704
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4705
+ * },
4706
+ * "closing": true,
4707
+ * "updated_at": "2026-08-29T07:00:00.000Z"
4708
+ * }
4533
4709
  * },
4534
4710
  * "meta": {
4535
4711
  * "note": "UFCalendar consensus line across the sportsbooks we track (book identities are not exposed). Information only, not betting advice.",
@@ -11846,7 +12022,62 @@ interface components {
11846
12022
  */
11847
12023
  since: string;
11848
12024
  };
11849
- /** @description The consensus line of one bout: current, opening, closing (settled bouts) and the movement between opening and the current line (the close once settled). */
12025
+ /** @description One prop market's consensus price: the mean, in decimal space, across the sportsbooks we track, converted back to American. */
12026
+ PropLine: {
12027
+ yes: components["schemas"]["OddsLine"];
12028
+ /** @description Null when fewer than two sportsbooks quote the "no" side (method-of-victory props are mostly quoted "yes" only). */
12029
+ no: components["schemas"]["OddsLine"] | null;
12030
+ /** @description The "yes" outcome with the market margin removed, 4 places: from the yes/no pair, or for method of victory its share of all six outcomes (both corners × KO/TKO, submission, decision) when all six are priced. Null otherwise. */
12031
+ fair_probability: number | null;
12032
+ /** @description How many sportsbooks backed this price. Book identities are never exposed. */
12033
+ sources: number;
12034
+ /**
12035
+ * Format: date-time
12036
+ * @description When this price was recorded (the last move).
12037
+ */
12038
+ recorded_at: string;
12039
+ };
12040
+ PropTotalRounds: {
12041
+ /** @description Rounds line (0.5, 1.5, 2.5, 3.5 or 4.5). */
12042
+ line: number;
12043
+ over: components["schemas"]["OddsLine"];
12044
+ /** @description Null when fewer than two sportsbooks quote the under. */
12045
+ under: components["schemas"]["OddsLine"] | null;
12046
+ /** @description Over with the market margin removed (from the over/under pair), 4 places; null without an under. */
12047
+ fair_probability_over: number | null;
12048
+ /** @description How many sportsbooks backed the over. */
12049
+ sources: number;
12050
+ /** Format: date-time */
12051
+ recorded_at: string;
12052
+ };
12053
+ PropMethodCorner: {
12054
+ /** @description This corner wins by KO/TKO. */
12055
+ ko: components["schemas"]["PropLine"] | null;
12056
+ /** @description This corner wins by submission. */
12057
+ sub: components["schemas"]["PropLine"] | null;
12058
+ /** @description This corner wins by decision. */
12059
+ dec: components["schemas"]["PropLine"] | null;
12060
+ };
12061
+ /** @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 starts. Information only, not betting advice. */
12062
+ FightProps: {
12063
+ /** @description Method of victory per corner (oriented to the bout's `fighter_a` / `fighter_b`). */
12064
+ method: {
12065
+ a: components["schemas"]["PropMethodCorner"];
12066
+ b: components["schemas"]["PropMethodCorner"];
12067
+ };
12068
+ /** @description Over/under per rounds line, ascending. The line with the most `sources` is the main one. */
12069
+ total_rounds: components["schemas"]["PropTotalRounds"][];
12070
+ /** @description The fight goes the distance (yes) or ends inside it (no). */
12071
+ distance: components["schemas"]["PropLine"] | null;
12072
+ /** @description True once the bout is settled: every price is the last one before the event start. */
12073
+ closing: boolean;
12074
+ /**
12075
+ * Format: date-time
12076
+ * @description When any market here last moved.
12077
+ */
12078
+ updated_at: string | null;
12079
+ };
12080
+ /** @description The consensus line of one bout: current, opening, closing (settled bouts) and the movement between opening and the current line (the close once settled), plus the prop markets. */
11850
12081
  FightOdds: {
11851
12082
  fight_id: number;
11852
12083
  status: components["schemas"]["FightStatus"] | null;
@@ -11882,8 +12113,10 @@ interface components {
11882
12113
  * @description When the line last moved (= `consensus.recorded_at`).
11883
12114
  */
11884
12115
  updated_at: string | null;
12116
+ /** @description Prop-market consensus (method of victory, total rounds, goes the distance); null when no sportsbooks price props for the bout. */
12117
+ props: components["schemas"]["FightProps"] | null;
11885
12118
  };
11886
- /** @description One bout of a card with its consensus line. Unpriced bouts stay on the list with nulls and `points: 0`. */
12119
+ /** @description One bout of a card with its consensus line and prop markets. Unpriced bouts stay on the list with nulls and `points: 0`. */
11887
12120
  EventOddsRow: {
11888
12121
  fight_id: number;
11889
12122
  status: components["schemas"]["FightStatus"] | null;
@@ -11911,6 +12144,8 @@ interface components {
11911
12144
  * @description When the line last moved (= `consensus.recorded_at`).
11912
12145
  */
11913
12146
  updated_at: string | null;
12147
+ /** @description Prop-market consensus (method of victory, total rounds, goes the distance); null when no sportsbooks price props for the bout. */
12148
+ props: components["schemas"]["FightProps"] | null;
11914
12149
  };
11915
12150
  EventOdds: {
11916
12151
  event: components["schemas"]["StorylineEvent"];
@@ -12694,4 +12929,4 @@ interface components {
12694
12929
  }
12695
12930
  type operations = Record<string, never>;
12696
12931
 
12697
- export { type Article, type ArticleLocale, type ArticleSummary, type BonusAward, type BonusLedger, type Broadcast, type BroadcastRight, type CareerBout, type CareerStats, type Champion, type ChangeFeedEntry, type ChangeKind, type Compare, type CompareAggregates, type CompareBout, type CredentialConfidence, DEFAULT_BASE_URL, type DissentingJudge, type Envelope, type EventChange, type EventDetail, type EventHeadline, type EventInclude, type EventListInclude, type EventOdds, type EventOddsRow, type EventPickem, type EventRef, type EventStatus, type EventStorylines, type EventSummary, type EventWatch, type Fight, FightAPI, FightAPIError, type FightAPIOptions, type FightInclude, type FightOdds, type FightResult, type FightSearchMethod, type FightSearchRow, type Fighter, type FighterAffiliation, type FighterBout, type FighterCredential, type FighterCredentials, type FighterImage, type FighterInclude, type FighterRef, type FighterSummary, type HeadlineCorner, type Judge, type JudgeColleague, type JudgeLeague, type JudgeScorecardRow, type LeaderboardRow, type MatchmakerCorner, type MatchmakerTag, type Matchup, type Meta, type MethodNormalized, type OddsBlock, type OddsHistoryPoint, type OddsLine, type OddsMovement, type OddsPair, type Org, type OrgDivision, type PickemSplit, type Plan, type Plans, type PowerIndex, type PowerIndexFighter, type PowerIndexMover, type PowerIndexRow, type PowerIndexView, type ProbabilitySource, type PublicSource, type Query, type QueryValue, type RankingDivision, type RankingEntry, type RankingsBoard, type RateLimit, type RecordBookSection, type RecordEntry, type RightsSeries, type Scorecard, type ScorecardRound, type Scorecards, type SplitDecisionRow, type StatMetric, type StatScope, type StatsPanel, type StorylineCorner, type StorylineTag, type Usage, VERSION, type Venue, type WatchProvider, type WebhookEndpoint, type WhosNext, type YearStats, type operations, type paths };
12932
+ export { type Article, type ArticleLocale, type ArticleSummary, type BonusAward, type BonusLedger, type Broadcast, type BroadcastRight, type CareerBout, type CareerStats, type Champion, type ChangeFeedEntry, type ChangeKind, type Compare, type CompareAggregates, type CompareBout, type CredentialConfidence, DEFAULT_BASE_URL, type DissentingJudge, type Envelope, type EventChange, type EventDetail, type EventHeadline, type EventInclude, type EventListInclude, type EventOdds, type EventOddsRow, type EventPickem, type EventRef, type EventStatus, type EventStorylines, type EventSummary, type EventWatch, type Fight, FightAPI, FightAPIError, type FightAPIOptions, type FightInclude, type FightOdds, type FightProps, type FightResult, type FightSearchMethod, type FightSearchRow, type Fighter, type FighterAffiliation, type FighterBout, type FighterCredential, type FighterCredentials, type FighterImage, type FighterInclude, type FighterRef, type FighterSummary, type HeadlineCorner, type Judge, type JudgeColleague, type JudgeLeague, type JudgeScorecardRow, type LeaderboardRow, type MatchmakerCorner, type MatchmakerTag, type Matchup, type Meta, type MethodNormalized, type OddsBlock, type OddsHistoryPoint, type OddsLine, type OddsMovement, type OddsPair, type Org, type OrgDivision, type PickemSplit, type Plan, type Plans, type PowerIndex, type PowerIndexFighter, type PowerIndexMover, type PowerIndexRow, type PowerIndexView, type ProbabilitySource, type PropLine, type PropMethodCorner, type PropTotalRounds, type PublicSource, type Query, type QueryValue, type RankingDivision, type RankingEntry, type RankingsBoard, type RateLimit, type RecordBookSection, type RecordEntry, type RightsSeries, type Scorecard, type ScorecardRound, type Scorecards, type SplitDecisionRow, type StatMetric, type StatScope, type StatsPanel, type StorylineCorner, type StorylineTag, type Usage, VERSION, type Venue, type WatchProvider, type WebhookEndpoint, type WhosNext, type YearStats, type operations, type paths };
package/dist/index.d.ts CHANGED
@@ -227,6 +227,46 @@ interface OddsBlock {
227
227
  /** When the line last moved. */
228
228
  updated_at: string | null;
229
229
  }
230
+ /** One prop market's consensus price. */
231
+ interface PropLine {
232
+ yes: OddsLine;
233
+ /** Null when fewer than two sportsbooks quote the "no" side. */
234
+ no: OddsLine | null;
235
+ /** "Yes" with the margin removed (method of victory: its share of all six outcomes), 4 places; null when unavailable. */
236
+ fair_probability: number | null;
237
+ /** How many sportsbooks backed this price. */
238
+ sources: number;
239
+ recorded_at: string;
240
+ }
241
+ /** Over/under on one rounds line. */
242
+ interface PropTotalRounds {
243
+ line: number;
244
+ over: OddsLine;
245
+ under: OddsLine | null;
246
+ fair_probability_over: number | null;
247
+ sources: number;
248
+ recorded_at: string;
249
+ }
250
+ /** Method of victory for one corner. */
251
+ interface PropMethodCorner {
252
+ ko: PropLine | null;
253
+ sub: PropLine | null;
254
+ dec: PropLine | null;
255
+ }
256
+ /** Prop-market consensus for one bout (information only, not betting advice). */
257
+ interface FightProps {
258
+ method: {
259
+ a: PropMethodCorner;
260
+ b: PropMethodCorner;
261
+ };
262
+ /** Ascending by line; the one with the most `sources` is the main line. */
263
+ total_rounds: PropTotalRounds[];
264
+ /** Goes the distance (yes) or ends inside it (no). */
265
+ distance: PropLine | null;
266
+ /** True once settled: every price is the last before the event start. */
267
+ closing: boolean;
268
+ updated_at: string | null;
269
+ }
230
270
  /** `GET /v1/fights/{id}/odds`. */
231
271
  interface FightOdds extends OddsBlock {
232
272
  fight_id: number;
@@ -242,6 +282,8 @@ interface FightOdds extends OddsBlock {
242
282
  slug: string;
243
283
  name: string;
244
284
  } | null;
285
+ /** Prop markets; null when no sportsbooks price them. */
286
+ props: FightProps | null;
245
287
  }
246
288
  /** One bout of `GET /v1/events/{id}/odds`. */
247
289
  interface EventOddsRow extends OddsBlock {
@@ -257,6 +299,8 @@ interface EventOddsRow extends OddsBlock {
257
299
  slug: string;
258
300
  name: string;
259
301
  } | null;
302
+ /** Prop markets; null when no sportsbooks price them. */
303
+ props: FightProps | null;
260
304
  }
261
305
  /** `GET /v1/events/{id}/odds` — card order, non-cancelled bouts, unpriced included. */
262
306
  interface EventOdds {
@@ -1694,7 +1738,7 @@ declare class FightAPI {
1694
1738
 
1695
1739
  /** Kept in lockstep with package.json and the User-Agent by
1696
1740
  * `apps/api/src/surfaces.test.ts`. Bump all three together. */
1697
- declare const VERSION = "0.8.1";
1741
+ declare const VERSION = "0.8.2";
1698
1742
 
1699
1743
  /**
1700
1744
  * This file was auto-generated by openapi-typescript.
@@ -3229,7 +3273,7 @@ interface paths {
3229
3273
  };
3230
3274
  /**
3231
3275
  * Consensus odds for one card
3232
- * @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. Information only, not betting advice. An unknown event 404s.
3276
+ * @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.
3233
3277
  */
3234
3278
  get: {
3235
3279
  parameters: {
@@ -3340,7 +3384,8 @@ interface paths {
3340
3384
  * "since": "2025-11-15T23:00:00.000Z"
3341
3385
  * },
3342
3386
  * "points": 1,
3343
- * "updated_at": "2025-11-15T23:00:00.000Z"
3387
+ * "updated_at": "2025-11-15T23:00:00.000Z",
3388
+ * "props": null
3344
3389
  * }
3345
3390
  * ]
3346
3391
  * },
@@ -4422,7 +4467,9 @@ interface paths {
4422
4467
  };
4423
4468
  /**
4424
4469
  * Consensus odds for one bout
4425
- * @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. Information only, not betting advice.
4470
+ * @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.
4471
+ *
4472
+ * `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 event starts, so a settled bout carries its closing props (`closing: true`). Books post props in fight week. Information only, not betting advice.
4426
4473
  */
4427
4474
  get: {
4428
4475
  parameters: {
@@ -4529,7 +4576,136 @@ interface paths {
4529
4576
  * "since": "2026-08-18T22:50:43.418Z"
4530
4577
  * },
4531
4578
  * "points": 57,
4532
- * "updated_at": "2026-08-29T10:50:34.350Z"
4579
+ * "updated_at": "2026-08-29T10:50:34.350Z",
4580
+ * "props": {
4581
+ * "method": {
4582
+ * "a": {
4583
+ * "ko": {
4584
+ * "yes": {
4585
+ * "american": 411,
4586
+ * "decimal": 5.11,
4587
+ * "implied_probability": 0.1957
4588
+ * },
4589
+ * "no": null,
4590
+ * "fair_probability": 0.1649,
4591
+ * "sources": 12,
4592
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4593
+ * },
4594
+ * "sub": {
4595
+ * "yes": {
4596
+ * "american": 1322,
4597
+ * "decimal": 14.22,
4598
+ * "implied_probability": 0.0703
4599
+ * },
4600
+ * "no": null,
4601
+ * "fair_probability": 0.0593,
4602
+ * "sources": 12,
4603
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4604
+ * },
4605
+ * "dec": {
4606
+ * "yes": {
4607
+ * "american": 290,
4608
+ * "decimal": 3.9,
4609
+ * "implied_probability": 0.2564
4610
+ * },
4611
+ * "no": {
4612
+ * "american": -425,
4613
+ * "decimal": 1.235,
4614
+ * "implied_probability": 0.8095
4615
+ * },
4616
+ * "fair_probability": 0.216,
4617
+ * "sources": 11,
4618
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4619
+ * }
4620
+ * },
4621
+ * "b": {
4622
+ * "ko": {
4623
+ * "yes": {
4624
+ * "american": 462,
4625
+ * "decimal": 5.62,
4626
+ * "implied_probability": 0.1779
4627
+ * },
4628
+ * "no": null,
4629
+ * "fair_probability": 0.1499,
4630
+ * "sources": 12,
4631
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4632
+ * },
4633
+ * "sub": {
4634
+ * "yes": {
4635
+ * "american": 1078,
4636
+ * "decimal": 11.78,
4637
+ * "implied_probability": 0.0849
4638
+ * },
4639
+ * "no": null,
4640
+ * "fair_probability": 0.0715,
4641
+ * "sources": 12,
4642
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4643
+ * },
4644
+ * "dec": {
4645
+ * "yes": {
4646
+ * "american": 149,
4647
+ * "decimal": 2.49,
4648
+ * "implied_probability": 0.4016
4649
+ * },
4650
+ * "no": null,
4651
+ * "fair_probability": 0.3384,
4652
+ * "sources": 11,
4653
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4654
+ * }
4655
+ * }
4656
+ * },
4657
+ * "total_rounds": [
4658
+ * {
4659
+ * "line": 1.5,
4660
+ * "over": {
4661
+ * "american": -386,
4662
+ * "decimal": 1.259,
4663
+ * "implied_probability": 0.7942
4664
+ * },
4665
+ * "under": {
4666
+ * "american": 258,
4667
+ * "decimal": 3.58,
4668
+ * "implied_probability": 0.2793
4669
+ * },
4670
+ * "fair_probability_over": 0.7398,
4671
+ * "sources": 4,
4672
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4673
+ * },
4674
+ * {
4675
+ * "line": 2.5,
4676
+ * "over": {
4677
+ * "american": -193,
4678
+ * "decimal": 1.518,
4679
+ * "implied_probability": 0.6587
4680
+ * },
4681
+ * "under": {
4682
+ * "american": 153,
4683
+ * "decimal": 2.53,
4684
+ * "implied_probability": 0.3953
4685
+ * },
4686
+ * "fair_probability_over": 0.625,
4687
+ * "sources": 17,
4688
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4689
+ * }
4690
+ * ],
4691
+ * "distance": {
4692
+ * "yes": {
4693
+ * "american": -160,
4694
+ * "decimal": 1.625,
4695
+ * "implied_probability": 0.6154
4696
+ * },
4697
+ * "no": {
4698
+ * "american": 123,
4699
+ * "decimal": 2.23,
4700
+ * "implied_probability": 0.4484
4701
+ * },
4702
+ * "fair_probability": 0.5785,
4703
+ * "sources": 11,
4704
+ * "recorded_at": "2026-08-29T07:00:00.000Z"
4705
+ * },
4706
+ * "closing": true,
4707
+ * "updated_at": "2026-08-29T07:00:00.000Z"
4708
+ * }
4533
4709
  * },
4534
4710
  * "meta": {
4535
4711
  * "note": "UFCalendar consensus line across the sportsbooks we track (book identities are not exposed). Information only, not betting advice.",
@@ -11846,7 +12022,62 @@ interface components {
11846
12022
  */
11847
12023
  since: string;
11848
12024
  };
11849
- /** @description The consensus line of one bout: current, opening, closing (settled bouts) and the movement between opening and the current line (the close once settled). */
12025
+ /** @description One prop market's consensus price: the mean, in decimal space, across the sportsbooks we track, converted back to American. */
12026
+ PropLine: {
12027
+ yes: components["schemas"]["OddsLine"];
12028
+ /** @description Null when fewer than two sportsbooks quote the "no" side (method-of-victory props are mostly quoted "yes" only). */
12029
+ no: components["schemas"]["OddsLine"] | null;
12030
+ /** @description The "yes" outcome with the market margin removed, 4 places: from the yes/no pair, or for method of victory its share of all six outcomes (both corners × KO/TKO, submission, decision) when all six are priced. Null otherwise. */
12031
+ fair_probability: number | null;
12032
+ /** @description How many sportsbooks backed this price. Book identities are never exposed. */
12033
+ sources: number;
12034
+ /**
12035
+ * Format: date-time
12036
+ * @description When this price was recorded (the last move).
12037
+ */
12038
+ recorded_at: string;
12039
+ };
12040
+ PropTotalRounds: {
12041
+ /** @description Rounds line (0.5, 1.5, 2.5, 3.5 or 4.5). */
12042
+ line: number;
12043
+ over: components["schemas"]["OddsLine"];
12044
+ /** @description Null when fewer than two sportsbooks quote the under. */
12045
+ under: components["schemas"]["OddsLine"] | null;
12046
+ /** @description Over with the market margin removed (from the over/under pair), 4 places; null without an under. */
12047
+ fair_probability_over: number | null;
12048
+ /** @description How many sportsbooks backed the over. */
12049
+ sources: number;
12050
+ /** Format: date-time */
12051
+ recorded_at: string;
12052
+ };
12053
+ PropMethodCorner: {
12054
+ /** @description This corner wins by KO/TKO. */
12055
+ ko: components["schemas"]["PropLine"] | null;
12056
+ /** @description This corner wins by submission. */
12057
+ sub: components["schemas"]["PropLine"] | null;
12058
+ /** @description This corner wins by decision. */
12059
+ dec: components["schemas"]["PropLine"] | null;
12060
+ };
12061
+ /** @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 starts. Information only, not betting advice. */
12062
+ FightProps: {
12063
+ /** @description Method of victory per corner (oriented to the bout's `fighter_a` / `fighter_b`). */
12064
+ method: {
12065
+ a: components["schemas"]["PropMethodCorner"];
12066
+ b: components["schemas"]["PropMethodCorner"];
12067
+ };
12068
+ /** @description Over/under per rounds line, ascending. The line with the most `sources` is the main one. */
12069
+ total_rounds: components["schemas"]["PropTotalRounds"][];
12070
+ /** @description The fight goes the distance (yes) or ends inside it (no). */
12071
+ distance: components["schemas"]["PropLine"] | null;
12072
+ /** @description True once the bout is settled: every price is the last one before the event start. */
12073
+ closing: boolean;
12074
+ /**
12075
+ * Format: date-time
12076
+ * @description When any market here last moved.
12077
+ */
12078
+ updated_at: string | null;
12079
+ };
12080
+ /** @description The consensus line of one bout: current, opening, closing (settled bouts) and the movement between opening and the current line (the close once settled), plus the prop markets. */
11850
12081
  FightOdds: {
11851
12082
  fight_id: number;
11852
12083
  status: components["schemas"]["FightStatus"] | null;
@@ -11882,8 +12113,10 @@ interface components {
11882
12113
  * @description When the line last moved (= `consensus.recorded_at`).
11883
12114
  */
11884
12115
  updated_at: string | null;
12116
+ /** @description Prop-market consensus (method of victory, total rounds, goes the distance); null when no sportsbooks price props for the bout. */
12117
+ props: components["schemas"]["FightProps"] | null;
11885
12118
  };
11886
- /** @description One bout of a card with its consensus line. Unpriced bouts stay on the list with nulls and `points: 0`. */
12119
+ /** @description One bout of a card with its consensus line and prop markets. Unpriced bouts stay on the list with nulls and `points: 0`. */
11887
12120
  EventOddsRow: {
11888
12121
  fight_id: number;
11889
12122
  status: components["schemas"]["FightStatus"] | null;
@@ -11911,6 +12144,8 @@ interface components {
11911
12144
  * @description When the line last moved (= `consensus.recorded_at`).
11912
12145
  */
11913
12146
  updated_at: string | null;
12147
+ /** @description Prop-market consensus (method of victory, total rounds, goes the distance); null when no sportsbooks price props for the bout. */
12148
+ props: components["schemas"]["FightProps"] | null;
11914
12149
  };
11915
12150
  EventOdds: {
11916
12151
  event: components["schemas"]["StorylineEvent"];
@@ -12694,4 +12929,4 @@ interface components {
12694
12929
  }
12695
12930
  type operations = Record<string, never>;
12696
12931
 
12697
- export { type Article, type ArticleLocale, type ArticleSummary, type BonusAward, type BonusLedger, type Broadcast, type BroadcastRight, type CareerBout, type CareerStats, type Champion, type ChangeFeedEntry, type ChangeKind, type Compare, type CompareAggregates, type CompareBout, type CredentialConfidence, DEFAULT_BASE_URL, type DissentingJudge, type Envelope, type EventChange, type EventDetail, type EventHeadline, type EventInclude, type EventListInclude, type EventOdds, type EventOddsRow, type EventPickem, type EventRef, type EventStatus, type EventStorylines, type EventSummary, type EventWatch, type Fight, FightAPI, FightAPIError, type FightAPIOptions, type FightInclude, type FightOdds, type FightResult, type FightSearchMethod, type FightSearchRow, type Fighter, type FighterAffiliation, type FighterBout, type FighterCredential, type FighterCredentials, type FighterImage, type FighterInclude, type FighterRef, type FighterSummary, type HeadlineCorner, type Judge, type JudgeColleague, type JudgeLeague, type JudgeScorecardRow, type LeaderboardRow, type MatchmakerCorner, type MatchmakerTag, type Matchup, type Meta, type MethodNormalized, type OddsBlock, type OddsHistoryPoint, type OddsLine, type OddsMovement, type OddsPair, type Org, type OrgDivision, type PickemSplit, type Plan, type Plans, type PowerIndex, type PowerIndexFighter, type PowerIndexMover, type PowerIndexRow, type PowerIndexView, type ProbabilitySource, type PublicSource, type Query, type QueryValue, type RankingDivision, type RankingEntry, type RankingsBoard, type RateLimit, type RecordBookSection, type RecordEntry, type RightsSeries, type Scorecard, type ScorecardRound, type Scorecards, type SplitDecisionRow, type StatMetric, type StatScope, type StatsPanel, type StorylineCorner, type StorylineTag, type Usage, VERSION, type Venue, type WatchProvider, type WebhookEndpoint, type WhosNext, type YearStats, type operations, type paths };
12932
+ export { type Article, type ArticleLocale, type ArticleSummary, type BonusAward, type BonusLedger, type Broadcast, type BroadcastRight, type CareerBout, type CareerStats, type Champion, type ChangeFeedEntry, type ChangeKind, type Compare, type CompareAggregates, type CompareBout, type CredentialConfidence, DEFAULT_BASE_URL, type DissentingJudge, type Envelope, type EventChange, type EventDetail, type EventHeadline, type EventInclude, type EventListInclude, type EventOdds, type EventOddsRow, type EventPickem, type EventRef, type EventStatus, type EventStorylines, type EventSummary, type EventWatch, type Fight, FightAPI, FightAPIError, type FightAPIOptions, type FightInclude, type FightOdds, type FightProps, type FightResult, type FightSearchMethod, type FightSearchRow, type Fighter, type FighterAffiliation, type FighterBout, type FighterCredential, type FighterCredentials, type FighterImage, type FighterInclude, type FighterRef, type FighterSummary, type HeadlineCorner, type Judge, type JudgeColleague, type JudgeLeague, type JudgeScorecardRow, type LeaderboardRow, type MatchmakerCorner, type MatchmakerTag, type Matchup, type Meta, type MethodNormalized, type OddsBlock, type OddsHistoryPoint, type OddsLine, type OddsMovement, type OddsPair, type Org, type OrgDivision, type PickemSplit, type Plan, type Plans, type PowerIndex, type PowerIndexFighter, type PowerIndexMover, type PowerIndexRow, type PowerIndexView, type ProbabilitySource, type PropLine, type PropMethodCorner, type PropTotalRounds, type PublicSource, type Query, type QueryValue, type RankingDivision, type RankingEntry, type RankingsBoard, type RateLimit, type RecordBookSection, type RecordEntry, type RightsSeries, type Scorecard, type ScorecardRound, type Scorecards, type SplitDecisionRow, type StatMetric, type StatScope, type StatsPanel, type StorylineCorner, type StorylineTag, type Usage, VERSION, type Venue, type WatchProvider, type WebhookEndpoint, type WhosNext, type YearStats, type operations, type paths };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "0.8.1";
2
+ var VERSION = "0.8.2";
3
3
 
4
4
  // src/client.ts
5
5
  var DEFAULT_BASE_URL = "https://api.ufcalendar.com/v1";
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.8.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 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\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\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\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\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\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 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 (and the free 1-day trial) 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 let res: Response;\n try {\n res = await this.#fetch(this.#url(path, params), {\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 const text = await res.text();\n let parsed: unknown = undefined;\n try {\n parsed = text ? JSON.parse(text) : undefined;\n } catch {\n parsed = undefined;\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, quotas, the free 1-day trial 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 /** Per-fight totals for both corners. */\n fightStats(fightId: number | string): Promise<Record<string, unknown>[]> {\n return this.get<Record<string, unknown>[]>(`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 * 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 /* ------------------------------------------------------------ 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 * 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 (and the free 1-day trial) 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;;;AC2EhB,IAAM,mBAAmB;AAChC,IAAM,qBAAqB;AAkBpB,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;AAEA,SAAS,SAA6B;AACpC,QAAM,MAAO,WAA0E,SAAS;AAChG,SAAO,KAAK,sBAAsB,KAAK;AACzC;AAEO,IAAM,WAAN,MAAe;AAAA,EACX;AAAA,EACA;AAAA;AAAA,EAGT,WAAwB;AAAA;AAAA,EAExB,gBAA2B,EAAE,OAAO,MAAM,WAAW,MAAM,OAAO,KAAK;AAAA,EAE9D;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,iBAA4C,UAA2B,CAAC,GAAG;AACrF,UAAM,OACJ,OAAO,oBAAoB,WACvB,EAAE,GAAG,SAAS,QAAQ,gBAAgB,IACtC,EAAE,GAAG,SAAS,GAAI,mBAAmB,CAAC,EAAG;AAC/C,SAAK,SAAS,KAAK,UAAU,OAAO;AACpC,SAAK,WAAW,KAAK,WAAW,kBAAkB,QAAQ,QAAQ,EAAE;AACpE,SAAK,SAAS,KAAK,SAAS,WAAW;AACvC,SAAK,aAAa,KAAK,aAAa;AACpC,SAAK,WAAW,KAAK,WAAW,CAAC;AACjC,QAAI,CAAC,KAAK,QAAQ;AAChB,YAAM,IA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,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.8.2';\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 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\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\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\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\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\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 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 (and the free 1-day trial) 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 let res: Response;\n try {\n res = await this.#fetch(this.#url(path, params), {\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 const text = await res.text();\n let parsed: unknown = undefined;\n try {\n parsed = text ? JSON.parse(text) : undefined;\n } catch {\n parsed = undefined;\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, quotas, the free 1-day trial 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 /** Per-fight totals for both corners. */\n fightStats(fightId: number | string): Promise<Record<string, unknown>[]> {\n return this.get<Record<string, unknown>[]>(`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 * 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 /* ------------------------------------------------------------ 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 * 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 (and the free 1-day trial) 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;;;AC2EhB,IAAM,mBAAmB;AAChC,IAAM,qBAAqB;AA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,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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ufcalendar/sdk",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
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",