@hahnpro/hpc-api 2.3.0 → 2.3.1
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.
|
@@ -30,7 +30,7 @@ class TimeseriesMockService extends data_mock_service_1.DataMockService {
|
|
|
30
30
|
}
|
|
31
31
|
async addValue(id, value) {
|
|
32
32
|
const ts = await this.getOne(id, {});
|
|
33
|
-
ts.data.push({ timestamp: new Date().
|
|
33
|
+
ts.data.push({ timestamp: new Date().valueOf(), value });
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
getManyByAsset(assetId, names) {
|
|
@@ -49,13 +49,13 @@ class TimeseriesMockService extends data_mock_service_1.DataMockService {
|
|
|
49
49
|
async getMostRecentValue(id, before) {
|
|
50
50
|
const ts = await this.getOne(id, {});
|
|
51
51
|
for (const datum of ts.data) {
|
|
52
|
-
if (datum.timestamp < before.
|
|
52
|
+
if (datum.timestamp < before.valueOf()) {
|
|
53
53
|
return datum;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
async getValues(id, from, limit, group) {
|
|
58
|
-
let timeSeriesValues = await this.getValuesOfPeriod(id, from, new Date().
|
|
58
|
+
let timeSeriesValues = await this.getValuesOfPeriod(id, from, new Date().valueOf(), group);
|
|
59
59
|
if (limit) {
|
|
60
60
|
timeSeriesValues = timeSeriesValues.slice(0, limit);
|
|
61
61
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hahnpro/hpc-api",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Module for easy access to the HahnPRO API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"axios": "
|
|
28
|
-
"eventsource": "^2.0.
|
|
27
|
+
"axios": "~0.26.1",
|
|
28
|
+
"eventsource": "^2.0.1",
|
|
29
29
|
"form-data": "^4.0.0",
|
|
30
30
|
"jwt-decode": "^3.1.2",
|
|
31
31
|
"p-queue": "^6.6.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
34
|
+
"@types/eventsource": "^1.1.8",
|
|
35
|
+
"axios-mock-adapter": "^1.20.0"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=v14.13"
|