@hello.nrfcloud.com/proto-map 10.0.1 → 10.0.3
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/lwm2m/definitions.js +2 -2
- package/dist/lwm2m/object/validate14301.js +4 -4
- package/dist/lwm2m/validation.js +1 -1
- package/lwm2m/14301.xml +2 -2
- package/lwm2m/definitions.ts +2 -2
- package/lwm2m/object/14301.d.ts +8 -8
- package/lwm2m/object/validate14301.ts +2 -2
- package/lwm2m/validation.ts +3 -1
- package/package.json +1 -1
|
@@ -682,7 +682,7 @@ var _obj;
|
|
|
682
682
|
0: {
|
|
683
683
|
ResourceID: 0,
|
|
684
684
|
Name: "Update interval",
|
|
685
|
-
Mandatory:
|
|
685
|
+
Mandatory: true,
|
|
686
686
|
Type: ResourceType.Integer,
|
|
687
687
|
Description: "The update interval in seconds. Examples: 10, 3600.",
|
|
688
688
|
RangeEnumeration: {
|
|
@@ -697,7 +697,7 @@ var _obj;
|
|
|
697
697
|
*/ 1: {
|
|
698
698
|
ResourceID: 1,
|
|
699
699
|
Name: "GNSS enabled",
|
|
700
|
-
Mandatory:
|
|
700
|
+
Mandatory: true,
|
|
701
701
|
Type: ResourceType.Boolean,
|
|
702
702
|
Description: "Whether to enabled the device's GNSS receiver."
|
|
703
703
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NumberResource, BooleanResource, TimeResource, validateInstance } from "../validation.js";
|
|
2
2
|
import { LwM2MObjectID } from "../LwM2MObjectID.js";
|
|
3
3
|
/**
|
|
4
4
|
* Validate Application Configuration (14301)
|
|
@@ -6,8 +6,8 @@ import { LwM2MObjectID } from "../LwM2MObjectID.js";
|
|
|
6
6
|
* Ensures the given object is an LwM2M object according to the schema 14301.xml.
|
|
7
7
|
*/ export var validate14301 = function(o) {
|
|
8
8
|
return validateInstance(LwM2MObjectID.ApplicationConfiguration_14301, "1.0", {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
0: NumberResource,
|
|
10
|
+
1: BooleanResource,
|
|
11
|
+
99: TimeResource
|
|
12
12
|
})(o);
|
|
13
13
|
};
|
package/dist/lwm2m/validation.js
CHANGED
|
@@ -125,7 +125,7 @@ export var validateInstance = function(ObjectID, ObjectVersion, Resources) {
|
|
|
125
125
|
for(var _iterator = Object.entries(Resources)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
126
126
|
var _step_value = _sliced_to_array(_step.value, 2), ResourceID = _step_value[0], validator = _step_value[1];
|
|
127
127
|
if (validator(i.Resources[parseInt(ResourceID, 10)]) === false) {
|
|
128
|
-
return error("Resource ".concat(ResourceID, " is invalid."));
|
|
128
|
+
return error("Resource ".concat(ResourceID, " for Object ").concat(ObjectID, " is invalid."));
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
} catch (err) {
|
package/lwm2m/14301.xml
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<Name>Update interval</Name>
|
|
13
13
|
<Operations>RW</Operations>
|
|
14
14
|
<MultipleInstances>Single</MultipleInstances>
|
|
15
|
-
<Mandatory>
|
|
15
|
+
<Mandatory>Mandatory</Mandatory>
|
|
16
16
|
<Type>Integer</Type>
|
|
17
17
|
<RangeEnumeration>0..31622400</RangeEnumeration>
|
|
18
18
|
<Units/>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<Name>GNSS enabled</Name>
|
|
23
23
|
<Operations>RW</Operations>
|
|
24
24
|
<MultipleInstances>Single</MultipleInstances>
|
|
25
|
-
<Mandatory>
|
|
25
|
+
<Mandatory>Mandatory</Mandatory>
|
|
26
26
|
<Type>Boolean</Type>
|
|
27
27
|
<RangeEnumeration/>
|
|
28
28
|
<Units/>
|
package/lwm2m/definitions.ts
CHANGED
|
@@ -325,12 +325,12 @@ export const definitions: Record<LwM2MObjectID, LWM2MObjectInfo> = { /**
|
|
|
325
325
|
* Minimum: 0
|
|
326
326
|
* Maximum: 31622400
|
|
327
327
|
*/
|
|
328
|
-
0: { ResourceID: 0, Name: "Update interval", Mandatory:
|
|
328
|
+
0: { ResourceID: 0, Name: "Update interval", Mandatory: true, Type: ResourceType.Integer, Description: "The update interval in seconds. Examples: 10, 3600.", RangeEnumeration: { min: 0, max: 31622400 } }, /**
|
|
329
329
|
* GNSS enabled (Boolean)
|
|
330
330
|
*
|
|
331
331
|
* Whether to enabled the device's GNSS receiver.
|
|
332
332
|
*/
|
|
333
|
-
1: { ResourceID: 1, Name: "GNSS enabled", Mandatory:
|
|
333
|
+
1: { ResourceID: 1, Name: "GNSS enabled", Mandatory: true, Type: ResourceType.Boolean, Description: "Whether to enabled the device's GNSS receiver." }, /**
|
|
334
334
|
* Timestamp (Time)
|
|
335
335
|
*
|
|
336
336
|
* The timestamp of when the configuration was updated.
|
package/lwm2m/object/14301.d.ts
CHANGED
|
@@ -9,12 +9,6 @@ export type ApplicationConfiguration_14301 = LwM2MObject<{
|
|
|
9
9
|
ObjectID: LwM2MObjectID.ApplicationConfiguration_14301;
|
|
10
10
|
ObjectVersion: "1.0";
|
|
11
11
|
Resources: {
|
|
12
|
-
/**
|
|
13
|
-
* Timestamp
|
|
14
|
-
*
|
|
15
|
-
* The timestamp of when the configuration was updated.
|
|
16
|
-
*/
|
|
17
|
-
99: number;
|
|
18
12
|
/**
|
|
19
13
|
* Update interval
|
|
20
14
|
*
|
|
@@ -23,12 +17,18 @@ export type ApplicationConfiguration_14301 = LwM2MObject<{
|
|
|
23
17
|
* Minimum: 0
|
|
24
18
|
* Maximum: 31622400
|
|
25
19
|
*/
|
|
26
|
-
0
|
|
20
|
+
0: number;
|
|
27
21
|
/**
|
|
28
22
|
* GNSS enabled
|
|
29
23
|
*
|
|
30
24
|
* Whether to enabled the device's GNSS receiver.
|
|
31
25
|
*/
|
|
32
|
-
1
|
|
26
|
+
1: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Timestamp
|
|
29
|
+
*
|
|
30
|
+
* The timestamp of when the configuration was updated.
|
|
31
|
+
*/
|
|
32
|
+
99: number;
|
|
33
33
|
};
|
|
34
34
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LwM2MObjectInstance } from "../LwM2MObjectInstance.js";
|
|
2
|
-
import {
|
|
2
|
+
import { NumberResource, BooleanResource, TimeResource, validateInstance } from "../validation.js";
|
|
3
3
|
import type { ApplicationConfiguration_14301 } from "../objects.js";
|
|
4
4
|
import { LwM2MObjectID } from "../LwM2MObjectID.js";
|
|
5
5
|
/**
|
|
@@ -11,4 +11,4 @@ export const validate14301 = (o: unknown): {
|
|
|
11
11
|
error: Error;
|
|
12
12
|
} | {
|
|
13
13
|
object: LwM2MObjectInstance<ApplicationConfiguration_14301>;
|
|
14
|
-
} => validateInstance<ApplicationConfiguration_14301>(LwM2MObjectID.ApplicationConfiguration_14301, "1.0", {
|
|
14
|
+
} => validateInstance<ApplicationConfiguration_14301>(LwM2MObjectID.ApplicationConfiguration_14301, "1.0", { 0: NumberResource, 1: BooleanResource, 99: TimeResource })(o);
|
package/lwm2m/validation.ts
CHANGED
|
@@ -82,7 +82,9 @@ export const validateInstance =
|
|
|
82
82
|
|
|
83
83
|
for (const [ResourceID, validator] of Object.entries(Resources)) {
|
|
84
84
|
if (validator(i.Resources[parseInt(ResourceID, 10)]) === false) {
|
|
85
|
-
return error(
|
|
85
|
+
return error(
|
|
86
|
+
`Resource ${ResourceID} for Object ${ObjectID} is invalid.`,
|
|
87
|
+
)
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
return { object: o as LwM2MObjectInstance<O> }
|
package/package.json
CHANGED