@digitraffic/common 2024.1.10-1 → 2024.1.23-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/dist/aws/infra/api/{handler-factory.d.ts → handler-factory.d.mts} +2 -2
- package/dist/aws/infra/api/{handler-factory.js → handler-factory.mjs} +5 -10
- package/dist/aws/infra/api/{integration.d.ts → integration.d.mts} +1 -1
- package/dist/aws/infra/api/{integration.js → integration.mjs} +10 -14
- package/dist/aws/infra/api/{response.d.ts → response.d.mts} +2 -3
- package/dist/aws/infra/api/{response.js → response.mjs} +26 -31
- package/dist/aws/infra/api/{responses.d.ts → responses.d.mts} +2 -3
- package/dist/aws/infra/api/responses.mjs +78 -0
- package/dist/aws/infra/api/{static-integration.d.ts → static-integration.d.mts} +1 -1
- package/dist/aws/infra/api/{static-integration.js → static-integration.mjs} +8 -12
- package/dist/aws/infra/canaries/{canary-alarm.d.ts → canary-alarm.d.mts} +1 -1
- package/dist/aws/infra/canaries/canary-alarm.mjs +20 -0
- package/dist/aws/infra/canaries/canary-keys.mjs +4 -0
- package/dist/aws/infra/canaries/canary-parameters.mjs +2 -0
- package/dist/aws/infra/canaries/{canary-role.js → canary-role.mjs} +9 -13
- package/dist/aws/infra/canaries/{canary.d.ts → canary.d.mts} +2 -2
- package/dist/aws/infra/canaries/canary.mjs +26 -0
- package/dist/aws/infra/canaries/{database-canary.d.ts → database-canary.d.mts} +3 -3
- package/dist/aws/infra/canaries/{database-canary.js → database-canary.mjs} +9 -13
- package/dist/aws/infra/canaries/{database-checker.d.ts → database-checker.d.mts} +1 -1
- package/dist/aws/infra/canaries/{database-checker.js → database-checker.mjs} +12 -18
- package/dist/aws/infra/canaries/{url-canary.d.ts → url-canary.d.mts} +4 -4
- package/dist/aws/infra/canaries/{url-canary.js → url-canary.mjs} +9 -13
- package/dist/aws/infra/canaries/{url-checker.d.ts → url-checker.d.mts} +2 -2
- package/dist/aws/infra/canaries/{url-checker.js → url-checker.mjs} +35 -42
- package/dist/aws/infra/{documentation.js → documentation.mjs} +9 -17
- package/dist/aws/infra/{import-util.js → import-util.mjs} +11 -19
- package/dist/aws/infra/scheduler.mjs +27 -0
- package/dist/aws/infra/{security-rule.js → security-rule.mjs} +5 -9
- package/dist/aws/infra/{sqs-integration.d.ts → sqs-integration.d.mts} +1 -2
- package/dist/aws/infra/{sqs-integration.js → sqs-integration.mjs} +12 -16
- package/dist/aws/infra/{sqs-queue.d.ts → sqs-queue.d.mts} +1 -1
- package/dist/aws/infra/{sqs-queue.js → sqs-queue.mjs} +33 -41
- package/dist/aws/infra/stack/{lambda-configs.d.ts → lambda-configs.d.mts} +2 -2
- package/dist/aws/infra/stack/{lambda-configs.js → lambda-configs.mjs} +15 -21
- package/dist/aws/infra/stack/{monitoredfunction.d.ts → monitoredfunction.d.mts} +3 -3
- package/dist/aws/infra/stack/{monitoredfunction.js → monitoredfunction.mjs} +20 -28
- package/dist/aws/infra/stack/{parameters.d.ts → parameters.d.mts} +1 -1
- package/dist/aws/infra/stack/{parameters.js → parameters.mjs} +6 -11
- package/dist/aws/infra/stack/{rest_apis.d.ts → rest_apis.d.mts} +3 -3
- package/dist/aws/infra/stack/{rest_apis.js → rest_apis.mjs} +42 -55
- package/dist/aws/infra/stack/{stack-checking-aspect.d.ts → stack-checking-aspect.d.mts} +1 -1
- package/dist/aws/infra/stack/{stack-checking-aspect.js → stack-checking-aspect.mjs} +25 -32
- package/dist/aws/infra/stack/{stack.d.ts → stack.d.mts} +3 -4
- package/dist/aws/infra/stack/stack.mjs +63 -0
- package/dist/aws/infra/stack/{subscription.d.ts → subscription.d.mts} +2 -2
- package/dist/aws/infra/stack/{subscription.js → subscription.mjs} +6 -11
- package/dist/aws/infra/stacks/{db-dns-stack.d.ts → db-dns-stack.d.mts} +2 -2
- package/dist/aws/infra/stacks/db-dns-stack.mjs +60 -0
- package/dist/aws/infra/stacks/{db-proxy-stack.d.ts → db-proxy-stack.d.mts} +2 -2
- package/dist/aws/infra/stacks/db-proxy-stack.mjs +73 -0
- package/dist/aws/infra/stacks/{db-stack.d.ts → db-stack.d.mts} +3 -4
- package/dist/aws/infra/stacks/{db-stack.js → db-stack.mjs} +31 -35
- package/dist/aws/infra/stacks/intra-stack-configuration.mjs +2 -0
- package/dist/aws/infra/stacks/{network-stack.d.ts → network-stack.d.mts} +2 -2
- package/dist/aws/infra/stacks/network-stack.mjs +40 -0
- package/dist/aws/infra/{usage-plans.js → usage-plans.mjs} +3 -8
- package/dist/aws/runtime/apikey.mjs +9 -0
- package/dist/aws/runtime/{digitraffic-integration-response.d.ts → digitraffic-integration-response.d.mts} +1 -1
- package/dist/aws/runtime/digitraffic-integration-response.mjs +24 -0
- package/dist/aws/runtime/{dt-logger-default.d.ts → dt-logger-default.d.mts} +2 -2
- package/dist/aws/runtime/dt-logger-default.mjs +6 -0
- package/dist/aws/runtime/{dt-logger.d.ts → dt-logger.d.mts} +1 -1
- package/dist/aws/runtime/{dt-logger.js → dt-logger.mjs} +4 -11
- package/dist/aws/runtime/{environment.js → environment.mjs} +4 -8
- package/dist/aws/runtime/{messaging.js → messaging.mjs} +2 -6
- package/dist/aws/runtime/{s3.js → s3.mjs} +4 -8
- package/dist/aws/runtime/secrets/{dbsecret.d.ts → dbsecret.d.mts} +1 -1
- package/dist/aws/runtime/secrets/{dbsecret.js → dbsecret.mjs} +6 -10
- package/dist/aws/runtime/secrets/proxy-holder.mjs +24 -0
- package/dist/aws/runtime/secrets/rds-holder.mjs +24 -0
- package/dist/aws/runtime/secrets/{secret-holder.d.ts → secret-holder.d.mts} +1 -1
- package/dist/aws/runtime/secrets/{secret-holder.js → secret-holder.mjs} +14 -19
- package/dist/aws/runtime/secrets/{secret.js → secret.mjs} +8 -12
- package/dist/aws/types/errors.mjs +12 -0
- package/dist/aws/types/{lambda-response.js → lambda-response.mjs} +4 -11
- package/dist/aws/types/{mediatypes.js → mediatypes.mjs} +3 -6
- package/dist/aws/types/model-with-reference.mjs +2 -0
- package/dist/aws/types/proxytypes.mjs +2 -0
- package/dist/aws/types/tags.mjs +4 -0
- package/dist/database/{cached.d.ts → cached.d.mts} +1 -1
- package/dist/database/{cached.js → cached.mjs} +10 -15
- package/dist/database/{database.d.ts → database.d.mts} +1 -1
- package/dist/database/{database.js → database.mjs} +17 -24
- package/dist/database/{last-updated.d.ts → last-updated.d.mts} +1 -1
- package/dist/database/{last-updated.js → last-updated.mjs} +9 -18
- package/dist/database/models.mjs +2 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +2 -0
- package/dist/marine/{id_utils.js → id_utils.mjs} +4 -10
- package/dist/marine/rtz.mjs +2 -0
- package/dist/test/{asserter.js → asserter.mjs} +2 -6
- package/dist/test/{db-testutils.d.ts → db-testutils.d.mts} +1 -1
- package/dist/test/db-testutils.mjs +29 -0
- package/dist/test/{httpserver.js → httpserver.mjs} +11 -15
- package/dist/test/secrets-manager.mjs +34 -0
- package/dist/test/testutils.mjs +33 -0
- package/dist/types/async-timeout-error.mjs +6 -0
- package/dist/types/aws-env.mjs +2 -0
- package/dist/types/either.mjs +2 -0
- package/dist/types/http-error.mjs +7 -0
- package/dist/types/input-error.mjs +3 -0
- package/dist/types/language.mjs +7 -0
- package/dist/types/{nullable.d.ts → nullable.d.mts} +1 -1
- package/dist/types/nullable.mjs +2 -0
- package/dist/types/{traffictype.js → traffictype.mjs} +3 -6
- package/dist/types/urn.mjs +2 -0
- package/dist/types/util-types.mjs +2 -0
- package/dist/types/validator.mjs +9 -0
- package/dist/utils/{api-model.d.ts → api-model.d.mts} +1 -1
- package/dist/utils/{api-model.js → api-model.mjs} +18 -28
- package/dist/utils/{base64.d.ts → base64.d.mts} +1 -1
- package/dist/utils/base64.mjs +16 -0
- package/dist/utils/date-utils.mjs +44 -0
- package/dist/utils/geojson-types.mjs +13 -0
- package/dist/utils/{geometry.js → geometry.mjs} +16 -49
- package/dist/utils/{logging.d.ts → logging.d.mts} +1 -1
- package/dist/utils/{logging.js → logging.mjs} +9 -14
- package/dist/utils/{retry.js → retry.mjs} +22 -27
- package/dist/utils/slack.mjs +23 -0
- package/dist/utils/{utils.d.ts → utils.d.mts} +2 -2
- package/dist/utils/{utils.js → utils.mjs} +15 -30
- package/package.json +99 -10
- package/src/aws/infra/api/{handler-factory.ts → handler-factory.mts} +3 -3
- package/src/aws/infra/api/{integration.ts → integration.mts} +2 -2
- package/src/aws/infra/api/{response.ts → response.mts} +3 -3
- package/src/aws/infra/api/{responses.ts → responses.mts} +4 -4
- package/src/aws/infra/api/{static-integration.ts → static-integration.mts} +2 -2
- package/src/aws/infra/canaries/Synthetics.d.mts +21 -0
- package/src/aws/infra/canaries/{canary-alarm.ts → canary-alarm.mts} +1 -1
- package/src/aws/infra/canaries/{canary.ts → canary.mts} +3 -3
- package/src/aws/infra/canaries/{database-canary.ts → database-canary.mts} +3 -3
- package/src/aws/infra/canaries/{database-checker.ts → database-checker.mts} +7 -10
- package/src/aws/infra/canaries/{url-canary.ts → url-canary.mts} +6 -6
- package/src/aws/infra/canaries/{url-checker.ts → url-checker.mts} +9 -29
- package/src/aws/infra/{sqs-integration.ts → sqs-integration.mts} +1 -1
- package/src/aws/infra/{sqs-queue.ts → sqs-queue.mts} +3 -6
- package/src/aws/infra/stack/{lambda-configs.ts → lambda-configs.mts} +2 -2
- package/src/aws/infra/stack/{monitoredfunction.ts → monitoredfunction.mts} +4 -4
- package/src/aws/infra/stack/{parameters.ts → parameters.mts} +1 -1
- package/src/aws/infra/stack/{rest_apis.ts → rest_apis.mts} +6 -6
- package/src/aws/infra/stack/{stack-checking-aspect.ts → stack-checking-aspect.mts} +1 -1
- package/src/aws/infra/stack/{stack.ts → stack.mts} +4 -5
- package/src/aws/infra/stack/{subscription.ts → subscription.mts} +2 -2
- package/src/aws/infra/stacks/{db-dns-stack.ts → db-dns-stack.mts} +4 -4
- package/src/aws/infra/stacks/{db-proxy-stack.ts → db-proxy-stack.mts} +5 -5
- package/src/aws/infra/stacks/{db-stack.ts → db-stack.mts} +5 -5
- package/src/aws/infra/stacks/{network-stack.ts → network-stack.mts} +3 -3
- package/src/aws/runtime/{digitraffic-integration-response.ts → digitraffic-integration-response.mts} +2 -2
- package/src/aws/runtime/{dt-logger-default.ts → dt-logger-default.mts} +2 -2
- package/src/aws/runtime/secrets/{dbsecret.ts → dbsecret.mts} +1 -1
- package/src/aws/runtime/secrets/node-ttl.d.mts +12 -0
- package/src/aws/runtime/secrets/{proxy-holder.ts → proxy-holder.mts} +4 -4
- package/src/aws/runtime/secrets/{rds-holder.ts → rds-holder.mts} +4 -4
- package/src/aws/runtime/secrets/{secret-holder.ts → secret-holder.mts} +8 -9
- package/src/aws/runtime/secrets/{secret.ts → secret.mts} +2 -2
- package/src/database/{cached.ts → cached.mts} +4 -2
- package/src/database/{database.ts → database.mts} +6 -6
- package/src/database/{last-updated.ts → last-updated.mts} +1 -1
- package/src/index.mts +2 -0
- package/src/test/{db-testutils.ts → db-testutils.mts} +2 -2
- package/src/test/{secrets-manager.ts → secrets-manager.mts} +3 -3
- package/src/types/{nullable.ts → nullable.mts} +1 -1
- package/src/utils/{api-model.ts → api-model.mts} +1 -1
- package/src/utils/{geometry.ts → geometry.mts} +5 -3
- package/src/utils/{logging.ts → logging.mts} +2 -2
- package/src/utils/{retry.ts → retry.mts} +3 -3
- package/src/utils/{slack.ts → slack.mts} +2 -2
- package/src/utils/{utils.ts → utils.mts} +3 -3
- package/dist/aws/infra/api/responses.js +0 -84
- package/dist/aws/infra/canaries/canary-alarm.js +0 -24
- package/dist/aws/infra/canaries/canary-keys.js +0 -7
- package/dist/aws/infra/canaries/canary-parameters.js +0 -3
- package/dist/aws/infra/canaries/canary.js +0 -30
- package/dist/aws/infra/scheduler.js +0 -31
- package/dist/aws/infra/stack/stack.js +0 -67
- package/dist/aws/infra/stacks/db-dns-stack.js +0 -64
- package/dist/aws/infra/stacks/db-proxy-stack.js +0 -77
- package/dist/aws/infra/stacks/intra-stack-configuration.js +0 -3
- package/dist/aws/infra/stacks/network-stack.js +0 -44
- package/dist/aws/runtime/apikey.js +0 -13
- package/dist/aws/runtime/digitraffic-integration-response.js +0 -28
- package/dist/aws/runtime/dt-logger-default.js +0 -9
- package/dist/aws/runtime/secrets/proxy-holder.js +0 -28
- package/dist/aws/runtime/secrets/rds-holder.js +0 -28
- package/dist/aws/types/errors.js +0 -16
- package/dist/aws/types/model-with-reference.js +0 -3
- package/dist/aws/types/proxytypes.js +0 -3
- package/dist/aws/types/tags.js +0 -7
- package/dist/database/models.js +0 -3
- package/dist/marine/rtz.js +0 -3
- package/dist/test/db-testutils.js +0 -34
- package/dist/test/secrets-manager.js +0 -62
- package/dist/test/testutils.js +0 -44
- package/dist/types/async-timeout-error.js +0 -10
- package/dist/types/aws-env.js +0 -3
- package/dist/types/either.js +0 -3
- package/dist/types/http-error.js +0 -11
- package/dist/types/input-error.js +0 -7
- package/dist/types/language.js +0 -10
- package/dist/types/nullable.js +0 -3
- package/dist/types/urn.js +0 -3
- package/dist/types/util-types.js +0 -3
- package/dist/types/validator.js +0 -14
- package/dist/utils/base64.js +0 -21
- package/dist/utils/date-utils.js +0 -51
- package/dist/utils/geojson-types.js +0 -18
- package/dist/utils/slack.js +0 -30
- /package/dist/aws/infra/canaries/{canary-keys.d.ts → canary-keys.d.mts} +0 -0
- /package/dist/aws/infra/canaries/{canary-parameters.d.ts → canary-parameters.d.mts} +0 -0
- /package/dist/aws/infra/canaries/{canary-role.d.ts → canary-role.d.mts} +0 -0
- /package/dist/aws/infra/{documentation.d.ts → documentation.d.mts} +0 -0
- /package/dist/aws/infra/{import-util.d.ts → import-util.d.mts} +0 -0
- /package/dist/aws/infra/{scheduler.d.ts → scheduler.d.mts} +0 -0
- /package/dist/aws/infra/{security-rule.d.ts → security-rule.d.mts} +0 -0
- /package/dist/aws/infra/stacks/{intra-stack-configuration.d.ts → intra-stack-configuration.d.mts} +0 -0
- /package/dist/aws/infra/{usage-plans.d.ts → usage-plans.d.mts} +0 -0
- /package/dist/aws/runtime/{apikey.d.ts → apikey.d.mts} +0 -0
- /package/dist/aws/runtime/{environment.d.ts → environment.d.mts} +0 -0
- /package/dist/aws/runtime/{messaging.d.ts → messaging.d.mts} +0 -0
- /package/dist/aws/runtime/{s3.d.ts → s3.d.mts} +0 -0
- /package/dist/aws/runtime/secrets/{proxy-holder.d.ts → proxy-holder.d.mts} +0 -0
- /package/dist/aws/runtime/secrets/{rds-holder.d.ts → rds-holder.d.mts} +0 -0
- /package/dist/aws/runtime/secrets/{secret.d.ts → secret.d.mts} +0 -0
- /package/dist/aws/types/{errors.d.ts → errors.d.mts} +0 -0
- /package/dist/aws/types/{lambda-response.d.ts → lambda-response.d.mts} +0 -0
- /package/dist/aws/types/{mediatypes.d.ts → mediatypes.d.mts} +0 -0
- /package/dist/aws/types/{model-with-reference.d.ts → model-with-reference.d.mts} +0 -0
- /package/dist/aws/types/{proxytypes.d.ts → proxytypes.d.mts} +0 -0
- /package/dist/aws/types/{tags.d.ts → tags.d.mts} +0 -0
- /package/dist/database/{models.d.ts → models.d.mts} +0 -0
- /package/dist/marine/{id_utils.d.ts → id_utils.d.mts} +0 -0
- /package/dist/marine/{rtz.d.ts → rtz.d.mts} +0 -0
- /package/dist/test/{asserter.d.ts → asserter.d.mts} +0 -0
- /package/dist/test/{httpserver.d.ts → httpserver.d.mts} +0 -0
- /package/dist/test/{secrets-manager.d.ts → secrets-manager.d.mts} +0 -0
- /package/dist/test/{testutils.d.ts → testutils.d.mts} +0 -0
- /package/dist/types/{async-timeout-error.d.ts → async-timeout-error.d.mts} +0 -0
- /package/dist/types/{aws-env.d.ts → aws-env.d.mts} +0 -0
- /package/dist/types/{either.d.ts → either.d.mts} +0 -0
- /package/dist/types/{http-error.d.ts → http-error.d.mts} +0 -0
- /package/dist/types/{input-error.d.ts → input-error.d.mts} +0 -0
- /package/dist/types/{language.d.ts → language.d.mts} +0 -0
- /package/dist/types/{traffictype.d.ts → traffictype.d.mts} +0 -0
- /package/dist/types/{urn.d.ts → urn.d.mts} +0 -0
- /package/dist/types/{util-types.d.ts → util-types.d.mts} +0 -0
- /package/dist/types/{validator.d.ts → validator.d.mts} +0 -0
- /package/dist/utils/{date-utils.d.ts → date-utils.d.mts} +0 -0
- /package/dist/utils/{geojson-types.d.ts → geojson-types.d.mts} +0 -0
- /package/dist/utils/{geometry.d.ts → geometry.d.mts} +0 -0
- /package/dist/utils/{retry.d.ts → retry.d.mts} +0 -0
- /package/dist/utils/{slack.d.ts → slack.d.mts} +0 -0
- /package/src/@types/geojson-validation/{index.d.ts → index.d.mts} +0 -0
- /package/src/aws/infra/canaries/{canary-keys.ts → canary-keys.mts} +0 -0
- /package/src/aws/infra/canaries/{canary-parameters.ts → canary-parameters.mts} +0 -0
- /package/src/aws/infra/canaries/{canary-role.ts → canary-role.mts} +0 -0
- /package/src/aws/infra/{documentation.ts → documentation.mts} +0 -0
- /package/src/aws/infra/{import-util.ts → import-util.mts} +0 -0
- /package/src/aws/infra/{scheduler.ts → scheduler.mts} +0 -0
- /package/src/aws/infra/{security-rule.ts → security-rule.mts} +0 -0
- /package/src/aws/infra/stacks/{intra-stack-configuration.ts → intra-stack-configuration.mts} +0 -0
- /package/src/aws/infra/{usage-plans.ts → usage-plans.mts} +0 -0
- /package/src/aws/runtime/{apikey.ts → apikey.mts} +0 -0
- /package/src/aws/runtime/{dt-logger.ts → dt-logger.mts} +0 -0
- /package/src/aws/runtime/{environment.ts → environment.mts} +0 -0
- /package/src/aws/runtime/{messaging.ts → messaging.mts} +0 -0
- /package/src/aws/runtime/{s3.ts → s3.mts} +0 -0
- /package/src/aws/types/{errors.ts → errors.mts} +0 -0
- /package/src/aws/types/{lambda-response.ts → lambda-response.mts} +0 -0
- /package/src/aws/types/{mediatypes.ts → mediatypes.mts} +0 -0
- /package/src/aws/types/{model-with-reference.ts → model-with-reference.mts} +0 -0
- /package/src/aws/types/{proxytypes.ts → proxytypes.mts} +0 -0
- /package/src/aws/types/{tags.ts → tags.mts} +0 -0
- /package/src/database/{models.ts → models.mts} +0 -0
- /package/src/marine/{id_utils.ts → id_utils.mts} +0 -0
- /package/src/marine/{rtz.ts → rtz.mts} +0 -0
- /package/src/test/{asserter.ts → asserter.mts} +0 -0
- /package/src/test/{httpserver.ts → httpserver.mts} +0 -0
- /package/src/test/{testutils.ts → testutils.mts} +0 -0
- /package/src/types/{async-timeout-error.ts → async-timeout-error.mts} +0 -0
- /package/src/types/{aws-env.ts → aws-env.mts} +0 -0
- /package/src/types/{either.ts → either.mts} +0 -0
- /package/src/types/{http-error.ts → http-error.mts} +0 -0
- /package/src/types/{input-error.ts → input-error.mts} +0 -0
- /package/src/types/{language.ts → language.mts} +0 -0
- /package/src/types/{traffictype.ts → traffictype.mts} +0 -0
- /package/src/types/{urn.ts → urn.mts} +0 -0
- /package/src/types/{util-types.ts → util-types.mts} +0 -0
- /package/src/types/{validator.ts → validator.mts} +0 -0
- /package/src/utils/{base64.ts → base64.mts} +0 -0
- /package/src/utils/{date-utils.ts → date-utils.mts} +0 -0
- /package/src/utils/{geojson-types.ts → geojson-types.mts} +0 -0
package/package.json
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "@digitraffic/common",
|
3
|
-
"version": "2024.1.
|
3
|
+
"version": "2024.1.23-1",
|
4
4
|
"description": "",
|
5
|
+
"type": "module",
|
5
6
|
"repository": {
|
6
7
|
"type": "git",
|
7
8
|
"url": "https://github.com/tmfg/digitraffic-common.git"
|
@@ -12,10 +13,96 @@
|
|
12
13
|
"license": "EUPL-1.2",
|
13
14
|
"private": false,
|
14
15
|
"files": [
|
15
|
-
"dist/**/*.
|
16
|
-
"dist/**/*.d.
|
17
|
-
"src/**/*.
|
16
|
+
"dist/**/*.mjs",
|
17
|
+
"dist/**/*.d.mts",
|
18
|
+
"src/**/*.mts"
|
18
19
|
],
|
20
|
+
"exports": {
|
21
|
+
".": "./dist/index.mjs",
|
22
|
+
"./dist/database/database": "./dist/database/database.mjs",
|
23
|
+
"./dist/database/cached": "./dist/database/cached.mjs",
|
24
|
+
"./dist/database/models": "./dist/database/models.mjs",
|
25
|
+
"./dist/database/last-updated": "./dist/database/last-updated.mjs",
|
26
|
+
"./dist/types/urn": "./dist/types/urn.mjs",
|
27
|
+
"./dist/types/util-types": "./dist/types/util-types.mjs",
|
28
|
+
"./dist/types/either": "./dist/types/either.mjs",
|
29
|
+
"./dist/types/validator": "./dist/types/validator.mjs",
|
30
|
+
"./dist/types/nullable": "./dist/types/nullable.mjs",
|
31
|
+
"./dist/types/aws-env": "./dist/types/aws-env.mjs",
|
32
|
+
"./dist/types/async-timeout-error": "./dist/types/async-timeout-error.mjs",
|
33
|
+
"./dist/types/input-error": "./dist/types/input-error.mjs",
|
34
|
+
"./dist/types/http-error": "./dist/types/http-error.mjs",
|
35
|
+
"./dist/types/language": "./dist/types/language.mjs",
|
36
|
+
"./dist/types/traffictype": "./dist/types/traffictype.mjs",
|
37
|
+
"./dist/test/testutils": "./dist/test/testutils.mjs",
|
38
|
+
"./dist/test/db-testutils": "./dist/test/db-testutils.mjs",
|
39
|
+
"./dist/test/httpserver": "./dist/test/httpserver.mjs",
|
40
|
+
"./dist/test/secrets-manager": "./dist/test/secrets-manager.mjs",
|
41
|
+
"./dist/test/asserter": "./dist/test/asserter.mjs",
|
42
|
+
"./dist/marine/rtz": "./dist/marine/rtz.mjs",
|
43
|
+
"./dist/marine/id_utils": "./dist/marine/id_utils.mjs",
|
44
|
+
"./dist/index": "./dist/index.mjs",
|
45
|
+
"./dist/utils/api-model": "./dist/utils/api-model.mjs",
|
46
|
+
"./dist/utils/logging": "./dist/utils/logging.mjs",
|
47
|
+
"./dist/utils/base64": "./dist/utils/base64.mjs",
|
48
|
+
"./dist/utils/date-utils": "./dist/utils/date-utils.mjs",
|
49
|
+
"./dist/utils/geojson-types": "./dist/utils/geojson-types.mjs",
|
50
|
+
"./dist/utils/slack": "./dist/utils/slack.mjs",
|
51
|
+
"./dist/utils/utils": "./dist/utils/utils.mjs",
|
52
|
+
"./dist/utils/retry": "./dist/utils/retry.mjs",
|
53
|
+
"./dist/utils/geometry": "./dist/utils/geometry.mjs",
|
54
|
+
"./dist/aws/infra/sqs-integration": "./dist/aws/infra/sqs-integration.mjs",
|
55
|
+
"./dist/aws/infra/stacks/network-stack": "./dist/aws/infra/stacks/network-stack.mjs",
|
56
|
+
"./dist/aws/infra/stacks/db-stack": "./dist/aws/infra/stacks/db-stack.mjs",
|
57
|
+
"./dist/aws/infra/stacks/db-proxy-stack": "./dist/aws/infra/stacks/db-proxy-stack.mjs",
|
58
|
+
"./dist/aws/infra/stacks/intra-stack-configuration": "./dist/aws/infra/stacks/intra-stack-configuration.mjs",
|
59
|
+
"./dist/aws/infra/stacks/db-dns-stack": "./dist/aws/infra/stacks/db-dns-stack.mjs",
|
60
|
+
"./dist/aws/infra/documentation": "./dist/aws/infra/documentation.mjs",
|
61
|
+
"./dist/aws/infra/usage-plans": "./dist/aws/infra/usage-plans.mjs",
|
62
|
+
"./dist/aws/infra/scheduler": "./dist/aws/infra/scheduler.mjs",
|
63
|
+
"./dist/aws/infra/import-util": "./dist/aws/infra/import-util.mjs",
|
64
|
+
"./dist/aws/infra/sqs-queue": "./dist/aws/infra/sqs-queue.mjs",
|
65
|
+
"./dist/aws/infra/api/response": "./dist/aws/infra/api/response.mjs",
|
66
|
+
"./dist/aws/infra/api/static-integration": "./dist/aws/infra/api/static-integration.mjs",
|
67
|
+
"./dist/aws/infra/api/responses": "./dist/aws/infra/api/responses.mjs",
|
68
|
+
"./dist/aws/infra/api/handler-factory": "./dist/aws/infra/api/handler-factory.mjs",
|
69
|
+
"./dist/aws/infra/api/integration": "./dist/aws/infra/api/integration.mjs",
|
70
|
+
"./dist/aws/infra/stack/stack-checking-aspect": "./dist/aws/infra/stack/stack-checking-aspect.mjs",
|
71
|
+
"./dist/aws/infra/stack/rest_apis": "./dist/aws/infra/stack/rest_apis.mjs",
|
72
|
+
"./dist/aws/infra/stack/lambda-configs": "./dist/aws/infra/stack/lambda-configs.mjs",
|
73
|
+
"./dist/aws/infra/stack/monitoredfunction": "./dist/aws/infra/stack/monitoredfunction.mjs",
|
74
|
+
"./dist/aws/infra/stack/subscription": "./dist/aws/infra/stack/subscription.mjs",
|
75
|
+
"./dist/aws/infra/stack/parameters": "./dist/aws/infra/stack/parameters.mjs",
|
76
|
+
"./dist/aws/infra/stack/stack": "./dist/aws/infra/stack/stack.mjs",
|
77
|
+
"./dist/aws/infra/security-rule": "./dist/aws/infra/security-rule.mjs",
|
78
|
+
"./dist/aws/infra/canaries/database-checker": "./dist/aws/infra/canaries/database-checker.mjs",
|
79
|
+
"./dist/aws/infra/canaries/canary": "./dist/aws/infra/canaries/canary.mjs",
|
80
|
+
"./dist/aws/infra/canaries/url-checker": "./dist/aws/infra/canaries/url-checker.mjs",
|
81
|
+
"./dist/aws/infra/canaries/database-canary": "./dist/aws/infra/canaries/database-canary.mjs",
|
82
|
+
"./dist/aws/infra/canaries/canary-alarm": "./dist/aws/infra/canaries/canary-alarm.mjs",
|
83
|
+
"./dist/aws/infra/canaries/canary-role": "./dist/aws/infra/canaries/canary-role.mjs",
|
84
|
+
"./dist/aws/infra/canaries/url-canary": "./dist/aws/infra/canaries/url-canary.mjs",
|
85
|
+
"./dist/aws/infra/canaries/canary-parameters": "./dist/aws/infra/canaries/canary-parameters.mjs",
|
86
|
+
"./dist/aws/infra/canaries/canary-keys": "./dist/aws/infra/canaries/canary-keys.mjs",
|
87
|
+
"./dist/aws/types/proxytypes": "./dist/aws/types/proxytypes.mjs",
|
88
|
+
"./dist/aws/types/tags": "./dist/aws/types/tags.mjs",
|
89
|
+
"./dist/aws/types/mediatypes": "./dist/aws/types/mediatypes.mjs",
|
90
|
+
"./dist/aws/types/model-with-reference": "./dist/aws/types/model-with-reference.mjs",
|
91
|
+
"./dist/aws/types/errors": "./dist/aws/types/errors.mjs",
|
92
|
+
"./dist/aws/types/lambda-response": "./dist/aws/types/lambda-response.mjs",
|
93
|
+
"./dist/aws/runtime/dt-logger-default": "./dist/aws/runtime/dt-logger-default.mjs",
|
94
|
+
"./dist/aws/runtime/secrets/secret": "./dist/aws/runtime/secrets/secret.mjs",
|
95
|
+
"./dist/aws/runtime/secrets/proxy-holder": "./dist/aws/runtime/secrets/proxy-holder.mjs",
|
96
|
+
"./dist/aws/runtime/secrets/dbsecret": "./dist/aws/runtime/secrets/dbsecret.mjs",
|
97
|
+
"./dist/aws/runtime/secrets/rds-holder": "./dist/aws/runtime/secrets/rds-holder.mjs",
|
98
|
+
"./dist/aws/runtime/secrets/secret-holder": "./dist/aws/runtime/secrets/secret-holder.mjs",
|
99
|
+
"./dist/aws/runtime/dt-logger": "./dist/aws/runtime/dt-logger.mjs",
|
100
|
+
"./dist/aws/runtime/s3": "./dist/aws/runtime/s3.mjs",
|
101
|
+
"./dist/aws/runtime/messaging": "./dist/aws/runtime/messaging.mjs",
|
102
|
+
"./dist/aws/runtime/apikey": "./dist/aws/runtime/apikey.mjs",
|
103
|
+
"./dist/aws/runtime/environment": "./dist/aws/runtime/environment.mjs",
|
104
|
+
"./dist/aws/runtime/digitraffic-integration-response": "./dist/aws/runtime/digitraffic-integration-response.mjs"
|
105
|
+
},
|
19
106
|
"peerDependencies": {
|
20
107
|
"@types/geojson": "^7946.0.12",
|
21
108
|
"aws-cdk-lib": "^2.103.0",
|
@@ -27,20 +114,23 @@
|
|
27
114
|
"date-fns-tz": "~2.0.0",
|
28
115
|
"etag": "^1.8.1",
|
29
116
|
"geojson-validation": "^1.0.2",
|
117
|
+
"lodash": "~4.17.21",
|
30
118
|
"node-ttl": "^0.2.0",
|
31
119
|
"pg-native": "^3.0.1",
|
32
120
|
"pg-promise": "^11.5.4"
|
33
121
|
},
|
34
122
|
"devDependencies": {
|
123
|
+
"@jest/globals": "^29.7.0",
|
35
124
|
"@types/aws-lambda": "8.10.131",
|
36
125
|
"@types/etag": "1.8.3",
|
37
126
|
"@types/geojson": "7946.0.13",
|
127
|
+
"@types/geojson-validation": "^1.0.2",
|
38
128
|
"@types/jest": "29.5.11",
|
39
129
|
"@types/lodash": "4.14.202",
|
40
130
|
"@types/node": "20.10.7",
|
41
131
|
"@types/sinon": "17.0.2",
|
42
132
|
"@typescript-eslint/eslint-plugin": "~6.18.1",
|
43
|
-
"@typescript-eslint/parser": "^6.
|
133
|
+
"@typescript-eslint/parser": "^6.19.1",
|
44
134
|
"aws-cdk-lib": "~2.118.0",
|
45
135
|
"aws-sdk": "~2.1531.0",
|
46
136
|
"axios": "^1.6.5",
|
@@ -55,15 +145,13 @@
|
|
55
145
|
"geojson-validation": "^1.0.2",
|
56
146
|
"jest": "^29.7.0",
|
57
147
|
"jest-junit": "^16.0.0",
|
58
|
-
"lint-staged": "^15.2.0",
|
59
148
|
"lodash": "~4.17.21",
|
60
149
|
"node-ttl": "^0.2.0",
|
61
|
-
"pg-native": "^3.0.1",
|
62
150
|
"pg-promise": "^11.5.4",
|
63
|
-
"prettier": "^3.
|
151
|
+
"prettier": "^3.2.4",
|
64
152
|
"rimraf": "^5.0.5",
|
65
153
|
"sinon": "17.0.1",
|
66
|
-
"ts-jest": "^29.1.
|
154
|
+
"ts-jest": "^29.1.2",
|
67
155
|
"typescript": "~5.3.3",
|
68
156
|
"velocityjs": "2.0.6"
|
69
157
|
},
|
@@ -78,7 +166,8 @@
|
|
78
166
|
"eslint-report": "eslint . --format html",
|
79
167
|
"ci:eslint-report": "eslint . --format html -o report.html || true",
|
80
168
|
"clean": "rimraf dist output",
|
81
|
-
"test": "jest --detectOpenHandles --forceExit --coverage --coverageDirectory=output/coverage/jest",
|
169
|
+
"test": "node --experimental-vm-modules --max-old-space-size=1536 --expose-gc ./node_modules/jest/bin/jest.js --detectOpenHandles --forceExit --coverage --coverageDirectory=output/coverage/jest --logHeapUsage --runInBand",
|
170
|
+
"test:inspect": "node --inspect-brk --expose-gc ./node_modules/jest/bin/jest.js --detectOpenHandles --forceExit --coverage --coverageDirectory=output/coverage/jest --logHeapUsage --runInBand",
|
82
171
|
"test:watch": "jest --detectOpenHandles --forceExit --coverage --coverageDirectory=output/coverage/jest --watch"
|
83
172
|
}
|
84
173
|
}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { getEnvVariableOrElse } from "../../../utils/utils";
|
2
|
-
import { DtLogger } from "../../runtime/dt-logger";
|
3
|
-
import { LambdaResponse } from "../../types/lambda-response";
|
1
|
+
import { getEnvVariableOrElse } from "../../../utils/utils.mjs";
|
2
|
+
import { DtLogger } from "../../runtime/dt-logger.mjs";
|
3
|
+
import { LambdaResponse } from "../../types/lambda-response.mjs";
|
4
4
|
|
5
5
|
export type LoggingHandler = (
|
6
6
|
method: () => Promise<LambdaResponse>,
|
@@ -4,8 +4,8 @@ import {
|
|
4
4
|
PassthroughBehavior,
|
5
5
|
} from "aws-cdk-lib/aws-apigateway";
|
6
6
|
import { IFunction } from "aws-cdk-lib/aws-lambda";
|
7
|
-
import { MediaType } from "../../types/mediatypes";
|
8
|
-
import { DigitrafficIntegrationResponse } from "../../runtime/digitraffic-integration-response";
|
7
|
+
import { MediaType } from "../../types/mediatypes.mjs";
|
8
|
+
import { DigitrafficIntegrationResponse } from "../../runtime/digitraffic-integration-response.mjs";
|
9
9
|
|
10
10
|
type ParameterType =
|
11
11
|
| "path"
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import { MediaType } from "../../types/mediatypes";
|
1
|
+
import { MediaType } from "../../types/mediatypes.mjs";
|
2
2
|
import {
|
3
3
|
JsonSchema,
|
4
4
|
JsonSchemaType,
|
5
5
|
JsonSchemaVersion,
|
6
6
|
MethodResponse,
|
7
7
|
Model,
|
8
|
+
type IModel
|
8
9
|
} from "aws-cdk-lib/aws-apigateway";
|
9
|
-
import {
|
10
|
-
import { dateFromIsoString } from "../../../utils/date-utils";
|
10
|
+
import { dateFromIsoString } from "../../../utils/date-utils.mjs";
|
11
11
|
|
12
12
|
/**
|
13
13
|
* This is velocity-script, that assumes the response to be LambdaResponse(status and body).
|
@@ -3,21 +3,21 @@ import {
|
|
3
3
|
XmlResponseTemplate,
|
4
4
|
NotFoundResponseTemplate,
|
5
5
|
BadRequestResponseTemplate,
|
6
|
-
} from "./response";
|
6
|
+
} from "./response.mjs";
|
7
7
|
import {
|
8
8
|
LambdaIntegration,
|
9
9
|
MethodResponse,
|
10
10
|
IntegrationResponse,
|
11
11
|
PassthroughBehavior,
|
12
|
+
type IModel
|
12
13
|
} from "aws-cdk-lib/aws-apigateway";
|
13
14
|
import { Function as AWSFunction } from "aws-cdk-lib/aws-lambda";
|
14
|
-
import { IModel } from "aws-cdk-lib/aws-apigateway/lib/model";
|
15
15
|
import {
|
16
16
|
BAD_REQUEST_MESSAGE,
|
17
17
|
ERROR_MESSAGE,
|
18
18
|
NOT_FOUND_MESSAGE,
|
19
|
-
} from "../../types/errors";
|
20
|
-
import { MediaType } from "../../types/mediatypes";
|
19
|
+
} from "../../types/errors.mjs";
|
20
|
+
import { MediaType } from "../../types/mediatypes.mjs";
|
21
21
|
|
22
22
|
/// @deprecated
|
23
23
|
export const RESPONSE_200_OK: IntegrationResponse = {
|
@@ -4,8 +4,8 @@ import {
|
|
4
4
|
PassthroughBehavior,
|
5
5
|
Resource,
|
6
6
|
} from "aws-cdk-lib/aws-apigateway";
|
7
|
-
import { MediaType } from "../../types/mediatypes";
|
8
|
-
import { RESPONSE_CORS_INTEGRATION } from "./responses";
|
7
|
+
import { MediaType } from "../../types/mediatypes.mjs";
|
8
|
+
import { RESPONSE_CORS_INTEGRATION } from "./responses.mjs";
|
9
9
|
|
10
10
|
const INTEGRATION_RESPONSE_200 = `{
|
11
11
|
"statusCode": 200
|
@@ -0,0 +1,21 @@
|
|
1
|
+
declare module 'Synthetics' {
|
2
|
+
import {type RequestOptions} from "http";
|
3
|
+
|
4
|
+
interface SyntheticsConfiguration {
|
5
|
+
withIncludeRequestBody: (value: boolean) => SyntheticsConfiguration;
|
6
|
+
withIncludeRequestHeaders: (value: boolean) => SyntheticsConfiguration;
|
7
|
+
withIncludeResponseBody: (value: boolean) => SyntheticsConfiguration;
|
8
|
+
withIncludeResponseHeaders: (value: boolean) => SyntheticsConfiguration;
|
9
|
+
withFailedCanaryMetric: (value: boolean) => SyntheticsConfiguration;
|
10
|
+
disableRequestMetrics: () => SyntheticsConfiguration;
|
11
|
+
}
|
12
|
+
|
13
|
+
export function executeHttpStep<T>(
|
14
|
+
name: string,
|
15
|
+
requestOptions: RequestOptions,
|
16
|
+
callback: JsonCheckerFunction<T>
|
17
|
+
): Promise<void>;
|
18
|
+
export function getConfiguration(): SyntheticsConfiguration;
|
19
|
+
|
20
|
+
export function executeStep(s: string, f: ()=>void, c: Record<string, boolean>)
|
21
|
+
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Construct } from "constructs";
|
2
|
-
import { CanaryParameters } from "./canary-parameters";
|
2
|
+
import { CanaryParameters } from "./canary-parameters.mjs";
|
3
3
|
import { Alarm, ComparisonOperator } from "aws-cdk-lib/aws-cloudwatch";
|
4
4
|
import { Canary } from "aws-cdk-lib/aws-synthetics";
|
5
5
|
import { SnsAction } from "aws-cdk-lib/aws-cloudwatch-actions";
|
@@ -7,10 +7,10 @@ import {
|
|
7
7
|
Test,
|
8
8
|
} from "aws-cdk-lib/aws-synthetics";
|
9
9
|
import { Role } from "aws-cdk-lib/aws-iam";
|
10
|
-
import { CanaryAlarm } from "./canary-alarm";
|
11
|
-
import { CanaryParameters } from "./canary-parameters";
|
10
|
+
import { CanaryAlarm } from "./canary-alarm.mjs";
|
11
|
+
import { CanaryParameters } from "./canary-parameters.mjs";
|
12
12
|
import { Construct } from "constructs";
|
13
|
-
import { LambdaEnvironment } from "../stack/lambda-configs";
|
13
|
+
import { LambdaEnvironment } from "../stack/lambda-configs.mjs";
|
14
14
|
|
15
15
|
export class DigitrafficCanary extends Canary {
|
16
16
|
constructor(
|
@@ -4,9 +4,9 @@ import { CfnCanary } from "aws-cdk-lib/aws-synthetics";
|
|
4
4
|
import { Schedule } from "aws-cdk-lib/aws-events";
|
5
5
|
import { Duration } from "aws-cdk-lib";
|
6
6
|
|
7
|
-
import { CanaryParameters } from "./canary-parameters";
|
8
|
-
import { DigitrafficCanary } from "./canary";
|
9
|
-
import { DigitrafficStack } from "../stack/stack";
|
7
|
+
import { CanaryParameters } from "./canary-parameters.mjs";
|
8
|
+
import { DigitrafficCanary } from "./canary.mjs";
|
9
|
+
import { DigitrafficStack } from "../stack/stack.mjs";
|
10
10
|
|
11
11
|
export class DatabaseCanary extends DigitrafficCanary {
|
12
12
|
constructor(
|
@@ -1,12 +1,11 @@
|
|
1
|
-
import { DTDatabase, inDatabaseReadonly } from "../../../database/database";
|
2
|
-
import { ProxyHolder } from "../../runtime/secrets/proxy-holder";
|
3
|
-
import { RdsHolder } from "../../runtime/secrets/rds-holder";
|
4
|
-
import { getEnvVariable } from "../../../utils/utils";
|
5
|
-
import { Countable } from "../../../database/models";
|
6
|
-
import { logger } from "../../runtime/dt-logger-default";
|
1
|
+
import { DTDatabase, inDatabaseReadonly } from "../../../database/database.mjs";
|
2
|
+
import { ProxyHolder } from "../../runtime/secrets/proxy-holder.mjs";
|
3
|
+
import { RdsHolder } from "../../runtime/secrets/rds-holder.mjs";
|
4
|
+
import { getEnvVariable } from "../../../utils/utils.mjs";
|
5
|
+
import { Countable } from "../../../database/models.mjs";
|
6
|
+
import { logger } from "../../runtime/dt-logger-default.mjs";
|
7
7
|
|
8
|
-
|
9
|
-
const synthetics = require("Synthetics");
|
8
|
+
const synthetics = await import("Synthetics");
|
10
9
|
|
11
10
|
abstract class DatabaseCheck<T> {
|
12
11
|
readonly name: string;
|
@@ -88,7 +87,6 @@ export class DatabaseCountChecker {
|
|
88
87
|
|
89
88
|
private constructor(credentialsFunction: () => Promise<void>) {
|
90
89
|
this.credentialsFunction = credentialsFunction;
|
91
|
-
|
92
90
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
93
91
|
synthetics.getConfiguration().disableRequestMetrics();
|
94
92
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
@@ -152,7 +150,6 @@ export class DatabaseCountChecker {
|
|
152
150
|
check.check(value);
|
153
151
|
};
|
154
152
|
|
155
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
156
153
|
synthetics.executeStep(check.name, checkFunction, stepConfig);
|
157
154
|
}
|
158
155
|
});
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { Role } from "aws-cdk-lib/aws-iam";
|
2
2
|
import { ISecret } from "aws-cdk-lib/aws-secretsmanager";
|
3
3
|
import { CfnCanary } from "aws-cdk-lib/aws-synthetics";
|
4
|
-
import { LambdaEnvironment } from "../stack/lambda-configs";
|
5
|
-
import { DigitrafficRestApi } from "../stack/rest_apis";
|
6
|
-
import { DigitrafficStack } from "../stack/stack";
|
7
|
-
import { DigitrafficCanary } from "./canary";
|
8
|
-
import { ENV_API_KEY, ENV_HOSTNAME, ENV_SECRET } from "./canary-keys";
|
9
|
-
import { CanaryParameters } from "./canary-parameters";
|
4
|
+
import { LambdaEnvironment } from "../stack/lambda-configs.mjs";
|
5
|
+
import { DigitrafficRestApi } from "../stack/rest_apis.mjs";
|
6
|
+
import { DigitrafficStack } from "../stack/stack.mjs";
|
7
|
+
import { DigitrafficCanary } from "./canary.mjs";
|
8
|
+
import { ENV_API_KEY, ENV_HOSTNAME, ENV_SECRET } from "./canary-keys.mjs";
|
9
|
+
import { CanaryParameters } from "./canary-parameters.mjs";
|
10
10
|
|
11
11
|
export interface UrlCanaryParameters extends CanaryParameters {
|
12
12
|
readonly hostname: string;
|
@@ -1,17 +1,17 @@
|
|
1
1
|
import { IncomingMessage, RequestOptions } from "http";
|
2
|
-
import { Asserter } from "../../../test/asserter";
|
2
|
+
import { Asserter } from "../../../test/asserter.mjs";
|
3
3
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
|
5
|
-
const synthetics
|
5
|
+
const synthetics = await import("Synthetics");
|
6
6
|
import zlib = require("zlib");
|
7
|
-
import { MediaType } from "../../types/mediatypes";
|
8
|
-
import { getApiKeyFromAPIGateway } from "../../runtime/apikey";
|
7
|
+
import { MediaType } from "../../types/mediatypes.mjs";
|
8
|
+
import { getApiKeyFromAPIGateway } from "../../runtime/apikey.mjs";
|
9
9
|
import { FeatureCollection } from "geojson";
|
10
|
-
import { isValidGeoJson } from "../../../utils/geometry";
|
11
|
-
import { getEnvVariable } from "../../../utils/utils";
|
12
|
-
import { ENV_API_KEY, ENV_HOSTNAME } from "./canary-keys";
|
13
|
-
import { logger } from "../../runtime/dt-logger-default";
|
14
|
-
import { logException } from "../../../utils/logging";
|
10
|
+
import { isValidGeoJson } from "../../../utils/geometry.mjs";
|
11
|
+
import { getEnvVariable } from "../../../utils/utils.mjs";
|
12
|
+
import { ENV_API_KEY, ENV_HOSTNAME } from "./canary-keys.mjs";
|
13
|
+
import { logger } from "../../runtime/dt-logger-default.mjs";
|
14
|
+
import { logException } from "../../../utils/logging.mjs";
|
15
15
|
|
16
16
|
export const API_KEY_HEADER = "x-api-key";
|
17
17
|
|
@@ -28,26 +28,6 @@ type JsonCheckerFunction<T> = (
|
|
28
28
|
message: IncomingMessage
|
29
29
|
) => Promise<void>;
|
30
30
|
|
31
|
-
/** Temporary type fix for SyntheticsConfiguration */
|
32
|
-
interface SyntheticsConfiguration {
|
33
|
-
withIncludeRequestBody: (value: boolean) => SyntheticsConfiguration;
|
34
|
-
withIncludeRequestHeaders: (value: boolean) => SyntheticsConfiguration;
|
35
|
-
withIncludeResponseBody: (value: boolean) => SyntheticsConfiguration;
|
36
|
-
withIncludeResponseHeaders: (value: boolean) => SyntheticsConfiguration;
|
37
|
-
withFailedCanaryMetric: (value: boolean) => SyntheticsConfiguration;
|
38
|
-
disableRequestMetrics: () => SyntheticsConfiguration;
|
39
|
-
}
|
40
|
-
|
41
|
-
/** Temporary type fix for Synthetics */
|
42
|
-
interface Synthetics {
|
43
|
-
executeHttpStep<T>(
|
44
|
-
name: string,
|
45
|
-
requestOptions: RequestOptions,
|
46
|
-
callback: JsonCheckerFunction<T>
|
47
|
-
): Promise<void>;
|
48
|
-
getConfiguration(): SyntheticsConfiguration;
|
49
|
-
}
|
50
|
-
|
51
31
|
export class UrlChecker {
|
52
32
|
private readonly requestOptions: RequestOptions;
|
53
33
|
|
@@ -4,10 +4,10 @@ import {
|
|
4
4
|
PassthroughBehavior,
|
5
5
|
RequestValidator,
|
6
6
|
Resource,
|
7
|
+
IModel
|
7
8
|
} from "aws-cdk-lib/aws-apigateway";
|
8
9
|
import { Queue } from "aws-cdk-lib/aws-sqs";
|
9
10
|
import { PolicyStatement, Role, ServicePrincipal } from "aws-cdk-lib/aws-iam";
|
10
|
-
import { IModel } from "aws-cdk-lib/aws-apigateway/lib/model";
|
11
11
|
import { Construct } from "constructs";
|
12
12
|
|
13
13
|
export function attachQueueToApiGatewayResource(
|
@@ -10,8 +10,8 @@ import { SnsAction } from "aws-cdk-lib/aws-cloudwatch-actions";
|
|
10
10
|
import { S3, S3Client } from "@aws-sdk/client-s3";
|
11
11
|
import { Upload } from "@aws-sdk/lib-storage";
|
12
12
|
import { SQSEvent, SQSHandler, SQSRecord } from "aws-lambda";
|
13
|
-
import { DigitrafficStack } from "./stack/stack";
|
14
|
-
import { MonitoredFunction } from "./stack/monitoredfunction";
|
13
|
+
import { DigitrafficStack } from "./stack/stack.mjs";
|
14
|
+
import { MonitoredFunction } from "./stack/monitoredfunction.mjs";
|
15
15
|
|
16
16
|
/**
|
17
17
|
* Construct for creating SQS-queues.
|
@@ -135,15 +135,12 @@ const bucketName = "";
|
|
135
135
|
|
136
136
|
function createHandler(): SQSHandler {
|
137
137
|
return async function handler(event: SQSEvent): Promise<void> {
|
138
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment
|
139
|
-
const AWS = require("aws-sdk");
|
140
138
|
|
141
139
|
const millis = new Date().getTime();
|
142
140
|
await Promise.all(
|
143
141
|
event.Records.map((e: SQSRecord, idx: number) =>
|
144
142
|
uploadToS3(
|
145
|
-
|
146
|
-
new AWS.S3(),
|
143
|
+
new S3(),
|
147
144
|
bucketName,
|
148
145
|
e.body,
|
149
146
|
`dlq-${millis}-${idx}.json`
|
@@ -9,8 +9,8 @@ import { Duration } from "aws-cdk-lib";
|
|
9
9
|
import { IVpc, SubnetSelection } from "aws-cdk-lib/aws-ec2";
|
10
10
|
import { RetentionDays } from "aws-cdk-lib/aws-logs";
|
11
11
|
import { Role } from "aws-cdk-lib/aws-iam";
|
12
|
-
import { DigitrafficStack } from "./stack";
|
13
|
-
import { MonitoredFunctionAlarmProps } from "./monitoredfunction";
|
12
|
+
import { DigitrafficStack } from "./stack.mjs";
|
13
|
+
import { MonitoredFunctionAlarmProps } from "./monitoredfunction.mjs";
|
14
14
|
|
15
15
|
export type LambdaEnvironment = Record<string, string>;
|
16
16
|
|
@@ -2,15 +2,15 @@ import { Function, FunctionProps } from "aws-cdk-lib/aws-lambda";
|
|
2
2
|
import { Stack } from "aws-cdk-lib";
|
3
3
|
import { SnsAction } from "aws-cdk-lib/aws-cloudwatch-actions";
|
4
4
|
import { ComparisonOperator, Metric } from "aws-cdk-lib/aws-cloudwatch";
|
5
|
-
import { DigitrafficStack } from "
|
5
|
+
import { DigitrafficStack } from "./stack.mjs";
|
6
6
|
import { ITopic } from "aws-cdk-lib/aws-sns";
|
7
7
|
import {
|
8
8
|
databaseFunctionProps,
|
9
9
|
LambdaEnvironment,
|
10
10
|
MonitoredFunctionParameters,
|
11
|
-
} from "
|
12
|
-
import { DigitrafficLogSubscriptions } from "
|
13
|
-
import { TrafficType } from "../../../types/traffictype";
|
11
|
+
} from "./lambda-configs.mjs";
|
12
|
+
import { DigitrafficLogSubscriptions } from "./subscription.mjs";
|
13
|
+
import { TrafficType } from "../../../types/traffictype.mjs";
|
14
14
|
|
15
15
|
import _ from "lodash";
|
16
16
|
|
@@ -19,12 +19,12 @@ import {
|
|
19
19
|
PolicyStatement,
|
20
20
|
} from "aws-cdk-lib/aws-iam";
|
21
21
|
import { Construct } from "constructs";
|
22
|
-
import { getModelReference } from "../../../utils/api-model";
|
23
|
-
import { MediaType } from "../../types/mediatypes";
|
24
|
-
import { ModelWithReference } from "../../types/model-with-reference";
|
25
|
-
import { DocumentationPart, DocumentationProperties } from "../documentation";
|
26
|
-
import { createDefaultUsagePlan, createUsagePlan } from "../usage-plans";
|
27
|
-
import { DigitrafficStack } from "./stack";
|
22
|
+
import { getModelReference } from "../../../utils/api-model.mjs";
|
23
|
+
import { MediaType } from "../../types/mediatypes.mjs";
|
24
|
+
import { ModelWithReference } from "../../types/model-with-reference.mjs";
|
25
|
+
import { DocumentationPart, DocumentationProperties } from "../documentation.mjs";
|
26
|
+
import { createDefaultUsagePlan, createUsagePlan } from "../usage-plans.mjs";
|
27
|
+
import { DigitrafficStack } from "./stack.mjs";
|
28
28
|
|
29
29
|
import _ from "lodash";
|
30
30
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Annotations, IAspect, Stack } from "aws-cdk-lib";
|
2
2
|
import { CfnFunction, Runtime } from "aws-cdk-lib/aws-lambda";
|
3
3
|
import { CfnBucket } from "aws-cdk-lib/aws-s3";
|
4
|
-
import { DigitrafficStack, SOLUTION_KEY } from "./stack";
|
4
|
+
import { DigitrafficStack, SOLUTION_KEY } from "./stack.mjs";
|
5
5
|
import { IConstruct } from "constructs";
|
6
6
|
import { CfnMethod, CfnResource } from "aws-cdk-lib/aws-apigateway";
|
7
7
|
import { CfnQueue } from "aws-cdk-lib/aws-sqs";
|
@@ -1,15 +1,14 @@
|
|
1
1
|
import { Aspects, Stack, StackProps } from "aws-cdk-lib";
|
2
|
-
import { IVpc, SecurityGroup, Vpc } from "aws-cdk-lib/aws-ec2";
|
3
|
-
import { ISecurityGroup } from "aws-cdk-lib/aws-ec2/lib/security-group";
|
2
|
+
import { type ISecurityGroup, IVpc, SecurityGroup, Vpc } from "aws-cdk-lib/aws-ec2";
|
4
3
|
import { ITopic, Topic } from "aws-cdk-lib/aws-sns";
|
5
4
|
import { StringParameter } from "aws-cdk-lib/aws-ssm";
|
6
5
|
import { ISecret, Secret } from "aws-cdk-lib/aws-secretsmanager";
|
7
6
|
import { Function as AWSFunction } from "aws-cdk-lib/aws-lambda";
|
8
7
|
|
9
|
-
import { StackCheckingAspect } from "./stack-checking-aspect";
|
8
|
+
import { StackCheckingAspect } from "./stack-checking-aspect.mjs";
|
10
9
|
import { Construct } from "constructs";
|
11
|
-
import { TrafficType } from "../../../types/traffictype";
|
12
|
-
import { DBLambdaEnvironment } from "./lambda-configs";
|
10
|
+
import { TrafficType } from "../../../types/traffictype.mjs";
|
11
|
+
import { DBLambdaEnvironment } from "./lambda-configs.mjs";
|
13
12
|
|
14
13
|
const SSM_ROOT = "/digitraffic";
|
15
14
|
export const SOLUTION_KEY = "Solution";
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { CfnSubscriptionFilter } from "aws-cdk-lib/aws-logs";
|
2
2
|
import { Function as AWSFunction } from "aws-cdk-lib/aws-lambda";
|
3
|
-
import { DigitrafficStack } from "./stack";
|
3
|
+
import { DigitrafficStack } from "./stack.mjs";
|
4
4
|
import { Construct } from "constructs";
|
5
|
-
import { MonitoredFunction } from "./monitoredfunction";
|
5
|
+
import { MonitoredFunction } from "./monitoredfunction.mjs";
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Creates a subscription filter that subscribes to a Lambda Log Group and delivers the logs to another destination.
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { Duration, RemovalPolicy, Stack } from "aws-cdk-lib";
|
2
|
-
import { Construct } from "constructs
|
2
|
+
import { type Construct } from "constructs";
|
3
3
|
import {
|
4
4
|
PrivateHostedZone,
|
5
5
|
RecordSet,
|
6
6
|
RecordTarget,
|
7
7
|
RecordType,
|
8
8
|
} from "aws-cdk-lib/aws-route53";
|
9
|
-
import { InfraStackConfiguration } from "./intra-stack-configuration";
|
10
|
-
import { importVpc } from "../import-util";
|
11
|
-
import { getParameterValue } from "../stack/parameters";
|
9
|
+
import { InfraStackConfiguration } from "./intra-stack-configuration.mjs";
|
10
|
+
import { importVpc } from "../import-util.mjs";
|
11
|
+
import { getParameterValue } from "../stack/parameters.mjs";
|
12
12
|
|
13
13
|
const DEFAULT_RECORD_TTL = Duration.seconds(30);
|
14
14
|
|
@@ -7,12 +7,12 @@ import {
|
|
7
7
|
} from "aws-cdk-lib/aws-rds";
|
8
8
|
import { ISecret, Secret } from "aws-cdk-lib/aws-secretsmanager";
|
9
9
|
import { IVpc, SecurityGroup } from "aws-cdk-lib/aws-ec2";
|
10
|
-
import { InfraStackConfiguration } from "./intra-stack-configuration";
|
11
|
-
import { DbStack } from "./db-stack";
|
12
|
-
import { exportValue, importVpc } from "../import-util";
|
13
|
-
import { createParameter } from "../stack/parameters";
|
10
|
+
import { InfraStackConfiguration } from "./intra-stack-configuration.mjs";
|
11
|
+
import { DbStack } from "./db-stack.mjs";
|
12
|
+
import { exportValue, importVpc } from "../import-util.mjs";
|
13
|
+
import { createParameter } from "../stack/parameters.mjs";
|
14
14
|
import { Stack, Duration } from "aws-cdk-lib/core";
|
15
|
-
import { Construct } from "constructs/lib/construct";
|
15
|
+
import { Construct } from "constructs/lib/construct.js";
|
16
16
|
|
17
17
|
export interface ProxyConfiguration {
|
18
18
|
readonly secretArn: string;
|