import { Venue } from "@weekendgoals/weekendgoals-types/dist/venues"; import { BoundingBox } from "@weekendgoals/weekendgoals-types/dist/types/bounding-box"; import { Team } from "@weekendgoals/weekendgoals-types/dist/teams"; import { EmailParams } from "@weekendgoals/weekendgoals-types/dist/email/email"; import { Attraction } from "@weekendgoals/weekendgoals-types/dist/attractions"; import { Ticket } from "@weekendgoals/weekendgoals-types/dist/tickets"; import { UserFeature } from "@weekendgoals/weekendgoals-types/dist/users"; import { League } from "@weekendgoals/weekendgoals-types/dist/leagues"; import { SearchResults } from "@weekendgoals/weekendgoals-types/dist/search"; import { Gender, Squad } from "@weekendgoals/weekendgoals-types/dist/classification"; import { AnnotatedLogEntry, ConfirmPlanRequest, CoverageSummary, CreateLogEntryRequest, CreatePlanRequest, EntryConsequences, LogEntry, LogStats, Plan, SetCoverageDetail, UpdateLogEntryRequest } from "@weekendgoals/weekendgoals-types/dist/log"; /** * The API takes endDate as a day and includes everything up to the end of * that day in UTC. Formatting it in the browser's timezone instead moved the * boundary by a day either way — the same Date produced a different window * depending on where the reader was, and callers that build a matching * `to=YYYY-MM-DD` link (the nearby-matches map) disagreed with what they had * just fetched. */ export declare function formatEndDateParam(endDate?: Date): string | undefined; export interface VenuesParams { boundingBox?: BoundingBox; limit?: number; abortController?: AbortController; } export interface AttractionsParams { boundingBox?: BoundingBox; limit?: number; abortController?: AbortController; } /** `GET /me` — the calling user, from `MeHandlers.getMe` (api-gateway/CLAUDE.md "Me and the log"). */ export interface Me { id: string; email: string; firstName: string | null; lastName: string | null; /** * The invite-only sections this account may see at all. Always present — * an account with none gets `[]` — because `/me` is the only route that * reports it: every gated route 404s rather than answering, so a client * has nowhere else to ask. */ features: UserFeature[]; } export interface MatchesParams { limit: number; offset?: number; startDate: Date; endDate?: Date; boundingBox?: BoundingBox; lng?: number; lat?: number; dist?: number; onlyMatches: boolean; venueIds?: string[]; competitionId?: string; competitionIds?: string[]; hasTickets?: boolean; country?: string; countries?: string[]; teamIds?: string[]; sort?: string; topRanks?: number; gender?: Gender; squad?: Squad; abortController?: AbortController; } export declare class ApiClient { private readonly client; constructor(apiBaseUrl: string, onError: (e: Error) => void, getRequestHeaders?: () => Record | Promise | undefined> | undefined); getBaseUrl: () => string; updateToken: (token: string) => void; getVenuesById: (venueIdsParam: string[]) => Promise; /** * `GET /venues/search` — a person typing a ground name (the log's manual * entry), not the scraper's whole-name resolver at `/venues/search/name`. * Answers with a list, never a 404; the server bounds `limit` itself. */ searchVenuesByName: (name: string, limit?: number, abortController?: AbortController) => Promise; getVenues: ({ boundingBox, limit, abortController, }: VenuesParams) => Promise; getMatches: ({ limit, offset, startDate, endDate, boundingBox, onlyMatches, lng, lat, dist, venueIds, competitionId, competitionIds, hasTickets, country, countries, teamIds, sort, topRanks, gender, squad, abortController, }: MatchesParams) => Promise; getMatchesByIds: (matchesIdsParam: string[]) => Promise; getTeamsByVenueId(venueId: string): Promise; getTeamsByIds(teamsIdsParam: string[]): Promise; getTeamsByName({ teamName, limit, }: { teamName: string; limit: number; }): Promise; contactUsMessage: ({ name, email, subject, message }: EmailParams) => Promise; getConfig: () => Promise; getAttractions: ({ boundingBox, limit, abortController, }: AttractionsParams) => Promise; getAttractionsByVenueId(venueId: string): Promise; getMatchesForTeams(teamIdsParam: string[], { limit, startDate, endDate, }: { limit: number; startDate: Date; endDate?: Date; }): Promise; getTicketsByMatchId(matchIdsParam: string[]): Promise; getLeaguesByIds(leagueIdsParam: string[]): Promise; getLeagues(params?: { search?: string; limit?: number; abortController?: AbortController; countries?: string[]; /** The two axes who competes is asked on. */ gender?: Gender; squad?: Squad; type?: string; withUpcomingMatches?: boolean; upcomingMatchesDays?: number; confederation?: string; scope?: string; }): Promise; /** * The search box's one call. * * It replaces three — teams, countries and leagues in parallel, each capped * separately — which could not be ranked against each other on this side: * whichever rows a per-type cap dropped were never seen here. The gateway * ranks them together and returns the sections already ordered, plus the * single best answer as `top`. * * `abortController` is not optional in practice. The box fires on every * keystroke, and two responses can land out of order, which shows the user * the results for a prefix of what they have typed. */ search(query: string, abortController?: AbortController): Promise; getCountries(search?: string, limit?: number, abortController?: AbortController): Promise; getCitiesByName(cityName: string, limit: number, abortController?: AbortController): Promise; getMatchesByCompetitionId(competitionId: string, { startDate, endDate }: { startDate: string; endDate: string; }): Promise; createGuestToken(): Promise; getMe(): Promise; getLogEntries(params?: { limit?: number; offset?: number; }): Promise<{ entries: AnnotatedLogEntry[]; total: number; }>; getLogEntry(id: string): Promise; /** Career stats — every count computed from the caller's entries alone. */ getMyLogStats(): Promise; createLogEntry(entry: CreateLogEntryRequest): Promise; updateLogEntry(id: string, update: UpdateLogEntryRequest): Promise; deleteLogEntry(id: string): Promise; /** The deltas of deleting this entry (GHF-6) — nothing is deleted by this call. */ getLogEntryConsequences(id: string): Promise; /** Every set's progress against the caller's log, and the nearest one to completing (GHF-6). */ getLogCoverage(): Promise; /** One set's full membership, each ground's visit state and next fixture (GHF-6). */ getLogCoverageForSet(slug: string): Promise; getPlans(): Promise<{ plans: Plan[]; }>; createPlan(plan: CreatePlanRequest): Promise; /** Only `askedAt` is ever editable — see api-gateway/CLAUDE.md "Me and the log: plans (GHF-3)". */ updatePlan(id: string, update: { askedAt: string | null; }): Promise; /** Turns the plan into a log entry (source "planned") and deletes the plan. */ confirmPlan(id: string, body: ConfirmPlanRequest): Promise; /** Dismiss — deletes the plan outright, nothing created. */ deletePlan(id: string): Promise; } //# sourceMappingURL=api-client.d.ts.map