@digitraffic/common 2026.4.17-2 → 2026.4.20-1

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.
@@ -28,6 +28,10 @@ export class DigitrafficCanaryRole extends Role {
28
28
  });
29
29
  this.addToPolicy(new PolicyStatement(BASE_POLICY_STATEMENT_PROPS));
30
30
  this.addToPolicy(new PolicyStatement(CLOUDWATCH_STATEMENT_PROPS));
31
+ this.addToPolicy(new PolicyStatement({
32
+ actions: ["apigateway:GET"],
33
+ resources: ["arn:aws:apigateway:*::/apikeys/*"],
34
+ }));
31
35
  }
32
36
  /**
33
37
  * Provides permissions to access resources within a VPC.
@@ -39,10 +39,6 @@ export declare class FunctionBuilder {
39
39
  * Creates a new builder with defaults, but without database or secret access.
40
40
  */
41
41
  static plain(stack: Stack & DigitrafficStackInterface, lambdaName: string): FunctionBuilder;
42
- /**
43
- * Stack only has one lambda. Default is that it has multiple lambdas.
44
- */
45
- singleLambda(): this;
46
42
  /**
47
43
  * Use AssetCode from given path(dist/lambda/${path}). Default path is lambdaName. Also calls withHandler with the same value.
48
44
  */
@@ -30,7 +30,6 @@ export class FunctionBuilder {
30
30
  policyStatements = [];
31
31
  allowedActions = [];
32
32
  _features = {
33
- singleLambda: false,
34
33
  databaseAccess: true,
35
34
  secretAccess: true,
36
35
  };
@@ -63,21 +62,11 @@ export class FunctionBuilder {
63
62
  .withoutDatabaseAccess()
64
63
  .withoutSecretAccess();
65
64
  }
66
- /**
67
- * Stack only has one lambda. Default is that it has multiple lambdas.
68
- */
69
- singleLambda() {
70
- this._features.singleLambda = true;
71
- return this;
72
- }
73
65
  /**
74
66
  * Use AssetCode from given path(dist/lambda/${path}). Default path is lambdaName. Also calls withHandler with the same value.
75
67
  */
76
68
  withAssetCode(path = this._name) {
77
- const lambdaPath = this._features.singleLambda
78
- ? `dist/lambda/`
79
- : `dist/lambda/${path}`;
80
- this.code = new AssetCode(lambdaPath);
69
+ this.code = new AssetCode(`dist/lambda/${path}`);
81
70
  this.withHandler(path);
82
71
  return this;
83
72
  }
@@ -34,7 +34,6 @@ export interface FunctionParameters {
34
34
  vpcSubnets?: SubnetSelection;
35
35
  runtime?: Runtime;
36
36
  architecture?: Architecture;
37
- singleLambda?: boolean;
38
37
  }
39
38
  export type MonitoredFunctionParameters = FunctionParameters & {
40
39
  readonly durationAlarmProps?: MonitoredFunctionAlarmProps;
@@ -31,16 +31,13 @@ export function lambdaFunctionProps(_, environment, lambdaName, simpleLambdaName
31
31
  timeout: Duration.seconds(config?.timeout ?? 60),
32
32
  logGroup: logGroup,
33
33
  reservedConcurrentExecutions: config?.reservedConcurrentExecutions ?? 2,
34
- code: getAssetCode(simpleLambdaName, config?.singleLambda ?? false),
34
+ code: getAssetCode(simpleLambdaName),
35
35
  handler: `${simpleLambdaName}.handler`,
36
36
  environment,
37
37
  };
38
38
  }
39
- function getAssetCode(simpleLambdaName, isSingleLambda) {
40
- const lambdaPath = isSingleLambda
41
- ? `dist/lambda/`
42
- : `dist/lambda/${simpleLambdaName}`;
43
- return new AssetCode(lambdaPath);
39
+ function getAssetCode(simpleLambdaName) {
40
+ return new AssetCode(`dist/lambda/${simpleLambdaName}`);
44
41
  }
45
42
  export function defaultLambdaConfiguration(config) {
46
43
  const props = {
@@ -88,9 +88,8 @@ export class DtLogger {
88
88
  */
89
89
  log(message) {
90
90
  // Append always method to message
91
- if (!message.message ||
92
- !message.message.length ||
93
- !message.message.includes(message.method)) {
91
+ if (!message.message?.length ||
92
+ !message.message?.includes(message.method)) {
94
93
  message.message = `${message.method} ${message.message ?? ""}`;
95
94
  }
96
95
  const error = message.error
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitraffic/common",
3
- "version": "2026.4.17-2",
3
+ "version": "2026.4.20-1",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "repository": {
@@ -124,7 +124,6 @@
124
124
  "@types/etag": "1.8.4",
125
125
  "@types/geojson": "7946.0.16",
126
126
  "@types/geojson-validation": "1.0.3",
127
- "@types/lodash-es": "4.17.12",
128
127
  "@types/madge": "5.0.3",
129
128
  "@types/node": "24.12.2",
130
129
  "@vitest/coverage-v8": "4.1.4",
@@ -137,7 +136,6 @@
137
136
  "geojson-validation": "1.0.2",
138
137
  "ky": "1.14.3",
139
138
  "lefthook": "2.1.5",
140
- "lodash-es": "4.18.1",
141
139
  "madge": "8.0.0",
142
140
  "pg-native": "3.7.0",
143
141
  "pg-promise": "12.6.2",
@@ -165,7 +163,6 @@
165
163
  "es-toolkit": "1.45.1",
166
164
  "geojson-validation": "1.0.2",
167
165
  "ky": "1.14.3",
168
- "lodash-es": "4.18.1",
169
166
  "pg-native": "3.7.0",
170
167
  "pg-promise": "12.6.2",
171
168
  "zod": "4.3.6"