@digitraffic/common 2024.8.16-1 → 2024.8.30-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.
Files changed (226) hide show
  1. package/dist/{test/asserter.mjs → __test__/asserter.js} +3 -3
  2. package/dist/{test/db-testutils.d.mts → __test__/db-testutils.d.ts} +1 -1
  3. package/dist/{test/db-testutils.mjs → __test__/db-testutils.js} +4 -3
  4. package/dist/__test__/{dependencies.test.mjs → dependencies.test.js} +1 -1
  5. package/dist/__test__/{imports.test.mjs → imports.test.js} +79 -79
  6. package/dist/__test__/infra/{acl-builder.test.mjs → acl-builder.test.js} +4 -4
  7. package/dist/__test__/infra/api/{handler-factory.test.mjs → handler-factory.test.js} +3 -4
  8. package/dist/__test__/infra/api/{response.test.mjs → response.test.js} +3 -11
  9. package/dist/__test__/infra/api/{static-integration.test.mjs → static-integration.test.js} +3 -3
  10. package/dist/__test__/infra/{documentation.test.mjs → documentation.test.js} +2 -2
  11. package/dist/__test__/infra/{scheduler.test.mjs → scheduler.test.js} +2 -2
  12. package/dist/__test__/infra/{security-rule.test.mjs → security-rule.test.js} +2 -2
  13. package/dist/__test__/marine/{id_utils.test.mjs → id_utils.test.js} +3 -3
  14. package/dist/{test/mock-ky.mjs → __test__/mock-ky.js} +1 -1
  15. package/dist/__test__/promise/{promise.test.mjs → promise.test.js} +9 -13
  16. package/dist/__test__/runtime/{dt-logger.test.mjs → dt-logger.test.js} +7 -7
  17. package/dist/__test__/secrets/{secret-holder.test.mjs → secret-holder.test.js} +6 -4
  18. package/dist/__test__/secrets/{secret.test.mjs → secret.test.js} +4 -2
  19. package/dist/__test__/stack/{rest-apis.test.mjs → rest-apis.test.js} +4 -4
  20. package/dist/__test__/test/{mock-ky.test.mjs → mock-ky.test.js} +3 -3
  21. package/dist/{test/testutils.mjs → __test__/testutils.js} +1 -2
  22. package/dist/__test__/types/{lambda-response.test.mjs → lambda-response.test.js} +2 -2
  23. package/dist/__test__/utils/{date-utils.test.mjs → date-utils.test.js} +3 -3
  24. package/dist/__test__/utils/{geometry.test.mjs → geometry.test.js} +3 -3
  25. package/dist/__test__/utils/{logging.test.mjs → logging.test.js} +4 -4
  26. package/dist/__test__/utils/{utils.test.mjs → utils.test.js} +2 -3
  27. package/dist/aws/infra/{acl-builder.d.mts → acl-builder.d.ts} +15 -8
  28. package/dist/aws/infra/{acl-builder.mjs → acl-builder.js} +77 -55
  29. package/dist/aws/infra/api/{handler-factory.d.mts → handler-factory.d.ts} +4 -4
  30. package/dist/aws/infra/api/{handler-factory.mjs → handler-factory.js} +7 -5
  31. package/dist/aws/infra/api/{integration.d.mts → integration.d.ts} +3 -1
  32. package/dist/aws/infra/api/{integration.mjs → integration.js} +31 -13
  33. package/dist/aws/infra/api/{response.d.mts → response.d.ts} +2 -2
  34. package/dist/aws/infra/api/{response.mjs → response.js} +4 -4
  35. package/dist/aws/infra/api/{responses.d.mts → responses.d.ts} +3 -3
  36. package/dist/aws/infra/api/{responses.mjs → responses.js} +4 -6
  37. package/dist/aws/infra/api/{static-integration.d.mts → static-integration.d.ts} +3 -9
  38. package/dist/aws/infra/api/{static-integration.mjs → static-integration.js} +3 -3
  39. package/dist/aws/infra/canaries/canary-alarm.d.ts +6 -0
  40. package/dist/aws/infra/canaries/{canary-alarm.mjs → canary-alarm.js} +1 -3
  41. package/dist/aws/infra/canaries/{canary-keys.mjs → canary-keys.js} +1 -1
  42. package/dist/aws/infra/canaries/{canary-parameters.d.mts → canary-parameters.d.ts} +1 -1
  43. package/dist/aws/infra/canaries/canary-parameters.js +2 -0
  44. package/dist/aws/infra/canaries/{canary-role.d.mts → canary-role.d.ts} +1 -1
  45. package/dist/aws/infra/canaries/{canary-role.mjs → canary-role.js} +2 -5
  46. package/dist/aws/infra/canaries/{canary.d.mts → canary.d.ts} +4 -4
  47. package/dist/aws/infra/canaries/{canary.mjs → canary.js} +3 -4
  48. package/dist/aws/infra/canaries/{database-canary.d.mts → database-canary.d.ts} +4 -5
  49. package/dist/aws/infra/canaries/{database-canary.mjs → database-canary.js} +4 -11
  50. package/dist/aws/infra/canaries/{database-checker.d.mts → database-checker.d.ts} +5 -5
  51. package/dist/aws/infra/canaries/{database-checker.mjs → database-checker.js} +15 -12
  52. package/dist/aws/infra/canaries/{url-canary.d.mts → url-canary.d.ts} +5 -5
  53. package/dist/aws/infra/canaries/{url-canary.mjs → url-canary.js} +7 -12
  54. package/dist/aws/infra/canaries/{url-checker.d.mts → url-checker.d.ts} +2 -2
  55. package/dist/aws/infra/canaries/{url-checker.mjs → url-checker.js} +12 -21
  56. package/dist/aws/infra/{documentation.d.mts → documentation.d.ts} +2 -2
  57. package/dist/aws/infra/{documentation.mjs → documentation.js} +4 -3
  58. package/dist/aws/infra/{import-util.d.mts → import-util.d.ts} +2 -2
  59. package/dist/aws/infra/{import-util.mjs → import-util.js} +3 -3
  60. package/dist/aws/infra/{scheduler.d.mts → scheduler.d.ts} +2 -2
  61. package/dist/aws/infra/{scheduler.mjs → scheduler.js} +1 -3
  62. package/dist/aws/infra/{security-rule.d.mts → security-rule.d.ts} +1 -1
  63. package/dist/aws/infra/{security-rule.mjs → security-rule.js} +1 -2
  64. package/dist/aws/infra/{sqs-integration.d.mts → sqs-integration.d.ts} +3 -3
  65. package/dist/aws/infra/{sqs-integration.mjs → sqs-integration.js} +3 -7
  66. package/dist/aws/infra/{sqs-queue.d.mts → sqs-queue.d.ts} +1 -1
  67. package/dist/aws/infra/{sqs-queue.mjs → sqs-queue.js} +19 -19
  68. package/dist/aws/infra/stack/{lambda-configs.d.mts → lambda-configs.d.ts} +4 -4
  69. package/dist/aws/infra/stack/{lambda-configs.mjs → lambda-configs.js} +3 -7
  70. package/dist/aws/infra/stack/{monitoredfunction.d.mts → monitoredfunction.d.ts} +15 -15
  71. package/dist/aws/infra/stack/{monitoredfunction.mjs → monitoredfunction.js} +42 -43
  72. package/dist/aws/infra/stack/{parameters.mjs → parameters.js} +1 -1
  73. package/dist/aws/infra/stack/{rest_apis.d.mts → rest_apis.d.ts} +12 -6
  74. package/dist/aws/infra/stack/{rest_apis.mjs → rest_apis.js} +26 -24
  75. package/dist/aws/infra/stack/{stack-checking-aspect.mjs → stack-checking-aspect.js} +7 -2
  76. package/dist/aws/infra/stack/{stack.d.mts → stack.d.ts} +4 -4
  77. package/dist/aws/infra/stack/{stack.mjs → stack.js} +2 -5
  78. package/dist/aws/infra/stack/{subscription.d.mts → subscription.d.ts} +4 -4
  79. package/dist/aws/infra/stack/{subscription.mjs → subscription.js} +2 -6
  80. package/dist/aws/infra/stacks/{db-dns-stack.d.mts → db-dns-stack.d.ts} +1 -1
  81. package/dist/aws/infra/stacks/{db-dns-stack.mjs → db-dns-stack.js} +4 -4
  82. package/dist/aws/infra/stacks/{db-proxy-stack.d.mts → db-proxy-stack.d.ts} +2 -2
  83. package/dist/aws/infra/stacks/{db-proxy-stack.mjs → db-proxy-stack.js} +5 -6
  84. package/dist/aws/infra/stacks/{db-stack.d.mts → db-stack.d.ts} +4 -4
  85. package/dist/aws/infra/stacks/{db-stack.mjs → db-stack.js} +7 -10
  86. package/dist/aws/infra/stacks/intra-stack-configuration.js +2 -0
  87. package/dist/aws/infra/stacks/{network-stack.d.mts → network-stack.d.ts} +2 -2
  88. package/dist/aws/infra/stacks/{network-stack.mjs → network-stack.js} +4 -7
  89. package/dist/aws/infra/{usage-plans.d.mts → usage-plans.d.ts} +1 -1
  90. package/dist/aws/infra/{usage-plans.mjs → usage-plans.js} +1 -2
  91. package/dist/aws/runtime/{apikey.mjs → apikey.js} +1 -1
  92. package/dist/aws/runtime/{digitraffic-integration-response.d.mts → digitraffic-integration-response.d.ts} +1 -1
  93. package/dist/aws/runtime/{digitraffic-integration-response.mjs → digitraffic-integration-response.js} +4 -6
  94. package/dist/aws/runtime/{dt-logger-default.d.mts → dt-logger-default.d.ts} +2 -2
  95. package/dist/aws/runtime/{dt-logger-default.mjs → dt-logger-default.js} +2 -2
  96. package/dist/aws/runtime/{dt-logger.mjs → dt-logger.js} +9 -4
  97. package/dist/aws/runtime/{environment.mjs → environment.js} +2 -2
  98. package/dist/aws/runtime/{s3.d.mts → s3.d.ts} +1 -1
  99. package/dist/aws/runtime/{s3.mjs → s3.js} +3 -3
  100. package/dist/aws/runtime/secrets/{dbsecret.d.mts → dbsecret.d.ts} +1 -1
  101. package/dist/aws/runtime/secrets/{dbsecret.mjs → dbsecret.js} +6 -2
  102. package/dist/aws/runtime/secrets/proxy-holder.js +25 -0
  103. package/dist/aws/runtime/secrets/rds-holder.js +25 -0
  104. package/dist/aws/runtime/secrets/{secret-holder.d.mts → secret-holder.d.ts} +6 -5
  105. package/dist/aws/runtime/secrets/{secret-holder.mjs → secret-holder.js} +11 -12
  106. package/dist/aws/runtime/secrets/{secret.mjs → secret.js} +7 -3
  107. package/dist/aws/types/{errors.mjs → errors.js} +1 -1
  108. package/dist/aws/types/{lambda-response.mjs → lambda-response.js} +1 -1
  109. package/dist/aws/types/{mediatypes.mjs → mediatypes.js} +1 -1
  110. package/dist/aws/types/{model-with-reference.d.mts → model-with-reference.d.ts} +1 -1
  111. package/dist/aws/types/model-with-reference.js +2 -0
  112. package/dist/aws/types/proxytypes.js +2 -0
  113. package/dist/aws/types/tags.js +4 -0
  114. package/dist/database/{cached.d.mts → cached.d.ts} +1 -1
  115. package/dist/database/{cached.mjs → cached.js} +2 -4
  116. package/dist/database/{database.mjs → database.js} +4 -8
  117. package/dist/database/{last-updated.d.mts → last-updated.d.ts} +1 -1
  118. package/dist/database/{last-updated.mjs → last-updated.js} +3 -1
  119. package/dist/database/models.js +2 -0
  120. package/dist/index.d.ts +1 -0
  121. package/dist/index.js +2 -0
  122. package/dist/marine/{id_utils.mjs → id_utils.js} +2 -2
  123. package/dist/marine/rtz.js +2 -0
  124. package/dist/types/{async-timeout-error.mjs → async-timeout-error.js} +1 -1
  125. package/dist/types/aws-env.js +2 -0
  126. package/dist/types/either.js +2 -0
  127. package/dist/types/{http-error.mjs → http-error.js} +1 -1
  128. package/dist/types/{input-error.mjs → input-error.js} +1 -1
  129. package/dist/types/{language.mjs → language.js} +1 -1
  130. package/dist/types/{nullable.d.mts → nullable.d.ts} +1 -1
  131. package/dist/types/nullable.js +2 -0
  132. package/dist/types/openapi-schema.d.ts +4342 -0
  133. package/dist/types/openapi-schema.js +134 -0
  134. package/dist/types/{traffictype.mjs → traffictype.js} +1 -1
  135. package/dist/types/urn.js +2 -0
  136. package/dist/types/util-types.js +2 -0
  137. package/dist/types/{validator.mjs → validator.js} +1 -1
  138. package/dist/utils/{api-model.d.mts → api-model.d.ts} +6 -5
  139. package/dist/utils/{api-model.mjs → api-model.js} +14 -15
  140. package/dist/utils/{base64.mjs → base64.js} +3 -3
  141. package/dist/utils/{date-utils.mjs → date-utils.js} +1 -1
  142. package/dist/utils/{geojson-types.d.mts → geojson-types.d.ts} +2 -2
  143. package/dist/utils/{geojson-types.mjs → geojson-types.js} +1 -1
  144. package/dist/utils/{geometry.d.mts → geometry.d.ts} +4 -3
  145. package/dist/utils/{geometry.mjs → geometry.js} +7 -4
  146. package/dist/utils/{logging.d.mts → logging.d.ts} +1 -1
  147. package/dist/utils/{logging.mjs → logging.js} +5 -8
  148. package/dist/utils/{retry.mjs → retry.js} +6 -8
  149. package/dist/utils/{slack.mjs → slack.js} +3 -3
  150. package/dist/utils/{utils.d.mts → utils.d.ts} +2 -3
  151. package/dist/utils/{utils.mjs → utils.js} +9 -5
  152. package/package.json +137 -131
  153. package/dist/aws/infra/canaries/canary-alarm.d.mts +0 -6
  154. package/dist/aws/infra/canaries/canary-parameters.mjs +0 -2
  155. package/dist/aws/infra/stacks/intra-stack-configuration.mjs +0 -2
  156. package/dist/aws/runtime/secrets/proxy-holder.mjs +0 -25
  157. package/dist/aws/runtime/secrets/rds-holder.mjs +0 -25
  158. package/dist/aws/types/model-with-reference.mjs +0 -2
  159. package/dist/aws/types/proxytypes.mjs +0 -2
  160. package/dist/aws/types/tags.mjs +0 -4
  161. package/dist/database/models.mjs +0 -2
  162. package/dist/index.d.mts +0 -1
  163. package/dist/index.mjs +0 -2
  164. package/dist/marine/rtz.mjs +0 -2
  165. package/dist/types/aws-env.mjs +0 -2
  166. package/dist/types/either.mjs +0 -2
  167. package/dist/types/nullable.mjs +0 -2
  168. package/dist/types/urn.mjs +0 -2
  169. package/dist/types/util-types.mjs +0 -2
  170. /package/dist/{test/asserter.d.mts → __test__/asserter.d.ts} +0 -0
  171. /package/dist/__test__/{dependencies.test.d.mts → dependencies.test.d.ts} +0 -0
  172. /package/dist/__test__/{imports.test.d.mts → imports.test.d.ts} +0 -0
  173. /package/dist/__test__/infra/{acl-builder.test.d.mts → acl-builder.test.d.ts} +0 -0
  174. /package/dist/__test__/infra/api/{handler-factory.test.d.mts → handler-factory.test.d.ts} +0 -0
  175. /package/dist/__test__/infra/api/{response.test.d.mts → response.test.d.ts} +0 -0
  176. /package/dist/__test__/infra/api/{static-integration.test.d.mts → static-integration.test.d.ts} +0 -0
  177. /package/dist/__test__/infra/{documentation.test.d.mts → documentation.test.d.ts} +0 -0
  178. /package/dist/__test__/infra/{scheduler.test.d.mts → scheduler.test.d.ts} +0 -0
  179. /package/dist/__test__/infra/{security-rule.test.d.mts → security-rule.test.d.ts} +0 -0
  180. /package/dist/__test__/marine/{id_utils.test.d.mts → id_utils.test.d.ts} +0 -0
  181. /package/dist/{test/mock-ky.d.mts → __test__/mock-ky.d.ts} +0 -0
  182. /package/dist/__test__/promise/{promise.test.d.mts → promise.test.d.ts} +0 -0
  183. /package/dist/__test__/runtime/{dt-logger.test.d.mts → dt-logger.test.d.ts} +0 -0
  184. /package/dist/__test__/secrets/{secret-holder.test.d.mts → secret-holder.test.d.ts} +0 -0
  185. /package/dist/__test__/secrets/{secret.test.d.mts → secret.test.d.ts} +0 -0
  186. /package/dist/__test__/stack/{rest-apis.test.d.mts → rest-apis.test.d.ts} +0 -0
  187. /package/dist/__test__/test/{mock-ky.test.d.mts → mock-ky.test.d.ts} +0 -0
  188. /package/dist/{test/testutils.d.mts → __test__/testutils.d.ts} +0 -0
  189. /package/dist/__test__/types/{lambda-response.test.d.mts → lambda-response.test.d.ts} +0 -0
  190. /package/dist/__test__/utils/{date-utils.test.d.mts → date-utils.test.d.ts} +0 -0
  191. /package/dist/__test__/utils/{geometry.test.d.mts → geometry.test.d.ts} +0 -0
  192. /package/dist/__test__/utils/{logging.test.d.mts → logging.test.d.ts} +0 -0
  193. /package/dist/__test__/utils/{utils.test.d.mts → utils.test.d.ts} +0 -0
  194. /package/dist/aws/infra/canaries/{canary-keys.d.mts → canary-keys.d.ts} +0 -0
  195. /package/dist/aws/infra/stack/{parameters.d.mts → parameters.d.ts} +0 -0
  196. /package/dist/aws/infra/stack/{stack-checking-aspect.d.mts → stack-checking-aspect.d.ts} +0 -0
  197. /package/dist/aws/infra/stacks/{intra-stack-configuration.d.mts → intra-stack-configuration.d.ts} +0 -0
  198. /package/dist/aws/runtime/{apikey.d.mts → apikey.d.ts} +0 -0
  199. /package/dist/aws/runtime/{dt-logger.d.mts → dt-logger.d.ts} +0 -0
  200. /package/dist/aws/runtime/{environment.d.mts → environment.d.ts} +0 -0
  201. /package/dist/aws/runtime/secrets/{proxy-holder.d.mts → proxy-holder.d.ts} +0 -0
  202. /package/dist/aws/runtime/secrets/{rds-holder.d.mts → rds-holder.d.ts} +0 -0
  203. /package/dist/aws/runtime/secrets/{secret.d.mts → secret.d.ts} +0 -0
  204. /package/dist/aws/types/{errors.d.mts → errors.d.ts} +0 -0
  205. /package/dist/aws/types/{lambda-response.d.mts → lambda-response.d.ts} +0 -0
  206. /package/dist/aws/types/{mediatypes.d.mts → mediatypes.d.ts} +0 -0
  207. /package/dist/aws/types/{proxytypes.d.mts → proxytypes.d.ts} +0 -0
  208. /package/dist/aws/types/{tags.d.mts → tags.d.ts} +0 -0
  209. /package/dist/database/{database.d.mts → database.d.ts} +0 -0
  210. /package/dist/database/{models.d.mts → models.d.ts} +0 -0
  211. /package/dist/marine/{id_utils.d.mts → id_utils.d.ts} +0 -0
  212. /package/dist/marine/{rtz.d.mts → rtz.d.ts} +0 -0
  213. /package/dist/types/{async-timeout-error.d.mts → async-timeout-error.d.ts} +0 -0
  214. /package/dist/types/{aws-env.d.mts → aws-env.d.ts} +0 -0
  215. /package/dist/types/{either.d.mts → either.d.ts} +0 -0
  216. /package/dist/types/{http-error.d.mts → http-error.d.ts} +0 -0
  217. /package/dist/types/{input-error.d.mts → input-error.d.ts} +0 -0
  218. /package/dist/types/{language.d.mts → language.d.ts} +0 -0
  219. /package/dist/types/{traffictype.d.mts → traffictype.d.ts} +0 -0
  220. /package/dist/types/{urn.d.mts → urn.d.ts} +0 -0
  221. /package/dist/types/{util-types.d.mts → util-types.d.ts} +0 -0
  222. /package/dist/types/{validator.d.mts → validator.d.ts} +0 -0
  223. /package/dist/utils/{base64.d.mts → base64.d.ts} +0 -0
  224. /package/dist/utils/{date-utils.d.mts → date-utils.d.ts} +0 -0
  225. /package/dist/utils/{retry.d.mts → retry.d.ts} +0 -0
  226. /package/dist/utils/{slack.d.mts → slack.d.ts} +0 -0
@@ -1,8 +1,4 @@
1
1
  import { CfnSubscriptionFilter } from "aws-cdk-lib/aws-logs";
2
- import { Function as AWSFunction } from "aws-cdk-lib/aws-lambda";
3
- import { DigitrafficStack } from "./stack.mjs";
4
- import { Construct } from "constructs";
5
- import { MonitoredFunction } from "./monitoredfunction.mjs";
6
2
  /**
7
3
  * Creates a subscription filter that subscribes to a Lambda Log Group and delivers the logs to another destination.
8
4
  * https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html
@@ -12,7 +8,7 @@ import { MonitoredFunction } from "./monitoredfunction.mjs";
12
8
  * @param stack CloudFormation stack
13
9
  */
14
10
  export function createSubscription(lambda, lambdaName, logDestinationArn, stack) {
15
- if (logDestinationArn == undefined) {
11
+ if (logDestinationArn === undefined || logDestinationArn === null) {
16
12
  return undefined;
17
13
  }
18
14
  const filter = new CfnSubscriptionFilter(stack, `${lambdaName}LogsSubscription`, {
@@ -38,4 +34,4 @@ export class DigitrafficLogSubscriptions {
38
34
  }
39
35
  }
40
36
  }
41
- //# sourceMappingURL=subscription.mjs.map
37
+ //# sourceMappingURL=subscription.js.map
@@ -1,6 +1,6 @@
1
1
  import { Stack } from "aws-cdk-lib";
2
2
  import { type Construct } from "constructs";
3
- import type { InfraStackConfiguration } from "./intra-stack-configuration.mjs";
3
+ import type { InfraStackConfiguration } from "./intra-stack-configuration.js";
4
4
  /**
5
5
  * Creates a dns local zone and creates records for cluster endpoints and proxy endpoints.
6
6
  *
@@ -1,8 +1,8 @@
1
1
  import { Duration, RemovalPolicy, Stack } from "aws-cdk-lib";
2
2
  import {} from "constructs";
3
- import { PrivateHostedZone, RecordSet, RecordTarget, RecordType, } from "aws-cdk-lib/aws-route53";
4
- import { importVpc } from "../import-util.mjs";
5
- import { getParameterValue } from "../stack/parameters.mjs";
3
+ import { PrivateHostedZone, RecordSet, RecordTarget, RecordType } from "aws-cdk-lib/aws-route53";
4
+ import { importVpc } from "../import-util.js";
5
+ import { getParameterValue } from "../stack/parameters.js";
6
6
  const DEFAULT_RECORD_TTL = Duration.seconds(30);
7
7
  /**
8
8
  * Creates a dns local zone and creates records for cluster endpoints and proxy endpoints.
@@ -58,4 +58,4 @@ export class DbDnsStack extends Stack {
58
58
  });
59
59
  }
60
60
  }
61
- //# sourceMappingURL=db-dns-stack.mjs.map
61
+ //# sourceMappingURL=db-dns-stack.js.map
@@ -1,9 +1,9 @@
1
1
  import { CfnDBProxyEndpoint, DatabaseProxy } from "aws-cdk-lib/aws-rds";
2
2
  import { type ISecret } from "aws-cdk-lib/aws-secretsmanager";
3
3
  import { type IVpc } from "aws-cdk-lib/aws-ec2";
4
- import type { InfraStackConfiguration } from "./intra-stack-configuration.mjs";
4
+ import type { InfraStackConfiguration } from "./intra-stack-configuration.js";
5
5
  import { Stack } from "aws-cdk-lib/core";
6
- import { Construct } from "constructs/lib/construct.js";
6
+ import type { Construct } from "constructs/lib/construct.js";
7
7
  export interface ProxyConfiguration {
8
8
  readonly secretArn: string;
9
9
  readonly name?: string;
@@ -1,11 +1,10 @@
1
1
  import { CfnDBProxyEndpoint, DatabaseCluster, DatabaseClusterEngine, DatabaseProxy, ProxyTarget, } from "aws-cdk-lib/aws-rds";
2
2
  import { Secret } from "aws-cdk-lib/aws-secretsmanager";
3
3
  import { SecurityGroup } from "aws-cdk-lib/aws-ec2";
4
- import { DbStack } from "./db-stack.mjs";
5
- import { exportValue, importVpc } from "../import-util.mjs";
6
- import { createParameter } from "../stack/parameters.mjs";
7
- import { Stack, Duration } from "aws-cdk-lib/core";
8
- import { Construct } from "constructs/lib/construct.js";
4
+ import { DbStack } from "./db-stack.js";
5
+ import { exportValue, importVpc } from "../import-util.js";
6
+ import { createParameter } from "../stack/parameters.js";
7
+ import { Duration, Stack } from "aws-cdk-lib/core";
9
8
  /**
10
9
  * A stack that creates a Database proxy.
11
10
  */
@@ -72,4 +71,4 @@ export class DbProxyStack extends Stack {
72
71
  });
73
72
  }
74
73
  }
75
- //# sourceMappingURL=db-proxy-stack.mjs.map
74
+ //# sourceMappingURL=db-proxy-stack.js.map
@@ -1,7 +1,7 @@
1
- import { InstanceType, type IVpc, type ISecurityGroup } from "aws-cdk-lib/aws-ec2";
2
- import { AuroraPostgresEngineVersion, DatabaseCluster, type DatabaseClusterProps, type IParameterGroup } from "aws-cdk-lib/aws-rds";
3
- import { Construct } from "constructs/lib/construct.js";
4
- import type { InfraStackConfiguration } from "./intra-stack-configuration.mjs";
1
+ import { type InstanceType, type ISecurityGroup, type IVpc } from "aws-cdk-lib/aws-ec2";
2
+ import { type AuroraPostgresEngineVersion, DatabaseCluster, type DatabaseClusterProps, type IParameterGroup } from "aws-cdk-lib/aws-rds";
3
+ import type { Construct } from "constructs/lib/construct.js";
4
+ import type { InfraStackConfiguration } from "./intra-stack-configuration.js";
5
5
  import { Stack } from "aws-cdk-lib/core";
6
6
  export interface DbConfiguration {
7
7
  readonly cluster?: ClusterConfiguration;
@@ -1,10 +1,9 @@
1
- import { InstanceType, SecurityGroup, SubnetType, } from "aws-cdk-lib/aws-ec2";
2
- import { AuroraPostgresEngineVersion, CfnDBInstance, Credentials, DatabaseCluster, DatabaseClusterEngine, DatabaseClusterFromSnapshot, InstanceUpdateBehaviour, ParameterGroup, } from "aws-cdk-lib/aws-rds";
3
- import { Construct } from "constructs/lib/construct.js";
1
+ import { SecurityGroup, SubnetType, } from "aws-cdk-lib/aws-ec2";
2
+ import { CfnDBInstance, Credentials, DatabaseCluster, DatabaseClusterEngine, DatabaseClusterFromSnapshot, InstanceUpdateBehaviour, ParameterGroup, } from "aws-cdk-lib/aws-rds";
4
3
  import { Secret } from "aws-cdk-lib/aws-secretsmanager";
5
- import { exportValue, importVpc } from "../import-util.mjs";
4
+ import { exportValue, importVpc } from "../import-util.js";
6
5
  import { Duration, RemovalPolicy, Stack } from "aws-cdk-lib/core";
7
- import { createParameter } from "../stack/parameters.mjs";
6
+ import { createParameter } from "../stack/parameters.js";
8
7
  /**
9
8
  * Stack that creates DatabaseCluster.
10
9
  *
@@ -102,11 +101,9 @@ export class DbStack extends Stack {
102
101
  createAuroraCluster(isc, configuration, clusterConfiguration, parameterGroups) {
103
102
  const instanceName = isc.environmentName + "-db";
104
103
  const securityGroup = SecurityGroup.fromSecurityGroupId(this, "securitygroup", clusterConfiguration.securityGroupId);
105
- const vpc = configuration.vpc
106
- ? configuration.vpc
107
- : importVpc(this, isc.environmentName);
104
+ const vpc = configuration.vpc ? configuration.vpc : importVpc(this, isc.environmentName);
108
105
  if (parameterGroups[0] === undefined) {
109
- throw Error('ParameterGroups should not be empty');
106
+ throw Error("ParameterGroups should not be empty");
110
107
  }
111
108
  const parameters = this.createClusterParameters(configuration.secretArn, clusterConfiguration, instanceName, vpc, securityGroup, parameterGroups[0]);
112
109
  // create cluster from the snapshot or from the scratch
@@ -127,4 +124,4 @@ export class DbStack extends Stack {
127
124
  return cluster;
128
125
  }
129
126
  }
130
- //# sourceMappingURL=db-stack.mjs.map
127
+ //# sourceMappingURL=db-stack.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=intra-stack-configuration.js.map
@@ -1,7 +1,7 @@
1
1
  import { type IVpc, Vpc } from "aws-cdk-lib/aws-ec2";
2
- import type { InfraStackConfiguration } from "./intra-stack-configuration.mjs";
2
+ import type { InfraStackConfiguration } from "./intra-stack-configuration.js";
3
3
  import { Stack } from "aws-cdk-lib/core";
4
- import { Construct } from "constructs/lib/construct.js";
4
+ import type { Construct } from "constructs/lib/construct.js";
5
5
  export interface NetworkConfiguration {
6
6
  readonly vpcName: string;
7
7
  readonly cidr: string;
@@ -1,7 +1,6 @@
1
1
  import { IpAddresses, SubnetType, Vpc } from "aws-cdk-lib/aws-ec2";
2
- import { exportValue } from "../import-util.mjs";
2
+ import { exportValue } from "../import-util.js";
3
3
  import { Stack } from "aws-cdk-lib/core";
4
- import { Construct } from "constructs/lib/construct.js";
5
4
  export class NetworkStack extends Stack {
6
5
  vpc;
7
6
  constructor(scope, id, isc, configuration) {
@@ -13,7 +12,7 @@ export class NetworkStack extends Stack {
13
12
  this.vpc.publicSubnets[1] === undefined ||
14
13
  this.vpc.privateSubnets[0] === undefined ||
15
14
  this.vpc.privateSubnets[1] === undefined) {
16
- throw Error('Subnets are not set correctly');
15
+ throw Error("Subnets are not set correctly");
17
16
  }
18
17
  exportValue(this, isc.environmentName, "VPCID", this.vpc.vpcId);
19
18
  exportValue(this, isc.environmentName, "digitrafficpublicASubnet", this.vpc.publicSubnets[0].subnetId);
@@ -24,9 +23,7 @@ export class NetworkStack extends Stack {
24
23
  createVpc(configuration) {
25
24
  return new Vpc(this, "DigitrafficVPC", {
26
25
  vpcName: configuration.vpcName,
27
- availabilityZones: Stack.of(this)
28
- .availabilityZones.sort()
29
- .slice(0, 2), // take two first azs
26
+ availabilityZones: Stack.of(this).availabilityZones.sort().slice(0, 2), // take two first azs
30
27
  enableDnsHostnames: true,
31
28
  enableDnsSupport: true,
32
29
  ipAddresses: IpAddresses.cidr(configuration.cidr),
@@ -45,4 +42,4 @@ export class NetworkStack extends Stack {
45
42
  });
46
43
  }
47
44
  }
48
- //# sourceMappingURL=network-stack.mjs.map
45
+ //# sourceMappingURL=network-stack.js.map
@@ -1,4 +1,4 @@
1
- import { type IApiKey, RestApi } from "aws-cdk-lib/aws-apigateway";
1
+ import type { IApiKey, RestApi } from "aws-cdk-lib/aws-apigateway";
2
2
  /**
3
3
  * Creates an usage plan for a REST API with a single API key
4
4
  * @param api The REST API
@@ -1,4 +1,3 @@
1
- import { RestApi } from "aws-cdk-lib/aws-apigateway";
2
1
  /**
3
2
  * Creates an usage plan for a REST API with a single API key
4
3
  * @param api The REST API
@@ -36,4 +35,4 @@ export function createDefaultUsagePlan(api, apiName, value) {
36
35
  plan.addApiKey(apiKey);
37
36
  return apiKey;
38
37
  }
39
- //# sourceMappingURL=usage-plans.mjs.map
38
+ //# sourceMappingURL=usage-plans.js.map
@@ -18,4 +18,4 @@ export async function getApiKeyFromAPIGateway(keyId) {
18
18
 
19
19
  return client.send(command);*/
20
20
  }
21
- //# sourceMappingURL=apikey.mjs.map
21
+ //# sourceMappingURL=apikey.js.map
@@ -1,5 +1,5 @@
1
1
  import type { IntegrationResponse } from "aws-cdk-lib/aws-apigateway";
2
- import { MediaType } from "../types/mediatypes.mjs";
2
+ import { MediaType } from "../types/mediatypes.js";
3
3
  export declare abstract class DigitrafficIntegrationResponse {
4
4
  static ok(mediaType: MediaType, sunset?: string): IntegrationResponse;
5
5
  static badRequest(mediaType?: MediaType): IntegrationResponse;
@@ -1,5 +1,5 @@
1
- import { MediaType } from "../types/mediatypes.mjs";
2
- import { getDeprecatedDefaultLambdaResponse, RESPONSE_DEFAULT_LAMBDA, } from "../infra/api/response.mjs";
1
+ import { MediaType } from "../types/mediatypes.js";
2
+ import { getDeprecatedDefaultLambdaResponse, RESPONSE_DEFAULT_LAMBDA } from "../infra/api/response.js";
3
3
  export class DigitrafficIntegrationResponse {
4
4
  static ok(mediaType, sunset) {
5
5
  return this.create("200", mediaType, sunset);
@@ -14,11 +14,9 @@ export class DigitrafficIntegrationResponse {
14
14
  return {
15
15
  statusCode,
16
16
  responseTemplates: {
17
- [mediaType]: sunset
18
- ? getDeprecatedDefaultLambdaResponse(sunset)
19
- : RESPONSE_DEFAULT_LAMBDA,
17
+ [mediaType]: sunset ? getDeprecatedDefaultLambdaResponse(sunset) : RESPONSE_DEFAULT_LAMBDA,
20
18
  },
21
19
  };
22
20
  }
23
21
  }
24
- //# sourceMappingURL=digitraffic-integration-response.mjs.map
22
+ //# sourceMappingURL=digitraffic-integration-response.js.map
@@ -1,8 +1,8 @@
1
- import { DtLogger } from "./dt-logger.mjs";
1
+ import { DtLogger } from "./dt-logger.js";
2
2
  /**
3
3
  * You can use this for method name definition to match DtLogger LoggableType.method parameter.
4
4
  */
5
- export type { LoggerMethodType } from "./dt-logger.mjs";
5
+ export type { LoggerMethodType } from "./dt-logger.js";
6
6
  /**
7
7
  * You can use this for your logging needs or create one locally and configure it as you wish.
8
8
  */
@@ -1,6 +1,6 @@
1
- import { DtLogger } from "./dt-logger.mjs";
1
+ import { DtLogger } from "./dt-logger.js";
2
2
  /**
3
3
  * You can use this for your logging needs or create one locally and configure it as you wish.
4
4
  */
5
5
  export const logger = new DtLogger();
6
- //# sourceMappingURL=dt-logger-default.mjs.map
6
+ //# sourceMappingURL=dt-logger-default.js.map
@@ -1,4 +1,5 @@
1
- import { mapKeys, lowerFirst } from "lodash-es";
1
+ import { lowerFirst, mapKeys } from "lodash-es";
2
+ import { getEnvVariableOrElse } from "../../utils/utils.js";
2
3
  /**
3
4
  * Helper class for json-logging.
4
5
  *
@@ -18,8 +19,9 @@ export class DtLogger {
18
19
  * @param {LoggerConfiguration?} [config] - Accepts configuration options @see {@link LoggerConfiguration}
19
20
  */
20
21
  constructor(config) {
21
- this.lambdaName = config?.lambdaName ?? process.env["AWS_LAMBDA_FUNCTION_NAME"];
22
- this.runtime = config?.runTime ?? process.env["AWS_EXECUTION_ENV"];
22
+ this.lambdaName =
23
+ config?.lambdaName ?? getEnvVariableOrElse("AWS_LAMBDA_FUNCTION_NAME", "unknown lambda name");
24
+ this.runtime = config?.runTime ?? getEnvVariableOrElse("AWS_EXECUTION_ENV", "unknown runtime");
23
25
  this.writeStream = config?.writeStream ?? process.stdout;
24
26
  }
25
27
  /**
@@ -96,7 +98,10 @@ export class DtLogger {
96
98
  this.writeStream.write(JSON.stringify(logMessage) + "\n");
97
99
  }
98
100
  }
101
+ /**
102
+ * Removes given prefixes from the keys of the object.
103
+ */
99
104
  function removePrefix(prefix, loggable) {
100
105
  return mapKeys(loggable, (_index, key) => key.startsWith(prefix) ? lowerFirst(key.replace(prefix, "")) : key);
101
106
  }
102
- //# sourceMappingURL=dt-logger.mjs.map
107
+ //# sourceMappingURL=dt-logger.js.map
@@ -9,7 +9,7 @@ export var EnvKeys;
9
9
  */
10
10
  export function envValue(key, defaultValue) {
11
11
  const value = process.env[key];
12
- if (value == null) {
12
+ if (value === null || value === undefined) {
13
13
  if (defaultValue) {
14
14
  return defaultValue;
15
15
  }
@@ -17,4 +17,4 @@ export function envValue(key, defaultValue) {
17
17
  }
18
18
  return value;
19
19
  }
20
- //# sourceMappingURL=environment.mjs.map
20
+ //# sourceMappingURL=environment.js.map
@@ -1,4 +1,4 @@
1
1
  import type { ObjectCannedACL } from "@aws-sdk/client-s3";
2
- import { S3Client } from "@aws-sdk/client-s3";
2
+ import { type S3Client } from "@aws-sdk/client-s3";
3
3
  import { type NodeJsRuntimeStreamingBlobPayloadInputTypes } from "@smithy/types";
4
4
  export declare function uploadToS3(s3: S3Client, bucketName: string, body: NodeJsRuntimeStreamingBlobPayloadInputTypes, objectName: string, cannedAcl?: ObjectCannedACL, contentType?: string): Promise<void>;
@@ -1,6 +1,6 @@
1
- import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
1
+ import { PutObjectCommand } from "@aws-sdk/client-s3";
2
2
  import {} from "@smithy/types";
3
- import { logger } from "./dt-logger-default.mjs";
3
+ import { logger } from "./dt-logger-default.js";
4
4
  export async function uploadToS3(s3, bucketName, body, objectName, cannedAcl, contentType) {
5
5
  const command = new PutObjectCommand({
6
6
  Bucket: bucketName,
@@ -19,4 +19,4 @@ export async function uploadToS3(s3, bucketName, body, objectName, cannedAcl, co
19
19
  });
20
20
  }
21
21
  }
22
- //# sourceMappingURL=s3.mjs.map
22
+ //# sourceMappingURL=s3.js.map
@@ -1,4 +1,4 @@
1
- import type { GenericSecret } from "./secret.mjs";
1
+ import type { GenericSecret } from "./secret.js";
2
2
  export declare enum RdsProxySecretKey {
3
3
  username = "username",
4
4
  password = "password",
@@ -1,3 +1,4 @@
1
+ import { logger } from "../dt-logger-default.js";
1
2
  export var RdsProxySecretKey;
2
3
  (function (RdsProxySecretKey) {
3
4
  RdsProxySecretKey["username"] = "username";
@@ -15,8 +16,11 @@ export var RdsSecretKey;
15
16
  export function checkExpectedSecretKeys(keys, secret) {
16
17
  const missingKeys = keys.filter((key) => !(key in secret));
17
18
  if (missingKeys.length) {
18
- console.error(`method=checkExpectedSecretKeys secret didn't contain the key(s) ${missingKeys.toString()}`);
19
+ logger.error({
20
+ method: "dbsecret.checkExpectedSecretKeys",
21
+ message: `secret didn't contain the key(s) ${missingKeys.toString()}`,
22
+ });
19
23
  throw new Error("Expected keys were not found");
20
24
  }
21
25
  }
22
- //# sourceMappingURL=dbsecret.mjs.map
26
+ //# sourceMappingURL=dbsecret.js.map
@@ -0,0 +1,25 @@
1
+ import { SecretHolder } from "./secret-holder.js";
2
+ import { RdsProxySecretKey } from "./dbsecret.js";
3
+ import { getEnvVariable, setEnvVariable } from "../../../utils/utils.js";
4
+ import { DatabaseEnvironmentKeys } from "../../../database/database.js";
5
+ const RDS_PROXY_SECRET_KEYS = Object.values(RdsProxySecretKey);
6
+ /**
7
+ * Holds credentials for RDS Proxy access.
8
+ */
9
+ export class ProxyHolder {
10
+ secretHolder;
11
+ constructor(secretId) {
12
+ this.secretHolder = new SecretHolder(secretId, "", RDS_PROXY_SECRET_KEYS);
13
+ }
14
+ static create() {
15
+ return new ProxyHolder(getEnvVariable("SECRET_ID"));
16
+ }
17
+ async setCredentials() {
18
+ const secret = await this.secretHolder.get();
19
+ setEnvVariable(DatabaseEnvironmentKeys.DB_USER, secret.username);
20
+ setEnvVariable(DatabaseEnvironmentKeys.DB_PASS, secret.password);
21
+ setEnvVariable(DatabaseEnvironmentKeys.DB_URI, secret.proxy_host);
22
+ setEnvVariable(DatabaseEnvironmentKeys.DB_RO_URI, secret.proxy_ro_host);
23
+ }
24
+ }
25
+ //# sourceMappingURL=proxy-holder.js.map
@@ -0,0 +1,25 @@
1
+ import { SecretHolder } from "./secret-holder.js";
2
+ import { RdsSecretKey } from "./dbsecret.js";
3
+ import { getEnvVariable, setEnvVariable } from "../../../utils/utils.js";
4
+ import { DatabaseEnvironmentKeys } from "../../../database/database.js";
5
+ const RDS_SECRET_KEYS = Object.values(RdsSecretKey);
6
+ /**
7
+ * Holds credentials for RDS access.
8
+ */
9
+ export class RdsHolder {
10
+ secretHolder;
11
+ constructor(secretId) {
12
+ this.secretHolder = new SecretHolder(secretId, "", RDS_SECRET_KEYS);
13
+ }
14
+ static create() {
15
+ return new RdsHolder(getEnvVariable("SECRET_ID"));
16
+ }
17
+ async setCredentials() {
18
+ const secret = await this.secretHolder.get();
19
+ setEnvVariable(DatabaseEnvironmentKeys.DB_USER, secret.username);
20
+ setEnvVariable(DatabaseEnvironmentKeys.DB_PASS, secret.password);
21
+ setEnvVariable(DatabaseEnvironmentKeys.DB_URI, secret.host);
22
+ setEnvVariable(DatabaseEnvironmentKeys.DB_RO_URI, secret.ro_host);
23
+ }
24
+ }
25
+ //# sourceMappingURL=rds-holder.js.map
@@ -1,4 +1,7 @@
1
- import { type GenericSecret } from "./secret.mjs";
1
+ import { type GenericSecret } from "./secret.js";
2
+ declare const DEFAULT_CONFIGURATION: {
3
+ readonly ttl: number;
4
+ };
2
5
  /**
3
6
  * Utility class for getting secrets from Secret Manager.
4
7
  * Supports prefix for secrets, checking of expected keys and ttl-configuration.
@@ -9,19 +12,17 @@ import { type GenericSecret } from "./secret.mjs";
9
12
  *
10
13
  * If you want secret manager to get values from different region than the lambda runtime is running, you can override this by
11
14
  * setting the region with utils setSecretOverideAwsRegionEnv method.
12
- *
13
15
  */
14
16
  export declare class SecretHolder<Secret extends GenericSecret> {
15
17
  private readonly secretId;
16
18
  private readonly prefix;
17
19
  private readonly expectedKeys;
18
20
  private readonly secretCache;
19
- constructor(secretId: string, prefix?: string, expectedKeys?: string[], configuration?: {
20
- ttl: number;
21
- });
21
+ constructor(secretId: string, prefix?: string, expectedKeys?: string[], configuration?: typeof DEFAULT_CONFIGURATION);
22
22
  private initSecret;
23
23
  static create<S extends GenericSecret>(prefix?: string, expectedKeys?: string[]): SecretHolder<S>;
24
24
  get(): Promise<Secret>;
25
25
  private parseSecret;
26
26
  private getSecret;
27
27
  }
28
+ export {};
@@ -1,7 +1,7 @@
1
- import { getSecret } from "./secret.mjs";
2
- import { checkExpectedSecretKeys } from "./dbsecret.mjs";
3
- import { getEnvVariable } from "../../../utils/utils.mjs";
4
- import { logger } from "../dt-logger-default.mjs";
1
+ import { getSecret } from "./secret.js";
2
+ import { checkExpectedSecretKeys } from "./dbsecret.js";
3
+ import { getEnvVariable } from "../../../utils/utils.js";
4
+ import { logger } from "../dt-logger-default.js";
5
5
  import NodeTtl from "node-ttl";
6
6
  const DEFAULT_PREFIX = "";
7
7
  const DEFAULT_SECRET_KEY = "SECRET";
@@ -18,7 +18,6 @@ const DEFAULT_CONFIGURATION = {
18
18
  *
19
19
  * If you want secret manager to get values from different region than the lambda runtime is running, you can override this by
20
20
  * setting the region with utils setSecretOverideAwsRegionEnv method.
21
- *
22
21
  */
23
22
  export class SecretHolder {
24
23
  secretId;
@@ -29,7 +28,6 @@ export class SecretHolder {
29
28
  this.secretId = secretId;
30
29
  this.prefix = prefix;
31
30
  this.expectedKeys = expectedKeys;
32
- // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
33
31
  this.secretCache = new NodeTtl(configuration);
34
32
  }
35
33
  async initSecret() {
@@ -38,7 +36,6 @@ export class SecretHolder {
38
36
  method: "SecretHolder.initSecret",
39
37
  message: "Refreshing secret " + this.secretId,
40
38
  });
41
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
42
39
  this.secretCache.push(DEFAULT_SECRET_KEY, secretValue);
43
40
  }
44
41
  static create(prefix = DEFAULT_PREFIX, expectedKeys = []) {
@@ -46,9 +43,7 @@ export class SecretHolder {
46
43
  }
47
44
  async get() {
48
45
  const secret = await this.getSecret();
49
- const parsedSecret = this.prefix === DEFAULT_PREFIX
50
- ? secret
51
- : this.parseSecret(secret, `${this.prefix}.`);
46
+ const parsedSecret = this.prefix === DEFAULT_PREFIX ? secret : this.parseSecret(secret, `${this.prefix}.`);
52
47
  if (this.expectedKeys.length > 0) {
53
48
  checkExpectedSecretKeys(this.expectedKeys, parsedSecret);
54
49
  }
@@ -60,6 +55,10 @@ export class SecretHolder {
60
55
  for (const key in secret) {
61
56
  if (key.startsWith(prefix)) {
62
57
  const withoutPrefix = key.substring(skip);
58
+ // skip undefined values
59
+ if (!secret[key]) {
60
+ continue;
61
+ }
63
62
  parsed[withoutPrefix] = secret[key];
64
63
  }
65
64
  }
@@ -70,7 +69,7 @@ export class SecretHolder {
70
69
  if (!secret) {
71
70
  await this.initSecret();
72
71
  }
73
- return secret ?? (this.secretCache.get(DEFAULT_SECRET_KEY));
72
+ return secret ?? this.secretCache.get(DEFAULT_SECRET_KEY);
74
73
  }
75
74
  }
76
- //# sourceMappingURL=secret-holder.mjs.map
75
+ //# sourceMappingURL=secret-holder.js.map
@@ -1,6 +1,6 @@
1
1
  import { SecretsManager } from "@aws-sdk/client-secrets-manager";
2
- import { getEnvVariable, getEnvVariableOrElse, getEnvVariableSafe } from "../../../utils/utils.mjs";
3
- import { EnvKeys } from "../environment.mjs";
2
+ import { getEnvVariable, getEnvVariableOrElse, getEnvVariableSafe } from "../../../utils/utils.js";
3
+ import { EnvKeys } from "../environment.js";
4
4
  // SECRET_OVERRIDE_AWS_REGION might not have been set before import of
5
5
  // secret, so we need to lazy initialize SecretsManager
6
6
  let smClient;
@@ -32,6 +32,10 @@ function parseSecret(secret, prefix) {
32
32
  for (const key in secret) {
33
33
  if (key.startsWith(prefix)) {
34
34
  const withoutPrefix = key.substring(skip);
35
+ // skip undefined values
36
+ if (!secret[key]) {
37
+ continue;
38
+ }
35
39
  parsed[withoutPrefix] = secret[key];
36
40
  }
37
41
  }
@@ -54,4 +58,4 @@ export async function getFromEnvOrSecret(key, secretId) {
54
58
  }
55
59
  throw new Error(`Cannot get value with key ${key} from env or secret`);
56
60
  }
57
- //# sourceMappingURL=secret.mjs.map
61
+ //# sourceMappingURL=secret.js.map
@@ -10,4 +10,4 @@ export class ValidationError extends Error {
10
10
  this.statusCode = statusCode;
11
11
  }
12
12
  }
13
- //# sourceMappingURL=errors.mjs.map
13
+ //# sourceMappingURL=errors.js.map
@@ -67,4 +67,4 @@ export class LambdaResponse {
67
67
  function toBase64(body) {
68
68
  return Buffer.from(body).toString("base64");
69
69
  }
70
- //# sourceMappingURL=lambda-response.mjs.map
70
+ //# sourceMappingURL=lambda-response.js.map
@@ -11,4 +11,4 @@ export var MediaType;
11
11
  MediaType["TEXT_CSV"] = "text/csv";
12
12
  MediaType["APPLICATION_JSON_UTF8"] = "application/json;charset=UTF-8";
13
13
  })(MediaType || (MediaType = {}));
14
- //# sourceMappingURL=mediatypes.mjs.map
14
+ //# sourceMappingURL=mediatypes.js.map
@@ -1,4 +1,4 @@
1
- import { Model } from "aws-cdk-lib/aws-apigateway";
1
+ import type { Model } from "aws-cdk-lib/aws-apigateway";
2
2
  /**
3
3
  * Model object with a reference to an API Gateway model object.
4
4
  */
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=model-with-reference.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=proxytypes.js.map
@@ -0,0 +1,4 @@
1
+ // DEPRECATED! This must be replaced with new application specific tags
2
+ export const BETA_TAGS = ["Beta"];
3
+ export const DATA_V1_TAGS = ["Data v1"];
4
+ //# sourceMappingURL=tags.js.map
@@ -1,4 +1,4 @@
1
- import type { DTDatabase, DTTransaction } from "./database.mjs";
1
+ import type { DTDatabase, DTTransaction } from "./database.js";
2
2
  export interface CachedValue<T> {
3
3
  content: T;
4
4
  last_updated: Date;
@@ -32,10 +32,8 @@ export function getJsonFromCache(db, cacheKey) {
32
32
  .then((value) => value?.content ?? undefined);
33
33
  }
34
34
  export async function getFromCache(db, cacheKey) {
35
- return db
36
- .oneOrNone(PS_GET_CACHE_VALUE, [cacheKey])
37
- .then((result) => {
35
+ return db.oneOrNone(PS_GET_CACHE_VALUE, [cacheKey]).then((result) => {
38
36
  return result ?? undefined;
39
37
  });
40
38
  }
41
- //# sourceMappingURL=cached.mjs.map
39
+ //# sourceMappingURL=cached.js.map