import {z} from 'zod' export type GetApiTeamTeamKeyEventEventKeyMatchesArgs = {'If-None-Match'?: string | undefined, team_key: string, event_key: string}; export type GetApiTeamTeamKeyEventEventKeyMatchesOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; export const compLevel = z.enum(["pm", "qm", "ef", "qf", "sf", "f"]); export const matchAlliance = z.object({score: z.number().int(), team_keys: z.array(z.string()), surrogate_team_keys: z.array(z.string()), dq_team_keys: z.array(z.string())}); export const allianceColor = z.enum(["red", "blue", ""]); export const matchScoreBreakdown2015Alliance = z.object({auto: z.string().nullable().optional(), auto_points: z.number().int().nullable().optional(), teleop_points: z.number().int().optional(), container_points: z.number().int().optional(), tote_points: z.number().int().optional(), litter_points: z.number().int().optional(), foul: z.string().nullable().optional(), foul_points: z.number().int().nullable().optional(), adjust_points: z.number().int().optional(), total_points: z.number().int().optional(), foul_count: z.number().int().optional(), tote_count_far: z.number().int().optional(), tote_count_near: z.number().int().optional(), tote_set: z.boolean().optional(), tote_stack: z.boolean().optional(), container_count_level1: z.number().int().optional(), container_count_level2: z.number().int().optional(), container_count_level3: z.number().int().optional(), container_count_level4: z.number().int().optional(), container_count_level5: z.number().int().optional(), container_count_level6: z.number().int().optional(), container_set: z.boolean().optional(), litter_count_container: z.number().int().optional(), litter_count_landfill: z.number().int().optional(), litter_count_unprocessed: z.number().int().optional(), robot_set: z.boolean().optional()}); export const matchScoreBreakdown2015 = z.object({blue: matchScoreBreakdown2015Alliance, red: matchScoreBreakdown2015Alliance, coopertition: z.enum(["None", "Unknown", "Stack"]), coopertition_points: z.number().int()}); export const robotAuto2016WithUnknown = z.enum(["Crossed", "None", "Reached", "Unknown"]); export const robotAuto2016WithoutUnknown = z.enum(["Crossed", "Reached", "None"]); export const towerFace2016 = z.enum(["Both", "Challenged", "None", "Scaled", "Unknown"]); export const position2016 = z.enum(["", "A_ChevalDeFrise", "A_Portcullis", "B_Moat", "B_Ramparts", "C_Drawbridge", "C_SallyPort", "D_RockWall", "D_RoughTerrain", "NotSpecified"]); export const matchScoreBreakdown2016Alliance = z.object({autoPoints: z.number().int(), teleopPoints: z.number().int().optional(), breachPoints: z.number().int(), foulPoints: z.number().int(), capturePoints: z.number().int(), adjustPoints: z.number().int().optional(), totalPoints: z.number().int(), tba_rpEarned: z.number().int().nullable(), robot1Auto: robotAuto2016WithUnknown.optional(), robot2Auto: robotAuto2016WithoutUnknown.optional(), robot3Auto: robotAuto2016WithUnknown.optional(), autoReachPoints: z.number().int(), autoCrossingPoints: z.number().int(), autoBouldersLow: z.number().int().optional(), autoBouldersHigh: z.number().int().optional(), autoBoulderPoints: z.number().int(), teleopCrossingPoints: z.number().int(), teleopBouldersLow: z.number().int(), teleopBouldersHigh: z.number().int(), teleopBoulderPoints: z.number().int(), teleopDefensesBreached: z.boolean(), teleopChallengePoints: z.number().int(), teleopScalePoints: z.number().int(), teleopTowerCaptured: z.boolean(), towerFaceA: towerFace2016.optional(), towerFaceB: towerFace2016.optional(), towerFaceC: towerFace2016.optional(), towerEndStrength: z.number().int().optional(), techFoulCount: z.number().int().optional(), foulCount: z.number().int().optional(), position2: position2016, position3: position2016, position4: position2016, position5: position2016, position1crossings: z.number().int(), position2crossings: z.number().int(), position3crossings: z.number().int(), position4crossings: z.number().int(), position5crossings: z.number().int()}); export const matchScoreBreakdown2016 = z.object({blue: matchScoreBreakdown2016Alliance, red: matchScoreBreakdown2016Alliance}); export const robotAuto2017 = z.enum(["Mobility", "None", "Unknown"]); export const touchpad2017 = z.enum(["None", "ReadyForTakeoff"]); export const matchScoreBreakdown2017Alliance = z.object({autoPoints: z.number().int(), teleopPoints: z.number().int(), foulPoints: z.number().int(), adjustPoints: z.number().int().optional(), totalPoints: z.number().int(), robot1Auto: robotAuto2017.optional(), robot2Auto: robotAuto2017.optional(), robot3Auto: robotAuto2017.optional(), rotor1Auto: z.boolean(), rotor2Auto: z.boolean(), autoFuelLow: z.number().int(), autoFuelHigh: z.number().int(), autoMobilityPoints: z.number().int(), autoRotorPoints: z.number().int(), autoFuelPoints: z.number().int(), teleopFuelPoints: z.number().int(), teleopFuelLow: z.number().int(), teleopFuelHigh: z.number().int(), teleopRotorPoints: z.number().int(), kPaRankingPointAchieved: z.boolean(), teleopTakeoffPoints: z.number().int(), kPaBonusPoints: z.number().int(), rotorBonusPoints: z.number().int(), rotor1Engaged: z.boolean(), rotor2Engaged: z.boolean(), rotor3Engaged: z.boolean(), rotor4Engaged: z.boolean(), rotorRankingPointAchieved: z.boolean(), tba_rpEarned: z.number().int().nullable().optional(), techFoulCount: z.number().int().optional(), foulCount: z.number().int().optional(), touchpadNear: touchpad2017.optional(), touchpadMiddle: touchpad2017.optional(), touchpadFar: touchpad2017.optional()}); export const matchScoreBreakdown2017 = z.object({blue: matchScoreBreakdown2017Alliance, red: matchScoreBreakdown2017Alliance}); export const autoRobot2018 = z.enum(["None", "AutoRun"]); export const endgameRobot2018 = z.enum(["Climbing", "Levitate", "None", "Parking", "Unknown"]); export const matchScoreBreakdown2018Alliance = z.object({adjustPoints: z.number().int().optional(), autoOwnershipPoints: z.number().int(), autoPoints: z.number().int(), autoQuestRankingPoint: z.boolean().optional(), autoRobot1: autoRobot2018.optional(), autoRobot2: autoRobot2018.optional(), autoRobot3: autoRobot2018.optional(), autoRunPoints: z.number().int(), autoScaleOwnershipSec: z.number().int(), autoSwitchAtZero: z.boolean().optional(), autoSwitchOwnershipSec: z.number().int(), endgamePoints: z.number().int(), endgameRobot1: endgameRobot2018.optional(), endgameRobot2: endgameRobot2018.optional(), endgameRobot3: endgameRobot2018.optional(), faceTheBossRankingPoint: z.boolean(), foulCount: z.number().int().optional(), foulPoints: z.number().int(), rp: z.number(), techFoulCount: z.number().int().optional(), teleopOwnershipPoints: z.number().int(), teleopPoints: z.number().int(), teleopScaleBoostSec: z.number().int(), teleopScaleForceSec: z.number().int().optional(), teleopScaleOwnershipSec: z.number().int(), teleopSwitchBoostSec: z.number().int(), teleopSwitchForceSec: z.number().int().optional(), teleopSwitchOwnershipSec: z.number().int(), totalPoints: z.number().int(), vaultBoostPlayed: z.number().int(), vaultBoostTotal: z.number().int(), vaultForcePlayed: z.number().int(), vaultForceTotal: z.number().int(), vaultLevitatePlayed: z.number().int(), vaultLevitateTotal: z.number().int(), vaultPoints: z.number().int(), tba_gameData: z.enum(["", "LLL", "LRL", "RLR", "RRR"]).optional()}); export const matchScoreBreakdown2018 = z.object({blue: matchScoreBreakdown2018Alliance, red: matchScoreBreakdown2018Alliance}); export const bay2019 = z.enum(["None", "Panel", "PanelAndCargo"]); export const endgameRobot2019 = z.enum(["HabLevel1", "HabLevel2", "HabLevel3", "None", "Unknown"]); export const habLine2019 = z.enum(["CrossedHabLineInSandstorm", "CrossedHabLineInTeleop", "None", "Unknown"]); export const preMatchBay2019 = z.enum(["Cargo", "Panel", "Unknown"]); export const matchScoreBreakdown2019Alliance = z.object({adjustPoints: z.number().int().optional(), autoPoints: z.number().int().optional(), bay1: bay2019, bay2: bay2019, bay3: bay2019, bay4: bay2019, bay5: bay2019, bay6: bay2019, bay7: bay2019, bay8: bay2019, cargoPoints: z.number().int(), completeRocketRankingPoint: z.boolean(), completedRocketFar: z.boolean().optional(), completedRocketNear: z.boolean().optional(), endgameRobot1: endgameRobot2019, endgameRobot2: endgameRobot2019, endgameRobot3: endgameRobot2019, foulCount: z.number().int().optional(), foulPoints: z.number().int(), habClimbPoints: z.number().int(), habDockingRankingPoint: z.boolean(), habLineRobot1: habLine2019, habLineRobot2: habLine2019, habLineRobot3: habLine2019, hatchPanelPoints: z.number().int(), lowLeftRocketFar: bay2019, lowLeftRocketNear: bay2019, lowRightRocketFar: bay2019, lowRightRocketNear: bay2019, midLeftRocketFar: bay2019, midLeftRocketNear: bay2019, midRightRocketFar: bay2019, midRightRocketNear: bay2019, preMatchBay1: preMatchBay2019, preMatchBay2: preMatchBay2019, preMatchBay3: preMatchBay2019, preMatchBay6: preMatchBay2019, preMatchBay7: preMatchBay2019, preMatchBay8: preMatchBay2019, preMatchLevelRobot1: endgameRobot2019, preMatchLevelRobot2: endgameRobot2019, preMatchLevelRobot3: endgameRobot2019, rp: z.number(), sandStormBonusPoints: z.number().int(), techFoulCount: z.number().int().optional(), teleopPoints: z.number().int(), topLeftRocketFar: bay2019, topLeftRocketNear: bay2019, topRightRocketFar: bay2019, topRightRocketNear: bay2019, totalPoints: z.number().int()}); export const matchScoreBreakdown2019 = z.object({blue: matchScoreBreakdown2019Alliance, red: matchScoreBreakdown2019Alliance}); export const initLineRobot2020 = z.enum(["Exited", "None"]); export const endgameRobot2020 = z.enum(["Hang", "None", "Park"]); export const stage3TargetColor2020 = z.enum(["Blue", "Green", "Red", "Unknown", "Yellow"]); export const endgameRungIsLevel2020 = z.enum(["IsLevel", "NotLevel"]); export const matchScoreBreakdown2020Alliance = z.object({initLineRobot1: initLineRobot2020, endgameRobot1: endgameRobot2020, initLineRobot2: initLineRobot2020, endgameRobot2: endgameRobot2020, initLineRobot3: initLineRobot2020, endgameRobot3: endgameRobot2020, autoCellsBottom: z.number().int(), autoCellsOuter: z.number().int(), autoCellsInner: z.number().int(), teleopCellsBottom: z.number().int(), teleopCellsOuter: z.number().int(), teleopCellsInner: z.number().int(), stage1Activated: z.boolean(), stage2Activated: z.boolean(), stage3Activated: z.boolean(), stage3TargetColor: stage3TargetColor2020, endgameRungIsLevel: endgameRungIsLevel2020, autoInitLinePoints: z.number().int(), autoCellPoints: z.number().int(), autoPoints: z.number().int(), teleopCellPoints: z.number().int(), controlPanelPoints: z.number().int(), endgamePoints: z.number().int(), teleopPoints: z.number().int(), shieldOperationalRankingPoint: z.boolean(), shieldEnergizedRankingPoint: z.boolean(), tba_shieldEnergizedRankingPointFromFoul: z.boolean().optional(), tba_numRobotsHanging: z.number().int().optional(), foulCount: z.number().int(), techFoulCount: z.number().int(), adjustPoints: z.number().int().optional(), foulPoints: z.number().int(), rp: z.number().optional(), totalPoints: z.number().int()}); export const matchScoreBreakdown2020 = z.object({blue: matchScoreBreakdown2020Alliance, red: matchScoreBreakdown2020Alliance}); export const taxiRobot2022 = z.enum(["No", "Yes"]); export const endgameRobot2022 = z.enum(["High", "Low", "Mid", "None", "Traversal"]); export const matchScoreBreakdown2022Alliance = z.object({taxiRobot1: taxiRobot2022.optional(), endgameRobot1: endgameRobot2022.optional(), taxiRobot2: taxiRobot2022.optional(), endgameRobot2: endgameRobot2022.optional(), taxiRobot3: taxiRobot2022.optional(), endgameRobot3: endgameRobot2022.optional(), autoCargoLowerNear: z.number().int().optional(), autoCargoLowerFar: z.number().int().optional(), autoCargoLowerBlue: z.number().int().optional(), autoCargoLowerRed: z.number().int().optional(), autoCargoUpperNear: z.number().int().optional(), autoCargoUpperFar: z.number().int().optional(), autoCargoUpperBlue: z.number().int().optional(), autoCargoUpperRed: z.number().int().optional(), autoCargoTotal: z.number().int().optional(), teleopCargoLowerNear: z.number().int().optional(), teleopCargoLowerFar: z.number().int().optional(), teleopCargoLowerBlue: z.number().int().optional(), teleopCargoLowerRed: z.number().int().optional(), teleopCargoUpperNear: z.number().int().optional(), teleopCargoUpperFar: z.number().int().optional(), teleopCargoUpperBlue: z.number().int().optional(), teleopCargoUpperRed: z.number().int().optional(), teleopCargoTotal: z.number().int().optional(), matchCargoTotal: z.number().int().optional(), autoTaxiPoints: z.number().int().optional(), autoCargoPoints: z.number().int().optional(), autoPoints: z.number().int().optional(), quintetAchieved: z.boolean().optional(), teleopCargoPoints: z.number().int().optional(), endgamePoints: z.number().int().optional(), teleopPoints: z.number().int().optional(), cargoBonusRankingPoint: z.boolean().optional(), hangarBonusRankingPoint: z.boolean().optional(), foulCount: z.number().int().optional(), techFoulCount: z.number().int().optional(), adjustPoints: z.number().int().optional(), foulPoints: z.number().int().optional(), rp: z.number().nullable().optional(), totalPoints: z.number().int().optional()}); export const matchScoreBreakdown2022 = z.object({blue: matchScoreBreakdown2022Alliance, red: matchScoreBreakdown2022Alliance}); export const bridgeState2023 = z.enum(["Level", "NotLevel"]); export const autoChargeStationRobot2023 = z.enum(["Docked", "None"]); export const mobilityRobot2023 = z.enum(["No", "Yes"]); export const endGameChargeStationRobot2023 = z.enum(["Docked", "None", "Park", "Parked"]); export const matchScoreBreakdown2023Alliance = z.object({activationBonusAchieved: z.boolean().optional(), adjustPoints: z.number().int().optional(), autoBridgeState: bridgeState2023.optional(), autoChargeStationPoints: z.number().int().optional(), autoChargeStationRobot1: autoChargeStationRobot2023.optional(), autoChargeStationRobot2: autoChargeStationRobot2023.optional(), autoChargeStationRobot3: autoChargeStationRobot2023.optional(), autoDocked: z.boolean().optional(), autoCommunity: z.object({B: z.array(z.enum(["None", "Cone", "Cube"])), M: z.array(z.enum(["None", "Cone", "Cube"])), T: z.array(z.enum(["None", "Cone", "Cube"]))}).optional(), autoGamePieceCount: z.number().int().optional(), autoGamePiecePoints: z.number().int().optional(), autoMobilityPoints: z.number().int(), mobilityRobot1: mobilityRobot2023, mobilityRobot2: mobilityRobot2023, mobilityRobot3: mobilityRobot2023, autoPoints: z.number().int(), coopGamePieceCount: z.number().int().optional(), coopertitionCriteriaMet: z.boolean().optional(), endGameBridgeState: bridgeState2023.optional(), endGameChargeStationPoints: z.number().int().optional(), endGameChargeStationRobot1: endGameChargeStationRobot2023.optional(), endGameChargeStationRobot2: endGameChargeStationRobot2023.optional(), endGameChargeStationRobot3: endGameChargeStationRobot2023.optional(), endGameParkPoints: z.number().int().optional(), extraGamePieceCount: z.number().int().optional(), foulCount: z.number().int(), foulPoints: z.number().int(), techFoulCount: z.number().int(), linkPoints: z.number().int().optional(), links: z.array(z.object({nodes: z.array(z.enum(["None", "Cone", "Cube"])), row: z.enum(["Bottom", "Mid", "Top"])})).nullable().optional(), sustainabilityBonusAchieved: z.boolean().optional(), teleopCommunity: z.object({B: z.array(z.enum(["None", "Cone", "Cube"])), M: z.array(z.enum(["None", "Cone", "Cube"])), T: z.array(z.enum(["None", "Cone", "Cube"]))}).optional(), teleopGamePieceCount: z.number().int().optional(), teleopGamePiecePoints: z.number().int().optional(), totalChargeStationPoints: z.number().int().optional(), teleopPoints: z.number().int(), rp: z.number(), totalPoints: z.number().int()}); export const matchScoreBreakdown2023 = z.object({blue: matchScoreBreakdown2023Alliance, red: matchScoreBreakdown2023Alliance}); export const autoLineRobot2024 = z.enum(["No", "Yes"]); export const endGameRobot2024 = z.enum(["CenterStage", "None", "Parked", "StageLeft", "StageRight"]); export const matchScoreBreakdown2024Alliance = z.object({adjustPoints: z.number().int().optional(), autoAmpNoteCount: z.number().int().optional(), autoAmpNotePoints: z.number().int().optional(), autoLeavePoints: z.number().int().optional(), autoLineRobot1: autoLineRobot2024.optional(), autoLineRobot2: autoLineRobot2024.optional(), autoLineRobot3: autoLineRobot2024.optional(), autoPoints: z.number().int().optional(), autoSpeakerNoteCount: z.number().int().optional(), autoSpeakerNotePoints: z.number().int().optional(), autoTotalNotePoints: z.number().int().optional(), coopNotePlayed: z.boolean().optional(), coopertitionBonusAchieved: z.boolean().optional(), coopertitionCriteriaMet: z.boolean().optional(), endGameHarmonyPoints: z.number().int().optional(), endGameNoteInTrapPoints: z.number().int().optional(), endGameOnStagePoints: z.number().int().optional(), endGameParkPoints: z.number().int().optional(), endGameRobot1: endGameRobot2024.optional(), endGameRobot2: endGameRobot2024.optional(), endGameRobot3: endGameRobot2024.optional(), endGameSpotLightBonusPoints: z.number().int().optional(), endGameTotalStagePoints: z.number().int().optional(), ensembleBonusAchieved: z.boolean().optional(), ensembleBonusOnStageRobotsThreshold: z.number().int().optional(), ensembleBonusStagePointsThreshold: z.number().int().optional(), foulCount: z.number().int().optional(), foulPoints: z.number().int().optional(), g206Penalty: z.boolean().optional(), g408Penalty: z.boolean().optional(), g424Penalty: z.boolean().optional(), melodyBonusAchieved: z.boolean().optional(), melodyBonusThreshold: z.number().int().optional(), melodyBonusThresholdCoop: z.number().int().optional(), melodyBonusThresholdNonCoop: z.number().int().optional(), micCenterStage: z.boolean().optional(), micStageLeft: z.boolean().optional(), micStageRight: z.boolean().optional(), rp: z.number(), techFoulCount: z.number().int().optional(), teleopAmpNoteCount: z.number().int().optional(), teleopAmpNotePoints: z.number().int().optional(), teleopPoints: z.number().int().optional(), teleopSpeakerNoteAmplifiedCount: z.number().int().optional(), teleopSpeakerNoteAmplifiedPoints: z.number().int().optional(), teleopSpeakerNoteCount: z.number().int().optional(), teleopSpeakerNotePoints: z.number().int().optional(), teleopTotalNotePoints: z.number().int().optional(), totalPoints: z.number().int(), trapCenterStage: z.boolean().optional(), trapStageLeft: z.boolean().optional(), trapStageRight: z.boolean().optional()}); export const matchScoreBreakdown2024 = z.object({blue: matchScoreBreakdown2024Alliance, red: matchScoreBreakdown2024Alliance}); export const reefRow2025 = z.object({nodeA: z.boolean(), nodeB: z.boolean(), nodeC: z.boolean(), nodeD: z.boolean(), nodeE: z.boolean(), nodeF: z.boolean(), nodeG: z.boolean(), nodeH: z.boolean(), nodeI: z.boolean(), nodeJ: z.boolean(), nodeK: z.boolean(), nodeL: z.boolean()}); export const endGameRobot2025 = z.enum(["DeepCage", "None", "Parked", "ShallowCage"]); export const matchScoreBreakdown2025Alliance = z.object({adjustPoints: z.number().int().optional(), algaePoints: z.number().int(), autoBonusAchieved: z.boolean().optional(), autoCoralCount: z.number().int(), autoCoralPoints: z.number().int(), autoLineRobot1: autoLineRobot2024, autoLineRobot2: autoLineRobot2024, autoLineRobot3: autoLineRobot2024, autoMobilityPoints: z.number().int(), autoPoints: z.number().int(), autoReef: z.object({topRow: reefRow2025, midRow: reefRow2025, botRow: reefRow2025, trough: z.number().int(), tba_botRowCount: z.number().int().optional(), tba_midRowCount: z.number().int().optional(), tba_topRowCount: z.number().int().optional()}), bargeBonusAchieved: z.boolean().optional(), coopertitionCriteriaMet: z.boolean().optional(), coralBonusAchieved: z.boolean().optional(), endGameBargePoints: z.number().int(), endGameRobot1: endGameRobot2025, endGameRobot2: endGameRobot2025, endGameRobot3: endGameRobot2025, foulCount: z.number().int(), foulPoints: z.number().int(), g206Penalty: z.boolean(), g410Penalty: z.boolean(), g418Penalty: z.boolean(), g428Penalty: z.boolean(), netAlgaeCount: z.number().int(), rp: z.number(), techFoulCount: z.number().int(), teleopCoralCount: z.number().int(), teleopCoralPoints: z.number().int(), teleopPoints: z.number().int(), teleopReef: z.object({topRow: reefRow2025, midRow: reefRow2025, botRow: reefRow2025, trough: z.number().int(), tba_botRowCount: z.number().int().optional(), tba_midRowCount: z.number().int().optional(), tba_topRowCount: z.number().int().optional()}), totalPoints: z.number().int(), wallAlgaeCount: z.number().int()}); export const matchScoreBreakdown2025 = z.object({blue: matchScoreBreakdown2025Alliance, red: matchScoreBreakdown2025Alliance}); export const towerRobot2026 = z.enum(["Level1", "Level2", "Level3", "None"]); export const hubScore2026 = z.object({autoCount: z.number().int(), autoPoints: z.number().int(), endgameCount: z.number().int(), endgamePoints: z.number().int(), shift1Count: z.number().int(), shift1Points: z.number().int(), shift2Count: z.number().int(), shift2Points: z.number().int(), shift3Count: z.number().int(), shift3Points: z.number().int(), shift4Count: z.number().int(), shift4Points: z.number().int(), teleopCount: z.number().int(), teleopPoints: z.number().int(), totalCount: z.number().int(), totalPoints: z.number().int(), transitionCount: z.number().int(), transitionPoints: z.number().int()}); export const matchScoreBreakdown2026Alliance = z.object({adjustPoints: z.number().int(), autoTowerPoints: z.number().int(), autoTowerRobot1: towerRobot2026, autoTowerRobot2: towerRobot2026, autoTowerRobot3: towerRobot2026, endGameTowerPoints: z.number().int(), endGameTowerRobot1: towerRobot2026, endGameTowerRobot2: towerRobot2026, endGameTowerRobot3: towerRobot2026, energizedAchieved: z.boolean(), foulPoints: z.number().int(), g206Penalty: z.boolean(), hubScore: hubScore2026, majorFoulCount: z.number().int(), minorFoulCount: z.number().int(), rp: z.number(), superchargedAchieved: z.boolean(), totalAutoPoints: z.number().int(), totalPoints: z.number().int(), totalTeleopPoints: z.number().int(), totalTowerPoints: z.number().int(), traversalAchieved: z.boolean()}); export const matchScoreBreakdown2026 = z.object({blue: matchScoreBreakdown2026Alliance, red: matchScoreBreakdown2026Alliance}); export const match = z.object({key: z.string(), comp_level: compLevel, set_number: z.number().int(), match_number: z.number().int(), alliances: z.object({red: matchAlliance, blue: matchAlliance}), winning_alliance: allianceColor, event_key: z.string(), time: z.number().int().nullable(), actual_time: z.number().int().nullable(), predicted_time: z.number().int().nullable(), post_result_time: z.number().int().nullable(), score_breakdown: z.union([matchScoreBreakdown2015, matchScoreBreakdown2016, matchScoreBreakdown2017, matchScoreBreakdown2018, matchScoreBreakdown2019, matchScoreBreakdown2020, matchScoreBreakdown2022, matchScoreBreakdown2023, matchScoreBreakdown2024, matchScoreBreakdown2025, matchScoreBreakdown2026]).nullable(), videos: z.array(z.object({type: z.string(), key: z.string()}))}); export const getApiTeamTeamKeyEventEventKeyMatchesResponse = z.array(match); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Gets a list of matches for the given team and event. * * GET /team/{team_key}/event/{event_key}/matches */ export const getApiTeamTeamKeyEventEventKeyMatches = async (args: GetApiTeamTeamKeyEventEventKeyMatchesArgs, options?: GetApiTeamTeamKeyEventEventKeyMatchesOptions) => { const {baseUrl = "https://www.thebluealliance.com/api/v3", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args['If-None-Match'] != null) headers.set("If-None-Match", String(args['If-None-Match'])) if (apiKey !== undefined) headers.set("X-TBA-Auth-Key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/team/${encodeURIComponent(String(args.team_key))}/event/${encodeURIComponent(String(args.event_key))}/matches${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(getApiTeamTeamKeyEventEventKeyMatchesResponse, await res.json()) };