@juhuu/sdk-ts 1.2.221 → 1.2.222
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/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +11 -9
- package/dist/index.mjs +11 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
@@ -3539,6 +3539,9 @@ declare namespace JUHUU {
|
|
3539
3539
|
deviceId?: string;
|
3540
3540
|
name?: string;
|
3541
3541
|
currentValue?: string | boolean | number;
|
3542
|
+
description?: string | null;
|
3543
|
+
enumArray?: string[];
|
3544
|
+
reference?: string | null;
|
3542
3545
|
};
|
3543
3546
|
type Options = JUHUU.RequestOptions;
|
3544
3547
|
type Response = {
|
package/dist/index.d.ts
CHANGED
@@ -3539,6 +3539,9 @@ declare namespace JUHUU {
|
|
3539
3539
|
deviceId?: string;
|
3540
3540
|
name?: string;
|
3541
3541
|
currentValue?: string | boolean | number;
|
3542
|
+
description?: string | null;
|
3543
|
+
enumArray?: string[];
|
3544
|
+
reference?: string | null;
|
3542
3545
|
};
|
3543
3546
|
type Options = JUHUU.RequestOptions;
|
3544
3547
|
type Response = {
|
package/dist/index.js
CHANGED
@@ -1677,20 +1677,21 @@ var TariffsService = class extends Service {
|
|
1677
1677
|
if (this.isFree(tariff) === true) {
|
1678
1678
|
return 0;
|
1679
1679
|
}
|
1680
|
-
if (tariff.interval === 0) {
|
1681
|
-
return tariff.amount[0];
|
1682
|
-
}
|
1683
1680
|
if (rentTimeSeconds > tariff.duration) {
|
1684
1681
|
console.warn("rentTimeS is greater than duration");
|
1685
1682
|
rentTimeSeconds = tariff.duration;
|
1686
1683
|
}
|
1687
1684
|
let sum = 0;
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1685
|
+
if (tariff.interval === 0) {
|
1686
|
+
sum = tariff.amount[0];
|
1687
|
+
} else {
|
1688
|
+
const startedIntervals = Math.ceil(rentTimeSeconds / tariff.interval);
|
1689
|
+
for (let i = 0; i < startedIntervals; i += 1) {
|
1690
|
+
if (i < tariff.amount.length) {
|
1691
|
+
sum += tariff.amount[i];
|
1692
|
+
} else {
|
1693
|
+
sum += tariff.continue;
|
1694
|
+
}
|
1694
1695
|
}
|
1695
1696
|
}
|
1696
1697
|
let serviceFee = Math.round(sum * tariff.serviceFeePercentage / 100);
|
@@ -2958,6 +2959,7 @@ var ParametersService = class extends Service {
|
|
2958
2959
|
body: {
|
2959
2960
|
name: ParameterUpdateParams.name,
|
2960
2961
|
currentValue: ParameterUpdateParams.currentValue,
|
2962
|
+
enumArray: ParameterUpdateParams.enumArray,
|
2961
2963
|
deviceId: ParameterUpdateParams.deviceId
|
2962
2964
|
},
|
2963
2965
|
authenticationNotOptional: true
|
package/dist/index.mjs
CHANGED
@@ -1633,20 +1633,21 @@ var TariffsService = class extends Service {
|
|
1633
1633
|
if (this.isFree(tariff) === true) {
|
1634
1634
|
return 0;
|
1635
1635
|
}
|
1636
|
-
if (tariff.interval === 0) {
|
1637
|
-
return tariff.amount[0];
|
1638
|
-
}
|
1639
1636
|
if (rentTimeSeconds > tariff.duration) {
|
1640
1637
|
console.warn("rentTimeS is greater than duration");
|
1641
1638
|
rentTimeSeconds = tariff.duration;
|
1642
1639
|
}
|
1643
1640
|
let sum = 0;
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1641
|
+
if (tariff.interval === 0) {
|
1642
|
+
sum = tariff.amount[0];
|
1643
|
+
} else {
|
1644
|
+
const startedIntervals = Math.ceil(rentTimeSeconds / tariff.interval);
|
1645
|
+
for (let i = 0; i < startedIntervals; i += 1) {
|
1646
|
+
if (i < tariff.amount.length) {
|
1647
|
+
sum += tariff.amount[i];
|
1648
|
+
} else {
|
1649
|
+
sum += tariff.continue;
|
1650
|
+
}
|
1650
1651
|
}
|
1651
1652
|
}
|
1652
1653
|
let serviceFee = Math.round(sum * tariff.serviceFeePercentage / 100);
|
@@ -2914,6 +2915,7 @@ var ParametersService = class extends Service {
|
|
2914
2915
|
body: {
|
2915
2916
|
name: ParameterUpdateParams.name,
|
2916
2917
|
currentValue: ParameterUpdateParams.currentValue,
|
2918
|
+
enumArray: ParameterUpdateParams.enumArray,
|
2917
2919
|
deviceId: ParameterUpdateParams.deviceId
|
2918
2920
|
},
|
2919
2921
|
authenticationNotOptional: true
|