Skip to content
We're currently creating a lot of content. Sign up to get notified when it's ready.

Objects

These are miscellaneous objects that are used throughout the library, documented here for reference.

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

The AssetReadings object holds the possible readings of an asset, retrieved through the readings API.

For tanks
{
level: [{
asset: string;
date: Date;
property: "level";
unit: Unit;
value: number
}]
}
For pipes
{
flow: [{
asset: string;
date: Date;
property: "flow";
unit: Unit;
value: number
}]
}
For junctions
{
pressure: [{
asset: string;
date: Date;
property: "pressure";
unit: Unit;
value: number
}],
demand: [{
asset: string;
date: Date;
property: "demand";
unit: Unit;
value: number
}]
}
For pumps
{
upstreamPressure: [{
asset: string;
date: Date;
property: "upstreamPressure";
unit: Unit;
value: number
}],
downstreamPressure: [{
asset: string;
date: Date;
property: "downstreamPressure";
unit: Unit;
value: number
}],
setting: [{
asset: string;
date: Date;
property: "setting";
unit: Unit;
value: number
}],
status: [{
asset: string;
date: Date;
property: "status";
unit: Unit;
value: number
}]
}
For valves
{
upstreamPressure: [{
asset: string;
date: Date;
property: "upstreamPressure";
unit: Unit;
value: number
}],
downstreamPressure: [{
asset: string;
date: Date;
property: "downstreamPressure";
unit: Unit;
value: number
}],
setting: [{
asset: string;
date: Date;
property: "setting";
unit: Unit;
value: number
}],
status: [{
asset: string;
date: Date;
property: "status";
unit: Unit;
value: number
}]
}

AssetReadingsCollection

type AssetReadingsCollection<T extends AssetType> = {
date: Date
readings: AssetReadings<T>
}[]

ValveFamilies

const ValveFamilies = {
PRV: "PRV",
PSV: "PSV",
PBV: "PBV",
FCV: "FCV",
TCV: "TCV",
GPV: "GPV"
} as const;

ValveGroups

const ValveGroups = {
Regulating: "regulating",
ShutOff: "shutOff"
} as const;

PipeGroups

const PipeGroups = {
Main: "main",
Lateral: "lateral"
} as const;

JunctionGroups

const JunctionGroups = {
Hydrant: "hydrant",
CustomerPoint: "customerPoint",
Junction: "junction"
} as const;

Unit

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:

  • mm
  • in
  • kw
  • hp
  • m
  • ft
  • m^3
  • ft^3
  • ft^3/s
  • l/s
  • l/m
  • l/min
  • Ml/d
  • m^3/h
  • m^3/d
  • gal/min
  • Mgal/d
  • Mgallon-imp/d
  • acre ft/d
  • km
  • mi
  • mwc
  • m/s
  • mwc/km
  • ft/s
  • ft/kft
  • psi
  • percentage
  • h
  • ul
  • null

Units

The Units object is used to define the measurement system used by the network. It is an object with the following properties:

International system

{
"system": "international",
"parameters": {
"capacity": "percentage",
"customer": null,
"element_length": "m",
"elevation": "m",
"flow": "l/s",
"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_status": null,
"velocity": "m/s",
"volume": "m^3",
"water_age": "h"
}
}

US Customary System

{
"system": "usCustomary",
"parameters": {
"capacity": "percentage",
"customer": null,
"element_length": "ft",
"elevation": "ft",
"flow": "gal/min",
"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_status": null,
"velocity": "ft/s",
"volume": "ft^3",
"water_age": "h"
}
}

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

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
}