attlaz-client 1.14.3 → 1.15.0
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.
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { HealthTestType } from './HealthTestType.js';
|
|
2
2
|
import { HealthAlertStatus } from './HealthAlertStatus.js';
|
|
3
|
-
import {
|
|
3
|
+
import { DataValueCollection } from '../DataValueCollection.js';
|
|
4
4
|
export declare class HealthAlert {
|
|
5
5
|
id: number;
|
|
6
|
+
scopeId: string;
|
|
6
7
|
healthTestType: HealthTestType;
|
|
7
8
|
status: HealthAlertStatus;
|
|
8
9
|
date: Date;
|
|
9
10
|
updated: Date;
|
|
10
|
-
data:
|
|
11
|
+
data: DataValueCollection;
|
|
11
12
|
constructor(healthTestType: HealthTestType, status: HealthAlertStatus);
|
|
12
13
|
static parse(raw: any): HealthAlert;
|
|
13
|
-
getDataValue(key: string): DataValueValue | null;
|
|
14
14
|
}
|
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
import { HealthTestType } from './HealthTestType.js';
|
|
2
2
|
import { HealthAlertStatus } from './HealthAlertStatus.js';
|
|
3
3
|
import { Utils } from '../../Utils.js';
|
|
4
|
+
import { DataValueCollection } from '../DataValueCollection.js';
|
|
4
5
|
export class HealthAlert {
|
|
5
6
|
id;
|
|
7
|
+
scopeId;
|
|
6
8
|
healthTestType;
|
|
7
9
|
status;
|
|
8
10
|
date;
|
|
9
11
|
updated;
|
|
10
|
-
data
|
|
12
|
+
data;
|
|
11
13
|
constructor(healthTestType, status) {
|
|
12
14
|
this.healthTestType = healthTestType;
|
|
13
15
|
this.status = status;
|
|
14
16
|
this.date = new Date();
|
|
15
|
-
this.data =
|
|
17
|
+
this.data = new DataValueCollection();
|
|
16
18
|
}
|
|
17
19
|
static parse(raw) {
|
|
18
20
|
const healthAlert = new HealthAlert(HealthTestType.fromString(raw.health_test_type), HealthAlertStatus.fromString(raw.status));
|
|
19
21
|
healthAlert.id = raw.id;
|
|
22
|
+
healthAlert.scopeId = raw.scope;
|
|
20
23
|
healthAlert.date = Utils.parseRawDate(raw.date);
|
|
21
24
|
healthAlert.updated = Utils.parseRawDate(raw.updated);
|
|
22
|
-
healthAlert.data = raw.data;
|
|
25
|
+
healthAlert.data = DataValueCollection.fromObject(raw.data);
|
|
23
26
|
return healthAlert;
|
|
24
27
|
}
|
|
25
|
-
getDataValue(key) {
|
|
26
|
-
for (const tag of this.data) {
|
|
27
|
-
if (tag.key === key) {
|
|
28
|
-
return tag.value;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
28
|
}
|
|
@@ -2,5 +2,5 @@ import { Endpoint } from './Endpoint.js';
|
|
|
2
2
|
import { HealthAlert } from '../Model/HealthAlert/HealthAlert.js';
|
|
3
3
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
4
4
|
export declare class HealthAlertEndpoint extends Endpoint {
|
|
5
|
-
|
|
5
|
+
getLatestByScope(scopeType: string, scopeId: string): Promise<CollectionResult<HealthAlert>>;
|
|
6
6
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Endpoint } from './Endpoint.js';
|
|
2
2
|
import { HealthAlert } from '../Model/HealthAlert/HealthAlert.js';
|
|
3
3
|
export class HealthAlertEndpoint extends Endpoint {
|
|
4
|
-
async
|
|
4
|
+
async getLatestByScope(scopeType, scopeId) {
|
|
5
5
|
try {
|
|
6
|
-
const url = '/
|
|
6
|
+
const url = '/health/' + scopeType + '/' + scopeId + '';
|
|
7
7
|
const result = await this.requestCollection(url, HealthAlert.parse);
|
|
8
8
|
return result;
|
|
9
9
|
}
|