@openxiot/xiot-core-spec-ts 0.0.18 → 0.0.19
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.
|
@@ -16,10 +16,9 @@ class DeviceDefinitionCodec {
|
|
|
16
16
|
}
|
|
17
17
|
static decode(o) {
|
|
18
18
|
const lifecycle = (0, Lifecycle_1.LifeCycleFromString)(o[Spec_1.Spec.LIFECYCLE]);
|
|
19
|
-
const category = o.category;
|
|
20
19
|
const type = new DeviceType_1.DeviceType(o[Spec_1.Spec.TYPE]);
|
|
21
20
|
const description = DescriptionCodec_1.DescriptionCodec.decode(o[Spec_1.Spec.DESCRIPTION]);
|
|
22
|
-
const def = new DeviceDefinition_1.DeviceDefinition(
|
|
21
|
+
const def = new DeviceDefinition_1.DeviceDefinition(type, description);
|
|
23
22
|
def.lifecycle = lifecycle;
|
|
24
23
|
return def;
|
|
25
24
|
}
|
|
@@ -28,9 +27,6 @@ class DeviceDefinitionCodec {
|
|
|
28
27
|
type: def.type.toString(),
|
|
29
28
|
description: DescriptionCodec_1.DescriptionCodec.encode(def.description)
|
|
30
29
|
};
|
|
31
|
-
if (def.category != null) {
|
|
32
|
-
o.category = def.category;
|
|
33
|
-
}
|
|
34
30
|
if (def.lifecycle !== undefined) {
|
|
35
31
|
o[Spec_1.Spec.LIFECYCLE] = def.lifecycle.toString();
|
|
36
32
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { DeviceType } from './urn/DeviceType';
|
|
2
2
|
import { WithLifecycle } from '../lifecycle/WithLifecycle';
|
|
3
3
|
export declare class DeviceDefinition extends WithLifecycle {
|
|
4
|
-
category: string;
|
|
5
4
|
type: DeviceType;
|
|
6
5
|
description: Map<string, string>;
|
|
7
|
-
constructor(
|
|
6
|
+
constructor(type: DeviceType, description: Map<string, string>);
|
|
8
7
|
}
|
|
@@ -3,10 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DeviceDefinition = void 0;
|
|
4
4
|
const WithLifecycle_1 = require("../lifecycle/WithLifecycle");
|
|
5
5
|
class DeviceDefinition extends WithLifecycle_1.WithLifecycle {
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(type, description) {
|
|
7
7
|
super();
|
|
8
8
|
this.description = new Map();
|
|
9
|
-
this.category = category;
|
|
10
9
|
this.type = type;
|
|
11
10
|
if (description != null) {
|
|
12
11
|
this.description = description;
|