@digitraffic/common 2026.1.13-1 → 2026.1.14-1-node24

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.
@@ -58,7 +58,7 @@ describe("integration tests", () => {
58
58
  const app = new App();
59
59
  const stack = new Stack(app);
60
60
  const f = new LambdaFunction(stack, "id", {
61
- runtime: Runtime.NODEJS_22_X,
61
+ runtime: Runtime.NODEJS_24_X,
62
62
  code: Code.fromInline("placeholder"),
63
63
  handler: "handler",
64
64
  });
@@ -64,7 +64,7 @@ describe("FunctionBuilder test", () => {
64
64
  [TEST_ENV_VAR]: TEST_ENV_VALUE,
65
65
  },
66
66
  },
67
- Runtime: Runtime.NODEJS_22_X.name,
67
+ Runtime: Runtime.NODEJS_24_X.name,
68
68
  MemorySize: 128,
69
69
  Timeout: 60,
70
70
  Handler: "test.handler",
@@ -83,10 +83,10 @@ describe("FunctionBuilder test", () => {
83
83
  });
84
84
  test("Lambda runtime is set", () => {
85
85
  const template = createTemplate((builder) => {
86
- builder.withRuntime(Runtime.NODEJS_20_X);
86
+ builder.withRuntime(Runtime.NODEJS_24_X);
87
87
  });
88
88
  template.hasResourceProperties("AWS::Lambda::Function", {
89
- Runtime: Runtime.NODEJS_20_X.name,
89
+ Runtime: Runtime.NODEJS_24_X.name,
90
90
  });
91
91
  });
92
92
  test("Lambda description is set", () => {
@@ -73,7 +73,7 @@ export const DigitrafficDLQueue = {
73
73
  functionName: dlqFunctionName,
74
74
  });
75
75
  const lambda = MonitoredFunction.create(stack, dlqFunctionName, {
76
- runtime: Runtime.NODEJS_22_X,
76
+ runtime: Runtime.NODEJS_24_X,
77
77
  logGroup: dlqLogGroup,
78
78
  functionName: dlqFunctionName,
79
79
  code: getDlqCode(dlqBucket.bucketName),
@@ -70,7 +70,7 @@ export declare class FunctionBuilder {
70
70
  */
71
71
  withMemorySize(memorySize: number): this;
72
72
  /**
73
- * Set runtime for the lambda. Default is Runtime.NODEJS_22_X.
73
+ * Set runtime for the lambda. Default is Runtime.NODEJS_24_X.
74
74
  */
75
75
  withRuntime(runtime: Runtime): this;
76
76
  /**
@@ -11,7 +11,7 @@ export class FunctionBuilder {
11
11
  _stack;
12
12
  _name;
13
13
  description;
14
- runtime = Runtime.NODEJS_22_X;
14
+ runtime = Runtime.NODEJS_24_X;
15
15
  architecture = Architecture.ARM_64;
16
16
  role;
17
17
  timeout = Duration.seconds(60);
@@ -121,7 +121,7 @@ export class FunctionBuilder {
121
121
  return this;
122
122
  }
123
123
  /**
124
- * Set runtime for the lambda. Default is Runtime.NODEJS_22_X.
124
+ * Set runtime for the lambda. Default is Runtime.NODEJS_24_X.
125
125
  */
126
126
  withRuntime(runtime) {
127
127
  this.runtime = runtime;
@@ -17,7 +17,7 @@ export function databaseFunctionProps(stack, environment, lambdaName, simpleLamb
17
17
  }
18
18
  export function lambdaFunctionProps(_, environment, lambdaName, simpleLambdaName, logGroup, config) {
19
19
  return {
20
- runtime: config?.runtime ?? Runtime.NODEJS_22_X,
20
+ runtime: config?.runtime ?? Runtime.NODEJS_24_X,
21
21
  architecture: config?.architecture ?? Architecture.ARM_64,
22
22
  memorySize: config?.memorySize ?? 128,
23
23
  functionName: lambdaName,
@@ -38,7 +38,7 @@ function getAssetCode(simpleLambdaName, isSingleLambda) {
38
38
  }
39
39
  export function defaultLambdaConfiguration(config) {
40
40
  const props = {
41
- runtime: Runtime.NODEJS_22_X,
41
+ runtime: Runtime.NODEJS_24_X,
42
42
  memorySize: config.memorySize ?? 128,
43
43
  functionName: config.functionName,
44
44
  handler: config.handler,
@@ -8,7 +8,7 @@ import { kebabCase } from "change-case";
8
8
  import { snakeCase } from "es-toolkit";
9
9
  import { DigitrafficStack, SOLUTION_KEY } from "./stack.js";
10
10
  const MAX_CONCURRENCY_LIMIT = 100;
11
- const NODE_RUNTIMES = [Runtime.NODEJS_22_X.name, Runtime.NODEJS_20_X.name];
11
+ const NODE_RUNTIMES = [Runtime.NODEJS_24_X.name, Runtime.NODEJS_22_X.name];
12
12
  var ResourceType;
13
13
  (function (ResourceType) {
14
14
  ResourceType["stackName"] = "STACK_NAME";
@@ -1,6 +1,8 @@
1
1
  import type { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda";
2
2
  import { MediaType } from "./mediatypes.js";
3
3
  export declare const MAX_LAMBDA_PAYLOAD_BYTES: number;
4
+ export declare const REDIRECTION_HTTP_STATUS_CODES: readonly [301, 302, 303, 307, 308];
5
+ export type RedirectionStatusCode = (typeof REDIRECTION_HTTP_STATUS_CODES)[number];
4
6
  /**
5
7
  * Used to build APIGatewayProxyResult response for Lambda proxy integration.
6
8
  * Default status is 200, compressed = false and contentType is application/json.
@@ -32,6 +34,7 @@ export declare class LambdaProxyResponseBuilder {
32
34
  static badRequest(error?: object | string): APIGatewayProxyResult;
33
35
  static notFound(error?: object | string): APIGatewayProxyResult;
34
36
  static unauthorized(error?: object | string): APIGatewayProxyResult;
37
+ static redirect(path: string, status?: RedirectionStatusCode): APIGatewayProxyResult;
35
38
  private withError;
36
39
  build(): APIGatewayProxyResult;
37
40
  /**
@@ -5,6 +5,7 @@ import { StopWatch } from "../../utils/stop-watch.js";
5
5
  import { logger } from "../runtime/dt-logger-default.js";
6
6
  import { MediaType } from "./mediatypes.js";
7
7
  export const MAX_LAMBDA_PAYLOAD_BYTES = 6 * 1024 * 1024; // 6 MiB
8
+ export const REDIRECTION_HTTP_STATUS_CODES = [301, 302, 303, 307, 308];
8
9
  /**
9
10
  * Used to build APIGatewayProxyResult response for Lambda proxy integration.
10
11
  * Default status is 200, compressed = false and contentType is application/json.
@@ -96,6 +97,12 @@ export class LambdaProxyResponseBuilder {
96
97
  static unauthorized(error = "Unauthorized") {
97
98
  return LambdaProxyResponseBuilder.create().withError(error, 401).build();
98
99
  }
100
+ static redirect(path, status = 302) {
101
+ return LambdaProxyResponseBuilder.create()
102
+ .withLocation(path)
103
+ .withStatus(status)
104
+ .build();
105
+ }
99
106
  withError(error, status) {
100
107
  return this.withStatus(status)
101
108
  .withBody(error)
@@ -104,7 +111,7 @@ export class LambdaProxyResponseBuilder {
104
111
  : MediaType.APPLICATION_JSON);
105
112
  }
106
113
  build() {
107
- const bodyNotRequired = [204, 301, 302, 303, 307, 308].includes(this.status);
114
+ const bodyNotRequired = [204, ...REDIRECTION_HTTP_STATUS_CODES].includes(this.status);
108
115
  if (!this.body && !bodyNotRequired) {
109
116
  throw new Error("Body is required for LambdaResponseBuilder");
110
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitraffic/common",
3
- "version": "2026.1.13-1",
3
+ "version": "2026.1.14-1-node24",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "repository": {
@@ -129,7 +129,7 @@
129
129
  "@types/jest": "30.0.0",
130
130
  "@types/lodash-es": "4.17.12",
131
131
  "@types/madge": "5.0.3",
132
- "@types/node": "22.19.3",
132
+ "@types/node": "24.10.4",
133
133
  "aws-cdk-lib": "2.234.1",
134
134
  "change-case": "5.4.4",
135
135
  "constructs": "10.4.4",
@@ -174,7 +174,7 @@
174
174
  "zod": "4.3.5"
175
175
  },
176
176
  "engines": {
177
- "node": ">=22 <23"
177
+ "node": ">=24 <25"
178
178
  },
179
179
  "scripts": {
180
180
  "build": "heft build --clean",