diff --git a/jest.config.ts b/jest.config.ts index 83a4b88..1397b8a 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -48,7 +48,7 @@ export default { // Make calling deprecated APIs throw helpful error messages // errorOnDeprecated: false, - extensionsToTreatAsEsm: ['.ts'], + // extensionsToTreatAsEsm: ['.ts'], // The default configuration for fake timers // fakeTimers: { @@ -88,9 +88,9 @@ export default { // ], // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module - moduleNameMapper: { - '^@middy$': '/node_modules/@middy', - }, + // moduleNameMapper: { + // '^@middy$': '/node_modules/@middy', + // }, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader // modulePathIgnorePatterns: [], @@ -175,17 +175,17 @@ export default { // testRunner: "jest-circus/runner", // A map from regular expressions to paths to transformers - transform: { - '^.+\\.tsx?$': [ - 'ts-jest', - { - useESM: true, - }, - ], - }, + // transform: { + // '^.+\\.tsx?$': [ + // 'ts-jest', + // { + // useESM: true, + // }, + // ], + // }, // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation - transformIgnorePatterns: ['/node_modules/(?!(@middy)/)'], + // transformIgnorePatterns: ['/node_modules/(?!(@middy)/)'], // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them // unmockedModulePathPatterns: undefined, diff --git a/package-lock.json b/package-lock.json index 8577237..fffcd57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,10 +13,9 @@ "@aws-sdk/client-dynamodb": "^3.523.0", "@aws-sdk/client-sqs": "^3.523.0", "@aws-sdk/lib-dynamodb": "^3.523.0", - "@middy/core": "^5.2.4", - "@middy/http-event-normalizer": "^5.2.4", - "@middy/http-json-body-parser": "^5.2.4", - "@middy/util": "^5.2.4", + "@middy/core": "^4.7.0", + "@middy/http-event-normalizer": "^4.7.0", + "@middy/http-json-body-parser": "^4.7.0", "@rollup/plugin-commonjs": "^25.0.4", "@rollup/plugin-node-resolve": "^15.2.1", "@rollup/plugin-terser": "^0.4.3", @@ -47,9 +46,9 @@ "@aws-sdk/client-dynamodb": "^3.523.0", "@aws-sdk/client-sqs": "^3.523.0", "@aws-sdk/lib-dynamodb": "^3.523.0", - "@middy/core": "^5.2.4", - "@middy/http-event-normalizer": "^5.2.4", - "@middy/http-json-body-parser": "^5.2.4", + "@middy/core": "^4.7.0", + "@middy/http-event-normalizer": "^4.7.0", + "@middy/http-json-body-parser": "^4.7.0", "http-status": "^1.7.4", "joi": "^17.12.2", "winston": "^3.11.0" @@ -1420,18 +1419,6 @@ "kuler": "^2.0.0" } }, - "node_modules/@datastream/core": { - "version": "0.0.35", - "resolved": "https://registry.npmjs.org/@datastream/core/-/core-0.0.35.tgz", - "integrity": "sha512-jmKFcDTYqtDy8DHPahaheg3MlLBiQboYX4jYX8oxE1tO5x7cfLl5M6bqR/o46RCEFZ3M9yMVfEEh0hy5raErEw==", - "dev": true, - "dependencies": { - "cloneable-readable": "3.0.0" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -2475,15 +2462,12 @@ } }, "node_modules/@middy/core": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@middy/core/-/core-5.2.4.tgz", - "integrity": "sha512-0FpwGAWFjGIgBrkc/7yWUaKsC+QA58IeVQWY5RJXLE+O5OOlXF2mYNgkgfRnlW7lg9I/chml3wt33yV4ZJJ8BA==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@middy/core/-/core-4.7.0.tgz", + "integrity": "sha512-yI++DmhDQ8+ugvY7+GrEnb2PF0M/6Wzbgu4Tf7QhOlhwKGDd4j6or+Ab7qYPWx+jnKf8F0tqlmh0gV4JLi0yHw==", "dev": true, - "dependencies": { - "@datastream/core": "0.0.35" - }, "engines": { - "node": ">=18" + "node": ">=16" }, "funding": { "type": "github", @@ -2491,12 +2475,12 @@ } }, "node_modules/@middy/http-event-normalizer": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@middy/http-event-normalizer/-/http-event-normalizer-5.2.4.tgz", - "integrity": "sha512-DapMjIy5oP6Ky88aXeyDQpn9z9saXb+v0Gx0WlAmvAjGfEd1RX64w6ngqwv/QoyI75krYeh4cXXox7nmrwNhqg==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@middy/http-event-normalizer/-/http-event-normalizer-4.7.0.tgz", + "integrity": "sha512-0LidQcYrZ5XZOXB5jfkXARL66kPgvoeZLC8EQoGcGz//n0QYNbR6Dtbb66vYiU2bgzPbx3N3mRmpGOLLDcnckA==", "dev": true, "engines": { - "node": ">=18" + "node": ">=16" }, "funding": { "type": "github", @@ -2504,12 +2488,15 @@ } }, "node_modules/@middy/http-json-body-parser": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@middy/http-json-body-parser/-/http-json-body-parser-5.2.4.tgz", - "integrity": "sha512-+CDr1WnbEKY/korgLnfxFSuMwgxqXM4uSodblN43Y9UzbArP+1OMpKYOnw3N2lLe26iA4CIO33V4hu8tUU5QzQ==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@middy/http-json-body-parser/-/http-json-body-parser-4.7.0.tgz", + "integrity": "sha512-OKDKAerCi3lDvSmZeV3lViKNHSPzj26nwNnVKt6Dcb0so0Llb9pDQtT5/GiEVjyuBbVteY1COz9AZlgprOw7lQ==", "dev": true, + "dependencies": { + "@middy/util": "4.7.0" + }, "engines": { - "node": ">=18" + "node": ">=16" }, "funding": { "type": "github", @@ -2517,12 +2504,12 @@ } }, "node_modules/@middy/util": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@middy/util/-/util-5.2.4.tgz", - "integrity": "sha512-1nwMlgOIBk6lT+PKFYuIYB9E+VlP8TTwthCK3snuuMsXCuaPlbZaQc4SqIWAeH/IcGP4aYjKRYUa18YJQBn6bQ==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@middy/util/-/util-4.7.0.tgz", + "integrity": "sha512-HUh0EOLGzBQjmJks4N12mmEebshtCUwyzdhk59UmAj97zzM0qn0exQvZDfbkY0pb/6b7sNnf7IpFww8Z6YxpWw==", "dev": true, "engines": { - "node": ">=18" + "node": ">=16" }, "funding": { "type": "github", @@ -4029,18 +4016,6 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dev": true, - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, "node_modules/acorn": { "version": "8.11.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", @@ -4628,26 +4603,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/bowser": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", @@ -4728,30 +4683,6 @@ "node-int64": "^0.4.0" } }, - "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -4866,31 +4797,6 @@ "node": ">=12" } }, - "node_modules/cloneable-readable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-3.0.0.tgz", - "integrity": "sha512-Lkfd9IRx1nfiBr7UHNxJSl/x7DOeUfYmxzCkxYJC2tyc/9vKgV75msgLGurGQsak/NvJDHMWcshzEXRlxfvhqg==", - "dev": true, - "dependencies": { - "readable-stream": "^4.0.0" - } - }, - "node_modules/cloneable-readable/node_modules/readable-stream": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", - "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", - "dev": true, - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -5603,24 +5509,6 @@ "node": ">=0.10.0" } }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "engines": { - "node": ">=0.8.x" - } - }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -6094,26 +5982,6 @@ "node": ">=10.17.0" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/ignore": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", @@ -8852,15 +8720,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", diff --git a/package.json b/package.json index c2d04a4..fc3c86b 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "build": "rollup -c --bundleConfigAsCjs", "clean": "rimraf coverage dist", "lint": "eslint src/**/*.ts", - "test": "NODE_OPTIONS=--experimental-vm-modules jest", - "test:coverage": "npm run test -- --coverage --silent --verbose --color", - "test:watch": "npm run test -- --watch" + "test": "jest", + "test:coverage": "jest --coverage --silent --verbose --color", + "test:watch": "jest --watch" }, "repository": { "type": "git", @@ -32,10 +32,9 @@ "@aws-sdk/client-dynamodb": "^3.523.0", "@aws-sdk/client-sqs": "^3.523.0", "@aws-sdk/lib-dynamodb": "^3.523.0", - "@middy/core": "^5.2.4", - "@middy/http-event-normalizer": "^5.2.4", - "@middy/http-json-body-parser": "^5.2.4", - "@middy/util": "^5.2.4", + "@middy/core": "^4.7.0", + "@middy/http-event-normalizer": "^4.7.0", + "@middy/http-json-body-parser": "^4.7.0", "@rollup/plugin-commonjs": "^25.0.4", "@rollup/plugin-node-resolve": "^15.2.1", "@rollup/plugin-terser": "^0.4.3", @@ -66,9 +65,9 @@ "@aws-sdk/client-dynamodb": "^3.523.0", "@aws-sdk/client-sqs": "^3.523.0", "@aws-sdk/lib-dynamodb": "^3.523.0", - "@middy/core": "^5.2.4", - "@middy/http-event-normalizer": "^5.2.4", - "@middy/http-json-body-parser": "^5.2.4", + "@middy/core": "^4.7.0", + "@middy/http-event-normalizer": "^4.7.0", + "@middy/http-json-body-parser": "^4.7.0", "http-status": "^1.7.4", "joi": "^17.12.2", "winston": "^3.11.0"