@digitraffic/common 2026.3.17-2 → 2026.3.26-1-beta

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.
package/README.md CHANGED
@@ -42,12 +42,29 @@ Format code
42
42
 
43
43
  ## Update deps
44
44
 
45
- This project uses exact dependency versions (no semver ranges). To update all dependencies to the latest versions:
45
+ This project uses exact dependency versions (no semver ranges)
46
+ and it has 7 days cooldown defined in [.npmrc](.npmrc)
47
+
48
+ To update all dependencies to the latest versions:
46
49
 
47
50
  ```bash
48
51
  pnpm up --latest
49
52
  ```
50
53
 
54
+ To update both normal dependencies and `peerDependencies` in one command, use:
55
+
56
+ ```bash
57
+ pnpm deps:update-all
58
+ ```
59
+
60
+ What `pnpm deps:update-all` does:
61
+ - Runs `pnpm up --latest`.
62
+ - Reads all keys from `peerDependencies` in `package.json`.
63
+ - Runs `pnpm add --save-peer --save-exact <name>@latest ...` for those packages.
64
+ - Updates `.npmrc` `use-node-version` to the newest Node release that is older than `minimum-release-age` and matches `engines.node`.
65
+
66
+ The command uses `scripts/update-deps-and-peers.ts` and is executed with Node's TypeScript type-stripping support (`node --experimental-strip-types`).
67
+
51
68
  After updating, run `pnpm audit` to check for vulnerabilities. If vulnerabilities exist in transitive dependencies, you may need to add overrides in `package.json` and/or exclusions in `.npmrc`. See [DEPENDENCY_OVERRIDES.md](./DEPENDENCY_OVERRIDES.md) for details.
52
69
 
53
70
  ## Publishing to [npmjs.com](https://www.npmjs.com/)
@@ -1,3 +1,4 @@
1
+ import type { Stack } from "aws-cdk-lib";
1
2
  import { Duration } from "aws-cdk-lib";
2
3
  import type { ISecurityGroup } from "aws-cdk-lib/aws-ec2";
3
4
  import type { IRole } from "aws-cdk-lib/aws-iam";
@@ -6,7 +7,7 @@ import type { ILayerVersion } from "aws-cdk-lib/aws-lambda";
6
7
  import { Architecture, Function as AwsFunction, Code, Runtime } from "aws-cdk-lib/aws-lambda";
7
8
  import { DtFunctionAlarms } from "./dt-function-alarms.js";
8
9
  import type { LambdaEnvironment } from "./lambda-configs.js";
9
- import type { DigitrafficStack } from "./stack.js";
10
+ import type { DigitrafficStackLike } from "./stack.js";
10
11
  export declare class FunctionBuilder {
11
12
  private readonly _stack;
12
13
  private readonly _name;
@@ -28,16 +29,16 @@ export declare class FunctionBuilder {
28
29
  private readonly policyStatements;
29
30
  private readonly allowedActions;
30
31
  private readonly _features;
31
- constructor(stack: DigitrafficStack, lambdaName: string);
32
+ constructor(stack: Stack & DigitrafficStackLike, lambdaName: string);
32
33
  /**
33
34
  * Creates a new builder with defaults, using the lambdaName as a source for the lambda implementation (dist/lambdaName/lambdaName.js).
34
35
  * Database access is given by default.
35
36
  */
36
- static create(stack: DigitrafficStack, lambdaName: string): FunctionBuilder;
37
+ static create(stack: Stack & DigitrafficStackLike, lambdaName: string): FunctionBuilder;
37
38
  /**
38
39
  * Creates a new builder with defaults, but without database or secret access.
39
40
  */
40
- static plain(stack: DigitrafficStack, lambdaName: string): FunctionBuilder;
41
+ static plain(stack: Stack & DigitrafficStackLike, lambdaName: string): FunctionBuilder;
41
42
  /**
42
43
  * Stack only has one lambda. Default is that it has multiple lambdas.
43
44
  */
@@ -1,6 +1,6 @@
1
1
  import type { Stack } from "aws-cdk-lib";
2
2
  import { LogGroup, RetentionDays } from "aws-cdk-lib/aws-logs";
3
- import type { DigitrafficStack } from "./stack.js";
3
+ import type { DigitrafficStackLike } from "./stack.js";
4
4
  export interface CreateLambdaLogGroupParams {
5
5
  functionName: string;
6
6
  retention?: RetentionDays;
@@ -10,6 +10,6 @@ export interface CreateLambdaLogGroupParamsForStack extends CreateLambdaLogGroup
10
10
  shortName: string;
11
11
  }
12
12
  export interface CreateLambdaLogGroupParamsForDigitrafficStack extends CreateLambdaLogGroupParams {
13
- stack: DigitrafficStack;
13
+ stack: Stack & DigitrafficStackLike;
14
14
  }
15
15
  export declare function createLambdaLogGroup(params: CreateLambdaLogGroupParamsForStack | CreateLambdaLogGroupParamsForDigitrafficStack): LogGroup;
@@ -1,3 +1,4 @@
1
+ import type { Stack } from "aws-cdk-lib";
1
2
  import type { IResource, JsonSchema, Resource, ResourceOptions, RestApiProps } from "aws-cdk-lib/aws-apigateway";
2
3
  import { RestApi } from "aws-cdk-lib/aws-apigateway";
3
4
  import { PolicyDocument } from "aws-cdk-lib/aws-iam";
@@ -5,7 +6,7 @@ import { StringParameter } from "aws-cdk-lib/aws-ssm";
5
6
  import type { Construct } from "constructs";
6
7
  import type { ModelWithReference } from "../../types/model-with-reference.js";
7
8
  import type { DocumentationPart } from "../documentation.js";
8
- import type { DigitrafficStack } from "./stack.js";
9
+ import type { DigitrafficStackLike } from "./stack.js";
9
10
  export declare const PUBLIC_REST_API_CORS_CONFIG: {
10
11
  readonly defaultCorsPreflightOptions: {
11
12
  readonly allowOrigins: string[];
@@ -23,7 +24,7 @@ export declare class DigitrafficRestApi extends RestApi {
23
24
  readonly apiKeyIds: string[];
24
25
  readonly enableDocumentation: boolean;
25
26
  private readonly _stack;
26
- constructor(stack: DigitrafficStack, apiId: string, apiName: string, allowFromIpAddresses?: string[] | undefined, config?: Partial<RestApiProps>);
27
+ constructor(stack: Stack & DigitrafficStackLike, apiId: string, apiName: string, allowFromIpAddresses?: string[] | undefined, config?: Partial<RestApiProps>);
27
28
  hostname(): string;
28
29
  /** Export end point and api key to Parameter store */
29
30
  exportEndpoint(): [StringParameter, StringParameter];
@@ -29,7 +29,18 @@ export interface StackConfiguration {
29
29
  };
30
30
  readonly whitelistedResources?: string[];
31
31
  }
32
- export declare class DigitrafficStack extends Stack {
32
+ export interface DigitrafficStackLike {
33
+ readonly configuration: StackConfiguration;
34
+ readonly vpc?: IVpc;
35
+ readonly lambdaDbSg?: ISecurityGroup;
36
+ readonly alarmTopic: ITopic;
37
+ readonly warningTopic: ITopic;
38
+ createLambdaEnvironment(): DBLambdaEnvironment;
39
+ createDefaultLambdaEnvironment(dbApplication: string): DBLambdaEnvironment;
40
+ getSecret(): ISecret;
41
+ grantSecret(...lambdas: AWSFunction[]): void;
42
+ }
43
+ export declare class DigitrafficStack extends Stack implements DigitrafficStackLike {
33
44
  readonly vpc?: IVpc;
34
45
  readonly lambdaDbSg?: ISecurityGroup;
35
46
  readonly alarmTopic: ITopic;
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export type { DigitrafficStackLike } from "./aws/infra/stack/stack.js";
1
2
  export { DigitrafficStack } from "./aws/infra/stack/stack.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitraffic/common",
3
- "version": "2026.3.17-2",
3
+ "version": "2026.3.26-1-beta",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "repository": {
@@ -108,39 +108,40 @@
108
108
  "dist/**/*.d.ts"
109
109
  ],
110
110
  "devDependencies": {
111
- "@aws-sdk/client-api-gateway": "3.998.0",
112
- "@aws-sdk/client-s3": "3.998.0",
113
- "@aws-sdk/client-secrets-manager": "3.998.0",
114
- "@aws-sdk/client-sns": "3.998.0",
115
- "@aws-sdk/lib-storage": "3.998.0",
116
- "@biomejs/biome": "2.4.4",
111
+ "@aws-sdk/client-api-gateway": "3.1004.0",
112
+ "@aws-sdk/client-s3": "3.1003.0",
113
+ "@aws-sdk/client-secrets-manager": "3.1003.0",
114
+ "@aws-sdk/client-sns": "3.1003.0",
115
+ "@aws-sdk/lib-storage": "3.1003.0",
116
+ "@biomejs/biome": "2.4.6",
117
117
  "@date-fns/tz": "1.4.1",
118
118
  "@rushstack/heft": "1.2.6",
119
119
  "@rushstack/heft-typescript-plugin": "1.3.1",
120
- "@smithy/fetch-http-handler": "5.3.11",
120
+ "@smithy/fetch-http-handler": "5.3.13",
121
+ "@smithy/node-http-handler": "4.4.14",
121
122
  "@smithy/types": "4.13.0",
122
- "@types/aws-lambda": "8.10.160",
123
+ "@types/aws-lambda": "8.10.161",
123
124
  "@types/etag": "1.8.4",
124
125
  "@types/geojson": "7946.0.16",
125
126
  "@types/geojson-validation": "1.0.3",
126
127
  "@types/lodash-es": "4.17.12",
127
128
  "@types/madge": "5.0.3",
128
- "@types/node": "25.3.1",
129
+ "@types/node": "25.3.5",
129
130
  "@vitest/coverage-v8": "4.0.18",
130
- "aws-cdk-lib": "2.240.0",
131
+ "aws-cdk-lib": "2.241.0",
131
132
  "change-case": "5.4.4",
132
133
  "constructs": "10.5.1",
133
134
  "date-fns": "4.1.0",
134
- "es-toolkit": "1.44.0",
135
+ "es-toolkit": "1.45.1",
135
136
  "etag": "1.8.1",
136
137
  "geojson-validation": "1.0.2",
137
138
  "ky": "1.14.3",
138
- "lefthook": "2.1.1",
139
+ "lefthook": "2.1.2",
139
140
  "lodash-es": "4.17.23",
140
141
  "madge": "8.0.0",
141
- "pg-native": "3.6.0",
142
- "pg-promise": "12.6.1",
143
- "pg-query-stream": "4.13.0",
142
+ "pg-native": "3.7.0",
143
+ "pg-promise": "12.6.2",
144
+ "pg-query-stream": "4.14.0",
144
145
  "rimraf": "6.1.3",
145
146
  "sort-package-json": "3.6.1",
146
147
  "typescript": "5.9.3",
@@ -149,24 +150,24 @@
149
150
  "zod": "4.3.6"
150
151
  },
151
152
  "peerDependencies": {
152
- "@aws-sdk/client-api-gateway": "3.975.0",
153
- "@aws-sdk/client-s3": "3.975.0",
154
- "@aws-sdk/client-secrets-manager": "3.975.0",
155
- "@aws-sdk/client-sns": "3.975.0",
156
- "@aws-sdk/lib-storage": "3.975.0",
153
+ "@aws-sdk/client-api-gateway": "3.1004.0",
154
+ "@aws-sdk/client-s3": "3.1003.0",
155
+ "@aws-sdk/client-secrets-manager": "3.1003.0",
156
+ "@aws-sdk/client-sns": "3.1003.0",
157
+ "@aws-sdk/lib-storage": "3.1003.0",
157
158
  "@date-fns/tz": "1.4.1",
158
- "@smithy/fetch-http-handler": "5.3.9",
159
- "@smithy/node-http-handler": "4.4.8",
160
- "aws-cdk-lib": "2.236.0",
159
+ "@smithy/fetch-http-handler": "5.3.13",
160
+ "@smithy/node-http-handler": "4.4.14",
161
+ "aws-cdk-lib": "2.241.0",
161
162
  "change-case": "5.4.4",
162
- "constructs": "10.4.5",
163
+ "constructs": "10.5.1",
163
164
  "date-fns": "4.1.0",
164
- "es-toolkit": "1.44.0",
165
+ "es-toolkit": "1.45.1",
165
166
  "geojson-validation": "1.0.2",
166
167
  "ky": "1.14.3",
167
168
  "lodash-es": "4.17.23",
168
- "pg-native": "3.5.2",
169
- "pg-promise": "12.3.0",
169
+ "pg-native": "3.7.0",
170
+ "pg-promise": "12.6.2",
170
171
  "zod": "4.3.6"
171
172
  },
172
173
  "engines": {
@@ -176,6 +177,7 @@
176
177
  "build": "heft build --clean",
177
178
  "build:watch": "heft build-watch",
178
179
  "ci:test": "vitest run --coverage --reporter=junit --outputFile=junit.xml",
180
+ "deps:update-all": "node --experimental-strip-types scripts/update-deps-and-peers.ts",
179
181
  "format:check": "biome check ",
180
182
  "format:check-staged": "biome check --staged",
181
183
  "format:fix": "biome check --write",