diff --git a/package-lock.json b/package-lock.json index 11e29cb..fc9401e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.3", "hasInstallScript": true, "dependencies": { - "domain-objects": "^0.13.2", + "domain-objects": "^0.22.1", "with-simple-caching": "^0.11.3" }, "devDependencies": { @@ -1257,6 +1257,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", @@ -4497,12 +4540,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": "*" } @@ -7102,15 +7147,6 @@ "node": ">=8.0.0" } }, - "node_modules/declapract/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/dedent": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", @@ -7349,18 +7385,62 @@ } }, "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" + } + }, + "node_modules/domain-objects/node_modules/type-fns": { + "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/domain-objects/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/domain-objects/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/domain-objects/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" @@ -12471,12 +12551,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", @@ -18185,6 +18267,14 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -20976,6 +21066,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", @@ -23527,12 +23650,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": "*" } @@ -25439,12 +25564,6 @@ "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-0.7.0.tgz", "integrity": "sha512-yADWicFwdz/GA4KTTUQ5cWIpXd7k5/4oh9aUhN5YAaRiZCao8XK5egRrHth4uYQVFzdD8Aq4S2haZue7AFfwmw==", "dev": true - }, - "uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "dev": true } } }, @@ -25657,17 +25776,53 @@ } }, "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" + }, + "dependencies": { + "type-fns": { + "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" + } + } + } + } } }, "dot-case": { @@ -29493,12 +29648,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", @@ -33799,6 +33956,11 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" + }, "v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", diff --git a/package.json b/package.json index f013f9d..cd4ff38 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "postinstall": "[ -d .git ] && npx husky install || exit 0" }, "dependencies": { - "domain-objects": "^0.13.2", + "domain-objects": "^0.22.1", "with-simple-caching": "^0.11.3" }, "devDependencies": { diff --git a/src/logic/normalizers/normalizeDomainObjectReferences.test.ts b/src/logic/normalizers/normalizeDomainObjectReferences.test.ts index cb4ac07..b945023 100644 --- a/src/logic/normalizers/normalizeDomainObjectReferences.test.ts +++ b/src/logic/normalizers/normalizeDomainObjectReferences.test.ts @@ -1,4 +1,4 @@ -import { DomainEntity, DomainValueObject } from 'domain-objects'; +import { DomainEntity, DomainLiteral } from 'domain-objects'; import { getCacheReferenceKeyForDomainObject, @@ -20,7 +20,7 @@ interface Geocode { latitude: number; longitude: number; } -class Geocode extends DomainValueObject implements Geocode {} +class Geocode extends DomainLiteral implements Geocode {} describe('getCacheReferenceKeyForDomainObject', () => { it('should define a good looking key for an example domain entity', () => { diff --git a/src/logic/wrappers/withNormalization.test.ts b/src/logic/wrappers/withNormalization.test.ts index 58a9c47..39de959 100644 --- a/src/logic/wrappers/withNormalization.test.ts +++ b/src/logic/wrappers/withNormalization.test.ts @@ -1,6 +1,6 @@ import { DomainEntity, - DomainValueObject, + DomainLiteral, deserialize, serialize, } from 'domain-objects'; @@ -29,7 +29,7 @@ interface Geocode { latitude: number; longitude: number; } -class Geocode extends DomainValueObject implements Geocode {} +class Geocode extends DomainLiteral implements Geocode {} describe('withNormalization', () => { beforeEach(() => jest.clearAllMocks());