diff --git a/package-lock.json b/package-lock.json index 817b1c2..ae2f0d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,12 +11,12 @@ "dependencies": { "bottleneck": "^2.19.5", "cross-sha256": "^1.2.0", - "domain-objects": "^0.13.2", + "domain-objects": "^0.22.1", "simple-in-memory-cache": "^0.3.0", "simple-lambda-client": "^2.3.0", - "type-fns": "0.8.1", + "type-fns": "1.17.0", "uuid": "9.0.0", - "with-cache-normalization": "^1.0.3", + "with-cache-normalization": "^1.0.5", "with-simple-caching": "^0.11.3" }, "devDependencies": { @@ -1266,6 +1266,49 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@ehmpathy/error-fns": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@ehmpathy/error-fns/-/error-fns-1.3.2.tgz", + "integrity": "sha512-U8jO5pqcQvZnqZiy2Vryz8KaPu0AdT8m/xWwp5cNJu0klqcEpskUrLimAIeR6+ymkHeBfGawzUaYa5/0uBQPow==", + "hasInstallScript": true, + "dependencies": { + "type-fns": "1.16.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@ehmpathy/error-fns/node_modules/@ehmpathy/error-fns": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@ehmpathy/error-fns/-/error-fns-1.0.2.tgz", + "integrity": "sha512-v3aJIqUvD9a3drx1pyS8La+9u9WTTvNE35NksiD4Oo3VanNe8Rmue/atRHPg4nNYQ/xPv4+RoqC+OBj6cAY8VA==", + "hasInstallScript": true, + "dependencies": { + "type-fns": "0.9.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@ehmpathy/error-fns/node_modules/@ehmpathy/error-fns/node_modules/type-fns": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-0.9.0.tgz", + "integrity": "sha512-ndhY4JBIbKix0LuGA5smh/XhFFnbeudnih++WxVoGTfdrITsZe/s3qje9GZNdWwsO+YWGyQkNXwAjnWyM/dipw==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@ehmpathy/error-fns/node_modules/type-fns": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.16.0.tgz", + "integrity": "sha512-4erPa91wW979ZHH/zVI340b3s4HQGFYUMH5rBUUP0tyqPGzpZJddUpZXBliu8KF/oXEMOq3Elydb7OgdgKpung==", + "dependencies": { + "@ehmpathy/error-fns": "1.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/@eslint/eslintrc": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", @@ -4506,12 +4549,14 @@ "node_modules/@types/lodash": { "version": "4.14.196", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.196.tgz", - "integrity": "sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ==" + "integrity": "sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ==", + "dev": true }, "node_modules/@types/lodash.omit": { "version": "4.5.7", "resolved": "https://registry.npmjs.org/@types/lodash.omit/-/lodash.omit-4.5.7.tgz", "integrity": "sha512-6q6cNg0tQ6oTWjSM+BcYMBhan54P/gLqBldG4AuXd3nKr0oeVekWNS4VrNEu3BhCSDXtGapi7zjhnna0s03KpA==", + "dev": true, "dependencies": { "@types/lodash": "*" } @@ -6968,6 +7013,15 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/declapract-typescript-ehmpathy/node_modules/type-fns": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-0.8.1.tgz", + "integrity": "sha512-cfOaPy1BoEIWsUA1GXrZMxVxSqykeK5GcADT2NeYFb/VWJClfTQUiEIMGaipwamjk85t4AoABI8LPEZS2QYE3w==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/declapract/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -7355,18 +7409,17 @@ } }, "node_modules/domain-objects": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/domain-objects/-/domain-objects-0.13.2.tgz", - "integrity": "sha512-00d0Otc642zfjF2WxUkk2/zgXA+2GOQbBnUSgww5dPsRbVcFOL/Qu+XsoiwcWT35TXmL2XHB41ovFh+snZH3tw==", + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/domain-objects/-/domain-objects-0.22.1.tgz", + "integrity": "sha512-xbheK1SMLo6TJyzhv25xau0tD5Ujc/yXggiD5ebicoshD5SyknejD6Z4rJUK3kAlBdW34mBhp9A/sVjU73pryA==", "hasInstallScript": true, "dependencies": { + "@ehmpathy/error-fns": "^1.1.0", "@types/joi": "^17.2.3", - "@types/lodash.omit": "^4.5.6", "@types/yup": "^0.29.6", "change-case": "^4.1.2", "cross-sha256": "^1.2.0", - "lodash.omit": "^4.5.0", - "lodash.pick": "^4.4.0" + "type-fns": "^1.13.0" }, "engines": { "node": ">=8.0.0" @@ -12461,12 +12514,14 @@ "node_modules/lodash.omit": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", - "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==" + "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==", + "dev": true }, "node_modules/lodash.pick": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==" + "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==", + "dev": true }, "node_modules/lodash.snakecase": { "version": "4.1.1", @@ -17970,9 +18025,46 @@ } }, "node_modules/type-fns": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-0.8.1.tgz", - "integrity": "sha512-cfOaPy1BoEIWsUA1GXrZMxVxSqykeK5GcADT2NeYFb/VWJClfTQUiEIMGaipwamjk85t4AoABI8LPEZS2QYE3w==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.17.0.tgz", + "integrity": "sha512-zscRD2lGbnD2Ktyvb79cZ7R1kGm0OBnfisG3g3LdFS9C9pR8YKdXtUojDStvgQtaqyb/a77E5gYTsBY3jrZMsA==", + "hasInstallScript": true, + "dependencies": { + "@ehmpathy/error-fns": "1.0.2", + "type-fns": "1.16.0", + "uuid": "9.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/type-fns/node_modules/@ehmpathy/error-fns": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@ehmpathy/error-fns/-/error-fns-1.0.2.tgz", + "integrity": "sha512-v3aJIqUvD9a3drx1pyS8La+9u9WTTvNE35NksiD4Oo3VanNe8Rmue/atRHPg4nNYQ/xPv4+RoqC+OBj6cAY8VA==", + "hasInstallScript": true, + "dependencies": { + "type-fns": "0.9.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/type-fns/node_modules/@ehmpathy/error-fns/node_modules/type-fns": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-0.9.0.tgz", + "integrity": "sha512-ndhY4JBIbKix0LuGA5smh/XhFFnbeudnih++WxVoGTfdrITsZe/s3qje9GZNdWwsO+YWGyQkNXwAjnWyM/dipw==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/type-fns/node_modules/type-fns": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.16.0.tgz", + "integrity": "sha512-4erPa91wW979ZHH/zVI340b3s4HQGFYUMH5rBUUP0tyqPGzpZJddUpZXBliu8KF/oXEMOq3Elydb7OgdgKpung==", + "dependencies": { + "@ehmpathy/error-fns": "1.0.2" + }, "engines": { "node": ">=8.0.0" } @@ -18443,12 +18535,13 @@ } }, "node_modules/with-cache-normalization": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/with-cache-normalization/-/with-cache-normalization-1.0.3.tgz", - "integrity": "sha512-gNKH/DSB37KOv3SbblIw7oZFT2hs2fWk50ffr8h5c1RImlVBriEW+lDTfjKLfC9aa3nvgO1kPMFAusWUhgRgBQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/with-cache-normalization/-/with-cache-normalization-1.0.5.tgz", + "integrity": "sha512-7LX2xh7KCnjPiNSEfNBajA/k1zbOaRRWf84pUUXmPI3LRNnTK4Whxw1x/wXCguJh6GAMBT0l43O52QaeE4x7ew==", "hasInstallScript": true, "dependencies": { - "domain-objects": "^0.13.2", + "@ehmpathy/error-fns": "^1.3.2", + "domain-objects": "^0.22.1", "with-simple-caching": "^0.11.3" }, "engines": { @@ -18467,6 +18560,14 @@ "node": ">=8.0.0" } }, + "node_modules/with-simple-caching/node_modules/type-fns": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-0.8.1.tgz", + "integrity": "sha512-cfOaPy1BoEIWsUA1GXrZMxVxSqykeK5GcADT2NeYFb/VWJClfTQUiEIMGaipwamjk85t4AoABI8LPEZS2QYE3w==", + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -21017,6 +21118,39 @@ } } }, + "@ehmpathy/error-fns": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@ehmpathy/error-fns/-/error-fns-1.3.2.tgz", + "integrity": "sha512-U8jO5pqcQvZnqZiy2Vryz8KaPu0AdT8m/xWwp5cNJu0klqcEpskUrLimAIeR6+ymkHeBfGawzUaYa5/0uBQPow==", + "requires": { + "type-fns": "1.16.0" + }, + "dependencies": { + "@ehmpathy/error-fns": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@ehmpathy/error-fns/-/error-fns-1.0.2.tgz", + "integrity": "sha512-v3aJIqUvD9a3drx1pyS8La+9u9WTTvNE35NksiD4Oo3VanNe8Rmue/atRHPg4nNYQ/xPv4+RoqC+OBj6cAY8VA==", + "requires": { + "type-fns": "0.9.0" + }, + "dependencies": { + "type-fns": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-0.9.0.tgz", + "integrity": "sha512-ndhY4JBIbKix0LuGA5smh/XhFFnbeudnih++WxVoGTfdrITsZe/s3qje9GZNdWwsO+YWGyQkNXwAjnWyM/dipw==" + } + } + }, + "type-fns": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.16.0.tgz", + "integrity": "sha512-4erPa91wW979ZHH/zVI340b3s4HQGFYUMH5rBUUP0tyqPGzpZJddUpZXBliu8KF/oXEMOq3Elydb7OgdgKpung==", + "requires": { + "@ehmpathy/error-fns": "1.0.2" + } + } + } + }, "@eslint/eslintrc": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", @@ -23568,12 +23702,14 @@ "@types/lodash": { "version": "4.14.196", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.196.tgz", - "integrity": "sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ==" + "integrity": "sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ==", + "dev": true }, "@types/lodash.omit": { "version": "4.5.7", "resolved": "https://registry.npmjs.org/@types/lodash.omit/-/lodash.omit-4.5.7.tgz", "integrity": "sha512-6q6cNg0tQ6oTWjSM+BcYMBhan54P/gLqBldG4AuXd3nKr0oeVekWNS4VrNEu3BhCSDXtGapi7zjhnna0s03KpA==", + "dev": true, "requires": { "@types/lodash": "*" } @@ -25513,6 +25649,12 @@ "jest-message-util": "^29.4.2", "jest-util": "^29.4.2" } + }, + "type-fns": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-0.8.1.tgz", + "integrity": "sha512-cfOaPy1BoEIWsUA1GXrZMxVxSqykeK5GcADT2NeYFb/VWJClfTQUiEIMGaipwamjk85t4AoABI8LPEZS2QYE3w==", + "dev": true } } }, @@ -25698,17 +25840,16 @@ } }, "domain-objects": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/domain-objects/-/domain-objects-0.13.2.tgz", - "integrity": "sha512-00d0Otc642zfjF2WxUkk2/zgXA+2GOQbBnUSgww5dPsRbVcFOL/Qu+XsoiwcWT35TXmL2XHB41ovFh+snZH3tw==", + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/domain-objects/-/domain-objects-0.22.1.tgz", + "integrity": "sha512-xbheK1SMLo6TJyzhv25xau0tD5Ujc/yXggiD5ebicoshD5SyknejD6Z4rJUK3kAlBdW34mBhp9A/sVjU73pryA==", "requires": { + "@ehmpathy/error-fns": "^1.1.0", "@types/joi": "^17.2.3", - "@types/lodash.omit": "^4.5.6", "@types/yup": "^0.29.6", "change-case": "^4.1.2", "cross-sha256": "^1.2.0", - "lodash.omit": "^4.5.0", - "lodash.pick": "^4.4.0" + "type-fns": "^1.13.0" } }, "dot-case": { @@ -29518,12 +29659,14 @@ "lodash.omit": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", - "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==" + "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==", + "dev": true }, "lodash.pick": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==" + "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==", + "dev": true }, "lodash.snakecase": { "version": "4.1.1", @@ -33666,9 +33809,39 @@ "dev": true }, "type-fns": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-0.8.1.tgz", - "integrity": "sha512-cfOaPy1BoEIWsUA1GXrZMxVxSqykeK5GcADT2NeYFb/VWJClfTQUiEIMGaipwamjk85t4AoABI8LPEZS2QYE3w==" + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.17.0.tgz", + "integrity": "sha512-zscRD2lGbnD2Ktyvb79cZ7R1kGm0OBnfisG3g3LdFS9C9pR8YKdXtUojDStvgQtaqyb/a77E5gYTsBY3jrZMsA==", + "requires": { + "@ehmpathy/error-fns": "1.0.2", + "type-fns": "1.16.0", + "uuid": "9.0.0" + }, + "dependencies": { + "@ehmpathy/error-fns": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@ehmpathy/error-fns/-/error-fns-1.0.2.tgz", + "integrity": "sha512-v3aJIqUvD9a3drx1pyS8La+9u9WTTvNE35NksiD4Oo3VanNe8Rmue/atRHPg4nNYQ/xPv4+RoqC+OBj6cAY8VA==", + "requires": { + "type-fns": "0.9.0" + }, + "dependencies": { + "type-fns": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-0.9.0.tgz", + "integrity": "sha512-ndhY4JBIbKix0LuGA5smh/XhFFnbeudnih++WxVoGTfdrITsZe/s3qje9GZNdWwsO+YWGyQkNXwAjnWyM/dipw==" + } + } + }, + "type-fns": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.16.0.tgz", + "integrity": "sha512-4erPa91wW979ZHH/zVI340b3s4HQGFYUMH5rBUUP0tyqPGzpZJddUpZXBliu8KF/oXEMOq3Elydb7OgdgKpung==", + "requires": { + "@ehmpathy/error-fns": "1.0.2" + } + } + } }, "typed-array-buffer": { "version": "1.0.0", @@ -34044,11 +34217,12 @@ } }, "with-cache-normalization": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/with-cache-normalization/-/with-cache-normalization-1.0.3.tgz", - "integrity": "sha512-gNKH/DSB37KOv3SbblIw7oZFT2hs2fWk50ffr8h5c1RImlVBriEW+lDTfjKLfC9aa3nvgO1kPMFAusWUhgRgBQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/with-cache-normalization/-/with-cache-normalization-1.0.5.tgz", + "integrity": "sha512-7LX2xh7KCnjPiNSEfNBajA/k1zbOaRRWf84pUUXmPI3LRNnTK4Whxw1x/wXCguJh6GAMBT0l43O52QaeE4x7ew==", "requires": { - "domain-objects": "^0.13.2", + "@ehmpathy/error-fns": "^1.3.2", + "domain-objects": "^0.22.1", "with-simple-caching": "^0.11.3" } }, @@ -34059,6 +34233,13 @@ "requires": { "simple-in-memory-cache": "^0.3.0", "type-fns": "0.8.1" + }, + "dependencies": { + "type-fns": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-0.8.1.tgz", + "integrity": "sha512-cfOaPy1BoEIWsUA1GXrZMxVxSqykeK5GcADT2NeYFb/VWJClfTQUiEIMGaipwamjk85t4AoABI8LPEZS2QYE3w==" + } } }, "word-wrap": { diff --git a/package.json b/package.json index 695878a..e57d9d4 100644 --- a/package.json +++ b/package.json @@ -56,12 +56,12 @@ "dependencies": { "bottleneck": "^2.19.5", "cross-sha256": "^1.2.0", - "domain-objects": "^0.13.2", + "domain-objects": "^0.22.1", "simple-in-memory-cache": "^0.3.0", "simple-lambda-client": "^2.3.0", - "type-fns": "0.8.1", + "type-fns": "1.17.0", "uuid": "9.0.0", - "with-cache-normalization": "^1.0.3", + "with-cache-normalization": "^1.0.5", "with-simple-caching": "^0.11.3" }, "devDependencies": { diff --git a/src/logic/dependencyPointers/defineDependencyPointerKey.test.ts b/src/logic/dependencyPointers/defineDependencyPointerKey.test.ts index d906a1b..fb917f8 100644 --- a/src/logic/dependencyPointers/defineDependencyPointerKey.test.ts +++ b/src/logic/dependencyPointers/defineDependencyPointerKey.test.ts @@ -1,4 +1,4 @@ -import { DomainEntity, DomainValueObject } from 'domain-objects'; +import { DomainEntity, DomainLiteral } from 'domain-objects'; import { defineDependencyPointerKey } from './defineDependencyPointerKey'; @@ -7,7 +7,7 @@ interface ContainerLock { model: string; } class ContainerLock - extends DomainValueObject + extends DomainLiteral implements ContainerLock {} interface Container { diff --git a/src/logic/dependencyPointers/defineDependencyPointerKey.ts b/src/logic/dependencyPointers/defineDependencyPointerKey.ts index 975855b..24f7a1b 100644 --- a/src/logic/dependencyPointers/defineDependencyPointerKey.ts +++ b/src/logic/dependencyPointers/defineDependencyPointerKey.ts @@ -1,7 +1,7 @@ import { sha256 } from 'cross-sha256'; import { DomainEntity, - DomainValueObject, + DomainLiteral, getUniqueIdentifierSlug, } from 'domain-objects'; import { PickOne } from 'type-fns'; @@ -10,7 +10,7 @@ import { SerializableObject } from 'with-cache-normalization/dist/domain/Normali const serializePropertyValue = (value: SerializableObject) => { // if it is a domain object, get its unique identifier const isDomainIdentifiable = - value instanceof DomainEntity || value instanceof DomainValueObject; + value instanceof DomainEntity || value instanceof DomainLiteral; if (isDomainIdentifiable) return getUniqueIdentifierSlug(value); // otherwise, must use JSON.stringify, to avoid getting things like `[ Object: object ]`; however, must be filePathSafe, so cross-sha hash and include human part diff --git a/src/logic/dependencyPointers/getDependencyPointersInvalidatedByMutation.test.ts b/src/logic/dependencyPointers/getDependencyPointersInvalidatedByMutation.test.ts index 852a822..bb0c94b 100644 --- a/src/logic/dependencyPointers/getDependencyPointersInvalidatedByMutation.test.ts +++ b/src/logic/dependencyPointers/getDependencyPointersInvalidatedByMutation.test.ts @@ -1,4 +1,4 @@ -import { DomainEntity, DomainValueObject } from 'domain-objects'; +import { DomainEntity, DomainLiteral } from 'domain-objects'; import { SerializableObject } from 'with-cache-normalization/dist/domain/NormalizeCacheValueMethod'; import { SimpleAsyncCache } from 'with-simple-caching'; @@ -18,7 +18,7 @@ interface ContainerLock { model: string; } class ContainerLock - extends DomainValueObject + extends DomainLiteral implements ContainerLock {} interface Container { diff --git a/src/logic/dependencyPointers/getDependencyPointersInvalidatedByMutationOutputReference.test.ts b/src/logic/dependencyPointers/getDependencyPointersInvalidatedByMutationOutputReference.test.ts index 1fce8e2..785fb4b 100644 --- a/src/logic/dependencyPointers/getDependencyPointersInvalidatedByMutationOutputReference.test.ts +++ b/src/logic/dependencyPointers/getDependencyPointersInvalidatedByMutationOutputReference.test.ts @@ -1,4 +1,4 @@ -import { DomainEntity, DomainValueObject } from 'domain-objects'; +import { DomainEntity, DomainLiteral } from 'domain-objects'; import { getCacheReferenceKeyForDomainObject } from 'with-cache-normalization'; import { SerializableObject } from 'with-cache-normalization/dist/domain/NormalizeCacheValueMethod'; import { SimpleAsyncCache } from 'with-simple-caching'; @@ -10,7 +10,7 @@ interface ContainerLock { model: string; } class ContainerLock - extends DomainValueObject + extends DomainLiteral implements ContainerLock {} interface Container { @@ -51,7 +51,7 @@ describe('getDependencyPointersInvalidatedByMutationOutputReference', () => { }; beforeEach(() => jest.clearAllMocks()); - it('should invalidate nothing if it is not a domain entity', async () => { + it.only('should invalidate nothing if it is not a domain entity', async () => { const pointers = await getDependencyPointersInvalidatedByMutationOutputReference({ cache, diff --git a/src/logic/withMutationEffects.test.ts b/src/logic/withMutationEffects.test.ts index ba88128..18f4dda 100644 --- a/src/logic/withMutationEffects.test.ts +++ b/src/logic/withMutationEffects.test.ts @@ -1,4 +1,4 @@ -import { DomainEntity, DomainValueObject } from 'domain-objects'; +import { DomainEntity, DomainLiteral } from 'domain-objects'; import { SimpleAsyncCache } from 'with-simple-caching'; import { ref } from './ref/ref'; @@ -19,7 +19,7 @@ interface ContainerLock { model: string; } class ContainerLock - extends DomainValueObject + extends DomainLiteral implements ContainerLock {} interface Container { diff --git a/src/logic/withQueryCaching.integration.test.ts b/src/logic/withQueryCaching.integration.test.ts index b7a7ba7..f4ad7dd 100644 --- a/src/logic/withQueryCaching.integration.test.ts +++ b/src/logic/withQueryCaching.integration.test.ts @@ -1,4 +1,4 @@ -import { DomainEntity, DomainValueObject } from 'domain-objects'; +import { DomainEntity, DomainLiteral } from 'domain-objects'; import { getSimpleLambdaClientCacheKey } from 'simple-lambda-client'; import { createCache } from 'simple-on-disk-cache'; import { @@ -25,7 +25,7 @@ interface ContainerLock { model: string; } class ContainerLock - extends DomainValueObject + extends DomainLiteral implements ContainerLock {} interface Container { diff --git a/src/logic/withQueryCaching.ts b/src/logic/withQueryCaching.ts index 2c7f9f4..1c6c25f 100644 --- a/src/logic/withQueryCaching.ts +++ b/src/logic/withQueryCaching.ts @@ -42,6 +42,9 @@ export const withQueryCaching = ( * for example * - a query called `getPaymentByUuid({ uuid }) => Payment | null` will likely have a dependency on `{ identity: { dobj: Payment, uuid: ({ input }) => input[0].uuid } }` * - a query called `getLastPaymentOfUser({ userUuid }) => Payment` will likely have a dependency on `{ relationship: { from: { dobj: User, uuid: ({ input }) => input[0].uuid }, to: { dobj: Payment }, via: { dobj: Payment, prop: 'userUuid' } }` + * + * tips + * - you can see the dependency pointers your query will be invalidated by, by searching for logs with the message `ddcache.query.set`. if `logDebug` is set, this log will be emitted each time your query is set to the cache */ dependsOn: DomainDrivenQueryDependsOn;