Objects
These are miscellaneous objects that are used throughout the library, documented here for reference.
AssetTypes
Section titled “AssetTypes”The AssetTypes object is used to define the possible types of an Asset.
const AssetTypes = { PIPE: "Pipe", JUNCTION: "Junction", VALVE: "Valve", PUMP: "Pump", SUPPLY_SOURCE: "SupplySource", TANK: "Tank"} as const;AssetReadings
Section titled “AssetReadings”The AssetReadings object holds the readings of an asset, retrieved through the readings API. It has one key per property measured in the asset. Each value is a single Reading for latest() and forPeriod(), and an array of Reading objects for forRange().
type Reading = { asset: string; property: AssetProperty; value: number; date: Date; unit: string;}The properties that can be measured depend on the asset type:
| Asset type | Properties |
|---|---|
Pipe | flow |
Junction | pressure, demand |
Tank | level |
Pump | setting, status, upstreamPressure, downstreamPressure |
Valve | setting, status, upstreamPressure, downstreamPressure |
SupplySource | None |
{ pressure: { asset: "J1", property: "pressure", value: 32.4, date: Date, unit: "mwc" }, demand: { asset: "J1", property: "demand", value: 1.2, date: Date, unit: "l/s" }}AssetReadingsCollection
Section titled “AssetReadingsCollection”type AssetReadingsCollection<T extends AssetType> = { date: Date readings: AssetReadings<T>}[]Levels
Section titled “Levels”The network level of an asset. See how levels are calculated in Pipe.
const Levels = { ARTERIAL: "arterial", DISTRIBUTION: "distribution"} as const;ValveFamilies
Section titled “ValveFamilies”const ValveFamilies = { PRV: "PRV", PSV: "PSV", PBV: "PBV", FCV: "FCV", TCV: "TCV", GPV: "GPV"} as const;ValveGroups
Section titled “ValveGroups”const ValveGroups = { Regulating: "regulating", ShutOff: "shutOff"} as const;PipeGroups
Section titled “PipeGroups”const PipeGroups = { Main: "main", Lateral: "lateral"} as const;JunctionGroups
Section titled “JunctionGroups”const JunctionGroups = { Hydrant: "hydrant", CustomerPoint: "customerPoint", Junction: "junction"} as const;The Unit object is used to define the possible units of a measurement. It is a string that can be one of the following values:
mminkwhpmftm^3ft^3ft^3/sl/sl/ml/minMl/dm^3/hm^3/dgal/minMgal/dMgallon-imp/dacre ft/dkmmimwcm/smwc/kmft/sft/kftpsipercentagehnull
The Units object (UnitsData) is returned by getUnits() and defines the measurement system used by the network: the system and the Unit of each parameter. The default units for each system are:
International system
Section titled “International system”{ "system": "international", "parameters": { "capacity": "percentage", "customer": null, "element_length": "m", "elevation": "m", "flow": "l/s", "level": "m", "network_length": "km", "percentage": "percentage", "pipe_diameter": "mm", "pipe_status": null, "power": "kw", "pressure": "mwc", "pump_status": null, "relative_head": "m", "roughness": null, "tank_diameter": "m", "unitary_headloss": "mwc/km", "valve_diameter": "mm", "valve_status": null, "velocity": "m/s", "volume": "m^3", "water_age": "h" }}US Customary System
Section titled “US Customary System”{ "system": "usCustomary", "parameters": { "capacity": "percentage", "customer": null, "element_length": "ft", "elevation": "ft", "flow": "gal/min", "level": "ft", "network_length": "mi", "percentage": "percentage", "pipe_diameter": "in", "pipe_status": null, "power": "hp", "pressure": "psi", "pump_status": null, "relative_head": "ft", "roughness": null, "tank_diameter": "ft", "unitary_headloss": "ft/kft", "valve_diameter": "in", "valve_status": null, "velocity": "ft/s", "volume": "ft^3", "water_age": "h" }}Materials
Section titled “Materials”The Materials property is used to define the possible materials of a pipe. Its value can be one of:
- AC: Asbestos Cement
- ARO: Abrasion Resistant Outerwrap
- CI: Cast Iron
- COPP: Copper
- CWOSMJ: Concrete Without Steel Metal Jacket
- CWSMJ: Concrete With Steel Metal Jacket
- DI: Ductile Iron
- DIL: Lined Ductile Iron
- FE: Iron
- GI: Galvanized Iron
- GIL: Lined Galvanized Iron
- HDPE: High Density Polyethylene
- L: Lead
- LDPE: Low Density Polyethylene
- MDPE: Medium Density Polyethylene
- NA: Not Available
- PC: Prestressed Concrete
- PE: Polyethylene
- PE80: Polyethylene 80
- PE100: Polyethylene 100
- PVC: Polyvinyl Chloride
- PVCO: Oriented Polyvinyl Chloride
- RC: Reinforced Concrete
- S: Steel
- SI: Spun Iron
- SS: Stainless Steel
- UNK: Unknown
- UPVC: Unplasticized Polyvinyl Chloride
Time has 2 attributes:
- time: The specific Date and time in UTC
- timezone: The timezone to use to localize this date
type Time = { time: Date timezone: string}Success and Failure
Section titled “Success and Failure”Many methods that change the state of Qatium return a Success or a Failure object. Check its status to know the result of the operation.
type Success = { status: "success";}
type Failure = { status: "failure"; error: Error | string;}ElementIdentifier
Section titled “ElementIdentifier”Identifies a network element (an asset or a zone) by its ID and type. type is one of the AssetTypes values or "Zone".
type ElementIdentifier = { id: string; type: "Pipe" | "Junction" | "Valve" | "Pump" | "SupplySource" | "Tank" | "Zone";}