Skip to content

Commit ae9b324

Browse files
committed
refactor: extract timestream history features to proto-map project
1 parent 0a240be commit ae9b324

16 files changed

+791
-459
lines changed

historicalData/NoHistoryMeasuresError.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

historicalData/instanceMeasuresToRecord.spec.ts

Lines changed: 0 additions & 37 deletions
This file was deleted.

historicalData/instanceMeasuresToRecord.ts

Lines changed: 0 additions & 64 deletions
This file was deleted.

historicalData/instanceToMeasures.ts

Lines changed: 0 additions & 74 deletions
This file was deleted.

lambda/queryLwM2MHistory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
import {
2323
LwM2MObjectIDs,
2424
definitions,
25+
isNumeric,
2526
timestampResources,
2627
type LWM2MObjectInfo,
2728
} from '@hello.nrfcloud.com/proto-map/lwm2m'
@@ -46,7 +47,6 @@ import {
4647
} from '../historicalData/HistoricalDataTimeSpans.ts'
4748
import { getAvailableColumns } from '../historicalData/getAvailableColumns.ts'
4849
import { validateDeviceJWT } from '../jwt/validateDeviceJWT.ts'
49-
import { isNumeric } from '../lwm2m/isNumeric.ts'
5050
import { fetchMapJWTPublicKeys } from './map/fetchMapJWTPublicKeys.ts'
5151
import { withDevice, type WithDevice } from './middleware/withDevice.ts'
5252

lambda/storeObjectsInTimestream.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ import { fromEnv } from '@bifravst/from-env'
1111
import { metricsForComponent } from '@hello.nrfcloud.com/lambda-helpers/metrics'
1212
import { requestLogger } from '@hello.nrfcloud.com/lambda-helpers/requestLogger'
1313
import {
14-
LwM2MObjectID,
1514
isLwM2MObjectID,
15+
LwM2MObjectID,
1616
} from '@hello.nrfcloud.com/proto-map/lwm2m'
1717
import type { LwM2MShadow } from '@hello.nrfcloud.com/proto-map/lwm2m/aws'
18+
import {
19+
instanceMeasuresToRecord,
20+
NoHistoryMeasuresError,
21+
} from '@hello.nrfcloud.com/proto-map/lwm2m/aws'
22+
1823
import middy from '@middy/core'
1924
import { getDeviceById } from '../devices/getDeviceById.ts'
20-
import { instanceMeasuresToRecord } from '../historicalData/instanceMeasuresToRecord.ts'
21-
import { NoHistoryMeasuresError } from '../historicalData/NoHistoryMeasuresError.ts'
2225

2326
const { tableInfo, DevicesTableName } = fromEnv({
2427
tableInfo: 'HISTORICAL_DATA_TABLE_INFO',

lwm2m/InvalidTimeError.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

lwm2m/correctOffset.spec.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

lwm2m/correctOffset.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

lwm2m/getLwM2MShadow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import {
33
type IoTDataPlaneClient,
44
} from '@aws-sdk/client-iot-data-plane'
55
import {
6+
isUnixTimeInSeconds,
67
timestampResources,
78
type LwM2MObjectInstance,
89
} from '@hello.nrfcloud.com/proto-map/lwm2m'
910
import { shadowToObjects } from '@hello.nrfcloud.com/proto-map/lwm2m/aws'
1011
import type { Device } from '../devices/device.ts'
11-
import { isUnixTimeInSeconds } from './isUnixTimeInSeconds.ts'
1212

1313
export const getLwM2MShadow =
1414
(iotData: IoTDataPlaneClient) =>

0 commit comments

Comments
 (0)