@ufcalendar/sdk 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -16
- package/dist/index.d.ts +26 -16
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/version.ts","../src/client.ts"],"sourcesContent":["export { FightAPI, FightAPIError, DEFAULT_BASE_URL } 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,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AAE,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/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.3';\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,MA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ACxD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,sBAAsB,KAAa,QAA6C;AACpF,UAAM,OAAgC,EAAE,IAAI;AAC5C,QAAI,QAAQ,OAAQ,MAAK,SAAS;AAClC,YAAQ,MAAM,KAAK,SAA0B,QAAQ,qBAAqB,EAAE,KAAK,CAAC,GAAG;AAAA,EACvF;AAAA,EAEA,MAAM,sBAAsB,YAA4C;AACtE,UAAM,KAAK,SAAkB,UAAU,qBAAqB,mBAAmB,OAAO,UAAU,CAAC,CAAC,EAAE;AAAA,EACtG;AAAA,EAEA,MAAM,oBAAoB,YAAuD;AAC/E,YACE,MAAM,KAAK;AAAA,MACT;AAAA,MACA,qBAAqB,mBAAmB,OAAO,UAAU,CAAC,CAAC;AAAA,IAC7D,GACA;AAAA,EACJ;AACF;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1738,7 +1738,7 @@ declare class FightAPI {
|
|
|
1738
1738
|
|
|
1739
1739
|
/** Kept in lockstep with package.json and the User-Agent by
|
|
1740
1740
|
* `apps/api/src/surfaces.test.ts`. Bump all three together. */
|
|
1741
|
-
declare const VERSION = "0.8.
|
|
1741
|
+
declare const VERSION = "0.8.3";
|
|
1742
1742
|
|
|
1743
1743
|
/**
|
|
1744
1744
|
* This file was auto-generated by openapi-typescript.
|
|
@@ -2294,9 +2294,9 @@ interface paths {
|
|
|
2294
2294
|
org?: "ufc" | "pfl" | "oktagon" | "bkfc" | "rizin";
|
|
2295
2295
|
/** @description Filter on lifecycle status; `postponed` is accepted (2026-09-24). `upcoming` = everything not yet over (announced, scheduled or live), soonest first. */
|
|
2296
2296
|
status?: components["schemas"]["EventStatusFilter"];
|
|
2297
|
-
/** @description
|
|
2297
|
+
/** @description First UTC calendar day, inclusive `YYYY-MM-DD`, matched against the event's `starts_at` (first bell, UTC) — not the venue's local date. Must be a real calendar day. */
|
|
2298
2298
|
from?: string;
|
|
2299
|
-
/** @description
|
|
2299
|
+
/** @description Last UTC calendar day, inclusive `YYYY-MM-DD`, matched against `starts_at` (UTC). An evening card in the Americas starts after midnight UTC, so it falls on the next UTC day: a Saturday-night Las Vegas card needs `to=` the Sunday. Must be a real calendar day. */
|
|
2300
2300
|
to?: string;
|
|
2301
2301
|
/** @description Sort by start time. Defaults are contextual — see endpoint description. */
|
|
2302
2302
|
order?: "asc" | "desc";
|
|
@@ -2468,6 +2468,8 @@ interface paths {
|
|
|
2468
2468
|
* Event with full card
|
|
2469
2469
|
* @description Full fight card (both corners, results when completed), venue and event-scoped broadcast rows. Every event and card entry carries `sport` (e.g. `mma`, `bare-knuckle-boxing`). Renamed events 308-redirect from stale slugs.
|
|
2470
2470
|
*
|
|
2471
|
+
* **Card order is read over non-cancelled bouts only.** `ordering` runs headliner-first (1 = main event), and `ordering`, `card_section` and `is_main` describe the card as it stands — except on a `status: "cancelled"` entry, which keeps the slot and section it had when it was scratched. The promotion re-lays the card around it afterwards, so a cancelled entry can share an `ordering` with a live bout or sit in a section that no longer matches its neighbours. Filter `status != "cancelled"` before deriving running order or sections.
|
|
2472
|
+
*
|
|
2471
2473
|
* `include=eta` adds `eta` (ISO timestamp or `null`) to every card entry: the estimated start of that bout, by the same rule the website's event page uses. These are estimates, not a schedule — each card section anchors on its declared start, and every completed bout re-anchors the rest of its section on its real finish. Cancelled bouts get `null`.
|
|
2472
2474
|
*
|
|
2473
2475
|
* `include=odds` adds `odds` to every card entry: the current UFCalendar consensus line (`a`, `b`, `favourite`, `fair_probability_a`, `sources`, `recorded_at`), or `null` when the bout is unpriced. Information only, not betting advice; the opening/closing lines and movement are on `/v1/events/{idOrSlug}/odds`.
|
|
@@ -3673,9 +3675,9 @@ interface paths {
|
|
|
3673
3675
|
fighter?: string;
|
|
3674
3676
|
/** @description Fighter slug or id — bouts this fighter won. */
|
|
3675
3677
|
winner?: string;
|
|
3676
|
-
/** @description
|
|
3678
|
+
/** @description First UTC calendar day, inclusive `YYYY-MM-DD`, matched against the event's `starts_at` (first bell, UTC) — not the venue's local date. Must be a real calendar day. */
|
|
3677
3679
|
from?: string;
|
|
3678
|
-
/** @description
|
|
3680
|
+
/** @description Last UTC calendar day, inclusive `YYYY-MM-DD`, matched against `starts_at` (UTC). An evening card in the Americas starts after midnight UTC, so it falls on the next UTC day: a Saturday-night Las Vegas card needs `to=` the Sunday. Must be a real calendar day. */
|
|
3679
3681
|
to?: string;
|
|
3680
3682
|
/** @description `true` = main events only. */
|
|
3681
3683
|
main_events_only?: boolean;
|
|
@@ -4257,11 +4259,11 @@ interface paths {
|
|
|
4257
4259
|
};
|
|
4258
4260
|
/**
|
|
4259
4261
|
* Judges' scorecards for a bout
|
|
4260
|
-
* @description The official athletic-commission record: every judge, their score for each round, their card total, the decision type and any point deductions. UFC back to 1995, PFL to 2018, OKTAGON to 2025, RIZIN from March 2026 (Japan has no athletic commission — the record is the one published by the officials body that judges RIZIN). UFC cards are cross-checked against the official scorecards ufc.com publishes (Dana White's Contender Series and Road to UFC included, from March 2022), which also fill bouts the commission record does not cover. `source` says who published the cards: `commission-record`, `ufc-official-cards`, or a promotion's own slug (`oktagon-official`, `pfl-official`, `aca-official`).
|
|
4262
|
+
* @description The official athletic-commission record: every judge, their score for each round, their card total, the decision type and any point deductions. UFC back to 1995, PFL to 2018, OKTAGON to 2025, RIZIN 2019–2022 and from March 2026 (Japan has no athletic commission — the record is the one published by the officials body that judges RIZIN; before March 2026 RIZIN judged each fight as a whole, so those cards carry each judge's total for the fight and no rounds, and 2023–2025 was not published). UFC cards are cross-checked against the official scorecards ufc.com publishes (Dana White's Contender Series and Road to UFC included, from March 2022), which also fill bouts the commission record does not cover. `source` says who published the cards: `commission-record`, `ufc-official-cards`, or a promotion's own slug (`oktagon-official`, `pfl-official`, `aca-official`).
|
|
4261
4263
|
*
|
|
4262
4264
|
* `total_a`/`total_b` and every round are oriented to the bout's `fighter_a_id`/`fighter_b_id`, which are repeated on the payload so you never have to fetch the fight to read a card. `winner_fighter_id` is who THAT judge gave it to.
|
|
4263
4265
|
*
|
|
4264
|
-
* **Check `scores_known` before charting totals.** When it is false the commission published only the outcome, and `total_a`/`total_b` are a 1-0 / 1-1 / 0-0 placeholder rather than a score (
|
|
4266
|
+
* **Check `scores_known` before charting totals.** When it is false the commission published only the outcome, and `total_a`/`total_b` are a 1-0 / 1-1 / 0-0 placeholder rather than a score (pre-2005 commission records, and the RIZIN cards where the officials published only each judge's pick); `rounds` is empty on those cards.
|
|
4265
4267
|
*
|
|
4266
4268
|
* **A bout with no commission record answers 200, not 404** (2026-09-24): `cards: []`, `decision_type: null`, and `meta.note` says why (a finish, or cards not yet published). 404 is reserved for an unknown fight, so a client can tell the two apart.
|
|
4267
4269
|
*
|
|
@@ -4793,9 +4795,9 @@ interface paths {
|
|
|
4793
4795
|
get: {
|
|
4794
4796
|
parameters: {
|
|
4795
4797
|
query?: {
|
|
4796
|
-
/** @description Earliest recorded day, inclusive `YYYY-MM-DD`. */
|
|
4798
|
+
/** @description Earliest recorded day (UTC), inclusive `YYYY-MM-DD`. */
|
|
4797
4799
|
from?: string;
|
|
4798
|
-
/** @description Latest recorded day, inclusive `YYYY-MM-DD`; must not precede `from`. */
|
|
4800
|
+
/** @description Latest recorded day (UTC), inclusive `YYYY-MM-DD`; must not precede `from`. */
|
|
4799
4801
|
to?: string;
|
|
4800
4802
|
/** @description Opaque cursor from `meta.pagination.next_cursor`. */
|
|
4801
4803
|
cursor?: string;
|
|
@@ -4965,9 +4967,9 @@ interface paths {
|
|
|
4965
4967
|
query?: {
|
|
4966
4968
|
/** @description Launch org slug: `ufc`, `pfl`, `oktagon`, `bkfc` or `rizin`. Staged orgs 400 until promoted. */
|
|
4967
4969
|
org?: "ufc" | "pfl" | "oktagon" | "bkfc" | "rizin";
|
|
4968
|
-
/** @description
|
|
4970
|
+
/** @description First UTC calendar day, inclusive `YYYY-MM-DD`, matched against the event's `starts_at` (first bell, UTC) — not the venue's local date. Must be a real calendar day. */
|
|
4969
4971
|
from?: string;
|
|
4970
|
-
/** @description
|
|
4972
|
+
/** @description Last UTC calendar day, inclusive `YYYY-MM-DD`, matched against `starts_at` (UTC). An evening card in the Americas starts after midnight UTC, so it falls on the next UTC day: a Saturday-night Las Vegas card needs `to=` the Sunday. Must be a real calendar day. */
|
|
4971
4973
|
to?: string;
|
|
4972
4974
|
/** @description Opaque cursor from `meta.pagination.next_cursor`. */
|
|
4973
4975
|
cursor?: string;
|
|
@@ -5841,7 +5843,7 @@ interface paths {
|
|
|
5841
5843
|
};
|
|
5842
5844
|
/**
|
|
5843
5845
|
* Fighter profile
|
|
5844
|
-
* @description Bio, records, stats, UFCalendar Power Index summary, and CC-licensed images with attribution metadata (displaying the credit is a license requirement). **Read `records` and `stats`** (added 2026-09-24): `records` is a map keyed by a clean name — `pro_mma` (the career MMA record), `amateur_mma`, `pro_kickboxing`, …, and the org slug for a record INSIDE one promotion (`ufc`, `one`, `bkfc`) — each `{ value, source, scope }`; `stats` is ONE per-minute panel (SLpM, striking accuracy/defense, SApM, takedown average/accuracy/defense, submission average), always the
|
|
5846
|
+
* @description Bio, records, stats, UFCalendar Power Index summary, and CC-licensed images with attribution metadata (displaying the credit is a license requirement). **Read `records` and `stats`** (added 2026-09-24): `records` is a map keyed by a clean name — `pro_mma` (the career MMA record), `amateur_mma`, `pro_kickboxing`, …, and the org slug for a record INSIDE one promotion (`ufc`, `one`, `bkfc`) — each `{ value, source, scope }`; `stats` is ONE per-minute panel (SLpM, striking accuracy/defense, SApM, takedown average/accuracy/defense, submission average), always ONE sport (the fighter's headline sport: the `pro-mma` panel over MMA bouts in every promotion; `pro-knuckle` for a bare-knuckle fighter, `pro-muay-thai` / `pro-kickboxing` for a ONE striker; sports are never averaged together), with `basis: { bouts, orgs, source, scope }` stating exactly which bouts it averages over (e.g. 7 UFC bouts, or 18 MMA bouts across UFC + Oktagon); `null` when no real panel exists. `career_stats` is the raw per-source row list these are built from and stays unchanged for existing integrations.
|
|
5845
5847
|
*
|
|
5846
5848
|
* `next_fight` is the fighter's next booked bout (not completed or cancelled, on an event that has not been cancelled and started no more than ~6h ago; `result` is always null) and `last_fight` their most recent completed or no-contest bout — both in the same shape as a `source: "native"` row of `/history`, or `null`.
|
|
5847
5849
|
*
|
|
@@ -6320,7 +6322,7 @@ interface paths {
|
|
|
6320
6322
|
};
|
|
6321
6323
|
/**
|
|
6322
6324
|
* Career statistics
|
|
6323
|
-
* @description Raw per-source career rows, plus the readable split in `meta.records` / `meta.stats` (the same objects the fighter profile carries — read those unless you need the per-source rows). `data`: per-scope career stats (`pro-mma`, `amateur-mma`, …): record, strikes landed/absorbed per minute, accuracy/defense, takedown and submission averages, and `updated_at` (this route only). Exactly ONE row per scope; `source` names the publisher it came from: `public-records` (the complete multi-promotion career record) is preferred, then the promotion's own site (`ufc-stats`, `bkfc-official`, `one-official`, …), then `ufcalendar`. A `public-records` record is a point-in-time snapshot advanced by every settled bout UFCalendar tracked after it, so it matches the record on ufcalendar.com. A row's record and its stats cover the same bouts. `pro-mma` = the career record plus striking/grappling averages UFCalendar computes over EVERY settled bout it holds per-fight totals for, in any promotion (Contender Series included); its stats are null when no such bout exists. Org-scoped rows (`ufc-only`, `bkfc-only`, `one-only`) are the fighter's record INSIDE that promotion, not a career record: `ufc-only` carries a record AND averages UFCalendar derives from the fighter's tracked UFC bouts only (Contender Series excluded, `W-L-D` plus ` (n NC)`; both null until a UFC bout is settled — a Contender-Series-only fighter has no UFC stats), while `bkfc-only` / `one-only` carry the promotion's own published record.
|
|
6325
|
+
* @description Raw per-source career rows, plus the readable split in `meta.records` / `meta.stats` (the same objects the fighter profile carries — read those unless you need the per-source rows). `data`: per-scope career stats (`pro-mma`, `amateur-mma`, …): record, strikes landed/absorbed per minute, accuracy/defense, takedown and submission averages, and `updated_at` (this route only). Exactly ONE row per scope; `source` names the publisher it came from: `public-records` (the complete multi-promotion career record) is preferred, then the promotion's own site (`ufc-stats`, `bkfc-official`, `one-official`, …), then `ufcalendar`. A `public-records` record is a point-in-time snapshot advanced by every settled bout UFCalendar tracked after it, so it matches the record on ufcalendar.com. A row's record and its stats cover the same bouts. `pro-mma` = the career record plus striking/grappling averages UFCalendar computes over EVERY settled MMA bout it holds per-fight totals for, in any promotion (Contender Series included); its stats are null when no such bout exists. Bouts of another sport are averaged on that sport's row (`pro-knuckle` for bare-knuckle boxing, `pro-muay-thai`, `pro-kickboxing`, `pro-boxing`; a stats-only row with a null record when the fighter has no such record row) and never enter `pro-mma`. Org-scoped rows (`ufc-only`, `bkfc-only`, `one-only`) are the fighter's record INSIDE that promotion, not a career record: `ufc-only` carries a record AND averages UFCalendar derives from the fighter's tracked UFC bouts only (Contender Series excluded, `W-L-D` plus ` (n NC)`; both null until a UFC bout is settled — a Contender-Series-only fighter has no UFC stats), while `bkfc-only` / `one-only` carry the promotion's own published record. ufcstats', OKTAGON's and ACA's header records are CAREER records and ship under `pro-mma` (the `public-records` row wins the scope when present, unless ufcstats counts more bouts).
|
|
6324
6326
|
*/
|
|
6325
6327
|
get: {
|
|
6326
6328
|
parameters: {
|
|
@@ -7602,7 +7604,7 @@ interface paths {
|
|
|
7602
7604
|
};
|
|
7603
7605
|
/**
|
|
7604
7606
|
* Matchmaker board
|
|
7605
|
-
* @description UFCalendar's matchmaker for one MMA promotion (`ufc`, `pfl`, `oktagon`, `rizin`; `bkfc` 400s `unsupported_org` — the engine runs on the Power Index, which rates MMA only). Every candidate pair inside a division is scored 0–100 for rank proximity, momentum, competitiveness, readiness and story (rematches, trilogy deciders, eliminators): the promotion's official ladder where one exists plus the strongest active unranked Power Index fighters. UFC pairs are scored by UFCalendar's booking model (a ranker trained on every realized UFC booking), weighted by the stakes term; other promotions use the fitted heuristic. Fighters already booked leave the board, pairs already booked are excluded, and one fighter appears in at most two slips per division.
|
|
7607
|
+
* @description UFCalendar's matchmaker for one MMA promotion (`ufc`, `pfl`, `oktagon`, `rizin`; `bkfc` 400s `unsupported_org` — the engine runs on the Power Index, which rates MMA only). Every candidate pair inside a division is scored 0–100 for rank proximity, momentum, competitiveness, readiness and story (rematches, trilogy deciders, eliminators): the promotion's official ladder where one exists plus the strongest active unranked Power Index fighters. A promotion with no official ladder (`rizin`) draws only on its current roster — fighters whose latest bout in the promotion is within 450 days — and its pairs are weighted by what each fighter has done there (title fights, wins, career pedigree), so a former champion is not paired with a two-fight prospect. UFC pairs are scored by UFCalendar's booking model (a ranker trained on every realized UFC booking), weighted by the stakes term; other promotions use the fitted heuristic. Fighters already booked leave the board, pairs already booked are excluded, and one fighter appears in at most two slips per division.
|
|
7606
7608
|
*
|
|
7607
7609
|
* Without `division` the list is the cross-division top board (at most two slips per division); with it, that division's best pairs. `meta.divisions` lists the promotion's divisions (an unknown one 400s `invalid_division`), `meta.rankings_date` the ladder snapshot used (null when the promotion has no current ladder). Each slip: `key` (`lo-hi` fighter ids), `a` (red corner — the better-credentialed side) and `b` with `rank` (0 = champion, null = unranked), `power_index`, `streak` (signed: +3 = three straight wins) and `booked`; `score`; `win_probability_a` from the two Power Index ratings; `tags` (`title`, `eliminator`, `coinFlip`, `bothStreaking`, `finishers`, `trilogyDecider`, `unfinishedBusiness`, `rematch`, `unrankedGem`, `bounceBack`, `steppingUp`, `bothDue`, `booked`).
|
|
7608
7610
|
*
|
|
@@ -8956,7 +8958,9 @@ interface paths {
|
|
|
8956
8958
|
query?: {
|
|
8957
8959
|
/** @description Same values as `/v1/events`; `upcoming` = the venue's cards not yet over. */
|
|
8958
8960
|
status?: components["schemas"]["EventStatusFilter"];
|
|
8961
|
+
/** @description First UTC calendar day, inclusive `YYYY-MM-DD`, matched against the event's `starts_at` (first bell, UTC) — not the venue's local date. Must be a real calendar day. */
|
|
8959
8962
|
from?: string;
|
|
8963
|
+
/** @description Last UTC calendar day, inclusive `YYYY-MM-DD`, matched against `starts_at` (UTC). An evening card in the Americas starts after midnight UTC, so it falls on the next UTC day: a Saturday-night Las Vegas card needs `to=` the Sunday. Must be a real calendar day. */
|
|
8960
8964
|
to?: string;
|
|
8961
8965
|
order?: "asc" | "desc";
|
|
8962
8966
|
/** @description Opaque cursor from `meta.pagination.next_cursor`. */
|
|
@@ -10987,7 +10991,10 @@ interface components {
|
|
|
10987
10991
|
event_title: string;
|
|
10988
10992
|
event_slug: string;
|
|
10989
10993
|
org_slug: string;
|
|
10990
|
-
/**
|
|
10994
|
+
/**
|
|
10995
|
+
* Format: date
|
|
10996
|
+
* @description The UTC calendar day of the event's `starts_at` (first bell). An evening card in the Americas starts after midnight UTC, so it can read one day after the venue's local date; use the event's `starts_at` + `tz` for a local label.
|
|
10997
|
+
*/
|
|
10991
10998
|
date: string | null;
|
|
10992
10999
|
opponent_id: number | null;
|
|
10993
11000
|
opponent_name: string | null;
|
|
@@ -11300,7 +11307,10 @@ interface components {
|
|
|
11300
11307
|
event_name: string | null;
|
|
11301
11308
|
event_slug: string | null;
|
|
11302
11309
|
org_slug: string | null;
|
|
11303
|
-
/**
|
|
11310
|
+
/**
|
|
11311
|
+
* Format: date
|
|
11312
|
+
* @description `native` rows: the UTC calendar day of the event's `starts_at` (first bell) — an evening card in the Americas starts after midnight UTC, so it can read one day after the venue's local date. `history` rows carry no time, only the date as the publisher printed it (usually the venue's local date).
|
|
11313
|
+
*/
|
|
11304
11314
|
date: string | null;
|
|
11305
11315
|
opponent_id: number | null;
|
|
11306
11316
|
opponent_name: string | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1738,7 +1738,7 @@ declare class FightAPI {
|
|
|
1738
1738
|
|
|
1739
1739
|
/** Kept in lockstep with package.json and the User-Agent by
|
|
1740
1740
|
* `apps/api/src/surfaces.test.ts`. Bump all three together. */
|
|
1741
|
-
declare const VERSION = "0.8.
|
|
1741
|
+
declare const VERSION = "0.8.3";
|
|
1742
1742
|
|
|
1743
1743
|
/**
|
|
1744
1744
|
* This file was auto-generated by openapi-typescript.
|
|
@@ -2294,9 +2294,9 @@ interface paths {
|
|
|
2294
2294
|
org?: "ufc" | "pfl" | "oktagon" | "bkfc" | "rizin";
|
|
2295
2295
|
/** @description Filter on lifecycle status; `postponed` is accepted (2026-09-24). `upcoming` = everything not yet over (announced, scheduled or live), soonest first. */
|
|
2296
2296
|
status?: components["schemas"]["EventStatusFilter"];
|
|
2297
|
-
/** @description
|
|
2297
|
+
/** @description First UTC calendar day, inclusive `YYYY-MM-DD`, matched against the event's `starts_at` (first bell, UTC) — not the venue's local date. Must be a real calendar day. */
|
|
2298
2298
|
from?: string;
|
|
2299
|
-
/** @description
|
|
2299
|
+
/** @description Last UTC calendar day, inclusive `YYYY-MM-DD`, matched against `starts_at` (UTC). An evening card in the Americas starts after midnight UTC, so it falls on the next UTC day: a Saturday-night Las Vegas card needs `to=` the Sunday. Must be a real calendar day. */
|
|
2300
2300
|
to?: string;
|
|
2301
2301
|
/** @description Sort by start time. Defaults are contextual — see endpoint description. */
|
|
2302
2302
|
order?: "asc" | "desc";
|
|
@@ -2468,6 +2468,8 @@ interface paths {
|
|
|
2468
2468
|
* Event with full card
|
|
2469
2469
|
* @description Full fight card (both corners, results when completed), venue and event-scoped broadcast rows. Every event and card entry carries `sport` (e.g. `mma`, `bare-knuckle-boxing`). Renamed events 308-redirect from stale slugs.
|
|
2470
2470
|
*
|
|
2471
|
+
* **Card order is read over non-cancelled bouts only.** `ordering` runs headliner-first (1 = main event), and `ordering`, `card_section` and `is_main` describe the card as it stands — except on a `status: "cancelled"` entry, which keeps the slot and section it had when it was scratched. The promotion re-lays the card around it afterwards, so a cancelled entry can share an `ordering` with a live bout or sit in a section that no longer matches its neighbours. Filter `status != "cancelled"` before deriving running order or sections.
|
|
2472
|
+
*
|
|
2471
2473
|
* `include=eta` adds `eta` (ISO timestamp or `null`) to every card entry: the estimated start of that bout, by the same rule the website's event page uses. These are estimates, not a schedule — each card section anchors on its declared start, and every completed bout re-anchors the rest of its section on its real finish. Cancelled bouts get `null`.
|
|
2472
2474
|
*
|
|
2473
2475
|
* `include=odds` adds `odds` to every card entry: the current UFCalendar consensus line (`a`, `b`, `favourite`, `fair_probability_a`, `sources`, `recorded_at`), or `null` when the bout is unpriced. Information only, not betting advice; the opening/closing lines and movement are on `/v1/events/{idOrSlug}/odds`.
|
|
@@ -3673,9 +3675,9 @@ interface paths {
|
|
|
3673
3675
|
fighter?: string;
|
|
3674
3676
|
/** @description Fighter slug or id — bouts this fighter won. */
|
|
3675
3677
|
winner?: string;
|
|
3676
|
-
/** @description
|
|
3678
|
+
/** @description First UTC calendar day, inclusive `YYYY-MM-DD`, matched against the event's `starts_at` (first bell, UTC) — not the venue's local date. Must be a real calendar day. */
|
|
3677
3679
|
from?: string;
|
|
3678
|
-
/** @description
|
|
3680
|
+
/** @description Last UTC calendar day, inclusive `YYYY-MM-DD`, matched against `starts_at` (UTC). An evening card in the Americas starts after midnight UTC, so it falls on the next UTC day: a Saturday-night Las Vegas card needs `to=` the Sunday. Must be a real calendar day. */
|
|
3679
3681
|
to?: string;
|
|
3680
3682
|
/** @description `true` = main events only. */
|
|
3681
3683
|
main_events_only?: boolean;
|
|
@@ -4257,11 +4259,11 @@ interface paths {
|
|
|
4257
4259
|
};
|
|
4258
4260
|
/**
|
|
4259
4261
|
* Judges' scorecards for a bout
|
|
4260
|
-
* @description The official athletic-commission record: every judge, their score for each round, their card total, the decision type and any point deductions. UFC back to 1995, PFL to 2018, OKTAGON to 2025, RIZIN from March 2026 (Japan has no athletic commission — the record is the one published by the officials body that judges RIZIN). UFC cards are cross-checked against the official scorecards ufc.com publishes (Dana White's Contender Series and Road to UFC included, from March 2022), which also fill bouts the commission record does not cover. `source` says who published the cards: `commission-record`, `ufc-official-cards`, or a promotion's own slug (`oktagon-official`, `pfl-official`, `aca-official`).
|
|
4262
|
+
* @description The official athletic-commission record: every judge, their score for each round, their card total, the decision type and any point deductions. UFC back to 1995, PFL to 2018, OKTAGON to 2025, RIZIN 2019–2022 and from March 2026 (Japan has no athletic commission — the record is the one published by the officials body that judges RIZIN; before March 2026 RIZIN judged each fight as a whole, so those cards carry each judge's total for the fight and no rounds, and 2023–2025 was not published). UFC cards are cross-checked against the official scorecards ufc.com publishes (Dana White's Contender Series and Road to UFC included, from March 2022), which also fill bouts the commission record does not cover. `source` says who published the cards: `commission-record`, `ufc-official-cards`, or a promotion's own slug (`oktagon-official`, `pfl-official`, `aca-official`).
|
|
4261
4263
|
*
|
|
4262
4264
|
* `total_a`/`total_b` and every round are oriented to the bout's `fighter_a_id`/`fighter_b_id`, which are repeated on the payload so you never have to fetch the fight to read a card. `winner_fighter_id` is who THAT judge gave it to.
|
|
4263
4265
|
*
|
|
4264
|
-
* **Check `scores_known` before charting totals.** When it is false the commission published only the outcome, and `total_a`/`total_b` are a 1-0 / 1-1 / 0-0 placeholder rather than a score (
|
|
4266
|
+
* **Check `scores_known` before charting totals.** When it is false the commission published only the outcome, and `total_a`/`total_b` are a 1-0 / 1-1 / 0-0 placeholder rather than a score (pre-2005 commission records, and the RIZIN cards where the officials published only each judge's pick); `rounds` is empty on those cards.
|
|
4265
4267
|
*
|
|
4266
4268
|
* **A bout with no commission record answers 200, not 404** (2026-09-24): `cards: []`, `decision_type: null`, and `meta.note` says why (a finish, or cards not yet published). 404 is reserved for an unknown fight, so a client can tell the two apart.
|
|
4267
4269
|
*
|
|
@@ -4793,9 +4795,9 @@ interface paths {
|
|
|
4793
4795
|
get: {
|
|
4794
4796
|
parameters: {
|
|
4795
4797
|
query?: {
|
|
4796
|
-
/** @description Earliest recorded day, inclusive `YYYY-MM-DD`. */
|
|
4798
|
+
/** @description Earliest recorded day (UTC), inclusive `YYYY-MM-DD`. */
|
|
4797
4799
|
from?: string;
|
|
4798
|
-
/** @description Latest recorded day, inclusive `YYYY-MM-DD`; must not precede `from`. */
|
|
4800
|
+
/** @description Latest recorded day (UTC), inclusive `YYYY-MM-DD`; must not precede `from`. */
|
|
4799
4801
|
to?: string;
|
|
4800
4802
|
/** @description Opaque cursor from `meta.pagination.next_cursor`. */
|
|
4801
4803
|
cursor?: string;
|
|
@@ -4965,9 +4967,9 @@ interface paths {
|
|
|
4965
4967
|
query?: {
|
|
4966
4968
|
/** @description Launch org slug: `ufc`, `pfl`, `oktagon`, `bkfc` or `rizin`. Staged orgs 400 until promoted. */
|
|
4967
4969
|
org?: "ufc" | "pfl" | "oktagon" | "bkfc" | "rizin";
|
|
4968
|
-
/** @description
|
|
4970
|
+
/** @description First UTC calendar day, inclusive `YYYY-MM-DD`, matched against the event's `starts_at` (first bell, UTC) — not the venue's local date. Must be a real calendar day. */
|
|
4969
4971
|
from?: string;
|
|
4970
|
-
/** @description
|
|
4972
|
+
/** @description Last UTC calendar day, inclusive `YYYY-MM-DD`, matched against `starts_at` (UTC). An evening card in the Americas starts after midnight UTC, so it falls on the next UTC day: a Saturday-night Las Vegas card needs `to=` the Sunday. Must be a real calendar day. */
|
|
4971
4973
|
to?: string;
|
|
4972
4974
|
/** @description Opaque cursor from `meta.pagination.next_cursor`. */
|
|
4973
4975
|
cursor?: string;
|
|
@@ -5841,7 +5843,7 @@ interface paths {
|
|
|
5841
5843
|
};
|
|
5842
5844
|
/**
|
|
5843
5845
|
* Fighter profile
|
|
5844
|
-
* @description Bio, records, stats, UFCalendar Power Index summary, and CC-licensed images with attribution metadata (displaying the credit is a license requirement). **Read `records` and `stats`** (added 2026-09-24): `records` is a map keyed by a clean name — `pro_mma` (the career MMA record), `amateur_mma`, `pro_kickboxing`, …, and the org slug for a record INSIDE one promotion (`ufc`, `one`, `bkfc`) — each `{ value, source, scope }`; `stats` is ONE per-minute panel (SLpM, striking accuracy/defense, SApM, takedown average/accuracy/defense, submission average), always the
|
|
5846
|
+
* @description Bio, records, stats, UFCalendar Power Index summary, and CC-licensed images with attribution metadata (displaying the credit is a license requirement). **Read `records` and `stats`** (added 2026-09-24): `records` is a map keyed by a clean name — `pro_mma` (the career MMA record), `amateur_mma`, `pro_kickboxing`, …, and the org slug for a record INSIDE one promotion (`ufc`, `one`, `bkfc`) — each `{ value, source, scope }`; `stats` is ONE per-minute panel (SLpM, striking accuracy/defense, SApM, takedown average/accuracy/defense, submission average), always ONE sport (the fighter's headline sport: the `pro-mma` panel over MMA bouts in every promotion; `pro-knuckle` for a bare-knuckle fighter, `pro-muay-thai` / `pro-kickboxing` for a ONE striker; sports are never averaged together), with `basis: { bouts, orgs, source, scope }` stating exactly which bouts it averages over (e.g. 7 UFC bouts, or 18 MMA bouts across UFC + Oktagon); `null` when no real panel exists. `career_stats` is the raw per-source row list these are built from and stays unchanged for existing integrations.
|
|
5845
5847
|
*
|
|
5846
5848
|
* `next_fight` is the fighter's next booked bout (not completed or cancelled, on an event that has not been cancelled and started no more than ~6h ago; `result` is always null) and `last_fight` their most recent completed or no-contest bout — both in the same shape as a `source: "native"` row of `/history`, or `null`.
|
|
5847
5849
|
*
|
|
@@ -6320,7 +6322,7 @@ interface paths {
|
|
|
6320
6322
|
};
|
|
6321
6323
|
/**
|
|
6322
6324
|
* Career statistics
|
|
6323
|
-
* @description Raw per-source career rows, plus the readable split in `meta.records` / `meta.stats` (the same objects the fighter profile carries — read those unless you need the per-source rows). `data`: per-scope career stats (`pro-mma`, `amateur-mma`, …): record, strikes landed/absorbed per minute, accuracy/defense, takedown and submission averages, and `updated_at` (this route only). Exactly ONE row per scope; `source` names the publisher it came from: `public-records` (the complete multi-promotion career record) is preferred, then the promotion's own site (`ufc-stats`, `bkfc-official`, `one-official`, …), then `ufcalendar`. A `public-records` record is a point-in-time snapshot advanced by every settled bout UFCalendar tracked after it, so it matches the record on ufcalendar.com. A row's record and its stats cover the same bouts. `pro-mma` = the career record plus striking/grappling averages UFCalendar computes over EVERY settled bout it holds per-fight totals for, in any promotion (Contender Series included); its stats are null when no such bout exists. Org-scoped rows (`ufc-only`, `bkfc-only`, `one-only`) are the fighter's record INSIDE that promotion, not a career record: `ufc-only` carries a record AND averages UFCalendar derives from the fighter's tracked UFC bouts only (Contender Series excluded, `W-L-D` plus ` (n NC)`; both null until a UFC bout is settled — a Contender-Series-only fighter has no UFC stats), while `bkfc-only` / `one-only` carry the promotion's own published record.
|
|
6325
|
+
* @description Raw per-source career rows, plus the readable split in `meta.records` / `meta.stats` (the same objects the fighter profile carries — read those unless you need the per-source rows). `data`: per-scope career stats (`pro-mma`, `amateur-mma`, …): record, strikes landed/absorbed per minute, accuracy/defense, takedown and submission averages, and `updated_at` (this route only). Exactly ONE row per scope; `source` names the publisher it came from: `public-records` (the complete multi-promotion career record) is preferred, then the promotion's own site (`ufc-stats`, `bkfc-official`, `one-official`, …), then `ufcalendar`. A `public-records` record is a point-in-time snapshot advanced by every settled bout UFCalendar tracked after it, so it matches the record on ufcalendar.com. A row's record and its stats cover the same bouts. `pro-mma` = the career record plus striking/grappling averages UFCalendar computes over EVERY settled MMA bout it holds per-fight totals for, in any promotion (Contender Series included); its stats are null when no such bout exists. Bouts of another sport are averaged on that sport's row (`pro-knuckle` for bare-knuckle boxing, `pro-muay-thai`, `pro-kickboxing`, `pro-boxing`; a stats-only row with a null record when the fighter has no such record row) and never enter `pro-mma`. Org-scoped rows (`ufc-only`, `bkfc-only`, `one-only`) are the fighter's record INSIDE that promotion, not a career record: `ufc-only` carries a record AND averages UFCalendar derives from the fighter's tracked UFC bouts only (Contender Series excluded, `W-L-D` plus ` (n NC)`; both null until a UFC bout is settled — a Contender-Series-only fighter has no UFC stats), while `bkfc-only` / `one-only` carry the promotion's own published record. ufcstats', OKTAGON's and ACA's header records are CAREER records and ship under `pro-mma` (the `public-records` row wins the scope when present, unless ufcstats counts more bouts).
|
|
6324
6326
|
*/
|
|
6325
6327
|
get: {
|
|
6326
6328
|
parameters: {
|
|
@@ -7602,7 +7604,7 @@ interface paths {
|
|
|
7602
7604
|
};
|
|
7603
7605
|
/**
|
|
7604
7606
|
* Matchmaker board
|
|
7605
|
-
* @description UFCalendar's matchmaker for one MMA promotion (`ufc`, `pfl`, `oktagon`, `rizin`; `bkfc` 400s `unsupported_org` — the engine runs on the Power Index, which rates MMA only). Every candidate pair inside a division is scored 0–100 for rank proximity, momentum, competitiveness, readiness and story (rematches, trilogy deciders, eliminators): the promotion's official ladder where one exists plus the strongest active unranked Power Index fighters. UFC pairs are scored by UFCalendar's booking model (a ranker trained on every realized UFC booking), weighted by the stakes term; other promotions use the fitted heuristic. Fighters already booked leave the board, pairs already booked are excluded, and one fighter appears in at most two slips per division.
|
|
7607
|
+
* @description UFCalendar's matchmaker for one MMA promotion (`ufc`, `pfl`, `oktagon`, `rizin`; `bkfc` 400s `unsupported_org` — the engine runs on the Power Index, which rates MMA only). Every candidate pair inside a division is scored 0–100 for rank proximity, momentum, competitiveness, readiness and story (rematches, trilogy deciders, eliminators): the promotion's official ladder where one exists plus the strongest active unranked Power Index fighters. A promotion with no official ladder (`rizin`) draws only on its current roster — fighters whose latest bout in the promotion is within 450 days — and its pairs are weighted by what each fighter has done there (title fights, wins, career pedigree), so a former champion is not paired with a two-fight prospect. UFC pairs are scored by UFCalendar's booking model (a ranker trained on every realized UFC booking), weighted by the stakes term; other promotions use the fitted heuristic. Fighters already booked leave the board, pairs already booked are excluded, and one fighter appears in at most two slips per division.
|
|
7606
7608
|
*
|
|
7607
7609
|
* Without `division` the list is the cross-division top board (at most two slips per division); with it, that division's best pairs. `meta.divisions` lists the promotion's divisions (an unknown one 400s `invalid_division`), `meta.rankings_date` the ladder snapshot used (null when the promotion has no current ladder). Each slip: `key` (`lo-hi` fighter ids), `a` (red corner — the better-credentialed side) and `b` with `rank` (0 = champion, null = unranked), `power_index`, `streak` (signed: +3 = three straight wins) and `booked`; `score`; `win_probability_a` from the two Power Index ratings; `tags` (`title`, `eliminator`, `coinFlip`, `bothStreaking`, `finishers`, `trilogyDecider`, `unfinishedBusiness`, `rematch`, `unrankedGem`, `bounceBack`, `steppingUp`, `bothDue`, `booked`).
|
|
7608
7610
|
*
|
|
@@ -8956,7 +8958,9 @@ interface paths {
|
|
|
8956
8958
|
query?: {
|
|
8957
8959
|
/** @description Same values as `/v1/events`; `upcoming` = the venue's cards not yet over. */
|
|
8958
8960
|
status?: components["schemas"]["EventStatusFilter"];
|
|
8961
|
+
/** @description First UTC calendar day, inclusive `YYYY-MM-DD`, matched against the event's `starts_at` (first bell, UTC) — not the venue's local date. Must be a real calendar day. */
|
|
8959
8962
|
from?: string;
|
|
8963
|
+
/** @description Last UTC calendar day, inclusive `YYYY-MM-DD`, matched against `starts_at` (UTC). An evening card in the Americas starts after midnight UTC, so it falls on the next UTC day: a Saturday-night Las Vegas card needs `to=` the Sunday. Must be a real calendar day. */
|
|
8960
8964
|
to?: string;
|
|
8961
8965
|
order?: "asc" | "desc";
|
|
8962
8966
|
/** @description Opaque cursor from `meta.pagination.next_cursor`. */
|
|
@@ -10987,7 +10991,10 @@ interface components {
|
|
|
10987
10991
|
event_title: string;
|
|
10988
10992
|
event_slug: string;
|
|
10989
10993
|
org_slug: string;
|
|
10990
|
-
/**
|
|
10994
|
+
/**
|
|
10995
|
+
* Format: date
|
|
10996
|
+
* @description The UTC calendar day of the event's `starts_at` (first bell). An evening card in the Americas starts after midnight UTC, so it can read one day after the venue's local date; use the event's `starts_at` + `tz` for a local label.
|
|
10997
|
+
*/
|
|
10991
10998
|
date: string | null;
|
|
10992
10999
|
opponent_id: number | null;
|
|
10993
11000
|
opponent_name: string | null;
|
|
@@ -11300,7 +11307,10 @@ interface components {
|
|
|
11300
11307
|
event_name: string | null;
|
|
11301
11308
|
event_slug: string | null;
|
|
11302
11309
|
org_slug: string | null;
|
|
11303
|
-
/**
|
|
11310
|
+
/**
|
|
11311
|
+
* Format: date
|
|
11312
|
+
* @description `native` rows: the UTC calendar day of the event's `starts_at` (first bell) — an evening card in the Americas starts after midnight UTC, so it can read one day after the venue's local date. `history` rows carry no time, only the date as the publisher printed it (usually the venue's local date).
|
|
11313
|
+
*/
|
|
11304
11314
|
date: string | null;
|
|
11305
11315
|
opponent_id: number | null;
|
|
11306
11316
|
opponent_name: string | null;
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version.ts","../src/client.ts"],"sourcesContent":["/** Kept in lockstep with package.json and the User-Agent by\n * `apps/api/src/surfaces.test.ts`. Bump all three together. */\nexport const VERSION = '0.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;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,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AACtB,WAAO,KAAK,IAAW,OAAO;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,eAAe,MAAM,OAAe;AAClC,QAAI,CAAC,KAAK,QAAQ;AAChB,YAAM,IAAI;AAAA,QACR;AAAA,QACA;AAAA,QACA;AAAA,MAEF;AAAA,IACF;AACA,WAAO,GAAG,KAAK,OAAO,aAAa,mBAAmB,GAAG,CAAC,YAAY,mBAAmB,KAAK,MAAM,CAAC;AAAA,EACvG;AAAA;AAAA,EAIA,mBAA+C;AAC7C,WAAO,KAAK,IAAuB,mBAAmB;AAAA,EACxD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,sBAAsB,KAAa,QAA6C;AACpF,UAAM,OAAgC,EAAE,IAAI;AAC5C,QAAI,QAAQ,OAAQ,MAAK,SAAS;AAClC,YAAQ,MAAM,KAAK,SAA0B,QAAQ,qBAAqB,EAAE,KAAK,CAAC,GAAG;AAAA,EACvF;AAAA,EAEA,MAAM,sBAAsB,YAA4C;AACtE,UAAM,KAAK,SAAkB,UAAU,qBAAqB,mBAAmB,OAAO,UAAU,CAAC,CAAC,EAAE;AAAA,EACtG;AAAA,EAEA,MAAM,oBAAoB,YAAuD;AAC/E,YACE,MAAM,KAAK;AAAA,MACT;AAAA,MACA,qBAAqB,mBAAmB,OAAO,UAAU,CAAC,CAAC;AAAA,IAC7D,GACA;AAAA,EACJ;AACF;","names":[]}
|
|
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.3';\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(end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QACA;AAAA,QACA;AAAA,MAEF;AAAA,IACF;AACA,WAAO,GAAG,KAAK,OAAO,aAAa,mBAAmB,GAAG,CAAC,YAAY,mBAAmB,KAAK,MAAM,CAAC;AAAA,EACvG;AAAA;AAAA,EAIA,mBAA+C;AAC7C,WAAO,KAAK,IAAuB,mBAAmB;AAAA,EACxD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,sBAAsB,KAAa,QAA6C;AACpF,UAAM,OAAgC,EAAE,IAAI;AAC5C,QAAI,QAAQ,OAAQ,MAAK,SAAS;AAClC,YAAQ,MAAM,KAAK,SAA0B,QAAQ,qBAAqB,EAAE,KAAK,CAAC,GAAG;AAAA,EACvF;AAAA,EAEA,MAAM,sBAAsB,YAA4C;AACtE,UAAM,KAAK,SAAkB,UAAU,qBAAqB,mBAAmB,OAAO,UAAU,CAAC,CAAC,EAAE;AAAA,EACtG;AAAA,EAEA,MAAM,oBAAoB,YAAuD;AAC/E,YACE,MAAM,KAAK;AAAA,MACT;AAAA,MACA,qBAAqB,mBAAmB,OAAO,UAAU,CAAC,CAAC;AAAA,IAC7D,GACA;AAAA,EACJ;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ufcalendar/sdk",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
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",
|