diff --git a/package-lock.json b/package-lock.json index 83d074fa..f636ba71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19535,7 +19535,7 @@ }, "packages/spacecat-shared-content-client": { "name": "@adobe/spacecat-shared-content-client", - "version": "1.2.13", + "version": "1.2.14", "license": "Apache-2.0", "dependencies": { "@adobe/helix-universal": "5.0.8", @@ -21223,10 +21223,10 @@ }, "packages/spacecat-shared-data-access": { "name": "@adobe/spacecat-shared-data-access", - "version": "1.58.2", + "version": "1.59.0", "license": "Apache-2.0", "dependencies": { - "@adobe/spacecat-shared-dynamo": "1.3.50", + "@adobe/spacecat-shared-dynamo": "1.4.0", "@adobe/spacecat-shared-utils": "1.23.1", "@aws-sdk/client-dynamodb": "3.705.0", "@aws-sdk/lib-dynamodb": "3.705.0", @@ -21263,605 +21263,86 @@ "node": ">=14.16" } }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo": { - "version": "1.3.50", - "resolved": "https://registry.npmjs.org/@adobe/spacecat-shared-dynamo/-/spacecat-shared-dynamo-1.3.50.tgz", - "integrity": "sha512-gJzLTz2XUi/b6M8Prx9+PaV01eddwETdwFoRAvjRGwoK2vjVwkiweAyDBSpbG5ww/HY/NNbZTBpOMDDj/5CvXg==", - "license": "Apache-2.0", - "dependencies": { - "@adobe/spacecat-shared-utils": "1.22.4", - "@aws-sdk/client-dynamodb": "3.699.0", - "@aws-sdk/lib-dynamodb": "3.699.0", - "aws-xray-sdk": "3.10.2" - }, - "engines": { - "node": ">=20.0.0 <23.0.0", - "npm": ">=10.0.0 <11.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@adobe/spacecat-shared-utils": { - "version": "1.22.4", - "resolved": "https://registry.npmjs.org/@adobe/spacecat-shared-utils/-/spacecat-shared-utils-1.22.4.tgz", - "integrity": "sha512-BJoBMwNZMH/35K58H2k10lbV97MIfF6bqQY1CjCgt3mjGeh6HeqWtwl33WB2QrZ9FdVRBJN+YNrwGkyGn948hA==", - "license": "Apache-2.0", - "dependencies": { - "@adobe/fetch": "4.1.9", - "@aws-sdk/client-s3": "3.685.0", - "@aws-sdk/client-sqs": "3.682.0", - "@json2csv/plainjs": "7.0.6", - "aws-xray-sdk": "3.10.1" - }, - "engines": { - "node": ">=20.0.0 <23.0.0", - "npm": ">=10.0.0 <11.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@adobe/spacecat-shared-utils/node_modules/aws-xray-sdk": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/aws-xray-sdk/-/aws-xray-sdk-3.10.1.tgz", - "integrity": "sha512-Ihp5L2x9LdM8CmC5Hu9HvgenEqb3d+DJZbgDegToPjer+WfVn0PU7JnGmBHX+2nnhbO6SyA7kZcFNAyQyw0rmQ==", - "license": "Apache-2.0", - "dependencies": { - "aws-xray-sdk-core": "3.10.1", - "aws-xray-sdk-express": "3.10.1", - "aws-xray-sdk-mysql": "3.10.1", - "aws-xray-sdk-postgres": "3.10.1" - }, - "engines": { - "node": ">= 14.x" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb": { - "version": "3.699.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-dynamodb/-/client-dynamodb-3.699.0.tgz", - "integrity": "sha512-npf2ZPUbFyyeWb0Fmgs/hGdjeecyUyldVU6okwM9DaaeOtlUmXA9e1vtrplgRJs3DLJdDJCGSTrBI+4w0MtgGg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.699.0", - "@aws-sdk/client-sts": "3.699.0", - "@aws-sdk/core": "3.696.0", - "@aws-sdk/credential-provider-node": "3.699.0", - "@aws-sdk/middleware-endpoint-discovery": "3.696.0", - "@aws-sdk/middleware-host-header": "3.696.0", - "@aws-sdk/middleware-logger": "3.696.0", - "@aws-sdk/middleware-recursion-detection": "3.696.0", - "@aws-sdk/middleware-user-agent": "3.696.0", - "@aws-sdk/region-config-resolver": "3.696.0", - "@aws-sdk/types": "3.696.0", - "@aws-sdk/util-endpoints": "3.696.0", - "@aws-sdk/util-user-agent-browser": "3.696.0", - "@aws-sdk/util-user-agent-node": "3.696.0", - "@smithy/config-resolver": "^3.0.12", - "@smithy/core": "^2.5.3", - "@smithy/fetch-http-handler": "^4.1.1", - "@smithy/hash-node": "^3.0.10", - "@smithy/invalid-dependency": "^3.0.10", - "@smithy/middleware-content-length": "^3.0.12", - "@smithy/middleware-endpoint": "^3.2.3", - "@smithy/middleware-retry": "^3.0.27", - "@smithy/middleware-serde": "^3.0.10", - "@smithy/middleware-stack": "^3.0.10", - "@smithy/node-config-provider": "^3.1.11", - "@smithy/node-http-handler": "^3.3.1", - "@smithy/protocol-http": "^4.1.7", - "@smithy/smithy-client": "^3.4.4", - "@smithy/types": "^3.7.1", - "@smithy/url-parser": "^3.0.10", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.27", - "@smithy/util-defaults-mode-node": "^3.0.27", - "@smithy/util-endpoints": "^2.1.6", - "@smithy/util-middleware": "^3.0.10", - "@smithy/util-retry": "^3.0.10", - "@smithy/util-utf8": "^3.0.0", - "@smithy/util-waiter": "^3.1.9", - "@types/uuid": "^9.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/client-sso": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.696.0.tgz", - "integrity": "sha512-q5TTkd08JS0DOkHfUL853tuArf7NrPeqoS5UOvqJho8ibV9Ak/a/HO4kNvy9Nj3cib/toHYHsQIEtecUPSUUrQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.696.0", - "@aws-sdk/middleware-host-header": "3.696.0", - "@aws-sdk/middleware-logger": "3.696.0", - "@aws-sdk/middleware-recursion-detection": "3.696.0", - "@aws-sdk/middleware-user-agent": "3.696.0", - "@aws-sdk/region-config-resolver": "3.696.0", - "@aws-sdk/types": "3.696.0", - "@aws-sdk/util-endpoints": "3.696.0", - "@aws-sdk/util-user-agent-browser": "3.696.0", - "@aws-sdk/util-user-agent-node": "3.696.0", - "@smithy/config-resolver": "^3.0.12", - "@smithy/core": "^2.5.3", - "@smithy/fetch-http-handler": "^4.1.1", - "@smithy/hash-node": "^3.0.10", - "@smithy/invalid-dependency": "^3.0.10", - "@smithy/middleware-content-length": "^3.0.12", - "@smithy/middleware-endpoint": "^3.2.3", - "@smithy/middleware-retry": "^3.0.27", - "@smithy/middleware-serde": "^3.0.10", - "@smithy/middleware-stack": "^3.0.10", - "@smithy/node-config-provider": "^3.1.11", - "@smithy/node-http-handler": "^3.3.1", - "@smithy/protocol-http": "^4.1.7", - "@smithy/smithy-client": "^3.4.4", - "@smithy/types": "^3.7.1", - "@smithy/url-parser": "^3.0.10", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.27", - "@smithy/util-defaults-mode-node": "^3.0.27", - "@smithy/util-endpoints": "^2.1.6", - "@smithy/util-middleware": "^3.0.10", - "@smithy/util-retry": "^3.0.10", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.699.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.699.0.tgz", - "integrity": "sha512-u8a1GorY5D1l+4FQAf4XBUC1T10/t7neuwT21r0ymrtMFSK2a9QqVHKMoLkvavAwyhJnARSBM9/UQC797PFOFw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.696.0", - "@aws-sdk/credential-provider-node": "3.699.0", - "@aws-sdk/middleware-host-header": "3.696.0", - "@aws-sdk/middleware-logger": "3.696.0", - "@aws-sdk/middleware-recursion-detection": "3.696.0", - "@aws-sdk/middleware-user-agent": "3.696.0", - "@aws-sdk/region-config-resolver": "3.696.0", - "@aws-sdk/types": "3.696.0", - "@aws-sdk/util-endpoints": "3.696.0", - "@aws-sdk/util-user-agent-browser": "3.696.0", - "@aws-sdk/util-user-agent-node": "3.696.0", - "@smithy/config-resolver": "^3.0.12", - "@smithy/core": "^2.5.3", - "@smithy/fetch-http-handler": "^4.1.1", - "@smithy/hash-node": "^3.0.10", - "@smithy/invalid-dependency": "^3.0.10", - "@smithy/middleware-content-length": "^3.0.12", - "@smithy/middleware-endpoint": "^3.2.3", - "@smithy/middleware-retry": "^3.0.27", - "@smithy/middleware-serde": "^3.0.10", - "@smithy/middleware-stack": "^3.0.10", - "@smithy/node-config-provider": "^3.1.11", - "@smithy/node-http-handler": "^3.3.1", - "@smithy/protocol-http": "^4.1.7", - "@smithy/smithy-client": "^3.4.4", - "@smithy/types": "^3.7.1", - "@smithy/url-parser": "^3.0.10", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.27", - "@smithy/util-defaults-mode-node": "^3.0.27", - "@smithy/util-endpoints": "^2.1.6", - "@smithy/util-middleware": "^3.0.10", - "@smithy/util-retry": "^3.0.10", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.699.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/client-sts": { - "version": "3.699.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.699.0.tgz", - "integrity": "sha512-++lsn4x2YXsZPIzFVwv3fSUVM55ZT0WRFmPeNilYIhZClxHLmVAWKH4I55cY9ry60/aTKYjzOXkWwyBKGsGvQg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.699.0", - "@aws-sdk/core": "3.696.0", - "@aws-sdk/credential-provider-node": "3.699.0", - "@aws-sdk/middleware-host-header": "3.696.0", - "@aws-sdk/middleware-logger": "3.696.0", - "@aws-sdk/middleware-recursion-detection": "3.696.0", - "@aws-sdk/middleware-user-agent": "3.696.0", - "@aws-sdk/region-config-resolver": "3.696.0", - "@aws-sdk/types": "3.696.0", - "@aws-sdk/util-endpoints": "3.696.0", - "@aws-sdk/util-user-agent-browser": "3.696.0", - "@aws-sdk/util-user-agent-node": "3.696.0", - "@smithy/config-resolver": "^3.0.12", - "@smithy/core": "^2.5.3", - "@smithy/fetch-http-handler": "^4.1.1", - "@smithy/hash-node": "^3.0.10", - "@smithy/invalid-dependency": "^3.0.10", - "@smithy/middleware-content-length": "^3.0.12", - "@smithy/middleware-endpoint": "^3.2.3", - "@smithy/middleware-retry": "^3.0.27", - "@smithy/middleware-serde": "^3.0.10", - "@smithy/middleware-stack": "^3.0.10", - "@smithy/node-config-provider": "^3.1.11", - "@smithy/node-http-handler": "^3.3.1", - "@smithy/protocol-http": "^4.1.7", - "@smithy/smithy-client": "^3.4.4", - "@smithy/types": "^3.7.1", - "@smithy/url-parser": "^3.0.10", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.27", - "@smithy/util-defaults-mode-node": "^3.0.27", - "@smithy/util-endpoints": "^2.1.6", - "@smithy/util-middleware": "^3.0.10", - "@smithy/util-retry": "^3.0.10", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/core": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.696.0.tgz", - "integrity": "sha512-3c9III1k03DgvRZWg8vhVmfIXPG6hAciN9MzQTzqGngzWAELZF/WONRTRQuDFixVtarQatmLHYVw/atGeA2Byw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.696.0", - "@smithy/core": "^2.5.3", - "@smithy/node-config-provider": "^3.1.11", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.7", - "@smithy/signature-v4": "^4.2.2", - "@smithy/smithy-client": "^3.4.4", - "@smithy/types": "^3.7.1", - "@smithy/util-middleware": "^3.0.10", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.696.0.tgz", - "integrity": "sha512-T9iMFnJL7YTlESLpVFT3fg1Lkb1lD+oiaIC8KMpepb01gDUBIpj9+Y+pA/cgRWW0yRxmkDXNazAE2qQTVFGJzA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.696.0", - "@aws-sdk/types": "3.696.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.696.0.tgz", - "integrity": "sha512-GV6EbvPi2eq1+WgY/o2RFA3P7HGmnkIzCNmhwtALFlqMroLYWKE7PSeHw66Uh1dFQeVESn0/+hiUNhu1mB0emA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.696.0", - "@aws-sdk/types": "3.696.0", - "@smithy/fetch-http-handler": "^4.1.1", - "@smithy/node-http-handler": "^3.3.1", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.7", - "@smithy/smithy-client": "^3.4.4", - "@smithy/types": "^3.7.1", - "@smithy/util-stream": "^3.3.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.699.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.699.0.tgz", - "integrity": "sha512-dXmCqjJnKmG37Q+nLjPVu22mNkrGHY8hYoOt3Jo9R2zr5MYV7s/NHsCHr+7E+BZ+tfZYLRPeB1wkpTeHiEcdRw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.696.0", - "@aws-sdk/credential-provider-env": "3.696.0", - "@aws-sdk/credential-provider-http": "3.696.0", - "@aws-sdk/credential-provider-process": "3.696.0", - "@aws-sdk/credential-provider-sso": "3.699.0", - "@aws-sdk/credential-provider-web-identity": "3.696.0", - "@aws-sdk/types": "3.696.0", - "@smithy/credential-provider-imds": "^3.2.6", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.699.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.699.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.699.0.tgz", - "integrity": "sha512-MmEmNDo1bBtTgRmdNfdQksXu4uXe66s0p1hi1YPrn1h59Q605eq/xiWbGL6/3KdkViH6eGUuABeV2ODld86ylg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.696.0", - "@aws-sdk/credential-provider-http": "3.696.0", - "@aws-sdk/credential-provider-ini": "3.699.0", - "@aws-sdk/credential-provider-process": "3.696.0", - "@aws-sdk/credential-provider-sso": "3.699.0", - "@aws-sdk/credential-provider-web-identity": "3.696.0", - "@aws-sdk/types": "3.696.0", - "@smithy/credential-provider-imds": "^3.2.6", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.696.0.tgz", - "integrity": "sha512-mL1RcFDe9sfmyU5K1nuFkO8UiJXXxLX4JO1gVaDIOvPqwStpUAwi3A1BoeZhWZZNQsiKI810RnYGo0E0WB/hUA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.696.0", - "@aws-sdk/types": "3.696.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.699.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.699.0.tgz", - "integrity": "sha512-Ekp2cZG4pl9D8+uKWm4qO1xcm8/MeiI8f+dnlZm8aQzizeC+aXYy9GyoclSf6daK8KfRPiRfM7ZHBBL5dAfdMA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/client-sso": "3.696.0", - "@aws-sdk/core": "3.696.0", - "@aws-sdk/token-providers": "3.699.0", - "@aws-sdk/types": "3.696.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.696.0.tgz", - "integrity": "sha512-XJ/CVlWChM0VCoc259vWguFUjJDn/QwDqHwbx+K9cg3v6yrqXfK5ai+p/6lx0nQpnk4JzPVeYYxWRpaTsGC9rg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.696.0", - "@aws-sdk/types": "3.696.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.696.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.696.0.tgz", - "integrity": "sha512-zELJp9Ta2zkX7ELggMN9qMCgekqZhFC5V2rOr4hJDEb/Tte7gpfKSObAnw/3AYiVqt36sjHKfdkoTsuwGdEoDg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.696.0", - "@smithy/protocol-http": "^4.1.7", - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/middleware-logger": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.696.0.tgz", - "integrity": "sha512-KhkHt+8AjCxcR/5Zp3++YPJPpFQzxpr+jmONiT/Jw2yqnSngZ0Yspm5wGoRx2hS1HJbyZNuaOWEGuJoxLeBKfA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.696.0", - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.696.0.tgz", - "integrity": "sha512-si/maV3Z0hH7qa99f9ru2xpS5HlfSVcasRlNUXKSDm611i7jFMWwGNLUOXFAOLhXotPX5G3Z6BLwL34oDeBMug==", + "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@adobe/spacecat-shared-utils": { + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/@adobe/spacecat-shared-utils/-/spacecat-shared-utils-1.22.4.tgz", + "integrity": "sha512-BJoBMwNZMH/35K58H2k10lbV97MIfF6bqQY1CjCgt3mjGeh6HeqWtwl33WB2QrZ9FdVRBJN+YNrwGkyGn948hA==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.696.0", - "@smithy/protocol-http": "^4.1.7", - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" + "@adobe/fetch": "4.1.9", + "@aws-sdk/client-s3": "3.685.0", + "@aws-sdk/client-sqs": "3.682.0", + "@json2csv/plainjs": "7.0.6", + "aws-xray-sdk": "3.10.1" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0 <23.0.0", + "npm": ">=10.0.0 <11.0.0" } }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.696.0.tgz", - "integrity": "sha512-Lvyj8CTyxrHI6GHd2YVZKIRI5Fmnugt3cpJo0VrKKEgK5zMySwEZ1n4dqPK6czYRWKd5+WnYHYAuU+Wdk6Jsjw==", + "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb": { + "version": "3.699.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-dynamodb/-/client-dynamodb-3.699.0.tgz", + "integrity": "sha512-npf2ZPUbFyyeWb0Fmgs/hGdjeecyUyldVU6okwM9DaaeOtlUmXA9e1vtrplgRJs3DLJdDJCGSTrBI+4w0MtgGg==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.699.0", + "@aws-sdk/client-sts": "3.699.0", "@aws-sdk/core": "3.696.0", + "@aws-sdk/credential-provider-node": "3.699.0", + "@aws-sdk/middleware-endpoint-discovery": "3.696.0", + "@aws-sdk/middleware-host-header": "3.696.0", + "@aws-sdk/middleware-logger": "3.696.0", + "@aws-sdk/middleware-recursion-detection": "3.696.0", + "@aws-sdk/middleware-user-agent": "3.696.0", + "@aws-sdk/region-config-resolver": "3.696.0", "@aws-sdk/types": "3.696.0", "@aws-sdk/util-endpoints": "3.696.0", + "@aws-sdk/util-user-agent-browser": "3.696.0", + "@aws-sdk/util-user-agent-node": "3.696.0", + "@smithy/config-resolver": "^3.0.12", "@smithy/core": "^2.5.3", - "@smithy/protocol-http": "^4.1.7", - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.696.0.tgz", - "integrity": "sha512-7EuH142lBXjI8yH6dVS/CZeiK/WZsmb/8zP6bQbVYpMrppSTgB3MzZZdxVZGzL5r8zPQOU10wLC4kIMy0qdBVQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.696.0", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/hash-node": "^3.0.10", + "@smithy/invalid-dependency": "^3.0.10", + "@smithy/middleware-content-length": "^3.0.12", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-retry": "^3.0.27", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/middleware-stack": "^3.0.10", "@smithy/node-config-provider": "^3.1.11", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", "@smithy/types": "^3.7.1", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.10", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/token-providers": { - "version": "3.699.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.699.0.tgz", - "integrity": "sha512-kuiEW9DWs7fNos/SM+y58HCPhcIzm1nEZLhe2/7/6+TvAYLuEWURYsbK48gzsxXlaJ2k/jGY3nIsA7RptbMOwA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.696.0", - "@smithy/property-provider": "^3.1.9", - "@smithy/shared-ini-file-loader": "^3.1.10", - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.699.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/types": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.696.0.tgz", - "integrity": "sha512-9rTvUJIAj5d3//U5FDPWGJ1nFJLuWb30vugGOrWk7aNZ6y9tuA3PI7Cc9dP8WEXKVyK1vuuk8rSFP2iqXnlgrw==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/util-endpoints": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.696.0.tgz", - "integrity": "sha512-T5s0IlBVX+gkb9g/I6CLt4yAZVzMSiGnbUqWihWsHvQR1WOoIcndQy/Oz/IJXT9T2ipoy7a80gzV6a5mglrioA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.696.0", - "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.27", + "@smithy/util-defaults-mode-node": "^3.0.27", "@smithy/util-endpoints": "^2.1.6", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.696.0.tgz", - "integrity": "sha512-Z5rVNDdmPOe6ELoM5AhF/ja5tSjbe6ctSctDPb0JdDf4dT0v2MfwhJKzXju2RzX8Es/77Glh7MlaXLE0kCB9+Q==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.696.0", - "@smithy/types": "^3.7.1", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.696.0.tgz", - "integrity": "sha512-KhKqcfyXIB0SCCt+qsu4eJjsfiOrNzK5dCV7RAW2YIpp+msxGUUX0NdRE9rkzjiv+3EMktgJm3eEIS+yxtlVdQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/middleware-user-agent": "3.696.0", - "@aws-sdk/types": "3.696.0", - "@smithy/node-config-provider": "^3.1.11", - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "@smithy/util-utf8": "^3.0.0", + "@smithy/util-waiter": "^3.1.9", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "engines": { "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-dynamodb/node_modules/@smithy/fetch-http-handler": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-4.1.1.tgz", - "integrity": "sha512-bH7QW0+JdX0bPBadXt8GwMof/jz0H28I84hU1Uet9ISpzUqXqRQ3fEZJ+ANPOhzSEczYvANNl3uDQDYArSFDtA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/protocol-http": "^4.1.7", - "@smithy/querystring-builder": "^3.0.10", - "@smithy/types": "^3.7.1", - "@smithy/util-base64": "^3.0.0", - "tslib": "^2.6.2" } }, "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/client-s3": { "version": "3.685.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.685.0.tgz", "integrity": "sha512-ClvMeQHbLhWkpxnVymo4qWS5/yZcPXjorDbSday3joCWYWCSHTO409nWd+jx6eA4MKT/EY/uJ6ZBJRFfByKLuA==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha1-browser": "5.2.0", @@ -21931,6 +21412,7 @@ "version": "3.682.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-sqs/-/client-sqs-3.682.0.tgz", "integrity": "sha512-93r0i2VwiHiZkcXfWVoxMpyw91Ou0C6gyS7AzPHoZ9ZoXV1VaBFqQ/FmcLzzNa9pwjE6k/Pn7VJMNKBezE8EmQ==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", @@ -21985,6 +21467,7 @@ "version": "3.682.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.682.0.tgz", "integrity": "sha512-PYH9RFUMYLFl66HSBq4tIx6fHViMLkhJHTYJoJONpBs+Td+NwVJ895AdLtDsBIhMS0YseCbPpuyjUCJgsUrwUw==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", @@ -22034,6 +21517,7 @@ "version": "3.682.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.682.0.tgz", "integrity": "sha512-ZPZ7Y/r/w3nx/xpPzGSqSQsB090Xk5aZZOH+WBhTDn/pBEuim09BYXCLzvvxb7R7NnuoQdrTJiwimdJAhHl7ZQ==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", @@ -22087,6 +21571,7 @@ "version": "3.682.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.682.0.tgz", "integrity": "sha512-xKuo4HksZ+F8m9DOfx/ZuWNhaPuqZFPwwy0xqcBT6sWH7OAuBjv/fnpOTzyQhpVTWddlf+ECtMAMrxjxuOExGQ==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", @@ -22138,6 +21623,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.679.0.tgz", "integrity": "sha512-CS6PWGX8l4v/xyvX8RtXnBisdCa5+URzKd0L6GvHChype9qKUVxO/Gg6N/y43Hvg7MNWJt9FBPNWIxUB+byJwg==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22160,6 +21646,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.679.0.tgz", "integrity": "sha512-EdlTYbzMm3G7VUNAMxr9S1nC1qUNqhKlAxFU8E7cKsAe8Bp29CD5HAs3POc56AVo9GC4yRIS+/mtlZSmrckzUA==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.679.0", @@ -22176,6 +21663,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.679.0.tgz", "integrity": "sha512-ZoKLubW5DqqV1/2a3TSn+9sSKg0T8SsYMt1JeirnuLJF0mCoYFUaWMyvxxKuxPoqvUsaycxKru4GkpJ10ltNBw==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.679.0", @@ -22197,6 +21685,7 @@ "version": "3.682.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.682.0.tgz", "integrity": "sha512-6eqWeHdK6EegAxqDdiCi215nT3QZPwukgWAYuVxNfJ/5m0/P7fAzF+D5kKVgByUvGJEbq/FEL8Fw7OBe64AA+g==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.679.0", @@ -22223,6 +21712,7 @@ "version": "3.682.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.682.0.tgz", "integrity": "sha512-HSmDqZcBVZrTctHCT9m++vdlDfJ1ARI218qmZa+TZzzOFNpKWy6QyHMEra45GB9GnkkMmV6unoDSPMuN0AqcMg==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/credential-provider-env": "3.679.0", @@ -22246,6 +21736,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.679.0.tgz", "integrity": "sha512-u/p4TV8kQ0zJWDdZD4+vdQFTMhkDEJFws040Gm113VHa/Xo1SYOjbpvqeuFoz6VmM0bLvoOWjxB9MxnSQbwKpQ==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.679.0", @@ -22263,6 +21754,7 @@ "version": "3.682.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.682.0.tgz", "integrity": "sha512-h7IH1VsWgV6YAJSWWV6y8uaRjGqLY3iBpGZlXuTH/c236NMLaNv+WqCBLeBxkFGUb2WeQ+FUPEJDCD69rgLIkg==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-sso": "3.682.0", @@ -22282,6 +21774,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.679.0.tgz", "integrity": "sha512-a74tLccVznXCaBefWPSysUcLXYJiSkeUmQGtalNgJ1vGkE36W5l/8czFiiowdWdKWz7+x6xf0w+Kjkjlj42Ung==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.679.0", @@ -22301,6 +21794,7 @@ "version": "3.699.0", "resolved": "https://registry.npmjs.org/@aws-sdk/lib-dynamodb/-/lib-dynamodb-3.699.0.tgz", "integrity": "sha512-k28YlOaoZ0p71SZYxOgqSRGjK+RIg8EYEoG7DoFoBeXxXX5R3Zpu07Mjl480y1enYULaLKroeKunUxd50qWNrw==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.696.0", @@ -22317,45 +21811,11 @@ "@aws-sdk/client-dynamodb": "^3.699.0" } }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/lib-dynamodb/node_modules/@aws-sdk/core": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.696.0.tgz", - "integrity": "sha512-3c9III1k03DgvRZWg8vhVmfIXPG6hAciN9MzQTzqGngzWAELZF/WONRTRQuDFixVtarQatmLHYVw/atGeA2Byw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.696.0", - "@smithy/core": "^2.5.3", - "@smithy/node-config-provider": "^3.1.11", - "@smithy/property-provider": "^3.1.9", - "@smithy/protocol-http": "^4.1.7", - "@smithy/signature-v4": "^4.2.2", - "@smithy/smithy-client": "^3.4.4", - "@smithy/types": "^3.7.1", - "@smithy/util-middleware": "^3.0.10", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/lib-dynamodb/node_modules/@aws-sdk/types": { - "version": "3.696.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.696.0.tgz", - "integrity": "sha512-9rTvUJIAj5d3//U5FDPWGJ1nFJLuWb30vugGOrWk7aNZ6y9tuA3PI7Cc9dP8WEXKVyK1vuuk8rSFP2iqXnlgrw==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.7.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, "packages/spacecat-shared-data-access/node_modules/@adobe/spacecat-shared-dynamo/node_modules/@aws-sdk/middleware-bucket-endpoint": { "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.679.0.tgz", "integrity": "sha512-5EpiPhhGgnF+uJR4DzWUk6Lx3pOn9oM6JGXxeHsiynfoBfq7vHMleq+uABHHSQS+y7XzbyZ7x8tXNQlliMwOsg==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22374,6 +21834,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.679.0.tgz", "integrity": "sha512-nYsh9PdWrF4EahTRdXHGlNud82RPc508CNGdh1lAGfPU3tNveGfMBX3PcGBtPOse3p9ebNKRWVmUc9eXSjGvHA==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22389,6 +21850,7 @@ "version": "3.682.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.682.0.tgz", "integrity": "sha512-5u1STth6iZUtAvPDO0NJVYKUX2EYKU7v84MYYaZ3O27HphRjFqDos0keL2KTnHn/KmMD68rM3yiUareWR8hnAQ==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-crypto/crc32": "5.2.0", @@ -22411,6 +21873,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.679.0.tgz", "integrity": "sha512-y176HuQ8JRY3hGX8rQzHDSbCl9P5Ny9l16z4xmaiLo+Qfte7ee4Yr3yaAKd7GFoJ3/Mhud2XZ37fR015MfYl2w==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22426,6 +21889,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.679.0.tgz", "integrity": "sha512-SA1C1D3XgoKTGxyNsOqd016ONpk46xJLWDgJUd00Zb21Ox5wYCoY6aDRKiaMRW+1VfCJdezs1Do3XLyIU9KxyA==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22440,6 +21904,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.679.0.tgz", "integrity": "sha512-0vet8InEj7nvIvGKk+ch7bEF5SyZ7Us9U7YTEgXPrBNStKeRUsgwRm0ijPWWd0a3oz2okaEwXsFl7G/vI0XiEA==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22454,6 +21919,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.679.0.tgz", "integrity": "sha512-sQoAZFsQiW/LL3DfKMYwBoGjYDEnMbA9WslWN8xneCmBAwKo6IcSksvYs23PP8XMIoBGe2I2J9BSr654XWygTQ==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22469,6 +21935,7 @@ "version": "3.685.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.685.0.tgz", "integrity": "sha512-C4w92b3A99NbghrA2Ssw6y1RbDF3I3Bgzi2Izh0pXgyIoDiX0xs9bUs/FGYLK4uepYr78DAZY8DwEpzjWIXkSA==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.679.0", @@ -22494,6 +21961,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sqs/-/middleware-sdk-sqs-3.679.0.tgz", "integrity": "sha512-GjOpT9GRMH6n3Rm9ZsRsrIbLxBPE3/L1KMkIn2uZj14uqz1pdE4ALCN9b9ZkPN+L//rsUrYqtd9gq9Hn9c2FJw==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22511,6 +21979,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.679.0.tgz", "integrity": "sha512-4GNUxXbs1M71uFHRiCAZtN0/g23ogI9YjMe5isAuYMHXwDB3MhqF7usKf954mBP6tplvN44vYlbJ84faaLrTtg==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22525,6 +21994,7 @@ "version": "3.682.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.682.0.tgz", "integrity": "sha512-7TyvYR9HdGH1/Nq0eeApUTM4izB6rExiw87khVYuJwZHr6FmvIL1FsOVFro/4WlXa0lg4LiYOm/8H8dHv+fXTg==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.679.0", @@ -22543,6 +22013,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.679.0.tgz", "integrity": "sha512-Ybx54P8Tg6KKq5ck7uwdjiKif7n/8g1x+V0V9uTjBjRWqaIgiqzXwKWoPj6NCNkE7tJNtqI4JrNxp/3S3HvmRw==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22560,6 +22031,7 @@ "version": "3.685.0", "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.685.0.tgz", "integrity": "sha512-IHLwuAZGqfUWVrNqw0ugnBa7iL8uBP4x6A7bfBDXRXWCWjUCed/1/D//0lKDHwpFkV74fGW6KoBacnWSUlXmwA==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/middleware-sdk-s3": "3.685.0", @@ -22577,6 +22049,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.679.0.tgz", "integrity": "sha512-1/+Zso/x2jqgutKixYFQEGli0FELTgah6bm7aB+m2FAWH4Hz7+iMUsazg6nSWm714sG9G3h5u42Dmpvi9X6/hA==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22596,6 +22069,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.679.0.tgz", "integrity": "sha512-NwVq8YvInxQdJ47+zz4fH3BRRLC6lL+WLkvr242PVBbUOLRyK/lkwHlfiKUoeVIMyK5NF+up6TRg71t/8Bny6Q==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@smithy/types": "^3.5.0", @@ -22609,6 +22083,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.679.0.tgz", "integrity": "sha512-CwzEbU8R8rq9bqUFryO50RFBlkfufV9UfMArHPWlo+lmsC+NlSluHQALoj6Jkq3zf5ppn1CN0c1DDLrEqdQUXg==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -22621,6 +22096,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.679.0.tgz", "integrity": "sha512-YL6s4Y/1zC45OvddvgE139fjeWSKKPgLlnfrvhVL7alNyY9n7beR4uhoDpNrt5mI6sn9qiBF17790o+xLAXjjg==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22636,6 +22112,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.679.0.tgz", "integrity": "sha512-CusSm2bTBG1kFypcsqU8COhnYc6zltobsqs3nRrvYqYaOqtMnuE46K4XTWpnzKgwDejgZGOE+WYyprtAxrPvmQ==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.679.0", @@ -22648,6 +22125,7 @@ "version": "3.682.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.682.0.tgz", "integrity": "sha512-so5s+j0gPoTS0HM4HPL+G0ajk0T6cQAg8JXzRgvyiQAxqie+zGCZAV3VuVeMNWMVbzsgZl0pYZaatPFTLG/AxA==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/middleware-user-agent": "3.682.0", @@ -22672,6 +22150,7 @@ "version": "3.679.0", "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.679.0.tgz", "integrity": "sha512-nPmhVZb39ty5bcQ7mAwtjezBcsBqTYZ9A2D9v/lE92KCLdu5RhSkPH7O71ZqbZx1mUSg9fAOxHPiG79U5VlpLQ==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@smithy/types": "^3.5.0", @@ -22685,6 +22164,7 @@ "version": "3.2.9", "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-3.2.9.tgz", "integrity": "sha512-hYNVQOqhFQ6vOpenifFME546f0GfJn2OiQ3M0FDmuUu8V/Uiwy2wej7ZXxFBNqdx0R5DZAqWM1l6VRhGz8oE6A==", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@smithy/protocol-http": "^4.1.4", @@ -22698,6 +22178,7 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "extraneous": true, "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -22817,21 +22298,6 @@ "node": ">=16.0.0" } }, - "packages/spacecat-shared-data-access/node_modules/@aws-sdk/util-dynamodb": { - "version": "3.699.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-dynamodb/-/util-dynamodb-3.699.0.tgz", - "integrity": "sha512-OamtYYyvVuEXiGUmjrKQqPhAUD1L8I1Eb7XcLcKIJKjegtadxr8Alp+wiefz/4Tandmb5erOjNJNYUCU3KfPog==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-dynamodb": "^3.699.0" - } - }, "packages/spacecat-shared-data-access/node_modules/lru-cache": { "version": "7.18.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", @@ -22843,7 +22309,7 @@ }, "packages/spacecat-shared-dynamo": { "name": "@adobe/spacecat-shared-dynamo", - "version": "1.3.51", + "version": "1.4.0", "license": "Apache-2.0", "dependencies": { "@adobe/spacecat-shared-utils": "1.22.4", @@ -29994,7 +29460,7 @@ }, "packages/spacecat-shared-utils": { "name": "@adobe/spacecat-shared-utils", - "version": "1.23.5", + "version": "1.23.6", "license": "Apache-2.0", "dependencies": { "@adobe/fetch": "4.1.11", diff --git a/packages/spacecat-shared-data-access/CHANGELOG.md b/packages/spacecat-shared-data-access/CHANGELOG.md index d228ad9d..24a51796 100755 --- a/packages/spacecat-shared-data-access/CHANGELOG.md +++ b/packages/spacecat-shared-data-access/CHANGELOG.md @@ -1,3 +1,10 @@ +# [@adobe/spacecat-shared-data-access-v1.59.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.58.2...@adobe/spacecat-shared-data-access-v1.59.0) (2024-12-11) + + +### Features + +* **data-access:** get site candidates ([#486](https://github.com/adobe/spacecat-shared/issues/486)) ([f45032d](https://github.com/adobe/spacecat-shared/commit/f45032dbcd3ea1e8cdfc2066f523b4a1690b5da4)) + # [@adobe/spacecat-shared-data-access-v1.58.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.58.1...@adobe/spacecat-shared-data-access-v1.58.2) (2024-12-07) diff --git a/packages/spacecat-shared-data-access/package.json b/packages/spacecat-shared-data-access/package.json index 80927568..e2296b01 100644 --- a/packages/spacecat-shared-data-access/package.json +++ b/packages/spacecat-shared-data-access/package.json @@ -1,6 +1,6 @@ { "name": "@adobe/spacecat-shared-data-access", - "version": "1.58.2", + "version": "1.59.0", "description": "Shared modules of the Spacecat Services - Data Access", "type": "module", "engines": { @@ -34,7 +34,7 @@ "access": "public" }, "dependencies": { - "@adobe/spacecat-shared-dynamo": "1.3.50", + "@adobe/spacecat-shared-dynamo": "1.4.0", "@adobe/spacecat-shared-utils": "1.23.1", "@aws-sdk/client-dynamodb": "3.705.0", "@aws-sdk/lib-dynamodb": "3.705.0", diff --git a/packages/spacecat-shared-data-access/src/index.d.ts b/packages/spacecat-shared-data-access/src/index.d.ts index a4673b1d..afd901ad 100644 --- a/packages/spacecat-shared-data-access/src/index.d.ts +++ b/packages/spacecat-shared-data-access/src/index.d.ts @@ -872,6 +872,7 @@ export interface DataAccess { ) => Promise; // site candidate functions + getSiteCandidates: () => Promise; getSiteCandidateByBaseURL: (baseURL: string) => Promise; upsertSiteCandidate: (siteCandidateDate: object) => Promise; siteCandidateExists: (baseURL: string) => Promise; diff --git a/packages/spacecat-shared-data-access/src/service/site-candidates/accessPatterns.js b/packages/spacecat-shared-data-access/src/service/site-candidates/accessPatterns.js index 274e76fe..65d4cc44 100644 --- a/packages/spacecat-shared-data-access/src/service/site-candidates/accessPatterns.js +++ b/packages/spacecat-shared-data-access/src/service/site-candidates/accessPatterns.js @@ -14,6 +14,21 @@ import { isObject } from '@adobe/spacecat-shared-utils'; import { createSiteCandidate } from '../../models/site-candidate.js'; import { SiteCandidateDto } from '../../dto/site-candidate.js'; +/** + * Retrieves all site candidates. + * + * @param {DynamoDbClient} dynamoClient - The DynamoDB client. + * @param {DataAccessConfig} config - The data access config. + * @returns {Promise[]>} A promise that resolves to an array of all site candidates. + */ +export const getSiteCandidates = async (dynamoClient, config) => { + const dynamoItems = await dynamoClient.scan({ + TableName: config.tableNameSites, + }); + + return dynamoItems.map((dynamoItem) => SiteCandidateDto.fromDynamoItem(dynamoItem)); +}; + /** * Checks if a site candidate exists in site candidates table using base url * @param {DynamoDbClient} dynamoClient - The DynamoDB client. diff --git a/packages/spacecat-shared-data-access/src/service/site-candidates/index.js b/packages/spacecat-shared-data-access/src/service/site-candidates/index.js index 8aff7852..1067bd99 100644 --- a/packages/spacecat-shared-data-access/src/service/site-candidates/index.js +++ b/packages/spacecat-shared-data-access/src/service/site-candidates/index.js @@ -11,6 +11,7 @@ */ import { + getSiteCandidates, getSiteCandidateByBaseURL, upsertSiteCandidate, exists, @@ -18,6 +19,10 @@ import { } from './accessPatterns.js'; export const siteCandidateFunctions = (dynamoClient, config, log) => ({ + getSiteCandidates: () => getSiteCandidates( + dynamoClient, + config, + ), getSiteCandidateByBaseURL: (baseURL) => getSiteCandidateByBaseURL( dynamoClient, config, diff --git a/packages/spacecat-shared-data-access/test/it/index.test.js b/packages/spacecat-shared-data-access/test/it/index.test.js index c0950b4f..43fefb3d 100755 --- a/packages/spacecat-shared-data-access/test/it/index.test.js +++ b/packages/spacecat-shared-data-access/test/it/index.test.js @@ -722,6 +722,11 @@ describe('Legacy Data Model IT', async () => { expect(latestAuditAfterRemoval).to.be.null; }); + it('get all site candidates', async () => { + const siteCandidates = await dataAccess.getSiteCandidates(); + expect(siteCandidates.length).to.equal(10); + }); + it('verify a previously added site candidate exists', async () => { const exists = await dataAccess.siteCandidateExists('https://example0.com'); expect(exists).to.be.true; diff --git a/packages/spacecat-shared-data-access/test/it/util/tableOperations.js b/packages/spacecat-shared-data-access/test/it/util/tableOperations.js old mode 100644 new mode 100755 diff --git a/packages/spacecat-shared-data-access/test/unit/service/index.test.js b/packages/spacecat-shared-data-access/test/unit/service/index.test.js index 87e9969b..6ef0f5e3 100644 --- a/packages/spacecat-shared-data-access/test/unit/service/index.test.js +++ b/packages/spacecat-shared-data-access/test/unit/service/index.test.js @@ -44,6 +44,7 @@ describe('Data Access Object Tests', () => { ]; const siteCandidateFunctions = [ + 'getSiteCandidates', 'getSiteCandidateByBaseURL', 'upsertSiteCandidate', 'siteCandidateExists', diff --git a/packages/spacecat-shared-data-access/test/unit/service/site-candidates/index.test.js b/packages/spacecat-shared-data-access/test/unit/service/site-candidates/index.test.js index 0b14827e..2c1b177f 100644 --- a/packages/spacecat-shared-data-access/test/unit/service/site-candidates/index.test.js +++ b/packages/spacecat-shared-data-access/test/unit/service/site-candidates/index.test.js @@ -43,6 +43,11 @@ describe('Site Candidate Access Pattern Tests', () => { const exportedFunctions = siteCandidateFunctions(mockDynamoClient, TEST_DA_CONFIG, mockLog); + it('exports upsertSiteCandidate function', () => { + expect(exportedFunctions).to.have.property('getSiteCandidates'); + expect(exportedFunctions.getSiteCandidates).to.be.a('function'); + }); + it('exports upsertSiteCandidate function', () => { expect(exportedFunctions).to.have.property('upsertSiteCandidate'); expect(exportedFunctions.upsertSiteCandidate).to.be.a('function'); @@ -63,11 +68,13 @@ describe('Site Candidate Access Pattern Tests', () => { let mockDynamoClient; let mockLog = {}; let exportedFunctions; + const siteCandidates = [{ baseURL: 'https://site1.com' }, { baseURL: 'https://site2.com' }]; beforeEach(() => { mockDynamoClient = { getItem: sinon.stub().returns(Promise.resolve(null)), putItem: sinon.stub().returns(Promise.resolve()), + scan: sinon.stub().resolves(siteCandidates), }; mockLog = { @@ -77,6 +84,13 @@ describe('Site Candidate Access Pattern Tests', () => { exportedFunctions = siteCandidateFunctions(mockDynamoClient, TEST_DA_CONFIG, mockLog); }); + it('returns all sitecandidates', async () => { + const result = await exportedFunctions.getSiteCandidates(); + + expect(result[0].getBaseURL()).to.equal(siteCandidates[0].baseURL); + expect(result[1].getBaseURL()).to.equal(siteCandidates[1].baseURL); + }); + it('returns the site candidate by base url', async () => { const siteCandidateData = { baseURL: 'https://existingsite.com', status: SITE_CANDIDATE_STATUS.PENDING }; mockDynamoClient.getItem.returns(Promise.resolve(siteCandidateData)); diff --git a/packages/spacecat-shared-dynamo/CHANGELOG.md b/packages/spacecat-shared-dynamo/CHANGELOG.md index 03218b30..28243d22 100644 --- a/packages/spacecat-shared-dynamo/CHANGELOG.md +++ b/packages/spacecat-shared-dynamo/CHANGELOG.md @@ -1,3 +1,10 @@ +# [@adobe/spacecat-shared-dynamo-v1.4.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-dynamo-v1.3.51...@adobe/spacecat-shared-dynamo-v1.4.0) (2024-12-11) + + +### Features + +* **dynamo:** scan support ([#485](https://github.com/adobe/spacecat-shared/issues/485)) ([3d32b1e](https://github.com/adobe/spacecat-shared/commit/3d32b1e8d2796e8a6a0f1c057845eb63f27eff39)) + # [@adobe/spacecat-shared-dynamo-v1.3.51](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-dynamo-v1.3.50...@adobe/spacecat-shared-dynamo-v1.3.51) (2024-12-07) diff --git a/packages/spacecat-shared-dynamo/package.json b/packages/spacecat-shared-dynamo/package.json index 62e5739b..154a8ee4 100644 --- a/packages/spacecat-shared-dynamo/package.json +++ b/packages/spacecat-shared-dynamo/package.json @@ -1,6 +1,6 @@ { "name": "@adobe/spacecat-shared-dynamo", - "version": "1.3.51", + "version": "1.4.0", "description": "Shared modules of the Spacecat Services - DynamoDB client", "type": "module", "engines": { diff --git a/packages/spacecat-shared-dynamo/src/index.d.ts b/packages/spacecat-shared-dynamo/src/index.d.ts index 8599d9c1..f6c4dbcd 100644 --- a/packages/spacecat-shared-dynamo/src/index.d.ts +++ b/packages/spacecat-shared-dynamo/src/index.d.ts @@ -11,7 +11,7 @@ */ import { DynamoDB } from '@aws-sdk/client-dynamodb'; -import { DynamoDBDocumentClient, QueryCommandInput } from '@aws-sdk/lib-dynamodb'; +import { DynamoDBDocumentClient, QueryCommandInput, ScanCommandInput } from '@aws-sdk/lib-dynamodb'; export declare interface Logger { error(message: string, ...args: unknown[]): void; @@ -24,6 +24,7 @@ export declare interface DynamoDbKey { } export declare interface DynamoDbClient { + scan(originalParams: ScanCommandInput): Promise; query(originalParams: QueryCommandInput): Promise; getItem(tableName: string, key: DynamoDbKey): Promise; putItem(tableName: string, item: object): Promise<{ message: string }>; diff --git a/packages/spacecat-shared-dynamo/src/index.js b/packages/spacecat-shared-dynamo/src/index.js index 542eaac5..a88d0f5e 100644 --- a/packages/spacecat-shared-dynamo/src/index.js +++ b/packages/spacecat-shared-dynamo/src/index.js @@ -14,6 +14,7 @@ import AWSXray from 'aws-xray-sdk'; import { DynamoDB } from '@aws-sdk/client-dynamodb'; import { DynamoDBDocument } from '@aws-sdk/lib-dynamodb'; +import scan from './modules/scan.js'; import query from './modules/query.js'; import getItem from './modules/getItem.js'; import putItem from './modules/putItem.js'; @@ -37,6 +38,7 @@ const createClient = ( }, }), ) => ({ + scan: (params) => scan(docClient, params, log), query: (params) => query(docClient, params, log), getItem: (tableName, key) => getItem(docClient, tableName, key, log), putItem: (tableName, item) => putItem(docClient, tableName, item, log), diff --git a/packages/spacecat-shared-dynamo/src/modules/scan.js b/packages/spacecat-shared-dynamo/src/modules/scan.js new file mode 100644 index 00000000..6e8a9bb9 --- /dev/null +++ b/packages/spacecat-shared-dynamo/src/modules/scan.js @@ -0,0 +1,62 @@ +/* + * Copyright 2024 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +import { performance } from 'perf_hooks'; + +/** + * Scans DynamoDB and automatically handles pagination to retrieve all items. + * + * @param {DynamoDBDocumentClient} docClient - The AWS SDK DynamoDB Document client instance. + * @param {Object} originalParams - The parameters for the DynamoDB scan. + * @param {Logger} log - The logging object, defaults to console. + * @returns {Promise} A promise that resolves to an array of items retrieved from DynamoDB. + * @throws {Error} Throws an error if the DynamoDB scan operation fails. + */ +async function scan(docClient, originalParams, log = console) { + let items = []; + const params = { ...originalParams }; + + let totalTime = 0; + let paginationCount = 0; + + try { + let data; + if (params.Limit && params.Limit <= 1) { + const result = await docClient.scan(params); + return result.Items; + } + do { + const startTime = performance.now(); + + // eslint-disable-next-line no-await-in-loop + data = await docClient.scan(params); + + const endTime = performance.now(); // End timing + const duration = endTime - startTime; + totalTime += duration; + paginationCount += 1; + + log.info(`Pagination ${paginationCount} scan time: ${duration.toFixed(2)} ms`); + + items = items.concat(data.Items); + params.ExclusiveStartKey = data.LastEvaluatedKey; + } while (data.LastEvaluatedKey); + } catch (error) { + log.error('DB Scan Error:', error); + throw error; + } + + log.info(`Total scan time: ${totalTime.toFixed(2)} ms with ${paginationCount} paginations for scan: ${JSON.stringify(params)}`); + + return items; +} + +export default scan; diff --git a/packages/spacecat-shared-dynamo/test/index.test.js b/packages/spacecat-shared-dynamo/test/index.test.js index 6999524b..2c1cc4f3 100644 --- a/packages/spacecat-shared-dynamo/test/index.test.js +++ b/packages/spacecat-shared-dynamo/test/index.test.js @@ -25,6 +25,12 @@ describe('createClient', () => { docClient = DynamoDBDocumentClient.from(dbClient); }); + it('should create a DynamoDB client with scan method', () => { + const client = createClient(console, dbClient, docClient); + expect(client).to.have.property('scan'); + expect(client.query).to.be.a('function'); + }); + it('should create a DynamoDB client with query method', () => { const client = createClient(console, dbClient, docClient); expect(client).to.have.property('query'); @@ -51,6 +57,6 @@ describe('createClient', () => { it('should use default parameters if none are provided', () => { const client = createClient(); - expect(client).to.have.all.keys('query', 'getItem', 'putItem', 'removeItem'); + expect(client).to.have.all.keys('scan', 'query', 'getItem', 'putItem', 'removeItem'); }); }); diff --git a/packages/spacecat-shared-dynamo/test/modules/scan.test.js b/packages/spacecat-shared-dynamo/test/modules/scan.test.js new file mode 100644 index 00000000..3f5f72d7 --- /dev/null +++ b/packages/spacecat-shared-dynamo/test/modules/scan.test.js @@ -0,0 +1,77 @@ +/* + * Copyright 2024 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ + +/* eslint-env mocha */ + +import { expect } from 'chai'; +import { createClient } from '../../src/index.js'; + +describe('scan', () => { + const scanParams = { + TableName: 'TestTable', + }; + const scanParamsWithLimit = { + TableName: 'TestTable', + Limit: 1, + }; + + let dynamoDbClient; + let mockDocClient; + + beforeEach(() => { + mockDocClient = { + scan: async (params) => { + if (params.Limit) { + return { Items: ['item1'] }; + } + // Check if LastEvaluatedKey is provided and simulate pagination + if (params.ExclusiveStartKey === 'key2') { + return { Items: ['item3'], LastEvaluatedKey: undefined }; + } else { + return { Items: ['item1', 'item2'], LastEvaluatedKey: 'key2' }; + } + }, + }; + + dynamoDbClient = createClient(console, undefined, mockDocClient); + }); + + it('scans items from the database', async () => { + const result = await dynamoDbClient.scan(scanParams); + expect(result).to.be.an('array'); + }); + + it('scans items from the database with pagination', async () => { + const result = await dynamoDbClient.scan(scanParams); + expect(result).to.have.lengthOf(3); + expect(result).to.deep.equal(['item1', 'item2', 'item3']); + }); + + it('scans items from the database with limit', async () => { + const result = await dynamoDbClient.scan(scanParamsWithLimit); + expect(result).to.have.lengthOf(1); + expect(result).to.deep.equal(['item1']); + }); + + it('handles errors in scan', async () => { + mockDocClient.scan = async () => { + throw new Error('Scan failed'); + }; + + try { + await dynamoDbClient.scan(scanParams); + expect.fail('scanDb did not throw as expected'); + } catch (error) { + expect(error.message).to.equal('Scan failed'); + } + }); +});