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.

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;

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 typeProperties
Pipeflow
Junctionpressure, demand
Tanklevel
Pumpsetting, status, upstreamPressure, downstreamPressure
Valvesetting, status, upstreamPressure, downstreamPressure
SupplySourceNone
Example for a junction, as returned by latest()
{
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"
}
}
type AssetReadingsCollection<T extends AssetType> = {
date: Date
readings: AssetReadings<T>
}[]

The network level of an asset. See how levels are calculated in Pipe.

const Levels = {
ARTERIAL: "arterial",
DISTRIBUTION: "distribution"
} as const;
const ValveFamilies = {
PRV: "PRV",
PSV: "PSV",
PBV: "PBV",
FCV: "FCV",
TCV: "TCV",
GPV: "GPV"
} as const;
const ValveGroups = {
Regulating: "regulating",
ShutOff: "shutOff"
} as const;
const PipeGroups = {
Main: "main",
Lateral: "lateral"
} as const;
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:

  • 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
  • null

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:

{
"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"
}
}
{
"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"
}
}

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
}

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;
}

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";
}