Skip to content

Commit

Permalink
fix: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Mar 21, 2024
1 parent 2335219 commit 0065a28
Show file tree
Hide file tree
Showing 21 changed files with 34 additions and 40 deletions.
2 changes: 1 addition & 1 deletion cdk/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const packagesInLayer: string[] = [
'@sinclair/typebox',
'ajv',
'@nordicsemiconductor/timestream-helpers',
'@hello.nrfcloud.com/proto-lwm2m',
'@hello.nrfcloud.com/proto-map',
'jsonata',
'mqtt',
'@protobuf-ts/runtime',
Expand Down
2 changes: 1 addition & 1 deletion cdk/resources/LwM2M.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
aws_lambda as Lambda,
Stack,
} from 'aws-cdk-lib'
import type { PackedLambda } from '../backend'
import type { PackedLambda } from '../backend.js'
import { LambdaLogGroup } from './LambdaLogGroup.js'

/**
Expand Down
2 changes: 1 addition & 1 deletion cdk/resources/Map.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { aws_iam as IAM, aws_location as Location, Stack } from 'aws-cdk-lib'
import type { CfnMap } from 'aws-cdk-lib/aws-location'
import { Construct } from 'constructs'
import type { UserAuthentication } from './UserAuthentication'
import type { UserAuthentication } from './UserAuthentication.js'

export class Map extends Construct {
public readonly map: CfnMap
Expand Down
5 changes: 3 additions & 2 deletions cdk/resources/Memfault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Stack,
RemovalPolicy,
} from 'aws-cdk-lib'
import type { IPrincipal } from 'aws-cdk-lib/aws-iam/index.js'
import { Construct } from 'constructs'
import type { PackedLambda } from '../backend.js'
import { LambdaLogGroup } from './LambdaLogGroup.js'
Expand Down Expand Up @@ -102,7 +101,9 @@ export class Memfault extends Construct {
})

fn.addPermission('InvokeByEvents', {
principal: new IAM.ServicePrincipal('events.amazonaws.com') as IPrincipal,
principal: new IAM.ServicePrincipal(
'events.amazonaws.com',
) as IAM.IPrincipal,
sourceArn: rule.ruleArn,
})

Expand Down
2 changes: 1 addition & 1 deletion cdk/resources/NRPlusGateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Kinesis, { StreamMode } from 'aws-cdk-lib/aws-kinesis'
import Lambda, { StartingPosition } from 'aws-cdk-lib/aws-lambda'
import { KinesisEventSource } from 'aws-cdk-lib/aws-lambda-event-sources'
import { Construct } from 'constructs'
import type { PackedLambda } from '../backend'
import type { PackedLambda } from '../backend.js'
import { LambdaLogGroup } from './LambdaLogGroup.js'

export class NRPlusGateway extends Construct {
Expand Down
5 changes: 3 additions & 2 deletions cdk/resources/PublishSummaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
aws_lambda as Lambda,
Duration,
} from 'aws-cdk-lib'
import type { IPrincipal } from 'aws-cdk-lib/aws-iam/index.js'
import { Construct } from 'constructs'
import type { PackedLambda } from '../backend.js'
import type { WebsocketAPI } from './WebsocketAPI.js'
Expand Down Expand Up @@ -90,7 +89,9 @@ export class PublishSummaries extends Construct {
})

lambda.addPermission('InvokeByEvents', {
principal: new IAM.ServicePrincipal('events.amazonaws.com') as IPrincipal,
principal: new IAM.ServicePrincipal(
'events.amazonaws.com',
) as IAM.IPrincipal,
sourceArn: rule.ruleArn,
})
}
Expand Down
4 changes: 2 additions & 2 deletions cdk/resources/ResolveNetworkSurveyGeoLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
aws_lambda_event_sources as LambdaEvents,
} from 'aws-cdk-lib'
import { Construct } from 'constructs'
import type { PackedLambda } from '../backend'
import type { WebsocketAPI } from './WebsocketAPI'
import type { PackedLambda } from '../backend.js'
import type { WebsocketAPI } from './WebsocketAPI.js'
import { LambdaLogGroup } from './LambdaLogGroup.js'

/**
Expand Down
2 changes: 1 addition & 1 deletion lambda/notifyClients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
DynamoDBClient,
ScanCommand,
} from '@aws-sdk/client-dynamodb'
import type { Summary } from './chartSummary'
import type { Summary } from './chartSummary.js'

export enum LocationSource {
MCELL = 'MCELL',
Expand Down
2 changes: 1 addition & 1 deletion lambda/onCellGeoLocationResolved.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IoTClient, SearchIndexCommand } from '@aws-sdk/client-iot'
import {
LwM2MObjectID,
type ConnectionInformation_14203,
} from '@hello.nrfcloud.com/proto-lwm2m'
} from '@hello.nrfcloud.com/proto-map'
import {
IoTDataPlaneClient,
UpdateThingShadowCommand,
Expand Down
2 changes: 1 addition & 1 deletion lambda/onNetworkSurveyLocated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
UpdateThingShadowCommand,
} from '@aws-sdk/client-iot-data-plane'
import { objectsToShadow } from '../lwm2m/objectsToShadow.js'
import { LwM2MObjectID } from '@hello.nrfcloud.com/proto-lwm2m'
import { LwM2MObjectID } from '@hello.nrfcloud.com/proto-map'

const { connectionsTableName, websocketManagementAPIURL, surveysTableName } =
fromEnv({
Expand Down
2 changes: 1 addition & 1 deletion lambda/publishLwM2MShadowsToJSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IoTClient } from '@aws-sdk/client-iot'
import { fetchLwM2MShadows } from '../lwm2m/fetchLwM2MShadows.js'
import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3'
import { fromEnv } from '@nordicsemiconductor/from-env'
import { models } from '@hello.nrfcloud.com/proto-lwm2m'
import { models } from '@hello.nrfcloud.com/proto-map'

const iot = new IoTClient({})
const fetchShadows = fetchLwM2MShadows(iot)
Expand Down
5 changes: 1 addition & 4 deletions lambda/updatesToLwM2M.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import {
UpdateThingShadowCommand,
} from '@aws-sdk/client-iot-data-plane'
import { transformShadowUpdateToLwM2M } from '../lwm2m/transformShadowUpdateToLwM2M.js'
import {
models,
type LwM2MObjectInstance,
} from '@hello.nrfcloud.com/proto-lwm2m'
import { models, type LwM2MObjectInstance } from '@hello.nrfcloud.com/proto-map'
import { objectsToShadow } from '../lwm2m/objectsToShadow.js'

const iotData = new IoTDataPlaneClient({})
Expand Down
4 changes: 2 additions & 2 deletions lambda/validateWithTypeBox.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Static, TSchema } from '@sinclair/typebox'
import Ajv, { type ErrorObject } from 'ajv'

import ajvLib, { type ErrorObject } from 'ajv'
const Ajv = ajvLib.default
export const validateWithTypeBox = <T extends TSchema>(
schema: T,
): ((value: unknown) =>
Expand Down
2 changes: 1 addition & 1 deletion lwm2m/fetchLwM2MShadows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IoTClient, SearchIndexCommand } from '@aws-sdk/client-iot'
import {
instanceTs,
type LwM2MObjectInstance,
} from '@hello.nrfcloud.com/proto-lwm2m'
} from '@hello.nrfcloud.com/proto-map'
import { shadowToObjects } from './shadowToObjects.js'
import { getDeviceInfo } from '../lambda/withDeviceAlias.js'

Expand Down
2 changes: 1 addition & 1 deletion lwm2m/objectsToShadow.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LwM2MObjectInstance } from '@hello.nrfcloud.com/proto-lwm2m'
import type { LwM2MObjectInstance } from '@hello.nrfcloud.com/proto-map'

export type LwM2MShadow = Record<
string,
Expand Down
4 changes: 2 additions & 2 deletions lwm2m/shadowToObjects.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
timestampResources,
type LwM2MObjectInstance,
} from '@hello.nrfcloud.com/proto-lwm2m'
import type { LwM2MShadow } from './objectsToShadow'
} from '@hello.nrfcloud.com/proto-map'
import type { LwM2MShadow } from './objectsToShadow.js'

export const shadowToObjects = (shadow: LwM2MShadow): LwM2MObjectInstance[] =>
Object.entries(shadow)
Expand Down
2 changes: 1 addition & 1 deletion lwm2m/transformShadowUpdateToLwM2M.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
import { transformShadowUpdateToLwM2M } from './transformShadowUpdateToLwM2M.js'
import { models } from '@hello.nrfcloud.com/proto-lwm2m'
import { models } from '@hello.nrfcloud.com/proto-map'

void describe('transformShadowUpdateToLwM2M()', () => {
void it('should convert a shadow update', async () =>
Expand Down
2 changes: 1 addition & 1 deletion lwm2m/transformShadowUpdateToLwM2M.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
type LwM2MObjectInstance,
type Transform,
definitions,
} from '@hello.nrfcloud.com/proto-lwm2m'
} from '@hello.nrfcloud.com/proto-map'

type Update = {
state: {
Expand Down
17 changes: 6 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
},
"prettier": "@bifravst/prettier-config",
"dependencies": {
"@hello.nrfcloud.com/proto-lwm2m": "3.3.0",
"@hello.nrfcloud.com/proto-map": "5.0.1",
"@nordicsemiconductor/from-env": "3.0.1",
"@nordicsemiconductor/timestream-helpers": "6.0.2",
"@protobuf-ts/runtime": "2.9.4",
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ES2022",
"moduleResolution": "node",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"resolveJsonModule": true,
"noEmit": true,
"noFallthroughCasesInSwitch": true,
Expand Down

0 comments on commit 0065a28

Please sign in to comment.