@digitraffic/common 2026.8.3-1 → 2026.8.6-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.
package/README.md CHANGED
@@ -1,13 +1,11 @@
1
1
  # Digitraffic-common
2
2
 
3
- This is a place for common utilities and classes that can be used in other
4
- cdk-projects.
3
+ This is a place for common utilities and classes that can be used in other cdk-projects.
5
4
 
6
5
  ## Setup
7
6
 
8
- Initialize the project scripts by running the following command. This only needs
9
- to be done once, after cloning or pulling the repository for the first time. It
10
- will install/reinstall lefthook git hooks.
7
+ Initialize the project scripts by running the following command. This only needs to be done once, after cloning or
8
+ pulling the repository for the first time. It will install/reinstall lefthook git hooks.
11
9
 
12
10
  ```shell
13
11
  pnpm run setup
@@ -43,40 +41,83 @@ Format code
43
41
  ## Update deps
44
42
 
45
43
  This project uses exact dependency versions (no semver ranges)
46
- and it has 7 days cooldown defined in [.npmrc](.npmrc)
44
+ and has a 7-day cooldown defined in [.npmrc](.npmrc).
45
+
46
+ ### Full update workflow
47
+
48
+ 1. **Update all dependencies** (deps, peerDeps, and Node version in `.npmrc`):
49
+ ```bash
50
+ pnpm deps:update-all
51
+ ```
52
+ This updates `package.json`, `pnpm-lock.yaml`, and installs everything in one step — no separate `pnpm install`
53
+ needed. What `pnpm deps:update-all` does:
54
+ - Runs `pnpm up --latest` for all packages **except** those listed in
55
+ `pnpm.updateConfig.ignoredPackages` in `package.json` (e.g. `typescript`, `@types/node`)
56
+ - Updates all `peerDependencies` to latest (same exclusions apply)
57
+ - Updates `.npmrc` `use-node-version` to the newest Node release that is older than `minimum-release-age` and
58
+ matches `engines.node`
59
+
60
+ See `scripts/update-deps-and-peers.ts` for implementation details.
61
+
62
+ Also **update `packageManager` manually** — it is not touched by the script.
63
+ Check the latest pnpm 10.x version (older than 7 days) at
64
+ https://www.npmjs.com/package/pnpm?activeTab=versions and update `package.json`:
65
+ ```json
66
+ "packageManager": "pnpm@10.x.x"
67
+ ```
68
+ See [DEPENDENCY_OVERRIDES.md](./DEPENDENCY_OVERRIDES.md#4-pnpm-version-packagemanager-field) for details.
69
+
70
+ 2. **Check for vulnerabilities:**
71
+ ```bash
72
+ pnpm audit
73
+ ```
74
+ If vulnerabilities are reported in transitive dependencies, add or update overrides in
75
+ `package.json` and/or exclusions in `.npmrc`.
76
+
77
+ 3. **Check if existing overrides can be removed** — existing overrides may no longer be needed if upstream dependencies
78
+ now pull in a safe version. Test each override by temporarily removing it, reinstalling, and re-running `pnpm audit`:
79
+ ```bash
80
+ # Remove the override from package.json, then do a fresh resolution:
81
+ rm -rf node_modules pnpm-lock.yaml && pnpm install
82
+ pnpm audit
83
+ ```
84
+ If no vulnerabilities are reported, the override is no longer needed — keep it removed. If vulnerabilities reappear,
85
+ restore the override. See [DEPENDENCY_OVERRIDES.md](./DEPENDENCY_OVERRIDES.md) for details.
86
+
87
+ 4. **Build and test:**
88
+ ```bash
89
+ pnpm run build
90
+ pnpm run test
91
+ ```
92
+
93
+ 5. **Commit and open a pull request**
94
+
95
+ Do the work on a feature branch so changes can be reviewed before merging.
96
+
97
+ 6. **Publish a new version** — once the pull request is merged to master, publish so
98
+ downstream projects pick up the changes (especially important for security fixes):
99
+ ```bash
100
+ ./scripts/publish.sh
101
+ ```
102
+ See [Publishing to npmjs.com](#publishing-to-npmjscom) below for details.
103
+
104
+ See [DEPENDENCY_OVERRIDES.md](./DEPENDENCY_OVERRIDES.md) for detailed instructions on adding, updating, and removing
105
+ overrides and `.npmrc` exclusions.
47
106
 
48
- To update all dependencies to the latest versions:
107
+ ## Publishing to [npmjs.com](https://www.npmjs.com/)
49
108
 
50
- ```bash
51
- pnpm up --latest
52
- pnpm audit # -> fix high
53
- ```
109
+ See https://www.npmjs.com/package/@digitraffic/common
54
110
 
55
- To update both normal dependencies and `peerDependencies` in one command, use:
111
+ To publish using today's date as the version number:
56
112
 
57
113
  ```bash
58
- pnpm deps:update-all
59
- pnpm audit # -> fix high
114
+ ./scripts/publish.sh
60
115
  ```
61
116
 
62
- What `pnpm deps:update-all` does:
63
- - Runs `pnpm up --latest`.
64
- - Reads all keys from `peerDependencies` in `package.json`.
65
- - Runs `pnpm add --save-peer --save-exact <name>@latest ...` for those packages.
66
- - Updates `.npmrc` `use-node-version` to the newest Node release that is older than `minimum-release-age` and matches `engines.node`.
67
-
68
- The command uses `scripts/update-deps-and-peers.ts` and is executed with Node's TypeScript type-stripping support (`node --experimental-strip-types`).
69
-
70
- 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.
71
-
72
- ## Publishing to [npmjs.com](https://www.npmjs.com/)
73
-
74
- See https://www.npmjs.com/package/@digitraffic/common
75
-
76
- Run the following command to publish a new version:
117
+ To publish with a specific version number:
77
118
 
78
119
  ```bash
79
- ./scripts/publish.sh 2026.3.5-1
120
+ ./scripts/publish.sh 2026.8.6-1
80
121
  ```
81
122
 
82
123
  ## How to use
@@ -107,30 +148,27 @@ If you do not need those things, you should not use DigitrafficStack.
107
148
 
108
149
  ### StackConfiguration
109
150
 
110
- Some commonly used parameters is predefined configuration. You can write
111
- configuration for your environments once and use across cdk-projects.
151
+ Commonly used parameters are predefined in `StackConfiguration`. Write the configuration for your environments once and reuse it across cdk-projects.
112
152
 
113
153
  ### StackCheckingAspect
114
154
 
115
155
  Uses cdk aspects to do some sanity checking for your cdk stack:
116
156
 
117
- - Stack naming check(Test/Prod in name)
118
- - Function configuration(memory, timeout, runtime, reservedConcurrency)
157
+ - Stack naming check (Test/Prod in name)
158
+ - Function configuration (memory, timeout, runtime, reservedConcurrency)
119
159
  - Tags, must have Solution tag defined
120
160
  - S3 Buckets, no public access
121
- - Api Gateway resource casing(kebabCase and snake_case)
161
+ - Api Gateway resource casing (kebabCase and snake_case)
122
162
  - Queue encrypting
123
163
  - LogGroup Retention
124
164
 
125
- You can use StackCheckingAspect for any stack, DigitrafficStack does it
126
- automatically, but you can call it manually:
165
+ You can use StackCheckingAspect for any stack, DigitrafficStack does it automatically, but you can call it manually:
127
166
 
128
167
  ```
129
168
  Aspects.of(this).add(StackCheckingAspect.create(this));
130
169
  ```
131
170
 
132
- Any resource can be whitelisted by giving it as a parameter or in the
133
- StackConfiguration
171
+ Any resource can be whitelisted by giving it as a parameter or in the StackConfiguration
134
172
 
135
173
  ### FunctionBuilder
136
174
 
@@ -139,6 +177,7 @@ FunctionBuilder allows you to make lambdas with alarms on memory usage and timeo
139
177
  By default, the created function has access to database, but this can of course be controlled.
140
178
 
141
179
  Creating lambda is easy:
180
+
142
181
  ```
143
182
  const lambda = FunctionBuilder.create(stack, "get-metadata")
144
183
  .withTimeout(Duration.seconds(2))
@@ -1,314 +1,92 @@
1
1
  import { expect, test } from "vitest";
2
- test("index import ok?", () => {
3
- const index = import("../index.js");
4
- return expect(index).resolves.toBeDefined();
5
- });
6
- test("database import ok?", () => {
7
- const database = import("../database/database.js");
8
- return expect(database).resolves.toBeDefined();
9
- });
10
- test("models import ok?", () => {
11
- const models = import("../database/models.js");
12
- return expect(models).resolves.toBeDefined();
13
- });
14
- test("lastUpdated import ok?", () => {
15
- const lastUpdated = import("../database/last-updated.js");
16
- return expect(lastUpdated).resolves.toBeDefined();
17
- });
18
- test("urn import ok?", () => {
19
- const urn = import("../types/urn.js");
20
- return expect(urn).resolves.toBeDefined();
21
- });
22
- test("utilTypes import ok?", () => {
23
- const utilTypes = import("../types/util-types.js");
24
- return expect(utilTypes).resolves.toBeDefined();
25
- });
26
- test("either import ok?", () => {
27
- const either = import("../types/either.js");
28
- return expect(either).resolves.toBeDefined();
29
- });
30
- test("validator import ok?", () => {
31
- const validator = import("../types/validator.js");
32
- return expect(validator).resolves.toBeDefined();
33
- });
34
- test("nullable import ok?", () => {
35
- const nullable = import("../types/nullable.js");
36
- return expect(nullable).resolves.toBeDefined();
37
- });
38
- test("asyncTimeoutError import ok?", () => {
39
- const asyncTimeoutError = import("../types/async-timeout-error.js");
40
- return expect(asyncTimeoutError).resolves.toBeDefined();
41
- });
42
- test("inputError import ok?", () => {
43
- const inputError = import("../types/input-error.js");
44
- return expect(inputError).resolves.toBeDefined();
45
- });
46
- test("httpError import ok?", () => {
47
- const httpError = import("../types/http-error.js");
48
- return expect(httpError).resolves.toBeDefined();
49
- });
50
- test("language import ok?", () => {
51
- const language = import("../types/language.js");
52
- return expect(language).resolves.toBeDefined();
53
- });
54
- test("traffictype import ok?", () => {
55
- const traffictype = import("../types/traffictype.js");
56
- return expect(traffictype).resolves.toBeDefined();
57
- });
58
- test("testutils import ok?", () => {
59
- const testutils = import("../__test__/testutils.js");
60
- return expect(testutils).resolves.toBeDefined();
61
- });
62
- test("dbTestutils import ok?", () => {
63
- const dbTestutils = import("../__test__/db-testutils.js");
64
- return expect(dbTestutils).resolves.toBeDefined();
65
- });
66
- test("asserter import ok?", () => {
67
- const asserter = import("../__test__/asserter.js");
68
- return expect(asserter).resolves.toBeDefined();
69
- });
70
- test("rtz import ok?", () => {
71
- const rtz = import("../marine/rtz.js");
72
- return expect(rtz).resolves.toBeDefined();
73
- });
74
- test("idUtils import ok?", () => {
75
- const idUtils = import("../marine/id_utils.js");
76
- return expect(idUtils).resolves.toBeDefined();
77
- });
78
- test("apiModel import ok?", () => {
79
- const apiModel = import("../utils/api-model.js");
80
- return expect(apiModel).resolves.toBeDefined();
81
- });
82
- test("logging import ok?", () => {
83
- const logging = import("../utils/logging.js");
84
- return expect(logging).resolves.toBeDefined();
85
- });
86
- test("base64 import ok?", () => {
87
- const base64 = import("../utils/base64.js");
88
- return expect(base64).resolves.toBeDefined();
89
- });
90
- test("dateUtils import ok?", () => {
91
- const dateUtils = import("../utils/date-utils.js");
92
- return expect(dateUtils).resolves.toBeDefined();
93
- });
94
- test("geojsonTypes import ok?", () => {
95
- const geojsonTypes = import("../utils/geojson-types.js");
96
- return expect(geojsonTypes).resolves.toBeDefined();
97
- });
98
- test("slack import ok?", () => {
99
- const slack = import("../utils/slack.js");
100
- return expect(slack).resolves.toBeDefined();
101
- });
102
- test("stopWatch import ok?", () => {
103
- const stopWatch = import("../utils/stop-watch.js");
104
- return expect(stopWatch).resolves.toBeDefined();
105
- });
106
- test("utils import ok?", () => {
107
- const utils = import("../utils/utils.js");
108
- return expect(utils).resolves.toBeDefined();
109
- });
110
- test("retry import ok?", () => {
111
- const retry = import("../utils/retry.js");
112
- return expect(retry).resolves.toBeDefined();
113
- });
114
- test("geometry import ok?", () => {
115
- const geometry = import("../utils/geometry.js");
116
- return expect(geometry).resolves.toBeDefined();
117
- });
118
- test("sqsIntegration import ok?", () => {
119
- const sqsIntegration = import("../aws/infra/sqs-integration.js");
120
- return expect(sqsIntegration).resolves.toBeDefined();
121
- });
122
- test("networkStack import ok?", () => {
123
- const networkStack = import("../aws/infra/stacks/network-stack.js");
124
- return expect(networkStack).resolves.toBeDefined();
125
- });
126
- test("dbStack import ok?", () => {
127
- const dbStack = import("../aws/infra/stacks/db-stack.js");
128
- return expect(dbStack).resolves.toBeDefined();
129
- });
130
- test("dbProxyStack import ok?", () => {
131
- const dbProxyStack = import("../aws/infra/stacks/db-proxy-stack.js");
132
- return expect(dbProxyStack).resolves.toBeDefined();
133
- });
134
- test("intraStackConfiguration import ok?", () => {
135
- const intraStackConfiguration = import("../aws/infra/stacks/intra-stack-configuration.js");
136
- return expect(intraStackConfiguration).resolves.toBeDefined();
137
- });
138
- test("dbDnsStack import ok?", () => {
139
- const dbDnsStack = import("../aws/infra/stacks/db-dns-stack.js");
140
- return expect(dbDnsStack).resolves.toBeDefined();
141
- });
142
- test("documentation import ok?", () => {
143
- const documentation = import("../aws/infra/documentation.js");
144
- return expect(documentation).resolves.toBeDefined();
145
- });
146
- test("usagePlans import ok?", () => {
147
- const usagePlans = import("../aws/infra/usage-plans.js");
148
- return expect(usagePlans).resolves.toBeDefined();
149
- });
150
- test("scheduler import ok?", () => {
151
- const scheduler = import("../aws/infra/scheduler.js");
152
- return expect(scheduler).resolves.toBeDefined();
153
- });
154
- test("importUtil import ok?", () => {
155
- const importUtil = import("../aws/infra/import-util.js");
156
- return expect(importUtil).resolves.toBeDefined();
157
- });
158
- test("sqsQueue import ok?", () => {
159
- const sqsQueue = import("../aws/infra/sqs-queue.js");
160
- return expect(sqsQueue).resolves.toBeDefined();
161
- });
162
- test("response import ok?", () => {
163
- const response = import("../aws/infra/api/response.js");
164
- return expect(response).resolves.toBeDefined();
165
- });
166
- test("staticIntegration import ok?", () => {
167
- const staticIntegration = import("../aws/infra/api/static-integration.js");
168
- return expect(staticIntegration).resolves.toBeDefined();
169
- });
170
- test("responses import ok?", () => {
171
- const responses = import("../aws/infra/api/responses.js");
172
- return expect(responses).resolves.toBeDefined();
173
- });
174
- test("handlerFactory import ok?", () => {
175
- const handlerFactory = import("../aws/infra/api/handler-factory.js");
176
- return expect(handlerFactory).resolves.toBeDefined();
177
- });
178
- test("integration import ok?", () => {
179
- const integration = import("../aws/infra/api/integration.js");
180
- return expect(integration).resolves.toBeDefined();
181
- });
182
- test("stackCheckingAspect import ok?", () => {
183
- const stackCheckingAspect = import("../aws/infra/stack/stack-checking-aspect.js");
184
- return expect(stackCheckingAspect).resolves.toBeDefined();
185
- });
186
- test("restApis import ok?", () => {
187
- const restApis = import("../aws/infra/stack/rest-api.js");
188
- return expect(restApis).resolves.toBeDefined();
189
- });
190
- test("lambdaConfigs import ok?", () => {
191
- const lambdaConfigs = import("../aws/infra/stack/lambda-configs.js");
192
- return expect(lambdaConfigs).resolves.toBeDefined();
193
- });
194
- test("monitoredfunction import ok?", () => {
195
- const monitoredfunction = import("../aws/infra/stack/monitoredfunction.js");
196
- return expect(monitoredfunction).resolves.toBeDefined();
197
- });
198
- test("subscription import ok?", () => {
199
- const subscription = import("../aws/infra/stack/subscription.js");
200
- return expect(subscription).resolves.toBeDefined();
201
- });
202
- test("parameters import ok?", () => {
203
- const parameters = import("../aws/infra/stack/parameters.js");
204
- return expect(parameters).resolves.toBeDefined();
205
- });
206
- test("stack import ok?", () => {
207
- const stack = import("../aws/infra/stack/stack.js");
208
- return expect(stack).resolves.toBeDefined();
209
- });
210
- test("securityRule import ok?", () => {
211
- const securityRule = import("../aws/infra/security-rule.js");
212
- return expect(securityRule).resolves.toBeDefined();
213
- });
214
- test("canary import ok?", () => {
215
- const canary = import("../aws/infra/canaries/canary.js");
216
- return expect(canary).resolves.toBeDefined();
217
- });
218
- test("databaseCanary import ok?", () => {
219
- const databaseCanary = import("../aws/infra/canaries/database-canary.js");
220
- return expect(databaseCanary).resolves.toBeDefined();
221
- });
222
- test("canaryAlarm import ok?", () => {
223
- const canaryAlarm = import("../aws/infra/canaries/canary-alarm.js");
224
- return expect(canaryAlarm).resolves.toBeDefined();
225
- });
226
- test("canaryRole import ok?", () => {
227
- const canaryRole = import("../aws/infra/canaries/canary-role.js");
228
- return expect(canaryRole).resolves.toBeDefined();
229
- });
230
- test("urlCanary import ok?", () => {
231
- const urlCanary = import("../aws/infra/canaries/url-canary.js");
232
- return expect(urlCanary).resolves.toBeDefined();
233
- });
234
- test("canaryParameters import ok?", () => {
235
- const canaryParameters = import("../aws/infra/canaries/canary-parameters.js");
236
- return expect(canaryParameters).resolves.toBeDefined();
237
- });
238
- test("canaryKeys import ok?", () => {
239
- const canaryKeys = import("../aws/infra/canaries/canary-keys.js");
240
- return expect(canaryKeys).resolves.toBeDefined();
241
- });
242
- test("lambda-proxy-types import ok?", () => {
243
- const proxytypes = import("../aws/types/lambda-proxy-types.js");
244
- return expect(proxytypes).resolves.toBeDefined();
245
- });
246
- test("tags import ok?", () => {
247
- const tags = import("../aws/types/tags.js");
248
- return expect(tags).resolves.toBeDefined();
249
- });
250
- test("mediatypes import ok?", () => {
251
- const mediatypes = import("../aws/types/mediatypes.js");
252
- return expect(mediatypes).resolves.toBeDefined();
253
- });
254
- test("modelWithReference import ok?", () => {
255
- const modelWithReference = import("../aws/types/model-with-reference.js");
256
- return expect(modelWithReference).resolves.toBeDefined();
257
- });
258
- test("errors import ok?", () => {
259
- const errors = import("../aws/types/errors.js");
260
- return expect(errors).resolves.toBeDefined();
261
- });
262
- test("lambdaResponse import ok?", () => {
263
- const lambdaResponse = import("../aws/types/lambda-response.js");
264
- return expect(lambdaResponse).resolves.toBeDefined();
265
- });
266
- test("dtLoggerDefault import ok?", () => {
267
- const dtLoggerDefault = import("../aws/runtime/dt-logger-default.js");
268
- return expect(dtLoggerDefault).resolves.toBeDefined();
269
- });
270
- test("secret import ok?", () => {
271
- const secret = import("../aws/runtime/secrets/secret.js");
272
- return expect(secret).resolves.toBeDefined();
273
- });
274
- test("proxyHolder import ok?", () => {
275
- const proxyHolder = import("../aws/runtime/secrets/proxy-holder.js");
276
- return expect(proxyHolder).resolves.toBeDefined();
277
- });
278
- test("dbsecret import ok?", () => {
279
- const dbsecret = import("../aws/runtime/secrets/dbsecret.js");
280
- return expect(dbsecret).resolves.toBeDefined();
281
- });
282
- test("rdsHolder import ok?", () => {
283
- const rdsHolder = import("../aws/runtime/secrets/rds-holder.js");
284
- return expect(rdsHolder).resolves.toBeDefined();
285
- });
286
- test("secretHolder import ok?", () => {
287
- const secretHolder = import("../aws/runtime/secrets/secret-holder.js");
288
- return expect(secretHolder).resolves.toBeDefined();
289
- });
290
- test("dtLogger import ok?", () => {
291
- const dtLogger = import("../aws/runtime/dt-logger.js");
292
- return expect(dtLogger).resolves.toBeDefined();
293
- });
294
- test("s3 import ok?", () => {
295
- const s3 = import("../aws/runtime/s3.js");
296
- return expect(s3).resolves.toBeDefined();
297
- });
2
+ const IMPORT_TEST_TIMEOUT_MS = 15_000;
3
+ function expectImportOk(name, path) {
4
+ test(name, async () => {
5
+ await expect(import(path)).resolves.toBeDefined();
6
+ }, IMPORT_TEST_TIMEOUT_MS);
7
+ }
8
+ expectImportOk("index import ok?", "../index.js");
9
+ expectImportOk("database import ok?", "../database/database.js");
10
+ expectImportOk("models import ok?", "../database/models.js");
11
+ expectImportOk("lastUpdated import ok?", "../database/last-updated.js");
12
+ expectImportOk("urn import ok?", "../types/urn.js");
13
+ expectImportOk("utilTypes import ok?", "../types/util-types.js");
14
+ expectImportOk("either import ok?", "../types/either.js");
15
+ expectImportOk("validator import ok?", "../types/validator.js");
16
+ expectImportOk("nullable import ok?", "../types/nullable.js");
17
+ expectImportOk("asyncTimeoutError import ok?", "../types/async-timeout-error.js");
18
+ expectImportOk("inputError import ok?", "../types/input-error.js");
19
+ expectImportOk("httpError import ok?", "../types/http-error.js");
20
+ expectImportOk("language import ok?", "../types/language.js");
21
+ expectImportOk("traffictype import ok?", "../types/traffictype.js");
22
+ expectImportOk("testutils import ok?", "../__test__/testutils.js");
23
+ expectImportOk("dbTestutils import ok?", "../__test__/db-testutils.js");
24
+ expectImportOk("asserter import ok?", "../__test__/asserter.js");
25
+ expectImportOk("rtz import ok?", "../marine/rtz.js");
26
+ expectImportOk("idUtils import ok?", "../marine/id_utils.js");
27
+ expectImportOk("apiModel import ok?", "../utils/api-model.js");
28
+ expectImportOk("logging import ok?", "../utils/logging.js");
29
+ expectImportOk("base64 import ok?", "../utils/base64.js");
30
+ expectImportOk("dateUtils import ok?", "../utils/date-utils.js");
31
+ expectImportOk("geojsonTypes import ok?", "../utils/geojson-types.js");
32
+ expectImportOk("slack import ok?", "../utils/slack.js");
33
+ expectImportOk("stopWatch import ok?", "../utils/stop-watch.js");
34
+ expectImportOk("utils import ok?", "../utils/utils.js");
35
+ expectImportOk("retry import ok?", "../utils/retry.js");
36
+ expectImportOk("geometry import ok?", "../utils/geometry.js");
37
+ expectImportOk("sqsIntegration import ok?", "../aws/infra/sqs-integration.js");
38
+ expectImportOk("networkStack import ok?", "../aws/infra/stacks/network-stack.js");
39
+ expectImportOk("dbStack import ok?", "../aws/infra/stacks/db-stack.js");
40
+ expectImportOk("dbProxyStack import ok?", "../aws/infra/stacks/db-proxy-stack.js");
41
+ expectImportOk("intraStackConfiguration import ok?", "../aws/infra/stacks/intra-stack-configuration.js");
42
+ expectImportOk("dbDnsStack import ok?", "../aws/infra/stacks/db-dns-stack.js");
43
+ expectImportOk("documentation import ok?", "../aws/infra/documentation.js");
44
+ expectImportOk("usagePlans import ok?", "../aws/infra/usage-plans.js");
45
+ expectImportOk("scheduler import ok?", "../aws/infra/scheduler.js");
46
+ expectImportOk("importUtil import ok?", "../aws/infra/import-util.js");
47
+ expectImportOk("sqsQueue import ok?", "../aws/infra/sqs-queue.js");
48
+ expectImportOk("response import ok?", "../aws/infra/api/response.js");
49
+ expectImportOk("staticIntegration import ok?", "../aws/infra/api/static-integration.js");
50
+ expectImportOk("responses import ok?", "../aws/infra/api/responses.js");
51
+ expectImportOk("handlerFactory import ok?", "../aws/infra/api/handler-factory.js");
52
+ expectImportOk("integration import ok?", "../aws/infra/api/integration.js");
53
+ expectImportOk("stackCheckingAspect import ok?", "../aws/infra/stack/stack-checking-aspect.js");
54
+ expectImportOk("restApis import ok?", "../aws/infra/stack/rest-api.js");
55
+ expectImportOk("lambdaConfigs import ok?", "../aws/infra/stack/lambda-configs.js");
56
+ expectImportOk("monitoredfunction import ok?", "../aws/infra/stack/monitoredfunction.js");
57
+ expectImportOk("subscription import ok?", "../aws/infra/stack/subscription.js");
58
+ expectImportOk("parameters import ok?", "../aws/infra/stack/parameters.js");
59
+ expectImportOk("stack import ok?", "../aws/infra/stack/stack.js");
60
+ expectImportOk("securityRule import ok?", "../aws/infra/security-rule.js");
61
+ expectImportOk("canary import ok?", "../aws/infra/canaries/canary.js");
62
+ expectImportOk("databaseCanary import ok?", "../aws/infra/canaries/database-canary.js");
63
+ expectImportOk("canaryAlarm import ok?", "../aws/infra/canaries/canary-alarm.js");
64
+ expectImportOk("canaryRole import ok?", "../aws/infra/canaries/canary-role.js");
65
+ expectImportOk("urlCanary import ok?", "../aws/infra/canaries/url-canary.js");
66
+ expectImportOk("canaryParameters import ok?", "../aws/infra/canaries/canary-parameters.js");
67
+ expectImportOk("canaryKeys import ok?", "../aws/infra/canaries/canary-keys.js");
68
+ expectImportOk("lambda-proxy-types import ok?", "../aws/types/lambda-proxy-types.js");
69
+ expectImportOk("tags import ok?", "../aws/types/tags.js");
70
+ expectImportOk("mediatypes import ok?", "../aws/types/mediatypes.js");
71
+ expectImportOk("modelWithReference import ok?", "../aws/types/model-with-reference.js");
72
+ expectImportOk("errors import ok?", "../aws/types/errors.js");
73
+ expectImportOk("lambdaResponse import ok?", "../aws/types/lambda-response.js");
74
+ expectImportOk("dtLoggerDefault import ok?", "../aws/runtime/dt-logger-default.js");
75
+ expectImportOk("secret import ok?", "../aws/runtime/secrets/secret.js");
76
+ expectImportOk("proxyHolder import ok?", "../aws/runtime/secrets/proxy-holder.js");
77
+ expectImportOk("dbsecret import ok?", "../aws/runtime/secrets/dbsecret.js");
78
+ expectImportOk("rdsHolder import ok?", "../aws/runtime/secrets/rds-holder.js");
79
+ expectImportOk("secretHolder import ok?", "../aws/runtime/secrets/secret-holder.js");
80
+ expectImportOk("dtLogger import ok?", "../aws/runtime/dt-logger.js");
81
+ expectImportOk("s3 import ok?", "../aws/runtime/s3.js");
298
82
  /*
299
83
  temporary disable, enable after sdk v2 is kicked out
300
84
  test('apikey import ok?', () => {
301
85
  const apikey = import("../aws/runtime/apikey.js");
302
86
  return expect(apikey).resolves.toBeDefined();
303
87
  });*/
304
- test("environment import ok?", () => {
305
- const environment = import("../aws/runtime/environment.js");
306
- return expect(environment).resolves.toBeDefined();
307
- });
308
- test("digitrafficIntegrationResponse import ok?", () => {
309
- const digitrafficIntegrationResponse = import("../aws/runtime/digitraffic-integration-response.js");
310
- return expect(digitrafficIntegrationResponse).resolves.toBeDefined();
311
- });
88
+ expectImportOk("environment import ok?", "../aws/runtime/environment.js");
89
+ expectImportOk("digitrafficIntegrationResponse import ok?", "../aws/runtime/digitraffic-integration-response.js");
312
90
  /*
313
91
  * Näitä ei testata, koska ne importtaa synthetics kirjaston, jolle ei ole mitään vastinetta npm:ssä. Lambdaympäristöstä
314
92
  * löytyy toi kirjasto.
@@ -149,4 +149,5 @@ describe("lead-time-logging", () => {
149
149
  });
150
150
  });
151
151
  });
152
+ // clean comment
152
153
  //# sourceMappingURL=lead-time-logging.test.js.map
@@ -4,8 +4,7 @@ import { CfnFunction, Runtime } from "aws-cdk-lib/aws-lambda";
4
4
  import { LogRetention } from "aws-cdk-lib/aws-logs";
5
5
  import { CfnBucket } from "aws-cdk-lib/aws-s3";
6
6
  import { CfnQueue } from "aws-cdk-lib/aws-sqs";
7
- import { kebabCase } from "change-case";
8
- import { snakeCase } from "es-toolkit";
7
+ import { kebabCase, snakeCase } from "es-toolkit";
9
8
  import { DigitrafficStack, SOLUTION_KEY } from "./stack.js";
10
9
  const MAX_CONCURRENCY_LIMIT = 100;
11
10
  const ALLOWED_RUNTIMES = [
@@ -1,4 +1,4 @@
1
- import { type IDatabase, type ITask } from "pg-promise";
1
+ import type { IDatabase, ITask } from "pg-promise";
2
2
  export declare enum DatabaseEnvironmentKeys {
3
3
  DB_USER = "DB_USER",
4
4
  DB_PASS = "DB_PASS",
@@ -1,4 +1,4 @@
1
- import pgpImport, {} from "pg-promise";
1
+ import pgpImport from "pg-promise";
2
2
  import { logger } from "../aws/runtime/dt-logger-default.js";
3
3
  import { logException } from "../utils/logging.js";
4
4
  import { getEnvVariable, getEnvVariableOrElse } from "../utils/utils.js";
@@ -3,12 +3,12 @@ export function logLeadTime(name, target, tookMs, extraFields) {
3
3
  const method = "LeadTimeLogging.logLeadTime";
4
4
  try {
5
5
  logger.info({
6
+ ...(extraFields ?? {}),
6
7
  method,
7
8
  customLeadTime: true,
8
9
  customName: name,
9
10
  customTarget: target,
10
11
  tookMs,
11
- ...(extraFields || {}),
12
12
  });
13
13
  }
14
14
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitraffic/common",
3
- "version": "2026.8.3-1",
3
+ "version": "2026.8.6-1",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "repository": {
@@ -109,36 +109,36 @@
109
109
  "dist/**/*.d.ts"
110
110
  ],
111
111
  "devDependencies": {
112
- "@aws-sdk/client-api-gateway": "3.1073.0",
113
- "@aws-sdk/client-s3": "3.1073.0",
114
- "@aws-sdk/client-secrets-manager": "3.1073.0",
115
- "@aws-sdk/client-sns": "3.1073.0",
116
- "@aws-sdk/lib-storage": "3.1073.0",
117
- "@biomejs/biome": "2.5.5",
112
+ "@aws-sdk/client-api-gateway": "3.1098.0",
113
+ "@aws-sdk/client-s3": "3.1098.0",
114
+ "@aws-sdk/client-secrets-manager": "3.1098.0",
115
+ "@aws-sdk/client-sns": "3.1098.0",
116
+ "@aws-sdk/lib-storage": "3.1098.0",
117
+ "@biomejs/biome": "2.5.6",
118
118
  "@date-fns/tz": "1.5.0",
119
- "@rushstack/heft": "1.2.19",
120
- "@rushstack/heft-typescript-plugin": "1.3.14",
121
- "@smithy/fetch-http-handler": "5.5.1",
122
- "@smithy/node-http-handler": "4.8.1",
123
- "@smithy/types": "4.15.0",
119
+ "@rushstack/heft": "1.2.22",
120
+ "@rushstack/heft-typescript-plugin": "1.3.17",
121
+ "@smithy/fetch-http-handler": "5.6.13",
122
+ "@smithy/node-http-handler": "4.9.13",
123
+ "@smithy/types": "4.16.1",
124
124
  "@types/aws-lambda": "8.10.162",
125
125
  "@types/etag": "1.8.4",
126
126
  "@types/geojson": "7946.0.16",
127
127
  "@types/geojson-validation": "1.0.3",
128
128
  "@types/madge": "5.0.3",
129
- "@types/node": "24.12.4",
129
+ "@types/node": "24.13.3",
130
130
  "@vitest/coverage-v8": "4.1.10",
131
- "aws-cdk-lib": "2.260.0",
132
- "constructs": "10.6.0",
131
+ "aws-cdk-lib": "2.262.2",
132
+ "constructs": "10.7.2",
133
133
  "date-fns": "4.4.0",
134
- "es-toolkit": "1.49.0",
134
+ "es-toolkit": "1.50.0",
135
135
  "etag": "1.8.1",
136
136
  "geojson-validation": "1.0.2",
137
137
  "ky": "2.0.2",
138
- "lefthook": "2.1.9",
138
+ "lefthook": "2.1.10",
139
139
  "madge": "8.0.0",
140
140
  "pg-native": "3.8.0",
141
- "pg-promise": "12.6.2",
141
+ "pg-promise": "12.7.0",
142
142
  "pg-query-stream": "4.16.0",
143
143
  "rimraf": "6.1.3",
144
144
  "sort-package-json": "4.0.0",
@@ -148,22 +148,22 @@
148
148
  "zod": "4.4.3"
149
149
  },
150
150
  "peerDependencies": {
151
- "@aws-sdk/client-api-gateway": "3.1073.0",
152
- "@aws-sdk/client-s3": "3.1073.0",
153
- "@aws-sdk/client-secrets-manager": "3.1073.0",
154
- "@aws-sdk/client-sns": "3.1073.0",
155
- "@aws-sdk/lib-storage": "3.1073.0",
151
+ "@aws-sdk/client-api-gateway": "3.1098.0",
152
+ "@aws-sdk/client-s3": "3.1098.0",
153
+ "@aws-sdk/client-secrets-manager": "3.1098.0",
154
+ "@aws-sdk/client-sns": "3.1098.0",
155
+ "@aws-sdk/lib-storage": "3.1098.0",
156
156
  "@date-fns/tz": "1.5.0",
157
- "@smithy/fetch-http-handler": "5.5.1",
158
- "@smithy/node-http-handler": "4.8.1",
159
- "aws-cdk-lib": "2.260.0",
160
- "constructs": "10.6.0",
157
+ "@smithy/fetch-http-handler": "5.6.13",
158
+ "@smithy/node-http-handler": "4.9.13",
159
+ "aws-cdk-lib": "2.262.2",
160
+ "constructs": "10.7.2",
161
161
  "date-fns": "4.4.0",
162
- "es-toolkit": "1.49.0",
162
+ "es-toolkit": "1.50.0",
163
163
  "geojson-validation": "1.0.2",
164
164
  "ky": "2.0.2",
165
165
  "pg-native": "3.8.0",
166
- "pg-promise": "12.6.2",
166
+ "pg-promise": "12.7.0",
167
167
  "zod": "4.4.3"
168
168
  },
169
169
  "engines": {
@@ -174,10 +174,10 @@
174
174
  "build:watch": "heft build-watch",
175
175
  "ci:test": "vitest run --coverage --reporter=junit --outputFile=junit.xml",
176
176
  "deps:update-all": "node --experimental-strip-types scripts/update-deps-and-peers.ts",
177
- "format:check": "biome check --error-on-warnings",
178
- "format:check-staged": "biome check --staged --error-on-warnings",
179
- "format:fix": "biome check --write --error-on-warnings",
180
- "format:fix-staged": "biome check --staged --write --error-on-warnings",
177
+ "format:check": "node_modules/.bin/biome check --error-on-warnings",
178
+ "format:check-staged": "node_modules/.bin/biome check --staged --error-on-warnings",
179
+ "format:fix": "node_modules/.bin/biome check --write --error-on-warnings",
180
+ "format:fix-staged": "node_modules/.bin/biome check --staged --write --error-on-warnings",
181
181
  "format:package-json": "sort-package-json",
182
182
  "setup": "pnpm install; node --experimental-strip-types scripts/setup-digitraffic-common.ts",
183
183
  "test": "vitest run --coverage && pnpm run format:check",