TMX API Surface
This page documents all tods-competition-factory methods used by the TMX client and the competition-factory-server, organized by category. Each method links to its governor documentation page.
TMX Mutation Methods
These 70 methods are invoked via mutationRequest() on the client, sent through Socket.IO to the server's executionQueue, executed by the factory engine, then applied locally on acknowledgment.
Event Management
| Method | Governor | Context |
|---|---|---|
| addEvent | Event | Create a new tournament event |
| deleteEvents | Event | Remove one or more events |
| modifyEvent | Event | Update event properties |
Draw Management
| Method | Governor | Context |
|---|---|---|
| addDrawDefinition | Event | Attach a draw definition to an event |
| deleteDrawDefinitions | Event | Remove draw definitions |
| modifyDrawDefinition | Draws | Update draw definition properties |
| resetDrawDefinition | Draws | Reset a draw to its initial state |
| removeStructure | Draws | Remove a structure from a draw |
| renameStructures | Draws | Rename structures within a draw |
| addPlayoffStructures | Draws | Add playoff structures to a draw |
| automatedPlayoffPositioning | Draws | Auto-position participants in playoff structures |
| attachQualifyingStructure | Draws | Link a qualifying structure to a main draw |
Draw Generation
| Method | Governor | Context |
|---|---|---|
| generateDrawDefinition | Generation | Generate a complete draw definition |
| generateFlightProfile | Generation | Generate flight profile for an event |
| attachFlightProfile | Event | Attach a flight profile to an event |
| deleteFlightAndFlightDraw | Event | Remove a flight and its associated draw |
| addFlight | Event | Add a flight to an event's flight profile |
Ad Hoc Draws
| Method | Governor | Context |
|---|---|---|
| addAdHocMatchUps | Draws | Add matchUps to an ad hoc draw |
| deleteAdHocMatchUps | Draws | Remove matchUps from an ad hoc draw |
| luckyDrawAdvancement | Draws | Advance participants in a lucky draw |
Entry Management
| Method | Governor | Context |
|---|---|---|
| addEventEntries | Entries | Add participants to an event's entry list |
| addDrawEntries | Entries | Add participants to a draw's entry list |
| addEventEntryPairs | Entries | Add doubles pairs to an event |
| modifyEntriesStatus | Entries | Change entry status (e.g., ALTERNATE, WITHDRAWN) |
| destroyPairEntries | Entries | Break apart doubles pair entries |
Participant Management
| Method | Governor | Context |
|---|---|---|
| addParticipants | Participant | Add participants to a tournament |
| deleteParticipants | Participant | Remove participants from a tournament |
| modifyParticipant | Participant | Update participant details |
| addIndividualParticipantIds | Participant | Add individuals to a group/team participant |
| removeIndividualParticipantIds | Participant | Remove individuals from a group/team participant |
Scoring
| Method | Governor | Context |
|---|---|---|
| setMatchUpStatus | MatchUp | Set matchUp score and outcome |
| resetScorecard | MatchUp | Clear a matchUp's score |
| setMatchUpFormat | MatchUp | Set scoring format for a matchUp |
Positioning
| Method | Governor | Context |
|---|---|---|
| setPositionAssignments | Draws | Assign participants to draw positions |
| setSubOrder | Draws | Set sub-ordering within a draw position |
Scheduling
| Method | Governor | Context |
|---|---|---|
| addMatchUpScheduleItems | Schedule | Add schedule details to a matchUp |
| bulkScheduleMatchUps | Schedule | Schedule multiple matchUps at once |
| proAutoSchedule | Schedule | Automated pro-level scheduling |
Team / Tie Operations
| Method | Governor | Context |
|---|---|---|
| modifyTieFormat | Event | Modify a tie format definition |
| assignTieMatchUpParticipantId | MatchUp | Assign a participant to a tie matchUp |
| removeTieMatchUpParticipantId | MatchUp | Remove a participant from a tie matchUp |
| resetMatchUpLineUps | MatchUp | Reset lineUps for a team matchUp |
Venue Management
| Method | Governor | Context |
|---|---|---|
| addVenue | Venue | Add a venue to a tournament |
| deleteVenues | Venue | Remove venues |
| modifyVenue | Venue | Update venue properties |
| addCourts | Venue | Add courts to a venue |
| modifyCourt | Venue | Update court properties |
| modifyCourtAvailability | Venue | Set court availability windows |
Publishing
| Method | Governor | Context |
|---|---|---|
| publishEvent | Publishing | Publish event data |
| unPublishEvent | Publishing | Unpublish event data |
| publishEventSeeding | Publishing | Publish event seeding |
| unPublishEventSeeding | Publishing | Unpublish event seeding |
| publishOrderOfPlay | Publishing | Publish order of play |
| unPublishOrderOfPlay | Publishing | Unpublish order of play |
| publishParticipants | Publishing | Publish participant data |
| unPublishParticipants | Publishing | Unpublish participant data |
Seeding / Ratings
| Method | Governor | Context |
|---|---|---|
| generateSeedingScaleItems | Generation | Generate seeding from scale items |
| setParticipantScaleItems | Participant | Set ranking/seeding scale items on participants |
| addDynamicRatings | Participant | Add dynamic ratings to participants |
| addParticipantTimeItem | Participant | Add a time item to a participant |
Sign-in
| Method | Governor | Context |
|---|---|---|
| modifyParticipantsSignInStatus | Participant | Update sign-in status for participants |
Tournament Settings
| Method | Governor | Context |
|---|---|---|
| setTournamentDates | Tournament | Set tournament start/end dates |
| setTournamentName | Tournament | Set tournament name |
| setTournamentNotes | Tournament | Set tournament notes |
Extensions / Resources
| Method | Governor | Context |
|---|---|---|
| addTournamentExtension | Tournament | Add an extension to the tournament record |
| addDrawDefinitionExtension | Draws | Add an extension to a draw definition |
| addEventExtension | Event | Add an extension to an event |
| addTournamentTimeItem | Tournament | Add a time item to the tournament |
| addOnlineResource | Tournament | Add an online resource (URL, image, etc.) |
Policies
| Method | Governor | Context |
|---|---|---|
| attachPolicies | Policy | Attach policy definitions to a tournament |
TMX Query Methods
These ~51 methods are called directly on tournamentEngine for read-only operations.
Tournament State
| Method | Governor | Context |
|---|---|---|
| getTournament | Query | Get the full tournament record |
| setState | Engine | Load a tournament record into the engine |
| reset | Engine | Clear engine state |
| getTournamentInfo | Tournament | Get tournament summary info |
| getTournamentTimeItem | Tournament | Get a specific time item from the tournament |
| newTournamentRecord | Tournament | Create a new empty tournament record |
| version | Engine | Get factory version |
Event Queries
| Method | Governor | Context |
|---|---|---|
| getEvent | Event | Get a single event by ID |
| getEvents | Event | Get all events in a tournament |
| getEventData | Publishing | Get event data with draw and matchUp details |
Draw Queries
| Method | Governor | Context |
|---|---|---|
| findDrawDefinition | Draws | Find a draw definition by ID |
| isAdHoc | Draws | Check if a draw is ad hoc type |
| isValidForQualifying | Draws | Check if a structure can have qualifying |
| getAvailablePlayoffProfiles | Draws | Get available playoff configurations |
| getValidGroupSizes | Draws | Get valid group sizes for round robin |
MatchUp Queries
| Method | Governor | Context |
|---|---|---|
| findMatchUp | MatchUp | Find a matchUp by ID |
| allDrawMatchUps | MatchUp | Get all matchUps in a draw |
| allEventMatchUps | MatchUp | Get all matchUps in an event |
| allTournamentMatchUps | Query | Get all matchUps in a tournament |
| tournamentMatchUps | Query | Get matchUps grouped by status |
| matchUpActions | MatchUp | Get available actions for a matchUp |
| positionActions | Draws | Get available actions for a draw position |
| getMatchUpFormat | MatchUp | Get the scoring format for a matchUp |
| calculateWinCriteria | MatchUp | Calculate win criteria for a matchUp format |
| checkScoreHasValue | Score | Check if a score object has a value |
Participant Queries
| Method | Governor | Context |
|---|---|---|
| getParticipants | Participant | Get participants with optional filtering |
| getParticipantStats | Query | Get statistics for a participant |
| getPredictiveAccuracy | MatchUp | Get predictive accuracy metrics |
Query Draw Generation
| Method | Governor | Context |
|---|---|---|
| generateDrawDefinition | Generation | Generate a draw (also used as query for preview) |
| generateAdHocMatchUps | Generation | Generate matchUps for ad hoc draws |
| generateQualifyingStructure | Generation | Generate a qualifying structure |
| generateFlightProfile | Generation | Generate a flight profile |
| generateSeedingScaleItems | Generation | Generate seeding scale items |
| drawMatic | Generation | DrawMatic draw generation |
Query Positioning
| Method | Governor | Context |
|---|---|---|
| getPositionAssignments | Draws | Get current position assignments |
| getEntriesAndSeedsCount | Entries | Get entry count and seeds count |
| getSeedsCount | Draws | Get the number of seeds |
| getLuckyDrawRoundStatus | Draws | Get status of lucky draw rounds |
Query Scheduling
| Method | Governor | Context |
|---|---|---|
| getCompetitionDateRange | Tournament | Get competition date range |
Tie Format
| Method | Governor | Context |
|---|---|---|
| getTieFormat | Query | Get the tie format for an event or draw |
Venue
| Method | Governor | Context |
|---|---|---|
| findVenue | Venue | Find a venue by ID |
Policy / Extensions
| Method | Governor | Context |
|---|---|---|
| findPolicy | Policy | Find a policy definition |
| getPolicyDefinitions | Policy | Get all policy definitions |
| findExtension | Query | Find an extension by name |
Query Publishing
| Method | Governor | Context |
|---|---|---|
| getPublishState | Publishing | Get current publish state |
Query Scoring
| Method | Governor | Context |
|---|---|---|
| parseScoreString | Score | Parse a score string into a score object |
| setMatchUpStatus | MatchUp | Set matchUp score (also used as query for validation) |
Teams
| Method | Governor | Context |
|---|---|---|
| createTeamsFromParticipantAttributes | Participant | Auto-create team participants from attributes |
Category
| Method | Governor | Context |
|---|---|---|
| setTournamentCategories | Tournament | Set categories on the tournament record |
Other Engine Calls
competitionEngine
| Method | Governor | Context |
|---|---|---|
| competitionScheduleMatchUps | MatchUp | Get scheduled matchUps across tournaments |
| getCompetitionDateRange | Tournament | Get the date range of the competition |
| getTournamentInfo | Tournament | Get tournament info via competition engine |
| getVenuesAndCourts | Venue | Get all venues and courts |
| proConflicts | Schedule | Get scheduling conflicts for pro events |
scaleEngine
| Method | Governor | Context |
|---|---|---|
| generateDynamicRatings | Participant | Generate dynamic ratings across events |
| setState | Engine | Load state into scale engine |
mocksEngine
| Method | Governor | Context |
|---|---|---|
| generateTournamentRecord | Mocks | Generate a mock tournament record |
scoreGovernor (direct calls)
| Method | Governor | Context |
|---|---|---|
| checkScoreHasValue | Score | Check if a score has a value |
| generateScoreString | Score | Generate a display score string |
| keyValueScore | Score | Key-value based score entry |
queryGovernor (direct calls)
| Method | Governor | Context |
|---|---|---|
| allTournamentMatchUps | Query | Get all tournament matchUps |
| compareTieFormats | Query | Compare two tie format definitions |
publishingGovernor (direct calls)
| Method | Governor | Context |
|---|---|---|
| getPublishState | Publishing | Get publish state directly from governor |
globalState
| Method | Documentation | Context |
|---|---|---|
| getDevContext | Global State | Get development context flag |
| setDevContext | Global State | Set development context flag |
| setSubscriptions | Subscriptions | Register topic subscription handlers |
tools
| Method | Documentation | Context |
|---|---|---|
| createMap | Tools | Create a keyed map from an array |
| dateTime | Tools | Date/time utilities |
| definedAttributes | Tools | Filter out undefined attributes |
| extractAttributes | Tools | Extract specific attributes from objects |
| generateDateRange | Tools | Generate an array of dates in a range |
| generateRange | Tools | Generate a numeric range array |
| intersection | Tools | Array intersection |
| isConvertableInteger | Tools | Check if a value can be converted to integer |
| isNumeric | Tools | Check if a value is numeric |
| JSON | Tools | JSON utilities |
| makeDeepCopy | Tools | Deep copy with circular reference handling |
| matchUpScheduleSort | Tools | Sort matchUps by schedule |
| nextPowerOf | Tools | Get next power of 2 |
| structureSort | Tools | Sort structures by stage/order |
| unique | Tools | Deduplicate an array |
| UUID | Tools | Generate a UUID |
| UUIDS | Tools | Generate multiple UUIDs |
Competition Factory Server Methods
The server uses a focused subset of factory methods for mutation execution and query serving.
Engines
| Method | Documentation | Context |
|---|---|---|
| asyncEngine | Mutation Engines | Create async mutation engine (per-request isolation) |
| askEngine | State Engines | Query engine with importMethods support |
Mutation Engine
| Method | Documentation | Context |
|---|---|---|
| setState | State Engines | Load tournament records into engine |
| executionQueue | Mutation Engines | Execute a batch of mutations atomically |
| getState | State Engines | Retrieve current engine state |
Query Methods (via askEngine)
| Method | Governor | Context |
|---|---|---|
| getTournamentInfo | Tournament | Get tournament summary for responses |
| getEventData | Publishing | Get event data for publishing |
| getParticipants | Participant | Get participants for responses |
| getTournamentPublishStatus | Publishing | Get full publish status |
| competitionScheduleMatchUps | MatchUp | Get scheduled matchUps |
Governors (direct usage)
| Method | Governor | Context |
|---|---|---|
| generateTournamentRecord | Mocks | Generate mock tournaments for testing |
| reportGovernor methods | Report | Merged into query engine |
Server globalState
| Method | Documentation | Context |
|---|---|---|
| setStateMethods | Global State | Set custom state methods |
| setStateProvider | Global State | Set state provider for async isolation |
| setGlobalSubscriptions | Subscriptions | Register global subscriptions |
| setSubscriptions | Subscriptions | Register topic subscriptions |
Server tools
| Method | Documentation | Context |
|---|---|---|
| unique | Tools | Deduplicate arrays |
| UUID | Tools | Generate UUIDs |
Constants
| Constant | Module | Values |
|---|---|---|
MISSING_TOURNAMENT_RECORD | factoryConstants / errorConditionConstants | Error condition for missing tournament |
SINGLES | eventConstants | Event type constant |
PUBLISH_EVENT, UNPUBLISH_EVENT | topicConstants | Publish/unpublish event topics |
PUBLISH_ORDER_OF_PLAY, UNPUBLISH_ORDER_OF_PLAY | topicConstants | Order of play topics |
PUBLISH_PARTICIPANTS, UNPUBLISH_PARTICIPANTS | topicConstants | Participant publishing topics |
UNPUBLISH_TOURNAMENT | topicConstants | Tournament unpublish topic |
MODIFY_TOURNAMENT_DETAIL | topicConstants | Tournament detail modification topic |
Fixtures
| Fixture | Path | Context |
|---|---|---|
POLICY_PRIVACY_DEFAULT | fixtures.policies | Default privacy policy for participant data |
Types
| Type | Context |
|---|---|
Tournament | TypeScript type for tournament record |