@hello.nrfcloud.com/proto-map 16.1.40 → 16.2.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.
Files changed (84) hide show
  1. package/api/DeviceJWT.ts +1 -1
  2. package/api/Devices.ts +1 -1
  3. package/api/Email.spec.ts +3 -3
  4. package/api/IsoDateType.spec.ts +2 -2
  5. package/api/UserDevices.ts +1 -1
  6. package/api/index.ts +5 -5
  7. package/dist/api/DeviceJWT.js +1 -1
  8. package/dist/api/Devices.js +1 -1
  9. package/dist/api/Email.spec.js +3 -3
  10. package/dist/api/IsoDateType.spec.js +2 -2
  11. package/dist/api/UserDevices.js +1 -1
  12. package/dist/api/index.js +5 -5
  13. package/dist/generator/generateLwM2MDefinitions.js +1 -1
  14. package/dist/generator/generateLwM2MDefinitions.spec.js +1 -1
  15. package/dist/generator/generateModels.js +1 -1
  16. package/dist/generator/generateType.js +2 -2
  17. package/dist/generator/generateValidator.js +1 -1
  18. package/dist/generator/generateValidators.js +1 -1
  19. package/dist/generator/lwm2m.js +4 -4
  20. package/dist/generator/tokenizeName.spec.js +2 -2
  21. package/dist/generator/types.js +4 -5
  22. package/dist/lwm2m/InvalidTimeError.js +119 -0
  23. package/dist/lwm2m/aws/NoHistoryMeasuresError.js +119 -0
  24. package/dist/lwm2m/aws/instanceMeasuresToRecord.js +48 -0
  25. package/dist/lwm2m/aws/instanceMeasuresToRecord.spec.js +39 -0
  26. package/dist/lwm2m/aws/instanceToMeasure.spec.js +50 -0
  27. package/dist/lwm2m/aws/instanceToMeasures.js +112 -0
  28. package/dist/lwm2m/aws/objectsToShadow.spec.js +3 -3
  29. package/dist/lwm2m/aws/shadowToObjects.spec.js +3 -3
  30. package/dist/lwm2m/check-lwm2m-rules.js +4 -4
  31. package/dist/lwm2m/correctOffset.js +12 -0
  32. package/dist/lwm2m/correctOffset.spec.js +11 -0
  33. package/dist/lwm2m/fromXML2JSON.js +1 -1
  34. package/dist/lwm2m/index.js +11 -7
  35. package/dist/lwm2m/instanceTs.spec.js +1 -1
  36. package/dist/lwm2m/isNumber.js +3 -0
  37. package/dist/lwm2m/isNumeric.js +15 -0
  38. package/dist/lwm2m/isNumeric.spec.js +38 -0
  39. package/dist/lwm2m/isUnixTimeInSeconds.js +7 -0
  40. package/dist/lwm2m/isUnixTimeInSeconds.spec.js +14 -0
  41. package/dist/lwm2m/parseRangeEnumeration.spec.js +2 -2
  42. package/dist/lwm2m/unwrapNestedArray.spec.js +1 -1
  43. package/dist/lwm2m/validate.spec.js +1 -1
  44. package/dist/models/check-model-rules.js +1 -1
  45. package/dist/senml/SenMLSchema.spec.js +2 -2
  46. package/dist/senml/hasValue.spec.js +1 -1
  47. package/dist/senml/index.js +2 -2
  48. package/dist/senml/lwm2mToSenML.js +2 -2
  49. package/dist/senml/lwm2mToSenML.spec.js +2 -2
  50. package/dist/senml/validateSenML.spec.js +1 -1
  51. package/lwm2m/InvalidTimeError.ts +6 -0
  52. package/lwm2m/LwM2MObject.ts +1 -1
  53. package/lwm2m/aws/NoHistoryMeasuresError.ts +6 -0
  54. package/lwm2m/aws/instanceMeasuresToRecord.spec.ts +37 -0
  55. package/lwm2m/aws/instanceMeasuresToRecord.ts +62 -0
  56. package/lwm2m/aws/instanceToMeasure.spec.ts +53 -0
  57. package/lwm2m/aws/instanceToMeasures.ts +72 -0
  58. package/lwm2m/aws/objectsToShadow.spec.ts +3 -3
  59. package/lwm2m/aws/shadowToObjects.spec.ts +3 -3
  60. package/lwm2m/aws/shadowToObjects.ts +1 -1
  61. package/lwm2m/check-lwm2m-rules.ts +4 -4
  62. package/lwm2m/correctOffset.spec.ts +24 -0
  63. package/lwm2m/correctOffset.ts +12 -0
  64. package/lwm2m/fromXML2JSON.ts +1 -1
  65. package/lwm2m/index.ts +11 -7
  66. package/lwm2m/instanceTs.spec.ts +1 -1
  67. package/lwm2m/isNumber.ts +2 -0
  68. package/lwm2m/isNumeric.spec.ts +30 -0
  69. package/lwm2m/isNumeric.ts +17 -0
  70. package/lwm2m/isUnixTimeInSeconds.spec.ts +16 -0
  71. package/lwm2m/isUnixTimeInSeconds.ts +8 -0
  72. package/lwm2m/parseRangeEnumeration.spec.ts +2 -2
  73. package/lwm2m/unwrapNestedArray.spec.ts +1 -1
  74. package/lwm2m/validate.spec.ts +1 -1
  75. package/lwm2m/validate.ts +1 -1
  76. package/lwm2m/validation.ts +1 -1
  77. package/models/check-model-rules.ts +1 -1
  78. package/package.json +5 -4
  79. package/senml/SenMLSchema.spec.ts +2 -2
  80. package/senml/hasValue.spec.ts +1 -1
  81. package/senml/index.ts +2 -2
  82. package/senml/lwm2mToSenML.spec.ts +5 -5
  83. package/senml/lwm2mToSenML.ts +3 -3
  84. package/senml/validateSenML.spec.ts +2 -2
@@ -0,0 +1,72 @@
1
+ import {
2
+ MeasureValueType,
3
+ type MeasureValue,
4
+ } from '@aws-sdk/client-timestream-write'
5
+ import { correctOffset } from 'lwm2m/correctOffset.js'
6
+ import { definitions } from 'lwm2m/definitions.js'
7
+ import { InvalidTimeError } from 'lwm2m/InvalidTimeError.js'
8
+ import { isNumber } from 'lwm2m/isNumber.js'
9
+ import { isNumeric } from 'lwm2m/isNumeric.js'
10
+ import { isUnixTimeInSeconds } from 'lwm2m/isUnixTimeInSeconds.js'
11
+ import type { LwM2MObjectInstance } from 'lwm2m/LwM2MObjectInstance.js'
12
+ import { timestampResources } from 'lwm2m/timestampResources.js'
13
+
14
+ export const instanceToMeasures = ({
15
+ Resources,
16
+ ObjectID,
17
+ ObjectInstanceID,
18
+ ObjectVersion,
19
+ }: LwM2MObjectInstance): { measures: MeasureValue[] } | { error: Error } => {
20
+ const measures: MeasureValue[] = []
21
+
22
+ const tsResource = timestampResources.get(ObjectID) as number
23
+ const ts = Resources[tsResource]
24
+
25
+ if (ts === undefined) {
26
+ return {
27
+ error: new InvalidTimeError(
28
+ `No timestamp resource defined for ${ObjectID}!`,
29
+ ),
30
+ }
31
+ }
32
+
33
+ if (!isNumber(ts)) {
34
+ return {
35
+ error: new InvalidTimeError(
36
+ `Not a timestamp resource defined for ${ObjectID}: ${ts.toString()}!`,
37
+ ),
38
+ }
39
+ }
40
+ const correctedTs = correctOffset(ts)
41
+
42
+ if (!isUnixTimeInSeconds(correctedTs)) {
43
+ return {
44
+ error: new InvalidTimeError(
45
+ `Timestamp ${JSON.stringify(ts)} for ${ObjectID} is not a valid unix time in seconds!`,
46
+ ),
47
+ }
48
+ }
49
+
50
+ for (const [ResourceID, Value] of Object.entries(Resources)) {
51
+ const def = definitions[ObjectID].Resources[parseInt(ResourceID, 10)]
52
+ if (def === undefined) {
53
+ return {
54
+ error: new Error(
55
+ `No definition found for ${ObjectID}/${ObjectInstanceID}/${ResourceID}`,
56
+ ),
57
+ }
58
+ }
59
+
60
+ if (Value === null) continue
61
+ if (Value === undefined) continue
62
+
63
+ if (!isNumeric(def)) continue
64
+
65
+ measures.push({
66
+ Name: `${ObjectID}/${ObjectVersion}/${ResourceID}`,
67
+ Value: Value.toString(),
68
+ Type: MeasureValueType.DOUBLE,
69
+ })
70
+ }
71
+ return { measures }
72
+ }
@@ -1,7 +1,7 @@
1
1
  import assert from 'node:assert/strict'
2
2
  import { describe, it } from 'node:test'
3
- import { objectsToShadow } from './objectsToShadow.js'
4
3
  import { LwM2MObjectID } from '../LwM2MObjectID.js'
4
+ import { objectsToShadow } from './objectsToShadow.js'
5
5
 
6
6
  void describe('objectsToShadow()', () => {
7
7
  void it('should convert a list of LwM2M objects to a shadow document', () =>
@@ -45,7 +45,7 @@ void describe('objectsToShadow()', () => {
45
45
  ObjectVersion: '1.0',
46
46
  Resources: {
47
47
  0: ['BOOT', 'MODEM', 'APP'],
48
- 99: 1717409966 * 1000,
48
+ 99: 1717409966,
49
49
  },
50
50
  },
51
51
  ]),
@@ -83,7 +83,7 @@ void describe('objectsToShadow()', () => {
83
83
  '14401:1.0': {
84
84
  0: {
85
85
  0: ['BOOT', 'MODEM', 'APP'],
86
- 99: 1717409966 * 1000,
86
+ 99: 1717409966,
87
87
  },
88
88
  },
89
89
  },
@@ -1,7 +1,7 @@
1
1
  import assert from 'node:assert/strict'
2
2
  import { describe, it } from 'node:test'
3
- import { shadowToObjects } from './shadowToObjects.js'
4
3
  import { LwM2MObjectID } from '../LwM2MObjectID.js'
4
+ import { shadowToObjects } from './shadowToObjects.js'
5
5
 
6
6
  void describe('shadowToObjects()', () => {
7
7
  void it('should convert a shadow to LwM2M objects', () =>
@@ -44,7 +44,7 @@ void describe('shadowToObjects()', () => {
44
44
  '14401:1.0': {
45
45
  0: {
46
46
  0: ['BOOT', 'MODEM', 'APP'],
47
- 99: 1717409966 * 1000,
47
+ 99: 1717409966,
48
48
  },
49
49
  },
50
50
  }),
@@ -99,7 +99,7 @@ void describe('shadowToObjects()', () => {
99
99
  ObjectVersion: '1.0',
100
100
  Resources: {
101
101
  0: ['BOOT', 'MODEM', 'APP'],
102
- 99: 1717409966 * 1000,
102
+ 99: 1717409966,
103
103
  },
104
104
  },
105
105
  ],
@@ -1,6 +1,6 @@
1
1
  import type { LwM2MObjectInstance } from '../LwM2MObjectInstance.js'
2
- import type { LwM2MShadow } from './objectsToShadow.js'
3
2
  import { timestampResources } from '../timestampResources.js'
3
+ import type { LwM2MShadow } from './objectsToShadow.js'
4
4
 
5
5
  export const shadowToObjects = (shadow: LwM2MShadow): LwM2MObjectInstance[] =>
6
6
  Object.entries(shadow)
@@ -1,17 +1,17 @@
1
1
  import chalk from 'chalk'
2
+ import assert from 'node:assert/strict'
3
+ import { exec } from 'node:child_process'
2
4
  import { readFile, readdir, stat } from 'node:fs/promises'
3
5
  import path, { parse } from 'node:path'
4
- import assert from 'node:assert/strict'
5
6
  import xml2js from 'xml2js'
6
- import { exec } from 'node:child_process'
7
- import { unwrapNestedArray } from './unwrapNestedArray.js'
7
+ import { validate } from '../validate.js'
8
8
  import {
9
9
  LWM2MObjectDefinition,
10
10
  type LWM2MObjectDefinitionType,
11
11
  } from './LWM2MObjectDefinition.js'
12
12
  import type { ParsedLwM2MObjectDefinition } from './ParsedLwM2MObjectDefinition.js'
13
- import { validate } from '../validate.js'
14
13
  import { parseRangeEnumeration } from './parseRangeEnumeration.js'
14
+ import { unwrapNestedArray } from './unwrapNestedArray.js'
15
15
 
16
16
  const v = validate(LWM2MObjectDefinition)
17
17
 
@@ -0,0 +1,24 @@
1
+ import assert from 'node:assert/strict'
2
+ import { describe, it } from 'node:test'
3
+ import { correctOffset } from './correctOffset.js'
4
+ import { isUnixTimeInSeconds } from './isUnixTimeInSeconds.js'
5
+
6
+ void describe('correctOffset()', () => {
7
+ void it('should correct timestamps in the future of up to 60 seconds', () => {
8
+ assert.equal(
9
+ isUnixTimeInSeconds(correctOffset(Date.now() / 1000 + 1)),
10
+ true,
11
+ 'should correct 1 second in the future',
12
+ )
13
+ assert.equal(
14
+ isUnixTimeInSeconds(correctOffset(Date.now() / 1000 + 60)),
15
+ true,
16
+ 'should correct 60 seconds in the future',
17
+ )
18
+ assert.equal(
19
+ isUnixTimeInSeconds(correctOffset(Date.now() / 1000 + 61)),
20
+ false,
21
+ 'should not correct 61 seconds in the future',
22
+ )
23
+ })
24
+ })
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Corrects an offset of up to 60 seconds in the future.
3
+ * This is needed because some devices clocks drift, and they report timestamps in the future.
4
+ */
5
+ export const correctOffset = (ts: number, maxOffsetSeconds = 60): number => {
6
+ const nowSeconds = Math.ceil(Date.now() / 1000)
7
+ const offset = ts * 1000 - nowSeconds
8
+ if (offset < 0) {
9
+ return ts
10
+ }
11
+ return ts - Math.min(offset, maxOffsetSeconds)
12
+ }
@@ -1,6 +1,6 @@
1
- import xml2js from 'xml2js'
2
1
  import { readFile } from 'node:fs/promises'
3
2
  import path from 'node:path'
3
+ import xml2js from 'xml2js'
4
4
  import type { LwM2MType } from './resourceType.js'
5
5
 
6
6
  /**
package/lwm2m/index.ts CHANGED
@@ -1,11 +1,15 @@
1
- export * from './validate.js'
2
- export * from './timestampResources.js'
1
+ export * from './definitions.js'
2
+ export * from './instanceTs.js'
3
+ export * from './InvalidTimeError.js'
4
+ export * from './isLwM2MObjectID.js'
5
+ export * from './isNumber.js'
6
+ export * from './isNumeric.js'
7
+ export * from './isUnixTimeInSeconds.js'
3
8
  export * from './LwM2MObject.js'
4
9
  export * from './LwM2MObjectID.js'
5
- export * from './objects.js'
6
- export * from './definitions.js'
7
10
  export * from './LWM2MObjectInfo.js'
8
- export * from './validators.js'
9
- export * from './instanceTs.js'
10
11
  export * from './LwM2MObjectInstance.js'
11
- export * from './isLwM2MObjectID.js'
12
+ export * from './objects.js'
13
+ export * from './timestampResources.js'
14
+ export * from './validate.js'
15
+ export * from './validators.js'
@@ -1,5 +1,5 @@
1
- import { describe, it } from 'node:test'
2
1
  import assert from 'node:assert/strict'
2
+ import { describe, it } from 'node:test'
3
3
  import { instanceTs, instanceTsAsDate } from './instanceTs.js'
4
4
 
5
5
  void describe('instanceTs()', () => {
@@ -0,0 +1,2 @@
1
+ export const isNumber = (value: unknown): value is number =>
2
+ Number.isFinite(value)
@@ -0,0 +1,30 @@
1
+ import assert from 'node:assert/strict'
2
+ import { describe, it } from 'node:test'
3
+ import { isNumeric } from './isNumeric.js'
4
+ import { ResourceType } from './LWM2MObjectInfo.js'
5
+
6
+ void describe('isNumeric', () => {
7
+ void it('should return true for numeric types', () => {
8
+ const numericTypes = [
9
+ { Type: ResourceType.Float },
10
+ { Type: ResourceType.Integer },
11
+ ]
12
+
13
+ numericTypes.forEach((def) => {
14
+ assert.strictEqual(isNumeric(def), true)
15
+ })
16
+ })
17
+
18
+ void it('should return false for non-numeric types', () => {
19
+ const nonNumericTypes = [
20
+ { Type: ResourceType.String },
21
+ { Type: ResourceType.Opaque },
22
+ { Type: ResourceType.Boolean },
23
+ { Type: ResourceType.Time },
24
+ ]
25
+
26
+ nonNumericTypes.forEach((def) => {
27
+ assert.strictEqual(isNumeric(def), false)
28
+ })
29
+ })
30
+ })
@@ -0,0 +1,17 @@
1
+ import { ResourceType } from './LWM2MObjectInfo.js'
2
+
3
+ /**
4
+ * Only store numeric values, because you cannot create statistics about strings, or boolean
5
+ */
6
+ export const isNumeric = (def: { Type: ResourceType }): boolean => {
7
+ switch (def.Type) {
8
+ case ResourceType.Float:
9
+ case ResourceType.Integer:
10
+ return true
11
+ case ResourceType.String:
12
+ case ResourceType.Opaque:
13
+ case ResourceType.Boolean:
14
+ case ResourceType.Time: // Time is numeric, but is stored as timestamp
15
+ return false
16
+ }
17
+ }
@@ -0,0 +1,16 @@
1
+ import assert from 'node:assert/strict'
2
+ import { describe, it } from 'node:test'
3
+ import { isUnixTimeInSeconds } from './isUnixTimeInSeconds.js'
4
+
5
+ void describe('isUnixTimeInSeconds()', () => {
6
+ void it('should return true for valid Unix time in seconds', () => {
7
+ assert.equal(isUnixTimeInSeconds(1700000000), true)
8
+ assert.equal(isUnixTimeInSeconds(Date.now() / 1000), true)
9
+ })
10
+
11
+ void it('should return false for invalid Unix time in seconds', () => {
12
+ assert.equal(isUnixTimeInSeconds('1700000000'), false)
13
+ assert.equal(isUnixTimeInSeconds(1699999999), false)
14
+ assert.equal(isUnixTimeInSeconds(Date.now()), false)
15
+ })
16
+ })
@@ -0,0 +1,8 @@
1
+ import { isNumber } from './isNumber.js'
2
+
3
+ export const isUnixTimeInSeconds = (value: unknown): value is number => {
4
+ if (!isNumber(value)) return false
5
+ if (value < 1700000000) return false
6
+ if (value * 1000 > Date.now()) return false
7
+ return true
8
+ }
@@ -1,7 +1,7 @@
1
- import { describe, it } from 'node:test'
2
1
  import assert from 'node:assert/strict'
3
- import { parseRangeEnumeration } from './parseRangeEnumeration.js'
2
+ import { describe, it } from 'node:test'
4
3
  import { RangeEnumerationRegExp } from './LWM2MObjectDefinition.js'
4
+ import { parseRangeEnumeration } from './parseRangeEnumeration.js'
5
5
 
6
6
  void describe('parseRangeEnumeration()', () => {
7
7
  void it('should parse valid range enumeration', () => {
@@ -1,5 +1,5 @@
1
- import { describe, it } from 'node:test'
2
1
  import assert from 'node:assert/strict'
2
+ import { describe, it } from 'node:test'
3
3
  import { unwrapNestedArray } from './unwrapNestedArray.js'
4
4
 
5
5
  void describe('unwrapNestedArray()', () => {
@@ -1,7 +1,7 @@
1
+ import assert from 'node:assert'
1
2
  import { describe, it } from 'node:test'
2
3
  import { validate } from './validate.js'
3
4
  import { validators } from './validators.js'
4
- import assert from 'node:assert'
5
5
 
6
6
  void describe('validate()', () => {
7
7
  const v = validate(validators)
package/lwm2m/validate.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { LwM2MObjectInstance } from './LwM2MObjectInstance.js'
2
1
  import type { LwM2MObjectID } from './LwM2MObjectID.js'
2
+ import type { LwM2MObjectInstance } from './LwM2MObjectInstance.js'
3
3
  import { isLwM2MObject } from './validation.js'
4
4
 
5
5
  export const validate =
@@ -1,5 +1,5 @@
1
- import type { LwM2MObjectInstance } from './LwM2MObjectInstance.js'
2
1
  import { LwM2MObjectIDs, type LwM2MObjectID } from './LwM2MObjectID.js'
2
+ import type { LwM2MObjectInstance } from './LwM2MObjectInstance.js'
3
3
 
4
4
  export const isLwM2MObject = (
5
5
  object: unknown,
@@ -1,9 +1,9 @@
1
1
  import chalk from 'chalk'
2
+ import { parseREADME } from 'markdown/parseREADME.js'
2
3
  import assert from 'node:assert/strict'
3
4
  import { readFile, readdir, stat } from 'node:fs/promises'
4
5
  import path from 'node:path'
5
6
  import { ModelIDRegExp } from './types.js'
6
- import { parseREADME } from 'markdown/parseREADME.js'
7
7
 
8
8
  console.log(chalk.gray('Models rules check'))
9
9
  console.log('')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hello.nrfcloud.com/proto-map",
3
- "version": "16.1.40",
3
+ "version": "16.2.0",
4
4
  "description": "Documents the communication protocol between devices, the hello.nrfcloud.com/map backend and web application",
5
5
  "type": "module",
6
6
  "exports": {
@@ -39,7 +39,7 @@
39
39
  "@bifravst/prettier-config": "1.1.6",
40
40
  "@commitlint/config-conventional": "19.7.1",
41
41
  "@swc/cli": "0.6.0",
42
- "@swc/core": "1.10.16",
42
+ "@swc/core": "1.10.18",
43
43
  "@types/node": "22.13.4",
44
44
  "@types/xml2js": "0.4.14",
45
45
  "chalk": "5.4.1",
@@ -49,7 +49,7 @@
49
49
  "remark": "15.0.1",
50
50
  "remark-frontmatter": "5.0.0",
51
51
  "tsmatchers": "5.0.2",
52
- "tsx": "4.19.2",
52
+ "tsx": "4.19.3",
53
53
  "typescript": "5.7.3",
54
54
  "xml2js": "0.6.2",
55
55
  "yaml": "2.7.0"
@@ -98,6 +98,7 @@
98
98
  "lwm2m"
99
99
  ],
100
100
  "peerDependencies": {
101
- "@sinclair/typebox": "^0.34.24"
101
+ "@aws-sdk/client-timestream-write": "^3.750.0",
102
+ "@sinclair/typebox": "^0.34.25"
102
103
  }
103
104
  }
@@ -1,7 +1,7 @@
1
- import { describe, it } from 'node:test'
2
- import { SenML, type SenMLType } from './SenMLSchema.js'
3
1
  import assert from 'node:assert/strict'
2
+ import { describe, it } from 'node:test'
4
3
  import { validate } from '../validate.js'
4
+ import { SenML, type SenMLType } from './SenMLSchema.js'
5
5
 
6
6
  void describe('SenMLType', () => {
7
7
  void it('it should validate a SenML payload', () => {
@@ -1,5 +1,5 @@
1
- import { describe, it } from 'node:test'
2
1
  import assert from 'node:assert/strict'
2
+ import { describe, it } from 'node:test'
3
3
  import { hasValue } from './hasValue.js'
4
4
 
5
5
  void describe('hasValue() should determine whether an object has a value', () => {
package/senml/index.ts CHANGED
@@ -1,4 +1,4 @@
1
+ export * from './fromCBOR.js'
2
+ export * from './lwm2mToSenML.js'
1
3
  export * from './SenMLSchema.js'
2
4
  export * from './senMLtoLwM2M.js'
3
- export * from './lwm2mToSenML.js'
4
- export * from './fromCBOR.js'
@@ -1,13 +1,13 @@
1
- import { it, describe } from 'node:test'
2
- import type { SenMLType } from './SenMLSchema.js'
1
+ import assert from 'node:assert/strict'
2
+ import { describe, it } from 'node:test'
3
+ import { LwM2MObjectID } from '../lwm2m/LwM2MObjectID.js'
4
+ import type { LwM2MObjectInstance } from '../lwm2m/LwM2MObjectInstance.js'
3
5
  import type {
4
6
  Geolocation_14201,
5
7
  SeaWaterLevel_14230,
6
8
  } from '../lwm2m/objects.js'
7
- import { LwM2MObjectID } from '../lwm2m/LwM2MObjectID.js'
8
- import assert from 'node:assert/strict'
9
- import type { LwM2MObjectInstance } from '../lwm2m/LwM2MObjectInstance.js'
10
9
  import { lwm2mToSenML } from './lwm2mToSenML.js'
10
+ import type { SenMLType } from './SenMLSchema.js'
11
11
 
12
12
  void describe('lwm2mToSenML()', () => {
13
13
  void it('should convert LwM2M to SenML', () => {
@@ -1,12 +1,12 @@
1
- import type { SenMLType } from './SenMLSchema.js'
1
+ import { definitions } from '../lwm2m/definitions.js'
2
2
  import { instanceTs } from '../lwm2m/instanceTs.js'
3
+ import { ResourceType, type LWM2MObjectInfo } from '../lwm2m/LWM2MObjectInfo.js'
3
4
  import type {
4
5
  LwM2MObjectInstance,
5
6
  LwM2MResourceValue,
6
7
  } from '../lwm2m/LwM2MObjectInstance.js'
7
8
  import { timestampResources } from '../lwm2m/timestampResources.js'
8
- import { definitions } from '../lwm2m/definitions.js'
9
- import { ResourceType, type LWM2MObjectInfo } from '../lwm2m/LWM2MObjectInfo.js'
9
+ import type { SenMLType } from './SenMLSchema.js'
10
10
 
11
11
  /**
12
12
  * Convert LwM2M Object Instances to senML
@@ -1,7 +1,7 @@
1
- import { describe, it } from 'node:test'
2
1
  import assert from 'node:assert/strict'
3
- import { validateSenML } from './validateSenML.js'
2
+ import { describe, it } from 'node:test'
4
3
  import type { SenMLType } from './SenMLSchema.js'
4
+ import { validateSenML } from './validateSenML.js'
5
5
 
6
6
  void describe('validateSenML()', () => {
7
7
  void it('should validate', () => {