@utiliread/primitives 1.0.0-54 → 1.0.0-57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/time-or-rule.js +2 -1
- package/dist/cjs/time-or-rule.js.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/register-id.d.ts +1 -1
- package/dist/esm/time-or-rule.d.ts +5 -0
- package/dist/esm/time-or-rule.js +1 -2
- package/dist/esm/time-or-rule.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +35 -35
- package/src/register-id.ts +58 -6
- package/src/repository.ts +23 -23
- package/src/step.ts +37 -37
- package/src/time-or-rule.ts +17 -17
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.localeDecimalSeparator = exports.invariantDecimalSeparator = exports.Step = exports.Repository = exports.RegisterLibrary = exports.RegisterConvention = exports.PrecisionNumber = exports.NumberFormatter = exports.DayOfWeek = void 0;
|
|
3
|
+
exports.localeDecimalSeparator = exports.invariantDecimalSeparator = exports.TimeOrRule = exports.Step = exports.Repository = exports.RegisterLibrary = exports.RegisterConvention = exports.PrecisionNumber = exports.NumberFormatter = exports.DayOfWeek = void 0;
|
|
4
4
|
const register_library_1 = require("./register-library");
|
|
5
5
|
Object.defineProperty(exports, "RegisterLibrary", { enumerable: true, get: function () { return register_library_1.RegisterLibrary; } });
|
|
6
6
|
const number_formatter_1 = require("./number-formatter");
|
|
@@ -12,6 +12,8 @@ Object.defineProperty(exports, "RegisterConvention", { enumerable: true, get: fu
|
|
|
12
12
|
const step_1 = require("./step");
|
|
13
13
|
Object.defineProperty(exports, "Step", { enumerable: true, get: function () { return step_1.Step; } });
|
|
14
14
|
Object.defineProperty(exports, "DayOfWeek", { enumerable: true, get: function () { return step_1.DayOfWeek; } });
|
|
15
|
+
const time_or_rule_1 = require("./time-or-rule");
|
|
16
|
+
Object.defineProperty(exports, "TimeOrRule", { enumerable: true, get: function () { return time_or_rule_1.TimeOrRule; } });
|
|
15
17
|
const precision_number_1 = require("./precision-number");
|
|
16
18
|
Object.defineProperty(exports, "PrecisionNumber", { enumerable: true, get: function () { return precision_number_1.PrecisionNumber; } });
|
|
17
19
|
require("./repository"); // We need this to get the Repository namespace exported
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAGA,yDAAqD;AAuBjD,gGAvBK,kCAAe,OAuBL;AArBnB,yDAAwG;AAgBpG,gGAhBK,kCAAe,OAgBL;AAUf,0GA1BsB,4CAAyB,OA0BtB;AACzB,uGA3BiD,yCAAsB,OA2BjD;AA1B1B,+DAA2D;AAiBvD,mGAjBK,wCAAkB,OAiBL;AAdtB,iCAAyC;AAmBrC,qFAnBK,WAAI,OAmBL;AATJ,0FAVW,gBAAS,OAUX;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAGA,yDAAqD;AAuBjD,gGAvBK,kCAAe,OAuBL;AArBnB,yDAAwG;AAgBpG,gGAhBK,kCAAe,OAgBL;AAUf,0GA1BsB,4CAAyB,OA0BtB;AACzB,uGA3BiD,yCAAsB,OA2BjD;AA1B1B,+DAA2D;AAiBvD,mGAjBK,wCAAkB,OAiBL;AAdtB,iCAAyC;AAmBrC,qFAnBK,WAAI,OAmBL;AATJ,0FAVW,gBAAS,OAUX;AATb,iDAA4C;AAmBxC,2FAnBK,yBAAU,OAmBL;AAlBd,yDAAqD;AAWjD,gGAXK,kCAAe,OAWL;AAVnB,wBAAsB,CAAC,wDAAwD;AAC/E,6CAA0C;AActC,2FAdK,uBAAU,OAcL"}
|
package/dist/cjs/time-or-rule.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimeOrRule = void 0;
|
|
3
4
|
var TimeOrRule;
|
|
4
5
|
(function (TimeOrRule) {
|
|
5
6
|
function isTime(input) {
|
|
@@ -14,5 +15,5 @@ var TimeOrRule;
|
|
|
14
15
|
return isRule(input) ? input : input.toJSON();
|
|
15
16
|
}
|
|
16
17
|
TimeOrRule.asJSON = asJSON;
|
|
17
|
-
})(TimeOrRule || (TimeOrRule = {}));
|
|
18
|
+
})(TimeOrRule = exports.TimeOrRule || (exports.TimeOrRule = {}));
|
|
18
19
|
//# sourceMappingURL=time-or-rule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-or-rule.js","sourceRoot":"","sources":["../../src/time-or-rule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"time-or-rule.js","sourceRoot":"","sources":["../../src/time-or-rule.ts"],"names":[],"mappings":";;;AAIA,IAAiB,UAAU,CAY1B;AAZD,WAAiB,UAAU;IACvB,SAAgB,MAAM,CAAC,KAAiB;QACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;IACrC,CAAC;IAFe,iBAAM,SAErB,CAAA;IAED,SAAgB,MAAM,CAAC,KAAiB;QACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;IACrC,CAAC;IAFe,iBAAM,SAErB,CAAA;IAED,SAAgB,MAAM,CAAC,KAAiB;QACpC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IAClD,CAAC;IAFe,iBAAM,SAErB,CAAA;AACL,CAAC,EAZgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAY1B"}
|
package/dist/esm/index.js
CHANGED
|
@@ -2,8 +2,9 @@ import { RegisterLibrary } from "./register-library";
|
|
|
2
2
|
import { NumberFormatter, invariantDecimalSeparator, localeDecimalSeparator } from "./number-formatter";
|
|
3
3
|
import { RegisterConvention } from "./register-convention";
|
|
4
4
|
import { Step, DayOfWeek } from "./step";
|
|
5
|
+
import { TimeOrRule } from "./time-or-rule";
|
|
5
6
|
import { PrecisionNumber } from "./precision-number";
|
|
6
7
|
import "./repository"; // We need this to get the Repository namespace exported
|
|
7
8
|
import { Repository } from "./repository";
|
|
8
|
-
export { DayOfWeek, NumberFormatter, PrecisionNumber, RegisterConvention, RegisterLibrary, Repository, Step, invariantDecimalSeparator, localeDecimalSeparator, };
|
|
9
|
+
export { DayOfWeek, NumberFormatter, PrecisionNumber, RegisterConvention, RegisterLibrary, Repository, Step, TimeOrRule, invariantDecimalSeparator, localeDecimalSeparator, };
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,cAAc,CAAC,CAAC,wDAAwD;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAGH,SAAS,EAET,eAAe,EACf,eAAe,EACf,kBAAkB,EAGlB,eAAe,EACf,UAAU,EACV,IAAI,EACJ,UAAU,EAEV,yBAAyB,EACzB,sBAAsB,GAEzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type RegisterId = "none" | "heatEnergy" | "diffHeatEnergy" | "heatEnergyVolumeInInlet" | "diffHeatEnergyVolumeInInlet" | "heatEnergyVolumeInOutlet" | "diffHeatEnergyVolumeInOutlet" | "coolingEnergy" | "diffCoolingEnergy" | "coolingEnergyVolumeInInlet" | "diffCoolingEnergyVolumeInInlet" | "coolingEnergyVolumeInOutlet" | "diffCoolingEnergyVolumeInOutlet" | "electricalEnergy" | "diffElectricalEnergy" | "reactiveEnergy" | "diffReactiveEnergy" | "volume" | "diffVolume" | "inletVolume" | "diffInletVolume" | "outletVolume" | "diffOutletVolume" | "pulseInputAVolume" | "diffPulseInputAVolume" | "pulseInputBVolume" | "diffPulseInputBVolume" | "mass" | "diffMass" | "inletMass" | "diffInletMass" | "outletMass" | "diffOutletMass" | "power" | "maxPower" | "minPower" | "avgPower" | "inletPower" | "maxInletPower" | "minInletPower" | "avgInletPower" | "outletPower" | "maxOutletPower" | "minOutletPower" | "avgOutletPower" | "volumeFlow" | "maxVolumeFlow" | "minVolumeFlow" | "avgVolumeFlow" | "inletVolumeFlow" | "maxInletVolumeFlow" | "minInletVolumeFlow" | "avgInletVolumeFlow" | "outletVolumeFlow" | "maxOutletVolumeFlow" | "minOutletVolumeFlow" | "avgOutletVolumeFlow" | "massFlow" | "maxMassFlow" | "minMassFlow" | "avgMassFlow" | "inletMassFlow" | "maxInletMassFlow" | "minInletMassFlow" | "avgInletMassFlow" | "outletMassFlow" | "maxOutletMassFlow" | "minOutletMassFlow" | "avgOutletMassFlow" | "flowTemperature" | "maxFlowTemperature" | "minFlowTemperature" | "avgFlowTemperature" | "inletFlowTemperature" | "maxInletFlowTemperature" | "minInletFlowTemperature" | "avgInletFlowTemperature" | "outletFlowTemperature" | "maxOutletFlowTemperature" | "minOutletFlowTemperature" | "avgOutletFlowTemperature" | "inletMinusOutletFlowTemperatureDifference" | "maxInletMinusOutletFlowTemperatureDifference" | "minInletMinusOutletFlowTemperatureDifference" | "avgInletMinusOutletFlowTemperatureDifference" | "outletMinusInletFlowTemperatureDifference" | "maxOutletMinusInletFlowTemperatureDifference" | "minOutletMinusInletFlowTemperatureDifference" | "avgOutletMinusInletFlowTemperatureDifference" | "ambientTemperature" | "maxAmbientTemperature" | "minAmbientTemperature" | "avgAmbientTemperature" | "radiatorTemperature" | "maxRadiatorTemperature" | "minRadiatorTemperature" | "avgRadiatorTemperature" | "relativeHumidity" | "kamstrupE8Inlet" | "diffKamstrupE8Inlet" | "kamstrupE9Outlet" | "diffKamstrupE9Outlet" | "operatingTime" | "diffOperatingTime" | "remainingBatteryTime" | "diffRemainingBatteryTime" | "deviceDate" | "deviceTime" | "deviceDateTime" | "timeSinceLastExactOverhearingArrived" | "timeAtLastExactOverhearingArrived" | "timeSinceLastPossibleCandidateOverhearingArrived" | "timeAtLastPossibleCandidateOverhearingArrived" | "timeSinceLastSampled" | "timeAtLastSampled" | "timeSinceLastInstallationMounted" | "timeAtLastInstallationMounted" | "basetime" | "instantTime" | "periodStartTime" | "periodEndTime" | "instantOrPeriodStartTime" | "instantOrPeriodEndTime" | "device" | "wMBusDeviceAddresses" | "kamdraftDeviceAddresses" | "tchlrDeviceAddresses" | "kamdaDeviceAddresses" | "msisdnDeviceAddresses" | "deviceRegisters" | "consumptionZone" | "mBusFormatStringSignature" | "deviceSoftwareVersion" | "kamstrupMulticalInfocodeType1" | "kamstrupMulticalInfocodeType2" | "kamstrupMulticalInfocodeType3" | "kamstrupMulticalInfocodeType4" | "kamstrupMulticalInfocode" | "kamstrupModuleType" | "diehlInfocodeType1" | "diehlInfocode" | "landisGyrMBusStatusType1" | "landisGyrMBusStatusType2" | "landisGyrMBusStatus" | "landisGyrInfocodeType1" | "landisGyrInfocodeType2" | "landisGyrInfocode" | "infocode";
|
|
1
|
+
export declare type RegisterId = "none" | "heatEnergy" | "diffHeatEnergy" | "cntHeatEnergy" | "heatEnergyVolumeInInlet" | "diffHeatEnergyVolumeInInlet" | "cntHeatEnergyVolumeInInlet" | "heatEnergyVolumeInOutlet" | "diffHeatEnergyVolumeInOutlet" | "cntHeatEnergyVolumeInOutlet" | "coolingEnergy" | "diffCoolingEnergy" | "cntCoolingEnergy" | "coolingEnergyVolumeInInlet" | "diffCoolingEnergyVolumeInInlet" | "cntCoolingEnergyVolumeInInlet" | "coolingEnergyVolumeInOutlet" | "diffCoolingEnergyVolumeInOutlet" | "cntCoolingEnergyVolumeInOutlet" | "electricalEnergy" | "diffElectricalEnergy" | "cntElectricalEnergy" | "reactiveEnergy" | "diffReactiveEnergy" | "cntReactiveEnergy" | "volume" | "diffVolume" | "cntVolume" | "inletVolume" | "diffInletVolume" | "cntInletVolume" | "outletVolume" | "diffOutletVolume" | "cntOutletVolume" | "pulseInputAVolume" | "diffPulseInputAVolume" | "cntPulseInputAVolume" | "pulseInputBVolume" | "diffPulseInputBVolume" | "cntPulseInputBVolume" | "mass" | "diffMass" | "cntMass" | "inletMass" | "diffInletMass" | "cntInletMass" | "outletMass" | "diffOutletMass" | "cntOutletMass" | "power" | "maxPower" | "minPower" | "avgPower" | "cntPower" | "ssqPower" | "inletPower" | "maxInletPower" | "minInletPower" | "avgInletPower" | "cntInletPower" | "ssqInletPower" | "outletPower" | "maxOutletPower" | "minOutletPower" | "avgOutletPower" | "cntOutletPower" | "ssqOutletPower" | "volumeFlow" | "maxVolumeFlow" | "minVolumeFlow" | "avgVolumeFlow" | "cntVolumeFlow" | "ssqVolumeFlow" | "inletVolumeFlow" | "maxInletVolumeFlow" | "minInletVolumeFlow" | "avgInletVolumeFlow" | "cntInletVolumeFlow" | "ssqInletVolumeFlow" | "outletVolumeFlow" | "maxOutletVolumeFlow" | "minOutletVolumeFlow" | "avgOutletVolumeFlow" | "cntOutletVolumeFlow" | "ssqOutletVolumeFlow" | "massFlow" | "maxMassFlow" | "minMassFlow" | "avgMassFlow" | "cntMassFlow" | "ssqMassFlow" | "inletMassFlow" | "maxInletMassFlow" | "minInletMassFlow" | "avgInletMassFlow" | "cntInletMassFlow" | "ssqInletMassFlow" | "outletMassFlow" | "maxOutletMassFlow" | "minOutletMassFlow" | "avgOutletMassFlow" | "cntOutletMassFlow" | "ssqOutletMassFlow" | "flowTemperature" | "maxFlowTemperature" | "minFlowTemperature" | "avgFlowTemperature" | "cntFlowTemperature" | "ssqFlowTemperature" | "inletFlowTemperature" | "maxInletFlowTemperature" | "minInletFlowTemperature" | "avgInletFlowTemperature" | "cntInletFlowTemperature" | "ssqInletFlowTemperature" | "outletFlowTemperature" | "maxOutletFlowTemperature" | "minOutletFlowTemperature" | "avgOutletFlowTemperature" | "cntOutletFlowTemperature" | "ssqOutletFlowTemperature" | "inletMinusOutletFlowTemperatureDifference" | "maxInletMinusOutletFlowTemperatureDifference" | "minInletMinusOutletFlowTemperatureDifference" | "avgInletMinusOutletFlowTemperatureDifference" | "cntInletMinusOutletFlowTemperatureDifference" | "ssqInletMinusOutletFlowTemperatureDifference" | "outletMinusInletFlowTemperatureDifference" | "maxOutletMinusInletFlowTemperatureDifference" | "minOutletMinusInletFlowTemperatureDifference" | "avgOutletMinusInletFlowTemperatureDifference" | "cntOutletMinusInletFlowTemperatureDifference" | "ssqOutletMinusInletFlowTemperatureDifference" | "ambientTemperature" | "maxAmbientTemperature" | "minAmbientTemperature" | "avgAmbientTemperature" | "cntAmbientTemperature" | "ssqAmbientTemperature" | "radiatorTemperature" | "maxRadiatorTemperature" | "minRadiatorTemperature" | "avgRadiatorTemperature" | "cntRadiatorTemperature" | "ssqRadiatorTemperature" | "relativeHumidity" | "kamstrupE8Inlet" | "diffKamstrupE8Inlet" | "cntKamstrupE8Inlet" | "kamstrupE9Outlet" | "diffKamstrupE9Outlet" | "cntKamstrupE9Outlet" | "operatingTime" | "diffOperatingTime" | "cntOperatingTime" | "remainingBatteryTime" | "diffRemainingBatteryTime" | "cntRemainingBatteryTime" | "deviceDate" | "deviceTime" | "deviceDateTime" | "timeSinceLastExactOverhearingArrived" | "timeAtLastExactOverhearingArrived" | "timeSinceLastPossibleCandidateOverhearingArrived" | "timeAtLastPossibleCandidateOverhearingArrived" | "timeSinceLastSampled" | "timeAtLastSampled" | "timeSinceLastInstallationMounted" | "timeAtLastInstallationMounted" | "basetime" | "instantTime" | "periodStartTime" | "periodEndTime" | "instantOrPeriodStartTime" | "instantOrPeriodEndTime" | "device" | "wMBusDeviceAddresses" | "kamdraftDeviceAddresses" | "tchlrDeviceAddresses" | "kamdaDeviceAddresses" | "msisdnDeviceAddresses" | "deviceRegisters" | "consumptionZone" | "mBusFormatStringSignature" | "deviceSoftwareVersion" | "kamstrupMulticalInfocodeType1" | "kamstrupMulticalInfocodeType2" | "kamstrupMulticalInfocodeType3" | "kamstrupMulticalInfocodeType4" | "kamstrupMulticalInfocode" | "kamstrupModuleType" | "diehlInfocodeType1" | "diehlInfocode" | "landisGyrMBusStatusType1" | "landisGyrMBusStatusType2" | "landisGyrMBusStatus" | "landisGyrInfocodeType1" | "landisGyrInfocodeType2" | "landisGyrInfocode" | "infocode";
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import { DateTime } from "luxon";
|
|
2
2
|
export declare type TimeOrRule = Date | DateTime | string;
|
|
3
|
+
export declare namespace TimeOrRule {
|
|
4
|
+
function isTime(input: TimeOrRule): input is Date | DateTime;
|
|
5
|
+
function isRule(input: TimeOrRule): input is string;
|
|
6
|
+
function asJSON(input: TimeOrRule): string;
|
|
7
|
+
}
|
package/dist/esm/time-or-rule.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var TimeOrRule;
|
|
1
|
+
export var TimeOrRule;
|
|
2
2
|
(function (TimeOrRule) {
|
|
3
3
|
function isTime(input) {
|
|
4
4
|
return typeof input !== "string";
|
|
@@ -13,5 +13,4 @@ var TimeOrRule;
|
|
|
13
13
|
}
|
|
14
14
|
TimeOrRule.asJSON = asJSON;
|
|
15
15
|
})(TimeOrRule || (TimeOrRule = {}));
|
|
16
|
-
export {};
|
|
17
16
|
//# sourceMappingURL=time-or-rule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-or-rule.js","sourceRoot":"","sources":["../../src/time-or-rule.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"time-or-rule.js","sourceRoot":"","sources":["../../src/time-or-rule.ts"],"names":[],"mappings":"AAIA,MAAM,KAAW,UAAU,CAY1B;AAZD,WAAiB,UAAU;IACvB,SAAgB,MAAM,CAAC,KAAiB;QACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;IACrC,CAAC;IAFe,iBAAM,SAErB,CAAA;IAED,SAAgB,MAAM,CAAC,KAAiB;QACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;IACrC,CAAC;IAFe,iBAAM,SAErB,CAAA;IAED,SAAgB,MAAM,CAAC,KAAiB;QACpC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IAClD,CAAC;IAFe,iBAAM,SAErB,CAAA;AACL,CAAC,EAZgB,UAAU,KAAV,UAAU,QAY1B"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import type { ConsumptionTypeId } from "./consumption-type-id";
|
|
2
|
-
import type { RegisterId } from "./register-id";
|
|
3
|
-
import type { UnitId } from "./unit-id";
|
|
4
|
-
import { RegisterLibrary } from "./register-library";
|
|
5
|
-
import type { RegisterDefinition } from "./register-definition";
|
|
6
|
-
import { NumberFormatter, invariantDecimalSeparator, localeDecimalSeparator } from "./number-formatter";
|
|
7
|
-
import { RegisterConvention } from "./register-convention";
|
|
8
|
-
import type { AggregateId } from "./aggregate-id";
|
|
9
|
-
import type { MeasureId } from "./measure-id";
|
|
10
|
-
import { Step, DayOfWeek } from "./step";
|
|
11
|
-
import { TimeOrRule } from "./time-or-rule";
|
|
12
|
-
import { PrecisionNumber } from "./precision-number";
|
|
13
|
-
import "./repository"; // We need this to get the Repository namespace exported
|
|
14
|
-
import { Repository } from "./repository";
|
|
15
|
-
import type { Optional } from "./optional";
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
AggregateId,
|
|
19
|
-
ConsumptionTypeId,
|
|
20
|
-
DayOfWeek,
|
|
21
|
-
MeasureId,
|
|
22
|
-
NumberFormatter,
|
|
23
|
-
PrecisionNumber,
|
|
24
|
-
RegisterConvention,
|
|
25
|
-
RegisterDefinition,
|
|
26
|
-
RegisterId,
|
|
27
|
-
RegisterLibrary,
|
|
28
|
-
Repository,
|
|
29
|
-
Step,
|
|
30
|
-
TimeOrRule,
|
|
31
|
-
UnitId,
|
|
32
|
-
invariantDecimalSeparator,
|
|
33
|
-
localeDecimalSeparator,
|
|
34
|
-
Optional,
|
|
35
|
-
};
|
|
1
|
+
import type { ConsumptionTypeId } from "./consumption-type-id";
|
|
2
|
+
import type { RegisterId } from "./register-id";
|
|
3
|
+
import type { UnitId } from "./unit-id";
|
|
4
|
+
import { RegisterLibrary } from "./register-library";
|
|
5
|
+
import type { RegisterDefinition } from "./register-definition";
|
|
6
|
+
import { NumberFormatter, invariantDecimalSeparator, localeDecimalSeparator } from "./number-formatter";
|
|
7
|
+
import { RegisterConvention } from "./register-convention";
|
|
8
|
+
import type { AggregateId } from "./aggregate-id";
|
|
9
|
+
import type { MeasureId } from "./measure-id";
|
|
10
|
+
import { Step, DayOfWeek } from "./step";
|
|
11
|
+
import { TimeOrRule } from "./time-or-rule";
|
|
12
|
+
import { PrecisionNumber } from "./precision-number";
|
|
13
|
+
import "./repository"; // We need this to get the Repository namespace exported
|
|
14
|
+
import { Repository } from "./repository";
|
|
15
|
+
import type { Optional } from "./optional";
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
AggregateId,
|
|
19
|
+
ConsumptionTypeId,
|
|
20
|
+
DayOfWeek,
|
|
21
|
+
MeasureId,
|
|
22
|
+
NumberFormatter,
|
|
23
|
+
PrecisionNumber,
|
|
24
|
+
RegisterConvention,
|
|
25
|
+
RegisterDefinition,
|
|
26
|
+
RegisterId,
|
|
27
|
+
RegisterLibrary,
|
|
28
|
+
Repository,
|
|
29
|
+
Step,
|
|
30
|
+
TimeOrRule,
|
|
31
|
+
UnitId,
|
|
32
|
+
invariantDecimalSeparator,
|
|
33
|
+
localeDecimalSeparator,
|
|
34
|
+
Optional,
|
|
35
|
+
};
|
package/src/register-id.ts
CHANGED
|
@@ -1,146 +1,198 @@
|
|
|
1
1
|
export type RegisterId =
|
|
2
2
|
"none" |
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
"heatEnergy" |
|
|
5
5
|
"diffHeatEnergy" |
|
|
6
|
+
"cntHeatEnergy" |
|
|
6
7
|
|
|
7
8
|
"heatEnergyVolumeInInlet" |
|
|
8
9
|
"diffHeatEnergyVolumeInInlet" |
|
|
10
|
+
"cntHeatEnergyVolumeInInlet" |
|
|
9
11
|
|
|
10
12
|
"heatEnergyVolumeInOutlet" |
|
|
11
13
|
"diffHeatEnergyVolumeInOutlet" |
|
|
14
|
+
"cntHeatEnergyVolumeInOutlet" |
|
|
12
15
|
|
|
13
16
|
"coolingEnergy" |
|
|
14
17
|
"diffCoolingEnergy" |
|
|
18
|
+
"cntCoolingEnergy" |
|
|
15
19
|
|
|
16
20
|
"coolingEnergyVolumeInInlet" |
|
|
17
21
|
"diffCoolingEnergyVolumeInInlet" |
|
|
22
|
+
"cntCoolingEnergyVolumeInInlet" |
|
|
18
23
|
|
|
19
24
|
"coolingEnergyVolumeInOutlet" |
|
|
20
25
|
"diffCoolingEnergyVolumeInOutlet" |
|
|
26
|
+
"cntCoolingEnergyVolumeInOutlet" |
|
|
21
27
|
|
|
22
28
|
"electricalEnergy" |
|
|
23
29
|
"diffElectricalEnergy" |
|
|
30
|
+
"cntElectricalEnergy" |
|
|
24
31
|
|
|
25
32
|
"reactiveEnergy" |
|
|
26
33
|
"diffReactiveEnergy" |
|
|
34
|
+
"cntReactiveEnergy" |
|
|
27
35
|
|
|
28
36
|
"volume" |
|
|
29
37
|
"diffVolume" |
|
|
38
|
+
"cntVolume" |
|
|
30
39
|
|
|
31
40
|
"inletVolume" |
|
|
32
41
|
"diffInletVolume" |
|
|
42
|
+
"cntInletVolume" |
|
|
33
43
|
|
|
34
44
|
"outletVolume" |
|
|
35
45
|
"diffOutletVolume" |
|
|
46
|
+
"cntOutletVolume" |
|
|
36
47
|
|
|
37
48
|
"pulseInputAVolume" |
|
|
38
49
|
"diffPulseInputAVolume" |
|
|
50
|
+
"cntPulseInputAVolume" |
|
|
39
51
|
|
|
40
52
|
"pulseInputBVolume" |
|
|
41
53
|
"diffPulseInputBVolume" |
|
|
54
|
+
"cntPulseInputBVolume" |
|
|
42
55
|
|
|
43
56
|
"mass" |
|
|
44
57
|
"diffMass" |
|
|
58
|
+
"cntMass" |
|
|
45
59
|
|
|
46
60
|
"inletMass" |
|
|
47
61
|
"diffInletMass" |
|
|
62
|
+
"cntInletMass" |
|
|
48
63
|
|
|
49
64
|
"outletMass" |
|
|
50
65
|
"diffOutletMass" |
|
|
66
|
+
"cntOutletMass" |
|
|
51
67
|
|
|
52
68
|
"power" |
|
|
53
69
|
"maxPower" |
|
|
54
70
|
"minPower" |
|
|
55
71
|
"avgPower" |
|
|
72
|
+
"cntPower" |
|
|
73
|
+
"ssqPower" |
|
|
56
74
|
|
|
57
75
|
"inletPower" |
|
|
58
76
|
"maxInletPower" |
|
|
59
77
|
"minInletPower" |
|
|
60
78
|
"avgInletPower" |
|
|
79
|
+
"cntInletPower" |
|
|
80
|
+
"ssqInletPower" |
|
|
61
81
|
|
|
62
82
|
"outletPower" |
|
|
63
83
|
"maxOutletPower" |
|
|
64
84
|
"minOutletPower" |
|
|
65
85
|
"avgOutletPower" |
|
|
86
|
+
"cntOutletPower" |
|
|
87
|
+
"ssqOutletPower" |
|
|
66
88
|
|
|
67
89
|
"volumeFlow" |
|
|
68
90
|
"maxVolumeFlow" |
|
|
69
91
|
"minVolumeFlow" |
|
|
70
92
|
"avgVolumeFlow" |
|
|
93
|
+
"cntVolumeFlow" |
|
|
94
|
+
"ssqVolumeFlow" |
|
|
71
95
|
|
|
72
96
|
"inletVolumeFlow" |
|
|
73
97
|
"maxInletVolumeFlow" |
|
|
74
98
|
"minInletVolumeFlow" |
|
|
75
99
|
"avgInletVolumeFlow" |
|
|
100
|
+
"cntInletVolumeFlow" |
|
|
101
|
+
"ssqInletVolumeFlow" |
|
|
76
102
|
|
|
77
103
|
"outletVolumeFlow" |
|
|
78
104
|
"maxOutletVolumeFlow" |
|
|
79
105
|
"minOutletVolumeFlow" |
|
|
80
106
|
"avgOutletVolumeFlow" |
|
|
107
|
+
"cntOutletVolumeFlow" |
|
|
108
|
+
"ssqOutletVolumeFlow" |
|
|
81
109
|
|
|
82
110
|
"massFlow" |
|
|
83
111
|
"maxMassFlow" |
|
|
84
112
|
"minMassFlow" |
|
|
85
113
|
"avgMassFlow" |
|
|
114
|
+
"cntMassFlow" |
|
|
115
|
+
"ssqMassFlow" |
|
|
86
116
|
|
|
87
117
|
"inletMassFlow" |
|
|
88
118
|
"maxInletMassFlow" |
|
|
89
119
|
"minInletMassFlow" |
|
|
90
120
|
"avgInletMassFlow" |
|
|
121
|
+
"cntInletMassFlow" |
|
|
122
|
+
"ssqInletMassFlow" |
|
|
91
123
|
|
|
92
124
|
"outletMassFlow" |
|
|
93
125
|
"maxOutletMassFlow" |
|
|
94
126
|
"minOutletMassFlow" |
|
|
95
127
|
"avgOutletMassFlow" |
|
|
128
|
+
"cntOutletMassFlow" |
|
|
129
|
+
"ssqOutletMassFlow" |
|
|
96
130
|
|
|
97
131
|
"flowTemperature" |
|
|
98
132
|
"maxFlowTemperature" |
|
|
99
133
|
"minFlowTemperature" |
|
|
100
134
|
"avgFlowTemperature" |
|
|
135
|
+
"cntFlowTemperature" |
|
|
136
|
+
"ssqFlowTemperature" |
|
|
101
137
|
|
|
102
138
|
"inletFlowTemperature" |
|
|
103
139
|
"maxInletFlowTemperature" |
|
|
104
140
|
"minInletFlowTemperature" |
|
|
105
141
|
"avgInletFlowTemperature" |
|
|
142
|
+
"cntInletFlowTemperature" |
|
|
143
|
+
"ssqInletFlowTemperature" |
|
|
106
144
|
|
|
107
145
|
"outletFlowTemperature" |
|
|
108
146
|
"maxOutletFlowTemperature" |
|
|
109
147
|
"minOutletFlowTemperature" |
|
|
110
148
|
"avgOutletFlowTemperature" |
|
|
149
|
+
"cntOutletFlowTemperature" |
|
|
150
|
+
"ssqOutletFlowTemperature" |
|
|
111
151
|
|
|
112
152
|
"inletMinusOutletFlowTemperatureDifference" |
|
|
113
153
|
"maxInletMinusOutletFlowTemperatureDifference" |
|
|
114
154
|
"minInletMinusOutletFlowTemperatureDifference" |
|
|
115
155
|
"avgInletMinusOutletFlowTemperatureDifference" |
|
|
156
|
+
"cntInletMinusOutletFlowTemperatureDifference" |
|
|
157
|
+
"ssqInletMinusOutletFlowTemperatureDifference" |
|
|
116
158
|
|
|
117
159
|
"outletMinusInletFlowTemperatureDifference" |
|
|
118
160
|
"maxOutletMinusInletFlowTemperatureDifference" |
|
|
119
161
|
"minOutletMinusInletFlowTemperatureDifference" |
|
|
120
162
|
"avgOutletMinusInletFlowTemperatureDifference" |
|
|
163
|
+
"cntOutletMinusInletFlowTemperatureDifference" |
|
|
164
|
+
"ssqOutletMinusInletFlowTemperatureDifference" |
|
|
121
165
|
|
|
122
166
|
"ambientTemperature" |
|
|
123
167
|
"maxAmbientTemperature" |
|
|
124
168
|
"minAmbientTemperature" |
|
|
125
169
|
"avgAmbientTemperature" |
|
|
170
|
+
"cntAmbientTemperature" |
|
|
171
|
+
"ssqAmbientTemperature" |
|
|
126
172
|
|
|
127
173
|
"radiatorTemperature" |
|
|
128
174
|
"maxRadiatorTemperature" |
|
|
129
175
|
"minRadiatorTemperature" |
|
|
130
176
|
"avgRadiatorTemperature" |
|
|
177
|
+
"cntRadiatorTemperature" |
|
|
178
|
+
"ssqRadiatorTemperature" |
|
|
131
179
|
|
|
132
180
|
"relativeHumidity" |
|
|
133
181
|
|
|
134
182
|
"kamstrupE8Inlet" |
|
|
135
183
|
"diffKamstrupE8Inlet" |
|
|
184
|
+
"cntKamstrupE8Inlet" |
|
|
136
185
|
"kamstrupE9Outlet" |
|
|
137
186
|
"diffKamstrupE9Outlet" |
|
|
187
|
+
"cntKamstrupE9Outlet" |
|
|
138
188
|
|
|
139
189
|
"operatingTime" |
|
|
140
190
|
"diffOperatingTime" |
|
|
191
|
+
"cntOperatingTime" |
|
|
141
192
|
|
|
142
193
|
"remainingBatteryTime" |
|
|
143
194
|
"diffRemainingBatteryTime" |
|
|
195
|
+
"cntRemainingBatteryTime" |
|
|
144
196
|
|
|
145
197
|
"deviceDate" |
|
|
146
198
|
"deviceTime" |
|
|
@@ -151,10 +203,10 @@ export type RegisterId =
|
|
|
151
203
|
|
|
152
204
|
"timeSinceLastPossibleCandidateOverhearingArrived" |
|
|
153
205
|
"timeAtLastPossibleCandidateOverhearingArrived" |
|
|
154
|
-
|
|
206
|
+
|
|
155
207
|
"timeSinceLastSampled" |
|
|
156
208
|
"timeAtLastSampled" |
|
|
157
|
-
|
|
209
|
+
|
|
158
210
|
"timeSinceLastInstallationMounted" |
|
|
159
211
|
"timeAtLastInstallationMounted" |
|
|
160
212
|
|
|
@@ -183,7 +235,7 @@ export type RegisterId =
|
|
|
183
235
|
"kamstrupMulticalInfocodeType4" |
|
|
184
236
|
"kamstrupMulticalInfocode" |
|
|
185
237
|
"kamstrupModuleType" |
|
|
186
|
-
|
|
238
|
+
|
|
187
239
|
"diehlInfocodeType1" |
|
|
188
240
|
"diehlInfocode" |
|
|
189
241
|
|
|
@@ -193,5 +245,5 @@ export type RegisterId =
|
|
|
193
245
|
"landisGyrInfocodeType1" |
|
|
194
246
|
"landisGyrInfocodeType2" |
|
|
195
247
|
"landisGyrInfocode" |
|
|
196
|
-
|
|
197
|
-
"infocode";
|
|
248
|
+
|
|
249
|
+
"infocode";
|
package/src/repository.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
// This is clearly not correct but it provides some amazing type safety
|
|
2
|
-
export type Repository = "some/repo";
|
|
3
|
-
|
|
4
|
-
export function Repository(repo: string): Repository;
|
|
5
|
-
export function Repository(team: string, name: string): Repository;
|
|
6
|
-
export function Repository(repoOrTeam: string, name?: string): Repository {
|
|
7
|
-
if (name) {
|
|
8
|
-
return <Repository>`${repoOrTeam}/${name}`;
|
|
9
|
-
} else if (repoOrTeam.indexOf("/") > 0) {
|
|
10
|
-
return <Repository>repoOrTeam;
|
|
11
|
-
} else {
|
|
12
|
-
throw new TypeError("Invalid repository format");
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export namespace Repository {
|
|
17
|
-
export function split(repo: Repository) {
|
|
18
|
-
const parts = repo.split("/");
|
|
19
|
-
return {
|
|
20
|
-
team: parts[0],
|
|
21
|
-
name: parts[1],
|
|
22
|
-
};
|
|
23
|
-
}
|
|
1
|
+
// This is clearly not correct but it provides some amazing type safety
|
|
2
|
+
export type Repository = "some/repo";
|
|
3
|
+
|
|
4
|
+
export function Repository(repo: string): Repository;
|
|
5
|
+
export function Repository(team: string, name: string): Repository;
|
|
6
|
+
export function Repository(repoOrTeam: string, name?: string): Repository {
|
|
7
|
+
if (name) {
|
|
8
|
+
return <Repository>`${repoOrTeam}/${name}`;
|
|
9
|
+
} else if (repoOrTeam.indexOf("/") > 0) {
|
|
10
|
+
return <Repository>repoOrTeam;
|
|
11
|
+
} else {
|
|
12
|
+
throw new TypeError("Invalid repository format");
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export namespace Repository {
|
|
17
|
+
export function split(repo: Repository) {
|
|
18
|
+
const parts = repo.split("/");
|
|
19
|
+
return {
|
|
20
|
+
team: parts[0],
|
|
21
|
+
name: parts[1],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
24
|
}
|
package/src/step.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { DateTime, Duration } from "luxon";
|
|
2
|
-
|
|
3
|
-
export type Step = "hour" | "day" | "week" | "month" | "year";
|
|
4
|
-
|
|
5
|
-
export enum DayOfWeek {
|
|
6
|
-
Monday = 1,
|
|
7
|
-
Tuesday = 2,
|
|
8
|
-
Wednesday = 3,
|
|
9
|
-
Thursday = 4,
|
|
10
|
-
Friday = 5,
|
|
11
|
-
Saturday = 6,
|
|
12
|
-
Sunday = 7,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export namespace Step {
|
|
16
|
-
export function startOf(dateTime: DateTime, step: Step, firstDayOfWeek?: DayOfWeek): DateTime {
|
|
17
|
-
if (step === "week") {
|
|
18
|
-
const value = dateTime.startOf("day").set({ weekday: firstDayOfWeek ?? DayOfWeek.Monday });
|
|
19
|
-
return value > dateTime
|
|
20
|
-
? value.minus({ days: 7 })
|
|
21
|
-
: value;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
return dateTime.startOf(step);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function asDuration(step: Step, amount = 1): Duration {
|
|
29
|
-
switch (step) {
|
|
30
|
-
case "hour": return Duration.fromObject({ hours: amount });
|
|
31
|
-
case "day": return Duration.fromObject({ days: amount });
|
|
32
|
-
case "week": return Duration.fromObject({ days: 7 * amount });
|
|
33
|
-
case "month": return Duration.fromObject({ months: amount });
|
|
34
|
-
case "year": return Duration.fromObject({ years: amount });
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
import { DateTime, Duration } from "luxon";
|
|
2
|
+
|
|
3
|
+
export type Step = "hour" | "day" | "week" | "month" | "year";
|
|
4
|
+
|
|
5
|
+
export enum DayOfWeek {
|
|
6
|
+
Monday = 1,
|
|
7
|
+
Tuesday = 2,
|
|
8
|
+
Wednesday = 3,
|
|
9
|
+
Thursday = 4,
|
|
10
|
+
Friday = 5,
|
|
11
|
+
Saturday = 6,
|
|
12
|
+
Sunday = 7,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export namespace Step {
|
|
16
|
+
export function startOf(dateTime: DateTime, step: Step, firstDayOfWeek?: DayOfWeek): DateTime {
|
|
17
|
+
if (step === "week") {
|
|
18
|
+
const value = dateTime.startOf("day").set({ weekday: firstDayOfWeek ?? DayOfWeek.Monday });
|
|
19
|
+
return value > dateTime
|
|
20
|
+
? value.minus({ days: 7 })
|
|
21
|
+
: value;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return dateTime.startOf(step);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function asDuration(step: Step, amount = 1): Duration {
|
|
29
|
+
switch (step) {
|
|
30
|
+
case "hour": return Duration.fromObject({ hours: amount });
|
|
31
|
+
case "day": return Duration.fromObject({ days: amount });
|
|
32
|
+
case "week": return Duration.fromObject({ days: 7 * amount });
|
|
33
|
+
case "month": return Duration.fromObject({ months: amount });
|
|
34
|
+
case "year": return Duration.fromObject({ years: amount });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
package/src/time-or-rule.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { DateTime } from "luxon";
|
|
2
|
-
|
|
3
|
-
export type TimeOrRule = Date | DateTime | string;
|
|
4
|
-
|
|
5
|
-
namespace TimeOrRule {
|
|
6
|
-
export function isTime(input: TimeOrRule): input is Date | DateTime {
|
|
7
|
-
return typeof input !== "string";
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function isRule(input: TimeOrRule): input is string {
|
|
11
|
-
return typeof input === "string";
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function asJSON(input: TimeOrRule) {
|
|
15
|
-
return isRule(input) ? input : input.toJSON();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
import { DateTime } from "luxon";
|
|
2
|
+
|
|
3
|
+
export type TimeOrRule = Date | DateTime | string;
|
|
4
|
+
|
|
5
|
+
export namespace TimeOrRule {
|
|
6
|
+
export function isTime(input: TimeOrRule): input is Date | DateTime {
|
|
7
|
+
return typeof input !== "string";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function isRule(input: TimeOrRule): input is string {
|
|
11
|
+
return typeof input === "string";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function asJSON(input: TimeOrRule) {
|
|
15
|
+
return isRule(input) ? input : input.toJSON();
|
|
16
|
+
}
|
|
17
|
+
}
|