EventorExtensions
Types
discipline
Helpers for reading the Eventor-specific data carried in IOF XML 3.0 <Extensions> elements emitted by the Eventor REST API.
Eventor writes these under the namespace http://eventor.orientering.se/iofxmlextensions, prefixed eventor:. Typical extension fields appear inside an <Event>'s top-level <Extensions> and inside each <Race>'s <Extensions>:
<Extensions>
<eventor:EventRaceId type="Eventor">24332</eventor:EventRaceId>
<eventor:StartListExists>true</eventor:StartListExists>
<eventor:ResultListExists>true</eventor:ResultListExists>
<eventor:Discipline>Foot</eventor:Discipline>
<eventor:Discipline>MountainBike</eventor:Discipline>
<eventor:LightCondition>Day</eventor:LightCondition>
<eventor:Attribute id="2">Ukas løype</eventor:Attribute>
</Extensions><eventor:Discipline> and <eventor:Attribute> can each appear multiple times. The IOF XSD does not constrain <Extensions> content, so the type here is intentionally Eventor-specific.
type discipline =
| Foot
| MountainBike
| Ski
| Trail
| Indoor
| OtherDiscipline(string)Constructors:
FootMountainBikeSkiTrailIndoorOtherDiscipline(string)
lightCondition
Whether a race takes place during the day, at night, or both.
type lightCondition =
| Day
| Night
| DayAndNight
| OtherLight(string)Constructors:
DayNightDayAndNightOtherLight(string)
attribute
A custom Eventor event attribute. The set of attributes is instance- specific — e.g. the Norwegian Eventor exposes Ukas løype, Paratilbud, etc.
type attribute = {id: string, value: string}Fields:
id:string— The numeric attribute id assigned by Eventor (as a string, preserving the wire format).value:string— The human-readable attribute name (text content).
t
Eventor extension fields seen on <Event> and <Race> elements.
type t = {
eventRaceId: option<string>,
startListExists: option<bool>,
resultListExists: option<bool>,
disciplines: array<discipline>,
lightCondition: option<lightCondition>,
attributes: array<attribute>,
}Fields:
eventRaceId:option<string>— Internal Eventor identifier for a race within a multi-race event.startListExists:option<bool>— Whether a start list has been published for this event/race.resultListExists:option<bool>— Whether a result list has been published for this event/race.disciplines:array<discipline>— Eventor's discipline classification. Repeatable — an event/race that accommodates multiple disciplines lists each one separately.lightCondition:option<lightCondition>— Eventor's day/night classification (only on<Race>in practice).attributes:array<attribute>— Custom Eventor attributes attached to the parent element.
Values
emptyExtensions
let emptyExtensions: tparseDiscipline
let parseDiscipline: string => disciplineparseLightCondition
let parseLightCondition: string => lightConditionparseBool
let parseBool: string => option<bool>fromElement
Extract Eventor extension fields from an arbitrary IOF element (e.g. an <Event> or <Race>). Returns emptyExtensions if the element has no <Extensions> child or no Eventor-namespaced fields inside.
let fromElement: IofXml.XmlUtils.xmlElement => t