Skip to content

Commit 4a0b397

Browse files
committed
fix: update dependencies
1 parent 08a7917 commit 4a0b397

23 files changed

+125
-111
lines changed

cdk/BackendStack.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1+
import { repositoryName } from '@bifravst/aws-cdk-ecr-helpers/repository'
2+
import { LambdaSource } from '@bifravst/aws-cdk-lambda-helpers/cdk'
3+
import type { PackedLayer } from '@bifravst/aws-cdk-lambda-helpers/layer'
4+
import { ContinuousDeployment } from '@bifravst/ci'
15
import type { App } from 'aws-cdk-lib'
26
import {
37
CfnOutput,
8+
aws_ecr as ECR,
49
aws_lambda as Lambda,
510
Stack,
6-
aws_ecr as ECR,
711
} from 'aws-cdk-lib'
8-
import type { BackendLambdas } from './packBackendLambdas.js'
9-
import type { PackedLayer } from '@bifravst/aws-cdk-lambda-helpers/layer'
10-
import { LambdaSource } from '@bifravst/aws-cdk-lambda-helpers/cdk'
11-
import { PublicDevices } from './resources/PublicDevices.js'
12-
import { ShareAPI } from './resources/ShareAPI.js'
13-
import { STACK_NAME } from './stackConfig.js'
14-
import { DevicesAPI } from './resources/DevicesAPI.js'
15-
import { DeviceManagementAPI } from './resources/DeviceManagementAPI.js'
1612
import { ContainerRepositoryId } from '../aws/ecr.js'
17-
import { repositoryName } from '@bifravst/aws-cdk-ecr-helpers/repository'
18-
import { ContinuousDeployment } from '@bifravst/ci'
13+
import type { BackendLambdas } from './packBackendLambdas.js'
1914
import { API } from './resources/api/API.js'
20-
import { ApiHealthCheck } from './resources/api/HealthCheck.js'
2115
import {
2216
CustomDomain,
2317
type CustomDomainDetails,
2418
} from './resources/api/CustomDomain.js'
25-
import { JWKS } from './resources/JWKS.js'
19+
import { ApiHealthCheck } from './resources/api/HealthCheck.js'
20+
import { DeviceManagementAPI } from './resources/DeviceManagementAPI.js'
21+
import { DevicesAPI } from './resources/DevicesAPI.js'
2622
import { EmailConfirmationTokens } from './resources/EmailConfirmationTokens.js'
23+
import { JWKS } from './resources/JWKS.js'
24+
import { PublicDevices } from './resources/PublicDevices.js'
25+
import { ShareAPI } from './resources/ShareAPI.js'
2726
import { UserAuthAPI } from './resources/UserAuthAPI.js'
27+
import { STACK_NAME } from './stackConfig.js'
2828

2929
/**
3030
* Provides resources for the backend serving data to hello.nrfcloud.com/map

cdk/backend.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1+
import { ACMClient } from '@aws-sdk/client-acm'
12
import { IAMClient } from '@aws-sdk/client-iam'
3+
import { ensureGitHubOIDCProvider } from '@bifravst/ci'
24
import { fromEnv } from '@bifravst/from-env'
5+
import { getCertificateArnForDomain } from '../aws/acm.js'
36
import pJSON from '../package.json'
47
import { BackendApp } from './BackendApp.js'
58
import { pack as packBaseLayer } from './baseLayer.js'
6-
import { ensureGitHubOIDCProvider } from '@bifravst/ci'
7-
import { packBackendLambdas } from './packBackendLambdas.js'
8-
import { ACMClient } from '@aws-sdk/client-acm'
9-
import { getCertificateArnForDomain } from '../aws/acm.js'
109
import { pack as packCDKLayer } from './cdkLayer.js'
1110
import { pack as packJWTLayer } from './jwtLayer.js'
11+
import { packBackendLambdas } from './packBackendLambdas.js'
1212

1313
const repoUrl = new URL(pJSON.repository.url)
1414
const repository = {

cdk/packBackendLambdas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { packLambdaFromPath } from '@bifravst/aws-cdk-lambda-helpers'
21
import type { PackedLambda } from '@bifravst/aws-cdk-lambda-helpers'
2+
import { packLambdaFromPath } from '@bifravst/aws-cdk-lambda-helpers'
33

44
export type BackendLambdas = {
55
shareDevice: PackedLambda

cdk/resources/api/CustomDomain.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { Construct } from 'constructs'
1+
import { PackedLambdaFn } from '@bifravst/aws-cdk-lambda-helpers/cdk'
22
import {
3+
CustomResource,
34
aws_apigatewayv2 as HttpApi,
5+
aws_iam as IAM,
46
ResolutionTypeHint,
57
type aws_lambda as Lambda,
6-
aws_iam as IAM,
7-
CustomResource,
88
} from 'aws-cdk-lib'
9-
import type { API } from './API.js'
10-
import { PackedLambdaFn } from '@bifravst/aws-cdk-lambda-helpers/cdk'
9+
import { Construct } from 'constructs'
1110
import type { BackendLambdas } from '../../packBackendLambdas.js'
11+
import type { API } from './API.js'
1212

1313
export type CustomDomainDetails = {
1414
domainName: string

cdk/resources/containers/buildOpenSSLLambdaImage.ts

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import path from 'node:path'
1+
import { hashFile } from '@bifravst/aws-cdk-ecr-helpers/hashFile'
2+
import { hashFolder } from '@bifravst/aws-cdk-ecr-helpers/hashFolder'
23
import {
34
type ImageBuilder,
45
type ImageChecker,
56
} from '@bifravst/aws-cdk-ecr-helpers/image'
6-
import { hashFolder } from '@bifravst/aws-cdk-ecr-helpers/hashFolder'
7-
import { hashFile } from '@bifravst/aws-cdk-ecr-helpers/hashFile'
8-
import fs from 'node:fs/promises'
9-
import run from '@bifravst/run'
10-
import os from 'node:os'
117
import { packLambdaFromPath } from '@bifravst/aws-cdk-lambda-helpers'
128
import { checkSumOfStrings } from '@bifravst/aws-cdk-lambda-helpers/util'
13-
import type { logFn } from '../../../cli/log.js'
14-
import { ContainerRepositoryId } from '../../../aws/ecr.js'
9+
import run from '@bifravst/run'
10+
import fs from 'node:fs/promises'
11+
import os from 'node:os'
12+
import path from 'node:path'
1513
import { fileURLToPath } from 'node:url'
14+
import { ContainerRepositoryId } from '../../../aws/ecr.js'
15+
import type { logFn } from '../../../cli/log.js'
1616
const __filename = fileURLToPath(import.meta.url)
1717
const __dirname = path.dirname(__filename)
1818

@@ -56,13 +56,24 @@ export const buildOpenSSLLambdaImage = async (
5656
log: { debug, stderr: debug, stdout: debug },
5757
})
5858

59+
const deps = new Map<string, string>()
60+
for (const dep of [
61+
'@bifravst/run',
62+
'@hello.nrfcloud.com/certificate-helpers',
63+
'@hello.nrfcloud.com/lambda-helpers',
64+
'@middy/core',
65+
]) {
66+
const version =
67+
pJSON.dependencies[dep as keyof typeof pJSON.dependencies] ??
68+
pJSON.devDependencies[dep as keyof typeof pJSON.devDependencies]
69+
if (version === undefined)
70+
throw new Error(`[OpenSSLImage] Failed to determine version for ${dep}!`)
71+
deps.set(dep, version)
72+
}
73+
5974
await run({
6075
command: 'npm',
61-
args: [
62-
'i',
63-
`@hello.nrfcloud.com/certificate-helpers@${pJSON.dependencies['@hello.nrfcloud.com/certificate-helpers']}`,
64-
`@bifravst/run@${pJSON.devDependencies['@bifravst/run']}`,
65-
],
76+
args: ['i', ...[...deps.entries()].map(([dep, v]) => `${dep}@${v}`)],
6677
log: { debug, stderr: debug, stdout: debug },
6778
cwd: path.join(distDir, 'lambda'),
6879
})

cli/cli.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import { CloudFormationClient } from '@aws-sdk/client-cloudformation'
2+
import { CloudWatchLogsClient } from '@aws-sdk/client-cloudwatch-logs'
23
import { DynamoDBClient } from '@aws-sdk/client-dynamodb'
4+
import { ECRClient } from '@aws-sdk/client-ecr'
35
import { SSMClient } from '@aws-sdk/client-ssm'
46
import { STSClient } from '@aws-sdk/client-sts'
57
import { stackOutput } from '@bifravst/cloudformation-helpers'
68
import chalk from 'chalk'
79
import { program } from 'commander'
10+
import { env } from '../aws/env.js'
811
import type { StackOutputs } from '../cdk/BackendStack.js'
912
import { STACK_NAME } from '../cdk/stackConfig.js'
1013
import psjon from '../package.json'
11-
import { ECRClient } from '@aws-sdk/client-ecr'
12-
import { registerDeviceCommand } from './commands/register-device.js'
1314
import type { CommandDefinition } from './commands/CommandDefinition.js'
1415
import { buildContainersCommand } from './commands/build-container.js'
15-
import { env } from '../aws/env.js'
16-
import { configureNrfCloudAccountCommand } from './commands/configure-nrfcloud-account.js'
17-
import { logsCommand } from './commands/logs.js'
18-
import { CloudWatchLogsClient } from '@aws-sdk/client-cloudwatch-logs'
1916
import { configureHelloCommand } from './commands/configure-hello.js'
20-
import { shareDeviceCommand } from './commands/share-device.js'
17+
import { configureNrfCloudAccountCommand } from './commands/configure-nrfcloud-account.js'
18+
import { generateJWTKeypairCommand } from './commands/generate-jwt-keypair.js'
2119
import { listDevicesCommand } from './commands/listDevices.js'
20+
import { logsCommand } from './commands/logs.js'
21+
import { registerDeviceCommand } from './commands/register-device.js'
2222
import { removeDeviceCommand } from './commands/remove-device.js'
23-
import { generateJWTKeypairCommand } from './commands/generate-jwt-keypair.js'
23+
import { shareDeviceCommand } from './commands/share-device.js'
2424

2525
const ssm = new SSMClient({})
2626
const db = new DynamoDBClient({})

cli/commands/build-container.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import type { ECRClient } from '@aws-sdk/client-ecr'
2-
import { getOrCreateRepository } from '@bifravst/aws-cdk-ecr-helpers/repository'
3-
import type { CommandDefinition } from './CommandDefinition.js'
4-
import { debug as debugFn } from '../log.js'
52
import {
63
buildAndPublishImage,
74
checkIfImageExists,
85
} from '@bifravst/aws-cdk-ecr-helpers/image'
9-
import { STACK_NAME } from '../../cdk/stackConfig.js'
6+
import { getOrCreateRepository } from '@bifravst/aws-cdk-ecr-helpers/repository'
107
import { ContainerRepositoryId } from '../../aws/ecr.js'
118
import { buildOpenSSLLambdaImage } from '../../cdk/resources/containers/buildOpenSSLLambdaImage.js'
9+
import { STACK_NAME } from '../../cdk/stackConfig.js'
10+
import { debug as debugFn } from '../log.js'
11+
import type { CommandDefinition } from './CommandDefinition.js'
1212

1313
export const buildContainersCommand = ({
1414
ecr,

cli/commands/configure-hello.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { SSMClient } from '@aws-sdk/client-ssm'
22
import chalk from 'chalk'
33
import { STACK_NAME } from '../../cdk/stackConfig.js'
4-
import type { CommandDefinition } from './CommandDefinition.js'
54
import {
65
deleteSettings,
76
putSetting,
87
type Settings,
98
} from '../../settings/hello.js'
9+
import type { CommandDefinition } from './CommandDefinition.js'
1010

1111
export const configureHelloCommand = ({
1212
ssm,

cli/commands/configure-nrfcloud-account.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import type { SSMClient } from '@aws-sdk/client-ssm'
2-
import chalk from 'chalk'
3-
import { STACK_NAME } from '../../cdk/stackConfig.js'
4-
import type { CommandDefinition } from './CommandDefinition.js'
52
import {
63
deleteSettings,
74
putSetting,
85
type Settings,
96
} from '@hello.nrfcloud.com/nrfcloud-api-helpers/settings'
7+
import chalk from 'chalk'
8+
import { STACK_NAME } from '../../cdk/stackConfig.js'
109
import { NRF_CLOUD_ACCOUNT } from '../../settings/account.js'
10+
import type { CommandDefinition } from './CommandDefinition.js'
1111

1212
export const configureNrfCloudAccountCommand = ({
1313
ssm,

cli/commands/generate-jwt-keypair.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import type { SSMClient } from '@aws-sdk/client-ssm'
22
import chalk from 'chalk'
3-
import type { CommandDefinition } from './CommandDefinition.js'
4-
import {
5-
deleteSetting as deleteSetting,
6-
putSetting as putSetting,
7-
type Settings,
8-
} from '../../settings/jwt.js'
93
import { STACK_NAME } from '../../cdk/stackConfig.js'
104
import { generateJWTKeyPair } from '../../jwt/generateJWTKeyPair.js'
5+
import { deleteSetting, putSetting, type Settings } from '../../settings/jwt.js'
6+
import type { CommandDefinition } from './CommandDefinition.js'
117

128
export const generateJWTKeypairCommand = ({
139
ssm,

0 commit comments

Comments
 (0)