@digitraffic/common 2026.3.17-1 → 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.
Files changed (238) hide show
  1. package/README.md +18 -1
  2. package/dist/__test__/asserter.d.ts +13 -0
  3. package/dist/__test__/asserter.js +39 -0
  4. package/dist/__test__/db-testutils.d.ts +3 -0
  5. package/dist/__test__/db-testutils.js +38 -0
  6. package/dist/__test__/dependencies.test.d.ts +1 -0
  7. package/dist/__test__/dependencies.test.js +21 -0
  8. package/dist/__test__/imports.test.d.ts +1 -0
  9. package/dist/__test__/imports.test.js +318 -0
  10. package/dist/__test__/infra/acl-builder.test.d.ts +1 -0
  11. package/dist/__test__/infra/acl-builder.test.js +72 -0
  12. package/dist/__test__/infra/api/handler-factory.test.d.ts +1 -0
  13. package/dist/__test__/infra/api/handler-factory.test.js +42 -0
  14. package/dist/__test__/infra/api/integration.test.d.ts +1 -0
  15. package/dist/__test__/infra/api/integration.test.js +162 -0
  16. package/dist/__test__/infra/api/response.test.d.ts +1 -0
  17. package/dist/__test__/infra/api/response.test.js +77 -0
  18. package/dist/__test__/infra/api/static-integration.test.d.ts +1 -0
  19. package/dist/__test__/infra/api/static-integration.test.js +35 -0
  20. package/dist/__test__/infra/documentation.test.d.ts +1 -0
  21. package/dist/__test__/infra/documentation.test.js +38 -0
  22. package/dist/__test__/infra/scheduler.test.d.ts +1 -0
  23. package/dist/__test__/infra/scheduler.test.js +23 -0
  24. package/dist/__test__/infra/security-rule.test.d.ts +1 -0
  25. package/dist/__test__/infra/security-rule.test.js +21 -0
  26. package/dist/__test__/infra/stack/rest-apis.test.d.ts +1 -0
  27. package/dist/__test__/infra/stack/rest-apis.test.js +47 -0
  28. package/dist/__test__/marine/id_utils.test.d.ts +1 -0
  29. package/dist/__test__/marine/id_utils.test.js +45 -0
  30. package/dist/__test__/mock-ky.d.ts +2 -0
  31. package/dist/__test__/mock-ky.js +15 -0
  32. package/dist/__test__/promise/promise.test.d.ts +1 -0
  33. package/dist/__test__/promise/promise.test.js +126 -0
  34. package/dist/__test__/runtime/dt-logger.test.d.ts +1 -0
  35. package/dist/__test__/runtime/dt-logger.test.js +193 -0
  36. package/dist/__test__/secrets/secret-holder.test.d.ts +1 -0
  37. package/dist/__test__/secrets/secret-holder.test.js +96 -0
  38. package/dist/__test__/secrets/secret.test.d.ts +1 -0
  39. package/dist/__test__/secrets/secret.test.js +57 -0
  40. package/dist/__test__/stack/dt-function.test.d.ts +1 -0
  41. package/dist/__test__/stack/dt-function.test.js +340 -0
  42. package/dist/__test__/stack/rest-apis.test.d.ts +1 -0
  43. package/dist/__test__/stack/rest-apis.test.js +45 -0
  44. package/dist/__test__/test/mock-ky.test.d.ts +1 -0
  45. package/dist/__test__/test/mock-ky.test.js +46 -0
  46. package/dist/__test__/testutils.d.ts +12 -0
  47. package/dist/__test__/testutils.js +32 -0
  48. package/dist/__test__/types/lambda-proxy-types.test.d.ts +8 -0
  49. package/dist/__test__/types/lambda-proxy-types.test.js +155 -0
  50. package/dist/__test__/types/lambda-response-builder.test.d.ts +1 -0
  51. package/dist/__test__/types/lambda-response-builder.test.js +81 -0
  52. package/dist/__test__/types/lambda-response.test.d.ts +9 -0
  53. package/dist/__test__/types/lambda-response.test.js +73 -0
  54. package/dist/__test__/utils/base64.test.d.ts +1 -0
  55. package/dist/__test__/utils/base64.test.js +38 -0
  56. package/dist/__test__/utils/date-utils.test.d.ts +1 -0
  57. package/dist/__test__/utils/date-utils.test.js +32 -0
  58. package/dist/__test__/utils/geometry.test.d.ts +1 -0
  59. package/dist/__test__/utils/geometry.test.js +25 -0
  60. package/dist/__test__/utils/lambda-proxy-event.test.d.ts +1 -0
  61. package/dist/__test__/utils/lambda-proxy-event.test.js +45 -0
  62. package/dist/__test__/utils/logging.test.d.ts +1 -0
  63. package/dist/__test__/utils/logging.test.js +75 -0
  64. package/dist/__test__/utils/stop-watch.test.d.ts +1 -0
  65. package/dist/__test__/utils/stop-watch.test.js +118 -0
  66. package/dist/__test__/utils/utils.test.d.ts +1 -0
  67. package/dist/__test__/utils/utils.test.js +48 -0
  68. package/dist/aws/infra/acl-builder.d.ts +53 -0
  69. package/dist/aws/infra/acl-builder.js +407 -0
  70. package/dist/aws/infra/api/handler-factory.d.ts +22 -0
  71. package/dist/aws/infra/api/handler-factory.js +68 -0
  72. package/dist/aws/infra/api/integration.d.ts +49 -0
  73. package/dist/aws/infra/api/integration.js +162 -0
  74. package/dist/aws/infra/api/response.d.ts +62 -0
  75. package/dist/aws/infra/api/response.js +132 -0
  76. package/dist/aws/infra/api/responses.d.ts +60 -0
  77. package/dist/aws/infra/api/responses.js +90 -0
  78. package/dist/aws/infra/api/static-integration.d.ts +16 -0
  79. package/dist/aws/infra/api/static-integration.js +76 -0
  80. package/dist/aws/infra/bucket-policy.d.ts +38 -0
  81. package/dist/aws/infra/bucket-policy.js +30 -0
  82. package/dist/aws/infra/canaries/canary-alarm.d.ts +6 -0
  83. package/dist/aws/infra/canaries/canary-alarm.js +20 -0
  84. package/dist/aws/infra/canaries/canary-keys.d.ts +3 -0
  85. package/dist/aws/infra/canaries/canary-keys.js +4 -0
  86. package/dist/aws/infra/canaries/canary-parameters.d.ts +19 -0
  87. package/dist/aws/infra/canaries/canary-parameters.js +2 -0
  88. package/dist/aws/infra/canaries/canary-role.d.ts +14 -0
  89. package/dist/aws/infra/canaries/canary-role.js +51 -0
  90. package/dist/aws/infra/canaries/canary.d.ts +8 -0
  91. package/dist/aws/infra/canaries/canary.js +26 -0
  92. package/dist/aws/infra/canaries/database-canary.d.ts +17 -0
  93. package/dist/aws/infra/canaries/database-canary.js +65 -0
  94. package/dist/aws/infra/canaries/database-checker.d.ts +33 -0
  95. package/dist/aws/infra/canaries/database-checker.js +119 -0
  96. package/dist/aws/infra/canaries/url-canary.d.ts +16 -0
  97. package/dist/aws/infra/canaries/url-canary.js +55 -0
  98. package/dist/aws/infra/canaries/url-checker.d.ts +45 -0
  99. package/dist/aws/infra/canaries/url-checker.js +256 -0
  100. package/dist/aws/infra/documentation.d.ts +56 -0
  101. package/dist/aws/infra/documentation.js +90 -0
  102. package/dist/aws/infra/import-util.d.ts +17 -0
  103. package/dist/aws/infra/import-util.js +41 -0
  104. package/dist/aws/infra/scheduler.d.ts +12 -0
  105. package/dist/aws/infra/scheduler.js +27 -0
  106. package/dist/aws/infra/security-rule.d.ts +12 -0
  107. package/dist/aws/infra/security-rule.js +35 -0
  108. package/dist/aws/infra/sqs-integration.d.ts +4 -0
  109. package/dist/aws/infra/sqs-integration.js +85 -0
  110. package/dist/aws/infra/sqs-queue.d.ts +19 -0
  111. package/dist/aws/infra/sqs-queue.js +145 -0
  112. package/dist/aws/infra/stack/dt-function-alarms.d.ts +29 -0
  113. package/dist/aws/infra/stack/dt-function-alarms.js +54 -0
  114. package/dist/aws/infra/stack/dt-function.d.ts +124 -0
  115. package/dist/aws/infra/stack/dt-function.js +315 -0
  116. package/dist/aws/infra/stack/lambda-configs.d.ts +44 -0
  117. package/dist/aws/infra/stack/lambda-configs.js +71 -0
  118. package/dist/aws/infra/stack/lambda-log-group.d.ts +15 -0
  119. package/dist/aws/infra/stack/lambda-log-group.js +24 -0
  120. package/dist/aws/infra/stack/monitoredfunction.d.ts +85 -0
  121. package/dist/aws/infra/stack/monitoredfunction.js +147 -0
  122. package/dist/aws/infra/stack/parameters.d.ts +40 -0
  123. package/dist/aws/infra/stack/parameters.js +50 -0
  124. package/dist/aws/infra/stack/rest-api.d.ts +74 -0
  125. package/dist/aws/infra/stack/rest-api.js +235 -0
  126. package/dist/aws/infra/stack/stack-checking-aspect.d.ts +20 -0
  127. package/dist/aws/infra/stack/stack-checking-aspect.js +183 -0
  128. package/dist/aws/infra/stack/stack.d.ts +56 -0
  129. package/dist/aws/infra/stack/stack.js +71 -0
  130. package/dist/aws/infra/stack/subscription.d.ts +17 -0
  131. package/dist/aws/infra/stack/subscription.js +37 -0
  132. package/dist/aws/infra/stacks/db-dns-stack.d.ts +13 -0
  133. package/dist/aws/infra/stacks/db-dns-stack.js +60 -0
  134. package/dist/aws/infra/stacks/db-proxy-stack.d.ts +24 -0
  135. package/dist/aws/infra/stacks/db-proxy-stack.js +74 -0
  136. package/dist/aws/infra/stacks/db-stack.d.ts +65 -0
  137. package/dist/aws/infra/stacks/db-stack.js +189 -0
  138. package/dist/aws/infra/stacks/intra-stack-configuration.d.ts +5 -0
  139. package/dist/aws/infra/stacks/intra-stack-configuration.js +2 -0
  140. package/dist/aws/infra/stacks/network-stack.d.ts +14 -0
  141. package/dist/aws/infra/stacks/network-stack.js +45 -0
  142. package/dist/aws/infra/usage-plans.d.ts +16 -0
  143. package/dist/aws/infra/usage-plans.js +38 -0
  144. package/dist/aws/runtime/apikey.d.ts +2 -0
  145. package/dist/aws/runtime/apikey.js +13 -0
  146. package/dist/aws/runtime/digitraffic-integration-response.d.ts +8 -0
  147. package/dist/aws/runtime/digitraffic-integration-response.js +25 -0
  148. package/dist/aws/runtime/dt-logger-default.d.ts +9 -0
  149. package/dist/aws/runtime/dt-logger-default.js +6 -0
  150. package/dist/aws/runtime/dt-logger.d.ts +117 -0
  151. package/dist/aws/runtime/dt-logger.js +159 -0
  152. package/dist/aws/runtime/environment.d.ts +5 -0
  153. package/dist/aws/runtime/environment.js +7 -0
  154. package/dist/aws/runtime/s3.d.ts +3 -0
  155. package/dist/aws/runtime/s3.js +21 -0
  156. package/dist/aws/runtime/secrets/dbsecret.d.ts +16 -0
  157. package/dist/aws/runtime/secrets/dbsecret.js +26 -0
  158. package/dist/aws/runtime/secrets/proxy-holder.d.ts +9 -0
  159. package/dist/aws/runtime/secrets/proxy-holder.js +25 -0
  160. package/dist/aws/runtime/secrets/rds-holder.d.ts +9 -0
  161. package/dist/aws/runtime/secrets/rds-holder.js +25 -0
  162. package/dist/aws/runtime/secrets/secret-holder.d.ts +30 -0
  163. package/dist/aws/runtime/secrets/secret-holder.js +81 -0
  164. package/dist/aws/runtime/secrets/secret.d.ts +8 -0
  165. package/dist/aws/runtime/secrets/secret.js +61 -0
  166. package/dist/aws/types/errors.d.ts +8 -0
  167. package/dist/aws/types/errors.js +13 -0
  168. package/dist/aws/types/lambda-proxy-types.d.ts +59 -0
  169. package/dist/aws/types/lambda-proxy-types.js +210 -0
  170. package/dist/aws/types/lambda-response.d.ts +89 -0
  171. package/dist/aws/types/lambda-response.js +204 -0
  172. package/dist/aws/types/mediatypes.d.ts +11 -0
  173. package/dist/aws/types/mediatypes.js +14 -0
  174. package/dist/aws/types/model-with-reference.d.ts +7 -0
  175. package/dist/aws/types/model-with-reference.js +2 -0
  176. package/dist/aws/types/tags.d.ts +2 -0
  177. package/dist/aws/types/tags.js +4 -0
  178. package/dist/database/database.d.ts +27 -0
  179. package/dist/database/database.js +95 -0
  180. package/dist/database/last-updated.d.ts +15 -0
  181. package/dist/database/last-updated.js +46 -0
  182. package/dist/database/models.d.ts +6 -0
  183. package/dist/database/models.js +2 -0
  184. package/dist/index.d.ts +2 -0
  185. package/dist/index.js +2 -0
  186. package/dist/marine/id_utils.d.ts +3 -0
  187. package/dist/marine/id_utils.js +36 -0
  188. package/dist/marine/rtz.d.ts +48 -0
  189. package/dist/marine/rtz.js +2 -0
  190. package/dist/types/async-timeout-error.d.ts +3 -0
  191. package/dist/types/async-timeout-error.js +6 -0
  192. package/dist/types/either.d.ts +9 -0
  193. package/dist/types/either.js +2 -0
  194. package/dist/types/geojson.d.ts +47 -0
  195. package/dist/types/geojson.js +51 -0
  196. package/dist/types/http-error.d.ts +4 -0
  197. package/dist/types/http-error.js +8 -0
  198. package/dist/types/input-error.d.ts +2 -0
  199. package/dist/types/input-error.js +3 -0
  200. package/dist/types/language.d.ts +5 -0
  201. package/dist/types/language.js +7 -0
  202. package/dist/types/nullable.d.ts +24 -0
  203. package/dist/types/nullable.js +2 -0
  204. package/dist/types/openapi-schema.d.ts +932 -0
  205. package/dist/types/openapi-schema.js +151 -0
  206. package/dist/types/traffictype.d.ts +11 -0
  207. package/dist/types/traffictype.js +13 -0
  208. package/dist/types/urn.d.ts +1 -0
  209. package/dist/types/urn.js +2 -0
  210. package/dist/types/util-types.d.ts +11 -0
  211. package/dist/types/util-types.js +2 -0
  212. package/dist/types/validator.d.ts +4 -0
  213. package/dist/types/validator.js +9 -0
  214. package/dist/utils/api-model.d.ts +51 -0
  215. package/dist/utils/api-model.js +118 -0
  216. package/dist/utils/base64.d.ts +34 -0
  217. package/dist/utils/base64.js +53 -0
  218. package/dist/utils/date-utils.d.ts +27 -0
  219. package/dist/utils/date-utils.js +45 -0
  220. package/dist/utils/geojson-types.d.ts +14 -0
  221. package/dist/utils/geojson-types.js +15 -0
  222. package/dist/utils/geometry.d.ts +44 -0
  223. package/dist/utils/geometry.js +154 -0
  224. package/dist/utils/lambda-proxy-event.d.ts +9 -0
  225. package/dist/utils/lambda-proxy-event.js +31 -0
  226. package/dist/utils/logging.d.ts +40 -0
  227. package/dist/utils/logging.js +88 -0
  228. package/dist/utils/retry.d.ts +33 -0
  229. package/dist/utils/retry.js +135 -0
  230. package/dist/utils/slack.d.ts +5 -0
  231. package/dist/utils/slack.js +24 -0
  232. package/dist/utils/stop-watch.d.ts +46 -0
  233. package/dist/utils/stop-watch.js +114 -0
  234. package/dist/utils/utils.d.ts +95 -0
  235. package/dist/utils/utils.js +178 -0
  236. package/dist/utils/zod-utils.d.ts +27 -0
  237. package/dist/utils/zod-utils.js +57 -0
  238. package/package.json +30 -28
@@ -0,0 +1,60 @@
1
+ import { Duration, RemovalPolicy, Stack } from "aws-cdk-lib";
2
+ import { PrivateHostedZone, RecordSet, RecordTarget, RecordType, } from "aws-cdk-lib/aws-route53";
3
+ import { importVpc } from "../import-util.js";
4
+ import { getParameterValue } from "../stack/parameters.js";
5
+ const DEFAULT_RECORD_TTL = Duration.seconds(30);
6
+ /**
7
+ * Creates a dns local zone and creates records for cluster endpoints and proxy endpoints.
8
+ *
9
+ * Please note, that created PrivateHostedZone has RETAIN removalPolicy, so if you want to delete this stack,
10
+ * you must remove the zone by hand after.
11
+ */
12
+ export class DbDnsStack extends Stack {
13
+ constructor(scope, id, isc) {
14
+ super(scope, id, {
15
+ env: isc.env,
16
+ });
17
+ this.createDnsRecords(isc);
18
+ }
19
+ createDnsRecords(isc) {
20
+ const vpc = importVpc(this, isc.environmentName);
21
+ const zone = new PrivateHostedZone(this, "DNSHostedZone", {
22
+ zoneName: `${isc.environmentName}.local`,
23
+ vpc,
24
+ });
25
+ zone.applyRemovalPolicy(RemovalPolicy.RETAIN);
26
+ const clusterReaderEndpoint = getParameterValue(this, "cluster.reader");
27
+ const clusterWriterEndpoint = getParameterValue(this, "cluster.writer");
28
+ const proxyReaderEndpoint = getParameterValue(this, "proxy.reader");
29
+ const proxyWriterEndpoint = getParameterValue(this, "proxy.writer");
30
+ new RecordSet(this, "ReaderRecord", {
31
+ recordType: RecordType.CNAME,
32
+ recordName: `db-ro.${isc.environmentName}.local`,
33
+ target: RecordTarget.fromValues(clusterReaderEndpoint),
34
+ ttl: DEFAULT_RECORD_TTL,
35
+ zone,
36
+ });
37
+ new RecordSet(this, "WriterRecord", {
38
+ recordType: RecordType.CNAME,
39
+ recordName: `db.${isc.environmentName}.local`,
40
+ target: RecordTarget.fromValues(clusterWriterEndpoint),
41
+ ttl: DEFAULT_RECORD_TTL,
42
+ zone,
43
+ });
44
+ new RecordSet(this, "ProxyReaderRecord", {
45
+ recordType: RecordType.CNAME,
46
+ recordName: `proxy-ro.${isc.environmentName}.local`,
47
+ target: RecordTarget.fromValues(proxyReaderEndpoint),
48
+ ttl: DEFAULT_RECORD_TTL,
49
+ zone,
50
+ });
51
+ new RecordSet(this, "ProxyWriterRecord", {
52
+ recordType: RecordType.CNAME,
53
+ recordName: `proxy.${isc.environmentName}.local`,
54
+ target: RecordTarget.fromValues(proxyWriterEndpoint),
55
+ ttl: DEFAULT_RECORD_TTL,
56
+ zone,
57
+ });
58
+ }
59
+ }
60
+ //# sourceMappingURL=db-dns-stack.js.map
@@ -0,0 +1,24 @@
1
+ import type { IVpc } from "aws-cdk-lib/aws-ec2";
2
+ import { CfnDBProxyEndpoint, DatabaseProxy } from "aws-cdk-lib/aws-rds";
3
+ import type { ISecret } from "aws-cdk-lib/aws-secretsmanager";
4
+ import { Stack } from "aws-cdk-lib/core";
5
+ import type { Construct } from "constructs/lib/construct.js";
6
+ import type { InfraStackConfiguration } from "./intra-stack-configuration.js";
7
+ export interface ProxyConfiguration {
8
+ readonly secretArn: string;
9
+ readonly name?: string;
10
+ readonly securityGroupId: string;
11
+ readonly clusterIdentifier: string;
12
+ }
13
+ /**
14
+ * A stack that creates a Database proxy.
15
+ */
16
+ export declare class DbProxyStack extends Stack {
17
+ readonly isc: InfraStackConfiguration;
18
+ static PROXY_READER_EXPORT_NAME: string;
19
+ static PROXY_WRITER_EXPORT_NAME: string;
20
+ constructor(scope: Construct, id: string, isc: InfraStackConfiguration, configuration: ProxyConfiguration);
21
+ setOutputs(proxy: DatabaseProxy): void;
22
+ createProxy(vpc: IVpc, secret: ISecret, configuration: ProxyConfiguration): DatabaseProxy;
23
+ createProxyEndpoints(vpc: IVpc, proxy: DatabaseProxy, securityGroupId: string): CfnDBProxyEndpoint;
24
+ }
@@ -0,0 +1,74 @@
1
+ import { SecurityGroup } from "aws-cdk-lib/aws-ec2";
2
+ import { CfnDBProxyEndpoint, DatabaseCluster, DatabaseClusterEngine, DatabaseProxy, ProxyTarget, } from "aws-cdk-lib/aws-rds";
3
+ import { Secret } from "aws-cdk-lib/aws-secretsmanager";
4
+ import { Duration, Stack } from "aws-cdk-lib/core";
5
+ import { exportValue, importVpc } from "../import-util.js";
6
+ import { createParameter } from "../stack/parameters.js";
7
+ import { DbStack } from "./db-stack.js";
8
+ /**
9
+ * A stack that creates a Database proxy.
10
+ */
11
+ export class DbProxyStack extends Stack {
12
+ isc;
13
+ static PROXY_READER_EXPORT_NAME = "db-reader-endpoint";
14
+ static PROXY_WRITER_EXPORT_NAME = "db-writer-endpoint";
15
+ constructor(scope, id, isc, configuration) {
16
+ super(scope, id, {
17
+ env: isc.env,
18
+ });
19
+ this.isc = isc;
20
+ if (configuration.clusterIdentifier === "") {
21
+ throw new Error("Empty cluster identifier!");
22
+ }
23
+ const vpc = importVpc(this, isc.environmentName);
24
+ const secret = Secret.fromSecretAttributes(this, "proxy-secret", {
25
+ secretCompleteArn: configuration.secretArn,
26
+ });
27
+ const proxy = this.createProxy(vpc, secret, configuration);
28
+ const readerEndpoint = this.createProxyEndpoints(vpc, proxy, configuration.securityGroupId);
29
+ createParameter(this, "proxy.reader", readerEndpoint.attrEndpoint);
30
+ createParameter(this, "proxy.writer", proxy.endpoint);
31
+ this.setOutputs(proxy);
32
+ }
33
+ setOutputs(proxy) {
34
+ // if only one instance, then there is no reader-endpoint
35
+ exportValue(this, this.isc.environmentName, DbProxyStack.PROXY_READER_EXPORT_NAME, proxy.endpoint);
36
+ exportValue(this, this.isc.environmentName, DbProxyStack.PROXY_WRITER_EXPORT_NAME, proxy.endpoint);
37
+ }
38
+ createProxy(vpc, secret, configuration) {
39
+ const proxyId = `${this.isc.environmentName}-proxy`;
40
+ const securityGroup = SecurityGroup.fromSecurityGroupId(this, "securitygroup", configuration.securityGroupId);
41
+ const cluster = DatabaseCluster.fromDatabaseClusterAttributes(this, "db-cluster", {
42
+ clusterIdentifier: configuration.clusterIdentifier,
43
+ engine: DatabaseClusterEngine.AURORA_POSTGRESQL,
44
+ port: DbStack.CLUSTER_PORT,
45
+ });
46
+ // CDK tries to allow connections between proxy and cluster
47
+ // this does not work on cluster references
48
+ cluster.connections.allowDefaultPortFrom = () => {
49
+ /* nothing */
50
+ };
51
+ return new DatabaseProxy(this, proxyId, {
52
+ dbProxyName: configuration.name ?? "AuroraProxy",
53
+ securityGroups: [securityGroup],
54
+ proxyTarget: ProxyTarget.fromCluster(cluster),
55
+ idleClientTimeout: Duration.seconds(1800),
56
+ maxConnectionsPercent: 50,
57
+ maxIdleConnectionsPercent: 25,
58
+ borrowTimeout: Duration.seconds(120),
59
+ requireTLS: false,
60
+ secrets: [secret],
61
+ vpc: vpc,
62
+ });
63
+ }
64
+ createProxyEndpoints(vpc, proxy, securityGroupId) {
65
+ return new CfnDBProxyEndpoint(this, "ReaderEndpoint", {
66
+ dbProxyEndpointName: "ReaderEndpoint",
67
+ dbProxyName: proxy.dbProxyName,
68
+ vpcSubnetIds: vpc.privateSubnets.map((sub) => sub.subnetId),
69
+ vpcSecurityGroupIds: [securityGroupId],
70
+ targetRole: "READ_ONLY",
71
+ });
72
+ }
73
+ }
74
+ //# sourceMappingURL=db-proxy-stack.js.map
@@ -0,0 +1,65 @@
1
+ import type { InstanceType, ISecurityGroup, IVpc } from "aws-cdk-lib/aws-ec2";
2
+ import { Key } from "aws-cdk-lib/aws-kms";
3
+ import type { AuroraPostgresEngineVersion, DatabaseClusterProps, IParameterGroup } from "aws-cdk-lib/aws-rds";
4
+ import { DatabaseCluster } from "aws-cdk-lib/aws-rds";
5
+ import { Stack } from "aws-cdk-lib/core";
6
+ import type { Construct } from "constructs/lib/construct.js";
7
+ import type { InfraStackConfiguration } from "./intra-stack-configuration.js";
8
+ export interface DbConfiguration {
9
+ readonly cluster?: ClusterConfiguration;
10
+ readonly clusterImport?: ClusterImportConfiguration;
11
+ readonly storageEncrypted?: boolean;
12
+ readonly customParameterGroups: AuroraPostgresEngineVersion[];
13
+ readonly workmem?: number;
14
+ /** superuser username and password are fetched from this secret, using keys
15
+ * db.superuser and db.superuser.password
16
+ */
17
+ readonly secretArn: string;
18
+ /** If this is not specified, import default vpc */
19
+ readonly vpc?: IVpc;
20
+ }
21
+ export interface ClusterDbInstanceConfiguration {
22
+ readonly instanceType: InstanceType;
23
+ readonly isFromLegacyInstanceProps?: boolean;
24
+ }
25
+ export interface ClusterConfiguration {
26
+ readonly securityGroupId: string;
27
+ readonly snapshotIdentifier?: string;
28
+ readonly dbVersion: AuroraPostgresEngineVersion;
29
+ readonly writer: ClusterDbInstanceConfiguration;
30
+ readonly readers: ClusterDbInstanceConfiguration[];
31
+ }
32
+ export interface ClusterImportConfiguration {
33
+ readonly clusterReadEndpoint: string;
34
+ readonly clusterWriteEndpoint: string;
35
+ }
36
+ /**
37
+ * Parse cluster identifier from cluster writer endpoint.
38
+ * i.e. <i>stackenv-stackenvxxx-xxx.cluster-xxx.region.rds.amazonaws.com</i>
39
+ * -> <i>stackenv-stackenvxxx-xxx</i>
40
+ * @param clusterImport ClusterImportConfiguration to resolve cluster identifier
41
+ * @param fallbackValue If parse fails return fallback value. If not given will throw error.
42
+ * @throws Error If not cluster is found and no fallbackValue is given.
43
+ */
44
+ export declare function parseClusterIdentifier(clusterImport?: ClusterImportConfiguration, fallbackValue?: string): string;
45
+ /**
46
+ * Stack that creates DatabaseCluster.
47
+ *
48
+ * Please not, that created Cluster has RETAIL removalPolicy, so if you want to delete the stack,
49
+ * you must first deploy without parameter group, then delete stack and manually delete cluster.
50
+ *
51
+ * You should deploy once with cluster and then without. This way you can create the cluster with this
52
+ * stack, but cluster is not part of the stack after that.
53
+ */
54
+ export declare class DbStack extends Stack {
55
+ static CLUSTER_PORT: number;
56
+ static CLUSTER_IDENTIFIER_EXPORT_NAME: string;
57
+ static CLUSTER_READ_ENDPOINT_EXPORT_NAME: string;
58
+ static CLUSTER_WRITE_ENDPOINT_EXPORT_NAME: string;
59
+ clusterIdentifier: string;
60
+ constructor(scope: Construct, id: string, isc: InfraStackConfiguration, configuration: DbConfiguration);
61
+ createParameterGroups(customVersions: AuroraPostgresEngineVersion[], workmem: number): IParameterGroup[];
62
+ createClusterParameters(secretArn: string, clusterConfiguration: ClusterConfiguration, instanceName: string, vpc: IVpc, securityGroup: ISecurityGroup, parameterGroup: IParameterGroup, storageEncrypted: boolean | undefined, rdsKey: Key | undefined): DatabaseClusterProps;
63
+ createRDSKey(instanceName: string, environmentName: string): Key;
64
+ createAuroraCluster(isc: InfraStackConfiguration, configuration: DbConfiguration, clusterConfiguration: ClusterConfiguration, parameterGroups: IParameterGroup[], instanceName: string, rdsKey: Key | undefined): DatabaseCluster;
65
+ }
@@ -0,0 +1,189 @@
1
+ import { SecurityGroup, SubnetType } from "aws-cdk-lib/aws-ec2";
2
+ import { Key } from "aws-cdk-lib/aws-kms";
3
+ import { CfnDBInstance, ClusterInstance, Credentials, DatabaseCluster, DatabaseClusterEngine, DatabaseClusterFromSnapshot, InstanceUpdateBehaviour, ParameterGroup, } from "aws-cdk-lib/aws-rds";
4
+ import { Secret } from "aws-cdk-lib/aws-secretsmanager";
5
+ import { Duration, RemovalPolicy, Stack } from "aws-cdk-lib/core";
6
+ import { exportValue, importVpc } from "../import-util.js";
7
+ import { createParameter } from "../stack/parameters.js";
8
+ /**
9
+ * Parse cluster identifier from cluster writer endpoint.
10
+ * i.e. <i>stackenv-stackenvxxx-xxx.cluster-xxx.region.rds.amazonaws.com</i>
11
+ * -> <i>stackenv-stackenvxxx-xxx</i>
12
+ * @param clusterImport ClusterImportConfiguration to resolve cluster identifier
13
+ * @param fallbackValue If parse fails return fallback value. If not given will throw error.
14
+ * @throws Error If not cluster is found and no fallbackValue is given.
15
+ */
16
+ export function parseClusterIdentifier(clusterImport, fallbackValue) {
17
+ if (clusterImport?.clusterWriteEndpoint.includes(".cluster") &&
18
+ clusterImport.clusterWriteEndpoint.split(".cluster")[0]) {
19
+ // @ts-expect-error this is checked above
20
+ return clusterImport.clusterWriteEndpoint.split(".cluster")[0];
21
+ }
22
+ if (fallbackValue) {
23
+ return fallbackValue;
24
+ }
25
+ throw new Error([
26
+ `Could not resolve 'clusterIdentifier' from 'configuration.clusterImport': ${clusterImport?.clusterWriteEndpoint}.,
27
+ 'configuration.clusterImport.clusterWriteEndpoint' didn't contain '.cluster'`,
28
+ ].join(" "));
29
+ }
30
+ /**
31
+ * Stack that creates DatabaseCluster.
32
+ *
33
+ * Please not, that created Cluster has RETAIL removalPolicy, so if you want to delete the stack,
34
+ * you must first deploy without parameter group, then delete stack and manually delete cluster.
35
+ *
36
+ * You should deploy once with cluster and then without. This way you can create the cluster with this
37
+ * stack, but cluster is not part of the stack after that.
38
+ */
39
+ export class DbStack extends Stack {
40
+ static CLUSTER_PORT = 5432;
41
+ static CLUSTER_IDENTIFIER_EXPORT_NAME = "db-cluster";
42
+ static CLUSTER_READ_ENDPOINT_EXPORT_NAME = "db-cluster-reader-endpoint";
43
+ static CLUSTER_WRITE_ENDPOINT_EXPORT_NAME = "db-cluster-writer-endpoint";
44
+ clusterIdentifier = "";
45
+ constructor(scope, id, isc, configuration) {
46
+ super(scope, id, {
47
+ env: isc.env,
48
+ });
49
+ const parameterGroups = this.createParameterGroups(configuration.customParameterGroups, configuration.workmem ?? 524288);
50
+ if ((configuration.cluster && configuration.clusterImport) ||
51
+ (!configuration.cluster && !configuration.clusterImport)) {
52
+ throw new Error("Configure either cluster or clusterImport");
53
+ }
54
+ const instanceName = `${isc.environmentName}-db`;
55
+ const rdsKey = configuration?.storageEncrypted
56
+ ? this.createRDSKey(instanceName, isc.environmentName)
57
+ : undefined;
58
+ // create cluster if this is wanted, should do it only once
59
+ if (configuration.cluster) {
60
+ const cluster = this.createAuroraCluster(isc, configuration, configuration.cluster, parameterGroups, instanceName, rdsKey);
61
+ exportValue(this, isc.environmentName, DbStack.CLUSTER_IDENTIFIER_EXPORT_NAME, cluster.clusterIdentifier);
62
+ exportValue(this, isc.environmentName, DbStack.CLUSTER_WRITE_ENDPOINT_EXPORT_NAME, cluster.clusterEndpoint.hostname);
63
+ exportValue(this, isc.environmentName, DbStack.CLUSTER_READ_ENDPOINT_EXPORT_NAME, cluster.clusterReadEndpoint.hostname);
64
+ createParameter(this, "cluster.reader", cluster.clusterReadEndpoint.hostname);
65
+ createParameter(this, "cluster.writer", cluster.clusterEndpoint.hostname);
66
+ createParameter(this, "cluster.identifier", cluster.clusterIdentifier);
67
+ this.clusterIdentifier = cluster.clusterIdentifier;
68
+ }
69
+ if (configuration.clusterImport) {
70
+ this.clusterIdentifier = parseClusterIdentifier(configuration.clusterImport);
71
+ createParameter(this, "cluster.reader", configuration.clusterImport.clusterReadEndpoint);
72
+ createParameter(this, "cluster.writer", configuration.clusterImport.clusterWriteEndpoint);
73
+ createParameter(this, "cluster.identifier", this.clusterIdentifier);
74
+ }
75
+ }
76
+ createParameterGroups(customVersions, workmem) {
77
+ return customVersions.map((version) => {
78
+ const pg = new ParameterGroup(this, `parameter-group-${version.auroraPostgresMajorVersion}`, {
79
+ engine: DatabaseClusterEngine.auroraPostgres({
80
+ version,
81
+ }),
82
+ parameters: {
83
+ "pg_stat_statements.track": "ALL",
84
+ random_page_cost: "1",
85
+ work_mem: workmem.toString(),
86
+ },
87
+ });
88
+ // create both cluster parameter group and instance parameter group
89
+ pg.bindToCluster({});
90
+ pg.bindToInstance({});
91
+ return pg;
92
+ });
93
+ }
94
+ createClusterParameters(secretArn, clusterConfiguration, instanceName, vpc, securityGroup, parameterGroup, storageEncrypted, rdsKey) {
95
+ const secret = Secret.fromSecretCompleteArn(this, "DBSecret", secretArn);
96
+ const defaultDbInstanceProps = {
97
+ autoMinorVersionUpgrade: true,
98
+ allowMajorVersionUpgrade: false,
99
+ enablePerformanceInsights: true,
100
+ parameterGroup: parameterGroup,
101
+ };
102
+ const writer = ClusterInstance.provisioned("WriterInstance", {
103
+ ...{
104
+ instanceType: clusterConfiguration.writer.instanceType,
105
+ isFromLegacyInstanceProps: clusterConfiguration.writer.isFromLegacyInstanceProps,
106
+ },
107
+ ...defaultDbInstanceProps,
108
+ });
109
+ const readers = clusterConfiguration.readers.map((reader, index) => ClusterInstance.provisioned(`ReaderInstance${index}`, {
110
+ ...{
111
+ instanceType: reader.instanceType,
112
+ isFromLegacyInstanceProps: reader.isFromLegacyInstanceProps,
113
+ },
114
+ ...defaultDbInstanceProps,
115
+ }));
116
+ return {
117
+ engine: DatabaseClusterEngine.auroraPostgres({
118
+ version: clusterConfiguration.dbVersion,
119
+ }),
120
+ writer,
121
+ readers,
122
+ vpcSubnets: {
123
+ subnetType: SubnetType.PRIVATE_WITH_EGRESS,
124
+ },
125
+ securityGroups: [securityGroup],
126
+ vpc,
127
+ instanceUpdateBehaviour: InstanceUpdateBehaviour.ROLLING,
128
+ instanceIdentifierBase: `${instanceName}-`,
129
+ cloudwatchLogsExports: ["postgresql"],
130
+ backup: {
131
+ retention: Duration.days(35),
132
+ preferredWindow: "01:00-02:00",
133
+ },
134
+ preferredMaintenanceWindow: "mon:03:00-mon:04:00",
135
+ deletionProtection: true,
136
+ removalPolicy: RemovalPolicy.RETAIN,
137
+ port: DbStack.CLUSTER_PORT,
138
+ credentials: Credentials.fromPassword(secret.secretValueFromJson("db.superuser").unsafeUnwrap(), secret.secretValueFromJson("db.superuser.password")),
139
+ parameterGroup,
140
+ monitoringInterval: Duration.seconds(30),
141
+ storageEncrypted: storageEncrypted ?? true,
142
+ ...(rdsKey ? { storageEncryptionKey: rdsKey } : {}),
143
+ };
144
+ }
145
+ createRDSKey(instanceName, environmentName) {
146
+ return new Key(this, "RDSKey", {
147
+ alias: `${environmentName}/db`,
148
+ enableKeyRotation: true,
149
+ description: `KMS key for RDS cluster ${instanceName}`,
150
+ removalPolicy: RemovalPolicy.RETAIN,
151
+ pendingWindow: Duration.days(30),
152
+ });
153
+ }
154
+ createAuroraCluster(isc, configuration, clusterConfiguration, parameterGroups, instanceName, rdsKey) {
155
+ const securityGroup = SecurityGroup.fromSecurityGroupId(this, "securitygroup", clusterConfiguration.securityGroupId);
156
+ const vpc = configuration.vpc
157
+ ? configuration.vpc
158
+ : importVpc(this, isc.environmentName);
159
+ if (parameterGroups[0] === undefined) {
160
+ throw Error("ParameterGroups should not be empty");
161
+ }
162
+ const parameters = this.createClusterParameters(configuration.secretArn, clusterConfiguration, instanceName, vpc, securityGroup, parameterGroups[0], configuration.storageEncrypted, rdsKey);
163
+ let cluster;
164
+ if (clusterConfiguration.snapshotIdentifier) {
165
+ cluster = new DatabaseClusterFromSnapshot(this, instanceName, {
166
+ ...parameters,
167
+ ...{
168
+ snapshotIdentifier: clusterConfiguration.snapshotIdentifier,
169
+ },
170
+ });
171
+ }
172
+ else {
173
+ cluster = new DatabaseCluster(this, instanceName, parameters);
174
+ }
175
+ // this workaround should prevent stack failing on version upgrade
176
+ // https://github.com/aws/aws-cdk/issues/21758
177
+ // https://github.com/aws/aws-cdk/pull/22185
178
+ // Maybe this could be removed completely as we don't update db with the CDK?
179
+ const cfnInstances = cluster.node.children.filter((child) => child instanceof CfnDBInstance);
180
+ // if (cfnInstances.length === 0) {
181
+ // throw new Error("Couldn't pull CfnDBInstances from the L1 constructs!");
182
+ // }
183
+ cfnInstances.forEach((cfnInstance) => {
184
+ delete cfnInstance.engineVersion;
185
+ });
186
+ return cluster;
187
+ }
188
+ }
189
+ //# sourceMappingURL=db-stack.js.map
@@ -0,0 +1,5 @@
1
+ import type { Environment } from "aws-cdk-lib/core";
2
+ export interface InfraStackConfiguration {
3
+ readonly env: Environment;
4
+ readonly environmentName: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=intra-stack-configuration.js.map
@@ -0,0 +1,14 @@
1
+ import type { IVpc } from "aws-cdk-lib/aws-ec2";
2
+ import { Vpc } from "aws-cdk-lib/aws-ec2";
3
+ import { Stack } from "aws-cdk-lib/core";
4
+ import type { Construct } from "constructs/lib/construct.js";
5
+ import type { InfraStackConfiguration } from "./intra-stack-configuration.js";
6
+ export interface NetworkConfiguration {
7
+ readonly vpcName: string;
8
+ readonly cidr: string;
9
+ }
10
+ export declare class NetworkStack extends Stack {
11
+ readonly vpc: IVpc;
12
+ constructor(scope: Construct, id: string, isc: InfraStackConfiguration, configuration: NetworkConfiguration);
13
+ createVpc(configuration: NetworkConfiguration): Vpc;
14
+ }
@@ -0,0 +1,45 @@
1
+ import { IpAddresses, SubnetType, Vpc } from "aws-cdk-lib/aws-ec2";
2
+ import { Stack } from "aws-cdk-lib/core";
3
+ import { exportValue } from "../import-util.js";
4
+ export class NetworkStack extends Stack {
5
+ vpc;
6
+ constructor(scope, id, isc, configuration) {
7
+ super(scope, id, {
8
+ env: isc.env,
9
+ });
10
+ this.vpc = this.createVpc(configuration);
11
+ if (this.vpc.publicSubnets[0] === undefined ||
12
+ this.vpc.publicSubnets[1] === undefined ||
13
+ this.vpc.privateSubnets[0] === undefined ||
14
+ this.vpc.privateSubnets[1] === undefined) {
15
+ throw Error("Subnets are not set correctly");
16
+ }
17
+ exportValue(this, isc.environmentName, "VPCID", this.vpc.vpcId);
18
+ exportValue(this, isc.environmentName, "digitrafficpublicASubnet", this.vpc.publicSubnets[0].subnetId);
19
+ exportValue(this, isc.environmentName, "digitrafficpublicBSubnet", this.vpc.publicSubnets[1].subnetId);
20
+ exportValue(this, isc.environmentName, "digitrafficprivateASubnet", this.vpc.privateSubnets[0].subnetId);
21
+ exportValue(this, isc.environmentName, "digitrafficprivateBSubnet", this.vpc.privateSubnets[1].subnetId);
22
+ }
23
+ createVpc(configuration) {
24
+ return new Vpc(this, "DigitrafficVPC", {
25
+ vpcName: configuration.vpcName,
26
+ availabilityZones: Stack.of(this).availabilityZones.sort().slice(0, 2), // take two first azs
27
+ enableDnsHostnames: true,
28
+ enableDnsSupport: true,
29
+ ipAddresses: IpAddresses.cidr(configuration.cidr),
30
+ subnetConfiguration: [
31
+ {
32
+ name: "public",
33
+ cidrMask: 24,
34
+ subnetType: SubnetType.PUBLIC,
35
+ },
36
+ {
37
+ name: "private",
38
+ cidrMask: 24,
39
+ subnetType: SubnetType.PRIVATE_WITH_EGRESS,
40
+ },
41
+ ],
42
+ });
43
+ }
44
+ }
45
+ //# sourceMappingURL=network-stack.js.map
@@ -0,0 +1,16 @@
1
+ import type { IApiKey, RestApi } from "aws-cdk-lib/aws-apigateway";
2
+ /**
3
+ * Creates an usage plan for a REST API with a single API key
4
+ * @param api The REST API
5
+ * @param apiKeyId Id for the API key, this is a surrogate id for CDK, not displayed anywhere
6
+ * @param apiKeyName Name for the API key, this is displayed in the AWS Console
7
+ * @deprecated Creates randomized API key names, use createDefaultUsagePlan instead
8
+ */
9
+ export declare function createUsagePlan(api: RestApi, apiKeyId: string, apiKeyName: string): IApiKey;
10
+ /**
11
+ * Creates a default usage plan for a REST API with a single API key
12
+ * @param api The REST API
13
+ * @param apiName Name of the api. Will generate key: apiName + ' API Key' and plan: apiName + ' API Usage Plan'
14
+ * @param value Optional value for the API key
15
+ */
16
+ export declare function createDefaultUsagePlan(api: RestApi, apiName: string, value?: string): IApiKey;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Creates an usage plan for a REST API with a single API key
3
+ * @param api The REST API
4
+ * @param apiKeyId Id for the API key, this is a surrogate id for CDK, not displayed anywhere
5
+ * @param apiKeyName Name for the API key, this is displayed in the AWS Console
6
+ * @deprecated Creates randomized API key names, use createDefaultUsagePlan instead
7
+ */
8
+ export function createUsagePlan(api, apiKeyId, apiKeyName) {
9
+ const apiKey = api.addApiKey(apiKeyId);
10
+ const plan = api.addUsagePlan(apiKeyName, {
11
+ name: apiKeyName,
12
+ });
13
+ plan.addApiStage({
14
+ stage: api.deploymentStage,
15
+ });
16
+ plan.addApiKey(apiKey);
17
+ return apiKey;
18
+ }
19
+ /**
20
+ * Creates a default usage plan for a REST API with a single API key
21
+ * @param api The REST API
22
+ * @param apiName Name of the api. Will generate key: apiName + ' API Key' and plan: apiName + ' API Usage Plan'
23
+ * @param value Optional value for the API key
24
+ */
25
+ export function createDefaultUsagePlan(api, apiName, value) {
26
+ const apiKeyName = `${apiName} API Key`;
27
+ const usagePlanName = `${apiName} API Usage Plan`;
28
+ const apiKey = api.addApiKey(apiKeyName, { apiKeyName: apiKeyName, value });
29
+ const plan = api.addUsagePlan(usagePlanName, {
30
+ name: usagePlanName,
31
+ });
32
+ plan.addApiStage({
33
+ stage: api.deploymentStage,
34
+ });
35
+ plan.addApiKey(apiKey);
36
+ return apiKey;
37
+ }
38
+ //# sourceMappingURL=usage-plans.js.map
@@ -0,0 +1,2 @@
1
+ import type { GetApiKeyCommandOutput } from "@aws-sdk/client-api-gateway";
2
+ export declare function getApiKeyFromAPIGateway(keyId: string): Promise<GetApiKeyCommandOutput>;
@@ -0,0 +1,13 @@
1
+ import { APIGatewayClient, GetApiKeyCommand, } from "@aws-sdk/client-api-gateway";
2
+ import { FetchHttpHandler } from "@smithy/fetch-http-handler";
3
+ export async function getApiKeyFromAPIGateway(keyId) {
4
+ const client = new APIGatewayClient({
5
+ requestHandler: new FetchHttpHandler(),
6
+ });
7
+ const command = new GetApiKeyCommand({
8
+ apiKey: keyId,
9
+ includeValue: true,
10
+ });
11
+ return await client.send(command);
12
+ }
13
+ //# sourceMappingURL=apikey.js.map
@@ -0,0 +1,8 @@
1
+ import type { IntegrationResponse } from "aws-cdk-lib/aws-apigateway";
2
+ import { MediaType } from "../types/mediatypes.js";
3
+ export declare abstract class DigitrafficIntegrationResponse {
4
+ static ok(mediaType: MediaType, deprecation?: boolean, sunset?: string): IntegrationResponse;
5
+ static badRequest(mediaType?: MediaType): IntegrationResponse;
6
+ static notImplemented(mediaType?: MediaType): IntegrationResponse;
7
+ static create(statusCode: string, mediaType: MediaType, deprecation?: boolean, sunset?: string): IntegrationResponse;
8
+ }
@@ -0,0 +1,25 @@
1
+ import { getDeprecatedDefaultLambdaResponse, RESPONSE_DEFAULT_LAMBDA, } from "../infra/api/response.js";
2
+ import { MediaType } from "../types/mediatypes.js";
3
+ // biome-ignore lint/complexity/noStaticOnlyClass: FIXME
4
+ export class DigitrafficIntegrationResponse {
5
+ static ok(mediaType, deprecation = false, sunset) {
6
+ return DigitrafficIntegrationResponse.create("200", mediaType, deprecation, sunset);
7
+ }
8
+ static badRequest(mediaType) {
9
+ return DigitrafficIntegrationResponse.create("400", mediaType ?? MediaType.TEXT_PLAIN);
10
+ }
11
+ static notImplemented(mediaType) {
12
+ return DigitrafficIntegrationResponse.create("501", mediaType ?? MediaType.TEXT_PLAIN);
13
+ }
14
+ static create(statusCode, mediaType, deprecation = false, sunset) {
15
+ return {
16
+ statusCode,
17
+ responseTemplates: {
18
+ [mediaType]: deprecation
19
+ ? getDeprecatedDefaultLambdaResponse(sunset)
20
+ : RESPONSE_DEFAULT_LAMBDA,
21
+ },
22
+ };
23
+ }
24
+ }
25
+ //# sourceMappingURL=digitraffic-integration-response.js.map
@@ -0,0 +1,9 @@
1
+ import { DtLogger } from "./dt-logger.js";
2
+ /**
3
+ * You can use this for method name definition to match DtLogger LoggableType.method parameter.
4
+ */
5
+ export type { LoggerMethodType } from "./dt-logger.js";
6
+ /**
7
+ * You can use this for your logging needs or create one locally and configure it as you wish.
8
+ */
9
+ export declare const logger: DtLogger;
@@ -0,0 +1,6 @@
1
+ import { DtLogger } from "./dt-logger.js";
2
+ /**
3
+ * You can use this for your logging needs or create one locally and configure it as you wish.
4
+ */
5
+ export const logger = new DtLogger();
6
+ //# sourceMappingURL=dt-logger-default.js.map